From 1f34bfa1a428d996bd4a1b964d6377f1aa2be236 Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 7 Oct 2015 18:53:56 +0200 Subject: [PATCH 001/214] TBD: generate scenario --- cmake_targets/CMakeLists.txt | 2 +- cmake_targets/epc_test/CMakeLists.template | 6 +- openair3/TEST/EPC_TEST/generate_scenario.c | 215 +++++++++++---------- openair3/TEST/EPC_TEST/generate_scenario.h | 132 +++++++++++++ 4 files changed, 252 insertions(+), 103 deletions(-) create mode 100755 openair3/TEST/EPC_TEST/generate_scenario.h diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 47a8f3a9b7..6b5c51870c 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1620,7 +1620,7 @@ add_executable(test_epc_generate_scenario ${OPENAIR_BIN_DIR}/messages_xml.h ) target_link_libraries (test_epc_generate_scenario - -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} + -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} ) diff --git a/cmake_targets/epc_test/CMakeLists.template b/cmake_targets/epc_test/CMakeLists.template index 25d94ea852..12a745b997 100644 --- a/cmake_targets/epc_test/CMakeLists.template +++ b/cmake_targets/epc_test/CMakeLists.template @@ -47,9 +47,9 @@ set ( OAI_EMU False ) set ( OAISIM False ) set ( OAI_NW_DRIVER_TYPE_ETHERNET False ) set ( OAI_NW_DRIVER_USE_NETLINK True ) -set ( OPENAIR1 False ) -set ( OPENAIR2 False ) -set ( OPENAIR_LTE F ) +set ( OPENAIR1 True ) +set ( OPENAIR2 True ) +set ( OPENAIR_LTE True ) set ( PACKAGE_NAME "epc_test" ) set ( PBS_SIM False ) set ( PDCP_USE_NETLINK True ) diff --git a/openair3/TEST/EPC_TEST/generate_scenario.c b/openair3/TEST/EPC_TEST/generate_scenario.c index bd181ce878..913533218e 100644 --- a/openair3/TEST/EPC_TEST/generate_scenario.c +++ b/openair3/TEST/EPC_TEST/generate_scenario.c @@ -39,15 +39,19 @@ #include #include #include +#include +#include +#include +#include + #include "assertions.h" -#include "enb_config.h" +#include "generate_scenario.h" #include "s1ap_eNB.h" #if defined(ENABLE_ITTI) # include "intertask_interface.h" #endif -#define EPC_TEST_SCENARIO_MAX_ENB 2 #define ENB_CONFIG_STRING_ACTIVE_ENBS "Active_eNBs" @@ -78,30 +82,53 @@ #define ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U "ENB_IPV4_ADDRESS_FOR_S1U" #define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U" +#define ENB_CONFIG_PROPERTIES_INDEX_OLD 0 +#define ENB_CONFIG_PROPERTIES_INDEX_NEW 1 -Enb_properties_array_t g_enb_properties; +Enb_properties_array_t g_enb_properties[2]; +char *g_test_dir = "."; // default value +char *g_pdml_in_basename = "trace.pdml"; // default value //------------------------------------------------------------------------------ -static void enb_config_display(void) +void generate_scenario(const char const * pdml_in_basenameP) //------------------------------------------------------------------------------ { - int i,j; + int fd_pdml_in; + if (chdir(g_test_dir) == 0) { + printf( "working in %s directory\n", g_test_dir); + fd_pdml_in = open(pdml_in_basenameP, O_RDONLY); + AssertFatal (fd_pdml_in > 0, + "Error while opening %s file in directory %s\n", + pdml_in_basenameP, + g_test_dir); + + } else { + printf("Error: chdir %s returned %s\n", g_test_dir, strerror(errno)); + exit(-1); + } +} + +//------------------------------------------------------------------------------ +static void enb_config_display(const boolean_t new_config_fileP) +//------------------------------------------------------------------------------ +{ + int i; printf( "\n----------------------------------------------------------------------\n"); - printf( " ENB CONFIG FILE CONTENT LOADED (TBC):\n"); + printf( " %s ENB CONFIG FILE CONTENT LOADED:\n", new_config_fileP == ENB_CONFIG_PROPERTIES_INDEX_OLD ? "Old":"New"); printf( "----------------------------------------------------------------------\n"); - for (i = 0; i < g_enb_properties.number; i++) { + for (i = 0; i < g_enb_properties[new_config_fileP].number; i++) { printf( "ENB CONFIG for instance %u:\n\n", i); - printf( "\teNB name: \t%s:\n",g_enb_properties.properties[i]->eNB_name); - printf( "\teNB ID: \t%"PRIu32":\n",g_enb_properties.properties[i]->eNB_id); - printf( "\tCell type: \t%s:\n",g_enb_properties.properties[i]->cell_type == CELL_MACRO_ENB ? "CELL_MACRO_ENB":"CELL_HOME_ENB"); - printf( "\tTAC: \t%"PRIu16":\n",g_enb_properties.properties[i]->tac); - printf( "\tMCC: \t%"PRIu16":\n",g_enb_properties.properties[i]->mcc); + printf( "\teNB name: \t%s\n",g_enb_properties[new_config_fileP].properties[i]->eNB_name); + printf( "\teNB ID: \t%"PRIu32"\n",g_enb_properties[new_config_fileP].properties[i]->eNB_id); + printf( "\tCell type: \t%s\n",g_enb_properties[new_config_fileP].properties[i]->cell_type == CELL_MACRO_ENB ? "CELL_MACRO_ENB":"CELL_HOME_ENB"); + printf( "\tTAC: \t%"PRIu16"\n",g_enb_properties[new_config_fileP].properties[i]->tac); + printf( "\tMCC: \t%"PRIu16"\n",g_enb_properties[new_config_fileP].properties[i]->mcc); - if (g_enb_properties.properties[i]->mnc_digit_length == 3) { - printf( "\tMNC: \t%03"PRIu16":\n",g_enb_properties.properties[i]->mnc); + if (g_enb_properties[new_config_fileP].properties[i]->mnc_digit_length == 3) { + printf( "\tMNC: \t%03"PRIu16"\n",g_enb_properties[new_config_fileP].properties[i]->mnc); } else { - printf( "\tMNC: \t%02"PRIu16":\n",g_enb_properties.properties[i]->mnc); + printf( "\tMNC: \t%02"PRIu16"\n",g_enb_properties[new_config_fileP].properties[i]->mnc); } printf( "\n--------------------------------------------------------\n"); } @@ -114,13 +141,12 @@ static void enb_config_display(void) #define libconfig_int int #endif //------------------------------------------------------------------------------ -const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) +void enb_config_init(const char const * lib_config_file_name_pP, const boolean_t new_config_fileP) //------------------------------------------------------------------------------ { config_t cfg; config_setting_t *setting = NULL; config_setting_t *subsetting = NULL; - config_setting_t *setting_srb1 = NULL; config_setting_t *setting_mme_addresses = NULL; config_setting_t *setting_mme_address = NULL; config_setting_t *setting_enb = NULL; @@ -128,8 +154,6 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) int enb_properties_index = 0; int num_enbs = 0; int num_mme_address = 0; - int num_otg_elements =0; - int num_component_carriers =0; int i = 0; int j = 0; int parse_errors = 0; @@ -139,12 +163,6 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) const char* enb_name = NULL; const char* mcc = 0; const char* mnc = 0; - const char* frame_type = NULL; - const char* prefix_type = NULL; - libconfig_int Nid_cell = 0; - - libconfig_int my_int; - char* ipv4 = NULL; char* ipv6 = NULL; char* active = NULL; @@ -157,21 +175,22 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) char* enb_ipv4_address_for_S1_MME = NULL; char *address = NULL; char *cidr = NULL; - char *astring = NULL; + + AssertFatal ((new_config_fileP == 0) || (new_config_fileP == 1), + "Bad parameter new_config_fileP %d \n", + new_config_fileP); + AssertFatal (lib_config_file_name_pP != NULL, + "Bad parameter lib_config_file_name_pP %s , must reference a valid eNB config file\n", + lib_config_file_name_pP); memset((char*)active_enb, 0 , EPC_TEST_SCENARIO_MAX_ENB * sizeof(char*)); config_init(&cfg); - if (lib_config_file_name_pP != NULL) { - /* Read the file. If there is an error, report it and exit. */ - if (! config_read_file(&cfg, lib_config_file_name_pP)) { - config_destroy(&cfg); - AssertFatal (0, "Failed to parse eNB configuration file %s!\n", lib_config_file_name_pP); - } - } else { + /* Read the file. If there is an error, report it and exit. */ + if (! config_read_file(&cfg, lib_config_file_name_pP)) { config_destroy(&cfg); - AssertFatal (0, "No eNB configuration file provided!\n"); + AssertFatal (0, "Failed to parse eNB configuration file %s!\n", lib_config_file_name_pP); } // Get list of active eNBs, (only these will be configured) @@ -195,7 +214,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) setting = config_lookup(&cfg, ENB_CONFIG_STRING_ENB_LIST); if (setting != NULL) { - enb_properties_index = 0; + enb_properties_index = g_enb_properties[new_config_fileP].number; parse_errors = 0; num_enbs = config_setting_length(setting); @@ -232,34 +251,34 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) // search if in active list for (j=0; j < num_enb_properties; j++) { if (strcmp(active_enb[j], enb_name) == 0) { - g_enb_properties.properties[enb_properties_index] = calloc(1, sizeof(Enb_properties_t)); + g_enb_properties[new_config_fileP].properties[enb_properties_index] = calloc(1, sizeof(Enb_properties_t)); - g_enb_properties.properties[enb_properties_index]->eNB_id = enb_id; + g_enb_properties[new_config_fileP].properties[enb_properties_index]->eNB_id = enb_id; if (strcmp(cell_type, "CELL_MACRO_ENB") == 0) { - g_enb_properties.properties[enb_properties_index]->cell_type = CELL_MACRO_ENB; + g_enb_properties[new_config_fileP].properties[enb_properties_index]->cell_type = CELL_MACRO_ENB; } else if (strcmp(cell_type, "CELL_HOME_ENB") == 0) { - g_enb_properties.properties[enb_properties_index]->cell_type = CELL_HOME_ENB; + g_enb_properties[new_config_fileP].properties[enb_properties_index]->cell_type = CELL_HOME_ENB; } else { AssertError (0, parse_errors ++, "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n", lib_config_file_name_pP, i, cell_type); } - g_enb_properties.properties[enb_properties_index]->eNB_name = strdup(enb_name); - g_enb_properties.properties[enb_properties_index]->tac = (uint16_t)atoi(tac); - g_enb_properties.properties[enb_properties_index]->mcc = (uint16_t)atoi(mcc); - g_enb_properties.properties[enb_properties_index]->mnc = (uint16_t)atoi(mnc); - g_enb_properties.properties[enb_properties_index]->mnc_digit_length = strlen(mnc); - AssertFatal((g_enb_properties.properties[enb_properties_index]->mnc_digit_length == 2) || - (g_enb_properties.properties[enb_properties_index]->mnc_digit_length == 3), + g_enb_properties[new_config_fileP].properties[enb_properties_index]->eNB_name = strdup(enb_name); + g_enb_properties[new_config_fileP].properties[enb_properties_index]->tac = (uint16_t)atoi(tac); + g_enb_properties[new_config_fileP].properties[enb_properties_index]->mcc = (uint16_t)atoi(mcc); + g_enb_properties[new_config_fileP].properties[enb_properties_index]->mnc = (uint16_t)atoi(mnc); + g_enb_properties[new_config_fileP].properties[enb_properties_index]->mnc_digit_length = strlen(mnc); + AssertFatal((g_enb_properties[new_config_fileP].properties[enb_properties_index]->mnc_digit_length == 2) || + (g_enb_properties[new_config_fileP].properties[enb_properties_index]->mnc_digit_length == 3), "BAD MNC DIGIT LENGTH %d", - g_enb_properties.properties[i]->mnc_digit_length); + g_enb_properties[new_config_fileP].properties[i]->mnc_digit_length); setting_mme_addresses = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_MME_IP_ADDRESS); num_mme_address = config_setting_length(setting_mme_addresses); - g_enb_properties.properties[enb_properties_index]->nb_mme = 0; + g_enb_properties[new_config_fileP].properties[enb_properties_index]->nb_mme = 0; for (j = 0; j < num_mme_address; j++) { setting_mme_address = config_setting_get_elem(setting_mme_addresses, j); @@ -277,22 +296,22 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) continue; // FIXME will prevent segfaults below, not sure what happens at function exit... } - g_enb_properties.properties[enb_properties_index]->nb_mme += 1; + g_enb_properties[new_config_fileP].properties[enb_properties_index]->nb_mme += 1; - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4_address = strdup(ipv4); - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6_address = strdup(ipv6); + g_enb_properties[new_config_fileP].properties[enb_properties_index]->mme_ip_address[j].ipv4_address = strdup(ipv4); + g_enb_properties[new_config_fileP].properties[enb_properties_index]->mme_ip_address[j].ipv6_address = strdup(ipv6); if (strcmp(active, "yes") == 0) { - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].active = 1; + g_enb_properties[new_config_fileP].properties[enb_properties_index]->mme_ip_address[j].active = 1; } // else { (calloc) if (strcmp(preference, "ipv4") == 0) { - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4 = 1; + g_enb_properties[new_config_fileP].properties[enb_properties_index]->mme_ip_address[j].ipv4 = 1; } else if (strcmp(preference, "ipv6") == 0) { - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1; + g_enb_properties[new_config_fileP].properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1; } else if (strcmp(preference, "no") == 0) { - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4 = 1; - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1; + g_enb_properties[new_config_fileP].properties[enb_properties_index]->mme_ip_address[j].ipv4 = 1; + g_enb_properties[new_config_fileP].properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1; } } @@ -314,49 +333,37 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) &enb_port_for_S1U) ) ) { - g_enb_properties.properties[enb_properties_index]->enb_interface_name_for_S1U = strdup(enb_interface_name_for_S1U); + g_enb_properties[new_config_fileP].properties[enb_properties_index]->enb_interface_name_for_S1U = strdup(enb_interface_name_for_S1U); cidr = enb_ipv4_address_for_S1U; address = strtok(cidr, "/"); if (address) { - IPV4_STR_ADDR_TO_INT_NWBO ( address, g_enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1U, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" ); + IPV4_STR_ADDR_TO_INT_NWBO ( address, g_enb_properties[new_config_fileP].properties[enb_properties_index]->enb_ipv4_address_for_S1U, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" ); } - g_enb_properties.properties[enb_properties_index]->enb_port_for_S1U = enb_port_for_S1U; + g_enb_properties[new_config_fileP].properties[enb_properties_index]->enb_port_for_S1U = enb_port_for_S1U; - g_enb_properties.properties[enb_properties_index]->enb_interface_name_for_S1_MME = strdup(enb_interface_name_for_S1_MME); + g_enb_properties[new_config_fileP].properties[enb_properties_index]->enb_interface_name_for_S1_MME = strdup(enb_interface_name_for_S1_MME); cidr = enb_ipv4_address_for_S1_MME; address = strtok(cidr, "/"); if (address) { - IPV4_STR_ADDR_TO_INT_NWBO ( address, g_enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1_MME, "BAD IP ADDRESS FORMAT FOR eNB S1_MME !\n" ); + IPV4_STR_ADDR_TO_INT_NWBO ( address, g_enb_properties[new_config_fileP].properties[enb_properties_index]->enb_ipv4_address_for_S1_MME, "BAD IP ADDRESS FORMAT FOR eNB S1_MME !\n" ); } } - } - } - } - } - } + } // if (subsetting != NULL) { + enb_properties_index += 1; + } // if (strcmp(active_enb[j], enb_name) == 0) + } // for (j=0; j < num_enb_properties; j++) + } // for (i = 0; i < num_enbs; i++) + } // if (setting != NULL) { - g_enb_properties.number = num_enb_properties; + g_enb_properties[new_config_fileP].number += num_enb_properties; - AssertError (enb_properties_index == num_enb_properties, parse_errors ++, - "Failed to parse eNB configuration file %s, mismatch between %u active eNBs and %u corresponding defined eNBs !\n", - lib_config_file_name_pP, num_enb_properties, enb_properties_index); AssertFatal (parse_errors == 0, "Failed to parse eNB configuration file %s, found %d error%s !\n", lib_config_file_name_pP, parse_errors, parse_errors > 1 ? "s" : ""); - enb_config_display(); - return &g_enb_properties; - -} - -//------------------------------------------------------------------------------ -const Enb_properties_array_t *enb_config_get(void) -//------------------------------------------------------------------------------ -{ - return &g_enb_properties; } @@ -370,12 +377,12 @@ static void usage ( fprintf (stdout, "Usage: %s [options]\n\n", argv[0]); fprintf (stdout, "Available options:\n"); fprintf (stdout, "\t--help, -h Print this help and return\n"); - fprintf (stdout, "\t--test-dir \n"); - fprintf (stdout, " Set the test directory where pdml and original enb(s) config files are located\n"); - fprintf (stdout, " See README in openair3/TEST/EPC_TEST\n"); fprintf (stdout, "\t--new-enb-conf-file \n"); fprintf (stdout, " Provide an updated eNB config file for generating a copy of the original test\n"); - fprintf (stdout, " This option is set as many times as there are some eNB in the original test\n"); + fprintf (stdout, " This option is set as many times as there are some eNB config files in the original test\n"); + fprintf (stdout, "\t--old-enb-conf-file \n"); + fprintf (stdout, " Provide the old eNB config file for generating a copy of the original test\n"); + fprintf (stdout, " This option is set as many times as there are some eNB config files in the original test\n"); } @@ -388,18 +395,19 @@ config_parse_opt_line ( { int option; char *enb_config_file_name = NULL; - char *test_dir = NULL; enum long_option_e { LONG_OPTION_START = 0x100, /* Start after regular single char options */ - LONG_OPTION_TEST_DIR, LONG_OPTION_NEW_ENB_CONF_FILE, + LONG_OPTION_OLD_ENB_CONF_FILE, + LONG_OPTION_PDML_IN_BASENAME, LONG_OPTION_HELP, }; static struct option long_options[] = { - {"test-dir", required_argument, 0, LONG_OPTION_TEST_DIR}, + {"old-enb-conf-file", required_argument, 0, LONG_OPTION_OLD_ENB_CONF_FILE}, {"new-enb-conf-file", required_argument, 0, LONG_OPTION_NEW_ENB_CONF_FILE}, + {"pdml_in_basename", required_argument, 0, LONG_OPTION_PDML_IN_BASENAME}, {"help", required_argument, 0, LONG_OPTION_HELP}, {NULL, 0, NULL, 0} }; @@ -407,31 +415,37 @@ config_parse_opt_line ( /* * Parsing command line */ - while ((option = getopt_long (argc, argv, "h", long_options, NULL)) != -1) { + while ((option = getopt_long (argc, argv, "hp:n:o", long_options, NULL)) != -1) { switch (option) { - case LONG_OPTION_TEST_DIR: + case LONG_OPTION_OLD_ENB_CONF_FILE: + case 'o': if (optarg) { - test_dir = strdup(optarg); - printf("TEST DIRECTORY IS %s\n", test_dir); + enb_config_file_name = optarg; + printf("Old eNB config file name is %s\n", enb_config_file_name); + enb_config_init(enb_config_file_name, ENB_CONFIG_PROPERTIES_INDEX_OLD); + g_test_dir = strdup(dirname(enb_config_file_name)); } break; case LONG_OPTION_NEW_ENB_CONF_FILE: + case 'n': if (optarg) { - enb_config_file_name = strdup(optarg); - printf("eNB config file name is %s\n", enb_config_file_name); - enb_config_init(enb_config_file_name); + enb_config_file_name = optarg; + printf("New eNB config file name is %s\n", enb_config_file_name); + enb_config_init(enb_config_file_name, ENB_CONFIG_PROPERTIES_INDEX_NEW); } break; + case LONG_OPTION_PDML_IN_BASENAME: + case 'p': if (optarg) { - test_dir = strdup(optarg); - printf("TEST DIRECTORY IS %s\n", test_dir); + g_pdml_in_basename = strdup(optarg); + printf("PDML input file name is %s\n", g_pdml_in_basename); } break; case LONG_OPTION_HELP: - case 'h': /* Fall through */ + case 'h': default: usage (argc, argv); exit (0); @@ -444,8 +458,11 @@ config_parse_opt_line ( int main( int argc, char **argv ) //------------------------------------------------------------------------------ { - memset((char*) &g_enb_properties, 0 , sizeof(g_enb_properties)); + memset((char*) &g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_OLD], 0 , sizeof(g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_OLD])); + memset((char*) &g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_NEW], 0 , sizeof(g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_NEW])); config_parse_opt_line (argc, argv); //Command-line options - + enb_config_display(ENB_CONFIG_PROPERTIES_INDEX_OLD); + enb_config_display(ENB_CONFIG_PROPERTIES_INDEX_NEW); + generate_scenario(g_pdml_in_basename); return 0; } diff --git a/openair3/TEST/EPC_TEST/generate_scenario.h b/openair3/TEST/EPC_TEST/generate_scenario.h new file mode 100755 index 0000000000..c3b42ea253 --- /dev/null +++ b/openair3/TEST/EPC_TEST/generate_scenario.h @@ -0,0 +1,132 @@ +/******************************************************************************* + OpenAirInterface + Copyright(c) 1999 - 2014 Eurecom + + OpenAirInterface is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + + OpenAirInterface is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenAirInterface.The full GNU General Public License is + included in this distribution in the file called "COPYING". If not, + see . + + Contact Information + OpenAirInterface Admin: openair_admin@eurecom.fr + OpenAirInterface Tech : openair_tech@eurecom.fr + OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + + Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + +*******************************************************************************/ + +/* + generate_scenario.h + ------------------- + AUTHOR : Lionel GAUTHIER + COMPANY : EURECOM + EMAIL : Lionel.Gauthier@eurecom.fr +*/ + +#ifndef GENERATE_SCENARIO_H_ +#define GENERATE_SCENARIO_H_ +#include +#include +#include + +#include "commonDef.h" +#include "platform_types.h" +#include "platform_constants.h" +#include "PHY/impl_defs_lte.h" +#include "s1ap_messages_types.h" +#ifdef CMAKER +#include "SystemInformationBlockType2.h" +#else +#include "RRC/LITE/MESSAGES/SystemInformationBlockType2.h" +#endif + +#define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\ + struct in_addr inp;\ + if ( inet_aton(AdDr_StR, &inp ) < 0 ) {\ + AssertFatal (0, MeSsAgE);\ + } else {\ + NwBo = inp.s_addr;\ + }\ + } while (0); + +/** @defgroup _enb_app ENB APP + * @ingroup _oai2 + * @{ + */ + +// Hard to find a defined value for max enb... +#define EPC_TEST_SCENARIO_MAX_ENB 4 + + +typedef struct mme_ip_address_s { + unsigned ipv4:1; + unsigned ipv6:1; + unsigned active:1; + char *ipv4_address; + char *ipv6_address; +} mme_ip_address_t; + +typedef struct Enb_properties_s { + /* Unique eNB_id to identify the eNB within EPC. + * For macro eNB ids this field should be 20 bits long. + * For home eNB ids this field should be 28 bits long. + */ + uint32_t eNB_id; + + /* The type of the cell */ + enum cell_type_e cell_type; + + /* Optional name for the cell + * NOTE: the name can be NULL (i.e no name) and will be cropped to 150 + * characters. + */ + char *eNB_name; + + /* Tracking area code */ + uint16_t tac; + + /* Mobile Country Code + * Mobile Network Code + */ + uint16_t mcc; + uint16_t mnc; + uint8_t mnc_digit_length; + + /* Nb of MME to connect to */ + uint8_t nb_mme; + /* List of MME to connect to */ + mme_ip_address_t mme_ip_address[S1AP_MAX_NB_MME_IP_ADDRESS]; + + int sctp_in_streams; + int sctp_out_streams; + + char *enb_interface_name_for_S1U; + in_addr_t enb_ipv4_address_for_S1U; + tcp_udp_port_t enb_port_for_S1U; + + char *enb_interface_name_for_S1_MME; + in_addr_t enb_ipv4_address_for_S1_MME; + +} Enb_properties_t; + +typedef struct Enb_properties_array_s { + int number; + Enb_properties_t *properties[EPC_TEST_SCENARIO_MAX_ENB]; +} Enb_properties_array_t; + +void enb_config_init(const char const * lib_config_file_name_pP, const boolean_t new_config_fileP); + +#endif /* ENB_CONFIG_H_ */ +/** @} */ From 5d4de8bd2d603d651f6eb797b1bb7a48247e9ef9 Mon Sep 17 00:00:00 2001 From: gauthier Date: Thu, 8 Oct 2015 15:21:56 +0200 Subject: [PATCH 002/214] switch branch --- cmake_targets/CMakeLists.txt | 5 ++- openair3/TEST/EPC_TEST/generate_scenario.c | 46 +++++++++++++++++----- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 6b5c51870c..6b9dae6b04 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1332,6 +1332,9 @@ include(FindPkgConfig) pkg_search_module(LIBXML2 libxml-2.0 REQUIRED) include_directories(${LIBXML2_INCLUDE_DIRS}) +pkg_search_module(LIBXSLT libxslt REQUIRED) +include_directories(${LIBXSLT_INCLUDE_DIRS}) + pkg_search_module(OPENSSL openssl REQUIRED) include_directories(${OPENSSL_INCLUDE_DIRS}) @@ -1620,7 +1623,7 @@ add_executable(test_epc_generate_scenario ${OPENAIR_BIN_DIR}/messages_xml.h ) target_link_libraries (test_epc_generate_scenario - -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} + -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} ) diff --git a/openair3/TEST/EPC_TEST/generate_scenario.c b/openair3/TEST/EPC_TEST/generate_scenario.c index 913533218e..6843766f95 100644 --- a/openair3/TEST/EPC_TEST/generate_scenario.c +++ b/openair3/TEST/EPC_TEST/generate_scenario.c @@ -43,15 +43,22 @@ #include #include #include - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "assertions.h" #include "generate_scenario.h" #include "s1ap_eNB.h" -#if defined(ENABLE_ITTI) -# include "intertask_interface.h" -#endif - +#include "intertask_interface.h" #define ENB_CONFIG_STRING_ACTIVE_ENBS "Active_eNBs" @@ -85,23 +92,44 @@ #define ENB_CONFIG_PROPERTIES_INDEX_OLD 0 #define ENB_CONFIG_PROPERTIES_INDEX_NEW 1 +#define ENB_CONFIG_MAX_XSLT_PARAMS 64 + Enb_properties_array_t g_enb_properties[2]; char *g_test_dir = "."; // default value char *g_pdml_in_basename = "trace.pdml"; // default value - +extern int xmlLoadExtDtdDefaultValue; //------------------------------------------------------------------------------ void generate_scenario(const char const * pdml_in_basenameP) //------------------------------------------------------------------------------ { - int fd_pdml_in; + //int fd_pdml_in; + xsltStylesheetPtr cur = NULL; + xmlDocPtr doc, res; + const char *params[ENB_CONFIG_MAX_XSLT_PARAMS]; + int nb_params = 0; + if (chdir(g_test_dir) == 0) { printf( "working in %s directory\n", g_test_dir); - fd_pdml_in = open(pdml_in_basenameP, O_RDONLY); + /*fd_pdml_in = open(pdml_in_basenameP, O_RDONLY); AssertFatal (fd_pdml_in > 0, "Error while opening %s file in directory %s\n", pdml_in_basenameP, - g_test_dir); + g_test_dir);*/ + params[nb_params] = NULL; + xmlSubstituteEntitiesDefault(1); + xmlLoadExtDtdDefaultValue = 1; + cur = xsltParseStylesheetFile("enb_config.xsl"); + doc = xmlParseFile(pdml_in_basenameP); + res = xsltApplyStylesheet(cur, doc, params); + xsltSaveResultToFile(stdout, res, cur); + + xsltFreeStylesheet(cur); + xmlFreeDoc(res); + xmlFreeDoc(doc); + + xsltCleanupGlobals(); + xmlCleanupParser(); } else { printf("Error: chdir %s returned %s\n", g_test_dir, strerror(errno)); exit(-1); From 13a409b4e69d469cc6191bb3e5ebfefc0304b27a Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 16 Oct 2015 02:20:52 -0700 Subject: [PATCH 003/214] brought in AVX2 modifications from svn repository on openair1/PHY/TOOLS/lte-dfts.c --- openair1/PHY/TOOLS/lte_dfts.c | 2773 ++++++++++++++++++++++++++++++--- 1 file changed, 2589 insertions(+), 184 deletions(-) diff --git a/openair1/PHY/TOOLS/lte_dfts.c b/openair1/PHY/TOOLS/lte_dfts.c index c031d5d384..f1103e4478 100644 --- a/openair1/PHY/TOOLS/lte_dfts.c +++ b/openair1/PHY/TOOLS/lte_dfts.c @@ -5,7 +5,7 @@ OpenAirInterface is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + (at your option) any lat_er version. OpenAirInterface is distributed in the hope that it will be useful, @@ -51,15 +51,15 @@ #include "PHY/sse_intrin.h" #define print_shorts(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7]) +#define print_shorts256(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7],(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15]) + #define print_ints(s,x) printf("%s %d %d %d %d\n",s,(x)[0],(x)[1],(x)[2],(x)[3]) -#ifdef AVX2 -static int16_t conjugatedft2[16] __attribute__((aligned(32))) = {1,1,1,1,1,1,1,1,-1,1,-1,1,-1,1,-1,1,-1,1}; -#endif -static int16_t conjugatedft[8] __attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1} ; +static int16_t conjugatedft[32] __attribute__((aligned(32))) = {-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1}; -static short reflip[8] __attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1}; + +static int16_t reflip[32] __attribute__((aligned(32))) = {1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1}; #if defined(__x86_64__) || defined(__i386__) static inline void cmac(__m128i a,__m128i b, __m128i *re32, __m128i *im32) __attribute__((always_inline)); @@ -101,8 +101,43 @@ static inline void cmacc(__m128i a,__m128i b, __m128i *re32, __m128i *im32) *im32 = _mm_add_epi32(*im32,cmac_tmp_im32); } +#ifdef __AVX2__ +static inline void cmac_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) __attribute__((always_inline)); +static inline void cmac_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) +{ + + __m256i cmac_tmp,cmac_tmp_re32,cmac_tmp_im32; + __m256i imshuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,19,18,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + cmac_tmp = _mm256_sign_epi16(b,*(__m256i*)reflip); + cmac_tmp_re32 = _mm256_madd_epi16(a,cmac_tmp); + + cmac_tmp = _mm256_shuffle_epi8(b,imshuffle); + cmac_tmp_im32 = _mm256_madd_epi16(cmac_tmp,a); + + *re32 = _mm256_add_epi32(*re32,cmac_tmp_re32); + *im32 = _mm256_add_epi32(*im32,cmac_tmp_im32); +} + +static inline void cmacc_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) __attribute__((always_inline)); +static inline void cmacc_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) +{ + + __m256i cmac_tmp,cmac_tmp_re32,cmac_tmp_im32; + __m256i imshuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,19,18,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + cmac_tmp_re32 = _mm256_madd_epi16(a,b); + cmac_tmp = _mm256_sign_epi16(b,*(__m256i*)reflip); + cmac_tmp = _mm256_shuffle_epi8(b,imshuffle); + cmac_tmp_im32 = _mm256_madd_epi16(cmac_tmp,a); + + *re32 = _mm256_add_epi32(*re32,cmac_tmp_re32); + *im32 = _mm256_add_epi32(*im32,cmac_tmp_im32); +} + +#endif static inline void cmult(__m128i a,__m128i b, __m128i *re32, __m128i *im32) __attribute__((always_inline)); @@ -120,6 +155,24 @@ static inline void cmult(__m128i a,__m128i b, __m128i *re32, __m128i *im32) } +#ifdef __AVX2__ +static inline void cmult_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) __attribute__((always_inline)); + +static inline void cmult_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) +{ + + register __m256i mmtmpb; + __m256i const perm_mask = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + mmtmpb = _mm256_sign_epi16(b,*(__m256i*)reflip); + *re32 = _mm256_madd_epi16(a,mmtmpb); + mmtmpb = _mm256_shuffle_epi8(b,perm_mask); + *im32 = _mm256_madd_epi16(a,mmtmpb); + +} + +#endif + static inline void cmultc(__m128i a,__m128i b, __m128i *re32, __m128i *im32) __attribute__((always_inline)); static inline void cmultc(__m128i a,__m128i b, __m128i *re32, __m128i *im32) @@ -134,6 +187,23 @@ static inline void cmultc(__m128i a,__m128i b, __m128i *re32, __m128i *im32) } +#ifdef __AVX2__ +static inline void cmultc_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) __attribute__((always_inline)); + +static inline void cmultc_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) +{ + + register __m256i mmtmpb; + __m256i const perm_mask = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + *re32 = _mm256_madd_epi16(a,b); + mmtmpb = _mm256_sign_epi16(b,*(__m256i*)reflip); + mmtmpb = _mm256_shuffle_epi8(mmtmpb,perm_mask); + *im32 = _mm256_madd_epi16(a,mmtmpb); + +} + +#endif static inline __m128i cpack(__m128i xre,__m128i xim) __attribute__((always_inline)); @@ -148,6 +218,21 @@ static inline __m128i cpack(__m128i xre,__m128i xim) } +#ifdef __AVX2__ +static inline __m256i cpack_256(__m256i xre,__m256i xim) __attribute__((always_inline)); + +static inline __m256i cpack_256(__m256i xre,__m256i xim) +{ + + register __m256i cpack_tmp1,cpack_tmp2; + + cpack_tmp1 = _mm256_unpacklo_epi32(xre,xim); + cpack_tmp2 = _mm256_unpackhi_epi32(xre,xim); + return(_mm256_packs_epi32(_mm256_srai_epi32(cpack_tmp1,15),_mm256_srai_epi32(cpack_tmp2,15))); + +} + +#endif static inline void packed_cmult(__m128i a,__m128i b, __m128i *c) __attribute__((always_inline)); @@ -160,6 +245,18 @@ static inline void packed_cmult(__m128i a,__m128i b, __m128i *c) } +#ifdef __AVX2__ +static inline void packed_cmult_256(__m256i a,__m256i b, __m256i *c) __attribute__((always_inline)); + +static inline void packed_cmult_256(__m256i a,__m256i b, __m256i *c) +{ + + __m256i cre,cim; + cmult_256(a,b,&cre,&cim); + *c = cpack_256(cre,cim); + +} +#endif static inline void packed_cmultc(__m128i a,__m128i b, __m128i *c) __attribute__((always_inline)); @@ -173,6 +270,20 @@ static inline void packed_cmultc(__m128i a,__m128i b, __m128i *c) } +#ifdef __AVX2__ +static inline void packed_cmultc_256(__m256i a,__m256i b, __m256i *c) __attribute__((always_inline)); + +static inline void packed_cmultc_256(__m256i a,__m256i b, __m256i *c) +{ + + __m256i cre,cim; + + cmultc_256(a,b,&cre,&cim); + *c = cpack_256(cre,cim); + +} +#endif + static inline __m128i packed_cmult2(__m128i a,__m128i b,__m128i b2) __attribute__((always_inline)); static inline __m128i packed_cmult2(__m128i a,__m128i b,__m128i b2) @@ -188,6 +299,23 @@ static inline __m128i packed_cmult2(__m128i a,__m128i b,__m128i b2) } +#ifdef __AVX2__ +static inline __m256i packed_cmult2_256(__m256i a,__m256i b,__m256i b2) __attribute__((always_inline)); + +static inline __m256i packed_cmult2_256(__m256i a,__m256i b,__m256i b2) +{ + + + register __m256i cre,cim; + + cre = _mm256_madd_epi16(a,b); + cim = _mm256_madd_epi16(a,b2); + + return(cpack_256(cre,cim)); + +} +#endif + #elif defined (__arm__) static inline void cmac(int16x8_t a,int16x8_t b, int32x4_t *re32, int32x4_t *im32) __attribute__((always_inline)); static inline void cmac(int16x8_t a,int16x8_t b, int32x4_t *re32, int32x4_t *im32) @@ -344,15 +472,15 @@ static inline int16x8_t packed_cmult2(int16x8_t a,int16x8_t b, int16x8_t b2) #endif -static int16_t W0s[8]__attribute__((aligned(16))) = {32767,0,32767,0,32767,0,32767,0}; +static int16_t W0s[8]__attribute__((aligned(32))) = {32767,0,32767,0,32767,0,32767,0}; -static int16_t W13s[8]__attribute__((aligned(16))) = {-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378}; -static int16_t W23s[8]__attribute__((aligned(16))) = {-16384,28378,-16384,28378,-16384,28378,-16384,28378}; +static int16_t W13s[8]__attribute__((aligned(32))) = {-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378}; +static int16_t W23s[8]__attribute__((aligned(32))) = {-16384,28378,-16384,28378,-16384,28378,-16384,28378}; -static int16_t W15s[8]__attribute__((aligned(16))) = {10126,-31163,10126,-31163,10126,-31163,10126,-31163}; -static int16_t W25s[8]__attribute__((aligned(16))) = {-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260}; -static int16_t W35s[8]__attribute__((aligned(16))) = {-26510,19260,-26510,19260,-26510,19260,-26510,19260}; -static int16_t W45s[8]__attribute__((aligned(16))) = {10126,31163,10126,31163,10126,31163,10126,31163}; +static int16_t W15s[8]__attribute__((aligned(32))) = {10126,-31163,10126,-31163,10126,-31163,10126,-31163}; +static int16_t W25s[8]__attribute__((aligned(32))) = {-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260}; +static int16_t W35s[8]__attribute__((aligned(32))) = {-26510,19260,-26510,19260,-26510,19260,-26510,19260}; +static int16_t W45s[8]__attribute__((aligned(32))) = {10126,31163,10126,31163,10126,31163,10126,31163}; #if defined(__x86_64__) || defined(__i386__) __m128i *W0 = (__m128i *)W0s; @@ -362,6 +490,17 @@ __m128i *W15 = (__m128i *)W15s; __m128i *W25 = (__m128i *)W25s; __m128i *W35 = (__m128i *)W35s; __m128i *W45 = (__m128i *)W45s; + +#ifdef __AVX2__ +__m256i *W0_256 = (__m256i *)W0s; +__m256i *W13_256 = (__m256i *)W13s; +__m256i *W23_256 = (__m256i *)W23s; +__m256i *W15_256 = (__m256i *)W15s; +__m256i *W25_256 = (__m256i *)W25s; +__m256i *W35_256 = (__m256i *)W35s; +__m256i *W45_256 = (__m256i *)W45s; +#endif + #elif defined(__arm__) int16x8_t *W0 = (int16x8_t *)W0s; int16x8_t *W13 = (int16x8_t *)W13s; @@ -417,6 +556,36 @@ static inline void bfly2(__m128i *x0, __m128i *x1,__m128i *y0, __m128i *y1,__m12 *y1 = _mm_packs_epi32(bfly2_tmp1,bfly2_tmp2); } +#ifdef __AVX2__ + +static inline void bfly2_256(__m256i *x0, __m256i *x1,__m256i *y0, __m256i *y1,__m256i *tw)__attribute__((always_inline)); + +static inline void bfly2_256(__m256i *x0, __m256i *x1,__m256i *y0, __m256i *y1,__m256i *tw) +{ + + __m256i x0r_2,x0i_2,x1r_2,x1i_2,dy0r,dy1r,dy0i,dy1i; + __m256i bfly2_tmp1,bfly2_tmp2; + + cmult_256(*(x0),*(W0_256),&x0r_2,&x0i_2); + cmult_256(*(x1),*(tw),&x1r_2,&x1i_2); + + dy0r = _mm256_srai_epi32(_mm256_add_epi32(x0r_2,x1r_2),15); + dy1r = _mm256_srai_epi32(_mm256_sub_epi32(x0r_2,x1r_2),15); + dy0i = _mm256_srai_epi32(_mm256_add_epi32(x0i_2,x1i_2),15); + // printf("y0i %d\n",((int16_t *)y0i)[0]); + dy1i = _mm256_srai_epi32(_mm256_sub_epi32(x0i_2,x1i_2),15); + + bfly2_tmp1 = _mm256_unpacklo_epi32(dy0r,dy0i); + bfly2_tmp2 = _mm256_unpackhi_epi32(dy0r,dy0i); + *y0 = _mm256_packs_epi32(bfly2_tmp1,bfly2_tmp2); + + bfly2_tmp1 = _mm256_unpacklo_epi32(dy1r,dy1i); + bfly2_tmp2 = _mm256_unpackhi_epi32(dy1r,dy1i); + *y1 = _mm256_packs_epi32(bfly2_tmp1,bfly2_tmp2); +} + +#endif + #elif defined(__arm__) static inline void bfly2(int16x8_t *x0, int16x8_t *x1,int16x8_t *y0, int16x8_t *y1,int16x8_t *tw)__attribute__((always_inline)); @@ -466,37 +635,67 @@ static inline void bfly2_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x #endif #if defined(__x86_64__) || defined(__i386__) + + + static inline void bfly2_16(__m128i *x0, __m128i *x1, __m128i *y0, __m128i *y1, __m128i *tw, __m128i *twb)__attribute__((always_inline)); static inline void bfly2_16(__m128i *x0, __m128i *x1, __m128i *y0, __m128i *y1, __m128i *tw, __m128i *twb) { - register __m128i x1t; + // register __m128i x1t; + __m128i x1t; x1t = packed_cmult2(*(x1),*(tw),*(twb)); - + /* + print_shorts("x0",(int16_t*)x0); + print_shorts("x1",(int16_t*)x1); + print_shorts("tw",(int16_t*)tw); + print_shorts("twb",(int16_t*)twb); + print_shorts("x1t",(int16_t*)&x1t);*/ *y0 = _mm_adds_epi16(*x0,x1t); *y1 = _mm_subs_epi16(*x0,x1t); - + /* print_shorts("y0",(int16_t*)y0); + print_shorts("y1",(int16_t*)y1);*/ } +#ifdef __AVX2__ + +static inline void bfly2_16_256(__m256i *x0, __m256i *x1, __m256i *y0, __m256i *y1, __m256i *tw, __m256i *twb)__attribute__((always_inline)); + +static inline void bfly2_16_256(__m256i *x0, __m256i *x1, __m256i *y0, __m256i *y1, __m256i *tw, __m256i *twb) +{ + + // register __m256i x1t; + __m256i x1t; + + x1t = packed_cmult2_256(*(x1),*(tw),*(twb)); + + print_shorts256("x0",(int16_t*)x0); + print_shorts256("x1",(int16_t*)x1); + print_shorts256("tw",(int16_t*)tw); + print_shorts256("twb",(int16_t*)twb); + print_shorts256("x1t",(int16_t*)&x1t); + *y0 = _mm256_adds_epi16(*x0,x1t); + *y1 = _mm256_subs_epi16(*x0,x1t); + + print_shorts256("y0",(int16_t*)y0); + print_shorts256("y1",(int16_t*)y1); +} +#endif + #elif defined(__arm__) -static inline void bfly2_16(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8_t *y1, int16x8_t *tw, int16x8_t *twb)__attribute__((always_inline)); +static inline void bfly2_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8_t *y1)__attribute__((always_inline)); -static inline void bfly2_16(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8_t *y1, int16x8_t *tw, int16x8_t *twb) +static inline void bfly2_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8_t *y1) { - register int16x8_t x1t; - - x1t = packed_cmult2(*(x1),*(tw),*(twb)); - - *y0 = vqaddq_s16(*x0,x1t); - *y1 = vqsubq_s16(*x0,x1t); + *y0 = vqaddq_s16(*x0,*x1); + *y1 = vqsubq_s16(*x0,*x1); } - #endif #if defined(__x86_64__) || defined(__i386__) @@ -525,6 +724,35 @@ static inline void ibfly2(__m128i *x0, __m128i *x1,__m128i *y0, __m128i *y1,__m1 bfly2_tmp2 = _mm_unpackhi_epi32(dy1r,dy1i); *y1 = _mm_packs_epi32(bfly2_tmp1,bfly2_tmp2); } + +#ifdef __AVX2__ +static inline void ibfly2_256(__m256i *x0, __m256i *x1,__m256i *y0, __m256i *y1,__m256i *tw)__attribute__((always_inline)); + +static inline void ibfly2_256(__m256i *x0, __m256i *x1,__m256i *y0, __m256i *y1,__m256i *tw) +{ + + __m256i x0r_2,x0i_2,x1r_2,x1i_2,dy0r,dy1r,dy0i,dy1i; + __m256i bfly2_tmp1,bfly2_tmp2; + + cmultc_256(*(x0),*(W0_256),&x0r_2,&x0i_2); + cmultc_256(*(x1),*(tw),&x1r_2,&x1i_2); + + dy0r = _mm256_srai_epi32(_mm256_add_epi32(x0r_2,x1r_2),15); + dy1r = _mm256_srai_epi32(_mm256_sub_epi32(x0r_2,x1r_2),15); + dy0i = _mm256_srai_epi32(_mm256_add_epi32(x0i_2,x1i_2),15); + // printf("y0i %d\n",((int16_t *)y0i)[0]); + dy1i = _mm256_srai_epi32(_mm256_sub_epi32(x0i_2,x1i_2),15); + + bfly2_tmp1 = _mm256_unpacklo_epi32(dy0r,dy0i); + bfly2_tmp2 = _mm256_unpackhi_epi32(dy0r,dy0i); + *y0 = _mm256_packs_epi32(bfly2_tmp1,bfly2_tmp2); + + bfly2_tmp1 = _mm256_unpacklo_epi32(dy1r,dy1i); + bfly2_tmp2 = _mm256_unpackhi_epi32(dy1r,dy1i); + *y1 = _mm256_packs_epi32(bfly2_tmp1,bfly2_tmp2); +} +#endif + #elif defined(__arm__) static inline void ibfly2(int16x8_t *x0, int16x8_t *x1,int16x8_t *y0, int16x8_t *y1,int16x8_t *tw) { @@ -577,6 +805,33 @@ static inline void bfly3(__m128i *x0,__m128i *x1,__m128i *x2, *(y2) = _mm_adds_epi16(*(x0),*(y2)); } +#ifdef __AVX2__ + +static inline void bfly3_256(__m256i *x0,__m256i *x1,__m256i *x2, + __m256i *y0,__m256i *y1,__m256i *y2, + __m256i *tw1,__m256i *tw2) __attribute__((always_inline)); + +static inline void bfly3_256(__m256i *x0,__m256i *x1,__m256i *x2, + __m256i *y0,__m256i *y1,__m256i *y2, + __m256i *tw1,__m256i *tw2) +{ + + __m256i tmpre,tmpim,x1_2,x2_2; + + packed_cmult_256(*(x1),*(tw1),&x1_2); + packed_cmult_256(*(x2),*(tw2),&x2_2); + *(y0) = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(x1_2,x2_2)); + cmult_256(x1_2,*(W13_256),&tmpre,&tmpim); + cmac_256(x2_2,*(W23_256),&tmpre,&tmpim); + *(y1) = cpack_256(tmpre,tmpim); + *(y1) = _mm256_adds_epi16(*(x0),*(y1)); + cmult_256(x1_2,*(W23_256),&tmpre,&tmpim); + cmac_256(x2_2,*(W13_256),&tmpre,&tmpim); + *(y2) = cpack_256(tmpre,tmpim); + *(y2) = _mm256_adds_epi16(*(x0),*(y2)); +} +#endif + #elif defined(__arm__) static inline void bfly3(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2, int16x8_t *y0,int16x8_t *y1,int16x8_t *y2, @@ -630,6 +885,33 @@ static inline void ibfly3(__m128i *x0,__m128i *x1,__m128i *x2, *(y2) = _mm_adds_epi16(*(x0),*(y2)); } +#ifdef __AVX2__ + +static inline void ibfly3_256(__m256i *x0,__m256i *x1,__m256i *x2, + __m256i *y0,__m256i *y1,__m256i *y2, + __m256i *tw1,__m256i *tw2) __attribute__((always_inline)); + +static inline void ibfly3_256(__m256i *x0,__m256i *x1,__m256i *x2, + __m256i *y0,__m256i *y1,__m256i *y2, + __m256i *tw1,__m256i *tw2) +{ + + __m256i tmpre,tmpim,x1_2,x2_2; + + packed_cmultc_256(*(x1),*(tw1),&x1_2); + packed_cmultc_256(*(x2),*(tw2),&x2_2); + *(y0) = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(x1_2,x2_2)); + cmultc_256(x1_2,*(W13_256),&tmpre,&tmpim); + cmacc_256(x2_2,*(W23_256),&tmpre,&tmpim); + *(y1) = cpack_256(tmpre,tmpim); + *(y1) = _mm256_adds_epi16(*(x0),*(y1)); + cmultc_256(x1_2,*(W23_256),&tmpre,&tmpim); + cmacc_256(x2_2,*(W13_256),&tmpre,&tmpim); + *(y2) = cpack_256(tmpre,tmpim); + *(y2) = _mm256_adds_epi16(*(x0),*(y2)); +} +#endif + #elif defined(__arm__) static inline void ibfly3(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2, int16x8_t *y0,int16x8_t *y1,int16x8_t *y2, @@ -677,6 +959,30 @@ static inline void bfly3_tw1(__m128i *x0,__m128i *x1,__m128i *x2, *(y2) = cpack(tmpre,tmpim); *(y2) = _mm_adds_epi16(*(x0),*(y2)); } + +#ifdef __AVX2__ + +static inline void bfly3_tw1_256(__m256i *x0,__m256i *x1,__m256i *x2, + __m256i *y0,__m256i *y1,__m256i *y2) __attribute__((always_inline)); + +static inline void bfly3_tw1_256(__m256i *x0,__m256i *x1,__m256i *x2, + __m256i *y0,__m256i *y1,__m256i *y2) +{ + + __m256i tmpre,tmpim; + + *(y0) = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(*(x1),*(x2))); + cmult_256(*(x1),*(W13_256),&tmpre,&tmpim); + cmac_256(*(x2),*(W23_256),&tmpre,&tmpim); + *(y1) = cpack_256(tmpre,tmpim); + *(y1) = _mm256_adds_epi16(*(x0),*(y1)); + cmult_256(*(x1),*(W23_256),&tmpre,&tmpim); + cmac_256(*(x2),*(W13_256),&tmpre,&tmpim); + *(y2) = cpack_256(tmpre,tmpim); + *(y2) = _mm256_adds_epi16(*(x0),*(y2)); +} +#endif + #elif defined(__arm__) static inline void bfly3_tw1(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2, int16x8_t *y0,int16x8_t *y1,int16x8_t *y2) __attribute__((always_inline)); @@ -743,6 +1049,48 @@ static inline void bfly4(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3, *(y3) = _mm_add_epi16(*(x0),cpack(dy3r,dy3i)); } +#ifdef __AVX2__ +static inline void bfly4_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3)__attribute__((always_inline)); + +static inline void bfly4_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3) +{ + + __m256i x1r_2,x1i_2,x2r_2,x2i_2,x3r_2,x3i_2,dy0r,dy0i,dy1r,dy1i,dy2r,dy2i,dy3r,dy3i; + + // cmult(*(x0),*(W0),&x0r_2,&x0i_2); + cmult_256(*(x1),*(tw1),&x1r_2,&x1i_2); + cmult_256(*(x2),*(tw2),&x2r_2,&x2i_2); + cmult_256(*(x3),*(tw3),&x3r_2,&x3i_2); + // dy0r = _mm_add_epi32(x0r_2,_mm_add_epi32(x1r_2,_mm_add_epi32(x2r_2,x3r_2))); + // dy0i = _mm_add_epi32(x0i_2,_mm_add_epi32(x1i_2,_mm_add_epi32(x2i_2,x3i_2))); + // *(y0) = cpack(dy0r,dy0i); + dy0r = _mm256_add_epi32(x1r_2,_mm256_add_epi32(x2r_2,x3r_2)); + dy0i = _mm256_add_epi32(x1i_2,_mm256_add_epi32(x2i_2,x3i_2)); + *(y0) = _mm256_add_epi16(*(x0),cpack_256(dy0r,dy0i)); + // dy1r = _mm_add_epi32(x0r_2,_mm_sub_epi32(x1i_2,_mm_add_epi32(x2r_2,x3i_2))); + // dy1i = _mm_sub_epi32(x0i_2,_mm_add_epi32(x1r_2,_mm_sub_epi32(x2i_2,x3r_2))); + // *(y1) = cpack(dy1r,dy1i); + dy1r = _mm256_sub_epi32(x1i_2,_mm256_add_epi32(x2r_2,x3i_2)); + dy1i = _mm256_sub_epi32(_mm256_sub_epi32(x3r_2,x2i_2),x1r_2); + *(y1) = _mm256_add_epi16(*(x0),cpack_256(dy1r,dy1i)); + // dy2r = _mm_sub_epi32(x0r_2,_mm_sub_epi32(x1r_2,_mm_sub_epi32(x2r_2,x3r_2))); + // dy2i = _mm_sub_epi32(x0i_2,_mm_sub_epi32(x1i_2,_mm_sub_epi32(x2i_2,x3i_2))); + // *(y2) = cpack(dy2r,dy2i); + dy2r = _mm256_sub_epi32(_mm256_sub_epi32(x2r_2,x3r_2),x1r_2); + dy2i = _mm256_sub_epi32(_mm256_sub_epi32(x2i_2,x3i_2),x1i_2); + *(y2) = _mm256_add_epi16(*(x0),cpack_256(dy2r,dy2i)); + // dy3r = _mm_sub_epi32(x0r_2,_mm_add_epi32(x1i_2,_mm_sub_epi32(x2r_2,x3i_2))); + // dy3i = _mm_add_epi32(x0i_2,_mm_sub_epi32(x1r_2,_mm_add_epi32(x2i_2,x3r_2))); + // *(y3) = cpack(dy3r,dy3i); + dy3r = _mm256_sub_epi32(_mm256_sub_epi32(x3i_2,x2r_2),x1i_2); + dy3i = _mm256_sub_epi32(x1r_2,_mm256_add_epi32(x2i_2,x3r_2)); + *(y3) = _mm256_add_epi16(*(x0),cpack_256(dy3r,dy3i)); +} +#endif #elif defined(__arm__) static inline void bfly4(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3, int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3, @@ -818,6 +1166,39 @@ static inline void ibfly4(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3, *(y1) = _mm_add_epi16(*(x0),cpack(dy1r,dy1i)); } +#ifdef __AVX2__ + +static inline void ibfly4_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3)__attribute__((always_inline)); + +static inline void ibfly4_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3) +{ + + __m256i x1r_2,x1i_2,x2r_2,x2i_2,x3r_2,x3i_2,dy0r,dy0i,dy1r,dy1i,dy2r,dy2i,dy3r,dy3i; + + + cmultc_256(*(x1),*(tw1),&x1r_2,&x1i_2); + cmultc_256(*(x2),*(tw2),&x2r_2,&x2i_2); + cmultc_256(*(x3),*(tw3),&x3r_2,&x3i_2); + + dy0r = _mm256_add_epi32(x1r_2,_mm256_add_epi32(x2r_2,x3r_2)); + dy0i = _mm256_add_epi32(x1i_2,_mm256_add_epi32(x2i_2,x3i_2)); + *(y0) = _mm256_add_epi16(*(x0),cpack_256(dy0r,dy0i)); + dy3r = _mm256_sub_epi32(x1i_2,_mm256_add_epi32(x2r_2,x3i_2)); + dy3i = _mm256_sub_epi32(_mm256_sub_epi32(x3r_2,x2i_2),x1r_2); + *(y3) = _mm256_add_epi16(*(x0),cpack_256(dy3r,dy3i)); + dy2r = _mm256_sub_epi32(_mm256_sub_epi32(x2r_2,x3r_2),x1r_2); + dy2i = _mm256_sub_epi32(_mm256_sub_epi32(x2i_2,x3i_2),x1i_2); + *(y2) = _mm256_add_epi16(*(x0),cpack_256(dy2r,dy2i)); + dy1r = _mm256_sub_epi32(_mm256_sub_epi32(x3i_2,x2r_2),x1i_2); + dy1i = _mm256_sub_epi32(x1r_2,_mm256_add_epi32(x2i_2,x3r_2)); + *(y1) = _mm256_add_epi16(*(x0),cpack_256(dy1r,dy1i)); +} + +#endif #elif defined(__arm__) static inline void ibfly4(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3, @@ -888,6 +1269,32 @@ static inline void bfly4_tw1(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3, */ } +#ifdef __AVX2__ + +static inline void bfly4_tw1_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3)__attribute__((always_inline)); + +static inline void bfly4_tw1_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3) +{ + register __m256i x1_flip,x3_flip,x02t,x13t; + register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + x02t = _mm256_adds_epi16(*(x0),*(x2)); + x13t = _mm256_adds_epi16(*(x1),*(x3)); + *(y0) = _mm256_adds_epi16(x02t,x13t); + *(y2) = _mm256_subs_epi16(x02t,x13t); + x1_flip = _mm256_sign_epi16(*(x1),*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(*(x3),*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(*(x0),*(x2)); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + *(y1) = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + *(y3) = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f +} +#endif + #elif defined(__arm__) static inline void bfly4_tw1(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3, @@ -1005,6 +1412,48 @@ static inline void bfly4_16(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3, } +#ifdef __AVX2__ +static inline void bfly4_16_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3, + __m256i *tw1b,__m256i *tw2b,__m256i *tw3b)__attribute__((always_inline)); + +static inline void bfly4_16_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3, + __m256i *tw1b,__m256i *tw2b,__m256i *tw3b) +{ + + register __m256i x1t,x2t,x3t,x02t,x13t; + register __m256i x1_flip,x3_flip; + register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + // each input xi is assumed to be to consecutive vectors xi0 xi1 on which to perform the 8 butterflies + // [xi00 xi01 xi02 xi03 xi10 xi20 xi30 xi40] + // each output yi is the same + + x1t = packed_cmult2_256(*(x1),*(tw1),*(tw1b)); + x2t = packed_cmult2_256(*(x2),*(tw2),*(tw2b)); + x3t = packed_cmult2_256(*(x3),*(tw3),*(tw3b)); + + x02t = _mm256_adds_epi16(*(x0),x2t); + x13t = _mm256_adds_epi16(x1t,x3t); + *(y0) = _mm256_adds_epi16(x02t,x13t); + *(y2) = _mm256_subs_epi16(x02t,x13t); + + x1_flip = _mm256_sign_epi16(x1t,*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(x3t,*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(*(x0),x2t); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + *(y1) = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + *(y3) = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + +} + +#endif + #elif defined(__arm__) static inline void bfly4_16(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3, @@ -1089,6 +1538,47 @@ static inline void ibfly4_16(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3, } +#ifdef __AVX2__ +static inline void ibfly4_16_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3, + __m256i *tw1b,__m256i *tw2b,__m256i *tw3b)__attribute__((always_inline)); + +static inline void ibfly4_16_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3, + __m256i *tw1b,__m256i *tw2b,__m256i *tw3b) +{ + + register __m256i x1t,x2t,x3t,x02t,x13t; + register __m256i x1_flip,x3_flip; + register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + // each input xi is assumed to be to consecutive vectors xi0 xi1 on which to perform the 8 butterflies + // [xi00 xi01 xi02 xi03 xi10 xi20 xi30 xi40] + // each output yi is the same + + x1t = packed_cmult2_256(*(x1),*(tw1),*(tw1b)); + x2t = packed_cmult2_256(*(x2),*(tw2),*(tw2b)); + x3t = packed_cmult2_256(*(x3),*(tw3),*(tw3b)); + + x02t = _mm256_adds_epi16(*(x0),x2t); + x13t = _mm256_adds_epi16(x1t,x3t); + *(y0) = _mm256_adds_epi16(x02t,x13t); + *(y2) = _mm256_subs_epi16(x02t,x13t); + + x1_flip = _mm256_sign_epi16(x1t,*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(x3t,*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(*(x0),x2t); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + *(y3) = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + *(y1) = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + +} +#endif + #elif defined(__arm__) static inline void ibfly4_16(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3, int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3, @@ -1173,6 +1663,59 @@ static inline void bfly5(__m128i *x0, __m128i *x1, __m128i *x2, __m128i *x3,__m1 } +#ifdef __AVX2__ + +static inline void bfly5_256(__m256i *x0, __m256i *x1, __m256i *x2, __m256i *x3,__m256i *x4, + __m256i *y0, __m256i *y1, __m256i *y2, __m256i *y3,__m256i *y4, + __m256i *tw1,__m256i *tw2,__m256i *tw3,__m256i *tw4)__attribute__((always_inline)); + +static inline void bfly5_256(__m256i *x0, __m256i *x1, __m256i *x2, __m256i *x3,__m256i *x4, + __m256i *y0, __m256i *y1, __m256i *y2, __m256i *y3,__m256i *y4, + __m256i *tw1,__m256i *tw2,__m256i *tw3,__m256i *tw4) +{ + + + + __m256i x1_2,x2_2,x3_2,x4_2,tmpre,tmpim; + + packed_cmult_256(*(x1),*(tw1),&x1_2); + packed_cmult_256(*(x2),*(tw2),&x2_2); + packed_cmult_256(*(x3),*(tw3),&x3_2); + packed_cmult_256(*(x4),*(tw4),&x4_2); + + *(y0) = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(x1_2,_mm256_adds_epi16(x2_2,_mm256_adds_epi16(x3_2,x4_2)))); + cmult_256(x1_2,*(W15_256),&tmpre,&tmpim); + cmac_256(x2_2,*(W25_256),&tmpre,&tmpim); + cmac_256(x3_2,*(W35_256),&tmpre,&tmpim); + cmac_256(x4_2,*(W45_256),&tmpre,&tmpim); + *(y1) = cpack_256(tmpre,tmpim); + *(y1) = _mm256_adds_epi16(*(x0),*(y1)); + + cmult_256(x1_2,*(W25_256),&tmpre,&tmpim); + cmac_256(x2_2,*(W45_256),&tmpre,&tmpim); + cmac_256(x3_2,*(W15_256),&tmpre,&tmpim); + cmac_256(x4_2,*(W35_256),&tmpre,&tmpim); + *(y2) = cpack_256(tmpre,tmpim); + *(y2) = _mm256_adds_epi16(*(x0),*(y2)); + + cmult_256(x1_2,*(W35_256),&tmpre,&tmpim); + cmac_256(x2_2,*(W15_256),&tmpre,&tmpim); + cmac_256(x3_2,*(W45_256),&tmpre,&tmpim); + cmac_256(x4_2,*(W25_256),&tmpre,&tmpim); + *(y3) = cpack_256(tmpre,tmpim); + *(y3) = _mm256_adds_epi16(*(x0),*(y3)); + + cmult_256(x1_2,*(W45_256),&tmpre,&tmpim); + cmac_256(x2_2,*(W35_256),&tmpre,&tmpim); + cmac_256(x3_2,*(W25_256),&tmpre,&tmpim); + cmac_256(x4_2,*(W15_256),&tmpre,&tmpim); + *(y4) = cpack_256(tmpre,tmpim); + *(y4) = _mm256_adds_epi16(*(x0),*(y4)); + + +} +#endif + #elif defined(__arm__) static inline void bfly5(int16x8_t *x0, int16x8_t *x1, int16x8_t *x2, int16x8_t *x3,int16x8_t *x4, int16x8_t *y0, int16x8_t *y1, int16x8_t *y2, int16x8_t *y3,int16x8_t *y4, @@ -1265,6 +1808,43 @@ static inline void bfly5_tw1(__m128i *x0, __m128i *x1, __m128i *x2, __m128i *x3, *(y4) = _mm_adds_epi16(*(x0),*(y4)); } +#ifdef __AVX2__ +static inline void bfly5_tw1_256(__m256i *x0, __m256i *x1, __m256i *x2, __m256i *x3,__m256i *x4, + __m256i *y0, __m256i *y1, __m256i *y2, __m256i *y3,__m256i *y4) __attribute__((always_inline)); + +static inline void bfly5_tw1_256(__m256i *x0, __m256i *x1, __m256i *x2, __m256i *x3,__m256i *x4, + __m256i *y0, __m256i *y1, __m256i *y2, __m256i *y3,__m256i *y4) +{ + + __m256i tmpre,tmpim; + + *(y0) = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(*(x1),_mm256_adds_epi16(*(x2),_mm256_adds_epi16(*(x3),*(x4))))); + cmult_256(*(x1),*(W15_256),&tmpre,&tmpim); + cmac_256(*(x2),*(W25_256),&tmpre,&tmpim); + cmac_256(*(x3),*(W35_256),&tmpre,&tmpim); + cmac_256(*(x4),*(W45_256),&tmpre,&tmpim); + *(y1) = cpack_256(tmpre,tmpim); + *(y1) = _mm256_adds_epi16(*(x0),*(y1)); + cmult_256(*(x1),*(W25_256),&tmpre,&tmpim); + cmac_256(*(x2),*(W45_256),&tmpre,&tmpim); + cmac_256(*(x3),*(W15_256),&tmpre,&tmpim); + cmac_256(*(x4),*(W35_256),&tmpre,&tmpim); + *(y2) = cpack_256(tmpre,tmpim); + *(y2) = _mm256_adds_epi16(*(x0),*(y2)); + cmult_256(*(x1),*(W35_256),&tmpre,&tmpim); + cmac_256(*(x2),*(W15_256),&tmpre,&tmpim); + cmac_256(*(x3),*(W45_256),&tmpre,&tmpim); + cmac_256(*(x4),*(W25_256),&tmpre,&tmpim); + *(y3) = cpack_256(tmpre,tmpim); + *(y3) = _mm256_adds_epi16(*(x0),*(y3)); + cmult_256(*(x1),*(W45_256),&tmpre,&tmpim); + cmac_256(*(x2),*(W35_256),&tmpre,&tmpim); + cmac_256(*(x3),*(W25_256),&tmpre,&tmpim); + cmac_256(*(x4),*(W15_256),&tmpre,&tmpim); + *(y4) = cpack_256(tmpre,tmpim); + *(y4) = _mm256_adds_epi16(*(x0),*(y4)); +} +#endif #elif defined(__arm__) static inline void bfly5_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *x2, int16x8_t *x3,int16x8_t *x4, int16x8_t *y0, int16x8_t *y1, int16x8_t *y2, int16x8_t *y3,int16x8_t *y4) __attribute__((always_inline)); @@ -1347,19 +1927,47 @@ static inline void transpose16_ooff(__m128i *x,__m128i *y,int off) register __m128i ytmp0,ytmp1,ytmp2,ytmp3; __m128i *y2=y; - ytmp0 = _mm_unpacklo_epi32(x[0],x[1]); - ytmp1 = _mm_unpackhi_epi32(x[0],x[1]); - ytmp2 = _mm_unpacklo_epi32(x[2],x[3]); - ytmp3 = _mm_unpackhi_epi32(x[2],x[3]); - *y2 = _mm_unpacklo_epi64(ytmp0,ytmp2); + ytmp0 = _mm_unpacklo_epi32(x[0],x[1]); // x00 x10 x01 x11 + ytmp1 = _mm_unpackhi_epi32(x[0],x[1]); // x02 x12 x03 x13 + ytmp2 = _mm_unpacklo_epi32(x[2],x[3]); // x20 x30 x21 x31 + ytmp3 = _mm_unpackhi_epi32(x[2],x[3]); // x22 x32 x23 x33 + *y2 = _mm_unpacklo_epi64(ytmp0,ytmp2); // x00 x10 x20 x30 y2+=off; - *y2 = _mm_unpackhi_epi64(ytmp0,ytmp2); + *y2 = _mm_unpackhi_epi64(ytmp0,ytmp2); // x01 x11 x21 x31 y2+=off; - *y2 = _mm_unpacklo_epi64(ytmp1,ytmp3); + *y2 = _mm_unpacklo_epi64(ytmp1,ytmp3); // x02 x12 x22 x32 y2+=off; - *y2 = _mm_unpackhi_epi64(ytmp1,ytmp3); + *y2 = _mm_unpackhi_epi64(ytmp1,ytmp3); // x03 x13 x23 x33 } +#ifdef __AVX2__ + +static inline void transpose16_ooff_simd256(__m256i *x,__m256i *y,int off) __attribute__((always_inline)); +static inline void transpose16_ooff_simd256(__m256i *x,__m256i *y,int off) +{ + register __m256i ytmp0,ytmp1,ytmp2,ytmp3,ytmp4,ytmp5,ytmp6,ytmp7; + __m256i *y2=y; + __m256i const perm_mask = _mm256_set_epi32(7, 3, 6, 2, 5, 1, 4, 0); + + ytmp0 = _mm256_permutevar8x32_epi32(x[0],perm_mask); // x00 x10 x01 x11 x02 x12 x03 x13 + ytmp1 = _mm256_permutevar8x32_epi32(x[1],perm_mask); // x20 x30 x21 x31 x22 x32 x23 x33 + ytmp2 = _mm256_permutevar8x32_epi32(x[2],perm_mask); // x40 x50 x41 x51 x42 x52 x43 x53 + ytmp3 = _mm256_permutevar8x32_epi32(x[3],perm_mask); // x60 x70 x61 x71 x62 x72 x63 x73 + ytmp4 = _mm256_unpacklo_epi64(ytmp0,ytmp1); // x00 x10 x20 x30 x01 x11 x21 x31 + ytmp5 = _mm256_unpackhi_epi64(ytmp0,ytmp1); // x02 x12 x22 x32 x03 x13 x23 x33 + ytmp6 = _mm256_unpacklo_epi64(ytmp2,ytmp3); // x40 x50 x60 x70 x41 x51 x61 x71 + ytmp7 = _mm256_unpackhi_epi64(ytmp2,ytmp3); // x42 x52 x62 x72 x43 x53 x63 x73 + + *y2 = _mm256_insertf128_si256(ytmp4,_mm256_extracti128_si256(ytmp6,0),1); //x00 x10 x20 x30 x40 x50 x60 x70 + y2+=off; + *y2 = _mm256_insertf128_si256(ytmp6,_mm256_extracti128_si256(ytmp4,1),0); //x01 x11 x21 x31 x41 x51 x61 x71 + y2+=off; + *y2 = _mm256_insertf128_si256(ytmp5,_mm256_extracti128_si256(ytmp7,0),1); //x00 x10 x20 x30 x40 x50 x60 x70 + y2+=off; + *y2 = _mm256_insertf128_si256(ytmp7,_mm256_extracti128_si256(ytmp5,1),0); //x01 x11 x21 x31 x41 x51 x61 x71 +} +#endif + #elif defined(__arm__) static inline void transpose16_ooff(int16x8_t *x,int16x8_t *y,int off) __attribute__((always_inline)); @@ -1388,7 +1996,29 @@ static inline void transpose4_ooff(__m64 *x,__m64 *y,int off) { y[0] = _mm_unpacklo_pi32(x[0],x[1]); y[off] = _mm_unpackhi_pi32(x[0],x[1]); + + // x[0] = [x0 x1] + // x[1] = [x2 x3] + // y[0] = [x0 x2] + // y[off] = [x1 x3] } +#ifdef __AVX2__ +static inline void transpose4_ooff_simd256(__m256i *x,__m256i *y,int off)__attribute__((always_inline)); +static inline void transpose4_ooff_simd256(__m256i *x,__m256i *y,int off) +{ + __m256i const perm_mask = _mm256_set_epi32(7, 5, 3, 1, 6, 4, 2, 0); + __m256i perm_tmp0,perm_tmp1; + + // x[0] = [x0 x1 x2 x3 x4 x5 x6 x7] + // x[1] = [x8 x9 x10 x11 x12 x13 x14] + // y[0] = [x0 x2 x4 x6 x8 x10 x12 x14] + // y[off] = [x1 x3 x5 x7 x9 x11 x13 x15] + perm_tmp0 = _mm256_permutevar8x32_epi32(x[0],perm_mask); + perm_tmp1 = _mm256_permutevar8x32_epi32(x[1],perm_mask); + y[0] = _mm256_insertf128_si256(perm_tmp0,_mm256_extracti128_si256(perm_tmp1,0),1); + y[off] = _mm256_insertf128_si256(perm_tmp1,_mm256_extracti128_si256(perm_tmp0,1),0); +} +#endif #elif (__arm__) static inline void transpose4_ooff(int16x4_t *x,int16x4_t *y,int off)__attribute__((always_inline)); @@ -1404,26 +2034,46 @@ static inline void transpose4_ooff(int16x4_t *x,int16x4_t *y,int off) // 16-point optimized DFT kernel -int16_t tw16[24] __attribute__((aligned(16))) = { 32767,0,30272,-12540,23169 ,-23170,12539 ,-30273, +int16_t tw16[24] __attribute__((aligned(32))) = { 32767,0,30272,-12540,23169 ,-23170,12539 ,-30273, 32767,0,23169,-23170,0 ,-32767,-23170,-23170, 32767,0,12539,-30273,-23170,-23170,-30273,12539 }; -int16_t tw16a[24] __attribute__((aligned(16))) = {32767,0,30272,12540,23169 ,23170,12539 ,30273, +int16_t tw16a[24] __attribute__((aligned(32))) = {32767,0,30272,12540,23169 ,23170,12539 ,30273, 32767,0,23169,23170,0 ,32767,-23170,23170, 32767,0,12539,30273,-23170,23170,-30273,-12539 }; -int16_t tw16b[24] __attribute__((aligned(16))) = { 0,32767,-12540,30272,-23170,23169 ,-30273,12539, +int16_t tw16b[24] __attribute__((aligned(32))) = { 0,32767,-12540,30272,-23170,23169 ,-30273,12539, 0,32767,-23170,23169,-32767,0 ,-23170,-23170, 0,32767,-30273,12539,-23170,-23170,12539 ,-30273 }; -int16_t tw16c[24] __attribute__((aligned(16))) = { 0,32767,12540,30272,23170,23169 ,30273 ,12539, +int16_t tw16c[24] __attribute__((aligned(32))) = { 0,32767,12540,30272,23170,23169 ,30273 ,12539, 0,32767,23170,23169,32767,0 ,23170 ,-23170, 0,32767,30273,12539,23170,-23170,-12539,-30273 }; +int16_t tw16rep[48] __attribute__((aligned(32))) = { 32767,0,30272,-12540,23169 ,-23170,12539 ,-30273,32767,0,30272,-12540,23169 ,-23170,12539 ,-30273, + 32767,0,23169,-23170,0 ,-32767,-23170,-23170,32767,0,23169,-23170,0 ,-32767,-23170,-23170, + 32767,0,12539,-30273,-23170,-23170,-30273,12539,32767,0,12539,-30273,-23170,-23170,-30273,12539 + }; + +int16_t tw16arep[48] __attribute__((aligned(32))) = {32767,0,30272,12540,23169 ,23170,12539 ,30273,32767,0,30272,12540,23169 ,23170,12539 ,30273, + 32767,0,23169,23170,0 ,32767,-23170,23170,32767,0,23169,23170,0 ,32767,-23170,23170, + 32767,0,12539,30273,-23170,23170,-30273,-12539,32767,0,12539,30273,-23170,23170,-30273,-12539 + }; + +int16_t tw16brep[48] __attribute__((aligned(32))) = { 0,32767,-12540,30272,-23170,23169 ,-30273,12539,0,32767,-12540,30272,-23170,23169 ,-30273,12539, + 0,32767,-23170,23169,-32767,0 ,-23170,-23170,0,32767,-23170,23169,-32767,0 ,-23170,-23170, + 0,32767,-30273,12539,-23170,-23170,12539 ,-30273,0,32767,-30273,12539,-23170,-23170,12539 ,-30273 + }; + +int16_t tw16crep[48] __attribute__((aligned(32))) = { 0,32767,12540,30272,23170,23169 ,30273 ,12539,0,32767,12540,30272,23170,23169 ,30273 ,12539, + 0,32767,23170,23169,32767,0 ,23170 ,-23170,0,32767,23170,23169,32767,0 ,23170 ,-23170, + 0,32767,30273,12539,23170,-23170,-12539,-30273,0,32767,30273,12539,23170,-23170,-12539,-30273 + }; + static inline void dft16(int16_t *x,int16_t *y) __attribute__((always_inline)); @@ -1437,7 +2087,6 @@ static inline void dft16(int16_t *x,int16_t *y) -#ifndef AVX2 /* This is the original version before unrolling bfly4_tw1(x128,x128+1,x128+2,x128+3, @@ -1496,32 +2145,6 @@ static inline void dft16(int16_t *x,int16_t *y) y128[1] = _mm_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f y128[3] = _mm_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f -#else - - // x02t = _mm_adds_epi16(x128[0],x128[2]); - // x13t = _mm_adds_epi16(x128[1],x128[3]); - - xt = _mm256_adds_epi16(x256[0],x256[1]); - - xtmp0 = _mm_adds_epi16(x02t,x13t); - xtmp2 = _mm_subs_epi16(x02t,x13t); - - x13_flip - x1_flip = _mm_sign_epi16(x128[1],*(__m128i*)conjugatedft); - x1_flip = _mm_shuffle_epi8(x1_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2)); - x3_flip = _mm_sign_epi16(x128[3],*(__m128i*)conjugatedft); - x3_flip = _mm_shuffle_epi8(x3_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2)); - - // x02t = _mm_subs_epi16(x128[0],x128[2]); - // x13t = _mm_subs_epi16(x1_flip,x3_flip); - xt = _mm256_subs_epi16(x256flip0,x256flip1); - - xtmp1 = _mm_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f - xtmp3 = _mm_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f - - -#endif - #elif defined(__arm__) int16x8_t *tw16a_128=(int16x8_t *)tw16a,*tw16b_128=(int16x8_t *)tw16b,*x128=(int16x8_t *)x,*y128=(int16x8_t *)y; @@ -1592,6 +2215,90 @@ static inline void dft16(int16_t *x,int16_t *y) #endif } +#if defined(__x86_64__) || defined(__i386__) +#ifdef __AVX2__ +// Does two 16-point DFTS (x[0 .. 15] is 128 LSBs of input vector, x[16..31] is in 128 MSBs) +static inline void dft16_simd256(int16_t *x,int16_t *y) __attribute__((always_inline)); +static inline void dft16_simd256(int16_t *x,int16_t *y) +{ + + __m256i *tw16a_256=(__m256i *)tw16arep,*tw16b_256=(__m256i *)tw16brep,*x256=(__m256i *)x,*y256=(__m256i *)y; + + __m256i x1_flip,x3_flip,x02t,x13t; + __m256i ytmp0,ytmp1,ytmp2,ytmp3,xtmp0,xtmp1,xtmp2,xtmp3; + register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + // First stage : 4 Radix-4 butterflies without input twiddles + + x02t = _mm256_adds_epi16(x256[0],x256[2]); + x13t = _mm256_adds_epi16(x256[1],x256[3]); + xtmp0 = _mm256_adds_epi16(x02t,x13t); + xtmp2 = _mm256_subs_epi16(x02t,x13t); + x1_flip = _mm256_sign_epi16(x256[1],*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(x256[3],*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(x256[0],x256[2]); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + xtmp1 = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + xtmp3 = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + + /* print_shorts256("xtmp0",(int16_t*)&xtmp0); + print_shorts256("xtmp1",(int16_t*)&xtmp1); + print_shorts256("xtmp2",(int16_t*)&xtmp2); + print_shorts256("xtmp3",(int16_t*)&xtmp3);*/ + + ytmp0 = _mm256_unpacklo_epi32(xtmp0,xtmp1); + ytmp1 = _mm256_unpackhi_epi32(xtmp0,xtmp1); + ytmp2 = _mm256_unpacklo_epi32(xtmp2,xtmp3); + ytmp3 = _mm256_unpackhi_epi32(xtmp2,xtmp3); + xtmp0 = _mm256_unpacklo_epi64(ytmp0,ytmp2); + xtmp1 = _mm256_unpackhi_epi64(ytmp0,ytmp2); + xtmp2 = _mm256_unpacklo_epi64(ytmp1,ytmp3); + xtmp3 = _mm256_unpackhi_epi64(ytmp1,ytmp3); + + // Second stage : 4 Radix-4 butterflies with input twiddles + xtmp1 = packed_cmult2_256(xtmp1,tw16a_256[0],tw16b_256[0]); + xtmp2 = packed_cmult2_256(xtmp2,tw16a_256[1],tw16b_256[1]); + xtmp3 = packed_cmult2_256(xtmp3,tw16a_256[2],tw16b_256[2]); + + /* print_shorts256("xtmp0",(int16_t*)&xtmp0); + print_shorts256("xtmp1",(int16_t*)&xtmp1); + print_shorts256("xtmp2",(int16_t*)&xtmp2); + print_shorts256("xtmp3",(int16_t*)&xtmp3);*/ + + x02t = _mm256_adds_epi16(xtmp0,xtmp2); + x13t = _mm256_adds_epi16(xtmp1,xtmp3); + ytmp0 = _mm256_adds_epi16(x02t,x13t); + ytmp2 = _mm256_subs_epi16(x02t,x13t); + x1_flip = _mm256_sign_epi16(xtmp1,*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(xtmp3,*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(xtmp0,xtmp2); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + ytmp1 = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + ytmp3 = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + + + // [y0 y1 y2 y3 y16 y17 y18 y19] + // [y4 y5 y6 y7 y20 y21 y22 y23] + // [y8 y9 y10 y11 y24 y25 y26 y27] + // [y12 y13 y14 y15 y28 y29 y30 y31] + + y256[0] = _mm256_insertf128_si256(ytmp0,_mm256_extracti128_si256(ytmp1,0),1); + y256[1] = _mm256_insertf128_si256(ytmp2,_mm256_extracti128_si256(ytmp3,0),1); + y256[2] = _mm256_insertf128_si256(ytmp1,_mm256_extracti128_si256(ytmp0,1),0); + y256[3] = _mm256_insertf128_si256(ytmp3,_mm256_extracti128_si256(ytmp2,1),0); + + // [y0 y1 y2 y3 y4 y5 y6 y7] + // [y8 y9 y10 y11 y12 y13 y14 y15] + // [y16 y17 y18 y19 y20 y21 y22 y23] + // [y24 y25 y26 y27 y28 y29 y30 y31] +} + +#endif +#endif static inline void idft16(int16_t *x,int16_t *y) __attribute__((always_inline)); static inline void idft16(int16_t *x,int16_t *y) @@ -1723,27 +2430,193 @@ static inline void idft16(int16_t *x,int16_t *y) #endif } +#if defined(__x86_64__) || defined(__i386__) +#ifdef __AVX2__ +// Does two 16-point IDFTS (x[0 .. 15] is 128 LSBs of input vector, x[16..31] is in 128 MSBs) +static inline void idft16_simd256(int16_t *x,int16_t *y) __attribute__((always_inline)); +static inline void idft16_simd256(int16_t *x,int16_t *y) +{ + + __m256i *tw16a_256=(__m256i *)tw16arep,*tw16b_256=(__m256i *)tw16brep,*x256=(__m256i *)x,*y256=(__m256i *)y; + register __m256i x1_flip,x3_flip,x02t,x13t; + register __m256i ytmp0,ytmp1,ytmp2,ytmp3,xtmp0,xtmp1,xtmp2,xtmp3; + register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + // First stage : 4 Radix-4 butterflies without input twiddles + + x02t = _mm256_adds_epi16(x256[0],x256[2]); + x13t = _mm256_adds_epi16(x256[1],x256[3]); + xtmp0 = _mm256_adds_epi16(x02t,x13t); + xtmp2 = _mm256_subs_epi16(x02t,x13t); + x1_flip = _mm256_sign_epi16(x256[1],*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(x256[3],*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(x256[0],x256[2]); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + xtmp3 = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + xtmp1 = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + + ytmp0 = _mm256_unpacklo_epi32(xtmp0,xtmp1); + ytmp1 = _mm256_unpackhi_epi32(xtmp0,xtmp1); + ytmp2 = _mm256_unpacklo_epi32(xtmp2,xtmp3); + ytmp3 = _mm256_unpackhi_epi32(xtmp2,xtmp3); + xtmp0 = _mm256_unpacklo_epi64(ytmp0,ytmp2); + xtmp1 = _mm256_unpackhi_epi64(ytmp0,ytmp2); + xtmp2 = _mm256_unpacklo_epi64(ytmp1,ytmp3); + xtmp3 = _mm256_unpackhi_epi64(ytmp1,ytmp3); + + // Second stage : 4 Radix-4 butterflies with input twiddles + xtmp1 = packed_cmult2_256(xtmp1,tw16a_256[0],tw16b_256[0]); + xtmp2 = packed_cmult2_256(xtmp2,tw16a_256[1],tw16b_256[1]); + xtmp3 = packed_cmult2_256(xtmp3,tw16a_256[2],tw16b_256[2]); + + x02t = _mm256_adds_epi16(xtmp0,xtmp2); + x13t = _mm256_adds_epi16(xtmp1,xtmp3); + y256[0] = _mm256_adds_epi16(x02t,x13t); + y256[2] = _mm256_subs_epi16(x02t,x13t); + x1_flip = _mm256_sign_epi16(xtmp1,*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(xtmp3,*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(xtmp0,xtmp2); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + y256[3] = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + y256[1] = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + + // [y0 y1 y2 y3 y16 y17 y18 y19] + // [y4 y5 y6 y7 y20 y21 y22 y23] + // [y8 y9 y10 y11 y24 y25 y26 y27] + // [y12 y13 y14 y15 y28 y29 y30 y31] + + y256[0] = _mm256_insertf128_si256(ytmp0,_mm256_extracti128_si256(ytmp1,0),1); + y256[1] = _mm256_insertf128_si256(ytmp2,_mm256_extracti128_si256(ytmp3,0),1); + y256[2] = _mm256_insertf128_si256(ytmp1,_mm256_extracti128_si256(ytmp0,1),0); + y256[3] = _mm256_insertf128_si256(ytmp3,_mm256_extracti128_si256(ytmp2,1),0); + +} +#endif +#endif // 64-point optimized DFT -int16_t tw64[96] __attribute__((aligned(16))) = { 32767,0,32609,-3212,32137,-6393,31356,-9512,30272,-12540,28897,-15447,27244,-18205,25329,-20788,23169,-23170,20787,-25330,18204,-27245,15446,-28898,12539,-30273,9511,-31357,6392,-32138,3211,-32610, - 32767,0,32137,-6393,30272,-12540,27244,-18205,23169,-23170,18204,-27245,12539,-30273,6392,-32138,0,-32767,-6393,-32138,-12540,-30273,-18205,-27245,-23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393, - 32767,0,31356,-9512,27244,-18205,20787,-25330,12539,-30273,3211,-32610,-6393,-32138,-15447,-28898,-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211,-30273,12539,-25330,20787,-18205,27244,-9512,31356 +int16_t tw64[96] __attribute__((aligned(32))) = { +32767,0,32609,-3212,32137,-6393,31356,-9512, +30272,-12540,28897,-15447,27244,-18205,25329,-20788, +23169,-23170,20787,-25330,18204,-27245,15446,-28898, +12539,-30273,9511,-31357,6392,-32138,3211,-32610, +32767,0,32137,-6393,30272,-12540,27244,-18205, +23169,-23170,18204,-27245,12539,-30273,6392,-32138, +0,-32767,-6393,-32138,-12540,-30273,-18205,-27245, +-23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393, +32767,0,31356,-9512,27244,-18205,20787,-25330, +12539,-30273,3211,-32610,-6393,-32138,-15447,-28898, +-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211, +-30273,12539,-25330,20787,-18205,27244,-9512,31356 }; -int16_t tw64a[96] __attribute__((aligned(16))) = { 32767,0,32609,3212,32137,6393,31356,9512,30272,12540,28897,15447,27244,18205,25329,20788,23169,23170,20787,25330,18204,27245,15446,28898,12539,30273,9511,31357,6392,32138,3211,32610, - 32767,0,32137,6393,30272,12540,27244,18205,23169,23170,18204,27245,12539,30273,6392,32138,0,32767,-6393,32138,-12540,30273,-18205,27245,-23170,23170,-27245,18205,-30273,12540,-32138,6393, - 32767,0,31356,9512,27244,18205,20787,25330,12539,30273,3211,32610,-6393,32138,-15447,28898,-23170,23170,-28898,15447,-32138,6393,-32610,-3211,-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356 +int16_t tw64rep[192] __attribute__((aligned(32))) = { +32767,0,32609,-3212,32137,-6393,31356,-9512,32767,0,32609,-3212,32137,-6393,31356,-9512, +30272,-12540,28897,-15447,27244,-18205,25329,-20788,30272,-12540,28897,-15447,27244,-18205,25329,-20788, +23169,-23170,20787,-25330,18204,-27245,15446,-28898,23169,-23170,20787,-25330,18204,-27245,15446,-28898, +12539,-30273,9511,-31357,6392,-32138,3211,-32610,12539,-30273,9511,-31357,6392,-32138,3211,-32610, +32767,0,32137,-6393,30272,-12540,27244,-18205,32767,0,32137,-6393,30272,-12540,27244,-18205, +23169,-23170,18204,-27245,12539,-30273,6392,-32138,23169,-23170,18204,-27245,12539,-30273,6392,-32138, +0,-32767,-6393,-32138,-12540,-30273,-18205,-27245,0,-32767,-6393,-32138,-12540,-30273,-18205,-27245, +-23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393,-23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393, +32767,0,31356,-9512,27244,-18205,20787,-25330,32767,0,31356,-9512,27244,-18205,20787,-25330, +12539,-30273,3211,-32610,-6393,-32138,-15447,-28898,12539,-30273,3211,-32610,-6393,-32138,-15447,-28898, +-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211,-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211, +-30273,12539,-25330,20787,-18205,27244,-9512,31356,-30273,12539,-25330,20787,-18205,27244,-9512,31356 + }; + +int16_t tw64a[96] __attribute__((aligned(32))) = { +32767,0,32609,3212,32137,6393,31356,9512, +30272,12540,28897,15447,27244,18205,25329,20788, +23169,23170,20787,25330,18204,27245,15446,28898, +12539,30273,9511,31357,6392,32138,3211,32610, +32767,0,32137,6393,30272,12540,27244,18205, +23169,23170,18204,27245,12539,30273,6392,32138, +0,32767,-6393,32138,-12540,30273,-18205,27245, +-23170,23170,-27245,18205,-30273,12540,-32138,6393, +32767,0,31356,9512,27244,18205,20787,25330, +12539,30273,3211,32610,-6393,32138,-15447,28898, +-23170,23170,-28898,15447,-32138,6393,-32610,-3211, +-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356 + }; +int16_t tw64arep[192] __attribute__((aligned(32))) = { +32767,0,32609,3212,32137,6393,31356,9512,32767,0,32609,3212,32137,6393,31356,9512, +30272,12540,28897,15447,27244,18205,25329,20788,30272,12540,28897,15447,27244,18205,25329,20788, +23169,23170,20787,25330,18204,27245,15446,28898,23169,23170,20787,25330,18204,27245,15446,28898, +12539,30273,9511,31357,6392,32138,3211,32610,12539,30273,9511,31357,6392,32138,3211,32610, +32767,0,32137,6393,30272,12540,27244,18205,32767,0,32137,6393,30272,12540,27244,18205, +23169,23170,18204,27245,12539,30273,6392,32138,23169,23170,18204,27245,12539,30273,6392,32138, +0,32767,-6393,32138,-12540,30273,-18205,27245,0,32767,-6393,32138,-12540,30273,-18205,27245, +-23170,23170,-27245,18205,-30273,12540,-32138,6393,-23170,23170,-27245,18205,-30273,12540,-32138,6393, +32767,0,31356,9512,27244,18205,20787,25330,32767,0,31356,9512,27244,18205,20787,25330, +12539,30273,3211,32610,-6393,32138,-15447,28898,12539,30273,3211,32610,-6393,32138,-15447,28898, +-23170,23170,-28898,15447,-32138,6393,-32610,-3211,-23170,23170,-28898,15447,-32138,6393,-32610,-3211, +-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356,-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356 }; -int16_t tw64b[96] __attribute__((aligned(16))) = { 0,32767,-3212,32609,-6393,32137,-9512,31356,-12540,30272,-15447,28897,-18205,27244,-20788,25329,-23170,23169,-25330,20787,-27245,18204,-28898,15446,-30273,12539,-31357,9511,-32138,6392,-32610,3211, - 0,32767,-6393,32137,-12540,30272,-18205,27244,-23170,23169,-27245,18204,-30273,12539,-32138,6392,-32767,0,-32138,-6393,-30273,-12540,-27245,-18205,-23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138, - 0,32767,-9512,31356,-18205,27244,-25330,20787,-30273,12539,-32610,3211,-32138,-6393,-28898,-15447,-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610,12539,-30273,20787,-25330,27244,-18205,31356,-9512 +int16_t tw64b[96] __attribute__((aligned(32))) = { +0,32767,-3212,32609,-6393,32137,-9512,31356, +-12540,30272,-15447,28897,-18205,27244,-20788,25329, +-23170,23169,-25330,20787,-27245,18204,-28898,15446, +-30273,12539,-31357,9511,-32138,6392,-32610,3211, +0,32767,-6393,32137,-12540,30272,-18205,27244, +-23170,23169,-27245,18204,-30273,12539,-32138,6392, +-32767,0,-32138,-6393,-30273,-12540,-27245,-18205, +-23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138, +0,32767,-9512,31356,-18205,27244,-25330,20787, +-30273,12539,-32610,3211,-32138,-6393,-28898,-15447, +-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610, +12539,-30273,20787,-25330,27244,-18205,31356,-9512 }; -int16_t tw64c[96] __attribute__((aligned(16))) = { 0,32767,3212,32609,6393,32137,9512,31356,12540,30272,15447,28897,18205,27244,20788,25329,23170,23169,25330,20787,27245,18204,28898,15446,30273,12539,31357,9511,32138,6392,32610,3211, - 0,32767,6393,32137,12540,30272,18205,27244,23170,23169,27245,18204,30273,12539,32138,6392,32767,0,32138,-6393,30273,-12540,27245,-18205,23170,-23170,18205,-27245,12540,-30273,6393,-32138, - 0,32767,9512,31356,18205,27244,25330,20787,30273,12539,32610,3211,32138,-6393,28898,-15447,23170,-23170,15447,-28898,6393,-32138,-3211,-32610,-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512 +int16_t tw64brep[192] __attribute__((aligned(32))) = { +0,32767,-3212,32609,-6393,32137,-9512,31356,0,32767,-3212,32609,-6393,32137,-9512,31356, +-12540,30272,-15447,28897,-18205,27244,-20788,25329,-12540,30272,-15447,28897,-18205,27244,-20788,25329, +-23170,23169,-25330,20787,-27245,18204,-28898,15446,-23170,23169,-25330,20787,-27245,18204,-28898,15446, +-30273,12539,-31357,9511,-32138,6392,-32610,3211,-30273,12539,-31357,9511,-32138,6392,-32610,3211, +0,32767,-6393,32137,-12540,30272,-18205,27244,0,32767,-6393,32137,-12540,30272,-18205,27244, +-23170,23169,-27245,18204,-30273,12539,-32138,6392,-23170,23169,-27245,18204,-30273,12539,-32138,6392, +-32767,0,-32138,-6393,-30273,-12540,-27245,-18205,-32767,0,-32138,-6393,-30273,-12540,-27245,-18205, +-23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138,-23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138, +0,32767,-9512,31356,-18205,27244,-25330,20787,0,32767,-9512,31356,-18205,27244,-25330,20787, +-30273,12539,-32610,3211,-32138,-6393,-28898,-15447,-30273,12539,-32610,3211,-32138,-6393,-28898,-15447, +-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610,-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610, +12539,-30273,20787,-25330,27244,-18205,31356,-9512,12539,-30273,20787,-25330,27244,-18205,31356,-9512 + }; + +int16_t tw64c[96] __attribute__((aligned(32))) = { +0,32767,3212,32609,6393,32137,9512,31356, +12540,30272,15447,28897,18205,27244,20788,25329, +23170,23169,25330,20787,27245,18204,28898,15446, +30273,12539,31357,9511,32138,6392,32610,3211, +0,32767,6393,32137,12540,30272,18205,27244, +23170,23169,27245,18204,30273,12539,32138,6392, +32767,0,32138,-6393,30273,-12540,27245,-18205, +23170,-23170,18205,-27245,12540,-30273,6393,-32138, +0,32767,9512,31356,18205,27244,25330,20787, +30273,12539,32610,3211,32138,-6393,28898,-15447, +23170,-23170,15447,-28898,6393,-32138,-3211,-32610, +-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512 + }; + +int16_t tw64crep[192] __attribute__((aligned(32))) = { +0,32767,3212,32609,6393,32137,9512,31356,0,32767,3212,32609,6393,32137,9512,31356, +12540,30272,15447,28897,18205,27244,20788,25329,12540,30272,15447,28897,18205,27244,20788,25329, +23170,23169,25330,20787,27245,18204,28898,15446,23170,23169,25330,20787,27245,18204,28898,15446, +30273,12539,31357,9511,32138,6392,32610,3211,30273,12539,31357,9511,32138,6392,32610,3211, +0,32767,6393,32137,12540,30272,18205,27244,0,32767,6393,32137,12540,30272,18205,27244, +23170,23169,27245,18204,30273,12539,32138,6392,23170,23169,27245,18204,30273,12539,32138,6392, +32767,0,32138,-6393,30273,-12540,27245,-18205,32767,0,32138,-6393,30273,-12540,27245,-18205, +23170,-23170,18205,-27245,12540,-30273,6393,-32138,23170,-23170,18205,-27245,12540,-30273,6393,-32138, +0,32767,9512,31356,18205,27244,25330,20787,0,32767,9512,31356,18205,27244,25330,20787, +30273,12539,32610,3211,32138,-6393,28898,-15447,30273,12539,32610,3211,32138,-6393,28898,-15447, +23170,-23170,15447,-28898,6393,-32138,-3211,-32610,23170,-23170,15447,-28898,6393,-32138,-3211,-32610, +-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512,-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512 }; @@ -1753,6 +2626,12 @@ int16_t tw64c[96] __attribute__((aligned(16))) = { 0,32767,3212,32609,6393,32137 #define shiftright_int16(a,shift) _mm_srai_epi16(a,shift) #define set1_int16(a) _mm_set1_epi16(a); #define mulhi_int16(a,b) _mm_slli_epi16(_mm_mulhi_epi16(a,b),1); +#ifdef __AVX2__ +#define simd256_q15_t __m256i +#define shiftright_int16_simd256(a,shift) _mm256_srai_epi16(a,shift) +#define set1_int16_simd256(a) _mm256_set1_epi16(a); +#define mulhi_int16_simd256(a,b) _mm256_slli_epi16(_mm256_mulhi_epi16(a,b),1); + #elif defined(__arm__) #define simd_q15_t int16x8_t #define simdshort_q15_t int16x4_t @@ -1761,6 +2640,8 @@ int16_t tw64c[96] __attribute__((aligned(16))) = { 0,32767,3212,32609,6393,32137 #define mulhi_int16(a,b) vqdmulhq_s16(a,b); #define _mm_empty() #define _m_empty() + +#endif #endif void dft64(int16_t *x,int16_t *y,int scale) @@ -1780,18 +2661,41 @@ void dft64(int16_t *x,int16_t *y,int scale) transpose16_ooff(x128,xtmp,4); + // xtmp0 = x00 x10 x20 x30 + // xtmp4 = x01 x11 x21 x31 + // xtmp8 = x02 x12 x22 x32 + // xtmp12 = x03 x13 x23 x33 transpose16_ooff(x128+4,xtmp+1,4); + // xtmp1 = x40 x50 x60 x70 + // xtmp5 = x41 x51 x61 x71 + // xtmp9 = x42 x52 x62 x72 + // xtmp13 = x43 x53 x63 x73 transpose16_ooff(x128+8,xtmp+2,4); + // xtmp2 = x80 x90 xa0 xb0 + // xtmp6 = x41 x51 x61 x71 + // xtmp10 = x82 x92 xa2 xb2 + // xtmp14 = x83 x93 xa3 xb3 transpose16_ooff(x128+12,xtmp+3,4); - + // xtmp3 = xc0 xd0 xe0 xf0 + // xtmp7 = xc1 xd1 xe1 xf1 + // xtmp11 = xc2 xd2 xe2 xf2 + // xtmp15 = xc3 xd3 xe3 xf3 #ifdef D64STATS stop_meas(&ts_t); start_meas(&ts_d); #endif - + // xtmp0 = x00 x10 x20 x30 + // xtmp1 = x40 x50 x60 x70 + // xtmp2 = x80 x90 xa0 xb0 + // xtmp3 = xc0 xd0 xe0 xf0 dft16((int16_t*)(xtmp),(int16_t*)ytmp); + + // xtmp4 = x01 x11 x21 x31 + // xtmp5 = x41 x51 x61 x71 + // xtmp6 = x81 x91 xa1 xb1 + // xtmp7 = xc1 xd1 xe1 xf1 dft16((int16_t*)(xtmp+4),(int16_t*)(ytmp+4)); dft16((int16_t*)(xtmp+8),(int16_t*)(ytmp+8)); dft16((int16_t*)(xtmp+12),(int16_t*)(ytmp+12)); @@ -1853,6 +2757,153 @@ void dft64(int16_t *x,int16_t *y,int scale) } +#ifdef __AVX2__ +void dft64_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[16],ytmp[16],*tw64a_256=(simd256_q15_t *)tw64a,*tw64b_256=(simd256_q15_t *)tw64b,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y; + simd256_q15_t xintl0,xintl1,xintl2,xintl3,xintl4,xintl5,xintl6,xintl7; + simd256_q15_t const perm_mask = _mm256_set_epi32(7, 3, 6, 2, 5, 1, 4, 0); + + +#ifdef D64STATS + time_stats_t ts_t,ts_d,ts_b; + + reset_meas(&ts_t); + reset_meas(&ts_d); + reset_meas(&ts_b); + start_meas(&ts_t); +#endif + +#ifdef D64STATS + stop_meas(&ts_t); + start_meas(&ts_d); +#endif + + print_shorts256("x2560",(int16_t*)x256); + print_shorts256("x2561",(int16_t*)(x256+1)); + print_shorts256("x2562",(int16_t*)(x256+2)); + print_shorts256("x2563",(int16_t*)(x256+3)); + print_shorts256("x2564",(int16_t*)(x256+4)); + print_shorts256("x2565",(int16_t*)(x256+5)); + print_shorts256("x2566",(int16_t*)(x256+6)); + print_shorts256("x2567",(int16_t*)(x256+7)); + + xintl0 = _mm256_permutevar8x32_epi32(x256[0],perm_mask); // x0 x4 x1 x5 x2 x6 x3 x7 + xintl1 = _mm256_permutevar8x32_epi32(x256[1],perm_mask); // x8 x12 x9 x13 x10 x14 x11 x15 + xintl2 = _mm256_permutevar8x32_epi32(x256[2],perm_mask); // x16 x20 x17 x21 x18 x22 x19 x23 + xintl3 = _mm256_permutevar8x32_epi32(x256[3],perm_mask); // x24 x28 x25 x29 x26 x30 x27 x31 + xintl4 = _mm256_permutevar8x32_epi32(x256[4],perm_mask); // x32 x28 x25 x29 x26 x30 x27 x31 + xintl5 = _mm256_permutevar8x32_epi32(x256[5],perm_mask); // x40 x28 x25 x29 x26 x30 x27 x31 + xintl6 = _mm256_permutevar8x32_epi32(x256[6],perm_mask); // x48 x28 x25 x29 x26 x30 x27 x31 + xintl7 = _mm256_permutevar8x32_epi32(x256[7],perm_mask); // x56 x28 x25 x29 x26 x30 x27 x31 + + print_shorts256("xintl0",(int16_t*)&xintl0); + print_shorts256("xintl1",(int16_t*)&xintl1); + print_shorts256("xintl2",(int16_t*)&xintl2); + print_shorts256("xintl3",(int16_t*)&xintl3); + print_shorts256("xintl4",(int16_t*)&xintl4); + print_shorts256("xintl5",(int16_t*)&xintl5); + print_shorts256("xintl6",(int16_t*)&xintl6); + print_shorts256("xintl7",(int16_t*)&xintl7); + + xtmp[0] = _mm256_unpacklo_epi64(xintl0,xintl1); // x0 x4 x8 x12 x1 x5 x9 x13 + xtmp[4] = _mm256_unpackhi_epi64(xintl0,xintl1); // x2 x6 x10 x14 x3 x7 x11 x15 + xtmp[1] = _mm256_unpacklo_epi64(xintl2,xintl3); // x16 x20 x24 x28 x17 x21 x25 x29 + xtmp[5] = _mm256_unpackhi_epi64(xintl2,xintl3); // x18 x22 x26 x30 x19 x23 x27 x31 + xtmp[2] = _mm256_unpacklo_epi64(xintl4,xintl5); // x32 x36 x40 x44 x33 x37 x41 x45 + xtmp[6] = _mm256_unpackhi_epi64(xintl4,xintl5); // x34 x38 x42 x46 x35 x39 x43 x47 + xtmp[3] = _mm256_unpacklo_epi64(xintl6,xintl7); // x48 x52 x56 x60 x49 x53 x57 x61 + xtmp[7] = _mm256_unpackhi_epi64(xintl6,xintl7); // x50 x54 x58 x62 x51 x55 x59 x63 + + print_shorts256("xtmp0",(int16_t*)xtmp); + print_shorts256("xtmp1",(int16_t*)(xtmp+1)); + print_shorts256("xtmp2",(int16_t*)(xtmp+2)); + print_shorts256("xtmp3",(int16_t*)(xtmp+3)); + print_shorts256("xtmp4",(int16_t*)(xtmp+4)); + print_shorts256("xtmp5",(int16_t*)(xtmp+5)); + print_shorts256("xtmp6",(int16_t*)(xtmp+6)); + print_shorts256("xtmp7",(int16_t*)(xtmp+7)); + + dft16_simd256((int16_t*)(xtmp),(int16_t*)ytmp); + // [y0 y1 y2 y3 y4 y5 y6 y7] + // [y8 y9 y10 y11 y12 y13 y14 y15] + // [y16 y17 y18 y19 y20 y21 y22 y23] + // [y24 y25 y26 y27 y28 y29 y30 y31] + + print_shorts256("ytmp0",(int16_t*)ytmp); + print_shorts256("ytmp1",(int16_t*)(ytmp+1)); + print_shorts256("ytmp2",(int16_t*)(ytmp+2)); + print_shorts256("ytmp3",(int16_t*)(ytmp+3)); + + dft16_simd256((int16_t*)(xtmp+4),(int16_t*)(ytmp+4)); + // [y32 y33 y34 y35 y36 y37 y38 y39] + // [y40 y41 y42 y43 y44 y45 y46 y47] + // [y48 y49 y50 y51 y52 y53 y54 y55] + // [y56 y57 y58 y59 y60 y61 y62 y63] + + print_shorts256("ytmp4",(int16_t*)(ytmp+4)); + print_shorts256("ytmp5",(int16_t*)(ytmp+5)); + print_shorts256("ytmp6",(int16_t*)(ytmp+6)); + print_shorts256("ytmp7",(int16_t*)(ytmp+7)); +#ifdef D64STATS + stop_meas(&ts_d); + start_meas(&ts_b); +#endif + + + bfly4_16_256(ytmp,ytmp+2,ytmp+4,ytmp+6, + y256,y256+2,y256+4,y256+6, + tw64a_256,tw64a_256+2,tw64a_256+4, + tw64b_256,tw64b_256+2,tw64b_256+4); + // [y0 y1 y2 y3 y4 y5 y6 y7] + // [y16 y17 y18 y19 y20 y21 y22 y23] + // [y32 y33 y34 y35 y36 y37 y38 y39] + // [y48 y49 y50 y51 y52 y53 y54 y55] + + bfly4_16_256(ytmp+1,ytmp+3,ytmp+5,ytmp+7, + y256+1,y256+3,y256+5,y256+7, + tw64a_256+1,tw64a_256+3,tw64a_256+5, + tw64b_256+1,tw64b_256+3,tw64b_256+5); + // [y8 y9 y10 y11 y12 y13 y14 y15] + // [y24 y25 y26 y27 y28 y29 y30 y31] + // [y40 y41 y42 y43 y44 y45 y46 y47] + // [y56 y57 y58 y59 y60 y61 y62 y63] + + print_shorts256("y256_0",(int16_t*)&y256[0]); + print_shorts256("y256_1",(int16_t*)&y256[1]); + print_shorts256("y256_2",(int16_t*)&y256[2]); + print_shorts256("y256_3",(int16_t*)&y256[3]); + print_shorts256("y256_4",(int16_t*)&y256[4]); + print_shorts256("y256_5",(int16_t*)&y256[5]); + print_shorts256("y256_6",(int16_t*)&y256[6]); + print_shorts256("y256_7",(int16_t*)&y256[7]); + + +#ifdef D64STATS + stop_meas(&ts_b); + printf("t: %llu cycles, d: %llu cycles, b: %llu cycles\n",ts_t.diff,ts_d.diff,ts_b.diff); +#endif + + + if (scale>0) { + y256[0] = shiftright_int16_simd256(y256[0],3); + y256[1] = shiftright_int16_simd256(y256[1],3); + y256[2] = shiftright_int16_simd256(y256[2],3); + y256[3] = shiftright_int16_simd256(y256[3],3); + y256[4] = shiftright_int16_simd256(y256[4],3); + y256[5] = shiftright_int16_simd256(y256[5],3); + y256[6] = shiftright_int16_simd256(y256[6],3); + y256[7] = shiftright_int16_simd256(y256[7],3); + } + + _mm_empty(); + _m_empty(); + + +} +#endif + void idft64(int16_t *x,int16_t *y,int scale) { @@ -1897,7 +2948,6 @@ void idft64(int16_t *x,int16_t *y,int scale) y128,y128+4,y128+8,y128+12, tw64a_128,tw64a_128+4,tw64a_128+8, tw64b_128,tw64b_128+4,tw64b_128+8); - ibfly4_16(ytmp+1,ytmp+5,ytmp+9,ytmp+13, y128+1,y128+5,y128+9,y128+13, tw64a_128+1,tw64a_128+5,tw64a_128+9, @@ -1945,14 +2995,115 @@ void idft64(int16_t *x,int16_t *y,int scale) } +#ifdef __AVX2__ +void idft64_simd256(int16_t *x,int16_t *y,int scale) +{ -int16_t tw128[128] __attribute__((aligned(16))) = { 32767,0,32727,-1608,32609,-3212,32412,-4808,32137,-6393,31785,-7962,31356,-9512,30851,-11039,30272,-12540,29621,-14010,28897,-15447,28105,-16846,27244,-18205,26318,-19520,25329,-20788,24278,-22005,23169,-23170,22004,-24279,20787,-25330,19519,-26319,18204,-27245,16845,-28106,15446,-28898,14009,-29622,12539,-30273,11038,-30852,9511,-31357,7961,-31786,6392,-32138,4807,-32413,3211,-32610,1607,-32728,0,-32767,-1608,-32728,-3212,-32610,-4808,-32413,-6393,-32138,-7962,-31786,-9512,-31357,-11039,-30852,-12540,-30273,-14010,-29622,-15447,-28898,-16846,-28106,-18205,-27245,-19520,-26319,-20788,-25330,-22005,-24279,-23170,-23170,-24279,-22005,-25330,-20788,-26319,-19520,-27245,-18205,-28106,-16846,-28898,-15447,-29622,-14010,-30273,-12540,-30852,-11039,-31357,-9512,-31786,-7962,-32138,-6393,-32413,-4808,-32610,-3212,-32728,-1608}; + simd256_q15_t xtmp[16],ytmp[16],*tw64a_256=(simd256_q15_t *)tw64,*tw64b_256=(simd256_q15_t *)tw64c,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y; + register simd256_q15_t xintl0,xintl1,xintl2,xintl3,xintl4,xintl5,xintl6,xintl7; + simd256_q15_t const perm_mask = _mm256_set_epi32(7, 3, 6, 2, 5, 1, 4, 0); -int16_t tw128a[128] __attribute__((aligned(16))) = { 32767,0,32727,1608,32609,3212,32412,4808,32137,6393,31785,7962,31356,9512,30851,11039,30272,12540,29621,14010,28897,15447,28105,16846,27244,18205,26318,19520,25329,20788,24278,22005,23169,23170,22004,24279,20787,25330,19519,26319,18204,27245,16845,28106,15446,28898,14009,29622,12539,30273,11038,30852,9511,31357,7961,31786,6392,32138,4807,32413,3211,32610,1607,32728,0,32767,-1608,32728,-3212,32610,-4808,32413,-6393,32138,-7962,31786,-9512,31357,-11039,30852,-12540,30273,-14010,29622,-15447,28898,-16846,28106,-18205,27245,-19520,26319,-20788,25330,-22005,24279,-23170,23170,-24279,22005,-25330,20788,-26319,19520,-27245,18205,-28106,16846,-28898,15447,-29622,14010,-30273,12540,-30852,11039,-31357,9512,-31786,7962,-32138,6393,-32413,4808,-32610,3212,-32728,1608}; -int16_t tw128b[128] __attribute__((aligned(16))) = {0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607,-32767,0,-32728,-1608,-32610,-3212,-32413,-4808,-32138,-6393,-31786,-7962,-31357,-9512,-30852,-11039,-30273,-12540,-29622,-14010,-28898,-15447,-28106,-16846,-27245,-18205,-26319,-19520,-25330,-20788,-24279,-22005,-23170,-23170,-22005,-24279,-20788,-25330,-19520,-26319,-18205,-27245,-16846,-28106,-15447,-28898,-14010,-29622,-12540,-30273,-11039,-30852,-9512,-31357,-7962,-31786,-6393,-32138,-4808,-32413,-3212,-32610,-1608,-32728}; +#ifdef D64STATS + time_stats_t ts_t,ts_d,ts_b; -int16_t tw128c[128] __attribute__((aligned(16))) = {0,32767,1608,32727,3212,32609,4808,32412,6393,32137,7962,31785,9512,31356,11039,30851,12540,30272,14010,29621,15447,28897,16846,28105,18205,27244,19520,26318,20788,25329,22005,24278,23170,23169,24279,22004,25330,20787,26319,19519,27245,18204,28106,16845,28898,15446,29622,14009,30273,12539,30852,11038,31357,9511,31786,7961,32138,6392,32413,4807,32610,3211,32728,1607,32767,0,32728,-1608,32610,-3212,32413,-4808,32138,-6393,31786,-7962,31357,-9512,30852,-11039,30273,-12540,29622,-14010,28898,-15447,28106,-16846,27245,-18205,26319,-19520,25330,-20788,24279,-22005,23170,-23170,22005,-24279,20788,-25330,19520,-26319,18205,-27245,16846,-28106,15447,-28898,14010,-29622,12540,-30273,11039,-30852,9512,-31357,7962,-31786,6393,-32138,4808,-32413,3212,-32610,1608,-32728}; + reset_meas(&ts_t); + reset_meas(&ts_d); + reset_meas(&ts_b); + start_meas(&ts_t); +#endif + +#ifdef D64STATS + stop_meas(&ts_t); + start_meas(&ts_d); +#endif + + xintl0 = _mm256_permutevar8x32_epi32(x256[0],perm_mask); // x0 x4 x1 x5 x2 x6 x3 x7 + xintl1 = _mm256_permutevar8x32_epi32(x256[1],perm_mask); // x8 x12 x9 x13 x10 x14 x11 x15 + xintl2 = _mm256_permutevar8x32_epi32(x256[2],perm_mask); // x16 x20 x17 x21 x18 x22 x19 x23 + xintl3 = _mm256_permutevar8x32_epi32(x256[3],perm_mask); // x24 x28 x25 x29 x26 x30 x27 x31 + xintl4 = _mm256_permutevar8x32_epi32(x256[4],perm_mask); // x24 x28 x25 x29 x26 x30 x27 x31 + xintl5 = _mm256_permutevar8x32_epi32(x256[5],perm_mask); // x24 x28 x25 x29 x26 x30 x27 x31 + xintl6 = _mm256_permutevar8x32_epi32(x256[6],perm_mask); // x24 x28 x25 x29 x26 x30 x27 x31 + xintl7 = _mm256_permutevar8x32_epi32(x256[7],perm_mask); // x24 x28 x25 x29 x26 x30 x27 x31 + + xtmp[0] = _mm256_unpacklo_epi64(xintl0,xintl1); // x0 x4 x8 x12 x1 x5 x9 x13 + xtmp[4] = _mm256_unpackhi_epi64(xintl0,xintl1); // x2 x6 x10 x14 x3 x7 x11 x15 + xtmp[1] = _mm256_unpacklo_epi64(xintl2,xintl3); // x16 x20 x24 x28 x17 x21 x25 x29 + xtmp[5] = _mm256_unpackhi_epi64(xintl2,xintl3); // x18 x22 x26 x30 x19 x23 x27 x31 + xtmp[2] = _mm256_unpacklo_epi64(xintl4,xintl5); // x32 x36 x40 x44 x33 x37 x41 x45 + xtmp[6] = _mm256_unpackhi_epi64(xintl4,xintl5); // x34 x38 x42 x46 x35 x39 x43 x47 + xtmp[3] = _mm256_unpacklo_epi64(xintl6,xintl7); // x48 x52 x56 x60 x49 x53 x57 x61 + xtmp[7] = _mm256_unpackhi_epi64(xintl6,xintl7); // x50 x54 x58 x62 x51 x55 x59 x63 + + + idft16_simd256((int16_t*)(xtmp),(int16_t*)ytmp); + // [y0 y1 y2 y3 y16 y17 y18 y19] + // [y4 y5 y6 y7 y20 y21 y22 y23] + // [y8 y9 y10 y11 y24 y25 y26 y27] + // [y12 y13 y14 y15 y28 y29 y30 y31] + + idft16_simd256((int16_t*)(xtmp+4),(int16_t*)(ytmp+4)); + // [y32 y33 y34 y35 y48 y49 y50 y51] + // [y36 y37 y38 y39 y52 y53 y54 y55] + // [y40 y41 y42 y43 y56 y57 y58 y59] + // [y44 y45 y46 y47 y60 y61 y62 y63] + +#ifdef D64STATS + stop_meas(&ts_d); + start_meas(&ts_b); +#endif + + + ibfly4_16_256(ytmp,ytmp+2,ytmp+4,ytmp+6, + y256,y256+2,y256+4,y256+6, + tw64a_256,tw64a_256+2,tw64a_256+4, + tw64b_256,tw64b_256+2,tw64b_256+4); + // [y0 y1 y2 y3 y4 y5 y6 y7] + // [y16 y17 y18 y19 y20 y21 y22 y23] + // [y32 y33 y34 y35 y36 y37 y38 y39] + // [y48 y49 y50 y51 y52 y53 y54 y55] + + ibfly4_16_256(ytmp+1,ytmp+3,ytmp+5,ytmp+7, + y256+1,y256+3,y256+5,y256+7, + tw64a_256+1,tw64a_256+3,tw64a_256+5, + tw64b_256+1,tw64b_256+3,tw64b_256+5); + // [y8 y9 y10 y11 y12 y13 y14 y15] + // [y24 y25 y26 y27 y28 y29 y30 y31] + // [y40 y41 y42 y43 y44 y45 y46 y47] + // [y56 y57 y58 y59 y60 y61 y62 y63] + + +#ifdef D64STATS + stop_meas(&ts_b); + printf("t: %llu cycles, d: %llu cycles, b: %llu cycles\n",ts_t.diff,ts_d.diff,ts_b.diff); +#endif + + + if (scale>0) { + y256[0] = shiftright_int16_simd256(y256[0],3); + y256[1] = shiftright_int16_simd256(y256[1],3); + y256[2] = shiftright_int16_simd256(y256[2],3); + y256[3] = shiftright_int16_simd256(y256[3],3); + y256[4] = shiftright_int16_simd256(y256[4],3); + y256[5] = shiftright_int16_simd256(y256[5],3); + y256[6] = shiftright_int16_simd256(y256[6],3); + y256[7] = shiftright_int16_simd256(y256[7],3); + } + + _mm_empty(); + _m_empty(); + +} +#endif + +int16_t tw128[128] __attribute__((aligned(32))) = { 32767,0,32727,-1608,32609,-3212,32412,-4808,32137,-6393,31785,-7962,31356,-9512,30851,-11039,30272,-12540,29621,-14010,28897,-15447,28105,-16846,27244,-18205,26318,-19520,25329,-20788,24278,-22005,23169,-23170,22004,-24279,20787,-25330,19519,-26319,18204,-27245,16845,-28106,15446,-28898,14009,-29622,12539,-30273,11038,-30852,9511,-31357,7961,-31786,6392,-32138,4807,-32413,3211,-32610,1607,-32728,0,-32767,-1608,-32728,-3212,-32610,-4808,-32413,-6393,-32138,-7962,-31786,-9512,-31357,-11039,-30852,-12540,-30273,-14010,-29622,-15447,-28898,-16846,-28106,-18205,-27245,-19520,-26319,-20788,-25330,-22005,-24279,-23170,-23170,-24279,-22005,-25330,-20788,-26319,-19520,-27245,-18205,-28106,-16846,-28898,-15447,-29622,-14010,-30273,-12540,-30852,-11039,-31357,-9512,-31786,-7962,-32138,-6393,-32413,-4808,-32610,-3212,-32728,-1608}; + +int16_t tw128a[128] __attribute__((aligned(32))) = { 32767,0,32727,1608,32609,3212,32412,4808,32137,6393,31785,7962,31356,9512,30851,11039,30272,12540,29621,14010,28897,15447,28105,16846,27244,18205,26318,19520,25329,20788,24278,22005,23169,23170,22004,24279,20787,25330,19519,26319,18204,27245,16845,28106,15446,28898,14009,29622,12539,30273,11038,30852,9511,31357,7961,31786,6392,32138,4807,32413,3211,32610,1607,32728,0,32767,-1608,32728,-3212,32610,-4808,32413,-6393,32138,-7962,31786,-9512,31357,-11039,30852,-12540,30273,-14010,29622,-15447,28898,-16846,28106,-18205,27245,-19520,26319,-20788,25330,-22005,24279,-23170,23170,-24279,22005,-25330,20788,-26319,19520,-27245,18205,-28106,16846,-28898,15447,-29622,14010,-30273,12540,-30852,11039,-31357,9512,-31786,7962,-32138,6393,-32413,4808,-32610,3212,-32728,1608}; + +int16_t tw128b[128] __attribute__((aligned(32))) = {0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607,-32767,0,-32728,-1608,-32610,-3212,-32413,-4808,-32138,-6393,-31786,-7962,-31357,-9512,-30852,-11039,-30273,-12540,-29622,-14010,-28898,-15447,-28106,-16846,-27245,-18205,-26319,-19520,-25330,-20788,-24279,-22005,-23170,-23170,-22005,-24279,-20788,-25330,-19520,-26319,-18205,-27245,-16846,-28106,-15447,-28898,-14010,-29622,-12540,-30273,-11039,-30852,-9512,-31357,-7962,-31786,-6393,-32138,-4808,-32413,-3212,-32610,-1608,-32728}; + +int16_t tw128c[128] __attribute__((aligned(32))) = {0,32767,1608,32727,3212,32609,4808,32412,6393,32137,7962,31785,9512,31356,11039,30851,12540,30272,14010,29621,15447,28897,16846,28105,18205,27244,19520,26318,20788,25329,22005,24278,23170,23169,24279,22004,25330,20787,26319,19519,27245,18204,28106,16845,28898,15446,29622,14009,30273,12539,30852,11038,31357,9511,31786,7961,32138,6392,32413,4807,32610,3211,32728,1607,32767,0,32728,-1608,32610,-3212,32413,-4808,32138,-6393,31786,-7962,31357,-9512,30852,-11039,30273,-12540,29622,-14010,28898,-15447,28106,-16846,27245,-18205,26319,-19520,25330,-20788,24279,-22005,23170,-23170,22005,-24279,20788,-25330,19520,-26319,18205,-27245,16846,-28106,15447,-28898,14010,-29622,12540,-30273,11039,-30852,9512,-31357,7962,-31786,6393,-32138,4808,-32413,3212,-32610,1608,-32728}; void dft128(int16_t *x,int16_t *y,int scale) { @@ -2000,6 +3151,8 @@ void dft128(int16_t *x,int16_t *y,int scale) dft64((int16_t*)(xtmp),(int16_t*)ytmp,1); dft64((int16_t*)(xtmp+32),(int16_t*)(ytmp+16),1); + /* write_output("dft128a.m","dfta",ytmp,64,1,1); + write_output("dft128b.m","dftb",ytmp+16,64,1,1);*/ for (i=0; i<16; i++) { bfly2_16(ytmpp,ytmpp+16, @@ -2050,11 +3203,81 @@ void dft128(int16_t *x,int16_t *y,int scale) } + /* write_output("dft128out.m","dft128",y,128,1,1); + exit(-1);*/ _mm_empty(); _m_empty(); } +#ifdef __AVX2__ +void dft128_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[16],*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[16],*y256=(simd256_q15_t*)y; + simd256_q15_t *tw128a_256p=(simd256_q15_t *)tw128a,*tw128b_256p=(simd256_q15_t *)tw128b,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_256 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + transpose4_ooff_simd256(x256 ,xtmp,8); + transpose4_ooff_simd256(x256+2,xtmp+1,8); + transpose4_ooff_simd256(x256+4,xtmp+2,8); + transpose4_ooff_simd256(x256+6,xtmp+3,8); + transpose4_ooff_simd256(x256+8,xtmp+4,8); + transpose4_ooff_simd256(x256+10,xtmp+5,8); + transpose4_ooff_simd256(x256+12,xtmp+6,8); + transpose4_ooff_simd256(x256+14,xtmp+7,8); + + write_output("dft128ina_256.m","dftina",xtmp,64,1,1); + write_output("dft128inb_256.m","dftinb",xtmp+8,64,1,1); + + dft64_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); + dft64_simd256((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); + + write_output("dft128outa_256.m","dftouta",ytmp,64,1,1); + write_output("dft128outb_256.m","dftoutb",ytmp+8,64,1,1); + + + for (i=0; i<8; i++) { + bfly2_16_256(ytmpp,ytmpp+8, + y256p,y256p+8, + tw128a_256p, + tw128b_256p); + tw128a_256p++; + tw128b_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + y256[0] = mulhi_int16_simd256(y256[0],ONE_OVER_SQRT2_Q15_256); + y256[1] = mulhi_int16_simd256(y256[1],ONE_OVER_SQRT2_Q15_256); + y256[2] = mulhi_int16_simd256(y256[2],ONE_OVER_SQRT2_Q15_256); + y256[3] = mulhi_int16_simd256(y256[3],ONE_OVER_SQRT2_Q15_256); + y256[4] = mulhi_int16_simd256(y256[4],ONE_OVER_SQRT2_Q15_256); + y256[5] = mulhi_int16_simd256(y256[5],ONE_OVER_SQRT2_Q15_256); + y256[6] = mulhi_int16_simd256(y256[6],ONE_OVER_SQRT2_Q15_256); + y256[7] = mulhi_int16_simd256(y256[7],ONE_OVER_SQRT2_Q15_256); + y256[8] = mulhi_int16_simd256(y256[8],ONE_OVER_SQRT2_Q15_256); + y256[9] = mulhi_int16_simd256(y256[9],ONE_OVER_SQRT2_Q15_256); + y256[10] = mulhi_int16_simd256(y256[10],ONE_OVER_SQRT2_Q15_256); + y256[11] = mulhi_int16_simd256(y256[11],ONE_OVER_SQRT2_Q15_256); + y256[12] = mulhi_int16_simd256(y256[12],ONE_OVER_SQRT2_Q15_256); + y256[13] = mulhi_int16_simd256(y256[13],ONE_OVER_SQRT2_Q15_256); + y256[14] = mulhi_int16_simd256(y256[14],ONE_OVER_SQRT2_Q15_256); + y256[15] = mulhi_int16_simd256(y256[15],ONE_OVER_SQRT2_Q15_256); + + } + + write_output("dft128.m","dft",y256,128,1,1); + exit(-1); +} + +#endif + void idft128(int16_t *x,int16_t *y,int scale) { @@ -2153,18 +3376,78 @@ void idft128(int16_t *x,int16_t *y,int scale) } +#ifdef __AVX2__ +void idft128_simd256(int16_t *x,int16_t *y,int scale) +{ -int16_t tw256[384] __attribute__((aligned(16))) = { 32767,0,32757,-805,32727,-1608,32678,-2411,32609,-3212,32520,-4012,32412,-4808,32284,-5602,32137,-6393,31970,-7180,31785,-7962,31580,-8740,31356,-9512,31113,-10279,30851,-11039,30571,-11793,30272,-12540,29955,-13279,29621,-14010,29268,-14733,28897,-15447,28510,-16151,28105,-16846,27683,-17531,27244,-18205,26789,-18868,26318,-19520,25831,-20160,25329,-20788,24811,-21403,24278,-22005,23731,-22595,23169,-23170,22594,-23732,22004,-24279,21402,-24812,20787,-25330,20159,-25832,19519,-26319,18867,-26790,18204,-27245,17530,-27684,16845,-28106,16150,-28511,15446,-28898,14732,-29269,14009,-29622,13278,-29956,12539,-30273,11792,-30572,11038,-30852,10278,-31114,9511,-31357,8739,-31581,7961,-31786,7179,-31971,6392,-32138,5601,-32285,4807,-32413,4011,-32521,3211,-32610,2410,-32679,1607,-32728,804,-32758, + simd256_q15_t xtmp[16],*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[16],*y256=(simd256_q15_t*)y; + simd256_q15_t *tw128_256p=(simd256_q15_t *)tw128,*tw128c_256p=(simd256_q15_t *)tw128c,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_256 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + + transpose4_ooff_simd256(x256 ,xtmp,8); + transpose4_ooff_simd256(x256+2,xtmp+1,8); + transpose4_ooff_simd256(x256+4,xtmp+2,8); + transpose4_ooff_simd256(x256+6,xtmp+3,8); + transpose4_ooff_simd256(x256+8,xtmp+4,8); + transpose4_ooff_simd256(x256+10,xtmp+5,8); + transpose4_ooff_simd256(x256+12,xtmp+6,8); + transpose4_ooff_simd256(x256+14,xtmp+7,8); + + dft64_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); + dft64_simd256((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); + + + for (i=0; i<8; i++) { + bfly2_16_256(ytmpp,ytmpp+8, + y256p,y256p+8, + tw128_256p, + tw128c_256p); + tw128_256p++; + tw128c_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + y256[0] = mulhi_int16_simd256(y256[0],ONE_OVER_SQRT2_Q15_256); + y256[1] = mulhi_int16_simd256(y256[1],ONE_OVER_SQRT2_Q15_256); + y256[2] = mulhi_int16_simd256(y256[2],ONE_OVER_SQRT2_Q15_256); + y256[3] = mulhi_int16_simd256(y256[3],ONE_OVER_SQRT2_Q15_256); + y256[4] = mulhi_int16_simd256(y256[4],ONE_OVER_SQRT2_Q15_256); + y256[5] = mulhi_int16_simd256(y256[5],ONE_OVER_SQRT2_Q15_256); + y256[6] = mulhi_int16_simd256(y256[6],ONE_OVER_SQRT2_Q15_256); + y256[7] = mulhi_int16_simd256(y256[7],ONE_OVER_SQRT2_Q15_256); + y256[8] = mulhi_int16_simd256(y256[8],ONE_OVER_SQRT2_Q15_256); + y256[9] = mulhi_int16_simd256(y256[9],ONE_OVER_SQRT2_Q15_256); + y256[10] = mulhi_int16_simd256(y256[10],ONE_OVER_SQRT2_Q15_256); + y256[11] = mulhi_int16_simd256(y256[11],ONE_OVER_SQRT2_Q15_256); + y256[12] = mulhi_int16_simd256(y256[12],ONE_OVER_SQRT2_Q15_256); + y256[13] = mulhi_int16_simd256(y256[13],ONE_OVER_SQRT2_Q15_256); + y256[14] = mulhi_int16_simd256(y256[14],ONE_OVER_SQRT2_Q15_256); + y256[15] = mulhi_int16_simd256(y256[15],ONE_OVER_SQRT2_Q15_256); + + } + +} + +#endif + +int16_t tw256[384] __attribute__((aligned(32))) = { 32767,0,32757,-805,32727,-1608,32678,-2411,32609,-3212,32520,-4012,32412,-4808,32284,-5602,32137,-6393,31970,-7180,31785,-7962,31580,-8740,31356,-9512,31113,-10279,30851,-11039,30571,-11793,30272,-12540,29955,-13279,29621,-14010,29268,-14733,28897,-15447,28510,-16151,28105,-16846,27683,-17531,27244,-18205,26789,-18868,26318,-19520,25831,-20160,25329,-20788,24811,-21403,24278,-22005,23731,-22595,23169,-23170,22594,-23732,22004,-24279,21402,-24812,20787,-25330,20159,-25832,19519,-26319,18867,-26790,18204,-27245,17530,-27684,16845,-28106,16150,-28511,15446,-28898,14732,-29269,14009,-29622,13278,-29956,12539,-30273,11792,-30572,11038,-30852,10278,-31114,9511,-31357,8739,-31581,7961,-31786,7179,-31971,6392,-32138,5601,-32285,4807,-32413,4011,-32521,3211,-32610,2410,-32679,1607,-32728,804,-32758, 32767,0,32727,-1608,32609,-3212,32412,-4808,32137,-6393,31785,-7962,31356,-9512,30851,-11039,30272,-12540,29621,-14010,28897,-15447,28105,-16846,27244,-18205,26318,-19520,25329,-20788,24278,-22005,23169,-23170,22004,-24279,20787,-25330,19519,-26319,18204,-27245,16845,-28106,15446,-28898,14009,-29622,12539,-30273,11038,-30852,9511,-31357,7961,-31786,6392,-32138,4807,-32413,3211,-32610,1607,-32728,0,-32767,-1608,-32728,-3212,-32610,-4808,-32413,-6393,-32138,-7962,-31786,-9512,-31357,-11039,-30852,-12540,-30273,-14010,-29622,-15447,-28898,-16846,-28106,-18205,-27245,-19520,-26319,-20788,-25330,-22005,-24279,-23170,-23170,-24279,-22005,-25330,-20788,-26319,-19520,-27245,-18205,-28106,-16846,-28898,-15447,-29622,-14010,-30273,-12540,-30852,-11039,-31357,-9512,-31786,-7962,-32138,-6393,-32413,-4808,-32610,-3212,-32728,-1608, 32767,0,32678,-2411,32412,-4808,31970,-7180,31356,-9512,30571,-11793,29621,-14010,28510,-16151,27244,-18205,25831,-20160,24278,-22005,22594,-23732,20787,-25330,18867,-26790,16845,-28106,14732,-29269,12539,-30273,10278,-31114,7961,-31786,5601,-32285,3211,-32610,804,-32758,-1608,-32728,-4012,-32521,-6393,-32138,-8740,-31581,-11039,-30852,-13279,-29956,-15447,-28898,-17531,-27684,-19520,-26319,-21403,-24812,-23170,-23170,-24812,-21403,-26319,-19520,-27684,-17531,-28898,-15447,-29956,-13279,-30852,-11039,-31581,-8740,-32138,-6393,-32521,-4012,-32728,-1608,-32758,804,-32610,3211,-32285,5601,-31786,7961,-31114,10278,-30273,12539,-29269,14732,-28106,16845,-26790,18867,-25330,20787,-23732,22594,-22005,24278,-20160,25831,-18205,27244,-16151,28510,-14010,29621,-11793,30571,-9512,31356,-7180,31970,-4808,32412,-2411,32678 }; -int16_t tw256a[384] __attribute__((aligned(16))) = { 32767,0,32757,804,32727,1607,32678,2410,32609,3211,32520,4011,32412,4807,32284,5601,32137,6392,31970,7179,31785,7961,31580,8739,31356,9511,31113,10278,30851,11038,30571,11792,30272,12539,29955,13278,29621,14009,29268,14732,28897,15446,28510,16150,28105,16845,27683,17530,27244,18204,26789,18867,26318,19519,25831,20159,25329,20787,24811,21402,24278,22004,23731,22594,23169,23169,22594,23731,22004,24278,21402,24811,20787,25329,20159,25831,19519,26318,18867,26789,18204,27244,17530,27683,16845,28105,16150,28510,15446,28897,14732,29268,14009,29621,13278,29955,12539,30272,11792,30571,11038,30851,10278,31113,9511,31356,8739,31580,7961,31785,7179,31970,6392,32137,5601,32284,4807,32412,4011,32520,3211,32609,2410,32678,1607,32727,804,32757, +int16_t tw256a[384] __attribute__((aligned(32))) = { 32767,0,32757,804,32727,1607,32678,2410,32609,3211,32520,4011,32412,4807,32284,5601,32137,6392,31970,7179,31785,7961,31580,8739,31356,9511,31113,10278,30851,11038,30571,11792,30272,12539,29955,13278,29621,14009,29268,14732,28897,15446,28510,16150,28105,16845,27683,17530,27244,18204,26789,18867,26318,19519,25831,20159,25329,20787,24811,21402,24278,22004,23731,22594,23169,23169,22594,23731,22004,24278,21402,24811,20787,25329,20159,25831,19519,26318,18867,26789,18204,27244,17530,27683,16845,28105,16150,28510,15446,28897,14732,29268,14009,29621,13278,29955,12539,30272,11792,30571,11038,30851,10278,31113,9511,31356,8739,31580,7961,31785,7179,31970,6392,32137,5601,32284,4807,32412,4011,32520,3211,32609,2410,32678,1607,32727,804,32757, 32767,0,32727,1607,32609,3211,32412,4807,32137,6392,31785,7961,31356,9511,30851,11038,30272,12539,29621,14009,28897,15446,28105,16845,27244,18204,26318,19519,25329,20787,24278,22004,23169,23169,22004,24278,20787,25329,19519,26318,18204,27244,16845,28105,15446,28897,14009,29621,12539,30272,11038,30851,9511,31356,7961,31785,6392,32137,4807,32412,3211,32609,1607,32727,0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607, 32767,0,32678,2410,32412,4807,31970,7179,31356,9511,30571,11792,29621,14009,28510,16150,27244,18204,25831,20159,24278,22004,22594,23731,20787,25329,18867,26789,16845,28105,14732,29268,12539,30272,10278,31113,7961,31785,5601,32284,3211,32609,804,32757,-1608,32727,-4012,32520,-6393,32137,-8740,31580,-11039,30851,-13279,29955,-15447,28897,-17531,27683,-19520,26318,-21403,24811,-23170,23169,-24812,21402,-26319,19519,-27684,17530,-28898,15446,-29956,13278,-30852,11038,-31581,8739,-32138,6392,-32521,4011,-32728,1607,-32758,-805,-32610,-3212,-32285,-5602,-31786,-7962,-31114,-10279,-30273,-12540,-29269,-14733,-28106,-16846,-26790,-18868,-25330,-20788,-23732,-22595,-22005,-24279,-20160,-25832,-18205,-27245,-16151,-28511,-14010,-29622,-11793,-30572,-9512,-31357,-7180,-31971,-4808,-32413,-2411,-32679 }; -int16_t tw256b[384] __attribute__((aligned(16))) = {0,32767,-805,32757,-1608,32727,-2411,32678,-3212,32609,-4012,32520,-4808,32412,-5602,32284,-6393,32137,-7180,31970,-7962,31785,-8740,31580,-9512,31356,-10279,31113,-11039,30851,-11793,30571,-12540,30272,-13279,29955,-14010,29621,-14733,29268,-15447,28897,-16151,28510,-16846,28105,-17531,27683,-18205,27244,-18868,26789,-19520,26318,-20160,25831,-20788,25329,-21403,24811,-22005,24278,-22595,23731,-23170,23169,-23732,22594,-24279,22004,-24812,21402,-25330,20787,-25832,20159,-26319,19519,-26790,18867,-27245,18204,-27684,17530,-28106,16845,-28511,16150,-28898,15446,-29269,14732,-29622,14009,-29956,13278,-30273,12539,-30572,11792,-30852,11038,-31114,10278,-31357,9511,-31581,8739,-31786,7961,-31971,7179,-32138,6392,-32285,5601,-32413,4807,-32521,4011,-32610,3211,-32679,2410,-32728,1607,-32758,804, +int16_t tw256b[384] __attribute__((aligned(32))) = {0,32767,-805,32757,-1608,32727,-2411,32678,-3212,32609,-4012,32520,-4808,32412,-5602,32284,-6393,32137,-7180,31970,-7962,31785,-8740,31580,-9512,31356,-10279,31113,-11039,30851,-11793,30571,-12540,30272,-13279,29955,-14010,29621,-14733,29268,-15447,28897,-16151,28510,-16846,28105,-17531,27683,-18205,27244,-18868,26789,-19520,26318,-20160,25831,-20788,25329,-21403,24811,-22005,24278,-22595,23731,-23170,23169,-23732,22594,-24279,22004,-24812,21402,-25330,20787,-25832,20159,-26319,19519,-26790,18867,-27245,18204,-27684,17530,-28106,16845,-28511,16150,-28898,15446,-29269,14732,-29622,14009,-29956,13278,-30273,12539,-30572,11792,-30852,11038,-31114,10278,-31357,9511,-31581,8739,-31786,7961,-31971,7179,-32138,6392,-32285,5601,-32413,4807,-32521,4011,-32610,3211,-32679,2410,-32728,1607,-32758,804, 0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607,-32767,0,-32728,-1608,-32610,-3212,-32413,-4808,-32138,-6393,-31786,-7962,-31357,-9512,-30852,-11039,-30273,-12540,-29622,-14010,-28898,-15447,-28106,-16846,-27245,-18205,-26319,-19520,-25330,-20788,-24279,-22005,-23170,-23170,-22005,-24279,-20788,-25330,-19520,-26319,-18205,-27245,-16846,-28106,-15447,-28898,-14010,-29622,-12540,-30273,-11039,-30852,-9512,-31357,-7962,-31786,-6393,-32138,-4808,-32413,-3212,-32610,-1608,-32728, 0,32767,-2411,32678,-4808,32412,-7180,31970,-9512,31356,-11793,30571,-14010,29621,-16151,28510,-18205,27244,-20160,25831,-22005,24278,-23732,22594,-25330,20787,-26790,18867,-28106,16845,-29269,14732,-30273,12539,-31114,10278,-31786,7961,-32285,5601,-32610,3211,-32758,804,-32728,-1608,-32521,-4012,-32138,-6393,-31581,-8740,-30852,-11039,-29956,-13279,-28898,-15447,-27684,-17531,-26319,-19520,-24812,-21403,-23170,-23170,-21403,-24812,-19520,-26319,-17531,-27684,-15447,-28898,-13279,-29956,-11039,-30852,-8740,-31581,-6393,-32138,-4012,-32521,-1608,-32728,804,-32758,3211,-32610,5601,-32285,7961,-31786,10278,-31114,12539,-30273,14732,-29269,16845,-28106,18867,-26790,20787,-25330,22594,-23732,24278,-22005,25831,-20160,27244,-18205,28510,-16151,29621,-14010,30571,-11793,31356,-9512,31970,-7180,32412,-4808,32678,-2411 }; @@ -2337,21 +3620,194 @@ void idft256(int16_t *x,int16_t *y,int scale) } -int16_t tw512[512] __attribute__((aligned(16))) = { +#ifdef __AVX2__ + +void dft256_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[64],ytmp[64],*tw256a_256p=(simd256_q15_t *)tw256a,*tw256b_256p=(simd256_q15_t *)tw256b,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + + transpose16_ooff_simd256(x256+0,xtmp+0,8); + transpose16_ooff_simd256(x256+4,xtmp+1,8); + transpose16_ooff_simd256(x256+8,xtmp+2,8); + transpose16_ooff_simd256(x256+12,xtmp+3,8); + transpose16_ooff_simd256(x256+16,xtmp+4,8); + transpose16_ooff_simd256(x256+20,xtmp+5,8); + transpose16_ooff_simd256(x256+24,xtmp+6,8); + transpose16_ooff_simd256(x256+28,xtmp+7,8); + + dft64_simd256((int16_t*)(xtmp),(int16_t*)(ytmp),1); + dft64_simd256((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); + dft64_simd256((int16_t*)(xtmp+16),(int16_t*)(ytmp+16),1); + dft64_simd256((int16_t*)(xtmp+24),(int16_t*)(ytmp+24),1); + + + bfly4_16_256(ytmpp,ytmpp+8,ytmpp+16,ytmpp+24, + y256p,y256p+8,y256p+16,y256p+24, + tw256a_256p,tw256a_256p+8,tw256a_256p+16, + tw256b_256p,tw256b_256p+8,tw256b_256p+16); + bfly4_16_256(ytmpp+1,ytmpp+9,ytmpp+17,ytmpp+25, + y256p+1,y256p+9,y256p+17,y256p+25, + tw256a_256p+1,tw256a_256p+9,tw256a_256p+17, + tw256b_256p+1,tw256b_256p+9,tw256b_256p+17); + bfly4_16_256(ytmpp+2,ytmpp+10,ytmpp+18,ytmpp+26, + y256p+2,y256p+10,y256p+18,y256p+26, + tw256a_256p+2,tw256a_256p+10,tw256a_256p+18, + tw256b_256p+2,tw256b_256p+10,tw256b_256p+18); + bfly4_16_256(ytmpp+3,ytmpp+11,ytmpp+19,ytmpp+27, + y256p+3,y256p+11,y256p+19,y256p+27, + tw256a_256p+3,tw256a_256p+11,tw256a_256p+19, + tw256b_256p+3,tw256b_256p+11,tw256b_256p+19); + bfly4_16_256(ytmpp+4,ytmpp+12,ytmpp+20,ytmpp+28, + y256p+4,y256p+12,y256p+20,y256p+28, + tw256a_256p+4,tw256a_256p+12,tw256a_256p+20, + tw256b_256p+4,tw256b_256p+12,tw256b_256p+20); + bfly4_16_256(ytmpp+5,ytmpp+13,ytmpp+21,ytmpp+29, + y256p+5,y256p+13,y256p+21,y256p+29, + tw256a_256p+5,tw256a_256p+13,tw256a_256p+21, + tw256b_256p+5,tw256b_256p+13,tw256b_256p+21); + bfly4_16_256(ytmpp+6,ytmpp+14,ytmpp+22,ytmpp+30, + y256p+6,y256p+14,y256p+22,y256p+30, + tw256a_256p+6,tw256a_256p+14,tw256a_256p+22, + tw256b_256p+6,tw256b_256p+14,tw256b_256p+22); + bfly4_16_256(ytmpp+7,ytmpp+15,ytmpp+23,ytmpp+31, + y256p+7,y256p+15,y256p+23,y256p+31, + tw256a_256p+7,tw256a_256p+15,tw256a_256p+23, + tw256b_256p+7,tw256b_256p+15,tw256b_256p+23); + + if (scale>0) { + + for (i=0; i<2; i++) { + y256[0] = shiftright_int16_simd256(y256[0],1); + y256[1] = shiftright_int16_simd256(y256[1],1); + y256[2] = shiftright_int16_simd256(y256[2],1); + y256[3] = shiftright_int16_simd256(y256[3],1); + y256[4] = shiftright_int16_simd256(y256[4],1); + y256[5] = shiftright_int16_simd256(y256[5],1); + y256[6] = shiftright_int16_simd256(y256[6],1); + y256[7] = shiftright_int16_simd256(y256[7],1); + y256[8] = shiftright_int16_simd256(y256[8],1); + y256[9] = shiftright_int16_simd256(y256[9],1); + y256[10] = shiftright_int16_simd256(y256[10],1); + y256[11] = shiftright_int16_simd256(y256[11],1); + y256[12] = shiftright_int16_simd256(y256[12],1); + y256[13] = shiftright_int16_simd256(y256[13],1); + y256[14] = shiftright_int16_simd256(y256[14],1); + y256[15] = shiftright_int16_simd256(y256[15],1); + + y256+=16; + } + + } + + _mm_empty(); + _m_empty(); + +} + +void idft256_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[64],ytmp[64],*tw256a_256p=(simd256_q15_t *)tw256a,*tw256b_256p=(simd256_q15_t *)tw256b,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + + transpose16_ooff_simd256(x256+0,xtmp+0,8); + transpose16_ooff_simd256(x256+4,xtmp+1,8); + transpose16_ooff_simd256(x256+8,xtmp+2,8); + transpose16_ooff_simd256(x256+12,xtmp+3,8); + transpose16_ooff_simd256(x256+16,xtmp+4,8); + transpose16_ooff_simd256(x256+20,xtmp+5,8); + transpose16_ooff_simd256(x256+24,xtmp+6,8); + transpose16_ooff_simd256(x256+28,xtmp+7,8); + + idft64_simd256((int16_t*)(xtmp),(int16_t*)(ytmp),1); + idft64_simd256((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); + idft64_simd256((int16_t*)(xtmp+16),(int16_t*)(ytmp+16),1); + idft64_simd256((int16_t*)(xtmp+24),(int16_t*)(ytmp+24),1); + + + ibfly4_16_256(ytmpp,ytmpp+8,ytmpp+16,ytmpp+24, + y256p,y256p+8,y256p+16,y256p+24, + tw256a_256p,tw256a_256p+8,tw256a_256p+16, + tw256b_256p,tw256b_256p+8,tw256b_256p+16); + ibfly4_16_256(ytmpp+1,ytmpp+9,ytmpp+17,ytmpp+25, + y256p+1,y256p+9,y256p+17,y256p+25, + tw256a_256p+1,tw256a_256p+9,tw256a_256p+17, + tw256b_256p+1,tw256b_256p+9,tw256b_256p+17); + ibfly4_16_256(ytmpp+2,ytmpp+10,ytmpp+18,ytmpp+26, + y256p+2,y256p+10,y256p+18,y256p+26, + tw256a_256p+2,tw256a_256p+10,tw256a_256p+18, + tw256b_256p+2,tw256b_256p+10,tw256b_256p+18); + ibfly4_16_256(ytmpp+3,ytmpp+11,ytmpp+19,ytmpp+27, + y256p+3,y256p+11,y256p+19,y256p+27, + tw256a_256p+3,tw256a_256p+11,tw256a_256p+19, + tw256b_256p+3,tw256b_256p+11,tw256b_256p+19); + ibfly4_16_256(ytmpp+4,ytmpp+12,ytmpp+20,ytmpp+28, + y256p+4,y256p+12,y256p+20,y256p+28, + tw256a_256p+4,tw256a_256p+12,tw256a_256p+20, + tw256b_256p+4,tw256b_256p+12,tw256b_256p+20); + ibfly4_16_256(ytmpp+5,ytmpp+13,ytmpp+21,ytmpp+29, + y256p+5,y256p+13,y256p+21,y256p+29, + tw256a_256p+5,tw256a_256p+13,tw256a_256p+21, + tw256b_256p+5,tw256b_256p+13,tw256b_256p+21); + ibfly4_16_256(ytmpp+6,ytmpp+14,ytmpp+22,ytmpp+30, + y256p+6,y256p+14,y256p+22,y256p+30, + tw256a_256p+6,tw256a_256p+14,tw256a_256p+22, + tw256b_256p+6,tw256b_256p+14,tw256b_256p+22); + ibfly4_16_256(ytmpp+7,ytmpp+15,ytmpp+23,ytmpp+31, + y256p+7,y256p+15,y256p+23,y256p+31, + tw256a_256p+7,tw256a_256p+15,tw256a_256p+23, + tw256b_256p+7,tw256b_256p+15,tw256b_256p+23); + + if (scale>0) { + + for (i=0; i<2; i++) { + y256[0] = shiftright_int16_simd256(y256[0],1); + y256[1] = shiftright_int16_simd256(y256[1],1); + y256[2] = shiftright_int16_simd256(y256[2],1); + y256[3] = shiftright_int16_simd256(y256[3],1); + y256[4] = shiftright_int16_simd256(y256[4],1); + y256[5] = shiftright_int16_simd256(y256[5],1); + y256[6] = shiftright_int16_simd256(y256[6],1); + y256[7] = shiftright_int16_simd256(y256[7],1); + y256[8] = shiftright_int16_simd256(y256[8],1); + y256[9] = shiftright_int16_simd256(y256[9],1); + y256[10] = shiftright_int16_simd256(y256[10],1); + y256[11] = shiftright_int16_simd256(y256[11],1); + y256[12] = shiftright_int16_simd256(y256[12],1); + y256[13] = shiftright_int16_simd256(y256[13],1); + y256[14] = shiftright_int16_simd256(y256[14],1); + y256[15] = shiftright_int16_simd256(y256[15],1); + + y256+=16; + } + + } + + _mm_empty(); + _m_empty(); + +} + +#endif +int16_t tw512[512] __attribute__((aligned(32))) = { 32767,0,32764,-403,32757,-805,32744,-1207,32727,-1608,32705,-2010,32678,-2411,32646,-2812,32609,-3212,32567,-3612,32520,-4012,32468,-4410,32412,-4808,32350,-5206,32284,-5602,32213,-5998,32137,-6393,32056,-6787,31970,-7180,31880,-7572,31785,-7962,31684,-8352,31580,-8740,31470,-9127,31356,-9512,31236,-9896,31113,-10279,30984,-10660,30851,-11039,30713,-11417,30571,-11793,30424,-12167,30272,-12540,30116,-12910,29955,-13279,29790,-13646,29621,-14010,29446,-14373,29268,-14733,29085,-15091,28897,-15447,28706,-15800,28510,-16151,28309,-16500,28105,-16846,27896,-17190,27683,-17531,27466,-17869,27244,-18205,27019,-18538,26789,-18868,26556,-19195,26318,-19520,26077,-19841,25831,-20160,25582,-20475,25329,-20788,25072,-21097,24811,-21403,24546,-21706,24278,-22005,24006,-22302,23731,-22595,23452,-22884,23169,-23170,22883,-23453,22594,-23732,22301,-24007,22004,-24279,21705,-24547,21402,-24812,21096,-25073,20787,-25330,20474,-25583,20159,-25832,19840,-26078,19519,-26319,19194,-26557,18867,-26790,18537,-27020,18204,-27245,17868,-27467,17530,-27684,17189,-27897,16845,-28106,16499,-28310,16150,-28511,15799,-28707,15446,-28898,15090,-29086,14732,-29269,14372,-29447,14009,-29622,13645,-29791,13278,-29956,12909,-30117,12539,-30273,12166,-30425,11792,-30572,11416,-30714,11038,-30852,10659,-30985,10278,-31114,9895,-31237,9511,-31357,9126,-31471,8739,-31581,8351,-31685,7961,-31786,7571,-31881,7179,-31971,6786,-32057,6392,-32138,5997,-32214,5601,-32285,5205,-32351,4807,-32413,4409,-32469,4011,-32521,3611,-32568,3211,-32610,2811,-32647,2410,-32679,2009,-32706,1607,-32728,1206,-32745,804,-32758,402,-32765,0,-32767,-403,-32765,-805,-32758,-1207,-32745,-1608,-32728,-2010,-32706,-2411,-32679,-2812,-32647,-3212,-32610,-3612,-32568,-4012,-32521,-4410,-32469,-4808,-32413,-5206,-32351,-5602,-32285,-5998,-32214,-6393,-32138,-6787,-32057,-7180,-31971,-7572,-31881,-7962,-31786,-8352,-31685,-8740,-31581,-9127,-31471,-9512,-31357,-9896,-31237,-10279,-31114,-10660,-30985,-11039,-30852,-11417,-30714,-11793,-30572,-12167,-30425,-12540,-30273,-12910,-30117,-13279,-29956,-13646,-29791,-14010,-29622,-14373,-29447,-14733,-29269,-15091,-29086,-15447,-28898,-15800,-28707,-16151,-28511,-16500,-28310,-16846,-28106,-17190,-27897,-17531,-27684,-17869,-27467,-18205,-27245,-18538,-27020,-18868,-26790,-19195,-26557,-19520,-26319,-19841,-26078,-20160,-25832,-20475,-25583,-20788,-25330,-21097,-25073,-21403,-24812,-21706,-24547,-22005,-24279,-22302,-24007,-22595,-23732,-22884,-23453,-23170,-23170,-23453,-22884,-23732,-22595,-24007,-22302,-24279,-22005,-24547,-21706,-24812,-21403,-25073,-21097,-25330,-20788,-25583,-20475,-25832,-20160,-26078,-19841,-26319,-19520,-26557,-19195,-26790,-18868,-27020,-18538,-27245,-18205,-27467,-17869,-27684,-17531,-27897,-17190,-28106,-16846,-28310,-16500,-28511,-16151,-28707,-15800,-28898,-15447,-29086,-15091,-29269,-14733,-29447,-14373,-29622,-14010,-29791,-13646,-29956,-13279,-30117,-12910,-30273,-12540,-30425,-12167,-30572,-11793,-30714,-11417,-30852,-11039,-30985,-10660,-31114,-10279,-31237,-9896,-31357,-9512,-31471,-9127,-31581,-8740,-31685,-8352,-31786,-7962,-31881,-7572,-31971,-7180,-32057,-6787,-32138,-6393,-32214,-5998,-32285,-5602,-32351,-5206,-32413,-4808,-32469,-4410,-32521,-4012,-32568,-3612,-32610,-3212,-32647,-2812,-32679,-2411,-32706,-2010,-32728,-1608,-32745,-1207,-32758,-805,-32765,-403 }; -int16_t tw512a[512] __attribute__((aligned(16))) = { +int16_t tw512a[512] __attribute__((aligned(32))) = { 32767,0,32764,403,32757,805,32744,1207,32727,1608,32705,2010,32678,2411,32646,2812,32609,3212,32567,3612,32520,4012,32468,4410,32412,4808,32350,5206,32284,5602,32213,5998,32137,6393,32056,6787,31970,7180,31880,7572,31785,7962,31684,8352,31580,8740,31470,9127,31356,9512,31236,9896,31113,10279,30984,10660,30851,11039,30713,11417,30571,11793,30424,12167,30272,12540,30116,12910,29955,13279,29790,13646,29621,14010,29446,14373,29268,14733,29085,15091,28897,15447,28706,15800,28510,16151,28309,16500,28105,16846,27896,17190,27683,17531,27466,17869,27244,18205,27019,18538,26789,18868,26556,19195,26318,19520,26077,19841,25831,20160,25582,20475,25329,20788,25072,21097,24811,21403,24546,21706,24278,22005,24006,22302,23731,22595,23452,22884,23169,23170,22883,23453,22594,23732,22301,24007,22004,24279,21705,24547,21402,24812,21096,25073,20787,25330,20474,25583,20159,25832,19840,26078,19519,26319,19194,26557,18867,26790,18537,27020,18204,27245,17868,27467,17530,27684,17189,27897,16845,28106,16499,28310,16150,28511,15799,28707,15446,28898,15090,29086,14732,29269,14372,29447,14009,29622,13645,29791,13278,29956,12909,30117,12539,30273,12166,30425,11792,30572,11416,30714,11038,30852,10659,30985,10278,31114,9895,31237,9511,31357,9126,31471,8739,31581,8351,31685,7961,31786,7571,31881,7179,31971,6786,32057,6392,32138,5997,32214,5601,32285,5205,32351,4807,32413,4409,32469,4011,32521,3611,32568,3211,32610,2811,32647,2410,32679,2009,32706,1607,32728,1206,32745,804,32758,402,32765,0,32767,-403,32765,-805,32758,-1207,32745,-1608,32728,-2010,32706,-2411,32679,-2812,32647,-3212,32610,-3612,32568,-4012,32521,-4410,32469,-4808,32413,-5206,32351,-5602,32285,-5998,32214,-6393,32138,-6787,32057,-7180,31971,-7572,31881,-7962,31786,-8352,31685,-8740,31581,-9127,31471,-9512,31357,-9896,31237,-10279,31114,-10660,30985,-11039,30852,-11417,30714,-11793,30572,-12167,30425,-12540,30273,-12910,30117,-13279,29956,-13646,29791,-14010,29622,-14373,29447,-14733,29269,-15091,29086,-15447,28898,-15800,28707,-16151,28511,-16500,28310,-16846,28106,-17190,27897,-17531,27684,-17869,27467,-18205,27245,-18538,27020,-18868,26790,-19195,26557,-19520,26319,-19841,26078,-20160,25832,-20475,25583,-20788,25330,-21097,25073,-21403,24812,-21706,24547,-22005,24279,-22302,24007,-22595,23732,-22884,23453,-23170,23170,-23453,22884,-23732,22595,-24007,22302,-24279,22005,-24547,21706,-24812,21403,-25073,21097,-25330,20788,-25583,20475,-25832,20160,-26078,19841,-26319,19520,-26557,19195,-26790,18868,-27020,18538,-27245,18205,-27467,17869,-27684,17531,-27897,17190,-28106,16846,-28310,16500,-28511,16151,-28707,15800,-28898,15447,-29086,15091,-29269,14733,-29447,14373,-29622,14010,-29791,13646,-29956,13279,-30117,12910,-30273,12540,-30425,12167,-30572,11793,-30714,11417,-30852,11039,-30985,10660,-31114,10279,-31237,9896,-31357,9512,-31471,9127,-31581,8740,-31685,8352,-31786,7962,-31881,7572,-31971,7180,-32057,6787,-32138,6393,-32214,5998,-32285,5602,-32351,5206,-32413,4808,-32469,4410,-32521,4012,-32568,3612,-32610,3212,-32647,2812,-32679,2411,-32706,2010,-32728,1608,-32745,1207,-32758,805,-32765,403 }; -int16_t tw512b[512] __attribute__((aligned(16))) = { +int16_t tw512b[512] __attribute__((aligned(32))) = { 0,32767,-403,32764,-805,32757,-1207,32744,-1608,32727,-2010,32705,-2411,32678,-2812,32646,-3212,32609,-3612,32567,-4012,32520,-4410,32468,-4808,32412,-5206,32350,-5602,32284,-5998,32213,-6393,32137,-6787,32056,-7180,31970,-7572,31880,-7962,31785,-8352,31684,-8740,31580,-9127,31470,-9512,31356,-9896,31236,-10279,31113,-10660,30984,-11039,30851,-11417,30713,-11793,30571,-12167,30424,-12540,30272,-12910,30116,-13279,29955,-13646,29790,-14010,29621,-14373,29446,-14733,29268,-15091,29085,-15447,28897,-15800,28706,-16151,28510,-16500,28309,-16846,28105,-17190,27896,-17531,27683,-17869,27466,-18205,27244,-18538,27019,-18868,26789,-19195,26556,-19520,26318,-19841,26077,-20160,25831,-20475,25582,-20788,25329,-21097,25072,-21403,24811,-21706,24546,-22005,24278,-22302,24006,-22595,23731,-22884,23452,-23170,23169,-23453,22883,-23732,22594,-24007,22301,-24279,22004,-24547,21705,-24812,21402,-25073,21096,-25330,20787,-25583,20474,-25832,20159,-26078,19840,-26319,19519,-26557,19194,-26790,18867,-27020,18537,-27245,18204,-27467,17868,-27684,17530,-27897,17189,-28106,16845,-28310,16499,-28511,16150,-28707,15799,-28898,15446,-29086,15090,-29269,14732,-29447,14372,-29622,14009,-29791,13645,-29956,13278,-30117,12909,-30273,12539,-30425,12166,-30572,11792,-30714,11416,-30852,11038,-30985,10659,-31114,10278,-31237,9895,-31357,9511,-31471,9126,-31581,8739,-31685,8351,-31786,7961,-31881,7571,-31971,7179,-32057,6786,-32138,6392,-32214,5997,-32285,5601,-32351,5205,-32413,4807,-32469,4409,-32521,4011,-32568,3611,-32610,3211,-32647,2811,-32679,2410,-32706,2009,-32728,1607,-32745,1206,-32758,804,-32765,402,-32767,0,-32765,-403,-32758,-805,-32745,-1207,-32728,-1608,-32706,-2010,-32679,-2411,-32647,-2812,-32610,-3212,-32568,-3612,-32521,-4012,-32469,-4410,-32413,-4808,-32351,-5206,-32285,-5602,-32214,-5998,-32138,-6393,-32057,-6787,-31971,-7180,-31881,-7572,-31786,-7962,-31685,-8352,-31581,-8740,-31471,-9127,-31357,-9512,-31237,-9896,-31114,-10279,-30985,-10660,-30852,-11039,-30714,-11417,-30572,-11793,-30425,-12167,-30273,-12540,-30117,-12910,-29956,-13279,-29791,-13646,-29622,-14010,-29447,-14373,-29269,-14733,-29086,-15091,-28898,-15447,-28707,-15800,-28511,-16151,-28310,-16500,-28106,-16846,-27897,-17190,-27684,-17531,-27467,-17869,-27245,-18205,-27020,-18538,-26790,-18868,-26557,-19195,-26319,-19520,-26078,-19841,-25832,-20160,-25583,-20475,-25330,-20788,-25073,-21097,-24812,-21403,-24547,-21706,-24279,-22005,-24007,-22302,-23732,-22595,-23453,-22884,-23170,-23170,-22884,-23453,-22595,-23732,-22302,-24007,-22005,-24279,-21706,-24547,-21403,-24812,-21097,-25073,-20788,-25330,-20475,-25583,-20160,-25832,-19841,-26078,-19520,-26319,-19195,-26557,-18868,-26790,-18538,-27020,-18205,-27245,-17869,-27467,-17531,-27684,-17190,-27897,-16846,-28106,-16500,-28310,-16151,-28511,-15800,-28707,-15447,-28898,-15091,-29086,-14733,-29269,-14373,-29447,-14010,-29622,-13646,-29791,-13279,-29956,-12910,-30117,-12540,-30273,-12167,-30425,-11793,-30572,-11417,-30714,-11039,-30852,-10660,-30985,-10279,-31114,-9896,-31237,-9512,-31357,-9127,-31471,-8740,-31581,-8352,-31685,-7962,-31786,-7572,-31881,-7180,-31971,-6787,-32057,-6393,-32138,-5998,-32214,-5602,-32285,-5206,-32351,-4808,-32413,-4410,-32469,-4012,-32521,-3612,-32568,-3212,-32610,-2812,-32647,-2411,-32679,-2010,-32706,-1608,-32728,-1207,-32745,-805,-32758,-403,-32765 }; -int16_t tw512c[512] __attribute__((aligned(16))) = { +int16_t tw512c[512] __attribute__((aligned(32))) = { 0,32767,403,32764,805,32757,1207,32744,1608,32727,2010,32705,2411,32678,2812,32646,3212,32609,3612,32567,4012,32520,4410,32468,4808,32412,5206,32350,5602,32284,5998,32213,6393,32137,6787,32056,7180,31970,7572,31880,7962,31785,8352,31684,8740,31580,9127,31470,9512,31356,9896,31236,10279,31113,10660,30984,11039,30851,11417,30713,11793,30571,12167,30424,12540,30272,12910,30116,13279,29955,13646,29790,14010,29621,14373,29446,14733,29268,15091,29085,15447,28897,15800,28706,16151,28510,16500,28309,16846,28105,17190,27896,17531,27683,17869,27466,18205,27244,18538,27019,18868,26789,19195,26556,19520,26318,19841,26077,20160,25831,20475,25582,20788,25329,21097,25072,21403,24811,21706,24546,22005,24278,22302,24006,22595,23731,22884,23452,23170,23169,23453,22883,23732,22594,24007,22301,24279,22004,24547,21705,24812,21402,25073,21096,25330,20787,25583,20474,25832,20159,26078,19840,26319,19519,26557,19194,26790,18867,27020,18537,27245,18204,27467,17868,27684,17530,27897,17189,28106,16845,28310,16499,28511,16150,28707,15799,28898,15446,29086,15090,29269,14732,29447,14372,29622,14009,29791,13645,29956,13278,30117,12909,30273,12539,30425,12166,30572,11792,30714,11416,30852,11038,30985,10659,31114,10278,31237,9895,31357,9511,31471,9126,31581,8739,31685,8351,31786,7961,31881,7571,31971,7179,32057,6786,32138,6392,32214,5997,32285,5601,32351,5205,32413,4807,32469,4409,32521,4011,32568,3611,32610,3211,32647,2811,32679,2410,32706,2009,32728,1607,32745,1206,32758,804,32765,402,32767,0,32765,-403,32758,-805,32745,-1207,32728,-1608,32706,-2010,32679,-2411,32647,-2812,32610,-3212,32568,-3612,32521,-4012,32469,-4410,32413,-4808,32351,-5206,32285,-5602,32214,-5998,32138,-6393,32057,-6787,31971,-7180,31881,-7572,31786,-7962,31685,-8352,31581,-8740,31471,-9127,31357,-9512,31237,-9896,31114,-10279,30985,-10660,30852,-11039,30714,-11417,30572,-11793,30425,-12167,30273,-12540,30117,-12910,29956,-13279,29791,-13646,29622,-14010,29447,-14373,29269,-14733,29086,-15091,28898,-15447,28707,-15800,28511,-16151,28310,-16500,28106,-16846,27897,-17190,27684,-17531,27467,-17869,27245,-18205,27020,-18538,26790,-18868,26557,-19195,26319,-19520,26078,-19841,25832,-20160,25583,-20475,25330,-20788,25073,-21097,24812,-21403,24547,-21706,24279,-22005,24007,-22302,23732,-22595,23453,-22884,23170,-23170,22884,-23453,22595,-23732,22302,-24007,22005,-24279,21706,-24547,21403,-24812,21097,-25073,20788,-25330,20475,-25583,20160,-25832,19841,-26078,19520,-26319,19195,-26557,18868,-26790,18538,-27020,18205,-27245,17869,-27467,17531,-27684,17190,-27897,16846,-28106,16500,-28310,16151,-28511,15800,-28707,15447,-28898,15091,-29086,14733,-29269,14373,-29447,14010,-29622,13646,-29791,13279,-29956,12910,-30117,12540,-30273,12167,-30425,11793,-30572,11417,-30714,11039,-30852,10660,-30985,10279,-31114,9896,-31237,9512,-31357,9127,-31471,8740,-31581,8352,-31685,7962,-31786,7572,-31881,7180,-31971,6787,-32057,6393,-32138,5998,-32214,5602,-32285,5206,-32351,4808,-32413,4410,-32469,4012,-32521,3612,-32568,3212,-32610,2812,-32647,2411,-32679,2010,-32706,1608,-32728,1207,-32745,805,-32758,403,-32765 }; @@ -2566,7 +4022,177 @@ void idft512(int16_t *x,int16_t *y,int scale) } -int16_t tw1024[1536] __attribute__((aligned(16))) = { 32767,0,32766,-202,32764,-403,32761,-604,32757,-805,32751,-1006,32744,-1207,32736,-1407,32727,-1608,32717,-1809,32705,-2010,32692,-2210,32678,-2411,32662,-2611,32646,-2812,32628,-3012,32609,-3212,32588,-3412,32567,-3612,32544,-3812,32520,-4012,32495,-4211,32468,-4410,32441,-4609,32412,-4808,32382,-5007,32350,-5206,32318,-5404,32284,-5602,32249,-5800,32213,-5998,32176,-6196,32137,-6393,32097,-6590,32056,-6787,32014,-6983,31970,-7180,31926,-7376,31880,-7572,31833,-7767,31785,-7962,31735,-8157,31684,-8352,31633,-8546,31580,-8740,31525,-8933,31470,-9127,31413,-9320,31356,-9512,31297,-9704,31236,-9896,31175,-10088,31113,-10279,31049,-10470,30984,-10660,30918,-10850,30851,-11039,30783,-11228,30713,-11417,30643,-11605,30571,-11793,30498,-11981,30424,-12167,30349,-12354,30272,-12540,30195,-12725,30116,-12910,30036,-13095,29955,-13279,29873,-13463,29790,-13646,29706,-13828,29621,-14010,29534,-14192,29446,-14373,29358,-14553,29268,-14733,29177,-14912,29085,-15091,28992,-15269,28897,-15447,28802,-15624,28706,-15800,28608,-15976,28510,-16151,28410,-16326,28309,-16500,28208,-16673,28105,-16846,28001,-17018,27896,-17190,27790,-17361,27683,-17531,27575,-17700,27466,-17869,27355,-18037,27244,-18205,27132,-18372,27019,-18538,26905,-18703,26789,-18868,26673,-19032,26556,-19195,26437,-19358,26318,-19520,26198,-19681,26077,-19841,25954,-20001,25831,-20160,25707,-20318,25582,-20475,25456,-20632,25329,-20788,25201,-20943,25072,-21097,24942,-21250,24811,-21403,24679,-21555,24546,-21706,24413,-21856,24278,-22005,24143,-22154,24006,-22302,23869,-22449,23731,-22595,23592,-22740,23452,-22884,23311,-23028,23169,-23170,23027,-23312,22883,-23453,22739,-23593,22594,-23732,22448,-23870,22301,-24007,22153,-24144,22004,-24279,21855,-24414,21705,-24547,21554,-24680,21402,-24812,21249,-24943,21096,-25073,20942,-25202,20787,-25330,20631,-25457,20474,-25583,20317,-25708,20159,-25832,20000,-25955,19840,-26078,19680,-26199,19519,-26319,19357,-26438,19194,-26557,19031,-26674,18867,-26790,18702,-26906,18537,-27020,18371,-27133,18204,-27245,18036,-27356,17868,-27467,17699,-27576,17530,-27684,17360,-27791,17189,-27897,17017,-28002,16845,-28106,16672,-28209,16499,-28310,16325,-28411,16150,-28511,15975,-28609,15799,-28707,15623,-28803,15446,-28898,15268,-28993,15090,-29086,14911,-29178,14732,-29269,14552,-29359,14372,-29447,14191,-29535,14009,-29622,13827,-29707,13645,-29791,13462,-29874,13278,-29956,13094,-30037,12909,-30117,12724,-30196,12539,-30273,12353,-30350,12166,-30425,11980,-30499,11792,-30572,11604,-30644,11416,-30714,11227,-30784,11038,-30852,10849,-30919,10659,-30985,10469,-31050,10278,-31114,10087,-31176,9895,-31237,9703,-31298,9511,-31357,9319,-31414,9126,-31471,8932,-31526,8739,-31581,8545,-31634,8351,-31685,8156,-31736,7961,-31786,7766,-31834,7571,-31881,7375,-31927,7179,-31971,6982,-32015,6786,-32057,6589,-32098,6392,-32138,6195,-32177,5997,-32214,5799,-32250,5601,-32285,5403,-32319,5205,-32351,5006,-32383,4807,-32413,4608,-32442,4409,-32469,4210,-32496,4011,-32521,3811,-32545,3611,-32568,3411,-32589,3211,-32610,3011,-32629,2811,-32647,2610,-32663,2410,-32679,2209,-32693,2009,-32706,1808,-32718,1607,-32728,1406,-32737,1206,-32745,1005,-32752,804,-32758,603,-32762,402,-32765,201,-32767, +#ifdef __AVX2__ + +void dft512_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[64],*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[64],*y256=(simd256_q15_t*)y; + simd256_q15_t *tw512a_256p=(simd256_q15_t *)tw512a,*tw512b_256p=(simd256_q15_t *)tw512b,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_256 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + + transpose4_ooff_simd256(x256 ,xtmp,32); + transpose4_ooff_simd256(x256+2,xtmp+1,32); + transpose4_ooff_simd256(x256+4,xtmp+2,32); + transpose4_ooff_simd256(x256+6,xtmp+3,32); + transpose4_ooff_simd256(x256+8,xtmp+4,32); + transpose4_ooff_simd256(x256+10,xtmp+5,32); + transpose4_ooff_simd256(x256+12,xtmp+6,32); + transpose4_ooff_simd256(x256+14,xtmp+7,32); + transpose4_ooff_simd256(x256+16,xtmp+8,32); + transpose4_ooff_simd256(x256+18,xtmp+9,32); + transpose4_ooff_simd256(x256+20,xtmp+10,32); + transpose4_ooff_simd256(x256+22,xtmp+11,32); + transpose4_ooff_simd256(x256+24,xtmp+12,32); + transpose4_ooff_simd256(x256+26,xtmp+13,32); + transpose4_ooff_simd256(x256+28,xtmp+14,32); + transpose4_ooff_simd256(x256+30,xtmp+15,32); + transpose4_ooff_simd256(x256+32,xtmp+16,32); + transpose4_ooff_simd256(x256+34,xtmp+17,32); + transpose4_ooff_simd256(x256+36,xtmp+18,32); + transpose4_ooff_simd256(x256+38,xtmp+19,32); + transpose4_ooff_simd256(x256+40,xtmp+20,32); + transpose4_ooff_simd256(x256+42,xtmp+21,32); + transpose4_ooff_simd256(x256+44,xtmp+22,32); + transpose4_ooff_simd256(x256+46,xtmp+23,32); + transpose4_ooff_simd256(x256+48,xtmp+24,32); + transpose4_ooff_simd256(x256+50,xtmp+25,32); + transpose4_ooff_simd256(x256+52,xtmp+26,32); + transpose4_ooff_simd256(x256+54,xtmp+27,32); + transpose4_ooff_simd256(x256+56,xtmp+28,32); + transpose4_ooff_simd256(x256+58,xtmp+29,32); + transpose4_ooff_simd256(x256+60,xtmp+30,32); + transpose4_ooff_simd256(x256+62,xtmp+31,32); + + dft256_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); + dft256_simd256((int16_t*)(xtmp+64),(int16_t*)(ytmp+32),1); + + + for (i=0; i<32; i++) { + bfly2_16_256(ytmpp,ytmpp+32, + y256p,y256p+32, + tw512a_256p, + tw512b_256p); + tw512a_256p++; + tw512b_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0;i<4;i++) { + y256[0] = mulhi_int16_simd256(y256[0],ONE_OVER_SQRT2_Q15_256); + y256[1] = mulhi_int16_simd256(y256[1],ONE_OVER_SQRT2_Q15_256); + y256[2] = mulhi_int16_simd256(y256[2],ONE_OVER_SQRT2_Q15_256); + y256[3] = mulhi_int16_simd256(y256[3],ONE_OVER_SQRT2_Q15_256); + y256[4] = mulhi_int16_simd256(y256[4],ONE_OVER_SQRT2_Q15_256); + y256[5] = mulhi_int16_simd256(y256[5],ONE_OVER_SQRT2_Q15_256); + y256[6] = mulhi_int16_simd256(y256[6],ONE_OVER_SQRT2_Q15_256); + y256[7] = mulhi_int16_simd256(y256[7],ONE_OVER_SQRT2_Q15_256); + y256[8] = mulhi_int16_simd256(y256[8],ONE_OVER_SQRT2_Q15_256); + y256[9] = mulhi_int16_simd256(y256[9],ONE_OVER_SQRT2_Q15_256); + y256[10] = mulhi_int16_simd256(y256[10],ONE_OVER_SQRT2_Q15_256); + y256[11] = mulhi_int16_simd256(y256[11],ONE_OVER_SQRT2_Q15_256); + y256[12] = mulhi_int16_simd256(y256[12],ONE_OVER_SQRT2_Q15_256); + y256[13] = mulhi_int16_simd256(y256[13],ONE_OVER_SQRT2_Q15_256); + y256[14] = mulhi_int16_simd256(y256[14],ONE_OVER_SQRT2_Q15_256); + y256[15] = mulhi_int16_simd256(y256[15],ONE_OVER_SQRT2_Q15_256); + y256+=16; + } + } + +} + +void idft512_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[64],*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[64],*y256=(simd256_q15_t*)y; + simd256_q15_t *tw512_256p=(simd256_q15_t *)tw512,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_256 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + + transpose4_ooff_simd256(x256 ,xtmp,32); + transpose4_ooff_simd256(x256+2,xtmp+1,32); + transpose4_ooff_simd256(x256+4,xtmp+2,32); + transpose4_ooff_simd256(x256+6,xtmp+3,32); + transpose4_ooff_simd256(x256+8,xtmp+4,32); + transpose4_ooff_simd256(x256+10,xtmp+5,32); + transpose4_ooff_simd256(x256+12,xtmp+6,32); + transpose4_ooff_simd256(x256+14,xtmp+7,32); + transpose4_ooff_simd256(x256+16,xtmp+8,32); + transpose4_ooff_simd256(x256+18,xtmp+9,32); + transpose4_ooff_simd256(x256+20,xtmp+10,32); + transpose4_ooff_simd256(x256+22,xtmp+11,32); + transpose4_ooff_simd256(x256+24,xtmp+12,32); + transpose4_ooff_simd256(x256+26,xtmp+13,32); + transpose4_ooff_simd256(x256+28,xtmp+14,32); + transpose4_ooff_simd256(x256+30,xtmp+15,32); + transpose4_ooff_simd256(x256+32,xtmp+16,32); + transpose4_ooff_simd256(x256+34,xtmp+17,32); + transpose4_ooff_simd256(x256+36,xtmp+18,32); + transpose4_ooff_simd256(x256+38,xtmp+19,32); + transpose4_ooff_simd256(x256+40,xtmp+20,32); + transpose4_ooff_simd256(x256+42,xtmp+21,32); + transpose4_ooff_simd256(x256+44,xtmp+22,32); + transpose4_ooff_simd256(x256+46,xtmp+23,32); + transpose4_ooff_simd256(x256+48,xtmp+24,32); + transpose4_ooff_simd256(x256+50,xtmp+25,32); + transpose4_ooff_simd256(x256+52,xtmp+26,32); + transpose4_ooff_simd256(x256+54,xtmp+27,32); + transpose4_ooff_simd256(x256+56,xtmp+28,32); + transpose4_ooff_simd256(x256+58,xtmp+29,32); + transpose4_ooff_simd256(x256+60,xtmp+30,32); + transpose4_ooff_simd256(x256+62,xtmp+31,32); + + idft256_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); + idft256_simd256((int16_t*)(xtmp+64),(int16_t*)(ytmp+32),1); + + + for (i=0; i<32; i++) { + ibfly2_256(ytmpp,ytmpp+32, + y256p,y256p+32, + tw512_256p); + tw512_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0;i<4;i++) { + y256[0] = mulhi_int16_simd256(y256[0],ONE_OVER_SQRT2_Q15_256); + y256[1] = mulhi_int16_simd256(y256[1],ONE_OVER_SQRT2_Q15_256); + y256[2] = mulhi_int16_simd256(y256[2],ONE_OVER_SQRT2_Q15_256); + y256[3] = mulhi_int16_simd256(y256[3],ONE_OVER_SQRT2_Q15_256); + y256[4] = mulhi_int16_simd256(y256[4],ONE_OVER_SQRT2_Q15_256); + y256[5] = mulhi_int16_simd256(y256[5],ONE_OVER_SQRT2_Q15_256); + y256[6] = mulhi_int16_simd256(y256[6],ONE_OVER_SQRT2_Q15_256); + y256[7] = mulhi_int16_simd256(y256[7],ONE_OVER_SQRT2_Q15_256); + y256[8] = mulhi_int16_simd256(y256[8],ONE_OVER_SQRT2_Q15_256); + y256[9] = mulhi_int16_simd256(y256[9],ONE_OVER_SQRT2_Q15_256); + y256[10] = mulhi_int16_simd256(y256[10],ONE_OVER_SQRT2_Q15_256); + y256[11] = mulhi_int16_simd256(y256[11],ONE_OVER_SQRT2_Q15_256); + y256[12] = mulhi_int16_simd256(y256[12],ONE_OVER_SQRT2_Q15_256); + y256[13] = mulhi_int16_simd256(y256[13],ONE_OVER_SQRT2_Q15_256); + y256[14] = mulhi_int16_simd256(y256[14],ONE_OVER_SQRT2_Q15_256); + y256[15] = mulhi_int16_simd256(y256[15],ONE_OVER_SQRT2_Q15_256); + y256+=16; + } + } + +} + +#endif + +int16_t tw1024[1536] __attribute__((aligned(32))) = { 32767,0,32766,-202,32764,-403,32761,-604,32757,-805,32751,-1006,32744,-1207,32736,-1407,32727,-1608,32717,-1809,32705,-2010,32692,-2210,32678,-2411,32662,-2611,32646,-2812,32628,-3012,32609,-3212,32588,-3412,32567,-3612,32544,-3812,32520,-4012,32495,-4211,32468,-4410,32441,-4609,32412,-4808,32382,-5007,32350,-5206,32318,-5404,32284,-5602,32249,-5800,32213,-5998,32176,-6196,32137,-6393,32097,-6590,32056,-6787,32014,-6983,31970,-7180,31926,-7376,31880,-7572,31833,-7767,31785,-7962,31735,-8157,31684,-8352,31633,-8546,31580,-8740,31525,-8933,31470,-9127,31413,-9320,31356,-9512,31297,-9704,31236,-9896,31175,-10088,31113,-10279,31049,-10470,30984,-10660,30918,-10850,30851,-11039,30783,-11228,30713,-11417,30643,-11605,30571,-11793,30498,-11981,30424,-12167,30349,-12354,30272,-12540,30195,-12725,30116,-12910,30036,-13095,29955,-13279,29873,-13463,29790,-13646,29706,-13828,29621,-14010,29534,-14192,29446,-14373,29358,-14553,29268,-14733,29177,-14912,29085,-15091,28992,-15269,28897,-15447,28802,-15624,28706,-15800,28608,-15976,28510,-16151,28410,-16326,28309,-16500,28208,-16673,28105,-16846,28001,-17018,27896,-17190,27790,-17361,27683,-17531,27575,-17700,27466,-17869,27355,-18037,27244,-18205,27132,-18372,27019,-18538,26905,-18703,26789,-18868,26673,-19032,26556,-19195,26437,-19358,26318,-19520,26198,-19681,26077,-19841,25954,-20001,25831,-20160,25707,-20318,25582,-20475,25456,-20632,25329,-20788,25201,-20943,25072,-21097,24942,-21250,24811,-21403,24679,-21555,24546,-21706,24413,-21856,24278,-22005,24143,-22154,24006,-22302,23869,-22449,23731,-22595,23592,-22740,23452,-22884,23311,-23028,23169,-23170,23027,-23312,22883,-23453,22739,-23593,22594,-23732,22448,-23870,22301,-24007,22153,-24144,22004,-24279,21855,-24414,21705,-24547,21554,-24680,21402,-24812,21249,-24943,21096,-25073,20942,-25202,20787,-25330,20631,-25457,20474,-25583,20317,-25708,20159,-25832,20000,-25955,19840,-26078,19680,-26199,19519,-26319,19357,-26438,19194,-26557,19031,-26674,18867,-26790,18702,-26906,18537,-27020,18371,-27133,18204,-27245,18036,-27356,17868,-27467,17699,-27576,17530,-27684,17360,-27791,17189,-27897,17017,-28002,16845,-28106,16672,-28209,16499,-28310,16325,-28411,16150,-28511,15975,-28609,15799,-28707,15623,-28803,15446,-28898,15268,-28993,15090,-29086,14911,-29178,14732,-29269,14552,-29359,14372,-29447,14191,-29535,14009,-29622,13827,-29707,13645,-29791,13462,-29874,13278,-29956,13094,-30037,12909,-30117,12724,-30196,12539,-30273,12353,-30350,12166,-30425,11980,-30499,11792,-30572,11604,-30644,11416,-30714,11227,-30784,11038,-30852,10849,-30919,10659,-30985,10469,-31050,10278,-31114,10087,-31176,9895,-31237,9703,-31298,9511,-31357,9319,-31414,9126,-31471,8932,-31526,8739,-31581,8545,-31634,8351,-31685,8156,-31736,7961,-31786,7766,-31834,7571,-31881,7375,-31927,7179,-31971,6982,-32015,6786,-32057,6589,-32098,6392,-32138,6195,-32177,5997,-32214,5799,-32250,5601,-32285,5403,-32319,5205,-32351,5006,-32383,4807,-32413,4608,-32442,4409,-32469,4210,-32496,4011,-32521,3811,-32545,3611,-32568,3411,-32589,3211,-32610,3011,-32629,2811,-32647,2610,-32663,2410,-32679,2209,-32693,2009,-32706,1808,-32718,1607,-32728,1406,-32737,1206,-32745,1005,-32752,804,-32758,603,-32762,402,-32765,201,-32767, 32767,0,32764,-403,32757,-805,32744,-1207,32727,-1608,32705,-2010,32678,-2411,32646,-2812,32609,-3212,32567,-3612,32520,-4012,32468,-4410,32412,-4808,32350,-5206,32284,-5602,32213,-5998,32137,-6393,32056,-6787,31970,-7180,31880,-7572,31785,-7962,31684,-8352,31580,-8740,31470,-9127,31356,-9512,31236,-9896,31113,-10279,30984,-10660,30851,-11039,30713,-11417,30571,-11793,30424,-12167,30272,-12540,30116,-12910,29955,-13279,29790,-13646,29621,-14010,29446,-14373,29268,-14733,29085,-15091,28897,-15447,28706,-15800,28510,-16151,28309,-16500,28105,-16846,27896,-17190,27683,-17531,27466,-17869,27244,-18205,27019,-18538,26789,-18868,26556,-19195,26318,-19520,26077,-19841,25831,-20160,25582,-20475,25329,-20788,25072,-21097,24811,-21403,24546,-21706,24278,-22005,24006,-22302,23731,-22595,23452,-22884,23169,-23170,22883,-23453,22594,-23732,22301,-24007,22004,-24279,21705,-24547,21402,-24812,21096,-25073,20787,-25330,20474,-25583,20159,-25832,19840,-26078,19519,-26319,19194,-26557,18867,-26790,18537,-27020,18204,-27245,17868,-27467,17530,-27684,17189,-27897,16845,-28106,16499,-28310,16150,-28511,15799,-28707,15446,-28898,15090,-29086,14732,-29269,14372,-29447,14009,-29622,13645,-29791,13278,-29956,12909,-30117,12539,-30273,12166,-30425,11792,-30572,11416,-30714,11038,-30852,10659,-30985,10278,-31114,9895,-31237,9511,-31357,9126,-31471,8739,-31581,8351,-31685,7961,-31786,7571,-31881,7179,-31971,6786,-32057,6392,-32138,5997,-32214,5601,-32285,5205,-32351,4807,-32413,4409,-32469,4011,-32521,3611,-32568,3211,-32610,2811,-32647,2410,-32679,2009,-32706,1607,-32728,1206,-32745,804,-32758,402,-32765,0,-32767,-403,-32765,-805,-32758,-1207,-32745,-1608,-32728,-2010,-32706,-2411,-32679,-2812,-32647,-3212,-32610,-3612,-32568,-4012,-32521,-4410,-32469,-4808,-32413,-5206,-32351,-5602,-32285,-5998,-32214,-6393,-32138,-6787,-32057,-7180,-31971,-7572,-31881,-7962,-31786,-8352,-31685,-8740,-31581,-9127,-31471,-9512,-31357,-9896,-31237,-10279,-31114,-10660,-30985,-11039,-30852,-11417,-30714,-11793,-30572,-12167,-30425,-12540,-30273,-12910,-30117,-13279,-29956,-13646,-29791,-14010,-29622,-14373,-29447,-14733,-29269,-15091,-29086,-15447,-28898,-15800,-28707,-16151,-28511,-16500,-28310,-16846,-28106,-17190,-27897,-17531,-27684,-17869,-27467,-18205,-27245,-18538,-27020,-18868,-26790,-19195,-26557,-19520,-26319,-19841,-26078,-20160,-25832,-20475,-25583,-20788,-25330,-21097,-25073,-21403,-24812,-21706,-24547,-22005,-24279,-22302,-24007,-22595,-23732,-22884,-23453,-23170,-23170,-23453,-22884,-23732,-22595,-24007,-22302,-24279,-22005,-24547,-21706,-24812,-21403,-25073,-21097,-25330,-20788,-25583,-20475,-25832,-20160,-26078,-19841,-26319,-19520,-26557,-19195,-26790,-18868,-27020,-18538,-27245,-18205,-27467,-17869,-27684,-17531,-27897,-17190,-28106,-16846,-28310,-16500,-28511,-16151,-28707,-15800,-28898,-15447,-29086,-15091,-29269,-14733,-29447,-14373,-29622,-14010,-29791,-13646,-29956,-13279,-30117,-12910,-30273,-12540,-30425,-12167,-30572,-11793,-30714,-11417,-30852,-11039,-30985,-10660,-31114,-10279,-31237,-9896,-31357,-9512,-31471,-9127,-31581,-8740,-31685,-8352,-31786,-7962,-31881,-7572,-31971,-7180,-32057,-6787,-32138,-6393,-32214,-5998,-32285,-5602,-32351,-5206,-32413,-4808,-32469,-4410,-32521,-4012,-32568,-3612,-32610,-3212,-32647,-2812,-32679,-2411,-32706,-2010,-32728,-1608,-32745,-1207,-32758,-805,-32765,-403, 32767,0,32761,-604,32744,-1207,32717,-1809,32678,-2411,32628,-3012,32567,-3612,32495,-4211,32412,-4808,32318,-5404,32213,-5998,32097,-6590,31970,-7180,31833,-7767,31684,-8352,31525,-8933,31356,-9512,31175,-10088,30984,-10660,30783,-11228,30571,-11793,30349,-12354,30116,-12910,29873,-13463,29621,-14010,29358,-14553,29085,-15091,28802,-15624,28510,-16151,28208,-16673,27896,-17190,27575,-17700,27244,-18205,26905,-18703,26556,-19195,26198,-19681,25831,-20160,25456,-20632,25072,-21097,24679,-21555,24278,-22005,23869,-22449,23452,-22884,23027,-23312,22594,-23732,22153,-24144,21705,-24547,21249,-24943,20787,-25330,20317,-25708,19840,-26078,19357,-26438,18867,-26790,18371,-27133,17868,-27467,17360,-27791,16845,-28106,16325,-28411,15799,-28707,15268,-28993,14732,-29269,14191,-29535,13645,-29791,13094,-30037,12539,-30273,11980,-30499,11416,-30714,10849,-30919,10278,-31114,9703,-31298,9126,-31471,8545,-31634,7961,-31786,7375,-31927,6786,-32057,6195,-32177,5601,-32285,5006,-32383,4409,-32469,3811,-32545,3211,-32610,2610,-32663,2009,-32706,1406,-32737,804,-32758,201,-32767,-403,-32765,-1006,-32752,-1608,-32728,-2210,-32693,-2812,-32647,-3412,-32589,-4012,-32521,-4609,-32442,-5206,-32351,-5800,-32250,-6393,-32138,-6983,-32015,-7572,-31881,-8157,-31736,-8740,-31581,-9320,-31414,-9896,-31237,-10470,-31050,-11039,-30852,-11605,-30644,-12167,-30425,-12725,-30196,-13279,-29956,-13828,-29707,-14373,-29447,-14912,-29178,-15447,-28898,-15976,-28609,-16500,-28310,-17018,-28002,-17531,-27684,-18037,-27356,-18538,-27020,-19032,-26674,-19520,-26319,-20001,-25955,-20475,-25583,-20943,-25202,-21403,-24812,-21856,-24414,-22302,-24007,-22740,-23593,-23170,-23170,-23593,-22740,-24007,-22302,-24414,-21856,-24812,-21403,-25202,-20943,-25583,-20475,-25955,-20001,-26319,-19520,-26674,-19032,-27020,-18538,-27356,-18037,-27684,-17531,-28002,-17018,-28310,-16500,-28609,-15976,-28898,-15447,-29178,-14912,-29447,-14373,-29707,-13828,-29956,-13279,-30196,-12725,-30425,-12167,-30644,-11605,-30852,-11039,-31050,-10470,-31237,-9896,-31414,-9320,-31581,-8740,-31736,-8157,-31881,-7572,-32015,-6983,-32138,-6393,-32250,-5800,-32351,-5206,-32442,-4609,-32521,-4012,-32589,-3412,-32647,-2812,-32693,-2210,-32728,-1608,-32752,-1006,-32765,-403,-32767,201,-32758,804,-32737,1406,-32706,2009,-32663,2610,-32610,3211,-32545,3811,-32469,4409,-32383,5006,-32285,5601,-32177,6195,-32057,6786,-31927,7375,-31786,7961,-31634,8545,-31471,9126,-31298,9703,-31114,10278,-30919,10849,-30714,11416,-30499,11980,-30273,12539,-30037,13094,-29791,13645,-29535,14191,-29269,14732,-28993,15268,-28707,15799,-28411,16325,-28106,16845,-27791,17360,-27467,17868,-27133,18371,-26790,18867,-26438,19357,-26078,19840,-25708,20317,-25330,20787,-24943,21249,-24547,21705,-24144,22153,-23732,22594,-23312,23027,-22884,23452,-22449,23869,-22005,24278,-21555,24679,-21097,25072,-20632,25456,-20160,25831,-19681,26198,-19195,26556,-18703,26905,-18205,27244,-17700,27575,-17190,27896,-16673,28208,-16151,28510,-15624,28802,-15091,29085,-14553,29358,-14010,29621,-13463,29873,-12910,30116,-12354,30349,-11793,30571,-11228,30783,-10660,30984,-10088,31175,-9512,31356,-8933,31525,-8352,31684,-7767,31833,-7180,31970,-6590,32097,-5998,32213,-5404,32318,-4808,32412,-4211,32495,-3612,32567,-3012,32628,-2411,32678,-1809,32717,-1207,32744,-604,32761 }; @@ -2683,7 +4309,121 @@ void idft1024(int16_t *x,int16_t *y,int scale) } -int16_t tw2048[2048] __attribute__((aligned(16))) = {32767,0,32766,-101,32766,-202,32765,-302,32764,-403,32763,-503,32761,-604,32759,-704,32757,-805,32754,-905,32751,-1006,32748,-1106,32744,-1207,32740,-1307,32736,-1407,32732,-1508,32727,-1608,32722,-1709,32717,-1809,32711,-1909,32705,-2010,32699,-2110,32692,-2210,32685,-2311,32678,-2411,32670,-2511,32662,-2611,32654,-2712,32646,-2812,32637,-2912,32628,-3012,32618,-3112,32609,-3212,32599,-3312,32588,-3412,32578,-3512,32567,-3612,32556,-3712,32544,-3812,32532,-3912,32520,-4012,32508,-4111,32495,-4211,32482,-4311,32468,-4410,32455,-4510,32441,-4609,32426,-4709,32412,-4808,32397,-4908,32382,-5007,32366,-5107,32350,-5206,32334,-5305,32318,-5404,32301,-5503,32284,-5602,32267,-5701,32249,-5800,32231,-5899,32213,-5998,32194,-6097,32176,-6196,32156,-6294,32137,-6393,32117,-6492,32097,-6590,32077,-6689,32056,-6787,32035,-6885,32014,-6983,31992,-7082,31970,-7180,31948,-7278,31926,-7376,31903,-7474,31880,-7572,31856,-7669,31833,-7767,31809,-7865,31785,-7962,31760,-8060,31735,-8157,31710,-8254,31684,-8352,31659,-8449,31633,-8546,31606,-8643,31580,-8740,31553,-8837,31525,-8933,31498,-9030,31470,-9127,31442,-9223,31413,-9320,31385,-9416,31356,-9512,31326,-9608,31297,-9704,31267,-9800,31236,-9896,31206,-9992,31175,-10088,31144,-10183,31113,-10279,31081,-10374,31049,-10470,31017,-10565,30984,-10660,30951,-10755,30918,-10850,30885,-10945,30851,-11039,30817,-11134,30783,-11228,30748,-11323,30713,-11417,30678,-11511,30643,-11605,30607,-11699,30571,-11793,30535,-11887,30498,-11981,30461,-12074,30424,-12167,30386,-12261,30349,-12354,30311,-12447,30272,-12540,30234,-12633,30195,-12725,30156,-12818,30116,-12910,30076,-13003,30036,-13095,29996,-13187,29955,-13279,29915,-13371,29873,-13463,29832,-13554,29790,-13646,29748,-13737,29706,-13828,29663,-13919,29621,-14010,29577,-14101,29534,-14192,29490,-14282,29446,-14373,29402,-14463,29358,-14553,29313,-14643,29268,-14733,29222,-14823,29177,-14912,29131,-15002,29085,-15091,29038,-15180,28992,-15269,28945,-15358,28897,-15447,28850,-15535,28802,-15624,28754,-15712,28706,-15800,28657,-15888,28608,-15976,28559,-16064,28510,-16151,28460,-16239,28410,-16326,28360,-16413,28309,-16500,28259,-16587,28208,-16673,28156,-16760,28105,-16846,28053,-16932,28001,-17018,27948,-17104,27896,-17190,27843,-17275,27790,-17361,27736,-17446,27683,-17531,27629,-17616,27575,-17700,27520,-17785,27466,-17869,27411,-17953,27355,-18037,27300,-18121,27244,-18205,27188,-18288,27132,-18372,27076,-18455,27019,-18538,26962,-18621,26905,-18703,26847,-18786,26789,-18868,26731,-18950,26673,-19032,26615,-19114,26556,-19195,26497,-19277,26437,-19358,26378,-19439,26318,-19520,26258,-19600,26198,-19681,26137,-19761,26077,-19841,26016,-19921,25954,-20001,25893,-20080,25831,-20160,25769,-20239,25707,-20318,25645,-20397,25582,-20475,25519,-20554,25456,-20632,25392,-20710,25329,-20788,25265,-20865,25201,-20943,25136,-21020,25072,-21097,25007,-21174,24942,-21250,24877,-21327,24811,-21403,24745,-21479,24679,-21555,24613,-21630,24546,-21706,24480,-21781,24413,-21856,24346,-21931,24278,-22005,24211,-22080,24143,-22154,24075,-22228,24006,-22302,23938,-22375,23869,-22449,23800,-22522,23731,-22595,23661,-22667,23592,-22740,23522,-22812,23452,-22884,23382,-22956,23311,-23028,23240,-23099,23169,-23170,23098,-23241,23027,-23312,22955,-23383,22883,-23453,22811,-23523,22739,-23593,22666,-23662,22594,-23732,22521,-23801,22448,-23870,22374,-23939,22301,-24007,22227,-24076,22153,-24144,22079,-24212,22004,-24279,21930,-24347,21855,-24414,21780,-24481,21705,-24547,21629,-24614,21554,-24680,21478,-24746,21402,-24812,21326,-24878,21249,-24943,21173,-25008,21096,-25073,21019,-25137,20942,-25202,20864,-25266,20787,-25330,20709,-25393,20631,-25457,20553,-25520,20474,-25583,20396,-25646,20317,-25708,20238,-25770,20159,-25832,20079,-25894,20000,-25955,19920,-26017,19840,-26078,19760,-26138,19680,-26199,19599,-26259,19519,-26319,19438,-26379,19357,-26438,19276,-26498,19194,-26557,19113,-26616,19031,-26674,18949,-26732,18867,-26790,18785,-26848,18702,-26906,18620,-26963,18537,-27020,18454,-27077,18371,-27133,18287,-27189,18204,-27245,18120,-27301,18036,-27356,17952,-27412,17868,-27467,17784,-27521,17699,-27576,17615,-27630,17530,-27684,17445,-27737,17360,-27791,17274,-27844,17189,-27897,17103,-27949,17017,-28002,16931,-28054,16845,-28106,16759,-28157,16672,-28209,16586,-28260,16499,-28310,16412,-28361,16325,-28411,16238,-28461,16150,-28511,16063,-28560,15975,-28609,15887,-28658,15799,-28707,15711,-28755,15623,-28803,15534,-28851,15446,-28898,15357,-28946,15268,-28993,15179,-29039,15090,-29086,15001,-29132,14911,-29178,14822,-29223,14732,-29269,14642,-29314,14552,-29359,14462,-29403,14372,-29447,14281,-29491,14191,-29535,14100,-29578,14009,-29622,13918,-29664,13827,-29707,13736,-29749,13645,-29791,13553,-29833,13462,-29874,13370,-29916,13278,-29956,13186,-29997,13094,-30037,13002,-30077,12909,-30117,12817,-30157,12724,-30196,12632,-30235,12539,-30273,12446,-30312,12353,-30350,12260,-30387,12166,-30425,12073,-30462,11980,-30499,11886,-30536,11792,-30572,11698,-30608,11604,-30644,11510,-30679,11416,-30714,11322,-30749,11227,-30784,11133,-30818,11038,-30852,10944,-30886,10849,-30919,10754,-30952,10659,-30985,10564,-31018,10469,-31050,10373,-31082,10278,-31114,10182,-31145,10087,-31176,9991,-31207,9895,-31237,9799,-31268,9703,-31298,9607,-31327,9511,-31357,9415,-31386,9319,-31414,9222,-31443,9126,-31471,9029,-31499,8932,-31526,8836,-31554,8739,-31581,8642,-31607,8545,-31634,8448,-31660,8351,-31685,8253,-31711,8156,-31736,8059,-31761,7961,-31786,7864,-31810,7766,-31834,7668,-31857,7571,-31881,7473,-31904,7375,-31927,7277,-31949,7179,-31971,7081,-31993,6982,-32015,6884,-32036,6786,-32057,6688,-32078,6589,-32098,6491,-32118,6392,-32138,6293,-32157,6195,-32177,6096,-32195,5997,-32214,5898,-32232,5799,-32250,5700,-32268,5601,-32285,5502,-32302,5403,-32319,5304,-32335,5205,-32351,5106,-32367,5006,-32383,4907,-32398,4807,-32413,4708,-32427,4608,-32442,4509,-32456,4409,-32469,4310,-32483,4210,-32496,4110,-32509,4011,-32521,3911,-32533,3811,-32545,3711,-32557,3611,-32568,3511,-32579,3411,-32589,3311,-32600,3211,-32610,3111,-32619,3011,-32629,2911,-32638,2811,-32647,2711,-32655,2610,-32663,2510,-32671,2410,-32679,2310,-32686,2209,-32693,2109,-32700,2009,-32706,1908,-32712,1808,-32718,1708,-32723,1607,-32728,1507,-32733,1406,-32737,1306,-32741,1206,-32745,1105,-32749,1005,-32752,904,-32755,804,-32758,703,-32760,603,-32762,502,-32764,402,-32765,301,-32766,201,-32767,100,-32767,0,-32767,-101,-32767,-202,-32767,-302,-32766,-403,-32765,-503,-32764,-604,-32762,-704,-32760,-805,-32758,-905,-32755,-1006,-32752,-1106,-32749,-1207,-32745,-1307,-32741,-1407,-32737,-1508,-32733,-1608,-32728,-1709,-32723,-1809,-32718,-1909,-32712,-2010,-32706,-2110,-32700,-2210,-32693,-2311,-32686,-2411,-32679,-2511,-32671,-2611,-32663,-2712,-32655,-2812,-32647,-2912,-32638,-3012,-32629,-3112,-32619,-3212,-32610,-3312,-32600,-3412,-32589,-3512,-32579,-3612,-32568,-3712,-32557,-3812,-32545,-3912,-32533,-4012,-32521,-4111,-32509,-4211,-32496,-4311,-32483,-4410,-32469,-4510,-32456,-4609,-32442,-4709,-32427,-4808,-32413,-4908,-32398,-5007,-32383,-5107,-32367,-5206,-32351,-5305,-32335,-5404,-32319,-5503,-32302,-5602,-32285,-5701,-32268,-5800,-32250,-5899,-32232,-5998,-32214,-6097,-32195,-6196,-32177,-6294,-32157,-6393,-32138,-6492,-32118,-6590,-32098,-6689,-32078,-6787,-32057,-6885,-32036,-6983,-32015,-7082,-31993,-7180,-31971,-7278,-31949,-7376,-31927,-7474,-31904,-7572,-31881,-7669,-31857,-7767,-31834,-7865,-31810,-7962,-31786,-8060,-31761,-8157,-31736,-8254,-31711,-8352,-31685,-8449,-31660,-8546,-31634,-8643,-31607,-8740,-31581,-8837,-31554,-8933,-31526,-9030,-31499,-9127,-31471,-9223,-31443,-9320,-31414,-9416,-31386,-9512,-31357,-9608,-31327,-9704,-31298,-9800,-31268,-9896,-31237,-9992,-31207,-10088,-31176,-10183,-31145,-10279,-31114,-10374,-31082,-10470,-31050,-10565,-31018,-10660,-30985,-10755,-30952,-10850,-30919,-10945,-30886,-11039,-30852,-11134,-30818,-11228,-30784,-11323,-30749,-11417,-30714,-11511,-30679,-11605,-30644,-11699,-30608,-11793,-30572,-11887,-30536,-11981,-30499,-12074,-30462,-12167,-30425,-12261,-30387,-12354,-30350,-12447,-30312,-12540,-30273,-12633,-30235,-12725,-30196,-12818,-30157,-12910,-30117,-13003,-30077,-13095,-30037,-13187,-29997,-13279,-29956,-13371,-29916,-13463,-29874,-13554,-29833,-13646,-29791,-13737,-29749,-13828,-29707,-13919,-29664,-14010,-29622,-14101,-29578,-14192,-29535,-14282,-29491,-14373,-29447,-14463,-29403,-14553,-29359,-14643,-29314,-14733,-29269,-14823,-29223,-14912,-29178,-15002,-29132,-15091,-29086,-15180,-29039,-15269,-28993,-15358,-28946,-15447,-28898,-15535,-28851,-15624,-28803,-15712,-28755,-15800,-28707,-15888,-28658,-15976,-28609,-16064,-28560,-16151,-28511,-16239,-28461,-16326,-28411,-16413,-28361,-16500,-28310,-16587,-28260,-16673,-28209,-16760,-28157,-16846,-28106,-16932,-28054,-17018,-28002,-17104,-27949,-17190,-27897,-17275,-27844,-17361,-27791,-17446,-27737,-17531,-27684,-17616,-27630,-17700,-27576,-17785,-27521,-17869,-27467,-17953,-27412,-18037,-27356,-18121,-27301,-18205,-27245,-18288,-27189,-18372,-27133,-18455,-27077,-18538,-27020,-18621,-26963,-18703,-26906,-18786,-26848,-18868,-26790,-18950,-26732,-19032,-26674,-19114,-26616,-19195,-26557,-19277,-26498,-19358,-26438,-19439,-26379,-19520,-26319,-19600,-26259,-19681,-26199,-19761,-26138,-19841,-26078,-19921,-26017,-20001,-25955,-20080,-25894,-20160,-25832,-20239,-25770,-20318,-25708,-20397,-25646,-20475,-25583,-20554,-25520,-20632,-25457,-20710,-25393,-20788,-25330,-20865,-25266,-20943,-25202,-21020,-25137,-21097,-25073,-21174,-25008,-21250,-24943,-21327,-24878,-21403,-24812,-21479,-24746,-21555,-24680,-21630,-24614,-21706,-24547,-21781,-24481,-21856,-24414,-21931,-24347,-22005,-24279,-22080,-24212,-22154,-24144,-22228,-24076,-22302,-24007,-22375,-23939,-22449,-23870,-22522,-23801,-22595,-23732,-22667,-23662,-22740,-23593,-22812,-23523,-22884,-23453,-22956,-23383,-23028,-23312,-23099,-23241,-23170,-23170,-23241,-23099,-23312,-23028,-23383,-22956,-23453,-22884,-23523,-22812,-23593,-22740,-23662,-22667,-23732,-22595,-23801,-22522,-23870,-22449,-23939,-22375,-24007,-22302,-24076,-22228,-24144,-22154,-24212,-22080,-24279,-22005,-24347,-21931,-24414,-21856,-24481,-21781,-24547,-21706,-24614,-21630,-24680,-21555,-24746,-21479,-24812,-21403,-24878,-21327,-24943,-21250,-25008,-21174,-25073,-21097,-25137,-21020,-25202,-20943,-25266,-20865,-25330,-20788,-25393,-20710,-25457,-20632,-25520,-20554,-25583,-20475,-25646,-20397,-25708,-20318,-25770,-20239,-25832,-20160,-25894,-20080,-25955,-20001,-26017,-19921,-26078,-19841,-26138,-19761,-26199,-19681,-26259,-19600,-26319,-19520,-26379,-19439,-26438,-19358,-26498,-19277,-26557,-19195,-26616,-19114,-26674,-19032,-26732,-18950,-26790,-18868,-26848,-18786,-26906,-18703,-26963,-18621,-27020,-18538,-27077,-18455,-27133,-18372,-27189,-18288,-27245,-18205,-27301,-18121,-27356,-18037,-27412,-17953,-27467,-17869,-27521,-17785,-27576,-17700,-27630,-17616,-27684,-17531,-27737,-17446,-27791,-17361,-27844,-17275,-27897,-17190,-27949,-17104,-28002,-17018,-28054,-16932,-28106,-16846,-28157,-16760,-28209,-16673,-28260,-16587,-28310,-16500,-28361,-16413,-28411,-16326,-28461,-16239,-28511,-16151,-28560,-16064,-28609,-15976,-28658,-15888,-28707,-15800,-28755,-15712,-28803,-15624,-28851,-15535,-28898,-15447,-28946,-15358,-28993,-15269,-29039,-15180,-29086,-15091,-29132,-15002,-29178,-14912,-29223,-14823,-29269,-14733,-29314,-14643,-29359,-14553,-29403,-14463,-29447,-14373,-29491,-14282,-29535,-14192,-29578,-14101,-29622,-14010,-29664,-13919,-29707,-13828,-29749,-13737,-29791,-13646,-29833,-13554,-29874,-13463,-29916,-13371,-29956,-13279,-29997,-13187,-30037,-13095,-30077,-13003,-30117,-12910,-30157,-12818,-30196,-12725,-30235,-12633,-30273,-12540,-30312,-12447,-30350,-12354,-30387,-12261,-30425,-12167,-30462,-12074,-30499,-11981,-30536,-11887,-30572,-11793,-30608,-11699,-30644,-11605,-30679,-11511,-30714,-11417,-30749,-11323,-30784,-11228,-30818,-11134,-30852,-11039,-30886,-10945,-30919,-10850,-30952,-10755,-30985,-10660,-31018,-10565,-31050,-10470,-31082,-10374,-31114,-10279,-31145,-10183,-31176,-10088,-31207,-9992,-31237,-9896,-31268,-9800,-31298,-9704,-31327,-9608,-31357,-9512,-31386,-9416,-31414,-9320,-31443,-9223,-31471,-9127,-31499,-9030,-31526,-8933,-31554,-8837,-31581,-8740,-31607,-8643,-31634,-8546,-31660,-8449,-31685,-8352,-31711,-8254,-31736,-8157,-31761,-8060,-31786,-7962,-31810,-7865,-31834,-7767,-31857,-7669,-31881,-7572,-31904,-7474,-31927,-7376,-31949,-7278,-31971,-7180,-31993,-7082,-32015,-6983,-32036,-6885,-32057,-6787,-32078,-6689,-32098,-6590,-32118,-6492,-32138,-6393,-32157,-6294,-32177,-6196,-32195,-6097,-32214,-5998,-32232,-5899,-32250,-5800,-32268,-5701,-32285,-5602,-32302,-5503,-32319,-5404,-32335,-5305,-32351,-5206,-32367,-5107,-32383,-5007,-32398,-4908,-32413,-4808,-32427,-4709,-32442,-4609,-32456,-4510,-32469,-4410,-32483,-4311,-32496,-4211,-32509,-4111,-32521,-4012,-32533,-3912,-32545,-3812,-32557,-3712,-32568,-3612,-32579,-3512,-32589,-3412,-32600,-3312,-32610,-3212,-32619,-3112,-32629,-3012,-32638,-2912,-32647,-2812,-32655,-2712,-32663,-2611,-32671,-2511,-32679,-2411,-32686,-2311,-32693,-2210,-32700,-2110,-32706,-2010,-32712,-1909,-32718,-1809,-32723,-1709,-32728,-1608,-32733,-1508,-32737,-1407,-32741,-1307,-32745,-1207,-32749,-1106,-32752,-1006,-32755,-905,-32758,-805,-32760,-704,-32762,-604,-32764,-503,-32765,-403,-32766,-302,-32767,-202,-32767,-101}; +#ifdef __AVX2__ +void dft1024_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[128],ytmp[128],*tw1024_256p=(simd256_q15_t *)tw1024,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i,j; + + for (i=0,j=0; i<128; i+=4,j++) { + transpose16_ooff_simd256(x256+i,xtmp+j,32); + } + + + dft256_simd256((int16_t*)(xtmp),(int16_t*)(ytmp),1); + dft256_simd256((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1); + dft256_simd256((int16_t*)(xtmp+64),(int16_t*)(ytmp+64),1); + dft256_simd256((int16_t*)(xtmp+96),(int16_t*)(ytmp+96),1); + + for (i=0; i<32; i++) { + bfly4_256(ytmpp,ytmpp+32,ytmpp+64,ytmpp+96, + y256p,y256p+32,y256p+64,y256p+96, + tw1024_256p,tw1024_256p+32,tw1024_256p+64); + tw1024_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0; i<8; i++) { + y256[0] = shiftright_int16_simd256(y256[0],1); + y256[1] = shiftright_int16_simd256(y256[1],1); + y256[2] = shiftright_int16_simd256(y256[2],1); + y256[3] = shiftright_int16_simd256(y256[3],1); + y256[4] = shiftright_int16_simd256(y256[4],1); + y256[5] = shiftright_int16_simd256(y256[5],1); + y256[6] = shiftright_int16_simd256(y256[6],1); + y256[7] = shiftright_int16_simd256(y256[7],1); + y256[8] = shiftright_int16_simd256(y256[8],1); + y256[9] = shiftright_int16_simd256(y256[9],1); + y256[10] = shiftright_int16_simd256(y256[10],1); + y256[11] = shiftright_int16_simd256(y256[11],1); + y256[12] = shiftright_int16_simd256(y256[12],1); + y256[13] = shiftright_int16_simd256(y256[13],1); + y256[14] = shiftright_int16_simd256(y256[14],1); + y256[15] = shiftright_int16_simd256(y256[15],1); + + y256+=16; + } + + } + + _mm_empty(); + _m_empty(); + +} + +void idft1024_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[128],ytmp[128],*tw1024_256p=(simd256_q15_t *)tw1024,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i,j; + + for (i=0,j=0; i<128; i+=4,j++) { + transpose16_ooff_simd256(x256+i,xtmp+j,32); + } + + + idft256_simd256((int16_t*)(xtmp),(int16_t*)(ytmp),1); + idft256_simd256((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1); + idft256_simd256((int16_t*)(xtmp+64),(int16_t*)(ytmp+64),1); + idft256_simd256((int16_t*)(xtmp+96),(int16_t*)(ytmp+96),1); + + for (i=0; i<32; i++) { + ibfly4_256(ytmpp,ytmpp+32,ytmpp+64,ytmpp+96, + y256p,y256p+32,y256p+64,y256p+96, + tw1024_256p,tw1024_256p+32,tw1024_256p+64); + tw1024_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0; i<8; i++) { + y256[0] = shiftright_int16_simd256(y256[0],1); + y256[1] = shiftright_int16_simd256(y256[1],1); + y256[2] = shiftright_int16_simd256(y256[2],1); + y256[3] = shiftright_int16_simd256(y256[3],1); + y256[4] = shiftright_int16_simd256(y256[4],1); + y256[5] = shiftright_int16_simd256(y256[5],1); + y256[6] = shiftright_int16_simd256(y256[6],1); + y256[7] = shiftright_int16_simd256(y256[7],1); + y256[8] = shiftright_int16_simd256(y256[8],1); + y256[9] = shiftright_int16_simd256(y256[9],1); + y256[10] = shiftright_int16_simd256(y256[10],1); + y256[11] = shiftright_int16_simd256(y256[11],1); + y256[12] = shiftright_int16_simd256(y256[12],1); + y256[13] = shiftright_int16_simd256(y256[13],1); + y256[14] = shiftright_int16_simd256(y256[14],1); + y256[15] = shiftright_int16_simd256(y256[15],1); + + y256+=16; + } + + } + + _mm_empty(); + _m_empty(); + +} +#endif + +int16_t tw2048[2048] __attribute__((aligned(32))) = {32767,0,32766,-101,32766,-202,32765,-302,32764,-403,32763,-503,32761,-604,32759,-704,32757,-805,32754,-905,32751,-1006,32748,-1106,32744,-1207,32740,-1307,32736,-1407,32732,-1508,32727,-1608,32722,-1709,32717,-1809,32711,-1909,32705,-2010,32699,-2110,32692,-2210,32685,-2311,32678,-2411,32670,-2511,32662,-2611,32654,-2712,32646,-2812,32637,-2912,32628,-3012,32618,-3112,32609,-3212,32599,-3312,32588,-3412,32578,-3512,32567,-3612,32556,-3712,32544,-3812,32532,-3912,32520,-4012,32508,-4111,32495,-4211,32482,-4311,32468,-4410,32455,-4510,32441,-4609,32426,-4709,32412,-4808,32397,-4908,32382,-5007,32366,-5107,32350,-5206,32334,-5305,32318,-5404,32301,-5503,32284,-5602,32267,-5701,32249,-5800,32231,-5899,32213,-5998,32194,-6097,32176,-6196,32156,-6294,32137,-6393,32117,-6492,32097,-6590,32077,-6689,32056,-6787,32035,-6885,32014,-6983,31992,-7082,31970,-7180,31948,-7278,31926,-7376,31903,-7474,31880,-7572,31856,-7669,31833,-7767,31809,-7865,31785,-7962,31760,-8060,31735,-8157,31710,-8254,31684,-8352,31659,-8449,31633,-8546,31606,-8643,31580,-8740,31553,-8837,31525,-8933,31498,-9030,31470,-9127,31442,-9223,31413,-9320,31385,-9416,31356,-9512,31326,-9608,31297,-9704,31267,-9800,31236,-9896,31206,-9992,31175,-10088,31144,-10183,31113,-10279,31081,-10374,31049,-10470,31017,-10565,30984,-10660,30951,-10755,30918,-10850,30885,-10945,30851,-11039,30817,-11134,30783,-11228,30748,-11323,30713,-11417,30678,-11511,30643,-11605,30607,-11699,30571,-11793,30535,-11887,30498,-11981,30461,-12074,30424,-12167,30386,-12261,30349,-12354,30311,-12447,30272,-12540,30234,-12633,30195,-12725,30156,-12818,30116,-12910,30076,-13003,30036,-13095,29996,-13187,29955,-13279,29915,-13371,29873,-13463,29832,-13554,29790,-13646,29748,-13737,29706,-13828,29663,-13919,29621,-14010,29577,-14101,29534,-14192,29490,-14282,29446,-14373,29402,-14463,29358,-14553,29313,-14643,29268,-14733,29222,-14823,29177,-14912,29131,-15002,29085,-15091,29038,-15180,28992,-15269,28945,-15358,28897,-15447,28850,-15535,28802,-15624,28754,-15712,28706,-15800,28657,-15888,28608,-15976,28559,-16064,28510,-16151,28460,-16239,28410,-16326,28360,-16413,28309,-16500,28259,-16587,28208,-16673,28156,-16760,28105,-16846,28053,-16932,28001,-17018,27948,-17104,27896,-17190,27843,-17275,27790,-17361,27736,-17446,27683,-17531,27629,-17616,27575,-17700,27520,-17785,27466,-17869,27411,-17953,27355,-18037,27300,-18121,27244,-18205,27188,-18288,27132,-18372,27076,-18455,27019,-18538,26962,-18621,26905,-18703,26847,-18786,26789,-18868,26731,-18950,26673,-19032,26615,-19114,26556,-19195,26497,-19277,26437,-19358,26378,-19439,26318,-19520,26258,-19600,26198,-19681,26137,-19761,26077,-19841,26016,-19921,25954,-20001,25893,-20080,25831,-20160,25769,-20239,25707,-20318,25645,-20397,25582,-20475,25519,-20554,25456,-20632,25392,-20710,25329,-20788,25265,-20865,25201,-20943,25136,-21020,25072,-21097,25007,-21174,24942,-21250,24877,-21327,24811,-21403,24745,-21479,24679,-21555,24613,-21630,24546,-21706,24480,-21781,24413,-21856,24346,-21931,24278,-22005,24211,-22080,24143,-22154,24075,-22228,24006,-22302,23938,-22375,23869,-22449,23800,-22522,23731,-22595,23661,-22667,23592,-22740,23522,-22812,23452,-22884,23382,-22956,23311,-23028,23240,-23099,23169,-23170,23098,-23241,23027,-23312,22955,-23383,22883,-23453,22811,-23523,22739,-23593,22666,-23662,22594,-23732,22521,-23801,22448,-23870,22374,-23939,22301,-24007,22227,-24076,22153,-24144,22079,-24212,22004,-24279,21930,-24347,21855,-24414,21780,-24481,21705,-24547,21629,-24614,21554,-24680,21478,-24746,21402,-24812,21326,-24878,21249,-24943,21173,-25008,21096,-25073,21019,-25137,20942,-25202,20864,-25266,20787,-25330,20709,-25393,20631,-25457,20553,-25520,20474,-25583,20396,-25646,20317,-25708,20238,-25770,20159,-25832,20079,-25894,20000,-25955,19920,-26017,19840,-26078,19760,-26138,19680,-26199,19599,-26259,19519,-26319,19438,-26379,19357,-26438,19276,-26498,19194,-26557,19113,-26616,19031,-26674,18949,-26732,18867,-26790,18785,-26848,18702,-26906,18620,-26963,18537,-27020,18454,-27077,18371,-27133,18287,-27189,18204,-27245,18120,-27301,18036,-27356,17952,-27412,17868,-27467,17784,-27521,17699,-27576,17615,-27630,17530,-27684,17445,-27737,17360,-27791,17274,-27844,17189,-27897,17103,-27949,17017,-28002,16931,-28054,16845,-28106,16759,-28157,16672,-28209,16586,-28260,16499,-28310,16412,-28361,16325,-28411,16238,-28461,16150,-28511,16063,-28560,15975,-28609,15887,-28658,15799,-28707,15711,-28755,15623,-28803,15534,-28851,15446,-28898,15357,-28946,15268,-28993,15179,-29039,15090,-29086,15001,-29132,14911,-29178,14822,-29223,14732,-29269,14642,-29314,14552,-29359,14462,-29403,14372,-29447,14281,-29491,14191,-29535,14100,-29578,14009,-29622,13918,-29664,13827,-29707,13736,-29749,13645,-29791,13553,-29833,13462,-29874,13370,-29916,13278,-29956,13186,-29997,13094,-30037,13002,-30077,12909,-30117,12817,-30157,12724,-30196,12632,-30235,12539,-30273,12446,-30312,12353,-30350,12260,-30387,12166,-30425,12073,-30462,11980,-30499,11886,-30536,11792,-30572,11698,-30608,11604,-30644,11510,-30679,11416,-30714,11322,-30749,11227,-30784,11133,-30818,11038,-30852,10944,-30886,10849,-30919,10754,-30952,10659,-30985,10564,-31018,10469,-31050,10373,-31082,10278,-31114,10182,-31145,10087,-31176,9991,-31207,9895,-31237,9799,-31268,9703,-31298,9607,-31327,9511,-31357,9415,-31386,9319,-31414,9222,-31443,9126,-31471,9029,-31499,8932,-31526,8836,-31554,8739,-31581,8642,-31607,8545,-31634,8448,-31660,8351,-31685,8253,-31711,8156,-31736,8059,-31761,7961,-31786,7864,-31810,7766,-31834,7668,-31857,7571,-31881,7473,-31904,7375,-31927,7277,-31949,7179,-31971,7081,-31993,6982,-32015,6884,-32036,6786,-32057,6688,-32078,6589,-32098,6491,-32118,6392,-32138,6293,-32157,6195,-32177,6096,-32195,5997,-32214,5898,-32232,5799,-32250,5700,-32268,5601,-32285,5502,-32302,5403,-32319,5304,-32335,5205,-32351,5106,-32367,5006,-32383,4907,-32398,4807,-32413,4708,-32427,4608,-32442,4509,-32456,4409,-32469,4310,-32483,4210,-32496,4110,-32509,4011,-32521,3911,-32533,3811,-32545,3711,-32557,3611,-32568,3511,-32579,3411,-32589,3311,-32600,3211,-32610,3111,-32619,3011,-32629,2911,-32638,2811,-32647,2711,-32655,2610,-32663,2510,-32671,2410,-32679,2310,-32686,2209,-32693,2109,-32700,2009,-32706,1908,-32712,1808,-32718,1708,-32723,1607,-32728,1507,-32733,1406,-32737,1306,-32741,1206,-32745,1105,-32749,1005,-32752,904,-32755,804,-32758,703,-32760,603,-32762,502,-32764,402,-32765,301,-32766,201,-32767,100,-32767,0,-32767,-101,-32767,-202,-32767,-302,-32766,-403,-32765,-503,-32764,-604,-32762,-704,-32760,-805,-32758,-905,-32755,-1006,-32752,-1106,-32749,-1207,-32745,-1307,-32741,-1407,-32737,-1508,-32733,-1608,-32728,-1709,-32723,-1809,-32718,-1909,-32712,-2010,-32706,-2110,-32700,-2210,-32693,-2311,-32686,-2411,-32679,-2511,-32671,-2611,-32663,-2712,-32655,-2812,-32647,-2912,-32638,-3012,-32629,-3112,-32619,-3212,-32610,-3312,-32600,-3412,-32589,-3512,-32579,-3612,-32568,-3712,-32557,-3812,-32545,-3912,-32533,-4012,-32521,-4111,-32509,-4211,-32496,-4311,-32483,-4410,-32469,-4510,-32456,-4609,-32442,-4709,-32427,-4808,-32413,-4908,-32398,-5007,-32383,-5107,-32367,-5206,-32351,-5305,-32335,-5404,-32319,-5503,-32302,-5602,-32285,-5701,-32268,-5800,-32250,-5899,-32232,-5998,-32214,-6097,-32195,-6196,-32177,-6294,-32157,-6393,-32138,-6492,-32118,-6590,-32098,-6689,-32078,-6787,-32057,-6885,-32036,-6983,-32015,-7082,-31993,-7180,-31971,-7278,-31949,-7376,-31927,-7474,-31904,-7572,-31881,-7669,-31857,-7767,-31834,-7865,-31810,-7962,-31786,-8060,-31761,-8157,-31736,-8254,-31711,-8352,-31685,-8449,-31660,-8546,-31634,-8643,-31607,-8740,-31581,-8837,-31554,-8933,-31526,-9030,-31499,-9127,-31471,-9223,-31443,-9320,-31414,-9416,-31386,-9512,-31357,-9608,-31327,-9704,-31298,-9800,-31268,-9896,-31237,-9992,-31207,-10088,-31176,-10183,-31145,-10279,-31114,-10374,-31082,-10470,-31050,-10565,-31018,-10660,-30985,-10755,-30952,-10850,-30919,-10945,-30886,-11039,-30852,-11134,-30818,-11228,-30784,-11323,-30749,-11417,-30714,-11511,-30679,-11605,-30644,-11699,-30608,-11793,-30572,-11887,-30536,-11981,-30499,-12074,-30462,-12167,-30425,-12261,-30387,-12354,-30350,-12447,-30312,-12540,-30273,-12633,-30235,-12725,-30196,-12818,-30157,-12910,-30117,-13003,-30077,-13095,-30037,-13187,-29997,-13279,-29956,-13371,-29916,-13463,-29874,-13554,-29833,-13646,-29791,-13737,-29749,-13828,-29707,-13919,-29664,-14010,-29622,-14101,-29578,-14192,-29535,-14282,-29491,-14373,-29447,-14463,-29403,-14553,-29359,-14643,-29314,-14733,-29269,-14823,-29223,-14912,-29178,-15002,-29132,-15091,-29086,-15180,-29039,-15269,-28993,-15358,-28946,-15447,-28898,-15535,-28851,-15624,-28803,-15712,-28755,-15800,-28707,-15888,-28658,-15976,-28609,-16064,-28560,-16151,-28511,-16239,-28461,-16326,-28411,-16413,-28361,-16500,-28310,-16587,-28260,-16673,-28209,-16760,-28157,-16846,-28106,-16932,-28054,-17018,-28002,-17104,-27949,-17190,-27897,-17275,-27844,-17361,-27791,-17446,-27737,-17531,-27684,-17616,-27630,-17700,-27576,-17785,-27521,-17869,-27467,-17953,-27412,-18037,-27356,-18121,-27301,-18205,-27245,-18288,-27189,-18372,-27133,-18455,-27077,-18538,-27020,-18621,-26963,-18703,-26906,-18786,-26848,-18868,-26790,-18950,-26732,-19032,-26674,-19114,-26616,-19195,-26557,-19277,-26498,-19358,-26438,-19439,-26379,-19520,-26319,-19600,-26259,-19681,-26199,-19761,-26138,-19841,-26078,-19921,-26017,-20001,-25955,-20080,-25894,-20160,-25832,-20239,-25770,-20318,-25708,-20397,-25646,-20475,-25583,-20554,-25520,-20632,-25457,-20710,-25393,-20788,-25330,-20865,-25266,-20943,-25202,-21020,-25137,-21097,-25073,-21174,-25008,-21250,-24943,-21327,-24878,-21403,-24812,-21479,-24746,-21555,-24680,-21630,-24614,-21706,-24547,-21781,-24481,-21856,-24414,-21931,-24347,-22005,-24279,-22080,-24212,-22154,-24144,-22228,-24076,-22302,-24007,-22375,-23939,-22449,-23870,-22522,-23801,-22595,-23732,-22667,-23662,-22740,-23593,-22812,-23523,-22884,-23453,-22956,-23383,-23028,-23312,-23099,-23241,-23170,-23170,-23241,-23099,-23312,-23028,-23383,-22956,-23453,-22884,-23523,-22812,-23593,-22740,-23662,-22667,-23732,-22595,-23801,-22522,-23870,-22449,-23939,-22375,-24007,-22302,-24076,-22228,-24144,-22154,-24212,-22080,-24279,-22005,-24347,-21931,-24414,-21856,-24481,-21781,-24547,-21706,-24614,-21630,-24680,-21555,-24746,-21479,-24812,-21403,-24878,-21327,-24943,-21250,-25008,-21174,-25073,-21097,-25137,-21020,-25202,-20943,-25266,-20865,-25330,-20788,-25393,-20710,-25457,-20632,-25520,-20554,-25583,-20475,-25646,-20397,-25708,-20318,-25770,-20239,-25832,-20160,-25894,-20080,-25955,-20001,-26017,-19921,-26078,-19841,-26138,-19761,-26199,-19681,-26259,-19600,-26319,-19520,-26379,-19439,-26438,-19358,-26498,-19277,-26557,-19195,-26616,-19114,-26674,-19032,-26732,-18950,-26790,-18868,-26848,-18786,-26906,-18703,-26963,-18621,-27020,-18538,-27077,-18455,-27133,-18372,-27189,-18288,-27245,-18205,-27301,-18121,-27356,-18037,-27412,-17953,-27467,-17869,-27521,-17785,-27576,-17700,-27630,-17616,-27684,-17531,-27737,-17446,-27791,-17361,-27844,-17275,-27897,-17190,-27949,-17104,-28002,-17018,-28054,-16932,-28106,-16846,-28157,-16760,-28209,-16673,-28260,-16587,-28310,-16500,-28361,-16413,-28411,-16326,-28461,-16239,-28511,-16151,-28560,-16064,-28609,-15976,-28658,-15888,-28707,-15800,-28755,-15712,-28803,-15624,-28851,-15535,-28898,-15447,-28946,-15358,-28993,-15269,-29039,-15180,-29086,-15091,-29132,-15002,-29178,-14912,-29223,-14823,-29269,-14733,-29314,-14643,-29359,-14553,-29403,-14463,-29447,-14373,-29491,-14282,-29535,-14192,-29578,-14101,-29622,-14010,-29664,-13919,-29707,-13828,-29749,-13737,-29791,-13646,-29833,-13554,-29874,-13463,-29916,-13371,-29956,-13279,-29997,-13187,-30037,-13095,-30077,-13003,-30117,-12910,-30157,-12818,-30196,-12725,-30235,-12633,-30273,-12540,-30312,-12447,-30350,-12354,-30387,-12261,-30425,-12167,-30462,-12074,-30499,-11981,-30536,-11887,-30572,-11793,-30608,-11699,-30644,-11605,-30679,-11511,-30714,-11417,-30749,-11323,-30784,-11228,-30818,-11134,-30852,-11039,-30886,-10945,-30919,-10850,-30952,-10755,-30985,-10660,-31018,-10565,-31050,-10470,-31082,-10374,-31114,-10279,-31145,-10183,-31176,-10088,-31207,-9992,-31237,-9896,-31268,-9800,-31298,-9704,-31327,-9608,-31357,-9512,-31386,-9416,-31414,-9320,-31443,-9223,-31471,-9127,-31499,-9030,-31526,-8933,-31554,-8837,-31581,-8740,-31607,-8643,-31634,-8546,-31660,-8449,-31685,-8352,-31711,-8254,-31736,-8157,-31761,-8060,-31786,-7962,-31810,-7865,-31834,-7767,-31857,-7669,-31881,-7572,-31904,-7474,-31927,-7376,-31949,-7278,-31971,-7180,-31993,-7082,-32015,-6983,-32036,-6885,-32057,-6787,-32078,-6689,-32098,-6590,-32118,-6492,-32138,-6393,-32157,-6294,-32177,-6196,-32195,-6097,-32214,-5998,-32232,-5899,-32250,-5800,-32268,-5701,-32285,-5602,-32302,-5503,-32319,-5404,-32335,-5305,-32351,-5206,-32367,-5107,-32383,-5007,-32398,-4908,-32413,-4808,-32427,-4709,-32442,-4609,-32456,-4510,-32469,-4410,-32483,-4311,-32496,-4211,-32509,-4111,-32521,-4012,-32533,-3912,-32545,-3812,-32557,-3712,-32568,-3612,-32579,-3512,-32589,-3412,-32600,-3312,-32610,-3212,-32619,-3112,-32629,-3012,-32638,-2912,-32647,-2812,-32655,-2712,-32663,-2611,-32671,-2511,-32679,-2411,-32686,-2311,-32693,-2210,-32700,-2110,-32706,-2010,-32712,-1909,-32718,-1809,-32723,-1709,-32728,-1608,-32733,-1508,-32737,-1407,-32741,-1307,-32745,-1207,-32749,-1106,-32752,-1006,-32755,-905,-32758,-805,-32760,-704,-32762,-604,-32764,-503,-32765,-403,-32766,-302,-32767,-202,-32767,-101}; void dft2048(int16_t *x,int16_t *y,int scale) @@ -2866,12 +4606,196 @@ void idft2048(int16_t *x,int16_t *y,int scale) } +#ifdef __AVX2__ + +void dft2048_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[256],*xtmpp,*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[256],*tw2048_256p=(simd256_q15_t *)tw2048,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + xtmpp = xtmp; + + for (i=0; i<4; i++) { + transpose4_ooff_simd256(x256 ,xtmpp,128); + transpose4_ooff_simd256(x256+2,xtmpp+1,128); + transpose4_ooff_simd256(x256+4,xtmpp+2,128); + transpose4_ooff_simd256(x256+6,xtmpp+3,128); + transpose4_ooff_simd256(x256+8,xtmpp+4,128); + transpose4_ooff_simd256(x256+10,xtmpp+5,128); + transpose4_ooff_simd256(x256+12,xtmpp+6,128); + transpose4_ooff_simd256(x256+14,xtmpp+7,128); + transpose4_ooff_simd256(x256+16,xtmpp+8,128); + transpose4_ooff_simd256(x256+18,xtmpp+9,128); + transpose4_ooff_simd256(x256+20,xtmpp+10,128); + transpose4_ooff_simd256(x256+22,xtmpp+11,128); + transpose4_ooff_simd256(x256+24,xtmpp+12,128); + transpose4_ooff_simd256(x256+26,xtmpp+13,128); + transpose4_ooff_simd256(x256+28,xtmpp+14,128); + transpose4_ooff_simd256(x256+30,xtmpp+15,128); + transpose4_ooff_simd256(x256+32,xtmpp+16,128); + transpose4_ooff_simd256(x256+34,xtmpp+17,128); + transpose4_ooff_simd256(x256+36,xtmpp+18,128); + transpose4_ooff_simd256(x256+38,xtmpp+19,128); + transpose4_ooff_simd256(x256+40,xtmpp+20,128); + transpose4_ooff_simd256(x256+42,xtmpp+21,128); + transpose4_ooff_simd256(x256+44,xtmpp+22,128); + transpose4_ooff_simd256(x256+46,xtmpp+23,128); + transpose4_ooff_simd256(x256+48,xtmpp+24,128); + transpose4_ooff_simd256(x256+50,xtmpp+25,128); + transpose4_ooff_simd256(x256+52,xtmpp+26,128); + transpose4_ooff_simd256(x256+54,xtmpp+27,128); + transpose4_ooff_simd256(x256+56,xtmpp+28,128); + transpose4_ooff_simd256(x256+58,xtmpp+29,128); + transpose4_ooff_simd256(x256+60,xtmpp+30,128); + transpose4_ooff_simd256(x256+62,xtmpp+31,128); + x256+=64; + xtmpp+=32; + } + + dft1024_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); + dft1024_simd256((int16_t*)(xtmp+256),(int16_t*)(ytmp+128),1); + + + for (i=0; i<128; i++) { + bfly2_256(ytmpp,ytmpp+128, + y256p,y256p+128, + tw2048_256p); + tw2048_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + y256p = y256; + + for (i=0; i<16; i++) { + y256p[0] = mulhi_int16_simd256(y256p[0],ONE_OVER_SQRT2_Q15_128); + y256p[1] = mulhi_int16_simd256(y256p[1],ONE_OVER_SQRT2_Q15_128); + y256p[2] = mulhi_int16_simd256(y256p[2],ONE_OVER_SQRT2_Q15_128); + y256p[3] = mulhi_int16_simd256(y256p[3],ONE_OVER_SQRT2_Q15_128); + y256p[4] = mulhi_int16_simd256(y256p[4],ONE_OVER_SQRT2_Q15_128); + y256p[5] = mulhi_int16_simd256(y256p[5],ONE_OVER_SQRT2_Q15_128); + y256p[6] = mulhi_int16_simd256(y256p[6],ONE_OVER_SQRT2_Q15_128); + y256p[7] = mulhi_int16_simd256(y256p[7],ONE_OVER_SQRT2_Q15_128); + y256p[8] = mulhi_int16_simd256(y256p[8],ONE_OVER_SQRT2_Q15_128); + y256p[9] = mulhi_int16_simd256(y256p[9],ONE_OVER_SQRT2_Q15_128); + y256p[10] = mulhi_int16_simd256(y256p[10],ONE_OVER_SQRT2_Q15_128); + y256p[11] = mulhi_int16_simd256(y256p[11],ONE_OVER_SQRT2_Q15_128); + y256p[12] = mulhi_int16_simd256(y256p[12],ONE_OVER_SQRT2_Q15_128); + y256p[13] = mulhi_int16_simd256(y256p[13],ONE_OVER_SQRT2_Q15_128); + y256p[14] = mulhi_int16_simd256(y256p[14],ONE_OVER_SQRT2_Q15_128); + y256p[15] = mulhi_int16_simd256(y256p[15],ONE_OVER_SQRT2_Q15_128); + y256p+=16; + } + } + + _mm_empty(); + _m_empty(); + +} + +void idft2048_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[256],*xtmpp,*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[256],*tw2048_256p=(simd256_q15_t *)tw2048,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + xtmpp = xtmp; + + for (i=0; i<4; i++) { + transpose4_ooff_simd256(x256 ,xtmpp,128); + transpose4_ooff_simd256(x256+2,xtmpp+1,128); + transpose4_ooff_simd256(x256+4,xtmpp+2,128); + transpose4_ooff_simd256(x256+6,xtmpp+3,128); + transpose4_ooff_simd256(x256+8,xtmpp+4,128); + transpose4_ooff_simd256(x256+10,xtmpp+5,128); + transpose4_ooff_simd256(x256+12,xtmpp+6,128); + transpose4_ooff_simd256(x256+14,xtmpp+7,128); + transpose4_ooff_simd256(x256+16,xtmpp+8,128); + transpose4_ooff_simd256(x256+18,xtmpp+9,128); + transpose4_ooff_simd256(x256+20,xtmpp+10,128); + transpose4_ooff_simd256(x256+22,xtmpp+11,128); + transpose4_ooff_simd256(x256+24,xtmpp+12,128); + transpose4_ooff_simd256(x256+26,xtmpp+13,128); + transpose4_ooff_simd256(x256+28,xtmpp+14,128); + transpose4_ooff_simd256(x256+30,xtmpp+15,128); + transpose4_ooff_simd256(x256+32,xtmpp+16,128); + transpose4_ooff_simd256(x256+34,xtmpp+17,128); + transpose4_ooff_simd256(x256+36,xtmpp+18,128); + transpose4_ooff_simd256(x256+38,xtmpp+19,128); + transpose4_ooff_simd256(x256+40,xtmpp+20,128); + transpose4_ooff_simd256(x256+42,xtmpp+21,128); + transpose4_ooff_simd256(x256+44,xtmpp+22,128); + transpose4_ooff_simd256(x256+46,xtmpp+23,128); + transpose4_ooff_simd256(x256+48,xtmpp+24,128); + transpose4_ooff_simd256(x256+50,xtmpp+25,128); + transpose4_ooff_simd256(x256+52,xtmpp+26,128); + transpose4_ooff_simd256(x256+54,xtmpp+27,128); + transpose4_ooff_simd256(x256+56,xtmpp+28,128); + transpose4_ooff_simd256(x256+58,xtmpp+29,128); + transpose4_ooff_simd256(x256+60,xtmpp+30,128); + transpose4_ooff_simd256(x256+62,xtmpp+31,128); + x256+=64; + xtmpp+=32; + } + + idft1024_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); + idft1024_simd256((int16_t*)(xtmp+256),(int16_t*)(ytmp+128),1); + + + for (i=0; i<128; i++) { + ibfly2_256(ytmpp,ytmpp+128, + y256p,y256p+128, + tw2048_256p); + tw2048_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + y256p = y256; + + for (i=0; i<16; i++) { + y256p[0] = mulhi_int16_simd256(y256p[0],ONE_OVER_SQRT2_Q15_128); + y256p[1] = mulhi_int16_simd256(y256p[1],ONE_OVER_SQRT2_Q15_128); + y256p[2] = mulhi_int16_simd256(y256p[2],ONE_OVER_SQRT2_Q15_128); + y256p[3] = mulhi_int16_simd256(y256p[3],ONE_OVER_SQRT2_Q15_128); + y256p[4] = mulhi_int16_simd256(y256p[4],ONE_OVER_SQRT2_Q15_128); + y256p[5] = mulhi_int16_simd256(y256p[5],ONE_OVER_SQRT2_Q15_128); + y256p[6] = mulhi_int16_simd256(y256p[6],ONE_OVER_SQRT2_Q15_128); + y256p[7] = mulhi_int16_simd256(y256p[7],ONE_OVER_SQRT2_Q15_128); + y256p[8] = mulhi_int16_simd256(y256p[8],ONE_OVER_SQRT2_Q15_128); + y256p[9] = mulhi_int16_simd256(y256p[9],ONE_OVER_SQRT2_Q15_128); + y256p[10] = mulhi_int16_simd256(y256p[10],ONE_OVER_SQRT2_Q15_128); + y256p[11] = mulhi_int16_simd256(y256p[11],ONE_OVER_SQRT2_Q15_128); + y256p[12] = mulhi_int16_simd256(y256p[12],ONE_OVER_SQRT2_Q15_128); + y256p[13] = mulhi_int16_simd256(y256p[13],ONE_OVER_SQRT2_Q15_128); + y256p[14] = mulhi_int16_simd256(y256p[14],ONE_OVER_SQRT2_Q15_128); + y256p[15] = mulhi_int16_simd256(y256p[15],ONE_OVER_SQRT2_Q15_128); + y256p+=16; + } + } + + _mm_empty(); + _m_empty(); + +} + +#endif + #include "twiddles4096.h" void dft4096(int16_t *x,int16_t *y,int scale) { - simd_q15_t xtmp[4096],ytmp[4096],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; + simd_q15_t xtmp[1024],ytmp[1024],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; simd_q15_t *ytmpp = &ytmp[0]; int i,j; @@ -2924,10 +4848,12 @@ void dft4096(int16_t *x,int16_t *y,int scale) } + + void idft4096(int16_t *x,int16_t *y,int scale) { - simd_q15_t xtmp[4096],ytmp[4096],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; + simd_q15_t xtmp[1024],ytmp[1024],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; simd_q15_t *ytmpp = &ytmp[0]; int i,j; @@ -2980,18 +4906,123 @@ void idft4096(int16_t *x,int16_t *y,int scale) } -/* Twiddles generated with -twa = floor(32767*exp(-sqrt(-1)*2*pi*(0:4095)/8192)); -twa2 = zeros(1,2*4096); -twa2(1:2:end) = real(twa); -twa2(2:2:end) = imag(twa); -fd=fopen("twiddle_tmp.txt","w"); -fprintf(fd,"static int16_t tw8192[4096*2] = {"); -fprintf(fd,"%d,",twa2(1:(4096*2)-1)); -fprintf(fd,"%d};\n",twa2(end)); -fclose(fd); -*/ -static int16_t tw8192[4096*2] = {32767,0,32766,-26,32766,-51,32766,-76,32766,-101,32766,-126,32766,-151,32766,-176,32766,-202,32766,-227,32766,-252,32765,-277,32765,-302,32765,-327,32765,-352,32764,-377,32764,-403,32764,-428,32763,-453,32763,-478,32763,-503,32762,-528,32762,-553,32761,-579,32761,-604,32760,-629,32760,-654,32759,-679,32759,-704,32758,-729,32758,-754,32757,-780,32757,-805,32756,-830,32755,-855,32755,-880,32754,-905,32753,-930,32753,-955,32752,-981,32751,-1006,32750,-1031,32750,-1056,32749,-1081,32748,-1106,32747,-1131,32746,-1156,32745,-1181,32744,-1207,32743,-1232,32742,-1257,32741,-1282,32740,-1307,32739,-1332,32738,-1357,32737,-1382,32736,-1407,32735,-1433,32734,-1458,32733,-1483,32732,-1508,32731,-1533,32729,-1558,32728,-1583,32727,-1608,32726,-1633,32725,-1659,32723,-1684,32722,-1709,32721,-1734,32719,-1759,32718,-1784,32717,-1809,32715,-1834,32714,-1859,32712,-1884,32711,-1909,32709,-1935,32708,-1960,32706,-1985,32705,-2010,32703,-2035,32702,-2060,32700,-2085,32699,-2110,32697,-2135,32695,-2160,32694,-2185,32692,-2210,32690,-2236,32688,-2261,32687,-2286,32685,-2311,32683,-2336,32681,-2361,32680,-2386,32678,-2411,32676,-2436,32674,-2461,32672,-2486,32670,-2511,32668,-2536,32666,-2561,32664,-2586,32662,-2611,32660,-2637,32658,-2662,32656,-2687,32654,-2712,32652,-2737,32650,-2762,32648,-2787,32646,-2812,32644,-2837,32641,-2862,32639,-2887,32637,-2912,32635,-2937,32632,-2962,32630,-2987,32628,-3012,32625,-3037,32623,-3062,32621,-3087,32618,-3112,32616,-3137,32614,-3162,32611,-3187,32609,-3212,32606,-3237,32604,-3262,32601,-3287,32599,-3312,32596,-3337,32594,-3362,32591,-3387,32588,-3412,32586,-3437,32583,-3462,32580,-3487,32578,-3512,32575,-3537,32572,-3562,32570,-3587,32567,-3612,32564,-3637,32561,-3662,32558,-3687,32556,-3712,32553,-3737,32550,-3762,32547,-3787,32544,-3812,32541,-3837,32538,-3862,32535,-3887,32532,-3912,32529,-3937,32526,-3962,32523,-3987,32520,-4012,32517,-4036,32514,-4061,32511,-4086,32508,-4111,32504,-4136,32501,-4161,32498,-4186,32495,-4211,32492,-4236,32488,-4261,32485,-4286,32482,-4311,32478,-4336,32475,-4360,32472,-4385,32468,-4410,32465,-4435,32462,-4460,32458,-4485,32455,-4510,32451,-4535,32448,-4560,32444,-4585,32441,-4609,32437,-4634,32434,-4659,32430,-4684,32426,-4709,32423,-4734,32419,-4759,32416,-4784,32412,-4808,32408,-4833,32404,-4858,32401,-4883,32397,-4908,32393,-4933,32389,-4958,32386,-4982,32382,-5007,32378,-5032,32374,-5057,32370,-5082,32366,-5107,32362,-5131,32358,-5156,32354,-5181,32350,-5206,32346,-5231,32342,-5255,32338,-5280,32334,-5305,32330,-5330,32326,-5355,32322,-5379,32318,-5404,32314,-5429,32310,-5454,32305,-5479,32301,-5503,32297,-5528,32293,-5553,32288,-5578,32284,-5602,32280,-5627,32275,-5652,32271,-5677,32267,-5701,32262,-5726,32258,-5751,32254,-5776,32249,-5800,32245,-5825,32240,-5850,32236,-5875,32231,-5899,32227,-5924,32222,-5949,32218,-5973,32213,-5998,32208,-6023,32204,-6048,32199,-6072,32194,-6097,32190,-6122,32185,-6146,32180,-6171,32176,-6196,32171,-6220,32166,-6245,32161,-6270,32156,-6294,32152,-6319,32147,-6344,32142,-6368,32137,-6393,32132,-6418,32127,-6442,32122,-6467,32117,-6492,32112,-6516,32107,-6541,32102,-6565,32097,-6590,32092,-6615,32087,-6639,32082,-6664,32077,-6689,32072,-6713,32066,-6738,32061,-6762,32056,-6787,32051,-6812,32046,-6836,32040,-6861,32035,-6885,32030,-6910,32024,-6934,32019,-6959,32014,-6983,32008,-7008,32003,-7033,31998,-7057,31992,-7082,31987,-7106,31981,-7131,31976,-7155,31970,-7180,31965,-7204,31959,-7229,31954,-7253,31948,-7278,31943,-7302,31937,-7327,31931,-7351,31926,-7376,31920,-7400,31914,-7425,31909,-7449,31903,-7474,31897,-7498,31891,-7523,31886,-7547,31880,-7572,31874,-7596,31868,-7620,31862,-7645,31856,-7669,31851,-7694,31845,-7718,31839,-7743,31833,-7767,31827,-7791,31821,-7816,31815,-7840,31809,-7865,31803,-7889,31797,-7913,31791,-7938,31785,-7962,31778,-7987,31772,-8011,31766,-8035,31760,-8060,31754,-8084,31748,-8108,31741,-8133,31735,-8157,31729,-8181,31723,-8206,31716,-8230,31710,-8254,31704,-8279,31697,-8303,31691,-8327,31684,-8352,31678,-8376,31672,-8400,31665,-8425,31659,-8449,31652,-8473,31646,-8497,31639,-8522,31633,-8546,31626,-8570,31619,-8594,31613,-8619,31606,-8643,31600,-8667,31593,-8691,31586,-8716,31580,-8740,31573,-8764,31566,-8788,31559,-8813,31553,-8837,31546,-8861,31539,-8885,31532,-8909,31525,-8933,31518,-8958,31512,-8982,31505,-9006,31498,-9030,31491,-9054,31484,-9078,31477,-9103,31470,-9127,31463,-9151,31456,-9175,31449,-9199,31442,-9223,31435,-9247,31428,-9271,31420,-9296,31413,-9320,31406,-9344,31399,-9368,31392,-9392,31385,-9416,31377,-9440,31370,-9464,31363,-9488,31356,-9512,31348,-9536,31341,-9560,31334,-9584,31326,-9608,31319,-9632,31311,-9656,31304,-9680,31297,-9704,31289,-9728,31282,-9752,31274,-9776,31267,-9800,31259,-9824,31252,-9848,31244,-9872,31236,-9896,31229,-9920,31221,-9944,31214,-9968,31206,-9992,31198,-10016,31191,-10040,31183,-10064,31175,-10088,31167,-10112,31160,-10136,31152,-10160,31144,-10183,31136,-10207,31128,-10231,31121,-10255,31113,-10279,31105,-10303,31097,-10327,31089,-10350,31081,-10374,31073,-10398,31065,-10422,31057,-10446,31049,-10470,31041,-10493,31033,-10517,31025,-10541,31017,-10565,31009,-10589,31001,-10612,30992,-10636,30984,-10660,30976,-10684,30968,-10707,30960,-10731,30951,-10755,30943,-10779,30935,-10802,30927,-10826,30918,-10850,30910,-10874,30902,-10897,30893,-10921,30885,-10945,30876,-10968,30868,-10992,30860,-11016,30851,-11039,30843,-11063,30834,-11087,30826,-11110,30817,-11134,30809,-11158,30800,-11181,30791,-11205,30783,-11228,30774,-11252,30766,-11276,30757,-11299,30748,-11323,30739,-11346,30731,-11370,30722,-11394,30713,-11417,30705,-11441,30696,-11464,30687,-11488,30678,-11511,30669,-11535,30660,-11558,30652,-11582,30643,-11605,30634,-11629,30625,-11652,30616,-11676,30607,-11699,30598,-11723,30589,-11746,30580,-11770,30571,-11793,30562,-11817,30553,-11840,30544,-11863,30535,-11887,30525,-11910,30516,-11934,30507,-11957,30498,-11981,30489,-12004,30480,-12027,30470,-12051,30461,-12074,30452,-12097,30442,-12121,30433,-12144,30424,-12167,30415,-12191,30405,-12214,30396,-12237,30386,-12261,30377,-12284,30368,-12307,30358,-12331,30349,-12354,30339,-12377,30330,-12400,30320,-12424,30311,-12447,30301,-12470,30291,-12493,30282,-12517,30272,-12540,30263,-12563,30253,-12586,30243,-12610,30234,-12633,30224,-12656,30214,-12679,30205,-12702,30195,-12725,30185,-12749,30175,-12772,30165,-12795,30156,-12818,30146,-12841,30136,-12864,30126,-12887,30116,-12910,30106,-12934,30096,-12957,30086,-12980,30076,-13003,30066,-13026,30056,-13049,30046,-13072,30036,-13095,30026,-13118,30016,-13141,30006,-13164,29996,-13187,29986,-13210,29976,-13233,29966,-13256,29955,-13279,29945,-13302,29935,-13325,29925,-13348,29915,-13371,29904,-13394,29894,-13417,29884,-13440,29873,-13463,29863,-13486,29853,-13508,29842,-13531,29832,-13554,29822,-13577,29811,-13600,29801,-13623,29790,-13646,29780,-13668,29769,-13691,29759,-13714,29748,-13737,29738,-13760,29727,-13783,29717,-13805,29706,-13828,29695,-13851,29685,-13874,29674,-13896,29663,-13919,29653,-13942,29642,-13965,29631,-13987,29621,-14010,29610,-14033,29599,-14056,29588,-14078,29577,-14101,29567,-14124,29556,-14146,29545,-14169,29534,-14192,29523,-14214,29512,-14237,29501,-14260,29490,-14282,29479,-14305,29468,-14327,29457,-14350,29446,-14373,29435,-14395,29424,-14418,29413,-14440,29402,-14463,29391,-14485,29380,-14508,29369,-14531,29358,-14553,29346,-14576,29335,-14598,29324,-14621,29313,-14643,29302,-14666,29290,-14688,29279,-14710,29268,-14733,29256,-14755,29245,-14778,29234,-14800,29222,-14823,29211,-14845,29200,-14867,29188,-14890,29177,-14912,29165,-14935,29154,-14957,29142,-14979,29131,-15002,29119,-15024,29108,-15046,29096,-15069,29085,-15091,29073,-15113,29062,-15136,29050,-15158,29038,-15180,29027,-15202,29015,-15225,29003,-15247,28992,-15269,28980,-15291,28968,-15314,28956,-15336,28945,-15358,28933,-15380,28921,-15402,28909,-15425,28897,-15447,28886,-15469,28874,-15491,28862,-15513,28850,-15535,28838,-15557,28826,-15580,28814,-15602,28802,-15624,28790,-15646,28778,-15668,28766,-15690,28754,-15712,28742,-15734,28730,-15756,28718,-15778,28706,-15800,28694,-15822,28681,-15844,28669,-15866,28657,-15888,28645,-15910,28633,-15932,28620,-15954,28608,-15976,28596,-15998,28584,-16020,28571,-16042,28559,-16064,28547,-16086,28534,-16108,28522,-16129,28510,-16151,28497,-16173,28485,-16195,28472,-16217,28460,-16239,28447,-16261,28435,-16282,28423,-16304,28410,-16326,28397,-16348,28385,-16369,28372,-16391,28360,-16413,28347,-16435,28335,-16456,28322,-16478,28309,-16500,28297,-16522,28284,-16543,28271,-16565,28259,-16587,28246,-16608,28233,-16630,28220,-16652,28208,-16673,28195,-16695,28182,-16717,28169,-16738,28156,-16760,28143,-16781,28131,-16803,28118,-16825,28105,-16846,28092,-16868,28079,-16889,28066,-16911,28053,-16932,28040,-16954,28027,-16975,28014,-16997,28001,-17018,27988,-17040,27975,-17061,27962,-17083,27948,-17104,27935,-17125,27922,-17147,27909,-17168,27896,-17190,27883,-17211,27869,-17233,27856,-17254,27843,-17275,27830,-17297,27816,-17318,27803,-17339,27790,-17361,27777,-17382,27763,-17403,27750,-17424,27736,-17446,27723,-17467,27710,-17488,27696,-17510,27683,-17531,27669,-17552,27656,-17573,27642,-17594,27629,-17616,27615,-17637,27602,-17658,27588,-17679,27575,-17700,27561,-17721,27548,-17743,27534,-17764,27520,-17785,27507,-17806,27493,-17827,27479,-17848,27466,-17869,27452,-17890,27438,-17911,27424,-17932,27411,-17953,27397,-17974,27383,-17995,27369,-18016,27355,-18037,27342,-18058,27328,-18079,27314,-18100,27300,-18121,27286,-18142,27272,-18163,27258,-18184,27244,-18205,27230,-18226,27216,-18247,27202,-18268,27188,-18288,27174,-18309,27160,-18330,27146,-18351,27132,-18372,27118,-18393,27104,-18413,27090,-18434,27076,-18455,27061,-18476,27047,-18496,27033,-18517,27019,-18538,27005,-18559,26990,-18579,26976,-18600,26962,-18621,26948,-18641,26933,-18662,26919,-18683,26905,-18703,26890,-18724,26876,-18745,26861,-18765,26847,-18786,26833,-18806,26818,-18827,26804,-18847,26789,-18868,26775,-18889,26760,-18909,26746,-18930,26731,-18950,26717,-18971,26702,-18991,26688,-19012,26673,-19032,26658,-19052,26644,-19073,26629,-19093,26615,-19114,26600,-19134,26585,-19155,26570,-19175,26556,-19195,26541,-19216,26526,-19236,26512,-19256,26497,-19277,26482,-19297,26467,-19317,26452,-19338,26437,-19358,26423,-19378,26408,-19398,26393,-19419,26378,-19439,26363,-19459,26348,-19479,26333,-19500,26318,-19520,26303,-19540,26288,-19560,26273,-19580,26258,-19600,26243,-19621,26228,-19641,26213,-19661,26198,-19681,26183,-19701,26168,-19721,26153,-19741,26137,-19761,26122,-19781,26107,-19801,26092,-19821,26077,-19841,26061,-19861,26046,-19881,26031,-19901,26016,-19921,26000,-19941,25985,-19961,25970,-19981,25954,-20001,25939,-20021,25924,-20041,25908,-20061,25893,-20080,25878,-20100,25862,-20120,25847,-20140,25831,-20160,25816,-20180,25800,-20199,25785,-20219,25769,-20239,25754,-20259,25738,-20278,25723,-20298,25707,-20318,25691,-20338,25676,-20357,25660,-20377,25645,-20397,25629,-20416,25613,-20436,25598,-20456,25582,-20475,25566,-20495,25550,-20514,25535,-20534,25519,-20554,25503,-20573,25487,-20593,25472,-20612,25456,-20632,25440,-20651,25424,-20671,25408,-20690,25392,-20710,25376,-20729,25361,-20749,25345,-20768,25329,-20788,25313,-20807,25297,-20826,25281,-20846,25265,-20865,25249,-20885,25233,-20904,25217,-20923,25201,-20943,25185,-20962,25169,-20981,25152,-21001,25136,-21020,25120,-21039,25104,-21058,25088,-21078,25072,-21097,25056,-21116,25039,-21135,25023,-21155,25007,-21174,24991,-21193,24974,-21212,24958,-21231,24942,-21250,24926,-21269,24909,-21289,24893,-21308,24877,-21327,24860,-21346,24844,-21365,24827,-21384,24811,-21403,24795,-21422,24778,-21441,24762,-21460,24745,-21479,24729,-21498,24712,-21517,24696,-21536,24679,-21555,24663,-21574,24646,-21593,24630,-21612,24613,-21630,24596,-21649,24580,-21668,24563,-21687,24546,-21706,24530,-21725,24513,-21744,24496,-21762,24480,-21781,24463,-21800,24446,-21819,24430,-21837,24413,-21856,24396,-21875,24379,-21894,24362,-21912,24346,-21931,24329,-21950,24312,-21968,24295,-21987,24278,-22005,24261,-22024,24244,-22043,24228,-22061,24211,-22080,24194,-22098,24177,-22117,24160,-22136,24143,-22154,24126,-22173,24109,-22191,24092,-22210,24075,-22228,24058,-22246,24041,-22265,24023,-22283,24006,-22302,23989,-22320,23972,-22339,23955,-22357,23938,-22375,23921,-22394,23903,-22412,23886,-22430,23869,-22449,23852,-22467,23835,-22485,23817,-22504,23800,-22522,23783,-22540,23766,-22558,23748,-22576,23731,-22595,23714,-22613,23696,-22631,23679,-22649,23661,-22667,23644,-22686,23627,-22704,23609,-22722,23592,-22740,23574,-22758,23557,-22776,23539,-22794,23522,-22812,23504,-22830,23487,-22848,23469,-22866,23452,-22884,23434,-22902,23417,-22920,23399,-22938,23382,-22956,23364,-22974,23346,-22992,23329,-23010,23311,-23028,23293,-23046,23276,-23063,23258,-23081,23240,-23099,23223,-23117,23205,-23135,23187,-23152,23169,-23170,23151,-23188,23134,-23206,23116,-23224,23098,-23241,23080,-23259,23062,-23277,23045,-23294,23027,-23312,23009,-23330,22991,-23347,22973,-23365,22955,-23383,22937,-23400,22919,-23418,22901,-23435,22883,-23453,22865,-23470,22847,-23488,22829,-23505,22811,-23523,22793,-23540,22775,-23558,22757,-23575,22739,-23593,22721,-23610,22703,-23628,22685,-23645,22666,-23662,22648,-23680,22630,-23697,22612,-23715,22594,-23732,22575,-23749,22557,-23767,22539,-23784,22521,-23801,22503,-23818,22484,-23836,22466,-23853,22448,-23870,22429,-23887,22411,-23904,22393,-23922,22374,-23939,22356,-23956,22338,-23973,22319,-23990,22301,-24007,22282,-24024,22264,-24042,22245,-24059,22227,-24076,22209,-24093,22190,-24110,22172,-24127,22153,-24144,22135,-24161,22116,-24178,22097,-24195,22079,-24212,22060,-24229,22042,-24245,22023,-24262,22004,-24279,21986,-24296,21967,-24313,21949,-24330,21930,-24347,21911,-24363,21893,-24380,21874,-24397,21855,-24414,21836,-24431,21818,-24447,21799,-24464,21780,-24481,21761,-24497,21743,-24514,21724,-24531,21705,-24547,21686,-24564,21667,-24581,21648,-24597,21629,-24614,21611,-24631,21592,-24647,21573,-24664,21554,-24680,21535,-24697,21516,-24713,21497,-24730,21478,-24746,21459,-24763,21440,-24779,21421,-24796,21402,-24812,21383,-24828,21364,-24845,21345,-24861,21326,-24878,21307,-24894,21288,-24910,21268,-24927,21249,-24943,21230,-24959,21211,-24975,21192,-24992,21173,-25008,21154,-25024,21134,-25040,21115,-25057,21096,-25073,21077,-25089,21057,-25105,21038,-25121,21019,-25137,21000,-25153,20980,-25170,20961,-25186,20942,-25202,20922,-25218,20903,-25234,20884,-25250,20864,-25266,20845,-25282,20825,-25298,20806,-25314,20787,-25330,20767,-25346,20748,-25362,20728,-25377,20709,-25393,20689,-25409,20670,-25425,20650,-25441,20631,-25457,20611,-25473,20592,-25488,20572,-25504,20553,-25520,20533,-25536,20513,-25551,20494,-25567,20474,-25583,20455,-25599,20435,-25614,20415,-25630,20396,-25646,20376,-25661,20356,-25677,20337,-25692,20317,-25708,20297,-25724,20277,-25739,20258,-25755,20238,-25770,20218,-25786,20198,-25801,20179,-25817,20159,-25832,20139,-25848,20119,-25863,20099,-25879,20079,-25894,20060,-25909,20040,-25925,20020,-25940,20000,-25955,19980,-25971,19960,-25986,19940,-26001,19920,-26017,19900,-26032,19880,-26047,19860,-26062,19840,-26078,19820,-26093,19800,-26108,19780,-26123,19760,-26138,19740,-26154,19720,-26169,19700,-26184,19680,-26199,19660,-26214,19640,-26229,19620,-26244,19599,-26259,19579,-26274,19559,-26289,19539,-26304,19519,-26319,19499,-26334,19478,-26349,19458,-26364,19438,-26379,19418,-26394,19397,-26409,19377,-26424,19357,-26438,19337,-26453,19316,-26468,19296,-26483,19276,-26498,19255,-26513,19235,-26527,19215,-26542,19194,-26557,19174,-26571,19154,-26586,19133,-26601,19113,-26616,19092,-26630,19072,-26645,19051,-26659,19031,-26674,19011,-26689,18990,-26703,18970,-26718,18949,-26732,18929,-26747,18908,-26761,18888,-26776,18867,-26790,18846,-26805,18826,-26819,18805,-26834,18785,-26848,18764,-26862,18744,-26877,18723,-26891,18702,-26906,18682,-26920,18661,-26934,18640,-26949,18620,-26963,18599,-26977,18578,-26991,18558,-27006,18537,-27020,18516,-27034,18495,-27048,18475,-27062,18454,-27077,18433,-27091,18412,-27105,18392,-27119,18371,-27133,18350,-27147,18329,-27161,18308,-27175,18287,-27189,18267,-27203,18246,-27217,18225,-27231,18204,-27245,18183,-27259,18162,-27273,18141,-27287,18120,-27301,18099,-27315,18078,-27329,18057,-27343,18036,-27356,18015,-27370,17994,-27384,17973,-27398,17952,-27412,17931,-27425,17910,-27439,17889,-27453,17868,-27467,17847,-27480,17826,-27494,17805,-27508,17784,-27521,17763,-27535,17742,-27549,17720,-27562,17699,-27576,17678,-27589,17657,-27603,17636,-27616,17615,-27630,17593,-27643,17572,-27657,17551,-27670,17530,-27684,17509,-27697,17487,-27711,17466,-27724,17445,-27737,17423,-27751,17402,-27764,17381,-27778,17360,-27791,17338,-27804,17317,-27817,17296,-27831,17274,-27844,17253,-27857,17232,-27870,17210,-27884,17189,-27897,17167,-27910,17146,-27923,17124,-27936,17103,-27949,17082,-27963,17060,-27976,17039,-27989,17017,-28002,16996,-28015,16974,-28028,16953,-28041,16931,-28054,16910,-28067,16888,-28080,16867,-28093,16845,-28106,16824,-28119,16802,-28132,16780,-28144,16759,-28157,16737,-28170,16716,-28183,16694,-28196,16672,-28209,16651,-28221,16629,-28234,16607,-28247,16586,-28260,16564,-28272,16542,-28285,16521,-28298,16499,-28310,16477,-28323,16455,-28336,16434,-28348,16412,-28361,16390,-28373,16368,-28386,16347,-28398,16325,-28411,16303,-28424,16281,-28436,16260,-28448,16238,-28461,16216,-28473,16194,-28486,16172,-28498,16150,-28511,16128,-28523,16107,-28535,16085,-28548,16063,-28560,16041,-28572,16019,-28585,15997,-28597,15975,-28609,15953,-28621,15931,-28634,15909,-28646,15887,-28658,15865,-28670,15843,-28682,15821,-28695,15799,-28707,15777,-28719,15755,-28731,15733,-28743,15711,-28755,15689,-28767,15667,-28779,15645,-28791,15623,-28803,15601,-28815,15579,-28827,15556,-28839,15534,-28851,15512,-28863,15490,-28875,15468,-28887,15446,-28898,15424,-28910,15401,-28922,15379,-28934,15357,-28946,15335,-28957,15313,-28969,15290,-28981,15268,-28993,15246,-29004,15224,-29016,15201,-29028,15179,-29039,15157,-29051,15135,-29063,15112,-29074,15090,-29086,15068,-29097,15045,-29109,15023,-29120,15001,-29132,14978,-29143,14956,-29155,14934,-29166,14911,-29178,14889,-29189,14866,-29201,14844,-29212,14822,-29223,14799,-29235,14777,-29246,14754,-29257,14732,-29269,14709,-29280,14687,-29291,14665,-29303,14642,-29314,14620,-29325,14597,-29336,14575,-29347,14552,-29359,14530,-29370,14507,-29381,14484,-29392,14462,-29403,14439,-29414,14417,-29425,14394,-29436,14372,-29447,14349,-29458,14326,-29469,14304,-29480,14281,-29491,14259,-29502,14236,-29513,14213,-29524,14191,-29535,14168,-29546,14145,-29557,14123,-29568,14100,-29578,14077,-29589,14055,-29600,14032,-29611,14009,-29622,13986,-29632,13964,-29643,13941,-29654,13918,-29664,13895,-29675,13873,-29686,13850,-29696,13827,-29707,13804,-29718,13782,-29728,13759,-29739,13736,-29749,13713,-29760,13690,-29770,13667,-29781,13645,-29791,13622,-29802,13599,-29812,13576,-29823,13553,-29833,13530,-29843,13507,-29854,13485,-29864,13462,-29874,13439,-29885,13416,-29895,13393,-29905,13370,-29916,13347,-29926,13324,-29936,13301,-29946,13278,-29956,13255,-29967,13232,-29977,13209,-29987,13186,-29997,13163,-30007,13140,-30017,13117,-30027,13094,-30037,13071,-30047,13048,-30057,13025,-30067,13002,-30077,12979,-30087,12956,-30097,12933,-30107,12909,-30117,12886,-30127,12863,-30137,12840,-30147,12817,-30157,12794,-30166,12771,-30176,12748,-30186,12724,-30196,12701,-30206,12678,-30215,12655,-30225,12632,-30235,12609,-30244,12585,-30254,12562,-30264,12539,-30273,12516,-30283,12492,-30292,12469,-30302,12446,-30312,12423,-30321,12399,-30331,12376,-30340,12353,-30350,12330,-30359,12306,-30369,12283,-30378,12260,-30387,12236,-30397,12213,-30406,12190,-30416,12166,-30425,12143,-30434,12120,-30443,12096,-30453,12073,-30462,12050,-30471,12026,-30481,12003,-30490,11980,-30499,11956,-30508,11933,-30517,11909,-30526,11886,-30536,11862,-30545,11839,-30554,11816,-30563,11792,-30572,11769,-30581,11745,-30590,11722,-30599,11698,-30608,11675,-30617,11651,-30626,11628,-30635,11604,-30644,11581,-30653,11557,-30661,11534,-30670,11510,-30679,11487,-30688,11463,-30697,11440,-30706,11416,-30714,11393,-30723,11369,-30732,11345,-30740,11322,-30749,11298,-30758,11275,-30767,11251,-30775,11227,-30784,11204,-30792,11180,-30801,11157,-30810,11133,-30818,11109,-30827,11086,-30835,11062,-30844,11038,-30852,11015,-30861,10991,-30869,10967,-30877,10944,-30886,10920,-30894,10896,-30903,10873,-30911,10849,-30919,10825,-30928,10801,-30936,10778,-30944,10754,-30952,10730,-30961,10706,-30969,10683,-30977,10659,-30985,10635,-30993,10611,-31002,10588,-31010,10564,-31018,10540,-31026,10516,-31034,10492,-31042,10469,-31050,10445,-31058,10421,-31066,10397,-31074,10373,-31082,10349,-31090,10326,-31098,10302,-31106,10278,-31114,10254,-31122,10230,-31129,10206,-31137,10182,-31145,10159,-31153,10135,-31161,10111,-31168,10087,-31176,10063,-31184,10039,-31192,10015,-31199,9991,-31207,9967,-31215,9943,-31222,9919,-31230,9895,-31237,9871,-31245,9847,-31253,9823,-31260,9799,-31268,9775,-31275,9751,-31283,9727,-31290,9703,-31298,9679,-31305,9655,-31312,9631,-31320,9607,-31327,9583,-31335,9559,-31342,9535,-31349,9511,-31357,9487,-31364,9463,-31371,9439,-31378,9415,-31386,9391,-31393,9367,-31400,9343,-31407,9319,-31414,9295,-31421,9270,-31429,9246,-31436,9222,-31443,9198,-31450,9174,-31457,9150,-31464,9126,-31471,9102,-31478,9077,-31485,9053,-31492,9029,-31499,9005,-31506,8981,-31513,8957,-31519,8932,-31526,8908,-31533,8884,-31540,8860,-31547,8836,-31554,8812,-31560,8787,-31567,8763,-31574,8739,-31581,8715,-31587,8690,-31594,8666,-31601,8642,-31607,8618,-31614,8593,-31620,8569,-31627,8545,-31634,8521,-31640,8496,-31647,8472,-31653,8448,-31660,8424,-31666,8399,-31673,8375,-31679,8351,-31685,8326,-31692,8302,-31698,8278,-31705,8253,-31711,8229,-31717,8205,-31724,8180,-31730,8156,-31736,8132,-31742,8107,-31749,8083,-31755,8059,-31761,8034,-31767,8010,-31773,7986,-31779,7961,-31786,7937,-31792,7912,-31798,7888,-31804,7864,-31810,7839,-31816,7815,-31822,7790,-31828,7766,-31834,7742,-31840,7717,-31846,7693,-31852,7668,-31857,7644,-31863,7619,-31869,7595,-31875,7571,-31881,7546,-31887,7522,-31892,7497,-31898,7473,-31904,7448,-31910,7424,-31915,7399,-31921,7375,-31927,7350,-31932,7326,-31938,7301,-31944,7277,-31949,7252,-31955,7228,-31960,7203,-31966,7179,-31971,7154,-31977,7130,-31982,7105,-31988,7081,-31993,7056,-31999,7032,-32004,7007,-32009,6982,-32015,6958,-32020,6933,-32025,6909,-32031,6884,-32036,6860,-32041,6835,-32047,6811,-32052,6786,-32057,6761,-32062,6737,-32067,6712,-32073,6688,-32078,6663,-32083,6638,-32088,6614,-32093,6589,-32098,6564,-32103,6540,-32108,6515,-32113,6491,-32118,6466,-32123,6441,-32128,6417,-32133,6392,-32138,6367,-32143,6343,-32148,6318,-32153,6293,-32157,6269,-32162,6244,-32167,6219,-32172,6195,-32177,6170,-32181,6145,-32186,6121,-32191,6096,-32195,6071,-32200,6047,-32205,6022,-32209,5997,-32214,5972,-32219,5948,-32223,5923,-32228,5898,-32232,5874,-32237,5849,-32241,5824,-32246,5799,-32250,5775,-32255,5750,-32259,5725,-32263,5700,-32268,5676,-32272,5651,-32276,5626,-32281,5601,-32285,5577,-32289,5552,-32294,5527,-32298,5502,-32302,5478,-32306,5453,-32311,5428,-32315,5403,-32319,5378,-32323,5354,-32327,5329,-32331,5304,-32335,5279,-32339,5254,-32343,5230,-32347,5205,-32351,5180,-32355,5155,-32359,5130,-32363,5106,-32367,5081,-32371,5056,-32375,5031,-32379,5006,-32383,4981,-32387,4957,-32390,4932,-32394,4907,-32398,4882,-32402,4857,-32405,4832,-32409,4807,-32413,4783,-32417,4758,-32420,4733,-32424,4708,-32427,4683,-32431,4658,-32435,4633,-32438,4608,-32442,4584,-32445,4559,-32449,4534,-32452,4509,-32456,4484,-32459,4459,-32463,4434,-32466,4409,-32469,4384,-32473,4359,-32476,4335,-32479,4310,-32483,4285,-32486,4260,-32489,4235,-32493,4210,-32496,4185,-32499,4160,-32502,4135,-32505,4110,-32509,4085,-32512,4060,-32515,4035,-32518,4011,-32521,3986,-32524,3961,-32527,3936,-32530,3911,-32533,3886,-32536,3861,-32539,3836,-32542,3811,-32545,3786,-32548,3761,-32551,3736,-32554,3711,-32557,3686,-32559,3661,-32562,3636,-32565,3611,-32568,3586,-32571,3561,-32573,3536,-32576,3511,-32579,3486,-32581,3461,-32584,3436,-32587,3411,-32589,3386,-32592,3361,-32595,3336,-32597,3311,-32600,3286,-32602,3261,-32605,3236,-32607,3211,-32610,3186,-32612,3161,-32615,3136,-32617,3111,-32619,3086,-32622,3061,-32624,3036,-32626,3011,-32629,2986,-32631,2961,-32633,2936,-32636,2911,-32638,2886,-32640,2861,-32642,2836,-32645,2811,-32647,2786,-32649,2761,-32651,2736,-32653,2711,-32655,2686,-32657,2661,-32659,2636,-32661,2610,-32663,2585,-32665,2560,-32667,2535,-32669,2510,-32671,2485,-32673,2460,-32675,2435,-32677,2410,-32679,2385,-32681,2360,-32682,2335,-32684,2310,-32686,2285,-32688,2260,-32689,2235,-32691,2209,-32693,2184,-32695,2159,-32696,2134,-32698,2109,-32700,2084,-32701,2059,-32703,2034,-32704,2009,-32706,1984,-32707,1959,-32709,1934,-32710,1908,-32712,1883,-32713,1858,-32715,1833,-32716,1808,-32718,1783,-32719,1758,-32720,1733,-32722,1708,-32723,1683,-32724,1658,-32726,1632,-32727,1607,-32728,1582,-32729,1557,-32730,1532,-32732,1507,-32733,1482,-32734,1457,-32735,1432,-32736,1406,-32737,1381,-32738,1356,-32739,1331,-32740,1306,-32741,1281,-32742,1256,-32743,1231,-32744,1206,-32745,1180,-32746,1155,-32747,1130,-32748,1105,-32749,1080,-32750,1055,-32751,1030,-32751,1005,-32752,980,-32753,954,-32754,929,-32754,904,-32755,879,-32756,854,-32756,829,-32757,804,-32758,779,-32758,753,-32759,728,-32759,703,-32760,678,-32760,653,-32761,628,-32761,603,-32762,578,-32762,552,-32763,527,-32763,502,-32764,477,-32764,452,-32764,427,-32765,402,-32765,376,-32765,351,-32766,326,-32766,301,-32766,276,-32766,251,-32767,226,-32767,201,-32767,175,-32767,150,-32767,125,-32767,100,-32767,75,-32767,50,-32767,25,-32767,0,-32767,-26,-32767,-51,-32767,-76,-32767,-101,-32767,-126,-32767,-151,-32767,-176,-32767,-202,-32767,-227,-32767,-252,-32767,-277,-32766,-302,-32766,-327,-32766,-352,-32766,-377,-32765,-403,-32765,-428,-32765,-453,-32764,-478,-32764,-503,-32764,-528,-32763,-553,-32763,-579,-32762,-604,-32762,-629,-32761,-654,-32761,-679,-32760,-704,-32760,-729,-32759,-754,-32759,-780,-32758,-805,-32758,-830,-32757,-855,-32756,-880,-32756,-905,-32755,-930,-32754,-955,-32754,-981,-32753,-1006,-32752,-1031,-32751,-1056,-32751,-1081,-32750,-1106,-32749,-1131,-32748,-1156,-32747,-1181,-32746,-1207,-32745,-1232,-32744,-1257,-32743,-1282,-32742,-1307,-32741,-1332,-32740,-1357,-32739,-1382,-32738,-1407,-32737,-1433,-32736,-1458,-32735,-1483,-32734,-1508,-32733,-1533,-32732,-1558,-32730,-1583,-32729,-1608,-32728,-1633,-32727,-1659,-32726,-1684,-32724,-1709,-32723,-1734,-32722,-1759,-32720,-1784,-32719,-1809,-32718,-1834,-32716,-1859,-32715,-1884,-32713,-1909,-32712,-1935,-32710,-1960,-32709,-1985,-32707,-2010,-32706,-2035,-32704,-2060,-32703,-2085,-32701,-2110,-32700,-2135,-32698,-2160,-32696,-2185,-32695,-2210,-32693,-2236,-32691,-2261,-32689,-2286,-32688,-2311,-32686,-2336,-32684,-2361,-32682,-2386,-32681,-2411,-32679,-2436,-32677,-2461,-32675,-2486,-32673,-2511,-32671,-2536,-32669,-2561,-32667,-2586,-32665,-2611,-32663,-2637,-32661,-2662,-32659,-2687,-32657,-2712,-32655,-2737,-32653,-2762,-32651,-2787,-32649,-2812,-32647,-2837,-32645,-2862,-32642,-2887,-32640,-2912,-32638,-2937,-32636,-2962,-32633,-2987,-32631,-3012,-32629,-3037,-32626,-3062,-32624,-3087,-32622,-3112,-32619,-3137,-32617,-3162,-32615,-3187,-32612,-3212,-32610,-3237,-32607,-3262,-32605,-3287,-32602,-3312,-32600,-3337,-32597,-3362,-32595,-3387,-32592,-3412,-32589,-3437,-32587,-3462,-32584,-3487,-32581,-3512,-32579,-3537,-32576,-3562,-32573,-3587,-32571,-3612,-32568,-3637,-32565,-3662,-32562,-3687,-32559,-3712,-32557,-3737,-32554,-3762,-32551,-3787,-32548,-3812,-32545,-3837,-32542,-3862,-32539,-3887,-32536,-3912,-32533,-3937,-32530,-3962,-32527,-3987,-32524,-4012,-32521,-4036,-32518,-4061,-32515,-4086,-32512,-4111,-32509,-4136,-32505,-4161,-32502,-4186,-32499,-4211,-32496,-4236,-32493,-4261,-32489,-4286,-32486,-4311,-32483,-4336,-32479,-4360,-32476,-4385,-32473,-4410,-32469,-4435,-32466,-4460,-32463,-4485,-32459,-4510,-32456,-4535,-32452,-4560,-32449,-4585,-32445,-4609,-32442,-4634,-32438,-4659,-32435,-4684,-32431,-4709,-32427,-4734,-32424,-4759,-32420,-4784,-32417,-4808,-32413,-4833,-32409,-4858,-32405,-4883,-32402,-4908,-32398,-4933,-32394,-4958,-32390,-4982,-32387,-5007,-32383,-5032,-32379,-5057,-32375,-5082,-32371,-5107,-32367,-5131,-32363,-5156,-32359,-5181,-32355,-5206,-32351,-5231,-32347,-5255,-32343,-5280,-32339,-5305,-32335,-5330,-32331,-5355,-32327,-5379,-32323,-5404,-32319,-5429,-32315,-5454,-32311,-5479,-32306,-5503,-32302,-5528,-32298,-5553,-32294,-5578,-32289,-5602,-32285,-5627,-32281,-5652,-32276,-5677,-32272,-5701,-32268,-5726,-32263,-5751,-32259,-5776,-32255,-5800,-32250,-5825,-32246,-5850,-32241,-5875,-32237,-5899,-32232,-5924,-32228,-5949,-32223,-5973,-32219,-5998,-32214,-6023,-32209,-6048,-32205,-6072,-32200,-6097,-32195,-6122,-32191,-6146,-32186,-6171,-32181,-6196,-32177,-6220,-32172,-6245,-32167,-6270,-32162,-6294,-32157,-6319,-32153,-6344,-32148,-6368,-32143,-6393,-32138,-6418,-32133,-6442,-32128,-6467,-32123,-6492,-32118,-6516,-32113,-6541,-32108,-6565,-32103,-6590,-32098,-6615,-32093,-6639,-32088,-6664,-32083,-6689,-32078,-6713,-32073,-6738,-32067,-6762,-32062,-6787,-32057,-6812,-32052,-6836,-32047,-6861,-32041,-6885,-32036,-6910,-32031,-6934,-32025,-6959,-32020,-6983,-32015,-7008,-32009,-7033,-32004,-7057,-31999,-7082,-31993,-7106,-31988,-7131,-31982,-7155,-31977,-7180,-31971,-7204,-31966,-7229,-31960,-7253,-31955,-7278,-31949,-7302,-31944,-7327,-31938,-7351,-31932,-7376,-31927,-7400,-31921,-7425,-31915,-7449,-31910,-7474,-31904,-7498,-31898,-7523,-31892,-7547,-31887,-7572,-31881,-7596,-31875,-7620,-31869,-7645,-31863,-7669,-31857,-7694,-31852,-7718,-31846,-7743,-31840,-7767,-31834,-7791,-31828,-7816,-31822,-7840,-31816,-7865,-31810,-7889,-31804,-7913,-31798,-7938,-31792,-7962,-31786,-7987,-31779,-8011,-31773,-8035,-31767,-8060,-31761,-8084,-31755,-8108,-31749,-8133,-31742,-8157,-31736,-8181,-31730,-8206,-31724,-8230,-31717,-8254,-31711,-8279,-31705,-8303,-31698,-8327,-31692,-8352,-31685,-8376,-31679,-8400,-31673,-8425,-31666,-8449,-31660,-8473,-31653,-8497,-31647,-8522,-31640,-8546,-31634,-8570,-31627,-8594,-31620,-8619,-31614,-8643,-31607,-8667,-31601,-8691,-31594,-8716,-31587,-8740,-31581,-8764,-31574,-8788,-31567,-8813,-31560,-8837,-31554,-8861,-31547,-8885,-31540,-8909,-31533,-8933,-31526,-8958,-31519,-8982,-31513,-9006,-31506,-9030,-31499,-9054,-31492,-9078,-31485,-9103,-31478,-9127,-31471,-9151,-31464,-9175,-31457,-9199,-31450,-9223,-31443,-9247,-31436,-9271,-31429,-9296,-31421,-9320,-31414,-9344,-31407,-9368,-31400,-9392,-31393,-9416,-31386,-9440,-31378,-9464,-31371,-9488,-31364,-9512,-31357,-9536,-31349,-9560,-31342,-9584,-31335,-9608,-31327,-9632,-31320,-9656,-31312,-9680,-31305,-9704,-31298,-9728,-31290,-9752,-31283,-9776,-31275,-9800,-31268,-9824,-31260,-9848,-31253,-9872,-31245,-9896,-31237,-9920,-31230,-9944,-31222,-9968,-31215,-9992,-31207,-10016,-31199,-10040,-31192,-10064,-31184,-10088,-31176,-10112,-31168,-10136,-31161,-10160,-31153,-10183,-31145,-10207,-31137,-10231,-31129,-10255,-31122,-10279,-31114,-10303,-31106,-10327,-31098,-10350,-31090,-10374,-31082,-10398,-31074,-10422,-31066,-10446,-31058,-10470,-31050,-10493,-31042,-10517,-31034,-10541,-31026,-10565,-31018,-10589,-31010,-10612,-31002,-10636,-30993,-10660,-30985,-10684,-30977,-10707,-30969,-10731,-30961,-10755,-30952,-10779,-30944,-10802,-30936,-10826,-30928,-10850,-30919,-10874,-30911,-10897,-30903,-10921,-30894,-10945,-30886,-10968,-30877,-10992,-30869,-11016,-30861,-11039,-30852,-11063,-30844,-11087,-30835,-11110,-30827,-11134,-30818,-11158,-30810,-11181,-30801,-11205,-30792,-11228,-30784,-11252,-30775,-11276,-30767,-11299,-30758,-11323,-30749,-11346,-30740,-11370,-30732,-11394,-30723,-11417,-30714,-11441,-30706,-11464,-30697,-11488,-30688,-11511,-30679,-11535,-30670,-11558,-30661,-11582,-30653,-11605,-30644,-11629,-30635,-11652,-30626,-11676,-30617,-11699,-30608,-11723,-30599,-11746,-30590,-11770,-30581,-11793,-30572,-11817,-30563,-11840,-30554,-11863,-30545,-11887,-30536,-11910,-30526,-11934,-30517,-11957,-30508,-11981,-30499,-12004,-30490,-12027,-30481,-12051,-30471,-12074,-30462,-12097,-30453,-12121,-30443,-12144,-30434,-12167,-30425,-12191,-30416,-12214,-30406,-12237,-30397,-12261,-30387,-12284,-30378,-12307,-30369,-12331,-30359,-12354,-30350,-12377,-30340,-12400,-30331,-12424,-30321,-12447,-30312,-12470,-30302,-12493,-30292,-12517,-30283,-12540,-30273,-12563,-30264,-12586,-30254,-12610,-30244,-12633,-30235,-12656,-30225,-12679,-30215,-12702,-30206,-12725,-30196,-12749,-30186,-12772,-30176,-12795,-30166,-12818,-30157,-12841,-30147,-12864,-30137,-12887,-30127,-12910,-30117,-12934,-30107,-12957,-30097,-12980,-30087,-13003,-30077,-13026,-30067,-13049,-30057,-13072,-30047,-13095,-30037,-13118,-30027,-13141,-30017,-13164,-30007,-13187,-29997,-13210,-29987,-13233,-29977,-13256,-29967,-13279,-29956,-13302,-29946,-13325,-29936,-13348,-29926,-13371,-29916,-13394,-29905,-13417,-29895,-13440,-29885,-13463,-29874,-13486,-29864,-13508,-29854,-13531,-29843,-13554,-29833,-13577,-29823,-13600,-29812,-13623,-29802,-13646,-29791,-13668,-29781,-13691,-29770,-13714,-29760,-13737,-29749,-13760,-29739,-13783,-29728,-13805,-29718,-13828,-29707,-13851,-29696,-13874,-29686,-13896,-29675,-13919,-29664,-13942,-29654,-13965,-29643,-13987,-29632,-14010,-29622,-14033,-29611,-14056,-29600,-14078,-29589,-14101,-29578,-14124,-29568,-14146,-29557,-14169,-29546,-14192,-29535,-14214,-29524,-14237,-29513,-14260,-29502,-14282,-29491,-14305,-29480,-14327,-29469,-14350,-29458,-14373,-29447,-14395,-29436,-14418,-29425,-14440,-29414,-14463,-29403,-14485,-29392,-14508,-29381,-14531,-29370,-14553,-29359,-14576,-29347,-14598,-29336,-14621,-29325,-14643,-29314,-14666,-29303,-14688,-29291,-14710,-29280,-14733,-29269,-14755,-29257,-14778,-29246,-14800,-29235,-14823,-29223,-14845,-29212,-14867,-29201,-14890,-29189,-14912,-29178,-14935,-29166,-14957,-29155,-14979,-29143,-15002,-29132,-15024,-29120,-15046,-29109,-15069,-29097,-15091,-29086,-15113,-29074,-15136,-29063,-15158,-29051,-15180,-29039,-15202,-29028,-15225,-29016,-15247,-29004,-15269,-28993,-15291,-28981,-15314,-28969,-15336,-28957,-15358,-28946,-15380,-28934,-15402,-28922,-15425,-28910,-15447,-28898,-15469,-28887,-15491,-28875,-15513,-28863,-15535,-28851,-15557,-28839,-15580,-28827,-15602,-28815,-15624,-28803,-15646,-28791,-15668,-28779,-15690,-28767,-15712,-28755,-15734,-28743,-15756,-28731,-15778,-28719,-15800,-28707,-15822,-28695,-15844,-28682,-15866,-28670,-15888,-28658,-15910,-28646,-15932,-28634,-15954,-28621,-15976,-28609,-15998,-28597,-16020,-28585,-16042,-28572,-16064,-28560,-16086,-28548,-16108,-28535,-16129,-28523,-16151,-28511,-16173,-28498,-16195,-28486,-16217,-28473,-16239,-28461,-16261,-28448,-16282,-28436,-16304,-28424,-16326,-28411,-16348,-28398,-16369,-28386,-16391,-28373,-16413,-28361,-16435,-28348,-16456,-28336,-16478,-28323,-16500,-28310,-16522,-28298,-16543,-28285,-16565,-28272,-16587,-28260,-16608,-28247,-16630,-28234,-16652,-28221,-16673,-28209,-16695,-28196,-16717,-28183,-16738,-28170,-16760,-28157,-16781,-28144,-16803,-28132,-16825,-28119,-16846,-28106,-16868,-28093,-16889,-28080,-16911,-28067,-16932,-28054,-16954,-28041,-16975,-28028,-16997,-28015,-17018,-28002,-17040,-27989,-17061,-27976,-17083,-27963,-17104,-27949,-17125,-27936,-17147,-27923,-17168,-27910,-17190,-27897,-17211,-27884,-17233,-27870,-17254,-27857,-17275,-27844,-17297,-27831,-17318,-27817,-17339,-27804,-17361,-27791,-17382,-27778,-17403,-27764,-17424,-27751,-17446,-27737,-17467,-27724,-17488,-27711,-17510,-27697,-17531,-27684,-17552,-27670,-17573,-27657,-17594,-27643,-17616,-27630,-17637,-27616,-17658,-27603,-17679,-27589,-17700,-27576,-17721,-27562,-17743,-27549,-17764,-27535,-17785,-27521,-17806,-27508,-17827,-27494,-17848,-27480,-17869,-27467,-17890,-27453,-17911,-27439,-17932,-27425,-17953,-27412,-17974,-27398,-17995,-27384,-18016,-27370,-18037,-27356,-18058,-27343,-18079,-27329,-18100,-27315,-18121,-27301,-18142,-27287,-18163,-27273,-18184,-27259,-18205,-27245,-18226,-27231,-18247,-27217,-18268,-27203,-18288,-27189,-18309,-27175,-18330,-27161,-18351,-27147,-18372,-27133,-18393,-27119,-18413,-27105,-18434,-27091,-18455,-27077,-18476,-27062,-18496,-27048,-18517,-27034,-18538,-27020,-18559,-27006,-18579,-26991,-18600,-26977,-18621,-26963,-18641,-26949,-18662,-26934,-18683,-26920,-18703,-26906,-18724,-26891,-18745,-26877,-18765,-26862,-18786,-26848,-18806,-26834,-18827,-26819,-18847,-26805,-18868,-26790,-18889,-26776,-18909,-26761,-18930,-26747,-18950,-26732,-18971,-26718,-18991,-26703,-19012,-26689,-19032,-26674,-19052,-26659,-19073,-26645,-19093,-26630,-19114,-26616,-19134,-26601,-19155,-26586,-19175,-26571,-19195,-26557,-19216,-26542,-19236,-26527,-19256,-26513,-19277,-26498,-19297,-26483,-19317,-26468,-19338,-26453,-19358,-26438,-19378,-26424,-19398,-26409,-19419,-26394,-19439,-26379,-19459,-26364,-19479,-26349,-19500,-26334,-19520,-26319,-19540,-26304,-19560,-26289,-19580,-26274,-19600,-26259,-19621,-26244,-19641,-26229,-19661,-26214,-19681,-26199,-19701,-26184,-19721,-26169,-19741,-26154,-19761,-26138,-19781,-26123,-19801,-26108,-19821,-26093,-19841,-26078,-19861,-26062,-19881,-26047,-19901,-26032,-19921,-26017,-19941,-26001,-19961,-25986,-19981,-25971,-20001,-25955,-20021,-25940,-20041,-25925,-20061,-25909,-20080,-25894,-20100,-25879,-20120,-25863,-20140,-25848,-20160,-25832,-20180,-25817,-20199,-25801,-20219,-25786,-20239,-25770,-20259,-25755,-20278,-25739,-20298,-25724,-20318,-25708,-20338,-25692,-20357,-25677,-20377,-25661,-20397,-25646,-20416,-25630,-20436,-25614,-20456,-25599,-20475,-25583,-20495,-25567,-20514,-25551,-20534,-25536,-20554,-25520,-20573,-25504,-20593,-25488,-20612,-25473,-20632,-25457,-20651,-25441,-20671,-25425,-20690,-25409,-20710,-25393,-20729,-25377,-20749,-25362,-20768,-25346,-20788,-25330,-20807,-25314,-20826,-25298,-20846,-25282,-20865,-25266,-20885,-25250,-20904,-25234,-20923,-25218,-20943,-25202,-20962,-25186,-20981,-25170,-21001,-25153,-21020,-25137,-21039,-25121,-21058,-25105,-21078,-25089,-21097,-25073,-21116,-25057,-21135,-25040,-21155,-25024,-21174,-25008,-21193,-24992,-21212,-24975,-21231,-24959,-21250,-24943,-21269,-24927,-21289,-24910,-21308,-24894,-21327,-24878,-21346,-24861,-21365,-24845,-21384,-24828,-21403,-24812,-21422,-24796,-21441,-24779,-21460,-24763,-21479,-24746,-21498,-24730,-21517,-24713,-21536,-24697,-21555,-24680,-21574,-24664,-21593,-24647,-21612,-24631,-21630,-24614,-21649,-24597,-21668,-24581,-21687,-24564,-21706,-24547,-21725,-24531,-21744,-24514,-21762,-24497,-21781,-24481,-21800,-24464,-21819,-24447,-21837,-24431,-21856,-24414,-21875,-24397,-21894,-24380,-21912,-24363,-21931,-24347,-21950,-24330,-21968,-24313,-21987,-24296,-22005,-24279,-22024,-24262,-22043,-24245,-22061,-24229,-22080,-24212,-22098,-24195,-22117,-24178,-22136,-24161,-22154,-24144,-22173,-24127,-22191,-24110,-22210,-24093,-22228,-24076,-22246,-24059,-22265,-24042,-22283,-24024,-22302,-24007,-22320,-23990,-22339,-23973,-22357,-23956,-22375,-23939,-22394,-23922,-22412,-23904,-22430,-23887,-22449,-23870,-22467,-23853,-22485,-23836,-22504,-23818,-22522,-23801,-22540,-23784,-22558,-23767,-22576,-23749,-22595,-23732,-22613,-23715,-22631,-23697,-22649,-23680,-22667,-23662,-22686,-23645,-22704,-23628,-22722,-23610,-22740,-23593,-22758,-23575,-22776,-23558,-22794,-23540,-22812,-23523,-22830,-23505,-22848,-23488,-22866,-23470,-22884,-23453,-22902,-23435,-22920,-23418,-22938,-23400,-22956,-23383,-22974,-23365,-22992,-23347,-23010,-23330,-23028,-23312,-23046,-23294,-23063,-23277,-23081,-23259,-23099,-23241,-23117,-23224,-23135,-23206,-23152,-23188,-23170,-23170,-23188,-23152,-23206,-23135,-23224,-23117,-23241,-23099,-23259,-23081,-23277,-23063,-23294,-23046,-23312,-23028,-23330,-23010,-23347,-22992,-23365,-22974,-23383,-22956,-23400,-22938,-23418,-22920,-23435,-22902,-23453,-22884,-23470,-22866,-23488,-22848,-23505,-22830,-23523,-22812,-23540,-22794,-23558,-22776,-23575,-22758,-23593,-22740,-23610,-22722,-23628,-22704,-23645,-22686,-23662,-22667,-23680,-22649,-23697,-22631,-23715,-22613,-23732,-22595,-23749,-22576,-23767,-22558,-23784,-22540,-23801,-22522,-23818,-22504,-23836,-22485,-23853,-22467,-23870,-22449,-23887,-22430,-23904,-22412,-23922,-22394,-23939,-22375,-23956,-22357,-23973,-22339,-23990,-22320,-24007,-22302,-24024,-22283,-24042,-22265,-24059,-22246,-24076,-22228,-24093,-22210,-24110,-22191,-24127,-22173,-24144,-22154,-24161,-22136,-24178,-22117,-24195,-22098,-24212,-22080,-24229,-22061,-24245,-22043,-24262,-22024,-24279,-22005,-24296,-21987,-24313,-21968,-24330,-21950,-24347,-21931,-24363,-21912,-24380,-21894,-24397,-21875,-24414,-21856,-24431,-21837,-24447,-21819,-24464,-21800,-24481,-21781,-24497,-21762,-24514,-21744,-24531,-21725,-24547,-21706,-24564,-21687,-24581,-21668,-24597,-21649,-24614,-21630,-24631,-21612,-24647,-21593,-24664,-21574,-24680,-21555,-24697,-21536,-24713,-21517,-24730,-21498,-24746,-21479,-24763,-21460,-24779,-21441,-24796,-21422,-24812,-21403,-24828,-21384,-24845,-21365,-24861,-21346,-24878,-21327,-24894,-21308,-24910,-21289,-24927,-21269,-24943,-21250,-24959,-21231,-24975,-21212,-24992,-21193,-25008,-21174,-25024,-21155,-25040,-21135,-25057,-21116,-25073,-21097,-25089,-21078,-25105,-21058,-25121,-21039,-25137,-21020,-25153,-21001,-25170,-20981,-25186,-20962,-25202,-20943,-25218,-20923,-25234,-20904,-25250,-20885,-25266,-20865,-25282,-20846,-25298,-20826,-25314,-20807,-25330,-20788,-25346,-20768,-25362,-20749,-25377,-20729,-25393,-20710,-25409,-20690,-25425,-20671,-25441,-20651,-25457,-20632,-25473,-20612,-25488,-20593,-25504,-20573,-25520,-20554,-25536,-20534,-25551,-20514,-25567,-20495,-25583,-20475,-25599,-20456,-25614,-20436,-25630,-20416,-25646,-20397,-25661,-20377,-25677,-20357,-25692,-20338,-25708,-20318,-25724,-20298,-25739,-20278,-25755,-20259,-25770,-20239,-25786,-20219,-25801,-20199,-25817,-20180,-25832,-20160,-25848,-20140,-25863,-20120,-25879,-20100,-25894,-20080,-25909,-20061,-25925,-20041,-25940,-20021,-25955,-20001,-25971,-19981,-25986,-19961,-26001,-19941,-26017,-19921,-26032,-19901,-26047,-19881,-26062,-19861,-26078,-19841,-26093,-19821,-26108,-19801,-26123,-19781,-26138,-19761,-26154,-19741,-26169,-19721,-26184,-19701,-26199,-19681,-26214,-19661,-26229,-19641,-26244,-19621,-26259,-19600,-26274,-19580,-26289,-19560,-26304,-19540,-26319,-19520,-26334,-19500,-26349,-19479,-26364,-19459,-26379,-19439,-26394,-19419,-26409,-19398,-26424,-19378,-26438,-19358,-26453,-19338,-26468,-19317,-26483,-19297,-26498,-19277,-26513,-19256,-26527,-19236,-26542,-19216,-26557,-19195,-26571,-19175,-26586,-19155,-26601,-19134,-26616,-19114,-26630,-19093,-26645,-19073,-26659,-19052,-26674,-19032,-26689,-19012,-26703,-18991,-26718,-18971,-26732,-18950,-26747,-18930,-26761,-18909,-26776,-18889,-26790,-18868,-26805,-18847,-26819,-18827,-26834,-18806,-26848,-18786,-26862,-18765,-26877,-18745,-26891,-18724,-26906,-18703,-26920,-18683,-26934,-18662,-26949,-18641,-26963,-18621,-26977,-18600,-26991,-18579,-27006,-18559,-27020,-18538,-27034,-18517,-27048,-18496,-27062,-18476,-27077,-18455,-27091,-18434,-27105,-18413,-27119,-18393,-27133,-18372,-27147,-18351,-27161,-18330,-27175,-18309,-27189,-18288,-27203,-18268,-27217,-18247,-27231,-18226,-27245,-18205,-27259,-18184,-27273,-18163,-27287,-18142,-27301,-18121,-27315,-18100,-27329,-18079,-27343,-18058,-27356,-18037,-27370,-18016,-27384,-17995,-27398,-17974,-27412,-17953,-27425,-17932,-27439,-17911,-27453,-17890,-27467,-17869,-27480,-17848,-27494,-17827,-27508,-17806,-27521,-17785,-27535,-17764,-27549,-17743,-27562,-17721,-27576,-17700,-27589,-17679,-27603,-17658,-27616,-17637,-27630,-17616,-27643,-17594,-27657,-17573,-27670,-17552,-27684,-17531,-27697,-17510,-27711,-17488,-27724,-17467,-27737,-17446,-27751,-17424,-27764,-17403,-27778,-17382,-27791,-17361,-27804,-17339,-27817,-17318,-27831,-17297,-27844,-17275,-27857,-17254,-27870,-17233,-27884,-17211,-27897,-17190,-27910,-17168,-27923,-17147,-27936,-17125,-27949,-17104,-27963,-17083,-27976,-17061,-27989,-17040,-28002,-17018,-28015,-16997,-28028,-16975,-28041,-16954,-28054,-16932,-28067,-16911,-28080,-16889,-28093,-16868,-28106,-16846,-28119,-16825,-28132,-16803,-28144,-16781,-28157,-16760,-28170,-16738,-28183,-16717,-28196,-16695,-28209,-16673,-28221,-16652,-28234,-16630,-28247,-16608,-28260,-16587,-28272,-16565,-28285,-16543,-28298,-16522,-28310,-16500,-28323,-16478,-28336,-16456,-28348,-16435,-28361,-16413,-28373,-16391,-28386,-16369,-28398,-16348,-28411,-16326,-28424,-16304,-28436,-16282,-28448,-16261,-28461,-16239,-28473,-16217,-28486,-16195,-28498,-16173,-28511,-16151,-28523,-16129,-28535,-16108,-28548,-16086,-28560,-16064,-28572,-16042,-28585,-16020,-28597,-15998,-28609,-15976,-28621,-15954,-28634,-15932,-28646,-15910,-28658,-15888,-28670,-15866,-28682,-15844,-28695,-15822,-28707,-15800,-28719,-15778,-28731,-15756,-28743,-15734,-28755,-15712,-28767,-15690,-28779,-15668,-28791,-15646,-28803,-15624,-28815,-15602,-28827,-15580,-28839,-15557,-28851,-15535,-28863,-15513,-28875,-15491,-28887,-15469,-28898,-15447,-28910,-15425,-28922,-15402,-28934,-15380,-28946,-15358,-28957,-15336,-28969,-15314,-28981,-15291,-28993,-15269,-29004,-15247,-29016,-15225,-29028,-15202,-29039,-15180,-29051,-15158,-29063,-15136,-29074,-15113,-29086,-15091,-29097,-15069,-29109,-15046,-29120,-15024,-29132,-15002,-29143,-14979,-29155,-14957,-29166,-14935,-29178,-14912,-29189,-14890,-29201,-14867,-29212,-14845,-29223,-14823,-29235,-14800,-29246,-14778,-29257,-14755,-29269,-14733,-29280,-14710,-29291,-14688,-29303,-14666,-29314,-14643,-29325,-14621,-29336,-14598,-29347,-14576,-29359,-14553,-29370,-14531,-29381,-14508,-29392,-14485,-29403,-14463,-29414,-14440,-29425,-14418,-29436,-14395,-29447,-14373,-29458,-14350,-29469,-14327,-29480,-14305,-29491,-14282,-29502,-14260,-29513,-14237,-29524,-14214,-29535,-14192,-29546,-14169,-29557,-14146,-29568,-14124,-29578,-14101,-29589,-14078,-29600,-14056,-29611,-14033,-29622,-14010,-29632,-13987,-29643,-13965,-29654,-13942,-29664,-13919,-29675,-13896,-29686,-13874,-29696,-13851,-29707,-13828,-29718,-13805,-29728,-13783,-29739,-13760,-29749,-13737,-29760,-13714,-29770,-13691,-29781,-13668,-29791,-13646,-29802,-13623,-29812,-13600,-29823,-13577,-29833,-13554,-29843,-13531,-29854,-13508,-29864,-13486,-29874,-13463,-29885,-13440,-29895,-13417,-29905,-13394,-29916,-13371,-29926,-13348,-29936,-13325,-29946,-13302,-29956,-13279,-29967,-13256,-29977,-13233,-29987,-13210,-29997,-13187,-30007,-13164,-30017,-13141,-30027,-13118,-30037,-13095,-30047,-13072,-30057,-13049,-30067,-13026,-30077,-13003,-30087,-12980,-30097,-12957,-30107,-12934,-30117,-12910,-30127,-12887,-30137,-12864,-30147,-12841,-30157,-12818,-30166,-12795,-30176,-12772,-30186,-12749,-30196,-12725,-30206,-12702,-30215,-12679,-30225,-12656,-30235,-12633,-30244,-12610,-30254,-12586,-30264,-12563,-30273,-12540,-30283,-12517,-30292,-12493,-30302,-12470,-30312,-12447,-30321,-12424,-30331,-12400,-30340,-12377,-30350,-12354,-30359,-12331,-30369,-12307,-30378,-12284,-30387,-12261,-30397,-12237,-30406,-12214,-30416,-12191,-30425,-12167,-30434,-12144,-30443,-12121,-30453,-12097,-30462,-12074,-30471,-12051,-30481,-12027,-30490,-12004,-30499,-11981,-30508,-11957,-30517,-11934,-30526,-11910,-30536,-11887,-30545,-11863,-30554,-11840,-30563,-11817,-30572,-11793,-30581,-11770,-30590,-11746,-30599,-11723,-30608,-11699,-30617,-11676,-30626,-11652,-30635,-11629,-30644,-11605,-30653,-11582,-30661,-11558,-30670,-11535,-30679,-11511,-30688,-11488,-30697,-11464,-30706,-11441,-30714,-11417,-30723,-11394,-30732,-11370,-30740,-11346,-30749,-11323,-30758,-11299,-30767,-11276,-30775,-11252,-30784,-11228,-30792,-11205,-30801,-11181,-30810,-11158,-30818,-11134,-30827,-11110,-30835,-11087,-30844,-11063,-30852,-11039,-30861,-11016,-30869,-10992,-30877,-10968,-30886,-10945,-30894,-10921,-30903,-10897,-30911,-10874,-30919,-10850,-30928,-10826,-30936,-10802,-30944,-10779,-30952,-10755,-30961,-10731,-30969,-10707,-30977,-10684,-30985,-10660,-30993,-10636,-31002,-10612,-31010,-10589,-31018,-10565,-31026,-10541,-31034,-10517,-31042,-10493,-31050,-10470,-31058,-10446,-31066,-10422,-31074,-10398,-31082,-10374,-31090,-10350,-31098,-10327,-31106,-10303,-31114,-10279,-31122,-10255,-31129,-10231,-31137,-10207,-31145,-10183,-31153,-10160,-31161,-10136,-31168,-10112,-31176,-10088,-31184,-10064,-31192,-10040,-31199,-10016,-31207,-9992,-31215,-9968,-31222,-9944,-31230,-9920,-31237,-9896,-31245,-9872,-31253,-9848,-31260,-9824,-31268,-9800,-31275,-9776,-31283,-9752,-31290,-9728,-31298,-9704,-31305,-9680,-31312,-9656,-31320,-9632,-31327,-9608,-31335,-9584,-31342,-9560,-31349,-9536,-31357,-9512,-31364,-9488,-31371,-9464,-31378,-9440,-31386,-9416,-31393,-9392,-31400,-9368,-31407,-9344,-31414,-9320,-31421,-9296,-31429,-9271,-31436,-9247,-31443,-9223,-31450,-9199,-31457,-9175,-31464,-9151,-31471,-9127,-31478,-9103,-31485,-9078,-31492,-9054,-31499,-9030,-31506,-9006,-31513,-8982,-31519,-8958,-31526,-8933,-31533,-8909,-31540,-8885,-31547,-8861,-31554,-8837,-31560,-8813,-31567,-8788,-31574,-8764,-31581,-8740,-31587,-8716,-31594,-8691,-31601,-8667,-31607,-8643,-31614,-8619,-31620,-8594,-31627,-8570,-31634,-8546,-31640,-8522,-31647,-8497,-31653,-8473,-31660,-8449,-31666,-8425,-31673,-8400,-31679,-8376,-31685,-8352,-31692,-8327,-31698,-8303,-31705,-8279,-31711,-8254,-31717,-8230,-31724,-8206,-31730,-8181,-31736,-8157,-31742,-8133,-31749,-8108,-31755,-8084,-31761,-8060,-31767,-8035,-31773,-8011,-31779,-7987,-31786,-7962,-31792,-7938,-31798,-7913,-31804,-7889,-31810,-7865,-31816,-7840,-31822,-7816,-31828,-7791,-31834,-7767,-31840,-7743,-31846,-7718,-31852,-7694,-31857,-7669,-31863,-7645,-31869,-7620,-31875,-7596,-31881,-7572,-31887,-7547,-31892,-7523,-31898,-7498,-31904,-7474,-31910,-7449,-31915,-7425,-31921,-7400,-31927,-7376,-31932,-7351,-31938,-7327,-31944,-7302,-31949,-7278,-31955,-7253,-31960,-7229,-31966,-7204,-31971,-7180,-31977,-7155,-31982,-7131,-31988,-7106,-31993,-7082,-31999,-7057,-32004,-7033,-32009,-7008,-32015,-6983,-32020,-6959,-32025,-6934,-32031,-6910,-32036,-6885,-32041,-6861,-32047,-6836,-32052,-6812,-32057,-6787,-32062,-6762,-32067,-6738,-32073,-6713,-32078,-6689,-32083,-6664,-32088,-6639,-32093,-6615,-32098,-6590,-32103,-6565,-32108,-6541,-32113,-6516,-32118,-6492,-32123,-6467,-32128,-6442,-32133,-6418,-32138,-6393,-32143,-6368,-32148,-6344,-32153,-6319,-32157,-6294,-32162,-6270,-32167,-6245,-32172,-6220,-32177,-6196,-32181,-6171,-32186,-6146,-32191,-6122,-32195,-6097,-32200,-6072,-32205,-6048,-32209,-6023,-32214,-5998,-32219,-5973,-32223,-5949,-32228,-5924,-32232,-5899,-32237,-5875,-32241,-5850,-32246,-5825,-32250,-5800,-32255,-5776,-32259,-5751,-32263,-5726,-32268,-5701,-32272,-5677,-32276,-5652,-32281,-5627,-32285,-5602,-32289,-5578,-32294,-5553,-32298,-5528,-32302,-5503,-32306,-5479,-32311,-5454,-32315,-5429,-32319,-5404,-32323,-5379,-32327,-5355,-32331,-5330,-32335,-5305,-32339,-5280,-32343,-5255,-32347,-5231,-32351,-5206,-32355,-5181,-32359,-5156,-32363,-5131,-32367,-5107,-32371,-5082,-32375,-5057,-32379,-5032,-32383,-5007,-32387,-4982,-32390,-4958,-32394,-4933,-32398,-4908,-32402,-4883,-32405,-4858,-32409,-4833,-32413,-4808,-32417,-4784,-32420,-4759,-32424,-4734,-32427,-4709,-32431,-4684,-32435,-4659,-32438,-4634,-32442,-4609,-32445,-4585,-32449,-4560,-32452,-4535,-32456,-4510,-32459,-4485,-32463,-4460,-32466,-4435,-32469,-4410,-32473,-4385,-32476,-4360,-32479,-4336,-32483,-4311,-32486,-4286,-32489,-4261,-32493,-4236,-32496,-4211,-32499,-4186,-32502,-4161,-32505,-4136,-32509,-4111,-32512,-4086,-32515,-4061,-32518,-4036,-32521,-4012,-32524,-3987,-32527,-3962,-32530,-3937,-32533,-3912,-32536,-3887,-32539,-3862,-32542,-3837,-32545,-3812,-32548,-3787,-32551,-3762,-32554,-3737,-32557,-3712,-32559,-3687,-32562,-3662,-32565,-3637,-32568,-3612,-32571,-3587,-32573,-3562,-32576,-3537,-32579,-3512,-32581,-3487,-32584,-3462,-32587,-3437,-32589,-3412,-32592,-3387,-32595,-3362,-32597,-3337,-32600,-3312,-32602,-3287,-32605,-3262,-32607,-3237,-32610,-3212,-32612,-3187,-32615,-3162,-32617,-3137,-32619,-3112,-32622,-3087,-32624,-3062,-32626,-3037,-32629,-3012,-32631,-2987,-32633,-2962,-32636,-2937,-32638,-2912,-32640,-2887,-32642,-2862,-32645,-2837,-32647,-2812,-32649,-2787,-32651,-2762,-32653,-2737,-32655,-2712,-32657,-2687,-32659,-2662,-32661,-2637,-32663,-2611,-32665,-2586,-32667,-2561,-32669,-2536,-32671,-2511,-32673,-2486,-32675,-2461,-32677,-2436,-32679,-2411,-32681,-2386,-32682,-2361,-32684,-2336,-32686,-2311,-32688,-2286,-32689,-2261,-32691,-2236,-32693,-2210,-32695,-2185,-32696,-2160,-32698,-2135,-32700,-2110,-32701,-2085,-32703,-2060,-32704,-2035,-32706,-2010,-32707,-1985,-32709,-1960,-32710,-1935,-32712,-1909,-32713,-1884,-32715,-1859,-32716,-1834,-32718,-1809,-32719,-1784,-32720,-1759,-32722,-1734,-32723,-1709,-32724,-1684,-32726,-1659,-32727,-1633,-32728,-1608,-32729,-1583,-32730,-1558,-32732,-1533,-32733,-1508,-32734,-1483,-32735,-1458,-32736,-1433,-32737,-1407,-32738,-1382,-32739,-1357,-32740,-1332,-32741,-1307,-32742,-1282,-32743,-1257,-32744,-1232,-32745,-1207,-32746,-1181,-32747,-1156,-32748,-1131,-32749,-1106,-32750,-1081,-32751,-1056,-32751,-1031,-32752,-1006,-32753,-981,-32754,-955,-32754,-930,-32755,-905,-32756,-880,-32756,-855,-32757,-830,-32758,-805,-32758,-780,-32759,-754,-32759,-729,-32760,-704,-32760,-679,-32761,-654,-32761,-629,-32762,-604,-32762,-579,-32763,-553,-32763,-528,-32764,-503,-32764,-478,-32764,-453,-32765,-428,-32765,-403,-32765,-377,-32766,-352,-32766,-327,-32766,-302,-32766,-277,-32767,-252,-32767,-227,-32767,-202,-32767,-176,-32767,-151,-32767,-126,-32767,-101,-32767,-76,-32767,-51,-32767,-26}; +#ifdef __AVX2__ +void dft4096_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[512],ytmp[512],*tw4096_256p=(simd256_q15_t *)tw4096,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i,j; + + for (i=0,j=0; i<512; i+=4,j++) { + transpose16_ooff_simd256(x256+i,xtmp+j,128); + } + + + dft1024_simd256((int16_t*)(xtmp),(int16_t*)(ytmp),1); + dft1024_simd256((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1); + dft1024_simd256((int16_t*)(xtmp+256),(int16_t*)(ytmp+256),1); + dft1024_simd256((int16_t*)(xtmp+384),(int16_t*)(ytmp+384),1); + + for (i=0; i<128; i++) { + bfly4_256(ytmpp,ytmpp+128,ytmpp+256,ytmpp+384, + y256p,y256p+128,y256p+256,y256p+384, + tw4096_256p,tw4096_256p+128,tw4096_256p+256); + tw4096_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0; i<32; i++) { + y256[0] = shiftright_int16_simd256(y256[0],1); + y256[1] = shiftright_int16_simd256(y256[1],1); + y256[2] = shiftright_int16_simd256(y256[2],1); + y256[3] = shiftright_int16_simd256(y256[3],1); + y256[4] = shiftright_int16_simd256(y256[4],1); + y256[5] = shiftright_int16_simd256(y256[5],1); + y256[6] = shiftright_int16_simd256(y256[6],1); + y256[7] = shiftright_int16_simd256(y256[7],1); + y256[8] = shiftright_int16_simd256(y256[8],1); + y256[9] = shiftright_int16_simd256(y256[9],1); + y256[10] = shiftright_int16_simd256(y256[10],1); + y256[11] = shiftright_int16_simd256(y256[11],1); + y256[12] = shiftright_int16_simd256(y256[12],1); + y256[13] = shiftright_int16_simd256(y256[13],1); + y256[14] = shiftright_int16_simd256(y256[14],1); + y256[15] = shiftright_int16_simd256(y256[15],1); + + y256+=16; + } + + } + + _mm_empty(); + _m_empty(); + +} + +void idft4096_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[512],ytmp[512],*tw4096_256p=(simd256_q15_t *)tw4096,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i,j; + + for (i=0,j=0; i<512; i+=4,j++) { + transpose16_ooff_simd256(x256+i,xtmp+j,128); + } + + + idft1024_simd256((int16_t*)(xtmp),(int16_t*)(ytmp),1); + idft1024_simd256((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1); + idft1024_simd256((int16_t*)(xtmp+256),(int16_t*)(ytmp+256),1); + idft1024_simd256((int16_t*)(xtmp+384),(int16_t*)(ytmp+384),1); + + for (i=0; i<128; i++) { + ibfly4_256(ytmpp,ytmpp+128,ytmpp+256,ytmpp+384, + y256p,y256p+128,y256p+256,y256p+384, + tw4096_256p,tw4096_256p+128,tw4096_256p+256); + tw4096_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0; i<32; i++) { + y256[0] = shiftright_int16_simd256(y256[0],1); + y256[1] = shiftright_int16_simd256(y256[1],1); + y256[2] = shiftright_int16_simd256(y256[2],1); + y256[3] = shiftright_int16_simd256(y256[3],1); + y256[4] = shiftright_int16_simd256(y256[4],1); + y256[5] = shiftright_int16_simd256(y256[5],1); + y256[6] = shiftright_int16_simd256(y256[6],1); + y256[7] = shiftright_int16_simd256(y256[7],1); + y256[8] = shiftright_int16_simd256(y256[8],1); + y256[9] = shiftright_int16_simd256(y256[9],1); + y256[10] = shiftright_int16_simd256(y256[10],1); + y256[11] = shiftright_int16_simd256(y256[11],1); + y256[12] = shiftright_int16_simd256(y256[12],1); + y256[13] = shiftright_int16_simd256(y256[13],1); + y256[14] = shiftright_int16_simd256(y256[14],1); + y256[15] = shiftright_int16_simd256(y256[15],1); + + y256+=16; + } + + } + + _mm_empty(); + _m_empty(); + +} + +#endif + + +#include "twiddles8192.h" void dft8192(int16_t *x,int16_t *y,int scale) { @@ -3173,13 +5204,105 @@ void idft8192(int16_t *x,int16_t *y,int scale) } +#ifdef __AVX2__ +void dft8192_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[1024],*xtmpp,*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[1024],*tw8192_256p=(simd256_q15_t *)tw8192,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + xtmpp = xtmp; + + for (i=0; i<32; i++) { + transpose4_ooff_simd256(x256 ,xtmpp,512); + transpose4_ooff_simd256(x256+2,xtmpp+1,512); + transpose4_ooff_simd256(x256+4,xtmpp+2,512); + transpose4_ooff_simd256(x256+6,xtmpp+3,512); + transpose4_ooff_simd256(x256+8,xtmpp+4,512); + transpose4_ooff_simd256(x256+10,xtmpp+5,512); + transpose4_ooff_simd256(x256+12,xtmpp+6,512); + transpose4_ooff_simd256(x256+14,xtmpp+7,512); + transpose4_ooff_simd256(x256+16,xtmpp+8,512); + transpose4_ooff_simd256(x256+18,xtmpp+9,512); + transpose4_ooff_simd256(x256+20,xtmpp+10,512); + transpose4_ooff_simd256(x256+22,xtmpp+11,512); + transpose4_ooff_simd256(x256+24,xtmpp+12,512); + transpose4_ooff_simd256(x256+26,xtmpp+13,512); + transpose4_ooff_simd256(x256+28,xtmpp+14,512); + transpose4_ooff_simd256(x256+30,xtmpp+15,512); + transpose4_ooff_simd256(x256+32,xtmpp+16,512); + transpose4_ooff_simd256(x256+34,xtmpp+17,512); + transpose4_ooff_simd256(x256+36,xtmpp+18,512); + transpose4_ooff_simd256(x256+38,xtmpp+19,512); + transpose4_ooff_simd256(x256+40,xtmpp+20,512); + transpose4_ooff_simd256(x256+42,xtmpp+21,512); + transpose4_ooff_simd256(x256+44,xtmpp+22,512); + transpose4_ooff_simd256(x256+46,xtmpp+23,512); + transpose4_ooff_simd256(x256+48,xtmpp+24,512); + transpose4_ooff_simd256(x256+50,xtmpp+25,512); + transpose4_ooff_simd256(x256+52,xtmpp+26,512); + transpose4_ooff_simd256(x256+54,xtmpp+27,512); + transpose4_ooff_simd256(x256+56,xtmpp+28,512); + transpose4_ooff_simd256(x256+58,xtmpp+29,512); + transpose4_ooff_simd256(x256+60,xtmpp+30,512); + transpose4_ooff_simd256(x256+62,xtmpp+31,512); + x256+=64; + xtmpp+=32; + } + + dft4096_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); + dft4096_simd256((int16_t*)(xtmp+1024),(int16_t*)(ytmp+512),1); + + + for (i=0; i<512; i++) { + bfly2_256(ytmpp,ytmpp+512, + y256p,y256p+512, + tw8192_256p); + tw8192_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + y256p = y256; + + for (i=0; i<64; i++) { + y256p[0] = mulhi_int16_simd256(y256p[0],ONE_OVER_SQRT2_Q15_128); + y256p[1] = mulhi_int16_simd256(y256p[1],ONE_OVER_SQRT2_Q15_128); + y256p[2] = mulhi_int16_simd256(y256p[2],ONE_OVER_SQRT2_Q15_128); + y256p[3] = mulhi_int16_simd256(y256p[3],ONE_OVER_SQRT2_Q15_128); + y256p[4] = mulhi_int16_simd256(y256p[4],ONE_OVER_SQRT2_Q15_128); + y256p[5] = mulhi_int16_simd256(y256p[5],ONE_OVER_SQRT2_Q15_128); + y256p[6] = mulhi_int16_simd256(y256p[6],ONE_OVER_SQRT2_Q15_128); + y256p[7] = mulhi_int16_simd256(y256p[7],ONE_OVER_SQRT2_Q15_128); + y256p[8] = mulhi_int16_simd256(y256p[8],ONE_OVER_SQRT2_Q15_128); + y256p[9] = mulhi_int16_simd256(y256p[9],ONE_OVER_SQRT2_Q15_128); + y256p[10] = mulhi_int16_simd256(y256p[10],ONE_OVER_SQRT2_Q15_128); + y256p[11] = mulhi_int16_simd256(y256p[11],ONE_OVER_SQRT2_Q15_128); + y256p[12] = mulhi_int16_simd256(y256p[12],ONE_OVER_SQRT2_Q15_128); + y256p[13] = mulhi_int16_simd256(y256p[13],ONE_OVER_SQRT2_Q15_128); + y256p[14] = mulhi_int16_simd256(y256p[14],ONE_OVER_SQRT2_Q15_128); + y256p[15] = mulhi_int16_simd256(y256p[15],ONE_OVER_SQRT2_Q15_128); + y256p+=16; + } + } + + _mm_empty(); + _m_empty(); + +} +#endif + #include "twiddle1536.h" // 512 x 3 void idft1536(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][512 ]__attribute__((aligned(16))); - uint32_t tmpo[3][512] __attribute__((aligned(16))); + uint32_t tmp[3][512 ]__attribute__((aligned(32))); + uint32_t tmpo[3][512] __attribute__((aligned(32))); for (i=0,j=0; i<512; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3217,8 +5340,8 @@ void idft1536(int16_t *input, int16_t *output) void dft1536(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][512] __attribute__((aligned(16))); - uint32_t tmpo[3][512] __attribute__((aligned(16))); + uint32_t tmp[3][512] __attribute__((aligned(32))); + uint32_t tmpo[3][512] __attribute__((aligned(32))); for (i=0,j=0; i<512; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3267,8 +5390,8 @@ void idft3072(int16_t *input, int16_t *output) void idft6144(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][2048] __attribute__((aligned(16))); - uint32_t tmpo[3][2048] __attribute__((aligned(16))); + uint32_t tmp[3][2048] __attribute__((aligned(32))); + uint32_t tmpo[3][2048] __attribute__((aligned(32))); for (i=0,j=0; i<2048; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3308,8 +5431,8 @@ void idft6144(int16_t *input, int16_t *output) void dft6144(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][2048] __attribute__((aligned(16))); - uint32_t tmpo[3][2048] __attribute__((aligned(16))); + uint32_t tmp[3][2048] __attribute__((aligned(32))); + uint32_t tmpo[3][2048] __attribute__((aligned(32))); for (i=0,j=0; i<2048; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3348,8 +5471,8 @@ void dft6144(int16_t *input, int16_t *output) void dft12288(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][4096] __attribute__((aligned(16))); - uint32_t tmpo[3][4096] __attribute__((aligned(16))); + uint32_t tmp[3][4096] __attribute__((aligned(32))); + uint32_t tmpo[3][4096] __attribute__((aligned(32))); for (i=0,j=0; i<4096; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3384,8 +5507,8 @@ void dft12288(int16_t *input, int16_t *output) void idft12288(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][4096] __attribute__((aligned(16))); - uint32_t tmpo[3][4096] __attribute__((aligned(16))); + uint32_t tmp[3][4096] __attribute__((aligned(32))); + uint32_t tmpo[3][4096] __attribute__((aligned(32))); for (i=0,j=0; i<4096; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3431,8 +5554,8 @@ void idft18432(int16_t *input, int16_t *output) void dft24576(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][8192] __attribute__((aligned(16))); - uint32_t tmpo[3][8192] __attribute__((aligned(16))); + uint32_t tmp[3][8192] __attribute__((aligned(32))); + uint32_t tmpo[3][8192] __attribute__((aligned(32))); for (i=0,j=0; i<8192; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3468,8 +5591,8 @@ void dft24576(int16_t *input, int16_t *output) void idft24576(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][16384] __attribute__((aligned(16))); - uint32_t tmpo[3][16384] __attribute__((aligned(16))); + uint32_t tmp[3][16384] __attribute__((aligned(32))); + uint32_t tmpo[3][16384] __attribute__((aligned(32))); for (i=0,j=0; i<8192; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3510,11 +5633,11 @@ void idft24576(int16_t *input, int16_t *output) /// THIS SECTION IS FOR ALL PUSCH DFTS (i.e. radix 2^a * 3^b * 4^c * 5^d) /// They use twiddles for 4-way parallel DFTS (i.e. 4 DFTS with interleaved input/output) -static int16_t W1_12s[8]__attribute__((aligned(16))) = {28377,-16383,28377,-16383,28377,-16383,28377,-16383}; -static int16_t W2_12s[8]__attribute__((aligned(16))) = {16383,-28377,16383,-28377,16383,-28377,16383,-28377}; -static int16_t W3_12s[8]__attribute__((aligned(16))) = {0,-32767,0,-32767,0,-32767,0,-32767}; -static int16_t W4_12s[8]__attribute__((aligned(16))) = {-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377}; -static int16_t W6_12s[8]__attribute__((aligned(16))) = {-32767,0,-32767,0,-32767,0,-32767,0}; +static int16_t W1_12s[8]__attribute__((aligned(32))) = {28377,-16383,28377,-16383,28377,-16383,28377,-16383}; +static int16_t W2_12s[8]__attribute__((aligned(32))) = {16383,-28377,16383,-28377,16383,-28377,16383,-28377}; +static int16_t W3_12s[8]__attribute__((aligned(32))) = {0,-32767,0,-32767,0,-32767,0,-32767}; +static int16_t W4_12s[8]__attribute__((aligned(32))) = {-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377}; +static int16_t W6_12s[8]__attribute__((aligned(32))) = {-32767,0,-32767,0,-32767,0,-32767,0}; simd_q15_t *W1_12=(simd_q15_t *)W1_12s; simd_q15_t *W2_12=(simd_q15_t *)W2_12s; @@ -3693,7 +5816,194 @@ void dft12(int16_t *x,int16_t *y) } -static int16_t tw24[88]__attribute__((aligned(16))) = {31650,-8480,31650,-8480,31650,-8480,31650,-8480, +#ifdef __AVX2__ + +static int16_t W1_12s_256[16]__attribute__((aligned(32))) = {28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383}; +static int16_t W2_12s_256[16]__attribute__((aligned(32))) = {16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377}; +static int16_t W3_12s_256[16]__attribute__((aligned(32))) = {0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767}; +static int16_t W4_12s_256[16]__attribute__((aligned(32))) = {-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377}; +static int16_t W6_12s_256[16]__attribute__((aligned(32))) = {-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0}; + +simd256_q15_t *W1_12_256=(simd256_q15_t *)W1_12s_256; +simd256_q15_t *W2_12_256=(simd256_q15_t *)W2_12s_256; +simd256_q15_t *W3_12_256=(simd256_q15_t *)W3_12s_256; +simd256_q15_t *W4_12_256=(simd256_q15_t *)W4_12s_256; +simd256_q15_t *W6_12_256=(simd256_q15_t *)W6_12s_256; + + +static simd256_q15_t norm256; + +static inline void dft12f_simd256(simd256_q15_t *x0, + simd256_q15_t *x1, + simd256_q15_t *x2, + simd256_q15_t *x3, + simd256_q15_t *x4, + simd256_q15_t *x5, + simd256_q15_t *x6, + simd256_q15_t *x7, + simd256_q15_t *x8, + simd256_q15_t *x9, + simd256_q15_t *x10, + simd256_q15_t *x11, + simd256_q15_t *y0, + simd256_q15_t *y1, + simd256_q15_t *y2, + simd256_q15_t *y3, + simd256_q15_t *y4, + simd256_q15_t *y5, + simd256_q15_t *y6, + simd256_q15_t *y7, + simd256_q15_t *y8, + simd256_q15_t *y9, + simd256_q15_t *y10, + simd256_q15_t *y11) __attribute__((always_inline)); + +static inline void dft12f_simd256(simd256_q15_t *x0, + simd256_q15_t *x1, + simd256_q15_t *x2, + simd256_q15_t *x3, + simd256_q15_t *x4, + simd256_q15_t *x5, + simd256_q15_t *x6, + simd256_q15_t *x7, + simd256_q15_t *x8, + simd256_q15_t *x9, + simd256_q15_t *x10, + simd256_q15_t *x11, + simd256_q15_t *y0, + simd256_q15_t *y1, + simd256_q15_t *y2, + simd256_q15_t *y3, + simd256_q15_t *y4, + simd256_q15_t *y5, + simd256_q15_t *y6, + simd256_q15_t *y7, + simd256_q15_t *y8, + simd256_q15_t *y9, + simd256_q15_t *y10, + simd256_q15_t *y11) +{ + + + simd256_q15_t tmp_dft12[12]; + + simd256_q15_t *tmp_dft12_ptr = &tmp_dft12[0]; + + // msg("dft12\n"); + + bfly4_tw1_256(x0, + x3, + x6, + x9, + tmp_dft12_ptr, + tmp_dft12_ptr+3, + tmp_dft12_ptr+6, + tmp_dft12_ptr+9); + + + bfly4_tw1_256(x1, + x4, + x7, + x10, + tmp_dft12_ptr+1, + tmp_dft12_ptr+4, + tmp_dft12_ptr+7, + tmp_dft12_ptr+10); + + + bfly4_tw1_256(x2, + x5, + x8, + x11, + tmp_dft12_ptr+2, + tmp_dft12_ptr+5, + tmp_dft12_ptr+8, + tmp_dft12_ptr+11); + + // k2=0; + bfly3_tw1_256(tmp_dft12_ptr, + tmp_dft12_ptr+1, + tmp_dft12_ptr+2, + y0, + y4, + y8); + + + + // k2=1; + bfly3_256(tmp_dft12_ptr+3, + tmp_dft12_ptr+4, + tmp_dft12_ptr+5, + y1, + y5, + y9, + W1_12_256, + W2_12_256); + + + + // k2=2; + bfly3_256(tmp_dft12_ptr+6, + tmp_dft12_ptr+7, + tmp_dft12_ptr+8, + y2, + y6, + y10, + W2_12_256, + W4_12_256); + + // k2=3; + bfly3_256(tmp_dft12_ptr+9, + tmp_dft12_ptr+10, + tmp_dft12_ptr+11, + y3, + y7, + y11, + W3_12_256, + W6_12_256); + +} + + + + +void dft12_simd256(int16_t *x,int16_t *y) +{ + + simd256_q15_t *x256 = (simd256_q15_t *)x,*y256 = (simd256_q15_t *)y; + dft12f_simd256(&x256[0], + &x256[1], + &x256[2], + &x256[3], + &x256[4], + &x256[5], + &x256[6], + &x256[7], + &x256[8], + &x256[9], + &x256[10], + &x256[11], + &y256[0], + &y256[1], + &y256[2], + &y256[3], + &y256[4], + &y256[5], + &y256[6], + &y256[7], + &y256[8], + &y256[9], + &y256[10], + &y256[11]); + + _mm_empty(); + _m_empty(); + +} + +#endif + +static int16_t tw24[88]__attribute__((aligned(32))) = {31650,-8480,31650,-8480,31650,-8480,31650,-8480, 28377,-16383,28377,-16383,28377,-16383,28377,-16383, 23169,-23169,23169,-23169,23169,-23169,23169,-23169, 16383,-28377,16383,-28377,16383,-28377,16383,-28377, @@ -3804,7 +6114,7 @@ void dft24(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa36[88]__attribute__((aligned(16))) = {32269,-5689,32269,-5689,32269,-5689,32269,-5689, +static int16_t twa36[88]__attribute__((aligned(32))) = {32269,-5689,32269,-5689,32269,-5689,32269,-5689, 30790,-11206,30790,-11206,30790,-11206,30790,-11206, 28377,-16383,28377,-16383,28377,-16383,28377,-16383, 25100,-21062,25100,-21062,25100,-21062,25100,-21062, @@ -3817,7 +6127,7 @@ static int16_t twa36[88]__attribute__((aligned(16))) = {32269,-5689,32269,-5689, -11206,-30790,-11206,-30790,-11206,-30790,-11206,-30790 }; -static int16_t twb36[88]__attribute__((aligned(16))) = {30790,-11206,30790,-11206,30790,-11206,30790,-11206, +static int16_t twb36[88]__attribute__((aligned(32))) = {30790,-11206,30790,-11206,30790,-11206,30790,-11206, 25100,-21062,25100,-21062,25100,-21062,25100,-21062, 16383,-28377,16383,-28377,16383,-28377,16383,-28377, 5689,-32269,5689,-32269,5689,-32269,5689,-32269, @@ -3950,7 +6260,7 @@ void dft36(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa48[88]__attribute__((aligned(16))) = {32486,-4276,32486,-4276,32486,-4276,32486,-4276, +static int16_t twa48[88]__attribute__((aligned(32))) = {32486,-4276,32486,-4276,32486,-4276,32486,-4276, 31650,-8480,31650,-8480,31650,-8480,31650,-8480, 30272,-12539,30272,-12539,30272,-12539,30272,-12539, 28377,-16383,28377,-16383,28377,-16383,28377,-16383, @@ -3963,7 +6273,7 @@ static int16_t twa48[88]__attribute__((aligned(16))) = {32486,-4276,32486,-4276, 4276,-32486,4276,-32486,4276,-32486,4276,-32486 }; -static int16_t twb48[88]__attribute__((aligned(16))) = {31650,-8480,31650,-8480,31650,-8480,31650,-8480, +static int16_t twb48[88]__attribute__((aligned(32))) = {31650,-8480,31650,-8480,31650,-8480,31650,-8480, 28377,-16383,28377,-16383,28377,-16383,28377,-16383, 23169,-23169,23169,-23169,23169,-23169,23169,-23169, 16383,-28377,16383,-28377,16383,-28377,16383,-28377, @@ -3976,7 +6286,7 @@ static int16_t twb48[88]__attribute__((aligned(16))) = {31650,-8480,31650,-8480, -31650,-8480,-31650,-8480,-31650,-8480,-31650,-8480 }; -static int16_t twc48[88]__attribute__((aligned(16))) = {30272,-12539,30272,-12539,30272,-12539,30272,-12539, +static int16_t twc48[88]__attribute__((aligned(32))) = {30272,-12539,30272,-12539,30272,-12539,30272,-12539, 23169,-23169,23169,-23169,23169,-23169,23169,-23169, 12539,-30272,12539,-30272,12539,-30272,12539,-30272, 0,-32767,0,-32767,0,-32767,0,-32767, @@ -4146,7 +6456,7 @@ void dft48(int16_t *x, int16_t *y,unsigned char scale_flag) } -static int16_t twa60[88]__attribute__((aligned(16))) = {32587,-3425,32587,-3425,32587,-3425,32587,-3425, +static int16_t twa60[88]__attribute__((aligned(32))) = {32587,-3425,32587,-3425,32587,-3425,32587,-3425, 32050,-6812,32050,-6812,32050,-6812,32050,-6812, 31163,-10125,31163,-10125,31163,-10125,31163,-10125, 29934,-13327,29934,-13327,29934,-13327,29934,-13327, @@ -4158,7 +6468,7 @@ static int16_t twa60[88]__attribute__((aligned(16))) = {32587,-3425,32587,-3425, 16383,-28377,16383,-28377,16383,-28377,16383,-28377, 13327,-29934,13327,-29934,13327,-29934,13327,-29934 }; -static int16_t twb60[88]__attribute__((aligned(16))) = {32050,-6812,32050,-6812,32050,-6812,32050,-6812, +static int16_t twb60[88]__attribute__((aligned(32))) = {32050,-6812,32050,-6812,32050,-6812,32050,-6812, 29934,-13327,29934,-13327,29934,-13327,29934,-13327, 26509,-19259,26509,-19259,26509,-19259,26509,-19259, 21925,-24350,21925,-24350,21925,-24350,21925,-24350, @@ -4170,7 +6480,7 @@ static int16_t twb60[88]__attribute__((aligned(16))) = {32050,-6812,32050,-6812, -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377, -21925,-24350,-21925,-24350,-21925,-24350,-21925,-24350 }; -static int16_t twc60[88]__attribute__((aligned(16))) = {31163,-10125,31163,-10125,31163,-10125,31163,-10125, +static int16_t twc60[88]__attribute__((aligned(32))) = {31163,-10125,31163,-10125,31163,-10125,31163,-10125, 26509,-19259,26509,-19259,26509,-19259,26509,-19259, 19259,-26509,19259,-26509,19259,-26509,19259,-26509, 10125,-31163,10125,-31163,10125,-31163,10125,-31163, @@ -4182,7 +6492,7 @@ static int16_t twc60[88]__attribute__((aligned(16))) = {31163,-10125,31163,-1012 -32767,0,-32767,0,-32767,0,-32767,0, -31163,10125,-31163,10125,-31163,10125,-31163,10125 }; -static int16_t twd60[88]__attribute__((aligned(16))) = {29934,-13327,29934,-13327,29934,-13327,29934,-13327, +static int16_t twd60[88]__attribute__((aligned(32))) = {29934,-13327,29934,-13327,29934,-13327,29934,-13327, 21925,-24350,21925,-24350,21925,-24350,21925,-24350, 10125,-31163,10125,-31163,10125,-31163,10125,-31163, -3425,-32587,-3425,-32587,-3425,-32587,-3425,-32587, @@ -4374,7 +6684,7 @@ void dft60(int16_t *x,int16_t *y,unsigned char scale) } -static int16_t tw72[280]__attribute__((aligned(16))) = {32642,-2855,32642,-2855,32642,-2855,32642,-2855, +static int16_t tw72[280]__attribute__((aligned(32))) = {32642,-2855,32642,-2855,32642,-2855,32642,-2855, 32269,-5689,32269,-5689,32269,-5689,32269,-5689, 31650,-8480,31650,-8480,31650,-8480,31650,-8480, 30790,-11206,30790,-11206,30790,-11206,30790,-11206, @@ -4453,7 +6763,7 @@ void dft72(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t tw96[376]__attribute__((aligned(16))) = {32696,-2143,32696,-2143,32696,-2143,32696,-2143, +static int16_t tw96[376]__attribute__((aligned(32))) = {32696,-2143,32696,-2143,32696,-2143,32696,-2143, 32486,-4276,32486,-4276,32486,-4276,32486,-4276, 32137,-6392,32137,-6392,32137,-6392,32137,-6392, 31650,-8480,31650,-8480,31650,-8480,31650,-8480, @@ -4546,7 +6856,7 @@ void dft96(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa108[280]__attribute__((aligned(16))) = {32711,-1905,32711,-1905,32711,-1905,32711,-1905, +static int16_t twa108[280]__attribute__((aligned(32))) = {32711,-1905,32711,-1905,32711,-1905,32711,-1905, 32545,-3804,32545,-3804,32545,-3804,32545,-3804, 32269,-5689,32269,-5689,32269,-5689,32269,-5689, 31883,-7556,31883,-7556,31883,-7556,31883,-7556, @@ -4583,7 +6893,7 @@ static int16_t twa108[280]__attribute__((aligned(16))) = {32711,-1905,32711,-190 -14705,-29281,-14705,-29281,-14705,-29281,-14705,-29281 }; -static int16_t twb108[280]__attribute__((aligned(16))) = {32545,-3804,32545,-3804,32545,-3804,32545,-3804, +static int16_t twb108[280]__attribute__((aligned(32))) = {32545,-3804,32545,-3804,32545,-3804,32545,-3804, 31883,-7556,31883,-7556,31883,-7556,31883,-7556, 30790,-11206,30790,-11206,30790,-11206,30790,-11206, 29281,-14705,29281,-14705,29281,-14705,29281,-14705, @@ -4670,7 +6980,7 @@ void dft108(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t tw120[472]__attribute__((aligned(16))) = {32722,-1714,32722,-1714,32722,-1714,32722,-1714, +static int16_t tw120[472]__attribute__((aligned(32))) = {32722,-1714,32722,-1714,32722,-1714,32722,-1714, 32587,-3425,32587,-3425,32587,-3425,32587,-3425, 32363,-5125,32363,-5125,32363,-5125,32363,-5125, 32050,-6812,32050,-6812,32050,-6812,32050,-6812, @@ -4775,7 +7085,7 @@ void dft120(int16_t *x,int16_t *y, unsigned char scale_flag) } -static int16_t twa144[376]__attribute__((aligned(16))) = {32735,-1429,32735,-1429,32735,-1429,32735,-1429, +static int16_t twa144[376]__attribute__((aligned(32))) = {32735,-1429,32735,-1429,32735,-1429,32735,-1429, 32642,-2855,32642,-2855,32642,-2855,32642,-2855, 32486,-4276,32486,-4276,32486,-4276,32486,-4276, 32269,-5689,32269,-5689,32269,-5689,32269,-5689, @@ -4824,7 +7134,7 @@ static int16_t twa144[376]__attribute__((aligned(16))) = {32735,-1429,32735,-142 -15130,-29064,-15130,-29064,-15130,-29064,-15130,-29064 }; -static int16_t twb144[376]__attribute__((aligned(16))) = {32642,-2855,32642,-2855,32642,-2855,32642,-2855, +static int16_t twb144[376]__attribute__((aligned(32))) = {32642,-2855,32642,-2855,32642,-2855,32642,-2855, 32269,-5689,32269,-5689,32269,-5689,32269,-5689, 31650,-8480,31650,-8480,31650,-8480,31650,-8480, 30790,-11206,30790,-11206,30790,-11206,30790,-11206, @@ -4922,7 +7232,7 @@ void dft144(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa180[472]__attribute__((aligned(16))) = {32747,-1143,32747,-1143,32747,-1143,32747,-1143, +static int16_t twa180[472]__attribute__((aligned(32))) = {32747,-1143,32747,-1143,32747,-1143,32747,-1143, 32687,-2285,32687,-2285,32687,-2285,32687,-2285, 32587,-3425,32587,-3425,32587,-3425,32587,-3425, 32448,-4560,32448,-4560,32448,-4560,32448,-4560, @@ -4983,7 +7293,7 @@ static int16_t twa180[472]__attribute__((aligned(16))) = {32747,-1143,32747,-114 -15383,-28931,-15383,-28931,-15383,-28931,-15383,-28931 }; -static int16_t twb180[472]__attribute__((aligned(16))) = {32687,-2285,32687,-2285,32687,-2285,32687,-2285, +static int16_t twb180[472]__attribute__((aligned(32))) = {32687,-2285,32687,-2285,32687,-2285,32687,-2285, 32448,-4560,32448,-4560,32448,-4560,32448,-4560, 32050,-6812,32050,-6812,32050,-6812,32050,-6812, 31497,-9031,31497,-9031,31497,-9031,31497,-9031, @@ -5093,7 +7403,7 @@ void dft180(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa192[376]__attribute__((aligned(16))) = {32749,-1072,32749,-1072,32749,-1072,32749,-1072, +static int16_t twa192[376]__attribute__((aligned(32))) = {32749,-1072,32749,-1072,32749,-1072,32749,-1072, 32696,-2143,32696,-2143,32696,-2143,32696,-2143, 32609,-3211,32609,-3211,32609,-3211,32609,-3211, 32486,-4276,32486,-4276,32486,-4276,32486,-4276, @@ -5142,7 +7452,7 @@ static int16_t twa192[376]__attribute__((aligned(16))) = {32749,-1072,32749,-107 1072,-32749,1072,-32749,1072,-32749,1072,-32749 }; -static int16_t twb192[376]__attribute__((aligned(16))) = {32696,-2143,32696,-2143,32696,-2143,32696,-2143, +static int16_t twb192[376]__attribute__((aligned(32))) = {32696,-2143,32696,-2143,32696,-2143,32696,-2143, 32486,-4276,32486,-4276,32486,-4276,32486,-4276, 32137,-6392,32137,-6392,32137,-6392,32137,-6392, 31650,-8480,31650,-8480,31650,-8480,31650,-8480, @@ -5191,7 +7501,7 @@ static int16_t twb192[376]__attribute__((aligned(16))) = {32696,-2143,32696,-214 -32696,-2143,-32696,-2143,-32696,-2143,-32696,-2143 }; -static int16_t twc192[376]__attribute__((aligned(16))) = {32609,-3211,32609,-3211,32609,-3211,32609,-3211, +static int16_t twc192[376]__attribute__((aligned(32))) = {32609,-3211,32609,-3211,32609,-3211,32609,-3211, 32137,-6392,32137,-6392,32137,-6392,32137,-6392, 31356,-9511,31356,-9511,31356,-9511,31356,-9511, 30272,-12539,30272,-12539,30272,-12539,30272,-12539, @@ -5295,7 +7605,7 @@ void dft192(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa216[568]__attribute__((aligned(16))) = {32753,-953,32753,-953,32753,-953,32753,-953, +static int16_t twa216[568]__attribute__((aligned(32))) = {32753,-953,32753,-953,32753,-953,32753,-953, 32711,-1905,32711,-1905,32711,-1905,32711,-1905, 32642,-2855,32642,-2855,32642,-2855,32642,-2855, 32545,-3804,32545,-3804,32545,-3804,32545,-3804, @@ -5368,7 +7678,7 @@ static int16_t twa216[568]__attribute__((aligned(16))) = {32753,-953,32753,-953, -15551,-28841,-15551,-28841,-15551,-28841,-15551,-28841 }; -static int16_t twb216[568]__attribute__((aligned(16))) = {32711,-1905,32711,-1905,32711,-1905,32711,-1905, +static int16_t twb216[568]__attribute__((aligned(32))) = {32711,-1905,32711,-1905,32711,-1905,32711,-1905, 32545,-3804,32545,-3804,32545,-3804,32545,-3804, 32269,-5689,32269,-5689,32269,-5689,32269,-5689, 31883,-7556,31883,-7556,31883,-7556,31883,-7556, @@ -5490,7 +7800,7 @@ void dft216(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa240[472]__attribute__((aligned(16))) = {32755,-857,32755,-857,32755,-857,32755,-857, +static int16_t twa240[472]__attribute__((aligned(32))) = {32755,-857,32755,-857,32755,-857,32755,-857, 32722,-1714,32722,-1714,32722,-1714,32722,-1714, 32665,-2570,32665,-2570,32665,-2570,32665,-2570, 32587,-3425,32587,-3425,32587,-3425,32587,-3425, @@ -5551,7 +7861,7 @@ static int16_t twa240[472]__attribute__((aligned(16))) = {32755,-857,32755,-857, 857,-32755,857,-32755,857,-32755,857,-32755 }; -static int16_t twb240[472]__attribute__((aligned(16))) = {32722,-1714,32722,-1714,32722,-1714,32722,-1714, +static int16_t twb240[472]__attribute__((aligned(32))) = {32722,-1714,32722,-1714,32722,-1714,32722,-1714, 32587,-3425,32587,-3425,32587,-3425,32587,-3425, 32363,-5125,32363,-5125,32363,-5125,32363,-5125, 32050,-6812,32050,-6812,32050,-6812,32050,-6812, @@ -5612,7 +7922,7 @@ static int16_t twb240[472]__attribute__((aligned(16))) = {32722,-1714,32722,-171 -32722,-1714,-32722,-1714,-32722,-1714,-32722,-1714 }; -static int16_t twc240[472]__attribute__((aligned(16))) = {32665,-2570,32665,-2570,32665,-2570,32665,-2570, +static int16_t twc240[472]__attribute__((aligned(32))) = {32665,-2570,32665,-2570,32665,-2570,32665,-2570, 32363,-5125,32363,-5125,32363,-5125,32363,-5125, 31861,-7649,31861,-7649,31861,-7649,31861,-7649, 31163,-10125,31163,-10125,31163,-10125,31163,-10125, @@ -5740,7 +8050,7 @@ twb2(2:2:end) = imag(twb); */ -static int16_t twa288[760]__attribute__((aligned(16))) = {32759,-714,32759,-714,32759,-714,32759,-714, +static int16_t twa288[760]__attribute__((aligned(32))) = {32759,-714,32759,-714,32759,-714,32759,-714, 32735,-1429,32735,-1429,32735,-1429,32735,-1429, 32696,-2143,32696,-2143,32696,-2143,32696,-2143, 32642,-2855,32642,-2855,32642,-2855,32642,-2855, @@ -5837,7 +8147,7 @@ static int16_t twa288[760]__attribute__((aligned(16))) = {32759,-714,32759,-714, -15760,-28727,-15760,-28727,-15760,-28727,-15760,-28727 }; -static int16_t twb288[760]__attribute__((aligned(16))) = {32735,-1429,32735,-1429,32735,-1429,32735,-1429, +static int16_t twb288[760]__attribute__((aligned(32))) = {32735,-1429,32735,-1429,32735,-1429,32735,-1429, 32642,-2855,32642,-2855,32642,-2855,32642,-2855, 32486,-4276,32486,-4276,32486,-4276,32486,-4276, 32269,-5689,32269,-5689,32269,-5689,32269,-5689, @@ -5983,7 +8293,7 @@ void dft288(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa300[472]__attribute__((aligned(16))) = {32759,-686,32759,-686,32759,-686,32759,-686, +static int16_t twa300[472]__attribute__((aligned(32))) = {32759,-686,32759,-686,32759,-686,32759,-686, 32738,-1372,32738,-1372,32738,-1372,32738,-1372, 32702,-2057,32702,-2057,32702,-2057,32702,-2057, 32652,-2741,32652,-2741,32652,-2741,32652,-2741, @@ -6044,7 +8354,7 @@ static int16_t twa300[472]__attribute__((aligned(16))) = {32759,-686,32759,-686, 10775,-30944,10775,-30944,10775,-30944,10775,-30944 }; -static int16_t twb300[472]__attribute__((aligned(16))) = {32738,-1372,32738,-1372,32738,-1372,32738,-1372, +static int16_t twb300[472]__attribute__((aligned(32))) = {32738,-1372,32738,-1372,32738,-1372,32738,-1372, 32652,-2741,32652,-2741,32652,-2741,32652,-2741, 32508,-4106,32508,-4106,32508,-4106,32508,-4106, 32308,-5464,32308,-5464,32308,-5464,32308,-5464, @@ -6105,7 +8415,7 @@ static int16_t twb300[472]__attribute__((aligned(16))) = {32738,-1372,32738,-137 -25679,-20353,-25679,-20353,-25679,-20353,-25679,-20353 }; -static int16_t twc300[472]__attribute__((aligned(16))) = {32702,-2057,32702,-2057,32702,-2057,32702,-2057, +static int16_t twc300[472]__attribute__((aligned(32))) = {32702,-2057,32702,-2057,32702,-2057,32702,-2057, 32508,-4106,32508,-4106,32508,-4106,32508,-4106, 32186,-6139,32186,-6139,32186,-6139,32186,-6139, 31737,-8148,31737,-8148,31737,-8148,31737,-8148, @@ -6166,7 +8476,7 @@ static int16_t twc300[472]__attribute__((aligned(16))) = {32702,-2057,32702,-205 -27666,17557,-27666,17557,-27666,17557,-27666,17557 }; -static int16_t twd300[472]__attribute__((aligned(16))) = {32652,-2741,32652,-2741,32652,-2741,32652,-2741, +static int16_t twd300[472]__attribute__((aligned(32))) = {32652,-2741,32652,-2741,32652,-2741,32652,-2741, 32308,-5464,32308,-5464,32308,-5464,32308,-5464, 31737,-8148,31737,-8148,31737,-8148,31737,-8148, 30944,-10775,30944,-10775,30944,-10775,30944,-10775, @@ -16097,8 +18407,7 @@ int main(int argc, char**argv) time_stats_t ts; - simd_q15_t x[2048],y[2048],tw0,tw1,tw2,tw3; - + simd256_q15_t x[2048],y[2048],tw0,tw1,tw2,tw3; int i; @@ -16426,10 +18735,10 @@ int main(int argc, char**argv) for (i=0;i<4;i++) printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&y[i])[0],((int16_t *)&y[i])[1],((int16_t*)&y[i])[2],((int16_t *)&y[i])[3],((int16_t*)&y[i])[4],((int16_t *)&y[i])[5],((int16_t*)&y[i])[6],((int16_t *)&y[i])[7]); printf("\n"); - */ - memset((void*)&x[0],0,64*4); -/* - for (i=0; i<64; i+=4) { + */ + memset((void*)&x[0],0,2048*4); + + for (i=0; i<2048; i+=4) { ((int16_t*)x)[i<<1] = 1024; ((int16_t*)x)[1+(i<<1)] = 0; ((int16_t*)x)[2+(i<<1)] = 0; @@ -16438,25 +18747,35 @@ int main(int argc, char**argv) ((int16_t*)x)[5+(i<<1)] = 0; ((int16_t*)x)[6+(i<<1)] = 0; ((int16_t*)x)[7+(i<<1)] = -1024; - } -*/ - for (i=0;i<64;i++) { - ((int16_t*)x)[i] = (int16_t)((taus()&0xffff))>>5; - } + } + /* + for (i=0; i<2048; i+=2) { + ((int16_t*)x)[i<<1] = 1024; + ((int16_t*)x)[1+(i<<1)] = 0; + ((int16_t*)x)[2+(i<<1)] = -1024; + ((int16_t*)x)[3+(i<<1)] = 0; + }*/ + /* + for (i=0;i<128;i++) { + ((int16_t*)x)[i] = i/2;//(int16_t)((taus()&0xffff))>>5; + }*/ + /* memset((void*)&y[0],0,64*4); -/* - dft16((int16_t *)x,(int16_t *)y); - printf("16-point\n"); + dft64_simd256((int16_t *)x,(int16_t *)y,1); + + + printf("64-point\n"); printf("X: "); for (i=0;i<4;i++) - printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&x[i])[0],((int16_t *)&x[i])[1],((int16_t*)&x[i])[2],((int16_t *)&x[i])[3],((int16_t*)&x[i])[4],((int16_t*)&x[i])[5],((int16_t*)&x[i])[6],((int16_t*)&x[i])[7]); + print_shorts256("",((int16_t *)x)+(i*16)); + printf("\nY:"); for (i=0;i<4;i++) - printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&y[i])[0],((int16_t *)&y[i])[1],((int16_t*)&y[i])[2],((int16_t *)&y[i])[3],((int16_t*)&y[i])[4],((int16_t *)&y[i])[5],((int16_t*)&y[i])[6],((int16_t *)&y[i])[7]); + print_shorts256("",((int16_t *)y)+(i*16)); printf("\n"); - exit(-1); -*/ + + dft64((int16_t *)x,(int16_t *)y,1); dft64((int16_t *)x,(int16_t *)y,1); dft64((int16_t *)x,(int16_t *)y,1); @@ -16470,8 +18789,27 @@ int main(int argc, char**argv) } printf("\n\n64-point (%f cycles, #trials %d)\n",(double)ts.diff/(double)ts.trials,ts.trials); - write_output("x64.m","x64",x,64,1,1); - write_output("y64.m","y64",y,64,1,1); + // write_output("x64.m","x64",x,64,1,1); + // write_output("y64.m","y64",y,64,1,1); + +#ifdef __AVX2__ + dft64_simd256((int16_t *)x,(int16_t *)y,1); + dft64_simd256((int16_t *)x,(int16_t *)y,1); + dft64_simd256((int16_t *)x,(int16_t *)y,1); + reset_meas(&ts); + + for (i=0; i<10000000; i++) { + start_meas(&ts); + dft64_simd256((int16_t *)x,(int16_t *)y,1); + stop_meas(&ts); + } + + printf("\n\n64-point AVX2 (%f cycles, #trials %d)\n",(double)ts.diff/(double)ts.trials,ts.trials); + write_output("x64_256.m","x64_256",x,64,1,1); + write_output("y64_256.m","y64_256",y,64,1,1); + +#endif + */ /* printf("X: "); @@ -16498,12 +18836,27 @@ int main(int argc, char**argv) for (i=0; i<10000; i++) { start_meas(&ts); - dft128((int16_t *)x,(int16_t *)y,0); + dft128((int16_t *)x,(int16_t *)y,1); stop_meas(&ts); } printf("\n\n128-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); +#ifdef __AVX2__ + memset((void*)&y[0],0,128*4); + reset_meas(&ts); + + for (i=0; i<10000; i++) { + start_meas(&ts); + dft128_simd256((int16_t *)x,(int16_t *)y,1); + stop_meas(&ts); + } + + printf("\n\n128-point AVX2 (%f cycles)\n",(double)ts.diff/(double)ts.trials); + write_output("x128_256.m","x128_256",x,128,1,1); + write_output("y128_256.m","y128_256",y,128,1,1); +#endif + /* printf("X: "); for (i=0;i<32;i++) printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&x[i])[0],((int16_t *)&x[i])[1],((int16_t*)&x[i])[2],((int16_t *)&x[i])[3],((int16_t*)&x[i])[4],((int16_t*)&x[i])[5],((int16_t*)&x[i])[6],((int16_t*)&x[i])[7]); @@ -16513,11 +18866,14 @@ int main(int argc, char**argv) printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&y[i])[0],((int16_t *)&y[i])[1],((int16_t*)&y[i])[2],((int16_t *)&y[i])[3],((int16_t*)&y[i])[4],((int16_t *)&y[i])[5],((int16_t*)&y[i])[6],((int16_t *)&y[i])[7]); printf("\n"); */ + + /* for (i=0; i<512; i++) { ((int16_t*)x)[i] = (int16_t)((taus()&0xffff))>>5; } - + memset((void*)&y[0],0,256*4); + */ reset_meas(&ts); for (i=0; i<10000; i++) { @@ -16528,8 +18884,20 @@ int main(int argc, char**argv) printf("\n\n256-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); +#ifdef __AVX2__ reset_meas(&ts); + for (i=0; i<10000; i++) { + start_meas(&ts); + dft256_simd256((int16_t *)x,(int16_t *)y,1); + stop_meas(&ts); + } + + printf("\n\n256-point AVX2 (%f cycles)\n",(double)ts.diff/(double)ts.trials); + +#endif + + reset_meas(&ts); for (i=0; i<10000; i++) { start_meas(&ts); dft512((int16_t *)x,(int16_t *)y,1); @@ -16538,8 +18906,19 @@ int main(int argc, char**argv) printf("\n\n512-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); - write_output("x.m","x",x,512,1,1); - write_output("y.m","y",y,512,1,1); +#ifdef __AVX2__ + reset_meas(&ts); + for (i=0; i<10000; i++) { + start_meas(&ts); + dft512_simd256((int16_t *)x,(int16_t *)y,1); + stop_meas(&ts); + } + + printf("\n\n512-point AVX2 (%f cycles)\n",(double)ts.diff/(double)ts.trials); + +#endif + // write_output("x.m","x",x,512,1,1); + // write_output("y.m","y",y,512,1,1); /* printf("X: "); @@ -16562,6 +18941,18 @@ int main(int argc, char**argv) printf("\n\n1024-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); +#ifdef __AVX2__ + reset_meas(&ts); + + for (i=0; i<10000; i++) { + start_meas(&ts); + dft1024_simd256((int16_t *)x,(int16_t *)y,1); + stop_meas(&ts); + } + + printf("\n\n1024-point - AVX2 (%f cycles)\n",(double)ts.diff/(double)ts.trials); +#endif + reset_meas(&ts); for (i=0; i<10000; i++) { @@ -16571,6 +18962,20 @@ int main(int argc, char**argv) } printf("\n\n2048-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); + +#ifdef __AVX2__ + + reset_meas(&ts); + + for (i=0; i<10000; i++) { + start_meas(&ts); + dft2048_simd256((int16_t *)x,(int16_t *)y,1); + stop_meas(&ts); + } + + printf("\n\n2048-point AVX2 (%f cycles)\n",(double)ts.diff/(double)ts.trials); + +#endif return(0); } From 62009b9a43878ff22bc5f1a5e7d49743560a4743 Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 16 Oct 2015 16:56:06 +0200 Subject: [PATCH 004/214] Sync for home --- .../attach_complete.pdml | 4242 +++++++++++++++++ .../enb.band7.tm1.usrpb210.epc.local.conf | 174 + openair3/TEST/EPC_TEST/generate_scenario.c | 339 +- openair3/TEST/EPC_TEST/generic_scenario.xsl | 46 + openair3/TEST/EPC_TEST/mme_test_s1_pcap2pdml | 24 +- 5 files changed, 4766 insertions(+), 59 deletions(-) create mode 100644 openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/attach_complete.pdml create mode 100644 openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb.band7.tm1.usrpb210.epc.local.conf create mode 100644 openair3/TEST/EPC_TEST/generic_scenario.xsl diff --git a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/attach_complete.pdml b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/attach_complete.pdml new file mode 100644 index 0000000000..fef45773f9 --- /dev/null +++ b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/attach_complete.pdml @@ -0,0 +1,4242 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb.band7.tm1.usrpb210.epc.local.conf b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb.band7.tm1.usrpb210.epc.local.conf new file mode 100644 index 0000000000..e864f47edb --- /dev/null +++ b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb.band7.tm1.usrpb210.epc.local.conf @@ -0,0 +1,174 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "95"; + + ////////// Physical parameters: + + component_carriers = ( + { + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2660000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 120; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -26; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -90; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -108; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + } + ); + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.188.2.2"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "tun2"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.188.2.2/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "lo"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.1/24"; + ENB_PORT_FOR_S1U = 2153; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + gtpu_log_level ="info"; + gtpu_log_verbosity ="medium"; + udp_log_level ="info"; + udp_log_verbosity ="medium"; + }; + + } +); diff --git a/openair3/TEST/EPC_TEST/generate_scenario.c b/openair3/TEST/EPC_TEST/generate_scenario.c index 6843766f95..eff91ea56f 100644 --- a/openair3/TEST/EPC_TEST/generate_scenario.c +++ b/openair3/TEST/EPC_TEST/generate_scenario.c @@ -43,6 +43,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -95,11 +98,64 @@ #define ENB_CONFIG_MAX_XSLT_PARAMS 64 Enb_properties_array_t g_enb_properties[2]; -char *g_test_dir = "."; // default value -char *g_pdml_in_basename = "trace.pdml"; // default value +char *g_openair_dir = NULL; +char *g_test_dir = NULL; +char *g_pdml_in_origin = NULL; +char *g_generic_scenario = NULL; extern int xmlLoadExtDtdDefaultValue; + +#define GENERATE_PDML_FILE 1 +#define GENERATE_GENERIC_SCENARIO 2 +#define GENERATE_DEDICATED_SCENARIO 4 + +#define GS_IS_FILE 1 +#define GS_IS_DIR 2 + //------------------------------------------------------------------------------ -void generate_scenario(const char const * pdml_in_basenameP) +// test if file exist in current directory +int is_file_exists( const char const * file_nameP, const char const *file_roleP) +{ + struct stat s; + int err = stat(file_nameP, &s); + if(-1 == err) { + if(ENOENT == errno) { + fprintf(stderr, "Please provide a valid %s, %s does not exist\n", file_roleP, file_nameP); + } else { + perror("stat"); + exit(1); + } + } else { + if(S_ISREG(s.st_mode)) { + return GS_IS_FILE; + } else if(S_ISDIR(s.st_mode)) { + return GS_IS_DIR; + } else { + fprintf(stderr, "Please provide a valid test %s, %s exists but is not found valid\n", file_roleP, file_nameP); + } + } + return 0; +} + +//------------------------------------------------------------------------------ +// return number of splitted items +int split_path( char * pathP, char *** resP) +{ + char * saveptr1; + char * p = strtok_r (pathP, "/", &saveptr1); + int n_spaces = 0; + + /// split string and append tokens to 'res' + while (p) { + *resP = realloc (*resP, sizeof (char*) * ++n_spaces); + AssertFatal (*resP, "realloc failed"); + (*resP)[n_spaces-1] = p; + p = strtok_r (NULL, "/", &saveptr1); + } + return n_spaces; +} + +//------------------------------------------------------------------------------ +void generate_generic_scenario(const char const * test_nameP, const char const * pdml_in_basenameP) //------------------------------------------------------------------------------ { //int fd_pdml_in; @@ -107,33 +163,58 @@ void generate_scenario(const char const * pdml_in_basenameP) xmlDocPtr doc, res; const char *params[ENB_CONFIG_MAX_XSLT_PARAMS]; int nb_params = 0; + int i,j; + char astring[1024]; + struct in_addr addr; - if (chdir(g_test_dir) == 0) { - printf( "working in %s directory\n", g_test_dir); - /*fd_pdml_in = open(pdml_in_basenameP, O_RDONLY); - AssertFatal (fd_pdml_in > 0, - "Error while opening %s file in directory %s\n", - pdml_in_basenameP, - g_test_dir);*/ - - params[nb_params] = NULL; - xmlSubstituteEntitiesDefault(1); - xmlLoadExtDtdDefaultValue = 1; - cur = xsltParseStylesheetFile("enb_config.xsl"); - doc = xmlParseFile(pdml_in_basenameP); - res = xsltApplyStylesheet(cur, doc, params); - xsltSaveResultToFile(stdout, res, cur); - - xsltFreeStylesheet(cur); - xmlFreeDoc(res); - xmlFreeDoc(doc); - - xsltCleanupGlobals(); - xmlCleanupParser(); + memset(astring, 0, sizeof(astring)); + if (getcwd(astring, sizeof(astring)) != NULL) { + fprintf(stdout, "working in %s directory\n", astring); } else { - printf("Error: chdir %s returned %s\n", g_test_dir, strerror(errno)); - exit(-1); + perror("getcwd() error"); + exit(1); } + + memset(astring, 0, sizeof(astring)); + strcat(astring, g_openair_dir); + strcat(astring, "/openair3/TEST/EPC_TEST/generic_scenario.xsl"); + + xmlSubstituteEntitiesDefault(1); + xmlLoadExtDtdDefaultValue = 1; + cur = xsltParseStylesheetFile(astring); + doc = xmlParseFile(pdml_in_basenameP); + params[nb_params++] = "test_name"; + sprintf(astring, "\"%s\"", test_nameP); + params[nb_params++] = strdup(astring); + + for (i = 0; i < g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_OLD].number; i++) { + // eNB S1-C IPv4 address + sprintf(astring, "enb_s1c%d", i); + params[nb_params++] = strdup(astring); + addr.s_addr = g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_OLD].properties[i]->enb_ipv4_address_for_S1_MME; + sprintf(astring, "\"%s\"", inet_ntoa(addr)); + params[nb_params++] = strdup(astring); + + // MME S1-C IPv4 address + for (j = 0; j < g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_OLD].properties[i]->nb_mme; j++) { + sprintf(astring, "mme_s1c%d_%d", i, j); + params[nb_params++] = strdup(astring); + AssertFatal (g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_OLD].properties[i]->mme_ip_address[j].ipv4_address, + "Only support MME IPv4 address\n"); + sprintf(astring, "\"%s\"", g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_OLD].properties[i]->mme_ip_address[j].ipv4_address); + params[nb_params++] = strdup(astring); + } + } + params[nb_params] = NULL; + res = xsltApplyStylesheet(cur, doc, params); + xsltSaveResultToFile(stdout, res, cur); + + xsltFreeStylesheet(cur); + xmlFreeDoc(res); + xmlFreeDoc(doc); + + xsltCleanupGlobals(); + xmlCleanupParser(); } //------------------------------------------------------------------------------ @@ -403,14 +484,77 @@ static void usage ( { fprintf (stdout, "Please report any bug to: openair4g-devel@lists.eurecom.fr\n\n"); fprintf (stdout, "Usage: %s [options]\n\n", argv[0]); + fprintf (stdout, "Mandatory options:\n"); + fprintf (stdout, "\t-t | --test-dir Directory where a set of files related to a particular test are located\n"); + fprintf (stdout, "\n"); fprintf (stdout, "Available options:\n"); - fprintf (stdout, "\t--help, -h Print this help and return\n"); - fprintf (stdout, "\t--new-enb-conf-file \n"); - fprintf (stdout, " Provide an updated eNB config file for generating a copy of the original test\n"); - fprintf (stdout, " This option is set as many times as there are some eNB config files in the original test\n"); - fprintf (stdout, "\t--old-enb-conf-file \n"); - fprintf (stdout, " Provide the old eNB config file for generating a copy of the original test\n"); - fprintf (stdout, " This option is set as many times as there are some eNB config files in the original test\n"); + fprintf (stdout, "\t-h | --help Print this help and return\n"); + fprintf (stdout, "\t-n | --new-enb-conf-file Provide an updated eNB config file for generating a copy of the original test\n"); + fprintf (stdout, " This option is set as many times as there are some eNB config files in the original test\n"); + fprintf (stdout, "\t-o | --old-enb-conf-file Provide the old eNB config file for generating a copy of the original test\n"); + fprintf (stdout, " This option is set as many times as there are some eNB config files in the original test\n"); + fprintf (stdout, "\t-p | --pdml File name (with no path) of an original scenario that has to be reworked (IP addresses) with new testbed\n"); + fprintf (stdout, "\t-s | --scenario-generic File name (with no path) of a scenario that has to be customized (IP addresses) with new testbed\n"); + fprintf (stdout, "\n"); + fprintf (stdout, "\n"); + fprintf (stdout, "Example of generate_scenario use cases: \n"); + fprintf (stdout, "\n"); + fprintf (stdout, " Case 1: generate a generix xml scenario from a captured pcap file: \n"); + fprintf (stdout, " +---------------------+ \n"); + fprintf (stdout, " |captured pcap-ng file| \n"); + fprintf (stdout, " +----------+----------+ \n"); + fprintf (stdout, " |\n"); + fprintf (stdout, " mme_test_s1_pcap2pdml \n"); + fprintf (stdout, " |\n"); + fprintf (stdout, " +--------V----------+ +------------------------+\n"); + fprintf (stdout, " |'pdml-in-orig' file| |'old-enb-conf-file' file|\n"); + fprintf (stdout, " +--------+----------+ +------------+-----------+\n"); + fprintf (stdout, " | |\n"); + fprintf (stdout, " +----------------------------+\n"); + fprintf (stdout, " |\n"); + fprintf (stdout, " generate_scenario -t -p -o \n"); + fprintf (stdout, " |\n"); + fprintf (stdout, " +------------V--------------+\n"); + fprintf (stdout, " +'xml-scenario-generic' file|\n"); + fprintf (stdout, " +---------------------------+\n"); + fprintf (stdout, "\n"); + fprintf (stdout, "\n"); + fprintf (stdout, " Case 2: generate a dedicated xml scenario from generic xml scenario:\n"); + fprintf (stdout, "\n"); + fprintf (stdout, " +---------------------------+ +------------------------+\n"); + fprintf (stdout, " |'xml-scenario-generic' file| |'new-enb-conf-file' file|\n"); + fprintf (stdout, " +--------+------------------+ +------------+-----------+\n"); + fprintf (stdout, " | |\n"); + fprintf (stdout, " +--------------------+---------------+\n"); + fprintf (stdout, " |\n"); + fprintf (stdout, " generate_scenario -t -s -n \n"); + fprintf (stdout, " |\n"); + fprintf (stdout, " +--------------V--------------+\n"); + fprintf (stdout, " +'xml-scenario-dedicated' file|\n"); + fprintf (stdout, " +-----------------------------+\n"); + fprintf (stdout, "\n"); + fprintf (stdout, "\n"); + fprintf (stdout, " Case 3 = case 1 + case 2: generate a dedicated xml scenario from a captured pcap file:\n"); + fprintf (stdout, "\n"); + fprintf (stdout, " +---------------------+\n"); + fprintf (stdout, " |captured pcap-ng file|\n"); + fprintf (stdout, " +----------+----------+\n"); + fprintf (stdout, " |\n"); + fprintf (stdout, " mme_test_s1_pcap2pdml \n"); + fprintf (stdout, " |\n"); + fprintf (stdout, " +------------------------+ +--------V----------+ +------------------------+\n"); + fprintf (stdout, " |'old-enb-conf-file' file| |'pdml-in-orig' file| |'new-enb-conf-file' file|\n"); + fprintf (stdout, " +------------+-----------+ +--------+----------+ +------------+-----------+\n"); + fprintf (stdout, " | | |\n"); + fprintf (stdout, " +----------------------+-------------------------+\n"); + fprintf (stdout, " |\n"); + fprintf (stdout, " V\n"); + fprintf (stdout, " generate_scenario -t -p -o -n \n"); + fprintf (stdout, " | ^ |\n"); + fprintf (stdout, " | | |\n"); + fprintf (stdout, " +--------------V------------+ +------------V----------------+\n"); + fprintf (stdout, " |'xml-scenario-generic' file| |'xml-scenario-dedicated' file|\n"); + fprintf (stdout, " +---------------------------+ +-----------------------------+\n"); } @@ -422,20 +566,29 @@ config_parse_opt_line ( //------------------------------------------------------------------------------ { int option; - char *enb_config_file_name = NULL; + int rv = 0; + char *new_enb_config_file_name = NULL; + char *old_enb_config_file_name = NULL; + char *pdml_in_file_name = NULL; + char *generic_scenario_file_name = NULL; + char *test_dir_name = NULL; enum long_option_e { LONG_OPTION_START = 0x100, /* Start after regular single char options */ LONG_OPTION_NEW_ENB_CONF_FILE, LONG_OPTION_OLD_ENB_CONF_FILE, - LONG_OPTION_PDML_IN_BASENAME, + LONG_OPTION_PDML, + LONG_OPTION_TEST_DIR, + LONG_OPTION_SCENARIO_GENERIC, LONG_OPTION_HELP, }; static struct option long_options[] = { {"old-enb-conf-file", required_argument, 0, LONG_OPTION_OLD_ENB_CONF_FILE}, {"new-enb-conf-file", required_argument, 0, LONG_OPTION_NEW_ENB_CONF_FILE}, - {"pdml_in_basename", required_argument, 0, LONG_OPTION_PDML_IN_BASENAME}, + {"pdml ", required_argument, 0, LONG_OPTION_PDML}, + {"test-dir", required_argument, 0, LONG_OPTION_TEST_DIR}, + {"scenario-generic", required_argument, 0, LONG_OPTION_SCENARIO_GENERIC}, {"help", required_argument, 0, LONG_OPTION_HELP}, {NULL, 0, NULL, 0} }; @@ -443,32 +596,53 @@ config_parse_opt_line ( /* * Parsing command line */ - while ((option = getopt_long (argc, argv, "hp:n:o", long_options, NULL)) != -1) { + while ((option = getopt_long (argc, argv, "hp:n:o:s:t", long_options, NULL)) != -1) { switch (option) { case LONG_OPTION_OLD_ENB_CONF_FILE: case 'o': if (optarg) { - enb_config_file_name = optarg; - printf("Old eNB config file name is %s\n", enb_config_file_name); - enb_config_init(enb_config_file_name, ENB_CONFIG_PROPERTIES_INDEX_OLD); - g_test_dir = strdup(dirname(enb_config_file_name)); + old_enb_config_file_name = optarg; + printf("Old eNB config file name is %s\n", old_enb_config_file_name); + rv |= GENERATE_GENERIC_SCENARIO; } break; case LONG_OPTION_NEW_ENB_CONF_FILE: case 'n': if (optarg) { - enb_config_file_name = optarg; - printf("New eNB config file name is %s\n", enb_config_file_name); - enb_config_init(enb_config_file_name, ENB_CONFIG_PROPERTIES_INDEX_NEW); + new_enb_config_file_name = optarg; + printf("New eNB config file name is %s\n", new_enb_config_file_name); + rv |= GENERATE_DEDICATED_SCENARIO; } break; - case LONG_OPTION_PDML_IN_BASENAME: + case LONG_OPTION_PDML: case 'p': if (optarg) { - g_pdml_in_basename = strdup(optarg); - printf("PDML input file name is %s\n", g_pdml_in_basename); + pdml_in_file_name = strdup(optarg); + printf("PDML input file name is %s\n", pdml_in_file_name); + rv |= GENERATE_GENERIC_SCENARIO; + } + break; + + case LONG_OPTION_TEST_DIR: + case 't': + if (optarg) { + test_dir_name = strdup(optarg); + if (is_file_exists(test_dir_name, "test dirname") != GS_IS_DIR) { + fprintf(stderr, "Please provide a valid test dirname, %s is not a valid directory name\n", test_dir_name); + exit(1); + } + printf("Test dir name is %s\n", test_dir_name); + } + break; + + case LONG_OPTION_SCENARIO_GENERIC: + case 's': + if (optarg) { + generic_scenario_file_name = strdup(optarg); + printf("Generic XML scenario input file name is %s\n", generic_scenario_file_name); + rv |= GENERATE_DEDICATED_SCENARIO; } break; @@ -479,18 +653,77 @@ config_parse_opt_line ( exit (0); } } - return 0; + if (NULL == test_dir_name) { + fprintf(stderr, "Please provide a valid test dirname\n"); + exit(1); + } + g_test_dir = test_dir_name; test_dir_name = NULL; + if (chdir(g_test_dir) != 0) { + fprintf(stderr, "Error: chdir %s returned %s\n", g_test_dir, strerror(errno)); + exit(1); + } + if (rv & GENERATE_GENERIC_SCENARIO) { + if (NULL == old_enb_config_file_name) { + fprintf(stderr, "Error: please provide the original eNB config file name that should be in %s\n", g_test_dir); + } + if (is_file_exists(old_enb_config_file_name, "Old eNB config file") != GS_IS_FILE) { + fprintf(stderr, "Error: original eNB config file name %s is not found in dir %s\n", old_enb_config_file_name, g_test_dir); + } + enb_config_display(ENB_CONFIG_PROPERTIES_INDEX_OLD); + enb_config_init(old_enb_config_file_name, ENB_CONFIG_PROPERTIES_INDEX_OLD); + + if (NULL == pdml_in_file_name) { + fprintf(stderr, "Error: please provide the PDML file name that should be in %s\n", g_test_dir); + } + if (is_file_exists(pdml_in_file_name, "PDML file") != GS_IS_FILE) { + fprintf(stderr, "Error: PDML file name %s is not found in dir %s\n", pdml_in_file_name, g_test_dir); + } + g_pdml_in_origin = pdml_in_file_name; pdml_in_file_name = NULL; + } + + if (rv & GENERATE_DEDICATED_SCENARIO) { + if (NULL == new_enb_config_file_name) { + fprintf(stderr, "Error: please provide the new eNB config file name that should be in %s\n", g_test_dir); + } + if (is_file_exists(new_enb_config_file_name, "New eNB config file") != GS_IS_FILE) { + fprintf(stderr, "Error: New eNB config file name %s is not found in dir %s\n", new_enb_config_file_name, g_test_dir); + } + enb_config_display(ENB_CONFIG_PROPERTIES_INDEX_NEW); + enb_config_init(new_enb_config_file_name, ENB_CONFIG_PROPERTIES_INDEX_NEW); + + if (NULL == generic_scenario_file_name) { + fprintf(stderr, "Error: please provide the Generic scenario file name that should be in %s\n", g_test_dir); + } + if (is_file_exists(generic_scenario_file_name, "Generic scenario file") != GS_IS_FILE) { + fprintf(stderr, "Error: Generic scenario file name %s is not found in dir %s\n", generic_scenario_file_name, g_test_dir); + } + g_generic_scenario = generic_scenario_file_name; generic_scenario_file_name = NULL; + } + return rv; } //------------------------------------------------------------------------------ int main( int argc, char **argv ) //------------------------------------------------------------------------------ { + int actions = 0; + + g_openair_dir = getenv("OPENAIR_DIR"); + if (NULL == g_openair_dir) { + fprintf(stderr, "Error: Could not get OPENAIR_DIR environment variable\n"); + exit(1); + } + memset((char*) &g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_OLD], 0 , sizeof(g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_OLD])); memset((char*) &g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_NEW], 0 , sizeof(g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_NEW])); - config_parse_opt_line (argc, argv); //Command-line options - enb_config_display(ENB_CONFIG_PROPERTIES_INDEX_OLD); - enb_config_display(ENB_CONFIG_PROPERTIES_INDEX_NEW); - generate_scenario(g_pdml_in_basename); + + actions = config_parse_opt_line (argc, argv); //Command-line options + if (actions & GENERATE_GENERIC_SCENARIO) { + generate_generic_scenario(g_test_dir, g_pdml_in_origin); + } + /*if (actions & GENERATE_DEDICATED_SCENARIO) { + generate_dedicated_scenario(g_test_dir, g_pdml_in_origin); + }*/ + return 0; } diff --git a/openair3/TEST/EPC_TEST/generic_scenario.xsl b/openair3/TEST/EPC_TEST/generic_scenario.xsl new file mode 100644 index 0000000000..99672a28f0 --- /dev/null +++ b/openair3/TEST/EPC_TEST/generic_scenario.xsl @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/openair3/TEST/EPC_TEST/mme_test_s1_pcap2pdml b/openair3/TEST/EPC_TEST/mme_test_s1_pcap2pdml index b0a77e60f5..796fa9a45b 100755 --- a/openair3/TEST/EPC_TEST/mme_test_s1_pcap2pdml +++ b/openair3/TEST/EPC_TEST/mme_test_s1_pcap2pdml @@ -35,14 +35,25 @@ packets = orig_dom.getElementsByTagName("packet") for packet in packets: found_sctp = False found_s1ap = False + sctp_node = None + frame_node = None + ip_node = None protos = packet.getElementsByTagName("proto") for proto in protos: attrs = proto.attributes urlnode = attrs['name'] - if urlnode.nodeValue == 'sctp': + if urlnode.nodeValue == 'frame': + frame_node = proto + elif urlnode.nodeValue == 'ip': + frame_node.appendChild(proto) + ip_node = proto + elif urlnode.nodeValue == 'sctp': found_sctp = True + ip_node.appendChild(proto) + sctp_node = proto elif urlnode.nodeValue == 's1ap': found_s1ap = True + sctp_node.appendChild(proto) elif urlnode.nodeValue == 'geninfo': packet.removeChild(proto) elif urlnode.nodeValue == 'eth': @@ -54,20 +65,21 @@ for packet in packets: ##################### # dom to xml string ##################### -filtered_pdml_string = orig_dom.toxml() +filtered_pdml_string = orig_dom.toprettyxml(indent=" ") cleaned_pdml_string = "" ##################### # remove blank lines in xml string ##################### lines = filtered_pdml_string.splitlines() for line in lines: - if line[:-1]: - cleaned_pdml_string += line + '\r\n' + if len(line.strip()): + if line[:-1]: + cleaned_pdml_string += line + '\r\n' #print "'%s'" % cleaned_pdml_string ##################### # write pdml string to pdml file ##################### -out_pdml_file_name = os.path.dirname(orig_pcap_file_name) + os.path.splitext(os.path.basename(orig_pcap_file_name))[0] + '.pdml' +out_pdml_file_name = os.path.dirname(orig_pcap_file_name) + '/' + os.path.splitext(os.path.basename(orig_pcap_file_name))[0] + '.pdml' out_file = open(out_pdml_file_name, "w") out_file.write(cleaned_pdml_string) out_file.close() @@ -86,7 +98,7 @@ filtered_html_string = etree.tostring(trans_root) ##################### # write html string to html file ##################### -out_html_file_name = os.path.dirname(orig_pcap_file_name) + os.path.splitext(os.path.basename(orig_pcap_file_name))[0] + '.html' +out_html_file_name = os.path.dirname(orig_pcap_file_name) + '/' +os.path.splitext(os.path.basename(orig_pcap_file_name))[0] + '.html' out_file = open(out_html_file_name, "w") out_file.write(filtered_html_string) out_file.close() From 5c05f3f4cb64222afc94e5d6e411d8a09a67811d Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 21 Oct 2015 11:42:07 +0200 Subject: [PATCH 005/214] fixed run script to enable fixed number of frames for simulation --- cmake_targets/tools/run_enb_ue_virt_noS1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake_targets/tools/run_enb_ue_virt_noS1 b/cmake_targets/tools/run_enb_ue_virt_noS1 index 74abe0de02..f5ed770f80 100755 --- a/cmake_targets/tools/run_enb_ue_virt_noS1 +++ b/cmake_targets/tools/run_enb_ue_virt_noS1 @@ -71,6 +71,7 @@ function help() echo_error " and PDCP-LTE. Then capture for all the interfaces with the following filters: s1ap or lte_rrc or mac-lte or rlc-lte" echo_error " or pdcp-lte. Note the L2 pdus are transmitted to the local interface." echo_error " -x, --xforms Run XFORMS scope windows." + echo_error " -n, --num-frames Set number of frames for simulation" } @@ -165,6 +166,11 @@ function main() exe_arguments="$exe_arguments -P wireshark" shift 1; ;; + -n | --num-frames) + echo "setting the number of frames in simulation to $2" + exe_arguments="$exe_arguments -n $2" + shift 2; + ;; *) echo "Unknown option $1" help From e8c40e78efc35ad3c284c494a718b42cffb68b9f Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 4 Nov 2015 10:57:03 +0100 Subject: [PATCH 006/214] generated an initial 'generic' scenario. --- openair3/TEST/EPC_TEST/generate_scenario.c | 69 ++++++- openair3/TEST/EPC_TEST/generic_scenario.xsl | 214 +++++++++++++++++++- 2 files changed, 264 insertions(+), 19 deletions(-) diff --git a/openair3/TEST/EPC_TEST/generate_scenario.c b/openair3/TEST/EPC_TEST/generate_scenario.c index eff91ea56f..c5289142b5 100644 --- a/openair3/TEST/EPC_TEST/generate_scenario.c +++ b/openair3/TEST/EPC_TEST/generate_scenario.c @@ -36,6 +36,7 @@ */ #include +#include #include #include #include @@ -95,7 +96,7 @@ #define ENB_CONFIG_PROPERTIES_INDEX_OLD 0 #define ENB_CONFIG_PROPERTIES_INDEX_NEW 1 -#define ENB_CONFIG_MAX_XSLT_PARAMS 64 +#define ENB_CONFIG_MAX_XSLT_PARAMS 32 Enb_properties_array_t g_enb_properties[2]; char *g_openair_dir = NULL; @@ -136,6 +137,25 @@ int is_file_exists( const char const * file_nameP, const char const *file_roleP) return 0; } + +//------------------------------------------------------------------------------ +int strip_extension(char *in_filename) +{ + static const uint8_t name_min_len = 1; + static const uint8_t max_ext_len = 5; // .pdml ! + fprintf(stdout, "strip_extension %s\n", in_filename); + + if (NULL != in_filename) { + /* Check chars starting at end of string to find last '.' */ + for (ssize_t i = strlen(in_filename); i > (name_min_len + max_ext_len); i--) { + if (in_filename[i] == '.') { + in_filename[i] = '\0'; + return i; + } + } + } + return -1; +} //------------------------------------------------------------------------------ // return number of splitted items int split_path( char * pathP, char *** resP) @@ -155,18 +175,21 @@ int split_path( char * pathP, char *** resP) } //------------------------------------------------------------------------------ -void generate_generic_scenario(const char const * test_nameP, const char const * pdml_in_basenameP) +int generate_generic_scenario(const char const * test_nameP, const char const * pdml_in_basenameP) //------------------------------------------------------------------------------ { //int fd_pdml_in; xsltStylesheetPtr cur = NULL; xmlDocPtr doc, res; - const char *params[ENB_CONFIG_MAX_XSLT_PARAMS]; + FILE *generic_scenario_file = NULL; + const char generic_scenario_filename[NAME_MAX]; + const char *params[2*ENB_CONFIG_MAX_XSLT_PARAMS]; int nb_params = 0; int i,j; char astring[1024]; struct in_addr addr; + memset(generic_scenario_filename, 0, sizeof(generic_scenario_filename)); memset(astring, 0, sizeof(astring)); if (getcwd(astring, sizeof(astring)) != NULL) { fprintf(stdout, "working in %s directory\n", astring); @@ -182,7 +205,18 @@ void generate_generic_scenario(const char const * test_nameP, const char const * xmlSubstituteEntitiesDefault(1); xmlLoadExtDtdDefaultValue = 1; cur = xsltParseStylesheetFile(astring); + if (NULL == cur) { + AssertFatal (0, "Could not parse stylesheet file %s (check OPENAIR_DIR env variable)!\n", astring); + } else { + fprintf(stdout, "XSLT style sheet: %s\n", astring); + } + doc = xmlParseFile(pdml_in_basenameP); + if (NULL == doc) { + AssertFatal (0, "Could not parse pdml file %s!\n", pdml_in_basenameP); + } else { + fprintf(stdout, "pdml file: %s\n", pdml_in_basenameP); + } params[nb_params++] = "test_name"; sprintf(astring, "\"%s\"", test_nameP); params[nb_params++] = strdup(astring); @@ -207,8 +241,25 @@ void generate_generic_scenario(const char const * test_nameP, const char const * } params[nb_params] = NULL; res = xsltApplyStylesheet(cur, doc, params); - xsltSaveResultToFile(stdout, res, cur); - + if (NULL != res) { + // since pdml filename is not relative (no path), just filename in current directory we can safely remove + sprintf(generic_scenario_filename,"%s",pdml_in_basenameP); + if (strip_extension(generic_scenario_filename) > 0) { + strcat(generic_scenario_filename, "_generic_scenario.xml"); + generic_scenario_file = fopen( generic_scenario_filename, "w+"); + if (NULL != generic_scenario_file) { + xsltSaveResultToFile(generic_scenario_file, res, cur); + fclose(generic_scenario_file); + fprintf(stdout, "Wrote generic scenario to %s\n", generic_scenario_filename); + } else { + fprintf(stderr, "Error in fopen(%s)\n", generic_scenario_filename); + } + } else { + fprintf(stderr, "Error in strip_extension()\n"); + } + } else { + fprintf(stderr, "Error in xsltApplyStylesheet()\n"); + } xsltFreeStylesheet(cur); xmlFreeDoc(res); xmlFreeDoc(doc); @@ -494,7 +545,7 @@ static void usage ( fprintf (stdout, "\t-o | --old-enb-conf-file Provide the old eNB config file for generating a copy of the original test\n"); fprintf (stdout, " This option is set as many times as there are some eNB config files in the original test\n"); fprintf (stdout, "\t-p | --pdml File name (with no path) of an original scenario that has to be reworked (IP addresses) with new testbed\n"); - fprintf (stdout, "\t-s | --scenario-generic File name (with no path) of a scenario that has to be customized (IP addresses) with new testbed\n"); + fprintf (stdout, "\t-s | --scenario-generic File name (with no path) of a scenario that has to be customized (IP addresses) with new testbed\n"); fprintf (stdout, "\n"); fprintf (stdout, "\n"); fprintf (stdout, "Example of generate_scenario use cases: \n"); @@ -596,7 +647,7 @@ config_parse_opt_line ( /* * Parsing command line */ - while ((option = getopt_long (argc, argv, "hp:n:o:s:t", long_options, NULL)) != -1) { + while ((option = getopt_long (argc, argv, "hp:n:o:s:t:", long_options, NULL)) != -1) { switch (option) { case LONG_OPTION_OLD_ENB_CONF_FILE: case 'o': @@ -669,8 +720,8 @@ config_parse_opt_line ( if (is_file_exists(old_enb_config_file_name, "Old eNB config file") != GS_IS_FILE) { fprintf(stderr, "Error: original eNB config file name %s is not found in dir %s\n", old_enb_config_file_name, g_test_dir); } - enb_config_display(ENB_CONFIG_PROPERTIES_INDEX_OLD); enb_config_init(old_enb_config_file_name, ENB_CONFIG_PROPERTIES_INDEX_OLD); + enb_config_display(ENB_CONFIG_PROPERTIES_INDEX_OLD); if (NULL == pdml_in_file_name) { fprintf(stderr, "Error: please provide the PDML file name that should be in %s\n", g_test_dir); @@ -688,8 +739,8 @@ config_parse_opt_line ( if (is_file_exists(new_enb_config_file_name, "New eNB config file") != GS_IS_FILE) { fprintf(stderr, "Error: New eNB config file name %s is not found in dir %s\n", new_enb_config_file_name, g_test_dir); } - enb_config_display(ENB_CONFIG_PROPERTIES_INDEX_NEW); enb_config_init(new_enb_config_file_name, ENB_CONFIG_PROPERTIES_INDEX_NEW); + enb_config_display(ENB_CONFIG_PROPERTIES_INDEX_NEW); if (NULL == generic_scenario_file_name) { fprintf(stderr, "Error: please provide the Generic scenario file name that should be in %s\n", g_test_dir); diff --git a/openair3/TEST/EPC_TEST/generic_scenario.xsl b/openair3/TEST/EPC_TEST/generic_scenario.xsl index 99672a28f0..ab0e7f1123 100644 --- a/openair3/TEST/EPC_TEST/generic_scenario.xsl +++ b/openair3/TEST/EPC_TEST/generic_scenario.xsl @@ -8,16 +8,103 @@ encoding="iso-8859-1" /> - + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + enb_s1c0 + enb_s1c1 + enb_s1c2 + enb_s1c3 + enb_s1c4 + enb_s1c5 + mme_s1c0_0 + mme_s1c0_1 + mme_s1c0_2 + mme_s1c0_3 + mme_s1c1_0 + mme_s1c1_1 + mme_s1c1_2" + mme_s1c1_3 + reverse_ip_yourself + + + + + + + DATA + INIT + INIT_ACK + SACK + HEARTBEAT + HEARTBEAT_ACK + ABORT + SHUTDOWN + SHUTDOWN_ACK + ERROR + COOKIE_ECHO + COOKIE_ACK + ECNE + CWR + SHUTDOWN_COMPLETE + UNKNOWN_CHUNK_TYPE + + + + + + + + + + + + + - - - + + + + + + + + + + + @@ -25,22 +112,129 @@ - + + + + + + + + + - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - From 12b871086da60688b7d15aeac269345e533b9c6c Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 4 Nov 2015 12:26:41 +0100 Subject: [PATCH 007/214] Removed dedicated scenario option, fixed scenario name(xml attribute) = pdml filename --- openair3/TEST/EPC_TEST/generate_scenario.c | 212 +++++++-------------- openair3/TEST/EPC_TEST/generate_scenario.h | 2 +- 2 files changed, 65 insertions(+), 149 deletions(-) diff --git a/openair3/TEST/EPC_TEST/generate_scenario.c b/openair3/TEST/EPC_TEST/generate_scenario.c index c5289142b5..4cb21f9604 100644 --- a/openair3/TEST/EPC_TEST/generate_scenario.c +++ b/openair3/TEST/EPC_TEST/generate_scenario.c @@ -93,12 +93,10 @@ #define ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U "ENB_IPV4_ADDRESS_FOR_S1U" #define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U" -#define ENB_CONFIG_PROPERTIES_INDEX_OLD 0 -#define ENB_CONFIG_PROPERTIES_INDEX_NEW 1 #define ENB_CONFIG_MAX_XSLT_PARAMS 32 -Enb_properties_array_t g_enb_properties[2]; +Enb_properties_array_t g_enb_properties; char *g_openair_dir = NULL; char *g_test_dir = NULL; char *g_pdml_in_origin = NULL; @@ -107,7 +105,6 @@ extern int xmlLoadExtDtdDefaultValue; #define GENERATE_PDML_FILE 1 #define GENERATE_GENERIC_SCENARIO 2 -#define GENERATE_DEDICATED_SCENARIO 4 #define GS_IS_FILE 1 #define GS_IS_DIR 2 @@ -187,6 +184,7 @@ int generate_generic_scenario(const char const * test_nameP, const char const * int nb_params = 0; int i,j; char astring[1024]; + char *astring2 = NULL; struct in_addr addr; memset(generic_scenario_filename, 0, sizeof(generic_scenario_filename)); @@ -218,24 +216,32 @@ int generate_generic_scenario(const char const * test_nameP, const char const * fprintf(stdout, "pdml file: %s\n", pdml_in_basenameP); } params[nb_params++] = "test_name"; - sprintf(astring, "\"%s\"", test_nameP); + sprintf(astring, "%s", pdml_in_basenameP); + if (strip_extension(astring) > 0) { + astring2 = strdup(astring); + sprintf(astring, "\"%s\"", astring2); + free(astring2); + astring2 = NULL; + } else { + fprintf(stderr, "Assigning test name failed: %s\n", astring); + } params[nb_params++] = strdup(astring); - for (i = 0; i < g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_OLD].number; i++) { + for (i = 0; i < g_enb_properties.number; i++) { // eNB S1-C IPv4 address sprintf(astring, "enb_s1c%d", i); params[nb_params++] = strdup(astring); - addr.s_addr = g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_OLD].properties[i]->enb_ipv4_address_for_S1_MME; + addr.s_addr = g_enb_properties.properties[i]->enb_ipv4_address_for_S1_MME; sprintf(astring, "\"%s\"", inet_ntoa(addr)); params[nb_params++] = strdup(astring); // MME S1-C IPv4 address - for (j = 0; j < g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_OLD].properties[i]->nb_mme; j++) { + for (j = 0; j < g_enb_properties.properties[i]->nb_mme; j++) { sprintf(astring, "mme_s1c%d_%d", i, j); params[nb_params++] = strdup(astring); - AssertFatal (g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_OLD].properties[i]->mme_ip_address[j].ipv4_address, + AssertFatal (g_enb_properties.properties[i]->mme_ip_address[j].ipv4_address, "Only support MME IPv4 address\n"); - sprintf(astring, "\"%s\"", g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_OLD].properties[i]->mme_ip_address[j].ipv4_address); + sprintf(astring, "\"%s\"", g_enb_properties.properties[i]->mme_ip_address[j].ipv4_address); params[nb_params++] = strdup(astring); } } @@ -269,26 +275,26 @@ int generate_generic_scenario(const char const * test_nameP, const char const * } //------------------------------------------------------------------------------ -static void enb_config_display(const boolean_t new_config_fileP) +static void enb_config_display(void) //------------------------------------------------------------------------------ { int i; printf( "\n----------------------------------------------------------------------\n"); - printf( " %s ENB CONFIG FILE CONTENT LOADED:\n", new_config_fileP == ENB_CONFIG_PROPERTIES_INDEX_OLD ? "Old":"New"); + printf( " ENB CONFIG FILE CONTENT LOADED:\n"); printf( "----------------------------------------------------------------------\n"); - for (i = 0; i < g_enb_properties[new_config_fileP].number; i++) { + for (i = 0; i < g_enb_properties.number; i++) { printf( "ENB CONFIG for instance %u:\n\n", i); - printf( "\teNB name: \t%s\n",g_enb_properties[new_config_fileP].properties[i]->eNB_name); - printf( "\teNB ID: \t%"PRIu32"\n",g_enb_properties[new_config_fileP].properties[i]->eNB_id); - printf( "\tCell type: \t%s\n",g_enb_properties[new_config_fileP].properties[i]->cell_type == CELL_MACRO_ENB ? "CELL_MACRO_ENB":"CELL_HOME_ENB"); - printf( "\tTAC: \t%"PRIu16"\n",g_enb_properties[new_config_fileP].properties[i]->tac); - printf( "\tMCC: \t%"PRIu16"\n",g_enb_properties[new_config_fileP].properties[i]->mcc); + printf( "\teNB name: \t%s\n",g_enb_properties.properties[i]->eNB_name); + printf( "\teNB ID: \t%"PRIu32"\n",g_enb_properties.properties[i]->eNB_id); + printf( "\tCell type: \t%s\n",g_enb_properties.properties[i]->cell_type == CELL_MACRO_ENB ? "CELL_MACRO_ENB":"CELL_HOME_ENB"); + printf( "\tTAC: \t%"PRIu16"\n",g_enb_properties.properties[i]->tac); + printf( "\tMCC: \t%"PRIu16"\n",g_enb_properties.properties[i]->mcc); - if (g_enb_properties[new_config_fileP].properties[i]->mnc_digit_length == 3) { - printf( "\tMNC: \t%03"PRIu16"\n",g_enb_properties[new_config_fileP].properties[i]->mnc); + if (g_enb_properties.properties[i]->mnc_digit_length == 3) { + printf( "\tMNC: \t%03"PRIu16"\n",g_enb_properties.properties[i]->mnc); } else { - printf( "\tMNC: \t%02"PRIu16"\n",g_enb_properties[new_config_fileP].properties[i]->mnc); + printf( "\tMNC: \t%02"PRIu16"\n",g_enb_properties.properties[i]->mnc); } printf( "\n--------------------------------------------------------\n"); } @@ -301,7 +307,7 @@ static void enb_config_display(const boolean_t new_config_fileP) #define libconfig_int int #endif //------------------------------------------------------------------------------ -void enb_config_init(const char const * lib_config_file_name_pP, const boolean_t new_config_fileP) +void enb_config_init(const char const * lib_config_file_name_pP) //------------------------------------------------------------------------------ { config_t cfg; @@ -336,9 +342,7 @@ void enb_config_init(const char const * lib_config_file_name_pP, const boolean_ char *address = NULL; char *cidr = NULL; - AssertFatal ((new_config_fileP == 0) || (new_config_fileP == 1), - "Bad parameter new_config_fileP %d \n", - new_config_fileP); + AssertFatal (lib_config_file_name_pP != NULL, "Bad parameter lib_config_file_name_pP %s , must reference a valid eNB config file\n", lib_config_file_name_pP); @@ -374,7 +378,7 @@ void enb_config_init(const char const * lib_config_file_name_pP, const boolean_ setting = config_lookup(&cfg, ENB_CONFIG_STRING_ENB_LIST); if (setting != NULL) { - enb_properties_index = g_enb_properties[new_config_fileP].number; + enb_properties_index = g_enb_properties.number; parse_errors = 0; num_enbs = config_setting_length(setting); @@ -411,34 +415,34 @@ void enb_config_init(const char const * lib_config_file_name_pP, const boolean_ // search if in active list for (j=0; j < num_enb_properties; j++) { if (strcmp(active_enb[j], enb_name) == 0) { - g_enb_properties[new_config_fileP].properties[enb_properties_index] = calloc(1, sizeof(Enb_properties_t)); + g_enb_properties.properties[enb_properties_index] = calloc(1, sizeof(Enb_properties_t)); - g_enb_properties[new_config_fileP].properties[enb_properties_index]->eNB_id = enb_id; + g_enb_properties.properties[enb_properties_index]->eNB_id = enb_id; if (strcmp(cell_type, "CELL_MACRO_ENB") == 0) { - g_enb_properties[new_config_fileP].properties[enb_properties_index]->cell_type = CELL_MACRO_ENB; + g_enb_properties.properties[enb_properties_index]->cell_type = CELL_MACRO_ENB; } else if (strcmp(cell_type, "CELL_HOME_ENB") == 0) { - g_enb_properties[new_config_fileP].properties[enb_properties_index]->cell_type = CELL_HOME_ENB; + g_enb_properties.properties[enb_properties_index]->cell_type = CELL_HOME_ENB; } else { AssertError (0, parse_errors ++, "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n", lib_config_file_name_pP, i, cell_type); } - g_enb_properties[new_config_fileP].properties[enb_properties_index]->eNB_name = strdup(enb_name); - g_enb_properties[new_config_fileP].properties[enb_properties_index]->tac = (uint16_t)atoi(tac); - g_enb_properties[new_config_fileP].properties[enb_properties_index]->mcc = (uint16_t)atoi(mcc); - g_enb_properties[new_config_fileP].properties[enb_properties_index]->mnc = (uint16_t)atoi(mnc); - g_enb_properties[new_config_fileP].properties[enb_properties_index]->mnc_digit_length = strlen(mnc); - AssertFatal((g_enb_properties[new_config_fileP].properties[enb_properties_index]->mnc_digit_length == 2) || - (g_enb_properties[new_config_fileP].properties[enb_properties_index]->mnc_digit_length == 3), + g_enb_properties.properties[enb_properties_index]->eNB_name = strdup(enb_name); + g_enb_properties.properties[enb_properties_index]->tac = (uint16_t)atoi(tac); + g_enb_properties.properties[enb_properties_index]->mcc = (uint16_t)atoi(mcc); + g_enb_properties.properties[enb_properties_index]->mnc = (uint16_t)atoi(mnc); + g_enb_properties.properties[enb_properties_index]->mnc_digit_length = strlen(mnc); + AssertFatal((g_enb_properties.properties[enb_properties_index]->mnc_digit_length == 2) || + (g_enb_properties.properties[enb_properties_index]->mnc_digit_length == 3), "BAD MNC DIGIT LENGTH %d", - g_enb_properties[new_config_fileP].properties[i]->mnc_digit_length); + g_enb_properties.properties[i]->mnc_digit_length); setting_mme_addresses = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_MME_IP_ADDRESS); num_mme_address = config_setting_length(setting_mme_addresses); - g_enb_properties[new_config_fileP].properties[enb_properties_index]->nb_mme = 0; + g_enb_properties.properties[enb_properties_index]->nb_mme = 0; for (j = 0; j < num_mme_address; j++) { setting_mme_address = config_setting_get_elem(setting_mme_addresses, j); @@ -456,22 +460,22 @@ void enb_config_init(const char const * lib_config_file_name_pP, const boolean_ continue; // FIXME will prevent segfaults below, not sure what happens at function exit... } - g_enb_properties[new_config_fileP].properties[enb_properties_index]->nb_mme += 1; + g_enb_properties.properties[enb_properties_index]->nb_mme += 1; - g_enb_properties[new_config_fileP].properties[enb_properties_index]->mme_ip_address[j].ipv4_address = strdup(ipv4); - g_enb_properties[new_config_fileP].properties[enb_properties_index]->mme_ip_address[j].ipv6_address = strdup(ipv6); + g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4_address = strdup(ipv4); + g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6_address = strdup(ipv6); if (strcmp(active, "yes") == 0) { - g_enb_properties[new_config_fileP].properties[enb_properties_index]->mme_ip_address[j].active = 1; + g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].active = 1; } // else { (calloc) if (strcmp(preference, "ipv4") == 0) { - g_enb_properties[new_config_fileP].properties[enb_properties_index]->mme_ip_address[j].ipv4 = 1; + g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4 = 1; } else if (strcmp(preference, "ipv6") == 0) { - g_enb_properties[new_config_fileP].properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1; + g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1; } else if (strcmp(preference, "no") == 0) { - g_enb_properties[new_config_fileP].properties[enb_properties_index]->mme_ip_address[j].ipv4 = 1; - g_enb_properties[new_config_fileP].properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1; + g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4 = 1; + g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1; } } @@ -493,22 +497,22 @@ void enb_config_init(const char const * lib_config_file_name_pP, const boolean_ &enb_port_for_S1U) ) ) { - g_enb_properties[new_config_fileP].properties[enb_properties_index]->enb_interface_name_for_S1U = strdup(enb_interface_name_for_S1U); + g_enb_properties.properties[enb_properties_index]->enb_interface_name_for_S1U = strdup(enb_interface_name_for_S1U); cidr = enb_ipv4_address_for_S1U; address = strtok(cidr, "/"); if (address) { - IPV4_STR_ADDR_TO_INT_NWBO ( address, g_enb_properties[new_config_fileP].properties[enb_properties_index]->enb_ipv4_address_for_S1U, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" ); + IPV4_STR_ADDR_TO_INT_NWBO ( address, g_enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1U, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" ); } - g_enb_properties[new_config_fileP].properties[enb_properties_index]->enb_port_for_S1U = enb_port_for_S1U; + g_enb_properties.properties[enb_properties_index]->enb_port_for_S1U = enb_port_for_S1U; - g_enb_properties[new_config_fileP].properties[enb_properties_index]->enb_interface_name_for_S1_MME = strdup(enb_interface_name_for_S1_MME); + g_enb_properties.properties[enb_properties_index]->enb_interface_name_for_S1_MME = strdup(enb_interface_name_for_S1_MME); cidr = enb_ipv4_address_for_S1_MME; address = strtok(cidr, "/"); if (address) { - IPV4_STR_ADDR_TO_INT_NWBO ( address, g_enb_properties[new_config_fileP].properties[enb_properties_index]->enb_ipv4_address_for_S1_MME, "BAD IP ADDRESS FORMAT FOR eNB S1_MME !\n" ); + IPV4_STR_ADDR_TO_INT_NWBO ( address, g_enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1_MME, "BAD IP ADDRESS FORMAT FOR eNB S1_MME !\n" ); } } } // if (subsetting != NULL) { @@ -518,7 +522,7 @@ void enb_config_init(const char const * lib_config_file_name_pP, const boolean_ } // for (i = 0; i < num_enbs; i++) } // if (setting != NULL) { - g_enb_properties[new_config_fileP].number += num_enb_properties; + g_enb_properties.number += num_enb_properties; AssertFatal (parse_errors == 0, @@ -540,22 +544,19 @@ static void usage ( fprintf (stdout, "\n"); fprintf (stdout, "Available options:\n"); fprintf (stdout, "\t-h | --help Print this help and return\n"); - fprintf (stdout, "\t-n | --new-enb-conf-file Provide an updated eNB config file for generating a copy of the original test\n"); - fprintf (stdout, " This option is set as many times as there are some eNB config files in the original test\n"); fprintf (stdout, "\t-o | --old-enb-conf-file Provide the old eNB config file for generating a copy of the original test\n"); fprintf (stdout, " This option is set as many times as there are some eNB config files in the original test\n"); fprintf (stdout, "\t-p | --pdml File name (with no path) of an original scenario that has to be reworked (IP addresses) with new testbed\n"); - fprintf (stdout, "\t-s | --scenario-generic File name (with no path) of a scenario that has to be customized (IP addresses) with new testbed\n"); fprintf (stdout, "\n"); fprintf (stdout, "\n"); - fprintf (stdout, "Example of generate_scenario use cases: \n"); + fprintf (stdout, "Example of generate_scenario use case: \n"); fprintf (stdout, "\n"); - fprintf (stdout, " Case 1: generate a generix xml scenario from a captured pcap file: \n"); + fprintf (stdout, " Generate a generix xml scenario from a captured pcap file: \n"); fprintf (stdout, " +---------------------+ \n"); fprintf (stdout, " |captured pcap-ng file| \n"); fprintf (stdout, " +----------+----------+ \n"); fprintf (stdout, " |\n"); - fprintf (stdout, " mme_test_s1_pcap2pdml \n"); + fprintf (stdout, " mme_test_s1_pcap2pdml --pcap_file <`captured pcap-ng file`>\n"); fprintf (stdout, " |\n"); fprintf (stdout, " +--------V----------+ +------------------------+\n"); fprintf (stdout, " |'pdml-in-orig' file| |'old-enb-conf-file' file|\n"); @@ -563,52 +564,14 @@ static void usage ( fprintf (stdout, " | |\n"); fprintf (stdout, " +----------------------------+\n"); fprintf (stdout, " |\n"); - fprintf (stdout, " generate_scenario -t -p -o \n"); + fprintf (stdout, " generate_scenario -t -p <'pdml-in-orig' file> -o <'old-enb-conf-file' file> \n"); fprintf (stdout, " |\n"); fprintf (stdout, " +------------V--------------+\n"); fprintf (stdout, " +'xml-scenario-generic' file|\n"); fprintf (stdout, " +---------------------------+\n"); fprintf (stdout, "\n"); - fprintf (stdout, "\n"); - fprintf (stdout, " Case 2: generate a dedicated xml scenario from generic xml scenario:\n"); - fprintf (stdout, "\n"); - fprintf (stdout, " +---------------------------+ +------------------------+\n"); - fprintf (stdout, " |'xml-scenario-generic' file| |'new-enb-conf-file' file|\n"); - fprintf (stdout, " +--------+------------------+ +------------+-----------+\n"); - fprintf (stdout, " | |\n"); - fprintf (stdout, " +--------------------+---------------+\n"); - fprintf (stdout, " |\n"); - fprintf (stdout, " generate_scenario -t -s -n \n"); - fprintf (stdout, " |\n"); - fprintf (stdout, " +--------------V--------------+\n"); - fprintf (stdout, " +'xml-scenario-dedicated' file|\n"); - fprintf (stdout, " +-----------------------------+\n"); - fprintf (stdout, "\n"); - fprintf (stdout, "\n"); - fprintf (stdout, " Case 3 = case 1 + case 2: generate a dedicated xml scenario from a captured pcap file:\n"); - fprintf (stdout, "\n"); - fprintf (stdout, " +---------------------+\n"); - fprintf (stdout, " |captured pcap-ng file|\n"); - fprintf (stdout, " +----------+----------+\n"); - fprintf (stdout, " |\n"); - fprintf (stdout, " mme_test_s1_pcap2pdml \n"); - fprintf (stdout, " |\n"); - fprintf (stdout, " +------------------------+ +--------V----------+ +------------------------+\n"); - fprintf (stdout, " |'old-enb-conf-file' file| |'pdml-in-orig' file| |'new-enb-conf-file' file|\n"); - fprintf (stdout, " +------------+-----------+ +--------+----------+ +------------+-----------+\n"); - fprintf (stdout, " | | |\n"); - fprintf (stdout, " +----------------------+-------------------------+\n"); - fprintf (stdout, " |\n"); - fprintf (stdout, " V\n"); - fprintf (stdout, " generate_scenario -t -p -o -n \n"); - fprintf (stdout, " | ^ |\n"); - fprintf (stdout, " | | |\n"); - fprintf (stdout, " +--------------V------------+ +------------V----------------+\n"); - fprintf (stdout, " |'xml-scenario-generic' file| |'xml-scenario-dedicated' file|\n"); - fprintf (stdout, " +---------------------------+ +-----------------------------+\n"); } - //------------------------------------------------------------------------------ int config_parse_opt_line ( @@ -618,28 +581,22 @@ config_parse_opt_line ( { int option; int rv = 0; - char *new_enb_config_file_name = NULL; char *old_enb_config_file_name = NULL; char *pdml_in_file_name = NULL; - char *generic_scenario_file_name = NULL; char *test_dir_name = NULL; enum long_option_e { LONG_OPTION_START = 0x100, /* Start after regular single char options */ - LONG_OPTION_NEW_ENB_CONF_FILE, LONG_OPTION_OLD_ENB_CONF_FILE, LONG_OPTION_PDML, LONG_OPTION_TEST_DIR, - LONG_OPTION_SCENARIO_GENERIC, LONG_OPTION_HELP, }; static struct option long_options[] = { {"old-enb-conf-file", required_argument, 0, LONG_OPTION_OLD_ENB_CONF_FILE}, - {"new-enb-conf-file", required_argument, 0, LONG_OPTION_NEW_ENB_CONF_FILE}, {"pdml ", required_argument, 0, LONG_OPTION_PDML}, {"test-dir", required_argument, 0, LONG_OPTION_TEST_DIR}, - {"scenario-generic", required_argument, 0, LONG_OPTION_SCENARIO_GENERIC}, {"help", required_argument, 0, LONG_OPTION_HELP}, {NULL, 0, NULL, 0} }; @@ -658,15 +615,6 @@ config_parse_opt_line ( } break; - case LONG_OPTION_NEW_ENB_CONF_FILE: - case 'n': - if (optarg) { - new_enb_config_file_name = optarg; - printf("New eNB config file name is %s\n", new_enb_config_file_name); - rv |= GENERATE_DEDICATED_SCENARIO; - } - break; - case LONG_OPTION_PDML: case 'p': if (optarg) { @@ -688,15 +636,6 @@ config_parse_opt_line ( } break; - case LONG_OPTION_SCENARIO_GENERIC: - case 's': - if (optarg) { - generic_scenario_file_name = strdup(optarg); - printf("Generic XML scenario input file name is %s\n", generic_scenario_file_name); - rv |= GENERATE_DEDICATED_SCENARIO; - } - break; - case LONG_OPTION_HELP: case 'h': default: @@ -720,8 +659,8 @@ config_parse_opt_line ( if (is_file_exists(old_enb_config_file_name, "Old eNB config file") != GS_IS_FILE) { fprintf(stderr, "Error: original eNB config file name %s is not found in dir %s\n", old_enb_config_file_name, g_test_dir); } - enb_config_init(old_enb_config_file_name, ENB_CONFIG_PROPERTIES_INDEX_OLD); - enb_config_display(ENB_CONFIG_PROPERTIES_INDEX_OLD); + enb_config_init(old_enb_config_file_name); + enb_config_display(); if (NULL == pdml_in_file_name) { fprintf(stderr, "Error: please provide the PDML file name that should be in %s\n", g_test_dir); @@ -731,25 +670,6 @@ config_parse_opt_line ( } g_pdml_in_origin = pdml_in_file_name; pdml_in_file_name = NULL; } - - if (rv & GENERATE_DEDICATED_SCENARIO) { - if (NULL == new_enb_config_file_name) { - fprintf(stderr, "Error: please provide the new eNB config file name that should be in %s\n", g_test_dir); - } - if (is_file_exists(new_enb_config_file_name, "New eNB config file") != GS_IS_FILE) { - fprintf(stderr, "Error: New eNB config file name %s is not found in dir %s\n", new_enb_config_file_name, g_test_dir); - } - enb_config_init(new_enb_config_file_name, ENB_CONFIG_PROPERTIES_INDEX_NEW); - enb_config_display(ENB_CONFIG_PROPERTIES_INDEX_NEW); - - if (NULL == generic_scenario_file_name) { - fprintf(stderr, "Error: please provide the Generic scenario file name that should be in %s\n", g_test_dir); - } - if (is_file_exists(generic_scenario_file_name, "Generic scenario file") != GS_IS_FILE) { - fprintf(stderr, "Error: Generic scenario file name %s is not found in dir %s\n", generic_scenario_file_name, g_test_dir); - } - g_generic_scenario = generic_scenario_file_name; generic_scenario_file_name = NULL; - } return rv; } @@ -765,16 +685,12 @@ int main( int argc, char **argv ) exit(1); } - memset((char*) &g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_OLD], 0 , sizeof(g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_OLD])); - memset((char*) &g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_NEW], 0 , sizeof(g_enb_properties[ENB_CONFIG_PROPERTIES_INDEX_NEW])); + memset((char*) &g_enb_properties, 0 , sizeof(g_enb_properties)); actions = config_parse_opt_line (argc, argv); //Command-line options if (actions & GENERATE_GENERIC_SCENARIO) { generate_generic_scenario(g_test_dir, g_pdml_in_origin); } - /*if (actions & GENERATE_DEDICATED_SCENARIO) { - generate_dedicated_scenario(g_test_dir, g_pdml_in_origin); - }*/ return 0; } diff --git a/openair3/TEST/EPC_TEST/generate_scenario.h b/openair3/TEST/EPC_TEST/generate_scenario.h index c3b42ea253..88c0d28e17 100755 --- a/openair3/TEST/EPC_TEST/generate_scenario.h +++ b/openair3/TEST/EPC_TEST/generate_scenario.h @@ -126,7 +126,7 @@ typedef struct Enb_properties_array_s { Enb_properties_t *properties[EPC_TEST_SCENARIO_MAX_ENB]; } Enb_properties_array_t; -void enb_config_init(const char const * lib_config_file_name_pP, const boolean_t new_config_fileP); +void enb_config_init(const char const * lib_config_file_name_pP); #endif /* ENB_CONFIG_H_ */ /** @} */ From d03f78a4031bf62d4ea1b43b0a83e899027ec84c Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 6 Nov 2015 10:03:26 +0100 Subject: [PATCH 008/214] Cleaned xml output, now a S1C test scenario is generated, ready to be parsed. --- cmake_targets/CMakeLists.txt | 66 ++- cmake_targets/tools/build_test_epc_tools | 4 + openair2/ENB_APP/enb_config.c | 2 +- openair2/ENB_APP/enb_config.h | 1 + openair3/TEST/EPC_TEST/generate_scenario.c | 103 ++--- openair3/TEST/EPC_TEST/generate_scenario.h | 0 openair3/TEST/EPC_TEST/generic_scenario.xsl | 421 ++++++++++---------- openair3/TEST/EPC_TEST/play_scenario.c | 405 +++++++++++++++++++ openair3/TEST/EPC_TEST/play_scenario.h | 49 +++ openair3/TEST/EPC_TEST/play_scenario.xsl | 113 ++++++ 10 files changed, 901 insertions(+), 263 deletions(-) mode change 100755 => 100644 openair3/TEST/EPC_TEST/generate_scenario.h create mode 100644 openair3/TEST/EPC_TEST/play_scenario.c create mode 100644 openair3/TEST/EPC_TEST/play_scenario.h create mode 100644 openair3/TEST/EPC_TEST/play_scenario.xsl diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 6b9dae6b04..42e381dd68 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -162,24 +162,47 @@ add_definitions(-DCMAKER) set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O2") -# Below has been put in comment because does not work with -# SVN authentication. -# -#find_package(Subversion) -#if(SUBVERSION_FOUND) -# Subversion_WC_INFO(${OPENAIR_DIR} openair) -# set (FIRMWARE_VERSION "${openair_WC_REVISION} - ${openair_WC_LAST_CHANGED_DATE}") -# Subversion_WC_LOG(${OPENAIR_DIR} Project) -#else() -# set (FIRMWARE_VERSION "No svn information") -#endif() -#add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"") + + +set(GIT_BRANCH "UNKNOWN") +set(GIT_COMMIT_HASH "UNKNOWN") +set(GIT_COMMIT_DATE "UNKNOWN") + + +find_package(Git) +if(GIT_FOUND) + message("git found: ${GIT_EXECUTABLE}") + # Get the current working branch + execute_process( + COMMAND git rev-parse --abbrev-ref HEAD + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE GIT_BRANCH + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + # Get the latest abbreviated commit hash of the working branch + execute_process( + COMMAND git log -1 --format=%h + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE GIT_COMMIT_HASH + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + # Get the latest commit date of the working branch + execute_process( + COMMAND git log -1 --format=%cd + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE GIT_COMMIT_DATE + OUTPUT_STRIP_TRAILING_WHITESPACE + ) +endif() + # Below is a hard-coded info set (FIRMWARE_VERSION "No svn information") add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"") -add_definitions("-DPACKAGE_VERSION=\"${FIRMWARE_VERSION}\"") -add_definitions("-DPACKAGE_BUGREPORT=\"OpenAirInterface web site\"") +add_definitions("-DPACKAGE_VERSION=\"Branch: ${GIT_BRANCH} Abrev. Hash: ${GIT_COMMIT_HASH} Date: ${GIT_COMMIT_DATE}\"") +add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"") @@ -1615,6 +1638,7 @@ endforeach(myExe) add_executable(test_epc_generate_scenario ${OPENAIR3_DIR}/TEST/EPC_TEST/generate_scenario.c + ${OPENAIR3_DIR}/TEST/EPC_TEST/generate_scenario.h ${OPENAIR2_DIR}/ENB_APP/enb_config.h ${OPENAIR2_DIR}/COMMON/commonDef.h ${OPENAIR2_DIR}/COMMON/messages_def.h @@ -1626,6 +1650,20 @@ target_link_libraries (test_epc_generate_scenario -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} ) +add_executable(test_epc_play_scenario + ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.c + ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.h + ${OPENAIR2_DIR}/ENB_APP/enb_config.h + ${OPENAIR2_DIR}/COMMON/commonDef.h + ${OPENAIR2_DIR}/COMMON/messages_def.h + ${OPENAIR2_DIR}/COMMON/messages_types.h + ${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h + ${OPENAIR_BIN_DIR}/messages_xml.h + ) +target_link_libraries (test_epc_play_scenario + -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} + ) + #unitary tests for Core NEtwork pieces ################################# diff --git a/cmake_targets/tools/build_test_epc_tools b/cmake_targets/tools/build_test_epc_tools index aff2a26fc0..10dc4fd256 100755 --- a/cmake_targets/tools/build_test_epc_tools +++ b/cmake_targets/tools/build_test_epc_tools @@ -121,6 +121,7 @@ function main() echo "Cleaning TEST_EPC" fi rm -f $OPENAIR_DIR/targets/bin/test_epc_generate_scenario + rm -f $OPENAIR_DIR/targets/bin/test_epc_play_scenario rm -Rf build 2>&1 mkdir -m 777 -p -v build fi @@ -140,6 +141,9 @@ function main() compilations \ epc_test test_epc_generate_scenario \ test_epc_generate_scenario $dbin/test_epc_generate_scenario + compilations \ + epc_test test_epc_play_scenario \ + test_epc_play_scenario $dbin/test_epc_play_scenario } diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 07e0ffa640..ad4dde7faa 100755 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -253,7 +253,7 @@ static const eutra_band_t eutra_bands[] = { Enb_properties_array_t enb_properties; -static void enb_config_display(void) +void enb_config_display(void) { int i,j; diff --git a/openair2/ENB_APP/enb_config.h b/openair2/ENB_APP/enb_config.h index 113681dafe..de837303ea 100755 --- a/openair2/ENB_APP/enb_config.h +++ b/openair2/ENB_APP/enb_config.h @@ -239,6 +239,7 @@ typedef struct Enb_properties_array_s { Enb_properties_t *properties[MAX_ENB]; } Enb_properties_array_t; +void enb_config_display(void); const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP); const Enb_properties_array_t *enb_config_get(void); diff --git a/openair3/TEST/EPC_TEST/generate_scenario.c b/openair3/TEST/EPC_TEST/generate_scenario.c index 4cb21f9604..8f39b9873e 100644 --- a/openair3/TEST/EPC_TEST/generate_scenario.c +++ b/openair3/TEST/EPC_TEST/generate_scenario.c @@ -100,11 +100,10 @@ Enb_properties_array_t g_enb_properties; char *g_openair_dir = NULL; char *g_test_dir = NULL; char *g_pdml_in_origin = NULL; -char *g_generic_scenario = NULL; extern int xmlLoadExtDtdDefaultValue; #define GENERATE_PDML_FILE 1 -#define GENERATE_GENERIC_SCENARIO 2 +#define GENERATE_SCENARIO 2 #define GS_IS_FILE 1 #define GS_IS_DIR 2 @@ -172,14 +171,14 @@ int split_path( char * pathP, char *** resP) } //------------------------------------------------------------------------------ -int generate_generic_scenario(const char const * test_nameP, const char const * pdml_in_basenameP) +int generate_test_scenario(const char const * test_nameP, const char const * pdml_in_basenameP) //------------------------------------------------------------------------------ { //int fd_pdml_in; xsltStylesheetPtr cur = NULL; xmlDocPtr doc, res; - FILE *generic_scenario_file = NULL; - const char generic_scenario_filename[NAME_MAX]; + FILE *test_scenario_file = NULL; + const char test_scenario_filename[NAME_MAX]; const char *params[2*ENB_CONFIG_MAX_XSLT_PARAMS]; int nb_params = 0; int i,j; @@ -187,7 +186,7 @@ int generate_generic_scenario(const char const * test_nameP, const char const * char *astring2 = NULL; struct in_addr addr; - memset(generic_scenario_filename, 0, sizeof(generic_scenario_filename)); + memset(test_scenario_filename, 0, sizeof(test_scenario_filename)); memset(astring, 0, sizeof(astring)); if (getcwd(astring, sizeof(astring)) != NULL) { fprintf(stdout, "working in %s directory\n", astring); @@ -249,16 +248,16 @@ int generate_generic_scenario(const char const * test_nameP, const char const * res = xsltApplyStylesheet(cur, doc, params); if (NULL != res) { // since pdml filename is not relative (no path), just filename in current directory we can safely remove - sprintf(generic_scenario_filename,"%s",pdml_in_basenameP); - if (strip_extension(generic_scenario_filename) > 0) { - strcat(generic_scenario_filename, "_generic_scenario.xml"); - generic_scenario_file = fopen( generic_scenario_filename, "w+"); - if (NULL != generic_scenario_file) { - xsltSaveResultToFile(generic_scenario_file, res, cur); - fclose(generic_scenario_file); - fprintf(stdout, "Wrote generic scenario to %s\n", generic_scenario_filename); + sprintf(test_scenario_filename,"%s",pdml_in_basenameP); + if (strip_extension(test_scenario_filename) > 0) { + strcat(test_scenario_filename, ".xml"); + test_scenario_file = fopen( test_scenario_filename, "w+"); + if (NULL != test_scenario_file) { + xsltSaveResultToFile(test_scenario_file, res, cur); + fclose(test_scenario_file); + fprintf(stdout, "Wrote test scenario to %s\n", test_scenario_filename); } else { - fprintf(stderr, "Error in fopen(%s)\n", generic_scenario_filename); + fprintf(stderr, "Error in fopen(%s)\n", test_scenario_filename); } } else { fprintf(stderr, "Error in strip_extension()\n"); @@ -537,17 +536,17 @@ static void usage ( char *argv[]) //------------------------------------------------------------------------------ { - fprintf (stdout, "Please report any bug to: openair4g-devel@lists.eurecom.fr\n\n"); + fprintf (stdout, "Please report any bug to: %s\n",PACKAGE_BUGREPORT); fprintf (stdout, "Usage: %s [options]\n\n", argv[0]); + fprintf (stdout, "\n"); fprintf (stdout, "Mandatory options:\n"); - fprintf (stdout, "\t-t | --test-dir Directory where a set of files related to a particular test are located\n"); + fprintf (stdout, "\t-c | --enb-conf-file Provide the old eNB config file for generating a copy of the original test\n"); + fprintf (stdout, "\t-d | --test-dir Directory where a set of files related to a particular test are located\n"); + fprintf (stdout, "\t-p | --pdml File name (with no path) in 'test-dir' directory of an original scenario that has to be reworked (IP addresses) with new testbed\n"); fprintf (stdout, "\n"); - fprintf (stdout, "Available options:\n"); + fprintf (stdout, "Other options:\n"); fprintf (stdout, "\t-h | --help Print this help and return\n"); - fprintf (stdout, "\t-o | --old-enb-conf-file Provide the old eNB config file for generating a copy of the original test\n"); - fprintf (stdout, " This option is set as many times as there are some eNB config files in the original test\n"); - fprintf (stdout, "\t-p | --pdml File name (with no path) of an original scenario that has to be reworked (IP addresses) with new testbed\n"); - fprintf (stdout, "\n"); + fprintf (stdout, "\t-v | --version Print informations about the version of this executable\n"); fprintf (stdout, "\n"); fprintf (stdout, "Example of generate_scenario use case: \n"); fprintf (stdout, "\n"); @@ -558,16 +557,16 @@ static void usage ( fprintf (stdout, " |\n"); fprintf (stdout, " mme_test_s1_pcap2pdml --pcap_file <`captured pcap-ng file`>\n"); fprintf (stdout, " |\n"); - fprintf (stdout, " +--------V----------+ +------------------------+\n"); - fprintf (stdout, " |'pdml-in-orig' file| |'old-enb-conf-file' file|\n"); - fprintf (stdout, " +--------+----------+ +------------+-----------+\n"); + fprintf (stdout, " +--------V----------+ +--------------------+\n"); + fprintf (stdout, " |'pdml-in-orig' file| |'enb-conf-file' file|\n"); + fprintf (stdout, " +--------+----------+ +--------------------+\n"); fprintf (stdout, " | |\n"); fprintf (stdout, " +----------------------------+\n"); fprintf (stdout, " |\n"); - fprintf (stdout, " generate_scenario -t -p <'pdml-in-orig' file> -o <'old-enb-conf-file' file> \n"); + fprintf (stdout, " generate_scenario -d -p <'pdml-in-orig' file> -c <'enb-conf-file' file> \n"); fprintf (stdout, " |\n"); fprintf (stdout, " +------------V--------------+\n"); - fprintf (stdout, " +'xml-scenario-generic' file|\n"); + fprintf (stdout, " +'xml-test-scenario' file |\n"); fprintf (stdout, " +---------------------------+\n"); fprintf (stdout, "\n"); } @@ -581,37 +580,39 @@ config_parse_opt_line ( { int option; int rv = 0; - char *old_enb_config_file_name = NULL; + char *enb_config_file_name = NULL; char *pdml_in_file_name = NULL; char *test_dir_name = NULL; enum long_option_e { LONG_OPTION_START = 0x100, /* Start after regular single char options */ - LONG_OPTION_OLD_ENB_CONF_FILE, + LONG_OPTION_ENB_CONF_FILE, LONG_OPTION_PDML, LONG_OPTION_TEST_DIR, LONG_OPTION_HELP, + LONG_OPTION_VERSION, }; static struct option long_options[] = { - {"old-enb-conf-file", required_argument, 0, LONG_OPTION_OLD_ENB_CONF_FILE}, - {"pdml ", required_argument, 0, LONG_OPTION_PDML}, - {"test-dir", required_argument, 0, LONG_OPTION_TEST_DIR}, - {"help", required_argument, 0, LONG_OPTION_HELP}, + {"enb-conf-file", required_argument, 0, LONG_OPTION_ENB_CONF_FILE}, + {"pdml ", required_argument, 0, LONG_OPTION_PDML}, + {"test-dir", required_argument, 0, LONG_OPTION_TEST_DIR}, + {"help", no_argument, 0, LONG_OPTION_HELP}, + {"version", no_argument, 0, LONG_OPTION_VERSION}, {NULL, 0, NULL, 0} }; /* * Parsing command line */ - while ((option = getopt_long (argc, argv, "hp:n:o:s:t:", long_options, NULL)) != -1) { + while ((option = getopt_long (argc, argv, "vhp:n:c:s:d:", long_options, NULL)) != -1) { switch (option) { - case LONG_OPTION_OLD_ENB_CONF_FILE: - case 'o': + case LONG_OPTION_ENB_CONF_FILE: + case 'c': if (optarg) { - old_enb_config_file_name = optarg; - printf("Old eNB config file name is %s\n", old_enb_config_file_name); - rv |= GENERATE_GENERIC_SCENARIO; + enb_config_file_name = optarg; + printf("eNB config file name is %s\n", enb_config_file_name); + rv |= GENERATE_SCENARIO; } break; @@ -620,12 +621,12 @@ config_parse_opt_line ( if (optarg) { pdml_in_file_name = strdup(optarg); printf("PDML input file name is %s\n", pdml_in_file_name); - rv |= GENERATE_GENERIC_SCENARIO; + rv |= GENERATE_SCENARIO; } break; case LONG_OPTION_TEST_DIR: - case 't': + case 'd': if (optarg) { test_dir_name = strdup(optarg); if (is_file_exists(test_dir_name, "test dirname") != GS_IS_DIR) { @@ -636,6 +637,12 @@ config_parse_opt_line ( } break; + case LONG_OPTION_VERSION: + case 'v': + printf("Version %s\n", PACKAGE_VERSION); + exit (0); + break; + case LONG_OPTION_HELP: case 'h': default: @@ -652,14 +659,14 @@ config_parse_opt_line ( fprintf(stderr, "Error: chdir %s returned %s\n", g_test_dir, strerror(errno)); exit(1); } - if (rv & GENERATE_GENERIC_SCENARIO) { - if (NULL == old_enb_config_file_name) { + if (rv & GENERATE_SCENARIO) { + if (NULL == enb_config_file_name) { fprintf(stderr, "Error: please provide the original eNB config file name that should be in %s\n", g_test_dir); } - if (is_file_exists(old_enb_config_file_name, "Old eNB config file") != GS_IS_FILE) { - fprintf(stderr, "Error: original eNB config file name %s is not found in dir %s\n", old_enb_config_file_name, g_test_dir); + if (is_file_exists(enb_config_file_name, "ENB config file") != GS_IS_FILE) { + fprintf(stderr, "Error: eNB config file name %s is not found in dir %s\n", enb_config_file_name, g_test_dir); } - enb_config_init(old_enb_config_file_name); + enb_config_init(enb_config_file_name); enb_config_display(); if (NULL == pdml_in_file_name) { @@ -688,8 +695,8 @@ int main( int argc, char **argv ) memset((char*) &g_enb_properties, 0 , sizeof(g_enb_properties)); actions = config_parse_opt_line (argc, argv); //Command-line options - if (actions & GENERATE_GENERIC_SCENARIO) { - generate_generic_scenario(g_test_dir, g_pdml_in_origin); + if (actions & GENERATE_SCENARIO) { + generate_test_scenario(g_test_dir, g_pdml_in_origin); } return 0; diff --git a/openair3/TEST/EPC_TEST/generate_scenario.h b/openair3/TEST/EPC_TEST/generate_scenario.h old mode 100755 new mode 100644 diff --git a/openair3/TEST/EPC_TEST/generic_scenario.xsl b/openair3/TEST/EPC_TEST/generic_scenario.xsl index ab0e7f1123..e55bfffd69 100644 --- a/openair3/TEST/EPC_TEST/generic_scenario.xsl +++ b/openair3/TEST/EPC_TEST/generic_scenario.xsl @@ -1,240 +1,261 @@ + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + enb_s1c0 enb_s1c1 enb_s1c2 enb_s1c3 enb_s1c4 enb_s1c5 + enb_s1c6 + enb_s1c7 mme_s1c0_0 mme_s1c0_1 mme_s1c0_2 mme_s1c0_3 mme_s1c1_0 mme_s1c1_1 - mme_s1c1_2" + mme_s1c1_2 mme_s1c1_3 - reverse_ip_yourself - - + mme_s1c2_0 + mme_s1c2_1 + mme_s1c2_2 + mme_s1c2_3 + mme_s1c3_0 + mme_s1c3_1 + mme_s1c3_2 + mme_s1c3_3 + + ERROR: Cannot reverse resolv IP ! + + + + - - + + - DATA - INIT - INIT_ACK - SACK - HEARTBEAT - HEARTBEAT_ACK - ABORT - SHUTDOWN - SHUTDOWN_ACK - ERROR - COOKIE_ECHO - COOKIE_ACK - ECNE - CWR - SHUTDOWN_COMPLETE - UNKNOWN_CHUNK_TYPE + DATA + INIT + INIT_ACK + SACK + HEARTBEAT + HEARTBEAT_ACK + ABORT + SHUTDOWN + SHUTDOWN_ACK + ERROR + COOKIE_ECHO + COOKIE_ACK + ECNE + CWR + SHUTDOWN_COMPLETE + + ERROR: UNKNOWN CHUNK TYPE ! + + - + + - - - - + - + - + - + - - - - + + + + - - - - + + + + + + + + SEND + RECEIVE + + ERROR: UNKNOWN ACTION ! + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - + + + - - + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c new file mode 100644 index 0000000000..b8252854e4 --- /dev/null +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -0,0 +1,405 @@ +/******************************************************************************* + OpenAirInterface + Copyright(c) 1999 - 2014 Eurecom + + OpenAirInterface is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + + OpenAirInterface is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenAirInterface.The full GNU General Public License is + included in this distribution in the file called "COPYING". If not, + see . + + Contact Information + OpenAirInterface Admin: openair_admin@eurecom.fr + OpenAirInterface Tech : openair_tech@eurecom.fr + OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + + Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + + *******************************************************************************/ + +/* + play_scenario.c + ------------------- + AUTHOR : Lionel GAUTHIER + COMPANY : EURECOM + EMAIL : Lionel.Gauthier@eurecom.fr + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "assertions.h" +#include "play_scenario.h" +#include "s1ap_eNB.h" +#include "intertask_interface.h" +#include "enb_config.h" +//------------------------------------------------------------------------------ +#define ENB_CONFIG_MAX_XSLT_PARAMS 32 +#define PLAY_SCENARIO 1 +#define GS_IS_FILE 1 +#define GS_IS_DIR 2 +//------------------------------------------------------------------------------ +char *g_openair_dir = NULL; +//------------------------------------------------------------------------------ +extern Enb_properties_array_t enb_properties; +extern int xmlLoadExtDtdDefaultValue; + +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// test if file exist in current directory +int is_file_exists( const char const * file_nameP, const char const *file_roleP) +{ + struct stat s; + int err = stat(file_nameP, &s); + if(-1 == err) { + if(ENOENT == errno) { + fprintf(stderr, "Please provide a valid %s, %s does not exist\n", file_roleP, file_nameP); + } else { + perror("stat"); + exit(1); + } + } else { + if(S_ISREG(s.st_mode)) { + return GS_IS_FILE; + } else if(S_ISDIR(s.st_mode)) { + return GS_IS_DIR; + } else { + fprintf(stderr, "Please provide a valid test %s, %s exists but is not found valid\n", file_roleP, file_nameP); + } + } + return 0; +} + + +//------------------------------------------------------------------------------ +int strip_extension(char *in_filename) +{ + static const uint8_t name_min_len = 1; + static const uint8_t max_ext_len = 5; // .pdml ! + fprintf(stdout, "strip_extension %s\n", in_filename); + + if (NULL != in_filename) { + /* Check chars starting at end of string to find last '.' */ + for (ssize_t i = strlen(in_filename); i > (name_min_len + max_ext_len); i--) { + if (in_filename[i] == '.') { + in_filename[i] = '\0'; + return i; + } + } + } + return -1; +} +//------------------------------------------------------------------------------ +// return number of splitted items +int split_path( char * pathP, char *** resP) +{ + char * saveptr1; + char * p = strtok_r (pathP, "/", &saveptr1); + int n_spaces = 0; + + /// split string and append tokens to 'res' + while (p) { + *resP = realloc (*resP, sizeof (char*) * ++n_spaces); + AssertFatal (*resP, "realloc failed"); + (*resP)[n_spaces-1] = p; + p = strtok_r (NULL, "/", &saveptr1); + } + return n_spaces; +} + +//------------------------------------------------------------------------------ +void play_scenario( + const char const * play_scenario_filename ) +{ + +} + +//------------------------------------------------------------------------------ +int generate_play_scenario( + const char const * test_dir_name, + const char const * test_scenario_filename, + const char const * enb_config_filename, + char const * play_scenario_filename /* OUT PARAM*/) +//------------------------------------------------------------------------------ +{ + //int fd_pdml_in; + xsltStylesheetPtr cur = NULL; + xmlDocPtr doc, res; + FILE *play_scenario_file = NULL; + const char *params[2*ENB_CONFIG_MAX_XSLT_PARAMS]; + int nb_params = 0; + int i,j; + char astring[1024]; + char *astring2 = NULL; + struct in_addr addr; + int ret = 0; + + memset(astring, 0, sizeof(astring)); + if (getcwd(astring, sizeof(astring)) != NULL) { + fprintf(stdout, "working in %s directory\n", astring); + } else { + perror("getcwd() error"); + exit(1); + } + + memset(astring, 0, sizeof(astring)); + strcat(astring, g_openair_dir); + strcat(astring, "/openair3/TEST/EPC_TEST/play_scenario.xsl"); + + xmlSubstituteEntitiesDefault(1); + xmlLoadExtDtdDefaultValue = 1; + cur = xsltParseStylesheetFile(astring); + if (NULL == cur) { + AssertFatal (0, "Could not parse stylesheet file %s (check OPENAIR_DIR env variable)!\n", astring); + } else { + fprintf(stdout, "XSLT style sheet: %s\n", astring); + } + + doc = xmlParseFile(test_scenario_filename); + if (NULL == doc) { + AssertFatal (0, "Could not parse scenario xml file %s!\n", test_scenario_filename); + } else { + fprintf(stdout, "Test scenario file: %s\n", test_scenario_filename); + } + + for (i = 0; i < enb_properties.number; i++) { + // eNB S1-C IPv4 address + sprintf(astring, "enb_s1c%d", i); + params[nb_params++] = strdup(astring); + addr.s_addr = enb_properties.properties[i]->enb_ipv4_address_for_S1_MME; + sprintf(astring, "\"%s\"", inet_ntoa(addr)); + params[nb_params++] = strdup(astring); + + // MME S1-C IPv4 address + for (j = 0; j < enb_properties.properties[i]->nb_mme; j++) { + sprintf(astring, "mme_s1c%d_%d", i, j); + params[nb_params++] = strdup(astring); + AssertFatal (enb_properties.properties[i]->mme_ip_address[j].ipv4_address, + "Only support MME IPv4 address\n"); + sprintf(astring, "\"%s\"", enb_properties.properties[i]->mme_ip_address[j].ipv4_address); + params[nb_params++] = strdup(astring); + } + } + params[nb_params] = NULL; + res = xsltApplyStylesheet(cur, doc, params); + if (NULL != res) { + // since pdml filename is not relative (no path), just filename in current directory we can safely remove + sprintf(play_scenario_filename,"%s",test_scenario_filename); + if (strip_extension(play_scenario_filename) > 0) { + strcat(play_scenario_filename, ".tsml"); + play_scenario_file = fopen( play_scenario_filename, "w+"); + if (NULL != play_scenario_file) { + xsltSaveResultToFile(play_scenario_file, res, cur); + fclose(play_scenario_file); + fprintf(stdout, "Wrote test scenario to %s\n", play_scenario_filename); + } else { + fprintf(stderr, "Error in fopen(%s)\n", play_scenario_filename); + ret = -1; + } + } else { + fprintf(stderr, "Error in strip_extension()\n"); + ret = -1; + } + } else { + fprintf(stderr, "Error in xsltApplyStylesheet()\n"); + ret = -1; + } + xsltFreeStylesheet(cur); + xmlFreeDoc(res); + xmlFreeDoc(doc); + + xsltCleanupGlobals(); + xmlCleanupParser(); + return ret; +} + +//------------------------------------------------------------------------------ +static void usage ( + int argc, + char *argv[]) +//------------------------------------------------------------------------------ +{ + fprintf (stdout, "Please report any bug to: %s\n",PACKAGE_BUGREPORT); + fprintf (stdout, "Usage: %s [options]\n\n", argv[0]); + fprintf (stdout, "\n"); + fprintf (stdout, "Client options:\n"); + fprintf (stdout, "\t-S | --server File name (with no path) of a test scenario that has to be replayed (TODO in future?)\n"); + fprintf (stdout, "Server options:\n"); + fprintf (stdout, "\t-d | --test-dir Directory where a set of files related to a particular test are located\n"); + fprintf (stdout, "\t-c | --enb-conf-file Provide an eNB config file, valid for the testbed\n"); + fprintf (stdout, "\t-s | --scenario File name (with no path) of a test scenario that has to be replayed ()\n"); + fprintf (stdout, "\n"); + fprintf (stdout, "Other options:\n"); + fprintf (stdout, "\t-h | --help Print this help and return\n"); + fprintf (stdout, "\t-v | --version Print informations about the version of this executable\n"); + fprintf (stdout, "\n"); +} + +//------------------------------------------------------------------------------ +int +config_parse_opt_line ( + int argc, + char *argv[], + char **test_dir_name, + char **scenario_file_name, + char **enb_config_file_name) +//------------------------------------------------------------------------------ +{ + int option; + int rv = 0; + const Enb_properties_array_t *enb_properties_p = NULL; + + enum long_option_e { + LONG_OPTION_START = 0x100, /* Start after regular single char options */ + LONG_OPTION_ENB_CONF_FILE, + LONG_OPTION_SCENARIO_FILE, + LONG_OPTION_TEST_DIR, + LONG_OPTION_HELP, + LONG_OPTION_VERSION + }; + + static struct option long_options[] = { + {"enb-conf-file", required_argument, 0, LONG_OPTION_ENB_CONF_FILE}, + {"scenario ", required_argument, 0, LONG_OPTION_SCENARIO_FILE}, + {"test-dir", required_argument, 0, LONG_OPTION_TEST_DIR}, + {"help", no_argument, 0, LONG_OPTION_HELP}, + {"version", no_argument, 0, LONG_OPTION_VERSION}, + {NULL, 0, NULL, 0} + }; + + /* + * Parsing command line + */ + while ((option = getopt_long (argc, argv, "vhc:s:d:", long_options, NULL)) != -1) { + switch (option) { + case LONG_OPTION_ENB_CONF_FILE: + case 'c': + if (optarg) { + *enb_config_file_name = strdup(optarg); + printf("eNB config file name is %s\n", *enb_config_file_name); + rv |= PLAY_SCENARIO; + } + break; + + case LONG_OPTION_SCENARIO_FILE: + case 's': + if (optarg) { + *scenario_file_name = strdup(optarg); + printf("Scenario file name is %s\n", *scenario_file_name); + rv |= PLAY_SCENARIO; + } + break; + + case LONG_OPTION_TEST_DIR: + case 'd': + if (optarg) { + *test_dir_name = strdup(optarg); + if (is_file_exists(*test_dir_name, "test dirname") != GS_IS_DIR) { + fprintf(stderr, "Please provide a valid test dirname, %s is not a valid directory name\n", *test_dir_name); + exit(1); + } + printf("Test dir name is %s\n", *test_dir_name); + } + break; + + case LONG_OPTION_VERSION: + case 'v': + printf("Version %s\n", PACKAGE_VERSION); + exit (0); + break; + + case LONG_OPTION_HELP: + case 'h': + default: + usage (argc, argv); + exit (0); + } + } + if (NULL == *test_dir_name) { + fprintf(stderr, "Please provide a valid test dirname\n"); + exit(1); + } + if (chdir(*test_dir_name) != 0) { + fprintf(stderr, "Error: chdir %s returned %s\n", *test_dir_name, strerror(errno)); + exit(1); + } + if (rv & PLAY_SCENARIO) { + if (NULL == *enb_config_file_name) { + fprintf(stderr, "Error: please provide the original eNB config file name that should be in %s\n", *test_dir_name); + } + if (is_file_exists(*enb_config_file_name, "eNB config file") != GS_IS_FILE) { + fprintf(stderr, "Error: original eNB config file name %s is not found in dir %s\n", *enb_config_file_name, *test_dir_name); + } + enb_properties_p = enb_config_init(*enb_config_file_name); + + if (NULL == *scenario_file_name) { + fprintf(stderr, "Error: please provide the scenario file name that should be in %s\n", *test_dir_name); + } + if (is_file_exists(*scenario_file_name, "Scenario file") != GS_IS_FILE) { + fprintf(stderr, "Error: Scenario file name %s is not found in dir %s\n", *scenario_file_name, *test_dir_name); + } + } + return rv; +} + +//------------------------------------------------------------------------------ +int main( int argc, char **argv ) +//------------------------------------------------------------------------------ +{ + int actions = 0; + char *test_dir_name = NULL; + char *scenario_file_name = NULL; + char *enb_config_file_name = NULL; + char play_scenario_filename[NAME_MAX]; + + memset(play_scenario_filename, 0, sizeof(play_scenario_filename)); + g_openair_dir = getenv("OPENAIR_DIR"); + if (NULL == g_openair_dir) { + fprintf(stderr, "Error: Could not get OPENAIR_DIR environment variable\n"); + exit(1); + } + + actions = config_parse_opt_line (argc, argv, &test_dir_name, &scenario_file_name, &enb_config_file_name); //Command-line options + if (actions & PLAY_SCENARIO) { + if (generate_play_scenario(test_dir_name, scenario_file_name,enb_config_file_name, play_scenario_filename) == 0) { + play_scenario(play_scenario_filename); + } + free_pointer(test_dir_name); + free_pointer(scenario_file_name); + free_pointer(enb_config_file_name); + } + + return 0; +} diff --git a/openair3/TEST/EPC_TEST/play_scenario.h b/openair3/TEST/EPC_TEST/play_scenario.h new file mode 100644 index 0000000000..c6e1087a04 --- /dev/null +++ b/openair3/TEST/EPC_TEST/play_scenario.h @@ -0,0 +1,49 @@ +/******************************************************************************* + OpenAirInterface + Copyright(c) 1999 - 2014 Eurecom + + OpenAirInterface is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + + OpenAirInterface is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenAirInterface.The full GNU General Public License is + included in this distribution in the file called "COPYING". If not, + see . + + Contact Information + OpenAirInterface Admin: openair_admin@eurecom.fr + OpenAirInterface Tech : openair_tech@eurecom.fr + OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + + Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + +*******************************************************************************/ + +/* + generate_scenario.h + ------------------- + AUTHOR : Lionel GAUTHIER + COMPANY : EURECOM + EMAIL : Lionel.Gauthier@eurecom.fr +*/ + +#ifndef GENERATE_SCENARIO_H_ +#define GENERATE_SCENARIO_H_ + +/** @defgroup _enb_app ENB APP + * @ingroup _oai2 + * @{ + */ + + +inline void free_pointer(void *p) {if (NULL != p) {free(p); p=NULL;}}; +#endif /* ENB_CONFIG_H_ */ +/** @} */ diff --git a/openair3/TEST/EPC_TEST/play_scenario.xsl b/openair3/TEST/EPC_TEST/play_scenario.xsl new file mode 100644 index 0000000000..1a89128005 --- /dev/null +++ b/openair3/TEST/EPC_TEST/play_scenario.xsl @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ERROR: Cannot resolv IP ! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ERROR: Cannot resolv IP ! + + + + + + + + + + + + + + + + From 34ab7c374fa99bc4e1ac167107c4acae0a8c6817 Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 6 Nov 2015 16:51:30 +0100 Subject: [PATCH 009/214] For syncing with origin --- openair3/TEST/EPC_TEST/generic_scenario.xsl | 24 +-- openair3/TEST/EPC_TEST/play_scenario.c | 154 ++++++++++++++++++-- openair3/TEST/EPC_TEST/play_scenario.h | 88 +++++++++++ openair3/TEST/EPC_TEST/play_scenario.xsl | 4 +- 4 files changed, 241 insertions(+), 29 deletions(-) diff --git a/openair3/TEST/EPC_TEST/generic_scenario.xsl b/openair3/TEST/EPC_TEST/generic_scenario.xsl index e55bfffd69..b1cadbcdfa 100644 --- a/openair3/TEST/EPC_TEST/generic_scenario.xsl +++ b/openair3/TEST/EPC_TEST/generic_scenario.xsl @@ -146,7 +146,7 @@ - + @@ -160,14 +160,14 @@ - + - + @@ -181,13 +181,13 @@ - + - + @@ -201,13 +201,13 @@ - + - + @@ -218,10 +218,10 @@ - + - + @@ -232,11 +232,11 @@ - + - + @@ -247,7 +247,7 @@ - + diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index b8252854e4..e73a41a683 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include @@ -138,16 +137,132 @@ int split_path( char * pathP, char *** resP) } return n_spaces; } - //------------------------------------------------------------------------------ -void play_scenario( +void display_node(xmlNodePtr node) { + if (node->type == XML_ELEMENT_NODE) { + xmlChar *path = xmlGetNodePath(node); + if (node->children != NULL && node->children->type == XML_TEXT_NODE) { + xmlChar *content = xmlNodeGetContent(node); + printf("%s -> %s\n", path, content); + xmlFree(content); + } else { + printf("%s\n", path); + } + xmlFree(path); + } +} +//------------------------------------------------------------------------------ +void free_scenario(test_scenario_t* scenario) +{ + //TODO +} +//------------------------------------------------------------------------------ +sctp_cid_t chunk_type_str2cid(xmlChar *chunk_type_str) +{ + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"DATA"))) { return SCTP_CID_DATA;} + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"INIT"))) { return SCTP_CID_INIT;} + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"INIT_ACK"))) { return SCTP_CID_INIT_ACK;} + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"SACK"))) { return SCTP_CID_SACK;} + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"HEARTBEAT"))) { return SCTP_CID_HEARTBEAT;} + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"HEARTBEAT_ACK"))) { return SCTP_CID_HEARTBEAT_ACK;} + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ABORT"))) { return SCTP_CID_ABORT;} + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"SHUTDOWN"))) { return SCTP_CID_SHUTDOWN;} + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"SHUTDOWN_ACK"))) { return SCTP_CID_SHUTDOWN_ACK;} + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ERROR"))) { return SCTP_CID_ERROR;} + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"COOKIE_ECHO"))) { return SCTP_CID_COOKIE_ECHO;} + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"COOKIE_ACK"))) { return SCTP_CID_COOKIE_ACK;} + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ECN_ECNE"))) { return SCTP_CID_ECN_ECNE;} + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ECN_CWR"))) { return SCTP_CID_ECN_CWR;} + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"SHUTDOWN_COMPLETE"))) { return SCTP_CID_SHUTDOWN_COMPLETE;} + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"AUTH"))) { return SCTP_CID_AUTH;} + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"FWD_TSN"))) { return SCTP_CID_FWD_TSN;} + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ASCONF"))) { return SCTP_CID_ASCONF;} + if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ASCONF_ACK"))) { return SCTP_CID_ASCONF_ACK;} + fprintf(stderr, "ERROR: Could not convert: %s\n", chunk_type_str); + exit(-1); +} +//------------------------------------------------------------------------------ +test_packet_t* parse_xml_packet(xmlNodePtr node) { + + test_packet_t *packet = NULL; + xmlNode *cur_node = NULL; + xmlChar *xml_char = NULL; + + if (NULL != node) { + packet = calloc(1, sizeof(*packet)); + + for (cur_node = node->children; cur_node; cur_node = cur_node->next) { + if (cur_node->type == XML_ELEMENT_NODE) { + printf("node type: Element, name: %s\n", cur_node->name); + if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"frame.time_relative"))) { + } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"ip.src"))) { + } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"ip.dst"))) { + } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"sctp.chunk_type_str"))) { + xml_char = xmlGetProp(cur_node, (const xmlChar *)"value"); + packet->sctp_hdr.chunk_type = chunk_type_str2cid(xml_char); + fprintf(stdout, "chunk_type_str2cid: %s\n", xml_char); + } + } + } + } + return packet; +} +//------------------------------------------------------------------------------ +int play_scenario(test_scenario_t* scenario) { + //TODO + return 0; +} +//------------------------------------------------------------------------------ +test_scenario_t* generate_scenario( const char const * play_scenario_filename ) { + xmlDocPtr doc = NULL; + xmlNodePtr root = NULL; + xmlNodePtr node = NULL; + xmlChar *xml_char = NULL; + test_scenario_t *scenario = NULL; + test_packet_t *packet = NULL; + test_packet_t **next_packet = NULL; + doc = xmlParseFile(play_scenario_filename); + if (NULL == doc) { + AssertFatal (0, "Could not parse scenario xml file %s!\n", play_scenario_filename); + } else { + fprintf(stdout, "Test scenario file to play: %s\n", play_scenario_filename); + } + + // Get root + root = xmlDocGetRootElement(doc); + if (NULL != root) { + if ((!xmlStrcmp(root->name, (const xmlChar *)"scenario"))) { + xml_char = xmlGetProp(root, (const xmlChar *)"name"); + printf("scenario name: %s\n", xml_char); + scenario = calloc(1, sizeof(*scenario)); + scenario->name = xml_char; // nodup nofree + next_packet = &scenario->list_packet; + for (node = root->children; node != NULL; node = node->next) { + if ((!xmlStrcmp(node->name, (const xmlChar *)"packet"))) { + packet = parse_xml_packet(node); + if (NULL != packet) { + *next_packet = packet; + next_packet = &packet->next; + } else { + fprintf(stdout, "WARNING omitted packet:\n"); + display_node(node); + } + } + } + } + } else { + fprintf(stderr, "Empty xml document\n"); + } + xmlFreeDoc(doc); + xmlCleanupParser(); + return scenario; } //------------------------------------------------------------------------------ -int generate_play_scenario( +int generate_xml_scenario( const char const * test_dir_name, const char const * test_scenario_filename, const char const * enb_config_filename, @@ -180,7 +295,7 @@ int generate_play_scenario( xmlSubstituteEntitiesDefault(1); xmlLoadExtDtdDefaultValue = 1; - cur = xsltParseStylesheetFile(astring); + cur = xsltParseStylesheetFile((const xmlChar *)astring); if (NULL == cur) { AssertFatal (0, "Could not parse stylesheet file %s (check OPENAIR_DIR env variable)!\n", astring); } else { @@ -215,7 +330,6 @@ int generate_play_scenario( params[nb_params] = NULL; res = xsltApplyStylesheet(cur, doc, params); if (NULL != res) { - // since pdml filename is not relative (no path), just filename in current directory we can safely remove sprintf(play_scenario_filename,"%s",test_scenario_filename); if (strip_extension(play_scenario_filename) > 0) { strcat(play_scenario_filename, ".tsml"); @@ -237,8 +351,8 @@ int generate_play_scenario( ret = -1; } xsltFreeStylesheet(cur); - xmlFreeDoc(res); xmlFreeDoc(doc); + xmlFreeDoc(res); xsltCleanupGlobals(); xmlCleanupParser(); @@ -378,11 +492,13 @@ config_parse_opt_line ( int main( int argc, char **argv ) //------------------------------------------------------------------------------ { - int actions = 0; - char *test_dir_name = NULL; - char *scenario_file_name = NULL; - char *enb_config_file_name = NULL; - char play_scenario_filename[NAME_MAX]; + int actions = 0; + char *test_dir_name = NULL; + char *scenario_file_name = NULL; + char *enb_config_file_name = NULL; + char play_scenario_filename[NAME_MAX]; + int ret = 0; + test_scenario_t *scenario = NULL; memset(play_scenario_filename, 0, sizeof(play_scenario_filename)); g_openair_dir = getenv("OPENAIR_DIR"); @@ -393,13 +509,21 @@ int main( int argc, char **argv ) actions = config_parse_opt_line (argc, argv, &test_dir_name, &scenario_file_name, &enb_config_file_name); //Command-line options if (actions & PLAY_SCENARIO) { - if (generate_play_scenario(test_dir_name, scenario_file_name,enb_config_file_name, play_scenario_filename) == 0) { - play_scenario(play_scenario_filename); + if (generate_xml_scenario(test_dir_name, scenario_file_name,enb_config_file_name, play_scenario_filename) == 0) { + if (NULL != (scenario = generate_scenario(play_scenario_filename))) { + ret = play_scenario(scenario); + } else { + fprintf(stderr, "Error: Could not generate scenario from tsml file\n"); + ret = -1; + } + } else { + fprintf(stderr, "Error: Could not generate tsml scenario from xml file\n"); + ret = -1; } free_pointer(test_dir_name); free_pointer(scenario_file_name); free_pointer(enb_config_file_name); } - return 0; + return ret; } diff --git a/openair3/TEST/EPC_TEST/play_scenario.h b/openair3/TEST/EPC_TEST/play_scenario.h index c6e1087a04..4916950783 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.h +++ b/openair3/TEST/EPC_TEST/play_scenario.h @@ -37,12 +37,100 @@ #ifndef GENERATE_SCENARIO_H_ #define GENERATE_SCENARIO_H_ +# include +# include +#include /** @defgroup _enb_app ENB APP * @ingroup _oai2 * @{ */ +typedef enum { + ACTION_S1C_START = 0, + ACTION_S1C_NULL = ACTION_S1C_START, + ACTION_S1C_SEND, + ACTION_S1C_RECEIVE, + ACTION_S1C_END +} test_action_t; + +// from kernel source file 3.19/include/linux/sctp.h +typedef enum { + SCTP_CID_DATA = 0, + SCTP_CID_INIT = 1, + SCTP_CID_INIT_ACK = 2, + SCTP_CID_SACK = 3, + SCTP_CID_HEARTBEAT = 4, + SCTP_CID_HEARTBEAT_ACK = 5, + SCTP_CID_ABORT = 6, + SCTP_CID_SHUTDOWN = 7, + SCTP_CID_SHUTDOWN_ACK = 8, + SCTP_CID_ERROR = 9, + SCTP_CID_COOKIE_ECHO = 10, + SCTP_CID_COOKIE_ACK = 11, + SCTP_CID_ECN_ECNE = 12, + SCTP_CID_ECN_CWR = 13, + SCTP_CID_SHUTDOWN_COMPLETE = 14, + + /* AUTH Extension Section 4.1 */ + SCTP_CID_AUTH = 0x0F, + + /* PR-SCTP Sec 3.2 */ + SCTP_CID_FWD_TSN = 0xC0, + + /* Use hex, as defined in ADDIP sec. 3.1 */ + SCTP_CID_ASCONF = 0xC1, + SCTP_CID_ASCONF_ACK = 0x80, +} sctp_cid_t; /* enum */ + +// from kernel source file 3.19/include/linux/sctp.h, Big Endians +typedef struct sctp_datahdr_s { + uint32_t tsn; + uint16_t stream; + uint16_t ssn; + uint32_t ppid; + uint8_t payload[0]; +} sctp_datahdr_t; + +// from kernel source file 3.19/include/linux/sctp.h, Big Endians +typedef struct sctp_inithdr { + uint32_t init_tag; + uint32_t a_rwnd; + uint16_t num_outbound_streams; + uint16_t num_inbound_streams; + uint32_t initial_tsn; + uint8_t params[0]; +} sctp_inithdr_t; + +typedef sctp_inithdr_t sctp_initackhdr_t; + +typedef struct test_sctp_hdr_s { + unsigned int src_port; + unsigned int dst_port; + sctp_cid_t chunk_type; + union { + sctp_datahdr_t data_hdr; + sctp_inithdr_t init_hdr; + sctp_initackhdr_t init_ack_hdr; + } u; +} test_sctp_hdr_t; + +typedef struct test_packet_s { + test_action_t action; + struct timeval time_relative_to_first_packet; + struct timeval time_relative_to_last_packet; + test_sctp_hdr_t sctp_hdr; + uint16_t s1ap_byte_stream_count; + uint8_t *s1ap_byte_stream; + xmlNodePtr *s1ap_node; + + struct test_packet_s *next; +}test_packet_t; + +typedef struct test_scenario_s { + xmlChar *name; + test_packet_t *list_packet; +}test_scenario_t; inline void free_pointer(void *p) {if (NULL != p) {free(p); p=NULL;}}; #endif /* ENB_CONFIG_H_ */ diff --git a/openair3/TEST/EPC_TEST/play_scenario.xsl b/openair3/TEST/EPC_TEST/play_scenario.xsl index 1a89128005..6b1c36cc3d 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.xsl +++ b/openair3/TEST/EPC_TEST/play_scenario.xsl @@ -34,7 +34,7 @@ - + @@ -67,7 +67,7 @@ - + From 757b1940ace4f35888b5c0968c0fb0217b498aa1 Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 13 Nov 2015 14:04:00 +0100 Subject: [PATCH 010/214] Problem decoding S1AP --- cmake_targets/epc_test/CMakeLists.template | 2 + .../attach_complete.pdml | 2 +- openair3/TEST/EPC_TEST/generic_scenario.xsl | 91 +- openair3/TEST/EPC_TEST/play_scenario.c | 965 +++++++++++++++++- openair3/TEST/EPC_TEST/play_scenario.h | 68 +- 5 files changed, 1035 insertions(+), 93 deletions(-) diff --git a/cmake_targets/epc_test/CMakeLists.template b/cmake_targets/epc_test/CMakeLists.template index 12a745b997..5789c3eb5c 100644 --- a/cmake_targets/epc_test/CMakeLists.template +++ b/cmake_targets/epc_test/CMakeLists.template @@ -1,11 +1,13 @@ cmake_minimum_required(VERSION 2.8) set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) +set ( ASN_DEBUG False) set ( ADDR_CONF False ) set ( DEBUG_OMG False ) set ( DISABLE_XER_PRINT False ) set ( DRIVER2013 True ) set ( EMOS False ) +set ( EMIT_ASN_DEBUG True ) set ( ENABLE_FXP True ) set ( ENABLE_ITTI True ) set ( ENABLE_NAS_UE_LOGGING True ) diff --git a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/attach_complete.pdml b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/attach_complete.pdml index fef45773f9..f7c27272aa 100644 --- a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/attach_complete.pdml +++ b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/attach_complete.pdml @@ -1,7 +1,7 @@ - + diff --git a/openair3/TEST/EPC_TEST/generic_scenario.xsl b/openair3/TEST/EPC_TEST/generic_scenario.xsl index b1cadbcdfa..1d49b4942e 100644 --- a/openair3/TEST/EPC_TEST/generic_scenario.xsl +++ b/openair3/TEST/EPC_TEST/generic_scenario.xsl @@ -106,6 +106,7 @@ + @@ -131,16 +132,17 @@ - - - - + + + + + @@ -148,59 +150,61 @@ + - - - - - + + + + + - + - - - + + + + - - - - - - + + + + + - + - - - + + + + - - - - - - + + + + + + - + @@ -209,44 +213,47 @@ + - - - + + + - + + - - - + + + - + + - - - + + + - + diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index e73a41a683..a32947c439 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -53,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -60,9 +62,13 @@ #include "assertions.h" #include "play_scenario.h" -#include "s1ap_eNB.h" +//#include "s1ap_eNB.h" +#include "s1ap_common.h" +#include "s1ap_ies_defs.h" +#include "s1ap_eNB_decoder.h" #include "intertask_interface.h" #include "enb_config.h" +#include "log.h" //------------------------------------------------------------------------------ #define ENB_CONFIG_MAX_XSLT_PARAMS 32 #define PLAY_SCENARIO 1 @@ -73,8 +79,100 @@ char *g_openair_dir = NULL; //------------------------------------------------------------------------------ extern Enb_properties_array_t enb_properties; extern int xmlLoadExtDtdDefaultValue; - +extern int asn_debug; +extern int asn1_xer_print; //------------------------------------------------------------------------------ +void test_print_hex_octets(const unsigned char * const byte_stream, const unsigned long int num); +int is_file_exists ( const char const * file_nameP, const char const *file_roleP); +int strip_extension( char *in_filename); +int split_path ( char * pathP, char *** resP); +void display_node ( xmlNodePtr node, unsigned int indent); +void display_tree ( xmlNodePtr node, unsigned int indent); +//------------------------- +void free_packet(test_packet_t* packet); +void free_scenario(test_scenario_t* scenario); +//------------------------- +void display_packet_sctp_init(const sctp_inithdr_t * const sctp); +void display_packet_sctp_initack(const sctp_initackhdr_t * const sctp); +void display_packet_sctp_data(const sctp_datahdr_t * const sctp); +void display_packet_sctp(const test_sctp_hdr_t * const sctp); +void display_packet_ip(const test_ip_hdr_t * const ip); +void display_packet(const test_packet_t * const packet); +void display_scenario(const test_scenario_t * const scenario); +//------------------------- +char * test_ip2ip_str(const test_ip_t * const ip); +int hex2data(unsigned char * const data, const unsigned char * const hexstring, const unsigned int len); +sctp_cid_t chunk_type_str2cid(const xmlChar * const chunk_type_str); +const char * const chunk_type_cid2str(const sctp_cid_t chunk_type); +test_action_t action_str2test_action_t(const xmlChar * const action); +void ip_str2test_ip(const xmlChar * const ip_str, test_ip_t * const ip); +//------------------------- +int test_s1ap_decode_initiating_message(s1ap_message *message, S1ap_InitiatingMessage_t *initiating_p); +int test_s1ap_decode_successful_outcome(s1ap_message *message, S1ap_SuccessfulOutcome_t *successfullOutcome_p); +int test_s1ap_decode_unsuccessful_outcome(s1ap_message *message, S1ap_UnsuccessfulOutcome_t *unSuccessfullOutcome_p); +int test_s1ap_decode_pdu(s1ap_message *message, const uint8_t * const buffer,const uint32_t length); +void test_decode_s1ap(test_s1ap_t * const s1ap); +//------------------------- +void parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, test_s1ap_t * const s1ap); +void parse_sctp_data_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_datahdr_t * const sctp_hdr); +void parse_sctp_init_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_inithdr_t * const sctp_hdr); +void parse_sctp_init_ack_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_initackhdr_t * const sctp_hdr); +void parse_sctp(xmlDocPtr doc, const xmlNode const *sctp_node, test_sctp_hdr_t * const sctp_hdr); +test_packet_t* parse_xml_packet(xmlDocPtr doc, xmlNodePtr node); +//------------------------- +int play_scenario(test_scenario_t* scenario); +int generate_xml_scenario( + const char const * test_dir_name, + const char const * test_scenario_filename, + const char const * enb_config_filename, + char const * play_scenario_filename /* OUT PARAM*/); + +//----------------------------------------------------------------------------- +void test_print_hex_octets(const unsigned char * const byte_stream, const unsigned long int num) +//----------------------------------------------------------------------------- +{ + unsigned long octet_index = 0; + + if (byte_stream == NULL) { + return; + } + + + + + fprintf(stdout, "+-----+-------------------------------------------------+\n"); + fprintf(stdout, "| | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n"); + fprintf(stdout, "+-----+-------------------------------------------------+\n"); + + for (octet_index = 0; octet_index < num; octet_index++) { + if ((octet_index % 16) == 0) { + if (octet_index != 0) { + fprintf(stdout, " |\n"); + } + + fprintf(stdout, " %04ld |", octet_index); + } + + /* + * Print every single octet in hexadecimal form + */ + fprintf(stdout, " %02x", byte_stream[octet_index]); + /* + * Align newline and pipes according to the octets in groups of 2 + */ + } + + /* + * Append enough spaces and put final pipe + */ + unsigned char index; + + for (index = octet_index; index < 16; ++index) { + fprintf(stdout, " "); + } + + fprintf(stdout, " |\n"); +} //------------------------------------------------------------------------------ // test if file exist in current directory @@ -138,9 +236,14 @@ int split_path( char * pathP, char *** resP) return n_spaces; } //------------------------------------------------------------------------------ -void display_node(xmlNodePtr node) { +void display_node(xmlNodePtr node, unsigned int indent) +{ + int i = 0; if (node->type == XML_ELEMENT_NODE) { xmlChar *path = xmlGetNodePath(node); + for (i=0; ichildren != NULL && node->children->type == XML_TEXT_NODE) { xmlChar *content = xmlNodeGetContent(node); printf("%s -> %s\n", path, content); @@ -151,13 +254,229 @@ void display_node(xmlNodePtr node) { xmlFree(path); } } +/** + * print_element_names: + * @node: the initial xml node to consider. + * @indent: indentation level. + * + * Prints the names of the all the xml elements + * that are siblings or children of a given xml node. + */ +//------------------------------------------------------------------------------ +void display_tree(xmlNodePtr node, unsigned int indent) +{ + xmlNode *cur_node = NULL; + + for (cur_node = node; cur_node; cur_node = cur_node->next) { + if (cur_node->type == XML_ELEMENT_NODE) { + display_node(cur_node, indent); + } + display_tree(cur_node->children, indent++); + } +} +//------------------------------------------------------------------------------ +void free_packet(test_packet_t* packet) +{ + if (packet) { + switch (packet->sctp_hdr.chunk_type) { + case SCTP_CID_DATA: + free_pointer(packet->sctp_hdr.u.data_hdr.payload.binary_stream); + break; + default: + ; + } + free_pointer(packet); + } +} + //------------------------------------------------------------------------------ void free_scenario(test_scenario_t* scenario) { - //TODO + test_packet_t *packet = NULL; + test_packet_t *next_packet = NULL; + if (scenario) { + packet = scenario->list_packet; + while (packet) { + next_packet = packet->next; + free_packet(packet); + packet = next_packet->next; + } + free_pointer(scenario); + } +} + + +//------------------------------------------------------------------------------ +void display_packet_sctp_init(const sctp_inithdr_t * const sctp) +{ + + if (sctp) { + fprintf(stdout, "\t\tSCTP.init.init_tag : %u\n", sctp->init_tag); + fprintf(stdout, "\t\tSCTP.init.a_rwnd : %u\n", sctp->a_rwnd); + fprintf(stdout, "\t\tSCTP.init.num_inbound_streams : %u\n", sctp->num_inbound_streams); + fprintf(stdout, "\t\tSCTP.init.num_outbound_streams : %u\n", sctp->num_outbound_streams); + fprintf(stdout, "\t\tSCTP.init.initial_tsn : %u\n", sctp->initial_tsn); + } } //------------------------------------------------------------------------------ -sctp_cid_t chunk_type_str2cid(xmlChar *chunk_type_str) +void display_packet_sctp_initack(const sctp_initackhdr_t * const sctp) +{ + + if (sctp) { + fprintf(stdout, "\t\tSCTP.initack.init_tag : %u\n", sctp->init_tag); + fprintf(stdout, "\t\tSCTP.initack.a_rwnd : %u\n", sctp->a_rwnd); + fprintf(stdout, "\t\tSCTP.initack.num_inbound_streams : %u\n", sctp->num_inbound_streams); + fprintf(stdout, "\t\tSCTP.initack.num_outbound_streams : %u\n", sctp->num_outbound_streams); + fprintf(stdout, "\t\tSCTP.initack.initial_tsn : %u\n", sctp->initial_tsn); + } +} +//------------------------------------------------------------------------------ +void display_packet_sctp_data(const sctp_datahdr_t * const sctp) +{ + if (sctp) { + fprintf(stdout, "\t\tSCTP.data.tsn : %u\n", sctp->tsn); + fprintf(stdout, "\t\tSCTP.data.stream : %u\n", sctp->stream); + fprintf(stdout, "\t\tSCTP.data.ssn : %u\n", sctp->ssn); + fprintf(stdout, "\t\tSCTP.data.ppid : %u\n", sctp->ppid); + //fprintf(stdout, "\t\tSCTP.data.pdu_type : %u\n", sctp->payload.pdu_type); + //fprintf(stdout, "\t\tSCTP.data.procedure_code : %u\n", sctp->payload.procedure_code); + fprintf(stdout, "\t\tSCTP.data.binary_stream_allocated_size : %u\n", sctp->payload.binary_stream_allocated_size); + if (NULL != sctp->payload.binary_stream) { + fprintf(stdout, "\t\tSCTP.data.binary_stream :\n"); + test_print_hex_octets(sctp->payload.binary_stream, sctp->payload.binary_stream_allocated_size); + } else { + fprintf(stdout, "\t\tSCTP.data.binary_stream : NULL\n"); + } + } +} + +//------------------------------------------------------------------------------ +void display_packet_sctp(const test_sctp_hdr_t * const sctp) +{ + if (sctp) { + fprintf(stdout, "\t\tSCTP.src_port : %u\n", sctp->src_port); + fprintf(stdout, "\t\tSCTP.dst_port : %u\n", sctp->dst_port); + fprintf(stdout, "\t\tSCTP.chunk_type : %s\n", chunk_type_cid2str(sctp->chunk_type)); + switch (sctp->chunk_type) { + case SCTP_CID_DATA: + display_packet_sctp_data(&sctp->u.data_hdr); + break; + case SCTP_CID_INIT: + display_packet_sctp_initack(&sctp->u.init_hdr); + break; + case SCTP_CID_INIT_ACK: + display_packet_sctp_initack(&sctp->u.init_ack_hdr); + break; + default: + ; + } + } +} +//------------------------------------------------------------------------------ +void display_packet_ip(const test_ip_hdr_t * const ip) +{ + if (ip) { + fprintf(stdout, "\t\tSource address : %s\n", test_ip2ip_str(&ip->src)); + fprintf(stdout, "\t\tDestination address : %s\n", test_ip2ip_str(&ip->dst)); + } +} + +//------------------------------------------------------------------------------ +void display_packet(const test_packet_t * const packet) +{ + if (packet) { + fprintf(stdout, "\tPacket:\tnum %u | original frame number %u \n", packet->packet_number, packet->original_frame_number); + fprintf(stdout, "\tPacket:\ttime relative to 1st packet %ld.%06lu\n", + packet->time_relative_to_first_packet.tv_sec, packet->time_relative_to_first_packet.tv_usec); + fprintf(stdout, "\tPacket:\ttime relative to last tx packet %ld.%06lu\n", + packet->time_relative_to_last_sent_packet.tv_sec, packet->time_relative_to_last_sent_packet.tv_usec); + fprintf(stdout, "\tPacket:\ttime relative to last_received packet %ld.%06lu\n", + packet->time_relative_to_last_received_packet.tv_sec, packet->time_relative_to_last_received_packet.tv_usec); + + switch(packet->action) { + case ACTION_S1C_SEND: + fprintf(stdout, "\tPacket:\tAction SEND\n"); + break; + case ACTION_S1C_RECEIVE: + fprintf(stdout, "\tPacket:\tAction RECEIVE\n"); + break; + default: + fprintf(stdout, "\tPacket:\tAction UNKNOWN\n"); + } + display_packet_ip(&packet->ip_hdr); + display_packet_sctp(&packet->sctp_hdr); + } +} +//------------------------------------------------------------------------------ +void display_scenario(const test_scenario_t * const scenario) +{ + test_packet_t *packet = NULL; + if (scenario) { + fprintf(stdout, "Scenario: %s\n", (scenario->name != NULL) ? (char*)scenario->name:"UNKNOWN NAME"); + packet = scenario->list_packet; + while (packet) { + display_packet(packet); + packet = packet->next; + } + } +} + +//------------------------------------------------------------------------------ +char * test_ip2ip_str(const test_ip_t * const ip) +{ + static char str[INET6_ADDRSTRLEN]; + + sprintf(str, "ERROR"); + switch (ip->address_family) { + case AF_INET6: + inet_ntop(AF_INET6, &(ip->address.ipv6), str, INET6_ADDRSTRLEN); + break; + case AF_INET: + inet_ntop(AF_INET, &(ip->address.ipv4), str, INET_ADDRSTRLEN); + break; + default: + ; + } + return str; +} +//------------------------------------------------------------------------------ +//convert hexstring to len bytes of data +//returns 0 on success, negative on error +//data is a buffer of at least len bytes +//hexstring is upper or lower case hexadecimal, NOT prepended with "0x" +int hex2data(unsigned char * const data, const unsigned char * const hexstring, const unsigned int len) +{ + unsigned const char *pos = hexstring; + char *endptr = NULL; + size_t count = 0; + + fprintf(stdout, "%s(%s,%d)\n", __FUNCTION__, hexstring, len); + + if ((len > 1) && (strlen((const char*)hexstring) % 2)) { + //or hexstring has an odd length + return -3; + } + + if (len == 1) { + char buf[5] = {'0', 'x', 0, pos[0], '\0'}; + data[0] = strtol(buf, &endptr, 16); + /* Check for various possible errors */ + AssertFatal ((errno == 0) || (data[0] != 0), "ERROR %s() strtol: %s\n", __FUNCTION__, strerror(errno)); + AssertFatal (endptr != buf, "ERROR %s() No digits were found\n", __FUNCTION__); + return 0; + } + + for(count = 0; count < len/2; count++) { + char buf[5] = {'0', 'x', pos[0], pos[1], 0}; + data[count] = strtol(buf, &endptr, 16); + pos += 2 * sizeof(char); + AssertFatal (endptr[0] == '\0', "ERROR %s() non-hexadecimal character encountered buf %p endptr %p buf %s count %d pos %p\n", __FUNCTION__, buf, endptr, buf, count, pos); + AssertFatal (endptr != buf, "ERROR %s() No digits were found\n", __FUNCTION__); + } + return 0; +} +//------------------------------------------------------------------------------ +sctp_cid_t chunk_type_str2cid(const xmlChar * const chunk_type_str) { if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"DATA"))) { return SCTP_CID_DATA;} if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"INIT"))) { return SCTP_CID_INIT;} @@ -178,31 +497,599 @@ sctp_cid_t chunk_type_str2cid(xmlChar *chunk_type_str) if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"FWD_TSN"))) { return SCTP_CID_FWD_TSN;} if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ASCONF"))) { return SCTP_CID_ASCONF;} if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ASCONF_ACK"))) { return SCTP_CID_ASCONF_ACK;} - fprintf(stderr, "ERROR: Could not convert: %s\n", chunk_type_str); - exit(-1); + AssertFatal (0, "ERROR: %s() cannot convert: %s\n", __FUNCTION__, chunk_type_str); } //------------------------------------------------------------------------------ -test_packet_t* parse_xml_packet(xmlNodePtr node) { +const char * const chunk_type_cid2str(const sctp_cid_t chunk_type) +{ + switch (chunk_type) { + case SCTP_CID_DATA: return "DATA"; break; + case SCTP_CID_INIT: return "INIT"; break; + case SCTP_CID_INIT_ACK: return "INIT_ACK"; break; + case SCTP_CID_SACK: return "SACK"; break; + case SCTP_CID_HEARTBEAT: return "HEARTBEAT"; break; + case SCTP_CID_HEARTBEAT_ACK: return "HEARTBEAT_ACK"; break; + case SCTP_CID_ABORT: return "ABORT"; break; + case SCTP_CID_SHUTDOWN: return "SHUTDOWN"; break; + case SCTP_CID_SHUTDOWN_ACK: return "SHUTDOWN_ACK"; break; + case SCTP_CID_ERROR: return "ERROR"; break; + case SCTP_CID_COOKIE_ECHO: return "COOKIE_ECHO"; break; + case SCTP_CID_COOKIE_ACK: return "COOKIE_ACK"; break; + case SCTP_CID_ECN_ECNE: return "ECN_ECNE"; break; + case SCTP_CID_ECN_CWR: return "ECN_CWR"; break; + case SCTP_CID_SHUTDOWN_COMPLETE: return "SHUTDOWN_COMPLETE"; break; + case SCTP_CID_AUTH: return "AUTH"; break; + case SCTP_CID_FWD_TSN: return "FWD_TSN"; break; + case SCTP_CID_ASCONF: return "ASCONF"; break; + case SCTP_CID_ASCONF_ACK: return "ASCONF_ACK"; break; + default: + AssertFatal (0, "ERROR %s(): Unknown chunk_type %d!\n", __FUNCTION__, chunk_type); + } +} +//------------------------------------------------------------------------------ +test_action_t action_str2test_action_t(const xmlChar * const action) +{ + if ((!xmlStrcmp(action, (const xmlChar *)"SEND"))) { return ACTION_S1C_SEND;} + if ((!xmlStrcmp(action, (const xmlChar *)"RECEIVE"))) { return ACTION_S1C_RECEIVE;} + AssertFatal (0, "ERROR: %s cannot convert: %s\n", __FUNCTION__, action); + //if (NULL == action) {return ACTION_S1C_NULL;} +} +//------------------------------------------------------------------------------ +void ip_str2test_ip(const xmlChar * const ip_str, test_ip_t * const ip) +{ + AssertFatal (NULL != ip_str, "ERROR %s() Cannot convert null string to ip address!\n", __FUNCTION__); + AssertFatal (NULL != ip, "ERROR %s() out parameter pointer is NULL!\n", __FUNCTION__); + // store this IP address in sa: + if (inet_pton(AF_INET, (const char*)ip_str, (void*)&(ip->address.ipv4)) > 0) { + ip->address_family = AF_INET; + } else if (inet_pton(AF_INET6, (const char*)ip_str, (void*)&(ip->address.ipv6)) > 0) { + ip->address_family = AF_INET6; + } else { + ip->address_family = AF_UNSPEC; + AssertFatal (0, "ERROR %s() Could not parse ip address %s!\n", __FUNCTION__, ip_str); + } +} +//------------------------------------------------------------------------------ +int test_s1ap_decode_initiating_message(s1ap_message *message, + S1ap_InitiatingMessage_t *initiating_p) +{ + int ret = -1; - test_packet_t *packet = NULL; - xmlNode *cur_node = NULL; - xmlChar *xml_char = NULL; + DevAssert(initiating_p != NULL); + + message->procedureCode = initiating_p->procedureCode; + message->criticality = initiating_p->criticality; + + switch(initiating_p->procedureCode) { + case S1ap_ProcedureCode_id_downlinkNASTransport: + ret = s1ap_decode_s1ap_downlinknastransporties( + &message->msg.s1ap_DownlinkNASTransportIEs, + &initiating_p->value); + break; + + case S1ap_ProcedureCode_id_InitialContextSetup: + ret = s1ap_decode_s1ap_initialcontextsetuprequesties( + &message->msg.s1ap_InitialContextSetupRequestIEs, &initiating_p->value); + break; + + case S1ap_ProcedureCode_id_UEContextRelease: + ret = s1ap_decode_s1ap_uecontextreleasecommandies( + &message->msg.s1ap_UEContextReleaseCommandIEs, &initiating_p->value); + break; + + case S1ap_ProcedureCode_id_Paging: + ret = s1ap_decode_s1ap_pagingies( + &message->msg.s1ap_PagingIEs, &initiating_p->value); + break; + + case S1ap_ProcedureCode_id_uplinkNASTransport: { + ret = s1ap_decode_s1ap_uplinknastransporties (&message->msg.s1ap_UplinkNASTransportIEs, &initiating_p->value); + } + break; + + case S1ap_ProcedureCode_id_S1Setup: { + ret = s1ap_decode_s1ap_s1setuprequesties (&message->msg.s1ap_S1SetupRequestIEs, &initiating_p->value); + } + break; + + case S1ap_ProcedureCode_id_initialUEMessage: { + ret = s1ap_decode_s1ap_initialuemessageies (&message->msg.s1ap_InitialUEMessageIEs, &initiating_p->value); + } + break; + + case S1ap_ProcedureCode_id_UEContextReleaseRequest: { + ret = s1ap_decode_s1ap_uecontextreleaserequesties (&message->msg.s1ap_UEContextReleaseRequestIEs, &initiating_p->value); + } + break; + + case S1ap_ProcedureCode_id_UECapabilityInfoIndication: { + ret = s1ap_decode_s1ap_uecapabilityinfoindicationies (&message->msg.s1ap_UECapabilityInfoIndicationIEs, &initiating_p->value); + } + break; + + case S1ap_ProcedureCode_id_NASNonDeliveryIndication: { + ret = s1ap_decode_s1ap_nasnondeliveryindication_ies (&message->msg.s1ap_NASNonDeliveryIndication_IEs, &initiating_p->value); + } + break; + + default: + AssertFatal( 0 , "Unknown procedure ID (%d) for initiating message\n", + (int)initiating_p->procedureCode); + return -1; + } + return ret; +} + +//------------------------------------------------------------------------------ +int test_s1ap_decode_successful_outcome(s1ap_message *message, + S1ap_SuccessfulOutcome_t *successfullOutcome_p) +{ + int ret = -1; + + DevAssert(successfullOutcome_p != NULL); + + message->procedureCode = successfullOutcome_p->procedureCode; + message->criticality = successfullOutcome_p->criticality; + + switch(successfullOutcome_p->procedureCode) { + case S1ap_ProcedureCode_id_S1Setup: + ret = s1ap_decode_s1ap_s1setupresponseies( + &message->msg.s1ap_S1SetupResponseIEs, &successfullOutcome_p->value); + break; + + case S1ap_ProcedureCode_id_InitialContextSetup: { + ret = s1ap_decode_s1ap_initialcontextsetupresponseies (&message->msg.s1ap_InitialContextSetupResponseIEs, &successfullOutcome_p->value); + } + break; + + case S1ap_ProcedureCode_id_UEContextRelease: { + ret = s1ap_decode_s1ap_uecontextreleasecompleteies (&message->msg.s1ap_UEContextReleaseCompleteIEs, &successfullOutcome_p->value); + } + break; + + default: + AssertFatal(0, "Unknown procedure ID (%d) for successfull outcome message\n", + (int)successfullOutcome_p->procedureCode); + return -1; + } + return ret; +} + +//------------------------------------------------------------------------------ +int test_s1ap_decode_unsuccessful_outcome(s1ap_message *message, + S1ap_UnsuccessfulOutcome_t *unSuccessfullOutcome_p) +{ + int ret = -1; + DevAssert(unSuccessfullOutcome_p != NULL); + + message->procedureCode = unSuccessfullOutcome_p->procedureCode; + message->criticality = unSuccessfullOutcome_p->criticality; + + switch(unSuccessfullOutcome_p->procedureCode) { + case S1ap_ProcedureCode_id_S1Setup: + return s1ap_decode_s1ap_s1setupfailureies( + &message->msg.s1ap_S1SetupFailureIEs, &unSuccessfullOutcome_p->value); + + case S1ap_ProcedureCode_id_InitialContextSetup: { + ret = s1ap_decode_s1ap_initialcontextsetupfailureies (&message->msg.s1ap_InitialContextSetupFailureIEs, &unSuccessfullOutcome_p->value); + } + break; + + + default: + AssertFatal(0,"Unknown procedure ID (%d) for unsuccessfull outcome message\n", + (int)unSuccessfullOutcome_p->procedureCode); + break; + } + + return ret; +} + +//------------------------------------------------------------------------------ +int test_s1ap_decode_pdu(s1ap_message *message, const uint8_t * const buffer, + const uint32_t length) +{ + S1AP_PDU_t pdu; + S1AP_PDU_t *pdu_p = &pdu; + asn_dec_rval_t dec_ret; + + DevAssert(buffer != NULL); + + memset((void *)pdu_p, 0, sizeof(S1AP_PDU_t)); + + dec_ret = aper_decode(NULL, + &asn_DEF_S1AP_PDU, + (void **)&pdu_p, + buffer, + length, + 0, + 0); + + if (dec_ret.code != RC_OK) { + S1AP_ERROR("Failed to decode pdu\n"); + return -1; + } + + message->direction = pdu_p->present; + + switch(pdu_p->present) { + case S1AP_PDU_PR_initiatingMessage: + return test_s1ap_decode_initiating_message(message, + &pdu_p->choice.initiatingMessage); + + case S1AP_PDU_PR_successfulOutcome: + return test_s1ap_decode_successful_outcome(message, + &pdu_p->choice.successfulOutcome); + + case S1AP_PDU_PR_unsuccessfulOutcome: + return test_s1ap_decode_unsuccessful_outcome(message, + &pdu_p->choice.unsuccessfulOutcome); + + default: + AssertFatal(0, "Unknown presence (%d) or not implemented\n", (int)pdu_p->present); + break; + } + return -1; +} +//------------------------------------------------------------------------------ +void test_decode_s1ap(test_s1ap_t * const s1ap) +{ + if (NULL != s1ap) { + if (test_s1ap_decode_pdu(&s1ap->message, s1ap->binary_stream, s1ap->binary_stream_allocated_size) < 0) { + AssertFatal (0, "ERROR %s() Cannot decode S1AP message!\n", __FUNCTION__); + } + } +} +//------------------------------------------------------------------------------ +void parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, test_s1ap_t * const s1ap) +{ + xmlNode *cur_node = NULL; + xmlChar *xml_char = NULL; + xmlChar *xml_char2 = NULL; + unsigned int size = 0; + int rc = 0; + unsigned int go_deeper_in_tree = 1; + + if ((NULL != s1ap_node) && (NULL != s1ap)) { + for (cur_node = (xmlNode *)s1ap_node; cur_node; cur_node = cur_node->next) { + go_deeper_in_tree = 1; + if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"field"))) { + // do not get hidden fields + xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"hide"); + if (NULL != xml_char) { + if ((!xmlStrcmp(xml_char, (const xmlChar *)"yes"))) { + xmlFree(xml_char); + return; + } + xmlFree(xml_char); + } + // first get size + xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"size"); + if (NULL != xml_char) { + size = strtoul((const char *)xml_char, NULL, 0); + xmlFree(xml_char); + // second: try to get value (always hex) + xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); + if (NULL != xml_char) { + xml_char2 = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"name"); + fprintf(stdout, "s1ap %p field %s size %d value %s\n",s1ap, xml_char2, size, xml_char); + xmlFree(xml_char2); + // if success to get value, do not parse children + //AssertFatal ((xmlStrlen(xml_char) == size), "ERROR %s() mismatch in size %d and strlen %d\n", __FUNCTION__, size, xmlStrlen(xml_char)); + //if (xmlStrlen(xml_char) == size) { + AssertFatal ((s1ap->binary_stream_pos+xmlStrlen(xml_char)/2) <= s1ap->binary_stream_allocated_size, + "ERROR %s() in buffer size: binary_stream_pos %d xmlStrlen(xml_char)/2=%d\n", __FUNCTION__, s1ap->binary_stream_pos, xmlStrlen(xml_char)/2); + rc = hex2data( &s1ap->binary_stream[s1ap->binary_stream_pos], xml_char, xmlStrlen(xml_char)); + s1ap->binary_stream_pos += xmlStrlen(xml_char)/2; + display_node(cur_node, 0); + AssertFatal (rc >= 0, "ERROR %s() in converting hex string %s len %d size %d rc %d\n", __FUNCTION__, xml_char, xmlStrlen(xml_char), size, rc); + go_deeper_in_tree = 0; + //} + xmlFree(xml_char); + } + } + } + if (0 < go_deeper_in_tree) { + parse_s1ap(doc, cur_node->children, s1ap); + } + } + } +} + +//------------------------------------------------------------------------------ +void parse_sctp_data_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_datahdr_t * const sctp_hdr) +{ + xmlNode *cur_node = NULL; + xmlChar *xml_char = NULL; + xmlChar *xml_char2 = NULL; + + if ((NULL != sctp_node) && (NULL != sctp_hdr)) { + xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); + if (NULL != xml_char) { + if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_payload_proto_id"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); + if (NULL != xml_char2) { + sctp_hdr->ppid = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_sid"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); + if (NULL != xml_char2) { + sctp_hdr->stream = strtoul((const char *)xml_char2, NULL, 16); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_tsn"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); + if (NULL != xml_char2) { + sctp_hdr->tsn = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_ssn"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); + if (NULL != xml_char2) { + sctp_hdr->ssn = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } + xmlFree(xml_char); + } + for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) { + parse_sctp_data_chunk(doc, cur_node, sctp_hdr); + } + } + +} +//------------------------------------------------------------------------------ +void parse_sctp_init_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_inithdr_t * const sctp_hdr) +{ + xmlNode *cur_node = NULL; + xmlChar *xml_char = NULL; + xmlChar *xml_char2 = NULL; + + if ((NULL != sctp_node) && (NULL != sctp_hdr)) { + xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); + if (NULL != xml_char) { + if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_nr_out_streams"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); + if (NULL != xml_char2) { + sctp_hdr->num_outbound_streams = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_nr_in_streams"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); + if (NULL != xml_char2) { + sctp_hdr->num_inbound_streams = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_credit"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); + if (NULL != xml_char2) { + sctp_hdr->a_rwnd = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_initial_tsn"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); + if (NULL != xml_char2) { + sctp_hdr->initial_tsn = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_initiate_tag"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); + if (NULL != xml_char2) { + sctp_hdr->init_tag = strtoul((const char *)xml_char2, NULL, 16); + xmlFree(xml_char2); + } + } + xmlFree(xml_char); + } + for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) { + parse_sctp_init_chunk(doc, cur_node, sctp_hdr); + } + } +} +//------------------------------------------------------------------------------ +void parse_sctp_init_ack_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_initackhdr_t * const sctp_hdr) +{ + xmlNode *cur_node = NULL; + xmlChar *xml_char = NULL; + xmlChar *xml_char2 = NULL; + + if ((NULL != sctp_node) && (NULL != sctp_hdr)) { + xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); + if (NULL != xml_char) { + if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_nr_out_streams"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); + if (NULL != xml_char2) { + sctp_hdr->num_outbound_streams = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_nr_in_streams"))) { + xml_char2 = xmlGetProp((xmlNode *)(xmlNode *)sctp_node, (const xmlChar *)"value"); + if (NULL != xml_char2) { + sctp_hdr->num_inbound_streams = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_credit"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); + if (NULL != xml_char2) { + sctp_hdr->a_rwnd = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_initial_tsn"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); + if (NULL != xml_char2) { + sctp_hdr->initial_tsn = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_initiate_tag"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); + if (NULL != xml_char2) { + sctp_hdr->init_tag = strtoul((const char *)xml_char2, NULL, 16); + xmlFree(xml_char2); + } + } + xmlFree(xml_char); + } + for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) { + parse_sctp_init_ack_chunk(doc, cur_node, sctp_hdr); + } + } +} +//------------------------------------------------------------------------------ +void parse_sctp(xmlDocPtr doc, const xmlNode const *sctp_node, test_sctp_hdr_t * const sctp_hdr) +{ + xmlNode *cur_node = NULL; + xmlChar *xml_char = NULL; + xmlChar *xml_char2 = NULL; + + if ((NULL != sctp_node) && (NULL != sctp_hdr)) { + if ((!xmlStrcmp(sctp_node->name, (const xmlChar *)"proto"))) { + xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); + if (NULL != xml_char) { + if ((!xmlStrcmp(xml_char, (const xmlChar *)"s1ap"))) { + xmlFree(xml_char); + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"size"); + if (NULL != xml_char2) { + sctp_hdr->u.data_hdr.payload.binary_stream_allocated_size = strtoul((const char *)xml_char2, NULL, 0); + sctp_hdr->u.data_hdr.payload.binary_stream = calloc(1, sctp_hdr->u.data_hdr.payload.binary_stream_allocated_size); + xmlFree(xml_char2); + } + parse_s1ap(doc, sctp_node, &sctp_hdr->u.data_hdr.payload); + test_decode_s1ap(&sctp_hdr->u.data_hdr.payload); + return; + } + xmlFree(xml_char); + } + } + //if ((cur_node->type == XML_ATTRIBUTE_NODE) || (cur_node->type == XML_ELEMENT_NODE)) { + xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); + if (NULL != xml_char) { + if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.srcport"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); + if (NULL != xml_char2) { + sctp_hdr->src_port = strtoul((const char *)xml_char2, NULL, 16); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.dstport"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); + if (NULL != xml_char2) { + sctp_hdr->dst_port = strtoul((const char *)xml_char2, NULL, 16); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.chunk_type"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); + if (NULL != xml_char2) { + sctp_hdr->chunk_type = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + switch (sctp_hdr->chunk_type) { + case SCTP_CID_DATA: + parse_sctp_data_chunk(doc, sctp_node->parent, &sctp_hdr->u.data_hdr); + break; + case SCTP_CID_INIT: + parse_sctp_init_chunk(doc, sctp_node->parent, &sctp_hdr->u.init_hdr); + break; + case SCTP_CID_INIT_ACK: + parse_sctp_init_ack_chunk(doc, sctp_node->parent, &sctp_hdr->u.init_ack_hdr); + break; + default: + ; + } + } + } + } + for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) { + parse_sctp(doc, cur_node, sctp_hdr); + } + } +} +//------------------------------------------------------------------------------ +test_packet_t* parse_xml_packet(xmlDocPtr doc, xmlNodePtr node) { + + test_packet_t *packet = NULL; + xmlNode *cur_node = NULL; + xmlChar *xml_char = NULL; + float afloat = (float)0.0; + static struct timeval initial_time = { .tv_sec = 0, .tv_usec = 0 }; + static struct timeval relative_last_sent_packet = { .tv_sec = 0, .tv_usec = 0 }; + static struct timeval relative_last_received_packet = { .tv_sec = 0, .tv_usec = 0 }; + static char first_packet = 1; + static char first_sent_packet = 1; + static char first_received_packet = 1; + static unsigned int packet_number = 1; if (NULL != node) { packet = calloc(1, sizeof(*packet)); + xml_char = xmlGetProp(node, (const xmlChar *)"action"); + packet->action = action_str2test_action_t(xml_char); + xmlFree(xml_char); + packet->packet_number = packet_number++; + for (cur_node = node->children; cur_node; cur_node = cur_node->next) { - if (cur_node->type == XML_ELEMENT_NODE) { - printf("node type: Element, name: %s\n", cur_node->name); + //if (cur_node->type == XML_ELEMENT_NODE) { if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"frame.time_relative"))) { + xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); + afloat = atof((const char*)xml_char); + xmlFree(xml_char); + packet->time_relative_to_first_packet.tv_sec = (int)afloat; + packet->time_relative_to_first_packet.tv_usec = (int)((afloat - packet->time_relative_to_first_packet.tv_sec)*1000000); + + if (first_packet > 0) { + initial_time = packet->time_relative_to_first_packet; + packet->time_relative_to_first_packet.tv_sec = 0; + packet->time_relative_to_first_packet.tv_usec = 0; + first_packet = 0; + } else { + timersub(&packet->time_relative_to_first_packet, &initial_time, + &packet->time_relative_to_first_packet); + } + if (packet->action == ACTION_S1C_SEND) { + if (first_sent_packet > 0) { + relative_last_sent_packet = packet->time_relative_to_first_packet; + packet->time_relative_to_last_sent_packet.tv_sec = 0; + packet->time_relative_to_last_sent_packet.tv_usec = 0; + first_sent_packet = 0; + } else { + timersub(&packet->time_relative_to_first_packet, &relative_last_sent_packet, + &packet->time_relative_to_last_sent_packet); + relative_last_sent_packet = packet->time_relative_to_first_packet; + } + } else if (packet->action == ACTION_S1C_RECEIVE) { + if (first_received_packet > 0) { + relative_last_received_packet.tv_sec = packet->time_relative_to_first_packet.tv_sec; + relative_last_received_packet.tv_usec = packet->time_relative_to_first_packet.tv_usec; + packet->time_relative_to_last_received_packet.tv_sec = 0; + packet->time_relative_to_last_received_packet.tv_usec = 0; + first_received_packet = 0; + } else { + timersub(&packet->time_relative_to_first_packet, &relative_last_received_packet, + &packet->time_relative_to_last_received_packet); + relative_last_received_packet = packet->time_relative_to_first_packet; + } + } + + } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"frame.number"))) { + xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); + packet->original_frame_number = strtoul((const char *)xml_char, NULL, 0); + xmlFree(xml_char); } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"ip.src"))) { + xml_char = xmlNodeListGetString(doc, cur_node->xmlChildrenNode, 1); + ip_str2test_ip(xml_char, &packet->ip_hdr.src); + xmlFree(xml_char); } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"ip.dst"))) { - } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"sctp.chunk_type_str"))) { - xml_char = xmlGetProp(cur_node, (const xmlChar *)"value"); - packet->sctp_hdr.chunk_type = chunk_type_str2cid(xml_char); - fprintf(stdout, "chunk_type_str2cid: %s\n", xml_char); + xml_char = xmlNodeListGetString(doc, cur_node->xmlChildrenNode, 1); + ip_str2test_ip(xml_char, &packet->ip_hdr.dst); + xmlFree(xml_char); + } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"proto"))) { + xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"name"); + if (NULL != xml_char) { + if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp"))) { + parse_sctp(doc, cur_node, &packet->sctp_hdr); + } + xmlFree(xml_char); + } } - } + //} } } return packet; @@ -210,11 +1097,12 @@ test_packet_t* parse_xml_packet(xmlNodePtr node) { //------------------------------------------------------------------------------ int play_scenario(test_scenario_t* scenario) { //TODO + display_scenario(scenario); return 0; } //------------------------------------------------------------------------------ test_scenario_t* generate_scenario( - const char const * play_scenario_filename ) + const char * const play_scenario_filename ) { xmlDocPtr doc = NULL; xmlNodePtr root = NULL; @@ -229,6 +1117,7 @@ test_scenario_t* generate_scenario( AssertFatal (0, "Could not parse scenario xml file %s!\n", play_scenario_filename); } else { fprintf(stdout, "Test scenario file to play: %s\n", play_scenario_filename); + //xmlDebugDumpDocument(NULL, doc); } // Get root @@ -242,13 +1131,13 @@ test_scenario_t* generate_scenario( next_packet = &scenario->list_packet; for (node = root->children; node != NULL; node = node->next) { if ((!xmlStrcmp(node->name, (const xmlChar *)"packet"))) { - packet = parse_xml_packet(node); + packet = parse_xml_packet(doc, node); if (NULL != packet) { *next_packet = packet; next_packet = &packet->next; } else { fprintf(stdout, "WARNING omitted packet:\n"); - display_node(node); + display_node(node, 0); } } } @@ -285,7 +1174,7 @@ int generate_xml_scenario( if (getcwd(astring, sizeof(astring)) != NULL) { fprintf(stdout, "working in %s directory\n", astring); } else { - perror("getcwd() error"); + perror("getcwd() ERROR"); exit(1); } @@ -332,22 +1221,22 @@ int generate_xml_scenario( if (NULL != res) { sprintf(play_scenario_filename,"%s",test_scenario_filename); if (strip_extension(play_scenario_filename) > 0) { - strcat(play_scenario_filename, ".tsml"); + strcat((char *)play_scenario_filename, ".tsml"); play_scenario_file = fopen( play_scenario_filename, "w+"); if (NULL != play_scenario_file) { xsltSaveResultToFile(play_scenario_file, res, cur); fclose(play_scenario_file); fprintf(stdout, "Wrote test scenario to %s\n", play_scenario_filename); } else { - fprintf(stderr, "Error in fopen(%s)\n", play_scenario_filename); + fprintf(stderr, "ERROR in fopen(%s)\n", play_scenario_filename); ret = -1; } } else { - fprintf(stderr, "Error in strip_extension()\n"); + fprintf(stderr, "ERROR in strip_extension()\n"); ret = -1; } } else { - fprintf(stderr, "Error in xsltApplyStylesheet()\n"); + fprintf(stderr, "ERROR in xsltApplyStylesheet()\n"); ret = -1; } xsltFreeStylesheet(cur); @@ -466,23 +1355,23 @@ config_parse_opt_line ( exit(1); } if (chdir(*test_dir_name) != 0) { - fprintf(stderr, "Error: chdir %s returned %s\n", *test_dir_name, strerror(errno)); + fprintf(stderr, "ERROR: chdir %s returned %s\n", *test_dir_name, strerror(errno)); exit(1); } if (rv & PLAY_SCENARIO) { if (NULL == *enb_config_file_name) { - fprintf(stderr, "Error: please provide the original eNB config file name that should be in %s\n", *test_dir_name); + fprintf(stderr, "ERROR: please provide the original eNB config file name that should be in %s\n", *test_dir_name); } if (is_file_exists(*enb_config_file_name, "eNB config file") != GS_IS_FILE) { - fprintf(stderr, "Error: original eNB config file name %s is not found in dir %s\n", *enb_config_file_name, *test_dir_name); + fprintf(stderr, "ERROR: original eNB config file name %s is not found in dir %s\n", *enb_config_file_name, *test_dir_name); } enb_properties_p = enb_config_init(*enb_config_file_name); if (NULL == *scenario_file_name) { - fprintf(stderr, "Error: please provide the scenario file name that should be in %s\n", *test_dir_name); + fprintf(stderr, "ERROR: please provide the scenario file name that should be in %s\n", *test_dir_name); } if (is_file_exists(*scenario_file_name, "Scenario file") != GS_IS_FILE) { - fprintf(stderr, "Error: Scenario file name %s is not found in dir %s\n", *scenario_file_name, *test_dir_name); + fprintf(stderr, "ERROR: Scenario file name %s is not found in dir %s\n", *scenario_file_name, *test_dir_name); } } return rv; @@ -503,21 +1392,29 @@ int main( int argc, char **argv ) memset(play_scenario_filename, 0, sizeof(play_scenario_filename)); g_openair_dir = getenv("OPENAIR_DIR"); if (NULL == g_openair_dir) { - fprintf(stderr, "Error: Could not get OPENAIR_DIR environment variable\n"); + fprintf(stderr, "ERROR: Could not get OPENAIR_DIR environment variable\n"); exit(1); } + // logging + logInit(); + set_comp_log(S1AP, LOG_TRACE, LOG_MED,1); + set_comp_log(SCTP, LOG_TRACE, LOG_MED,1); + asn_debug = 1; + asn1_xer_print = 1; + + //parameters actions = config_parse_opt_line (argc, argv, &test_dir_name, &scenario_file_name, &enb_config_file_name); //Command-line options if (actions & PLAY_SCENARIO) { if (generate_xml_scenario(test_dir_name, scenario_file_name,enb_config_file_name, play_scenario_filename) == 0) { if (NULL != (scenario = generate_scenario(play_scenario_filename))) { ret = play_scenario(scenario); } else { - fprintf(stderr, "Error: Could not generate scenario from tsml file\n"); + fprintf(stderr, "ERROR: Could not generate scenario from tsml file\n"); ret = -1; } } else { - fprintf(stderr, "Error: Could not generate tsml scenario from xml file\n"); + fprintf(stderr, "ERROR: Could not generate tsml scenario from xml file\n"); ret = -1; } free_pointer(test_dir_name); diff --git a/openair3/TEST/EPC_TEST/play_scenario.h b/openair3/TEST/EPC_TEST/play_scenario.h index 4916950783..2bf6cc4ccf 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.h +++ b/openair3/TEST/EPC_TEST/play_scenario.h @@ -28,18 +28,22 @@ *******************************************************************************/ /* - generate_scenario.h + play_scenario.h ------------------- AUTHOR : Lionel GAUTHIER COMPANY : EURECOM EMAIL : Lionel.Gauthier@eurecom.fr */ -#ifndef GENERATE_SCENARIO_H_ -#define GENERATE_SCENARIO_H_ -# include -# include -#include +#ifndef PLAY_SCENARIO_H_ +#define PLAY_SCENARIO_H_ +# include +# include +# include +# include + +#include "s1ap_ies_defs.h" + /** @defgroup _enb_app ENB APP * @ingroup _oai2 @@ -83,13 +87,32 @@ typedef enum { SCTP_CID_ASCONF_ACK = 0x80, } sctp_cid_t; /* enum */ +typedef enum { + TEST_S1AP_PDU_TYPE_START = 0, + TEST_S1AP_PDU_TYPE_UNKNOWN = TEST_S1AP_PDU_TYPE_START, + TEST_S1AP_PDU_TYPE_INITIATING, + TEST_S1AP_PDU_TYPE_SUCCESSFUL_OUTCOME, + TEST_S1AP_PDU_TYPE_UNSUCCESSFUL_OUTCOME, + TEST_S1AP_PDU_TYPE_END +} test_s1ap_pdu_type_t; + + +typedef struct test_s1ap_s { + //test_s1ap_pdu_type_t pdu_type; + uint16_t binary_stream_pos; + uint16_t binary_stream_allocated_size; + uint8_t *binary_stream; + s1ap_message message; +} test_s1ap_t; + + // from kernel source file 3.19/include/linux/sctp.h, Big Endians typedef struct sctp_datahdr_s { - uint32_t tsn; - uint16_t stream; - uint16_t ssn; - uint32_t ppid; - uint8_t payload[0]; + uint32_t tsn; + uint16_t stream; + uint16_t ssn; + uint32_t ppid; + test_s1ap_t payload; } sctp_datahdr_t; // from kernel source file 3.19/include/linux/sctp.h, Big Endians @@ -115,15 +138,28 @@ typedef struct test_sctp_hdr_s { } u; } test_sctp_hdr_t; +typedef struct test_ip_s { + unsigned int address_family; // AF_INET, AF_INET6 + union { + struct in6_addr ipv6; + in_addr_t ipv4; + }address; +}test_ip_t; + +typedef struct test_ip_hdr_s { + test_ip_t src; + test_ip_t dst; +} test_ip_hdr_t; + typedef struct test_packet_s { test_action_t action; struct timeval time_relative_to_first_packet; - struct timeval time_relative_to_last_packet; + struct timeval time_relative_to_last_sent_packet; + struct timeval time_relative_to_last_received_packet; + unsigned int original_frame_number; + unsigned int packet_number; + test_ip_hdr_t ip_hdr; test_sctp_hdr_t sctp_hdr; - uint16_t s1ap_byte_stream_count; - uint8_t *s1ap_byte_stream; - xmlNodePtr *s1ap_node; - struct test_packet_s *next; }test_packet_t; From 7c28ae7360e846c035db6f906d5f45d570ca0d62 Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 13 Nov 2015 16:54:17 +0100 Subject: [PATCH 011/214] Still ASN1 display bug --- openair3/TEST/EPC_TEST/play_scenario.c | 144 +++++++++++++++---------- 1 file changed, 86 insertions(+), 58 deletions(-) diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index a32947c439..982c1ffb40 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -60,6 +60,7 @@ #include #include +#include "intertask_interface_init.h" #include "assertions.h" #include "play_scenario.h" //#include "s1ap_eNB.h" @@ -470,7 +471,7 @@ int hex2data(unsigned char * const data, const unsigned char * const hexstring, char buf[5] = {'0', 'x', pos[0], pos[1], 0}; data[count] = strtol(buf, &endptr, 16); pos += 2 * sizeof(char); - AssertFatal (endptr[0] == '\0', "ERROR %s() non-hexadecimal character encountered buf %p endptr %p buf %s count %d pos %p\n", __FUNCTION__, buf, endptr, buf, count, pos); + AssertFatal (endptr[0] == '\0', "ERROR %s() non-hexadecimal character encountered buf %p endptr %p buf %s count %zu pos %p\n", __FUNCTION__, buf, endptr, buf, count, pos); AssertFatal (endptr != buf, "ERROR %s() No digits were found\n", __FUNCTION__); } return 0; @@ -553,10 +554,13 @@ void ip_str2test_ip(const xmlChar * const ip_str, test_ip_t * const ip) int test_s1ap_decode_initiating_message(s1ap_message *message, S1ap_InitiatingMessage_t *initiating_p) { + char *message_string = NULL; int ret = -1; DevAssert(initiating_p != NULL); + message_string = calloc(20000, sizeof(char)); + AssertFatal (NULL != message_string, "ERROR malloc()failed!\n"); message->procedureCode = initiating_p->procedureCode; message->criticality = initiating_p->criticality; @@ -565,58 +569,65 @@ int test_s1ap_decode_initiating_message(s1ap_message *message, ret = s1ap_decode_s1ap_downlinknastransporties( &message->msg.s1ap_DownlinkNASTransportIEs, &initiating_p->value); + s1ap_xer_print_s1ap_downlinknastransport(s1ap_xer__print2sp, message_string, message); break; case S1ap_ProcedureCode_id_InitialContextSetup: ret = s1ap_decode_s1ap_initialcontextsetuprequesties( &message->msg.s1ap_InitialContextSetupRequestIEs, &initiating_p->value); + s1ap_xer_print_s1ap_initialcontextsetuprequest(s1ap_xer__print2sp, message_string, message); break; case S1ap_ProcedureCode_id_UEContextRelease: ret = s1ap_decode_s1ap_uecontextreleasecommandies( &message->msg.s1ap_UEContextReleaseCommandIEs, &initiating_p->value); + s1ap_xer_print_s1ap_uecontextreleasecommand(s1ap_xer__print2sp, message_string, message); break; case S1ap_ProcedureCode_id_Paging: ret = s1ap_decode_s1ap_pagingies( &message->msg.s1ap_PagingIEs, &initiating_p->value); + s1ap_xer_print_s1ap_paging(s1ap_xer__print2sp, message_string, message); break; - case S1ap_ProcedureCode_id_uplinkNASTransport: { - ret = s1ap_decode_s1ap_uplinknastransporties (&message->msg.s1ap_UplinkNASTransportIEs, &initiating_p->value); - } + case S1ap_ProcedureCode_id_uplinkNASTransport: + ret = s1ap_decode_s1ap_uplinknastransporties (&message->msg.s1ap_UplinkNASTransportIEs, &initiating_p->value); + s1ap_xer_print_s1ap_uplinknastransport(s1ap_xer__print2sp, message_string, message); break; - case S1ap_ProcedureCode_id_S1Setup: { - ret = s1ap_decode_s1ap_s1setuprequesties (&message->msg.s1ap_S1SetupRequestIEs, &initiating_p->value); - } + case S1ap_ProcedureCode_id_S1Setup: + ret = s1ap_decode_s1ap_s1setuprequesties (&message->msg.s1ap_S1SetupRequestIEs, &initiating_p->value); + s1ap_xer_print_s1ap_s1setuprequest(s1ap_xer__print2sp, message_string, message); break; - case S1ap_ProcedureCode_id_initialUEMessage: { - ret = s1ap_decode_s1ap_initialuemessageies (&message->msg.s1ap_InitialUEMessageIEs, &initiating_p->value); - } + case S1ap_ProcedureCode_id_initialUEMessage: + ret = s1ap_decode_s1ap_initialuemessageies (&message->msg.s1ap_InitialUEMessageIEs, &initiating_p->value); + s1ap_xer_print_s1ap_initialuemessage(s1ap_xer__print2sp, message_string, message); break; - case S1ap_ProcedureCode_id_UEContextReleaseRequest: { - ret = s1ap_decode_s1ap_uecontextreleaserequesties (&message->msg.s1ap_UEContextReleaseRequestIEs, &initiating_p->value); - } + case S1ap_ProcedureCode_id_UEContextReleaseRequest: + ret = s1ap_decode_s1ap_uecontextreleaserequesties (&message->msg.s1ap_UEContextReleaseRequestIEs, &initiating_p->value); + s1ap_xer_print_s1ap_uecontextreleaserequest(s1ap_xer__print2sp, message_string, message); break; - case S1ap_ProcedureCode_id_UECapabilityInfoIndication: { - ret = s1ap_decode_s1ap_uecapabilityinfoindicationies (&message->msg.s1ap_UECapabilityInfoIndicationIEs, &initiating_p->value); - } + case S1ap_ProcedureCode_id_UECapabilityInfoIndication: + ret = s1ap_decode_s1ap_uecapabilityinfoindicationies (&message->msg.s1ap_UECapabilityInfoIndicationIEs, &initiating_p->value); + //s1ap_xer_print_s1ap_uecapabilityinfoindication(s1ap_xer__print2sp, message_string, message); break; - case S1ap_ProcedureCode_id_NASNonDeliveryIndication: { - ret = s1ap_decode_s1ap_nasnondeliveryindication_ies (&message->msg.s1ap_NASNonDeliveryIndication_IEs, &initiating_p->value); - } + case S1ap_ProcedureCode_id_NASNonDeliveryIndication: + ret = s1ap_decode_s1ap_nasnondeliveryindication_ies (&message->msg.s1ap_NASNonDeliveryIndication_IEs, &initiating_p->value); + s1ap_xer_print_s1ap_nasnondeliveryindication_(s1ap_xer__print2sp, message_string, message); break; default: + free(message_string); AssertFatal( 0 , "Unknown procedure ID (%d) for initiating message\n", (int)initiating_p->procedureCode); return -1; } + fprintf(stdout, "s1ap_xer_print:\n%s\n", message_string); + free(message_string); return ret; } @@ -624,9 +635,12 @@ int test_s1ap_decode_initiating_message(s1ap_message *message, int test_s1ap_decode_successful_outcome(s1ap_message *message, S1ap_SuccessfulOutcome_t *successfullOutcome_p) { - int ret = -1; + char *message_string = NULL; + int ret = -1; DevAssert(successfullOutcome_p != NULL); + message_string = calloc(20000, sizeof(char)); + AssertFatal (NULL != message_string, "ERROR malloc()failed!\n"); message->procedureCode = successfullOutcome_p->procedureCode; message->criticality = successfullOutcome_p->criticality; @@ -635,23 +649,27 @@ int test_s1ap_decode_successful_outcome(s1ap_message *message, case S1ap_ProcedureCode_id_S1Setup: ret = s1ap_decode_s1ap_s1setupresponseies( &message->msg.s1ap_S1SetupResponseIEs, &successfullOutcome_p->value); + s1ap_xer_print_s1ap_s1setupresponse(s1ap_xer__print2sp, message_string, message); break; - case S1ap_ProcedureCode_id_InitialContextSetup: { - ret = s1ap_decode_s1ap_initialcontextsetupresponseies (&message->msg.s1ap_InitialContextSetupResponseIEs, &successfullOutcome_p->value); - } + case S1ap_ProcedureCode_id_InitialContextSetup: + ret = s1ap_decode_s1ap_initialcontextsetupresponseies (&message->msg.s1ap_InitialContextSetupResponseIEs, &successfullOutcome_p->value); + s1ap_xer_print_s1ap_initialcontextsetupresponse(s1ap_xer__print2sp, message_string, message); break; - case S1ap_ProcedureCode_id_UEContextRelease: { + case S1ap_ProcedureCode_id_UEContextRelease: ret = s1ap_decode_s1ap_uecontextreleasecompleteies (&message->msg.s1ap_UEContextReleaseCompleteIEs, &successfullOutcome_p->value); - } + s1ap_xer_print_s1ap_uecontextreleasecomplete(s1ap_xer__print2sp, message_string, message); break; default: + free(message_string); AssertFatal(0, "Unknown procedure ID (%d) for successfull outcome message\n", (int)successfullOutcome_p->procedureCode); return -1; } + fprintf(stdout, "s1ap_xer_print:\n%s\n", message_string); + free(message_string); return ret; } @@ -659,29 +677,37 @@ int test_s1ap_decode_successful_outcome(s1ap_message *message, int test_s1ap_decode_unsuccessful_outcome(s1ap_message *message, S1ap_UnsuccessfulOutcome_t *unSuccessfullOutcome_p) { + char *message_string = NULL; int ret = -1; + DevAssert(unSuccessfullOutcome_p != NULL); + message_string = calloc(20000, sizeof(char)); + AssertFatal (NULL != message_string, "ERROR malloc()failed!\n"); message->procedureCode = unSuccessfullOutcome_p->procedureCode; message->criticality = unSuccessfullOutcome_p->criticality; switch(unSuccessfullOutcome_p->procedureCode) { case S1ap_ProcedureCode_id_S1Setup: - return s1ap_decode_s1ap_s1setupfailureies( + ret = s1ap_decode_s1ap_s1setupfailureies( &message->msg.s1ap_S1SetupFailureIEs, &unSuccessfullOutcome_p->value); + s1ap_xer_print_s1ap_s1setupfailure(s1ap_xer__print2sp, message_string, message); + break; - case S1ap_ProcedureCode_id_InitialContextSetup: { - ret = s1ap_decode_s1ap_initialcontextsetupfailureies (&message->msg.s1ap_InitialContextSetupFailureIEs, &unSuccessfullOutcome_p->value); - } + case S1ap_ProcedureCode_id_InitialContextSetup: + ret = s1ap_decode_s1ap_initialcontextsetupfailureies (&message->msg.s1ap_InitialContextSetupFailureIEs, &unSuccessfullOutcome_p->value); + s1ap_xer_print_s1ap_initialcontextsetupfailure(s1ap_xer__print2sp, message_string, message); break; default: + free(message_string); AssertFatal(0,"Unknown procedure ID (%d) for unsuccessfull outcome message\n", (int)unSuccessfullOutcome_p->procedureCode); break; } - + fprintf(stdout, "s1ap_xer_print:\n%s\n", message_string); + free(message_string); return ret; } @@ -758,34 +784,35 @@ void parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, test_s1ap_t * con xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"hide"); if (NULL != xml_char) { if ((!xmlStrcmp(xml_char, (const xmlChar *)"yes"))) { - xmlFree(xml_char); - return; + go_deeper_in_tree = 0; } xmlFree(xml_char); } - // first get size - xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"size"); - if (NULL != xml_char) { - size = strtoul((const char *)xml_char, NULL, 0); - xmlFree(xml_char); - // second: try to get value (always hex) - xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); + if (0 < go_deeper_in_tree) { + // first get size + xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"size"); if (NULL != xml_char) { - xml_char2 = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"name"); - fprintf(stdout, "s1ap %p field %s size %d value %s\n",s1ap, xml_char2, size, xml_char); - xmlFree(xml_char2); - // if success to get value, do not parse children - //AssertFatal ((xmlStrlen(xml_char) == size), "ERROR %s() mismatch in size %d and strlen %d\n", __FUNCTION__, size, xmlStrlen(xml_char)); - //if (xmlStrlen(xml_char) == size) { - AssertFatal ((s1ap->binary_stream_pos+xmlStrlen(xml_char)/2) <= s1ap->binary_stream_allocated_size, - "ERROR %s() in buffer size: binary_stream_pos %d xmlStrlen(xml_char)/2=%d\n", __FUNCTION__, s1ap->binary_stream_pos, xmlStrlen(xml_char)/2); - rc = hex2data( &s1ap->binary_stream[s1ap->binary_stream_pos], xml_char, xmlStrlen(xml_char)); - s1ap->binary_stream_pos += xmlStrlen(xml_char)/2; - display_node(cur_node, 0); - AssertFatal (rc >= 0, "ERROR %s() in converting hex string %s len %d size %d rc %d\n", __FUNCTION__, xml_char, xmlStrlen(xml_char), size, rc); - go_deeper_in_tree = 0; - //} + size = strtoul((const char *)xml_char, NULL, 0); xmlFree(xml_char); + // second: try to get value (always hex) + xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); + if (NULL != xml_char) { + xml_char2 = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"name"); + fprintf(stdout, "s1ap %p field %s size %d value %s\n",s1ap, xml_char2, size, xml_char); + xmlFree(xml_char2); + // if success to get value, do not parse children + //AssertFatal ((xmlStrlen(xml_char) == size), "ERROR %s() mismatch in size %d and strlen %d\n", __FUNCTION__, size, xmlStrlen(xml_char)); + //if (xmlStrlen(xml_char) == size) { + AssertFatal ((s1ap->binary_stream_pos+xmlStrlen(xml_char)/2) <= s1ap->binary_stream_allocated_size, + "ERROR %s() in buffer size: binary_stream_pos %d xmlStrlen(xml_char)/2=%d\n", __FUNCTION__, s1ap->binary_stream_pos, xmlStrlen(xml_char)/2); + rc = hex2data( &s1ap->binary_stream[s1ap->binary_stream_pos], xml_char, xmlStrlen(xml_char)); + s1ap->binary_stream_pos += xmlStrlen(xml_char)/2; + display_node(cur_node, 0); + AssertFatal (rc >= 0, "ERROR %s() in converting hex string %s len %d size %d rc %d\n", __FUNCTION__, xml_char, xmlStrlen(xml_char), size, rc); + go_deeper_in_tree = 0; + //} + xmlFree(xml_char); + } } } } @@ -1166,7 +1193,6 @@ int generate_xml_scenario( int nb_params = 0; int i,j; char astring[1024]; - char *astring2 = NULL; struct in_addr addr; int ret = 0; @@ -1219,8 +1245,8 @@ int generate_xml_scenario( params[nb_params] = NULL; res = xsltApplyStylesheet(cur, doc, params); if (NULL != res) { - sprintf(play_scenario_filename,"%s",test_scenario_filename); - if (strip_extension(play_scenario_filename) > 0) { + sprintf((char *)play_scenario_filename,"%s",test_scenario_filename); + if (strip_extension((char *)play_scenario_filename) > 0) { strcat((char *)play_scenario_filename, ".tsml"); play_scenario_file = fopen( play_scenario_filename, "w+"); if (NULL != play_scenario_file) { @@ -1398,8 +1424,10 @@ int main( int argc, char **argv ) // logging logInit(); - set_comp_log(S1AP, LOG_TRACE, LOG_MED,1); - set_comp_log(SCTP, LOG_TRACE, LOG_MED,1); + itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL); + + set_comp_log(S1AP, LOG_TRACE, LOG_MED, 1); + set_comp_log(SCTP, LOG_TRACE, LOG_MED, 1); asn_debug = 1; asn1_xer_print = 1; From d27641a443113d3af55e05df7f433b54fd0a6bc5 Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 17 Nov 2015 16:56:24 +0100 Subject: [PATCH 012/214] Begin to begin sending packets (many things to do hash assoc id, mme_ue_id, nas security, etc) --- cmake_targets/CMakeLists.txt | 30 +- cmake_targets/epc_test/CMakeLists.template | 4 +- cmake_targets/tools/build_test_epc_tools | 2 +- openair3/S1AP/s1ap_eNB.c | 7 +- openair3/TEST/EPC_TEST/play_scenario.c | 1215 +++-------------- openair3/TEST/EPC_TEST/play_scenario.h | 215 ++- openair3/TEST/EPC_TEST/play_scenario_decode.c | 214 +++ .../TEST/EPC_TEST/play_scenario_display.c | 292 ++++ openair3/TEST/EPC_TEST/play_scenario_fsm.c | 127 ++ openair3/TEST/EPC_TEST/play_scenario_parse.c | 561 ++++++++ openair3/TEST/EPC_TEST/play_scenario_s1ap.c | 162 +++ openair3/TEST/EPC_TEST/play_scenario_sctp.c | 45 + openair3/UTILS/conversions.h | 1 - 13 files changed, 1814 insertions(+), 1061 deletions(-) create mode 100644 openair3/TEST/EPC_TEST/play_scenario_decode.c create mode 100644 openair3/TEST/EPC_TEST/play_scenario_display.c create mode 100644 openair3/TEST/EPC_TEST/play_scenario_fsm.c create mode 100644 openair3/TEST/EPC_TEST/play_scenario_parse.c create mode 100644 openair3/TEST/EPC_TEST/play_scenario_s1ap.c create mode 100644 openair3/TEST/EPC_TEST/play_scenario_sctp.c diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 5fb722ee9d..148aae2419 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -216,18 +216,20 @@ add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"") # Debug related options ######################################### -add_boolean_option(MSG_PRINT False "print debug messages") -add_boolean_option(DISABLE_XER_PRINT False "print XER Format") -add_boolean_option(XER_PRINT False "print XER Format") -add_boolean_option(RRC_MSG_PRINT False "print RRC messages") -add_boolean_option(PDCP_MSG_PRINT False "print PDCP messages to /tmp/pdcp.log") -add_boolean_option(DEBUG_PDCP_PAYLOAD False "print PDCP PDU to stdout") # if true, make sure that global and PDCP log levels are trace +add_boolean_option(ASN_DEBUG False "ASN1 coder/decoder Debug") +add_boolean_option(EMIT_ASN_DEBUG False "ASN1 coder/decoder Debug") +add_boolean_option(MSG_PRINT False "print debug messages") +add_boolean_option(DISABLE_XER_PRINT False "print XER Format") +add_boolean_option(XER_PRINT False "print XER Format") +add_boolean_option(RRC_MSG_PRINT False "print RRC messages") +add_boolean_option(PDCP_MSG_PRINT False "print PDCP messages to /tmp/pdcp.log") +add_boolean_option(DEBUG_PDCP_PAYLOAD False "print PDCP PDU to stdout") # if true, make sure that global and PDCP log levels are trace add_boolean_option(DEBUG_MAC_INTERFACE False "print MAC-RLC PDU exchange to stdout") # if true, make sure that global and PDCP log levels are trace -add_boolean_option(TRACE_RLC_PAYLOAD False "print RLC PDU to stdout") # if true, make sure that global and PDCP log levels are trace -add_boolean_option(TEST_OMG False "???") -add_boolean_option(DEBUG_OMG False "???") -add_boolean_option(XFORMS False "This adds the possibility to see the signal oscilloscope") -add_boolean_option(PRINT_STATS False "This adds the possibility to see the status") +add_boolean_option(TRACE_RLC_PAYLOAD False "print RLC PDU to stdout") # if true, make sure that global and PDCP log levels are trace +add_boolean_option(TEST_OMG False "???") +add_boolean_option(DEBUG_OMG False "???") +add_boolean_option(XFORMS False "This adds the possibility to see the signal oscilloscope") +add_boolean_option(PRINT_STATS False "This adds the possibility to see the status") add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering") @@ -1660,6 +1662,12 @@ target_link_libraries (test_epc_generate_scenario add_executable(test_epc_play_scenario ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.c + ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_decode.c + ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_display.c + ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_fsm.c + ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_parse.c + ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap.c + ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_sctp.c ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.h ${OPENAIR2_DIR}/ENB_APP/enb_config.h ${OPENAIR2_DIR}/COMMON/commonDef.h diff --git a/cmake_targets/epc_test/CMakeLists.template b/cmake_targets/epc_test/CMakeLists.template index 5789c3eb5c..8a8223e4ae 100644 --- a/cmake_targets/epc_test/CMakeLists.template +++ b/cmake_targets/epc_test/CMakeLists.template @@ -7,7 +7,7 @@ set ( DEBUG_OMG False ) set ( DISABLE_XER_PRINT False ) set ( DRIVER2013 True ) set ( EMOS False ) -set ( EMIT_ASN_DEBUG True ) +set ( EMIT_ASN_DEBUG False ) set ( ENABLE_FXP True ) set ( ENABLE_ITTI True ) set ( ENABLE_NAS_UE_LOGGING True ) @@ -76,4 +76,4 @@ set ( SMBV False ) set ( TEST_OMG False ) set ( USE_MME "R10" ) set ( USER_MODE True ) -set ( XER_PRINT False ) +set ( XER_PRINT True ) diff --git a/cmake_targets/tools/build_test_epc_tools b/cmake_targets/tools/build_test_epc_tools index 10dc4fd256..db49fa017b 100755 --- a/cmake_targets/tools/build_test_epc_tools +++ b/cmake_targets/tools/build_test_epc_tools @@ -22,7 +22,7 @@ # Contact Information # OpenAirInterface Admin: openair_admin@eurecom.fr # OpenAirInterface Tech : openair_tech@eurecom.fr -# OpenAirInterface Dev : openair4g-devel@eurecom.fr +# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr # # Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE # diff --git a/openair3/S1AP/s1ap_eNB.c b/openair3/S1AP/s1ap_eNB.c index c880c3f3b4..1b683d4aa3 100644 --- a/openair3/S1AP/s1ap_eNB.c +++ b/openair3/S1AP/s1ap_eNB.c @@ -72,9 +72,9 @@ s1ap_eNB_config_t s1ap_config; static int s1ap_eNB_generate_s1_setup_request( s1ap_eNB_instance_t *instance_p, s1ap_eNB_mme_data_t *s1ap_mme_data_p); -static + void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB); -static + void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp); uint32_t s1ap_generate_eNB_id(void) @@ -150,7 +150,7 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, itti_send_msg_to_task(TASK_SCTP, instance_p->instance, message_p); } -static + void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB) { s1ap_eNB_instance_t *new_instance; @@ -210,7 +210,6 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t * } } -static void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) { s1ap_eNB_instance_t *instance_p; diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index 982c1ffb40..fda38dbcb8 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -48,132 +48,27 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + #include "intertask_interface_init.h" +#include "timer.h" #include "assertions.h" -#include "play_scenario.h" -//#include "s1ap_eNB.h" #include "s1ap_common.h" -#include "s1ap_ies_defs.h" -#include "s1ap_eNB_decoder.h" #include "intertask_interface.h" -#include "enb_config.h" +#include "play_scenario.h" +#include "sctp_eNB_task.h" #include "log.h" //------------------------------------------------------------------------------ -#define ENB_CONFIG_MAX_XSLT_PARAMS 32 #define PLAY_SCENARIO 1 #define GS_IS_FILE 1 #define GS_IS_DIR 2 //------------------------------------------------------------------------------ char *g_openair_dir = NULL; //------------------------------------------------------------------------------ -extern Enb_properties_array_t enb_properties; extern int xmlLoadExtDtdDefaultValue; extern int asn_debug; extern int asn1_xer_print; -//------------------------------------------------------------------------------ -void test_print_hex_octets(const unsigned char * const byte_stream, const unsigned long int num); -int is_file_exists ( const char const * file_nameP, const char const *file_roleP); -int strip_extension( char *in_filename); -int split_path ( char * pathP, char *** resP); -void display_node ( xmlNodePtr node, unsigned int indent); -void display_tree ( xmlNodePtr node, unsigned int indent); -//------------------------- -void free_packet(test_packet_t* packet); -void free_scenario(test_scenario_t* scenario); -//------------------------- -void display_packet_sctp_init(const sctp_inithdr_t * const sctp); -void display_packet_sctp_initack(const sctp_initackhdr_t * const sctp); -void display_packet_sctp_data(const sctp_datahdr_t * const sctp); -void display_packet_sctp(const test_sctp_hdr_t * const sctp); -void display_packet_ip(const test_ip_hdr_t * const ip); -void display_packet(const test_packet_t * const packet); -void display_scenario(const test_scenario_t * const scenario); -//------------------------- -char * test_ip2ip_str(const test_ip_t * const ip); -int hex2data(unsigned char * const data, const unsigned char * const hexstring, const unsigned int len); -sctp_cid_t chunk_type_str2cid(const xmlChar * const chunk_type_str); -const char * const chunk_type_cid2str(const sctp_cid_t chunk_type); -test_action_t action_str2test_action_t(const xmlChar * const action); -void ip_str2test_ip(const xmlChar * const ip_str, test_ip_t * const ip); -//------------------------- -int test_s1ap_decode_initiating_message(s1ap_message *message, S1ap_InitiatingMessage_t *initiating_p); -int test_s1ap_decode_successful_outcome(s1ap_message *message, S1ap_SuccessfulOutcome_t *successfullOutcome_p); -int test_s1ap_decode_unsuccessful_outcome(s1ap_message *message, S1ap_UnsuccessfulOutcome_t *unSuccessfullOutcome_p); -int test_s1ap_decode_pdu(s1ap_message *message, const uint8_t * const buffer,const uint32_t length); -void test_decode_s1ap(test_s1ap_t * const s1ap); -//------------------------- -void parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, test_s1ap_t * const s1ap); -void parse_sctp_data_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_datahdr_t * const sctp_hdr); -void parse_sctp_init_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_inithdr_t * const sctp_hdr); -void parse_sctp_init_ack_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_initackhdr_t * const sctp_hdr); -void parse_sctp(xmlDocPtr doc, const xmlNode const *sctp_node, test_sctp_hdr_t * const sctp_hdr); -test_packet_t* parse_xml_packet(xmlDocPtr doc, xmlNodePtr node); -//------------------------- -int play_scenario(test_scenario_t* scenario); -int generate_xml_scenario( - const char const * test_dir_name, - const char const * test_scenario_filename, - const char const * enb_config_filename, - char const * play_scenario_filename /* OUT PARAM*/); -//----------------------------------------------------------------------------- -void test_print_hex_octets(const unsigned char * const byte_stream, const unsigned long int num) -//----------------------------------------------------------------------------- -{ - unsigned long octet_index = 0; - - if (byte_stream == NULL) { - return; - } - - - - - fprintf(stdout, "+-----+-------------------------------------------------+\n"); - fprintf(stdout, "| | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n"); - fprintf(stdout, "+-----+-------------------------------------------------+\n"); - - for (octet_index = 0; octet_index < num; octet_index++) { - if ((octet_index % 16) == 0) { - if (octet_index != 0) { - fprintf(stdout, " |\n"); - } - - fprintf(stdout, " %04ld |", octet_index); - } - - /* - * Print every single octet in hexadecimal form - */ - fprintf(stdout, " %02x", byte_stream[octet_index]); - /* - * Align newline and pipes according to the octets in groups of 2 - */ - } - - /* - * Append enough spaces and put final pipe - */ - unsigned char index; - - for (index = octet_index; index < 16; ++index) { - fprintf(stdout, " "); - } - - fprintf(stdout, " |\n"); -} //------------------------------------------------------------------------------ // test if file exist in current directory @@ -202,7 +97,7 @@ int is_file_exists( const char const * file_nameP, const char const *file_roleP) //------------------------------------------------------------------------------ -int strip_extension(char *in_filename) +int et_strip_extension(char *in_filename) { static const uint8_t name_min_len = 1; static const uint8_t max_ext_len = 5; // .pdml ! @@ -237,193 +132,38 @@ int split_path( char * pathP, char *** resP) return n_spaces; } //------------------------------------------------------------------------------ -void display_node(xmlNodePtr node, unsigned int indent) -{ - int i = 0; - if (node->type == XML_ELEMENT_NODE) { - xmlChar *path = xmlGetNodePath(node); - for (i=0; ichildren != NULL && node->children->type == XML_TEXT_NODE) { - xmlChar *content = xmlNodeGetContent(node); - printf("%s -> %s\n", path, content); - xmlFree(content); - } else { - printf("%s\n", path); - } - xmlFree(path); - } -} -/** - * print_element_names: - * @node: the initial xml node to consider. - * @indent: indentation level. - * - * Prints the names of the all the xml elements - * that are siblings or children of a given xml node. - */ -//------------------------------------------------------------------------------ -void display_tree(xmlNodePtr node, unsigned int indent) -{ - xmlNode *cur_node = NULL; - - for (cur_node = node; cur_node; cur_node = cur_node->next) { - if (cur_node->type == XML_ELEMENT_NODE) { - display_node(cur_node, indent); - } - display_tree(cur_node->children, indent++); - } -} -//------------------------------------------------------------------------------ -void free_packet(test_packet_t* packet) +void et_free_packet(et_packet_t* packet) { if (packet) { switch (packet->sctp_hdr.chunk_type) { case SCTP_CID_DATA: - free_pointer(packet->sctp_hdr.u.data_hdr.payload.binary_stream); + et_free_pointer(packet->sctp_hdr.u.data_hdr.payload.binary_stream); break; default: ; } - free_pointer(packet); + et_free_pointer(packet); } } //------------------------------------------------------------------------------ -void free_scenario(test_scenario_t* scenario) +void et_free_scenario(et_scenario_t* scenario) { - test_packet_t *packet = NULL; - test_packet_t *next_packet = NULL; + et_packet_t *packet = NULL; + et_packet_t *next_packet = NULL; if (scenario) { packet = scenario->list_packet; while (packet) { next_packet = packet->next; - free_packet(packet); + et_free_packet(packet); packet = next_packet->next; } - free_pointer(scenario); - } -} - - -//------------------------------------------------------------------------------ -void display_packet_sctp_init(const sctp_inithdr_t * const sctp) -{ - - if (sctp) { - fprintf(stdout, "\t\tSCTP.init.init_tag : %u\n", sctp->init_tag); - fprintf(stdout, "\t\tSCTP.init.a_rwnd : %u\n", sctp->a_rwnd); - fprintf(stdout, "\t\tSCTP.init.num_inbound_streams : %u\n", sctp->num_inbound_streams); - fprintf(stdout, "\t\tSCTP.init.num_outbound_streams : %u\n", sctp->num_outbound_streams); - fprintf(stdout, "\t\tSCTP.init.initial_tsn : %u\n", sctp->initial_tsn); - } -} -//------------------------------------------------------------------------------ -void display_packet_sctp_initack(const sctp_initackhdr_t * const sctp) -{ - - if (sctp) { - fprintf(stdout, "\t\tSCTP.initack.init_tag : %u\n", sctp->init_tag); - fprintf(stdout, "\t\tSCTP.initack.a_rwnd : %u\n", sctp->a_rwnd); - fprintf(stdout, "\t\tSCTP.initack.num_inbound_streams : %u\n", sctp->num_inbound_streams); - fprintf(stdout, "\t\tSCTP.initack.num_outbound_streams : %u\n", sctp->num_outbound_streams); - fprintf(stdout, "\t\tSCTP.initack.initial_tsn : %u\n", sctp->initial_tsn); - } -} -//------------------------------------------------------------------------------ -void display_packet_sctp_data(const sctp_datahdr_t * const sctp) -{ - if (sctp) { - fprintf(stdout, "\t\tSCTP.data.tsn : %u\n", sctp->tsn); - fprintf(stdout, "\t\tSCTP.data.stream : %u\n", sctp->stream); - fprintf(stdout, "\t\tSCTP.data.ssn : %u\n", sctp->ssn); - fprintf(stdout, "\t\tSCTP.data.ppid : %u\n", sctp->ppid); - //fprintf(stdout, "\t\tSCTP.data.pdu_type : %u\n", sctp->payload.pdu_type); - //fprintf(stdout, "\t\tSCTP.data.procedure_code : %u\n", sctp->payload.procedure_code); - fprintf(stdout, "\t\tSCTP.data.binary_stream_allocated_size : %u\n", sctp->payload.binary_stream_allocated_size); - if (NULL != sctp->payload.binary_stream) { - fprintf(stdout, "\t\tSCTP.data.binary_stream :\n"); - test_print_hex_octets(sctp->payload.binary_stream, sctp->payload.binary_stream_allocated_size); - } else { - fprintf(stdout, "\t\tSCTP.data.binary_stream : NULL\n"); - } + et_free_pointer(scenario); } } //------------------------------------------------------------------------------ -void display_packet_sctp(const test_sctp_hdr_t * const sctp) -{ - if (sctp) { - fprintf(stdout, "\t\tSCTP.src_port : %u\n", sctp->src_port); - fprintf(stdout, "\t\tSCTP.dst_port : %u\n", sctp->dst_port); - fprintf(stdout, "\t\tSCTP.chunk_type : %s\n", chunk_type_cid2str(sctp->chunk_type)); - switch (sctp->chunk_type) { - case SCTP_CID_DATA: - display_packet_sctp_data(&sctp->u.data_hdr); - break; - case SCTP_CID_INIT: - display_packet_sctp_initack(&sctp->u.init_hdr); - break; - case SCTP_CID_INIT_ACK: - display_packet_sctp_initack(&sctp->u.init_ack_hdr); - break; - default: - ; - } - } -} -//------------------------------------------------------------------------------ -void display_packet_ip(const test_ip_hdr_t * const ip) -{ - if (ip) { - fprintf(stdout, "\t\tSource address : %s\n", test_ip2ip_str(&ip->src)); - fprintf(stdout, "\t\tDestination address : %s\n", test_ip2ip_str(&ip->dst)); - } -} - -//------------------------------------------------------------------------------ -void display_packet(const test_packet_t * const packet) -{ - if (packet) { - fprintf(stdout, "\tPacket:\tnum %u | original frame number %u \n", packet->packet_number, packet->original_frame_number); - fprintf(stdout, "\tPacket:\ttime relative to 1st packet %ld.%06lu\n", - packet->time_relative_to_first_packet.tv_sec, packet->time_relative_to_first_packet.tv_usec); - fprintf(stdout, "\tPacket:\ttime relative to last tx packet %ld.%06lu\n", - packet->time_relative_to_last_sent_packet.tv_sec, packet->time_relative_to_last_sent_packet.tv_usec); - fprintf(stdout, "\tPacket:\ttime relative to last_received packet %ld.%06lu\n", - packet->time_relative_to_last_received_packet.tv_sec, packet->time_relative_to_last_received_packet.tv_usec); - - switch(packet->action) { - case ACTION_S1C_SEND: - fprintf(stdout, "\tPacket:\tAction SEND\n"); - break; - case ACTION_S1C_RECEIVE: - fprintf(stdout, "\tPacket:\tAction RECEIVE\n"); - break; - default: - fprintf(stdout, "\tPacket:\tAction UNKNOWN\n"); - } - display_packet_ip(&packet->ip_hdr); - display_packet_sctp(&packet->sctp_hdr); - } -} -//------------------------------------------------------------------------------ -void display_scenario(const test_scenario_t * const scenario) -{ - test_packet_t *packet = NULL; - if (scenario) { - fprintf(stdout, "Scenario: %s\n", (scenario->name != NULL) ? (char*)scenario->name:"UNKNOWN NAME"); - packet = scenario->list_packet; - while (packet) { - display_packet(packet); - packet = packet->next; - } - } -} - -//------------------------------------------------------------------------------ -char * test_ip2ip_str(const test_ip_t * const ip) +char * et_ip2ip_str(const et_ip_t * const ip) { static char str[INET6_ADDRSTRLEN]; @@ -445,7 +185,7 @@ char * test_ip2ip_str(const test_ip_t * const ip) //returns 0 on success, negative on error //data is a buffer of at least len bytes //hexstring is upper or lower case hexadecimal, NOT prepended with "0x" -int hex2data(unsigned char * const data, const unsigned char * const hexstring, const unsigned int len) +int et_hex2data(unsigned char * const data, const unsigned char * const hexstring, const unsigned int len) { unsigned const char *pos = hexstring; char *endptr = NULL; @@ -477,7 +217,7 @@ int hex2data(unsigned char * const data, const unsigned char * const hexstring, return 0; } //------------------------------------------------------------------------------ -sctp_cid_t chunk_type_str2cid(const xmlChar * const chunk_type_str) +sctp_cid_t et_chunk_type_str2cid(const xmlChar * const chunk_type_str) { if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"DATA"))) { return SCTP_CID_DATA;} if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"INIT"))) { return SCTP_CID_INIT;} @@ -501,7 +241,7 @@ sctp_cid_t chunk_type_str2cid(const xmlChar * const chunk_type_str) AssertFatal (0, "ERROR: %s() cannot convert: %s\n", __FUNCTION__, chunk_type_str); } //------------------------------------------------------------------------------ -const char * const chunk_type_cid2str(const sctp_cid_t chunk_type) +const char * const et_chunk_type_cid2str(const sctp_cid_t chunk_type) { switch (chunk_type) { case SCTP_CID_DATA: return "DATA"; break; @@ -528,15 +268,15 @@ const char * const chunk_type_cid2str(const sctp_cid_t chunk_type) } } //------------------------------------------------------------------------------ -test_action_t action_str2test_action_t(const xmlChar * const action) +et_packet_action_t et_action_str2et_action_t(const xmlChar * const action) { - if ((!xmlStrcmp(action, (const xmlChar *)"SEND"))) { return ACTION_S1C_SEND;} - if ((!xmlStrcmp(action, (const xmlChar *)"RECEIVE"))) { return ACTION_S1C_RECEIVE;} + if ((!xmlStrcmp(action, (const xmlChar *)"SEND"))) { return ET_PACKET_ACTION_S1C_SEND;} + if ((!xmlStrcmp(action, (const xmlChar *)"RECEIVE"))) { return ET_PACKET_ACTION_S1C_RECEIVE;} AssertFatal (0, "ERROR: %s cannot convert: %s\n", __FUNCTION__, action); //if (NULL == action) {return ACTION_S1C_NULL;} } //------------------------------------------------------------------------------ -void ip_str2test_ip(const xmlChar * const ip_str, test_ip_t * const ip) +void et_ip_str2et_ip(const xmlChar * const ip_str, et_ip_t * const ip) { AssertFatal (NULL != ip_str, "ERROR %s() Cannot convert null string to ip address!\n", __FUNCTION__); AssertFatal (NULL != ip, "ERROR %s() out parameter pointer is NULL!\n", __FUNCTION__); @@ -550,732 +290,207 @@ void ip_str2test_ip(const xmlChar * const ip_str, test_ip_t * const ip) AssertFatal (0, "ERROR %s() Could not parse ip address %s!\n", __FUNCTION__, ip_str); } } -//------------------------------------------------------------------------------ -int test_s1ap_decode_initiating_message(s1ap_message *message, - S1ap_InitiatingMessage_t *initiating_p) +/*------------------------------------------------------------------------------*/ +uint32_t et_eNB_app_register(const Enb_properties_array_t *enb_properties) { - char *message_string = NULL; - int ret = -1; + uint32_t enb_id; + uint32_t mme_id; + MessageDef *msg_p; + uint32_t register_enb_pending = 0; + char *str = NULL; + struct in_addr addr; - DevAssert(initiating_p != NULL); - message_string = calloc(20000, sizeof(char)); - AssertFatal (NULL != message_string, "ERROR malloc()failed!\n"); - message->procedureCode = initiating_p->procedureCode; - message->criticality = initiating_p->criticality; + for (enb_id = 0; (enb_id < enb_properties->number) ; enb_id++) { + { + s1ap_register_enb_req_t *s1ap_register_eNB; - switch(initiating_p->procedureCode) { - case S1ap_ProcedureCode_id_downlinkNASTransport: - ret = s1ap_decode_s1ap_downlinknastransporties( - &message->msg.s1ap_DownlinkNASTransportIEs, - &initiating_p->value); - s1ap_xer_print_s1ap_downlinknastransport(s1ap_xer__print2sp, message_string, message); - break; + /* note: there is an implicit relationship between the data structure and the message name */ + msg_p = itti_alloc_new_message (TASK_ENB_APP, S1AP_REGISTER_ENB_REQ); - case S1ap_ProcedureCode_id_InitialContextSetup: - ret = s1ap_decode_s1ap_initialcontextsetuprequesties( - &message->msg.s1ap_InitialContextSetupRequestIEs, &initiating_p->value); - s1ap_xer_print_s1ap_initialcontextsetuprequest(s1ap_xer__print2sp, message_string, message); - break; + s1ap_register_eNB = &S1AP_REGISTER_ENB_REQ(msg_p); - case S1ap_ProcedureCode_id_UEContextRelease: - ret = s1ap_decode_s1ap_uecontextreleasecommandies( - &message->msg.s1ap_UEContextReleaseCommandIEs, &initiating_p->value); - s1ap_xer_print_s1ap_uecontextreleasecommand(s1ap_xer__print2sp, message_string, message); - break; + /* Some default/random parameters */ + s1ap_register_eNB->eNB_id = enb_properties->properties[enb_id]->eNB_id; + s1ap_register_eNB->cell_type = enb_properties->properties[enb_id]->cell_type; + s1ap_register_eNB->eNB_name = enb_properties->properties[enb_id]->eNB_name; + s1ap_register_eNB->tac = enb_properties->properties[enb_id]->tac; + s1ap_register_eNB->mcc = enb_properties->properties[enb_id]->mcc; + s1ap_register_eNB->mnc = enb_properties->properties[enb_id]->mnc; + s1ap_register_eNB->mnc_digit_length = enb_properties->properties[enb_id]->mnc_digit_length; + s1ap_register_eNB->default_drx = enb_properties->properties[enb_id]->pcch_defaultPagingCycle[0]; - case S1ap_ProcedureCode_id_Paging: - ret = s1ap_decode_s1ap_pagingies( - &message->msg.s1ap_PagingIEs, &initiating_p->value); - s1ap_xer_print_s1ap_paging(s1ap_xer__print2sp, message_string, message); - break; + s1ap_register_eNB->nb_mme = enb_properties->properties[enb_id]->nb_mme; + AssertFatal (s1ap_register_eNB->nb_mme <= S1AP_MAX_NB_MME_IP_ADDRESS, "Too many MME for eNB %d (%d/%d)!", enb_id, s1ap_register_eNB->nb_mme, + S1AP_MAX_NB_MME_IP_ADDRESS); - case S1ap_ProcedureCode_id_uplinkNASTransport: - ret = s1ap_decode_s1ap_uplinknastransporties (&message->msg.s1ap_UplinkNASTransportIEs, &initiating_p->value); - s1ap_xer_print_s1ap_uplinknastransport(s1ap_xer__print2sp, message_string, message); - break; + for (mme_id = 0; mme_id < s1ap_register_eNB->nb_mme; mme_id++) { + s1ap_register_eNB->mme_ip_address[mme_id].ipv4 = enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv4; + s1ap_register_eNB->mme_ip_address[mme_id].ipv6 = enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv6; + strncpy (s1ap_register_eNB->mme_ip_address[mme_id].ipv4_address, + enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv4_address, + sizeof(s1ap_register_eNB->mme_ip_address[0].ipv4_address)); + strncpy (s1ap_register_eNB->mme_ip_address[mme_id].ipv6_address, + enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv6_address, + sizeof(s1ap_register_eNB->mme_ip_address[0].ipv6_address)); + } - case S1ap_ProcedureCode_id_S1Setup: - ret = s1ap_decode_s1ap_s1setuprequesties (&message->msg.s1ap_S1SetupRequestIEs, &initiating_p->value); - s1ap_xer_print_s1ap_s1setuprequest(s1ap_xer__print2sp, message_string, message); - break; + s1ap_register_eNB->sctp_in_streams = enb_properties->properties[enb_id]->sctp_in_streams; + s1ap_register_eNB->sctp_out_streams = enb_properties->properties[enb_id]->sctp_out_streams; - case S1ap_ProcedureCode_id_initialUEMessage: - ret = s1ap_decode_s1ap_initialuemessageies (&message->msg.s1ap_InitialUEMessageIEs, &initiating_p->value); - s1ap_xer_print_s1ap_initialuemessage(s1ap_xer__print2sp, message_string, message); - break; - case S1ap_ProcedureCode_id_UEContextReleaseRequest: - ret = s1ap_decode_s1ap_uecontextreleaserequesties (&message->msg.s1ap_UEContextReleaseRequestIEs, &initiating_p->value); - s1ap_xer_print_s1ap_uecontextreleaserequest(s1ap_xer__print2sp, message_string, message); - break; + s1ap_register_eNB->enb_ip_address.ipv6 = 0; + s1ap_register_eNB->enb_ip_address.ipv4 = 1; + addr.s_addr = enb_properties->properties[enb_id]->enb_ipv4_address_for_S1_MME; + str = inet_ntoa(addr); + strcpy(s1ap_register_eNB->enb_ip_address.ipv4_address, str); - case S1ap_ProcedureCode_id_UECapabilityInfoIndication: - ret = s1ap_decode_s1ap_uecapabilityinfoindicationies (&message->msg.s1ap_UECapabilityInfoIndicationIEs, &initiating_p->value); - //s1ap_xer_print_s1ap_uecapabilityinfoindication(s1ap_xer__print2sp, message_string, message); - break; + itti_send_msg_to_task (TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p); - case S1ap_ProcedureCode_id_NASNonDeliveryIndication: - ret = s1ap_decode_s1ap_nasnondeliveryindication_ies (&message->msg.s1ap_NASNonDeliveryIndication_IEs, &initiating_p->value); - s1ap_xer_print_s1ap_nasnondeliveryindication_(s1ap_xer__print2sp, message_string, message); - break; - - default: - free(message_string); - AssertFatal( 0 , "Unknown procedure ID (%d) for initiating message\n", - (int)initiating_p->procedureCode); - return -1; + register_enb_pending++; + } } - fprintf(stdout, "s1ap_xer_print:\n%s\n", message_string); - free(message_string); - return ret; + + return register_enb_pending; +} +/*------------------------------------------------------------------------------*/ +void *et_eNB_app_task(void *args_p) +{ + const Enb_properties_array_t *enb_properties_p = NULL; + uint32_t register_enb_pending; + uint32_t registered_enb; + long enb_register_retry_timer_id; + uint32_t enb_id; + MessageDef *msg_p = NULL; + const char *msg_name = NULL; + instance_t instance; + int result; + + itti_mark_task_ready (TASK_ENB_APP); + + + enb_properties_p = enb_config_get(); + + + /* Try to register each eNB */ + registered_enb = 0; + register_enb_pending = et_eNB_app_register (enb_properties_p); + + + do { + // Wait for a message + itti_receive_msg (TASK_ENB_APP, &msg_p); + + msg_name = ITTI_MSG_NAME (msg_p); + instance = ITTI_MSG_INSTANCE (msg_p); + + switch (ITTI_MSG_ID(msg_p)) { + case TERMINATE_MESSAGE: + itti_exit_task (); + break; + + + + case S1AP_REGISTER_ENB_CNF: + LOG_I(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, msg_name, + S1AP_REGISTER_ENB_CNF(msg_p).nb_mme); + + DevAssert(register_enb_pending > 0); + register_enb_pending--; + + /* Check if at least eNB is registered with one MME */ + if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) { + registered_enb++; + } + + /* Check if all register eNB requests have been processed */ + if (register_enb_pending == 0) { + if (registered_enb == enb_properties_p->number) { + /* If all eNB are registered, start scenario */ + + } else { + uint32_t not_associated = enb_properties_p->number - registered_enb; + + LOG_W(ENB_APP, " %d eNB %s not associated with a MME, retrying registration in %d seconds ...\n", + not_associated, not_associated > 1 ? "are" : "is", ET_ENB_REGISTER_RETRY_DELAY); + + /* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */ + if (timer_setup (ET_ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT, + NULL, &enb_register_retry_timer_id) < 0) { + LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n"); + + sleep(ET_ENB_REGISTER_RETRY_DELAY); + /* Restart the registration process */ + registered_enb = 0; + register_enb_pending = et_eNB_app_register (enb_properties_p); + } + } + } + + break; + + case S1AP_DEREGISTERED_ENB_IND: + LOG_W(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, msg_name, + S1AP_DEREGISTERED_ENB_IND(msg_p).nb_mme); + + /* TODO handle recovering of registration */ + break; + + case TIMER_HAS_EXPIRED: + LOG_I(ENB_APP, " Received %s: timer_id %d\n", msg_name, TIMER_HAS_EXPIRED(msg_p).timer_id); + + if (TIMER_HAS_EXPIRED (msg_p).timer_id == enb_register_retry_timer_id) { + /* Restart the registration process */ + registered_enb = 0; + register_enb_pending = et_eNB_app_register (enb_properties_p); + } + break; + + default: + LOG_E(ENB_APP, "Received unexpected message %s\n", msg_name); + break; + } + + result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); + } while (1); + return NULL; } //------------------------------------------------------------------------------ -int test_s1ap_decode_successful_outcome(s1ap_message *message, - S1ap_SuccessfulOutcome_t *successfullOutcome_p) +int et_play_scenario(et_scenario_t* const scenario) { - char *message_string = NULL; - int ret = -1; + et_event_t event; + et_display_scenario(scenario); - DevAssert(successfullOutcome_p != NULL); - message_string = calloc(20000, sizeof(char)); - AssertFatal (NULL != message_string, "ERROR malloc()failed!\n"); - - message->procedureCode = successfullOutcome_p->procedureCode; - message->criticality = successfullOutcome_p->criticality; - - switch(successfullOutcome_p->procedureCode) { - case S1ap_ProcedureCode_id_S1Setup: - ret = s1ap_decode_s1ap_s1setupresponseies( - &message->msg.s1ap_S1SetupResponseIEs, &successfullOutcome_p->value); - s1ap_xer_print_s1ap_s1setupresponse(s1ap_xer__print2sp, message_string, message); - break; - - case S1ap_ProcedureCode_id_InitialContextSetup: - ret = s1ap_decode_s1ap_initialcontextsetupresponseies (&message->msg.s1ap_InitialContextSetupResponseIEs, &successfullOutcome_p->value); - s1ap_xer_print_s1ap_initialcontextsetupresponse(s1ap_xer__print2sp, message_string, message); - break; - - case S1ap_ProcedureCode_id_UEContextRelease: - ret = s1ap_decode_s1ap_uecontextreleasecompleteies (&message->msg.s1ap_UEContextReleaseCompleteIEs, &successfullOutcome_p->value); - s1ap_xer_print_s1ap_uecontextreleasecomplete(s1ap_xer__print2sp, message_string, message); - break; - - default: - free(message_string); - AssertFatal(0, "Unknown procedure ID (%d) for successfull outcome message\n", - (int)successfullOutcome_p->procedureCode); - return -1; - } - fprintf(stdout, "s1ap_xer_print:\n%s\n", message_string); - free(message_string); - return ret; -} - -//------------------------------------------------------------------------------ -int test_s1ap_decode_unsuccessful_outcome(s1ap_message *message, - S1ap_UnsuccessfulOutcome_t *unSuccessfullOutcome_p) -{ - char *message_string = NULL; - int ret = -1; - - DevAssert(unSuccessfullOutcome_p != NULL); - message_string = calloc(20000, sizeof(char)); - AssertFatal (NULL != message_string, "ERROR malloc()failed!\n"); - - message->procedureCode = unSuccessfullOutcome_p->procedureCode; - message->criticality = unSuccessfullOutcome_p->criticality; - - switch(unSuccessfullOutcome_p->procedureCode) { - case S1ap_ProcedureCode_id_S1Setup: - ret = s1ap_decode_s1ap_s1setupfailureies( - &message->msg.s1ap_S1SetupFailureIEs, &unSuccessfullOutcome_p->value); - s1ap_xer_print_s1ap_s1setupfailure(s1ap_xer__print2sp, message_string, message); - break; - - case S1ap_ProcedureCode_id_InitialContextSetup: - ret = s1ap_decode_s1ap_initialcontextsetupfailureies (&message->msg.s1ap_InitialContextSetupFailureIEs, &unSuccessfullOutcome_p->value); - s1ap_xer_print_s1ap_initialcontextsetupfailure(s1ap_xer__print2sp, message_string, message); - break; - - - default: - free(message_string); - AssertFatal(0,"Unknown procedure ID (%d) for unsuccessfull outcome message\n", - (int)unSuccessfullOutcome_p->procedureCode); - break; - } - fprintf(stdout, "s1ap_xer_print:\n%s\n", message_string); - free(message_string); - return ret; -} - -//------------------------------------------------------------------------------ -int test_s1ap_decode_pdu(s1ap_message *message, const uint8_t * const buffer, - const uint32_t length) -{ - S1AP_PDU_t pdu; - S1AP_PDU_t *pdu_p = &pdu; - asn_dec_rval_t dec_ret; - - DevAssert(buffer != NULL); - - memset((void *)pdu_p, 0, sizeof(S1AP_PDU_t)); - - dec_ret = aper_decode(NULL, - &asn_DEF_S1AP_PDU, - (void **)&pdu_p, - buffer, - length, - 0, - 0); - - if (dec_ret.code != RC_OK) { - S1AP_ERROR("Failed to decode pdu\n"); + // create SCTP ITTI task: same as eNB code + if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) { + LOG_E(SCTP, "Create task for SCTP failed\n"); return -1; } - message->direction = pdu_p->present; - - switch(pdu_p->present) { - case S1AP_PDU_PR_initiatingMessage: - return test_s1ap_decode_initiating_message(message, - &pdu_p->choice.initiatingMessage); - - case S1AP_PDU_PR_successfulOutcome: - return test_s1ap_decode_successful_outcome(message, - &pdu_p->choice.successfulOutcome); - - case S1AP_PDU_PR_unsuccessfulOutcome: - return test_s1ap_decode_unsuccessful_outcome(message, - &pdu_p->choice.unsuccessfulOutcome); - - default: - AssertFatal(0, "Unknown presence (%d) or not implemented\n", (int)pdu_p->present); - break; - } - return -1; -} -//------------------------------------------------------------------------------ -void test_decode_s1ap(test_s1ap_t * const s1ap) -{ - if (NULL != s1ap) { - if (test_s1ap_decode_pdu(&s1ap->message, s1ap->binary_stream, s1ap->binary_stream_allocated_size) < 0) { - AssertFatal (0, "ERROR %s() Cannot decode S1AP message!\n", __FUNCTION__); - } - } -} -//------------------------------------------------------------------------------ -void parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, test_s1ap_t * const s1ap) -{ - xmlNode *cur_node = NULL; - xmlChar *xml_char = NULL; - xmlChar *xml_char2 = NULL; - unsigned int size = 0; - int rc = 0; - unsigned int go_deeper_in_tree = 1; - - if ((NULL != s1ap_node) && (NULL != s1ap)) { - for (cur_node = (xmlNode *)s1ap_node; cur_node; cur_node = cur_node->next) { - go_deeper_in_tree = 1; - if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"field"))) { - // do not get hidden fields - xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"hide"); - if (NULL != xml_char) { - if ((!xmlStrcmp(xml_char, (const xmlChar *)"yes"))) { - go_deeper_in_tree = 0; - } - xmlFree(xml_char); - } - if (0 < go_deeper_in_tree) { - // first get size - xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"size"); - if (NULL != xml_char) { - size = strtoul((const char *)xml_char, NULL, 0); - xmlFree(xml_char); - // second: try to get value (always hex) - xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); - if (NULL != xml_char) { - xml_char2 = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"name"); - fprintf(stdout, "s1ap %p field %s size %d value %s\n",s1ap, xml_char2, size, xml_char); - xmlFree(xml_char2); - // if success to get value, do not parse children - //AssertFatal ((xmlStrlen(xml_char) == size), "ERROR %s() mismatch in size %d and strlen %d\n", __FUNCTION__, size, xmlStrlen(xml_char)); - //if (xmlStrlen(xml_char) == size) { - AssertFatal ((s1ap->binary_stream_pos+xmlStrlen(xml_char)/2) <= s1ap->binary_stream_allocated_size, - "ERROR %s() in buffer size: binary_stream_pos %d xmlStrlen(xml_char)/2=%d\n", __FUNCTION__, s1ap->binary_stream_pos, xmlStrlen(xml_char)/2); - rc = hex2data( &s1ap->binary_stream[s1ap->binary_stream_pos], xml_char, xmlStrlen(xml_char)); - s1ap->binary_stream_pos += xmlStrlen(xml_char)/2; - display_node(cur_node, 0); - AssertFatal (rc >= 0, "ERROR %s() in converting hex string %s len %d size %d rc %d\n", __FUNCTION__, xml_char, xmlStrlen(xml_char), size, rc); - go_deeper_in_tree = 0; - //} - xmlFree(xml_char); - } - } - } - } - if (0 < go_deeper_in_tree) { - parse_s1ap(doc, cur_node->children, s1ap); - } - } - } -} - -//------------------------------------------------------------------------------ -void parse_sctp_data_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_datahdr_t * const sctp_hdr) -{ - xmlNode *cur_node = NULL; - xmlChar *xml_char = NULL; - xmlChar *xml_char2 = NULL; - - if ((NULL != sctp_node) && (NULL != sctp_hdr)) { - xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); - if (NULL != xml_char) { - if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_payload_proto_id"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); - if (NULL != xml_char2) { - sctp_hdr->ppid = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_sid"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); - if (NULL != xml_char2) { - sctp_hdr->stream = strtoul((const char *)xml_char2, NULL, 16); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_tsn"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); - if (NULL != xml_char2) { - sctp_hdr->tsn = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_ssn"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); - if (NULL != xml_char2) { - sctp_hdr->ssn = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } - xmlFree(xml_char); - } - for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) { - parse_sctp_data_chunk(doc, cur_node, sctp_hdr); - } + // create S1AP ITTI task: not as same as eNB code + if (itti_create_task (TASK_S1AP, et_s1ap_eNB_task, NULL) < 0) { + LOG_E(S1AP, "Create task for S1AP failed\n"); + return -1; } -} -//------------------------------------------------------------------------------ -void parse_sctp_init_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_inithdr_t * const sctp_hdr) -{ - xmlNode *cur_node = NULL; - xmlChar *xml_char = NULL; - xmlChar *xml_char2 = NULL; - - if ((NULL != sctp_node) && (NULL != sctp_hdr)) { - xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); - if (NULL != xml_char) { - if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_nr_out_streams"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); - if (NULL != xml_char2) { - sctp_hdr->num_outbound_streams = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_nr_in_streams"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); - if (NULL != xml_char2) { - sctp_hdr->num_inbound_streams = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_credit"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); - if (NULL != xml_char2) { - sctp_hdr->a_rwnd = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_initial_tsn"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); - if (NULL != xml_char2) { - sctp_hdr->initial_tsn = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_initiate_tag"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); - if (NULL != xml_char2) { - sctp_hdr->init_tag = strtoul((const char *)xml_char2, NULL, 16); - xmlFree(xml_char2); - } - } - xmlFree(xml_char); - } - for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) { - parse_sctp_init_chunk(doc, cur_node, sctp_hdr); - } + // create ENB_APP ITTI task: not as same as eNB code + if (itti_create_task (TASK_ENB_APP, et_eNB_app_task, NULL) < 0) { + LOG_E(ENB_APP, "Create task for ENB_APP failed\n"); + return -1; } -} -//------------------------------------------------------------------------------ -void parse_sctp_init_ack_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_initackhdr_t * const sctp_hdr) -{ - xmlNode *cur_node = NULL; - xmlChar *xml_char = NULL; - xmlChar *xml_char2 = NULL; - if ((NULL != sctp_node) && (NULL != sctp_hdr)) { - xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); - if (NULL != xml_char) { - if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_nr_out_streams"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); - if (NULL != xml_char2) { - sctp_hdr->num_outbound_streams = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_nr_in_streams"))) { - xml_char2 = xmlGetProp((xmlNode *)(xmlNode *)sctp_node, (const xmlChar *)"value"); - if (NULL != xml_char2) { - sctp_hdr->num_inbound_streams = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_credit"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); - if (NULL != xml_char2) { - sctp_hdr->a_rwnd = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_initial_tsn"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); - if (NULL != xml_char2) { - sctp_hdr->initial_tsn = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_initiate_tag"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); - if (NULL != xml_char2) { - sctp_hdr->init_tag = strtoul((const char *)xml_char2, NULL, 16); - xmlFree(xml_char2); - } - } - xmlFree(xml_char); - } - for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) { - parse_sctp_init_ack_chunk(doc, cur_node, sctp_hdr); - } - } -} -//------------------------------------------------------------------------------ -void parse_sctp(xmlDocPtr doc, const xmlNode const *sctp_node, test_sctp_hdr_t * const sctp_hdr) -{ - xmlNode *cur_node = NULL; - xmlChar *xml_char = NULL; - xmlChar *xml_char2 = NULL; + event.code = ET_EVENT_INIT; + event.u.init.scenario = scenario; + et_scenario_fsm_notify_event(event); - if ((NULL != sctp_node) && (NULL != sctp_hdr)) { - if ((!xmlStrcmp(sctp_node->name, (const xmlChar *)"proto"))) { - xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); - if (NULL != xml_char) { - if ((!xmlStrcmp(xml_char, (const xmlChar *)"s1ap"))) { - xmlFree(xml_char); - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"size"); - if (NULL != xml_char2) { - sctp_hdr->u.data_hdr.payload.binary_stream_allocated_size = strtoul((const char *)xml_char2, NULL, 0); - sctp_hdr->u.data_hdr.payload.binary_stream = calloc(1, sctp_hdr->u.data_hdr.payload.binary_stream_allocated_size); - xmlFree(xml_char2); - } - parse_s1ap(doc, sctp_node, &sctp_hdr->u.data_hdr.payload); - test_decode_s1ap(&sctp_hdr->u.data_hdr.payload); - return; - } - xmlFree(xml_char); - } - } - //if ((cur_node->type == XML_ATTRIBUTE_NODE) || (cur_node->type == XML_ELEMENT_NODE)) { - xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); - if (NULL != xml_char) { - if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.srcport"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); - if (NULL != xml_char2) { - sctp_hdr->src_port = strtoul((const char *)xml_char2, NULL, 16); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.dstport"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); - if (NULL != xml_char2) { - sctp_hdr->dst_port = strtoul((const char *)xml_char2, NULL, 16); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.chunk_type"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); - if (NULL != xml_char2) { - sctp_hdr->chunk_type = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - switch (sctp_hdr->chunk_type) { - case SCTP_CID_DATA: - parse_sctp_data_chunk(doc, sctp_node->parent, &sctp_hdr->u.data_hdr); - break; - case SCTP_CID_INIT: - parse_sctp_init_chunk(doc, sctp_node->parent, &sctp_hdr->u.init_hdr); - break; - case SCTP_CID_INIT_ACK: - parse_sctp_init_ack_chunk(doc, sctp_node->parent, &sctp_hdr->u.init_ack_hdr); - break; - default: - ; - } - } - } - } - for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) { - parse_sctp(doc, cur_node, sctp_hdr); - } - } -} -//------------------------------------------------------------------------------ -test_packet_t* parse_xml_packet(xmlDocPtr doc, xmlNodePtr node) { - test_packet_t *packet = NULL; - xmlNode *cur_node = NULL; - xmlChar *xml_char = NULL; - float afloat = (float)0.0; - static struct timeval initial_time = { .tv_sec = 0, .tv_usec = 0 }; - static struct timeval relative_last_sent_packet = { .tv_sec = 0, .tv_usec = 0 }; - static struct timeval relative_last_received_packet = { .tv_sec = 0, .tv_usec = 0 }; - static char first_packet = 1; - static char first_sent_packet = 1; - static char first_received_packet = 1; - static unsigned int packet_number = 1; - - if (NULL != node) { - packet = calloc(1, sizeof(*packet)); - - xml_char = xmlGetProp(node, (const xmlChar *)"action"); - packet->action = action_str2test_action_t(xml_char); - xmlFree(xml_char); - packet->packet_number = packet_number++; - - for (cur_node = node->children; cur_node; cur_node = cur_node->next) { - //if (cur_node->type == XML_ELEMENT_NODE) { - if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"frame.time_relative"))) { - xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); - afloat = atof((const char*)xml_char); - xmlFree(xml_char); - packet->time_relative_to_first_packet.tv_sec = (int)afloat; - packet->time_relative_to_first_packet.tv_usec = (int)((afloat - packet->time_relative_to_first_packet.tv_sec)*1000000); - - if (first_packet > 0) { - initial_time = packet->time_relative_to_first_packet; - packet->time_relative_to_first_packet.tv_sec = 0; - packet->time_relative_to_first_packet.tv_usec = 0; - first_packet = 0; - } else { - timersub(&packet->time_relative_to_first_packet, &initial_time, - &packet->time_relative_to_first_packet); - } - if (packet->action == ACTION_S1C_SEND) { - if (first_sent_packet > 0) { - relative_last_sent_packet = packet->time_relative_to_first_packet; - packet->time_relative_to_last_sent_packet.tv_sec = 0; - packet->time_relative_to_last_sent_packet.tv_usec = 0; - first_sent_packet = 0; - } else { - timersub(&packet->time_relative_to_first_packet, &relative_last_sent_packet, - &packet->time_relative_to_last_sent_packet); - relative_last_sent_packet = packet->time_relative_to_first_packet; - } - } else if (packet->action == ACTION_S1C_RECEIVE) { - if (first_received_packet > 0) { - relative_last_received_packet.tv_sec = packet->time_relative_to_first_packet.tv_sec; - relative_last_received_packet.tv_usec = packet->time_relative_to_first_packet.tv_usec; - packet->time_relative_to_last_received_packet.tv_sec = 0; - packet->time_relative_to_last_received_packet.tv_usec = 0; - first_received_packet = 0; - } else { - timersub(&packet->time_relative_to_first_packet, &relative_last_received_packet, - &packet->time_relative_to_last_received_packet); - relative_last_received_packet = packet->time_relative_to_first_packet; - } - } - - } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"frame.number"))) { - xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); - packet->original_frame_number = strtoul((const char *)xml_char, NULL, 0); - xmlFree(xml_char); - } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"ip.src"))) { - xml_char = xmlNodeListGetString(doc, cur_node->xmlChildrenNode, 1); - ip_str2test_ip(xml_char, &packet->ip_hdr.src); - xmlFree(xml_char); - } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"ip.dst"))) { - xml_char = xmlNodeListGetString(doc, cur_node->xmlChildrenNode, 1); - ip_str2test_ip(xml_char, &packet->ip_hdr.dst); - xmlFree(xml_char); - } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"proto"))) { - xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"name"); - if (NULL != xml_char) { - if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp"))) { - parse_sctp(doc, cur_node, &packet->sctp_hdr); - } - xmlFree(xml_char); - } - } - //} - } - } - return packet; -} -//------------------------------------------------------------------------------ -int play_scenario(test_scenario_t* scenario) { - //TODO - display_scenario(scenario); return 0; } -//------------------------------------------------------------------------------ -test_scenario_t* generate_scenario( - const char * const play_scenario_filename ) -{ - xmlDocPtr doc = NULL; - xmlNodePtr root = NULL; - xmlNodePtr node = NULL; - xmlChar *xml_char = NULL; - test_scenario_t *scenario = NULL; - test_packet_t *packet = NULL; - test_packet_t **next_packet = NULL; - - doc = xmlParseFile(play_scenario_filename); - if (NULL == doc) { - AssertFatal (0, "Could not parse scenario xml file %s!\n", play_scenario_filename); - } else { - fprintf(stdout, "Test scenario file to play: %s\n", play_scenario_filename); - //xmlDebugDumpDocument(NULL, doc); - } - - // Get root - root = xmlDocGetRootElement(doc); - if (NULL != root) { - if ((!xmlStrcmp(root->name, (const xmlChar *)"scenario"))) { - xml_char = xmlGetProp(root, (const xmlChar *)"name"); - printf("scenario name: %s\n", xml_char); - scenario = calloc(1, sizeof(*scenario)); - scenario->name = xml_char; // nodup nofree - next_packet = &scenario->list_packet; - for (node = root->children; node != NULL; node = node->next) { - if ((!xmlStrcmp(node->name, (const xmlChar *)"packet"))) { - packet = parse_xml_packet(doc, node); - if (NULL != packet) { - *next_packet = packet; - next_packet = &packet->next; - } else { - fprintf(stdout, "WARNING omitted packet:\n"); - display_node(node, 0); - } - } - } - } - } else { - fprintf(stderr, "Empty xml document\n"); - } - xmlFreeDoc(doc); - xmlCleanupParser(); - return scenario; -} //------------------------------------------------------------------------------ -int generate_xml_scenario( - const char const * test_dir_name, - const char const * test_scenario_filename, - const char const * enb_config_filename, - char const * play_scenario_filename /* OUT PARAM*/) -//------------------------------------------------------------------------------ -{ - //int fd_pdml_in; - xsltStylesheetPtr cur = NULL; - xmlDocPtr doc, res; - FILE *play_scenario_file = NULL; - const char *params[2*ENB_CONFIG_MAX_XSLT_PARAMS]; - int nb_params = 0; - int i,j; - char astring[1024]; - struct in_addr addr; - int ret = 0; - - memset(astring, 0, sizeof(astring)); - if (getcwd(astring, sizeof(astring)) != NULL) { - fprintf(stdout, "working in %s directory\n", astring); - } else { - perror("getcwd() ERROR"); - exit(1); - } - - memset(astring, 0, sizeof(astring)); - strcat(astring, g_openair_dir); - strcat(astring, "/openair3/TEST/EPC_TEST/play_scenario.xsl"); - - xmlSubstituteEntitiesDefault(1); - xmlLoadExtDtdDefaultValue = 1; - cur = xsltParseStylesheetFile((const xmlChar *)astring); - if (NULL == cur) { - AssertFatal (0, "Could not parse stylesheet file %s (check OPENAIR_DIR env variable)!\n", astring); - } else { - fprintf(stdout, "XSLT style sheet: %s\n", astring); - } - - doc = xmlParseFile(test_scenario_filename); - if (NULL == doc) { - AssertFatal (0, "Could not parse scenario xml file %s!\n", test_scenario_filename); - } else { - fprintf(stdout, "Test scenario file: %s\n", test_scenario_filename); - } - - for (i = 0; i < enb_properties.number; i++) { - // eNB S1-C IPv4 address - sprintf(astring, "enb_s1c%d", i); - params[nb_params++] = strdup(astring); - addr.s_addr = enb_properties.properties[i]->enb_ipv4_address_for_S1_MME; - sprintf(astring, "\"%s\"", inet_ntoa(addr)); - params[nb_params++] = strdup(astring); - - // MME S1-C IPv4 address - for (j = 0; j < enb_properties.properties[i]->nb_mme; j++) { - sprintf(astring, "mme_s1c%d_%d", i, j); - params[nb_params++] = strdup(astring); - AssertFatal (enb_properties.properties[i]->mme_ip_address[j].ipv4_address, - "Only support MME IPv4 address\n"); - sprintf(astring, "\"%s\"", enb_properties.properties[i]->mme_ip_address[j].ipv4_address); - params[nb_params++] = strdup(astring); - } - } - params[nb_params] = NULL; - res = xsltApplyStylesheet(cur, doc, params); - if (NULL != res) { - sprintf((char *)play_scenario_filename,"%s",test_scenario_filename); - if (strip_extension((char *)play_scenario_filename) > 0) { - strcat((char *)play_scenario_filename, ".tsml"); - play_scenario_file = fopen( play_scenario_filename, "w+"); - if (NULL != play_scenario_file) { - xsltSaveResultToFile(play_scenario_file, res, cur); - fclose(play_scenario_file); - fprintf(stdout, "Wrote test scenario to %s\n", play_scenario_filename); - } else { - fprintf(stderr, "ERROR in fopen(%s)\n", play_scenario_filename); - ret = -1; - } - } else { - fprintf(stderr, "ERROR in strip_extension()\n"); - ret = -1; - } - } else { - fprintf(stderr, "ERROR in xsltApplyStylesheet()\n"); - ret = -1; - } - xsltFreeStylesheet(cur); - xmlFreeDoc(doc); - xmlFreeDoc(res); - - xsltCleanupGlobals(); - xmlCleanupParser(); - return ret; -} - -//------------------------------------------------------------------------------ -static void usage ( +static void et_usage ( int argc, char *argv[]) //------------------------------------------------------------------------------ @@ -1298,10 +513,10 @@ static void usage ( //------------------------------------------------------------------------------ int -config_parse_opt_line ( +et_config_parse_opt_line ( int argc, char *argv[], - char **test_dir_name, + char **et_dir_name, char **scenario_file_name, char **enb_config_file_name) //------------------------------------------------------------------------------ @@ -1354,12 +569,12 @@ config_parse_opt_line ( case LONG_OPTION_TEST_DIR: case 'd': if (optarg) { - *test_dir_name = strdup(optarg); - if (is_file_exists(*test_dir_name, "test dirname") != GS_IS_DIR) { - fprintf(stderr, "Please provide a valid test dirname, %s is not a valid directory name\n", *test_dir_name); + *et_dir_name = strdup(optarg); + if (is_file_exists(*et_dir_name, "test dirname") != GS_IS_DIR) { + fprintf(stderr, "Please provide a valid test dirname, %s is not a valid directory name\n", *et_dir_name); exit(1); } - printf("Test dir name is %s\n", *test_dir_name); + printf("Test dir name is %s\n", *et_dir_name); } break; @@ -1372,32 +587,32 @@ config_parse_opt_line ( case LONG_OPTION_HELP: case 'h': default: - usage (argc, argv); + et_usage (argc, argv); exit (0); } } - if (NULL == *test_dir_name) { + if (NULL == *et_dir_name) { fprintf(stderr, "Please provide a valid test dirname\n"); exit(1); } - if (chdir(*test_dir_name) != 0) { - fprintf(stderr, "ERROR: chdir %s returned %s\n", *test_dir_name, strerror(errno)); + if (chdir(*et_dir_name) != 0) { + fprintf(stderr, "ERROR: chdir %s returned %s\n", *et_dir_name, strerror(errno)); exit(1); } if (rv & PLAY_SCENARIO) { if (NULL == *enb_config_file_name) { - fprintf(stderr, "ERROR: please provide the original eNB config file name that should be in %s\n", *test_dir_name); + fprintf(stderr, "ERROR: please provide the original eNB config file name that should be in %s\n", *et_dir_name); } if (is_file_exists(*enb_config_file_name, "eNB config file") != GS_IS_FILE) { - fprintf(stderr, "ERROR: original eNB config file name %s is not found in dir %s\n", *enb_config_file_name, *test_dir_name); + fprintf(stderr, "ERROR: original eNB config file name %s is not found in dir %s\n", *enb_config_file_name, *et_dir_name); } enb_properties_p = enb_config_init(*enb_config_file_name); if (NULL == *scenario_file_name) { - fprintf(stderr, "ERROR: please provide the scenario file name that should be in %s\n", *test_dir_name); + fprintf(stderr, "ERROR: please provide the scenario file name that should be in %s\n", *et_dir_name); } if (is_file_exists(*scenario_file_name, "Scenario file") != GS_IS_FILE) { - fprintf(stderr, "ERROR: Scenario file name %s is not found in dir %s\n", *scenario_file_name, *test_dir_name); + fprintf(stderr, "ERROR: Scenario file name %s is not found in dir %s\n", *scenario_file_name, *et_dir_name); } } return rv; @@ -1408,12 +623,12 @@ int main( int argc, char **argv ) //------------------------------------------------------------------------------ { int actions = 0; - char *test_dir_name = NULL; + char *et_dir_name = NULL; char *scenario_file_name = NULL; char *enb_config_file_name = NULL; - char play_scenario_filename[NAME_MAX]; int ret = 0; - test_scenario_t *scenario = NULL; + et_scenario_t *scenario = NULL; + char play_scenario_filename[NAME_MAX]; memset(play_scenario_filename, 0, sizeof(play_scenario_filename)); g_openair_dir = getenv("OPENAIR_DIR"); @@ -1428,15 +643,15 @@ int main( int argc, char **argv ) set_comp_log(S1AP, LOG_TRACE, LOG_MED, 1); set_comp_log(SCTP, LOG_TRACE, LOG_MED, 1); - asn_debug = 1; + asn_debug = 0; asn1_xer_print = 1; //parameters - actions = config_parse_opt_line (argc, argv, &test_dir_name, &scenario_file_name, &enb_config_file_name); //Command-line options + actions = et_config_parse_opt_line (argc, argv, &et_dir_name, &scenario_file_name, &enb_config_file_name); //Command-line options if (actions & PLAY_SCENARIO) { - if (generate_xml_scenario(test_dir_name, scenario_file_name,enb_config_file_name, play_scenario_filename) == 0) { - if (NULL != (scenario = generate_scenario(play_scenario_filename))) { - ret = play_scenario(scenario); + if (et_generate_xml_scenario(et_dir_name, scenario_file_name,enb_config_file_name, play_scenario_filename) == 0) { + if (NULL != (scenario = et_generate_scenario(play_scenario_filename))) { + ret = et_play_scenario(scenario); } else { fprintf(stderr, "ERROR: Could not generate scenario from tsml file\n"); ret = -1; @@ -1445,9 +660,9 @@ int main( int argc, char **argv ) fprintf(stderr, "ERROR: Could not generate tsml scenario from xml file\n"); ret = -1; } - free_pointer(test_dir_name); - free_pointer(scenario_file_name); - free_pointer(enb_config_file_name); + et_free_pointer(et_dir_name); + et_free_pointer(scenario_file_name); + et_free_pointer(enb_config_file_name); } return ret; diff --git a/openair3/TEST/EPC_TEST/play_scenario.h b/openair3/TEST/EPC_TEST/play_scenario.h index 2bf6cc4ccf..725b5abc0e 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.h +++ b/openair3/TEST/EPC_TEST/play_scenario.h @@ -28,7 +28,7 @@ *******************************************************************************/ /* - play_scenario.h + et_scenario.h ------------------- AUTHOR : Lionel GAUTHIER COMPANY : EURECOM @@ -42,21 +42,44 @@ # include # include +#include "enb_config.h" #include "s1ap_ies_defs.h" +# define ET_ENB_REGISTER_RETRY_DELAY 3 -/** @defgroup _enb_app ENB APP - * @ingroup _oai2 - * @{ - */ typedef enum { - ACTION_S1C_START = 0, - ACTION_S1C_NULL = ACTION_S1C_START, - ACTION_S1C_SEND, - ACTION_S1C_RECEIVE, - ACTION_S1C_END -} test_action_t; + ET_PACKET_STATUS_START = 0, + ET_PACKET_STATUS_NONE = ET_PACKET_STATUS_START, + ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT, + ET_PACKET_STATUS_SCHEDULED_FOR_SENDING, + ET_PACKET_STATUS_SENT, + ET_PACKET_STATUS_SENT_WITH_ERRORS, + ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING, + ET_PACKET_STATUS_RECEIVED, + ET_PACKET_STATUS_RECEIVED_WITH_ERRORS, + ET_PACKET_STATUS_END +} et_packet_status_t; + +typedef enum { + ET_FSM_STATE_START = 0, + ET_FSM_STATE_NULL = ET_FSM_STATE_START, + ET_FSM_STATE_CONNECTING_SCTP, + ET_FSM_STATE_WAITING_TX_EVENT, + ET_FSM_STATE_WAITING_RX_EVENT, + ET_FSM_STATE_END +} et_fsm_state_t; + + + + +typedef enum { + ET_PACKET_ACTION_S1C_START = 0, + ET_PACKET_ACTION_S1C_NULL = ET_PACKET_ACTION_S1C_START, + ET_PACKET_ACTION_S1C_SEND, + ET_PACKET_ACTION_S1C_RECEIVE, + ET_PACKET_ACTION_S1C_END +} et_packet_action_t; // from kernel source file 3.19/include/linux/sctp.h typedef enum { @@ -94,16 +117,17 @@ typedef enum { TEST_S1AP_PDU_TYPE_SUCCESSFUL_OUTCOME, TEST_S1AP_PDU_TYPE_UNSUCCESSFUL_OUTCOME, TEST_S1AP_PDU_TYPE_END -} test_s1ap_pdu_type_t; +} et_s1ap_pdu_type_t; -typedef struct test_s1ap_s { - //test_s1ap_pdu_type_t pdu_type; +typedef struct et_s1ap_s { + //et_s1ap_pdu_type_t pdu_type; + S1AP_PDU_t pdu; // decoded ASN1 C type: choice of initiatingMessage, successfulOutcome, unsuccessfulOutcome uint16_t binary_stream_pos; uint16_t binary_stream_allocated_size; uint8_t *binary_stream; - s1ap_message message; -} test_s1ap_t; + s1ap_message message; // decoded message: information elements +} et_s1ap_t; // from kernel source file 3.19/include/linux/sctp.h, Big Endians @@ -112,7 +136,7 @@ typedef struct sctp_datahdr_s { uint16_t stream; uint16_t ssn; uint32_t ppid; - test_s1ap_t payload; + et_s1ap_t payload; } sctp_datahdr_t; // from kernel source file 3.19/include/linux/sctp.h, Big Endians @@ -127,7 +151,7 @@ typedef struct sctp_inithdr { typedef sctp_inithdr_t sctp_initackhdr_t; -typedef struct test_sctp_hdr_s { +typedef struct et_sctp_hdr_s { unsigned int src_port; unsigned int dst_port; sctp_cid_t chunk_type; @@ -136,38 +160,145 @@ typedef struct test_sctp_hdr_s { sctp_inithdr_t init_hdr; sctp_initackhdr_t init_ack_hdr; } u; -} test_sctp_hdr_t; +} et_sctp_hdr_t; -typedef struct test_ip_s { +typedef struct et_ip_s { unsigned int address_family; // AF_INET, AF_INET6 union { struct in6_addr ipv6; in_addr_t ipv4; }address; -}test_ip_t; +}et_ip_t; -typedef struct test_ip_hdr_s { - test_ip_t src; - test_ip_t dst; -} test_ip_hdr_t; +typedef struct et_ip_hdr_s { + et_ip_t src; + et_ip_t dst; +} et_ip_hdr_t; -typedef struct test_packet_s { - test_action_t action; - struct timeval time_relative_to_first_packet; - struct timeval time_relative_to_last_sent_packet; - struct timeval time_relative_to_last_received_packet; - unsigned int original_frame_number; - unsigned int packet_number; - test_ip_hdr_t ip_hdr; - test_sctp_hdr_t sctp_hdr; - struct test_packet_s *next; -}test_packet_t; +typedef struct et_packet_s { + et_packet_action_t action; + struct timeval time_relative_to_first_packet; + struct timeval time_relative_to_last_sent_packet; + struct timeval time_relative_to_last_received_packet; + unsigned int original_frame_number; + unsigned int packet_number; + et_ip_hdr_t ip_hdr; + et_sctp_hdr_t sctp_hdr; + struct et_packet_s *next; + //scenario running vars + et_packet_status_t status; +}et_packet_t; -typedef struct test_scenario_s { + +typedef struct sctp_epoll_s { + /* Array of events monitored by the task. + * By default only one fd is monitored (the one used to received messages + * from other tasks). + * More events can be suscribed later by the task itself. + */ + struct epoll_event *events; + + int epoll_nb_events; + +} thread_desc_t; + +typedef struct et_scenario_s { xmlChar *name; - test_packet_t *list_packet; -}test_scenario_t; + et_packet_t *list_packet; -inline void free_pointer(void *p) {if (NULL != p) {free(p); p=NULL;}}; -#endif /* ENB_CONFIG_H_ */ -/** @} */ + // playing scenario + et_packet_t *waited_packet; + et_packet_t *current_packet; +} et_scenario_t; + + +typedef enum { + ET_EVENT_START = 0, + ET_EVENT_INIT = ET_EVENT_START, + ET_EVENT_RX_SCTP_EVENT, + ET_EVENT_RX_S1AP, + ET_EVENT_RX_X2AP, + ET_EVENT_RX_PACKET_TIME_OUT, + ET_EVENT_TX_PACKET, + ET_EVENT_STOP, + ET_EVENT_END +} et_event_code_t; + +typedef struct et_event_init_s { + et_scenario_t *scenario; +} et_event_init_t; + +typedef struct et_event_s1ap_data_ind_s { + sctp_datahdr_t sctp_datahdr; +} et_event_s1ap_data_ind_t; + +typedef struct et_event_s1ap_data_req_s { + +} et_event_s1ap_data_req_t; + +typedef struct et_event_s { + et_event_code_t code; + union { + et_event_init_t init; + et_event_s1ap_data_ind_t s1ap_data_ind; + et_event_s1ap_data_req_t s1ap_data_req; + } u; +} et_event_t; + +inline void et_free_pointer(void *p) {if (NULL != p) {free(p); p=NULL;}}; + +//------------------------- +void et_free_packet(et_packet_t* packet); +void et_free_scenario(et_scenario_t* scenario); +//------------------------- +void et_display_packet_s1ap_data(const et_s1ap_t * const s1ap); +void et_display_packet_sctp_init(const sctp_inithdr_t * const sctp); +void et_display_packet_sctp_initack(const sctp_initackhdr_t * const sctp); +void et_display_packet_sctp_data(const sctp_datahdr_t * const sctp); +void et_display_packet_sctp(const et_sctp_hdr_t * const sctp); +void et_display_packet_ip(const et_ip_hdr_t * const ip); +void et_display_packet(const et_packet_t * const packet); +void et_display_scenario(const et_scenario_t * const scenario); +//------------------------- +int et_s1ap_decode_initiating_message(s1ap_message *message, S1ap_InitiatingMessage_t *initiating_p); +int et_s1ap_decode_successful_outcome(s1ap_message *message, S1ap_SuccessfulOutcome_t *successfullOutcome_p); +int et_s1ap_decode_unsuccessful_outcome(s1ap_message *message, S1ap_UnsuccessfulOutcome_t *unSuccessfullOutcome_p); +int et_s1ap_decode_pdu(S1AP_PDU_t * const pdu, s1ap_message * const message, const uint8_t * const buffer, const uint32_t length); +void et_decode_s1ap(et_s1ap_t * const s1ap); +//------------------------- +void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind); +void * et_s1ap_eNB_task(void *arg); +int et_generate_xml_scenario( + const char const * xml_in_dir_name, + const char const * xml_in_scenario_filename, + const char const * enb_config_filename, + char const * tsml_out_scenario_filename); +//------------------------- +int et_scenario_fsm_notify_event_state_null(et_event_t event); +int et_scenario_fsm_notify_event(et_event_t event); +//------------------------- +void et_parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, et_s1ap_t * const s1ap); +void et_parse_sctp_data_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_datahdr_t * const sctp_hdr); +void et_parse_sctp_init_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_inithdr_t * const sctp_hdr); +void et_parse_sctp_init_ack_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_initackhdr_t * const sctp_hdr); +void et_parse_sctp(xmlDocPtr doc, const xmlNode const *sctp_node, et_sctp_hdr_t * const sctp_hdr); +et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node); +et_scenario_t* et_generate_scenario(const char * const et_scenario_filename ); +//------------------------- +void et_print_hex_octets(const unsigned char * const byte_stream, const unsigned long int num); +int et_is_file_exists ( const char const * file_nameP, const char const *file_roleP); +int et_strip_extension( char *in_filename); +int et_split_path ( char * pathP, char *** resP); +void et_display_node ( xmlNodePtr node, unsigned int indent); +void et_display_tree ( xmlNodePtr node, unsigned int indent); +char * et_ip2ip_str(const et_ip_t * const ip); +int et_hex2data(unsigned char * const data, const unsigned char * const hexstring, const unsigned int len); +sctp_cid_t et_chunk_type_str2cid(const xmlChar * const chunk_type_str); +const char * const et_chunk_type_cid2str(const sctp_cid_t chunk_type); +et_packet_action_t et_action_str2et_action_t(const xmlChar * const action); +void et_ip_str2et_ip(const xmlChar * const ip_str, et_ip_t * const ip); +uint32_t et_eNB_app_register(const Enb_properties_array_t *enb_properties); +void *et_eNB_app_task(void *args_p); +int et_play_scenario(et_scenario_t* const scenario); + +#endif /* PLAY_SCENARIO_H_ */ diff --git a/openair3/TEST/EPC_TEST/play_scenario_decode.c b/openair3/TEST/EPC_TEST/play_scenario_decode.c new file mode 100644 index 0000000000..aba1703eb3 --- /dev/null +++ b/openair3/TEST/EPC_TEST/play_scenario_decode.c @@ -0,0 +1,214 @@ +/******************************************************************************* + OpenAirInterface + Copyright(c) 1999 - 2014 Eurecom + + OpenAirInterface is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + + OpenAirInterface is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenAirInterface.The full GNU General Public License is + included in this distribution in the file called "COPYING". If not, + see . + + Contact Information + OpenAirInterface Admin: openair_admin@eurecom.fr + OpenAirInterface Tech : openair_tech@eurecom.fr + OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + + Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + + *******************************************************************************/ + +/* + play_scenario_decode.c + ------------------- + AUTHOR : Lionel GAUTHIER + COMPANY : EURECOM + EMAIL : Lionel.Gauthier@eurecom.fr + */ + +#include "intertask_interface.h" +#include "platform_types.h" +#include "s1ap_ies_defs.h" +#include "s1ap_eNB_decoder.h" +#include "assertions.h" +#include "play_scenario.h" + +//------------------------------------------------------------------------------ +int et_s1ap_decode_initiating_message(s1ap_message *message, S1ap_InitiatingMessage_t *initiating_p) +{ + int ret = -1; + + DevAssert(initiating_p != NULL); + + message->procedureCode = initiating_p->procedureCode; + message->criticality = initiating_p->criticality; + + switch(initiating_p->procedureCode) { + case S1ap_ProcedureCode_id_downlinkNASTransport: + ret = s1ap_decode_s1ap_downlinknastransporties(&message->msg.s1ap_DownlinkNASTransportIEs,&initiating_p->value); + break; + + case S1ap_ProcedureCode_id_InitialContextSetup: + ret = s1ap_decode_s1ap_initialcontextsetuprequesties(&message->msg.s1ap_InitialContextSetupRequestIEs, &initiating_p->value); + break; + + case S1ap_ProcedureCode_id_UEContextRelease: + ret = s1ap_decode_s1ap_uecontextreleasecommandies(&message->msg.s1ap_UEContextReleaseCommandIEs, &initiating_p->value); + break; + + case S1ap_ProcedureCode_id_Paging: + ret = s1ap_decode_s1ap_pagingies(&message->msg.s1ap_PagingIEs, &initiating_p->value); + break; + + case S1ap_ProcedureCode_id_uplinkNASTransport: + ret = s1ap_decode_s1ap_uplinknastransporties (&message->msg.s1ap_UplinkNASTransportIEs, &initiating_p->value); + break; + + case S1ap_ProcedureCode_id_S1Setup: + ret = s1ap_decode_s1ap_s1setuprequesties (&message->msg.s1ap_S1SetupRequestIEs, &initiating_p->value); + break; + + case S1ap_ProcedureCode_id_initialUEMessage: + ret = s1ap_decode_s1ap_initialuemessageies (&message->msg.s1ap_InitialUEMessageIEs, &initiating_p->value); + break; + + case S1ap_ProcedureCode_id_UEContextReleaseRequest: + ret = s1ap_decode_s1ap_uecontextreleaserequesties (&message->msg.s1ap_UEContextReleaseRequestIEs, &initiating_p->value); + break; + + case S1ap_ProcedureCode_id_UECapabilityInfoIndication: + ret = s1ap_decode_s1ap_uecapabilityinfoindicationies (&message->msg.s1ap_UECapabilityInfoIndicationIEs, &initiating_p->value); + break; + + case S1ap_ProcedureCode_id_NASNonDeliveryIndication: + ret = s1ap_decode_s1ap_nasnondeliveryindication_ies (&message->msg.s1ap_NASNonDeliveryIndication_IEs, &initiating_p->value); + break; + + default: + AssertFatal( 0 , "Unknown procedure ID (%d) for initiating message\n", + (int)initiating_p->procedureCode); + return -1; + } + return ret; +} + +//------------------------------------------------------------------------------ +int et_s1ap_decode_successful_outcome(s1ap_message *message, S1ap_SuccessfulOutcome_t *successfullOutcome_p) +{ + int ret = -1; + + DevAssert(successfullOutcome_p != NULL); + + message->procedureCode = successfullOutcome_p->procedureCode; + message->criticality = successfullOutcome_p->criticality; + + switch(successfullOutcome_p->procedureCode) { + case S1ap_ProcedureCode_id_S1Setup: + ret = s1ap_decode_s1ap_s1setupresponseies( + &message->msg.s1ap_S1SetupResponseIEs, &successfullOutcome_p->value); + break; + + case S1ap_ProcedureCode_id_InitialContextSetup: + ret = s1ap_decode_s1ap_initialcontextsetupresponseies (&message->msg.s1ap_InitialContextSetupResponseIEs, &successfullOutcome_p->value); + break; + + case S1ap_ProcedureCode_id_UEContextRelease: + ret = s1ap_decode_s1ap_uecontextreleasecompleteies (&message->msg.s1ap_UEContextReleaseCompleteIEs, &successfullOutcome_p->value); + break; + + default: + AssertFatal(0, "Unknown procedure ID (%d) for successfull outcome message\n", + (int)successfullOutcome_p->procedureCode); + return -1; + } + return ret; +} + +//------------------------------------------------------------------------------ +int et_s1ap_decode_unsuccessful_outcome(s1ap_message *message, S1ap_UnsuccessfulOutcome_t *unSuccessfullOutcome_p) +{ + int ret = -1; + + DevAssert(unSuccessfullOutcome_p != NULL); + + message->procedureCode = unSuccessfullOutcome_p->procedureCode; + message->criticality = unSuccessfullOutcome_p->criticality; + + switch(unSuccessfullOutcome_p->procedureCode) { + case S1ap_ProcedureCode_id_S1Setup: + ret = s1ap_decode_s1ap_s1setupfailureies(&message->msg.s1ap_S1SetupFailureIEs, &unSuccessfullOutcome_p->value); + break; + + case S1ap_ProcedureCode_id_InitialContextSetup: + ret = s1ap_decode_s1ap_initialcontextsetupfailureies (&message->msg.s1ap_InitialContextSetupFailureIEs, &unSuccessfullOutcome_p->value); + break; + + default: + AssertFatal(0,"Unknown procedure ID (%d) for unsuccessfull outcome message\n", + (int)unSuccessfullOutcome_p->procedureCode); + break; + } + return ret; +} + +//------------------------------------------------------------------------------ +int et_s1ap_decode_pdu(S1AP_PDU_t * const pdu, s1ap_message * const message, const uint8_t * const buffer, const uint32_t length) +{ + asn_dec_rval_t dec_ret; + + DevAssert(buffer != NULL); + + memset((void *)pdu, 0, sizeof(S1AP_PDU_t)); + + dec_ret = aper_decode(NULL, + &asn_DEF_S1AP_PDU, + (void **)&pdu, + buffer, + length, + 0, + 0); + + if (dec_ret.code != RC_OK) { + S1AP_ERROR("Failed to decode pdu\n"); + return -1; + } + + message->direction = pdu->present; + + switch(pdu->present) { + case S1AP_PDU_PR_initiatingMessage: + return et_s1ap_decode_initiating_message(message, + &pdu->choice.initiatingMessage); + + case S1AP_PDU_PR_successfulOutcome: + return et_s1ap_decode_successful_outcome(message, + &pdu->choice.successfulOutcome); + + case S1AP_PDU_PR_unsuccessfulOutcome: + return et_s1ap_decode_unsuccessful_outcome(message, + &pdu->choice.unsuccessfulOutcome); + + default: + AssertFatal(0, "Unknown presence (%d) or not implemented\n", (int)pdu->present); + break; + } + return -1; +} +//------------------------------------------------------------------------------ +void et_decode_s1ap(et_s1ap_t * const s1ap) +{ + if (NULL != s1ap) { + if (et_s1ap_decode_pdu(&s1ap->pdu, &s1ap->message, s1ap->binary_stream, s1ap->binary_stream_allocated_size) < 0) { + AssertFatal (0, "ERROR %s() Cannot decode S1AP message!\n", __FUNCTION__); + } + } +} diff --git a/openair3/TEST/EPC_TEST/play_scenario_display.c b/openair3/TEST/EPC_TEST/play_scenario_display.c new file mode 100644 index 0000000000..406c69c858 --- /dev/null +++ b/openair3/TEST/EPC_TEST/play_scenario_display.c @@ -0,0 +1,292 @@ +/******************************************************************************* + OpenAirInterface + Copyright(c) 1999 - 2014 Eurecom + + OpenAirInterface is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + + OpenAirInterface is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenAirInterface.The full GNU General Public License is + included in this distribution in the file called "COPYING". If not, + see . + + Contact Information + OpenAirInterface Admin: openair_admin@eurecom.fr + OpenAirInterface Tech : openair_tech@eurecom.fr + OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + + Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + + *******************************************************************************/ + +/* + play_scenario_display.c + ------------------- + AUTHOR : Lionel GAUTHIER + COMPANY : EURECOM + EMAIL : Lionel.Gauthier@eurecom.fr + */ +#include +#include + +#include "intertask_interface.h" +#include "platform_types.h" +#include "assertions.h" +#include "s1ap_ies_defs.h" +#include "s1ap_eNB_decoder.h" +#include "play_scenario.h" +//----------------------------------------------------------------------------- +void et_print_hex_octets(const unsigned char * const byte_stream, const unsigned long int num) +{ + unsigned long octet_index = 0; + + if (byte_stream == NULL) { + return; + } + + fprintf(stdout, "+-----+-------------------------------------------------+\n"); + fprintf(stdout, "| | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n"); + fprintf(stdout, "+-----+-------------------------------------------------+\n"); + + for (octet_index = 0; octet_index < num; octet_index++) { + if ((octet_index % 16) == 0) { + if (octet_index != 0) { + fprintf(stdout, " |\n"); + } + + fprintf(stdout, " %04ld |", octet_index); + } + + /* + * Print every single octet in hexadecimal form + */ + fprintf(stdout, " %02x", byte_stream[octet_index]); + /* + * Align newline and pipes according to the octets in groups of 2 + */ + } + + /* + * Append enough spaces and put final pipe + */ + unsigned char index; + + for (index = octet_index; index < 16; ++index) { + fprintf(stdout, " "); + } + + fprintf(stdout, " |\n"); +} + +//------------------------------------------------------------------------------ +void et_display_node(xmlNodePtr node, unsigned int indent) +{ + int i = 0; + if (node->type == XML_ELEMENT_NODE) { + xmlChar *path = xmlGetNodePath(node); + for (i=0; ichildren != NULL && node->children->type == XML_TEXT_NODE) { + xmlChar *content = xmlNodeGetContent(node); + printf("%s -> %s\n", path, content); + xmlFree(content); + } else { + printf("%s\n", path); + } + xmlFree(path); + } +} +//------------------------------------------------------------------------------ +void et_display_tree(xmlNodePtr node, unsigned int indent) +{ + xmlNode *cur_node = NULL; + + for (cur_node = node; cur_node; cur_node = cur_node->next) { + if (cur_node->type == XML_ELEMENT_NODE) { + et_display_node(cur_node, indent); + } + et_display_tree(cur_node->children, indent++); + } +} +//------------------------------------------------------------------------------ +void et_display_packet_s1ap_data(const et_s1ap_t * const s1ap) +{ + char *message_string = NULL; + + if (s1ap) { + message_string = calloc(20000, sizeof(char)); + AssertFatal (NULL != message_string, "ERROR malloc()failed!\n"); + s1ap_string_total_size = 0; + switch(s1ap->pdu.present) { + case S1AP_PDU_PR_initiatingMessage: + switch(s1ap->pdu.choice.initiatingMessage.procedureCode) { + case S1ap_ProcedureCode_id_downlinkNASTransport: s1ap_xer_print_s1ap_downlinknastransport(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break; + case S1ap_ProcedureCode_id_InitialContextSetup: s1ap_xer_print_s1ap_initialcontextsetuprequest(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break; + case S1ap_ProcedureCode_id_UEContextRelease: s1ap_xer_print_s1ap_uecontextreleasecommand(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break; + case S1ap_ProcedureCode_id_Paging: s1ap_xer_print_s1ap_paging(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break; + case S1ap_ProcedureCode_id_uplinkNASTransport: s1ap_xer_print_s1ap_uplinknastransport(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break; + case S1ap_ProcedureCode_id_S1Setup: s1ap_xer_print_s1ap_s1setuprequest(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break; + case S1ap_ProcedureCode_id_initialUEMessage: s1ap_xer_print_s1ap_initialuemessage(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break; + case S1ap_ProcedureCode_id_UEContextReleaseRequest: s1ap_xer_print_s1ap_uecontextreleaserequest(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break; + case S1ap_ProcedureCode_id_UECapabilityInfoIndication:s1ap_xer_print_s1ap_uecapabilityinfoindication(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break; + case S1ap_ProcedureCode_id_NASNonDeliveryIndication: s1ap_xer_print_s1ap_nasnondeliveryindication_(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break; + default: + AssertFatal( 0 , "Unknown procedure ID (%d) for initiating message\n", + (int)s1ap->pdu.choice.initiatingMessage.procedureCode); + } + break; + case S1AP_PDU_PR_successfulOutcome: + switch(s1ap->pdu.choice.successfulOutcome.procedureCode) { + case S1ap_ProcedureCode_id_S1Setup: s1ap_xer_print_s1ap_s1setupresponse(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break; + case S1ap_ProcedureCode_id_InitialContextSetup: s1ap_xer_print_s1ap_initialcontextsetupresponse(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break; + case S1ap_ProcedureCode_id_UEContextRelease: s1ap_xer_print_s1ap_uecontextreleasecomplete(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break; + default: + AssertFatal(0, "Unknown procedure ID (%d) for successfull outcome message\n", + (int)s1ap->pdu.choice.successfulOutcome.procedureCode); + } + break; + + case S1AP_PDU_PR_unsuccessfulOutcome: + switch(s1ap->pdu.choice.unsuccessfulOutcome.procedureCode) { + case S1ap_ProcedureCode_id_S1Setup: s1ap_xer_print_s1ap_s1setupfailure(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break; + case S1ap_ProcedureCode_id_InitialContextSetup: s1ap_xer_print_s1ap_initialcontextsetupfailure(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break; + default: + et_free_pointer(message_string); + AssertFatal(0,"Unknown procedure ID (%d) for unsuccessfull outcome message\n", + (int)s1ap->pdu.choice.unsuccessfulOutcome.procedureCode); + break; + } + break; + default: + AssertFatal(0, "Unknown presence (%d) or not implemented\n", (int)s1ap->pdu.present); + break; + } + fprintf(stdout, "\t\tSCTP.data XML dump:\n%s\n", message_string); + et_free_pointer(message_string); + } +} +//------------------------------------------------------------------------------ +void et_display_packet_sctp_init(const sctp_inithdr_t * const sctp) +{ + + if (sctp) { + fprintf(stdout, "\t\tSCTP.init.init_tag : %u\n", sctp->init_tag); + fprintf(stdout, "\t\tSCTP.init.a_rwnd : %u\n", sctp->a_rwnd); + fprintf(stdout, "\t\tSCTP.init.num_inbound_streams : %u\n", sctp->num_inbound_streams); + fprintf(stdout, "\t\tSCTP.init.num_outbound_streams : %u\n", sctp->num_outbound_streams); + fprintf(stdout, "\t\tSCTP.init.initial_tsn : %u\n", sctp->initial_tsn); + } +} +//------------------------------------------------------------------------------ +void et_display_packet_sctp_initack(const sctp_initackhdr_t * const sctp) +{ + + if (sctp) { + fprintf(stdout, "\t\tSCTP.initack.init_tag : %u\n", sctp->init_tag); + fprintf(stdout, "\t\tSCTP.initack.a_rwnd : %u\n", sctp->a_rwnd); + fprintf(stdout, "\t\tSCTP.initack.num_inbound_streams : %u\n", sctp->num_inbound_streams); + fprintf(stdout, "\t\tSCTP.initack.num_outbound_streams : %u\n", sctp->num_outbound_streams); + fprintf(stdout, "\t\tSCTP.initack.initial_tsn : %u\n", sctp->initial_tsn); + } +} +//------------------------------------------------------------------------------ +void et_display_packet_sctp_data(const sctp_datahdr_t * const sctp) +{ + if (sctp) { + fprintf(stdout, "\t\tSCTP.data.tsn : %u\n", sctp->tsn); + fprintf(stdout, "\t\tSCTP.data.stream : %u\n", sctp->stream); + fprintf(stdout, "\t\tSCTP.data.ssn : %u\n", sctp->ssn); + fprintf(stdout, "\t\tSCTP.data.ppid : %u\n", sctp->ppid); + if (sctp->ppid == 18) { + et_display_packet_s1ap_data(&sctp->payload); + } + fprintf(stdout, "\t\tSCTP.data.binary_stream_allocated_size : %u\n", sctp->payload.binary_stream_allocated_size); + if (NULL != sctp->payload.binary_stream) { + fprintf(stdout, "\t\tSCTP.data.binary_stream :\n"); + et_print_hex_octets(sctp->payload.binary_stream, sctp->payload.binary_stream_allocated_size); + } else { + fprintf(stdout, "\t\tSCTP.data.binary_stream : NULL\n"); + } + } +} + +//------------------------------------------------------------------------------ +void et_display_packet_sctp(const et_sctp_hdr_t * const sctp) +{ + if (sctp) { + fprintf(stdout, "\t\tSCTP.src_port : %u\n", sctp->src_port); + fprintf(stdout, "\t\tSCTP.dst_port : %u\n", sctp->dst_port); + fprintf(stdout, "\t\tSCTP.chunk_type : %s\n", et_chunk_type_cid2str(sctp->chunk_type)); + switch (sctp->chunk_type) { + case SCTP_CID_DATA: + et_display_packet_sctp_data(&sctp->u.data_hdr); + break; + case SCTP_CID_INIT: + et_display_packet_sctp_initack(&sctp->u.init_hdr); + break; + case SCTP_CID_INIT_ACK: + et_display_packet_sctp_initack(&sctp->u.init_ack_hdr); + break; + default: + ; + } + } +} +//------------------------------------------------------------------------------ +void et_display_packet_ip(const et_ip_hdr_t * const ip) +{ + if (ip) { + fprintf(stdout, "\t\tSource address : %s\n", et_ip2ip_str(&ip->src)); + fprintf(stdout, "\t\tDestination address : %s\n", et_ip2ip_str(&ip->dst)); + } +} + +//------------------------------------------------------------------------------ +void et_display_packet(const et_packet_t * const packet) +{ + if (packet) { + fprintf(stdout, "-------------------------------------------------------------------------------\n"); + fprintf(stdout, "\tPacket:\tnum %u | original frame number %u \n", packet->packet_number, packet->original_frame_number); + fprintf(stdout, "\tPacket:\ttime relative to 1st packet %ld.%06lu\n", + packet->time_relative_to_first_packet.tv_sec, packet->time_relative_to_first_packet.tv_usec); + fprintf(stdout, "\tPacket:\ttime relative to last tx packet %ld.%06lu\n", + packet->time_relative_to_last_sent_packet.tv_sec, packet->time_relative_to_last_sent_packet.tv_usec); + fprintf(stdout, "\tPacket:\ttime relative to last_received packet %ld.%06lu\n", + packet->time_relative_to_last_received_packet.tv_sec, packet->time_relative_to_last_received_packet.tv_usec); + + switch(packet->action) { + case ET_PACKET_ACTION_S1C_SEND: + fprintf(stdout, "\tPacket:\tAction SEND\n"); + break; + case ET_PACKET_ACTION_S1C_RECEIVE: + fprintf(stdout, "\tPacket:\tAction RECEIVE\n"); + break; + default: + fprintf(stdout, "\tPacket:\tAction UNKNOWN\n"); + } + et_display_packet_ip(&packet->ip_hdr); + et_display_packet_sctp(&packet->sctp_hdr); + } +} +//------------------------------------------------------------------------------ +void et_display_scenario(const et_scenario_t * const scenario) +{ + et_packet_t *packet = NULL; + if (scenario) { + fprintf(stdout, "Scenario: %s\n", (scenario->name != NULL) ? (char*)scenario->name:"UNKNOWN NAME"); + packet = scenario->list_packet; + while (packet) { + et_display_packet(packet); + packet = packet->next; + } + } +} diff --git a/openair3/TEST/EPC_TEST/play_scenario_fsm.c b/openair3/TEST/EPC_TEST/play_scenario_fsm.c new file mode 100644 index 0000000000..6c73793f4d --- /dev/null +++ b/openair3/TEST/EPC_TEST/play_scenario_fsm.c @@ -0,0 +1,127 @@ +/******************************************************************************* + OpenAirInterface + Copyright(c) 1999 - 2014 Eurecom + + OpenAirInterface is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + + OpenAirInterface is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenAirInterface.The full GNU General Public License is + included in this distribution in the file called "COPYING". If not, + see . + + Contact Information + OpenAirInterface Admin: openair_admin@eurecom.fr + OpenAirInterface Tech : openair_tech@eurecom.fr + OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + + Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + + *******************************************************************************/ + +/* + play_scenario_fsm.c + ------------------- + AUTHOR : Lionel GAUTHIER + COMPANY : EURECOM + EMAIL : Lionel.Gauthier@eurecom.fr + */ +#include + +#include "intertask_interface.h" +#include "platform_types.h" +#include "assertions.h" +#include "play_scenario.h" + + +et_scenario_t *g_scenario = NULL; +et_fsm_state_t g_fsm_state = ET_FSM_STATE_NULL; +//------------------------------------------------------------------------------ +int et_scenario_fsm_notify_event_state_null(et_event_t event) +{ + et_packet_t *packet = NULL; + const Enb_properties_array_t *enb_properties_p = NULL; + uint32_t register_enb_pending; + + switch (event.code){ + case ET_EVENT_INIT: + AssertFatal(NULL == g_scenario, "Current scenario not ended"); + g_scenario = event.u.init.scenario; + packet = g_scenario->list_packet; + while (NULL != packet) { + switch (packet->sctp_hdr.chunk_type) { + + case SCTP_CID_DATA : + // no init in this scenario, may be sub-scenario + if (packet->action == ET_PACKET_ACTION_S1C_SEND) { + } else if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { + g_scenario->waited_packet = packet; + } else { + packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT; + packet = packet->next; + } + break; + case SCTP_CID_INIT: + case SCTP_CID_INIT_ACK: + enb_properties_p = enb_config_get(); + /* Try to register each eNB */ + g_fsm_state = ET_FSM_STATE_CONNECTING_SCTP; + register_enb_pending = et_eNB_app_register (enb_properties_p); + break; + case SCTP_CID_HEARTBEAT: + case SCTP_CID_HEARTBEAT_ACK: + case SCTP_CID_COOKIE_ECHO: + case SCTP_CID_COOKIE_ACK: + case SCTP_CID_ECN_ECNE: + case SCTP_CID_ECN_CWR: + packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT; + packet = packet->next; + break; + case SCTP_CID_ABORT: + case SCTP_CID_SHUTDOWN: + case SCTP_CID_SHUTDOWN_ACK: + case SCTP_CID_ERROR: + case SCTP_CID_SHUTDOWN_COMPLETE: + AssertFatal(0, "The scenario should be cleaned (packet %s cannot be processed at this time)", et_chunk_type_cid2str(packet->sctp_hdr.chunk_type)); + break; + + default: + packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT; + packet = packet->next; + } + } + fprintf(stderr, "No Packet found in this scenario: %s\n", g_scenario->name); + return -1; + break; + + case ET_EVENT_STOP: + break; + + default: + AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_NULL", event.code); + } + return 0; +} + +//------------------------------------------------------------------------------ +int et_scenario_fsm_notify_event(et_event_t event) +{ + AssertFatal((event.code >= ET_EVENT_START) && (event.code < ET_EVENT_END), "Unknown et_event_t.code %d", event.code); + + switch (g_fsm_state){ + case ET_FSM_STATE_NULL: return et_scenario_fsm_notify_event_state_null(event); break; + case ET_FSM_STATE_CONNECTING_SCTP: return et_scenario_fsm_notify_event_state_null(event); break; + case ET_FSM_STATE_WAITING_TX_EVENT: return et_scenario_fsm_notify_event_state_null(event); break; + case ET_FSM_STATE_WAITING_RX_EVENT: return et_scenario_fsm_notify_event_state_null(event); break; + default: + return -1; + } +} diff --git a/openair3/TEST/EPC_TEST/play_scenario_parse.c b/openair3/TEST/EPC_TEST/play_scenario_parse.c new file mode 100644 index 0000000000..236c17963a --- /dev/null +++ b/openair3/TEST/EPC_TEST/play_scenario_parse.c @@ -0,0 +1,561 @@ +/******************************************************************************* + OpenAirInterface + Copyright(c) 1999 - 2014 Eurecom + + OpenAirInterface is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + + OpenAirInterface is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenAirInterface.The full GNU General Public License is + included in this distribution in the file called "COPYING". If not, + see . + + Contact Information + OpenAirInterface Admin: openair_admin@eurecom.fr + OpenAirInterface Tech : openair_tech@eurecom.fr + OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + + Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + + *******************************************************************************/ + +/* + play_scenario_parse.c + ------------------- + AUTHOR : Lionel GAUTHIER + COMPANY : EURECOM + EMAIL : Lionel.Gauthier@eurecom.fr + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "intertask_interface.h" +#include "platform_types.h" +#include "enb_config.h" +#include "assertions.h" +#include "play_scenario.h" +//------------------------------------------------------------------------------ +#define ENB_CONFIG_MAX_XSLT_PARAMS 32 +//------------------------------------------------------------------------------ +extern char *g_openair_dir; +extern Enb_properties_array_t enb_properties; +//------------------------------------------------------------------------------ +void et_parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, et_s1ap_t * const s1ap) +{ + xmlNode *cur_node = NULL; + xmlChar *xml_char = NULL; + xmlChar *xml_char2 = NULL; + unsigned int size = 0; + int rc = 0; + unsigned int go_deeper_in_tree = 1; + + if ((NULL != s1ap_node) && (NULL != s1ap)) { + for (cur_node = (xmlNode *)s1ap_node; cur_node; cur_node = cur_node->next) { + go_deeper_in_tree = 1; + if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"field"))) { + // do not get hidden fields + xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"hide"); + if (NULL != xml_char) { + if ((!xmlStrcmp(xml_char, (const xmlChar *)"yes"))) { + go_deeper_in_tree = 0; + } + xmlFree(xml_char); + } + if (0 < go_deeper_in_tree) { + // first get size + xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"size"); + if (NULL != xml_char) { + size = strtoul((const char *)xml_char, NULL, 0); + xmlFree(xml_char); + // second: try to get value (always hex) + xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); + if (NULL != xml_char) { + xml_char2 = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"name"); + fprintf(stdout, "s1ap %p field %s size %d value %s\n",s1ap, xml_char2, size, xml_char); + xmlFree(xml_char2); + // if success to get value, do not parse children + //AssertFatal ((xmlStrlen(xml_char) == size), "ERROR %s() mismatch in size %d and strlen %d\n", __FUNCTION__, size, xmlStrlen(xml_char)); + //if (xmlStrlen(xml_char) == size) { + AssertFatal ((s1ap->binary_stream_pos+xmlStrlen(xml_char)/2) <= s1ap->binary_stream_allocated_size, + "ERROR %s() in buffer size: binary_stream_pos %d xmlStrlen(xml_char)/2=%d\n", __FUNCTION__, s1ap->binary_stream_pos, xmlStrlen(xml_char)/2); + rc = et_hex2data( &s1ap->binary_stream[s1ap->binary_stream_pos], xml_char, xmlStrlen(xml_char)); + s1ap->binary_stream_pos += xmlStrlen(xml_char)/2; + et_display_node(cur_node, 0); + AssertFatal (rc >= 0, "ERROR %s() in converting hex string %s len %d size %d rc %d\n", __FUNCTION__, xml_char, xmlStrlen(xml_char), size, rc); + go_deeper_in_tree = 0; + //} + xmlFree(xml_char); + } + } + } + } + if (0 < go_deeper_in_tree) { + et_parse_s1ap(doc, cur_node->children, s1ap); + } + } + } +} + +//------------------------------------------------------------------------------ +void et_parse_sctp_data_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_datahdr_t * const sctp_hdr) +{ + xmlNode *cur_node = NULL; + xmlChar *xml_char = NULL; + xmlChar *xml_char2 = NULL; + + if ((NULL != sctp_node) && (NULL != sctp_hdr)) { + xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); + if (NULL != xml_char) { + if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_payload_proto_id"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); + if (NULL != xml_char2) { + sctp_hdr->ppid = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_sid"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); + if (NULL != xml_char2) { + sctp_hdr->stream = strtoul((const char *)xml_char2, NULL, 16); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_tsn"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); + if (NULL != xml_char2) { + sctp_hdr->tsn = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_ssn"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); + if (NULL != xml_char2) { + sctp_hdr->ssn = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } + xmlFree(xml_char); + } + for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) { + et_parse_sctp_data_chunk(doc, cur_node, sctp_hdr); + } + } + +} +//------------------------------------------------------------------------------ +void et_parse_sctp_init_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_inithdr_t * const sctp_hdr) +{ + xmlNode *cur_node = NULL; + xmlChar *xml_char = NULL; + xmlChar *xml_char2 = NULL; + + if ((NULL != sctp_node) && (NULL != sctp_hdr)) { + xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); + if (NULL != xml_char) { + if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_nr_out_streams"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); + if (NULL != xml_char2) { + sctp_hdr->num_outbound_streams = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_nr_in_streams"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); + if (NULL != xml_char2) { + sctp_hdr->num_inbound_streams = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_credit"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); + if (NULL != xml_char2) { + sctp_hdr->a_rwnd = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_initial_tsn"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); + if (NULL != xml_char2) { + sctp_hdr->initial_tsn = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_initiate_tag"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); + if (NULL != xml_char2) { + sctp_hdr->init_tag = strtoul((const char *)xml_char2, NULL, 16); + xmlFree(xml_char2); + } + } + xmlFree(xml_char); + } + for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) { + et_parse_sctp_init_chunk(doc, cur_node, sctp_hdr); + } + } +} +//------------------------------------------------------------------------------ +void et_parse_sctp_init_ack_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_initackhdr_t * const sctp_hdr) +{ + xmlNode *cur_node = NULL; + xmlChar *xml_char = NULL; + xmlChar *xml_char2 = NULL; + + if ((NULL != sctp_node) && (NULL != sctp_hdr)) { + xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); + if (NULL != xml_char) { + if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_nr_out_streams"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); + if (NULL != xml_char2) { + sctp_hdr->num_outbound_streams = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_nr_in_streams"))) { + xml_char2 = xmlGetProp((xmlNode *)(xmlNode *)sctp_node, (const xmlChar *)"value"); + if (NULL != xml_char2) { + sctp_hdr->num_inbound_streams = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_credit"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); + if (NULL != xml_char2) { + sctp_hdr->a_rwnd = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_initial_tsn"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); + if (NULL != xml_char2) { + sctp_hdr->initial_tsn = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_initiate_tag"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); + if (NULL != xml_char2) { + sctp_hdr->init_tag = strtoul((const char *)xml_char2, NULL, 16); + xmlFree(xml_char2); + } + } + xmlFree(xml_char); + } + for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) { + et_parse_sctp_init_ack_chunk(doc, cur_node, sctp_hdr); + } + } +} +//------------------------------------------------------------------------------ +void et_parse_sctp(xmlDocPtr doc, const xmlNode const *sctp_node, et_sctp_hdr_t * const sctp_hdr) +{ + xmlNode *cur_node = NULL; + xmlChar *xml_char = NULL; + xmlChar *xml_char2 = NULL; + + if ((NULL != sctp_node) && (NULL != sctp_hdr)) { + if ((!xmlStrcmp(sctp_node->name, (const xmlChar *)"proto"))) { + xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); + if (NULL != xml_char) { + if ((!xmlStrcmp(xml_char, (const xmlChar *)"s1ap"))) { + xmlFree(xml_char); + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"size"); + if (NULL != xml_char2) { + sctp_hdr->u.data_hdr.payload.binary_stream_allocated_size = strtoul((const char *)xml_char2, NULL, 0); + sctp_hdr->u.data_hdr.payload.binary_stream = calloc(1, sctp_hdr->u.data_hdr.payload.binary_stream_allocated_size); + xmlFree(xml_char2); + } + et_parse_s1ap(doc, sctp_node, &sctp_hdr->u.data_hdr.payload); + et_decode_s1ap(&sctp_hdr->u.data_hdr.payload); + return; + } + xmlFree(xml_char); + } + } + //if ((cur_node->type == XML_ATTRIBUTE_NODE) || (cur_node->type == XML_ELEMENT_NODE)) { + xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); + if (NULL != xml_char) { + if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.srcport"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); + if (NULL != xml_char2) { + sctp_hdr->src_port = strtoul((const char *)xml_char2, NULL, 16); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.dstport"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); + if (NULL != xml_char2) { + sctp_hdr->dst_port = strtoul((const char *)xml_char2, NULL, 16); + xmlFree(xml_char2); + } + } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.chunk_type"))) { + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); + if (NULL != xml_char2) { + sctp_hdr->chunk_type = strtoul((const char *)xml_char2, NULL, 0); + xmlFree(xml_char2); + switch (sctp_hdr->chunk_type) { + case SCTP_CID_DATA: + et_parse_sctp_data_chunk(doc, sctp_node->parent, &sctp_hdr->u.data_hdr); + break; + case SCTP_CID_INIT: + et_parse_sctp_init_chunk(doc, sctp_node->parent, &sctp_hdr->u.init_hdr); + break; + case SCTP_CID_INIT_ACK: + et_parse_sctp_init_ack_chunk(doc, sctp_node->parent, &sctp_hdr->u.init_ack_hdr); + break; + default: + ; + } + } + } + } + for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) { + et_parse_sctp(doc, cur_node, sctp_hdr); + } + } +} +//------------------------------------------------------------------------------ +et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node) { + + et_packet_t *packet = NULL; + xmlNode *cur_node = NULL; + xmlChar *xml_char = NULL; + float afloat = (float)0.0; + static struct timeval initial_time = { .tv_sec = 0, .tv_usec = 0 }; + static struct timeval relative_last_sent_packet = { .tv_sec = 0, .tv_usec = 0 }; + static struct timeval relative_last_received_packet = { .tv_sec = 0, .tv_usec = 0 }; + static char first_packet = 1; + static char first_sent_packet = 1; + static char first_received_packet = 1; + static unsigned int packet_number = 1; + + if (NULL != node) { + packet = calloc(1, sizeof(*packet)); + + xml_char = xmlGetProp(node, (const xmlChar *)"action"); + packet->action = et_action_str2et_action_t(xml_char); + xmlFree(xml_char); + packet->packet_number = packet_number++; + + for (cur_node = node->children; cur_node; cur_node = cur_node->next) { + //if (cur_node->type == XML_ELEMENT_NODE) { + if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"frame.time_relative"))) { + xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); + afloat = atof((const char*)xml_char); + xmlFree(xml_char); + packet->time_relative_to_first_packet.tv_sec = (int)afloat; + packet->time_relative_to_first_packet.tv_usec = (int)((afloat - packet->time_relative_to_first_packet.tv_sec)*1000000); + + if (first_packet > 0) { + initial_time = packet->time_relative_to_first_packet; + packet->time_relative_to_first_packet.tv_sec = 0; + packet->time_relative_to_first_packet.tv_usec = 0; + first_packet = 0; + } else { + timersub(&packet->time_relative_to_first_packet, &initial_time, + &packet->time_relative_to_first_packet); + } + if (packet->action == ET_PACKET_ACTION_S1C_SEND) { + if (first_sent_packet > 0) { + relative_last_sent_packet = packet->time_relative_to_first_packet; + packet->time_relative_to_last_sent_packet.tv_sec = 0; + packet->time_relative_to_last_sent_packet.tv_usec = 0; + first_sent_packet = 0; + } else { + timersub(&packet->time_relative_to_first_packet, &relative_last_sent_packet, + &packet->time_relative_to_last_sent_packet); + relative_last_sent_packet = packet->time_relative_to_first_packet; + } + } else if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { + if (first_received_packet > 0) { + relative_last_received_packet.tv_sec = packet->time_relative_to_first_packet.tv_sec; + relative_last_received_packet.tv_usec = packet->time_relative_to_first_packet.tv_usec; + packet->time_relative_to_last_received_packet.tv_sec = 0; + packet->time_relative_to_last_received_packet.tv_usec = 0; + first_received_packet = 0; + } else { + timersub(&packet->time_relative_to_first_packet, &relative_last_received_packet, + &packet->time_relative_to_last_received_packet); + relative_last_received_packet = packet->time_relative_to_first_packet; + } + } + + } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"frame.number"))) { + xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); + packet->original_frame_number = strtoul((const char *)xml_char, NULL, 0); + xmlFree(xml_char); + } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"ip.src"))) { + xml_char = xmlNodeListGetString(doc, cur_node->xmlChildrenNode, 1); + et_ip_str2et_ip(xml_char, &packet->ip_hdr.src); + xmlFree(xml_char); + } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"ip.dst"))) { + xml_char = xmlNodeListGetString(doc, cur_node->xmlChildrenNode, 1); + et_ip_str2et_ip(xml_char, &packet->ip_hdr.dst); + xmlFree(xml_char); + } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"proto"))) { + xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"name"); + if (NULL != xml_char) { + if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp"))) { + et_parse_sctp(doc, cur_node, &packet->sctp_hdr); + } + xmlFree(xml_char); + } + } + //} + } + } + return packet; +} +//------------------------------------------------------------------------------ +et_scenario_t* et_generate_scenario( + const char * const tsml_out_scenario_filename ) +{ + xmlDocPtr doc = NULL; + xmlNodePtr root = NULL; + xmlNodePtr node = NULL; + xmlChar *xml_char = NULL; + et_scenario_t *scenario = NULL; + et_packet_t *packet = NULL; + et_packet_t **next_packet = NULL; + + doc = xmlParseFile(tsml_out_scenario_filename); + if (NULL == doc) { + AssertFatal (0, "Could not parse scenario xml file %s!\n", tsml_out_scenario_filename); + } else { + fprintf(stdout, "Test scenario file to play: %s\n", tsml_out_scenario_filename); + //xmlDebugDumpDocument(NULL, doc); + } + + // Get root + root = xmlDocGetRootElement(doc); + if (NULL != root) { + if ((!xmlStrcmp(root->name, (const xmlChar *)"scenario"))) { + xml_char = xmlGetProp(root, (const xmlChar *)"name"); + printf("scenario name: %s\n", xml_char); + scenario = calloc(1, sizeof(*scenario)); + scenario->name = xml_char; // nodup nofree + next_packet = &scenario->list_packet; + for (node = root->children; node != NULL; node = node->next) { + if ((!xmlStrcmp(node->name, (const xmlChar *)"packet"))) { + packet = et_parse_xml_packet(doc, node); + if (NULL != packet) { + *next_packet = packet; + next_packet = &packet->next; + } else { + fprintf(stdout, "WARNING omitted packet:\n"); + et_display_node(node, 0); + } + } + } + } + } else { + fprintf(stderr, "Empty xml document\n"); + } + xmlFreeDoc(doc); + xmlCleanupParser(); + return scenario; +} +//------------------------------------------------------------------------------ +int et_generate_xml_scenario( + const char const * xml_in_dir_name, + const char const * xml_in_scenario_filename, + const char const * enb_config_filename, + char const * tsml_out_scenario_filename) +//------------------------------------------------------------------------------ +{ + //int fd_pdml_in; + xsltStylesheetPtr cur = NULL; + xmlDocPtr doc, res; + FILE *play_scenario_file = NULL; + const char *params[2*ENB_CONFIG_MAX_XSLT_PARAMS]; + int nb_params = 0; + int i,j; + char astring[1024]; + struct in_addr addr; + int ret = 0; + + memset(astring, 0, sizeof(astring)); + if (getcwd(astring, sizeof(astring)) != NULL) { + fprintf(stdout, "working in %s directory\n", astring); + } else { + perror("getcwd() ERROR"); + exit(1); + } + + memset(astring, 0, sizeof(astring)); + strcat(astring, g_openair_dir); + strcat(astring, "/openair3/TEST/EPC_TEST/play_scenario.xsl"); + + xmlSubstituteEntitiesDefault(1); + xmlLoadExtDtdDefaultValue = 1; + cur = xsltParseStylesheetFile((const xmlChar *)astring); + if (NULL == cur) { + AssertFatal (0, "Could not parse stylesheet file %s (check OPENAIR_DIR env variable)!\n", astring); + } else { + fprintf(stdout, "XSLT style sheet: %s\n", astring); + } + + doc = xmlParseFile(xml_in_scenario_filename); + if (NULL == doc) { + AssertFatal (0, "Could not parse scenario xml file %s!\n", xml_in_scenario_filename); + } else { + fprintf(stdout, "Test scenario file: %s\n", xml_in_scenario_filename); + } + + for (i = 0; i < enb_properties.number; i++) { + // eNB S1-C IPv4 address + sprintf(astring, "enb_s1c%d", i); + params[nb_params++] = strdup(astring); + addr.s_addr = enb_properties.properties[i]->enb_ipv4_address_for_S1_MME; + sprintf(astring, "\"%s\"", inet_ntoa(addr)); + params[nb_params++] = strdup(astring); + + // MME S1-C IPv4 address + for (j = 0; j < enb_properties.properties[i]->nb_mme; j++) { + sprintf(astring, "mme_s1c%d_%d", i, j); + params[nb_params++] = strdup(astring); + AssertFatal (enb_properties.properties[i]->mme_ip_address[j].ipv4_address, + "Only support MME IPv4 address\n"); + sprintf(astring, "\"%s\"", enb_properties.properties[i]->mme_ip_address[j].ipv4_address); + params[nb_params++] = strdup(astring); + } + } + params[nb_params] = NULL; + res = xsltApplyStylesheet(cur, doc, params); + if (NULL != res) { + sprintf((char *)tsml_out_scenario_filename,"%s",xml_in_scenario_filename); + if (et_strip_extension((char *)tsml_out_scenario_filename) > 0) { + strcat((char *)tsml_out_scenario_filename, ".tsml"); + play_scenario_file = fopen( tsml_out_scenario_filename, "w+"); + if (NULL != play_scenario_file) { + xsltSaveResultToFile(play_scenario_file, res, cur); + fclose(play_scenario_file); + fprintf(stdout, "Wrote test scenario to %s\n", tsml_out_scenario_filename); + } else { + fprintf(stderr, "ERROR in fopen(%s)\n", tsml_out_scenario_filename); + ret = -1; + } + } else { + fprintf(stderr, "ERROR in strip_extension()\n"); + ret = -1; + } + } else { + fprintf(stderr, "ERROR in xsltApplyStylesheet()\n"); + ret = -1; + } + xsltFreeStylesheet(cur); + xmlFreeDoc(doc); + xmlFreeDoc(res); + + xsltCleanupGlobals(); + xmlCleanupParser(); + return ret; +} + diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c new file mode 100644 index 0000000000..cb5571c28b --- /dev/null +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c @@ -0,0 +1,162 @@ +/******************************************************************************* + OpenAirInterface + Copyright(c) 1999 - 2014 Eurecom + + OpenAirInterface is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + + OpenAirInterface is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenAirInterface.The full GNU General Public License is + included in this distribution in the file called "COPYING". If not, + see . + + Contact Information + OpenAirInterface Admin: openair_admin@eurecom.fr + OpenAirInterface Tech : openair_tech@eurecom.fr + OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + + Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + + *******************************************************************************/ + +/* + play_scenario_s1ap.c + ------------------- + AUTHOR : Lionel GAUTHIER + COMPANY : EURECOM + EMAIL : Lionel.Gauthier@eurecom.fr + */ +#include +#include +#include +#include +#include "tree.h" +#include "queue.h" + + +#include "intertask_interface.h" +#include "messages_types.h" +#include "platform_types.h" +#include "s1ap_common.h" +#include "s1ap_eNB_defs.h" +#include "s1ap_eNB_default_values.h" +#include "s1ap_eNB_management_procedures.h" +#include "s1ap_eNB.h" +#include "play_scenario.h" +#include "msc.h" +#include "assertions.h" +#include "conversions.h" + + +//------------------------------------------------------------------------------ +extern void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp); +extern void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB); +//------------------------------------------------------------------------------ +void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind) +{ + int result = 0; + et_event_t event; + + DevAssert(sctp_data_ind != NULL); + + memset((void*)&event, 0, sizeof(event)); + + event.code = ET_EVENT_RX_S1AP; + event.u.s1ap_data_ind.sctp_datahdr.tsn = 0; + event.u.s1ap_data_ind.sctp_datahdr.stream = sctp_data_ind->stream; + event.u.s1ap_data_ind.sctp_datahdr.ssn = 0; + event.u.s1ap_data_ind.sctp_datahdr.ppid = 18; // find constant + + event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream_pos = 0; + event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream_allocated_size = sctp_data_ind->buffer_length; + event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream = NULL; + if ((sctp_data_ind->buffer_length > 0) && (NULL != sctp_data_ind->buffer)) { + event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream = calloc(1, sctp_data_ind->buffer_length); + memcpy(event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream, + sctp_data_ind->buffer, + sctp_data_ind->buffer_length); + + if (et_s1ap_decode_pdu( + &event.u.s1ap_data_ind.sctp_datahdr.payload.pdu, + &event.u.s1ap_data_ind.sctp_datahdr.payload.message, + event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream, + event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream_allocated_size) < 0) { + AssertFatal (0, "ERROR %s() Cannot decode RX S1AP message!\n", __FUNCTION__); + } + + } + + result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); + + et_scenario_fsm_notify_event(event); + +} +//------------------------------------------------------------------------------ +void *et_s1ap_eNB_task(void *arg) +{ + MessageDef *received_msg = NULL; + int result; + + S1AP_DEBUG("Starting S1AP layer\n"); + + s1ap_eNB_prepare_internal_data(); + + itti_mark_task_ready(TASK_S1AP); + MSC_START_USE(); + + while (1) { + itti_receive_msg(TASK_S1AP, &received_msg); + + switch (ITTI_MSG_ID(received_msg)) { + case TERMINATE_MESSAGE: + itti_exit_task(); + break; + + case S1AP_REGISTER_ENB_REQ: { + /* Register a new eNB. + * in Virtual mode eNBs will be distinguished using the mod_id/ + * Each eNB has to send an S1AP_REGISTER_ENB message with its + * own parameters. + */ + s1ap_eNB_handle_register_eNB(ITTI_MESSAGE_GET_INSTANCE(received_msg), + &S1AP_REGISTER_ENB_REQ(received_msg)); + } + break; + + case SCTP_NEW_ASSOCIATION_RESP: { + s1ap_eNB_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg), + &received_msg->ittiMsg.sctp_new_association_resp); + } + break; + + case SCTP_DATA_IND: { + et_s1ap_eNB_handle_sctp_data_ind(&received_msg->ittiMsg.sctp_data_ind); + } + break; + + + default: + S1AP_ERROR("Received unhandled message: %d:%s\n", + ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg)); + break; + } + + result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); + + received_msg = NULL; + } + + return NULL; +} + + diff --git a/openair3/TEST/EPC_TEST/play_scenario_sctp.c b/openair3/TEST/EPC_TEST/play_scenario_sctp.c new file mode 100644 index 0000000000..6856cb2933 --- /dev/null +++ b/openair3/TEST/EPC_TEST/play_scenario_sctp.c @@ -0,0 +1,45 @@ +/******************************************************************************* + OpenAirInterface + Copyright(c) 1999 - 2014 Eurecom + + OpenAirInterface is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + + OpenAirInterface is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenAirInterface.The full GNU General Public License is + included in this distribution in the file called "COPYING". If not, + see . + + Contact Information + OpenAirInterface Admin: openair_admin@eurecom.fr + OpenAirInterface Tech : openair_tech@eurecom.fr + OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + + Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + + *******************************************************************************/ + +/* + play_scenario_sctp.c + ------------------- + AUTHOR : Lionel GAUTHIER + COMPANY : EURECOM + EMAIL : Lionel.Gauthier@eurecom.fr + */ + + +#include + +#include "intertask_interface.h" +#include "platform_types.h" +#include "assertions.h" +#include "play_scenario.h" + diff --git a/openair3/UTILS/conversions.h b/openair3/UTILS/conversions.h index aaa2b9714f..47912f0d92 100644 --- a/openair3/UTILS/conversions.h +++ b/openair3/UTILS/conversions.h @@ -275,7 +275,6 @@ do { \ (bITsTRING)->size = 3; \ (bITsTRING)->bits_unused = 4; \ } while(0) -/* /* TS 36.413 v10.9.0 section 9.2.1.38: * E-UTRAN CGI/Cell Identity * The leftmost bits of the Cell From e58be6bbc14cc1b1bde0a126d9bd9bd9206bca8c Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 23 Nov 2015 16:54:44 +0100 Subject: [PATCH 013/214] Remaining TODO fill assoc_id and mme_ue_id of packets --- cmake_targets/CMakeLists.txt | 5 +- openair3/TEST/EPC_TEST/generate_scenario.c | 4 +- openair3/TEST/EPC_TEST/generic_scenario.xsl | 144 ++++-- openair3/TEST/EPC_TEST/play_scenario.c | 309 ++++++++++-- openair3/TEST/EPC_TEST/play_scenario.h | 186 +++++++- openair3/TEST/EPC_TEST/play_scenario_fsm.c | 325 +++++++++++-- openair3/TEST/EPC_TEST/play_scenario_parse.c | 27 +- openair3/TEST/EPC_TEST/play_scenario_s1ap.c | 447 +++++++++++++++++- .../EPC_TEST/play_scenario_s1ap_eNB_defs.h | 250 ++++++++++ 9 files changed, 1522 insertions(+), 175 deletions(-) create mode 100644 openair3/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 148aae2419..bcf90bdb83 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1667,17 +1667,16 @@ add_executable(test_epc_play_scenario ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_fsm.c ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_parse.c ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap.c + ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_sctp.c ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.h - ${OPENAIR2_DIR}/ENB_APP/enb_config.h ${OPENAIR2_DIR}/COMMON/commonDef.h ${OPENAIR2_DIR}/COMMON/messages_def.h ${OPENAIR2_DIR}/COMMON/messages_types.h - ${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h ${OPENAIR_BIN_DIR}/messages_xml.h ) target_link_libraries (test_epc_play_scenario - -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} + -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} ) diff --git a/openair3/TEST/EPC_TEST/generate_scenario.c b/openair3/TEST/EPC_TEST/generate_scenario.c index 8f39b9873e..9f4e16baef 100644 --- a/openair3/TEST/EPC_TEST/generate_scenario.c +++ b/openair3/TEST/EPC_TEST/generate_scenario.c @@ -228,7 +228,7 @@ int generate_test_scenario(const char const * test_nameP, const char const * pdm for (i = 0; i < g_enb_properties.number; i++) { // eNB S1-C IPv4 address - sprintf(astring, "enb_s1c%d", i); + sprintf(astring, "enb%d_s1c", i); params[nb_params++] = strdup(astring); addr.s_addr = g_enb_properties.properties[i]->enb_ipv4_address_for_S1_MME; sprintf(astring, "\"%s\"", inet_ntoa(addr)); @@ -236,7 +236,7 @@ int generate_test_scenario(const char const * test_nameP, const char const * pdm // MME S1-C IPv4 address for (j = 0; j < g_enb_properties.properties[i]->nb_mme; j++) { - sprintf(astring, "mme_s1c%d_%d", i, j); + sprintf(astring, "mme%d_s1c_%d", i, j); params[nb_params++] = strdup(astring); AssertFatal (g_enb_properties.properties[i]->mme_ip_address[j].ipv4_address, "Only support MME IPv4 address\n"); diff --git a/openair3/TEST/EPC_TEST/generic_scenario.xsl b/openair3/TEST/EPC_TEST/generic_scenario.xsl index 1d49b4942e..592bef83d4 100644 --- a/openair3/TEST/EPC_TEST/generic_scenario.xsl +++ b/openair3/TEST/EPC_TEST/generic_scenario.xsl @@ -8,30 +8,30 @@ /> - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -39,30 +39,30 @@ - enb_s1c0 - enb_s1c1 - enb_s1c2 - enb_s1c3 - enb_s1c4 - enb_s1c5 - enb_s1c6 - enb_s1c7 - mme_s1c0_0 - mme_s1c0_1 - mme_s1c0_2 - mme_s1c0_3 - mme_s1c1_0 - mme_s1c1_1 - mme_s1c1_2 - mme_s1c1_3 - mme_s1c2_0 - mme_s1c2_1 - mme_s1c2_2 - mme_s1c2_3 - mme_s1c3_0 - mme_s1c3_1 - mme_s1c3_2 - mme_s1c3_3 + enb0_s1c + enb1_s1c + enb2_s1c + enb3_s1c + enb4_s1c + enb5_s1c + enb6_s1c + enb7_s1c + mme0_s1c_0 + mme0_s1c_1 + mme0_s1c_2 + mme0_s1c_3 + mme1_s1c_0 + mme1_s1c_1 + mme1_s1c_2 + mme1_s1c_3 + mme2_s1c_0 + mme2_s1c_1 + mme2_s1c_2 + mme2_s1c_3 + mme3_s1c_0 + mme3_s1c_1 + mme3_s1c_2 + mme3_s1c_3 ERROR: Cannot reverse resolv IP ! @@ -70,6 +70,26 @@ + + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + + ERROR: Cannot set eNB instance ! + + + + + + + @@ -120,8 +140,26 @@ - SEND - RECEIVE + SEND + RECEIVE + + ERROR: UNKNOWN ACTION ! + + + + + + + + + + + + + + + + ERROR: UNKNOWN ACTION ! @@ -156,6 +194,7 @@ + @@ -177,6 +216,7 @@ + @@ -197,6 +237,7 @@ + @@ -218,6 +259,7 @@ + @@ -233,6 +275,7 @@ + @@ -249,6 +292,7 @@ + diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index fda38dbcb8..f29393f0e7 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -48,6 +48,9 @@ #include #include #include +#include +#include +#include #include "intertask_interface_init.h" @@ -63,11 +66,19 @@ #define GS_IS_FILE 1 #define GS_IS_DIR 2 //------------------------------------------------------------------------------ -char *g_openair_dir = NULL; +char *g_openair_dir = NULL; +Enb_properties_array_t g_enb_properties; //------------------------------------------------------------------------------ -extern int xmlLoadExtDtdDefaultValue; -extern int asn_debug; -extern int asn1_xer_print; +extern et_scenario_t *g_scenario; +extern int xmlLoadExtDtdDefaultValue; +extern int asn_debug; +extern int asn1_xer_print; + +//------------------------------------------------------------------------------ +// MEMO: +// Scenario with several eNBs: We may have to create ethx.y interfaces +// + //------------------------------------------------------------------------------ @@ -159,6 +170,7 @@ void et_free_scenario(et_scenario_t* scenario) packet = next_packet->next; } et_free_pointer(scenario); + pthread_mutex_destroy(&scenario->fsm_lock); } } @@ -290,17 +302,250 @@ void et_ip_str2et_ip(const xmlChar * const ip_str, et_ip_t * const ip) AssertFatal (0, "ERROR %s() Could not parse ip address %s!\n", __FUNCTION__, ip_str); } } +#ifdef LIBCONFIG_LONG +#define libconfig_int long +#else +#define libconfig_int int +#endif +//------------------------------------------------------------------------------ +void et_enb_config_init(const char const * lib_config_file_name_pP) +//------------------------------------------------------------------------------ +{ + config_t cfg; + config_setting_t *setting = NULL; + config_setting_t *subsetting = NULL; + config_setting_t *setting_mme_addresses = NULL; + config_setting_t *setting_mme_address = NULL; + config_setting_t *setting_enb = NULL; + int num_enb_properties = 0; + int enb_properties_index = 0; + int num_enbs = 0; + int num_mme_address = 0; + int i = 0; + int j = 0; + int parse_errors = 0; + libconfig_int enb_id = 0; + const char* cell_type = NULL; + const char* tac = 0; + const char* enb_name = NULL; + const char* mcc = 0; + const char* mnc = 0; + char* ipv4 = NULL; + char* ipv6 = NULL; + char* active = NULL; + char* preference = NULL; + const char* active_enb[MAX_ENB]; + char* enb_interface_name_for_S1U = NULL; + char* enb_ipv4_address_for_S1U = NULL; + libconfig_int enb_port_for_S1U = 0; + char* enb_interface_name_for_S1_MME = NULL; + char* enb_ipv4_address_for_S1_MME = NULL; + char *address = NULL; + char *cidr = NULL; + + + AssertFatal (lib_config_file_name_pP != NULL, + "Bad parameter lib_config_file_name_pP %s , must reference a valid eNB config file\n", + lib_config_file_name_pP); + + memset((char*)active_enb, 0 , MAX_ENB * sizeof(char*)); + + config_init(&cfg); + + /* Read the file. If there is an error, report it and exit. */ + if (! config_read_file(&cfg, lib_config_file_name_pP)) { + config_destroy(&cfg); + AssertFatal (0, "Failed to parse eNB configuration file %s!\n", lib_config_file_name_pP); + } + + // Get list of active eNBs, (only these will be configured) + setting = config_lookup(&cfg, ENB_CONFIG_STRING_ACTIVE_ENBS); + + if (setting != NULL) { + num_enbs = config_setting_length(setting); + + for (i = 0; i < num_enbs; i++) { + setting_enb = config_setting_get_elem(setting, i); + active_enb[i] = config_setting_get_string (setting_enb); + AssertFatal (active_enb[i] != NULL, + "Failed to parse config file %s, %uth attribute %s \n", + lib_config_file_name_pP, i, ENB_CONFIG_STRING_ACTIVE_ENBS); + active_enb[i] = strdup(active_enb[i]); + num_enb_properties += 1; + } + } + + /* Output a list of all eNBs. */ + setting = config_lookup(&cfg, ENB_CONFIG_STRING_ENB_LIST); + + if (setting != NULL) { + enb_properties_index = g_enb_properties.number; + parse_errors = 0; + num_enbs = config_setting_length(setting); + + for (i = 0; i < num_enbs; i++) { + setting_enb = config_setting_get_elem(setting, i); + + if (! config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_ENB_ID, &enb_id)) { + /* Calculate a default eNB ID */ +# if defined(ENABLE_USE_MME) + uint32_t hash; + + hash = et_s1ap_generate_eNB_id (); + enb_id = i + (hash & 0xFFFF8); +# else + enb_id = i; +# endif + } + + if ( !( config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_CELL_TYPE, &cell_type) + && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_ENB_NAME, &enb_name) + && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_TRACKING_AREA_CODE, &tac) + && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE, &mcc) + && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_NETWORK_CODE, &mnc) + + + ) + ) { + AssertError (0, parse_errors ++, + "Failed to parse eNB configuration file %s, %u th enb\n", + lib_config_file_name_pP, i); + continue; // FIXME this prevents segfaults below, not sure what happens after function exit + } + + // search if in active list + for (j=0; j < num_enb_properties; j++) { + if (strcmp(active_enb[j], enb_name) == 0) { + g_enb_properties.properties[enb_properties_index] = calloc(1, sizeof(Enb_properties_t)); + + g_enb_properties.properties[enb_properties_index]->eNB_id = enb_id; + + if (strcmp(cell_type, "CELL_MACRO_ENB") == 0) { + g_enb_properties.properties[enb_properties_index]->cell_type = CELL_MACRO_ENB; + } else if (strcmp(cell_type, "CELL_HOME_ENB") == 0) { + g_enb_properties.properties[enb_properties_index]->cell_type = CELL_HOME_ENB; + } else { + AssertError (0, parse_errors ++, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n", + lib_config_file_name_pP, i, cell_type); + } + + g_enb_properties.properties[enb_properties_index]->eNB_name = strdup(enb_name); + g_enb_properties.properties[enb_properties_index]->tac = (uint16_t)atoi(tac); + g_enb_properties.properties[enb_properties_index]->mcc = (uint16_t)atoi(mcc); + g_enb_properties.properties[enb_properties_index]->mnc = (uint16_t)atoi(mnc); + g_enb_properties.properties[enb_properties_index]->mnc_digit_length = strlen(mnc); + AssertFatal((g_enb_properties.properties[enb_properties_index]->mnc_digit_length == 2) || + (g_enb_properties.properties[enb_properties_index]->mnc_digit_length == 3), + "BAD MNC DIGIT LENGTH %d", + g_enb_properties.properties[i]->mnc_digit_length); + + + setting_mme_addresses = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_MME_IP_ADDRESS); + num_mme_address = config_setting_length(setting_mme_addresses); + g_enb_properties.properties[enb_properties_index]->nb_mme = 0; + + for (j = 0; j < num_mme_address; j++) { + setting_mme_address = config_setting_get_elem(setting_mme_addresses, j); + + if ( !( + config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IPV4_ADDRESS, (const char **)&ipv4) + && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IPV6_ADDRESS, (const char **)&ipv6) + && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE, (const char **)&active) + && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, (const char **)&preference) + ) + ) { + AssertError (0, parse_errors ++, + "Failed to parse eNB configuration file %s, %u th enb %u th mme address !\n", + lib_config_file_name_pP, i, j); + continue; // FIXME will prevent segfaults below, not sure what happens at function exit... + } + + g_enb_properties.properties[enb_properties_index]->nb_mme += 1; + + g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4_address = strdup(ipv4); + g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6_address = strdup(ipv6); + + if (strcmp(active, "yes") == 0) { + g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].active = 1; + } // else { (calloc) + + if (strcmp(preference, "ipv4") == 0) { + g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4 = 1; + } else if (strcmp(preference, "ipv6") == 0) { + g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1; + } else if (strcmp(preference, "no") == 0) { + g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4 = 1; + g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1; + } + } + + + // NETWORK_INTERFACES + subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG); + + if (subsetting != NULL) { + if ( ( + config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME, + (const char **)&enb_interface_name_for_S1_MME) + && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME, + (const char **)&enb_ipv4_address_for_S1_MME) + && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, + (const char **)&enb_interface_name_for_S1U) + && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, + (const char **)&enb_ipv4_address_for_S1U) + && config_setting_lookup_int(subsetting, ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, + &enb_port_for_S1U) + ) + ) { + g_enb_properties.properties[enb_properties_index]->enb_interface_name_for_S1U = strdup(enb_interface_name_for_S1U); + cidr = enb_ipv4_address_for_S1U; + address = strtok(cidr, "/"); + + if (address) { + IPV4_STR_ADDR_TO_INT_NWBO ( address, g_enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1U, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" ); + } + + g_enb_properties.properties[enb_properties_index]->enb_port_for_S1U = enb_port_for_S1U; + + g_enb_properties.properties[enb_properties_index]->enb_interface_name_for_S1_MME = strdup(enb_interface_name_for_S1_MME); + cidr = enb_ipv4_address_for_S1_MME; + address = strtok(cidr, "/"); + + if (address) { + IPV4_STR_ADDR_TO_INT_NWBO ( address, g_enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1_MME, "BAD IP ADDRESS FORMAT FOR eNB S1_MME !\n" ); + } + } + } // if (subsetting != NULL) { + enb_properties_index += 1; + } // if (strcmp(active_enb[j], enb_name) == 0) + } // for (j=0; j < num_enb_properties; j++) + } // for (i = 0; i < num_enbs; i++) + } // if (setting != NULL) { + + g_enb_properties.number += num_enb_properties; + + + AssertFatal (parse_errors == 0, + "Failed to parse eNB configuration file %s, found %d error%s !\n", + lib_config_file_name_pP, parse_errors, parse_errors > 1 ? "s" : ""); +} +/*------------------------------------------------------------------------------*/ +const Enb_properties_array_t *et_enb_config_get(void) +{ + return &g_enb_properties; +} /*------------------------------------------------------------------------------*/ uint32_t et_eNB_app_register(const Enb_properties_array_t *enb_properties) { uint32_t enb_id; uint32_t mme_id; MessageDef *msg_p; - uint32_t register_enb_pending = 0; char *str = NULL; struct in_addr addr; + g_scenario->register_enb_pending = 0; for (enb_id = 0; (enb_id < enb_properties->number) ; enb_id++) { { s1ap_register_enb_req_t *s1ap_register_eNB; @@ -318,7 +563,6 @@ uint32_t et_eNB_app_register(const Enb_properties_array_t *enb_properties) s1ap_register_eNB->mcc = enb_properties->properties[enb_id]->mcc; s1ap_register_eNB->mnc = enb_properties->properties[enb_id]->mnc; s1ap_register_eNB->mnc_digit_length = enb_properties->properties[enb_id]->mnc_digit_length; - s1ap_register_eNB->default_drx = enb_properties->properties[enb_id]->pcch_defaultPagingCycle[0]; s1ap_register_eNB->nb_mme = enb_properties->properties[enb_id]->nb_mme; AssertFatal (s1ap_register_eNB->nb_mme <= S1AP_MAX_NB_MME_IP_ADDRESS, "Too many MME for eNB %d (%d/%d)!", enb_id, s1ap_register_eNB->nb_mme, @@ -347,20 +591,16 @@ uint32_t et_eNB_app_register(const Enb_properties_array_t *enb_properties) itti_send_msg_to_task (TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p); - register_enb_pending++; + g_scenario->register_enb_pending++; } } - return register_enb_pending; + return g_scenario->register_enb_pending; } /*------------------------------------------------------------------------------*/ void *et_eNB_app_task(void *args_p) { - const Enb_properties_array_t *enb_properties_p = NULL; - uint32_t register_enb_pending; - uint32_t registered_enb; - long enb_register_retry_timer_id; - uint32_t enb_id; + et_scenario_t *scenario = (et_scenario_t*)args_p; MessageDef *msg_p = NULL; const char *msg_name = NULL; instance_t instance; @@ -369,14 +609,6 @@ void *et_eNB_app_task(void *args_p) itti_mark_task_ready (TASK_ENB_APP); - enb_properties_p = enb_config_get(); - - - /* Try to register each eNB */ - registered_enb = 0; - register_enb_pending = et_eNB_app_register (enb_properties_p); - - do { // Wait for a message itti_receive_msg (TASK_ENB_APP, &msg_p); @@ -389,40 +621,40 @@ void *et_eNB_app_task(void *args_p) itti_exit_task (); break; - - case S1AP_REGISTER_ENB_CNF: LOG_I(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, msg_name, S1AP_REGISTER_ENB_CNF(msg_p).nb_mme); - DevAssert(register_enb_pending > 0); - register_enb_pending--; + DevAssert(g_scenario->register_enb_pending > 0); + g_scenario->register_enb_pending--; /* Check if at least eNB is registered with one MME */ if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) { - registered_enb++; + g_scenario->registered_enb++; } /* Check if all register eNB requests have been processed */ - if (register_enb_pending == 0) { - if (registered_enb == enb_properties_p->number) { + if (scenario->register_enb_pending == 0) { + if (scenario->registered_enb == scenario->enb_properties->number) { /* If all eNB are registered, start scenario */ - + et_event_t event; + event.code = ET_EVENT_S1C_CONNECTED; + et_scenario_fsm_notify_event(event); } else { - uint32_t not_associated = enb_properties_p->number - registered_enb; + uint32_t not_associated = scenario->enb_properties->number - scenario->registered_enb; LOG_W(ENB_APP, " %d eNB %s not associated with a MME, retrying registration in %d seconds ...\n", not_associated, not_associated > 1 ? "are" : "is", ET_ENB_REGISTER_RETRY_DELAY); /* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */ if (timer_setup (ET_ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT, - NULL, &enb_register_retry_timer_id) < 0) { + NULL, &scenario->enb_register_retry_timer_id) < 0) { LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n"); sleep(ET_ENB_REGISTER_RETRY_DELAY); /* Restart the registration process */ - registered_enb = 0; - register_enb_pending = et_eNB_app_register (enb_properties_p); + scenario->registered_enb = 0; + scenario->register_enb_pending = et_eNB_app_register (scenario->enb_properties); } } } @@ -439,10 +671,10 @@ void *et_eNB_app_task(void *args_p) case TIMER_HAS_EXPIRED: LOG_I(ENB_APP, " Received %s: timer_id %d\n", msg_name, TIMER_HAS_EXPIRED(msg_p).timer_id); - if (TIMER_HAS_EXPIRED (msg_p).timer_id == enb_register_retry_timer_id) { + if (TIMER_HAS_EXPIRED (msg_p).timer_id == scenario->enb_register_retry_timer_id) { /* Restart the registration process */ - registered_enb = 0; - register_enb_pending = et_eNB_app_register (enb_properties_p); + scenario->registered_enb = 0; + scenario->register_enb_pending = et_eNB_app_register (scenario->enb_properties); } break; @@ -476,7 +708,7 @@ int et_play_scenario(et_scenario_t* const scenario) } // create ENB_APP ITTI task: not as same as eNB code - if (itti_create_task (TASK_ENB_APP, et_eNB_app_task, NULL) < 0) { + if (itti_create_task (TASK_ENB_APP, et_eNB_app_task, scenario) < 0) { LOG_E(ENB_APP, "Create task for ENB_APP failed\n"); return -1; } @@ -523,7 +755,6 @@ et_config_parse_opt_line ( { int option; int rv = 0; - const Enb_properties_array_t *enb_properties_p = NULL; enum long_option_e { LONG_OPTION_START = 0x100, /* Start after regular single char options */ @@ -606,7 +837,7 @@ et_config_parse_opt_line ( if (is_file_exists(*enb_config_file_name, "eNB config file") != GS_IS_FILE) { fprintf(stderr, "ERROR: original eNB config file name %s is not found in dir %s\n", *enb_config_file_name, *et_dir_name); } - enb_properties_p = enb_config_init(*enb_config_file_name); + et_enb_config_init(*enb_config_file_name); if (NULL == *scenario_file_name) { fprintf(stderr, "ERROR: please provide the scenario file name that should be in %s\n", *et_dir_name); diff --git a/openair3/TEST/EPC_TEST/play_scenario.h b/openair3/TEST/EPC_TEST/play_scenario.h index 725b5abc0e..3a52c6a0b8 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.h +++ b/openair3/TEST/EPC_TEST/play_scenario.h @@ -28,7 +28,7 @@ *******************************************************************************/ /* - et_scenario.h + play_scenario.h ------------------- AUTHOR : Lionel GAUTHIER COMPANY : EURECOM @@ -39,14 +39,121 @@ #define PLAY_SCENARIO_H_ # include # include +# include # include # include -#include "enb_config.h" +#include "S1AP-PDU.h" #include "s1ap_ies_defs.h" +#include "play_scenario_s1ap_eNB_defs.h" +#include "hashtable.h" -# define ET_ENB_REGISTER_RETRY_DELAY 3 +#define MAX_ENB 16 + +#define ENB_CONFIG_STRING_ACTIVE_ENBS "Active_eNBs" + +#define ENB_CONFIG_STRING_ENB_LIST "eNBs" +#define ENB_CONFIG_STRING_ENB_ID "eNB_ID" +#define ENB_CONFIG_STRING_CELL_TYPE "cell_type" +#define ENB_CONFIG_STRING_ENB_NAME "eNB_name" + +#define ENB_CONFIG_STRING_TRACKING_AREA_CODE "tracking_area_code" +#define ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE "mobile_country_code" +#define ENB_CONFIG_STRING_MOBILE_NETWORK_CODE "mobile_network_code" + + +#define ENB_CONFIG_STRING_MME_IP_ADDRESS "mme_ip_address" +#define ENB_CONFIG_STRING_MME_IPV4_ADDRESS "ipv4" +#define ENB_CONFIG_STRING_MME_IPV6_ADDRESS "ipv6" +#define ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE "active" +#define ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE "preference" + +#define ENB_CONFIG_STRING_SCTP_CONFIG "SCTP" +#define ENB_CONFIG_STRING_SCTP_INSTREAMS "SCTP_INSTREAMS" +#define ENB_CONFIG_STRING_SCTP_OUTSTREAMS "SCTP_OUTSTREAMS" + +#define ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG "NETWORK_INTERFACES" +#define ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME "ENB_INTERFACE_NAME_FOR_S1_MME" +#define ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME "ENB_IPV4_ADDRESS_FOR_S1_MME" +#define ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U "ENB_INTERFACE_NAME_FOR_S1U" +#define ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U "ENB_IPV4_ADDRESS_FOR_S1U" +#define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U" + + +typedef struct mme_ip_address_s { + unsigned ipv4:1; + unsigned ipv6:1; + unsigned active:1; + char *ipv4_address; + char *ipv6_address; +} mme_ip_address_t; + +#define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\ + struct in_addr inp;\ + if ( inet_aton(AdDr_StR, &inp ) < 0 ) {\ + AssertFatal (0, MeSsAgE);\ + } else {\ + NwBo = inp.s_addr;\ + }\ + } while (0); + + +typedef struct Enb_properties_s { + /* Unique eNB_id to identify the eNB within EPC. + * For macro eNB ids this field should be 20 bits long. + * For home eNB ids this field should be 28 bits long. + */ + uint32_t eNB_id; + + /* The type of the cell */ + enum cell_type_e cell_type; + + /* Optional name for the cell + * NOTE: the name can be NULL (i.e no name) and will be cropped to 150 + * characters. + */ + char *eNB_name; + + /* Tracking area code */ + uint16_t tac; + + /* Mobile Country Code + * Mobile Network Code + */ + uint16_t mcc; + uint16_t mnc; + uint8_t mnc_digit_length; + + + + /* Physical parameters */ + + int16_t Nid_cell[1+MAX_NUM_CCs];// for testing, change later + /* Nb of MME to connect to */ + uint8_t nb_mme; + /* List of MME to connect to */ + mme_ip_address_t mme_ip_address[S1AP_MAX_NB_MME_IP_ADDRESS]; + + int sctp_in_streams; + int sctp_out_streams; + + char *enb_interface_name_for_S1U; + in_addr_t enb_ipv4_address_for_S1U; + tcp_udp_port_t enb_port_for_S1U; + + char *enb_interface_name_for_S1_MME; + in_addr_t enb_ipv4_address_for_S1_MME; + +} Enb_properties_t; + +typedef struct Enb_properties_array_s { + int number; + Enb_properties_t *properties[MAX_ENB]; +} Enb_properties_array_t; + +# define ET_ENB_REGISTER_RETRY_DELAY 3 +# define ET_FSM_STATE_WAITING_RX_EVENT_DELAY_SEC 15 typedef enum { ET_PACKET_STATUS_START = 0, @@ -54,19 +161,17 @@ typedef enum { ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT, ET_PACKET_STATUS_SCHEDULED_FOR_SENDING, ET_PACKET_STATUS_SENT, - ET_PACKET_STATUS_SENT_WITH_ERRORS, ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING, ET_PACKET_STATUS_RECEIVED, - ET_PACKET_STATUS_RECEIVED_WITH_ERRORS, ET_PACKET_STATUS_END } et_packet_status_t; typedef enum { ET_FSM_STATE_START = 0, ET_FSM_STATE_NULL = ET_FSM_STATE_START, - ET_FSM_STATE_CONNECTING_SCTP, - ET_FSM_STATE_WAITING_TX_EVENT, - ET_FSM_STATE_WAITING_RX_EVENT, + ET_FSM_STATE_CONNECTING_S1C, + ET_FSM_STATE_WAITING_EVENT, + ET_FSM_STATE_RUNNING, ET_FSM_STATE_END } et_fsm_state_t; @@ -136,6 +241,7 @@ typedef struct sctp_datahdr_s { uint16_t stream; uint16_t ssn; uint32_t ppid; + uint32_t assoc_id; // filled when running scenario et_s1ap_t payload; } sctp_datahdr_t; @@ -182,11 +288,15 @@ typedef struct et_packet_s { struct timeval time_relative_to_last_received_packet; unsigned int original_frame_number; unsigned int packet_number; + instance_t enb_instance; et_ip_hdr_t ip_hdr; et_sctp_hdr_t sctp_hdr; struct et_packet_s *next; + //scenario running vars et_packet_status_t status; + long timer_id; // ITTI timer id for waiting rx packets + struct timeval timestamp_packet; // timestamp when rx or tx packet }et_packet_t; @@ -203,24 +313,37 @@ typedef struct sctp_epoll_s { } thread_desc_t; typedef struct et_scenario_s { - xmlChar *name; - et_packet_t *list_packet; - + xmlChar *name; + et_packet_t *list_packet; + //-------------------------- // playing scenario - et_packet_t *waited_packet; - et_packet_t *current_packet; + //-------------------------- + Enb_properties_array_t *enb_properties; + uint32_t register_enb_pending; + uint32_t registered_enb; + long enb_register_retry_timer_id; + + pthread_mutex_t fsm_lock; + et_fsm_state_t fsm_state; + + hash_table_t *hash_mme2association_id; + hash_table_t *hash_old_ue_mme_id2ue_mme_id; + struct timeval time_last_tx_packet; + struct timeval time_last_rx_packet; + et_packet_t *last_rx_packet; + et_packet_t *last_tx_packet; + et_packet_t *next_packet; } et_scenario_t; typedef enum { ET_EVENT_START = 0, ET_EVENT_INIT = ET_EVENT_START, + ET_EVENT_S1C_CONNECTED, ET_EVENT_RX_SCTP_EVENT, ET_EVENT_RX_S1AP, - ET_EVENT_RX_X2AP, ET_EVENT_RX_PACKET_TIME_OUT, - ET_EVENT_TX_PACKET, - ET_EVENT_STOP, + ET_EVENT_TX_TIMED_PACKET, ET_EVENT_END } et_event_code_t; @@ -241,7 +364,8 @@ typedef struct et_event_s { union { et_event_init_t init; et_event_s1ap_data_ind_t s1ap_data_ind; - et_event_s1ap_data_req_t s1ap_data_req; + et_packet_t *tx_timed_packet; + et_packet_t *rx_packet_time_out; } u; } et_event_t; @@ -266,16 +390,36 @@ int et_s1ap_decode_unsuccessful_outcome(s1ap_message *message, S1ap_Unsuccessful int et_s1ap_decode_pdu(S1AP_PDU_t * const pdu, s1ap_message * const message, const uint8_t * const buffer, const uint32_t length); void et_decode_s1ap(et_s1ap_t * const s1ap); //------------------------- -void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind); +int et_s1ap_eNB_compare_assoc_id( struct s1ap_eNB_mme_data_s *p1, struct s1ap_eNB_mme_data_s *p2); +uint16_t et_s1ap_eNB_fetch_add_global_cnx_id(void); +void et_s1ap_eNB_prepare_internal_data(void); +void et_s1ap_eNB_insert_new_instance(s1ap_eNB_instance_t *new_instance_p); +struct s1ap_eNB_mme_data_s *et_s1ap_eNB_get_MME(s1ap_eNB_instance_t *instance_p,int32_t assoc_id, uint16_t cnx_id); +s1ap_eNB_instance_t *et_s1ap_eNB_get_instance(instance_t instance); +void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,uint32_t buffer_length, uint16_t stream); +void et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const sctp_data_ind); +void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t * const sctp_data_ind); +void et_s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, + net_ip_address_t *mme_ip_address, + net_ip_address_t *local_ip_addr, + uint16_t in_streams, + uint16_t out_streams); +void et_s1ap_handle_s1_setup_message(s1ap_eNB_mme_data_t *mme_desc_p, int sctp_shutdown); +void et_s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB); +void et_s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp); void * et_s1ap_eNB_task(void *arg); +//------------------------- int et_generate_xml_scenario( const char const * xml_in_dir_name, const char const * xml_in_scenario_filename, const char const * enb_config_filename, char const * tsml_out_scenario_filename); //------------------------- -int et_scenario_fsm_notify_event_state_null(et_event_t event); -int et_scenario_fsm_notify_event(et_event_t event); +et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event); +et_fsm_state_t et_scenario_fsm_notify_event_state_waiting(et_event_t event); +et_fsm_state_t et_scenario_fsm_notify_event_state_connecting_s1c(et_event_t event); +et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event); +et_fsm_state_t et_scenario_fsm_notify_event(et_event_t event); //------------------------- void et_parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, et_s1ap_t * const s1ap); void et_parse_sctp_data_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_datahdr_t * const sctp_hdr); @@ -297,6 +441,8 @@ sctp_cid_t et_chunk_type_str2cid(const xmlChar * const chunk_type_str); const char * const et_chunk_type_cid2str(const sctp_cid_t chunk_type); et_packet_action_t et_action_str2et_action_t(const xmlChar * const action); void et_ip_str2et_ip(const xmlChar * const ip_str, et_ip_t * const ip); +void et_enb_config_init(const char const * lib_config_file_name_pP); +const Enb_properties_array_t *et_enb_config_get(void); uint32_t et_eNB_app_register(const Enb_properties_array_t *enb_properties); void *et_eNB_app_task(void *args_p); int et_play_scenario(et_scenario_t* const scenario); diff --git a/openair3/TEST/EPC_TEST/play_scenario_fsm.c b/openair3/TEST/EPC_TEST/play_scenario_fsm.c index 6c73793f4d..8e59a98258 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_fsm.c +++ b/openair3/TEST/EPC_TEST/play_scenario_fsm.c @@ -35,74 +35,322 @@ EMAIL : Lionel.Gauthier@eurecom.fr */ #include +#include #include "intertask_interface.h" #include "platform_types.h" #include "assertions.h" #include "play_scenario.h" +#include "s1ap_ies_defs.h" +#include "play_scenario_s1ap_eNB_defs.h" +#include "timer.h" - -et_scenario_t *g_scenario = NULL; -et_fsm_state_t g_fsm_state = ET_FSM_STATE_NULL; //------------------------------------------------------------------------------ -int et_scenario_fsm_notify_event_state_null(et_event_t event) +et_scenario_t *g_scenario = NULL; +//------------------------------------------------------------------------------ +int timeval_subtract (struct timeval * const result, struct timeval * const a, struct timeval * const b) +{ + struct timeval b2; + b2.tv_sec = b->tv_sec; + b2.tv_usec = b->tv_usec; + + /* Perform the carry for the later subtraction by updating y. */ + if (a->tv_usec < b2.tv_usec) { + int nsec = (b2.tv_usec - a->tv_usec) / 1000000 + 1; + b2.tv_usec -= 1000000 * nsec; + b2.tv_sec += nsec; + } + if (a->tv_usec - b2.tv_usec > 1000000) { + int nsec = (a->tv_usec - b2.tv_usec) / 1000000; + b2.tv_usec += 1000000 * nsec; + b2.tv_sec -= nsec; + } + + /* Compute the time remaining to wait. + tv_usec is certainly positive. */ + result->tv_sec = a->tv_sec - b2.tv_sec; + result->tv_usec = a->tv_usec - b2.tv_usec; + + /* Return 1 if result is negative. */ + return a->tv_sec < b2.tv_sec; +} + + +//------------------------------------------------------------------------------ +void et_scenario_wait_rx_packet(et_packet_t * const packet) +{ + if (timer_setup (ET_FSM_STATE_WAITING_RX_EVENT_DELAY_SEC, 0, TASK_S1AP, INSTANCE_DEFAULT, TIMER_ONE_SHOT, + NULL, &packet->timer_id) < 0) { + AssertFatal(0, " Can not start waiting RX event timer\n"); + } + g_scenario->fsm_state = ET_FSM_STATE_WAITING_EVENT; + packet->status = ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING; +} +//------------------------------------------------------------------------------ +void et_scenario_schedule_tx_packet(et_packet_t * const packet) +{ + s1ap_eNB_instance_t *s1ap_eNB_instance = NULL; + struct timeval now = { .tv_sec = 0, .tv_usec = 0 }; + struct timeval offset_last_tx_packet = { .tv_sec = 0, .tv_usec = 0 }; + struct timeval offset_last_rx_packet = { .tv_sec = 0, .tv_usec = 0 }; + struct timeval offset_tx_rx = { .tv_sec = 0, .tv_usec = 0 }; + struct timeval offset = { .tv_sec = 0, .tv_usec = 0 }; + int last_packet_was_tx = 0; + int we_are_too_early = 0; + + AssertFatal(NULL != packet, "packet argument is NULL"); + s1ap_eNB_instance = et_s1ap_eNB_get_instance(packet->enb_instance); + AssertFatal(NULL != s1ap_eNB_instance, "Cannot get s1ap_eNB_instance_t for eNB instance %d", packet->enb_instance); + + g_scenario->fsm_state = ET_FSM_STATE_WAITING_EVENT; + + switch (packet->sctp_hdr.chunk_type) { + case SCTP_CID_DATA: + // check if we can send it now + // TODO: BUG we have to discard in scenario all packets that cannot be processed (SACK, COOKIEs, etc) + AssertFatal(gettimeofday(&now, NULL) == 0, "gettimeofday failed"); + timeval_subtract(&offset_last_tx_packet,&now,&g_scenario->time_last_tx_packet); + timeval_subtract(&offset_last_rx_packet,&now,&g_scenario->time_last_rx_packet); + last_packet_was_tx = timeval_subtract(&offset_tx_rx,&offset_last_tx_packet,&offset_last_rx_packet); + if (last_packet_was_tx) { + we_are_too_early = timeval_subtract(&offset,&offset_last_tx_packet,&packet->time_relative_to_last_sent_packet); + } else { + we_are_too_early = timeval_subtract(&offset,&offset_last_rx_packet,&packet->time_relative_to_last_received_packet); + } + if (we_are_too_early > 0) { + // set timer + packet->status = ET_PACKET_STATUS_SCHEDULED_FOR_SENDING; + if (timer_setup (offset.tv_sec, offset.tv_usec, TASK_S1AP, INSTANCE_DEFAULT, TIMER_ONE_SHOT, + NULL, &packet->timer_id) < 0) { + AssertFatal(0, " Can not start TX event timer\n"); + } + // Done g_scenario->fsm_state = ET_FSM_STATE_WAITING_TX_EVENT; + } else { + // send immediately + et_s1ap_eNB_itti_send_sctp_data_req( + packet->enb_instance, + packet->sctp_hdr.u.data_hdr.assoc_id, + packet->sctp_hdr.u.data_hdr.payload.binary_stream, + packet->sctp_hdr.u.data_hdr.payload.binary_stream_allocated_size, + packet->sctp_hdr.u.data_hdr.stream); + packet->status = ET_PACKET_STATUS_SENT; + g_scenario->fsm_state = ET_FSM_STATE_RUNNING; + } + break; + case SCTP_CID_INIT: + case SCTP_CID_INIT_ACK: + AssertFatal(0, "Invalid case TX packet SCTP_CID_INIT or SCTP_CID_INIT_ACK"); + break; + default: + AssertFatal(0, "Invalid case TX packet SCTP_CID %d", packet->sctp_hdr.chunk_type); + } +} +//------------------------------------------------------------------------------ +et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event) { - et_packet_t *packet = NULL; - const Enb_properties_array_t *enb_properties_p = NULL; - uint32_t register_enb_pending; switch (event.code){ - case ET_EVENT_INIT: - AssertFatal(NULL == g_scenario, "Current scenario not ended"); - g_scenario = event.u.init.scenario; - packet = g_scenario->list_packet; - while (NULL != packet) { - switch (packet->sctp_hdr.chunk_type) { + case ET_EVENT_RX_PACKET_TIME_OUT: + AssertFatal(0, "Event ET_EVENT_RX_PACKET_TIME_OUT not handled in FSM state ET_FSM_STATE_RUNNING"); + break; + case ET_EVENT_TX_TIMED_PACKET: + AssertFatal(0, "Event ET_EVENT_TX_TIMED_PACKET not handled in FSM state ET_FSM_STATE_RUNNING"); + break; + case ET_EVENT_RX_S1AP: + AssertFatal(0, "TODO"); + break; + default: + AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_RUNNING", event.code); + } + pthread_mutex_unlock(&g_scenario->fsm_lock); + return 0; +} +//------------------------------------------------------------------------------ +et_fsm_state_t et_scenario_fsm_notify_event_state_waiting(et_event_t event) +{ + + switch (event.code){ + case ET_EVENT_RX_PACKET_TIME_OUT: + fprintf(stderr, "Error The following packet is not received:\n"); + et_display_packet(event.u.rx_packet_time_out); + AssertFatal(0, "Waited packet not received"); + break; + case ET_EVENT_RX_S1AP: + et_s1ap_process_rx_packet(&event.u.s1ap_data_ind); + break; + case ET_EVENT_TX_TIMED_PACKET: + // send immediately + et_s1ap_eNB_itti_send_sctp_data_req( + event.u.tx_timed_packet->enb_instance, + event.u.tx_timed_packet->sctp_hdr.u.data_hdr.assoc_id, + event.u.tx_timed_packet->sctp_hdr.u.data_hdr.payload.binary_stream, + event.u.tx_timed_packet->sctp_hdr.u.data_hdr.payload.binary_stream_allocated_size, + event.u.tx_timed_packet->sctp_hdr.u.data_hdr.stream); + event.u.tx_timed_packet->status = ET_PACKET_STATUS_SENT; + g_scenario->fsm_state = ET_FSM_STATE_RUNNING; + break; + + + default: + AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_WAITING", event.code); + } + pthread_mutex_unlock(&g_scenario->fsm_lock); + return 0; +} + +//------------------------------------------------------------------------------ +et_fsm_state_t et_scenario_fsm_notify_event_state_connecting_s1c(et_event_t event) +{ + + switch (event.code){ + case ET_EVENT_S1C_CONNECTED: + // hack simulate we have been able to get the right timing values + AssertFatal(gettimeofday(&g_scenario->time_last_tx_packet, NULL) == 0, "gettimeofday failed"); + AssertFatal(gettimeofday(&g_scenario->time_last_rx_packet, NULL) == 0, "gettimeofday failed"); + + while (NULL != g_scenario->next_packet) { + switch (g_scenario->next_packet->sctp_hdr.chunk_type) { case SCTP_CID_DATA : // no init in this scenario, may be sub-scenario - if (packet->action == ET_PACKET_ACTION_S1C_SEND) { - } else if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { - g_scenario->waited_packet = packet; + if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) { + et_scenario_schedule_tx_packet(g_scenario->next_packet); + pthread_mutex_unlock(&g_scenario->fsm_lock); + return g_scenario->fsm_state; + } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { + if (g_scenario->next_packet->status == ET_PACKET_STATUS_RECEIVED) { + g_scenario->last_rx_packet = g_scenario->next_packet; + g_scenario->next_packet = g_scenario->next_packet->next; + g_scenario->time_last_rx_packet = g_scenario->last_rx_packet->timestamp_packet; + g_scenario->next_packet = g_scenario->next_packet->next; + + } else if (g_scenario->next_packet->status == ET_PACKET_STATUS_NONE) { + et_scenario_wait_rx_packet(g_scenario->next_packet); + pthread_mutex_unlock(&g_scenario->fsm_lock); + return g_scenario->fsm_state; + } else { + AssertFatal(0, "Invalid packet status %d", g_scenario->next_packet->status); + } } else { - packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT; - packet = packet->next; + AssertFatal(0, "Invalid packet action %d", g_scenario->next_packet->action); } - break; + break; + case SCTP_CID_INIT: case SCTP_CID_INIT_ACK: - enb_properties_p = enb_config_get(); - /* Try to register each eNB */ - g_fsm_state = ET_FSM_STATE_CONNECTING_SCTP; - register_enb_pending = et_eNB_app_register (enb_properties_p); - break; case SCTP_CID_HEARTBEAT: case SCTP_CID_HEARTBEAT_ACK: case SCTP_CID_COOKIE_ECHO: case SCTP_CID_COOKIE_ACK: case SCTP_CID_ECN_ECNE: case SCTP_CID_ECN_CWR: - packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT; - packet = packet->next; + g_scenario->next_packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT; + g_scenario->next_packet = g_scenario->next_packet->next; break; + case SCTP_CID_ABORT: case SCTP_CID_SHUTDOWN: case SCTP_CID_SHUTDOWN_ACK: case SCTP_CID_ERROR: case SCTP_CID_SHUTDOWN_COMPLETE: - AssertFatal(0, "The scenario should be cleaned (packet %s cannot be processed at this time)", et_chunk_type_cid2str(packet->sctp_hdr.chunk_type)); + AssertFatal(0, "The scenario should be cleaned (packet %s cannot be processed at this time)", + et_chunk_type_cid2str(g_scenario->next_packet->sctp_hdr.chunk_type)); break; default: - packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT; - packet = packet->next; + g_scenario->next_packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT; + g_scenario->next_packet = g_scenario->next_packet->next; } } fprintf(stderr, "No Packet found in this scenario: %s\n", g_scenario->name); - return -1; + g_scenario->fsm_state = ET_FSM_STATE_NULL; + pthread_mutex_unlock(&g_scenario->fsm_lock); + return g_scenario->fsm_state; break; - case ET_EVENT_STOP: + default: + AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_CONNECTING_S1C", event.code); + } + pthread_mutex_unlock(&g_scenario->fsm_lock); + return 0; +} +//------------------------------------------------------------------------------ +et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event) +{ + switch (event.code){ + case ET_EVENT_INIT: + AssertFatal(NULL == g_scenario, "Current scenario not ended"); + g_scenario = event.u.init.scenario; + g_scenario->next_packet = g_scenario->list_packet; + while (NULL != g_scenario->next_packet) { + switch (g_scenario->next_packet->sctp_hdr.chunk_type) { + + case SCTP_CID_DATA : + // no init in this scenario, may be sub-scenario + if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) { + et_scenario_schedule_tx_packet(g_scenario->next_packet); + pthread_mutex_unlock(&g_scenario->fsm_lock); + return g_scenario->fsm_state; + } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { + if (g_scenario->next_packet->status == ET_PACKET_STATUS_RECEIVED) { + g_scenario->last_rx_packet = g_scenario->next_packet; + g_scenario->next_packet = g_scenario->next_packet->next; + g_scenario->time_last_rx_packet = g_scenario->last_rx_packet->timestamp_packet; + g_scenario->next_packet = g_scenario->next_packet->next; + + } else if (g_scenario->next_packet->status == ET_PACKET_STATUS_NONE) { + et_scenario_wait_rx_packet(g_scenario->next_packet); + pthread_mutex_unlock(&g_scenario->fsm_lock); + return g_scenario->fsm_state; + } else { + AssertFatal(0, "Invalid packet status %d", g_scenario->next_packet->status); + } + } else { + AssertFatal(0, "Invalid packet action %d", g_scenario->next_packet->action); + } + break; + + case SCTP_CID_INIT: + case SCTP_CID_INIT_ACK: + g_scenario->enb_properties = (Enb_properties_array_t *)et_enb_config_get(); + g_scenario->hash_old_ue_mme_id2ue_mme_id = hashtable_create (256,NULL,NULL); + g_scenario->hash_mme2association_id = hashtable_create (256,NULL,NULL); + // Try to register each eNB + g_scenario->registered_enb = 0; + g_scenario->fsm_state = ET_FSM_STATE_CONNECTING_S1C; + g_scenario->register_enb_pending = et_eNB_app_register (g_scenario->enb_properties); + pthread_mutex_unlock(&g_scenario->fsm_lock); + return g_scenario->fsm_state; + break; + + case SCTP_CID_HEARTBEAT: + case SCTP_CID_HEARTBEAT_ACK: + case SCTP_CID_COOKIE_ECHO: + case SCTP_CID_COOKIE_ACK: + case SCTP_CID_ECN_ECNE: + case SCTP_CID_ECN_CWR: + g_scenario->next_packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT; + g_scenario->next_packet = g_scenario->next_packet->next; + break; + + case SCTP_CID_ABORT: + case SCTP_CID_SHUTDOWN: + case SCTP_CID_SHUTDOWN_ACK: + case SCTP_CID_ERROR: + case SCTP_CID_SHUTDOWN_COMPLETE: + AssertFatal(0, "The scenario should be cleaned (packet %s cannot be processed at this time)", + et_chunk_type_cid2str(g_scenario->next_packet->sctp_hdr.chunk_type)); + break; + + default: + g_scenario->next_packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT; + g_scenario->next_packet = g_scenario->next_packet->next; + } + } + fprintf(stderr, "No Useful packet found in this scenario: %s\n", g_scenario->name); + g_scenario->fsm_state = ET_FSM_STATE_NULL; + pthread_mutex_unlock(&g_scenario->fsm_lock); + return g_scenario->fsm_state; break; default: @@ -112,16 +360,19 @@ int et_scenario_fsm_notify_event_state_null(et_event_t event) } //------------------------------------------------------------------------------ -int et_scenario_fsm_notify_event(et_event_t event) +et_fsm_state_t et_scenario_fsm_notify_event(et_event_t event) { AssertFatal((event.code >= ET_EVENT_START) && (event.code < ET_EVENT_END), "Unknown et_event_t.code %d", event.code); - switch (g_fsm_state){ + pthread_mutex_lock(&g_scenario->fsm_lock); + switch (g_scenario->fsm_state){ case ET_FSM_STATE_NULL: return et_scenario_fsm_notify_event_state_null(event); break; - case ET_FSM_STATE_CONNECTING_SCTP: return et_scenario_fsm_notify_event_state_null(event); break; - case ET_FSM_STATE_WAITING_TX_EVENT: return et_scenario_fsm_notify_event_state_null(event); break; - case ET_FSM_STATE_WAITING_RX_EVENT: return et_scenario_fsm_notify_event_state_null(event); break; + case ET_FSM_STATE_CONNECTING_S1C: return et_scenario_fsm_notify_event_state_connecting_s1c(event); break; + case ET_FSM_STATE_WAITING_EVENT: return et_scenario_fsm_notify_event_state_waiting(event); break; + case ET_FSM_STATE_RUNNING: return et_scenario_fsm_notify_event_state_running(event); break; default: - return -1; + AssertFatal(0, "Case fsm_state %d not handled", g_scenario->fsm_state); } + pthread_mutex_unlock(&g_scenario->fsm_lock); + return g_scenario->fsm_state; } diff --git a/openair3/TEST/EPC_TEST/play_scenario_parse.c b/openair3/TEST/EPC_TEST/play_scenario_parse.c index 236c17963a..f6d8aa73ac 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_parse.c +++ b/openair3/TEST/EPC_TEST/play_scenario_parse.c @@ -47,17 +47,19 @@ #include #include #include +#include +#include +#include #include "intertask_interface.h" #include "platform_types.h" -#include "enb_config.h" #include "assertions.h" #include "play_scenario.h" //------------------------------------------------------------------------------ #define ENB_CONFIG_MAX_XSLT_PARAMS 32 //------------------------------------------------------------------------------ extern char *g_openair_dir; -extern Enb_properties_array_t enb_properties; +extern Enb_properties_array_t g_enb_properties; //------------------------------------------------------------------------------ void et_parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, et_s1ap_t * const s1ap) { @@ -407,6 +409,10 @@ et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node) { } xmlFree(xml_char); } + } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"eNB.instance"))) { + xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); + packet->enb_instance = strtoul((const char *)xml_char, NULL, 0); + xmlFree(xml_char); } //} } @@ -439,8 +445,11 @@ et_scenario_t* et_generate_scenario( if ((!xmlStrcmp(root->name, (const xmlChar *)"scenario"))) { xml_char = xmlGetProp(root, (const xmlChar *)"name"); printf("scenario name: %s\n", xml_char); - scenario = calloc(1, sizeof(*scenario)); - scenario->name = xml_char; // nodup nofree + scenario = calloc(1, sizeof(*scenario)); + scenario->name = xml_char; // nodup nofree + scenario->fsm_state = ET_FSM_STATE_NULL; + pthread_mutex_init(&scenario->fsm_lock, NULL); + next_packet = &scenario->list_packet; for (node = root->children; node != NULL; node = node->next) { if ((!xmlStrcmp(node->name, (const xmlChar *)"packet"))) { @@ -509,21 +518,21 @@ int et_generate_xml_scenario( fprintf(stdout, "Test scenario file: %s\n", xml_in_scenario_filename); } - for (i = 0; i < enb_properties.number; i++) { + for (i = 0; i < g_enb_properties.number; i++) { // eNB S1-C IPv4 address sprintf(astring, "enb_s1c%d", i); params[nb_params++] = strdup(astring); - addr.s_addr = enb_properties.properties[i]->enb_ipv4_address_for_S1_MME; + addr.s_addr = g_enb_properties.properties[i]->enb_ipv4_address_for_S1_MME; sprintf(astring, "\"%s\"", inet_ntoa(addr)); params[nb_params++] = strdup(astring); // MME S1-C IPv4 address - for (j = 0; j < enb_properties.properties[i]->nb_mme; j++) { + for (j = 0; j < g_enb_properties.properties[i]->nb_mme; j++) { sprintf(astring, "mme_s1c%d_%d", i, j); params[nb_params++] = strdup(astring); - AssertFatal (enb_properties.properties[i]->mme_ip_address[j].ipv4_address, + AssertFatal (g_enb_properties.properties[i]->mme_ip_address[j].ipv4_address, "Only support MME IPv4 address\n"); - sprintf(astring, "\"%s\"", enb_properties.properties[i]->mme_ip_address[j].ipv4_address); + sprintf(astring, "\"%s\"", g_enb_properties.properties[i]->mme_ip_address[j].ipv4_address); params[nb_params++] = strdup(astring); } } diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c index cb5571c28b..7dd80904ae 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c @@ -38,29 +38,173 @@ #include #include #include +#include +#include #include "tree.h" #include "queue.h" #include "intertask_interface.h" -#include "messages_types.h" +#include "timer.h" #include "platform_types.h" -#include "s1ap_common.h" -#include "s1ap_eNB_defs.h" -#include "s1ap_eNB_default_values.h" -#include "s1ap_eNB_management_procedures.h" -#include "s1ap_eNB.h" -#include "play_scenario.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" +#include "s1ap_common.h" +#include "play_scenario_s1ap_eNB_defs.h" +#include "play_scenario.h" +#include "msc.h" +//------------------------------------------------------------------------------ +s1ap_eNB_internal_data_t s1ap_eNB_internal_data; +RB_GENERATE(s1ap_mme_map, s1ap_eNB_mme_data_s, entry, et_s1ap_eNB_compare_assoc_id); +//------------------------------------------------------------------------------ +extern et_scenario_t *g_scenario; +//------------------------------------------------------------------------------ +int et_s1ap_eNB_compare_assoc_id( + struct s1ap_eNB_mme_data_s *p1, struct s1ap_eNB_mme_data_s *p2) +{ + if (p1->assoc_id == -1) { + if (p1->cnx_id < p2->cnx_id) { + return -1; + } + if (p1->cnx_id > p2->cnx_id) { + return 1; + } + } else { + if (p1->assoc_id < p2->assoc_id) { + return -1; + } + + if (p1->assoc_id > p2->assoc_id) { + return 1; + } + } + + /* Matching reference */ + return 0; +} +//------------------------------------------------------------------------------ +uint32_t et_s1ap_generate_eNB_id(void) +{ + char *out; + char hostname[50]; + int ret; + uint32_t eNB_id; + + /* Retrieve the host name */ + ret = gethostname(hostname, sizeof(hostname)); + DevAssert(ret == 0); + + out = crypt(hostname, "eurecom"); + DevAssert(out != NULL); + + eNB_id = ((out[0] << 24) | (out[1] << 16) | (out[2] << 8) | out[3]); + + return eNB_id; +} +//------------------------------------------------------------------------------ +uint16_t et_s1ap_eNB_fetch_add_global_cnx_id(void) +{ + return ++s1ap_eNB_internal_data.global_cnx_id; +} //------------------------------------------------------------------------------ -extern void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp); -extern void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB); +void et_s1ap_eNB_prepare_internal_data(void) +{ + memset(&s1ap_eNB_internal_data, 0, sizeof(s1ap_eNB_internal_data)); + STAILQ_INIT(&s1ap_eNB_internal_data.s1ap_eNB_instances_head); +} + //------------------------------------------------------------------------------ -void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind) +void et_s1ap_eNB_insert_new_instance(s1ap_eNB_instance_t *new_instance_p) +{ + DevAssert(new_instance_p != NULL); + + STAILQ_INSERT_TAIL(&s1ap_eNB_internal_data.s1ap_eNB_instances_head, + new_instance_p, s1ap_eNB_entries); +} + +//------------------------------------------------------------------------------ +struct s1ap_eNB_mme_data_s *et_s1ap_eNB_get_MME( + s1ap_eNB_instance_t *instance_p, + int32_t assoc_id, uint16_t cnx_id) +{ + struct s1ap_eNB_mme_data_s temp; + struct s1ap_eNB_mme_data_s *found; + + memset(&temp, 0, sizeof(struct s1ap_eNB_mme_data_s)); + + temp.assoc_id = assoc_id; + temp.cnx_id = cnx_id; + + if (instance_p == NULL) { + STAILQ_FOREACH(instance_p, &s1ap_eNB_internal_data.s1ap_eNB_instances_head, + s1ap_eNB_entries) { + found = RB_FIND(s1ap_mme_map, &instance_p->s1ap_mme_head, &temp); + + if (found != NULL) { + return found; + } + } + } else { + return RB_FIND(s1ap_mme_map, &instance_p->s1ap_mme_head, &temp); + } + + return NULL; +} + +//------------------------------------------------------------------------------ +s1ap_eNB_instance_t *et_s1ap_eNB_get_instance(instance_t instance) +{ + s1ap_eNB_instance_t *temp = NULL; + + STAILQ_FOREACH(temp, &s1ap_eNB_internal_data.s1ap_eNB_instances_head, + s1ap_eNB_entries) { + if (temp->instance == instance) { + /* Matching occurence */ + return temp; + } + } + + return NULL; +} +//------------------------------------------------------------------------------ +void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer, + uint32_t buffer_length, uint16_t stream) +{ + MessageDef *message_p; + sctp_data_req_t *sctp_data_req; + + message_p = itti_alloc_new_message(TASK_S1AP, SCTP_DATA_REQ); + + sctp_data_req = &message_p->ittiMsg.sctp_data_req; + + sctp_data_req->assoc_id = assoc_id; + sctp_data_req->buffer = buffer; + sctp_data_req->buffer_length = buffer_length; + sctp_data_req->stream = stream; + + itti_send_msg_to_task(TASK_SCTP, instance, message_p); +} +//------------------------------------------------------------------------------ +void et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const sctp_data_ind) +{ + et_packet_t * packet = NULL; + unsigned long int not_found = 1; + + packet = g_scenario->next_packet; + // not_found threshold may sure depend on number of mme, may be not sure on number of UE + while ((NULL != packet) && (not_found < 5)) { + if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { + //TODO + } + not_found += 1; + packet = packet->next; + } +} + +//------------------------------------------------------------------------------ +void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t * const sctp_data_ind) { int result = 0; et_event_t event; @@ -73,7 +217,8 @@ void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind) event.u.s1ap_data_ind.sctp_datahdr.tsn = 0; event.u.s1ap_data_ind.sctp_datahdr.stream = sctp_data_ind->stream; event.u.s1ap_data_ind.sctp_datahdr.ssn = 0; - event.u.s1ap_data_ind.sctp_datahdr.ppid = 18; // find constant + event.u.s1ap_data_ind.sctp_datahdr.ppid = S1AP_SCTP_PPID; + event.u.s1ap_data_ind.sctp_datahdr.assoc_id = sctp_data_ind->assoc_id; event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream_pos = 0; event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream_allocated_size = sctp_data_ind->buffer_length; @@ -100,6 +245,253 @@ void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind) et_scenario_fsm_notify_event(event); } +//------------------------------------------------------------------------------ +void et_s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, + net_ip_address_t *mme_ip_address, + net_ip_address_t *local_ip_addr, + uint16_t in_streams, + uint16_t out_streams) +{ + MessageDef *message_p = NULL; + sctp_new_association_req_t *sctp_new_association_req_p = NULL; + s1ap_eNB_mme_data_t *s1ap_mme_data_p = NULL; + + DevAssert(instance_p != NULL); + DevAssert(mme_ip_address != NULL); + + message_p = itti_alloc_new_message(TASK_S1AP, SCTP_NEW_ASSOCIATION_REQ); + + sctp_new_association_req_p = &message_p->ittiMsg.sctp_new_association_req; + + sctp_new_association_req_p->port = S1AP_PORT_NUMBER; + sctp_new_association_req_p->ppid = S1AP_SCTP_PPID; + + sctp_new_association_req_p->in_streams = in_streams; + sctp_new_association_req_p->out_streams = out_streams; + + memcpy(&sctp_new_association_req_p->remote_address, + mme_ip_address, + sizeof(*mme_ip_address)); + + memcpy(&sctp_new_association_req_p->local_address, + local_ip_addr, + sizeof(*local_ip_addr)); + + /* Create new MME descriptor */ + s1ap_mme_data_p = calloc(1, sizeof(*s1ap_mme_data_p)); + DevAssert(s1ap_mme_data_p != NULL); + + s1ap_mme_data_p->cnx_id = et_s1ap_eNB_fetch_add_global_cnx_id(); + sctp_new_association_req_p->ulp_cnx_id = s1ap_mme_data_p->cnx_id; + + s1ap_mme_data_p->assoc_id = -1; + s1ap_mme_data_p->s1ap_eNB_instance = instance_p; + + memcpy((void*)&s1ap_mme_data_p->mme_net_ip_address, mme_ip_address, sizeof(*mme_ip_address)); + + + STAILQ_INIT(&s1ap_mme_data_p->served_gummei); + + /* Insert the new descriptor in list of known MME + * but not yet associated. + */ + RB_INSERT(s1ap_mme_map, &instance_p->s1ap_mme_head, s1ap_mme_data_p); + s1ap_mme_data_p->state = S1AP_ENB_STATE_WAITING; + instance_p->s1ap_mme_nb ++; + instance_p->s1ap_mme_pending_nb ++; + + itti_send_msg_to_task(TASK_SCTP, instance_p->instance, message_p); +} +//------------------------------------------------------------------------------ +void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id, + struct s1ap_eNB_instance_s * const s1ap_eNB_instance, + s1ap_eNB_mme_data_t * const mme_desc_p) +{ + et_packet_t *packet = NULL; + struct in6_addr s1c_mme_ipv6 = IN6ADDR_ANY_INIT; + in_addr_t s1c_mme_ipv4 = INADDR_ANY; + struct in6_addr s1c_enb_ipv6 = IN6ADDR_ANY_INIT; + in_addr_t s1c_enb_ipv4 = INADDR_ANY; + + packet = g_scenario->next_packet; + while (NULL != packet) { + switch (packet->sctp_hdr.chunk_type) { + + case SCTP_CID_DATA : + if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) { + // TODO compare addresses and ports + if (packet->ip_hdr.dst) + packet->sctp_hdr.dst_port == 0; + packet->sctp_hdr.src_port == 0; + + } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { + } + break; + + case SCTP_CID_INIT: + case SCTP_CID_INIT_ACK: + case SCTP_CID_HEARTBEAT: + case SCTP_CID_HEARTBEAT_ACK: + case SCTP_CID_COOKIE_ECHO: + case SCTP_CID_COOKIE_ACK: + case SCTP_CID_ECN_ECNE: + case SCTP_CID_ECN_CWR: + break; + + case SCTP_CID_ABORT: + case SCTP_CID_SHUTDOWN: + case SCTP_CID_SHUTDOWN_ACK: + case SCTP_CID_ERROR: + case SCTP_CID_SHUTDOWN_COMPLETE: + //TODO + break; + + default: + ; + } + packet = packet->next; + } +} +//------------------------------------------------------------------------------ +void et_s1ap_handle_s1_setup_message(s1ap_eNB_mme_data_t *mme_desc_p, int sctp_shutdown) +{ + if (sctp_shutdown) { + /* A previously connected MME has been shutdown */ + + /* TODO check if it was used by some eNB and send a message to inform these eNB if there is no more associated MME */ + if (mme_desc_p->state == S1AP_ENB_STATE_CONNECTED) { + mme_desc_p->state = S1AP_ENB_STATE_DISCONNECTED; + + if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb > 0) { + /* Decrease associated MME number */ + mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb --; + } + + /* If there are no more associated MME, inform eNB app */ + if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb == 0) { + MessageDef *message_p; + + message_p = itti_alloc_new_message(TASK_S1AP, S1AP_DEREGISTERED_ENB_IND); + S1AP_DEREGISTERED_ENB_IND(message_p).nb_mme = 0; + itti_send_msg_to_task(TASK_ENB_APP, mme_desc_p->s1ap_eNB_instance->instance, message_p); + } + } + } else { + /* Check that at least one setup message is pending */ + DevCheck(mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb > 0, mme_desc_p->s1ap_eNB_instance->instance, + mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb, 0); + + if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb > 0) { + /* Decrease pending messages number */ + mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb --; + } + + et_s1ap_update_assoc_id_of_packets(mme_desc_p->assoc_id, + mme_desc_p->s1ap_eNB_instance, + mme_desc_p); + + /* If there are no more pending messages, inform eNB app */ + if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb == 0) { + MessageDef *message_p; + + message_p = itti_alloc_new_message(TASK_S1AP, S1AP_REGISTER_ENB_CNF); + S1AP_REGISTER_ENB_CNF(message_p).nb_mme = mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb; + itti_send_msg_to_task(TASK_ENB_APP, mme_desc_p->s1ap_eNB_instance->instance, message_p); + } + } +} +//------------------------------------------------------------------------------ +void et_s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB) +{ + s1ap_eNB_instance_t *new_instance; + uint8_t index; + + DevAssert(s1ap_register_eNB != NULL); + + /* Look if the provided instance already exists */ + new_instance = et_s1ap_eNB_get_instance(instance); + + if (new_instance != NULL) { + /* Checks if it is a retry on the same eNB */ + DevCheck(new_instance->eNB_id == s1ap_register_eNB->eNB_id, new_instance->eNB_id, s1ap_register_eNB->eNB_id, 0); + DevCheck(new_instance->cell_type == s1ap_register_eNB->cell_type, new_instance->cell_type, s1ap_register_eNB->cell_type, 0); + DevCheck(new_instance->tac == s1ap_register_eNB->tac, new_instance->tac, s1ap_register_eNB->tac, 0); + DevCheck(new_instance->mcc == s1ap_register_eNB->mcc, new_instance->mcc, s1ap_register_eNB->mcc, 0); + DevCheck(new_instance->mnc == s1ap_register_eNB->mnc, new_instance->mnc, s1ap_register_eNB->mnc, 0); + DevCheck(new_instance->mnc_digit_length == s1ap_register_eNB->mnc_digit_length, new_instance->mnc_digit_length, s1ap_register_eNB->mnc_digit_length, 0); + } else { + new_instance = calloc(1, sizeof(s1ap_eNB_instance_t)); + DevAssert(new_instance != NULL); + + RB_INIT(&new_instance->s1ap_ue_head); + RB_INIT(&new_instance->s1ap_mme_head); + + /* Copy usefull parameters */ + new_instance->instance = instance; + new_instance->eNB_name = s1ap_register_eNB->eNB_name; + new_instance->eNB_id = s1ap_register_eNB->eNB_id; + new_instance->cell_type = s1ap_register_eNB->cell_type; + new_instance->tac = s1ap_register_eNB->tac; + new_instance->mcc = s1ap_register_eNB->mcc; + new_instance->mnc = s1ap_register_eNB->mnc; + new_instance->mnc_digit_length = s1ap_register_eNB->mnc_digit_length; + + /* Add the new instance to the list of eNB (meaningfull in virtual mode) */ + et_s1ap_eNB_insert_new_instance(new_instance); + + S1AP_DEBUG("Registered new eNB[%d] and %s eNB id %u\n", + instance, + s1ap_register_eNB->cell_type == CELL_MACRO_ENB ? "macro" : "home", + s1ap_register_eNB->eNB_id); + } + + DevCheck(s1ap_register_eNB->nb_mme <= S1AP_MAX_NB_MME_IP_ADDRESS, + S1AP_MAX_NB_MME_IP_ADDRESS, s1ap_register_eNB->nb_mme, 0); + + /* Trying to connect to provided list of MME ip address */ + for (index = 0; index < s1ap_register_eNB->nb_mme; index++) { + et_s1ap_eNB_register_mme(new_instance, + &s1ap_register_eNB->mme_ip_address[index], + &s1ap_register_eNB->enb_ip_address, + s1ap_register_eNB->sctp_in_streams, + s1ap_register_eNB->sctp_out_streams); + } +} + +//------------------------------------------------------------------------------ +void et_s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) +{ + s1ap_eNB_instance_t *instance_p = NULL; + s1ap_eNB_mme_data_t *s1ap_mme_data_p = NULL; + + DevAssert(sctp_new_association_resp != NULL); + + instance_p = et_s1ap_eNB_get_instance(instance); + DevAssert(instance_p != NULL); + + s1ap_mme_data_p = et_s1ap_eNB_get_MME(instance_p, -1, + sctp_new_association_resp->ulp_cnx_id); + DevAssert(s1ap_mme_data_p != NULL); + + if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) { + S1AP_WARN("Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n", + sctp_new_association_resp->sctp_state, + instance, + sctp_new_association_resp->ulp_cnx_id); + + et_s1ap_handle_s1_setup_message(s1ap_mme_data_p, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN); + + return; + } + + /* Update parameters */ + s1ap_mme_data_p->assoc_id = sctp_new_association_resp->assoc_id; + s1ap_mme_data_p->in_streams = sctp_new_association_resp->in_streams; + s1ap_mme_data_p->out_streams = sctp_new_association_resp->out_streams; + + et_s1ap_handle_s1_setup_message(s1ap_mme_data_p, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN); +} + //------------------------------------------------------------------------------ void *et_s1ap_eNB_task(void *arg) { @@ -108,7 +500,7 @@ void *et_s1ap_eNB_task(void *arg) S1AP_DEBUG("Starting S1AP layer\n"); - s1ap_eNB_prepare_internal_data(); + et_s1ap_eNB_prepare_internal_data(); itti_mark_task_ready(TASK_S1AP); MSC_START_USE(); @@ -127,13 +519,13 @@ void *et_s1ap_eNB_task(void *arg) * Each eNB has to send an S1AP_REGISTER_ENB message with its * own parameters. */ - s1ap_eNB_handle_register_eNB(ITTI_MESSAGE_GET_INSTANCE(received_msg), + et_s1ap_eNB_handle_register_eNB(ITTI_MESSAGE_GET_INSTANCE(received_msg), &S1AP_REGISTER_ENB_REQ(received_msg)); } break; case SCTP_NEW_ASSOCIATION_RESP: { - s1ap_eNB_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg), + et_s1ap_eNB_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg), &received_msg->ittiMsg.sctp_new_association_resp); } break; @@ -143,6 +535,31 @@ void *et_s1ap_eNB_task(void *arg) } break; + case TIMER_HAS_EXPIRED: + LOG_I(S1AP, " Received TIMER_HAS_EXPIRED: timer_id %d\n", TIMER_HAS_EXPIRED(received_msg).timer_id); + { + et_packet_t * packet = (et_packet_t*)TIMER_HAS_EXPIRED (received_msg).arg; + et_event_t event; + if (packet->status == ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING) { + memset((void*)&event, 0, sizeof(event)); + event.code = ET_EVENT_RX_PACKET_TIME_OUT; + event.u.rx_packet_time_out = packet; + et_scenario_fsm_notify_event(event); + } else if (packet->status == ET_PACKET_STATUS_SCHEDULED_FOR_SENDING) { + memset((void*)&event, 0, sizeof(event)); + event.code = ET_EVENT_TX_TIMED_PACKET; + event.u.tx_timed_packet = packet; + et_scenario_fsm_notify_event(event); + } else if ((packet->status != ET_PACKET_STATUS_SENT) && ((packet->status != ET_PACKET_STATUS_RECEIVED))) { + AssertFatal (0, "Bad status %d of packet timed out!\n", packet->status); + } + } + if (TIMER_HAS_EXPIRED (received_msg).timer_id == g_scenario->enb_register_retry_timer_id) { + /* Restart the registration process */ + g_scenario->registered_enb = 0; + g_scenario->register_enb_pending = et_eNB_app_register (g_scenario->enb_properties); + } + break; default: S1AP_ERROR("Received unhandled message: %d:%s\n", diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h b/openair3/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h new file mode 100644 index 0000000000..ac77b88b24 --- /dev/null +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h @@ -0,0 +1,250 @@ +/******************************************************************************* + OpenAirInterface + Copyright(c) 1999 - 2014 Eurecom + + OpenAirInterface is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + + OpenAirInterface is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenAirInterface.The full GNU General Public License is + included in this distribution in the file called "COPYING". If not, + see . + + Contact Information + OpenAirInterface Admin: openair_admin@eurecom.fr + OpenAirInterface Tech : openair_tech@eurecom.fr + OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + + Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France. + + *******************************************************************************/ + +#include + +#include "queue.h" +#include "tree.h" + +#include "sctp_eNB_defs.h" + +#ifndef PLAY_SCENARIO_S1AP_ENB_DEFS_H_ +#define PLAY_SCENARIO_S1AP_ENB_DEFS_H_ + +#define ENB_TAC (1) +#define ENB_MCC (208) +#define ENB_MNC (92) + +#define ENB_NAME "Eurecom ENB" +#define ENB_NAME_FORMAT (ENB_NAME" %u") + +#define S1AP_PORT_NUMBER (36412) +#define S1AP_SCTP_PPID (18) + +#define X2AP_PORT_NUMBER (36422) +#define X2AP_SCTP_PPID (27) + +#define S1AP_ENB_NAME_LENGTH_MAX (150) + +typedef enum { + /* Disconnected state: initial state for any association. */ + S1AP_ENB_STATE_DISCONNECTED = 0x0, + /* State waiting for S1 Setup response message if eNB is MME accepted or + * S1 Setup failure if MME rejects the eNB. + */ + S1AP_ENB_STATE_WAITING = 0x1, + /* The eNB is successfully connected to MME, UE contexts can be created. */ + S1AP_ENB_STATE_CONNECTED = 0x2, + /* The MME has sent an overload start message. Once the MME disables the + * OVERLOAD marker, the state of the association will be + * S1AP_ENB_STATE_CONNECTED. + */ + S1AP_ENB_OVERLOAD = 0x3, + /* Max number of states available */ + S1AP_ENB_STATE_MAX, +} s1ap_eNB_state_t; + + +/* If the Overload Action IE in the OVERLOAD START message is set to + * - “reject all RRC connection establishments for non-emergency mobile + * originated data transfer “ (i.e. reject traffic corresponding to RRC cause + * “mo-data “ (TS 36.331 [16])), or + * - “reject all RRC connection establishments for signalling “ (i.e. reject + * traffic corresponding to RRC cause “modata” and “mo-signalling” + * (TS 36.331 [16])),or + * - “only permit RRC connection establishments for emergency sessions and + * mobile terminated services” (i.e. only permit traffic corresponding to RRC + * cause “emergency” and “mt-Access” (TS 36.331 [16])). + * + * NOTE: When the Overload Action IE is set to “only permit RRC connection + * establishments for emergency sessions and mobile terminated services”, + * emergency calls with RRC cause “highPriorityAcess” from high priority users + * are rejected (TS 24.301 [24]). + */ +typedef enum { + S1AP_OVERLOAD_REJECT_MO_DATA = 0x0, + S1AP_OVERLOAD_REJECT_ALL_SIGNALLING = 0x1, + S1AP_OVERLOAD_ONLY_EMERGENCY_AND_MT = 0x2, + S1AP_NO_OVERLOAD = 0x3, + S1AP_OVERLOAD_MAX, +} s1ap_overload_state_t; + +/* Served PLMN identity element */ +struct plmn_identity_s { + uint16_t mcc; + uint16_t mnc; + uint8_t mnc_digit_length; + STAILQ_ENTRY(plmn_identity_s) next; +}; + +/* Served group id element */ +struct served_group_id_s { + uint16_t mme_group_id; + STAILQ_ENTRY(served_group_id_s) next; +}; + +/* Served mme code for a particular MME */ +struct mme_code_s { + uint8_t mme_code; + STAILQ_ENTRY(mme_code_s) next; +}; + +/* Served gummei element */ +struct served_gummei_s { + /* Number of MME served PLMNs */ + uint8_t nb_served_plmns; + /* List of served PLMNs by MME */ + STAILQ_HEAD(served_plmns_s, plmn_identity_s) served_plmns; + + /* Number of group id in list */ + uint8_t nb_group_id; + /* Served group id list */ + STAILQ_HEAD(served_group_ids_s, served_group_id_s) served_group_ids; + + /* Number of MME code */ + uint8_t nb_mme_code; + /* MME Code to uniquely identify an MME within an MME pool area */ + STAILQ_HEAD(mme_codes_s, mme_code_s) mme_codes; + + /* Next GUMMEI element */ + STAILQ_ENTRY(served_gummei_s) next; +}; + +struct s1ap_eNB_instance_s; + +/* This structure describes association of a eNB to a MME */ +typedef struct s1ap_eNB_mme_data_s { + /* MME descriptors tree, ordered by sctp assoc id */ + RB_ENTRY(s1ap_eNB_mme_data_s) entry; + + /* This is the optional name provided by the MME */ + char *mme_name; + net_ip_address_t mme_net_ip_address; // useful for joining assoc_id and ip address of packets + + /* List of served GUMMEI per MME. There is one GUMMEI per RAT with a max + * number of 8 RATs but in our case only one is used. The LTE related pool + * configuration is included on the first place in the list. + */ + STAILQ_HEAD(served_gummeis_s, served_gummei_s) served_gummei; + + /* Relative processing capacity of an MME with respect to the other MMEs + * in the pool in order to load-balance MMEs within a pool as defined + * in TS 23.401. + */ + uint8_t relative_mme_capacity; + + /* Current MME overload information (if any). */ + s1ap_overload_state_t overload_state; + /* Current eNB->MME S1AP association state */ + s1ap_eNB_state_t state; + + /* Next usable stream for UE signalling */ + int32_t nextstream; + + /* Number of input/ouput streams */ + uint16_t in_streams; + uint16_t out_streams; + + /* Connexion id used between SCTP/S1AP */ + uint16_t cnx_id; + + /* SCTP association id */ + int32_t assoc_id; + + /* Only meaningfull in virtual mode */ + struct s1ap_eNB_instance_s *s1ap_eNB_instance; +} s1ap_eNB_mme_data_t; + +typedef struct s1ap_eNB_instance_s { + /* Next s1ap eNB association. + * Only used for virtual mode. + */ + STAILQ_ENTRY(s1ap_eNB_instance_s) s1ap_eNB_entries; + + /* Number of MME requested by eNB (tree size) */ + uint32_t s1ap_mme_nb; + /* Number of MME for which association is pending */ + uint32_t s1ap_mme_pending_nb; + /* Number of MME successfully associated to eNB */ + uint32_t s1ap_mme_associated_nb; + /* Tree of S1AP MME associations ordered by association ID */ + RB_HEAD(s1ap_mme_map, s1ap_eNB_mme_data_s) s1ap_mme_head; + + /* TODO: add a map ordered by relative MME capacity */ + + /* Tree of UE ordered by eNB_ue_s1ap_id's */ + RB_HEAD(s1ap_ue_map, s1ap_eNB_ue_context_s) s1ap_ue_head; + + /* For virtual mode, mod_id as defined in the rest of the L1/L2 stack */ + instance_t instance; + + /* Displayable name of eNB */ + char *eNB_name; + net_ip_address_t s1c_net_ip_address; + + /* Unique eNB_id to identify the eNB within EPC. + * In our case the eNB is a macro eNB so the id will be 20 bits long. + * For Home eNB id, this field should be 28 bits long. + */ + uint32_t eNB_id; + /* The type of the cell */ + enum cell_type_e cell_type; + + /* Tracking area code */ + uint16_t tac; + + /* Mobile Country Code + * Mobile Network Code + */ + uint16_t mcc; + uint16_t mnc; + uint8_t mnc_digit_length; + +} s1ap_eNB_instance_t; + +typedef struct { + /* List of served eNBs + * Only used for virtual mode + */ + STAILQ_HEAD(s1ap_eNB_instances_head_s, s1ap_eNB_instance_s) s1ap_eNB_instances_head; + /* Nb of registered eNBs */ + uint8_t nb_registered_eNBs; + + /* Generate a unique connexion id used between S1AP and SCTP */ + uint16_t global_cnx_id; +} s1ap_eNB_internal_data_t; + +int s1ap_eNB_compare_assoc_id( + struct s1ap_eNB_mme_data_s *p1, struct s1ap_eNB_mme_data_s *p2); + +/* Generate the tree management functions */ +RB_PROTOTYPE(s1ap_mme_map, s1ap_eNB_mme_data_s, entry, + s1ap_eNB_compare_assoc_id); + +#endif /* PLAY_SCENARIO_S1AP_ENB_DEFS_H_ */ From 717cd8a102d002fba32f57ba04c7421347e06c36 Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 24 Nov 2015 16:51:15 +0100 Subject: [PATCH 014/214] Starting debug, remainig TODO report new mme_ue_id --- openair2/COMMON/s1ap_messages_types.h | 2 +- openair3/SCTP/sctp_eNB_task.c | 9 ++ openair3/TEST/EPC_TEST/play_scenario.c | 97 +++++++++---- openair3/TEST/EPC_TEST/play_scenario.h | 8 +- openair3/TEST/EPC_TEST/play_scenario.xsl | 144 +++++++++---------- openair3/TEST/EPC_TEST/play_scenario_fsm.c | 68 ++++----- openair3/TEST/EPC_TEST/play_scenario_parse.c | 2 - openair3/TEST/EPC_TEST/play_scenario_s1ap.c | 86 +++++++++-- 8 files changed, 266 insertions(+), 150 deletions(-) diff --git a/openair2/COMMON/s1ap_messages_types.h b/openair2/COMMON/s1ap_messages_types.h index c39725b737..f2c6a2a3a2 100644 --- a/openair2/COMMON/s1ap_messages_types.h +++ b/openair2/COMMON/s1ap_messages_types.h @@ -112,7 +112,7 @@ typedef struct net_ip_address_s { unsigned ipv4:1; unsigned ipv6:1; char ipv4_address[16]; - char ipv6_address[40]; + char ipv6_address[46]; } net_ip_address_t; typedef uint64_t bitrate_t; diff --git a/openair3/SCTP/sctp_eNB_task.c b/openair3/SCTP/sctp_eNB_task.c index c1e7d989e9..357803ac4f 100644 --- a/openair3/SCTP/sctp_eNB_task.c +++ b/openair3/SCTP/sctp_eNB_task.c @@ -100,6 +100,7 @@ static STAILQ_HEAD(sctp_cnx_list_head, sctp_cnx_list_elm_s) sctp_cnx_list; static uint16_t sctp_nb_cnx = 0; +//------------------------------------------------------------------------------ struct sctp_cnx_list_elm_s *sctp_get_cnx(int32_t assoc_id, int sd) { struct sctp_cnx_list_elm_s *elm; @@ -119,6 +120,7 @@ struct sctp_cnx_list_elm_s *sctp_get_cnx(int32_t assoc_id, int sd) return NULL; } +//------------------------------------------------------------------------------ void sctp_handle_new_association_req( const instance_t instance, @@ -388,6 +390,7 @@ sctp_handle_new_association_req( sd, sctp_nb_cnx, assoc_id); } + //------------------------------------------------------------------------------ void sctp_send_data( instance_t instance, task_id_t task_id, @@ -430,6 +433,7 @@ void sctp_send_data( sctp_cnx->assoc_id); } +//------------------------------------------------------------------------------ static int sctp_close_association( const instance_t instance, const task_id_t requestor, @@ -456,6 +460,7 @@ static int sctp_close_association( return 0; } +//------------------------------------------------------------------------------ static int sctp_create_new_listener( const instance_t instance, const task_id_t requestor, @@ -580,6 +585,7 @@ err: return -1; } +//------------------------------------------------------------------------------ static inline void sctp_eNB_accept_associations( @@ -646,6 +652,7 @@ sctp_eNB_accept_associations( } } +//------------------------------------------------------------------------------ static inline void sctp_eNB_read_from_socket( @@ -770,6 +777,7 @@ sctp_eNB_read_from_socket( } } +//------------------------------------------------------------------------------ void sctp_eNB_flush_sockets( struct epoll_event *events, int nb_events) @@ -799,6 +807,7 @@ sctp_eNB_flush_sockets( } +//------------------------------------------------------------------------------ void *sctp_eNB_task(void *arg) { int nb_events; diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index f29393f0e7..f8f334dd9c 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -51,6 +51,7 @@ #include #include #include +#include #include "intertask_interface_init.h" @@ -60,6 +61,7 @@ #include "intertask_interface.h" #include "play_scenario.h" #include "sctp_eNB_task.h" +#include "sctp_default_values.h" #include "log.h" //------------------------------------------------------------------------------ #define PLAY_SCENARIO 1 @@ -73,6 +75,7 @@ extern et_scenario_t *g_scenario; extern int xmlLoadExtDtdDefaultValue; extern int asn_debug; extern int asn1_xer_print; +extern pthread_mutex_t g_fsm_lock; //------------------------------------------------------------------------------ // MEMO: @@ -170,7 +173,7 @@ void et_free_scenario(et_scenario_t* scenario) packet = next_packet->next; } et_free_pointer(scenario); - pthread_mutex_destroy(&scenario->fsm_lock); + pthread_mutex_destroy(&g_fsm_lock); } } @@ -276,7 +279,7 @@ const char * const et_chunk_type_cid2str(const sctp_cid_t chunk_type) case SCTP_CID_ASCONF: return "ASCONF"; break; case SCTP_CID_ASCONF_ACK: return "ASCONF_ACK"; break; default: - AssertFatal (0, "ERROR %s(): Unknown chunk_type %d!\n", __FUNCTION__, chunk_type); + AssertFatal (0, "ERROR: Unknown chunk_type %d!\n", chunk_type); } } //------------------------------------------------------------------------------ @@ -284,24 +287,50 @@ et_packet_action_t et_action_str2et_action_t(const xmlChar * const action) { if ((!xmlStrcmp(action, (const xmlChar *)"SEND"))) { return ET_PACKET_ACTION_S1C_SEND;} if ((!xmlStrcmp(action, (const xmlChar *)"RECEIVE"))) { return ET_PACKET_ACTION_S1C_RECEIVE;} - AssertFatal (0, "ERROR: %s cannot convert: %s\n", __FUNCTION__, action); + AssertFatal (0, "ERROR: cannot convert: %s\n", action); //if (NULL == action) {return ACTION_S1C_NULL;} } //------------------------------------------------------------------------------ void et_ip_str2et_ip(const xmlChar * const ip_str, et_ip_t * const ip) { - AssertFatal (NULL != ip_str, "ERROR %s() Cannot convert null string to ip address!\n", __FUNCTION__); - AssertFatal (NULL != ip, "ERROR %s() out parameter pointer is NULL!\n", __FUNCTION__); + AssertFatal (NULL != ip_str, "ERROR Cannot convert null string to ip address!\n"); + AssertFatal (NULL != ip, "ERROR out parameter pointer is NULL!\n"); // store this IP address in sa: if (inet_pton(AF_INET, (const char*)ip_str, (void*)&(ip->address.ipv4)) > 0) { ip->address_family = AF_INET; + strncpy((char *)ip->str, (const char *)ip_str, INET_ADDRSTRLEN+1); } else if (inet_pton(AF_INET6, (const char*)ip_str, (void*)&(ip->address.ipv6)) > 0) { ip->address_family = AF_INET6; + strncpy((char *)ip->str, (const char *)ip_str, INET6_ADDRSTRLEN+1); } else { ip->address_family = AF_UNSPEC; AssertFatal (0, "ERROR %s() Could not parse ip address %s!\n", __FUNCTION__, ip_str); } } +//------------------------------------------------------------------------------ +int et_compare_et_ip_to_net_ip_address(const et_ip_t * const ip, const net_ip_address_t * const net_ip) +{ + AssertFatal (NULL != ip, "ERROR ip parameter\n"); + AssertFatal (NULL != net_ip, "ERROR net_ip parameter\n"); + switch (ip->address_family) { + case AF_INET: + if (net_ip->ipv4) { + S1AP_DEBUG("%s(%s,%s)=%d\n",__FUNCTION__,ip->str, net_ip->ipv4_address, strcmp(ip->str, net_ip->ipv4_address)); + return strcmp(ip->str, net_ip->ipv4_address); + } + return -1; + break; + case AF_INET6: + if (net_ip->ipv6) { + return strcmp(ip->str, net_ip->ipv6_address); + } + return -1; + break; + default: + return -1; + } +} + #ifdef LIBCONFIG_LONG #define libconfig_int long #else @@ -317,6 +346,7 @@ void et_enb_config_init(const char const * lib_config_file_name_pP) config_setting_t *setting_mme_addresses = NULL; config_setting_t *setting_mme_address = NULL; config_setting_t *setting_enb = NULL; + libconfig_int my_int; int num_enb_properties = 0; int enb_properties_index = 0; int num_enbs = 0; @@ -479,6 +509,20 @@ void et_enb_config_init(const char const * lib_config_file_name_pP) g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1; } } + // SCTP SETTING + g_enb_properties.properties[enb_properties_index]->sctp_out_streams = SCTP_OUT_STREAMS; + g_enb_properties.properties[enb_properties_index]->sctp_in_streams = SCTP_IN_STREAMS; + subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_SCTP_CONFIG); + + if (subsetting != NULL) { + if ( (config_setting_lookup_int( subsetting, ENB_CONFIG_STRING_SCTP_INSTREAMS, &my_int) )) { + g_enb_properties.properties[enb_properties_index]->sctp_in_streams = (uint16_t)my_int; + } + + if ( (config_setting_lookup_int( subsetting, ENB_CONFIG_STRING_SCTP_OUTSTREAMS, &my_int) )) { + g_enb_properties.properties[enb_properties_index]->sctp_out_streams = (uint16_t)my_int; + } + } // NETWORK_INTERFACES @@ -536,19 +580,19 @@ const Enb_properties_array_t *et_enb_config_get(void) return &g_enb_properties; } /*------------------------------------------------------------------------------*/ -uint32_t et_eNB_app_register(const Enb_properties_array_t *enb_properties) +void et_eNB_app_register(const Enb_properties_array_t *enb_properties) { - uint32_t enb_id; - uint32_t mme_id; - MessageDef *msg_p; - char *str = NULL; - struct in_addr addr; + uint32_t enb_id = 0; + uint32_t mme_id = 0; + MessageDef *msg_p = NULL; + char *str = NULL; + struct in_addr addr = {.s_addr = 0}; g_scenario->register_enb_pending = 0; for (enb_id = 0; (enb_id < enb_properties->number) ; enb_id++) { { - s1ap_register_enb_req_t *s1ap_register_eNB; + s1ap_register_enb_req_t *s1ap_register_eNB = NULL; /* note: there is an implicit relationship between the data structure and the message name */ msg_p = itti_alloc_new_message (TASK_ENB_APP, S1AP_REGISTER_ENB_REQ); @@ -589,13 +633,10 @@ uint32_t et_eNB_app_register(const Enb_properties_array_t *enb_properties) str = inet_ntoa(addr); strcpy(s1ap_register_eNB->enb_ip_address.ipv4_address, str); - itti_send_msg_to_task (TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p); - g_scenario->register_enb_pending++; + itti_send_msg_to_task (TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p); } } - - return g_scenario->register_enb_pending; } /*------------------------------------------------------------------------------*/ void *et_eNB_app_task(void *args_p) @@ -603,12 +644,11 @@ void *et_eNB_app_task(void *args_p) et_scenario_t *scenario = (et_scenario_t*)args_p; MessageDef *msg_p = NULL; const char *msg_name = NULL; - instance_t instance; - int result; + instance_t instance = 0; + int result = 0; itti_mark_task_ready (TASK_ENB_APP); - do { // Wait for a message itti_receive_msg (TASK_ENB_APP, &msg_p); @@ -625,18 +665,20 @@ void *et_eNB_app_task(void *args_p) LOG_I(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, msg_name, S1AP_REGISTER_ENB_CNF(msg_p).nb_mme); - DevAssert(g_scenario->register_enb_pending > 0); - g_scenario->register_enb_pending--; + DevAssert(scenario->register_enb_pending > 0); + scenario->register_enb_pending--; /* Check if at least eNB is registered with one MME */ if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) { - g_scenario->registered_enb++; + scenario->registered_enb++; } /* Check if all register eNB requests have been processed */ if (scenario->register_enb_pending == 0) { + timer_remove(scenario->enb_register_retry_timer_id); if (scenario->registered_enb == scenario->enb_properties->number) { /* If all eNB are registered, start scenario */ + LOG_D(ENB_APP, " All eNB are now associated with a MME\n"); et_event_t event; event.code = ET_EVENT_S1C_CONNECTED; et_scenario_fsm_notify_event(event); @@ -654,7 +696,7 @@ void *et_eNB_app_task(void *args_p) sleep(ET_ENB_REGISTER_RETRY_DELAY); /* Restart the registration process */ scenario->registered_enb = 0; - scenario->register_enb_pending = et_eNB_app_register (scenario->enb_properties); + et_eNB_app_register (scenario->enb_properties); } } } @@ -674,7 +716,7 @@ void *et_eNB_app_task(void *args_p) if (TIMER_HAS_EXPIRED (msg_p).timer_id == scenario->enb_register_retry_timer_id) { /* Restart the registration process */ scenario->registered_enb = 0; - scenario->register_enb_pending = et_eNB_app_register (scenario->enb_properties); + et_eNB_app_register (scenario->enb_properties); } break; @@ -870,10 +912,13 @@ int main( int argc, char **argv ) // logging logInit(); + set_glog(LOG_TRACE, LOG_MED); + itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL); + set_comp_log(ENB_APP, LOG_TRACE, LOG_MED, 1); set_comp_log(S1AP, LOG_TRACE, LOG_MED, 1); - set_comp_log(SCTP, LOG_TRACE, LOG_MED, 1); + set_comp_log(SCTP, LOG_TRACE, LOG_FULL, 1); asn_debug = 0; asn1_xer_print = 1; @@ -895,6 +940,6 @@ int main( int argc, char **argv ) et_free_pointer(scenario_file_name); et_free_pointer(enb_config_file_name); } - + itti_wait_tasks_end(); return ret; } diff --git a/openair3/TEST/EPC_TEST/play_scenario.h b/openair3/TEST/EPC_TEST/play_scenario.h index 3a52c6a0b8..060c77b8ee 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.h +++ b/openair3/TEST/EPC_TEST/play_scenario.h @@ -39,7 +39,6 @@ #define PLAY_SCENARIO_H_ # include # include -# include # include # include @@ -274,6 +273,7 @@ typedef struct et_ip_s { struct in6_addr ipv6; in_addr_t ipv4; }address; + char str[INET6_ADDRSTRLEN+1]; }et_ip_t; typedef struct et_ip_hdr_s { @@ -323,8 +323,6 @@ typedef struct et_scenario_s { uint32_t registered_enb; long enb_register_retry_timer_id; - pthread_mutex_t fsm_lock; - et_fsm_state_t fsm_state; hash_table_t *hash_mme2association_id; hash_table_t *hash_old_ue_mme_id2ue_mme_id; @@ -391,6 +389,7 @@ int et_s1ap_decode_pdu(S1AP_PDU_t * const pdu, s1ap_message * const message, con void et_decode_s1ap(et_s1ap_t * const s1ap); //------------------------- int et_s1ap_eNB_compare_assoc_id( struct s1ap_eNB_mme_data_s *p1, struct s1ap_eNB_mme_data_s *p2); +uint32_t et_s1ap_generate_eNB_id(void); uint16_t et_s1ap_eNB_fetch_add_global_cnx_id(void); void et_s1ap_eNB_prepare_internal_data(void); void et_s1ap_eNB_insert_new_instance(s1ap_eNB_instance_t *new_instance_p); @@ -436,6 +435,7 @@ int et_split_path ( char * pathP, char *** resP); void et_display_node ( xmlNodePtr node, unsigned int indent); void et_display_tree ( xmlNodePtr node, unsigned int indent); char * et_ip2ip_str(const et_ip_t * const ip); +int et_compare_et_ip_to_net_ip_address(const et_ip_t * const ip, const net_ip_address_t * const net_ip); int et_hex2data(unsigned char * const data, const unsigned char * const hexstring, const unsigned int len); sctp_cid_t et_chunk_type_str2cid(const xmlChar * const chunk_type_str); const char * const et_chunk_type_cid2str(const sctp_cid_t chunk_type); @@ -443,7 +443,7 @@ et_packet_action_t et_action_str2et_action_t(const xmlChar * const action); void et_ip_str2et_ip(const xmlChar * const ip_str, et_ip_t * const ip); void et_enb_config_init(const char const * lib_config_file_name_pP); const Enb_properties_array_t *et_enb_config_get(void); -uint32_t et_eNB_app_register(const Enb_properties_array_t *enb_properties); +void et_eNB_app_register(const Enb_properties_array_t *enb_properties); void *et_eNB_app_task(void *args_p); int et_play_scenario(et_scenario_t* const scenario); diff --git a/openair3/TEST/EPC_TEST/play_scenario.xsl b/openair3/TEST/EPC_TEST/play_scenario.xsl index 6b1c36cc3d..0ce22c08df 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.xsl +++ b/openair3/TEST/EPC_TEST/play_scenario.xsl @@ -9,57 +9,57 @@ /> - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + ERROR: Cannot resolv IP ! @@ -69,30 +69,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + ERROR: Cannot resolv IP ! diff --git a/openair3/TEST/EPC_TEST/play_scenario_fsm.c b/openair3/TEST/EPC_TEST/play_scenario_fsm.c index 8e59a98258..18dba384b0 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_fsm.c +++ b/openair3/TEST/EPC_TEST/play_scenario_fsm.c @@ -36,6 +36,7 @@ */ #include #include +#include #include "intertask_interface.h" #include "platform_types.h" @@ -46,7 +47,9 @@ #include "timer.h" //------------------------------------------------------------------------------ -et_scenario_t *g_scenario = NULL; +et_scenario_t *g_scenario = NULL; +pthread_mutex_t g_fsm_lock = PTHREAD_MUTEX_INITIALIZER; +et_fsm_state_t g_fsm_state = ET_FSM_STATE_NULL; //------------------------------------------------------------------------------ int timeval_subtract (struct timeval * const result, struct timeval * const a, struct timeval * const b) { @@ -83,7 +86,7 @@ void et_scenario_wait_rx_packet(et_packet_t * const packet) NULL, &packet->timer_id) < 0) { AssertFatal(0, " Can not start waiting RX event timer\n"); } - g_scenario->fsm_state = ET_FSM_STATE_WAITING_EVENT; + g_fsm_state = ET_FSM_STATE_WAITING_EVENT; packet->status = ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING; } //------------------------------------------------------------------------------ @@ -102,7 +105,8 @@ void et_scenario_schedule_tx_packet(et_packet_t * const packet) s1ap_eNB_instance = et_s1ap_eNB_get_instance(packet->enb_instance); AssertFatal(NULL != s1ap_eNB_instance, "Cannot get s1ap_eNB_instance_t for eNB instance %d", packet->enb_instance); - g_scenario->fsm_state = ET_FSM_STATE_WAITING_EVENT; + LOG_D(ENB_APP, "%s\n", __FUNCTION__); + g_fsm_state = ET_FSM_STATE_WAITING_EVENT; switch (packet->sctp_hdr.chunk_type) { case SCTP_CID_DATA: @@ -124,7 +128,7 @@ void et_scenario_schedule_tx_packet(et_packet_t * const packet) NULL, &packet->timer_id) < 0) { AssertFatal(0, " Can not start TX event timer\n"); } - // Done g_scenario->fsm_state = ET_FSM_STATE_WAITING_TX_EVENT; + // Done g_fsm_state = ET_FSM_STATE_WAITING_TX_EVENT; } else { // send immediately et_s1ap_eNB_itti_send_sctp_data_req( @@ -134,7 +138,7 @@ void et_scenario_schedule_tx_packet(et_packet_t * const packet) packet->sctp_hdr.u.data_hdr.payload.binary_stream_allocated_size, packet->sctp_hdr.u.data_hdr.stream); packet->status = ET_PACKET_STATUS_SENT; - g_scenario->fsm_state = ET_FSM_STATE_RUNNING; + g_fsm_state = ET_FSM_STATE_RUNNING; } break; case SCTP_CID_INIT: @@ -162,7 +166,7 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event) default: AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_RUNNING", event.code); } - pthread_mutex_unlock(&g_scenario->fsm_lock); + pthread_mutex_unlock(&g_fsm_lock); return 0; } @@ -188,14 +192,14 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_waiting(et_event_t event) event.u.tx_timed_packet->sctp_hdr.u.data_hdr.payload.binary_stream_allocated_size, event.u.tx_timed_packet->sctp_hdr.u.data_hdr.stream); event.u.tx_timed_packet->status = ET_PACKET_STATUS_SENT; - g_scenario->fsm_state = ET_FSM_STATE_RUNNING; + g_fsm_state = ET_FSM_STATE_RUNNING; break; default: AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_WAITING", event.code); } - pthread_mutex_unlock(&g_scenario->fsm_lock); + pthread_mutex_unlock(&g_fsm_lock); return 0; } @@ -215,8 +219,8 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_connecting_s1c(et_event_t even // no init in this scenario, may be sub-scenario if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) { et_scenario_schedule_tx_packet(g_scenario->next_packet); - pthread_mutex_unlock(&g_scenario->fsm_lock); - return g_scenario->fsm_state; + pthread_mutex_unlock(&g_fsm_lock); + return g_fsm_state; } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { if (g_scenario->next_packet->status == ET_PACKET_STATUS_RECEIVED) { g_scenario->last_rx_packet = g_scenario->next_packet; @@ -226,8 +230,8 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_connecting_s1c(et_event_t even } else if (g_scenario->next_packet->status == ET_PACKET_STATUS_NONE) { et_scenario_wait_rx_packet(g_scenario->next_packet); - pthread_mutex_unlock(&g_scenario->fsm_lock); - return g_scenario->fsm_state; + pthread_mutex_unlock(&g_fsm_lock); + return g_fsm_state; } else { AssertFatal(0, "Invalid packet status %d", g_scenario->next_packet->status); } @@ -263,15 +267,15 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_connecting_s1c(et_event_t even } } fprintf(stderr, "No Packet found in this scenario: %s\n", g_scenario->name); - g_scenario->fsm_state = ET_FSM_STATE_NULL; - pthread_mutex_unlock(&g_scenario->fsm_lock); - return g_scenario->fsm_state; + g_fsm_state = ET_FSM_STATE_NULL; + pthread_mutex_unlock(&g_fsm_lock); + return g_fsm_state; break; default: AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_CONNECTING_S1C", event.code); } - pthread_mutex_unlock(&g_scenario->fsm_lock); + pthread_mutex_unlock(&g_fsm_lock); return 0; } //------------------------------------------------------------------------------ @@ -289,8 +293,8 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event) // no init in this scenario, may be sub-scenario if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) { et_scenario_schedule_tx_packet(g_scenario->next_packet); - pthread_mutex_unlock(&g_scenario->fsm_lock); - return g_scenario->fsm_state; + pthread_mutex_unlock(&g_fsm_lock); + return g_fsm_state; } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { if (g_scenario->next_packet->status == ET_PACKET_STATUS_RECEIVED) { g_scenario->last_rx_packet = g_scenario->next_packet; @@ -300,8 +304,8 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event) } else if (g_scenario->next_packet->status == ET_PACKET_STATUS_NONE) { et_scenario_wait_rx_packet(g_scenario->next_packet); - pthread_mutex_unlock(&g_scenario->fsm_lock); - return g_scenario->fsm_state; + pthread_mutex_unlock(&g_fsm_lock); + return g_fsm_state; } else { AssertFatal(0, "Invalid packet status %d", g_scenario->next_packet->status); } @@ -317,10 +321,10 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event) g_scenario->hash_mme2association_id = hashtable_create (256,NULL,NULL); // Try to register each eNB g_scenario->registered_enb = 0; - g_scenario->fsm_state = ET_FSM_STATE_CONNECTING_S1C; - g_scenario->register_enb_pending = et_eNB_app_register (g_scenario->enb_properties); - pthread_mutex_unlock(&g_scenario->fsm_lock); - return g_scenario->fsm_state; + g_fsm_state = ET_FSM_STATE_CONNECTING_S1C; + et_eNB_app_register (g_scenario->enb_properties); + pthread_mutex_unlock(&g_fsm_lock); + return g_fsm_state; break; case SCTP_CID_HEARTBEAT: @@ -348,9 +352,9 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event) } } fprintf(stderr, "No Useful packet found in this scenario: %s\n", g_scenario->name); - g_scenario->fsm_state = ET_FSM_STATE_NULL; - pthread_mutex_unlock(&g_scenario->fsm_lock); - return g_scenario->fsm_state; + g_fsm_state = ET_FSM_STATE_NULL; + pthread_mutex_unlock(&g_fsm_lock); + return g_fsm_state; break; default: @@ -364,15 +368,15 @@ et_fsm_state_t et_scenario_fsm_notify_event(et_event_t event) { AssertFatal((event.code >= ET_EVENT_START) && (event.code < ET_EVENT_END), "Unknown et_event_t.code %d", event.code); - pthread_mutex_lock(&g_scenario->fsm_lock); - switch (g_scenario->fsm_state){ + pthread_mutex_lock(&g_fsm_lock); + switch (g_fsm_state){ case ET_FSM_STATE_NULL: return et_scenario_fsm_notify_event_state_null(event); break; case ET_FSM_STATE_CONNECTING_S1C: return et_scenario_fsm_notify_event_state_connecting_s1c(event); break; case ET_FSM_STATE_WAITING_EVENT: return et_scenario_fsm_notify_event_state_waiting(event); break; case ET_FSM_STATE_RUNNING: return et_scenario_fsm_notify_event_state_running(event); break; default: - AssertFatal(0, "Case fsm_state %d not handled", g_scenario->fsm_state); + AssertFatal(0, "Case fsm_state %d not handled", g_fsm_state); } - pthread_mutex_unlock(&g_scenario->fsm_lock); - return g_scenario->fsm_state; + pthread_mutex_unlock(&g_fsm_lock); + return g_fsm_state; } diff --git a/openair3/TEST/EPC_TEST/play_scenario_parse.c b/openair3/TEST/EPC_TEST/play_scenario_parse.c index f6d8aa73ac..13c4746a5e 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_parse.c +++ b/openair3/TEST/EPC_TEST/play_scenario_parse.c @@ -447,8 +447,6 @@ et_scenario_t* et_generate_scenario( printf("scenario name: %s\n", xml_char); scenario = calloc(1, sizeof(*scenario)); scenario->name = xml_char; // nodup nofree - scenario->fsm_state = ET_FSM_STATE_NULL; - pthread_mutex_init(&scenario->fsm_lock, NULL); next_packet = &scenario->list_packet; for (node = root->children; node != NULL; node = node->next) { diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c index 7dd80904ae..d11d032b43 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c @@ -308,28 +308,82 @@ void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id, s1ap_eNB_mme_data_t * const mme_desc_p) { et_packet_t *packet = NULL; - struct in6_addr s1c_mme_ipv6 = IN6ADDR_ANY_INIT; - in_addr_t s1c_mme_ipv4 = INADDR_ANY; - struct in6_addr s1c_enb_ipv6 = IN6ADDR_ANY_INIT; - in_addr_t s1c_enb_ipv4 = INADDR_ANY; + int ret; + unsigned int old_enb_port = 0; + unsigned int old_mme_port = 0; - packet = g_scenario->next_packet; + S1AP_DEBUG("%s for SCTP association (%u)\n",__FUNCTION__,assoc_id); + + packet = g_scenario->list_packet; while (NULL != packet) { switch (packet->sctp_hdr.chunk_type) { case SCTP_CID_DATA : - if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) { - // TODO compare addresses and ports - if (packet->ip_hdr.dst) - packet->sctp_hdr.dst_port == 0; - packet->sctp_hdr.src_port == 0; - - } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { + if (ET_PACKET_STATUS_NONE == packet->status) { + if (0 < old_mme_port) { + if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) { + ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &mme_desc_p->mme_net_ip_address); + if (0 == ret) { + ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &s1ap_eNB_instance->s1c_net_ip_address); + if (0 == ret) { + // same IP src, same IP dst + if ((packet->sctp_hdr.dst_port == old_mme_port) && (packet->sctp_hdr.src_port == old_enb_port)) { + packet->sctp_hdr.u.data_hdr.assoc_id = assoc_id; + S1AP_DEBUG("tPacket:\tnum %u | original frame number %u \n", packet->packet_number, packet->original_frame_number); + S1AP_DEBUG("\tUpdated assoc id: %u\n", assoc_id); + } + } + } + } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { + ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &mme_desc_p->mme_net_ip_address); + if (0 == ret) { + ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &s1ap_eNB_instance->s1c_net_ip_address); + if (0 == ret) { + // same IP src, same IP dst + if ((packet->sctp_hdr.src_port == old_mme_port) && (packet->sctp_hdr.dst_port == old_enb_port)) { + packet->sctp_hdr.u.data_hdr.assoc_id = assoc_id; + S1AP_DEBUG("tPacket:\tnum %u | original frame number %u \n", packet->packet_number, packet->original_frame_number); + S1AP_DEBUG("\tUpdated assoc id: %u\n", assoc_id); + } + } + } + } + } } break; + // Strong assumption + // in replayed scenario, the order of SCTP INIT packets is supposed to be the same as in the catched scenario case SCTP_CID_INIT: + ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &mme_desc_p->mme_net_ip_address); + if (0 == ret) { + ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &s1ap_eNB_instance->s1c_net_ip_address); + if (0 == ret) { + if (0 == old_enb_port) { + if (ET_PACKET_STATUS_NONE == packet->status) { + packet->status = ET_PACKET_STATUS_SENT; + old_enb_port = packet->sctp_hdr.src_port; + } + } + } + } + break; + case SCTP_CID_INIT_ACK: + ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &mme_desc_p->mme_net_ip_address); + if (0 == ret) { + ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &s1ap_eNB_instance->s1c_net_ip_address); + if (0 == ret) { + if (old_enb_port == packet->sctp_hdr.dst_port) { + if (ET_PACKET_STATUS_NONE == packet->status) { + packet->status = ET_PACKET_STATUS_RECEIVED; + old_mme_port = packet->sctp_hdr.dst_port; + } + } + } + } + break; + case SCTP_CID_HEARTBEAT: case SCTP_CID_HEARTBEAT_ACK: case SCTP_CID_COOKIE_ECHO: @@ -384,12 +438,14 @@ void et_s1ap_handle_s1_setup_message(s1ap_eNB_mme_data_t *mme_desc_p, int sctp_s if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb > 0) { /* Decrease pending messages number */ mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb --; + mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb++; } et_s1ap_update_assoc_id_of_packets(mme_desc_p->assoc_id, mme_desc_p->s1ap_eNB_instance, mme_desc_p); + /* If there are no more pending messages, inform eNB app */ if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb == 0) { MessageDef *message_p; @@ -484,6 +540,10 @@ void et_s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_asso return; } + S1AP_DEBUG("Received successful result for SCTP association (%u), instance %d, cnx_id %u\n", + sctp_new_association_resp->sctp_state, + instance, + sctp_new_association_resp->ulp_cnx_id); /* Update parameters */ s1ap_mme_data_p->assoc_id = sctp_new_association_resp->assoc_id; s1ap_mme_data_p->in_streams = sctp_new_association_resp->in_streams; @@ -557,7 +617,7 @@ void *et_s1ap_eNB_task(void *arg) if (TIMER_HAS_EXPIRED (received_msg).timer_id == g_scenario->enb_register_retry_timer_id) { /* Restart the registration process */ g_scenario->registered_enb = 0; - g_scenario->register_enb_pending = et_eNB_app_register (g_scenario->enb_properties); + et_eNB_app_register (g_scenario->enb_properties); } break; From 11cfa5ba76a1c8963348387726d408fb276ca460 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 16 Oct 2015 02:20:52 -0700 Subject: [PATCH 015/214] brought in AVX2 modifications from svn repository on openair1/PHY/TOOLS/lte-dfts.c --- openair1/PHY/TOOLS/lte_dfts.c | 2773 ++++++++++++++++++++++++++++++--- 1 file changed, 2589 insertions(+), 184 deletions(-) diff --git a/openair1/PHY/TOOLS/lte_dfts.c b/openair1/PHY/TOOLS/lte_dfts.c index c031d5d384..f1103e4478 100644 --- a/openair1/PHY/TOOLS/lte_dfts.c +++ b/openair1/PHY/TOOLS/lte_dfts.c @@ -5,7 +5,7 @@ OpenAirInterface is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + (at your option) any lat_er version. OpenAirInterface is distributed in the hope that it will be useful, @@ -51,15 +51,15 @@ #include "PHY/sse_intrin.h" #define print_shorts(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7]) +#define print_shorts256(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7],(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15]) + #define print_ints(s,x) printf("%s %d %d %d %d\n",s,(x)[0],(x)[1],(x)[2],(x)[3]) -#ifdef AVX2 -static int16_t conjugatedft2[16] __attribute__((aligned(32))) = {1,1,1,1,1,1,1,1,-1,1,-1,1,-1,1,-1,1,-1,1}; -#endif -static int16_t conjugatedft[8] __attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1} ; +static int16_t conjugatedft[32] __attribute__((aligned(32))) = {-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1}; -static short reflip[8] __attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1}; + +static int16_t reflip[32] __attribute__((aligned(32))) = {1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1}; #if defined(__x86_64__) || defined(__i386__) static inline void cmac(__m128i a,__m128i b, __m128i *re32, __m128i *im32) __attribute__((always_inline)); @@ -101,8 +101,43 @@ static inline void cmacc(__m128i a,__m128i b, __m128i *re32, __m128i *im32) *im32 = _mm_add_epi32(*im32,cmac_tmp_im32); } +#ifdef __AVX2__ +static inline void cmac_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) __attribute__((always_inline)); +static inline void cmac_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) +{ + + __m256i cmac_tmp,cmac_tmp_re32,cmac_tmp_im32; + __m256i imshuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,19,18,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + cmac_tmp = _mm256_sign_epi16(b,*(__m256i*)reflip); + cmac_tmp_re32 = _mm256_madd_epi16(a,cmac_tmp); + + cmac_tmp = _mm256_shuffle_epi8(b,imshuffle); + cmac_tmp_im32 = _mm256_madd_epi16(cmac_tmp,a); + + *re32 = _mm256_add_epi32(*re32,cmac_tmp_re32); + *im32 = _mm256_add_epi32(*im32,cmac_tmp_im32); +} + +static inline void cmacc_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) __attribute__((always_inline)); +static inline void cmacc_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) +{ + + __m256i cmac_tmp,cmac_tmp_re32,cmac_tmp_im32; + __m256i imshuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,19,18,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + cmac_tmp_re32 = _mm256_madd_epi16(a,b); + cmac_tmp = _mm256_sign_epi16(b,*(__m256i*)reflip); + cmac_tmp = _mm256_shuffle_epi8(b,imshuffle); + cmac_tmp_im32 = _mm256_madd_epi16(cmac_tmp,a); + + *re32 = _mm256_add_epi32(*re32,cmac_tmp_re32); + *im32 = _mm256_add_epi32(*im32,cmac_tmp_im32); +} + +#endif static inline void cmult(__m128i a,__m128i b, __m128i *re32, __m128i *im32) __attribute__((always_inline)); @@ -120,6 +155,24 @@ static inline void cmult(__m128i a,__m128i b, __m128i *re32, __m128i *im32) } +#ifdef __AVX2__ +static inline void cmult_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) __attribute__((always_inline)); + +static inline void cmult_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) +{ + + register __m256i mmtmpb; + __m256i const perm_mask = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + mmtmpb = _mm256_sign_epi16(b,*(__m256i*)reflip); + *re32 = _mm256_madd_epi16(a,mmtmpb); + mmtmpb = _mm256_shuffle_epi8(b,perm_mask); + *im32 = _mm256_madd_epi16(a,mmtmpb); + +} + +#endif + static inline void cmultc(__m128i a,__m128i b, __m128i *re32, __m128i *im32) __attribute__((always_inline)); static inline void cmultc(__m128i a,__m128i b, __m128i *re32, __m128i *im32) @@ -134,6 +187,23 @@ static inline void cmultc(__m128i a,__m128i b, __m128i *re32, __m128i *im32) } +#ifdef __AVX2__ +static inline void cmultc_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) __attribute__((always_inline)); + +static inline void cmultc_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) +{ + + register __m256i mmtmpb; + __m256i const perm_mask = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + *re32 = _mm256_madd_epi16(a,b); + mmtmpb = _mm256_sign_epi16(b,*(__m256i*)reflip); + mmtmpb = _mm256_shuffle_epi8(mmtmpb,perm_mask); + *im32 = _mm256_madd_epi16(a,mmtmpb); + +} + +#endif static inline __m128i cpack(__m128i xre,__m128i xim) __attribute__((always_inline)); @@ -148,6 +218,21 @@ static inline __m128i cpack(__m128i xre,__m128i xim) } +#ifdef __AVX2__ +static inline __m256i cpack_256(__m256i xre,__m256i xim) __attribute__((always_inline)); + +static inline __m256i cpack_256(__m256i xre,__m256i xim) +{ + + register __m256i cpack_tmp1,cpack_tmp2; + + cpack_tmp1 = _mm256_unpacklo_epi32(xre,xim); + cpack_tmp2 = _mm256_unpackhi_epi32(xre,xim); + return(_mm256_packs_epi32(_mm256_srai_epi32(cpack_tmp1,15),_mm256_srai_epi32(cpack_tmp2,15))); + +} + +#endif static inline void packed_cmult(__m128i a,__m128i b, __m128i *c) __attribute__((always_inline)); @@ -160,6 +245,18 @@ static inline void packed_cmult(__m128i a,__m128i b, __m128i *c) } +#ifdef __AVX2__ +static inline void packed_cmult_256(__m256i a,__m256i b, __m256i *c) __attribute__((always_inline)); + +static inline void packed_cmult_256(__m256i a,__m256i b, __m256i *c) +{ + + __m256i cre,cim; + cmult_256(a,b,&cre,&cim); + *c = cpack_256(cre,cim); + +} +#endif static inline void packed_cmultc(__m128i a,__m128i b, __m128i *c) __attribute__((always_inline)); @@ -173,6 +270,20 @@ static inline void packed_cmultc(__m128i a,__m128i b, __m128i *c) } +#ifdef __AVX2__ +static inline void packed_cmultc_256(__m256i a,__m256i b, __m256i *c) __attribute__((always_inline)); + +static inline void packed_cmultc_256(__m256i a,__m256i b, __m256i *c) +{ + + __m256i cre,cim; + + cmultc_256(a,b,&cre,&cim); + *c = cpack_256(cre,cim); + +} +#endif + static inline __m128i packed_cmult2(__m128i a,__m128i b,__m128i b2) __attribute__((always_inline)); static inline __m128i packed_cmult2(__m128i a,__m128i b,__m128i b2) @@ -188,6 +299,23 @@ static inline __m128i packed_cmult2(__m128i a,__m128i b,__m128i b2) } +#ifdef __AVX2__ +static inline __m256i packed_cmult2_256(__m256i a,__m256i b,__m256i b2) __attribute__((always_inline)); + +static inline __m256i packed_cmult2_256(__m256i a,__m256i b,__m256i b2) +{ + + + register __m256i cre,cim; + + cre = _mm256_madd_epi16(a,b); + cim = _mm256_madd_epi16(a,b2); + + return(cpack_256(cre,cim)); + +} +#endif + #elif defined (__arm__) static inline void cmac(int16x8_t a,int16x8_t b, int32x4_t *re32, int32x4_t *im32) __attribute__((always_inline)); static inline void cmac(int16x8_t a,int16x8_t b, int32x4_t *re32, int32x4_t *im32) @@ -344,15 +472,15 @@ static inline int16x8_t packed_cmult2(int16x8_t a,int16x8_t b, int16x8_t b2) #endif -static int16_t W0s[8]__attribute__((aligned(16))) = {32767,0,32767,0,32767,0,32767,0}; +static int16_t W0s[8]__attribute__((aligned(32))) = {32767,0,32767,0,32767,0,32767,0}; -static int16_t W13s[8]__attribute__((aligned(16))) = {-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378}; -static int16_t W23s[8]__attribute__((aligned(16))) = {-16384,28378,-16384,28378,-16384,28378,-16384,28378}; +static int16_t W13s[8]__attribute__((aligned(32))) = {-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378}; +static int16_t W23s[8]__attribute__((aligned(32))) = {-16384,28378,-16384,28378,-16384,28378,-16384,28378}; -static int16_t W15s[8]__attribute__((aligned(16))) = {10126,-31163,10126,-31163,10126,-31163,10126,-31163}; -static int16_t W25s[8]__attribute__((aligned(16))) = {-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260}; -static int16_t W35s[8]__attribute__((aligned(16))) = {-26510,19260,-26510,19260,-26510,19260,-26510,19260}; -static int16_t W45s[8]__attribute__((aligned(16))) = {10126,31163,10126,31163,10126,31163,10126,31163}; +static int16_t W15s[8]__attribute__((aligned(32))) = {10126,-31163,10126,-31163,10126,-31163,10126,-31163}; +static int16_t W25s[8]__attribute__((aligned(32))) = {-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260}; +static int16_t W35s[8]__attribute__((aligned(32))) = {-26510,19260,-26510,19260,-26510,19260,-26510,19260}; +static int16_t W45s[8]__attribute__((aligned(32))) = {10126,31163,10126,31163,10126,31163,10126,31163}; #if defined(__x86_64__) || defined(__i386__) __m128i *W0 = (__m128i *)W0s; @@ -362,6 +490,17 @@ __m128i *W15 = (__m128i *)W15s; __m128i *W25 = (__m128i *)W25s; __m128i *W35 = (__m128i *)W35s; __m128i *W45 = (__m128i *)W45s; + +#ifdef __AVX2__ +__m256i *W0_256 = (__m256i *)W0s; +__m256i *W13_256 = (__m256i *)W13s; +__m256i *W23_256 = (__m256i *)W23s; +__m256i *W15_256 = (__m256i *)W15s; +__m256i *W25_256 = (__m256i *)W25s; +__m256i *W35_256 = (__m256i *)W35s; +__m256i *W45_256 = (__m256i *)W45s; +#endif + #elif defined(__arm__) int16x8_t *W0 = (int16x8_t *)W0s; int16x8_t *W13 = (int16x8_t *)W13s; @@ -417,6 +556,36 @@ static inline void bfly2(__m128i *x0, __m128i *x1,__m128i *y0, __m128i *y1,__m12 *y1 = _mm_packs_epi32(bfly2_tmp1,bfly2_tmp2); } +#ifdef __AVX2__ + +static inline void bfly2_256(__m256i *x0, __m256i *x1,__m256i *y0, __m256i *y1,__m256i *tw)__attribute__((always_inline)); + +static inline void bfly2_256(__m256i *x0, __m256i *x1,__m256i *y0, __m256i *y1,__m256i *tw) +{ + + __m256i x0r_2,x0i_2,x1r_2,x1i_2,dy0r,dy1r,dy0i,dy1i; + __m256i bfly2_tmp1,bfly2_tmp2; + + cmult_256(*(x0),*(W0_256),&x0r_2,&x0i_2); + cmult_256(*(x1),*(tw),&x1r_2,&x1i_2); + + dy0r = _mm256_srai_epi32(_mm256_add_epi32(x0r_2,x1r_2),15); + dy1r = _mm256_srai_epi32(_mm256_sub_epi32(x0r_2,x1r_2),15); + dy0i = _mm256_srai_epi32(_mm256_add_epi32(x0i_2,x1i_2),15); + // printf("y0i %d\n",((int16_t *)y0i)[0]); + dy1i = _mm256_srai_epi32(_mm256_sub_epi32(x0i_2,x1i_2),15); + + bfly2_tmp1 = _mm256_unpacklo_epi32(dy0r,dy0i); + bfly2_tmp2 = _mm256_unpackhi_epi32(dy0r,dy0i); + *y0 = _mm256_packs_epi32(bfly2_tmp1,bfly2_tmp2); + + bfly2_tmp1 = _mm256_unpacklo_epi32(dy1r,dy1i); + bfly2_tmp2 = _mm256_unpackhi_epi32(dy1r,dy1i); + *y1 = _mm256_packs_epi32(bfly2_tmp1,bfly2_tmp2); +} + +#endif + #elif defined(__arm__) static inline void bfly2(int16x8_t *x0, int16x8_t *x1,int16x8_t *y0, int16x8_t *y1,int16x8_t *tw)__attribute__((always_inline)); @@ -466,37 +635,67 @@ static inline void bfly2_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x #endif #if defined(__x86_64__) || defined(__i386__) + + + static inline void bfly2_16(__m128i *x0, __m128i *x1, __m128i *y0, __m128i *y1, __m128i *tw, __m128i *twb)__attribute__((always_inline)); static inline void bfly2_16(__m128i *x0, __m128i *x1, __m128i *y0, __m128i *y1, __m128i *tw, __m128i *twb) { - register __m128i x1t; + // register __m128i x1t; + __m128i x1t; x1t = packed_cmult2(*(x1),*(tw),*(twb)); - + /* + print_shorts("x0",(int16_t*)x0); + print_shorts("x1",(int16_t*)x1); + print_shorts("tw",(int16_t*)tw); + print_shorts("twb",(int16_t*)twb); + print_shorts("x1t",(int16_t*)&x1t);*/ *y0 = _mm_adds_epi16(*x0,x1t); *y1 = _mm_subs_epi16(*x0,x1t); - + /* print_shorts("y0",(int16_t*)y0); + print_shorts("y1",(int16_t*)y1);*/ } +#ifdef __AVX2__ + +static inline void bfly2_16_256(__m256i *x0, __m256i *x1, __m256i *y0, __m256i *y1, __m256i *tw, __m256i *twb)__attribute__((always_inline)); + +static inline void bfly2_16_256(__m256i *x0, __m256i *x1, __m256i *y0, __m256i *y1, __m256i *tw, __m256i *twb) +{ + + // register __m256i x1t; + __m256i x1t; + + x1t = packed_cmult2_256(*(x1),*(tw),*(twb)); + + print_shorts256("x0",(int16_t*)x0); + print_shorts256("x1",(int16_t*)x1); + print_shorts256("tw",(int16_t*)tw); + print_shorts256("twb",(int16_t*)twb); + print_shorts256("x1t",(int16_t*)&x1t); + *y0 = _mm256_adds_epi16(*x0,x1t); + *y1 = _mm256_subs_epi16(*x0,x1t); + + print_shorts256("y0",(int16_t*)y0); + print_shorts256("y1",(int16_t*)y1); +} +#endif + #elif defined(__arm__) -static inline void bfly2_16(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8_t *y1, int16x8_t *tw, int16x8_t *twb)__attribute__((always_inline)); +static inline void bfly2_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8_t *y1)__attribute__((always_inline)); -static inline void bfly2_16(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8_t *y1, int16x8_t *tw, int16x8_t *twb) +static inline void bfly2_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8_t *y1) { - register int16x8_t x1t; - - x1t = packed_cmult2(*(x1),*(tw),*(twb)); - - *y0 = vqaddq_s16(*x0,x1t); - *y1 = vqsubq_s16(*x0,x1t); + *y0 = vqaddq_s16(*x0,*x1); + *y1 = vqsubq_s16(*x0,*x1); } - #endif #if defined(__x86_64__) || defined(__i386__) @@ -525,6 +724,35 @@ static inline void ibfly2(__m128i *x0, __m128i *x1,__m128i *y0, __m128i *y1,__m1 bfly2_tmp2 = _mm_unpackhi_epi32(dy1r,dy1i); *y1 = _mm_packs_epi32(bfly2_tmp1,bfly2_tmp2); } + +#ifdef __AVX2__ +static inline void ibfly2_256(__m256i *x0, __m256i *x1,__m256i *y0, __m256i *y1,__m256i *tw)__attribute__((always_inline)); + +static inline void ibfly2_256(__m256i *x0, __m256i *x1,__m256i *y0, __m256i *y1,__m256i *tw) +{ + + __m256i x0r_2,x0i_2,x1r_2,x1i_2,dy0r,dy1r,dy0i,dy1i; + __m256i bfly2_tmp1,bfly2_tmp2; + + cmultc_256(*(x0),*(W0_256),&x0r_2,&x0i_2); + cmultc_256(*(x1),*(tw),&x1r_2,&x1i_2); + + dy0r = _mm256_srai_epi32(_mm256_add_epi32(x0r_2,x1r_2),15); + dy1r = _mm256_srai_epi32(_mm256_sub_epi32(x0r_2,x1r_2),15); + dy0i = _mm256_srai_epi32(_mm256_add_epi32(x0i_2,x1i_2),15); + // printf("y0i %d\n",((int16_t *)y0i)[0]); + dy1i = _mm256_srai_epi32(_mm256_sub_epi32(x0i_2,x1i_2),15); + + bfly2_tmp1 = _mm256_unpacklo_epi32(dy0r,dy0i); + bfly2_tmp2 = _mm256_unpackhi_epi32(dy0r,dy0i); + *y0 = _mm256_packs_epi32(bfly2_tmp1,bfly2_tmp2); + + bfly2_tmp1 = _mm256_unpacklo_epi32(dy1r,dy1i); + bfly2_tmp2 = _mm256_unpackhi_epi32(dy1r,dy1i); + *y1 = _mm256_packs_epi32(bfly2_tmp1,bfly2_tmp2); +} +#endif + #elif defined(__arm__) static inline void ibfly2(int16x8_t *x0, int16x8_t *x1,int16x8_t *y0, int16x8_t *y1,int16x8_t *tw) { @@ -577,6 +805,33 @@ static inline void bfly3(__m128i *x0,__m128i *x1,__m128i *x2, *(y2) = _mm_adds_epi16(*(x0),*(y2)); } +#ifdef __AVX2__ + +static inline void bfly3_256(__m256i *x0,__m256i *x1,__m256i *x2, + __m256i *y0,__m256i *y1,__m256i *y2, + __m256i *tw1,__m256i *tw2) __attribute__((always_inline)); + +static inline void bfly3_256(__m256i *x0,__m256i *x1,__m256i *x2, + __m256i *y0,__m256i *y1,__m256i *y2, + __m256i *tw1,__m256i *tw2) +{ + + __m256i tmpre,tmpim,x1_2,x2_2; + + packed_cmult_256(*(x1),*(tw1),&x1_2); + packed_cmult_256(*(x2),*(tw2),&x2_2); + *(y0) = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(x1_2,x2_2)); + cmult_256(x1_2,*(W13_256),&tmpre,&tmpim); + cmac_256(x2_2,*(W23_256),&tmpre,&tmpim); + *(y1) = cpack_256(tmpre,tmpim); + *(y1) = _mm256_adds_epi16(*(x0),*(y1)); + cmult_256(x1_2,*(W23_256),&tmpre,&tmpim); + cmac_256(x2_2,*(W13_256),&tmpre,&tmpim); + *(y2) = cpack_256(tmpre,tmpim); + *(y2) = _mm256_adds_epi16(*(x0),*(y2)); +} +#endif + #elif defined(__arm__) static inline void bfly3(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2, int16x8_t *y0,int16x8_t *y1,int16x8_t *y2, @@ -630,6 +885,33 @@ static inline void ibfly3(__m128i *x0,__m128i *x1,__m128i *x2, *(y2) = _mm_adds_epi16(*(x0),*(y2)); } +#ifdef __AVX2__ + +static inline void ibfly3_256(__m256i *x0,__m256i *x1,__m256i *x2, + __m256i *y0,__m256i *y1,__m256i *y2, + __m256i *tw1,__m256i *tw2) __attribute__((always_inline)); + +static inline void ibfly3_256(__m256i *x0,__m256i *x1,__m256i *x2, + __m256i *y0,__m256i *y1,__m256i *y2, + __m256i *tw1,__m256i *tw2) +{ + + __m256i tmpre,tmpim,x1_2,x2_2; + + packed_cmultc_256(*(x1),*(tw1),&x1_2); + packed_cmultc_256(*(x2),*(tw2),&x2_2); + *(y0) = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(x1_2,x2_2)); + cmultc_256(x1_2,*(W13_256),&tmpre,&tmpim); + cmacc_256(x2_2,*(W23_256),&tmpre,&tmpim); + *(y1) = cpack_256(tmpre,tmpim); + *(y1) = _mm256_adds_epi16(*(x0),*(y1)); + cmultc_256(x1_2,*(W23_256),&tmpre,&tmpim); + cmacc_256(x2_2,*(W13_256),&tmpre,&tmpim); + *(y2) = cpack_256(tmpre,tmpim); + *(y2) = _mm256_adds_epi16(*(x0),*(y2)); +} +#endif + #elif defined(__arm__) static inline void ibfly3(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2, int16x8_t *y0,int16x8_t *y1,int16x8_t *y2, @@ -677,6 +959,30 @@ static inline void bfly3_tw1(__m128i *x0,__m128i *x1,__m128i *x2, *(y2) = cpack(tmpre,tmpim); *(y2) = _mm_adds_epi16(*(x0),*(y2)); } + +#ifdef __AVX2__ + +static inline void bfly3_tw1_256(__m256i *x0,__m256i *x1,__m256i *x2, + __m256i *y0,__m256i *y1,__m256i *y2) __attribute__((always_inline)); + +static inline void bfly3_tw1_256(__m256i *x0,__m256i *x1,__m256i *x2, + __m256i *y0,__m256i *y1,__m256i *y2) +{ + + __m256i tmpre,tmpim; + + *(y0) = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(*(x1),*(x2))); + cmult_256(*(x1),*(W13_256),&tmpre,&tmpim); + cmac_256(*(x2),*(W23_256),&tmpre,&tmpim); + *(y1) = cpack_256(tmpre,tmpim); + *(y1) = _mm256_adds_epi16(*(x0),*(y1)); + cmult_256(*(x1),*(W23_256),&tmpre,&tmpim); + cmac_256(*(x2),*(W13_256),&tmpre,&tmpim); + *(y2) = cpack_256(tmpre,tmpim); + *(y2) = _mm256_adds_epi16(*(x0),*(y2)); +} +#endif + #elif defined(__arm__) static inline void bfly3_tw1(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2, int16x8_t *y0,int16x8_t *y1,int16x8_t *y2) __attribute__((always_inline)); @@ -743,6 +1049,48 @@ static inline void bfly4(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3, *(y3) = _mm_add_epi16(*(x0),cpack(dy3r,dy3i)); } +#ifdef __AVX2__ +static inline void bfly4_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3)__attribute__((always_inline)); + +static inline void bfly4_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3) +{ + + __m256i x1r_2,x1i_2,x2r_2,x2i_2,x3r_2,x3i_2,dy0r,dy0i,dy1r,dy1i,dy2r,dy2i,dy3r,dy3i; + + // cmult(*(x0),*(W0),&x0r_2,&x0i_2); + cmult_256(*(x1),*(tw1),&x1r_2,&x1i_2); + cmult_256(*(x2),*(tw2),&x2r_2,&x2i_2); + cmult_256(*(x3),*(tw3),&x3r_2,&x3i_2); + // dy0r = _mm_add_epi32(x0r_2,_mm_add_epi32(x1r_2,_mm_add_epi32(x2r_2,x3r_2))); + // dy0i = _mm_add_epi32(x0i_2,_mm_add_epi32(x1i_2,_mm_add_epi32(x2i_2,x3i_2))); + // *(y0) = cpack(dy0r,dy0i); + dy0r = _mm256_add_epi32(x1r_2,_mm256_add_epi32(x2r_2,x3r_2)); + dy0i = _mm256_add_epi32(x1i_2,_mm256_add_epi32(x2i_2,x3i_2)); + *(y0) = _mm256_add_epi16(*(x0),cpack_256(dy0r,dy0i)); + // dy1r = _mm_add_epi32(x0r_2,_mm_sub_epi32(x1i_2,_mm_add_epi32(x2r_2,x3i_2))); + // dy1i = _mm_sub_epi32(x0i_2,_mm_add_epi32(x1r_2,_mm_sub_epi32(x2i_2,x3r_2))); + // *(y1) = cpack(dy1r,dy1i); + dy1r = _mm256_sub_epi32(x1i_2,_mm256_add_epi32(x2r_2,x3i_2)); + dy1i = _mm256_sub_epi32(_mm256_sub_epi32(x3r_2,x2i_2),x1r_2); + *(y1) = _mm256_add_epi16(*(x0),cpack_256(dy1r,dy1i)); + // dy2r = _mm_sub_epi32(x0r_2,_mm_sub_epi32(x1r_2,_mm_sub_epi32(x2r_2,x3r_2))); + // dy2i = _mm_sub_epi32(x0i_2,_mm_sub_epi32(x1i_2,_mm_sub_epi32(x2i_2,x3i_2))); + // *(y2) = cpack(dy2r,dy2i); + dy2r = _mm256_sub_epi32(_mm256_sub_epi32(x2r_2,x3r_2),x1r_2); + dy2i = _mm256_sub_epi32(_mm256_sub_epi32(x2i_2,x3i_2),x1i_2); + *(y2) = _mm256_add_epi16(*(x0),cpack_256(dy2r,dy2i)); + // dy3r = _mm_sub_epi32(x0r_2,_mm_add_epi32(x1i_2,_mm_sub_epi32(x2r_2,x3i_2))); + // dy3i = _mm_add_epi32(x0i_2,_mm_sub_epi32(x1r_2,_mm_add_epi32(x2i_2,x3r_2))); + // *(y3) = cpack(dy3r,dy3i); + dy3r = _mm256_sub_epi32(_mm256_sub_epi32(x3i_2,x2r_2),x1i_2); + dy3i = _mm256_sub_epi32(x1r_2,_mm256_add_epi32(x2i_2,x3r_2)); + *(y3) = _mm256_add_epi16(*(x0),cpack_256(dy3r,dy3i)); +} +#endif #elif defined(__arm__) static inline void bfly4(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3, int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3, @@ -818,6 +1166,39 @@ static inline void ibfly4(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3, *(y1) = _mm_add_epi16(*(x0),cpack(dy1r,dy1i)); } +#ifdef __AVX2__ + +static inline void ibfly4_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3)__attribute__((always_inline)); + +static inline void ibfly4_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3) +{ + + __m256i x1r_2,x1i_2,x2r_2,x2i_2,x3r_2,x3i_2,dy0r,dy0i,dy1r,dy1i,dy2r,dy2i,dy3r,dy3i; + + + cmultc_256(*(x1),*(tw1),&x1r_2,&x1i_2); + cmultc_256(*(x2),*(tw2),&x2r_2,&x2i_2); + cmultc_256(*(x3),*(tw3),&x3r_2,&x3i_2); + + dy0r = _mm256_add_epi32(x1r_2,_mm256_add_epi32(x2r_2,x3r_2)); + dy0i = _mm256_add_epi32(x1i_2,_mm256_add_epi32(x2i_2,x3i_2)); + *(y0) = _mm256_add_epi16(*(x0),cpack_256(dy0r,dy0i)); + dy3r = _mm256_sub_epi32(x1i_2,_mm256_add_epi32(x2r_2,x3i_2)); + dy3i = _mm256_sub_epi32(_mm256_sub_epi32(x3r_2,x2i_2),x1r_2); + *(y3) = _mm256_add_epi16(*(x0),cpack_256(dy3r,dy3i)); + dy2r = _mm256_sub_epi32(_mm256_sub_epi32(x2r_2,x3r_2),x1r_2); + dy2i = _mm256_sub_epi32(_mm256_sub_epi32(x2i_2,x3i_2),x1i_2); + *(y2) = _mm256_add_epi16(*(x0),cpack_256(dy2r,dy2i)); + dy1r = _mm256_sub_epi32(_mm256_sub_epi32(x3i_2,x2r_2),x1i_2); + dy1i = _mm256_sub_epi32(x1r_2,_mm256_add_epi32(x2i_2,x3r_2)); + *(y1) = _mm256_add_epi16(*(x0),cpack_256(dy1r,dy1i)); +} + +#endif #elif defined(__arm__) static inline void ibfly4(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3, @@ -888,6 +1269,32 @@ static inline void bfly4_tw1(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3, */ } +#ifdef __AVX2__ + +static inline void bfly4_tw1_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3)__attribute__((always_inline)); + +static inline void bfly4_tw1_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3) +{ + register __m256i x1_flip,x3_flip,x02t,x13t; + register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + x02t = _mm256_adds_epi16(*(x0),*(x2)); + x13t = _mm256_adds_epi16(*(x1),*(x3)); + *(y0) = _mm256_adds_epi16(x02t,x13t); + *(y2) = _mm256_subs_epi16(x02t,x13t); + x1_flip = _mm256_sign_epi16(*(x1),*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(*(x3),*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(*(x0),*(x2)); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + *(y1) = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + *(y3) = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f +} +#endif + #elif defined(__arm__) static inline void bfly4_tw1(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3, @@ -1005,6 +1412,48 @@ static inline void bfly4_16(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3, } +#ifdef __AVX2__ +static inline void bfly4_16_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3, + __m256i *tw1b,__m256i *tw2b,__m256i *tw3b)__attribute__((always_inline)); + +static inline void bfly4_16_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3, + __m256i *tw1b,__m256i *tw2b,__m256i *tw3b) +{ + + register __m256i x1t,x2t,x3t,x02t,x13t; + register __m256i x1_flip,x3_flip; + register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + // each input xi is assumed to be to consecutive vectors xi0 xi1 on which to perform the 8 butterflies + // [xi00 xi01 xi02 xi03 xi10 xi20 xi30 xi40] + // each output yi is the same + + x1t = packed_cmult2_256(*(x1),*(tw1),*(tw1b)); + x2t = packed_cmult2_256(*(x2),*(tw2),*(tw2b)); + x3t = packed_cmult2_256(*(x3),*(tw3),*(tw3b)); + + x02t = _mm256_adds_epi16(*(x0),x2t); + x13t = _mm256_adds_epi16(x1t,x3t); + *(y0) = _mm256_adds_epi16(x02t,x13t); + *(y2) = _mm256_subs_epi16(x02t,x13t); + + x1_flip = _mm256_sign_epi16(x1t,*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(x3t,*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(*(x0),x2t); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + *(y1) = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + *(y3) = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + +} + +#endif + #elif defined(__arm__) static inline void bfly4_16(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3, @@ -1089,6 +1538,47 @@ static inline void ibfly4_16(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3, } +#ifdef __AVX2__ +static inline void ibfly4_16_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3, + __m256i *tw1b,__m256i *tw2b,__m256i *tw3b)__attribute__((always_inline)); + +static inline void ibfly4_16_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3, + __m256i *tw1b,__m256i *tw2b,__m256i *tw3b) +{ + + register __m256i x1t,x2t,x3t,x02t,x13t; + register __m256i x1_flip,x3_flip; + register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + // each input xi is assumed to be to consecutive vectors xi0 xi1 on which to perform the 8 butterflies + // [xi00 xi01 xi02 xi03 xi10 xi20 xi30 xi40] + // each output yi is the same + + x1t = packed_cmult2_256(*(x1),*(tw1),*(tw1b)); + x2t = packed_cmult2_256(*(x2),*(tw2),*(tw2b)); + x3t = packed_cmult2_256(*(x3),*(tw3),*(tw3b)); + + x02t = _mm256_adds_epi16(*(x0),x2t); + x13t = _mm256_adds_epi16(x1t,x3t); + *(y0) = _mm256_adds_epi16(x02t,x13t); + *(y2) = _mm256_subs_epi16(x02t,x13t); + + x1_flip = _mm256_sign_epi16(x1t,*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(x3t,*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(*(x0),x2t); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + *(y3) = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + *(y1) = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + +} +#endif + #elif defined(__arm__) static inline void ibfly4_16(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3, int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3, @@ -1173,6 +1663,59 @@ static inline void bfly5(__m128i *x0, __m128i *x1, __m128i *x2, __m128i *x3,__m1 } +#ifdef __AVX2__ + +static inline void bfly5_256(__m256i *x0, __m256i *x1, __m256i *x2, __m256i *x3,__m256i *x4, + __m256i *y0, __m256i *y1, __m256i *y2, __m256i *y3,__m256i *y4, + __m256i *tw1,__m256i *tw2,__m256i *tw3,__m256i *tw4)__attribute__((always_inline)); + +static inline void bfly5_256(__m256i *x0, __m256i *x1, __m256i *x2, __m256i *x3,__m256i *x4, + __m256i *y0, __m256i *y1, __m256i *y2, __m256i *y3,__m256i *y4, + __m256i *tw1,__m256i *tw2,__m256i *tw3,__m256i *tw4) +{ + + + + __m256i x1_2,x2_2,x3_2,x4_2,tmpre,tmpim; + + packed_cmult_256(*(x1),*(tw1),&x1_2); + packed_cmult_256(*(x2),*(tw2),&x2_2); + packed_cmult_256(*(x3),*(tw3),&x3_2); + packed_cmult_256(*(x4),*(tw4),&x4_2); + + *(y0) = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(x1_2,_mm256_adds_epi16(x2_2,_mm256_adds_epi16(x3_2,x4_2)))); + cmult_256(x1_2,*(W15_256),&tmpre,&tmpim); + cmac_256(x2_2,*(W25_256),&tmpre,&tmpim); + cmac_256(x3_2,*(W35_256),&tmpre,&tmpim); + cmac_256(x4_2,*(W45_256),&tmpre,&tmpim); + *(y1) = cpack_256(tmpre,tmpim); + *(y1) = _mm256_adds_epi16(*(x0),*(y1)); + + cmult_256(x1_2,*(W25_256),&tmpre,&tmpim); + cmac_256(x2_2,*(W45_256),&tmpre,&tmpim); + cmac_256(x3_2,*(W15_256),&tmpre,&tmpim); + cmac_256(x4_2,*(W35_256),&tmpre,&tmpim); + *(y2) = cpack_256(tmpre,tmpim); + *(y2) = _mm256_adds_epi16(*(x0),*(y2)); + + cmult_256(x1_2,*(W35_256),&tmpre,&tmpim); + cmac_256(x2_2,*(W15_256),&tmpre,&tmpim); + cmac_256(x3_2,*(W45_256),&tmpre,&tmpim); + cmac_256(x4_2,*(W25_256),&tmpre,&tmpim); + *(y3) = cpack_256(tmpre,tmpim); + *(y3) = _mm256_adds_epi16(*(x0),*(y3)); + + cmult_256(x1_2,*(W45_256),&tmpre,&tmpim); + cmac_256(x2_2,*(W35_256),&tmpre,&tmpim); + cmac_256(x3_2,*(W25_256),&tmpre,&tmpim); + cmac_256(x4_2,*(W15_256),&tmpre,&tmpim); + *(y4) = cpack_256(tmpre,tmpim); + *(y4) = _mm256_adds_epi16(*(x0),*(y4)); + + +} +#endif + #elif defined(__arm__) static inline void bfly5(int16x8_t *x0, int16x8_t *x1, int16x8_t *x2, int16x8_t *x3,int16x8_t *x4, int16x8_t *y0, int16x8_t *y1, int16x8_t *y2, int16x8_t *y3,int16x8_t *y4, @@ -1265,6 +1808,43 @@ static inline void bfly5_tw1(__m128i *x0, __m128i *x1, __m128i *x2, __m128i *x3, *(y4) = _mm_adds_epi16(*(x0),*(y4)); } +#ifdef __AVX2__ +static inline void bfly5_tw1_256(__m256i *x0, __m256i *x1, __m256i *x2, __m256i *x3,__m256i *x4, + __m256i *y0, __m256i *y1, __m256i *y2, __m256i *y3,__m256i *y4) __attribute__((always_inline)); + +static inline void bfly5_tw1_256(__m256i *x0, __m256i *x1, __m256i *x2, __m256i *x3,__m256i *x4, + __m256i *y0, __m256i *y1, __m256i *y2, __m256i *y3,__m256i *y4) +{ + + __m256i tmpre,tmpim; + + *(y0) = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(*(x1),_mm256_adds_epi16(*(x2),_mm256_adds_epi16(*(x3),*(x4))))); + cmult_256(*(x1),*(W15_256),&tmpre,&tmpim); + cmac_256(*(x2),*(W25_256),&tmpre,&tmpim); + cmac_256(*(x3),*(W35_256),&tmpre,&tmpim); + cmac_256(*(x4),*(W45_256),&tmpre,&tmpim); + *(y1) = cpack_256(tmpre,tmpim); + *(y1) = _mm256_adds_epi16(*(x0),*(y1)); + cmult_256(*(x1),*(W25_256),&tmpre,&tmpim); + cmac_256(*(x2),*(W45_256),&tmpre,&tmpim); + cmac_256(*(x3),*(W15_256),&tmpre,&tmpim); + cmac_256(*(x4),*(W35_256),&tmpre,&tmpim); + *(y2) = cpack_256(tmpre,tmpim); + *(y2) = _mm256_adds_epi16(*(x0),*(y2)); + cmult_256(*(x1),*(W35_256),&tmpre,&tmpim); + cmac_256(*(x2),*(W15_256),&tmpre,&tmpim); + cmac_256(*(x3),*(W45_256),&tmpre,&tmpim); + cmac_256(*(x4),*(W25_256),&tmpre,&tmpim); + *(y3) = cpack_256(tmpre,tmpim); + *(y3) = _mm256_adds_epi16(*(x0),*(y3)); + cmult_256(*(x1),*(W45_256),&tmpre,&tmpim); + cmac_256(*(x2),*(W35_256),&tmpre,&tmpim); + cmac_256(*(x3),*(W25_256),&tmpre,&tmpim); + cmac_256(*(x4),*(W15_256),&tmpre,&tmpim); + *(y4) = cpack_256(tmpre,tmpim); + *(y4) = _mm256_adds_epi16(*(x0),*(y4)); +} +#endif #elif defined(__arm__) static inline void bfly5_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *x2, int16x8_t *x3,int16x8_t *x4, int16x8_t *y0, int16x8_t *y1, int16x8_t *y2, int16x8_t *y3,int16x8_t *y4) __attribute__((always_inline)); @@ -1347,19 +1927,47 @@ static inline void transpose16_ooff(__m128i *x,__m128i *y,int off) register __m128i ytmp0,ytmp1,ytmp2,ytmp3; __m128i *y2=y; - ytmp0 = _mm_unpacklo_epi32(x[0],x[1]); - ytmp1 = _mm_unpackhi_epi32(x[0],x[1]); - ytmp2 = _mm_unpacklo_epi32(x[2],x[3]); - ytmp3 = _mm_unpackhi_epi32(x[2],x[3]); - *y2 = _mm_unpacklo_epi64(ytmp0,ytmp2); + ytmp0 = _mm_unpacklo_epi32(x[0],x[1]); // x00 x10 x01 x11 + ytmp1 = _mm_unpackhi_epi32(x[0],x[1]); // x02 x12 x03 x13 + ytmp2 = _mm_unpacklo_epi32(x[2],x[3]); // x20 x30 x21 x31 + ytmp3 = _mm_unpackhi_epi32(x[2],x[3]); // x22 x32 x23 x33 + *y2 = _mm_unpacklo_epi64(ytmp0,ytmp2); // x00 x10 x20 x30 y2+=off; - *y2 = _mm_unpackhi_epi64(ytmp0,ytmp2); + *y2 = _mm_unpackhi_epi64(ytmp0,ytmp2); // x01 x11 x21 x31 y2+=off; - *y2 = _mm_unpacklo_epi64(ytmp1,ytmp3); + *y2 = _mm_unpacklo_epi64(ytmp1,ytmp3); // x02 x12 x22 x32 y2+=off; - *y2 = _mm_unpackhi_epi64(ytmp1,ytmp3); + *y2 = _mm_unpackhi_epi64(ytmp1,ytmp3); // x03 x13 x23 x33 } +#ifdef __AVX2__ + +static inline void transpose16_ooff_simd256(__m256i *x,__m256i *y,int off) __attribute__((always_inline)); +static inline void transpose16_ooff_simd256(__m256i *x,__m256i *y,int off) +{ + register __m256i ytmp0,ytmp1,ytmp2,ytmp3,ytmp4,ytmp5,ytmp6,ytmp7; + __m256i *y2=y; + __m256i const perm_mask = _mm256_set_epi32(7, 3, 6, 2, 5, 1, 4, 0); + + ytmp0 = _mm256_permutevar8x32_epi32(x[0],perm_mask); // x00 x10 x01 x11 x02 x12 x03 x13 + ytmp1 = _mm256_permutevar8x32_epi32(x[1],perm_mask); // x20 x30 x21 x31 x22 x32 x23 x33 + ytmp2 = _mm256_permutevar8x32_epi32(x[2],perm_mask); // x40 x50 x41 x51 x42 x52 x43 x53 + ytmp3 = _mm256_permutevar8x32_epi32(x[3],perm_mask); // x60 x70 x61 x71 x62 x72 x63 x73 + ytmp4 = _mm256_unpacklo_epi64(ytmp0,ytmp1); // x00 x10 x20 x30 x01 x11 x21 x31 + ytmp5 = _mm256_unpackhi_epi64(ytmp0,ytmp1); // x02 x12 x22 x32 x03 x13 x23 x33 + ytmp6 = _mm256_unpacklo_epi64(ytmp2,ytmp3); // x40 x50 x60 x70 x41 x51 x61 x71 + ytmp7 = _mm256_unpackhi_epi64(ytmp2,ytmp3); // x42 x52 x62 x72 x43 x53 x63 x73 + + *y2 = _mm256_insertf128_si256(ytmp4,_mm256_extracti128_si256(ytmp6,0),1); //x00 x10 x20 x30 x40 x50 x60 x70 + y2+=off; + *y2 = _mm256_insertf128_si256(ytmp6,_mm256_extracti128_si256(ytmp4,1),0); //x01 x11 x21 x31 x41 x51 x61 x71 + y2+=off; + *y2 = _mm256_insertf128_si256(ytmp5,_mm256_extracti128_si256(ytmp7,0),1); //x00 x10 x20 x30 x40 x50 x60 x70 + y2+=off; + *y2 = _mm256_insertf128_si256(ytmp7,_mm256_extracti128_si256(ytmp5,1),0); //x01 x11 x21 x31 x41 x51 x61 x71 +} +#endif + #elif defined(__arm__) static inline void transpose16_ooff(int16x8_t *x,int16x8_t *y,int off) __attribute__((always_inline)); @@ -1388,7 +1996,29 @@ static inline void transpose4_ooff(__m64 *x,__m64 *y,int off) { y[0] = _mm_unpacklo_pi32(x[0],x[1]); y[off] = _mm_unpackhi_pi32(x[0],x[1]); + + // x[0] = [x0 x1] + // x[1] = [x2 x3] + // y[0] = [x0 x2] + // y[off] = [x1 x3] } +#ifdef __AVX2__ +static inline void transpose4_ooff_simd256(__m256i *x,__m256i *y,int off)__attribute__((always_inline)); +static inline void transpose4_ooff_simd256(__m256i *x,__m256i *y,int off) +{ + __m256i const perm_mask = _mm256_set_epi32(7, 5, 3, 1, 6, 4, 2, 0); + __m256i perm_tmp0,perm_tmp1; + + // x[0] = [x0 x1 x2 x3 x4 x5 x6 x7] + // x[1] = [x8 x9 x10 x11 x12 x13 x14] + // y[0] = [x0 x2 x4 x6 x8 x10 x12 x14] + // y[off] = [x1 x3 x5 x7 x9 x11 x13 x15] + perm_tmp0 = _mm256_permutevar8x32_epi32(x[0],perm_mask); + perm_tmp1 = _mm256_permutevar8x32_epi32(x[1],perm_mask); + y[0] = _mm256_insertf128_si256(perm_tmp0,_mm256_extracti128_si256(perm_tmp1,0),1); + y[off] = _mm256_insertf128_si256(perm_tmp1,_mm256_extracti128_si256(perm_tmp0,1),0); +} +#endif #elif (__arm__) static inline void transpose4_ooff(int16x4_t *x,int16x4_t *y,int off)__attribute__((always_inline)); @@ -1404,26 +2034,46 @@ static inline void transpose4_ooff(int16x4_t *x,int16x4_t *y,int off) // 16-point optimized DFT kernel -int16_t tw16[24] __attribute__((aligned(16))) = { 32767,0,30272,-12540,23169 ,-23170,12539 ,-30273, +int16_t tw16[24] __attribute__((aligned(32))) = { 32767,0,30272,-12540,23169 ,-23170,12539 ,-30273, 32767,0,23169,-23170,0 ,-32767,-23170,-23170, 32767,0,12539,-30273,-23170,-23170,-30273,12539 }; -int16_t tw16a[24] __attribute__((aligned(16))) = {32767,0,30272,12540,23169 ,23170,12539 ,30273, +int16_t tw16a[24] __attribute__((aligned(32))) = {32767,0,30272,12540,23169 ,23170,12539 ,30273, 32767,0,23169,23170,0 ,32767,-23170,23170, 32767,0,12539,30273,-23170,23170,-30273,-12539 }; -int16_t tw16b[24] __attribute__((aligned(16))) = { 0,32767,-12540,30272,-23170,23169 ,-30273,12539, +int16_t tw16b[24] __attribute__((aligned(32))) = { 0,32767,-12540,30272,-23170,23169 ,-30273,12539, 0,32767,-23170,23169,-32767,0 ,-23170,-23170, 0,32767,-30273,12539,-23170,-23170,12539 ,-30273 }; -int16_t tw16c[24] __attribute__((aligned(16))) = { 0,32767,12540,30272,23170,23169 ,30273 ,12539, +int16_t tw16c[24] __attribute__((aligned(32))) = { 0,32767,12540,30272,23170,23169 ,30273 ,12539, 0,32767,23170,23169,32767,0 ,23170 ,-23170, 0,32767,30273,12539,23170,-23170,-12539,-30273 }; +int16_t tw16rep[48] __attribute__((aligned(32))) = { 32767,0,30272,-12540,23169 ,-23170,12539 ,-30273,32767,0,30272,-12540,23169 ,-23170,12539 ,-30273, + 32767,0,23169,-23170,0 ,-32767,-23170,-23170,32767,0,23169,-23170,0 ,-32767,-23170,-23170, + 32767,0,12539,-30273,-23170,-23170,-30273,12539,32767,0,12539,-30273,-23170,-23170,-30273,12539 + }; + +int16_t tw16arep[48] __attribute__((aligned(32))) = {32767,0,30272,12540,23169 ,23170,12539 ,30273,32767,0,30272,12540,23169 ,23170,12539 ,30273, + 32767,0,23169,23170,0 ,32767,-23170,23170,32767,0,23169,23170,0 ,32767,-23170,23170, + 32767,0,12539,30273,-23170,23170,-30273,-12539,32767,0,12539,30273,-23170,23170,-30273,-12539 + }; + +int16_t tw16brep[48] __attribute__((aligned(32))) = { 0,32767,-12540,30272,-23170,23169 ,-30273,12539,0,32767,-12540,30272,-23170,23169 ,-30273,12539, + 0,32767,-23170,23169,-32767,0 ,-23170,-23170,0,32767,-23170,23169,-32767,0 ,-23170,-23170, + 0,32767,-30273,12539,-23170,-23170,12539 ,-30273,0,32767,-30273,12539,-23170,-23170,12539 ,-30273 + }; + +int16_t tw16crep[48] __attribute__((aligned(32))) = { 0,32767,12540,30272,23170,23169 ,30273 ,12539,0,32767,12540,30272,23170,23169 ,30273 ,12539, + 0,32767,23170,23169,32767,0 ,23170 ,-23170,0,32767,23170,23169,32767,0 ,23170 ,-23170, + 0,32767,30273,12539,23170,-23170,-12539,-30273,0,32767,30273,12539,23170,-23170,-12539,-30273 + }; + static inline void dft16(int16_t *x,int16_t *y) __attribute__((always_inline)); @@ -1437,7 +2087,6 @@ static inline void dft16(int16_t *x,int16_t *y) -#ifndef AVX2 /* This is the original version before unrolling bfly4_tw1(x128,x128+1,x128+2,x128+3, @@ -1496,32 +2145,6 @@ static inline void dft16(int16_t *x,int16_t *y) y128[1] = _mm_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f y128[3] = _mm_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f -#else - - // x02t = _mm_adds_epi16(x128[0],x128[2]); - // x13t = _mm_adds_epi16(x128[1],x128[3]); - - xt = _mm256_adds_epi16(x256[0],x256[1]); - - xtmp0 = _mm_adds_epi16(x02t,x13t); - xtmp2 = _mm_subs_epi16(x02t,x13t); - - x13_flip - x1_flip = _mm_sign_epi16(x128[1],*(__m128i*)conjugatedft); - x1_flip = _mm_shuffle_epi8(x1_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2)); - x3_flip = _mm_sign_epi16(x128[3],*(__m128i*)conjugatedft); - x3_flip = _mm_shuffle_epi8(x3_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2)); - - // x02t = _mm_subs_epi16(x128[0],x128[2]); - // x13t = _mm_subs_epi16(x1_flip,x3_flip); - xt = _mm256_subs_epi16(x256flip0,x256flip1); - - xtmp1 = _mm_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f - xtmp3 = _mm_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f - - -#endif - #elif defined(__arm__) int16x8_t *tw16a_128=(int16x8_t *)tw16a,*tw16b_128=(int16x8_t *)tw16b,*x128=(int16x8_t *)x,*y128=(int16x8_t *)y; @@ -1592,6 +2215,90 @@ static inline void dft16(int16_t *x,int16_t *y) #endif } +#if defined(__x86_64__) || defined(__i386__) +#ifdef __AVX2__ +// Does two 16-point DFTS (x[0 .. 15] is 128 LSBs of input vector, x[16..31] is in 128 MSBs) +static inline void dft16_simd256(int16_t *x,int16_t *y) __attribute__((always_inline)); +static inline void dft16_simd256(int16_t *x,int16_t *y) +{ + + __m256i *tw16a_256=(__m256i *)tw16arep,*tw16b_256=(__m256i *)tw16brep,*x256=(__m256i *)x,*y256=(__m256i *)y; + + __m256i x1_flip,x3_flip,x02t,x13t; + __m256i ytmp0,ytmp1,ytmp2,ytmp3,xtmp0,xtmp1,xtmp2,xtmp3; + register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + // First stage : 4 Radix-4 butterflies without input twiddles + + x02t = _mm256_adds_epi16(x256[0],x256[2]); + x13t = _mm256_adds_epi16(x256[1],x256[3]); + xtmp0 = _mm256_adds_epi16(x02t,x13t); + xtmp2 = _mm256_subs_epi16(x02t,x13t); + x1_flip = _mm256_sign_epi16(x256[1],*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(x256[3],*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(x256[0],x256[2]); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + xtmp1 = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + xtmp3 = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + + /* print_shorts256("xtmp0",(int16_t*)&xtmp0); + print_shorts256("xtmp1",(int16_t*)&xtmp1); + print_shorts256("xtmp2",(int16_t*)&xtmp2); + print_shorts256("xtmp3",(int16_t*)&xtmp3);*/ + + ytmp0 = _mm256_unpacklo_epi32(xtmp0,xtmp1); + ytmp1 = _mm256_unpackhi_epi32(xtmp0,xtmp1); + ytmp2 = _mm256_unpacklo_epi32(xtmp2,xtmp3); + ytmp3 = _mm256_unpackhi_epi32(xtmp2,xtmp3); + xtmp0 = _mm256_unpacklo_epi64(ytmp0,ytmp2); + xtmp1 = _mm256_unpackhi_epi64(ytmp0,ytmp2); + xtmp2 = _mm256_unpacklo_epi64(ytmp1,ytmp3); + xtmp3 = _mm256_unpackhi_epi64(ytmp1,ytmp3); + + // Second stage : 4 Radix-4 butterflies with input twiddles + xtmp1 = packed_cmult2_256(xtmp1,tw16a_256[0],tw16b_256[0]); + xtmp2 = packed_cmult2_256(xtmp2,tw16a_256[1],tw16b_256[1]); + xtmp3 = packed_cmult2_256(xtmp3,tw16a_256[2],tw16b_256[2]); + + /* print_shorts256("xtmp0",(int16_t*)&xtmp0); + print_shorts256("xtmp1",(int16_t*)&xtmp1); + print_shorts256("xtmp2",(int16_t*)&xtmp2); + print_shorts256("xtmp3",(int16_t*)&xtmp3);*/ + + x02t = _mm256_adds_epi16(xtmp0,xtmp2); + x13t = _mm256_adds_epi16(xtmp1,xtmp3); + ytmp0 = _mm256_adds_epi16(x02t,x13t); + ytmp2 = _mm256_subs_epi16(x02t,x13t); + x1_flip = _mm256_sign_epi16(xtmp1,*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(xtmp3,*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(xtmp0,xtmp2); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + ytmp1 = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + ytmp3 = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + + + // [y0 y1 y2 y3 y16 y17 y18 y19] + // [y4 y5 y6 y7 y20 y21 y22 y23] + // [y8 y9 y10 y11 y24 y25 y26 y27] + // [y12 y13 y14 y15 y28 y29 y30 y31] + + y256[0] = _mm256_insertf128_si256(ytmp0,_mm256_extracti128_si256(ytmp1,0),1); + y256[1] = _mm256_insertf128_si256(ytmp2,_mm256_extracti128_si256(ytmp3,0),1); + y256[2] = _mm256_insertf128_si256(ytmp1,_mm256_extracti128_si256(ytmp0,1),0); + y256[3] = _mm256_insertf128_si256(ytmp3,_mm256_extracti128_si256(ytmp2,1),0); + + // [y0 y1 y2 y3 y4 y5 y6 y7] + // [y8 y9 y10 y11 y12 y13 y14 y15] + // [y16 y17 y18 y19 y20 y21 y22 y23] + // [y24 y25 y26 y27 y28 y29 y30 y31] +} + +#endif +#endif static inline void idft16(int16_t *x,int16_t *y) __attribute__((always_inline)); static inline void idft16(int16_t *x,int16_t *y) @@ -1723,27 +2430,193 @@ static inline void idft16(int16_t *x,int16_t *y) #endif } +#if defined(__x86_64__) || defined(__i386__) +#ifdef __AVX2__ +// Does two 16-point IDFTS (x[0 .. 15] is 128 LSBs of input vector, x[16..31] is in 128 MSBs) +static inline void idft16_simd256(int16_t *x,int16_t *y) __attribute__((always_inline)); +static inline void idft16_simd256(int16_t *x,int16_t *y) +{ + + __m256i *tw16a_256=(__m256i *)tw16arep,*tw16b_256=(__m256i *)tw16brep,*x256=(__m256i *)x,*y256=(__m256i *)y; + register __m256i x1_flip,x3_flip,x02t,x13t; + register __m256i ytmp0,ytmp1,ytmp2,ytmp3,xtmp0,xtmp1,xtmp2,xtmp3; + register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + // First stage : 4 Radix-4 butterflies without input twiddles + + x02t = _mm256_adds_epi16(x256[0],x256[2]); + x13t = _mm256_adds_epi16(x256[1],x256[3]); + xtmp0 = _mm256_adds_epi16(x02t,x13t); + xtmp2 = _mm256_subs_epi16(x02t,x13t); + x1_flip = _mm256_sign_epi16(x256[1],*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(x256[3],*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(x256[0],x256[2]); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + xtmp3 = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + xtmp1 = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + + ytmp0 = _mm256_unpacklo_epi32(xtmp0,xtmp1); + ytmp1 = _mm256_unpackhi_epi32(xtmp0,xtmp1); + ytmp2 = _mm256_unpacklo_epi32(xtmp2,xtmp3); + ytmp3 = _mm256_unpackhi_epi32(xtmp2,xtmp3); + xtmp0 = _mm256_unpacklo_epi64(ytmp0,ytmp2); + xtmp1 = _mm256_unpackhi_epi64(ytmp0,ytmp2); + xtmp2 = _mm256_unpacklo_epi64(ytmp1,ytmp3); + xtmp3 = _mm256_unpackhi_epi64(ytmp1,ytmp3); + + // Second stage : 4 Radix-4 butterflies with input twiddles + xtmp1 = packed_cmult2_256(xtmp1,tw16a_256[0],tw16b_256[0]); + xtmp2 = packed_cmult2_256(xtmp2,tw16a_256[1],tw16b_256[1]); + xtmp3 = packed_cmult2_256(xtmp3,tw16a_256[2],tw16b_256[2]); + + x02t = _mm256_adds_epi16(xtmp0,xtmp2); + x13t = _mm256_adds_epi16(xtmp1,xtmp3); + y256[0] = _mm256_adds_epi16(x02t,x13t); + y256[2] = _mm256_subs_epi16(x02t,x13t); + x1_flip = _mm256_sign_epi16(xtmp1,*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(xtmp3,*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(xtmp0,xtmp2); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + y256[3] = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + y256[1] = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + + // [y0 y1 y2 y3 y16 y17 y18 y19] + // [y4 y5 y6 y7 y20 y21 y22 y23] + // [y8 y9 y10 y11 y24 y25 y26 y27] + // [y12 y13 y14 y15 y28 y29 y30 y31] + + y256[0] = _mm256_insertf128_si256(ytmp0,_mm256_extracti128_si256(ytmp1,0),1); + y256[1] = _mm256_insertf128_si256(ytmp2,_mm256_extracti128_si256(ytmp3,0),1); + y256[2] = _mm256_insertf128_si256(ytmp1,_mm256_extracti128_si256(ytmp0,1),0); + y256[3] = _mm256_insertf128_si256(ytmp3,_mm256_extracti128_si256(ytmp2,1),0); + +} +#endif +#endif // 64-point optimized DFT -int16_t tw64[96] __attribute__((aligned(16))) = { 32767,0,32609,-3212,32137,-6393,31356,-9512,30272,-12540,28897,-15447,27244,-18205,25329,-20788,23169,-23170,20787,-25330,18204,-27245,15446,-28898,12539,-30273,9511,-31357,6392,-32138,3211,-32610, - 32767,0,32137,-6393,30272,-12540,27244,-18205,23169,-23170,18204,-27245,12539,-30273,6392,-32138,0,-32767,-6393,-32138,-12540,-30273,-18205,-27245,-23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393, - 32767,0,31356,-9512,27244,-18205,20787,-25330,12539,-30273,3211,-32610,-6393,-32138,-15447,-28898,-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211,-30273,12539,-25330,20787,-18205,27244,-9512,31356 +int16_t tw64[96] __attribute__((aligned(32))) = { +32767,0,32609,-3212,32137,-6393,31356,-9512, +30272,-12540,28897,-15447,27244,-18205,25329,-20788, +23169,-23170,20787,-25330,18204,-27245,15446,-28898, +12539,-30273,9511,-31357,6392,-32138,3211,-32610, +32767,0,32137,-6393,30272,-12540,27244,-18205, +23169,-23170,18204,-27245,12539,-30273,6392,-32138, +0,-32767,-6393,-32138,-12540,-30273,-18205,-27245, +-23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393, +32767,0,31356,-9512,27244,-18205,20787,-25330, +12539,-30273,3211,-32610,-6393,-32138,-15447,-28898, +-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211, +-30273,12539,-25330,20787,-18205,27244,-9512,31356 }; -int16_t tw64a[96] __attribute__((aligned(16))) = { 32767,0,32609,3212,32137,6393,31356,9512,30272,12540,28897,15447,27244,18205,25329,20788,23169,23170,20787,25330,18204,27245,15446,28898,12539,30273,9511,31357,6392,32138,3211,32610, - 32767,0,32137,6393,30272,12540,27244,18205,23169,23170,18204,27245,12539,30273,6392,32138,0,32767,-6393,32138,-12540,30273,-18205,27245,-23170,23170,-27245,18205,-30273,12540,-32138,6393, - 32767,0,31356,9512,27244,18205,20787,25330,12539,30273,3211,32610,-6393,32138,-15447,28898,-23170,23170,-28898,15447,-32138,6393,-32610,-3211,-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356 +int16_t tw64rep[192] __attribute__((aligned(32))) = { +32767,0,32609,-3212,32137,-6393,31356,-9512,32767,0,32609,-3212,32137,-6393,31356,-9512, +30272,-12540,28897,-15447,27244,-18205,25329,-20788,30272,-12540,28897,-15447,27244,-18205,25329,-20788, +23169,-23170,20787,-25330,18204,-27245,15446,-28898,23169,-23170,20787,-25330,18204,-27245,15446,-28898, +12539,-30273,9511,-31357,6392,-32138,3211,-32610,12539,-30273,9511,-31357,6392,-32138,3211,-32610, +32767,0,32137,-6393,30272,-12540,27244,-18205,32767,0,32137,-6393,30272,-12540,27244,-18205, +23169,-23170,18204,-27245,12539,-30273,6392,-32138,23169,-23170,18204,-27245,12539,-30273,6392,-32138, +0,-32767,-6393,-32138,-12540,-30273,-18205,-27245,0,-32767,-6393,-32138,-12540,-30273,-18205,-27245, +-23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393,-23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393, +32767,0,31356,-9512,27244,-18205,20787,-25330,32767,0,31356,-9512,27244,-18205,20787,-25330, +12539,-30273,3211,-32610,-6393,-32138,-15447,-28898,12539,-30273,3211,-32610,-6393,-32138,-15447,-28898, +-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211,-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211, +-30273,12539,-25330,20787,-18205,27244,-9512,31356,-30273,12539,-25330,20787,-18205,27244,-9512,31356 + }; + +int16_t tw64a[96] __attribute__((aligned(32))) = { +32767,0,32609,3212,32137,6393,31356,9512, +30272,12540,28897,15447,27244,18205,25329,20788, +23169,23170,20787,25330,18204,27245,15446,28898, +12539,30273,9511,31357,6392,32138,3211,32610, +32767,0,32137,6393,30272,12540,27244,18205, +23169,23170,18204,27245,12539,30273,6392,32138, +0,32767,-6393,32138,-12540,30273,-18205,27245, +-23170,23170,-27245,18205,-30273,12540,-32138,6393, +32767,0,31356,9512,27244,18205,20787,25330, +12539,30273,3211,32610,-6393,32138,-15447,28898, +-23170,23170,-28898,15447,-32138,6393,-32610,-3211, +-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356 + }; +int16_t tw64arep[192] __attribute__((aligned(32))) = { +32767,0,32609,3212,32137,6393,31356,9512,32767,0,32609,3212,32137,6393,31356,9512, +30272,12540,28897,15447,27244,18205,25329,20788,30272,12540,28897,15447,27244,18205,25329,20788, +23169,23170,20787,25330,18204,27245,15446,28898,23169,23170,20787,25330,18204,27245,15446,28898, +12539,30273,9511,31357,6392,32138,3211,32610,12539,30273,9511,31357,6392,32138,3211,32610, +32767,0,32137,6393,30272,12540,27244,18205,32767,0,32137,6393,30272,12540,27244,18205, +23169,23170,18204,27245,12539,30273,6392,32138,23169,23170,18204,27245,12539,30273,6392,32138, +0,32767,-6393,32138,-12540,30273,-18205,27245,0,32767,-6393,32138,-12540,30273,-18205,27245, +-23170,23170,-27245,18205,-30273,12540,-32138,6393,-23170,23170,-27245,18205,-30273,12540,-32138,6393, +32767,0,31356,9512,27244,18205,20787,25330,32767,0,31356,9512,27244,18205,20787,25330, +12539,30273,3211,32610,-6393,32138,-15447,28898,12539,30273,3211,32610,-6393,32138,-15447,28898, +-23170,23170,-28898,15447,-32138,6393,-32610,-3211,-23170,23170,-28898,15447,-32138,6393,-32610,-3211, +-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356,-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356 }; -int16_t tw64b[96] __attribute__((aligned(16))) = { 0,32767,-3212,32609,-6393,32137,-9512,31356,-12540,30272,-15447,28897,-18205,27244,-20788,25329,-23170,23169,-25330,20787,-27245,18204,-28898,15446,-30273,12539,-31357,9511,-32138,6392,-32610,3211, - 0,32767,-6393,32137,-12540,30272,-18205,27244,-23170,23169,-27245,18204,-30273,12539,-32138,6392,-32767,0,-32138,-6393,-30273,-12540,-27245,-18205,-23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138, - 0,32767,-9512,31356,-18205,27244,-25330,20787,-30273,12539,-32610,3211,-32138,-6393,-28898,-15447,-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610,12539,-30273,20787,-25330,27244,-18205,31356,-9512 +int16_t tw64b[96] __attribute__((aligned(32))) = { +0,32767,-3212,32609,-6393,32137,-9512,31356, +-12540,30272,-15447,28897,-18205,27244,-20788,25329, +-23170,23169,-25330,20787,-27245,18204,-28898,15446, +-30273,12539,-31357,9511,-32138,6392,-32610,3211, +0,32767,-6393,32137,-12540,30272,-18205,27244, +-23170,23169,-27245,18204,-30273,12539,-32138,6392, +-32767,0,-32138,-6393,-30273,-12540,-27245,-18205, +-23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138, +0,32767,-9512,31356,-18205,27244,-25330,20787, +-30273,12539,-32610,3211,-32138,-6393,-28898,-15447, +-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610, +12539,-30273,20787,-25330,27244,-18205,31356,-9512 }; -int16_t tw64c[96] __attribute__((aligned(16))) = { 0,32767,3212,32609,6393,32137,9512,31356,12540,30272,15447,28897,18205,27244,20788,25329,23170,23169,25330,20787,27245,18204,28898,15446,30273,12539,31357,9511,32138,6392,32610,3211, - 0,32767,6393,32137,12540,30272,18205,27244,23170,23169,27245,18204,30273,12539,32138,6392,32767,0,32138,-6393,30273,-12540,27245,-18205,23170,-23170,18205,-27245,12540,-30273,6393,-32138, - 0,32767,9512,31356,18205,27244,25330,20787,30273,12539,32610,3211,32138,-6393,28898,-15447,23170,-23170,15447,-28898,6393,-32138,-3211,-32610,-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512 +int16_t tw64brep[192] __attribute__((aligned(32))) = { +0,32767,-3212,32609,-6393,32137,-9512,31356,0,32767,-3212,32609,-6393,32137,-9512,31356, +-12540,30272,-15447,28897,-18205,27244,-20788,25329,-12540,30272,-15447,28897,-18205,27244,-20788,25329, +-23170,23169,-25330,20787,-27245,18204,-28898,15446,-23170,23169,-25330,20787,-27245,18204,-28898,15446, +-30273,12539,-31357,9511,-32138,6392,-32610,3211,-30273,12539,-31357,9511,-32138,6392,-32610,3211, +0,32767,-6393,32137,-12540,30272,-18205,27244,0,32767,-6393,32137,-12540,30272,-18205,27244, +-23170,23169,-27245,18204,-30273,12539,-32138,6392,-23170,23169,-27245,18204,-30273,12539,-32138,6392, +-32767,0,-32138,-6393,-30273,-12540,-27245,-18205,-32767,0,-32138,-6393,-30273,-12540,-27245,-18205, +-23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138,-23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138, +0,32767,-9512,31356,-18205,27244,-25330,20787,0,32767,-9512,31356,-18205,27244,-25330,20787, +-30273,12539,-32610,3211,-32138,-6393,-28898,-15447,-30273,12539,-32610,3211,-32138,-6393,-28898,-15447, +-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610,-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610, +12539,-30273,20787,-25330,27244,-18205,31356,-9512,12539,-30273,20787,-25330,27244,-18205,31356,-9512 + }; + +int16_t tw64c[96] __attribute__((aligned(32))) = { +0,32767,3212,32609,6393,32137,9512,31356, +12540,30272,15447,28897,18205,27244,20788,25329, +23170,23169,25330,20787,27245,18204,28898,15446, +30273,12539,31357,9511,32138,6392,32610,3211, +0,32767,6393,32137,12540,30272,18205,27244, +23170,23169,27245,18204,30273,12539,32138,6392, +32767,0,32138,-6393,30273,-12540,27245,-18205, +23170,-23170,18205,-27245,12540,-30273,6393,-32138, +0,32767,9512,31356,18205,27244,25330,20787, +30273,12539,32610,3211,32138,-6393,28898,-15447, +23170,-23170,15447,-28898,6393,-32138,-3211,-32610, +-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512 + }; + +int16_t tw64crep[192] __attribute__((aligned(32))) = { +0,32767,3212,32609,6393,32137,9512,31356,0,32767,3212,32609,6393,32137,9512,31356, +12540,30272,15447,28897,18205,27244,20788,25329,12540,30272,15447,28897,18205,27244,20788,25329, +23170,23169,25330,20787,27245,18204,28898,15446,23170,23169,25330,20787,27245,18204,28898,15446, +30273,12539,31357,9511,32138,6392,32610,3211,30273,12539,31357,9511,32138,6392,32610,3211, +0,32767,6393,32137,12540,30272,18205,27244,0,32767,6393,32137,12540,30272,18205,27244, +23170,23169,27245,18204,30273,12539,32138,6392,23170,23169,27245,18204,30273,12539,32138,6392, +32767,0,32138,-6393,30273,-12540,27245,-18205,32767,0,32138,-6393,30273,-12540,27245,-18205, +23170,-23170,18205,-27245,12540,-30273,6393,-32138,23170,-23170,18205,-27245,12540,-30273,6393,-32138, +0,32767,9512,31356,18205,27244,25330,20787,0,32767,9512,31356,18205,27244,25330,20787, +30273,12539,32610,3211,32138,-6393,28898,-15447,30273,12539,32610,3211,32138,-6393,28898,-15447, +23170,-23170,15447,-28898,6393,-32138,-3211,-32610,23170,-23170,15447,-28898,6393,-32138,-3211,-32610, +-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512,-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512 }; @@ -1753,6 +2626,12 @@ int16_t tw64c[96] __attribute__((aligned(16))) = { 0,32767,3212,32609,6393,32137 #define shiftright_int16(a,shift) _mm_srai_epi16(a,shift) #define set1_int16(a) _mm_set1_epi16(a); #define mulhi_int16(a,b) _mm_slli_epi16(_mm_mulhi_epi16(a,b),1); +#ifdef __AVX2__ +#define simd256_q15_t __m256i +#define shiftright_int16_simd256(a,shift) _mm256_srai_epi16(a,shift) +#define set1_int16_simd256(a) _mm256_set1_epi16(a); +#define mulhi_int16_simd256(a,b) _mm256_slli_epi16(_mm256_mulhi_epi16(a,b),1); + #elif defined(__arm__) #define simd_q15_t int16x8_t #define simdshort_q15_t int16x4_t @@ -1761,6 +2640,8 @@ int16_t tw64c[96] __attribute__((aligned(16))) = { 0,32767,3212,32609,6393,32137 #define mulhi_int16(a,b) vqdmulhq_s16(a,b); #define _mm_empty() #define _m_empty() + +#endif #endif void dft64(int16_t *x,int16_t *y,int scale) @@ -1780,18 +2661,41 @@ void dft64(int16_t *x,int16_t *y,int scale) transpose16_ooff(x128,xtmp,4); + // xtmp0 = x00 x10 x20 x30 + // xtmp4 = x01 x11 x21 x31 + // xtmp8 = x02 x12 x22 x32 + // xtmp12 = x03 x13 x23 x33 transpose16_ooff(x128+4,xtmp+1,4); + // xtmp1 = x40 x50 x60 x70 + // xtmp5 = x41 x51 x61 x71 + // xtmp9 = x42 x52 x62 x72 + // xtmp13 = x43 x53 x63 x73 transpose16_ooff(x128+8,xtmp+2,4); + // xtmp2 = x80 x90 xa0 xb0 + // xtmp6 = x41 x51 x61 x71 + // xtmp10 = x82 x92 xa2 xb2 + // xtmp14 = x83 x93 xa3 xb3 transpose16_ooff(x128+12,xtmp+3,4); - + // xtmp3 = xc0 xd0 xe0 xf0 + // xtmp7 = xc1 xd1 xe1 xf1 + // xtmp11 = xc2 xd2 xe2 xf2 + // xtmp15 = xc3 xd3 xe3 xf3 #ifdef D64STATS stop_meas(&ts_t); start_meas(&ts_d); #endif - + // xtmp0 = x00 x10 x20 x30 + // xtmp1 = x40 x50 x60 x70 + // xtmp2 = x80 x90 xa0 xb0 + // xtmp3 = xc0 xd0 xe0 xf0 dft16((int16_t*)(xtmp),(int16_t*)ytmp); + + // xtmp4 = x01 x11 x21 x31 + // xtmp5 = x41 x51 x61 x71 + // xtmp6 = x81 x91 xa1 xb1 + // xtmp7 = xc1 xd1 xe1 xf1 dft16((int16_t*)(xtmp+4),(int16_t*)(ytmp+4)); dft16((int16_t*)(xtmp+8),(int16_t*)(ytmp+8)); dft16((int16_t*)(xtmp+12),(int16_t*)(ytmp+12)); @@ -1853,6 +2757,153 @@ void dft64(int16_t *x,int16_t *y,int scale) } +#ifdef __AVX2__ +void dft64_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[16],ytmp[16],*tw64a_256=(simd256_q15_t *)tw64a,*tw64b_256=(simd256_q15_t *)tw64b,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y; + simd256_q15_t xintl0,xintl1,xintl2,xintl3,xintl4,xintl5,xintl6,xintl7; + simd256_q15_t const perm_mask = _mm256_set_epi32(7, 3, 6, 2, 5, 1, 4, 0); + + +#ifdef D64STATS + time_stats_t ts_t,ts_d,ts_b; + + reset_meas(&ts_t); + reset_meas(&ts_d); + reset_meas(&ts_b); + start_meas(&ts_t); +#endif + +#ifdef D64STATS + stop_meas(&ts_t); + start_meas(&ts_d); +#endif + + print_shorts256("x2560",(int16_t*)x256); + print_shorts256("x2561",(int16_t*)(x256+1)); + print_shorts256("x2562",(int16_t*)(x256+2)); + print_shorts256("x2563",(int16_t*)(x256+3)); + print_shorts256("x2564",(int16_t*)(x256+4)); + print_shorts256("x2565",(int16_t*)(x256+5)); + print_shorts256("x2566",(int16_t*)(x256+6)); + print_shorts256("x2567",(int16_t*)(x256+7)); + + xintl0 = _mm256_permutevar8x32_epi32(x256[0],perm_mask); // x0 x4 x1 x5 x2 x6 x3 x7 + xintl1 = _mm256_permutevar8x32_epi32(x256[1],perm_mask); // x8 x12 x9 x13 x10 x14 x11 x15 + xintl2 = _mm256_permutevar8x32_epi32(x256[2],perm_mask); // x16 x20 x17 x21 x18 x22 x19 x23 + xintl3 = _mm256_permutevar8x32_epi32(x256[3],perm_mask); // x24 x28 x25 x29 x26 x30 x27 x31 + xintl4 = _mm256_permutevar8x32_epi32(x256[4],perm_mask); // x32 x28 x25 x29 x26 x30 x27 x31 + xintl5 = _mm256_permutevar8x32_epi32(x256[5],perm_mask); // x40 x28 x25 x29 x26 x30 x27 x31 + xintl6 = _mm256_permutevar8x32_epi32(x256[6],perm_mask); // x48 x28 x25 x29 x26 x30 x27 x31 + xintl7 = _mm256_permutevar8x32_epi32(x256[7],perm_mask); // x56 x28 x25 x29 x26 x30 x27 x31 + + print_shorts256("xintl0",(int16_t*)&xintl0); + print_shorts256("xintl1",(int16_t*)&xintl1); + print_shorts256("xintl2",(int16_t*)&xintl2); + print_shorts256("xintl3",(int16_t*)&xintl3); + print_shorts256("xintl4",(int16_t*)&xintl4); + print_shorts256("xintl5",(int16_t*)&xintl5); + print_shorts256("xintl6",(int16_t*)&xintl6); + print_shorts256("xintl7",(int16_t*)&xintl7); + + xtmp[0] = _mm256_unpacklo_epi64(xintl0,xintl1); // x0 x4 x8 x12 x1 x5 x9 x13 + xtmp[4] = _mm256_unpackhi_epi64(xintl0,xintl1); // x2 x6 x10 x14 x3 x7 x11 x15 + xtmp[1] = _mm256_unpacklo_epi64(xintl2,xintl3); // x16 x20 x24 x28 x17 x21 x25 x29 + xtmp[5] = _mm256_unpackhi_epi64(xintl2,xintl3); // x18 x22 x26 x30 x19 x23 x27 x31 + xtmp[2] = _mm256_unpacklo_epi64(xintl4,xintl5); // x32 x36 x40 x44 x33 x37 x41 x45 + xtmp[6] = _mm256_unpackhi_epi64(xintl4,xintl5); // x34 x38 x42 x46 x35 x39 x43 x47 + xtmp[3] = _mm256_unpacklo_epi64(xintl6,xintl7); // x48 x52 x56 x60 x49 x53 x57 x61 + xtmp[7] = _mm256_unpackhi_epi64(xintl6,xintl7); // x50 x54 x58 x62 x51 x55 x59 x63 + + print_shorts256("xtmp0",(int16_t*)xtmp); + print_shorts256("xtmp1",(int16_t*)(xtmp+1)); + print_shorts256("xtmp2",(int16_t*)(xtmp+2)); + print_shorts256("xtmp3",(int16_t*)(xtmp+3)); + print_shorts256("xtmp4",(int16_t*)(xtmp+4)); + print_shorts256("xtmp5",(int16_t*)(xtmp+5)); + print_shorts256("xtmp6",(int16_t*)(xtmp+6)); + print_shorts256("xtmp7",(int16_t*)(xtmp+7)); + + dft16_simd256((int16_t*)(xtmp),(int16_t*)ytmp); + // [y0 y1 y2 y3 y4 y5 y6 y7] + // [y8 y9 y10 y11 y12 y13 y14 y15] + // [y16 y17 y18 y19 y20 y21 y22 y23] + // [y24 y25 y26 y27 y28 y29 y30 y31] + + print_shorts256("ytmp0",(int16_t*)ytmp); + print_shorts256("ytmp1",(int16_t*)(ytmp+1)); + print_shorts256("ytmp2",(int16_t*)(ytmp+2)); + print_shorts256("ytmp3",(int16_t*)(ytmp+3)); + + dft16_simd256((int16_t*)(xtmp+4),(int16_t*)(ytmp+4)); + // [y32 y33 y34 y35 y36 y37 y38 y39] + // [y40 y41 y42 y43 y44 y45 y46 y47] + // [y48 y49 y50 y51 y52 y53 y54 y55] + // [y56 y57 y58 y59 y60 y61 y62 y63] + + print_shorts256("ytmp4",(int16_t*)(ytmp+4)); + print_shorts256("ytmp5",(int16_t*)(ytmp+5)); + print_shorts256("ytmp6",(int16_t*)(ytmp+6)); + print_shorts256("ytmp7",(int16_t*)(ytmp+7)); +#ifdef D64STATS + stop_meas(&ts_d); + start_meas(&ts_b); +#endif + + + bfly4_16_256(ytmp,ytmp+2,ytmp+4,ytmp+6, + y256,y256+2,y256+4,y256+6, + tw64a_256,tw64a_256+2,tw64a_256+4, + tw64b_256,tw64b_256+2,tw64b_256+4); + // [y0 y1 y2 y3 y4 y5 y6 y7] + // [y16 y17 y18 y19 y20 y21 y22 y23] + // [y32 y33 y34 y35 y36 y37 y38 y39] + // [y48 y49 y50 y51 y52 y53 y54 y55] + + bfly4_16_256(ytmp+1,ytmp+3,ytmp+5,ytmp+7, + y256+1,y256+3,y256+5,y256+7, + tw64a_256+1,tw64a_256+3,tw64a_256+5, + tw64b_256+1,tw64b_256+3,tw64b_256+5); + // [y8 y9 y10 y11 y12 y13 y14 y15] + // [y24 y25 y26 y27 y28 y29 y30 y31] + // [y40 y41 y42 y43 y44 y45 y46 y47] + // [y56 y57 y58 y59 y60 y61 y62 y63] + + print_shorts256("y256_0",(int16_t*)&y256[0]); + print_shorts256("y256_1",(int16_t*)&y256[1]); + print_shorts256("y256_2",(int16_t*)&y256[2]); + print_shorts256("y256_3",(int16_t*)&y256[3]); + print_shorts256("y256_4",(int16_t*)&y256[4]); + print_shorts256("y256_5",(int16_t*)&y256[5]); + print_shorts256("y256_6",(int16_t*)&y256[6]); + print_shorts256("y256_7",(int16_t*)&y256[7]); + + +#ifdef D64STATS + stop_meas(&ts_b); + printf("t: %llu cycles, d: %llu cycles, b: %llu cycles\n",ts_t.diff,ts_d.diff,ts_b.diff); +#endif + + + if (scale>0) { + y256[0] = shiftright_int16_simd256(y256[0],3); + y256[1] = shiftright_int16_simd256(y256[1],3); + y256[2] = shiftright_int16_simd256(y256[2],3); + y256[3] = shiftright_int16_simd256(y256[3],3); + y256[4] = shiftright_int16_simd256(y256[4],3); + y256[5] = shiftright_int16_simd256(y256[5],3); + y256[6] = shiftright_int16_simd256(y256[6],3); + y256[7] = shiftright_int16_simd256(y256[7],3); + } + + _mm_empty(); + _m_empty(); + + +} +#endif + void idft64(int16_t *x,int16_t *y,int scale) { @@ -1897,7 +2948,6 @@ void idft64(int16_t *x,int16_t *y,int scale) y128,y128+4,y128+8,y128+12, tw64a_128,tw64a_128+4,tw64a_128+8, tw64b_128,tw64b_128+4,tw64b_128+8); - ibfly4_16(ytmp+1,ytmp+5,ytmp+9,ytmp+13, y128+1,y128+5,y128+9,y128+13, tw64a_128+1,tw64a_128+5,tw64a_128+9, @@ -1945,14 +2995,115 @@ void idft64(int16_t *x,int16_t *y,int scale) } +#ifdef __AVX2__ +void idft64_simd256(int16_t *x,int16_t *y,int scale) +{ -int16_t tw128[128] __attribute__((aligned(16))) = { 32767,0,32727,-1608,32609,-3212,32412,-4808,32137,-6393,31785,-7962,31356,-9512,30851,-11039,30272,-12540,29621,-14010,28897,-15447,28105,-16846,27244,-18205,26318,-19520,25329,-20788,24278,-22005,23169,-23170,22004,-24279,20787,-25330,19519,-26319,18204,-27245,16845,-28106,15446,-28898,14009,-29622,12539,-30273,11038,-30852,9511,-31357,7961,-31786,6392,-32138,4807,-32413,3211,-32610,1607,-32728,0,-32767,-1608,-32728,-3212,-32610,-4808,-32413,-6393,-32138,-7962,-31786,-9512,-31357,-11039,-30852,-12540,-30273,-14010,-29622,-15447,-28898,-16846,-28106,-18205,-27245,-19520,-26319,-20788,-25330,-22005,-24279,-23170,-23170,-24279,-22005,-25330,-20788,-26319,-19520,-27245,-18205,-28106,-16846,-28898,-15447,-29622,-14010,-30273,-12540,-30852,-11039,-31357,-9512,-31786,-7962,-32138,-6393,-32413,-4808,-32610,-3212,-32728,-1608}; + simd256_q15_t xtmp[16],ytmp[16],*tw64a_256=(simd256_q15_t *)tw64,*tw64b_256=(simd256_q15_t *)tw64c,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y; + register simd256_q15_t xintl0,xintl1,xintl2,xintl3,xintl4,xintl5,xintl6,xintl7; + simd256_q15_t const perm_mask = _mm256_set_epi32(7, 3, 6, 2, 5, 1, 4, 0); -int16_t tw128a[128] __attribute__((aligned(16))) = { 32767,0,32727,1608,32609,3212,32412,4808,32137,6393,31785,7962,31356,9512,30851,11039,30272,12540,29621,14010,28897,15447,28105,16846,27244,18205,26318,19520,25329,20788,24278,22005,23169,23170,22004,24279,20787,25330,19519,26319,18204,27245,16845,28106,15446,28898,14009,29622,12539,30273,11038,30852,9511,31357,7961,31786,6392,32138,4807,32413,3211,32610,1607,32728,0,32767,-1608,32728,-3212,32610,-4808,32413,-6393,32138,-7962,31786,-9512,31357,-11039,30852,-12540,30273,-14010,29622,-15447,28898,-16846,28106,-18205,27245,-19520,26319,-20788,25330,-22005,24279,-23170,23170,-24279,22005,-25330,20788,-26319,19520,-27245,18205,-28106,16846,-28898,15447,-29622,14010,-30273,12540,-30852,11039,-31357,9512,-31786,7962,-32138,6393,-32413,4808,-32610,3212,-32728,1608}; -int16_t tw128b[128] __attribute__((aligned(16))) = {0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607,-32767,0,-32728,-1608,-32610,-3212,-32413,-4808,-32138,-6393,-31786,-7962,-31357,-9512,-30852,-11039,-30273,-12540,-29622,-14010,-28898,-15447,-28106,-16846,-27245,-18205,-26319,-19520,-25330,-20788,-24279,-22005,-23170,-23170,-22005,-24279,-20788,-25330,-19520,-26319,-18205,-27245,-16846,-28106,-15447,-28898,-14010,-29622,-12540,-30273,-11039,-30852,-9512,-31357,-7962,-31786,-6393,-32138,-4808,-32413,-3212,-32610,-1608,-32728}; +#ifdef D64STATS + time_stats_t ts_t,ts_d,ts_b; -int16_t tw128c[128] __attribute__((aligned(16))) = {0,32767,1608,32727,3212,32609,4808,32412,6393,32137,7962,31785,9512,31356,11039,30851,12540,30272,14010,29621,15447,28897,16846,28105,18205,27244,19520,26318,20788,25329,22005,24278,23170,23169,24279,22004,25330,20787,26319,19519,27245,18204,28106,16845,28898,15446,29622,14009,30273,12539,30852,11038,31357,9511,31786,7961,32138,6392,32413,4807,32610,3211,32728,1607,32767,0,32728,-1608,32610,-3212,32413,-4808,32138,-6393,31786,-7962,31357,-9512,30852,-11039,30273,-12540,29622,-14010,28898,-15447,28106,-16846,27245,-18205,26319,-19520,25330,-20788,24279,-22005,23170,-23170,22005,-24279,20788,-25330,19520,-26319,18205,-27245,16846,-28106,15447,-28898,14010,-29622,12540,-30273,11039,-30852,9512,-31357,7962,-31786,6393,-32138,4808,-32413,3212,-32610,1608,-32728}; + reset_meas(&ts_t); + reset_meas(&ts_d); + reset_meas(&ts_b); + start_meas(&ts_t); +#endif + +#ifdef D64STATS + stop_meas(&ts_t); + start_meas(&ts_d); +#endif + + xintl0 = _mm256_permutevar8x32_epi32(x256[0],perm_mask); // x0 x4 x1 x5 x2 x6 x3 x7 + xintl1 = _mm256_permutevar8x32_epi32(x256[1],perm_mask); // x8 x12 x9 x13 x10 x14 x11 x15 + xintl2 = _mm256_permutevar8x32_epi32(x256[2],perm_mask); // x16 x20 x17 x21 x18 x22 x19 x23 + xintl3 = _mm256_permutevar8x32_epi32(x256[3],perm_mask); // x24 x28 x25 x29 x26 x30 x27 x31 + xintl4 = _mm256_permutevar8x32_epi32(x256[4],perm_mask); // x24 x28 x25 x29 x26 x30 x27 x31 + xintl5 = _mm256_permutevar8x32_epi32(x256[5],perm_mask); // x24 x28 x25 x29 x26 x30 x27 x31 + xintl6 = _mm256_permutevar8x32_epi32(x256[6],perm_mask); // x24 x28 x25 x29 x26 x30 x27 x31 + xintl7 = _mm256_permutevar8x32_epi32(x256[7],perm_mask); // x24 x28 x25 x29 x26 x30 x27 x31 + + xtmp[0] = _mm256_unpacklo_epi64(xintl0,xintl1); // x0 x4 x8 x12 x1 x5 x9 x13 + xtmp[4] = _mm256_unpackhi_epi64(xintl0,xintl1); // x2 x6 x10 x14 x3 x7 x11 x15 + xtmp[1] = _mm256_unpacklo_epi64(xintl2,xintl3); // x16 x20 x24 x28 x17 x21 x25 x29 + xtmp[5] = _mm256_unpackhi_epi64(xintl2,xintl3); // x18 x22 x26 x30 x19 x23 x27 x31 + xtmp[2] = _mm256_unpacklo_epi64(xintl4,xintl5); // x32 x36 x40 x44 x33 x37 x41 x45 + xtmp[6] = _mm256_unpackhi_epi64(xintl4,xintl5); // x34 x38 x42 x46 x35 x39 x43 x47 + xtmp[3] = _mm256_unpacklo_epi64(xintl6,xintl7); // x48 x52 x56 x60 x49 x53 x57 x61 + xtmp[7] = _mm256_unpackhi_epi64(xintl6,xintl7); // x50 x54 x58 x62 x51 x55 x59 x63 + + + idft16_simd256((int16_t*)(xtmp),(int16_t*)ytmp); + // [y0 y1 y2 y3 y16 y17 y18 y19] + // [y4 y5 y6 y7 y20 y21 y22 y23] + // [y8 y9 y10 y11 y24 y25 y26 y27] + // [y12 y13 y14 y15 y28 y29 y30 y31] + + idft16_simd256((int16_t*)(xtmp+4),(int16_t*)(ytmp+4)); + // [y32 y33 y34 y35 y48 y49 y50 y51] + // [y36 y37 y38 y39 y52 y53 y54 y55] + // [y40 y41 y42 y43 y56 y57 y58 y59] + // [y44 y45 y46 y47 y60 y61 y62 y63] + +#ifdef D64STATS + stop_meas(&ts_d); + start_meas(&ts_b); +#endif + + + ibfly4_16_256(ytmp,ytmp+2,ytmp+4,ytmp+6, + y256,y256+2,y256+4,y256+6, + tw64a_256,tw64a_256+2,tw64a_256+4, + tw64b_256,tw64b_256+2,tw64b_256+4); + // [y0 y1 y2 y3 y4 y5 y6 y7] + // [y16 y17 y18 y19 y20 y21 y22 y23] + // [y32 y33 y34 y35 y36 y37 y38 y39] + // [y48 y49 y50 y51 y52 y53 y54 y55] + + ibfly4_16_256(ytmp+1,ytmp+3,ytmp+5,ytmp+7, + y256+1,y256+3,y256+5,y256+7, + tw64a_256+1,tw64a_256+3,tw64a_256+5, + tw64b_256+1,tw64b_256+3,tw64b_256+5); + // [y8 y9 y10 y11 y12 y13 y14 y15] + // [y24 y25 y26 y27 y28 y29 y30 y31] + // [y40 y41 y42 y43 y44 y45 y46 y47] + // [y56 y57 y58 y59 y60 y61 y62 y63] + + +#ifdef D64STATS + stop_meas(&ts_b); + printf("t: %llu cycles, d: %llu cycles, b: %llu cycles\n",ts_t.diff,ts_d.diff,ts_b.diff); +#endif + + + if (scale>0) { + y256[0] = shiftright_int16_simd256(y256[0],3); + y256[1] = shiftright_int16_simd256(y256[1],3); + y256[2] = shiftright_int16_simd256(y256[2],3); + y256[3] = shiftright_int16_simd256(y256[3],3); + y256[4] = shiftright_int16_simd256(y256[4],3); + y256[5] = shiftright_int16_simd256(y256[5],3); + y256[6] = shiftright_int16_simd256(y256[6],3); + y256[7] = shiftright_int16_simd256(y256[7],3); + } + + _mm_empty(); + _m_empty(); + +} +#endif + +int16_t tw128[128] __attribute__((aligned(32))) = { 32767,0,32727,-1608,32609,-3212,32412,-4808,32137,-6393,31785,-7962,31356,-9512,30851,-11039,30272,-12540,29621,-14010,28897,-15447,28105,-16846,27244,-18205,26318,-19520,25329,-20788,24278,-22005,23169,-23170,22004,-24279,20787,-25330,19519,-26319,18204,-27245,16845,-28106,15446,-28898,14009,-29622,12539,-30273,11038,-30852,9511,-31357,7961,-31786,6392,-32138,4807,-32413,3211,-32610,1607,-32728,0,-32767,-1608,-32728,-3212,-32610,-4808,-32413,-6393,-32138,-7962,-31786,-9512,-31357,-11039,-30852,-12540,-30273,-14010,-29622,-15447,-28898,-16846,-28106,-18205,-27245,-19520,-26319,-20788,-25330,-22005,-24279,-23170,-23170,-24279,-22005,-25330,-20788,-26319,-19520,-27245,-18205,-28106,-16846,-28898,-15447,-29622,-14010,-30273,-12540,-30852,-11039,-31357,-9512,-31786,-7962,-32138,-6393,-32413,-4808,-32610,-3212,-32728,-1608}; + +int16_t tw128a[128] __attribute__((aligned(32))) = { 32767,0,32727,1608,32609,3212,32412,4808,32137,6393,31785,7962,31356,9512,30851,11039,30272,12540,29621,14010,28897,15447,28105,16846,27244,18205,26318,19520,25329,20788,24278,22005,23169,23170,22004,24279,20787,25330,19519,26319,18204,27245,16845,28106,15446,28898,14009,29622,12539,30273,11038,30852,9511,31357,7961,31786,6392,32138,4807,32413,3211,32610,1607,32728,0,32767,-1608,32728,-3212,32610,-4808,32413,-6393,32138,-7962,31786,-9512,31357,-11039,30852,-12540,30273,-14010,29622,-15447,28898,-16846,28106,-18205,27245,-19520,26319,-20788,25330,-22005,24279,-23170,23170,-24279,22005,-25330,20788,-26319,19520,-27245,18205,-28106,16846,-28898,15447,-29622,14010,-30273,12540,-30852,11039,-31357,9512,-31786,7962,-32138,6393,-32413,4808,-32610,3212,-32728,1608}; + +int16_t tw128b[128] __attribute__((aligned(32))) = {0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607,-32767,0,-32728,-1608,-32610,-3212,-32413,-4808,-32138,-6393,-31786,-7962,-31357,-9512,-30852,-11039,-30273,-12540,-29622,-14010,-28898,-15447,-28106,-16846,-27245,-18205,-26319,-19520,-25330,-20788,-24279,-22005,-23170,-23170,-22005,-24279,-20788,-25330,-19520,-26319,-18205,-27245,-16846,-28106,-15447,-28898,-14010,-29622,-12540,-30273,-11039,-30852,-9512,-31357,-7962,-31786,-6393,-32138,-4808,-32413,-3212,-32610,-1608,-32728}; + +int16_t tw128c[128] __attribute__((aligned(32))) = {0,32767,1608,32727,3212,32609,4808,32412,6393,32137,7962,31785,9512,31356,11039,30851,12540,30272,14010,29621,15447,28897,16846,28105,18205,27244,19520,26318,20788,25329,22005,24278,23170,23169,24279,22004,25330,20787,26319,19519,27245,18204,28106,16845,28898,15446,29622,14009,30273,12539,30852,11038,31357,9511,31786,7961,32138,6392,32413,4807,32610,3211,32728,1607,32767,0,32728,-1608,32610,-3212,32413,-4808,32138,-6393,31786,-7962,31357,-9512,30852,-11039,30273,-12540,29622,-14010,28898,-15447,28106,-16846,27245,-18205,26319,-19520,25330,-20788,24279,-22005,23170,-23170,22005,-24279,20788,-25330,19520,-26319,18205,-27245,16846,-28106,15447,-28898,14010,-29622,12540,-30273,11039,-30852,9512,-31357,7962,-31786,6393,-32138,4808,-32413,3212,-32610,1608,-32728}; void dft128(int16_t *x,int16_t *y,int scale) { @@ -2000,6 +3151,8 @@ void dft128(int16_t *x,int16_t *y,int scale) dft64((int16_t*)(xtmp),(int16_t*)ytmp,1); dft64((int16_t*)(xtmp+32),(int16_t*)(ytmp+16),1); + /* write_output("dft128a.m","dfta",ytmp,64,1,1); + write_output("dft128b.m","dftb",ytmp+16,64,1,1);*/ for (i=0; i<16; i++) { bfly2_16(ytmpp,ytmpp+16, @@ -2050,11 +3203,81 @@ void dft128(int16_t *x,int16_t *y,int scale) } + /* write_output("dft128out.m","dft128",y,128,1,1); + exit(-1);*/ _mm_empty(); _m_empty(); } +#ifdef __AVX2__ +void dft128_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[16],*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[16],*y256=(simd256_q15_t*)y; + simd256_q15_t *tw128a_256p=(simd256_q15_t *)tw128a,*tw128b_256p=(simd256_q15_t *)tw128b,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_256 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + transpose4_ooff_simd256(x256 ,xtmp,8); + transpose4_ooff_simd256(x256+2,xtmp+1,8); + transpose4_ooff_simd256(x256+4,xtmp+2,8); + transpose4_ooff_simd256(x256+6,xtmp+3,8); + transpose4_ooff_simd256(x256+8,xtmp+4,8); + transpose4_ooff_simd256(x256+10,xtmp+5,8); + transpose4_ooff_simd256(x256+12,xtmp+6,8); + transpose4_ooff_simd256(x256+14,xtmp+7,8); + + write_output("dft128ina_256.m","dftina",xtmp,64,1,1); + write_output("dft128inb_256.m","dftinb",xtmp+8,64,1,1); + + dft64_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); + dft64_simd256((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); + + write_output("dft128outa_256.m","dftouta",ytmp,64,1,1); + write_output("dft128outb_256.m","dftoutb",ytmp+8,64,1,1); + + + for (i=0; i<8; i++) { + bfly2_16_256(ytmpp,ytmpp+8, + y256p,y256p+8, + tw128a_256p, + tw128b_256p); + tw128a_256p++; + tw128b_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + y256[0] = mulhi_int16_simd256(y256[0],ONE_OVER_SQRT2_Q15_256); + y256[1] = mulhi_int16_simd256(y256[1],ONE_OVER_SQRT2_Q15_256); + y256[2] = mulhi_int16_simd256(y256[2],ONE_OVER_SQRT2_Q15_256); + y256[3] = mulhi_int16_simd256(y256[3],ONE_OVER_SQRT2_Q15_256); + y256[4] = mulhi_int16_simd256(y256[4],ONE_OVER_SQRT2_Q15_256); + y256[5] = mulhi_int16_simd256(y256[5],ONE_OVER_SQRT2_Q15_256); + y256[6] = mulhi_int16_simd256(y256[6],ONE_OVER_SQRT2_Q15_256); + y256[7] = mulhi_int16_simd256(y256[7],ONE_OVER_SQRT2_Q15_256); + y256[8] = mulhi_int16_simd256(y256[8],ONE_OVER_SQRT2_Q15_256); + y256[9] = mulhi_int16_simd256(y256[9],ONE_OVER_SQRT2_Q15_256); + y256[10] = mulhi_int16_simd256(y256[10],ONE_OVER_SQRT2_Q15_256); + y256[11] = mulhi_int16_simd256(y256[11],ONE_OVER_SQRT2_Q15_256); + y256[12] = mulhi_int16_simd256(y256[12],ONE_OVER_SQRT2_Q15_256); + y256[13] = mulhi_int16_simd256(y256[13],ONE_OVER_SQRT2_Q15_256); + y256[14] = mulhi_int16_simd256(y256[14],ONE_OVER_SQRT2_Q15_256); + y256[15] = mulhi_int16_simd256(y256[15],ONE_OVER_SQRT2_Q15_256); + + } + + write_output("dft128.m","dft",y256,128,1,1); + exit(-1); +} + +#endif + void idft128(int16_t *x,int16_t *y,int scale) { @@ -2153,18 +3376,78 @@ void idft128(int16_t *x,int16_t *y,int scale) } +#ifdef __AVX2__ +void idft128_simd256(int16_t *x,int16_t *y,int scale) +{ -int16_t tw256[384] __attribute__((aligned(16))) = { 32767,0,32757,-805,32727,-1608,32678,-2411,32609,-3212,32520,-4012,32412,-4808,32284,-5602,32137,-6393,31970,-7180,31785,-7962,31580,-8740,31356,-9512,31113,-10279,30851,-11039,30571,-11793,30272,-12540,29955,-13279,29621,-14010,29268,-14733,28897,-15447,28510,-16151,28105,-16846,27683,-17531,27244,-18205,26789,-18868,26318,-19520,25831,-20160,25329,-20788,24811,-21403,24278,-22005,23731,-22595,23169,-23170,22594,-23732,22004,-24279,21402,-24812,20787,-25330,20159,-25832,19519,-26319,18867,-26790,18204,-27245,17530,-27684,16845,-28106,16150,-28511,15446,-28898,14732,-29269,14009,-29622,13278,-29956,12539,-30273,11792,-30572,11038,-30852,10278,-31114,9511,-31357,8739,-31581,7961,-31786,7179,-31971,6392,-32138,5601,-32285,4807,-32413,4011,-32521,3211,-32610,2410,-32679,1607,-32728,804,-32758, + simd256_q15_t xtmp[16],*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[16],*y256=(simd256_q15_t*)y; + simd256_q15_t *tw128_256p=(simd256_q15_t *)tw128,*tw128c_256p=(simd256_q15_t *)tw128c,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_256 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + + transpose4_ooff_simd256(x256 ,xtmp,8); + transpose4_ooff_simd256(x256+2,xtmp+1,8); + transpose4_ooff_simd256(x256+4,xtmp+2,8); + transpose4_ooff_simd256(x256+6,xtmp+3,8); + transpose4_ooff_simd256(x256+8,xtmp+4,8); + transpose4_ooff_simd256(x256+10,xtmp+5,8); + transpose4_ooff_simd256(x256+12,xtmp+6,8); + transpose4_ooff_simd256(x256+14,xtmp+7,8); + + dft64_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); + dft64_simd256((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); + + + for (i=0; i<8; i++) { + bfly2_16_256(ytmpp,ytmpp+8, + y256p,y256p+8, + tw128_256p, + tw128c_256p); + tw128_256p++; + tw128c_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + y256[0] = mulhi_int16_simd256(y256[0],ONE_OVER_SQRT2_Q15_256); + y256[1] = mulhi_int16_simd256(y256[1],ONE_OVER_SQRT2_Q15_256); + y256[2] = mulhi_int16_simd256(y256[2],ONE_OVER_SQRT2_Q15_256); + y256[3] = mulhi_int16_simd256(y256[3],ONE_OVER_SQRT2_Q15_256); + y256[4] = mulhi_int16_simd256(y256[4],ONE_OVER_SQRT2_Q15_256); + y256[5] = mulhi_int16_simd256(y256[5],ONE_OVER_SQRT2_Q15_256); + y256[6] = mulhi_int16_simd256(y256[6],ONE_OVER_SQRT2_Q15_256); + y256[7] = mulhi_int16_simd256(y256[7],ONE_OVER_SQRT2_Q15_256); + y256[8] = mulhi_int16_simd256(y256[8],ONE_OVER_SQRT2_Q15_256); + y256[9] = mulhi_int16_simd256(y256[9],ONE_OVER_SQRT2_Q15_256); + y256[10] = mulhi_int16_simd256(y256[10],ONE_OVER_SQRT2_Q15_256); + y256[11] = mulhi_int16_simd256(y256[11],ONE_OVER_SQRT2_Q15_256); + y256[12] = mulhi_int16_simd256(y256[12],ONE_OVER_SQRT2_Q15_256); + y256[13] = mulhi_int16_simd256(y256[13],ONE_OVER_SQRT2_Q15_256); + y256[14] = mulhi_int16_simd256(y256[14],ONE_OVER_SQRT2_Q15_256); + y256[15] = mulhi_int16_simd256(y256[15],ONE_OVER_SQRT2_Q15_256); + + } + +} + +#endif + +int16_t tw256[384] __attribute__((aligned(32))) = { 32767,0,32757,-805,32727,-1608,32678,-2411,32609,-3212,32520,-4012,32412,-4808,32284,-5602,32137,-6393,31970,-7180,31785,-7962,31580,-8740,31356,-9512,31113,-10279,30851,-11039,30571,-11793,30272,-12540,29955,-13279,29621,-14010,29268,-14733,28897,-15447,28510,-16151,28105,-16846,27683,-17531,27244,-18205,26789,-18868,26318,-19520,25831,-20160,25329,-20788,24811,-21403,24278,-22005,23731,-22595,23169,-23170,22594,-23732,22004,-24279,21402,-24812,20787,-25330,20159,-25832,19519,-26319,18867,-26790,18204,-27245,17530,-27684,16845,-28106,16150,-28511,15446,-28898,14732,-29269,14009,-29622,13278,-29956,12539,-30273,11792,-30572,11038,-30852,10278,-31114,9511,-31357,8739,-31581,7961,-31786,7179,-31971,6392,-32138,5601,-32285,4807,-32413,4011,-32521,3211,-32610,2410,-32679,1607,-32728,804,-32758, 32767,0,32727,-1608,32609,-3212,32412,-4808,32137,-6393,31785,-7962,31356,-9512,30851,-11039,30272,-12540,29621,-14010,28897,-15447,28105,-16846,27244,-18205,26318,-19520,25329,-20788,24278,-22005,23169,-23170,22004,-24279,20787,-25330,19519,-26319,18204,-27245,16845,-28106,15446,-28898,14009,-29622,12539,-30273,11038,-30852,9511,-31357,7961,-31786,6392,-32138,4807,-32413,3211,-32610,1607,-32728,0,-32767,-1608,-32728,-3212,-32610,-4808,-32413,-6393,-32138,-7962,-31786,-9512,-31357,-11039,-30852,-12540,-30273,-14010,-29622,-15447,-28898,-16846,-28106,-18205,-27245,-19520,-26319,-20788,-25330,-22005,-24279,-23170,-23170,-24279,-22005,-25330,-20788,-26319,-19520,-27245,-18205,-28106,-16846,-28898,-15447,-29622,-14010,-30273,-12540,-30852,-11039,-31357,-9512,-31786,-7962,-32138,-6393,-32413,-4808,-32610,-3212,-32728,-1608, 32767,0,32678,-2411,32412,-4808,31970,-7180,31356,-9512,30571,-11793,29621,-14010,28510,-16151,27244,-18205,25831,-20160,24278,-22005,22594,-23732,20787,-25330,18867,-26790,16845,-28106,14732,-29269,12539,-30273,10278,-31114,7961,-31786,5601,-32285,3211,-32610,804,-32758,-1608,-32728,-4012,-32521,-6393,-32138,-8740,-31581,-11039,-30852,-13279,-29956,-15447,-28898,-17531,-27684,-19520,-26319,-21403,-24812,-23170,-23170,-24812,-21403,-26319,-19520,-27684,-17531,-28898,-15447,-29956,-13279,-30852,-11039,-31581,-8740,-32138,-6393,-32521,-4012,-32728,-1608,-32758,804,-32610,3211,-32285,5601,-31786,7961,-31114,10278,-30273,12539,-29269,14732,-28106,16845,-26790,18867,-25330,20787,-23732,22594,-22005,24278,-20160,25831,-18205,27244,-16151,28510,-14010,29621,-11793,30571,-9512,31356,-7180,31970,-4808,32412,-2411,32678 }; -int16_t tw256a[384] __attribute__((aligned(16))) = { 32767,0,32757,804,32727,1607,32678,2410,32609,3211,32520,4011,32412,4807,32284,5601,32137,6392,31970,7179,31785,7961,31580,8739,31356,9511,31113,10278,30851,11038,30571,11792,30272,12539,29955,13278,29621,14009,29268,14732,28897,15446,28510,16150,28105,16845,27683,17530,27244,18204,26789,18867,26318,19519,25831,20159,25329,20787,24811,21402,24278,22004,23731,22594,23169,23169,22594,23731,22004,24278,21402,24811,20787,25329,20159,25831,19519,26318,18867,26789,18204,27244,17530,27683,16845,28105,16150,28510,15446,28897,14732,29268,14009,29621,13278,29955,12539,30272,11792,30571,11038,30851,10278,31113,9511,31356,8739,31580,7961,31785,7179,31970,6392,32137,5601,32284,4807,32412,4011,32520,3211,32609,2410,32678,1607,32727,804,32757, +int16_t tw256a[384] __attribute__((aligned(32))) = { 32767,0,32757,804,32727,1607,32678,2410,32609,3211,32520,4011,32412,4807,32284,5601,32137,6392,31970,7179,31785,7961,31580,8739,31356,9511,31113,10278,30851,11038,30571,11792,30272,12539,29955,13278,29621,14009,29268,14732,28897,15446,28510,16150,28105,16845,27683,17530,27244,18204,26789,18867,26318,19519,25831,20159,25329,20787,24811,21402,24278,22004,23731,22594,23169,23169,22594,23731,22004,24278,21402,24811,20787,25329,20159,25831,19519,26318,18867,26789,18204,27244,17530,27683,16845,28105,16150,28510,15446,28897,14732,29268,14009,29621,13278,29955,12539,30272,11792,30571,11038,30851,10278,31113,9511,31356,8739,31580,7961,31785,7179,31970,6392,32137,5601,32284,4807,32412,4011,32520,3211,32609,2410,32678,1607,32727,804,32757, 32767,0,32727,1607,32609,3211,32412,4807,32137,6392,31785,7961,31356,9511,30851,11038,30272,12539,29621,14009,28897,15446,28105,16845,27244,18204,26318,19519,25329,20787,24278,22004,23169,23169,22004,24278,20787,25329,19519,26318,18204,27244,16845,28105,15446,28897,14009,29621,12539,30272,11038,30851,9511,31356,7961,31785,6392,32137,4807,32412,3211,32609,1607,32727,0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607, 32767,0,32678,2410,32412,4807,31970,7179,31356,9511,30571,11792,29621,14009,28510,16150,27244,18204,25831,20159,24278,22004,22594,23731,20787,25329,18867,26789,16845,28105,14732,29268,12539,30272,10278,31113,7961,31785,5601,32284,3211,32609,804,32757,-1608,32727,-4012,32520,-6393,32137,-8740,31580,-11039,30851,-13279,29955,-15447,28897,-17531,27683,-19520,26318,-21403,24811,-23170,23169,-24812,21402,-26319,19519,-27684,17530,-28898,15446,-29956,13278,-30852,11038,-31581,8739,-32138,6392,-32521,4011,-32728,1607,-32758,-805,-32610,-3212,-32285,-5602,-31786,-7962,-31114,-10279,-30273,-12540,-29269,-14733,-28106,-16846,-26790,-18868,-25330,-20788,-23732,-22595,-22005,-24279,-20160,-25832,-18205,-27245,-16151,-28511,-14010,-29622,-11793,-30572,-9512,-31357,-7180,-31971,-4808,-32413,-2411,-32679 }; -int16_t tw256b[384] __attribute__((aligned(16))) = {0,32767,-805,32757,-1608,32727,-2411,32678,-3212,32609,-4012,32520,-4808,32412,-5602,32284,-6393,32137,-7180,31970,-7962,31785,-8740,31580,-9512,31356,-10279,31113,-11039,30851,-11793,30571,-12540,30272,-13279,29955,-14010,29621,-14733,29268,-15447,28897,-16151,28510,-16846,28105,-17531,27683,-18205,27244,-18868,26789,-19520,26318,-20160,25831,-20788,25329,-21403,24811,-22005,24278,-22595,23731,-23170,23169,-23732,22594,-24279,22004,-24812,21402,-25330,20787,-25832,20159,-26319,19519,-26790,18867,-27245,18204,-27684,17530,-28106,16845,-28511,16150,-28898,15446,-29269,14732,-29622,14009,-29956,13278,-30273,12539,-30572,11792,-30852,11038,-31114,10278,-31357,9511,-31581,8739,-31786,7961,-31971,7179,-32138,6392,-32285,5601,-32413,4807,-32521,4011,-32610,3211,-32679,2410,-32728,1607,-32758,804, +int16_t tw256b[384] __attribute__((aligned(32))) = {0,32767,-805,32757,-1608,32727,-2411,32678,-3212,32609,-4012,32520,-4808,32412,-5602,32284,-6393,32137,-7180,31970,-7962,31785,-8740,31580,-9512,31356,-10279,31113,-11039,30851,-11793,30571,-12540,30272,-13279,29955,-14010,29621,-14733,29268,-15447,28897,-16151,28510,-16846,28105,-17531,27683,-18205,27244,-18868,26789,-19520,26318,-20160,25831,-20788,25329,-21403,24811,-22005,24278,-22595,23731,-23170,23169,-23732,22594,-24279,22004,-24812,21402,-25330,20787,-25832,20159,-26319,19519,-26790,18867,-27245,18204,-27684,17530,-28106,16845,-28511,16150,-28898,15446,-29269,14732,-29622,14009,-29956,13278,-30273,12539,-30572,11792,-30852,11038,-31114,10278,-31357,9511,-31581,8739,-31786,7961,-31971,7179,-32138,6392,-32285,5601,-32413,4807,-32521,4011,-32610,3211,-32679,2410,-32728,1607,-32758,804, 0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607,-32767,0,-32728,-1608,-32610,-3212,-32413,-4808,-32138,-6393,-31786,-7962,-31357,-9512,-30852,-11039,-30273,-12540,-29622,-14010,-28898,-15447,-28106,-16846,-27245,-18205,-26319,-19520,-25330,-20788,-24279,-22005,-23170,-23170,-22005,-24279,-20788,-25330,-19520,-26319,-18205,-27245,-16846,-28106,-15447,-28898,-14010,-29622,-12540,-30273,-11039,-30852,-9512,-31357,-7962,-31786,-6393,-32138,-4808,-32413,-3212,-32610,-1608,-32728, 0,32767,-2411,32678,-4808,32412,-7180,31970,-9512,31356,-11793,30571,-14010,29621,-16151,28510,-18205,27244,-20160,25831,-22005,24278,-23732,22594,-25330,20787,-26790,18867,-28106,16845,-29269,14732,-30273,12539,-31114,10278,-31786,7961,-32285,5601,-32610,3211,-32758,804,-32728,-1608,-32521,-4012,-32138,-6393,-31581,-8740,-30852,-11039,-29956,-13279,-28898,-15447,-27684,-17531,-26319,-19520,-24812,-21403,-23170,-23170,-21403,-24812,-19520,-26319,-17531,-27684,-15447,-28898,-13279,-29956,-11039,-30852,-8740,-31581,-6393,-32138,-4012,-32521,-1608,-32728,804,-32758,3211,-32610,5601,-32285,7961,-31786,10278,-31114,12539,-30273,14732,-29269,16845,-28106,18867,-26790,20787,-25330,22594,-23732,24278,-22005,25831,-20160,27244,-18205,28510,-16151,29621,-14010,30571,-11793,31356,-9512,31970,-7180,32412,-4808,32678,-2411 }; @@ -2337,21 +3620,194 @@ void idft256(int16_t *x,int16_t *y,int scale) } -int16_t tw512[512] __attribute__((aligned(16))) = { +#ifdef __AVX2__ + +void dft256_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[64],ytmp[64],*tw256a_256p=(simd256_q15_t *)tw256a,*tw256b_256p=(simd256_q15_t *)tw256b,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + + transpose16_ooff_simd256(x256+0,xtmp+0,8); + transpose16_ooff_simd256(x256+4,xtmp+1,8); + transpose16_ooff_simd256(x256+8,xtmp+2,8); + transpose16_ooff_simd256(x256+12,xtmp+3,8); + transpose16_ooff_simd256(x256+16,xtmp+4,8); + transpose16_ooff_simd256(x256+20,xtmp+5,8); + transpose16_ooff_simd256(x256+24,xtmp+6,8); + transpose16_ooff_simd256(x256+28,xtmp+7,8); + + dft64_simd256((int16_t*)(xtmp),(int16_t*)(ytmp),1); + dft64_simd256((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); + dft64_simd256((int16_t*)(xtmp+16),(int16_t*)(ytmp+16),1); + dft64_simd256((int16_t*)(xtmp+24),(int16_t*)(ytmp+24),1); + + + bfly4_16_256(ytmpp,ytmpp+8,ytmpp+16,ytmpp+24, + y256p,y256p+8,y256p+16,y256p+24, + tw256a_256p,tw256a_256p+8,tw256a_256p+16, + tw256b_256p,tw256b_256p+8,tw256b_256p+16); + bfly4_16_256(ytmpp+1,ytmpp+9,ytmpp+17,ytmpp+25, + y256p+1,y256p+9,y256p+17,y256p+25, + tw256a_256p+1,tw256a_256p+9,tw256a_256p+17, + tw256b_256p+1,tw256b_256p+9,tw256b_256p+17); + bfly4_16_256(ytmpp+2,ytmpp+10,ytmpp+18,ytmpp+26, + y256p+2,y256p+10,y256p+18,y256p+26, + tw256a_256p+2,tw256a_256p+10,tw256a_256p+18, + tw256b_256p+2,tw256b_256p+10,tw256b_256p+18); + bfly4_16_256(ytmpp+3,ytmpp+11,ytmpp+19,ytmpp+27, + y256p+3,y256p+11,y256p+19,y256p+27, + tw256a_256p+3,tw256a_256p+11,tw256a_256p+19, + tw256b_256p+3,tw256b_256p+11,tw256b_256p+19); + bfly4_16_256(ytmpp+4,ytmpp+12,ytmpp+20,ytmpp+28, + y256p+4,y256p+12,y256p+20,y256p+28, + tw256a_256p+4,tw256a_256p+12,tw256a_256p+20, + tw256b_256p+4,tw256b_256p+12,tw256b_256p+20); + bfly4_16_256(ytmpp+5,ytmpp+13,ytmpp+21,ytmpp+29, + y256p+5,y256p+13,y256p+21,y256p+29, + tw256a_256p+5,tw256a_256p+13,tw256a_256p+21, + tw256b_256p+5,tw256b_256p+13,tw256b_256p+21); + bfly4_16_256(ytmpp+6,ytmpp+14,ytmpp+22,ytmpp+30, + y256p+6,y256p+14,y256p+22,y256p+30, + tw256a_256p+6,tw256a_256p+14,tw256a_256p+22, + tw256b_256p+6,tw256b_256p+14,tw256b_256p+22); + bfly4_16_256(ytmpp+7,ytmpp+15,ytmpp+23,ytmpp+31, + y256p+7,y256p+15,y256p+23,y256p+31, + tw256a_256p+7,tw256a_256p+15,tw256a_256p+23, + tw256b_256p+7,tw256b_256p+15,tw256b_256p+23); + + if (scale>0) { + + for (i=0; i<2; i++) { + y256[0] = shiftright_int16_simd256(y256[0],1); + y256[1] = shiftright_int16_simd256(y256[1],1); + y256[2] = shiftright_int16_simd256(y256[2],1); + y256[3] = shiftright_int16_simd256(y256[3],1); + y256[4] = shiftright_int16_simd256(y256[4],1); + y256[5] = shiftright_int16_simd256(y256[5],1); + y256[6] = shiftright_int16_simd256(y256[6],1); + y256[7] = shiftright_int16_simd256(y256[7],1); + y256[8] = shiftright_int16_simd256(y256[8],1); + y256[9] = shiftright_int16_simd256(y256[9],1); + y256[10] = shiftright_int16_simd256(y256[10],1); + y256[11] = shiftright_int16_simd256(y256[11],1); + y256[12] = shiftright_int16_simd256(y256[12],1); + y256[13] = shiftright_int16_simd256(y256[13],1); + y256[14] = shiftright_int16_simd256(y256[14],1); + y256[15] = shiftright_int16_simd256(y256[15],1); + + y256+=16; + } + + } + + _mm_empty(); + _m_empty(); + +} + +void idft256_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[64],ytmp[64],*tw256a_256p=(simd256_q15_t *)tw256a,*tw256b_256p=(simd256_q15_t *)tw256b,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + + transpose16_ooff_simd256(x256+0,xtmp+0,8); + transpose16_ooff_simd256(x256+4,xtmp+1,8); + transpose16_ooff_simd256(x256+8,xtmp+2,8); + transpose16_ooff_simd256(x256+12,xtmp+3,8); + transpose16_ooff_simd256(x256+16,xtmp+4,8); + transpose16_ooff_simd256(x256+20,xtmp+5,8); + transpose16_ooff_simd256(x256+24,xtmp+6,8); + transpose16_ooff_simd256(x256+28,xtmp+7,8); + + idft64_simd256((int16_t*)(xtmp),(int16_t*)(ytmp),1); + idft64_simd256((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); + idft64_simd256((int16_t*)(xtmp+16),(int16_t*)(ytmp+16),1); + idft64_simd256((int16_t*)(xtmp+24),(int16_t*)(ytmp+24),1); + + + ibfly4_16_256(ytmpp,ytmpp+8,ytmpp+16,ytmpp+24, + y256p,y256p+8,y256p+16,y256p+24, + tw256a_256p,tw256a_256p+8,tw256a_256p+16, + tw256b_256p,tw256b_256p+8,tw256b_256p+16); + ibfly4_16_256(ytmpp+1,ytmpp+9,ytmpp+17,ytmpp+25, + y256p+1,y256p+9,y256p+17,y256p+25, + tw256a_256p+1,tw256a_256p+9,tw256a_256p+17, + tw256b_256p+1,tw256b_256p+9,tw256b_256p+17); + ibfly4_16_256(ytmpp+2,ytmpp+10,ytmpp+18,ytmpp+26, + y256p+2,y256p+10,y256p+18,y256p+26, + tw256a_256p+2,tw256a_256p+10,tw256a_256p+18, + tw256b_256p+2,tw256b_256p+10,tw256b_256p+18); + ibfly4_16_256(ytmpp+3,ytmpp+11,ytmpp+19,ytmpp+27, + y256p+3,y256p+11,y256p+19,y256p+27, + tw256a_256p+3,tw256a_256p+11,tw256a_256p+19, + tw256b_256p+3,tw256b_256p+11,tw256b_256p+19); + ibfly4_16_256(ytmpp+4,ytmpp+12,ytmpp+20,ytmpp+28, + y256p+4,y256p+12,y256p+20,y256p+28, + tw256a_256p+4,tw256a_256p+12,tw256a_256p+20, + tw256b_256p+4,tw256b_256p+12,tw256b_256p+20); + ibfly4_16_256(ytmpp+5,ytmpp+13,ytmpp+21,ytmpp+29, + y256p+5,y256p+13,y256p+21,y256p+29, + tw256a_256p+5,tw256a_256p+13,tw256a_256p+21, + tw256b_256p+5,tw256b_256p+13,tw256b_256p+21); + ibfly4_16_256(ytmpp+6,ytmpp+14,ytmpp+22,ytmpp+30, + y256p+6,y256p+14,y256p+22,y256p+30, + tw256a_256p+6,tw256a_256p+14,tw256a_256p+22, + tw256b_256p+6,tw256b_256p+14,tw256b_256p+22); + ibfly4_16_256(ytmpp+7,ytmpp+15,ytmpp+23,ytmpp+31, + y256p+7,y256p+15,y256p+23,y256p+31, + tw256a_256p+7,tw256a_256p+15,tw256a_256p+23, + tw256b_256p+7,tw256b_256p+15,tw256b_256p+23); + + if (scale>0) { + + for (i=0; i<2; i++) { + y256[0] = shiftright_int16_simd256(y256[0],1); + y256[1] = shiftright_int16_simd256(y256[1],1); + y256[2] = shiftright_int16_simd256(y256[2],1); + y256[3] = shiftright_int16_simd256(y256[3],1); + y256[4] = shiftright_int16_simd256(y256[4],1); + y256[5] = shiftright_int16_simd256(y256[5],1); + y256[6] = shiftright_int16_simd256(y256[6],1); + y256[7] = shiftright_int16_simd256(y256[7],1); + y256[8] = shiftright_int16_simd256(y256[8],1); + y256[9] = shiftright_int16_simd256(y256[9],1); + y256[10] = shiftright_int16_simd256(y256[10],1); + y256[11] = shiftright_int16_simd256(y256[11],1); + y256[12] = shiftright_int16_simd256(y256[12],1); + y256[13] = shiftright_int16_simd256(y256[13],1); + y256[14] = shiftright_int16_simd256(y256[14],1); + y256[15] = shiftright_int16_simd256(y256[15],1); + + y256+=16; + } + + } + + _mm_empty(); + _m_empty(); + +} + +#endif +int16_t tw512[512] __attribute__((aligned(32))) = { 32767,0,32764,-403,32757,-805,32744,-1207,32727,-1608,32705,-2010,32678,-2411,32646,-2812,32609,-3212,32567,-3612,32520,-4012,32468,-4410,32412,-4808,32350,-5206,32284,-5602,32213,-5998,32137,-6393,32056,-6787,31970,-7180,31880,-7572,31785,-7962,31684,-8352,31580,-8740,31470,-9127,31356,-9512,31236,-9896,31113,-10279,30984,-10660,30851,-11039,30713,-11417,30571,-11793,30424,-12167,30272,-12540,30116,-12910,29955,-13279,29790,-13646,29621,-14010,29446,-14373,29268,-14733,29085,-15091,28897,-15447,28706,-15800,28510,-16151,28309,-16500,28105,-16846,27896,-17190,27683,-17531,27466,-17869,27244,-18205,27019,-18538,26789,-18868,26556,-19195,26318,-19520,26077,-19841,25831,-20160,25582,-20475,25329,-20788,25072,-21097,24811,-21403,24546,-21706,24278,-22005,24006,-22302,23731,-22595,23452,-22884,23169,-23170,22883,-23453,22594,-23732,22301,-24007,22004,-24279,21705,-24547,21402,-24812,21096,-25073,20787,-25330,20474,-25583,20159,-25832,19840,-26078,19519,-26319,19194,-26557,18867,-26790,18537,-27020,18204,-27245,17868,-27467,17530,-27684,17189,-27897,16845,-28106,16499,-28310,16150,-28511,15799,-28707,15446,-28898,15090,-29086,14732,-29269,14372,-29447,14009,-29622,13645,-29791,13278,-29956,12909,-30117,12539,-30273,12166,-30425,11792,-30572,11416,-30714,11038,-30852,10659,-30985,10278,-31114,9895,-31237,9511,-31357,9126,-31471,8739,-31581,8351,-31685,7961,-31786,7571,-31881,7179,-31971,6786,-32057,6392,-32138,5997,-32214,5601,-32285,5205,-32351,4807,-32413,4409,-32469,4011,-32521,3611,-32568,3211,-32610,2811,-32647,2410,-32679,2009,-32706,1607,-32728,1206,-32745,804,-32758,402,-32765,0,-32767,-403,-32765,-805,-32758,-1207,-32745,-1608,-32728,-2010,-32706,-2411,-32679,-2812,-32647,-3212,-32610,-3612,-32568,-4012,-32521,-4410,-32469,-4808,-32413,-5206,-32351,-5602,-32285,-5998,-32214,-6393,-32138,-6787,-32057,-7180,-31971,-7572,-31881,-7962,-31786,-8352,-31685,-8740,-31581,-9127,-31471,-9512,-31357,-9896,-31237,-10279,-31114,-10660,-30985,-11039,-30852,-11417,-30714,-11793,-30572,-12167,-30425,-12540,-30273,-12910,-30117,-13279,-29956,-13646,-29791,-14010,-29622,-14373,-29447,-14733,-29269,-15091,-29086,-15447,-28898,-15800,-28707,-16151,-28511,-16500,-28310,-16846,-28106,-17190,-27897,-17531,-27684,-17869,-27467,-18205,-27245,-18538,-27020,-18868,-26790,-19195,-26557,-19520,-26319,-19841,-26078,-20160,-25832,-20475,-25583,-20788,-25330,-21097,-25073,-21403,-24812,-21706,-24547,-22005,-24279,-22302,-24007,-22595,-23732,-22884,-23453,-23170,-23170,-23453,-22884,-23732,-22595,-24007,-22302,-24279,-22005,-24547,-21706,-24812,-21403,-25073,-21097,-25330,-20788,-25583,-20475,-25832,-20160,-26078,-19841,-26319,-19520,-26557,-19195,-26790,-18868,-27020,-18538,-27245,-18205,-27467,-17869,-27684,-17531,-27897,-17190,-28106,-16846,-28310,-16500,-28511,-16151,-28707,-15800,-28898,-15447,-29086,-15091,-29269,-14733,-29447,-14373,-29622,-14010,-29791,-13646,-29956,-13279,-30117,-12910,-30273,-12540,-30425,-12167,-30572,-11793,-30714,-11417,-30852,-11039,-30985,-10660,-31114,-10279,-31237,-9896,-31357,-9512,-31471,-9127,-31581,-8740,-31685,-8352,-31786,-7962,-31881,-7572,-31971,-7180,-32057,-6787,-32138,-6393,-32214,-5998,-32285,-5602,-32351,-5206,-32413,-4808,-32469,-4410,-32521,-4012,-32568,-3612,-32610,-3212,-32647,-2812,-32679,-2411,-32706,-2010,-32728,-1608,-32745,-1207,-32758,-805,-32765,-403 }; -int16_t tw512a[512] __attribute__((aligned(16))) = { +int16_t tw512a[512] __attribute__((aligned(32))) = { 32767,0,32764,403,32757,805,32744,1207,32727,1608,32705,2010,32678,2411,32646,2812,32609,3212,32567,3612,32520,4012,32468,4410,32412,4808,32350,5206,32284,5602,32213,5998,32137,6393,32056,6787,31970,7180,31880,7572,31785,7962,31684,8352,31580,8740,31470,9127,31356,9512,31236,9896,31113,10279,30984,10660,30851,11039,30713,11417,30571,11793,30424,12167,30272,12540,30116,12910,29955,13279,29790,13646,29621,14010,29446,14373,29268,14733,29085,15091,28897,15447,28706,15800,28510,16151,28309,16500,28105,16846,27896,17190,27683,17531,27466,17869,27244,18205,27019,18538,26789,18868,26556,19195,26318,19520,26077,19841,25831,20160,25582,20475,25329,20788,25072,21097,24811,21403,24546,21706,24278,22005,24006,22302,23731,22595,23452,22884,23169,23170,22883,23453,22594,23732,22301,24007,22004,24279,21705,24547,21402,24812,21096,25073,20787,25330,20474,25583,20159,25832,19840,26078,19519,26319,19194,26557,18867,26790,18537,27020,18204,27245,17868,27467,17530,27684,17189,27897,16845,28106,16499,28310,16150,28511,15799,28707,15446,28898,15090,29086,14732,29269,14372,29447,14009,29622,13645,29791,13278,29956,12909,30117,12539,30273,12166,30425,11792,30572,11416,30714,11038,30852,10659,30985,10278,31114,9895,31237,9511,31357,9126,31471,8739,31581,8351,31685,7961,31786,7571,31881,7179,31971,6786,32057,6392,32138,5997,32214,5601,32285,5205,32351,4807,32413,4409,32469,4011,32521,3611,32568,3211,32610,2811,32647,2410,32679,2009,32706,1607,32728,1206,32745,804,32758,402,32765,0,32767,-403,32765,-805,32758,-1207,32745,-1608,32728,-2010,32706,-2411,32679,-2812,32647,-3212,32610,-3612,32568,-4012,32521,-4410,32469,-4808,32413,-5206,32351,-5602,32285,-5998,32214,-6393,32138,-6787,32057,-7180,31971,-7572,31881,-7962,31786,-8352,31685,-8740,31581,-9127,31471,-9512,31357,-9896,31237,-10279,31114,-10660,30985,-11039,30852,-11417,30714,-11793,30572,-12167,30425,-12540,30273,-12910,30117,-13279,29956,-13646,29791,-14010,29622,-14373,29447,-14733,29269,-15091,29086,-15447,28898,-15800,28707,-16151,28511,-16500,28310,-16846,28106,-17190,27897,-17531,27684,-17869,27467,-18205,27245,-18538,27020,-18868,26790,-19195,26557,-19520,26319,-19841,26078,-20160,25832,-20475,25583,-20788,25330,-21097,25073,-21403,24812,-21706,24547,-22005,24279,-22302,24007,-22595,23732,-22884,23453,-23170,23170,-23453,22884,-23732,22595,-24007,22302,-24279,22005,-24547,21706,-24812,21403,-25073,21097,-25330,20788,-25583,20475,-25832,20160,-26078,19841,-26319,19520,-26557,19195,-26790,18868,-27020,18538,-27245,18205,-27467,17869,-27684,17531,-27897,17190,-28106,16846,-28310,16500,-28511,16151,-28707,15800,-28898,15447,-29086,15091,-29269,14733,-29447,14373,-29622,14010,-29791,13646,-29956,13279,-30117,12910,-30273,12540,-30425,12167,-30572,11793,-30714,11417,-30852,11039,-30985,10660,-31114,10279,-31237,9896,-31357,9512,-31471,9127,-31581,8740,-31685,8352,-31786,7962,-31881,7572,-31971,7180,-32057,6787,-32138,6393,-32214,5998,-32285,5602,-32351,5206,-32413,4808,-32469,4410,-32521,4012,-32568,3612,-32610,3212,-32647,2812,-32679,2411,-32706,2010,-32728,1608,-32745,1207,-32758,805,-32765,403 }; -int16_t tw512b[512] __attribute__((aligned(16))) = { +int16_t tw512b[512] __attribute__((aligned(32))) = { 0,32767,-403,32764,-805,32757,-1207,32744,-1608,32727,-2010,32705,-2411,32678,-2812,32646,-3212,32609,-3612,32567,-4012,32520,-4410,32468,-4808,32412,-5206,32350,-5602,32284,-5998,32213,-6393,32137,-6787,32056,-7180,31970,-7572,31880,-7962,31785,-8352,31684,-8740,31580,-9127,31470,-9512,31356,-9896,31236,-10279,31113,-10660,30984,-11039,30851,-11417,30713,-11793,30571,-12167,30424,-12540,30272,-12910,30116,-13279,29955,-13646,29790,-14010,29621,-14373,29446,-14733,29268,-15091,29085,-15447,28897,-15800,28706,-16151,28510,-16500,28309,-16846,28105,-17190,27896,-17531,27683,-17869,27466,-18205,27244,-18538,27019,-18868,26789,-19195,26556,-19520,26318,-19841,26077,-20160,25831,-20475,25582,-20788,25329,-21097,25072,-21403,24811,-21706,24546,-22005,24278,-22302,24006,-22595,23731,-22884,23452,-23170,23169,-23453,22883,-23732,22594,-24007,22301,-24279,22004,-24547,21705,-24812,21402,-25073,21096,-25330,20787,-25583,20474,-25832,20159,-26078,19840,-26319,19519,-26557,19194,-26790,18867,-27020,18537,-27245,18204,-27467,17868,-27684,17530,-27897,17189,-28106,16845,-28310,16499,-28511,16150,-28707,15799,-28898,15446,-29086,15090,-29269,14732,-29447,14372,-29622,14009,-29791,13645,-29956,13278,-30117,12909,-30273,12539,-30425,12166,-30572,11792,-30714,11416,-30852,11038,-30985,10659,-31114,10278,-31237,9895,-31357,9511,-31471,9126,-31581,8739,-31685,8351,-31786,7961,-31881,7571,-31971,7179,-32057,6786,-32138,6392,-32214,5997,-32285,5601,-32351,5205,-32413,4807,-32469,4409,-32521,4011,-32568,3611,-32610,3211,-32647,2811,-32679,2410,-32706,2009,-32728,1607,-32745,1206,-32758,804,-32765,402,-32767,0,-32765,-403,-32758,-805,-32745,-1207,-32728,-1608,-32706,-2010,-32679,-2411,-32647,-2812,-32610,-3212,-32568,-3612,-32521,-4012,-32469,-4410,-32413,-4808,-32351,-5206,-32285,-5602,-32214,-5998,-32138,-6393,-32057,-6787,-31971,-7180,-31881,-7572,-31786,-7962,-31685,-8352,-31581,-8740,-31471,-9127,-31357,-9512,-31237,-9896,-31114,-10279,-30985,-10660,-30852,-11039,-30714,-11417,-30572,-11793,-30425,-12167,-30273,-12540,-30117,-12910,-29956,-13279,-29791,-13646,-29622,-14010,-29447,-14373,-29269,-14733,-29086,-15091,-28898,-15447,-28707,-15800,-28511,-16151,-28310,-16500,-28106,-16846,-27897,-17190,-27684,-17531,-27467,-17869,-27245,-18205,-27020,-18538,-26790,-18868,-26557,-19195,-26319,-19520,-26078,-19841,-25832,-20160,-25583,-20475,-25330,-20788,-25073,-21097,-24812,-21403,-24547,-21706,-24279,-22005,-24007,-22302,-23732,-22595,-23453,-22884,-23170,-23170,-22884,-23453,-22595,-23732,-22302,-24007,-22005,-24279,-21706,-24547,-21403,-24812,-21097,-25073,-20788,-25330,-20475,-25583,-20160,-25832,-19841,-26078,-19520,-26319,-19195,-26557,-18868,-26790,-18538,-27020,-18205,-27245,-17869,-27467,-17531,-27684,-17190,-27897,-16846,-28106,-16500,-28310,-16151,-28511,-15800,-28707,-15447,-28898,-15091,-29086,-14733,-29269,-14373,-29447,-14010,-29622,-13646,-29791,-13279,-29956,-12910,-30117,-12540,-30273,-12167,-30425,-11793,-30572,-11417,-30714,-11039,-30852,-10660,-30985,-10279,-31114,-9896,-31237,-9512,-31357,-9127,-31471,-8740,-31581,-8352,-31685,-7962,-31786,-7572,-31881,-7180,-31971,-6787,-32057,-6393,-32138,-5998,-32214,-5602,-32285,-5206,-32351,-4808,-32413,-4410,-32469,-4012,-32521,-3612,-32568,-3212,-32610,-2812,-32647,-2411,-32679,-2010,-32706,-1608,-32728,-1207,-32745,-805,-32758,-403,-32765 }; -int16_t tw512c[512] __attribute__((aligned(16))) = { +int16_t tw512c[512] __attribute__((aligned(32))) = { 0,32767,403,32764,805,32757,1207,32744,1608,32727,2010,32705,2411,32678,2812,32646,3212,32609,3612,32567,4012,32520,4410,32468,4808,32412,5206,32350,5602,32284,5998,32213,6393,32137,6787,32056,7180,31970,7572,31880,7962,31785,8352,31684,8740,31580,9127,31470,9512,31356,9896,31236,10279,31113,10660,30984,11039,30851,11417,30713,11793,30571,12167,30424,12540,30272,12910,30116,13279,29955,13646,29790,14010,29621,14373,29446,14733,29268,15091,29085,15447,28897,15800,28706,16151,28510,16500,28309,16846,28105,17190,27896,17531,27683,17869,27466,18205,27244,18538,27019,18868,26789,19195,26556,19520,26318,19841,26077,20160,25831,20475,25582,20788,25329,21097,25072,21403,24811,21706,24546,22005,24278,22302,24006,22595,23731,22884,23452,23170,23169,23453,22883,23732,22594,24007,22301,24279,22004,24547,21705,24812,21402,25073,21096,25330,20787,25583,20474,25832,20159,26078,19840,26319,19519,26557,19194,26790,18867,27020,18537,27245,18204,27467,17868,27684,17530,27897,17189,28106,16845,28310,16499,28511,16150,28707,15799,28898,15446,29086,15090,29269,14732,29447,14372,29622,14009,29791,13645,29956,13278,30117,12909,30273,12539,30425,12166,30572,11792,30714,11416,30852,11038,30985,10659,31114,10278,31237,9895,31357,9511,31471,9126,31581,8739,31685,8351,31786,7961,31881,7571,31971,7179,32057,6786,32138,6392,32214,5997,32285,5601,32351,5205,32413,4807,32469,4409,32521,4011,32568,3611,32610,3211,32647,2811,32679,2410,32706,2009,32728,1607,32745,1206,32758,804,32765,402,32767,0,32765,-403,32758,-805,32745,-1207,32728,-1608,32706,-2010,32679,-2411,32647,-2812,32610,-3212,32568,-3612,32521,-4012,32469,-4410,32413,-4808,32351,-5206,32285,-5602,32214,-5998,32138,-6393,32057,-6787,31971,-7180,31881,-7572,31786,-7962,31685,-8352,31581,-8740,31471,-9127,31357,-9512,31237,-9896,31114,-10279,30985,-10660,30852,-11039,30714,-11417,30572,-11793,30425,-12167,30273,-12540,30117,-12910,29956,-13279,29791,-13646,29622,-14010,29447,-14373,29269,-14733,29086,-15091,28898,-15447,28707,-15800,28511,-16151,28310,-16500,28106,-16846,27897,-17190,27684,-17531,27467,-17869,27245,-18205,27020,-18538,26790,-18868,26557,-19195,26319,-19520,26078,-19841,25832,-20160,25583,-20475,25330,-20788,25073,-21097,24812,-21403,24547,-21706,24279,-22005,24007,-22302,23732,-22595,23453,-22884,23170,-23170,22884,-23453,22595,-23732,22302,-24007,22005,-24279,21706,-24547,21403,-24812,21097,-25073,20788,-25330,20475,-25583,20160,-25832,19841,-26078,19520,-26319,19195,-26557,18868,-26790,18538,-27020,18205,-27245,17869,-27467,17531,-27684,17190,-27897,16846,-28106,16500,-28310,16151,-28511,15800,-28707,15447,-28898,15091,-29086,14733,-29269,14373,-29447,14010,-29622,13646,-29791,13279,-29956,12910,-30117,12540,-30273,12167,-30425,11793,-30572,11417,-30714,11039,-30852,10660,-30985,10279,-31114,9896,-31237,9512,-31357,9127,-31471,8740,-31581,8352,-31685,7962,-31786,7572,-31881,7180,-31971,6787,-32057,6393,-32138,5998,-32214,5602,-32285,5206,-32351,4808,-32413,4410,-32469,4012,-32521,3612,-32568,3212,-32610,2812,-32647,2411,-32679,2010,-32706,1608,-32728,1207,-32745,805,-32758,403,-32765 }; @@ -2566,7 +4022,177 @@ void idft512(int16_t *x,int16_t *y,int scale) } -int16_t tw1024[1536] __attribute__((aligned(16))) = { 32767,0,32766,-202,32764,-403,32761,-604,32757,-805,32751,-1006,32744,-1207,32736,-1407,32727,-1608,32717,-1809,32705,-2010,32692,-2210,32678,-2411,32662,-2611,32646,-2812,32628,-3012,32609,-3212,32588,-3412,32567,-3612,32544,-3812,32520,-4012,32495,-4211,32468,-4410,32441,-4609,32412,-4808,32382,-5007,32350,-5206,32318,-5404,32284,-5602,32249,-5800,32213,-5998,32176,-6196,32137,-6393,32097,-6590,32056,-6787,32014,-6983,31970,-7180,31926,-7376,31880,-7572,31833,-7767,31785,-7962,31735,-8157,31684,-8352,31633,-8546,31580,-8740,31525,-8933,31470,-9127,31413,-9320,31356,-9512,31297,-9704,31236,-9896,31175,-10088,31113,-10279,31049,-10470,30984,-10660,30918,-10850,30851,-11039,30783,-11228,30713,-11417,30643,-11605,30571,-11793,30498,-11981,30424,-12167,30349,-12354,30272,-12540,30195,-12725,30116,-12910,30036,-13095,29955,-13279,29873,-13463,29790,-13646,29706,-13828,29621,-14010,29534,-14192,29446,-14373,29358,-14553,29268,-14733,29177,-14912,29085,-15091,28992,-15269,28897,-15447,28802,-15624,28706,-15800,28608,-15976,28510,-16151,28410,-16326,28309,-16500,28208,-16673,28105,-16846,28001,-17018,27896,-17190,27790,-17361,27683,-17531,27575,-17700,27466,-17869,27355,-18037,27244,-18205,27132,-18372,27019,-18538,26905,-18703,26789,-18868,26673,-19032,26556,-19195,26437,-19358,26318,-19520,26198,-19681,26077,-19841,25954,-20001,25831,-20160,25707,-20318,25582,-20475,25456,-20632,25329,-20788,25201,-20943,25072,-21097,24942,-21250,24811,-21403,24679,-21555,24546,-21706,24413,-21856,24278,-22005,24143,-22154,24006,-22302,23869,-22449,23731,-22595,23592,-22740,23452,-22884,23311,-23028,23169,-23170,23027,-23312,22883,-23453,22739,-23593,22594,-23732,22448,-23870,22301,-24007,22153,-24144,22004,-24279,21855,-24414,21705,-24547,21554,-24680,21402,-24812,21249,-24943,21096,-25073,20942,-25202,20787,-25330,20631,-25457,20474,-25583,20317,-25708,20159,-25832,20000,-25955,19840,-26078,19680,-26199,19519,-26319,19357,-26438,19194,-26557,19031,-26674,18867,-26790,18702,-26906,18537,-27020,18371,-27133,18204,-27245,18036,-27356,17868,-27467,17699,-27576,17530,-27684,17360,-27791,17189,-27897,17017,-28002,16845,-28106,16672,-28209,16499,-28310,16325,-28411,16150,-28511,15975,-28609,15799,-28707,15623,-28803,15446,-28898,15268,-28993,15090,-29086,14911,-29178,14732,-29269,14552,-29359,14372,-29447,14191,-29535,14009,-29622,13827,-29707,13645,-29791,13462,-29874,13278,-29956,13094,-30037,12909,-30117,12724,-30196,12539,-30273,12353,-30350,12166,-30425,11980,-30499,11792,-30572,11604,-30644,11416,-30714,11227,-30784,11038,-30852,10849,-30919,10659,-30985,10469,-31050,10278,-31114,10087,-31176,9895,-31237,9703,-31298,9511,-31357,9319,-31414,9126,-31471,8932,-31526,8739,-31581,8545,-31634,8351,-31685,8156,-31736,7961,-31786,7766,-31834,7571,-31881,7375,-31927,7179,-31971,6982,-32015,6786,-32057,6589,-32098,6392,-32138,6195,-32177,5997,-32214,5799,-32250,5601,-32285,5403,-32319,5205,-32351,5006,-32383,4807,-32413,4608,-32442,4409,-32469,4210,-32496,4011,-32521,3811,-32545,3611,-32568,3411,-32589,3211,-32610,3011,-32629,2811,-32647,2610,-32663,2410,-32679,2209,-32693,2009,-32706,1808,-32718,1607,-32728,1406,-32737,1206,-32745,1005,-32752,804,-32758,603,-32762,402,-32765,201,-32767, +#ifdef __AVX2__ + +void dft512_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[64],*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[64],*y256=(simd256_q15_t*)y; + simd256_q15_t *tw512a_256p=(simd256_q15_t *)tw512a,*tw512b_256p=(simd256_q15_t *)tw512b,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_256 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + + transpose4_ooff_simd256(x256 ,xtmp,32); + transpose4_ooff_simd256(x256+2,xtmp+1,32); + transpose4_ooff_simd256(x256+4,xtmp+2,32); + transpose4_ooff_simd256(x256+6,xtmp+3,32); + transpose4_ooff_simd256(x256+8,xtmp+4,32); + transpose4_ooff_simd256(x256+10,xtmp+5,32); + transpose4_ooff_simd256(x256+12,xtmp+6,32); + transpose4_ooff_simd256(x256+14,xtmp+7,32); + transpose4_ooff_simd256(x256+16,xtmp+8,32); + transpose4_ooff_simd256(x256+18,xtmp+9,32); + transpose4_ooff_simd256(x256+20,xtmp+10,32); + transpose4_ooff_simd256(x256+22,xtmp+11,32); + transpose4_ooff_simd256(x256+24,xtmp+12,32); + transpose4_ooff_simd256(x256+26,xtmp+13,32); + transpose4_ooff_simd256(x256+28,xtmp+14,32); + transpose4_ooff_simd256(x256+30,xtmp+15,32); + transpose4_ooff_simd256(x256+32,xtmp+16,32); + transpose4_ooff_simd256(x256+34,xtmp+17,32); + transpose4_ooff_simd256(x256+36,xtmp+18,32); + transpose4_ooff_simd256(x256+38,xtmp+19,32); + transpose4_ooff_simd256(x256+40,xtmp+20,32); + transpose4_ooff_simd256(x256+42,xtmp+21,32); + transpose4_ooff_simd256(x256+44,xtmp+22,32); + transpose4_ooff_simd256(x256+46,xtmp+23,32); + transpose4_ooff_simd256(x256+48,xtmp+24,32); + transpose4_ooff_simd256(x256+50,xtmp+25,32); + transpose4_ooff_simd256(x256+52,xtmp+26,32); + transpose4_ooff_simd256(x256+54,xtmp+27,32); + transpose4_ooff_simd256(x256+56,xtmp+28,32); + transpose4_ooff_simd256(x256+58,xtmp+29,32); + transpose4_ooff_simd256(x256+60,xtmp+30,32); + transpose4_ooff_simd256(x256+62,xtmp+31,32); + + dft256_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); + dft256_simd256((int16_t*)(xtmp+64),(int16_t*)(ytmp+32),1); + + + for (i=0; i<32; i++) { + bfly2_16_256(ytmpp,ytmpp+32, + y256p,y256p+32, + tw512a_256p, + tw512b_256p); + tw512a_256p++; + tw512b_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0;i<4;i++) { + y256[0] = mulhi_int16_simd256(y256[0],ONE_OVER_SQRT2_Q15_256); + y256[1] = mulhi_int16_simd256(y256[1],ONE_OVER_SQRT2_Q15_256); + y256[2] = mulhi_int16_simd256(y256[2],ONE_OVER_SQRT2_Q15_256); + y256[3] = mulhi_int16_simd256(y256[3],ONE_OVER_SQRT2_Q15_256); + y256[4] = mulhi_int16_simd256(y256[4],ONE_OVER_SQRT2_Q15_256); + y256[5] = mulhi_int16_simd256(y256[5],ONE_OVER_SQRT2_Q15_256); + y256[6] = mulhi_int16_simd256(y256[6],ONE_OVER_SQRT2_Q15_256); + y256[7] = mulhi_int16_simd256(y256[7],ONE_OVER_SQRT2_Q15_256); + y256[8] = mulhi_int16_simd256(y256[8],ONE_OVER_SQRT2_Q15_256); + y256[9] = mulhi_int16_simd256(y256[9],ONE_OVER_SQRT2_Q15_256); + y256[10] = mulhi_int16_simd256(y256[10],ONE_OVER_SQRT2_Q15_256); + y256[11] = mulhi_int16_simd256(y256[11],ONE_OVER_SQRT2_Q15_256); + y256[12] = mulhi_int16_simd256(y256[12],ONE_OVER_SQRT2_Q15_256); + y256[13] = mulhi_int16_simd256(y256[13],ONE_OVER_SQRT2_Q15_256); + y256[14] = mulhi_int16_simd256(y256[14],ONE_OVER_SQRT2_Q15_256); + y256[15] = mulhi_int16_simd256(y256[15],ONE_OVER_SQRT2_Q15_256); + y256+=16; + } + } + +} + +void idft512_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[64],*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[64],*y256=(simd256_q15_t*)y; + simd256_q15_t *tw512_256p=(simd256_q15_t *)tw512,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_256 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + + transpose4_ooff_simd256(x256 ,xtmp,32); + transpose4_ooff_simd256(x256+2,xtmp+1,32); + transpose4_ooff_simd256(x256+4,xtmp+2,32); + transpose4_ooff_simd256(x256+6,xtmp+3,32); + transpose4_ooff_simd256(x256+8,xtmp+4,32); + transpose4_ooff_simd256(x256+10,xtmp+5,32); + transpose4_ooff_simd256(x256+12,xtmp+6,32); + transpose4_ooff_simd256(x256+14,xtmp+7,32); + transpose4_ooff_simd256(x256+16,xtmp+8,32); + transpose4_ooff_simd256(x256+18,xtmp+9,32); + transpose4_ooff_simd256(x256+20,xtmp+10,32); + transpose4_ooff_simd256(x256+22,xtmp+11,32); + transpose4_ooff_simd256(x256+24,xtmp+12,32); + transpose4_ooff_simd256(x256+26,xtmp+13,32); + transpose4_ooff_simd256(x256+28,xtmp+14,32); + transpose4_ooff_simd256(x256+30,xtmp+15,32); + transpose4_ooff_simd256(x256+32,xtmp+16,32); + transpose4_ooff_simd256(x256+34,xtmp+17,32); + transpose4_ooff_simd256(x256+36,xtmp+18,32); + transpose4_ooff_simd256(x256+38,xtmp+19,32); + transpose4_ooff_simd256(x256+40,xtmp+20,32); + transpose4_ooff_simd256(x256+42,xtmp+21,32); + transpose4_ooff_simd256(x256+44,xtmp+22,32); + transpose4_ooff_simd256(x256+46,xtmp+23,32); + transpose4_ooff_simd256(x256+48,xtmp+24,32); + transpose4_ooff_simd256(x256+50,xtmp+25,32); + transpose4_ooff_simd256(x256+52,xtmp+26,32); + transpose4_ooff_simd256(x256+54,xtmp+27,32); + transpose4_ooff_simd256(x256+56,xtmp+28,32); + transpose4_ooff_simd256(x256+58,xtmp+29,32); + transpose4_ooff_simd256(x256+60,xtmp+30,32); + transpose4_ooff_simd256(x256+62,xtmp+31,32); + + idft256_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); + idft256_simd256((int16_t*)(xtmp+64),(int16_t*)(ytmp+32),1); + + + for (i=0; i<32; i++) { + ibfly2_256(ytmpp,ytmpp+32, + y256p,y256p+32, + tw512_256p); + tw512_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0;i<4;i++) { + y256[0] = mulhi_int16_simd256(y256[0],ONE_OVER_SQRT2_Q15_256); + y256[1] = mulhi_int16_simd256(y256[1],ONE_OVER_SQRT2_Q15_256); + y256[2] = mulhi_int16_simd256(y256[2],ONE_OVER_SQRT2_Q15_256); + y256[3] = mulhi_int16_simd256(y256[3],ONE_OVER_SQRT2_Q15_256); + y256[4] = mulhi_int16_simd256(y256[4],ONE_OVER_SQRT2_Q15_256); + y256[5] = mulhi_int16_simd256(y256[5],ONE_OVER_SQRT2_Q15_256); + y256[6] = mulhi_int16_simd256(y256[6],ONE_OVER_SQRT2_Q15_256); + y256[7] = mulhi_int16_simd256(y256[7],ONE_OVER_SQRT2_Q15_256); + y256[8] = mulhi_int16_simd256(y256[8],ONE_OVER_SQRT2_Q15_256); + y256[9] = mulhi_int16_simd256(y256[9],ONE_OVER_SQRT2_Q15_256); + y256[10] = mulhi_int16_simd256(y256[10],ONE_OVER_SQRT2_Q15_256); + y256[11] = mulhi_int16_simd256(y256[11],ONE_OVER_SQRT2_Q15_256); + y256[12] = mulhi_int16_simd256(y256[12],ONE_OVER_SQRT2_Q15_256); + y256[13] = mulhi_int16_simd256(y256[13],ONE_OVER_SQRT2_Q15_256); + y256[14] = mulhi_int16_simd256(y256[14],ONE_OVER_SQRT2_Q15_256); + y256[15] = mulhi_int16_simd256(y256[15],ONE_OVER_SQRT2_Q15_256); + y256+=16; + } + } + +} + +#endif + +int16_t tw1024[1536] __attribute__((aligned(32))) = { 32767,0,32766,-202,32764,-403,32761,-604,32757,-805,32751,-1006,32744,-1207,32736,-1407,32727,-1608,32717,-1809,32705,-2010,32692,-2210,32678,-2411,32662,-2611,32646,-2812,32628,-3012,32609,-3212,32588,-3412,32567,-3612,32544,-3812,32520,-4012,32495,-4211,32468,-4410,32441,-4609,32412,-4808,32382,-5007,32350,-5206,32318,-5404,32284,-5602,32249,-5800,32213,-5998,32176,-6196,32137,-6393,32097,-6590,32056,-6787,32014,-6983,31970,-7180,31926,-7376,31880,-7572,31833,-7767,31785,-7962,31735,-8157,31684,-8352,31633,-8546,31580,-8740,31525,-8933,31470,-9127,31413,-9320,31356,-9512,31297,-9704,31236,-9896,31175,-10088,31113,-10279,31049,-10470,30984,-10660,30918,-10850,30851,-11039,30783,-11228,30713,-11417,30643,-11605,30571,-11793,30498,-11981,30424,-12167,30349,-12354,30272,-12540,30195,-12725,30116,-12910,30036,-13095,29955,-13279,29873,-13463,29790,-13646,29706,-13828,29621,-14010,29534,-14192,29446,-14373,29358,-14553,29268,-14733,29177,-14912,29085,-15091,28992,-15269,28897,-15447,28802,-15624,28706,-15800,28608,-15976,28510,-16151,28410,-16326,28309,-16500,28208,-16673,28105,-16846,28001,-17018,27896,-17190,27790,-17361,27683,-17531,27575,-17700,27466,-17869,27355,-18037,27244,-18205,27132,-18372,27019,-18538,26905,-18703,26789,-18868,26673,-19032,26556,-19195,26437,-19358,26318,-19520,26198,-19681,26077,-19841,25954,-20001,25831,-20160,25707,-20318,25582,-20475,25456,-20632,25329,-20788,25201,-20943,25072,-21097,24942,-21250,24811,-21403,24679,-21555,24546,-21706,24413,-21856,24278,-22005,24143,-22154,24006,-22302,23869,-22449,23731,-22595,23592,-22740,23452,-22884,23311,-23028,23169,-23170,23027,-23312,22883,-23453,22739,-23593,22594,-23732,22448,-23870,22301,-24007,22153,-24144,22004,-24279,21855,-24414,21705,-24547,21554,-24680,21402,-24812,21249,-24943,21096,-25073,20942,-25202,20787,-25330,20631,-25457,20474,-25583,20317,-25708,20159,-25832,20000,-25955,19840,-26078,19680,-26199,19519,-26319,19357,-26438,19194,-26557,19031,-26674,18867,-26790,18702,-26906,18537,-27020,18371,-27133,18204,-27245,18036,-27356,17868,-27467,17699,-27576,17530,-27684,17360,-27791,17189,-27897,17017,-28002,16845,-28106,16672,-28209,16499,-28310,16325,-28411,16150,-28511,15975,-28609,15799,-28707,15623,-28803,15446,-28898,15268,-28993,15090,-29086,14911,-29178,14732,-29269,14552,-29359,14372,-29447,14191,-29535,14009,-29622,13827,-29707,13645,-29791,13462,-29874,13278,-29956,13094,-30037,12909,-30117,12724,-30196,12539,-30273,12353,-30350,12166,-30425,11980,-30499,11792,-30572,11604,-30644,11416,-30714,11227,-30784,11038,-30852,10849,-30919,10659,-30985,10469,-31050,10278,-31114,10087,-31176,9895,-31237,9703,-31298,9511,-31357,9319,-31414,9126,-31471,8932,-31526,8739,-31581,8545,-31634,8351,-31685,8156,-31736,7961,-31786,7766,-31834,7571,-31881,7375,-31927,7179,-31971,6982,-32015,6786,-32057,6589,-32098,6392,-32138,6195,-32177,5997,-32214,5799,-32250,5601,-32285,5403,-32319,5205,-32351,5006,-32383,4807,-32413,4608,-32442,4409,-32469,4210,-32496,4011,-32521,3811,-32545,3611,-32568,3411,-32589,3211,-32610,3011,-32629,2811,-32647,2610,-32663,2410,-32679,2209,-32693,2009,-32706,1808,-32718,1607,-32728,1406,-32737,1206,-32745,1005,-32752,804,-32758,603,-32762,402,-32765,201,-32767, 32767,0,32764,-403,32757,-805,32744,-1207,32727,-1608,32705,-2010,32678,-2411,32646,-2812,32609,-3212,32567,-3612,32520,-4012,32468,-4410,32412,-4808,32350,-5206,32284,-5602,32213,-5998,32137,-6393,32056,-6787,31970,-7180,31880,-7572,31785,-7962,31684,-8352,31580,-8740,31470,-9127,31356,-9512,31236,-9896,31113,-10279,30984,-10660,30851,-11039,30713,-11417,30571,-11793,30424,-12167,30272,-12540,30116,-12910,29955,-13279,29790,-13646,29621,-14010,29446,-14373,29268,-14733,29085,-15091,28897,-15447,28706,-15800,28510,-16151,28309,-16500,28105,-16846,27896,-17190,27683,-17531,27466,-17869,27244,-18205,27019,-18538,26789,-18868,26556,-19195,26318,-19520,26077,-19841,25831,-20160,25582,-20475,25329,-20788,25072,-21097,24811,-21403,24546,-21706,24278,-22005,24006,-22302,23731,-22595,23452,-22884,23169,-23170,22883,-23453,22594,-23732,22301,-24007,22004,-24279,21705,-24547,21402,-24812,21096,-25073,20787,-25330,20474,-25583,20159,-25832,19840,-26078,19519,-26319,19194,-26557,18867,-26790,18537,-27020,18204,-27245,17868,-27467,17530,-27684,17189,-27897,16845,-28106,16499,-28310,16150,-28511,15799,-28707,15446,-28898,15090,-29086,14732,-29269,14372,-29447,14009,-29622,13645,-29791,13278,-29956,12909,-30117,12539,-30273,12166,-30425,11792,-30572,11416,-30714,11038,-30852,10659,-30985,10278,-31114,9895,-31237,9511,-31357,9126,-31471,8739,-31581,8351,-31685,7961,-31786,7571,-31881,7179,-31971,6786,-32057,6392,-32138,5997,-32214,5601,-32285,5205,-32351,4807,-32413,4409,-32469,4011,-32521,3611,-32568,3211,-32610,2811,-32647,2410,-32679,2009,-32706,1607,-32728,1206,-32745,804,-32758,402,-32765,0,-32767,-403,-32765,-805,-32758,-1207,-32745,-1608,-32728,-2010,-32706,-2411,-32679,-2812,-32647,-3212,-32610,-3612,-32568,-4012,-32521,-4410,-32469,-4808,-32413,-5206,-32351,-5602,-32285,-5998,-32214,-6393,-32138,-6787,-32057,-7180,-31971,-7572,-31881,-7962,-31786,-8352,-31685,-8740,-31581,-9127,-31471,-9512,-31357,-9896,-31237,-10279,-31114,-10660,-30985,-11039,-30852,-11417,-30714,-11793,-30572,-12167,-30425,-12540,-30273,-12910,-30117,-13279,-29956,-13646,-29791,-14010,-29622,-14373,-29447,-14733,-29269,-15091,-29086,-15447,-28898,-15800,-28707,-16151,-28511,-16500,-28310,-16846,-28106,-17190,-27897,-17531,-27684,-17869,-27467,-18205,-27245,-18538,-27020,-18868,-26790,-19195,-26557,-19520,-26319,-19841,-26078,-20160,-25832,-20475,-25583,-20788,-25330,-21097,-25073,-21403,-24812,-21706,-24547,-22005,-24279,-22302,-24007,-22595,-23732,-22884,-23453,-23170,-23170,-23453,-22884,-23732,-22595,-24007,-22302,-24279,-22005,-24547,-21706,-24812,-21403,-25073,-21097,-25330,-20788,-25583,-20475,-25832,-20160,-26078,-19841,-26319,-19520,-26557,-19195,-26790,-18868,-27020,-18538,-27245,-18205,-27467,-17869,-27684,-17531,-27897,-17190,-28106,-16846,-28310,-16500,-28511,-16151,-28707,-15800,-28898,-15447,-29086,-15091,-29269,-14733,-29447,-14373,-29622,-14010,-29791,-13646,-29956,-13279,-30117,-12910,-30273,-12540,-30425,-12167,-30572,-11793,-30714,-11417,-30852,-11039,-30985,-10660,-31114,-10279,-31237,-9896,-31357,-9512,-31471,-9127,-31581,-8740,-31685,-8352,-31786,-7962,-31881,-7572,-31971,-7180,-32057,-6787,-32138,-6393,-32214,-5998,-32285,-5602,-32351,-5206,-32413,-4808,-32469,-4410,-32521,-4012,-32568,-3612,-32610,-3212,-32647,-2812,-32679,-2411,-32706,-2010,-32728,-1608,-32745,-1207,-32758,-805,-32765,-403, 32767,0,32761,-604,32744,-1207,32717,-1809,32678,-2411,32628,-3012,32567,-3612,32495,-4211,32412,-4808,32318,-5404,32213,-5998,32097,-6590,31970,-7180,31833,-7767,31684,-8352,31525,-8933,31356,-9512,31175,-10088,30984,-10660,30783,-11228,30571,-11793,30349,-12354,30116,-12910,29873,-13463,29621,-14010,29358,-14553,29085,-15091,28802,-15624,28510,-16151,28208,-16673,27896,-17190,27575,-17700,27244,-18205,26905,-18703,26556,-19195,26198,-19681,25831,-20160,25456,-20632,25072,-21097,24679,-21555,24278,-22005,23869,-22449,23452,-22884,23027,-23312,22594,-23732,22153,-24144,21705,-24547,21249,-24943,20787,-25330,20317,-25708,19840,-26078,19357,-26438,18867,-26790,18371,-27133,17868,-27467,17360,-27791,16845,-28106,16325,-28411,15799,-28707,15268,-28993,14732,-29269,14191,-29535,13645,-29791,13094,-30037,12539,-30273,11980,-30499,11416,-30714,10849,-30919,10278,-31114,9703,-31298,9126,-31471,8545,-31634,7961,-31786,7375,-31927,6786,-32057,6195,-32177,5601,-32285,5006,-32383,4409,-32469,3811,-32545,3211,-32610,2610,-32663,2009,-32706,1406,-32737,804,-32758,201,-32767,-403,-32765,-1006,-32752,-1608,-32728,-2210,-32693,-2812,-32647,-3412,-32589,-4012,-32521,-4609,-32442,-5206,-32351,-5800,-32250,-6393,-32138,-6983,-32015,-7572,-31881,-8157,-31736,-8740,-31581,-9320,-31414,-9896,-31237,-10470,-31050,-11039,-30852,-11605,-30644,-12167,-30425,-12725,-30196,-13279,-29956,-13828,-29707,-14373,-29447,-14912,-29178,-15447,-28898,-15976,-28609,-16500,-28310,-17018,-28002,-17531,-27684,-18037,-27356,-18538,-27020,-19032,-26674,-19520,-26319,-20001,-25955,-20475,-25583,-20943,-25202,-21403,-24812,-21856,-24414,-22302,-24007,-22740,-23593,-23170,-23170,-23593,-22740,-24007,-22302,-24414,-21856,-24812,-21403,-25202,-20943,-25583,-20475,-25955,-20001,-26319,-19520,-26674,-19032,-27020,-18538,-27356,-18037,-27684,-17531,-28002,-17018,-28310,-16500,-28609,-15976,-28898,-15447,-29178,-14912,-29447,-14373,-29707,-13828,-29956,-13279,-30196,-12725,-30425,-12167,-30644,-11605,-30852,-11039,-31050,-10470,-31237,-9896,-31414,-9320,-31581,-8740,-31736,-8157,-31881,-7572,-32015,-6983,-32138,-6393,-32250,-5800,-32351,-5206,-32442,-4609,-32521,-4012,-32589,-3412,-32647,-2812,-32693,-2210,-32728,-1608,-32752,-1006,-32765,-403,-32767,201,-32758,804,-32737,1406,-32706,2009,-32663,2610,-32610,3211,-32545,3811,-32469,4409,-32383,5006,-32285,5601,-32177,6195,-32057,6786,-31927,7375,-31786,7961,-31634,8545,-31471,9126,-31298,9703,-31114,10278,-30919,10849,-30714,11416,-30499,11980,-30273,12539,-30037,13094,-29791,13645,-29535,14191,-29269,14732,-28993,15268,-28707,15799,-28411,16325,-28106,16845,-27791,17360,-27467,17868,-27133,18371,-26790,18867,-26438,19357,-26078,19840,-25708,20317,-25330,20787,-24943,21249,-24547,21705,-24144,22153,-23732,22594,-23312,23027,-22884,23452,-22449,23869,-22005,24278,-21555,24679,-21097,25072,-20632,25456,-20160,25831,-19681,26198,-19195,26556,-18703,26905,-18205,27244,-17700,27575,-17190,27896,-16673,28208,-16151,28510,-15624,28802,-15091,29085,-14553,29358,-14010,29621,-13463,29873,-12910,30116,-12354,30349,-11793,30571,-11228,30783,-10660,30984,-10088,31175,-9512,31356,-8933,31525,-8352,31684,-7767,31833,-7180,31970,-6590,32097,-5998,32213,-5404,32318,-4808,32412,-4211,32495,-3612,32567,-3012,32628,-2411,32678,-1809,32717,-1207,32744,-604,32761 }; @@ -2683,7 +4309,121 @@ void idft1024(int16_t *x,int16_t *y,int scale) } -int16_t tw2048[2048] __attribute__((aligned(16))) = {32767,0,32766,-101,32766,-202,32765,-302,32764,-403,32763,-503,32761,-604,32759,-704,32757,-805,32754,-905,32751,-1006,32748,-1106,32744,-1207,32740,-1307,32736,-1407,32732,-1508,32727,-1608,32722,-1709,32717,-1809,32711,-1909,32705,-2010,32699,-2110,32692,-2210,32685,-2311,32678,-2411,32670,-2511,32662,-2611,32654,-2712,32646,-2812,32637,-2912,32628,-3012,32618,-3112,32609,-3212,32599,-3312,32588,-3412,32578,-3512,32567,-3612,32556,-3712,32544,-3812,32532,-3912,32520,-4012,32508,-4111,32495,-4211,32482,-4311,32468,-4410,32455,-4510,32441,-4609,32426,-4709,32412,-4808,32397,-4908,32382,-5007,32366,-5107,32350,-5206,32334,-5305,32318,-5404,32301,-5503,32284,-5602,32267,-5701,32249,-5800,32231,-5899,32213,-5998,32194,-6097,32176,-6196,32156,-6294,32137,-6393,32117,-6492,32097,-6590,32077,-6689,32056,-6787,32035,-6885,32014,-6983,31992,-7082,31970,-7180,31948,-7278,31926,-7376,31903,-7474,31880,-7572,31856,-7669,31833,-7767,31809,-7865,31785,-7962,31760,-8060,31735,-8157,31710,-8254,31684,-8352,31659,-8449,31633,-8546,31606,-8643,31580,-8740,31553,-8837,31525,-8933,31498,-9030,31470,-9127,31442,-9223,31413,-9320,31385,-9416,31356,-9512,31326,-9608,31297,-9704,31267,-9800,31236,-9896,31206,-9992,31175,-10088,31144,-10183,31113,-10279,31081,-10374,31049,-10470,31017,-10565,30984,-10660,30951,-10755,30918,-10850,30885,-10945,30851,-11039,30817,-11134,30783,-11228,30748,-11323,30713,-11417,30678,-11511,30643,-11605,30607,-11699,30571,-11793,30535,-11887,30498,-11981,30461,-12074,30424,-12167,30386,-12261,30349,-12354,30311,-12447,30272,-12540,30234,-12633,30195,-12725,30156,-12818,30116,-12910,30076,-13003,30036,-13095,29996,-13187,29955,-13279,29915,-13371,29873,-13463,29832,-13554,29790,-13646,29748,-13737,29706,-13828,29663,-13919,29621,-14010,29577,-14101,29534,-14192,29490,-14282,29446,-14373,29402,-14463,29358,-14553,29313,-14643,29268,-14733,29222,-14823,29177,-14912,29131,-15002,29085,-15091,29038,-15180,28992,-15269,28945,-15358,28897,-15447,28850,-15535,28802,-15624,28754,-15712,28706,-15800,28657,-15888,28608,-15976,28559,-16064,28510,-16151,28460,-16239,28410,-16326,28360,-16413,28309,-16500,28259,-16587,28208,-16673,28156,-16760,28105,-16846,28053,-16932,28001,-17018,27948,-17104,27896,-17190,27843,-17275,27790,-17361,27736,-17446,27683,-17531,27629,-17616,27575,-17700,27520,-17785,27466,-17869,27411,-17953,27355,-18037,27300,-18121,27244,-18205,27188,-18288,27132,-18372,27076,-18455,27019,-18538,26962,-18621,26905,-18703,26847,-18786,26789,-18868,26731,-18950,26673,-19032,26615,-19114,26556,-19195,26497,-19277,26437,-19358,26378,-19439,26318,-19520,26258,-19600,26198,-19681,26137,-19761,26077,-19841,26016,-19921,25954,-20001,25893,-20080,25831,-20160,25769,-20239,25707,-20318,25645,-20397,25582,-20475,25519,-20554,25456,-20632,25392,-20710,25329,-20788,25265,-20865,25201,-20943,25136,-21020,25072,-21097,25007,-21174,24942,-21250,24877,-21327,24811,-21403,24745,-21479,24679,-21555,24613,-21630,24546,-21706,24480,-21781,24413,-21856,24346,-21931,24278,-22005,24211,-22080,24143,-22154,24075,-22228,24006,-22302,23938,-22375,23869,-22449,23800,-22522,23731,-22595,23661,-22667,23592,-22740,23522,-22812,23452,-22884,23382,-22956,23311,-23028,23240,-23099,23169,-23170,23098,-23241,23027,-23312,22955,-23383,22883,-23453,22811,-23523,22739,-23593,22666,-23662,22594,-23732,22521,-23801,22448,-23870,22374,-23939,22301,-24007,22227,-24076,22153,-24144,22079,-24212,22004,-24279,21930,-24347,21855,-24414,21780,-24481,21705,-24547,21629,-24614,21554,-24680,21478,-24746,21402,-24812,21326,-24878,21249,-24943,21173,-25008,21096,-25073,21019,-25137,20942,-25202,20864,-25266,20787,-25330,20709,-25393,20631,-25457,20553,-25520,20474,-25583,20396,-25646,20317,-25708,20238,-25770,20159,-25832,20079,-25894,20000,-25955,19920,-26017,19840,-26078,19760,-26138,19680,-26199,19599,-26259,19519,-26319,19438,-26379,19357,-26438,19276,-26498,19194,-26557,19113,-26616,19031,-26674,18949,-26732,18867,-26790,18785,-26848,18702,-26906,18620,-26963,18537,-27020,18454,-27077,18371,-27133,18287,-27189,18204,-27245,18120,-27301,18036,-27356,17952,-27412,17868,-27467,17784,-27521,17699,-27576,17615,-27630,17530,-27684,17445,-27737,17360,-27791,17274,-27844,17189,-27897,17103,-27949,17017,-28002,16931,-28054,16845,-28106,16759,-28157,16672,-28209,16586,-28260,16499,-28310,16412,-28361,16325,-28411,16238,-28461,16150,-28511,16063,-28560,15975,-28609,15887,-28658,15799,-28707,15711,-28755,15623,-28803,15534,-28851,15446,-28898,15357,-28946,15268,-28993,15179,-29039,15090,-29086,15001,-29132,14911,-29178,14822,-29223,14732,-29269,14642,-29314,14552,-29359,14462,-29403,14372,-29447,14281,-29491,14191,-29535,14100,-29578,14009,-29622,13918,-29664,13827,-29707,13736,-29749,13645,-29791,13553,-29833,13462,-29874,13370,-29916,13278,-29956,13186,-29997,13094,-30037,13002,-30077,12909,-30117,12817,-30157,12724,-30196,12632,-30235,12539,-30273,12446,-30312,12353,-30350,12260,-30387,12166,-30425,12073,-30462,11980,-30499,11886,-30536,11792,-30572,11698,-30608,11604,-30644,11510,-30679,11416,-30714,11322,-30749,11227,-30784,11133,-30818,11038,-30852,10944,-30886,10849,-30919,10754,-30952,10659,-30985,10564,-31018,10469,-31050,10373,-31082,10278,-31114,10182,-31145,10087,-31176,9991,-31207,9895,-31237,9799,-31268,9703,-31298,9607,-31327,9511,-31357,9415,-31386,9319,-31414,9222,-31443,9126,-31471,9029,-31499,8932,-31526,8836,-31554,8739,-31581,8642,-31607,8545,-31634,8448,-31660,8351,-31685,8253,-31711,8156,-31736,8059,-31761,7961,-31786,7864,-31810,7766,-31834,7668,-31857,7571,-31881,7473,-31904,7375,-31927,7277,-31949,7179,-31971,7081,-31993,6982,-32015,6884,-32036,6786,-32057,6688,-32078,6589,-32098,6491,-32118,6392,-32138,6293,-32157,6195,-32177,6096,-32195,5997,-32214,5898,-32232,5799,-32250,5700,-32268,5601,-32285,5502,-32302,5403,-32319,5304,-32335,5205,-32351,5106,-32367,5006,-32383,4907,-32398,4807,-32413,4708,-32427,4608,-32442,4509,-32456,4409,-32469,4310,-32483,4210,-32496,4110,-32509,4011,-32521,3911,-32533,3811,-32545,3711,-32557,3611,-32568,3511,-32579,3411,-32589,3311,-32600,3211,-32610,3111,-32619,3011,-32629,2911,-32638,2811,-32647,2711,-32655,2610,-32663,2510,-32671,2410,-32679,2310,-32686,2209,-32693,2109,-32700,2009,-32706,1908,-32712,1808,-32718,1708,-32723,1607,-32728,1507,-32733,1406,-32737,1306,-32741,1206,-32745,1105,-32749,1005,-32752,904,-32755,804,-32758,703,-32760,603,-32762,502,-32764,402,-32765,301,-32766,201,-32767,100,-32767,0,-32767,-101,-32767,-202,-32767,-302,-32766,-403,-32765,-503,-32764,-604,-32762,-704,-32760,-805,-32758,-905,-32755,-1006,-32752,-1106,-32749,-1207,-32745,-1307,-32741,-1407,-32737,-1508,-32733,-1608,-32728,-1709,-32723,-1809,-32718,-1909,-32712,-2010,-32706,-2110,-32700,-2210,-32693,-2311,-32686,-2411,-32679,-2511,-32671,-2611,-32663,-2712,-32655,-2812,-32647,-2912,-32638,-3012,-32629,-3112,-32619,-3212,-32610,-3312,-32600,-3412,-32589,-3512,-32579,-3612,-32568,-3712,-32557,-3812,-32545,-3912,-32533,-4012,-32521,-4111,-32509,-4211,-32496,-4311,-32483,-4410,-32469,-4510,-32456,-4609,-32442,-4709,-32427,-4808,-32413,-4908,-32398,-5007,-32383,-5107,-32367,-5206,-32351,-5305,-32335,-5404,-32319,-5503,-32302,-5602,-32285,-5701,-32268,-5800,-32250,-5899,-32232,-5998,-32214,-6097,-32195,-6196,-32177,-6294,-32157,-6393,-32138,-6492,-32118,-6590,-32098,-6689,-32078,-6787,-32057,-6885,-32036,-6983,-32015,-7082,-31993,-7180,-31971,-7278,-31949,-7376,-31927,-7474,-31904,-7572,-31881,-7669,-31857,-7767,-31834,-7865,-31810,-7962,-31786,-8060,-31761,-8157,-31736,-8254,-31711,-8352,-31685,-8449,-31660,-8546,-31634,-8643,-31607,-8740,-31581,-8837,-31554,-8933,-31526,-9030,-31499,-9127,-31471,-9223,-31443,-9320,-31414,-9416,-31386,-9512,-31357,-9608,-31327,-9704,-31298,-9800,-31268,-9896,-31237,-9992,-31207,-10088,-31176,-10183,-31145,-10279,-31114,-10374,-31082,-10470,-31050,-10565,-31018,-10660,-30985,-10755,-30952,-10850,-30919,-10945,-30886,-11039,-30852,-11134,-30818,-11228,-30784,-11323,-30749,-11417,-30714,-11511,-30679,-11605,-30644,-11699,-30608,-11793,-30572,-11887,-30536,-11981,-30499,-12074,-30462,-12167,-30425,-12261,-30387,-12354,-30350,-12447,-30312,-12540,-30273,-12633,-30235,-12725,-30196,-12818,-30157,-12910,-30117,-13003,-30077,-13095,-30037,-13187,-29997,-13279,-29956,-13371,-29916,-13463,-29874,-13554,-29833,-13646,-29791,-13737,-29749,-13828,-29707,-13919,-29664,-14010,-29622,-14101,-29578,-14192,-29535,-14282,-29491,-14373,-29447,-14463,-29403,-14553,-29359,-14643,-29314,-14733,-29269,-14823,-29223,-14912,-29178,-15002,-29132,-15091,-29086,-15180,-29039,-15269,-28993,-15358,-28946,-15447,-28898,-15535,-28851,-15624,-28803,-15712,-28755,-15800,-28707,-15888,-28658,-15976,-28609,-16064,-28560,-16151,-28511,-16239,-28461,-16326,-28411,-16413,-28361,-16500,-28310,-16587,-28260,-16673,-28209,-16760,-28157,-16846,-28106,-16932,-28054,-17018,-28002,-17104,-27949,-17190,-27897,-17275,-27844,-17361,-27791,-17446,-27737,-17531,-27684,-17616,-27630,-17700,-27576,-17785,-27521,-17869,-27467,-17953,-27412,-18037,-27356,-18121,-27301,-18205,-27245,-18288,-27189,-18372,-27133,-18455,-27077,-18538,-27020,-18621,-26963,-18703,-26906,-18786,-26848,-18868,-26790,-18950,-26732,-19032,-26674,-19114,-26616,-19195,-26557,-19277,-26498,-19358,-26438,-19439,-26379,-19520,-26319,-19600,-26259,-19681,-26199,-19761,-26138,-19841,-26078,-19921,-26017,-20001,-25955,-20080,-25894,-20160,-25832,-20239,-25770,-20318,-25708,-20397,-25646,-20475,-25583,-20554,-25520,-20632,-25457,-20710,-25393,-20788,-25330,-20865,-25266,-20943,-25202,-21020,-25137,-21097,-25073,-21174,-25008,-21250,-24943,-21327,-24878,-21403,-24812,-21479,-24746,-21555,-24680,-21630,-24614,-21706,-24547,-21781,-24481,-21856,-24414,-21931,-24347,-22005,-24279,-22080,-24212,-22154,-24144,-22228,-24076,-22302,-24007,-22375,-23939,-22449,-23870,-22522,-23801,-22595,-23732,-22667,-23662,-22740,-23593,-22812,-23523,-22884,-23453,-22956,-23383,-23028,-23312,-23099,-23241,-23170,-23170,-23241,-23099,-23312,-23028,-23383,-22956,-23453,-22884,-23523,-22812,-23593,-22740,-23662,-22667,-23732,-22595,-23801,-22522,-23870,-22449,-23939,-22375,-24007,-22302,-24076,-22228,-24144,-22154,-24212,-22080,-24279,-22005,-24347,-21931,-24414,-21856,-24481,-21781,-24547,-21706,-24614,-21630,-24680,-21555,-24746,-21479,-24812,-21403,-24878,-21327,-24943,-21250,-25008,-21174,-25073,-21097,-25137,-21020,-25202,-20943,-25266,-20865,-25330,-20788,-25393,-20710,-25457,-20632,-25520,-20554,-25583,-20475,-25646,-20397,-25708,-20318,-25770,-20239,-25832,-20160,-25894,-20080,-25955,-20001,-26017,-19921,-26078,-19841,-26138,-19761,-26199,-19681,-26259,-19600,-26319,-19520,-26379,-19439,-26438,-19358,-26498,-19277,-26557,-19195,-26616,-19114,-26674,-19032,-26732,-18950,-26790,-18868,-26848,-18786,-26906,-18703,-26963,-18621,-27020,-18538,-27077,-18455,-27133,-18372,-27189,-18288,-27245,-18205,-27301,-18121,-27356,-18037,-27412,-17953,-27467,-17869,-27521,-17785,-27576,-17700,-27630,-17616,-27684,-17531,-27737,-17446,-27791,-17361,-27844,-17275,-27897,-17190,-27949,-17104,-28002,-17018,-28054,-16932,-28106,-16846,-28157,-16760,-28209,-16673,-28260,-16587,-28310,-16500,-28361,-16413,-28411,-16326,-28461,-16239,-28511,-16151,-28560,-16064,-28609,-15976,-28658,-15888,-28707,-15800,-28755,-15712,-28803,-15624,-28851,-15535,-28898,-15447,-28946,-15358,-28993,-15269,-29039,-15180,-29086,-15091,-29132,-15002,-29178,-14912,-29223,-14823,-29269,-14733,-29314,-14643,-29359,-14553,-29403,-14463,-29447,-14373,-29491,-14282,-29535,-14192,-29578,-14101,-29622,-14010,-29664,-13919,-29707,-13828,-29749,-13737,-29791,-13646,-29833,-13554,-29874,-13463,-29916,-13371,-29956,-13279,-29997,-13187,-30037,-13095,-30077,-13003,-30117,-12910,-30157,-12818,-30196,-12725,-30235,-12633,-30273,-12540,-30312,-12447,-30350,-12354,-30387,-12261,-30425,-12167,-30462,-12074,-30499,-11981,-30536,-11887,-30572,-11793,-30608,-11699,-30644,-11605,-30679,-11511,-30714,-11417,-30749,-11323,-30784,-11228,-30818,-11134,-30852,-11039,-30886,-10945,-30919,-10850,-30952,-10755,-30985,-10660,-31018,-10565,-31050,-10470,-31082,-10374,-31114,-10279,-31145,-10183,-31176,-10088,-31207,-9992,-31237,-9896,-31268,-9800,-31298,-9704,-31327,-9608,-31357,-9512,-31386,-9416,-31414,-9320,-31443,-9223,-31471,-9127,-31499,-9030,-31526,-8933,-31554,-8837,-31581,-8740,-31607,-8643,-31634,-8546,-31660,-8449,-31685,-8352,-31711,-8254,-31736,-8157,-31761,-8060,-31786,-7962,-31810,-7865,-31834,-7767,-31857,-7669,-31881,-7572,-31904,-7474,-31927,-7376,-31949,-7278,-31971,-7180,-31993,-7082,-32015,-6983,-32036,-6885,-32057,-6787,-32078,-6689,-32098,-6590,-32118,-6492,-32138,-6393,-32157,-6294,-32177,-6196,-32195,-6097,-32214,-5998,-32232,-5899,-32250,-5800,-32268,-5701,-32285,-5602,-32302,-5503,-32319,-5404,-32335,-5305,-32351,-5206,-32367,-5107,-32383,-5007,-32398,-4908,-32413,-4808,-32427,-4709,-32442,-4609,-32456,-4510,-32469,-4410,-32483,-4311,-32496,-4211,-32509,-4111,-32521,-4012,-32533,-3912,-32545,-3812,-32557,-3712,-32568,-3612,-32579,-3512,-32589,-3412,-32600,-3312,-32610,-3212,-32619,-3112,-32629,-3012,-32638,-2912,-32647,-2812,-32655,-2712,-32663,-2611,-32671,-2511,-32679,-2411,-32686,-2311,-32693,-2210,-32700,-2110,-32706,-2010,-32712,-1909,-32718,-1809,-32723,-1709,-32728,-1608,-32733,-1508,-32737,-1407,-32741,-1307,-32745,-1207,-32749,-1106,-32752,-1006,-32755,-905,-32758,-805,-32760,-704,-32762,-604,-32764,-503,-32765,-403,-32766,-302,-32767,-202,-32767,-101}; +#ifdef __AVX2__ +void dft1024_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[128],ytmp[128],*tw1024_256p=(simd256_q15_t *)tw1024,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i,j; + + for (i=0,j=0; i<128; i+=4,j++) { + transpose16_ooff_simd256(x256+i,xtmp+j,32); + } + + + dft256_simd256((int16_t*)(xtmp),(int16_t*)(ytmp),1); + dft256_simd256((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1); + dft256_simd256((int16_t*)(xtmp+64),(int16_t*)(ytmp+64),1); + dft256_simd256((int16_t*)(xtmp+96),(int16_t*)(ytmp+96),1); + + for (i=0; i<32; i++) { + bfly4_256(ytmpp,ytmpp+32,ytmpp+64,ytmpp+96, + y256p,y256p+32,y256p+64,y256p+96, + tw1024_256p,tw1024_256p+32,tw1024_256p+64); + tw1024_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0; i<8; i++) { + y256[0] = shiftright_int16_simd256(y256[0],1); + y256[1] = shiftright_int16_simd256(y256[1],1); + y256[2] = shiftright_int16_simd256(y256[2],1); + y256[3] = shiftright_int16_simd256(y256[3],1); + y256[4] = shiftright_int16_simd256(y256[4],1); + y256[5] = shiftright_int16_simd256(y256[5],1); + y256[6] = shiftright_int16_simd256(y256[6],1); + y256[7] = shiftright_int16_simd256(y256[7],1); + y256[8] = shiftright_int16_simd256(y256[8],1); + y256[9] = shiftright_int16_simd256(y256[9],1); + y256[10] = shiftright_int16_simd256(y256[10],1); + y256[11] = shiftright_int16_simd256(y256[11],1); + y256[12] = shiftright_int16_simd256(y256[12],1); + y256[13] = shiftright_int16_simd256(y256[13],1); + y256[14] = shiftright_int16_simd256(y256[14],1); + y256[15] = shiftright_int16_simd256(y256[15],1); + + y256+=16; + } + + } + + _mm_empty(); + _m_empty(); + +} + +void idft1024_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[128],ytmp[128],*tw1024_256p=(simd256_q15_t *)tw1024,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i,j; + + for (i=0,j=0; i<128; i+=4,j++) { + transpose16_ooff_simd256(x256+i,xtmp+j,32); + } + + + idft256_simd256((int16_t*)(xtmp),(int16_t*)(ytmp),1); + idft256_simd256((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1); + idft256_simd256((int16_t*)(xtmp+64),(int16_t*)(ytmp+64),1); + idft256_simd256((int16_t*)(xtmp+96),(int16_t*)(ytmp+96),1); + + for (i=0; i<32; i++) { + ibfly4_256(ytmpp,ytmpp+32,ytmpp+64,ytmpp+96, + y256p,y256p+32,y256p+64,y256p+96, + tw1024_256p,tw1024_256p+32,tw1024_256p+64); + tw1024_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0; i<8; i++) { + y256[0] = shiftright_int16_simd256(y256[0],1); + y256[1] = shiftright_int16_simd256(y256[1],1); + y256[2] = shiftright_int16_simd256(y256[2],1); + y256[3] = shiftright_int16_simd256(y256[3],1); + y256[4] = shiftright_int16_simd256(y256[4],1); + y256[5] = shiftright_int16_simd256(y256[5],1); + y256[6] = shiftright_int16_simd256(y256[6],1); + y256[7] = shiftright_int16_simd256(y256[7],1); + y256[8] = shiftright_int16_simd256(y256[8],1); + y256[9] = shiftright_int16_simd256(y256[9],1); + y256[10] = shiftright_int16_simd256(y256[10],1); + y256[11] = shiftright_int16_simd256(y256[11],1); + y256[12] = shiftright_int16_simd256(y256[12],1); + y256[13] = shiftright_int16_simd256(y256[13],1); + y256[14] = shiftright_int16_simd256(y256[14],1); + y256[15] = shiftright_int16_simd256(y256[15],1); + + y256+=16; + } + + } + + _mm_empty(); + _m_empty(); + +} +#endif + +int16_t tw2048[2048] __attribute__((aligned(32))) = {32767,0,32766,-101,32766,-202,32765,-302,32764,-403,32763,-503,32761,-604,32759,-704,32757,-805,32754,-905,32751,-1006,32748,-1106,32744,-1207,32740,-1307,32736,-1407,32732,-1508,32727,-1608,32722,-1709,32717,-1809,32711,-1909,32705,-2010,32699,-2110,32692,-2210,32685,-2311,32678,-2411,32670,-2511,32662,-2611,32654,-2712,32646,-2812,32637,-2912,32628,-3012,32618,-3112,32609,-3212,32599,-3312,32588,-3412,32578,-3512,32567,-3612,32556,-3712,32544,-3812,32532,-3912,32520,-4012,32508,-4111,32495,-4211,32482,-4311,32468,-4410,32455,-4510,32441,-4609,32426,-4709,32412,-4808,32397,-4908,32382,-5007,32366,-5107,32350,-5206,32334,-5305,32318,-5404,32301,-5503,32284,-5602,32267,-5701,32249,-5800,32231,-5899,32213,-5998,32194,-6097,32176,-6196,32156,-6294,32137,-6393,32117,-6492,32097,-6590,32077,-6689,32056,-6787,32035,-6885,32014,-6983,31992,-7082,31970,-7180,31948,-7278,31926,-7376,31903,-7474,31880,-7572,31856,-7669,31833,-7767,31809,-7865,31785,-7962,31760,-8060,31735,-8157,31710,-8254,31684,-8352,31659,-8449,31633,-8546,31606,-8643,31580,-8740,31553,-8837,31525,-8933,31498,-9030,31470,-9127,31442,-9223,31413,-9320,31385,-9416,31356,-9512,31326,-9608,31297,-9704,31267,-9800,31236,-9896,31206,-9992,31175,-10088,31144,-10183,31113,-10279,31081,-10374,31049,-10470,31017,-10565,30984,-10660,30951,-10755,30918,-10850,30885,-10945,30851,-11039,30817,-11134,30783,-11228,30748,-11323,30713,-11417,30678,-11511,30643,-11605,30607,-11699,30571,-11793,30535,-11887,30498,-11981,30461,-12074,30424,-12167,30386,-12261,30349,-12354,30311,-12447,30272,-12540,30234,-12633,30195,-12725,30156,-12818,30116,-12910,30076,-13003,30036,-13095,29996,-13187,29955,-13279,29915,-13371,29873,-13463,29832,-13554,29790,-13646,29748,-13737,29706,-13828,29663,-13919,29621,-14010,29577,-14101,29534,-14192,29490,-14282,29446,-14373,29402,-14463,29358,-14553,29313,-14643,29268,-14733,29222,-14823,29177,-14912,29131,-15002,29085,-15091,29038,-15180,28992,-15269,28945,-15358,28897,-15447,28850,-15535,28802,-15624,28754,-15712,28706,-15800,28657,-15888,28608,-15976,28559,-16064,28510,-16151,28460,-16239,28410,-16326,28360,-16413,28309,-16500,28259,-16587,28208,-16673,28156,-16760,28105,-16846,28053,-16932,28001,-17018,27948,-17104,27896,-17190,27843,-17275,27790,-17361,27736,-17446,27683,-17531,27629,-17616,27575,-17700,27520,-17785,27466,-17869,27411,-17953,27355,-18037,27300,-18121,27244,-18205,27188,-18288,27132,-18372,27076,-18455,27019,-18538,26962,-18621,26905,-18703,26847,-18786,26789,-18868,26731,-18950,26673,-19032,26615,-19114,26556,-19195,26497,-19277,26437,-19358,26378,-19439,26318,-19520,26258,-19600,26198,-19681,26137,-19761,26077,-19841,26016,-19921,25954,-20001,25893,-20080,25831,-20160,25769,-20239,25707,-20318,25645,-20397,25582,-20475,25519,-20554,25456,-20632,25392,-20710,25329,-20788,25265,-20865,25201,-20943,25136,-21020,25072,-21097,25007,-21174,24942,-21250,24877,-21327,24811,-21403,24745,-21479,24679,-21555,24613,-21630,24546,-21706,24480,-21781,24413,-21856,24346,-21931,24278,-22005,24211,-22080,24143,-22154,24075,-22228,24006,-22302,23938,-22375,23869,-22449,23800,-22522,23731,-22595,23661,-22667,23592,-22740,23522,-22812,23452,-22884,23382,-22956,23311,-23028,23240,-23099,23169,-23170,23098,-23241,23027,-23312,22955,-23383,22883,-23453,22811,-23523,22739,-23593,22666,-23662,22594,-23732,22521,-23801,22448,-23870,22374,-23939,22301,-24007,22227,-24076,22153,-24144,22079,-24212,22004,-24279,21930,-24347,21855,-24414,21780,-24481,21705,-24547,21629,-24614,21554,-24680,21478,-24746,21402,-24812,21326,-24878,21249,-24943,21173,-25008,21096,-25073,21019,-25137,20942,-25202,20864,-25266,20787,-25330,20709,-25393,20631,-25457,20553,-25520,20474,-25583,20396,-25646,20317,-25708,20238,-25770,20159,-25832,20079,-25894,20000,-25955,19920,-26017,19840,-26078,19760,-26138,19680,-26199,19599,-26259,19519,-26319,19438,-26379,19357,-26438,19276,-26498,19194,-26557,19113,-26616,19031,-26674,18949,-26732,18867,-26790,18785,-26848,18702,-26906,18620,-26963,18537,-27020,18454,-27077,18371,-27133,18287,-27189,18204,-27245,18120,-27301,18036,-27356,17952,-27412,17868,-27467,17784,-27521,17699,-27576,17615,-27630,17530,-27684,17445,-27737,17360,-27791,17274,-27844,17189,-27897,17103,-27949,17017,-28002,16931,-28054,16845,-28106,16759,-28157,16672,-28209,16586,-28260,16499,-28310,16412,-28361,16325,-28411,16238,-28461,16150,-28511,16063,-28560,15975,-28609,15887,-28658,15799,-28707,15711,-28755,15623,-28803,15534,-28851,15446,-28898,15357,-28946,15268,-28993,15179,-29039,15090,-29086,15001,-29132,14911,-29178,14822,-29223,14732,-29269,14642,-29314,14552,-29359,14462,-29403,14372,-29447,14281,-29491,14191,-29535,14100,-29578,14009,-29622,13918,-29664,13827,-29707,13736,-29749,13645,-29791,13553,-29833,13462,-29874,13370,-29916,13278,-29956,13186,-29997,13094,-30037,13002,-30077,12909,-30117,12817,-30157,12724,-30196,12632,-30235,12539,-30273,12446,-30312,12353,-30350,12260,-30387,12166,-30425,12073,-30462,11980,-30499,11886,-30536,11792,-30572,11698,-30608,11604,-30644,11510,-30679,11416,-30714,11322,-30749,11227,-30784,11133,-30818,11038,-30852,10944,-30886,10849,-30919,10754,-30952,10659,-30985,10564,-31018,10469,-31050,10373,-31082,10278,-31114,10182,-31145,10087,-31176,9991,-31207,9895,-31237,9799,-31268,9703,-31298,9607,-31327,9511,-31357,9415,-31386,9319,-31414,9222,-31443,9126,-31471,9029,-31499,8932,-31526,8836,-31554,8739,-31581,8642,-31607,8545,-31634,8448,-31660,8351,-31685,8253,-31711,8156,-31736,8059,-31761,7961,-31786,7864,-31810,7766,-31834,7668,-31857,7571,-31881,7473,-31904,7375,-31927,7277,-31949,7179,-31971,7081,-31993,6982,-32015,6884,-32036,6786,-32057,6688,-32078,6589,-32098,6491,-32118,6392,-32138,6293,-32157,6195,-32177,6096,-32195,5997,-32214,5898,-32232,5799,-32250,5700,-32268,5601,-32285,5502,-32302,5403,-32319,5304,-32335,5205,-32351,5106,-32367,5006,-32383,4907,-32398,4807,-32413,4708,-32427,4608,-32442,4509,-32456,4409,-32469,4310,-32483,4210,-32496,4110,-32509,4011,-32521,3911,-32533,3811,-32545,3711,-32557,3611,-32568,3511,-32579,3411,-32589,3311,-32600,3211,-32610,3111,-32619,3011,-32629,2911,-32638,2811,-32647,2711,-32655,2610,-32663,2510,-32671,2410,-32679,2310,-32686,2209,-32693,2109,-32700,2009,-32706,1908,-32712,1808,-32718,1708,-32723,1607,-32728,1507,-32733,1406,-32737,1306,-32741,1206,-32745,1105,-32749,1005,-32752,904,-32755,804,-32758,703,-32760,603,-32762,502,-32764,402,-32765,301,-32766,201,-32767,100,-32767,0,-32767,-101,-32767,-202,-32767,-302,-32766,-403,-32765,-503,-32764,-604,-32762,-704,-32760,-805,-32758,-905,-32755,-1006,-32752,-1106,-32749,-1207,-32745,-1307,-32741,-1407,-32737,-1508,-32733,-1608,-32728,-1709,-32723,-1809,-32718,-1909,-32712,-2010,-32706,-2110,-32700,-2210,-32693,-2311,-32686,-2411,-32679,-2511,-32671,-2611,-32663,-2712,-32655,-2812,-32647,-2912,-32638,-3012,-32629,-3112,-32619,-3212,-32610,-3312,-32600,-3412,-32589,-3512,-32579,-3612,-32568,-3712,-32557,-3812,-32545,-3912,-32533,-4012,-32521,-4111,-32509,-4211,-32496,-4311,-32483,-4410,-32469,-4510,-32456,-4609,-32442,-4709,-32427,-4808,-32413,-4908,-32398,-5007,-32383,-5107,-32367,-5206,-32351,-5305,-32335,-5404,-32319,-5503,-32302,-5602,-32285,-5701,-32268,-5800,-32250,-5899,-32232,-5998,-32214,-6097,-32195,-6196,-32177,-6294,-32157,-6393,-32138,-6492,-32118,-6590,-32098,-6689,-32078,-6787,-32057,-6885,-32036,-6983,-32015,-7082,-31993,-7180,-31971,-7278,-31949,-7376,-31927,-7474,-31904,-7572,-31881,-7669,-31857,-7767,-31834,-7865,-31810,-7962,-31786,-8060,-31761,-8157,-31736,-8254,-31711,-8352,-31685,-8449,-31660,-8546,-31634,-8643,-31607,-8740,-31581,-8837,-31554,-8933,-31526,-9030,-31499,-9127,-31471,-9223,-31443,-9320,-31414,-9416,-31386,-9512,-31357,-9608,-31327,-9704,-31298,-9800,-31268,-9896,-31237,-9992,-31207,-10088,-31176,-10183,-31145,-10279,-31114,-10374,-31082,-10470,-31050,-10565,-31018,-10660,-30985,-10755,-30952,-10850,-30919,-10945,-30886,-11039,-30852,-11134,-30818,-11228,-30784,-11323,-30749,-11417,-30714,-11511,-30679,-11605,-30644,-11699,-30608,-11793,-30572,-11887,-30536,-11981,-30499,-12074,-30462,-12167,-30425,-12261,-30387,-12354,-30350,-12447,-30312,-12540,-30273,-12633,-30235,-12725,-30196,-12818,-30157,-12910,-30117,-13003,-30077,-13095,-30037,-13187,-29997,-13279,-29956,-13371,-29916,-13463,-29874,-13554,-29833,-13646,-29791,-13737,-29749,-13828,-29707,-13919,-29664,-14010,-29622,-14101,-29578,-14192,-29535,-14282,-29491,-14373,-29447,-14463,-29403,-14553,-29359,-14643,-29314,-14733,-29269,-14823,-29223,-14912,-29178,-15002,-29132,-15091,-29086,-15180,-29039,-15269,-28993,-15358,-28946,-15447,-28898,-15535,-28851,-15624,-28803,-15712,-28755,-15800,-28707,-15888,-28658,-15976,-28609,-16064,-28560,-16151,-28511,-16239,-28461,-16326,-28411,-16413,-28361,-16500,-28310,-16587,-28260,-16673,-28209,-16760,-28157,-16846,-28106,-16932,-28054,-17018,-28002,-17104,-27949,-17190,-27897,-17275,-27844,-17361,-27791,-17446,-27737,-17531,-27684,-17616,-27630,-17700,-27576,-17785,-27521,-17869,-27467,-17953,-27412,-18037,-27356,-18121,-27301,-18205,-27245,-18288,-27189,-18372,-27133,-18455,-27077,-18538,-27020,-18621,-26963,-18703,-26906,-18786,-26848,-18868,-26790,-18950,-26732,-19032,-26674,-19114,-26616,-19195,-26557,-19277,-26498,-19358,-26438,-19439,-26379,-19520,-26319,-19600,-26259,-19681,-26199,-19761,-26138,-19841,-26078,-19921,-26017,-20001,-25955,-20080,-25894,-20160,-25832,-20239,-25770,-20318,-25708,-20397,-25646,-20475,-25583,-20554,-25520,-20632,-25457,-20710,-25393,-20788,-25330,-20865,-25266,-20943,-25202,-21020,-25137,-21097,-25073,-21174,-25008,-21250,-24943,-21327,-24878,-21403,-24812,-21479,-24746,-21555,-24680,-21630,-24614,-21706,-24547,-21781,-24481,-21856,-24414,-21931,-24347,-22005,-24279,-22080,-24212,-22154,-24144,-22228,-24076,-22302,-24007,-22375,-23939,-22449,-23870,-22522,-23801,-22595,-23732,-22667,-23662,-22740,-23593,-22812,-23523,-22884,-23453,-22956,-23383,-23028,-23312,-23099,-23241,-23170,-23170,-23241,-23099,-23312,-23028,-23383,-22956,-23453,-22884,-23523,-22812,-23593,-22740,-23662,-22667,-23732,-22595,-23801,-22522,-23870,-22449,-23939,-22375,-24007,-22302,-24076,-22228,-24144,-22154,-24212,-22080,-24279,-22005,-24347,-21931,-24414,-21856,-24481,-21781,-24547,-21706,-24614,-21630,-24680,-21555,-24746,-21479,-24812,-21403,-24878,-21327,-24943,-21250,-25008,-21174,-25073,-21097,-25137,-21020,-25202,-20943,-25266,-20865,-25330,-20788,-25393,-20710,-25457,-20632,-25520,-20554,-25583,-20475,-25646,-20397,-25708,-20318,-25770,-20239,-25832,-20160,-25894,-20080,-25955,-20001,-26017,-19921,-26078,-19841,-26138,-19761,-26199,-19681,-26259,-19600,-26319,-19520,-26379,-19439,-26438,-19358,-26498,-19277,-26557,-19195,-26616,-19114,-26674,-19032,-26732,-18950,-26790,-18868,-26848,-18786,-26906,-18703,-26963,-18621,-27020,-18538,-27077,-18455,-27133,-18372,-27189,-18288,-27245,-18205,-27301,-18121,-27356,-18037,-27412,-17953,-27467,-17869,-27521,-17785,-27576,-17700,-27630,-17616,-27684,-17531,-27737,-17446,-27791,-17361,-27844,-17275,-27897,-17190,-27949,-17104,-28002,-17018,-28054,-16932,-28106,-16846,-28157,-16760,-28209,-16673,-28260,-16587,-28310,-16500,-28361,-16413,-28411,-16326,-28461,-16239,-28511,-16151,-28560,-16064,-28609,-15976,-28658,-15888,-28707,-15800,-28755,-15712,-28803,-15624,-28851,-15535,-28898,-15447,-28946,-15358,-28993,-15269,-29039,-15180,-29086,-15091,-29132,-15002,-29178,-14912,-29223,-14823,-29269,-14733,-29314,-14643,-29359,-14553,-29403,-14463,-29447,-14373,-29491,-14282,-29535,-14192,-29578,-14101,-29622,-14010,-29664,-13919,-29707,-13828,-29749,-13737,-29791,-13646,-29833,-13554,-29874,-13463,-29916,-13371,-29956,-13279,-29997,-13187,-30037,-13095,-30077,-13003,-30117,-12910,-30157,-12818,-30196,-12725,-30235,-12633,-30273,-12540,-30312,-12447,-30350,-12354,-30387,-12261,-30425,-12167,-30462,-12074,-30499,-11981,-30536,-11887,-30572,-11793,-30608,-11699,-30644,-11605,-30679,-11511,-30714,-11417,-30749,-11323,-30784,-11228,-30818,-11134,-30852,-11039,-30886,-10945,-30919,-10850,-30952,-10755,-30985,-10660,-31018,-10565,-31050,-10470,-31082,-10374,-31114,-10279,-31145,-10183,-31176,-10088,-31207,-9992,-31237,-9896,-31268,-9800,-31298,-9704,-31327,-9608,-31357,-9512,-31386,-9416,-31414,-9320,-31443,-9223,-31471,-9127,-31499,-9030,-31526,-8933,-31554,-8837,-31581,-8740,-31607,-8643,-31634,-8546,-31660,-8449,-31685,-8352,-31711,-8254,-31736,-8157,-31761,-8060,-31786,-7962,-31810,-7865,-31834,-7767,-31857,-7669,-31881,-7572,-31904,-7474,-31927,-7376,-31949,-7278,-31971,-7180,-31993,-7082,-32015,-6983,-32036,-6885,-32057,-6787,-32078,-6689,-32098,-6590,-32118,-6492,-32138,-6393,-32157,-6294,-32177,-6196,-32195,-6097,-32214,-5998,-32232,-5899,-32250,-5800,-32268,-5701,-32285,-5602,-32302,-5503,-32319,-5404,-32335,-5305,-32351,-5206,-32367,-5107,-32383,-5007,-32398,-4908,-32413,-4808,-32427,-4709,-32442,-4609,-32456,-4510,-32469,-4410,-32483,-4311,-32496,-4211,-32509,-4111,-32521,-4012,-32533,-3912,-32545,-3812,-32557,-3712,-32568,-3612,-32579,-3512,-32589,-3412,-32600,-3312,-32610,-3212,-32619,-3112,-32629,-3012,-32638,-2912,-32647,-2812,-32655,-2712,-32663,-2611,-32671,-2511,-32679,-2411,-32686,-2311,-32693,-2210,-32700,-2110,-32706,-2010,-32712,-1909,-32718,-1809,-32723,-1709,-32728,-1608,-32733,-1508,-32737,-1407,-32741,-1307,-32745,-1207,-32749,-1106,-32752,-1006,-32755,-905,-32758,-805,-32760,-704,-32762,-604,-32764,-503,-32765,-403,-32766,-302,-32767,-202,-32767,-101}; void dft2048(int16_t *x,int16_t *y,int scale) @@ -2866,12 +4606,196 @@ void idft2048(int16_t *x,int16_t *y,int scale) } +#ifdef __AVX2__ + +void dft2048_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[256],*xtmpp,*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[256],*tw2048_256p=(simd256_q15_t *)tw2048,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + xtmpp = xtmp; + + for (i=0; i<4; i++) { + transpose4_ooff_simd256(x256 ,xtmpp,128); + transpose4_ooff_simd256(x256+2,xtmpp+1,128); + transpose4_ooff_simd256(x256+4,xtmpp+2,128); + transpose4_ooff_simd256(x256+6,xtmpp+3,128); + transpose4_ooff_simd256(x256+8,xtmpp+4,128); + transpose4_ooff_simd256(x256+10,xtmpp+5,128); + transpose4_ooff_simd256(x256+12,xtmpp+6,128); + transpose4_ooff_simd256(x256+14,xtmpp+7,128); + transpose4_ooff_simd256(x256+16,xtmpp+8,128); + transpose4_ooff_simd256(x256+18,xtmpp+9,128); + transpose4_ooff_simd256(x256+20,xtmpp+10,128); + transpose4_ooff_simd256(x256+22,xtmpp+11,128); + transpose4_ooff_simd256(x256+24,xtmpp+12,128); + transpose4_ooff_simd256(x256+26,xtmpp+13,128); + transpose4_ooff_simd256(x256+28,xtmpp+14,128); + transpose4_ooff_simd256(x256+30,xtmpp+15,128); + transpose4_ooff_simd256(x256+32,xtmpp+16,128); + transpose4_ooff_simd256(x256+34,xtmpp+17,128); + transpose4_ooff_simd256(x256+36,xtmpp+18,128); + transpose4_ooff_simd256(x256+38,xtmpp+19,128); + transpose4_ooff_simd256(x256+40,xtmpp+20,128); + transpose4_ooff_simd256(x256+42,xtmpp+21,128); + transpose4_ooff_simd256(x256+44,xtmpp+22,128); + transpose4_ooff_simd256(x256+46,xtmpp+23,128); + transpose4_ooff_simd256(x256+48,xtmpp+24,128); + transpose4_ooff_simd256(x256+50,xtmpp+25,128); + transpose4_ooff_simd256(x256+52,xtmpp+26,128); + transpose4_ooff_simd256(x256+54,xtmpp+27,128); + transpose4_ooff_simd256(x256+56,xtmpp+28,128); + transpose4_ooff_simd256(x256+58,xtmpp+29,128); + transpose4_ooff_simd256(x256+60,xtmpp+30,128); + transpose4_ooff_simd256(x256+62,xtmpp+31,128); + x256+=64; + xtmpp+=32; + } + + dft1024_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); + dft1024_simd256((int16_t*)(xtmp+256),(int16_t*)(ytmp+128),1); + + + for (i=0; i<128; i++) { + bfly2_256(ytmpp,ytmpp+128, + y256p,y256p+128, + tw2048_256p); + tw2048_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + y256p = y256; + + for (i=0; i<16; i++) { + y256p[0] = mulhi_int16_simd256(y256p[0],ONE_OVER_SQRT2_Q15_128); + y256p[1] = mulhi_int16_simd256(y256p[1],ONE_OVER_SQRT2_Q15_128); + y256p[2] = mulhi_int16_simd256(y256p[2],ONE_OVER_SQRT2_Q15_128); + y256p[3] = mulhi_int16_simd256(y256p[3],ONE_OVER_SQRT2_Q15_128); + y256p[4] = mulhi_int16_simd256(y256p[4],ONE_OVER_SQRT2_Q15_128); + y256p[5] = mulhi_int16_simd256(y256p[5],ONE_OVER_SQRT2_Q15_128); + y256p[6] = mulhi_int16_simd256(y256p[6],ONE_OVER_SQRT2_Q15_128); + y256p[7] = mulhi_int16_simd256(y256p[7],ONE_OVER_SQRT2_Q15_128); + y256p[8] = mulhi_int16_simd256(y256p[8],ONE_OVER_SQRT2_Q15_128); + y256p[9] = mulhi_int16_simd256(y256p[9],ONE_OVER_SQRT2_Q15_128); + y256p[10] = mulhi_int16_simd256(y256p[10],ONE_OVER_SQRT2_Q15_128); + y256p[11] = mulhi_int16_simd256(y256p[11],ONE_OVER_SQRT2_Q15_128); + y256p[12] = mulhi_int16_simd256(y256p[12],ONE_OVER_SQRT2_Q15_128); + y256p[13] = mulhi_int16_simd256(y256p[13],ONE_OVER_SQRT2_Q15_128); + y256p[14] = mulhi_int16_simd256(y256p[14],ONE_OVER_SQRT2_Q15_128); + y256p[15] = mulhi_int16_simd256(y256p[15],ONE_OVER_SQRT2_Q15_128); + y256p+=16; + } + } + + _mm_empty(); + _m_empty(); + +} + +void idft2048_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[256],*xtmpp,*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[256],*tw2048_256p=(simd256_q15_t *)tw2048,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + xtmpp = xtmp; + + for (i=0; i<4; i++) { + transpose4_ooff_simd256(x256 ,xtmpp,128); + transpose4_ooff_simd256(x256+2,xtmpp+1,128); + transpose4_ooff_simd256(x256+4,xtmpp+2,128); + transpose4_ooff_simd256(x256+6,xtmpp+3,128); + transpose4_ooff_simd256(x256+8,xtmpp+4,128); + transpose4_ooff_simd256(x256+10,xtmpp+5,128); + transpose4_ooff_simd256(x256+12,xtmpp+6,128); + transpose4_ooff_simd256(x256+14,xtmpp+7,128); + transpose4_ooff_simd256(x256+16,xtmpp+8,128); + transpose4_ooff_simd256(x256+18,xtmpp+9,128); + transpose4_ooff_simd256(x256+20,xtmpp+10,128); + transpose4_ooff_simd256(x256+22,xtmpp+11,128); + transpose4_ooff_simd256(x256+24,xtmpp+12,128); + transpose4_ooff_simd256(x256+26,xtmpp+13,128); + transpose4_ooff_simd256(x256+28,xtmpp+14,128); + transpose4_ooff_simd256(x256+30,xtmpp+15,128); + transpose4_ooff_simd256(x256+32,xtmpp+16,128); + transpose4_ooff_simd256(x256+34,xtmpp+17,128); + transpose4_ooff_simd256(x256+36,xtmpp+18,128); + transpose4_ooff_simd256(x256+38,xtmpp+19,128); + transpose4_ooff_simd256(x256+40,xtmpp+20,128); + transpose4_ooff_simd256(x256+42,xtmpp+21,128); + transpose4_ooff_simd256(x256+44,xtmpp+22,128); + transpose4_ooff_simd256(x256+46,xtmpp+23,128); + transpose4_ooff_simd256(x256+48,xtmpp+24,128); + transpose4_ooff_simd256(x256+50,xtmpp+25,128); + transpose4_ooff_simd256(x256+52,xtmpp+26,128); + transpose4_ooff_simd256(x256+54,xtmpp+27,128); + transpose4_ooff_simd256(x256+56,xtmpp+28,128); + transpose4_ooff_simd256(x256+58,xtmpp+29,128); + transpose4_ooff_simd256(x256+60,xtmpp+30,128); + transpose4_ooff_simd256(x256+62,xtmpp+31,128); + x256+=64; + xtmpp+=32; + } + + idft1024_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); + idft1024_simd256((int16_t*)(xtmp+256),(int16_t*)(ytmp+128),1); + + + for (i=0; i<128; i++) { + ibfly2_256(ytmpp,ytmpp+128, + y256p,y256p+128, + tw2048_256p); + tw2048_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + y256p = y256; + + for (i=0; i<16; i++) { + y256p[0] = mulhi_int16_simd256(y256p[0],ONE_OVER_SQRT2_Q15_128); + y256p[1] = mulhi_int16_simd256(y256p[1],ONE_OVER_SQRT2_Q15_128); + y256p[2] = mulhi_int16_simd256(y256p[2],ONE_OVER_SQRT2_Q15_128); + y256p[3] = mulhi_int16_simd256(y256p[3],ONE_OVER_SQRT2_Q15_128); + y256p[4] = mulhi_int16_simd256(y256p[4],ONE_OVER_SQRT2_Q15_128); + y256p[5] = mulhi_int16_simd256(y256p[5],ONE_OVER_SQRT2_Q15_128); + y256p[6] = mulhi_int16_simd256(y256p[6],ONE_OVER_SQRT2_Q15_128); + y256p[7] = mulhi_int16_simd256(y256p[7],ONE_OVER_SQRT2_Q15_128); + y256p[8] = mulhi_int16_simd256(y256p[8],ONE_OVER_SQRT2_Q15_128); + y256p[9] = mulhi_int16_simd256(y256p[9],ONE_OVER_SQRT2_Q15_128); + y256p[10] = mulhi_int16_simd256(y256p[10],ONE_OVER_SQRT2_Q15_128); + y256p[11] = mulhi_int16_simd256(y256p[11],ONE_OVER_SQRT2_Q15_128); + y256p[12] = mulhi_int16_simd256(y256p[12],ONE_OVER_SQRT2_Q15_128); + y256p[13] = mulhi_int16_simd256(y256p[13],ONE_OVER_SQRT2_Q15_128); + y256p[14] = mulhi_int16_simd256(y256p[14],ONE_OVER_SQRT2_Q15_128); + y256p[15] = mulhi_int16_simd256(y256p[15],ONE_OVER_SQRT2_Q15_128); + y256p+=16; + } + } + + _mm_empty(); + _m_empty(); + +} + +#endif + #include "twiddles4096.h" void dft4096(int16_t *x,int16_t *y,int scale) { - simd_q15_t xtmp[4096],ytmp[4096],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; + simd_q15_t xtmp[1024],ytmp[1024],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; simd_q15_t *ytmpp = &ytmp[0]; int i,j; @@ -2924,10 +4848,12 @@ void dft4096(int16_t *x,int16_t *y,int scale) } + + void idft4096(int16_t *x,int16_t *y,int scale) { - simd_q15_t xtmp[4096],ytmp[4096],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; + simd_q15_t xtmp[1024],ytmp[1024],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; simd_q15_t *ytmpp = &ytmp[0]; int i,j; @@ -2980,18 +4906,123 @@ void idft4096(int16_t *x,int16_t *y,int scale) } -/* Twiddles generated with -twa = floor(32767*exp(-sqrt(-1)*2*pi*(0:4095)/8192)); -twa2 = zeros(1,2*4096); -twa2(1:2:end) = real(twa); -twa2(2:2:end) = imag(twa); -fd=fopen("twiddle_tmp.txt","w"); -fprintf(fd,"static int16_t tw8192[4096*2] = {"); -fprintf(fd,"%d,",twa2(1:(4096*2)-1)); -fprintf(fd,"%d};\n",twa2(end)); -fclose(fd); -*/ -static int16_t tw8192[4096*2] = {32767,0,32766,-26,32766,-51,32766,-76,32766,-101,32766,-126,32766,-151,32766,-176,32766,-202,32766,-227,32766,-252,32765,-277,32765,-302,32765,-327,32765,-352,32764,-377,32764,-403,32764,-428,32763,-453,32763,-478,32763,-503,32762,-528,32762,-553,32761,-579,32761,-604,32760,-629,32760,-654,32759,-679,32759,-704,32758,-729,32758,-754,32757,-780,32757,-805,32756,-830,32755,-855,32755,-880,32754,-905,32753,-930,32753,-955,32752,-981,32751,-1006,32750,-1031,32750,-1056,32749,-1081,32748,-1106,32747,-1131,32746,-1156,32745,-1181,32744,-1207,32743,-1232,32742,-1257,32741,-1282,32740,-1307,32739,-1332,32738,-1357,32737,-1382,32736,-1407,32735,-1433,32734,-1458,32733,-1483,32732,-1508,32731,-1533,32729,-1558,32728,-1583,32727,-1608,32726,-1633,32725,-1659,32723,-1684,32722,-1709,32721,-1734,32719,-1759,32718,-1784,32717,-1809,32715,-1834,32714,-1859,32712,-1884,32711,-1909,32709,-1935,32708,-1960,32706,-1985,32705,-2010,32703,-2035,32702,-2060,32700,-2085,32699,-2110,32697,-2135,32695,-2160,32694,-2185,32692,-2210,32690,-2236,32688,-2261,32687,-2286,32685,-2311,32683,-2336,32681,-2361,32680,-2386,32678,-2411,32676,-2436,32674,-2461,32672,-2486,32670,-2511,32668,-2536,32666,-2561,32664,-2586,32662,-2611,32660,-2637,32658,-2662,32656,-2687,32654,-2712,32652,-2737,32650,-2762,32648,-2787,32646,-2812,32644,-2837,32641,-2862,32639,-2887,32637,-2912,32635,-2937,32632,-2962,32630,-2987,32628,-3012,32625,-3037,32623,-3062,32621,-3087,32618,-3112,32616,-3137,32614,-3162,32611,-3187,32609,-3212,32606,-3237,32604,-3262,32601,-3287,32599,-3312,32596,-3337,32594,-3362,32591,-3387,32588,-3412,32586,-3437,32583,-3462,32580,-3487,32578,-3512,32575,-3537,32572,-3562,32570,-3587,32567,-3612,32564,-3637,32561,-3662,32558,-3687,32556,-3712,32553,-3737,32550,-3762,32547,-3787,32544,-3812,32541,-3837,32538,-3862,32535,-3887,32532,-3912,32529,-3937,32526,-3962,32523,-3987,32520,-4012,32517,-4036,32514,-4061,32511,-4086,32508,-4111,32504,-4136,32501,-4161,32498,-4186,32495,-4211,32492,-4236,32488,-4261,32485,-4286,32482,-4311,32478,-4336,32475,-4360,32472,-4385,32468,-4410,32465,-4435,32462,-4460,32458,-4485,32455,-4510,32451,-4535,32448,-4560,32444,-4585,32441,-4609,32437,-4634,32434,-4659,32430,-4684,32426,-4709,32423,-4734,32419,-4759,32416,-4784,32412,-4808,32408,-4833,32404,-4858,32401,-4883,32397,-4908,32393,-4933,32389,-4958,32386,-4982,32382,-5007,32378,-5032,32374,-5057,32370,-5082,32366,-5107,32362,-5131,32358,-5156,32354,-5181,32350,-5206,32346,-5231,32342,-5255,32338,-5280,32334,-5305,32330,-5330,32326,-5355,32322,-5379,32318,-5404,32314,-5429,32310,-5454,32305,-5479,32301,-5503,32297,-5528,32293,-5553,32288,-5578,32284,-5602,32280,-5627,32275,-5652,32271,-5677,32267,-5701,32262,-5726,32258,-5751,32254,-5776,32249,-5800,32245,-5825,32240,-5850,32236,-5875,32231,-5899,32227,-5924,32222,-5949,32218,-5973,32213,-5998,32208,-6023,32204,-6048,32199,-6072,32194,-6097,32190,-6122,32185,-6146,32180,-6171,32176,-6196,32171,-6220,32166,-6245,32161,-6270,32156,-6294,32152,-6319,32147,-6344,32142,-6368,32137,-6393,32132,-6418,32127,-6442,32122,-6467,32117,-6492,32112,-6516,32107,-6541,32102,-6565,32097,-6590,32092,-6615,32087,-6639,32082,-6664,32077,-6689,32072,-6713,32066,-6738,32061,-6762,32056,-6787,32051,-6812,32046,-6836,32040,-6861,32035,-6885,32030,-6910,32024,-6934,32019,-6959,32014,-6983,32008,-7008,32003,-7033,31998,-7057,31992,-7082,31987,-7106,31981,-7131,31976,-7155,31970,-7180,31965,-7204,31959,-7229,31954,-7253,31948,-7278,31943,-7302,31937,-7327,31931,-7351,31926,-7376,31920,-7400,31914,-7425,31909,-7449,31903,-7474,31897,-7498,31891,-7523,31886,-7547,31880,-7572,31874,-7596,31868,-7620,31862,-7645,31856,-7669,31851,-7694,31845,-7718,31839,-7743,31833,-7767,31827,-7791,31821,-7816,31815,-7840,31809,-7865,31803,-7889,31797,-7913,31791,-7938,31785,-7962,31778,-7987,31772,-8011,31766,-8035,31760,-8060,31754,-8084,31748,-8108,31741,-8133,31735,-8157,31729,-8181,31723,-8206,31716,-8230,31710,-8254,31704,-8279,31697,-8303,31691,-8327,31684,-8352,31678,-8376,31672,-8400,31665,-8425,31659,-8449,31652,-8473,31646,-8497,31639,-8522,31633,-8546,31626,-8570,31619,-8594,31613,-8619,31606,-8643,31600,-8667,31593,-8691,31586,-8716,31580,-8740,31573,-8764,31566,-8788,31559,-8813,31553,-8837,31546,-8861,31539,-8885,31532,-8909,31525,-8933,31518,-8958,31512,-8982,31505,-9006,31498,-9030,31491,-9054,31484,-9078,31477,-9103,31470,-9127,31463,-9151,31456,-9175,31449,-9199,31442,-9223,31435,-9247,31428,-9271,31420,-9296,31413,-9320,31406,-9344,31399,-9368,31392,-9392,31385,-9416,31377,-9440,31370,-9464,31363,-9488,31356,-9512,31348,-9536,31341,-9560,31334,-9584,31326,-9608,31319,-9632,31311,-9656,31304,-9680,31297,-9704,31289,-9728,31282,-9752,31274,-9776,31267,-9800,31259,-9824,31252,-9848,31244,-9872,31236,-9896,31229,-9920,31221,-9944,31214,-9968,31206,-9992,31198,-10016,31191,-10040,31183,-10064,31175,-10088,31167,-10112,31160,-10136,31152,-10160,31144,-10183,31136,-10207,31128,-10231,31121,-10255,31113,-10279,31105,-10303,31097,-10327,31089,-10350,31081,-10374,31073,-10398,31065,-10422,31057,-10446,31049,-10470,31041,-10493,31033,-10517,31025,-10541,31017,-10565,31009,-10589,31001,-10612,30992,-10636,30984,-10660,30976,-10684,30968,-10707,30960,-10731,30951,-10755,30943,-10779,30935,-10802,30927,-10826,30918,-10850,30910,-10874,30902,-10897,30893,-10921,30885,-10945,30876,-10968,30868,-10992,30860,-11016,30851,-11039,30843,-11063,30834,-11087,30826,-11110,30817,-11134,30809,-11158,30800,-11181,30791,-11205,30783,-11228,30774,-11252,30766,-11276,30757,-11299,30748,-11323,30739,-11346,30731,-11370,30722,-11394,30713,-11417,30705,-11441,30696,-11464,30687,-11488,30678,-11511,30669,-11535,30660,-11558,30652,-11582,30643,-11605,30634,-11629,30625,-11652,30616,-11676,30607,-11699,30598,-11723,30589,-11746,30580,-11770,30571,-11793,30562,-11817,30553,-11840,30544,-11863,30535,-11887,30525,-11910,30516,-11934,30507,-11957,30498,-11981,30489,-12004,30480,-12027,30470,-12051,30461,-12074,30452,-12097,30442,-12121,30433,-12144,30424,-12167,30415,-12191,30405,-12214,30396,-12237,30386,-12261,30377,-12284,30368,-12307,30358,-12331,30349,-12354,30339,-12377,30330,-12400,30320,-12424,30311,-12447,30301,-12470,30291,-12493,30282,-12517,30272,-12540,30263,-12563,30253,-12586,30243,-12610,30234,-12633,30224,-12656,30214,-12679,30205,-12702,30195,-12725,30185,-12749,30175,-12772,30165,-12795,30156,-12818,30146,-12841,30136,-12864,30126,-12887,30116,-12910,30106,-12934,30096,-12957,30086,-12980,30076,-13003,30066,-13026,30056,-13049,30046,-13072,30036,-13095,30026,-13118,30016,-13141,30006,-13164,29996,-13187,29986,-13210,29976,-13233,29966,-13256,29955,-13279,29945,-13302,29935,-13325,29925,-13348,29915,-13371,29904,-13394,29894,-13417,29884,-13440,29873,-13463,29863,-13486,29853,-13508,29842,-13531,29832,-13554,29822,-13577,29811,-13600,29801,-13623,29790,-13646,29780,-13668,29769,-13691,29759,-13714,29748,-13737,29738,-13760,29727,-13783,29717,-13805,29706,-13828,29695,-13851,29685,-13874,29674,-13896,29663,-13919,29653,-13942,29642,-13965,29631,-13987,29621,-14010,29610,-14033,29599,-14056,29588,-14078,29577,-14101,29567,-14124,29556,-14146,29545,-14169,29534,-14192,29523,-14214,29512,-14237,29501,-14260,29490,-14282,29479,-14305,29468,-14327,29457,-14350,29446,-14373,29435,-14395,29424,-14418,29413,-14440,29402,-14463,29391,-14485,29380,-14508,29369,-14531,29358,-14553,29346,-14576,29335,-14598,29324,-14621,29313,-14643,29302,-14666,29290,-14688,29279,-14710,29268,-14733,29256,-14755,29245,-14778,29234,-14800,29222,-14823,29211,-14845,29200,-14867,29188,-14890,29177,-14912,29165,-14935,29154,-14957,29142,-14979,29131,-15002,29119,-15024,29108,-15046,29096,-15069,29085,-15091,29073,-15113,29062,-15136,29050,-15158,29038,-15180,29027,-15202,29015,-15225,29003,-15247,28992,-15269,28980,-15291,28968,-15314,28956,-15336,28945,-15358,28933,-15380,28921,-15402,28909,-15425,28897,-15447,28886,-15469,28874,-15491,28862,-15513,28850,-15535,28838,-15557,28826,-15580,28814,-15602,28802,-15624,28790,-15646,28778,-15668,28766,-15690,28754,-15712,28742,-15734,28730,-15756,28718,-15778,28706,-15800,28694,-15822,28681,-15844,28669,-15866,28657,-15888,28645,-15910,28633,-15932,28620,-15954,28608,-15976,28596,-15998,28584,-16020,28571,-16042,28559,-16064,28547,-16086,28534,-16108,28522,-16129,28510,-16151,28497,-16173,28485,-16195,28472,-16217,28460,-16239,28447,-16261,28435,-16282,28423,-16304,28410,-16326,28397,-16348,28385,-16369,28372,-16391,28360,-16413,28347,-16435,28335,-16456,28322,-16478,28309,-16500,28297,-16522,28284,-16543,28271,-16565,28259,-16587,28246,-16608,28233,-16630,28220,-16652,28208,-16673,28195,-16695,28182,-16717,28169,-16738,28156,-16760,28143,-16781,28131,-16803,28118,-16825,28105,-16846,28092,-16868,28079,-16889,28066,-16911,28053,-16932,28040,-16954,28027,-16975,28014,-16997,28001,-17018,27988,-17040,27975,-17061,27962,-17083,27948,-17104,27935,-17125,27922,-17147,27909,-17168,27896,-17190,27883,-17211,27869,-17233,27856,-17254,27843,-17275,27830,-17297,27816,-17318,27803,-17339,27790,-17361,27777,-17382,27763,-17403,27750,-17424,27736,-17446,27723,-17467,27710,-17488,27696,-17510,27683,-17531,27669,-17552,27656,-17573,27642,-17594,27629,-17616,27615,-17637,27602,-17658,27588,-17679,27575,-17700,27561,-17721,27548,-17743,27534,-17764,27520,-17785,27507,-17806,27493,-17827,27479,-17848,27466,-17869,27452,-17890,27438,-17911,27424,-17932,27411,-17953,27397,-17974,27383,-17995,27369,-18016,27355,-18037,27342,-18058,27328,-18079,27314,-18100,27300,-18121,27286,-18142,27272,-18163,27258,-18184,27244,-18205,27230,-18226,27216,-18247,27202,-18268,27188,-18288,27174,-18309,27160,-18330,27146,-18351,27132,-18372,27118,-18393,27104,-18413,27090,-18434,27076,-18455,27061,-18476,27047,-18496,27033,-18517,27019,-18538,27005,-18559,26990,-18579,26976,-18600,26962,-18621,26948,-18641,26933,-18662,26919,-18683,26905,-18703,26890,-18724,26876,-18745,26861,-18765,26847,-18786,26833,-18806,26818,-18827,26804,-18847,26789,-18868,26775,-18889,26760,-18909,26746,-18930,26731,-18950,26717,-18971,26702,-18991,26688,-19012,26673,-19032,26658,-19052,26644,-19073,26629,-19093,26615,-19114,26600,-19134,26585,-19155,26570,-19175,26556,-19195,26541,-19216,26526,-19236,26512,-19256,26497,-19277,26482,-19297,26467,-19317,26452,-19338,26437,-19358,26423,-19378,26408,-19398,26393,-19419,26378,-19439,26363,-19459,26348,-19479,26333,-19500,26318,-19520,26303,-19540,26288,-19560,26273,-19580,26258,-19600,26243,-19621,26228,-19641,26213,-19661,26198,-19681,26183,-19701,26168,-19721,26153,-19741,26137,-19761,26122,-19781,26107,-19801,26092,-19821,26077,-19841,26061,-19861,26046,-19881,26031,-19901,26016,-19921,26000,-19941,25985,-19961,25970,-19981,25954,-20001,25939,-20021,25924,-20041,25908,-20061,25893,-20080,25878,-20100,25862,-20120,25847,-20140,25831,-20160,25816,-20180,25800,-20199,25785,-20219,25769,-20239,25754,-20259,25738,-20278,25723,-20298,25707,-20318,25691,-20338,25676,-20357,25660,-20377,25645,-20397,25629,-20416,25613,-20436,25598,-20456,25582,-20475,25566,-20495,25550,-20514,25535,-20534,25519,-20554,25503,-20573,25487,-20593,25472,-20612,25456,-20632,25440,-20651,25424,-20671,25408,-20690,25392,-20710,25376,-20729,25361,-20749,25345,-20768,25329,-20788,25313,-20807,25297,-20826,25281,-20846,25265,-20865,25249,-20885,25233,-20904,25217,-20923,25201,-20943,25185,-20962,25169,-20981,25152,-21001,25136,-21020,25120,-21039,25104,-21058,25088,-21078,25072,-21097,25056,-21116,25039,-21135,25023,-21155,25007,-21174,24991,-21193,24974,-21212,24958,-21231,24942,-21250,24926,-21269,24909,-21289,24893,-21308,24877,-21327,24860,-21346,24844,-21365,24827,-21384,24811,-21403,24795,-21422,24778,-21441,24762,-21460,24745,-21479,24729,-21498,24712,-21517,24696,-21536,24679,-21555,24663,-21574,24646,-21593,24630,-21612,24613,-21630,24596,-21649,24580,-21668,24563,-21687,24546,-21706,24530,-21725,24513,-21744,24496,-21762,24480,-21781,24463,-21800,24446,-21819,24430,-21837,24413,-21856,24396,-21875,24379,-21894,24362,-21912,24346,-21931,24329,-21950,24312,-21968,24295,-21987,24278,-22005,24261,-22024,24244,-22043,24228,-22061,24211,-22080,24194,-22098,24177,-22117,24160,-22136,24143,-22154,24126,-22173,24109,-22191,24092,-22210,24075,-22228,24058,-22246,24041,-22265,24023,-22283,24006,-22302,23989,-22320,23972,-22339,23955,-22357,23938,-22375,23921,-22394,23903,-22412,23886,-22430,23869,-22449,23852,-22467,23835,-22485,23817,-22504,23800,-22522,23783,-22540,23766,-22558,23748,-22576,23731,-22595,23714,-22613,23696,-22631,23679,-22649,23661,-22667,23644,-22686,23627,-22704,23609,-22722,23592,-22740,23574,-22758,23557,-22776,23539,-22794,23522,-22812,23504,-22830,23487,-22848,23469,-22866,23452,-22884,23434,-22902,23417,-22920,23399,-22938,23382,-22956,23364,-22974,23346,-22992,23329,-23010,23311,-23028,23293,-23046,23276,-23063,23258,-23081,23240,-23099,23223,-23117,23205,-23135,23187,-23152,23169,-23170,23151,-23188,23134,-23206,23116,-23224,23098,-23241,23080,-23259,23062,-23277,23045,-23294,23027,-23312,23009,-23330,22991,-23347,22973,-23365,22955,-23383,22937,-23400,22919,-23418,22901,-23435,22883,-23453,22865,-23470,22847,-23488,22829,-23505,22811,-23523,22793,-23540,22775,-23558,22757,-23575,22739,-23593,22721,-23610,22703,-23628,22685,-23645,22666,-23662,22648,-23680,22630,-23697,22612,-23715,22594,-23732,22575,-23749,22557,-23767,22539,-23784,22521,-23801,22503,-23818,22484,-23836,22466,-23853,22448,-23870,22429,-23887,22411,-23904,22393,-23922,22374,-23939,22356,-23956,22338,-23973,22319,-23990,22301,-24007,22282,-24024,22264,-24042,22245,-24059,22227,-24076,22209,-24093,22190,-24110,22172,-24127,22153,-24144,22135,-24161,22116,-24178,22097,-24195,22079,-24212,22060,-24229,22042,-24245,22023,-24262,22004,-24279,21986,-24296,21967,-24313,21949,-24330,21930,-24347,21911,-24363,21893,-24380,21874,-24397,21855,-24414,21836,-24431,21818,-24447,21799,-24464,21780,-24481,21761,-24497,21743,-24514,21724,-24531,21705,-24547,21686,-24564,21667,-24581,21648,-24597,21629,-24614,21611,-24631,21592,-24647,21573,-24664,21554,-24680,21535,-24697,21516,-24713,21497,-24730,21478,-24746,21459,-24763,21440,-24779,21421,-24796,21402,-24812,21383,-24828,21364,-24845,21345,-24861,21326,-24878,21307,-24894,21288,-24910,21268,-24927,21249,-24943,21230,-24959,21211,-24975,21192,-24992,21173,-25008,21154,-25024,21134,-25040,21115,-25057,21096,-25073,21077,-25089,21057,-25105,21038,-25121,21019,-25137,21000,-25153,20980,-25170,20961,-25186,20942,-25202,20922,-25218,20903,-25234,20884,-25250,20864,-25266,20845,-25282,20825,-25298,20806,-25314,20787,-25330,20767,-25346,20748,-25362,20728,-25377,20709,-25393,20689,-25409,20670,-25425,20650,-25441,20631,-25457,20611,-25473,20592,-25488,20572,-25504,20553,-25520,20533,-25536,20513,-25551,20494,-25567,20474,-25583,20455,-25599,20435,-25614,20415,-25630,20396,-25646,20376,-25661,20356,-25677,20337,-25692,20317,-25708,20297,-25724,20277,-25739,20258,-25755,20238,-25770,20218,-25786,20198,-25801,20179,-25817,20159,-25832,20139,-25848,20119,-25863,20099,-25879,20079,-25894,20060,-25909,20040,-25925,20020,-25940,20000,-25955,19980,-25971,19960,-25986,19940,-26001,19920,-26017,19900,-26032,19880,-26047,19860,-26062,19840,-26078,19820,-26093,19800,-26108,19780,-26123,19760,-26138,19740,-26154,19720,-26169,19700,-26184,19680,-26199,19660,-26214,19640,-26229,19620,-26244,19599,-26259,19579,-26274,19559,-26289,19539,-26304,19519,-26319,19499,-26334,19478,-26349,19458,-26364,19438,-26379,19418,-26394,19397,-26409,19377,-26424,19357,-26438,19337,-26453,19316,-26468,19296,-26483,19276,-26498,19255,-26513,19235,-26527,19215,-26542,19194,-26557,19174,-26571,19154,-26586,19133,-26601,19113,-26616,19092,-26630,19072,-26645,19051,-26659,19031,-26674,19011,-26689,18990,-26703,18970,-26718,18949,-26732,18929,-26747,18908,-26761,18888,-26776,18867,-26790,18846,-26805,18826,-26819,18805,-26834,18785,-26848,18764,-26862,18744,-26877,18723,-26891,18702,-26906,18682,-26920,18661,-26934,18640,-26949,18620,-26963,18599,-26977,18578,-26991,18558,-27006,18537,-27020,18516,-27034,18495,-27048,18475,-27062,18454,-27077,18433,-27091,18412,-27105,18392,-27119,18371,-27133,18350,-27147,18329,-27161,18308,-27175,18287,-27189,18267,-27203,18246,-27217,18225,-27231,18204,-27245,18183,-27259,18162,-27273,18141,-27287,18120,-27301,18099,-27315,18078,-27329,18057,-27343,18036,-27356,18015,-27370,17994,-27384,17973,-27398,17952,-27412,17931,-27425,17910,-27439,17889,-27453,17868,-27467,17847,-27480,17826,-27494,17805,-27508,17784,-27521,17763,-27535,17742,-27549,17720,-27562,17699,-27576,17678,-27589,17657,-27603,17636,-27616,17615,-27630,17593,-27643,17572,-27657,17551,-27670,17530,-27684,17509,-27697,17487,-27711,17466,-27724,17445,-27737,17423,-27751,17402,-27764,17381,-27778,17360,-27791,17338,-27804,17317,-27817,17296,-27831,17274,-27844,17253,-27857,17232,-27870,17210,-27884,17189,-27897,17167,-27910,17146,-27923,17124,-27936,17103,-27949,17082,-27963,17060,-27976,17039,-27989,17017,-28002,16996,-28015,16974,-28028,16953,-28041,16931,-28054,16910,-28067,16888,-28080,16867,-28093,16845,-28106,16824,-28119,16802,-28132,16780,-28144,16759,-28157,16737,-28170,16716,-28183,16694,-28196,16672,-28209,16651,-28221,16629,-28234,16607,-28247,16586,-28260,16564,-28272,16542,-28285,16521,-28298,16499,-28310,16477,-28323,16455,-28336,16434,-28348,16412,-28361,16390,-28373,16368,-28386,16347,-28398,16325,-28411,16303,-28424,16281,-28436,16260,-28448,16238,-28461,16216,-28473,16194,-28486,16172,-28498,16150,-28511,16128,-28523,16107,-28535,16085,-28548,16063,-28560,16041,-28572,16019,-28585,15997,-28597,15975,-28609,15953,-28621,15931,-28634,15909,-28646,15887,-28658,15865,-28670,15843,-28682,15821,-28695,15799,-28707,15777,-28719,15755,-28731,15733,-28743,15711,-28755,15689,-28767,15667,-28779,15645,-28791,15623,-28803,15601,-28815,15579,-28827,15556,-28839,15534,-28851,15512,-28863,15490,-28875,15468,-28887,15446,-28898,15424,-28910,15401,-28922,15379,-28934,15357,-28946,15335,-28957,15313,-28969,15290,-28981,15268,-28993,15246,-29004,15224,-29016,15201,-29028,15179,-29039,15157,-29051,15135,-29063,15112,-29074,15090,-29086,15068,-29097,15045,-29109,15023,-29120,15001,-29132,14978,-29143,14956,-29155,14934,-29166,14911,-29178,14889,-29189,14866,-29201,14844,-29212,14822,-29223,14799,-29235,14777,-29246,14754,-29257,14732,-29269,14709,-29280,14687,-29291,14665,-29303,14642,-29314,14620,-29325,14597,-29336,14575,-29347,14552,-29359,14530,-29370,14507,-29381,14484,-29392,14462,-29403,14439,-29414,14417,-29425,14394,-29436,14372,-29447,14349,-29458,14326,-29469,14304,-29480,14281,-29491,14259,-29502,14236,-29513,14213,-29524,14191,-29535,14168,-29546,14145,-29557,14123,-29568,14100,-29578,14077,-29589,14055,-29600,14032,-29611,14009,-29622,13986,-29632,13964,-29643,13941,-29654,13918,-29664,13895,-29675,13873,-29686,13850,-29696,13827,-29707,13804,-29718,13782,-29728,13759,-29739,13736,-29749,13713,-29760,13690,-29770,13667,-29781,13645,-29791,13622,-29802,13599,-29812,13576,-29823,13553,-29833,13530,-29843,13507,-29854,13485,-29864,13462,-29874,13439,-29885,13416,-29895,13393,-29905,13370,-29916,13347,-29926,13324,-29936,13301,-29946,13278,-29956,13255,-29967,13232,-29977,13209,-29987,13186,-29997,13163,-30007,13140,-30017,13117,-30027,13094,-30037,13071,-30047,13048,-30057,13025,-30067,13002,-30077,12979,-30087,12956,-30097,12933,-30107,12909,-30117,12886,-30127,12863,-30137,12840,-30147,12817,-30157,12794,-30166,12771,-30176,12748,-30186,12724,-30196,12701,-30206,12678,-30215,12655,-30225,12632,-30235,12609,-30244,12585,-30254,12562,-30264,12539,-30273,12516,-30283,12492,-30292,12469,-30302,12446,-30312,12423,-30321,12399,-30331,12376,-30340,12353,-30350,12330,-30359,12306,-30369,12283,-30378,12260,-30387,12236,-30397,12213,-30406,12190,-30416,12166,-30425,12143,-30434,12120,-30443,12096,-30453,12073,-30462,12050,-30471,12026,-30481,12003,-30490,11980,-30499,11956,-30508,11933,-30517,11909,-30526,11886,-30536,11862,-30545,11839,-30554,11816,-30563,11792,-30572,11769,-30581,11745,-30590,11722,-30599,11698,-30608,11675,-30617,11651,-30626,11628,-30635,11604,-30644,11581,-30653,11557,-30661,11534,-30670,11510,-30679,11487,-30688,11463,-30697,11440,-30706,11416,-30714,11393,-30723,11369,-30732,11345,-30740,11322,-30749,11298,-30758,11275,-30767,11251,-30775,11227,-30784,11204,-30792,11180,-30801,11157,-30810,11133,-30818,11109,-30827,11086,-30835,11062,-30844,11038,-30852,11015,-30861,10991,-30869,10967,-30877,10944,-30886,10920,-30894,10896,-30903,10873,-30911,10849,-30919,10825,-30928,10801,-30936,10778,-30944,10754,-30952,10730,-30961,10706,-30969,10683,-30977,10659,-30985,10635,-30993,10611,-31002,10588,-31010,10564,-31018,10540,-31026,10516,-31034,10492,-31042,10469,-31050,10445,-31058,10421,-31066,10397,-31074,10373,-31082,10349,-31090,10326,-31098,10302,-31106,10278,-31114,10254,-31122,10230,-31129,10206,-31137,10182,-31145,10159,-31153,10135,-31161,10111,-31168,10087,-31176,10063,-31184,10039,-31192,10015,-31199,9991,-31207,9967,-31215,9943,-31222,9919,-31230,9895,-31237,9871,-31245,9847,-31253,9823,-31260,9799,-31268,9775,-31275,9751,-31283,9727,-31290,9703,-31298,9679,-31305,9655,-31312,9631,-31320,9607,-31327,9583,-31335,9559,-31342,9535,-31349,9511,-31357,9487,-31364,9463,-31371,9439,-31378,9415,-31386,9391,-31393,9367,-31400,9343,-31407,9319,-31414,9295,-31421,9270,-31429,9246,-31436,9222,-31443,9198,-31450,9174,-31457,9150,-31464,9126,-31471,9102,-31478,9077,-31485,9053,-31492,9029,-31499,9005,-31506,8981,-31513,8957,-31519,8932,-31526,8908,-31533,8884,-31540,8860,-31547,8836,-31554,8812,-31560,8787,-31567,8763,-31574,8739,-31581,8715,-31587,8690,-31594,8666,-31601,8642,-31607,8618,-31614,8593,-31620,8569,-31627,8545,-31634,8521,-31640,8496,-31647,8472,-31653,8448,-31660,8424,-31666,8399,-31673,8375,-31679,8351,-31685,8326,-31692,8302,-31698,8278,-31705,8253,-31711,8229,-31717,8205,-31724,8180,-31730,8156,-31736,8132,-31742,8107,-31749,8083,-31755,8059,-31761,8034,-31767,8010,-31773,7986,-31779,7961,-31786,7937,-31792,7912,-31798,7888,-31804,7864,-31810,7839,-31816,7815,-31822,7790,-31828,7766,-31834,7742,-31840,7717,-31846,7693,-31852,7668,-31857,7644,-31863,7619,-31869,7595,-31875,7571,-31881,7546,-31887,7522,-31892,7497,-31898,7473,-31904,7448,-31910,7424,-31915,7399,-31921,7375,-31927,7350,-31932,7326,-31938,7301,-31944,7277,-31949,7252,-31955,7228,-31960,7203,-31966,7179,-31971,7154,-31977,7130,-31982,7105,-31988,7081,-31993,7056,-31999,7032,-32004,7007,-32009,6982,-32015,6958,-32020,6933,-32025,6909,-32031,6884,-32036,6860,-32041,6835,-32047,6811,-32052,6786,-32057,6761,-32062,6737,-32067,6712,-32073,6688,-32078,6663,-32083,6638,-32088,6614,-32093,6589,-32098,6564,-32103,6540,-32108,6515,-32113,6491,-32118,6466,-32123,6441,-32128,6417,-32133,6392,-32138,6367,-32143,6343,-32148,6318,-32153,6293,-32157,6269,-32162,6244,-32167,6219,-32172,6195,-32177,6170,-32181,6145,-32186,6121,-32191,6096,-32195,6071,-32200,6047,-32205,6022,-32209,5997,-32214,5972,-32219,5948,-32223,5923,-32228,5898,-32232,5874,-32237,5849,-32241,5824,-32246,5799,-32250,5775,-32255,5750,-32259,5725,-32263,5700,-32268,5676,-32272,5651,-32276,5626,-32281,5601,-32285,5577,-32289,5552,-32294,5527,-32298,5502,-32302,5478,-32306,5453,-32311,5428,-32315,5403,-32319,5378,-32323,5354,-32327,5329,-32331,5304,-32335,5279,-32339,5254,-32343,5230,-32347,5205,-32351,5180,-32355,5155,-32359,5130,-32363,5106,-32367,5081,-32371,5056,-32375,5031,-32379,5006,-32383,4981,-32387,4957,-32390,4932,-32394,4907,-32398,4882,-32402,4857,-32405,4832,-32409,4807,-32413,4783,-32417,4758,-32420,4733,-32424,4708,-32427,4683,-32431,4658,-32435,4633,-32438,4608,-32442,4584,-32445,4559,-32449,4534,-32452,4509,-32456,4484,-32459,4459,-32463,4434,-32466,4409,-32469,4384,-32473,4359,-32476,4335,-32479,4310,-32483,4285,-32486,4260,-32489,4235,-32493,4210,-32496,4185,-32499,4160,-32502,4135,-32505,4110,-32509,4085,-32512,4060,-32515,4035,-32518,4011,-32521,3986,-32524,3961,-32527,3936,-32530,3911,-32533,3886,-32536,3861,-32539,3836,-32542,3811,-32545,3786,-32548,3761,-32551,3736,-32554,3711,-32557,3686,-32559,3661,-32562,3636,-32565,3611,-32568,3586,-32571,3561,-32573,3536,-32576,3511,-32579,3486,-32581,3461,-32584,3436,-32587,3411,-32589,3386,-32592,3361,-32595,3336,-32597,3311,-32600,3286,-32602,3261,-32605,3236,-32607,3211,-32610,3186,-32612,3161,-32615,3136,-32617,3111,-32619,3086,-32622,3061,-32624,3036,-32626,3011,-32629,2986,-32631,2961,-32633,2936,-32636,2911,-32638,2886,-32640,2861,-32642,2836,-32645,2811,-32647,2786,-32649,2761,-32651,2736,-32653,2711,-32655,2686,-32657,2661,-32659,2636,-32661,2610,-32663,2585,-32665,2560,-32667,2535,-32669,2510,-32671,2485,-32673,2460,-32675,2435,-32677,2410,-32679,2385,-32681,2360,-32682,2335,-32684,2310,-32686,2285,-32688,2260,-32689,2235,-32691,2209,-32693,2184,-32695,2159,-32696,2134,-32698,2109,-32700,2084,-32701,2059,-32703,2034,-32704,2009,-32706,1984,-32707,1959,-32709,1934,-32710,1908,-32712,1883,-32713,1858,-32715,1833,-32716,1808,-32718,1783,-32719,1758,-32720,1733,-32722,1708,-32723,1683,-32724,1658,-32726,1632,-32727,1607,-32728,1582,-32729,1557,-32730,1532,-32732,1507,-32733,1482,-32734,1457,-32735,1432,-32736,1406,-32737,1381,-32738,1356,-32739,1331,-32740,1306,-32741,1281,-32742,1256,-32743,1231,-32744,1206,-32745,1180,-32746,1155,-32747,1130,-32748,1105,-32749,1080,-32750,1055,-32751,1030,-32751,1005,-32752,980,-32753,954,-32754,929,-32754,904,-32755,879,-32756,854,-32756,829,-32757,804,-32758,779,-32758,753,-32759,728,-32759,703,-32760,678,-32760,653,-32761,628,-32761,603,-32762,578,-32762,552,-32763,527,-32763,502,-32764,477,-32764,452,-32764,427,-32765,402,-32765,376,-32765,351,-32766,326,-32766,301,-32766,276,-32766,251,-32767,226,-32767,201,-32767,175,-32767,150,-32767,125,-32767,100,-32767,75,-32767,50,-32767,25,-32767,0,-32767,-26,-32767,-51,-32767,-76,-32767,-101,-32767,-126,-32767,-151,-32767,-176,-32767,-202,-32767,-227,-32767,-252,-32767,-277,-32766,-302,-32766,-327,-32766,-352,-32766,-377,-32765,-403,-32765,-428,-32765,-453,-32764,-478,-32764,-503,-32764,-528,-32763,-553,-32763,-579,-32762,-604,-32762,-629,-32761,-654,-32761,-679,-32760,-704,-32760,-729,-32759,-754,-32759,-780,-32758,-805,-32758,-830,-32757,-855,-32756,-880,-32756,-905,-32755,-930,-32754,-955,-32754,-981,-32753,-1006,-32752,-1031,-32751,-1056,-32751,-1081,-32750,-1106,-32749,-1131,-32748,-1156,-32747,-1181,-32746,-1207,-32745,-1232,-32744,-1257,-32743,-1282,-32742,-1307,-32741,-1332,-32740,-1357,-32739,-1382,-32738,-1407,-32737,-1433,-32736,-1458,-32735,-1483,-32734,-1508,-32733,-1533,-32732,-1558,-32730,-1583,-32729,-1608,-32728,-1633,-32727,-1659,-32726,-1684,-32724,-1709,-32723,-1734,-32722,-1759,-32720,-1784,-32719,-1809,-32718,-1834,-32716,-1859,-32715,-1884,-32713,-1909,-32712,-1935,-32710,-1960,-32709,-1985,-32707,-2010,-32706,-2035,-32704,-2060,-32703,-2085,-32701,-2110,-32700,-2135,-32698,-2160,-32696,-2185,-32695,-2210,-32693,-2236,-32691,-2261,-32689,-2286,-32688,-2311,-32686,-2336,-32684,-2361,-32682,-2386,-32681,-2411,-32679,-2436,-32677,-2461,-32675,-2486,-32673,-2511,-32671,-2536,-32669,-2561,-32667,-2586,-32665,-2611,-32663,-2637,-32661,-2662,-32659,-2687,-32657,-2712,-32655,-2737,-32653,-2762,-32651,-2787,-32649,-2812,-32647,-2837,-32645,-2862,-32642,-2887,-32640,-2912,-32638,-2937,-32636,-2962,-32633,-2987,-32631,-3012,-32629,-3037,-32626,-3062,-32624,-3087,-32622,-3112,-32619,-3137,-32617,-3162,-32615,-3187,-32612,-3212,-32610,-3237,-32607,-3262,-32605,-3287,-32602,-3312,-32600,-3337,-32597,-3362,-32595,-3387,-32592,-3412,-32589,-3437,-32587,-3462,-32584,-3487,-32581,-3512,-32579,-3537,-32576,-3562,-32573,-3587,-32571,-3612,-32568,-3637,-32565,-3662,-32562,-3687,-32559,-3712,-32557,-3737,-32554,-3762,-32551,-3787,-32548,-3812,-32545,-3837,-32542,-3862,-32539,-3887,-32536,-3912,-32533,-3937,-32530,-3962,-32527,-3987,-32524,-4012,-32521,-4036,-32518,-4061,-32515,-4086,-32512,-4111,-32509,-4136,-32505,-4161,-32502,-4186,-32499,-4211,-32496,-4236,-32493,-4261,-32489,-4286,-32486,-4311,-32483,-4336,-32479,-4360,-32476,-4385,-32473,-4410,-32469,-4435,-32466,-4460,-32463,-4485,-32459,-4510,-32456,-4535,-32452,-4560,-32449,-4585,-32445,-4609,-32442,-4634,-32438,-4659,-32435,-4684,-32431,-4709,-32427,-4734,-32424,-4759,-32420,-4784,-32417,-4808,-32413,-4833,-32409,-4858,-32405,-4883,-32402,-4908,-32398,-4933,-32394,-4958,-32390,-4982,-32387,-5007,-32383,-5032,-32379,-5057,-32375,-5082,-32371,-5107,-32367,-5131,-32363,-5156,-32359,-5181,-32355,-5206,-32351,-5231,-32347,-5255,-32343,-5280,-32339,-5305,-32335,-5330,-32331,-5355,-32327,-5379,-32323,-5404,-32319,-5429,-32315,-5454,-32311,-5479,-32306,-5503,-32302,-5528,-32298,-5553,-32294,-5578,-32289,-5602,-32285,-5627,-32281,-5652,-32276,-5677,-32272,-5701,-32268,-5726,-32263,-5751,-32259,-5776,-32255,-5800,-32250,-5825,-32246,-5850,-32241,-5875,-32237,-5899,-32232,-5924,-32228,-5949,-32223,-5973,-32219,-5998,-32214,-6023,-32209,-6048,-32205,-6072,-32200,-6097,-32195,-6122,-32191,-6146,-32186,-6171,-32181,-6196,-32177,-6220,-32172,-6245,-32167,-6270,-32162,-6294,-32157,-6319,-32153,-6344,-32148,-6368,-32143,-6393,-32138,-6418,-32133,-6442,-32128,-6467,-32123,-6492,-32118,-6516,-32113,-6541,-32108,-6565,-32103,-6590,-32098,-6615,-32093,-6639,-32088,-6664,-32083,-6689,-32078,-6713,-32073,-6738,-32067,-6762,-32062,-6787,-32057,-6812,-32052,-6836,-32047,-6861,-32041,-6885,-32036,-6910,-32031,-6934,-32025,-6959,-32020,-6983,-32015,-7008,-32009,-7033,-32004,-7057,-31999,-7082,-31993,-7106,-31988,-7131,-31982,-7155,-31977,-7180,-31971,-7204,-31966,-7229,-31960,-7253,-31955,-7278,-31949,-7302,-31944,-7327,-31938,-7351,-31932,-7376,-31927,-7400,-31921,-7425,-31915,-7449,-31910,-7474,-31904,-7498,-31898,-7523,-31892,-7547,-31887,-7572,-31881,-7596,-31875,-7620,-31869,-7645,-31863,-7669,-31857,-7694,-31852,-7718,-31846,-7743,-31840,-7767,-31834,-7791,-31828,-7816,-31822,-7840,-31816,-7865,-31810,-7889,-31804,-7913,-31798,-7938,-31792,-7962,-31786,-7987,-31779,-8011,-31773,-8035,-31767,-8060,-31761,-8084,-31755,-8108,-31749,-8133,-31742,-8157,-31736,-8181,-31730,-8206,-31724,-8230,-31717,-8254,-31711,-8279,-31705,-8303,-31698,-8327,-31692,-8352,-31685,-8376,-31679,-8400,-31673,-8425,-31666,-8449,-31660,-8473,-31653,-8497,-31647,-8522,-31640,-8546,-31634,-8570,-31627,-8594,-31620,-8619,-31614,-8643,-31607,-8667,-31601,-8691,-31594,-8716,-31587,-8740,-31581,-8764,-31574,-8788,-31567,-8813,-31560,-8837,-31554,-8861,-31547,-8885,-31540,-8909,-31533,-8933,-31526,-8958,-31519,-8982,-31513,-9006,-31506,-9030,-31499,-9054,-31492,-9078,-31485,-9103,-31478,-9127,-31471,-9151,-31464,-9175,-31457,-9199,-31450,-9223,-31443,-9247,-31436,-9271,-31429,-9296,-31421,-9320,-31414,-9344,-31407,-9368,-31400,-9392,-31393,-9416,-31386,-9440,-31378,-9464,-31371,-9488,-31364,-9512,-31357,-9536,-31349,-9560,-31342,-9584,-31335,-9608,-31327,-9632,-31320,-9656,-31312,-9680,-31305,-9704,-31298,-9728,-31290,-9752,-31283,-9776,-31275,-9800,-31268,-9824,-31260,-9848,-31253,-9872,-31245,-9896,-31237,-9920,-31230,-9944,-31222,-9968,-31215,-9992,-31207,-10016,-31199,-10040,-31192,-10064,-31184,-10088,-31176,-10112,-31168,-10136,-31161,-10160,-31153,-10183,-31145,-10207,-31137,-10231,-31129,-10255,-31122,-10279,-31114,-10303,-31106,-10327,-31098,-10350,-31090,-10374,-31082,-10398,-31074,-10422,-31066,-10446,-31058,-10470,-31050,-10493,-31042,-10517,-31034,-10541,-31026,-10565,-31018,-10589,-31010,-10612,-31002,-10636,-30993,-10660,-30985,-10684,-30977,-10707,-30969,-10731,-30961,-10755,-30952,-10779,-30944,-10802,-30936,-10826,-30928,-10850,-30919,-10874,-30911,-10897,-30903,-10921,-30894,-10945,-30886,-10968,-30877,-10992,-30869,-11016,-30861,-11039,-30852,-11063,-30844,-11087,-30835,-11110,-30827,-11134,-30818,-11158,-30810,-11181,-30801,-11205,-30792,-11228,-30784,-11252,-30775,-11276,-30767,-11299,-30758,-11323,-30749,-11346,-30740,-11370,-30732,-11394,-30723,-11417,-30714,-11441,-30706,-11464,-30697,-11488,-30688,-11511,-30679,-11535,-30670,-11558,-30661,-11582,-30653,-11605,-30644,-11629,-30635,-11652,-30626,-11676,-30617,-11699,-30608,-11723,-30599,-11746,-30590,-11770,-30581,-11793,-30572,-11817,-30563,-11840,-30554,-11863,-30545,-11887,-30536,-11910,-30526,-11934,-30517,-11957,-30508,-11981,-30499,-12004,-30490,-12027,-30481,-12051,-30471,-12074,-30462,-12097,-30453,-12121,-30443,-12144,-30434,-12167,-30425,-12191,-30416,-12214,-30406,-12237,-30397,-12261,-30387,-12284,-30378,-12307,-30369,-12331,-30359,-12354,-30350,-12377,-30340,-12400,-30331,-12424,-30321,-12447,-30312,-12470,-30302,-12493,-30292,-12517,-30283,-12540,-30273,-12563,-30264,-12586,-30254,-12610,-30244,-12633,-30235,-12656,-30225,-12679,-30215,-12702,-30206,-12725,-30196,-12749,-30186,-12772,-30176,-12795,-30166,-12818,-30157,-12841,-30147,-12864,-30137,-12887,-30127,-12910,-30117,-12934,-30107,-12957,-30097,-12980,-30087,-13003,-30077,-13026,-30067,-13049,-30057,-13072,-30047,-13095,-30037,-13118,-30027,-13141,-30017,-13164,-30007,-13187,-29997,-13210,-29987,-13233,-29977,-13256,-29967,-13279,-29956,-13302,-29946,-13325,-29936,-13348,-29926,-13371,-29916,-13394,-29905,-13417,-29895,-13440,-29885,-13463,-29874,-13486,-29864,-13508,-29854,-13531,-29843,-13554,-29833,-13577,-29823,-13600,-29812,-13623,-29802,-13646,-29791,-13668,-29781,-13691,-29770,-13714,-29760,-13737,-29749,-13760,-29739,-13783,-29728,-13805,-29718,-13828,-29707,-13851,-29696,-13874,-29686,-13896,-29675,-13919,-29664,-13942,-29654,-13965,-29643,-13987,-29632,-14010,-29622,-14033,-29611,-14056,-29600,-14078,-29589,-14101,-29578,-14124,-29568,-14146,-29557,-14169,-29546,-14192,-29535,-14214,-29524,-14237,-29513,-14260,-29502,-14282,-29491,-14305,-29480,-14327,-29469,-14350,-29458,-14373,-29447,-14395,-29436,-14418,-29425,-14440,-29414,-14463,-29403,-14485,-29392,-14508,-29381,-14531,-29370,-14553,-29359,-14576,-29347,-14598,-29336,-14621,-29325,-14643,-29314,-14666,-29303,-14688,-29291,-14710,-29280,-14733,-29269,-14755,-29257,-14778,-29246,-14800,-29235,-14823,-29223,-14845,-29212,-14867,-29201,-14890,-29189,-14912,-29178,-14935,-29166,-14957,-29155,-14979,-29143,-15002,-29132,-15024,-29120,-15046,-29109,-15069,-29097,-15091,-29086,-15113,-29074,-15136,-29063,-15158,-29051,-15180,-29039,-15202,-29028,-15225,-29016,-15247,-29004,-15269,-28993,-15291,-28981,-15314,-28969,-15336,-28957,-15358,-28946,-15380,-28934,-15402,-28922,-15425,-28910,-15447,-28898,-15469,-28887,-15491,-28875,-15513,-28863,-15535,-28851,-15557,-28839,-15580,-28827,-15602,-28815,-15624,-28803,-15646,-28791,-15668,-28779,-15690,-28767,-15712,-28755,-15734,-28743,-15756,-28731,-15778,-28719,-15800,-28707,-15822,-28695,-15844,-28682,-15866,-28670,-15888,-28658,-15910,-28646,-15932,-28634,-15954,-28621,-15976,-28609,-15998,-28597,-16020,-28585,-16042,-28572,-16064,-28560,-16086,-28548,-16108,-28535,-16129,-28523,-16151,-28511,-16173,-28498,-16195,-28486,-16217,-28473,-16239,-28461,-16261,-28448,-16282,-28436,-16304,-28424,-16326,-28411,-16348,-28398,-16369,-28386,-16391,-28373,-16413,-28361,-16435,-28348,-16456,-28336,-16478,-28323,-16500,-28310,-16522,-28298,-16543,-28285,-16565,-28272,-16587,-28260,-16608,-28247,-16630,-28234,-16652,-28221,-16673,-28209,-16695,-28196,-16717,-28183,-16738,-28170,-16760,-28157,-16781,-28144,-16803,-28132,-16825,-28119,-16846,-28106,-16868,-28093,-16889,-28080,-16911,-28067,-16932,-28054,-16954,-28041,-16975,-28028,-16997,-28015,-17018,-28002,-17040,-27989,-17061,-27976,-17083,-27963,-17104,-27949,-17125,-27936,-17147,-27923,-17168,-27910,-17190,-27897,-17211,-27884,-17233,-27870,-17254,-27857,-17275,-27844,-17297,-27831,-17318,-27817,-17339,-27804,-17361,-27791,-17382,-27778,-17403,-27764,-17424,-27751,-17446,-27737,-17467,-27724,-17488,-27711,-17510,-27697,-17531,-27684,-17552,-27670,-17573,-27657,-17594,-27643,-17616,-27630,-17637,-27616,-17658,-27603,-17679,-27589,-17700,-27576,-17721,-27562,-17743,-27549,-17764,-27535,-17785,-27521,-17806,-27508,-17827,-27494,-17848,-27480,-17869,-27467,-17890,-27453,-17911,-27439,-17932,-27425,-17953,-27412,-17974,-27398,-17995,-27384,-18016,-27370,-18037,-27356,-18058,-27343,-18079,-27329,-18100,-27315,-18121,-27301,-18142,-27287,-18163,-27273,-18184,-27259,-18205,-27245,-18226,-27231,-18247,-27217,-18268,-27203,-18288,-27189,-18309,-27175,-18330,-27161,-18351,-27147,-18372,-27133,-18393,-27119,-18413,-27105,-18434,-27091,-18455,-27077,-18476,-27062,-18496,-27048,-18517,-27034,-18538,-27020,-18559,-27006,-18579,-26991,-18600,-26977,-18621,-26963,-18641,-26949,-18662,-26934,-18683,-26920,-18703,-26906,-18724,-26891,-18745,-26877,-18765,-26862,-18786,-26848,-18806,-26834,-18827,-26819,-18847,-26805,-18868,-26790,-18889,-26776,-18909,-26761,-18930,-26747,-18950,-26732,-18971,-26718,-18991,-26703,-19012,-26689,-19032,-26674,-19052,-26659,-19073,-26645,-19093,-26630,-19114,-26616,-19134,-26601,-19155,-26586,-19175,-26571,-19195,-26557,-19216,-26542,-19236,-26527,-19256,-26513,-19277,-26498,-19297,-26483,-19317,-26468,-19338,-26453,-19358,-26438,-19378,-26424,-19398,-26409,-19419,-26394,-19439,-26379,-19459,-26364,-19479,-26349,-19500,-26334,-19520,-26319,-19540,-26304,-19560,-26289,-19580,-26274,-19600,-26259,-19621,-26244,-19641,-26229,-19661,-26214,-19681,-26199,-19701,-26184,-19721,-26169,-19741,-26154,-19761,-26138,-19781,-26123,-19801,-26108,-19821,-26093,-19841,-26078,-19861,-26062,-19881,-26047,-19901,-26032,-19921,-26017,-19941,-26001,-19961,-25986,-19981,-25971,-20001,-25955,-20021,-25940,-20041,-25925,-20061,-25909,-20080,-25894,-20100,-25879,-20120,-25863,-20140,-25848,-20160,-25832,-20180,-25817,-20199,-25801,-20219,-25786,-20239,-25770,-20259,-25755,-20278,-25739,-20298,-25724,-20318,-25708,-20338,-25692,-20357,-25677,-20377,-25661,-20397,-25646,-20416,-25630,-20436,-25614,-20456,-25599,-20475,-25583,-20495,-25567,-20514,-25551,-20534,-25536,-20554,-25520,-20573,-25504,-20593,-25488,-20612,-25473,-20632,-25457,-20651,-25441,-20671,-25425,-20690,-25409,-20710,-25393,-20729,-25377,-20749,-25362,-20768,-25346,-20788,-25330,-20807,-25314,-20826,-25298,-20846,-25282,-20865,-25266,-20885,-25250,-20904,-25234,-20923,-25218,-20943,-25202,-20962,-25186,-20981,-25170,-21001,-25153,-21020,-25137,-21039,-25121,-21058,-25105,-21078,-25089,-21097,-25073,-21116,-25057,-21135,-25040,-21155,-25024,-21174,-25008,-21193,-24992,-21212,-24975,-21231,-24959,-21250,-24943,-21269,-24927,-21289,-24910,-21308,-24894,-21327,-24878,-21346,-24861,-21365,-24845,-21384,-24828,-21403,-24812,-21422,-24796,-21441,-24779,-21460,-24763,-21479,-24746,-21498,-24730,-21517,-24713,-21536,-24697,-21555,-24680,-21574,-24664,-21593,-24647,-21612,-24631,-21630,-24614,-21649,-24597,-21668,-24581,-21687,-24564,-21706,-24547,-21725,-24531,-21744,-24514,-21762,-24497,-21781,-24481,-21800,-24464,-21819,-24447,-21837,-24431,-21856,-24414,-21875,-24397,-21894,-24380,-21912,-24363,-21931,-24347,-21950,-24330,-21968,-24313,-21987,-24296,-22005,-24279,-22024,-24262,-22043,-24245,-22061,-24229,-22080,-24212,-22098,-24195,-22117,-24178,-22136,-24161,-22154,-24144,-22173,-24127,-22191,-24110,-22210,-24093,-22228,-24076,-22246,-24059,-22265,-24042,-22283,-24024,-22302,-24007,-22320,-23990,-22339,-23973,-22357,-23956,-22375,-23939,-22394,-23922,-22412,-23904,-22430,-23887,-22449,-23870,-22467,-23853,-22485,-23836,-22504,-23818,-22522,-23801,-22540,-23784,-22558,-23767,-22576,-23749,-22595,-23732,-22613,-23715,-22631,-23697,-22649,-23680,-22667,-23662,-22686,-23645,-22704,-23628,-22722,-23610,-22740,-23593,-22758,-23575,-22776,-23558,-22794,-23540,-22812,-23523,-22830,-23505,-22848,-23488,-22866,-23470,-22884,-23453,-22902,-23435,-22920,-23418,-22938,-23400,-22956,-23383,-22974,-23365,-22992,-23347,-23010,-23330,-23028,-23312,-23046,-23294,-23063,-23277,-23081,-23259,-23099,-23241,-23117,-23224,-23135,-23206,-23152,-23188,-23170,-23170,-23188,-23152,-23206,-23135,-23224,-23117,-23241,-23099,-23259,-23081,-23277,-23063,-23294,-23046,-23312,-23028,-23330,-23010,-23347,-22992,-23365,-22974,-23383,-22956,-23400,-22938,-23418,-22920,-23435,-22902,-23453,-22884,-23470,-22866,-23488,-22848,-23505,-22830,-23523,-22812,-23540,-22794,-23558,-22776,-23575,-22758,-23593,-22740,-23610,-22722,-23628,-22704,-23645,-22686,-23662,-22667,-23680,-22649,-23697,-22631,-23715,-22613,-23732,-22595,-23749,-22576,-23767,-22558,-23784,-22540,-23801,-22522,-23818,-22504,-23836,-22485,-23853,-22467,-23870,-22449,-23887,-22430,-23904,-22412,-23922,-22394,-23939,-22375,-23956,-22357,-23973,-22339,-23990,-22320,-24007,-22302,-24024,-22283,-24042,-22265,-24059,-22246,-24076,-22228,-24093,-22210,-24110,-22191,-24127,-22173,-24144,-22154,-24161,-22136,-24178,-22117,-24195,-22098,-24212,-22080,-24229,-22061,-24245,-22043,-24262,-22024,-24279,-22005,-24296,-21987,-24313,-21968,-24330,-21950,-24347,-21931,-24363,-21912,-24380,-21894,-24397,-21875,-24414,-21856,-24431,-21837,-24447,-21819,-24464,-21800,-24481,-21781,-24497,-21762,-24514,-21744,-24531,-21725,-24547,-21706,-24564,-21687,-24581,-21668,-24597,-21649,-24614,-21630,-24631,-21612,-24647,-21593,-24664,-21574,-24680,-21555,-24697,-21536,-24713,-21517,-24730,-21498,-24746,-21479,-24763,-21460,-24779,-21441,-24796,-21422,-24812,-21403,-24828,-21384,-24845,-21365,-24861,-21346,-24878,-21327,-24894,-21308,-24910,-21289,-24927,-21269,-24943,-21250,-24959,-21231,-24975,-21212,-24992,-21193,-25008,-21174,-25024,-21155,-25040,-21135,-25057,-21116,-25073,-21097,-25089,-21078,-25105,-21058,-25121,-21039,-25137,-21020,-25153,-21001,-25170,-20981,-25186,-20962,-25202,-20943,-25218,-20923,-25234,-20904,-25250,-20885,-25266,-20865,-25282,-20846,-25298,-20826,-25314,-20807,-25330,-20788,-25346,-20768,-25362,-20749,-25377,-20729,-25393,-20710,-25409,-20690,-25425,-20671,-25441,-20651,-25457,-20632,-25473,-20612,-25488,-20593,-25504,-20573,-25520,-20554,-25536,-20534,-25551,-20514,-25567,-20495,-25583,-20475,-25599,-20456,-25614,-20436,-25630,-20416,-25646,-20397,-25661,-20377,-25677,-20357,-25692,-20338,-25708,-20318,-25724,-20298,-25739,-20278,-25755,-20259,-25770,-20239,-25786,-20219,-25801,-20199,-25817,-20180,-25832,-20160,-25848,-20140,-25863,-20120,-25879,-20100,-25894,-20080,-25909,-20061,-25925,-20041,-25940,-20021,-25955,-20001,-25971,-19981,-25986,-19961,-26001,-19941,-26017,-19921,-26032,-19901,-26047,-19881,-26062,-19861,-26078,-19841,-26093,-19821,-26108,-19801,-26123,-19781,-26138,-19761,-26154,-19741,-26169,-19721,-26184,-19701,-26199,-19681,-26214,-19661,-26229,-19641,-26244,-19621,-26259,-19600,-26274,-19580,-26289,-19560,-26304,-19540,-26319,-19520,-26334,-19500,-26349,-19479,-26364,-19459,-26379,-19439,-26394,-19419,-26409,-19398,-26424,-19378,-26438,-19358,-26453,-19338,-26468,-19317,-26483,-19297,-26498,-19277,-26513,-19256,-26527,-19236,-26542,-19216,-26557,-19195,-26571,-19175,-26586,-19155,-26601,-19134,-26616,-19114,-26630,-19093,-26645,-19073,-26659,-19052,-26674,-19032,-26689,-19012,-26703,-18991,-26718,-18971,-26732,-18950,-26747,-18930,-26761,-18909,-26776,-18889,-26790,-18868,-26805,-18847,-26819,-18827,-26834,-18806,-26848,-18786,-26862,-18765,-26877,-18745,-26891,-18724,-26906,-18703,-26920,-18683,-26934,-18662,-26949,-18641,-26963,-18621,-26977,-18600,-26991,-18579,-27006,-18559,-27020,-18538,-27034,-18517,-27048,-18496,-27062,-18476,-27077,-18455,-27091,-18434,-27105,-18413,-27119,-18393,-27133,-18372,-27147,-18351,-27161,-18330,-27175,-18309,-27189,-18288,-27203,-18268,-27217,-18247,-27231,-18226,-27245,-18205,-27259,-18184,-27273,-18163,-27287,-18142,-27301,-18121,-27315,-18100,-27329,-18079,-27343,-18058,-27356,-18037,-27370,-18016,-27384,-17995,-27398,-17974,-27412,-17953,-27425,-17932,-27439,-17911,-27453,-17890,-27467,-17869,-27480,-17848,-27494,-17827,-27508,-17806,-27521,-17785,-27535,-17764,-27549,-17743,-27562,-17721,-27576,-17700,-27589,-17679,-27603,-17658,-27616,-17637,-27630,-17616,-27643,-17594,-27657,-17573,-27670,-17552,-27684,-17531,-27697,-17510,-27711,-17488,-27724,-17467,-27737,-17446,-27751,-17424,-27764,-17403,-27778,-17382,-27791,-17361,-27804,-17339,-27817,-17318,-27831,-17297,-27844,-17275,-27857,-17254,-27870,-17233,-27884,-17211,-27897,-17190,-27910,-17168,-27923,-17147,-27936,-17125,-27949,-17104,-27963,-17083,-27976,-17061,-27989,-17040,-28002,-17018,-28015,-16997,-28028,-16975,-28041,-16954,-28054,-16932,-28067,-16911,-28080,-16889,-28093,-16868,-28106,-16846,-28119,-16825,-28132,-16803,-28144,-16781,-28157,-16760,-28170,-16738,-28183,-16717,-28196,-16695,-28209,-16673,-28221,-16652,-28234,-16630,-28247,-16608,-28260,-16587,-28272,-16565,-28285,-16543,-28298,-16522,-28310,-16500,-28323,-16478,-28336,-16456,-28348,-16435,-28361,-16413,-28373,-16391,-28386,-16369,-28398,-16348,-28411,-16326,-28424,-16304,-28436,-16282,-28448,-16261,-28461,-16239,-28473,-16217,-28486,-16195,-28498,-16173,-28511,-16151,-28523,-16129,-28535,-16108,-28548,-16086,-28560,-16064,-28572,-16042,-28585,-16020,-28597,-15998,-28609,-15976,-28621,-15954,-28634,-15932,-28646,-15910,-28658,-15888,-28670,-15866,-28682,-15844,-28695,-15822,-28707,-15800,-28719,-15778,-28731,-15756,-28743,-15734,-28755,-15712,-28767,-15690,-28779,-15668,-28791,-15646,-28803,-15624,-28815,-15602,-28827,-15580,-28839,-15557,-28851,-15535,-28863,-15513,-28875,-15491,-28887,-15469,-28898,-15447,-28910,-15425,-28922,-15402,-28934,-15380,-28946,-15358,-28957,-15336,-28969,-15314,-28981,-15291,-28993,-15269,-29004,-15247,-29016,-15225,-29028,-15202,-29039,-15180,-29051,-15158,-29063,-15136,-29074,-15113,-29086,-15091,-29097,-15069,-29109,-15046,-29120,-15024,-29132,-15002,-29143,-14979,-29155,-14957,-29166,-14935,-29178,-14912,-29189,-14890,-29201,-14867,-29212,-14845,-29223,-14823,-29235,-14800,-29246,-14778,-29257,-14755,-29269,-14733,-29280,-14710,-29291,-14688,-29303,-14666,-29314,-14643,-29325,-14621,-29336,-14598,-29347,-14576,-29359,-14553,-29370,-14531,-29381,-14508,-29392,-14485,-29403,-14463,-29414,-14440,-29425,-14418,-29436,-14395,-29447,-14373,-29458,-14350,-29469,-14327,-29480,-14305,-29491,-14282,-29502,-14260,-29513,-14237,-29524,-14214,-29535,-14192,-29546,-14169,-29557,-14146,-29568,-14124,-29578,-14101,-29589,-14078,-29600,-14056,-29611,-14033,-29622,-14010,-29632,-13987,-29643,-13965,-29654,-13942,-29664,-13919,-29675,-13896,-29686,-13874,-29696,-13851,-29707,-13828,-29718,-13805,-29728,-13783,-29739,-13760,-29749,-13737,-29760,-13714,-29770,-13691,-29781,-13668,-29791,-13646,-29802,-13623,-29812,-13600,-29823,-13577,-29833,-13554,-29843,-13531,-29854,-13508,-29864,-13486,-29874,-13463,-29885,-13440,-29895,-13417,-29905,-13394,-29916,-13371,-29926,-13348,-29936,-13325,-29946,-13302,-29956,-13279,-29967,-13256,-29977,-13233,-29987,-13210,-29997,-13187,-30007,-13164,-30017,-13141,-30027,-13118,-30037,-13095,-30047,-13072,-30057,-13049,-30067,-13026,-30077,-13003,-30087,-12980,-30097,-12957,-30107,-12934,-30117,-12910,-30127,-12887,-30137,-12864,-30147,-12841,-30157,-12818,-30166,-12795,-30176,-12772,-30186,-12749,-30196,-12725,-30206,-12702,-30215,-12679,-30225,-12656,-30235,-12633,-30244,-12610,-30254,-12586,-30264,-12563,-30273,-12540,-30283,-12517,-30292,-12493,-30302,-12470,-30312,-12447,-30321,-12424,-30331,-12400,-30340,-12377,-30350,-12354,-30359,-12331,-30369,-12307,-30378,-12284,-30387,-12261,-30397,-12237,-30406,-12214,-30416,-12191,-30425,-12167,-30434,-12144,-30443,-12121,-30453,-12097,-30462,-12074,-30471,-12051,-30481,-12027,-30490,-12004,-30499,-11981,-30508,-11957,-30517,-11934,-30526,-11910,-30536,-11887,-30545,-11863,-30554,-11840,-30563,-11817,-30572,-11793,-30581,-11770,-30590,-11746,-30599,-11723,-30608,-11699,-30617,-11676,-30626,-11652,-30635,-11629,-30644,-11605,-30653,-11582,-30661,-11558,-30670,-11535,-30679,-11511,-30688,-11488,-30697,-11464,-30706,-11441,-30714,-11417,-30723,-11394,-30732,-11370,-30740,-11346,-30749,-11323,-30758,-11299,-30767,-11276,-30775,-11252,-30784,-11228,-30792,-11205,-30801,-11181,-30810,-11158,-30818,-11134,-30827,-11110,-30835,-11087,-30844,-11063,-30852,-11039,-30861,-11016,-30869,-10992,-30877,-10968,-30886,-10945,-30894,-10921,-30903,-10897,-30911,-10874,-30919,-10850,-30928,-10826,-30936,-10802,-30944,-10779,-30952,-10755,-30961,-10731,-30969,-10707,-30977,-10684,-30985,-10660,-30993,-10636,-31002,-10612,-31010,-10589,-31018,-10565,-31026,-10541,-31034,-10517,-31042,-10493,-31050,-10470,-31058,-10446,-31066,-10422,-31074,-10398,-31082,-10374,-31090,-10350,-31098,-10327,-31106,-10303,-31114,-10279,-31122,-10255,-31129,-10231,-31137,-10207,-31145,-10183,-31153,-10160,-31161,-10136,-31168,-10112,-31176,-10088,-31184,-10064,-31192,-10040,-31199,-10016,-31207,-9992,-31215,-9968,-31222,-9944,-31230,-9920,-31237,-9896,-31245,-9872,-31253,-9848,-31260,-9824,-31268,-9800,-31275,-9776,-31283,-9752,-31290,-9728,-31298,-9704,-31305,-9680,-31312,-9656,-31320,-9632,-31327,-9608,-31335,-9584,-31342,-9560,-31349,-9536,-31357,-9512,-31364,-9488,-31371,-9464,-31378,-9440,-31386,-9416,-31393,-9392,-31400,-9368,-31407,-9344,-31414,-9320,-31421,-9296,-31429,-9271,-31436,-9247,-31443,-9223,-31450,-9199,-31457,-9175,-31464,-9151,-31471,-9127,-31478,-9103,-31485,-9078,-31492,-9054,-31499,-9030,-31506,-9006,-31513,-8982,-31519,-8958,-31526,-8933,-31533,-8909,-31540,-8885,-31547,-8861,-31554,-8837,-31560,-8813,-31567,-8788,-31574,-8764,-31581,-8740,-31587,-8716,-31594,-8691,-31601,-8667,-31607,-8643,-31614,-8619,-31620,-8594,-31627,-8570,-31634,-8546,-31640,-8522,-31647,-8497,-31653,-8473,-31660,-8449,-31666,-8425,-31673,-8400,-31679,-8376,-31685,-8352,-31692,-8327,-31698,-8303,-31705,-8279,-31711,-8254,-31717,-8230,-31724,-8206,-31730,-8181,-31736,-8157,-31742,-8133,-31749,-8108,-31755,-8084,-31761,-8060,-31767,-8035,-31773,-8011,-31779,-7987,-31786,-7962,-31792,-7938,-31798,-7913,-31804,-7889,-31810,-7865,-31816,-7840,-31822,-7816,-31828,-7791,-31834,-7767,-31840,-7743,-31846,-7718,-31852,-7694,-31857,-7669,-31863,-7645,-31869,-7620,-31875,-7596,-31881,-7572,-31887,-7547,-31892,-7523,-31898,-7498,-31904,-7474,-31910,-7449,-31915,-7425,-31921,-7400,-31927,-7376,-31932,-7351,-31938,-7327,-31944,-7302,-31949,-7278,-31955,-7253,-31960,-7229,-31966,-7204,-31971,-7180,-31977,-7155,-31982,-7131,-31988,-7106,-31993,-7082,-31999,-7057,-32004,-7033,-32009,-7008,-32015,-6983,-32020,-6959,-32025,-6934,-32031,-6910,-32036,-6885,-32041,-6861,-32047,-6836,-32052,-6812,-32057,-6787,-32062,-6762,-32067,-6738,-32073,-6713,-32078,-6689,-32083,-6664,-32088,-6639,-32093,-6615,-32098,-6590,-32103,-6565,-32108,-6541,-32113,-6516,-32118,-6492,-32123,-6467,-32128,-6442,-32133,-6418,-32138,-6393,-32143,-6368,-32148,-6344,-32153,-6319,-32157,-6294,-32162,-6270,-32167,-6245,-32172,-6220,-32177,-6196,-32181,-6171,-32186,-6146,-32191,-6122,-32195,-6097,-32200,-6072,-32205,-6048,-32209,-6023,-32214,-5998,-32219,-5973,-32223,-5949,-32228,-5924,-32232,-5899,-32237,-5875,-32241,-5850,-32246,-5825,-32250,-5800,-32255,-5776,-32259,-5751,-32263,-5726,-32268,-5701,-32272,-5677,-32276,-5652,-32281,-5627,-32285,-5602,-32289,-5578,-32294,-5553,-32298,-5528,-32302,-5503,-32306,-5479,-32311,-5454,-32315,-5429,-32319,-5404,-32323,-5379,-32327,-5355,-32331,-5330,-32335,-5305,-32339,-5280,-32343,-5255,-32347,-5231,-32351,-5206,-32355,-5181,-32359,-5156,-32363,-5131,-32367,-5107,-32371,-5082,-32375,-5057,-32379,-5032,-32383,-5007,-32387,-4982,-32390,-4958,-32394,-4933,-32398,-4908,-32402,-4883,-32405,-4858,-32409,-4833,-32413,-4808,-32417,-4784,-32420,-4759,-32424,-4734,-32427,-4709,-32431,-4684,-32435,-4659,-32438,-4634,-32442,-4609,-32445,-4585,-32449,-4560,-32452,-4535,-32456,-4510,-32459,-4485,-32463,-4460,-32466,-4435,-32469,-4410,-32473,-4385,-32476,-4360,-32479,-4336,-32483,-4311,-32486,-4286,-32489,-4261,-32493,-4236,-32496,-4211,-32499,-4186,-32502,-4161,-32505,-4136,-32509,-4111,-32512,-4086,-32515,-4061,-32518,-4036,-32521,-4012,-32524,-3987,-32527,-3962,-32530,-3937,-32533,-3912,-32536,-3887,-32539,-3862,-32542,-3837,-32545,-3812,-32548,-3787,-32551,-3762,-32554,-3737,-32557,-3712,-32559,-3687,-32562,-3662,-32565,-3637,-32568,-3612,-32571,-3587,-32573,-3562,-32576,-3537,-32579,-3512,-32581,-3487,-32584,-3462,-32587,-3437,-32589,-3412,-32592,-3387,-32595,-3362,-32597,-3337,-32600,-3312,-32602,-3287,-32605,-3262,-32607,-3237,-32610,-3212,-32612,-3187,-32615,-3162,-32617,-3137,-32619,-3112,-32622,-3087,-32624,-3062,-32626,-3037,-32629,-3012,-32631,-2987,-32633,-2962,-32636,-2937,-32638,-2912,-32640,-2887,-32642,-2862,-32645,-2837,-32647,-2812,-32649,-2787,-32651,-2762,-32653,-2737,-32655,-2712,-32657,-2687,-32659,-2662,-32661,-2637,-32663,-2611,-32665,-2586,-32667,-2561,-32669,-2536,-32671,-2511,-32673,-2486,-32675,-2461,-32677,-2436,-32679,-2411,-32681,-2386,-32682,-2361,-32684,-2336,-32686,-2311,-32688,-2286,-32689,-2261,-32691,-2236,-32693,-2210,-32695,-2185,-32696,-2160,-32698,-2135,-32700,-2110,-32701,-2085,-32703,-2060,-32704,-2035,-32706,-2010,-32707,-1985,-32709,-1960,-32710,-1935,-32712,-1909,-32713,-1884,-32715,-1859,-32716,-1834,-32718,-1809,-32719,-1784,-32720,-1759,-32722,-1734,-32723,-1709,-32724,-1684,-32726,-1659,-32727,-1633,-32728,-1608,-32729,-1583,-32730,-1558,-32732,-1533,-32733,-1508,-32734,-1483,-32735,-1458,-32736,-1433,-32737,-1407,-32738,-1382,-32739,-1357,-32740,-1332,-32741,-1307,-32742,-1282,-32743,-1257,-32744,-1232,-32745,-1207,-32746,-1181,-32747,-1156,-32748,-1131,-32749,-1106,-32750,-1081,-32751,-1056,-32751,-1031,-32752,-1006,-32753,-981,-32754,-955,-32754,-930,-32755,-905,-32756,-880,-32756,-855,-32757,-830,-32758,-805,-32758,-780,-32759,-754,-32759,-729,-32760,-704,-32760,-679,-32761,-654,-32761,-629,-32762,-604,-32762,-579,-32763,-553,-32763,-528,-32764,-503,-32764,-478,-32764,-453,-32765,-428,-32765,-403,-32765,-377,-32766,-352,-32766,-327,-32766,-302,-32766,-277,-32767,-252,-32767,-227,-32767,-202,-32767,-176,-32767,-151,-32767,-126,-32767,-101,-32767,-76,-32767,-51,-32767,-26}; +#ifdef __AVX2__ +void dft4096_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[512],ytmp[512],*tw4096_256p=(simd256_q15_t *)tw4096,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i,j; + + for (i=0,j=0; i<512; i+=4,j++) { + transpose16_ooff_simd256(x256+i,xtmp+j,128); + } + + + dft1024_simd256((int16_t*)(xtmp),(int16_t*)(ytmp),1); + dft1024_simd256((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1); + dft1024_simd256((int16_t*)(xtmp+256),(int16_t*)(ytmp+256),1); + dft1024_simd256((int16_t*)(xtmp+384),(int16_t*)(ytmp+384),1); + + for (i=0; i<128; i++) { + bfly4_256(ytmpp,ytmpp+128,ytmpp+256,ytmpp+384, + y256p,y256p+128,y256p+256,y256p+384, + tw4096_256p,tw4096_256p+128,tw4096_256p+256); + tw4096_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0; i<32; i++) { + y256[0] = shiftright_int16_simd256(y256[0],1); + y256[1] = shiftright_int16_simd256(y256[1],1); + y256[2] = shiftright_int16_simd256(y256[2],1); + y256[3] = shiftright_int16_simd256(y256[3],1); + y256[4] = shiftright_int16_simd256(y256[4],1); + y256[5] = shiftright_int16_simd256(y256[5],1); + y256[6] = shiftright_int16_simd256(y256[6],1); + y256[7] = shiftright_int16_simd256(y256[7],1); + y256[8] = shiftright_int16_simd256(y256[8],1); + y256[9] = shiftright_int16_simd256(y256[9],1); + y256[10] = shiftright_int16_simd256(y256[10],1); + y256[11] = shiftright_int16_simd256(y256[11],1); + y256[12] = shiftright_int16_simd256(y256[12],1); + y256[13] = shiftright_int16_simd256(y256[13],1); + y256[14] = shiftright_int16_simd256(y256[14],1); + y256[15] = shiftright_int16_simd256(y256[15],1); + + y256+=16; + } + + } + + _mm_empty(); + _m_empty(); + +} + +void idft4096_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[512],ytmp[512],*tw4096_256p=(simd256_q15_t *)tw4096,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i,j; + + for (i=0,j=0; i<512; i+=4,j++) { + transpose16_ooff_simd256(x256+i,xtmp+j,128); + } + + + idft1024_simd256((int16_t*)(xtmp),(int16_t*)(ytmp),1); + idft1024_simd256((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1); + idft1024_simd256((int16_t*)(xtmp+256),(int16_t*)(ytmp+256),1); + idft1024_simd256((int16_t*)(xtmp+384),(int16_t*)(ytmp+384),1); + + for (i=0; i<128; i++) { + ibfly4_256(ytmpp,ytmpp+128,ytmpp+256,ytmpp+384, + y256p,y256p+128,y256p+256,y256p+384, + tw4096_256p,tw4096_256p+128,tw4096_256p+256); + tw4096_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0; i<32; i++) { + y256[0] = shiftright_int16_simd256(y256[0],1); + y256[1] = shiftright_int16_simd256(y256[1],1); + y256[2] = shiftright_int16_simd256(y256[2],1); + y256[3] = shiftright_int16_simd256(y256[3],1); + y256[4] = shiftright_int16_simd256(y256[4],1); + y256[5] = shiftright_int16_simd256(y256[5],1); + y256[6] = shiftright_int16_simd256(y256[6],1); + y256[7] = shiftright_int16_simd256(y256[7],1); + y256[8] = shiftright_int16_simd256(y256[8],1); + y256[9] = shiftright_int16_simd256(y256[9],1); + y256[10] = shiftright_int16_simd256(y256[10],1); + y256[11] = shiftright_int16_simd256(y256[11],1); + y256[12] = shiftright_int16_simd256(y256[12],1); + y256[13] = shiftright_int16_simd256(y256[13],1); + y256[14] = shiftright_int16_simd256(y256[14],1); + y256[15] = shiftright_int16_simd256(y256[15],1); + + y256+=16; + } + + } + + _mm_empty(); + _m_empty(); + +} + +#endif + + +#include "twiddles8192.h" void dft8192(int16_t *x,int16_t *y,int scale) { @@ -3173,13 +5204,105 @@ void idft8192(int16_t *x,int16_t *y,int scale) } +#ifdef __AVX2__ +void dft8192_simd256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[1024],*xtmpp,*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[1024],*tw8192_256p=(simd256_q15_t *)tw8192,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + xtmpp = xtmp; + + for (i=0; i<32; i++) { + transpose4_ooff_simd256(x256 ,xtmpp,512); + transpose4_ooff_simd256(x256+2,xtmpp+1,512); + transpose4_ooff_simd256(x256+4,xtmpp+2,512); + transpose4_ooff_simd256(x256+6,xtmpp+3,512); + transpose4_ooff_simd256(x256+8,xtmpp+4,512); + transpose4_ooff_simd256(x256+10,xtmpp+5,512); + transpose4_ooff_simd256(x256+12,xtmpp+6,512); + transpose4_ooff_simd256(x256+14,xtmpp+7,512); + transpose4_ooff_simd256(x256+16,xtmpp+8,512); + transpose4_ooff_simd256(x256+18,xtmpp+9,512); + transpose4_ooff_simd256(x256+20,xtmpp+10,512); + transpose4_ooff_simd256(x256+22,xtmpp+11,512); + transpose4_ooff_simd256(x256+24,xtmpp+12,512); + transpose4_ooff_simd256(x256+26,xtmpp+13,512); + transpose4_ooff_simd256(x256+28,xtmpp+14,512); + transpose4_ooff_simd256(x256+30,xtmpp+15,512); + transpose4_ooff_simd256(x256+32,xtmpp+16,512); + transpose4_ooff_simd256(x256+34,xtmpp+17,512); + transpose4_ooff_simd256(x256+36,xtmpp+18,512); + transpose4_ooff_simd256(x256+38,xtmpp+19,512); + transpose4_ooff_simd256(x256+40,xtmpp+20,512); + transpose4_ooff_simd256(x256+42,xtmpp+21,512); + transpose4_ooff_simd256(x256+44,xtmpp+22,512); + transpose4_ooff_simd256(x256+46,xtmpp+23,512); + transpose4_ooff_simd256(x256+48,xtmpp+24,512); + transpose4_ooff_simd256(x256+50,xtmpp+25,512); + transpose4_ooff_simd256(x256+52,xtmpp+26,512); + transpose4_ooff_simd256(x256+54,xtmpp+27,512); + transpose4_ooff_simd256(x256+56,xtmpp+28,512); + transpose4_ooff_simd256(x256+58,xtmpp+29,512); + transpose4_ooff_simd256(x256+60,xtmpp+30,512); + transpose4_ooff_simd256(x256+62,xtmpp+31,512); + x256+=64; + xtmpp+=32; + } + + dft4096_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); + dft4096_simd256((int16_t*)(xtmp+1024),(int16_t*)(ytmp+512),1); + + + for (i=0; i<512; i++) { + bfly2_256(ytmpp,ytmpp+512, + y256p,y256p+512, + tw8192_256p); + tw8192_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + y256p = y256; + + for (i=0; i<64; i++) { + y256p[0] = mulhi_int16_simd256(y256p[0],ONE_OVER_SQRT2_Q15_128); + y256p[1] = mulhi_int16_simd256(y256p[1],ONE_OVER_SQRT2_Q15_128); + y256p[2] = mulhi_int16_simd256(y256p[2],ONE_OVER_SQRT2_Q15_128); + y256p[3] = mulhi_int16_simd256(y256p[3],ONE_OVER_SQRT2_Q15_128); + y256p[4] = mulhi_int16_simd256(y256p[4],ONE_OVER_SQRT2_Q15_128); + y256p[5] = mulhi_int16_simd256(y256p[5],ONE_OVER_SQRT2_Q15_128); + y256p[6] = mulhi_int16_simd256(y256p[6],ONE_OVER_SQRT2_Q15_128); + y256p[7] = mulhi_int16_simd256(y256p[7],ONE_OVER_SQRT2_Q15_128); + y256p[8] = mulhi_int16_simd256(y256p[8],ONE_OVER_SQRT2_Q15_128); + y256p[9] = mulhi_int16_simd256(y256p[9],ONE_OVER_SQRT2_Q15_128); + y256p[10] = mulhi_int16_simd256(y256p[10],ONE_OVER_SQRT2_Q15_128); + y256p[11] = mulhi_int16_simd256(y256p[11],ONE_OVER_SQRT2_Q15_128); + y256p[12] = mulhi_int16_simd256(y256p[12],ONE_OVER_SQRT2_Q15_128); + y256p[13] = mulhi_int16_simd256(y256p[13],ONE_OVER_SQRT2_Q15_128); + y256p[14] = mulhi_int16_simd256(y256p[14],ONE_OVER_SQRT2_Q15_128); + y256p[15] = mulhi_int16_simd256(y256p[15],ONE_OVER_SQRT2_Q15_128); + y256p+=16; + } + } + + _mm_empty(); + _m_empty(); + +} +#endif + #include "twiddle1536.h" // 512 x 3 void idft1536(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][512 ]__attribute__((aligned(16))); - uint32_t tmpo[3][512] __attribute__((aligned(16))); + uint32_t tmp[3][512 ]__attribute__((aligned(32))); + uint32_t tmpo[3][512] __attribute__((aligned(32))); for (i=0,j=0; i<512; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3217,8 +5340,8 @@ void idft1536(int16_t *input, int16_t *output) void dft1536(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][512] __attribute__((aligned(16))); - uint32_t tmpo[3][512] __attribute__((aligned(16))); + uint32_t tmp[3][512] __attribute__((aligned(32))); + uint32_t tmpo[3][512] __attribute__((aligned(32))); for (i=0,j=0; i<512; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3267,8 +5390,8 @@ void idft3072(int16_t *input, int16_t *output) void idft6144(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][2048] __attribute__((aligned(16))); - uint32_t tmpo[3][2048] __attribute__((aligned(16))); + uint32_t tmp[3][2048] __attribute__((aligned(32))); + uint32_t tmpo[3][2048] __attribute__((aligned(32))); for (i=0,j=0; i<2048; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3308,8 +5431,8 @@ void idft6144(int16_t *input, int16_t *output) void dft6144(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][2048] __attribute__((aligned(16))); - uint32_t tmpo[3][2048] __attribute__((aligned(16))); + uint32_t tmp[3][2048] __attribute__((aligned(32))); + uint32_t tmpo[3][2048] __attribute__((aligned(32))); for (i=0,j=0; i<2048; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3348,8 +5471,8 @@ void dft6144(int16_t *input, int16_t *output) void dft12288(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][4096] __attribute__((aligned(16))); - uint32_t tmpo[3][4096] __attribute__((aligned(16))); + uint32_t tmp[3][4096] __attribute__((aligned(32))); + uint32_t tmpo[3][4096] __attribute__((aligned(32))); for (i=0,j=0; i<4096; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3384,8 +5507,8 @@ void dft12288(int16_t *input, int16_t *output) void idft12288(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][4096] __attribute__((aligned(16))); - uint32_t tmpo[3][4096] __attribute__((aligned(16))); + uint32_t tmp[3][4096] __attribute__((aligned(32))); + uint32_t tmpo[3][4096] __attribute__((aligned(32))); for (i=0,j=0; i<4096; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3431,8 +5554,8 @@ void idft18432(int16_t *input, int16_t *output) void dft24576(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][8192] __attribute__((aligned(16))); - uint32_t tmpo[3][8192] __attribute__((aligned(16))); + uint32_t tmp[3][8192] __attribute__((aligned(32))); + uint32_t tmpo[3][8192] __attribute__((aligned(32))); for (i=0,j=0; i<8192; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3468,8 +5591,8 @@ void dft24576(int16_t *input, int16_t *output) void idft24576(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][16384] __attribute__((aligned(16))); - uint32_t tmpo[3][16384] __attribute__((aligned(16))); + uint32_t tmp[3][16384] __attribute__((aligned(32))); + uint32_t tmpo[3][16384] __attribute__((aligned(32))); for (i=0,j=0; i<8192; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3510,11 +5633,11 @@ void idft24576(int16_t *input, int16_t *output) /// THIS SECTION IS FOR ALL PUSCH DFTS (i.e. radix 2^a * 3^b * 4^c * 5^d) /// They use twiddles for 4-way parallel DFTS (i.e. 4 DFTS with interleaved input/output) -static int16_t W1_12s[8]__attribute__((aligned(16))) = {28377,-16383,28377,-16383,28377,-16383,28377,-16383}; -static int16_t W2_12s[8]__attribute__((aligned(16))) = {16383,-28377,16383,-28377,16383,-28377,16383,-28377}; -static int16_t W3_12s[8]__attribute__((aligned(16))) = {0,-32767,0,-32767,0,-32767,0,-32767}; -static int16_t W4_12s[8]__attribute__((aligned(16))) = {-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377}; -static int16_t W6_12s[8]__attribute__((aligned(16))) = {-32767,0,-32767,0,-32767,0,-32767,0}; +static int16_t W1_12s[8]__attribute__((aligned(32))) = {28377,-16383,28377,-16383,28377,-16383,28377,-16383}; +static int16_t W2_12s[8]__attribute__((aligned(32))) = {16383,-28377,16383,-28377,16383,-28377,16383,-28377}; +static int16_t W3_12s[8]__attribute__((aligned(32))) = {0,-32767,0,-32767,0,-32767,0,-32767}; +static int16_t W4_12s[8]__attribute__((aligned(32))) = {-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377}; +static int16_t W6_12s[8]__attribute__((aligned(32))) = {-32767,0,-32767,0,-32767,0,-32767,0}; simd_q15_t *W1_12=(simd_q15_t *)W1_12s; simd_q15_t *W2_12=(simd_q15_t *)W2_12s; @@ -3693,7 +5816,194 @@ void dft12(int16_t *x,int16_t *y) } -static int16_t tw24[88]__attribute__((aligned(16))) = {31650,-8480,31650,-8480,31650,-8480,31650,-8480, +#ifdef __AVX2__ + +static int16_t W1_12s_256[16]__attribute__((aligned(32))) = {28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383}; +static int16_t W2_12s_256[16]__attribute__((aligned(32))) = {16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377}; +static int16_t W3_12s_256[16]__attribute__((aligned(32))) = {0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767}; +static int16_t W4_12s_256[16]__attribute__((aligned(32))) = {-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377}; +static int16_t W6_12s_256[16]__attribute__((aligned(32))) = {-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0}; + +simd256_q15_t *W1_12_256=(simd256_q15_t *)W1_12s_256; +simd256_q15_t *W2_12_256=(simd256_q15_t *)W2_12s_256; +simd256_q15_t *W3_12_256=(simd256_q15_t *)W3_12s_256; +simd256_q15_t *W4_12_256=(simd256_q15_t *)W4_12s_256; +simd256_q15_t *W6_12_256=(simd256_q15_t *)W6_12s_256; + + +static simd256_q15_t norm256; + +static inline void dft12f_simd256(simd256_q15_t *x0, + simd256_q15_t *x1, + simd256_q15_t *x2, + simd256_q15_t *x3, + simd256_q15_t *x4, + simd256_q15_t *x5, + simd256_q15_t *x6, + simd256_q15_t *x7, + simd256_q15_t *x8, + simd256_q15_t *x9, + simd256_q15_t *x10, + simd256_q15_t *x11, + simd256_q15_t *y0, + simd256_q15_t *y1, + simd256_q15_t *y2, + simd256_q15_t *y3, + simd256_q15_t *y4, + simd256_q15_t *y5, + simd256_q15_t *y6, + simd256_q15_t *y7, + simd256_q15_t *y8, + simd256_q15_t *y9, + simd256_q15_t *y10, + simd256_q15_t *y11) __attribute__((always_inline)); + +static inline void dft12f_simd256(simd256_q15_t *x0, + simd256_q15_t *x1, + simd256_q15_t *x2, + simd256_q15_t *x3, + simd256_q15_t *x4, + simd256_q15_t *x5, + simd256_q15_t *x6, + simd256_q15_t *x7, + simd256_q15_t *x8, + simd256_q15_t *x9, + simd256_q15_t *x10, + simd256_q15_t *x11, + simd256_q15_t *y0, + simd256_q15_t *y1, + simd256_q15_t *y2, + simd256_q15_t *y3, + simd256_q15_t *y4, + simd256_q15_t *y5, + simd256_q15_t *y6, + simd256_q15_t *y7, + simd256_q15_t *y8, + simd256_q15_t *y9, + simd256_q15_t *y10, + simd256_q15_t *y11) +{ + + + simd256_q15_t tmp_dft12[12]; + + simd256_q15_t *tmp_dft12_ptr = &tmp_dft12[0]; + + // msg("dft12\n"); + + bfly4_tw1_256(x0, + x3, + x6, + x9, + tmp_dft12_ptr, + tmp_dft12_ptr+3, + tmp_dft12_ptr+6, + tmp_dft12_ptr+9); + + + bfly4_tw1_256(x1, + x4, + x7, + x10, + tmp_dft12_ptr+1, + tmp_dft12_ptr+4, + tmp_dft12_ptr+7, + tmp_dft12_ptr+10); + + + bfly4_tw1_256(x2, + x5, + x8, + x11, + tmp_dft12_ptr+2, + tmp_dft12_ptr+5, + tmp_dft12_ptr+8, + tmp_dft12_ptr+11); + + // k2=0; + bfly3_tw1_256(tmp_dft12_ptr, + tmp_dft12_ptr+1, + tmp_dft12_ptr+2, + y0, + y4, + y8); + + + + // k2=1; + bfly3_256(tmp_dft12_ptr+3, + tmp_dft12_ptr+4, + tmp_dft12_ptr+5, + y1, + y5, + y9, + W1_12_256, + W2_12_256); + + + + // k2=2; + bfly3_256(tmp_dft12_ptr+6, + tmp_dft12_ptr+7, + tmp_dft12_ptr+8, + y2, + y6, + y10, + W2_12_256, + W4_12_256); + + // k2=3; + bfly3_256(tmp_dft12_ptr+9, + tmp_dft12_ptr+10, + tmp_dft12_ptr+11, + y3, + y7, + y11, + W3_12_256, + W6_12_256); + +} + + + + +void dft12_simd256(int16_t *x,int16_t *y) +{ + + simd256_q15_t *x256 = (simd256_q15_t *)x,*y256 = (simd256_q15_t *)y; + dft12f_simd256(&x256[0], + &x256[1], + &x256[2], + &x256[3], + &x256[4], + &x256[5], + &x256[6], + &x256[7], + &x256[8], + &x256[9], + &x256[10], + &x256[11], + &y256[0], + &y256[1], + &y256[2], + &y256[3], + &y256[4], + &y256[5], + &y256[6], + &y256[7], + &y256[8], + &y256[9], + &y256[10], + &y256[11]); + + _mm_empty(); + _m_empty(); + +} + +#endif + +static int16_t tw24[88]__attribute__((aligned(32))) = {31650,-8480,31650,-8480,31650,-8480,31650,-8480, 28377,-16383,28377,-16383,28377,-16383,28377,-16383, 23169,-23169,23169,-23169,23169,-23169,23169,-23169, 16383,-28377,16383,-28377,16383,-28377,16383,-28377, @@ -3804,7 +6114,7 @@ void dft24(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa36[88]__attribute__((aligned(16))) = {32269,-5689,32269,-5689,32269,-5689,32269,-5689, +static int16_t twa36[88]__attribute__((aligned(32))) = {32269,-5689,32269,-5689,32269,-5689,32269,-5689, 30790,-11206,30790,-11206,30790,-11206,30790,-11206, 28377,-16383,28377,-16383,28377,-16383,28377,-16383, 25100,-21062,25100,-21062,25100,-21062,25100,-21062, @@ -3817,7 +6127,7 @@ static int16_t twa36[88]__attribute__((aligned(16))) = {32269,-5689,32269,-5689, -11206,-30790,-11206,-30790,-11206,-30790,-11206,-30790 }; -static int16_t twb36[88]__attribute__((aligned(16))) = {30790,-11206,30790,-11206,30790,-11206,30790,-11206, +static int16_t twb36[88]__attribute__((aligned(32))) = {30790,-11206,30790,-11206,30790,-11206,30790,-11206, 25100,-21062,25100,-21062,25100,-21062,25100,-21062, 16383,-28377,16383,-28377,16383,-28377,16383,-28377, 5689,-32269,5689,-32269,5689,-32269,5689,-32269, @@ -3950,7 +6260,7 @@ void dft36(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa48[88]__attribute__((aligned(16))) = {32486,-4276,32486,-4276,32486,-4276,32486,-4276, +static int16_t twa48[88]__attribute__((aligned(32))) = {32486,-4276,32486,-4276,32486,-4276,32486,-4276, 31650,-8480,31650,-8480,31650,-8480,31650,-8480, 30272,-12539,30272,-12539,30272,-12539,30272,-12539, 28377,-16383,28377,-16383,28377,-16383,28377,-16383, @@ -3963,7 +6273,7 @@ static int16_t twa48[88]__attribute__((aligned(16))) = {32486,-4276,32486,-4276, 4276,-32486,4276,-32486,4276,-32486,4276,-32486 }; -static int16_t twb48[88]__attribute__((aligned(16))) = {31650,-8480,31650,-8480,31650,-8480,31650,-8480, +static int16_t twb48[88]__attribute__((aligned(32))) = {31650,-8480,31650,-8480,31650,-8480,31650,-8480, 28377,-16383,28377,-16383,28377,-16383,28377,-16383, 23169,-23169,23169,-23169,23169,-23169,23169,-23169, 16383,-28377,16383,-28377,16383,-28377,16383,-28377, @@ -3976,7 +6286,7 @@ static int16_t twb48[88]__attribute__((aligned(16))) = {31650,-8480,31650,-8480, -31650,-8480,-31650,-8480,-31650,-8480,-31650,-8480 }; -static int16_t twc48[88]__attribute__((aligned(16))) = {30272,-12539,30272,-12539,30272,-12539,30272,-12539, +static int16_t twc48[88]__attribute__((aligned(32))) = {30272,-12539,30272,-12539,30272,-12539,30272,-12539, 23169,-23169,23169,-23169,23169,-23169,23169,-23169, 12539,-30272,12539,-30272,12539,-30272,12539,-30272, 0,-32767,0,-32767,0,-32767,0,-32767, @@ -4146,7 +6456,7 @@ void dft48(int16_t *x, int16_t *y,unsigned char scale_flag) } -static int16_t twa60[88]__attribute__((aligned(16))) = {32587,-3425,32587,-3425,32587,-3425,32587,-3425, +static int16_t twa60[88]__attribute__((aligned(32))) = {32587,-3425,32587,-3425,32587,-3425,32587,-3425, 32050,-6812,32050,-6812,32050,-6812,32050,-6812, 31163,-10125,31163,-10125,31163,-10125,31163,-10125, 29934,-13327,29934,-13327,29934,-13327,29934,-13327, @@ -4158,7 +6468,7 @@ static int16_t twa60[88]__attribute__((aligned(16))) = {32587,-3425,32587,-3425, 16383,-28377,16383,-28377,16383,-28377,16383,-28377, 13327,-29934,13327,-29934,13327,-29934,13327,-29934 }; -static int16_t twb60[88]__attribute__((aligned(16))) = {32050,-6812,32050,-6812,32050,-6812,32050,-6812, +static int16_t twb60[88]__attribute__((aligned(32))) = {32050,-6812,32050,-6812,32050,-6812,32050,-6812, 29934,-13327,29934,-13327,29934,-13327,29934,-13327, 26509,-19259,26509,-19259,26509,-19259,26509,-19259, 21925,-24350,21925,-24350,21925,-24350,21925,-24350, @@ -4170,7 +6480,7 @@ static int16_t twb60[88]__attribute__((aligned(16))) = {32050,-6812,32050,-6812, -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377, -21925,-24350,-21925,-24350,-21925,-24350,-21925,-24350 }; -static int16_t twc60[88]__attribute__((aligned(16))) = {31163,-10125,31163,-10125,31163,-10125,31163,-10125, +static int16_t twc60[88]__attribute__((aligned(32))) = {31163,-10125,31163,-10125,31163,-10125,31163,-10125, 26509,-19259,26509,-19259,26509,-19259,26509,-19259, 19259,-26509,19259,-26509,19259,-26509,19259,-26509, 10125,-31163,10125,-31163,10125,-31163,10125,-31163, @@ -4182,7 +6492,7 @@ static int16_t twc60[88]__attribute__((aligned(16))) = {31163,-10125,31163,-1012 -32767,0,-32767,0,-32767,0,-32767,0, -31163,10125,-31163,10125,-31163,10125,-31163,10125 }; -static int16_t twd60[88]__attribute__((aligned(16))) = {29934,-13327,29934,-13327,29934,-13327,29934,-13327, +static int16_t twd60[88]__attribute__((aligned(32))) = {29934,-13327,29934,-13327,29934,-13327,29934,-13327, 21925,-24350,21925,-24350,21925,-24350,21925,-24350, 10125,-31163,10125,-31163,10125,-31163,10125,-31163, -3425,-32587,-3425,-32587,-3425,-32587,-3425,-32587, @@ -4374,7 +6684,7 @@ void dft60(int16_t *x,int16_t *y,unsigned char scale) } -static int16_t tw72[280]__attribute__((aligned(16))) = {32642,-2855,32642,-2855,32642,-2855,32642,-2855, +static int16_t tw72[280]__attribute__((aligned(32))) = {32642,-2855,32642,-2855,32642,-2855,32642,-2855, 32269,-5689,32269,-5689,32269,-5689,32269,-5689, 31650,-8480,31650,-8480,31650,-8480,31650,-8480, 30790,-11206,30790,-11206,30790,-11206,30790,-11206, @@ -4453,7 +6763,7 @@ void dft72(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t tw96[376]__attribute__((aligned(16))) = {32696,-2143,32696,-2143,32696,-2143,32696,-2143, +static int16_t tw96[376]__attribute__((aligned(32))) = {32696,-2143,32696,-2143,32696,-2143,32696,-2143, 32486,-4276,32486,-4276,32486,-4276,32486,-4276, 32137,-6392,32137,-6392,32137,-6392,32137,-6392, 31650,-8480,31650,-8480,31650,-8480,31650,-8480, @@ -4546,7 +6856,7 @@ void dft96(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa108[280]__attribute__((aligned(16))) = {32711,-1905,32711,-1905,32711,-1905,32711,-1905, +static int16_t twa108[280]__attribute__((aligned(32))) = {32711,-1905,32711,-1905,32711,-1905,32711,-1905, 32545,-3804,32545,-3804,32545,-3804,32545,-3804, 32269,-5689,32269,-5689,32269,-5689,32269,-5689, 31883,-7556,31883,-7556,31883,-7556,31883,-7556, @@ -4583,7 +6893,7 @@ static int16_t twa108[280]__attribute__((aligned(16))) = {32711,-1905,32711,-190 -14705,-29281,-14705,-29281,-14705,-29281,-14705,-29281 }; -static int16_t twb108[280]__attribute__((aligned(16))) = {32545,-3804,32545,-3804,32545,-3804,32545,-3804, +static int16_t twb108[280]__attribute__((aligned(32))) = {32545,-3804,32545,-3804,32545,-3804,32545,-3804, 31883,-7556,31883,-7556,31883,-7556,31883,-7556, 30790,-11206,30790,-11206,30790,-11206,30790,-11206, 29281,-14705,29281,-14705,29281,-14705,29281,-14705, @@ -4670,7 +6980,7 @@ void dft108(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t tw120[472]__attribute__((aligned(16))) = {32722,-1714,32722,-1714,32722,-1714,32722,-1714, +static int16_t tw120[472]__attribute__((aligned(32))) = {32722,-1714,32722,-1714,32722,-1714,32722,-1714, 32587,-3425,32587,-3425,32587,-3425,32587,-3425, 32363,-5125,32363,-5125,32363,-5125,32363,-5125, 32050,-6812,32050,-6812,32050,-6812,32050,-6812, @@ -4775,7 +7085,7 @@ void dft120(int16_t *x,int16_t *y, unsigned char scale_flag) } -static int16_t twa144[376]__attribute__((aligned(16))) = {32735,-1429,32735,-1429,32735,-1429,32735,-1429, +static int16_t twa144[376]__attribute__((aligned(32))) = {32735,-1429,32735,-1429,32735,-1429,32735,-1429, 32642,-2855,32642,-2855,32642,-2855,32642,-2855, 32486,-4276,32486,-4276,32486,-4276,32486,-4276, 32269,-5689,32269,-5689,32269,-5689,32269,-5689, @@ -4824,7 +7134,7 @@ static int16_t twa144[376]__attribute__((aligned(16))) = {32735,-1429,32735,-142 -15130,-29064,-15130,-29064,-15130,-29064,-15130,-29064 }; -static int16_t twb144[376]__attribute__((aligned(16))) = {32642,-2855,32642,-2855,32642,-2855,32642,-2855, +static int16_t twb144[376]__attribute__((aligned(32))) = {32642,-2855,32642,-2855,32642,-2855,32642,-2855, 32269,-5689,32269,-5689,32269,-5689,32269,-5689, 31650,-8480,31650,-8480,31650,-8480,31650,-8480, 30790,-11206,30790,-11206,30790,-11206,30790,-11206, @@ -4922,7 +7232,7 @@ void dft144(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa180[472]__attribute__((aligned(16))) = {32747,-1143,32747,-1143,32747,-1143,32747,-1143, +static int16_t twa180[472]__attribute__((aligned(32))) = {32747,-1143,32747,-1143,32747,-1143,32747,-1143, 32687,-2285,32687,-2285,32687,-2285,32687,-2285, 32587,-3425,32587,-3425,32587,-3425,32587,-3425, 32448,-4560,32448,-4560,32448,-4560,32448,-4560, @@ -4983,7 +7293,7 @@ static int16_t twa180[472]__attribute__((aligned(16))) = {32747,-1143,32747,-114 -15383,-28931,-15383,-28931,-15383,-28931,-15383,-28931 }; -static int16_t twb180[472]__attribute__((aligned(16))) = {32687,-2285,32687,-2285,32687,-2285,32687,-2285, +static int16_t twb180[472]__attribute__((aligned(32))) = {32687,-2285,32687,-2285,32687,-2285,32687,-2285, 32448,-4560,32448,-4560,32448,-4560,32448,-4560, 32050,-6812,32050,-6812,32050,-6812,32050,-6812, 31497,-9031,31497,-9031,31497,-9031,31497,-9031, @@ -5093,7 +7403,7 @@ void dft180(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa192[376]__attribute__((aligned(16))) = {32749,-1072,32749,-1072,32749,-1072,32749,-1072, +static int16_t twa192[376]__attribute__((aligned(32))) = {32749,-1072,32749,-1072,32749,-1072,32749,-1072, 32696,-2143,32696,-2143,32696,-2143,32696,-2143, 32609,-3211,32609,-3211,32609,-3211,32609,-3211, 32486,-4276,32486,-4276,32486,-4276,32486,-4276, @@ -5142,7 +7452,7 @@ static int16_t twa192[376]__attribute__((aligned(16))) = {32749,-1072,32749,-107 1072,-32749,1072,-32749,1072,-32749,1072,-32749 }; -static int16_t twb192[376]__attribute__((aligned(16))) = {32696,-2143,32696,-2143,32696,-2143,32696,-2143, +static int16_t twb192[376]__attribute__((aligned(32))) = {32696,-2143,32696,-2143,32696,-2143,32696,-2143, 32486,-4276,32486,-4276,32486,-4276,32486,-4276, 32137,-6392,32137,-6392,32137,-6392,32137,-6392, 31650,-8480,31650,-8480,31650,-8480,31650,-8480, @@ -5191,7 +7501,7 @@ static int16_t twb192[376]__attribute__((aligned(16))) = {32696,-2143,32696,-214 -32696,-2143,-32696,-2143,-32696,-2143,-32696,-2143 }; -static int16_t twc192[376]__attribute__((aligned(16))) = {32609,-3211,32609,-3211,32609,-3211,32609,-3211, +static int16_t twc192[376]__attribute__((aligned(32))) = {32609,-3211,32609,-3211,32609,-3211,32609,-3211, 32137,-6392,32137,-6392,32137,-6392,32137,-6392, 31356,-9511,31356,-9511,31356,-9511,31356,-9511, 30272,-12539,30272,-12539,30272,-12539,30272,-12539, @@ -5295,7 +7605,7 @@ void dft192(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa216[568]__attribute__((aligned(16))) = {32753,-953,32753,-953,32753,-953,32753,-953, +static int16_t twa216[568]__attribute__((aligned(32))) = {32753,-953,32753,-953,32753,-953,32753,-953, 32711,-1905,32711,-1905,32711,-1905,32711,-1905, 32642,-2855,32642,-2855,32642,-2855,32642,-2855, 32545,-3804,32545,-3804,32545,-3804,32545,-3804, @@ -5368,7 +7678,7 @@ static int16_t twa216[568]__attribute__((aligned(16))) = {32753,-953,32753,-953, -15551,-28841,-15551,-28841,-15551,-28841,-15551,-28841 }; -static int16_t twb216[568]__attribute__((aligned(16))) = {32711,-1905,32711,-1905,32711,-1905,32711,-1905, +static int16_t twb216[568]__attribute__((aligned(32))) = {32711,-1905,32711,-1905,32711,-1905,32711,-1905, 32545,-3804,32545,-3804,32545,-3804,32545,-3804, 32269,-5689,32269,-5689,32269,-5689,32269,-5689, 31883,-7556,31883,-7556,31883,-7556,31883,-7556, @@ -5490,7 +7800,7 @@ void dft216(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa240[472]__attribute__((aligned(16))) = {32755,-857,32755,-857,32755,-857,32755,-857, +static int16_t twa240[472]__attribute__((aligned(32))) = {32755,-857,32755,-857,32755,-857,32755,-857, 32722,-1714,32722,-1714,32722,-1714,32722,-1714, 32665,-2570,32665,-2570,32665,-2570,32665,-2570, 32587,-3425,32587,-3425,32587,-3425,32587,-3425, @@ -5551,7 +7861,7 @@ static int16_t twa240[472]__attribute__((aligned(16))) = {32755,-857,32755,-857, 857,-32755,857,-32755,857,-32755,857,-32755 }; -static int16_t twb240[472]__attribute__((aligned(16))) = {32722,-1714,32722,-1714,32722,-1714,32722,-1714, +static int16_t twb240[472]__attribute__((aligned(32))) = {32722,-1714,32722,-1714,32722,-1714,32722,-1714, 32587,-3425,32587,-3425,32587,-3425,32587,-3425, 32363,-5125,32363,-5125,32363,-5125,32363,-5125, 32050,-6812,32050,-6812,32050,-6812,32050,-6812, @@ -5612,7 +7922,7 @@ static int16_t twb240[472]__attribute__((aligned(16))) = {32722,-1714,32722,-171 -32722,-1714,-32722,-1714,-32722,-1714,-32722,-1714 }; -static int16_t twc240[472]__attribute__((aligned(16))) = {32665,-2570,32665,-2570,32665,-2570,32665,-2570, +static int16_t twc240[472]__attribute__((aligned(32))) = {32665,-2570,32665,-2570,32665,-2570,32665,-2570, 32363,-5125,32363,-5125,32363,-5125,32363,-5125, 31861,-7649,31861,-7649,31861,-7649,31861,-7649, 31163,-10125,31163,-10125,31163,-10125,31163,-10125, @@ -5740,7 +8050,7 @@ twb2(2:2:end) = imag(twb); */ -static int16_t twa288[760]__attribute__((aligned(16))) = {32759,-714,32759,-714,32759,-714,32759,-714, +static int16_t twa288[760]__attribute__((aligned(32))) = {32759,-714,32759,-714,32759,-714,32759,-714, 32735,-1429,32735,-1429,32735,-1429,32735,-1429, 32696,-2143,32696,-2143,32696,-2143,32696,-2143, 32642,-2855,32642,-2855,32642,-2855,32642,-2855, @@ -5837,7 +8147,7 @@ static int16_t twa288[760]__attribute__((aligned(16))) = {32759,-714,32759,-714, -15760,-28727,-15760,-28727,-15760,-28727,-15760,-28727 }; -static int16_t twb288[760]__attribute__((aligned(16))) = {32735,-1429,32735,-1429,32735,-1429,32735,-1429, +static int16_t twb288[760]__attribute__((aligned(32))) = {32735,-1429,32735,-1429,32735,-1429,32735,-1429, 32642,-2855,32642,-2855,32642,-2855,32642,-2855, 32486,-4276,32486,-4276,32486,-4276,32486,-4276, 32269,-5689,32269,-5689,32269,-5689,32269,-5689, @@ -5983,7 +8293,7 @@ void dft288(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa300[472]__attribute__((aligned(16))) = {32759,-686,32759,-686,32759,-686,32759,-686, +static int16_t twa300[472]__attribute__((aligned(32))) = {32759,-686,32759,-686,32759,-686,32759,-686, 32738,-1372,32738,-1372,32738,-1372,32738,-1372, 32702,-2057,32702,-2057,32702,-2057,32702,-2057, 32652,-2741,32652,-2741,32652,-2741,32652,-2741, @@ -6044,7 +8354,7 @@ static int16_t twa300[472]__attribute__((aligned(16))) = {32759,-686,32759,-686, 10775,-30944,10775,-30944,10775,-30944,10775,-30944 }; -static int16_t twb300[472]__attribute__((aligned(16))) = {32738,-1372,32738,-1372,32738,-1372,32738,-1372, +static int16_t twb300[472]__attribute__((aligned(32))) = {32738,-1372,32738,-1372,32738,-1372,32738,-1372, 32652,-2741,32652,-2741,32652,-2741,32652,-2741, 32508,-4106,32508,-4106,32508,-4106,32508,-4106, 32308,-5464,32308,-5464,32308,-5464,32308,-5464, @@ -6105,7 +8415,7 @@ static int16_t twb300[472]__attribute__((aligned(16))) = {32738,-1372,32738,-137 -25679,-20353,-25679,-20353,-25679,-20353,-25679,-20353 }; -static int16_t twc300[472]__attribute__((aligned(16))) = {32702,-2057,32702,-2057,32702,-2057,32702,-2057, +static int16_t twc300[472]__attribute__((aligned(32))) = {32702,-2057,32702,-2057,32702,-2057,32702,-2057, 32508,-4106,32508,-4106,32508,-4106,32508,-4106, 32186,-6139,32186,-6139,32186,-6139,32186,-6139, 31737,-8148,31737,-8148,31737,-8148,31737,-8148, @@ -6166,7 +8476,7 @@ static int16_t twc300[472]__attribute__((aligned(16))) = {32702,-2057,32702,-205 -27666,17557,-27666,17557,-27666,17557,-27666,17557 }; -static int16_t twd300[472]__attribute__((aligned(16))) = {32652,-2741,32652,-2741,32652,-2741,32652,-2741, +static int16_t twd300[472]__attribute__((aligned(32))) = {32652,-2741,32652,-2741,32652,-2741,32652,-2741, 32308,-5464,32308,-5464,32308,-5464,32308,-5464, 31737,-8148,31737,-8148,31737,-8148,31737,-8148, 30944,-10775,30944,-10775,30944,-10775,30944,-10775, @@ -16097,8 +18407,7 @@ int main(int argc, char**argv) time_stats_t ts; - simd_q15_t x[2048],y[2048],tw0,tw1,tw2,tw3; - + simd256_q15_t x[2048],y[2048],tw0,tw1,tw2,tw3; int i; @@ -16426,10 +18735,10 @@ int main(int argc, char**argv) for (i=0;i<4;i++) printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&y[i])[0],((int16_t *)&y[i])[1],((int16_t*)&y[i])[2],((int16_t *)&y[i])[3],((int16_t*)&y[i])[4],((int16_t *)&y[i])[5],((int16_t*)&y[i])[6],((int16_t *)&y[i])[7]); printf("\n"); - */ - memset((void*)&x[0],0,64*4); -/* - for (i=0; i<64; i+=4) { + */ + memset((void*)&x[0],0,2048*4); + + for (i=0; i<2048; i+=4) { ((int16_t*)x)[i<<1] = 1024; ((int16_t*)x)[1+(i<<1)] = 0; ((int16_t*)x)[2+(i<<1)] = 0; @@ -16438,25 +18747,35 @@ int main(int argc, char**argv) ((int16_t*)x)[5+(i<<1)] = 0; ((int16_t*)x)[6+(i<<1)] = 0; ((int16_t*)x)[7+(i<<1)] = -1024; - } -*/ - for (i=0;i<64;i++) { - ((int16_t*)x)[i] = (int16_t)((taus()&0xffff))>>5; - } + } + /* + for (i=0; i<2048; i+=2) { + ((int16_t*)x)[i<<1] = 1024; + ((int16_t*)x)[1+(i<<1)] = 0; + ((int16_t*)x)[2+(i<<1)] = -1024; + ((int16_t*)x)[3+(i<<1)] = 0; + }*/ + /* + for (i=0;i<128;i++) { + ((int16_t*)x)[i] = i/2;//(int16_t)((taus()&0xffff))>>5; + }*/ + /* memset((void*)&y[0],0,64*4); -/* - dft16((int16_t *)x,(int16_t *)y); - printf("16-point\n"); + dft64_simd256((int16_t *)x,(int16_t *)y,1); + + + printf("64-point\n"); printf("X: "); for (i=0;i<4;i++) - printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&x[i])[0],((int16_t *)&x[i])[1],((int16_t*)&x[i])[2],((int16_t *)&x[i])[3],((int16_t*)&x[i])[4],((int16_t*)&x[i])[5],((int16_t*)&x[i])[6],((int16_t*)&x[i])[7]); + print_shorts256("",((int16_t *)x)+(i*16)); + printf("\nY:"); for (i=0;i<4;i++) - printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&y[i])[0],((int16_t *)&y[i])[1],((int16_t*)&y[i])[2],((int16_t *)&y[i])[3],((int16_t*)&y[i])[4],((int16_t *)&y[i])[5],((int16_t*)&y[i])[6],((int16_t *)&y[i])[7]); + print_shorts256("",((int16_t *)y)+(i*16)); printf("\n"); - exit(-1); -*/ + + dft64((int16_t *)x,(int16_t *)y,1); dft64((int16_t *)x,(int16_t *)y,1); dft64((int16_t *)x,(int16_t *)y,1); @@ -16470,8 +18789,27 @@ int main(int argc, char**argv) } printf("\n\n64-point (%f cycles, #trials %d)\n",(double)ts.diff/(double)ts.trials,ts.trials); - write_output("x64.m","x64",x,64,1,1); - write_output("y64.m","y64",y,64,1,1); + // write_output("x64.m","x64",x,64,1,1); + // write_output("y64.m","y64",y,64,1,1); + +#ifdef __AVX2__ + dft64_simd256((int16_t *)x,(int16_t *)y,1); + dft64_simd256((int16_t *)x,(int16_t *)y,1); + dft64_simd256((int16_t *)x,(int16_t *)y,1); + reset_meas(&ts); + + for (i=0; i<10000000; i++) { + start_meas(&ts); + dft64_simd256((int16_t *)x,(int16_t *)y,1); + stop_meas(&ts); + } + + printf("\n\n64-point AVX2 (%f cycles, #trials %d)\n",(double)ts.diff/(double)ts.trials,ts.trials); + write_output("x64_256.m","x64_256",x,64,1,1); + write_output("y64_256.m","y64_256",y,64,1,1); + +#endif + */ /* printf("X: "); @@ -16498,12 +18836,27 @@ int main(int argc, char**argv) for (i=0; i<10000; i++) { start_meas(&ts); - dft128((int16_t *)x,(int16_t *)y,0); + dft128((int16_t *)x,(int16_t *)y,1); stop_meas(&ts); } printf("\n\n128-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); +#ifdef __AVX2__ + memset((void*)&y[0],0,128*4); + reset_meas(&ts); + + for (i=0; i<10000; i++) { + start_meas(&ts); + dft128_simd256((int16_t *)x,(int16_t *)y,1); + stop_meas(&ts); + } + + printf("\n\n128-point AVX2 (%f cycles)\n",(double)ts.diff/(double)ts.trials); + write_output("x128_256.m","x128_256",x,128,1,1); + write_output("y128_256.m","y128_256",y,128,1,1); +#endif + /* printf("X: "); for (i=0;i<32;i++) printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&x[i])[0],((int16_t *)&x[i])[1],((int16_t*)&x[i])[2],((int16_t *)&x[i])[3],((int16_t*)&x[i])[4],((int16_t*)&x[i])[5],((int16_t*)&x[i])[6],((int16_t*)&x[i])[7]); @@ -16513,11 +18866,14 @@ int main(int argc, char**argv) printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&y[i])[0],((int16_t *)&y[i])[1],((int16_t*)&y[i])[2],((int16_t *)&y[i])[3],((int16_t*)&y[i])[4],((int16_t *)&y[i])[5],((int16_t*)&y[i])[6],((int16_t *)&y[i])[7]); printf("\n"); */ + + /* for (i=0; i<512; i++) { ((int16_t*)x)[i] = (int16_t)((taus()&0xffff))>>5; } - + memset((void*)&y[0],0,256*4); + */ reset_meas(&ts); for (i=0; i<10000; i++) { @@ -16528,8 +18884,20 @@ int main(int argc, char**argv) printf("\n\n256-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); +#ifdef __AVX2__ reset_meas(&ts); + for (i=0; i<10000; i++) { + start_meas(&ts); + dft256_simd256((int16_t *)x,(int16_t *)y,1); + stop_meas(&ts); + } + + printf("\n\n256-point AVX2 (%f cycles)\n",(double)ts.diff/(double)ts.trials); + +#endif + + reset_meas(&ts); for (i=0; i<10000; i++) { start_meas(&ts); dft512((int16_t *)x,(int16_t *)y,1); @@ -16538,8 +18906,19 @@ int main(int argc, char**argv) printf("\n\n512-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); - write_output("x.m","x",x,512,1,1); - write_output("y.m","y",y,512,1,1); +#ifdef __AVX2__ + reset_meas(&ts); + for (i=0; i<10000; i++) { + start_meas(&ts); + dft512_simd256((int16_t *)x,(int16_t *)y,1); + stop_meas(&ts); + } + + printf("\n\n512-point AVX2 (%f cycles)\n",(double)ts.diff/(double)ts.trials); + +#endif + // write_output("x.m","x",x,512,1,1); + // write_output("y.m","y",y,512,1,1); /* printf("X: "); @@ -16562,6 +18941,18 @@ int main(int argc, char**argv) printf("\n\n1024-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); +#ifdef __AVX2__ + reset_meas(&ts); + + for (i=0; i<10000; i++) { + start_meas(&ts); + dft1024_simd256((int16_t *)x,(int16_t *)y,1); + stop_meas(&ts); + } + + printf("\n\n1024-point - AVX2 (%f cycles)\n",(double)ts.diff/(double)ts.trials); +#endif + reset_meas(&ts); for (i=0; i<10000; i++) { @@ -16571,6 +18962,20 @@ int main(int argc, char**argv) } printf("\n\n2048-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); + +#ifdef __AVX2__ + + reset_meas(&ts); + + for (i=0; i<10000; i++) { + start_meas(&ts); + dft2048_simd256((int16_t *)x,(int16_t *)y,1); + stop_meas(&ts); + } + + printf("\n\n2048-point AVX2 (%f cycles)\n",(double)ts.diff/(double)ts.trials); + +#endif return(0); } From 610e07a96cfc87aa190df76757e81cf6441106ba Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 1 Dec 2015 16:55:41 +0100 Subject: [PATCH 016/214] For backup only, dont compile, TODO missing patch for asn1c compiler --- cmake_targets/CMakeLists.txt | 2 + openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py | 146 +++++++++- openair3/TEST/EPC_TEST/play_scenario.c | 4 + openair3/TEST/EPC_TEST/play_scenario.h | 11 + openair3/TEST/EPC_TEST/play_scenario_fsm.c | 11 +- openair3/TEST/EPC_TEST/play_scenario_parse.c | 4 +- openair3/TEST/EPC_TEST/play_scenario_s1ap.c | 83 +++++- .../EPC_TEST/play_scenario_s1ap_compare_ie.c | 273 ++++++++++++++++++ openair3/TEST/EPC_TEST/play_scenario_sctp.c | 45 +++ 9 files changed, 570 insertions(+), 9 deletions(-) create mode 100644 openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index bcf90bdb83..9c5bbad0de 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -337,6 +337,7 @@ set(S1AP_OAI_generated ${S1AP_C_DIR}/s1ap_decoder.c ${S1AP_C_DIR}/s1ap_encoder.c ${S1AP_C_DIR}/s1ap_xer_print.c + ${S1AP_C_DIR}/s1ap_compare.c ${S1AP_C_DIR}/s1ap_ies_defs.h ) file(GLOB s1ap_h ${S1AP_C_DIR}/*.h) @@ -1667,6 +1668,7 @@ add_executable(test_epc_play_scenario ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_fsm.c ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_parse.c ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap.c + ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_sctp.c ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.h diff --git a/openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py b/openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py index c298e8ae87..f5daf03c25 100644 --- a/openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py +++ b/openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py @@ -250,20 +250,31 @@ for key in iesDefs: asn1cStruct = re.sub('Item', 'List', asn1cStruct) keylowerunderscore = re.sub('-', '_', key.lower()) firstlower = re.sub('Item', 'List', re.sub('enb', 'eNB', lowerFirstCamelWord(asn1cStruct))) + + f.write("/* %s in iesDefs not in ieofielist.values() */\n" % (key)) f.write("/** \\brief Decode function for %s ies.\n" % (key)) if len(iesDefs[key]["ies"]) != 0: f.write(" * \\param %s Pointer to ASN1 structure in which data will be stored\n" % (lowerFirstCamelWord(re.sub('-', '_', key)))) f.write(" * \\param any_p Pointer to the ANY value to decode.\n") f.write(" **/\n") f.write("int %s_decode_%s(\n" % (fileprefix, keylowerunderscore)) - if len(iesDefs[key]["ies"]) != 0: f.write(" %s_t *%s,\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key)))) f.write(" ANY_t *any_p);\n\n") + f.write("/* %s in iesDefs not in ieofielist.values() */\n" % (key)) + f.write("/** \\brief Compare function for %s ies.\n" % (key)) + f.write(" * \\param %s Pointer to the ASN1 structure.\n" % (firstlower)) + f.write(" * \\param %s Pointer to the ASN1 structure.\n" % (firstlower)) + f.write(" **/\n") + f.write("long %s_compare_%s(\n" % (fileprefix, keylowerunderscore)) + f.write(" %s_t *%s1,\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key)))) + f.write(" %s_t *%s2);\n\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key)))) + if len(iesDefs[key]["ies"]) == 0: continue + f.write("/* %s in iesDefs not in ieofielist.values() */\n" % (key)) f.write("/** \\brief Encode function for %s ies.\n" % (key)) f.write(" * \\param %s Pointer to the ASN1 structure.\n" % (firstlower)) f.write(" * \\param %s Pointer to the IES structure.\n" % (lowerFirstCamelWord(re.sub('-', '_', key)))) @@ -272,16 +283,19 @@ for key in iesDefs: f.write(" %s_t *%s,\n" % (asn1cStruct, firstlower)) f.write(" %s_t *%s);\n\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key)))) + for key in iesDefs: if key not in ieofielist.values(): continue asn1cStruct = re.sub('-', '_', re.sub('IEs', '', key)) asn1cStruct = re.sub('Item', 'List', asn1cStruct) firstlower = re.sub('Item', 'List', re.sub('enb', 'eNB', lowerFirstCamelWord(asn1cStruct))) + f.write("/* %s in iesDefs in ieofielist.values() */\n" % (key)) f.write("/** \\brief Encode function for %s ies.\n" % (key)) f.write(" * \\param %s Pointer to the ASN1 structure.\n" % (firstlower)) f.write(" * \\param %s Pointer to the IES structure.\n" % (lowerFirstCamelWord(re.sub('-', '_', key)))) f.write(" **/\n") + f.write("/* %s in iesDefs in ieofielist.values() */\n" % (key)) f.write("int %s_encode_%s(\n" % (fileprefix, firstlower.lower())) f.write(" %s_t *%s,\n" % (asn1cStruct, firstlower)) f.write(" %sIEs_t *%sIEs);\n\n" % (asn1cStruct, firstlower)) @@ -289,9 +303,19 @@ for key in iesDefs: f.write(" * \\param any_p Pointer to the ANY value to decode.\n") f.write(" * \\param callback Callback function called when any_p is successfully decoded.\n") f.write(" **/\n") + f.write("/* %s in iesDefs in ieofielist.values() */\n" % (key)) f.write("int %s_decode_%s(\n" % (fileprefix, firstlower.lower())) f.write(" %sIEs_t *%sIEs,\n" % (asn1cStruct, firstlower)) f.write(" %s_t *%s);\n\n" % (asn1cStruct, lowerFirstCamelWord(asn1cStruct))) + f.write("/** \\brief Compare function for %s ies.\n" % (key)) + f.write(" * \\param %s Pointer to the IES structure.\n" % (firstlower)) + f.write(" * \\param %s Pointer to the IES structure.\n" % (firstlower)) + f.write(" **/\n") + f.write("long %s_compare_%s(\n" % (fileprefix, firstlower.lower())) + f.write(" %sIEs_t *%s1,\n" % (asn1cStruct, firstlower)) + f.write(" %sIEs_t *%s2);\n\n" % (asn1cStruct, firstlower)) + + for key in iesDefs: asn1cStruct = re.sub('-', '_', re.sub('IEs', '', key)) @@ -704,3 +728,123 @@ for (key, value) in iesDefs.items(): #f.write("cb_failed:\n") #f.write(" return er;\n") f.write("}\n\n") + + +#Generate xer print functions +f = open(outdir + fileprefix + '_compare.c', 'w') +outputHeaderToFile(f, filename) +f.write("#include \n") +f.write("#include \n\n") +f.write("#include \n#include \n\n") +f.write("#include \"%s_common.h\"\n#include \"%s_ies_defs.h\"\n" % (fileprefix, fileprefix)) +f.write("#include \"%s-ProtocolIE-ID.h\"\n\n" % (fileprefix_first_upper)) + + +for key in iesDefs: + if key in ieofielist.values(): + continue + structName = re.sub('ies', '', key) + asn1cStruct = re.sub('-', '_', re.sub('IEs', '', key)) + asn1cStruct = re.sub('Item', 'List', asn1cStruct) + if asn1cStruct.rfind('_') == len(asn1cStruct) - 1: + asn1cStruct = asn1cStruct[:-1] + asn1cStructfirstlower = asn1cStruct[:1].lower() + asn1cStruct[1:] + firstwordlower = re.sub('Item', 'List', re.sub('enb', 'eNB', lowerFirstCamelWord(asn1cStruct))) + + iesaccess = "" + if key not in ieofielist.values(): + iesaccess = "%s_ies." % (firstwordlower) + + keyName = re.sub('-', '_', key) + keyupperunderscore = keyName.upper() + # No IE to encode... + if len(iesDefs[key]["ies"]) == 0: + continue + + f.write("long %s_compare_%s(\n" % (fileprefix, re.sub('-', '_', structName.lower()))) + f.write(" %s_t *%s1,\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key)))) + f.write(" %s_t *%s2) {\n\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key)))) + + f.write(" long rv = 0;\n\n") + + f.write(" assert(%s1 != NULL);\n" % (lowerFirstCamelWord(re.sub('-', '_', key)))); + f.write(" assert(%s2 != NULL);\n" % (lowerFirstCamelWord(re.sub('-', '_', key)))); + + loop = 0 + for ie in iesDefs[key]["ies"]: + iename = re.sub('-', '_', re.sub('id-', '', ie[0])) + ienameunderscore = re.sub('-', '_', iename) + ienamefirstwordlower = lowerFirstCamelWord(iename) + ieupperunderscore = re.sub('-', '_', re.sub('id-', '', ie[0])).upper() + ietypeunderscore = re.sub('-', '_', ie[2]) + + if ie[3] != "mandatory": + + loop = loop + 1 + if loop == 1: + #f.write(" %s_IE_t *ie1 = NULL;\n" % (fileprefix_first_upper)) + #f.write(" %s_IE_t *ie2 = NULL;\n" % (fileprefix_first_upper)) + f.write(" if (%s1->presenceMask != %s2->presenceMask) return -1;\n" % (lowerFirstCamelWord(re.sub('-', '_', key)), lowerFirstCamelWord(re.sub('-', '_', key)))) + + if ie[3] == "optional": + f.write(" /* Optional field */\n") + elif ie[3] == "conditional": + f.write(" /* Conditional field */\n") + f.write(" if (%s1->presenceMask & %s_%s_PRESENT) {\n" % (lowerFirstCamelWord(re.sub('-', '_', key)), keyupperunderscore, ieupperunderscore)) + + + if ie[2] in ieofielist.keys(): + f.write(" /* collection field */\n") + f.write(" rv = %s_compare_%s(&%s1->%s, &%s2->%s);\n" % (fileprefix, ietypeunderscore.lower(), lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower )) + f.write(" if (rv != 0) {rv = rv << 8; rv |= %s_ProtocolIE_ID_id_%s; return rv;}\n" % (fileprefix_first_upper, ienameunderscore)) + else: + f.write(" /* simple field */\n") + f.write(" rv = asn_DEF_%s.compare(&asn_DEF_%s, &%s1->%s, &asn_DEF_%s, &%s2->%s); \n" % (ietypeunderscore, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower )) + f.write(" if (rv != 0) {rv = rv << 8; rv |= %s_ProtocolIE_ID_id_%s; return rv;}\n" % (fileprefix_first_upper, ienameunderscore)) + f.write(" assert(0);\n"); + f.write(" }\n\n") + + else: + if ie[2] in ieofielist.keys(): + f.write(" /* Mandatory collection field */\n") + f.write(" rv = %s_compare_%s(&%s1->%s, &%s2->%s);\n" % (fileprefix, ietypeunderscore.lower(), lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower )) + f.write(" if (rv != 0) {rv = rv << 8; rv |= %s_ProtocolIE_ID_id_%s; return rv;}\n" % (fileprefix_first_upper, ienameunderscore)) + else: + f.write(" /* Mandatory simple field */\n") + f.write(" rv = asn_DEF_%s.compare(&asn_DEF_%s, &%s1->%s, &asn_DEF_%s, &%s2->%s);\n" % (ietypeunderscore, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower )) + f.write(" if (rv != 0) {rv = rv << 8; rv |= %s_ProtocolIE_ID_id_%s; return rv;}\n" % (fileprefix_first_upper, ienameunderscore)) + f.write(" return 0;\n") + f.write("}\n\n") + +for (key, value) in iesDefs.items(): + if key not in ieofielist.values(): + continue + + ie = value["ies"][0] + ietypeunderscore = re.sub('-', '_', ie[2]) + asn1cStruct = re.sub('-', '_', re.sub('IEs', '', re.sub('-IEs', '', key))) + asn1cStruct = re.sub('Item', 'List', asn1cStruct) + firstwordlower = re.sub('Item', 'List', re.sub('enb', 'eNB', lowerFirstCamelWord(asn1cStruct))) + + for (i, j) in ieofielist.items(): + if j == key: + break + + f.write("extern asn_TYPE_descriptor_t asn_DEF_%s;\n" % (ietypeunderscore)) + + f.write("long %s_compare_%s(\n" % (fileprefix, re.sub('-', '_', i).lower())) + f.write(" %sIEs_t *%sIEs1,\n" % (re.sub('-', '_', i), lowerFirstCamelWord(re.sub('-', '_', i)))) + f.write(" %sIEs_t *%sIEs2) {\n\n" % (re.sub('-', '_', i), lowerFirstCamelWord(re.sub('-', '_', i)))) + f.write(" int i;\n") + f.write(" long rv = 0;\n") + + f.write(" assert(%sIEs1 != NULL);\n" % (lowerFirstCamelWord(re.sub('-', '_', i)))); + f.write(" assert(%sIEs2 != NULL);\n\n" % (lowerFirstCamelWord(re.sub('-', '_', i)))); + + f.write(" for (i = 0; i < %sIEs1->%s.count; i++) {\n" % (lowerFirstCamelWord(re.sub('-', '_', i)), re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key))))) + f.write(" rv = asn_DEF_%s.compare(&asn_DEF_%s, %sIEs1->%s.array[i], &asn_DEF_%s, %sIEs2->%s.array[i]);\n" % (ietypeunderscore, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', i)), re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key))), ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', i)), re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key))))) + f.write(" if (rv != 0) return rv;\n") + f.write(" }\n") + f.write(" return 0;\n") + f.write("}\n\n") + diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index f8f334dd9c..216e098a01 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -318,15 +318,19 @@ int et_compare_et_ip_to_net_ip_address(const et_ip_t * const ip, const net_ip_ad S1AP_DEBUG("%s(%s,%s)=%d\n",__FUNCTION__,ip->str, net_ip->ipv4_address, strcmp(ip->str, net_ip->ipv4_address)); return strcmp(ip->str, net_ip->ipv4_address); } + S1AP_DEBUG("%s(%s,%s)=-1 (IP version (4) not matching)\n",__FUNCTION__,ip->str, net_ip->ipv4_address); return -1; break; case AF_INET6: if (net_ip->ipv6) { + S1AP_DEBUG("%s(%s,%s)=%d\n",__FUNCTION__,ip->str, net_ip->ipv4_address, strcmp(ip->str, net_ip->ipv6_address)); return strcmp(ip->str, net_ip->ipv6_address); } + S1AP_DEBUG("%s(%s,%s)=-1 (IP version (6) not matching)\n",__FUNCTION__,ip->str, net_ip->ipv6_address); return -1; break; default: + S1AP_DEBUG("%s(%s,...)=-1 (unknown IP version)\n",__FUNCTION__,ip->str); return -1; } } diff --git a/openair3/TEST/EPC_TEST/play_scenario.h b/openair3/TEST/EPC_TEST/play_scenario.h index 060c77b8ee..3c8c5faef8 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.h +++ b/openair3/TEST/EPC_TEST/play_scenario.h @@ -47,6 +47,10 @@ #include "play_scenario_s1ap_eNB_defs.h" #include "hashtable.h" +// powers of 2 +#define ET_BIT_MASK_MATCH_SCTP_STREAM 1 +#define ET_BIT_MASK_MATCH_SCTP_SSN 2 +//#define ET_BIT_MASK_MATCH_S1AP_ 2 #define MAX_ENB 16 @@ -396,6 +400,8 @@ void et_s1ap_eNB_insert_new_instance(s1ap_eNB_instance_t *new_instance_p); struct s1ap_eNB_mme_data_s *et_s1ap_eNB_get_MME(s1ap_eNB_instance_t *instance_p,int32_t assoc_id, uint16_t cnx_id); s1ap_eNB_instance_t *et_s1ap_eNB_get_instance(instance_t instance); void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,uint32_t buffer_length, uint16_t stream); +int et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints); +et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const s1ap_data_ind); void et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const sctp_data_ind); void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t * const sctp_data_ind); void et_s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, @@ -428,6 +434,11 @@ void et_parse_sctp(xmlDocPtr doc, const xmlNode const *sctp_node, et_sctp_hdr_t et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node); et_scenario_t* et_generate_scenario(const char * const et_scenario_filename ); //------------------------- +int et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, s1ap_message * const m2, const uint32_t constraints); +//------------------------- +int et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * const sctp2, const uint32_t constraints); +int et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t * const sctp2, const uint32_t constraints); +//------------------------------------------------------------------------------ void et_print_hex_octets(const unsigned char * const byte_stream, const unsigned long int num); int et_is_file_exists ( const char const * file_nameP, const char const *file_roleP); int et_strip_extension( char *in_filename); diff --git a/openair3/TEST/EPC_TEST/play_scenario_fsm.c b/openair3/TEST/EPC_TEST/play_scenario_fsm.c index 18dba384b0..23ef72035c 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_fsm.c +++ b/openair3/TEST/EPC_TEST/play_scenario_fsm.c @@ -50,6 +50,7 @@ et_scenario_t *g_scenario = NULL; pthread_mutex_t g_fsm_lock = PTHREAD_MUTEX_INITIALIZER; et_fsm_state_t g_fsm_state = ET_FSM_STATE_NULL; +uint32_t g_constraints = ET_BIT_MASK_MATCH_SCTP_STREAM | ET_BIT_MASK_MATCH_SCTP_SSN; //------------------------------------------------------------------------------ int timeval_subtract (struct timeval * const result, struct timeval * const a, struct timeval * const b) { @@ -123,6 +124,9 @@ void et_scenario_schedule_tx_packet(et_packet_t * const packet) } if (we_are_too_early > 0) { // set timer + LOG_D(ENB_APP, "Send packet num %u original frame number %u in %ld.%d sec\n", + packet->packet_number, packet->original_frame_number, offset.tv_sec, offset.tv_usec); + packet->status = ET_PACKET_STATUS_SCHEDULED_FOR_SENDING; if (timer_setup (offset.tv_sec, offset.tv_usec, TASK_S1AP, INSTANCE_DEFAULT, TIMER_ONE_SHOT, NULL, &packet->timer_id) < 0) { @@ -130,7 +134,9 @@ void et_scenario_schedule_tx_packet(et_packet_t * const packet) } // Done g_fsm_state = ET_FSM_STATE_WAITING_TX_EVENT; } else { + LOG_D(ENB_APP, "Send packet num %u original frame number %u immediately\n", packet->packet_number, packet->original_frame_number); // send immediately + AssertFatal(0 == gettimeofday(&packet->timestamp_packet, NULL), "gettimeofday() Failed"); et_s1ap_eNB_itti_send_sctp_data_req( packet->enb_instance, packet->sctp_hdr.u.data_hdr.assoc_id, @@ -161,7 +167,7 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event) AssertFatal(0, "Event ET_EVENT_TX_TIMED_PACKET not handled in FSM state ET_FSM_STATE_RUNNING"); break; case ET_EVENT_RX_S1AP: - AssertFatal(0, "TODO"); + et_s1ap_process_rx_packet(&event.u.s1ap_data_ind); break; default: AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_RUNNING", event.code); @@ -185,6 +191,7 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_waiting(et_event_t event) break; case ET_EVENT_TX_TIMED_PACKET: // send immediately + AssertFatal(0 == gettimeofday(&event.u.tx_timed_packet->timestamp_packet, NULL), "gettimeofday() Failed"); et_s1ap_eNB_itti_send_sctp_data_req( event.u.tx_timed_packet->enb_instance, event.u.tx_timed_packet->sctp_hdr.u.data_hdr.assoc_id, @@ -290,7 +297,7 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event) switch (g_scenario->next_packet->sctp_hdr.chunk_type) { case SCTP_CID_DATA : - // no init in this scenario, may be sub-scenario + // no init in this scenario, may be sub-scenario, ... if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) { et_scenario_schedule_tx_packet(g_scenario->next_packet); pthread_mutex_unlock(&g_fsm_lock); diff --git a/openair3/TEST/EPC_TEST/play_scenario_parse.c b/openair3/TEST/EPC_TEST/play_scenario_parse.c index 13c4746a5e..cb302f229a 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_parse.c +++ b/openair3/TEST/EPC_TEST/play_scenario_parse.c @@ -518,7 +518,7 @@ int et_generate_xml_scenario( for (i = 0; i < g_enb_properties.number; i++) { // eNB S1-C IPv4 address - sprintf(astring, "enb_s1c%d", i); + sprintf(astring, "enb%d_s1c", i); params[nb_params++] = strdup(astring); addr.s_addr = g_enb_properties.properties[i]->enb_ipv4_address_for_S1_MME; sprintf(astring, "\"%s\"", inet_ntoa(addr)); @@ -526,7 +526,7 @@ int et_generate_xml_scenario( // MME S1-C IPv4 address for (j = 0; j < g_enb_properties.properties[i]->nb_mme; j++) { - sprintf(astring, "mme_s1c%d_%d", i, j); + sprintf(astring, "mme%d_s1c_%d", i, j); params[nb_params++] = strdup(astring); AssertFatal (g_enb_properties.properties[i]->mme_ip_address[j].ipv4_address, "Only support MME IPv4 address\n"); diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c index d11d032b43..408ff72a4a 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c @@ -40,6 +40,7 @@ #include #include #include +#include #include "tree.h" #include "queue.h" @@ -58,6 +59,7 @@ s1ap_eNB_internal_data_t s1ap_eNB_internal_data; RB_GENERATE(s1ap_mme_map, s1ap_eNB_mme_data_s, entry, et_s1ap_eNB_compare_assoc_id); //------------------------------------------------------------------------------ extern et_scenario_t *g_scenario; +extern uint32_t g_constraints; //------------------------------------------------------------------------------ int et_s1ap_eNB_compare_assoc_id( struct s1ap_eNB_mme_data_s *p1, struct s1ap_eNB_mme_data_s *p2) @@ -187,20 +189,86 @@ void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, itti_send_msg_to_task(TASK_SCTP, instance, message_p); } //------------------------------------------------------------------------------ -void et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const sctp_data_ind) +int et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints) +{ + if (s1ap1->pdu.present != s1ap2->pdu.present) return -6; + switch (s1ap1->pdu.present) { + case S1AP_PDU_PR_NOTHING: + break; + case S1AP_PDU_PR_initiatingMessage: + if (s1ap1->pdu.choice.initiatingMessage.procedureCode != s1ap2->pdu.choice.initiatingMessage.procedureCode) return -7; + if (s1ap1->pdu.choice.initiatingMessage.criticality != s1ap2->pdu.choice.initiatingMessage.criticality) return -8; + break; + case S1AP_PDU_PR_successfulOutcome: + if (s1ap1->pdu.choice.successfulOutcome.procedureCode != s1ap2->pdu.choice.successfulOutcome.procedureCode) return -7; + if (s1ap1->pdu.choice.successfulOutcome.criticality != s1ap2->pdu.choice.successfulOutcome.criticality) return -8; + break; + case S1AP_PDU_PR_unsuccessfulOutcome: + if (s1ap1->pdu.choice.unsuccessfulOutcome.procedureCode != s1ap2->pdu.choice.unsuccessfulOutcome.procedureCode) return -7; + if (s1ap1->pdu.choice.unsuccessfulOutcome.criticality != s1ap2->pdu.choice.unsuccessfulOutcome.criticality) return -8; + break; + default: + AssertFatal(0, "Unknown pdu.present %d", s1ap1->pdu.present); + } + + if (s1ap1->binary_stream_allocated_size == s1ap2->binary_stream_allocated_size) { + if (memcmp((void*)s1ap1->binary_stream, (void*)s1ap2->binary_stream, s1ap1->binary_stream_allocated_size) == 0) return 0; + } + // if no matching, may be the scenario need minor corrections (same enb_ue_s1ap_id but need to update mme_ue_s1ap_id) + return et_s1ap_ies_is_matching(s1ap1->pdu.present, &s1ap1->message, &s1ap2->message, constraints); +} + +//------------------------------------------------------------------------------ +et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const s1ap_data_ind) { et_packet_t * packet = NULL; + AssertFatal (NULL != s1ap_data_ind, "Bad parameter sctp_data_ind\n"); + packet = calloc(1, sizeof(*packet)); + packet->action = ET_PACKET_ACTION_S1C_NULL; + //packet->time_relative_to_first_packet.tv_sec = 0; + //packet->time_relative_to_first_packet.tv_usec = 0; + //packet->time_relative_to_last_sent_packet.tv_sec = 0; + //packet->time_relative_to_last_sent_packet.tv_usec = 0; + //packet->time_relative_to_last_received_packet.tv_sec = 0; + //packet->time_relative_to_last_received_packet.tv_usec = 0; + //packet->original_frame_number = 0; + //packet->packet_number = 0; + packet->enb_instance = 0; //TODO + //packet->ip_hdr; + // keep in mind: allocated buffer: sctp_datahdr.payload.binary_stream + memcpy((void*)&packet->sctp_hdr, (void*)&s1ap_data_ind->sctp_datahdr, sizeof(packet->sctp_hdr)); + //packet->next = NULL; + packet->status = ET_PACKET_STATUS_RECEIVED; + //packet->timer_id = 0; + AssertFatal(0 == gettimeofday(&packet->timestamp_packet, NULL), "gettimeofday() Failed"); + return packet; +} + + +//------------------------------------------------------------------------------ +void et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) +{ + et_packet_t * packet = NULL; + et_packet_t * rx_packet = NULL; unsigned long int not_found = 1; + AssertFatal (NULL != s1ap_data_ind, "Bad parameter sctp_data_ind\n"); + rx_packet = et_build_packet_from_s1ap_data_ind(s1ap_data_ind); + packet = g_scenario->next_packet; // not_found threshold may sure depend on number of mme, may be not sure on number of UE while ((NULL != packet) && (not_found < 5)) { if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { //TODO + if (et_sctp_is_matching(&packet->sctp_hdr, &rx_packet->sctp_hdr, g_constraints) == 0) { + et_scenario_set_packet_received(packet); + } } not_found += 1; packet = packet->next; } + S1AP_DEBUG("Rx packet not found in scenario:\n"); + et_display_packet_sctp(&rx_packet->sctp_hdr); } //------------------------------------------------------------------------------ @@ -234,7 +302,7 @@ void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t * const sctp_data_ind) &event.u.s1ap_data_ind.sctp_datahdr.payload.message, event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream, event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream_allocated_size) < 0) { - AssertFatal (0, "ERROR %s() Cannot decode RX S1AP message!\n", __FUNCTION__); + AssertFatal (0, "ERROR Cannot decode RX S1AP message!\n"); } } @@ -319,6 +387,7 @@ void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id, switch (packet->sctp_hdr.chunk_type) { case SCTP_CID_DATA : + S1AP_DEBUG("%s for SCTP association (%u) SCTP_CID_DATA\n",__FUNCTION__,assoc_id); if (ET_PACKET_STATUS_NONE == packet->status) { if (0 < old_mme_port) { if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) { @@ -355,6 +424,7 @@ void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id, // Strong assumption // in replayed scenario, the order of SCTP INIT packets is supposed to be the same as in the catched scenario case SCTP_CID_INIT: + S1AP_DEBUG("%s for SCTP association (%u) SCTP_CID_INIT\n",__FUNCTION__,assoc_id); ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &mme_desc_p->mme_net_ip_address); if (0 == ret) { ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &s1ap_eNB_instance->s1c_net_ip_address); @@ -363,6 +433,7 @@ void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id, if (ET_PACKET_STATUS_NONE == packet->status) { packet->status = ET_PACKET_STATUS_SENT; old_enb_port = packet->sctp_hdr.src_port; + S1AP_DEBUG("%s for SCTP association (%u) SCTP_CID_INIT SUCCESS\n",__FUNCTION__,assoc_id); } } } @@ -370,14 +441,16 @@ void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id, break; case SCTP_CID_INIT_ACK: - ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &mme_desc_p->mme_net_ip_address); + S1AP_DEBUG("%s for SCTP association (%u) SCTP_CID_INIT_ACK\n",__FUNCTION__,assoc_id); + ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &mme_desc_p->mme_net_ip_address); if (0 == ret) { - ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &s1ap_eNB_instance->s1c_net_ip_address); + ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &s1ap_eNB_instance->s1c_net_ip_address); if (0 == ret) { if (old_enb_port == packet->sctp_hdr.dst_port) { if (ET_PACKET_STATUS_NONE == packet->status) { packet->status = ET_PACKET_STATUS_RECEIVED; old_mme_port = packet->sctp_hdr.dst_port; + S1AP_DEBUG("%s for SCTP association (%u) SCTP_CID_INIT_ACK SUCCESS\n",__FUNCTION__,assoc_id); } } } @@ -475,6 +548,7 @@ void et_s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_ DevCheck(new_instance->mcc == s1ap_register_eNB->mcc, new_instance->mcc, s1ap_register_eNB->mcc, 0); DevCheck(new_instance->mnc == s1ap_register_eNB->mnc, new_instance->mnc, s1ap_register_eNB->mnc, 0); DevCheck(new_instance->mnc_digit_length == s1ap_register_eNB->mnc_digit_length, new_instance->mnc_digit_length, s1ap_register_eNB->mnc_digit_length, 0); + DevCheck(memcmp((void*)&new_instance->s1c_net_ip_address, (void*)&s1ap_register_eNB->enb_ip_address, sizeof(new_instance->s1c_net_ip_address)) == 0, 0,0,0); } else { new_instance = calloc(1, sizeof(s1ap_eNB_instance_t)); DevAssert(new_instance != NULL); @@ -491,6 +565,7 @@ void et_s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_ new_instance->mcc = s1ap_register_eNB->mcc; new_instance->mnc = s1ap_register_eNB->mnc; new_instance->mnc_digit_length = s1ap_register_eNB->mnc_digit_length; + memcpy((void*)&new_instance->s1c_net_ip_address, (void*)&s1ap_register_eNB->enb_ip_address, sizeof(new_instance->s1c_net_ip_address)); /* Add the new instance to the list of eNB (meaningfull in virtual mode) */ et_s1ap_eNB_insert_new_instance(new_instance); diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c new file mode 100644 index 0000000000..5ad5708bab --- /dev/null +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c @@ -0,0 +1,273 @@ +/******************************************************************************* + OpenAirInterface + Copyright(c) 1999 - 2014 Eurecom + + OpenAirInterface is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + + OpenAirInterface is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenAirInterface.The full GNU General Public License is + included in this distribution in the file called "COPYING". If not, + see . + + Contact Information + OpenAirInterface Admin: openair_admin@eurecom.fr + OpenAirInterface Tech : openair_tech@eurecom.fr + OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + + Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + + *******************************************************************************/ + +/* + play_scenario_s1ap_compare_ie.c + ------------------- + AUTHOR : Lionel GAUTHIER + COMPANY : EURECOM + EMAIL : Lionel.Gauthier@eurecom.fr + */ +#include +#include +#include +#include +#include +#include +#include "tree.h" +#include "queue.h" + + +#include "intertask_interface.h" +#include "timer.h" +#include "platform_types.h" +#include "assertions.h" +#include "conversions.h" +#include "s1ap_common.h" +#include "play_scenario_s1ap_eNB_defs.h" +#include "play_scenario.h" +#include "msc.h" +//------------------------------------------------------------------------------ +extern et_scenario_t *g_scenario; +extern uint32_t g_constraints; +//------------------------------------------------------------------------------ + +int et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, s1ap_message * const m2, const uint32_t constraints) +{ + long ret = 0; + AssertFatal(m1 != NULL, "bad parameter m1"); + AssertFatal(m2 != NULL, "bad parameter m2"); + if (m1->procedureCode != m2->procedureCode) return -1; + + + // some cases can never occur since uplink only. + switch (m1->procedureCode) { + case S1ap_ProcedureCode_id_HandoverPreparation: + AssertFatal(0, "S1ap_ProcedureCode_id_InitialContextSetup not implemented"); + break; + case S1ap_ProcedureCode_id_HandoverResourceAllocation: + AssertFatal(0, "S1ap_ProcedureCode_id_InitialContextSetup not implemented"); + break; + case S1ap_ProcedureCode_id_HandoverNotification: + AssertFatal(0, "S1ap_ProcedureCode_id_HandoverNotification not implemented"); + break; + case S1ap_ProcedureCode_id_PathSwitchRequest: + ret = s1ap_compare_s1ap_pathswitchrequesties( + &m1->msg.s1ap_PathSwitchRequestIEs, + &m2->msg.s1ap_PathSwitchRequestIEs); + break; + case S1ap_ProcedureCode_id_HandoverCancel: + ret = s1ap_compare_s1ap_handovercancelies( + &m1->msg.s1ap_HandoverCancelIEs, + &m2->msg.s1ap_HandoverCancelIEs); + break; + case S1ap_ProcedureCode_id_E_RABSetup: + case S1ap_ProcedureCode_id_E_RABModify: + case S1ap_ProcedureCode_id_E_RABRelease: + if (present == S1AP_PDU_PR_initiatingMessage) { + ret = s1ap_compare_s1ap_e_rabreleasecommandies( + &m1->msg.s1ap_E_RABReleaseCommandIEs, + &m2->msg.s1ap_E_RABReleaseCommandIEs); + } else if (present == S1AP_PDU_PR_successfulOutcome) { + ret = s1ap_compare_s1ap_e_rabreleaseresponseies( + &m1->msg.s1ap_E_RABReleaseResponseIEs, + &m2->msg.s1ap_E_RABReleaseResponseIEs); + } + break; + case S1ap_ProcedureCode_id_E_RABReleaseIndication: + ret = s1ap_compare_s1ap_e_rabreleaseindicationies( + &m1->msg.s1ap_E_RABReleaseIndicationIEs, + &m2->msg.s1ap_E_RABReleaseIndicationIEs); + break; + case S1ap_ProcedureCode_id_InitialContextSetup: + AssertFatal(0, "S1ap_ProcedureCode_id_InitialContextSetup not implemented"); + break; + case S1ap_ProcedureCode_id_Paging: + ret = s1ap_compare_s1ap_pagingies( + &m1->msg.s1ap_PagingIEs, + &m2->msg.s1ap_PagingIEs); + break; + case S1ap_ProcedureCode_id_downlinkNASTransport: + ret = s1ap_compare_s1ap_downlinknastransporties( + &m1->msg.s1ap_DownlinkNASTransportIEs, + &m2->msg.s1ap_DownlinkNASTransportIEs); + break; + case S1ap_ProcedureCode_id_initialUEMessage: + ret = s1ap_compare_s1ap_initialuemessageies( + &m1->msg.s1ap_InitialUEMessageIEs, + &m2->msg.s1ap_InitialUEMessageIEs); + break; + case S1ap_ProcedureCode_id_uplinkNASTransport: + ret = s1ap_compare_s1ap_uplinknastransporties( + &m1->msg.s1ap_UplinkNASTransportIEs, + &m2->msg.s1ap_UplinkNASTransportIEs); + break; + case S1ap_ProcedureCode_id_Reset: + ret = s1ap_compare_s1ap_reseties( + &m1->msg.s1ap_ResetIEs, + &m2->msg.s1ap_ResetIEs); + break; + case S1ap_ProcedureCode_id_ErrorIndication: + ret = s1ap_compare_s1ap_errorindicationies( + &m1->msg.s1ap_ErrorIndicationIEs, + &m2->msg.s1ap_ErrorIndicationIEs); + break; + case S1ap_ProcedureCode_id_NASNonDeliveryIndication: + ret = s1ap_compare_s1ap_nasnondeliveryindication_ies( + &m1->msg.s1ap_NASNonDeliveryIndication_IEs, + &m2->msg.s1ap_NASNonDeliveryIndication_IEs); + break; + case S1ap_ProcedureCode_id_S1Setup: + if (present == S1AP_PDU_PR_initiatingMessage) { + ret = s1ap_compare_s1ap_s1setuprequesties( + &m1->msg.s1ap_S1SetupRequestIEs, + &m2->msg.s1ap_S1SetupRequestIEs); + } else if (present == S1AP_PDU_PR_successfulOutcome) { + ret = s1ap_compare_s1ap_s1setupresponseies( + &m1->msg.s1ap_S1SetupResponseIEs, + &m2->msg.s1ap_S1SetupResponseIEs); + } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) { + ret = s1ap_compare_s1ap_s1setupfailureies( + &m1->msg.s1ap_S1SetupFailureIEs, + &m2->msg.s1ap_S1SetupFailureIEs); + } + break; + case S1ap_ProcedureCode_id_UEContextReleaseRequest: + ret = s1ap_compare_s1ap_uecontextreleaserequesties( + &m1->msg.s1ap_UEContextReleaseRequestIEs, + &m2->msg.s1ap_UEContextReleaseRequestIEs); + break; + case S1ap_ProcedureCode_id_DownlinkS1cdma2000tunneling: + ret = s1ap_compare_s1ap_downlinks1cdma2000tunnelingies( + &m1->msg.s1ap_DownlinkS1cdma2000tunnelingIEs, + &m2->msg.s1ap_DownlinkS1cdma2000tunnelingIEs); + break; + case S1ap_ProcedureCode_id_UplinkS1cdma2000tunneling: + ret = s1ap_compare_s1ap_uplinks1cdma2000tunnelingies( + &m1->msg.s1ap_UplinkS1cdma2000tunnelingIEs, + &m2->msg.s1ap_UplinkS1cdma2000tunnelingIEs); + break; + case S1ap_ProcedureCode_id_UEContextModification: + if (present == S1AP_PDU_PR_initiatingMessage) { + ret = s1ap_compare_s1ap_uecontextmodificationrequesties( + &m1->msg.s1ap_UEContextModificationRequestIEs, + &m2->msg.s1ap_UEContextModificationRequestIEs); + } else if (present == S1AP_PDU_PR_successfulOutcome) { + ret = s1ap_compare_s1ap_uecontextmodificationresponseies( + &m1->msg.s1ap_UEContextModificationResponseIEs, + &m2->msg.s1ap_UEContextModificationResponseIEs); + } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) { + ret = s1ap_compare_s1ap_uecontextmodificationfailureies( + &m1->msg.s1ap_UEContextModificationFailureIEs, + &m2->msg.s1ap_UEContextModificationFailureIEs); + } + break; + case S1ap_ProcedureCode_id_UECapabilityInfoIndication: + ret = s1ap_compare_s1ap_uecapabilityinfoindicationies( + &m1->msg.s1ap_UECapabilityInfoIndicationIEs, + &m2->msg.s1ap_UECapabilityInfoIndicationIEs); + break; + case S1ap_ProcedureCode_id_UEContextRelease: + + break; + case S1ap_ProcedureCode_id_eNBStatusTransfer: + ret = s1ap_compare_s1ap_enbstatustransferies( + &m1->msg.s1ap_ENBStatusTransferIEs, + &m2->msg.s1ap_ENBStatusTransferIEs); + break; + case S1ap_ProcedureCode_id_MMEStatusTransfer: + ret = s1ap_compare_s1ap_mmestatustransferies( + &m1->msg.s1ap_MMEStatusTransferIEs, + &m2->msg.s1ap_MMEStatusTransferIEs); + break; + case S1ap_ProcedureCode_id_DeactivateTrace: + ret = s1ap_compare_s1ap_deactivatetraceies( + &m1->msg.s1ap_DeactivateTraceIEs, + &m2->msg.s1ap_DeactivateTraceIEs); + break; + case S1ap_ProcedureCode_id_TraceStart: + ret = s1ap_compare_s1ap_tracestarties( + &m1->msg.s1ap_TraceStartIEs, + &m2->msg.s1ap_TraceStartIEs); + break; + case S1ap_ProcedureCode_id_TraceFailureIndication: + ret = s1ap_compare_s1ap_tracefailureindicationies( + &m1->msg.s1ap_TraceFailureIndicationIEs, + &m2->msg.s1ap_TraceFailureIndicationIEs); + break; + case S1ap_ProcedureCode_id_ENBConfigurationUpdate: + case S1ap_ProcedureCode_id_MMEConfigurationUpdate: + case S1ap_ProcedureCode_id_LocationReportingControl: + case S1ap_ProcedureCode_id_LocationReportingFailureIndication: + case S1ap_ProcedureCode_id_LocationReport: + case S1ap_ProcedureCode_id_OverloadStart: + case S1ap_ProcedureCode_id_OverloadStop: + case S1ap_ProcedureCode_id_WriteReplaceWarning: + case S1ap_ProcedureCode_id_eNBDirectInformationTransfer: + case S1ap_ProcedureCode_id_MMEDirectInformationTransfer: + case S1ap_ProcedureCode_id_PrivateMessage: + case S1ap_ProcedureCode_id_eNBConfigurationTransfer: + case S1ap_ProcedureCode_id_MMEConfigurationTransfer: + case S1ap_ProcedureCode_id_CellTrafficTrace: + case S1ap_ProcedureCode_id_Kill: + if (present == S1AP_PDU_PR_initiatingMessage) { + ret = s1ap_compare_s1ap_killrequesties( + &m1->msg.s1ap_KillRequestIEs, + &m2->msg.s1ap_KillRequestIEs); + } else { + ret = s1ap_compare_s1ap_killresponseies( + &m1->msg.s1ap_KillResponseIEs, + &m2->msg.s1ap_KillResponseIEs); + } + break; + case S1ap_ProcedureCode_id_downlinkUEAssociatedLPPaTransport: + ret = s1ap_compare_s1ap_downlinkueassociatedlppatransport_ies( + &m1->msg.s1ap_DownlinkUEAssociatedLPPaTransport_IEs, + &m2->msg.s1ap_DownlinkUEAssociatedLPPaTransport_IEs); + break; + case S1ap_ProcedureCode_id_uplinkUEAssociatedLPPaTransport: + ret = s1ap_compare_s1ap_uplinkueassociatedlppatransport_ies( + &m1->msg.s1ap_UplinkUEAssociatedLPPaTransport_IEs, + &m2->msg.s1ap_UplinkUEAssociatedLPPaTransport_IEs); + break; + case S1ap_ProcedureCode_id_downlinkNonUEAssociatedLPPaTransport: + ret = s1ap_compare_s1ap_downlinknonueassociatedlppatransport_ies( + &m1->msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs, + &m2->msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs); + break; + case S1ap_ProcedureCode_id_uplinkNonUEAssociatedLPPaTransport: + ret = s1ap_compare_s1ap_uplinknonueassociatedlppatransport_ies( + &m1->msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs, + &m2->msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs); + break; + default: + AssertFatal(0, "Unknown procedure code %ld", m1->procedureCode); + } + return 0; +} diff --git a/openair3/TEST/EPC_TEST/play_scenario_sctp.c b/openair3/TEST/EPC_TEST/play_scenario_sctp.c index 6856cb2933..314beae8e1 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_sctp.c +++ b/openair3/TEST/EPC_TEST/play_scenario_sctp.c @@ -43,3 +43,48 @@ #include "assertions.h" #include "play_scenario.h" +//------------------------------------------------------------------------------ +int et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * const sctp2, const uint32_t constraints) +{ + // no comparison for ports + if (sctp1->ppid != sctp2->ppid) return -4; + if (sctp1->assoc_id != sctp2->assoc_id) return -5; + if (sctp1->stream != sctp2->stream) { + if (constraints & ET_BIT_MASK_MATCH_SCTP_STREAM) { + return -2; + } else { + S1AP_WARN("No Matching SCTP stream %u %u\n", sctp1->stream, sctp2->stream); + } + } + if (sctp1->ssn != sctp2->ssn) { + if (constraints & ET_BIT_MASK_MATCH_SCTP_SSN) { + return -3; + } else { + S1AP_WARN("No Matching SCTP ssn %u %u\n", sctp1->ssn, sctp2->ssn); + } + } + return et_s1ap_is_matching(&sctp1->payload, &sctp2->payload, constraints); +} + +//------------------------------------------------------------------------------ +int et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t * const sctp2, const uint32_t constraints) +{ + // no comparison for ports + if (sctp1->chunk_type != sctp2->chunk_type) return -1; + switch (sctp1->chunk_type) { + case SCTP_CID_DATA: + return et_sctp_data_is_matching(&sctp1->u.data_hdr, &sctp2->u.data_hdr, constraints); + break; + + case SCTP_CID_INIT: + AssertFatal(0, "Not needed now"); + break; + case SCTP_CID_INIT_ACK: + AssertFatal(0, "Not needed now"); + break; + default: + AssertFatal(0, "Not needed now cid %d", sctp1->chunk_type); + } + + return 0; +} From 44355e1a7355cc0d36c5f5f636d88533287c2fe6 Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 2 Dec 2015 11:26:21 +0100 Subject: [PATCH 017/214] Receiving setupresponse success, TBC --- openair3/TEST/EPC_TEST/play_scenario.c | 16 ++ openair3/TEST/EPC_TEST/play_scenario.h | 21 +- .../TEST/EPC_TEST/play_scenario_display.c | 22 ++ openair3/TEST/EPC_TEST/play_scenario_fsm.c | 5 +- openair3/TEST/EPC_TEST/play_scenario_s1ap.c | 61 ++++-- .../EPC_TEST/play_scenario_s1ap_compare_ie.c | 194 +++++++++++++++++- openair3/TEST/EPC_TEST/play_scenario_sctp.c | 18 +- 7 files changed, 305 insertions(+), 32 deletions(-) diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index 216e098a01..9a9cb881b1 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -283,6 +283,22 @@ const char * const et_chunk_type_cid2str(const sctp_cid_t chunk_type) } } //------------------------------------------------------------------------------ +const char * const et_error_match2str(const int err) +{ + switch (err) { + case -ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE: return "SCTP_CHUNK_TYPE"; break; + case -ET_ERROR_MATCH_PACKET_SCTP_PPID: return "SCTP_PPID"; break; + case -ET_ERROR_MATCH_PACKET_SCTP_ASSOC_ID: return "SCTP_ASSOC_ID"; break; + case -ET_ERROR_MATCH_PACKET_SCTP_STREAM_ID: return "SCTP_STREAM_ID"; break; + case -ET_ERROR_MATCH_PACKET_SCTP_SSN: return "SCTP_SSN"; break; + case -ET_ERROR_MATCH_PACKET_S1AP_PRESENT: return "S1AP_PRESENT"; break; + case -ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE: return "S1AP_PROCEDURE_CODE"; break; + case -ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY: return "S1AP_CRITICALITY"; break; + default: + AssertFatal (0, "ERROR: Unknown match error %d!(TODO handle an1c error codes)\n", err); + } +} +//------------------------------------------------------------------------------ et_packet_action_t et_action_str2et_action_t(const xmlChar * const action) { if ((!xmlStrcmp(action, (const xmlChar *)"SEND"))) { return ET_PACKET_ACTION_S1C_SEND;} diff --git a/openair3/TEST/EPC_TEST/play_scenario.h b/openair3/TEST/EPC_TEST/play_scenario.h index 3c8c5faef8..d5f11e40f9 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.h +++ b/openair3/TEST/EPC_TEST/play_scenario.h @@ -178,6 +178,19 @@ typedef enum { ET_FSM_STATE_END } et_fsm_state_t; +typedef enum { + ET_ERROR_MATCH_START = 1, + ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE = ET_ERROR_MATCH_START, + ET_ERROR_MATCH_PACKET_SCTP_PPID, + ET_ERROR_MATCH_PACKET_SCTP_ASSOC_ID, + ET_ERROR_MATCH_PACKET_SCTP_STREAM_ID, + ET_ERROR_MATCH_PACKET_SCTP_SSN, + ET_ERROR_MATCH_PACKET_S1AP_PRESENT, + ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE, + ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY, + ET_ERROR_MATCH_END +} et_error_match_code_t; + @@ -332,9 +345,9 @@ typedef struct et_scenario_s { hash_table_t *hash_old_ue_mme_id2ue_mme_id; struct timeval time_last_tx_packet; struct timeval time_last_rx_packet; - et_packet_t *last_rx_packet; - et_packet_t *last_tx_packet; - et_packet_t *next_packet; + et_packet_t *last_rx_packet; // last packet received with all previous scenario RX packet received. + et_packet_t *last_tx_packet; // last sent packet + et_packet_t *next_packet; // next packet to be handled in the scenario (RX or TX packet) } et_scenario_t; @@ -402,6 +415,7 @@ s1ap_eNB_instance_t *et_s1ap_eNB_get_instance(instance_t instance); void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,uint32_t buffer_length, uint16_t stream); int et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints); et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const s1ap_data_ind); +void et_scenario_set_packet_received(et_packet_t * const packet); void et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const sctp_data_ind); void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t * const sctp_data_ind); void et_s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, @@ -450,6 +464,7 @@ int et_compare_et_ip_to_net_ip_address(const et_ip_t * const ip, const net_ip_ad int et_hex2data(unsigned char * const data, const unsigned char * const hexstring, const unsigned int len); sctp_cid_t et_chunk_type_str2cid(const xmlChar * const chunk_type_str); const char * const et_chunk_type_cid2str(const sctp_cid_t chunk_type); +const char * const et_error_match2str(const int err); et_packet_action_t et_action_str2et_action_t(const xmlChar * const action); void et_ip_str2et_ip(const xmlChar * const ip_str, et_ip_t * const ip); void et_enb_config_init(const char const * lib_config_file_name_pP); diff --git a/openair3/TEST/EPC_TEST/play_scenario_display.c b/openair3/TEST/EPC_TEST/play_scenario_display.c index 406c69c858..2a924e952c 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_display.c +++ b/openair3/TEST/EPC_TEST/play_scenario_display.c @@ -273,6 +273,28 @@ void et_display_packet(const et_packet_t * const packet) default: fprintf(stdout, "\tPacket:\tAction UNKNOWN\n"); } + switch(packet->status) { + case ET_PACKET_STATUS_NONE: + fprintf(stdout, "\tPacket:\tStatus NONE\n"); + break; + case ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT: + fprintf(stdout, "\tPacket:\tStatus NOT_TAKEN_IN_ACCOUNT\n"); + break; + case ET_PACKET_STATUS_SCHEDULED_FOR_SENDING: + fprintf(stdout, "\tPacket:\tStatus SCHEDULED_FOR_SENDING\n"); + break; + case ET_PACKET_STATUS_SENT: + fprintf(stdout, "\tPacket:\tStatus SENT\n"); + break; + case ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING: + fprintf(stdout, "\tPacket:\tStatus SCHEDULED_FOR_RECEIVING\n"); + break; + case ET_PACKET_STATUS_RECEIVED: + fprintf(stdout, "\tPacket:\tStatus RECEIVED\n"); + break; + default: + fprintf(stdout, "\tPacket:\tStatus UNKNOWN\n"); + } et_display_packet_ip(&packet->ip_hdr); et_display_packet_sctp(&packet->sctp_hdr); } diff --git a/openair3/TEST/EPC_TEST/play_scenario_fsm.c b/openair3/TEST/EPC_TEST/play_scenario_fsm.c index 23ef72035c..d561668b17 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_fsm.c +++ b/openair3/TEST/EPC_TEST/play_scenario_fsm.c @@ -292,7 +292,10 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event) case ET_EVENT_INIT: AssertFatal(NULL == g_scenario, "Current scenario not ended"); g_scenario = event.u.init.scenario; - g_scenario->next_packet = g_scenario->list_packet; + g_scenario->next_packet = g_scenario->list_packet; + g_scenario->last_rx_packet = NULL; + g_scenario->last_tx_packet = NULL; + while (NULL != g_scenario->next_packet) { switch (g_scenario->next_packet->sctp_hdr.chunk_type) { diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c index 408ff72a4a..92cc3f766e 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c @@ -191,21 +191,21 @@ void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, //------------------------------------------------------------------------------ int et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints) { - if (s1ap1->pdu.present != s1ap2->pdu.present) return -6; + if (s1ap1->pdu.present != s1ap2->pdu.present) return -ET_ERROR_MATCH_PACKET_S1AP_PRESENT; switch (s1ap1->pdu.present) { case S1AP_PDU_PR_NOTHING: break; case S1AP_PDU_PR_initiatingMessage: - if (s1ap1->pdu.choice.initiatingMessage.procedureCode != s1ap2->pdu.choice.initiatingMessage.procedureCode) return -7; - if (s1ap1->pdu.choice.initiatingMessage.criticality != s1ap2->pdu.choice.initiatingMessage.criticality) return -8; + if (s1ap1->pdu.choice.initiatingMessage.procedureCode != s1ap2->pdu.choice.initiatingMessage.procedureCode) return -ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE; + if (s1ap1->pdu.choice.initiatingMessage.criticality != s1ap2->pdu.choice.initiatingMessage.criticality) return -ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY; break; case S1AP_PDU_PR_successfulOutcome: - if (s1ap1->pdu.choice.successfulOutcome.procedureCode != s1ap2->pdu.choice.successfulOutcome.procedureCode) return -7; - if (s1ap1->pdu.choice.successfulOutcome.criticality != s1ap2->pdu.choice.successfulOutcome.criticality) return -8; + if (s1ap1->pdu.choice.successfulOutcome.procedureCode != s1ap2->pdu.choice.successfulOutcome.procedureCode) return -ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE; + if (s1ap1->pdu.choice.successfulOutcome.criticality != s1ap2->pdu.choice.successfulOutcome.criticality) return -ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY; break; case S1AP_PDU_PR_unsuccessfulOutcome: - if (s1ap1->pdu.choice.unsuccessfulOutcome.procedureCode != s1ap2->pdu.choice.unsuccessfulOutcome.procedureCode) return -7; - if (s1ap1->pdu.choice.unsuccessfulOutcome.criticality != s1ap2->pdu.choice.unsuccessfulOutcome.criticality) return -8; + if (s1ap1->pdu.choice.unsuccessfulOutcome.procedureCode != s1ap2->pdu.choice.unsuccessfulOutcome.procedureCode) return -ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE; + if (s1ap1->pdu.choice.unsuccessfulOutcome.criticality != s1ap2->pdu.choice.unsuccessfulOutcome.criticality) return -ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY; break; default: AssertFatal(0, "Unknown pdu.present %d", s1ap1->pdu.present); @@ -236,7 +236,8 @@ et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const packet->enb_instance = 0; //TODO //packet->ip_hdr; // keep in mind: allocated buffer: sctp_datahdr.payload.binary_stream - memcpy((void*)&packet->sctp_hdr, (void*)&s1ap_data_ind->sctp_datahdr, sizeof(packet->sctp_hdr)); + packet->sctp_hdr.chunk_type = SCTP_CID_DATA; + memcpy((void*)&packet->sctp_hdr.u.data_hdr, (void*)&s1ap_data_ind->sctp_datahdr, sizeof(packet->sctp_hdr)); //packet->next = NULL; packet->status = ET_PACKET_STATUS_RECEIVED; //packet->timer_id = 0; @@ -245,23 +246,54 @@ et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const } +//------------------------------------------------------------------------------ +void et_scenario_set_packet_received(et_packet_t * const packet) +{ + int rc = 0; + packet->status = ET_PACKET_STATUS_RECEIVED; + S1AP_DEBUG("Packet num %d received\n", packet->packet_number); + if (packet->timer_id != 0) { + rc = timer_remove(packet->timer_id); + AssertFatal(rc == 0, "Timer on Rx packet num %d unknown", packet->packet_number); + } +} + //------------------------------------------------------------------------------ void et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) { et_packet_t * packet = NULL; et_packet_t * rx_packet = NULL; unsigned long int not_found = 1; + long rv = 0; AssertFatal (NULL != s1ap_data_ind, "Bad parameter sctp_data_ind\n"); rx_packet = et_build_packet_from_s1ap_data_ind(s1ap_data_ind); - packet = g_scenario->next_packet; + if (NULL == g_scenario->last_rx_packet) { + packet = g_scenario->list_packet; + while (NULL != packet) { + if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { + if (packet->status == ET_PACKET_STATUS_RECEIVED) { + g_scenario->last_rx_packet = packet; + } else { + break; + } + } + packet = packet->next; + } + packet = g_scenario->list_packet; + } else { + packet = g_scenario->last_rx_packet; + } // not_found threshold may sure depend on number of mme, may be not sure on number of UE while ((NULL != packet) && (not_found < 5)) { if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { - //TODO - if (et_sctp_is_matching(&packet->sctp_hdr, &rx_packet->sctp_hdr, g_constraints) == 0) { + rv = et_sctp_is_matching(&packet->sctp_hdr, &rx_packet->sctp_hdr, g_constraints); + if (0 == rv) { + S1AP_DEBUG("Compare RX packet with packet num %d succeeded\n", packet->packet_number); et_scenario_set_packet_received(packet); + } else { + S1AP_DEBUG("Compare RX packet with packet num %d failed %s\n", packet->packet_number, et_error_match2str(rv)); } } not_found += 1; @@ -388,9 +420,9 @@ void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id, case SCTP_CID_DATA : S1AP_DEBUG("%s for SCTP association (%u) SCTP_CID_DATA\n",__FUNCTION__,assoc_id); - if (ET_PACKET_STATUS_NONE == packet->status) { + if ((ET_PACKET_STATUS_NONE == packet->status) || (ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING == packet->status)) { if (0 < old_mme_port) { - if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) { + if (packet->action == ET_PACKET_ACTION_S1C_SEND) { ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &mme_desc_p->mme_net_ip_address); if (0 == ret) { ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &s1ap_eNB_instance->s1c_net_ip_address); @@ -403,7 +435,7 @@ void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id, } } } - } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { + } else if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &mme_desc_p->mme_net_ip_address); if (0 == ret) { ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &s1ap_eNB_instance->s1c_net_ip_address); @@ -474,6 +506,7 @@ void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id, break; default: + AssertFatal(0, "Unknown chunk_type %d packet num %d", packet->sctp_hdr.chunk_type, packet->packet_number); ; } packet = packet->next; diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c index 5ad5708bab..239621854a 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c @@ -63,86 +63,156 @@ int et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, long ret = 0; AssertFatal(m1 != NULL, "bad parameter m1"); AssertFatal(m2 != NULL, "bad parameter m2"); - if (m1->procedureCode != m2->procedureCode) return -1; + AssertFatal((present == S1AP_PDU_PR_initiatingMessage) || + (present == S1AP_PDU_PR_successfulOutcome) || + (present == S1AP_PDU_PR_unsuccessfulOutcome) , "bad parameter S1AP_PDU_PR present "); + if (m1->procedureCode != m2->procedureCode) return -ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE; // some cases can never occur since uplink only. switch (m1->procedureCode) { case S1ap_ProcedureCode_id_HandoverPreparation: - AssertFatal(0, "S1ap_ProcedureCode_id_InitialContextSetup not implemented"); + if (present == S1AP_PDU_PR_initiatingMessage) { + ret = s1ap_compare_s1ap_handoverrequiredies( + &m1->msg.s1ap_HandoverRequiredIEs, + &m2->msg.s1ap_HandoverRequiredIEs); + } else { + ret = s1ap_compare_s1ap_handovercommandies( + &m1->msg.s1ap_HandoverCommandIEs, + &m2->msg.s1ap_HandoverCommandIEs); + } break; + case S1ap_ProcedureCode_id_HandoverResourceAllocation: - AssertFatal(0, "S1ap_ProcedureCode_id_InitialContextSetup not implemented"); + if (present == S1AP_PDU_PR_initiatingMessage) { + ret = s1ap_compare_s1ap_handoverrequesties( + &m1->msg.s1ap_HandoverRequestIEs, + &m2->msg.s1ap_HandoverRequestIEs); + } else if (present == S1AP_PDU_PR_successfulOutcome) { + ret = s1ap_compare_s1ap_handoverrequestacknowledgeies( + &m1->msg.s1ap_HandoverRequestAcknowledgeIEs, + &m2->msg.s1ap_HandoverRequestAcknowledgeIEs); + } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) { + ret = s1ap_compare_s1ap_handoverfailureies( + &m1->msg.s1ap_HandoverFailureIEs, + &m2->msg.s1ap_HandoverFailureIEs); + } break; + case S1ap_ProcedureCode_id_HandoverNotification: - AssertFatal(0, "S1ap_ProcedureCode_id_HandoverNotification not implemented"); + ret = s1ap_compare_s1ap_handovernotifyies( + &m1->msg.s1ap_HandoverNotifyIEs, + &m2->msg.s1ap_HandoverNotifyIEs); break; + case S1ap_ProcedureCode_id_PathSwitchRequest: ret = s1ap_compare_s1ap_pathswitchrequesties( &m1->msg.s1ap_PathSwitchRequestIEs, &m2->msg.s1ap_PathSwitchRequestIEs); break; + case S1ap_ProcedureCode_id_HandoverCancel: ret = s1ap_compare_s1ap_handovercancelies( &m1->msg.s1ap_HandoverCancelIEs, &m2->msg.s1ap_HandoverCancelIEs); break; + case S1ap_ProcedureCode_id_E_RABSetup: + if (present == S1AP_PDU_PR_initiatingMessage) { + ret = s1ap_compare_s1ap_e_rabsetuprequesties( + &m1->msg.s1ap_E_RABSetupRequestIEs, + &m2->msg.s1ap_E_RABSetupRequestIEs); + } else { + ret = s1ap_compare_s1ap_e_rabsetupresponseies( + &m1->msg.s1ap_E_RABSetupResponseIEs, + &m2->msg.s1ap_E_RABSetupResponseIEs); + } + break; + case S1ap_ProcedureCode_id_E_RABModify: + if (present == S1AP_PDU_PR_initiatingMessage) { + ret = s1ap_compare_s1ap_e_rabmodifyrequesties( + &m1->msg.s1ap_E_RABModifyRequestIEs, + &m2->msg.s1ap_E_RABModifyRequestIEs); + } else { + ret = s1ap_compare_s1ap_e_rabmodifyresponseies( + &m1->msg.s1ap_E_RABModifyResponseIEs, + &m2->msg.s1ap_E_RABModifyResponseIEs); + } + break; + case S1ap_ProcedureCode_id_E_RABRelease: if (present == S1AP_PDU_PR_initiatingMessage) { ret = s1ap_compare_s1ap_e_rabreleasecommandies( &m1->msg.s1ap_E_RABReleaseCommandIEs, &m2->msg.s1ap_E_RABReleaseCommandIEs); - } else if (present == S1AP_PDU_PR_successfulOutcome) { + } else { ret = s1ap_compare_s1ap_e_rabreleaseresponseies( &m1->msg.s1ap_E_RABReleaseResponseIEs, &m2->msg.s1ap_E_RABReleaseResponseIEs); } break; + case S1ap_ProcedureCode_id_E_RABReleaseIndication: ret = s1ap_compare_s1ap_e_rabreleaseindicationies( &m1->msg.s1ap_E_RABReleaseIndicationIEs, &m2->msg.s1ap_E_RABReleaseIndicationIEs); break; + case S1ap_ProcedureCode_id_InitialContextSetup: - AssertFatal(0, "S1ap_ProcedureCode_id_InitialContextSetup not implemented"); + if (present == S1AP_PDU_PR_initiatingMessage) { + ret = s1ap_compare_s1ap_initialcontextsetuprequesties( + &m1->msg.s1ap_InitialContextSetupRequestIEs, + &m2->msg.s1ap_InitialContextSetupRequestIEs); + } else { + ret = s1ap_compare_s1ap_initialcontextsetupresponseies( + &m1->msg.s1ap_InitialContextSetupResponseIEs, + &m2->msg.s1ap_InitialContextSetupResponseIEs); + } break; + case S1ap_ProcedureCode_id_Paging: ret = s1ap_compare_s1ap_pagingies( &m1->msg.s1ap_PagingIEs, &m2->msg.s1ap_PagingIEs); break; + case S1ap_ProcedureCode_id_downlinkNASTransport: ret = s1ap_compare_s1ap_downlinknastransporties( &m1->msg.s1ap_DownlinkNASTransportIEs, &m2->msg.s1ap_DownlinkNASTransportIEs); break; + case S1ap_ProcedureCode_id_initialUEMessage: ret = s1ap_compare_s1ap_initialuemessageies( &m1->msg.s1ap_InitialUEMessageIEs, &m2->msg.s1ap_InitialUEMessageIEs); break; + case S1ap_ProcedureCode_id_uplinkNASTransport: ret = s1ap_compare_s1ap_uplinknastransporties( &m1->msg.s1ap_UplinkNASTransportIEs, &m2->msg.s1ap_UplinkNASTransportIEs); break; + case S1ap_ProcedureCode_id_Reset: ret = s1ap_compare_s1ap_reseties( &m1->msg.s1ap_ResetIEs, &m2->msg.s1ap_ResetIEs); break; + case S1ap_ProcedureCode_id_ErrorIndication: ret = s1ap_compare_s1ap_errorindicationies( &m1->msg.s1ap_ErrorIndicationIEs, &m2->msg.s1ap_ErrorIndicationIEs); break; + case S1ap_ProcedureCode_id_NASNonDeliveryIndication: ret = s1ap_compare_s1ap_nasnondeliveryindication_ies( &m1->msg.s1ap_NASNonDeliveryIndication_IEs, &m2->msg.s1ap_NASNonDeliveryIndication_IEs); break; + case S1ap_ProcedureCode_id_S1Setup: if (present == S1AP_PDU_PR_initiatingMessage) { ret = s1ap_compare_s1ap_s1setuprequesties( @@ -158,21 +228,25 @@ int et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, &m2->msg.s1ap_S1SetupFailureIEs); } break; + case S1ap_ProcedureCode_id_UEContextReleaseRequest: ret = s1ap_compare_s1ap_uecontextreleaserequesties( &m1->msg.s1ap_UEContextReleaseRequestIEs, &m2->msg.s1ap_UEContextReleaseRequestIEs); break; + case S1ap_ProcedureCode_id_DownlinkS1cdma2000tunneling: ret = s1ap_compare_s1ap_downlinks1cdma2000tunnelingies( &m1->msg.s1ap_DownlinkS1cdma2000tunnelingIEs, &m2->msg.s1ap_DownlinkS1cdma2000tunnelingIEs); break; + case S1ap_ProcedureCode_id_UplinkS1cdma2000tunneling: ret = s1ap_compare_s1ap_uplinks1cdma2000tunnelingies( &m1->msg.s1ap_UplinkS1cdma2000tunnelingIEs, &m2->msg.s1ap_UplinkS1cdma2000tunnelingIEs); break; + case S1ap_ProcedureCode_id_UEContextModification: if (present == S1AP_PDU_PR_initiatingMessage) { ret = s1ap_compare_s1ap_uecontextmodificationrequesties( @@ -188,53 +262,152 @@ int et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, &m2->msg.s1ap_UEContextModificationFailureIEs); } break; + case S1ap_ProcedureCode_id_UECapabilityInfoIndication: ret = s1ap_compare_s1ap_uecapabilityinfoindicationies( &m1->msg.s1ap_UECapabilityInfoIndicationIEs, &m2->msg.s1ap_UECapabilityInfoIndicationIEs); break; - case S1ap_ProcedureCode_id_UEContextRelease: + case S1ap_ProcedureCode_id_UEContextRelease: + if (present == S1AP_PDU_PR_initiatingMessage) { + ret = s1ap_compare_s1ap_uecontextreleasecommandies( + &m1->msg.s1ap_UEContextReleaseCommandIEs, + &m2->msg.s1ap_UEContextReleaseCommandIEs); + } else { + ret = s1ap_compare_s1ap_uecontextreleasecompleteies( + &m1->msg.s1ap_UEContextReleaseCompleteIEs, + &m2->msg.s1ap_UEContextReleaseCompleteIEs); + } break; + case S1ap_ProcedureCode_id_eNBStatusTransfer: ret = s1ap_compare_s1ap_enbstatustransferies( &m1->msg.s1ap_ENBStatusTransferIEs, &m2->msg.s1ap_ENBStatusTransferIEs); break; + case S1ap_ProcedureCode_id_MMEStatusTransfer: ret = s1ap_compare_s1ap_mmestatustransferies( &m1->msg.s1ap_MMEStatusTransferIEs, &m2->msg.s1ap_MMEStatusTransferIEs); break; + case S1ap_ProcedureCode_id_DeactivateTrace: ret = s1ap_compare_s1ap_deactivatetraceies( &m1->msg.s1ap_DeactivateTraceIEs, &m2->msg.s1ap_DeactivateTraceIEs); break; + case S1ap_ProcedureCode_id_TraceStart: ret = s1ap_compare_s1ap_tracestarties( &m1->msg.s1ap_TraceStartIEs, &m2->msg.s1ap_TraceStartIEs); break; + case S1ap_ProcedureCode_id_TraceFailureIndication: ret = s1ap_compare_s1ap_tracefailureindicationies( &m1->msg.s1ap_TraceFailureIndicationIEs, &m2->msg.s1ap_TraceFailureIndicationIEs); break; + case S1ap_ProcedureCode_id_ENBConfigurationUpdate: + if (present == S1AP_PDU_PR_initiatingMessage) { + ret = s1ap_compare_s1ap_enbconfigurationupdateies( + &m1->msg.s1ap_ENBConfigurationUpdateIEs, + &m2->msg.s1ap_ENBConfigurationUpdateIEs); + } else if (present == S1AP_PDU_PR_successfulOutcome) { + ret = s1ap_compare_s1ap_enbconfigurationupdateacknowledgeies( + &m1->msg.s1ap_ENBConfigurationUpdateAcknowledgeIEs, + &m2->msg.s1ap_ENBConfigurationUpdateAcknowledgeIEs); + } else { + ret = s1ap_compare_s1ap_enbconfigurationupdatefailureies( + &m1->msg.s1ap_ENBConfigurationUpdateFailureIEs, + &m2->msg.s1ap_ENBConfigurationUpdateFailureIEs); + } + break; + case S1ap_ProcedureCode_id_MMEConfigurationUpdate: + if (present == S1AP_PDU_PR_initiatingMessage) { + ret = s1ap_compare_s1ap_mmeconfigurationupdateies( + &m1->msg.s1ap_MMEConfigurationUpdateIEs, + &m2->msg.s1ap_MMEConfigurationUpdateIEs); + } else if (present == S1AP_PDU_PR_successfulOutcome) { + ret = s1ap_compare_s1ap_mmeconfigurationupdateacknowledgeies( + &m1->msg.s1ap_MMEConfigurationUpdateAcknowledgeIEs, + &m2->msg.s1ap_MMEConfigurationUpdateAcknowledgeIEs); + } else { + ret = s1ap_compare_s1ap_mmeconfigurationupdatefailureies( + &m1->msg.s1ap_MMEConfigurationUpdateFailureIEs, + &m2->msg.s1ap_MMEConfigurationUpdateFailureIEs); + } + break; + case S1ap_ProcedureCode_id_LocationReportingControl: + ret = s1ap_compare_s1ap_locationreportingcontrolies( + &m1->msg.s1ap_LocationReportingControlIEs, + &m2->msg.s1ap_LocationReportingControlIEs); + break; + case S1ap_ProcedureCode_id_LocationReportingFailureIndication: + ret = s1ap_compare_s1ap_locationreportingfailureindicationies( + &m1->msg.s1ap_LocationReportingFailureIndicationIEs, + &m2->msg.s1ap_LocationReportingFailureIndicationIEs); + break; + case S1ap_ProcedureCode_id_LocationReport: + ret = s1ap_compare_s1ap_locationreporties( + &m1->msg.s1ap_LocationReportIEs, + &m2->msg.s1ap_LocationReportIEs); + break; + case S1ap_ProcedureCode_id_OverloadStart: + ret = s1ap_compare_s1ap_overloadstarties( + &m1->msg.s1ap_OverloadStartIEs, + &m2->msg.s1ap_OverloadStartIEs); + break; + case S1ap_ProcedureCode_id_OverloadStop: + ret = s1ap_compare_s1ap_overloadstopies( + &m1->msg.s1ap_OverloadStopIEs, + &m2->msg.s1ap_OverloadStopIEs); + break; + case S1ap_ProcedureCode_id_WriteReplaceWarning: + if (present == S1AP_PDU_PR_initiatingMessage) { + ret = s1ap_compare_s1ap_writereplacewarningrequesties( + &m1->msg.s1ap_WriteReplaceWarningRequestIEs, + &m2->msg.s1ap_WriteReplaceWarningRequestIEs); + } else { + ret = s1ap_compare_s1ap_writereplacewarningresponseies( + &m1->msg.s1ap_WriteReplaceWarningResponseIEs, + &m2->msg.s1ap_WriteReplaceWarningResponseIEs); + } + break; + case S1ap_ProcedureCode_id_eNBDirectInformationTransfer: + ret = s1ap_compare_s1ap_enbdirectinformationtransferies( + &m1->msg.s1ap_ENBDirectInformationTransferIEs, + &m2->msg.s1ap_ENBDirectInformationTransferIEs); + break; + case S1ap_ProcedureCode_id_MMEDirectInformationTransfer: + + ret = s1ap_compare_s1ap_mmedirectinformationtransferies( + &m1->msg.s1ap_MMEDirectInformationTransferIEs, + &m2->msg.s1ap_MMEDirectInformationTransferIEs); + break; + case S1ap_ProcedureCode_id_PrivateMessage: case S1ap_ProcedureCode_id_eNBConfigurationTransfer: case S1ap_ProcedureCode_id_MMEConfigurationTransfer: + case S1ap_ProcedureCode_id_CellTrafficTrace: + ret = s1ap_compare_s1ap_celltraffictraceies( + &m1->msg.s1ap_CellTrafficTraceIEs, + &m2->msg.s1ap_CellTrafficTraceIEs); + break; + case S1ap_ProcedureCode_id_Kill: if (present == S1AP_PDU_PR_initiatingMessage) { ret = s1ap_compare_s1ap_killrequesties( @@ -246,28 +419,33 @@ int et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, &m2->msg.s1ap_KillResponseIEs); } break; + case S1ap_ProcedureCode_id_downlinkUEAssociatedLPPaTransport: ret = s1ap_compare_s1ap_downlinkueassociatedlppatransport_ies( &m1->msg.s1ap_DownlinkUEAssociatedLPPaTransport_IEs, &m2->msg.s1ap_DownlinkUEAssociatedLPPaTransport_IEs); break; + case S1ap_ProcedureCode_id_uplinkUEAssociatedLPPaTransport: ret = s1ap_compare_s1ap_uplinkueassociatedlppatransport_ies( &m1->msg.s1ap_UplinkUEAssociatedLPPaTransport_IEs, &m2->msg.s1ap_UplinkUEAssociatedLPPaTransport_IEs); break; + case S1ap_ProcedureCode_id_downlinkNonUEAssociatedLPPaTransport: ret = s1ap_compare_s1ap_downlinknonueassociatedlppatransport_ies( &m1->msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs, &m2->msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs); break; + case S1ap_ProcedureCode_id_uplinkNonUEAssociatedLPPaTransport: ret = s1ap_compare_s1ap_uplinknonueassociatedlppatransport_ies( &m1->msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs, &m2->msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs); break; + default: AssertFatal(0, "Unknown procedure code %ld", m1->procedureCode); } - return 0; + return ret; } diff --git a/openair3/TEST/EPC_TEST/play_scenario_sctp.c b/openair3/TEST/EPC_TEST/play_scenario_sctp.c index 314beae8e1..a61701d92d 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_sctp.c +++ b/openair3/TEST/EPC_TEST/play_scenario_sctp.c @@ -47,20 +47,26 @@ int et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * const sctp2, const uint32_t constraints) { // no comparison for ports - if (sctp1->ppid != sctp2->ppid) return -4; - if (sctp1->assoc_id != sctp2->assoc_id) return -5; + if (sctp1->ppid != sctp2->ppid) { + S1AP_WARN("No Matching SCTP PPID %u %u\n", sctp1->ppid, sctp2->ppid); + return -ET_ERROR_MATCH_PACKET_SCTP_PPID; + } + if (sctp1->assoc_id != sctp2->assoc_id) { + S1AP_WARN("No Matching SCTP assoc id %u %u\n", sctp1->assoc_id, sctp2->assoc_id); + return -ET_ERROR_MATCH_PACKET_SCTP_ASSOC_ID; + } if (sctp1->stream != sctp2->stream) { if (constraints & ET_BIT_MASK_MATCH_SCTP_STREAM) { - return -2; + return -ET_ERROR_MATCH_PACKET_SCTP_STREAM_ID; } else { S1AP_WARN("No Matching SCTP stream %u %u\n", sctp1->stream, sctp2->stream); } } if (sctp1->ssn != sctp2->ssn) { if (constraints & ET_BIT_MASK_MATCH_SCTP_SSN) { - return -3; + return -ET_ERROR_MATCH_PACKET_SCTP_SSN; } else { - S1AP_WARN("No Matching SCTP ssn %u %u\n", sctp1->ssn, sctp2->ssn); + S1AP_WARN("No Matching SCTP STREAM SN %u %u\n", sctp1->ssn, sctp2->ssn); } } return et_s1ap_is_matching(&sctp1->payload, &sctp2->payload, constraints); @@ -70,7 +76,7 @@ int et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * cons int et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t * const sctp2, const uint32_t constraints) { // no comparison for ports - if (sctp1->chunk_type != sctp2->chunk_type) return -1; + if (sctp1->chunk_type != sctp2->chunk_type) return -ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE; switch (sctp1->chunk_type) { case SCTP_CID_DATA: return et_sctp_data_is_matching(&sctp1->u.data_hdr, &sctp2->u.data_hdr, constraints); From 8a001c57bc4432786d2d5f8d1a5a8a3de5b3ef9b Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 2 Dec 2015 13:04:21 +0100 Subject: [PATCH 018/214] Backup, need to feed with packets, still patch for asn1c to be comited --- openair3/TEST/EPC_TEST/play_scenario.h | 19 +++-- openair3/TEST/EPC_TEST/play_scenario_fsm.c | 74 ++++++++++++++++--- openair3/TEST/EPC_TEST/play_scenario_s1ap.c | 24 ++++-- .../EPC_TEST/play_scenario_s1ap_compare_ie.c | 6 +- openair3/TEST/EPC_TEST/play_scenario_sctp.c | 4 +- 5 files changed, 97 insertions(+), 30 deletions(-) diff --git a/openair3/TEST/EPC_TEST/play_scenario.h b/openair3/TEST/EPC_TEST/play_scenario.h index d5f11e40f9..604d0000bc 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.h +++ b/openair3/TEST/EPC_TEST/play_scenario.h @@ -173,7 +173,8 @@ typedef enum { ET_FSM_STATE_START = 0, ET_FSM_STATE_NULL = ET_FSM_STATE_START, ET_FSM_STATE_CONNECTING_S1C, - ET_FSM_STATE_WAITING_EVENT, + ET_FSM_STATE_WAITING_RX_EVENT, + ET_FSM_STATE_WAITING_TX_EVENT, ET_FSM_STATE_RUNNING, ET_FSM_STATE_END } et_fsm_state_t; @@ -359,6 +360,7 @@ typedef enum { ET_EVENT_RX_S1AP, ET_EVENT_RX_PACKET_TIME_OUT, ET_EVENT_TX_TIMED_PACKET, + ET_EVENT_TICK, ET_EVENT_END } et_event_code_t; @@ -413,10 +415,10 @@ void et_s1ap_eNB_insert_new_instance(s1ap_eNB_instance_t *new_instance_p); struct s1ap_eNB_mme_data_s *et_s1ap_eNB_get_MME(s1ap_eNB_instance_t *instance_p,int32_t assoc_id, uint16_t cnx_id); s1ap_eNB_instance_t *et_s1ap_eNB_get_instance(instance_t instance); void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,uint32_t buffer_length, uint16_t stream); -int et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints); +long et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints); et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const s1ap_data_ind); -void et_scenario_set_packet_received(et_packet_t * const packet); -void et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const sctp_data_ind); +int et_scenario_set_packet_received(et_packet_t * const packet); +int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const sctp_data_ind); void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t * const sctp_data_ind); void et_s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, net_ip_address_t *mme_ip_address, @@ -435,7 +437,8 @@ int et_generate_xml_scenario( char const * tsml_out_scenario_filename); //------------------------- et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event); -et_fsm_state_t et_scenario_fsm_notify_event_state_waiting(et_event_t event); +et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_tx(et_event_t event); +et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_rx(et_event_t event); et_fsm_state_t et_scenario_fsm_notify_event_state_connecting_s1c(et_event_t event); et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event); et_fsm_state_t et_scenario_fsm_notify_event(et_event_t event); @@ -448,10 +451,10 @@ void et_parse_sctp(xmlDocPtr doc, const xmlNode const *sctp_node, et_sctp_hdr_t et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node); et_scenario_t* et_generate_scenario(const char * const et_scenario_filename ); //------------------------- -int et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, s1ap_message * const m2, const uint32_t constraints); +long et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, s1ap_message * const m2, const uint32_t constraints); //------------------------- -int et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * const sctp2, const uint32_t constraints); -int et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t * const sctp2, const uint32_t constraints); +long et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * const sctp2, const uint32_t constraints); +long et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t * const sctp2, const uint32_t constraints); //------------------------------------------------------------------------------ void et_print_hex_octets(const unsigned char * const byte_stream, const unsigned long int num); int et_is_file_exists ( const char const * file_nameP, const char const *file_roleP); diff --git a/openair3/TEST/EPC_TEST/play_scenario_fsm.c b/openair3/TEST/EPC_TEST/play_scenario_fsm.c index d561668b17..b6ff0de859 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_fsm.c +++ b/openair3/TEST/EPC_TEST/play_scenario_fsm.c @@ -87,7 +87,7 @@ void et_scenario_wait_rx_packet(et_packet_t * const packet) NULL, &packet->timer_id) < 0) { AssertFatal(0, " Can not start waiting RX event timer\n"); } - g_fsm_state = ET_FSM_STATE_WAITING_EVENT; + g_fsm_state = ET_FSM_STATE_WAITING_RX_EVENT; packet->status = ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING; } //------------------------------------------------------------------------------ @@ -107,7 +107,7 @@ void et_scenario_schedule_tx_packet(et_packet_t * const packet) AssertFatal(NULL != s1ap_eNB_instance, "Cannot get s1ap_eNB_instance_t for eNB instance %d", packet->enb_instance); LOG_D(ENB_APP, "%s\n", __FUNCTION__); - g_fsm_state = ET_FSM_STATE_WAITING_EVENT; + g_fsm_state = ET_FSM_STATE_WAITING_TX_EVENT; switch (packet->sctp_hdr.chunk_type) { case SCTP_CID_DATA: @@ -160,6 +160,10 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event) { switch (event.code){ + case ET_EVENT_TICK: + //TODO + + break; case ET_EVENT_RX_PACKET_TIME_OUT: AssertFatal(0, "Event ET_EVENT_RX_PACKET_TIME_OUT not handled in FSM state ET_FSM_STATE_RUNNING"); break; @@ -177,18 +181,17 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event) } //------------------------------------------------------------------------------ -et_fsm_state_t et_scenario_fsm_notify_event_state_waiting(et_event_t event) +et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_tx(et_event_t event) { - + int rv = 0; switch (event.code){ - case ET_EVENT_RX_PACKET_TIME_OUT: - fprintf(stderr, "Error The following packet is not received:\n"); - et_display_packet(event.u.rx_packet_time_out); - AssertFatal(0, "Waited packet not received"); + case ET_EVENT_TICK: break; + case ET_EVENT_RX_S1AP: - et_s1ap_process_rx_packet(&event.u.s1ap_data_ind); + rv = et_s1ap_process_rx_packet(&event.u.s1ap_data_ind); break; + case ET_EVENT_TX_TIMED_PACKET: // send immediately AssertFatal(0 == gettimeofday(&event.u.tx_timed_packet->timestamp_packet, NULL), "gettimeofday() Failed"); @@ -202,9 +205,39 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_waiting(et_event_t event) g_fsm_state = ET_FSM_STATE_RUNNING; break; - + case ET_EVENT_RX_PACKET_TIME_OUT: default: - AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_WAITING", event.code); + AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_WAITING_TX", event.code); + } + pthread_mutex_unlock(&g_fsm_lock); + return 0; +} + +//------------------------------------------------------------------------------ +et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_rx(et_event_t event) +{ + int rv = 0; + switch (event.code){ + case ET_EVENT_TICK: + break; + + case ET_EVENT_RX_PACKET_TIME_OUT: + fprintf(stderr, "Error The following packet is not received:\n"); + et_display_packet(event.u.rx_packet_time_out); + AssertFatal(0, "Waited packet not received"); + break; + + case ET_EVENT_RX_S1AP: + rv = et_s1ap_process_rx_packet(&event.u.s1ap_data_ind); + // waited packet + if (rv == 0) { + g_fsm_state = ET_FSM_STATE_RUNNING; + } + break; + + case ET_EVENT_TX_TIMED_PACKET: + default: + AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_WAITING_RX", event.code); } pthread_mutex_unlock(&g_fsm_lock); return 0; @@ -215,6 +248,9 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_connecting_s1c(et_event_t even { switch (event.code){ + case ET_EVENT_TICK: + break; + case ET_EVENT_S1C_CONNECTED: // hack simulate we have been able to get the right timing values AssertFatal(gettimeofday(&g_scenario->time_last_tx_packet, NULL) == 0, "gettimeofday failed"); @@ -227,6 +263,11 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_connecting_s1c(et_event_t even if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) { et_scenario_schedule_tx_packet(g_scenario->next_packet); pthread_mutex_unlock(&g_fsm_lock); + + et_event_t continue_event; + continue_event.code = ET_EVENT_TICK; + et_scenario_fsm_notify_event(continue_event); + return g_fsm_state; } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { if (g_scenario->next_packet->status == ET_PACKET_STATUS_RECEIVED) { @@ -289,6 +330,9 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_connecting_s1c(et_event_t even et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event) { switch (event.code){ + case ET_EVENT_TICK: + break; + case ET_EVENT_INIT: AssertFatal(NULL == g_scenario, "Current scenario not ended"); g_scenario = event.u.init.scenario; @@ -304,6 +348,11 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event) if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) { et_scenario_schedule_tx_packet(g_scenario->next_packet); pthread_mutex_unlock(&g_fsm_lock); + + et_event_t continue_event; + continue_event.code = ET_EVENT_TICK; + et_scenario_fsm_notify_event(continue_event); + return g_fsm_state; } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { if (g_scenario->next_packet->status == ET_PACKET_STATUS_RECEIVED) { @@ -382,7 +431,8 @@ et_fsm_state_t et_scenario_fsm_notify_event(et_event_t event) switch (g_fsm_state){ case ET_FSM_STATE_NULL: return et_scenario_fsm_notify_event_state_null(event); break; case ET_FSM_STATE_CONNECTING_S1C: return et_scenario_fsm_notify_event_state_connecting_s1c(event); break; - case ET_FSM_STATE_WAITING_EVENT: return et_scenario_fsm_notify_event_state_waiting(event); break; + case ET_FSM_STATE_WAITING_TX_EVENT: return et_scenario_fsm_notify_event_state_waiting_tx(event); break; + case ET_FSM_STATE_WAITING_RX_EVENT: return et_scenario_fsm_notify_event_state_waiting_rx(event); break; case ET_FSM_STATE_RUNNING: return et_scenario_fsm_notify_event_state_running(event); break; default: AssertFatal(0, "Case fsm_state %d not handled", g_fsm_state); diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c index 92cc3f766e..336dc547d5 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c @@ -189,7 +189,7 @@ void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, itti_send_msg_to_task(TASK_SCTP, instance, message_p); } //------------------------------------------------------------------------------ -int et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints) +long et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints) { if (s1ap1->pdu.present != s1ap2->pdu.present) return -ET_ERROR_MATCH_PACKET_S1AP_PRESENT; switch (s1ap1->pdu.present) { @@ -247,19 +247,22 @@ et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const //------------------------------------------------------------------------------ -void et_scenario_set_packet_received(et_packet_t * const packet) +// return 0 if packet was waited +int et_scenario_set_packet_received(et_packet_t * const packet) { int rc = 0; packet->status = ET_PACKET_STATUS_RECEIVED; S1AP_DEBUG("Packet num %d received\n", packet->packet_number); if (packet->timer_id != 0) { rc = timer_remove(packet->timer_id); - AssertFatal(rc == 0, "Timer on Rx packet num %d unknown", packet->packet_number); + AssertFatal(rc == 0, "TODO: Debug Timer on Rx packet num %d unknown", packet->packet_number); + return rc; } + return 1; } //------------------------------------------------------------------------------ -void et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) +int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) { et_packet_t * packet = NULL; et_packet_t * rx_packet = NULL; @@ -291,9 +294,15 @@ void et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) rv = et_sctp_is_matching(&packet->sctp_hdr, &rx_packet->sctp_hdr, g_constraints); if (0 == rv) { S1AP_DEBUG("Compare RX packet with packet num %d succeeded\n", packet->packet_number); - et_scenario_set_packet_received(packet); + return et_scenario_set_packet_received(packet); } else { S1AP_DEBUG("Compare RX packet with packet num %d failed %s\n", packet->packet_number, et_error_match2str(rv)); + // asn1 compare no match return code, may not collide with non asn1 error return codes + // (each asn1 rc <= 166 (enum e_S1ap_ProtocolIE_ID, in generated file S1ap_ProtocolIE_ID.h)) + if ((rv > 0) || (rv <= -ET_ERROR_MATCH_END)) { + //TODO MME_UE_S1AP_ID, etc. + AssertFatal(0,"Some work needed there"); + } } } not_found += 1; @@ -301,6 +310,7 @@ void et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) } S1AP_DEBUG("Rx packet not found in scenario:\n"); et_display_packet_sctp(&rx_packet->sctp_hdr); + return -1; } //------------------------------------------------------------------------------ @@ -344,6 +354,10 @@ void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t * const sctp_data_ind) et_scenario_fsm_notify_event(event); + memset((void*)&event, 0, sizeof(event)); + event.code = ET_EVENT_TICK; + et_scenario_fsm_notify_event(event); + } //------------------------------------------------------------------------------ void et_s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c index 239621854a..5300476e98 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c @@ -58,15 +58,15 @@ extern et_scenario_t *g_scenario; extern uint32_t g_constraints; //------------------------------------------------------------------------------ -int et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, s1ap_message * const m2, const uint32_t constraints) +long et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, s1ap_message * const m2, const uint32_t constraints) { long ret = 0; AssertFatal(m1 != NULL, "bad parameter m1"); AssertFatal(m2 != NULL, "bad parameter m2"); AssertFatal((present == S1AP_PDU_PR_initiatingMessage) || (present == S1AP_PDU_PR_successfulOutcome) || - (present == S1AP_PDU_PR_unsuccessfulOutcome) , "bad parameter S1AP_PDU_PR present "); - if (m1->procedureCode != m2->procedureCode) return -ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE; + (present == S1AP_PDU_PR_unsuccessfulOutcome) , "Bad parameter S1AP_PDU_PR present "); + AssertFatal( m1->procedureCode == m2->procedureCode, "Bad parameters: no matching procedure codes"); // some cases can never occur since uplink only. diff --git a/openair3/TEST/EPC_TEST/play_scenario_sctp.c b/openair3/TEST/EPC_TEST/play_scenario_sctp.c index a61701d92d..07206f53b8 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_sctp.c +++ b/openair3/TEST/EPC_TEST/play_scenario_sctp.c @@ -44,7 +44,7 @@ #include "play_scenario.h" //------------------------------------------------------------------------------ -int et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * const sctp2, const uint32_t constraints) +long et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * const sctp2, const uint32_t constraints) { // no comparison for ports if (sctp1->ppid != sctp2->ppid) { @@ -73,7 +73,7 @@ int et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * cons } //------------------------------------------------------------------------------ -int et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t * const sctp2, const uint32_t constraints) +long et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t * const sctp2, const uint32_t constraints) { // no comparison for ports if (sctp1->chunk_type != sctp2->chunk_type) return -ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE; From e547fa872442df5571f2e23c0329b5aa9dcb5c75 Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 4 Dec 2015 11:16:47 +0100 Subject: [PATCH 019/214] Able to begin replay a scenario...debug needed --- cmake_targets/tools/build_helper | 1 + cmake_targets/tools/build_test_epc_tools | 5 + openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 | 1030 +++++++++++++++++++ openair3/TEST/EPC_TEST/play_scenario.c | 8 +- openair3/TEST/EPC_TEST/play_scenario_fsm.c | 77 +- openair3/TEST/EPC_TEST/play_scenario_s1ap.c | 22 +- 6 files changed, 1133 insertions(+), 10 deletions(-) create mode 100644 openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 46997c2773..350dae86a6 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -274,6 +274,7 @@ install_asn1c_from_source(){ patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch.p0 >> /tmp/log_compile_asn1c patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_2.p0 >> /tmp/log_compile_asn1c patch -p0 < $OPENAIR_DIR/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0 >> /tmp/log_compile_asn1c + patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 >> /tmp/log_compile_asn1c ./configure make > /tmp/log_compile_asn1c 2>&1 $SUDO make install diff --git a/cmake_targets/tools/build_test_epc_tools b/cmake_targets/tools/build_test_epc_tools index db49fa017b..b67cf15810 100755 --- a/cmake_targets/tools/build_test_epc_tools +++ b/cmake_targets/tools/build_test_epc_tools @@ -141,9 +141,14 @@ function main() compilations \ epc_test test_epc_generate_scenario \ test_epc_generate_scenario $dbin/test_epc_generate_scenario + compilations \ epc_test test_epc_play_scenario \ test_epc_play_scenario $dbin/test_epc_play_scenario + + $SUDO cp -upv test_epc_generate_scenario /usr/local/bin + $SUDO cp -upv test_epc_play_scenario /usr/local/bin + $SUDO cp -upv $OPENAIR_DIR/openair3/TEST/EPC_TEST/mme_test_s1_pcap2pdml /usr/local/bin } diff --git a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 b/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 new file mode 100644 index 0000000000..cf3553c362 --- /dev/null +++ b/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 @@ -0,0 +1,1030 @@ +--- ./asn1c/unber.c 2015-12-03 09:43:33.959009150 +0100 ++++ ./asn1c/unber.c 2015-11-30 13:20:40.751264003 +0100 +@@ -779,4 +779,6 @@ + + asn_enc_rval_t OCTET_STRING_encode_aper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *cts, void *sptr, asn_per_outp_t *po) { asn_enc_rval_t er = { 0, 0, 0 }; (void)td; (void)cts; (void)sptr; (void)po; return er; } + ++long OCTET_STRING_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) { (void)td1; (void)sptr1; (void)td2; (void)sptr2; return 0; } ++ + size_t xer_whitespace_span(const void *chunk_buf, size_t chunk_size) { (void)chunk_buf; (void)chunk_size; return 0; } +--- ./libasn1compiler/asn1c_C.c 2015-12-03 09:43:33.971009150 +0100 ++++ ./libasn1compiler/asn1c_C.c 2015-11-30 14:29:33.027259725 +0100 +@@ -1082,6 +1082,8 @@ + enum tvm_compat tv_mode; + enum etd_spec etd_spec; + char *p; ++ char tmp_buf[512]; ++ int i = 0; + + if(arg->embed) { + enum tnfmt tnfmt = TNF_CTYPE; +@@ -1243,7 +1245,8 @@ + OUT("td->uper_decoder = asn_DEF_%s.uper_decoder;\n", type_name); + OUT("td->uper_encoder = asn_DEF_%s.uper_encoder;\n", type_name); + OUT("td->aper_decoder = asn_DEF_%s.aper_decoder;\n", type_name); +- OUT("td->aper_encoder = asn_DEF_%s.aper_encoder;\n", type_name); ++ OUT("td->aper_encoder = asn_DEF_%s.aper_encoder;\n", type_name); ++ OUT("td->compare = asn_DEF_%s.compare;\n", type_name); + if(!terminal && !tags_count) { + OUT("/* The next four lines are here because of -fknown-extern-type */\n"); + OUT("td->tags = asn_DEF_%s.tags;\n", type_name); +@@ -1413,6 +1416,49 @@ + OUT("}\n"); + OUT("\n"); + ++ ++ i = 0; ++ while ((p[i] != '_') && (i < sizeof(tmp_buf))) { ++ tmp_buf[i] = p[i]; ++ i++; ++ } ++ tmp_buf[i] = '\0'; ++ // hack, only for s1ap ++ if ((strcmp("S1ap", tmp_buf) == 0) || (strcmp("X2ap", tmp_buf) == 0)) ++ OUT("#include \"%s-ProtocolIE-ID.h\"\n", tmp_buf); ++ ++ ++ p = MKID(expr); ++ if(HIDE_INNER_DEFS) OUT("static "); ++ OUT("long\n"); ++ OUT("%s", p); ++ if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index); ++ OUT("_compare(asn_TYPE_descriptor_t *td1,\n"); ++ i = 0; ++ while ((p[i] != '_') && (i < sizeof(tmp_buf))) { ++ tmp_buf[i] = p[i]; ++ i++; ++ } ++ tmp_buf[i] = '\0'; ++ strcat(tmp_buf,"_ProtocolIE_ID_id_"); ++ strcat(tmp_buf,&p[++i]); ++ INDENTED( ++ OUT("\tvoid *structure1,\n"); ++ OUT("\tasn_TYPE_descriptor_t *td2,\n"); ++ OUT("\tvoid *structure2) {\n"); ++ OUT("long rv = 0;\n"); ++ OUT("%s_%d_inherit_TYPE_descriptor(td1);\n", ++ p, expr->_type_unique_index); ++ OUT("%s_%d_inherit_TYPE_descriptor(td2);\n", ++ p, expr->_type_unique_index); ++ OUT("rv = td1->compare(td1, structure1, td2, structure2);\n"); ++ if ((strcmp("S1ap", tmp_buf) == 0) || (strcmp("X2ap", tmp_buf) == 0)) ++ OUT("if (rv) { rv = (rv << 8); rv |= %s;}\n", tmp_buf); ++ OUT("return rv;\n"); ++ ); ++ OUT("}\n"); ++ OUT("\n"); ++ + p = MKID(expr); + + if(HIDE_INNER_DEFS) OUT("static "); +@@ -1450,7 +1496,8 @@ + OUT("per_type_decoder_f %s_decode_uper;\n", p); + OUT("per_type_encoder_f %s_encode_uper;\n", p); + OUT("per_type_decoder_f %s_decode_aper;\n", p); +- OUT("per_type_encoder_f %s_encode_aper;\n", p); ++ OUT("per_type_encoder_f %s_encode_aper;\n", p); ++ OUT("type_compare_f %s_compare;\n", p); + } + } + +@@ -2501,6 +2548,7 @@ + OUT("0, 0,\t/* No APER support, " + "use \"-gen-PER\" to enable */\n"); + } ++ FUNCREF(compare); + + if(!terminal || terminal->expr_type == ASN_CONSTR_CHOICE) { + //if(expr->expr_type == ASN_CONSTR_CHOICE) { +--- ./skeletons/ANY.c 2015-12-03 09:43:33.971009150 +0100 ++++ ./skeletons/ANY.c 2015-11-26 14:40:56.547616803 +0100 +@@ -24,7 +24,8 @@ + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, +- OCTET_STRING_encode_aper, ++ OCTET_STRING_encode_aper, ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + 0, 0, 0, 0, + 0, /* No PER visible constraints */ +--- ./skeletons/BIT_STRING.c 2015-12-03 09:43:33.967009150 +0100 ++++ ./skeletons/BIT_STRING.c 2015-11-26 14:41:50.159616747 +0100 +@@ -30,7 +30,8 @@ + OCTET_STRING_decode_uper, /* Unaligned PER decoder */ + OCTET_STRING_encode_uper, /* Unaligned PER encoder */ + OCTET_STRING_decode_aper, /* Aligned PER decoder */ +- OCTET_STRING_encode_aper, /* Aligned PER encoder */ ++ OCTET_STRING_encode_aper, /* Aligned PER encoder */ ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_BIT_STRING_tags, + sizeof(asn_DEF_BIT_STRING_tags) +--- ./skeletons/BMPString.c 2015-12-03 09:43:33.963009150 +0100 ++++ ./skeletons/BMPString.c 2015-11-26 14:42:08.487616728 +0100 +@@ -36,7 +36,8 @@ + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, /* Aligned PER decoder */ +- OCTET_STRING_encode_aper, /* Aligned PER encoder */ ++ OCTET_STRING_encode_aper, /* Aligned PER encoder */ ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_BMPString_tags, + sizeof(asn_DEF_BMPString_tags) +--- ./skeletons/BOOLEAN.c 2015-12-03 09:43:33.967009150 +0100 ++++ ./skeletons/BOOLEAN.c 2015-11-30 13:16:30.275264262 +0100 +@@ -25,7 +25,8 @@ + BOOLEAN_decode_uper, /* Unaligned PER decoder */ + BOOLEAN_encode_uper, /* Unaligned PER encoder */ + BOOLEAN_decode_aper, /* Aligned PER decoder */ +- BOOLEAN_encode_aper, /* Aligned PER encoder */ ++ BOOLEAN_encode_aper, /* Aligned PER encoder */ ++ BOOLEAN_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_BOOLEAN_tags, + sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]), +@@ -326,3 +327,21 @@ + + _ASN_ENCODED_OK(er); + } ++ ++long ++BOOLEAN_compare(asn_TYPE_descriptor_t *td1, ++ void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) { ++ const BOOLEAN_t *st1 = (const BOOLEAN_t *)sptr1; ++ const BOOLEAN_t *st2 = (const BOOLEAN_t *)sptr2; ++ if ((td1) && (td2)) { ++ if ((td1->name) && (td2->name)) { ++ if (strcmp(td1->name, td2->name)) return -1; ++ } else { ++ if ((td1->xml_tag) && (td2->xml_tag)) { ++ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; ++ } ++ } ++ } ++ return (*st1 != *st2); ++} ++ +--- ./skeletons/BOOLEAN.h 2015-12-03 09:43:33.967009150 +0100 ++++ ./skeletons/BOOLEAN.h 2015-11-26 12:46:58.491623882 +0100 +@@ -30,6 +30,7 @@ + per_type_encoder_f BOOLEAN_encode_uper; + per_type_decoder_f BOOLEAN_decode_aper; + per_type_encoder_f BOOLEAN_encode_aper; ++type_compare_f BOOLEAN_compare; + + #ifdef __cplusplus + } +--- ./skeletons/compare.h 1970-01-01 01:00:00.000000000 +0100 ++++ ./skeletons/compare.h 2015-11-30 13:15:56.415264297 +0100 +@@ -0,0 +1,27 @@ ++/*- ++ * Eurecom 2015. ++ */ ++#ifndef _COMPARE_H_ ++#define _COMPARE_H_ ++ ++#include ++#include ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++struct asn_TYPE_descriptor_s; /* Forward declaration */ ++ ++typedef long (type_compare_f)( ++ struct asn_TYPE_descriptor_s *type_descriptor1, ++ void *struct_ptr1, ++ struct asn_TYPE_descriptor_s *type_descriptor2, ++ void *struct_ptr2 ++); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* _COMPARE_H_ */ +--- ./skeletons/constr_CHOICE.c 2015-12-03 09:43:33.967009150 +0100 ++++ ./skeletons/constr_CHOICE.c 2015-11-30 13:16:49.007264243 +0100 +@@ -1272,3 +1272,57 @@ + assert(pres_size != sizeof(int)); + } + } ++ ++long ++CHOICE_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) ++{ ++ asn_CHOICE_specifics_t *specs1 = (asn_CHOICE_specifics_t *)td1->specifics; ++ asn_CHOICE_specifics_t *specs2 = (asn_CHOICE_specifics_t *)td2->specifics; ++ int present1; ++ int present2; ++ ++ if ((!sptr1) && (!sptr2)) return 0; ++ if (!sptr1) return -1; ++ if (!sptr2) return -1; ++ ++ if ((td1) && (td2)) { ++ if ((td1->name) && (td2->name)) { ++ if (strcmp(td1->name, td2->name)) return -1; ++ } else { ++ if ((td1->xml_tag) && (td2->xml_tag)) { ++ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; ++ } ++ } ++ } ++ ++ /* ++ * Figure out which CHOICE element is encoded. ++ */ ++ present1 = _fetch_present_idx(sptr1, specs1->pres_offset,specs1->pres_size); ++ // same specs ++ present2 = _fetch_present_idx(sptr2, specs2->pres_offset,specs2->pres_size); ++ ++ if (td1->elements_count != td2->elements_count) return -1; ++ if (present1 != present2) return -1; ++ if(present1 > 0 && present1 <= td1->elements_count) { ++ asn_TYPE_member_t *elm1 = &td1->elements[present1-1]; ++ asn_TYPE_member_t *elm2 = &td2->elements[present2-1]; ++ const void *memb_ptr1; ++ const void *memb_ptr2; ++ ++ if((elm1->flags & ATF_POINTER) && (elm1->flags & ATF_POINTER)){ ++ memb_ptr1 = *(const void * const *)((const char *)sptr1 + elm1->memb_offset); ++ memb_ptr2 = *(const void * const *)((const char *)sptr2 + elm2->memb_offset); ++ if((!memb_ptr1) && (!memb_ptr2)) return -1; ++ if (!memb_ptr1) return -1; ++ if (!memb_ptr2) return -1; ++ } else if (!(elm1->flags & ATF_POINTER) && !(elm1->flags & ATF_POINTER)){ ++ memb_ptr1 = (const void *)((const char *)sptr1 + elm1->memb_offset); ++ memb_ptr2 = (const void *)((const char *)sptr2 + elm2->memb_offset); ++ } else { ++ return -1; ++ } ++ return elm1->type->compare(elm1->type, memb_ptr1, elm2->type, memb_ptr2); ++ } ++ return 0; ++} +--- ./skeletons/constr_CHOICE.h 2015-12-03 09:43:33.967009150 +0100 ++++ ./skeletons/constr_CHOICE.h 2015-11-26 14:43:57.647616615 +0100 +@@ -39,7 +39,7 @@ + /* + * A set specialized functions dealing with the CHOICE type. + */ +-asn_struct_free_f CHOICE_free; ++asn_struct_free_f CHOICE_free; + asn_struct_print_f CHOICE_print; + asn_constr_check_f CHOICE_constraint; + ber_type_decoder_f CHOICE_decode_ber; +@@ -50,7 +50,8 @@ + per_type_encoder_f CHOICE_encode_uper; + per_type_decoder_f CHOICE_decode_aper; + per_type_encoder_f CHOICE_encode_aper; +-asn_outmost_tag_f CHOICE_outmost_tag; ++type_compare_f CHOICE_compare; ++asn_outmost_tag_f CHOICE_outmost_tag; + + #ifdef __cplusplus + } +--- ./skeletons/constr_SEQUENCE.c 2015-12-03 09:43:33.967009150 +0100 ++++ ./skeletons/constr_SEQUENCE.c 2015-11-30 13:17:33.871264196 +0100 +@@ -1761,3 +1761,50 @@ + + _ASN_ENCODED_OK(er); + } ++ ++long ++SEQUENCE_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) { ++ int edx; ++ int ret; ++ ++ if((!sptr1) && (!sptr2)) return -1; ++ if(!sptr1) return -1; ++ if(!sptr2) return -1; ++ ++ if ((td1) && (td2)) { ++ if ((td1->name) && (td2->name)) { ++ if (strcmp(td1->name, td2->name)) return -1; ++ } else { ++ if ((td1->xml_tag) && (td2->xml_tag)) { ++ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; ++ } ++ } ++ } ++ ++ if (td1->elements_count != td2->elements_count) return -1; ++ ++ for(edx = 0; edx < td1->elements_count; edx++) { ++ asn_TYPE_member_t *elm1 = &td1->elements[edx]; ++ asn_TYPE_member_t *elm2 = &td1->elements[edx]; ++ const void *memb_ptr1; ++ const void *memb_ptr2; ++ ++ if(elm1->flags & ATF_POINTER) { ++ memb_ptr1 = *(const void * const *)((const char *)sptr1 + elm1->memb_offset); ++ memb_ptr2 = *(const void * const *)((const char *)sptr2 + elm2->memb_offset); ++ if((!memb_ptr1) && (!memb_ptr2)) { ++ if(elm1->optional) continue; ++ } ++ if (!memb_ptr1) return -1; ++ if (!memb_ptr2) return -1; ++ } else { ++ memb_ptr1 = (const void *)((const char *)sptr1 + elm1->memb_offset); ++ memb_ptr2 = (const void *)((const char *)sptr2 + elm2->memb_offset); ++ } ++ ++ /* Compare the member itself */ ++ ret = elm1->type->compare(elm1->type, memb_ptr1, elm2->type, memb_ptr2); ++ if(ret) return ret; ++ } ++ return 0; ++} +--- ./skeletons/constr_SEQUENCE.h 2015-12-03 09:43:33.971009150 +0100 ++++ ./skeletons/constr_SEQUENCE.h 2015-11-26 14:48:14.123616350 +0100 +@@ -54,6 +54,7 @@ + per_type_encoder_f SEQUENCE_encode_uper; + per_type_decoder_f SEQUENCE_decode_aper; + per_type_encoder_f SEQUENCE_encode_aper; ++type_compare_f SEQUENCE_compare; + + #ifdef __cplusplus + } +--- ./skeletons/constr_SEQUENCE_OF.h 2015-12-03 09:43:33.963009150 +0100 ++++ ./skeletons/constr_SEQUENCE_OF.h 2015-11-26 15:05:25.399615282 +0100 +@@ -22,7 +22,8 @@ + #define SEQUENCE_OF_decode_ber SET_OF_decode_ber + #define SEQUENCE_OF_decode_xer SET_OF_decode_xer + #define SEQUENCE_OF_decode_uper SET_OF_decode_uper +-#define SEQUENCE_OF_decode_aper SET_OF_decode_aper ++#define SEQUENCE_OF_decode_aper SET_OF_decode_aper ++#define SEQUENCE_OF_compare SET_OF_compare + der_type_encoder_f SEQUENCE_OF_encode_der; + xer_type_encoder_f SEQUENCE_OF_encode_xer; + per_type_encoder_f SEQUENCE_OF_encode_uper; +--- ./skeletons/constr_SET.c 2015-12-03 09:43:33.963009150 +0100 ++++ ./skeletons/constr_SET.c 2015-11-30 13:17:49.903264180 +0100 +@@ -1108,7 +1108,7 @@ + } + } + +-int ++long + SET_constraint(asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + int edx; +--- ./skeletons/constr_SET.h 2015-12-03 09:43:33.963009150 +0100 ++++ ./skeletons/constr_SET.h 2015-11-26 14:49:09.243616293 +0100 +@@ -56,6 +56,7 @@ + per_type_decoder_f SET_decode_aper; + per_type_encoder_f SET_encode_uper; + per_type_encoder_f SET_encode_aper; ++type_compare_f SET_compare; + + /*********************** + * Some handy helpers. * +--- ./skeletons/constr_SET_OF.c 2015-12-03 09:43:33.963009150 +0100 ++++ ./skeletons/constr_SET_OF.c 2015-11-30 13:17:42.099264188 +0100 +@@ -1039,3 +1039,46 @@ + rv.consumed = 0; + return rv; + } ++ ++long ++SET_OF_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) ++{ ++ asn_TYPE_member_t *elm1 = td1->elements; ++ asn_TYPE_member_t *elm2 = td2->elements; ++ const asn_anonymous_set_ *list1 = _A_CSET_FROM_VOID(sptr1); ++ const asn_anonymous_set_ *list2 = _A_CSET_FROM_VOID(sptr2); ++ int ret; ++ int i; ++ ++ if((!sptr1) && !(sptr2)) return 0; ++ if(!sptr1) return -1; ++ if(!sptr2) return -1; ++ ++ if ((td1) && (td2)) { ++ if ((td1->name) && (td2->name)) { ++ if (strcmp(td1->name, td2->name)) return -1; ++ } else { ++ if ((td1->xml_tag) && (td2->xml_tag)) { ++ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; ++ } ++ } ++ } ++ ++ if (td1->elements_count != td2->elements_count) return -1; ++ ++ ++ if (list1->count != list2->count ) return -1; ++ ++ for(i = 0; i < list1->count; i++) { ++ const void *memb_ptr1 = list1->array[i]; ++ const void *memb_ptr2 = list2->array[i]; ++ if ((!memb_ptr1) & (!memb_ptr2)) continue; ++ if(!memb_ptr1) return -1; ++ if(!memb_ptr2) return -1; ++ ++ ret = elm1->type->compare(elm1->type, memb_ptr1, elm2->type, memb_ptr2); ++ if(ret) return ret; ++ } ++ ++ return 0; ++} +--- ./skeletons/constr_SET_OF.h 2015-12-03 09:43:33.963009150 +0100 ++++ ./skeletons/constr_SET_OF.h 2015-11-26 14:48:45.067616318 +0100 +@@ -36,6 +36,7 @@ + per_type_encoder_f SET_OF_encode_uper; + per_type_decoder_f SET_OF_decode_aper; + per_type_encoder_f SET_OF_encode_aper; ++type_compare_f SET_OF_compare; + + #ifdef __cplusplus + } +--- ./skeletons/constr_TYPE.h 2015-12-03 09:43:33.963009150 +0100 ++++ ./skeletons/constr_TYPE.h 2015-11-26 15:28:05.495613874 +0100 +@@ -41,7 +41,8 @@ + #include /* Encoder into XER (XML, text) */ + #include /* Packet Encoding Rules decoder */ + #include /* Packet Encoding Rules encoder */ +-#include /* Subtype constraints support */ ++#include /* Subtype constraints support */ ++#include /* Comparison */ + + /* + * Free the structure according to its specification. +@@ -101,6 +102,7 @@ + per_type_encoder_f *uper_encoder; /* Unaligned PER encoder */ + per_type_decoder_f *aper_decoder; /* Aligned PER decoder */ + per_type_encoder_f *aper_encoder; /* Aligned PER encoder */ ++ type_compare_f *compare; /* Comparison between 2 instances */ + + /*********************************************************************** + * Internally useful members. Not to be used by applications directly. * +--- ./skeletons/ENUMERATED.c 2015-12-03 09:43:33.963009150 +0100 ++++ ./skeletons/ENUMERATED.c 2015-11-30 13:18:05.399264164 +0100 +@@ -27,7 +27,8 @@ + ENUMERATED_decode_uper, /* Unaligned PER decoder */ + ENUMERATED_encode_uper, /* Unaligned PER encoder */ + ENUMERATED_decode_aper, /* Aligned PER decoder */ +- ENUMERATED_encode_aper, /* Aligned PER encoder */ ++ ENUMERATED_encode_aper, /* Aligned PER encoder */ ++ ENUMERATED_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_ENUMERATED_tags, + sizeof(asn_DEF_ENUMERATED_tags) / sizeof(asn_DEF_ENUMERATED_tags[0]), +@@ -103,3 +104,22 @@ + + return NativeEnumerated_encode_aper(td, constraints, &value, po); + } ++ ++long ++ENUMERATED_compare(asn_TYPE_descriptor_t *td1, void *sptr1, ++ asn_TYPE_descriptor_t *td2, void *sptr2) { ++ ENUMERATED_t *st1 = (ENUMERATED_t *)sptr1; ++ ENUMERATED_t *st2 = (ENUMERATED_t *)sptr2; ++ ++ if ((td1) && (td2)) { ++ if ((td1->name) && (td2->name)) { ++ if (strcmp(td1->name, td2->name)) return -1; ++ } else { ++ if ((td1->xml_tag) && (td2->xml_tag)) { ++ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; ++ } ++ } ++ } ++ return (*st1 != *st2); ++} ++ +--- ./skeletons/ENUMERATED.h 2015-12-03 09:43:33.963009150 +0100 ++++ ./skeletons/ENUMERATED.h 2015-11-26 12:46:35.523623906 +0100 +@@ -19,6 +19,7 @@ + per_type_encoder_f ENUMERATED_encode_uper; + per_type_decoder_f ENUMERATED_decode_aper; + per_type_encoder_f ENUMERATED_encode_aper; ++type_compare_f ENUMERATED_compare; + + #ifdef __cplusplus + } +--- ./skeletons/file-dependencies 2015-12-03 09:43:33.731009150 +0100 ++++ ./skeletons/file-dependencies 2015-11-26 16:05:44.923611535 +0100 +@@ -39,7 +39,7 @@ + constr_SEQUENCE.h constr_SEQUENCE.c + constr_SEQUENCE_OF.h constr_SEQUENCE_OF.c asn_SEQUENCE_OF.h constr_SET_OF.h + constr_SET.h constr_SET.c +-constr_SET_OF.h constr_SET_OF.c asn_SET_OF.h ++constr_SET_OF.h constr_SET_OF.c asn_SET_OF.h compare.h + + COMMON-FILES: # THIS IS A SPECIAL SECTION + asn_application.h # Applications should include this file +--- ./skeletons/GeneralizedTime.c 2015-12-03 09:43:33.971009150 +0100 ++++ ./skeletons/GeneralizedTime.c 2015-11-26 15:09:03.899615056 +0100 +@@ -168,7 +168,8 @@ + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, +- OCTET_STRING_encode_aper, ++ OCTET_STRING_encode_aper, ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_GeneralizedTime_tags, + sizeof(asn_DEF_GeneralizedTime_tags) +--- ./skeletons/GeneralString.c 2015-12-03 09:43:33.967009150 +0100 ++++ ./skeletons/GeneralString.c 2015-11-26 14:50:11.843616228 +0100 +@@ -25,7 +25,8 @@ + OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */ + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, +- OCTET_STRING_encode_aper, ++ OCTET_STRING_encode_aper, ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_GeneralString_tags, + sizeof(asn_DEF_GeneralString_tags) +--- ./skeletons/GraphicString.c 2015-12-03 09:43:33.971009150 +0100 ++++ ./skeletons/GraphicString.c 2015-11-26 15:33:33.255613535 +0100 +@@ -25,7 +25,8 @@ + OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */ + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, +- OCTET_STRING_encode_aper, ++ OCTET_STRING_encode_aper, ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_GraphicString_tags, + sizeof(asn_DEF_GraphicString_tags) +--- ./skeletons/IA5String.c 2015-12-03 09:43:33.967009150 +0100 ++++ ./skeletons/IA5String.c 2015-11-26 14:50:44.219616194 +0100 +@@ -31,6 +31,7 @@ + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, + OCTET_STRING_encode_aper, ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_IA5String_tags, + sizeof(asn_DEF_IA5String_tags) +--- ./skeletons/INTEGER.c 2015-12-03 09:43:33.967009150 +0100 ++++ ./skeletons/INTEGER.c 2015-11-30 13:18:18.143264151 +0100 +@@ -35,6 +35,7 @@ + INTEGER_decode_aper, + INTEGER_encode_aper, + #endif /* ASN_DISABLE_PER_SUPPORT */ ++ INTEGER_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_INTEGER_tags, + sizeof(asn_DEF_INTEGER_tags) / sizeof(asn_DEF_INTEGER_tags[0]), +@@ -1501,3 +1502,20 @@ + } + + ++long ++INTEGER_compare(asn_TYPE_descriptor_t *td1, void *sptr1, ++ asn_TYPE_descriptor_t *td2, void *sptr2) { ++ INTEGER_t *st1 = (INTEGER_t *)sptr1; ++ INTEGER_t *st2 = (INTEGER_t *)sptr2; ++ if ((td1) && (td2)) { ++ if ((td1->name) && (td2->name)) { ++ if (strcmp(td1->name, td2->name)) return -1; ++ } else { ++ if ((td1->xml_tag) && (td2->xml_tag)) { ++ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; ++ } ++ } ++ } ++ if (st1->size != st2->size) return -1; ++ return memcmp(st1->buf, st2->buf, st1->size); ++} +--- ./skeletons/INTEGER.h 2015-12-03 09:43:33.967009150 +0100 ++++ ./skeletons/INTEGER.h 2015-11-26 12:50:41.551623651 +0100 +@@ -43,6 +43,7 @@ + per_type_encoder_f INTEGER_encode_uper; + per_type_decoder_f INTEGER_decode_aper; + per_type_encoder_f INTEGER_encode_aper; ++type_compare_f INTEGER_compare; + + /*********************************** + * Some handy conversion routines. * +--- ./skeletons/ISO646String.c 2015-12-03 09:43:33.967009150 +0100 ++++ ./skeletons/ISO646String.c 2015-11-26 12:55:48.327623333 +0100 +@@ -30,7 +30,8 @@ + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, +- OCTET_STRING_encode_aper, ++ OCTET_STRING_encode_aper, ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_ISO646String_tags, + sizeof(asn_DEF_ISO646String_tags) +--- ./skeletons/Makefile.am 2015-12-03 09:43:33.715009150 +0100 ++++ ./skeletons/Makefile.am 2015-11-26 15:28:55.887613822 +0100 +@@ -50,7 +50,7 @@ + ber_decoder.c ber_decoder.h \ + ber_tlv_length.c ber_tlv_length.h \ + ber_tlv_tag.c ber_tlv_tag.h \ +- constr_CHOICE.c constr_CHOICE.h \ ++ comparison.h constr_CHOICE.c constr_CHOICE.h \ + constr_SEQUENCE.c constr_SEQUENCE.h \ + constr_SEQUENCE_OF.c constr_SEQUENCE_OF.h \ + constr_SET.c constr_SET.h \ +--- ./skeletons/NativeEnumerated.c 2015-12-03 09:43:33.967009150 +0100 ++++ ./skeletons/NativeEnumerated.c 2015-11-30 13:18:32.015264136 +0100 +@@ -31,7 +31,8 @@ + NativeEnumerated_decode_uper, + NativeEnumerated_encode_uper, + NativeEnumerated_decode_aper, +- NativeEnumerated_encode_aper, ++ NativeEnumerated_encode_aper, ++ NativeEnumerated_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_NativeEnumerated_tags, + sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]), +@@ -335,3 +336,25 @@ + + _ASN_ENCODED_OK(er); + } ++ ++long ++NativeEnumerated_compare(asn_TYPE_descriptor_t *td1, void *sptr1, ++ asn_TYPE_descriptor_t *td2, void *sptr2) { ++ const asn_INTEGER_enum_map_t *a = sptr1; ++ const asn_INTEGER_enum_map_t *b = sptr2; ++ if ((td1) && (td2)) { ++ if ((td1->name) && (td2->name)) { ++ if (strcmp(td1->name, td2->name)) return -1; ++ } else { ++ if ((td1->xml_tag) && (td2->xml_tag)) { ++ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; ++ } ++ } ++ } ++ ++ if(a->nat_value == b->nat_value) ++ return 0; ++ if(a->nat_value < b->nat_value) ++ return -1; ++ return 1; ++} +--- ./skeletons/NativeEnumerated.h 2015-12-03 09:43:33.967009150 +0100 ++++ ./skeletons/NativeEnumerated.h 2015-11-26 14:51:43.315616133 +0100 +@@ -26,6 +26,7 @@ + per_type_encoder_f NativeEnumerated_encode_uper; + per_type_decoder_f NativeEnumerated_decode_aper; + per_type_encoder_f NativeEnumerated_encode_aper; ++type_compare_f NativeEnumerated_compare; + + #ifdef __cplusplus + } +--- ./skeletons/NativeInteger.c 2015-12-03 09:43:33.967009150 +0100 ++++ ./skeletons/NativeInteger.c 2015-11-30 13:18:39.887264128 +0100 +@@ -32,7 +32,8 @@ + NativeInteger_decode_uper, /* Unaligned PER decoder */ + NativeInteger_encode_uper, /* Unaligned PER encoder */ + NativeInteger_decode_aper, /* Aligned PER decoder */ +- NativeInteger_encode_aper, /* Aligned PER encoder */ ++ NativeInteger_encode_aper, /* Aligned PER encoder */ ++ NativeInteger_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_NativeInteger_tags, + sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]), +@@ -410,3 +411,20 @@ + } + } + ++ ++long ++NativeInteger_compare(asn_TYPE_descriptor_t *td1, void *sptr1, ++ asn_TYPE_descriptor_t *td2, void *sptr2) { ++ const long *native1 = (const long *)sptr1; ++ const long *native2 = (const long *)sptr2; ++ if ((td1) && (td2)) { ++ if ((td1->name) && (td2->name)) { ++ if (strcmp(td1->name, td2->name)) return -1; ++ } else { ++ if ((td1->xml_tag) && (td2->xml_tag)) { ++ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; ++ } ++ } ++ } ++ return (*native1 != *native2); ++} +--- ./skeletons/NativeInteger.h 2015-12-03 09:43:33.971009150 +0100 ++++ ./skeletons/NativeInteger.h 2015-11-26 14:52:13.931616101 +0100 +@@ -31,6 +31,7 @@ + per_type_encoder_f NativeInteger_encode_uper; + per_type_decoder_f NativeInteger_decode_aper; + per_type_encoder_f NativeInteger_encode_aper; ++type_compare_f NativeInteger_compare; + + #ifdef __cplusplus + } +--- ./skeletons/NativeReal.c 2015-12-03 09:43:33.971009150 +0100 ++++ ./skeletons/NativeReal.c 2015-11-30 13:18:46.655264121 +0100 +@@ -33,7 +33,8 @@ + NativeReal_decode_uper, + NativeReal_encode_uper, + NativeReal_decode_aper, +- NativeReal_encode_aper, ++ NativeReal_encode_aper, ++ NativeReal_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_NativeReal_tags, + sizeof(asn_DEF_NativeReal_tags) / sizeof(asn_DEF_NativeReal_tags[0]), +@@ -405,3 +406,21 @@ + } + } + ++long ++NativeReal_compare(asn_TYPE_descriptor_t *td1, void *sptr1, ++ asn_TYPE_descriptor_t *td2, void *sptr2) { ++ REAL_t *st1 = (REAL_t *)sptr1; ++ REAL_t *st2 = (REAL_t *)sptr2; ++ ++ if ((td1) && (td2)) { ++ if ((td1->name) && (td2->name)) { ++ if (strcmp(td1->name, td2->name)) return -1; ++ } else { ++ if ((td1->xml_tag) && (td2->xml_tag)) { ++ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; ++ } ++ } ++ } ++ if (st1->size != st2->size) return -1; ++ return memcmp(st1->buf, st2->buf, st1->size); ++} +--- ./skeletons/NativeReal.h 2015-12-03 09:43:33.971009150 +0100 ++++ ./skeletons/NativeReal.h 2015-11-26 14:31:12.631617407 +0100 +@@ -29,6 +29,7 @@ + per_type_encoder_f NativeReal_encode_uper; + per_type_decoder_f NativeReal_decode_aper; + per_type_encoder_f NativeReal_encode_aper; ++type_compare_f NativeReal_compare; + + #ifdef __cplusplus + } +--- ./skeletons/NULL.c 2015-12-03 09:43:33.963009150 +0100 ++++ ./skeletons/NULL.c 2015-11-30 13:18:53.047264114 +0100 +@@ -26,7 +26,8 @@ + NULL_decode_uper, /* Unaligned PER decoder */ + NULL_encode_uper, /* Unaligned PER encoder */ + NULL_decode_aper, /* Aligned PER decoder */ +- NULL_encode_aper, /* Aligned PER encoder */ ++ NULL_encode_aper, /* Aligned PER encoder */ ++ NULL_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_NULL_tags, + sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]), +@@ -192,3 +193,10 @@ + er.encoded = 0; + _ASN_ENCODED_OK(er); + } ++ ++long ++NULL_compare(asn_TYPE_descriptor_t *td1, void *sptr1, ++ asn_TYPE_descriptor_t *td2, void *sptr2) { ++ ++ return 0; ++} +--- ./skeletons/NULL.h 2015-12-03 09:43:33.963009150 +0100 ++++ ./skeletons/NULL.h 2015-11-26 14:53:03.875616050 +0100 +@@ -27,6 +27,7 @@ + per_type_encoder_f NULL_encode_uper; + per_type_decoder_f NULL_decode_aper; + per_type_encoder_f NULL_encode_aper; ++type_compare_f NULL_compare; + + #ifdef __cplusplus + } +--- ./skeletons/NumericString.c 2015-12-03 09:43:33.963009150 +0100 ++++ ./skeletons/NumericString.c 2015-11-26 14:40:39.407616820 +0100 +@@ -50,7 +50,8 @@ + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, +- OCTET_STRING_encode_aper, ++ OCTET_STRING_encode_aper, ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_NumericString_tags, + sizeof(asn_DEF_NumericString_tags) +--- ./skeletons/ObjectDescriptor.c 2015-12-03 09:43:33.963009150 +0100 ++++ ./skeletons/ObjectDescriptor.c 2015-11-26 14:55:46.227615882 +0100 +@@ -25,7 +25,8 @@ + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, +- OCTET_STRING_encode_aper, ++ OCTET_STRING_encode_aper, ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_ObjectDescriptor_tags, + sizeof(asn_DEF_ObjectDescriptor_tags) +--- ./skeletons/OBJECT_IDENTIFIER.c 2015-12-03 09:43:33.967009150 +0100 ++++ ./skeletons/OBJECT_IDENTIFIER.c 2015-11-26 14:55:13.311615916 +0100 +@@ -28,7 +28,8 @@ + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, +- OCTET_STRING_encode_aper, ++ OCTET_STRING_encode_aper, ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_OBJECT_IDENTIFIER_tags, + sizeof(asn_DEF_OBJECT_IDENTIFIER_tags) +--- ./skeletons/OCTET_STRING.c 2015-12-03 09:43:33.975009150 +0100 ++++ ./skeletons/OCTET_STRING.c 2015-11-30 13:19:18.271264088 +0100 +@@ -37,7 +37,8 @@ + OCTET_STRING_decode_uper, /* Unaligned PER decoder */ + OCTET_STRING_encode_uper, /* Unaligned PER encoder */ + OCTET_STRING_decode_aper, /* Aligned PER decoder */ +- OCTET_STRING_encode_aper, /* Aligned PER encoder */ ++ OCTET_STRING_encode_aper, /* Aligned PER encoder */ ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_OCTET_STRING_tags, + sizeof(asn_DEF_OCTET_STRING_tags) +@@ -2160,3 +2161,21 @@ + return st; + } + ++long ++OCTET_STRING_compare(asn_TYPE_descriptor_t *td1, ++ void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) { ++ OCTET_STRING_t *st1 = (OCTET_STRING_t *)sptr1; ++ OCTET_STRING_t *st2 = (OCTET_STRING_t *)sptr2; ++ ++ if ((td1) && (td2)) { ++ if ((td1->name) && (td2->name)) { ++ if (strcmp(td1->name, td2->name)) return -1; ++ } else { ++ if ((td1->xml_tag) && (td2->xml_tag)) { ++ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; ++ } ++ } ++ } ++ if (st1->size != st2->size) return -1; ++ return memcmp(st1->buf, st2->buf, st1->size); ++} +--- ./skeletons/OCTET_STRING.h 2015-12-03 09:43:33.971009150 +0100 ++++ ./skeletons/OCTET_STRING.h 2015-11-26 12:56:15.259623305 +0100 +@@ -34,6 +34,7 @@ + per_type_encoder_f OCTET_STRING_encode_uper; + per_type_decoder_f OCTET_STRING_decode_aper; + per_type_encoder_f OCTET_STRING_encode_aper; ++type_compare_f OCTET_STRING_compare; + + /****************************** + * Handy conversion routines. * +--- ./skeletons/PrintableString.c 2015-12-03 09:43:33.963009150 +0100 ++++ ./skeletons/PrintableString.c 2015-11-26 14:56:09.787615857 +0100 +@@ -60,7 +60,8 @@ + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, +- OCTET_STRING_encode_aper, ++ OCTET_STRING_encode_aper, ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_PrintableString_tags, + sizeof(asn_DEF_PrintableString_tags) +--- ./skeletons/REAL.c 2015-12-03 09:43:33.971009150 +0100 ++++ ./skeletons/REAL.c 2015-11-30 13:19:27.671264079 +0100 +@@ -46,7 +46,8 @@ + REAL_decode_uper, + REAL_encode_uper, + REAL_decode_aper, +- REAL_encode_aper, ++ REAL_encode_aper, ++ REAL_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_REAL_tags, + sizeof(asn_DEF_REAL_tags) / sizeof(asn_DEF_REAL_tags[0]), +@@ -741,3 +742,23 @@ + + return 0; + } ++ ++ ++long ++REAL_compare(asn_TYPE_descriptor_t *td1, void *sptr1, ++ asn_TYPE_descriptor_t *td2, void *sptr2) { ++ REAL_t *st1 = (REAL_t *)sptr1; ++ REAL_t *st2 = (REAL_t *)sptr2; ++ ++ if ((td1) && (td2)) { ++ if ((td1->name) && (td2->name)) { ++ if (strcmp(td1->name, td2->name)) return -1; ++ } else { ++ if ((td1->xml_tag) && (td2->xml_tag)) { ++ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; ++ } ++ } ++ } ++ if (st1->size != st2->size) return -1; ++ return memcmp(st1->buf, st2->buf, st1->size); ++} +--- ./skeletons/REAL.h 2015-12-03 09:43:33.971009150 +0100 ++++ ./skeletons/REAL.h 2015-11-26 13:00:46.183623025 +0100 +@@ -23,6 +23,7 @@ + per_type_encoder_f REAL_encode_uper; + per_type_decoder_f REAL_decode_aper; + per_type_encoder_f REAL_encode_aper; ++type_compare_f REAL_compare; + + /*********************************** + * Some handy conversion routines. * +--- ./skeletons/RELATIVE-OID.c 2015-12-03 09:43:33.963009150 +0100 ++++ ./skeletons/RELATIVE-OID.c 2015-11-26 14:56:31.703615834 +0100 +@@ -29,7 +29,8 @@ + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, +- OCTET_STRING_encode_aper, ++ OCTET_STRING_encode_aper, ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_RELATIVE_OID_tags, + sizeof(asn_DEF_RELATIVE_OID_tags) +--- ./skeletons/T61String.c 2015-12-03 09:43:33.963009150 +0100 ++++ ./skeletons/T61String.c 2015-11-26 14:57:07.235615798 +0100 +@@ -25,7 +25,8 @@ + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, +- OCTET_STRING_encode_aper, ++ OCTET_STRING_encode_aper, ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_T61String_tags, + sizeof(asn_DEF_T61String_tags) +--- ./skeletons/TeletexString.c 2015-12-03 09:43:33.963009150 +0100 ++++ ./skeletons/TeletexString.c 2015-11-26 14:57:17.643615787 +0100 +@@ -25,7 +25,8 @@ + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, +- OCTET_STRING_encode_aper, ++ OCTET_STRING_encode_aper, ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_TeletexString_tags, + sizeof(asn_DEF_TeletexString_tags) +--- ./skeletons/UniversalString.c 2015-12-03 09:43:33.971009150 +0100 ++++ ./skeletons/UniversalString.c 2015-11-26 14:57:29.015615775 +0100 +@@ -36,7 +36,8 @@ + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, +- OCTET_STRING_encode_aper, ++ OCTET_STRING_encode_aper, ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_UniversalString_tags, + sizeof(asn_DEF_UniversalString_tags) +--- ./skeletons/UTCTime.c 2015-12-03 09:43:33.971009150 +0100 ++++ ./skeletons/UTCTime.c 2015-11-26 14:57:44.127615759 +0100 +@@ -41,7 +41,8 @@ + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, +- OCTET_STRING_encode_aper, ++ OCTET_STRING_encode_aper, ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_UTCTime_tags, + sizeof(asn_DEF_UTCTime_tags) +--- ./skeletons/UTF8String.c 2015-12-03 09:43:33.959009150 +0100 ++++ ./skeletons/UTF8String.c 2015-11-26 14:06:54.563618917 +0100 +@@ -27,6 +27,7 @@ + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, + OCTET_STRING_encode_aper, ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_UTF8String_tags, + sizeof(asn_DEF_UTF8String_tags) +--- ./skeletons/VideotexString.c 2015-12-03 09:43:33.967009150 +0100 ++++ ./skeletons/VideotexString.c 2015-11-26 14:07:06.139618905 +0100 +@@ -25,7 +25,8 @@ + OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */ + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, +- OCTET_STRING_encode_aper, ++ OCTET_STRING_encode_aper, ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_VideotexString_tags, + sizeof(asn_DEF_VideotexString_tags) +--- ./skeletons/VisibleString.c 2015-12-03 09:43:33.971009150 +0100 ++++ ./skeletons/VisibleString.c 2015-11-26 14:07:15.283618895 +0100 +@@ -30,7 +30,8 @@ + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, + OCTET_STRING_decode_aper, +- OCTET_STRING_encode_aper, ++ OCTET_STRING_encode_aper, ++ OCTET_STRING_compare, + 0, /* Use generic outmost tag fetcher */ + asn_DEF_VisibleString_tags, + sizeof(asn_DEF_VisibleString_tags) diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index 9a9cb881b1..1aab216428 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -331,18 +331,18 @@ int et_compare_et_ip_to_net_ip_address(const et_ip_t * const ip, const net_ip_ad switch (ip->address_family) { case AF_INET: if (net_ip->ipv4) { - S1AP_DEBUG("%s(%s,%s)=%d\n",__FUNCTION__,ip->str, net_ip->ipv4_address, strcmp(ip->str, net_ip->ipv4_address)); + //S1AP_DEBUG("%s(%s,%s)=%d\n",__FUNCTION__,ip->str, net_ip->ipv4_address, strcmp(ip->str, net_ip->ipv4_address)); return strcmp(ip->str, net_ip->ipv4_address); } - S1AP_DEBUG("%s(%s,%s)=-1 (IP version (4) not matching)\n",__FUNCTION__,ip->str, net_ip->ipv4_address); + //S1AP_DEBUG("%s(%s,%s)=-1 (IP version (4) not matching)\n",__FUNCTION__,ip->str, net_ip->ipv4_address); return -1; break; case AF_INET6: if (net_ip->ipv6) { - S1AP_DEBUG("%s(%s,%s)=%d\n",__FUNCTION__,ip->str, net_ip->ipv4_address, strcmp(ip->str, net_ip->ipv6_address)); + //S1AP_DEBUG("%s(%s,%s)=%d\n",__FUNCTION__,ip->str, net_ip->ipv4_address, strcmp(ip->str, net_ip->ipv6_address)); return strcmp(ip->str, net_ip->ipv6_address); } - S1AP_DEBUG("%s(%s,%s)=-1 (IP version (6) not matching)\n",__FUNCTION__,ip->str, net_ip->ipv6_address); + //S1AP_DEBUG("%s(%s,%s)=-1 (IP version (6) not matching)\n",__FUNCTION__,ip->str, net_ip->ipv6_address); return -1; break; default: diff --git a/openair3/TEST/EPC_TEST/play_scenario_fsm.c b/openair3/TEST/EPC_TEST/play_scenario_fsm.c index b6ff0de859..1db9df632e 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_fsm.c +++ b/openair3/TEST/EPC_TEST/play_scenario_fsm.c @@ -87,6 +87,7 @@ void et_scenario_wait_rx_packet(et_packet_t * const packet) NULL, &packet->timer_id) < 0) { AssertFatal(0, " Can not start waiting RX event timer\n"); } + LOG_D(ENB_APP, "Waiting RX packet num %d\n", packet->packet_number); g_fsm_state = ET_FSM_STATE_WAITING_RX_EVENT; packet->status = ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING; } @@ -144,6 +145,7 @@ void et_scenario_schedule_tx_packet(et_packet_t * const packet) packet->sctp_hdr.u.data_hdr.payload.binary_stream_allocated_size, packet->sctp_hdr.u.data_hdr.stream); packet->status = ET_PACKET_STATUS_SENT; + g_scenario->next_packet = g_scenario->next_packet->next; g_fsm_state = ET_FSM_STATE_RUNNING; } break; @@ -161,8 +163,76 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event) switch (event.code){ case ET_EVENT_TICK: - //TODO + while (NULL != g_scenario->next_packet) { + LOG_D(ENB_APP, "EVENT_TICK: Considering packet num %d:\n", g_scenario->next_packet->packet_number); + switch (g_scenario->next_packet->sctp_hdr.chunk_type) { + case SCTP_CID_DATA : + // no init in this scenario, may be sub-scenario + if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) { + if (g_scenario->next_packet->status == ET_PACKET_STATUS_NONE) { + et_scenario_schedule_tx_packet(g_scenario->next_packet); + pthread_mutex_unlock(&g_fsm_lock); + et_event_t continue_event; + continue_event.code = ET_EVENT_TICK; + et_scenario_fsm_notify_event(continue_event); + + return g_fsm_state; + } else if (g_scenario->next_packet->status != ET_PACKET_STATUS_SCHEDULED_FOR_SENDING) { + AssertFatal(0, "Invalid packet status %d", g_scenario->next_packet->status); + } + } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { + if (g_scenario->next_packet->status == ET_PACKET_STATUS_RECEIVED) { + g_scenario->next_packet = g_scenario->next_packet->next; + + } else if (g_scenario->next_packet->status == ET_PACKET_STATUS_NONE) { + et_scenario_wait_rx_packet(g_scenario->next_packet); + pthread_mutex_unlock(&g_fsm_lock); + return g_fsm_state; + } else { + AssertFatal(0, "Invalid packet status %d", g_scenario->next_packet->status); + } + } else { + AssertFatal(0, "Invalid packet action %d", g_scenario->next_packet->action); + } + break; + + case SCTP_CID_INIT: + case SCTP_CID_INIT_ACK: + case SCTP_CID_HEARTBEAT: + case SCTP_CID_HEARTBEAT_ACK: + case SCTP_CID_COOKIE_ECHO: + case SCTP_CID_COOKIE_ACK: + case SCTP_CID_ECN_ECNE: + case SCTP_CID_ECN_CWR: + LOG_D(ENB_APP, "EVENT_TICK: Ignoring packet num %d SCTP CID %s\n", + g_scenario->next_packet->packet_number, + et_chunk_type_cid2str(g_scenario->next_packet->sctp_hdr.chunk_type)); + g_scenario->next_packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT; + g_scenario->next_packet = g_scenario->next_packet->next; + break; + + case SCTP_CID_ABORT: + case SCTP_CID_SHUTDOWN: + case SCTP_CID_SHUTDOWN_ACK: + case SCTP_CID_ERROR: + case SCTP_CID_SHUTDOWN_COMPLETE: + AssertFatal(0, "The scenario should be cleaned (packet %s cannot be processed at this time)", + et_chunk_type_cid2str(g_scenario->next_packet->sctp_hdr.chunk_type)); + break; + + default: + LOG_D(ENB_APP, "EVENT_TICK: Ignoring packet num %d SCTP CID %s\n", + g_scenario->next_packet->packet_number, + et_chunk_type_cid2str(g_scenario->next_packet->sctp_hdr.chunk_type)); + g_scenario->next_packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT; + g_scenario->next_packet = g_scenario->next_packet->next; + } + } + fprintf(stderr, "No Packet found in this scenario: %s\n", g_scenario->name); + g_fsm_state = ET_FSM_STATE_NULL; + pthread_mutex_unlock(&g_fsm_lock); + return g_fsm_state; break; case ET_EVENT_RX_PACKET_TIME_OUT: AssertFatal(0, "Event ET_EVENT_RX_PACKET_TIME_OUT not handled in FSM state ET_FSM_STATE_RUNNING"); @@ -186,6 +256,7 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_tx(et_event_t event) int rv = 0; switch (event.code){ case ET_EVENT_TICK: + fprintf(stdout, "EVENT_TICK: waiting for tx event\n"); break; case ET_EVENT_RX_S1AP: @@ -202,6 +273,7 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_tx(et_event_t event) event.u.tx_timed_packet->sctp_hdr.u.data_hdr.payload.binary_stream_allocated_size, event.u.tx_timed_packet->sctp_hdr.u.data_hdr.stream); event.u.tx_timed_packet->status = ET_PACKET_STATUS_SENT; + g_scenario->next_packet = event.u.tx_timed_packet->next; g_fsm_state = ET_FSM_STATE_RUNNING; break; @@ -219,6 +291,7 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_rx(et_event_t event) int rv = 0; switch (event.code){ case ET_EVENT_TICK: + fprintf(stdout, "EVENT_TICK: waiting for rx event\n"); break; case ET_EVENT_RX_PACKET_TIME_OUT: @@ -272,7 +345,6 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_connecting_s1c(et_event_t even } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { if (g_scenario->next_packet->status == ET_PACKET_STATUS_RECEIVED) { g_scenario->last_rx_packet = g_scenario->next_packet; - g_scenario->next_packet = g_scenario->next_packet->next; g_scenario->time_last_rx_packet = g_scenario->last_rx_packet->timestamp_packet; g_scenario->next_packet = g_scenario->next_packet->next; @@ -357,7 +429,6 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event) } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { if (g_scenario->next_packet->status == ET_PACKET_STATUS_RECEIVED) { g_scenario->last_rx_packet = g_scenario->next_packet; - g_scenario->next_packet = g_scenario->next_packet->next; g_scenario->time_last_rx_packet = g_scenario->last_rx_packet->timestamp_packet; g_scenario->next_packet = g_scenario->next_packet->next; diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c index 336dc547d5..142ab069e9 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c @@ -250,9 +250,24 @@ et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const // return 0 if packet was waited int et_scenario_set_packet_received(et_packet_t * const packet) { - int rc = 0; + et_packet_t * p = NULL; + int rc = 0; + packet->status = ET_PACKET_STATUS_RECEIVED; S1AP_DEBUG("Packet num %d received\n", packet->packet_number); + + p = g_scenario->last_rx_packet; + while (NULL != p) { + if (p->action == ET_PACKET_ACTION_S1C_RECEIVE) { + if (p->status == ET_PACKET_STATUS_RECEIVED) { + g_scenario->last_rx_packet = p; + } else { + break; + } + } + p = p->next; + } + if (packet->timer_id != 0) { rc = timer_remove(packet->timer_id); AssertFatal(rc == 0, "TODO: Debug Timer on Rx packet num %d unknown", packet->packet_number); @@ -278,6 +293,7 @@ int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { if (packet->status == ET_PACKET_STATUS_RECEIVED) { g_scenario->last_rx_packet = packet; + g_scenario->time_last_rx_packet = g_scenario->last_rx_packet->timestamp_packet; } else { break; } @@ -286,7 +302,7 @@ int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) } packet = g_scenario->list_packet; } else { - packet = g_scenario->last_rx_packet; + packet = g_scenario->last_rx_packet->next; } // not_found threshold may sure depend on number of mme, may be not sure on number of UE while ((NULL != packet) && (not_found < 5)) { @@ -308,8 +324,8 @@ int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) not_found += 1; packet = packet->next; } - S1AP_DEBUG("Rx packet not found in scenario:\n"); et_display_packet_sctp(&rx_packet->sctp_hdr); + AssertFatal(0, "Rx packet not found in scenario (see dump above)"); return -1; } From afa23c829b015c6a024e04fc7e9e0db4f92e1148 Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 4 Dec 2015 16:12:49 +0100 Subject: [PATCH 020/214] Timings seems to be OK, (to be checked more accurately) --- openair3/TEST/EPC_TEST/play_scenario.h | 10 +++---- openair3/TEST/EPC_TEST/play_scenario_fsm.c | 30 ++++++++++++++++---- openair3/TEST/EPC_TEST/play_scenario_parse.c | 1 + openair3/TEST/EPC_TEST/play_scenario_s1ap.c | 29 +++++++++++++------ 4 files changed, 51 insertions(+), 19 deletions(-) diff --git a/openair3/TEST/EPC_TEST/play_scenario.h b/openair3/TEST/EPC_TEST/play_scenario.h index 604d0000bc..a926ea55e4 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.h +++ b/openair3/TEST/EPC_TEST/play_scenario.h @@ -344,11 +344,11 @@ typedef struct et_scenario_s { hash_table_t *hash_mme2association_id; hash_table_t *hash_old_ue_mme_id2ue_mme_id; - struct timeval time_last_tx_packet; - struct timeval time_last_rx_packet; - et_packet_t *last_rx_packet; // last packet received with all previous scenario RX packet received. - et_packet_t *last_tx_packet; // last sent packet - et_packet_t *next_packet; // next packet to be handled in the scenario (RX or TX packet) + struct timeval time_last_tx_packet; // Time last sent packet + struct timeval time_last_rx_packet; // Time last packet received with all previous scenario RX packet received. + et_packet_t *last_rx_packet; // Last packet received with all previous scenario RX packet received. + et_packet_t *last_tx_packet; // Last sent packet + et_packet_t *next_packet; // Next packet to be handled in the scenario (RX or TX packet) } et_scenario_t; diff --git a/openair3/TEST/EPC_TEST/play_scenario_fsm.c b/openair3/TEST/EPC_TEST/play_scenario_fsm.c index 1db9df632e..b76d2240f5 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_fsm.c +++ b/openair3/TEST/EPC_TEST/play_scenario_fsm.c @@ -55,17 +55,19 @@ uint32_t g_constraints = ET_BIT_MASK_MATCH_SCTP_STREAM | ET_BIT_MASK_MA int timeval_subtract (struct timeval * const result, struct timeval * const a, struct timeval * const b) { struct timeval b2; + int nsec = 0; b2.tv_sec = b->tv_sec; b2.tv_usec = b->tv_usec; + /* Perform the carry for the later subtraction by updating y. */ if (a->tv_usec < b2.tv_usec) { - int nsec = (b2.tv_usec - a->tv_usec) / 1000000 + 1; + nsec = (b2.tv_usec - a->tv_usec) / 1000000 + 1; b2.tv_usec -= 1000000 * nsec; b2.tv_sec += nsec; } if (a->tv_usec - b2.tv_usec > 1000000) { - int nsec = (a->tv_usec - b2.tv_usec) / 1000000; + nsec = (a->tv_usec - b2.tv_usec) / 1000000; b2.tv_usec += 1000000 * nsec; b2.tv_sec -= nsec; } @@ -75,7 +77,8 @@ int timeval_subtract (struct timeval * const result, struct timeval * const a, s result->tv_sec = a->tv_sec - b2.tv_sec; result->tv_usec = a->tv_usec - b2.tv_usec; - /* Return 1 if result is negative. */ + LOG_D(ENB_APP, "timeval_subtract(%ld.%06d, %ld.%06d)=%ld.%06d\n", a->tv_sec, a->tv_usec, b->tv_sec, b->tv_usec, result->tv_sec, result->tv_usec); + return a->tv_sec < b2.tv_sec; } @@ -117,15 +120,22 @@ void et_scenario_schedule_tx_packet(et_packet_t * const packet) AssertFatal(gettimeofday(&now, NULL) == 0, "gettimeofday failed"); timeval_subtract(&offset_last_tx_packet,&now,&g_scenario->time_last_tx_packet); timeval_subtract(&offset_last_rx_packet,&now,&g_scenario->time_last_rx_packet); + LOG_D(ENB_APP, "offset_last_tx_packet=%ld.%06d\n", offset_last_tx_packet.tv_sec, offset_last_tx_packet.tv_usec); + LOG_D(ENB_APP, "offset_last_rx_packet=%ld.%06d\n", offset_last_rx_packet.tv_sec, offset_last_rx_packet.tv_usec); + last_packet_was_tx = timeval_subtract(&offset_tx_rx,&offset_last_tx_packet,&offset_last_rx_packet); if (last_packet_was_tx) { + LOG_D(ENB_APP, "last_packet_was_tx\n"); we_are_too_early = timeval_subtract(&offset,&offset_last_tx_packet,&packet->time_relative_to_last_sent_packet); + LOG_D(ENB_APP, "we_are_too_early=%d, offset=%ld.%06d\n", we_are_too_early, offset.tv_sec, offset.tv_usec); } else { + LOG_D(ENB_APP, "last_packet_was_rx\n"); we_are_too_early = timeval_subtract(&offset,&offset_last_rx_packet,&packet->time_relative_to_last_received_packet); + LOG_D(ENB_APP, "we_are_too_early=%d, offset=%ld.%06d\n", we_are_too_early, offset.tv_sec, offset.tv_usec); } if (we_are_too_early > 0) { // set timer - LOG_D(ENB_APP, "Send packet num %u original frame number %u in %ld.%d sec\n", + LOG_D(ENB_APP, "Send packet num %u original frame number %u in %ld.%06d sec\n", packet->packet_number, packet->original_frame_number, offset.tv_sec, offset.tv_usec); packet->status = ET_PACKET_STATUS_SCHEDULED_FOR_SENDING; @@ -138,6 +148,10 @@ void et_scenario_schedule_tx_packet(et_packet_t * const packet) LOG_D(ENB_APP, "Send packet num %u original frame number %u immediately\n", packet->packet_number, packet->original_frame_number); // send immediately AssertFatal(0 == gettimeofday(&packet->timestamp_packet, NULL), "gettimeofday() Failed"); + + g_scenario->time_last_tx_packet.tv_sec = packet->timestamp_packet.tv_sec; + g_scenario->time_last_tx_packet.tv_usec = packet->timestamp_packet.tv_usec; + et_s1ap_eNB_itti_send_sctp_data_req( packet->enb_instance, packet->sctp_hdr.u.data_hdr.assoc_id, @@ -266,6 +280,10 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_tx(et_event_t event) case ET_EVENT_TX_TIMED_PACKET: // send immediately AssertFatal(0 == gettimeofday(&event.u.tx_timed_packet->timestamp_packet, NULL), "gettimeofday() Failed"); + + g_scenario->time_last_tx_packet.tv_sec = event.u.tx_timed_packet->timestamp_packet.tv_sec; + g_scenario->time_last_tx_packet.tv_usec = event.u.tx_timed_packet->timestamp_packet.tv_usec; + et_s1ap_eNB_itti_send_sctp_data_req( event.u.tx_timed_packet->enb_instance, event.u.tx_timed_packet->sctp_hdr.u.data_hdr.assoc_id, @@ -325,8 +343,7 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_connecting_s1c(et_event_t even break; case ET_EVENT_S1C_CONNECTED: - // hack simulate we have been able to get the right timing values - AssertFatal(gettimeofday(&g_scenario->time_last_tx_packet, NULL) == 0, "gettimeofday failed"); + // hack simulate we have been able to get the right timing values for STCP connect AssertFatal(gettimeofday(&g_scenario->time_last_rx_packet, NULL) == 0, "gettimeofday failed"); while (NULL != g_scenario->next_packet) { @@ -452,6 +469,7 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event) // Try to register each eNB g_scenario->registered_enb = 0; g_fsm_state = ET_FSM_STATE_CONNECTING_S1C; + AssertFatal(gettimeofday(&g_scenario->time_last_tx_packet, NULL) == 0, "gettimeofday failed"); et_eNB_app_register (g_scenario->enb_properties); pthread_mutex_unlock(&g_fsm_lock); return g_fsm_state; diff --git a/openair3/TEST/EPC_TEST/play_scenario_parse.c b/openair3/TEST/EPC_TEST/play_scenario_parse.c index cb302f229a..496102449a 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_parse.c +++ b/openair3/TEST/EPC_TEST/play_scenario_parse.c @@ -343,6 +343,7 @@ et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node) { xml_char = xmlGetProp(node, (const xmlChar *)"action"); packet->action = et_action_str2et_action_t(xml_char); + packet->status = ET_PACKET_STATUS_NONE; xmlFree(xml_char); packet->packet_number = packet_number++; diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c index 142ab069e9..df26de97c2 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c @@ -254,13 +254,18 @@ int et_scenario_set_packet_received(et_packet_t * const packet) int rc = 0; packet->status = ET_PACKET_STATUS_RECEIVED; - S1AP_DEBUG("Packet num %d received\n", packet->packet_number); + S1AP_DEBUG("Packet received: num %u | original frame number %u \n", packet->packet_number, packet->original_frame_number); + S1AP_DEBUG("Last Packet received: num %u | original frame number %u \n", g_scenario->last_rx_packet->packet_number, g_scenario->last_rx_packet->original_frame_number); p = g_scenario->last_rx_packet; while (NULL != p) { - if (p->action == ET_PACKET_ACTION_S1C_RECEIVE) { - if (p->status == ET_PACKET_STATUS_RECEIVED) { + if (ET_PACKET_ACTION_S1C_RECEIVE == p->action) { + if ((ET_PACKET_STATUS_RECEIVED == p->status) || (ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT == p->status)) { g_scenario->last_rx_packet = p; + g_scenario->time_last_rx_packet.tv_sec = p->timestamp_packet.tv_sec; + g_scenario->time_last_rx_packet.tv_usec = p->timestamp_packet.tv_usec; + S1AP_DEBUG("Set Last Packet received: num %u | original frame number %u \n", g_scenario->last_rx_packet->packet_number, g_scenario->last_rx_packet->original_frame_number); + S1AP_DEBUG("Set time_last_rx_packet %ld.%06d\n", g_scenario->time_last_rx_packet.tv_sec, g_scenario->time_last_rx_packet.tv_usec); } else { break; } @@ -268,7 +273,7 @@ int et_scenario_set_packet_received(et_packet_t * const packet) p = p->next; } - if (packet->timer_id != 0) { + if (0 != packet->timer_id) { rc = timer_remove(packet->timer_id); AssertFatal(rc == 0, "TODO: Debug Timer on Rx packet num %d unknown", packet->packet_number); return rc; @@ -291,9 +296,14 @@ int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) packet = g_scenario->list_packet; while (NULL != packet) { if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { - if (packet->status == ET_PACKET_STATUS_RECEIVED) { + if ((ET_PACKET_STATUS_RECEIVED == packet->status) || (ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT == packet->status)) { g_scenario->last_rx_packet = packet; - g_scenario->time_last_rx_packet = g_scenario->last_rx_packet->timestamp_packet; + if (ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT != packet->status) { + g_scenario->time_last_rx_packet.tv_sec = packet->timestamp_packet.tv_sec; + g_scenario->time_last_rx_packet.tv_usec = packet->timestamp_packet.tv_usec; + } + S1AP_DEBUG("Set Last Packet received: num %u | original frame number %u \n", g_scenario->last_rx_packet->packet_number, g_scenario->last_rx_packet->original_frame_number); + S1AP_DEBUG("Set time_last_rx_packet %ld.%06d\n", g_scenario->time_last_rx_packet.tv_sec, g_scenario->time_last_rx_packet.tv_usec); } else { break; } @@ -309,10 +319,13 @@ int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { rv = et_sctp_is_matching(&packet->sctp_hdr, &rx_packet->sctp_hdr, g_constraints); if (0 == rv) { - S1AP_DEBUG("Compare RX packet with packet num %d succeeded\n", packet->packet_number); + S1AP_DEBUG("Compare RX packet with packet: num %u | original frame number %u \n", packet->packet_number, packet->original_frame_number); + packet->timestamp_packet.tv_sec = rx_packet->timestamp_packet.tv_sec; + packet->timestamp_packet.tv_usec = rx_packet->timestamp_packet.tv_usec; return et_scenario_set_packet_received(packet); } else { - S1AP_DEBUG("Compare RX packet with packet num %d failed %s\n", packet->packet_number, et_error_match2str(rv)); + S1AP_DEBUG("Compare RX packet with packet: num %u | original frame number %u failed:%s\n", + packet->packet_number, packet->original_frame_number, et_error_match2str(rv)); // asn1 compare no match return code, may not collide with non asn1 error return codes // (each asn1 rc <= 166 (enum e_S1ap_ProtocolIE_ID, in generated file S1ap_ProtocolIE_ID.h)) if ((rv > 0) || (rv <= -ET_ERROR_MATCH_END)) { From 1b86363795b0931fc47d78899e9d079df659f408 Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 8 Dec 2015 15:08:02 +0100 Subject: [PATCH 021/214] Remaining TODO: handle diff MME_UE_S1AP_ID, asn1c compare not tested --- cmake_targets/CMakeLists.txt | 1 + openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 | 848 +++++++++++------- openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py | 87 +- openair3/TEST/EPC_TEST/play_scenario.c | 34 +- openair3/TEST/EPC_TEST/play_scenario.h | 14 +- openair3/TEST/EPC_TEST/play_scenario_s1ap.c | 394 +++++++- .../EPC_TEST/play_scenario_s1ap_compare_ie.c | 6 +- openair3/TEST/EPC_TEST/play_scenario_sctp.c | 31 +- 8 files changed, 1041 insertions(+), 374 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 9c5bbad0de..a562a5ebc0 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1677,6 +1677,7 @@ add_executable(test_epc_play_scenario ${OPENAIR2_DIR}/COMMON/messages_types.h ${OPENAIR_BIN_DIR}/messages_xml.h ) +target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c) target_link_libraries (test_epc_play_scenario -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} ) diff --git a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 b/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 index cf3553c362..3986a6a83b 100644 --- a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 +++ b/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 @@ -1,20 +1,20 @@ ---- ./asn1c/unber.c 2015-12-03 09:43:33.959009150 +0100 -+++ ./asn1c/unber.c 2015-11-30 13:20:40.751264003 +0100 +--- asn1c/unber.c 2015-12-08 14:39:33.282543533 +0100 ++++ asn1c/unber.c 2015-12-07 10:46:18.382647000 +0100 @@ -779,4 +779,6 @@ asn_enc_rval_t OCTET_STRING_encode_aper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *cts, void *sptr, asn_per_outp_t *po) { asn_enc_rval_t er = { 0, 0, 0 }; (void)td; (void)cts; (void)sptr; (void)po; return er; } -+long OCTET_STRING_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) { (void)td1; (void)sptr1; (void)td2; (void)sptr2; return 0; } ++asn_comp_rval_t * OCTET_STRING_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) { (void)td1; (void)sptr1; (void)td2; (void)sptr2; return 0; } + size_t xer_whitespace_span(const void *chunk_buf, size_t chunk_size) { (void)chunk_buf; (void)chunk_size; return 0; } ---- ./libasn1compiler/asn1c_C.c 2015-12-03 09:43:33.971009150 +0100 -+++ ./libasn1compiler/asn1c_C.c 2015-11-30 14:29:33.027259725 +0100 +--- libasn1compiler/asn1c_C.c 2015-12-08 14:39:33.366543533 +0100 ++++ libasn1compiler/asn1c_C.c 2015-12-08 08:38:29.002565000 +0100 @@ -1082,6 +1082,8 @@ enum tvm_compat tv_mode; enum etd_spec etd_spec; char *p; -+ char tmp_buf[512]; -+ int i = 0; ++ //char tmp_buf[512]; ++ //int i = 0; if(arg->embed) { enum tnfmt tnfmt = TNF_CTYPE; @@ -28,49 +28,39 @@ if(!terminal && !tags_count) { OUT("/* The next four lines are here because of -fknown-extern-type */\n"); OUT("td->tags = asn_DEF_%s.tags;\n", type_name); -@@ -1413,6 +1416,49 @@ +@@ -1413,6 +1416,39 @@ OUT("}\n"); OUT("\n"); + -+ i = 0; -+ while ((p[i] != '_') && (i < sizeof(tmp_buf))) { -+ tmp_buf[i] = p[i]; -+ i++; -+ } -+ tmp_buf[i] = '\0'; ++ //i = 0; ++ //while ((p[i] != '_') && (i < sizeof(tmp_buf))) { ++ // tmp_buf[i] = p[i]; ++ // i++; ++ //} ++ //tmp_buf[i] = '\0'; + // hack, only for s1ap -+ if ((strcmp("S1ap", tmp_buf) == 0) || (strcmp("X2ap", tmp_buf) == 0)) -+ OUT("#include \"%s-ProtocolIE-ID.h\"\n", tmp_buf); ++ //if ((strcmp("S1ap", tmp_buf) == 0) || (strcmp("X2ap", tmp_buf) == 0)) ++ // OUT("#include \"%s-ProtocolIE-ID.h\"\n", tmp_buf); + + + p = MKID(expr); + if(HIDE_INNER_DEFS) OUT("static "); -+ OUT("long\n"); ++ OUT("asn_comp_rval_t * \n"); + OUT("%s", p); + if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index); + OUT("_compare(asn_TYPE_descriptor_t *td1,\n"); -+ i = 0; -+ while ((p[i] != '_') && (i < sizeof(tmp_buf))) { -+ tmp_buf[i] = p[i]; -+ i++; -+ } -+ tmp_buf[i] = '\0'; -+ strcat(tmp_buf,"_ProtocolIE_ID_id_"); -+ strcat(tmp_buf,&p[++i]); + INDENTED( + OUT("\tvoid *structure1,\n"); + OUT("\tasn_TYPE_descriptor_t *td2,\n"); + OUT("\tvoid *structure2) {\n"); -+ OUT("long rv = 0;\n"); ++ OUT("asn_comp_rval_t * res = NULL;\n"); + OUT("%s_%d_inherit_TYPE_descriptor(td1);\n", + p, expr->_type_unique_index); + OUT("%s_%d_inherit_TYPE_descriptor(td2);\n", + p, expr->_type_unique_index); -+ OUT("rv = td1->compare(td1, structure1, td2, structure2);\n"); -+ if ((strcmp("S1ap", tmp_buf) == 0) || (strcmp("X2ap", tmp_buf) == 0)) -+ OUT("if (rv) { rv = (rv << 8); rv |= %s;}\n", tmp_buf); -+ OUT("return rv;\n"); ++ OUT("res = td1->compare(td1, structure1, td2, structure2);\n"); ++ OUT("return res;\n"); + ); + OUT("}\n"); + OUT("\n"); @@ -78,7 +68,7 @@ p = MKID(expr); if(HIDE_INNER_DEFS) OUT("static "); -@@ -1450,7 +1496,8 @@ +@@ -1450,7 +1486,8 @@ OUT("per_type_decoder_f %s_decode_uper;\n", p); OUT("per_type_encoder_f %s_encode_uper;\n", p); OUT("per_type_decoder_f %s_decode_aper;\n", p); @@ -88,7 +78,7 @@ } } -@@ -2501,6 +2548,7 @@ +@@ -2501,6 +2538,7 @@ OUT("0, 0,\t/* No APER support, " "use \"-gen-PER\" to enable */\n"); } @@ -96,8 +86,8 @@ if(!terminal || terminal->expr_type == ASN_CONSTR_CHOICE) { //if(expr->expr_type == ASN_CONSTR_CHOICE) { ---- ./skeletons/ANY.c 2015-12-03 09:43:33.971009150 +0100 -+++ ./skeletons/ANY.c 2015-11-26 14:40:56.547616803 +0100 +--- skeletons/ANY.c 2015-12-08 14:39:33.350543533 +0100 ++++ skeletons/ANY.c 2015-11-26 14:40:56.547616000 +0100 @@ -24,7 +24,8 @@ OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, @@ -108,8 +98,101 @@ 0, /* Use generic outmost tag fetcher */ 0, 0, 0, 0, 0, /* No PER visible constraints */ ---- ./skeletons/BIT_STRING.c 2015-12-03 09:43:33.967009150 +0100 -+++ ./skeletons/BIT_STRING.c 2015-11-26 14:41:50.159616747 +0100 +--- skeletons/asn_application.h 2015-12-08 14:39:12.674543554 +0100 ++++ skeletons/asn_application.h 2015-12-07 14:36:32.950633000 +0100 +@@ -9,7 +9,8 @@ + #define _ASN_APPLICATION_H_ + + #include "asn_system.h" /* for platform-dependent types */ +-#include "asn_codecs.h" /* for ASN.1 codecs specifics */ ++#include "asn_codecs.h" /* for ASN.1 codecs specifics */ ++#include "asn_compare.h" + + #ifdef __cplusplus + extern "C" { +--- skeletons/asn_compare.h 1970-01-01 01:00:00.000000000 +0100 ++++ skeletons/asn_compare.h 2015-12-08 10:34:58.090558000 +0100 +@@ -0,0 +1,78 @@ ++#ifndef _ASN_COMPARE_H_ ++#define _ASN_COMPARE_H_ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++struct asn_TYPE_descriptor_s; /* Forward declaration */ ++ ++ ++typedef enum COMPARE_ERR_CODE_e { ++ COMPARE_ERR_CODE_START = 0, ++ COMPARE_ERR_CODE_NONE = COMPARE_ERR_CODE_START, ++ COMPARE_ERR_CODE_NO_MATCH, ++ COMPARE_ERR_CODE_TYPE_MISMATCH, ++ COMPARE_ERR_CODE_TYPE_ARG_NULL, ++ COMPARE_ERR_CODE_VALUE_NULL, ++ COMPARE_ERR_CODE_VALUE_ARG_NULL, ++ COMPARE_ERR_CODE_CHOICE_NUM, ++ COMPARE_ERR_CODE_CHOICE_PRESENT, ++ COMPARE_ERR_CODE_CHOICE_MALFORMED, ++ COMPARE_ERR_CODE_SET_MALFORMED, ++ COMPARE_ERR_CODE_COLLECTION_NUM_ELEMENTS, ++ COMPARE_ERR_CODE_END ++} COMPARE_ERR_CODE_t; ++ ++typedef struct asn_comp_rval_s { ++ enum COMPARE_ERR_CODE_e err_code; ++ char *name; // e_S1ap_ProtocolIE_ID not available for all ASN1 use (RRC vs S1AP, X2AP) ++ void *structure1; ++ void *structure2; ++ struct asn_comp_rval_s *next; ++} asn_comp_rval_t; ++ ++#define COMPARE_CHECK_ARGS(aRg_tYpE_dEf1, aRg_tYpE_dEf2, aRg_vAl1, aRg_vAl2, rEsUlT) \ ++ do {\ ++ if ((aRg_tYpE_dEf1) && (aRg_tYpE_dEf2)) {\ ++ if ((aRg_tYpE_dEf1->name) && (aRg_tYpE_dEf2->name)) {\ ++ if (strcmp(aRg_tYpE_dEf1->name, aRg_tYpE_dEf2->name)) {\ ++ rEsUlT = (asn_comp_rval_t *)calloc(1, sizeof(asn_comp_rval_t));\ ++ rEsUlT->err_code = COMPARE_ERR_CODE_TYPE_MISMATCH;\ ++ rEsUlT->name = aRg_tYpE_dEf1->name;\ ++ return rEsUlT;\ ++ }\ ++ } else {\ ++ if ((aRg_tYpE_dEf1->xml_tag) && (aRg_tYpE_dEf2->xml_tag)) {\ ++ if (strcmp(aRg_tYpE_dEf1->xml_tag, aRg_tYpE_dEf2->xml_tag)) {\ ++ rEsUlT = (asn_comp_rval_t *)calloc(1, sizeof(asn_comp_rval_t));\ ++ rEsUlT->err_code = COMPARE_ERR_CODE_TYPE_MISMATCH;\ ++ rEsUlT->name = aRg_tYpE_dEf1->xml_tag;\ ++ return rEsUlT;\ ++ }\ ++ }\ ++ }\ ++ } else {\ ++ rEsUlT = (asn_comp_rval_t *)calloc(1, sizeof(asn_comp_rval_t));\ ++ rEsUlT->name = aRg_tYpE_dEf1->name;\ ++ rEsUlT->structure1 = aRg_vAl1;\ ++ rEsUlT->structure2 = aRg_vAl2;\ ++ rEsUlT->err_code = COMPARE_ERR_CODE_TYPE_ARG_NULL;\ ++ return rEsUlT;\ ++ }\ ++ if ((NULL == aRg_vAl1) || (NULL == aRg_vAl2)){\ ++ rEsUlT = (asn_comp_rval_t *)calloc(1, sizeof(asn_comp_rval_t));\ ++ rEsUlT->name = aRg_tYpE_dEf1->name;\ ++ rEsUlT->structure1 = aRg_vAl1;\ ++ rEsUlT->structure2 = aRg_vAl2;\ ++ rEsUlT->err_code = COMPARE_ERR_CODE_VALUE_ARG_NULL;\ ++ return rEsUlT;\ ++ }\ ++ } while (0); ++ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* _ASN_COMPARE_H_ */ +--- skeletons/BIT_STRING.c 2015-12-08 14:39:33.346543533 +0100 ++++ skeletons/BIT_STRING.c 2015-11-26 14:41:50.159616000 +0100 @@ -30,7 +30,8 @@ OCTET_STRING_decode_uper, /* Unaligned PER decoder */ OCTET_STRING_encode_uper, /* Unaligned PER encoder */ @@ -120,8 +203,8 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_BIT_STRING_tags, sizeof(asn_DEF_BIT_STRING_tags) ---- ./skeletons/BMPString.c 2015-12-03 09:43:33.963009150 +0100 -+++ ./skeletons/BMPString.c 2015-11-26 14:42:08.487616728 +0100 +--- skeletons/BMPString.c 2015-12-08 14:39:33.338543533 +0100 ++++ skeletons/BMPString.c 2015-11-26 14:42:08.487616000 +0100 @@ -36,7 +36,8 @@ OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, @@ -132,8 +215,8 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_BMPString_tags, sizeof(asn_DEF_BMPString_tags) ---- ./skeletons/BOOLEAN.c 2015-12-03 09:43:33.967009150 +0100 -+++ ./skeletons/BOOLEAN.c 2015-11-30 13:16:30.275264262 +0100 +--- skeletons/BOOLEAN.c 2015-12-08 14:39:33.342543533 +0100 ++++ skeletons/BOOLEAN.c 2015-12-08 10:37:11.866558000 +0100 @@ -25,7 +25,8 @@ BOOLEAN_decode_uper, /* Unaligned PER decoder */ BOOLEAN_encode_uper, /* Unaligned PER encoder */ @@ -144,30 +227,31 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_BOOLEAN_tags, sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]), -@@ -326,3 +327,21 @@ +@@ -326,3 +327,22 @@ _ASN_ENCODED_OK(er); } + -+long ++asn_comp_rval_t * +BOOLEAN_compare(asn_TYPE_descriptor_t *td1, + void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) { + const BOOLEAN_t *st1 = (const BOOLEAN_t *)sptr1; + const BOOLEAN_t *st2 = (const BOOLEAN_t *)sptr2; -+ if ((td1) && (td2)) { -+ if ((td1->name) && (td2->name)) { -+ if (strcmp(td1->name, td2->name)) return -1; -+ } else { -+ if ((td1->xml_tag) && (td2->xml_tag)) { -+ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; -+ } -+ } -+ } -+ return (*st1 != *st2); ++ asn_comp_rval_t *res = NULL; ++ ++ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res) ++ ++ if (*st1 == *st2) return NULL; ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_NO_MATCH; ++ return res; +} + ---- ./skeletons/BOOLEAN.h 2015-12-03 09:43:33.967009150 +0100 -+++ ./skeletons/BOOLEAN.h 2015-11-26 12:46:58.491623882 +0100 +--- skeletons/BOOLEAN.h 2015-12-08 14:39:33.342543533 +0100 ++++ skeletons/BOOLEAN.h 2015-11-26 12:46:58.491623000 +0100 @@ -30,6 +30,7 @@ per_type_encoder_f BOOLEAN_encode_uper; per_type_decoder_f BOOLEAN_decode_aper; @@ -176,9 +260,9 @@ #ifdef __cplusplus } ---- ./skeletons/compare.h 1970-01-01 01:00:00.000000000 +0100 -+++ ./skeletons/compare.h 2015-11-30 13:15:56.415264297 +0100 -@@ -0,0 +1,27 @@ +--- skeletons/compare.h 1970-01-01 01:00:00.000000000 +0100 ++++ skeletons/compare.h 2015-12-08 08:23:03.694566000 +0100 +@@ -0,0 +1,28 @@ +/*- + * Eurecom 2015. + */ @@ -186,7 +270,6 @@ +#define _COMPARE_H_ + +#include -+#include + +#ifdef __cplusplus +extern "C" { @@ -194,46 +277,37 @@ + +struct asn_TYPE_descriptor_s; /* Forward declaration */ + -+typedef long (type_compare_f)( ++typedef asn_comp_rval_t * (type_compare_f)( + struct asn_TYPE_descriptor_s *type_descriptor1, + void *struct_ptr1, + struct asn_TYPE_descriptor_s *type_descriptor2, + void *struct_ptr2 +); + ++ ++ +#ifdef __cplusplus +} +#endif + +#endif /* _COMPARE_H_ */ ---- ./skeletons/constr_CHOICE.c 2015-12-03 09:43:33.967009150 +0100 -+++ ./skeletons/constr_CHOICE.c 2015-11-30 13:16:49.007264243 +0100 -@@ -1272,3 +1272,57 @@ +--- skeletons/constr_CHOICE.c 2015-12-08 14:39:33.342543533 +0100 ++++ skeletons/constr_CHOICE.c 2015-12-08 10:39:16.670558000 +0100 +@@ -1272,3 +1272,75 @@ assert(pres_size != sizeof(int)); } } + -+long ++asn_comp_rval_t * +CHOICE_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) +{ + asn_CHOICE_specifics_t *specs1 = (asn_CHOICE_specifics_t *)td1->specifics; + asn_CHOICE_specifics_t *specs2 = (asn_CHOICE_specifics_t *)td2->specifics; + int present1; + int present2; ++ asn_comp_rval_t *res = NULL; + -+ if ((!sptr1) && (!sptr2)) return 0; -+ if (!sptr1) return -1; -+ if (!sptr2) return -1; -+ -+ if ((td1) && (td2)) { -+ if ((td1->name) && (td2->name)) { -+ if (strcmp(td1->name, td2->name)) return -1; -+ } else { -+ if ((td1->xml_tag) && (td2->xml_tag)) { -+ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; -+ } -+ } -+ } ++ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res) + + /* + * Figure out which CHOICE element is encoded. @@ -242,8 +316,22 @@ + // same specs + present2 = _fetch_present_idx(sptr2, specs2->pres_offset,specs2->pres_size); + -+ if (td1->elements_count != td2->elements_count) return -1; -+ if (present1 != present2) return -1; ++ if (td1->elements_count != td2->elements_count) { ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_CHOICE_NUM; ++ return res; ++ } ++ if (present1 != present2) { ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_CHOICE_PRESENT; ++ return res; ++ } + if(present1 > 0 && present1 <= td1->elements_count) { + asn_TYPE_member_t *elm1 = &td1->elements[present1-1]; + asn_TYPE_member_t *elm2 = &td2->elements[present2-1]; @@ -253,21 +341,36 @@ + if((elm1->flags & ATF_POINTER) && (elm1->flags & ATF_POINTER)){ + memb_ptr1 = *(const void * const *)((const char *)sptr1 + elm1->memb_offset); + memb_ptr2 = *(const void * const *)((const char *)sptr2 + elm2->memb_offset); -+ if((!memb_ptr1) && (!memb_ptr2)) return -1; -+ if (!memb_ptr1) return -1; -+ if (!memb_ptr2) return -1; ++ if((!memb_ptr1) || (!memb_ptr2)) { ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_VALUE_NULL; ++ return res; ++ } + } else if (!(elm1->flags & ATF_POINTER) && !(elm1->flags & ATF_POINTER)){ + memb_ptr1 = (const void *)((const char *)sptr1 + elm1->memb_offset); + memb_ptr2 = (const void *)((const char *)sptr2 + elm2->memb_offset); + } else { -+ return -1; ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_CHOICE_MALFORMED; ++ return res; + } + return elm1->type->compare(elm1->type, memb_ptr1, elm2->type, memb_ptr2); + } -+ return 0; ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_CHOICE_MALFORMED; ++ return res; +} ---- ./skeletons/constr_CHOICE.h 2015-12-03 09:43:33.967009150 +0100 -+++ ./skeletons/constr_CHOICE.h 2015-11-26 14:43:57.647616615 +0100 +--- skeletons/constr_CHOICE.h 2015-12-08 14:39:33.342543533 +0100 ++++ skeletons/constr_CHOICE.h 2015-11-26 14:43:57.647616000 +0100 @@ -39,7 +39,7 @@ /* * A set specialized functions dealing with the CHOICE type. @@ -287,34 +390,30 @@ #ifdef __cplusplus } ---- ./skeletons/constr_SEQUENCE.c 2015-12-03 09:43:33.967009150 +0100 -+++ ./skeletons/constr_SEQUENCE.c 2015-11-30 13:17:33.871264196 +0100 -@@ -1761,3 +1761,50 @@ +--- skeletons/constr_SEQUENCE.c 2015-12-08 14:39:33.346543533 +0100 ++++ skeletons/constr_SEQUENCE.c 2015-12-08 10:39:52.442558000 +0100 +@@ -1761,3 +1761,66 @@ _ASN_ENCODED_OK(er); } + -+long -+SEQUENCE_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) { ++asn_comp_rval_t * SEQUENCE_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) { + int edx; + int ret; ++ asn_comp_rval_t *res = NULL; ++ asn_comp_rval_t *res2 = NULL; + -+ if((!sptr1) && (!sptr2)) return -1; -+ if(!sptr1) return -1; -+ if(!sptr2) return -1; ++ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res) + -+ if ((td1) && (td2)) { -+ if ((td1->name) && (td2->name)) { -+ if (strcmp(td1->name, td2->name)) return -1; -+ } else { -+ if ((td1->xml_tag) && (td2->xml_tag)) { -+ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; -+ } -+ } ++ if (td1->elements_count != td2->elements_count) { ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_COLLECTION_NUM_ELEMENTS; ++ return res; + } + -+ if (td1->elements_count != td2->elements_count) return -1; -+ + for(edx = 0; edx < td1->elements_count; edx++) { + asn_TYPE_member_t *elm1 = &td1->elements[edx]; + asn_TYPE_member_t *elm2 = &td1->elements[edx]; @@ -327,21 +426,41 @@ + if((!memb_ptr1) && (!memb_ptr2)) { + if(elm1->optional) continue; + } -+ if (!memb_ptr1) return -1; -+ if (!memb_ptr2) return -1; ++ if ((!memb_ptr1) || (!memb_ptr2)) { ++ res2 = calloc(1, sizeof(asn_comp_rval_t)); ++ res2->name = elm1->name; ++ res2->structure1 = memb_ptr1; ++ res2->structure2 = memb_ptr2; ++ res->err_code = COMPARE_ERR_CODE_VALUE_NULL; ++ if (NULL == res) { ++ res = res2; ++ } else { ++ res2->next = res; ++ res = res2; ++ } ++ res2 = NULL; ++ } + } else { + memb_ptr1 = (const void *)((const char *)sptr1 + elm1->memb_offset); + memb_ptr2 = (const void *)((const char *)sptr2 + elm2->memb_offset); + } + + /* Compare the member itself */ -+ ret = elm1->type->compare(elm1->type, memb_ptr1, elm2->type, memb_ptr2); -+ if(ret) return ret; ++ res2 = elm1->type->compare(elm1->type, memb_ptr1, elm2->type, memb_ptr2); ++ if(res2) { ++ if (NULL == res) { ++ res = res2; ++ } else { ++ res2->next = res; ++ res = res2; ++ } ++ res2 = NULL; ++ } + } -+ return 0; ++ return res; +} ---- ./skeletons/constr_SEQUENCE.h 2015-12-03 09:43:33.971009150 +0100 -+++ ./skeletons/constr_SEQUENCE.h 2015-11-26 14:48:14.123616350 +0100 +--- skeletons/constr_SEQUENCE.h 2015-12-08 14:39:33.346543533 +0100 ++++ skeletons/constr_SEQUENCE.h 2015-11-26 14:48:14.123616000 +0100 @@ -54,6 +54,7 @@ per_type_encoder_f SEQUENCE_encode_uper; per_type_decoder_f SEQUENCE_decode_aper; @@ -350,8 +469,8 @@ #ifdef __cplusplus } ---- ./skeletons/constr_SEQUENCE_OF.h 2015-12-03 09:43:33.963009150 +0100 -+++ ./skeletons/constr_SEQUENCE_OF.h 2015-11-26 15:05:25.399615282 +0100 +--- skeletons/constr_SEQUENCE_OF.h 2015-12-08 14:39:33.342543533 +0100 ++++ skeletons/constr_SEQUENCE_OF.h 2015-11-26 15:05:25.399615000 +0100 @@ -22,7 +22,8 @@ #define SEQUENCE_OF_decode_ber SET_OF_decode_ber #define SEQUENCE_OF_decode_xer SET_OF_decode_xer @@ -362,8 +481,8 @@ der_type_encoder_f SEQUENCE_OF_encode_der; xer_type_encoder_f SEQUENCE_OF_encode_xer; per_type_encoder_f SEQUENCE_OF_encode_uper; ---- ./skeletons/constr_SET.c 2015-12-03 09:43:33.963009150 +0100 -+++ ./skeletons/constr_SET.c 2015-11-30 13:17:49.903264180 +0100 +--- skeletons/constr_SET.c 2015-12-08 14:39:33.342543533 +0100 ++++ skeletons/constr_SET.c 2015-12-08 10:40:35.066558000 +0100 @@ -1108,7 +1108,7 @@ } } @@ -373,8 +492,67 @@ SET_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { int edx; ---- ./skeletons/constr_SET.h 2015-12-03 09:43:33.963009150 +0100 -+++ ./skeletons/constr_SET.h 2015-11-26 14:49:09.243616293 +0100 +@@ -1159,3 +1159,58 @@ + + return 0; + } ++ ++asn_comp_rval_t * ++SET_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) ++{ ++ int edx; ++ asn_comp_rval_t *res = NULL; ++ asn_comp_rval_t *res2 = NULL; ++ ++ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res) ++ ++ if (td1->elements_count != td2->elements_count) { ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_COLLECTION_NUM_ELEMENTS; ++ return res; ++ } ++ ++ for(edx = 0; edx < td1->elements_count; edx++) { ++ asn_TYPE_member_t *elm1 = &td1->elements[edx]; ++ asn_TYPE_member_t *elm2 = &td2->elements[edx]; ++ const void *memb_ptr1; ++ const void *memb_ptr2; ++ ++ if(elm1->flags & ATF_POINTER) { ++ memb_ptr1 = *(const void * const *)((const char *)sptr1 + elm1->memb_offset); ++ memb_ptr2 = *(const void * const *)((const char *)sptr2 + elm2->memb_offset); ++ if(!memb_ptr1) { ++ if(elm1->optional) ++ continue; ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_SET_MALFORMED; ++ return res; ++ } ++ } else { ++ memb_ptr1 = (const void *)((const char *)sptr1 + elm1->memb_offset); ++ memb_ptr2 = (const void *)((const char *)sptr2 + elm2->memb_offset); ++ } ++ res2 = elm1->type->compare(elm1->type, memb_ptr1, elm2->type, memb_ptr2); ++ if(res2) { ++ if (NULL == res) { ++ res = res2; ++ } else { ++ res2->next = res; ++ res = res2; ++ } ++ res2 = NULL; ++ } ++ } ++ return res; ++} +--- skeletons/constr_SET.h 2015-12-08 14:39:33.342543533 +0100 ++++ skeletons/constr_SET.h 2015-11-26 14:49:09.243616000 +0100 @@ -56,6 +56,7 @@ per_type_decoder_f SET_decode_aper; per_type_encoder_f SET_encode_uper; @@ -383,14 +561,14 @@ /*********************** * Some handy helpers. * ---- ./skeletons/constr_SET_OF.c 2015-12-03 09:43:33.963009150 +0100 -+++ ./skeletons/constr_SET_OF.c 2015-11-30 13:17:42.099264188 +0100 -@@ -1039,3 +1039,46 @@ +--- skeletons/constr_SET_OF.c 2015-12-08 14:39:33.338543533 +0100 ++++ skeletons/constr_SET_OF.c 2015-12-08 10:45:54.466557000 +0100 +@@ -1039,3 +1039,55 @@ rv.consumed = 0; return rv; } + -+long ++asn_comp_rval_t * +SET_OF_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) +{ + asn_TYPE_member_t *elm1 = td1->elements; @@ -399,41 +577,50 @@ + const asn_anonymous_set_ *list2 = _A_CSET_FROM_VOID(sptr2); + int ret; + int i; ++ asn_comp_rval_t *res = NULL; ++ asn_comp_rval_t *res2 = NULL; + -+ if((!sptr1) && !(sptr2)) return 0; -+ if(!sptr1) return -1; -+ if(!sptr2) return -1; ++ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res) + -+ if ((td1) && (td2)) { -+ if ((td1->name) && (td2->name)) { -+ if (strcmp(td1->name, td2->name)) return -1; -+ } else { -+ if ((td1->xml_tag) && (td2->xml_tag)) { -+ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; -+ } -+ } ++ if (td1->elements_count != td2->elements_count) { ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_COLLECTION_NUM_ELEMENTS; ++ return res; + } + -+ if (td1->elements_count != td2->elements_count) return -1; + -+ -+ if (list1->count != list2->count ) return -1; ++ if (list1->count != list2->count ) { ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_COLLECTION_NUM_ELEMENTS; ++ return res; ++ } + + for(i = 0; i < list1->count; i++) { + const void *memb_ptr1 = list1->array[i]; + const void *memb_ptr2 = list2->array[i]; + if ((!memb_ptr1) & (!memb_ptr2)) continue; -+ if(!memb_ptr1) return -1; -+ if(!memb_ptr2) return -1; + -+ ret = elm1->type->compare(elm1->type, memb_ptr1, elm2->type, memb_ptr2); -+ if(ret) return ret; ++ res2 = elm1->type->compare(elm1->type, memb_ptr1, elm2->type, memb_ptr2); ++ if(res2) { ++ if (NULL == res) { ++ res = res2; ++ } else { ++ res2->next = res; ++ res = res2; ++ } ++ res2 = NULL; ++ } + } -+ -+ return 0; ++ return res; +} ---- ./skeletons/constr_SET_OF.h 2015-12-03 09:43:33.963009150 +0100 -+++ ./skeletons/constr_SET_OF.h 2015-11-26 14:48:45.067616318 +0100 +--- skeletons/constr_SET_OF.h 2015-12-08 14:39:33.338543533 +0100 ++++ skeletons/constr_SET_OF.h 2015-11-26 14:48:45.067616000 +0100 @@ -36,6 +36,7 @@ per_type_encoder_f SET_OF_encode_uper; per_type_decoder_f SET_OF_decode_aper; @@ -442,8 +629,8 @@ #ifdef __cplusplus } ---- ./skeletons/constr_TYPE.h 2015-12-03 09:43:33.963009150 +0100 -+++ ./skeletons/constr_TYPE.h 2015-11-26 15:28:05.495613874 +0100 +--- skeletons/constr_TYPE.h 2015-12-08 14:39:33.338543533 +0100 ++++ skeletons/constr_TYPE.h 2015-11-26 15:28:05.495613000 +0100 @@ -41,7 +41,8 @@ #include /* Encoder into XER (XML, text) */ #include /* Packet Encoding Rules decoder */ @@ -462,8 +649,8 @@ /*********************************************************************** * Internally useful members. Not to be used by applications directly. * ---- ./skeletons/ENUMERATED.c 2015-12-03 09:43:33.963009150 +0100 -+++ ./skeletons/ENUMERATED.c 2015-11-30 13:18:05.399264164 +0100 +--- skeletons/ENUMERATED.c 2015-12-08 14:39:33.342543533 +0100 ++++ skeletons/ENUMERATED.c 2015-12-08 10:40:55.986558000 +0100 @@ -27,7 +27,8 @@ ENUMERATED_decode_uper, /* Unaligned PER decoder */ ENUMERATED_encode_uper, /* Unaligned PER encoder */ @@ -479,26 +666,26 @@ return NativeEnumerated_encode_aper(td, constraints, &value, po); } + -+long ++asn_comp_rval_t * +ENUMERATED_compare(asn_TYPE_descriptor_t *td1, void *sptr1, + asn_TYPE_descriptor_t *td2, void *sptr2) { + ENUMERATED_t *st1 = (ENUMERATED_t *)sptr1; + ENUMERATED_t *st2 = (ENUMERATED_t *)sptr2; ++ asn_comp_rval_t *res = NULL; + -+ if ((td1) && (td2)) { -+ if ((td1->name) && (td2->name)) { -+ if (strcmp(td1->name, td2->name)) return -1; -+ } else { -+ if ((td1->xml_tag) && (td2->xml_tag)) { -+ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; -+ } -+ } -+ } -+ return (*st1 != *st2); ++ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res) ++ ++ if (*st1 == *st2) return NULL; ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_NO_MATCH; ++ return res; +} + ---- ./skeletons/ENUMERATED.h 2015-12-03 09:43:33.963009150 +0100 -+++ ./skeletons/ENUMERATED.h 2015-11-26 12:46:35.523623906 +0100 +--- skeletons/ENUMERATED.h 2015-12-08 14:39:33.342543533 +0100 ++++ skeletons/ENUMERATED.h 2015-11-26 12:46:35.523623000 +0100 @@ -19,6 +19,7 @@ per_type_encoder_f ENUMERATED_encode_uper; per_type_decoder_f ENUMERATED_decode_aper; @@ -507,9 +694,9 @@ #ifdef __cplusplus } ---- ./skeletons/file-dependencies 2015-12-03 09:43:33.731009150 +0100 -+++ ./skeletons/file-dependencies 2015-11-26 16:05:44.923611535 +0100 -@@ -39,7 +39,7 @@ +--- skeletons/file-dependencies 2015-12-08 14:39:12.678543554 +0100 ++++ skeletons/file-dependencies 2015-12-07 15:34:40.454629000 +0100 +@@ -39,12 +39,13 @@ constr_SEQUENCE.h constr_SEQUENCE.c constr_SEQUENCE_OF.h constr_SEQUENCE_OF.c asn_SEQUENCE_OF.h constr_SET_OF.h constr_SET.h constr_SET.c @@ -517,9 +704,17 @@ +constr_SET_OF.h constr_SET_OF.c asn_SET_OF.h compare.h COMMON-FILES: # THIS IS A SPECIAL SECTION - asn_application.h # Applications should include this file ---- ./skeletons/GeneralizedTime.c 2015-12-03 09:43:33.971009150 +0100 -+++ ./skeletons/GeneralizedTime.c 2015-11-26 15:09:03.899615056 +0100 +-asn_application.h # Applications should include this file ++asn_application.h # Applications should include this file + asn_system.h # Platform-dependent types +-asn_codecs.h # Return types of encoders and decoders ++asn_codecs.h # Return types of encoders and decoders ++asn_compare.h # Return type of compare + asn_internal.h # Internal stuff + OCTET_STRING.h OCTET_STRING.c # This one is used too widely + BIT_STRING.h BIT_STRING.c # This one is necessary for the above one +--- skeletons/GeneralizedTime.c 2015-12-08 14:39:33.350543533 +0100 ++++ skeletons/GeneralizedTime.c 2015-11-26 15:09:03.899615000 +0100 @@ -168,7 +168,8 @@ OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, @@ -530,8 +725,8 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_GeneralizedTime_tags, sizeof(asn_DEF_GeneralizedTime_tags) ---- ./skeletons/GeneralString.c 2015-12-03 09:43:33.967009150 +0100 -+++ ./skeletons/GeneralString.c 2015-11-26 14:50:11.843616228 +0100 +--- skeletons/GeneralString.c 2015-12-08 14:39:33.342543533 +0100 ++++ skeletons/GeneralString.c 2015-11-26 14:50:11.843616000 +0100 @@ -25,7 +25,8 @@ OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_uper, @@ -542,8 +737,8 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_GeneralString_tags, sizeof(asn_DEF_GeneralString_tags) ---- ./skeletons/GraphicString.c 2015-12-03 09:43:33.971009150 +0100 -+++ ./skeletons/GraphicString.c 2015-11-26 15:33:33.255613535 +0100 +--- skeletons/GraphicString.c 2015-12-08 14:39:33.350543533 +0100 ++++ skeletons/GraphicString.c 2015-11-26 15:33:33.255613000 +0100 @@ -25,7 +25,8 @@ OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_uper, @@ -554,8 +749,8 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_GraphicString_tags, sizeof(asn_DEF_GraphicString_tags) ---- ./skeletons/IA5String.c 2015-12-03 09:43:33.967009150 +0100 -+++ ./skeletons/IA5String.c 2015-11-26 14:50:44.219616194 +0100 +--- skeletons/IA5String.c 2015-12-08 14:39:33.342543533 +0100 ++++ skeletons/IA5String.c 2015-11-26 14:50:44.219616000 +0100 @@ -31,6 +31,7 @@ OCTET_STRING_encode_uper, OCTET_STRING_decode_aper, @@ -564,8 +759,8 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_IA5String_tags, sizeof(asn_DEF_IA5String_tags) ---- ./skeletons/INTEGER.c 2015-12-03 09:43:33.967009150 +0100 -+++ ./skeletons/INTEGER.c 2015-11-30 13:18:18.143264151 +0100 +--- skeletons/INTEGER.c 2015-12-08 14:39:33.346543533 +0100 ++++ skeletons/INTEGER.c 2015-12-08 10:41:08.526558000 +0100 @@ -35,6 +35,7 @@ INTEGER_decode_aper, INTEGER_encode_aper, @@ -574,29 +769,39 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_INTEGER_tags, sizeof(asn_DEF_INTEGER_tags) / sizeof(asn_DEF_INTEGER_tags[0]), -@@ -1501,3 +1502,20 @@ +@@ -1501,3 +1502,30 @@ } -+long ++asn_comp_rval_t * +INTEGER_compare(asn_TYPE_descriptor_t *td1, void *sptr1, + asn_TYPE_descriptor_t *td2, void *sptr2) { + INTEGER_t *st1 = (INTEGER_t *)sptr1; + INTEGER_t *st2 = (INTEGER_t *)sptr2; -+ if ((td1) && (td2)) { -+ if ((td1->name) && (td2->name)) { -+ if (strcmp(td1->name, td2->name)) return -1; -+ } else { -+ if ((td1->xml_tag) && (td2->xml_tag)) { -+ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; -+ } -+ } ++ asn_comp_rval_t *res = NULL; ++ ++ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res) ++ ++ if (st1->size != st2->size) { ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_NO_MATCH; ++ return res; + } -+ if (st1->size != st2->size) return -1; -+ return memcmp(st1->buf, st2->buf, st1->size); ++ if (0 != memcmp(st1->buf, st2->buf, st1->size)) { ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_NO_MATCH; ++ return res; ++ } ++ return NULL; +} ---- ./skeletons/INTEGER.h 2015-12-03 09:43:33.967009150 +0100 -+++ ./skeletons/INTEGER.h 2015-11-26 12:50:41.551623651 +0100 +--- skeletons/INTEGER.h 2015-12-08 14:39:33.346543533 +0100 ++++ skeletons/INTEGER.h 2015-11-26 12:50:41.551623000 +0100 @@ -43,6 +43,7 @@ per_type_encoder_f INTEGER_encode_uper; per_type_decoder_f INTEGER_decode_aper; @@ -605,8 +810,8 @@ /*********************************** * Some handy conversion routines. * ---- ./skeletons/ISO646String.c 2015-12-03 09:43:33.967009150 +0100 -+++ ./skeletons/ISO646String.c 2015-11-26 12:55:48.327623333 +0100 +--- skeletons/ISO646String.c 2015-12-08 14:39:33.342543533 +0100 ++++ skeletons/ISO646String.c 2015-11-26 12:55:48.327623000 +0100 @@ -30,7 +30,8 @@ OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, @@ -617,19 +822,25 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_ISO646String_tags, sizeof(asn_DEF_ISO646String_tags) ---- ./skeletons/Makefile.am 2015-12-03 09:43:33.715009150 +0100 -+++ ./skeletons/Makefile.am 2015-11-26 15:28:55.887613822 +0100 -@@ -50,7 +50,7 @@ +--- skeletons/Makefile.am 2015-12-08 14:39:12.666543554 +0100 ++++ skeletons/Makefile.am 2015-12-07 15:54:00.150628000 +0100 +@@ -46,11 +46,11 @@ + asn_SET_OF.c asn_SET_OF.h \ + asn_application.h asn_codecs.h \ + asn_codecs_prim.c asn_codecs_prim.h \ +- asn_internal.h asn_system.h \ ++ asn_internal.h asn_system.h asn_compare.h \ ber_decoder.c ber_decoder.h \ ber_tlv_length.c ber_tlv_length.h \ - ber_tlv_tag.c ber_tlv_tag.h \ +- ber_tlv_tag.c ber_tlv_tag.h \ - constr_CHOICE.c constr_CHOICE.h \ ++ ber_tlv_tag.c ber_tlv_tag.h compare.h \ + comparison.h constr_CHOICE.c constr_CHOICE.h \ constr_SEQUENCE.c constr_SEQUENCE.h \ constr_SEQUENCE_OF.c constr_SEQUENCE_OF.h \ constr_SET.c constr_SET.h \ ---- ./skeletons/NativeEnumerated.c 2015-12-03 09:43:33.967009150 +0100 -+++ ./skeletons/NativeEnumerated.c 2015-11-30 13:18:32.015264136 +0100 +--- skeletons/NativeEnumerated.c 2015-12-08 14:39:33.342543533 +0100 ++++ skeletons/NativeEnumerated.c 2015-12-08 10:41:17.662558000 +0100 @@ -31,7 +31,8 @@ NativeEnumerated_decode_uper, NativeEnumerated_encode_uper, @@ -640,34 +851,31 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_NativeEnumerated_tags, sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]), -@@ -335,3 +336,25 @@ +@@ -335,3 +336,22 @@ _ASN_ENCODED_OK(er); } + -+long ++asn_comp_rval_t * +NativeEnumerated_compare(asn_TYPE_descriptor_t *td1, void *sptr1, + asn_TYPE_descriptor_t *td2, void *sptr2) { + const asn_INTEGER_enum_map_t *a = sptr1; + const asn_INTEGER_enum_map_t *b = sptr2; -+ if ((td1) && (td2)) { -+ if ((td1->name) && (td2->name)) { -+ if (strcmp(td1->name, td2->name)) return -1; -+ } else { -+ if ((td1->xml_tag) && (td2->xml_tag)) { -+ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; -+ } -+ } -+ } ++ asn_comp_rval_t *res = NULL; ++ ++ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res) + + if(a->nat_value == b->nat_value) -+ return 0; -+ if(a->nat_value < b->nat_value) -+ return -1; -+ return 1; ++ return NULL; ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_NO_MATCH; ++ return res; +} ---- ./skeletons/NativeEnumerated.h 2015-12-03 09:43:33.967009150 +0100 -+++ ./skeletons/NativeEnumerated.h 2015-11-26 14:51:43.315616133 +0100 +--- skeletons/NativeEnumerated.h 2015-12-08 14:39:33.342543533 +0100 ++++ skeletons/NativeEnumerated.h 2015-11-26 14:51:43.315616000 +0100 @@ -26,6 +26,7 @@ per_type_encoder_f NativeEnumerated_encode_uper; per_type_decoder_f NativeEnumerated_decode_aper; @@ -676,8 +884,8 @@ #ifdef __cplusplus } ---- ./skeletons/NativeInteger.c 2015-12-03 09:43:33.967009150 +0100 -+++ ./skeletons/NativeInteger.c 2015-11-30 13:18:39.887264128 +0100 +--- skeletons/NativeInteger.c 2015-12-08 14:39:33.346543533 +0100 ++++ skeletons/NativeInteger.c 2015-12-08 10:41:24.550558000 +0100 @@ -32,7 +32,8 @@ NativeInteger_decode_uper, /* Unaligned PER decoder */ NativeInteger_encode_uper, /* Unaligned PER encoder */ @@ -688,29 +896,30 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_NativeInteger_tags, sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]), -@@ -410,3 +411,20 @@ +@@ -410,3 +411,21 @@ } } + -+long ++asn_comp_rval_t * +NativeInteger_compare(asn_TYPE_descriptor_t *td1, void *sptr1, + asn_TYPE_descriptor_t *td2, void *sptr2) { + const long *native1 = (const long *)sptr1; + const long *native2 = (const long *)sptr2; -+ if ((td1) && (td2)) { -+ if ((td1->name) && (td2->name)) { -+ if (strcmp(td1->name, td2->name)) return -1; -+ } else { -+ if ((td1->xml_tag) && (td2->xml_tag)) { -+ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; -+ } -+ } -+ } -+ return (*native1 != *native2); ++ asn_comp_rval_t *res = NULL; ++ ++ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res) ++ ++ if (*native1 == *native2) return NULL; ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_NO_MATCH; ++ return res; +} ---- ./skeletons/NativeInteger.h 2015-12-03 09:43:33.971009150 +0100 -+++ ./skeletons/NativeInteger.h 2015-11-26 14:52:13.931616101 +0100 +--- skeletons/NativeInteger.h 2015-12-08 14:39:33.346543533 +0100 ++++ skeletons/NativeInteger.h 2015-11-26 14:52:13.931616000 +0100 @@ -31,6 +31,7 @@ per_type_encoder_f NativeInteger_encode_uper; per_type_decoder_f NativeInteger_decode_aper; @@ -719,8 +928,8 @@ #ifdef __cplusplus } ---- ./skeletons/NativeReal.c 2015-12-03 09:43:33.971009150 +0100 -+++ ./skeletons/NativeReal.c 2015-11-30 13:18:46.655264121 +0100 +--- skeletons/NativeReal.c 2015-12-08 14:39:33.350543533 +0100 ++++ skeletons/NativeReal.c 2015-12-08 10:41:32.666558000 +0100 @@ -33,7 +33,8 @@ NativeReal_decode_uper, NativeReal_encode_uper, @@ -731,30 +940,39 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_NativeReal_tags, sizeof(asn_DEF_NativeReal_tags) / sizeof(asn_DEF_NativeReal_tags[0]), -@@ -405,3 +406,21 @@ +@@ -405,3 +406,30 @@ } } -+long ++asn_comp_rval_t * +NativeReal_compare(asn_TYPE_descriptor_t *td1, void *sptr1, + asn_TYPE_descriptor_t *td2, void *sptr2) { + REAL_t *st1 = (REAL_t *)sptr1; + REAL_t *st2 = (REAL_t *)sptr2; ++ asn_comp_rval_t *res = NULL; + -+ if ((td1) && (td2)) { -+ if ((td1->name) && (td2->name)) { -+ if (strcmp(td1->name, td2->name)) return -1; -+ } else { -+ if ((td1->xml_tag) && (td2->xml_tag)) { -+ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; -+ } -+ } ++ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res) ++ ++ if (st1->size != st2->size) { ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_NO_MATCH; ++ return res; + } -+ if (st1->size != st2->size) return -1; -+ return memcmp(st1->buf, st2->buf, st1->size); ++ if (0 != memcmp(st1->buf, st2->buf, st1->size)) { ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_NO_MATCH; ++ return res; ++ } ++ return NULL; +} ---- ./skeletons/NativeReal.h 2015-12-03 09:43:33.971009150 +0100 -+++ ./skeletons/NativeReal.h 2015-11-26 14:31:12.631617407 +0100 +--- skeletons/NativeReal.h 2015-12-08 14:39:33.350543533 +0100 ++++ skeletons/NativeReal.h 2015-11-26 14:31:12.631617000 +0100 @@ -29,6 +29,7 @@ per_type_encoder_f NativeReal_encode_uper; per_type_decoder_f NativeReal_decode_aper; @@ -763,8 +981,8 @@ #ifdef __cplusplus } ---- ./skeletons/NULL.c 2015-12-03 09:43:33.963009150 +0100 -+++ ./skeletons/NULL.c 2015-11-30 13:18:53.047264114 +0100 +--- skeletons/NULL.c 2015-12-08 14:39:33.338543533 +0100 ++++ skeletons/NULL.c 2015-12-07 10:49:05.178647000 +0100 @@ -26,7 +26,8 @@ NULL_decode_uper, /* Unaligned PER decoder */ NULL_encode_uper, /* Unaligned PER encoder */ @@ -780,14 +998,14 @@ _ASN_ENCODED_OK(er); } + -+long ++asn_comp_rval_t * +NULL_compare(asn_TYPE_descriptor_t *td1, void *sptr1, + asn_TYPE_descriptor_t *td2, void *sptr2) { + -+ return 0; ++ return NULL; +} ---- ./skeletons/NULL.h 2015-12-03 09:43:33.963009150 +0100 -+++ ./skeletons/NULL.h 2015-11-26 14:53:03.875616050 +0100 +--- skeletons/NULL.h 2015-12-08 14:39:33.338543533 +0100 ++++ skeletons/NULL.h 2015-11-26 14:53:03.875616000 +0100 @@ -27,6 +27,7 @@ per_type_encoder_f NULL_encode_uper; per_type_decoder_f NULL_decode_aper; @@ -796,8 +1014,8 @@ #ifdef __cplusplus } ---- ./skeletons/NumericString.c 2015-12-03 09:43:33.963009150 +0100 -+++ ./skeletons/NumericString.c 2015-11-26 14:40:39.407616820 +0100 +--- skeletons/NumericString.c 2015-12-08 14:39:33.338543533 +0100 ++++ skeletons/NumericString.c 2015-11-26 14:40:39.407616000 +0100 @@ -50,7 +50,8 @@ OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, @@ -808,8 +1026,8 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_NumericString_tags, sizeof(asn_DEF_NumericString_tags) ---- ./skeletons/ObjectDescriptor.c 2015-12-03 09:43:33.963009150 +0100 -+++ ./skeletons/ObjectDescriptor.c 2015-11-26 14:55:46.227615882 +0100 +--- skeletons/ObjectDescriptor.c 2015-12-08 14:39:33.338543533 +0100 ++++ skeletons/ObjectDescriptor.c 2015-11-26 14:55:46.227615000 +0100 @@ -25,7 +25,8 @@ OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, @@ -820,8 +1038,8 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_ObjectDescriptor_tags, sizeof(asn_DEF_ObjectDescriptor_tags) ---- ./skeletons/OBJECT_IDENTIFIER.c 2015-12-03 09:43:33.967009150 +0100 -+++ ./skeletons/OBJECT_IDENTIFIER.c 2015-11-26 14:55:13.311615916 +0100 +--- skeletons/OBJECT_IDENTIFIER.c 2015-12-08 14:39:33.342543533 +0100 ++++ skeletons/OBJECT_IDENTIFIER.c 2015-11-26 14:55:13.311615000 +0100 @@ -28,7 +28,8 @@ OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, @@ -832,8 +1050,8 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_OBJECT_IDENTIFIER_tags, sizeof(asn_DEF_OBJECT_IDENTIFIER_tags) ---- ./skeletons/OCTET_STRING.c 2015-12-03 09:43:33.975009150 +0100 -+++ ./skeletons/OCTET_STRING.c 2015-11-30 13:19:18.271264088 +0100 +--- skeletons/OCTET_STRING.c 2015-12-08 14:39:44.554543521 +0100 ++++ skeletons/OCTET_STRING.c 2015-12-08 10:41:42.838558000 +0100 @@ -37,7 +37,8 @@ OCTET_STRING_decode_uper, /* Unaligned PER decoder */ OCTET_STRING_encode_uper, /* Unaligned PER encoder */ @@ -844,30 +1062,39 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_OCTET_STRING_tags, sizeof(asn_DEF_OCTET_STRING_tags) -@@ -2160,3 +2161,21 @@ +@@ -2160,3 +2161,30 @@ return st; } -+long ++asn_comp_rval_t * +OCTET_STRING_compare(asn_TYPE_descriptor_t *td1, + void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) { + OCTET_STRING_t *st1 = (OCTET_STRING_t *)sptr1; + OCTET_STRING_t *st2 = (OCTET_STRING_t *)sptr2; ++ asn_comp_rval_t *res = NULL; + -+ if ((td1) && (td2)) { -+ if ((td1->name) && (td2->name)) { -+ if (strcmp(td1->name, td2->name)) return -1; -+ } else { -+ if ((td1->xml_tag) && (td2->xml_tag)) { -+ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; -+ } -+ } ++ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res) ++ ++ if (st1->size != st2->size) { ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_NO_MATCH; ++ return res; + } -+ if (st1->size != st2->size) return -1; -+ return memcmp(st1->buf, st2->buf, st1->size); ++ if (0 != memcmp(st1->buf, st2->buf, st1->size)) { ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_NO_MATCH; ++ return res; ++ } ++ return NULL; +} ---- ./skeletons/OCTET_STRING.h 2015-12-03 09:43:33.971009150 +0100 -+++ ./skeletons/OCTET_STRING.h 2015-11-26 12:56:15.259623305 +0100 +--- skeletons/OCTET_STRING.h 2015-12-08 14:39:33.350543533 +0100 ++++ skeletons/OCTET_STRING.h 2015-11-26 12:56:15.259623000 +0100 @@ -34,6 +34,7 @@ per_type_encoder_f OCTET_STRING_encode_uper; per_type_decoder_f OCTET_STRING_decode_aper; @@ -876,8 +1103,8 @@ /****************************** * Handy conversion routines. * ---- ./skeletons/PrintableString.c 2015-12-03 09:43:33.963009150 +0100 -+++ ./skeletons/PrintableString.c 2015-11-26 14:56:09.787615857 +0100 +--- skeletons/PrintableString.c 2015-12-08 14:39:33.338543533 +0100 ++++ skeletons/PrintableString.c 2015-11-26 14:56:09.787615000 +0100 @@ -60,7 +60,8 @@ OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, @@ -888,8 +1115,8 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_PrintableString_tags, sizeof(asn_DEF_PrintableString_tags) ---- ./skeletons/REAL.c 2015-12-03 09:43:33.971009150 +0100 -+++ ./skeletons/REAL.c 2015-11-30 13:19:27.671264079 +0100 +--- skeletons/REAL.c 2015-12-08 14:39:33.350543533 +0100 ++++ skeletons/REAL.c 2015-12-08 10:41:55.178558000 +0100 @@ -46,7 +46,8 @@ REAL_decode_uper, REAL_encode_uper, @@ -900,32 +1127,41 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_REAL_tags, sizeof(asn_DEF_REAL_tags) / sizeof(asn_DEF_REAL_tags[0]), -@@ -741,3 +742,23 @@ +@@ -741,3 +742,32 @@ return 0; } + + -+long ++asn_comp_rval_t * +REAL_compare(asn_TYPE_descriptor_t *td1, void *sptr1, + asn_TYPE_descriptor_t *td2, void *sptr2) { + REAL_t *st1 = (REAL_t *)sptr1; + REAL_t *st2 = (REAL_t *)sptr2; ++ asn_comp_rval_t *res = NULL; + -+ if ((td1) && (td2)) { -+ if ((td1->name) && (td2->name)) { -+ if (strcmp(td1->name, td2->name)) return -1; -+ } else { -+ if ((td1->xml_tag) && (td2->xml_tag)) { -+ if (strcmp(td1->xml_tag, td2->xml_tag)) return -1; -+ } -+ } ++ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res) ++ ++ if (st1->size != st2->size) { ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_NO_MATCH; ++ return res; + } -+ if (st1->size != st2->size) return -1; -+ return memcmp(st1->buf, st2->buf, st1->size); ++ if (0 != memcmp(st1->buf, st2->buf, st1->size)) { ++ res = calloc(1, sizeof(asn_comp_rval_t)); ++ res->name = td1->name; ++ res->structure1 = sptr1; ++ res->structure2 = sptr2; ++ res->err_code = COMPARE_ERR_CODE_NO_MATCH; ++ return res; ++ } ++ return NULL; +} ---- ./skeletons/REAL.h 2015-12-03 09:43:33.971009150 +0100 -+++ ./skeletons/REAL.h 2015-11-26 13:00:46.183623025 +0100 +--- skeletons/REAL.h 2015-12-08 14:39:33.350543533 +0100 ++++ skeletons/REAL.h 2015-11-26 13:00:46.183623000 +0100 @@ -23,6 +23,7 @@ per_type_encoder_f REAL_encode_uper; per_type_decoder_f REAL_decode_aper; @@ -934,8 +1170,8 @@ /*********************************** * Some handy conversion routines. * ---- ./skeletons/RELATIVE-OID.c 2015-12-03 09:43:33.963009150 +0100 -+++ ./skeletons/RELATIVE-OID.c 2015-11-26 14:56:31.703615834 +0100 +--- skeletons/RELATIVE-OID.c 2015-12-08 14:39:33.338543533 +0100 ++++ skeletons/RELATIVE-OID.c 2015-11-26 14:56:31.703615000 +0100 @@ -29,7 +29,8 @@ OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, @@ -946,8 +1182,8 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_RELATIVE_OID_tags, sizeof(asn_DEF_RELATIVE_OID_tags) ---- ./skeletons/T61String.c 2015-12-03 09:43:33.963009150 +0100 -+++ ./skeletons/T61String.c 2015-11-26 14:57:07.235615798 +0100 +--- skeletons/T61String.c 2015-12-08 14:39:33.338543533 +0100 ++++ skeletons/T61String.c 2015-11-26 14:57:07.235615000 +0100 @@ -25,7 +25,8 @@ OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, @@ -958,8 +1194,8 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_T61String_tags, sizeof(asn_DEF_T61String_tags) ---- ./skeletons/TeletexString.c 2015-12-03 09:43:33.963009150 +0100 -+++ ./skeletons/TeletexString.c 2015-11-26 14:57:17.643615787 +0100 +--- skeletons/TeletexString.c 2015-12-08 14:39:33.338543533 +0100 ++++ skeletons/TeletexString.c 2015-11-26 14:57:17.643615000 +0100 @@ -25,7 +25,8 @@ OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, @@ -970,8 +1206,8 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_TeletexString_tags, sizeof(asn_DEF_TeletexString_tags) ---- ./skeletons/UniversalString.c 2015-12-03 09:43:33.971009150 +0100 -+++ ./skeletons/UniversalString.c 2015-11-26 14:57:29.015615775 +0100 +--- skeletons/UniversalString.c 2015-12-08 14:39:33.350543533 +0100 ++++ skeletons/UniversalString.c 2015-11-26 14:57:29.015615000 +0100 @@ -36,7 +36,8 @@ OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, @@ -982,8 +1218,8 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_UniversalString_tags, sizeof(asn_DEF_UniversalString_tags) ---- ./skeletons/UTCTime.c 2015-12-03 09:43:33.971009150 +0100 -+++ ./skeletons/UTCTime.c 2015-11-26 14:57:44.127615759 +0100 +--- skeletons/UTCTime.c 2015-12-08 14:39:33.350543533 +0100 ++++ skeletons/UTCTime.c 2015-11-26 14:57:44.127615000 +0100 @@ -41,7 +41,8 @@ OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, @@ -994,8 +1230,8 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_UTCTime_tags, sizeof(asn_DEF_UTCTime_tags) ---- ./skeletons/UTF8String.c 2015-12-03 09:43:33.959009150 +0100 -+++ ./skeletons/UTF8String.c 2015-11-26 14:06:54.563618917 +0100 +--- skeletons/UTF8String.c 2015-12-08 14:39:33.314543533 +0100 ++++ skeletons/UTF8String.c 2015-11-26 14:06:54.563618000 +0100 @@ -27,6 +27,7 @@ OCTET_STRING_encode_uper, OCTET_STRING_decode_aper, @@ -1004,8 +1240,8 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_UTF8String_tags, sizeof(asn_DEF_UTF8String_tags) ---- ./skeletons/VideotexString.c 2015-12-03 09:43:33.967009150 +0100 -+++ ./skeletons/VideotexString.c 2015-11-26 14:07:06.139618905 +0100 +--- skeletons/VideotexString.c 2015-12-08 14:39:33.342543533 +0100 ++++ skeletons/VideotexString.c 2015-11-26 14:07:06.139618000 +0100 @@ -25,7 +25,8 @@ OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */ OCTET_STRING_encode_uper, @@ -1016,8 +1252,8 @@ 0, /* Use generic outmost tag fetcher */ asn_DEF_VideotexString_tags, sizeof(asn_DEF_VideotexString_tags) ---- ./skeletons/VisibleString.c 2015-12-03 09:43:33.971009150 +0100 -+++ ./skeletons/VisibleString.c 2015-11-26 14:07:15.283618895 +0100 +--- skeletons/VisibleString.c 2015-12-08 14:39:33.350543533 +0100 ++++ skeletons/VisibleString.c 2015-11-26 14:07:15.283618000 +0100 @@ -30,7 +30,8 @@ OCTET_STRING_decode_uper, OCTET_STRING_encode_uper, diff --git a/openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py b/openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py index f5daf03c25..446266d6a3 100644 --- a/openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py +++ b/openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py @@ -36,7 +36,7 @@ def outputHeaderToFile(f, filename): f.write("""/******************************************************************************* Eurecom OpenAirInterface - Copyright(c) 1999 - 2013 Eurecom + Copyright(c) 1999 - 2015 Eurecom This program is free software; you can redistribute it and/or modify it under the terms and conditions of the GNU General Public License, @@ -267,7 +267,7 @@ for key in iesDefs: f.write(" * \\param %s Pointer to the ASN1 structure.\n" % (firstlower)) f.write(" * \\param %s Pointer to the ASN1 structure.\n" % (firstlower)) f.write(" **/\n") - f.write("long %s_compare_%s(\n" % (fileprefix, keylowerunderscore)) + f.write("asn_comp_rval_t * %s_compare_%s(\n" % (fileprefix, keylowerunderscore)) f.write(" %s_t *%s1,\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key)))) f.write(" %s_t *%s2);\n\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key)))) @@ -311,7 +311,7 @@ for key in iesDefs: f.write(" * \\param %s Pointer to the IES structure.\n" % (firstlower)) f.write(" * \\param %s Pointer to the IES structure.\n" % (firstlower)) f.write(" **/\n") - f.write("long %s_compare_%s(\n" % (fileprefix, firstlower.lower())) + f.write("asn_comp_rval_t * %s_compare_%s(\n" % (fileprefix, firstlower.lower())) f.write(" %sIEs_t *%s1,\n" % (asn1cStruct, firstlower)) f.write(" %sIEs_t *%s2);\n\n" % (asn1cStruct, firstlower)) @@ -761,11 +761,12 @@ for key in iesDefs: if len(iesDefs[key]["ies"]) == 0: continue - f.write("long %s_compare_%s(\n" % (fileprefix, re.sub('-', '_', structName.lower()))) + f.write("asn_comp_rval_t * %s_compare_%s(\n" % (fileprefix, re.sub('-', '_', structName.lower()))) f.write(" %s_t *%s1,\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key)))) f.write(" %s_t *%s2) {\n\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key)))) - f.write(" long rv = 0;\n\n") + f.write(" asn_comp_rval_t *rv = NULL;\n\n") + f.write(" asn_comp_rval_t *rv2 = NULL;\n\n") f.write(" assert(%s1 != NULL);\n" % (lowerFirstCamelWord(re.sub('-', '_', key)))); f.write(" assert(%s2 != NULL);\n" % (lowerFirstCamelWord(re.sub('-', '_', key)))); @@ -784,7 +785,7 @@ for key in iesDefs: if loop == 1: #f.write(" %s_IE_t *ie1 = NULL;\n" % (fileprefix_first_upper)) #f.write(" %s_IE_t *ie2 = NULL;\n" % (fileprefix_first_upper)) - f.write(" if (%s1->presenceMask != %s2->presenceMask) return -1;\n" % (lowerFirstCamelWord(re.sub('-', '_', key)), lowerFirstCamelWord(re.sub('-', '_', key)))) + f.write(" if (%s1->presenceMask != %s2->presenceMask) {rv=calloc(1,sizeof(asn_comp_rval_t));rv->name = asn_DEF_%s.name;rv->structure1 = %s1;rv->structure2 = %s2;rv->err_code = COMPARE_ERR_CODE_VALUE_NULL; return rv;}\n" % (lowerFirstCamelWord(re.sub('-', '_', key)), lowerFirstCamelWord(re.sub('-', '_', key)), ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), lowerFirstCamelWord(re.sub('-', '_', key)))) if ie[3] == "optional": f.write(" /* Optional field */\n") @@ -795,25 +796,61 @@ for key in iesDefs: if ie[2] in ieofielist.keys(): f.write(" /* collection field */\n") - f.write(" rv = %s_compare_%s(&%s1->%s, &%s2->%s);\n" % (fileprefix, ietypeunderscore.lower(), lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower )) - f.write(" if (rv != 0) {rv = rv << 8; rv |= %s_ProtocolIE_ID_id_%s; return rv;}\n" % (fileprefix_first_upper, ienameunderscore)) + f.write(" rv2 = %s_compare_%s(&%s1->%s, &%s2->%s);\n" % (fileprefix, ietypeunderscore.lower(), lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower )) + f.write(" if(rv2) {") + f.write(" if (NULL == rv) {") + f.write(" rv = rv2;") + f.write(" } else {") + f.write(" rv2->next = rv;") + f.write(" rv = rv2;") + f.write(" }") + f.write(" rv2 = NULL;") + f.write(" }") else: f.write(" /* simple field */\n") - f.write(" rv = asn_DEF_%s.compare(&asn_DEF_%s, &%s1->%s, &asn_DEF_%s, &%s2->%s); \n" % (ietypeunderscore, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower )) - f.write(" if (rv != 0) {rv = rv << 8; rv |= %s_ProtocolIE_ID_id_%s; return rv;}\n" % (fileprefix_first_upper, ienameunderscore)) + f.write(" rv2 = asn_DEF_%s.compare(&asn_DEF_%s, &%s1->%s, &asn_DEF_%s, &%s2->%s); \n" % (ietypeunderscore, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower )) + f.write(" if (rv2) {") + f.write(" if (NULL == rv) {") + f.write(" rv = rv2;") + f.write(" } else {") + f.write(" rv2->next = rv;") + f.write(" rv = rv2;") + f.write(" }") + f.write(" rv2 = NULL;") + f.write(" if (!rv->name) rv->name = asn_DEF_%s.name;" % (ietypeunderscore)) + f.write(" }") + f.write(" assert(0);\n"); f.write(" }\n\n") else: if ie[2] in ieofielist.keys(): f.write(" /* Mandatory collection field */\n") - f.write(" rv = %s_compare_%s(&%s1->%s, &%s2->%s);\n" % (fileprefix, ietypeunderscore.lower(), lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower )) - f.write(" if (rv != 0) {rv = rv << 8; rv |= %s_ProtocolIE_ID_id_%s; return rv;}\n" % (fileprefix_first_upper, ienameunderscore)) + f.write(" rv2 = %s_compare_%s(&%s1->%s, &%s2->%s);\n" % (fileprefix, ietypeunderscore.lower(), lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower )) + f.write(" if (rv2) {\n") + f.write(" if (NULL == rv) {\n") + f.write(" rv = rv2;\n") + f.write(" } else {\n") + f.write(" rv2->next = rv;\n") + f.write(" rv = rv2;\n") + f.write(" }\n") + f.write(" rv2 = NULL;\n") + f.write(" }\n") + else: f.write(" /* Mandatory simple field */\n") - f.write(" rv = asn_DEF_%s.compare(&asn_DEF_%s, &%s1->%s, &asn_DEF_%s, &%s2->%s);\n" % (ietypeunderscore, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower )) - f.write(" if (rv != 0) {rv = rv << 8; rv |= %s_ProtocolIE_ID_id_%s; return rv;}\n" % (fileprefix_first_upper, ienameunderscore)) - f.write(" return 0;\n") + f.write(" rv2 = asn_DEF_%s.compare(&asn_DEF_%s, &%s1->%s, &asn_DEF_%s, &%s2->%s);\n" % (ietypeunderscore, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower )) + f.write(" if(rv2) {\n") + f.write(" if (NULL == rv) {\n") + f.write(" rv = rv2;\n") + f.write(" } else {\n") + f.write(" rv2->next = rv;\n") + f.write(" rv = rv2;\n") + f.write(" }\n") + f.write(" rv2 = NULL;\n") + f.write(" if (!rv->name) rv->name = asn_DEF_%s.name;\n" % (ietypeunderscore)) + f.write(" }\n") + f.write(" return rv;\n") f.write("}\n\n") for (key, value) in iesDefs.items(): @@ -832,19 +869,29 @@ for (key, value) in iesDefs.items(): f.write("extern asn_TYPE_descriptor_t asn_DEF_%s;\n" % (ietypeunderscore)) - f.write("long %s_compare_%s(\n" % (fileprefix, re.sub('-', '_', i).lower())) + f.write("asn_comp_rval_t * %s_compare_%s(\n" % (fileprefix, re.sub('-', '_', i).lower())) f.write(" %sIEs_t *%sIEs1,\n" % (re.sub('-', '_', i), lowerFirstCamelWord(re.sub('-', '_', i)))) f.write(" %sIEs_t *%sIEs2) {\n\n" % (re.sub('-', '_', i), lowerFirstCamelWord(re.sub('-', '_', i)))) f.write(" int i;\n") - f.write(" long rv = 0;\n") + f.write(" asn_comp_rval_t *rv = NULL;\n\n") + f.write(" asn_comp_rval_t *rv2 = NULL;\n\n") + f.write(" assert(%sIEs1 != NULL);\n" % (lowerFirstCamelWord(re.sub('-', '_', i)))); f.write(" assert(%sIEs2 != NULL);\n\n" % (lowerFirstCamelWord(re.sub('-', '_', i)))); f.write(" for (i = 0; i < %sIEs1->%s.count; i++) {\n" % (lowerFirstCamelWord(re.sub('-', '_', i)), re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key))))) - f.write(" rv = asn_DEF_%s.compare(&asn_DEF_%s, %sIEs1->%s.array[i], &asn_DEF_%s, %sIEs2->%s.array[i]);\n" % (ietypeunderscore, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', i)), re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key))), ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', i)), re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key))))) - f.write(" if (rv != 0) return rv;\n") + f.write(" rv2 = asn_DEF_%s.compare(&asn_DEF_%s, %sIEs1->%s.array[i], &asn_DEF_%s, %sIEs2->%s.array[i]);\n" % (ietypeunderscore, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', i)), re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key))), ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', i)), re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key))))) + f.write(" if(rv2) {") + f.write(" if (NULL == rv) {") + f.write(" rv = rv2;") + f.write(" } else {") + f.write(" rv2->next = rv;") + f.write(" rv = rv2;") + f.write(" }") + f.write(" rv2 = NULL;") + f.write(" }") f.write(" }\n") - f.write(" return 0;\n") + f.write(" return rv;\n") f.write("}\n\n") diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index 1aab216428..133e9adf4b 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -286,14 +286,26 @@ const char * const et_chunk_type_cid2str(const sctp_cid_t chunk_type) const char * const et_error_match2str(const int err) { switch (err) { - case -ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE: return "SCTP_CHUNK_TYPE"; break; - case -ET_ERROR_MATCH_PACKET_SCTP_PPID: return "SCTP_PPID"; break; - case -ET_ERROR_MATCH_PACKET_SCTP_ASSOC_ID: return "SCTP_ASSOC_ID"; break; - case -ET_ERROR_MATCH_PACKET_SCTP_STREAM_ID: return "SCTP_STREAM_ID"; break; - case -ET_ERROR_MATCH_PACKET_SCTP_SSN: return "SCTP_SSN"; break; - case -ET_ERROR_MATCH_PACKET_S1AP_PRESENT: return "S1AP_PRESENT"; break; - case -ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE: return "S1AP_PROCEDURE_CODE"; break; - case -ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY: return "S1AP_CRITICALITY"; break; + // from asn_compare.h + case COMPARE_ERR_CODE_NO_MATCH: return "CODE_NO_MATCH"; break; + case COMPARE_ERR_CODE_TYPE_MISMATCH: return "TYPE_MISMATCH"; break; + case COMPARE_ERR_CODE_TYPE_ARG_NULL: return "TYPE_ARG_NULL"; break; + case COMPARE_ERR_CODE_VALUE_NULL: return "VALUE_NULL"; break; + case COMPARE_ERR_CODE_VALUE_ARG_NULL: return "VALUE_ARG_NULL"; break; + case COMPARE_ERR_CODE_CHOICE_NUM: return "CHOICE_NUM"; break; + case COMPARE_ERR_CODE_CHOICE_PRESENT: return "CHOICE_PRESENT"; break; + case COMPARE_ERR_CODE_CHOICE_MALFORMED: return "CHOICE_MALFORMED"; break; + case COMPARE_ERR_CODE_SET_MALFORMED: return "SET_MALFORMED"; break; + case COMPARE_ERR_CODE_COLLECTION_NUM_ELEMENTS: return "COLLECTION_NUM_ELEMENTS"; break; + // from play_scenario.h + case ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE: return "SCTP_CHUNK_TYPE"; break; + case ET_ERROR_MATCH_PACKET_SCTP_PPID: return "SCTP_PPID"; break; + case ET_ERROR_MATCH_PACKET_SCTP_ASSOC_ID: return "SCTP_ASSOC_ID"; break; + case ET_ERROR_MATCH_PACKET_SCTP_STREAM_ID: return "SCTP_STREAM_ID"; break; + case ET_ERROR_MATCH_PACKET_SCTP_SSN: return "SCTP_SSN"; break; + case ET_ERROR_MATCH_PACKET_S1AP_PRESENT: return "S1AP_PRESENT"; break; + case ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE: return "S1AP_PROCEDURE_CODE"; break; + case ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY: return "S1AP_CRITICALITY"; break; default: AssertFatal (0, "ERROR: Unknown match error %d!(TODO handle an1c error codes)\n", err); } @@ -792,9 +804,9 @@ static void et_usage ( fprintf (stdout, "Please report any bug to: %s\n",PACKAGE_BUGREPORT); fprintf (stdout, "Usage: %s [options]\n\n", argv[0]); fprintf (stdout, "\n"); - fprintf (stdout, "Client options:\n"); - fprintf (stdout, "\t-S | --server File name (with no path) of a test scenario that has to be replayed (TODO in future?)\n"); - fprintf (stdout, "Server options:\n"); + //fprintf (stdout, "Client options:\n"); + //fprintf (stdout, "\t-S | --server File name (with no path) of a test scenario that has to be replayed (TODO in future?)\n"); + //fprintf (stdout, "Server options:\n"); fprintf (stdout, "\t-d | --test-dir Directory where a set of files related to a particular test are located\n"); fprintf (stdout, "\t-c | --enb-conf-file Provide an eNB config file, valid for the testbed\n"); fprintf (stdout, "\t-s | --scenario File name (with no path) of a test scenario that has to be replayed ()\n"); diff --git a/openair3/TEST/EPC_TEST/play_scenario.h b/openair3/TEST/EPC_TEST/play_scenario.h index a926ea55e4..f44974dae0 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.h +++ b/openair3/TEST/EPC_TEST/play_scenario.h @@ -46,6 +46,7 @@ #include "s1ap_ies_defs.h" #include "play_scenario_s1ap_eNB_defs.h" #include "hashtable.h" +#include "asn_compare.h" // powers of 2 #define ET_BIT_MASK_MATCH_SCTP_STREAM 1 @@ -179,8 +180,10 @@ typedef enum { ET_FSM_STATE_END } et_fsm_state_t; +enum COMPARE_ERR_CODE_e; + typedef enum { - ET_ERROR_MATCH_START = 1, + ET_ERROR_MATCH_START = COMPARE_ERR_CODE_END, ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE = ET_ERROR_MATCH_START, ET_ERROR_MATCH_PACKET_SCTP_PPID, ET_ERROR_MATCH_PACKET_SCTP_ASSOC_ID, @@ -415,7 +418,8 @@ void et_s1ap_eNB_insert_new_instance(s1ap_eNB_instance_t *new_instance_p); struct s1ap_eNB_mme_data_s *et_s1ap_eNB_get_MME(s1ap_eNB_instance_t *instance_p,int32_t assoc_id, uint16_t cnx_id); s1ap_eNB_instance_t *et_s1ap_eNB_get_instance(instance_t instance); void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,uint32_t buffer_length, uint16_t stream); -long et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints); +int et_handle_s1ap_mismatch(et_packet_t * const spacket, et_packet_t * const rx_packet); +asn_comp_rval_t* et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints); et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const s1ap_data_ind); int et_scenario_set_packet_received(et_packet_t * const packet); int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const sctp_data_ind); @@ -451,10 +455,10 @@ void et_parse_sctp(xmlDocPtr doc, const xmlNode const *sctp_node, et_sctp_hdr_t et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node); et_scenario_t* et_generate_scenario(const char * const et_scenario_filename ); //------------------------- -long et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, s1ap_message * const m2, const uint32_t constraints); +asn_comp_rval_t * et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, s1ap_message * const m2, const uint32_t constraints); //------------------------- -long et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * const sctp2, const uint32_t constraints); -long et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t * const sctp2, const uint32_t constraints); +asn_comp_rval_t * et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * const sctp2, const uint32_t constraints); +asn_comp_rval_t * et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t * const sctp2, const uint32_t constraints); //------------------------------------------------------------------------------ void et_print_hex_octets(const unsigned char * const byte_stream, const unsigned long int num); int et_is_file_exists ( const char const * file_nameP, const char const *file_roleP); diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c index df26de97c2..d58b16c2d3 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c @@ -189,30 +189,363 @@ void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, itti_send_msg_to_task(TASK_SCTP, instance, message_p); } //------------------------------------------------------------------------------ -long et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints) +int et_handle_s1ap_mismatch(et_packet_t * const spacket, et_packet_t * const rx_packet) { - if (s1ap1->pdu.present != s1ap2->pdu.present) return -ET_ERROR_MATCH_PACKET_S1AP_PRESENT; + S1ap_MME_UE_S1AP_ID_t scenario_mme_ue_s1ap_id = 0; + S1ap_MME_UE_S1AP_ID_t rx_mme_ue_s1ap_id = 0; + S1AP_PDU_PR present; + + present = rx_packet->sctp_hdr.u.data_hdr.payload.pdu.present; + + switch (rx_packet->sctp_hdr.u.data_hdr.payload.message.procedureCode) { + case S1ap_ProcedureCode_id_HandoverPreparation: + if (present == S1AP_PDU_PR_initiatingMessage) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequiredIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequiredIEs.mme_ue_s1ap_id; + } else { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverCommandIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverCommandIEs.mme_ue_s1ap_id; + } + break; + + case S1ap_ProcedureCode_id_HandoverResourceAllocation: + if (present == S1AP_PDU_PR_initiatingMessage) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequestIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequestIEs.mme_ue_s1ap_id; + } else if (present == S1AP_PDU_PR_successfulOutcome) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequestAcknowledgeIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequestAcknowledgeIEs.mme_ue_s1ap_id; + } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverFailureIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverFailureIEs.mme_ue_s1ap_id; + } + break; + + case S1ap_ProcedureCode_id_HandoverNotification: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverNotifyIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverNotifyIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_PathSwitchRequest: + //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PathSwitchRequestIEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PathSwitchRequestIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_HandoverCancel: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverCancelIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverCancelIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_E_RABSetup: + if (present == S1AP_PDU_PR_initiatingMessage) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABSetupRequestIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABSetupRequestIEs.mme_ue_s1ap_id; + } else { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABSetupResponseIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABSetupResponseIEs.mme_ue_s1ap_id; + } + break; + + case S1ap_ProcedureCode_id_E_RABModify: + if (present == S1AP_PDU_PR_initiatingMessage) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABModifyRequestIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABModifyRequestIEs.mme_ue_s1ap_id; + } else { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABModifyResponseIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABModifyResponseIEs.mme_ue_s1ap_id; + } + break; + + case S1ap_ProcedureCode_id_E_RABRelease: + if (present == S1AP_PDU_PR_initiatingMessage) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseCommandIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseCommandIEs.mme_ue_s1ap_id; + } else { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseResponseIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseResponseIEs.mme_ue_s1ap_id; + } + break; + + case S1ap_ProcedureCode_id_E_RABReleaseIndication: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseIndicationIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseIndicationIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_InitialContextSetup: + if (present == S1AP_PDU_PR_initiatingMessage) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialContextSetupRequestIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialContextSetupRequestIEs.mme_ue_s1ap_id; + } else { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialContextSetupResponseIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialContextSetupResponseIEs.mme_ue_s1ap_id; + } + break; + + case S1ap_ProcedureCode_id_Paging: + //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PagingIEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PagingIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_downlinkNASTransport: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNASTransportIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNASTransportIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_initialUEMessage: + //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialUEMessageIEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialUEMessageIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_uplinkNASTransport: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNASTransportIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNASTransportIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_Reset: + //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ResetIEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ResetIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_ErrorIndication: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ErrorIndicationIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ErrorIndicationIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_NASNonDeliveryIndication: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_NASNonDeliveryIndication_IEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_NASNonDeliveryIndication_IEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_S1Setup: + /*if (present == S1AP_PDU_PR_initiatingMessage) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupRequestIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupRequestIEs.mme_ue_s1ap_id; + } else if (present == S1AP_PDU_PR_successfulOutcome) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupResponseIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupResponseIEs.mme_ue_s1ap_id; + } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupFailureIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupFailureIEs.mme_ue_s1ap_id; + }*/ + break; + + case S1ap_ProcedureCode_id_UEContextReleaseRequest: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseRequestIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseRequestIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_DownlinkS1cdma2000tunneling: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkS1cdma2000tunnelingIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkS1cdma2000tunnelingIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_UplinkS1cdma2000tunneling: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkS1cdma2000tunnelingIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkS1cdma2000tunnelingIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_UEContextModification: + if (present == S1AP_PDU_PR_initiatingMessage) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationRequestIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationRequestIEs.mme_ue_s1ap_id; + } else if (present == S1AP_PDU_PR_successfulOutcome) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationResponseIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationResponseIEs.mme_ue_s1ap_id; + } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationFailureIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationFailureIEs.mme_ue_s1ap_id; + } + break; + + case S1ap_ProcedureCode_id_UECapabilityInfoIndication: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UECapabilityInfoIndicationIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UECapabilityInfoIndicationIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_UEContextRelease: + if (present == S1AP_PDU_PR_initiatingMessage) { + //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.mme_ue_s1ap_id; + } else { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCompleteIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCompleteIEs.mme_ue_s1ap_id; + } + break; + + case S1ap_ProcedureCode_id_eNBStatusTransfer: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBStatusTransferIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBStatusTransferIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_MMEStatusTransfer: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEStatusTransferIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEStatusTransferIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_DeactivateTrace: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DeactivateTraceIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DeactivateTraceIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_TraceStart: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_TraceStartIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_TraceStartIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_TraceFailureIndication: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_TraceFailureIndicationIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_TraceFailureIndicationIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_ENBConfigurationUpdate: + /*if (present == S1AP_PDU_PR_initiatingMessage) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateIEs.mme_ue_s1ap_id; + } else if (present == S1AP_PDU_PR_successfulOutcome) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id; + } else { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateFailureIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateFailureIEs.mme_ue_s1ap_id; + }*/ + break; + + case S1ap_ProcedureCode_id_MMEConfigurationUpdate: + /*if (present == S1AP_PDU_PR_initiatingMessage) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateIEs.mme_ue_s1ap_id; + } else if (present == S1AP_PDU_PR_successfulOutcome) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id; + } else { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateFailureIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateFailureIEs.mme_ue_s1ap_id; + }*/ + break; + + case S1ap_ProcedureCode_id_LocationReportingControl: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportingControlIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportingControlIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_LocationReportingFailureIndication: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportingFailureIndicationIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportingFailureIndicationIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_LocationReport: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_OverloadStart: + //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStartIEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStartIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_OverloadStop: + //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStopIEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStopIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_WriteReplaceWarning: + /*if (present == S1AP_PDU_PR_initiatingMessage) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningRequestIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningRequestIEs.mme_ue_s1ap_id; + } else { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningResponseIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningResponseIEs.mme_ue_s1ap_id; + }*/ + break; + + case S1ap_ProcedureCode_id_eNBDirectInformationTransfer: + //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBDirectInformationTransferIEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBDirectInformationTransferIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_MMEDirectInformationTransfer: + //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEDirectInformationTransferIEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEDirectInformationTransferIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_PrivateMessage: + case S1ap_ProcedureCode_id_eNBConfigurationTransfer: + case S1ap_ProcedureCode_id_MMEConfigurationTransfer: + AssertFatal(0, "TODO"); + break; + + case S1ap_ProcedureCode_id_CellTrafficTrace: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_CellTrafficTraceIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_CellTrafficTraceIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_Kill: + /*if (present == S1AP_PDU_PR_initiatingMessage) { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillRequestIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillRequestIEs.mme_ue_s1ap_id; + } else { + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillResponseIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillResponseIEs.mme_ue_s1ap_id; + }*/ + break; + + case S1ap_ProcedureCode_id_downlinkUEAssociatedLPPaTransport: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_uplinkUEAssociatedLPPaTransport: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_downlinkNonUEAssociatedLPPaTransport: + //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_uplinkNonUEAssociatedLPPaTransport: + //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; + break; + + default: + AssertFatal(0, "Unknown procedure code %ld", rx_packet->sctp_hdr.u.data_hdr.payload.message.procedureCode); + } + return 0; +} +//------------------------------------------------------------------------------ +asn_comp_rval_t * et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints) +{ + asn_comp_rval_t *rv = NULL; + if (s1ap1->pdu.present != s1ap2->pdu.present) {rv = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_PRESENT; return rv;} switch (s1ap1->pdu.present) { case S1AP_PDU_PR_NOTHING: break; case S1AP_PDU_PR_initiatingMessage: - if (s1ap1->pdu.choice.initiatingMessage.procedureCode != s1ap2->pdu.choice.initiatingMessage.procedureCode) return -ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE; - if (s1ap1->pdu.choice.initiatingMessage.criticality != s1ap2->pdu.choice.initiatingMessage.criticality) return -ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY; + if (s1ap1->pdu.choice.initiatingMessage.procedureCode != s1ap2->pdu.choice.initiatingMessage.procedureCode) + {rv = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE; return rv;} + if (s1ap1->pdu.choice.initiatingMessage.criticality != s1ap2->pdu.choice.initiatingMessage.criticality) + {rv = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY; return rv;} break; case S1AP_PDU_PR_successfulOutcome: - if (s1ap1->pdu.choice.successfulOutcome.procedureCode != s1ap2->pdu.choice.successfulOutcome.procedureCode) return -ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE; - if (s1ap1->pdu.choice.successfulOutcome.criticality != s1ap2->pdu.choice.successfulOutcome.criticality) return -ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY; + if (s1ap1->pdu.choice.successfulOutcome.procedureCode != s1ap2->pdu.choice.successfulOutcome.procedureCode) + {rv = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE; return rv;} + if (s1ap1->pdu.choice.successfulOutcome.criticality != s1ap2->pdu.choice.successfulOutcome.criticality) + {rv = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY; return rv;} break; case S1AP_PDU_PR_unsuccessfulOutcome: - if (s1ap1->pdu.choice.unsuccessfulOutcome.procedureCode != s1ap2->pdu.choice.unsuccessfulOutcome.procedureCode) return -ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE; - if (s1ap1->pdu.choice.unsuccessfulOutcome.criticality != s1ap2->pdu.choice.unsuccessfulOutcome.criticality) return -ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY; + if (s1ap1->pdu.choice.unsuccessfulOutcome.procedureCode != s1ap2->pdu.choice.unsuccessfulOutcome.procedureCode) + {rv = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE; return rv;} + if (s1ap1->pdu.choice.unsuccessfulOutcome.criticality != s1ap2->pdu.choice.unsuccessfulOutcome.criticality) + {rv = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY; return rv;} break; default: AssertFatal(0, "Unknown pdu.present %d", s1ap1->pdu.present); } if (s1ap1->binary_stream_allocated_size == s1ap2->binary_stream_allocated_size) { - if (memcmp((void*)s1ap1->binary_stream, (void*)s1ap2->binary_stream, s1ap1->binary_stream_allocated_size) == 0) return 0; + if (memcmp((void*)s1ap1->binary_stream, (void*)s1ap2->binary_stream, s1ap1->binary_stream_allocated_size) == 0) return NULL; } // if no matching, may be the scenario need minor corrections (same enb_ue_s1ap_id but need to update mme_ue_s1ap_id) return et_s1ap_ies_is_matching(s1ap1->pdu.present, &s1ap1->message, &s1ap2->message, constraints); @@ -284,10 +617,12 @@ int et_scenario_set_packet_received(et_packet_t * const packet) //------------------------------------------------------------------------------ int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) { - et_packet_t * packet = NULL; - et_packet_t * rx_packet = NULL; - unsigned long int not_found = 1; - long rv = 0; + et_packet_t *packet = NULL; + et_packet_t *rx_packet = NULL; + unsigned long int not_found = 1; + asn_comp_rval_t *comp_results = NULL; + asn_comp_rval_t *comp_results2 = NULL; + unsigned char error_code = 0; AssertFatal (NULL != s1ap_data_ind, "Bad parameter sctp_data_ind\n"); rx_packet = et_build_packet_from_s1ap_data_ind(s1ap_data_ind); @@ -317,20 +652,35 @@ int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) // not_found threshold may sure depend on number of mme, may be not sure on number of UE while ((NULL != packet) && (not_found < 5)) { if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { - rv = et_sctp_is_matching(&packet->sctp_hdr, &rx_packet->sctp_hdr, g_constraints); - if (0 == rv) { + comp_results = et_sctp_is_matching(&packet->sctp_hdr, &rx_packet->sctp_hdr, g_constraints); + if (NULL == comp_results) { S1AP_DEBUG("Compare RX packet with packet: num %u | original frame number %u \n", packet->packet_number, packet->original_frame_number); packet->timestamp_packet.tv_sec = rx_packet->timestamp_packet.tv_sec; packet->timestamp_packet.tv_usec = rx_packet->timestamp_packet.tv_usec; return et_scenario_set_packet_received(packet); } else { - S1AP_DEBUG("Compare RX packet with packet: num %u | original frame number %u failed:%s\n", - packet->packet_number, packet->original_frame_number, et_error_match2str(rv)); - // asn1 compare no match return code, may not collide with non asn1 error return codes - // (each asn1 rc <= 166 (enum e_S1ap_ProtocolIE_ID, in generated file S1ap_ProtocolIE_ID.h)) - if ((rv > 0) || (rv <= -ET_ERROR_MATCH_END)) { - //TODO MME_UE_S1AP_ID, etc. - AssertFatal(0,"Some work needed there"); + S1AP_DEBUG("Compare RX packet with packet: num %u | original frame number %u failed\n", + packet->packet_number, packet->original_frame_number); + while (comp_results) { + S1AP_DEBUG("Result err code %s(%u) ASN1 struct name %s\n", + et_error_match2str(comp_results->err_code), comp_results->err_code, comp_results->name); + // (each asn1 rc <= 166 (enum e_S1ap_ProtocolIE_ID, in generated file S1ap_ProtocolIE_ID.h)) + if (comp_results->err_code == COMPARE_ERR_CODE_NO_MATCH) { + //TODO MME_UE_S1AP_ID, etc. + // get latest error code + if (strcmp(comp_results->name, "S1ap-MME-UE-S1AP-ID") == 0) { + if (0 == et_handle_s1ap_mismatch((et_packet_t *const)packet, (et_packet_t *const)rx_packet)) { + packet->timestamp_packet.tv_sec = rx_packet->timestamp_packet.tv_sec; + packet->timestamp_packet.tv_usec = rx_packet->timestamp_packet.tv_usec; + return et_scenario_set_packet_received(packet); + } + } else { + AssertFatal(0,"Some work needed there"); + } + } + comp_results2 = comp_results; + comp_results = comp_results2->next; + et_free_pointer(comp_results2); } } } diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c index 5300476e98..213be2b347 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c @@ -58,9 +58,9 @@ extern et_scenario_t *g_scenario; extern uint32_t g_constraints; //------------------------------------------------------------------------------ -long et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, s1ap_message * const m2, const uint32_t constraints) +asn_comp_rval_t * et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, s1ap_message * const m2, const uint32_t constraints) { - long ret = 0; + asn_comp_rval_t *ret = NULL; AssertFatal(m1 != NULL, "bad parameter m1"); AssertFatal(m2 != NULL, "bad parameter m2"); AssertFatal((present == S1AP_PDU_PR_initiatingMessage) || @@ -401,6 +401,8 @@ long et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, case S1ap_ProcedureCode_id_PrivateMessage: case S1ap_ProcedureCode_id_eNBConfigurationTransfer: case S1ap_ProcedureCode_id_MMEConfigurationTransfer: + AssertFatal(0, "TODO"); + break; case S1ap_ProcedureCode_id_CellTrafficTrace: ret = s1ap_compare_s1ap_celltraffictraceies( diff --git a/openair3/TEST/EPC_TEST/play_scenario_sctp.c b/openair3/TEST/EPC_TEST/play_scenario_sctp.c index 07206f53b8..181009c2c9 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_sctp.c +++ b/openair3/TEST/EPC_TEST/play_scenario_sctp.c @@ -44,27 +44,36 @@ #include "play_scenario.h" //------------------------------------------------------------------------------ -long et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * const sctp2, const uint32_t constraints) +asn_comp_rval_t * et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * const sctp2, const uint32_t constraints) { + asn_comp_rval_t *rv = NULL; // no comparison for ports if (sctp1->ppid != sctp2->ppid) { S1AP_WARN("No Matching SCTP PPID %u %u\n", sctp1->ppid, sctp2->ppid); - return -ET_ERROR_MATCH_PACKET_SCTP_PPID; + rv = calloc(1, sizeof(asn_comp_rval_t)); + rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_PPID; + return rv; } if (sctp1->assoc_id != sctp2->assoc_id) { S1AP_WARN("No Matching SCTP assoc id %u %u\n", sctp1->assoc_id, sctp2->assoc_id); - return -ET_ERROR_MATCH_PACKET_SCTP_ASSOC_ID; + rv = calloc(1, sizeof(asn_comp_rval_t)); + rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_ASSOC_ID; + return rv; } if (sctp1->stream != sctp2->stream) { if (constraints & ET_BIT_MASK_MATCH_SCTP_STREAM) { - return -ET_ERROR_MATCH_PACKET_SCTP_STREAM_ID; + rv = calloc(1, sizeof(asn_comp_rval_t)); + rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_STREAM_ID; + return rv; } else { S1AP_WARN("No Matching SCTP stream %u %u\n", sctp1->stream, sctp2->stream); } } if (sctp1->ssn != sctp2->ssn) { if (constraints & ET_BIT_MASK_MATCH_SCTP_SSN) { - return -ET_ERROR_MATCH_PACKET_SCTP_SSN; + rv = calloc(1, sizeof(asn_comp_rval_t)); + rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_SSN; + return rv; } else { S1AP_WARN("No Matching SCTP STREAM SN %u %u\n", sctp1->ssn, sctp2->ssn); } @@ -73,10 +82,16 @@ long et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * con } //------------------------------------------------------------------------------ -long et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t * const sctp2, const uint32_t constraints) +asn_comp_rval_t * et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t * const sctp2, const uint32_t constraints) { // no comparison for ports - if (sctp1->chunk_type != sctp2->chunk_type) return -ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE; + asn_comp_rval_t *rv = NULL; + if (sctp1->chunk_type != sctp2->chunk_type){ + S1AP_WARN("No Matching chunk_type %u %u\n", sctp1->chunk_type, sctp2->chunk_type); + rv = calloc(1, sizeof(asn_comp_rval_t)); + rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE; + return rv; + } switch (sctp1->chunk_type) { case SCTP_CID_DATA: return et_sctp_data_is_matching(&sctp1->u.data_hdr, &sctp2->u.data_hdr, constraints); @@ -92,5 +107,5 @@ long et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t * const sctp AssertFatal(0, "Not needed now cid %d", sctp1->chunk_type); } - return 0; + return NULL; } From 5dbe3bef51e0e988ad4668d2aa17e5380bd00145 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 13 Dec 2015 07:57:04 -0800 Subject: [PATCH 022/214] debugging and testing of AVX2-optimized DFTS (radix 2/4 only). --- cmake_targets/CMakeLists.txt | 2 +- .../lte_dl_channel_estimation.c | 53 +- openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c | 24 +- openair1/PHY/MODULATION/ofdm_mod.c | 22 +- openair1/PHY/MODULATION/slot_fep.c | 30 +- openair1/PHY/TOOLS/Makefile | 16 +- openair1/PHY/TOOLS/lte_dfts.c | 526 +++++++++--------- openair1/PHY/TOOLS/twiddles8192.h | 12 + openair1/SIMULATION/LTE_PHY/dlsim.c | 18 +- 9 files changed, 378 insertions(+), 325 deletions(-) create mode 100644 openair1/PHY/TOOLS/twiddles8192.h diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 8ba602c25d..d8fd96353d 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -134,7 +134,7 @@ else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l") set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2") endif() if (CPUINFO MATCHES "sse4_2") - set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.2") + set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2 -msse4.2") endif() if (CPUINFO MATCHES "sse4_1") set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1") diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c index 10c0cef42a..b7356c7430 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c @@ -203,8 +203,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, multadd_complex_vector_real_scalar(dl_ch-(phy_vars_ue->lte_frame_parms.ofdm_symbol_size<<1), phy_vars_ue->ch_est_alpha,dl_ch-(phy_vars_ue->lte_frame_parms.ofdm_symbol_size<<1), 1,phy_vars_ue->lte_frame_parms.ofdm_symbol_size); - - +#ifdef DEBUG_CH + printf("k %d, first_carrier %d\n",k,phy_vars_ue->lte_frame_parms.first_carrier_offset); +#endif if ((phy_vars_ue->lte_frame_parms.N_RB_DL==6) || (phy_vars_ue->lte_frame_parms.N_RB_DL==50) || (phy_vars_ue->lte_frame_parms.N_RB_DL==100)) { @@ -213,7 +214,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, // Treat first 2 pilots specially (left edge) ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); - // printf("pilot 0 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#ifdef DEBUG_CH + printf("pilot 0 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#endif multadd_real_vector_complex_scalar(fl, ch, dl_ch, @@ -224,7 +227,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); - // printf("pilot 1 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#ifdef DEBUG_CH + printf("pilot 1 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#endif multadd_real_vector_complex_scalar(f2l2, ch, dl_ch, @@ -235,15 +240,13 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, for (pilot_cnt=2; pilot_cnt<((phy_vars_ue->lte_frame_parms.N_RB_DL)-1); pilot_cnt+=2) { - // printf("%d\n",dl_ch-(int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]); - - // printf("pilot[%d][%d] (%d,%d)\n",p,pilot_cnt,pil[0],pil[1]); - // printf("rx[%d] -> (%d,%d)\n", k, rxF[0], rxF[1]); ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); //Re ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); //Im - // printf("**rb %d %d\n",rb,dl_ch-(int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]); +#ifdef DEBUG_CH + printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#endif multadd_real_vector_complex_scalar(f, ch, dl_ch, @@ -254,13 +257,11 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, rxF+=12; dl_ch+=8; - // printf("pilot[%d][%d] (%d,%d)\n",p,rb,pil[0],pil[1]); - // printf("rx[%d] -> (%d,%d)\n", k+6, rxF[0], rxF[1]); - - ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); - // printf("**rb %d %d\n",rb,dl_ch-(int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]); +#ifdef DEBUG_CH + printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#endif multadd_real_vector_complex_scalar(f2, ch, dl_ch, @@ -281,15 +282,17 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, rxF = (int16_t *)&rxdataF[aarx][((symbol_offset+1+k))]; +#ifdef DEBUG_CH + printf("second half k %d\n",k); +#endif for (pilot_cnt=0; pilot_cnt<((phy_vars_ue->lte_frame_parms.N_RB_DL)-3); pilot_cnt+=2) { - // printf("pilot[%d][%d] (%d,%d)\n",p,pilot_cnt,pil[0],pil[1]); - // printf("rx[%d] -> (%d,%d)\n", k+6, rxF[0], rxF[1]); ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); - - // printf("**rb %d %d\n",rb,dl_ch-(int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]); +#ifdef DEBUG_CH + printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#endif multadd_real_vector_complex_scalar(f, ch, dl_ch, @@ -300,8 +303,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); - - // printf("**rb %d %d\n",rb,dl_ch-(int16_T *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]); +#ifdef DEBUG_CH + printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#endif multadd_real_vector_complex_scalar(f2, ch, dl_ch, @@ -314,8 +318,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); - // printf("pilot 49: rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); - +#ifdef DEBUG_CH + printf("pilot %d: rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#endif multadd_real_vector_complex_scalar(fr, ch, dl_ch, @@ -326,7 +331,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); - // printf("pilot 50: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#ifdef DEBUG_CH + printf("pilot %d: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#endif multadd_real_vector_complex_scalar(f2r2, ch, dl_ch, diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c index 6ab784aa18..ea1bb01ae5 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c @@ -116,7 +116,7 @@ LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t max_turbo_ite dlsch->max_turbo_iterations = max_turbo_iterations; for (i=0; iharq_processes[i] = (LTE_DL_UE_HARQ_t *)malloc16(sizeof(LTE_DL_UE_HARQ_t)); if (dlsch->harq_processes[i]) { @@ -155,7 +155,7 @@ LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t max_turbo_ite return(dlsch); } - msg("new_ue_dlsch with size %zu: exit_flag = %u\n",sizeof(LTE_DL_UE_HARQ_t), exit_flag); + printf("new_ue_dlsch with size %zu: exit_flag = %u\n",sizeof(LTE_DL_UE_HARQ_t), exit_flag); free_ue_dlsch(dlsch); return(NULL); @@ -204,22 +204,22 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, time_stats_t *); if (!dlsch_llr) { - msg("dlsch_decoding.c: NULL dlsch_llr pointer\n"); + printf("dlsch_decoding.c: NULL dlsch_llr pointer\n"); return(dlsch->max_turbo_iterations); } if (!harq_process) { - msg("dlsch_decoding.c: NULL harq_process pointer\n"); + printf("dlsch_decoding.c: NULL harq_process pointer\n"); return(dlsch->max_turbo_iterations); } if (!frame_parms) { - msg("dlsch_decoding.c: NULL frame_parms pointer\n"); + printf("dlsch_decoding.c: NULL frame_parms pointer\n"); return(dlsch->max_turbo_iterations); } if (subframe>9) { - msg("dlsch_decoding.c: Illegal subframe index %d\n",subframe); + printf("dlsch_decoding.c: Illegal subframe index %d\n",subframe); return(dlsch->max_turbo_iterations); } @@ -232,13 +232,13 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, /* if (nb_rb > frame_parms->N_RB_DL) { - msg("dlsch_decoding.c: Illegal nb_rb %d\n",nb_rb); + printf("dlsch_decoding.c: Illegal nb_rb %d\n",nb_rb); return(max_turbo_iterations); }*/ /*harq_pid = dlsch->current_harq_pid; if (harq_pid >= 8) { - msg("dlsch_decoding.c: Illegal harq_pid %d\n",harq_pid); + printf("dlsch_decoding.c: Illegal harq_pid %d\n",harq_pid); return(max_turbo_iterations); } */ @@ -250,7 +250,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, G = harq_process->G; //get_G(frame_parms,nb_rb,dlsch->rb_alloc,mod_order,num_pdcch_symbols,phy_vars_ue->frame,subframe); - // msg("DLSCH Decoding, harq_pid %d Ndi %d\n",harq_pid,harq_process->Ndi); + // printf("DLSCH Decoding, harq_pid %d Ndi %d\n",harq_pid,harq_process->Ndi); if (harq_process->round == 0) { // This is a new packet, so compute quantities regarding segmentation @@ -269,7 +269,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, /* else { - msg("dlsch_decoding.c: Ndi>0 not checked yet!!\n"); + printf("dlsch_decoding.c: Ndi>0 not checked yet!!\n"); return(max_turbo_iterations); } */ @@ -296,7 +296,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, break; } - if (harq_process->C >= MAX_NUM_DLSCH_SEGMENTS/bw_scaling) { + if (harq_process->C > MAX_NUM_DLSCH_SEGMENTS/bw_scaling) { LOG_E(PHY,"Illegal harq_process->C %d > %d\n",harq_process->C,MAX_NUM_DLSCH_SEGMENTS/bw_scaling); return((1+dlsch->max_turbo_iterations)); } @@ -320,7 +320,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, else if (Kr_bytes <= 768) iind = 123 + ((Kr_bytes-256)>>3); else { - msg("dlsch_decoding: Illegal codeword size %d!!!\n",Kr_bytes); + printf("dlsch_decoding: Illegal codeword size %d!!!\n",Kr_bytes); return(dlsch->max_turbo_iterations); } diff --git a/openair1/PHY/MODULATION/ofdm_mod.c b/openair1/PHY/MODULATION/ofdm_mod.c index 61e5f9fb5b..08a8aa22c1 100755 --- a/openair1/PHY/MODULATION/ofdm_mod.c +++ b/openair1/PHY/MODULATION/ofdm_mod.c @@ -91,7 +91,7 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input ) { - static short temp[2048*4] __attribute__((aligned(16))); + static short temp[2048*4] __attribute__((aligned(32))); unsigned short i,j; short k; @@ -139,12 +139,18 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input msg("[PHY] symbol %d/%d (%p,%p -> %p)\n",i,nb_symbols,input,&input[i<=-nb_prefix_samples; k--) { diff --git a/openair1/PHY/MODULATION/slot_fep.c b/openair1/PHY/MODULATION/slot_fep.c index feb2d885b2..3767285353 100644 --- a/openair1/PHY/MODULATION/slot_fep.c +++ b/openair1/PHY/MODULATION/slot_fep.c @@ -56,7 +56,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, unsigned int rx_offset; void (*dft)(int16_t *,int16_t *, int); - int tmp_dft_in[256]; // This is for misalignment issues for 6 and 15 PRBs + int tmp_dft_in[2048]; // This is for misalignment issues for 6 and 15 PRBs switch (frame_parms->log2_symbol_size) { case 7: @@ -96,12 +96,12 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, if (l<0 || l>=7-frame_parms->Ncp) { - msg("slot_fep: l must be between 0 and %d\n",7-frame_parms->Ncp); + printf("slot_fep: l must be between 0 and %d\n",7-frame_parms->Ncp); return(-1); } if (Ns<0 || Ns>=20) { - msg("slot_fep: Ns must be between 0 and 19\n"); + printf("slot_fep: Ns must be between 0 and 19\n"); return(-1); } @@ -111,12 +111,12 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, memset(&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],0,frame_parms->ofdm_symbol_size*sizeof(int)); rx_offset = sample_offset + slot_offset + nb_prefix_samples0 + subframe_offset - SOFFSET; - // Align with 128 bit - rx_offset = rx_offset - rx_offset % 4; + // Align with 256 bit + // rx_offset = rx_offset&0xfffffff8; #ifdef DEBUG_FEP // if (phy_vars_ue->frame <100) - msg("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol, + printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol, nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset); #endif @@ -127,9 +127,9 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, (short *)&ue_common_vars->rxdata[aa][0], frame_parms->ofdm_symbol_size*sizeof(int)); - if ((rx_offset&3)!=0) { // if input to dft is not 128-bit aligned, issue for size 6 and 15 PRBs + if ((rx_offset&7)!=0) { // if input to dft is not 256-bit aligned, issue for size 6,15 and 25 PRBs memcpy((void *)tmp_dft_in, - (void *)&ue_common_vars->rxdata[aa][(rx_offset-nb_prefix_samples0) % frame_length_samples], + (void *)&ue_common_vars->rxdata[aa][rx_offset % frame_length_samples], frame_parms->ofdm_symbol_size*sizeof(int)); dft((int16_t *)tmp_dft_in, (int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); @@ -142,12 +142,12 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, } } else { - rx_offset += (frame_parms->ofdm_symbol_size+nb_prefix_samples) + - (frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1); + rx_offset += (frame_parms->ofdm_symbol_size+nb_prefix_samples)*l;// + + // (frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1); #ifdef DEBUG_FEP // if (phy_vars_ue->frame <100) - msg("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol, + printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol, nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset); #endif @@ -158,7 +158,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, start_meas(&phy_vars_ue->rx_dft_stats); - if ((rx_offset&3)!=0) { // if input to dft is not 128-bit aligned, issue for size 6 and 15 PRBs + if ((rx_offset&7)!=0) { // if input to dft is not 128-bit aligned, issue for size 6 and 15 PRBs memcpy((void *)tmp_dft_in, (void *)&ue_common_vars->rxdata[aa][(rx_offset) % frame_length_samples], frame_parms->ofdm_symbol_size*sizeof(int)); @@ -182,7 +182,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, for (aa=0; aanb_antennas_tx_eNB; aa++) { #ifdef DEBUG_FEP - msg("Channel estimation eNB %d, aatx %d, slot %d, symbol %d\n",eNB_id,aa,Ns,l); + printf("Channel estimation eNB %d, aatx %d, slot %d, symbol %d\n",eNB_id,aa,Ns,l); #endif start_meas(&phy_vars_ue->dlsch_channel_estimation_stats); lte_dl_channel_estimation(phy_vars_ue,eNB_id,0, @@ -205,7 +205,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, // do frequency offset estimation here! // use channel estimates from current symbol (=ch_t) and last symbol (ch_{t-1}) #ifdef DEBUG_FEP - msg("Frequency offset estimation\n"); + printf("Frequency offset estimation\n"); #endif if (l==(4-frame_parms->Ncp)) { @@ -222,7 +222,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, } #ifdef DEBUG_FEP - msg("slot_fep: done\n"); + printf("slot_fep: done\n"); #endif return(0); } diff --git a/openair1/PHY/TOOLS/Makefile b/openair1/PHY/TOOLS/Makefile index 908c1b6f14..eee9d78344 100644 --- a/openair1/PHY/TOOLS/Makefile +++ b/openair1/PHY/TOOLS/Makefile @@ -1,8 +1,14 @@ -lte_dfts: lte_dfts.c - gcc -O2 -mavx2 -g -ggdb -o lte_dfts lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS +lte_dfts_sse4: lte_dfts.c + gcc -O2 -msse4.1 -g -ggdb -o lte_dfts_sse4 lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS -lte_dfts.s: lte_dfts.c +lte_dfts_avx2: lte_dfts.c + gcc -O2 -mavx2 -g -ggdb -o lte_dfts_avx2 lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS + +lte_dfts_avx2.s: lte_dfts.c gcc -O2 -mavx2 -S lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS -dft_cycles: lte_dfts - ./lte_dfts | egrep cycles +lte_dfts_sse4.s: lte_dfts.c + gcc -O2 -msse4.1 -S lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS + +dft_cycles_avx2: lte_dfts_avx2 + ./lte_dfts_avx2 | egrep cycles diff --git a/openair1/PHY/TOOLS/lte_dfts.c b/openair1/PHY/TOOLS/lte_dfts.c index f1103e4478..9a3ef6461e 100644 --- a/openair1/PHY/TOOLS/lte_dfts.c +++ b/openair1/PHY/TOOLS/lte_dfts.c @@ -472,15 +472,15 @@ static inline int16x8_t packed_cmult2(int16x8_t a,int16x8_t b, int16x8_t b2) #endif -static int16_t W0s[8]__attribute__((aligned(32))) = {32767,0,32767,0,32767,0,32767,0}; +static int16_t W0s[16]__attribute__((aligned(32))) = {32767,0,32767,0,32767,0,32767,0,32767,0,32767,0,32767,0,32767,0}; -static int16_t W13s[8]__attribute__((aligned(32))) = {-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378}; -static int16_t W23s[8]__attribute__((aligned(32))) = {-16384,28378,-16384,28378,-16384,28378,-16384,28378}; +static int16_t W13s[16]__attribute__((aligned(32))) = {-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378}; +static int16_t W23s[16]__attribute__((aligned(32))) = {-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378}; -static int16_t W15s[8]__attribute__((aligned(32))) = {10126,-31163,10126,-31163,10126,-31163,10126,-31163}; -static int16_t W25s[8]__attribute__((aligned(32))) = {-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260}; -static int16_t W35s[8]__attribute__((aligned(32))) = {-26510,19260,-26510,19260,-26510,19260,-26510,19260}; -static int16_t W45s[8]__attribute__((aligned(32))) = {10126,31163,10126,31163,10126,31163,10126,31163}; +static int16_t W15s[16]__attribute__((aligned(32))) = {10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163}; +static int16_t W25s[16]__attribute__((aligned(32))) = {-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260}; +static int16_t W35s[16]__attribute__((aligned(32))) = {-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260}; +static int16_t W45s[16]__attribute__((aligned(32))) = {10126,31163,10126,31163,10126,31163,10126,31163,10126,31163,10126,31163,10126,31163,10126,31163}; #if defined(__x86_64__) || defined(__i386__) __m128i *W0 = (__m128i *)W0s; @@ -513,7 +513,7 @@ int16x8_t *W45 = (int16x8_t *)W45s; static int16_t dft_norm_table[16] = {9459, //12 6689,//24 5461,//36 - 4729,//48 + 4729,//482 4230,//60 23170,//72 3344,//96 @@ -670,17 +670,17 @@ static inline void bfly2_16_256(__m256i *x0, __m256i *x1, __m256i *y0, __m256i * __m256i x1t; x1t = packed_cmult2_256(*(x1),*(tw),*(twb)); - + /* print_shorts256("x0",(int16_t*)x0); print_shorts256("x1",(int16_t*)x1); print_shorts256("tw",(int16_t*)tw); print_shorts256("twb",(int16_t*)twb); - print_shorts256("x1t",(int16_t*)&x1t); + print_shorts256("x1t",(int16_t*)&x1t);*/ *y0 = _mm256_adds_epi16(*x0,x1t); *y1 = _mm256_subs_epi16(*x0,x1t); - print_shorts256("y0",(int16_t*)y0); - print_shorts256("y1",(int16_t*)y1); + /*print_shorts256("y0",(int16_t*)y0); + print_shorts256("y1",(int16_t*)y1);*/ } #endif @@ -1947,7 +1947,7 @@ static inline void transpose16_ooff_simd256(__m256i *x,__m256i *y,int off) { register __m256i ytmp0,ytmp1,ytmp2,ytmp3,ytmp4,ytmp5,ytmp6,ytmp7; __m256i *y2=y; - __m256i const perm_mask = _mm256_set_epi32(7, 3, 6, 2, 5, 1, 4, 0); + __m256i const perm_mask = _mm256_set_epi32(7, 3, 5, 1, 6, 2, 4, 0); ytmp0 = _mm256_permutevar8x32_epi32(x[0],perm_mask); // x00 x10 x01 x11 x02 x12 x03 x13 ytmp1 = _mm256_permutevar8x32_epi32(x[1],perm_mask); // x20 x30 x21 x31 x22 x32 x23 x33 @@ -2437,7 +2437,7 @@ static inline void idft16_simd256(int16_t *x,int16_t *y) __attribute__((always_i static inline void idft16_simd256(int16_t *x,int16_t *y) { - __m256i *tw16a_256=(__m256i *)tw16arep,*tw16b_256=(__m256i *)tw16brep,*x256=(__m256i *)x,*y256=(__m256i *)y; + __m256i *tw16a_256=(__m256i *)tw16rep,*tw16b_256=(__m256i *)tw16crep,*x256=(__m256i *)x,*y256=(__m256i *)y; register __m256i x1_flip,x3_flip,x02t,x13t; register __m256i ytmp0,ytmp1,ytmp2,ytmp3,xtmp0,xtmp1,xtmp2,xtmp3; register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); @@ -2473,16 +2473,16 @@ static inline void idft16_simd256(int16_t *x,int16_t *y) x02t = _mm256_adds_epi16(xtmp0,xtmp2); x13t = _mm256_adds_epi16(xtmp1,xtmp3); - y256[0] = _mm256_adds_epi16(x02t,x13t); - y256[2] = _mm256_subs_epi16(x02t,x13t); + ytmp0 = _mm256_adds_epi16(x02t,x13t); + ytmp2 = _mm256_subs_epi16(x02t,x13t); x1_flip = _mm256_sign_epi16(xtmp1,*(__m256i*)conjugatedft); x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); x3_flip = _mm256_sign_epi16(xtmp3,*(__m256i*)conjugatedft); x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); x02t = _mm256_subs_epi16(xtmp0,xtmp2); x13t = _mm256_subs_epi16(x1_flip,x3_flip); - y256[3] = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f - y256[1] = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + ytmp3 = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + ytmp1 = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f // [y0 y1 y2 y3 y16 y17 y18 y19] // [y4 y5 y6 y7 y20 y21 y22 y23] @@ -2644,6 +2644,7 @@ int16_t tw64crep[192] __attribute__((aligned(32))) = { #endif #endif +#ifndef __AVX2__ void dft64(int16_t *x,int16_t *y,int scale) { @@ -2757,13 +2758,13 @@ void dft64(int16_t *x,int16_t *y,int scale) } -#ifdef __AVX2__ -void dft64_simd256(int16_t *x,int16_t *y,int scale) +#else // __AVX2__ +void dft64(int16_t *x,int16_t *y,int scale) { simd256_q15_t xtmp[16],ytmp[16],*tw64a_256=(simd256_q15_t *)tw64a,*tw64b_256=(simd256_q15_t *)tw64b,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y; simd256_q15_t xintl0,xintl1,xintl2,xintl3,xintl4,xintl5,xintl6,xintl7; - simd256_q15_t const perm_mask = _mm256_set_epi32(7, 3, 6, 2, 5, 1, 4, 0); + simd256_q15_t const perm_mask = _mm256_set_epi32(7, 3, 5, 1, 6, 2, 4, 0); #ifdef D64STATS @@ -2779,7 +2780,7 @@ void dft64_simd256(int16_t *x,int16_t *y,int scale) stop_meas(&ts_t); start_meas(&ts_d); #endif - + /* print_shorts256("x2560",(int16_t*)x256); print_shorts256("x2561",(int16_t*)(x256+1)); print_shorts256("x2562",(int16_t*)(x256+2)); @@ -2788,7 +2789,7 @@ void dft64_simd256(int16_t *x,int16_t *y,int scale) print_shorts256("x2565",(int16_t*)(x256+5)); print_shorts256("x2566",(int16_t*)(x256+6)); print_shorts256("x2567",(int16_t*)(x256+7)); - + */ xintl0 = _mm256_permutevar8x32_epi32(x256[0],perm_mask); // x0 x4 x1 x5 x2 x6 x3 x7 xintl1 = _mm256_permutevar8x32_epi32(x256[1],perm_mask); // x8 x12 x9 x13 x10 x14 x11 x15 xintl2 = _mm256_permutevar8x32_epi32(x256[2],perm_mask); // x16 x20 x17 x21 x18 x22 x19 x23 @@ -2797,7 +2798,7 @@ void dft64_simd256(int16_t *x,int16_t *y,int scale) xintl5 = _mm256_permutevar8x32_epi32(x256[5],perm_mask); // x40 x28 x25 x29 x26 x30 x27 x31 xintl6 = _mm256_permutevar8x32_epi32(x256[6],perm_mask); // x48 x28 x25 x29 x26 x30 x27 x31 xintl7 = _mm256_permutevar8x32_epi32(x256[7],perm_mask); // x56 x28 x25 x29 x26 x30 x27 x31 - + /* print_shorts256("xintl0",(int16_t*)&xintl0); print_shorts256("xintl1",(int16_t*)&xintl1); print_shorts256("xintl2",(int16_t*)&xintl2); @@ -2806,7 +2807,7 @@ void dft64_simd256(int16_t *x,int16_t *y,int scale) print_shorts256("xintl5",(int16_t*)&xintl5); print_shorts256("xintl6",(int16_t*)&xintl6); print_shorts256("xintl7",(int16_t*)&xintl7); - + */ xtmp[0] = _mm256_unpacklo_epi64(xintl0,xintl1); // x0 x4 x8 x12 x1 x5 x9 x13 xtmp[4] = _mm256_unpackhi_epi64(xintl0,xintl1); // x2 x6 x10 x14 x3 x7 x11 x15 xtmp[1] = _mm256_unpacklo_epi64(xintl2,xintl3); // x16 x20 x24 x28 x17 x21 x25 x29 @@ -2815,7 +2816,7 @@ void dft64_simd256(int16_t *x,int16_t *y,int scale) xtmp[6] = _mm256_unpackhi_epi64(xintl4,xintl5); // x34 x38 x42 x46 x35 x39 x43 x47 xtmp[3] = _mm256_unpacklo_epi64(xintl6,xintl7); // x48 x52 x56 x60 x49 x53 x57 x61 xtmp[7] = _mm256_unpackhi_epi64(xintl6,xintl7); // x50 x54 x58 x62 x51 x55 x59 x63 - + /* print_shorts256("xtmp0",(int16_t*)xtmp); print_shorts256("xtmp1",(int16_t*)(xtmp+1)); print_shorts256("xtmp2",(int16_t*)(xtmp+2)); @@ -2824,28 +2825,29 @@ void dft64_simd256(int16_t *x,int16_t *y,int scale) print_shorts256("xtmp5",(int16_t*)(xtmp+5)); print_shorts256("xtmp6",(int16_t*)(xtmp+6)); print_shorts256("xtmp7",(int16_t*)(xtmp+7)); - + */ dft16_simd256((int16_t*)(xtmp),(int16_t*)ytmp); // [y0 y1 y2 y3 y4 y5 y6 y7] // [y8 y9 y10 y11 y12 y13 y14 y15] // [y16 y17 y18 y19 y20 y21 y22 y23] // [y24 y25 y26 y27 y28 y29 y30 y31] - + /* print_shorts256("ytmp0",(int16_t*)ytmp); print_shorts256("ytmp1",(int16_t*)(ytmp+1)); print_shorts256("ytmp2",(int16_t*)(ytmp+2)); print_shorts256("ytmp3",(int16_t*)(ytmp+3)); - + */ dft16_simd256((int16_t*)(xtmp+4),(int16_t*)(ytmp+4)); // [y32 y33 y34 y35 y36 y37 y38 y39] // [y40 y41 y42 y43 y44 y45 y46 y47] // [y48 y49 y50 y51 y52 y53 y54 y55] // [y56 y57 y58 y59 y60 y61 y62 y63] - + /* print_shorts256("ytmp4",(int16_t*)(ytmp+4)); print_shorts256("ytmp5",(int16_t*)(ytmp+5)); print_shorts256("ytmp6",(int16_t*)(ytmp+6)); print_shorts256("ytmp7",(int16_t*)(ytmp+7)); + */ #ifdef D64STATS stop_meas(&ts_d); start_meas(&ts_b); @@ -2869,7 +2871,7 @@ void dft64_simd256(int16_t *x,int16_t *y,int scale) // [y24 y25 y26 y27 y28 y29 y30 y31] // [y40 y41 y42 y43 y44 y45 y46 y47] // [y56 y57 y58 y59 y60 y61 y62 y63] - + /* print_shorts256("y256_0",(int16_t*)&y256[0]); print_shorts256("y256_1",(int16_t*)&y256[1]); print_shorts256("y256_2",(int16_t*)&y256[2]); @@ -2878,7 +2880,7 @@ void dft64_simd256(int16_t *x,int16_t *y,int scale) print_shorts256("y256_5",(int16_t*)&y256[5]); print_shorts256("y256_6",(int16_t*)&y256[6]); print_shorts256("y256_7",(int16_t*)&y256[7]); - + */ #ifdef D64STATS stop_meas(&ts_b); @@ -2904,6 +2906,7 @@ void dft64_simd256(int16_t *x,int16_t *y,int scale) } #endif +#ifndef __AVX2__ void idft64(int16_t *x,int16_t *y,int scale) { @@ -2995,13 +2998,13 @@ void idft64(int16_t *x,int16_t *y,int scale) } -#ifdef __AVX2__ -void idft64_simd256(int16_t *x,int16_t *y,int scale) +#else // __AVX2__ +void idft64(int16_t *x,int16_t *y,int scale) { simd256_q15_t xtmp[16],ytmp[16],*tw64a_256=(simd256_q15_t *)tw64,*tw64b_256=(simd256_q15_t *)tw64c,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y; register simd256_q15_t xintl0,xintl1,xintl2,xintl3,xintl4,xintl5,xintl6,xintl7; - simd256_q15_t const perm_mask = _mm256_set_epi32(7, 3, 6, 2, 5, 1, 4, 0); + simd256_q15_t const perm_mask = _mm256_set_epi32(7, 3, 5, 1, 6, 2, 4, 0); #ifdef D64STATS @@ -3105,6 +3108,7 @@ int16_t tw128b[128] __attribute__((aligned(32))) = {0,32767,-1608,32727,-3212,32 int16_t tw128c[128] __attribute__((aligned(32))) = {0,32767,1608,32727,3212,32609,4808,32412,6393,32137,7962,31785,9512,31356,11039,30851,12540,30272,14010,29621,15447,28897,16846,28105,18205,27244,19520,26318,20788,25329,22005,24278,23170,23169,24279,22004,25330,20787,26319,19519,27245,18204,28106,16845,28898,15446,29622,14009,30273,12539,30852,11038,31357,9511,31786,7961,32138,6392,32413,4807,32610,3211,32728,1607,32767,0,32728,-1608,32610,-3212,32413,-4808,32138,-6393,31786,-7962,31357,-9512,30852,-11039,30273,-12540,29622,-14010,28898,-15447,28106,-16846,27245,-18205,26319,-19520,25330,-20788,24279,-22005,23170,-23170,22005,-24279,20788,-25330,19520,-26319,18205,-27245,16846,-28106,15447,-28898,14010,-29622,12540,-30273,11039,-30852,9512,-31357,7962,-31786,6393,-32138,4808,-32413,3212,-32610,1608,-32728}; +#ifndef __AVX2__ void dft128(int16_t *x,int16_t *y,int scale) { @@ -3210,8 +3214,8 @@ void dft128(int16_t *x,int16_t *y,int scale) } -#ifdef __AVX2__ -void dft128_simd256(int16_t *x,int16_t *y,int scale) +#else // __AVX2__ +void dft128(int16_t *x,int16_t *y,int scale) { simd256_q15_t xtmp[16],*x256 = (simd256_q15_t *)x; @@ -3230,15 +3234,16 @@ void dft128_simd256(int16_t *x,int16_t *y,int scale) transpose4_ooff_simd256(x256+12,xtmp+6,8); transpose4_ooff_simd256(x256+14,xtmp+7,8); - write_output("dft128ina_256.m","dftina",xtmp,64,1,1); + /* write_output("dft128ina_256.m","dftina",xtmp,64,1,1); write_output("dft128inb_256.m","dftinb",xtmp+8,64,1,1); + */ + + dft64((int16_t*)(xtmp),(int16_t*)ytmp,1); + dft64((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); - dft64_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); - dft64_simd256((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); - - write_output("dft128outa_256.m","dftouta",ytmp,64,1,1); + /*write_output("dft128outa_256.m","dftouta",ytmp,64,1,1); write_output("dft128outb_256.m","dftoutb",ytmp+8,64,1,1); - + */ for (i=0; i<8; i++) { bfly2_16_256(ytmpp,ytmpp+8, @@ -3272,12 +3277,13 @@ void dft128_simd256(int16_t *x,int16_t *y,int scale) } - write_output("dft128.m","dft",y256,128,1,1); - exit(-1); + /* write_output("dft128.m","dft",y256,128,1,1); + exit(-1);*/ } #endif +#ifndef __AVX2__ void idft128(int16_t *x,int16_t *y,int scale) { @@ -3376,13 +3382,13 @@ void idft128(int16_t *x,int16_t *y,int scale) } -#ifdef __AVX2__ -void idft128_simd256(int16_t *x,int16_t *y,int scale) +#else // __AVX2__ +void idft128(int16_t *x,int16_t *y,int scale) { simd256_q15_t xtmp[16],*x256 = (simd256_q15_t *)x; simd256_q15_t ytmp[16],*y256=(simd256_q15_t*)y; - simd256_q15_t *tw128_256p=(simd256_q15_t *)tw128,*tw128c_256p=(simd256_q15_t *)tw128c,*y256p=(simd256_q15_t *)y; + simd256_q15_t *tw128_256p=(simd256_q15_t *)tw128,*y256p=(simd256_q15_t *)y; simd256_q15_t *ytmpp = &ytmp[0]; int i; simd256_q15_t ONE_OVER_SQRT2_Q15_256 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); @@ -3397,17 +3403,15 @@ void idft128_simd256(int16_t *x,int16_t *y,int scale) transpose4_ooff_simd256(x256+12,xtmp+6,8); transpose4_ooff_simd256(x256+14,xtmp+7,8); - dft64_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); - dft64_simd256((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); + idft64((int16_t*)(xtmp),(int16_t*)ytmp,1); + idft64((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); for (i=0; i<8; i++) { - bfly2_16_256(ytmpp,ytmpp+8, - y256p,y256p+8, - tw128_256p, - tw128c_256p); + ibfly2_256(ytmpp,ytmpp+8, + y256p,y256p+8, + tw128_256p); tw128_256p++; - tw128c_256p++; y256p++; ytmpp++; } @@ -3451,7 +3455,7 @@ int16_t tw256b[384] __attribute__((aligned(32))) = {0,32767,-805,32757,-1608,327 0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607,-32767,0,-32728,-1608,-32610,-3212,-32413,-4808,-32138,-6393,-31786,-7962,-31357,-9512,-30852,-11039,-30273,-12540,-29622,-14010,-28898,-15447,-28106,-16846,-27245,-18205,-26319,-19520,-25330,-20788,-24279,-22005,-23170,-23170,-22005,-24279,-20788,-25330,-19520,-26319,-18205,-27245,-16846,-28106,-15447,-28898,-14010,-29622,-12540,-30273,-11039,-30852,-9512,-31357,-7962,-31786,-6393,-32138,-4808,-32413,-3212,-32610,-1608,-32728, 0,32767,-2411,32678,-4808,32412,-7180,31970,-9512,31356,-11793,30571,-14010,29621,-16151,28510,-18205,27244,-20160,25831,-22005,24278,-23732,22594,-25330,20787,-26790,18867,-28106,16845,-29269,14732,-30273,12539,-31114,10278,-31786,7961,-32285,5601,-32610,3211,-32758,804,-32728,-1608,-32521,-4012,-32138,-6393,-31581,-8740,-30852,-11039,-29956,-13279,-28898,-15447,-27684,-17531,-26319,-19520,-24812,-21403,-23170,-23170,-21403,-24812,-19520,-26319,-17531,-27684,-15447,-28898,-13279,-29956,-11039,-30852,-8740,-31581,-6393,-32138,-4012,-32521,-1608,-32728,804,-32758,3211,-32610,5601,-32285,7961,-31786,10278,-31114,12539,-30273,14732,-29269,16845,-28106,18867,-26790,20787,-25330,22594,-23732,24278,-22005,25831,-20160,27244,-18205,28510,-16151,29621,-14010,30571,-11793,31356,-9512,31970,-7180,32412,-4808,32678,-2411 }; - +#ifndef __AVX2__ void dft256(int16_t *x,int16_t *y,int scale) { @@ -3620,12 +3624,12 @@ void idft256(int16_t *x,int16_t *y,int scale) } -#ifdef __AVX2__ +#else //__AVX2__ -void dft256_simd256(int16_t *x,int16_t *y,int scale) +void dft256(int16_t *x,int16_t *y,int scale) { - simd256_q15_t xtmp[64],ytmp[64],*tw256a_256p=(simd256_q15_t *)tw256a,*tw256b_256p=(simd256_q15_t *)tw256b,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t xtmp[32],ytmp[32],*tw256a_256p=(simd256_q15_t *)tw256a,*tw256b_256p=(simd256_q15_t *)tw256b,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; simd256_q15_t *ytmpp = &ytmp[0]; int i; @@ -3637,11 +3641,18 @@ void dft256_simd256(int16_t *x,int16_t *y,int scale) transpose16_ooff_simd256(x256+20,xtmp+5,8); transpose16_ooff_simd256(x256+24,xtmp+6,8); transpose16_ooff_simd256(x256+28,xtmp+7,8); - - dft64_simd256((int16_t*)(xtmp),(int16_t*)(ytmp),1); - dft64_simd256((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); - dft64_simd256((int16_t*)(xtmp+16),(int16_t*)(ytmp+16),1); - dft64_simd256((int16_t*)(xtmp+24),(int16_t*)(ytmp+24),1); + /* + char vname[10]; + for (i=0;i<32;i++) { + sprintf(vname,"xtmp%d",i); + print_shorts256(vname,(int16_t*)(xtmp+i)); + } + exit(-1);*/ + + dft64((int16_t*)(xtmp),(int16_t*)(ytmp),1); + dft64((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); + dft64((int16_t*)(xtmp+16),(int16_t*)(ytmp+16),1); + dft64((int16_t*)(xtmp+24),(int16_t*)(ytmp+24),1); bfly4_16_256(ytmpp,ytmpp+8,ytmpp+16,ytmpp+24, @@ -3707,10 +3718,10 @@ void dft256_simd256(int16_t *x,int16_t *y,int scale) } -void idft256_simd256(int16_t *x,int16_t *y,int scale) +void idft256(int16_t *x,int16_t *y,int scale) { - simd256_q15_t xtmp[64],ytmp[64],*tw256a_256p=(simd256_q15_t *)tw256a,*tw256b_256p=(simd256_q15_t *)tw256b,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t xtmp[32],ytmp[32],*tw256_256p=(simd256_q15_t *)tw256,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; simd256_q15_t *ytmpp = &ytmp[0]; int i; @@ -3723,44 +3734,44 @@ void idft256_simd256(int16_t *x,int16_t *y,int scale) transpose16_ooff_simd256(x256+24,xtmp+6,8); transpose16_ooff_simd256(x256+28,xtmp+7,8); - idft64_simd256((int16_t*)(xtmp),(int16_t*)(ytmp),1); - idft64_simd256((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); - idft64_simd256((int16_t*)(xtmp+16),(int16_t*)(ytmp+16),1); - idft64_simd256((int16_t*)(xtmp+24),(int16_t*)(ytmp+24),1); + idft64((int16_t*)(xtmp),(int16_t*)(ytmp),1); + idft64((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); + idft64((int16_t*)(xtmp+16),(int16_t*)(ytmp+16),1); + idft64((int16_t*)(xtmp+24),(int16_t*)(ytmp+24),1); + + + ibfly4_256(ytmpp,ytmpp+8,ytmpp+16,ytmpp+24, + y256p,y256p+8,y256p+16,y256p+24, + tw256_256p,tw256_256p+8,tw256_256p+16); + ibfly4_256(ytmpp+1,ytmpp+9,ytmpp+17,ytmpp+25, + y256p+1,y256p+9,y256p+17,y256p+25, + tw256_256p+1,tw256_256p+9,tw256_256p+17); + + ibfly4_256(ytmpp+2,ytmpp+10,ytmpp+18,ytmpp+26, + y256p+2,y256p+10,y256p+18,y256p+26, + tw256_256p+2,tw256_256p+10,tw256_256p+18); + + ibfly4_256(ytmpp+3,ytmpp+11,ytmpp+19,ytmpp+27, + y256p+3,y256p+11,y256p+19,y256p+27, + tw256_256p+3,tw256_256p+11,tw256_256p+19); + + ibfly4_256(ytmpp+4,ytmpp+12,ytmpp+20,ytmpp+28, + y256p+4,y256p+12,y256p+20,y256p+28, + tw256_256p+4,tw256_256p+12,tw256_256p+20); + + ibfly4_256(ytmpp+5,ytmpp+13,ytmpp+21,ytmpp+29, + y256p+5,y256p+13,y256p+21,y256p+29, + tw256_256p+5,tw256_256p+13,tw256_256p+21); + + ibfly4_256(ytmpp+6,ytmpp+14,ytmpp+22,ytmpp+30, + y256p+6,y256p+14,y256p+22,y256p+30, + tw256_256p+6,tw256_256p+14,tw256_256p+22); + + ibfly4_256(ytmpp+7,ytmpp+15,ytmpp+23,ytmpp+31, + y256p+7,y256p+15,y256p+23,y256p+31, + tw256_256p+7,tw256_256p+15,tw256_256p+23); - ibfly4_16_256(ytmpp,ytmpp+8,ytmpp+16,ytmpp+24, - y256p,y256p+8,y256p+16,y256p+24, - tw256a_256p,tw256a_256p+8,tw256a_256p+16, - tw256b_256p,tw256b_256p+8,tw256b_256p+16); - ibfly4_16_256(ytmpp+1,ytmpp+9,ytmpp+17,ytmpp+25, - y256p+1,y256p+9,y256p+17,y256p+25, - tw256a_256p+1,tw256a_256p+9,tw256a_256p+17, - tw256b_256p+1,tw256b_256p+9,tw256b_256p+17); - ibfly4_16_256(ytmpp+2,ytmpp+10,ytmpp+18,ytmpp+26, - y256p+2,y256p+10,y256p+18,y256p+26, - tw256a_256p+2,tw256a_256p+10,tw256a_256p+18, - tw256b_256p+2,tw256b_256p+10,tw256b_256p+18); - ibfly4_16_256(ytmpp+3,ytmpp+11,ytmpp+19,ytmpp+27, - y256p+3,y256p+11,y256p+19,y256p+27, - tw256a_256p+3,tw256a_256p+11,tw256a_256p+19, - tw256b_256p+3,tw256b_256p+11,tw256b_256p+19); - ibfly4_16_256(ytmpp+4,ytmpp+12,ytmpp+20,ytmpp+28, - y256p+4,y256p+12,y256p+20,y256p+28, - tw256a_256p+4,tw256a_256p+12,tw256a_256p+20, - tw256b_256p+4,tw256b_256p+12,tw256b_256p+20); - ibfly4_16_256(ytmpp+5,ytmpp+13,ytmpp+21,ytmpp+29, - y256p+5,y256p+13,y256p+21,y256p+29, - tw256a_256p+5,tw256a_256p+13,tw256a_256p+21, - tw256b_256p+5,tw256b_256p+13,tw256b_256p+21); - ibfly4_16_256(ytmpp+6,ytmpp+14,ytmpp+22,ytmpp+30, - y256p+6,y256p+14,y256p+22,y256p+30, - tw256a_256p+6,tw256a_256p+14,tw256a_256p+22, - tw256b_256p+6,tw256b_256p+14,tw256b_256p+22); - ibfly4_16_256(ytmpp+7,ytmpp+15,ytmpp+23,ytmpp+31, - y256p+7,y256p+15,y256p+23,y256p+31, - tw256a_256p+7,tw256a_256p+15,tw256a_256p+23, - tw256b_256p+7,tw256b_256p+15,tw256b_256p+23); if (scale>0) { @@ -3811,7 +3822,7 @@ int16_t tw512c[512] __attribute__((aligned(32))) = { 0,32767,403,32764,805,32757,1207,32744,1608,32727,2010,32705,2411,32678,2812,32646,3212,32609,3612,32567,4012,32520,4410,32468,4808,32412,5206,32350,5602,32284,5998,32213,6393,32137,6787,32056,7180,31970,7572,31880,7962,31785,8352,31684,8740,31580,9127,31470,9512,31356,9896,31236,10279,31113,10660,30984,11039,30851,11417,30713,11793,30571,12167,30424,12540,30272,12910,30116,13279,29955,13646,29790,14010,29621,14373,29446,14733,29268,15091,29085,15447,28897,15800,28706,16151,28510,16500,28309,16846,28105,17190,27896,17531,27683,17869,27466,18205,27244,18538,27019,18868,26789,19195,26556,19520,26318,19841,26077,20160,25831,20475,25582,20788,25329,21097,25072,21403,24811,21706,24546,22005,24278,22302,24006,22595,23731,22884,23452,23170,23169,23453,22883,23732,22594,24007,22301,24279,22004,24547,21705,24812,21402,25073,21096,25330,20787,25583,20474,25832,20159,26078,19840,26319,19519,26557,19194,26790,18867,27020,18537,27245,18204,27467,17868,27684,17530,27897,17189,28106,16845,28310,16499,28511,16150,28707,15799,28898,15446,29086,15090,29269,14732,29447,14372,29622,14009,29791,13645,29956,13278,30117,12909,30273,12539,30425,12166,30572,11792,30714,11416,30852,11038,30985,10659,31114,10278,31237,9895,31357,9511,31471,9126,31581,8739,31685,8351,31786,7961,31881,7571,31971,7179,32057,6786,32138,6392,32214,5997,32285,5601,32351,5205,32413,4807,32469,4409,32521,4011,32568,3611,32610,3211,32647,2811,32679,2410,32706,2009,32728,1607,32745,1206,32758,804,32765,402,32767,0,32765,-403,32758,-805,32745,-1207,32728,-1608,32706,-2010,32679,-2411,32647,-2812,32610,-3212,32568,-3612,32521,-4012,32469,-4410,32413,-4808,32351,-5206,32285,-5602,32214,-5998,32138,-6393,32057,-6787,31971,-7180,31881,-7572,31786,-7962,31685,-8352,31581,-8740,31471,-9127,31357,-9512,31237,-9896,31114,-10279,30985,-10660,30852,-11039,30714,-11417,30572,-11793,30425,-12167,30273,-12540,30117,-12910,29956,-13279,29791,-13646,29622,-14010,29447,-14373,29269,-14733,29086,-15091,28898,-15447,28707,-15800,28511,-16151,28310,-16500,28106,-16846,27897,-17190,27684,-17531,27467,-17869,27245,-18205,27020,-18538,26790,-18868,26557,-19195,26319,-19520,26078,-19841,25832,-20160,25583,-20475,25330,-20788,25073,-21097,24812,-21403,24547,-21706,24279,-22005,24007,-22302,23732,-22595,23453,-22884,23170,-23170,22884,-23453,22595,-23732,22302,-24007,22005,-24279,21706,-24547,21403,-24812,21097,-25073,20788,-25330,20475,-25583,20160,-25832,19841,-26078,19520,-26319,19195,-26557,18868,-26790,18538,-27020,18205,-27245,17869,-27467,17531,-27684,17190,-27897,16846,-28106,16500,-28310,16151,-28511,15800,-28707,15447,-28898,15091,-29086,14733,-29269,14373,-29447,14010,-29622,13646,-29791,13279,-29956,12910,-30117,12540,-30273,12167,-30425,11793,-30572,11417,-30714,11039,-30852,10660,-30985,10279,-31114,9896,-31237,9512,-31357,9127,-31471,8740,-31581,8352,-31685,7962,-31786,7572,-31881,7180,-31971,6787,-32057,6393,-32138,5998,-32214,5602,-32285,5206,-32351,4808,-32413,4410,-32469,4012,-32521,3612,-32568,3212,-32610,2812,-32647,2411,-32679,2010,-32706,1608,-32728,1207,-32745,805,-32758,403,-32765 }; - +#ifndef __AVX2__ void dft512(int16_t *x,int16_t *y,int scale) { @@ -4022,14 +4033,14 @@ void idft512(int16_t *x,int16_t *y,int scale) } -#ifdef __AVX2__ +#else //__AVX2__ -void dft512_simd256(int16_t *x,int16_t *y,int scale) +void dft512(int16_t *x,int16_t *y,int scale) { simd256_q15_t xtmp[64],*x256 = (simd256_q15_t *)x; simd256_q15_t ytmp[64],*y256=(simd256_q15_t*)y; - simd256_q15_t *tw512a_256p=(simd256_q15_t *)tw512a,*tw512b_256p=(simd256_q15_t *)tw512b,*y256p=(simd256_q15_t *)y; + simd256_q15_t *tw512_256p=(simd256_q15_t*)tw512,*y256p=(simd256_q15_t *)y; simd256_q15_t *ytmpp = &ytmp[0]; int i; simd256_q15_t ONE_OVER_SQRT2_Q15_256 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); @@ -4068,17 +4079,15 @@ void dft512_simd256(int16_t *x,int16_t *y,int scale) transpose4_ooff_simd256(x256+60,xtmp+30,32); transpose4_ooff_simd256(x256+62,xtmp+31,32); - dft256_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); - dft256_simd256((int16_t*)(xtmp+64),(int16_t*)(ytmp+32),1); + dft256((int16_t*)(xtmp),(int16_t*)ytmp,1); + dft256((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1); for (i=0; i<32; i++) { - bfly2_16_256(ytmpp,ytmpp+32, - y256p,y256p+32, - tw512a_256p, - tw512b_256p); - tw512a_256p++; - tw512b_256p++; + bfly2_256(ytmpp,ytmpp+32, + y256p,y256p+32, + tw512_256p); + tw512_256p++; y256p++; ytmpp++; } @@ -4108,7 +4117,7 @@ void dft512_simd256(int16_t *x,int16_t *y,int scale) } -void idft512_simd256(int16_t *x,int16_t *y,int scale) +void idft512(int16_t *x,int16_t *y,int scale) { simd256_q15_t xtmp[64],*x256 = (simd256_q15_t *)x; @@ -4152,8 +4161,8 @@ void idft512_simd256(int16_t *x,int16_t *y,int scale) transpose4_ooff_simd256(x256+60,xtmp+30,32); transpose4_ooff_simd256(x256+62,xtmp+31,32); - idft256_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); - idft256_simd256((int16_t*)(xtmp+64),(int16_t*)(ytmp+32),1); + idft256((int16_t*)(xtmp),(int16_t*)ytmp,1); + idft256((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1); for (i=0; i<32; i++) { @@ -4196,7 +4205,7 @@ int16_t tw1024[1536] __attribute__((aligned(32))) = { 32767,0,32766,-202,32764, 32767,0,32764,-403,32757,-805,32744,-1207,32727,-1608,32705,-2010,32678,-2411,32646,-2812,32609,-3212,32567,-3612,32520,-4012,32468,-4410,32412,-4808,32350,-5206,32284,-5602,32213,-5998,32137,-6393,32056,-6787,31970,-7180,31880,-7572,31785,-7962,31684,-8352,31580,-8740,31470,-9127,31356,-9512,31236,-9896,31113,-10279,30984,-10660,30851,-11039,30713,-11417,30571,-11793,30424,-12167,30272,-12540,30116,-12910,29955,-13279,29790,-13646,29621,-14010,29446,-14373,29268,-14733,29085,-15091,28897,-15447,28706,-15800,28510,-16151,28309,-16500,28105,-16846,27896,-17190,27683,-17531,27466,-17869,27244,-18205,27019,-18538,26789,-18868,26556,-19195,26318,-19520,26077,-19841,25831,-20160,25582,-20475,25329,-20788,25072,-21097,24811,-21403,24546,-21706,24278,-22005,24006,-22302,23731,-22595,23452,-22884,23169,-23170,22883,-23453,22594,-23732,22301,-24007,22004,-24279,21705,-24547,21402,-24812,21096,-25073,20787,-25330,20474,-25583,20159,-25832,19840,-26078,19519,-26319,19194,-26557,18867,-26790,18537,-27020,18204,-27245,17868,-27467,17530,-27684,17189,-27897,16845,-28106,16499,-28310,16150,-28511,15799,-28707,15446,-28898,15090,-29086,14732,-29269,14372,-29447,14009,-29622,13645,-29791,13278,-29956,12909,-30117,12539,-30273,12166,-30425,11792,-30572,11416,-30714,11038,-30852,10659,-30985,10278,-31114,9895,-31237,9511,-31357,9126,-31471,8739,-31581,8351,-31685,7961,-31786,7571,-31881,7179,-31971,6786,-32057,6392,-32138,5997,-32214,5601,-32285,5205,-32351,4807,-32413,4409,-32469,4011,-32521,3611,-32568,3211,-32610,2811,-32647,2410,-32679,2009,-32706,1607,-32728,1206,-32745,804,-32758,402,-32765,0,-32767,-403,-32765,-805,-32758,-1207,-32745,-1608,-32728,-2010,-32706,-2411,-32679,-2812,-32647,-3212,-32610,-3612,-32568,-4012,-32521,-4410,-32469,-4808,-32413,-5206,-32351,-5602,-32285,-5998,-32214,-6393,-32138,-6787,-32057,-7180,-31971,-7572,-31881,-7962,-31786,-8352,-31685,-8740,-31581,-9127,-31471,-9512,-31357,-9896,-31237,-10279,-31114,-10660,-30985,-11039,-30852,-11417,-30714,-11793,-30572,-12167,-30425,-12540,-30273,-12910,-30117,-13279,-29956,-13646,-29791,-14010,-29622,-14373,-29447,-14733,-29269,-15091,-29086,-15447,-28898,-15800,-28707,-16151,-28511,-16500,-28310,-16846,-28106,-17190,-27897,-17531,-27684,-17869,-27467,-18205,-27245,-18538,-27020,-18868,-26790,-19195,-26557,-19520,-26319,-19841,-26078,-20160,-25832,-20475,-25583,-20788,-25330,-21097,-25073,-21403,-24812,-21706,-24547,-22005,-24279,-22302,-24007,-22595,-23732,-22884,-23453,-23170,-23170,-23453,-22884,-23732,-22595,-24007,-22302,-24279,-22005,-24547,-21706,-24812,-21403,-25073,-21097,-25330,-20788,-25583,-20475,-25832,-20160,-26078,-19841,-26319,-19520,-26557,-19195,-26790,-18868,-27020,-18538,-27245,-18205,-27467,-17869,-27684,-17531,-27897,-17190,-28106,-16846,-28310,-16500,-28511,-16151,-28707,-15800,-28898,-15447,-29086,-15091,-29269,-14733,-29447,-14373,-29622,-14010,-29791,-13646,-29956,-13279,-30117,-12910,-30273,-12540,-30425,-12167,-30572,-11793,-30714,-11417,-30852,-11039,-30985,-10660,-31114,-10279,-31237,-9896,-31357,-9512,-31471,-9127,-31581,-8740,-31685,-8352,-31786,-7962,-31881,-7572,-31971,-7180,-32057,-6787,-32138,-6393,-32214,-5998,-32285,-5602,-32351,-5206,-32413,-4808,-32469,-4410,-32521,-4012,-32568,-3612,-32610,-3212,-32647,-2812,-32679,-2411,-32706,-2010,-32728,-1608,-32745,-1207,-32758,-805,-32765,-403, 32767,0,32761,-604,32744,-1207,32717,-1809,32678,-2411,32628,-3012,32567,-3612,32495,-4211,32412,-4808,32318,-5404,32213,-5998,32097,-6590,31970,-7180,31833,-7767,31684,-8352,31525,-8933,31356,-9512,31175,-10088,30984,-10660,30783,-11228,30571,-11793,30349,-12354,30116,-12910,29873,-13463,29621,-14010,29358,-14553,29085,-15091,28802,-15624,28510,-16151,28208,-16673,27896,-17190,27575,-17700,27244,-18205,26905,-18703,26556,-19195,26198,-19681,25831,-20160,25456,-20632,25072,-21097,24679,-21555,24278,-22005,23869,-22449,23452,-22884,23027,-23312,22594,-23732,22153,-24144,21705,-24547,21249,-24943,20787,-25330,20317,-25708,19840,-26078,19357,-26438,18867,-26790,18371,-27133,17868,-27467,17360,-27791,16845,-28106,16325,-28411,15799,-28707,15268,-28993,14732,-29269,14191,-29535,13645,-29791,13094,-30037,12539,-30273,11980,-30499,11416,-30714,10849,-30919,10278,-31114,9703,-31298,9126,-31471,8545,-31634,7961,-31786,7375,-31927,6786,-32057,6195,-32177,5601,-32285,5006,-32383,4409,-32469,3811,-32545,3211,-32610,2610,-32663,2009,-32706,1406,-32737,804,-32758,201,-32767,-403,-32765,-1006,-32752,-1608,-32728,-2210,-32693,-2812,-32647,-3412,-32589,-4012,-32521,-4609,-32442,-5206,-32351,-5800,-32250,-6393,-32138,-6983,-32015,-7572,-31881,-8157,-31736,-8740,-31581,-9320,-31414,-9896,-31237,-10470,-31050,-11039,-30852,-11605,-30644,-12167,-30425,-12725,-30196,-13279,-29956,-13828,-29707,-14373,-29447,-14912,-29178,-15447,-28898,-15976,-28609,-16500,-28310,-17018,-28002,-17531,-27684,-18037,-27356,-18538,-27020,-19032,-26674,-19520,-26319,-20001,-25955,-20475,-25583,-20943,-25202,-21403,-24812,-21856,-24414,-22302,-24007,-22740,-23593,-23170,-23170,-23593,-22740,-24007,-22302,-24414,-21856,-24812,-21403,-25202,-20943,-25583,-20475,-25955,-20001,-26319,-19520,-26674,-19032,-27020,-18538,-27356,-18037,-27684,-17531,-28002,-17018,-28310,-16500,-28609,-15976,-28898,-15447,-29178,-14912,-29447,-14373,-29707,-13828,-29956,-13279,-30196,-12725,-30425,-12167,-30644,-11605,-30852,-11039,-31050,-10470,-31237,-9896,-31414,-9320,-31581,-8740,-31736,-8157,-31881,-7572,-32015,-6983,-32138,-6393,-32250,-5800,-32351,-5206,-32442,-4609,-32521,-4012,-32589,-3412,-32647,-2812,-32693,-2210,-32728,-1608,-32752,-1006,-32765,-403,-32767,201,-32758,804,-32737,1406,-32706,2009,-32663,2610,-32610,3211,-32545,3811,-32469,4409,-32383,5006,-32285,5601,-32177,6195,-32057,6786,-31927,7375,-31786,7961,-31634,8545,-31471,9126,-31298,9703,-31114,10278,-30919,10849,-30714,11416,-30499,11980,-30273,12539,-30037,13094,-29791,13645,-29535,14191,-29269,14732,-28993,15268,-28707,15799,-28411,16325,-28106,16845,-27791,17360,-27467,17868,-27133,18371,-26790,18867,-26438,19357,-26078,19840,-25708,20317,-25330,20787,-24943,21249,-24547,21705,-24144,22153,-23732,22594,-23312,23027,-22884,23452,-22449,23869,-22005,24278,-21555,24679,-21097,25072,-20632,25456,-20160,25831,-19681,26198,-19195,26556,-18703,26905,-18205,27244,-17700,27575,-17190,27896,-16673,28208,-16151,28510,-15624,28802,-15091,29085,-14553,29358,-14010,29621,-13463,29873,-12910,30116,-12354,30349,-11793,30571,-11228,30783,-10660,30984,-10088,31175,-9512,31356,-8933,31525,-8352,31684,-7767,31833,-7180,31970,-6590,32097,-5998,32213,-5404,32318,-4808,32412,-4211,32495,-3612,32567,-3012,32628,-2411,32678,-1809,32717,-1207,32744,-604,32761 }; - +#ifndef __AVX2__ void dft1024(int16_t *x,int16_t *y,int scale) { @@ -4309,8 +4318,8 @@ void idft1024(int16_t *x,int16_t *y,int scale) } -#ifdef __AVX2__ -void dft1024_simd256(int16_t *x,int16_t *y,int scale) +#else //__AVX2__ +void dft1024(int16_t *x,int16_t *y,int scale) { simd256_q15_t xtmp[128],ytmp[128],*tw1024_256p=(simd256_q15_t *)tw1024,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; @@ -4322,10 +4331,10 @@ void dft1024_simd256(int16_t *x,int16_t *y,int scale) } - dft256_simd256((int16_t*)(xtmp),(int16_t*)(ytmp),1); - dft256_simd256((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1); - dft256_simd256((int16_t*)(xtmp+64),(int16_t*)(ytmp+64),1); - dft256_simd256((int16_t*)(xtmp+96),(int16_t*)(ytmp+96),1); + dft256((int16_t*)(xtmp),(int16_t*)(ytmp),1); + dft256((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1); + dft256((int16_t*)(xtmp+64),(int16_t*)(ytmp+64),1); + dft256((int16_t*)(xtmp+96),(int16_t*)(ytmp+96),1); for (i=0; i<32; i++) { bfly4_256(ytmpp,ytmpp+32,ytmpp+64,ytmpp+96, @@ -4366,7 +4375,7 @@ void dft1024_simd256(int16_t *x,int16_t *y,int scale) } -void idft1024_simd256(int16_t *x,int16_t *y,int scale) +void idft1024(int16_t *x,int16_t *y,int scale) { simd256_q15_t xtmp[128],ytmp[128],*tw1024_256p=(simd256_q15_t *)tw1024,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; @@ -4378,10 +4387,10 @@ void idft1024_simd256(int16_t *x,int16_t *y,int scale) } - idft256_simd256((int16_t*)(xtmp),(int16_t*)(ytmp),1); - idft256_simd256((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1); - idft256_simd256((int16_t*)(xtmp+64),(int16_t*)(ytmp+64),1); - idft256_simd256((int16_t*)(xtmp+96),(int16_t*)(ytmp+96),1); + idft256((int16_t*)(xtmp),(int16_t*)(ytmp),1); + idft256((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1); + idft256((int16_t*)(xtmp+64),(int16_t*)(ytmp+64),1); + idft256((int16_t*)(xtmp+96),(int16_t*)(ytmp+96),1); for (i=0; i<32; i++) { ibfly4_256(ytmpp,ytmpp+32,ytmpp+64,ytmpp+96, @@ -4425,11 +4434,11 @@ void idft1024_simd256(int16_t *x,int16_t *y,int scale) int16_t tw2048[2048] __attribute__((aligned(32))) = {32767,0,32766,-101,32766,-202,32765,-302,32764,-403,32763,-503,32761,-604,32759,-704,32757,-805,32754,-905,32751,-1006,32748,-1106,32744,-1207,32740,-1307,32736,-1407,32732,-1508,32727,-1608,32722,-1709,32717,-1809,32711,-1909,32705,-2010,32699,-2110,32692,-2210,32685,-2311,32678,-2411,32670,-2511,32662,-2611,32654,-2712,32646,-2812,32637,-2912,32628,-3012,32618,-3112,32609,-3212,32599,-3312,32588,-3412,32578,-3512,32567,-3612,32556,-3712,32544,-3812,32532,-3912,32520,-4012,32508,-4111,32495,-4211,32482,-4311,32468,-4410,32455,-4510,32441,-4609,32426,-4709,32412,-4808,32397,-4908,32382,-5007,32366,-5107,32350,-5206,32334,-5305,32318,-5404,32301,-5503,32284,-5602,32267,-5701,32249,-5800,32231,-5899,32213,-5998,32194,-6097,32176,-6196,32156,-6294,32137,-6393,32117,-6492,32097,-6590,32077,-6689,32056,-6787,32035,-6885,32014,-6983,31992,-7082,31970,-7180,31948,-7278,31926,-7376,31903,-7474,31880,-7572,31856,-7669,31833,-7767,31809,-7865,31785,-7962,31760,-8060,31735,-8157,31710,-8254,31684,-8352,31659,-8449,31633,-8546,31606,-8643,31580,-8740,31553,-8837,31525,-8933,31498,-9030,31470,-9127,31442,-9223,31413,-9320,31385,-9416,31356,-9512,31326,-9608,31297,-9704,31267,-9800,31236,-9896,31206,-9992,31175,-10088,31144,-10183,31113,-10279,31081,-10374,31049,-10470,31017,-10565,30984,-10660,30951,-10755,30918,-10850,30885,-10945,30851,-11039,30817,-11134,30783,-11228,30748,-11323,30713,-11417,30678,-11511,30643,-11605,30607,-11699,30571,-11793,30535,-11887,30498,-11981,30461,-12074,30424,-12167,30386,-12261,30349,-12354,30311,-12447,30272,-12540,30234,-12633,30195,-12725,30156,-12818,30116,-12910,30076,-13003,30036,-13095,29996,-13187,29955,-13279,29915,-13371,29873,-13463,29832,-13554,29790,-13646,29748,-13737,29706,-13828,29663,-13919,29621,-14010,29577,-14101,29534,-14192,29490,-14282,29446,-14373,29402,-14463,29358,-14553,29313,-14643,29268,-14733,29222,-14823,29177,-14912,29131,-15002,29085,-15091,29038,-15180,28992,-15269,28945,-15358,28897,-15447,28850,-15535,28802,-15624,28754,-15712,28706,-15800,28657,-15888,28608,-15976,28559,-16064,28510,-16151,28460,-16239,28410,-16326,28360,-16413,28309,-16500,28259,-16587,28208,-16673,28156,-16760,28105,-16846,28053,-16932,28001,-17018,27948,-17104,27896,-17190,27843,-17275,27790,-17361,27736,-17446,27683,-17531,27629,-17616,27575,-17700,27520,-17785,27466,-17869,27411,-17953,27355,-18037,27300,-18121,27244,-18205,27188,-18288,27132,-18372,27076,-18455,27019,-18538,26962,-18621,26905,-18703,26847,-18786,26789,-18868,26731,-18950,26673,-19032,26615,-19114,26556,-19195,26497,-19277,26437,-19358,26378,-19439,26318,-19520,26258,-19600,26198,-19681,26137,-19761,26077,-19841,26016,-19921,25954,-20001,25893,-20080,25831,-20160,25769,-20239,25707,-20318,25645,-20397,25582,-20475,25519,-20554,25456,-20632,25392,-20710,25329,-20788,25265,-20865,25201,-20943,25136,-21020,25072,-21097,25007,-21174,24942,-21250,24877,-21327,24811,-21403,24745,-21479,24679,-21555,24613,-21630,24546,-21706,24480,-21781,24413,-21856,24346,-21931,24278,-22005,24211,-22080,24143,-22154,24075,-22228,24006,-22302,23938,-22375,23869,-22449,23800,-22522,23731,-22595,23661,-22667,23592,-22740,23522,-22812,23452,-22884,23382,-22956,23311,-23028,23240,-23099,23169,-23170,23098,-23241,23027,-23312,22955,-23383,22883,-23453,22811,-23523,22739,-23593,22666,-23662,22594,-23732,22521,-23801,22448,-23870,22374,-23939,22301,-24007,22227,-24076,22153,-24144,22079,-24212,22004,-24279,21930,-24347,21855,-24414,21780,-24481,21705,-24547,21629,-24614,21554,-24680,21478,-24746,21402,-24812,21326,-24878,21249,-24943,21173,-25008,21096,-25073,21019,-25137,20942,-25202,20864,-25266,20787,-25330,20709,-25393,20631,-25457,20553,-25520,20474,-25583,20396,-25646,20317,-25708,20238,-25770,20159,-25832,20079,-25894,20000,-25955,19920,-26017,19840,-26078,19760,-26138,19680,-26199,19599,-26259,19519,-26319,19438,-26379,19357,-26438,19276,-26498,19194,-26557,19113,-26616,19031,-26674,18949,-26732,18867,-26790,18785,-26848,18702,-26906,18620,-26963,18537,-27020,18454,-27077,18371,-27133,18287,-27189,18204,-27245,18120,-27301,18036,-27356,17952,-27412,17868,-27467,17784,-27521,17699,-27576,17615,-27630,17530,-27684,17445,-27737,17360,-27791,17274,-27844,17189,-27897,17103,-27949,17017,-28002,16931,-28054,16845,-28106,16759,-28157,16672,-28209,16586,-28260,16499,-28310,16412,-28361,16325,-28411,16238,-28461,16150,-28511,16063,-28560,15975,-28609,15887,-28658,15799,-28707,15711,-28755,15623,-28803,15534,-28851,15446,-28898,15357,-28946,15268,-28993,15179,-29039,15090,-29086,15001,-29132,14911,-29178,14822,-29223,14732,-29269,14642,-29314,14552,-29359,14462,-29403,14372,-29447,14281,-29491,14191,-29535,14100,-29578,14009,-29622,13918,-29664,13827,-29707,13736,-29749,13645,-29791,13553,-29833,13462,-29874,13370,-29916,13278,-29956,13186,-29997,13094,-30037,13002,-30077,12909,-30117,12817,-30157,12724,-30196,12632,-30235,12539,-30273,12446,-30312,12353,-30350,12260,-30387,12166,-30425,12073,-30462,11980,-30499,11886,-30536,11792,-30572,11698,-30608,11604,-30644,11510,-30679,11416,-30714,11322,-30749,11227,-30784,11133,-30818,11038,-30852,10944,-30886,10849,-30919,10754,-30952,10659,-30985,10564,-31018,10469,-31050,10373,-31082,10278,-31114,10182,-31145,10087,-31176,9991,-31207,9895,-31237,9799,-31268,9703,-31298,9607,-31327,9511,-31357,9415,-31386,9319,-31414,9222,-31443,9126,-31471,9029,-31499,8932,-31526,8836,-31554,8739,-31581,8642,-31607,8545,-31634,8448,-31660,8351,-31685,8253,-31711,8156,-31736,8059,-31761,7961,-31786,7864,-31810,7766,-31834,7668,-31857,7571,-31881,7473,-31904,7375,-31927,7277,-31949,7179,-31971,7081,-31993,6982,-32015,6884,-32036,6786,-32057,6688,-32078,6589,-32098,6491,-32118,6392,-32138,6293,-32157,6195,-32177,6096,-32195,5997,-32214,5898,-32232,5799,-32250,5700,-32268,5601,-32285,5502,-32302,5403,-32319,5304,-32335,5205,-32351,5106,-32367,5006,-32383,4907,-32398,4807,-32413,4708,-32427,4608,-32442,4509,-32456,4409,-32469,4310,-32483,4210,-32496,4110,-32509,4011,-32521,3911,-32533,3811,-32545,3711,-32557,3611,-32568,3511,-32579,3411,-32589,3311,-32600,3211,-32610,3111,-32619,3011,-32629,2911,-32638,2811,-32647,2711,-32655,2610,-32663,2510,-32671,2410,-32679,2310,-32686,2209,-32693,2109,-32700,2009,-32706,1908,-32712,1808,-32718,1708,-32723,1607,-32728,1507,-32733,1406,-32737,1306,-32741,1206,-32745,1105,-32749,1005,-32752,904,-32755,804,-32758,703,-32760,603,-32762,502,-32764,402,-32765,301,-32766,201,-32767,100,-32767,0,-32767,-101,-32767,-202,-32767,-302,-32766,-403,-32765,-503,-32764,-604,-32762,-704,-32760,-805,-32758,-905,-32755,-1006,-32752,-1106,-32749,-1207,-32745,-1307,-32741,-1407,-32737,-1508,-32733,-1608,-32728,-1709,-32723,-1809,-32718,-1909,-32712,-2010,-32706,-2110,-32700,-2210,-32693,-2311,-32686,-2411,-32679,-2511,-32671,-2611,-32663,-2712,-32655,-2812,-32647,-2912,-32638,-3012,-32629,-3112,-32619,-3212,-32610,-3312,-32600,-3412,-32589,-3512,-32579,-3612,-32568,-3712,-32557,-3812,-32545,-3912,-32533,-4012,-32521,-4111,-32509,-4211,-32496,-4311,-32483,-4410,-32469,-4510,-32456,-4609,-32442,-4709,-32427,-4808,-32413,-4908,-32398,-5007,-32383,-5107,-32367,-5206,-32351,-5305,-32335,-5404,-32319,-5503,-32302,-5602,-32285,-5701,-32268,-5800,-32250,-5899,-32232,-5998,-32214,-6097,-32195,-6196,-32177,-6294,-32157,-6393,-32138,-6492,-32118,-6590,-32098,-6689,-32078,-6787,-32057,-6885,-32036,-6983,-32015,-7082,-31993,-7180,-31971,-7278,-31949,-7376,-31927,-7474,-31904,-7572,-31881,-7669,-31857,-7767,-31834,-7865,-31810,-7962,-31786,-8060,-31761,-8157,-31736,-8254,-31711,-8352,-31685,-8449,-31660,-8546,-31634,-8643,-31607,-8740,-31581,-8837,-31554,-8933,-31526,-9030,-31499,-9127,-31471,-9223,-31443,-9320,-31414,-9416,-31386,-9512,-31357,-9608,-31327,-9704,-31298,-9800,-31268,-9896,-31237,-9992,-31207,-10088,-31176,-10183,-31145,-10279,-31114,-10374,-31082,-10470,-31050,-10565,-31018,-10660,-30985,-10755,-30952,-10850,-30919,-10945,-30886,-11039,-30852,-11134,-30818,-11228,-30784,-11323,-30749,-11417,-30714,-11511,-30679,-11605,-30644,-11699,-30608,-11793,-30572,-11887,-30536,-11981,-30499,-12074,-30462,-12167,-30425,-12261,-30387,-12354,-30350,-12447,-30312,-12540,-30273,-12633,-30235,-12725,-30196,-12818,-30157,-12910,-30117,-13003,-30077,-13095,-30037,-13187,-29997,-13279,-29956,-13371,-29916,-13463,-29874,-13554,-29833,-13646,-29791,-13737,-29749,-13828,-29707,-13919,-29664,-14010,-29622,-14101,-29578,-14192,-29535,-14282,-29491,-14373,-29447,-14463,-29403,-14553,-29359,-14643,-29314,-14733,-29269,-14823,-29223,-14912,-29178,-15002,-29132,-15091,-29086,-15180,-29039,-15269,-28993,-15358,-28946,-15447,-28898,-15535,-28851,-15624,-28803,-15712,-28755,-15800,-28707,-15888,-28658,-15976,-28609,-16064,-28560,-16151,-28511,-16239,-28461,-16326,-28411,-16413,-28361,-16500,-28310,-16587,-28260,-16673,-28209,-16760,-28157,-16846,-28106,-16932,-28054,-17018,-28002,-17104,-27949,-17190,-27897,-17275,-27844,-17361,-27791,-17446,-27737,-17531,-27684,-17616,-27630,-17700,-27576,-17785,-27521,-17869,-27467,-17953,-27412,-18037,-27356,-18121,-27301,-18205,-27245,-18288,-27189,-18372,-27133,-18455,-27077,-18538,-27020,-18621,-26963,-18703,-26906,-18786,-26848,-18868,-26790,-18950,-26732,-19032,-26674,-19114,-26616,-19195,-26557,-19277,-26498,-19358,-26438,-19439,-26379,-19520,-26319,-19600,-26259,-19681,-26199,-19761,-26138,-19841,-26078,-19921,-26017,-20001,-25955,-20080,-25894,-20160,-25832,-20239,-25770,-20318,-25708,-20397,-25646,-20475,-25583,-20554,-25520,-20632,-25457,-20710,-25393,-20788,-25330,-20865,-25266,-20943,-25202,-21020,-25137,-21097,-25073,-21174,-25008,-21250,-24943,-21327,-24878,-21403,-24812,-21479,-24746,-21555,-24680,-21630,-24614,-21706,-24547,-21781,-24481,-21856,-24414,-21931,-24347,-22005,-24279,-22080,-24212,-22154,-24144,-22228,-24076,-22302,-24007,-22375,-23939,-22449,-23870,-22522,-23801,-22595,-23732,-22667,-23662,-22740,-23593,-22812,-23523,-22884,-23453,-22956,-23383,-23028,-23312,-23099,-23241,-23170,-23170,-23241,-23099,-23312,-23028,-23383,-22956,-23453,-22884,-23523,-22812,-23593,-22740,-23662,-22667,-23732,-22595,-23801,-22522,-23870,-22449,-23939,-22375,-24007,-22302,-24076,-22228,-24144,-22154,-24212,-22080,-24279,-22005,-24347,-21931,-24414,-21856,-24481,-21781,-24547,-21706,-24614,-21630,-24680,-21555,-24746,-21479,-24812,-21403,-24878,-21327,-24943,-21250,-25008,-21174,-25073,-21097,-25137,-21020,-25202,-20943,-25266,-20865,-25330,-20788,-25393,-20710,-25457,-20632,-25520,-20554,-25583,-20475,-25646,-20397,-25708,-20318,-25770,-20239,-25832,-20160,-25894,-20080,-25955,-20001,-26017,-19921,-26078,-19841,-26138,-19761,-26199,-19681,-26259,-19600,-26319,-19520,-26379,-19439,-26438,-19358,-26498,-19277,-26557,-19195,-26616,-19114,-26674,-19032,-26732,-18950,-26790,-18868,-26848,-18786,-26906,-18703,-26963,-18621,-27020,-18538,-27077,-18455,-27133,-18372,-27189,-18288,-27245,-18205,-27301,-18121,-27356,-18037,-27412,-17953,-27467,-17869,-27521,-17785,-27576,-17700,-27630,-17616,-27684,-17531,-27737,-17446,-27791,-17361,-27844,-17275,-27897,-17190,-27949,-17104,-28002,-17018,-28054,-16932,-28106,-16846,-28157,-16760,-28209,-16673,-28260,-16587,-28310,-16500,-28361,-16413,-28411,-16326,-28461,-16239,-28511,-16151,-28560,-16064,-28609,-15976,-28658,-15888,-28707,-15800,-28755,-15712,-28803,-15624,-28851,-15535,-28898,-15447,-28946,-15358,-28993,-15269,-29039,-15180,-29086,-15091,-29132,-15002,-29178,-14912,-29223,-14823,-29269,-14733,-29314,-14643,-29359,-14553,-29403,-14463,-29447,-14373,-29491,-14282,-29535,-14192,-29578,-14101,-29622,-14010,-29664,-13919,-29707,-13828,-29749,-13737,-29791,-13646,-29833,-13554,-29874,-13463,-29916,-13371,-29956,-13279,-29997,-13187,-30037,-13095,-30077,-13003,-30117,-12910,-30157,-12818,-30196,-12725,-30235,-12633,-30273,-12540,-30312,-12447,-30350,-12354,-30387,-12261,-30425,-12167,-30462,-12074,-30499,-11981,-30536,-11887,-30572,-11793,-30608,-11699,-30644,-11605,-30679,-11511,-30714,-11417,-30749,-11323,-30784,-11228,-30818,-11134,-30852,-11039,-30886,-10945,-30919,-10850,-30952,-10755,-30985,-10660,-31018,-10565,-31050,-10470,-31082,-10374,-31114,-10279,-31145,-10183,-31176,-10088,-31207,-9992,-31237,-9896,-31268,-9800,-31298,-9704,-31327,-9608,-31357,-9512,-31386,-9416,-31414,-9320,-31443,-9223,-31471,-9127,-31499,-9030,-31526,-8933,-31554,-8837,-31581,-8740,-31607,-8643,-31634,-8546,-31660,-8449,-31685,-8352,-31711,-8254,-31736,-8157,-31761,-8060,-31786,-7962,-31810,-7865,-31834,-7767,-31857,-7669,-31881,-7572,-31904,-7474,-31927,-7376,-31949,-7278,-31971,-7180,-31993,-7082,-32015,-6983,-32036,-6885,-32057,-6787,-32078,-6689,-32098,-6590,-32118,-6492,-32138,-6393,-32157,-6294,-32177,-6196,-32195,-6097,-32214,-5998,-32232,-5899,-32250,-5800,-32268,-5701,-32285,-5602,-32302,-5503,-32319,-5404,-32335,-5305,-32351,-5206,-32367,-5107,-32383,-5007,-32398,-4908,-32413,-4808,-32427,-4709,-32442,-4609,-32456,-4510,-32469,-4410,-32483,-4311,-32496,-4211,-32509,-4111,-32521,-4012,-32533,-3912,-32545,-3812,-32557,-3712,-32568,-3612,-32579,-3512,-32589,-3412,-32600,-3312,-32610,-3212,-32619,-3112,-32629,-3012,-32638,-2912,-32647,-2812,-32655,-2712,-32663,-2611,-32671,-2511,-32679,-2411,-32686,-2311,-32693,-2210,-32700,-2110,-32706,-2010,-32712,-1909,-32718,-1809,-32723,-1709,-32728,-1608,-32733,-1508,-32737,-1407,-32741,-1307,-32745,-1207,-32749,-1106,-32752,-1006,-32755,-905,-32758,-805,-32760,-704,-32762,-604,-32764,-503,-32765,-403,-32766,-302,-32767,-202,-32767,-101}; - +#ifndef __AVX2__ void dft2048(int16_t *x,int16_t *y,int scale) { - simdshort_q15_t xtmp[2048],*xtmpp,*x64 = (simdshort_q15_t *)x; + simdshort_q15_t xtmp[1024],*xtmpp,*x64 = (simdshort_q15_t *)x; simd_q15_t ytmp[512],*tw2048_128p=(simd_q15_t *)tw2048,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; simd_q15_t *ytmpp = &ytmp[0]; int i; @@ -4519,7 +4528,7 @@ void dft2048(int16_t *x,int16_t *y,int scale) void idft2048(int16_t *x,int16_t *y,int scale) { - simdshort_q15_t xtmp[2048],*xtmpp,*x64 = (simdshort_q15_t *)x; + simdshort_q15_t xtmp[1024],*xtmpp,*x64 = (simdshort_q15_t *)x; simd_q15_t ytmp[512],*tw2048_128p=(simd_q15_t *)tw2048,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; simd_q15_t *ytmpp = &ytmp[0]; int i; @@ -4606,9 +4615,9 @@ void idft2048(int16_t *x,int16_t *y,int scale) } -#ifdef __AVX2__ +#else // __AVX2__ -void dft2048_simd256(int16_t *x,int16_t *y,int scale) +void dft2048(int16_t *x,int16_t *y,int scale) { simd256_q15_t xtmp[256],*xtmpp,*x256 = (simd256_q15_t *)x; @@ -4656,8 +4665,8 @@ void dft2048_simd256(int16_t *x,int16_t *y,int scale) xtmpp+=32; } - dft1024_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); - dft1024_simd256((int16_t*)(xtmp+256),(int16_t*)(ytmp+128),1); + dft1024((int16_t*)(xtmp),(int16_t*)ytmp,1); + dft1024((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1); for (i=0; i<128; i++) { @@ -4698,7 +4707,7 @@ void dft2048_simd256(int16_t *x,int16_t *y,int scale) } -void idft2048_simd256(int16_t *x,int16_t *y,int scale) +void idft2048(int16_t *x,int16_t *y,int scale) { simd256_q15_t xtmp[256],*xtmpp,*x256 = (simd256_q15_t *)x; @@ -4746,8 +4755,8 @@ void idft2048_simd256(int16_t *x,int16_t *y,int scale) xtmpp+=32; } - idft1024_simd256((int16_t*)(xtmp),(int16_t*)ytmp,1); - idft1024_simd256((int16_t*)(xtmp+256),(int16_t*)(ytmp+128),1); + idft1024((int16_t*)(xtmp),(int16_t*)ytmp,1); + idft1024((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1); for (i=0; i<128; i++) { @@ -4919,10 +4928,10 @@ void dft4096_simd256(int16_t *x,int16_t *y,int scale) } - dft1024_simd256((int16_t*)(xtmp),(int16_t*)(ytmp),1); - dft1024_simd256((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1); - dft1024_simd256((int16_t*)(xtmp+256),(int16_t*)(ytmp+256),1); - dft1024_simd256((int16_t*)(xtmp+384),(int16_t*)(ytmp+384),1); + dft1024((int16_t*)(xtmp),(int16_t*)(ytmp),1); + dft1024((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1); + dft1024((int16_t*)(xtmp+256),(int16_t*)(ytmp+256),1); + dft1024((int16_t*)(xtmp+384),(int16_t*)(ytmp+384),1); for (i=0; i<128; i++) { bfly4_256(ytmpp,ytmpp+128,ytmpp+256,ytmpp+384, @@ -4975,10 +4984,10 @@ void idft4096_simd256(int16_t *x,int16_t *y,int scale) } - idft1024_simd256((int16_t*)(xtmp),(int16_t*)(ytmp),1); - idft1024_simd256((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1); - idft1024_simd256((int16_t*)(xtmp+256),(int16_t*)(ytmp+256),1); - idft1024_simd256((int16_t*)(xtmp+384),(int16_t*)(ytmp+384),1); + idft1024((int16_t*)(xtmp),(int16_t*)(ytmp),1); + idft1024((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1); + idft1024((int16_t*)(xtmp+256),(int16_t*)(ytmp+256),1); + idft1024((int16_t*)(xtmp+384),(int16_t*)(ytmp+384),1); for (i=0; i<128; i++) { ibfly4_256(ytmpp,ytmpp+128,ytmpp+256,ytmpp+384, @@ -18385,7 +18394,6 @@ void dft1200(int16_t *x,int16_t *y,unsigned char scale_flag) if (scale_flag==1) { norm128 = set1_int16(16384);//dft_norm_table[13]); - for (i=0; i<1200; i++) { y128[i] = mulhi_int16(y128[i],norm128); } @@ -18407,8 +18415,11 @@ int main(int argc, char**argv) time_stats_t ts; +#ifdef __AVX2__ simd256_q15_t x[2048],y[2048],tw0,tw1,tw2,tw3; - +#else + simd_q15_t x[4096],y[4096],tw0,tw1,tw2,tw3; +#endif int i; set_taus_seed(0); @@ -18754,62 +18765,58 @@ int main(int argc, char**argv) ((int16_t*)x)[1+(i<<1)] = 0; ((int16_t*)x)[2+(i<<1)] = -1024; ((int16_t*)x)[3+(i<<1)] = 0; - }*/ - /* - for (i=0;i<128;i++) { + } + + for (i=0;i<2048*2;i++) { ((int16_t*)x)[i] = i/2;//(int16_t)((taus()&0xffff))>>5; - }*/ - /* - memset((void*)&y[0],0,64*4); - dft64_simd256((int16_t *)x,(int16_t *)y,1); + } + */ + memset((void*)&x[0],0,64*sizeof(int32_t)); + for (i=2;i<36;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } + for (i=(128-36);i<128;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } + idft64((int16_t *)x,(int16_t *)y,1); printf("64-point\n"); printf("X: "); - for (i=0;i<4;i++) + for (i=0;i<8;i++) print_shorts256("",((int16_t *)x)+(i*16)); printf("\nY:"); - for (i=0;i<4;i++) + for (i=0;i<8;i++) print_shorts256("",((int16_t *)y)+(i*16)); printf("\n"); - dft64((int16_t *)x,(int16_t *)y,1); - dft64((int16_t *)x,(int16_t *)y,1); - dft64((int16_t *)x,(int16_t *)y,1); + + + idft64((int16_t *)x,(int16_t *)y,1); + idft64((int16_t *)x,(int16_t *)y,1); + idft64((int16_t *)x,(int16_t *)y,1); reset_meas(&ts); for (i=0; i<10000000; i++) { start_meas(&ts); - dft64((int16_t *)x,(int16_t *)y,1); + idft64((int16_t *)x,(int16_t *)y,1); stop_meas(&ts); } printf("\n\n64-point (%f cycles, #trials %d)\n",(double)ts.diff/(double)ts.trials,ts.trials); // write_output("x64.m","x64",x,64,1,1); - // write_output("y64.m","y64",y,64,1,1); - -#ifdef __AVX2__ - dft64_simd256((int16_t *)x,(int16_t *)y,1); - dft64_simd256((int16_t *)x,(int16_t *)y,1); - dft64_simd256((int16_t *)x,(int16_t *)y,1); - reset_meas(&ts); - - for (i=0; i<10000000; i++) { - start_meas(&ts); - dft64_simd256((int16_t *)x,(int16_t *)y,1); - stop_meas(&ts); - } - - printf("\n\n64-point AVX2 (%f cycles, #trials %d)\n",(double)ts.diff/(double)ts.trials,ts.trials); - write_output("x64_256.m","x64_256",x,64,1,1); - write_output("y64_256.m","y64_256",y,64,1,1); - -#endif - */ + write_output("y64.m","y64",y,64,1,1); + write_output("x64.m","x64",x,64,1,1); /* printf("X: "); @@ -18831,33 +18838,32 @@ int main(int argc, char**argv) } */ - memset((void*)&y[0],0,128*4); + memset((void*)&x[0],0,128*4); + for (i=2;i<72;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } + for (i=(256-72);i<256;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } reset_meas(&ts); for (i=0; i<10000; i++) { start_meas(&ts); - dft128((int16_t *)x,(int16_t *)y,1); + idft128((int16_t *)x,(int16_t *)y,1); stop_meas(&ts); } printf("\n\n128-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); - -#ifdef __AVX2__ - memset((void*)&y[0],0,128*4); - reset_meas(&ts); - - for (i=0; i<10000; i++) { - start_meas(&ts); - dft128_simd256((int16_t *)x,(int16_t *)y,1); - stop_meas(&ts); - } - - printf("\n\n128-point AVX2 (%f cycles)\n",(double)ts.diff/(double)ts.trials); - write_output("x128_256.m","x128_256",x,128,1,1); - write_output("y128_256.m","y128_256",y,128,1,1); -#endif - - /* printf("X: "); + write_output("y128.m","y128",y,128,1,1); + write_output("x128.m","x128",x,128,1,1); +/* + printf("X: "); for (i=0;i<32;i++) printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&x[i])[0],((int16_t *)&x[i])[1],((int16_t*)&x[i])[2],((int16_t *)&x[i])[3],((int16_t*)&x[i])[4],((int16_t*)&x[i])[5],((int16_t*)&x[i])[6],((int16_t*)&x[i])[7]); printf("\nY:"); @@ -18865,7 +18871,7 @@ int main(int argc, char**argv) for (i=0;i<32;i++) printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&y[i])[0],((int16_t *)&y[i])[1],((int16_t*)&y[i])[2],((int16_t *)&y[i])[3],((int16_t*)&y[i])[4],((int16_t *)&y[i])[5],((int16_t*)&y[i])[6],((int16_t *)&y[i])[7]); printf("\n"); - */ +*/ /* for (i=0; i<512; i++) { @@ -18874,52 +18880,55 @@ int main(int argc, char**argv) memset((void*)&y[0],0,256*4); */ + memset((void*)&x[0],0,256*sizeof(int32_t)); + for (i=2;i<144;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } + for (i=(512-144);i<512;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } reset_meas(&ts); for (i=0; i<10000; i++) { start_meas(&ts); - dft256((int16_t *)x,(int16_t *)y,1); + idft256((int16_t *)x,(int16_t *)y,1); stop_meas(&ts); } printf("\n\n256-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); + write_output("y256.m","y256",y,256,1,1); + write_output("x256.m","x256",x,256,1,1); -#ifdef __AVX2__ - reset_meas(&ts); - - for (i=0; i<10000; i++) { - start_meas(&ts); - dft256_simd256((int16_t *)x,(int16_t *)y,1); - stop_meas(&ts); + memset((void*)&x[0],0,512*sizeof(int32_t)); + for (i=2;i<302;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } + for (i=(1024-300);i<1024;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; } - printf("\n\n256-point AVX2 (%f cycles)\n",(double)ts.diff/(double)ts.trials); - -#endif - reset_meas(&ts); for (i=0; i<10000; i++) { start_meas(&ts); - dft512((int16_t *)x,(int16_t *)y,1); + idft512((int16_t *)x,(int16_t *)y,1); stop_meas(&ts); } printf("\n\n512-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); - -#ifdef __AVX2__ - reset_meas(&ts); - for (i=0; i<10000; i++) { - start_meas(&ts); - dft512_simd256((int16_t *)x,(int16_t *)y,1); - stop_meas(&ts); - } - - printf("\n\n512-point AVX2 (%f cycles)\n",(double)ts.diff/(double)ts.trials); - -#endif - // write_output("x.m","x",x,512,1,1); - // write_output("y.m","y",y,512,1,1); - + write_output("y512.m","y512",y,512,1,1); + write_output("x512.m","x512",x,512,1,1); /* printf("X: "); for (i=0;i<64;i++) @@ -18931,51 +18940,56 @@ int main(int argc, char**argv) printf("\n"); */ + memset((void*)x,0,1024*sizeof(int32_t)); + for (i=2;i<602;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } + for (i=2*724;i<2048;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } reset_meas(&ts); for (i=0; i<10000; i++) { start_meas(&ts); - dft1024((int16_t *)x,(int16_t *)y,1); + idft1024((int16_t *)x,(int16_t *)y,1); stop_meas(&ts); } printf("\n\n1024-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); + write_output("y1024.m","y1024",y,1024,1,1); + write_output("x1024.m","x1024",x,1024,1,1); -#ifdef __AVX2__ - reset_meas(&ts); - - for (i=0; i<10000; i++) { - start_meas(&ts); - dft1024_simd256((int16_t *)x,(int16_t *)y,1); - stop_meas(&ts); + memset((void*)x,0,2048*sizeof(int32_t)); + for (i=2;i<1202;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } + for (i=2*(2048-600);i<4096;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; } - - printf("\n\n1024-point - AVX2 (%f cycles)\n",(double)ts.diff/(double)ts.trials); -#endif - reset_meas(&ts); for (i=0; i<10000; i++) { start_meas(&ts); - dft2048((int16_t *)x,(int16_t *)y,1); + idft2048((int16_t *)x,(int16_t *)y,1); stop_meas(&ts); } printf("\n\n2048-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); + write_output("y2048.m","y2048",y,2048,1,1); + write_output("x2048.m","x2048",x,2048,1,1); -#ifdef __AVX2__ - - reset_meas(&ts); - - for (i=0; i<10000; i++) { - start_meas(&ts); - dft2048_simd256((int16_t *)x,(int16_t *)y,1); - stop_meas(&ts); - } - - printf("\n\n2048-point AVX2 (%f cycles)\n",(double)ts.diff/(double)ts.trials); - -#endif return(0); } diff --git a/openair1/PHY/TOOLS/twiddles8192.h b/openair1/PHY/TOOLS/twiddles8192.h new file mode 100644 index 0000000000..ddb8ab2273 --- /dev/null +++ b/openair1/PHY/TOOLS/twiddles8192.h @@ -0,0 +1,12 @@ +/* Twiddles generated with +twa = floor(32767*exp(-sqrt(-1)*2*pi*(0:4095)/8192)); +twa2 = zeros(1,2*4096); +twa2(1:2:end) = real(twa); +twa2(2:2:end) = imag(twa); +fd=fopen("twiddle_tmp.txt","w"); +fprintf(fd,"static int16_t tw8192[4096*2] = {"); +fprintf(fd,"%d,",twa2(1:(4096*2)-1)); +fprintf(fd,"%d};\n",twa2(end)); +fclose(fd); +*/ +static int16_t tw8192[4096*2] = {32767,0,32766,-26,32766,-51,32766,-76,32766,-101,32766,-126,32766,-151,32766,-176,32766,-202,32766,-227,32766,-252,32765,-277,32765,-302,32765,-327,32765,-352,32764,-377,32764,-403,32764,-428,32763,-453,32763,-478,32763,-503,32762,-528,32762,-553,32761,-579,32761,-604,32760,-629,32760,-654,32759,-679,32759,-704,32758,-729,32758,-754,32757,-780,32757,-805,32756,-830,32755,-855,32755,-880,32754,-905,32753,-930,32753,-955,32752,-981,32751,-1006,32750,-1031,32750,-1056,32749,-1081,32748,-1106,32747,-1131,32746,-1156,32745,-1181,32744,-1207,32743,-1232,32742,-1257,32741,-1282,32740,-1307,32739,-1332,32738,-1357,32737,-1382,32736,-1407,32735,-1433,32734,-1458,32733,-1483,32732,-1508,32731,-1533,32729,-1558,32728,-1583,32727,-1608,32726,-1633,32725,-1659,32723,-1684,32722,-1709,32721,-1734,32719,-1759,32718,-1784,32717,-1809,32715,-1834,32714,-1859,32712,-1884,32711,-1909,32709,-1935,32708,-1960,32706,-1985,32705,-2010,32703,-2035,32702,-2060,32700,-2085,32699,-2110,32697,-2135,32695,-2160,32694,-2185,32692,-2210,32690,-2236,32688,-2261,32687,-2286,32685,-2311,32683,-2336,32681,-2361,32680,-2386,32678,-2411,32676,-2436,32674,-2461,32672,-2486,32670,-2511,32668,-2536,32666,-2561,32664,-2586,32662,-2611,32660,-2637,32658,-2662,32656,-2687,32654,-2712,32652,-2737,32650,-2762,32648,-2787,32646,-2812,32644,-2837,32641,-2862,32639,-2887,32637,-2912,32635,-2937,32632,-2962,32630,-2987,32628,-3012,32625,-3037,32623,-3062,32621,-3087,32618,-3112,32616,-3137,32614,-3162,32611,-3187,32609,-3212,32606,-3237,32604,-3262,32601,-3287,32599,-3312,32596,-3337,32594,-3362,32591,-3387,32588,-3412,32586,-3437,32583,-3462,32580,-3487,32578,-3512,32575,-3537,32572,-3562,32570,-3587,32567,-3612,32564,-3637,32561,-3662,32558,-3687,32556,-3712,32553,-3737,32550,-3762,32547,-3787,32544,-3812,32541,-3837,32538,-3862,32535,-3887,32532,-3912,32529,-3937,32526,-3962,32523,-3987,32520,-4012,32517,-4036,32514,-4061,32511,-4086,32508,-4111,32504,-4136,32501,-4161,32498,-4186,32495,-4211,32492,-4236,32488,-4261,32485,-4286,32482,-4311,32478,-4336,32475,-4360,32472,-4385,32468,-4410,32465,-4435,32462,-4460,32458,-4485,32455,-4510,32451,-4535,32448,-4560,32444,-4585,32441,-4609,32437,-4634,32434,-4659,32430,-4684,32426,-4709,32423,-4734,32419,-4759,32416,-4784,32412,-4808,32408,-4833,32404,-4858,32401,-4883,32397,-4908,32393,-4933,32389,-4958,32386,-4982,32382,-5007,32378,-5032,32374,-5057,32370,-5082,32366,-5107,32362,-5131,32358,-5156,32354,-5181,32350,-5206,32346,-5231,32342,-5255,32338,-5280,32334,-5305,32330,-5330,32326,-5355,32322,-5379,32318,-5404,32314,-5429,32310,-5454,32305,-5479,32301,-5503,32297,-5528,32293,-5553,32288,-5578,32284,-5602,32280,-5627,32275,-5652,32271,-5677,32267,-5701,32262,-5726,32258,-5751,32254,-5776,32249,-5800,32245,-5825,32240,-5850,32236,-5875,32231,-5899,32227,-5924,32222,-5949,32218,-5973,32213,-5998,32208,-6023,32204,-6048,32199,-6072,32194,-6097,32190,-6122,32185,-6146,32180,-6171,32176,-6196,32171,-6220,32166,-6245,32161,-6270,32156,-6294,32152,-6319,32147,-6344,32142,-6368,32137,-6393,32132,-6418,32127,-6442,32122,-6467,32117,-6492,32112,-6516,32107,-6541,32102,-6565,32097,-6590,32092,-6615,32087,-6639,32082,-6664,32077,-6689,32072,-6713,32066,-6738,32061,-6762,32056,-6787,32051,-6812,32046,-6836,32040,-6861,32035,-6885,32030,-6910,32024,-6934,32019,-6959,32014,-6983,32008,-7008,32003,-7033,31998,-7057,31992,-7082,31987,-7106,31981,-7131,31976,-7155,31970,-7180,31965,-7204,31959,-7229,31954,-7253,31948,-7278,31943,-7302,31937,-7327,31931,-7351,31926,-7376,31920,-7400,31914,-7425,31909,-7449,31903,-7474,31897,-7498,31891,-7523,31886,-7547,31880,-7572,31874,-7596,31868,-7620,31862,-7645,31856,-7669,31851,-7694,31845,-7718,31839,-7743,31833,-7767,31827,-7791,31821,-7816,31815,-7840,31809,-7865,31803,-7889,31797,-7913,31791,-7938,31785,-7962,31778,-7987,31772,-8011,31766,-8035,31760,-8060,31754,-8084,31748,-8108,31741,-8133,31735,-8157,31729,-8181,31723,-8206,31716,-8230,31710,-8254,31704,-8279,31697,-8303,31691,-8327,31684,-8352,31678,-8376,31672,-8400,31665,-8425,31659,-8449,31652,-8473,31646,-8497,31639,-8522,31633,-8546,31626,-8570,31619,-8594,31613,-8619,31606,-8643,31600,-8667,31593,-8691,31586,-8716,31580,-8740,31573,-8764,31566,-8788,31559,-8813,31553,-8837,31546,-8861,31539,-8885,31532,-8909,31525,-8933,31518,-8958,31512,-8982,31505,-9006,31498,-9030,31491,-9054,31484,-9078,31477,-9103,31470,-9127,31463,-9151,31456,-9175,31449,-9199,31442,-9223,31435,-9247,31428,-9271,31420,-9296,31413,-9320,31406,-9344,31399,-9368,31392,-9392,31385,-9416,31377,-9440,31370,-9464,31363,-9488,31356,-9512,31348,-9536,31341,-9560,31334,-9584,31326,-9608,31319,-9632,31311,-9656,31304,-9680,31297,-9704,31289,-9728,31282,-9752,31274,-9776,31267,-9800,31259,-9824,31252,-9848,31244,-9872,31236,-9896,31229,-9920,31221,-9944,31214,-9968,31206,-9992,31198,-10016,31191,-10040,31183,-10064,31175,-10088,31167,-10112,31160,-10136,31152,-10160,31144,-10183,31136,-10207,31128,-10231,31121,-10255,31113,-10279,31105,-10303,31097,-10327,31089,-10350,31081,-10374,31073,-10398,31065,-10422,31057,-10446,31049,-10470,31041,-10493,31033,-10517,31025,-10541,31017,-10565,31009,-10589,31001,-10612,30992,-10636,30984,-10660,30976,-10684,30968,-10707,30960,-10731,30951,-10755,30943,-10779,30935,-10802,30927,-10826,30918,-10850,30910,-10874,30902,-10897,30893,-10921,30885,-10945,30876,-10968,30868,-10992,30860,-11016,30851,-11039,30843,-11063,30834,-11087,30826,-11110,30817,-11134,30809,-11158,30800,-11181,30791,-11205,30783,-11228,30774,-11252,30766,-11276,30757,-11299,30748,-11323,30739,-11346,30731,-11370,30722,-11394,30713,-11417,30705,-11441,30696,-11464,30687,-11488,30678,-11511,30669,-11535,30660,-11558,30652,-11582,30643,-11605,30634,-11629,30625,-11652,30616,-11676,30607,-11699,30598,-11723,30589,-11746,30580,-11770,30571,-11793,30562,-11817,30553,-11840,30544,-11863,30535,-11887,30525,-11910,30516,-11934,30507,-11957,30498,-11981,30489,-12004,30480,-12027,30470,-12051,30461,-12074,30452,-12097,30442,-12121,30433,-12144,30424,-12167,30415,-12191,30405,-12214,30396,-12237,30386,-12261,30377,-12284,30368,-12307,30358,-12331,30349,-12354,30339,-12377,30330,-12400,30320,-12424,30311,-12447,30301,-12470,30291,-12493,30282,-12517,30272,-12540,30263,-12563,30253,-12586,30243,-12610,30234,-12633,30224,-12656,30214,-12679,30205,-12702,30195,-12725,30185,-12749,30175,-12772,30165,-12795,30156,-12818,30146,-12841,30136,-12864,30126,-12887,30116,-12910,30106,-12934,30096,-12957,30086,-12980,30076,-13003,30066,-13026,30056,-13049,30046,-13072,30036,-13095,30026,-13118,30016,-13141,30006,-13164,29996,-13187,29986,-13210,29976,-13233,29966,-13256,29955,-13279,29945,-13302,29935,-13325,29925,-13348,29915,-13371,29904,-13394,29894,-13417,29884,-13440,29873,-13463,29863,-13486,29853,-13508,29842,-13531,29832,-13554,29822,-13577,29811,-13600,29801,-13623,29790,-13646,29780,-13668,29769,-13691,29759,-13714,29748,-13737,29738,-13760,29727,-13783,29717,-13805,29706,-13828,29695,-13851,29685,-13874,29674,-13896,29663,-13919,29653,-13942,29642,-13965,29631,-13987,29621,-14010,29610,-14033,29599,-14056,29588,-14078,29577,-14101,29567,-14124,29556,-14146,29545,-14169,29534,-14192,29523,-14214,29512,-14237,29501,-14260,29490,-14282,29479,-14305,29468,-14327,29457,-14350,29446,-14373,29435,-14395,29424,-14418,29413,-14440,29402,-14463,29391,-14485,29380,-14508,29369,-14531,29358,-14553,29346,-14576,29335,-14598,29324,-14621,29313,-14643,29302,-14666,29290,-14688,29279,-14710,29268,-14733,29256,-14755,29245,-14778,29234,-14800,29222,-14823,29211,-14845,29200,-14867,29188,-14890,29177,-14912,29165,-14935,29154,-14957,29142,-14979,29131,-15002,29119,-15024,29108,-15046,29096,-15069,29085,-15091,29073,-15113,29062,-15136,29050,-15158,29038,-15180,29027,-15202,29015,-15225,29003,-15247,28992,-15269,28980,-15291,28968,-15314,28956,-15336,28945,-15358,28933,-15380,28921,-15402,28909,-15425,28897,-15447,28886,-15469,28874,-15491,28862,-15513,28850,-15535,28838,-15557,28826,-15580,28814,-15602,28802,-15624,28790,-15646,28778,-15668,28766,-15690,28754,-15712,28742,-15734,28730,-15756,28718,-15778,28706,-15800,28694,-15822,28681,-15844,28669,-15866,28657,-15888,28645,-15910,28633,-15932,28620,-15954,28608,-15976,28596,-15998,28584,-16020,28571,-16042,28559,-16064,28547,-16086,28534,-16108,28522,-16129,28510,-16151,28497,-16173,28485,-16195,28472,-16217,28460,-16239,28447,-16261,28435,-16282,28423,-16304,28410,-16326,28397,-16348,28385,-16369,28372,-16391,28360,-16413,28347,-16435,28335,-16456,28322,-16478,28309,-16500,28297,-16522,28284,-16543,28271,-16565,28259,-16587,28246,-16608,28233,-16630,28220,-16652,28208,-16673,28195,-16695,28182,-16717,28169,-16738,28156,-16760,28143,-16781,28131,-16803,28118,-16825,28105,-16846,28092,-16868,28079,-16889,28066,-16911,28053,-16932,28040,-16954,28027,-16975,28014,-16997,28001,-17018,27988,-17040,27975,-17061,27962,-17083,27948,-17104,27935,-17125,27922,-17147,27909,-17168,27896,-17190,27883,-17211,27869,-17233,27856,-17254,27843,-17275,27830,-17297,27816,-17318,27803,-17339,27790,-17361,27777,-17382,27763,-17403,27750,-17424,27736,-17446,27723,-17467,27710,-17488,27696,-17510,27683,-17531,27669,-17552,27656,-17573,27642,-17594,27629,-17616,27615,-17637,27602,-17658,27588,-17679,27575,-17700,27561,-17721,27548,-17743,27534,-17764,27520,-17785,27507,-17806,27493,-17827,27479,-17848,27466,-17869,27452,-17890,27438,-17911,27424,-17932,27411,-17953,27397,-17974,27383,-17995,27369,-18016,27355,-18037,27342,-18058,27328,-18079,27314,-18100,27300,-18121,27286,-18142,27272,-18163,27258,-18184,27244,-18205,27230,-18226,27216,-18247,27202,-18268,27188,-18288,27174,-18309,27160,-18330,27146,-18351,27132,-18372,27118,-18393,27104,-18413,27090,-18434,27076,-18455,27061,-18476,27047,-18496,27033,-18517,27019,-18538,27005,-18559,26990,-18579,26976,-18600,26962,-18621,26948,-18641,26933,-18662,26919,-18683,26905,-18703,26890,-18724,26876,-18745,26861,-18765,26847,-18786,26833,-18806,26818,-18827,26804,-18847,26789,-18868,26775,-18889,26760,-18909,26746,-18930,26731,-18950,26717,-18971,26702,-18991,26688,-19012,26673,-19032,26658,-19052,26644,-19073,26629,-19093,26615,-19114,26600,-19134,26585,-19155,26570,-19175,26556,-19195,26541,-19216,26526,-19236,26512,-19256,26497,-19277,26482,-19297,26467,-19317,26452,-19338,26437,-19358,26423,-19378,26408,-19398,26393,-19419,26378,-19439,26363,-19459,26348,-19479,26333,-19500,26318,-19520,26303,-19540,26288,-19560,26273,-19580,26258,-19600,26243,-19621,26228,-19641,26213,-19661,26198,-19681,26183,-19701,26168,-19721,26153,-19741,26137,-19761,26122,-19781,26107,-19801,26092,-19821,26077,-19841,26061,-19861,26046,-19881,26031,-19901,26016,-19921,26000,-19941,25985,-19961,25970,-19981,25954,-20001,25939,-20021,25924,-20041,25908,-20061,25893,-20080,25878,-20100,25862,-20120,25847,-20140,25831,-20160,25816,-20180,25800,-20199,25785,-20219,25769,-20239,25754,-20259,25738,-20278,25723,-20298,25707,-20318,25691,-20338,25676,-20357,25660,-20377,25645,-20397,25629,-20416,25613,-20436,25598,-20456,25582,-20475,25566,-20495,25550,-20514,25535,-20534,25519,-20554,25503,-20573,25487,-20593,25472,-20612,25456,-20632,25440,-20651,25424,-20671,25408,-20690,25392,-20710,25376,-20729,25361,-20749,25345,-20768,25329,-20788,25313,-20807,25297,-20826,25281,-20846,25265,-20865,25249,-20885,25233,-20904,25217,-20923,25201,-20943,25185,-20962,25169,-20981,25152,-21001,25136,-21020,25120,-21039,25104,-21058,25088,-21078,25072,-21097,25056,-21116,25039,-21135,25023,-21155,25007,-21174,24991,-21193,24974,-21212,24958,-21231,24942,-21250,24926,-21269,24909,-21289,24893,-21308,24877,-21327,24860,-21346,24844,-21365,24827,-21384,24811,-21403,24795,-21422,24778,-21441,24762,-21460,24745,-21479,24729,-21498,24712,-21517,24696,-21536,24679,-21555,24663,-21574,24646,-21593,24630,-21612,24613,-21630,24596,-21649,24580,-21668,24563,-21687,24546,-21706,24530,-21725,24513,-21744,24496,-21762,24480,-21781,24463,-21800,24446,-21819,24430,-21837,24413,-21856,24396,-21875,24379,-21894,24362,-21912,24346,-21931,24329,-21950,24312,-21968,24295,-21987,24278,-22005,24261,-22024,24244,-22043,24228,-22061,24211,-22080,24194,-22098,24177,-22117,24160,-22136,24143,-22154,24126,-22173,24109,-22191,24092,-22210,24075,-22228,24058,-22246,24041,-22265,24023,-22283,24006,-22302,23989,-22320,23972,-22339,23955,-22357,23938,-22375,23921,-22394,23903,-22412,23886,-22430,23869,-22449,23852,-22467,23835,-22485,23817,-22504,23800,-22522,23783,-22540,23766,-22558,23748,-22576,23731,-22595,23714,-22613,23696,-22631,23679,-22649,23661,-22667,23644,-22686,23627,-22704,23609,-22722,23592,-22740,23574,-22758,23557,-22776,23539,-22794,23522,-22812,23504,-22830,23487,-22848,23469,-22866,23452,-22884,23434,-22902,23417,-22920,23399,-22938,23382,-22956,23364,-22974,23346,-22992,23329,-23010,23311,-23028,23293,-23046,23276,-23063,23258,-23081,23240,-23099,23223,-23117,23205,-23135,23187,-23152,23169,-23170,23151,-23188,23134,-23206,23116,-23224,23098,-23241,23080,-23259,23062,-23277,23045,-23294,23027,-23312,23009,-23330,22991,-23347,22973,-23365,22955,-23383,22937,-23400,22919,-23418,22901,-23435,22883,-23453,22865,-23470,22847,-23488,22829,-23505,22811,-23523,22793,-23540,22775,-23558,22757,-23575,22739,-23593,22721,-23610,22703,-23628,22685,-23645,22666,-23662,22648,-23680,22630,-23697,22612,-23715,22594,-23732,22575,-23749,22557,-23767,22539,-23784,22521,-23801,22503,-23818,22484,-23836,22466,-23853,22448,-23870,22429,-23887,22411,-23904,22393,-23922,22374,-23939,22356,-23956,22338,-23973,22319,-23990,22301,-24007,22282,-24024,22264,-24042,22245,-24059,22227,-24076,22209,-24093,22190,-24110,22172,-24127,22153,-24144,22135,-24161,22116,-24178,22097,-24195,22079,-24212,22060,-24229,22042,-24245,22023,-24262,22004,-24279,21986,-24296,21967,-24313,21949,-24330,21930,-24347,21911,-24363,21893,-24380,21874,-24397,21855,-24414,21836,-24431,21818,-24447,21799,-24464,21780,-24481,21761,-24497,21743,-24514,21724,-24531,21705,-24547,21686,-24564,21667,-24581,21648,-24597,21629,-24614,21611,-24631,21592,-24647,21573,-24664,21554,-24680,21535,-24697,21516,-24713,21497,-24730,21478,-24746,21459,-24763,21440,-24779,21421,-24796,21402,-24812,21383,-24828,21364,-24845,21345,-24861,21326,-24878,21307,-24894,21288,-24910,21268,-24927,21249,-24943,21230,-24959,21211,-24975,21192,-24992,21173,-25008,21154,-25024,21134,-25040,21115,-25057,21096,-25073,21077,-25089,21057,-25105,21038,-25121,21019,-25137,21000,-25153,20980,-25170,20961,-25186,20942,-25202,20922,-25218,20903,-25234,20884,-25250,20864,-25266,20845,-25282,20825,-25298,20806,-25314,20787,-25330,20767,-25346,20748,-25362,20728,-25377,20709,-25393,20689,-25409,20670,-25425,20650,-25441,20631,-25457,20611,-25473,20592,-25488,20572,-25504,20553,-25520,20533,-25536,20513,-25551,20494,-25567,20474,-25583,20455,-25599,20435,-25614,20415,-25630,20396,-25646,20376,-25661,20356,-25677,20337,-25692,20317,-25708,20297,-25724,20277,-25739,20258,-25755,20238,-25770,20218,-25786,20198,-25801,20179,-25817,20159,-25832,20139,-25848,20119,-25863,20099,-25879,20079,-25894,20060,-25909,20040,-25925,20020,-25940,20000,-25955,19980,-25971,19960,-25986,19940,-26001,19920,-26017,19900,-26032,19880,-26047,19860,-26062,19840,-26078,19820,-26093,19800,-26108,19780,-26123,19760,-26138,19740,-26154,19720,-26169,19700,-26184,19680,-26199,19660,-26214,19640,-26229,19620,-26244,19599,-26259,19579,-26274,19559,-26289,19539,-26304,19519,-26319,19499,-26334,19478,-26349,19458,-26364,19438,-26379,19418,-26394,19397,-26409,19377,-26424,19357,-26438,19337,-26453,19316,-26468,19296,-26483,19276,-26498,19255,-26513,19235,-26527,19215,-26542,19194,-26557,19174,-26571,19154,-26586,19133,-26601,19113,-26616,19092,-26630,19072,-26645,19051,-26659,19031,-26674,19011,-26689,18990,-26703,18970,-26718,18949,-26732,18929,-26747,18908,-26761,18888,-26776,18867,-26790,18846,-26805,18826,-26819,18805,-26834,18785,-26848,18764,-26862,18744,-26877,18723,-26891,18702,-26906,18682,-26920,18661,-26934,18640,-26949,18620,-26963,18599,-26977,18578,-26991,18558,-27006,18537,-27020,18516,-27034,18495,-27048,18475,-27062,18454,-27077,18433,-27091,18412,-27105,18392,-27119,18371,-27133,18350,-27147,18329,-27161,18308,-27175,18287,-27189,18267,-27203,18246,-27217,18225,-27231,18204,-27245,18183,-27259,18162,-27273,18141,-27287,18120,-27301,18099,-27315,18078,-27329,18057,-27343,18036,-27356,18015,-27370,17994,-27384,17973,-27398,17952,-27412,17931,-27425,17910,-27439,17889,-27453,17868,-27467,17847,-27480,17826,-27494,17805,-27508,17784,-27521,17763,-27535,17742,-27549,17720,-27562,17699,-27576,17678,-27589,17657,-27603,17636,-27616,17615,-27630,17593,-27643,17572,-27657,17551,-27670,17530,-27684,17509,-27697,17487,-27711,17466,-27724,17445,-27737,17423,-27751,17402,-27764,17381,-27778,17360,-27791,17338,-27804,17317,-27817,17296,-27831,17274,-27844,17253,-27857,17232,-27870,17210,-27884,17189,-27897,17167,-27910,17146,-27923,17124,-27936,17103,-27949,17082,-27963,17060,-27976,17039,-27989,17017,-28002,16996,-28015,16974,-28028,16953,-28041,16931,-28054,16910,-28067,16888,-28080,16867,-28093,16845,-28106,16824,-28119,16802,-28132,16780,-28144,16759,-28157,16737,-28170,16716,-28183,16694,-28196,16672,-28209,16651,-28221,16629,-28234,16607,-28247,16586,-28260,16564,-28272,16542,-28285,16521,-28298,16499,-28310,16477,-28323,16455,-28336,16434,-28348,16412,-28361,16390,-28373,16368,-28386,16347,-28398,16325,-28411,16303,-28424,16281,-28436,16260,-28448,16238,-28461,16216,-28473,16194,-28486,16172,-28498,16150,-28511,16128,-28523,16107,-28535,16085,-28548,16063,-28560,16041,-28572,16019,-28585,15997,-28597,15975,-28609,15953,-28621,15931,-28634,15909,-28646,15887,-28658,15865,-28670,15843,-28682,15821,-28695,15799,-28707,15777,-28719,15755,-28731,15733,-28743,15711,-28755,15689,-28767,15667,-28779,15645,-28791,15623,-28803,15601,-28815,15579,-28827,15556,-28839,15534,-28851,15512,-28863,15490,-28875,15468,-28887,15446,-28898,15424,-28910,15401,-28922,15379,-28934,15357,-28946,15335,-28957,15313,-28969,15290,-28981,15268,-28993,15246,-29004,15224,-29016,15201,-29028,15179,-29039,15157,-29051,15135,-29063,15112,-29074,15090,-29086,15068,-29097,15045,-29109,15023,-29120,15001,-29132,14978,-29143,14956,-29155,14934,-29166,14911,-29178,14889,-29189,14866,-29201,14844,-29212,14822,-29223,14799,-29235,14777,-29246,14754,-29257,14732,-29269,14709,-29280,14687,-29291,14665,-29303,14642,-29314,14620,-29325,14597,-29336,14575,-29347,14552,-29359,14530,-29370,14507,-29381,14484,-29392,14462,-29403,14439,-29414,14417,-29425,14394,-29436,14372,-29447,14349,-29458,14326,-29469,14304,-29480,14281,-29491,14259,-29502,14236,-29513,14213,-29524,14191,-29535,14168,-29546,14145,-29557,14123,-29568,14100,-29578,14077,-29589,14055,-29600,14032,-29611,14009,-29622,13986,-29632,13964,-29643,13941,-29654,13918,-29664,13895,-29675,13873,-29686,13850,-29696,13827,-29707,13804,-29718,13782,-29728,13759,-29739,13736,-29749,13713,-29760,13690,-29770,13667,-29781,13645,-29791,13622,-29802,13599,-29812,13576,-29823,13553,-29833,13530,-29843,13507,-29854,13485,-29864,13462,-29874,13439,-29885,13416,-29895,13393,-29905,13370,-29916,13347,-29926,13324,-29936,13301,-29946,13278,-29956,13255,-29967,13232,-29977,13209,-29987,13186,-29997,13163,-30007,13140,-30017,13117,-30027,13094,-30037,13071,-30047,13048,-30057,13025,-30067,13002,-30077,12979,-30087,12956,-30097,12933,-30107,12909,-30117,12886,-30127,12863,-30137,12840,-30147,12817,-30157,12794,-30166,12771,-30176,12748,-30186,12724,-30196,12701,-30206,12678,-30215,12655,-30225,12632,-30235,12609,-30244,12585,-30254,12562,-30264,12539,-30273,12516,-30283,12492,-30292,12469,-30302,12446,-30312,12423,-30321,12399,-30331,12376,-30340,12353,-30350,12330,-30359,12306,-30369,12283,-30378,12260,-30387,12236,-30397,12213,-30406,12190,-30416,12166,-30425,12143,-30434,12120,-30443,12096,-30453,12073,-30462,12050,-30471,12026,-30481,12003,-30490,11980,-30499,11956,-30508,11933,-30517,11909,-30526,11886,-30536,11862,-30545,11839,-30554,11816,-30563,11792,-30572,11769,-30581,11745,-30590,11722,-30599,11698,-30608,11675,-30617,11651,-30626,11628,-30635,11604,-30644,11581,-30653,11557,-30661,11534,-30670,11510,-30679,11487,-30688,11463,-30697,11440,-30706,11416,-30714,11393,-30723,11369,-30732,11345,-30740,11322,-30749,11298,-30758,11275,-30767,11251,-30775,11227,-30784,11204,-30792,11180,-30801,11157,-30810,11133,-30818,11109,-30827,11086,-30835,11062,-30844,11038,-30852,11015,-30861,10991,-30869,10967,-30877,10944,-30886,10920,-30894,10896,-30903,10873,-30911,10849,-30919,10825,-30928,10801,-30936,10778,-30944,10754,-30952,10730,-30961,10706,-30969,10683,-30977,10659,-30985,10635,-30993,10611,-31002,10588,-31010,10564,-31018,10540,-31026,10516,-31034,10492,-31042,10469,-31050,10445,-31058,10421,-31066,10397,-31074,10373,-31082,10349,-31090,10326,-31098,10302,-31106,10278,-31114,10254,-31122,10230,-31129,10206,-31137,10182,-31145,10159,-31153,10135,-31161,10111,-31168,10087,-31176,10063,-31184,10039,-31192,10015,-31199,9991,-31207,9967,-31215,9943,-31222,9919,-31230,9895,-31237,9871,-31245,9847,-31253,9823,-31260,9799,-31268,9775,-31275,9751,-31283,9727,-31290,9703,-31298,9679,-31305,9655,-31312,9631,-31320,9607,-31327,9583,-31335,9559,-31342,9535,-31349,9511,-31357,9487,-31364,9463,-31371,9439,-31378,9415,-31386,9391,-31393,9367,-31400,9343,-31407,9319,-31414,9295,-31421,9270,-31429,9246,-31436,9222,-31443,9198,-31450,9174,-31457,9150,-31464,9126,-31471,9102,-31478,9077,-31485,9053,-31492,9029,-31499,9005,-31506,8981,-31513,8957,-31519,8932,-31526,8908,-31533,8884,-31540,8860,-31547,8836,-31554,8812,-31560,8787,-31567,8763,-31574,8739,-31581,8715,-31587,8690,-31594,8666,-31601,8642,-31607,8618,-31614,8593,-31620,8569,-31627,8545,-31634,8521,-31640,8496,-31647,8472,-31653,8448,-31660,8424,-31666,8399,-31673,8375,-31679,8351,-31685,8326,-31692,8302,-31698,8278,-31705,8253,-31711,8229,-31717,8205,-31724,8180,-31730,8156,-31736,8132,-31742,8107,-31749,8083,-31755,8059,-31761,8034,-31767,8010,-31773,7986,-31779,7961,-31786,7937,-31792,7912,-31798,7888,-31804,7864,-31810,7839,-31816,7815,-31822,7790,-31828,7766,-31834,7742,-31840,7717,-31846,7693,-31852,7668,-31857,7644,-31863,7619,-31869,7595,-31875,7571,-31881,7546,-31887,7522,-31892,7497,-31898,7473,-31904,7448,-31910,7424,-31915,7399,-31921,7375,-31927,7350,-31932,7326,-31938,7301,-31944,7277,-31949,7252,-31955,7228,-31960,7203,-31966,7179,-31971,7154,-31977,7130,-31982,7105,-31988,7081,-31993,7056,-31999,7032,-32004,7007,-32009,6982,-32015,6958,-32020,6933,-32025,6909,-32031,6884,-32036,6860,-32041,6835,-32047,6811,-32052,6786,-32057,6761,-32062,6737,-32067,6712,-32073,6688,-32078,6663,-32083,6638,-32088,6614,-32093,6589,-32098,6564,-32103,6540,-32108,6515,-32113,6491,-32118,6466,-32123,6441,-32128,6417,-32133,6392,-32138,6367,-32143,6343,-32148,6318,-32153,6293,-32157,6269,-32162,6244,-32167,6219,-32172,6195,-32177,6170,-32181,6145,-32186,6121,-32191,6096,-32195,6071,-32200,6047,-32205,6022,-32209,5997,-32214,5972,-32219,5948,-32223,5923,-32228,5898,-32232,5874,-32237,5849,-32241,5824,-32246,5799,-32250,5775,-32255,5750,-32259,5725,-32263,5700,-32268,5676,-32272,5651,-32276,5626,-32281,5601,-32285,5577,-32289,5552,-32294,5527,-32298,5502,-32302,5478,-32306,5453,-32311,5428,-32315,5403,-32319,5378,-32323,5354,-32327,5329,-32331,5304,-32335,5279,-32339,5254,-32343,5230,-32347,5205,-32351,5180,-32355,5155,-32359,5130,-32363,5106,-32367,5081,-32371,5056,-32375,5031,-32379,5006,-32383,4981,-32387,4957,-32390,4932,-32394,4907,-32398,4882,-32402,4857,-32405,4832,-32409,4807,-32413,4783,-32417,4758,-32420,4733,-32424,4708,-32427,4683,-32431,4658,-32435,4633,-32438,4608,-32442,4584,-32445,4559,-32449,4534,-32452,4509,-32456,4484,-32459,4459,-32463,4434,-32466,4409,-32469,4384,-32473,4359,-32476,4335,-32479,4310,-32483,4285,-32486,4260,-32489,4235,-32493,4210,-32496,4185,-32499,4160,-32502,4135,-32505,4110,-32509,4085,-32512,4060,-32515,4035,-32518,4011,-32521,3986,-32524,3961,-32527,3936,-32530,3911,-32533,3886,-32536,3861,-32539,3836,-32542,3811,-32545,3786,-32548,3761,-32551,3736,-32554,3711,-32557,3686,-32559,3661,-32562,3636,-32565,3611,-32568,3586,-32571,3561,-32573,3536,-32576,3511,-32579,3486,-32581,3461,-32584,3436,-32587,3411,-32589,3386,-32592,3361,-32595,3336,-32597,3311,-32600,3286,-32602,3261,-32605,3236,-32607,3211,-32610,3186,-32612,3161,-32615,3136,-32617,3111,-32619,3086,-32622,3061,-32624,3036,-32626,3011,-32629,2986,-32631,2961,-32633,2936,-32636,2911,-32638,2886,-32640,2861,-32642,2836,-32645,2811,-32647,2786,-32649,2761,-32651,2736,-32653,2711,-32655,2686,-32657,2661,-32659,2636,-32661,2610,-32663,2585,-32665,2560,-32667,2535,-32669,2510,-32671,2485,-32673,2460,-32675,2435,-32677,2410,-32679,2385,-32681,2360,-32682,2335,-32684,2310,-32686,2285,-32688,2260,-32689,2235,-32691,2209,-32693,2184,-32695,2159,-32696,2134,-32698,2109,-32700,2084,-32701,2059,-32703,2034,-32704,2009,-32706,1984,-32707,1959,-32709,1934,-32710,1908,-32712,1883,-32713,1858,-32715,1833,-32716,1808,-32718,1783,-32719,1758,-32720,1733,-32722,1708,-32723,1683,-32724,1658,-32726,1632,-32727,1607,-32728,1582,-32729,1557,-32730,1532,-32732,1507,-32733,1482,-32734,1457,-32735,1432,-32736,1406,-32737,1381,-32738,1356,-32739,1331,-32740,1306,-32741,1281,-32742,1256,-32743,1231,-32744,1206,-32745,1180,-32746,1155,-32747,1130,-32748,1105,-32749,1080,-32750,1055,-32751,1030,-32751,1005,-32752,980,-32753,954,-32754,929,-32754,904,-32755,879,-32756,854,-32756,829,-32757,804,-32758,779,-32758,753,-32759,728,-32759,703,-32760,678,-32760,653,-32761,628,-32761,603,-32762,578,-32762,552,-32763,527,-32763,502,-32764,477,-32764,452,-32764,427,-32765,402,-32765,376,-32765,351,-32766,326,-32766,301,-32766,276,-32766,251,-32767,226,-32767,201,-32767,175,-32767,150,-32767,125,-32767,100,-32767,75,-32767,50,-32767,25,-32767,0,-32767,-26,-32767,-51,-32767,-76,-32767,-101,-32767,-126,-32767,-151,-32767,-176,-32767,-202,-32767,-227,-32767,-252,-32767,-277,-32766,-302,-32766,-327,-32766,-352,-32766,-377,-32765,-403,-32765,-428,-32765,-453,-32764,-478,-32764,-503,-32764,-528,-32763,-553,-32763,-579,-32762,-604,-32762,-629,-32761,-654,-32761,-679,-32760,-704,-32760,-729,-32759,-754,-32759,-780,-32758,-805,-32758,-830,-32757,-855,-32756,-880,-32756,-905,-32755,-930,-32754,-955,-32754,-981,-32753,-1006,-32752,-1031,-32751,-1056,-32751,-1081,-32750,-1106,-32749,-1131,-32748,-1156,-32747,-1181,-32746,-1207,-32745,-1232,-32744,-1257,-32743,-1282,-32742,-1307,-32741,-1332,-32740,-1357,-32739,-1382,-32738,-1407,-32737,-1433,-32736,-1458,-32735,-1483,-32734,-1508,-32733,-1533,-32732,-1558,-32730,-1583,-32729,-1608,-32728,-1633,-32727,-1659,-32726,-1684,-32724,-1709,-32723,-1734,-32722,-1759,-32720,-1784,-32719,-1809,-32718,-1834,-32716,-1859,-32715,-1884,-32713,-1909,-32712,-1935,-32710,-1960,-32709,-1985,-32707,-2010,-32706,-2035,-32704,-2060,-32703,-2085,-32701,-2110,-32700,-2135,-32698,-2160,-32696,-2185,-32695,-2210,-32693,-2236,-32691,-2261,-32689,-2286,-32688,-2311,-32686,-2336,-32684,-2361,-32682,-2386,-32681,-2411,-32679,-2436,-32677,-2461,-32675,-2486,-32673,-2511,-32671,-2536,-32669,-2561,-32667,-2586,-32665,-2611,-32663,-2637,-32661,-2662,-32659,-2687,-32657,-2712,-32655,-2737,-32653,-2762,-32651,-2787,-32649,-2812,-32647,-2837,-32645,-2862,-32642,-2887,-32640,-2912,-32638,-2937,-32636,-2962,-32633,-2987,-32631,-3012,-32629,-3037,-32626,-3062,-32624,-3087,-32622,-3112,-32619,-3137,-32617,-3162,-32615,-3187,-32612,-3212,-32610,-3237,-32607,-3262,-32605,-3287,-32602,-3312,-32600,-3337,-32597,-3362,-32595,-3387,-32592,-3412,-32589,-3437,-32587,-3462,-32584,-3487,-32581,-3512,-32579,-3537,-32576,-3562,-32573,-3587,-32571,-3612,-32568,-3637,-32565,-3662,-32562,-3687,-32559,-3712,-32557,-3737,-32554,-3762,-32551,-3787,-32548,-3812,-32545,-3837,-32542,-3862,-32539,-3887,-32536,-3912,-32533,-3937,-32530,-3962,-32527,-3987,-32524,-4012,-32521,-4036,-32518,-4061,-32515,-4086,-32512,-4111,-32509,-4136,-32505,-4161,-32502,-4186,-32499,-4211,-32496,-4236,-32493,-4261,-32489,-4286,-32486,-4311,-32483,-4336,-32479,-4360,-32476,-4385,-32473,-4410,-32469,-4435,-32466,-4460,-32463,-4485,-32459,-4510,-32456,-4535,-32452,-4560,-32449,-4585,-32445,-4609,-32442,-4634,-32438,-4659,-32435,-4684,-32431,-4709,-32427,-4734,-32424,-4759,-32420,-4784,-32417,-4808,-32413,-4833,-32409,-4858,-32405,-4883,-32402,-4908,-32398,-4933,-32394,-4958,-32390,-4982,-32387,-5007,-32383,-5032,-32379,-5057,-32375,-5082,-32371,-5107,-32367,-5131,-32363,-5156,-32359,-5181,-32355,-5206,-32351,-5231,-32347,-5255,-32343,-5280,-32339,-5305,-32335,-5330,-32331,-5355,-32327,-5379,-32323,-5404,-32319,-5429,-32315,-5454,-32311,-5479,-32306,-5503,-32302,-5528,-32298,-5553,-32294,-5578,-32289,-5602,-32285,-5627,-32281,-5652,-32276,-5677,-32272,-5701,-32268,-5726,-32263,-5751,-32259,-5776,-32255,-5800,-32250,-5825,-32246,-5850,-32241,-5875,-32237,-5899,-32232,-5924,-32228,-5949,-32223,-5973,-32219,-5998,-32214,-6023,-32209,-6048,-32205,-6072,-32200,-6097,-32195,-6122,-32191,-6146,-32186,-6171,-32181,-6196,-32177,-6220,-32172,-6245,-32167,-6270,-32162,-6294,-32157,-6319,-32153,-6344,-32148,-6368,-32143,-6393,-32138,-6418,-32133,-6442,-32128,-6467,-32123,-6492,-32118,-6516,-32113,-6541,-32108,-6565,-32103,-6590,-32098,-6615,-32093,-6639,-32088,-6664,-32083,-6689,-32078,-6713,-32073,-6738,-32067,-6762,-32062,-6787,-32057,-6812,-32052,-6836,-32047,-6861,-32041,-6885,-32036,-6910,-32031,-6934,-32025,-6959,-32020,-6983,-32015,-7008,-32009,-7033,-32004,-7057,-31999,-7082,-31993,-7106,-31988,-7131,-31982,-7155,-31977,-7180,-31971,-7204,-31966,-7229,-31960,-7253,-31955,-7278,-31949,-7302,-31944,-7327,-31938,-7351,-31932,-7376,-31927,-7400,-31921,-7425,-31915,-7449,-31910,-7474,-31904,-7498,-31898,-7523,-31892,-7547,-31887,-7572,-31881,-7596,-31875,-7620,-31869,-7645,-31863,-7669,-31857,-7694,-31852,-7718,-31846,-7743,-31840,-7767,-31834,-7791,-31828,-7816,-31822,-7840,-31816,-7865,-31810,-7889,-31804,-7913,-31798,-7938,-31792,-7962,-31786,-7987,-31779,-8011,-31773,-8035,-31767,-8060,-31761,-8084,-31755,-8108,-31749,-8133,-31742,-8157,-31736,-8181,-31730,-8206,-31724,-8230,-31717,-8254,-31711,-8279,-31705,-8303,-31698,-8327,-31692,-8352,-31685,-8376,-31679,-8400,-31673,-8425,-31666,-8449,-31660,-8473,-31653,-8497,-31647,-8522,-31640,-8546,-31634,-8570,-31627,-8594,-31620,-8619,-31614,-8643,-31607,-8667,-31601,-8691,-31594,-8716,-31587,-8740,-31581,-8764,-31574,-8788,-31567,-8813,-31560,-8837,-31554,-8861,-31547,-8885,-31540,-8909,-31533,-8933,-31526,-8958,-31519,-8982,-31513,-9006,-31506,-9030,-31499,-9054,-31492,-9078,-31485,-9103,-31478,-9127,-31471,-9151,-31464,-9175,-31457,-9199,-31450,-9223,-31443,-9247,-31436,-9271,-31429,-9296,-31421,-9320,-31414,-9344,-31407,-9368,-31400,-9392,-31393,-9416,-31386,-9440,-31378,-9464,-31371,-9488,-31364,-9512,-31357,-9536,-31349,-9560,-31342,-9584,-31335,-9608,-31327,-9632,-31320,-9656,-31312,-9680,-31305,-9704,-31298,-9728,-31290,-9752,-31283,-9776,-31275,-9800,-31268,-9824,-31260,-9848,-31253,-9872,-31245,-9896,-31237,-9920,-31230,-9944,-31222,-9968,-31215,-9992,-31207,-10016,-31199,-10040,-31192,-10064,-31184,-10088,-31176,-10112,-31168,-10136,-31161,-10160,-31153,-10183,-31145,-10207,-31137,-10231,-31129,-10255,-31122,-10279,-31114,-10303,-31106,-10327,-31098,-10350,-31090,-10374,-31082,-10398,-31074,-10422,-31066,-10446,-31058,-10470,-31050,-10493,-31042,-10517,-31034,-10541,-31026,-10565,-31018,-10589,-31010,-10612,-31002,-10636,-30993,-10660,-30985,-10684,-30977,-10707,-30969,-10731,-30961,-10755,-30952,-10779,-30944,-10802,-30936,-10826,-30928,-10850,-30919,-10874,-30911,-10897,-30903,-10921,-30894,-10945,-30886,-10968,-30877,-10992,-30869,-11016,-30861,-11039,-30852,-11063,-30844,-11087,-30835,-11110,-30827,-11134,-30818,-11158,-30810,-11181,-30801,-11205,-30792,-11228,-30784,-11252,-30775,-11276,-30767,-11299,-30758,-11323,-30749,-11346,-30740,-11370,-30732,-11394,-30723,-11417,-30714,-11441,-30706,-11464,-30697,-11488,-30688,-11511,-30679,-11535,-30670,-11558,-30661,-11582,-30653,-11605,-30644,-11629,-30635,-11652,-30626,-11676,-30617,-11699,-30608,-11723,-30599,-11746,-30590,-11770,-30581,-11793,-30572,-11817,-30563,-11840,-30554,-11863,-30545,-11887,-30536,-11910,-30526,-11934,-30517,-11957,-30508,-11981,-30499,-12004,-30490,-12027,-30481,-12051,-30471,-12074,-30462,-12097,-30453,-12121,-30443,-12144,-30434,-12167,-30425,-12191,-30416,-12214,-30406,-12237,-30397,-12261,-30387,-12284,-30378,-12307,-30369,-12331,-30359,-12354,-30350,-12377,-30340,-12400,-30331,-12424,-30321,-12447,-30312,-12470,-30302,-12493,-30292,-12517,-30283,-12540,-30273,-12563,-30264,-12586,-30254,-12610,-30244,-12633,-30235,-12656,-30225,-12679,-30215,-12702,-30206,-12725,-30196,-12749,-30186,-12772,-30176,-12795,-30166,-12818,-30157,-12841,-30147,-12864,-30137,-12887,-30127,-12910,-30117,-12934,-30107,-12957,-30097,-12980,-30087,-13003,-30077,-13026,-30067,-13049,-30057,-13072,-30047,-13095,-30037,-13118,-30027,-13141,-30017,-13164,-30007,-13187,-29997,-13210,-29987,-13233,-29977,-13256,-29967,-13279,-29956,-13302,-29946,-13325,-29936,-13348,-29926,-13371,-29916,-13394,-29905,-13417,-29895,-13440,-29885,-13463,-29874,-13486,-29864,-13508,-29854,-13531,-29843,-13554,-29833,-13577,-29823,-13600,-29812,-13623,-29802,-13646,-29791,-13668,-29781,-13691,-29770,-13714,-29760,-13737,-29749,-13760,-29739,-13783,-29728,-13805,-29718,-13828,-29707,-13851,-29696,-13874,-29686,-13896,-29675,-13919,-29664,-13942,-29654,-13965,-29643,-13987,-29632,-14010,-29622,-14033,-29611,-14056,-29600,-14078,-29589,-14101,-29578,-14124,-29568,-14146,-29557,-14169,-29546,-14192,-29535,-14214,-29524,-14237,-29513,-14260,-29502,-14282,-29491,-14305,-29480,-14327,-29469,-14350,-29458,-14373,-29447,-14395,-29436,-14418,-29425,-14440,-29414,-14463,-29403,-14485,-29392,-14508,-29381,-14531,-29370,-14553,-29359,-14576,-29347,-14598,-29336,-14621,-29325,-14643,-29314,-14666,-29303,-14688,-29291,-14710,-29280,-14733,-29269,-14755,-29257,-14778,-29246,-14800,-29235,-14823,-29223,-14845,-29212,-14867,-29201,-14890,-29189,-14912,-29178,-14935,-29166,-14957,-29155,-14979,-29143,-15002,-29132,-15024,-29120,-15046,-29109,-15069,-29097,-15091,-29086,-15113,-29074,-15136,-29063,-15158,-29051,-15180,-29039,-15202,-29028,-15225,-29016,-15247,-29004,-15269,-28993,-15291,-28981,-15314,-28969,-15336,-28957,-15358,-28946,-15380,-28934,-15402,-28922,-15425,-28910,-15447,-28898,-15469,-28887,-15491,-28875,-15513,-28863,-15535,-28851,-15557,-28839,-15580,-28827,-15602,-28815,-15624,-28803,-15646,-28791,-15668,-28779,-15690,-28767,-15712,-28755,-15734,-28743,-15756,-28731,-15778,-28719,-15800,-28707,-15822,-28695,-15844,-28682,-15866,-28670,-15888,-28658,-15910,-28646,-15932,-28634,-15954,-28621,-15976,-28609,-15998,-28597,-16020,-28585,-16042,-28572,-16064,-28560,-16086,-28548,-16108,-28535,-16129,-28523,-16151,-28511,-16173,-28498,-16195,-28486,-16217,-28473,-16239,-28461,-16261,-28448,-16282,-28436,-16304,-28424,-16326,-28411,-16348,-28398,-16369,-28386,-16391,-28373,-16413,-28361,-16435,-28348,-16456,-28336,-16478,-28323,-16500,-28310,-16522,-28298,-16543,-28285,-16565,-28272,-16587,-28260,-16608,-28247,-16630,-28234,-16652,-28221,-16673,-28209,-16695,-28196,-16717,-28183,-16738,-28170,-16760,-28157,-16781,-28144,-16803,-28132,-16825,-28119,-16846,-28106,-16868,-28093,-16889,-28080,-16911,-28067,-16932,-28054,-16954,-28041,-16975,-28028,-16997,-28015,-17018,-28002,-17040,-27989,-17061,-27976,-17083,-27963,-17104,-27949,-17125,-27936,-17147,-27923,-17168,-27910,-17190,-27897,-17211,-27884,-17233,-27870,-17254,-27857,-17275,-27844,-17297,-27831,-17318,-27817,-17339,-27804,-17361,-27791,-17382,-27778,-17403,-27764,-17424,-27751,-17446,-27737,-17467,-27724,-17488,-27711,-17510,-27697,-17531,-27684,-17552,-27670,-17573,-27657,-17594,-27643,-17616,-27630,-17637,-27616,-17658,-27603,-17679,-27589,-17700,-27576,-17721,-27562,-17743,-27549,-17764,-27535,-17785,-27521,-17806,-27508,-17827,-27494,-17848,-27480,-17869,-27467,-17890,-27453,-17911,-27439,-17932,-27425,-17953,-27412,-17974,-27398,-17995,-27384,-18016,-27370,-18037,-27356,-18058,-27343,-18079,-27329,-18100,-27315,-18121,-27301,-18142,-27287,-18163,-27273,-18184,-27259,-18205,-27245,-18226,-27231,-18247,-27217,-18268,-27203,-18288,-27189,-18309,-27175,-18330,-27161,-18351,-27147,-18372,-27133,-18393,-27119,-18413,-27105,-18434,-27091,-18455,-27077,-18476,-27062,-18496,-27048,-18517,-27034,-18538,-27020,-18559,-27006,-18579,-26991,-18600,-26977,-18621,-26963,-18641,-26949,-18662,-26934,-18683,-26920,-18703,-26906,-18724,-26891,-18745,-26877,-18765,-26862,-18786,-26848,-18806,-26834,-18827,-26819,-18847,-26805,-18868,-26790,-18889,-26776,-18909,-26761,-18930,-26747,-18950,-26732,-18971,-26718,-18991,-26703,-19012,-26689,-19032,-26674,-19052,-26659,-19073,-26645,-19093,-26630,-19114,-26616,-19134,-26601,-19155,-26586,-19175,-26571,-19195,-26557,-19216,-26542,-19236,-26527,-19256,-26513,-19277,-26498,-19297,-26483,-19317,-26468,-19338,-26453,-19358,-26438,-19378,-26424,-19398,-26409,-19419,-26394,-19439,-26379,-19459,-26364,-19479,-26349,-19500,-26334,-19520,-26319,-19540,-26304,-19560,-26289,-19580,-26274,-19600,-26259,-19621,-26244,-19641,-26229,-19661,-26214,-19681,-26199,-19701,-26184,-19721,-26169,-19741,-26154,-19761,-26138,-19781,-26123,-19801,-26108,-19821,-26093,-19841,-26078,-19861,-26062,-19881,-26047,-19901,-26032,-19921,-26017,-19941,-26001,-19961,-25986,-19981,-25971,-20001,-25955,-20021,-25940,-20041,-25925,-20061,-25909,-20080,-25894,-20100,-25879,-20120,-25863,-20140,-25848,-20160,-25832,-20180,-25817,-20199,-25801,-20219,-25786,-20239,-25770,-20259,-25755,-20278,-25739,-20298,-25724,-20318,-25708,-20338,-25692,-20357,-25677,-20377,-25661,-20397,-25646,-20416,-25630,-20436,-25614,-20456,-25599,-20475,-25583,-20495,-25567,-20514,-25551,-20534,-25536,-20554,-25520,-20573,-25504,-20593,-25488,-20612,-25473,-20632,-25457,-20651,-25441,-20671,-25425,-20690,-25409,-20710,-25393,-20729,-25377,-20749,-25362,-20768,-25346,-20788,-25330,-20807,-25314,-20826,-25298,-20846,-25282,-20865,-25266,-20885,-25250,-20904,-25234,-20923,-25218,-20943,-25202,-20962,-25186,-20981,-25170,-21001,-25153,-21020,-25137,-21039,-25121,-21058,-25105,-21078,-25089,-21097,-25073,-21116,-25057,-21135,-25040,-21155,-25024,-21174,-25008,-21193,-24992,-21212,-24975,-21231,-24959,-21250,-24943,-21269,-24927,-21289,-24910,-21308,-24894,-21327,-24878,-21346,-24861,-21365,-24845,-21384,-24828,-21403,-24812,-21422,-24796,-21441,-24779,-21460,-24763,-21479,-24746,-21498,-24730,-21517,-24713,-21536,-24697,-21555,-24680,-21574,-24664,-21593,-24647,-21612,-24631,-21630,-24614,-21649,-24597,-21668,-24581,-21687,-24564,-21706,-24547,-21725,-24531,-21744,-24514,-21762,-24497,-21781,-24481,-21800,-24464,-21819,-24447,-21837,-24431,-21856,-24414,-21875,-24397,-21894,-24380,-21912,-24363,-21931,-24347,-21950,-24330,-21968,-24313,-21987,-24296,-22005,-24279,-22024,-24262,-22043,-24245,-22061,-24229,-22080,-24212,-22098,-24195,-22117,-24178,-22136,-24161,-22154,-24144,-22173,-24127,-22191,-24110,-22210,-24093,-22228,-24076,-22246,-24059,-22265,-24042,-22283,-24024,-22302,-24007,-22320,-23990,-22339,-23973,-22357,-23956,-22375,-23939,-22394,-23922,-22412,-23904,-22430,-23887,-22449,-23870,-22467,-23853,-22485,-23836,-22504,-23818,-22522,-23801,-22540,-23784,-22558,-23767,-22576,-23749,-22595,-23732,-22613,-23715,-22631,-23697,-22649,-23680,-22667,-23662,-22686,-23645,-22704,-23628,-22722,-23610,-22740,-23593,-22758,-23575,-22776,-23558,-22794,-23540,-22812,-23523,-22830,-23505,-22848,-23488,-22866,-23470,-22884,-23453,-22902,-23435,-22920,-23418,-22938,-23400,-22956,-23383,-22974,-23365,-22992,-23347,-23010,-23330,-23028,-23312,-23046,-23294,-23063,-23277,-23081,-23259,-23099,-23241,-23117,-23224,-23135,-23206,-23152,-23188,-23170,-23170,-23188,-23152,-23206,-23135,-23224,-23117,-23241,-23099,-23259,-23081,-23277,-23063,-23294,-23046,-23312,-23028,-23330,-23010,-23347,-22992,-23365,-22974,-23383,-22956,-23400,-22938,-23418,-22920,-23435,-22902,-23453,-22884,-23470,-22866,-23488,-22848,-23505,-22830,-23523,-22812,-23540,-22794,-23558,-22776,-23575,-22758,-23593,-22740,-23610,-22722,-23628,-22704,-23645,-22686,-23662,-22667,-23680,-22649,-23697,-22631,-23715,-22613,-23732,-22595,-23749,-22576,-23767,-22558,-23784,-22540,-23801,-22522,-23818,-22504,-23836,-22485,-23853,-22467,-23870,-22449,-23887,-22430,-23904,-22412,-23922,-22394,-23939,-22375,-23956,-22357,-23973,-22339,-23990,-22320,-24007,-22302,-24024,-22283,-24042,-22265,-24059,-22246,-24076,-22228,-24093,-22210,-24110,-22191,-24127,-22173,-24144,-22154,-24161,-22136,-24178,-22117,-24195,-22098,-24212,-22080,-24229,-22061,-24245,-22043,-24262,-22024,-24279,-22005,-24296,-21987,-24313,-21968,-24330,-21950,-24347,-21931,-24363,-21912,-24380,-21894,-24397,-21875,-24414,-21856,-24431,-21837,-24447,-21819,-24464,-21800,-24481,-21781,-24497,-21762,-24514,-21744,-24531,-21725,-24547,-21706,-24564,-21687,-24581,-21668,-24597,-21649,-24614,-21630,-24631,-21612,-24647,-21593,-24664,-21574,-24680,-21555,-24697,-21536,-24713,-21517,-24730,-21498,-24746,-21479,-24763,-21460,-24779,-21441,-24796,-21422,-24812,-21403,-24828,-21384,-24845,-21365,-24861,-21346,-24878,-21327,-24894,-21308,-24910,-21289,-24927,-21269,-24943,-21250,-24959,-21231,-24975,-21212,-24992,-21193,-25008,-21174,-25024,-21155,-25040,-21135,-25057,-21116,-25073,-21097,-25089,-21078,-25105,-21058,-25121,-21039,-25137,-21020,-25153,-21001,-25170,-20981,-25186,-20962,-25202,-20943,-25218,-20923,-25234,-20904,-25250,-20885,-25266,-20865,-25282,-20846,-25298,-20826,-25314,-20807,-25330,-20788,-25346,-20768,-25362,-20749,-25377,-20729,-25393,-20710,-25409,-20690,-25425,-20671,-25441,-20651,-25457,-20632,-25473,-20612,-25488,-20593,-25504,-20573,-25520,-20554,-25536,-20534,-25551,-20514,-25567,-20495,-25583,-20475,-25599,-20456,-25614,-20436,-25630,-20416,-25646,-20397,-25661,-20377,-25677,-20357,-25692,-20338,-25708,-20318,-25724,-20298,-25739,-20278,-25755,-20259,-25770,-20239,-25786,-20219,-25801,-20199,-25817,-20180,-25832,-20160,-25848,-20140,-25863,-20120,-25879,-20100,-25894,-20080,-25909,-20061,-25925,-20041,-25940,-20021,-25955,-20001,-25971,-19981,-25986,-19961,-26001,-19941,-26017,-19921,-26032,-19901,-26047,-19881,-26062,-19861,-26078,-19841,-26093,-19821,-26108,-19801,-26123,-19781,-26138,-19761,-26154,-19741,-26169,-19721,-26184,-19701,-26199,-19681,-26214,-19661,-26229,-19641,-26244,-19621,-26259,-19600,-26274,-19580,-26289,-19560,-26304,-19540,-26319,-19520,-26334,-19500,-26349,-19479,-26364,-19459,-26379,-19439,-26394,-19419,-26409,-19398,-26424,-19378,-26438,-19358,-26453,-19338,-26468,-19317,-26483,-19297,-26498,-19277,-26513,-19256,-26527,-19236,-26542,-19216,-26557,-19195,-26571,-19175,-26586,-19155,-26601,-19134,-26616,-19114,-26630,-19093,-26645,-19073,-26659,-19052,-26674,-19032,-26689,-19012,-26703,-18991,-26718,-18971,-26732,-18950,-26747,-18930,-26761,-18909,-26776,-18889,-26790,-18868,-26805,-18847,-26819,-18827,-26834,-18806,-26848,-18786,-26862,-18765,-26877,-18745,-26891,-18724,-26906,-18703,-26920,-18683,-26934,-18662,-26949,-18641,-26963,-18621,-26977,-18600,-26991,-18579,-27006,-18559,-27020,-18538,-27034,-18517,-27048,-18496,-27062,-18476,-27077,-18455,-27091,-18434,-27105,-18413,-27119,-18393,-27133,-18372,-27147,-18351,-27161,-18330,-27175,-18309,-27189,-18288,-27203,-18268,-27217,-18247,-27231,-18226,-27245,-18205,-27259,-18184,-27273,-18163,-27287,-18142,-27301,-18121,-27315,-18100,-27329,-18079,-27343,-18058,-27356,-18037,-27370,-18016,-27384,-17995,-27398,-17974,-27412,-17953,-27425,-17932,-27439,-17911,-27453,-17890,-27467,-17869,-27480,-17848,-27494,-17827,-27508,-17806,-27521,-17785,-27535,-17764,-27549,-17743,-27562,-17721,-27576,-17700,-27589,-17679,-27603,-17658,-27616,-17637,-27630,-17616,-27643,-17594,-27657,-17573,-27670,-17552,-27684,-17531,-27697,-17510,-27711,-17488,-27724,-17467,-27737,-17446,-27751,-17424,-27764,-17403,-27778,-17382,-27791,-17361,-27804,-17339,-27817,-17318,-27831,-17297,-27844,-17275,-27857,-17254,-27870,-17233,-27884,-17211,-27897,-17190,-27910,-17168,-27923,-17147,-27936,-17125,-27949,-17104,-27963,-17083,-27976,-17061,-27989,-17040,-28002,-17018,-28015,-16997,-28028,-16975,-28041,-16954,-28054,-16932,-28067,-16911,-28080,-16889,-28093,-16868,-28106,-16846,-28119,-16825,-28132,-16803,-28144,-16781,-28157,-16760,-28170,-16738,-28183,-16717,-28196,-16695,-28209,-16673,-28221,-16652,-28234,-16630,-28247,-16608,-28260,-16587,-28272,-16565,-28285,-16543,-28298,-16522,-28310,-16500,-28323,-16478,-28336,-16456,-28348,-16435,-28361,-16413,-28373,-16391,-28386,-16369,-28398,-16348,-28411,-16326,-28424,-16304,-28436,-16282,-28448,-16261,-28461,-16239,-28473,-16217,-28486,-16195,-28498,-16173,-28511,-16151,-28523,-16129,-28535,-16108,-28548,-16086,-28560,-16064,-28572,-16042,-28585,-16020,-28597,-15998,-28609,-15976,-28621,-15954,-28634,-15932,-28646,-15910,-28658,-15888,-28670,-15866,-28682,-15844,-28695,-15822,-28707,-15800,-28719,-15778,-28731,-15756,-28743,-15734,-28755,-15712,-28767,-15690,-28779,-15668,-28791,-15646,-28803,-15624,-28815,-15602,-28827,-15580,-28839,-15557,-28851,-15535,-28863,-15513,-28875,-15491,-28887,-15469,-28898,-15447,-28910,-15425,-28922,-15402,-28934,-15380,-28946,-15358,-28957,-15336,-28969,-15314,-28981,-15291,-28993,-15269,-29004,-15247,-29016,-15225,-29028,-15202,-29039,-15180,-29051,-15158,-29063,-15136,-29074,-15113,-29086,-15091,-29097,-15069,-29109,-15046,-29120,-15024,-29132,-15002,-29143,-14979,-29155,-14957,-29166,-14935,-29178,-14912,-29189,-14890,-29201,-14867,-29212,-14845,-29223,-14823,-29235,-14800,-29246,-14778,-29257,-14755,-29269,-14733,-29280,-14710,-29291,-14688,-29303,-14666,-29314,-14643,-29325,-14621,-29336,-14598,-29347,-14576,-29359,-14553,-29370,-14531,-29381,-14508,-29392,-14485,-29403,-14463,-29414,-14440,-29425,-14418,-29436,-14395,-29447,-14373,-29458,-14350,-29469,-14327,-29480,-14305,-29491,-14282,-29502,-14260,-29513,-14237,-29524,-14214,-29535,-14192,-29546,-14169,-29557,-14146,-29568,-14124,-29578,-14101,-29589,-14078,-29600,-14056,-29611,-14033,-29622,-14010,-29632,-13987,-29643,-13965,-29654,-13942,-29664,-13919,-29675,-13896,-29686,-13874,-29696,-13851,-29707,-13828,-29718,-13805,-29728,-13783,-29739,-13760,-29749,-13737,-29760,-13714,-29770,-13691,-29781,-13668,-29791,-13646,-29802,-13623,-29812,-13600,-29823,-13577,-29833,-13554,-29843,-13531,-29854,-13508,-29864,-13486,-29874,-13463,-29885,-13440,-29895,-13417,-29905,-13394,-29916,-13371,-29926,-13348,-29936,-13325,-29946,-13302,-29956,-13279,-29967,-13256,-29977,-13233,-29987,-13210,-29997,-13187,-30007,-13164,-30017,-13141,-30027,-13118,-30037,-13095,-30047,-13072,-30057,-13049,-30067,-13026,-30077,-13003,-30087,-12980,-30097,-12957,-30107,-12934,-30117,-12910,-30127,-12887,-30137,-12864,-30147,-12841,-30157,-12818,-30166,-12795,-30176,-12772,-30186,-12749,-30196,-12725,-30206,-12702,-30215,-12679,-30225,-12656,-30235,-12633,-30244,-12610,-30254,-12586,-30264,-12563,-30273,-12540,-30283,-12517,-30292,-12493,-30302,-12470,-30312,-12447,-30321,-12424,-30331,-12400,-30340,-12377,-30350,-12354,-30359,-12331,-30369,-12307,-30378,-12284,-30387,-12261,-30397,-12237,-30406,-12214,-30416,-12191,-30425,-12167,-30434,-12144,-30443,-12121,-30453,-12097,-30462,-12074,-30471,-12051,-30481,-12027,-30490,-12004,-30499,-11981,-30508,-11957,-30517,-11934,-30526,-11910,-30536,-11887,-30545,-11863,-30554,-11840,-30563,-11817,-30572,-11793,-30581,-11770,-30590,-11746,-30599,-11723,-30608,-11699,-30617,-11676,-30626,-11652,-30635,-11629,-30644,-11605,-30653,-11582,-30661,-11558,-30670,-11535,-30679,-11511,-30688,-11488,-30697,-11464,-30706,-11441,-30714,-11417,-30723,-11394,-30732,-11370,-30740,-11346,-30749,-11323,-30758,-11299,-30767,-11276,-30775,-11252,-30784,-11228,-30792,-11205,-30801,-11181,-30810,-11158,-30818,-11134,-30827,-11110,-30835,-11087,-30844,-11063,-30852,-11039,-30861,-11016,-30869,-10992,-30877,-10968,-30886,-10945,-30894,-10921,-30903,-10897,-30911,-10874,-30919,-10850,-30928,-10826,-30936,-10802,-30944,-10779,-30952,-10755,-30961,-10731,-30969,-10707,-30977,-10684,-30985,-10660,-30993,-10636,-31002,-10612,-31010,-10589,-31018,-10565,-31026,-10541,-31034,-10517,-31042,-10493,-31050,-10470,-31058,-10446,-31066,-10422,-31074,-10398,-31082,-10374,-31090,-10350,-31098,-10327,-31106,-10303,-31114,-10279,-31122,-10255,-31129,-10231,-31137,-10207,-31145,-10183,-31153,-10160,-31161,-10136,-31168,-10112,-31176,-10088,-31184,-10064,-31192,-10040,-31199,-10016,-31207,-9992,-31215,-9968,-31222,-9944,-31230,-9920,-31237,-9896,-31245,-9872,-31253,-9848,-31260,-9824,-31268,-9800,-31275,-9776,-31283,-9752,-31290,-9728,-31298,-9704,-31305,-9680,-31312,-9656,-31320,-9632,-31327,-9608,-31335,-9584,-31342,-9560,-31349,-9536,-31357,-9512,-31364,-9488,-31371,-9464,-31378,-9440,-31386,-9416,-31393,-9392,-31400,-9368,-31407,-9344,-31414,-9320,-31421,-9296,-31429,-9271,-31436,-9247,-31443,-9223,-31450,-9199,-31457,-9175,-31464,-9151,-31471,-9127,-31478,-9103,-31485,-9078,-31492,-9054,-31499,-9030,-31506,-9006,-31513,-8982,-31519,-8958,-31526,-8933,-31533,-8909,-31540,-8885,-31547,-8861,-31554,-8837,-31560,-8813,-31567,-8788,-31574,-8764,-31581,-8740,-31587,-8716,-31594,-8691,-31601,-8667,-31607,-8643,-31614,-8619,-31620,-8594,-31627,-8570,-31634,-8546,-31640,-8522,-31647,-8497,-31653,-8473,-31660,-8449,-31666,-8425,-31673,-8400,-31679,-8376,-31685,-8352,-31692,-8327,-31698,-8303,-31705,-8279,-31711,-8254,-31717,-8230,-31724,-8206,-31730,-8181,-31736,-8157,-31742,-8133,-31749,-8108,-31755,-8084,-31761,-8060,-31767,-8035,-31773,-8011,-31779,-7987,-31786,-7962,-31792,-7938,-31798,-7913,-31804,-7889,-31810,-7865,-31816,-7840,-31822,-7816,-31828,-7791,-31834,-7767,-31840,-7743,-31846,-7718,-31852,-7694,-31857,-7669,-31863,-7645,-31869,-7620,-31875,-7596,-31881,-7572,-31887,-7547,-31892,-7523,-31898,-7498,-31904,-7474,-31910,-7449,-31915,-7425,-31921,-7400,-31927,-7376,-31932,-7351,-31938,-7327,-31944,-7302,-31949,-7278,-31955,-7253,-31960,-7229,-31966,-7204,-31971,-7180,-31977,-7155,-31982,-7131,-31988,-7106,-31993,-7082,-31999,-7057,-32004,-7033,-32009,-7008,-32015,-6983,-32020,-6959,-32025,-6934,-32031,-6910,-32036,-6885,-32041,-6861,-32047,-6836,-32052,-6812,-32057,-6787,-32062,-6762,-32067,-6738,-32073,-6713,-32078,-6689,-32083,-6664,-32088,-6639,-32093,-6615,-32098,-6590,-32103,-6565,-32108,-6541,-32113,-6516,-32118,-6492,-32123,-6467,-32128,-6442,-32133,-6418,-32138,-6393,-32143,-6368,-32148,-6344,-32153,-6319,-32157,-6294,-32162,-6270,-32167,-6245,-32172,-6220,-32177,-6196,-32181,-6171,-32186,-6146,-32191,-6122,-32195,-6097,-32200,-6072,-32205,-6048,-32209,-6023,-32214,-5998,-32219,-5973,-32223,-5949,-32228,-5924,-32232,-5899,-32237,-5875,-32241,-5850,-32246,-5825,-32250,-5800,-32255,-5776,-32259,-5751,-32263,-5726,-32268,-5701,-32272,-5677,-32276,-5652,-32281,-5627,-32285,-5602,-32289,-5578,-32294,-5553,-32298,-5528,-32302,-5503,-32306,-5479,-32311,-5454,-32315,-5429,-32319,-5404,-32323,-5379,-32327,-5355,-32331,-5330,-32335,-5305,-32339,-5280,-32343,-5255,-32347,-5231,-32351,-5206,-32355,-5181,-32359,-5156,-32363,-5131,-32367,-5107,-32371,-5082,-32375,-5057,-32379,-5032,-32383,-5007,-32387,-4982,-32390,-4958,-32394,-4933,-32398,-4908,-32402,-4883,-32405,-4858,-32409,-4833,-32413,-4808,-32417,-4784,-32420,-4759,-32424,-4734,-32427,-4709,-32431,-4684,-32435,-4659,-32438,-4634,-32442,-4609,-32445,-4585,-32449,-4560,-32452,-4535,-32456,-4510,-32459,-4485,-32463,-4460,-32466,-4435,-32469,-4410,-32473,-4385,-32476,-4360,-32479,-4336,-32483,-4311,-32486,-4286,-32489,-4261,-32493,-4236,-32496,-4211,-32499,-4186,-32502,-4161,-32505,-4136,-32509,-4111,-32512,-4086,-32515,-4061,-32518,-4036,-32521,-4012,-32524,-3987,-32527,-3962,-32530,-3937,-32533,-3912,-32536,-3887,-32539,-3862,-32542,-3837,-32545,-3812,-32548,-3787,-32551,-3762,-32554,-3737,-32557,-3712,-32559,-3687,-32562,-3662,-32565,-3637,-32568,-3612,-32571,-3587,-32573,-3562,-32576,-3537,-32579,-3512,-32581,-3487,-32584,-3462,-32587,-3437,-32589,-3412,-32592,-3387,-32595,-3362,-32597,-3337,-32600,-3312,-32602,-3287,-32605,-3262,-32607,-3237,-32610,-3212,-32612,-3187,-32615,-3162,-32617,-3137,-32619,-3112,-32622,-3087,-32624,-3062,-32626,-3037,-32629,-3012,-32631,-2987,-32633,-2962,-32636,-2937,-32638,-2912,-32640,-2887,-32642,-2862,-32645,-2837,-32647,-2812,-32649,-2787,-32651,-2762,-32653,-2737,-32655,-2712,-32657,-2687,-32659,-2662,-32661,-2637,-32663,-2611,-32665,-2586,-32667,-2561,-32669,-2536,-32671,-2511,-32673,-2486,-32675,-2461,-32677,-2436,-32679,-2411,-32681,-2386,-32682,-2361,-32684,-2336,-32686,-2311,-32688,-2286,-32689,-2261,-32691,-2236,-32693,-2210,-32695,-2185,-32696,-2160,-32698,-2135,-32700,-2110,-32701,-2085,-32703,-2060,-32704,-2035,-32706,-2010,-32707,-1985,-32709,-1960,-32710,-1935,-32712,-1909,-32713,-1884,-32715,-1859,-32716,-1834,-32718,-1809,-32719,-1784,-32720,-1759,-32722,-1734,-32723,-1709,-32724,-1684,-32726,-1659,-32727,-1633,-32728,-1608,-32729,-1583,-32730,-1558,-32732,-1533,-32733,-1508,-32734,-1483,-32735,-1458,-32736,-1433,-32737,-1407,-32738,-1382,-32739,-1357,-32740,-1332,-32741,-1307,-32742,-1282,-32743,-1257,-32744,-1232,-32745,-1207,-32746,-1181,-32747,-1156,-32748,-1131,-32749,-1106,-32750,-1081,-32751,-1056,-32751,-1031,-32752,-1006,-32753,-981,-32754,-955,-32754,-930,-32755,-905,-32756,-880,-32756,-855,-32757,-830,-32758,-805,-32758,-780,-32759,-754,-32759,-729,-32760,-704,-32760,-679,-32761,-654,-32761,-629,-32762,-604,-32762,-579,-32763,-553,-32763,-528,-32764,-503,-32764,-478,-32764,-453,-32765,-428,-32765,-403,-32765,-377,-32766,-352,-32766,-327,-32766,-302,-32766,-277,-32767,-252,-32767,-227,-32767,-202,-32767,-176,-32767,-151,-32767,-126,-32767,-101,-32767,-76,-32767,-51,-32767,-26}; diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 6474e83dd9..1190c9523f 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -3336,7 +3336,7 @@ PMI_FEEDBACK: PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[PHY_vars_UE->dlsch_ue[0][cw]->current_harq_pid]->G = coded_bits_per_codeword; - /* + // calculate uncoded BLER uncoded_ber=0; for (i=0;idlsch_unscrambling_stats); dlsch_unscrambling(&PHY_vars_UE->lte_frame_parms, @@ -3463,12 +3463,12 @@ PMI_FEEDBACK: } sprintf(fname,"rxsig0_r%d.m",round); - sprintf(vname,"rxs0_r%d.m",round); + sprintf(vname,"rxs0_r%d",round); write_output(fname,vname, &PHY_vars_UE->lte_ue_common_vars.rxdata[0][0],10*PHY_vars_UE->lte_frame_parms.samples_per_tti,1,1); sprintf(fname,"rxsigF0_r%d.m",round); - sprintf(vname,"rxs0F_r%d.m",round); + sprintf(vname,"rxs0F_r%d",round); write_output(fname,vname, &PHY_vars_UE->lte_ue_common_vars.rxdataF[0][0],2*PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,2,1); - + if (PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) { sprintf(fname,"rxsig1_r%d.m",round); sprintf(vname,"rxs1_r%d.m",round); @@ -3479,14 +3479,14 @@ PMI_FEEDBACK: } sprintf(fname,"dlsch00_r%d.m",round); - sprintf(vname,"dl00_r%d.m",round); + sprintf(vname,"dl00_r%d",round); write_output(fname,vname, &(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][0][0]), PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,1,1); if (PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) { sprintf(fname,"dlsch01_r%d.m",round); - sprintf(vname,"dl01_r%d.m",round); + sprintf(vname,"dl01_r%d",round); write_output(fname,vname, &(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][1][0]), PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1); @@ -3494,7 +3494,7 @@ PMI_FEEDBACK: if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1) { sprintf(fname,"dlsch10_r%d.m",round); - sprintf(vname,"dl10_r%d.m",round); + sprintf(vname,"dl10_r%d",round); write_output(fname,vname, &(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][2][0]), PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1); @@ -3502,7 +3502,7 @@ PMI_FEEDBACK: if ((PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) && (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1)) { sprintf(fname,"dlsch11_r%d.m",round); - sprintf(vname,"dl11_r%d.m",round); + sprintf(vname,"dl11_r%d",round); write_output(fname,vname, &(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][3][0]), PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1); From 1e08469ed8fe8232133be1f2df53fa17ee81cb06 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Mon, 14 Dec 2015 01:51:26 -0800 Subject: [PATCH 023/214] conversion of some sse4 code to avx2 for turbo encoder. No noticeable improvement (output expansion for encoder doesn't benefit much because of unpack instruction difference on AVX2. maxh adjustement in dlsch_demodulation (to be checked further for other mcs) exit criterion in dlsim to allow estimation of lower BLER. --- cmake_targets/CMakeLists.txt | 2 +- openair1/PHY/CODING/3gpplte_sse.c | 203 ++++++++++++++++-- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 2 +- openair1/SIMULATION/LTE_PHY/dlsim.c | 2 +- 4 files changed, 185 insertions(+), 24 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index d8fd96353d..8ba602c25d 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -134,7 +134,7 @@ else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l") set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2") endif() if (CPUINFO MATCHES "sse4_2") - set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2 -msse4.2") + set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.2") endif() if (CPUINFO MATCHES "sse4_1") set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1") diff --git a/openair1/PHY/CODING/3gpplte_sse.c b/openair1/PHY/CODING/3gpplte_sse.c index 41c0f65dc3..3dda77e4ee 100755 --- a/openair1/PHY/CODING/3gpplte_sse.c +++ b/openair1/PHY/CODING/3gpplte_sse.c @@ -37,6 +37,7 @@ #include "extern_3GPPinterleaver.h" #else #include "vars.h" +#include #endif #include #include @@ -48,6 +49,7 @@ #define print_shorts(s,x) printf("%s %x,%x,%x,%x,%x,%x,%x,%x\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7]) #define print_ints(s,x) printf("%s %x %x %x %x\n",s,(x)[0],(x)[1],(x)[2],(x)[3]) +#define print_bytes2(s,x) printf("%s %x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7],(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15],(x)[16],(x)[17],(x)[18],(x)[19],(x)[20],(x)[21],(x)[22],(x)[23],(x)[24],(x)[25],(x)[26],(x)[27],(x)[28],(x)[29],(x)[30],(x)[31]) //#define DEBUG_TURBO_ENCODER 1 #define CALLGRIND 1 @@ -143,9 +145,10 @@ void treillis_table_init(void) char interleave_compact_byte(short * base_interleaver,unsigned char * input, unsigned char * output, int n) { - char expandInput[768*8] __attribute__((aligned(16))); + char expandInput[768*8] __attribute__((aligned(32))); int i,loop=n>>4; #if defined(__x86_64__) || defined(__i386__) +#ifndef __AVX2__ __m128i *i_128=(__m128i *)input, *o_128=(__m128i*)expandInput; __m128i tmp1, tmp2, tmp3, tmp4; __m128i BIT_MASK = _mm_set_epi8( 0b00000001, @@ -164,6 +167,43 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns 0b00100000, 0b01000000, 0b10000000); + +#else + __m256i *i_256=(__m256i *)input, *o_256=(__m256i*)expandInput; + __m256i tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + __m256i BIT_MASK = _mm256_set_epi8( 0b00000001, + 0b00000010, + 0b00000100, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b00000001, + 0b00000010, + 0b00000100, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b00000001, + 0b00000010, + 0b00000100, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b00000001, + 0b00000010, + 0b00000100, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b10000000); +#endif #elif defined(__arm__) uint8x16_t *i_128=(uint8x16_t *)input, *o_128=(uint8x16_t *)expandInput; uint8x16_t tmp1,tmp2; @@ -187,46 +227,123 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns 0b00000010, 0b00000001}; #endif + +#ifndef __AVX2__ if ((n&15) > 0) loop++; - +#else + loop=n>>5; + if ((n&31) > 0) + loop++; +#endif for (i=0; i>(7-b); */ #if defined(__x86_64__) || defined(__i386__) - tmp1=_mm_load_si128(i_128++); - tmp2=_mm_unpacklo_epi8(tmp1,tmp1); - tmp3=_mm_unpacklo_epi16(tmp2,tmp2); - tmp4=_mm_unpacklo_epi32(tmp3,tmp3); +#ifndef __AVX2__ + tmp1=_mm_load_si128(i_128++); // tmp1 = B0,B1,...,B15 + tmp2=_mm_unpacklo_epi8(tmp1,tmp1); // tmp2 = B0,B0,B1,B1,...,B7,B7 + tmp3=_mm_unpacklo_epi16(tmp2,tmp2); // tmp3 = B0,B0,B0,B0,B1,B1,B1,B1,B2,B2,B2,B2,B3,B3,B3,B3 + tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 - B0,B0,B0,B0,B0,B0,B0,B0,B1,B1,B1,B1,B1,B1,B1,B1 *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK); - tmp4=_mm_unpackhi_epi32(tmp3,tmp3); + tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 - B2,B2,B2,B2,B2,B2,B2,B2,B3,B3,B3,B3,B3,B3,B3,B3 *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);; - tmp3=_mm_unpackhi_epi16(tmp2,tmp2); - tmp4=_mm_unpacklo_epi32(tmp3,tmp3); + tmp3=_mm_unpackhi_epi16(tmp2,tmp2); // tmp3 = B4,B4,B4,B4,B5,B5,B5,B5,B6,B6,B6,B6,B7,B7,B7,B7 + tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 - B4,B4,B4,B4,B4,B4,B4,B4,B5,B5,B5,B5,B5,B5,B5,B5 *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);; - tmp4=_mm_unpackhi_epi32(tmp3,tmp3); + tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 - B6,B6,B6,B6,B6,B6,B6,B6,B7,B7,B7,B7,B7,B7,B7,B7 *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);; - tmp2=_mm_unpackhi_epi8(tmp1,tmp1); - tmp3=_mm_unpacklo_epi16(tmp2,tmp2); - tmp4=_mm_unpacklo_epi32(tmp3,tmp3); + tmp2=_mm_unpackhi_epi8(tmp1,tmp1); // tmp2 = B8,B8,B9,B9,...,B15,B15 + tmp3=_mm_unpacklo_epi16(tmp2,tmp2); // tmp3 = B8,B8,B8,B8,B9,B9,B9,B9,B10,B10,B10,B10,B11,B11,B11,B11 + tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 = B8,B8,B8,B8,B8,B8,B8,B8,B9,B9,B9,B9,B9,B9,B9,B9 *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);; - tmp4=_mm_unpackhi_epi32(tmp3,tmp3); + tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 = B10,B10,B10,B10,B10,B10,B10,B10,B11,B11,B11,B11,B11,B11,B11,B11 *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);; - tmp3=_mm_unpackhi_epi16(tmp2,tmp2); - tmp4=_mm_unpacklo_epi32(tmp3,tmp3); + tmp3=_mm_unpackhi_epi16(tmp2,tmp2); // tmp3 = B12,B12,B12,B12,B13,B13,B13,B13,B14,B14,B14,B14,B15,B15,B15,B15 + tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 = B12,B12,B12,B12,B12,B12,B12,B12,B13,B13,B13,B13,B13,B13,B13,B13 *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);; - tmp4=_mm_unpackhi_epi32(tmp3,tmp3); + tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 = B14,B14,B14,B14,B14,B14,B14,B14,B15,B15,B15,B15,B15,B15,B15,B15 *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);; +#else + tmp1=_mm256_load_si256(i_256++); // tmp1 = B0,B1,...,B15,...,B31 + //print_bytes2("in",(uint8_t*)&tmp1); + tmp2=_mm256_unpacklo_epi8(tmp1,tmp1); // tmp2 = B0,B0,B1,B1,...,B7,B7,B16,B16,B17,B17,...,B23,B23 + tmp3=_mm256_unpacklo_epi16(tmp2,tmp2); // tmp3 = B0,B0,B0,B0,B1,B1,B1,B1,B2,B2,B2,B2,B3,B3,B3,B3,B16,B16,B16,B16,...,B19,B19,B19,B19 + tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 - B0,B0,B0,B0,B0,B0,B0,B0,B1,B1,B1,B1,B1,B1,B1,B1,B16,B16...,B17..,B17 + tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 - B2,B2,B2,B2,B2,B2,B2,B2,B3,B3,B3,B3,B3,B3,B3,B3,B18...,B18,B19,...,B19 + tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1); // tmp6 = B0 B1 B2 B3 + tmp7=_mm256_insertf128_si256(tmp5,_mm256_extracti128_si256(tmp4,1),0); // tmp7 = B16 B17 B18 B19 + //print_bytes2("tmp2",(uint8_t*)&tmp2); + //print_bytes2("tmp3",(uint8_t*)&tmp3); + //print_bytes2("tmp4",(uint8_t*)&tmp4); + //print_bytes2("tmp5",(uint8_t*)&tmp4); + //print_bytes2("tmp6",(uint8_t*)&tmp6); + //print_bytes2("tmp7",(uint8_t*)&tmp7); + o_256[0]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp6,BIT_MASK),BIT_MASK); + //print_bytes2("out",(uint8_t*)o_256); + o_256[4]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);; + //print_bytes2("out",(uint8_t*)(o_256+4)); + tmp3=_mm256_unpackhi_epi16(tmp2,tmp2); // tmp3 = B4,B4,B4,B4,B5,B5,B5,B5,B6,B6,B6,B6,B7,B7,B7,B7,B20,B20,B20,B20,...,B23,B23,B23,B23 + tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 - B4,B4,B4,B4,B4,B4,B4,B4,B5,B5,B5,B5,B5,B5,B5,B5,B20,B20...,B21..,B21 + tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 - B6,B6,B6,B6,B6,B6,B6,B6,B7,B7,B7,B7,B7,B7,B7,B7,B22...,B22,B23,...,B23 + tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1); // tmp6 = B4 B5 B6 B7 + tmp7=_mm256_insertf128_si256(tmp5,_mm256_extracti128_si256(tmp4,1),0); // tmp7 = B20 B21 B22 B23 + //print_bytes2("tmp2",(uint8_t*)&tmp2); + //print_bytes2("tmp3",(uint8_t*)&tmp3); + //print_bytes2("tmp4",(uint8_t*)&tmp4); + //print_bytes2("tmp5",(uint8_t*)&tmp4); + //print_bytes2("tmp6",(uint8_t*)&tmp6); + //print_bytes2("tmp7",(uint8_t*)&tmp7); + o_256[1]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp6,BIT_MASK),BIT_MASK); + //print_bytes2("out",(uint8_t*)(o_256+1)); + o_256[5]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);; + //print_bytes2("out",(uint8_t*)(o_256+4)); + + tmp2=_mm256_unpackhi_epi8(tmp1,tmp1); // tmp2 = B8 B9 B10 B11 B12 B13 B14 B15 B25 B26 B27 B28 B29 B30 B31 + tmp3=_mm256_unpacklo_epi16(tmp2,tmp2); // tmp3 = B8,B9,B10,B11,B26,B27,B28,B29 + tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 - B8,B9,B26,B27 + tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 - B10,B11,B28,B29 + tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1); // tmp6 = B8 B9 B10 B11 + tmp7=_mm256_insertf128_si256(tmp5,_mm256_extracti128_si256(tmp4,1),0); // tmp7 = B26 B27 B28 B29 + //print_bytes2("tmp2",(uint8_t*)&tmp2); + //print_bytes2("tmp3",(uint8_t*)&tmp3); + //print_bytes2("tmp4",(uint8_t*)&tmp4); + //print_bytes2("tmp5",(uint8_t*)&tmp4); + //print_bytes2("tmp6",(uint8_t*)&tmp6); + //print_bytes2("tmp7",(uint8_t*)&tmp7); + o_256[2]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp6,BIT_MASK),BIT_MASK); + //print_bytes2("out",(uint8_t*)(o_256+2)); + o_256[6]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);; + //print_bytes2("out",(uint8_t*)(o_256+4)); + + tmp3=_mm256_unpackhi_epi16(tmp2,tmp2); // tmp3 = B12 B13 B14 B15 B28 B29 B30 B31 + tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 = B12 B13 B28 B29 + tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 = B14 B15 B30 B31 + tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1); // tmp6 = B12 B13 B14 B15 + tmp7=_mm256_insertf128_si256(tmp5,_mm256_extracti128_si256(tmp4,1),0); // tmp7 = B28 B29 B30 B31 + //print_bytes2("tmp2",(uint8_t*)&tmp2); + //print_bytes2("tmp3",(uint8_t*)&tmp3); + //print_bytes2("tmp4",(uint8_t*)&tmp4); + //print_bytes2("tmp5",(uint8_t*)&tmp4); + //print_bytes2("tmp6",(uint8_t*)&tmp6); + //print_bytes2("tmp7",(uint8_t*)&tmp7); + o_256[3]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp6,BIT_MASK),BIT_MASK); + //print_bytes2("out",(uint8_t*)(o_256+3)); + o_256[7]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);; + //print_bytes2("out",(uint8_t*)(o_256+7)); + + o_256+=8; +#endif #elif defined(__arm__) tmp1=vld1q_u8((uint8_t*)i_128); //print_bytes("tmp1:",(uint8_t*)&tmp1); @@ -305,8 +422,13 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns short * ptr_intl=base_interleaver; #if defined(__x86_64) || defined(__i386__) +#ifndef __AVX2__ __m128i tmp; - uint16_t *systematic2_ptr=(unsigned short *) output; + uint16_t *systematic2_ptr=(uint16_t *) output; +#else + __m256i tmp; + uint32_t *systematic2_ptr=(uint32_t *) output; +#endif #elif defined(__arm__) uint8x16_t tmp; const uint8_t __attribute__ ((aligned (16))) _Powers[16]= @@ -316,11 +438,15 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns uint8x16_t Powers= vld1q_u8(_Powers); uint8_t *systematic2_ptr=(uint8_t *) output; #endif +#ifndef __AVX2 int input_length_words=n>>1; - +#else + int input_length_words=n>>2; +#endif for ( i=0; i< input_length_words ; i ++ ) { #if defined(__x86_64__) || defined(__i386__) +#ifndef __AVX2__ tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],7); tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],6); tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],5); @@ -338,6 +464,41 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],8+1); tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],8+0); *systematic2_ptr++=(unsigned short)_mm_movemask_epi8(tmp); +#else + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],7); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],6); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],5); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],4); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],3); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],2); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],1); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],0); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+7); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+6); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+5); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+4); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+3); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+2); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+1); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+0); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+7); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+6); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+5); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+4); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+3); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+2); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+1); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+0); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+7); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+6); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+5); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+4); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+3); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+2); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+1); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+0); + *systematic2_ptr++=(unsigned int)_mm256_movemask_epi8(tmp); +#endif #elif defined(__arm__) tmp=vsetq_lane_u8(expandInput[*ptr_intl++],tmp,7); tmp=vsetq_lane_u8(expandInput[*ptr_intl++],tmp,6); @@ -485,7 +646,7 @@ void threegpplte_turbo_encoder(unsigned char *input, int main(int argc,char **argv) { - unsigned char input[INPUT_LENGTH+16],state,state2; + unsigned char input[INPUT_LENGTH+32],state,state2; unsigned char output[12+(3*(INPUT_LENGTH<<3))],x,z; int i; unsigned char out; @@ -510,7 +671,7 @@ int main(int argc,char **argv) memset((void*)input,0,INPUT_LENGTH+16); for (i=0; ilog2_maxh = (log2_approx(avgs)/2); + lte_ue_pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2)+3; // + log2_approx(frame_parms->nb_antennas_tx_eNB-1) //-1 because log2_approx counts the number of bits // + log2_approx(frame_parms->nb_antennas_rx-1); diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 1190c9523f..ef7f640e50 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -4033,7 +4033,7 @@ PMI_FEEDBACK: printf("[continue] effective rate : %f (%2.1f%%,%f)): increase snr \n",rate*effective_rate, 100*effective_rate, rate); } - if (((double)errs[0]/(round_trials[0]))<1e-2) + if (((double)errs[0]/(round_trials[0]))<(10.0/n_frames)) break; }// SNR From 3e3bdd9ef23c6c3a3738021f3f288509dda30903 Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 15 Dec 2015 13:19:00 +0100 Subject: [PATCH 024/214] Removed from this repo epc xsl files, commiting for sync --- cmake_targets/tools/build_helper | 179 ++++++++- cmake_targets/tools/build_test_epc_tools | 1 - openair3/TEST/EPC_TEST/generate_scenario.c | 17 +- openair3/TEST/EPC_TEST/generic_scenario.xsl | 312 ---------------- openair3/TEST/EPC_TEST/mme_test_s1_pcap2pdml | 104 ------ openair3/TEST/EPC_TEST/play_scenario.c | 6 - openair3/TEST/EPC_TEST/play_scenario.h | 3 +- openair3/TEST/EPC_TEST/play_scenario.xsl | 113 ------ openair3/TEST/EPC_TEST/play_scenario_parse.c | 13 +- openair3/TEST/EPC_TEST/play_scenario_s1ap.c | 14 +- .../EPC_TEST/play_scenario_s1ap_compare_ie.c | 351 ++++++++++++++++++ .../enb.band7.tm1.usrpb210.epc.local.conf | 12 +- 12 files changed, 557 insertions(+), 568 deletions(-) delete mode 100644 openair3/TEST/EPC_TEST/generic_scenario.xsl delete mode 100755 openair3/TEST/EPC_TEST/mme_test_s1_pcap2pdml delete mode 100644 openair3/TEST/EPC_TEST/play_scenario.xsl diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 350dae86a6..0a0118581e 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -30,7 +30,7 @@ ################################################################################ # file build_helper # brief -# author Laurent Thomas +# authors Laurent Thomas, Lionel GAUTHIER # ####################################### SUDO='sudo -E' @@ -301,6 +301,183 @@ install_nas_tools() { fi } +################################################# +# 3. Network interfaces utilities +################################################ + +cidr2mask(){ + local i mask="" + local full_octets=$(($1/8)) + local partial_octet=$(($1%8)) + + for ((i=0;i<4;i+=1)); do + if [ $i -lt $full_octets ]; then + mask+=255 + elif [ $i -eq $full_octets ]; then + mask+=$((256 - 2**(8-$partial_octet))) + else + mask+=0 + fi + test $i -lt 3 && mask+=. + done + + echo $mask +} + +# example: netcalc 192.168.12.100 255.255.255.0 +netcalc(){ + local IFS='.' ip i + local -a oct msk + + read -ra oct <<<"$1" + read -ra msk <<<"$2" + + for i in ${!oct[@]}; do + ip+=( "$(( oct[i] & msk[i] ))" ) + done + + echo "${ip[*]}" +} + +# example: +bcastcalc(){ + local IFS='.' ip i + local -a oct msk + + read -ra oct <<<"$1" + read -ra msk <<<"$2" + + for i in ${!oct[@]}; do + ip+=( "$(( oct[i] + ( 255 - ( oct[i] | msk[i] ) ) ))" ) + done + echo "${ip[*]}" +} + + +is_real_interface(){ + my_bool=1 + for var in "$@" + do + if [ "a$var" == "a" ]; then + return 0 + fi + if [ "a$var" == "anone" ]; then + return 0 + fi + IF=`cat /etc/udev/rules.d/70-persistent-net.rules | grep $var | sed 's/^.*NAME=//' | tr -d '"'` + if [ "$IF" == "$var" ]; then + if [ "a${var:0:3}" != "aeth" ]; then + if [ "a${var:0:4}" != "awlan" ]; then + if [ "a${var:0:4}" != "awifi" ]; then + my_bool=0; + fi + fi + fi + fi + done + return $my_bool +} + +is_virtual_interface(){ + my_bool=1 + for var in "$@" + do + if [ "a$var" == "a" ]; then + return 0 + fi + if [ "a$var" == "anone" ]; then + return 0 + fi + num=`expr index "$var" :` + + if [ $num -eq 0 ]; then + my_bool=0; + fi + done + return $my_bool +} + +# arg1 = interface name +# arg2 = ipv4 addr cidr +set_interface_up(){ + interface=$1 + address=${2%/*} #part before '/' + cidr_netmask=${2#*/} # part after '/' + + if [ "a${interface:0:4}" == "anone" ]; then + return; + fi + echo "ifconfig $interface up" + $SUDO ifconfig $interface up + sync + netmask=`cidr2mask $cidr_netmask` + broadcast=`bcastcalc $address $netmask` + echo "ip -4 addr add $address/$cidr_netmask broadcast $broadcast dev $interface" + $SUDO ip -4 addr add $address/$cidr_netmask broadcast $broadcast dev $interface + sync +} + +# arg1 = interface name +# arg2 = ipv4 addr cidr +set_virtual_interface_up(){ + interface=$1 + address=${2%/*} #part before '/' + cidr_netmask=${2#*/} # part after '/' + + if [ "a${interface:0:4}" == "anone" ]; then + return; + fi + $SUDO ifconfig $interface down > /dev/null 2>&1 + sync + echo "ifconfig $interface $address up" + $SUDO ifconfig $interface $address up + sync +} + +#arg1 is interface name +#arg2 is IP address (CIDR) +set_network_interface(){ + local interface_name=$1 + local ip_cidr=$2 + + is_virtual_interface $interface_name + if [ $? -eq 1 ]; then + echo "$interface_name is virtual interface" + set_virtual_interface_up $interface_name $ip_cidr + else + is_real_interface $interface_name + if [ $? -eq 1 ]; then + echo "$interface_name is real interface" + set_interface_up $interface_name $ip_cidr + else + echo_warning "$interface_name not handled, not configuring it" + return + fi + fi +} + +# arg1 is a 'libconfig-like' config file +set_epc_network_interfaces(){ + value="`cat $1 | cut -d "#" -f1 | grep 'ADDRESS\|INTERFACE' | tr -d " " | grep "="`" + eval $value + + # check all var names are correct + list_var_name="\ + ENB_INTERFACE_NAME_FOR_S1_MME ENB_IPV4_ADDRESS_FOR_S1_MME \ + ENB_INTERFACE_NAME_FOR_S1U ENB_IPV4_ADDRESS_FOR_S1U " + for var_name in $list_var_name + do + if [ -n "$${var_name}" ]; then + echo_success "Found ${var_name} = ${!var_name}" + else + echo_fatal "${var_name} does does not exist in your config file $1" + fi + done + + # configure interfaces + set_network_interface $ENB_INTERFACE_NAME_FOR_S1_MME $ENB_IPV4_ADDRESS_FOR_S1_MME + set_network_interface $ENB_INTERFACE_NAME_FOR_S1U $ENB_IPV4_ADDRESS_FOR_S1U +} diff --git a/cmake_targets/tools/build_test_epc_tools b/cmake_targets/tools/build_test_epc_tools index b67cf15810..aa7103fd78 100755 --- a/cmake_targets/tools/build_test_epc_tools +++ b/cmake_targets/tools/build_test_epc_tools @@ -148,7 +148,6 @@ function main() $SUDO cp -upv test_epc_generate_scenario /usr/local/bin $SUDO cp -upv test_epc_play_scenario /usr/local/bin - $SUDO cp -upv $OPENAIR_DIR/openair3/TEST/EPC_TEST/mme_test_s1_pcap2pdml /usr/local/bin } diff --git a/openair3/TEST/EPC_TEST/generate_scenario.c b/openair3/TEST/EPC_TEST/generate_scenario.c index 9f4e16baef..238ba0ff11 100644 --- a/openair3/TEST/EPC_TEST/generate_scenario.c +++ b/openair3/TEST/EPC_TEST/generate_scenario.c @@ -97,7 +97,6 @@ #define ENB_CONFIG_MAX_XSLT_PARAMS 32 Enb_properties_array_t g_enb_properties; -char *g_openair_dir = NULL; char *g_test_dir = NULL; char *g_pdml_in_origin = NULL; extern int xmlLoadExtDtdDefaultValue; @@ -195,17 +194,13 @@ int generate_test_scenario(const char const * test_nameP, const char const * pdm exit(1); } - memset(astring, 0, sizeof(astring)); - strcat(astring, g_openair_dir); - strcat(astring, "/openair3/TEST/EPC_TEST/generic_scenario.xsl"); - xmlSubstituteEntitiesDefault(1); xmlLoadExtDtdDefaultValue = 1; - cur = xsltParseStylesheetFile(astring); + cur = xsltParseStylesheetFile("/usr/share/oai/xsl/generic_scenario.xsl"); if (NULL == cur) { - AssertFatal (0, "Could not parse stylesheet file %s (check OPENAIR_DIR env variable)!\n", astring); + AssertFatal (0, "Could not parse stylesheet file /usr/share/oai/xsl/generic_scenario.xsl!\n"); } else { - fprintf(stdout, "XSLT style sheet: %s\n", astring); + fprintf(stdout, "XSLT style sheet: /usr/share/oai/xsl/generic_scenario.xsl\n"); } doc = xmlParseFile(pdml_in_basenameP); @@ -686,12 +681,6 @@ int main( int argc, char **argv ) { int actions = 0; - g_openair_dir = getenv("OPENAIR_DIR"); - if (NULL == g_openair_dir) { - fprintf(stderr, "Error: Could not get OPENAIR_DIR environment variable\n"); - exit(1); - } - memset((char*) &g_enb_properties, 0 , sizeof(g_enb_properties)); actions = config_parse_opt_line (argc, argv); //Command-line options diff --git a/openair3/TEST/EPC_TEST/generic_scenario.xsl b/openair3/TEST/EPC_TEST/generic_scenario.xsl deleted file mode 100644 index 592bef83d4..0000000000 --- a/openair3/TEST/EPC_TEST/generic_scenario.xsl +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enb0_s1c - enb1_s1c - enb2_s1c - enb3_s1c - enb4_s1c - enb5_s1c - enb6_s1c - enb7_s1c - mme0_s1c_0 - mme0_s1c_1 - mme0_s1c_2 - mme0_s1c_3 - mme1_s1c_0 - mme1_s1c_1 - mme1_s1c_2 - mme1_s1c_3 - mme2_s1c_0 - mme2_s1c_1 - mme2_s1c_2 - mme2_s1c_3 - mme3_s1c_0 - mme3_s1c_1 - mme3_s1c_2 - mme3_s1c_3 - - ERROR: Cannot reverse resolv IP ! - - - - - - - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - - ERROR: Cannot set eNB instance ! - - - - - - - - - - - DATA - INIT - INIT_ACK - SACK - HEARTBEAT - HEARTBEAT_ACK - ABORT - SHUTDOWN - SHUTDOWN_ACK - ERROR - COOKIE_ECHO - COOKIE_ACK - ECNE - CWR - SHUTDOWN_COMPLETE - - ERROR: UNKNOWN CHUNK TYPE ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SEND - RECEIVE - - ERROR: UNKNOWN ACTION ! - - - - - - - - - - - - - - - - - - ERROR: UNKNOWN ACTION ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/openair3/TEST/EPC_TEST/mme_test_s1_pcap2pdml b/openair3/TEST/EPC_TEST/mme_test_s1_pcap2pdml deleted file mode 100755 index 796fa9a45b..0000000000 --- a/openair3/TEST/EPC_TEST/mme_test_s1_pcap2pdml +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -import sys -import subprocess -import re -import socket -import datetime -from datetime import date -import os, errno -import argparse -import tempfile -from lxml import etree -from xml.dom.minidom import parse, parseString - -##################### -# program arguments -##################### -parser = argparse.ArgumentParser() -parser.add_argument("--pcap_file", "-p", type=str,help="input pcap file to be translated") -args = parser.parse_args() - -##################### -# get xml document from pcap -##################### -orig_pcap_file_name = args.pcap_file.strip() -orig_pdml_string = subprocess.check_output(["tshark", '-T', 'pdml', '-r', orig_pcap_file_name]) - -orig_dom = parseString(orig_pdml_string) - -##################### -# filtering unwanted packets -##################### -#cases = orig_etree.findall(".//proto[@name='sctp']") -packets = orig_dom.getElementsByTagName("packet") -for packet in packets: - found_sctp = False - found_s1ap = False - sctp_node = None - frame_node = None - ip_node = None - protos = packet.getElementsByTagName("proto") - for proto in protos: - attrs = proto.attributes - urlnode = attrs['name'] - if urlnode.nodeValue == 'frame': - frame_node = proto - elif urlnode.nodeValue == 'ip': - frame_node.appendChild(proto) - ip_node = proto - elif urlnode.nodeValue == 'sctp': - found_sctp = True - ip_node.appendChild(proto) - sctp_node = proto - elif urlnode.nodeValue == 's1ap': - found_s1ap = True - sctp_node.appendChild(proto) - elif urlnode.nodeValue == 'geninfo': - packet.removeChild(proto) - elif urlnode.nodeValue == 'eth': - packet.removeChild(proto) - if found_sctp == False: - # hopefully it seems to work (remove iterated packet) - packet.parentNode.removeChild(packet) - -##################### -# dom to xml string -##################### -filtered_pdml_string = orig_dom.toprettyxml(indent=" ") -cleaned_pdml_string = "" -##################### -# remove blank lines in xml string -##################### -lines = filtered_pdml_string.splitlines() -for line in lines: - if len(line.strip()): - if line[:-1]: - cleaned_pdml_string += line + '\r\n' -#print "'%s'" % cleaned_pdml_string -##################### -# write pdml string to pdml file -##################### -out_pdml_file_name = os.path.dirname(orig_pcap_file_name) + '/' + os.path.splitext(os.path.basename(orig_pcap_file_name))[0] + '.pdml' -out_file = open(out_pdml_file_name, "w") -out_file.write(cleaned_pdml_string) -out_file.close() - -############################################################ -# DECEIVING HTML BONUS: DO NOT SEEM TO WORK CORRECTLY IN FIREFOX -# DID NOT INVESTIGATE -##################### -# write xml string to html file -##################### -xsl_root = etree.fromstring(open('/usr/share/wireshark/pdml2html.xsl').read()) -transform = etree.XSLT(xsl_root) -xml_root = etree.fromstring(cleaned_pdml_string) -trans_root = transform(xml_root) -filtered_html_string = etree.tostring(trans_root) -##################### -# write html string to html file -##################### -out_html_file_name = os.path.dirname(orig_pcap_file_name) + '/' +os.path.splitext(os.path.basename(orig_pcap_file_name))[0] + '.html' -out_file = open(out_html_file_name, "w") -out_file.write(filtered_html_string) -out_file.close() diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index 133e9adf4b..a801d2cf23 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -68,7 +68,6 @@ #define GS_IS_FILE 1 #define GS_IS_DIR 2 //------------------------------------------------------------------------------ -char *g_openair_dir = NULL; Enb_properties_array_t g_enb_properties; //------------------------------------------------------------------------------ extern et_scenario_t *g_scenario; @@ -936,11 +935,6 @@ int main( int argc, char **argv ) char play_scenario_filename[NAME_MAX]; memset(play_scenario_filename, 0, sizeof(play_scenario_filename)); - g_openair_dir = getenv("OPENAIR_DIR"); - if (NULL == g_openair_dir) { - fprintf(stderr, "ERROR: Could not get OPENAIR_DIR environment variable\n"); - exit(1); - } // logging logInit(); diff --git a/openair3/TEST/EPC_TEST/play_scenario.h b/openair3/TEST/EPC_TEST/play_scenario.h index f44974dae0..758ee97981 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.h +++ b/openair3/TEST/EPC_TEST/play_scenario.h @@ -252,6 +252,7 @@ typedef struct et_s1ap_s { uint16_t binary_stream_allocated_size; uint8_t *binary_stream; s1ap_message message; // decoded message: information elements + xmlNodePtr xml_node; // XML representation of the S1AP PDU } et_s1ap_t; @@ -418,7 +419,7 @@ void et_s1ap_eNB_insert_new_instance(s1ap_eNB_instance_t *new_instance_p); struct s1ap_eNB_mme_data_s *et_s1ap_eNB_get_MME(s1ap_eNB_instance_t *instance_p,int32_t assoc_id, uint16_t cnx_id); s1ap_eNB_instance_t *et_s1ap_eNB_get_instance(instance_t instance); void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,uint32_t buffer_length, uint16_t stream); -int et_handle_s1ap_mismatch(et_packet_t * const spacket, et_packet_t * const rx_packet); +int et_handle_s1ap_mismatch_mme_ue_s1ap_id(et_packet_t * const spacket, et_packet_t * const rx_packet); asn_comp_rval_t* et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints); et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const s1ap_data_ind); int et_scenario_set_packet_received(et_packet_t * const packet); diff --git a/openair3/TEST/EPC_TEST/play_scenario.xsl b/openair3/TEST/EPC_TEST/play_scenario.xsl deleted file mode 100644 index 0ce22c08df..0000000000 --- a/openair3/TEST/EPC_TEST/play_scenario.xsl +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ERROR: Cannot resolv IP ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ERROR: Cannot resolv IP ! - - - - - - - - - - - - - - - - diff --git a/openair3/TEST/EPC_TEST/play_scenario_parse.c b/openair3/TEST/EPC_TEST/play_scenario_parse.c index 496102449a..35ed5c8603 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_parse.c +++ b/openair3/TEST/EPC_TEST/play_scenario_parse.c @@ -58,7 +58,6 @@ //------------------------------------------------------------------------------ #define ENB_CONFIG_MAX_XSLT_PARAMS 32 //------------------------------------------------------------------------------ -extern char *g_openair_dir; extern Enb_properties_array_t g_enb_properties; //------------------------------------------------------------------------------ void et_parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, et_s1ap_t * const s1ap) @@ -71,6 +70,9 @@ void et_parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, et_s1ap_t * co unsigned int go_deeper_in_tree = 1; if ((NULL != s1ap_node) && (NULL != s1ap)) { + // seee http://www.xmlsoft.org/html/libxml-tree.html#xmlCopyNode + s1ap->xml_node = xmlCopyNode(s1ap_node, 1); + AssertFatal(NULL != s1ap->xml_node, "xmlCopyNode Failed"); for (cur_node = (xmlNode *)s1ap_node; cur_node; cur_node = cur_node->next) { go_deeper_in_tree = 1; if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"field"))) { @@ -497,17 +499,14 @@ int et_generate_xml_scenario( exit(1); } - memset(astring, 0, sizeof(astring)); - strcat(astring, g_openair_dir); - strcat(astring, "/openair3/TEST/EPC_TEST/play_scenario.xsl"); xmlSubstituteEntitiesDefault(1); xmlLoadExtDtdDefaultValue = 1; - cur = xsltParseStylesheetFile((const xmlChar *)astring); + cur = xsltParseStylesheetFile((const xmlChar *)"/usr/share/oai/xsl/play_scenario.xsl"); if (NULL == cur) { - AssertFatal (0, "Could not parse stylesheet file %s (check OPENAIR_DIR env variable)!\n", astring); + AssertFatal (0, "Could not parse stylesheet file /usr/share/oai/xsl/play_scenario.xsl!\n"); } else { - fprintf(stdout, "XSLT style sheet: %s\n", astring); + fprintf(stdout, "XSLT style sheet: /usr/share/oai/xsl/play_scenario.xsl\n"); } doc = xmlParseFile(xml_in_scenario_filename); diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c index d58b16c2d3..f5afebd786 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c @@ -189,7 +189,7 @@ void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, itti_send_msg_to_task(TASK_SCTP, instance, message_p); } //------------------------------------------------------------------------------ -int et_handle_s1ap_mismatch(et_packet_t * const spacket, et_packet_t * const rx_packet) +int et_handle_s1ap_mismatch_mme_ue_s1ap_id(et_packet_t * const spacket, et_packet_t * const rx_packet) { S1ap_MME_UE_S1AP_ID_t scenario_mme_ue_s1ap_id = 0; S1ap_MME_UE_S1AP_ID_t rx_mme_ue_s1ap_id = 0; @@ -512,7 +512,15 @@ int et_handle_s1ap_mismatch(et_packet_t * const spacket, et_packet_t * const rx_ default: AssertFatal(0, "Unknown procedure code %ld", rx_packet->sctp_hdr.u.data_hdr.payload.message.procedureCode); } - return 0; + if (scenario_mme_ue_s1ap_id != rx_mme_ue_s1ap_id) { + et_packet_t * p = spacket; + while (p) { + et_s1ap_update_mme_ue_s1ap_id(p, scenario_mme_ue_s1ap_id, rx_mme_ue_s1ap_id); + p = p->next; + } + return 0; + } + return 1; } //------------------------------------------------------------------------------ asn_comp_rval_t * et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints) @@ -669,7 +677,7 @@ int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) //TODO MME_UE_S1AP_ID, etc. // get latest error code if (strcmp(comp_results->name, "S1ap-MME-UE-S1AP-ID") == 0) { - if (0 == et_handle_s1ap_mismatch((et_packet_t *const)packet, (et_packet_t *const)rx_packet)) { + if (0 == et_handle_s1ap_mismatch_mme_ue_s1ap_id((et_packet_t *const)packet, (et_packet_t *const)rx_packet)) { packet->timestamp_packet.tv_sec = rx_packet->timestamp_packet.tv_sec; packet->timestamp_packet.tv_usec = rx_packet->timestamp_packet.tv_usec; return et_scenario_set_packet_received(packet); diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c index 213be2b347..3533ee086e 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c @@ -451,3 +451,354 @@ asn_comp_rval_t * et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_messag } return ret; } + +//------------------------------------------------------------------------------ +int et_s1ap_update_mme_ue_s1ap_id(et_packet_t * const packet, const S1ap_MME_UE_S1AP_ID_t old_id, const S1ap_MME_UE_S1AP_ID_t new_id) +{ + S1ap_MME_UE_S1AP_ID_t mme_ue_s1ap_id = 0; + S1AP_PDU_PR present; + ssize_t encoded; + + present = packet->sctp_hdr.u.data_hdr.payload.pdu.present; + + S1AP_DEBUG("Updating mme_ue_s1ap_id of packet num %d...\n", packet->packet_number); + + switch (packet->sctp_hdr.u.data_hdr.payload.message.procedureCode) { + case S1ap_ProcedureCode_id_HandoverPreparation: + if (present == S1AP_PDU_PR_initiatingMessage) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequiredIEs.mme_ue_s1ap_id; + if (old_id == mme_ue_s1ap_id) { + packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequiredIEs.mme_ue_s1ap_id = new_id; + // re-encode + S1ap_HandoverRequired_t msg; + S1ap_HandoverRequired_t *msg_p = &msg; + memset((void *)msg_p, 0, sizeof(msg)); + + if (s1ap_encode_s1ap_handoverrequiredies( + msg_p, &packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequiredIEs) < 0) { + AssertFatal(0, "Re-encoding handoverrequiredies failed"); + } + + ANY_fromType_aper(&packet->sctp_hdr.u.data_hdr.payload.pdu.choice.initiatingMessage.value, + &asn_DEF_S1ap_HandoverRequired, + &packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequiredIEs); + + packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequiredIEs; + encoded = aper_encode_to_new_buffer(&asn_DEF_S1AP_PDU, 0, &packet->sctp_hdr.u.data_hdr.payload.pdu, + (void **)&packet->sctp_hdr.u.data_hdr.payload.binary_stream); + AssertFatal(encoded < 0, "Re-encoding PDU failed"); + } + } else { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverCommandIEs.mme_ue_s1ap_id; + } + break; + + case S1ap_ProcedureCode_id_HandoverResourceAllocation: + if (present == S1AP_PDU_PR_initiatingMessage) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequestIEs.mme_ue_s1ap_id; + } else if (present == S1AP_PDU_PR_successfulOutcome) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequestAcknowledgeIEs.mme_ue_s1ap_id; + } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverFailureIEs.mme_ue_s1ap_id; + } + break; + + case S1ap_ProcedureCode_id_HandoverNotification: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverNotifyIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_PathSwitchRequest: + //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PathSwitchRequestIEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PathSwitchRequestIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_HandoverCancel: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverCancelIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_E_RABSetup: + if (present == S1AP_PDU_PR_initiatingMessage) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABSetupRequestIEs.mme_ue_s1ap_id; + } else { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABSetupResponseIEs.mme_ue_s1ap_id; + } + break; + + case S1ap_ProcedureCode_id_E_RABModify: + if (present == S1AP_PDU_PR_initiatingMessage) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABModifyRequestIEs.mme_ue_s1ap_id; + } else { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABModifyResponseIEs.mme_ue_s1ap_id; + } + break; + + case S1ap_ProcedureCode_id_E_RABRelease: + if (present == S1AP_PDU_PR_initiatingMessage) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseCommandIEs.mme_ue_s1ap_id; + } else { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseResponseIEs.mme_ue_s1ap_id; + } + break; + + case S1ap_ProcedureCode_id_E_RABReleaseIndication: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseIndicationIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_InitialContextSetup: + if (present == S1AP_PDU_PR_initiatingMessage) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialContextSetupRequestIEs.mme_ue_s1ap_id; + } else { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialContextSetupResponseIEs.mme_ue_s1ap_id; + } + break; + + case S1ap_ProcedureCode_id_Paging: + //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PagingIEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PagingIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_downlinkNASTransport: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNASTransportIEs.mme_ue_s1ap_id; + if (old_id == mme_ue_s1ap_id) { + packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNASTransportIEs.mme_ue_s1ap_id = new_id; + // re-encode + S1ap_DownlinkNASTransport_t msg; + S1ap_DownlinkNASTransport_t *msg_p = &msg; + memset((void *)msg_p, 0, sizeof(msg)); + + if (s1ap_encode_s1ap_downlinknastransporties( + msg_p, &packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNASTransportIEs) < 0) { + AssertFatal(0, "Re-encoding downlinknastransporties failed"); + } + + ANY_fromType_aper(&packet->sctp_hdr.u.data_hdr.payload.pdu.choice.initiatingMessage.value, + &asn_DEF_S1ap_DownlinkNASTransport, + &packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNASTransportIEs); + + encoded = aper_encode_to_new_buffer(&asn_DEF_S1AP_PDU, 0, &packet->sctp_hdr.u.data_hdr.payload.pdu, + (void **)&packet->sctp_hdr.u.data_hdr.payload.binary_stream); + AssertFatal(encoded < 0, "Re-encoding PDU failed"); + } + break; + + case S1ap_ProcedureCode_id_initialUEMessage: + //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialUEMessageIEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialUEMessageIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_uplinkNASTransport: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNASTransportIEs.mme_ue_s1ap_id; + if (old_id == mme_ue_s1ap_id) { + packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNASTransportIEs.mme_ue_s1ap_id = new_id; + // re-encode + S1ap_UplinkNASTransport_t msg; + S1ap_UplinkNASTransport_t *msg_p = &msg; + memset((void *)msg_p, 0, sizeof(msg)); + + if (s1ap_encode_s1ap_uplinknastransporties( + msg_p, &packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNASTransportIEs) < 0) { + AssertFatal(0, "Re-encoding uplinknastransporties failed"); + } + + ANY_fromType_aper(&packet->sctp_hdr.u.data_hdr.payload.pdu.choice.initiatingMessage.value, + &asn_DEF_S1ap_DownlinkNASTransport, + &packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNASTransportIEs); + + encoded = aper_encode_to_new_buffer(&asn_DEF_S1AP_PDU, 0, &packet->sctp_hdr.u.data_hdr.payload.pdu, + (void **)&packet->sctp_hdr.u.data_hdr.payload.binary_stream); + AssertFatal(encoded < 0, "Re-encoding PDU failed"); + } + break; + + case S1ap_ProcedureCode_id_Reset: + //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ResetIEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ResetIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_ErrorIndication: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ErrorIndicationIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_NASNonDeliveryIndication: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_NASNonDeliveryIndication_IEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_S1Setup: + /*if (present == S1AP_PDU_PR_initiatingMessage) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupRequestIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupRequestIEs.mme_ue_s1ap_id; + } else if (present == S1AP_PDU_PR_successfulOutcome) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupResponseIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupResponseIEs.mme_ue_s1ap_id; + } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupFailureIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupFailureIEs.mme_ue_s1ap_id; + }*/ + break; + + case S1ap_ProcedureCode_id_UEContextReleaseRequest: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseRequestIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_DownlinkS1cdma2000tunneling: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkS1cdma2000tunnelingIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_UplinkS1cdma2000tunneling: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkS1cdma2000tunnelingIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_UEContextModification: + if (present == S1AP_PDU_PR_initiatingMessage) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationRequestIEs.mme_ue_s1ap_id; + } else if (present == S1AP_PDU_PR_successfulOutcome) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationResponseIEs.mme_ue_s1ap_id; + } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationFailureIEs.mme_ue_s1ap_id; + } + break; + + case S1ap_ProcedureCode_id_UECapabilityInfoIndication: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UECapabilityInfoIndicationIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_UEContextRelease: + if (present == S1AP_PDU_PR_initiatingMessage) { + //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.mme_ue_s1ap_id; + } else { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCompleteIEs.mme_ue_s1ap_id; + } + break; + + case S1ap_ProcedureCode_id_eNBStatusTransfer: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBStatusTransferIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_MMEStatusTransfer: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEStatusTransferIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_DeactivateTrace: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DeactivateTraceIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_TraceStart: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_TraceStartIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_TraceFailureIndication: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_TraceFailureIndicationIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_ENBConfigurationUpdate: + /*if (present == S1AP_PDU_PR_initiatingMessage) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateIEs.mme_ue_s1ap_id; + } else if (present == S1AP_PDU_PR_successfulOutcome) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id; + } else { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateFailureIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateFailureIEs.mme_ue_s1ap_id; + }*/ + break; + + case S1ap_ProcedureCode_id_MMEConfigurationUpdate: + /*if (present == S1AP_PDU_PR_initiatingMessage) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateIEs.mme_ue_s1ap_id; + } else if (present == S1AP_PDU_PR_successfulOutcome) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id; + } else { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateFailureIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateFailureIEs.mme_ue_s1ap_id; + }*/ + break; + + case S1ap_ProcedureCode_id_LocationReportingControl: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportingControlIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_LocationReportingFailureIndication: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportingFailureIndicationIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_LocationReport: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_OverloadStart: + //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStartIEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStartIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_OverloadStop: + //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStopIEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStopIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_WriteReplaceWarning: + /*if (present == S1AP_PDU_PR_initiatingMessage) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningRequestIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningRequestIEs.mme_ue_s1ap_id; + } else { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningResponseIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningResponseIEs.mme_ue_s1ap_id; + }*/ + break; + + case S1ap_ProcedureCode_id_eNBDirectInformationTransfer: + //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBDirectInformationTransferIEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBDirectInformationTransferIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_MMEDirectInformationTransfer: + //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEDirectInformationTransferIEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEDirectInformationTransferIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_PrivateMessage: + case S1ap_ProcedureCode_id_eNBConfigurationTransfer: + case S1ap_ProcedureCode_id_MMEConfigurationTransfer: + AssertFatal(0, "TODO"); + break; + + case S1ap_ProcedureCode_id_CellTrafficTrace: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_CellTrafficTraceIEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_Kill: + /*if (present == S1AP_PDU_PR_initiatingMessage) { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillRequestIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillRequestIEs.mme_ue_s1ap_id; + } else { + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillResponseIEs.mme_ue_s1ap_id; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillResponseIEs.mme_ue_s1ap_id; + }*/ + break; + + case S1ap_ProcedureCode_id_downlinkUEAssociatedLPPaTransport: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_uplinkUEAssociatedLPPaTransport: + mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_downlinkNonUEAssociatedLPPaTransport: + //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; + break; + + case S1ap_ProcedureCode_id_uplinkNonUEAssociatedLPPaTransport: + //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; + //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; + break; + + default: + AssertFatal(0, "Unknown procedure code %ld", packet->sctp_hdr.u.data_hdr.payload.message.procedureCode); + } + return 0; +} diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf index e864f47edb..a2df43fec0 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf @@ -131,7 +131,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.188.2.2"; + mme_ip_address = ( { ipv4 = "192.170.0.1"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -140,12 +140,12 @@ eNBs = NETWORK_INTERFACES : { - ENB_INTERFACE_NAME_FOR_S1_MME = "tun2"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.188.2.2/24"; + ENB_INTERFACE_NAME_FOR_S1_MME = "eth0:3"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.170.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.1/24"; - ENB_PORT_FOR_S1U = 2153; # Spec 2152 + ENB_INTERFACE_NAME_FOR_S1U = "eth0:4"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.170.1.2/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; log_config : From cc4286f27bdb827267b105a4f33bc5a63024606a Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 15 Dec 2015 16:56:55 +0100 Subject: [PATCH 025/214] sync --- openair3/TEST/EPC_TEST/play_scenario.h | 5 +- openair3/TEST/EPC_TEST/play_scenario_parse.c | 9 +- .../EPC_TEST/play_scenario_s1ap_compare_ie.c | 475 +++++------------- 3 files changed, 146 insertions(+), 343 deletions(-) diff --git a/openair3/TEST/EPC_TEST/play_scenario.h b/openair3/TEST/EPC_TEST/play_scenario.h index 758ee97981..4ac46e84b5 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.h +++ b/openair3/TEST/EPC_TEST/play_scenario.h @@ -48,6 +48,9 @@ #include "hashtable.h" #include "asn_compare.h" +#define ET_XPATH_EXPRESSION_MAX_LENGTH 400 + + // powers of 2 #define ET_BIT_MASK_MATCH_SCTP_STREAM 1 #define ET_BIT_MASK_MATCH_SCTP_SSN 2 @@ -252,7 +255,7 @@ typedef struct et_s1ap_s { uint16_t binary_stream_allocated_size; uint8_t *binary_stream; s1ap_message message; // decoded message: information elements - xmlNodePtr xml_node; // XML representation of the S1AP PDU + xmlDocPtr doc; // XML representation of the S1AP PDU } et_s1ap_t; diff --git a/openair3/TEST/EPC_TEST/play_scenario_parse.c b/openair3/TEST/EPC_TEST/play_scenario_parse.c index 35ed5c8603..b9d24f366c 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_parse.c +++ b/openair3/TEST/EPC_TEST/play_scenario_parse.c @@ -70,9 +70,12 @@ void et_parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, et_s1ap_t * co unsigned int go_deeper_in_tree = 1; if ((NULL != s1ap_node) && (NULL != s1ap)) { - // seee http://www.xmlsoft.org/html/libxml-tree.html#xmlCopyNode - s1ap->xml_node = xmlCopyNode(s1ap_node, 1); - AssertFatal(NULL != s1ap->xml_node, "xmlCopyNode Failed"); + // see http://www.xmlsoft.org/html/libxml-tree.html#xmlCopyNode + cur_node = xmlCopyNode(s1ap_node, 1); + AssertFatal(NULL != cur_node, "xmlCopyNode Failed"); + s1ap->doc = xmlNewDoc(BAD_CAST "1.0"); + xmlDocSetRootElement(s1ap->doc, cur_node); + for (cur_node = (xmlNode *)s1ap_node; cur_node; cur_node = cur_node->next) { go_deeper_in_tree = 1; if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"field"))) { diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c index 3533ee086e..87ffe29e32 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c @@ -40,6 +40,10 @@ #include #include #include +#include +#include +#include +#include #include "tree.h" #include "queue.h" @@ -452,353 +456,146 @@ asn_comp_rval_t * et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_messag return ret; } + +static void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, xmlChar *new_id_hex, xmlChar *new_id_dec, xmlChar *showname) +{ + xmlNode *cur_node = NULL; + xmlAttrPtr attr = NULL; + xmlChar *xml_char = NULL; + int size = 0; + int pos = 0; + int go_deeper_in_tree = 1; + // modify + for (cur_node = (xmlNode *)node; cur_node; cur_node = cur_node->next) { + go_deeper_in_tree = 1; + if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"field"))) { + // do not get hidden fields + xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"hide"); + if (NULL != xml_char) { + if ((!xmlStrcmp(xml_char, (const xmlChar *)"yes"))) { + go_deeper_in_tree = 0; + } + xmlFree(xml_char); + } + if (0 < go_deeper_in_tree) { + // first get size + xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"pos"); + if (NULL != xml_char) { + pos = strtoul((const char *)xml_char, NULL, 0); + xmlFree(xml_char); + xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"size"); + if (NULL != xml_char) { + size = strtoul((const char *)xml_char, NULL, 0); + xmlFree(xml_char); + // second: try to set value (always hex) + attr = xmlSetProp((xmlNode *)cur_node, (const xmlChar *)"value", new_id_hex); + attr = xmlSetProp((xmlNode *)cur_node, (const xmlChar *)"show", new_id_dec); + attr = xmlSetProp((xmlNode *)cur_node, (const xmlChar *)"showname", showname); + //TODO update s1ap->binary_stream @pos with new_id_hex, size + } + } + } + } + if (0 < go_deeper_in_tree) { + update_xpath_node_mme_ue_s1ap_id(s1ap, cur_node->children, new_id_hex, new_id_dec, showname); + } + } +} + +/** + * update_xpath_nodes: + * @nodes: the nodes set. + * @value: the new value for the node(s) + * + * Prints the @nodes content to @output. + * From http://www.xmlsoft.org/examples/#xpath2.c + */ +static void update_xpath_nodes_mme_ue_s1ap_id(et_s1ap_t * const s1ap_payload, xmlNodeSetPtr nodes, const S1ap_MME_UE_S1AP_ID_t new_id) +{ + int size = 0; + int i = 0; + int ret = 0; + const xmlChar value_d[32]; + const xmlChar value_h[20]; + const xmlChar showname[64]; + xmlNode *s1ap_node = NULL; + + size = (nodes) ? nodes->nodeNr : 0; + + ret = snprintf((char *)value_d, 32, "%ld", new_id); + AssertFatal((ret < 0) || (ret > 32), "Could not convert int to dec str"); + ret = snprintf((char *)value_h, 20, "C0%X", new_id); + AssertFatal((ret < 0) || (ret > 20), "Could not convert int to hex str"); + ret = snprintf((char *)showname, 64, "MME-UE-S1AP-ID: %d", new_id); + AssertFatal((ret < 0) || (ret > 64), "Could not convert int to dec str"); + /* + * NOTE: the nodes are processed in reverse order, i.e. reverse document + * order because xmlNodeSetContent can actually free up descendant + * of the node and such nodes may have been selected too ! Handling + * in reverse order ensure that descendant are accessed first, before + * they get removed. Mixing XPath and modifications on a tree must be + * done carefully ! + */ + for(i = size - 1; i >= 0; i--) { + s1ap_node = nodes->nodeTab[i]; + AssertFatal(NULL != s1ap_node, "One element of resultset of XPATH expression is NULL\n"); + update_xpath_node_mme_ue_s1ap_id(s1ap_payload, s1ap_node, value_d, value_h, showname); + /* + * All the elements returned by an XPath query are pointers to + * elements from the tree *except* namespace nodes where the XPath + * semantic is different from the implementation in libxml2 tree. + * As a result when a returned node set is freed when + * xmlXPathFreeObject() is called, that routine must check the + * element type. But node from the returned set may have been removed + * by xmlNodeSetContent() resulting in access to freed data. + * This can be exercised by running valgrind + * There is 2 ways around it: + * - make a copy of the pointers to the nodes from the result set + * then call xmlXPathFreeObject() and then modify the nodes + * or + * - remove the reference to the modified nodes from the node set + * as they are processed, if they are not namespace nodes. + */ + if (nodes->nodeTab[i]->type != XML_NAMESPACE_DECL) { + nodes->nodeTab[i] = NULL; + } + } +} //------------------------------------------------------------------------------ int et_s1ap_update_mme_ue_s1ap_id(et_packet_t * const packet, const S1ap_MME_UE_S1AP_ID_t old_id, const S1ap_MME_UE_S1AP_ID_t new_id) { - S1ap_MME_UE_S1AP_ID_t mme_ue_s1ap_id = 0; - S1AP_PDU_PR present; - ssize_t encoded; - present = packet->sctp_hdr.u.data_hdr.payload.pdu.present; - S1AP_DEBUG("Updating mme_ue_s1ap_id of packet num %d...\n", packet->packet_number); + xmlNode *cur_node = NULL; + xmlChar xpath_expression[ET_XPATH_EXPRESSION_MAX_LENGTH]; + int ret = 0; + xmlDocPtr doc = NULL; + xmlXPathContextPtr xpath_ctx = NULL; + xmlXPathObjectPtr xpath_obj = NULL; - switch (packet->sctp_hdr.u.data_hdr.payload.message.procedureCode) { - case S1ap_ProcedureCode_id_HandoverPreparation: - if (present == S1AP_PDU_PR_initiatingMessage) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequiredIEs.mme_ue_s1ap_id; - if (old_id == mme_ue_s1ap_id) { - packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequiredIEs.mme_ue_s1ap_id = new_id; - // re-encode - S1ap_HandoverRequired_t msg; - S1ap_HandoverRequired_t *msg_p = &msg; - memset((void *)msg_p, 0, sizeof(msg)); + ret = snprintf(xpath_expression, ET_XPATH_EXPRESSION_MAX_LENGTH, "//field[@name=\"s1ap.MME_UE_S1AP_ID\"][@show=\"%d\"]", old_id); + AssertFatal((ret < 0) || (ret > ET_XPATH_EXPRESSION_MAX_LENGTH), "Could not build XPATH expression"); - if (s1ap_encode_s1ap_handoverrequiredies( - msg_p, &packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequiredIEs) < 0) { - AssertFatal(0, "Re-encoding handoverrequiredies failed"); - } + doc = packet->sctp_hdr.u.data_hdr.payload.doc; - ANY_fromType_aper(&packet->sctp_hdr.u.data_hdr.payload.pdu.choice.initiatingMessage.value, - &asn_DEF_S1ap_HandoverRequired, - &packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequiredIEs); - - packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequiredIEs; - encoded = aper_encode_to_new_buffer(&asn_DEF_S1AP_PDU, 0, &packet->sctp_hdr.u.data_hdr.payload.pdu, - (void **)&packet->sctp_hdr.u.data_hdr.payload.binary_stream); - AssertFatal(encoded < 0, "Re-encoding PDU failed"); - } - } else { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverCommandIEs.mme_ue_s1ap_id; - } - break; - - case S1ap_ProcedureCode_id_HandoverResourceAllocation: - if (present == S1AP_PDU_PR_initiatingMessage) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequestIEs.mme_ue_s1ap_id; - } else if (present == S1AP_PDU_PR_successfulOutcome) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequestAcknowledgeIEs.mme_ue_s1ap_id; - } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverFailureIEs.mme_ue_s1ap_id; - } - break; - - case S1ap_ProcedureCode_id_HandoverNotification: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverNotifyIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_PathSwitchRequest: - //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PathSwitchRequestIEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PathSwitchRequestIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_HandoverCancel: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverCancelIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_E_RABSetup: - if (present == S1AP_PDU_PR_initiatingMessage) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABSetupRequestIEs.mme_ue_s1ap_id; - } else { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABSetupResponseIEs.mme_ue_s1ap_id; - } - break; - - case S1ap_ProcedureCode_id_E_RABModify: - if (present == S1AP_PDU_PR_initiatingMessage) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABModifyRequestIEs.mme_ue_s1ap_id; - } else { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABModifyResponseIEs.mme_ue_s1ap_id; - } - break; - - case S1ap_ProcedureCode_id_E_RABRelease: - if (present == S1AP_PDU_PR_initiatingMessage) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseCommandIEs.mme_ue_s1ap_id; - } else { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseResponseIEs.mme_ue_s1ap_id; - } - break; - - case S1ap_ProcedureCode_id_E_RABReleaseIndication: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseIndicationIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_InitialContextSetup: - if (present == S1AP_PDU_PR_initiatingMessage) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialContextSetupRequestIEs.mme_ue_s1ap_id; - } else { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialContextSetupResponseIEs.mme_ue_s1ap_id; - } - break; - - case S1ap_ProcedureCode_id_Paging: - //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PagingIEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PagingIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_downlinkNASTransport: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNASTransportIEs.mme_ue_s1ap_id; - if (old_id == mme_ue_s1ap_id) { - packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNASTransportIEs.mme_ue_s1ap_id = new_id; - // re-encode - S1ap_DownlinkNASTransport_t msg; - S1ap_DownlinkNASTransport_t *msg_p = &msg; - memset((void *)msg_p, 0, sizeof(msg)); - - if (s1ap_encode_s1ap_downlinknastransporties( - msg_p, &packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNASTransportIEs) < 0) { - AssertFatal(0, "Re-encoding downlinknastransporties failed"); - } - - ANY_fromType_aper(&packet->sctp_hdr.u.data_hdr.payload.pdu.choice.initiatingMessage.value, - &asn_DEF_S1ap_DownlinkNASTransport, - &packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNASTransportIEs); - - encoded = aper_encode_to_new_buffer(&asn_DEF_S1AP_PDU, 0, &packet->sctp_hdr.u.data_hdr.payload.pdu, - (void **)&packet->sctp_hdr.u.data_hdr.payload.binary_stream); - AssertFatal(encoded < 0, "Re-encoding PDU failed"); - } - break; - - case S1ap_ProcedureCode_id_initialUEMessage: - //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialUEMessageIEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialUEMessageIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_uplinkNASTransport: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNASTransportIEs.mme_ue_s1ap_id; - if (old_id == mme_ue_s1ap_id) { - packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNASTransportIEs.mme_ue_s1ap_id = new_id; - // re-encode - S1ap_UplinkNASTransport_t msg; - S1ap_UplinkNASTransport_t *msg_p = &msg; - memset((void *)msg_p, 0, sizeof(msg)); - - if (s1ap_encode_s1ap_uplinknastransporties( - msg_p, &packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNASTransportIEs) < 0) { - AssertFatal(0, "Re-encoding uplinknastransporties failed"); - } - - ANY_fromType_aper(&packet->sctp_hdr.u.data_hdr.payload.pdu.choice.initiatingMessage.value, - &asn_DEF_S1ap_DownlinkNASTransport, - &packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNASTransportIEs); - - encoded = aper_encode_to_new_buffer(&asn_DEF_S1AP_PDU, 0, &packet->sctp_hdr.u.data_hdr.payload.pdu, - (void **)&packet->sctp_hdr.u.data_hdr.payload.binary_stream); - AssertFatal(encoded < 0, "Re-encoding PDU failed"); - } - break; - - case S1ap_ProcedureCode_id_Reset: - //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ResetIEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ResetIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_ErrorIndication: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ErrorIndicationIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_NASNonDeliveryIndication: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_NASNonDeliveryIndication_IEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_S1Setup: - /*if (present == S1AP_PDU_PR_initiatingMessage) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupRequestIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupRequestIEs.mme_ue_s1ap_id; - } else if (present == S1AP_PDU_PR_successfulOutcome) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupResponseIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupResponseIEs.mme_ue_s1ap_id; - } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupFailureIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupFailureIEs.mme_ue_s1ap_id; - }*/ - break; - - case S1ap_ProcedureCode_id_UEContextReleaseRequest: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseRequestIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_DownlinkS1cdma2000tunneling: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkS1cdma2000tunnelingIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_UplinkS1cdma2000tunneling: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkS1cdma2000tunnelingIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_UEContextModification: - if (present == S1AP_PDU_PR_initiatingMessage) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationRequestIEs.mme_ue_s1ap_id; - } else if (present == S1AP_PDU_PR_successfulOutcome) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationResponseIEs.mme_ue_s1ap_id; - } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationFailureIEs.mme_ue_s1ap_id; - } - break; - - case S1ap_ProcedureCode_id_UECapabilityInfoIndication: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UECapabilityInfoIndicationIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_UEContextRelease: - if (present == S1AP_PDU_PR_initiatingMessage) { - //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.mme_ue_s1ap_id; - } else { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCompleteIEs.mme_ue_s1ap_id; - } - break; - - case S1ap_ProcedureCode_id_eNBStatusTransfer: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBStatusTransferIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_MMEStatusTransfer: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEStatusTransferIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_DeactivateTrace: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DeactivateTraceIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_TraceStart: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_TraceStartIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_TraceFailureIndication: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_TraceFailureIndicationIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_ENBConfigurationUpdate: - /*if (present == S1AP_PDU_PR_initiatingMessage) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateIEs.mme_ue_s1ap_id; - } else if (present == S1AP_PDU_PR_successfulOutcome) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id; - } else { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateFailureIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateFailureIEs.mme_ue_s1ap_id; - }*/ - break; - - case S1ap_ProcedureCode_id_MMEConfigurationUpdate: - /*if (present == S1AP_PDU_PR_initiatingMessage) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateIEs.mme_ue_s1ap_id; - } else if (present == S1AP_PDU_PR_successfulOutcome) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id; - } else { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateFailureIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateFailureIEs.mme_ue_s1ap_id; - }*/ - break; - - case S1ap_ProcedureCode_id_LocationReportingControl: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportingControlIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_LocationReportingFailureIndication: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportingFailureIndicationIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_LocationReport: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_OverloadStart: - //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStartIEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStartIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_OverloadStop: - //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStopIEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStopIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_WriteReplaceWarning: - /*if (present == S1AP_PDU_PR_initiatingMessage) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningRequestIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningRequestIEs.mme_ue_s1ap_id; - } else { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningResponseIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningResponseIEs.mme_ue_s1ap_id; - }*/ - break; - - case S1ap_ProcedureCode_id_eNBDirectInformationTransfer: - //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBDirectInformationTransferIEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBDirectInformationTransferIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_MMEDirectInformationTransfer: - //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEDirectInformationTransferIEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEDirectInformationTransferIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_PrivateMessage: - case S1ap_ProcedureCode_id_eNBConfigurationTransfer: - case S1ap_ProcedureCode_id_MMEConfigurationTransfer: - AssertFatal(0, "TODO"); - break; - - case S1ap_ProcedureCode_id_CellTrafficTrace: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_CellTrafficTraceIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_Kill: - /*if (present == S1AP_PDU_PR_initiatingMessage) { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillRequestIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillRequestIEs.mme_ue_s1ap_id; - } else { - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillResponseIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillResponseIEs.mme_ue_s1ap_id; - }*/ - break; - - case S1ap_ProcedureCode_id_downlinkUEAssociatedLPPaTransport: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_uplinkUEAssociatedLPPaTransport: - mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_downlinkNonUEAssociatedLPPaTransport: - //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_uplinkNonUEAssociatedLPPaTransport: - //mme_ue_s1ap_id = packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; - break; - - default: - AssertFatal(0, "Unknown procedure code %ld", packet->sctp_hdr.u.data_hdr.payload.message.procedureCode); + // Create xpath evaluation context + xpath_ctx = xmlXPathNewContext(doc); + if(xpath_ctx == NULL) { + fprintf(stderr,"Error: unable to create new XPath context\n"); + xmlFreeDoc(doc); + return(-1); } + + // Evaluate xpath expression + xpath_obj = xmlXPathEvalExpression(xpath_expression, xpath_ctx); + AssertFatal(xpath_obj != NULL, "Unable to evaluate XPATH expression \"%s\"\n", xpath_expression); + + // update selected nodes + update_xpath_nodes_mme_ue_s1ap_id(&packet->sctp_hdr.u.data_hdr.payload, xpath_obj->nodesetval, new_id); + + // Cleanup of XPath data + xmlXPathFreeObject(xpath_obj); + xmlXPathFreeContext(xpath_ctx); + return 0; } From ed26845480fc401e9c994ae958f4e4f515df54ff Mon Sep 17 00:00:00 2001 From: gauthier Date: Thu, 17 Dec 2015 16:22:08 +0100 Subject: [PATCH 026/214] TODO transport layer address, play scenario max speed --- cmake_targets/tools/build_helper | 178 ------------------ openair3/TEST/EPC_TEST/generate_scenario.c | 4 +- openair3/TEST/EPC_TEST/play_scenario.c | 12 +- openair3/TEST/EPC_TEST/play_scenario.h | 4 + openair3/TEST/EPC_TEST/play_scenario_fsm.c | 19 +- openair3/TEST/EPC_TEST/play_scenario_parse.c | 16 +- openair3/TEST/EPC_TEST/play_scenario_s1ap.c | 33 ++-- .../EPC_TEST/play_scenario_s1ap_compare_ie.c | 54 ++++-- openair3/TEST/EPC_TEST/play_scenario_sctp.c | 19 +- 9 files changed, 112 insertions(+), 227 deletions(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 0a0118581e..534c4e0907 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -301,184 +301,6 @@ install_nas_tools() { fi } -################################################# -# 3. Network interfaces utilities -################################################ - -cidr2mask(){ - local i mask="" - local full_octets=$(($1/8)) - local partial_octet=$(($1%8)) - - for ((i=0;i<4;i+=1)); do - if [ $i -lt $full_octets ]; then - mask+=255 - elif [ $i -eq $full_octets ]; then - mask+=$((256 - 2**(8-$partial_octet))) - else - mask+=0 - fi - test $i -lt 3 && mask+=. - done - - echo $mask -} - -# example: netcalc 192.168.12.100 255.255.255.0 -netcalc(){ - local IFS='.' ip i - local -a oct msk - - read -ra oct <<<"$1" - read -ra msk <<<"$2" - - for i in ${!oct[@]}; do - ip+=( "$(( oct[i] & msk[i] ))" ) - done - - echo "${ip[*]}" -} - -# example: -bcastcalc(){ - local IFS='.' ip i - local -a oct msk - - read -ra oct <<<"$1" - read -ra msk <<<"$2" - - for i in ${!oct[@]}; do - ip+=( "$(( oct[i] + ( 255 - ( oct[i] | msk[i] ) ) ))" ) - done - echo "${ip[*]}" -} - - -is_real_interface(){ - my_bool=1 - for var in "$@" - do - if [ "a$var" == "a" ]; then - return 0 - fi - if [ "a$var" == "anone" ]; then - return 0 - fi - IF=`cat /etc/udev/rules.d/70-persistent-net.rules | grep $var | sed 's/^.*NAME=//' | tr -d '"'` - if [ "$IF" == "$var" ]; then - if [ "a${var:0:3}" != "aeth" ]; then - if [ "a${var:0:4}" != "awlan" ]; then - if [ "a${var:0:4}" != "awifi" ]; then - my_bool=0; - fi - fi - fi - fi - done - return $my_bool -} - -is_virtual_interface(){ - my_bool=1 - for var in "$@" - do - if [ "a$var" == "a" ]; then - return 0 - fi - if [ "a$var" == "anone" ]; then - return 0 - fi - num=`expr index "$var" :` - - if [ $num -eq 0 ]; then - my_bool=0; - fi - done - return $my_bool -} - -# arg1 = interface name -# arg2 = ipv4 addr cidr -set_interface_up(){ - interface=$1 - address=${2%/*} #part before '/' - cidr_netmask=${2#*/} # part after '/' - - if [ "a${interface:0:4}" == "anone" ]; then - return; - fi - echo "ifconfig $interface up" - $SUDO ifconfig $interface up - sync - netmask=`cidr2mask $cidr_netmask` - broadcast=`bcastcalc $address $netmask` - echo "ip -4 addr add $address/$cidr_netmask broadcast $broadcast dev $interface" - $SUDO ip -4 addr add $address/$cidr_netmask broadcast $broadcast dev $interface - sync -} - -# arg1 = interface name -# arg2 = ipv4 addr cidr -set_virtual_interface_up(){ - interface=$1 - address=${2%/*} #part before '/' - cidr_netmask=${2#*/} # part after '/' - - if [ "a${interface:0:4}" == "anone" ]; then - return; - fi - $SUDO ifconfig $interface down > /dev/null 2>&1 - sync - echo "ifconfig $interface $address up" - $SUDO ifconfig $interface $address up - sync -} - -#arg1 is interface name -#arg2 is IP address (CIDR) -set_network_interface(){ - local interface_name=$1 - local ip_cidr=$2 - - is_virtual_interface $interface_name - if [ $? -eq 1 ]; then - echo "$interface_name is virtual interface" - set_virtual_interface_up $interface_name $ip_cidr - else - is_real_interface $interface_name - if [ $? -eq 1 ]; then - echo "$interface_name is real interface" - set_interface_up $interface_name $ip_cidr - else - echo_warning "$interface_name not handled, not configuring it" - return - fi - fi -} - -# arg1 is a 'libconfig-like' config file -set_epc_network_interfaces(){ - value="`cat $1 | cut -d "#" -f1 | grep 'ADDRESS\|INTERFACE' | tr -d " " | grep "="`" - eval $value - - # check all var names are correct - list_var_name="\ - ENB_INTERFACE_NAME_FOR_S1_MME ENB_IPV4_ADDRESS_FOR_S1_MME \ - ENB_INTERFACE_NAME_FOR_S1U ENB_IPV4_ADDRESS_FOR_S1U " - for var_name in $list_var_name - do - if [ -n "$${var_name}" ]; then - echo_success "Found ${var_name} = ${!var_name}" - else - echo_fatal "${var_name} does does not exist in your config file $1" - fi - done - - # configure interfaces - set_network_interface $ENB_INTERFACE_NAME_FOR_S1_MME $ENB_IPV4_ADDRESS_FOR_S1_MME - set_network_interface $ENB_INTERFACE_NAME_FOR_S1U $ENB_IPV4_ADDRESS_FOR_S1U -} - ################################ diff --git a/openair3/TEST/EPC_TEST/generate_scenario.c b/openair3/TEST/EPC_TEST/generate_scenario.c index 238ba0ff11..69e707dcf9 100644 --- a/openair3/TEST/EPC_TEST/generate_scenario.c +++ b/openair3/TEST/EPC_TEST/generate_scenario.c @@ -142,7 +142,7 @@ int strip_extension(char *in_filename) if (NULL != in_filename) { /* Check chars starting at end of string to find last '.' */ - for (ssize_t i = strlen(in_filename); i > (name_min_len + max_ext_len); i--) { + for (ssize_t i = strlen(in_filename); i >= name_min_len; i--) { if (in_filename[i] == '.') { in_filename[i] = '\0'; return i; @@ -662,7 +662,7 @@ config_parse_opt_line ( fprintf(stderr, "Error: eNB config file name %s is not found in dir %s\n", enb_config_file_name, g_test_dir); } enb_config_init(enb_config_file_name); - enb_config_display(); + //enb_config_display(); if (NULL == pdml_in_file_name) { fprintf(stderr, "Error: please provide the PDML file name that should be in %s\n", g_test_dir); diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index a801d2cf23..21aca820c2 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -69,6 +69,7 @@ #define GS_IS_DIR 2 //------------------------------------------------------------------------------ Enb_properties_array_t g_enb_properties; +int g_max_speed = 0; //------------------------------------------------------------------------------ extern et_scenario_t *g_scenario; extern int xmlLoadExtDtdDefaultValue; @@ -118,7 +119,7 @@ int et_strip_extension(char *in_filename) if (NULL != in_filename) { /* Check chars starting at end of string to find last '.' */ - for (ssize_t i = strlen(in_filename); i > (name_min_len + max_ext_len); i--) { + for (ssize_t i = strlen(in_filename); i > name_min_len; i--) { if (in_filename[i] == '.') { in_filename[i] = '\0'; return i; @@ -833,6 +834,7 @@ et_config_parse_opt_line ( LONG_OPTION_START = 0x100, /* Start after regular single char options */ LONG_OPTION_ENB_CONF_FILE, LONG_OPTION_SCENARIO_FILE, + LONG_OPTION_MAX_SPEED, LONG_OPTION_TEST_DIR, LONG_OPTION_HELP, LONG_OPTION_VERSION @@ -841,6 +843,7 @@ et_config_parse_opt_line ( static struct option long_options[] = { {"enb-conf-file", required_argument, 0, LONG_OPTION_ENB_CONF_FILE}, {"scenario ", required_argument, 0, LONG_OPTION_SCENARIO_FILE}, + {"max-speed ", no_argument, 0, LONG_OPTION_MAX_SPEED}, {"test-dir", required_argument, 0, LONG_OPTION_TEST_DIR}, {"help", no_argument, 0, LONG_OPTION_HELP}, {"version", no_argument, 0, LONG_OPTION_VERSION}, @@ -850,7 +853,7 @@ et_config_parse_opt_line ( /* * Parsing command line */ - while ((option = getopt_long (argc, argv, "vhc:s:d:", long_options, NULL)) != -1) { + while ((option = getopt_long (argc, argv, "vhmc:s:d:", long_options, NULL)) != -1) { switch (option) { case LONG_OPTION_ENB_CONF_FILE: case 'c': @@ -882,6 +885,11 @@ et_config_parse_opt_line ( } break; + case LONG_OPTION_MAX_SPEED: + case 'm': + g_max_speed = 1; + break; + case LONG_OPTION_VERSION: case 'v': printf("Version %s\n", PACKAGE_VERSION); diff --git a/openair3/TEST/EPC_TEST/play_scenario.h b/openair3/TEST/EPC_TEST/play_scenario.h index 4ac46e84b5..0391ac5c47 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.h +++ b/openair3/TEST/EPC_TEST/play_scenario.h @@ -40,6 +40,7 @@ # include # include # include +# include # include #include "S1AP-PDU.h" @@ -460,6 +461,9 @@ et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node); et_scenario_t* et_generate_scenario(const char * const et_scenario_filename ); //------------------------- asn_comp_rval_t * et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, s1ap_message * const m2, const uint32_t constraints); +void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, const S1ap_MME_UE_S1AP_ID_t new_id); +void update_xpath_nodes_mme_ue_s1ap_id(et_s1ap_t * const s1ap_payload, xmlNodeSetPtr nodes, const S1ap_MME_UE_S1AP_ID_t new_id); +int et_s1ap_update_mme_ue_s1ap_id(et_packet_t * const packet, const S1ap_MME_UE_S1AP_ID_t old_id, const S1ap_MME_UE_S1AP_ID_t new_id); //------------------------- asn_comp_rval_t * et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * const sctp2, const uint32_t constraints); asn_comp_rval_t * et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t * const sctp2, const uint32_t constraints); diff --git a/openair3/TEST/EPC_TEST/play_scenario_fsm.c b/openair3/TEST/EPC_TEST/play_scenario_fsm.c index b76d2240f5..a8f7e7331f 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_fsm.c +++ b/openair3/TEST/EPC_TEST/play_scenario_fsm.c @@ -46,6 +46,8 @@ #include "play_scenario_s1ap_eNB_defs.h" #include "timer.h" +//------------------------------------------------------------------------------ +extern int g_max_speed; //------------------------------------------------------------------------------ et_scenario_t *g_scenario = NULL; pthread_mutex_t g_fsm_lock = PTHREAD_MUTEX_INITIALIZER; @@ -86,13 +88,13 @@ int timeval_subtract (struct timeval * const result, struct timeval * const a, s //------------------------------------------------------------------------------ void et_scenario_wait_rx_packet(et_packet_t * const packet) { + packet->status = ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING; + g_fsm_state = ET_FSM_STATE_WAITING_RX_EVENT; if (timer_setup (ET_FSM_STATE_WAITING_RX_EVENT_DELAY_SEC, 0, TASK_S1AP, INSTANCE_DEFAULT, TIMER_ONE_SHOT, - NULL, &packet->timer_id) < 0) { + packet, &packet->timer_id) < 0) { AssertFatal(0, " Can not start waiting RX event timer\n"); } LOG_D(ENB_APP, "Waiting RX packet num %d\n", packet->packet_number); - g_fsm_state = ET_FSM_STATE_WAITING_RX_EVENT; - packet->status = ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING; } //------------------------------------------------------------------------------ void et_scenario_schedule_tx_packet(et_packet_t * const packet) @@ -133,14 +135,19 @@ void et_scenario_schedule_tx_packet(et_packet_t * const packet) we_are_too_early = timeval_subtract(&offset,&offset_last_rx_packet,&packet->time_relative_to_last_received_packet); LOG_D(ENB_APP, "we_are_too_early=%d, offset=%ld.%06d\n", we_are_too_early, offset.tv_sec, offset.tv_usec); } - if (we_are_too_early > 0) { + if ((0 < we_are_too_early) && (0 == g_max_speed)){ // set timer + if (offset.tv_sec < 0) offset.tv_sec = -offset.tv_sec; + if (offset.tv_usec < 0) { + offset.tv_usec = offset.tv_usec + 1000000; + offset.tv_sec -= 1; + } + LOG_D(ENB_APP, "Send packet num %u original frame number %u in %ld.%06d sec\n", packet->packet_number, packet->original_frame_number, offset.tv_sec, offset.tv_usec); packet->status = ET_PACKET_STATUS_SCHEDULED_FOR_SENDING; - if (timer_setup (offset.tv_sec, offset.tv_usec, TASK_S1AP, INSTANCE_DEFAULT, TIMER_ONE_SHOT, - NULL, &packet->timer_id) < 0) { + if (timer_setup (offset.tv_sec, offset.tv_usec, TASK_S1AP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,packet, &packet->timer_id) < 0) { AssertFatal(0, " Can not start TX event timer\n"); } // Done g_fsm_state = ET_FSM_STATE_WAITING_TX_EVENT; diff --git a/openair3/TEST/EPC_TEST/play_scenario_parse.c b/openair3/TEST/EPC_TEST/play_scenario_parse.c index b9d24f366c..4004dd5074 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_parse.c +++ b/openair3/TEST/EPC_TEST/play_scenario_parse.c @@ -359,7 +359,7 @@ et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node) { afloat = atof((const char*)xml_char); xmlFree(xml_char); packet->time_relative_to_first_packet.tv_sec = (int)afloat; - packet->time_relative_to_first_packet.tv_usec = (int)((afloat - packet->time_relative_to_first_packet.tv_sec)*1000000); + packet->time_relative_to_first_packet.tv_usec = (int)((afloat - packet->time_relative_to_first_packet.tv_sec)*1000000.0); if (first_packet > 0) { initial_time = packet->time_relative_to_first_packet; @@ -381,6 +381,13 @@ et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node) { &packet->time_relative_to_last_sent_packet); relative_last_sent_packet = packet->time_relative_to_first_packet; } + if (first_received_packet > 0) { + packet->time_relative_to_last_received_packet.tv_sec = 0; + packet->time_relative_to_last_received_packet.tv_usec = 0; + } else { + timersub(&packet->time_relative_to_first_packet, &relative_last_received_packet, + &packet->time_relative_to_last_received_packet); + } } else if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { if (first_received_packet > 0) { relative_last_received_packet.tv_sec = packet->time_relative_to_first_packet.tv_sec; @@ -393,6 +400,13 @@ et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node) { &packet->time_relative_to_last_received_packet); relative_last_received_packet = packet->time_relative_to_first_packet; } + if (first_sent_packet > 0) { + packet->time_relative_to_last_sent_packet.tv_sec = 0; + packet->time_relative_to_last_sent_packet.tv_usec = 0; + } else { + timersub(&packet->time_relative_to_first_packet, &relative_last_sent_packet, + &packet->time_relative_to_last_sent_packet); + } } } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"frame.number"))) { diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c index f5afebd786..6a39397f19 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c @@ -682,6 +682,11 @@ int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) packet->timestamp_packet.tv_usec = rx_packet->timestamp_packet.tv_usec; return et_scenario_set_packet_received(packet); } + } else if (strcmp(comp_results->name, "S1ap-TransportLayerAddress") == 0) { + S1AP_WARN("Some work needed there for %s, TODO in generic_scenario.xsl, add epc conf file in the process\n",comp_results->name); + packet->timestamp_packet.tv_sec = rx_packet->timestamp_packet.tv_sec; + packet->timestamp_packet.tv_usec = rx_packet->timestamp_packet.tv_usec; + return et_scenario_set_packet_received(packet); } else { AssertFatal(0,"Some work needed there"); } @@ -1109,18 +1114,22 @@ void *et_s1ap_eNB_task(void *arg) { et_packet_t * packet = (et_packet_t*)TIMER_HAS_EXPIRED (received_msg).arg; et_event_t event; - if (packet->status == ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING) { - memset((void*)&event, 0, sizeof(event)); - event.code = ET_EVENT_RX_PACKET_TIME_OUT; - event.u.rx_packet_time_out = packet; - et_scenario_fsm_notify_event(event); - } else if (packet->status == ET_PACKET_STATUS_SCHEDULED_FOR_SENDING) { - memset((void*)&event, 0, sizeof(event)); - event.code = ET_EVENT_TX_TIMED_PACKET; - event.u.tx_timed_packet = packet; - et_scenario_fsm_notify_event(event); - } else if ((packet->status != ET_PACKET_STATUS_SENT) && ((packet->status != ET_PACKET_STATUS_RECEIVED))) { - AssertFatal (0, "Bad status %d of packet timed out!\n", packet->status); + if (NULL != packet) { + if (packet->status == ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING) { + memset((void*)&event, 0, sizeof(event)); + event.code = ET_EVENT_RX_PACKET_TIME_OUT; + event.u.rx_packet_time_out = packet; + et_scenario_fsm_notify_event(event); + } else if (packet->status == ET_PACKET_STATUS_SCHEDULED_FOR_SENDING) { + memset((void*)&event, 0, sizeof(event)); + event.code = ET_EVENT_TX_TIMED_PACKET; + event.u.tx_timed_packet = packet; + et_scenario_fsm_notify_event(event); + } else if ((packet->status != ET_PACKET_STATUS_SENT) && ((packet->status != ET_PACKET_STATUS_RECEIVED))) { + AssertFatal (0, "Bad status %d of packet timed out!\n", packet->status); + } + } else { + LOG_W(S1AP, " Received TIMER_HAS_EXPIRED: timer_id %d, no packet attached to timer\n", TIMER_HAS_EXPIRED(received_msg).timer_id); } } if (TIMER_HAS_EXPIRED (received_msg).timer_id == g_scenario->enb_register_retry_timer_id) { diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c index 87ffe29e32..31d784b2bd 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c @@ -38,8 +38,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -457,7 +459,7 @@ asn_comp_rval_t * et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_messag } -static void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, xmlChar *new_id_hex, xmlChar *new_id_dec, xmlChar *showname) +void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, const S1ap_MME_UE_S1AP_ID_t new_id) { xmlNode *cur_node = NULL; xmlAttrPtr attr = NULL; @@ -485,19 +487,47 @@ static void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *no xmlFree(xml_char); xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"size"); if (NULL != xml_char) { + const xmlChar value_d[32]; + const xmlChar value_h[20]; + const xmlChar showname[64]; + int ret = 0; + int pos2 = 0; + char val = NULL; + char hex[3] = {0,0,0};; + size = strtoul((const char *)xml_char, NULL, 0); xmlFree(xml_char); // second: try to set value (always hex) - attr = xmlSetProp((xmlNode *)cur_node, (const xmlChar *)"value", new_id_hex); - attr = xmlSetProp((xmlNode *)cur_node, (const xmlChar *)"show", new_id_dec); + ret = snprintf((char *)value_d, 32, "%ld", new_id); + AssertFatal((ret < 0) || (ret > 32), "Could not convert int to dec str"); + ret = snprintf((char *)value_h, 20, "C0%08X", new_id); + AssertFatal((ret < 0) || (ret > 20), "Could not convert int to hex str"); + ret = snprintf((char *)showname, 64, "MME-UE-S1AP-ID: %d", new_id); + AssertFatal((ret < 0) || (ret > 64), "Could not convert int to dec str"); + + attr = xmlSetProp((xmlNode *)cur_node, (const xmlChar *)"value", value_h); + attr = xmlSetProp((xmlNode *)cur_node, (const xmlChar *)"show", value_d); attr = xmlSetProp((xmlNode *)cur_node, (const xmlChar *)"showname", showname); //TODO update s1ap->binary_stream @pos with new_id_hex, size + AssertFatal((pos+size) < s1ap->binary_stream_allocated_size, "Rewrite of mme_ue_s1ap_id out of bounds of binary_stream"); + //avoid endianess issues + do { + hex[0] = value_h[pos2++]; + hex[1] = value_h[pos2++]; + hex[2] = 0; + val = (unsigned char)strtoul(hex, NULL, 16); + AssertFatal(errno != 0, "Conversion of hexstring %s failed", hex); + s1ap->binary_stream[pos++] = val; + } while (pos2 < (2*5)); + // update ASN1 + et_decode_s1ap(s1ap); + S1AP_DEBUG("Updated ASN1 for %s\n", showname); } } } } if (0 < go_deeper_in_tree) { - update_xpath_node_mme_ue_s1ap_id(s1ap, cur_node->children, new_id_hex, new_id_dec, showname); + update_xpath_node_mme_ue_s1ap_id(s1ap, cur_node->children, new_id); } } } @@ -510,24 +540,14 @@ static void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *no * Prints the @nodes content to @output. * From http://www.xmlsoft.org/examples/#xpath2.c */ -static void update_xpath_nodes_mme_ue_s1ap_id(et_s1ap_t * const s1ap_payload, xmlNodeSetPtr nodes, const S1ap_MME_UE_S1AP_ID_t new_id) +void update_xpath_nodes_mme_ue_s1ap_id(et_s1ap_t * const s1ap_payload, xmlNodeSetPtr nodes, const S1ap_MME_UE_S1AP_ID_t new_id) { int size = 0; int i = 0; - int ret = 0; - const xmlChar value_d[32]; - const xmlChar value_h[20]; - const xmlChar showname[64]; xmlNode *s1ap_node = NULL; size = (nodes) ? nodes->nodeNr : 0; - ret = snprintf((char *)value_d, 32, "%ld", new_id); - AssertFatal((ret < 0) || (ret > 32), "Could not convert int to dec str"); - ret = snprintf((char *)value_h, 20, "C0%X", new_id); - AssertFatal((ret < 0) || (ret > 20), "Could not convert int to hex str"); - ret = snprintf((char *)showname, 64, "MME-UE-S1AP-ID: %d", new_id); - AssertFatal((ret < 0) || (ret > 64), "Could not convert int to dec str"); /* * NOTE: the nodes are processed in reverse order, i.e. reverse document * order because xmlNodeSetContent can actually free up descendant @@ -539,7 +559,7 @@ static void update_xpath_nodes_mme_ue_s1ap_id(et_s1ap_t * const s1ap_payload, xm for(i = size - 1; i >= 0; i--) { s1ap_node = nodes->nodeTab[i]; AssertFatal(NULL != s1ap_node, "One element of resultset of XPATH expression is NULL\n"); - update_xpath_node_mme_ue_s1ap_id(s1ap_payload, s1ap_node, value_d, value_h, showname); + update_xpath_node_mme_ue_s1ap_id(s1ap_payload, s1ap_node, new_id); /* * All the elements returned by an XPath query are pointers to * elements from the tree *except* namespace nodes where the XPath @@ -574,7 +594,7 @@ int et_s1ap_update_mme_ue_s1ap_id(et_packet_t * const packet, const S1ap_MME_UE_ xmlXPathObjectPtr xpath_obj = NULL; ret = snprintf(xpath_expression, ET_XPATH_EXPRESSION_MAX_LENGTH, "//field[@name=\"s1ap.MME_UE_S1AP_ID\"][@show=\"%d\"]", old_id); - AssertFatal((ret < 0) || (ret > ET_XPATH_EXPRESSION_MAX_LENGTH), "Could not build XPATH expression"); + AssertFatal((ret > 0) && (ret < ET_XPATH_EXPRESSION_MAX_LENGTH), "Could not build XPATH expression err=%d", ret); doc = packet->sctp_hdr.u.data_hdr.payload.doc; diff --git a/openair3/TEST/EPC_TEST/play_scenario_sctp.c b/openair3/TEST/EPC_TEST/play_scenario_sctp.c index 181009c2c9..5d5489089b 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_sctp.c +++ b/openair3/TEST/EPC_TEST/play_scenario_sctp.c @@ -69,15 +69,16 @@ asn_comp_rval_t * et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_da S1AP_WARN("No Matching SCTP stream %u %u\n", sctp1->stream, sctp2->stream); } } - if (sctp1->ssn != sctp2->ssn) { - if (constraints & ET_BIT_MASK_MATCH_SCTP_SSN) { - rv = calloc(1, sizeof(asn_comp_rval_t)); - rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_SSN; - return rv; - } else { - S1AP_WARN("No Matching SCTP STREAM SN %u %u\n", sctp1->ssn, sctp2->ssn); - } - } + // We do not have SSN from lower layers +// if (sctp1->ssn != sctp2->ssn) { +// if (constraints & ET_BIT_MASK_MATCH_SCTP_SSN) { +// rv = calloc(1, sizeof(asn_comp_rval_t)); +// rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_SSN; +// return rv; +// } else { +// S1AP_WARN("No Matching SCTP STREAM SN %u %u\n", sctp1->ssn, sctp2->ssn); +// } +// } return et_s1ap_is_matching(&sctp1->payload, &sctp2->payload, constraints); } From 64df39d1bf706a1206fe8239defb9217589d8a6b Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 18 Dec 2015 21:11:45 +0100 Subject: [PATCH 027/214] Sync --- openair3/TEST/EPC_TEST/play_scenario.c | 277 +++++++++++++++++- openair3/TEST/EPC_TEST/play_scenario.h | 18 +- openair3/TEST/EPC_TEST/play_scenario_fsm.c | 58 ++-- openair3/TEST/EPC_TEST/play_scenario_parse.c | 52 +++- openair3/TEST/EPC_TEST/play_scenario_s1ap.c | 2 - .../EPC_TEST/play_scenario_s1ap_compare_ie.c | 1 - 6 files changed, 346 insertions(+), 62 deletions(-) diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index 21aca820c2..d85faf4c2c 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -130,6 +130,54 @@ int et_strip_extension(char *in_filename) } //------------------------------------------------------------------------------ // return number of splitted items +void et_get_shift_arg( char * line_argument, shift_packet_t * const shift) +{ + int len = strlen(line_argument); + int i = 0; + int j = 0; + int num_milli = 0; + char my_num[64]; + int negative = 0; + + + while ((line_argument[i] != ':') && (i < len)) { + my_num[i] = line_argument[i]; + i += 1; + } + my_num[i++] = '\0'; + shift->frame_number = atoi(my_num); + AssertFatal(ishift_seconds = atoi(my_num); + // may omit .mmm, accept .m or .mm or .mmm or ... + while ((i < len) && (num_milli++ < 3)){ + my_num[j++] = line_argument[i++]; + } + while (num_milli++ < 6){ + my_num[j++] = '0'; + } + my_num[j] = '\0'; + shift->shift_microseconds = atoi(my_num); + if (negative == 1) { + shift->shift_seconds = - shift->shift_seconds; + shift->shift_microseconds = - shift->shift_microseconds; + } +} +//------------------------------------------------------------------------------ +// return number of splitted items int split_path( char * pathP, char *** resP) { char * saveptr1; @@ -764,9 +812,168 @@ void *et_eNB_app_task(void *args_p) } //------------------------------------------------------------------------------ -int et_play_scenario(et_scenario_t* const scenario) +int et_play_scenario(et_scenario_t* const scenario, const struct shift_packet_s *shifts) { - et_event_t event; + et_event_t event; + struct shift_packet_s *shift = shifts; + et_packet_t *packet = NULL; + et_packet_t *next_packet = NULL; + struct timeval shift_all_packets = { .tv_sec = 0, .tv_usec = 0 }; + struct timeval relative_last_sent_packet = { .tv_sec = 0, .tv_usec = 0 }; + struct timeval relative_last_received_packet = { .tv_sec = 0, .tv_usec = 0 }; + struct timeval initial_time = { .tv_sec = 0, .tv_usec = 0 }; + char first_packet = 1; + char first_sent_packet = 1; + char first_received_packet = 1; + + // first apply timing shifts if requested + while (shift) { + packet = scenario->list_packet; + while (packet) { + fprintf(stdout, "*shift: %p\n", shift); + fprintf(stdout, "\tframe_number: %p\n", shift->frame_number); + fprintf(stdout, "\tshift_seconds: %ld\n", shift->shift_seconds); + fprintf(stdout, "\tshift_microseconds: %ld\n", shift->shift_microseconds); + fprintf(stdout, "\tsingle: %d\n\n", shift->single); + fprintf(stdout, "\tshift_all_packets_seconds: %ld\n", shift_all_packets.tv_sec); + fprintf(stdout, "\tshift_all_packets_microseconds: %ld\n", shift_all_packets.tv_usec); + + AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0), + "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u", + packet->time_relative_to_first_packet.tv_sec, + packet->time_relative_to_first_packet.tv_usec, + packet->packet_number, + packet->original_frame_number); + AssertFatal((packet->time_relative_to_last_received_packet.tv_sec >= 0) && (packet->time_relative_to_last_received_packet.tv_usec >= 0), + "Bad timing result time_relative_to_last_received_packet=%d.%d packet num %u, original frame number %u", + packet->time_relative_to_last_received_packet.tv_sec, + packet->time_relative_to_last_received_packet.tv_usec, + packet->packet_number, + packet->original_frame_number); + AssertFatal((packet->time_relative_to_last_sent_packet.tv_sec >= 0) && (packet->time_relative_to_last_sent_packet.tv_usec >= 0), + "Bad timing result time_relative_to_last_sent_packet=%d.%d packet num %u, original frame number %u", + packet->time_relative_to_last_sent_packet.tv_sec, + packet->time_relative_to_last_sent_packet.tv_usec, + packet->packet_number, + packet->original_frame_number); + fprintf(stdout, "\tpacket num %u, original frame number %u time_relative_to_first_packet=%d.%d\n", + packet->packet_number, + packet->original_frame_number, + packet->time_relative_to_first_packet.tv_sec, + packet->time_relative_to_first_packet.tv_usec); + fprintf(stdout, "\tpacket num %u, original frame number %u time_relative_to_last_received_packet=%d.%d\n", + packet->packet_number, + packet->original_frame_number, + packet->time_relative_to_last_received_packet.tv_sec, + packet->time_relative_to_last_received_packet.tv_usec); + fprintf(stdout, "\tpacket num %u, original frame number %u time_relative_to_last_sent_packet=%d.%d\n", + packet->packet_number, + packet->original_frame_number, + packet->time_relative_to_last_sent_packet.tv_sec, + packet->time_relative_to_last_sent_packet.tv_usec); + + if ((shift->single) && (shift->frame_number == packet->original_frame_number)) { + struct timeval t_offset = { .tv_sec = shift->shift_seconds, .tv_usec = shift->shift_microseconds }; + et_packet_shift_timing(packet, &t_offset); + next_packet = packet->next; + if (next_packet) { + t_offset.tv_sec = -t_offset.tv_sec; + t_offset.tv_usec = -t_offset.tv_usec; + + if (packet->action == ET_PACKET_ACTION_S1C_SEND) { + timeval_add(&next_packet->time_relative_to_last_sent_packet, &next_packet->time_relative_to_last_sent_packet, &t_offset); + } else if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { + timeval_add(&next_packet->time_relative_to_last_received_packet, &next_packet->time_relative_to_last_received_packet, &t_offset); + } + } + } + if ((0 == shift->single) && (shift->frame_number == packet->original_frame_number)) { + shift_all_packets.tv_sec = shift->shift_seconds; + shift_all_packets.tv_usec = shift->shift_microseconds; + timeval_add(&packet->time_relative_to_first_packet, &packet->time_relative_to_first_packet, &shift_all_packets); + fprintf(stdout, "\tpacket num %u, now original frame number %u time_relative_to_first_packet=%d.%d\n", + packet->packet_number, + packet->original_frame_number, + packet->time_relative_to_first_packet.tv_sec, + packet->time_relative_to_first_packet.tv_usec); + AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0), + "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u", + packet->time_relative_to_first_packet.tv_sec, + packet->time_relative_to_first_packet.tv_usec, + packet->packet_number, + packet->original_frame_number); + } else if ((0 == shift->single) && (shift->frame_number < packet->original_frame_number)) { + timeval_add(&packet->time_relative_to_first_packet, &packet->time_relative_to_first_packet, &shift_all_packets); + fprintf(stdout, "\tpacket num %u, now original frame number %u time_relative_to_first_packet=%d.%d\n", + packet->packet_number, + packet->original_frame_number, + packet->time_relative_to_first_packet.tv_sec, + packet->time_relative_to_first_packet.tv_usec); + AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0), + "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u", + packet->time_relative_to_first_packet.tv_sec, + packet->time_relative_to_first_packet.tv_usec, + packet->packet_number, + packet->original_frame_number); + } + packet = packet->next; + } + shift = shift->next; + } + // now recompute time_relative_to_last_received_packet, time_relative_to_last_sent_packet + if (shifts) { + packet = scenario->list_packet; + while (packet) { + if (first_packet > 0) { + initial_time = packet->time_relative_to_first_packet; + packet->time_relative_to_first_packet.tv_sec = 0; + packet->time_relative_to_first_packet.tv_usec = 0; + first_packet = 0; + } else { + timersub(&packet->time_relative_to_first_packet, &initial_time, + &packet->time_relative_to_first_packet); + } + if (packet->action == ET_PACKET_ACTION_S1C_SEND) { + if (first_sent_packet > 0) { + relative_last_sent_packet = packet->time_relative_to_first_packet; + packet->time_relative_to_last_sent_packet.tv_sec = 0; + packet->time_relative_to_last_sent_packet.tv_usec = 0; + first_sent_packet = 0; + } else { + timersub(&packet->time_relative_to_first_packet, &relative_last_sent_packet, + &packet->time_relative_to_last_sent_packet); + relative_last_sent_packet = packet->time_relative_to_first_packet; + } + if (first_received_packet > 0) { + packet->time_relative_to_last_received_packet.tv_sec = 0; + packet->time_relative_to_last_received_packet.tv_usec = 0; + } else { + timersub(&packet->time_relative_to_first_packet, &relative_last_received_packet, + &packet->time_relative_to_last_received_packet); + } + } else if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { + if (first_received_packet > 0) { + relative_last_received_packet.tv_sec = packet->time_relative_to_first_packet.tv_sec; + relative_last_received_packet.tv_usec = packet->time_relative_to_first_packet.tv_usec; + packet->time_relative_to_last_received_packet.tv_sec = 0; + packet->time_relative_to_last_received_packet.tv_usec = 0; + first_received_packet = 0; + } else { + timersub(&packet->time_relative_to_first_packet, &relative_last_received_packet, + &packet->time_relative_to_last_received_packet); + relative_last_received_packet = packet->time_relative_to_first_packet; + } + if (first_sent_packet > 0) { + packet->time_relative_to_last_sent_packet.tv_sec = 0; + packet->time_relative_to_last_sent_packet.tv_usec = 0; + } else { + timersub(&packet->time_relative_to_first_packet, &relative_last_sent_packet, + &packet->time_relative_to_last_sent_packet); + } + } + packet = packet->next; + } + } et_display_scenario(scenario); // create SCTP ITTI task: same as eNB code @@ -804,16 +1011,16 @@ static void et_usage ( fprintf (stdout, "Please report any bug to: %s\n",PACKAGE_BUGREPORT); fprintf (stdout, "Usage: %s [options]\n\n", argv[0]); fprintf (stdout, "\n"); - //fprintf (stdout, "Client options:\n"); - //fprintf (stdout, "\t-S | --server File name (with no path) of a test scenario that has to be replayed (TODO in future?)\n"); - //fprintf (stdout, "Server options:\n"); - fprintf (stdout, "\t-d | --test-dir Directory where a set of files related to a particular test are located\n"); - fprintf (stdout, "\t-c | --enb-conf-file Provide an eNB config file, valid for the testbed\n"); - fprintf (stdout, "\t-s | --scenario File name (with no path) of a test scenario that has to be replayed ()\n"); + fprintf (stdout, "\t-d | --test-dir Directory where a set of files related to a particular test are located\n"); + fprintf (stdout, "\t-c | --enb-conf-file Provide an eNB config file, valid for the testbed\n"); + fprintf (stdout, "\t-f | --shift-packet Shift the timing of a packet'\n"); + fprintf (stdout, "\t-F | --shift-packets Shift the timing of packets starting at frame 'frame' included\n"); + fprintf (stdout, "\t-m | --max-speed Play scenario as fast as possible without respecting frame timings\n"); + fprintf (stdout, "\t-s | --scenario File name (with no path) of a test scenario that has to be replayed ()\n"); fprintf (stdout, "\n"); fprintf (stdout, "Other options:\n"); - fprintf (stdout, "\t-h | --help Print this help and return\n"); - fprintf (stdout, "\t-v | --version Print informations about the version of this executable\n"); + fprintf (stdout, "\t-h | --help Print this help and return\n"); + fprintf (stdout, "\t-v | --version Print informations about the version of this executable\n"); fprintf (stdout, "\n"); } @@ -824,11 +1031,13 @@ et_config_parse_opt_line ( char *argv[], char **et_dir_name, char **scenario_file_name, - char **enb_config_file_name) + char **enb_config_file_name, + shift_packet_t **shifts) //------------------------------------------------------------------------------ { - int option; - int rv = 0; + int option = 0; + int rv = 0; + shift_packet_t *shift = NULL; enum long_option_e { LONG_OPTION_START = 0x100, /* Start after regular single char options */ @@ -836,6 +1045,8 @@ et_config_parse_opt_line ( LONG_OPTION_SCENARIO_FILE, LONG_OPTION_MAX_SPEED, LONG_OPTION_TEST_DIR, + LONG_OPTION_SHIFT_PACKET, + LONG_OPTION_SHIFT_PACKETS, LONG_OPTION_HELP, LONG_OPTION_VERSION }; @@ -845,6 +1056,8 @@ et_config_parse_opt_line ( {"scenario ", required_argument, 0, LONG_OPTION_SCENARIO_FILE}, {"max-speed ", no_argument, 0, LONG_OPTION_MAX_SPEED}, {"test-dir", required_argument, 0, LONG_OPTION_TEST_DIR}, + {"shift-packet", required_argument, 0, LONG_OPTION_SHIFT_PACKET}, + {"shift-packets", required_argument, 0, LONG_OPTION_SHIFT_PACKETS}, {"help", no_argument, 0, LONG_OPTION_HELP}, {"version", no_argument, 0, LONG_OPTION_VERSION}, {NULL, 0, NULL, 0} @@ -853,7 +1066,7 @@ et_config_parse_opt_line ( /* * Parsing command line */ - while ((option = getopt_long (argc, argv, "vhmc:s:d:", long_options, NULL)) != -1) { + while ((option = getopt_long (argc, argv, "vhmc:s:d:f:F", long_options, NULL)) != -1) { switch (option) { case LONG_OPTION_ENB_CONF_FILE: case 'c': @@ -885,6 +1098,37 @@ et_config_parse_opt_line ( } break; + case LONG_OPTION_SHIFT_PACKET: + case 'f': + if (optarg) { + if (NULL == *shifts) { + shift = calloc(1, sizeof (*shift)); + *shifts = shift; + } else { + shift->next = calloc(1, sizeof (*shift)); + shift = shift->next; + } + shift->single = 1; + et_get_shift_arg(optarg, shift); + printf("Arg Shift packet %s\n", optarg); + } + break; + + case LONG_OPTION_SHIFT_PACKETS: + case 'F': + if (optarg) { + if (NULL == *shifts) { + shift = calloc(1, sizeof (*shift)); + *shifts = shift; + } else { + shift->next = calloc(1, sizeof (*shift)); + shift = shift->next; + } + et_get_shift_arg(optarg, shift); + printf("Arg Shift packets %s\n", optarg); + } + break; + case LONG_OPTION_MAX_SPEED: case 'm': g_max_speed = 1; @@ -938,6 +1182,7 @@ int main( int argc, char **argv ) char *et_dir_name = NULL; char *scenario_file_name = NULL; char *enb_config_file_name = NULL; + struct shift_packet_s *shifts = NULL; int ret = 0; et_scenario_t *scenario = NULL; char play_scenario_filename[NAME_MAX]; @@ -957,11 +1202,11 @@ int main( int argc, char **argv ) asn1_xer_print = 1; //parameters - actions = et_config_parse_opt_line (argc, argv, &et_dir_name, &scenario_file_name, &enb_config_file_name); //Command-line options + actions = et_config_parse_opt_line (argc, argv, &et_dir_name, &scenario_file_name, &enb_config_file_name, &shifts); //Command-line options if (actions & PLAY_SCENARIO) { if (et_generate_xml_scenario(et_dir_name, scenario_file_name,enb_config_file_name, play_scenario_filename) == 0) { if (NULL != (scenario = et_generate_scenario(play_scenario_filename))) { - ret = et_play_scenario(scenario); + ret = et_play_scenario(scenario, shifts); } else { fprintf(stderr, "ERROR: Could not generate scenario from tsml file\n"); ret = -1; diff --git a/openair3/TEST/EPC_TEST/play_scenario.h b/openair3/TEST/EPC_TEST/play_scenario.h index 0391ac5c47..ca569e5141 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.h +++ b/openair3/TEST/EPC_TEST/play_scenario.h @@ -89,6 +89,15 @@ #define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U" +typedef struct shift_packet_s { + unsigned int frame_number; + int shift_seconds; + int shift_microseconds; + int single; // only this packet + struct shift_packet_s *next; +} shift_packet_t; + + typedef struct mme_ip_address_s { unsigned ipv4:1; unsigned ipv6:1; @@ -445,6 +454,10 @@ int et_generate_xml_scenario( const char const * enb_config_filename, char const * tsml_out_scenario_filename); //------------------------- +void timeval_add (struct timeval * const result, const struct timeval * const a, const struct timeval * const b); +int timeval_subtract (struct timeval * const result, struct timeval * const a, struct timeval * const b); +void et_scenario_wait_rx_packet(et_packet_t * const packet); +void et_scenario_schedule_tx_packet(et_packet_t * const packet); et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event); et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_tx(et_event_t event); et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_rx(et_event_t event); @@ -458,7 +471,7 @@ void et_parse_sctp_init_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sct void et_parse_sctp_init_ack_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_initackhdr_t * const sctp_hdr); void et_parse_sctp(xmlDocPtr doc, const xmlNode const *sctp_node, et_sctp_hdr_t * const sctp_hdr); et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node); -et_scenario_t* et_generate_scenario(const char * const et_scenario_filename ); +et_scenario_t* et_generate_scenario(const char * const et_scenario_filename); //------------------------- asn_comp_rval_t * et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, s1ap_message * const m2, const uint32_t constraints); void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, const S1ap_MME_UE_S1AP_ID_t new_id); @@ -471,6 +484,7 @@ asn_comp_rval_t * et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t void et_print_hex_octets(const unsigned char * const byte_stream, const unsigned long int num); int et_is_file_exists ( const char const * file_nameP, const char const *file_roleP); int et_strip_extension( char *in_filename); +void et_get_shift_arg( char * line_argument, shift_packet_t * const shift); int et_split_path ( char * pathP, char *** resP); void et_display_node ( xmlNodePtr node, unsigned int indent); void et_display_tree ( xmlNodePtr node, unsigned int indent); @@ -486,6 +500,6 @@ void et_enb_config_init(const char const * lib_config_file_name_pP); const Enb_properties_array_t *et_enb_config_get(void); void et_eNB_app_register(const Enb_properties_array_t *enb_properties); void *et_eNB_app_task(void *args_p); -int et_play_scenario(et_scenario_t* const scenario); +int et_play_scenario(et_scenario_t* const scenario, const struct shift_packet_s *shifts); #endif /* PLAY_SCENARIO_H_ */ diff --git a/openair3/TEST/EPC_TEST/play_scenario_fsm.c b/openair3/TEST/EPC_TEST/play_scenario_fsm.c index a8f7e7331f..dece907dee 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_fsm.c +++ b/openair3/TEST/EPC_TEST/play_scenario_fsm.c @@ -54,36 +54,35 @@ pthread_mutex_t g_fsm_lock = PTHREAD_MUTEX_INITIALIZER; et_fsm_state_t g_fsm_state = ET_FSM_STATE_NULL; uint32_t g_constraints = ET_BIT_MASK_MATCH_SCTP_STREAM | ET_BIT_MASK_MATCH_SCTP_SSN; //------------------------------------------------------------------------------ -int timeval_subtract (struct timeval * const result, struct timeval * const a, struct timeval * const b) +// it is assumed that if a time is negative tv_sec and tv_usec are both negative +void timeval_add (struct timeval * const result, const struct timeval * const a, const struct timeval * const b) { - struct timeval b2; - int nsec = 0; - b2.tv_sec = b->tv_sec; - b2.tv_usec = b->tv_usec; - - - /* Perform the carry for the later subtraction by updating y. */ - if (a->tv_usec < b2.tv_usec) { - nsec = (b2.tv_usec - a->tv_usec) / 1000000 + 1; - b2.tv_usec -= 1000000 * nsec; - b2.tv_sec += nsec; + AssertFatal(((a->tv_sec <= 0) && (a->tv_usec <= 0)) || ((a->tv_sec >= 0) && (a->tv_usec >= 0)), " Bad time format arg a\n"); + AssertFatal(((b->tv_sec <= 0) && (b->tv_usec <= 0)) || ((b->tv_sec >= 0) && (b->tv_usec >= 0)), " Bad time format arg b\n"); + // may happen overflows but were are not dealing with very large timings + long long int r = a->tv_usec + b->tv_usec + (a->tv_sec + b->tv_sec) * 1000000; + result->tv_sec = r / (long long int)1000000; + result->tv_usec = r % (long long int)1000000; + if ((result != a) && (result != b)) { + LOG_D(ENB_APP, "timeval_add(%ld.%06d, %ld.%06d)=%ld.%06d\n", a->tv_sec, a->tv_usec, b->tv_sec, b->tv_usec, result->tv_sec, result->tv_usec); } - if (a->tv_usec - b2.tv_usec > 1000000) { - nsec = (a->tv_usec - b2.tv_usec) / 1000000; - b2.tv_usec += 1000000 * nsec; - b2.tv_sec -= nsec; - } - - /* Compute the time remaining to wait. - tv_usec is certainly positive. */ - result->tv_sec = a->tv_sec - b2.tv_sec; - result->tv_usec = a->tv_usec - b2.tv_usec; - - LOG_D(ENB_APP, "timeval_subtract(%ld.%06d, %ld.%06d)=%ld.%06d\n", a->tv_sec, a->tv_usec, b->tv_sec, b->tv_usec, result->tv_sec, result->tv_usec); - - return a->tv_sec < b2.tv_sec; } +//------------------------------------------------------------------------------ +// it is assumed that if a time is negative tv_sec and tv_usec are both negative +int timeval_subtract (struct timeval * const result, struct timeval * const a, struct timeval * const b) +{ + AssertFatal(((a->tv_sec <= 0) && (a->tv_usec <= 0)) || ((a->tv_sec >= 0) && (a->tv_usec >= 0)), " Bad time format arg a\n"); + AssertFatal(((b->tv_sec <= 0) && (b->tv_usec <= 0)) || ((b->tv_sec >= 0) && (b->tv_usec >= 0)), " Bad time format arg b\n"); + // may happen overflows but were are not dealing with very large timings + long long int r = a->tv_usec - b->tv_usec + (a->tv_sec - b->tv_sec) * 1000000; + result->tv_sec = r / (long long int)1000000; + result->tv_usec = r % (long long int)1000000; + if ((result != a) && (result != b)) { + LOG_D(ENB_APP, "timeval_subtract(%ld.%06d, %ld.%06d)=%ld.%06d\n", a->tv_sec, a->tv_usec, b->tv_sec, b->tv_usec, result->tv_sec, result->tv_usec); + } + return result->tv_sec < 0; +} //------------------------------------------------------------------------------ void et_scenario_wait_rx_packet(et_packet_t * const packet) @@ -137,10 +136,9 @@ void et_scenario_schedule_tx_packet(et_packet_t * const packet) } if ((0 < we_are_too_early) && (0 == g_max_speed)){ // set timer - if (offset.tv_sec < 0) offset.tv_sec = -offset.tv_sec; - if (offset.tv_usec < 0) { - offset.tv_usec = offset.tv_usec + 1000000; - offset.tv_sec -= 1; + if (offset.tv_sec < 0) { + offset.tv_sec = -offset.tv_sec; + offset.tv_usec = -offset.tv_usec; } LOG_D(ENB_APP, "Send packet num %u original frame number %u in %ld.%06d sec\n", diff --git a/openair3/TEST/EPC_TEST/play_scenario_parse.c b/openair3/TEST/EPC_TEST/play_scenario_parse.c index 4004dd5074..11dac34f0a 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_parse.c +++ b/openair3/TEST/EPC_TEST/play_scenario_parse.c @@ -62,7 +62,7 @@ extern Enb_properties_array_t g_enb_properties; //------------------------------------------------------------------------------ void et_parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, et_s1ap_t * const s1ap) { - xmlNode *cur_node = NULL; + xmlNodePtr cur_node = NULL; xmlChar *xml_char = NULL; xmlChar *xml_char2 = NULL; unsigned int size = 0; @@ -329,9 +329,38 @@ void et_parse_sctp(xmlDocPtr doc, const xmlNode const *sctp_node, et_sctp_hdr_t } } //------------------------------------------------------------------------------ -et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node) { +void et_packet_shift_timing(et_packet_t * const packet, const struct timeval * const shift) +{ + timeval_add(&packet->time_relative_to_first_packet, &packet->time_relative_to_first_packet, shift); + AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0), + "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u", + packet->time_relative_to_first_packet.tv_sec, + packet->time_relative_to_first_packet.tv_usec, + packet->packet_number, + packet->original_frame_number); - et_packet_t *packet = NULL; + timeval_add(&packet->time_relative_to_last_received_packet, &packet->time_relative_to_last_received_packet, shift); + AssertFatal((packet->time_relative_to_last_received_packet.tv_sec >= 0) && (packet->time_relative_to_last_received_packet.tv_usec >= 0), + "Bad timing result time_relative_to_last_received_packet=%d.%d packet num %u, original frame number %u", + packet->time_relative_to_last_received_packet.tv_sec, + packet->time_relative_to_last_received_packet.tv_usec, + packet->packet_number, + packet->original_frame_number); + + timeval_add(&packet->time_relative_to_last_sent_packet, &packet->time_relative_to_last_sent_packet, shift); + AssertFatal((packet->time_relative_to_last_sent_packet.tv_sec >= 0) && (packet->time_relative_to_last_sent_packet.tv_usec >= 0), + "Bad timing result time_relative_to_last_sent_packet=%d.%d packet num %u, original frame number %u", + packet->time_relative_to_last_sent_packet.tv_sec, + packet->time_relative_to_last_sent_packet.tv_usec, + packet->packet_number, + packet->original_frame_number); +} + +//------------------------------------------------------------------------------ +et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node) +{ + + et_packet_t *packet = NULL; xmlNode *cur_node = NULL; xmlChar *xml_char = NULL; float afloat = (float)0.0; @@ -343,6 +372,7 @@ et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node) { static char first_received_packet = 1; static unsigned int packet_number = 1; + if (NULL != node) { packet = calloc(1, sizeof(*packet)); @@ -441,15 +471,15 @@ et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node) { } //------------------------------------------------------------------------------ et_scenario_t* et_generate_scenario( - const char * const tsml_out_scenario_filename ) + const char * const tsml_out_scenario_filename) { - xmlDocPtr doc = NULL; - xmlNodePtr root = NULL; - xmlNodePtr node = NULL; - xmlChar *xml_char = NULL; - et_scenario_t *scenario = NULL; - et_packet_t *packet = NULL; - et_packet_t **next_packet = NULL; + xmlDocPtr doc = NULL; + xmlNodePtr root = NULL; + xmlNodePtr node = NULL; + xmlChar *xml_char = NULL; + et_scenario_t *scenario = NULL; + et_packet_t *packet = NULL; + et_packet_t **next_packet = NULL; doc = xmlParseFile(tsml_out_scenario_filename); if (NULL == doc) { diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c index 6a39397f19..285b883ded 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c @@ -68,7 +68,6 @@ int et_s1ap_eNB_compare_assoc_id( if (p1->cnx_id < p2->cnx_id) { return -1; } - if (p1->cnx_id > p2->cnx_id) { return 1; } @@ -76,7 +75,6 @@ int et_s1ap_eNB_compare_assoc_id( if (p1->assoc_id < p2->assoc_id) { return -1; } - if (p1->assoc_id > p2->assoc_id) { return 1; } diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c index 31d784b2bd..32b571f823 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c @@ -586,7 +586,6 @@ int et_s1ap_update_mme_ue_s1ap_id(et_packet_t * const packet, const S1ap_MME_UE_ { - xmlNode *cur_node = NULL; xmlChar xpath_expression[ET_XPATH_EXPRESSION_MAX_LENGTH]; int ret = 0; xmlDocPtr doc = NULL; From ea7c5d5e6d694dc119010753c61aa449319cd116 Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 22 Dec 2015 16:18:51 +0100 Subject: [PATCH 028/214] Ok, replay scenario, to be tested with more scenarios --- openair3/TEST/EPC_TEST/play_scenario.c | 64 +++++----- openair3/TEST/EPC_TEST/play_scenario.h | 9 +- openair3/TEST/EPC_TEST/play_scenario_fsm.c | 100 ++++++++++------ openair3/TEST/EPC_TEST/play_scenario_parse.c | 110 ++++++++---------- openair3/TEST/EPC_TEST/play_scenario_s1ap.c | 28 ++++- .../EPC_TEST/play_scenario_s1ap_compare_ie.c | 13 ++- 6 files changed, 184 insertions(+), 140 deletions(-) diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index d85faf4c2c..e7cb8ef848 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -830,13 +830,13 @@ int et_play_scenario(et_scenario_t* const scenario, const struct shift_packet_s while (shift) { packet = scenario->list_packet; while (packet) { - fprintf(stdout, "*shift: %p\n", shift); - fprintf(stdout, "\tframe_number: %p\n", shift->frame_number); - fprintf(stdout, "\tshift_seconds: %ld\n", shift->shift_seconds); - fprintf(stdout, "\tshift_microseconds: %ld\n", shift->shift_microseconds); - fprintf(stdout, "\tsingle: %d\n\n", shift->single); - fprintf(stdout, "\tshift_all_packets_seconds: %ld\n", shift_all_packets.tv_sec); - fprintf(stdout, "\tshift_all_packets_microseconds: %ld\n", shift_all_packets.tv_usec); +// fprintf(stdout, "*shift: %p\n", shift); +// fprintf(stdout, "\tframe_number: %p\n", shift->frame_number); +// fprintf(stdout, "\tshift_seconds: %ld\n", shift->shift_seconds); +// fprintf(stdout, "\tshift_microseconds: %ld\n", shift->shift_microseconds); +// fprintf(stdout, "\tsingle: %d\n\n", shift->single); +// fprintf(stdout, "\tshift_all_packets_seconds: %ld\n", shift_all_packets.tv_sec); +// fprintf(stdout, "\tshift_all_packets_microseconds: %ld\n", shift_all_packets.tv_usec); AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0), "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u", @@ -856,21 +856,21 @@ int et_play_scenario(et_scenario_t* const scenario, const struct shift_packet_s packet->time_relative_to_last_sent_packet.tv_usec, packet->packet_number, packet->original_frame_number); - fprintf(stdout, "\tpacket num %u, original frame number %u time_relative_to_first_packet=%d.%d\n", - packet->packet_number, - packet->original_frame_number, - packet->time_relative_to_first_packet.tv_sec, - packet->time_relative_to_first_packet.tv_usec); - fprintf(stdout, "\tpacket num %u, original frame number %u time_relative_to_last_received_packet=%d.%d\n", - packet->packet_number, - packet->original_frame_number, - packet->time_relative_to_last_received_packet.tv_sec, - packet->time_relative_to_last_received_packet.tv_usec); - fprintf(stdout, "\tpacket num %u, original frame number %u time_relative_to_last_sent_packet=%d.%d\n", - packet->packet_number, - packet->original_frame_number, - packet->time_relative_to_last_sent_packet.tv_sec, - packet->time_relative_to_last_sent_packet.tv_usec); +// fprintf(stdout, "\tpacket num %u, original frame number %u time_relative_to_first_packet=%d.%d\n", +// packet->packet_number, +// packet->original_frame_number, +// packet->time_relative_to_first_packet.tv_sec, +// packet->time_relative_to_first_packet.tv_usec); +// fprintf(stdout, "\tpacket num %u, original frame number %u time_relative_to_last_received_packet=%d.%d\n", +// packet->packet_number, +// packet->original_frame_number, +// packet->time_relative_to_last_received_packet.tv_sec, +// packet->time_relative_to_last_received_packet.tv_usec); +// fprintf(stdout, "\tpacket num %u, original frame number %u time_relative_to_last_sent_packet=%d.%d\n", +// packet->packet_number, +// packet->original_frame_number, +// packet->time_relative_to_last_sent_packet.tv_sec, +// packet->time_relative_to_last_sent_packet.tv_usec); if ((shift->single) && (shift->frame_number == packet->original_frame_number)) { struct timeval t_offset = { .tv_sec = shift->shift_seconds, .tv_usec = shift->shift_microseconds }; @@ -891,11 +891,11 @@ int et_play_scenario(et_scenario_t* const scenario, const struct shift_packet_s shift_all_packets.tv_sec = shift->shift_seconds; shift_all_packets.tv_usec = shift->shift_microseconds; timeval_add(&packet->time_relative_to_first_packet, &packet->time_relative_to_first_packet, &shift_all_packets); - fprintf(stdout, "\tpacket num %u, now original frame number %u time_relative_to_first_packet=%d.%d\n", - packet->packet_number, - packet->original_frame_number, - packet->time_relative_to_first_packet.tv_sec, - packet->time_relative_to_first_packet.tv_usec); +// fprintf(stdout, "\tpacket num %u, now original frame number %u time_relative_to_first_packet=%d.%d\n", +// packet->packet_number, +// packet->original_frame_number, +// packet->time_relative_to_first_packet.tv_sec, +// packet->time_relative_to_first_packet.tv_usec); AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0), "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u", packet->time_relative_to_first_packet.tv_sec, @@ -904,11 +904,11 @@ int et_play_scenario(et_scenario_t* const scenario, const struct shift_packet_s packet->original_frame_number); } else if ((0 == shift->single) && (shift->frame_number < packet->original_frame_number)) { timeval_add(&packet->time_relative_to_first_packet, &packet->time_relative_to_first_packet, &shift_all_packets); - fprintf(stdout, "\tpacket num %u, now original frame number %u time_relative_to_first_packet=%d.%d\n", - packet->packet_number, - packet->original_frame_number, - packet->time_relative_to_first_packet.tv_sec, - packet->time_relative_to_first_packet.tv_usec); +// fprintf(stdout, "\tpacket num %u, now original frame number %u time_relative_to_first_packet=%d.%d\n", +// packet->packet_number, +// packet->original_frame_number, +// packet->time_relative_to_first_packet.tv_sec, +// packet->time_relative_to_first_packet.tv_usec); AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0), "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u", packet->time_relative_to_first_packet.tv_sec, diff --git a/openair3/TEST/EPC_TEST/play_scenario.h b/openair3/TEST/EPC_TEST/play_scenario.h index ca569e5141..c1458047bd 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.h +++ b/openair3/TEST/EPC_TEST/play_scenario.h @@ -90,10 +90,10 @@ typedef struct shift_packet_s { - unsigned int frame_number; + unsigned int frame_number; // original frame number int shift_seconds; int shift_microseconds; - int single; // only this packet + int single; // shift timing only for this packet (not also following packets) struct shift_packet_s *next; } shift_packet_t; @@ -261,6 +261,7 @@ typedef enum { typedef struct et_s1ap_s { //et_s1ap_pdu_type_t pdu_type; S1AP_PDU_t pdu; // decoded ASN1 C type: choice of initiatingMessage, successfulOutcome, unsuccessfulOutcome + uint16_t xml_stream_pos_offset; uint16_t binary_stream_pos; uint16_t binary_stream_allocated_size; uint8_t *binary_stream; @@ -366,6 +367,8 @@ typedef struct et_scenario_s { et_packet_t *last_rx_packet; // Last packet received with all previous scenario RX packet received. et_packet_t *last_tx_packet; // Last sent packet et_packet_t *next_packet; // Next packet to be handled in the scenario (RX or TX packet) + + int timer_count; } et_scenario_t; @@ -457,7 +460,7 @@ int et_generate_xml_scenario( void timeval_add (struct timeval * const result, const struct timeval * const a, const struct timeval * const b); int timeval_subtract (struct timeval * const result, struct timeval * const a, struct timeval * const b); void et_scenario_wait_rx_packet(et_packet_t * const packet); -void et_scenario_schedule_tx_packet(et_packet_t * const packet); +void et_scenario_schedule_tx_packet(et_packet_t * packet); et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event); et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_tx(et_event_t event); et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_rx(et_event_t event); diff --git a/openair3/TEST/EPC_TEST/play_scenario_fsm.c b/openair3/TEST/EPC_TEST/play_scenario_fsm.c index dece907dee..5dee83afc9 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_fsm.c +++ b/openair3/TEST/EPC_TEST/play_scenario_fsm.c @@ -70,6 +70,7 @@ void timeval_add (struct timeval * const result, const struct timeval * const a, //------------------------------------------------------------------------------ // it is assumed that if a time is negative tv_sec and tv_usec are both negative +// return true if result is positive int timeval_subtract (struct timeval * const result, struct timeval * const a, struct timeval * const b) { AssertFatal(((a->tv_sec <= 0) && (a->tv_usec <= 0)) || ((a->tv_sec >= 0) && (a->tv_usec >= 0)), " Bad time format arg a\n"); @@ -81,7 +82,7 @@ int timeval_subtract (struct timeval * const result, struct timeval * const a, s if ((result != a) && (result != b)) { LOG_D(ENB_APP, "timeval_subtract(%ld.%06d, %ld.%06d)=%ld.%06d\n", a->tv_sec, a->tv_usec, b->tv_sec, b->tv_usec, result->tv_sec, result->tv_usec); } - return result->tv_sec < 0; + return (result->tv_sec >= 0) && (result->tv_usec >= 0); } //------------------------------------------------------------------------------ @@ -93,10 +94,11 @@ void et_scenario_wait_rx_packet(et_packet_t * const packet) packet, &packet->timer_id) < 0) { AssertFatal(0, " Can not start waiting RX event timer\n"); } - LOG_D(ENB_APP, "Waiting RX packet num %d\n", packet->packet_number); + g_scenario->timer_count++; + LOG_D(ENB_APP, "Waiting RX packet num %d original frame number %u\n", packet->packet_number, packet->original_frame_number); } //------------------------------------------------------------------------------ -void et_scenario_schedule_tx_packet(et_packet_t * const packet) +void et_scenario_schedule_tx_packet(et_packet_t * packet) { s1ap_eNB_instance_t *s1ap_eNB_instance = NULL; struct timeval now = { .tv_sec = 0, .tv_usec = 0 }; @@ -104,8 +106,9 @@ void et_scenario_schedule_tx_packet(et_packet_t * const packet) struct timeval offset_last_rx_packet = { .tv_sec = 0, .tv_usec = 0 }; struct timeval offset_tx_rx = { .tv_sec = 0, .tv_usec = 0 }; struct timeval offset = { .tv_sec = 0, .tv_usec = 0 }; - int last_packet_was_tx = 0; - int we_are_too_early = 0; + int last_packet_was_rx = 0; + int we_are_too_late = 0; + int original_frame_number = -1; AssertFatal(NULL != packet, "packet argument is NULL"); s1ap_eNB_instance = et_s1ap_eNB_get_instance(packet->enb_instance); @@ -124,19 +127,19 @@ void et_scenario_schedule_tx_packet(et_packet_t * const packet) LOG_D(ENB_APP, "offset_last_tx_packet=%ld.%06d\n", offset_last_tx_packet.tv_sec, offset_last_tx_packet.tv_usec); LOG_D(ENB_APP, "offset_last_rx_packet=%ld.%06d\n", offset_last_rx_packet.tv_sec, offset_last_rx_packet.tv_usec); - last_packet_was_tx = timeval_subtract(&offset_tx_rx,&offset_last_tx_packet,&offset_last_rx_packet); - if (last_packet_was_tx) { - LOG_D(ENB_APP, "last_packet_was_tx\n"); - we_are_too_early = timeval_subtract(&offset,&offset_last_tx_packet,&packet->time_relative_to_last_sent_packet); - LOG_D(ENB_APP, "we_are_too_early=%d, offset=%ld.%06d\n", we_are_too_early, offset.tv_sec, offset.tv_usec); - } else { + last_packet_was_rx = timeval_subtract(&offset_tx_rx,&offset_last_tx_packet,&offset_last_rx_packet); + if (last_packet_was_rx) { LOG_D(ENB_APP, "last_packet_was_rx\n"); - we_are_too_early = timeval_subtract(&offset,&offset_last_rx_packet,&packet->time_relative_to_last_received_packet); - LOG_D(ENB_APP, "we_are_too_early=%d, offset=%ld.%06d\n", we_are_too_early, offset.tv_sec, offset.tv_usec); + we_are_too_late = timeval_subtract(&offset,&offset_last_rx_packet,&packet->time_relative_to_last_received_packet); + LOG_D(ENB_APP, "we_are_too_late=%d, offset=%ld.%06d\n", we_are_too_late, offset.tv_sec, offset.tv_usec); + } else { + LOG_D(ENB_APP, "last_packet_was_tx\n"); + we_are_too_late = timeval_subtract(&offset,&offset_last_tx_packet,&packet->time_relative_to_last_sent_packet); + LOG_D(ENB_APP, "we_are_too_early=%d, offset=%ld.%06d\n", we_are_too_late, offset.tv_sec, offset.tv_usec); } - if ((0 < we_are_too_early) && (0 == g_max_speed)){ + if ((0 == we_are_too_late) && (0 == g_max_speed)){ // set timer - if (offset.tv_sec < 0) { + if ((offset.tv_sec <= 0) || (offset.tv_usec <= 0)){ offset.tv_sec = -offset.tv_sec; offset.tv_usec = -offset.tv_usec; } @@ -148,23 +151,27 @@ void et_scenario_schedule_tx_packet(et_packet_t * const packet) if (timer_setup (offset.tv_sec, offset.tv_usec, TASK_S1AP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,packet, &packet->timer_id) < 0) { AssertFatal(0, " Can not start TX event timer\n"); } + g_scenario->timer_count++; // Done g_fsm_state = ET_FSM_STATE_WAITING_TX_EVENT; } else { - LOG_D(ENB_APP, "Send packet num %u original frame number %u immediately\n", packet->packet_number, packet->original_frame_number); // send immediately AssertFatal(0 == gettimeofday(&packet->timestamp_packet, NULL), "gettimeofday() Failed"); + original_frame_number = packet->original_frame_number; + do { + g_scenario->time_last_tx_packet.tv_sec = packet->timestamp_packet.tv_sec; + g_scenario->time_last_tx_packet.tv_usec = packet->timestamp_packet.tv_usec; - g_scenario->time_last_tx_packet.tv_sec = packet->timestamp_packet.tv_sec; - g_scenario->time_last_tx_packet.tv_usec = packet->timestamp_packet.tv_usec; - - et_s1ap_eNB_itti_send_sctp_data_req( + LOG_D(ENB_APP, "Sending packet num %d original frame number %u immediately\n",packet->packet_number, packet->original_frame_number); + et_s1ap_eNB_itti_send_sctp_data_req( packet->enb_instance, packet->sctp_hdr.u.data_hdr.assoc_id, packet->sctp_hdr.u.data_hdr.payload.binary_stream, packet->sctp_hdr.u.data_hdr.payload.binary_stream_allocated_size, packet->sctp_hdr.u.data_hdr.stream); - packet->status = ET_PACKET_STATUS_SENT; - g_scenario->next_packet = g_scenario->next_packet->next; + packet->status = ET_PACKET_STATUS_SENT; + g_scenario->next_packet = g_scenario->next_packet->next; + packet = packet->next; + } while ((NULL != packet) && (packet->original_frame_number == original_frame_number)); g_fsm_state = ET_FSM_STATE_RUNNING; } break; @@ -183,7 +190,7 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event) switch (event.code){ case ET_EVENT_TICK: while (NULL != g_scenario->next_packet) { - LOG_D(ENB_APP, "EVENT_TICK: Considering packet num %d:\n", g_scenario->next_packet->packet_number); + LOG_D(ENB_APP, "EVENT_TICK: Considering packet num %d original frame number %u\n", g_scenario->next_packet->packet_number, g_scenario->next_packet->original_frame_number); switch (g_scenario->next_packet->sctp_hdr.chunk_type) { case SCTP_CID_DATA : // no init in this scenario, may be sub-scenario @@ -251,6 +258,13 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event) fprintf(stderr, "No Packet found in this scenario: %s\n", g_scenario->name); g_fsm_state = ET_FSM_STATE_NULL; pthread_mutex_unlock(&g_fsm_lock); + if (0 == g_scenario->timer_count) { + fprintf(stderr, "End of scenario: %s\n", g_scenario->name); + fflush(stderr); + fflush(stdout); + exit(0); + } + fprintf(stderr, "Remaining timers running: %d\n", g_scenario->timer_count); return g_fsm_state; break; case ET_EVENT_RX_PACKET_TIME_OUT: @@ -272,7 +286,10 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event) //------------------------------------------------------------------------------ et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_tx(et_event_t event) { - int rv = 0; + int rv = 0; + int original_frame_number = -1; + et_packet_t *packet = NULL; + switch (event.code){ case ET_EVENT_TICK: fprintf(stdout, "EVENT_TICK: waiting for tx event\n"); @@ -284,19 +301,25 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_tx(et_event_t event) case ET_EVENT_TX_TIMED_PACKET: // send immediately - AssertFatal(0 == gettimeofday(&event.u.tx_timed_packet->timestamp_packet, NULL), "gettimeofday() Failed"); + packet = event.u.tx_timed_packet; + AssertFatal(0 == gettimeofday(&packet->timestamp_packet, NULL), "gettimeofday() Failed"); - g_scenario->time_last_tx_packet.tv_sec = event.u.tx_timed_packet->timestamp_packet.tv_sec; - g_scenario->time_last_tx_packet.tv_usec = event.u.tx_timed_packet->timestamp_packet.tv_usec; + original_frame_number = packet->original_frame_number; + do { + g_scenario->time_last_tx_packet.tv_sec = packet->timestamp_packet.tv_sec; + g_scenario->time_last_tx_packet.tv_usec = packet->timestamp_packet.tv_usec; - et_s1ap_eNB_itti_send_sctp_data_req( - event.u.tx_timed_packet->enb_instance, - event.u.tx_timed_packet->sctp_hdr.u.data_hdr.assoc_id, - event.u.tx_timed_packet->sctp_hdr.u.data_hdr.payload.binary_stream, - event.u.tx_timed_packet->sctp_hdr.u.data_hdr.payload.binary_stream_allocated_size, - event.u.tx_timed_packet->sctp_hdr.u.data_hdr.stream); - event.u.tx_timed_packet->status = ET_PACKET_STATUS_SENT; - g_scenario->next_packet = event.u.tx_timed_packet->next; + LOG_D(ENB_APP, "Sending packet num %d original frame number %u immediately\n",packet->packet_number, packet->original_frame_number); + et_s1ap_eNB_itti_send_sctp_data_req( + packet->enb_instance, + packet->sctp_hdr.u.data_hdr.assoc_id, + packet->sctp_hdr.u.data_hdr.payload.binary_stream, + packet->sctp_hdr.u.data_hdr.payload.binary_stream_allocated_size, + packet->sctp_hdr.u.data_hdr.stream); + packet->status = ET_PACKET_STATUS_SENT; + packet = packet->next; + g_scenario->next_packet = packet; + } while ( (NULL != packet) && (packet->original_frame_number == original_frame_number)); g_fsm_state = ET_FSM_STATE_RUNNING; break; @@ -411,6 +434,13 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_connecting_s1c(et_event_t even fprintf(stderr, "No Packet found in this scenario: %s\n", g_scenario->name); g_fsm_state = ET_FSM_STATE_NULL; pthread_mutex_unlock(&g_fsm_lock); + if (0 == g_scenario->timer_count) { + fprintf(stderr, "End of scenario: %s\n", g_scenario->name); + fflush(stderr); + fflush(stdout); + exit(0); + } + fprintf(stderr, "Remaining timers running: %d\n", g_scenario->timer_count); return g_fsm_state; break; diff --git a/openair3/TEST/EPC_TEST/play_scenario_parse.c b/openair3/TEST/EPC_TEST/play_scenario_parse.c index 11dac34f0a..aedc021f73 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_parse.c +++ b/openair3/TEST/EPC_TEST/play_scenario_parse.c @@ -71,10 +71,15 @@ void et_parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, et_s1ap_t * co if ((NULL != s1ap_node) && (NULL != s1ap)) { // see http://www.xmlsoft.org/html/libxml-tree.html#xmlCopyNode - cur_node = xmlCopyNode(s1ap_node, 1); - AssertFatal(NULL != cur_node, "xmlCopyNode Failed"); - s1ap->doc = xmlNewDoc(BAD_CAST "1.0"); - xmlDocSetRootElement(s1ap->doc, cur_node); + if (NULL == s1ap->doc) { + xmlUnlinkNode(s1ap_node); + //cur_node = xmlCopyNodeList(s1ap_node); + // arg2: if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) + //cur_node = xmlCopyNode(s1ap_node, 1); + //AssertFatal(NULL != cur_node, "xmlCopyNode Failed"); + s1ap->doc = xmlNewDoc(BAD_CAST "1.0"); + xmlDocSetRootElement(s1ap->doc, s1ap_node); + } for (cur_node = (xmlNode *)s1ap_node; cur_node; cur_node = cur_node->next) { go_deeper_in_tree = 1; @@ -97,17 +102,17 @@ void et_parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, et_s1ap_t * co xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); if (NULL != xml_char) { xml_char2 = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"name"); - fprintf(stdout, "s1ap %p field %s size %d value %s\n",s1ap, xml_char2, size, xml_char); + fprintf(stdout, "s1ap %p field name %s size %d value %s\n",s1ap, xml_char2, size, xml_char); xmlFree(xml_char2); // if success to get value, do not parse children //AssertFatal ((xmlStrlen(xml_char) == size), "ERROR %s() mismatch in size %d and strlen %d\n", __FUNCTION__, size, xmlStrlen(xml_char)); //if (xmlStrlen(xml_char) == size) { AssertFatal ((s1ap->binary_stream_pos+xmlStrlen(xml_char)/2) <= s1ap->binary_stream_allocated_size, - "ERROR %s() in buffer size: binary_stream_pos %d xmlStrlen(xml_char)/2=%d\n", __FUNCTION__, s1ap->binary_stream_pos, xmlStrlen(xml_char)/2); + "ERROR in buffer size: binary_stream_pos %d xmlStrlen(xml_char)/2=%d\n", s1ap->binary_stream_pos, xmlStrlen(xml_char)/2); rc = et_hex2data( &s1ap->binary_stream[s1ap->binary_stream_pos], xml_char, xmlStrlen(xml_char)); s1ap->binary_stream_pos += xmlStrlen(xml_char)/2; - et_display_node(cur_node, 0); - AssertFatal (rc >= 0, "ERROR %s() in converting hex string %s len %d size %d rc %d\n", __FUNCTION__, xml_char, xmlStrlen(xml_char), size, rc); + //et_display_node(cur_node, 0); + AssertFatal (rc >= 0, "ERROR in converting hex string %s len %d size %d rc %d\n", xml_char, xmlStrlen(xml_char), size, rc); go_deeper_in_tree = 0; //} xmlFree(xml_char); @@ -274,15 +279,23 @@ void et_parse_sctp(xmlDocPtr doc, const xmlNode const *sctp_node, et_sctp_hdr_t if (NULL != xml_char) { if ((!xmlStrcmp(xml_char, (const xmlChar *)"s1ap"))) { xmlFree(xml_char); - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"size"); - if (NULL != xml_char2) { - sctp_hdr->u.data_hdr.payload.binary_stream_allocated_size = strtoul((const char *)xml_char2, NULL, 0); - sctp_hdr->u.data_hdr.payload.binary_stream = calloc(1, sctp_hdr->u.data_hdr.payload.binary_stream_allocated_size); - xmlFree(xml_char2); + xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"pos"); + if (NULL != xml_char) { + sctp_hdr->u.data_hdr.payload.xml_stream_pos_offset = strtoul((const char *)xml_char, NULL, 0); + xmlFree(xml_char); + + xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"size"); + if (NULL != xml_char2) { + sctp_hdr->u.data_hdr.payload.binary_stream_allocated_size = strtoul((const char *)xml_char2, NULL, 0); + sctp_hdr->u.data_hdr.payload.binary_stream = calloc(1, sctp_hdr->u.data_hdr.payload.binary_stream_allocated_size); + sctp_hdr->u.data_hdr.payload.binary_stream_pos = 0; + fprintf(stdout, "Allocating payload of sctp_hdr %p %u bytes\n", sctp_hdr, sctp_hdr->u.data_hdr.payload.binary_stream_allocated_size); + xmlFree(xml_char2); + } + et_parse_s1ap(doc, sctp_node, &sctp_hdr->u.data_hdr.payload); + et_decode_s1ap(&sctp_hdr->u.data_hdr.payload); + return; } - et_parse_s1ap(doc, sctp_node, &sctp_hdr->u.data_hdr.payload); - et_decode_s1ap(&sctp_hdr->u.data_hdr.payload); - return; } xmlFree(xml_char); } @@ -388,6 +401,7 @@ et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node) xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); afloat = atof((const char*)xml_char); xmlFree(xml_char); + fprintf(stdout, "Parsing packet frame.time_relative: %f\n", afloat); packet->time_relative_to_first_packet.tv_sec = (int)afloat; packet->time_relative_to_first_packet.tv_usec = (int)((afloat - packet->time_relative_to_first_packet.tv_sec)*1000000.0); @@ -400,48 +414,10 @@ et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node) timersub(&packet->time_relative_to_first_packet, &initial_time, &packet->time_relative_to_first_packet); } - if (packet->action == ET_PACKET_ACTION_S1C_SEND) { - if (first_sent_packet > 0) { - relative_last_sent_packet = packet->time_relative_to_first_packet; - packet->time_relative_to_last_sent_packet.tv_sec = 0; - packet->time_relative_to_last_sent_packet.tv_usec = 0; - first_sent_packet = 0; - } else { - timersub(&packet->time_relative_to_first_packet, &relative_last_sent_packet, - &packet->time_relative_to_last_sent_packet); - relative_last_sent_packet = packet->time_relative_to_first_packet; - } - if (first_received_packet > 0) { - packet->time_relative_to_last_received_packet.tv_sec = 0; - packet->time_relative_to_last_received_packet.tv_usec = 0; - } else { - timersub(&packet->time_relative_to_first_packet, &relative_last_received_packet, - &packet->time_relative_to_last_received_packet); - } - } else if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { - if (first_received_packet > 0) { - relative_last_received_packet.tv_sec = packet->time_relative_to_first_packet.tv_sec; - relative_last_received_packet.tv_usec = packet->time_relative_to_first_packet.tv_usec; - packet->time_relative_to_last_received_packet.tv_sec = 0; - packet->time_relative_to_last_received_packet.tv_usec = 0; - first_received_packet = 0; - } else { - timersub(&packet->time_relative_to_first_packet, &relative_last_received_packet, - &packet->time_relative_to_last_received_packet); - relative_last_received_packet = packet->time_relative_to_first_packet; - } - if (first_sent_packet > 0) { - packet->time_relative_to_last_sent_packet.tv_sec = 0; - packet->time_relative_to_last_sent_packet.tv_usec = 0; - } else { - timersub(&packet->time_relative_to_first_packet, &relative_last_sent_packet, - &packet->time_relative_to_last_sent_packet); - } - } - } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"frame.number"))) { xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); packet->original_frame_number = strtoul((const char *)xml_char, NULL, 0); + fprintf(stdout, "Parsing packet frame.number: %u\n", packet->original_frame_number); xmlFree(xml_char); } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"ip.src"))) { xml_char = xmlNodeListGetString(doc, cur_node->xmlChildrenNode, 1); @@ -473,13 +449,14 @@ et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node) et_scenario_t* et_generate_scenario( const char * const tsml_out_scenario_filename) { - xmlDocPtr doc = NULL; - xmlNodePtr root = NULL; - xmlNodePtr node = NULL; - xmlChar *xml_char = NULL; - et_scenario_t *scenario = NULL; - et_packet_t *packet = NULL; - et_packet_t **next_packet = NULL; + xmlDocPtr doc = NULL; + xmlNodePtr root = NULL; + xmlNodePtr node = NULL; + xmlChar *xml_char = NULL; + et_scenario_t *scenario = NULL; + et_packet_t *last_packet = NULL; + et_packet_t *packet = NULL; + et_packet_t **next_packet = NULL; doc = xmlParseFile(tsml_out_scenario_filename); if (NULL == doc) { @@ -503,6 +480,14 @@ et_scenario_t* et_generate_scenario( if ((!xmlStrcmp(node->name, (const xmlChar *)"packet"))) { packet = et_parse_xml_packet(doc, node); if (NULL != packet) { + // special case: S1AP same frame for 2 packets + if (NULL != last_packet) { + if (last_packet->original_frame_number == packet->original_frame_number) { + // updating because these informations are not in 2nd sctp header (same IP packet) + packet->sctp_hdr.dst_port = last_packet->sctp_hdr.dst_port; + packet->sctp_hdr.src_port = last_packet->sctp_hdr.src_port; + } + } *next_packet = packet; next_packet = &packet->next; } else { @@ -510,6 +495,7 @@ et_scenario_t* et_generate_scenario( et_display_node(node, 0); } } + last_packet = packet; } } } else { diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c index 285b883ded..5d5a3672d3 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c @@ -362,8 +362,16 @@ int et_handle_s1ap_mismatch_mme_ue_s1ap_id(et_packet_t * const spacket, et_packe case S1ap_ProcedureCode_id_UEContextRelease: if (present == S1AP_PDU_PR_initiatingMessage) { - //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.mme_ue_s1ap_id; + switch (rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.uE_S1AP_IDs.present) { + case S1ap_UE_S1AP_IDs_PR_uE_S1AP_ID_pair: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.uE_S1AP_IDs.choice.uE_S1AP_ID_pair.mME_UE_S1AP_ID; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.uE_S1AP_IDs.choice.uE_S1AP_ID_pair.mME_UE_S1AP_ID; + break; + case S1ap_UE_S1AP_IDs_PR_mME_UE_S1AP_ID: + rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.uE_S1AP_IDs.choice.mME_UE_S1AP_ID; + scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.uE_S1AP_IDs.choice.mME_UE_S1AP_ID; + break; + } } else { rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCompleteIEs.mme_ue_s1ap_id; scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCompleteIEs.mme_ue_s1ap_id; @@ -511,6 +519,7 @@ int et_handle_s1ap_mismatch_mme_ue_s1ap_id(et_packet_t * const spacket, et_packe AssertFatal(0, "Unknown procedure code %ld", rx_packet->sctp_hdr.u.data_hdr.payload.message.procedureCode); } if (scenario_mme_ue_s1ap_id != rx_mme_ue_s1ap_id) { + S1AP_DEBUG("%s() Updating mme_ue_s1ap_id %u -> %u \n", __FUNCTION__, scenario_mme_ue_s1ap_id, rx_mme_ue_s1ap_id); et_packet_t * p = spacket; while (p) { et_s1ap_update_mme_ue_s1ap_id(p, scenario_mme_ue_s1ap_id, rx_mme_ue_s1ap_id); @@ -615,6 +624,7 @@ int et_scenario_set_packet_received(et_packet_t * const packet) if (0 != packet->timer_id) { rc = timer_remove(packet->timer_id); AssertFatal(rc == 0, "TODO: Debug Timer on Rx packet num %d unknown", packet->packet_number); + g_scenario->timer_count--; return rc; } return 1; @@ -656,7 +666,8 @@ int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) packet = g_scenario->last_rx_packet->next; } // not_found threshold may sure depend on number of mme, may be not sure on number of UE - while ((NULL != packet) && (not_found < 5)) { + while ((NULL != packet) && (not_found < 7)) { + S1AP_DEBUG("%s() Considering packet num %d original frame number %u\n", __FUNCTION__, packet->packet_number, packet->original_frame_number); if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { comp_results = et_sctp_is_matching(&packet->sctp_hdr, &rx_packet->sctp_hdr, g_constraints); if (NULL == comp_results) { @@ -681,11 +692,15 @@ int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) return et_scenario_set_packet_received(packet); } } else if (strcmp(comp_results->name, "S1ap-TransportLayerAddress") == 0) { - S1AP_WARN("Some work needed there for %s, TODO in generic_scenario.xsl, add epc conf file in the process\n",comp_results->name); + S1AP_WARN("Some work needed there for %s, TODO in generic_scenario.xsl, add epc conf file in the process, anyway continuing...\n",comp_results->name); packet->timestamp_packet.tv_sec = rx_packet->timestamp_packet.tv_sec; packet->timestamp_packet.tv_usec = rx_packet->timestamp_packet.tv_usec; return et_scenario_set_packet_received(packet); } else { + S1AP_WARN("\n\nRX PACKET:\n"); + et_display_packet_sctp(&rx_packet->sctp_hdr); + S1AP_WARN("\n\nWAITED PACKET:\n"); + et_display_packet_sctp(&packet->sctp_hdr); AssertFatal(0,"Some work needed there"); } } @@ -1112,6 +1127,7 @@ void *et_s1ap_eNB_task(void *arg) { et_packet_t * packet = (et_packet_t*)TIMER_HAS_EXPIRED (received_msg).arg; et_event_t event; + g_scenario->timer_count--; if (NULL != packet) { if (packet->status == ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING) { memset((void*)&event, 0, sizeof(event)); @@ -1123,6 +1139,10 @@ void *et_s1ap_eNB_task(void *arg) event.code = ET_EVENT_TX_TIMED_PACKET; event.u.tx_timed_packet = packet; et_scenario_fsm_notify_event(event); + + et_event_t continue_event; + continue_event.code = ET_EVENT_TICK; + et_scenario_fsm_notify_event(continue_event); } else if ((packet->status != ET_PACKET_STATUS_SENT) && ((packet->status != ET_PACKET_STATUS_RECEIVED))) { AssertFatal (0, "Bad status %d of packet timed out!\n", packet->status); } diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c index 32b571f823..ad720ab7dc 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c @@ -467,6 +467,8 @@ void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, con int size = 0; int pos = 0; int go_deeper_in_tree = 1; + S1AP_DEBUG("%s() mme_ue_s1ap_id %u\n", __FUNCTION__, new_id); + // modify for (cur_node = (xmlNode *)node; cur_node; cur_node = cur_node->next) { go_deeper_in_tree = 1; @@ -484,6 +486,8 @@ void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, con xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"pos"); if (NULL != xml_char) { pos = strtoul((const char *)xml_char, NULL, 0); + pos -= s1ap->xml_stream_pos_offset; + AssertFatal(pos >= 0, "Bad pos %d xml_stream_pos_offset %d", pos, s1ap->xml_stream_pos_offset); xmlFree(xml_char); xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"size"); if (NULL != xml_char) { @@ -499,11 +503,11 @@ void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, con xmlFree(xml_char); // second: try to set value (always hex) ret = snprintf((char *)value_d, 32, "%ld", new_id); - AssertFatal((ret < 0) || (ret > 32), "Could not convert int to dec str"); + AssertFatal((ret > 0) && (ret < 32), "Could not convert int to dec str"); ret = snprintf((char *)value_h, 20, "C0%08X", new_id); - AssertFatal((ret < 0) || (ret > 20), "Could not convert int to hex str"); + AssertFatal((ret > 0) && (ret < 20), "Could not convert int to hex str"); ret = snprintf((char *)showname, 64, "MME-UE-S1AP-ID: %d", new_id); - AssertFatal((ret < 0) || (ret > 64), "Could not convert int to dec str"); + AssertFatal((ret > 0) && (ret < 64), "Could not convert int to dec str"); attr = xmlSetProp((xmlNode *)cur_node, (const xmlChar *)"value", value_h); attr = xmlSetProp((xmlNode *)cur_node, (const xmlChar *)"show", value_d); @@ -592,11 +596,12 @@ int et_s1ap_update_mme_ue_s1ap_id(et_packet_t * const packet, const S1ap_MME_UE_ xmlXPathContextPtr xpath_ctx = NULL; xmlXPathObjectPtr xpath_obj = NULL; + S1AP_DEBUG("%s() packet num %u original frame number %u, mme_ue_s1ap_id %u -> %u\n", __FUNCTION__, packet->packet_number, packet->original_frame_number, old_id, new_id); + ret = snprintf(xpath_expression, ET_XPATH_EXPRESSION_MAX_LENGTH, "//field[@name=\"s1ap.MME_UE_S1AP_ID\"][@show=\"%d\"]", old_id); AssertFatal((ret > 0) && (ret < ET_XPATH_EXPRESSION_MAX_LENGTH), "Could not build XPATH expression err=%d", ret); doc = packet->sctp_hdr.u.data_hdr.payload.doc; - // Create xpath evaluation context xpath_ctx = xmlXPathNewContext(doc); if(xpath_ctx == NULL) { From 27b1707ed118ea83f8c733458a763552d5c85606 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 1 Jan 2016 05:51:09 -0800 Subject: [PATCH 029/214] AVX2 updates to turbo encoder interleaver. Also speedup in RSC encoder. 40% speedup improvement. --- openair1/PHY/CODING/3gpplte_sse.c | 79 +++++++++++++++++-------------- openair1/PHY/CODING/Makefile | 2 +- openair1/PHY/INIT/lte_init.c | 2 + 3 files changed, 46 insertions(+), 37 deletions(-) diff --git a/openair1/PHY/CODING/3gpplte_sse.c b/openair1/PHY/CODING/3gpplte_sse.c index 3dda77e4ee..e486c8e0b4 100755 --- a/openair1/PHY/CODING/3gpplte_sse.c +++ b/openair1/PHY/CODING/3gpplte_sse.c @@ -59,16 +59,12 @@ unsigned long long threegpplte_interleaver_tmp; #if defined(__x86_64__) || defined(__i386__) struct treillis { union { - __m64 systematic_64[3]; - char systematic_8[24]; - }; - union { - __m64 parity1_64[3]; - char parity1_8[24]; + __m64 systematic_andp1_64[3]; + uint8_t systematic_andp1_8[24]; }; union { __m64 parity2_64[3]; - char parity2_8[24]; + uint8_t parity2_8[24]; }; int exit_state; } __attribute__ ((aligned(64))); @@ -77,12 +73,8 @@ struct treillis { struct treillis { union { - uint8x8_t systematic_64[3]; - char systematic_8[24]; - }__attribute__((aligned(64))); - union { - uint8x8_t parity1_64[3]; - char parity1_8[24]; + uint8x8_t systematic_andp1_64[3]; + char systematic_andp1_8[24]; }__attribute__((aligned(64))); union { uint8x8_t parity2_64[3]; @@ -93,6 +85,7 @@ struct treillis { #endif struct treillis all_treillis[8][256]; + int all_treillis_initialized=0; static inline unsigned char threegpplte_rsc(unsigned char input,unsigned char *state) @@ -118,18 +111,20 @@ void treillis_table_init(void) unsigned char v, current_state; // clear all_treillis - for (i=0; i<8; i++) + for (i=0; i<8; i++) { bzero( all_treillis[i], sizeof(all_treillis[0]) ); + } for (i=0; i<8; i++) { //all possible initial states for (j=0; j<=255; j++) { // all possible values of a byte current_state=i; for (b=0; b<8 ; b++ ) { // pre-compute the image of the byte j in _m128i vector right place - all_treillis[i][j].systematic_8[b*3]= (j&(1<<(7-b)))>>(7-b); - v=threegpplte_rsc( all_treillis[i][j].systematic_8[b*3] , + all_treillis[i][j].systematic_andp1_8[b*3]= (j&(1<<(7-b)))>>(7-b); + v=threegpplte_rsc( all_treillis[i][j].systematic_andp1_8[b*3] , ¤t_state); - all_treillis[i][j].parity1_8[b*3+1]=v; // for the yparity1 + all_treillis[i][j].systematic_andp1_8[b*3+1]=v; // for the yparity1 + // all_treillis[i][j].parity1_8[b*3+1]=v; // for the yparity1 all_treillis[i][j].parity2_8[b*3+2]=v; // for the yparity2 } @@ -236,10 +231,12 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns if ((n&31) > 0) loop++; #endif + + for (i=0; i>(7-b); */ + // int cur_byte=i<<3; + // for (b=0;b<8;b++) + // expandInput[cur_byte+b] = (input[i]&(1<<(7-b)))>>(7-b); #if defined(__x86_64__) || defined(__i386__) #ifndef __AVX2__ @@ -419,6 +416,7 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns i_128++; #endif } + short * ptr_intl=base_interleaver; #if defined(__x86_64) || defined(__i386__) @@ -438,7 +436,7 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns uint8x16_t Powers= vld1q_u8(_Powers); uint8_t *systematic2_ptr=(uint8_t *) output; #endif -#ifndef __AVX2 +#ifndef __AVX2__ int input_length_words=n>>1; #else int input_length_words=n>>2; @@ -473,6 +471,7 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],2); tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],1); tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],0); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+7); tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+6); tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+5); @@ -481,6 +480,7 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+2); tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+1); tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+0); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+7); tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+6); tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+5); @@ -488,7 +488,8 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+3); tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+2); tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+1); - tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+0); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+0); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+7); tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+6); tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+5); @@ -497,6 +498,7 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+2); tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+1); tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+0); + *systematic2_ptr++=(unsigned int)_mm256_movemask_epi8(tmp); #endif #elif defined(__arm__) @@ -552,8 +554,9 @@ void threegpplte_turbo_encoder(unsigned char *input, unsigned short input_length_bits = input_length_bytes<<3; short * base_interleaver; - if ( all_treillis_initialized == 0 ) + if ( all_treillis_initialized == 0 ) { treillis_table_init(); + } // look for f1 and f2 precomputed interleaver values for (i=0; i < 188 && f1f2mat[i].nb_bits != input_length_bits; i++); @@ -566,7 +569,7 @@ void threegpplte_turbo_encoder(unsigned char *input, } - unsigned char systematic2[768]; + unsigned char systematic2[768] __attribute__((aligned(32))); interleave_compact_byte(base_interleaver,input,systematic2,input_length_bytes); #if defined(__x86_64__) || defined(__i386__) @@ -580,22 +583,26 @@ void threegpplte_turbo_encoder(unsigned char *input, for ( state0=state1=i=0 ; i Date: Sun, 3 Jan 2016 15:15:26 -0800 Subject: [PATCH 030/214] added avx2 optimized turbo decoder for 16-bit LLR. This decoder parallelizes by decoding 2 code segments concurrently. requires updates dlsch_decoding.c to identify when new parallel version can be used. other minor changes related to memory allocations for future avx2 optimizations (32-byte alignment). --- cmake_targets/CMakeLists.txt | 5 +- .../CODING/3gpplte_turbo_decoder_avx2_16bit.c | 1374 +++++++++++++++++ .../CODING/3gpplte_turbo_decoder_sse_16bit.c | 248 ++- openair1/PHY/CODING/defs.h | 18 + openair1/PHY/INIT/lte_init.c | 4 +- openair1/PHY/LTE_ESTIMATION/filt96_32.h | 112 +- openair1/PHY/LTE_ESTIMATION/lte_sync_time.c | 4 +- .../PHY/LTE_ESTIMATION/lte_sync_timefreq.c | 4 +- openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c | 163 +- openair1/SCHED/phy_procedures_lte_eNb.c | 6 +- 10 files changed, 1796 insertions(+), 142 deletions(-) create mode 100644 openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 8ba602c25d..8fc2f4fd09 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -134,7 +134,7 @@ else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l") set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2") endif() if (CPUINFO MATCHES "sse4_2") - set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.2") + set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2 -msse4.2") endif() if (CPUINFO MATCHES "sse4_1") set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1") @@ -168,7 +168,7 @@ set(CMAKE_CXX_FLAGS # these changes are related to hardcoded path to include .h files add_definitions(-DCMAKER) set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3") -set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O2") +set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O3") # Below has been put in comment because does not work with # SVN authentication. @@ -840,6 +840,7 @@ set(PHY_SRC ${OPENAIR1_DIR}/PHY/CODING/crc_byte.c ${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c ${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c + ${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c ${OPENAIR1_DIR}/PHY/CODING/lte_rate_matching.c ${OPENAIR1_DIR}/PHY/CODING/rate_matching.c ${OPENAIR1_DIR}/PHY/CODING/viterbi.c diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c new file mode 100644 index 0000000000..11720087ee --- /dev/null +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c @@ -0,0 +1,1374 @@ +/******************************************************************************* + OpenAirInterface + Copyright(c) 1999 - 2014 Eurecom + + OpenAirInterface is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + + OpenAirInterface is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenAirInterface.The full GNU General Public License is + included in this distribution in the file called "COPYING". If not, + see . + + Contact Information + OpenAirInterface Admin: openair_admin@eurecom.fr + OpenAirInterface Tech : openair_tech@eurecom.fr + OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + + Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + + *******************************************************************************/ +/* file: 3gpplte_turbo_decoder_sse_16bit.c + purpose: Routines for implementing max-logmap decoding of Turbo-coded (DLSCH) transport channels from 36-212, V8.6 2009-03 + authors: raymond.knopp@eurecom.fr, Laurent Thomas (Alcatel-Lucent) + date: 21.10.2009 + + Note: This version of the routine currently requires SSE2,SSSE3 and SSE4.1 equipped computers. It uses 16-bit inputs for + LLRS and uses 16-bit arithmetic for the internal computations! + + Changelog: 17.11.2009 FK SSE4.1 not required anymore + Aug. 2012 new parallelization options for higher speed (8-way parallelization) + Jan. 2013 8-bit LLR support with 16-way parallelization + Feb. 2013 New interleaving and hard-decision optimizations (L. Thomas) + May 2013 Extracted 16bit code +*/ + +/// +/// + +#ifdef __AVX2__ + +#include "PHY/sse_intrin.h" + +#ifndef TEST_DEBUG +#include "PHY/defs.h" +#include "PHY/CODING/defs.h" +#include "PHY/CODING/lte_interleaver_inline.h" +#include "extern_3GPPinterleaver.h" +#else + +#include "defs.h" +#include +#include +#include +#endif + +#ifdef MEX +#include "mex.h" +#endif + + +//#define DEBUG_LOGMAP + +#ifdef DEBUG_LOGMAP +#define print_shorts(s,x) fprintf(fdavx2,"%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7]);fprintf(fdavx2b,"%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15]) +FILE *fdavx2,*fdavx2b; +#else + +#endif + + +#define print_bytes(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7],(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15],(x)[16],(x)[17],(x)[18],(x)[19],(x)[20],(x)[21],(x)[22],(x)[23],(x)[24],(x)[25],(x)[26],(x)[27],(x)[28],(x)[29],(x)[30],(x)[31]) + + + + +typedef int16_t llr_t; // internal decoder LLR data is 16-bit fixed +typedef int16_t channel_t; +#define MAX 256 + +void log_map16avx2(llr_t* systematic,channel_t* y_parity, llr_t* m11, llr_t* m10, llr_t *alpha, llr_t *beta, llr_t* ext,uint16_t frame_length,unsigned char term_flag,unsigned char F,int offset8_flag,time_stats_t *alpha_stats,time_stats_t *beta_stats,time_stats_t *gamma_stats,time_stats_t *ext_stats); +void compute_gamma16avx2(llr_t* m11,llr_t* m10,llr_t* systematic, channel_t* y_parity, uint16_t frame_length,unsigned char term_flag); +void compute_alpha16avx2(llr_t*alpha,llr_t *beta, llr_t* m11,llr_t* m10, uint16_t frame_length,unsigned char F); +void compute_beta16avx2(llr_t*alpha, llr_t* beta,llr_t* m11,llr_t* m10, uint16_t frame_length,unsigned char F,int offset8_flag); +void compute_ext16avx2(llr_t* alpha,llr_t* beta,llr_t* m11,llr_t* m10,llr_t* extrinsic, llr_t* ap, uint16_t frame_length); + + +void log_map16avx2(llr_t* systematic, + channel_t* y_parity, + llr_t* m11, + llr_t* m10, + llr_t *alpha, + llr_t *beta, + llr_t* ext, + uint16_t frame_length, + unsigned char term_flag, + unsigned char F, + int offset8_flag, + time_stats_t *alpha_stats, + time_stats_t *beta_stats, + time_stats_t *gamma_stats, + time_stats_t *ext_stats) +{ + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"log_map (avx2_16bit), frame_length %d\n",frame_length); + fprintf(fdavx2b,"log_map (avx2_16bit), frame_length %d\n",frame_length); +#endif + + start_meas(gamma_stats) ; + compute_gamma16avx2(m11,m10,systematic,y_parity,frame_length,term_flag) ; + stop_meas(gamma_stats); + start_meas(alpha_stats) ; + compute_alpha16avx2(alpha,beta,m11,m10,frame_length,F) ; + stop_meas(alpha_stats); + start_meas(beta_stats) ; + compute_beta16avx2(alpha,beta,m11,m10,frame_length,F,offset8_flag) ; + stop_meas(beta_stats); + start_meas(ext_stats) ; + compute_ext16avx2(alpha,beta,m11,m10,ext,systematic,frame_length) ; + stop_meas(ext_stats); + + +} + +void compute_gamma16avx2(llr_t* m11,llr_t* m10,llr_t* systematic,channel_t* y_parity, + uint16_t frame_length,unsigned char term_flag) +{ + int k,K1; + + __m256i *systematic128 = (__m256i *)systematic; + __m256i *y_parity128 = (__m256i *)y_parity; + __m256i *m10_128 = (__m256i *)m10; + __m256i *m11_128 = (__m256i *)m11; + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"compute_gamma (avx2_16bit), %p,%p,%p,%p,framelength %d\n",m11,m10,systematic,y_parity,frame_length); + fprintf(fdavx2b,"compute_gamma (avx2_16bit), %p,%p,%p,%p,framelength %d\n",m11,m10,systematic,y_parity,frame_length); +#endif + + K1=frame_length>>3; + + for (k=0; k>3; + K1 = (frame_length>>3); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"Compute alpha (avx2_16bit)\n"); + fprintf(fdavx2b,"Compute alpha (avx2_16bit)\n"); +#endif + for (l=K1;; l=l2,rerun_flag=1) { + alpha128 = (__m256i *)alpha; + + if (rerun_flag == 0) { + + alpha128[0] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,0,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,0); + alpha128[1] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2); + alpha128[2] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2); + alpha128[3] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2); + alpha128[4] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2); + alpha128[5] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2); + alpha128[6] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2); + alpha128[7] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"Initial alpha\n"); + fprintf(fdavx2b,"Initial alpha\n"); + print_shorts("a0",(int16_t*)&alpha128[0]); + print_shorts("a1",(int16_t*)&alpha128[1]); + print_shorts("a2",(int16_t*)&alpha128[2]); + print_shorts("a3",(int16_t*)&alpha128[3]); + print_shorts("a4",(int16_t*)&alpha128[4]); + print_shorts("a5",(int16_t*)&alpha128[5]); + print_shorts("a6",(int16_t*)&alpha128[6]); + print_shorts("a7",(int16_t*)&alpha128[7]); +#endif + } else { + //set initial alpha in columns 1-7 from final alpha from last run in columns 0-6 + alpha128[0] = _mm256_slli_si256(alpha128[frame_length],2); + alpha128[1] = _mm256_slli_si256(alpha128[1+frame_length],2); + alpha128[2] = _mm256_slli_si256(alpha128[2+frame_length],2); + alpha128[3] = _mm256_slli_si256(alpha128[3+frame_length],2); + alpha128[4] = _mm256_slli_si256(alpha128[4+frame_length],2); + alpha128[5] = _mm256_slli_si256(alpha128[5+frame_length],2); + alpha128[6] = _mm256_slli_si256(alpha128[6+frame_length],2); + alpha128[7] = _mm256_slli_si256(alpha128[7+frame_length],2); + // set initial alpha in column 0 to (0,-MAX/2,...,-MAX/2) + alpha[16] = -MAX/2; + alpha[32] = -MAX/2; + alpha[48] = -MAX/2; + alpha[64] = -MAX/2; + alpha[80] = -MAX/2; + alpha[96] = -MAX/2; + alpha[112] = -MAX/2; + + alpha[24] = -MAX/2; + alpha[40] = -MAX/2; + alpha[56] = -MAX/2; + alpha[72] = -MAX/2; + alpha[88] = -MAX/2; + alpha[104] = -MAX/2; + alpha[120] = -MAX/2; +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"Second run\n"); + fprintf(fdavx2b,"Second run\n"); + print_shorts("a0",(int16_t*)&alpha128[0]); + print_shorts("a1",(int16_t*)&alpha128[1]); + print_shorts("a2",(int16_t*)&alpha128[2]); + print_shorts("a3",(int16_t*)&alpha128[3]); + print_shorts("a4",(int16_t*)&alpha128[4]); + print_shorts("a5",(int16_t*)&alpha128[5]); + print_shorts("a6",(int16_t*)&alpha128[6]); + print_shorts("a7",(int16_t*)&alpha128[7]); +#endif + + } + + alpha_ptr = &alpha128[0]; + m11p = (__m256i*)m_11; + m10p = (__m256i*)m_10; + + for (k=0; + kbeta1_16) ? beta0_16 : beta1_16; + beta_m = (beta_m>beta2_16) ? beta_m : beta2_16; + beta_m = (beta_m>beta3_16) ? beta_m : beta3_16; + beta_m = (beta_m>beta4_16) ? beta_m : beta4_16; + beta_m = (beta_m>beta5_16) ? beta_m : beta5_16; + beta_m = (beta_m>beta6_16) ? beta_m : beta6_16; + beta_m = (beta_m>beta7_16) ? beta_m : beta7_16; + + beta_m_cw2 = (beta0_cw2_16>beta1_cw2_16) ? beta0_cw2_16 : beta1_cw2_16; + beta_m_cw2 = (beta_m_cw2>beta2_cw2_16) ? beta_m_cw2 : beta2_cw2_16; + beta_m_cw2 = (beta_m_cw2>beta3_cw2_16) ? beta_m_cw2 : beta3_cw2_16; + beta_m_cw2 = (beta_m_cw2>beta4_cw2_16) ? beta_m_cw2 : beta4_cw2_16; + beta_m_cw2 = (beta_m_cw2>beta5_cw2_16) ? beta_m_cw2 : beta5_cw2_16; + beta_m_cw2 = (beta_m_cw2>beta6_cw2_16) ? beta_m_cw2 : beta6_cw2_16; + beta_m_cw2 = (beta_m_cw2>beta7_cw2_16) ? beta_m_cw2 : beta7_cw2_16; + + + beta0_16=beta0_16-beta_m; + beta1_16=beta1_16-beta_m; + beta2_16=beta2_16-beta_m; + beta3_16=beta3_16-beta_m; + beta4_16=beta4_16-beta_m; + beta5_16=beta5_16-beta_m; + beta6_16=beta6_16-beta_m; + beta7_16=beta7_16-beta_m; + + beta0_cw2_16=beta0_cw2_16-beta_m_cw2; + beta1_cw2_16=beta1_cw2_16-beta_m_cw2; + beta2_cw2_16=beta2_cw2_16-beta_m_cw2; + beta3_cw2_16=beta3_cw2_16-beta_m_cw2; + beta4_cw2_16=beta4_cw2_16-beta_m_cw2; + beta5_cw2_16=beta5_cw2_16-beta_m_cw2; + beta6_cw2_16=beta6_cw2_16-beta_m_cw2; + beta7_cw2_16=beta7_cw2_16-beta_m_cw2; + + for (rerun_flag=0;; rerun_flag=1) { + + beta_ptr = (__m256i*)&beta[frame_length<<4]; + alpha128 = (__m256i*)&alpha[0]; + + if (rerun_flag == 0) { + beta_ptr[0] = alpha128[(frame_length)]; + beta_ptr[1] = alpha128[1+(frame_length)]; + beta_ptr[2] = alpha128[2+(frame_length)]; + beta_ptr[3] = alpha128[3+(frame_length)]; + beta_ptr[4] = alpha128[4+(frame_length)]; + beta_ptr[5] = alpha128[5+(frame_length)]; + beta_ptr[6] = alpha128[6+(frame_length)]; + beta_ptr[7] = alpha128[7+(frame_length)]; + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"beta init \n"); + fprintf(fdavx2b,"beta init \n"); + print_shorts("b0",(int16_t*)&beta_ptr[0]); + print_shorts("b1",(int16_t*)&beta_ptr[1]); + print_shorts("b2",(int16_t*)&beta_ptr[2]); + print_shorts("b3",(int16_t*)&beta_ptr[3]); + print_shorts("b4",(int16_t*)&beta_ptr[4]); + print_shorts("b5",(int16_t*)&beta_ptr[5]); + print_shorts("b6",(int16_t*)&beta_ptr[6]); + print_shorts("b7",(int16_t*)&beta_ptr[7]); +#endif + } else { + + beta128 = (__m256i*)&beta[0]; + beta_ptr[0] = _mm256_srli_si256(beta128[0],2); + beta_ptr[1] = _mm256_srli_si256(beta128[1],2); + beta_ptr[2] = _mm256_srli_si256(beta128[2],2); + beta_ptr[3] = _mm256_srli_si256(beta128[3],2); + beta_ptr[4] = _mm256_srli_si256(beta128[4],2); + beta_ptr[5] = _mm256_srli_si256(beta128[5],2); + beta_ptr[6] = _mm256_srli_si256(beta128[6],2); + beta_ptr[7] = _mm256_srli_si256(beta128[7],2); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"beta init (second run)\n"); + fprintf(fdavx2b,"beta init (second run)\n"); + print_shorts("b0",(int16_t*)&beta_ptr[0]); + print_shorts("b1",(int16_t*)&beta_ptr[1]); + print_shorts("b2",(int16_t*)&beta_ptr[2]); + print_shorts("b3",(int16_t*)&beta_ptr[3]); + print_shorts("b4",(int16_t*)&beta_ptr[4]); + print_shorts("b5",(int16_t*)&beta_ptr[5]); + print_shorts("b6",(int16_t*)&beta_ptr[6]); + print_shorts("b7",(int16_t*)&beta_ptr[7]); +#endif + } + + + beta_ptr[0] = _mm256_insert_epi16(beta_ptr[0],beta0_16,7); + beta_ptr[1] = _mm256_insert_epi16(beta_ptr[1],beta1_16,7); + beta_ptr[2] = _mm256_insert_epi16(beta_ptr[2],beta2_16,7); + beta_ptr[3] = _mm256_insert_epi16(beta_ptr[3],beta3_16,7); + beta_ptr[4] = _mm256_insert_epi16(beta_ptr[4],beta4_16,7); + beta_ptr[5] = _mm256_insert_epi16(beta_ptr[5],beta5_16,7); + beta_ptr[6] = _mm256_insert_epi16(beta_ptr[6],beta6_16,7); + beta_ptr[7] = _mm256_insert_epi16(beta_ptr[7],beta7_16,7); + + beta_ptr[0] = _mm256_insert_epi16(beta_ptr[0],beta0_cw2_16,15); + beta_ptr[1] = _mm256_insert_epi16(beta_ptr[1],beta1_cw2_16,15); + beta_ptr[2] = _mm256_insert_epi16(beta_ptr[2],beta2_cw2_16,15); + beta_ptr[3] = _mm256_insert_epi16(beta_ptr[3],beta3_cw2_16,15); + beta_ptr[4] = _mm256_insert_epi16(beta_ptr[4],beta4_cw2_16,15); + beta_ptr[5] = _mm256_insert_epi16(beta_ptr[5],beta5_cw2_16,15); + beta_ptr[6] = _mm256_insert_epi16(beta_ptr[6],beta6_cw2_16,15); + beta_ptr[7] = _mm256_insert_epi16(beta_ptr[7],beta7_cw2_16,15); + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"beta init (after insert) \n"); + fprintf(fdavx2b,"beta init (after insert) \n"); + print_shorts("b0",(int16_t*)&beta_ptr[0]); + print_shorts("b1",(int16_t*)&beta_ptr[1]); + print_shorts("b2",(int16_t*)&beta_ptr[2]); + print_shorts("b3",(int16_t*)&beta_ptr[3]); + print_shorts("b4",(int16_t*)&beta_ptr[4]); + print_shorts("b5",(int16_t*)&beta_ptr[5]); + print_shorts("b6",(int16_t*)&beta_ptr[6]); + print_shorts("b7",(int16_t*)&beta_ptr[7]); +#endif + int loopval=((rerun_flag==0)?0:((frame_length-L)>>3)); + + for (k=(frame_length>>3)-1; k>=loopval; k--) { + + m11_128=((__m256i*)m_11)[k]; + m10_128=((__m256i*)m_10)[k]; + + m_b0 = _mm256_adds_epi16(beta_ptr[4],m11_128); //m11 + m_b1 = _mm256_subs_epi16(beta_ptr[4],m11_128); //m00 + m_b2 = _mm256_subs_epi16(beta_ptr[5],m10_128); //m01 + m_b3 = _mm256_adds_epi16(beta_ptr[5],m10_128); //m10 + m_b4 = _mm256_adds_epi16(beta_ptr[6],m10_128); //m10 + m_b5 = _mm256_subs_epi16(beta_ptr[6],m10_128); //m01 + m_b6 = _mm256_subs_epi16(beta_ptr[7],m11_128); //m00 + m_b7 = _mm256_adds_epi16(beta_ptr[7],m11_128); //m11 + + new0 = _mm256_subs_epi16(beta_ptr[0],m11_128); //m00 + new1 = _mm256_adds_epi16(beta_ptr[0],m11_128); //m11 + new2 = _mm256_adds_epi16(beta_ptr[1],m10_128); //m10 + new3 = _mm256_subs_epi16(beta_ptr[1],m10_128); //m01 + new4 = _mm256_subs_epi16(beta_ptr[2],m10_128); //m01 + new5 = _mm256_adds_epi16(beta_ptr[2],m10_128); //m10 + new6 = _mm256_adds_epi16(beta_ptr[3],m11_128); //m11 + new7 = _mm256_subs_epi16(beta_ptr[3],m11_128); //m00 + + beta_ptr-=8; + + beta_ptr[0] = _mm256_max_epi16(m_b0,new0); + beta_ptr[1] = _mm256_max_epi16(m_b1,new1); + beta_ptr[2] = _mm256_max_epi16(m_b2,new2); + beta_ptr[3] = _mm256_max_epi16(m_b3,new3); + beta_ptr[4] = _mm256_max_epi16(m_b4,new4); + beta_ptr[5] = _mm256_max_epi16(m_b5,new5); + beta_ptr[6] = _mm256_max_epi16(m_b6,new6); + beta_ptr[7] = _mm256_max_epi16(m_b7,new7); + + beta_max = _mm256_max_epi16(beta_ptr[0],beta_ptr[1]); + beta_max = _mm256_max_epi16(beta_max ,beta_ptr[2]); + beta_max = _mm256_max_epi16(beta_max ,beta_ptr[3]); + beta_max = _mm256_max_epi16(beta_max ,beta_ptr[4]); + beta_max = _mm256_max_epi16(beta_max ,beta_ptr[5]); + beta_max = _mm256_max_epi16(beta_max ,beta_ptr[6]); + beta_max = _mm256_max_epi16(beta_max ,beta_ptr[7]); + + beta_ptr[0] = _mm256_subs_epi16(beta_ptr[0],beta_max); + beta_ptr[1] = _mm256_subs_epi16(beta_ptr[1],beta_max); + beta_ptr[2] = _mm256_subs_epi16(beta_ptr[2],beta_max); + beta_ptr[3] = _mm256_subs_epi16(beta_ptr[3],beta_max); + beta_ptr[4] = _mm256_subs_epi16(beta_ptr[4],beta_max); + beta_ptr[5] = _mm256_subs_epi16(beta_ptr[5],beta_max); + beta_ptr[6] = _mm256_subs_epi16(beta_ptr[6],beta_max); + beta_ptr[7] = _mm256_subs_epi16(beta_ptr[7],beta_max); + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"Loop index %d, mb\n",k); + fprintf(fdavx2,"beta init (after max)\n"); + fprintf(fdavx2b,"Loop index %d, mb\n",k); + fprintf(fdavx2b,"beta init (after max)\n"); + + print_shorts("b0",(int16_t*)&beta_ptr[0]); + print_shorts("b1",(int16_t*)&beta_ptr[1]); + print_shorts("b2",(int16_t*)&beta_ptr[2]); + print_shorts("b3",(int16_t*)&beta_ptr[3]); + print_shorts("b4",(int16_t*)&beta_ptr[4]); + print_shorts("b5",(int16_t*)&beta_ptr[5]); + print_shorts("b6",(int16_t*)&beta_ptr[6]); + print_shorts("b7",(int16_t*)&beta_ptr[7]); + +#endif + } + + if (rerun_flag==1) + break; + } +} + +void compute_ext16avx2(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext, llr_t* systematic,uint16_t frame_length) +{ + + __m256i *alpha128=(__m256i *)alpha; + __m256i *beta128=(__m256i *)beta; + __m256i *m11_128,*m10_128,*ext_128; + __m256i *alpha_ptr,*beta_ptr; + __m256i m00_1,m00_2,m00_3,m00_4; + __m256i m01_1,m01_2,m01_3,m01_4; + __m256i m10_1,m10_2,m10_3,m10_4; + __m256i m11_1,m11_2,m11_3,m11_4; + + int k; + + // + // LLR computation, 8 consequtive bits per loop + // + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"compute_ext (avx2_16bit), %p, %p, %p, %p, %p, %p ,framelength %d\n",alpha,beta,m_11,m_10,ext,systematic,frame_length); + fprintf(fdavx2b,"compute_ext (avx2_16bit), %p, %p, %p, %p, %p, %p ,framelength %d\n",alpha,beta,m_11,m_10,ext,systematic,frame_length); +#endif + + alpha_ptr = alpha128; + beta_ptr = &beta128[8]; + + + for (k=0; k<(frame_length>>3); k++) { + + + m11_128 = (__m256i*)&m_11[k<<4]; + m10_128 = (__m256i*)&m_10[k<<4]; + ext_128 = (__m256i*)&ext[k<<4]; + + /* + fprintf(fdavx2,"EXT %03d\n",k); + print_shorts("a0:",&alpha_ptr[0]); + print_shorts("a1:",&alpha_ptr[1]); + print_shorts("a2:",&alpha_ptr[2]); + print_shorts("a3:",&alpha_ptr[3]); + print_shorts("a4:",&alpha_ptr[4]); + print_shorts("a5:",&alpha_ptr[5]); + print_shorts("a6:",&alpha_ptr[6]); + print_shorts("a7:",&alpha_ptr[7]); + print_shorts("b0:",&beta_ptr[0]); + print_shorts("b1:",&beta_ptr[1]); + print_shorts("b2:",&beta_ptr[2]); + print_shorts("b3:",&beta_ptr[3]); + print_shorts("b4:",&beta_ptr[4]); + print_shorts("b5:",&beta_ptr[5]); + print_shorts("b6:",&beta_ptr[6]); + print_shorts("b7:",&beta_ptr[7]); + */ + m00_4 = _mm256_adds_epi16(alpha_ptr[7],beta_ptr[3]); //ALPHA_BETA_4m00; + m11_4 = _mm256_adds_epi16(alpha_ptr[7],beta_ptr[7]); //ALPHA_BETA_4m11; + m00_3 = _mm256_adds_epi16(alpha_ptr[6],beta_ptr[7]); //ALPHA_BETA_3m00; + m11_3 = _mm256_adds_epi16(alpha_ptr[6],beta_ptr[3]); //ALPHA_BETA_3m11; + m00_2 = _mm256_adds_epi16(alpha_ptr[1],beta_ptr[4]); //ALPHA_BETA_2m00; + m11_2 = _mm256_adds_epi16(alpha_ptr[1],beta_ptr[0]); //ALPHA_BETA_2m11; + m11_1 = _mm256_adds_epi16(alpha_ptr[0],beta_ptr[4]); //ALPHA_BETA_1m11; + m00_1 = _mm256_adds_epi16(alpha_ptr[0],beta_ptr[0]); //ALPHA_BETA_1m00; + m01_4 = _mm256_adds_epi16(alpha_ptr[5],beta_ptr[6]); //ALPHA_BETA_4m01; + m10_4 = _mm256_adds_epi16(alpha_ptr[5],beta_ptr[2]); //ALPHA_BETA_4m10; + m01_3 = _mm256_adds_epi16(alpha_ptr[4],beta_ptr[2]); //ALPHA_BETA_3m01; + m10_3 = _mm256_adds_epi16(alpha_ptr[4],beta_ptr[6]); //ALPHA_BETA_3m10; + m01_2 = _mm256_adds_epi16(alpha_ptr[3],beta_ptr[1]); //ALPHA_BETA_2m01; + m10_2 = _mm256_adds_epi16(alpha_ptr[3],beta_ptr[5]); //ALPHA_BETA_2m10; + m10_1 = _mm256_adds_epi16(alpha_ptr[2],beta_ptr[1]); //ALPHA_BETA_1m10; + m01_1 = _mm256_adds_epi16(alpha_ptr[2],beta_ptr[5]); //ALPHA_BETA_1m01; + /* + print_shorts("m11_1:",&m11_1); + print_shorts("m11_2:",&m11_2); + print_shorts("m11_3:",&m11_3); + print_shorts("m11_4:",&m11_4); + print_shorts("m00_1:",&m00_1); + print_shorts("m00_2:",&m00_2); + print_shorts("m00_3:",&m00_3); + print_shorts("m00_4:",&m00_4); + print_shorts("m10_1:",&m10_1); + print_shorts("m10_2:",&m10_2); + print_shorts("m10_3:",&m10_3); + print_shorts("m10_4:",&m10_4); + print_shorts("m01_1:",&m01_1); + print_shorts("m01_2:",&m01_2); + print_shorts("m01_3:",&m01_3); + print_shorts("m01_4:",&m01_4); + */ + m01_1 = _mm256_max_epi16(m01_1,m01_2); + m01_1 = _mm256_max_epi16(m01_1,m01_3); + m01_1 = _mm256_max_epi16(m01_1,m01_4); + m00_1 = _mm256_max_epi16(m00_1,m00_2); + m00_1 = _mm256_max_epi16(m00_1,m00_3); + m00_1 = _mm256_max_epi16(m00_1,m00_4); + m10_1 = _mm256_max_epi16(m10_1,m10_2); + m10_1 = _mm256_max_epi16(m10_1,m10_3); + m10_1 = _mm256_max_epi16(m10_1,m10_4); + m11_1 = _mm256_max_epi16(m11_1,m11_2); + m11_1 = _mm256_max_epi16(m11_1,m11_3); + m11_1 = _mm256_max_epi16(m11_1,m11_4); + + // print_shorts("m11_1:",&m11_1); + + m01_1 = _mm256_subs_epi16(m01_1,*m10_128); + m00_1 = _mm256_subs_epi16(m00_1,*m11_128); + m10_1 = _mm256_adds_epi16(m10_1,*m10_128); + m11_1 = _mm256_adds_epi16(m11_1,*m11_128); + + // print_shorts("m10_1:",&m10_1); + // print_shorts("m11_1:",&m11_1); + m01_1 = _mm256_max_epi16(m01_1,m00_1); + m10_1 = _mm256_max_epi16(m10_1,m11_1); + // print_shorts("m01_1:",&m01_1); + // print_shorts("m10_1:",&m10_1); + + *ext_128 = _mm256_subs_epi16(m10_1,m01_1); + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"ext %p\n",ext_128); + fprintf(fdavx2b,"ext %p\n",ext_128); + print_shorts("ext:",(int16_t*)ext_128); + print_shorts("m11:",(int16_t*)m11_128); + print_shorts("m10:",(int16_t*)m10_128); + print_shorts("m10_1:",(int16_t*)&m10_1); + print_shorts("m01_1:",(int16_t*)&m01_1); + + +#endif + + alpha_ptr+=8; + beta_ptr+=8; + } +} + + + +//int pi2[n],pi3[n+8],pi5[n+8],pi4[n+8],pi6[n+8], +int *pi2tab16avx2[188],*pi5tab16avx2[188],*pi4tab16avx2[188],*pi6tab16avx2[188]; + +void free_td16avx2(void) +{ + int ind; + + for (ind=0; ind<188; ind++) { + free(pi2tab16avx2[ind]); + free(pi5tab16avx2[ind]); + free(pi4tab16avx2[ind]); + free(pi6tab16avx2[ind]); + } +} + +void init_td16avx2() +{ + + int ind,i,i2,i3,j,n,pi,pi2_i,pi2_pi; + short * base_interleaver; + + for (ind=0; ind<188; ind++) { + n = f1f2mat[ind].nb_bits; + base_interleaver=il_tb+f1f2mat[ind].beg_index; +#ifdef MEX + // This is needed for the Mex implementation to make the memory persistent + pi2tab16[ind] = mxMalloc((n+8)*sizeof(int)); + pi5tab16[ind] = mxMalloc((n+8)*sizeof(int)); + pi4tab16[ind] = mxMalloc((n+8)*sizeof(int)); + pi6tab16[ind] = mxMalloc((n+8)*sizeof(int)); +#else + pi2tab16avx2[ind] = malloc((n+8)*sizeof(int)); + pi5tab16avx2[ind] = malloc((n+8)*sizeof(int)); + pi4tab16avx2[ind] = malloc((n+8)*sizeof(int)); + pi6tab16avx2[ind] = malloc((n+8)*sizeof(int)); +#endif + + // fprintf(fdavx2,"Interleaver index %d\n",ind); + for (i=i2=0; i2<8; i2++) { + j=i2; + + for (i3=0; i3<(n>>3); i3++,i++,j+=8) { + + // if (j>=n) + // j-=(n-1); + + pi2tab16avx2[ind][i] = ((j>>3)<<4) + (j&7); // 16*floor(j/8) + j mod8, which allows the second codeword to be in pi[i] + 8 + // fprintf(fdavx2,"pi2[%d] = %d(%d)\n",i, pi2tab16avx2[ind][i],j); + } + } + + for (i=0; i>4)<<3)+(pi2tab16avx2[ind][i]&7); + pi2_pi = ((pi2tab16avx2[ind][pi]>>4)<<3)+(pi2tab16avx2[ind][pi]&7); + pi4tab16avx2[ind][pi2_i] = pi2tab16avx2[ind][pi]; + pi5tab16avx2[ind][pi2_pi] = pi2tab16avx2[ind][i]; + pi6tab16avx2[ind][pi] = pi2tab16avx2[ind][i]; + } + + } +} + +unsigned char phy_threegpplte_turbo_decoder16avx2(int16_t *y, + int16_t *y2, + uint8_t *decoded_bytes, + uint8_t *decoded_bytes2, + uint16_t n, + uint16_t f1, + uint16_t f2, + uint8_t max_iterations, + uint8_t crc_type, + uint8_t F, + time_stats_t *init_stats, + time_stats_t *alpha_stats, + time_stats_t *beta_stats, + time_stats_t *gamma_stats, + time_stats_t *ext_stats, + time_stats_t *intl1_stats, + time_stats_t *intl2_stats) +{ + + /* y is a pointer to the input + decoded_bytes is a pointer to the decoded output + n is the size in bits of the coded block, with the tail */ + + + llr_t systematic0[2*(n+16)] __attribute__ ((aligned(32))); + llr_t systematic1[2*(n+16)] __attribute__ ((aligned(32))); + llr_t systematic2[2*(n+16)] __attribute__ ((aligned(32))); + llr_t yparity1[2*(n+16)] __attribute__ ((aligned(32))); + llr_t yparity2[2*(n+16)] __attribute__ ((aligned(32))); + + llr_t ext[2*(n+128)] __attribute__((aligned(32))); + llr_t ext2[2*(n+128)] __attribute__((aligned(32))); + + llr_t alpha[(n+16)*16] __attribute__ ((aligned(32))); + llr_t beta[(n+16)*16] __attribute__ ((aligned(32))); + llr_t m11[2*(n+16)] __attribute__ ((aligned(32))); + llr_t m10[2*(n+16)] __attribute__ ((aligned(32))); + + + int *pi2_p,*pi4_p,*pi5_p,*pi6_p; + llr_t *s,*s1,*s2,*yp1,*yp2,*yp,*yp_cw2; + uint32_t i,j,iind;//,pi; + uint8_t iteration_cnt=0; + uint32_t crc,oldcrc,crc_cw2,oldcrc_cw2,crc_len; + uint8_t temp; + uint32_t db; + + + __m128i *yp128,*yp128_cw2; + __m256i tmp, zeros=_mm256_setzero_si256(); + __m128i tmpe,tmpe_cw2; + + int offset8_flag=0; + +#ifdef DEBUG_LOGMAP + fdavx2 = fopen("dump_avx2.txt","w"); + fdavx2b = fopen("dump_avx2b.txt","w"); + + printf("tc avx2_16 (y,y2) %p,%p\n",y,y2); +#endif + if (crc_type > 3) { + printf("Illegal crc length!\n"); + return 255; + } + + + start_meas(init_stats); + + + + for (iind=0; iind < 188 && f1f2mat[iind].nb_bits != n; iind++); + + if ( iind == 188 ) { + printf("Illegal frame length!\n"); + return 255; + } + + switch (crc_type) { + case CRC24_A: + case CRC24_B: + crc_len=3; + break; + + case CRC16: + crc_len=2; + break; + + case CRC8: + crc_len=1; + break; + + default: + crc_len=3; + } + + + yp128 = (__m128i*)y; + yp128_cw2 = (__m128i*)y2; + + s = systematic0; + s1 = systematic1; + s2 = systematic2; + yp1 = yparity1; + yp2 = yparity2; + + + + for (i=0; i>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); + fprintf(fdavx2b,"init0: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); +#endif + + j=pi2_p[1]; + + s[j] = _mm_extract_epi16(tmpe,3); + yp1[j] = _mm_extract_epi16(tmpe,4); + yp2[j] = _mm_extract_epi16(tmpe,5); + s[j+8] = _mm_extract_epi16(tmpe_cw2,3); + yp1[j+8] = _mm_extract_epi16(tmpe_cw2,4); + yp2[j+8] = _mm_extract_epi16(tmpe_cw2,5); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"init1: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); + fprintf(fdavx2b,"init1: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); +#endif + j=pi2_p[2]; + + s[j] = _mm_extract_epi16(tmpe,6); + yp1[j] = _mm_extract_epi16(tmpe,7); + tmpe = _mm_load_si128(&yp128[1]); + yp2[j] = _mm_extract_epi16(tmpe,0); + s[j+8] = _mm_extract_epi16(tmpe_cw2,6); + yp1[j+8] = _mm_extract_epi16(tmpe_cw2,7); + tmpe_cw2 = _mm_load_si128(&yp128_cw2[1]); + yp2[j+8] = _mm_extract_epi16(tmpe_cw2,0); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"init2: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); + fprintf(fdavx2b,"init2: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); +#endif + j=pi2_p[3]; + + s[j] = _mm_extract_epi16(tmpe,1); + yp1[j] = _mm_extract_epi16(tmpe,2); + yp2[j] = _mm_extract_epi16(tmpe,3); + s[j+8] = _mm_extract_epi16(tmpe_cw2,1); + yp1[j+8] = _mm_extract_epi16(tmpe_cw2,2); + yp2[j+8] = _mm_extract_epi16(tmpe_cw2,3); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"init3: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); + fprintf(fdavx2b,"init3: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); +#endif + j=pi2_p[4]; + + s[j] = _mm_extract_epi16(tmpe,4); + yp1[j] = _mm_extract_epi16(tmpe,5); + yp2[j] = _mm_extract_epi16(tmpe,6); + s[j+8] = _mm_extract_epi16(tmpe_cw2,4); + yp1[j+8] = _mm_extract_epi16(tmpe_cw2,5); + yp2[j+8] = _mm_extract_epi16(tmpe_cw2,6); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"init4: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); + fprintf(fdavx2b,"init4: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); +#endif + j=pi2_p[5]; + + s[j] = _mm_extract_epi16(tmpe,7); + tmpe = _mm_load_si128(&yp128[2]); + yp1[j] = _mm_extract_epi16(tmpe,0); + yp2[j] = _mm_extract_epi16(tmpe,1); + s[j+8] = _mm_extract_epi16(tmpe_cw2,7); + tmpe_cw2 = _mm_load_si128(&yp128_cw2[2]); + yp1[j+8] = _mm_extract_epi16(tmpe_cw2,0); + yp2[j+8] = _mm_extract_epi16(tmpe_cw2,1); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"init5: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); + fprintf(fdavx2b,"init5: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); +#endif + j=pi2_p[6]; + + s[j] = _mm_extract_epi16(tmpe,2); + yp1[j] = _mm_extract_epi16(tmpe,3); + yp2[j] = _mm_extract_epi16(tmpe,4); + s[j+8] = _mm_extract_epi16(tmpe_cw2,2); + yp1[j+8] = _mm_extract_epi16(tmpe_cw2,3); + yp2[j+8] = _mm_extract_epi16(tmpe_cw2,4); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"init6: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); + fprintf(fdavx2b,"init6: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); +#endif + j=pi2_p[7]; + + s[j] = _mm_extract_epi16(tmpe,5); + yp1[j] = _mm_extract_epi16(tmpe,6); + yp2[j] = _mm_extract_epi16(tmpe,7); + s[j+8] = _mm_extract_epi16(tmpe_cw2,5); + yp1[j+8] = _mm_extract_epi16(tmpe_cw2,6); + yp2[j+8] = _mm_extract_epi16(tmpe_cw2,7); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"init7: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); + fprintf(fdavx2b,"init7: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); +#endif + yp128+=3; + yp128_cw2+=3; + + } + + yp=(llr_t*)yp128; + yp_cw2=(llr_t*)yp128_cw2; + + // Termination + for (i=0; i<3; i++) { + s[(n<<1)+i] = *yp; + s1[(n<<1)+i] = *yp; + s2[(n<<1)+i] = *yp; + yp++; + yp1[(n<<1)+i] = *yp; + yp++; + + s[(n<<1)+i+8] = *yp_cw2; + s1[(n<<1)+i+8] = *yp_cw2; + s2[(n<<1)+i+8] = *yp_cw2; + yp_cw2++; + yp1[(n<<1)+i+8] = *yp_cw2; + yp_cw2++; +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"Term 1 (%d): %d %d\n",n+i,s[(n<<1)+i],yp1[(n<<1)+i]); + fprintf(fdavx2b,"Term 1 (%d): %d %d\n",n+i,s[(n<<1)+i+8],yp1[(n<<1)+i+8]); +#endif //DEBUG_LOGMAP + } + + for (i=16; i<19; i++) { + s[(n<<1)+i] = *yp; + s1[(n<<1)+i] = *yp; + s2[(n<<1)+i] = *yp; + yp++; + yp2[(n<<1)+(i-16)] = *yp; + yp++; + + s[(n<<1)+i+8]= *yp_cw2; + s1[(n<<1)+i+8] = *yp_cw2 ; + s2[(n<<1)+i+8] = *yp_cw2; + yp_cw2++; + yp2[(n<<1)+i-16+8] = *yp_cw2; + yp_cw2++; +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"Term 2 (%d): %d %d\n",n+i-3-8,s[(n<<1)+i],yp2[(n<<1)+i-16]); + fprintf(fdavx2b,"Term 2 (%d): %d %d\n",n+i-3-8,s[(n<<1)+i+8],yp2[(n<<1)+i-16+8]); +#endif //DEBUG_LOGMAP + } + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"\n"); + fprintf(fdavx2b,"\n"); +#endif //DEBUG_LOGMAP + + stop_meas(init_stats); + + // do log_map from first parity bit + + log_map16avx2(systematic0,yparity1,m11,m10,alpha,beta,ext,n,0,F,offset8_flag,alpha_stats,beta_stats,gamma_stats,ext_stats); + + while (iteration_cnt++ < max_iterations) { + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"\n*******************ITERATION %d (n %d), ext %p\n\n",iteration_cnt,n,ext); + fprintf(fdavx2b,"\n*******************ITERATION %d (n %d), ext %p\n\n",iteration_cnt,n,ext); +#endif //DEBUG_LOGMAP + + start_meas(intl1_stats); + + pi4_p=pi4tab16avx2[iind]; + + for (i=0; i<(n>>3); i++) { // steady-state portion + + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],0); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],8); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],1); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],9); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],2); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],10); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],3); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],11); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],4); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],12); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],5); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],13); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],6); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],14); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],7); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],15); +#ifdef DEBUG_LOGMAP + print_shorts("syst2",(int16_t*)&((__m256i *)systematic2)[i]); +#endif + } + + stop_meas(intl1_stats); + + // do log_map from second parity bit + + log_map16avx2(systematic2,yparity2,m11,m10,alpha,beta,ext2,n,1,F,offset8_flag,alpha_stats,beta_stats,gamma_stats,ext_stats); + + + + pi5_p=pi5tab16avx2[iind]; + + for (i=0; i<(n>>3); i++) { + + tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],0); + tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],8); + tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],1); + tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],9); + tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],2); + tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],10); + tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],3); + tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],11); + tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],4); + tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],12); + tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],5); + tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],13); + tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],6); + tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],14); + tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],7); + tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],15); + ((__m256i *)systematic1)[i] = _mm256_adds_epi16(_mm256_subs_epi16(tmp,((__m256i*)ext)[i]),((__m256i *)systematic0)[i]); +#ifdef DEBUG_LOGMAP + print_shorts("syst1",(int16_t*)&((__m256i *)systematic1)[i]); +#endif + } + + if (iteration_cnt>1) { + start_meas(intl2_stats); + pi6_p=pi6tab16avx2[iind]; + + for (i=0; i<(n>>3); i++) { + + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],7); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],15); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],6); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],14); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],5); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],13); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],4); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],12); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],3); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],11); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],2); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],10); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],1); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],9); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],0); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],8); +#ifdef DEBUG_LOGMAP + print_shorts("tmp",(int16_t*)&tmp); +#endif + tmp=_mm256_cmpgt_epi8(_mm256_packs_epi16(tmp,zeros),zeros); + db=(uint32_t)_mm256_movemask_epi8(tmp); + decoded_bytes[i]=db&0xff; + decoded_bytes2[i]=(uint8_t)(db>>16)&0xff; +#ifdef DEBUG_LOGMAP + print_shorts("tmp",(int16_t*)&tmp); + fprintf(fdavx2,"decoded_bytes[%d] %x (%x)\n",i,decoded_bytes[i],db); + fprintf(fdavx2b,"decoded_bytes[%d] %x (%x)\n",i,decoded_bytes2[i],db); +#endif + } + } + + // check status on output + if (iteration_cnt>1) { + oldcrc= *((uint32_t *)(&decoded_bytes[(n>>3)-crc_len])); + + switch (crc_type) { + + case CRC24_A: + oldcrc&=0x00ffffff; + crc = crc24a(&decoded_bytes[F>>3], + n-24-F)>>8; + temp=((uint8_t *)&crc)[2]; + ((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0]; + ((uint8_t *)&crc)[0] = temp; + break; + + case CRC24_B: + oldcrc&=0x00ffffff; + crc = crc24b(decoded_bytes, + n-24)>>8; + temp=((uint8_t *)&crc)[2]; + ((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0]; + ((uint8_t *)&crc)[0] = temp; + break; + + case CRC16: + oldcrc&=0x0000ffff; + crc = crc16(decoded_bytes, + n-16)>>16; + break; + + case CRC8: + oldcrc&=0x000000ff; + crc = crc8(decoded_bytes, + n-8)>>24; + break; + + default: + printf("FATAL: 3gpplte_turbo_decoder_sse.c: Unknown CRC\n"); + return(255); + break; + } + + // second CW + oldcrc_cw2= *((uint32_t *)(&decoded_bytes2[(n>>3)-crc_len])); + + switch (crc_type) { + + case CRC24_A: + oldcrc_cw2&=0x00ffffff; + crc_cw2 = crc24a(&decoded_bytes2[F>>3], + n-24-F)>>8; + temp=((uint8_t *)&crc_cw2)[2]; + ((uint8_t *)&crc_cw2)[2] = ((uint8_t *)&crc_cw2)[0]; + ((uint8_t *)&crc_cw2)[0] = temp; + break; + + case CRC24_B: + oldcrc_cw2&=0x00ffffff; + crc_cw2 = crc24b(decoded_bytes2, + n-24)>>8; + temp=((uint8_t *)&crc_cw2)[2]; + ((uint8_t *)&crc_cw2)[2] = ((uint8_t *)&crc_cw2)[0]; + ((uint8_t *)&crc_cw2)[0] = temp; + break; + + case CRC16: + oldcrc_cw2&=0x0000ffff; + crc_cw2 = crc16(decoded_bytes2, + n-16)>>16; + break; + + case CRC8: + oldcrc_cw2&=0x000000ff; + crc_cw2 = crc8(decoded_bytes2, + n-8)>>24; + break; + + default: + printf("FATAL: 3gpplte_turbo_decoder_sse.c: Unknown CRC\n"); + return(255); + break; + } + + stop_meas(intl2_stats); + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"oldcrc %x, crc %x, oldcrc_cw2 %x, crc_cw2 %x\n",oldcrc,crc,oldcrc_cw2,crc_cw2); + fprintf(fdavx2b,"oldcrc %x, crc %x, oldcrc_cw2 %x, crc_cw2 %x\n",oldcrc,crc,oldcrc_cw2,crc_cw2); +#endif + + if ((crc == oldcrc) && (crc!=0) && (crc_cw2 == oldcrc_cw2) && (crc_cw2!=0)) { + return(iteration_cnt); + } + } + + // do log_map from first parity bit + if (iteration_cnt < max_iterations) { + log_map16avx2(systematic1,yparity1,m11,m10,alpha,beta,ext,n,0,F,offset8_flag,alpha_stats,beta_stats,gamma_stats,ext_stats); + + __m256i* ext_128=(__m256i*) ext; + __m256i* s1_128=(__m256i*) systematic1; + __m256i* s0_128=(__m256i*) systematic0; + int myloop=n>>3; + + for (i=0; i>3; @@ -150,7 +156,7 @@ void compute_gamma16(llr_t* m11,llr_t* m10,llr_t* systematic,channel_t* y_parity #endif #ifdef DEBUG_LOGMAP - printf("Loop index k, m11,m10\n"); + fprintf(fdsse4,"Loop index k %d\n", k); print_shorts("sys",(int16_t*)&systematic128[k]); print_shorts("yp",(int16_t*)&y_parity128[k]); print_shorts("m11",(int16_t*)&m11_128[k]); @@ -164,7 +170,15 @@ void compute_gamma16(llr_t* m11,llr_t* m10,llr_t* systematic,channel_t* y_parity m10_128[k] = _mm_srai_epi16(_mm_subs_epi16(systematic128[k+term_flag],y_parity128[k]),1); #elif defined(__arm__) m11_128[k] = vhaddq_s16(systematic128[k+term_flag],y_parity128[k]); - m10_128[k] = vhsubq_s16(systematic128[k+term_flag],y_parity128[k]); +m10_128[k] = vhsubq_s16(systematic128[k+term_flag],y_parity128[k]); +#endif + +#ifdef DEBUG_LOGMAP +fprintf(fdsse4,"Loop index k %d (term flag %d)\n", k,term_flag); +print_shorts("sys",(int16_t*)&systematic128[k]); + print_shorts("yp",(int16_t*)&y_parity128[k]); + print_shorts("m11",(int16_t*)&m11_128[k]); + print_shorts("m10",(int16_t*)&m10_128[k]); #endif } @@ -188,7 +202,9 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s #endif l2 = L>>3; K1 = (frame_length>>3); - +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"compute_alpha (sse_16bit)\n"); +#endif for (l=K1;; l=l2,rerun_flag=1) { #if defined(__x86_64__) || defined(__i386__) alpha128 = (__m128i *)alpha; @@ -218,7 +234,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s alpha128[7] = vdupq_n_s16(-MAX/2); #endif #ifdef DEBUG_LOGMAP - printf("Initial alpha\n"); + fprintf(fdsse4,"Initial alpha\n"); print_shorts("a0",(int16_t*)&alpha128[0]); print_shorts("a1",(int16_t*)&alpha128[1]); print_shorts("a2",(int16_t*)&alpha128[2]); @@ -258,7 +274,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s alpha[48] = -MAX/2; alpha[56] = -MAX/2; #ifdef DEBUG_LOGMAP - printf("Second run\n"); + fprintf(fdsse4,"Second run\n"); print_shorts("a0",(int16_t*)&alpha128[0]); print_shorts("a1",(int16_t*)&alpha128[1]); print_shorts("a2",(int16_t*)&alpha128[2]); @@ -390,7 +406,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s #endif #ifdef DEBUG_LOGMAP - printf("Loop index %d, mb\n",k); + fprintf(fdsse4,"Loop index %d\n",k); print_shorts("mb0",(int16_t*)&m_b0); print_shorts("mb1",(int16_t*)&m_b1); print_shorts("mb2",(int16_t*)&m_b2); @@ -400,7 +416,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s print_shorts("mb6",(int16_t*)&m_b6); print_shorts("mb7",(int16_t*)&m_b7); - printf("Loop index %d, new\n",k); + fprintf(fdsse4,"Loop index %d, new\n",k); print_shorts("new0",(int16_t*)&new0); print_shorts("new1",(int16_t*)&new1); print_shorts("new2",(int16_t*)&new2); @@ -410,7 +426,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s print_shorts("new6",(int16_t*)&new6); print_shorts("new7",(int16_t*)&new7); - printf("Loop index %d, after max\n",k); + fprintf(fdsse4,"Loop index %d, after max\n",k); print_shorts("a0",(int16_t*)&a0); print_shorts("a1",(int16_t*)&a1); print_shorts("a2",(int16_t*)&a2); @@ -420,7 +436,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s print_shorts("a6",(int16_t*)&a6); print_shorts("a7",(int16_t*)&a7); - printf("Loop index %d\n",k); + fprintf(fdsse4,"Loop index %d\n",k); print_shorts("a0",(int16_t*)&alpha_ptr[0]); print_shorts("a1",(int16_t*)&alpha_ptr[1]); print_shorts("a2",(int16_t*)&alpha_ptr[2]); @@ -463,25 +479,29 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh llr_t beta0,beta1; #ifdef DEBUG_LOGMAP - msg("compute_beta, %p,%p,%p,%p,framelength %d,F %d\n", - beta,m_11,m_10,alpha,frame_length,F); + fprintf(fdsse4,"compute_beta, %p,%p,%p,%p,framelength %d,F %d\n", + beta,m_11,m_10,alpha,frame_length,F); #endif // termination for beta initialization - // printf("beta init: offset8 %d\n",offset8_flag); + // fprintf(fdsse4,"beta init: offset8 %d\n",offset8_flag); m11=(int16_t)m_11[2+frame_length]; m10=(int16_t)m_10[2+frame_length]; - // printf("m11,m10 %d,%d\n",m11,m10); +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"m11,m10 %d,%d\n",m11,m10); +#endif beta0 = -m11;//M0T_TERM; beta1 = m11;//M1T_TERM; m11=(int16_t)m_11[1+frame_length]; m10=(int16_t)m_10[1+frame_length]; - // printf("m11,m10 %d,%d\n",m11,m10); +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"m11,m10 %d,%d\n",m11,m10); +#endif beta0_2 = beta0-m11;//+M0T_TERM; beta1_2 = beta0+m11;//+M1T_TERM; @@ -489,8 +509,9 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh beta3_2 = beta1-m10;//+M3T_TERM; m11=(int16_t)m_11[frame_length]; m10=(int16_t)m_10[frame_length]; - // printf("m11,m10 %d,%d (%p)\n",m11,m10,m_11+frame_length); - +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"m11,m10 %d,%d\n",m11,m10); +#endif beta0_16 = beta0_2-m11;//+M0T_TERM; beta1_16 = beta0_2+m11;//+M1T_TERM; beta2_16 = beta1_2+m10;//+M2T_TERM; @@ -536,6 +557,17 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh beta_ptr[5] = alpha128[5+(frame_length)]; beta_ptr[6] = alpha128[6+(frame_length)]; beta_ptr[7] = alpha128[7+(frame_length)]; +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"beta init \n"); + print_shorts("b0",(int16_t*)&beta_ptr[0]); + print_shorts("b1",(int16_t*)&beta_ptr[1]); + print_shorts("b2",(int16_t*)&beta_ptr[2]); + print_shorts("b3",(int16_t*)&beta_ptr[3]); + print_shorts("b4",(int16_t*)&beta_ptr[4]); + print_shorts("b5",(int16_t*)&beta_ptr[5]); + print_shorts("b6",(int16_t*)&beta_ptr[6]); + print_shorts("b7",(int16_t*)&beta_ptr[7]); +#endif } else { #if defined(__x86_64__) || defined(__i386__) beta128 = (__m128i*)&beta[0]; @@ -558,6 +590,17 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh beta_ptr[5] = (int16x8_t)vshrq_n_s64((int64x2_t)beta128[5],16); beta_ptr[5] = vsetq_lane_s16(beta[43],beta_ptr[5],4); beta_ptr[6] = (int16x8_t)vshrq_n_s64((int64x2_t)beta128[6],16); beta_ptr[6] = vsetq_lane_s16(beta[51],beta_ptr[6],4); beta_ptr[7] = (int16x8_t)vshrq_n_s64((int64x2_t)beta128[7],16); beta_ptr[7] = vsetq_lane_s16(beta[59],beta_ptr[7],4); +#endif +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"beta init (second run) \n"); + print_shorts("b0",(int16_t*)&beta_ptr[0]); + print_shorts("b1",(int16_t*)&beta_ptr[1]); + print_shorts("b2",(int16_t*)&beta_ptr[2]); + print_shorts("b3",(int16_t*)&beta_ptr[3]); + print_shorts("b4",(int16_t*)&beta_ptr[4]); + print_shorts("b5",(int16_t*)&beta_ptr[5]); + print_shorts("b6",(int16_t*)&beta_ptr[6]); + print_shorts("b7",(int16_t*)&beta_ptr[7]); #endif } @@ -582,6 +625,17 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh beta_ptr[7] = vsetq_lane_s16(beta7_16,beta_ptr[7],7); #endif +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"beta init (after insert) \n"); + print_shorts("b0",(int16_t*)&beta_ptr[0]); + print_shorts("b1",(int16_t*)&beta_ptr[1]); + print_shorts("b2",(int16_t*)&beta_ptr[2]); + print_shorts("b3",(int16_t*)&beta_ptr[3]); + print_shorts("b4",(int16_t*)&beta_ptr[4]); + print_shorts("b5",(int16_t*)&beta_ptr[5]); + print_shorts("b6",(int16_t*)&beta_ptr[6]); + print_shorts("b7",(int16_t*)&beta_ptr[7]); +#endif int loopval=((rerun_flag==0)?0:((frame_length-L)>>3)); for (k=(frame_length>>3)-1; k>=loopval; k--) { @@ -684,6 +738,18 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh beta_ptr[7] = vqsubq_s16(beta_ptr[7],beta_max); #endif +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"Loop index %d, mb\n",k); + fprintf(fdsse4,"beta init (after max)\n"); + print_shorts("b0",(int16_t*)&beta_ptr[0]); + print_shorts("b1",(int16_t*)&beta_ptr[1]); + print_shorts("b2",(int16_t*)&beta_ptr[2]); + print_shorts("b3",(int16_t*)&beta_ptr[3]); + print_shorts("b4",(int16_t*)&beta_ptr[4]); + print_shorts("b5",(int16_t*)&beta_ptr[5]); + print_shorts("b6",(int16_t*)&beta_ptr[6]); + print_shorts("b7",(int16_t*)&beta_ptr[7]); +#endif } @@ -721,7 +787,7 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext, // #ifdef DEBUG_LOGMAP - msg("compute_ext, %p, %p, %p, %p, %p, %p ,framelength %d\n",alpha,beta,m_11,m_10,ext,systematic,frame_length); + fprintf(fdsse4,"compute_ext (sse_16bit), %p, %p, %p, %p, %p, %p ,framelength %d\n",alpha,beta,m_11,m_10,ext,systematic,frame_length); #endif alpha_ptr = alpha128; @@ -736,7 +802,7 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext, ext_128 = (__m128i*)&ext[k<<3]; /* - printf("EXT %03d\n",k); + fprintf(fdsse4,"EXT %03d\n",k); print_shorts("a0:",&alpha_ptr[0]); print_shorts("a1:",&alpha_ptr[1]); print_shorts("a2:",&alpha_ptr[2]); @@ -816,15 +882,15 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext, // print_shorts("m10_1:",&m10_1); *ext_128 = _mm_subs_epi16(m10_1,m01_1); +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"ext %p\n",ext_128); + print_shorts("ext:",(int16_t*)ext_128); + print_shorts("m11:",(int16_t*)m11_128); + print_shorts("m10:",(int16_t*)m10_128); + print_shorts("m10_1:",(int16_t*)&m10_1); + print_shorts("m01_1:",(int16_t*)&m01_1); +#endif - /* - print_shorts("ext:",ext_128); - print_shorts("m11:",m11_128); - print_shorts("m10:",m10_128); - print_shorts("m10_1:",&m10_1); - print_shorts("m01_1:",&m01_1); - print_shorts("syst:",systematic_128); - */ #elif defined(__arm__) m11_128 = (int16x8_t*)&m_11[k<<3]; m10_128 = (int16x8_t*)&m_10[k<<3]; @@ -927,7 +993,7 @@ void init_td16() // j-=(n-1); pi2tab16[ind][i] = j; - // printf("pi2[%d] = %d\n",i,j); + // fprintf(fdsse4,"pi2[%d] = %d\n",i,j); } } @@ -989,7 +1055,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, #if defined(__x86_64__) || defined(__i386__) __m128i *yp128; __m128i tmp, zeros=_mm_setzero_si128(); - register __m128i tmpe; + __m128i tmpe; #elif defined(__arm__) int16x8_t *yp128; // int16x8_t tmp128[(n+8)>>3]; @@ -1000,12 +1066,20 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, #endif int offset8_flag=0; +#ifdef DEBUG_LOGMAP + fdsse4 = fopen("dump_sse4.txt","w"); + + + printf("tc sse4_16 (y) %p\n",y); +#endif + if (crc_type > 3) { - msg("Illegal crc length!\n"); + printf("Illegal crc length!\n"); return 255; } + start_meas(init_stats); @@ -1013,7 +1087,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, for (iind=0; iind < 188 && f1f2mat[iind].nb_bits != n; iind++); if ( iind == 188 ) { - msg("Illegal frame length!\n"); + printf("Illegal frame length!\n"); return 255; } @@ -1059,62 +1133,74 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, #if defined(__x86_64__) || defined(__i386__) tmpe = _mm_load_si128(yp128); + // fprintf(fdsse4,"yp128 %p\n",yp128); + // print_shorts("tmpe",(int16_t *)&tmpe); s[j] = _mm_extract_epi16(tmpe,0); yp1[j] = _mm_extract_epi16(tmpe,1); yp2[j] = _mm_extract_epi16(tmpe,2); - // printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); - +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"init0: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#endif j=pi2_p[1]; s[j] = _mm_extract_epi16(tmpe,3); yp1[j] = _mm_extract_epi16(tmpe,4); yp2[j] = _mm_extract_epi16(tmpe,5); - // printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); - +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"init1: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#endif j=pi2_p[2]; s[j] = _mm_extract_epi16(tmpe,6); yp1[j] = _mm_extract_epi16(tmpe,7); tmpe = _mm_load_si128(&yp128[1]); yp2[j] = _mm_extract_epi16(tmpe,0); - // printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); - +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"init2: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#endif j=pi2_p[3]; s[j] = _mm_extract_epi16(tmpe,1); yp1[j] = _mm_extract_epi16(tmpe,2); yp2[j] = _mm_extract_epi16(tmpe,3); - // printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); - +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"init3: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#endif j=pi2_p[4]; s[j] = _mm_extract_epi16(tmpe,4); yp1[j] = _mm_extract_epi16(tmpe,5); yp2[j] = _mm_extract_epi16(tmpe,6); - // printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); - +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"init4: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#endif j=pi2_p[5]; s[j] = _mm_extract_epi16(tmpe,7); tmpe = _mm_load_si128(&yp128[2]); yp1[j] = _mm_extract_epi16(tmpe,0); yp2[j] = _mm_extract_epi16(tmpe,1); - // printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"init5: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#endif j=pi2_p[6]; s[j] = _mm_extract_epi16(tmpe,2); yp1[j] = _mm_extract_epi16(tmpe,3); yp2[j] = _mm_extract_epi16(tmpe,4); - // printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); - +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"init6: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#endif j=pi2_p[7]; s[j] = _mm_extract_epi16(tmpe,5); yp1[j] = _mm_extract_epi16(tmpe,6); yp2[j] = _mm_extract_epi16(tmpe,7); - // printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"init7: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#endif #elif defined(__arm__) s[j] = vgetq_lane_s16(yp128[0],0); @@ -1172,7 +1258,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, yp1[i] = *yp; yp++; #ifdef DEBUG_LOGMAP - msg("Term 1 (%d): %d %d\n",i,s[i],yp1[i]); + fprintf(fdsse4,"Term 1 (%d): %d %d\n",i,s[i],yp1[i]); #endif //DEBUG_LOGMAP } @@ -1184,12 +1270,12 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, yp2[i-8] = *yp; yp++; #ifdef DEBUG_LOGMAP - msg("Term 2 (%d): %d %d\n",i-3,s[i],yp2[i-8]); + fprintf(fdsse4,"Term 2 (%d): %d %d\n",i-3,s[i],yp2[i-8]); #endif //DEBUG_LOGMAP } #ifdef DEBUG_LOGMAP - msg("\n"); + fprintf(fdsse4,"\n"); #endif //DEBUG_LOGMAP stop_meas(init_stats); @@ -1201,7 +1287,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, while (iteration_cnt++ < max_iterations) { #ifdef DEBUG_LOGMAP - printf("\n*******************ITERATION %d (n %d), ext %p\n\n",iteration_cnt,n,ext); + fprintf(fdsse4,"\n*******************ITERATION %d (n %d), ext %p\n\n",iteration_cnt,n,ext); #endif //DEBUG_LOGMAP start_meas(intl1_stats); @@ -1209,24 +1295,29 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, pi4_p=pi4tab16[iind]; for (i=0; i<(n>>3); i++) { // steady-state portion + #if defined(__x86_64__) || defined(__i386__) - ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],0); - ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],1); - ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],2); - ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],3); - ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],4); - ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],5); - ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],6); - ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],7); + ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],0); + ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],1); + ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],2); + ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],3); + ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],4); + ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],5); + ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],6); + ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],7); + #elif defined(__arm__) - ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],0); - ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],1); - ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],2); - ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],3); - ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],4); - ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],5); - ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],6); - ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],7); + ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],0); + ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],1); + ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],2); + ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],3); + ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],4); + ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],5); + ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],6); + ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],7); +#endif +#ifdef DEBUG_LOGMAP + print_shorts("syst2",(int16_t*)&((__m128i *)systematic2)[i]); #endif } @@ -1261,6 +1352,9 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, tmp=vsetq_lane_s16(ext2[*pi5_p++],tmp,6); tmp=vsetq_lane_s16(ext2[*pi5_p++],tmp,7); ((int16x8_t *)systematic1)[i] = vqaddq_s16(vqsubq_s16(tmp,((int16x8_t*)ext)[i]),((int16x8_t *)systematic0)[i]); +#endif +#ifdef DEBUG_LOGMAP + print_shorts("syst1",(int16_t*)&((__m128i *)systematic1)[i]); #endif } @@ -1278,6 +1372,9 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, tmp=_mm_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p++],2); tmp=_mm_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p++],1); tmp=_mm_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p++],0); +#ifdef DEBUG_LOGMAP + print_shorts("tmp",(int16_t*)&tmp); +#endif tmp=_mm_cmpgt_epi8(_mm_packs_epi16(tmp,zeros),zeros); decoded_bytes[i]=(unsigned char)_mm_movemask_epi8(tmp); #elif defined(__arm__) @@ -1297,6 +1394,10 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, uint64x2_t Mask = vpaddlq_u32(vpaddlq_u16(vandq_u16(vcgtq_s16(tmp,zeros), Powers))); uint64x1_t Mask64 = vget_high_u64(Mask)+vget_low_u64(Mask); decoded_bytes[i] = (uint8_t)Mask64; +#endif +#ifdef DEBUG_LOGMAP + print_shorts("tmp",(int16_t*)&tmp); + fprintf(fdsse4,"decoded_bytes[%d] %x\n",i,decoded_bytes[i]); #endif } } @@ -1344,6 +1445,9 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, } stop_meas(intl2_stats); +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"oldcrc %x, crc %x\n",oldcrc,crc); +#endif if ((crc == oldcrc) && (crc!=0)) { return(iteration_cnt); @@ -1374,8 +1478,12 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, } } } + + // fprintf(fdsse4,"crc %x, oldcrc %x\n",crc,oldcrc); - // printf("crc %x, oldcrc %x\n",crc,oldcrc); +#ifdef DEBUG_LOGMAP + fclose(fdsse4); +#endif #if defined(__x86_64__) || defined(__i386__) _mm_empty(); diff --git a/openair1/PHY/CODING/defs.h b/openair1/PHY/CODING/defs.h index acb6e8dd29..b14cfb1c24 100644 --- a/openair1/PHY/CODING/defs.h +++ b/openair1/PHY/CODING/defs.h @@ -483,6 +483,24 @@ uint8_t phy_threegpplte_turbo_decoder16(int16_t *y, time_stats_t *intl1_stats, time_stats_t *intl2_stats); +uint8_t phy_threegpplte_turbo_decoder16avx2(int16_t *y, + int16_t *y2, + uint8_t *decoded_bytes, + uint8_t *decoded_bytes2, + uint16_t n, + uint16_t interleaver_f1, + uint16_t interleaver_f2, + uint8_t max_iterations, + uint8_t crc_type, + uint8_t F, + time_stats_t *init_stats, + time_stats_t *alpha_stats, + time_stats_t *beta_stats, + time_stats_t *gamma_stats, + time_stats_t *ext_stats, + time_stats_t *intl1_stats, + time_stats_t *intl2_stats); + /*! \brief This routine performs max-logmap detection for the 3GPP turbo code (with termination). It is optimized for SIMD processing and 8-bit LLR arithmetic, and requires SSE2,SSSE3 and SSE4.1 (gcc >=4.3 and appropriate CPU) diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index da841952e1..2d345f9c8d 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -895,7 +895,9 @@ void phy_init_lte_top(LTE_DL_FRAME_PARMS *lte_frame_parms) init_td8(); init_td16(); - +#ifdef __AVX2__ + init_td16avx2(); +#endif lte_sync_time_init(lte_frame_parms); diff --git a/openair1/PHY/LTE_ESTIMATION/filt96_32.h b/openair1/PHY/LTE_ESTIMATION/filt96_32.h index a29a8c26fb..61225974bc 100644 --- a/openair1/PHY/LTE_ESTIMATION/filt96_32.h +++ b/openair1/PHY/LTE_ESTIMATION/filt96_32.h @@ -26,187 +26,187 @@ Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE *******************************************************************************/ -short filt24_0[24] __attribute__((aligned(16))) ={ +short filt24_0[24] __attribute__((aligned(32))) ={ 2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_0_dcl[24] __attribute__((aligned(16))) ={ +short filt24_0_dcl[24] __attribute__((aligned(32))) ={ 2341,4681,7022,9362,11703,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_0_dcr[24] __attribute__((aligned(16))) ={ +short filt24_0_dcr[24] __attribute__((aligned(32))) ={ 2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_1[24] __attribute__((aligned(16))) ={ +short filt24_1[24] __attribute__((aligned(32))) ={ 0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_1_dcl[24] __attribute__((aligned(16))) ={ +short filt24_1_dcl[24] __attribute__((aligned(32))) ={ 0,4681,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_1_dcr[24] __attribute__((aligned(16))) ={ +short filt24_1_dcr[24] __attribute__((aligned(32))) ={ 0,2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_2[24] __attribute__((aligned(16))) ={ +short filt24_2[24] __attribute__((aligned(32))) ={ 0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_2_dcl[24] __attribute__((aligned(16))) ={ +short filt24_2_dcl[24] __attribute__((aligned(32))) ={ 0,0,2341,4681,7022,9362, 11703,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_2_dcr[24] __attribute__((aligned(16))) ={ +short filt24_2_dcr[24] __attribute__((aligned(32))) ={ 0,0,2730,5461,8192,10922,13653,16384,14043,11703,9362,4681,2341,0,0,0,0,0,0,0,0,0,0,0 }; // X X X Y | X X X X | X Y X X -short filt24_3[24] __attribute__((aligned(16))) ={ +short filt24_3[24] __attribute__((aligned(32))) ={ 0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0 }; -short filt24_3_dcl[24] __attribute__((aligned(16))) ={ +short filt24_3_dcl[24] __attribute__((aligned(32))) ={ 0,0,0,2341,4681,7022,9362,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0 }; // X X X Y | X X DC X X | X Y X X -short filt24_3_dcr[24] __attribute__((aligned(16))) ={ +short filt24_3_dcr[24] __attribute__((aligned(32))) ={ 0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,7022,4681,2341,0,0,0,0,0,0,0,0,0,0 }; -short filt24_4[24] __attribute__((aligned(16))) ={ +short filt24_4[24] __attribute__((aligned(32))) ={ 0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0 }; -short filt24_4_dcl[24] __attribute__((aligned(16))) ={ +short filt24_4_dcl[24] __attribute__((aligned(32))) ={ 0,0,0,0,2341,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0 }; -short filt24_4_dcr[24] __attribute__((aligned(16))) ={ +short filt24_4_dcr[24] __attribute__((aligned(32))) ={ 0,0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,7022,4681,2341,0,0,0,0,0,0,0,0,0 }; -short filt24_5[24] __attribute__((aligned(16))) ={ +short filt24_5[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0 }; // X X X Y | X X DC X X | X Y X X -short filt24_5_dcl[24] __attribute__((aligned(16))) ={ +short filt24_5_dcl[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,2341,4681,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0 }; -short filt24_5_dcr[24] __attribute__((aligned(16))) ={ +short filt24_5_dcr[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,2730,5461,8192,10922,13653,16384,11703,9362,7022,4681,2730,0,0,0,0,0,0,0,0 }; -short filt24_6[24] __attribute__((aligned(16))) ={ +short filt24_6[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0 }; -short filt24_6_dcl[24] __attribute__((aligned(16))) ={ +short filt24_6_dcl[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,4681,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0 }; -short filt24_6_dcr[24] __attribute__((aligned(16))) ={ +short filt24_6_dcr[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0,0 }; -short filt24_7[24] __attribute__((aligned(16))) ={ +short filt24_7[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0 }; -short filt24_7_dcl[24] __attribute__((aligned(16))) ={ +short filt24_7_dcl[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,0,4681,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0 }; -short filt24_7_dcr[24] __attribute__((aligned(16))) ={ +short filt24_7_dcr[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0 }; -short filt24_0l[24] __attribute__((aligned(16))) ={ +short filt24_0l[24] __attribute__((aligned(32))) ={ 30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_1l[24] __attribute__((aligned(16))) ={ +short filt24_1l[24] __attribute__((aligned(32))) ={ 0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_2l[24] __attribute__((aligned(16))) ={ +short filt24_2l[24] __attribute__((aligned(32))) ={ 0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_3l[24] __attribute__((aligned(16))) ={ +short filt24_3l[24] __attribute__((aligned(32))) ={ //0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0}; 0,0,0,0,0,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0 }; -short filt24_4l[24] __attribute__((aligned(16))) ={ +short filt24_4l[24] __attribute__((aligned(32))) ={ 0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0 }; -short filt24_5l[24] __attribute__((aligned(16))) ={ +short filt24_5l[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0 }; -short filt24_6l[24] __attribute__((aligned(16))) ={ +short filt24_6l[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0 }; -short filt24_7l[24] __attribute__((aligned(16))) ={ +short filt24_7l[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0 }; -short filt24_0l2[24] __attribute__((aligned(16))) ={ +short filt24_0l2[24] __attribute__((aligned(32))) ={ 2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_1l2[24] __attribute__((aligned(16))) ={ +short filt24_1l2[24] __attribute__((aligned(32))) ={ 0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_2l2[24] __attribute__((aligned(16))) ={ +short filt24_2l2[24] __attribute__((aligned(32))) ={ -2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_3l2[24] __attribute__((aligned(16))) ={ +short filt24_3l2[24] __attribute__((aligned(32))) ={ -5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0 }; -short filt24_4l2[24] __attribute__((aligned(16))) ={ +short filt24_4l2[24] __attribute__((aligned(32))) ={ -8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0 }; -short filt24_5l2[24] __attribute__((aligned(16))) ={ +short filt24_5l2[24] __attribute__((aligned(32))) ={ 0,-8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0 }; -short filt24_6l2[24] __attribute__((aligned(16))) ={ +short filt24_6l2[24] __attribute__((aligned(32))) ={ -13653,-10922,-8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0 }; -short filt24_7l2[24] __attribute__((aligned(16))) ={ +short filt24_7l2[24] __attribute__((aligned(32))) ={ 0,-13653,-10922,-8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0 }; -short filt24_0r[24] __attribute__((aligned(16))) ={ +short filt24_0r[24] __attribute__((aligned(32))) ={ 2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_1r[24] __attribute__((aligned(16))) ={ +short filt24_1r[24] __attribute__((aligned(32))) ={ 0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_2r[24] __attribute__((aligned(16))) ={ +short filt24_2r[24] __attribute__((aligned(32))) ={ 0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_3r[24] __attribute__((aligned(16))) ={ +short filt24_3r[24] __attribute__((aligned(32))) ={ 0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0 }; -short filt24_4r[24] __attribute__((aligned(16))) ={ +short filt24_4r[24] __attribute__((aligned(32))) ={ 0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0 }; -short filt24_5r[24] __attribute__((aligned(16))) ={ +short filt24_5r[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0 }; -short filt24_6r[24] __attribute__((aligned(16))) ={ +short filt24_6r[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0 }; -short filt24_7r[24] __attribute__((aligned(16))) ={ +short filt24_7r[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0 }; -short filt24_0r2[24] __attribute__((aligned(16))) ={ /****/ +short filt24_0r2[24] __attribute__((aligned(32))) ={ /****/ 2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0,0,0,0 }; -short filt24_1r2[24] __attribute__((aligned(16))) ={ +short filt24_1r2[24] __attribute__((aligned(32))) ={ 0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0,0,0 }; -short filt24_2r2[24] __attribute__((aligned(16))) ={ +short filt24_2r2[24] __attribute__((aligned(32))) ={ 0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0,0 }; -short filt24_3r2[24] __attribute__((aligned(16))) ={ +short filt24_3r2[24] __attribute__((aligned(32))) ={ 0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0 }; -short filt24_4r2[24] __attribute__((aligned(16))) ={ +short filt24_4r2[24] __attribute__((aligned(32))) ={ 0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0 }; -short filt24_5r2[24] __attribute__((aligned(16))) ={ +short filt24_5r2[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0 }; -short filt24_6r2[24] __attribute__((aligned(16))) ={ +short filt24_6r2[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0 }; -short filt24_7r2[24] __attribute__((aligned(16))) ={ +short filt24_7r2[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653 }; diff --git a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c index 9864a50ee2..263bee3dca 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c @@ -52,8 +52,8 @@ int* sync_corr_ue0 = NULL; int* sync_corr_ue1 = NULL; int* sync_corr_ue2 = NULL; -int sync_tmp[2048*4] __attribute__((aligned(16))); -short syncF_tmp[2048*2] __attribute__((aligned(16))); +int sync_tmp[2048*4] __attribute__((aligned(32))); +short syncF_tmp[2048*2] __attribute__((aligned(32))); diff --git a/openair1/PHY/LTE_ESTIMATION/lte_sync_timefreq.c b/openair1/PHY/LTE_ESTIMATION/lte_sync_timefreq.c index 493583214a..74b46c5eb6 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_sync_timefreq.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_sync_timefreq.c @@ -56,8 +56,8 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq) { #if defined(__x86_64__) || defined(__i386__) UE_SCAN_INFO_t *scan_info = &ue->scan_info[band]; - int16_t spectrum[12288] __attribute__((aligned(16))); - int16_t spectrum_p5ms[12288] __attribute__((aligned(16))); + int16_t spectrum[12288] __attribute__((aligned(32))); + int16_t spectrum_p5ms[12288] __attribute__((aligned(32))); int i,f,band_idx; __m128i autocorr0[256/4],autocorr1[256/4],autocorr2[256/4]; __m128i autocorr0_t[256/4],autocorr1_t[256/4],autocorr2_t[256/4]; diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c index ea1bb01ae5..66df9dbb78 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c @@ -186,6 +186,27 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, uint8_t crc_type; #ifdef DEBUG_DLSCH_DECODING uint16_t i; +#endif +#ifdef __AVX2__ + int Kr_last,skipped_last=0; + uint8_t (*tc_2cw)(int16_t *y, + int16_t *y2, + uint8_t *, + uint8_t *, + uint16_t, + uint16_t, + uint16_t, + uint8_t, + uint8_t, + uint8_t, + time_stats_t *, + time_stats_t *, + time_stats_t *, + time_stats_t *, + time_stats_t *, + time_stats_t *, + time_stats_t *); + #endif uint8_t (*tc)(int16_t *y, uint8_t *, @@ -203,6 +224,9 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, time_stats_t *, time_stats_t *); + + + if (!dlsch_llr) { printf("dlsch_decoding.c: NULL dlsch_llr pointer\n"); return(dlsch->max_turbo_iterations); @@ -223,8 +247,12 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, return(dlsch->max_turbo_iterations); } - if (llr8_flag == 0) + if (llr8_flag == 0) { +#ifdef __AVX2__ + tc_2cw = phy_threegpplte_turbo_decoder16avx2; +#endif tc = phy_threegpplte_turbo_decoder16; + } else tc = phy_threegpplte_turbo_decoder8; @@ -300,6 +328,10 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, LOG_E(PHY,"Illegal harq_process->C %d > %d\n",harq_process->C,MAX_NUM_DLSCH_SEGMENTS/bw_scaling); return((1+dlsch->max_turbo_iterations)); } +#ifdef DEBUG_DLSCH_DECODING + printf("Segmentation: C %d, Cminus %d, Kminus %d, Kplus %d\n",harq_process->C,harq_process->Cminus,harq_process->Kminus,harq_process->Kplus); +#endif + for (r=0; rC; r++) { @@ -414,15 +446,11 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, printf("\n"); */ +#ifndef __AVX2__ if (err_flag == 0) { start_meas(dlsch_turbo_decoding_stats); -#ifdef TURBO_S - ret = phy_threegpplte_turbo_decoder_scalar -#else - ret = tc -#endif (&harq_process->d[r][96], harq_process->c[r], Kr, @@ -442,7 +470,130 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, stop_meas(dlsch_turbo_decoding_stats); } +#else + if ((harq_process->C == 1) || + ((r==harq_process->C-1) && (skipped_last==0))) { // last segment with odd number of segments + start_meas(dlsch_turbo_decoding_stats); + ret = tc + (&harq_process->d[r][96], + harq_process->c[r], + Kr, + f1f2mat_old[iind*2], + f1f2mat_old[(iind*2)+1], + dlsch->max_turbo_iterations, + crc_type, + (r==0) ? harq_process->F : 0, + &phy_vars_ue->dlsch_tc_init_stats, + &phy_vars_ue->dlsch_tc_alpha_stats, + &phy_vars_ue->dlsch_tc_beta_stats, + &phy_vars_ue->dlsch_tc_gamma_stats, + &phy_vars_ue->dlsch_tc_ext_stats, + &phy_vars_ue->dlsch_tc_intl1_stats, + &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1); + stop_meas(dlsch_turbo_decoding_stats); + // printf("single decode, exit\n"); + // exit(-1); + } + else { + // we can merge code segments + if ((skipped_last == 0) && (rC-1)) { + skipped_last = 1; + Kr_last = Kr; + } + else { + skipped_last=0; + + if (Kr_last == Kr) { // decode 2 code segments with AVX2 version +#ifdef DEBUG_DLSCH_DECODING + printf("single decoding segment %d (%p)\n",r-1,&harq_process->d[r-1][96]); +#endif + start_meas(dlsch_turbo_decoding_stats); +#ifdef DEBUG_DLSCH_DECODING + printf("double decoding segments %d,%d (%p,%p)\n",r-1,r,&harq_process->d[r-1][96],&harq_process->d[r][96]); +#endif + ret = tc_2cw + (&harq_process->d[r-1][96], + &harq_process->d[r][96], + harq_process->c[r-1], + harq_process->c[r], + Kr, + f1f2mat_old[iind*2], + f1f2mat_old[(iind*2)+1], + dlsch->max_turbo_iterations, + crc_type, + (r==0) ? harq_process->F : 0, + &phy_vars_ue->dlsch_tc_init_stats, + &phy_vars_ue->dlsch_tc_alpha_stats, + &phy_vars_ue->dlsch_tc_beta_stats, + &phy_vars_ue->dlsch_tc_gamma_stats, + &phy_vars_ue->dlsch_tc_ext_stats, + &phy_vars_ue->dlsch_tc_intl1_stats, + &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1); + /* + ret = tc + (&harq_process->d[r-1][96], + harq_process->c[r-1], + Kr_last, + f1f2mat_old[iind*2], + f1f2mat_old[(iind*2)+1], + dlsch->max_turbo_iterations, + crc_type, + (r==0) ? harq_process->F : 0, + &phy_vars_ue->dlsch_tc_init_stats, + &phy_vars_ue->dlsch_tc_alpha_stats, + &phy_vars_ue->dlsch_tc_beta_stats, + &phy_vars_ue->dlsch_tc_gamma_stats, + &phy_vars_ue->dlsch_tc_ext_stats, + &phy_vars_ue->dlsch_tc_intl1_stats, + &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1); + + exit(-1);*/ + stop_meas(dlsch_turbo_decoding_stats); + } + else { // Kr_last != Kr + start_meas(dlsch_turbo_decoding_stats); + ret = tc + (&harq_process->d[r-1][96], + harq_process->c[r-1], + Kr_last, + f1f2mat_old[iind*2], + f1f2mat_old[(iind*2)+1], + dlsch->max_turbo_iterations, + crc_type, + (r==0) ? harq_process->F : 0, + &phy_vars_ue->dlsch_tc_init_stats, + &phy_vars_ue->dlsch_tc_alpha_stats, + &phy_vars_ue->dlsch_tc_beta_stats, + &phy_vars_ue->dlsch_tc_gamma_stats, + &phy_vars_ue->dlsch_tc_ext_stats, + &phy_vars_ue->dlsch_tc_intl1_stats, + &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1); + stop_meas(dlsch_turbo_decoding_stats); + + start_meas(dlsch_turbo_decoding_stats); + ret = tc + (&harq_process->d[r][96], + harq_process->c[r], + Kr, + f1f2mat_old[iind*2], + f1f2mat_old[(iind*2)+1], + dlsch->max_turbo_iterations, + crc_type, + (r==0) ? harq_process->F : 0, + &phy_vars_ue->dlsch_tc_init_stats, + &phy_vars_ue->dlsch_tc_alpha_stats, + &phy_vars_ue->dlsch_tc_beta_stats, + &phy_vars_ue->dlsch_tc_gamma_stats, + &phy_vars_ue->dlsch_tc_ext_stats, + &phy_vars_ue->dlsch_tc_intl1_stats, + &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1); + stop_meas(dlsch_turbo_decoding_stats); + + } + } + } +#endif if ((err_flag == 0) && (ret>=(1+dlsch->max_turbo_iterations))) {// a Code segment is in error so break; diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 165f2fbac6..e056fa7f7d 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -79,9 +79,9 @@ extern int exit_openair; //extern void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms); -unsigned char dlsch_input_buffer[2700] __attribute__ ((aligned(16))); -int eNB_sync_buffer0[640*6] __attribute__ ((aligned(16))); -int eNB_sync_buffer1[640*6] __attribute__ ((aligned(16))); +unsigned char dlsch_input_buffer[2700] __attribute__ ((aligned(32))); +int eNB_sync_buffer0[640*6] __attribute__ ((aligned(32))); +int eNB_sync_buffer1[640*6] __attribute__ ((aligned(32))); int *eNB_sync_buffer[2] = {eNB_sync_buffer0, eNB_sync_buffer1}; extern uint16_t hundred_times_log10_NPRB[100]; From b14a2212fda1cff45267144085a1faad437ea8b8 Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 5 Jan 2016 11:38:39 +0100 Subject: [PATCH 031/214] Correct timming issues --- openair3/TEST/EPC_TEST/play_scenario.c | 100 +++++++++--------- openair3/TEST/EPC_TEST/play_scenario_fsm.c | 2 +- .../EPC_TEST/play_scenario_s1ap_compare_ie.c | 18 ++-- 3 files changed, 60 insertions(+), 60 deletions(-) diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index e7cb8ef848..c633cedfa7 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -921,58 +921,56 @@ int et_play_scenario(et_scenario_t* const scenario, const struct shift_packet_s shift = shift->next; } // now recompute time_relative_to_last_received_packet, time_relative_to_last_sent_packet - if (shifts) { - packet = scenario->list_packet; - while (packet) { - if (first_packet > 0) { - initial_time = packet->time_relative_to_first_packet; - packet->time_relative_to_first_packet.tv_sec = 0; - packet->time_relative_to_first_packet.tv_usec = 0; - first_packet = 0; - } else { - timersub(&packet->time_relative_to_first_packet, &initial_time, - &packet->time_relative_to_first_packet); - } - if (packet->action == ET_PACKET_ACTION_S1C_SEND) { - if (first_sent_packet > 0) { - relative_last_sent_packet = packet->time_relative_to_first_packet; - packet->time_relative_to_last_sent_packet.tv_sec = 0; - packet->time_relative_to_last_sent_packet.tv_usec = 0; - first_sent_packet = 0; - } else { - timersub(&packet->time_relative_to_first_packet, &relative_last_sent_packet, - &packet->time_relative_to_last_sent_packet); - relative_last_sent_packet = packet->time_relative_to_first_packet; - } - if (first_received_packet > 0) { - packet->time_relative_to_last_received_packet.tv_sec = 0; - packet->time_relative_to_last_received_packet.tv_usec = 0; - } else { - timersub(&packet->time_relative_to_first_packet, &relative_last_received_packet, - &packet->time_relative_to_last_received_packet); - } - } else if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { - if (first_received_packet > 0) { - relative_last_received_packet.tv_sec = packet->time_relative_to_first_packet.tv_sec; - relative_last_received_packet.tv_usec = packet->time_relative_to_first_packet.tv_usec; - packet->time_relative_to_last_received_packet.tv_sec = 0; - packet->time_relative_to_last_received_packet.tv_usec = 0; - first_received_packet = 0; - } else { - timersub(&packet->time_relative_to_first_packet, &relative_last_received_packet, - &packet->time_relative_to_last_received_packet); - relative_last_received_packet = packet->time_relative_to_first_packet; - } - if (first_sent_packet > 0) { - packet->time_relative_to_last_sent_packet.tv_sec = 0; - packet->time_relative_to_last_sent_packet.tv_usec = 0; - } else { - timersub(&packet->time_relative_to_first_packet, &relative_last_sent_packet, - &packet->time_relative_to_last_sent_packet); - } - } - packet = packet->next; + packet = scenario->list_packet; + while (packet) { + if (first_packet > 0) { + initial_time = packet->time_relative_to_first_packet; + packet->time_relative_to_first_packet.tv_sec = 0; + packet->time_relative_to_first_packet.tv_usec = 0; + first_packet = 0; + } else { + timersub(&packet->time_relative_to_first_packet, &initial_time, + &packet->time_relative_to_first_packet); } + if (packet->action == ET_PACKET_ACTION_S1C_SEND) { + if (first_sent_packet > 0) { + relative_last_sent_packet = packet->time_relative_to_first_packet; + packet->time_relative_to_last_sent_packet.tv_sec = 0; + packet->time_relative_to_last_sent_packet.tv_usec = 0; + first_sent_packet = 0; + } else { + timersub(&packet->time_relative_to_first_packet, &relative_last_sent_packet, + &packet->time_relative_to_last_sent_packet); + relative_last_sent_packet = packet->time_relative_to_first_packet; + } + if (first_received_packet > 0) { + packet->time_relative_to_last_received_packet.tv_sec = 0; + packet->time_relative_to_last_received_packet.tv_usec = 0; + } else { + timersub(&packet->time_relative_to_first_packet, &relative_last_received_packet, + &packet->time_relative_to_last_received_packet); + } + } else if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { + if (first_received_packet > 0) { + relative_last_received_packet.tv_sec = packet->time_relative_to_first_packet.tv_sec; + relative_last_received_packet.tv_usec = packet->time_relative_to_first_packet.tv_usec; + packet->time_relative_to_last_received_packet.tv_sec = 0; + packet->time_relative_to_last_received_packet.tv_usec = 0; + first_received_packet = 0; + } else { + timersub(&packet->time_relative_to_first_packet, &relative_last_received_packet, + &packet->time_relative_to_last_received_packet); + relative_last_received_packet = packet->time_relative_to_first_packet; + } + if (first_sent_packet > 0) { + packet->time_relative_to_last_sent_packet.tv_sec = 0; + packet->time_relative_to_last_sent_packet.tv_usec = 0; + } else { + timersub(&packet->time_relative_to_first_packet, &relative_last_sent_packet, + &packet->time_relative_to_last_sent_packet); + } + } + packet = packet->next; } et_display_scenario(scenario); diff --git a/openair3/TEST/EPC_TEST/play_scenario_fsm.c b/openair3/TEST/EPC_TEST/play_scenario_fsm.c index 5dee83afc9..d253e5cd5f 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_fsm.c +++ b/openair3/TEST/EPC_TEST/play_scenario_fsm.c @@ -135,7 +135,7 @@ void et_scenario_schedule_tx_packet(et_packet_t * packet) } else { LOG_D(ENB_APP, "last_packet_was_tx\n"); we_are_too_late = timeval_subtract(&offset,&offset_last_tx_packet,&packet->time_relative_to_last_sent_packet); - LOG_D(ENB_APP, "we_are_too_early=%d, offset=%ld.%06d\n", we_are_too_late, offset.tv_sec, offset.tv_usec); + LOG_D(ENB_APP, "we_are_too_late=%d, offset=%ld.%06d\n", we_are_too_late, offset.tv_sec, offset.tv_usec); } if ((0 == we_are_too_late) && (0 == g_max_speed)){ // set timer diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c index ad720ab7dc..2242a63bd6 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c @@ -494,10 +494,11 @@ void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, con const xmlChar value_d[32]; const xmlChar value_h[20]; const xmlChar showname[64]; - int ret = 0; - int pos2 = 0; - char val = NULL; - char hex[3] = {0,0,0};; + int ret = 0; + int pos2 = 0; + unsigned long int uli = 0; + char hex[3] = {0,0,0}; + char *end_ptr = NULL; size = strtoul((const char *)xml_char, NULL, 0); xmlFree(xml_char); @@ -518,10 +519,11 @@ void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, con do { hex[0] = value_h[pos2++]; hex[1] = value_h[pos2++]; - hex[2] = 0; - val = (unsigned char)strtoul(hex, NULL, 16); - AssertFatal(errno != 0, "Conversion of hexstring %s failed", hex); - s1ap->binary_stream[pos++] = val; + hex[2] = '\0'; + end_ptr = hex; + uli = strtoul(hex, &end_ptr, 16); + AssertFatal((uli != ULONG_MAX) && (end_ptr != NULL) && (*end_ptr == '\0'), "Conversion of hexstring %s failed returned %ld errno %d", hex, uli, errno); + s1ap->binary_stream[pos++] = (unsigned char)uli; } while (pos2 < (2*5)); // update ASN1 et_decode_s1ap(s1ap); From 015187e578721a3300bc313406f1aa5b8058d035 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sat, 23 Jan 2016 08:59:36 -0800 Subject: [PATCH 032/214] AVX2 optimization activated for gamma computation in 16-bit turbo decoder (single-codeword) --- cmake_targets/CMakeLists.txt | 2 +- openair1/PHY/CODING/3gpplte_sse.c | 1 + .../CODING/3gpplte_turbo_decoder_avx2_16bit.c | 140 +++++++----- .../CODING/3gpplte_turbo_decoder_sse_16bit.c | 199 ++++++++++++++++-- openair1/PHY/LTE_REFSIG/lte_gold.c | 6 +- openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c | 3 +- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 10 +- 7 files changed, 286 insertions(+), 75 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 8fc2f4fd09..d162337ee8 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -134,7 +134,7 @@ else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l") set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2") endif() if (CPUINFO MATCHES "sse4_2") - set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2 -msse4.2") + set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2 -msse4.2 -fno-tree-vectorize") endif() if (CPUINFO MATCHES "sse4_1") set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1") diff --git a/openair1/PHY/CODING/3gpplte_sse.c b/openair1/PHY/CODING/3gpplte_sse.c index e486c8e0b4..ac4a1ae353 100755 --- a/openair1/PHY/CODING/3gpplte_sse.c +++ b/openair1/PHY/CODING/3gpplte_sse.c @@ -223,6 +223,7 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns 0b00000001}; #endif + #ifndef __AVX2__ if ((n&15) > 0) loop++; diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c index 11720087ee..75e8eaf126 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c @@ -186,12 +186,16 @@ void compute_alpha16avx2(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,uint16 __m256i new0,new1,new2,new3,new4,new5,new6,new7; __m256i alpha_max; + unsigned long long timein,timeout; + l2 = L>>3; K1 = (frame_length>>3); #ifdef DEBUG_LOGMAP fprintf(fdavx2,"Compute alpha (avx2_16bit)\n"); fprintf(fdavx2b,"Compute alpha (avx2_16bit)\n"); #endif + timein = rdtsc_oai(); + for (l=K1;; l=l2,rerun_flag=1) { alpha128 = (__m256i *)alpha; @@ -378,6 +382,9 @@ void compute_alpha16avx2(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,uint16 if (rerun_flag==1) break; } + timeout = rdtsc_oai(); + printf("alpha: inner loop time %llu\n",timeout-timein); + } @@ -386,9 +393,10 @@ void compute_beta16avx2(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,uint16_ int k,rerun_flag=0; - __m256i m11_128,m10_128; - __m256i m_b0,m_b1,m_b2,m_b3,m_b4,m_b5,m_b6,m_b7; - __m256i new0,new1,new2,new3,new4,new5,new6,new7; + __m256i *m11p,*m10p; + register __m256i b0,b1,b2,b3,b4,b5,b6,b7; + register __m256i m_b0,m_b1,m_b2,m_b3,m_b4,m_b5,m_b6,m_b7; + register __m256i new0,new1,new2,new3,new4,new5,new6,new7; __m256i *beta128,*alpha128,*beta_ptr; __m256i beta_max; @@ -398,6 +406,8 @@ void compute_beta16avx2(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,uint16_ llr_t beta0,beta1; llr_t beta0_cw2,beta1_cw2; + unsigned long long timein,timeout; + #ifdef DEBUG_LOGMAP fprintf(fdavx2,"compute_beta (avx2_16bit), %p,%p,%p,%p,framelength %d,F %d\n", beta,m_11,m_10,alpha,frame_length,F); @@ -590,56 +600,74 @@ void compute_beta16avx2(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,uint16_ #endif int loopval=((rerun_flag==0)?0:((frame_length-L)>>3)); + printf("beta: rerun %d => loopval %d\n",rerun_flag,loopval); + + timein = rdtsc_oai(); + + m11p = (frame_length>>3)-1+(__m256i*)m_11; + m10p = (frame_length>>3)-1+(__m256i*)m_10; + for (k=(frame_length>>3)-1; k>=loopval; k--) { - m11_128=((__m256i*)m_11)[k]; - m10_128=((__m256i*)m_10)[k]; + + b4 = _mm256_load_si256(&beta_ptr[4]); + b5 = _mm256_load_si256(&beta_ptr[5]); + b6 = _mm256_load_si256(&beta_ptr[6]); + b7 = _mm256_load_si256(&beta_ptr[7]); - m_b0 = _mm256_adds_epi16(beta_ptr[4],m11_128); //m11 - m_b1 = _mm256_subs_epi16(beta_ptr[4],m11_128); //m00 - m_b2 = _mm256_subs_epi16(beta_ptr[5],m10_128); //m01 - m_b3 = _mm256_adds_epi16(beta_ptr[5],m10_128); //m10 - m_b4 = _mm256_adds_epi16(beta_ptr[6],m10_128); //m10 - m_b5 = _mm256_subs_epi16(beta_ptr[6],m10_128); //m01 - m_b6 = _mm256_subs_epi16(beta_ptr[7],m11_128); //m00 - m_b7 = _mm256_adds_epi16(beta_ptr[7],m11_128); //m11 + m_b0 = _mm256_adds_epi16(b4,*m11p); //m11 + m_b1 = _mm256_subs_epi16(b4,*m11p); //m00 + m_b2 = _mm256_subs_epi16(b5,*m10p); //m01 + m_b3 = _mm256_adds_epi16(b5,*m10p); //m10 + m_b4 = _mm256_adds_epi16(b6,*m10p); //m10 + m_b5 = _mm256_subs_epi16(b6,*m10p); //m01 + m_b6 = _mm256_subs_epi16(b7,*m11p); //m00 + m_b7 = _mm256_adds_epi16(b7,*m11p); //m11 - new0 = _mm256_subs_epi16(beta_ptr[0],m11_128); //m00 - new1 = _mm256_adds_epi16(beta_ptr[0],m11_128); //m11 - new2 = _mm256_adds_epi16(beta_ptr[1],m10_128); //m10 - new3 = _mm256_subs_epi16(beta_ptr[1],m10_128); //m01 - new4 = _mm256_subs_epi16(beta_ptr[2],m10_128); //m01 - new5 = _mm256_adds_epi16(beta_ptr[2],m10_128); //m10 - new6 = _mm256_adds_epi16(beta_ptr[3],m11_128); //m11 - new7 = _mm256_subs_epi16(beta_ptr[3],m11_128); //m00 + b0 = _mm256_load_si256(&beta_ptr[0]); + b1 = _mm256_load_si256(&beta_ptr[1]); + b2 = _mm256_load_si256(&beta_ptr[2]); + b3 = _mm256_load_si256(&beta_ptr[3]); + + new0 = _mm256_subs_epi16(b0,*m11p); //m00 + new1 = _mm256_adds_epi16(b0,*m11p); //m11 + new2 = _mm256_adds_epi16(b1,*m10p); //m10 + new3 = _mm256_subs_epi16(b1,*m10p); //m01 + new4 = _mm256_subs_epi16(b2,*m10p); //m01 + new5 = _mm256_adds_epi16(b2,*m10p); //m10 + new6 = _mm256_adds_epi16(b3,*m11p); //m11 + new7 = _mm256_subs_epi16(b3,*m11p); //m00 + + + b0 = _mm256_max_epi16(m_b0,new0); + b1 = _mm256_max_epi16(m_b1,new1); + b2 = _mm256_max_epi16(m_b2,new2); + b3 = _mm256_max_epi16(m_b3,new3); + b4 = _mm256_max_epi16(m_b4,new4); + b5 = _mm256_max_epi16(m_b5,new5); + b6 = _mm256_max_epi16(m_b6,new6); + b7 = _mm256_max_epi16(m_b7,new7); + + beta_max = _mm256_max_epi16(b0,b1); + beta_max = _mm256_max_epi16(beta_max ,b2); + beta_max = _mm256_max_epi16(beta_max ,b3); + beta_max = _mm256_max_epi16(beta_max ,b4); + beta_max = _mm256_max_epi16(beta_max ,b5); + beta_max = _mm256_max_epi16(beta_max ,b6); + beta_max = _mm256_max_epi16(beta_max ,b7); beta_ptr-=8; + m11p--; + m10p--; - beta_ptr[0] = _mm256_max_epi16(m_b0,new0); - beta_ptr[1] = _mm256_max_epi16(m_b1,new1); - beta_ptr[2] = _mm256_max_epi16(m_b2,new2); - beta_ptr[3] = _mm256_max_epi16(m_b3,new3); - beta_ptr[4] = _mm256_max_epi16(m_b4,new4); - beta_ptr[5] = _mm256_max_epi16(m_b5,new5); - beta_ptr[6] = _mm256_max_epi16(m_b6,new6); - beta_ptr[7] = _mm256_max_epi16(m_b7,new7); - - beta_max = _mm256_max_epi16(beta_ptr[0],beta_ptr[1]); - beta_max = _mm256_max_epi16(beta_max ,beta_ptr[2]); - beta_max = _mm256_max_epi16(beta_max ,beta_ptr[3]); - beta_max = _mm256_max_epi16(beta_max ,beta_ptr[4]); - beta_max = _mm256_max_epi16(beta_max ,beta_ptr[5]); - beta_max = _mm256_max_epi16(beta_max ,beta_ptr[6]); - beta_max = _mm256_max_epi16(beta_max ,beta_ptr[7]); - - beta_ptr[0] = _mm256_subs_epi16(beta_ptr[0],beta_max); - beta_ptr[1] = _mm256_subs_epi16(beta_ptr[1],beta_max); - beta_ptr[2] = _mm256_subs_epi16(beta_ptr[2],beta_max); - beta_ptr[3] = _mm256_subs_epi16(beta_ptr[3],beta_max); - beta_ptr[4] = _mm256_subs_epi16(beta_ptr[4],beta_max); - beta_ptr[5] = _mm256_subs_epi16(beta_ptr[5],beta_max); - beta_ptr[6] = _mm256_subs_epi16(beta_ptr[6],beta_max); - beta_ptr[7] = _mm256_subs_epi16(beta_ptr[7],beta_max); + beta_ptr[0] = _mm256_subs_epi16(b0,beta_max); + beta_ptr[1] = _mm256_subs_epi16(b1,beta_max); + beta_ptr[2] = _mm256_subs_epi16(b2,beta_max); + beta_ptr[3] = _mm256_subs_epi16(b3,beta_max); + beta_ptr[4] = _mm256_subs_epi16(b4,beta_max); + beta_ptr[5] = _mm256_subs_epi16(b5,beta_max); + beta_ptr[6] = _mm256_subs_epi16(b6,beta_max); + beta_ptr[7] = _mm256_subs_epi16(b7,beta_max); #ifdef DEBUG_LOGMAP fprintf(fdavx2,"Loop index %d, mb\n",k); @@ -658,6 +686,8 @@ void compute_beta16avx2(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,uint16_ #endif } + timeout = rdtsc_oai(); + printf("beta: inner loop time %llu\n",timeout-timein); if (rerun_flag==1) break; @@ -968,7 +998,7 @@ unsigned char phy_threegpplte_turbo_decoder16avx2(int16_t *y, yp2 = yparity2; - +#if 0 for (i=0; i>3; +#else + if ((frame_length&15) > 0) + K1=(frame_length+1)>>4; + else + K1=frame_length>>4; +#endif for (k=0; k>3; // Termination #if defined(__x86_64__) || defined(__i386__) m11_128[k] = _mm_srai_epi16(_mm_adds_epi16(systematic128[k+term_flag],y_parity128[k]),1); + //#ifndef __AVX2__ +#if 1 m10_128[k] = _mm_srai_epi16(_mm_subs_epi16(systematic128[k+term_flag],y_parity128[k]),1); +#else + m10_128[k] = _mm_srai_epi16(_mm_subs_epi16(y_parity128[k],systematic128[k+term_flag]),1); +#endif #elif defined(__arm__) m11_128[k] = vhaddq_s16(systematic128[k+term_flag],y_parity128[k]); -m10_128[k] = vhsubq_s16(systematic128[k+term_flag],y_parity128[k]); + m10_128[k] = vhsubq_s16(systematic128[k+term_flag],y_parity128[k]); #endif #ifdef DEBUG_LOGMAP @@ -188,11 +207,21 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s { int k,l,l2,K1,rerun_flag=0; #if defined(__x86_64__) || defined(__i386__) - __m128i *alpha128=(__m128i *)alpha,*alpha_ptr; - __m128i a0,a1,a2,a3,a4,a5,a6,a7,*m11p,*m10p; + __m128i *alpha128=(__m128i *)alpha,*alpha_ptr,*m11p,*m10p; + //#ifndef __AVX2__ +#if 1 + __m128i a0,a1,a2,a3,a4,a5,a6,a7; __m128i m_b0,m_b1,m_b2,m_b3,m_b4,m_b5,m_b6,m_b7; __m128i new0,new1,new2,new3,new4,new5,new6,new7; __m128i alpha_max; +#else + __m256i *alpha256=(__m256i *)alpha,*alpha_ptr256,m11,m10; + __m256i a01,a23,a45,a67,a02,a13,a64,a75; + __m256i m_b01,m_b23,m_b45,m_b67,new01,new23,new45,new67; + __m256i m11m10_256; + __m256i alpha_max; +#endif + #elif defined(__arm__) int16x8_t *alpha128=(int16x8_t *)alpha,*alpha_ptr; int16x8_t a0,a1,a2,a3,a4,a5,a6,a7,*m11p,*m10p; @@ -208,6 +237,10 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s for (l=K1;; l=l2,rerun_flag=1) { #if defined(__x86_64__) || defined(__i386__) alpha128 = (__m128i *)alpha; + //#ifdef __AVX2__ +#if 0 + alpha256 = (__m256i *)alpha; +#endif #elif defined(__arm__) alpha128 = (int16x8_t *)alpha; #endif @@ -288,6 +321,11 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s } alpha_ptr = &alpha128[0]; + //#ifdef __AVX2__ +#if 0 + alpha_ptr256 = &alpha256[0]; +#endif + #if defined(__x86_64__) || defined(__i386__) m11p = (__m128i*)m_11; m10p = (__m128i*)m_10; @@ -300,6 +338,8 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s k++) { #if defined(__x86_64__) || defined(__i386__) + //#ifndef __AVX2__ +#if 1 a1=_mm_load_si128(&alpha_ptr[1]); a3=_mm_load_si128(&alpha_ptr[3]); a5=_mm_load_si128(&alpha_ptr[5]); @@ -344,6 +384,37 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s alpha_max = _mm_max_epi16(alpha_max,a5); alpha_max = _mm_max_epi16(alpha_max,a6); alpha_max = _mm_max_epi16(alpha_max,a7); +#else + a02=_mm256_load_si256(&alpha_ptr256[0]); + a13=_mm256_load_si256(&alpha_ptr256[1]); + a64=_mm256_load_si256(&alpha_ptr256[2]); + a75=_mm256_load_si256(&alpha_ptr256[3]); + m11m10_256 = _mm256_insertf128_si256(m11m10_256,*m11p,0); + m11m10_256 = _mm256_insertf128_si256(m11m10_256,*m10p,1); + + + m_b01 = _mm256_adds_epi16(a13,m11m10_256); //negative m10 + m_b23 = _mm256_subs_epi16(a75,m11m10_256); //negative m10 + m_b45 = _mm256_subs_epi16(a13,m11m10_256); //negative m10 + m_b67 = _mm256_adds_epi16(a75,m11m10_256); //negative m10 + + new01 = _mm256_subs_epi16(a02,m11m10_256); //negative m10 + new23 = _mm256_adds_epi16(a64,m11m10_256); //negative m10 + new45 = _mm256_adds_epi16(a02,m11m10_256); //negative m10 + new67 = _mm256_subs_epi16(a64,m11m10_256); //negative m10 + + a01 = _mm256_max_epi16(m_b01,new01); + a23 = _mm256_max_epi16(m_b23,new23); + a45 = _mm256_max_epi16(m_b45,new45); + a67 = _mm256_max_epi16(m_b67,new67); + + alpha_max = _mm256_max_epi16(a01,a23); + alpha_max = _mm256_max_epi16(alpha_max,a45); + alpha_max = _mm256_max_epi16(alpha_max,a67); + alpha_max = _mm256_max_epi16(alpha_max,_mm256_permutevar8x32_epi32(alpha_max,_mm256_set_epi32(3,2,1,0,7,6,5,4))); + + +#endif #elif defined(__arm__) m_b0 = vqaddq_s16(alpha_ptr[1],*m11p); // m11 m_b4 = vqsubq_s16(alpha_ptr[1],*m11p); // m00=-m11 @@ -383,9 +454,15 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s #endif alpha_ptr+=8; + //#ifdef __AVX2__ +#if 0 + alpha_ptr256+=4; +#endif m11p++; m10p++; #if defined(__x86_64__) || defined(__i386__) + //#ifndef __AVX2__ +#if 1 alpha_ptr[0] = _mm_subs_epi16(a0,alpha_max); alpha_ptr[1] = _mm_subs_epi16(a1,alpha_max); alpha_ptr[2] = _mm_subs_epi16(a2,alpha_max); @@ -394,6 +471,18 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s alpha_ptr[5] = _mm_subs_epi16(a5,alpha_max); alpha_ptr[6] = _mm_subs_epi16(a6,alpha_max); alpha_ptr[7] = _mm_subs_epi16(a7,alpha_max); +#else + + a01 = _mm256_subs_epi16(a01,alpha_max); + a23 = _mm256_subs_epi16(a23,alpha_max); + a45 = _mm256_subs_epi16(a45,alpha_max); + a67 = _mm256_subs_epi16(a67,alpha_max); + + alpha_ptr256[0] = _mm256_permute2x128_si256(a01,a23,0x20); //a02 + alpha_ptr256[1] = _mm256_permute2x128_si256(a01,a23,0x13); //a13 + alpha_ptr256[2] = _mm256_permute2x128_si256(a45,a67,0x02); //a64 + alpha_ptr256[3] = _mm256_permute2x128_si256(a45,a67,0x31); //a75 +#endif #elif defined(__arm__) alpha_ptr[0] = vqsubq_s16(a0,alpha_max); alpha_ptr[1] = vqsubq_s16(a1,alpha_max); @@ -488,8 +577,12 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh // fprintf(fdsse4,"beta init: offset8 %d\n",offset8_flag); m11=(int16_t)m_11[2+frame_length]; + //#ifndef __AVX2__ +#if 1 m10=(int16_t)m_10[2+frame_length]; - +#else + m10=-(int16_t)m_10[2+frame_length]; +#endif #ifdef DEBUG_LOGMAP fprintf(fdsse4,"m11,m10 %d,%d\n",m11,m10); #endif @@ -643,6 +736,9 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh m11_128=((__m128i*)m_11)[k]; m10_128=((__m128i*)m_10)[k]; + + //#ifndef __AVX2__ +#if 1 m_b0 = _mm_adds_epi16(beta_ptr[4],m11_128); //m11 m_b1 = _mm_subs_epi16(beta_ptr[4],m11_128); //m00 m_b2 = _mm_subs_epi16(beta_ptr[5],m10_128); //m01 @@ -652,6 +748,7 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh m_b6 = _mm_subs_epi16(beta_ptr[7],m11_128); //m00 m_b7 = _mm_adds_epi16(beta_ptr[7],m11_128); //m11 + new0 = _mm_subs_epi16(beta_ptr[0],m11_128); //m00 new1 = _mm_adds_epi16(beta_ptr[0],m11_128); //m11 new2 = _mm_adds_epi16(beta_ptr[1],m10_128); //m10 @@ -661,8 +758,29 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh new6 = _mm_adds_epi16(beta_ptr[3],m11_128); //m11 new7 = _mm_subs_epi16(beta_ptr[3],m11_128); //m00 +#else + b01=_mm256_load_si256(&((_m256i*)beta_ptr)[0]); + b23=_mm256_load_si256(&((_m256i*)beta_ptr)[1]); + b45=_mm256_load_si256(&((_m256i*)beta_ptr)[2]); + b67=_mm256_load_si256(&((_m256i*)beta_ptr)[3]); + m11m10_256 = _mm256_insertf128_si256(m11m10_256,m11_128,0); + m11m10_256 = _mm256_insertf128_si256(m11m10_256,m10_128,1); + + + m_b02 = _mm256_adds_epi16(b45,m11m10_256); //negative m10 + m_b13 = _mm256_subs_epi16(b45,m11m10_256); //negative m10 + m_b64 = _mm256_subs_epi16(b67,m11m10_256); //negative m10 + m_b75 = _mm256_adds_epi16(b67,m11m10_256); //negative m10 + new02 = _mm256_subs_epi16(b01,m11m10_256); //negative m10 + new13 = _mm256_adds_epi16(b01,m11m10_256); //negative m10 + new64 = _mm256_adds_epi16(b23,m11m10_256); //negative m10 + new75 = _mm256_subs_epi16(b24,m11m10_256); //negative m10 +#endif + beta_ptr-=8; + //#ifndef __AVX2__ +#if 1 beta_ptr[0] = _mm_max_epi16(m_b0,new0); beta_ptr[1] = _mm_max_epi16(m_b1,new1); beta_ptr[2] = _mm_max_epi16(m_b2,new2); @@ -688,6 +806,28 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh beta_ptr[5] = _mm_subs_epi16(beta_ptr[5],beta_max); beta_ptr[6] = _mm_subs_epi16(beta_ptr[6],beta_max); beta_ptr[7] = _mm_subs_epi16(beta_ptr[7],beta_max); +#else + b02 = _mm256_max_epi16(m_b02,new02); + b13 = _mm256_max_epi16(m_b13,new13); + b64 = _mm256_max_epi16(m_b64,new64); + b75 = _mm256_max_epi16(m_b75,new75); + + beta_max = _mm256_max_epi16(b02,b13); + beta_max = _mm256_max_epi16(beta_max,b64); + beta_max = _mm256_max_epi16(beta_max,b75); + beta_max = _mm256_max_epi16(beta_max,_mm256_permutevar8x32_epi32(betaa_max,_mm256_set_epi32(3,2,1,0,7,6,5,4))); + + b02 = _mm256_subs_epi16(b02,beta_max); + b13 = _mm256_subs_epi16(b13,beta_max); + b64 = _mm256_subs_epi16(b64,beta_max); + b75 = _mm256_subs_epi16(b75,beta_max); + + ((_m256i*)beta_ptr)[0]) = _mm256_permute2x128_si256(b02,b13,0x02); //b01 + ((_m256i*)beta_ptr)[1]) = _mm256_permute2x128_si256(b02,b13,0x31); //b23 + ((_m256i*)beta_ptr)[2]) = _mm256_permute2x128_si256(b64,b75,0x13); //b45 + ((_m256i*)beta_ptr)[3]) = _mm256_permute2x128_si256(b64,b75,0x20); //b67 +#endif + #elif defined(__arm__) m11_128=((int16x8_t*)m_11)[k]; m10_128=((int16x8_t*)m_10)[k]; @@ -820,6 +960,9 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext, print_shorts("b6:",&beta_ptr[6]); print_shorts("b7:",&beta_ptr[7]); */ + + //#ifndef __AVX2__ +#if 1 m00_4 = _mm_adds_epi16(alpha_ptr[7],beta_ptr[3]); //ALPHA_BETA_4m00; m11_4 = _mm_adds_epi16(alpha_ptr[7],beta_ptr[7]); //ALPHA_BETA_4m11; m00_3 = _mm_adds_epi16(alpha_ptr[6],beta_ptr[7]); //ALPHA_BETA_3m00; @@ -836,6 +979,32 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext, m10_2 = _mm_adds_epi16(alpha_ptr[3],beta_ptr[5]); //ALPHA_BETA_2m10; m10_1 = _mm_adds_epi16(alpha_ptr[2],beta_ptr[1]); //ALPHA_BETA_1m10; m01_1 = _mm_adds_epi16(alpha_ptr[2],beta_ptr[5]); //ALPHA_BETA_1m01; +#else + + + m00_1 = _mm_adds_epi16(alpha_ptr[0],beta_ptr[0]); //ALPHA_BETA_1m00; + m10_1 = _mm_adds_epi16(alpha_ptr[2],beta_ptr[1]); //ALPHA_BETA_1m10; + m11_1 = _mm_adds_epi16(alpha_ptr[0],beta_ptr[4]); //ALPHA_BETA_1m11; + m01_1 = _mm_adds_epi16(alpha_ptr[2],beta_ptr[5]); //ALPHA_BETA_1m01; + + m11_2 = _mm_adds_epi16(alpha_ptr[1],beta_ptr[0]); //ALPHA_BETA_2m11; + m01_2 = _mm_adds_epi16(alpha_ptr[3],beta_ptr[1]); //ALPHA_BETA_2m01; + m00_2 = _mm_adds_epi16(alpha_ptr[1],beta_ptr[4]); //ALPHA_BETA_2m00; + m10_2 = _mm_adds_epi16(alpha_ptr[3],beta_ptr[5]); //ALPHA_BETA_2m10; + + m11_3 = _mm_adds_epi16(alpha_ptr[6],beta_ptr[3]); //ALPHA_BETA_3m11; + m01_3 = _mm_adds_epi16(alpha_ptr[4],beta_ptr[2]); //ALPHA_BETA_3m01; + m00_3 = _mm_adds_epi16(alpha_ptr[6],beta_ptr[7]); //ALPHA_BETA_3m00; + m10_3 = _mm_adds_epi16(alpha_ptr[4],beta_ptr[6]); //ALPHA_BETA_3m10; + + m00_4 = _mm_adds_epi16(alpha_ptr[7],beta_ptr[3]); //ALPHA_BETA_4m00; + m10_4 = _mm_adds_epi16(alpha_ptr[5],beta_ptr[2]); //ALPHA_BETA_4m10; + m11_4 = _mm_adds_epi16(alpha_ptr[7],beta_ptr[7]); //ALPHA_BETA_4m11; + m01_4 = _mm_adds_epi16(alpha_ptr[5],beta_ptr[6]); //ALPHA_BETA_4m01; + + +#endif + /* print_shorts("m11_1:",&m11_1); print_shorts("m11_2:",&m11_2); @@ -1030,19 +1199,19 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, n is the size in bits of the coded block, with the tail */ - llr_t systematic0[n+16] __attribute__ ((aligned(16))); - llr_t systematic1[n+16] __attribute__ ((aligned(16))); - llr_t systematic2[n+16] __attribute__ ((aligned(16))); - llr_t yparity1[n+16] __attribute__ ((aligned(16))); - llr_t yparity2[n+16] __attribute__ ((aligned(16))); + llr_t systematic0[n+16] __attribute__ ((aligned(32))); + llr_t systematic1[n+16] __attribute__ ((aligned(32))); + llr_t systematic2[n+16] __attribute__ ((aligned(32))); + llr_t yparity1[n+16] __attribute__ ((aligned(32))); + llr_t yparity2[n+16] __attribute__ ((aligned(32))); - llr_t ext[n+128] __attribute__((aligned(16))); - llr_t ext2[n+128] __attribute__((aligned(16))); + llr_t ext[n+128] __attribute__((aligned(32))); + llr_t ext2[n+128] __attribute__((aligned(32))); - llr_t alpha[(n+16)*8] __attribute__ ((aligned(16))); - llr_t beta[(n+16)*8] __attribute__ ((aligned(16))); - llr_t m11[n+16] __attribute__ ((aligned(16))); - llr_t m10[n+16] __attribute__ ((aligned(16))); + llr_t alpha[(n+16)*8] __attribute__ ((aligned(32))); + llr_t beta[(n+16)*8] __attribute__ ((aligned(32))); + llr_t m11[n+32] __attribute__ ((aligned(32))); + llr_t m10[n+32] __attribute__ ((aligned(32))); int *pi2_p,*pi4_p,*pi5_p,*pi6_p; diff --git a/openair1/PHY/LTE_REFSIG/lte_gold.c b/openair1/PHY/LTE_REFSIG/lte_gold.c index 567851a51a..bfd6716640 100644 --- a/openair1/PHY/LTE_REFSIG/lte_gold.c +++ b/openair1/PHY/LTE_REFSIG/lte_gold.c @@ -61,21 +61,18 @@ void lte_gold(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_table[20][2][14] x2 = Ncp + (Nid_cell<<1) + - (((1+(Nid_cell<<1))*(1 + (((frame_parms->Ncp==0)?4:3)*l) + (7*(1+ns))))<<10); //cinit + (((1+(Nid_cell<<1))*(1 + (((frame_parms->Ncp==0)?4:3)*l) + (7*(1+ns))))<<10); //cinit //x2 = frame_parms->Ncp + (Nid_cell<<1) + (1+(Nid_cell<<1))*(1 + (3*l) + (7*(1+ns))); //cinit //n = 0 - // printf("cinit (ns %d, l %d) => %d\n",ns,l,x2); x1 = 1+ (1<<31); x2=x2 ^ ((x2 ^ (x2>>1) ^ (x2>>2) ^ (x2>>3))<<31); // skip first 50 double words (1600 bits) - //printf("n=0 : x1 %x, x2 %x\n",x1,x2); for (n=1; n<50; n++) { x1 = (x1>>1) ^ (x1>>4); x1 = x1 ^ (x1<<31) ^ (x1<<28); x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4); x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28); - // printf("x1 : %x, x2 : %x\n",x1,x2); } for (n=0; n<14; n++) { @@ -84,7 +81,6 @@ void lte_gold(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_table[20][2][14] x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4); x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28); lte_gold_table[ns][l][n] = x1^x2; - // printf("n=%d : c %x\n",n,x1^x2); } } diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c index 66df9dbb78..801c1a4f93 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c @@ -446,7 +446,8 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, printf("\n"); */ -#ifndef __AVX2__ + //#ifndef __AVX2__ +#if 1 if (err_flag == 0) { start_meas(dlsch_turbo_decoding_stats); diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index ad464b16ba..264a3c3610 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -1898,17 +1898,17 @@ void dlsch_channel_compensation_TM3(LTE_DL_FRAME_PARMS *frame_parms, for (aarx=0; aarxnb_antennas_rx; aarx++) { - dl_ch0_128 = (__m128i *)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12]; - dl_ch1_128 = (__m128i *)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12]; + dl_ch0_128 = (__m128i *)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12]; // hr,0 + dl_ch1_128 = (__m128i *)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12]; // hr,1 dl_ch_mag0_128 = (__m128i *)&dl_ch_mag0[aarx][symbol*frame_parms->N_RB_DL*12]; dl_ch_mag0_128b = (__m128i *)&dl_ch_magb0[aarx][symbol*frame_parms->N_RB_DL*12]; dl_ch_mag1_128 = (__m128i *)&dl_ch_mag1[aarx][symbol*frame_parms->N_RB_DL*12]; dl_ch_mag1_128b = (__m128i *)&dl_ch_magb1[aarx][symbol*frame_parms->N_RB_DL*12]; - rxdataF128 = (__m128i *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12]; - rxdataF_comp0_128 = (__m128i *)&rxdataF_comp0[aarx][symbol*frame_parms->N_RB_DL*12]; - rxdataF_comp1_128 = (__m128i *)&rxdataF_comp1[aarx][symbol*frame_parms->N_RB_DL*12]; + rxdataF128 = (__m128i *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12]; // yr + rxdataF_comp0_128 = (__m128i *)&rxdataF_comp0[aarx][symbol*frame_parms->N_RB_DL*12]; // yr,0 = yr * conj(hr,0) + rxdataF_comp1_128 = (__m128i *)&rxdataF_comp1[aarx][symbol*frame_parms->N_RB_DL*12]; // yr,1 = yr * conj(hr,1) for (rb=0; rb Date: Tue, 26 Jan 2016 16:45:48 +0100 Subject: [PATCH 033/214] Traces + shift timing bug --- openair3/TEST/EPC_TEST/play_scenario.c | 45 ++++++++++--------- .../EPC_TEST/play_scenario_s1ap_compare_ie.c | 12 +++-- 2 files changed, 34 insertions(+), 23 deletions(-) diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index c633cedfa7..cafdd93d31 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -141,10 +141,14 @@ void et_get_shift_arg( char * line_argument, shift_packet_t * const shift) while ((line_argument[i] != ':') && (i < len)) { - my_num[i] = line_argument[i]; + if (isdigit(line_argument[i])) { // may occur '\"' + my_num[j++] = line_argument[i]; + } i += 1; } - my_num[i++] = '\0'; + AssertFatal(':' == line_argument[i], "Bad format"); + i += 1; // ':' + my_num[j++] = '\0'; shift->frame_number = atoi(my_num); AssertFatal(ilist_packet; while (packet) { -// fprintf(stdout, "*shift: %p\n", shift); -// fprintf(stdout, "\tframe_number: %p\n", shift->frame_number); -// fprintf(stdout, "\tshift_seconds: %ld\n", shift->shift_seconds); -// fprintf(stdout, "\tshift_microseconds: %ld\n", shift->shift_microseconds); -// fprintf(stdout, "\tsingle: %d\n\n", shift->single); -// fprintf(stdout, "\tshift_all_packets_seconds: %ld\n", shift_all_packets.tv_sec); -// fprintf(stdout, "\tshift_all_packets_microseconds: %ld\n", shift_all_packets.tv_usec); + fprintf(stdout, "*shift: %p\n", shift); + fprintf(stdout, "\tframe_number: %d\n", shift->frame_number); + fprintf(stdout, "\tshift_seconds: %ld\n", shift->shift_seconds); + fprintf(stdout, "\tshift_microseconds: %ld\n", shift->shift_microseconds); + fprintf(stdout, "\tsingle: %d\n\n", shift->single); + fprintf(stdout, "\tshift_all_packets_seconds: %ld\n", shift_all_packets.tv_sec); + fprintf(stdout, "\tshift_all_packets_microseconds: %ld\n", shift_all_packets.tv_usec); AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0), "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u", @@ -891,11 +896,11 @@ int et_play_scenario(et_scenario_t* const scenario, const struct shift_packet_s shift_all_packets.tv_sec = shift->shift_seconds; shift_all_packets.tv_usec = shift->shift_microseconds; timeval_add(&packet->time_relative_to_first_packet, &packet->time_relative_to_first_packet, &shift_all_packets); -// fprintf(stdout, "\tpacket num %u, now original frame number %u time_relative_to_first_packet=%d.%d\n", -// packet->packet_number, -// packet->original_frame_number, -// packet->time_relative_to_first_packet.tv_sec, -// packet->time_relative_to_first_packet.tv_usec); + fprintf(stdout, "\tpacket num %u, now original frame number %u time_relative_to_first_packet=%d.%d\n", + packet->packet_number, + packet->original_frame_number, + packet->time_relative_to_first_packet.tv_sec, + packet->time_relative_to_first_packet.tv_usec); AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0), "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u", packet->time_relative_to_first_packet.tv_sec, @@ -904,11 +909,11 @@ int et_play_scenario(et_scenario_t* const scenario, const struct shift_packet_s packet->original_frame_number); } else if ((0 == shift->single) && (shift->frame_number < packet->original_frame_number)) { timeval_add(&packet->time_relative_to_first_packet, &packet->time_relative_to_first_packet, &shift_all_packets); -// fprintf(stdout, "\tpacket num %u, now original frame number %u time_relative_to_first_packet=%d.%d\n", -// packet->packet_number, -// packet->original_frame_number, -// packet->time_relative_to_first_packet.tv_sec, -// packet->time_relative_to_first_packet.tv_usec); + fprintf(stdout, "\tpacket num %u, now original frame number %u time_relative_to_first_packet=%d.%d\n", + packet->packet_number, + packet->original_frame_number, + packet->time_relative_to_first_packet.tv_sec, + packet->time_relative_to_first_packet.tv_usec); AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0), "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u", packet->time_relative_to_first_packet.tv_sec, @@ -1107,8 +1112,8 @@ et_config_parse_opt_line ( shift = shift->next; } shift->single = 1; - et_get_shift_arg(optarg, shift); printf("Arg Shift packet %s\n", optarg); + et_get_shift_arg(optarg, shift); } break; diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c index 2242a63bd6..1e79c38963 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c @@ -467,7 +467,7 @@ void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, con int size = 0; int pos = 0; int go_deeper_in_tree = 1; - S1AP_DEBUG("%s() mme_ue_s1ap_id %u\n", __FUNCTION__, new_id); + S1AP_INFO("%s() mme_ue_s1ap_id %u\n", __FUNCTION__, new_id); // modify for (cur_node = (xmlNode *)node; cur_node; cur_node = cur_node->next) { @@ -527,7 +527,7 @@ void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, con } while (pos2 < (2*5)); // update ASN1 et_decode_s1ap(s1ap); - S1AP_DEBUG("Updated ASN1 for %s\n", showname); + S1AP_INFO("Updated ASN1 for %s\n", showname); } } } @@ -553,6 +553,7 @@ void update_xpath_nodes_mme_ue_s1ap_id(et_s1ap_t * const s1ap_payload, xmlNodeSe xmlNode *s1ap_node = NULL; size = (nodes) ? nodes->nodeNr : 0; + S1AP_DEBUG("%s() num nodes %u\n", __FUNCTION__, size); /* * NOTE: the nodes are processed in reverse order, i.e. reverse document @@ -614,14 +615,19 @@ int et_s1ap_update_mme_ue_s1ap_id(et_packet_t * const packet, const S1ap_MME_UE_ // Evaluate xpath expression xpath_obj = xmlXPathEvalExpression(xpath_expression, xpath_ctx); + xmlXPathFreeContext(xpath_ctx); AssertFatal(xpath_obj != NULL, "Unable to evaluate XPATH expression \"%s\"\n", xpath_expression); + if(xmlXPathNodeSetIsEmpty(xpath_obj->nodesetval)){ + xmlXPathFreeObject(xpath_obj); + S1AP_DEBUG("%s() No match packet num %u original frame number %u, mme_ue_s1ap_id %u -> %u\n", __FUNCTION__, packet->packet_number, packet->original_frame_number, old_id, new_id); + return -1; + } // update selected nodes update_xpath_nodes_mme_ue_s1ap_id(&packet->sctp_hdr.u.data_hdr.payload, xpath_obj->nodesetval, new_id); // Cleanup of XPath data xmlXPathFreeObject(xpath_obj); - xmlXPathFreeContext(xpath_ctx); return 0; } From 5319fcba38008b1c99c2eab6e82926471b965a19 Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 27 Jan 2016 08:39:44 +0100 Subject: [PATCH 034/214] Bug, needed unsigned instead of signed --- openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c index 1e79c38963..f9c7d9c822 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c @@ -601,7 +601,7 @@ int et_s1ap_update_mme_ue_s1ap_id(et_packet_t * const packet, const S1ap_MME_UE_ S1AP_DEBUG("%s() packet num %u original frame number %u, mme_ue_s1ap_id %u -> %u\n", __FUNCTION__, packet->packet_number, packet->original_frame_number, old_id, new_id); - ret = snprintf(xpath_expression, ET_XPATH_EXPRESSION_MAX_LENGTH, "//field[@name=\"s1ap.MME_UE_S1AP_ID\"][@show=\"%d\"]", old_id); + ret = snprintf(xpath_expression, ET_XPATH_EXPRESSION_MAX_LENGTH, "//field[@name=\"s1ap.MME_UE_S1AP_ID\"][@show=\"%u\"]", old_id); AssertFatal((ret > 0) && (ret < ET_XPATH_EXPRESSION_MAX_LENGTH), "Could not build XPATH expression err=%d", ret); doc = packet->sctp_hdr.u.data_hdr.payload.doc; @@ -620,7 +620,8 @@ int et_s1ap_update_mme_ue_s1ap_id(et_packet_t * const packet, const S1ap_MME_UE_ if(xmlXPathNodeSetIsEmpty(xpath_obj->nodesetval)){ xmlXPathFreeObject(xpath_obj); - S1AP_DEBUG("%s() No match packet num %u original frame number %u, mme_ue_s1ap_id %u -> %u\n", __FUNCTION__, packet->packet_number, packet->original_frame_number, old_id, new_id); + S1AP_DEBUG("%s() No match \"%s\"packet num %u original frame number %u, mme_ue_s1ap_id %u -> %u\n", + __FUNCTION__, xpath_expression, packet->packet_number, packet->original_frame_number, old_id, new_id); return -1; } // update selected nodes From 8402a1a30e3f7597e52403d7cbcad38f1ab16b28 Mon Sep 17 00:00:00 2001 From: gauthier Date: Thu, 28 Jan 2016 11:35:36 +0100 Subject: [PATCH 035/214] lte_eNB_measurements --- openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c index 14e1c18571..ee2e7d9658 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c @@ -68,8 +68,8 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB, phy_measurements->n0_power[aarx] = ((k1*signal_energy(&eNB_common_vars->rxdata[eNB_id][aarx][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size], - frame_parms->ofdm_symbol_size)) + k2*phy_measurements->n0_power[aarx])>>10; - phy_measurements->n0_power[aarx] = (phy_measurements->n0_power[aarx] * 12*frame_parms->N_RB_DL)/(frame_parms->ofdm_symbol_size); + frame_parms->ofdm_symbol_size)) + k2*phy_measurements->n0_power[aarx])>>10; + //phy_measurements->n0_power[aarx] = (phy_measurements->n0_power[aarx]) * 12*frame_parms->N_RB_DL)/(frame_parms->ofdm_symbol_size); phy_measurements->n0_power_dB[aarx] = (unsigned short) dB_fixed(phy_measurements->n0_power[aarx]); phy_measurements->n0_power_tot += phy_measurements->n0_power[aarx]; } From 40656e0e494f9129bab1c7a1e129552380d6d214 Mon Sep 17 00:00:00 2001 From: kaltenbe Date: Mon, 1 Feb 2016 17:43:31 +0100 Subject: [PATCH 036/214] some changes in logging for XFORMS and UL scheduling (activation in all subframes and retransmissions only via PHICH) --- openair1/PHY/LTE_TRANSPORT/print_stats.c | 226 ++++----- openair1/PHY/LTE_TRANSPORT/rar_tools.c | 2 +- openair1/SCHED/phy_procedures_lte_eNb.c | 33 +- openair2/LAYER2/MAC/defs.h | 4 +- openair2/LAYER2/MAC/eNB_scheduler.c | 12 +- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 4 +- .../LAYER2/MAC/eNB_scheduler_primitives.c | 11 +- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 466 +++++++++--------- openair2/LAYER2/MAC/pre_processor.c | 2 +- openair2/LAYER2/MAC/rar_tools.c | 6 +- .../CONF/enb.band7.tm1.50PRB.usrpb210.conf | 4 +- targets/RT/USER/lte-softmodem.c | 15 +- 12 files changed, 391 insertions(+), 394 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/print_stats.c b/openair1/PHY/LTE_TRANSPORT/print_stats.c index a386e1cb30..0548fd2f4f 100644 --- a/openair1/PHY/LTE_TRANSPORT/print_stats.c +++ b/openair1/PHY/LTE_TRANSPORT/print_stats.c @@ -566,7 +566,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) // } for (eNB=0; eNBproc[0].frame_tx, phy_vars_eNB->rx_total_gain_eNB_dB, @@ -574,7 +574,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) phy_vars_eNB->PHY_measurements_eNB[eNB].n0_power_dB[0], phy_vars_eNB->PHY_measurements_eNB[eNB].n0_power_dB[1]); - len += sprintf(&buffer[len],"[eNB PROC] PRB I0 (%X.%X.%X.%X): ", + len += sprintf(&buffer[len],"PRB I0 (%X.%X.%X.%X): ", phy_vars_eNB->rb_mask_ul[0], phy_vars_eNB->rb_mask_ul[1],phy_vars_eNB->rb_mask_ul[2],phy_vars_eNB->rb_mask_ul[3]); @@ -587,7 +587,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) } len += sprintf(&buffer[len],"\n"); - len += sprintf(&buffer[len],"\n[eNB PROC] PERFORMANCE PARAMETERS\n"); + len += sprintf(&buffer[len],"\nPERFORMANCE PARAMETERS\n"); /* len += sprintf(&buffer[len],"[eNB PROC] Total DLSCH Bitrate for the System %dkbps\n",((phy_vars_eNB->eNB_UE_stats[0].dlsch_bitrate + phy_vars_eNB->eNB_UE_stats[1].dlsch_bitrate)/1000)); len += sprintf(&buffer[len],"[eNB PROC] Total Bits successfully transitted %dKbits in %dframe(s)\n",((phy_vars_eNB->eNB_UE_stats[0].total_transmitted_bits + phy_vars_eNB->eNB_UE_stats[1].total_transmitted_bits)/1000),phy_vars_eNB->frame+1); @@ -595,119 +595,95 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) */ for (UE_id=0; UE_iddlsch_eNB[(uint8_t)UE_id][0]->rnti>0)&& + (phy_vars_eNB->eNB_UE_stats[UE_id].mode == PUSCH)) { - if (phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti>0) { phy_vars_eNB->total_dlsch_bitrate = phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate + phy_vars_eNB->total_dlsch_bitrate; phy_vars_eNB->total_transmitted_bits = phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS + phy_vars_eNB->total_transmitted_bits; //phy_vars_eNB->total_system_throughput = phy_vars_eNB->eNB_UE_stats[UE_id].total_transmitted_bits + phy_vars_eNB->total_system_throughput; - if (phy_vars_eNB->eNB_UE_stats[UE_id].mode == PUSCH) - for (i=0; i<8; i++) - success = success + (phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0] - phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i]); - } + + for (i=0; i<8; i++) + success = success + (phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0] - phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i]); -#else - phy_vars_eNB->total_dlsch_bitrate = phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate + phy_vars_eNB->total_dlsch_bitrate; - phy_vars_eNB->total_transmitted_bits = phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS + phy_vars_eNB->total_transmitted_bits; + + + len += sprintf(&buffer[len],"Total DLSCH %d kbits / %d frames ",(phy_vars_eNB->total_transmitted_bits/1000),phy_vars_eNB->proc[0].frame_tx+1); + len += sprintf(&buffer[len],"Total DLSCH throughput %d kbps ",(phy_vars_eNB->total_dlsch_bitrate/1000)); + len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,phy_vars_eNB->proc[0].frame_tx+1); + //len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->FULL_MUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions); + //len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->check_for_MUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions); + //len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->check_for_SUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions); + + len += sprintf(&buffer[len],"UE %d (%x) Power: (%d,%d) dB, Po_PUSCH: (%d,%d) dBm, Po_PUCCH (%d/%d) dBm, Po_PUCCH1 (%d,%d) dBm, PUCCH1 Thres %d dBm \n", + UE_id, + phy_vars_eNB->eNB_UE_stats[UE_id].crnti, + dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[UE_id]->ulsch_power[0]), + dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[UE_id]->ulsch_power[1]), + phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[0], + phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[1], + dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB, + phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH, + dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB, + dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB, + PUCCH1_THRES+phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm-dB_fixed(phy_vars_eNB->lte_frame_parms.N_RB_UL), + phy_vars_eNB->eNB_UE_stats[UE_id].sector); + + len+= sprintf(&buffer[len],"DL mcs %d, UL mcs %d, UL rb %d, delta_TF %d, ", + i, + phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[0]->mcs, + phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[0]->mcs, + phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[0]->nb_rb, + phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[0]->delta_TF); + + len += sprintf(&buffer[len],"Wideband CQI: (%d,%d) dB\n", + phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][0], + phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][1]); + + /* len += sprintf(&buffer[len],"[eNB PROC] Subband CQI: "); + + for (i=0; ilte_frame_parms.N_RB_DL; i++) + len += sprintf(&buffer[len],"%2d ", + phy_vars_eNB->PHY_measurements_eNB[eNB].subband_cqi_tot_dB[UE_id][i]); + + len += sprintf(&buffer[len],"\n"); + */ - //phy_vars_eNB->total_system_throughput = phy_vars_eNB->eNB_UE_stats[UE_id].total_transmitted_bits + phy_vars_eNB->total_system_throughput; - for (i=0; i<8; i++) - success = success + (phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0] - phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i]); + len += sprintf(&buffer[len],"DL TM %d, DL_cqi %d, DL_pmi_single %jx ", + phy_vars_eNB->transmission_mode[UE_id], + phy_vars_eNB->eNB_UE_stats[UE_id].DL_cqi[0], + pmi2hex_2Ar1(phy_vars_eNB->eNB_UE_stats[UE_id].DL_pmi_single)); -#endif - } - - len += sprintf(&buffer[len],"[eNB PROC] Total DLSCH bits successfully transmitted %d kbits in %d frame(s)\n",(phy_vars_eNB->total_transmitted_bits/1000),phy_vars_eNB->proc[0].frame_tx+1); - len += sprintf(&buffer[len],"[eNB PROC] Total DLSCH average system throughput %d kbps\n",(phy_vars_eNB->total_dlsch_bitrate/1000)); - len += sprintf(&buffer[len],"[eNB PROC] Total DLSCH successful transmissions %d in %d frame(s)\n",success,phy_vars_eNB->proc[0].frame_tx+1); - //len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->FULL_MUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions); - //len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->check_for_MUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions); - //len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->check_for_SUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions); - - } - - len += sprintf(&buffer[len],"\n"); - - for (UE_id=0; UE_iddlsch_eNB[(uint8_t)UE_id][0]->rnti>0) { -#endif - len += sprintf(&buffer[len],"[eNB PROC] UE %d (%x) Power: (%d,%d) dB, Po_PUSCH: (%d,%d) dBm, Po_PUCCH (%d/%d) dBm, Po_PUCCH1 (%d,%d) dBm, PUCCH1 Thres %d dBm \n", - UE_id, - phy_vars_eNB->eNB_UE_stats[UE_id].crnti, - dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[UE_id]->ulsch_power[0]), - dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[UE_id]->ulsch_power[1]), - phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[0], - phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[1], - dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB, - phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH, - dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB, - dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB, - PUCCH1_THRES+phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm-dB_fixed(phy_vars_eNB->lte_frame_parms.N_RB_UL), - phy_vars_eNB->eNB_UE_stats[UE_id].sector); - - for(i=0; i<8; i++) - len+= sprintf(&buffer[len]," harq %d: DL mcs %d, UL mcs %d, UL rb %d, delta_TF %d\n", - i, - phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[i]->mcs, - phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[i]->mcs, - phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[i]->nb_rb, - phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[i]->delta_TF); - - len += sprintf(&buffer[len],"[eNB PROC] Wideband CQI: (%d,%d) dB\n", - phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][0], - phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][1]); - - len += sprintf(&buffer[len],"[eNB PROC] Subband CQI: "); - - for (i=0; i<25; i++) - len += sprintf(&buffer[len],"%2d ", - phy_vars_eNB->PHY_measurements_eNB[eNB].subband_cqi_tot_dB[UE_id][i]); - - len += sprintf(&buffer[len],"\n"); - - len += sprintf(&buffer[len],"[eNB PROC] DL TM %d, DL_cqi %d, DL_pmi_single %jx\n", - phy_vars_eNB->transmission_mode[UE_id], - phy_vars_eNB->eNB_UE_stats[UE_id].DL_cqi[0], - pmi2hex_2Ar1(phy_vars_eNB->eNB_UE_stats[UE_id].DL_pmi_single)); - - len += sprintf(&buffer[len],"[eNB PROC] DL Subband CQI: "); - - for (i=0; i<13; i++) - len += sprintf(&buffer[len],"%2d ", - phy_vars_eNB->eNB_UE_stats[UE_id].DL_subband_cqi[0][i]); - - len += sprintf(&buffer[len],"\n"); - - len += sprintf(&buffer[len],"[eNB PROC] Timing advance %d samples (%d 16Ts), update %d\n", - phy_vars_eNB->eNB_UE_stats[UE_id].UE_timing_offset, - phy_vars_eNB->eNB_UE_stats[UE_id].UE_timing_offset>>2, - phy_vars_eNB->eNB_UE_stats[UE_id].timing_advance_update); - - len += sprintf(&buffer[len],"[eNB PROC] Mode = %s(%d)\n", - mode_string[phy_vars_eNB->eNB_UE_stats[UE_id].mode], - phy_vars_eNB->eNB_UE_stats[UE_id].mode); -#ifdef OPENAIR2 - UE_id_mac = find_UE_id(phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti); - - if (UE_id_mac != -1) { - RRC_status = mac_eNB_get_rrc_status(phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti); - len += sprintf(&buffer[len],"[eNB PROC] UE_id_mac = %d, RRC status = %d\n",UE_id_mac,RRC_status); - } else - len += sprintf(&buffer[len],"[eNB PROC] UE_id_mac = -1\n"); - -#endif - -#ifdef OPENAIR2 - - if (phy_vars_eNB->eNB_UE_stats[UE_id].mode == PUSCH) { -#endif - len += sprintf(&buffer[len],"[eNB PROC] SR received/total: %d/%d (diff %d)\n", + len += sprintf(&buffer[len],"Timing advance %d samples (%d 16Ts), update %d ", + phy_vars_eNB->eNB_UE_stats[UE_id].UE_timing_offset, + phy_vars_eNB->eNB_UE_stats[UE_id].UE_timing_offset>>2, + phy_vars_eNB->eNB_UE_stats[UE_id].timing_advance_update); + + len += sprintf(&buffer[len],"Mode = %s(%d) ", + mode_string[phy_vars_eNB->eNB_UE_stats[UE_id].mode], + phy_vars_eNB->eNB_UE_stats[UE_id].mode); + UE_id_mac = find_UE_id(phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti); + + if (UE_id_mac != -1) { + RRC_status = mac_eNB_get_rrc_status(phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti); + len += sprintf(&buffer[len],"UE_id_mac = %d, RRC status = %d\n",UE_id_mac,RRC_status); + } else + len += sprintf(&buffer[len],"UE_id_mac = -1\n"); + + len += sprintf(&buffer[len],"SR received/total: %d/%d (diff %d)\n", phy_vars_eNB->eNB_UE_stats[UE_id].sr_received, phy_vars_eNB->eNB_UE_stats[UE_id].sr_total, phy_vars_eNB->eNB_UE_stats[UE_id].sr_total-phy_vars_eNB->eNB_UE_stats[UE_id].sr_received); + + len += sprintf(&buffer[len],"DL Subband CQI: "); + + for (i=0; i<25; i++) + len += sprintf(&buffer[len],"%2d ", + phy_vars_eNB->eNB_UE_stats[UE_id].DL_subband_cqi[0][i]); + + len += sprintf(&buffer[len],"\n"); + + ulsch_errors = 0; @@ -716,10 +692,10 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) ulsch_round_errors[j]=0; } - len += sprintf(&buffer[len],"[eNB PROC] ULSCH errors/attempts per harq (per round): \n"); + len += sprintf(&buffer[len],"ULSCH errors/attempts per harq (per round): \n"); for (i=0; i<8; i++) { - len += sprintf(&buffer[len]," harq %d: %d/%d (fer %d) (%d/%d, %d/%d, %d/%d, %d/%d)\n", + len += sprintf(&buffer[len]," harq %d: %d/%d (fer %d) (%d/%d, %d/%d, %d/%d, %d/%d) ", i, phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_errors[i], phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[i][0], @@ -732,6 +708,9 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[i][2], phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[i][3], phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[i][3]); + if ((i&1) == 1) + len += sprintf(&buffer[len],"\n"); + ulsch_errors+=phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_errors[i]; for (j=0; j<4; j++) { @@ -740,7 +719,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) } } - len += sprintf(&buffer[len],"[eNB PROC] ULSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d): \n", + len += sprintf(&buffer[len],"ULSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d)\n", ulsch_errors,ulsch_round_attempts[0], ulsch_round_errors[0],ulsch_round_attempts[0], @@ -755,10 +734,10 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) dlsch_round_errors[j]=0; } - len += sprintf(&buffer[len],"[eNB PROC] DLSCH errors/attempts per harq (per round): \n"); + len += sprintf(&buffer[len],"DLSCH errors/attempts per harq (per round): \n"); for (i=0; i<8; i++) { - len += sprintf(&buffer[len]," harq %d: %d/%d (%d/%d/%d, %d/%d/%d, %d/%d/%d, %d/%d/%d)\n", + len += sprintf(&buffer[len]," harq %d: %d/%d (%d/%d/%d, %d/%d/%d, %d/%d/%d, %d/%d/%d) ", i, phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i], phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0], @@ -774,6 +753,10 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_ACK[i][3], phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[i][3], phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][3]); + if ((i&1) == 1) + len += sprintf(&buffer[len],"\n"); + + dlsch_errors+=phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i]; for (j=0; j<4; j++) { @@ -782,7 +765,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) } } - len += sprintf(&buffer[len],"[eNB PROC] DLSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d): \n", + len += sprintf(&buffer[len],"DLSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d): \n", dlsch_errors,dlsch_round_attempts[0], dlsch_round_errors[0],dlsch_round_attempts[0], dlsch_round_errors[1],dlsch_round_attempts[1], @@ -790,11 +773,11 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) dlsch_round_errors[3],dlsch_round_attempts[3]); - len += sprintf(&buffer[len],"[eNB PROC] DLSCH total bits from MAC: %dkbit\n",(phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS_MAC)/1000); - len += sprintf(&buffer[len],"[eNB PROC] DLSCH total bits ack'ed: %dkbit\n",(phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS)/1000); - len += sprintf(&buffer[len],"[eNB PROC] DLSCH Average throughput (100 frames): %dkbps\n",(phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate/1000)); - len += sprintf(&buffer[len],"[eNB PROC] Transmission Mode %d\n",phy_vars_eNB->transmission_mode[UE_id]); - + len += sprintf(&buffer[len],"DLSCH total bits from MAC: %dkbit ",(phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS_MAC)/1000); + len += sprintf(&buffer[len],"DLSCH total bits ack'ed: %dkbit ",(phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS)/1000); + len += sprintf(&buffer[len],"DLSCH Average throughput (100 frames): %dkbps\n",(phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate/1000)); + // len += sprintf(&buffer[len],"[eNB PROC] Transmission Mode %d\n",phy_vars_eNB->transmission_mode[UE_id]); + /* if(phy_vars_eNB->transmission_mode[UE_id] == 5) { if(phy_vars_eNB->mu_mimo_mode[UE_id].dl_pow_off == 0) len += sprintf(&buffer[len],"[eNB PROC] ****UE %d is in MU-MIMO mode****\n",UE_id); @@ -803,7 +786,8 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) else len += sprintf(&buffer[len],"[eNB PROC] ****UE %d is not scheduled****\n",UE_id); } - + */ + /* len += sprintf(&buffer[len],"[eNB PROC] RB Allocation on Sub-bands: "); // for (j=0;j< mac_xface->lte_frame_parms->N_RBGS;j++) @@ -813,16 +797,14 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) len += sprintf(&buffer[len],"\n"); len += sprintf(&buffer[len],"[eNB PROC] Total Number of Allocated PRBs = %d\n",phy_vars_eNB->mu_mimo_mode[UE_id].pre_nb_available_rbs); - -#ifdef OPENAIR2 + */ } } -#endif len += sprintf(&buffer[len],"\n"); } - + len += sprintf(&buffer[len],"EOF\n"); - + return len; } diff --git a/openair1/PHY/LTE_TRANSPORT/rar_tools.c b/openair1/PHY/LTE_TRANSPORT/rar_tools.c index 1b789e1144..808f9e765d 100644 --- a/openair1/PHY/LTE_TRANSPORT/rar_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/rar_tools.c @@ -81,7 +81,7 @@ int generate_eNB_ulsch_params_from_rar(unsigned char *rar_pdu, uint16_t *RIV2nb_rb_LUT, *RIV2first_rb_LUT; uint16_t RIV_max; - LOG_I(PHY,"[eNB][RAPROC] generate_eNB_ulsch_params_from_rar: subframe %d (harq_pid %d)\n",subframe,harq_pid); + LOG_D(PHY,"[eNB][RAPROC] generate_eNB_ulsch_params_from_rar: subframe %d (harq_pid %d)\n",subframe,harq_pid); switch (frame_parms->N_RB_DL) { case 6: diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 60cd0ec0f7..d54e6856f3 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -178,7 +178,7 @@ int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB) } else { if (phy_vars_eNB->eNB_UE_stats[i].crnti==0) { MSC_LOG_EVENT(MSC_PHY_ENB, "0 Add ue %"PRIx16" ", rnti); - LOG_I(PHY,"UE_id %d associated with rnti %x\n",i, (uint16_t)rnti); + LOG_D(PHY,"UE_id %d associated with rnti %x\n",i, (uint16_t)rnti); phy_vars_eNB->dlsch_eNB[i][0]->rnti = rnti; phy_vars_eNB->ulsch_eNB[i]->rnti = rnti; phy_vars_eNB->eNB_UE_stats[i].crnti = rnti; @@ -186,7 +186,7 @@ int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB) phy_vars_eNB->eNB_UE_stats[i].Po_PUCCH1_below = 0; phy_vars_eNB->eNB_UE_stats[i].Po_PUCCH1_above = (int32_t)pow(10.0,.1*(phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+phy_vars_eNB->rx_total_gain_eNB_dB)); phy_vars_eNB->eNB_UE_stats[i].Po_PUCCH = (int32_t)pow(10.0,.1*(phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+phy_vars_eNB->rx_total_gain_eNB_dB)); - LOG_I(PHY,"Initializing Po_PUCCH: p0_NominalPUCCH %d, gain %d => %d\n", + LOG_D(PHY,"Initializing Po_PUCCH: p0_NominalPUCCH %d, gain %d => %d\n", phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH, phy_vars_eNB->rx_total_gain_eNB_dB, phy_vars_eNB->eNB_UE_stats[i].Po_PUCCH); @@ -1742,17 +1742,8 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e phy_vars_eNB->dlsch_eNB[i][0]->subframe_tx[subframe] = 0; } - // init_nCCE_table(); num_pdcch_symbols = DCI_pdu->num_pdcch_symbols; - /*get_num_pdcch_symbols(DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci, - DCI_pdu->dci_alloc, - &phy_vars_eNB->lte_frame_parms, - subframe);*/ - /* - DCI_pdu->nCCE = get_nCCE(num_pdcch_symbols, - &phy_vars_eNB->lte_frame_parms, - get_mi(&phy_vars_eNB->lte_frame_parms,subframe));*/ LOG_D(PHY,"num_pdcch_symbols %"PRIu8", nCCE %u (dci commond %"PRIu8", dci uespec %"PRIu8"\n",num_pdcch_symbols,DCI_pdu->nCCE, DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); @@ -1946,7 +1937,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e return; // not reached } -#ifdef DEBUG_PHY_PROC + //#ifdef DEBUG_PHY_PROC //if (phy_vars_eNB->proc[sched_subframe].frame_tx%100 == 0) LOG_D(PHY, "[eNB %"PRIu8"][PUSCH %"PRIu8"] Frame %d subframe %d UL Frame %"PRIu32", UL Subframe %"PRIu8", Generated ULSCH (format0) DCI (rnti %"PRIx16", dci %"PRIx8") (DCI pos %"PRIu32"/%d), aggregation %d\n", @@ -1963,7 +1954,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e i, DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci, 1<dci_alloc[i].L); -#endif + //#endif //dump_dci(&phy_vars_eNB->lte_frame_parms,&DCI_pdu->dci_alloc[i]); //LOG_D(PHY,"[eNB] cba generate_eNB_ulsch_params_from_dci for ue %d for dci rnti %x\n", UE_id, DCI_pdu->dci_alloc[i].rnti); @@ -2212,7 +2203,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e phy_vars_eNB->proc[sched_subframe].frame_tx, &phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->Msg3_frame, &phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->Msg3_subframe); - LOG_I(PHY,"[eNB][RAPROC] Frame %d subframe %d, Activated Msg3 demodulation for UE %"PRId8" in frame %"PRIu32", subframe %"PRIu8"\n", + LOG_D(PHY,"[eNB][RAPROC] Frame %d subframe %d, Activated Msg3 demodulation for UE %"PRId8" in frame %"PRIu32", subframe %"PRIu8"\n", phy_vars_eNB->proc[sched_subframe].frame_tx, subframe, UE_id, @@ -3051,7 +3042,7 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset = preamble_delay_list[preamble_max]&0x1FFF; //limit to 13 (=11+2) bits //phy_vars_eNb->eNB_UE_stats[(uint32_t)UE_id].mode = PRACH; phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].sector = 0; - LOG_I(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure (UE_id %d) with preamble %d, energy %d.%d dB, delay %d\n", + LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure (UE_id %d) with preamble %d, energy %d.%d dB, delay %d\n", phy_vars_eNB->Mod_id, phy_vars_eNB->CC_id, frame, @@ -3492,14 +3483,14 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ LOG_D(PHY,"[eNB][PUSCH %d] Increasing to round %d\n",harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round); if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) { - LOG_I(PHY,"[eNB %d/%d][RAPROC] frame %d, subframe %d, UE %d: Error receiving ULSCH (Msg3), round %d/%d\n", + LOG_D(PHY,"[eNB %d/%d][RAPROC] frame %d, subframe %d, UE %d: Error receiving ULSCH (Msg3), round %d/%d\n", phy_vars_eNB->Mod_id, phy_vars_eNB->CC_id, frame,subframe, i, phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round-1, phy_vars_eNB->lte_frame_parms.maxHARQ_Msg3Tx-1); - LOG_I(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) RSSI (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n", + LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) RSSI (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n", phy_vars_eNB->Mod_id,harq_pid, frame,subframe, phy_vars_eNB->ulsch_eNB[i]->rnti, @@ -3515,7 +3506,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round == phy_vars_eNB->lte_frame_parms.maxHARQ_Msg3Tx) { - LOG_I(PHY,"[eNB %d][RAPROC] maxHARQ_Msg3Tx reached, abandoning RA procedure for UE %d\n", + LOG_D(PHY,"[eNB %d][RAPROC] maxHARQ_Msg3Tx reached, abandoning RA procedure for UE %d\n", phy_vars_eNB->Mod_id, i); phy_vars_eNB->eNB_UE_stats[i].mode = PRACH; #ifdef OPENAIR2 @@ -3547,7 +3538,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ */ // dump_ulsch(phy_vars_eNB,sched_subframe,i); //#ifndef EXMIMO_IOT - LOG_W(PHY,"[eNB] Frame %d, Subframe %d: Msg3 in error, i = %d \n", frame,subframe,i); + LOG_D(PHY,"[eNB] Frame %d, Subframe %d: Msg3 in error, i = %d \n", frame,subframe,i); //#else //mac_exit_wrapper("Msg3 error"); //#endif @@ -3601,10 +3592,10 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ } // ulsch in error else { if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) { - LOG_I(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d ULSCH received, setting round to 0, PHICH ACK\n", + LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d ULSCH received, setting round to 0, PHICH ACK\n", phy_vars_eNB->Mod_id,harq_pid, frame,subframe); - LOG_I(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) RSSI (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n", + LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) RSSI (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n", phy_vars_eNB->Mod_id,harq_pid, frame,subframe, phy_vars_eNB->ulsch_eNB[i]->rnti, diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index cd2d593726..7a48413b7a 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -737,7 +737,9 @@ typedef struct { uint16_t pre_nb_available_rbs[MAX_NUM_CCs]; unsigned char rballoc_sub_UE[MAX_NUM_CCs][N_RBG_MAX]; uint16_t ta_timer; - int16_t ta_update; + int16_t ta_update; + int32_t context_active_timer; + int32_t ul_inactivity_timer; } UE_sched_ctrl; /*! \brief eNB template for the Random access information */ typedef struct { diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 21e9337dbb..d603ad4237 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -123,6 +123,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti)); next_i= UE_list->next[i]; + // increment this, it is cleared when we receive an sdu + eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].ul_inactivity_timer++; + if (mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti)==NULL) { mac_remove_ue(module_idP, i, frameP, subframeP); } @@ -356,7 +359,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, } else { if (mac_xface->lte_frame_parms->frame_type == FDD) { //FDD - // schedule_RA(module_idP,frameP, subframeP, 0); schedule_ulsch(module_idP, frameP, cooperation_flag, 4, 8); schedule_ue_spec(module_idP, frameP, subframeP, mbsfn_status); fill_DLSCH_dci(module_idP, frameP, subframeP, mbsfn_status); @@ -427,7 +429,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, break; } } else { //FDD - // schedule_ulsch(module_idP,frameP,cooperation_flag,6,0); + schedule_ulsch(module_idP,frameP,cooperation_flag,6,0); schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); } @@ -456,7 +458,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, break; } } else { //FDD - //schedule_ulsch(module_idP,frameP,cooperation_flag,7,1); + schedule_ulsch(module_idP,frameP,cooperation_flag,7,1); schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); } @@ -485,7 +487,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, break; } } else { //FDD - //schedule_ulsch(module_idP,frameP,cooperation_flag,8,2); + schedule_ulsch(module_idP,frameP,cooperation_flag,8,2); schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); } @@ -529,7 +531,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, break; } } else { //FDD - // schedule_ulsch(module_idP,frameP,cooperation_flag,9,3); + schedule_ulsch(module_idP,frameP,cooperation_flag,9,3); schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 8cb6b91301..1fc273feac 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -737,7 +737,7 @@ void initiate_ra_proc(module_id_t module_idP, int CC_id,frame_t frameP, uint16_t uint8_t i; RA_TEMPLATE *RA_template = (RA_TEMPLATE *)&eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[0]; - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,preamble_index); + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,preamble_index); for (i=0; ibsr_info[LCGID0]>0) || (UE_template->bsr_info[LCGID1]>0) || (UE_template->bsr_info[LCGID2]>0) || (UE_template->bsr_info[LCGID3]>0) || - (UE_template->ul_SR>0)) { // uplink scheduling request + (UE_template->ul_SR>0) || + (UE_sched_ctl->ul_inactivity_timer>100)) { // uplink scheduling request + return(1); } else { return(0); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 493ff11d33..b929c71ff4 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -105,6 +105,9 @@ void rx_sdu( } LOG_D(MAC,"[eNB %d] CC_id %d Received ULSCH sdu from PHY (rnti %x, UE_id %d), parsing header\n",enb_mod_idP,CC_idP,rntiP,UE_id); + + if (UE_id!=-1) + UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer=0; payload_ptr = parse_ulsch_header(sduP,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,sdu_lenP); @@ -760,15 +763,17 @@ void schedule_ulsch_rnti(module_id_t module_idP, LOG_T(MAC,"[eNB %d] Frame %d, subframeP %d, UE %d CC %d : got harq pid %d round %d (rnti %x,mode %s)\n", module_idP,frameP,subframeP,UE_id,CC_id, harq_pid, round,rnti,mode_string[eNB_UE_stats->mode]); - //#undef EXMIMO_IOT +#undef EXMIMO_IOT #ifndef EXMIMO_IOT - if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0)) || (round>0) || ((frameP%10)==0)) + if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0)) || (round>0))// || ((frameP%10)==0)) // if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames #else - if (round==0) + if (round==0) // always schedule #endif { + LOG_D(MAC,"[eNB %d][PUSCH] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UE_inactivity timer %d)\n", + module_idP,frameP,subframeP,UE_id,rnti,round,UE_template->ul_SR,UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer); // reset the scheduling request UE_template->ul_SR = 0; aggregation = process_ue_cqi(module_idP,UE_id); // =2 by default!! @@ -855,7 +860,236 @@ void schedule_ulsch_rnti(module_id_t module_idP, TBS, UE_template); - } else if (round > 0) { //we schedule a retransmission + // Cyclic shift for DM RS + if(cooperation_flag == 2) { + if(UE_id == 1) { // For Distriibuted Alamouti, cyclic shift applied to 2nd UE + cshift = 1; + } else { + cshift = 0; + } + } else { + cshift = 0;// values from 0 to 7 can be used for mapping the cyclic shift (36.211 , Table 5.5.2.1.1-1) + } + + if (frame_parms->frame_type == TDD) { + switch (frame_parms->N_RB_UL) { + case 6: + ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; + + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->type = 0; + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0; + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc; + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs; + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi; + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc; + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift; + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0; + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe]; + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req; + + add_ue_spec_dci(DCI_pdu, + ULSCH_dci, + rnti, + sizeof(DCI0_1_5MHz_TDD_1_6_t), + aggregation, + sizeof_DCI0_1_5MHz_TDD_1_6_t, + format0, + 0); + break; + + default: + case 25: + ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; + + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->type = 0; + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0; + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc; + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs; + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi; + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc; + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift; + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0; + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe]; + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req; + + add_ue_spec_dci(DCI_pdu, + ULSCH_dci, + rnti, + sizeof(DCI0_5MHz_TDD_1_6_t), + aggregation, + sizeof_DCI0_5MHz_TDD_1_6_t, + format0, + 0); + break; + + case 50: + ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; + + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->type = 0; + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0; + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc; + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs; + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi; + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc; + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift; + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0; + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe]; + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req; + + add_ue_spec_dci(DCI_pdu, + ULSCH_dci, + rnti, + sizeof(DCI0_10MHz_TDD_1_6_t), + aggregation, + sizeof_DCI0_10MHz_TDD_1_6_t, + format0, + 0); + break; + + case 100: + ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; + + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->type = 0; + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0; + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc; + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs; + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi; + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc; + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift; + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0; + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe]; + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req; + + add_ue_spec_dci(DCI_pdu, + ULSCH_dci, + rnti, + sizeof(DCI0_20MHz_TDD_1_6_t), + aggregation, + sizeof_DCI0_20MHz_TDD_1_6_t, + format0, + 0); + break; + } + } // TDD + else { //FDD + switch (frame_parms->N_RB_UL) { + case 25: + default: + + ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; + + ((DCI0_5MHz_FDD_t *)ULSCH_dci)->type = 0; + ((DCI0_5MHz_FDD_t *)ULSCH_dci)->hopping = 0; + ((DCI0_5MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc; + ((DCI0_5MHz_FDD_t *)ULSCH_dci)->mcs = mcs; + ((DCI0_5MHz_FDD_t *)ULSCH_dci)->ndi = ndi; + ((DCI0_5MHz_FDD_t *)ULSCH_dci)->TPC = tpc; + ((DCI0_5MHz_FDD_t *)ULSCH_dci)->cshift = cshift; + ((DCI0_5MHz_FDD_t *)ULSCH_dci)->padding = 0; + ((DCI0_5MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req; + + add_ue_spec_dci(DCI_pdu, + ULSCH_dci, + rnti, + sizeof(DCI0_5MHz_FDD_t), + aggregation, + sizeof_DCI0_5MHz_FDD_t, + format0, + 0); + break; + + case 6: + ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; + + ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->type = 0; + ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->hopping = 0; + ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc; + ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->mcs = mcs; + ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->ndi = ndi; + ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->TPC = tpc; + ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->cshift = cshift; + ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->padding = 0; + ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req; + + add_ue_spec_dci(DCI_pdu, + ULSCH_dci, + rnti, + sizeof(DCI0_1_5MHz_FDD_t), + aggregation, + sizeof_DCI0_1_5MHz_FDD_t, + format0, + 0); + break; + + case 50: + ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; + + ((DCI0_10MHz_FDD_t *)ULSCH_dci)->type = 0; + ((DCI0_10MHz_FDD_t *)ULSCH_dci)->hopping = 0; + ((DCI0_10MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc; + ((DCI0_10MHz_FDD_t *)ULSCH_dci)->mcs = mcs; + ((DCI0_10MHz_FDD_t *)ULSCH_dci)->ndi = ndi; + ((DCI0_10MHz_FDD_t *)ULSCH_dci)->TPC = tpc; + ((DCI0_10MHz_FDD_t *)ULSCH_dci)->padding = 0; + ((DCI0_10MHz_FDD_t *)ULSCH_dci)->cshift = cshift; + ((DCI0_10MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req; + + add_ue_spec_dci(DCI_pdu, + ULSCH_dci, + rnti, + sizeof(DCI0_10MHz_FDD_t), + aggregation, + sizeof_DCI0_10MHz_FDD_t, + format0, + 0); + break; + + case 100: + ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; + + ((DCI0_20MHz_FDD_t *)ULSCH_dci)->type = 0; + ((DCI0_20MHz_FDD_t *)ULSCH_dci)->hopping = 0; + ((DCI0_20MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc; + ((DCI0_20MHz_FDD_t *)ULSCH_dci)->mcs = mcs; + ((DCI0_20MHz_FDD_t *)ULSCH_dci)->ndi = ndi; + ((DCI0_20MHz_FDD_t *)ULSCH_dci)->TPC = tpc; + ((DCI0_20MHz_FDD_t *)ULSCH_dci)->padding = 0; + ((DCI0_20MHz_FDD_t *)ULSCH_dci)->cshift = cshift; + ((DCI0_20MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req; + + add_ue_spec_dci(DCI_pdu, + ULSCH_dci, + rnti, + sizeof(DCI0_20MHz_FDD_t), + aggregation, + sizeof_DCI0_20MHz_FDD_t, + format0, + 0); + break; + + } + } + + + add_ue_ulsch_info(module_idP, + CC_id, + UE_id, + subframeP, + S_UL_SCHEDULED); + + LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP,CC_id,frameP,subframeP,UE_id); +#ifdef DEBUG + dump_dci(frame_parms, &DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci-1]); +#endif + + } + else { + LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d,round %d)\n", + module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs, + first_rb[CC_id],rb_table[rb_table_index], + rb_table_index,TBS,harq_pid,round); + }/* + else if (round > 0) { //we schedule a retransmission ndi = UE_template->oldNDI_UL[harq_pid]; @@ -866,7 +1100,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, } - LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE retransmission (mcs %d, first rb %d, nb_rb %d, harq_pid %d, round %d)\n", + LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE retransmission (mcs %d, first rb %d, nb_rb %d, harq_pid %d, round %d)\n", module_idP,UE_id,rnti,CC_id,frameP,subframeP,mcs, first_rb[CC_id],UE_template->nb_rb_ul[harq_pid], harq_pid, round); @@ -882,227 +1116,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1=mcs; UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=mcs; } - - // Cyclic shift for DM RS - if(cooperation_flag == 2) { - if(UE_id == 1) { // For Distriibuted Alamouti, cyclic shift applied to 2nd UE - cshift = 1; - } else { - cshift = 0; - } - } else { - cshift = 0;// values from 0 to 7 can be used for mapping the cyclic shift (36.211 , Table 5.5.2.1.1-1) - } - - if (frame_parms->frame_type == TDD) { - switch (frame_parms->N_RB_UL) { - case 6: - ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; - - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->type = 0; - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0; - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc; - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs; - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi; - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc; - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift; - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0; - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe]; - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req; - - add_ue_spec_dci(DCI_pdu, - ULSCH_dci, - rnti, - sizeof(DCI0_1_5MHz_TDD_1_6_t), - aggregation, - sizeof_DCI0_1_5MHz_TDD_1_6_t, - format0, - 0); - break; - - default: - case 25: - ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; - - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->type = 0; - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0; - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc; - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs; - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi; - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc; - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift; - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0; - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe]; - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req; - - add_ue_spec_dci(DCI_pdu, - ULSCH_dci, - rnti, - sizeof(DCI0_5MHz_TDD_1_6_t), - aggregation, - sizeof_DCI0_5MHz_TDD_1_6_t, - format0, - 0); - break; - - case 50: - ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; - - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->type = 0; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe]; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req; - - add_ue_spec_dci(DCI_pdu, - ULSCH_dci, - rnti, - sizeof(DCI0_10MHz_TDD_1_6_t), - aggregation, - sizeof_DCI0_10MHz_TDD_1_6_t, - format0, - 0); - break; - - case 100: - ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; - - ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->type = 0; - ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0; - ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc; - ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs; - ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi; - ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc; - ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0; - ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe]; - ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req; - - add_ue_spec_dci(DCI_pdu, - ULSCH_dci, - rnti, - sizeof(DCI0_20MHz_TDD_1_6_t), - aggregation, - sizeof_DCI0_20MHz_TDD_1_6_t, - format0, - 0); - break; - } - } // TDD - else { //FDD - switch (frame_parms->N_RB_UL) { - case 25: - default: - - ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; - - ((DCI0_5MHz_FDD_t *)ULSCH_dci)->type = 0; - ((DCI0_5MHz_FDD_t *)ULSCH_dci)->hopping = 0; - ((DCI0_5MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc; - ((DCI0_5MHz_FDD_t *)ULSCH_dci)->mcs = mcs; - ((DCI0_5MHz_FDD_t *)ULSCH_dci)->ndi = ndi; - ((DCI0_5MHz_FDD_t *)ULSCH_dci)->TPC = tpc; - ((DCI0_5MHz_FDD_t *)ULSCH_dci)->cshift = cshift; - ((DCI0_5MHz_FDD_t *)ULSCH_dci)->padding = 0; - ((DCI0_5MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req; - - add_ue_spec_dci(DCI_pdu, - ULSCH_dci, - rnti, - sizeof(DCI0_5MHz_FDD_t), - aggregation, - sizeof_DCI0_5MHz_FDD_t, - format0, - 0); - break; - - case 6: - ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; - - ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->type = 0; - ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->hopping = 0; - ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc; - ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->mcs = mcs; - ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->ndi = ndi; - ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->TPC = tpc; - ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->cshift = cshift; - ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->padding = 0; - ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req; - - add_ue_spec_dci(DCI_pdu, - ULSCH_dci, - rnti, - sizeof(DCI0_1_5MHz_FDD_t), - aggregation, - sizeof_DCI0_1_5MHz_FDD_t, - format0, - 0); - break; - - case 50: - ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; - - ((DCI0_10MHz_FDD_t *)ULSCH_dci)->type = 0; - ((DCI0_10MHz_FDD_t *)ULSCH_dci)->hopping = 0; - ((DCI0_10MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc; - ((DCI0_10MHz_FDD_t *)ULSCH_dci)->mcs = mcs; - ((DCI0_10MHz_FDD_t *)ULSCH_dci)->ndi = ndi; - ((DCI0_10MHz_FDD_t *)ULSCH_dci)->TPC = tpc; - ((DCI0_10MHz_FDD_t *)ULSCH_dci)->padding = 0; - ((DCI0_10MHz_FDD_t *)ULSCH_dci)->cshift = cshift; - ((DCI0_10MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req; - - add_ue_spec_dci(DCI_pdu, - ULSCH_dci, - rnti, - sizeof(DCI0_10MHz_FDD_t), - aggregation, - sizeof_DCI0_10MHz_FDD_t, - format0, - 0); - break; - - case 100: - ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; - - ((DCI0_20MHz_FDD_t *)ULSCH_dci)->type = 0; - ((DCI0_20MHz_FDD_t *)ULSCH_dci)->hopping = 0; - ((DCI0_20MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc; - ((DCI0_20MHz_FDD_t *)ULSCH_dci)->mcs = mcs; - ((DCI0_20MHz_FDD_t *)ULSCH_dci)->ndi = ndi; - ((DCI0_20MHz_FDD_t *)ULSCH_dci)->TPC = tpc; - ((DCI0_20MHz_FDD_t *)ULSCH_dci)->padding = 0; - ((DCI0_20MHz_FDD_t *)ULSCH_dci)->cshift = cshift; - ((DCI0_20MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req; - - add_ue_spec_dci(DCI_pdu, - ULSCH_dci, - rnti, - sizeof(DCI0_20MHz_FDD_t), - aggregation, - sizeof_DCI0_20MHz_FDD_t, - format0, - 0); - break; - - } - } - - add_ue_ulsch_info(module_idP, - CC_id, - UE_id, - subframeP, - S_UL_SCHEDULED); - - LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP,CC_id,frameP,subframeP,UE_id); -#ifdef DEBUG - dump_dci(frame_parms, &DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci-1]); -#endif + */ } // UE_is_to_be_scheduled } // UE is in PUSCH diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 410d454419..89702742a9 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -1104,7 +1104,7 @@ void store_ulsch_buffer(module_id_t module_idP, int frameP, sub_frame_t subframe } if ( UE_template->ul_total_buffer >0) - LOG_D(MAC,"[eNB %d] Frame %d subframe %d UE %d CC id %d: LCGID0 %d, LCGID1 %d, LCGID2 %d LCGID3 %d, BO %d\n", + LOG_I(MAC,"[eNB %d] Frame %d subframe %d UE %d CC id %d: LCGID0 %d, LCGID1 %d, LCGID2 %d LCGID3 %d, BO %d\n", module_idP, frameP,subframeP, UE_id, UE_PCCID(module_idP,UE_id), UE_template->ul_buffer_info[LCGID0], UE_template->ul_buffer_info[LCGID1], diff --git a/openair2/LAYER2/MAC/rar_tools.c b/openair2/LAYER2/MAC/rar_tools.c index 2e97f83fac..4b5c576aa6 100644 --- a/openair2/LAYER2/MAC/rar_tools.c +++ b/openair2/LAYER2/MAC/rar_tools.c @@ -117,7 +117,7 @@ unsigned short fill_rar( rar[2] |= ((mcs&0x8)>>3); // mcs 10 rar[3] = (((mcs&0x7)<<5)) | ((TPC&7)<<2) | ((ULdelay&1)<<1) | (cqireq&1); - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Generating RAR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ra_idx %d, CRNTI %x,preamble %d/%d,TIMING OFFSET %d\n", + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Generating RAR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ra_idx %d, CRNTI %x,preamble %d/%d,TIMING OFFSET %d\n", module_idP, CC_id, frameP, *(uint8_t*)rarh,rar[0],rar[1],rar[2],rar[3],rar[4],rar[5], @@ -168,14 +168,14 @@ ue_process_rar( LOG_D(MAC,"[UE %d][RAPROC] rarh->RAPID %d\n",module_idP,rarh->RAPID); // LOG_I(MAC,"[UE %d][RAPROC] rar->R %d\n",module_idP,rar->R); - LOG_I(MAC,"[UE %d][RAPROC] rar->Timing_Advance_Command %d\n",module_idP,(((uint16_t)(rar[0]&0x7f))<<4) + (rar[1]>>4)); + LOG_D(MAC,"[UE %d][RAPROC] rar->Timing_Advance_Command %d\n",module_idP,(((uint16_t)(rar[0]&0x7f))<<4) + (rar[1]>>4)); // LOG_I(MAC,"[UE %d][RAPROC] rar->hopping_flag %d\n",module_idP,rar->hopping_flag); // LOG_I(MAC,"[UE %d][RAPROC] rar->rb_alloc %d\n",module_idP,rar->rb_alloc); // LOG_I(MAC,"[UE %d][RAPROC] rar->mcs %d\n",module_idP,rar->mcs); // LOG_I(MAC,"[UE %d][RAPROC] rar->TPC %d\n",module_idP,rar->TPC); // LOG_I(MAC,"[UE %d][RAPROC] rar->UL_delay %d\n",module_idP,rar->UL_delay); // LOG_I(MAC,"[UE %d][RAPROC] rar->cqi_req %d\n",module_idP,rar->cqi_req); - LOG_I(MAC,"[UE %d][RAPROC] rar->t_crnti %x\n",module_idP,(uint16_t)rar[5]+(rar[4]<<8)); + LOG_D(MAC,"[UE %d][RAPROC] rar->t_crnti %x\n",module_idP,(uint16_t)rar[5]+(rar[4]<<8)); #endif diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index e94e7c79a9..2ce9598129 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -140,10 +140,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index e67bcb6b07..a42e5196b4 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -164,7 +164,7 @@ FD_lte_phy_scope_ue *form_ue[NUMBER_OF_UE_MAX]; FD_lte_phy_scope_enb *form_enb[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; FD_stats_form *form_stats=NULL,*form_stats_l2=NULL; char title[255]; -unsigned char scope_enb_num_ue = 1; +unsigned char scope_enb_num_ue = 2; #endif //XFORMS #ifdef RTAI @@ -504,6 +504,7 @@ static void *scope_thread(void *arg) int len = 0; struct sched_param sched_param; int UE_id, CC_id; + int ue_cnt=0; sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO)+1; sched_setscheduler(0, SCHED_FIFO,&sched_param); @@ -547,11 +548,15 @@ static void *scope_thread(void *arg) fl_clear_browser(form_stats->stats_text); fl_add_browser_line(form_stats->stats_text, stats_buffer); - for(UE_id=0; UE_iddlsch_eNB[UE_id][0]->rnti>0) && (ue_cnt Date: Wed, 3 Feb 2016 11:17:27 +0100 Subject: [PATCH 037/214] bugfix in phy_scope_lte increase maximum users in eNodeB to 16 --- openair1/PHY/LTE_TRANSPORT/print_stats.c | 1 - openair1/PHY/impl_defs_top.h | 2 +- openair2/LAYER2/MAC/pre_processor.c | 2 +- openair2/RRC/LITE/rrc_eNB.c | 3 +++ .../GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf | 4 ++-- targets/RT/USER/lte-softmodem.c | 4 ++-- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/print_stats.c b/openair1/PHY/LTE_TRANSPORT/print_stats.c index 0548fd2f4f..54c32cdca6 100644 --- a/openair1/PHY/LTE_TRANSPORT/print_stats.c +++ b/openair1/PHY/LTE_TRANSPORT/print_stats.c @@ -630,7 +630,6 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) phy_vars_eNB->eNB_UE_stats[UE_id].sector); len+= sprintf(&buffer[len],"DL mcs %d, UL mcs %d, UL rb %d, delta_TF %d, ", - i, phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[0]->mcs, phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[0]->mcs, phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[0]->nb_rb, diff --git a/openair1/PHY/impl_defs_top.h b/openair1/PHY/impl_defs_top.h index 69d8e16649..e55e28e3be 100755 --- a/openair1/PHY/impl_defs_top.h +++ b/openair1/PHY/impl_defs_top.h @@ -342,7 +342,7 @@ typedef struct { #define MAX_FRAME_NUMBER 0x400 #if defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP) #define NUMBER_OF_eNB_MAX 1 -#define NUMBER_OF_UE_MAX 4 +#define NUMBER_OF_UE_MAX 16 #define NUMBER_OF_CONNECTED_eNB_MAX 3 #else #ifdef LARGE_SCALE diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 89702742a9..410d454419 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -1104,7 +1104,7 @@ void store_ulsch_buffer(module_id_t module_idP, int frameP, sub_frame_t subframe } if ( UE_template->ul_total_buffer >0) - LOG_I(MAC,"[eNB %d] Frame %d subframe %d UE %d CC id %d: LCGID0 %d, LCGID1 %d, LCGID2 %d LCGID3 %d, BO %d\n", + LOG_D(MAC,"[eNB %d] Frame %d subframe %d UE %d CC id %d: LCGID0 %d, LCGID1 %d, LCGID2 %d LCGID3 %d, BO %d\n", module_idP, frameP,subframeP, UE_id, UE_PCCID(module_idP,UE_id), UE_template->ul_buffer_info[LCGID0], UE_template->ul_buffer_info[LCGID1], diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index 1d0b5f2902..c7cb18eab0 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -3714,11 +3714,14 @@ rrc_eNB_decode_ccch( random_value = (((uint64_t)mme_code) << 32) | m_tmsi; if ((ue_context_p = rrc_eNB_ue_context_stmsi_exist(ctxt_pP, mme_code, m_tmsi))) { #warning "TODO: stmsi_exist: remove UE from MAC/PHY (how?)" + LOG_I(RRC,PROTOCOL_RRC_CTXT_UE_FMT" S-TMSI exists, ue_context_p %p\n",ue_context_p); // AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)"); ue_context_p = NULL; } else { ue_context_p = rrc_eNB_get_next_free_ue_context(ctxt_pP, NOT_A_RANDOM_UE_IDENTITY); } + if (ue_context_p==NULL) + AssertFatal(0 == 1, "ue_context_p is null"); ue_context_p->ue_context.Initialue_identity_s_TMSI.presence = TRUE; ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code = mme_code; ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi = m_tmsi; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index 2ce9598129..d81099533a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -140,10 +140,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index a42e5196b4..a609863550 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -316,7 +316,7 @@ static LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; int multi_thread=1; uint32_t target_dl_mcs = 28; //maximum allowed mcs -uint32_t target_ul_mcs = 10; +uint32_t target_ul_mcs = 19; uint32_t timing_advance = 0; uint8_t exit_missed_slots=1; uint64_t num_missed_slots=0; // counter for the number of missed slots @@ -552,7 +552,7 @@ static void *scope_thread(void *arg) for(UE_id=0; UE_iddlsch_eNB[UE_id][0]->rnti>0) && (ue_cnt Date: Sun, 14 Feb 2016 14:32:11 -0800 Subject: [PATCH 038/214] added UL failure indication to PHY/MAC/RRC eNodeB procedures. --- cmake_targets/CMakeLists.txt | 4 +- openair1/SCHED/phy_procedures_lte_eNb.c | 12 ++- openair1/SCHED/phy_procedures_lte_ue.c | 6 +- openair2/LAYER2/MAC/defs.h | 2 + openair2/LAYER2/MAC/eNB_scheduler.c | 100 +++++++++++++++++- .../LAYER2/MAC/eNB_scheduler_primitives.c | 47 +++++--- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 5 +- openair2/LAYER2/MAC/main.c | 5 +- openair2/LAYER2/MAC/proto.h | 9 ++ openair2/LAYER2/PDCP_v10.1.0/pdcp.c | 8 +- openair2/PHY_INTERFACE/defs.h | 3 +- .../L2_INTERFACE/openair_rrc_L2_interface.c | 8 +- openair2/RRC/LITE/L2_interface.c | 27 +++-- openair2/RRC/LITE/proto.h | 28 +++-- openair2/RRC/LITE/rrc_UE.c | 84 +++++++-------- openair2/RRC/LITE/rrc_common.c | 2 +- openair2/RRC/LITE/rrc_eNB.c | 90 ++++++++-------- openair2/RRC/LITE/rrc_eNB_S1AP.c | 18 ++-- 18 files changed, 305 insertions(+), 153 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index f52a3c465f..7907d68f45 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -940,8 +940,8 @@ set (ENB_APP_SRC add_library(L2 ${L2_SRC} ${MAC_SRC} - ${ENB_APP_SRC} - ${OPENAIR2_DIR}/RRC/L2_INTERFACE/openair_rrc_L2_interface.c) + ${ENB_APP_SRC}) +# ${OPENAIR2_DIR}/RRC/L2_INTERFACE/openair_rrc_L2_interface.c) # L3 Libs ########################## diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index d54e6856f3..a7796a9b69 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1342,13 +1342,21 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e // If we've dropped the UE, go back to PRACH mode for this UE //#if !defined(EXMIMO_IOT) if (phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors == ULSCH_max_consecutive_errors) { - LOG_W(PHY,"[eNB %d, CC %d] frame %d, subframe %d, UE %d: ULSCH consecutive error count reached %u, removing UE\n", + LOG_W(PHY,"[eNB %d, CC %d] frame %d, subframe %d, UE %d: ULSCH consecutive error count reached %u, triggering UL Failure\n", phy_vars_eNB->Mod_id,phy_vars_eNB->CC_id,frame,subframe, i, phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors); + /* phy_vars_eNB->eNB_UE_stats[i].mode = PRACH; remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB,abstraction_flag); + */ phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors=0; + mac_xface->UL_failure_indication(phy_vars_eNB->Mod_id, + phy_vars_eNB->CC_id, + frame, + phy_vars_eNB->eNB_UE_stats[i].crnti, + subframe); + } - + //#endif } diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index bc84beae43..ef93068fb4 100755 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -2676,7 +2676,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac if (ret == (1+phy_vars_ue->dlsch_ue[eNB_id][0]->max_turbo_iterations)) { phy_vars_ue->dlsch_errors[eNB_id]++; - //#ifdef DEBUG_PHY_PROC +#ifdef DEBUG_PHY_PROC LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d DLSCH in error (rv %d,mcs %d,TBS %d)\n", phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti, harq_pid,frame_rx,subframe_prev, @@ -2686,8 +2686,8 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac // if (abstraction_flag ==0 ) dump_dlsch(phy_vars_ue,eNB_id,subframe_prev,harq_pid); - mac_xface->macphy_exit(""); - //#endif + mac_xface->macphy_exit("DLSCH in error"); +#endif } else { LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d (slot_rx %d): Received DLSCH (rv %d,mcs %d,TBS %d)\n", phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti, diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index 7a48413b7a..493ecece78 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -740,6 +740,8 @@ typedef struct { int16_t ta_update; int32_t context_active_timer; int32_t ul_inactivity_timer; + int32_t ul_failure_timer; + int32_t ra_pdcch_order_sent; } UE_sched_ctrl; /*! \brief eNB template for the Random access information */ typedef struct { diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index d603ad4237..d5de3bbae6 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -90,7 +90,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, #endif #if defined(ENABLE_ITTI) MessageDef *msg_p; - const char *msg_name; + const char *msg_name; instance_t instance; int result; #endif @@ -98,6 +98,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, int CC_id,i,next_i; UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list; rnti_t rnti; + int ra_pdcch_sent=0; + void *DLSCH_dci=NULL; + int size_bits,size_bytes; LOG_D(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler (UE_list->head %d)\n",module_idP, frameP, subframeP,UE_list->head); @@ -129,6 +132,101 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, if (mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti)==NULL) { mac_remove_ue(module_idP, i, frameP, subframeP); } + else { + // check uplink failure + if (UE_list->UE_sched_ctrl[i].ul_failure_timer>0) { + LOG_I(MAC,"UE %d rnti %x: UL Failure timer %d \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); + if (UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent == 0) { + if (ra_pdcch_sent==0) { + UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=1; + ra_pdcch_sent=1; + + // add a format 1A dci for this UE to request an RA procedure (only one UE per subframe) + LOG_I(MAC,"UE %d rnti %x: sending PDCCH order for RAPROC \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); + DLSCH_dci = (void *)UE_list->UE_template[CC_id][i].DLSCH_DCI[0]; + *(uint32_t*)DLSCH_dci = 0; + if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { + switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { + case 6: + ((DCI1A_1_5MHz_TDD_1_6_t*)DLSCH_dci)->type = 1; + ((DCI1A_1_5MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 31; + size_bytes = sizeof(DCI1A_1_5MHz_TDD_1_6_t); + size_bits = sizeof_DCI1A_1_5MHz_TDD_1_6_t; + break; + case 25: + ((DCI1A_5MHz_TDD_1_6_t*)DLSCH_dci)->type = 1; + ((DCI1A_5MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 511; + size_bytes = sizeof(DCI1A_5MHz_TDD_1_6_t); + size_bits = sizeof_DCI1A_5MHz_TDD_1_6_t; + break; + case 50: + ((DCI1A_10MHz_TDD_1_6_t*)DLSCH_dci)->type = 1; + ((DCI1A_10MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 2047; + size_bytes = sizeof(DCI1A_10MHz_TDD_1_6_t); + size_bits = sizeof_DCI1A_10MHz_TDD_1_6_t; + break; + case 100: + ((DCI1A_20MHz_TDD_1_6_t*)DLSCH_dci)->type = 1; + ((DCI1A_20MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 8191; + size_bytes = sizeof(DCI1A_20MHz_TDD_1_6_t); + size_bits = sizeof_DCI1A_20MHz_TDD_1_6_t; + break; + } + } + else { // FDD + switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { + case 6: + ((DCI1A_1_5MHz_FDD_t*)DLSCH_dci)->type = 1; + ((DCI1A_1_5MHz_FDD_t*)DLSCH_dci)->rballoc = 31; + size_bytes = sizeof(DCI1A_1_5MHz_FDD_t); + size_bits = sizeof_DCI1A_1_5MHz_FDD_t; + break; + case 25: + ((DCI1A_5MHz_FDD_t*)DLSCH_dci)->type = 1; + ((DCI1A_5MHz_FDD_t*)DLSCH_dci)->rballoc = 511; + size_bytes = sizeof(DCI1A_5MHz_FDD_t); + size_bits = sizeof_DCI1A_5MHz_FDD_t; + break; + case 50: + ((DCI1A_10MHz_FDD_t*)DLSCH_dci)->type = 1; + ((DCI1A_10MHz_FDD_t*)DLSCH_dci)->rballoc = 2047; + size_bytes = sizeof(DCI1A_10MHz_FDD_t); + size_bits = sizeof_DCI1A_10MHz_FDD_t; + break; + case 100: + ((DCI1A_20MHz_FDD_t*)DLSCH_dci)->type = 1; + ((DCI1A_20MHz_FDD_t*)DLSCH_dci)->rballoc = 8191; + size_bytes = sizeof(DCI1A_20MHz_FDD_t); + size_bits = sizeof_DCI1A_20MHz_FDD_t; + break; + } + } + + add_ue_spec_dci(DCI_pdu[CC_id], + DLSCH_dci, + rnti, + size_bytes, + process_ue_cqi (module_idP,i),//aggregation, + size_bits, + format1A, + 0); + } + else { // ra_pdcch_sent==1 + if ((UE_list->UE_sched_ctrl[i].ul_failure_timer % 40) == 0) + UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=0; // resend every 4 frames + } + } + UE_list->UE_sched_ctrl[i].ul_failure_timer++; + // check threshold + if (UE_list->UE_sched_ctrl[i].ul_failure_timer > 200) { + // inform RRC of failure and clear timer + LOG_I(MAC,"UE %d rnti %x: UL Failure Triggering RRC \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); + mac_eNB_rrc_ul_failure(module_idP,CC_id,frameP,subframeP,rnti); + UE_list->UE_sched_ctrl[i].ul_failure_timer=0; + } + } // ul_failure_timer>0 + + } i = next_i; } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 35ffe3b561..8c8eeff148 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -530,22 +530,9 @@ void swap_UEs(UE_list_t *listP,int nodeiP, int nodejP, int ul_flag) dump_ue_list(listP,ul_flag); } -void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP) -{ - int UE_id = find_UE_id(mod_idP, rntiP); - UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list; - if (UE_id != -1) { - LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); - UE_list->UE_template[cc_idP][UE_id].ul_SR = 1; - UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE; - } else { - // AssertFatal(0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP); - // AssertError(0, 0, "Frame %d: find_UE_id(%u,rnti %d) not found\n", frameP, enb_mod_idP, rntiP); - LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d (unknown UEid) on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); - } -} + @@ -1108,3 +1095,35 @@ boolean_t CCE_allocation_infeasible(int module_idP, return(res); } +void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP) +{ + + int UE_id = find_UE_id(mod_idP, rntiP); + UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list; + + if (UE_id != -1) { + LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); + UE_list->UE_template[cc_idP][UE_id].ul_SR = 1; + UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE; + } else { + // AssertFatal(0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP); + // AssertError(0, 0, "Frame %d: find_UE_id(%u,rnti %d) not found\n", frameP, enb_mod_idP, rntiP); + LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d (unknown UEid) on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); + } +} + +void UL_failure_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP) +{ + + int UE_id = find_UE_id(mod_idP, rntiP); + UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list; + + if (UE_id != -1) { + LOG_I(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling UL Failure for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=1; + } else { + // AssertFatal(0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP); + // AssertError(0, 0, "Frame %d: find_UE_id(%u,rnti %d) not found\n", frameP, enb_mod_idP, rntiP); + LOG_W(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling UL Failure for UE %d (unknown UEid) on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); + } +} diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index b929c71ff4..42f19cc2ae 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -106,9 +106,10 @@ void rx_sdu( LOG_D(MAC,"[eNB %d] CC_id %d Received ULSCH sdu from PHY (rnti %x, UE_id %d), parsing header\n",enb_mod_idP,CC_idP,rntiP,UE_id); - if (UE_id!=-1) + if (UE_id!=-1) { UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer=0; - + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=0; + } payload_ptr = parse_ulsch_header(sduP,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,sdu_lenP); eNB->eNB_stats[CC_idP].ulsch_bytes_rx=sdu_lenP; diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index 0e8a65cf01..32cb3b1738 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -84,7 +84,7 @@ void dl_phy_sync_success(module_id_t module_idP, } else #endif { - mac_in_sync_ind(module_idP,frameP,eNB_index); + rrc_in_sync_ind(module_idP,frameP,eNB_index); } } @@ -382,7 +382,7 @@ int mac_init_global_param(void) // mac_xface->macphy_data_ind=macphy_data_ind; mac_xface->mrbch_phy_sync_failure=mrbch_phy_sync_failure; mac_xface->dl_phy_sync_success=dl_phy_sync_success; - mac_xface->out_of_sync_ind=mac_out_of_sync_ind; + mac_xface->out_of_sync_ind=rrc_out_of_sync_ind; // Mac_rlc_xface->macphy_exit= mac_xface->macphy_exit; // Mac_rlc_xface->frame = 0; @@ -462,6 +462,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui mac_xface->initiate_ra_proc = initiate_ra_proc; mac_xface->cancel_ra_proc = cancel_ra_proc; mac_xface->SR_indication = SR_indication; + mac_xface->UL_failure_indication = UL_failure_indication; mac_xface->rx_sdu = rx_sdu; mac_xface->get_dlsch_sdu = get_dlsch_sdu; mac_xface->get_eNB_UE_stats = get_eNB_UE_stats; diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 9afe098d77..632d8c8360 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -269,6 +269,15 @@ void rx_sdu(const module_id_t module_idP, const int CC_id,const frame_t frameP, */ void SR_indication(module_id_t module_idP,int CC_id,frame_t frameP,rnti_t rnti, sub_frame_t subframe); +/* \brief Function to indicate a UL failure was detected by eNB PHY. +@param Mod_id Instance ID of eNB +@param CC_id Component carrier +@param frameP Frame index +@param rnti RNTI of UE transmitting the SR +@param subframe Index of subframe where SR was received +*/ +void UL_failure_indication(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,sub_frame_t subframe); + uint8_t *get_dlsch_sdu(module_id_t module_idP,int CC_id,frame_t frameP,rnti_t rnti,uint8_t TBindex); /* \brief Function to retrieve MCH transport block and MCS used for MCH in this MBSFN subframe. Returns null if no MCH is to be transmitted diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index f25e921570..a612733e67 100755 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -636,10 +636,10 @@ pdcp_data_ind( PROTOCOL_PDCP_CTXT_FMT" DATA-IND len %u", PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p), sdu_buffer_sizeP - pdcp_header_len - pdcp_tailer_len); - pdcp_rrc_data_ind(ctxt_pP, - rb_id, - sdu_buffer_sizeP - pdcp_header_len - pdcp_tailer_len, - (uint8_t*)&sdu_buffer_pP->data[pdcp_header_len]); + rrc_data_ind(ctxt_pP, + rb_id, + sdu_buffer_sizeP - pdcp_header_len - pdcp_tailer_len, + (uint8_t*)&sdu_buffer_pP->data[pdcp_header_len]); free_mem_block(sdu_buffer_pP); // free_mem_block(new_sdu); diff --git a/openair2/PHY_INTERFACE/defs.h b/openair2/PHY_INTERFACE/defs.h index 7b0367f537..194b085118 100755 --- a/openair2/PHY_INTERFACE/defs.h +++ b/openair2/PHY_INTERFACE/defs.h @@ -94,7 +94,8 @@ typedef struct { /// Indicate Scheduling Request from UE void (*SR_indication)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,sub_frame_t subframe); - + /// Indicate UL Failure to eNodeB MAC + void (*UL_failure_indication)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,sub_frame_t subframe); /// Configure Common PHY parameters from SIB1 void (*phy_config_sib1_eNB)(module_id_t Mod_id,int CC_id, TDD_Config_t *tdd_config, diff --git a/openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.c b/openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.c index 732d2aa54a..702433744d 100644 --- a/openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.c +++ b/openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.c @@ -155,10 +155,10 @@ rlcrrc_data_ind( ) //------------------------------------------------------------------------------ { - rrc_lite_data_ind(ctxt_pP, - srb_idP, - sdu_lenP, - buffer_pP); + rrc_data_ind(ctxt_pP, + srb_idP, + sdu_lenP, + buffer_pP); } //------------------------------------------------------------------------------ diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c index 6a64095e92..cea9640275 100644 --- a/openair2/RRC/LITE/L2_interface.c +++ b/openair2/RRC/LITE/L2_interface.c @@ -67,7 +67,7 @@ mui_t mui=0; //------------------------------------------------------------------------------ int8_t -mac_rrc_lite_data_req( +mac_rrc_data_req( const module_id_t Mod_idP, const int CC_id, const frame_t frameP, @@ -98,7 +98,7 @@ mac_rrc_lite_data_req( // All even frames transmit SIB in SF 5 if (eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB1 == 255) { LOG_E(RRC,"[eNB %d] MAC Request for SIB1 and SIB1 not initialized\n",Mod_idP); - mac_xface->macphy_exit("mac_rrc_lite_data_req: MAC Request for SIB1 and SIB1 not initialized"); + mac_xface->macphy_exit("mac_rrc_data_req: MAC Request for SIB1 and SIB1 not initialized"); } if ((frameP%2) == 0) { @@ -337,7 +337,7 @@ mac_rrc_lite_data_req( //------------------------------------------------------------------------------ int8_t -mac_rrc_lite_data_ind( +mac_rrc_data_ind( const module_id_t module_idP, const int CC_id, const frame_t frameP, @@ -505,14 +505,14 @@ mac_rrc_lite_data_ind( //-------------------------------------------------------------------------------------------// // this function is Not USED anymore -void mac_lite_sync_ind(module_id_t Mod_idP,uint8_t Status) +void mac_sync_ind(module_id_t Mod_idP,uint8_t Status) { //-------------------------------------------------------------------------------------------// } //------------------------------------------------------------------------------ uint8_t -rrc_lite_data_req( +rrc_data_req( const protocol_ctxt_t* const ctxt_pP, const rb_id_t rb_idP, const mui_t muiP, @@ -582,7 +582,7 @@ rrc_lite_data_req( //------------------------------------------------------------------------------ void -rrc_lite_data_ind( +rrc_data_ind( const protocol_ctxt_t* const ctxt_pP, const rb_id_t Srb_id, const sdu_size_t sdu_sizeP, @@ -646,7 +646,7 @@ rrc_lite_data_ind( } //-------------------------------------------------------------------------------------------// -void rrc_lite_in_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index) +void rrc_in_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index) { //-------------------------------------------------------------------------------------------// #if defined(ENABLE_ITTI) @@ -670,7 +670,7 @@ void rrc_lite_in_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_inde } //-------------------------------------------------------------------------------------------// -void rrc_lite_out_of_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index) +void rrc_out_of_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index) { //-------------------------------------------------------------------------------------------// LOG_I(RRC,"[UE %d] Frame %d: OUT OF SYNC FROM eNB %d (T310 active %d : T310 %d, N310 %d, N311 %d)\n ", @@ -697,7 +697,7 @@ void rrc_lite_out_of_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_ //------------------------------------------------------------------------------ int -mac_eNB_get_rrc_lite_status( +mac_eNB_get_rrc_status( const module_id_t Mod_idP, const rnti_t rntiP ) @@ -715,10 +715,17 @@ mac_eNB_get_rrc_lite_status( } } +void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP, + const int CC_id, + const frame_t frameP, + const sub_frame_t subframeP, + const rnti_t rnti) { + return; +} //------------------------------------------------------------------------------ int -mac_UE_get_rrc_lite_status( +mac_UE_get_rrc_status( const module_id_t Mod_idP, const uint8_t indexP ) diff --git a/openair2/RRC/LITE/proto.h b/openair2/RRC/LITE/proto.h index 5d77698c8e..cde0643ee1 100644 --- a/openair2/RRC/LITE/proto.h +++ b/openair2/RRC/LITE/proto.h @@ -44,15 +44,15 @@ int L3_xface_init(void); void openair_rrc_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active,uint8_t HO_enabled); #if defined(ENABLE_ITTI) char -openair_rrc_lite_eNB_configuration( +openair_rrc_eNB_configuration( const module_id_t enb_mod_idP, RrcConfigurationReq* configuration ); #endif -char openair_rrc_lite_eNB_init( +char openair_rrc_eNB_init( const module_id_t module_idP); -char openair_rrc_lite_ue_init( +char openair_rrc_ue_init( const module_id_t module_idP, const uint8_t CH_IDX); void rrc_config_buffer(SRB_INFO *srb_info, uint8_t Lchan_type, uint8_t Role); @@ -281,7 +281,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover( //L2_interface.c int8_t -mac_rrc_lite_data_req( +mac_rrc_data_req( const module_id_t Mod_idP, const int CC_id, const frame_t frameP, @@ -294,7 +294,7 @@ mac_rrc_lite_data_req( ); int8_t -mac_rrc_lite_data_ind( +mac_rrc_data_ind( const module_id_t module_idP, const int CC_id, const frame_t frameP, @@ -310,8 +310,14 @@ mac_rrc_lite_data_ind( void mac_sync_ind( module_id_t Mod_instP, uint8_t status); +void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP, + const int CC_id, + const frame_t frameP, + const sub_frame_t subframeP, + const rnti_t rnti); + uint8_t -rrc_lite_data_req( +rrc_data_req( const protocol_ctxt_t* const ctxt_pP, const rb_id_t rb_idP, const mui_t muiP, @@ -322,16 +328,16 @@ rrc_lite_data_req( ); void -rrc_lite_data_ind( +rrc_data_ind( const protocol_ctxt_t* const ctxt_pP, const rb_id_t Srb_id, const sdu_size_t sdu_sizeP, const uint8_t* const buffer_pP ); -void rrc_lite_in_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t eNB_index); +void rrc_in_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t eNB_index); -void rrc_lite_out_of_sync_ind(module_id_t module_idP, frame_t frameP, unsigned short eNB_index); +void rrc_out_of_sync_ind(module_id_t module_idP, frame_t frameP, unsigned short eNB_index); int decode_MCCH_Message( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, const uint8_t* const Sdu, const uint8_t Sdu_len, const uint8_t mbsfn_sync_area ); @@ -356,13 +362,13 @@ ue_measurement_report_triggering( ); int -mac_eNB_get_rrc_lite_status( +mac_eNB_get_rrc_status( const module_id_t Mod_idP, const rnti_t rntiP ); int -mac_UE_get_rrc_lite_status( +mac_UE_get_rrc_status( const module_id_t Mod_idP, const uint8_t indexP ); diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c index a919a055f2..8410c4c719 100644 --- a/openair2/RRC/LITE/rrc_UE.c +++ b/openair2/RRC/LITE/rrc_UE.c @@ -276,7 +276,7 @@ static void init_MCCH_UE(module_id_t ue_mod_idP, uint8_t eNB_index) #endif //----------------------------------------------------------------------------- -static void openair_rrc_lite_ue_init_security( const protocol_ctxt_t* const ctxt_pP ) +static void openair_rrc_ue_init_security( const protocol_ctxt_t* const ctxt_pP ) { #if defined(ENABLE_SECURITY) // uint8_t *kRRCenc; @@ -297,7 +297,7 @@ static void openair_rrc_lite_ue_init_security( const protocol_ctxt_t* const ctxt } //----------------------------------------------------------------------------- -char openair_rrc_lite_ue_init( const module_id_t ue_mod_idP, const unsigned char eNB_index ) +char openair_rrc_ue_init( const module_id_t ue_mod_idP, const unsigned char eNB_index ) { protocol_ctxt_t ctxt; PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_idP, ENB_FLAG_NO, NOT_A_RNTI, 0, 0,eNB_index); @@ -324,7 +324,7 @@ char openair_rrc_lite_ue_init( const module_id_t ue_mod_idP, const unsigned char UE_rrc_inst[ctxt.module_id].integrity_algorithm = SecurityAlgorithmConfig__integrityProtAlgorithm_reserved; #endif - openair_rrc_lite_ue_init_security(&ctxt); + openair_rrc_ue_init_security(&ctxt); init_SI_UE(&ctxt,eNB_index); LOG_D(RRC,PROTOCOL_RRC_CTXT_FMT" INIT: phy_sync_2_ch_ind\n", PROTOCOL_RRC_CTXT_ARGS(&ctxt)); @@ -445,14 +445,14 @@ static void rrc_ue_generate_RRCConnectionSetupComplete( const protocol_ctxt_t* c LOG_D(RLC, "[FRAME %05d][RRC_UE][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCConnectionSetupComplete to eNB %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n", ctxt_pP->frame, ctxt_pP->module_id+NB_eNB_INST, size, eNB_index, rrc_mui, ctxt_pP->module_id+NB_eNB_INST, DCCH); - pdcp_rrc_data_req ( - ctxt_pP, - DCCH, - rrc_mui++, - SDU_CONFIRM_NO, - size, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req ( + ctxt_pP, + DCCH, + rrc_mui++, + SDU_CONFIRM_NO, + size, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); } //----------------------------------------------------------------------------- @@ -472,14 +472,14 @@ static void rrc_ue_generate_RRCConnectionReconfigurationComplete( const protocol rrc_mui, UE_MODULE_ID_TO_INSTANCE(ctxt_pP->module_id), DCCH); - pdcp_rrc_data_req ( - ctxt_pP, - DCCH, - rrc_mui++, - SDU_CONFIRM_NO, - size, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req ( + ctxt_pP, + DCCH, + rrc_mui++, + SDU_CONFIRM_NO, + size, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); } @@ -1430,14 +1430,14 @@ rrc_ue_process_securityModeCommand( } LOG_T(RRC, "\n"); - pdcp_rrc_data_req ( - ctxt_pP, - DCCH, - rrc_mui++, - SDU_CONFIRM_NO, - (enc_rval.encoded + 7) / 8, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req ( + ctxt_pP, + DCCH, + rrc_mui++, + SDU_CONFIRM_NO, + (enc_rval.encoded + 7) / 8, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); } } } @@ -1535,14 +1535,14 @@ rrc_ue_process_ueCapabilityEnquiry( } LOG_T(RRC, "\n"); - pdcp_rrc_data_req ( - ctxt_pP, - DCCH, - rrc_mui++, - SDU_CONFIRM_NO, - (enc_rval.encoded + 7) / 8, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req ( + ctxt_pP, + DCCH, + rrc_mui++, + SDU_CONFIRM_NO, + (enc_rval.encoded + 7) / 8, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); } } } @@ -4160,15 +4160,15 @@ void *rrc_ue_task( void *args_p ) /* Transfer data to PDCP */ PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, ENB_FLAG_NO, UE_rrc_inst[ue_mod_id].Info[0].rnti, 0, 0,0); - pdcp_rrc_data_req (&ctxt, - DCCH, - rrc_mui++, - SDU_CONFIRM_NO, - length, buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req (&ctxt, + DCCH, + rrc_mui++, + SDU_CONFIRM_NO, + length, buffer, + PDCP_TRANSMISSION_MODE_CONTROL); break; } - + # endif # if ENABLE_RAL diff --git a/openair2/RRC/LITE/rrc_common.c b/openair2/RRC/LITE/rrc_common.c index e2d8a6c69b..a27199bdab 100644 --- a/openair2/RRC/LITE/rrc_common.c +++ b/openair2/RRC/LITE/rrc_common.c @@ -132,7 +132,7 @@ rrc_init_global_param( return -1; } */ - rrc_rlc_register_rrc (rlcrrc_data_ind, NULL); //register with rlc + rrc_rlc_register_rrc (rrc_data_ind, NULL); //register with rlc DCCH_LCHAN_DESC.transport_block_size = 4; DCCH_LCHAN_DESC.max_transport_blocks = 16; diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index c7cb18eab0..da1b07e25b 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -920,14 +920,14 @@ rrc_eNB_generate_SecurityModeCommand( rrc_eNB_mui, size); - pdcp_rrc_data_req( - ctxt_pP, - DCCH, - rrc_eNB_mui++, - SDU_CONFIRM_NO, - size, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req( + ctxt_pP, + DCCH, + rrc_eNB_mui++, + SDU_CONFIRM_NO, + size, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); } @@ -971,14 +971,14 @@ rrc_eNB_generate_UECapabilityEnquiry( rrc_eNB_mui, size); - pdcp_rrc_data_req( - ctxt_pP, - DCCH, - rrc_eNB_mui++, - SDU_CONFIRM_NO, - size, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req( + ctxt_pP, + DCCH, + rrc_eNB_mui++, + SDU_CONFIRM_NO, + size, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); } @@ -1107,14 +1107,14 @@ rrc_eNB_generate_RRCConnectionRelease( rrc_eNB_mui, size); - pdcp_rrc_data_req( - ctxt_pP, - DCCH, - rrc_eNB_mui++, - SDU_CONFIRM_NO, - size, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req( + ctxt_pP, + DCCH, + rrc_eNB_mui++, + SDU_CONFIRM_NO, + size, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); } //----------------------------------------------------------------------------- @@ -1728,14 +1728,14 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration( rrc_eNB_mui, size); - pdcp_rrc_data_req( - ctxt_pP, - DCCH, - rrc_eNB_mui++, - SDU_CONFIRM_NO, - size, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req( + ctxt_pP, + DCCH, + rrc_eNB_mui++, + SDU_CONFIRM_NO, + size, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); } @@ -1805,14 +1805,14 @@ rrc_eNB_generate_RRCConnectionReconfiguration_SCell( rrc_eNB_mui, size); - pdcp_rrc_data_req( - ctxt_pP, - DCCH, - rrc_eNB_mui++, - SDU_CONFIRM_NO, - size, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req( + ctxt_pP, + DCCH, + rrc_eNB_mui++, + SDU_CONFIRM_NO, + size, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); return(0); } @@ -3369,7 +3369,7 @@ rrc_eNB_generate_RRCConnectionSetup( #if defined(ENABLE_ITTI) char //----------------------------------------------------------------------------- -openair_rrc_lite_eNB_init( +openair_rrc_eNB_init( const module_id_t enb_mod_idP ) //----------------------------------------------------------------------------- @@ -3382,13 +3382,13 @@ openair_rrc_lite_eNB_init( #if defined(ENABLE_ITTI) //----------------------------------------------------------------------------- char -openair_rrc_lite_eNB_configuration( +openair_rrc_eNB_configuration( const module_id_t enb_mod_idP, RrcConfigurationReq* configuration ) #else char -openair_rrc_lite_eNB_init( +openair_rrc_eNB_init( const module_id_t enb_mod_idP ) #endif @@ -3417,7 +3417,7 @@ openair_rrc_lite_eNB_init( // for (j = 0; j < NUMBER_OF_UE_MAX; j++) { // eNB_rrc_inst[ctxt.module_id].ciphering_algorithm[j] = SecurityAlgorithmConfig__cipheringAlgorithm_eea0; // eNB_rrc_inst[ctxt.module_id].integrity_algorithm[j] = SecurityAlgorithmConfig__integrityProtAlgorithm_eia2; - // rrc_lite_eNB_init_security(enb_mod_idP, j); + // rrc_eNB_init_security(enb_mod_idP, j); // } // } eNB_rrc_inst[ctxt.module_id].Nb_ue = 0; @@ -4434,7 +4434,7 @@ rrc_enb_task( /* Messages from eNB app */ case RRC_CONFIGURATION_REQ: LOG_I(RRC, "[eNB %d] Received %s\n", instance, msg_name_p); - openair_rrc_lite_eNB_configuration(ENB_INSTANCE_TO_MODULE_ID(instance), &RRC_CONFIGURATION_REQ(msg_p)); + openair_rrc_eNB_configuration(ENB_INSTANCE_TO_MODULE_ID(instance), &RRC_CONFIGURATION_REQ(msg_p)); break; # if ENABLE_RAL diff --git a/openair2/RRC/LITE/rrc_eNB_S1AP.c b/openair2/RRC/LITE/rrc_eNB_S1AP.c index d93b8eea2f..6598e72273 100644 --- a/openair2/RRC/LITE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LITE/rrc_eNB_S1AP.c @@ -840,15 +840,15 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS( LOG_F(RRC,"\n"); #endif /* Transfer data to PDCP */ - pdcp_rrc_data_req ( - &ctxt, - DCCH, - *rrc_eNB_mui++, - SDU_CONFIRM_NO, - length, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); - + rrc_data_req ( + &ctxt, + DCCH, + *rrc_eNB_mui++, + SDU_CONFIRM_NO, + length, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); + return (0); } } From 59f6146a35a6a9e3e0c3d6cd536778a356b2f41b Mon Sep 17 00:00:00 2001 From: kaltenbe Date: Mon, 15 Feb 2016 19:08:08 +0100 Subject: [PATCH 039/214] UE UL failure debugging --- openair2/LAYER2/MAC/defs.h | 1 + openair2/LAYER2/MAC/eNB_scheduler.c | 175 +++++++++--------- .../LAYER2/MAC/eNB_scheduler_primitives.c | 12 +- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 18 +- openair2/LAYER2/MAC/pre_processor.c | 26 ++- openair2/LAYER2/openair2_proc.c | 3 +- openair2/RRC/LITE/L2_interface.c | 9 + openair2/RRC/LITE/proto.h | 6 + openair2/RRC/LITE/rrc_eNB.c | 12 +- .../CONF/enb.band7.tm1.50PRB.usrpb210.conf | 4 +- 10 files changed, 168 insertions(+), 98 deletions(-) diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index 493ecece78..79d8169839 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -742,6 +742,7 @@ typedef struct { int32_t ul_inactivity_timer; int32_t ul_failure_timer; int32_t ra_pdcch_order_sent; + int32_t ul_out_of_sync; } UE_sched_ctrl; /*! \brief eNB template for the Random access information */ typedef struct { diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index d5de3bbae6..e0d2d83a73 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -98,7 +98,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, int CC_id,i,next_i; UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list; rnti_t rnti; - int ra_pdcch_sent=0; void *DLSCH_dci=NULL; int size_bits,size_bytes; @@ -134,99 +133,99 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, } else { // check uplink failure - if (UE_list->UE_sched_ctrl[i].ul_failure_timer>0) { - LOG_I(MAC,"UE %d rnti %x: UL Failure timer %d \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); - if (UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent == 0) { - if (ra_pdcch_sent==0) { - UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=1; - ra_pdcch_sent=1; - - // add a format 1A dci for this UE to request an RA procedure (only one UE per subframe) - LOG_I(MAC,"UE %d rnti %x: sending PDCCH order for RAPROC \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); - DLSCH_dci = (void *)UE_list->UE_template[CC_id][i].DLSCH_DCI[0]; - *(uint32_t*)DLSCH_dci = 0; - if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { - switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { - case 6: - ((DCI1A_1_5MHz_TDD_1_6_t*)DLSCH_dci)->type = 1; - ((DCI1A_1_5MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 31; - size_bytes = sizeof(DCI1A_1_5MHz_TDD_1_6_t); - size_bits = sizeof_DCI1A_1_5MHz_TDD_1_6_t; - break; - case 25: - ((DCI1A_5MHz_TDD_1_6_t*)DLSCH_dci)->type = 1; - ((DCI1A_5MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 511; - size_bytes = sizeof(DCI1A_5MHz_TDD_1_6_t); - size_bits = sizeof_DCI1A_5MHz_TDD_1_6_t; - break; - case 50: - ((DCI1A_10MHz_TDD_1_6_t*)DLSCH_dci)->type = 1; - ((DCI1A_10MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 2047; - size_bytes = sizeof(DCI1A_10MHz_TDD_1_6_t); - size_bits = sizeof_DCI1A_10MHz_TDD_1_6_t; - break; - case 100: - ((DCI1A_20MHz_TDD_1_6_t*)DLSCH_dci)->type = 1; - ((DCI1A_20MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 8191; - size_bytes = sizeof(DCI1A_20MHz_TDD_1_6_t); - size_bits = sizeof_DCI1A_20MHz_TDD_1_6_t; - break; - } + if ((UE_list->UE_sched_ctrl[i].ul_failure_timer>0)&& + (UE_list->UE_sched_ctrl[i].ul_out_of_sync==0)) { + LOG_D(MAC,"UE %d rnti %x: UL Failure timer %d \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); + if (UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent==0) { + UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=1; + + // add a format 1A dci for this UE to request an RA procedure (only one UE per subframe) + LOG_I(MAC,"UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d) \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); + DLSCH_dci = (void *)UE_list->UE_template[CC_id][i].DLSCH_DCI[0]; + *(uint32_t*)DLSCH_dci = 0; + if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { + switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { + case 6: + ((DCI1A_1_5MHz_TDD_1_6_t*)DLSCH_dci)->type = 1; + ((DCI1A_1_5MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 31; + size_bytes = sizeof(DCI1A_1_5MHz_TDD_1_6_t); + size_bits = sizeof_DCI1A_1_5MHz_TDD_1_6_t; + break; + case 25: + ((DCI1A_5MHz_TDD_1_6_t*)DLSCH_dci)->type = 1; + ((DCI1A_5MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 511; + size_bytes = sizeof(DCI1A_5MHz_TDD_1_6_t); + size_bits = sizeof_DCI1A_5MHz_TDD_1_6_t; + break; + case 50: + ((DCI1A_10MHz_TDD_1_6_t*)DLSCH_dci)->type = 1; + ((DCI1A_10MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 2047; + size_bytes = sizeof(DCI1A_10MHz_TDD_1_6_t); + size_bits = sizeof_DCI1A_10MHz_TDD_1_6_t; + break; + case 100: + ((DCI1A_20MHz_TDD_1_6_t*)DLSCH_dci)->type = 1; + ((DCI1A_20MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 8191; + size_bytes = sizeof(DCI1A_20MHz_TDD_1_6_t); + size_bits = sizeof_DCI1A_20MHz_TDD_1_6_t; + break; } - else { // FDD - switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { - case 6: - ((DCI1A_1_5MHz_FDD_t*)DLSCH_dci)->type = 1; - ((DCI1A_1_5MHz_FDD_t*)DLSCH_dci)->rballoc = 31; - size_bytes = sizeof(DCI1A_1_5MHz_FDD_t); - size_bits = sizeof_DCI1A_1_5MHz_FDD_t; + } + else { // FDD + switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { + case 6: + ((DCI1A_1_5MHz_FDD_t*)DLSCH_dci)->type = 1; + ((DCI1A_1_5MHz_FDD_t*)DLSCH_dci)->rballoc = 31; + size_bytes = sizeof(DCI1A_1_5MHz_FDD_t); + size_bits = sizeof_DCI1A_1_5MHz_FDD_t; + break; + case 25: + ((DCI1A_5MHz_FDD_t*)DLSCH_dci)->type = 1; + ((DCI1A_5MHz_FDD_t*)DLSCH_dci)->rballoc = 511; + size_bytes = sizeof(DCI1A_5MHz_FDD_t); + size_bits = sizeof_DCI1A_5MHz_FDD_t; + break; + case 50: + ((DCI1A_10MHz_FDD_t*)DLSCH_dci)->type = 1; + ((DCI1A_10MHz_FDD_t*)DLSCH_dci)->rballoc = 2047; + size_bytes = sizeof(DCI1A_10MHz_FDD_t); + size_bits = sizeof_DCI1A_10MHz_FDD_t; break; - case 25: - ((DCI1A_5MHz_FDD_t*)DLSCH_dci)->type = 1; - ((DCI1A_5MHz_FDD_t*)DLSCH_dci)->rballoc = 511; - size_bytes = sizeof(DCI1A_5MHz_FDD_t); - size_bits = sizeof_DCI1A_5MHz_FDD_t; - break; - case 50: - ((DCI1A_10MHz_FDD_t*)DLSCH_dci)->type = 1; - ((DCI1A_10MHz_FDD_t*)DLSCH_dci)->rballoc = 2047; - size_bytes = sizeof(DCI1A_10MHz_FDD_t); - size_bits = sizeof_DCI1A_10MHz_FDD_t; - break; - case 100: - ((DCI1A_20MHz_FDD_t*)DLSCH_dci)->type = 1; - ((DCI1A_20MHz_FDD_t*)DLSCH_dci)->rballoc = 8191; - size_bytes = sizeof(DCI1A_20MHz_FDD_t); - size_bits = sizeof_DCI1A_20MHz_FDD_t; - break; - } + case 100: + ((DCI1A_20MHz_FDD_t*)DLSCH_dci)->type = 1; + ((DCI1A_20MHz_FDD_t*)DLSCH_dci)->rballoc = 8191; + size_bytes = sizeof(DCI1A_20MHz_FDD_t); + size_bits = sizeof_DCI1A_20MHz_FDD_t; + break; } - - add_ue_spec_dci(DCI_pdu[CC_id], - DLSCH_dci, - rnti, + } + + add_ue_spec_dci(DCI_pdu[CC_id], + DLSCH_dci, + rnti, size_bytes, - process_ue_cqi (module_idP,i),//aggregation, - size_bits, - format1A, - 0); - } - else { // ra_pdcch_sent==1 - if ((UE_list->UE_sched_ctrl[i].ul_failure_timer % 40) == 0) - UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=0; // resend every 4 frames - } + process_ue_cqi (module_idP,i),//aggregation, + size_bits, + format1A, + 0); } - UE_list->UE_sched_ctrl[i].ul_failure_timer++; - // check threshold - if (UE_list->UE_sched_ctrl[i].ul_failure_timer > 200) { - // inform RRC of failure and clear timer - LOG_I(MAC,"UE %d rnti %x: UL Failure Triggering RRC \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); - mac_eNB_rrc_ul_failure(module_idP,CC_id,frameP,subframeP,rnti); - UE_list->UE_sched_ctrl[i].ul_failure_timer=0; + else { // ra_pdcch_sent==1 + LOG_I(MAC,"UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); + if ((UE_list->UE_sched_ctrl[i].ul_failure_timer % 40) == 0) + UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=0; // resend every 4 frames } - } // ul_failure_timer>0 - - } + } + UE_list->UE_sched_ctrl[i].ul_failure_timer++; + // check threshold + if (UE_list->UE_sched_ctrl[i].ul_failure_timer > 200) { + // inform RRC of failure and clear timer + LOG_I(MAC,"UE %d rnti %x: UL Failure Triggering RRC \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); + mac_eNB_rrc_ul_failure(module_idP,CC_id,frameP,subframeP,rnti); + UE_list->UE_sched_ctrl[i].ul_failure_timer=0; + UE_list->UE_sched_ctrl[i].ul_out_of_sync=1; + } + } // ul_failure_timer>0 + i = next_i; } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 8c8eeff148..b3dc9defe1 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -698,6 +698,12 @@ uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id) UE_sched_ctrl *UE_sched_ctl = &eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[UE_id]; LOG_D(MAC,"[eNB %d][PUSCH] Checking UL requirements UE %d/%x\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id)); + // do not schedule UE if UL is not working + if (UE_sched_ctl->ul_failure_timer>0) + return(0); + if (UE_sched_ctl->ul_out_of_sync>0) + return(0); + if ((UE_template->bsr_info[LCGID0]>0) || (UE_template->bsr_info[LCGID1]>0) || (UE_template->bsr_info[LCGID2]>0) || @@ -1119,8 +1125,10 @@ void UL_failure_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list; if (UE_id != -1) { - LOG_I(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling UL Failure for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); - UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=1; + LOG_I(MAC,"[eNB %d][UE %d/%x] Frame %d subframeP %d Signaling UL Failure for UE %d on CC_id %d (timer %d)\n",mod_idP,UE_id,rntiP,frameP,subframeP, UE_id,cc_idP, + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); + if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer == 0) + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=1; } else { // AssertFatal(0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP); // AssertError(0, 0, "Frame %d: find_UE_id(%u,rnti %d) not found\n", frameP, enb_mod_idP, rntiP); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 42f19cc2ae..95a894f52a 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -109,6 +109,10 @@ void rx_sdu( if (UE_id!=-1) { UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer=0; UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=0; + if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) { + UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync=0; + mac_eNB_rrc_ul_in_sync(enb_mod_idP,CC_idP,frameP,subframeP,UE_RNTI(enb_mod_idP,UE_id)); + } } payload_ptr = parse_ulsch_header(sduP,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,sdu_lenP); @@ -133,6 +137,14 @@ void rx_sdu( case CRNTI: UE_id = find_UE_id(enb_mod_idP,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1]); LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n",enb_mod_idP, CC_idP, rx_ces[i], i,num_ce,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1],UE_id); + if (UE_id!=-1) { + UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer=0; + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=0; + if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) { + UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync=0; + mac_eNB_rrc_ul_in_sync(enb_mod_idP,CC_idP,frameP,subframeP,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1]); + } + } crnti_rx=1; payload_ptr+=2; @@ -773,8 +785,10 @@ void schedule_ulsch_rnti(module_id_t module_idP, if (round==0) // always schedule #endif { - LOG_D(MAC,"[eNB %d][PUSCH] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UE_inactivity timer %d)\n", - module_idP,frameP,subframeP,UE_id,rnti,round,UE_template->ul_SR,UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer); + LOG_D(MAC,"[eNB %d][PUSCH] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d)\n", + module_idP,frameP,subframeP,UE_id,rnti,round,UE_template->ul_SR, + UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer, + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); // reset the scheduling request UE_template->ul_SR = 0; aggregation = process_ue_cqi(module_idP,UE_id); // =2 by default!! diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 410d454419..dc52699eb8 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -319,6 +319,8 @@ void sort_UEs (module_id_t Mod_idP, rnti1 = UE_RNTI(Mod_idP,UE_id1); if(rnti1 == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id1].ul_out_of_sync == 1) + continue; pCC_id1 = UE_PCCID(Mod_idP,UE_id1); cqi1 = maxcqi(Mod_idP,UE_id1); // round1 = maxround(Mod_idP,rnti1,frameP,subframeP,0); @@ -327,6 +329,8 @@ void sort_UEs (module_id_t Mod_idP, rnti2 = UE_RNTI(Mod_idP,UE_id2); if(rnti2 == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id2].ul_out_of_sync == 1) + continue; cqi2 = maxcqi(Mod_idP,UE_id2); round2 = maxround(Mod_idP,rnti2,frameP,subframeP,0); //mac_xface->get_ue_active_harq_pid(Mod_id,rnti2,subframe,&harq_pid2,&round2,0); pCC_id2 = UE_PCCID(Mod_idP,UE_id2); @@ -453,7 +457,8 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, if(rnti == NOT_A_RNTI) continue; - + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) + continue; UE_id = i; // if there is no available harq_process, skip the UE @@ -563,6 +568,8 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, // LOG_D(MAC,"UE %d rnti 0x\n", UE_id, rnti ); if(rnti == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) + continue; transmission_mode = mac_xface->get_transmission_mode(Mod_id,CC_id,rnti); // mac_xface->get_ue_active_harq_pid(Mod_id,CC_id,rnti,frameP,subframeP,&harq_pid,&round,0); @@ -607,6 +614,8 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, round2 = ue_sched_ctl2->round[CC_id]; if(rnti2 == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id2].ul_out_of_sync == 1) + continue; eNB_UE_stats2 = mac_xface->get_eNB_UE_stats(Mod_id,CC_id,rnti2); //mac_xface->get_ue_active_harq_pid(Mod_id,CC_id,rnti2,frameP,subframeP,&harq_pid2,&round2,0); @@ -965,6 +974,9 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, if (rnti==NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) + continue; + UE_id = i; for (n=0; nnumactiveULCCs[UE_id]; n++) { @@ -1013,6 +1025,8 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, if (rnti==NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) + continue; UE_id = i; @@ -1041,6 +1055,8 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, if (rnti==NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) + continue; UE_id = i; @@ -1146,6 +1162,8 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra if (rnti==NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) + continue; UE_id = i; @@ -1246,7 +1264,9 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP) rnti1 = UE_RNTI(module_idP,UE_id1); if(rnti1 == NOT_A_RNTI) - continue; + continue; + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) + continue; pCCid1 = UE_PCCID(module_idP,UE_id1); round1 = maxround(module_idP,rnti1,frameP,subframeP,1); @@ -1256,6 +1276,8 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP) if(rnti2 == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id2].ul_out_of_sync == 1) + continue; pCCid2 = UE_PCCID(module_idP,UE_id2); round2 = maxround(module_idP,rnti2,frameP,subframeP,1); diff --git a/openair2/LAYER2/openair2_proc.c b/openair2/LAYER2/openair2_proc.c index 35684d239a..8e3c39f9f0 100644 --- a/openair2/LAYER2/openair2_proc.c +++ b/openair2/LAYER2/openair2_proc.c @@ -201,9 +201,10 @@ int dump_eNB_l2_stats(char *buffer, int length) UE_list->eNB_UE_stats[CC_id][UE_id].avg_overhead_bytes ); - len += sprintf(&buffer[len],"[MAC] UE %d (ULSCH), Status %d, RNTI %x : rx power (normalized %d, target %d), MCS (pre %d, post %d), RB (rx %d, retx %d, total %d), Current TBS %d \n", + len += sprintf(&buffer[len],"[MAC] UE %d (ULSCH), Status %d, Failute timer %d, RNTI %x : rx power (normalized %d, target %d), MCS (pre %d, post %d), RB (rx %d, retx %d, total %d), Current TBS %d \n", UE_id, map_int_to_str(rrc_status_names, UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status), + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer, UE_list->eNB_UE_stats[CC_id][UE_id].crnti, UE_list->eNB_UE_stats[CC_id][UE_id].normalized_rx_power, UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power, diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c index cea9640275..7a4a69e2d2 100644 --- a/openair2/RRC/LITE/L2_interface.c +++ b/openair2/RRC/LITE/L2_interface.c @@ -723,6 +723,15 @@ void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP, return; } + +void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP, + const int CC_id, + const frame_t frameP, + const sub_frame_t subframeP, + const rnti_t rnti) { + + return; +} //------------------------------------------------------------------------------ int mac_UE_get_rrc_status( diff --git a/openair2/RRC/LITE/proto.h b/openair2/RRC/LITE/proto.h index cde0643ee1..920d4d85f3 100644 --- a/openair2/RRC/LITE/proto.h +++ b/openair2/RRC/LITE/proto.h @@ -316,6 +316,12 @@ void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP, const sub_frame_t subframeP, const rnti_t rnti); +void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP, + const int CC_id, + const frame_t frameP, + const sub_frame_t subframeP, + const rnti_t rnti); + uint8_t rrc_data_req( const protocol_ctxt_t* const ctxt_pP, diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index da1b07e25b..befdc32c63 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -567,10 +567,20 @@ rrc_eNB_ue_context_stmsi_exist( { struct rrc_eNB_ue_context_s* ue_context_p = NULL; RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head)) { - if (ue_context_p->ue_context.Initialue_identity_s_TMSI.presence == TRUE) + LOG_I(RRC,"checking for UE S-TMSI %x, mme %x (%p): rnti %x", + m_tmsiP, mme_codeP, ue_context_p, + ue_context_p->ue_context.rnti); + if (ue_context_p->ue_context.Initialue_identity_s_TMSI.presence == TRUE) { + printf("S-TMSI %x, MME %x\n", + ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi, + ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code); if (ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi == m_tmsiP) if (ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code == mme_codeP) return ue_context_p; + } + else + printf("\n"); + } return NULL; } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index d81099533a..2ce9598129 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -140,10 +140,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; From fdb81c2339adf20d7fa396a11b14d2c3d27e4a2c Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Wed, 17 Feb 2016 19:32:50 +0100 Subject: [PATCH 040/214] more changes for UE context management --- openair2/LAYER2/MAC/eNB_scheduler.c | 19 ++++++++++--------- .../LAYER2/MAC/eNB_scheduler_primitives.c | 3 ++- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 3 ++- .../CONF/enb.band7.tm1.50PRB.usrpb210.conf | 4 ++-- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index e0d2d83a73..d1d08390d7 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -214,15 +214,16 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, if ((UE_list->UE_sched_ctrl[i].ul_failure_timer % 40) == 0) UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=0; // resend every 4 frames } - } - UE_list->UE_sched_ctrl[i].ul_failure_timer++; - // check threshold - if (UE_list->UE_sched_ctrl[i].ul_failure_timer > 200) { - // inform RRC of failure and clear timer - LOG_I(MAC,"UE %d rnti %x: UL Failure Triggering RRC \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); - mac_eNB_rrc_ul_failure(module_idP,CC_id,frameP,subframeP,rnti); - UE_list->UE_sched_ctrl[i].ul_failure_timer=0; - UE_list->UE_sched_ctrl[i].ul_out_of_sync=1; + + UE_list->UE_sched_ctrl[i].ul_failure_timer++; + // check threshold + if (UE_list->UE_sched_ctrl[i].ul_failure_timer > 200) { + // inform RRC of failure and clear timer + LOG_I(MAC,"UE %d rnti %x: UL Failure Triggering RRC \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); + mac_eNB_rrc_ul_failure(module_idP,CC_id,frameP,subframeP,rnti); + UE_list->UE_sched_ctrl[i].ul_failure_timer=0; + UE_list->UE_sched_ctrl[i].ul_out_of_sync=1; + } } } // ul_failure_timer>0 diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index b3dc9defe1..e23f007a07 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1125,7 +1125,8 @@ void UL_failure_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list; if (UE_id != -1) { - LOG_I(MAC,"[eNB %d][UE %d/%x] Frame %d subframeP %d Signaling UL Failure for UE %d on CC_id %d (timer %d)\n",mod_idP,UE_id,rntiP,frameP,subframeP, UE_id,cc_idP, + LOG_I(MAC,"[eNB %d][UE %d/%x] Frame %d subframeP %d Signaling UL Failure for UE %d on CC_id %d (timer %d)\n", + mod_idP,UE_id,rntiP,frameP,subframeP, UE_id,cc_idP, UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer == 0) UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=1; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 95a894f52a..4c34eea075 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -136,7 +136,8 @@ void rx_sdu( case CRNTI: UE_id = find_UE_id(enb_mod_idP,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1]); - LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n",enb_mod_idP, CC_idP, rx_ces[i], i,num_ce,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1],UE_id); + LOG_I(MAC, "[eNB %d] Frame %d, Subframe %d CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n", + frameP,subframeP,enb_mod_idP, CC_idP, rx_ces[i], i,num_ce,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1],UE_id); if (UE_id!=-1) { UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer=0; UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=0; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index 2ce9598129..3b5386a0e6 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -28,7 +28,7 @@ eNBs = tdd_config_s = 0; prefix_type = "NORMAL"; eutra_band = 7; - downlink_frequency = 2680000000L; + downlink_frequency = 2685000000L; uplink_frequency_offset = -120000000; Nid_cell = 0; N_RB_DL = 50; @@ -82,7 +82,7 @@ eNBs = rach_messagePowerOffsetGroupB = ; */ rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; + rach_preambleInitialReceivedTargetPower = -100; rach_preambleTransMax = 10; rach_raResponseWindowSize = 10; rach_macContentionResolutionTimer = 48; From cac00e34e10375c6f6d409488f2eefcc8ee93434 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 19 Feb 2016 10:06:58 +0100 Subject: [PATCH 041/214] temporary commit for debugging on another computer --- openair1/PHY/LTE_TRANSPORT/dlsch_coding.c | 50 +++++++++---------- openair1/PHY/LTE_TRANSPORT/proto.h | 4 +- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 2 +- openair1/PHY/impl_defs_top.h | 2 +- openair1/SCHED/defs.h | 2 +- openair1/SCHED/phy_procedures_lte_eNb.c | 18 +++---- openair2/LAYER2/MAC/eNB_scheduler.c | 6 +-- .../LAYER2/MAC/eNB_scheduler_primitives.c | 46 ++++++++--------- openair2/LAYER2/MAC/main.c | 1 + openair2/LAYER2/MAC/proto.h | 2 +- openair2/PHY_INTERFACE/defs.h | 2 +- openair2/RRC/LITE/L2_interface.c | 36 +++++++++++-- openair2/RRC/LITE/defs.h | 1 + openair2/RRC/LITE/rrc_common.c | 17 ++++++- openair2/RRC/LITE/rrc_eNB.c | 2 +- 15 files changed, 115 insertions(+), 76 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c index 95af038ab0..01102636fc 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c @@ -44,6 +44,7 @@ #include "PHY/CODING/extern.h" #include "PHY/CODING/lte_interleaver_inline.h" #include "PHY/LTE_TRANSPORT/defs.h" +#include "PHY/LTE_TRANSPORT/proto.h" #include "defs.h" #include "UTIL/LOG/vcd_signal_dumper.h" @@ -91,11 +92,11 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch) #endif for (r=0; rharq_processes[i]->c[r]); #endif - + if (dlsch->harq_processes[i]->c[r]) { free16(dlsch->harq_processes[i]->c[r],((r==0)?8:0) + 3+768); dlsch->harq_processes[i]->c[r] = NULL; @@ -104,17 +105,17 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch) free16(dlsch->harq_processes[i]->d[r],(96+12+3+(3*6144))); dlsch->harq_processes[i]->d[r] = NULL; } - } - - free16(dlsch->harq_processes[i],sizeof(LTE_DL_eNB_HARQ_t)); - dlsch->harq_processes[i] = NULL; + + } + free16(dlsch->harq_processes[i],sizeof(LTE_DL_eNB_HARQ_t)); + dlsch->harq_processes[i] = NULL; } } - + free16(dlsch,sizeof(LTE_eNB_DLSCH_t)); dlsch = NULL; - } - + } + } LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_t Nsoft,unsigned char N_RB_DL, uint8_t abstraction_flag) @@ -204,28 +205,28 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_ for (i=0; iharq_processes[i]->round=0; - if (abstraction_flag==0) { - for (j=0; j<96; j++) - for (r=0; rharq_processes[%d]->d[%d] %p\n",i,r,dlsch->harq_processes[i]->d[r]); - dlsch->harq_processes[i]->d[r][j] = LTE_NULL; - } - } + for (j=0; j<96; j++) + for (r=0; rharq_processes[%d]->d[%d] %p\n",i,r,dlsch->harq_processes[i]->d[r]); + if (dlsch->harq_processes[i]->d[r]) + dlsch->harq_processes[i]->d[r][j] = LTE_NULL; + } + } return(dlsch); } } - LOG_D(PHY, "new_eNB_dlsch exit flag %d, size of %ld\n", - exit_flag, sizeof(LTE_eNB_DLSCH_t)); + LOG_D(PHY,"new_eNB_dlsch exit flag %d, size of %ld\n", + exit_flag, sizeof(LTE_eNB_DLSCH_t)); free_eNB_dlsch(dlsch); return(NULL); } -void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag) +void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch) { unsigned char Mdlharq; @@ -245,12 +246,11 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag) dlsch->harq_processes[i]->status = 0; dlsch->harq_processes[i]->round = 0; - if (abstraction_flag==0) { - for (j=0; j<96; j++) - for (r=0; rharq_processes[i]->d[r]) - dlsch->harq_processes[i]->d[r][j] = LTE_NULL; - } + for (j=0; j<96; j++) + for (r=0; rharq_processes[i]->d[r]) + dlsch->harq_processes[i]->d[r][j] = LTE_NULL; + } } } diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index 9afea790b3..15a8f53f54 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -54,7 +54,7 @@ */ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch); -void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag); +void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch); /** \fn new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t abstraction_flag) \brief This function allocates structures for a particular DLSCH at eNB @@ -85,7 +85,7 @@ void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch); LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag); -void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch, uint8_t abstraction_flag); +void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch); void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch); diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 25dae3ed63..ca4e8be933 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -179,7 +179,7 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint return(NULL); } -void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch, uint8_t abstraction_flag) +void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch) { unsigned char Mdlharq; diff --git a/openair1/PHY/impl_defs_top.h b/openair1/PHY/impl_defs_top.h index e55e28e3be..4b0edcff29 100755 --- a/openair1/PHY/impl_defs_top.h +++ b/openair1/PHY/impl_defs_top.h @@ -256,7 +256,7 @@ #define AMP_OVER_2 (AMP>>1) /// Threshold for PUCCH Format 1 detection -#define PUCCH1_THRES 10 +#define PUCCH1_THRES 7 /// Threshold for PUCCH Format 1a/1b detection #define PUCCH1a_THRES 4 diff --git a/openair1/SCHED/defs.h b/openair1/SCHED/defs.h index 8692a31f12..af6acca880 100644 --- a/openair1/SCHED/defs.h +++ b/openair1/SCHED/defs.h @@ -405,7 +405,7 @@ void remove_harq_pid_from_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid); int8_t find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB); int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB); -int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag); +int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rnti); void process_timing_advance(module_id_t Mod_id,uint8_t CC_id,int16_t timing_advance); void process_timing_advance_rar(PHY_VARS_UE *phy_vars_ue,uint16_t timing_advance); diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index a7796a9b69..3552344fb7 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -198,10 +198,10 @@ int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB) return(-1); } -int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB, uint8_t abstraction_flag) -{ +int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rntiP) { uint8_t i; int j; + PHY_VARS_eNB *phy_vars_eNB = PHY_vars_eNB_g[Mod_idP]; for (i=0; idlsch_eNB[i]==NULL) || (phy_vars_eNB->ulsch_eNB[i]==NULL)) { @@ -209,14 +209,14 @@ int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB, uint8_t abstraction LOG_E(PHY,"Can't remove UE, not enough memory allocated\n"); return(-1); } else { - if (phy_vars_eNB->eNB_UE_stats[i].crnti==rnti) { - MSC_LOG_EVENT(MSC_PHY_ENB, "0 Removed ue %"PRIx16" ", rnti); + if (phy_vars_eNB->eNB_UE_stats[i].crnti==rntiP) { + MSC_LOG_EVENT(MSC_PHY_ENB, "0 Removed ue %"PRIx16" ", rntiP); #ifdef DEBUG_PHY_PROC LOG_I(PHY,"eNB %d removing UE %d with rnti %x\n",phy_vars_eNB->Mod_id,i,rnti); #endif //msg("[PHY] UE_id %d\n",i); - clean_eNb_dlsch(phy_vars_eNB->dlsch_eNB[i][0], abstraction_flag); - clean_eNb_ulsch(phy_vars_eNB->ulsch_eNB[i],abstraction_flag); + clean_eNb_dlsch(phy_vars_eNB->dlsch_eNB[i][0]); + clean_eNb_ulsch(phy_vars_eNB->ulsch_eNB[i]); //phy_vars_eNB->eNB_UE_stats[i].crnti = 0; memset(&phy_vars_eNB->eNB_UE_stats[i],0,sizeof(LTE_eNB_UE_stats)); // mac_exit_wrapper("Removing UE"); @@ -232,7 +232,7 @@ int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB, uint8_t abstraction } } - MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (not found)", rnti); + MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (not found)", rntiP); return(-1); } @@ -3523,7 +3523,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ frame, phy_vars_eNB->eNB_UE_stats[i].crnti); #endif - remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB,abstraction_flag); + mac_phy_remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB); phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 0; //phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 0; @@ -3670,7 +3670,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->CC_id, frame, phy_vars_eNB->eNB_UE_stats[i].crnti); - remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB,abstraction_flag); + mac_phy_remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB); phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 0; } diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index d1d08390d7..dbc094034b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -127,9 +127,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, // increment this, it is cleared when we receive an sdu eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].ul_inactivity_timer++; - + if (mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti)==NULL) { - mac_remove_ue(module_idP, i, frameP, subframeP); + // mac_remove_ue(module_idP, i, frameP, subframeP); } else { // check uplink failure @@ -210,7 +210,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, 0); } else { // ra_pdcch_sent==1 - LOG_I(MAC,"UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); + LOG_D(MAC,"UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); if ((UE_list->UE_sched_ctrl[i].ul_failure_timer % 40) == 0) UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=0; // resend every 4 frames } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index e23f007a07..4ba290bf59 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -287,44 +287,38 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP) } //------------------------------------------------------------------------------ -int mac_remove_ue(module_id_t mod_idP, int ue_idP, int frameP, sub_frame_t subframeP) +int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP) //------------------------------------------------------------------------------ { int prev,i, ret=-1; - rnti_t rnti; - UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list; - int pCC_id = UE_PCCID(mod_idP,ue_idP); - rnti = UE_list->UE_template[pCC_id][ue_idP].rnti; - LOG_I(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n",ue_idP,pCC_id, rnti); + UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list; + int UE_id = find_UE_id(mod_idP,rntiP); + int pCC_id = UE_PCCID(mod_idP,UE_id); + + LOG_I(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n",UE_id,pCC_id, rntiP); dump_ue_list(UE_list,0); // clear all remaining pending transmissions - UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID0] = 0; - UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID1] = 0; - UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID2] = 0; - UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID3] = 0; + UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID0] = 0; + UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID1] = 0; + UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID2] = 0; + UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID3] = 0; - UE_list->UE_template[pCC_id][ue_idP].ul_SR = 0; - UE_list->UE_template[pCC_id][ue_idP].rnti = NOT_A_RNTI; - UE_list->UE_template[pCC_id][ue_idP].ul_active = FALSE; - eNB_ulsch_info[mod_idP][pCC_id][ue_idP].rnti = NOT_A_RNTI; - eNB_ulsch_info[mod_idP][pCC_id][ue_idP].status = S_UL_NONE; - eNB_dlsch_info[mod_idP][pCC_id][ue_idP].rnti = NOT_A_RNTI; - eNB_dlsch_info[mod_idP][pCC_id][ue_idP].status = S_DL_NONE; - - rrc_eNB_free_UE( - mod_idP, - rnti, - frameP, - subframeP); + UE_list->UE_template[pCC_id][UE_id].ul_SR = 0; + UE_list->UE_template[pCC_id][UE_id].rnti = NOT_A_RNTI; + UE_list->UE_template[pCC_id][UE_id].ul_active = FALSE; + eNB_ulsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI; + eNB_ulsch_info[mod_idP][pCC_id][UE_id].status = S_UL_NONE; + eNB_dlsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI; + eNB_dlsch_info[mod_idP][pCC_id][UE_id].status = S_DL_NONE; prev = UE_list->head; for (i=UE_list->head; i>=0; i=UE_list->next[i]) { - if (i == ue_idP) { + if (i == UE_id) { // link prev to next in Active list //if (prev==UE_list->head) if (i==UE_list->head) { @@ -349,7 +343,7 @@ int mac_remove_ue(module_id_t mod_idP, int ue_idP, int frameP, sub_frame_t subfr prev = UE_list->head_ul; for (i=UE_list->head_ul; i>=0; i=UE_list->next_ul[i]) { - if (i == ue_idP) { + if (i == UE_id) { // link prev to next in Active list if (prev==UE_list->head_ul) { UE_list->head_ul = UE_list->next_ul[i]; @@ -370,7 +364,7 @@ int mac_remove_ue(module_id_t mod_idP, int ue_idP, int frameP, sub_frame_t subfr return (0); } - LOG_E(MAC,"error in mac_remove_ue(), could not find previous to %d in UE_list, should never happen, Dumping UE list\n",ue_idP); + LOG_E(MAC,"error in mac_remove_ue(), could not find previous to %d in UE_list, should never happen, Dumping UE list\n",UE_id); dump_ue_list(UE_list,0); mac_xface->macphy_exit("mac_remove_ue: Problem in UE_list"); return(-1); diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index 32cb3b1738..d5a445744d 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -476,6 +476,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui mac_xface->Msg1_transmitted = Msg1_tx; mac_xface->ra_failed = ra_failed; mac_xface->ra_succeeded = ra_succeeded; + mac_xface->mac_phy_remove_ue = mac_phy_remove_ue; LOG_I(MAC,"[MAIN] init UE MAC functions \n"); mac_xface->ue_decode_si = ue_decode_si; diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 632d8c8360..0e1d69d065 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -499,7 +499,7 @@ uint8_t *parse_ulsch_header(uint8_t *mac_header, int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active); int mac_init(void); int add_new_ue(module_id_t Mod_id, int CC_id, rnti_t rnti,int harq_pid); -int mac_remove_ue(module_id_t Mod_id, int UE_id,int frameP, sub_frame_t subframeP); +int rrc_mac_remove_ue(module_id_t Mod_id, rnti_t rntiP); int maxround(module_id_t Mod_id,uint16_t rnti,int frame,sub_frame_t subframe,uint8_t ul_flag); diff --git a/openair2/PHY_INTERFACE/defs.h b/openair2/PHY_INTERFACE/defs.h index 194b085118..df8cfbdc26 100755 --- a/openair2/PHY_INTERFACE/defs.h +++ b/openair2/PHY_INTERFACE/defs.h @@ -134,7 +134,7 @@ typedef struct { /// get delta mcs for fast UL AMC int16_t (*estimate_ue_tx_power)(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs); - + int (*mac_phy_remove_ue)(module_id_t Mod_idP,rnti_t rntiP); /// UE functions /// reset the ue phy diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c index 7a4a69e2d2..8c16eb8542 100644 --- a/openair2/RRC/LITE/L2_interface.c +++ b/openair2/RRC/LITE/L2_interface.c @@ -716,19 +716,47 @@ mac_eNB_get_rrc_status( } void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP, - const int CC_id, + const int CC_idP, const frame_t frameP, const sub_frame_t subframeP, - const rnti_t rnti) { + const rnti_t rntiP) { + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + ue_context_p = rrc_eNB_get_ue_context( + &eNB_rrc_inst[Mod_instP], + rntiP); + + if (ue_context_p != NULL) { + LOG_I(RRC,"Frame %d, Subframe %d: UE %x UL failure, activating timer\n",rntiP); + ue_context_p->ue_context.ul_failure_timer=1; + } + else { + LOG_E(RRC,"Frame %d, Subframe %d: UE %x unknown \n",rntiP); + } + return; } void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP, - const int CC_id, + const int CC_idP, const frame_t frameP, const sub_frame_t subframeP, - const rnti_t rnti) { + const rnti_t rntiP) { + + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + ue_context_p = rrc_eNB_get_ue_context( + &eNB_rrc_inst[Mod_instP], + rntiP); + + + + if (ue_context_p != NULL) { + LOG_I(RRC,"Frame %d, Subframe %d: UE %x to UL in synch\n",rntiP); + ue_context_p->ue_context.ul_failure_timer=0; + } + else { + LOG_E(RRC,"Frame %d, Subframe %d: UE %x unknown \n",rntiP); + } return; } diff --git a/openair2/RRC/LITE/defs.h b/openair2/RRC/LITE/defs.h index 78240de082..49dc4d06ad 100644 --- a/openair2/RRC/LITE/defs.h +++ b/openair2/RRC/LITE/defs.h @@ -357,6 +357,7 @@ typedef struct eNB_RRC_UE_s { transport_layer_addr_t enb_gtp_addrs[S1AP_MAX_E_RAB]; rb_id_t enb_gtp_ebi[S1AP_MAX_E_RAB]; #endif + uint32_t ul_failure_timer; } eNB_RRC_UE_t; typedef uid_t ue_uid_t; diff --git a/openair2/RRC/LITE/rrc_common.c b/openair2/RRC/LITE/rrc_common.c index a27199bdab..75a50428f5 100644 --- a/openair2/RRC/LITE/rrc_common.c +++ b/openair2/RRC/LITE/rrc_common.c @@ -414,9 +414,10 @@ rrc_rx_tx( uint8_t UE_id; int32_t current_timestamp_ms, ref_timestamp_ms; struct timeval ts; + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + #ifdef LOCALIZATION double estimated_distance; - struct rrc_eNB_ue_context_s* ue_context_p = NULL; protocol_ctxt_t ctxt; #endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_IN); @@ -517,6 +518,20 @@ rrc_rx_tx( } else { // eNB check_handovers(ctxt_pP); // counetr, and get the value and aggregate + + // check for UL failure + RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head)) { + if (ue_context_p->ue_context.ul_failure_timer>0) { + ue_context_p->ue_context.ul_failure_timer++; + if (ue_context_p->ue_context.ul_failure_timer == 1000) { + // remove UE after 1 second after MAC has indicated UL failure + LOG_I(RRC,"Removing UE %x instance\n",ue_context_p->ue_context.rnti); + + } + } + + + } #ifdef LOCALIZATION /* for the localization, only primary CC_id might be relevant*/ diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index befdc32c63..836217e8d9 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -790,7 +790,6 @@ rrc_eNB_free_mem_UE_context( } //----------------------------------------------------------------------------- -// called by MAC layer only // should be called when UE is lost by eNB void rrc_eNB_free_UE( @@ -836,6 +835,7 @@ rrc_eNB_free_UE( #endif ue_context_p->ue_context.Status = RRC_IDLE; + rrc_mac_remove_ue(enb_mod_idP,rntiP); rrc_rlc_remove_ue(&ctxt); pdcp_remove_UE(&ctxt); From d4cdda31abf878c3944c967e7332522c1e6cbc7b Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 19 Feb 2016 15:42:32 +0100 Subject: [PATCH 042/214] Final changes for UE context management --- openair1/PHY/LTE_TRANSPORT/dlsch_coding.c | 50 +++++++-------- openair1/PHY/LTE_TRANSPORT/proto.h | 4 +- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 2 +- openair1/PHY/impl_defs_top.h | 2 +- openair1/SCHED/defs.h | 2 +- openair1/SCHED/phy_procedures_lte_eNb.c | 62 ++++++++++--------- openair2/LAYER2/MAC/eNB_scheduler.c | 6 +- .../LAYER2/MAC/eNB_scheduler_primitives.c | 48 +++++++------- openair2/LAYER2/MAC/main.c | 1 + openair2/LAYER2/MAC/proto.h | 2 +- openair2/PHY_INTERFACE/defs.h | 2 +- openair2/RRC/LITE/L2_interface.c | 38 ++++++++++-- openair2/RRC/LITE/defs.h | 1 + openair2/RRC/LITE/proto.h | 6 +- openair2/RRC/LITE/rrc_common.c | 19 +++++- openair2/RRC/LITE/rrc_eNB.c | 56 ++++++++--------- 16 files changed, 171 insertions(+), 130 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c index 95af038ab0..01102636fc 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c @@ -44,6 +44,7 @@ #include "PHY/CODING/extern.h" #include "PHY/CODING/lte_interleaver_inline.h" #include "PHY/LTE_TRANSPORT/defs.h" +#include "PHY/LTE_TRANSPORT/proto.h" #include "defs.h" #include "UTIL/LOG/vcd_signal_dumper.h" @@ -91,11 +92,11 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch) #endif for (r=0; rharq_processes[i]->c[r]); #endif - + if (dlsch->harq_processes[i]->c[r]) { free16(dlsch->harq_processes[i]->c[r],((r==0)?8:0) + 3+768); dlsch->harq_processes[i]->c[r] = NULL; @@ -104,17 +105,17 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch) free16(dlsch->harq_processes[i]->d[r],(96+12+3+(3*6144))); dlsch->harq_processes[i]->d[r] = NULL; } - } - - free16(dlsch->harq_processes[i],sizeof(LTE_DL_eNB_HARQ_t)); - dlsch->harq_processes[i] = NULL; + + } + free16(dlsch->harq_processes[i],sizeof(LTE_DL_eNB_HARQ_t)); + dlsch->harq_processes[i] = NULL; } } - + free16(dlsch,sizeof(LTE_eNB_DLSCH_t)); dlsch = NULL; - } - + } + } LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_t Nsoft,unsigned char N_RB_DL, uint8_t abstraction_flag) @@ -204,28 +205,28 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_ for (i=0; iharq_processes[i]->round=0; - if (abstraction_flag==0) { - for (j=0; j<96; j++) - for (r=0; rharq_processes[%d]->d[%d] %p\n",i,r,dlsch->harq_processes[i]->d[r]); - dlsch->harq_processes[i]->d[r][j] = LTE_NULL; - } - } + for (j=0; j<96; j++) + for (r=0; rharq_processes[%d]->d[%d] %p\n",i,r,dlsch->harq_processes[i]->d[r]); + if (dlsch->harq_processes[i]->d[r]) + dlsch->harq_processes[i]->d[r][j] = LTE_NULL; + } + } return(dlsch); } } - LOG_D(PHY, "new_eNB_dlsch exit flag %d, size of %ld\n", - exit_flag, sizeof(LTE_eNB_DLSCH_t)); + LOG_D(PHY,"new_eNB_dlsch exit flag %d, size of %ld\n", + exit_flag, sizeof(LTE_eNB_DLSCH_t)); free_eNB_dlsch(dlsch); return(NULL); } -void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag) +void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch) { unsigned char Mdlharq; @@ -245,12 +246,11 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag) dlsch->harq_processes[i]->status = 0; dlsch->harq_processes[i]->round = 0; - if (abstraction_flag==0) { - for (j=0; j<96; j++) - for (r=0; rharq_processes[i]->d[r]) - dlsch->harq_processes[i]->d[r][j] = LTE_NULL; - } + for (j=0; j<96; j++) + for (r=0; rharq_processes[i]->d[r]) + dlsch->harq_processes[i]->d[r][j] = LTE_NULL; + } } } diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index 9afea790b3..15a8f53f54 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -54,7 +54,7 @@ */ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch); -void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag); +void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch); /** \fn new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t abstraction_flag) \brief This function allocates structures for a particular DLSCH at eNB @@ -85,7 +85,7 @@ void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch); LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag); -void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch, uint8_t abstraction_flag); +void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch); void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch); diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 25dae3ed63..ca4e8be933 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -179,7 +179,7 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint return(NULL); } -void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch, uint8_t abstraction_flag) +void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch) { unsigned char Mdlharq; diff --git a/openair1/PHY/impl_defs_top.h b/openair1/PHY/impl_defs_top.h index e55e28e3be..4b0edcff29 100755 --- a/openair1/PHY/impl_defs_top.h +++ b/openair1/PHY/impl_defs_top.h @@ -256,7 +256,7 @@ #define AMP_OVER_2 (AMP>>1) /// Threshold for PUCCH Format 1 detection -#define PUCCH1_THRES 10 +#define PUCCH1_THRES 7 /// Threshold for PUCCH Format 1a/1b detection #define PUCCH1a_THRES 4 diff --git a/openair1/SCHED/defs.h b/openair1/SCHED/defs.h index 8692a31f12..af6acca880 100644 --- a/openair1/SCHED/defs.h +++ b/openair1/SCHED/defs.h @@ -405,7 +405,7 @@ void remove_harq_pid_from_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid); int8_t find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB); int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB); -int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag); +int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rnti); void process_timing_advance(module_id_t Mod_id,uint8_t CC_id,int16_t timing_advance); void process_timing_advance_rar(PHY_VARS_UE *phy_vars_ue,uint16_t timing_advance); diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index a7796a9b69..ca1e8a3d37 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -198,41 +198,43 @@ int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB) return(-1); } -int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB, uint8_t abstraction_flag) -{ +int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rntiP) { uint8_t i; - int j; + int j,CC_id; + PHY_VARS_eNB *phy_vars_eNB; - for (i=0; idlsch_eNB[i]==NULL) || (phy_vars_eNB->ulsch_eNB[i]==NULL)) { - MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (ENOMEM)", rnti); - LOG_E(PHY,"Can't remove UE, not enough memory allocated\n"); - return(-1); - } else { - if (phy_vars_eNB->eNB_UE_stats[i].crnti==rnti) { - MSC_LOG_EVENT(MSC_PHY_ENB, "0 Removed ue %"PRIx16" ", rnti); + for (CC_id=0;CC_iddlsch_eNB[i]==NULL) || (phy_vars_eNB->ulsch_eNB[i]==NULL)) { + MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (ENOMEM)", rnti); + LOG_E(PHY,"Can't remove UE, not enough memory allocated\n"); + return(-1); + } else { + if (phy_vars_eNB->eNB_UE_stats[i].crnti==rntiP) { + MSC_LOG_EVENT(MSC_PHY_ENB, "0 Removed ue %"PRIx16" ", rntiP); #ifdef DEBUG_PHY_PROC - LOG_I(PHY,"eNB %d removing UE %d with rnti %x\n",phy_vars_eNB->Mod_id,i,rnti); + LOG_I(PHY,"eNB %d removing UE %d with rnti %x\n",phy_vars_eNB->Mod_id,i,rnti); #endif - //msg("[PHY] UE_id %d\n",i); - clean_eNb_dlsch(phy_vars_eNB->dlsch_eNB[i][0], abstraction_flag); - clean_eNb_ulsch(phy_vars_eNB->ulsch_eNB[i],abstraction_flag); - //phy_vars_eNB->eNB_UE_stats[i].crnti = 0; - memset(&phy_vars_eNB->eNB_UE_stats[i],0,sizeof(LTE_eNB_UE_stats)); - // mac_exit_wrapper("Removing UE"); - - /* clear the harq pid freelist */ - phy_vars_eNB->dlsch_eNB[i][0]->head_freelist = 0; - phy_vars_eNB->dlsch_eNB[i][0]->tail_freelist = 0; - for (j = 0; j < 8; j++) - put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[i][0], j); - - return(i); + //msg("[PHY] UE_id %d\n",i); + clean_eNb_dlsch(phy_vars_eNB->dlsch_eNB[i][0]); + clean_eNb_ulsch(phy_vars_eNB->ulsch_eNB[i]); + //phy_vars_eNB->eNB_UE_stats[i].crnti = 0; + memset(&phy_vars_eNB->eNB_UE_stats[i],0,sizeof(LTE_eNB_UE_stats)); + // mac_exit_wrapper("Removing UE"); + + /* clear the harq pid freelist */ + phy_vars_eNB->dlsch_eNB[i][0]->head_freelist = 0; + phy_vars_eNB->dlsch_eNB[i][0]->tail_freelist = 0; + for (j = 0; j < 8; j++) + put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[i][0], j); + + return(i); + } } } } - - MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (not found)", rnti); + MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (not found)", rntiP); return(-1); } @@ -3523,7 +3525,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ frame, phy_vars_eNB->eNB_UE_stats[i].crnti); #endif - remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB,abstraction_flag); + mac_phy_remove_ue(phy_vars_eNB->Mod_id,phy_vars_eNB->eNB_UE_stats[i].crnti); phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 0; //phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 0; @@ -3670,7 +3672,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->CC_id, frame, phy_vars_eNB->eNB_UE_stats[i].crnti); - remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB,abstraction_flag); + mac_phy_remove_ue(phy_vars_eNB->Mod_id,phy_vars_eNB->eNB_UE_stats[i].crnti); phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 0; } diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index d1d08390d7..dbc094034b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -127,9 +127,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, // increment this, it is cleared when we receive an sdu eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].ul_inactivity_timer++; - + if (mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti)==NULL) { - mac_remove_ue(module_idP, i, frameP, subframeP); + // mac_remove_ue(module_idP, i, frameP, subframeP); } else { // check uplink failure @@ -210,7 +210,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, 0); } else { // ra_pdcch_sent==1 - LOG_I(MAC,"UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); + LOG_D(MAC,"UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); if ((UE_list->UE_sched_ctrl[i].ul_failure_timer % 40) == 0) UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=0; // resend every 4 frames } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index e23f007a07..7162501f89 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -287,44 +287,38 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP) } //------------------------------------------------------------------------------ -int mac_remove_ue(module_id_t mod_idP, int ue_idP, int frameP, sub_frame_t subframeP) +int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP) //------------------------------------------------------------------------------ { int prev,i, ret=-1; - rnti_t rnti; - UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list; - int pCC_id = UE_PCCID(mod_idP,ue_idP); - rnti = UE_list->UE_template[pCC_id][ue_idP].rnti; - LOG_I(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n",ue_idP,pCC_id, rnti); + UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list; + int UE_id = find_UE_id(mod_idP,rntiP); + int pCC_id = UE_PCCID(mod_idP,UE_id); + + LOG_I(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n",UE_id,pCC_id, rntiP); dump_ue_list(UE_list,0); // clear all remaining pending transmissions - UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID0] = 0; - UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID1] = 0; - UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID2] = 0; - UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID3] = 0; + UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID0] = 0; + UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID1] = 0; + UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID2] = 0; + UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID3] = 0; - UE_list->UE_template[pCC_id][ue_idP].ul_SR = 0; - UE_list->UE_template[pCC_id][ue_idP].rnti = NOT_A_RNTI; - UE_list->UE_template[pCC_id][ue_idP].ul_active = FALSE; - eNB_ulsch_info[mod_idP][pCC_id][ue_idP].rnti = NOT_A_RNTI; - eNB_ulsch_info[mod_idP][pCC_id][ue_idP].status = S_UL_NONE; - eNB_dlsch_info[mod_idP][pCC_id][ue_idP].rnti = NOT_A_RNTI; - eNB_dlsch_info[mod_idP][pCC_id][ue_idP].status = S_DL_NONE; - - rrc_eNB_free_UE( - mod_idP, - rnti, - frameP, - subframeP); + UE_list->UE_template[pCC_id][UE_id].ul_SR = 0; + UE_list->UE_template[pCC_id][UE_id].rnti = NOT_A_RNTI; + UE_list->UE_template[pCC_id][UE_id].ul_active = FALSE; + eNB_ulsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI; + eNB_ulsch_info[mod_idP][pCC_id][UE_id].status = S_UL_NONE; + eNB_dlsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI; + eNB_dlsch_info[mod_idP][pCC_id][UE_id].status = S_DL_NONE; prev = UE_list->head; for (i=UE_list->head; i>=0; i=UE_list->next[i]) { - if (i == ue_idP) { + if (i == UE_id) { // link prev to next in Active list //if (prev==UE_list->head) if (i==UE_list->head) { @@ -349,7 +343,7 @@ int mac_remove_ue(module_id_t mod_idP, int ue_idP, int frameP, sub_frame_t subfr prev = UE_list->head_ul; for (i=UE_list->head_ul; i>=0; i=UE_list->next_ul[i]) { - if (i == ue_idP) { + if (i == UE_id) { // link prev to next in Active list if (prev==UE_list->head_ul) { UE_list->head_ul = UE_list->next_ul[i]; @@ -366,11 +360,13 @@ int mac_remove_ue(module_id_t mod_idP, int ue_idP, int frameP, sub_frame_t subfr prev=i; } + mac_phy_remove_ue(mod_idP,rntiP); + if (ret == 0) { return (0); } - LOG_E(MAC,"error in mac_remove_ue(), could not find previous to %d in UE_list, should never happen, Dumping UE list\n",ue_idP); + LOG_E(MAC,"error in mac_remove_ue(), could not find previous to %d in UE_list, should never happen, Dumping UE list\n",UE_id); dump_ue_list(UE_list,0); mac_xface->macphy_exit("mac_remove_ue: Problem in UE_list"); return(-1); diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index 32cb3b1738..d5a445744d 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -476,6 +476,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui mac_xface->Msg1_transmitted = Msg1_tx; mac_xface->ra_failed = ra_failed; mac_xface->ra_succeeded = ra_succeeded; + mac_xface->mac_phy_remove_ue = mac_phy_remove_ue; LOG_I(MAC,"[MAIN] init UE MAC functions \n"); mac_xface->ue_decode_si = ue_decode_si; diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 632d8c8360..0e1d69d065 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -499,7 +499,7 @@ uint8_t *parse_ulsch_header(uint8_t *mac_header, int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active); int mac_init(void); int add_new_ue(module_id_t Mod_id, int CC_id, rnti_t rnti,int harq_pid); -int mac_remove_ue(module_id_t Mod_id, int UE_id,int frameP, sub_frame_t subframeP); +int rrc_mac_remove_ue(module_id_t Mod_id, rnti_t rntiP); int maxround(module_id_t Mod_id,uint16_t rnti,int frame,sub_frame_t subframe,uint8_t ul_flag); diff --git a/openair2/PHY_INTERFACE/defs.h b/openair2/PHY_INTERFACE/defs.h index 194b085118..df8cfbdc26 100755 --- a/openair2/PHY_INTERFACE/defs.h +++ b/openair2/PHY_INTERFACE/defs.h @@ -134,7 +134,7 @@ typedef struct { /// get delta mcs for fast UL AMC int16_t (*estimate_ue_tx_power)(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs); - + int (*mac_phy_remove_ue)(module_id_t Mod_idP,rnti_t rntiP); /// UE functions /// reset the ue phy diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c index 7a4a69e2d2..ad8a9c9c2e 100644 --- a/openair2/RRC/LITE/L2_interface.c +++ b/openair2/RRC/LITE/L2_interface.c @@ -716,19 +716,47 @@ mac_eNB_get_rrc_status( } void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP, - const int CC_id, + const int CC_idP, const frame_t frameP, const sub_frame_t subframeP, - const rnti_t rnti) { + const rnti_t rntiP) { - return; + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + ue_context_p = rrc_eNB_get_ue_context( + &eNB_rrc_inst[Mod_instP], + rntiP); + + if (ue_context_p != NULL) { + LOG_I(RRC,"Frame %d, Subframe %d: UE %x UL failure, activating timer\n",rntiP); + ue_context_p->ue_context.ul_failure_timer=1; + } + else { + LOG_W(RRC,"Frame %d, Subframe %d: UE %x unknown \n",frameP,subframeP,rntiP); + rrc_mac_remove_ue(Mod_instP,rntiP); + } + } void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP, - const int CC_id, + const int CC_idP, const frame_t frameP, const sub_frame_t subframeP, - const rnti_t rnti) { + const rnti_t rntiP) { + + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + ue_context_p = rrc_eNB_get_ue_context( + &eNB_rrc_inst[Mod_instP], + rntiP); + + + + if (ue_context_p != NULL) { + LOG_I(RRC,"Frame %d, Subframe %d: UE %x to UL in synch\n",rntiP); + ue_context_p->ue_context.ul_failure_timer=0; + } + else { + LOG_E(RRC,"Frame %d, Subframe %d: UE %x unknown \n",rntiP); + } return; } diff --git a/openair2/RRC/LITE/defs.h b/openair2/RRC/LITE/defs.h index 78240de082..49dc4d06ad 100644 --- a/openair2/RRC/LITE/defs.h +++ b/openair2/RRC/LITE/defs.h @@ -357,6 +357,7 @@ typedef struct eNB_RRC_UE_s { transport_layer_addr_t enb_gtp_addrs[S1AP_MAX_E_RAB]; rb_id_t enb_gtp_ebi[S1AP_MAX_E_RAB]; #endif + uint32_t ul_failure_timer; } eNB_RRC_UE_t; typedef uid_t ue_uid_t; diff --git a/openair2/RRC/LITE/proto.h b/openair2/RRC/LITE/proto.h index 920d4d85f3..d14b129479 100644 --- a/openair2/RRC/LITE/proto.h +++ b/openair2/RRC/LITE/proto.h @@ -439,10 +439,8 @@ rrc_eNB_free_mem_UE_context( void rrc_eNB_free_UE( - const module_id_t enb_mod_idP, - const rnti_t rntiP, - const frame_t frameP, - const sub_frame_t subframeP + const module_id_t enb_mod_idP, + const struct rrc_eNB_ue_context_s* const ue_context_pP ); long binary_search_int(int elements[], long numElem, int value); diff --git a/openair2/RRC/LITE/rrc_common.c b/openair2/RRC/LITE/rrc_common.c index a27199bdab..595e87a534 100644 --- a/openair2/RRC/LITE/rrc_common.c +++ b/openair2/RRC/LITE/rrc_common.c @@ -48,6 +48,7 @@ #include "asn1_msg.h" #include "pdcp.h" #include "UTIL/LOG/vcd_signal_dumper.h" +#include "rrc_eNB_UE_context.h" #ifdef LOCALIZATION #include @@ -414,9 +415,10 @@ rrc_rx_tx( uint8_t UE_id; int32_t current_timestamp_ms, ref_timestamp_ms; struct timeval ts; + struct rrc_eNB_ue_context_s *ue_context_p = NULL,*ue_to_be_removed = NULL; + #ifdef LOCALIZATION double estimated_distance; - struct rrc_eNB_ue_context_s* ue_context_p = NULL; protocol_ctxt_t ctxt; #endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_IN); @@ -517,6 +519,21 @@ rrc_rx_tx( } else { // eNB check_handovers(ctxt_pP); // counetr, and get the value and aggregate + + // check for UL failure + RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head)) { + if (ue_context_p->ue_context.ul_failure_timer>0) { + ue_context_p->ue_context.ul_failure_timer++; + if (ue_context_p->ue_context.ul_failure_timer >= 20000) { + // remove UE after 20 seconds after MAC has indicated UL failure + LOG_I(RRC,"Removing UE %x instance\n",ue_context_p->ue_context.rnti); + ue_to_be_removed = ue_context_p; + break; + } + } + } + if (ue_to_be_removed) + rrc_eNB_free_UE(ctxt_pP->module_id,ue_to_be_removed); #ifdef LOCALIZATION /* for the localization, only primary CC_id might be relevant*/ diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index befdc32c63..6683e70045 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -790,35 +790,32 @@ rrc_eNB_free_mem_UE_context( } //----------------------------------------------------------------------------- -// called by MAC layer only // should be called when UE is lost by eNB void -rrc_eNB_free_UE( - const module_id_t enb_mod_idP, - const rnti_t rntiP, - const frame_t frameP, - const sub_frame_t subframeP -) +rrc_eNB_free_UE(const module_id_t enb_mod_idP,const struct rrc_eNB_ue_context_s* const ue_context_pP) //----------------------------------------------------------------------------- { - struct rrc_eNB_ue_context_s* ue_context_p = NULL; + protocol_ctxt_t ctxt; #if !defined(ENABLE_USE_MME) module_id_t ue_module_id; #endif - AssertFatal(enb_mod_idP < NB_eNB_INST, "eNB inst invalid (%d/%d) for UE %x!", enb_mod_idP, NB_eNB_INST, rntiP); - ue_context_p = rrc_eNB_get_ue_context( + rnti_t rnti = ue_context_pP->ue_context.rnti; + + + AssertFatal(enb_mod_idP < NB_eNB_INST, "eNB inst invalid (%d/%d) for UE %x!", enb_mod_idP, NB_eNB_INST, rnti); + /* ue_context_p = rrc_eNB_get_ue_context( &eNB_rrc_inst[enb_mod_idP], rntiP ); - - if (NULL != ue_context_p) { - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, enb_mod_idP, ENB_FLAG_YES, rntiP, frameP, subframeP,enb_mod_idP); - LOG_W(RRC, "[eNB %d] Removing UE RNTI %x\n", enb_mod_idP, rntiP); + */ + if (NULL != ue_context_pP) { + PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, enb_mod_idP, ENB_FLAG_YES, rnti, 0, 0,enb_mod_idP); + LOG_W(RRC, "[eNB %d] Removing UE RNTI %x\n", enb_mod_idP, rnti); #if defined(ENABLE_USE_MME) - rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ(enb_mod_idP, ue_context_p, S1AP_CAUSE_RADIO_NETWORK, 21); // send cause 21: connection with ue lost + rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ(enb_mod_idP, ue_context_pP, S1AP_CAUSE_RADIO_NETWORK, 21); // send cause 21: connection with ue lost /* From 3GPP 36300v10 p129 : 19.2.2.2.2 S1 UE Context Release Request (eNB triggered) * If the E-UTRAN internal reason is a radio link failure detected in the eNB, the eNB shall wait a sufficient time before * triggering the S1 UE Context Release Request procedure @@ -827,22 +824,22 @@ rrc_eNB_free_UE( */ #else #if defined(OAI_EMU) - AssertFatal(ue_context_p->local_uid < NUMBER_OF_UE_MAX, "local_uid invalid (%d<%d) for UE %x!", ue_context_p->local_uid, NUMBER_OF_UE_MAX, rntiP); - ue_module_id = oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_mod_idP][ue_context_p->local_uid]; - AssertFatal(ue_module_id < NUMBER_OF_UE_MAX, "ue_module_id invalid (%d<%d) for UE %x!", ue_module_id, NUMBER_OF_UE_MAX, rntiP); - oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_mod_idP][ue_context_p->local_uid] = -1; + AssertFatal(ue_context_pP->local_uid < NUMBER_OF_UE_MAX, "local_uid invalid (%d<%d) for UE %x!", ue_context_pP->local_uid, NUMBER_OF_UE_MAX, rnti); + ue_module_id = oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_mod_idP][ue_context_pP->local_uid]; + AssertFatal(ue_module_id < NUMBER_OF_UE_MAX, "ue_module_id invalid (%d<%d) for UE %x!", ue_module_id, NUMBER_OF_UE_MAX, rnti); + oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_mod_idP][ue_context_pP->local_uid] = -1; oai_emulation.info.eNB_ue_module_id_to_rnti[enb_mod_idP][ue_module_id] = NOT_A_RNTI; #endif #endif - ue_context_p->ue_context.Status = RRC_IDLE; + rrc_mac_remove_ue(enb_mod_idP,rnti); rrc_rlc_remove_ue(&ctxt); pdcp_remove_UE(&ctxt); rrc_eNB_remove_ue_context( &ctxt, &eNB_rrc_inst[enb_mod_idP], - ue_context_p); + ue_context_pP); } } @@ -3554,6 +3551,7 @@ rrc_eNB_decode_ccch( int i, rval; struct rrc_eNB_ue_context_s* ue_context_p = NULL; uint64_t random_value = 0; + int stmsi_received = 0; //memset(ul_ccch_msg,0,sizeof(UL_CCCH_Message_t)); @@ -3724,17 +3722,16 @@ rrc_eNB_decode_ccch( random_value = (((uint64_t)mme_code) << 32) | m_tmsi; if ((ue_context_p = rrc_eNB_ue_context_stmsi_exist(ctxt_pP, mme_code, m_tmsi))) { #warning "TODO: stmsi_exist: remove UE from MAC/PHY (how?)" - LOG_I(RRC,PROTOCOL_RRC_CTXT_UE_FMT" S-TMSI exists, ue_context_p %p\n",ue_context_p); + LOG_I(RRC," S-TMSI exists, ue_context_p %p\n",ue_context_p); + stmsi_received=1; // AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)"); - ue_context_p = NULL; + // ue_context_p = NULL; } else { ue_context_p = rrc_eNB_get_next_free_ue_context(ctxt_pP, NOT_A_RANDOM_UE_IDENTITY); + ue_context_p->ue_context.Initialue_identity_s_TMSI.presence = TRUE; + ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code = mme_code; + ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi = m_tmsi; } - if (ue_context_p==NULL) - AssertFatal(0 == 1, "ue_context_p is null"); - ue_context_p->ue_context.Initialue_identity_s_TMSI.presence = TRUE; - ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code = mme_code; - ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi = m_tmsi; MSC_LOG_RX_MESSAGE( MSC_RRC_ENB, @@ -3780,7 +3777,8 @@ rrc_eNB_decode_ccch( PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), ue_context_p->ue_context.random_ue_identity); #endif - eNB_rrc_inst[ctxt_pP->module_id].Nb_ue++; + if (stmsi_received == 0) + eNB_rrc_inst[ctxt_pP->module_id].Nb_ue++; } else { // no context available From a4ea1f9ba6733bd7c1ba695be7f62d0b41599e4b Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 19 Feb 2016 21:24:08 +0100 Subject: [PATCH 043/214] small changes in RRC --- openair2/RRC/LITE/L2_interface.c | 2 +- openair2/RRC/LITE/rrc_eNB.c | 20 +++++++++++++------ .../CONF/enb.band7.tm1.rrh.usrpb210.conf | 16 +++++++-------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c index ad8a9c9c2e..f0d89169c3 100644 --- a/openair2/RRC/LITE/L2_interface.c +++ b/openair2/RRC/LITE/L2_interface.c @@ -727,7 +727,7 @@ void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP, rntiP); if (ue_context_p != NULL) { - LOG_I(RRC,"Frame %d, Subframe %d: UE %x UL failure, activating timer\n",rntiP); + LOG_I(RRC,"Frame %d, Subframe %d: UE %x UL failure, activating timer\n",frameP,subframeP,rntiP); ue_context_p->ue_context.ul_failure_timer=1; } else { diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index 6683e70045..abc7435b79 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -3724,6 +3724,7 @@ rrc_eNB_decode_ccch( #warning "TODO: stmsi_exist: remove UE from MAC/PHY (how?)" LOG_I(RRC," S-TMSI exists, ue_context_p %p\n",ue_context_p); stmsi_received=1; + ue_context_p->ue_context.rnti = ctxt_pP->rnti; // AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)"); // ue_context_p = NULL; } else { @@ -3766,12 +3767,19 @@ rrc_eNB_decode_ccch( #if defined(ENABLE_ITTI) ue_context_p->ue_context.establishment_cause = rrcConnectionRequest->establishmentCause; - LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection from UE random UE identity (0x%" PRIx64 ") MME code %u TMSI %u cause %u\n", - PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), - ue_context_p->ue_context.random_ue_identity, - ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code, - ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi, - ue_context_p->ue_context.establishment_cause); + if (stmsi_received==0) + LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection from UE random UE identity (0x%" PRIx64 ") MME code %u TMSI %u cause %u\n", + PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), + ue_context_p->ue_context.random_ue_identity, + ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code, + ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi, + ue_context_p->ue_context.establishment_cause); + else + LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection from UE MME code %u TMSI %u cause %u\n", + PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), + ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code, + ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi, + ue_context_p->ue_context.establishment_cause); #else LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection for UE random UE identity (0x%" PRIx64 ")\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf index 33db53740c..8e94836df1 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf @@ -17,7 +17,7 @@ eNBs = mobile_country_code = "208"; - mobile_network_code = "92"; + mobile_network_code = "93"; ////////// Physical parameters: @@ -133,7 +133,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; + mme_ip_address = ( { ipv4 = "192.168.12.11"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -145,8 +145,8 @@ rrh_gw_config = ( local_if_name = "eth0"; #remote_address = "169.254.10.158"; #local_address = "169.254.8.15"; - remote_address = "74:d4:35:cc:88:45"; - local_address = "98:90:96:df:66:07"; + remote_address = "74:d4:35:cc:88:d1"; #bourdon + local_address = "74:d4:35:cc:8d:15"; #papillon local_port = 50000; #for raw option local port must be the same to remote remote_port = 50000; rrh_gw_active = "yes"; @@ -161,13 +161,13 @@ rrh_gw_config = ( NETWORK_INTERFACES : { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth4"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; + ENB_INTERFACE_NAME_FOR_S1_MME = "eth3"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth4"; + ENB_INTERFACE_NAME_FOR_S1U = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; From c32e5544e2339d6fd683247d290c7680cd043b8f Mon Sep 17 00:00:00 2001 From: gauthier Date: Sat, 20 Feb 2016 18:20:44 +0100 Subject: [PATCH 044/214] Make it compile on 15.10 (problem with gcc-xml not resolved, may be do as in openair-cn: disable it, it is only needed for ITTI ANALYZER) --- cmake_targets/CMakeLists.txt | 1 - openair2/COMMON/commonDef.h | 19 ++++++++++++------- openair2/LAYER2/RLC/rlc.h | 2 ++ openair2/UTIL/OCG/OCG_parse_XML.c | 4 ---- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index a88eb69991..1c8f3d221e 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1110,7 +1110,6 @@ add_library(CN_UTILS ${OPENAIR3_DIR}/UTILS/conversions.c ${OPENAIR3_DIR}/UTILS/enum_string.c ${OPENAIR3_DIR}/UTILS/log.c - ${OPENAIR3_DIR}/UTILS/mme_config.c ${OPENAIR3_DIR}/UTILS/mcc_mnc_itu.c ) diff --git a/openair2/COMMON/commonDef.h b/openair2/COMMON/commonDef.h index e33e64ec06..64216b0094 100644 --- a/openair2/COMMON/commonDef.h +++ b/openair2/COMMON/commonDef.h @@ -48,7 +48,19 @@ Description Contains global common definitions #include #include +#include +typedef signed char boolean_t; + +#if !defined(TRUE) +#define TRUE (boolean_t)0x01 +#endif + +#if !defined(FALSE) +#define FALSE (boolean_t)0x00 +#endif + +#define BOOL_NOT(b) (b^TRUE) #define NAS_UE_ID_FMT "0x%06x" @@ -59,13 +71,6 @@ Description Contains global common definitions #define RETURNok (0) #define RETURNerror (-1) -#ifndef FALSE -#define FALSE (0) -#endif -#ifndef TRUE -#define TRUE (1) -#endif - /* * Name of the environment variable which defines the default directory * where the NAS application is executed and where are located files diff --git a/openair2/LAYER2/RLC/rlc.h b/openair2/LAYER2/RLC/rlc.h index 392ae88cf8..72fde0b746 100755 --- a/openair2/LAYER2/RLC/rlc.h +++ b/openair2/LAYER2/RLC/rlc.h @@ -60,6 +60,8 @@ # include "DRB-ToAddModList.h" # include "SRB-ToAddMod.h" # include "SRB-ToAddModList.h" +# include "DRB-ToReleaseList.h" + #ifdef Rel10 #include "PMCH-InfoList-r9.h" #endif diff --git a/openair2/UTIL/OCG/OCG_parse_XML.c b/openair2/UTIL/OCG/OCG_parse_XML.c index 5397cdbd98..0100d742e1 100644 --- a/openair2/UTIL/OCG/OCG_parse_XML.c +++ b/openair2/UTIL/OCG/OCG_parse_XML.c @@ -51,10 +51,6 @@ #include "UTIL/OPT/opt.h" /*----------------------------------------------------------------------------*/ -#ifndef HAVE_STRNDUP -char * strndup (const char *s, size_t size); -#endif - static int oai_emulation_; /*!< \brief indicating that the parsing position is now within OAI_Emulation_*/ static int environment_system_config_; /*!< \brief indicating that the parsing position is now within Envi_Config_*/ From a9256dedb360737ec70d7d2c9106dc201515d27f Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Sun, 21 Feb 2016 22:01:49 +0100 Subject: [PATCH 045/214] Fix asn1c warnings. The strategy is rather basic. Files with warnings are replaced by an edited copy that triggers no warning. We take care to check that the replaced file is the same as the one that was analyzed at the time of warning removal (through checking its SHA1). There is a new bash script "fix_asn1" in cmake_targets/tools and the files replacing the existing ones are in cmake_targets/tools/fix_asn1.data. --- cmake_targets/CMakeLists.txt | 25 + cmake_targets/tools/fix_asn1 | 169 +++ .../RRC.rel10/SystemInformation-r8-IEs.h | 109 ++ .../S1AP.rel10.5/NativeInteger.c | 412 +++++++ .../S1AP.rel10.5/constr_SET_OF.c | 1041 +++++++++++++++++ .../X2AP.rel11.2/NativeInteger.c | 412 +++++++ .../X2ap-CriticalityDiagnostics-IE-List.h | 63 + .../X2AP.rel11.2/constr_SET_OF.c | 1041 +++++++++++++++++ 8 files changed, 3272 insertions(+) create mode 100755 cmake_targets/tools/fix_asn1 create mode 100644 cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h create mode 100644 cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c create mode 100644 cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c create mode 100644 cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c create mode 100644 cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h create mode 100644 cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index a125219982..6bebc2d655 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -247,6 +247,7 @@ endif (${RTAI}) # New C code source file, cmake must be re-run (instead of re-running make only) ############# set(asn1c_call "${OPENAIR_CMAKE}/tools/generate_asn1") +set(fix_asn1c_call "${OPENAIR_CMAKE}/tools/fix_asn1") set(asn1_generated_dir ${OPENAIR_BIN_DIR}) set(protoc_call "${OPENAIR_CMAKE}/tools/generate_protobuf") @@ -269,6 +270,15 @@ if(NOT EXISTS ${asn1c_call}) message( FATAL_ERROR "The script ${asn1c_call} must be present" ) endif(NOT EXISTS ${asn1c_call}) execute_process(COMMAND ${asn1c_call} ${RRC_FULL_DIR} ${RRC_GRAMMAR}) +if(NOT EXISTS ${fix_asn1c_call}) + message( FATAL_ERROR "The script ${fix_asn1c_call} must be present" ) +endif(NOT EXISTS ${fix_asn1c_call}) +execute_process( + COMMAND ${fix_asn1c_call} ${RRC_FULL_DIR} RRC ${RRC_ASN1_VERSION} + RESULT_VARIABLE ret) +if (NOT ${ret} STREQUAL 0) + message(FATAL_ERROR "${fix_asn1c_call}: error") +endif (NOT ${ret} STREQUAL 0) file(GLOB rrc_source ${RRC_FULL_DIR}/*.c) set(rrc_source ${rrc_source} ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1_msg.c) file(GLOB rrc_h ${RRC_FULL_DIR}/*.h) @@ -282,6 +292,7 @@ include_directories ("${RRC_FULL_DIR}") add_custom_command ( OUTPUT ${RRC_FULL_DIR}/asn1_constants.h COMMAND ${asn1c_call} ${RRC_FULL_DIR} ${RRC_GRAMMAR} + COMMAND ${fix_asn1c_call} ${RRC_FULL_DIR} RRC ${RRC_ASN1_VERSION} DEPENDS ${RRC_GRAMMAR} ) @@ -311,6 +322,12 @@ set(S1AP_ASN_FILES set(S1AP_C_DIR ${asn1_generated_dir}/${ASN1RELDIR}) #message("calling ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES}") execute_process(COMMAND ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES}) +execute_process( + COMMAND ${fix_asn1c_call} ${S1AP_C_DIR} S1AP ${S1AP_VERSION} + RESULT_VARIABLE ret) +if (NOT ${ret} STREQUAL 0) + message(FATAL_ERROR "${fix_asn1c_call}: error") +endif (NOT ${ret} STREQUAL 0) file(GLOB S1AP_source ${S1AP_C_DIR}/*.c) set(S1AP_OAI_generated @@ -326,6 +343,7 @@ add_custom_command ( OUTPUT ${S1AP_OAI_generated} COMMAND ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES} COMMAND python ${S1AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f${S1AP_ASN_DIR}/S1AP-PDU-Contents.asn -o${S1AP_C_DIR} + COMMAND ${fix_asn1c_call} ${S1AP_C_DIR} S1AP ${S1AP_VERSION} DEPENDS ${S1AP_ASN_FILES} ) add_library(S1AP_LIB @@ -378,6 +396,12 @@ set(X2AP_ASN_FILES set(X2AP_C_DIR ${asn1_generated_dir}/${ASN1RELDIR}) #message("calling ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES}") execute_process(COMMAND ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES}) +execute_process( + COMMAND ${fix_asn1c_call} ${X2AP_C_DIR} X2AP ${X2AP_VERSION} + RESULT_VARIABLE ret) +if (NOT ${ret} STREQUAL 0) + message(FATAL_ERROR "${fix_asn1c_call}: error") +endif (NOT ${ret} STREQUAL 0) file(GLOB X2AP_source ${X2AP_C_DIR}/*.c) set(X2AP_OAI_generated @@ -394,6 +418,7 @@ add_custom_command ( OUTPUT ${X2AP_OAI_generated} COMMAND ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES} COMMAND python ${X2AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${X2AP_ASN_DIR}/X2AP-PDU-Contents.asn -o ${X2AP_C_DIR} + COMMAND ${fix_asn1c_call} ${X2AP_C_DIR} X2AP ${X2AP_VERSION} DEPENDS ${X2AP_ASN_FILES} ) diff --git a/cmake_targets/tools/fix_asn1 b/cmake_targets/tools/fix_asn1 new file mode 100755 index 0000000000..f222374fae --- /dev/null +++ b/cmake_targets/tools/fix_asn1 @@ -0,0 +1,169 @@ +#!/bin/bash + +# in those arrays, each line is: +# + +RRC_Rel10=( + "SystemInformation-r8-IEs.h" 819eda3db27516f7c6780d832fb3c462e2264ea7 "fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h" +) + +X2AP_Rel11_2=( + "X2ap-CriticalityDiagnostics-IE-List.h" f0e2414992bfacfbc4b9fd15c977241d6d7fabeb "fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h" + "NativeInteger.c" e23034083a0fb9d4a2e523e2a64286161e621f27 "fix_asn1.data/X2AP.rel11.2/NativeInteger.c" + "constr_SET_OF.c" 5fb65da648a57ea61f008fa226b707cf343c1c0c "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c" +) + +S1AP_Rel10_5=( + "NativeInteger.c" e23034083a0fb9d4a2e523e2a64286161e621f27 "fix_asn1.data/S1AP.rel10.5/NativeInteger.c" + "constr_SET_OF.c" 5fb65da648a57ea61f008fa226b707cf343c1c0c "fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c" +) + +red_color="\x1b[31m" +green_color="\x1b[32m" +reset_color="\x1b[0m" + +function error() +{ + echo -e "$red_color"ERROR: "$@""$reset_color" + exit 1 +} + +function check_sha1() +{ + local file="$1" + local target_sha1="$2" + + if [ ! -f "$file" ] + then + error "$file: no such file" + fi + + local computed_sha1=$(sha1sum "$file" | cut -f 1 -d ' ') + + if [ "$target_sha1" != "$computed_sha1" ] + then + error "$file: wrong SHA1" + fi +} + +function copy_file() +{ + local file="$1" + local destination="$2" + + echo -e "$green_color""copy file $OPENAIR_DIR/cmake_targets/tools/$file to $destination""$reset_color" + + cp -f "$OPENAIR_DIR/cmake_targets/tools/$file" "$destination" + if [ $? -ne 0 ] + then + error "copy of $file to $destination failed" + fi +} + +function patch() +{ + local directory="$1" + local array=$2 + local len=$3 # the length could be computed locally but the way to do it is not clear to me [CROUX] + + local i + local file + local sha1 + local replace + local item + + for (( i = 0; i < $len; i += 3 )) + do + # special bash syntax to access the array + item=$array[$i]; file=${!item} + item=$array[$((i+1))]; sha1=${!item} + item=$array[$((i+2))]; replace=${!item} + check_sha1 "$directory/$file" "$sha1" + copy_file "$replace" "$directory" + done +} + +function patch_rrc() +{ + local directory="$1" + local version="$2" + + case "$version" in + Rel10 ) + echo "patching RRC files release 10" + patch "$directory" RRC_Rel10 ${#RRC_Rel10[*]} + ;; + * ) + error unknwon/unhandled RRC version \'"$version"\' + ;; + esac +} + +function patch_x2ap() +{ + local directory="$1" + local version="$2" + + case "$version" in + R11 ) + echo "patching X2AP files release 11.2" + patch "$directory" X2AP_Rel11_2 ${#X2AP_Rel11_2[*]} + ;; + * ) + error unknwon/unhandled X2AP version \'"$version"\' + ;; + esac +} + +function patch_s1ap() +{ + local directory="$1" + local version="$2" + + case "$version" in + R10 ) + echo "patching S1AP files release 10.5" + patch "$directory" S1AP_Rel10_5 ${#S1AP_Rel10_5[*]} + ;; + * ) + error unknwon/unhandled S1AP version \'"$version"\' + ;; + esac +} + +function main() +{ + if [ $# -ne 3 ] + then + echo "ERROR: pass " + exit 1 + fi + + if [ x"$OPENAIR_DIR" = x ] + then + error "the variable OPENAIR_DIR is not set" + fi + + local directory="$1" + local module="$2" + local version="$3" + + case "$module" in + RRC ) + patch_rrc "$directory" "$version" + ;; + X2AP ) + patch_x2ap "$directory" "$version" + ;; + S1AP ) + patch_s1ap "$directory" "$version" + ;; + * ) + error unknown module "$module" + ;; + esac + + exit 0 +} + +main "$@" diff --git a/cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h b/cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h new file mode 100644 index 0000000000..baa09c12ef --- /dev/null +++ b/cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h @@ -0,0 +1,109 @@ +/* + * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) + * From ASN.1 module "EUTRA-RRC-Definitions" + * found in "fixed_grammar.asn" + * `asn1c -gen-PER` + */ + +#ifndef _SystemInformation_r8_IEs_H_ +#define _SystemInformation_r8_IEs_H_ + + +#include + +/* Including external dependencies */ +#include +#include "SystemInformationBlockType2.h" +#include "SystemInformationBlockType3.h" +#include "SystemInformationBlockType4.h" +#include "SystemInformationBlockType5.h" +#include "SystemInformationBlockType6.h" +#include "SystemInformationBlockType7.h" +#include "SystemInformationBlockType8.h" +#include "SystemInformationBlockType9.h" +#include "SystemInformationBlockType10.h" +#include "SystemInformationBlockType11.h" +#include "SystemInformationBlockType12-r9.h" +#include "SystemInformationBlockType13-r9.h" +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR { + SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_NOTHING, /* No components present */ + SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2, + SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib3, + SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib4, + SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib5, + SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib6, + SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib7, + SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib8, + SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib9, + SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib10, + SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib11, + /* Extensions may appear below */ + SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib12_v920, + SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib13_v920 +} SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR; + +/* Forward declarations */ +struct SystemInformation_v8a0_IEs; + + union SystemInformation_r8_IEs__sib_TypeAndInfo__Member_u { + SystemInformationBlockType2_t sib2; + SystemInformationBlockType3_t sib3; + SystemInformationBlockType4_t sib4; + SystemInformationBlockType5_t sib5; + SystemInformationBlockType6_t sib6; + SystemInformationBlockType7_t sib7; + SystemInformationBlockType8_t sib8; + SystemInformationBlockType9_t sib9; + SystemInformationBlockType10_t sib10; + SystemInformationBlockType11_t sib11; + /* + * This type is extensible, + * possible extensions are below. + */ + SystemInformationBlockType12_r9_t sib12_v920; + SystemInformationBlockType13_r9_t sib13_v920; + }; + + struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member { + SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR present; + union SystemInformation_r8_IEs__sib_TypeAndInfo__Member_u choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + }; + +/* SystemInformation-r8-IEs */ +typedef struct SystemInformation_r8_IEs { + struct SystemInformation_r8_IEs__sib_TypeAndInfo { + A_SEQUENCE_OF(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } sib_TypeAndInfo; + struct SystemInformation_v8a0_IEs *nonCriticalExtension /* OPTIONAL */; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} SystemInformation_r8_IEs_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_SystemInformation_r8_IEs; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "SystemInformation-v8a0-IEs.h" + +#endif /* _SystemInformation_r8_IEs_H_ */ +#include diff --git a/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c b/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c new file mode 100644 index 0000000000..239dbdc10f --- /dev/null +++ b/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c @@ -0,0 +1,412 @@ +/*- + * Copyright (c) 2004, 2005, 2006 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +/* + * Read the NativeInteger.h for the explanation wrt. differences between + * INTEGER and NativeInteger. + * Basically, both are decoders and encoders of ASN.1 INTEGER type, but this + * implementation deals with the standard (machine-specific) representation + * of them instead of using the platform-independent buffer. + */ +#include +#include + +/* + * NativeInteger basic type description. + */ +static ber_tlv_tag_t asn_DEF_NativeInteger_tags[] = { + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_NativeInteger = { + "INTEGER", /* The ASN.1 type is still INTEGER */ + "INTEGER", + NativeInteger_free, + NativeInteger_print, + asn_generic_no_constraint, + NativeInteger_decode_ber, + NativeInteger_encode_der, + NativeInteger_decode_xer, + NativeInteger_encode_xer, + NativeInteger_decode_uper, /* Unaligned PER decoder */ + NativeInteger_encode_uper, /* Unaligned PER encoder */ + NativeInteger_decode_aper, /* Aligned PER decoder */ + NativeInteger_encode_aper, /* Aligned PER encoder */ + 0, /* Use generic outmost tag fetcher */ + asn_DEF_NativeInteger_tags, + sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]), + asn_DEF_NativeInteger_tags, /* Same as above */ + sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]), + 0, /* No PER visible constraints */ + 0, 0, /* No members */ + 0 /* No specifics */ +}; + +/* + * Decode INTEGER type. + */ +asn_dec_rval_t +NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx, + asn_TYPE_descriptor_t *td, + void **nint_ptr, const void *buf_ptr, size_t size, int tag_mode) { + asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; + long *native = (long *)*nint_ptr; + asn_dec_rval_t rval; + ber_tlv_len_t length; + + /* + * If the structure is not there, allocate it. + */ + if(native == NULL) { + native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native))); + if(native == NULL) { + rval.code = RC_FAIL; + rval.consumed = 0; + return rval; + } + } + + ASN_DEBUG("Decoding %s as INTEGER (tm=%d)", + td->name, tag_mode); + + /* + * Check tags. + */ + rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size, + tag_mode, 0, &length, 0); + if(rval.code != RC_OK) + return rval; + + ASN_DEBUG("%s length is %d bytes", td->name, (int)length); + + /* + * Make sure we have this length. + */ + buf_ptr = ((const char *)buf_ptr) + rval.consumed; + size -= rval.consumed; + if(length > (ber_tlv_len_t)size) { + rval.code = RC_WMORE; + rval.consumed = 0; + return rval; + } + + /* + * ASN.1 encoded INTEGER: buf_ptr, length + * Fill the native, at the same time checking for overflow. + * If overflow occured, return with RC_FAIL. + */ + { + INTEGER_t tmp; + union { + const void *constbuf; + void *nonconstbuf; + } unconst_buf; + long l; + + unconst_buf.constbuf = buf_ptr; + tmp.buf = (uint8_t *)unconst_buf.nonconstbuf; + tmp.size = length; + + if((specs&&specs->field_unsigned) + ? asn_INTEGER2ulong(&tmp, (unsigned long *)&l) /* sic */ + : asn_INTEGER2long(&tmp, &l)) { + rval.code = RC_FAIL; + rval.consumed = 0; + return rval; + } + + *native = l; + } + + rval.code = RC_OK; + rval.consumed += length; + + ASN_DEBUG("Took %ld/%ld bytes to encode %s (%ld)", + (long)rval.consumed, (long)length, td->name, (long)*native); + + return rval; +} + +/* + * Encode the NativeInteger using the standard INTEGER type DER encoder. + */ +asn_enc_rval_t +NativeInteger_encode_der(asn_TYPE_descriptor_t *sd, void *ptr, + int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { + unsigned long native = *(unsigned long *)ptr; /* Disable sign ext. */ + asn_enc_rval_t erval; + INTEGER_t tmp; + +#ifdef WORDS_BIGENDIAN /* Opportunistic optimization */ + + tmp.buf = (uint8_t *)&native; + tmp.size = sizeof(native); + +#else /* Works even if WORDS_BIGENDIAN is not set where should've been */ + uint8_t buf[sizeof(native)]; + uint8_t *p; + + /* Prepare a fake INTEGER */ + for(p = buf + sizeof(buf) - 1; p >= buf; p--, native >>= 8) + *p = (uint8_t)native; + + tmp.buf = buf; + tmp.size = sizeof(buf); +#endif /* WORDS_BIGENDIAN */ + + /* Encode fake INTEGER */ + erval = INTEGER_encode_der(sd, &tmp, tag_mode, tag, cb, app_key); + if(erval.encoded == -1) { + assert(erval.structure_ptr == &tmp); + erval.structure_ptr = ptr; + } + return erval; +} + +/* + * Decode the chunk of XML text encoding INTEGER. + */ +asn_dec_rval_t +NativeInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx, + asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, + const void *buf_ptr, size_t size) { + asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; + asn_dec_rval_t rval; + INTEGER_t st; + void *st_ptr = (void *)&st; + long *native = (long *)*sptr; + + if(!native) { + native = (long *)(*sptr = CALLOC(1, sizeof(*native))); + if(!native) _ASN_DECODE_FAILED; + } + + memset(&st, 0, sizeof(st)); + rval = INTEGER_decode_xer(opt_codec_ctx, td, &st_ptr, + opt_mname, buf_ptr, size); + if(rval.code == RC_OK) { + long l; + if((specs&&specs->field_unsigned) + ? asn_INTEGER2ulong(&st, (unsigned long *)&l) /* sic */ + : asn_INTEGER2long(&st, &l)) { + rval.code = RC_FAIL; + rval.consumed = 0; + } else { + *native = l; + } + } else { + /* + * Cannot restart from the middle; + * there is no place to save state in the native type. + * Request a continuation from the very beginning. + */ + rval.consumed = 0; + } + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &st); + return rval; +} + + +asn_enc_rval_t +NativeInteger_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; + char scratch[32]; /* Enough for 64-bit int */ + asn_enc_rval_t er; + const long *native = (const long *)sptr; + + (void)ilevel; + (void)flags; + + if(!native) _ASN_ENCODE_FAILED; + + er.encoded = snprintf(scratch, sizeof(scratch), + (specs && specs->field_unsigned) + ? "%lu" : "%ld", *native); + if(er.encoded <= 0 || (size_t)er.encoded >= sizeof(scratch) + || cb(scratch, er.encoded, app_key) < 0) + _ASN_ENCODE_FAILED; + + _ASN_ENCODED_OK(er); +} + +asn_dec_rval_t +NativeInteger_decode_uper(asn_codec_ctx_t *opt_codec_ctx, + asn_TYPE_descriptor_t *td, + asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + + asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; + asn_dec_rval_t rval; + long *native = (long *)*sptr; + INTEGER_t tmpint; + void *tmpintptr = &tmpint; + + (void)opt_codec_ctx; + ASN_DEBUG("Decoding NativeInteger %s (UPER)", td->name); + + if(!native) { + native = (long *)(*sptr = CALLOC(1, sizeof(*native))); + if(!native) _ASN_DECODE_FAILED; + } + + memset(&tmpint, 0, sizeof tmpint); + rval = INTEGER_decode_uper(opt_codec_ctx, td, constraints, + &tmpintptr, pd); + if(rval.code == RC_OK) { + if((specs&&specs->field_unsigned) + ? asn_INTEGER2ulong(&tmpint, (unsigned long *)native) + : asn_INTEGER2long(&tmpint, native)) + rval.code = RC_FAIL; + else + ASN_DEBUG("NativeInteger %s got value %ld", + td->name, *native); + } + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); + + return rval; +} + +asn_dec_rval_t +NativeInteger_decode_aper(asn_codec_ctx_t *opt_codec_ctx, + asn_TYPE_descriptor_t *td, + asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + + asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; + asn_dec_rval_t rval; + long *native = (long *)*sptr; + INTEGER_t tmpint; + void *tmpintptr = &tmpint; + //int dynamic = 0; + + (void)opt_codec_ctx; + ASN_DEBUG("Decoding NativeInteger %s (APER)", td->name); + + if(!native) { + native = (long *)(*sptr = CALLOC(1, sizeof(*native))); + //dynamic = 1; + if(!native) _ASN_DECODE_FAILED; + } + + memset(&tmpint, 0, sizeof tmpint); + rval = INTEGER_decode_aper(opt_codec_ctx, td, constraints, + &tmpintptr, pd); + if(rval.code == RC_OK) { + if((specs&&specs->field_unsigned) + ? asn_INTEGER2ulong(&tmpint, (unsigned long *)native) + : asn_INTEGER2long(&tmpint, native)) + rval.code = RC_FAIL; + else + ASN_DEBUG("NativeInteger %s got value %ld", + td->name, *native); + } + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); + //if (dynamic) + // free(native); + + return rval; +} + +asn_enc_rval_t +NativeInteger_encode_uper(asn_TYPE_descriptor_t *td, + asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { + asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; + asn_enc_rval_t er; + long native; + INTEGER_t tmpint; + + if(!sptr) _ASN_ENCODE_FAILED; + + native = *(long *)sptr; + + ASN_DEBUG("Encoding NativeInteger %s %ld (UPER)", td->name, native); + + memset(&tmpint, 0, sizeof(tmpint)); + if((specs&&specs->field_unsigned) + ? asn_ulong2INTEGER(&tmpint, native) + : asn_long2INTEGER(&tmpint, native)) + _ASN_ENCODE_FAILED; + er = INTEGER_encode_uper(td, constraints, &tmpint, po); + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); + return er; +} + +asn_enc_rval_t +NativeInteger_encode_aper( + asn_TYPE_descriptor_t *td, + asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { + + asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; + asn_enc_rval_t er; + INTEGER_t tmpint; + + if(!sptr) _ASN_ENCODE_FAILED; + memset(&tmpint, 0, sizeof(tmpint)); + + if(specs&&specs->field_unsigned) { + unsigned long native; + native = *(unsigned long *)sptr; + + ASN_DEBUG("Encoding NativeInteger %s %lu (APER) (unsigned)", td->name, native); + + if(asn_ulong2INTEGER(&tmpint, native)) + _ASN_ENCODE_FAILED; + } else { + long native; + native = *(long *)sptr; + + ASN_DEBUG("Encoding NativeInteger %s %ld (APER) (unsigned)", td->name, native); + if(asn_long2INTEGER(&tmpint, native)) + _ASN_ENCODE_FAILED; + } + +// if((specs&&specs->field_unsigned) +// ? asn_ulong2INTEGER(&tmpint, native) +// : asn_long2INTEGER(&tmpint, native)) +// _ASN_ENCODE_FAILED; + er = INTEGER_encode_aper(td, constraints, &tmpint, po); + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); + return er; +} + +/* + * INTEGER specific human-readable output. + */ +int +NativeInteger_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, + asn_app_consume_bytes_f *cb, void *app_key) { + asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; + const long *native = (const long *)sptr; + char scratch[32]; /* Enough for 64-bit int */ + int ret; + + (void)td; /* Unused argument */ + (void)ilevel; /* Unused argument */ + + if(native) { + ret = snprintf(scratch, sizeof(scratch), + (specs && specs->field_unsigned) + ? "%lu" : "%ld", *native); + assert(ret > 0 && (size_t)ret < sizeof(scratch)); + return (cb(scratch, ret, app_key) < 0) ? -1 : 0; + } else { + return (cb("", 8, app_key) < 0) ? -1 : 0; + } +} + +void +NativeInteger_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { + + if(!td || !ptr) + return; + + ASN_DEBUG("Freeing %s as INTEGER (%d, %p, Native)", + td->name, contents_only, ptr); + + if(!contents_only) { + FREEMEM(ptr); + } +} + diff --git a/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c b/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c new file mode 100644 index 0000000000..3e2d23b254 --- /dev/null +++ b/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c @@ -0,0 +1,1041 @@ +/*- + * Copyright (c) 2003, 2004, 2005 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include + +/* + * Number of bytes left for this structure. + * (ctx->left) indicates the number of bytes _transferred_ for the structure. + * (size) contains the number of bytes in the buffer passed. + */ +#define LEFT ((size<(size_t)ctx->left)?size:(size_t)ctx->left) + +/* + * If the subprocessor function returns with an indication that it wants + * more data, it may well be a fatal decoding problem, because the + * size is constrained by the 's L, even if the buffer size allows + * reading more data. + * For example, consider the buffer containing the following TLVs: + * ... + * The TLV length clearly indicates that one byte is expected in V, but + * if the V processor returns with "want more data" even if the buffer + * contains way more data than the V processor have seen. + */ +#define SIZE_VIOLATION (ctx->left >= 0 && (size_t)ctx->left <= size) + +/* + * This macro "eats" the part of the buffer which is definitely "consumed", + * i.e. was correctly converted into local representation or rightfully skipped. + */ +#undef ADVANCE +#define ADVANCE(num_bytes) do { \ + size_t num = num_bytes; \ + ptr = ((const char *)ptr) + num;\ + size -= num; \ + if(ctx->left >= 0) \ + ctx->left -= num; \ + consumed_myself += num; \ + } while(0) + +/* + * Switch to the next phase of parsing. + */ +#undef NEXT_PHASE +#undef PHASE_OUT +#define NEXT_PHASE(ctx) do { \ + ctx->phase++; \ + ctx->step = 0; \ + } while(0) +#define PHASE_OUT(ctx) do { ctx->phase = 10; } while(0) + +/* + * Return a standardized complex structure. + */ +#undef RETURN +#define RETURN(_code) do { \ + rval.code = _code; \ + rval.consumed = consumed_myself;\ + return rval; \ + } while(0) + +/* + * The decoder of the SET OF type. + */ +asn_dec_rval_t +SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + void **struct_ptr, const void *ptr, size_t size, int tag_mode) { + /* + * Bring closer parts of structure description. + */ + asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; + asn_TYPE_member_t *elm = td->elements; /* Single one */ + + /* + * Parts of the structure being constructed. + */ + void *st = *struct_ptr; /* Target structure. */ + asn_struct_ctx_t *ctx; /* Decoder context */ + + ber_tlv_tag_t tlv_tag; /* T from TLV */ + asn_dec_rval_t rval; /* Return code from subparsers */ + + ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ + + ASN_DEBUG("Decoding %s as SET OF", td->name); + + /* + * Create the target structure if it is not present already. + */ + if(st == 0) { + st = *struct_ptr = CALLOC(1, specs->struct_size); + if(st == 0) { + RETURN(RC_FAIL); + } + } + + /* + * Restore parsing context. + */ + ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); + + /* + * Start to parse where left previously + */ + switch(ctx->phase) { + case 0: + /* + * PHASE 0. + * Check that the set of tags associated with given structure + * perfectly fits our expectations. + */ + + rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size, + tag_mode, 1, &ctx->left, 0); + if(rval.code != RC_OK) { + ASN_DEBUG("%s tagging check failed: %d", + td->name, rval.code); + return rval; + } + + if(ctx->left >= 0) + ctx->left += rval.consumed; /* ?Substracted below! */ + ADVANCE(rval.consumed); + + ASN_DEBUG("Structure consumes %ld bytes, " + "buffer %ld", (long)ctx->left, (long)size); + + NEXT_PHASE(ctx); + /* Fall through */ + case 1: + /* + * PHASE 1. + * From the place where we've left it previously, + * try to decode the next item. + */ + for(;; ctx->step = 0) { + ssize_t tag_len; /* Length of TLV's T */ + + if(ctx->step & 1) + goto microphase2; + + /* + * MICROPHASE 1: Synchronize decoding. + */ + + if(ctx->left == 0) { + ASN_DEBUG("End of SET OF %s", td->name); + /* + * No more things to decode. + * Exit out of here. + */ + PHASE_OUT(ctx); + RETURN(RC_OK); + } + + /* + * Fetch the T from TLV. + */ + tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag); + switch(tag_len) { + case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); + /* Fall through */ + case -1: RETURN(RC_FAIL); + } + + if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) { + if(LEFT < 2) { + if(SIZE_VIOLATION) + RETURN(RC_FAIL); + else + RETURN(RC_WMORE); + } else if(((const uint8_t *)ptr)[1] == 0) { + /* + * Found the terminator of the + * indefinite length structure. + */ + break; + } + } + + /* Outmost tag may be unknown and cannot be fetched/compared */ + if(elm->tag != (ber_tlv_tag_t)-1) { + if(BER_TAGS_EQUAL(tlv_tag, elm->tag)) { + /* + * The new list member of expected type has arrived. + */ + } else { + ASN_DEBUG("Unexpected tag %s fixed SET OF %s", + ber_tlv_tag_string(tlv_tag), td->name); + ASN_DEBUG("%s SET OF has tag %s", + td->name, ber_tlv_tag_string(elm->tag)); + RETURN(RC_FAIL); + } + } + + /* + * MICROPHASE 2: Invoke the member-specific decoder. + */ + ctx->step |= 1; /* Confirm entering next microphase */ + microphase2: + + /* + * Invoke the member fetch routine according to member's type + */ + rval = elm->type->ber_decoder(opt_codec_ctx, + elm->type, &ctx->ptr, ptr, LEFT, 0); + ASN_DEBUG("In %s SET OF %s code %d consumed %d", + td->name, elm->type->name, + rval.code, (int)rval.consumed); + switch(rval.code) { + case RC_OK: + { + asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); + if(ASN_SET_ADD(list, ctx->ptr) != 0) + RETURN(RC_FAIL); + else + ctx->ptr = 0; + } + break; + case RC_WMORE: /* More data expected */ + if(!SIZE_VIOLATION) { + ADVANCE(rval.consumed); + RETURN(RC_WMORE); + } + /* Fall through */ + case RC_FAIL: /* Fatal error */ + ASN_STRUCT_FREE(*elm->type, ctx->ptr); + ctx->ptr = 0; + RETURN(RC_FAIL); + } /* switch(rval) */ + + ADVANCE(rval.consumed); + } /* for(all list members) */ + + NEXT_PHASE(ctx); + case 2: + /* + * Read in all "end of content" TLVs. + */ + while(ctx->left < 0) { + if(LEFT < 2) { + if(LEFT > 0 && ((const char *)ptr)[0] != 0) { + /* Unexpected tag */ + RETURN(RC_FAIL); + } else { + RETURN(RC_WMORE); + } + } + if(((const char *)ptr)[0] == 0 + && ((const char *)ptr)[1] == 0) { + ADVANCE(2); + ctx->left++; + } else { + RETURN(RC_FAIL); + } + } + + PHASE_OUT(ctx); + } + + RETURN(RC_OK); +} + +/* + * Internally visible buffer holding a single encoded element. + */ +struct _el_buffer { + uint8_t *buf; + size_t length; + size_t size; +}; +/* Append bytes to the above structure */ +static int _el_addbytes(const void *buffer, size_t size, void *el_buf_ptr) { + struct _el_buffer *el_buf = (struct _el_buffer *)el_buf_ptr; + + if(el_buf->length + size > el_buf->size) + return -1; + + memcpy(el_buf->buf + el_buf->length, buffer, size); + + el_buf->length += size; + return 0; +} +static int _el_buf_cmp(const void *ap, const void *bp) { + const struct _el_buffer *a = (const struct _el_buffer *)ap; + const struct _el_buffer *b = (const struct _el_buffer *)bp; + int ret; + size_t common_len; + + if(a->length < b->length) + common_len = a->length; + else + common_len = b->length; + + ret = memcmp(a->buf, b->buf, common_len); + if(ret == 0) { + if(a->length < b->length) + ret = -1; + else if(a->length > b->length) + ret = 1; + } + + return ret; +} + +/* + * The DER encoder of the SET OF type. + */ +asn_enc_rval_t +SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, + int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { + asn_TYPE_member_t *elm = td->elements; + asn_TYPE_descriptor_t *elm_type = elm->type; + der_type_encoder_f *der_encoder = elm_type->der_encoder; + asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr); + size_t computed_size = 0; + ssize_t encoding_size = 0; + struct _el_buffer *encoded_els; + ssize_t eels_count = 0; + size_t max_encoded_len = 1; + asn_enc_rval_t erval; + int ret; + int edx; + + ASN_DEBUG("Estimating size for SET OF %s", td->name); + + /* + * Gather the length of the underlying members sequence. + */ + for(edx = 0; edx < list->count; edx++) { + void *memb_ptr = list->array[edx]; + if(!memb_ptr) continue; + erval = der_encoder(elm_type, memb_ptr, 0, elm->tag, 0, 0); + if(erval.encoded == -1) + return erval; + computed_size += erval.encoded; + + /* Compute maximum encoding's size */ + if(max_encoded_len < (size_t)erval.encoded) + max_encoded_len = erval.encoded; + } + + /* + * Encode the TLV for the sequence itself. + */ + encoding_size = der_write_tags(td, computed_size, tag_mode, 1, tag, + cb, app_key); + if(encoding_size == -1) { + erval.encoded = -1; + erval.failed_type = td; + erval.structure_ptr = ptr; + return erval; + } + computed_size += encoding_size; + + if(!cb || list->count == 0) { + erval.encoded = computed_size; + _ASN_ENCODED_OK(erval); + } + + /* + * DER mandates dynamic sorting of the SET OF elements + * according to their encodings. Build an array of the + * encoded elements. + */ + encoded_els = (struct _el_buffer *)MALLOC( + list->count * sizeof(encoded_els[0])); + if(encoded_els == NULL) { + erval.encoded = -1; + erval.failed_type = td; + erval.structure_ptr = ptr; + return erval; + } + + ASN_DEBUG("Encoding members of %s SET OF", td->name); + + /* + * Encode all members. + */ + for(edx = 0; edx < list->count; edx++) { + void *memb_ptr = list->array[edx]; + struct _el_buffer *encoded_el = &encoded_els[eels_count]; + + if(!memb_ptr) continue; + + /* + * Prepare space for encoding. + */ + encoded_el->buf = (uint8_t *)MALLOC(max_encoded_len); + if(encoded_el->buf) { + encoded_el->length = 0; + encoded_el->size = max_encoded_len; + } else { + for(edx--; edx >= 0; edx--) + FREEMEM(encoded_els[edx].buf); + FREEMEM(encoded_els); + erval.encoded = -1; + erval.failed_type = td; + erval.structure_ptr = ptr; + return erval; + } + + /* + * Encode the member into the prepared space. + */ + erval = der_encoder(elm_type, memb_ptr, 0, elm->tag, + _el_addbytes, encoded_el); + if(erval.encoded == -1) { + for(; edx >= 0; edx--) + FREEMEM(encoded_els[edx].buf); + FREEMEM(encoded_els); + return erval; + } + encoding_size += erval.encoded; + eels_count++; + } + + /* + * Sort the encoded elements according to their encoding. + */ + qsort(encoded_els, eels_count, sizeof(encoded_els[0]), _el_buf_cmp); + + /* + * Report encoded elements to the application. + * Dispose of temporary sorted members table. + */ + ret = 0; + for(edx = 0; edx < eels_count; edx++) { + struct _el_buffer *encoded_el = &encoded_els[edx]; + /* Report encoded chunks to the application */ + if(ret == 0 + && cb(encoded_el->buf, encoded_el->length, app_key) < 0) + ret = -1; + FREEMEM(encoded_el->buf); + } + FREEMEM(encoded_els); + + if(ret || computed_size != (size_t)encoding_size) { + /* + * Standard callback failed, or + * encoded size is not equal to the computed size. + */ + erval.encoded = -1; + erval.failed_type = td; + erval.structure_ptr = ptr; + } else { + erval.encoded = computed_size; + } + + _ASN_ENCODED_OK(erval); +} + +#undef XER_ADVANCE +#define XER_ADVANCE(num_bytes) do { \ + size_t num = num_bytes; \ + buf_ptr = ((const char *)buf_ptr) + num;\ + size -= num; \ + consumed_myself += num; \ + } while(0) + +/* + * Decode the XER (XML) data. + */ +asn_dec_rval_t +SET_OF_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + void **struct_ptr, const char *opt_mname, + const void *buf_ptr, size_t size) { + /* + * Bring closer parts of structure description. + */ + asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; + asn_TYPE_member_t *element = td->elements; + const char *elm_tag; + const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; + + /* + * ... and parts of the structure being constructed. + */ + void *st = *struct_ptr; /* Target structure. */ + asn_struct_ctx_t *ctx; /* Decoder context */ + + asn_dec_rval_t rval; /* Return value from a decoder */ + ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ + + /* + * Create the target structure if it is not present already. + */ + if(st == 0) { + st = *struct_ptr = CALLOC(1, specs->struct_size); + if(st == 0) RETURN(RC_FAIL); + } + + /* Which tag is expected for the downstream */ + if(specs->as_XMLValueList) { + elm_tag = (specs->as_XMLValueList == 1) ? 0 : ""; + } else { + elm_tag = (*element->name) + ? element->name : element->type->xml_tag; + } + + /* + * Restore parsing context. + */ + ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); + + /* + * Phases of XER/XML processing: + * Phase 0: Check that the opening tag matches our expectations. + * Phase 1: Processing body and reacting on closing tag. + * Phase 2: Processing inner type. + */ + for(; ctx->phase <= 2;) { + pxer_chunk_type_e ch_type; /* XER chunk type */ + ssize_t ch_size; /* Chunk size */ + xer_check_tag_e tcv; /* Tag check value */ + + /* + * Go inside the inner member of a set. + */ + if(ctx->phase == 2) { + asn_dec_rval_t tmprval; + + /* Invoke the inner type decoder, m.b. multiple times */ + ASN_DEBUG("XER/SET OF element [%s]", elm_tag); + tmprval = element->type->xer_decoder(opt_codec_ctx, + element->type, &ctx->ptr, elm_tag, + buf_ptr, size); + if(tmprval.code == RC_OK) { + asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); + if(ASN_SET_ADD(list, ctx->ptr) != 0) + RETURN(RC_FAIL); + ctx->ptr = 0; + XER_ADVANCE(tmprval.consumed); + } else { + XER_ADVANCE(tmprval.consumed); + RETURN(tmprval.code); + } + ctx->phase = 1; /* Back to body processing */ + ASN_DEBUG("XER/SET OF phase => %d", ctx->phase); + /* Fall through */ + } + + /* + * Get the next part of the XML stream. + */ + ch_size = xer_next_token(&ctx->context, + buf_ptr, size, &ch_type); + switch(ch_size) { + case -1: RETURN(RC_FAIL); + case 0: RETURN(RC_WMORE); + default: + switch(ch_type) { + case PXER_COMMENT: /* Got XML comment */ + case PXER_TEXT: /* Ignore free-standing text */ + XER_ADVANCE(ch_size); /* Skip silently */ + continue; + case PXER_TAG: + break; /* Check the rest down there */ + } + } + + tcv = xer_check_tag(buf_ptr, ch_size, xml_tag); + ASN_DEBUG("XER/SET OF: tcv = %d, ph=%d t=%s", + tcv, ctx->phase, xml_tag); + switch(tcv) { + case XCT_CLOSING: + if(ctx->phase == 0) break; + ctx->phase = 0; + /* Fall through */ + case XCT_BOTH: + if(ctx->phase == 0) { + /* No more things to decode */ + XER_ADVANCE(ch_size); + ctx->phase = 3; /* Phase out */ + RETURN(RC_OK); + } + /* Fall through */ + case XCT_OPENING: + if(ctx->phase == 0) { + XER_ADVANCE(ch_size); + ctx->phase = 1; /* Processing body phase */ + continue; + } + /* Fall through */ + case XCT_UNKNOWN_OP: + case XCT_UNKNOWN_BO: + + ASN_DEBUG("XER/SET OF: tcv=%d, ph=%d", tcv, ctx->phase); + if(ctx->phase == 1) { + /* + * Process a single possible member. + */ + ctx->phase = 2; + continue; + } + /* Fall through */ + default: + break; + } + + ASN_DEBUG("Unexpected XML tag in SET OF"); + break; + } + + ctx->phase = 3; /* "Phase out" on hard failure */ + RETURN(RC_FAIL); +} + + + +typedef struct xer_tmp_enc_s { + void *buffer; + size_t offset; + size_t size; +} xer_tmp_enc_t; +static int +SET_OF_encode_xer_callback(const void *buffer, size_t size, void *key) { + xer_tmp_enc_t *t = (xer_tmp_enc_t *)key; + if(t->offset + size >= t->size) { + size_t newsize = (t->size << 2) + size; + void *p = REALLOC(t->buffer, newsize); + if(!p) return -1; + t->buffer = p; + t->size = newsize; + } + memcpy((char *)t->buffer + t->offset, buffer, size); + t->offset += size; + return 0; +} +static int +SET_OF_xer_order(const void *aptr, const void *bptr) { + const xer_tmp_enc_t *a = (const xer_tmp_enc_t *)aptr; + const xer_tmp_enc_t *b = (const xer_tmp_enc_t *)bptr; + size_t minlen = a->offset; + int ret; + if(b->offset < minlen) minlen = b->offset; + /* Well-formed UTF-8 has this nice lexicographical property... */ + ret = memcmp(a->buffer, b->buffer, minlen); + if(ret != 0) return ret; + if(a->offset == b->offset) + return 0; + if(a->offset == minlen) + return -1; + return 1; +} + + +asn_enc_rval_t +SET_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + asn_enc_rval_t er; + asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; + asn_TYPE_member_t *elm = td->elements; + asn_anonymous_set_ *list = _A_SET_FROM_VOID(sptr); + const char *mname = specs->as_XMLValueList + ? 0 : ((*elm->name) ? elm->name : elm->type->xml_tag); + size_t mlen = mname ? strlen(mname) : 0; + int xcan = (flags & XER_F_CANONICAL); + xer_tmp_enc_t *encs = 0; + size_t encs_count = 0; + void *original_app_key = app_key; + asn_app_consume_bytes_f *original_cb = cb; + int i; + + if(!sptr) _ASN_ENCODE_FAILED; + + if(xcan) { + encs = (xer_tmp_enc_t *)MALLOC(list->count * sizeof(encs[0])); + if(!encs) _ASN_ENCODE_FAILED; + cb = SET_OF_encode_xer_callback; + } + + er.encoded = 0; + + for(i = 0; i < list->count; i++) { + asn_enc_rval_t tmper; + + void *memb_ptr = list->array[i]; + if(!memb_ptr) continue; + + if(encs) { + memset(&encs[encs_count], 0, sizeof(encs[0])); + app_key = &encs[encs_count]; + encs_count++; + } + + if(mname) { + if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel); + _ASN_CALLBACK3("<", 1, mname, mlen, ">", 1); + } + + if(!xcan && specs->as_XMLValueList == 1) + _i_ASN_TEXT_INDENT(1, ilevel + 1); + tmper = elm->type->xer_encoder(elm->type, memb_ptr, + ilevel + (specs->as_XMLValueList != 2), + flags, cb, app_key); + if(tmper.encoded == -1) { + td = tmper.failed_type; + sptr = tmper.structure_ptr; + goto cb_failed; + } + if(tmper.encoded == 0 && specs->as_XMLValueList) { + const char *name = elm->type->xml_tag; + size_t len = strlen(name); + _ASN_CALLBACK3("<", 1, name, len, "/>", 2); + } + + if(mname) { + _ASN_CALLBACK3("", 1); + er.encoded += 5; + } + + er.encoded += (2 * mlen) + tmper.encoded; + } + + if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel - 1); + + if(encs) { + xer_tmp_enc_t *enc = encs; + xer_tmp_enc_t *end = encs + encs_count; + ssize_t control_size = 0; + + cb = original_cb; + app_key = original_app_key; + qsort(encs, encs_count, sizeof(encs[0]), SET_OF_xer_order); + + for(; enc < end; enc++) { + _ASN_CALLBACK(enc->buffer, enc->offset); + FREEMEM(enc->buffer); + enc->buffer = 0; + control_size += enc->offset; + } + assert(control_size == er.encoded); + } + + goto cleanup; +cb_failed: + er.encoded = -1; + er.failed_type = td; + er.structure_ptr = sptr; +cleanup: + if(encs) { + while(encs_count-- > 0) { + if(encs[encs_count].buffer) + FREEMEM(encs[encs_count].buffer); + } + FREEMEM(encs); + } + _ASN_ENCODED_OK(er); +} + +int +SET_OF_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, + asn_app_consume_bytes_f *cb, void *app_key) { + asn_TYPE_member_t *elm = td->elements; + const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); + int ret; + int i; + + if(!sptr) return (cb("", 8, app_key) < 0) ? -1 : 0; + + /* Dump preamble */ + if(cb(td->name, strlen(td->name), app_key) < 0 + || cb(" ::= {", 6, app_key) < 0) + return -1; + + for(i = 0; i < list->count; i++) { + const void *memb_ptr = list->array[i]; + if(!memb_ptr) continue; + + _i_INDENT(1); + + ret = elm->type->print_struct(elm->type, memb_ptr, + ilevel + 1, cb, app_key); + if(ret) return ret; + } + + ilevel--; + _i_INDENT(1); + + return (cb("}", 1, app_key) < 0) ? -1 : 0; +} + +void +SET_OF_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { + if(td && ptr) { + asn_SET_OF_specifics_t *specs; + asn_TYPE_member_t *elm = td->elements; + asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr); + asn_struct_ctx_t *ctx; /* Decoder context */ + int i; + + /* + * Could not use set_of_empty() because of (*free) + * incompatibility. + */ + for(i = 0; i < list->count; i++) { + void *memb_ptr = list->array[i]; + if(memb_ptr) + ASN_STRUCT_FREE(*elm->type, memb_ptr); + } + list->count = 0; /* No meaningful elements left */ + + asn_set_empty(list); /* Remove (list->array) */ + + specs = (asn_SET_OF_specifics_t *)td->specifics; + ctx = (asn_struct_ctx_t *)((char *)ptr + specs->ctx_offset); + if(ctx->ptr) { + ASN_STRUCT_FREE(*elm->type, ctx->ptr); + ctx->ptr = 0; + } + + if(!contents_only) { + FREEMEM(ptr); + } + } +} + +int +SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_TYPE_member_t *elm = td->elements; + asn_constr_check_f *constr; + const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); + int i; + + if(!sptr) { + _ASN_CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + constr = elm->memb_constraints; + if(!constr) constr = elm->type->check_constraints; + + /* + * Iterate over the members of an array. + * Validate each in turn, until one fails. + */ + for(i = 0; i < list->count; i++) { + const void *memb_ptr = list->array[i]; + int ret; + + if(!memb_ptr) continue; + + ret = constr(elm->type, memb_ptr, ctfailcb, app_key); + if(ret) return ret; + } + + /* + * Cannot inherit it eralier: + * need to make sure we get the updated version. + */ + if(!elm->memb_constraints) + elm->memb_constraints = elm->type->check_constraints; + + return 0; +} + +asn_dec_rval_t +SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + asn_dec_rval_t rv; + asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; + asn_TYPE_member_t *elm = td->elements; /* Single one */ + void *st = *sptr; + asn_anonymous_set_ *list; + asn_per_constraint_t *ct; + int repeat = 0; + ssize_t nelems; + + if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx)) + _ASN_DECODE_FAILED; + + /* + * Create the target structure if it is not present already. + */ + if(!st) { + st = *sptr = CALLOC(1, specs->struct_size); + if(!st) _ASN_DECODE_FAILED; + } + list = _A_SET_FROM_VOID(st); + + /* Figure out which constraints to use */ + if(constraints) ct = &constraints->size; + else if(td->per_constraints) ct = &td->per_constraints->size; + else ct = 0; + + if(ct && ct->flags & APC_EXTENSIBLE) { + int value = per_get_few_bits(pd, 1); + if(value < 0) _ASN_DECODE_STARVED; + if(value) ct = 0; /* Not restricted! */ + } + + if(ct && ct->effective_bits >= 0) { + /* X.691, #19.5: No length determinant */ + nelems = per_get_few_bits(pd, ct->effective_bits); + ASN_DEBUG("Preparing to fetch %ld+%"PRIdMAX" elements from %s", + (long)nelems, ct->lower_bound, td->name); + if(nelems < 0) _ASN_DECODE_STARVED; + nelems += ct->lower_bound; + } else { + nelems = -1; + } + + do { + int i; + if(nelems < 0) { + nelems = uper_get_length(pd, + ct ? ct->effective_bits : -1, &repeat); + ASN_DEBUG("Got to decode %d elements (eff %d)", + (int)nelems, (int)(ct ? ct->effective_bits : -1)); + if(nelems < 0) _ASN_DECODE_STARVED; + } + + for(i = 0; i < nelems; i++) { + void *ptr = 0; + ASN_DEBUG("SET OF %s decoding", elm->type->name); + rv = elm->type->uper_decoder(opt_codec_ctx, elm->type, + elm->per_constraints, &ptr, pd); + ASN_DEBUG("%s SET OF %s decoded %d, %p", + td->name, elm->type->name, rv.code, ptr); + if(rv.code == RC_OK) { + if(ASN_SET_ADD(list, ptr) == 0) + continue; + ASN_DEBUG("Failed to add element into %s", + td->name); + /* Fall through */ + rv.code = RC_FAIL; + } else { + ASN_DEBUG("Failed decoding %s of %s (SET OF)", + elm->type->name, td->name); + } + if(ptr) ASN_STRUCT_FREE(*elm->type, ptr); + return rv; + } + + nelems = -1; /* Allow uper_get_length() */ + } while(repeat); + + ASN_DEBUG("Decoded %s as SET OF", td->name); + + rv.code = RC_OK; + rv.consumed = 0; + return rv; +} + +asn_dec_rval_t +SET_OF_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + asn_dec_rval_t rv; + asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; + asn_TYPE_member_t *elm = td->elements; /* Single one */ + void *st = *sptr; + asn_anonymous_set_ *list; + asn_per_constraint_t *ct; + int repeat = 0; + ssize_t nelems; + + if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx)) + _ASN_DECODE_FAILED; + + /* + * Create the target structure if it is not present already. + */ + if(!st) { + st = *sptr = CALLOC(1, specs->struct_size); + if(!st) _ASN_DECODE_FAILED; + } + list = _A_SET_FROM_VOID(st); + + /* Figure out which constraints to use */ + if(constraints) ct = &constraints->size; + else if(td->per_constraints) ct = &td->per_constraints->size; + else ct = 0; + + if(ct && ct->flags & APC_EXTENSIBLE) { + int value = per_get_few_bits(pd, 1); + if(value < 0) _ASN_DECODE_STARVED; + if(value) ct = 0; /* Not restricted! */ + } + + if(ct && ct->effective_bits >= 0) { + /* X.691, #19.5: No length determinant */ +// nelems = per_get_few_bits(pd, ct->effective_bits); + nelems = aper_get_nsnnwn(pd, ct->upper_bound - ct->lower_bound); + ASN_DEBUG("Preparing to fetch %ld+%"PRIdMAX" elements from %s", + (long)nelems, ct->lower_bound, td->name); + if(nelems < 0) _ASN_DECODE_STARVED; + nelems += ct->lower_bound; + } else { + nelems = -1; + } + + do { + int i; + if(nelems < 0) { + nelems = aper_get_length(pd, ct ? ct->upper_bound - ct->lower_bound + 1 : -1, + ct ? ct->effective_bits : -1, &repeat); + ASN_DEBUG("Got to decode %d elements (eff %d)", + (int)nelems, ct ? ct->effective_bits : -1); + if(nelems < 0) _ASN_DECODE_STARVED; + } + + for(i = 0; i < nelems; i++) { + void *ptr = 0; + ASN_DEBUG("SET OF %s decoding", elm->type->name); + rv = elm->type->aper_decoder(opt_codec_ctx, elm->type, + elm->per_constraints, &ptr, pd); + ASN_DEBUG("%s SET OF %s decoded %d, %p", + td->name, elm->type->name, rv.code, ptr); + if(rv.code == RC_OK) { + if(ASN_SET_ADD(list, ptr) == 0) + continue; + ASN_DEBUG("Failed to add element into %s", + td->name); + /* Fall through */ + rv.code = RC_FAIL; + } else { + ASN_DEBUG("Failed decoding %s of %s (SET OF)", + elm->type->name, td->name); + } + if(ptr) ASN_STRUCT_FREE(*elm->type, ptr); + return rv; + } + + nelems = -1; /* Allow uper_get_length() */ + } while(repeat); + + ASN_DEBUG("Decoded %s as SET OF", td->name); + + rv.code = RC_OK; + rv.consumed = 0; + return rv; +} diff --git a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c new file mode 100644 index 0000000000..239dbdc10f --- /dev/null +++ b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c @@ -0,0 +1,412 @@ +/*- + * Copyright (c) 2004, 2005, 2006 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +/* + * Read the NativeInteger.h for the explanation wrt. differences between + * INTEGER and NativeInteger. + * Basically, both are decoders and encoders of ASN.1 INTEGER type, but this + * implementation deals with the standard (machine-specific) representation + * of them instead of using the platform-independent buffer. + */ +#include +#include + +/* + * NativeInteger basic type description. + */ +static ber_tlv_tag_t asn_DEF_NativeInteger_tags[] = { + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_NativeInteger = { + "INTEGER", /* The ASN.1 type is still INTEGER */ + "INTEGER", + NativeInteger_free, + NativeInteger_print, + asn_generic_no_constraint, + NativeInteger_decode_ber, + NativeInteger_encode_der, + NativeInteger_decode_xer, + NativeInteger_encode_xer, + NativeInteger_decode_uper, /* Unaligned PER decoder */ + NativeInteger_encode_uper, /* Unaligned PER encoder */ + NativeInteger_decode_aper, /* Aligned PER decoder */ + NativeInteger_encode_aper, /* Aligned PER encoder */ + 0, /* Use generic outmost tag fetcher */ + asn_DEF_NativeInteger_tags, + sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]), + asn_DEF_NativeInteger_tags, /* Same as above */ + sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]), + 0, /* No PER visible constraints */ + 0, 0, /* No members */ + 0 /* No specifics */ +}; + +/* + * Decode INTEGER type. + */ +asn_dec_rval_t +NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx, + asn_TYPE_descriptor_t *td, + void **nint_ptr, const void *buf_ptr, size_t size, int tag_mode) { + asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; + long *native = (long *)*nint_ptr; + asn_dec_rval_t rval; + ber_tlv_len_t length; + + /* + * If the structure is not there, allocate it. + */ + if(native == NULL) { + native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native))); + if(native == NULL) { + rval.code = RC_FAIL; + rval.consumed = 0; + return rval; + } + } + + ASN_DEBUG("Decoding %s as INTEGER (tm=%d)", + td->name, tag_mode); + + /* + * Check tags. + */ + rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size, + tag_mode, 0, &length, 0); + if(rval.code != RC_OK) + return rval; + + ASN_DEBUG("%s length is %d bytes", td->name, (int)length); + + /* + * Make sure we have this length. + */ + buf_ptr = ((const char *)buf_ptr) + rval.consumed; + size -= rval.consumed; + if(length > (ber_tlv_len_t)size) { + rval.code = RC_WMORE; + rval.consumed = 0; + return rval; + } + + /* + * ASN.1 encoded INTEGER: buf_ptr, length + * Fill the native, at the same time checking for overflow. + * If overflow occured, return with RC_FAIL. + */ + { + INTEGER_t tmp; + union { + const void *constbuf; + void *nonconstbuf; + } unconst_buf; + long l; + + unconst_buf.constbuf = buf_ptr; + tmp.buf = (uint8_t *)unconst_buf.nonconstbuf; + tmp.size = length; + + if((specs&&specs->field_unsigned) + ? asn_INTEGER2ulong(&tmp, (unsigned long *)&l) /* sic */ + : asn_INTEGER2long(&tmp, &l)) { + rval.code = RC_FAIL; + rval.consumed = 0; + return rval; + } + + *native = l; + } + + rval.code = RC_OK; + rval.consumed += length; + + ASN_DEBUG("Took %ld/%ld bytes to encode %s (%ld)", + (long)rval.consumed, (long)length, td->name, (long)*native); + + return rval; +} + +/* + * Encode the NativeInteger using the standard INTEGER type DER encoder. + */ +asn_enc_rval_t +NativeInteger_encode_der(asn_TYPE_descriptor_t *sd, void *ptr, + int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { + unsigned long native = *(unsigned long *)ptr; /* Disable sign ext. */ + asn_enc_rval_t erval; + INTEGER_t tmp; + +#ifdef WORDS_BIGENDIAN /* Opportunistic optimization */ + + tmp.buf = (uint8_t *)&native; + tmp.size = sizeof(native); + +#else /* Works even if WORDS_BIGENDIAN is not set where should've been */ + uint8_t buf[sizeof(native)]; + uint8_t *p; + + /* Prepare a fake INTEGER */ + for(p = buf + sizeof(buf) - 1; p >= buf; p--, native >>= 8) + *p = (uint8_t)native; + + tmp.buf = buf; + tmp.size = sizeof(buf); +#endif /* WORDS_BIGENDIAN */ + + /* Encode fake INTEGER */ + erval = INTEGER_encode_der(sd, &tmp, tag_mode, tag, cb, app_key); + if(erval.encoded == -1) { + assert(erval.structure_ptr == &tmp); + erval.structure_ptr = ptr; + } + return erval; +} + +/* + * Decode the chunk of XML text encoding INTEGER. + */ +asn_dec_rval_t +NativeInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx, + asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, + const void *buf_ptr, size_t size) { + asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; + asn_dec_rval_t rval; + INTEGER_t st; + void *st_ptr = (void *)&st; + long *native = (long *)*sptr; + + if(!native) { + native = (long *)(*sptr = CALLOC(1, sizeof(*native))); + if(!native) _ASN_DECODE_FAILED; + } + + memset(&st, 0, sizeof(st)); + rval = INTEGER_decode_xer(opt_codec_ctx, td, &st_ptr, + opt_mname, buf_ptr, size); + if(rval.code == RC_OK) { + long l; + if((specs&&specs->field_unsigned) + ? asn_INTEGER2ulong(&st, (unsigned long *)&l) /* sic */ + : asn_INTEGER2long(&st, &l)) { + rval.code = RC_FAIL; + rval.consumed = 0; + } else { + *native = l; + } + } else { + /* + * Cannot restart from the middle; + * there is no place to save state in the native type. + * Request a continuation from the very beginning. + */ + rval.consumed = 0; + } + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &st); + return rval; +} + + +asn_enc_rval_t +NativeInteger_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; + char scratch[32]; /* Enough for 64-bit int */ + asn_enc_rval_t er; + const long *native = (const long *)sptr; + + (void)ilevel; + (void)flags; + + if(!native) _ASN_ENCODE_FAILED; + + er.encoded = snprintf(scratch, sizeof(scratch), + (specs && specs->field_unsigned) + ? "%lu" : "%ld", *native); + if(er.encoded <= 0 || (size_t)er.encoded >= sizeof(scratch) + || cb(scratch, er.encoded, app_key) < 0) + _ASN_ENCODE_FAILED; + + _ASN_ENCODED_OK(er); +} + +asn_dec_rval_t +NativeInteger_decode_uper(asn_codec_ctx_t *opt_codec_ctx, + asn_TYPE_descriptor_t *td, + asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + + asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; + asn_dec_rval_t rval; + long *native = (long *)*sptr; + INTEGER_t tmpint; + void *tmpintptr = &tmpint; + + (void)opt_codec_ctx; + ASN_DEBUG("Decoding NativeInteger %s (UPER)", td->name); + + if(!native) { + native = (long *)(*sptr = CALLOC(1, sizeof(*native))); + if(!native) _ASN_DECODE_FAILED; + } + + memset(&tmpint, 0, sizeof tmpint); + rval = INTEGER_decode_uper(opt_codec_ctx, td, constraints, + &tmpintptr, pd); + if(rval.code == RC_OK) { + if((specs&&specs->field_unsigned) + ? asn_INTEGER2ulong(&tmpint, (unsigned long *)native) + : asn_INTEGER2long(&tmpint, native)) + rval.code = RC_FAIL; + else + ASN_DEBUG("NativeInteger %s got value %ld", + td->name, *native); + } + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); + + return rval; +} + +asn_dec_rval_t +NativeInteger_decode_aper(asn_codec_ctx_t *opt_codec_ctx, + asn_TYPE_descriptor_t *td, + asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + + asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; + asn_dec_rval_t rval; + long *native = (long *)*sptr; + INTEGER_t tmpint; + void *tmpintptr = &tmpint; + //int dynamic = 0; + + (void)opt_codec_ctx; + ASN_DEBUG("Decoding NativeInteger %s (APER)", td->name); + + if(!native) { + native = (long *)(*sptr = CALLOC(1, sizeof(*native))); + //dynamic = 1; + if(!native) _ASN_DECODE_FAILED; + } + + memset(&tmpint, 0, sizeof tmpint); + rval = INTEGER_decode_aper(opt_codec_ctx, td, constraints, + &tmpintptr, pd); + if(rval.code == RC_OK) { + if((specs&&specs->field_unsigned) + ? asn_INTEGER2ulong(&tmpint, (unsigned long *)native) + : asn_INTEGER2long(&tmpint, native)) + rval.code = RC_FAIL; + else + ASN_DEBUG("NativeInteger %s got value %ld", + td->name, *native); + } + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); + //if (dynamic) + // free(native); + + return rval; +} + +asn_enc_rval_t +NativeInteger_encode_uper(asn_TYPE_descriptor_t *td, + asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { + asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; + asn_enc_rval_t er; + long native; + INTEGER_t tmpint; + + if(!sptr) _ASN_ENCODE_FAILED; + + native = *(long *)sptr; + + ASN_DEBUG("Encoding NativeInteger %s %ld (UPER)", td->name, native); + + memset(&tmpint, 0, sizeof(tmpint)); + if((specs&&specs->field_unsigned) + ? asn_ulong2INTEGER(&tmpint, native) + : asn_long2INTEGER(&tmpint, native)) + _ASN_ENCODE_FAILED; + er = INTEGER_encode_uper(td, constraints, &tmpint, po); + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); + return er; +} + +asn_enc_rval_t +NativeInteger_encode_aper( + asn_TYPE_descriptor_t *td, + asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { + + asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; + asn_enc_rval_t er; + INTEGER_t tmpint; + + if(!sptr) _ASN_ENCODE_FAILED; + memset(&tmpint, 0, sizeof(tmpint)); + + if(specs&&specs->field_unsigned) { + unsigned long native; + native = *(unsigned long *)sptr; + + ASN_DEBUG("Encoding NativeInteger %s %lu (APER) (unsigned)", td->name, native); + + if(asn_ulong2INTEGER(&tmpint, native)) + _ASN_ENCODE_FAILED; + } else { + long native; + native = *(long *)sptr; + + ASN_DEBUG("Encoding NativeInteger %s %ld (APER) (unsigned)", td->name, native); + if(asn_long2INTEGER(&tmpint, native)) + _ASN_ENCODE_FAILED; + } + +// if((specs&&specs->field_unsigned) +// ? asn_ulong2INTEGER(&tmpint, native) +// : asn_long2INTEGER(&tmpint, native)) +// _ASN_ENCODE_FAILED; + er = INTEGER_encode_aper(td, constraints, &tmpint, po); + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); + return er; +} + +/* + * INTEGER specific human-readable output. + */ +int +NativeInteger_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, + asn_app_consume_bytes_f *cb, void *app_key) { + asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; + const long *native = (const long *)sptr; + char scratch[32]; /* Enough for 64-bit int */ + int ret; + + (void)td; /* Unused argument */ + (void)ilevel; /* Unused argument */ + + if(native) { + ret = snprintf(scratch, sizeof(scratch), + (specs && specs->field_unsigned) + ? "%lu" : "%ld", *native); + assert(ret > 0 && (size_t)ret < sizeof(scratch)); + return (cb(scratch, ret, app_key) < 0) ? -1 : 0; + } else { + return (cb("", 8, app_key) < 0) ? -1 : 0; + } +} + +void +NativeInteger_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { + + if(!td || !ptr) + return; + + ASN_DEBUG("Freeing %s as INTEGER (%d, %p, Native)", + td->name, contents_only, ptr); + + if(!contents_only) { + FREEMEM(ptr); + } +} + diff --git a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h new file mode 100644 index 0000000000..d9c9fd1b4b --- /dev/null +++ b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h @@ -0,0 +1,63 @@ +/* + * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) + * From ASN.1 module "X2AP-IEs" + * found in "/roux/comments/openairinterface5g/openair2/X2AP/MESSAGES/ASN1/R11.2/X2AP-IEs.asn" + * `asn1c -gen-PER` + */ + +#ifndef _X2ap_CriticalityDiagnostics_IE_List_H_ +#define _X2ap_CriticalityDiagnostics_IE_List_H_ + + +#include + +/* Including external dependencies */ +#include +#include "X2ap-Criticality.h" +#include "X2ap-ProtocolIE-ID.h" +#include "X2ap-TypeOfError.h" +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward declarations */ +struct X2ap_IE_Extensions; + +struct X2ap_CriticalityDiagnostics_IE_List__Member { + X2ap_Criticality_t iECriticality; + X2ap_ProtocolIE_ID_t iE_ID; + X2ap_TypeOfError_t typeOfError; + struct X2ap_IE_Extensions *iE_Extensions /* OPTIONAL */; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + }; + +/* X2ap-CriticalityDiagnostics-IE-List */ +typedef struct X2ap_CriticalityDiagnostics_IE_List { + A_SEQUENCE_OF(struct X2ap_CriticalityDiagnostics_IE_List__Member + ) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} X2ap_CriticalityDiagnostics_IE_List_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_X2ap_CriticalityDiagnostics_IE_List; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "X2ap-IE-Extensions.h" + +#endif /* _X2ap_CriticalityDiagnostics_IE_List_H_ */ +#include diff --git a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c new file mode 100644 index 0000000000..3e2d23b254 --- /dev/null +++ b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c @@ -0,0 +1,1041 @@ +/*- + * Copyright (c) 2003, 2004, 2005 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include + +/* + * Number of bytes left for this structure. + * (ctx->left) indicates the number of bytes _transferred_ for the structure. + * (size) contains the number of bytes in the buffer passed. + */ +#define LEFT ((size<(size_t)ctx->left)?size:(size_t)ctx->left) + +/* + * If the subprocessor function returns with an indication that it wants + * more data, it may well be a fatal decoding problem, because the + * size is constrained by the 's L, even if the buffer size allows + * reading more data. + * For example, consider the buffer containing the following TLVs: + * ... + * The TLV length clearly indicates that one byte is expected in V, but + * if the V processor returns with "want more data" even if the buffer + * contains way more data than the V processor have seen. + */ +#define SIZE_VIOLATION (ctx->left >= 0 && (size_t)ctx->left <= size) + +/* + * This macro "eats" the part of the buffer which is definitely "consumed", + * i.e. was correctly converted into local representation or rightfully skipped. + */ +#undef ADVANCE +#define ADVANCE(num_bytes) do { \ + size_t num = num_bytes; \ + ptr = ((const char *)ptr) + num;\ + size -= num; \ + if(ctx->left >= 0) \ + ctx->left -= num; \ + consumed_myself += num; \ + } while(0) + +/* + * Switch to the next phase of parsing. + */ +#undef NEXT_PHASE +#undef PHASE_OUT +#define NEXT_PHASE(ctx) do { \ + ctx->phase++; \ + ctx->step = 0; \ + } while(0) +#define PHASE_OUT(ctx) do { ctx->phase = 10; } while(0) + +/* + * Return a standardized complex structure. + */ +#undef RETURN +#define RETURN(_code) do { \ + rval.code = _code; \ + rval.consumed = consumed_myself;\ + return rval; \ + } while(0) + +/* + * The decoder of the SET OF type. + */ +asn_dec_rval_t +SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + void **struct_ptr, const void *ptr, size_t size, int tag_mode) { + /* + * Bring closer parts of structure description. + */ + asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; + asn_TYPE_member_t *elm = td->elements; /* Single one */ + + /* + * Parts of the structure being constructed. + */ + void *st = *struct_ptr; /* Target structure. */ + asn_struct_ctx_t *ctx; /* Decoder context */ + + ber_tlv_tag_t tlv_tag; /* T from TLV */ + asn_dec_rval_t rval; /* Return code from subparsers */ + + ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ + + ASN_DEBUG("Decoding %s as SET OF", td->name); + + /* + * Create the target structure if it is not present already. + */ + if(st == 0) { + st = *struct_ptr = CALLOC(1, specs->struct_size); + if(st == 0) { + RETURN(RC_FAIL); + } + } + + /* + * Restore parsing context. + */ + ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); + + /* + * Start to parse where left previously + */ + switch(ctx->phase) { + case 0: + /* + * PHASE 0. + * Check that the set of tags associated with given structure + * perfectly fits our expectations. + */ + + rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size, + tag_mode, 1, &ctx->left, 0); + if(rval.code != RC_OK) { + ASN_DEBUG("%s tagging check failed: %d", + td->name, rval.code); + return rval; + } + + if(ctx->left >= 0) + ctx->left += rval.consumed; /* ?Substracted below! */ + ADVANCE(rval.consumed); + + ASN_DEBUG("Structure consumes %ld bytes, " + "buffer %ld", (long)ctx->left, (long)size); + + NEXT_PHASE(ctx); + /* Fall through */ + case 1: + /* + * PHASE 1. + * From the place where we've left it previously, + * try to decode the next item. + */ + for(;; ctx->step = 0) { + ssize_t tag_len; /* Length of TLV's T */ + + if(ctx->step & 1) + goto microphase2; + + /* + * MICROPHASE 1: Synchronize decoding. + */ + + if(ctx->left == 0) { + ASN_DEBUG("End of SET OF %s", td->name); + /* + * No more things to decode. + * Exit out of here. + */ + PHASE_OUT(ctx); + RETURN(RC_OK); + } + + /* + * Fetch the T from TLV. + */ + tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag); + switch(tag_len) { + case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); + /* Fall through */ + case -1: RETURN(RC_FAIL); + } + + if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) { + if(LEFT < 2) { + if(SIZE_VIOLATION) + RETURN(RC_FAIL); + else + RETURN(RC_WMORE); + } else if(((const uint8_t *)ptr)[1] == 0) { + /* + * Found the terminator of the + * indefinite length structure. + */ + break; + } + } + + /* Outmost tag may be unknown and cannot be fetched/compared */ + if(elm->tag != (ber_tlv_tag_t)-1) { + if(BER_TAGS_EQUAL(tlv_tag, elm->tag)) { + /* + * The new list member of expected type has arrived. + */ + } else { + ASN_DEBUG("Unexpected tag %s fixed SET OF %s", + ber_tlv_tag_string(tlv_tag), td->name); + ASN_DEBUG("%s SET OF has tag %s", + td->name, ber_tlv_tag_string(elm->tag)); + RETURN(RC_FAIL); + } + } + + /* + * MICROPHASE 2: Invoke the member-specific decoder. + */ + ctx->step |= 1; /* Confirm entering next microphase */ + microphase2: + + /* + * Invoke the member fetch routine according to member's type + */ + rval = elm->type->ber_decoder(opt_codec_ctx, + elm->type, &ctx->ptr, ptr, LEFT, 0); + ASN_DEBUG("In %s SET OF %s code %d consumed %d", + td->name, elm->type->name, + rval.code, (int)rval.consumed); + switch(rval.code) { + case RC_OK: + { + asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); + if(ASN_SET_ADD(list, ctx->ptr) != 0) + RETURN(RC_FAIL); + else + ctx->ptr = 0; + } + break; + case RC_WMORE: /* More data expected */ + if(!SIZE_VIOLATION) { + ADVANCE(rval.consumed); + RETURN(RC_WMORE); + } + /* Fall through */ + case RC_FAIL: /* Fatal error */ + ASN_STRUCT_FREE(*elm->type, ctx->ptr); + ctx->ptr = 0; + RETURN(RC_FAIL); + } /* switch(rval) */ + + ADVANCE(rval.consumed); + } /* for(all list members) */ + + NEXT_PHASE(ctx); + case 2: + /* + * Read in all "end of content" TLVs. + */ + while(ctx->left < 0) { + if(LEFT < 2) { + if(LEFT > 0 && ((const char *)ptr)[0] != 0) { + /* Unexpected tag */ + RETURN(RC_FAIL); + } else { + RETURN(RC_WMORE); + } + } + if(((const char *)ptr)[0] == 0 + && ((const char *)ptr)[1] == 0) { + ADVANCE(2); + ctx->left++; + } else { + RETURN(RC_FAIL); + } + } + + PHASE_OUT(ctx); + } + + RETURN(RC_OK); +} + +/* + * Internally visible buffer holding a single encoded element. + */ +struct _el_buffer { + uint8_t *buf; + size_t length; + size_t size; +}; +/* Append bytes to the above structure */ +static int _el_addbytes(const void *buffer, size_t size, void *el_buf_ptr) { + struct _el_buffer *el_buf = (struct _el_buffer *)el_buf_ptr; + + if(el_buf->length + size > el_buf->size) + return -1; + + memcpy(el_buf->buf + el_buf->length, buffer, size); + + el_buf->length += size; + return 0; +} +static int _el_buf_cmp(const void *ap, const void *bp) { + const struct _el_buffer *a = (const struct _el_buffer *)ap; + const struct _el_buffer *b = (const struct _el_buffer *)bp; + int ret; + size_t common_len; + + if(a->length < b->length) + common_len = a->length; + else + common_len = b->length; + + ret = memcmp(a->buf, b->buf, common_len); + if(ret == 0) { + if(a->length < b->length) + ret = -1; + else if(a->length > b->length) + ret = 1; + } + + return ret; +} + +/* + * The DER encoder of the SET OF type. + */ +asn_enc_rval_t +SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, + int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { + asn_TYPE_member_t *elm = td->elements; + asn_TYPE_descriptor_t *elm_type = elm->type; + der_type_encoder_f *der_encoder = elm_type->der_encoder; + asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr); + size_t computed_size = 0; + ssize_t encoding_size = 0; + struct _el_buffer *encoded_els; + ssize_t eels_count = 0; + size_t max_encoded_len = 1; + asn_enc_rval_t erval; + int ret; + int edx; + + ASN_DEBUG("Estimating size for SET OF %s", td->name); + + /* + * Gather the length of the underlying members sequence. + */ + for(edx = 0; edx < list->count; edx++) { + void *memb_ptr = list->array[edx]; + if(!memb_ptr) continue; + erval = der_encoder(elm_type, memb_ptr, 0, elm->tag, 0, 0); + if(erval.encoded == -1) + return erval; + computed_size += erval.encoded; + + /* Compute maximum encoding's size */ + if(max_encoded_len < (size_t)erval.encoded) + max_encoded_len = erval.encoded; + } + + /* + * Encode the TLV for the sequence itself. + */ + encoding_size = der_write_tags(td, computed_size, tag_mode, 1, tag, + cb, app_key); + if(encoding_size == -1) { + erval.encoded = -1; + erval.failed_type = td; + erval.structure_ptr = ptr; + return erval; + } + computed_size += encoding_size; + + if(!cb || list->count == 0) { + erval.encoded = computed_size; + _ASN_ENCODED_OK(erval); + } + + /* + * DER mandates dynamic sorting of the SET OF elements + * according to their encodings. Build an array of the + * encoded elements. + */ + encoded_els = (struct _el_buffer *)MALLOC( + list->count * sizeof(encoded_els[0])); + if(encoded_els == NULL) { + erval.encoded = -1; + erval.failed_type = td; + erval.structure_ptr = ptr; + return erval; + } + + ASN_DEBUG("Encoding members of %s SET OF", td->name); + + /* + * Encode all members. + */ + for(edx = 0; edx < list->count; edx++) { + void *memb_ptr = list->array[edx]; + struct _el_buffer *encoded_el = &encoded_els[eels_count]; + + if(!memb_ptr) continue; + + /* + * Prepare space for encoding. + */ + encoded_el->buf = (uint8_t *)MALLOC(max_encoded_len); + if(encoded_el->buf) { + encoded_el->length = 0; + encoded_el->size = max_encoded_len; + } else { + for(edx--; edx >= 0; edx--) + FREEMEM(encoded_els[edx].buf); + FREEMEM(encoded_els); + erval.encoded = -1; + erval.failed_type = td; + erval.structure_ptr = ptr; + return erval; + } + + /* + * Encode the member into the prepared space. + */ + erval = der_encoder(elm_type, memb_ptr, 0, elm->tag, + _el_addbytes, encoded_el); + if(erval.encoded == -1) { + for(; edx >= 0; edx--) + FREEMEM(encoded_els[edx].buf); + FREEMEM(encoded_els); + return erval; + } + encoding_size += erval.encoded; + eels_count++; + } + + /* + * Sort the encoded elements according to their encoding. + */ + qsort(encoded_els, eels_count, sizeof(encoded_els[0]), _el_buf_cmp); + + /* + * Report encoded elements to the application. + * Dispose of temporary sorted members table. + */ + ret = 0; + for(edx = 0; edx < eels_count; edx++) { + struct _el_buffer *encoded_el = &encoded_els[edx]; + /* Report encoded chunks to the application */ + if(ret == 0 + && cb(encoded_el->buf, encoded_el->length, app_key) < 0) + ret = -1; + FREEMEM(encoded_el->buf); + } + FREEMEM(encoded_els); + + if(ret || computed_size != (size_t)encoding_size) { + /* + * Standard callback failed, or + * encoded size is not equal to the computed size. + */ + erval.encoded = -1; + erval.failed_type = td; + erval.structure_ptr = ptr; + } else { + erval.encoded = computed_size; + } + + _ASN_ENCODED_OK(erval); +} + +#undef XER_ADVANCE +#define XER_ADVANCE(num_bytes) do { \ + size_t num = num_bytes; \ + buf_ptr = ((const char *)buf_ptr) + num;\ + size -= num; \ + consumed_myself += num; \ + } while(0) + +/* + * Decode the XER (XML) data. + */ +asn_dec_rval_t +SET_OF_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + void **struct_ptr, const char *opt_mname, + const void *buf_ptr, size_t size) { + /* + * Bring closer parts of structure description. + */ + asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; + asn_TYPE_member_t *element = td->elements; + const char *elm_tag; + const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; + + /* + * ... and parts of the structure being constructed. + */ + void *st = *struct_ptr; /* Target structure. */ + asn_struct_ctx_t *ctx; /* Decoder context */ + + asn_dec_rval_t rval; /* Return value from a decoder */ + ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ + + /* + * Create the target structure if it is not present already. + */ + if(st == 0) { + st = *struct_ptr = CALLOC(1, specs->struct_size); + if(st == 0) RETURN(RC_FAIL); + } + + /* Which tag is expected for the downstream */ + if(specs->as_XMLValueList) { + elm_tag = (specs->as_XMLValueList == 1) ? 0 : ""; + } else { + elm_tag = (*element->name) + ? element->name : element->type->xml_tag; + } + + /* + * Restore parsing context. + */ + ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); + + /* + * Phases of XER/XML processing: + * Phase 0: Check that the opening tag matches our expectations. + * Phase 1: Processing body and reacting on closing tag. + * Phase 2: Processing inner type. + */ + for(; ctx->phase <= 2;) { + pxer_chunk_type_e ch_type; /* XER chunk type */ + ssize_t ch_size; /* Chunk size */ + xer_check_tag_e tcv; /* Tag check value */ + + /* + * Go inside the inner member of a set. + */ + if(ctx->phase == 2) { + asn_dec_rval_t tmprval; + + /* Invoke the inner type decoder, m.b. multiple times */ + ASN_DEBUG("XER/SET OF element [%s]", elm_tag); + tmprval = element->type->xer_decoder(opt_codec_ctx, + element->type, &ctx->ptr, elm_tag, + buf_ptr, size); + if(tmprval.code == RC_OK) { + asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); + if(ASN_SET_ADD(list, ctx->ptr) != 0) + RETURN(RC_FAIL); + ctx->ptr = 0; + XER_ADVANCE(tmprval.consumed); + } else { + XER_ADVANCE(tmprval.consumed); + RETURN(tmprval.code); + } + ctx->phase = 1; /* Back to body processing */ + ASN_DEBUG("XER/SET OF phase => %d", ctx->phase); + /* Fall through */ + } + + /* + * Get the next part of the XML stream. + */ + ch_size = xer_next_token(&ctx->context, + buf_ptr, size, &ch_type); + switch(ch_size) { + case -1: RETURN(RC_FAIL); + case 0: RETURN(RC_WMORE); + default: + switch(ch_type) { + case PXER_COMMENT: /* Got XML comment */ + case PXER_TEXT: /* Ignore free-standing text */ + XER_ADVANCE(ch_size); /* Skip silently */ + continue; + case PXER_TAG: + break; /* Check the rest down there */ + } + } + + tcv = xer_check_tag(buf_ptr, ch_size, xml_tag); + ASN_DEBUG("XER/SET OF: tcv = %d, ph=%d t=%s", + tcv, ctx->phase, xml_tag); + switch(tcv) { + case XCT_CLOSING: + if(ctx->phase == 0) break; + ctx->phase = 0; + /* Fall through */ + case XCT_BOTH: + if(ctx->phase == 0) { + /* No more things to decode */ + XER_ADVANCE(ch_size); + ctx->phase = 3; /* Phase out */ + RETURN(RC_OK); + } + /* Fall through */ + case XCT_OPENING: + if(ctx->phase == 0) { + XER_ADVANCE(ch_size); + ctx->phase = 1; /* Processing body phase */ + continue; + } + /* Fall through */ + case XCT_UNKNOWN_OP: + case XCT_UNKNOWN_BO: + + ASN_DEBUG("XER/SET OF: tcv=%d, ph=%d", tcv, ctx->phase); + if(ctx->phase == 1) { + /* + * Process a single possible member. + */ + ctx->phase = 2; + continue; + } + /* Fall through */ + default: + break; + } + + ASN_DEBUG("Unexpected XML tag in SET OF"); + break; + } + + ctx->phase = 3; /* "Phase out" on hard failure */ + RETURN(RC_FAIL); +} + + + +typedef struct xer_tmp_enc_s { + void *buffer; + size_t offset; + size_t size; +} xer_tmp_enc_t; +static int +SET_OF_encode_xer_callback(const void *buffer, size_t size, void *key) { + xer_tmp_enc_t *t = (xer_tmp_enc_t *)key; + if(t->offset + size >= t->size) { + size_t newsize = (t->size << 2) + size; + void *p = REALLOC(t->buffer, newsize); + if(!p) return -1; + t->buffer = p; + t->size = newsize; + } + memcpy((char *)t->buffer + t->offset, buffer, size); + t->offset += size; + return 0; +} +static int +SET_OF_xer_order(const void *aptr, const void *bptr) { + const xer_tmp_enc_t *a = (const xer_tmp_enc_t *)aptr; + const xer_tmp_enc_t *b = (const xer_tmp_enc_t *)bptr; + size_t minlen = a->offset; + int ret; + if(b->offset < minlen) minlen = b->offset; + /* Well-formed UTF-8 has this nice lexicographical property... */ + ret = memcmp(a->buffer, b->buffer, minlen); + if(ret != 0) return ret; + if(a->offset == b->offset) + return 0; + if(a->offset == minlen) + return -1; + return 1; +} + + +asn_enc_rval_t +SET_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + asn_enc_rval_t er; + asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; + asn_TYPE_member_t *elm = td->elements; + asn_anonymous_set_ *list = _A_SET_FROM_VOID(sptr); + const char *mname = specs->as_XMLValueList + ? 0 : ((*elm->name) ? elm->name : elm->type->xml_tag); + size_t mlen = mname ? strlen(mname) : 0; + int xcan = (flags & XER_F_CANONICAL); + xer_tmp_enc_t *encs = 0; + size_t encs_count = 0; + void *original_app_key = app_key; + asn_app_consume_bytes_f *original_cb = cb; + int i; + + if(!sptr) _ASN_ENCODE_FAILED; + + if(xcan) { + encs = (xer_tmp_enc_t *)MALLOC(list->count * sizeof(encs[0])); + if(!encs) _ASN_ENCODE_FAILED; + cb = SET_OF_encode_xer_callback; + } + + er.encoded = 0; + + for(i = 0; i < list->count; i++) { + asn_enc_rval_t tmper; + + void *memb_ptr = list->array[i]; + if(!memb_ptr) continue; + + if(encs) { + memset(&encs[encs_count], 0, sizeof(encs[0])); + app_key = &encs[encs_count]; + encs_count++; + } + + if(mname) { + if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel); + _ASN_CALLBACK3("<", 1, mname, mlen, ">", 1); + } + + if(!xcan && specs->as_XMLValueList == 1) + _i_ASN_TEXT_INDENT(1, ilevel + 1); + tmper = elm->type->xer_encoder(elm->type, memb_ptr, + ilevel + (specs->as_XMLValueList != 2), + flags, cb, app_key); + if(tmper.encoded == -1) { + td = tmper.failed_type; + sptr = tmper.structure_ptr; + goto cb_failed; + } + if(tmper.encoded == 0 && specs->as_XMLValueList) { + const char *name = elm->type->xml_tag; + size_t len = strlen(name); + _ASN_CALLBACK3("<", 1, name, len, "/>", 2); + } + + if(mname) { + _ASN_CALLBACK3("", 1); + er.encoded += 5; + } + + er.encoded += (2 * mlen) + tmper.encoded; + } + + if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel - 1); + + if(encs) { + xer_tmp_enc_t *enc = encs; + xer_tmp_enc_t *end = encs + encs_count; + ssize_t control_size = 0; + + cb = original_cb; + app_key = original_app_key; + qsort(encs, encs_count, sizeof(encs[0]), SET_OF_xer_order); + + for(; enc < end; enc++) { + _ASN_CALLBACK(enc->buffer, enc->offset); + FREEMEM(enc->buffer); + enc->buffer = 0; + control_size += enc->offset; + } + assert(control_size == er.encoded); + } + + goto cleanup; +cb_failed: + er.encoded = -1; + er.failed_type = td; + er.structure_ptr = sptr; +cleanup: + if(encs) { + while(encs_count-- > 0) { + if(encs[encs_count].buffer) + FREEMEM(encs[encs_count].buffer); + } + FREEMEM(encs); + } + _ASN_ENCODED_OK(er); +} + +int +SET_OF_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, + asn_app_consume_bytes_f *cb, void *app_key) { + asn_TYPE_member_t *elm = td->elements; + const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); + int ret; + int i; + + if(!sptr) return (cb("", 8, app_key) < 0) ? -1 : 0; + + /* Dump preamble */ + if(cb(td->name, strlen(td->name), app_key) < 0 + || cb(" ::= {", 6, app_key) < 0) + return -1; + + for(i = 0; i < list->count; i++) { + const void *memb_ptr = list->array[i]; + if(!memb_ptr) continue; + + _i_INDENT(1); + + ret = elm->type->print_struct(elm->type, memb_ptr, + ilevel + 1, cb, app_key); + if(ret) return ret; + } + + ilevel--; + _i_INDENT(1); + + return (cb("}", 1, app_key) < 0) ? -1 : 0; +} + +void +SET_OF_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { + if(td && ptr) { + asn_SET_OF_specifics_t *specs; + asn_TYPE_member_t *elm = td->elements; + asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr); + asn_struct_ctx_t *ctx; /* Decoder context */ + int i; + + /* + * Could not use set_of_empty() because of (*free) + * incompatibility. + */ + for(i = 0; i < list->count; i++) { + void *memb_ptr = list->array[i]; + if(memb_ptr) + ASN_STRUCT_FREE(*elm->type, memb_ptr); + } + list->count = 0; /* No meaningful elements left */ + + asn_set_empty(list); /* Remove (list->array) */ + + specs = (asn_SET_OF_specifics_t *)td->specifics; + ctx = (asn_struct_ctx_t *)((char *)ptr + specs->ctx_offset); + if(ctx->ptr) { + ASN_STRUCT_FREE(*elm->type, ctx->ptr); + ctx->ptr = 0; + } + + if(!contents_only) { + FREEMEM(ptr); + } + } +} + +int +SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_TYPE_member_t *elm = td->elements; + asn_constr_check_f *constr; + const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); + int i; + + if(!sptr) { + _ASN_CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + constr = elm->memb_constraints; + if(!constr) constr = elm->type->check_constraints; + + /* + * Iterate over the members of an array. + * Validate each in turn, until one fails. + */ + for(i = 0; i < list->count; i++) { + const void *memb_ptr = list->array[i]; + int ret; + + if(!memb_ptr) continue; + + ret = constr(elm->type, memb_ptr, ctfailcb, app_key); + if(ret) return ret; + } + + /* + * Cannot inherit it eralier: + * need to make sure we get the updated version. + */ + if(!elm->memb_constraints) + elm->memb_constraints = elm->type->check_constraints; + + return 0; +} + +asn_dec_rval_t +SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + asn_dec_rval_t rv; + asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; + asn_TYPE_member_t *elm = td->elements; /* Single one */ + void *st = *sptr; + asn_anonymous_set_ *list; + asn_per_constraint_t *ct; + int repeat = 0; + ssize_t nelems; + + if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx)) + _ASN_DECODE_FAILED; + + /* + * Create the target structure if it is not present already. + */ + if(!st) { + st = *sptr = CALLOC(1, specs->struct_size); + if(!st) _ASN_DECODE_FAILED; + } + list = _A_SET_FROM_VOID(st); + + /* Figure out which constraints to use */ + if(constraints) ct = &constraints->size; + else if(td->per_constraints) ct = &td->per_constraints->size; + else ct = 0; + + if(ct && ct->flags & APC_EXTENSIBLE) { + int value = per_get_few_bits(pd, 1); + if(value < 0) _ASN_DECODE_STARVED; + if(value) ct = 0; /* Not restricted! */ + } + + if(ct && ct->effective_bits >= 0) { + /* X.691, #19.5: No length determinant */ + nelems = per_get_few_bits(pd, ct->effective_bits); + ASN_DEBUG("Preparing to fetch %ld+%"PRIdMAX" elements from %s", + (long)nelems, ct->lower_bound, td->name); + if(nelems < 0) _ASN_DECODE_STARVED; + nelems += ct->lower_bound; + } else { + nelems = -1; + } + + do { + int i; + if(nelems < 0) { + nelems = uper_get_length(pd, + ct ? ct->effective_bits : -1, &repeat); + ASN_DEBUG("Got to decode %d elements (eff %d)", + (int)nelems, (int)(ct ? ct->effective_bits : -1)); + if(nelems < 0) _ASN_DECODE_STARVED; + } + + for(i = 0; i < nelems; i++) { + void *ptr = 0; + ASN_DEBUG("SET OF %s decoding", elm->type->name); + rv = elm->type->uper_decoder(opt_codec_ctx, elm->type, + elm->per_constraints, &ptr, pd); + ASN_DEBUG("%s SET OF %s decoded %d, %p", + td->name, elm->type->name, rv.code, ptr); + if(rv.code == RC_OK) { + if(ASN_SET_ADD(list, ptr) == 0) + continue; + ASN_DEBUG("Failed to add element into %s", + td->name); + /* Fall through */ + rv.code = RC_FAIL; + } else { + ASN_DEBUG("Failed decoding %s of %s (SET OF)", + elm->type->name, td->name); + } + if(ptr) ASN_STRUCT_FREE(*elm->type, ptr); + return rv; + } + + nelems = -1; /* Allow uper_get_length() */ + } while(repeat); + + ASN_DEBUG("Decoded %s as SET OF", td->name); + + rv.code = RC_OK; + rv.consumed = 0; + return rv; +} + +asn_dec_rval_t +SET_OF_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + asn_dec_rval_t rv; + asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; + asn_TYPE_member_t *elm = td->elements; /* Single one */ + void *st = *sptr; + asn_anonymous_set_ *list; + asn_per_constraint_t *ct; + int repeat = 0; + ssize_t nelems; + + if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx)) + _ASN_DECODE_FAILED; + + /* + * Create the target structure if it is not present already. + */ + if(!st) { + st = *sptr = CALLOC(1, specs->struct_size); + if(!st) _ASN_DECODE_FAILED; + } + list = _A_SET_FROM_VOID(st); + + /* Figure out which constraints to use */ + if(constraints) ct = &constraints->size; + else if(td->per_constraints) ct = &td->per_constraints->size; + else ct = 0; + + if(ct && ct->flags & APC_EXTENSIBLE) { + int value = per_get_few_bits(pd, 1); + if(value < 0) _ASN_DECODE_STARVED; + if(value) ct = 0; /* Not restricted! */ + } + + if(ct && ct->effective_bits >= 0) { + /* X.691, #19.5: No length determinant */ +// nelems = per_get_few_bits(pd, ct->effective_bits); + nelems = aper_get_nsnnwn(pd, ct->upper_bound - ct->lower_bound); + ASN_DEBUG("Preparing to fetch %ld+%"PRIdMAX" elements from %s", + (long)nelems, ct->lower_bound, td->name); + if(nelems < 0) _ASN_DECODE_STARVED; + nelems += ct->lower_bound; + } else { + nelems = -1; + } + + do { + int i; + if(nelems < 0) { + nelems = aper_get_length(pd, ct ? ct->upper_bound - ct->lower_bound + 1 : -1, + ct ? ct->effective_bits : -1, &repeat); + ASN_DEBUG("Got to decode %d elements (eff %d)", + (int)nelems, ct ? ct->effective_bits : -1); + if(nelems < 0) _ASN_DECODE_STARVED; + } + + for(i = 0; i < nelems; i++) { + void *ptr = 0; + ASN_DEBUG("SET OF %s decoding", elm->type->name); + rv = elm->type->aper_decoder(opt_codec_ctx, elm->type, + elm->per_constraints, &ptr, pd); + ASN_DEBUG("%s SET OF %s decoded %d, %p", + td->name, elm->type->name, rv.code, ptr); + if(rv.code == RC_OK) { + if(ASN_SET_ADD(list, ptr) == 0) + continue; + ASN_DEBUG("Failed to add element into %s", + td->name); + /* Fall through */ + rv.code = RC_FAIL; + } else { + ASN_DEBUG("Failed decoding %s of %s (SET OF)", + elm->type->name, td->name); + } + if(ptr) ASN_STRUCT_FREE(*elm->type, ptr); + return rv; + } + + nelems = -1; /* Allow uper_get_length() */ + } while(repeat); + + ASN_DEBUG("Decoded %s as SET OF", td->name); + + rv.code = RC_OK; + rv.consumed = 0; + return rv; +} From 9108ecbdf6f01e0bd5b6115f2d7a951fb981b79d Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 22 Feb 2016 11:40:26 +0100 Subject: [PATCH 046/214] Use diff files and 'patch' instead of copying full files. --- cmake_targets/tools/fix_asn1 | 46 +- .../RRC.rel10/SystemInformation-r8-IEs.h | 109 -- .../RRC.rel10/SystemInformation-r8-IEs.h.diff | 23 + .../S1AP.rel10.5/NativeInteger.c | 412 ------- .../S1AP.rel10.5/NativeInteger.c.diff | 8 + .../S1AP.rel10.5/constr_SET_OF.c | 1041 ----------------- .../S1AP.rel10.5/constr_SET_OF.c.diff | 4 + .../X2AP.rel11.2/NativeInteger.c | 412 ------- .../X2AP.rel11.2/NativeInteger.c.diff | 8 + .../X2ap-CriticalityDiagnostics-IE-List.h | 63 - ...X2ap-CriticalityDiagnostics-IE-List.h.diff | 15 + .../X2AP.rel11.2/constr_SET_OF.c | 1041 ----------------- .../X2AP.rel11.2/constr_SET_OF.c.diff | 4 + 13 files changed, 85 insertions(+), 3101 deletions(-) delete mode 100644 cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h create mode 100644 cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff delete mode 100644 cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c create mode 100644 cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff delete mode 100644 cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c create mode 100644 cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff delete mode 100644 cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c create mode 100644 cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff delete mode 100644 cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h create mode 100644 cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff delete mode 100644 cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c create mode 100644 cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff diff --git a/cmake_targets/tools/fix_asn1 b/cmake_targets/tools/fix_asn1 index f222374fae..ba8f15d8ec 100755 --- a/cmake_targets/tools/fix_asn1 +++ b/cmake_targets/tools/fix_asn1 @@ -1,26 +1,26 @@ #!/bin/bash # in those arrays, each line is: -# +# RRC_Rel10=( - "SystemInformation-r8-IEs.h" 819eda3db27516f7c6780d832fb3c462e2264ea7 "fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h" + "SystemInformation-r8-IEs.h" 819eda3db27516f7c6780d832fb3c462e2264ea7 "fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff" ) X2AP_Rel11_2=( - "X2ap-CriticalityDiagnostics-IE-List.h" f0e2414992bfacfbc4b9fd15c977241d6d7fabeb "fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h" - "NativeInteger.c" e23034083a0fb9d4a2e523e2a64286161e621f27 "fix_asn1.data/X2AP.rel11.2/NativeInteger.c" - "constr_SET_OF.c" 5fb65da648a57ea61f008fa226b707cf343c1c0c "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c" + "X2ap-CriticalityDiagnostics-IE-List.h" f0e2414992bfacfbc4b9fd15c977241d6d7fabeb "fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff" + "NativeInteger.c" e23034083a0fb9d4a2e523e2a64286161e621f27 "fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff" + "constr_SET_OF.c" 5fb65da648a57ea61f008fa226b707cf343c1c0c "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff" ) S1AP_Rel10_5=( - "NativeInteger.c" e23034083a0fb9d4a2e523e2a64286161e621f27 "fix_asn1.data/S1AP.rel10.5/NativeInteger.c" - "constr_SET_OF.c" 5fb65da648a57ea61f008fa226b707cf343c1c0c "fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c" + "NativeInteger.c" e23034083a0fb9d4a2e523e2a64286161e621f27 "fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff" + "constr_SET_OF.c" 5fb65da648a57ea61f008fa226b707cf343c1c0c "fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff" ) -red_color="\x1b[31m" -green_color="\x1b[32m" -reset_color="\x1b[0m" +red_color="$(tput setaf 1)" +green_color="$(tput setaf 2)" +reset_color="$(tput sgr0)" function error() { @@ -46,21 +46,21 @@ function check_sha1() fi } -function copy_file() +function patch_file() { - local file="$1" - local destination="$2" + local patch="$1" + local file="$2" - echo -e "$green_color""copy file $OPENAIR_DIR/cmake_targets/tools/$file to $destination""$reset_color" + echo -e "$green_color""patch file $file with $OPENAIR_DIR/cmake_targets/tools/$patch""$reset_color" - cp -f "$OPENAIR_DIR/cmake_targets/tools/$file" "$destination" + patch "$file" "$OPENAIR_DIR/cmake_targets/tools/$patch" if [ $? -ne 0 ] then - error "copy of $file to $destination failed" + error "patching of $file with $OPENAIR_DIR/cmake_targets/tools/$patch failed" fi } -function patch() +function apply_patches() { local directory="$1" local array=$2 @@ -69,7 +69,7 @@ function patch() local i local file local sha1 - local replace + local patch local item for (( i = 0; i < $len; i += 3 )) @@ -77,9 +77,9 @@ function patch() # special bash syntax to access the array item=$array[$i]; file=${!item} item=$array[$((i+1))]; sha1=${!item} - item=$array[$((i+2))]; replace=${!item} + item=$array[$((i+2))]; patch=${!item} check_sha1 "$directory/$file" "$sha1" - copy_file "$replace" "$directory" + patch_file "$patch" "$directory/$file" done } @@ -91,7 +91,7 @@ function patch_rrc() case "$version" in Rel10 ) echo "patching RRC files release 10" - patch "$directory" RRC_Rel10 ${#RRC_Rel10[*]} + apply_patches "$directory" RRC_Rel10 ${#RRC_Rel10[*]} ;; * ) error unknwon/unhandled RRC version \'"$version"\' @@ -107,7 +107,7 @@ function patch_x2ap() case "$version" in R11 ) echo "patching X2AP files release 11.2" - patch "$directory" X2AP_Rel11_2 ${#X2AP_Rel11_2[*]} + apply_patches "$directory" X2AP_Rel11_2 ${#X2AP_Rel11_2[*]} ;; * ) error unknwon/unhandled X2AP version \'"$version"\' @@ -123,7 +123,7 @@ function patch_s1ap() case "$version" in R10 ) echo "patching S1AP files release 10.5" - patch "$directory" S1AP_Rel10_5 ${#S1AP_Rel10_5[*]} + apply_patches "$directory" S1AP_Rel10_5 ${#S1AP_Rel10_5[*]} ;; * ) error unknwon/unhandled S1AP version \'"$version"\' diff --git a/cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h b/cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h deleted file mode 100644 index baa09c12ef..0000000000 --- a/cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) - * From ASN.1 module "EUTRA-RRC-Definitions" - * found in "fixed_grammar.asn" - * `asn1c -gen-PER` - */ - -#ifndef _SystemInformation_r8_IEs_H_ -#define _SystemInformation_r8_IEs_H_ - - -#include - -/* Including external dependencies */ -#include -#include "SystemInformationBlockType2.h" -#include "SystemInformationBlockType3.h" -#include "SystemInformationBlockType4.h" -#include "SystemInformationBlockType5.h" -#include "SystemInformationBlockType6.h" -#include "SystemInformationBlockType7.h" -#include "SystemInformationBlockType8.h" -#include "SystemInformationBlockType9.h" -#include "SystemInformationBlockType10.h" -#include "SystemInformationBlockType11.h" -#include "SystemInformationBlockType12-r9.h" -#include "SystemInformationBlockType13-r9.h" -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Dependencies */ -typedef enum SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR { - SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_NOTHING, /* No components present */ - SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2, - SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib3, - SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib4, - SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib5, - SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib6, - SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib7, - SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib8, - SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib9, - SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib10, - SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib11, - /* Extensions may appear below */ - SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib12_v920, - SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib13_v920 -} SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR; - -/* Forward declarations */ -struct SystemInformation_v8a0_IEs; - - union SystemInformation_r8_IEs__sib_TypeAndInfo__Member_u { - SystemInformationBlockType2_t sib2; - SystemInformationBlockType3_t sib3; - SystemInformationBlockType4_t sib4; - SystemInformationBlockType5_t sib5; - SystemInformationBlockType6_t sib6; - SystemInformationBlockType7_t sib7; - SystemInformationBlockType8_t sib8; - SystemInformationBlockType9_t sib9; - SystemInformationBlockType10_t sib10; - SystemInformationBlockType11_t sib11; - /* - * This type is extensible, - * possible extensions are below. - */ - SystemInformationBlockType12_r9_t sib12_v920; - SystemInformationBlockType13_r9_t sib13_v920; - }; - - struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member { - SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR present; - union SystemInformation_r8_IEs__sib_TypeAndInfo__Member_u choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; - }; - -/* SystemInformation-r8-IEs */ -typedef struct SystemInformation_r8_IEs { - struct SystemInformation_r8_IEs__sib_TypeAndInfo { - A_SEQUENCE_OF(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; - } sib_TypeAndInfo; - struct SystemInformation_v8a0_IEs *nonCriticalExtension /* OPTIONAL */; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SystemInformation_r8_IEs_t; - -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_SystemInformation_r8_IEs; - -#ifdef __cplusplus -} -#endif - -/* Referred external types */ -#include "SystemInformation-v8a0-IEs.h" - -#endif /* _SystemInformation_r8_IEs_H_ */ -#include diff --git a/cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff b/cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff new file mode 100644 index 0000000000..525e35ac9e --- /dev/null +++ b/cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff @@ -0,0 +1,23 @@ +57,61d56 +< /* SystemInformation-r8-IEs */ +< typedef struct SystemInformation_r8_IEs { +< struct SystemInformation_r8_IEs__sib_TypeAndInfo { +< A_SEQUENCE_OF(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member { +< SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR present; +79c74,78 +< } choice; +--- +> }; +> +> struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member { +> SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR present; +> union SystemInformation_r8_IEs__sib_TypeAndInfo__Member_u choice; +83c82,87 +< } ) list; +--- +> }; +> +> /* SystemInformation-r8-IEs */ +> typedef struct SystemInformation_r8_IEs { +> struct SystemInformation_r8_IEs__sib_TypeAndInfo { +> A_SEQUENCE_OF(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member) list; diff --git a/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c b/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c deleted file mode 100644 index 239dbdc10f..0000000000 --- a/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c +++ /dev/null @@ -1,412 +0,0 @@ -/*- - * Copyright (c) 2004, 2005, 2006 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -/* - * Read the NativeInteger.h for the explanation wrt. differences between - * INTEGER and NativeInteger. - * Basically, both are decoders and encoders of ASN.1 INTEGER type, but this - * implementation deals with the standard (machine-specific) representation - * of them instead of using the platform-independent buffer. - */ -#include -#include - -/* - * NativeInteger basic type description. - */ -static ber_tlv_tag_t asn_DEF_NativeInteger_tags[] = { - (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) -}; -asn_TYPE_descriptor_t asn_DEF_NativeInteger = { - "INTEGER", /* The ASN.1 type is still INTEGER */ - "INTEGER", - NativeInteger_free, - NativeInteger_print, - asn_generic_no_constraint, - NativeInteger_decode_ber, - NativeInteger_encode_der, - NativeInteger_decode_xer, - NativeInteger_encode_xer, - NativeInteger_decode_uper, /* Unaligned PER decoder */ - NativeInteger_encode_uper, /* Unaligned PER encoder */ - NativeInteger_decode_aper, /* Aligned PER decoder */ - NativeInteger_encode_aper, /* Aligned PER encoder */ - 0, /* Use generic outmost tag fetcher */ - asn_DEF_NativeInteger_tags, - sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]), - asn_DEF_NativeInteger_tags, /* Same as above */ - sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]), - 0, /* No PER visible constraints */ - 0, 0, /* No members */ - 0 /* No specifics */ -}; - -/* - * Decode INTEGER type. - */ -asn_dec_rval_t -NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, - void **nint_ptr, const void *buf_ptr, size_t size, int tag_mode) { - asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; - long *native = (long *)*nint_ptr; - asn_dec_rval_t rval; - ber_tlv_len_t length; - - /* - * If the structure is not there, allocate it. - */ - if(native == NULL) { - native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native))); - if(native == NULL) { - rval.code = RC_FAIL; - rval.consumed = 0; - return rval; - } - } - - ASN_DEBUG("Decoding %s as INTEGER (tm=%d)", - td->name, tag_mode); - - /* - * Check tags. - */ - rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size, - tag_mode, 0, &length, 0); - if(rval.code != RC_OK) - return rval; - - ASN_DEBUG("%s length is %d bytes", td->name, (int)length); - - /* - * Make sure we have this length. - */ - buf_ptr = ((const char *)buf_ptr) + rval.consumed; - size -= rval.consumed; - if(length > (ber_tlv_len_t)size) { - rval.code = RC_WMORE; - rval.consumed = 0; - return rval; - } - - /* - * ASN.1 encoded INTEGER: buf_ptr, length - * Fill the native, at the same time checking for overflow. - * If overflow occured, return with RC_FAIL. - */ - { - INTEGER_t tmp; - union { - const void *constbuf; - void *nonconstbuf; - } unconst_buf; - long l; - - unconst_buf.constbuf = buf_ptr; - tmp.buf = (uint8_t *)unconst_buf.nonconstbuf; - tmp.size = length; - - if((specs&&specs->field_unsigned) - ? asn_INTEGER2ulong(&tmp, (unsigned long *)&l) /* sic */ - : asn_INTEGER2long(&tmp, &l)) { - rval.code = RC_FAIL; - rval.consumed = 0; - return rval; - } - - *native = l; - } - - rval.code = RC_OK; - rval.consumed += length; - - ASN_DEBUG("Took %ld/%ld bytes to encode %s (%ld)", - (long)rval.consumed, (long)length, td->name, (long)*native); - - return rval; -} - -/* - * Encode the NativeInteger using the standard INTEGER type DER encoder. - */ -asn_enc_rval_t -NativeInteger_encode_der(asn_TYPE_descriptor_t *sd, void *ptr, - int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { - unsigned long native = *(unsigned long *)ptr; /* Disable sign ext. */ - asn_enc_rval_t erval; - INTEGER_t tmp; - -#ifdef WORDS_BIGENDIAN /* Opportunistic optimization */ - - tmp.buf = (uint8_t *)&native; - tmp.size = sizeof(native); - -#else /* Works even if WORDS_BIGENDIAN is not set where should've been */ - uint8_t buf[sizeof(native)]; - uint8_t *p; - - /* Prepare a fake INTEGER */ - for(p = buf + sizeof(buf) - 1; p >= buf; p--, native >>= 8) - *p = (uint8_t)native; - - tmp.buf = buf; - tmp.size = sizeof(buf); -#endif /* WORDS_BIGENDIAN */ - - /* Encode fake INTEGER */ - erval = INTEGER_encode_der(sd, &tmp, tag_mode, tag, cb, app_key); - if(erval.encoded == -1) { - assert(erval.structure_ptr == &tmp); - erval.structure_ptr = ptr; - } - return erval; -} - -/* - * Decode the chunk of XML text encoding INTEGER. - */ -asn_dec_rval_t -NativeInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, - const void *buf_ptr, size_t size) { - asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; - asn_dec_rval_t rval; - INTEGER_t st; - void *st_ptr = (void *)&st; - long *native = (long *)*sptr; - - if(!native) { - native = (long *)(*sptr = CALLOC(1, sizeof(*native))); - if(!native) _ASN_DECODE_FAILED; - } - - memset(&st, 0, sizeof(st)); - rval = INTEGER_decode_xer(opt_codec_ctx, td, &st_ptr, - opt_mname, buf_ptr, size); - if(rval.code == RC_OK) { - long l; - if((specs&&specs->field_unsigned) - ? asn_INTEGER2ulong(&st, (unsigned long *)&l) /* sic */ - : asn_INTEGER2long(&st, &l)) { - rval.code = RC_FAIL; - rval.consumed = 0; - } else { - *native = l; - } - } else { - /* - * Cannot restart from the middle; - * there is no place to save state in the native type. - * Request a continuation from the very beginning. - */ - rval.consumed = 0; - } - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &st); - return rval; -} - - -asn_enc_rval_t -NativeInteger_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; - char scratch[32]; /* Enough for 64-bit int */ - asn_enc_rval_t er; - const long *native = (const long *)sptr; - - (void)ilevel; - (void)flags; - - if(!native) _ASN_ENCODE_FAILED; - - er.encoded = snprintf(scratch, sizeof(scratch), - (specs && specs->field_unsigned) - ? "%lu" : "%ld", *native); - if(er.encoded <= 0 || (size_t)er.encoded >= sizeof(scratch) - || cb(scratch, er.encoded, app_key) < 0) - _ASN_ENCODE_FAILED; - - _ASN_ENCODED_OK(er); -} - -asn_dec_rval_t -NativeInteger_decode_uper(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { - - asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; - asn_dec_rval_t rval; - long *native = (long *)*sptr; - INTEGER_t tmpint; - void *tmpintptr = &tmpint; - - (void)opt_codec_ctx; - ASN_DEBUG("Decoding NativeInteger %s (UPER)", td->name); - - if(!native) { - native = (long *)(*sptr = CALLOC(1, sizeof(*native))); - if(!native) _ASN_DECODE_FAILED; - } - - memset(&tmpint, 0, sizeof tmpint); - rval = INTEGER_decode_uper(opt_codec_ctx, td, constraints, - &tmpintptr, pd); - if(rval.code == RC_OK) { - if((specs&&specs->field_unsigned) - ? asn_INTEGER2ulong(&tmpint, (unsigned long *)native) - : asn_INTEGER2long(&tmpint, native)) - rval.code = RC_FAIL; - else - ASN_DEBUG("NativeInteger %s got value %ld", - td->name, *native); - } - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); - - return rval; -} - -asn_dec_rval_t -NativeInteger_decode_aper(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { - - asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; - asn_dec_rval_t rval; - long *native = (long *)*sptr; - INTEGER_t tmpint; - void *tmpintptr = &tmpint; - //int dynamic = 0; - - (void)opt_codec_ctx; - ASN_DEBUG("Decoding NativeInteger %s (APER)", td->name); - - if(!native) { - native = (long *)(*sptr = CALLOC(1, sizeof(*native))); - //dynamic = 1; - if(!native) _ASN_DECODE_FAILED; - } - - memset(&tmpint, 0, sizeof tmpint); - rval = INTEGER_decode_aper(opt_codec_ctx, td, constraints, - &tmpintptr, pd); - if(rval.code == RC_OK) { - if((specs&&specs->field_unsigned) - ? asn_INTEGER2ulong(&tmpint, (unsigned long *)native) - : asn_INTEGER2long(&tmpint, native)) - rval.code = RC_FAIL; - else - ASN_DEBUG("NativeInteger %s got value %ld", - td->name, *native); - } - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); - //if (dynamic) - // free(native); - - return rval; -} - -asn_enc_rval_t -NativeInteger_encode_uper(asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { - asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; - asn_enc_rval_t er; - long native; - INTEGER_t tmpint; - - if(!sptr) _ASN_ENCODE_FAILED; - - native = *(long *)sptr; - - ASN_DEBUG("Encoding NativeInteger %s %ld (UPER)", td->name, native); - - memset(&tmpint, 0, sizeof(tmpint)); - if((specs&&specs->field_unsigned) - ? asn_ulong2INTEGER(&tmpint, native) - : asn_long2INTEGER(&tmpint, native)) - _ASN_ENCODE_FAILED; - er = INTEGER_encode_uper(td, constraints, &tmpint, po); - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); - return er; -} - -asn_enc_rval_t -NativeInteger_encode_aper( - asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { - - asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; - asn_enc_rval_t er; - INTEGER_t tmpint; - - if(!sptr) _ASN_ENCODE_FAILED; - memset(&tmpint, 0, sizeof(tmpint)); - - if(specs&&specs->field_unsigned) { - unsigned long native; - native = *(unsigned long *)sptr; - - ASN_DEBUG("Encoding NativeInteger %s %lu (APER) (unsigned)", td->name, native); - - if(asn_ulong2INTEGER(&tmpint, native)) - _ASN_ENCODE_FAILED; - } else { - long native; - native = *(long *)sptr; - - ASN_DEBUG("Encoding NativeInteger %s %ld (APER) (unsigned)", td->name, native); - if(asn_long2INTEGER(&tmpint, native)) - _ASN_ENCODE_FAILED; - } - -// if((specs&&specs->field_unsigned) -// ? asn_ulong2INTEGER(&tmpint, native) -// : asn_long2INTEGER(&tmpint, native)) -// _ASN_ENCODE_FAILED; - er = INTEGER_encode_aper(td, constraints, &tmpint, po); - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); - return er; -} - -/* - * INTEGER specific human-readable output. - */ -int -NativeInteger_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; - const long *native = (const long *)sptr; - char scratch[32]; /* Enough for 64-bit int */ - int ret; - - (void)td; /* Unused argument */ - (void)ilevel; /* Unused argument */ - - if(native) { - ret = snprintf(scratch, sizeof(scratch), - (specs && specs->field_unsigned) - ? "%lu" : "%ld", *native); - assert(ret > 0 && (size_t)ret < sizeof(scratch)); - return (cb(scratch, ret, app_key) < 0) ? -1 : 0; - } else { - return (cb("", 8, app_key) < 0) ? -1 : 0; - } -} - -void -NativeInteger_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { - - if(!td || !ptr) - return; - - ASN_DEBUG("Freeing %s as INTEGER (%d, %p, Native)", - td->name, contents_only, ptr); - - if(!contents_only) { - FREEMEM(ptr); - } -} - diff --git a/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff b/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff new file mode 100644 index 0000000000..c1649fd6f7 --- /dev/null +++ b/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff @@ -0,0 +1,8 @@ +282c282 +< int dynamic = 0; +--- +> //int dynamic = 0; +289c289 +< dynamic = 1; +--- +> //dynamic = 1; diff --git a/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c b/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c deleted file mode 100644 index 3e2d23b254..0000000000 --- a/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c +++ /dev/null @@ -1,1041 +0,0 @@ -/*- - * Copyright (c) 2003, 2004, 2005 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include - -/* - * Number of bytes left for this structure. - * (ctx->left) indicates the number of bytes _transferred_ for the structure. - * (size) contains the number of bytes in the buffer passed. - */ -#define LEFT ((size<(size_t)ctx->left)?size:(size_t)ctx->left) - -/* - * If the subprocessor function returns with an indication that it wants - * more data, it may well be a fatal decoding problem, because the - * size is constrained by the 's L, even if the buffer size allows - * reading more data. - * For example, consider the buffer containing the following TLVs: - * ... - * The TLV length clearly indicates that one byte is expected in V, but - * if the V processor returns with "want more data" even if the buffer - * contains way more data than the V processor have seen. - */ -#define SIZE_VIOLATION (ctx->left >= 0 && (size_t)ctx->left <= size) - -/* - * This macro "eats" the part of the buffer which is definitely "consumed", - * i.e. was correctly converted into local representation or rightfully skipped. - */ -#undef ADVANCE -#define ADVANCE(num_bytes) do { \ - size_t num = num_bytes; \ - ptr = ((const char *)ptr) + num;\ - size -= num; \ - if(ctx->left >= 0) \ - ctx->left -= num; \ - consumed_myself += num; \ - } while(0) - -/* - * Switch to the next phase of parsing. - */ -#undef NEXT_PHASE -#undef PHASE_OUT -#define NEXT_PHASE(ctx) do { \ - ctx->phase++; \ - ctx->step = 0; \ - } while(0) -#define PHASE_OUT(ctx) do { ctx->phase = 10; } while(0) - -/* - * Return a standardized complex structure. - */ -#undef RETURN -#define RETURN(_code) do { \ - rval.code = _code; \ - rval.consumed = consumed_myself;\ - return rval; \ - } while(0) - -/* - * The decoder of the SET OF type. - */ -asn_dec_rval_t -SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **struct_ptr, const void *ptr, size_t size, int tag_mode) { - /* - * Bring closer parts of structure description. - */ - asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; - asn_TYPE_member_t *elm = td->elements; /* Single one */ - - /* - * Parts of the structure being constructed. - */ - void *st = *struct_ptr; /* Target structure. */ - asn_struct_ctx_t *ctx; /* Decoder context */ - - ber_tlv_tag_t tlv_tag; /* T from TLV */ - asn_dec_rval_t rval; /* Return code from subparsers */ - - ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ - - ASN_DEBUG("Decoding %s as SET OF", td->name); - - /* - * Create the target structure if it is not present already. - */ - if(st == 0) { - st = *struct_ptr = CALLOC(1, specs->struct_size); - if(st == 0) { - RETURN(RC_FAIL); - } - } - - /* - * Restore parsing context. - */ - ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); - - /* - * Start to parse where left previously - */ - switch(ctx->phase) { - case 0: - /* - * PHASE 0. - * Check that the set of tags associated with given structure - * perfectly fits our expectations. - */ - - rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size, - tag_mode, 1, &ctx->left, 0); - if(rval.code != RC_OK) { - ASN_DEBUG("%s tagging check failed: %d", - td->name, rval.code); - return rval; - } - - if(ctx->left >= 0) - ctx->left += rval.consumed; /* ?Substracted below! */ - ADVANCE(rval.consumed); - - ASN_DEBUG("Structure consumes %ld bytes, " - "buffer %ld", (long)ctx->left, (long)size); - - NEXT_PHASE(ctx); - /* Fall through */ - case 1: - /* - * PHASE 1. - * From the place where we've left it previously, - * try to decode the next item. - */ - for(;; ctx->step = 0) { - ssize_t tag_len; /* Length of TLV's T */ - - if(ctx->step & 1) - goto microphase2; - - /* - * MICROPHASE 1: Synchronize decoding. - */ - - if(ctx->left == 0) { - ASN_DEBUG("End of SET OF %s", td->name); - /* - * No more things to decode. - * Exit out of here. - */ - PHASE_OUT(ctx); - RETURN(RC_OK); - } - - /* - * Fetch the T from TLV. - */ - tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag); - switch(tag_len) { - case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); - /* Fall through */ - case -1: RETURN(RC_FAIL); - } - - if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) { - if(LEFT < 2) { - if(SIZE_VIOLATION) - RETURN(RC_FAIL); - else - RETURN(RC_WMORE); - } else if(((const uint8_t *)ptr)[1] == 0) { - /* - * Found the terminator of the - * indefinite length structure. - */ - break; - } - } - - /* Outmost tag may be unknown and cannot be fetched/compared */ - if(elm->tag != (ber_tlv_tag_t)-1) { - if(BER_TAGS_EQUAL(tlv_tag, elm->tag)) { - /* - * The new list member of expected type has arrived. - */ - } else { - ASN_DEBUG("Unexpected tag %s fixed SET OF %s", - ber_tlv_tag_string(tlv_tag), td->name); - ASN_DEBUG("%s SET OF has tag %s", - td->name, ber_tlv_tag_string(elm->tag)); - RETURN(RC_FAIL); - } - } - - /* - * MICROPHASE 2: Invoke the member-specific decoder. - */ - ctx->step |= 1; /* Confirm entering next microphase */ - microphase2: - - /* - * Invoke the member fetch routine according to member's type - */ - rval = elm->type->ber_decoder(opt_codec_ctx, - elm->type, &ctx->ptr, ptr, LEFT, 0); - ASN_DEBUG("In %s SET OF %s code %d consumed %d", - td->name, elm->type->name, - rval.code, (int)rval.consumed); - switch(rval.code) { - case RC_OK: - { - asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); - if(ASN_SET_ADD(list, ctx->ptr) != 0) - RETURN(RC_FAIL); - else - ctx->ptr = 0; - } - break; - case RC_WMORE: /* More data expected */ - if(!SIZE_VIOLATION) { - ADVANCE(rval.consumed); - RETURN(RC_WMORE); - } - /* Fall through */ - case RC_FAIL: /* Fatal error */ - ASN_STRUCT_FREE(*elm->type, ctx->ptr); - ctx->ptr = 0; - RETURN(RC_FAIL); - } /* switch(rval) */ - - ADVANCE(rval.consumed); - } /* for(all list members) */ - - NEXT_PHASE(ctx); - case 2: - /* - * Read in all "end of content" TLVs. - */ - while(ctx->left < 0) { - if(LEFT < 2) { - if(LEFT > 0 && ((const char *)ptr)[0] != 0) { - /* Unexpected tag */ - RETURN(RC_FAIL); - } else { - RETURN(RC_WMORE); - } - } - if(((const char *)ptr)[0] == 0 - && ((const char *)ptr)[1] == 0) { - ADVANCE(2); - ctx->left++; - } else { - RETURN(RC_FAIL); - } - } - - PHASE_OUT(ctx); - } - - RETURN(RC_OK); -} - -/* - * Internally visible buffer holding a single encoded element. - */ -struct _el_buffer { - uint8_t *buf; - size_t length; - size_t size; -}; -/* Append bytes to the above structure */ -static int _el_addbytes(const void *buffer, size_t size, void *el_buf_ptr) { - struct _el_buffer *el_buf = (struct _el_buffer *)el_buf_ptr; - - if(el_buf->length + size > el_buf->size) - return -1; - - memcpy(el_buf->buf + el_buf->length, buffer, size); - - el_buf->length += size; - return 0; -} -static int _el_buf_cmp(const void *ap, const void *bp) { - const struct _el_buffer *a = (const struct _el_buffer *)ap; - const struct _el_buffer *b = (const struct _el_buffer *)bp; - int ret; - size_t common_len; - - if(a->length < b->length) - common_len = a->length; - else - common_len = b->length; - - ret = memcmp(a->buf, b->buf, common_len); - if(ret == 0) { - if(a->length < b->length) - ret = -1; - else if(a->length > b->length) - ret = 1; - } - - return ret; -} - -/* - * The DER encoder of the SET OF type. - */ -asn_enc_rval_t -SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, - int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_TYPE_member_t *elm = td->elements; - asn_TYPE_descriptor_t *elm_type = elm->type; - der_type_encoder_f *der_encoder = elm_type->der_encoder; - asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr); - size_t computed_size = 0; - ssize_t encoding_size = 0; - struct _el_buffer *encoded_els; - ssize_t eels_count = 0; - size_t max_encoded_len = 1; - asn_enc_rval_t erval; - int ret; - int edx; - - ASN_DEBUG("Estimating size for SET OF %s", td->name); - - /* - * Gather the length of the underlying members sequence. - */ - for(edx = 0; edx < list->count; edx++) { - void *memb_ptr = list->array[edx]; - if(!memb_ptr) continue; - erval = der_encoder(elm_type, memb_ptr, 0, elm->tag, 0, 0); - if(erval.encoded == -1) - return erval; - computed_size += erval.encoded; - - /* Compute maximum encoding's size */ - if(max_encoded_len < (size_t)erval.encoded) - max_encoded_len = erval.encoded; - } - - /* - * Encode the TLV for the sequence itself. - */ - encoding_size = der_write_tags(td, computed_size, tag_mode, 1, tag, - cb, app_key); - if(encoding_size == -1) { - erval.encoded = -1; - erval.failed_type = td; - erval.structure_ptr = ptr; - return erval; - } - computed_size += encoding_size; - - if(!cb || list->count == 0) { - erval.encoded = computed_size; - _ASN_ENCODED_OK(erval); - } - - /* - * DER mandates dynamic sorting of the SET OF elements - * according to their encodings. Build an array of the - * encoded elements. - */ - encoded_els = (struct _el_buffer *)MALLOC( - list->count * sizeof(encoded_els[0])); - if(encoded_els == NULL) { - erval.encoded = -1; - erval.failed_type = td; - erval.structure_ptr = ptr; - return erval; - } - - ASN_DEBUG("Encoding members of %s SET OF", td->name); - - /* - * Encode all members. - */ - for(edx = 0; edx < list->count; edx++) { - void *memb_ptr = list->array[edx]; - struct _el_buffer *encoded_el = &encoded_els[eels_count]; - - if(!memb_ptr) continue; - - /* - * Prepare space for encoding. - */ - encoded_el->buf = (uint8_t *)MALLOC(max_encoded_len); - if(encoded_el->buf) { - encoded_el->length = 0; - encoded_el->size = max_encoded_len; - } else { - for(edx--; edx >= 0; edx--) - FREEMEM(encoded_els[edx].buf); - FREEMEM(encoded_els); - erval.encoded = -1; - erval.failed_type = td; - erval.structure_ptr = ptr; - return erval; - } - - /* - * Encode the member into the prepared space. - */ - erval = der_encoder(elm_type, memb_ptr, 0, elm->tag, - _el_addbytes, encoded_el); - if(erval.encoded == -1) { - for(; edx >= 0; edx--) - FREEMEM(encoded_els[edx].buf); - FREEMEM(encoded_els); - return erval; - } - encoding_size += erval.encoded; - eels_count++; - } - - /* - * Sort the encoded elements according to their encoding. - */ - qsort(encoded_els, eels_count, sizeof(encoded_els[0]), _el_buf_cmp); - - /* - * Report encoded elements to the application. - * Dispose of temporary sorted members table. - */ - ret = 0; - for(edx = 0; edx < eels_count; edx++) { - struct _el_buffer *encoded_el = &encoded_els[edx]; - /* Report encoded chunks to the application */ - if(ret == 0 - && cb(encoded_el->buf, encoded_el->length, app_key) < 0) - ret = -1; - FREEMEM(encoded_el->buf); - } - FREEMEM(encoded_els); - - if(ret || computed_size != (size_t)encoding_size) { - /* - * Standard callback failed, or - * encoded size is not equal to the computed size. - */ - erval.encoded = -1; - erval.failed_type = td; - erval.structure_ptr = ptr; - } else { - erval.encoded = computed_size; - } - - _ASN_ENCODED_OK(erval); -} - -#undef XER_ADVANCE -#define XER_ADVANCE(num_bytes) do { \ - size_t num = num_bytes; \ - buf_ptr = ((const char *)buf_ptr) + num;\ - size -= num; \ - consumed_myself += num; \ - } while(0) - -/* - * Decode the XER (XML) data. - */ -asn_dec_rval_t -SET_OF_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **struct_ptr, const char *opt_mname, - const void *buf_ptr, size_t size) { - /* - * Bring closer parts of structure description. - */ - asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; - asn_TYPE_member_t *element = td->elements; - const char *elm_tag; - const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; - - /* - * ... and parts of the structure being constructed. - */ - void *st = *struct_ptr; /* Target structure. */ - asn_struct_ctx_t *ctx; /* Decoder context */ - - asn_dec_rval_t rval; /* Return value from a decoder */ - ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ - - /* - * Create the target structure if it is not present already. - */ - if(st == 0) { - st = *struct_ptr = CALLOC(1, specs->struct_size); - if(st == 0) RETURN(RC_FAIL); - } - - /* Which tag is expected for the downstream */ - if(specs->as_XMLValueList) { - elm_tag = (specs->as_XMLValueList == 1) ? 0 : ""; - } else { - elm_tag = (*element->name) - ? element->name : element->type->xml_tag; - } - - /* - * Restore parsing context. - */ - ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); - - /* - * Phases of XER/XML processing: - * Phase 0: Check that the opening tag matches our expectations. - * Phase 1: Processing body and reacting on closing tag. - * Phase 2: Processing inner type. - */ - for(; ctx->phase <= 2;) { - pxer_chunk_type_e ch_type; /* XER chunk type */ - ssize_t ch_size; /* Chunk size */ - xer_check_tag_e tcv; /* Tag check value */ - - /* - * Go inside the inner member of a set. - */ - if(ctx->phase == 2) { - asn_dec_rval_t tmprval; - - /* Invoke the inner type decoder, m.b. multiple times */ - ASN_DEBUG("XER/SET OF element [%s]", elm_tag); - tmprval = element->type->xer_decoder(opt_codec_ctx, - element->type, &ctx->ptr, elm_tag, - buf_ptr, size); - if(tmprval.code == RC_OK) { - asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); - if(ASN_SET_ADD(list, ctx->ptr) != 0) - RETURN(RC_FAIL); - ctx->ptr = 0; - XER_ADVANCE(tmprval.consumed); - } else { - XER_ADVANCE(tmprval.consumed); - RETURN(tmprval.code); - } - ctx->phase = 1; /* Back to body processing */ - ASN_DEBUG("XER/SET OF phase => %d", ctx->phase); - /* Fall through */ - } - - /* - * Get the next part of the XML stream. - */ - ch_size = xer_next_token(&ctx->context, - buf_ptr, size, &ch_type); - switch(ch_size) { - case -1: RETURN(RC_FAIL); - case 0: RETURN(RC_WMORE); - default: - switch(ch_type) { - case PXER_COMMENT: /* Got XML comment */ - case PXER_TEXT: /* Ignore free-standing text */ - XER_ADVANCE(ch_size); /* Skip silently */ - continue; - case PXER_TAG: - break; /* Check the rest down there */ - } - } - - tcv = xer_check_tag(buf_ptr, ch_size, xml_tag); - ASN_DEBUG("XER/SET OF: tcv = %d, ph=%d t=%s", - tcv, ctx->phase, xml_tag); - switch(tcv) { - case XCT_CLOSING: - if(ctx->phase == 0) break; - ctx->phase = 0; - /* Fall through */ - case XCT_BOTH: - if(ctx->phase == 0) { - /* No more things to decode */ - XER_ADVANCE(ch_size); - ctx->phase = 3; /* Phase out */ - RETURN(RC_OK); - } - /* Fall through */ - case XCT_OPENING: - if(ctx->phase == 0) { - XER_ADVANCE(ch_size); - ctx->phase = 1; /* Processing body phase */ - continue; - } - /* Fall through */ - case XCT_UNKNOWN_OP: - case XCT_UNKNOWN_BO: - - ASN_DEBUG("XER/SET OF: tcv=%d, ph=%d", tcv, ctx->phase); - if(ctx->phase == 1) { - /* - * Process a single possible member. - */ - ctx->phase = 2; - continue; - } - /* Fall through */ - default: - break; - } - - ASN_DEBUG("Unexpected XML tag in SET OF"); - break; - } - - ctx->phase = 3; /* "Phase out" on hard failure */ - RETURN(RC_FAIL); -} - - - -typedef struct xer_tmp_enc_s { - void *buffer; - size_t offset; - size_t size; -} xer_tmp_enc_t; -static int -SET_OF_encode_xer_callback(const void *buffer, size_t size, void *key) { - xer_tmp_enc_t *t = (xer_tmp_enc_t *)key; - if(t->offset + size >= t->size) { - size_t newsize = (t->size << 2) + size; - void *p = REALLOC(t->buffer, newsize); - if(!p) return -1; - t->buffer = p; - t->size = newsize; - } - memcpy((char *)t->buffer + t->offset, buffer, size); - t->offset += size; - return 0; -} -static int -SET_OF_xer_order(const void *aptr, const void *bptr) { - const xer_tmp_enc_t *a = (const xer_tmp_enc_t *)aptr; - const xer_tmp_enc_t *b = (const xer_tmp_enc_t *)bptr; - size_t minlen = a->offset; - int ret; - if(b->offset < minlen) minlen = b->offset; - /* Well-formed UTF-8 has this nice lexicographical property... */ - ret = memcmp(a->buffer, b->buffer, minlen); - if(ret != 0) return ret; - if(a->offset == b->offset) - return 0; - if(a->offset == minlen) - return -1; - return 1; -} - - -asn_enc_rval_t -SET_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_enc_rval_t er; - asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; - asn_TYPE_member_t *elm = td->elements; - asn_anonymous_set_ *list = _A_SET_FROM_VOID(sptr); - const char *mname = specs->as_XMLValueList - ? 0 : ((*elm->name) ? elm->name : elm->type->xml_tag); - size_t mlen = mname ? strlen(mname) : 0; - int xcan = (flags & XER_F_CANONICAL); - xer_tmp_enc_t *encs = 0; - size_t encs_count = 0; - void *original_app_key = app_key; - asn_app_consume_bytes_f *original_cb = cb; - int i; - - if(!sptr) _ASN_ENCODE_FAILED; - - if(xcan) { - encs = (xer_tmp_enc_t *)MALLOC(list->count * sizeof(encs[0])); - if(!encs) _ASN_ENCODE_FAILED; - cb = SET_OF_encode_xer_callback; - } - - er.encoded = 0; - - for(i = 0; i < list->count; i++) { - asn_enc_rval_t tmper; - - void *memb_ptr = list->array[i]; - if(!memb_ptr) continue; - - if(encs) { - memset(&encs[encs_count], 0, sizeof(encs[0])); - app_key = &encs[encs_count]; - encs_count++; - } - - if(mname) { - if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel); - _ASN_CALLBACK3("<", 1, mname, mlen, ">", 1); - } - - if(!xcan && specs->as_XMLValueList == 1) - _i_ASN_TEXT_INDENT(1, ilevel + 1); - tmper = elm->type->xer_encoder(elm->type, memb_ptr, - ilevel + (specs->as_XMLValueList != 2), - flags, cb, app_key); - if(tmper.encoded == -1) { - td = tmper.failed_type; - sptr = tmper.structure_ptr; - goto cb_failed; - } - if(tmper.encoded == 0 && specs->as_XMLValueList) { - const char *name = elm->type->xml_tag; - size_t len = strlen(name); - _ASN_CALLBACK3("<", 1, name, len, "/>", 2); - } - - if(mname) { - _ASN_CALLBACK3("", 1); - er.encoded += 5; - } - - er.encoded += (2 * mlen) + tmper.encoded; - } - - if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel - 1); - - if(encs) { - xer_tmp_enc_t *enc = encs; - xer_tmp_enc_t *end = encs + encs_count; - ssize_t control_size = 0; - - cb = original_cb; - app_key = original_app_key; - qsort(encs, encs_count, sizeof(encs[0]), SET_OF_xer_order); - - for(; enc < end; enc++) { - _ASN_CALLBACK(enc->buffer, enc->offset); - FREEMEM(enc->buffer); - enc->buffer = 0; - control_size += enc->offset; - } - assert(control_size == er.encoded); - } - - goto cleanup; -cb_failed: - er.encoded = -1; - er.failed_type = td; - er.structure_ptr = sptr; -cleanup: - if(encs) { - while(encs_count-- > 0) { - if(encs[encs_count].buffer) - FREEMEM(encs[encs_count].buffer); - } - FREEMEM(encs); - } - _ASN_ENCODED_OK(er); -} - -int -SET_OF_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_TYPE_member_t *elm = td->elements; - const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); - int ret; - int i; - - if(!sptr) return (cb("", 8, app_key) < 0) ? -1 : 0; - - /* Dump preamble */ - if(cb(td->name, strlen(td->name), app_key) < 0 - || cb(" ::= {", 6, app_key) < 0) - return -1; - - for(i = 0; i < list->count; i++) { - const void *memb_ptr = list->array[i]; - if(!memb_ptr) continue; - - _i_INDENT(1); - - ret = elm->type->print_struct(elm->type, memb_ptr, - ilevel + 1, cb, app_key); - if(ret) return ret; - } - - ilevel--; - _i_INDENT(1); - - return (cb("}", 1, app_key) < 0) ? -1 : 0; -} - -void -SET_OF_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { - if(td && ptr) { - asn_SET_OF_specifics_t *specs; - asn_TYPE_member_t *elm = td->elements; - asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr); - asn_struct_ctx_t *ctx; /* Decoder context */ - int i; - - /* - * Could not use set_of_empty() because of (*free) - * incompatibility. - */ - for(i = 0; i < list->count; i++) { - void *memb_ptr = list->array[i]; - if(memb_ptr) - ASN_STRUCT_FREE(*elm->type, memb_ptr); - } - list->count = 0; /* No meaningful elements left */ - - asn_set_empty(list); /* Remove (list->array) */ - - specs = (asn_SET_OF_specifics_t *)td->specifics; - ctx = (asn_struct_ctx_t *)((char *)ptr + specs->ctx_offset); - if(ctx->ptr) { - ASN_STRUCT_FREE(*elm->type, ctx->ptr); - ctx->ptr = 0; - } - - if(!contents_only) { - FREEMEM(ptr); - } - } -} - -int -SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { - asn_TYPE_member_t *elm = td->elements; - asn_constr_check_f *constr; - const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); - int i; - - if(!sptr) { - _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } - - constr = elm->memb_constraints; - if(!constr) constr = elm->type->check_constraints; - - /* - * Iterate over the members of an array. - * Validate each in turn, until one fails. - */ - for(i = 0; i < list->count; i++) { - const void *memb_ptr = list->array[i]; - int ret; - - if(!memb_ptr) continue; - - ret = constr(elm->type, memb_ptr, ctfailcb, app_key); - if(ret) return ret; - } - - /* - * Cannot inherit it eralier: - * need to make sure we get the updated version. - */ - if(!elm->memb_constraints) - elm->memb_constraints = elm->type->check_constraints; - - return 0; -} - -asn_dec_rval_t -SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { - asn_dec_rval_t rv; - asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; - asn_TYPE_member_t *elm = td->elements; /* Single one */ - void *st = *sptr; - asn_anonymous_set_ *list; - asn_per_constraint_t *ct; - int repeat = 0; - ssize_t nelems; - - if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx)) - _ASN_DECODE_FAILED; - - /* - * Create the target structure if it is not present already. - */ - if(!st) { - st = *sptr = CALLOC(1, specs->struct_size); - if(!st) _ASN_DECODE_FAILED; - } - list = _A_SET_FROM_VOID(st); - - /* Figure out which constraints to use */ - if(constraints) ct = &constraints->size; - else if(td->per_constraints) ct = &td->per_constraints->size; - else ct = 0; - - if(ct && ct->flags & APC_EXTENSIBLE) { - int value = per_get_few_bits(pd, 1); - if(value < 0) _ASN_DECODE_STARVED; - if(value) ct = 0; /* Not restricted! */ - } - - if(ct && ct->effective_bits >= 0) { - /* X.691, #19.5: No length determinant */ - nelems = per_get_few_bits(pd, ct->effective_bits); - ASN_DEBUG("Preparing to fetch %ld+%"PRIdMAX" elements from %s", - (long)nelems, ct->lower_bound, td->name); - if(nelems < 0) _ASN_DECODE_STARVED; - nelems += ct->lower_bound; - } else { - nelems = -1; - } - - do { - int i; - if(nelems < 0) { - nelems = uper_get_length(pd, - ct ? ct->effective_bits : -1, &repeat); - ASN_DEBUG("Got to decode %d elements (eff %d)", - (int)nelems, (int)(ct ? ct->effective_bits : -1)); - if(nelems < 0) _ASN_DECODE_STARVED; - } - - for(i = 0; i < nelems; i++) { - void *ptr = 0; - ASN_DEBUG("SET OF %s decoding", elm->type->name); - rv = elm->type->uper_decoder(opt_codec_ctx, elm->type, - elm->per_constraints, &ptr, pd); - ASN_DEBUG("%s SET OF %s decoded %d, %p", - td->name, elm->type->name, rv.code, ptr); - if(rv.code == RC_OK) { - if(ASN_SET_ADD(list, ptr) == 0) - continue; - ASN_DEBUG("Failed to add element into %s", - td->name); - /* Fall through */ - rv.code = RC_FAIL; - } else { - ASN_DEBUG("Failed decoding %s of %s (SET OF)", - elm->type->name, td->name); - } - if(ptr) ASN_STRUCT_FREE(*elm->type, ptr); - return rv; - } - - nelems = -1; /* Allow uper_get_length() */ - } while(repeat); - - ASN_DEBUG("Decoded %s as SET OF", td->name); - - rv.code = RC_OK; - rv.consumed = 0; - return rv; -} - -asn_dec_rval_t -SET_OF_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { - asn_dec_rval_t rv; - asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; - asn_TYPE_member_t *elm = td->elements; /* Single one */ - void *st = *sptr; - asn_anonymous_set_ *list; - asn_per_constraint_t *ct; - int repeat = 0; - ssize_t nelems; - - if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx)) - _ASN_DECODE_FAILED; - - /* - * Create the target structure if it is not present already. - */ - if(!st) { - st = *sptr = CALLOC(1, specs->struct_size); - if(!st) _ASN_DECODE_FAILED; - } - list = _A_SET_FROM_VOID(st); - - /* Figure out which constraints to use */ - if(constraints) ct = &constraints->size; - else if(td->per_constraints) ct = &td->per_constraints->size; - else ct = 0; - - if(ct && ct->flags & APC_EXTENSIBLE) { - int value = per_get_few_bits(pd, 1); - if(value < 0) _ASN_DECODE_STARVED; - if(value) ct = 0; /* Not restricted! */ - } - - if(ct && ct->effective_bits >= 0) { - /* X.691, #19.5: No length determinant */ -// nelems = per_get_few_bits(pd, ct->effective_bits); - nelems = aper_get_nsnnwn(pd, ct->upper_bound - ct->lower_bound); - ASN_DEBUG("Preparing to fetch %ld+%"PRIdMAX" elements from %s", - (long)nelems, ct->lower_bound, td->name); - if(nelems < 0) _ASN_DECODE_STARVED; - nelems += ct->lower_bound; - } else { - nelems = -1; - } - - do { - int i; - if(nelems < 0) { - nelems = aper_get_length(pd, ct ? ct->upper_bound - ct->lower_bound + 1 : -1, - ct ? ct->effective_bits : -1, &repeat); - ASN_DEBUG("Got to decode %d elements (eff %d)", - (int)nelems, ct ? ct->effective_bits : -1); - if(nelems < 0) _ASN_DECODE_STARVED; - } - - for(i = 0; i < nelems; i++) { - void *ptr = 0; - ASN_DEBUG("SET OF %s decoding", elm->type->name); - rv = elm->type->aper_decoder(opt_codec_ctx, elm->type, - elm->per_constraints, &ptr, pd); - ASN_DEBUG("%s SET OF %s decoded %d, %p", - td->name, elm->type->name, rv.code, ptr); - if(rv.code == RC_OK) { - if(ASN_SET_ADD(list, ptr) == 0) - continue; - ASN_DEBUG("Failed to add element into %s", - td->name); - /* Fall through */ - rv.code = RC_FAIL; - } else { - ASN_DEBUG("Failed decoding %s of %s (SET OF)", - elm->type->name, td->name); - } - if(ptr) ASN_STRUCT_FREE(*elm->type, ptr); - return rv; - } - - nelems = -1; /* Allow uper_get_length() */ - } while(repeat); - - ASN_DEBUG("Decoded %s as SET OF", td->name); - - rv.code = RC_OK; - rv.consumed = 0; - return rv; -} diff --git a/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff b/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff new file mode 100644 index 0000000000..3ceaf5e3e5 --- /dev/null +++ b/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff @@ -0,0 +1,4 @@ +1007c1007 +< (int)nelems, (int)ct ? ct->effective_bits : -1); +--- +> (int)nelems, ct ? ct->effective_bits : -1); diff --git a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c deleted file mode 100644 index 239dbdc10f..0000000000 --- a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c +++ /dev/null @@ -1,412 +0,0 @@ -/*- - * Copyright (c) 2004, 2005, 2006 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -/* - * Read the NativeInteger.h for the explanation wrt. differences between - * INTEGER and NativeInteger. - * Basically, both are decoders and encoders of ASN.1 INTEGER type, but this - * implementation deals with the standard (machine-specific) representation - * of them instead of using the platform-independent buffer. - */ -#include -#include - -/* - * NativeInteger basic type description. - */ -static ber_tlv_tag_t asn_DEF_NativeInteger_tags[] = { - (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) -}; -asn_TYPE_descriptor_t asn_DEF_NativeInteger = { - "INTEGER", /* The ASN.1 type is still INTEGER */ - "INTEGER", - NativeInteger_free, - NativeInteger_print, - asn_generic_no_constraint, - NativeInteger_decode_ber, - NativeInteger_encode_der, - NativeInteger_decode_xer, - NativeInteger_encode_xer, - NativeInteger_decode_uper, /* Unaligned PER decoder */ - NativeInteger_encode_uper, /* Unaligned PER encoder */ - NativeInteger_decode_aper, /* Aligned PER decoder */ - NativeInteger_encode_aper, /* Aligned PER encoder */ - 0, /* Use generic outmost tag fetcher */ - asn_DEF_NativeInteger_tags, - sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]), - asn_DEF_NativeInteger_tags, /* Same as above */ - sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]), - 0, /* No PER visible constraints */ - 0, 0, /* No members */ - 0 /* No specifics */ -}; - -/* - * Decode INTEGER type. - */ -asn_dec_rval_t -NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, - void **nint_ptr, const void *buf_ptr, size_t size, int tag_mode) { - asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; - long *native = (long *)*nint_ptr; - asn_dec_rval_t rval; - ber_tlv_len_t length; - - /* - * If the structure is not there, allocate it. - */ - if(native == NULL) { - native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native))); - if(native == NULL) { - rval.code = RC_FAIL; - rval.consumed = 0; - return rval; - } - } - - ASN_DEBUG("Decoding %s as INTEGER (tm=%d)", - td->name, tag_mode); - - /* - * Check tags. - */ - rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size, - tag_mode, 0, &length, 0); - if(rval.code != RC_OK) - return rval; - - ASN_DEBUG("%s length is %d bytes", td->name, (int)length); - - /* - * Make sure we have this length. - */ - buf_ptr = ((const char *)buf_ptr) + rval.consumed; - size -= rval.consumed; - if(length > (ber_tlv_len_t)size) { - rval.code = RC_WMORE; - rval.consumed = 0; - return rval; - } - - /* - * ASN.1 encoded INTEGER: buf_ptr, length - * Fill the native, at the same time checking for overflow. - * If overflow occured, return with RC_FAIL. - */ - { - INTEGER_t tmp; - union { - const void *constbuf; - void *nonconstbuf; - } unconst_buf; - long l; - - unconst_buf.constbuf = buf_ptr; - tmp.buf = (uint8_t *)unconst_buf.nonconstbuf; - tmp.size = length; - - if((specs&&specs->field_unsigned) - ? asn_INTEGER2ulong(&tmp, (unsigned long *)&l) /* sic */ - : asn_INTEGER2long(&tmp, &l)) { - rval.code = RC_FAIL; - rval.consumed = 0; - return rval; - } - - *native = l; - } - - rval.code = RC_OK; - rval.consumed += length; - - ASN_DEBUG("Took %ld/%ld bytes to encode %s (%ld)", - (long)rval.consumed, (long)length, td->name, (long)*native); - - return rval; -} - -/* - * Encode the NativeInteger using the standard INTEGER type DER encoder. - */ -asn_enc_rval_t -NativeInteger_encode_der(asn_TYPE_descriptor_t *sd, void *ptr, - int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { - unsigned long native = *(unsigned long *)ptr; /* Disable sign ext. */ - asn_enc_rval_t erval; - INTEGER_t tmp; - -#ifdef WORDS_BIGENDIAN /* Opportunistic optimization */ - - tmp.buf = (uint8_t *)&native; - tmp.size = sizeof(native); - -#else /* Works even if WORDS_BIGENDIAN is not set where should've been */ - uint8_t buf[sizeof(native)]; - uint8_t *p; - - /* Prepare a fake INTEGER */ - for(p = buf + sizeof(buf) - 1; p >= buf; p--, native >>= 8) - *p = (uint8_t)native; - - tmp.buf = buf; - tmp.size = sizeof(buf); -#endif /* WORDS_BIGENDIAN */ - - /* Encode fake INTEGER */ - erval = INTEGER_encode_der(sd, &tmp, tag_mode, tag, cb, app_key); - if(erval.encoded == -1) { - assert(erval.structure_ptr == &tmp); - erval.structure_ptr = ptr; - } - return erval; -} - -/* - * Decode the chunk of XML text encoding INTEGER. - */ -asn_dec_rval_t -NativeInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, - const void *buf_ptr, size_t size) { - asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; - asn_dec_rval_t rval; - INTEGER_t st; - void *st_ptr = (void *)&st; - long *native = (long *)*sptr; - - if(!native) { - native = (long *)(*sptr = CALLOC(1, sizeof(*native))); - if(!native) _ASN_DECODE_FAILED; - } - - memset(&st, 0, sizeof(st)); - rval = INTEGER_decode_xer(opt_codec_ctx, td, &st_ptr, - opt_mname, buf_ptr, size); - if(rval.code == RC_OK) { - long l; - if((specs&&specs->field_unsigned) - ? asn_INTEGER2ulong(&st, (unsigned long *)&l) /* sic */ - : asn_INTEGER2long(&st, &l)) { - rval.code = RC_FAIL; - rval.consumed = 0; - } else { - *native = l; - } - } else { - /* - * Cannot restart from the middle; - * there is no place to save state in the native type. - * Request a continuation from the very beginning. - */ - rval.consumed = 0; - } - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &st); - return rval; -} - - -asn_enc_rval_t -NativeInteger_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; - char scratch[32]; /* Enough for 64-bit int */ - asn_enc_rval_t er; - const long *native = (const long *)sptr; - - (void)ilevel; - (void)flags; - - if(!native) _ASN_ENCODE_FAILED; - - er.encoded = snprintf(scratch, sizeof(scratch), - (specs && specs->field_unsigned) - ? "%lu" : "%ld", *native); - if(er.encoded <= 0 || (size_t)er.encoded >= sizeof(scratch) - || cb(scratch, er.encoded, app_key) < 0) - _ASN_ENCODE_FAILED; - - _ASN_ENCODED_OK(er); -} - -asn_dec_rval_t -NativeInteger_decode_uper(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { - - asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; - asn_dec_rval_t rval; - long *native = (long *)*sptr; - INTEGER_t tmpint; - void *tmpintptr = &tmpint; - - (void)opt_codec_ctx; - ASN_DEBUG("Decoding NativeInteger %s (UPER)", td->name); - - if(!native) { - native = (long *)(*sptr = CALLOC(1, sizeof(*native))); - if(!native) _ASN_DECODE_FAILED; - } - - memset(&tmpint, 0, sizeof tmpint); - rval = INTEGER_decode_uper(opt_codec_ctx, td, constraints, - &tmpintptr, pd); - if(rval.code == RC_OK) { - if((specs&&specs->field_unsigned) - ? asn_INTEGER2ulong(&tmpint, (unsigned long *)native) - : asn_INTEGER2long(&tmpint, native)) - rval.code = RC_FAIL; - else - ASN_DEBUG("NativeInteger %s got value %ld", - td->name, *native); - } - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); - - return rval; -} - -asn_dec_rval_t -NativeInteger_decode_aper(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { - - asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; - asn_dec_rval_t rval; - long *native = (long *)*sptr; - INTEGER_t tmpint; - void *tmpintptr = &tmpint; - //int dynamic = 0; - - (void)opt_codec_ctx; - ASN_DEBUG("Decoding NativeInteger %s (APER)", td->name); - - if(!native) { - native = (long *)(*sptr = CALLOC(1, sizeof(*native))); - //dynamic = 1; - if(!native) _ASN_DECODE_FAILED; - } - - memset(&tmpint, 0, sizeof tmpint); - rval = INTEGER_decode_aper(opt_codec_ctx, td, constraints, - &tmpintptr, pd); - if(rval.code == RC_OK) { - if((specs&&specs->field_unsigned) - ? asn_INTEGER2ulong(&tmpint, (unsigned long *)native) - : asn_INTEGER2long(&tmpint, native)) - rval.code = RC_FAIL; - else - ASN_DEBUG("NativeInteger %s got value %ld", - td->name, *native); - } - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); - //if (dynamic) - // free(native); - - return rval; -} - -asn_enc_rval_t -NativeInteger_encode_uper(asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { - asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; - asn_enc_rval_t er; - long native; - INTEGER_t tmpint; - - if(!sptr) _ASN_ENCODE_FAILED; - - native = *(long *)sptr; - - ASN_DEBUG("Encoding NativeInteger %s %ld (UPER)", td->name, native); - - memset(&tmpint, 0, sizeof(tmpint)); - if((specs&&specs->field_unsigned) - ? asn_ulong2INTEGER(&tmpint, native) - : asn_long2INTEGER(&tmpint, native)) - _ASN_ENCODE_FAILED; - er = INTEGER_encode_uper(td, constraints, &tmpint, po); - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); - return er; -} - -asn_enc_rval_t -NativeInteger_encode_aper( - asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { - - asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; - asn_enc_rval_t er; - INTEGER_t tmpint; - - if(!sptr) _ASN_ENCODE_FAILED; - memset(&tmpint, 0, sizeof(tmpint)); - - if(specs&&specs->field_unsigned) { - unsigned long native; - native = *(unsigned long *)sptr; - - ASN_DEBUG("Encoding NativeInteger %s %lu (APER) (unsigned)", td->name, native); - - if(asn_ulong2INTEGER(&tmpint, native)) - _ASN_ENCODE_FAILED; - } else { - long native; - native = *(long *)sptr; - - ASN_DEBUG("Encoding NativeInteger %s %ld (APER) (unsigned)", td->name, native); - if(asn_long2INTEGER(&tmpint, native)) - _ASN_ENCODE_FAILED; - } - -// if((specs&&specs->field_unsigned) -// ? asn_ulong2INTEGER(&tmpint, native) -// : asn_long2INTEGER(&tmpint, native)) -// _ASN_ENCODE_FAILED; - er = INTEGER_encode_aper(td, constraints, &tmpint, po); - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); - return er; -} - -/* - * INTEGER specific human-readable output. - */ -int -NativeInteger_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; - const long *native = (const long *)sptr; - char scratch[32]; /* Enough for 64-bit int */ - int ret; - - (void)td; /* Unused argument */ - (void)ilevel; /* Unused argument */ - - if(native) { - ret = snprintf(scratch, sizeof(scratch), - (specs && specs->field_unsigned) - ? "%lu" : "%ld", *native); - assert(ret > 0 && (size_t)ret < sizeof(scratch)); - return (cb(scratch, ret, app_key) < 0) ? -1 : 0; - } else { - return (cb("", 8, app_key) < 0) ? -1 : 0; - } -} - -void -NativeInteger_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { - - if(!td || !ptr) - return; - - ASN_DEBUG("Freeing %s as INTEGER (%d, %p, Native)", - td->name, contents_only, ptr); - - if(!contents_only) { - FREEMEM(ptr); - } -} - diff --git a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff new file mode 100644 index 0000000000..c1649fd6f7 --- /dev/null +++ b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff @@ -0,0 +1,8 @@ +282c282 +< int dynamic = 0; +--- +> //int dynamic = 0; +289c289 +< dynamic = 1; +--- +> //dynamic = 1; diff --git a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h deleted file mode 100644 index d9c9fd1b4b..0000000000 --- a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) - * From ASN.1 module "X2AP-IEs" - * found in "/roux/comments/openairinterface5g/openair2/X2AP/MESSAGES/ASN1/R11.2/X2AP-IEs.asn" - * `asn1c -gen-PER` - */ - -#ifndef _X2ap_CriticalityDiagnostics_IE_List_H_ -#define _X2ap_CriticalityDiagnostics_IE_List_H_ - - -#include - -/* Including external dependencies */ -#include -#include "X2ap-Criticality.h" -#include "X2ap-ProtocolIE-ID.h" -#include "X2ap-TypeOfError.h" -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Forward declarations */ -struct X2ap_IE_Extensions; - -struct X2ap_CriticalityDiagnostics_IE_List__Member { - X2ap_Criticality_t iECriticality; - X2ap_ProtocolIE_ID_t iE_ID; - X2ap_TypeOfError_t typeOfError; - struct X2ap_IE_Extensions *iE_Extensions /* OPTIONAL */; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; - }; - -/* X2ap-CriticalityDiagnostics-IE-List */ -typedef struct X2ap_CriticalityDiagnostics_IE_List { - A_SEQUENCE_OF(struct X2ap_CriticalityDiagnostics_IE_List__Member - ) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} X2ap_CriticalityDiagnostics_IE_List_t; - -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_X2ap_CriticalityDiagnostics_IE_List; - -#ifdef __cplusplus -} -#endif - -/* Referred external types */ -#include "X2ap-IE-Extensions.h" - -#endif /* _X2ap_CriticalityDiagnostics_IE_List_H_ */ -#include diff --git a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff new file mode 100644 index 0000000000..6ea7b2454e --- /dev/null +++ b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff @@ -0,0 +1,15 @@ +29,31c29 +< /* X2ap-CriticalityDiagnostics-IE-List */ +< typedef struct X2ap_CriticalityDiagnostics_IE_List { +< A_SEQUENCE_OF(struct X2ap_CriticalityDiagnostics_IE_List__Member { +--- +> struct X2ap_CriticalityDiagnostics_IE_List__Member { +43c41,46 +< } ) list; +--- +> }; +> +> /* X2ap-CriticalityDiagnostics-IE-List */ +> typedef struct X2ap_CriticalityDiagnostics_IE_List { +> A_SEQUENCE_OF(struct X2ap_CriticalityDiagnostics_IE_List__Member +> ) list; diff --git a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c deleted file mode 100644 index 3e2d23b254..0000000000 --- a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c +++ /dev/null @@ -1,1041 +0,0 @@ -/*- - * Copyright (c) 2003, 2004, 2005 Lev Walkin . - * All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include -#include - -/* - * Number of bytes left for this structure. - * (ctx->left) indicates the number of bytes _transferred_ for the structure. - * (size) contains the number of bytes in the buffer passed. - */ -#define LEFT ((size<(size_t)ctx->left)?size:(size_t)ctx->left) - -/* - * If the subprocessor function returns with an indication that it wants - * more data, it may well be a fatal decoding problem, because the - * size is constrained by the 's L, even if the buffer size allows - * reading more data. - * For example, consider the buffer containing the following TLVs: - * ... - * The TLV length clearly indicates that one byte is expected in V, but - * if the V processor returns with "want more data" even if the buffer - * contains way more data than the V processor have seen. - */ -#define SIZE_VIOLATION (ctx->left >= 0 && (size_t)ctx->left <= size) - -/* - * This macro "eats" the part of the buffer which is definitely "consumed", - * i.e. was correctly converted into local representation or rightfully skipped. - */ -#undef ADVANCE -#define ADVANCE(num_bytes) do { \ - size_t num = num_bytes; \ - ptr = ((const char *)ptr) + num;\ - size -= num; \ - if(ctx->left >= 0) \ - ctx->left -= num; \ - consumed_myself += num; \ - } while(0) - -/* - * Switch to the next phase of parsing. - */ -#undef NEXT_PHASE -#undef PHASE_OUT -#define NEXT_PHASE(ctx) do { \ - ctx->phase++; \ - ctx->step = 0; \ - } while(0) -#define PHASE_OUT(ctx) do { ctx->phase = 10; } while(0) - -/* - * Return a standardized complex structure. - */ -#undef RETURN -#define RETURN(_code) do { \ - rval.code = _code; \ - rval.consumed = consumed_myself;\ - return rval; \ - } while(0) - -/* - * The decoder of the SET OF type. - */ -asn_dec_rval_t -SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **struct_ptr, const void *ptr, size_t size, int tag_mode) { - /* - * Bring closer parts of structure description. - */ - asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; - asn_TYPE_member_t *elm = td->elements; /* Single one */ - - /* - * Parts of the structure being constructed. - */ - void *st = *struct_ptr; /* Target structure. */ - asn_struct_ctx_t *ctx; /* Decoder context */ - - ber_tlv_tag_t tlv_tag; /* T from TLV */ - asn_dec_rval_t rval; /* Return code from subparsers */ - - ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ - - ASN_DEBUG("Decoding %s as SET OF", td->name); - - /* - * Create the target structure if it is not present already. - */ - if(st == 0) { - st = *struct_ptr = CALLOC(1, specs->struct_size); - if(st == 0) { - RETURN(RC_FAIL); - } - } - - /* - * Restore parsing context. - */ - ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); - - /* - * Start to parse where left previously - */ - switch(ctx->phase) { - case 0: - /* - * PHASE 0. - * Check that the set of tags associated with given structure - * perfectly fits our expectations. - */ - - rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size, - tag_mode, 1, &ctx->left, 0); - if(rval.code != RC_OK) { - ASN_DEBUG("%s tagging check failed: %d", - td->name, rval.code); - return rval; - } - - if(ctx->left >= 0) - ctx->left += rval.consumed; /* ?Substracted below! */ - ADVANCE(rval.consumed); - - ASN_DEBUG("Structure consumes %ld bytes, " - "buffer %ld", (long)ctx->left, (long)size); - - NEXT_PHASE(ctx); - /* Fall through */ - case 1: - /* - * PHASE 1. - * From the place where we've left it previously, - * try to decode the next item. - */ - for(;; ctx->step = 0) { - ssize_t tag_len; /* Length of TLV's T */ - - if(ctx->step & 1) - goto microphase2; - - /* - * MICROPHASE 1: Synchronize decoding. - */ - - if(ctx->left == 0) { - ASN_DEBUG("End of SET OF %s", td->name); - /* - * No more things to decode. - * Exit out of here. - */ - PHASE_OUT(ctx); - RETURN(RC_OK); - } - - /* - * Fetch the T from TLV. - */ - tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag); - switch(tag_len) { - case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); - /* Fall through */ - case -1: RETURN(RC_FAIL); - } - - if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) { - if(LEFT < 2) { - if(SIZE_VIOLATION) - RETURN(RC_FAIL); - else - RETURN(RC_WMORE); - } else if(((const uint8_t *)ptr)[1] == 0) { - /* - * Found the terminator of the - * indefinite length structure. - */ - break; - } - } - - /* Outmost tag may be unknown and cannot be fetched/compared */ - if(elm->tag != (ber_tlv_tag_t)-1) { - if(BER_TAGS_EQUAL(tlv_tag, elm->tag)) { - /* - * The new list member of expected type has arrived. - */ - } else { - ASN_DEBUG("Unexpected tag %s fixed SET OF %s", - ber_tlv_tag_string(tlv_tag), td->name); - ASN_DEBUG("%s SET OF has tag %s", - td->name, ber_tlv_tag_string(elm->tag)); - RETURN(RC_FAIL); - } - } - - /* - * MICROPHASE 2: Invoke the member-specific decoder. - */ - ctx->step |= 1; /* Confirm entering next microphase */ - microphase2: - - /* - * Invoke the member fetch routine according to member's type - */ - rval = elm->type->ber_decoder(opt_codec_ctx, - elm->type, &ctx->ptr, ptr, LEFT, 0); - ASN_DEBUG("In %s SET OF %s code %d consumed %d", - td->name, elm->type->name, - rval.code, (int)rval.consumed); - switch(rval.code) { - case RC_OK: - { - asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); - if(ASN_SET_ADD(list, ctx->ptr) != 0) - RETURN(RC_FAIL); - else - ctx->ptr = 0; - } - break; - case RC_WMORE: /* More data expected */ - if(!SIZE_VIOLATION) { - ADVANCE(rval.consumed); - RETURN(RC_WMORE); - } - /* Fall through */ - case RC_FAIL: /* Fatal error */ - ASN_STRUCT_FREE(*elm->type, ctx->ptr); - ctx->ptr = 0; - RETURN(RC_FAIL); - } /* switch(rval) */ - - ADVANCE(rval.consumed); - } /* for(all list members) */ - - NEXT_PHASE(ctx); - case 2: - /* - * Read in all "end of content" TLVs. - */ - while(ctx->left < 0) { - if(LEFT < 2) { - if(LEFT > 0 && ((const char *)ptr)[0] != 0) { - /* Unexpected tag */ - RETURN(RC_FAIL); - } else { - RETURN(RC_WMORE); - } - } - if(((const char *)ptr)[0] == 0 - && ((const char *)ptr)[1] == 0) { - ADVANCE(2); - ctx->left++; - } else { - RETURN(RC_FAIL); - } - } - - PHASE_OUT(ctx); - } - - RETURN(RC_OK); -} - -/* - * Internally visible buffer holding a single encoded element. - */ -struct _el_buffer { - uint8_t *buf; - size_t length; - size_t size; -}; -/* Append bytes to the above structure */ -static int _el_addbytes(const void *buffer, size_t size, void *el_buf_ptr) { - struct _el_buffer *el_buf = (struct _el_buffer *)el_buf_ptr; - - if(el_buf->length + size > el_buf->size) - return -1; - - memcpy(el_buf->buf + el_buf->length, buffer, size); - - el_buf->length += size; - return 0; -} -static int _el_buf_cmp(const void *ap, const void *bp) { - const struct _el_buffer *a = (const struct _el_buffer *)ap; - const struct _el_buffer *b = (const struct _el_buffer *)bp; - int ret; - size_t common_len; - - if(a->length < b->length) - common_len = a->length; - else - common_len = b->length; - - ret = memcmp(a->buf, b->buf, common_len); - if(ret == 0) { - if(a->length < b->length) - ret = -1; - else if(a->length > b->length) - ret = 1; - } - - return ret; -} - -/* - * The DER encoder of the SET OF type. - */ -asn_enc_rval_t -SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, - int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_TYPE_member_t *elm = td->elements; - asn_TYPE_descriptor_t *elm_type = elm->type; - der_type_encoder_f *der_encoder = elm_type->der_encoder; - asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr); - size_t computed_size = 0; - ssize_t encoding_size = 0; - struct _el_buffer *encoded_els; - ssize_t eels_count = 0; - size_t max_encoded_len = 1; - asn_enc_rval_t erval; - int ret; - int edx; - - ASN_DEBUG("Estimating size for SET OF %s", td->name); - - /* - * Gather the length of the underlying members sequence. - */ - for(edx = 0; edx < list->count; edx++) { - void *memb_ptr = list->array[edx]; - if(!memb_ptr) continue; - erval = der_encoder(elm_type, memb_ptr, 0, elm->tag, 0, 0); - if(erval.encoded == -1) - return erval; - computed_size += erval.encoded; - - /* Compute maximum encoding's size */ - if(max_encoded_len < (size_t)erval.encoded) - max_encoded_len = erval.encoded; - } - - /* - * Encode the TLV for the sequence itself. - */ - encoding_size = der_write_tags(td, computed_size, tag_mode, 1, tag, - cb, app_key); - if(encoding_size == -1) { - erval.encoded = -1; - erval.failed_type = td; - erval.structure_ptr = ptr; - return erval; - } - computed_size += encoding_size; - - if(!cb || list->count == 0) { - erval.encoded = computed_size; - _ASN_ENCODED_OK(erval); - } - - /* - * DER mandates dynamic sorting of the SET OF elements - * according to their encodings. Build an array of the - * encoded elements. - */ - encoded_els = (struct _el_buffer *)MALLOC( - list->count * sizeof(encoded_els[0])); - if(encoded_els == NULL) { - erval.encoded = -1; - erval.failed_type = td; - erval.structure_ptr = ptr; - return erval; - } - - ASN_DEBUG("Encoding members of %s SET OF", td->name); - - /* - * Encode all members. - */ - for(edx = 0; edx < list->count; edx++) { - void *memb_ptr = list->array[edx]; - struct _el_buffer *encoded_el = &encoded_els[eels_count]; - - if(!memb_ptr) continue; - - /* - * Prepare space for encoding. - */ - encoded_el->buf = (uint8_t *)MALLOC(max_encoded_len); - if(encoded_el->buf) { - encoded_el->length = 0; - encoded_el->size = max_encoded_len; - } else { - for(edx--; edx >= 0; edx--) - FREEMEM(encoded_els[edx].buf); - FREEMEM(encoded_els); - erval.encoded = -1; - erval.failed_type = td; - erval.structure_ptr = ptr; - return erval; - } - - /* - * Encode the member into the prepared space. - */ - erval = der_encoder(elm_type, memb_ptr, 0, elm->tag, - _el_addbytes, encoded_el); - if(erval.encoded == -1) { - for(; edx >= 0; edx--) - FREEMEM(encoded_els[edx].buf); - FREEMEM(encoded_els); - return erval; - } - encoding_size += erval.encoded; - eels_count++; - } - - /* - * Sort the encoded elements according to their encoding. - */ - qsort(encoded_els, eels_count, sizeof(encoded_els[0]), _el_buf_cmp); - - /* - * Report encoded elements to the application. - * Dispose of temporary sorted members table. - */ - ret = 0; - for(edx = 0; edx < eels_count; edx++) { - struct _el_buffer *encoded_el = &encoded_els[edx]; - /* Report encoded chunks to the application */ - if(ret == 0 - && cb(encoded_el->buf, encoded_el->length, app_key) < 0) - ret = -1; - FREEMEM(encoded_el->buf); - } - FREEMEM(encoded_els); - - if(ret || computed_size != (size_t)encoding_size) { - /* - * Standard callback failed, or - * encoded size is not equal to the computed size. - */ - erval.encoded = -1; - erval.failed_type = td; - erval.structure_ptr = ptr; - } else { - erval.encoded = computed_size; - } - - _ASN_ENCODED_OK(erval); -} - -#undef XER_ADVANCE -#define XER_ADVANCE(num_bytes) do { \ - size_t num = num_bytes; \ - buf_ptr = ((const char *)buf_ptr) + num;\ - size -= num; \ - consumed_myself += num; \ - } while(0) - -/* - * Decode the XER (XML) data. - */ -asn_dec_rval_t -SET_OF_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **struct_ptr, const char *opt_mname, - const void *buf_ptr, size_t size) { - /* - * Bring closer parts of structure description. - */ - asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; - asn_TYPE_member_t *element = td->elements; - const char *elm_tag; - const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; - - /* - * ... and parts of the structure being constructed. - */ - void *st = *struct_ptr; /* Target structure. */ - asn_struct_ctx_t *ctx; /* Decoder context */ - - asn_dec_rval_t rval; /* Return value from a decoder */ - ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ - - /* - * Create the target structure if it is not present already. - */ - if(st == 0) { - st = *struct_ptr = CALLOC(1, specs->struct_size); - if(st == 0) RETURN(RC_FAIL); - } - - /* Which tag is expected for the downstream */ - if(specs->as_XMLValueList) { - elm_tag = (specs->as_XMLValueList == 1) ? 0 : ""; - } else { - elm_tag = (*element->name) - ? element->name : element->type->xml_tag; - } - - /* - * Restore parsing context. - */ - ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); - - /* - * Phases of XER/XML processing: - * Phase 0: Check that the opening tag matches our expectations. - * Phase 1: Processing body and reacting on closing tag. - * Phase 2: Processing inner type. - */ - for(; ctx->phase <= 2;) { - pxer_chunk_type_e ch_type; /* XER chunk type */ - ssize_t ch_size; /* Chunk size */ - xer_check_tag_e tcv; /* Tag check value */ - - /* - * Go inside the inner member of a set. - */ - if(ctx->phase == 2) { - asn_dec_rval_t tmprval; - - /* Invoke the inner type decoder, m.b. multiple times */ - ASN_DEBUG("XER/SET OF element [%s]", elm_tag); - tmprval = element->type->xer_decoder(opt_codec_ctx, - element->type, &ctx->ptr, elm_tag, - buf_ptr, size); - if(tmprval.code == RC_OK) { - asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); - if(ASN_SET_ADD(list, ctx->ptr) != 0) - RETURN(RC_FAIL); - ctx->ptr = 0; - XER_ADVANCE(tmprval.consumed); - } else { - XER_ADVANCE(tmprval.consumed); - RETURN(tmprval.code); - } - ctx->phase = 1; /* Back to body processing */ - ASN_DEBUG("XER/SET OF phase => %d", ctx->phase); - /* Fall through */ - } - - /* - * Get the next part of the XML stream. - */ - ch_size = xer_next_token(&ctx->context, - buf_ptr, size, &ch_type); - switch(ch_size) { - case -1: RETURN(RC_FAIL); - case 0: RETURN(RC_WMORE); - default: - switch(ch_type) { - case PXER_COMMENT: /* Got XML comment */ - case PXER_TEXT: /* Ignore free-standing text */ - XER_ADVANCE(ch_size); /* Skip silently */ - continue; - case PXER_TAG: - break; /* Check the rest down there */ - } - } - - tcv = xer_check_tag(buf_ptr, ch_size, xml_tag); - ASN_DEBUG("XER/SET OF: tcv = %d, ph=%d t=%s", - tcv, ctx->phase, xml_tag); - switch(tcv) { - case XCT_CLOSING: - if(ctx->phase == 0) break; - ctx->phase = 0; - /* Fall through */ - case XCT_BOTH: - if(ctx->phase == 0) { - /* No more things to decode */ - XER_ADVANCE(ch_size); - ctx->phase = 3; /* Phase out */ - RETURN(RC_OK); - } - /* Fall through */ - case XCT_OPENING: - if(ctx->phase == 0) { - XER_ADVANCE(ch_size); - ctx->phase = 1; /* Processing body phase */ - continue; - } - /* Fall through */ - case XCT_UNKNOWN_OP: - case XCT_UNKNOWN_BO: - - ASN_DEBUG("XER/SET OF: tcv=%d, ph=%d", tcv, ctx->phase); - if(ctx->phase == 1) { - /* - * Process a single possible member. - */ - ctx->phase = 2; - continue; - } - /* Fall through */ - default: - break; - } - - ASN_DEBUG("Unexpected XML tag in SET OF"); - break; - } - - ctx->phase = 3; /* "Phase out" on hard failure */ - RETURN(RC_FAIL); -} - - - -typedef struct xer_tmp_enc_s { - void *buffer; - size_t offset; - size_t size; -} xer_tmp_enc_t; -static int -SET_OF_encode_xer_callback(const void *buffer, size_t size, void *key) { - xer_tmp_enc_t *t = (xer_tmp_enc_t *)key; - if(t->offset + size >= t->size) { - size_t newsize = (t->size << 2) + size; - void *p = REALLOC(t->buffer, newsize); - if(!p) return -1; - t->buffer = p; - t->size = newsize; - } - memcpy((char *)t->buffer + t->offset, buffer, size); - t->offset += size; - return 0; -} -static int -SET_OF_xer_order(const void *aptr, const void *bptr) { - const xer_tmp_enc_t *a = (const xer_tmp_enc_t *)aptr; - const xer_tmp_enc_t *b = (const xer_tmp_enc_t *)bptr; - size_t minlen = a->offset; - int ret; - if(b->offset < minlen) minlen = b->offset; - /* Well-formed UTF-8 has this nice lexicographical property... */ - ret = memcmp(a->buffer, b->buffer, minlen); - if(ret != 0) return ret; - if(a->offset == b->offset) - return 0; - if(a->offset == minlen) - return -1; - return 1; -} - - -asn_enc_rval_t -SET_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_enc_rval_t er; - asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; - asn_TYPE_member_t *elm = td->elements; - asn_anonymous_set_ *list = _A_SET_FROM_VOID(sptr); - const char *mname = specs->as_XMLValueList - ? 0 : ((*elm->name) ? elm->name : elm->type->xml_tag); - size_t mlen = mname ? strlen(mname) : 0; - int xcan = (flags & XER_F_CANONICAL); - xer_tmp_enc_t *encs = 0; - size_t encs_count = 0; - void *original_app_key = app_key; - asn_app_consume_bytes_f *original_cb = cb; - int i; - - if(!sptr) _ASN_ENCODE_FAILED; - - if(xcan) { - encs = (xer_tmp_enc_t *)MALLOC(list->count * sizeof(encs[0])); - if(!encs) _ASN_ENCODE_FAILED; - cb = SET_OF_encode_xer_callback; - } - - er.encoded = 0; - - for(i = 0; i < list->count; i++) { - asn_enc_rval_t tmper; - - void *memb_ptr = list->array[i]; - if(!memb_ptr) continue; - - if(encs) { - memset(&encs[encs_count], 0, sizeof(encs[0])); - app_key = &encs[encs_count]; - encs_count++; - } - - if(mname) { - if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel); - _ASN_CALLBACK3("<", 1, mname, mlen, ">", 1); - } - - if(!xcan && specs->as_XMLValueList == 1) - _i_ASN_TEXT_INDENT(1, ilevel + 1); - tmper = elm->type->xer_encoder(elm->type, memb_ptr, - ilevel + (specs->as_XMLValueList != 2), - flags, cb, app_key); - if(tmper.encoded == -1) { - td = tmper.failed_type; - sptr = tmper.structure_ptr; - goto cb_failed; - } - if(tmper.encoded == 0 && specs->as_XMLValueList) { - const char *name = elm->type->xml_tag; - size_t len = strlen(name); - _ASN_CALLBACK3("<", 1, name, len, "/>", 2); - } - - if(mname) { - _ASN_CALLBACK3("", 1); - er.encoded += 5; - } - - er.encoded += (2 * mlen) + tmper.encoded; - } - - if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel - 1); - - if(encs) { - xer_tmp_enc_t *enc = encs; - xer_tmp_enc_t *end = encs + encs_count; - ssize_t control_size = 0; - - cb = original_cb; - app_key = original_app_key; - qsort(encs, encs_count, sizeof(encs[0]), SET_OF_xer_order); - - for(; enc < end; enc++) { - _ASN_CALLBACK(enc->buffer, enc->offset); - FREEMEM(enc->buffer); - enc->buffer = 0; - control_size += enc->offset; - } - assert(control_size == er.encoded); - } - - goto cleanup; -cb_failed: - er.encoded = -1; - er.failed_type = td; - er.structure_ptr = sptr; -cleanup: - if(encs) { - while(encs_count-- > 0) { - if(encs[encs_count].buffer) - FREEMEM(encs[encs_count].buffer); - } - FREEMEM(encs); - } - _ASN_ENCODED_OK(er); -} - -int -SET_OF_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { - asn_TYPE_member_t *elm = td->elements; - const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); - int ret; - int i; - - if(!sptr) return (cb("", 8, app_key) < 0) ? -1 : 0; - - /* Dump preamble */ - if(cb(td->name, strlen(td->name), app_key) < 0 - || cb(" ::= {", 6, app_key) < 0) - return -1; - - for(i = 0; i < list->count; i++) { - const void *memb_ptr = list->array[i]; - if(!memb_ptr) continue; - - _i_INDENT(1); - - ret = elm->type->print_struct(elm->type, memb_ptr, - ilevel + 1, cb, app_key); - if(ret) return ret; - } - - ilevel--; - _i_INDENT(1); - - return (cb("}", 1, app_key) < 0) ? -1 : 0; -} - -void -SET_OF_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { - if(td && ptr) { - asn_SET_OF_specifics_t *specs; - asn_TYPE_member_t *elm = td->elements; - asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr); - asn_struct_ctx_t *ctx; /* Decoder context */ - int i; - - /* - * Could not use set_of_empty() because of (*free) - * incompatibility. - */ - for(i = 0; i < list->count; i++) { - void *memb_ptr = list->array[i]; - if(memb_ptr) - ASN_STRUCT_FREE(*elm->type, memb_ptr); - } - list->count = 0; /* No meaningful elements left */ - - asn_set_empty(list); /* Remove (list->array) */ - - specs = (asn_SET_OF_specifics_t *)td->specifics; - ctx = (asn_struct_ctx_t *)((char *)ptr + specs->ctx_offset); - if(ctx->ptr) { - ASN_STRUCT_FREE(*elm->type, ctx->ptr); - ctx->ptr = 0; - } - - if(!contents_only) { - FREEMEM(ptr); - } - } -} - -int -SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { - asn_TYPE_member_t *elm = td->elements; - asn_constr_check_f *constr; - const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); - int i; - - if(!sptr) { - _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } - - constr = elm->memb_constraints; - if(!constr) constr = elm->type->check_constraints; - - /* - * Iterate over the members of an array. - * Validate each in turn, until one fails. - */ - for(i = 0; i < list->count; i++) { - const void *memb_ptr = list->array[i]; - int ret; - - if(!memb_ptr) continue; - - ret = constr(elm->type, memb_ptr, ctfailcb, app_key); - if(ret) return ret; - } - - /* - * Cannot inherit it eralier: - * need to make sure we get the updated version. - */ - if(!elm->memb_constraints) - elm->memb_constraints = elm->type->check_constraints; - - return 0; -} - -asn_dec_rval_t -SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { - asn_dec_rval_t rv; - asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; - asn_TYPE_member_t *elm = td->elements; /* Single one */ - void *st = *sptr; - asn_anonymous_set_ *list; - asn_per_constraint_t *ct; - int repeat = 0; - ssize_t nelems; - - if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx)) - _ASN_DECODE_FAILED; - - /* - * Create the target structure if it is not present already. - */ - if(!st) { - st = *sptr = CALLOC(1, specs->struct_size); - if(!st) _ASN_DECODE_FAILED; - } - list = _A_SET_FROM_VOID(st); - - /* Figure out which constraints to use */ - if(constraints) ct = &constraints->size; - else if(td->per_constraints) ct = &td->per_constraints->size; - else ct = 0; - - if(ct && ct->flags & APC_EXTENSIBLE) { - int value = per_get_few_bits(pd, 1); - if(value < 0) _ASN_DECODE_STARVED; - if(value) ct = 0; /* Not restricted! */ - } - - if(ct && ct->effective_bits >= 0) { - /* X.691, #19.5: No length determinant */ - nelems = per_get_few_bits(pd, ct->effective_bits); - ASN_DEBUG("Preparing to fetch %ld+%"PRIdMAX" elements from %s", - (long)nelems, ct->lower_bound, td->name); - if(nelems < 0) _ASN_DECODE_STARVED; - nelems += ct->lower_bound; - } else { - nelems = -1; - } - - do { - int i; - if(nelems < 0) { - nelems = uper_get_length(pd, - ct ? ct->effective_bits : -1, &repeat); - ASN_DEBUG("Got to decode %d elements (eff %d)", - (int)nelems, (int)(ct ? ct->effective_bits : -1)); - if(nelems < 0) _ASN_DECODE_STARVED; - } - - for(i = 0; i < nelems; i++) { - void *ptr = 0; - ASN_DEBUG("SET OF %s decoding", elm->type->name); - rv = elm->type->uper_decoder(opt_codec_ctx, elm->type, - elm->per_constraints, &ptr, pd); - ASN_DEBUG("%s SET OF %s decoded %d, %p", - td->name, elm->type->name, rv.code, ptr); - if(rv.code == RC_OK) { - if(ASN_SET_ADD(list, ptr) == 0) - continue; - ASN_DEBUG("Failed to add element into %s", - td->name); - /* Fall through */ - rv.code = RC_FAIL; - } else { - ASN_DEBUG("Failed decoding %s of %s (SET OF)", - elm->type->name, td->name); - } - if(ptr) ASN_STRUCT_FREE(*elm->type, ptr); - return rv; - } - - nelems = -1; /* Allow uper_get_length() */ - } while(repeat); - - ASN_DEBUG("Decoded %s as SET OF", td->name); - - rv.code = RC_OK; - rv.consumed = 0; - return rv; -} - -asn_dec_rval_t -SET_OF_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { - asn_dec_rval_t rv; - asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; - asn_TYPE_member_t *elm = td->elements; /* Single one */ - void *st = *sptr; - asn_anonymous_set_ *list; - asn_per_constraint_t *ct; - int repeat = 0; - ssize_t nelems; - - if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx)) - _ASN_DECODE_FAILED; - - /* - * Create the target structure if it is not present already. - */ - if(!st) { - st = *sptr = CALLOC(1, specs->struct_size); - if(!st) _ASN_DECODE_FAILED; - } - list = _A_SET_FROM_VOID(st); - - /* Figure out which constraints to use */ - if(constraints) ct = &constraints->size; - else if(td->per_constraints) ct = &td->per_constraints->size; - else ct = 0; - - if(ct && ct->flags & APC_EXTENSIBLE) { - int value = per_get_few_bits(pd, 1); - if(value < 0) _ASN_DECODE_STARVED; - if(value) ct = 0; /* Not restricted! */ - } - - if(ct && ct->effective_bits >= 0) { - /* X.691, #19.5: No length determinant */ -// nelems = per_get_few_bits(pd, ct->effective_bits); - nelems = aper_get_nsnnwn(pd, ct->upper_bound - ct->lower_bound); - ASN_DEBUG("Preparing to fetch %ld+%"PRIdMAX" elements from %s", - (long)nelems, ct->lower_bound, td->name); - if(nelems < 0) _ASN_DECODE_STARVED; - nelems += ct->lower_bound; - } else { - nelems = -1; - } - - do { - int i; - if(nelems < 0) { - nelems = aper_get_length(pd, ct ? ct->upper_bound - ct->lower_bound + 1 : -1, - ct ? ct->effective_bits : -1, &repeat); - ASN_DEBUG("Got to decode %d elements (eff %d)", - (int)nelems, ct ? ct->effective_bits : -1); - if(nelems < 0) _ASN_DECODE_STARVED; - } - - for(i = 0; i < nelems; i++) { - void *ptr = 0; - ASN_DEBUG("SET OF %s decoding", elm->type->name); - rv = elm->type->aper_decoder(opt_codec_ctx, elm->type, - elm->per_constraints, &ptr, pd); - ASN_DEBUG("%s SET OF %s decoded %d, %p", - td->name, elm->type->name, rv.code, ptr); - if(rv.code == RC_OK) { - if(ASN_SET_ADD(list, ptr) == 0) - continue; - ASN_DEBUG("Failed to add element into %s", - td->name); - /* Fall through */ - rv.code = RC_FAIL; - } else { - ASN_DEBUG("Failed decoding %s of %s (SET OF)", - elm->type->name, td->name); - } - if(ptr) ASN_STRUCT_FREE(*elm->type, ptr); - return rv; - } - - nelems = -1; /* Allow uper_get_length() */ - } while(repeat); - - ASN_DEBUG("Decoded %s as SET OF", td->name); - - rv.code = RC_OK; - rv.consumed = 0; - return rv; -} diff --git a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff new file mode 100644 index 0000000000..3ceaf5e3e5 --- /dev/null +++ b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff @@ -0,0 +1,4 @@ +1007c1007 +< (int)nelems, (int)ct ? ct->effective_bits : -1); +--- +> (int)nelems, ct ? ct->effective_bits : -1); From bae725a3204ecc70efe08e21bc015c630c93f73b Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 22 Feb 2016 16:08:08 +0100 Subject: [PATCH 047/214] Deal with Rel8 RRC (not checked, just let fix_asn1 accept it). Also modified CMakeLists.txt to run asn1tostruct.py at cmake time, because the generated Makefile was wrong. When compiling with -j4 it would mess up by calling fix_asn1 twice with a weird timing, leading to failures. --- cmake_targets/CMakeLists.txt | 26 ++++++++++++++++++-------- cmake_targets/tools/fix_asn1 | 3 +++ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 6bebc2d655..c7058c1cff 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -321,10 +321,15 @@ set(S1AP_ASN_FILES ) set(S1AP_C_DIR ${asn1_generated_dir}/${ASN1RELDIR}) #message("calling ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES}") -execute_process(COMMAND ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES}) -execute_process( - COMMAND ${fix_asn1c_call} ${S1AP_C_DIR} S1AP ${S1AP_VERSION} - RESULT_VARIABLE ret) +execute_process(COMMAND ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES} RESULT_VARIABLE ret) +if (NOT ${ret} STREQUAL 0) + message(FATAL_ERROR "${asn1c_call}: error") +endif (NOT ${ret} STREQUAL 0) +execute_process(COMMAND python ${S1AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f${S1AP_ASN_DIR}/S1AP-PDU-Contents.asn -o${S1AP_C_DIR} RESULT_VARIABLE ret) +if (NOT ${ret} STREQUAL 0) + message(FATAL_ERROR "asn1tostruct.py: error") +endif (NOT ${ret} STREQUAL 0) +execute_process(COMMAND ${fix_asn1c_call} ${S1AP_C_DIR} S1AP ${S1AP_VERSION} RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${fix_asn1c_call}: error") endif (NOT ${ret} STREQUAL 0) @@ -395,10 +400,15 @@ set(X2AP_ASN_FILES set(X2AP_C_DIR ${asn1_generated_dir}/${ASN1RELDIR}) #message("calling ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES}") -execute_process(COMMAND ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES}) -execute_process( - COMMAND ${fix_asn1c_call} ${X2AP_C_DIR} X2AP ${X2AP_VERSION} - RESULT_VARIABLE ret) +execute_process(COMMAND ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES} RESULT_VARIABLE ret) +if (NOT ${ret} STREQUAL 0) + message(FATAL_ERROR "${asn1c_call}: error") +endif (NOT ${ret} STREQUAL 0) +execute_process(COMMAND python ${X2AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${X2AP_ASN_DIR}/X2AP-PDU-Contents.asn -o ${X2AP_C_DIR} RESULT_VARIABLE ret) +if (NOT ${ret} STREQUAL 0) + message(FATAL_ERROR "asn1tostruct.py: error") +endif (NOT ${ret} STREQUAL 0) +execute_process(COMMAND ${fix_asn1c_call} ${X2AP_C_DIR} X2AP ${X2AP_VERSION} RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${fix_asn1c_call}: error") endif (NOT ${ret} STREQUAL 0) diff --git a/cmake_targets/tools/fix_asn1 b/cmake_targets/tools/fix_asn1 index ba8f15d8ec..42893e05c6 100755 --- a/cmake_targets/tools/fix_asn1 +++ b/cmake_targets/tools/fix_asn1 @@ -93,6 +93,9 @@ function patch_rrc() echo "patching RRC files release 10" apply_patches "$directory" RRC_Rel10 ${#RRC_Rel10[*]} ;; + Rel8 ) + echo "patching RRC files release 8 TODO?" + ;; * ) error unknwon/unhandled RRC version \'"$version"\' ;; From 9330a890dc89a6bc9c4d08fd5c3f1a771f4f3442 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 22 Feb 2016 16:14:13 +0100 Subject: [PATCH 048/214] Small fixes in CMakeLists.txt --- cmake_targets/CMakeLists.txt | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index c7058c1cff..b551df03d8 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -269,13 +269,16 @@ set (RRC_FULL_DIR ${asn1_generated_dir}/${RRC_ASN1_VERSION}) if(NOT EXISTS ${asn1c_call}) message( FATAL_ERROR "The script ${asn1c_call} must be present" ) endif(NOT EXISTS ${asn1c_call}) -execute_process(COMMAND ${asn1c_call} ${RRC_FULL_DIR} ${RRC_GRAMMAR}) +execute_process(COMMAND ${asn1c_call} ${RRC_FULL_DIR} ${RRC_GRAMMAR} + RESULT_VARIABLE ret) +if (NOT ${ret} STREQUAL 0) + message(FATAL_ERROR "${asn1c_call}: error") +endif (NOT ${ret} STREQUAL 0) if(NOT EXISTS ${fix_asn1c_call}) message( FATAL_ERROR "The script ${fix_asn1c_call} must be present" ) endif(NOT EXISTS ${fix_asn1c_call}) -execute_process( - COMMAND ${fix_asn1c_call} ${RRC_FULL_DIR} RRC ${RRC_ASN1_VERSION} - RESULT_VARIABLE ret) +execute_process(COMMAND ${fix_asn1c_call} ${RRC_FULL_DIR} RRC ${RRC_ASN1_VERSION} + RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${fix_asn1c_call}: error") endif (NOT ${ret} STREQUAL 0) @@ -321,15 +324,18 @@ set(S1AP_ASN_FILES ) set(S1AP_C_DIR ${asn1_generated_dir}/${ASN1RELDIR}) #message("calling ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES}") -execute_process(COMMAND ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES} RESULT_VARIABLE ret) +execute_process(COMMAND ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES} + RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${asn1c_call}: error") endif (NOT ${ret} STREQUAL 0) -execute_process(COMMAND python ${S1AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f${S1AP_ASN_DIR}/S1AP-PDU-Contents.asn -o${S1AP_C_DIR} RESULT_VARIABLE ret) +execute_process(COMMAND python ${S1AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f${S1AP_ASN_DIR}/S1AP-PDU-Contents.asn -o${S1AP_C_DIR} + RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "asn1tostruct.py: error") endif (NOT ${ret} STREQUAL 0) -execute_process(COMMAND ${fix_asn1c_call} ${S1AP_C_DIR} S1AP ${S1AP_VERSION} RESULT_VARIABLE ret) +execute_process(COMMAND ${fix_asn1c_call} ${S1AP_C_DIR} S1AP ${S1AP_VERSION} + RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${fix_asn1c_call}: error") endif (NOT ${ret} STREQUAL 0) @@ -400,15 +406,18 @@ set(X2AP_ASN_FILES set(X2AP_C_DIR ${asn1_generated_dir}/${ASN1RELDIR}) #message("calling ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES}") -execute_process(COMMAND ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES} RESULT_VARIABLE ret) +execute_process(COMMAND ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES} + RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${asn1c_call}: error") endif (NOT ${ret} STREQUAL 0) -execute_process(COMMAND python ${X2AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${X2AP_ASN_DIR}/X2AP-PDU-Contents.asn -o ${X2AP_C_DIR} RESULT_VARIABLE ret) +execute_process(COMMAND python ${X2AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${X2AP_ASN_DIR}/X2AP-PDU-Contents.asn -o ${X2AP_C_DIR} + RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "asn1tostruct.py: error") endif (NOT ${ret} STREQUAL 0) -execute_process(COMMAND ${fix_asn1c_call} ${X2AP_C_DIR} X2AP ${X2AP_VERSION} RESULT_VARIABLE ret) +execute_process(COMMAND ${fix_asn1c_call} ${X2AP_C_DIR} X2AP ${X2AP_VERSION} + RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${fix_asn1c_call}: error") endif (NOT ${ret} STREQUAL 0) From 120369a6a0e8122e4cf8ffa562d7427d4776e8a4 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 22 Feb 2016 16:15:09 +0100 Subject: [PATCH 049/214] better logging in autotests --- cmake_targets/autotests/run_compilation_autotests.bash | 6 +++--- cmake_targets/tools/test_helper | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake_targets/autotests/run_compilation_autotests.bash b/cmake_targets/autotests/run_compilation_autotests.bash index afe7aa4873..a7b056dc81 100755 --- a/cmake_targets/autotests/run_compilation_autotests.bash +++ b/cmake_targets/autotests/run_compilation_autotests.bash @@ -20,7 +20,7 @@ test_compile() { compile_prog=$2 exec_prog=$3 build_dir=$tdir/$1/build - log_file=$tdir/log/test.$1.txt + log_file=$tdir/log/test.$1.$2.$5.txt target=$5 echo "Compiling test case $test_name. Log file = $log_file" rm -fr $build_dir @@ -34,10 +34,10 @@ test_compile() { if [ -s $exec_prog ] ; then cp $exec_prog $tdir/bin/`basename $exec_prog`.$target.$test_name echo_success "$test_name $exec_prog $target compiled" - xUnit_success "compilation" $test_name "PASS" 1 + xUnit_success "compilation" $test_name "PASS" 1 "$results_file" else echo_error "$test_name $exec_prog $target compilation failed" - xUnit_fail "compilation" $test_name "FAIL" 1 + xUnit_fail "compilation" $test_name "FAIL" 1 "$results_file" fi } diff --git a/cmake_targets/tools/test_helper b/cmake_targets/tools/test_helper index 49a9910573..cae0bacbe0 100644 --- a/cmake_targets/tools/test_helper +++ b/cmake_targets/tools/test_helper @@ -35,7 +35,7 @@ xUnit_fail() { currtime=$(date +%s.%N) time=$(echo "$currtime - $XUNIT_START" | bc -l) xml="" - echo -e $xml >> $xmlfile_testcase + echo -e "$xml" >> "$xmlfile_testcase" XUNIT_TESTCASES_XML="$XUNIT_TESTCASES_XML \n$xml" XUNIT_FAILED=$((XUNIT_FAILED+1)) } From 1657e0897c9b06d72195792917fadb0dc8768339 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 22 Feb 2016 17:48:31 +0100 Subject: [PATCH 050/214] Change the way we compute the sha1sum. Line 4 of *.h files depends on the directory containing openair; get rid of it. --- cmake_targets/tools/fix_asn1 | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/cmake_targets/tools/fix_asn1 b/cmake_targets/tools/fix_asn1 index 42893e05c6..4c3940079a 100755 --- a/cmake_targets/tools/fix_asn1 +++ b/cmake_targets/tools/fix_asn1 @@ -1,21 +1,21 @@ #!/bin/bash # in those arrays, each line is: -# +# RRC_Rel10=( - "SystemInformation-r8-IEs.h" 819eda3db27516f7c6780d832fb3c462e2264ea7 "fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff" + "SystemInformation-r8-IEs.h" 603cd6615cff36ec7020692d72c0d6de7c4859cb "fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff" ) X2AP_Rel11_2=( - "X2ap-CriticalityDiagnostics-IE-List.h" f0e2414992bfacfbc4b9fd15c977241d6d7fabeb "fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff" - "NativeInteger.c" e23034083a0fb9d4a2e523e2a64286161e621f27 "fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff" - "constr_SET_OF.c" 5fb65da648a57ea61f008fa226b707cf343c1c0c "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff" + "X2ap-CriticalityDiagnostics-IE-List.h" ae96308b37fcbcbf39da5012e42968135fc5f27b "fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff" + "NativeInteger.c" f815a276f31ec54e03ed008d4f01faee579f00be "fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff" + "constr_SET_OF.c" aeae707ba2471104a862477eb0107f04f4793ff4 "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff" ) S1AP_Rel10_5=( - "NativeInteger.c" e23034083a0fb9d4a2e523e2a64286161e621f27 "fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff" - "constr_SET_OF.c" 5fb65da648a57ea61f008fa226b707cf343c1c0c "fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff" + "NativeInteger.c" f815a276f31ec54e03ed008d4f01faee579f00be "fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff" + "constr_SET_OF.c" aeae707ba2471104a862477eb0107f04f4793ff4 "fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff" ) red_color="$(tput setaf 1)" @@ -38,7 +38,12 @@ function check_sha1() error "$file: no such file" fi - local computed_sha1=$(sha1sum "$file" | cut -f 1 -d ' ') + # we don't use the line 4 of the file + # it contains the location of the ASN1 grammar + # and this location is not the same on every + # installation (this is for *.h files, for *.c + # files it's no big deal to skip that line) + local computed_sha1=$(sed 4d "$file" | sha1sum | cut -f 1 -d ' ') if [ "$target_sha1" != "$computed_sha1" ] then From 7f4c22f851f5cf04bd2cfadbd2e3decc5f832461 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Thu, 25 Feb 2016 12:01:31 +0100 Subject: [PATCH 051/214] bugfix in allocate_CCEs --- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 7162501f89..d709dcdfda 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -991,13 +991,11 @@ int allocate_CCEs(int module_idP, int allocation_is_feasible = 1; DCI_ALLOC_t *dci_alloc; - LOG_D(MAC,"Allocate CCEs subframe %d, test %d : (common %d,uspec %d)\n",subframeP,test_onlyP,DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); - init_CCE_table(module_idP,CC_idP); - DCI_pdu->nCCE=0; - while (allocation_is_feasible == 1) { + init_CCE_table(module_idP,CC_idP); + DCI_pdu->nCCE=0; for (i=0;iNum_common_dci + DCI_pdu->Num_ue_spec_dci;i++) { dci_alloc = &DCI_pdu->dci_alloc[i]; From f6beede730f3f3ea41fa4c07b5966eb52b01bb0b Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Thu, 25 Feb 2016 09:30:44 -0800 Subject: [PATCH 052/214] fixed bug in generate_RIVtables for 20 MHz distributed VRB allocations (openair1/PHY/LTE_TRANSPORT/dci_tools.c) --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index c9d68cd0aa..f2d22e5231 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -734,11 +734,11 @@ void generate_RIV_tables() if (nVRB<32) alloc0 |= (1< Date: Fri, 26 Feb 2016 19:10:11 +0100 Subject: [PATCH 053/214] nothing special --- .../GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index 3b5386a0e6..7e17a07512 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -28,7 +28,7 @@ eNBs = tdd_config_s = 0; prefix_type = "NORMAL"; eutra_band = 7; - downlink_frequency = 2685000000L; + downlink_frequency = 2660000000L; uplink_frequency_offset = -120000000; Nid_cell = 0; N_RB_DL = 50; From 0c017f692272666fdb5eca3bd37bb0355adb05df Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 1 Mar 2016 22:53:47 +0100 Subject: [PATCH 054/214] Added delay on exit option --- openair3/TEST/EPC_TEST/play_scenario.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index cafdd93d31..876691cfcc 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -1016,6 +1016,7 @@ static void et_usage ( fprintf (stdout, "\n"); fprintf (stdout, "\t-d | --test-dir Directory where a set of files related to a particular test are located\n"); fprintf (stdout, "\t-c | --enb-conf-file Provide an eNB config file, valid for the testbed\n"); + fprintf (stdout, "\t-D | --delay-on-exit Wait delay-in-sec before exiting\n"); fprintf (stdout, "\t-f | --shift-packet Shift the timing of a packet'\n"); fprintf (stdout, "\t-F | --shift-packets Shift the timing of packets starting at frame 'frame' included\n"); fprintf (stdout, "\t-m | --max-speed Play scenario as fast as possible without respecting frame timings\n"); @@ -1035,7 +1036,8 @@ et_config_parse_opt_line ( char **et_dir_name, char **scenario_file_name, char **enb_config_file_name, - shift_packet_t **shifts) + shift_packet_t **shifts, + int *delay_on_exit) //------------------------------------------------------------------------------ { int option = 0; @@ -1048,6 +1050,7 @@ et_config_parse_opt_line ( LONG_OPTION_SCENARIO_FILE, LONG_OPTION_MAX_SPEED, LONG_OPTION_TEST_DIR, + LONG_OPTION_DELAY_EXIT, LONG_OPTION_SHIFT_PACKET, LONG_OPTION_SHIFT_PACKETS, LONG_OPTION_HELP, @@ -1059,6 +1062,7 @@ et_config_parse_opt_line ( {"scenario ", required_argument, 0, LONG_OPTION_SCENARIO_FILE}, {"max-speed ", no_argument, 0, LONG_OPTION_MAX_SPEED}, {"test-dir", required_argument, 0, LONG_OPTION_TEST_DIR}, + {"delay-on-exit", required_argument, 0, LONG_OPTION_DELAY_EXIT}, {"shift-packet", required_argument, 0, LONG_OPTION_SHIFT_PACKET}, {"shift-packets", required_argument, 0, LONG_OPTION_SHIFT_PACKETS}, {"help", no_argument, 0, LONG_OPTION_HELP}, @@ -1101,6 +1105,19 @@ et_config_parse_opt_line ( } break; + case LONG_OPTION_DELAY_EXIT: + case 'D': + if (optarg) { + delay_on_exit = atoi(optarg); + if (0 > delay_on_exit) { + fprintf(stderr, "Please provide a valid -D/--delay-on-exit argument, %s is not a valid value\n", delay_on_exit); + exit(1); + } + printf("Delay on exit is %d\n", delay_on_exit); + } + break; + + case LONG_OPTION_SHIFT_PACKET: case 'f': if (optarg) { @@ -1187,6 +1204,7 @@ int main( int argc, char **argv ) char *enb_config_file_name = NULL; struct shift_packet_s *shifts = NULL; int ret = 0; + int delay_on_exit = 0; et_scenario_t *scenario = NULL; char play_scenario_filename[NAME_MAX]; @@ -1205,7 +1223,7 @@ int main( int argc, char **argv ) asn1_xer_print = 1; //parameters - actions = et_config_parse_opt_line (argc, argv, &et_dir_name, &scenario_file_name, &enb_config_file_name, &shifts); //Command-line options + actions = et_config_parse_opt_line (argc, argv, &et_dir_name, &scenario_file_name, &enb_config_file_name, &shifts, &delay_on_exit); //Command-line options if (actions & PLAY_SCENARIO) { if (et_generate_xml_scenario(et_dir_name, scenario_file_name,enb_config_file_name, play_scenario_filename) == 0) { if (NULL != (scenario = et_generate_scenario(play_scenario_filename))) { @@ -1223,5 +1241,8 @@ int main( int argc, char **argv ) et_free_pointer(enb_config_file_name); } itti_wait_tasks_end(); + if (0 < delay_on_exit) { + sleep(delay_on_exit); + } return ret; } From 8f0ac37edad0ec81d0111292d97e3be1ce58cb76 Mon Sep 17 00:00:00 2001 From: Aikaterini Date: Wed, 2 Mar 2016 20:58:20 +0100 Subject: [PATCH 055/214] modifications in UE NAS to allow OAI UE to connect to. Note this is hard-coded in NAS, it will no longer work with openairCN. To be fixed before merging into develop branch . --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 6 ++-- openair1/SCHED/phy_procedures_lte_ue.c | 2 +- openair3/NAS/TOOLS/network.h | 20 +++++++----- openair3/NAS/TOOLS/ue_data.c | 30 ++++++++++++++++++ openair3/NAS/TOOLS/usim_data.c | 35 ++++++++++++++++++--- openair3/NAS/UE/API/USIM/aka_functions.c | 12 +++++++ openair3/NAS/UE/API/USIM/usim_api.c | 40 ++++++++++++++---------- openair3/NAS/UE/EMM/Attach.c | 2 +- targets/ARCH/COMMON/common_lib.c | 12 ++++--- 9 files changed, 122 insertions(+), 37 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index f2d22e5231..3d8724fd4f 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -253,8 +253,8 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t */ // printf("rb_alloc[1]=%x,rb_alloc[0]=%x\n",rb_alloc2[1],rb_alloc2[0]); } else { - LOG_E(PHY,"resource type 1 not supported for N_RB_DL=100\n"); - mac_xface->macphy_exit("resource type 1 not supported for N_RB_DL=100\n"); + LOG_E(PHY,"resource type 1 not supported for N_RB_DL=50\n"); + // mac_xface->macphy_exit("resource type 1 not supported for N_RB_DL=100\n"); /* subset = rb_alloc&1; shift = (rb_alloc>>1)&1; @@ -284,7 +284,7 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t } } else { LOG_E(PHY,"resource type 1 not supported for N_RB_DL=100\n"); - mac_xface->macphy_exit("resource type 1 not supported for N_RB_DL=100\n"); + // mac_xface->macphy_exit("resource type 1 not supported for N_RB_DL=100\n"); /* subset = rb_alloc&1; shift = (rb_alloc>>1)&1; diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 985cda147f..c96d277b96 100755 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -1382,7 +1382,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra #endif if (abstraction_flag == 0) { - LOG_D(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : Generating PRACH, preamble %d, TARGET_RECEIVED_POWER %d dBm, PRACH TDD Resource index %d, RA-RNTI %d\n", + LOG_I(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : Generating PRACH, preamble %d, TARGET_RECEIVED_POWER %d dBm, PRACH TDD Resource index %d, RA-RNTI %d\n", Mod_id, frame_tx, subframe_tx, diff --git a/openair3/NAS/TOOLS/network.h b/openair3/NAS/TOOLS/network.h index 54bf61a7b4..b2c7977d2d 100644 --- a/openair3/NAS/TOOLS/network.h +++ b/openair3/NAS/TOOLS/network.h @@ -58,21 +58,23 @@ Description Defines a list of PLMN network operators #define SFR1 1 #define SFR2 2 #define SFR3 3 -#define TM1 4 -#define FCT1 5 -#define VDF1 6 -#define VDF2 7 -#define VDF3 8 -#define VDF4 9 -#define VDF5 10 +#define OAI_LTEBOX 4 +#define TM1 5 +#define FCT1 6 +#define VDF1 7 +#define VDF2 8 +#define VDF3 9 +#define VDF4 10 +#define VDF5 11 -#define SELECTED_PLMN SFR1 +#define SELECTED_PLMN OAI_LTEBOX //SFR1 #define TEST_PLMN {0,0,0x0f,1,1,0} // 00101 #define SFR_PLMN_1 {0,2,0x0f,8,0,1} // 20810 #define SFR_PLMN_2 {0,2,0x0f,8,1,1} // 20811 #define SFR_PLMN_3 {0,2,0x0f,8,3,1} // 20813 +#define OAI_LTEBOX_PLMN {0,2,0x0f,8,3,9} //20893 #define TM_PLMN_1 {1,3,0,0,8,2} // 310280 #define FCT_PLMN_1 {1,3,8,0,2,0} // 310028 #define VDF_PLMN_1 {2,2,0x0f,2,0,1} // 22210 @@ -81,6 +83,7 @@ Description Defines a list of PLMN network operators #define VDF_PLMN_4 {6,2,0x0f,2,0x0f,2} // 2622 #define VDF_PLMN_5 {6,2,0x0f,2,0x0f,4} // 2624 + /****************************************************************************/ /************************ G L O B A L T Y P E S ************************/ /****************************************************************************/ @@ -110,6 +113,7 @@ network_record_t network_records[] = { {20810, SFR_PLMN_1, "SFR France", "SFR", 0x0001, 0xfffd}, {20811, SFR_PLMN_2, "SFR France", "SFR", 0x0001, 0xfffd}, {20813, SFR_PLMN_3, "SFR France", "SFR", 0x0001, 0xfffd}, + {20893, OAI_LTEBOX_PLMN, "OAI LTEBOX", "OAIALU", 0x0001, 0xfffd}, {310280,TM_PLMN_1, "T-Mobile USA", "T-Mobile", 0x0001, 0xfffd}, {310028,FCT_PLMN_1, "FICTITIOUS USA", "FICTITIO", 0x0001, 0xfffd}, {22210, VDF_PLMN_1, "Vodafone Italia", "VODAFONE", 0x0001, 0xfffd}, diff --git a/openair3/NAS/TOOLS/ue_data.c b/openair3/NAS/TOOLS/ue_data.c index 478119acda..abfb2ee773 100644 --- a/openair3/NAS/TOOLS/ue_data.c +++ b/openair3/NAS/TOOLS/ue_data.c @@ -354,6 +354,36 @@ static void _gen_emm_data(emm_nvdata_t* data) data->rplmn.MNCdigit2 = 0; data->rplmn.MNCdigit3 = 0xf; #endif +#if (SELECTED_PLMN == OAI_LTEBOX) + /* + * International Mobile Subscriber Identity + * IMSI = MCC + MNC + MSIN = 208 (France) + 93 (OAI) + 00001110 + */ + data->imsi.length = 8; + data->imsi.u.num.parity = ODD_PARITY; // Type of identity = IMSI, even + data->imsi.u.num.digit1 = 2; // MCC digit 1 + data->imsi.u.num.digit2 = 0; // MCC digit 2 + data->imsi.u.num.digit3 = 8; // MCC digit 3 + data->imsi.u.num.digit4 = 9; // MNC digit 1 + data->imsi.u.num.digit5 = 3; // MNC digit 2 + data->imsi.u.num.digit6 = 0; // MNC digit 3 + data->imsi.u.num.digit7 = 1; + data->imsi.u.num.digit8 = 0; + data->imsi.u.num.digit9 = 0; + data->imsi.u.num.digit10 = 0; + data->imsi.u.num.digit11 = 0; + data->imsi.u.num.digit12 = 1; + data->imsi.u.num.digit13 = 1; + data->imsi.u.num.digit14 = 1; + data->imsi.u.num.digit15 = 0; + + data->rplmn.MCCdigit1 = 2; + data->rplmn.MCCdigit2 = 0; + data->rplmn.MCCdigit3 = 8; + data->rplmn.MNCdigit1 = 9; + data->rplmn.MNCdigit2 = 3; + data->rplmn.MNCdigit3 = 0xf; +#endif #if (SELECTED_PLMN == TEST1) /* * International Mobile Subscriber Identity diff --git a/openair3/NAS/TOOLS/usim_data.c b/openair3/NAS/TOOLS/usim_data.c index ea046245ed..624f076c6e 100644 --- a/openair3/NAS/TOOLS/usim_data.c +++ b/openair3/NAS/TOOLS/usim_data.c @@ -61,7 +61,7 @@ Description Implements the utility used to generate data stored in the #define KSI USIM_KSI_NOT_AVAILABLE #define KSI_ASME USIM_KSI_NOT_AVAILABLE -#define INT_ALGO USIM_INT_EIA1 +#define INT_ALGO USIM_INT_EIA2 #define ENC_ALGO USIM_ENC_EEA0 #define SECURITY_ALGORITHMS (ENC_ALGO | INT_ALGO) @@ -159,12 +159,13 @@ int main (int argc, const char* argv[]) usim_data.imsi.u.num.digit15 = 0b1111; #endif #if (SELECTED_PLMN == SFR1) -#warning "IMSI 208.10.00001234" + /* * International Mobile Subscriber Identity * IMSI = MCC + MNC + MSIN = 208 (France) + 10 (SFR) + 00001234 */ - #warning "IMSI 208.10.00001234" +#warning "IMSI 208.10.00001234" + usim_data.imsi.length = 8; usim_data.imsi.u.num.parity = EVEN_PARITY; // Parity: even usim_data.imsi.u.num.digit1 = 2; // MCC digit 1 @@ -183,6 +184,31 @@ int main (int argc, const char* argv[]) usim_data.imsi.u.num.digit14 = 4; usim_data.imsi.u.num.digit15 = 0b1111; #endif +#if (SELECTED_PLMN == OAI_LTEBOX) +#warning "IMSI 208.93.00001110" + /* + * International Mobile Subscriber Identity + * IMSI = MCC + MNC + MSIN = 208 (France) + 10 (SFR) + 00001234 + */ + #warning "IMSI 208.93.0100001110" + usim_data.imsi.length = 8; + usim_data.imsi.u.num.parity = ODD_PARITY; // Parity: even + usim_data.imsi.u.num.digit1 = 2; // MCC digit 1 + usim_data.imsi.u.num.digit2 = 0; // MCC digit 2 + usim_data.imsi.u.num.digit3 = 8; // MCC digit 3 + usim_data.imsi.u.num.digit4 = 9; // MNC digit 1 + usim_data.imsi.u.num.digit5 = 3; // MNC digit 2 + usim_data.imsi.u.num.digit6 = 0; // MNC digit 3 + usim_data.imsi.u.num.digit7 = 1; + usim_data.imsi.u.num.digit8 = 0; + usim_data.imsi.u.num.digit9 = 0; + usim_data.imsi.u.num.digit10 = 0; + usim_data.imsi.u.num.digit11 = 0; + usim_data.imsi.u.num.digit12 = 1; + usim_data.imsi.u.num.digit13 = 1; + usim_data.imsi.u.num.digit14 = 1; + usim_data.imsi.u.num.digit15 = 0; +#endif #if (SELECTED_PLMN == TEST1) #warning "IMSI 001.01.000001234" usim_data.imsi.length = 8; @@ -470,13 +496,14 @@ static void _display_usim_data(const usim_data_t* data) printf("\tparity\t= %s\n", data->imsi.u.num.parity == EVEN_PARITY ? "Even" : "Odd"); digits = (data->imsi.length * 2) - 1 - (data->imsi.u.num.parity == EVEN_PARITY ? 1 : 0); printf("\tdigits\t= %d\n", digits); + printf("\tdigits\t= %u%u%u%u%u%x%u%u%u%u", data->imsi.u.num.digit1, // MCC digit 1 data->imsi.u.num.digit2, // MCC digit 2 data->imsi.u.num.digit3, // MCC digit 3 data->imsi.u.num.digit4, // MNC digit 1 data->imsi.u.num.digit5, // MNC digit 2 - data->imsi.u.num.digit6, // MNC digit 3 + data->imsi.u.num.digit6==0xf?0:data->imsi.u.num.digit6, // MNC digit 3 data->imsi.u.num.digit7, data->imsi.u.num.digit8, data->imsi.u.num.digit9, diff --git a/openair3/NAS/UE/API/USIM/aka_functions.c b/openair3/NAS/UE/API/USIM/aka_functions.c index 7670cbfc0b..1c30a17bfd 100644 --- a/openair3/NAS/UE/API/USIM/aka_functions.c +++ b/openair3/NAS/UE/API/USIM/aka_functions.c @@ -21,9 +21,21 @@ /*--------- Operator Variant Algorithm Configuration Field --------*/ /*------- Insert your value of OP here -------*/ /* PFT OP used currently in HSS (OPENAIRHSS/auc/kdf.c) */ +#define OAI_LTEBOX + +#ifdef OAI_LTEBOX +//1006020f0a478bf6b699f15c062e42b3 +/*u8 OP[16] = {0xb3, 0x42, 0x2e, 0x06, 0x5c, 0xf1, 0x99, 0xb6, + 0xf6, 0x8b, 0x47, 0x0a, 0x0f, 0x02, 0x06, 0x10 + };*/ +u8 OP[16] = {0x10, 0x06, 0x02, 0x0f, 0x0a, 0x47, 0x8b, 0xf6, + 0xb6, 0x99, 0xf1, 0x5c, 0x06, 0x2e, 0x42, 0xb3 +}; +#else u8 OP[16] = {0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 }; +#endif /*------- Insert your value of OP here -------*/ /*------------------------------------------------------------------- diff --git a/openair3/NAS/UE/API/USIM/usim_api.c b/openair3/NAS/UE/API/USIM/usim_api.c index 64bc05d0c3..eb63cacc6a 100644 --- a/openair3/NAS/UE/API/USIM/usim_api.c +++ b/openair3/NAS/UE/API/USIM/usim_api.c @@ -77,7 +77,7 @@ Description Implements the API used by the NAS layer to read/write * Subscriber authentication security key */ #define USIM_API_K_SIZE 16 -#define USIM_API_K_VALUE "8BAF473F2F8FD09487CCCBD7097C6862" +#define USIM_API_K_VALUE "fec86ba6eb707ed08905757b1bb44b8f" static uint8_t _usim_api_k[USIM_API_K_SIZE]; @@ -85,9 +85,13 @@ static uint8_t _usim_api_k[USIM_API_K_SIZE]; /* * List of last used Sequence Numbers SQN */ +#define USIM_API_AK_SIZE 6 +#define USIM_API_SQN_SIZE USIM_API_AK_SIZE +#define USIM_API_SQNMS_SIZE USIM_API_SQN_SIZE + static struct _usim_api_data_s { /* Highest sequence number the USIM has ever accepted */ - uint32_t sqn_ms; + uint8_t sqn_ms[USIM_API_SQNMS_SIZE]; /* List of the last used sequence numbers */ #define USIM_API_SQN_LIST_SIZE 32 uint8_t n_sqns; @@ -230,25 +234,25 @@ int usim_api_authenticate(const OctetString* rand_pP, const OctetString* autn_pP /* Compute the cipher key CK = f3K (RAND) */ /* Compute the integrity key IK = f4K (RAND) */ /* Compute the anonymity key AK = f5K (RAND) */ -#define USIM_API_AK_SIZE 6 + u8 ak[USIM_API_AK_SIZE]; f2345(_usim_api_k, rand_pP->value, res_pP->value, ck_pP->value, ik_pP->value, ak); - LOG_TRACE(DEBUG, "USIM-API - res(f2) :%s",dump_octet_string(res_pP)); - LOG_TRACE(DEBUG, "USIM-API - ck(f3) :%s",dump_octet_string(ck_pP)); - LOG_TRACE(DEBUG, "USIM-API - ik(f4) :%s",dump_octet_string(ik_pP)); - LOG_TRACE(DEBUG, "USIM-API - ak(f5) : %02X%02X%02X%02X%02X%02X", + LOG_TRACE(INFO, "USIM-API - res(f2) :%s",dump_octet_string(res_pP)); + LOG_TRACE(INFO, "USIM-API - ck(f3) :%s",dump_octet_string(ck_pP)); + LOG_TRACE(INFO, "USIM-API - ik(f4) :%s",dump_octet_string(ik_pP)); + LOG_TRACE(INFO, "USIM-API - ak(f5) : %02X%02X%02X%02X%02X%02X", ak[0],ak[1],ak[2],ak[3],ak[4],ak[5]); /* Retrieve the sequence number SQN = (SQN ⊕ AK) ⊕ AK */ -#define USIM_API_SQN_SIZE USIM_API_AK_SIZE + u8 sqn[USIM_API_SQN_SIZE]; for (i = 0; i < USIM_API_SQN_SIZE; i++) { sqn[i] = autn_pP->value[i] ^ ak[i]; } - LOG_TRACE(DEBUG, "USIM-API - Retrieved SQN %02X%02X%02X%02X%02X%02X", + LOG_TRACE(INFO, "USIM-API - Retrieved SQN %02X%02X%02X%02X%02X%02X", sqn[0],sqn[1],sqn[2],sqn[3],sqn[4],sqn[5]); /* Compute XMAC = f1K (SQN || RAND || AMF) */ @@ -267,14 +271,15 @@ int usim_api_authenticate(const OctetString* rand_pP, const OctetString* autn_pP USIM_API_XMAC_SIZE) != 0 ) { LOG_TRACE(INFO, "USIM-API - Comparing the XMAC with the MAC included in AUTN Failed"); + rc = RETURNerror; //LOG_FUNC_RETURN (RETURNerror); } else { LOG_TRACE(INFO, "USIM-API - Comparing the XMAC with the MAC included in AUTN Succeeded"); + /* Verify that the received sequence number SQN is in the correct range */ + rc = _usim_api_check_sqn(*(uint32_t*)(sqn), sqn[USIM_API_SQN_SIZE - 1]); } - /* Verify that the received sequence number SQN is in the correct range */ - rc = _usim_api_check_sqn(*(uint32_t*)(sqn), sqn[USIM_API_SQN_SIZE - 1]); if (rc != RETURNok) { /* Synchronisation failure; compute the AUTS parameter */ @@ -283,15 +288,16 @@ int usim_api_authenticate(const OctetString* rand_pP, const OctetString* autn_pP * Conc(SQNMS) = SQNMS ⊕ f5*K(RAND) */ f5star(_usim_api_k, rand_pP->value, ak); -#define USIM_API_SQNMS_SIZE USIM_API_SQN_SIZE + u8 sqn_ms[USIM_API_SQNMS_SIZE]; memset(sqn_ms, 0, USIM_API_SQNMS_SIZE); -#define USIM_API_SQN_MS_SIZE 3 - - for (i = 0; i < USIM_API_SQN_MS_SIZE; i++) { + //#define USIM_API_SQN_MS_SIZE 3 + printf("_usim_api_data.sqn_ms %p\n",_usim_api_data.sqn_ms); + for (i = 0; i < USIM_API_SQNMS_SIZE; i++) { #warning "LG:BUG HERE TODO" + printf("i %d: ((uint8_t*)(_usim_api_data.sqn_ms))[USIM_API_SQNMS_SIZE - i] %d\n",i, ((uint8_t*)(_usim_api_data.sqn_ms))[USIM_API_SQNMS_SIZE - i]); sqn_ms[USIM_API_SQNMS_SIZE - i] = - ((uint8_t*)(_usim_api_data.sqn_ms))[USIM_API_SQN_MS_SIZE - i]; + ((uint8_t*)(_usim_api_data.sqn_ms))[USIM_API_SQNMS_SIZE - i]; } u8 sqnms[USIM_API_SQNMS_SIZE]; @@ -317,6 +323,8 @@ int usim_api_authenticate(const OctetString* rand_pP, const OctetString* autn_pP * AUTS = Conc(SQNMS) || MACS */ memcpy(&auts_pP->value[0], sqnms, USIM_API_SQNMS_SIZE); memcpy(&auts_pP->value[USIM_API_SQNMS_SIZE], macs, USIM_API_MACS_SIZE); + auts_pP->length = USIM_API_SQNMS_SIZE + USIM_API_MACS_SIZE; + LOG_FUNC_RETURN (RETURNerror); } LOG_FUNC_RETURN (RETURNok); diff --git a/openair3/NAS/UE/EMM/Attach.c b/openair3/NAS/UE/EMM/Attach.c index d7bdeb9120..8a589fa0a0 100755 --- a/openair3/NAS/UE/EMM/Attach.c +++ b/openair3/NAS/UE/EMM/Attach.c @@ -249,7 +249,7 @@ int emm_proc_attach(emm_proc_attach_type_t type) esm_sap.data.pdn_connect.is_defined = TRUE; esm_sap.data.pdn_connect.cid = 1; /* TODO: PDN type should be set according to the IP capability of the UE */ - esm_sap.data.pdn_connect.pdn_type = NET_PDN_TYPE_IPV4V6; + esm_sap.data.pdn_connect.pdn_type = NET_PDN_TYPE_IPV4; esm_sap.data.pdn_connect.apn = NULL; esm_sap.data.pdn_connect.is_emergency = _emm_data.is_emergency; rc = esm_sap_send(&esm_sap); diff --git a/targets/ARCH/COMMON/common_lib.c b/targets/ARCH/COMMON/common_lib.c index e4ee06d0a4..77c750a530 100644 --- a/targets/ARCH/COMMON/common_lib.c +++ b/targets/ARCH/COMMON/common_lib.c @@ -99,6 +99,7 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param void *lib_handle; oai_device_initfunc_t dp ; oai_transport_initfunc_t tp ; + int ret=0; if (flag == BBU_LOCAL_RADIO_HEAD) { lib_handle = dlopen(OAI_RF_LIBNAME, RTLD_LAZY); @@ -110,7 +111,10 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param dp = dlsym(lib_handle,"device_init"); if (dp != NULL ) { - dp(device,openair0_cfg); + ret = dp(device,openair0_cfg); + if (ret<0) { + fprintf(stderr, "%s %d:oai device intialization failed %s\n", __FILE__, __LINE__, dlerror()); + } } else { fprintf(stderr, "%s %d:oai device intializing function not found %s\n", __FILE__, __LINE__, dlerror()); return -1; @@ -132,14 +136,14 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param } } - return 0; + return ret; } int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg) { - int rc; + int rc=0; //ToDo: EXMIMO harmonization is not complete. That is the reason for this ifdef #ifdef EXMIMO device_init(device, openair0_cfg); @@ -152,7 +156,7 @@ int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cf } } #endif - return 0; + return rc; } int openair0_transport_load(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * eth_params) { From d33d2f5ed5ea76a3d8d4a533f07717c3ab6d47f6 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Thu, 3 Mar 2016 10:41:49 +0100 Subject: [PATCH 056/214] install libxslt --- cmake_targets/tools/build_helper | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 0d68c5d8d7..810b7349d2 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -269,7 +269,9 @@ check_install_oai_software() { pydb \ wvdial \ python-numpy \ - sshpass + sshpass \ + libxslt1-dev + $SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so if [ `lsb_release -rs` = '12.04' ] ; then install_nettle_from_source @@ -398,4 +400,4 @@ if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then fi return $stat -} \ No newline at end of file +} From c48f074aae1144a6ff726f01793935161f94f0b7 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 6 Mar 2016 23:57:42 +0100 Subject: [PATCH 057/214] changes in BSR handling in eNodeB. UL throughput on 5 MHz is 8 Mbit/s (mcs 19, 20 PRB). MCS 20 is not working for an unknown reason. --- openair1/PHY/LTE_ESTIMATION/lte_sync_time.c | 16 +- openair1/PHY/defs.h | 6 +- openair1/SCHED/phy_procedures_lte_eNb.c | 215 ++------------ openair2/LAYER2/MAC/config.c | 267 +++++++++--------- openair2/LAYER2/MAC/defs.h | 6 +- .../LAYER2/MAC/eNB_scheduler_primitives.c | 5 +- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 123 ++++++-- openair2/LAYER2/MAC/pre_processor.c | 17 +- openair3/NAS/TOOLS/ue_data.c | 2 +- openair3/NAS/TOOLS/usim_data.c | 4 +- openair3/NAS/UE/ESM/esm_ebr_context.c | 4 +- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 1 + .../CONF/enb.band7.tm1.usrpb210.conf | 4 +- targets/RT/USER/lte-softmodem.c | 5 + targets/RT/USER/lte-ue.c | 8 +- 15 files changed, 314 insertions(+), 369 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c index 6e2311789e..e45ca86453 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c @@ -346,6 +346,8 @@ static inline int abs32(int x) int debug_cnt=0; #endif +#define SHIFT 17 + int lte_sync_time(int **rxdata, ///rx data in time domain LTE_DL_FRAME_PARMS *frame_parms, int *eNB_id) @@ -414,8 +416,8 @@ int lte_sync_time(int **rxdata, ///rx data in time domain //calculate dot product of primary_synch0_time and rxdata[ar][n] (ar=0..nb_ant_rx) and store the sum in temp[n]; for (ar=0; arnb_antennas_rx; ar++) { - result = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, 15); - result2 = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, 15); + result = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT); + result2 = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT); ((short*)sync_corr_ue0)[2*n] += ((short*) &result)[0]; ((short*)sync_corr_ue0)[2*n+1] += ((short*) &result)[1]; @@ -428,8 +430,8 @@ int lte_sync_time(int **rxdata, ///rx data in time domain } for (ar=0; arnb_antennas_rx; ar++) { - result = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, 15); - result2 = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, 15); + result = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT); + result2 = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT); ((short*)sync_corr_ue1)[2*n] += ((short*) &result)[0]; ((short*)sync_corr_ue1)[2*n+1] += ((short*) &result)[1]; ((short*)sync_corr_ue1)[2*(length+n)] += ((short*) &result2)[0]; @@ -443,8 +445,8 @@ int lte_sync_time(int **rxdata, ///rx data in time domain for (ar=0; arnb_antennas_rx; ar++) { - result = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, 15); - result2 = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, 15); + result = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT); + result2 = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT); ((short*)sync_corr_ue2)[2*n] += ((short*) &result)[0]; ((short*)sync_corr_ue2)[2*n+1] += ((short*) &result)[1]; ((short*)sync_corr_ue2)[2*(length+n)] += ((short*) &result2)[0]; @@ -561,7 +563,7 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain //calculate dot product of primary_synch0_time and rxdata[ar][n] (ar=0..nb_ant_rx) and store the sum in temp[n]; for (ar=0; arnb_antennas_rx; ar++) { - result = dot_product((short*)primary_synch_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, 15); + result = dot_product((short*)primary_synch_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT); //((short*)sync_corr)[2*n] += ((short*) &result)[0]; //((short*)sync_corr)[2*n+1] += ((short*) &result)[1]; sync_corr_eNB[n] += abs32(result); diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index f308c0500a..189629566b 100755 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -390,7 +390,11 @@ typedef struct PHY_VARS_eNB_s { int32_t pucch1_stats_thres[NUMBER_OF_UE_MAX][10*1024]; int32_t pucch1ab_stats_cnt[NUMBER_OF_UE_MAX][10]; int32_t pucch1ab_stats[NUMBER_OF_UE_MAX][2*10*1024]; - + int32_t pusch_stats_rb[NUMBER_OF_UE_MAX][10240]; + int32_t pusch_stats_round[NUMBER_OF_UE_MAX][10240]; + int32_t pusch_stats_mcs[NUMBER_OF_UE_MAX][10240]; + int32_t pusch_stats_bsr[NUMBER_OF_UE_MAX][10240]; + int32_t pusch_stats_BO[NUMBER_OF_UE_MAX][10240]; #if ENABLE_RAL hash_table_t *ral_thresholds_timed; SLIST_HEAD(ral_thresholds_gen_poll_enb_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX]; diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index ca1e8a3d37..c64fbb807c 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -87,7 +87,7 @@ int *eNB_sync_buffer[2] = {eNB_sync_buffer0, eNB_sync_buffer1}; extern uint16_t hundred_times_log10_NPRB[100]; unsigned int max_peak_val; -int max_sect_id, max_sync_pos; +int max_sync_pos; //DCI_ALLOC_t dci_alloc[8]; @@ -342,69 +342,18 @@ void phy_procedures_emos_eNB_TX(unsigned char subframe, PHY_VARS_eNB *phy_vars_e } #endif -/* - void phy_procedures_eNB_S_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag) { - int sect_id = 0, aa; - - if (next_slot%2==0) { - #ifdef DEBUG_PHY_PROC - msg("[PHY][eNB %d] Frame %d, slot %d: Generating pilots for DL-S\n", - phy_vars_eNB->Mod_id,phy_vars_eNB->frame,next_slot); - #endif - - for (sect_id=0;sect_idlte_frame_parms.nb_antennas_tx; aa++) { - - - #ifdef IFFT_FPGA - memset(&phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id][aa][next_slot*(phy_vars_eNB->lte_frame_parms.N_RB_DL*12)*(phy_vars_eNB->lte_frame_parms.symbols_per_tti>>1)], - 0,(phy_vars_eNB->lte_frame_parms.N_RB_DL*12)*(phy_vars_eNB->lte_frame_parms.symbols_per_tti>>1)*sizeof(mod_sym_t)); - #else - memset(&phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id][aa][next_slot*phy_vars_eNB->lte_frame_parms.ofdm_symbol_size*(phy_vars_eNB->lte_frame_parms.symbols_per_tti>>1)], - 0,phy_vars_eNB->lte_frame_parms.ofdm_symbol_size*(phy_vars_eNB->lte_frame_parms.symbols_per_tti>>1)*sizeof(mod_sym_t)); - #endif - } - - generate_pilots_slot(phy_vars_eNB, - phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id], - AMP, - next_slot); - - msg("[PHY][eNB] Frame %d, subframe %d Generating PSS\n", - phy_vars_eNB->frame,next_slot>>1); - - generate_pss(phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id], - 4*AMP, - &phy_vars_eNB->lte_frame_parms, - 2, - next_slot); - - } - else { - #ifdef PHY_ABSTRACTION - generate_pss_emul(phy_vars_eNB,sect_id); - #endif - } - } - } - } -*/ void phy_procedures_eNB_S_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type) { UNUSED(r_type); - // unsigned char sect_id=0; int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx; #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_S_RX(%d)\n", phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_rx, subframe); #endif - // for (sect_id=0;sect_idNum_ue_spec_dci, DCI_pdu->Num_common_dci, DCI_pdu->dci_alloc, @@ -2137,7 +2083,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e stop_meas(&phy_vars_eNB->dlsch_scrambling_stats); start_meas(&phy_vars_eNB->dlsch_modulation_stats); - // for (sect_id=0;sect_idlte_eNB_common_vars.txdataF[0], AMP, subframe, @@ -2271,7 +2217,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e num_pdcch_symbols,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe), 0, subframe<<1); - // for (sect_id=0;sect_idlte_eNB_common_vars.txdataF[0], AMP, subframe, @@ -2430,15 +2376,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e subframe<<1); stop_meas(&phy_vars_eNB->dlsch_scrambling_stats); start_meas(&phy_vars_eNB->dlsch_modulation_stats); - //for (sect_id=0;sect_idtransmission_mode[(uint8_t)UE_id] == 5) && - (phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->dl_power_off == 0)) - amp = (int16_t)(((int32_t)AMP*(int32_t)ONE_OVER_SQRT2_Q15)>>15); - else*/ - // amp = AMP; - // if (UE_id == 1) - // LOG_I(PHY,"[MYEMOS] MCS_i %d\n", phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->mcs); re_allocated = dlsch_modulation(phy_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, @@ -2484,10 +2422,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e // printf("[PHY][eNB] Frame %d subframe %d Checking for phich\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe); if (is_phich_subframe(&phy_vars_eNB->lte_frame_parms,subframe)) { -#ifdef DEBUG_PHY_PROC - // LOG_D(PHY,"[eNB %d] Frame %d, subframe %d: Calling generate_phich_top\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, subframe); -#endif - // for (sect_id=0;sect_idMod_id,frame, subframe); #endif - /* -#ifdef OAI_USRP - for (aa=0;aalte_frame_parms.nb_antennas_rx;aa++) - rescale(&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti], - phy_vars_eNB->lte_frame_parms.samples_per_tti); -#endif - */ + phy_vars_eNB->rb_mask_ul[0]=0; phy_vars_eNB->rb_mask_ul[1]=0; phy_vars_eNB->rb_mask_ul[2]=0; @@ -3174,7 +3101,6 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ for (l=0; llte_frame_parms.symbols_per_tti/2; l++) { - // for (sect_id=0;sect_idlte_frame_parms, &phy_vars_eNB->lte_eNB_common_vars, l, @@ -3194,72 +3120,6 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ stop_meas(&phy_vars_eNB->ofdm_demod_stats); } - sect_id = 0; - - /* - for (UE_id=0;UE_ideNB_UE_stats[(uint32_t)UE_id].mode>PRACH) && (last_slot%2==1)) { - #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d] frame %d, slot %d: Doing SRS estimation and measurements for UE_id %d (UE_mode %d)\n", - phy_vars_eNB->Mod_id, - phy_vars_eNB->proc[sched_subframe].frame_tx, last_slot, - UE_id,phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].mode); - #endif - for (sect_id=0;sect_idlte_frame_parms, - &phy_vars_eNB->lte_eNB_common_vars, - &phy_vars_eNB->lte_eNB_srs_vars[(uint32_t)UE_id], - &phy_vars_eNB->soundingrs_ul_config_dedicated[(uint32_t)UE_id], - last_slot>>1, - sect_id); - lte_eNB_srs_measurements(phy_vars_eNB, - sect_id, - UE_id, - 1); - #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d] frame %d, slot %d: UE_id %d, sect_id %d: RX RSSI %d (from SRS)\n", - phy_vars_eNB->Mod_id, - phy_vars_eNB->proc[sched_subframe].frame_tx, last_slot, - UE_id,sect_id, - phy_vars_eNB->PHY_measurements_eNB[sect_id].rx_rssi_dBm[(uint32_t)UE_id]); - #endif - } - - sect_id=0; - #ifdef USER_MODE - //write_output("srs_est0.m","srsest0",phy_vars_eNB->lte_eNB_common_vars.srs_ch_estimates[0][0],512,1,1); - //write_output("srs_est1.m","srsest1",phy_vars_eNB->lte_eNB_common_vars.srs_ch_estimates[0][1],512,1,1); - #endif - - //msg("timing advance in\n"); - sync_pos = lte_est_timing_advance(&phy_vars_eNB->lte_frame_parms, - &phy_vars_eNB->lte_eNB_srs_vars[(uint32_t)UE_id], - §_id, - phy_vars_eNB->first_run_timing_advance[(uint32_t)UE_id], - number_of_cards, - 24576); - - //msg("timing advance out\n"); - - //phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset = sync_pos - phy_vars_eNB->lte_frame_parms.nb_prefix_samples/8; - phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset = 0; - phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].sector = sect_id; - #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d] frame %d, slot %d: user %d in sector %d: timing_advance = %d\n", - phy_vars_eNB->Mod_id, - phy_vars_eNB->proc[sched_subframe].frame_tx, last_slot, - UE_id, sect_id, - phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset); - #endif - } - } - else { - - } - */ - // Check for active processes in current subframe harq_pid = subframe2harq_pid(&phy_vars_eNB->lte_frame_parms, frame,subframe); @@ -3270,33 +3130,18 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->cba_last_reception[i]=0; } - // LOG_I(PHY,"subframe %d: nPRS %d\n",last_slot>>1,phy_vars_eNB->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[last_slot-1]); - for (i=0; icooperation_flag > 0) && (two_ues_connected == 1)) - break; - */ #ifdef OPENAIR2 if (phy_vars_eNB->eNB_UE_stats[i].mode == RA_RESPONSE) process_Msg3(phy_vars_eNB,sched_subframe,i,harq_pid); #endif - /* - #ifdef DEBUG_PHY_PROC - if (phy_vars_eNB->ulsch_eNB[i]) { - - LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d, subframe %d rnti %x, alloc %d, Msg3 %d\n",phy_vars_eNB->Mod_id, - harq_pid,frame,subframe, - (phy_vars_eNB->ulsch_eNB[i]->rnti), - (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_scheduling_flag), - (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag) - ); - } - #endif - */ + phy_vars_eNB->pusch_stats_rb[i][(frame*10)+subframe] = 0; + phy_vars_eNB->pusch_stats_round[i][(frame*10)+subframe] = 0; + phy_vars_eNB->pusch_stats_mcs[i][(frame*10)+subframe] = 0; + phy_vars_eNB->pusch_stats_bsr[i][(frame*10)+subframe] = 0; if ((phy_vars_eNB->ulsch_eNB[i]) && (phy_vars_eNB->ulsch_eNB[i]->rnti>0) && @@ -3326,13 +3171,12 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ subframe, phy_vars_eNB->eNB_UE_stats[i].sector); } else { - LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d Mode %s sect_id %d\n", + LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d Mode %s\n", phy_vars_eNB->Mod_id, frame, subframe, i, - mode_string[phy_vars_eNB->eNB_UE_stats[i].mode], - phy_vars_eNB->eNB_UE_stats[i].sector); + mode_string[phy_vars_eNB->eNB_UE_stats[i].mode]); } #endif @@ -3352,7 +3196,6 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ } } - //#ifdef DEBUG_PHY_PROC LOG_D(PHY, "[eNB %d][PUSCH %d] Frame %d Subframe %d Demodulating PUSCH: dci_alloc %d, rar_alloc %d, round %d, first_rb %d, nb_rb %d, mcs %d, TBS %d, rv %d, cyclic_shift %d (n_DMRS2 %d, cyclicShift_common %d, nprs %d), O_ACK %d \n", phy_vars_eNB->Mod_id,harq_pid,frame,subframe, @@ -3369,7 +3212,9 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift, nPRS, phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->O_ACK); - //#endif + phy_vars_eNB->pusch_stats_rb[i][(frame*10)+subframe] = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb; + phy_vars_eNB->pusch_stats_round[i][(frame*10)+subframe] = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round; + phy_vars_eNB->pusch_stats_mcs[i][(frame*10)+subframe] = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->mcs; start_meas(&phy_vars_eNB->ulsch_demodulation_stats); if (abstraction_flag==0) { @@ -3429,26 +3274,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[0], phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[1], ret); - //#endif //DEBUG_PHY_PROC - /* - if ((two_ues_connected==1) && (phy_vars_eNB->cooperation_flag==2)) { - for (j=0;jlte_frame_parms.nb_antennas_rx;j++) { - phy_vars_eNB->eNB_UE_stats[i].UL_rssi[j] = dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power_0[j]) - - phy_vars_eNB->rx_total_gain_eNB_dB; - phy_vars_eNB->eNB_UE_stats[i+1].UL_rssi[j] = dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power_1[j]) - - phy_vars_eNB->rx_total_gain_eNB_dB; - } - #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d] Frame %d subframe %d: ULSCH %d RX power UE0 (%d,%d) dB RX power UE1 (%d,%d)\n", - phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,last_slot>>1,i, - dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power_0[0]), - dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power_0[1]), - dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power_1[0]), - dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power_1[1])); - #endif - } - else { - */ + //compute the expected ULSCH RX power (for the stats) phy_vars_eNB->ulsch_eNB[(uint32_t)i]->harq_processes[harq_pid]->delta_TF = @@ -3478,13 +3304,6 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ if (ret == (1+MAX_TURBO_ITERATIONS)) { - /* - if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round>0) { - dump_ulsch(phy_vars_eNB, sched_subframe, i); - mac_xface->macphy_exit("retransmission in error"); - } - */ - phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[harq_pid][phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round]++; phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 1; phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_ACK = 0; @@ -3769,10 +3588,10 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ } #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d] frame %d, subframe %d: user %d in sector %d: timing advance = %d\n", + LOG_D(PHY,"[eNB %d] frame %d, subframe %d: user %d: timing advance = %d\n", phy_vars_eNB->Mod_id, frame, subframe, - i, sect_id, + i, phy_vars_eNB->eNB_UE_stats[i].timing_advance_update); #endif @@ -4318,7 +4137,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ #ifdef PHY_ABSTRACTION else { lte_eNB_I0_measurements_emul(phy_vars_eNB, - sect_id); + 0); } #endif diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index e3f6d8e78c..3d205eb871 100644 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -90,8 +90,8 @@ void ue_mac_reset(module_id_t module_idP,uint8_t eNB_index) int rrc_mac_config_req( - module_id_t Mod_id, - int CC_id, + module_id_t Mod_idP, + int CC_idP, eNB_flag_t eNB_flagP, rnti_t rntiP, uint8_t eNB_index, @@ -129,28 +129,31 @@ rrc_mac_config_req( int i; int UE_id = -1; + eNB_MAC_INST *eNB = &eNB_mac_inst[Mod_idP]; + UE_list_t *UE_list= &eNB->UE_list; + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN); if (eNB_flagP==0) { - LOG_I(MAC,"[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",Mod_id,eNB_index); + LOG_I(MAC,"[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",Mod_idP,eNB_index); if (tdd_Config != NULL) { - UE_mac_inst[Mod_id].tdd_Config = tdd_Config; + UE_mac_inst[Mod_idP].tdd_Config = tdd_Config; } } else { - UE_id = find_UE_id(Mod_id, rntiP); + UE_id = find_UE_id(Mod_idP, rntiP); if (physicalConfigDedicated == NULL) { - LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY\n", Mod_id, CC_id); + LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY\n", Mod_idP, CC_idP); } else { - LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY for UE %d (%x)\n", Mod_id, CC_id, UE_id, UE_RNTI(Mod_id, UE_id)); + LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY for UE %d (%x)\n", Mod_idP, CC_idP, UE_id, UE_RNTI(Mod_idP, UE_id)); } } if (tdd_Config && SIwindowsize && SIperiod) { if (eNB_flagP == ENB_FLAG_YES) { - mac_xface->phy_config_sib1_eNB(Mod_id, CC_id, tdd_Config, *SIwindowsize, *SIperiod); + mac_xface->phy_config_sib1_eNB(Mod_idP, CC_idP, tdd_Config, *SIwindowsize, *SIperiod); } else { - mac_xface->phy_config_sib1_ue(Mod_id,0,eNB_index,tdd_Config,*SIwindowsize,*SIperiod); + mac_xface->phy_config_sib1_ue(Mod_idP,0,eNB_index,tdd_Config,*SIwindowsize,*SIperiod); } } @@ -165,106 +168,112 @@ rrc_mac_config_req( LOG_I(MAC,"[CONFIG]pusch_config_common.groupAssignmentPUSCH = %ld\n",radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH); LOG_I(MAC,"[CONFIG]pusch_config_common.sequenceHoppingEnabled = %d\n",radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled); LOG_I(MAC,"[CONFIG]pusch_config_common.cyclicShift = %ld\n",radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift); - mac_xface->phy_config_sib2_eNB(Mod_id, CC_id, radioResourceConfigCommon, ul_CarrierFreq, ul_Bandwidth, additionalSpectrumEmission, mbsfn_SubframeConfigList); + mac_xface->phy_config_sib2_eNB(Mod_idP, CC_idP, radioResourceConfigCommon, ul_CarrierFreq, ul_Bandwidth, additionalSpectrumEmission, mbsfn_SubframeConfigList); } else { - UE_mac_inst[Mod_id].radioResourceConfigCommon = radioResourceConfigCommon; - mac_xface->phy_config_sib2_ue(Mod_id,0,eNB_index,radioResourceConfigCommon,ul_CarrierFreq,ul_Bandwidth,additionalSpectrumEmission,mbsfn_SubframeConfigList); + UE_mac_inst[Mod_idP].radioResourceConfigCommon = radioResourceConfigCommon; + mac_xface->phy_config_sib2_ue(Mod_idP,0,eNB_index,radioResourceConfigCommon,ul_CarrierFreq,ul_Bandwidth,additionalSpectrumEmission,mbsfn_SubframeConfigList); } } // SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters->logicalChannelGroup if (logicalChannelConfig!= NULL) { if (eNB_flagP==0) { - LOG_I(MAC,"[CONFIG][UE %d] Applying RRC logicalChannelConfig from eNB%d\n",Mod_id,eNB_index); - UE_mac_inst[Mod_id].logicalChannelConfig[logicalChannelIdentity]=logicalChannelConfig; - UE_mac_inst[Mod_id].scheduling_info.Bj[logicalChannelIdentity]=0; // initilize the bucket for this lcid + LOG_I(MAC,"[CONFIG][UE %d] Applying RRC logicalChannelConfig from eNB%d\n",Mod_idP,eNB_index); + UE_mac_inst[Mod_idP].logicalChannelConfig[logicalChannelIdentity]=logicalChannelConfig; + UE_mac_inst[Mod_idP].scheduling_info.Bj[logicalChannelIdentity]=0; // initilize the bucket for this lcid if (logicalChannelConfig->ul_SpecificParameters) { - UE_mac_inst[Mod_id].scheduling_info.bucket_size[logicalChannelIdentity]=logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate * + UE_mac_inst[Mod_idP].scheduling_info.bucket_size[logicalChannelIdentity]=logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate * logicalChannelConfig->ul_SpecificParameters->bucketSizeDuration; // set the max bucket size - UE_mac_inst[Mod_id].scheduling_info.LCGID[logicalChannelIdentity]=*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup; - LOG_D(MAC,"[CONFIG][UE %d] LCID %d is attached to the LCGID %d\n",Mod_id,logicalChannelIdentity,*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup); + UE_mac_inst[Mod_idP].scheduling_info.LCGID[logicalChannelIdentity]=*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup; + LOG_D(MAC,"[CONFIG][UE %d] LCID %d is attached to the LCGID %d\n",Mod_idP,logicalChannelIdentity,*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup); } else { - LOG_E(MAC,"[CONFIG][UE %d] LCID %d NULL ul_SpecificParameters\n",Mod_id,logicalChannelIdentity); + LOG_E(MAC,"[CONFIG][UE %d] LCID %d NULL ul_SpecificParameters\n",Mod_idP,logicalChannelIdentity); mac_xface->macphy_exit("NULL ul_SpecificParameters"); } } + else { + if (logicalChannelConfig) + UE_list->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = *logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup; + else + UE_list->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = 0; + } } if (mac_MainConfig != NULL) { if (eNB_flagP==0) { - LOG_I(MAC,"[CONFIG][UE%d] Applying RRC macMainConfig from eNB%d\n",Mod_id,eNB_index); - UE_mac_inst[Mod_id].macConfig=mac_MainConfig; - UE_mac_inst[Mod_id].measGapConfig=measGapConfig; + LOG_I(MAC,"[CONFIG][UE%d] Applying RRC macMainConfig from eNB%d\n",Mod_idP,eNB_index); + UE_mac_inst[Mod_idP].macConfig=mac_MainConfig; + UE_mac_inst[Mod_idP].measGapConfig=measGapConfig; if (mac_MainConfig->ul_SCH_Config) { if (mac_MainConfig->ul_SCH_Config->periodicBSR_Timer) { - UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer = (uint16_t) *mac_MainConfig->ul_SCH_Config->periodicBSR_Timer; + UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer = (uint16_t) *mac_MainConfig->ul_SCH_Config->periodicBSR_Timer; } else { - UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer = (uint16_t) MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity; + UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer = (uint16_t) MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity; } if (mac_MainConfig->ul_SCH_Config->maxHARQ_Tx) { - UE_mac_inst[Mod_id].scheduling_info.maxHARQ_Tx = (uint16_t) *mac_MainConfig->ul_SCH_Config->maxHARQ_Tx; + UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx = (uint16_t) *mac_MainConfig->ul_SCH_Config->maxHARQ_Tx; } else { - UE_mac_inst[Mod_id].scheduling_info.maxHARQ_Tx = (uint16_t) MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5; + UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx = (uint16_t) MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5; } if (mac_MainConfig->ul_SCH_Config->retxBSR_Timer) { - UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer = (uint16_t) mac_MainConfig->ul_SCH_Config->retxBSR_Timer; + UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer = (uint16_t) mac_MainConfig->ul_SCH_Config->retxBSR_Timer; } else { - UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer = (uint16_t)MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560; + UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer = (uint16_t)MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560; } } #ifdef Rel10 if (mac_MainConfig->ext1 && mac_MainConfig->ext1->sr_ProhibitTimer_r9) { - UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer = (uint16_t) *mac_MainConfig->ext1->sr_ProhibitTimer_r9; + UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer = (uint16_t) *mac_MainConfig->ext1->sr_ProhibitTimer_r9; } else { - UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer = (uint16_t) 0; + UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer = (uint16_t) 0; } #endif - UE_mac_inst[Mod_id].scheduling_info.periodicBSR_SF = get_sf_periodicBSRTimer(UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer); - UE_mac_inst[Mod_id].scheduling_info.retxBSR_SF = get_sf_retxBSRTimer(UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer); + UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_SF = get_sf_periodicBSRTimer(UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer); + UE_mac_inst[Mod_idP].scheduling_info.retxBSR_SF = get_sf_retxBSRTimer(UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer); - UE_mac_inst[Mod_id].scheduling_info.drx_config = mac_MainConfig->drx_Config; - UE_mac_inst[Mod_id].scheduling_info.phr_config = mac_MainConfig->phr_Config; + UE_mac_inst[Mod_idP].scheduling_info.drx_config = mac_MainConfig->drx_Config; + UE_mac_inst[Mod_idP].scheduling_info.phr_config = mac_MainConfig->phr_Config; if (mac_MainConfig->phr_Config) { - UE_mac_inst[Mod_id].PHR_state = mac_MainConfig->phr_Config->present; - UE_mac_inst[Mod_id].PHR_reconfigured = 1; - UE_mac_inst[Mod_id].scheduling_info.periodicPHR_Timer = mac_MainConfig->phr_Config->choice.setup.periodicPHR_Timer; - UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_Timer = mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer; - UE_mac_inst[Mod_id].scheduling_info.PathlossChange = mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange; + UE_mac_inst[Mod_idP].PHR_state = mac_MainConfig->phr_Config->present; + UE_mac_inst[Mod_idP].PHR_reconfigured = 1; + UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer = mac_MainConfig->phr_Config->choice.setup.periodicPHR_Timer; + UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer = mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer; + UE_mac_inst[Mod_idP].scheduling_info.PathlossChange = mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange; } else { - UE_mac_inst[Mod_id].PHR_reconfigured = 0; - UE_mac_inst[Mod_id].PHR_state = MAC_MainConfig__phr_Config_PR_setup; - UE_mac_inst[Mod_id].scheduling_info.periodicPHR_Timer = MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20; - UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_Timer = MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20; - UE_mac_inst[Mod_id].scheduling_info.PathlossChange = MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB1; + UE_mac_inst[Mod_idP].PHR_reconfigured = 0; + UE_mac_inst[Mod_idP].PHR_state = MAC_MainConfig__phr_Config_PR_setup; + UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer = MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20; + UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer = MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20; + UE_mac_inst[Mod_idP].scheduling_info.PathlossChange = MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB1; } - UE_mac_inst[Mod_id].scheduling_info.periodicPHR_SF = get_sf_perioidicPHR_Timer(UE_mac_inst[Mod_id].scheduling_info.periodicPHR_Timer); - UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_SF = get_sf_prohibitPHR_Timer(UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_Timer); - UE_mac_inst[Mod_id].scheduling_info.PathlossChange_db = get_db_dl_PathlossChange(UE_mac_inst[Mod_id].scheduling_info.PathlossChange); + UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_SF = get_sf_perioidicPHR_Timer(UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer); + UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_SF = get_sf_prohibitPHR_Timer(UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer); + UE_mac_inst[Mod_idP].scheduling_info.PathlossChange_db = get_db_dl_PathlossChange(UE_mac_inst[Mod_idP].scheduling_info.PathlossChange); LOG_D(MAC,"[UE %d] config PHR (%d): periodic %d (SF) prohibit %d (SF) pathlosschange %d (db) \n", - Mod_id, + Mod_idP, (mac_MainConfig->phr_Config)?mac_MainConfig->phr_Config->present:-1, - UE_mac_inst[Mod_id].scheduling_info.periodicPHR_SF, - UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_SF, - UE_mac_inst[Mod_id].scheduling_info.PathlossChange_db); + UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_SF, + UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_SF, + UE_mac_inst[Mod_idP].scheduling_info.PathlossChange_db); } } if (physicalConfigDedicated != NULL) { if (eNB_flagP==1) { - mac_xface->phy_config_dedicated_eNB(Mod_id, CC_id, UE_RNTI(Mod_id, UE_id), physicalConfigDedicated); + mac_xface->phy_config_dedicated_eNB(Mod_idP, CC_idP, UE_RNTI(Mod_idP, UE_id), physicalConfigDedicated); } else { - mac_xface->phy_config_dedicated_ue(Mod_id,0,eNB_index,physicalConfigDedicated); - UE_mac_inst[Mod_id].physicalConfigDedicated=physicalConfigDedicated; // for SR proc + mac_xface->phy_config_dedicated_ue(Mod_idP,0,eNB_index,physicalConfigDedicated); + UE_mac_inst[Mod_idP].physicalConfigDedicated=physicalConfigDedicated; // for SR proc } } @@ -273,11 +282,11 @@ rrc_mac_config_req( if (sCellToAddMod_r10 != NULL) { if (eNB_flagP==1) { - mac_xface->phy_config_dedicated_scell_eNB(Mod_id,UE_RNTI(Mod_id,UE_id),sCellToAddMod_r10,1); + mac_xface->phy_config_dedicated_scell_eNB(Mod_idP,UE_RNTI(Mod_idP,UE_id),sCellToAddMod_r10,1); } else { #warning "phy_config_dedicated_scell_ue is empty" - mac_xface->phy_config_dedicated_scell_ue(Mod_id,eNB_index,sCellToAddMod_r10,1); - UE_mac_inst[Mod_id].physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10; // using SCell index 0 + mac_xface->phy_config_dedicated_scell_ue(Mod_idP,eNB_index,sCellToAddMod_r10,1); + UE_mac_inst[Mod_idP].physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10; // using SCell index 0 } } @@ -286,22 +295,22 @@ rrc_mac_config_req( if (eNB_flagP == 0) { if (measObj!= NULL) { if (measObj[0]!= NULL) { - UE_mac_inst[Mod_id].n_adj_cells = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.count; - LOG_I(MAC,"Number of adjacent cells %d\n",UE_mac_inst[Mod_id].n_adj_cells); + UE_mac_inst[Mod_idP].n_adj_cells = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.count; + LOG_I(MAC,"Number of adjacent cells %d\n",UE_mac_inst[Mod_idP].n_adj_cells); - for (i=0; imeasObject.choice.measObjectEUTRA.cellsToAddModList->list.array[i]->physCellId; - LOG_I(MAC,"Cell %d : Nid_cell %d\n",i,UE_mac_inst[Mod_id].adj_cell_id[i]); + for (i=0; imeasObject.choice.measObjectEUTRA.cellsToAddModList->list.array[i]->physCellId; + LOG_I(MAC,"Cell %d : Nid_cell %d\n",i,UE_mac_inst[Mod_idP].adj_cell_id[i]); } - mac_xface->phy_config_meas_ue(Mod_id,0,eNB_index,UE_mac_inst[Mod_id].n_adj_cells,UE_mac_inst[Mod_id].adj_cell_id); + mac_xface->phy_config_meas_ue(Mod_idP,0,eNB_index,UE_mac_inst[Mod_idP].n_adj_cells,UE_mac_inst[Mod_idP].adj_cell_id); } /* if (quantityConfig != NULL) { if (quantityConfig[0] != NULL) { - UE_mac_inst[Mod_id].quantityConfig = quantityConfig[0]; - LOG_I(MAC,"UE %d configured filterCoeff.",UE_mac_inst[Mod_id].crnti); + UE_mac_inst[Mod_idP].quantityConfig = quantityConfig[0]; + LOG_I(MAC,"UE %d configured filterCoeff.",UE_mac_inst[Mod_idP].crnti); mac_xface->phy_config_meas_ue } } @@ -312,51 +321,51 @@ rrc_mac_config_req( if (eNB_flagP==0) { if(mobilityControlInfo != NULL) { - LOG_D(MAC,"[UE%d] MAC Reset procedure triggered by RRC eNB %d \n",Mod_id,eNB_index); - ue_mac_reset(Mod_id,eNB_index); + LOG_D(MAC,"[UE%d] MAC Reset procedure triggered by RRC eNB %d \n",Mod_idP,eNB_index); + ue_mac_reset(Mod_idP,eNB_index); if(mobilityControlInfo->radioResourceConfigCommon.rach_ConfigCommon) { - memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->rach_ConfigCommon, + memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->rach_ConfigCommon, (void *)mobilityControlInfo->radioResourceConfigCommon.rach_ConfigCommon, sizeof(RACH_ConfigCommon_t)); } - memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->prach_Config.prach_ConfigInfo, + memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->prach_Config.prach_ConfigInfo, (void *)mobilityControlInfo->radioResourceConfigCommon.prach_Config.prach_ConfigInfo, sizeof(PRACH_ConfigInfo_t)); - UE_mac_inst[Mod_id].radioResourceConfigCommon->prach_Config.rootSequenceIndex = mobilityControlInfo->radioResourceConfigCommon.prach_Config.rootSequenceIndex; + UE_mac_inst[Mod_idP].radioResourceConfigCommon->prach_Config.rootSequenceIndex = mobilityControlInfo->radioResourceConfigCommon.prach_Config.rootSequenceIndex; if(mobilityControlInfo->radioResourceConfigCommon.pdsch_ConfigCommon) { - memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->pdsch_ConfigCommon, + memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->pdsch_ConfigCommon, (void *)mobilityControlInfo->radioResourceConfigCommon.pdsch_ConfigCommon, sizeof(PDSCH_ConfigCommon_t)); } // not a pointer: mobilityControlInfo->radioResourceConfigCommon.pusch_ConfigCommon - memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->pusch_ConfigCommon, + memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->pusch_ConfigCommon, (void *)&mobilityControlInfo->radioResourceConfigCommon.pusch_ConfigCommon, sizeof(PUSCH_ConfigCommon_t)); if(mobilityControlInfo->radioResourceConfigCommon.phich_Config) { - /* memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->phich_Config, + /* memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->phich_Config, (void *)mobilityControlInfo->radioResourceConfigCommon.phich_Config, sizeof(PHICH_Config_t)); */ } if(mobilityControlInfo->radioResourceConfigCommon.pucch_ConfigCommon) { - memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->pucch_ConfigCommon, + memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->pucch_ConfigCommon, (void *)mobilityControlInfo->radioResourceConfigCommon.pucch_ConfigCommon, sizeof(PUCCH_ConfigCommon_t)); } if(mobilityControlInfo->radioResourceConfigCommon.soundingRS_UL_ConfigCommon) { - memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->soundingRS_UL_ConfigCommon, + memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->soundingRS_UL_ConfigCommon, (void *)mobilityControlInfo->radioResourceConfigCommon.soundingRS_UL_ConfigCommon, sizeof(SoundingRS_UL_ConfigCommon_t)); } if(mobilityControlInfo->radioResourceConfigCommon.uplinkPowerControlCommon) { - memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->uplinkPowerControlCommon, + memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->uplinkPowerControlCommon, (void *)mobilityControlInfo->radioResourceConfigCommon.uplinkPowerControlCommon, sizeof(UplinkPowerControlCommon_t)); } @@ -367,54 +376,54 @@ rrc_mac_config_req( } if(mobilityControlInfo->radioResourceConfigCommon.tdd_Config) { - UE_mac_inst[Mod_id].tdd_Config = mobilityControlInfo->radioResourceConfigCommon.tdd_Config; + UE_mac_inst[Mod_idP].tdd_Config = mobilityControlInfo->radioResourceConfigCommon.tdd_Config; } if(mobilityControlInfo->radioResourceConfigCommon.ul_CyclicPrefixLength) { - memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->ul_CyclicPrefixLength, + memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->ul_CyclicPrefixLength, (void *)mobilityControlInfo->radioResourceConfigCommon.ul_CyclicPrefixLength, sizeof(UL_CyclicPrefixLength_t)); } // store the previous rnti in case of failure, and set thenew rnti - UE_mac_inst[Mod_id].crnti_before_ho = UE_mac_inst[Mod_id].crnti; - UE_mac_inst[Mod_id].crnti = ((mobilityControlInfo->newUE_Identity.buf[0])|(mobilityControlInfo->newUE_Identity.buf[1]<<8)); - LOG_I(MAC,"[UE %d] Received new identity %x from %d\n", Mod_id, UE_mac_inst[Mod_id].crnti, eNB_index); - UE_mac_inst[Mod_id].rach_ConfigDedicated = malloc(sizeof(*mobilityControlInfo->rach_ConfigDedicated)); + UE_mac_inst[Mod_idP].crnti_before_ho = UE_mac_inst[Mod_idP].crnti; + UE_mac_inst[Mod_idP].crnti = ((mobilityControlInfo->newUE_Identity.buf[0])|(mobilityControlInfo->newUE_Identity.buf[1]<<8)); + LOG_I(MAC,"[UE %d] Received new identity %x from %d\n", Mod_idP, UE_mac_inst[Mod_idP].crnti, eNB_index); + UE_mac_inst[Mod_idP].rach_ConfigDedicated = malloc(sizeof(*mobilityControlInfo->rach_ConfigDedicated)); if (mobilityControlInfo->rach_ConfigDedicated) { - memcpy((void*)UE_mac_inst[Mod_id].rach_ConfigDedicated, + memcpy((void*)UE_mac_inst[Mod_idP].rach_ConfigDedicated, (void*)mobilityControlInfo->rach_ConfigDedicated, sizeof(*mobilityControlInfo->rach_ConfigDedicated)); } - mac_xface->phy_config_afterHO_ue(Mod_id,0,eNB_index,mobilityControlInfo,0); + mac_xface->phy_config_afterHO_ue(Mod_idP,0,eNB_index,mobilityControlInfo,0); } } if (mbsfn_SubframeConfigList != NULL) { if (eNB_flagP == 1) { - LOG_I(MAC,"[eNB %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_id, mbsfn_SubframeConfigList->list.count); - eNB_mac_inst[Mod_id].common_channels[0].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count; + LOG_I(MAC,"[eNB %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_idP, mbsfn_SubframeConfigList->list.count); + eNB_mac_inst[Mod_idP].common_channels[0].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count; for (i=0; ilist.count; i++) { - eNB_mac_inst[Mod_id].common_channels[0].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i]; - LOG_I(MAC, "[eNB %d][CONFIG] MBSFN_SubframeConfig[%d] pattern is %x\n", Mod_id, i, - eNB_mac_inst[Mod_id].common_channels[0].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]); + eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i]; + LOG_I(MAC, "[eNB %d][CONFIG] MBSFN_SubframeConfig[%d] pattern is %x\n", Mod_idP, i, + eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]); } #ifdef Rel10 - eNB_mac_inst[Mod_id].common_channels[0].MBMS_flag = MBMS_Flag; + eNB_mac_inst[Mod_idP].common_channels[0].MBMS_flag = MBMS_Flag; #endif } else { // UE - LOG_I(MAC,"[UE %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_id, mbsfn_SubframeConfigList->list.count); - UE_mac_inst[Mod_id].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count; + LOG_I(MAC,"[UE %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_idP, mbsfn_SubframeConfigList->list.count); + UE_mac_inst[Mod_idP].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count; for (i=0; ilist.count; i++) { - LOG_I(MAC, "[UE %d] Configuring MBSFN_SubframeConfig %d from received SIB2 \n", Mod_id, i); - UE_mac_inst[Mod_id].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i]; - // LOG_I("[UE %d] MBSFN_SubframeConfig[%d] pattern is %ld\n", Mod_id, - // UE_mac_inst[Mod_id].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]); + LOG_I(MAC, "[UE %d] Configuring MBSFN_SubframeConfig %d from received SIB2 \n", Mod_idP, i); + UE_mac_inst[Mod_idP].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i]; + // LOG_I("[UE %d] MBSFN_SubframeConfig[%d] pattern is %ld\n", Mod_idP, + // UE_mac_inst[Mod_idP].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]); } } } @@ -424,24 +433,24 @@ rrc_mac_config_req( if (mbsfn_AreaInfoList != NULL) { if (eNB_flagP == 1) { // One eNB could be part of multiple mbsfn syc area, this could change over time so reset each time - LOG_I(MAC,"[eNB %d][CONFIG] Received %d MBSFN Area Info\n", Mod_id, mbsfn_AreaInfoList->list.count); - eNB_mac_inst[Mod_id].common_channels[0].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count; + LOG_I(MAC,"[eNB %d][CONFIG] Received %d MBSFN Area Info\n", Mod_idP, mbsfn_AreaInfoList->list.count); + eNB_mac_inst[Mod_idP].common_channels[0].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count; for (i =0; i< mbsfn_AreaInfoList->list.count; i++) { - eNB_mac_inst[Mod_id].common_channels[0].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i]; - LOG_I(MAC,"[eNB %d][CONFIG] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n", Mod_id,i, - eNB_mac_inst[Mod_id].common_channels[0].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9); - mac_xface->phy_config_sib13_eNB(Mod_id,0,i,eNB_mac_inst[Mod_id].common_channels[0].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9); + eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i]; + LOG_I(MAC,"[eNB %d][CONFIG] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n", Mod_idP,i, + eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9); + mac_xface->phy_config_sib13_eNB(Mod_idP,0,i,eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9); } } else { // UE - LOG_I(MAC,"[UE %d][CONFIG] Received %d MBSFN Area Info\n", Mod_id, mbsfn_AreaInfoList->list.count); - UE_mac_inst[Mod_id].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count; + LOG_I(MAC,"[UE %d][CONFIG] Received %d MBSFN Area Info\n", Mod_idP, mbsfn_AreaInfoList->list.count); + UE_mac_inst[Mod_idP].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count; for (i =0; i< mbsfn_AreaInfoList->list.count; i++) { - UE_mac_inst[Mod_id].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i]; - LOG_I(MAC,"[UE %d] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n",Mod_id, i, - UE_mac_inst[Mod_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9); - mac_xface->phy_config_sib13_ue(Mod_id,0,eNB_index,i,UE_mac_inst[Mod_id].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9); + UE_mac_inst[Mod_idP].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i]; + LOG_I(MAC,"[UE %d] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n",Mod_idP, i, + UE_mac_inst[Mod_idP].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9); + mac_xface->phy_config_sib13_ue(Mod_idP,0,eNB_index,i,UE_mac_inst[Mod_idP].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9); } } } @@ -456,29 +465,29 @@ rrc_mac_config_req( LOG_I(MAC, "[CONFIG] Number of PMCH in this MBSFN Area %d\n", pmch_InfoList->list.count); for (i =0; i< pmch_InfoList->list.count; i++) { - eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9; + eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9; LOG_I(MAC, "[CONFIG] PMCH[%d]: This PMCH stop (sf_AllocEnd_r9) at subframe %ldth\n", i, - eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i]->sf_AllocEnd_r9); + eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i]->sf_AllocEnd_r9); LOG_I(MAC, "[CONFIG] PMCH[%d]: mch_Scheduling_Period = %ld\n", i, - eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i]->mch_SchedulingPeriod_r9); + eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i]->mch_SchedulingPeriod_r9); LOG_I(MAC, "[CONFIG] PMCH[%d]: dataMCS = %ld\n", i, - eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i]->dataMCS_r9); + eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i]->dataMCS_r9); // MBMS session info list in each MCH - eNB_mac_inst[Mod_id].common_channels[0].mbms_SessionList[i] = &pmch_InfoList->list.array[i]->mbms_SessionInfoList_r9; - LOG_I(MAC, "PMCH[%d] Number of session (MTCH) is: %d\n",i, eNB_mac_inst[Mod_id].common_channels[0].mbms_SessionList[i]->list.count); + eNB_mac_inst[Mod_idP].common_channels[0].mbms_SessionList[i] = &pmch_InfoList->list.array[i]->mbms_SessionInfoList_r9; + LOG_I(MAC, "PMCH[%d] Number of session (MTCH) is: %d\n",i, eNB_mac_inst[Mod_idP].common_channels[0].mbms_SessionList[i]->list.count); } } else { // UE - LOG_I(MAC, "[UE %d] Configuring PMCH_config from MCCH MESSAGE \n",Mod_id); + LOG_I(MAC, "[UE %d] Configuring PMCH_config from MCCH MESSAGE \n",Mod_idP); for (i =0; i< pmch_InfoList->list.count; i++) { - UE_mac_inst[Mod_id].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9; - LOG_I(MAC, "[UE %d] PMCH[%d]: MCH_Scheduling_Period = %ld\n", Mod_id, i, - UE_mac_inst[Mod_id].pmch_Config[i]->mch_SchedulingPeriod_r9); + UE_mac_inst[Mod_idP].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9; + LOG_I(MAC, "[UE %d] PMCH[%d]: MCH_Scheduling_Period = %ld\n", Mod_idP, i, + UE_mac_inst[Mod_idP].pmch_Config[i]->mch_SchedulingPeriod_r9); } - UE_mac_inst[Mod_id].mcch_status = 1; + UE_mac_inst[Mod_idP].mcch_status = 1; } } @@ -487,28 +496,28 @@ rrc_mac_config_req( if (eNB_flagP == 0) { if (cba_rnti) { - UE_mac_inst[Mod_id].cba_rnti[num_active_cba_groups-1] = cba_rnti; + UE_mac_inst[Mod_idP].cba_rnti[num_active_cba_groups-1] = cba_rnti; LOG_D(MAC,"[UE %d] configure CBA group %d RNTI %x for eNB %d (total active cba group %d)\n", - Mod_id,Mod_id%num_active_cba_groups, cba_rnti,eNB_index,num_active_cba_groups); - mac_xface->phy_config_cba_rnti(Mod_id,CC_id,eNB_flagP,eNB_index,cba_rnti,num_active_cba_groups-1, num_active_cba_groups); + Mod_idP,Mod_idP%num_active_cba_groups, cba_rnti,eNB_index,num_active_cba_groups); + mac_xface->phy_config_cba_rnti(Mod_idP,CC_idP,eNB_flagP,eNB_index,cba_rnti,num_active_cba_groups-1, num_active_cba_groups); } } else { if (cba_rnti) { LOG_D(MAC,"[eNB %d] configure CBA RNTI for UE %d (total active cba groups %d)\n", - Mod_id, UE_id, num_active_cba_groups); - eNB_mac_inst[Mod_id].common_channels[CC_id].num_active_cba_groups=num_active_cba_groups; + Mod_idP, UE_id, num_active_cba_groups); + eNB_mac_inst[Mod_idP].common_channels[CC_idP].num_active_cba_groups=num_active_cba_groups; for (i=0; i < num_active_cba_groups; i ++) { - if (eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] != cba_rnti + i) { - eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] = cba_rnti + i; + if (eNB_mac_inst[Mod_idP].common_channels[CC_idP].cba_rnti[i] != cba_rnti + i) { + eNB_mac_inst[Mod_idP].common_channels[CC_idP].cba_rnti[i] = cba_rnti + i; } //only configure UE ids up to num_active_cba_groups //we use them as candidates for the transmission of dci format0) if (UE_id%num_active_cba_groups == i) { - mac_xface->phy_config_cba_rnti(Mod_id,CC_id,eNB_flagP,UE_id,cba_rnti + i,i,num_active_cba_groups ); + mac_xface->phy_config_cba_rnti(Mod_idP,CC_idP,eNB_flagP,UE_id,cba_rnti + i,i,num_active_cba_groups ); LOG_D(MAC,"[eNB %d] configure CBA groups %d with RNTI %x for UE %d (total active cba groups %d)\n", - Mod_id, i, eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i],UE_id, num_active_cba_groups); + Mod_idP, i, eNB_mac_inst[Mod_idP].common_channels[CC_idP].cba_rnti[i],UE_id, num_active_cba_groups); } } } @@ -558,7 +567,7 @@ rrc_get_estimated_ue_distance( return eNB_UE_stats->distance.power_based; } - // LOG_D(LOCALIZE, "DEBUG ME, dist = %d\n", &eNB_mac_inst[ctxt_pP->module_id].UE_list.UE_template[CC_id][UE_id].distance.power_based); + // LOG_D(LOCALIZE, "DEBUG ME, dist = %d\n", &eNB_mac_inst[ctxt_pP->module_id].UE_list.UE_template[CC_idP][UE_id].distance.power_based); } diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index 79d8169839..405bb6ca95 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -654,9 +654,12 @@ typedef struct { // Logical channel info for link with RLC - /// UE BSR info for each logical channel group id + /// Last received UE BSR info for each logical channel group id uint8_t bsr_info[MAX_NUM_LCGID]; + /// LCGID mapping + long lcgidmap[11]; + /// phr information int8_t phr_info; @@ -743,6 +746,7 @@ typedef struct { int32_t ul_failure_timer; int32_t ra_pdcch_order_sent; int32_t ul_out_of_sync; + int32_t phr_received; } UE_sched_ctrl; /*! \brief eNB template for the Random access information */ typedef struct { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index d709dcdfda..1bd44c77ce 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -692,7 +692,7 @@ uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id) UE_TEMPLATE *UE_template = &eNB_mac_inst[module_idP].UE_list.UE_template[CC_id][UE_id]; UE_sched_ctrl *UE_sched_ctl = &eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[UE_id]; - LOG_D(MAC,"[eNB %d][PUSCH] Checking UL requirements UE %d/%x\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id)); + // do not schedule UE if UL is not working if (UE_sched_ctl->ul_failure_timer>0) @@ -700,6 +700,8 @@ uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id) if (UE_sched_ctl->ul_out_of_sync>0) return(0); + LOG_D(MAC,"[eNB %d][PUSCH] Checking UL requirements UE %d/%x\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id)); + if ((UE_template->bsr_info[LCGID0]>0) || (UE_template->bsr_info[LCGID1]>0) || (UE_template->bsr_info[LCGID2]>0) || @@ -707,6 +709,7 @@ uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id) (UE_template->ul_SR>0) || (UE_sched_ctl->ul_inactivity_timer>100)) { // uplink scheduling request + LOG_D(MAC,"[eNB %d][PUSCH] UE %d/%x should be scheduled\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id)); return(1); } else { return(0); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 4c34eea075..1500711639 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -89,6 +89,7 @@ void rx_sdu( eNB_MAC_INST *eNB = &eNB_mac_inst[enb_mod_idP]; UE_list_t *UE_list= &eNB->UE_list; int crnti_rx=0; + int old_buffer_info; start_meas(&eNB->rx_ulsch_sdu); @@ -130,6 +131,7 @@ void rx_sdu( enb_mod_idP, CC_idP, rx_ces[i], UE_list->UE_template[CC_idP][UE_id].phr_info); UE_list->UE_template[CC_idP][UE_id].phr_info_configured=1; } + UE_list->UE_sched_ctrl[UE_id].phr_received = 1; payload_ptr+=sizeof(POWER_HEADROOM_CMD); break; @@ -169,9 +171,31 @@ void rx_sdu( UE_list->UE_template[CC_idP][UE_id].bsr_info[lcgid] = (payload_ptr[0] & 0x3f); + // update buffer info + // old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]; + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[lcgid]]; + + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]; + + /* + if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info) + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info; + else + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0; + */ + + if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= 300000) + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 300000; + + PHY_vars_eNB_g[enb_mod_idP][CC_idP]->pusch_stats_bsr[UE_id][(frameP*10)+subframeP] = (payload_ptr[0] & 0x3f); + if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid] == 0 ) { UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid]=frameP; } + LOG_D(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : ul_total_buffer = %d (lcg increment %d, old %d)\n", + enb_mod_idP, CC_idP, rx_ces[i], UE_list->UE_template[CC_idP][UE_id].ul_total_buffer, + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid], + old_buffer_info); } else { @@ -188,6 +212,41 @@ void rx_sdu( UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2] = ((payload_ptr[1] & 0x0F) << 2) | ((payload_ptr[2] & 0xC0) >> 6); UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3] = (payload_ptr[2] & 0x3F); + + // update buffer info + old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0]; + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID0]]; + + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0]; + if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info) + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info; + else + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0; + + old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1]; + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID1]]; + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1]; + if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info) + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info; + else + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0; + + old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2]; + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2]]; + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2]; + if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info) + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info; + else + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0; + + old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3]; + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3]]; + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3]; + if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info) + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info; + else + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0; + LOG_D(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d: Received long BSR LCGID0 = %u LCGID1 = " "%u LCGID2 = %u LCGID3 = %u\n", enb_mod_idP, CC_idP, @@ -307,10 +366,11 @@ void rx_sdu( case DCCH : case DCCH1 : // if(eNB_mac_inst[module_idP][CC_idP].Dcch_lchan[UE_id].Active==1){ + #if defined(ENABLE_MAC_PAYLOAD_DEBUG) LOG_T(MAC,"offset: %d\n",(unsigned char)((unsigned char*)payload_ptr-sduP)); - + for (j=0; j<32; j++) { LOG_T(MAC,"%x ",payload_ptr[j]); } @@ -319,6 +379,12 @@ void rx_sdu( #endif if (UE_id != -1) { + // adjust buffer occupancy of the correponding logical channel group + if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] >= rx_lengths[i]) + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] - rx_lengths[i]; + else + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0; + // This check is just to make sure we didn't get a bogus SDU length, to be removed ... if (rx_lengths[i] UL-DCCH, received %d bytes form UE %d on LCID %d \n", @@ -361,6 +427,17 @@ void rx_sdu( enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id,rx_lcids[i]); if (UE_id != -1) { + // adjust buffer occupancy of the correponding logical channel group + LOG_D(MAC,"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d, removing from LCGID %d, %d\n", + enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id,rx_lcids[i], + UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]], + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]]); + + if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] >= rx_lengths[i]) + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] - rx_lengths[i]; + else + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0; + if ((rx_lengths[i] 0) ) { // MAX SIZE OF transport block mac_rlc_data_ind( enb_mod_idP, @@ -434,6 +511,7 @@ uint32_t bytes_to_bsr_index(int32_t nbytes) return(i-1); } +/* void adjust_bsr_info(int buffer_occupancy, uint16_t TBS, UE_TEMPLATE *UE_template) @@ -479,6 +557,7 @@ void adjust_bsr_info(int buffer_occupancy, } +*/ void add_ue_ulsch_info(module_id_t module_idP, int CC_id, int UE_id, sub_frame_t subframeP, UE_ULSCH_STATUS status) { @@ -705,8 +784,8 @@ void schedule_ulsch_rnti(module_id_t module_idP, uint8_t status = 0; uint8_t rb_table_index = -1; uint16_t TBS = 0; - int32_t buffer_occupancy=0; - uint32_t cqi_req,cshift,ndi,mcs,rballoc,tpc; + // int32_t buffer_occupancy=0; + uint32_t cqi_req,cshift,ndi,mcs=0,rballoc,tpc; int32_t normalized_rx_power, target_rx_power=-90; static int32_t tpc_accumulated=0; @@ -714,9 +793,9 @@ void schedule_ulsch_rnti(module_id_t module_idP, eNB_MAC_INST *eNB=&eNB_mac_inst[module_idP]; UE_list_t *UE_list=&eNB->UE_list; UE_TEMPLATE *UE_template; - int rvidx_tab[4] = {0,2,3,1}; + // int rvidx_tab[4] = {0,2,3,1}; LTE_DL_FRAME_PARMS *frame_parms; - + int drop_ue=0; // LOG_I(MAC,"entering ulsch preprocesor\n"); @@ -733,6 +812,8 @@ void schedule_ulsch_rnti(module_id_t module_idP, // don't schedule if Msg4 is not received yet if (UE_list->UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured==FALSE) { + LOG_I(MAC,"[eNB %d] frame %d subfarme %d, UE %d: not configured, skipping UE scheduling \n", + module_idP,frameP,subframeP,UE_id); continue; } @@ -751,15 +832,20 @@ void schedule_ulsch_rnti(module_id_t module_idP, eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti); if (eNB_UE_stats==NULL) { - LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d CC %d: no PHY context\n", module_idP,frameP,subframeP,UE_id,CC_id); + LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: no PHY context\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id); + drop_ue=1; continue; // mac_xface->macphy_exit("[MAC][eNB] Cannot find eNB_UE_stats\n"); } + if (drop_ue==1) + continue; + if (CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,aggregation,rnti)) { LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: not enough nCCE\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id); continue; // break; } + // printf("UE %d/%x is feasible, mode %s\n",UE_id,rnti,mode_string[eNB_UE_stats->mode]); if (eNB_UE_stats->mode == PUSCH) { // ue has a ulsch channel @@ -770,21 +856,14 @@ void schedule_ulsch_rnti(module_id_t module_idP, if (mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,1) == -1 ) { LOG_W(MAC,"[eNB %d] Scheduler Frame %d, subframeP %d: candidate harq_pid from PHY for UE %d CC %d RNTI %x\n", module_idP,frameP,subframeP, UE_id, CC_id, rnti); - // NN --> RK: Don't schedule UE if we cannot get harq pid - //should we continue or set harq_pid to 0? continue; } else LOG_T(MAC,"[eNB %d] Frame %d, subframeP %d, UE %d CC %d : got harq pid %d round %d (rnti %x,mode %s)\n", module_idP,frameP,subframeP,UE_id,CC_id, harq_pid, round,rnti,mode_string[eNB_UE_stats->mode]); -#undef EXMIMO_IOT -#ifndef EXMIMO_IOT - + PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP] = UE_template->ul_total_buffer; if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0)) || (round>0))// || ((frameP%10)==0)) // if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames -#else - if (round==0) // always schedule -#endif { LOG_D(MAC,"[eNB %d][PUSCH] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d)\n", module_idP,frameP,subframeP,UE_id,rnti,round,UE_template->ul_SR, @@ -848,7 +927,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, } UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=mcs; - buffer_occupancy = UE_template->ul_total_buffer; + // buffer_occupancy = UE_template->ul_total_buffer; while ((rb_table[rb_table_index]>(frame_parms->N_RB_UL-1-first_rb[CC_id])) && (rb_table_index>0)) { @@ -858,10 +937,11 @@ void schedule_ulsch_rnti(module_id_t module_idP, TBS = mac_xface->get_TBS_UL(mcs,rb_table[rb_table_index]); UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used_rx+=rb_table[rb_table_index]; UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS=TBS; - buffer_occupancy -= TBS; + // buffer_occupancy -= TBS; rballoc = mac_xface->computeRIV(frame_parms->N_RB_UL, first_rb[CC_id], rb_table[rb_table_index]); + // bad indices : 20 (40 PRB), 21 (45 PRB), 22 (48 PRB) // increment for next UE allocation first_rb[CC_id]+=rb_table[rb_table_index]; //store for possible retransmission @@ -871,11 +951,20 @@ void schedule_ulsch_rnti(module_id_t module_idP, module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs, first_rb[CC_id],rb_table[rb_table_index], rb_table_index,TBS,harq_pid); + + /* // Adjust BSR entries for LCGIDs adjust_bsr_info(buffer_occupancy, TBS, UE_template); - + */ + // adjust total UL buffer status by TBS, wait for UL sdus to do final update + LOG_D(MAC,"[eNB %d] CC_id %d UE %d/%x : adjusting ul_total_buffer, old %d, TBS %d\n", module_idP,CC_id,UE_id,rnti,UE_template->ul_total_buffer,TBS); + if (UE_template->ul_total_buffer > TBS) + UE_template->ul_total_buffer -= TBS; + else + UE_template->ul_total_buffer = 0; + LOG_D(MAC,"ul_total_buffer, new %d\n", UE_template->ul_total_buffer); // Cyclic shift for DM RS if(cooperation_flag == 2) { if(UE_id == 1) { // For Distriibuted Alamouti, cyclic shift applied to 2nd UE diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index dc52699eb8..2acda1c746 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -939,7 +939,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, // LOG_I(MAC,"store ulsch buffers\n"); // convert BSR to bytes for comparison with tbs - store_ulsch_buffer(module_idP,frameP, subframeP); + // store_ulsch_buffer(module_idP,frameP, subframeP); //LOG_I(MAC,"assign max mcs min rb\n"); // maximize MCS and then allocate required RB according to the buffer occupancy with the limit of max available UL RB @@ -1097,7 +1097,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, } } - +/* void store_ulsch_buffer(module_id_t module_idP, int frameP, sub_frame_t subframeP) { @@ -1108,6 +1108,9 @@ void store_ulsch_buffer(module_id_t module_idP, int frameP, sub_frame_t subframe for (UE_id=UE_list->head_ul; UE_id>=0; UE_id=UE_list->next_ul[UE_id]) { + if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) + continue; + UE_template = &UE_list->UE_template[UE_PCCID(module_idP,UE_id)][UE_id]; //LOG_I(MAC,"[UE %d next %d] SR is %d\n",UE_id, UE_list->next_ul[UE_id], UE_template->ul_SR); @@ -1138,7 +1141,7 @@ void store_ulsch_buffer(module_id_t module_idP, int frameP, sub_frame_t subframe } } } - +*/ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subframeP, uint16_t *first_rb) @@ -1148,7 +1151,7 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra uint16_t n,UE_id; uint8_t CC_id; rnti_t rnti = -1; - int mcs=cmin(16,openair_daq_vars.target_ue_ul_mcs); + int mcs; int rb_table_index=0,tbs,tx_power; eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP]; UE_list_t *UE_list = &eNB->UE_list; @@ -1156,6 +1159,7 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra UE_TEMPLATE *UE_template; LTE_DL_FRAME_PARMS *frame_parms; + for (i=UE_list->head_ul; i>=0; i=UE_list->next_ul[i]) { rnti = UE_RNTI(module_idP,i); @@ -1165,6 +1169,11 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) continue; + if (UE_list->UE_sched_ctrl[i].phr_received == 1) + mcs = 20; // if we've received the power headroom information the UE, we can go to maximum mcs + else + mcs = 10; // otherwise, limit to QPSK PUSCH + UE_id = i; for (n=0; nnumactiveULCCs[UE_id]; n++) { diff --git a/openair3/NAS/TOOLS/ue_data.c b/openair3/NAS/TOOLS/ue_data.c index abfb2ee773..6c7df70a08 100644 --- a/openair3/NAS/TOOLS/ue_data.c +++ b/openair3/NAS/TOOLS/ue_data.c @@ -375,7 +375,7 @@ static void _gen_emm_data(emm_nvdata_t* data) data->imsi.u.num.digit12 = 1; data->imsi.u.num.digit13 = 1; data->imsi.u.num.digit14 = 1; - data->imsi.u.num.digit15 = 0; + data->imsi.u.num.digit15 = 1; data->rplmn.MCCdigit1 = 2; data->rplmn.MCCdigit2 = 0; diff --git a/openair3/NAS/TOOLS/usim_data.c b/openair3/NAS/TOOLS/usim_data.c index 624f076c6e..ffde00c268 100644 --- a/openair3/NAS/TOOLS/usim_data.c +++ b/openair3/NAS/TOOLS/usim_data.c @@ -185,7 +185,7 @@ int main (int argc, const char* argv[]) usim_data.imsi.u.num.digit15 = 0b1111; #endif #if (SELECTED_PLMN == OAI_LTEBOX) -#warning "IMSI 208.93.00001110" +#warning "IMSI 208.93.00001111" /* * International Mobile Subscriber Identity * IMSI = MCC + MNC + MSIN = 208 (France) + 10 (SFR) + 00001234 @@ -207,7 +207,7 @@ int main (int argc, const char* argv[]) usim_data.imsi.u.num.digit12 = 1; usim_data.imsi.u.num.digit13 = 1; usim_data.imsi.u.num.digit14 = 1; - usim_data.imsi.u.num.digit15 = 0; + usim_data.imsi.u.num.digit15 = 1; #endif #if (SELECTED_PLMN == TEST1) #warning "IMSI 001.01.000001234" diff --git a/openair3/NAS/UE/ESM/esm_ebr_context.c b/openair3/NAS/UE/ESM/esm_ebr_context.c index fcf278a2e4..a5ab5532e1 100755 --- a/openair3/NAS/UE/ESM/esm_ebr_context.c +++ b/openair3/NAS/UE/ESM/esm_ebr_context.c @@ -281,13 +281,13 @@ int esm_ebr_context_create( } res = sprintf(command_line, - "ifconfig oip1 %s netmask %s broadcast %s up", + "ifconfig oip1 %s netmask %s broadcast %s", ipv4_addr, netmask, broadcast); // AssertFatal((res > 0) && (res < 128), // "error in system command line"); LOG_TRACE(INFO, "ESM-PROC - executing %s ", command_line); - system(command_line); + //system(command_line); break; case NET_PDN_TYPE_IPV6: diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index ece81dc7c3..652cd53f9f 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -313,6 +313,7 @@ int trx_usrp_set_freq(openair0_device* device, openair0_config_t *openair0_cfg, usrp_state_t *s = (usrp_state_t*)device->priv; + printf("Setting USRP TX Freq %f, RX Freq %f\n",openair0_cfg[0].tx_freq[0],openair0_cfg[0].rx_freq[0]); s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[0]); s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[0]); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf index 4a9113282f..0a9201eda8 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf @@ -143,10 +143,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 8f1ed46edb..691542e277 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -3499,6 +3499,11 @@ int main( int argc, char **argv ) #endif + write_output("pusch_rb.m","puschrb",PHY_vars_eNB_g[0][0]->pusch_stats_rb,10240,1,2); + write_output("pusch_mcs.m","puschmcs",PHY_vars_eNB_g[0][0]->pusch_stats_mcs,10240,1,2); + write_output("pusch_round.m","puschround",PHY_vars_eNB_g[0][0]->pusch_stats_round,10240,1,2); + write_output("pusch_bsr.m","puschbsr",PHY_vars_eNB_g[0][0]->pusch_stats_bsr,10240,1,2); + write_output("pusch_BO.m","puschBO",PHY_vars_eNB_g[0][0]->pusch_stats_BO,10240,1,2); // stop threads #ifdef XFORMS printf("waiting for XFORMS thread\n"); diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index c31ad32009..b5a09d6623 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -447,8 +447,8 @@ static void *UE_thread_synch(void *arg) } #ifndef EXMIMO openair0.trx_set_freq_func(&openair0,&openair0_cfg[0],0); - openair0.trx_set_gains_func(&openair0,&openair0_cfg[0]); - openair0.trx_stop_func(0); + //openair0.trx_set_gains_func(&openair0,&openair0_cfg[0]); + //openair0.trx_stop_func(0); #else openair0_set_frequencies(&openair0,&openair0_cfg[0],0); openair0_set_gains(&openair0,&openair0_cfg[0]); @@ -1229,7 +1229,7 @@ void *UE_thread(void *arg) } } else { LOG_E( PHY, "[SCHED][UE] UE RX thread busy (IC %d)!!\n", instance_cnt_rx); - if (instance_cnt_rx > 1) { + if (instance_cnt_rx > 2) { exit_fun("instance_cnt_rx > 1"); return &UE_thread_retval; } @@ -1265,7 +1265,7 @@ void *UE_thread(void *arg) } else { LOG_E( PHY, "[SCHED][UE] UE TX thread busy (IC %d)!!\n" ); - if (instance_cnt_tx>1) { + if (instance_cnt_tx>2) { exit_fun("instance_cnt_tx > 1"); return &UE_thread_retval; } From b37e234eccc3bd358eb03b46f3cbc1ef02ef5023 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Mon, 7 Mar 2016 21:59:30 +0100 Subject: [PATCH 058/214] added CQI request timer. CQI only requested periodically. MCS20 on UL works now. --- openair2/LAYER2/MAC/defs.h | 1 + openair2/LAYER2/MAC/eNB_scheduler.c | 2 ++ openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 13 +++++++++++-- targets/RT/USER/lte-softmodem.c | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index 405bb6ca95..078b4fde24 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -742,6 +742,7 @@ typedef struct { uint16_t ta_timer; int16_t ta_update; int32_t context_active_timer; + int32_t cqi_req_timer; int32_t ul_inactivity_timer; int32_t ul_failure_timer; int32_t ra_pdcch_order_sent; diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index dbc094034b..5f68448e6b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -127,6 +127,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, // increment this, it is cleared when we receive an sdu eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].ul_inactivity_timer++; + + eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].cqi_req_timer++; if (mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti)==NULL) { // mac_remove_ue(module_idP, i, frameP, subframeP); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 1500711639..6953926101 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -873,7 +873,14 @@ void schedule_ulsch_rnti(module_id_t module_idP, UE_template->ul_SR = 0; aggregation = process_ue_cqi(module_idP,UE_id); // =2 by default!! status = mac_eNB_get_rrc_status(module_idP,rnti); - cqi_req = (status < RRC_CONNECTED)? 0:1; + if (status < RRC_CONNECTED) + cqi_req = 0; + else if (UE_list->UE_sched_ctrl[UE_id].cqi_req_timer>30) { + cqi_req = 1; + UE_list->UE_sched_ctrl[UE_id].cqi_req_timer=0; + } + else + cqi_req = 0; //power control //compute the expected ULSCH RX power (for the stats) @@ -918,7 +925,9 @@ void schedule_ulsch_rnti(module_id_t module_idP, UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power=target_rx_power; UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1=UE_template->pre_assigned_mcs_ul; mcs = cmin (UE_template->pre_assigned_mcs_ul, openair_daq_vars.target_ue_ul_mcs); // adjust, based on user-defined MCS - + if ((cqi_req==1) && (mcs==20)) { + mcs=19; + } if (UE_template->pre_allocated_rb_table_index_ul >=0) { rb_table_index=UE_template->pre_allocated_rb_table_index_ul; } else { diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 691542e277..aa0c440c20 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -318,7 +318,7 @@ static LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; int multi_thread=1; uint32_t target_dl_mcs = 28; //maximum allowed mcs -uint32_t target_ul_mcs = 19; +uint32_t target_ul_mcs = 20; uint32_t timing_advance = 0; uint8_t exit_missed_slots=1; uint64_t num_missed_slots=0; // counter for the number of missed slots From 9915db73978681223814ea1d056390976d0879df Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 11 Mar 2016 14:47:13 +0100 Subject: [PATCH 059/214] extra logging for debugging (with Csaba Sipos) --- openair2/LAYER2/MAC/defs.h | 1 + .../LAYER2/MAC/eNB_scheduler_primitives.c | 5 ++- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 38 +++++++++++-------- .../CONF/enb.band7.tm1.50PRB.usrpb210.conf | 4 +- .../CONF/enb.band7.tm1.usrpb210.conf | 6 +-- 5 files changed, 32 insertions(+), 22 deletions(-) diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index 078b4fde24..48d958f54d 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -745,6 +745,7 @@ typedef struct { int32_t cqi_req_timer; int32_t ul_inactivity_timer; int32_t ul_failure_timer; + int32_t ul_scheduled; int32_t ra_pdcch_order_sent; int32_t ul_out_of_sync; int32_t phr_received; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 1bd44c77ce..d8cd21d366 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -707,7 +707,7 @@ uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id) (UE_template->bsr_info[LCGID2]>0) || (UE_template->bsr_info[LCGID3]>0) || (UE_template->ul_SR>0) || - (UE_sched_ctl->ul_inactivity_timer>100)) { // uplink scheduling request + ((UE_sched_ctl->ul_inactivity_timer>100)&&(UE_sched_ctl->ul_scheduled>0))) { // uplink scheduling request LOG_D(MAC,"[eNB %d][PUSCH] UE %d/%x should be scheduled\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id)); return(1); @@ -1105,7 +1105,8 @@ void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list; if (UE_id != -1) { - LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); + if (mac_eNB_get_rrc_status(mod_idP,UE_RNTI(mod_idP,UE_id)) < RRC_CONNECTED) + LOG_I(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); UE_list->UE_template[cc_idP][UE_id].ul_SR = 1; UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE; } else { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 6953926101..cf637d165e 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -109,7 +109,9 @@ void rx_sdu( if (UE_id!=-1) { UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer=0; - UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=0; + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer =0; + UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1<UE_sched_ctrl[UE_id].ul_out_of_sync > 0) { UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync=0; mac_eNB_rrc_ul_in_sync(enb_mod_idP,CC_idP,frameP,subframeP,UE_RNTI(enb_mod_idP,UE_id)); @@ -173,6 +175,7 @@ void rx_sdu( // update buffer info // old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]; + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[lcgid]]; UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]; @@ -192,10 +195,10 @@ void rx_sdu( if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid] == 0 ) { UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid]=frameP; } - LOG_D(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : ul_total_buffer = %d (lcg increment %d, old %d)\n", + + LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : ul_total_buffer = %d (lcg increment %d)\n", enb_mod_idP, CC_idP, rx_ces[i], UE_list->UE_template[CC_idP][UE_id].ul_total_buffer, - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid], - old_buffer_info); + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]); } else { @@ -793,6 +796,8 @@ void schedule_ulsch_rnti(module_id_t module_idP, eNB_MAC_INST *eNB=&eNB_mac_inst[module_idP]; UE_list_t *UE_list=&eNB->UE_list; UE_TEMPLATE *UE_template; + UE_sched_ctrl *UE_sched_ctrl; + // int rvidx_tab[4] = {0,2,3,1}; LTE_DL_FRAME_PARMS *frame_parms; int drop_ue=0; @@ -851,7 +856,8 @@ void schedule_ulsch_rnti(module_id_t module_idP, if (eNB_UE_stats->mode == PUSCH) { // ue has a ulsch channel DCI_pdu = &eNB->common_channels[CC_id].DCI_pdu; - UE_template = &UE_list->UE_template[CC_id][UE_id]; + UE_template = &UE_list->UE_template[CC_id][UE_id]; + UE_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id]; if (mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,1) == -1 ) { LOG_W(MAC,"[eNB %d] Scheduler Frame %d, subframeP %d: candidate harq_pid from PHY for UE %d CC %d RNTI %x\n", @@ -867,17 +873,17 @@ void schedule_ulsch_rnti(module_id_t module_idP, { LOG_D(MAC,"[eNB %d][PUSCH] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d)\n", module_idP,frameP,subframeP,UE_id,rnti,round,UE_template->ul_SR, - UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer, - UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); + UE_sched_ctrl->ul_inactivity_timer, + UE_sched_ctrl->ul_failure_timer); // reset the scheduling request UE_template->ul_SR = 0; aggregation = process_ue_cqi(module_idP,UE_id); // =2 by default!! status = mac_eNB_get_rrc_status(module_idP,rnti); if (status < RRC_CONNECTED) cqi_req = 0; - else if (UE_list->UE_sched_ctrl[UE_id].cqi_req_timer>30) { + else if (UE_sched_ctrl->cqi_req_timer>30) { cqi_req = 1; - UE_list->UE_sched_ctrl[UE_id].cqi_req_timer=0; + UE_sched_ctrl->cqi_req_timer=0; } else cqi_req = 0; @@ -955,12 +961,14 @@ void schedule_ulsch_rnti(module_id_t module_idP, first_rb[CC_id]+=rb_table[rb_table_index]; //store for possible retransmission UE_template->nb_rb_ul[harq_pid] = rb_table[rb_table_index]; + UE_sched_ctrl->ul_scheduled |= (1< RRC_CONNECTED) && + if ((mac_eNB_get_rrc_status(module_idP,rnti) > RRC_CONNECTED) && (UE_is_to_be_scheduled(module_idP,CC_id,UE_id) == 0)) { active_UEs[cba_group]++; } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index 7e17a07512..72047f44de 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -140,10 +140,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf index 0a9201eda8..985017e8d5 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf @@ -82,7 +82,7 @@ eNBs = rach_messagePowerOffsetGroupB = ; */ rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; + rach_preambleInitialReceivedTargetPower = -100; rach_preambleTransMax = 10; rach_raResponseWindowSize = 10; rach_macContentionResolutionTimer = 48; @@ -143,10 +143,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; From a33d8050cf8280ee119517912f00b8a103a43979 Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 11 Mar 2016 17:16:49 +0100 Subject: [PATCH 060/214] more logging for CSABA --- openair1/SCHED/phy_procedures_lte_eNb.c | 9 +++++++++ openair2/LAYER2/MAC/eNB_scheduler.c | 1 + .../LAYER2/MAC/eNB_scheduler_primitives.c | 4 ++-- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 19 ++++++++++++++----- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index c64fbb807c..5070861889 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -3416,6 +3416,15 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[harq_pid]++; phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors++; //dump_ulsch(phy_vars_eNB, sched_subframe, i); + // indicate error to MAC + mac_xface->rx_sdu(phy_vars_eNB->Mod_id, + phy_vars_eNB->CC_id, + frame,subframe, + phy_vars_eNB->ulsch_eNB[i]->rnti, + NULL, + 0, + harq_pid, + &phy_vars_eNB->ulsch_eNB[i]->Msg3_flag); } } } // ulsch in error diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 5f68448e6b..3edc92e605 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -125,6 +125,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti)); next_i= UE_list->next[i]; + PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]=-63; // increment this, it is cleared when we receive an sdu eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].ul_inactivity_timer++; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index d8cd21d366..03ac161a9a 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -706,8 +706,8 @@ uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id) (UE_template->bsr_info[LCGID1]>0) || (UE_template->bsr_info[LCGID2]>0) || (UE_template->bsr_info[LCGID3]>0) || - (UE_template->ul_SR>0) || - ((UE_sched_ctl->ul_inactivity_timer>100)&&(UE_sched_ctl->ul_scheduled>0))) { // uplink scheduling request + (UE_template->ul_SR>0) || // uplink scheduling request + ((UE_sched_ctl->ul_inactivity_timer>100)&&(UE_sched_ctl->ul_scheduled!=0xFF))) { LOG_D(MAC,"[eNB %d][PUSCH] UE %d/%x should be scheduled\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id)); return(1); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index cf637d165e..3bae9af445 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -107,6 +107,11 @@ void rx_sdu( LOG_D(MAC,"[eNB %d] CC_id %d Received ULSCH sdu from PHY (rnti %x, UE_id %d), parsing header\n",enb_mod_idP,CC_idP,rntiP,UE_id); + if (sduP==NULL) { // we've got an error after N rounds + UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1<UE_sched_ctrl[UE_id].ul_inactivity_timer=0; UE_list->UE_sched_ctrl[UE_id].ul_failure_timer =0; @@ -117,8 +122,12 @@ void rx_sdu( mac_eNB_rrc_ul_in_sync(enb_mod_idP,CC_idP,frameP,subframeP,UE_RNTI(enb_mod_idP,UE_id)); } } + + payload_ptr = parse_ulsch_header(sduP,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,sdu_lenP); - + + + eNB->eNB_stats[CC_idP].ulsch_bytes_rx=sdu_lenP; eNB->eNB_stats[CC_idP].total_ulsch_bytes_rx+=sdu_lenP; eNB->eNB_stats[CC_idP].total_ulsch_pdus_rx+=1; @@ -195,10 +204,10 @@ void rx_sdu( if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid] == 0 ) { UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid]=frameP; } - - LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : ul_total_buffer = %d (lcg increment %d)\n", - enb_mod_idP, CC_idP, rx_ces[i], UE_list->UE_template[CC_idP][UE_id].ul_total_buffer, - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]); + if (mac_eNB_get_rrc_status(enb_mod_idP,UE_RNTI(enb_mod_idP,UE_id)) < RRC_CONNECTED) + LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : ul_total_buffer = %d (lcg increment %d)\n", + enb_mod_idP, CC_idP, rx_ces[i], UE_list->UE_template[CC_idP][UE_id].ul_total_buffer, + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]); } else { From d9e40977ed7cee6f31892807276c1ca8ce83e17d Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 13 Mar 2016 22:58:00 +0100 Subject: [PATCH 061/214] changes to VCD logging for UL debugging --- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 9 +- openair1/SCHED/phy_procedures_lte_eNb.c | 27 +++--- openair2/LAYER2/MAC/eNB_scheduler.c | 4 +- .../LAYER2/MAC/eNB_scheduler_primitives.c | 2 +- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 9 +- openair2/UTIL/LOG/vcd_signal_dumper.c | 48 +++++++++- openair2/UTIL/LOG/vcd_signal_dumper.h | 44 ++++++++- .../CONF/enb.band3.tm1.usrpb210.conf | 10 +-- .../CONF/enb.band7.tm1.50PRB.usrpb210.conf | 4 +- .../CONF/enb.band7.tm1.usrpb210.conf | 4 +- targets/RT/USER/eNB_usrp.gtkw | 89 ++++++++++++++++--- 11 files changed, 201 insertions(+), 49 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index ca4e8be933..c9887d1c1a 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -288,13 +288,12 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, time_stats_t *, time_stats_t *); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING,1); + harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[sched_subframe].frame_rx,subframe); + + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,1); // x1 is set in lte_gold_generic x2 = ((uint32_t)ulsch->rnti<<14) + ((uint32_t)subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1 - - // harq_pid = (ulsch->RRCConnRequest_flag == 0) ? subframe2harq_pid_tdd(frame_parms->tdd_config,subframe) : 0; - harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[sched_subframe].frame_rx,subframe); ulsch_harq = ulsch->harq_processes[harq_pid]; if (harq_pid==255) { @@ -1408,7 +1407,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, } - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING,0); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,0); return(ret); } diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 5070861889..fe8346bb86 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -3060,8 +3060,6 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ ANFBmode_t bundling_flag; PUCCH_FMT_t format; uint8_t nPRS; - // uint8_t two_ues_connected = 0; - uint8_t pusch_active = 0; LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_eNB->lte_frame_parms; int sync_pos; uint16_t rnti=0; @@ -3123,8 +3121,6 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ // Check for active processes in current subframe harq_pid = subframe2harq_pid(&phy_vars_eNB->lte_frame_parms, frame,subframe); - pusch_active = 0; - // reset the cba flag used for collision detection for (i=0; i < NUM_MAX_CBA_GROUP; i++) { phy_vars_eNB->cba_last_reception[i]=0; @@ -3138,16 +3134,14 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ #endif - phy_vars_eNB->pusch_stats_rb[i][(frame*10)+subframe] = 0; + phy_vars_eNB->pusch_stats_rb[i][(frame*10)+subframe] = -63; phy_vars_eNB->pusch_stats_round[i][(frame*10)+subframe] = 0; - phy_vars_eNB->pusch_stats_mcs[i][(frame*10)+subframe] = 0; - phy_vars_eNB->pusch_stats_bsr[i][(frame*10)+subframe] = 0; + phy_vars_eNB->pusch_stats_mcs[i][(frame*10)+subframe] = -63; if ((phy_vars_eNB->ulsch_eNB[i]) && (phy_vars_eNB->ulsch_eNB[i]->rnti>0) && (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_scheduling_flag==1)) { - pusch_active = 1; round = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round; for (int rb=0; @@ -3246,7 +3240,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ sched_subframe, 0, // control_only_flag phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->V_UL_DAI, - 0); + 0);//phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb>20 ? 1 : 0); } #ifdef PHY_ABSTRACTION @@ -3638,7 +3632,6 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ } -#ifdef PUCCH else if ((phy_vars_eNB->dlsch_eNB[i][0]) && (phy_vars_eNB->dlsch_eNB[i][0]->rnti>0)) { // check for PUCCH @@ -3937,9 +3930,12 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ SR_payload); } } - } // PUCCH processing - -#endif //PUCCH + // dump stats to VCD + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS0+harq_pid,phy_vars_eNB->pusch_stats_mcs[0][(frame*10)+subframe]); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB0+harq_pid,phy_vars_eNB->pusch_stats_rb[0][(frame*10)+subframe]); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND0+harq_pid,phy_vars_eNB->pusch_stats_round[0][(frame*10)+subframe]); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI0+harq_pid,dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[0]->ulsch_power[0])); + } // ulsch_eNB[0] && ulsch_eNB[0]->rnti>0 && ulsch_eNB[0]->subframe_scheduling_flag == 1 if ((frame % 100 == 0) && (subframe == 4)) { for (harq_idx=0; harq_idx<8; harq_idx++) { @@ -4015,7 +4011,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ sched_subframe, 0, // control_only_flag phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->V_UL_DAI, - 0); + 0);//phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb>20 ? 1 : 0); } #ifdef PHY_ABSTRACTION @@ -4132,10 +4128,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ } // loop i=0 ... NUMBER_OF_UE_MAX-1 - // if (pusch_active == 0) { if (abstraction_flag == 0) { - // LOG_D(PHY,"[eNB] Frame %d, subframe %d Doing I0_measurements\n", - // (((subframe)==9)?-1:0) + phy_vars_eNB->proc[sched_subframe].frame_tx,subframe); lte_eNB_I0_measurements(phy_vars_eNB, subframe, 0, diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 3edc92e605..a73daad499 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -125,7 +125,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti)); next_i= UE_list->next[i]; - PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]=-63; + PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]=-63; + if (i==UE_list->head) + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]); // increment this, it is cleared when we receive an sdu eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].ul_inactivity_timer++; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 03ac161a9a..324226f3a8 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -707,7 +707,7 @@ uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id) (UE_template->bsr_info[LCGID2]>0) || (UE_template->bsr_info[LCGID3]>0) || (UE_template->ul_SR>0) || // uplink scheduling request - ((UE_sched_ctl->ul_inactivity_timer>100)&&(UE_sched_ctl->ul_scheduled!=0xFF))) { + ((UE_sched_ctl->ul_inactivity_timer>100)&&(UE_sched_ctl->ul_scheduled==0))) { LOG_D(MAC,"[eNB %d][PUSCH] UE %d/%x should be scheduled\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id)); return(1); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 3bae9af445..c36e77bfcb 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -200,7 +200,8 @@ void rx_sdu( UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 300000; PHY_vars_eNB_g[enb_mod_idP][CC_idP]->pusch_stats_bsr[UE_id][(frameP*10)+subframeP] = (payload_ptr[0] & 0x3f); - + if (UE_id == UE_list->head) + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,PHY_vars_eNB_g[enb_mod_idP][CC_idP]->pusch_stats_bsr[UE_id][(frameP*10)+subframeP]); if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid] == 0 ) { UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid]=frameP; } @@ -877,6 +878,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, module_idP,frameP,subframeP,UE_id,CC_id, harq_pid, round,rnti,mode_string[eNB_UE_stats->mode]); PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP] = UE_template->ul_total_buffer; + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO,PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP]); if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0)) || (round>0))// || ((frameP%10)==0)) // if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames { @@ -953,7 +955,8 @@ void schedule_ulsch_rnti(module_id_t module_idP, UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=mcs; // buffer_occupancy = UE_template->ul_total_buffer; - while ((rb_table[rb_table_index]>(frame_parms->N_RB_UL-1-first_rb[CC_id])) && + while (((rb_table[rb_table_index]>(frame_parms->N_RB_UL-1-first_rb[CC_id])) || + (rb_table[rb_table_index]>39)) && (rb_table_index>0)) { rb_table_index--; } @@ -971,6 +974,8 @@ void schedule_ulsch_rnti(module_id_t module_idP, //store for possible retransmission UE_template->nb_rb_ul[harq_pid] = rb_table[rb_table_index]; UE_sched_ctrl->ul_scheduled |= (1<head) + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SCHEDULED,UE_sched_ctrl->ul_scheduled); if (mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n", diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.c b/openair2/UTIL/LOG/vcd_signal_dumper.c index 31ce2e0d71..39c66c0b61 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.c +++ b/openair2/UTIL/LOG/vcd_signal_dumper.c @@ -118,7 +118,42 @@ const char* eurecomVariablesNames[] = { "mp_alloc", "mp_free", "ue_inst_cnt_rx", - "ue_inst_cnt_tx" + "ue_inst_cnt_tx", + "ue0_BSR", + "ue0_BO", + "ue0_scheduled", + "ue0_rssi0", + "ue0_rssi1", + "ue0_rssi2", + "ue0_rssi3", + "ue0_rssi4", + "ue0_rssi5", + "ue0_rssi6", + "ue0_rssi7", + "ue0_MCS0", + "ue0_MCS1", + "ue0_MCS2", + "ue0_MCS3", + "ue0_MCS4", + "ue0_MCS5", + "ue0_MCS6", + "ue0_MCS7", + "ue0_RB0", + "ue0_RB1", + "ue0_RB2", + "ue0_RB3", + "ue0_RB4", + "ue0_RB5", + "ue0_RB6", + "ue0_RB7", + "ue0_ROUND0", + "ue0_ROUND1", + "ue0_ROUND2", + "ue0_ROUND3", + "ue0_ROUND4", + "ue0_ROUND5", + "ue0_ROUND6", + "ue0_ROUND7", }; const char* eurecomFunctionsNames[] = { @@ -200,7 +235,16 @@ const char* eurecomFunctionsNames[] = { "macxface_phy_config_sib2_eNB", "macxface_phy_config_dedicated_eNB", "phy_ue_compute_prach", - "phy_enb_ulsch_decoding", + "phy_enb_ulsch_decoding0", + "phy_enb_ulsch_decoding1", + "phy_enb_ulsch_decoding2", + "phy_enb_ulsch_decoding3", + "phy_enb_ulsch_decoding4", + "phy_enb_ulsch_decoding5", + "phy_enb_ulsch_decoding6", + "phy_enb_ulsch_decoding7", + "phy_enb_ulsch_decoding8", + "phy_enb_ulsch_decoding9", "phy_enb_sfgen", "phy_enb_prach_rx", "phy_enb_pdcch_tx", diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.h b/openair2/UTIL/LOG/vcd_signal_dumper.h index 9ca55846fd..18c0d17339 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.h +++ b/openair2/UTIL/LOG/vcd_signal_dumper.h @@ -91,6 +91,41 @@ typedef enum { VCD_SIGNAL_DUMPER_VARIABLE_MP_FREE, VCD_SIGNAL_DUMPER_VARIABLES_UE_INST_CNT_RX, VCD_SIGNAL_DUMPER_VARIABLES_UE_INST_CNT_TX, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SCHEDULED, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI0, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI1, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI2, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI3, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI4, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI5, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI6, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI7, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS0, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS1, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS2, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS3, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS4, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS5, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS6, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS7, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB0, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB1, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB2, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB3, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB4, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB5, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB6, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB7, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND0, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND1, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND2, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND3, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND4, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND5, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND6, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND7, VCD_SIGNAL_DUMPER_VARIABLES_LAST, VCD_SIGNAL_DUMPER_VARIABLES_END = VCD_SIGNAL_DUMPER_VARIABLES_LAST, } vcd_signal_dump_variables; @@ -174,7 +209,14 @@ typedef enum { VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_CONFIG_SIB2_ENB, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_CONFIG_DEDICATED_ENB, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_UE_COMPUTE_PRACH, - VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING1, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING2, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING3, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING4, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING5, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING6, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING7, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_SFGEN, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX, diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band3.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band3.tm1.usrpb210.conf index 1a38352409..0a6def7757 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band3.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band3.tm1.usrpb210.conf @@ -17,7 +17,7 @@ eNBs = mobile_country_code = "208"; - mobile_network_code = "92"; + mobile_network_code = "93"; ////////// Physical parameters: @@ -36,7 +36,7 @@ eNBs = nb_antennas_tx = 1; nb_antennas_rx = 1; tx_gain = 90; - rx_gain = 135; + rx_gain = 125; prach_root = 0; prach_config_index = 0; prach_high_speed = "DISABLE"; @@ -131,7 +131,7 @@ eNBs = }; ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.13.11"; + mme_ip_address = ( { ipv4 = "192.168.12.11"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -141,10 +141,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.10/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index 72047f44de..7e17a07512 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -140,10 +140,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf index 985017e8d5..7839a52d21 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf @@ -143,10 +143,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/RT/USER/eNB_usrp.gtkw b/targets/RT/USER/eNB_usrp.gtkw index ca9427a38d..5c85d91546 100644 --- a/targets/RT/USER/eNB_usrp.gtkw +++ b/targets/RT/USER/eNB_usrp.gtkw @@ -1,16 +1,16 @@ [*] [*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI -[*] Wed Sep 9 13:51:16 2015 +[*] Sun Mar 13 08:08:42 2016 [*] -[dumpfile] "/homes/kaltenbe/openair_dump_eNB_usrp_note4.gtk" -[dumpfile_mtime] "Wed Sep 9 13:39:25 2015" -[dumpfile_size] 323681028 -[savefile] "/homes/kaltenbe/Devel/openair/openair4G/trunk/targets/RT/USER/eNB.gtkw" -[timestart] 63022760000 -[size] 1855 1056 -[pos] -851 -429 +[dumpfile] "/tmp/openair_dump_eNB.vcd" +[dumpfile_mtime] "Sun Mar 13 08:07:27 2016" +[dumpfile_size] 273954069 +[savefile] "/home/papillon/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw" +[timestart] 0 +[size] 1535 876 +[pos] -1 -1 *-22.793451 63031840000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -[sst_width] 224 +[sst_width] 284 [signals_width] 230 [sst_expanded] 1 [sst_vpaned_height] 294 @@ -50,16 +50,83 @@ functions.eNB_thread_rx9 functions.eNB_thread_tx9 functions.phy_procedures_eNb_tx functions.phy_procedures_eNb_rx +@24 +variables.ue0_BO[63:0] +@420 +variables.ue0_BSR[63:0] +@28 +functions.phy_enb_ulsch_decoding0 +@420 +variables.ue0_rssi0[63:0] +variables.ue0_MCS0[63:0] +variables.ue0_RB0[63:0] +@24 +variables.ue0_ROUND0[63:0] +@28 +functions.phy_enb_ulsch_decoding1 +@420 +variables.ue0_rssi1[63:0] +variables.ue0_MCS1[63:0] +variables.ue0_RB1[63:0] +@24 +variables.ue0_ROUND1[63:0] +@28 +functions.phy_enb_ulsch_decoding2 +@420 +variables.ue0_rssi2[63:0] +variables.ue0_MCS2[63:0] +variables.ue0_RB2[63:0] +@24 +variables.ue0_ROUND2[63:0] +@28 +functions.phy_enb_ulsch_decoding3 +@420 +variables.ue0_rssi3[63:0] +variables.ue0_MCS3[63:0] +variables.ue0_RB3[63:0] +@24 +variables.ue0_ROUND3[63:0] +@28 +functions.phy_enb_ulsch_decoding4 +@420 +variables.ue0_rssi4[63:0] +variables.ue0_MCS4[63:0] +variables.ue0_RB4[63:0] +@24 +variables.ue0_ROUND4[63:0] +@28 +functions.phy_enb_ulsch_decoding5 +@420 +variables.ue0_rssi5[63:0] +variables.ue0_MCS5[63:0] +variables.ue0_RB5[63:0] +@24 +variables.ue0_ROUND5[63:0] +@28 +functions.phy_enb_ulsch_decoding6 +@420 +variables.ue0_rssi6[63:0] +variables.ue0_MCS6[63:0] +variables.ue0_RB6[63:0] +@24 +variables.ue0_ROUND6[63:0] +@28 +functions.phy_enb_ulsch_decoding7 +@420 +variables.ue0_rssi7[63:0] +variables.ue0_MCS7[63:0] +variables.ue0_RB7[63:0] +@24 +variables.ue0_ROUND7[63:0] +@28 functions.phy_enb_prach_rx functions.phy_eNB_dlsch_encoding functions.phy_eNB_dlsch_modulation functions.phy_eNB_dlsch_scrambling functions.phy_enb_pdcch_tx -functions.phy_enb_ulsch_decoding functions.phy_enb_rs_tx functions.rrc_mac_config_req functions.rlc_data_req -@29 functions.udp_enb_task [pattern_trace] 1 [pattern_trace] 0 From 7c016904d1eb5cb02038dfb8070ca61661bce531 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 15 Mar 2016 10:50:45 +0100 Subject: [PATCH 062/214] add sudo to deleting asn1 tmp dir --- cmake_targets/tools/build_helper | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index c8adf45257..82602b8cee 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -288,7 +288,7 @@ install_asn1c_from_source(){ asn1_install_dir=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_dir " ( - rm -rf /tmp/asn1c-r1516 + $SUDO rm -rf /tmp/asn1c-r1516 mkdir -p /tmp/asn1c-r1516 cd /tmp/asn1c-r1516 svn co https://github.com/vlm/asn1c/trunk /tmp/asn1c-r1516 -r 1516 @@ -397,4 +397,4 @@ if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then fi return $stat -} \ No newline at end of file +} From 902f70ae5eba918e0d1ba822135b4edefb42684b Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 15 Mar 2016 13:41:09 +0100 Subject: [PATCH 063/214] Remove some traces in --- openair3/TEST/EPC_TEST/play_scenario.c | 43 ++++++++++++++----- openair3/TEST/EPC_TEST/play_scenario_fsm.c | 5 ++- openair3/TEST/EPC_TEST/play_scenario_parse.c | 3 +- .../EPC_TEST/play_scenario_s1ap_compare_ie.c | 8 ++-- 4 files changed, 41 insertions(+), 18 deletions(-) diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index cafdd93d31..b2207d39d7 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -835,13 +835,13 @@ int et_play_scenario(et_scenario_t* const scenario, const struct shift_packet_s while (shift) { packet = scenario->list_packet; while (packet) { - fprintf(stdout, "*shift: %p\n", shift); - fprintf(stdout, "\tframe_number: %d\n", shift->frame_number); - fprintf(stdout, "\tshift_seconds: %ld\n", shift->shift_seconds); - fprintf(stdout, "\tshift_microseconds: %ld\n", shift->shift_microseconds); - fprintf(stdout, "\tsingle: %d\n\n", shift->single); - fprintf(stdout, "\tshift_all_packets_seconds: %ld\n", shift_all_packets.tv_sec); - fprintf(stdout, "\tshift_all_packets_microseconds: %ld\n", shift_all_packets.tv_usec); + //fprintf(stdout, "*shift: %p\n", shift); + //fprintf(stdout, "\tframe_number: %d\n", shift->frame_number); + //fprintf(stdout, "\tshift_seconds: %ld\n", shift->shift_seconds); + //fprintf(stdout, "\tshift_microseconds: %ld\n", shift->shift_microseconds); + //fprintf(stdout, "\tsingle: %d\n\n", shift->single); + //fprintf(stdout, "\tshift_all_packets_seconds: %ld\n", shift_all_packets.tv_sec); + //fprintf(stdout, "\tshift_all_packets_microseconds: %ld\n", shift_all_packets.tv_usec); AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0), "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u", @@ -977,7 +977,7 @@ int et_play_scenario(et_scenario_t* const scenario, const struct shift_packet_s } packet = packet->next; } - et_display_scenario(scenario); + //et_display_scenario(scenario); // create SCTP ITTI task: same as eNB code if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) { @@ -1016,6 +1016,7 @@ static void et_usage ( fprintf (stdout, "\n"); fprintf (stdout, "\t-d | --test-dir Directory where a set of files related to a particular test are located\n"); fprintf (stdout, "\t-c | --enb-conf-file Provide an eNB config file, valid for the testbed\n"); + fprintf (stdout, "\t-D | --delay-on-exit Wait delay-in-sec before exiting\n"); fprintf (stdout, "\t-f | --shift-packet Shift the timing of a packet'\n"); fprintf (stdout, "\t-F | --shift-packets Shift the timing of packets starting at frame 'frame' included\n"); fprintf (stdout, "\t-m | --max-speed Play scenario as fast as possible without respecting frame timings\n"); @@ -1035,7 +1036,8 @@ et_config_parse_opt_line ( char **et_dir_name, char **scenario_file_name, char **enb_config_file_name, - shift_packet_t **shifts) + shift_packet_t **shifts, + int *delay_on_exit) //------------------------------------------------------------------------------ { int option = 0; @@ -1048,6 +1050,7 @@ et_config_parse_opt_line ( LONG_OPTION_SCENARIO_FILE, LONG_OPTION_MAX_SPEED, LONG_OPTION_TEST_DIR, + LONG_OPTION_DELAY_EXIT, LONG_OPTION_SHIFT_PACKET, LONG_OPTION_SHIFT_PACKETS, LONG_OPTION_HELP, @@ -1059,6 +1062,7 @@ et_config_parse_opt_line ( {"scenario ", required_argument, 0, LONG_OPTION_SCENARIO_FILE}, {"max-speed ", no_argument, 0, LONG_OPTION_MAX_SPEED}, {"test-dir", required_argument, 0, LONG_OPTION_TEST_DIR}, + {"delay-on-exit", required_argument, 0, LONG_OPTION_DELAY_EXIT}, {"shift-packet", required_argument, 0, LONG_OPTION_SHIFT_PACKET}, {"shift-packets", required_argument, 0, LONG_OPTION_SHIFT_PACKETS}, {"help", no_argument, 0, LONG_OPTION_HELP}, @@ -1101,6 +1105,19 @@ et_config_parse_opt_line ( } break; + case LONG_OPTION_DELAY_EXIT: + case 'D': + if (optarg) { + delay_on_exit = atoi(optarg); + if (0 > delay_on_exit) { + fprintf(stderr, "Please provide a valid -D/--delay-on-exit argument, %s is not a valid value\n", delay_on_exit); + exit(1); + } + printf("Delay on exit is %d\n", delay_on_exit); + } + break; + + case LONG_OPTION_SHIFT_PACKET: case 'f': if (optarg) { @@ -1187,6 +1204,7 @@ int main( int argc, char **argv ) char *enb_config_file_name = NULL; struct shift_packet_s *shifts = NULL; int ret = 0; + int delay_on_exit = 0; et_scenario_t *scenario = NULL; char play_scenario_filename[NAME_MAX]; @@ -1205,7 +1223,7 @@ int main( int argc, char **argv ) asn1_xer_print = 1; //parameters - actions = et_config_parse_opt_line (argc, argv, &et_dir_name, &scenario_file_name, &enb_config_file_name, &shifts); //Command-line options + actions = et_config_parse_opt_line (argc, argv, &et_dir_name, &scenario_file_name, &enb_config_file_name, &shifts, &delay_on_exit); //Command-line options if (actions & PLAY_SCENARIO) { if (et_generate_xml_scenario(et_dir_name, scenario_file_name,enb_config_file_name, play_scenario_filename) == 0) { if (NULL != (scenario = et_generate_scenario(play_scenario_filename))) { @@ -1223,5 +1241,10 @@ int main( int argc, char **argv ) et_free_pointer(enb_config_file_name); } itti_wait_tasks_end(); + if (0 < delay_on_exit) { + sleep(delay_on_exit); + } return ret; } + + diff --git a/openair3/TEST/EPC_TEST/play_scenario_fsm.c b/openair3/TEST/EPC_TEST/play_scenario_fsm.c index d253e5cd5f..f5b142d2fd 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_fsm.c +++ b/openair3/TEST/EPC_TEST/play_scenario_fsm.c @@ -262,7 +262,8 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event) fprintf(stderr, "End of scenario: %s\n", g_scenario->name); fflush(stderr); fflush(stdout); - exit(0); + return 0; + //exit(0); } fprintf(stderr, "Remaining timers running: %d\n", g_scenario->timer_count); return g_fsm_state; @@ -342,7 +343,7 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_rx(et_event_t event) case ET_EVENT_RX_PACKET_TIME_OUT: fprintf(stderr, "Error The following packet is not received:\n"); - et_display_packet(event.u.rx_packet_time_out); + //et_display_packet(event.u.rx_packet_time_out); AssertFatal(0, "Waited packet not received"); break; diff --git a/openair3/TEST/EPC_TEST/play_scenario_parse.c b/openair3/TEST/EPC_TEST/play_scenario_parse.c index aedc021f73..e4f7b48c51 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_parse.c +++ b/openair3/TEST/EPC_TEST/play_scenario_parse.c @@ -491,8 +491,7 @@ et_scenario_t* et_generate_scenario( *next_packet = packet; next_packet = &packet->next; } else { - fprintf(stdout, "WARNING omitted packet:\n"); - et_display_node(node, 0); + fprintf(stdout, "WARNING omitted packet\n"); } } last_packet = packet; diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c index f9c7d9c822..5d43b211ee 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c @@ -467,7 +467,7 @@ void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, con int size = 0; int pos = 0; int go_deeper_in_tree = 1; - S1AP_INFO("%s() mme_ue_s1ap_id %u\n", __FUNCTION__, new_id); + //S1AP_INFO("%s() mme_ue_s1ap_id %u\n", __FUNCTION__, new_id); // modify for (cur_node = (xmlNode *)node; cur_node; cur_node = cur_node->next) { @@ -527,7 +527,7 @@ void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, con } while (pos2 < (2*5)); // update ASN1 et_decode_s1ap(s1ap); - S1AP_INFO("Updated ASN1 for %s\n", showname); + //S1AP_INFO("Updated ASN1 for %s\n", showname); } } } @@ -553,7 +553,7 @@ void update_xpath_nodes_mme_ue_s1ap_id(et_s1ap_t * const s1ap_payload, xmlNodeSe xmlNode *s1ap_node = NULL; size = (nodes) ? nodes->nodeNr : 0; - S1AP_DEBUG("%s() num nodes %u\n", __FUNCTION__, size); + //S1AP_DEBUG("%s() num nodes %u\n", __FUNCTION__, size); /* * NOTE: the nodes are processed in reverse order, i.e. reverse document @@ -599,7 +599,7 @@ int et_s1ap_update_mme_ue_s1ap_id(et_packet_t * const packet, const S1ap_MME_UE_ xmlXPathContextPtr xpath_ctx = NULL; xmlXPathObjectPtr xpath_obj = NULL; - S1AP_DEBUG("%s() packet num %u original frame number %u, mme_ue_s1ap_id %u -> %u\n", __FUNCTION__, packet->packet_number, packet->original_frame_number, old_id, new_id); + //S1AP_DEBUG("%s() packet num %u original frame number %u, mme_ue_s1ap_id %u -> %u\n", __FUNCTION__, packet->packet_number, packet->original_frame_number, old_id, new_id); ret = snprintf(xpath_expression, ET_XPATH_EXPRESSION_MAX_LENGTH, "//field[@name=\"s1ap.MME_UE_S1AP_ID\"][@show=\"%u\"]", old_id); AssertFatal((ret > 0) && (ret < ET_XPATH_EXPRESSION_MAX_LENGTH), "Could not build XPATH expression err=%d", ret); From 26f5d0d93de13f46c17bc5eefd9f0e4e1755c1e4 Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 15 Mar 2016 17:41:06 +0100 Subject: [PATCH 064/214] more changes to uplink scheduling and vcd logging --- openair1/PHY/LTE_TRANSPORT/pucch.c | 10 ++++++-- openair1/PHY/TOOLS/lte_phy_scope.c | 2 +- openair1/PHY/impl_defs_top.h | 2 +- openair1/PHY/vars.h | 2 +- openair1/SCHED/phy_procedures_lte_eNb.c | 17 +++++++------- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 3 +++ .../LAYER2/MAC/eNB_scheduler_primitives.c | 9 +++++++- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 3 ++- openair2/UTIL/LOG/vcd_signal_dumper.c | 4 ++-- openair2/UTIL/LOG/vcd_signal_dumper.h | 2 ++ targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 4 ++-- .../CONF/enb.band7.tm1.50PRB.usrpb210.conf | 4 ++-- .../CONF/enb.band7.tm1.usrpb210.conf | 4 ++-- targets/RT/USER/eNB_usrp.gtkw | 23 +++++++++++++------ 14 files changed, 59 insertions(+), 30 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 837c99b073..e791fea1bd 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -41,6 +41,9 @@ #include "PHY/extern.h" #include "LAYER2/MAC/extern.h" +#include "UTIL/LOG/log.h" +#include "UTIL/LOG/vcd_signal_dumper.h" + //uint8_t ncs_cell[20][7]; //#define DEBUG_PUCCH_TX //#define DEBUG_PUCCH_RX @@ -446,7 +449,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNB->lte_eNB_common_vars; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms; // PUCCH_CONFIG_DEDICATED *pucch_config_dedicated = &phy_vars_eNB->pucch_config_dedicated[UE_id]; - int8_t sigma2_dB = phy_vars_eNB->PHY_measurements_eNB[0].n0_subband_power_tot_dB[6]; + int8_t sigma2_dB = phy_vars_eNB->PHY_measurements_eNB[0].n0_subband_power_tot_dB[0]-10; uint32_t *Po_PUCCH = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH); int32_t *Po_PUCCH_dBm = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH_dBm); uint32_t *Po_PUCCH1_below = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below); @@ -815,7 +818,10 @@ uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, } LOG_D(PHY,"[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (I0 %d dBm, thres %d), Po_PUCCH1_below/above : %d / %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_subband_power_tot_dBm[6],pucch1_thres,dB_fixed(*Po_PUCCH1_below),dB_fixed(*Po_PUCCH1_above)); *Po_PUCCH_update = 1; - + if (UE_id==0) { + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_ENERGY,dB_fixed(stat_max)); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_THRES,sigma2_dB+pucch1_thres); + } } else if ((fmt == pucch_format1a)||(fmt == pucch_format1b)) { stat_max = 0; #ifdef DEBUG_PUCCH_RX diff --git a/openair1/PHY/TOOLS/lte_phy_scope.c b/openair1/PHY/TOOLS/lte_phy_scope.c index 843a77fe62..31db339ecc 100644 --- a/openair1/PHY/TOOLS/lte_phy_scope.c +++ b/openair1/PHY/TOOLS/lte_phy_scope.c @@ -355,7 +355,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, fl_set_xyplot_ybounds(form->pucch_comp,-5000,5000); fl_set_xyplot_xbounds(form->pucch_comp,-5000,5000); - fl_set_xyplot_ybounds(form->pucch_comp1,20,80); + fl_set_xyplot_ybounds(form->pucch_comp1,0,80); } diff --git a/openair1/PHY/impl_defs_top.h b/openair1/PHY/impl_defs_top.h index 388687e97b..73d89cc242 100755 --- a/openair1/PHY/impl_defs_top.h +++ b/openair1/PHY/impl_defs_top.h @@ -263,7 +263,7 @@ #define AMP_OVER_2 (AMP>>1) /// Threshold for PUCCH Format 1 detection -#define PUCCH1_THRES 7 +#define PUCCH1_THRES 0 /// Threshold for PUCCH Format 1a/1b detection #define PUCCH1a_THRES 4 diff --git a/openair1/PHY/vars.h b/openair1/PHY/vars.h index 294105affa..3d940d4a94 100755 --- a/openair1/PHY/vars.h +++ b/openair1/PHY/vars.h @@ -77,7 +77,7 @@ unsigned char NB_RN_INST=0; unsigned char NB_INST=0; #endif -unsigned int ULSCH_max_consecutive_errors = 10; +unsigned int ULSCH_max_consecutive_errors = 20; int number_of_cards; diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index fe8346bb86..68ea6270e9 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -3629,8 +3629,13 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[harq_pid], phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[harq_pid][0]); #endif - - } + + // dump stats to VCD + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS0+harq_pid,phy_vars_eNB->pusch_stats_mcs[0][(frame*10)+subframe]); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB0+harq_pid,phy_vars_eNB->pusch_stats_rb[0][(frame*10)+subframe]); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND0+harq_pid,phy_vars_eNB->pusch_stats_round[0][(frame*10)+subframe]); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI0+harq_pid,dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[0]->ulsch_power[0])); + } // ulsch_eNB[0] && ulsch_eNB[0]->rnti>0 && ulsch_eNB[0]->subframe_scheduling_flag == 1 else if ((phy_vars_eNB->dlsch_eNB[i][0]) && (phy_vars_eNB->dlsch_eNB[i][0]->rnti>0)) { // check for PUCCH @@ -3930,12 +3935,8 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ SR_payload); } } - // dump stats to VCD - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS0+harq_pid,phy_vars_eNB->pusch_stats_mcs[0][(frame*10)+subframe]); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB0+harq_pid,phy_vars_eNB->pusch_stats_rb[0][(frame*10)+subframe]); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND0+harq_pid,phy_vars_eNB->pusch_stats_round[0][(frame*10)+subframe]); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI0+harq_pid,dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[0]->ulsch_power[0])); - } // ulsch_eNB[0] && ulsch_eNB[0]->rnti>0 && ulsch_eNB[0]->subframe_scheduling_flag == 1 + + } if ((frame % 100 == 0) && (subframe == 4)) { for (harq_idx=0; harq_idx<8; harq_idx++) { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 1fc273feac..96ec0fd5e1 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -739,6 +739,9 @@ void initiate_ra_proc(module_id_t module_idP, int CC_id,frame_t frameP, uint16_t LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,preamble_index); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC,1); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC,0); + for (i=0; ibsr_info[LCGID2]>0) || (UE_template->bsr_info[LCGID3]>0) || (UE_template->ul_SR>0) || // uplink scheduling request - ((UE_sched_ctl->ul_inactivity_timer>100)&&(UE_sched_ctl->ul_scheduled==0))) { + ((UE_sched_ctl->ul_inactivity_timer>50)&& + (UE_sched_ctl->ul_scheduled==0))|| // every 2 frames when RRC_CONNECTED + ((UE_sched_ctl->ul_inactivity_timer>10)&& + (UE_sched_ctl->ul_scheduled==0)&& + (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED))) // every Frame when not RRC_CONNECTED + { LOG_D(MAC,"[eNB %d][PUSCH] UE %d/%x should be scheduled\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id)); return(1); @@ -1109,6 +1114,8 @@ void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP LOG_I(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); UE_list->UE_template[cc_idP][UE_id].ul_SR = 1; UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE; + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION,1); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION,0); } else { // AssertFatal(0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP); // AssertError(0, 0, "Frame %d: find_UE_id(%u,rnti %d) not found\n", frameP, enb_mod_idP, rntiP); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index c36e77bfcb..ea10f5a9fd 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -321,7 +321,8 @@ void rx_sdu( LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Received CCCH: %x.%x.%x.%x.%x.%x, Terminating RA procedure for UE rnti %x\n", enb_mod_idP,CC_idP,frameP, payload_ptr[0],payload_ptr[1],payload_ptr[2],payload_ptr[3],payload_ptr[4], payload_ptr[5], rntiP); - + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC,1); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC,0); for (ii=0; iiusrp->set_master_clock_rate(30.72e6); openair0_cfg[0].samples_per_packet = 2048; - openair0_cfg[0].tx_sample_advance = 113; + openair0_cfg[0].tx_sample_advance = 113; openair0_cfg[0].tx_bw = 10e6; openair0_cfg[0].rx_bw = 10e6; - openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; + openair0_cfg[0].tx_scheduling_advance = 10240; break; case 7680000: s->usrp->set_master_clock_rate(30.72e6); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index 7e17a07512..72047f44de 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -140,10 +140,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf index 7839a52d21..985017e8d5 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf @@ -143,10 +143,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/RT/USER/eNB_usrp.gtkw b/targets/RT/USER/eNB_usrp.gtkw index 5c85d91546..8722fd14b0 100644 --- a/targets/RT/USER/eNB_usrp.gtkw +++ b/targets/RT/USER/eNB_usrp.gtkw @@ -1,17 +1,17 @@ [*] [*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI -[*] Sun Mar 13 08:08:42 2016 +[*] Mon Mar 14 12:40:13 2016 [*] [dumpfile] "/tmp/openair_dump_eNB.vcd" -[dumpfile_mtime] "Sun Mar 13 08:07:27 2016" -[dumpfile_size] 273954069 -[savefile] "/home/papillon/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw" -[timestart] 0 +[dumpfile_mtime] "Mon Mar 14 11:08:33 2016" +[dumpfile_size] 54022345 +[savefile] "/home/abeille/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw" +[timestart] 12592600000 [size] 1535 876 [pos] -1 -1 -*-22.793451 63031840000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +*-25.793451 12619679774 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 [sst_width] 284 -[signals_width] 230 +[signals_width] 238 [sst_expanded] 1 [sst_vpaned_height] 294 @24 @@ -55,6 +55,15 @@ variables.ue0_BO[63:0] @420 variables.ue0_BSR[63:0] @28 +functions.macxface_initiate_ra_proc +@29 +functions.macxface_terminate_ra_proc +@28 +functions.macxface_SR_indication +@420 +variables.ue0_SR_ENERGY[63:0] +variables.ue0_SR_THRES[63:0] +@28 functions.phy_enb_ulsch_decoding0 @420 variables.ue0_rssi0[63:0] From e3a7edb0a2e08a59c31a919d688417b09aadd875 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 15 Mar 2016 18:47:36 +0100 Subject: [PATCH 065/214] RRH Tests for USRP b210 --- cmake_targets/autotests/README.txt | 16 + cmake_targets/autotests/test_case_list.xml | 336 ++++++++++++--------- 2 files changed, 212 insertions(+), 140 deletions(-) diff --git a/cmake_targets/autotests/README.txt b/cmake_targets/autotests/README.txt index d3b72edf46..6e9cbbd581 100644 --- a/cmake_targets/autotests/README.txt +++ b/cmake_targets/autotests/README.txt @@ -189,6 +189,22 @@ Obj.# Case# Test# Description 01 75 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX 01 75 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX +01 80 00 lte-softmodem + RRH tests with BladeRF RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX +01 80 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX +01 80 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX +01 80 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX +01 80 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX +01 80 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX +01 80 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX + +01 85 00 lte-softmodem + RRH tests with USRP X310 RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX +01 85 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX +01 85 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX +01 85 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX +01 85 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX +01 85 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX +01 85 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX + 01 64 lte-softmodem-noS1 tests diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 4e6ca873cb..d2afaa3469 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -10,7 +10,7 @@ sudo -S -E /opt/ltebox/tools/stop_ltebox $OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; uname -a; dmesg|tail 36000 - 0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 0159+ 0160+ 0161+ 0162+ 0163+ 0165+ 0170+ 0175+ + 0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 0159+ 0160+ 0161+ 0162+ 0163+ 0165+ 0170+ 017502 017505 3 mozart calisson stevens nano amerique @@ -5521,44 +5521,46 @@ mozart 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=5;tx_sample_advance=70;tx_scheduling_advance=9;" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf pdsch_referenceSignalPower -26 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=70;tx_scheduling_advance=9;rrh_gw_active=\"yes\";" + $OPENAIR_DIR/cmake_targets/build_oai + --eNB -w None -t ETHERNET -x -c --disable-deadline + + + sleep 5; $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf -W + + + + + False $OPENAIR_DIR/cmake_targets/build_oai --RRH -w USRP -t ETHERNET -c --disable-deadline sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw - -n1 -g3 -x -i eth1 + -n1 -x -m1 -i eth1 False - $OPENAIR_DIR/cmake_targets/build_oai - --eNB -w None -t ETHERNET -x -c --disable-deadline - - - sleep 5; $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W - - - - - False + /tmp @@ -5601,39 +5603,50 @@ lte-softmodem - calisson + calisson + mozart stevens amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=113;tx_scheduling_advance=9;rrh_gw_active=\"yes\";" $OPENAIR_DIR/cmake_targets/build_oai - --eNB -w USRP -x -c + --eNB -w None -t ETHERNET -x -c --disable-deadline - $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + sleep 5; $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf -W - True + False + + $OPENAIR_DIR/cmake_targets/build_oai + --RRH -w USRP -t ETHERNET -c --disable-deadline + + + sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw + -n1 -x -m1 -i eth1 + False /tmp @@ -5675,39 +5688,50 @@ lte-softmodem - calisson + calisson + mozart stevens amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf pdsch_referenceSignalPower -32 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=115;tx_scheduling_advance=11;rrh_gw_active=\"yes\";" $OPENAIR_DIR/cmake_targets/build_oai - --eNB -w USRP -x -c + --eNB -w None -t ETHERNET -x -c --disable-deadline - $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + sleep 5; $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf -W - True + False + + $OPENAIR_DIR/cmake_targets/build_oai + --RRH -w USRP -t ETHERNET -c --disable-deadline + + + sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw + -n1 -x -m1 -i eth1 + False /tmp @@ -5749,39 +5773,50 @@ lte-softmodem - calisson + calisson + mozart stevens amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf pdsch_referenceSignalPower -26 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=70;tx_scheduling_advance=9;rrh_gw_active=\"yes\";" $OPENAIR_DIR/cmake_targets/build_oai - --eNB -w USRP -x -c + --eNB -w None -t ETHERNET -x -c --disable-deadline - $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + sleep 5; $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf -W - True + False + + $OPENAIR_DIR/cmake_targets/build_oai + --RRH -w USRP -t ETHERNET -c --disable-deadline + + + sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw + -n1 -x -m1 -i eth1 + False /tmp @@ -5827,34 +5862,44 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=113;tx_scheduling_advance=9;rrh_gw_active=\"yes\";" $OPENAIR_DIR/cmake_targets/build_oai - --eNB -w USRP -x -c + --eNB -w None -t ETHERNET -x -c --disable-deadline - $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + sleep 5; $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf -W - True + False + + $OPENAIR_DIR/cmake_targets/build_oai + --RRH -w USRP -t ETHERNET -c --disable-deadline + + + sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw + -n1 -x -m1 -i eth1 + False /tmp @@ -5895,39 +5940,50 @@ lte-softmodem - calisson + calisson + mozart stevens amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf pdsch_referenceSignalPower -32 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=115;tx_scheduling_advance=11;rrh_gw_active=\"yes\";" $OPENAIR_DIR/cmake_targets/build_oai - --eNB -w USRP -x -c + --eNB -w None -t ETHERNET -x -c --disable-deadline - $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + sleep 5; $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf -W - True + False + + $OPENAIR_DIR/cmake_targets/build_oai + --RRH -w USRP -t ETHERNET -c --disable-deadline + + + sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw + -n1 -x -m1 -i eth1 + False /tmp From 665b33ce5bc496aa992b2dcacad2e77e867b8330 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 15 Mar 2016 19:08:17 +0100 Subject: [PATCH 066/214] minor fix in RRH testcase 017504 --- cmake_targets/autotests/test_case_list.xml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index d2afaa3469..59e6783c23 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -5544,7 +5544,7 @@ --eNB -w None -t ETHERNET -x -c --disable-deadline - sleep 5; $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf -W @@ -5632,7 +5632,7 @@ --eNB -w None -t ETHERNET -x -c --disable-deadline - sleep 5; $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf -W @@ -5717,7 +5717,7 @@ --eNB -w None -t ETHERNET -x -c --disable-deadline - sleep 5; $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf -W @@ -5802,7 +5802,7 @@ --eNB -w None -t ETHERNET -x -c --disable-deadline - sleep 5; $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf -W @@ -5857,7 +5857,8 @@ lte-softmodem - calisson + calisson + mozart stevens amerique 390 @@ -5885,7 +5886,7 @@ --eNB -w None -t ETHERNET -x -c --disable-deadline - sleep 5; $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf -W From ef6f2e2a17d37a5fca76afe8e7b51777798b9195 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 16 Mar 2016 12:06:42 +0100 Subject: [PATCH 067/214] minor stability fixes for Gitlab test setup --- .../autotests/run_exec_lte-softmodem_tests.py | 2 +- cmake_targets/autotests/test_case_list.xml | 120 +++++++++--------- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py index 3418798954..9997d89cd7 100755 --- a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py +++ b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py @@ -216,7 +216,7 @@ def sftp_module (username, password, hostname, ports, paramList,logfile): # \brief bash script stub put at the end of scripts to terminate it # \param timeout_cmd terminate script after timeout_cmd seconds # \param terminate_missing_procs if True terminate all the processes launched by script if one of them terminates prematurely (due to error) -def finalize_deploy_script (timeout_cmd, terminate_missing_procs='True'): +def finalize_deploy_script (timeout_cmd, terminate_missing_procs='False'): cmd = 'declare -i timeout_cmd='+str(timeout_cmd) + '\n' if terminate_missing_procs == 'True': cmd = cmd + """ diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 59e6783c23..382127b1d6 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -981,7 +981,7 @@ - True + False /tmp @@ -995,7 +995,7 @@ - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp @@ -1015,7 +1015,7 @@ throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec - True + False USRPb210.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX 10 @@ -1055,7 +1055,7 @@ - True + False /tmp @@ -1069,7 +1069,7 @@ - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp @@ -1089,7 +1089,7 @@ throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec - True + False USRPb210.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX 10 @@ -1129,7 +1129,7 @@ - True + False /tmp @@ -1141,7 +1141,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec @@ -1162,7 +1162,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False USRPb210.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX 10 @@ -1202,7 +1202,7 @@ - True + False /tmp @@ -1215,7 +1215,7 @@ throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue @@ -1235,7 +1235,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False USRPb210.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX 10 @@ -1275,7 +1275,7 @@ - True + False /tmp @@ -1289,7 +1289,7 @@ throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue @@ -1309,7 +1309,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False USRPb210.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX 10 @@ -1350,7 +1350,7 @@ - True + False /tmp @@ -1364,7 +1364,7 @@ - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp @@ -1384,7 +1384,7 @@ throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec - True + False USRPb210.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.2TX.2RX 10 @@ -1425,7 +1425,7 @@ - True + False /tmp > @@ -1438,7 +1438,7 @@ - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp @@ -1458,7 +1458,7 @@ throughput_test min=2.0Mbits/sec max=2.0Mbits/sec average=2.0Mbits/sec - True + False USRPb210.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.2TX.2RX 10 @@ -1498,7 +1498,7 @@ - True + False /tmp @@ -1512,7 +1512,7 @@ - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp @@ -1532,7 +1532,7 @@ throughput_test min=4.0Mbits/sec max=4.0Mbits/sec average=4.0Mbits/sec - True + False USRPb210.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.2TX.2RX 10 @@ -1572,7 +1572,7 @@ - True + False /tmp @@ -1586,7 +1586,7 @@ throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue @@ -1606,7 +1606,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False USRPb210.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.2TX.2RX 10 @@ -1646,7 +1646,7 @@ - True + False /tmp @@ -1660,7 +1660,7 @@ throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue @@ -1680,7 +1680,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False USRPb210.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.2TX.2RX 10 @@ -1720,7 +1720,7 @@ - True + False /tmp @@ -1734,7 +1734,7 @@ throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue @@ -1754,7 +1754,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False USRPb210.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.2TX.2RX 10 @@ -2836,7 +2836,7 @@ throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec - True + False USRPx310.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX 10 @@ -2908,7 +2908,7 @@ throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec - True + False USRPx310.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX 10 @@ -2980,7 +2980,7 @@ throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec - True + False USRPx310.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX 10 @@ -3051,7 +3051,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False USRPx310.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX 10 @@ -3122,7 +3122,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False USRPx310.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX 10 @@ -3193,7 +3193,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False USRPx310.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX 10 @@ -3755,7 +3755,7 @@ throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec - True + False EXMIMO.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX 10 @@ -3828,7 +3828,7 @@ throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec - True + False EXMIMO.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX 10 @@ -3904,7 +3904,7 @@ throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec - True + False EXMIMO.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX 10 @@ -3975,7 +3975,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False EXMIMO.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX 10 @@ -4046,7 +4046,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False EXMIMO.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX 10 @@ -4117,7 +4117,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False EXMIMO.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX 10 @@ -4760,7 +4760,7 @@ throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec - True + False BladeRF.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX 10 @@ -4835,7 +4835,7 @@ throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec - True + False BladeRF.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX 10 @@ -4909,7 +4909,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False BladeRF.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX 10 @@ -4983,7 +4983,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False BladeRF.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX 10 @@ -5058,7 +5058,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False BladeRF.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX 10 @@ -5209,7 +5209,7 @@ throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec - True + False SoDeRa.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX 10 @@ -5284,7 +5284,7 @@ throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec - True + False SoDeRa.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX 10 @@ -5358,7 +5358,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False BladeRF.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX 10 @@ -5432,7 +5432,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False SoDeRa.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX 10 @@ -5507,7 +5507,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False SoDeRa.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX 10 @@ -5680,7 +5680,7 @@ throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec - True + False USRPb210.RRH.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX 10 @@ -5765,7 +5765,7 @@ throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec - True + False USRPb210.RRH.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX 10 @@ -5849,7 +5849,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False USRPb210.RRH.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX 10 @@ -5933,7 +5933,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False USRPb210.RRH.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX 10 @@ -6018,7 +6018,7 @@ $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 - True + False USRPb210.RRH.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX 10 From 9b82047c43ed40676ae4325c946a6e3b1007a35a Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 16 Mar 2016 12:18:50 +0100 Subject: [PATCH 068/214] minor fix for Gitlab CI stability --- cmake_targets/autotests/test_case_list.xml | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 382127b1d6..6ea12c1fcb 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -2803,7 +2803,7 @@ - True + False /tmp @@ -2875,7 +2875,7 @@ - True + False /tmp @@ -2946,7 +2946,7 @@ - True + False /tmp @@ -3018,7 +3018,7 @@ - True + False /tmp @@ -3089,7 +3089,7 @@ - True + False /tmp @@ -3160,7 +3160,7 @@ - True + False /tmp @@ -3317,7 +3317,7 @@ - True + False /tmp @@ -3641,7 +3641,7 @@ - True + False /tmp @@ -3722,7 +3722,7 @@ - True + False /tmp @@ -3794,7 +3794,7 @@ - True + False /tmp @@ -3866,7 +3866,7 @@ - True + False /tmp @@ -3942,7 +3942,7 @@ - True + False /tmp @@ -4013,7 +4013,7 @@ - True + False /tmp @@ -4084,7 +4084,7 @@ - True + False /tmp From 138380e97a3d535b62011a370062af976ae50147 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 16 Mar 2016 12:21:10 +0100 Subject: [PATCH 069/214] minor fix for Gitlab CI stability --- cmake_targets/autotests/test_case_list.xml | 54 +++++++++++----------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 6ea12c1fcb..50bdd93344 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -2816,7 +2816,7 @@ - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp @@ -2888,7 +2888,7 @@ - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp @@ -2960,7 +2960,7 @@ - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp @@ -3030,7 +3030,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec @@ -3101,7 +3101,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec @@ -3172,7 +3172,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec @@ -3735,7 +3735,7 @@ - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp @@ -3808,7 +3808,7 @@ - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp @@ -3880,7 +3880,7 @@ - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp @@ -3954,7 +3954,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec @@ -4025,7 +4025,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec @@ -4096,7 +4096,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec @@ -4740,7 +4740,7 @@ - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp @@ -4815,7 +4815,7 @@ - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp @@ -4888,7 +4888,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec @@ -4963,7 +4963,7 @@ throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue @@ -5038,7 +5038,7 @@ throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue @@ -5189,7 +5189,7 @@ - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp @@ -5264,7 +5264,7 @@ - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp @@ -5337,7 +5337,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec @@ -5412,7 +5412,7 @@ throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue @@ -5487,7 +5487,7 @@ throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue @@ -5660,7 +5660,7 @@ - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp @@ -5745,7 +5745,7 @@ - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp @@ -5828,7 +5828,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec @@ -5913,7 +5913,7 @@ throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue @@ -5998,7 +5998,7 @@ throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec - True + False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue From b2bbd720a6fb478d7e25ee019a0891f30a8e38d1 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 16 Mar 2016 14:12:29 +0100 Subject: [PATCH 070/214] syntax fix for test setup xml file --- cmake_targets/autotests/test_case_list.xml | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 50bdd93344..394feda359 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -2803,7 +2803,7 @@ - False + False /tmp @@ -2875,7 +2875,7 @@ - False + False /tmp @@ -2946,7 +2946,7 @@ - False + False /tmp @@ -3018,7 +3018,7 @@ - False + False /tmp @@ -3089,7 +3089,7 @@ - False + False /tmp @@ -3160,7 +3160,7 @@ - False + False /tmp @@ -3317,7 +3317,7 @@ - False + False /tmp @@ -3641,7 +3641,7 @@ - False + False /tmp @@ -3722,7 +3722,7 @@ - False + False /tmp @@ -3794,7 +3794,7 @@ - False + False /tmp @@ -3866,7 +3866,7 @@ - False + False /tmp @@ -3942,7 +3942,7 @@ - False + False /tmp @@ -4013,7 +4013,7 @@ - False + False /tmp @@ -4084,7 +4084,7 @@ - False + False /tmp From 91d8c8920b11312fdd68db6f29bf3583b779ed0d Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Wed, 16 Mar 2016 15:10:06 +0100 Subject: [PATCH 071/214] Modifications to test system to download from the right repository when doing a merge request from oai-internal to oai. --- .gitlab-ci.yml | 5 +++-- cmake_targets/autotests/run_exec_lte-softmodem_tests.py | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c75f8fa464..8947453454 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,7 @@ job1: - echo $EXTERNAL_SHARE_DIR - echo $SHELL - git rev-parse --abbrev-ref HEAD + - git_repo=`git config --get remote.origin.url` - git_head=`git rev-parse HEAD` - echo $git_head - tmp=`git show-ref --head | grep $git_head` @@ -23,8 +24,8 @@ job1: - echo $NRUNS_LTE_SOFTMODEM - echo $TIMEOUT_CMD - mkdir -p $OPENAIR_DIR/cmake_targets/autotests/log - - python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -c -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS $OAI_EXTRA_ARGS -g "$OAI_TEST_CASE_GROUP">& $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log - - python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -r -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS `echo $OAI_EXTRA_ARGS` -g "$OAI_TEST_CASE_GROUP" --nrun_lte_softmodem $NRUNS_LTE_SOFTMODEM --timeout_cmd $TIMEOUT_CMD >& $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log + - python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -c -5GRepo $git_repo -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS $OAI_EXTRA_ARGS -g "$OAI_TEST_CASE_GROUP">& $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log + - python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -r -5GRepo $git_repo -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS `echo $OAI_EXTRA_ARGS` -g "$OAI_TEST_CASE_GROUP" --nrun_lte_softmodem $NRUNS_LTE_SOFTMODEM --timeout_cmd $TIMEOUT_CMD >& $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log - mv $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest.log - mv $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest_cleanup.log - sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $NFS_TEST_RESULTS_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$NFS_TEST_RESULTS_DIR diff --git a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py index 9997d89cd7..ace214bb53 100755 --- a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py +++ b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py @@ -1105,6 +1105,7 @@ pw ='' i = 0 dlsim=0 localshell=0 +GitOAI5GRepo='' GitOAI5GRepoBranch='' GitOAI5GHeadVersion='' user='' @@ -1141,6 +1142,9 @@ while i < len (sys.argv): i = i +1 elif arg == '-c': cleanUpRemoteMachines=True + elif arg == '-5GRepo': + GitOAI5GRepo = sys.argv[i+1] + i = i +1 elif arg == '-5GRepoBranch': GitOAI5GRepoBranch = sys.argv[i+1] i = i +1 @@ -1190,6 +1194,7 @@ while i < len (sys.argv): print "-r: Remove the log directory in autotests" print "-g: Run test cases in a group" print "-c: Run cleanup scripts on remote machines and exit" + print "-5GRepo: Repository for OAI 5G to use to run tests (overrides GitOAI5GRepo in test_case_list.xml)" print "-5GRepoBranch: Branch for OAI 5G Repository to run tests (overrides the branch in test_case_list.xml)" print "-5GRepoHeadVersion: Head commit on which to run tests (overrides the branch in test_case_list.xml)" print "-u: use the user name passed as argument" @@ -1278,7 +1283,9 @@ if MachineList =='': MachineList = xmlRoot.findtext('MachineList',default='') NFSResultsShare = xmlRoot.findtext('NFSResultsShare',default='') GitOpenaircnRepo = xmlRoot.findtext('GitOpenair-cnRepo',default='') -GitOAI5GRepo = xmlRoot.findtext('GitOAI5GRepo',default='') + +if GitOAI5GRepo == '': + GitOAI5GRepo = xmlRoot.findtext('GitOAI5GRepo',default='') if GitOAI5GRepoBranch == '': GitOAI5GRepoBranch = xmlRoot.findtext('GitOAI5GRepoBranch',default='') From ede2d8e672ea86c3ba41457cc86446509b2d1b67 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Wed, 16 Mar 2016 15:51:42 +0100 Subject: [PATCH 072/214] small bug in scope --- openair1/PHY/TOOLS/lte_phy_scope.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openair1/PHY/TOOLS/lte_phy_scope.c b/openair1/PHY/TOOLS/lte_phy_scope.c index 843a77fe62..a1478c45ab 100644 --- a/openair1/PHY/TOOLS/lte_phy_scope.c +++ b/openair1/PHY/TOOLS/lte_phy_scope.c @@ -719,13 +719,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, // PDSCH LLRs if (pdsch_llr != NULL) { - for (i=0; ipdsch_llr,0,coded_bits_per_codeword/4); - fl_set_xyplot_data(form->pdsch_llr,bit,llr,coded_bits_per_codeword/4,"","",""); + fl_set_xyplot_xbounds(form->pdsch_llr,0,coded_bits_per_codeword); + fl_set_xyplot_data(form->pdsch_llr,bit,llr,coded_bits_per_codeword,"","",""); } // PDSCH I/Q of MF Output From 4f9b32aa2bb3c9e145ed88ff242065b571be5ce5 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 16 Mar 2016 16:12:30 +0100 Subject: [PATCH 073/214] updates for OAI EPC Local test cases --- cmake_targets/autotests/test_case_list.xml | 254 ++++++++++----------- 1 file changed, 125 insertions(+), 129 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 394feda359..4dc402c024 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1768,30 +1768,30 @@ calisson 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf pdsch_referenceSignalPower -26 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5:3\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.2/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5:4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.170.1.2/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -26 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5:3\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5:4\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.170.1.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -1852,30 +1852,30 @@ calisson 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf pdsch_referenceSignalPower -29 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5:3\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.2/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5:4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.170.1.2/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5:3\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5:4\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.170.1.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -1936,30 +1936,30 @@ calisson 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf pdsch_referenceSignalPower -29 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5:3\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.2/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5:4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.170.1.2/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5:3\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5:4\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.170.1.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -2020,30 +2020,30 @@ calisson 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf pdsch_referenceSignalPower -26 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5:3\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.2/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5:4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.170.1.2/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -26 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5:3\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5:4\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.170.1.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -2104,30 +2104,30 @@ calisson 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf pdsch_referenceSignalPower -29 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5:3\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.2/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5:4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.170.1.2/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5:3\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5:4\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.170.1.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -2188,30 +2188,30 @@ calisson 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf pdsch_referenceSignalPower -29 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5:3\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.2/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5:4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.170.1.2/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5:3\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5:4\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.170.1.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -3884,15 +3884,11 @@ sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp - BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth5\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" - SCRIPTS/build_epc - -c -l - SCRIPTS/build_hss - -c -l + + + + + From 1459ca123768ef791df29f6352a0509e07e53303 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 16 Mar 2016 17:17:52 +0100 Subject: [PATCH 074/214] remove testcases from exclusion which are working --- cmake_targets/autotests/test_case_list.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 4dc402c024..5212b62995 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -10,7 +10,7 @@ sudo -S -E /opt/ltebox/tools/stop_ltebox $OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; uname -a; dmesg|tail 36000 - 0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 0159+ 0160+ 0161+ 0162+ 0163+ 0165+ 0170+ 017502 017505 + 0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 0170+ 017502 017505 3 mozart calisson stevens nano amerique From 4eed6a1a472f74a8da19c53dde44933e778a11d0 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 16 Mar 2016 17:24:50 +0100 Subject: [PATCH 075/214] fix for segmentation fault in BaldeRF --- targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c index 065b0bbad2..d9b7bfa905 100644 --- a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c +++ b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c @@ -1080,6 +1080,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { device->trx_set_freq_func = trx_brf_set_freq; device->trx_set_gains_func = trx_brf_set_gains; device->openair0_cfg = openair0_cfg; + device->priv = (void *)brf; calibrate_rf(device); From 1db6299616f6ed3e561bfcb862d8da6fafe9cc2b Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Thu, 17 Mar 2016 19:35:45 +0100 Subject: [PATCH 076/214] change to exclusion test case list --- cmake_targets/autotests/test_case_list.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 5212b62995..c4b0fc75e6 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -10,7 +10,7 @@ sudo -S -E /opt/ltebox/tools/stop_ltebox $OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; uname -a; dmesg|tail 36000 - 0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 0170+ 017502 017505 + 0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 016502 016505 0170+ 017502 017505 018002 018005 018502 018505 3 mozart calisson stevens nano amerique From b441c37b4050c7f3863e71a3874c13ffda7ea700 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 18 Mar 2016 08:00:51 +0100 Subject: [PATCH 077/214] added Timing advance tracing to .vcd output. Increase maximum UL RB count to 45. Measured UL throughput @ 15 Mbit/s (40 PRBs). --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 128 +----------------- openair2/LAYER2/MAC/pre_processor.c | 52 +------ openair2/UTIL/LOG/vcd_signal_dumper.c | 1 + openair2/UTIL/LOG/vcd_signal_dumper.h | 1 + .../CONF/enb.band7.tm1.50PRB.usrpb210.conf | 4 +- targets/RT/USER/eNB_usrp.gtkw | 16 +-- 6 files changed, 19 insertions(+), 183 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index ea10f5a9fd..b1410003c2 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -525,54 +525,6 @@ uint32_t bytes_to_bsr_index(int32_t nbytes) return(i-1); } -/* -void adjust_bsr_info(int buffer_occupancy, - uint16_t TBS, - UE_TEMPLATE *UE_template) -{ - - uint32_t tmp_bsr; - - // could not serve all the uplink traffic - if (buffer_occupancy > 0 ) { - if (BSR_TABLE[UE_template->bsr_info[LCGID0]] <= TBS ) { - tmp_bsr = BSR_TABLE[UE_template->bsr_info[LCGID0]]; // serving this amout of bytes - UE_template->bsr_info[LCGID0] = 0; - - if (BSR_TABLE[UE_template->bsr_info[LCGID1]] <= (TBS-tmp_bsr)) { - tmp_bsr += BSR_TABLE[UE_template->bsr_info[LCGID1]]; - UE_template->bsr_info[LCGID1] = 0; - - if (BSR_TABLE[UE_template->bsr_info[LCGID2]] <= (TBS-tmp_bsr)) { - tmp_bsr += BSR_TABLE[UE_template->bsr_info[LCGID2]]; - UE_template->bsr_info[LCGID2] = 0; - - if (BSR_TABLE[UE_template->bsr_info[LCGID3]] <= (TBS-tmp_bsr)) { - tmp_bsr += BSR_TABLE[UE_template->bsr_info[LCGID3]]; - UE_template->bsr_info[LCGID3] = 0; - } else { - UE_template->bsr_info[LCGID3] = bytes_to_bsr_index((int32_t)BSR_TABLE[UE_template->bsr_info[LCGID3]] - ((int32_t) TBS - (int32_t)tmp_bsr)); - } - } else { - UE_template->bsr_info[LCGID2] = bytes_to_bsr_index((int32_t)BSR_TABLE[UE_template->bsr_info[LCGID2]] - ((int32_t)TBS - (int32_t)tmp_bsr)); - } - } else { - UE_template->bsr_info[LCGID1] = bytes_to_bsr_index((int32_t)BSR_TABLE[UE_template->bsr_info[LCGID1]] - ((int32_t)TBS - (int32_t)tmp_bsr)); - } - } else { - UE_template->bsr_info[LCGID0] = bytes_to_bsr_index((int32_t)BSR_TABLE[UE_template->bsr_info[LCGID0]] - (int32_t)TBS); - } - } else { // we have flushed all buffers so clear bsr - UE_template->bsr_info[LCGID0] = 0; - UE_template->bsr_info[LCGID1] = 0; - UE_template->bsr_info[LCGID2] = 0; - UE_template->bsr_info[LCGID3] = 0; - } - - -} -*/ - void add_ue_ulsch_info(module_id_t module_idP, int CC_id, int UE_id, sub_frame_t subframeP, UE_ULSCH_STATUS status) { @@ -584,66 +536,6 @@ void add_ue_ulsch_info(module_id_t module_idP, int CC_id, int UE_id, sub_frame_t } -// This seems not to be used anymore -/* -int schedule_next_ulue(module_id_t module_idP, int UE_id, sub_frame_t subframeP){ - - int next_ue; - - // first phase: scheduling for ACK - switch (subframeP) { - // scheduling for subframeP 2: for scheduled user during subframeP 5 and 6 - case 8: - if ((eNB_dlsch_info[module_idP][UE_id].status == S_DL_SCHEDULED) && - (eNB_dlsch_info[module_idP][UE_id].subframe == 5 || eNB_dlsch_info[module_idP][UE_id].subframe == 6)){ - // set the downlink status - eNB_dlsch_info[module_idP][UE_id].status = S_DL_BUFFERED; - return UE_id; - } - break; - // scheduling for subframeP 3: for scheduled user during subframeP 7 and 8 - case 9: - if ((eNB_dlsch_info[module_idP][UE_id].status == S_DL_SCHEDULED) && - (eNB_dlsch_info[module_idP][UE_id].subframe == 7 || eNB_dlsch_info[module_idP][UE_id].subframe == 8)){ - eNB_dlsch_info[module_idP][UE_id].status = S_DL_BUFFERED; - return UE_id; - } - break; - // scheduling UL subframeP 4: for scheduled user during subframeP 9 and 0 - case 0 : - if ((eNB_dlsch_info[module_idP][UE_id].status == S_DL_SCHEDULED) && - (eNB_dlsch_info[module_idP][UE_id].subframe == 9 || eNB_dlsch_info[module_idP][UE_id].subframe == 0)){ - eNB_dlsch_info[module_idP][UE_id].status = S_DL_BUFFERED; - return UE_id; - } - break; - default: - break; - } - - // second phase - for (next_ue=0; next_ue ul_total_buffer; while (((rb_table[rb_table_index]>(frame_parms->N_RB_UL-1-first_rb[CC_id])) || - (rb_table[rb_table_index]>39)) && + (rb_table[rb_table_index]>45)) && (rb_table_index>0)) { rb_table_index--; } @@ -984,12 +876,6 @@ void schedule_ulsch_rnti(module_id_t module_idP, first_rb[CC_id],rb_table[rb_table_index], rb_table_index,TBS,harq_pid); - /* - // Adjust BSR entries for LCGIDs - adjust_bsr_info(buffer_occupancy, - TBS, - UE_template); - */ // adjust total UL buffer status by TBS, wait for UL sdus to do final update LOG_D(MAC,"[eNB %d] CC_id %d UE %d/%x : adjusting ul_total_buffer, old %d, TBS %d\n", module_idP,CC_id,UE_id,rnti,UE_template->ul_total_buffer,TBS); if (UE_template->ul_total_buffer > TBS) @@ -998,16 +884,8 @@ void schedule_ulsch_rnti(module_id_t module_idP, UE_template->ul_total_buffer = 0; LOG_D(MAC,"ul_total_buffer, new %d\n", UE_template->ul_total_buffer); // Cyclic shift for DM RS - if(cooperation_flag == 2) { - if(UE_id == 1) { // For Distriibuted Alamouti, cyclic shift applied to 2nd UE - cshift = 1; - } else { - cshift = 0; - } - } else { - cshift = 0;// values from 0 to 7 can be used for mapping the cyclic shift (36.211 , Table 5.5.2.1.1-1) - } - + cshift = 0;// values from 0 to 7 can be used for mapping the cyclic shift (36.211 , Table 5.5.2.1.1-1) + if (frame_parms->frame_type == TDD) { switch (frame_parms->N_RB_UL) { case 6: diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 2acda1c746..3cbecbb69c 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -47,6 +47,7 @@ #include "LAYER2/MAC/proto.h" #include "LAYER2/MAC/extern.h" #include "UTIL/LOG/log.h" +#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" #include "OCG.h" #include "OCG_extern.h" @@ -807,6 +808,9 @@ void dlsch_scheduler_pre_processor_reset (int module_idP, ue_sched_ctl->ta_timer--; ue_sched_ctl->ta_update =0; // don't trigger a timing advance command } + if (UE_id==0) { + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_TIMING_ADVANCE,ue_sched_ctl->ta_update); + } nb_rbs_required[CC_id][UE_id]=0; ue_sched_ctl->pre_nb_available_rbs[CC_id] = 0; ue_sched_ctl->dl_pow_off[CC_id] = 2; @@ -937,9 +941,6 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, UE_TEMPLATE *UE_template = 0; LTE_DL_FRAME_PARMS *frame_parms = 0; - // LOG_I(MAC,"store ulsch buffers\n"); - // convert BSR to bytes for comparison with tbs - // store_ulsch_buffer(module_idP,frameP, subframeP); //LOG_I(MAC,"assign max mcs min rb\n"); // maximize MCS and then allocate required RB according to the buffer occupancy with the limit of max available UL RB @@ -1097,51 +1098,6 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, } } -/* -void store_ulsch_buffer(module_id_t module_idP, int frameP, sub_frame_t subframeP) -{ - - int UE_id,pCC_id,lcgid; - UE_list_t *UE_list = &eNB_mac_inst[module_idP].UE_list; - UE_TEMPLATE *UE_template; - - for (UE_id=UE_list->head_ul; UE_id>=0; UE_id=UE_list->next_ul[UE_id]) { - - - if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) - continue; - - UE_template = &UE_list->UE_template[UE_PCCID(module_idP,UE_id)][UE_id]; - //LOG_I(MAC,"[UE %d next %d] SR is %d\n",UE_id, UE_list->next_ul[UE_id], UE_template->ul_SR); - - UE_template->ul_total_buffer=0; - - for (lcgid=0; lcgidul_buffer_info[lcgid]=BSR_TABLE[UE_template->bsr_info[lcgid]]; - UE_template->ul_total_buffer+= UE_template->ul_buffer_info[lcgid]; // apply traffic aggregtaion if packets are small - // UE_template->ul_buffer_creation_time_max=cmax(UE_template->ul_buffer_creation_time_max, frame_cycle*1024 + frameP-UE_template->ul_buffer_creation_time[lcgid])); - } - - if ( UE_template->ul_total_buffer >0) - LOG_D(MAC,"[eNB %d] Frame %d subframe %d UE %d CC id %d: LCGID0 %d, LCGID1 %d, LCGID2 %d LCGID3 %d, BO %d\n", - module_idP, frameP,subframeP, UE_id, UE_PCCID(module_idP,UE_id), - UE_template->ul_buffer_info[LCGID0], - UE_template->ul_buffer_info[LCGID1], - UE_template->ul_buffer_info[LCGID2], - UE_template->ul_buffer_info[LCGID3], - UE_template->ul_total_buffer); - else if (UE_is_to_be_scheduled(module_idP,UE_PCCID(module_idP,UE_id),UE_id) > 0 ) { - if (UE_template->ul_total_buffer == 0 ) { - UE_template->ul_total_buffer = BSR_TABLE[11]; - } - - LOG_D(MAC,"[eNB %d] Frame %d subframe %d UE %d CC id %d: SR active, set BO to %d \n", - module_idP, frameP,subframeP, UE_id, UE_PCCID(module_idP,UE_id), - UE_template->ul_total_buffer); - } - } -} -*/ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subframeP, uint16_t *first_rb) diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.c b/openair2/UTIL/LOG/vcd_signal_dumper.c index abf552c633..4038c33bda 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.c +++ b/openair2/UTIL/LOG/vcd_signal_dumper.c @@ -122,6 +122,7 @@ const char* eurecomVariablesNames[] = { "ue0_BSR", "ue0_BO", "ue0_scheduled", + "ue0_timing_advance", "ue0_SR_ENERGY", "ue0_SR_THRES", "ue0_rssi0", diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.h b/openair2/UTIL/LOG/vcd_signal_dumper.h index 6eb125786f..24a0efee27 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.h +++ b/openair2/UTIL/LOG/vcd_signal_dumper.h @@ -94,6 +94,7 @@ typedef enum { VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR, VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO, VCD_SIGNAL_DUMPER_VARIABLES_UE0_SCHEDULED, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_TIMING_ADVANCE, VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_ENERGY, VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_THRES, VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI0, diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index 72047f44de..7e17a07512 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -140,10 +140,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/RT/USER/eNB_usrp.gtkw b/targets/RT/USER/eNB_usrp.gtkw index 8722fd14b0..b7810896d5 100644 --- a/targets/RT/USER/eNB_usrp.gtkw +++ b/targets/RT/USER/eNB_usrp.gtkw @@ -1,15 +1,15 @@ [*] [*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI -[*] Mon Mar 14 12:40:13 2016 +[*] Thu Mar 17 23:50:10 2016 [*] [dumpfile] "/tmp/openair_dump_eNB.vcd" -[dumpfile_mtime] "Mon Mar 14 11:08:33 2016" -[dumpfile_size] 54022345 -[savefile] "/home/abeille/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw" -[timestart] 12592600000 +[dumpfile_mtime] "Thu Mar 17 23:49:36 2016" +[dumpfile_size] 236045612 +[savefile] "/home/papillon/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw" +[timestart] 10372000000 [size] 1535 876 [pos] -1 -1 -*-25.793451 12619679774 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +*-29.793451 12619679774 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 [sst_width] 284 [signals_width] 238 [sst_expanded] 1 @@ -54,11 +54,11 @@ functions.phy_procedures_eNb_rx variables.ue0_BO[63:0] @420 variables.ue0_BSR[63:0] +@421 +variables.ue0_timing_advance[63:0] @28 functions.macxface_initiate_ra_proc -@29 functions.macxface_terminate_ra_proc -@28 functions.macxface_SR_indication @420 variables.ue0_SR_ENERGY[63:0] From 606e51f83263557640bba673cbff3807920bd00a Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Fri, 18 Mar 2016 10:23:12 +0100 Subject: [PATCH 078/214] improved error handling in common lib --- targets/ARCH/COMMON/common_lib.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/targets/ARCH/COMMON/common_lib.c b/targets/ARCH/COMMON/common_lib.c index e4ee06d0a4..dea02f2bba 100644 --- a/targets/ARCH/COMMON/common_lib.c +++ b/targets/ARCH/COMMON/common_lib.c @@ -103,14 +103,18 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param if (flag == BBU_LOCAL_RADIO_HEAD) { lib_handle = dlopen(OAI_RF_LIBNAME, RTLD_LAZY); if (!lib_handle) { - printf( "Unable to locate %s: HW device set to NONE_DEV.\n", OAI_RF_LIBNAME); - return 0; + fprintf(stderr,"Unable to locate %s: HW device set to NONE_DEV.\n", OAI_RF_LIBNAME); + fprintf(stderr,"%s\n",dlerror()); + return -1; } dp = dlsym(lib_handle,"device_init"); if (dp != NULL ) { - dp(device,openair0_cfg); + if (dp(device,openair0_cfg)!=0) { + fprintf(stderr,"Error initializing device\n"); + return -1; + } } else { fprintf(stderr, "%s %d:oai device intializing function not found %s\n", __FILE__, __LINE__, dlerror()); return -1; @@ -119,7 +123,8 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param lib_handle = dlopen(OAI_TP_LIBNAME, RTLD_LAZY); if (!lib_handle) { printf( "Unable to locate %s: transport protocol set to NONE_TP.\n", OAI_TP_LIBNAME); - return 0; + printf( "%s\n",dlerror()); + return -1; } tp = dlsym(lib_handle,"transport_init"); @@ -152,7 +157,7 @@ int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cf } } #endif - return 0; + return rc; } int openair0_transport_load(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * eth_params) { @@ -164,7 +169,7 @@ int openair0_transport_load(openair0_device *device, openair0_config_t *openair0 return -1; } } - return 0; + return rc; } From 56d0f9a2eaaae0720e887bd10001510a3caa1260 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Fri, 18 Mar 2016 12:23:40 +0100 Subject: [PATCH 079/214] adding -fPIC to compile options in LMSSDR libraries --- targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/CMakeLists.txt | 2 +- targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/CMakeLists.txt b/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/CMakeLists.txt index 88a021ae00..c331185e17 100644 --- a/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/CMakeLists.txt +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/CMakeLists.txt @@ -2,7 +2,7 @@ set(si5351_src_files Si5351C.cpp ) set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -std=c++11 " + "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -std=c++11 -fPIC" ) diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/CMakeLists.txt b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/CMakeLists.txt index cea22ac829..4613e9ce72 100644 --- a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/CMakeLists.txt +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/CMakeLists.txt @@ -9,7 +9,7 @@ if(${CMAKE_MAJOR_VERSION} GREATER 2) endif() ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS) if(CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -fPIC") endif() # set up include-directories From bed47a441d229dc556f54d3e1f9ec943051e81ab Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 20 Mar 2016 21:24:38 +0100 Subject: [PATCH 080/214] activated 8-bit LLR decoding for DLSCH. added gtkw configuration for UE usrp. --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 4 +- openair1/PHY/LTE_TRANSPORT/defs.h | 4 ++ openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c | 4 ++ .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 2 +- openair1/PHY/LTE_TRANSPORT/print_stats.c | 19 ++++++- openair1/SCHED/phy_procedures_lte_ue.c | 4 +- targets/RT/USER/lte-ue.c | 10 ++++ targets/RT/USER/ue_usrp.gtkw | 53 +++++++++++++++++++ 8 files changed, 93 insertions(+), 7 deletions(-) create mode 100644 targets/RT/USER/ue_usrp.gtkw diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 3d8724fd4f..26c5d3667d 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -4467,7 +4467,7 @@ int generate_ue_dlsch_params_from_dci(int frame, dlsch[0]->g_pucch += delta_PUCCH_lut[TPC&3]; if (TPC!=1) - LOG_I(PHY,"format1 TPC %d, dlsch0_harq->delta_PUCCH %d\n",TPC,dlsch0_harq->delta_PUCCH); + LOG_D(PHY,"format1 TPC %d, dlsch0_harq->delta_PUCCH %d\n",TPC,dlsch0_harq->delta_PUCCH); dlsch0_harq->rvidx = rv; @@ -4476,7 +4476,7 @@ int generate_ue_dlsch_params_from_dci(int frame, dlsch0_harq->dl_power_off = 1; //no power offset - LOG_D(PHY,"UE (%x/%d): Subframe %d Format2 DCI: ndi %d, old_ndi %d (first tx %d) harq_status %d\n",dlsch[0]->rnti,harq_pid,subframe,ndi,dlsch0_harq->DCINdi, + LOG_D(PHY,"UE (%x/%d): Subframe %d Format1 DCI: ndi %d, old_ndi %d (first tx %d) harq_status %d\n",dlsch[0]->rnti,harq_pid,subframe,ndi,dlsch0_harq->DCINdi, dlsch0_harq->first_tx,dlsch0_harq->status); // printf("Format2 DCI (UE, hard pid %d): ndi %d, old_ndi %d (first tx %d)\n",harq_pid,ndi,dlsch0_harq->DCINdi, diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index 3cd608aa14..6c758b1c22 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -572,6 +572,10 @@ typedef struct { vrb_t vrb_type; /// downlink power offset field uint8_t dl_power_off; + /// trials per round statistics + uint32_t trials[8]; + /// error statistics per round + uint32_t errors[8]; } LTE_DL_UE_HARQ_t; typedef struct { diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c index efcd868338..c59652e2fa 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c @@ -243,6 +243,9 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, return(max_turbo_iterations); } */ + + harq_process->trials[harq_process->round]++; + A = harq_process->TBS; //2072 for QPSK 1/3 ret = dlsch->max_turbo_iterations; @@ -457,6 +460,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, dlsch->harq_ack[subframe].ack = 0; dlsch->harq_ack[subframe].harq_id = harq_pid; dlsch->harq_ack[subframe].send_harq_status = 1; + harq_process->errors[harq_process->round]++; harq_process->round++; // LOG_D(PHY,"[UE %d] DLSCH: Setting NACK for subframe %d (pid %d, round %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round); diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index de9acefb6e..f38cff301c 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -281,7 +281,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, // avgs = cmax(avgs,avg[(aarx<<1)+aatx]); - lte_ue_pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2); + lte_ue_pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2)+1; // + log2_approx(frame_parms->nb_antennas_tx_eNB-1) //-1 because log2_approx counts the number of bits // + log2_approx(frame_parms->nb_antennas_rx-1); diff --git a/openair1/PHY/LTE_TRANSPORT/print_stats.c b/openair1/PHY/LTE_TRANSPORT/print_stats.c index 032f8ce86f..839bc68190 100644 --- a/openair1/PHY/LTE_TRANSPORT/print_stats.c +++ b/openair1/PHY/LTE_TRANSPORT/print_stats.c @@ -61,6 +61,7 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t uint8_t eNB=0; uint32_t RRC_status; int len=length; + int harq_pid,round; if (phy_vars_ue==NULL) return 0; @@ -488,13 +489,27 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t if (phy_vars_ue->transmission_mode[eNB] == 6) len += sprintf(&buffer[len], "[UE PROC] Mode 6 Wideband CQI eNB %d : %d dB\n",eNB,phy_vars_ue->PHY_measurements.precoded_cqi_dB[eNB][0]); + for (harq_pid=0;harq_pid<8;harq_pid++) { + len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 0 harq_pid %d, mcs %d:",eNB,harq_pid,phy_vars_ue->dlsch_ue[0][0]->harq_processes[harq_pid]->mcs); + for (round=0;round<8;round++) + len+=sprintf(&buffer[len],"%d/%d ", + phy_vars_ue->dlsch_ue[0][0]->harq_processes[harq_pid]->errors[round], + phy_vars_ue->dlsch_ue[0][0]->harq_processes[harq_pid]->trials[round]); + len+=sprintf(&buffer[len],"\n"); + } if (phy_vars_ue->dlsch_ue[0] && phy_vars_ue->dlsch_ue[0][0] && phy_vars_ue->dlsch_ue[0][1]) { len += sprintf(&buffer[len], "[UE PROC] Saved PMI for DLSCH eNB %d : %jx (%p)\n",eNB,pmi2hex_2Ar1(phy_vars_ue->dlsch_ue[0][0]->pmi_alloc),phy_vars_ue->dlsch_ue[0][0]); len += sprintf(&buffer[len], "[UE PROC] eNB %d: dl_power_off = %d\n",eNB,phy_vars_ue->dlsch_ue[0][0]->harq_processes[0]->dl_power_off); - len += sprintf(&buffer[len], "[UE PROC] DL mcs1 (dlsch cw1) %d\n",phy_vars_ue->dlsch_ue[0][0]->harq_processes[0]->mcs); - len += sprintf(&buffer[len], "[UE PROC] DL mcs2 (dlsch cw2) %d\n",phy_vars_ue->dlsch_ue[0][1]->harq_processes[0]->mcs); + for (harq_pid=0;harq_pid<8;harq_pid++) { + len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 1 harq_pid %d, mcs %d:",eNB,harq_pid,phy_vars_ue->dlsch_ue[0][1]->harq_processes[0]->mcs); + for (round=0;round<8;round++) + len+=sprintf(&buffer[len],"%d/%d ", + phy_vars_ue->dlsch_ue[0][1]->harq_processes[harq_pid]->errors[round], + phy_vars_ue->dlsch_ue[0][1]->harq_processes[harq_pid]->trials[round]); + len+=sprintf(&buffer[len],"\n"); + } } len += sprintf(&buffer[len], "[UE PROC] DLSCH Total %d, Error %d, FER %d\n",phy_vars_ue->dlsch_received[0],phy_vars_ue->dlsch_errors[0],phy_vars_ue->dlsch_fer[0]); diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index cd452de193..1adf9931cd 100755 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -2637,7 +2637,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid], subframe_prev, harq_pid, - 1,0); + 1,1); stop_meas(&phy_vars_ue->dlsch_decoding_stats); } @@ -3320,7 +3320,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0], subframe_prev, 0, - 0,0); + 0,1); } else { // abstraction #ifdef PHY_ABSTRACTION ret = dlsch_decoding_emul(phy_vars_ue, diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 89aa19e8b9..7e67db5bc5 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -504,6 +504,16 @@ static void *UE_thread_synch(void *arg) if (abs(freq_offset) > 7500) { LOG_I( PHY, "[initial_sync] No cell synchronization found, abandoning\n" ); + FILE *fd; + if (fd = fopen("rxsig_frame0.dat","w")) { + fwrite((void*)&UE->lte_ue_common_vars.rxdata[0][0], + sizeof(int32_t), + 10*UE->lte_frame_parms.samples_per_tti, + fd); + LOG_I(PHY,"Dummping Frame ... bye bye \n"); + fclose(fd); + exit(0); + } mac_xface->macphy_exit("No cell synchronization found, abandoning"); return &UE_thread_synch_retval; // not reached } diff --git a/targets/RT/USER/ue_usrp.gtkw b/targets/RT/USER/ue_usrp.gtkw new file mode 100644 index 0000000000..81940b5643 --- /dev/null +++ b/targets/RT/USER/ue_usrp.gtkw @@ -0,0 +1,53 @@ +[*] +[*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI +[*] Sun Mar 20 18:27:06 2016 +[*] +[dumpfile] "/tmp/openair_dump_UE.vcd" +[dumpfile_mtime] "Sun Mar 20 18:14:17 2016" +[dumpfile_size] 92262400 +[savefile] "/home/papillon/openairinterface5g/targets/RT/USER/ue_usrp.gtkw" +[timestart] 30032830000 +[size] 1215 640 +[pos] 105 102 +*-22.292629 30041590000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +[sst_width] 224 +[signals_width] 262 +[sst_expanded] 1 +[sst_vpaned_height] 155 +@24 +variables.hw_subframe[63:0] +@28 +functions.trx_read +functions.trx_write +@24 +variables.subframe_number_RX_UE[63:0] +variables.subframe_number_TX_UE[63:0] +@28 +functions.ue_thread_rx +functions.ue_thread_tx +@420 +variables.ue_inst_cnt_rx[63:0] +variables.ue_inst_cnt_tx[63:0] +@28 +functions.phy_procedures_ue_rx +functions.phy_procedures_ue_tx +@24 +variables.frame_number_RX_UE[63:0] +variables.frame_number_TX_UE[63:0] +@28 +functions.ue_slot_fep +functions.lte_ue_measurement_procedures +functions.ue_rrc_measurements +functions.ue_gain_control +functions.ue_adjust_synch +functions.lte_ue_pbch_procedures +functions.lte_ue_pdcch_procedures +functions.rx_pdcch +functions.dci_decoding +functions.phy_ue_generate_prach +functions.phy_ue_ulsch_encoding +functions.phy_ue_ulsch_modulation +functions.phy_ue_ulsch_scrambling +functions.phy_ue_config_sib2 +[pattern_trace] 1 +[pattern_trace] 0 From c0f6881c15fd4767efc483ef9cb201bb20595bcf Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 20 Mar 2016 22:07:17 +0100 Subject: [PATCH 081/214] fixes after merge --- openair1/PHY/MODULATION/ofdm_mod.c | 4 ++-- openair1/SIMULATION/LTE_PHY/dlsim.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/MODULATION/ofdm_mod.c b/openair1/PHY/MODULATION/ofdm_mod.c index a187899617..f27f0500b0 100755 --- a/openair1/PHY/MODULATION/ofdm_mod.c +++ b/openair1/PHY/MODULATION/ofdm_mod.c @@ -145,12 +145,12 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input #ifndef __AVX2__ // handle 128-bit alignment for 128-bit SIMD (SSE4,NEON,AltiVEC) - idft((int16_t *)&input[i< Date: Sun, 20 Mar 2016 22:27:00 +0100 Subject: [PATCH 082/214] minor change on commented code --- openair1/SCHED/phy_procedures_lte_ue.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 1adf9931cd..913321bb98 100755 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -2654,16 +2654,19 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac if (ret == (1+phy_vars_ue->dlsch_ue[eNB_id][0]->max_turbo_iterations)) { phy_vars_ue->dlsch_errors[eNB_id]++; +#ifdef DEBUG_PHY_PROC LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d DLSCH in error (rv %d,mcs %d,TBS %d)\n", phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti, harq_pid,frame_rx,subframe_prev, phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rvidx, phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs, phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->TBS); - - // if (abstraction_flag ==0 ) - // dump_dlsch(phy_vars_ue,eNB_id,subframe_prev,harq_pid); - //mac_xface->macphy_exit("DLSCH in error"); +/* + if (abstraction_flag ==0 ) + dump_dlsch(phy_vars_ue,eNB_id,subframe_prev,harq_pid); + mac_xface->macphy_exit(""); +*/ +#endif } else { LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d (slot_rx %d): Received DLSCH (rv %d,mcs %d,TBS %d)\n", phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti, From c031cfe84e525a79d8c759cff1955d31cb996932 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 21 Mar 2016 10:28:37 +0100 Subject: [PATCH 083/214] minor fix for bug in Gitlab CI for checking out code --- cmake_targets/autotests/run_exec_lte-softmodem_tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py index ace214bb53..086ec12080 100755 --- a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py +++ b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py @@ -1401,8 +1401,8 @@ for oai in oai_list: #cmd = cmd + 'mkdir -p ' + logdir + '\n' cmd = cmd + 'cd '+ logdir + '\n' cmd = cmd + 'git config --global http.sslVerify false \n' - cmd = cmd + 'git clone --depth 1 '+ GitOAI5GRepo + ' -b ' + GitOAI5GRepoBranch +' \n' - cmd = cmd + 'git clone '+ GitOpenaircnRepo + ' -b ' +GitOpenaircnRepoBranch + ' \n' + cmd = cmd + 'git clone '+ GitOAI5GRepo +' \n' + cmd = cmd + 'git clone '+ GitOpenaircnRepo + ' \n' cmd = cmd + 'cd ' + logdirOAI5GRepo + '\n' cmd = cmd + 'git checkout ' + GitOAI5GRepoBranch + '\n' #cmd = cmd + 'git checkout ' + GitOAI5GHeadVersion + '\n' From 3a419bd4eaf14d804257d12a1895b62afb48a5b5 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 21 Mar 2016 10:42:28 +0100 Subject: [PATCH 084/214] minor fix for Gitlab CI logging --- cmake_targets/autotests/run_exec_lte-softmodem_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py index 086ec12080..f1c165acbf 100755 --- a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py +++ b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py @@ -1409,7 +1409,7 @@ for oai in oai_list: cmd = cmd + 'git_head=`git ls-remote |grep \'' + GitOAI5GRepoBranch + '\'` \n' cmd = cmd + 'git_head=($git_head) \n' cmd = cmd + 'git_head=${git_head[0]} \n' - cmd = cmd + 'echo \"GitOAI5GHeadVersion_remote = $git_head\"' + cmd = cmd + 'echo \"GitOAI5GHeadVersion_remote = $git_head\" \n' cmd = cmd + 'echo \"GitOAI5GHeadVersion_local = ' + GitOAI5GHeadVersion + '\" \n' if flag_skip_git_head_check==True: cmd = cmd + 'echo \"skipping GitHead check...\" \n ' From 28dae90984b71d169f620da3d3fff2889a843462 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 21 Mar 2016 11:29:02 +0100 Subject: [PATCH 085/214] fix for excluding tests listed in xml file --- .../autotests/run_exec_autotests.bash | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cmake_targets/autotests/run_exec_autotests.bash b/cmake_targets/autotests/run_exec_autotests.bash index a98a071bae..1029acc1e6 100755 --- a/cmake_targets/autotests/run_exec_autotests.bash +++ b/cmake_targets/autotests/run_exec_autotests.bash @@ -388,6 +388,7 @@ until [ -z "$1" ] -g | --run-group) RUN_GROUP=1 test_case_group=$2 + test_case_group=`sed "s/\+/\*/g" <<< "${test_case_group}"` # Replace + with * for bash string substituion echo_info "Will execute test cases only in group $test_case_group" shift 2;; -p) @@ -423,9 +424,17 @@ rm -fr $tmpfile xml_conf="$OPENAIR_DIR/cmake_targets/autotests/test_case_list.xml" test_case_list=`xmlstarlet sel -T -t -m /testCaseList/testCase -s A:N:- "@id" -v "@id" -n $xml_conf` +test_case_excl_list=`xmlstarlet sel -t -v "/testCaseList/TestCaseExclusionList" $xml_conf` +echo "Test Case Exclusion List = $test_case_excl_list " + +test_case_excl_list=`sed "s/\+/\*/g" <<< "$test_case_excl_list" ` # Replace + with * for bash string substituion + +read -a test_case_excl_array <<< "$test_case_excl_list" echo "test_case_list = $test_case_list" +echo "Test Case Exclusion List = $test_case_excl_list \n" + readarray -t test_case_array <<<"$test_case_list" read -a test_case_group_array <<< "$test_case_group" @@ -447,6 +456,15 @@ for search_expr in "${test_case_array[@]}" flag_run_test_case=1 fi + for search_excl in "${test_case_excl_array[@]}" + do + if [[ $search_expr == $search_excl ]];then + flag_run_test_case=0 + echo_info "Test case $search_expr match found in test case excl group. Will skip the test case for execution..." + break + fi + done + #We skip this test case if it is not in the group list if [ "$flag_run_test_case" -ne "1" ]; then From 17f29b776f237486c4aa66cefee0bdd4131feb7e Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Tue, 22 Mar 2016 03:07:20 -0700 Subject: [PATCH 086/214] tracing in unitary simulations (ulsim/prachsim) --- openair1/SIMULATION/LTE_PHY/prachsim.c | 1 + openair1/SIMULATION/LTE_PHY/ulsim.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/prachsim.c b/openair1/SIMULATION/LTE_PHY/prachsim.c index 187a521e07..b38bb3e5ff 100644 --- a/openair1/SIMULATION/LTE_PHY/prachsim.c +++ b/openair1/SIMULATION/LTE_PHY/prachsim.c @@ -326,6 +326,7 @@ int main(int argc, char **argv) Nid_cell, 3, N_RB_DL, + 0, osf, 0); diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 463c74c123..c8e793a5d9 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -513,11 +513,6 @@ int main(int argc, char **argv) nsymb = (PHY_vars_eNB->lte_frame_parms.Ncp == 0) ? 14 : 12; - coded_bits_per_codeword = nb_rb * (12 * get_Qm(mcs)) * nsymb; - - rate = (double)dlsch_tbs25[get_I_TBS(mcs)][nb_rb-1]/(coded_bits_per_codeword); - - printf("Rate = %f (mod %d), coded bits %d\n",rate,get_Qm(mcs),coded_bits_per_codeword); sprintf(bler_fname,"ULbler_mcs%d_nrb%d_ChannelModel%d_nsim%d.csv",mcs,nb_rb,chMod,n_frames); bler_fd = fopen(bler_fname,"w"); @@ -809,6 +804,13 @@ int main(int argc, char **argv) CBA_RNTI, srs_flag); + coded_bits_per_codeword = nb_rb * (12 * get_Qm_ul(mcs)) * nsymb; + + if (cqi_flag == 1) coded_bits_per_codeword-=PHY_vars_UE->ulsch_ue[0]->O; + + rate = (double)dlsch_tbs25[get_I_TBS(mcs)][nb_rb-1]/(coded_bits_per_codeword); + + printf("Rate = %f (mod %d), coded bits %d\n",rate,get_Qm_ul(mcs),coded_bits_per_codeword); PHY_vars_UE->frame_tx = (PHY_vars_UE->frame_tx+1)&1023; @@ -1516,7 +1518,7 @@ int main(int argc, char **argv) rate*effective_rate, 100*effective_rate, rate, - rate*get_Qm(mcs), + rate*get_Qm_ul(mcs), (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/ (double)PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->TBS, (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])); From 0d7e510d296ab2321a40b85ea8de52ff3e1c84ec Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Wed, 23 Mar 2016 16:00:22 +0100 Subject: [PATCH 087/214] fix size checks of CCCH it was at the wrong place it was also wrong (< instead of <=) --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 41 ++++++++++++----------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 493ff11d33..e6033d5057 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -229,6 +229,12 @@ void rx_sdu( switch (rx_lcids[i]) { case CCCH : + if (rx_lengths[i] > CCCH_PAYLOAD_SIZE_MAX) { + LOG_E(MAC, "[eNB %d/%d] frame %d received CCCH of size %d (too big, maximum allowed is %d), dropping packet\n", + enb_mod_idP, CC_idP, frameP, rx_lengths[i], CCCH_PAYLOAD_SIZE_MAX); + break; + } + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Received CCCH: %x.%x.%x.%x.%x.%x, Terminating RA procedure for UE rnti %x\n", enb_mod_idP,CC_idP,frameP, payload_ptr[0],payload_ptr[1],payload_ptr[2],payload_ptr[3],payload_ptr[4], payload_ptr[5], rntiP); @@ -302,26 +308,23 @@ void rx_sdu( #endif if (UE_id != -1) { - // This check is just to make sure we didn't get a bogus SDU length, to be removed ... - if (rx_lengths[i] UL-DCCH, received %d bytes form UE %d on LCID %d \n", - enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id, rx_lcids[i]); + LOG_D(MAC,"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DCCH, received %d bytes form UE %d on LCID %d \n", + enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id, rx_lcids[i]); - mac_rlc_data_ind( - enb_mod_idP, - rntiP, - enb_mod_idP, - frameP, - ENB_FLAG_YES, - MBMS_FLAG_NO, - rx_lcids[i], - (char *)payload_ptr, - rx_lengths[i], - 1, - NULL);//(unsigned int*)crc_status); - UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]]+=1; - UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]]+=rx_lengths[i]; - } + mac_rlc_data_ind( + enb_mod_idP, + rntiP, + enb_mod_idP, + frameP, + ENB_FLAG_YES, + MBMS_FLAG_NO, + rx_lcids[i], + (char *)payload_ptr, + rx_lengths[i], + 1, + NULL);//(unsigned int*)crc_status); + UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]]+=1; + UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]]+=rx_lengths[i]; } /* UE_id != -1 */ // } From ffd02335a428116355f6b8b55a5e51bf50f4be6d Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Wed, 23 Mar 2016 16:49:17 +0100 Subject: [PATCH 088/214] fixes to take into account new asn1 patch --- cmake_targets/tools/fix_asn1 | 8 ++++---- .../tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff | 4 ++-- .../tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmake_targets/tools/fix_asn1 b/cmake_targets/tools/fix_asn1 index 4c3940079a..dcc00d5e37 100755 --- a/cmake_targets/tools/fix_asn1 +++ b/cmake_targets/tools/fix_asn1 @@ -9,13 +9,13 @@ RRC_Rel10=( X2AP_Rel11_2=( "X2ap-CriticalityDiagnostics-IE-List.h" ae96308b37fcbcbf39da5012e42968135fc5f27b "fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff" - "NativeInteger.c" f815a276f31ec54e03ed008d4f01faee579f00be "fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff" - "constr_SET_OF.c" aeae707ba2471104a862477eb0107f04f4793ff4 "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff" + "NativeInteger.c" 9f173e87daa1e7378618dbb060a10aae752d74be "fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff" + "constr_SET_OF.c" 5c8765a1e0fc44a48e406d0aa7628004bf3aac2a "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff" ) S1AP_Rel10_5=( - "NativeInteger.c" f815a276f31ec54e03ed008d4f01faee579f00be "fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff" - "constr_SET_OF.c" aeae707ba2471104a862477eb0107f04f4793ff4 "fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff" + "NativeInteger.c" 9f173e87daa1e7378618dbb060a10aae752d74be "fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff" + "constr_SET_OF.c" 5c8765a1e0fc44a48e406d0aa7628004bf3aac2a "fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff" ) red_color="$(tput setaf 1)" diff --git a/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff b/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff index c1649fd6f7..3b51426ad3 100644 --- a/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff +++ b/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff @@ -1,8 +1,8 @@ -282c282 +283c283 < int dynamic = 0; --- > //int dynamic = 0; -289c289 +290c290 < dynamic = 1; --- > //dynamic = 1; diff --git a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff index c1649fd6f7..3b51426ad3 100644 --- a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff +++ b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff @@ -1,8 +1,8 @@ -282c282 +283c283 < int dynamic = 0; --- > //int dynamic = 0; -289c289 +290c290 < dynamic = 1; --- > //dynamic = 1; From f79b0e7d9b273bb1fd561574fcd49ed8cf5e17df Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 23 Mar 2016 21:15:49 +0100 Subject: [PATCH 089/214] added hotfix for DCCH bad size limitation (to be checked after merge with develop). Changed UL idle scheduling to improve 5MHz performance, changed DCI aggregation for ue-specific DCIs (reduces contention with SI and RA in subframe 5 for 5 MHz). Added RRC timer for UE release which cleans L1. Still issues in 10 MHz throughput with TCP. 5 MHz seems almost fine. --- openair1/SCHED/phy_procedures_lte_eNb.c | 3 ++- openair2/LAYER2/MAC/eNB_scheduler.c | 4 ++-- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 4 ++-- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 2 -- openair2/RRC/LITE/defs.h | 1 + openair2/RRC/LITE/rrc_common.c | 9 +++++++++ openair2/RRC/LITE/rrc_eNB.c | 2 ++ 7 files changed, 18 insertions(+), 7 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 68ea6270e9..03a0ad1088 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -2980,8 +2980,9 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t mac_xface->macphy_exit("Exiting for PRACH debug\n"); */ - UE_id = find_next_ue_index(phy_vars_eNB); + UE_id = find_next_ue_index(phy_vars_eNB); + if (UE_id>=0) { phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset = preamble_delay_list[preamble_max]&0x1FFF; //limit to 13 (=11+2) bits //phy_vars_eNb->eNB_UE_stats[(uint32_t)UE_id].mode = PRACH; diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index a73daad499..570a7a1608 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -145,7 +145,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=1; // add a format 1A dci for this UE to request an RA procedure (only one UE per subframe) - LOG_I(MAC,"UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d) \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); + LOG_D(MAC,"UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d) \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); DLSCH_dci = (void *)UE_list->UE_template[CC_id][i].DLSCH_DCI[0]; *(uint32_t*)DLSCH_dci = 0; if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { @@ -224,7 +224,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, // check threshold if (UE_list->UE_sched_ctrl[i].ul_failure_timer > 200) { // inform RRC of failure and clear timer - LOG_I(MAC,"UE %d rnti %x: UL Failure Triggering RRC \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); + LOG_I(MAC,"UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); mac_eNB_rrc_ul_failure(module_idP,CC_id,frameP,subframeP,rnti); UE_list->UE_sched_ctrl[i].ul_failure_timer=0; UE_list->UE_sched_ctrl[i].ul_out_of_sync=1; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 4145d8c045..fe06e8081f 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -193,7 +193,7 @@ uint8_t find_active_UEs(module_id_t module_idP,int CC_id){ // get aggregatiob form phy for a give UE unsigned char process_ue_cqi (module_id_t module_idP, int ue_idP) { - unsigned char aggregation=2; + unsigned char aggregation=1; // check the MCS and SNR and set the aggregation accordingly return aggregation; } @@ -707,7 +707,7 @@ uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id) (UE_template->bsr_info[LCGID2]>0) || (UE_template->bsr_info[LCGID3]>0) || (UE_template->ul_SR>0) || // uplink scheduling request - ((UE_sched_ctl->ul_inactivity_timer>50)&& + ((UE_sched_ctl->ul_inactivity_timer>20)&& (UE_sched_ctl->ul_scheduled==0))|| // every 2 frames when RRC_CONNECTED ((UE_sched_ctl->ul_inactivity_timer>10)&& (UE_sched_ctl->ul_scheduled==0)&& diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index ea10f5a9fd..3d7efad87d 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -400,7 +400,6 @@ void rx_sdu( UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0; // This check is just to make sure we didn't get a bogus SDU length, to be removed ... - if (rx_lengths[i] UL-DCCH, received %d bytes form UE %d on LCID %d \n", enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id, rx_lcids[i]); @@ -418,7 +417,6 @@ void rx_sdu( NULL);//(unsigned int*)crc_status); UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]]+=1; UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]]+=rx_lengths[i]; - } } /* UE_id != -1 */ // } diff --git a/openair2/RRC/LITE/defs.h b/openair2/RRC/LITE/defs.h index 49dc4d06ad..7a52115440 100644 --- a/openair2/RRC/LITE/defs.h +++ b/openair2/RRC/LITE/defs.h @@ -358,6 +358,7 @@ typedef struct eNB_RRC_UE_s { rb_id_t enb_gtp_ebi[S1AP_MAX_E_RAB]; #endif uint32_t ul_failure_timer; + uint32_t ue_release_timer; } eNB_RRC_UE_t; typedef uid_t ue_uid_t; diff --git a/openair2/RRC/LITE/rrc_common.c b/openair2/RRC/LITE/rrc_common.c index 595e87a534..e6cbb2dcfb 100644 --- a/openair2/RRC/LITE/rrc_common.c +++ b/openair2/RRC/LITE/rrc_common.c @@ -531,6 +531,15 @@ rrc_rx_tx( break; } } + if (ue_context_p->ue_context.ue_release_timer>0) { + ue_context_p->ue_context.ue_release_timer++; + if (ue_context_p->ue_context.ue_release_timer >= 100) { + // remove UE after 10 frames after RRCConnectionRelease is triggered + LOG_I(RRC,"Removing UE %x instance\n",ue_context_p->ue_context.rnti); + ue_to_be_removed = ue_context_p; + break; + } + } } if (ue_to_be_removed) rrc_eNB_free_UE(ctxt_pP->module_id,ue_to_be_removed); diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index abc7435b79..b22cd5c38e 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -1090,6 +1090,8 @@ rrc_eNB_generate_RRCConnectionRelease( memset(buffer, 0, RRC_BUF_SIZE); size = do_RRCConnectionRelease(ctxt_pP->module_id, buffer,rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id)); + // set release timer + ue_context_pP->ue_context.ue_release_timer=1; LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Logical Channel DL-DCCH, Generate RRCConnectionRelease (bytes %d)\n", From 0057448b9100038e20d62f64a29fca0275bee91f Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Thu, 24 Mar 2016 10:45:52 -0700 Subject: [PATCH 090/214] removed unused MAC_INTERFACE directory --- openair1/MAC_INTERFACE/COPYING | 674 ---------------------------- openair1/MAC_INTERFACE/Makefile.inc | 2 - openair1/MAC_INTERFACE/defs.h | 42 -- openair1/MAC_INTERFACE/extern.h | 55 --- openair1/MAC_INTERFACE/init.c | 76 ---- openair1/MAC_INTERFACE/register.c | 121 ----- openair1/MAC_INTERFACE/vars.h | 52 --- 7 files changed, 1022 deletions(-) delete mode 100644 openair1/MAC_INTERFACE/COPYING delete mode 100644 openair1/MAC_INTERFACE/Makefile.inc delete mode 100755 openair1/MAC_INTERFACE/defs.h delete mode 100755 openair1/MAC_INTERFACE/extern.h delete mode 100644 openair1/MAC_INTERFACE/init.c delete mode 100644 openair1/MAC_INTERFACE/register.c delete mode 100755 openair1/MAC_INTERFACE/vars.h diff --git a/openair1/MAC_INTERFACE/COPYING b/openair1/MAC_INTERFACE/COPYING deleted file mode 100644 index 818433ecc0..0000000000 --- a/openair1/MAC_INTERFACE/COPYING +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/openair1/MAC_INTERFACE/Makefile.inc b/openair1/MAC_INTERFACE/Makefile.inc deleted file mode 100644 index 5dcd2a3ffe..0000000000 --- a/openair1/MAC_INTERFACE/Makefile.inc +++ /dev/null @@ -1,2 +0,0 @@ -#MAC_XFACE_OBJS = $(OPENAIR1_TOP)/MAC_INTERFACE/register.o -MAC_XFACE_OBJS += $(OPENAIR1_TOP)/MAC_INTERFACE/init.o diff --git a/openair1/MAC_INTERFACE/defs.h b/openair1/MAC_INTERFACE/defs.h deleted file mode 100755 index dbaab57fcc..0000000000 --- a/openair1/MAC_INTERFACE/defs.h +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - OpenAirInterface - Copyright(c) 1999 - 2014 Eurecom - - OpenAirInterface is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - - OpenAirInterface is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with OpenAirInterface.The full GNU General Public License is - included in this distribution in the file called "COPYING". If not, - see . - - Contact Information - OpenAirInterface Admin: openair_admin@eurecom.fr - OpenAirInterface Tech : openair_tech@eurecom.fr - OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr - - Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE - - *******************************************************************************/ -/*________________________mac_defs.h________________________ - - Authors : Hicham Anouar, Raymond Knopp - Company : EURECOM - Emails : anouar@eurecom.fr, knopp@eurecom.fr - ________________________________________________________________*/ - -#ifndef __MAC_INTERFACE_DEFS_H__ -#define __MAC_INTERFACE_DEFS_H__ - - -#include "PHY_INTERFACE/defs.h" - -#endif diff --git a/openair1/MAC_INTERFACE/extern.h b/openair1/MAC_INTERFACE/extern.h deleted file mode 100755 index a7444939ee..0000000000 --- a/openair1/MAC_INTERFACE/extern.h +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - OpenAirInterface - Copyright(c) 1999 - 2014 Eurecom - - OpenAirInterface is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - - OpenAirInterface is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with OpenAirInterface.The full GNU General Public License is - included in this distribution in the file called "COPYING". If not, - see . - - Contact Information - OpenAirInterface Admin: openair_admin@eurecom.fr - OpenAirInterface Tech : openair_tech@eurecom.fr - OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr - - Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE - - *******************************************************************************/ -/*________________________mac_extern.h________________________ - - Authors : Hicham Anouar, Raymond Knopp - Company : EURECOM - Emails : anouar@eurecom.fr, knopp@eurecom.fr -________________________________________________________________*/ - - -/*! \file mac_extern.h -* \brief Generic mac interface external variable definitions -* \author R. Knopp -* \date March 2006 -* \note -* \warning -* @ingroup macxface -*/ - -#ifndef __MAC_INTERFACE_EXTERN_H__ -#define __MAC_INTERFACE_EXTERN_H__ - -#include "defs.h" - - -extern MAC_xface *mac_xface; - - -#endif /*__MAC_INTERFACE_EXTERN_H__ */ diff --git a/openair1/MAC_INTERFACE/init.c b/openair1/MAC_INTERFACE/init.c deleted file mode 100644 index 480d365f09..0000000000 --- a/openair1/MAC_INTERFACE/init.c +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************* - OpenAirInterface - Copyright(c) 1999 - 2014 Eurecom - - OpenAirInterface is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - - OpenAirInterface is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with OpenAirInterface.The full GNU General Public License is - included in this distribution in the file called "COPYING". If not, - see . - - Contact Information - OpenAirInterface Admin: openair_admin@eurecom.fr - OpenAirInterface Tech : openair_tech@eurecom.fr - OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr - - Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE - - *******************************************************************************/ -/*________________________mac_init.c________________________ - - Authors : Hicham Anouar, Raymond Knopp - Company : EURECOM - Emails : anouar@eurecom.fr, knopp@eurecom.fr -________________________________________________________________*/ - -/*!\brief Initilization and reconfiguration routines for generic MAC interface */ - -#include "defs.h" -#include "extern.h" -#include "SCHED/defs.h" - -int mac_init(void) -{ - int i; - -#ifndef USER_MODE - // mac_xface->macphy_init(); - mac_xface->macphy_exit = openair_sched_exit; -#else - mac_xface->macphy_exit=(void (*)(void)) exit; -#endif - - /* this is done in cbmimo1_fileops - #ifdef OPENAIR2 - mac_xface->macphy_init(); - #endif //OPENAIR2 - */ - - return(1); -} - -void mac_cleanup(void) -{ - -} - -void mac_resynch(void) -{ - -} - -/* -#ifdef OPENAIR2 -EXPORT_SYMBOL(frame); -#endif //OPENAIR2 -*/ diff --git a/openair1/MAC_INTERFACE/register.c b/openair1/MAC_INTERFACE/register.c deleted file mode 100644 index 0c3c611817..0000000000 --- a/openair1/MAC_INTERFACE/register.c +++ /dev/null @@ -1,121 +0,0 @@ -/******************************************************************************* - OpenAirInterface - Copyright(c) 1999 - 2014 Eurecom - - OpenAirInterface is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - - OpenAirInterface is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with OpenAirInterface.The full GNU General Public License is - included in this distribution in the file called "COPYING". If not, - see . - - Contact Information - OpenAirInterface Admin: openair_admin@eurecom.fr - OpenAirInterface Tech : openair_tech@eurecom.fr - OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr - - Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE - - *******************************************************************************/ -/*________________________mac_register.c________________________ - - Authors : Hicham Anouar, Raymond Knopp - Company : EURECOM - Emails : anouar@eurecom.fr, knopp@eurecom.fr -________________________________________________________________*/ - - -/*!\brief Registration routines for generic MAC interface. Register/unregister a MAC. -Upon registration, the MAC retrieves the transport channel (MAC_tch) data structure and provides the -pointer to the macphy_scheduler() routine*/ -#define __NO_VERSION__ - -#undef __PHY_IMPLEMENTATION_DEFS_H__ - -#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h" -#include "defs.h" -#include "extern.h" -#include "SCHED/extern.h" - -#ifndef USER_MODE - - - - - -void dummy_macphy_scheduler(uint8_t last_slot) -{ - //if (last_slot == 0) - // mac_xface->frame++; - - msg("[OPENAIR][MAC XFACE] in dummy_macphy_scheduler(): MAC no yet registered!\n"); - - //#ifdef EMOS - // phy_procedures(last_slot); - //#endif - -} - -void dummy_macphy_setparams(void *params) -{ - msg("[OPENAIR][MAC XFACE] dummy_macphy_setparams(): no MAC registered!\n"); -} - -void dummy_macphy_init(void ) -{ - msg("[OPENAIR][MAC XFACE] dummy_macphy_init(): no MAC registered!\n"); -} - -MAC_xface *mac_register(void macphy_scheduler(uint8_t last_slot), void macphy_setparams(void *),void macphy_init(void ),void mrbch_phy_sync_failure(unsigned char,unsigned char), - void chbch_phy_sync_success(unsigned char,unsigned char)) -{ - - if (openair_daq_vars.mac_registered == 0) { - - msg("[OPENAIR][MAC XFACE] Registering new MAC interface at %p, scheduler %p, setparams at %p, init at %p\n", - mac_xface,macphy_scheduler,macphy_setparams,macphy_init); - mac_xface->macphy_scheduler = macphy_scheduler; - mac_xface->macphy_setparams = macphy_setparams; - mac_xface->macphy_init = macphy_init; -#ifndef PC_TARGET - // mac_xface->ublaze_mac_xface = ublaze_mac_xface; -#endif - openair_daq_vars.mac_registered=1; - return(mac_xface); - } else { - msg("[OPENAIR][MAC XFACE] MAC interface already registered, aborting ...\n"); - return NULL; - } - - -} - -int mac_unregister(MAC_xface *mac_xface_rx) -{ - - if (mac_xface_rx == mac_xface) { - msg("[OPENAIR][MAC XFACE] Unregistering MAC interface\n"); - mac_xface->macphy_scheduler = dummy_macphy_scheduler; - mac_xface->macphy_setparams = dummy_macphy_setparams; - mac_xface->macphy_init = dummy_macphy_init; - openair_daq_vars.mac_registered=0; - return(0); - } else { - msg("[OPENAIR][MAC XFACE] Not the right interface descriptor pointer!!!, aborting ...\n"); - return (-1); - } - -} - -EXPORT_SYMBOL(mac_register); -EXPORT_SYMBOL(mac_unregister); -#endif //USER_MODE diff --git a/openair1/MAC_INTERFACE/vars.h b/openair1/MAC_INTERFACE/vars.h deleted file mode 100755 index e3ef7f6ab1..0000000000 --- a/openair1/MAC_INTERFACE/vars.h +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - OpenAirInterface - Copyright(c) 1999 - 2014 Eurecom - - OpenAirInterface is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - - OpenAirInterface is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with OpenAirInterface.The full GNU General Public License is - included in this distribution in the file called "COPYING". If not, - see . - - Contact Information - OpenAirInterface Admin: openair_admin@eurecom.fr - OpenAirInterface Tech : openair_tech@eurecom.fr - OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr - - Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE - - *******************************************************************************/ -/*________________________mac_vars.h________________________ - - Authors : Hicham Anouar, Raymond Knopp - Company : EURECOM - Emails : anouar@eurecom.fr, knopp@eurecom.fr -________________________________________________________________*/ - - -/*! \file mac_vars.h -* \brief generic mac interface variable definitions -* \author R. Knopp -* \version 1 -* \date March 2006 -* @ingroup macxface -*/ - -#ifndef __MAC_INTERFACE_VARS_H__ -#define __MAC_INTERFACE_VARS_H__ - -#include "defs.h" - -MAC_xface *mac_xface; - -#endif //__MAC_INTERFACE_VARS_H__ From 81f5d25e65aa80cc70e7cbbf6777489d234652d0 Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 25 Mar 2016 08:49:20 +0100 Subject: [PATCH 091/214] changed some PUSCH/PUCCH parameters in configuration file. --- .../CONF/enb.band7.tm1.50PRB.usrpb210.conf | 10 +++++----- .../GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index 7e17a07512..d5d1f0d78a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -64,9 +64,9 @@ eNBs = srs_ackNackST =; srs_MaxUpPts =;*/ - pusch_p0_Nominal = -90; + pusch_p0_Nominal = -96; pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; + pucch_p0_Nominal = -103; msg3_delta_Preamble = 6; pucch_deltaF_Format1 = "deltaF2"; pucch_deltaF_Format1b = "deltaF3"; @@ -82,7 +82,7 @@ eNBs = rach_messagePowerOffsetGroupB = ; */ rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -100; + rach_preambleInitialReceivedTargetPower = -104; rach_preambleTransMax = 10; rach_raResponseWindowSize = 10; rach_macContentionResolutionTimer = 48; @@ -140,10 +140,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf index 773c3dd71e..985017e8d5 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf @@ -17,7 +17,7 @@ eNBs = mobile_country_code = "208"; - mobile_network_code = "95"; + mobile_network_code = "93"; ////////// Physical parameters: @@ -28,7 +28,7 @@ eNBs = tdd_config_s = 0; prefix_type = "NORMAL"; eutra_band = 7; - downlink_frequency = 2685000000L; + downlink_frequency = 2660000000L; uplink_frequency_offset = -120000000; Nid_cell = 0; N_RB_DL = 25; @@ -133,7 +133,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.211"; + mme_ip_address = ( { ipv4 = "192.168.12.11"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; From 8028652a71158149f0b3f5ac188f48bda7750428 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 25 Mar 2016 20:08:04 +0100 Subject: [PATCH 092/214] hotfix for enb/EPC local config file --- .../GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf index 3043256628..1ea7b64740 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf @@ -144,7 +144,6 @@ eNBs = ENB_INTERFACE_NAME_FOR_S1U = "eth0:4"; ENB_IPV4_ADDRESS_FOR_S1U = "192.170.1.2/24"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.170.0.2/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; @@ -167,4 +166,4 @@ eNBs = }; } -); +); \ No newline at end of file From a56b0a1f702f85d04cfeeae4998148fed832b402 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Fri, 25 Mar 2016 22:14:54 +0100 Subject: [PATCH 093/214] clean liblfds (comment #pragma lines) --- .../src/lfds611_freelist/lfds611_freelist_new.c | 4 ++-- .../liblfds611/src/lfds611_queue/lfds611_queue_delete.c | 4 ++-- .../liblfds611/src/lfds611_queue/lfds611_queue_new.c | 8 ++++---- .../liblfds611/src/lfds611_queue/lfds611_queue_query.c | 4 ++-- .../src/lfds611_ringbuffer/lfds611_ringbuffer_new.c | 4 ++-- .../src/lfds611_ringbuffer/lfds611_ringbuffer_query.c | 4 ++-- .../liblfds611/src/lfds611_slist/lfds611_slist_new.c | 4 ++-- .../liblfds611/src/lfds611_stack/lfds611_stack_delete.c | 4 ++-- .../liblfds611/src/lfds611_stack/lfds611_stack_new.c | 8 ++++---- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_new.c index 477887e76f..2eeae80097 100644 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_new.c +++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_new.c @@ -48,7 +48,7 @@ int lfds611_freelist_new( struct lfds611_freelist_state **fs, lfds611_atom_t num /****************************************************************************/ -#pragma warning( disable : 4100 ) +//#pragma warning( disable : 4100 ) void lfds611_freelist_use( struct lfds611_freelist_state *fs ) { @@ -59,7 +59,7 @@ void lfds611_freelist_use( struct lfds611_freelist_state *fs ) return; } -#pragma warning( default : 4100 ) +//#pragma warning( default : 4100 ) diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_delete.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_delete.c index 718cfe1ae9..a11b501e56 100644 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_delete.c +++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_delete.c @@ -41,7 +41,7 @@ void lfds611_queue_delete( struct lfds611_queue_state *qs, void (*user_data_dele /****************************************************************************/ -#pragma warning( disable : 4100 ) +//#pragma warning( disable : 4100 ) void lfds611_queue_internal_freelist_delete_function( void *user_data, void *user_state ) { @@ -53,5 +53,5 @@ void lfds611_queue_internal_freelist_delete_function( void *user_data, void *use return; } -#pragma warning( default : 4100 ) +//#pragma warning( default : 4100 ) diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_new.c index accc6c3769..7fec0a2e90 100644 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_new.c +++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_new.c @@ -46,7 +46,7 @@ int lfds611_queue_new( struct lfds611_queue_state **qs, lfds611_atom_t number_el /****************************************************************************/ -#pragma warning( disable : 4100 ) +//#pragma warning( disable : 4100 ) void lfds611_queue_use( struct lfds611_queue_state *qs ) { @@ -57,14 +57,14 @@ void lfds611_queue_use( struct lfds611_queue_state *qs ) return; } -#pragma warning( default : 4100 ) +//#pragma warning( default : 4100 ) /****************************************************************************/ -#pragma warning( disable : 4100 ) +//#pragma warning( disable : 4100 ) int lfds611_queue_internal_freelist_init_function( void **user_data, void *user_state ) { @@ -82,7 +82,7 @@ int lfds611_queue_internal_freelist_init_function( void **user_data, void *user_ return( rv ); } -#pragma warning( default : 4100 ) +//#pragma warning( default : 4100 ) diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_query.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_query.c index 2a546dde39..504485d7b5 100644 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_query.c +++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_query.c @@ -5,7 +5,7 @@ /****************************************************************************/ -#pragma warning( disable : 4100 ) +//#pragma warning( disable : 4100 ) void lfds611_queue_query( struct lfds611_queue_state *qs, enum lfds611_queue_query_type query_type, void *query_input, void *query_output ) { @@ -31,7 +31,7 @@ void lfds611_queue_query( struct lfds611_queue_state *qs, enum lfds611_queue_que return; } -#pragma warning( default : 4100 ) +//#pragma warning( default : 4100 ) diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_new.c index 2fafe52a37..6d8dde2a54 100644 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_new.c +++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_new.c @@ -48,7 +48,7 @@ int lfds611_ringbuffer_new( struct lfds611_ringbuffer_state **rs, lfds611_atom_t /****************************************************************************/ -#pragma warning( disable : 4100 ) +//#pragma warning( disable : 4100 ) void lfds611_ringbuffer_use( struct lfds611_ringbuffer_state *rs ) { @@ -59,5 +59,5 @@ void lfds611_ringbuffer_use( struct lfds611_ringbuffer_state *rs ) return; } -#pragma warning( default : 4100 ) +//#pragma warning( default : 4100 ) diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_query.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_query.c index ad3d56a788..11bf8b0b6e 100644 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_query.c +++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_query.c @@ -5,7 +5,7 @@ /****************************************************************************/ -#pragma warning( disable : 4100 ) +//#pragma warning( disable : 4100 ) void lfds611_ringbuffer_query( struct lfds611_ringbuffer_state *rs, enum lfds611_ringbuffer_query_type query_type, void *query_input, void *query_output ) { @@ -26,7 +26,7 @@ void lfds611_ringbuffer_query( struct lfds611_ringbuffer_state *rs, enum lfds611 return; } -#pragma warning( default : 4100 ) +//#pragma warning( default : 4100 ) diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_new.c index 7142694a67..b48e349ab0 100644 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_new.c +++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_new.c @@ -31,7 +31,7 @@ int lfds611_slist_new( struct lfds611_slist_state **ss, void (*user_data_delete_ /****************************************************************************/ -#pragma warning( disable : 4100 ) +//#pragma warning( disable : 4100 ) void lfds611_slist_use( struct lfds611_slist_state *ss ) { @@ -42,7 +42,7 @@ void lfds611_slist_use( struct lfds611_slist_state *ss ) return; } -#pragma warning( default : 4100 ) +//#pragma warning( default : 4100 ) diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_delete.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_delete.c index 6a79156a52..75700e6b39 100644 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_delete.c +++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_delete.c @@ -51,7 +51,7 @@ void lfds611_stack_clear( struct lfds611_stack_state *ss, void (*user_data_clear /****************************************************************************/ -#pragma warning( disable : 4100 ) +//#pragma warning( disable : 4100 ) void lfds611_stack_internal_freelist_delete_function( void *user_data, void *user_state ) { @@ -63,5 +63,5 @@ void lfds611_stack_internal_freelist_delete_function( void *user_data, void *use return; } -#pragma warning( default : 4100 ) +//#pragma warning( default : 4100 ) diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_new.c index 820e51bcc5..927f28c88c 100644 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_new.c +++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_new.c @@ -42,7 +42,7 @@ int lfds611_stack_new( struct lfds611_stack_state **ss, lfds611_atom_t number_el /****************************************************************************/ -#pragma warning( disable : 4100 ) +//#pragma warning( disable : 4100 ) void lfds611_stack_use( struct lfds611_stack_state *ss ) { @@ -53,14 +53,14 @@ void lfds611_stack_use( struct lfds611_stack_state *ss ) return; } -#pragma warning( default : 4100 ) +//#pragma warning( default : 4100 ) /****************************************************************************/ -#pragma warning( disable : 4100 ) +//#pragma warning( disable : 4100 ) int lfds611_stack_internal_freelist_init_function( void **user_data, void *user_state ) { @@ -78,7 +78,7 @@ int lfds611_stack_internal_freelist_init_function( void **user_data, void *user_ return( rv ); } -#pragma warning( default : 4100 ) +//#pragma warning( default : 4100 ) From 3f8c74caba1a7699f7b422472fa0ccef8520379b Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Fri, 25 Mar 2016 22:26:40 +0100 Subject: [PATCH 094/214] avoid duplicate #define --- common/utils/itti/memory_pools.c | 2 ++ openair1/PHY/defs.h | 10 ++++++---- openair2/COMMON/openair_defs.h | 8 +++++++- openair2/RRC/LITE/rrc_eNB_S1AP.c | 1 + openair2/UTIL/OMV/structures.h | 4 +++- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/common/utils/itti/memory_pools.c b/common/utils/itti/memory_pools.c index dadc80ca2a..97ec7d8e38 100644 --- a/common/utils/itti/memory_pools.c +++ b/common/utils/itti/memory_pools.c @@ -54,7 +54,9 @@ uint64_t vcd_mp_free; #endif /*------------------------------------------------------------------------------*/ +#ifndef CHARS_TO_UINT32 #define CHARS_TO_UINT32(c1, c2, c3, c4) (((c1) << 24) | ((c2) << 16) | ((c3) << 8) | (c4)) +#endif #define MEMORY_POOL_ITEM_INFO_NUMBER 2 diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index 578b05634c..3c16ce0cd3 100755 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -65,10 +65,12 @@ //use msg in the real-time thread context #define msg_nrt printf //use msg_nrt in the non real-time context (for initialization, ...) -#ifdef __AVX2__ -#define malloc16(x) memalign(32,x) -#else -#define malloc16(x) memalign(16,x) +#ifndef malloc16 +# ifdef __AVX2__ +# define malloc16(x) memalign(32,x) +# else +# define malloc16(x) memalign(16,x) +# endif #endif #define free16(y,x) free(y) #define bigmalloc malloc diff --git a/openair2/COMMON/openair_defs.h b/openair2/COMMON/openair_defs.h index 0a6b88ce33..c2dd4d0616 100755 --- a/openair2/COMMON/openair_defs.h +++ b/openair2/COMMON/openair_defs.h @@ -41,7 +41,13 @@ #if !defined (msg) # define msg(aRGS...) LOG_D(PHY, ##aRGS) #endif -#define malloc16(x) memalign(16,x) //malloc(x) +#ifndef malloc16 +# ifdef __AVX2__ +# define malloc16(x) memalign(32,x) +# else +# define malloc16(x) memalign(16,x) +# endif +#endif #define free16(y,x) free(y) #define bigmalloc malloc #define bigmalloc16 malloc16 diff --git a/openair2/RRC/LITE/rrc_eNB_S1AP.c b/openair2/RRC/LITE/rrc_eNB_S1AP.c index d93b8eea2f..375fc3e0cf 100644 --- a/openair2/RRC/LITE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LITE/rrc_eNB_S1AP.c @@ -392,6 +392,7 @@ rrc_pdcp_config_security( #define DEBUG_SECURITY 1 #if defined (DEBUG_SECURITY) +#undef msg #define msg printf if (print_keys ==1 ) { diff --git a/openair2/UTIL/OMV/structures.h b/openair2/UTIL/OMV/structures.h index f3b2b69d73..6c131371cb 100755 --- a/openair2/UTIL/OMV/structures.h +++ b/openair2/UTIL/OMV/structures.h @@ -44,7 +44,9 @@ #define Maxneighbor 64 #define NUMBER_OF_UE_MAX 64 #define NUMBER_OF_eNB_MAX 3 -#define NB_ANTENNAS_RX 4 +#ifndef NB_ANTENNAS_RX +# define NB_ANTENNAS_RX 4 +#endif #endif // From 04eed3bd6e6a80fcd37d21f5172700a179633186 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Fri, 25 Mar 2016 23:58:58 +0100 Subject: [PATCH 095/214] remove "unused variable" and "set but not used" warnings --- cmake_targets/tools/fix_asn1 | 4 ++-- common/utils/collection/hashtable/hashtable.c | 1 - openair1/PHY/INIT/lte_init.c | 8 ++++---- openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c | 4 ++-- openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c | 2 +- openair1/SCHED/phy_mac_stub.c | 6 +++--- openair1/SCHED/phy_procedures_lte_eNb.c | 3 +++ openair1/SCHED/pucch_pc.c | 10 +++++----- openair2/ENB_APP/enb_config.c | 4 ++-- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 10 +++++----- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 2 +- openair2/LAYER2/MAC/pre_processor.c | 6 +++--- openair2/LAYER2/PDCP_v10.1.0/pdcp.c | 2 ++ openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c | 3 +++ openair2/LAYER2/RLC/rlc_rrc.c | 2 +- openair2/LAYER2/openair2_proc.c | 2 +- openair2/RRC/LITE/rrc_UE.c | 2 ++ openair2/RRC/LITE/rrc_common.c | 5 ++++- openair2/RRC/LITE/rrc_eNB.c | 14 +++++++------- openair2/RRC/LITE/rrc_eNB_GTPV1U.c | 1 + openair2/RRC/LITE/rrc_eNB_S1AP.c | 6 +++--- openair2/UTIL/OMG/common.c | 9 ++------- openair2/UTIL/OMG/omg.c | 2 +- openair2/UTIL/OMG/steadystaterwp.c | 6 +++--- openair2/UTIL/OMG/trace.c | 4 ++-- openair2/UTIL/OMG/trace_hashtable.c | 2 -- openair2/UTIL/OSA/osa_stream_eea.c | 2 -- openair3/GTPV1-U/gtpv1u_eNB.c | 7 ++++--- openair3/NAS/COMMON/IES/MsNetworkFeatureSupport.c | 4 ++-- openair3/NAS/UE/EMM/EmmStatusHdl.c | 2 +- openair3/NAS/UE/EMM/LowerLayer.c | 2 +- openair3/NAS/UE/EMM/SAP/emm_fsm.c | 2 +- openair3/NAS/UE/ESM/esm_ebr_context.c | 12 +++++++----- openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 | 6 ++---- openair3/S1AP/s1ap_eNB_handlers.c | 1 + openair3/SECU/nas_stream_eea1.c | 4 ++-- openair3/SECU/nas_stream_eia2.c | 1 + openair3/UDP/udp_eNB_task.c | 8 ++++---- targets/RT/USER/lte-softmodem.c | 11 ++++++----- targets/RT/USER/lte-ue.c | 2 +- 40 files changed, 96 insertions(+), 88 deletions(-) diff --git a/cmake_targets/tools/fix_asn1 b/cmake_targets/tools/fix_asn1 index dcc00d5e37..5f182c8f7e 100755 --- a/cmake_targets/tools/fix_asn1 +++ b/cmake_targets/tools/fix_asn1 @@ -10,12 +10,12 @@ RRC_Rel10=( X2AP_Rel11_2=( "X2ap-CriticalityDiagnostics-IE-List.h" ae96308b37fcbcbf39da5012e42968135fc5f27b "fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff" "NativeInteger.c" 9f173e87daa1e7378618dbb060a10aae752d74be "fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff" - "constr_SET_OF.c" 5c8765a1e0fc44a48e406d0aa7628004bf3aac2a "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff" + "constr_SET_OF.c" 5352abd70c1784a0a2ef3c2e287b30ea3cdcf760 "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff" ) S1AP_Rel10_5=( "NativeInteger.c" 9f173e87daa1e7378618dbb060a10aae752d74be "fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff" - "constr_SET_OF.c" 5c8765a1e0fc44a48e406d0aa7628004bf3aac2a "fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff" + "constr_SET_OF.c" 5352abd70c1784a0a2ef3c2e287b30ea3cdcf760 "fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff" ) red_color="$(tput setaf 1)" diff --git a/common/utils/collection/hashtable/hashtable.c b/common/utils/collection/hashtable/hashtable.c index d424e2a0ad..4ce0ee7a7e 100755 --- a/common/utils/collection/hashtable/hashtable.c +++ b/common/utils/collection/hashtable/hashtable.c @@ -177,7 +177,6 @@ hashtable_rc_t hashtable_dump_content (const hash_table_t * const hashtblP, char { hash_node_t *node = NULL; unsigned int i = 0; - unsigned int num_elements = 0; if (hashtblP == NULL) { *remaining_bytes_in_buffer_pP = snprintf( buffer_pP, diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index c819704bd2..8fcc33a6d2 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -128,8 +128,8 @@ void phy_config_sib2_eNB(uint8_t Mod_id, { LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms; - LTE_eNB_UE_stats *eNB_UE_stats = PHY_vars_eNB_g[Mod_id][CC_id]->eNB_UE_stats; - int32_t rx_total_gain_eNB_dB = PHY_vars_eNB_g[Mod_id][CC_id]->rx_total_gain_eNB_dB; + //LTE_eNB_UE_stats *eNB_UE_stats = PHY_vars_eNB_g[Mod_id][CC_id]->eNB_UE_stats; + //int32_t rx_total_gain_eNB_dB = PHY_vars_eNB_g[Mod_id][CC_id]->rx_total_gain_eNB_dB; int i; LOG_D(PHY,"[eNB%d] CCid %d Frame %d: Applying radioResourceConfigCommon\n",Mod_id,CC_id,PHY_vars_eNB_g[Mod_id][CC_id]->proc[8].frame_tx); @@ -683,11 +683,11 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id, int CC_id) { - PHY_VARS_eNB *phy_vars_eNB = PHY_vars_eNB_g[Mod_id][CC_id]; + //PHY_VARS_eNB *phy_vars_eNB = PHY_vars_eNB_g[Mod_id][CC_id]; uint8_t UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][0]); struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10; //struct RadioResourceConfigCommonSCell_r10 *physicalConfigCommonSCell_r10 = sCellToAddMod_r10->radioResourceConfigCommonSCell_r10; - PhysCellId_t physCellId_r10 = sCellToAddMod_r10->cellIdentification_r10->physCellId_r10; + //PhysCellId_t physCellId_r10 = sCellToAddMod_r10->cellIdentification_r10->physCellId_r10; ARFCN_ValueEUTRA_t dl_CarrierFreq_r10 = sCellToAddMod_r10->cellIdentification_r10->dl_CarrierFreq_r10; uint32_t carrier_freq_local; diff --git a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c index 14e1c18571..378832ccf7 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c @@ -50,13 +50,13 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB, PHY_MEASUREMENTS_eNB *phy_measurements = &phy_vars_eNB->PHY_measurements_eNB[eNB_id]; int32_t *rb_mask = phy_vars_eNB->rb_mask_ul; - uint32_t aarx,rx_power_correction; + uint32_t aarx /* ,rx_power_correction */; uint32_t rb; int32_t *ul_ch; int32_t n0_power_tot; int len; int offset; - int Nsymb = (frame_parms->Ncp==NORMAL)?14:12; + //int Nsymb = (frame_parms->Ncp==NORMAL)?14:12; // noise measurements // for the moment we measure the noise on the 7th OFDM symbol (in S subframe) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c index 65c4214427..3bc26ad7e8 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c @@ -572,7 +572,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue, // skip the first 4 RE due to interpolation filter length of 5 (not possible to skip 5 due to 128i alignment, must be multiple of 128bit) #if defined(__x86_64__) || defined(__i386__) - __m128i pmi128_re,pmi128_im,mmtmpPMI0,mmtmpPMI1,mmtmpPMI2,mmtmpPMI3; + __m128i pmi128_re,pmi128_im,mmtmpPMI0,mmtmpPMI1 /* ,mmtmpPMI2,mmtmpPMI3 */ ; dl_ch0_128 = (__m128i *)&phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][aarx][4]; dl_ch1_128 = (__m128i *)&phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][2+aarx][4]; diff --git a/openair1/SCHED/phy_mac_stub.c b/openair1/SCHED/phy_mac_stub.c index 9bcba1072c..6e90960bfc 100644 --- a/openair1/SCHED/phy_mac_stub.c +++ b/openair1/SCHED/phy_mac_stub.c @@ -54,11 +54,11 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e { int i; - uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag; + //uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag; uint8_t transmission_mode = phy_vars_eNB->transmission_mode[0]; uint32_t rballoc = 0x7FFF; - uint32_t rballoc2 = 0x000F; + //uint32_t rballoc2 = 0x000F; int subframe = phy_vars_eNB->proc[sched_subframe].subframe_tx; LTE_eNB_DLSCH_t *DLSCH_ptr = phy_vars_eNB->dlsch_eNB[0][0]; @@ -585,7 +585,7 @@ void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eN { int i; - uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag; + //uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag; uint8_t transmission_mode = phy_vars_eNB->transmission_mode[0]; //uint32_t rballoc = 0x00F0; diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 375c0dcd1f..4042cb511c 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1822,6 +1822,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e stop_meas(&phy_vars_eNB->phy_proc_tx); + (void)re_allocated; /* remove gcc warning "set but not used" */ } void process_Msg3(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t UE_id, uint8_t harq_pid) @@ -2493,6 +2494,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ } sect_id = 0; + (void)sect_id; /* remove gcc warning "set but not used" */ /* for (UE_id=0;UE_iddlsch_ue[eNB_id][0]->harq_ack[subframe].harq_id; + //if ((pucch_fmt == pucch_format1a) || + // (pucch_fmt == pucch_format1b)) { // Update g_pucch based on TPC/delta_PUCCH received in PDCCH for this process + //harq_pid = phy_vars_ue->dlsch_ue[eNB_id][0]->harq_ack[subframe].harq_id; //this is now done in dci_tools //phy_vars_ue->g_pucch[eNB_id] += phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->delta_PUCCH; - } + //} Po_PUCCH = get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,eNB_id)+ phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+ diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index cc63eb8671..e96ef91326 100755 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -562,9 +562,9 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) const char* pusch_alpha = NULL; libconfig_int pucch_p0_Nominal = 0; libconfig_int msg3_delta_Preamble = 0; - libconfig_int ul_CyclicPrefixLength = 0; + //libconfig_int ul_CyclicPrefixLength = 0; const char* pucch_deltaF_Format1 = NULL; - const char* pucch_deltaF_Format1a = NULL; + //const char* pucch_deltaF_Format1a = NULL; const char* pucch_deltaF_Format1b = NULL; const char* pucch_deltaF_Format2 = NULL; const char* pucch_deltaF_Format2a = NULL; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 2a52d8779a..f7d109aa31 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -1488,23 +1488,23 @@ fill_DLSCH_dci( // loop over all allocated UEs and compute frequency allocations for PDSCH int UE_id = -1; - uint8_t first_rb,nb_rb=3; + uint8_t /* first_rb, */ nb_rb=3; rnti_t rnti; - unsigned char *vrb_map; + //unsigned char *vrb_map; uint8_t rballoc_sub[25]; //uint8_t number_of_subbands=13; - unsigned char round; + //unsigned char round; unsigned char harq_pid; void *DLSCH_dci=NULL; DCI_PDU *DCI_pdu; int i; - void *BCCH_alloc_pdu; + //void *BCCH_alloc_pdu; int size_bits,size_bytes; int CC_id; eNB_MAC_INST *eNB =&eNB_mac_inst[module_idP]; UE_list_t *UE_list = &eNB->UE_list; - RA_TEMPLATE *RA_template; + //RA_TEMPLATE *RA_template; start_meas(&eNB->fill_DLSCH_dci); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_FILL_DLSCH_DCI,VCD_FUNCTION_IN); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 9cabd6b622..79529c3284 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1082,7 +1082,7 @@ boolean_t CCE_allocation_infeasible(int module_idP, DCI_PDU *DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_idP].DCI_pdu; - DCI_ALLOC_t *dci_alloc; + //DCI_ALLOC_t *dci_alloc; int ret; boolean_t res=FALSE; diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 410d454419..39c4aedb4d 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -751,7 +751,7 @@ void dlsch_scheduler_pre_processor_reset (int module_idP, uint8_t *vrb_map = &eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map; int RBGsize = PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL/N_RBG; #ifdef SF05_LIMIT - int subframe05_limit=0; + //int subframe05_limit=0; int sf05_upper=-1,sf05_lower=-1; #endif LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti); @@ -1085,7 +1085,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, void store_ulsch_buffer(module_id_t module_idP, int frameP, sub_frame_t subframeP) { - int UE_id,pCC_id,lcgid; + int UE_id, /* pCC_id, */ lcgid; UE_list_t *UE_list = &eNB_mac_inst[module_idP].UE_list; UE_TEMPLATE *UE_template; @@ -1231,7 +1231,7 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP) int UE_id1,UE_id2; int pCCid1,pCCid2; int round1,round2; - int i=0,ii=0,j=0; + int i=0,ii=0; rnti_t rnti1,rnti2; UE_list_t *UE_list = &eNB_mac_inst[module_idP].UE_list; diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index f25e921570..a2dbf9d9b8 100755 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -1032,6 +1032,8 @@ pdcp_remove_UE( } + (void)h_rc; /* remove gcc warning "set but not used" */ + return 1; } diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c index ec303172b0..b92340348a 100755 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c @@ -599,6 +599,7 @@ rlc_am_mac_status_indication ( rlc_sn_t sn_end = (rlc->vt_a - 1) & RLC_AM_SN_MASK; int found_pdu = 0; rlc_sn_t found_pdu_sn = 0; // avoid warning + (void)found_pdu_sn; /* avoid gcc warning "set but not used" */ while (sn != sn_end) { @@ -917,6 +918,8 @@ rlc_am_mac_data_indication ( int octet_index, index; #endif + (void)l_rlc_p; /* avoid gcc warning "unused variable" */ + #if TRACE_RLC_AM_PDU || MESSAGE_CHART_GENERATOR if (data_indP.data.nb_elements > 0) { diff --git a/openair2/LAYER2/RLC/rlc_rrc.c b/openair2/LAYER2/RLC/rlc_rrc.c index 05ad79d7d4..50f4e4b9bd 100644 --- a/openair2/LAYER2/RLC/rlc_rrc.c +++ b/openair2/LAYER2/RLC/rlc_rrc.c @@ -634,7 +634,7 @@ rlc_op_status_t rrc_rlc_config_req ( const rlc_info_t rlc_infoP) { //----------------------------------------------------------------------------- - rlc_op_status_t status; + //rlc_op_status_t status; LOG_D(RLC, PROTOCOL_CTXT_FMT" CONFIG_REQ for RAB %u\n", PROTOCOL_CTXT_ARGS(ctxt_pP), diff --git a/openair2/LAYER2/openair2_proc.c b/openair2/LAYER2/openair2_proc.c index 35684d239a..284f91a7f8 100644 --- a/openair2/LAYER2/openair2_proc.c +++ b/openair2/LAYER2/openair2_proc.c @@ -74,7 +74,7 @@ int dump_eNB_l2_stats(char *buffer, int length) int eNB_id,UE_id,number_of_cards; int len= length; int CC_id=0; - int i,j; + int i; protocol_ctxt_t ctxt; rlc_op_status_t rlc_status; unsigned int stat_rlc_mode; diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c index a919a055f2..ee35f317cd 100644 --- a/openair2/RRC/LITE/rrc_UE.c +++ b/openair2/RRC/LITE/rrc_UE.c @@ -261,6 +261,7 @@ static void init_SI_UE( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_ #ifdef Rel10 //----------------------------------------------------------------------------- +#if 0 static void init_MCCH_UE(module_id_t ue_mod_idP, uint8_t eNB_index) { int i; @@ -274,6 +275,7 @@ static void init_MCCH_UE(module_id_t ue_mod_idP, uint8_t eNB_index) } } #endif +#endif //----------------------------------------------------------------------------- static void openair_rrc_lite_ue_init_security( const protocol_ctxt_t* const ctxt_pP ) diff --git a/openair2/RRC/LITE/rrc_common.c b/openair2/RRC/LITE/rrc_common.c index e2d8a6c69b..2a37ccde00 100644 --- a/openair2/RRC/LITE/rrc_common.c +++ b/openair2/RRC/LITE/rrc_common.c @@ -411,7 +411,7 @@ rrc_rx_tx( ) //----------------------------------------------------------------------------- { - uint8_t UE_id; + //uint8_t UE_id; int32_t current_timestamp_ms, ref_timestamp_ms; struct timeval ts; #ifdef LOCALIZATION @@ -547,6 +547,9 @@ rrc_rx_tx( } #endif + (void)ts; /* remove gcc warning "unused variable" */ + (void)ref_timestamp_ms; /* remove gcc warning "unused variable" */ + (void)current_timestamp_ms; /* remove gcc warning "unused variable" */ } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT); diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index 1d0b5f2902..deab2d04a3 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -1131,8 +1131,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration( int i; // configure SRB1/SRB2, PhysicalConfigDedicated, MAC_MainConfig for UE - eNB_RRC_INST* rrc_inst = &eNB_rrc_inst[ctxt_pP->module_id]; - struct PhysicalConfigDedicated** physicalConfigDedicated = &ue_context_pP->ue_context.physicalConfigDedicated; + //eNB_RRC_INST* rrc_inst = &eNB_rrc_inst[ctxt_pP->module_id]; + //struct PhysicalConfigDedicated** physicalConfigDedicated = &ue_context_pP->ue_context.physicalConfigDedicated; struct SRB_ToAddMod *SRB2_config = NULL; struct SRB_ToAddMod__rlc_Config *SRB2_rlc_config = NULL; @@ -1145,7 +1145,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration( struct DRB_ToAddMod *DRB_config = NULL; struct RLC_Config *DRB_rlc_config = NULL; struct PDCP_Config *DRB_pdcp_config = NULL; - struct PDCP_Config__rlc_AM *PDCP_rlc_AM = NULL; + //struct PDCP_Config__rlc_AM *PDCP_rlc_AM = NULL; struct PDCP_Config__rlc_UM *PDCP_rlc_UM = NULL; struct LogicalChannelConfig *DRB_lchan_config = NULL; struct LogicalChannelConfig__ul_SpecificParameters @@ -1163,7 +1163,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration( #if Rel10 long *sr_ProhibitTimer_r9 = NULL; // uint8_t sCellIndexToAdd = rrc_find_free_SCell_index(enb_mod_idP, ue_mod_idP, 1); - uint8_t sCellIndexToAdd = 0; + //uint8_t sCellIndexToAdd = 0; #endif long *logicalchannelgroup, *logicalchannelgroup_drb; @@ -2097,8 +2097,8 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover( QuantityConfig_t *quantityConfig; MobilityControlInfo_t *mobilityInfo; // HandoverCommand_t handoverCommand; - uint8_t sourceModId = - get_adjacent_cell_mod_id(ue_context_pP->ue_context.handover_info->as_context.reestablishmentInfo->sourcePhysCellId); + //uint8_t sourceModId = + // get_adjacent_cell_mod_id(ue_context_pP->ue_context.handover_info->as_context.reestablishmentInfo->sourcePhysCellId); #if Rel10 long *sr_ProhibitTimer_r9; #endif @@ -3010,7 +3010,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( uint8_t *kUPenc = NULL; DRB_ToAddModList_t* DRB_configList = ue_context_pP->ue_context.DRB_configList; - SRB_ToAddModList_t* SRB_configList = ue_context_pP->ue_context.SRB_configList; + //SRB_ToAddModList_t* SRB_configList = ue_context_pP->ue_context.SRB_configList; #if defined(ENABLE_SECURITY) diff --git a/openair2/RRC/LITE/rrc_eNB_GTPV1U.c b/openair2/RRC/LITE/rrc_eNB_GTPV1U.c index b85933ad47..29ff0d9dc2 100755 --- a/openair2/RRC/LITE/rrc_eNB_GTPV1U.c +++ b/openair2/RRC/LITE/rrc_eNB_GTPV1U.c @@ -86,6 +86,7 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP( create_tunnel_resp_pP->num_tunnels, ue_context_p->ue_context.enb_gtp_ebi[0], ue_context_p->ue_context.enb_gtp_teid[0]); + (void)rnti; /* avoid gcc warning "set but not used" */ return 0; } else { return -1; diff --git a/openair2/RRC/LITE/rrc_eNB_S1AP.c b/openair2/RRC/LITE/rrc_eNB_S1AP.c index 375fc3e0cf..b8b5aba4ae 100644 --- a/openair2/RRC/LITE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LITE/rrc_eNB_S1AP.c @@ -672,7 +672,7 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ( if (rrcConnectionSetupComplete->registeredMME != NULL) { /* Fill GUMMEI */ struct RegisteredMME *r_mme = rrcConnectionSetupComplete->registeredMME; - int selected_plmn_identity = rrcConnectionSetupComplete->selectedPLMN_Identity; + //int selected_plmn_identity = rrcConnectionSetupComplete->selectedPLMN_Identity; S1AP_NAS_FIRST_REQ (message_p).ue_identity.presenceMask |= UE_IDENTITIES_gummei; @@ -859,7 +859,7 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char { uint16_t ue_initial_id; uint32_t eNB_ue_s1ap_id; - MessageDef *message_gtpv1u_p = NULL; + //MessageDef *message_gtpv1u_p = NULL; gtpv1u_enb_create_tunnel_req_t create_tunnel_req; gtpv1u_enb_create_tunnel_resp_t create_tunnel_resp; @@ -1170,7 +1170,7 @@ int rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND (MessageDef *msg_p, const ch */ { int e_rab; - int mod_id = 0; + //int mod_id = 0; MessageDef *msg_delete_tunnels_p = NULL; MSC_LOG_TX_MESSAGE( diff --git a/openair2/UTIL/OMG/common.c b/openair2/UTIL/OMG/common.c index dd12cb302a..d02ccf63ce 100644 --- a/openair2/UTIL/OMG/common.c +++ b/openair2/UTIL/OMG/common.c @@ -158,6 +158,7 @@ remove_node_entry (node_struct * node, node_list * node_vector) if (list->next->node->id == node->id) { toremove = tmp; // TODO delete the entry + (void)toremove; /* avoid gcc warning "set but not used" */ tmp = list->next->next; if (tmp != NULL) { @@ -259,13 +260,11 @@ node_list * remove_node (node_list * list, int nid, int node_type) { - int found; node_list *current = NULL, *previous = NULL; //int cond=0; //int i=0; if (list == NULL) { - found = 1; //false return NULL; } else { //start search @@ -280,12 +279,10 @@ remove_node (node_list * list, int nid, int node_type) //holds: current = NULL or type != node_type or.., but not both if (current == NULL) { - found = 1; LOG_E (OMG, " Element to remove is not found\n "); return NULL; } //value not found else { - found = 0; // true value found if (current == list) { list = current->next; @@ -322,7 +319,6 @@ node_struct * find_node (node_list * list, int nid, int node_type) { - int found; node_list *current; if (list == NULL) { @@ -340,7 +336,6 @@ find_node (node_list * list, int nid, int node_type) //holds: current = NULL or type != node_type or.., but not both if (current == NULL) { - found = 1; LOG_D (OMG, " Element to find in Node_Vector with ID: %d could not be found\n ", nid); @@ -380,7 +375,7 @@ node_list * reset_node_list (node_list * list) { node_list *tmp; - node_list *last = list; + //node_list *last = list; if (list == NULL) { //printf("Node_list is NULL\n"); diff --git a/openair2/UTIL/OMG/omg.c b/openair2/UTIL/OMG/omg.c index 11bdc62071..12b9395f75 100644 --- a/openair2/UTIL/OMG/omg.c +++ b/openair2/UTIL/OMG/omg.c @@ -301,7 +301,7 @@ set_new_mob_type (int id, int node_t, int mob_t, double cur_time) int prev_mob; node_list *tmp; - job_list *tmp2, *prev_job; + //job_list *tmp2, *prev_job; pair_struct *pair; double pause_p; diff --git a/openair2/UTIL/OMG/steadystaterwp.c b/openair2/UTIL/OMG/steadystaterwp.c index c466f3cd23..ba2e0d88f7 100644 --- a/openair2/UTIL/OMG/steadystaterwp.c +++ b/openair2/UTIL/OMG/steadystaterwp.c @@ -173,7 +173,7 @@ place_steadystaterwp_node (node_struct * node) void sleep_steadystaterwp_node (pair_struct * pair, double cur_time) { - static int initial = 1; + //static int initial = 1; node_struct *node; node = pair->b; node->mobile = 0; @@ -209,10 +209,10 @@ sleep_steadystaterwp_node (pair_struct * pair, double cur_time) void move_steadystaterwp_node (pair_struct * pair, double cur_time) { - static int initial = 1; + //static int initial = 1; double distance, journeytime_next, max_distance; double temp_x, temp_y, u1, u2; - int loc_num; + //int loc_num; double pr, block_xmin, block_ymin; //LOG_D (OMG, "[STEADY_RWP] move node: %d\n", node->ID); diff --git a/openair2/UTIL/OMG/trace.c b/openair2/UTIL/OMG/trace.c index 89a9377f93..144b9ae597 100644 --- a/openair2/UTIL/OMG/trace.c +++ b/openair2/UTIL/OMG/trace.c @@ -55,7 +55,7 @@ int start_trace_generator (omg_global_param omg_param_list) { double cur_time = 0.0; - int immobile = 0; + //int immobile = 0; int node_number; node_struct *node = NULL; mobility_struct *mobility = NULL; @@ -235,7 +235,7 @@ schedule_trace_node (pair_struct * pair, node_data * n_data, double cur_time) void sleep_trace_node (pair_struct * pair, node_data * n_data, double cur_time) { - double journeytime, distance; + //double journeytime, distance; node_struct *node = pair->b; node->mobile = 0; node->mob->speed = 0.0; diff --git a/openair2/UTIL/OMG/trace_hashtable.c b/openair2/UTIL/OMG/trace_hashtable.c index 2ecb392219..51f745de89 100644 --- a/openair2/UTIL/OMG/trace_hashtable.c +++ b/openair2/UTIL/OMG/trace_hashtable.c @@ -58,8 +58,6 @@ hash_table_t **table; void create_new_table (int node_type) { - int i; - if(table==NULL) table = (hash_table_t **) calloc (MAX_NUM_NODE_TYPES, sizeof (hash_table_t*)); diff --git a/openair2/UTIL/OSA/osa_stream_eea.c b/openair2/UTIL/OSA/osa_stream_eea.c index 0a044e2e01..8e346631ec 100644 --- a/openair2/UTIL/OSA/osa_stream_eea.c +++ b/openair2/UTIL/OSA/osa_stream_eea.c @@ -78,7 +78,6 @@ int stream_encrypt_eea1(stream_cipher_t *stream_cipher, uint8_t **out) int n ; int i = 0; uint32_t zero_bit = 0; - uint32_t byte_length; uint32_t *KS; uint32_t K[4],IV[4]; @@ -89,7 +88,6 @@ int stream_encrypt_eea1(stream_cipher_t *stream_cipher, uint8_t **out) n = ( stream_cipher->blength + 31 ) / 32; zero_bit = stream_cipher->blength & 0x7; - byte_length = stream_cipher->blength >> 3; memset(&snow_3g_context, 0, sizeof(snow_3g_context)); /*Initialisation*/ diff --git a/openair3/GTPV1-U/gtpv1u_eNB.c b/openair3/GTPV1-U/gtpv1u_eNB.c index ca492469b1..ff049ba1b4 100644 --- a/openair3/GTPV1-U/gtpv1u_eNB.c +++ b/openair3/GTPV1-U/gtpv1u_eNB.c @@ -673,7 +673,7 @@ gtpv1u_create_s1u_tunnel( teid_t s1u_teid = 0; gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL; gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - MessageDef *message_p = NULL; + //MessageDef *message_p = NULL; hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; int i; ebi_t eps_bearer_id = 0; @@ -996,7 +996,7 @@ void *gtpv1u_eNB_task(void *args) { int rc = 0; instance_t instance; - const char *msg_name_p; + //const char *msg_name_p; rc = gtpv1u_eNB_init(); AssertFatal(rc == 0, "gtpv1u_eNB_init Failed"); @@ -1014,7 +1014,7 @@ void *gtpv1u_eNB_task(void *args) DevAssert(received_message_p != NULL); instance = ITTI_MSG_INSTANCE(received_message_p); - msg_name_p = ITTI_MSG_NAME(received_message_p); + //msg_name_p = ITTI_MSG_NAME(received_message_p); switch (ITTI_MSG_ID(received_message_p)) { @@ -1081,6 +1081,7 @@ void *gtpv1u_eNB_task(void *args) LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", enb_s1u_teid,sgw_s1u_teid,data_req_p->length); + (void)enb_s1u_teid; /* avoid gcc warning "set but not used" */ } else { rc = nwGtpv1uProcessUlpReq(gtpv1u_data_g.gtpv1u_stack, &stack_req); diff --git a/openair3/NAS/COMMON/IES/MsNetworkFeatureSupport.c b/openair3/NAS/COMMON/IES/MsNetworkFeatureSupport.c index d8efa5312b..08fee949a0 100644 --- a/openair3/NAS/COMMON/IES/MsNetworkFeatureSupport.c +++ b/openair3/NAS/COMMON/IES/MsNetworkFeatureSupport.c @@ -54,9 +54,9 @@ int decode_ms_network_feature_support(MsNetworkFeatureSupport *msnetworkfeatures } int encode_ms_network_feature_support(MsNetworkFeatureSupport *msnetworkfeaturesupport, uint8_t iei, uint8_t *buffer, uint32_t len) { - uint8_t *lenPtr; + //uint8_t *lenPtr; uint32_t encoded = 0; - int encode_result; + //int encode_result; /* Checking IEI and pointer */ CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, MS_NETWORK_FEATURE_SUPPORT_MINIMUM_LENGTH, len); #if defined (NAS_DEBUG) diff --git a/openair3/NAS/UE/EMM/EmmStatusHdl.c b/openair3/NAS/UE/EMM/EmmStatusHdl.c index 85d423fd23..126b2a94f6 100755 --- a/openair3/NAS/UE/EMM/EmmStatusHdl.c +++ b/openair3/NAS/UE/EMM/EmmStatusHdl.c @@ -130,7 +130,7 @@ int emm_proc_status(unsigned int ueid, int emm_cause) emm_sap_t emm_sap; emm_security_context_t *sctx = NULL; - struct emm_data_context_s *ctx = NULL; + //struct emm_data_context_s *ctx = NULL; LOG_TRACE(INFO,"EMM-PROC - EMM status procedure requested"); diff --git a/openair3/NAS/UE/EMM/LowerLayer.c b/openair3/NAS/UE/EMM/LowerLayer.c index 130fe1bb5d..6e264d2a54 100755 --- a/openair3/NAS/UE/EMM/LowerLayer.c +++ b/openair3/NAS/UE/EMM/LowerLayer.c @@ -261,7 +261,7 @@ int lowerlayer_data_req(unsigned int ueid, const OctetString *data) int rc; emm_sap_t emm_sap; emm_security_context_t *sctx = NULL; - struct emm_data_context_s *ctx = NULL; + //struct emm_data_context_s *ctx = NULL; emm_sap.primitive = EMMAS_DATA_REQ; emm_sap.u.emm_as.u.data.guti = _emm_data.guti; diff --git a/openair3/NAS/UE/EMM/SAP/emm_fsm.c b/openair3/NAS/UE/EMM/SAP/emm_fsm.c index 83c5e5f1db..dc0e1efa28 100755 --- a/openair3/NAS/UE/EMM/SAP/emm_fsm.c +++ b/openair3/NAS/UE/EMM/SAP/emm_fsm.c @@ -215,7 +215,7 @@ emm_fsm_state_t _emm_fsm_status[EMM_FSM_NB_UE_MAX]; ***************************************************************************/ void emm_fsm_initialize(void) { - int ueid; + //int ueid; LOG_FUNC_IN; _emm_fsm_status[0] = EMM_NULL; diff --git a/openair3/NAS/UE/ESM/esm_ebr_context.c b/openair3/NAS/UE/ESM/esm_ebr_context.c index fcf278a2e4..f56a19b876 100755 --- a/openair3/NAS/UE/ESM/esm_ebr_context.c +++ b/openair3/NAS/UE/ESM/esm_ebr_context.c @@ -114,7 +114,7 @@ int esm_ebr_context_create( int bid = 0; esm_data_context_t *esm_ctx = NULL; esm_pdn_t *pdn = NULL; - unsigned int ueid = 0; + //unsigned int ueid = 0; LOG_FUNC_IN; @@ -212,7 +212,7 @@ int esm_ebr_context_create( { char *tmp = NULL; char ipv4_addr[INET_ADDRSTRLEN]; - char ipv6_addr[INET6_ADDRSTRLEN]; + //char ipv6_addr[INET6_ADDRSTRLEN]; char *netmask = NULL; char broadcast[INET_ADDRSTRLEN]; struct in_addr in_addr; @@ -221,7 +221,8 @@ int esm_ebr_context_create( switch (pdn->type) { case NET_PDN_TYPE_IPV4V6: - ipv6_addr[0] = pdn->ip_addr[4]; + //ipv6_addr[0] = pdn->ip_addr[4]; + /* TODO? */ // etc case NET_PDN_TYPE_IPV4: @@ -283,11 +284,12 @@ int esm_ebr_context_create( res = sprintf(command_line, "ifconfig oip1 %s netmask %s broadcast %s up", ipv4_addr, netmask, broadcast); + (void)res; /* avoid gcc warning "set but not used" */ // AssertFatal((res > 0) && (res < 128), // "error in system command line"); LOG_TRACE(INFO, "ESM-PROC - executing %s ", command_line); - system(command_line); + if (system(command_line)) ; /* TODO: what to do? */ break; case NET_PDN_TYPE_IPV6: @@ -341,7 +343,7 @@ int esm_ebr_context_release( esm_pdn_t *pdn = NULL; esm_data_context_t *esm_ctx; - unsigned int ueid = 0; + //unsigned int ueid = 0; LOG_FUNC_IN; diff --git a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 b/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 index 3986a6a83b..b3517fd2d4 100644 --- a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 +++ b/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 @@ -392,14 +392,13 @@ } --- skeletons/constr_SEQUENCE.c 2015-12-08 14:39:33.346543533 +0100 +++ skeletons/constr_SEQUENCE.c 2015-12-08 10:39:52.442558000 +0100 -@@ -1761,3 +1761,66 @@ +@@ -1761,3 +1761,65 @@ _ASN_ENCODED_OK(er); } + +asn_comp_rval_t * SEQUENCE_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) { + int edx; -+ int ret; + asn_comp_rval_t *res = NULL; + asn_comp_rval_t *res2 = NULL; + @@ -563,7 +562,7 @@ * Some handy helpers. * --- skeletons/constr_SET_OF.c 2015-12-08 14:39:33.338543533 +0100 +++ skeletons/constr_SET_OF.c 2015-12-08 10:45:54.466557000 +0100 -@@ -1039,3 +1039,55 @@ +@@ -1039,3 +1039,54 @@ rv.consumed = 0; return rv; } @@ -575,7 +574,6 @@ + asn_TYPE_member_t *elm2 = td2->elements; + const asn_anonymous_set_ *list1 = _A_CSET_FROM_VOID(sptr1); + const asn_anonymous_set_ *list2 = _A_CSET_FROM_VOID(sptr2); -+ int ret; + int i; + asn_comp_rval_t *res = NULL; + asn_comp_rval_t *res2 = NULL; diff --git a/openair3/S1AP/s1ap_eNB_handlers.c b/openair3/S1AP/s1ap_eNB_handlers.c index 6f0d4128c7..3e6b2ebe7c 100644 --- a/openair3/S1AP/s1ap_eNB_handlers.c +++ b/openair3/S1AP/s1ap_eNB_handlers.c @@ -864,6 +864,7 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id, case S1ap_UE_S1AP_IDs_PR_mME_UE_S1AP_ID: mme_ue_s1ap_id = ueContextReleaseCommand_p->uE_S1AP_IDs.choice.mME_UE_S1AP_ID; S1AP_ERROR("TO DO mapping mme_ue_s1ap_id enb_ue_s1ap_id"); + (void)mme_ue_s1ap_id; /* TODO: remove - it's to remove gcc warning about unused var */ case S1ap_UE_S1AP_IDs_PR_NOTHING: default: diff --git a/openair3/SECU/nas_stream_eea1.c b/openair3/SECU/nas_stream_eea1.c index 4b69ae8231..142df9e0dc 100755 --- a/openair3/SECU/nas_stream_eea1.c +++ b/openair3/SECU/nas_stream_eea1.c @@ -49,7 +49,7 @@ int nas_stream_encrypt_eea1(nas_stream_cipher_t *stream_cipher, uint8_t *out) int n ; int i = 0; uint32_t zero_bit = 0; - uint32_t byte_length; + //uint32_t byte_length; uint32_t *KS; uint32_t K[4],IV[4]; @@ -60,7 +60,7 @@ int nas_stream_encrypt_eea1(nas_stream_cipher_t *stream_cipher, uint8_t *out) n = ( stream_cipher->blength + 31 ) / 32; zero_bit = stream_cipher->blength & 0x7; - byte_length = stream_cipher->blength >> 3; + //byte_length = stream_cipher->blength >> 3; memset(&snow_3g_context, 0, sizeof(snow_3g_context)); /*Initialisation*/ diff --git a/openair3/SECU/nas_stream_eia2.c b/openair3/SECU/nas_stream_eia2.c index f1f64dd90a..4841dfc90b 100644 --- a/openair3/SECU/nas_stream_eia2.c +++ b/openair3/SECU/nas_stream_eia2.c @@ -112,6 +112,7 @@ int nas_stream_encrypt_eia2(nas_stream_cipher_t *stream_cipher, uint8_t out[4]) cmac_ctx = CMAC_CTX_new(); ret = CMAC_Init(cmac_ctx, stream_cipher->key, stream_cipher->key_length, cipher, NULL); ret = CMAC_Update(cmac_ctx, m, m_length + 8); + (void)ret; /* avoid gcc warning "set but not used" */ CMAC_Final(cmac_ctx, data, &size); CMAC_CTX_free(cmac_ctx); diff --git a/openair3/UDP/udp_eNB_task.c b/openair3/UDP/udp_eNB_task.c index 3e53f9f62f..d2a73d9b95 100644 --- a/openair3/UDP/udp_eNB_task.c +++ b/openair3/UDP/udp_eNB_task.c @@ -300,8 +300,8 @@ void *udp_eNB_task(void *args_p) int nb_events; struct epoll_event *events; MessageDef *received_message_p = NULL; - const char *msg_name = NULL; - instance_t instance = 0; + //const char *msg_name = NULL; + //instance_t instance = 0; udp_enb_init(NULL); itti_mark_task_ready(TASK_UDP); @@ -316,8 +316,8 @@ void *udp_eNB_task(void *args_p) if (received_message_p != NULL) { - msg_name = ITTI_MSG_NAME (received_message_p); - instance = ITTI_MSG_INSTANCE (received_message_p); + //msg_name = ITTI_MSG_NAME (received_message_p); + //instance = ITTI_MSG_INSTANCE (received_message_p); switch (ITTI_MSG_ID(received_message_p)) { case UDP_INIT: { diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 7df20f05c8..c111e76879 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -1276,7 +1276,7 @@ static void* eNB_thread_rx( void* param ) FILE *rx_time_file; char rx_time_name[101]; - int i; + //int i; if (opp_enabled == 1){ snprintf(rx_time_name, 100,"/tmp/%s_rx_time_thread_sf_%d", "eNB", proc->subframe); @@ -3225,10 +3225,11 @@ int main( int argc, char **argv ) if (input_fd) { printf("Reading in from file to antenna buffer %d\n",0); - fread(UE[0]->lte_ue_common_vars.rxdata[0], - sizeof(int32_t), - frame_parms[0]->samples_per_tti*10, - input_fd); + if (fread(UE[0]->lte_ue_common_vars.rxdata[0], + sizeof(int32_t), + frame_parms[0]->samples_per_tti*10, + input_fd) != frame_parms[0]->samples_per_tti*10) + printf("error reading from file\n"); } //p_exmimo_config->framing.tdd_config = TXRXSWITCH_TESTRX; } else { diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index e72b4ec80a..4acb7e7a5f 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -607,7 +607,7 @@ static void *UE_thread_synch(void *arg) static void *UE_thread_tx(void *arg) { static int UE_thread_tx_retval; - int ret; + //int ret; PHY_VARS_UE *UE = (PHY_VARS_UE*)arg; From 77363df00bd7874f3182b6df417bea58e0523db0 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Sat, 26 Mar 2016 22:52:19 +0100 Subject: [PATCH 096/214] remove #warning lines (comment them out) --- openair1/PHY/INIT/lte_init.c | 2 +- openair1/SCHED/pusch_pc.c | 2 +- openair2/LAYER2/MAC/config.c | 2 +- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 2 +- openair2/LAYER2/MAC/eNB_scheduler_mch.c | 2 +- openair2/LAYER2/PDCP_v10.1.0/pdcp.c | 2 +- openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c | 4 ++-- openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c | 2 +- openair2/LAYER2/RLC/rlc_rrc.c | 2 +- openair2/RRC/LITE/rrc_eNB.c | 10 +++++----- openair2/RRC/LITE/rrc_eNB_S1AP.c | 2 +- openair2/UTIL/OTG/otg_rx.c | 2 +- openair3/GTPV1-U/gtpv1u.h | 2 +- openair3/GTPV1-U/gtpv1u_eNB.c | 4 ++-- openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c | 2 +- openair3/NAS/COMMON/API/NETWORK/nas_message.c | 2 +- openair3/NAS/COMMON/EMM/MSG/AttachAccept.c | 4 ++-- openair3/NAS/COMMON/IES/UeNetworkCapability.c | 4 ++-- openair3/NAS/UE/API/USIM/usim_api.c | 2 +- openair3/S1AP/s1ap_eNB_handlers.c | 2 +- openair3/S1AP/s1ap_eNB_nas_procedures.c | 4 ++-- openair3/SCTP/sctp_eNB_task.c | 2 +- 22 files changed, 31 insertions(+), 31 deletions(-) diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 8fcc33a6d2..1f98a0eecc 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -733,7 +733,7 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id, } if (physicalConfigDedicatedSCell_r10) { -#warning " phy_vars_eNB->physicalConfigDedicatedSCell_r10 does not exist in phy_vars_eNB" +//#warning " phy_vars_eNB->physicalConfigDedicatedSCell_r10 does not exist in phy_vars_eNB" // phy_vars_eNB->physicalConfigDedicatedSCell_r10[UE_id] = physicalConfigDedicatedSCell_r10; LOG_I(PHY,"[eNB %d] Frame %d: Configured phyConfigDedicatedSCell with CC_id %d for UE %d\n",Mod_id,/*phy_vars_eNB->frame*/0,CC_id,UE_id); } else { diff --git a/openair1/SCHED/pusch_pc.c b/openair1/SCHED/pusch_pc.c index 2af8771afe..5fb1f7449c 100644 --- a/openair1/SCHED/pusch_pc.c +++ b/openair1/SCHED/pusch_pc.c @@ -81,7 +81,7 @@ int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id, //(phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->control_only == 1) ? phy_vars_eNB->ulsch_eNB[UE_id]->beta_offset_cqi_times8:8; DevAssert( UE_id < NUMBER_OF_UE_MAX ); -#warning "This condition happens sometimes. Need more investigation" // navid +//#warning "This condition happens sometimes. Need more investigation" // navid //DevAssert( MPR_x100/6 < 100 ); if (phy_vars_eNB->ul_power_control_dedicated[UE_id].deltaMCS_Enabled == 1) { diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index e3f6d8e78c..608a67c18a 100644 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -275,7 +275,7 @@ rrc_mac_config_req( if (eNB_flagP==1) { mac_xface->phy_config_dedicated_scell_eNB(Mod_id,UE_RNTI(Mod_id,UE_id),sCellToAddMod_r10,1); } else { -#warning "phy_config_dedicated_scell_ue is empty" +//#warning "phy_config_dedicated_scell_ue is empty" mac_xface->phy_config_dedicated_scell_ue(Mod_id,eNB_index,sCellToAddMod_r10,1); UE_mac_inst[Mod_id].physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10; // using SCell index 0 } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index f7d109aa31..4d8e32b63c 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -1125,7 +1125,7 @@ schedule_ue_spec( if (frame_parms[CC_id]->frame_type == TDD) { UE_list->UE_template[CC_id][UE_id].DAI++; // printf("DAI update: subframeP %d: UE %d, DAI %d\n",subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].DAI); -#warning only for 5MHz channel +//#warning only for 5MHz channel update_ul_dci(module_idP,CC_id,rnti,UE_list->UE_template[CC_id][UE_id].DAI); } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_mch.c b/openair2/LAYER2/MAC/eNB_scheduler_mch.c index e894f3a662..a6926e15ad 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_mch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_mch.c @@ -666,7 +666,7 @@ MCH_PDU *get_mch_sdu(module_id_t module_idP, int CC_id, frame_t frameP, sub_fram { // eNB_mac_inst[module_idP].MCH_pdu.mcs=0; //LOG_D(MAC," MCH_pdu.mcs is %d\n", eNB_mac_inst[module_idP].MCH_pdu.mcs); -#warning "MCH pdu should take the CC_id index" +//#warning "MCH pdu should take the CC_id index" return(&eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu); } diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index a2dbf9d9b8..638c8051b0 100755 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -1488,7 +1488,7 @@ pdcp_config_req_asn1 ( case CONFIG_ACTION_REMOVE: DevAssert(pdcp_pP != NULL); -#warning "TODO pdcp_module_id_to_rnti" +//#warning "TODO pdcp_module_id_to_rnti" //pdcp_module_id_to_rnti[ctxt_pP.module_id ][dst_id] = NOT_A_RNTI; LOG_D(PDCP, PROTOCOL_PDCP_CTXT_FMT" CONFIG_ACTION_REMOVE LCID %d RBID %d configured\n", PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP), diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c index eb2d0c5aca..81645f06fe 100755 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c @@ -57,7 +57,7 @@ rlc_am_init( pthread_mutex_init(&rlc_pP->lock_input_sdus, NULL); rlc_pP->input_sdus = calloc(1, RLC_AM_SDU_CONTROL_BUFFER_SIZE*sizeof(rlc_am_tx_sdu_management_t)); -#warning "cast the rlc retrans buffer to uint32" +//#warning "cast the rlc retrans buffer to uint32" // rlc_pP->pdu_retrans_buffer = calloc(1, (uint16_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(rlc_am_tx_data_pdu_management_t))); rlc_pP->pdu_retrans_buffer = calloc(1, (uint32_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof( rlc_am_tx_data_pdu_management_t))); @@ -114,7 +114,7 @@ rlc_am_reestablish( LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[AM REESTABLISH] RE-INIT STATE VARIABLES, BUFFERS, LISTS\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP)); -#warning TODO when possible reassemble RLC SDUs from any byte segments of AMD PDUs with SN inf VR(MR) +//#warning TODO when possible reassemble RLC SDUs from any byte segments of AMD PDUs with SN inf VR(MR) list2_free(&rlc_pP->receiver_buffer); list_free(&rlc_pP->pdus_to_mac_layer); diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c index e2dda28f95..18ff9a8ad4 100755 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c @@ -516,7 +516,7 @@ void rlc_am_segment_10 ( pdu_tb_req_p->data_ptr = (unsigned char*)pdu_p; pdu_tb_req_p->tb_size = data_pdu_size - pdu_remaining_size; -#warning "why 3000: changed to RLC_SDU_MAX_SIZE " +//#warning "why 3000: changed to RLC_SDU_MAX_SIZE " assert(pdu_tb_req_p->tb_size < RLC_SDU_MAX_SIZE ); rlc_am_pdu_polling(ctxt_pP, rlc_pP, pdu_p, pdu_mngt_p->payload_size); diff --git a/openair2/LAYER2/RLC/rlc_rrc.c b/openair2/LAYER2/RLC/rlc_rrc.c index 50f4e4b9bd..f78cf90631 100644 --- a/openair2/LAYER2/RLC/rlc_rrc.c +++ b/openair2/LAYER2/RLC/rlc_rrc.c @@ -196,7 +196,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP break; case SRB_ToAddMod__rlc_Config_PR_defaultValue: -#warning TO DO SRB_ToAddMod__rlc_Config_PR_defaultValue +//#warning TO DO SRB_ToAddMod__rlc_Config_PR_defaultValue if (rrc_rlc_add_rlc (ctxt_pP, SRB_FLAG_YES, MBMS_FLAG_NO, rb_id, lc_id, RLC_MODE_UM) != NULL) { config_req_rlc_um_asn1( ctxt_pP, diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index deab2d04a3..5d7c99a586 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -2945,7 +2945,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover( handoverCommand.criticalExtensions.choice.c1.choice.handoverCommand_r8.handoverCommandMessage.buf = buffer; handoverCommand.criticalExtensions.choice.c1.choice.handoverCommand_r8.handoverCommandMessage.size = size; */ -#warning "COMPILATION PROBLEM" +//#warning "COMPILATION PROBLEM" #ifdef PROBLEM_COMPILATION_RESOLVED if (sourceModId != 0xFF) { @@ -3700,7 +3700,7 @@ rrc_eNB_decode_ccch( * the current one must be removed from MAC/PHY (zombie UE) */ if ((ue_context_p = rrc_eNB_ue_context_random_exist(ctxt_pP, random_value))) { -#warning "TODO: random_exist: remove UE from MAC/PHY (how?)" +//#warning "TODO: random_exist: remove UE from MAC/PHY (how?)" // AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)"); ue_context_p = NULL; } else { @@ -3713,7 +3713,7 @@ rrc_eNB_decode_ccch( m_tmsi_t m_tmsi = BIT_STRING_to_uint32(&s_TMSI.m_TMSI); random_value = (((uint64_t)mme_code) << 32) | m_tmsi; if ((ue_context_p = rrc_eNB_ue_context_stmsi_exist(ctxt_pP, mme_code, m_tmsi))) { -#warning "TODO: stmsi_exist: remove UE from MAC/PHY (how?)" +//#warning "TODO: stmsi_exist: remove UE from MAC/PHY (how?)" // AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)"); ue_context_p = NULL; } else { @@ -4175,7 +4175,7 @@ rrc_eNB_decode_dcch( // cancel the security mode in PDCP // followup with the remaining procedure -#warning "LG Removed rrc_eNB_generate_UECapabilityEnquiry after receiving securityModeFailure" +//#warning "LG Removed rrc_eNB_generate_UECapabilityEnquiry after receiving securityModeFailure" rrc_eNB_generate_UECapabilityEnquiry(ctxt_pP, ue_context_p); break; @@ -4443,7 +4443,7 @@ rrc_enb_task( //SPECTRA: Add the RRC connection reconfiguration with Second cell configuration case RRC_RAL_CONNECTION_RECONFIGURATION_REQ: // ue_mod_id = 0; /* TODO force ue_mod_id to first UE, NAS UE not virtualized yet */ -#warning "TODO GET RIGHT RNTI" +//#warning "TODO GET RIGHT RNTI" PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_YES, diff --git a/openair2/RRC/LITE/rrc_eNB_S1AP.c b/openair2/RRC/LITE/rrc_eNB_S1AP.c index b8b5aba4ae..679e629f16 100644 --- a/openair2/RRC/LITE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LITE/rrc_eNB_S1AP.c @@ -233,7 +233,7 @@ rrc_eNB_get_ue_context_from_s1ap_ids( static e_SecurityAlgorithmConfig__cipheringAlgorithm rrc_eNB_select_ciphering(uint16_t algorithms) { -#warning "Forced return SecurityAlgorithmConfig__cipheringAlgorithm_eea0, to be deleted in future" +//#warning "Forced return SecurityAlgorithmConfig__cipheringAlgorithm_eea0, to be deleted in future" return SecurityAlgorithmConfig__cipheringAlgorithm_eea0; if (algorithms & S1AP_ENCRYPTION_EEA2_MASK) { diff --git a/openair2/UTIL/OTG/otg_rx.c b/openair2/UTIL/OTG/otg_rx.c index 8331dd8477..3f0d35d223 100644 --- a/openair2/UTIL/OTG/otg_rx.c +++ b/openair2/UTIL/OTG/otg_rx.c @@ -113,7 +113,7 @@ int otg_rx_pkt(const int dst_instanceP, const int ctime, const char * const buff dst_instance = otg_hdr_rx->dst_instance; if (dst_instance != dst_instanceP) { -#warning "LG: TODO think about multicast traffic" +//#warning "LG: TODO think about multicast traffic" LOG_W(OTG,"[SRC %d][DST %d] [FLOW_idx %d][APP TYPE %d] RX INFO pkt at time %d: flag 0x %x, seq number %d, tx time %d, size (hdr %d, pdcp %d) not for dest instance %u\n", dst_instanceP); } diff --git a/openair3/GTPV1-U/gtpv1u.h b/openair3/GTPV1-U/gtpv1u.h index 264fedfe77..e2af712f7b 100644 --- a/openair3/GTPV1-U/gtpv1u.h +++ b/openair3/GTPV1-U/gtpv1u.h @@ -54,7 +54,7 @@ # define GTPU_ERROR(x, args...) fprintf(stderr, "[GTPU][E]"x, ##args) #endif -#warning "TO BE REFINED" +//#warning "TO BE REFINED" # define GTPU_HEADER_OVERHEAD_MAX 64 uint32_t gtpv1u_new_teid(void); diff --git a/openair3/GTPV1-U/gtpv1u_eNB.c b/openair3/GTPV1-U/gtpv1u_eNB.c index ff049ba1b4..9f2475ef37 100644 --- a/openair3/GTPV1-U/gtpv1u_eNB.c +++ b/openair3/GTPV1-U/gtpv1u_eNB.c @@ -333,7 +333,7 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req( gtpv1u_teid_data_p->eps_bearer_id); #endif -#warning "LG eps bearer mapping to DRB id to do (offset -4)" +//#warning "LG eps bearer mapping to DRB id to do (offset -4)" PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gtpv1u_teid_data_p->enb_id, ENB_FLAG_YES, gtpv1u_teid_data_p->ue_id, 0, 0,gtpv1u_teid_data_p->enb_id); MSC_LOG_TX_MESSAGE( @@ -611,7 +611,7 @@ gtpv1u_new_data_req( if (bearer_p->state != BEARER_UP) { LOG_W(GTPU, "Trying to send data over bearer with state(%u) != BEARER_UP\n", bearer_p->state); -#warning LG: HACK WHILE WAITING FOR NAS, normally return -1 +//#warning LG: HACK WHILE WAITING FOR NAS, normally return -1 if (bearer_p->state != BEARER_IN_CONFIG) return -1; diff --git a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c index 5308c0c86c..f00441dfa2 100644 --- a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c +++ b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c @@ -630,7 +630,7 @@ nwGtpv1uHandleEchoReq(NW_IN NwGtpv1uStackT *thiz, bufLen = sizeof(NwGtpv1uIeTv1T)+ ((NwGtpv1uMsgT*)hMsg)->msgLen; -#warning CROUX DIRTY +16, TO BE FIXED!!! +//#warning CROUX DIRTY +16, TO BE FIXED!!! /* the +16 is there because by analyzing memory allocation with some external * tool, I saw that there were 6 bytes accessed after bufLen in nwGtpv1uCreateAndSendMsg * the value "16" has been chosen arbitrarily, just bigger than 6 diff --git a/openair3/NAS/COMMON/API/NETWORK/nas_message.c b/openair3/NAS/COMMON/API/NETWORK/nas_message.c index a7e5802765..ece3ced5a3 100644 --- a/openair3/NAS/COMMON/API/NETWORK/nas_message.c +++ b/openair3/NAS/COMMON/API/NETWORK/nas_message.c @@ -323,7 +323,7 @@ int nas_message_decrypt( #if defined(NAS_MME) LOG_FUNC_RETURN (TLV_DECODE_MAC_MISMATCH); #else -#warning "added test on integrity algorithm because of SECURITY_MODE_COMMAND not correctly handled in UE (check integrity)" +//#warning "added test on integrity algorithm because of SECURITY_MODE_COMMAND not correctly handled in UE (check integrity)" if (emm_security_context->selected_algorithms.integrity != NAS_SECURITY_ALGORITHMS_EIA0) { diff --git a/openair3/NAS/COMMON/EMM/MSG/AttachAccept.c b/openair3/NAS/COMMON/EMM/MSG/AttachAccept.c index 3d800d5c19..c7e4c36614 100644 --- a/openair3/NAS/COMMON/EMM/MSG/AttachAccept.c +++ b/openair3/NAS/COMMON/EMM/MSG/AttachAccept.c @@ -214,7 +214,7 @@ int encode_attach_accept(attach_accept_msg *attach_accept, uint8_t *buffer, uint *(buffer + encoded) = (encode_u8_eps_attach_result(&attach_accept->epsattachresult) & 0x0f); encoded++; -#warning "LG TEST override t3412value" +//#warning "LG TEST override t3412value" attach_accept->t3412value.unit = GPRS_TIMER_UNIT_360S; attach_accept->t3412value.timervalue = 10; @@ -288,7 +288,7 @@ int encode_attach_accept(attach_accept_msg *attach_accept, uint8_t *buffer, uint encoded += encode_result; } -#warning "LG TEST override t3402value" +//#warning "LG TEST override t3402value" attach_accept->presencemask |= ATTACH_ACCEPT_T3402_VALUE_PRESENT; attach_accept->t3402value.unit = GPRS_TIMER_UNIT_60S; attach_accept->t3402value.timervalue = 12; diff --git a/openair3/NAS/COMMON/IES/UeNetworkCapability.c b/openair3/NAS/COMMON/IES/UeNetworkCapability.c index 41393e7689..902bd1c79c 100644 --- a/openair3/NAS/COMMON/IES/UeNetworkCapability.c +++ b/openair3/NAS/COMMON/IES/UeNetworkCapability.c @@ -81,7 +81,7 @@ int decode_ue_network_capability(UeNetworkCapability *uenetworkcapability, uint8 LOG_TRACE(INFO, "uenetworkcapability decoded GPRS\n"); } -#warning "Force GPRS present if UMTS present" +//#warning "Force GPRS present if UMTS present" uenetworkcapability->gprs_present =1; } } @@ -131,7 +131,7 @@ int encode_ue_network_capability(UeNetworkCapability *uenetworkcapability, uint8 } if (uenetworkcapability->gprs_present) { -#warning "Force gea to 0x60" +//#warning "Force gea to 0x60" *(buffer + encoded) = 0x00 | 0x60; ////((uenetworkcapability->spare & 0x7) << 5) | // spare coded as zero //((uenetworkcapability->csfb & 0x1) << 4) | diff --git a/openair3/NAS/UE/API/USIM/usim_api.c b/openair3/NAS/UE/API/USIM/usim_api.c index 64bc05d0c3..8a7a26de0d 100644 --- a/openair3/NAS/UE/API/USIM/usim_api.c +++ b/openair3/NAS/UE/API/USIM/usim_api.c @@ -289,7 +289,7 @@ int usim_api_authenticate(const OctetString* rand_pP, const OctetString* autn_pP #define USIM_API_SQN_MS_SIZE 3 for (i = 0; i < USIM_API_SQN_MS_SIZE; i++) { -#warning "LG:BUG HERE TODO" +//#warning "LG:BUG HERE TODO" sqn_ms[USIM_API_SQNMS_SIZE - i] = ((uint8_t*)(_usim_api_data.sqn_ms))[USIM_API_SQN_MS_SIZE - i]; } diff --git a/openair3/S1AP/s1ap_eNB_handlers.c b/openair3/S1AP/s1ap_eNB_handlers.c index 3e6b2ebe7c..fb9722dbc8 100644 --- a/openair3/S1AP/s1ap_eNB_handlers.c +++ b/openair3/S1AP/s1ap_eNB_handlers.c @@ -859,7 +859,7 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id, break; -#warning "TODO mapping mme_ue_s1ap_id enb_ue_s1ap_id?" +//#warning "TODO mapping mme_ue_s1ap_id enb_ue_s1ap_id?" case S1ap_UE_S1AP_IDs_PR_mME_UE_S1AP_ID: mme_ue_s1ap_id = ueContextReleaseCommand_p->uE_S1AP_IDs.choice.mME_UE_S1AP_ID; diff --git a/openair3/S1AP/s1ap_eNB_nas_procedures.c b/openair3/S1AP/s1ap_eNB_nas_procedures.c index 0cd4c08cb1..dbe0fef091 100644 --- a/openair3/S1AP/s1ap_eNB_nas_procedures.c +++ b/openair3/S1AP/s1ap_eNB_nas_procedures.c @@ -191,7 +191,7 @@ int s1ap_eNB_handle_nas_first_req( * The cell identity is defined on 28 bits but as we use macro enb id, * we have to pad. */ -#warning "TODO get cell id from RRC" +//#warning "TODO get cell id from RRC" MACRO_ENB_ID_TO_CELL_IDENTITY(instance_p->eNB_id, 0, // Cell ID &initial_ue_message_p->eutran_cgi.cell_ID); @@ -400,7 +400,7 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_ s1ap_eNB_instance_p->mnc_digit_length, &uplink_NAS_transport_p->eutran_cgi.pLMNidentity); -#warning "TODO get cell id from RRC" +//#warning "TODO get cell id from RRC" MACRO_ENB_ID_TO_CELL_IDENTITY(s1ap_eNB_instance_p->eNB_id, 0, &uplink_NAS_transport_p->eutran_cgi.cell_ID); diff --git a/openair3/SCTP/sctp_eNB_task.c b/openair3/SCTP/sctp_eNB_task.c index 357803ac4f..6812c6bce3 100644 --- a/openair3/SCTP/sctp_eNB_task.c +++ b/openair3/SCTP/sctp_eNB_task.c @@ -148,7 +148,7 @@ sctp_handle_new_association_req( DevAssert(sctp_new_association_req_p != NULL); /* Create new socket with IPv6 affinity */ -#warning "SCTP may Force IPv4 only, here" +//#warning "SCTP may Force IPv4 only, here" #ifdef NO_VIRTUAL_MACHINE // in init chunk appears a list of host addresses, IPv4 and IPv4 in an arbitrary (unsorted) order From 544da9f598b5af0b4471bf5c949368fe14c77c22 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Sat, 26 Mar 2016 22:57:45 +0100 Subject: [PATCH 097/214] remove warnings from rt_wrapper.c --- targets/RT/USER/rt_wrapper.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/targets/RT/USER/rt_wrapper.c b/targets/RT/USER/rt_wrapper.c index 0242dab3d8..a011cf8dfe 100644 --- a/targets/RT/USER/rt_wrapper.c +++ b/targets/RT/USER/rt_wrapper.c @@ -38,6 +38,10 @@ * \warning */ +#include +#include +#include + #include "rt_wrapper.h" static int latency_target_fd = -1; static int32_t latency_target_value = 0; @@ -154,6 +158,7 @@ int fill_modeled_runtime_table(uint16_t runtime_phy_rx[29][6], runtime_phy_tx[i][j] = cell_processing_dl[j] + platform_processing_dl + user_processing_dl_err[j] + user_processing_dl_a[j]*i+ user_processing_dl_b[j]; } } + return 0; } // int runtime_upper_layers[6]; // values for different RBs From ce0adf779b2fe1caa68ad9eb40a144c2b07de670 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Sat, 26 Mar 2016 23:14:55 +0100 Subject: [PATCH 098/214] declare struct rrc_rnti_tree_s before RB_PROTOTYPE --- openair2/RRC/LITE/rrc_eNB_S1AP.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair2/RRC/LITE/rrc_eNB_S1AP.h b/openair2/RRC/LITE/rrc_eNB_S1AP.h index ea797e8c20..93a213c06f 100644 --- a/openair2/RRC/LITE/rrc_eNB_S1AP.h +++ b/openair2/RRC/LITE/rrc_eNB_S1AP.h @@ -63,6 +63,8 @@ rrc_eNB_S1AP_compare_ue_ids( struct rrc_ue_s1ap_ids_s* c2_pP ); +struct rrc_rnti_tree_s; + RB_PROTOTYPE(rrc_rnti_tree_s, rrc_ue_s1ap_ids_s, entries, rrc_eNB_S1AP_compare_ue_ids); struct rrc_ue_s1ap_ids_s* From 2cea2dbed9d66cc5002bf8971b54cefb5f53a726 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Sat, 26 Mar 2016 23:25:30 +0100 Subject: [PATCH 099/214] get rid of "const" warnings in nas_message.c --- openair3/NAS/COMMON/API/NETWORK/nas_message.c | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/openair3/NAS/COMMON/API/NETWORK/nas_message.c b/openair3/NAS/COMMON/API/NETWORK/nas_message.c index ece3ced5a3..e0face9576 100644 --- a/openair3/NAS/COMMON/API/NETWORK/nas_message.c +++ b/openair3/NAS/COMMON/API/NETWORK/nas_message.c @@ -1016,10 +1016,10 @@ static int _nas_message_decrypt( stream_cipher.count = count; stream_cipher.bearer = 0x00; //33.401 section 8.1.1 stream_cipher.direction = direction; - stream_cipher.message = src; + stream_cipher.message = (unsigned char *)src; /* length in bits */ stream_cipher.blength = length << 3; - nas_stream_encrypt_eea1(&stream_cipher, dest); + nas_stream_encrypt_eea1(&stream_cipher, (unsigned char *)dest); /* Decode the first octet (security header type or EPS bearer identity, * and protocol discriminator) */ DECODE_U8(dest, *(uint8_t*)(&header), size); @@ -1050,10 +1050,10 @@ static int _nas_message_decrypt( stream_cipher.count = count; stream_cipher.bearer = 0x00; //33.401 section 8.1.1 stream_cipher.direction = direction; - stream_cipher.message = src; + stream_cipher.message = (unsigned char *)src; /* length in bits */ stream_cipher.blength = length << 3; - nas_stream_encrypt_eea1(&stream_cipher, dest); + nas_stream_encrypt_eea1(&stream_cipher, (unsigned char *)dest); /* Decode the first octet (security header type or EPS bearer identity, * and protocol discriminator) */ DECODE_U8(dest, *(uint8_t*)(&header), size); @@ -1178,10 +1178,10 @@ static int _nas_message_encrypt( stream_cipher.count = count; stream_cipher.bearer = 0x00; //33.401 section 8.1.1 stream_cipher.direction = direction; - stream_cipher.message = src; + stream_cipher.message = (unsigned char *)src; /* length in bits */ stream_cipher.blength = length << 3; - nas_stream_encrypt_eea1(&stream_cipher, dest); + nas_stream_encrypt_eea1(&stream_cipher, (unsigned char *)dest); LOG_FUNC_RETURN (length); @@ -1209,10 +1209,10 @@ static int _nas_message_encrypt( stream_cipher.count = count; stream_cipher.bearer = 0x00; //33.401 section 8.1.1 stream_cipher.direction = direction; - stream_cipher.message = src; + stream_cipher.message = (unsigned char *)src; /* length in bits */ stream_cipher.blength = length << 3; - nas_stream_encrypt_eea2(&stream_cipher, dest); + nas_stream_encrypt_eea2(&stream_cipher, (unsigned char *)dest); LOG_FUNC_RETURN (length); @@ -1344,7 +1344,7 @@ static uint32_t _nas_message_get_mac( stream_cipher.count = count; stream_cipher.bearer = 0x00; //33.401 section 8.1.1 stream_cipher.direction = direction; - stream_cipher.message = buffer; + stream_cipher.message = (unsigned char *)buffer; /* length in bits */ stream_cipher.blength = length << 3; @@ -1390,7 +1390,7 @@ static uint32_t _nas_message_get_mac( stream_cipher.count = count; stream_cipher.bearer = 0x00; //33.401 section 8.1.1 stream_cipher.direction = direction; - stream_cipher.message = buffer; + stream_cipher.message = (unsigned char *)buffer; /* length in bits */ stream_cipher.blength = length << 3; From aab91dd0d4f5a4f1b73f7937ad59cf5ff987d0de Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 27 Mar 2016 02:50:47 -0700 Subject: [PATCH 100/214] removal of MAC_INTERFACE directory and its consequences --- openair1/PHY/LTE_ESTIMATION/adjust_gain.c | 2 -- openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c | 2 -- openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c | 5 ++--- openair1/PHY/LTE_ESTIMATION/lte_sync_time.c | 2 -- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 2 -- openair1/PHY/LTE_TRANSPORT/pcfich.c | 1 - openair1/PHY/LTE_TRANSPORT/rar_tools.c | 4 ---- openair1/PHY/LTE_TRANSPORT/uci_tools.c | 2 -- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 2 -- openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c | 2 -- openair1/PHY/MODULATION/slot_fep.c | 1 - openair1/PHY/MODULATION/slot_fep_mbsfn.c | 1 - openair1/PHY/extern.h | 7 ++----- openair1/SCHED/phy_mac_stub.c | 2 -- openair1/SCHED/phy_procedures_lte_common.c | 2 -- openair1/SCHED/phy_procedures_lte_eNb.c | 2 -- openair1/SCHED/phy_procedures_lte_ue.c | 2 -- openair2/LAYER2/MAC/rar_tools.c | 2 -- openair2/LAYER2/MAC/vars.h | 1 + openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c | 1 - openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_receiver.c | 1 - openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c | 1 - targets/RT/USER/lte-softmodem.c | 4 ---- targets/RT/USER/lte-ue.c | 4 ---- targets/RT/USER/sched_dlsch.c | 8 -------- targets/RT/USER/sched_rx_pdsch.c | 2 -- targets/SIMU/USER/channel_sim.c | 1 - targets/SIMU/USER/init_lte.c | 3 --- targets/SIMU/USER/oaisim.c | 1 - targets/SIMU/USER/oaisim_functions.c | 1 - targets/SIMU/USER/sinr_sim.c | 1 - 31 files changed, 5 insertions(+), 67 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/adjust_gain.c b/openair1/PHY/LTE_ESTIMATION/adjust_gain.c index ead0ed7d99..af72bce967 100644 --- a/openair1/PHY/LTE_ESTIMATION/adjust_gain.c +++ b/openair1/PHY/LTE_ESTIMATION/adjust_gain.c @@ -29,8 +29,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #ifdef EXMIMO #include "openair0_lib.h" diff --git a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c index 9425e94d02..059119c605 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c @@ -29,8 +29,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #define DEBUG_PHY diff --git a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c index 14e1c18571..b960848859 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c @@ -48,7 +48,7 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB, LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNB->lte_eNB_common_vars; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms; PHY_MEASUREMENTS_eNB *phy_measurements = &phy_vars_eNB->PHY_measurements_eNB[eNB_id]; - int32_t *rb_mask = phy_vars_eNB->rb_mask_ul; + uint32_t *rb_mask = phy_vars_eNB->rb_mask_ul; uint32_t aarx,rx_power_correction; uint32_t rb; @@ -56,7 +56,6 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB, int32_t n0_power_tot; int len; int offset; - int Nsymb = (frame_parms->Ncp==NORMAL)?14:12; // noise measurements // for the moment we measure the noise on the 7th OFDM symbol (in S subframe) @@ -88,7 +87,7 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB, // select the 7th symbol in an uplink subframe offset = (frame_parms->first_carrier_offset + (rb*12))%frame_parms->ofdm_symbol_size; - offset += (7*frame_parms->ofdm_symbol_size);//(((Nsymb*subframe)+7)*frame_parms->ofdm_symbol_size); + offset += (7*frame_parms->ofdm_symbol_size); ul_ch = &eNB_common_vars->rxdataF[eNB_id][aarx][offset]; len = 12; // just do first half of middle PRB for odd number of PRBs diff --git a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c index edbdbda2d1..083459c397 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c @@ -37,8 +37,6 @@ #include "PHY/defs.h" #include "PHY/extern.h" #include "SCHED/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include #ifdef OPENAIR2 diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index c9d68cd0aa..24781884da 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -40,8 +40,6 @@ #include "PHY/defs.h" #include "PHY/extern.h" #include "SCHED/defs.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #ifdef DEBUG_DCI_TOOLS #include "PHY/vars.h" #endif diff --git a/openair1/PHY/LTE_TRANSPORT/pcfich.c b/openair1/PHY/LTE_TRANSPORT/pcfich.c index f289fd3bd0..978492a500 100644 --- a/openair1/PHY/LTE_TRANSPORT/pcfich.c +++ b/openair1/PHY/LTE_TRANSPORT/pcfich.c @@ -38,7 +38,6 @@ * \warning */ #include "PHY/defs.h" -#include "MAC_INTERFACE/extern.h" //uint16_t pcfich_reg[4]; //uint8_t pcfich_first_reg_idx = 0; diff --git a/openair1/PHY/LTE_TRANSPORT/rar_tools.c b/openair1/PHY/LTE_TRANSPORT/rar_tools.c index 1b789e1144..5482818873 100644 --- a/openair1/PHY/LTE_TRANSPORT/rar_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/rar_tools.c @@ -40,12 +40,8 @@ #include "PHY/defs.h" #include "PHY/extern.h" #include "SCHED/extern.h" -#ifdef OPENAIR2 #include "LAYER2/MAC/defs.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include "SCHED/defs.h" -#endif #include "assertions.h" diff --git a/openair1/PHY/LTE_TRANSPORT/uci_tools.c b/openair1/PHY/LTE_TRANSPORT/uci_tools.c index 1cccc4aaac..6a475d52ee 100644 --- a/openair1/PHY/LTE_TRANSPORT/uci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/uci_tools.c @@ -39,8 +39,6 @@ */ #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #ifdef DEBUG_UCI_TOOLS #include "PHY/vars.h" #endif diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 25dae3ed63..b68f2c3090 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -44,8 +44,6 @@ #include "PHY/extern.h" #include "PHY/CODING/extern.h" #include "extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include "SCHED/extern.h" #ifdef OPENAIR2 #include "LAYER2/MAC/defs.h" diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c index f2e4dea58a..e52cdf9567 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c @@ -40,8 +40,6 @@ #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include "defs.h" #include "extern.h" //#define DEBUG_ULSCH diff --git a/openair1/PHY/MODULATION/slot_fep.c b/openair1/PHY/MODULATION/slot_fep.c index 0d2389c2ae..38e603e5e4 100644 --- a/openair1/PHY/MODULATION/slot_fep.c +++ b/openair1/PHY/MODULATION/slot_fep.c @@ -27,7 +27,6 @@ *******************************************************************************/ #include "PHY/defs.h" -#include "MAC_INTERFACE/extern.h" #include "defs.h" //#define DEBUG_FEP diff --git a/openair1/PHY/MODULATION/slot_fep_mbsfn.c b/openair1/PHY/MODULATION/slot_fep_mbsfn.c index d71a9d0477..f6ca4aa2f4 100644 --- a/openair1/PHY/MODULATION/slot_fep_mbsfn.c +++ b/openair1/PHY/MODULATION/slot_fep_mbsfn.c @@ -27,7 +27,6 @@ *******************************************************************************/ #include "PHY/defs.h" -#include "MAC_INTERFACE/extern.h" #include "defs.h" //#define DEBUG_FEP diff --git a/openair1/PHY/extern.h b/openair1/PHY/extern.h index a7450e3e21..4c9e2706c7 100755 --- a/openair1/PHY/extern.h +++ b/openair1/PHY/extern.h @@ -30,7 +30,7 @@ #define __PHY_EXTERN_H__ #include "PHY/defs.h" - +#include "PHY_INTERFACE/defs.h" extern char* namepointer_chMag ; extern char* namepointer_log2; @@ -39,10 +39,7 @@ extern char fmageren_name2[512]; extern unsigned int RX_DMA_BUFFER[4][NB_ANTENNAS_RX]; extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX]; -#ifdef OPENAIR_LTE #include "PHY/LTE_TRANSPORT/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include "SIMULATION/ETH_TRANSPORT/extern.h" extern unsigned int DAQ_MBOX; @@ -56,6 +53,7 @@ extern PHY_VARS_eNB ***PHY_vars_eNB_g; extern PHY_VARS_RN **PHY_vars_RN_g; extern LTE_DL_FRAME_PARMS *lte_frame_parms_g; +extern MAC_xface *mac_xface; extern short primary_synch0[144]; @@ -78,7 +76,6 @@ extern char mode_string[4][20]; #include "PHY/LTE_TRANSPORT/extern.h" -#endif #ifndef OPENAIR2 extern unsigned char NB_eNB_INST; diff --git a/openair1/SCHED/phy_mac_stub.c b/openair1/SCHED/phy_mac_stub.c index 9bcba1072c..ab2c97a657 100644 --- a/openair1/SCHED/phy_mac_stub.c +++ b/openair1/SCHED/phy_mac_stub.c @@ -40,8 +40,6 @@ #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include "SCHED/defs.h" #include "SCHED/extern.h" #include "LAYER2/MAC/extern.h" diff --git a/openair1/SCHED/phy_procedures_lte_common.c b/openair1/SCHED/phy_procedures_lte_common.c index c51bd82d8a..e56606e262 100755 --- a/openair1/SCHED/phy_procedures_lte_common.c +++ b/openair1/SCHED/phy_procedures_lte_common.c @@ -39,8 +39,6 @@ */ #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include "SCHED/defs.h" #include "SCHED/extern.h" diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 375c0dcd1f..4c740f4e33 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -40,8 +40,6 @@ #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include "SCHED/defs.h" #include "SCHED/extern.h" diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index b29c229f27..902377f140 100755 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -42,8 +42,6 @@ #include "defs.h" #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include "SCHED/defs.h" #include "SCHED/extern.h" diff --git a/openair2/LAYER2/MAC/rar_tools.c b/openair2/LAYER2/MAC/rar_tools.c index 2e97f83fac..5efa737a91 100644 --- a/openair2/LAYER2/MAC/rar_tools.c +++ b/openair2/LAYER2/MAC/rar_tools.c @@ -39,8 +39,6 @@ #include "defs.h" #include "proto.h" #include "extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include "SIMULATION/TOOLS/defs.h" #include "UTIL/LOG/log.h" #include "OCG.h" diff --git a/openair2/LAYER2/MAC/vars.h b/openair2/LAYER2/MAC/vars.h index 88da64de5a..508c7f8c21 100644 --- a/openair2/LAYER2/MAC/vars.h +++ b/openair2/LAYER2/MAC/vars.h @@ -55,6 +55,7 @@ const uint32_t BSR_TABLE[BSR_TABLE_SIZE]= {0,10,12,14,17,19,22,26,31,36,42,49,57 //uint32_t EBSR_Level[63]={0,10,13,16,19,23,29,35,43,53,65,80,98,120,147,181}; +MAC_xface *mac_xface; uint32_t RRC_CONNECTION_FLAG; diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c index b2930e6296..881dc9b993 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c @@ -37,7 +37,6 @@ #include "rlc_primitives.h" #include "mac_primitives.h" #include "list.h" -#include "MAC_INTERFACE/extern.h" #include "UTIL/LOG/log.h" #include "UTIL/LOG/vcd_signal_dumper.h" diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_receiver.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_receiver.c index 085f37e4c1..6ea07a4677 100755 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_receiver.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_receiver.c @@ -36,7 +36,6 @@ #include "rlc_primitives.h" #include "mac_primitives.h" #include "list.h" -#include "MAC_INTERFACE/extern.h" #include "UTIL/LOG/log.h" //----------------------------------------------------------------------------- diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c index a31f990916..24890bf957 100755 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c @@ -40,7 +40,6 @@ #include "list.h" #include "rlc_um.h" #include "rlc_primitives.h" -#include "MAC_INTERFACE/extern.h" #include "UTIL/LOG/log.h" //----------------------------------------------------------------------------- diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 7df20f05c8..e384c1f79a 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -77,8 +77,6 @@ struct gps_fix_t dummy_gps_data; //#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all #include "PHY/vars.h" -#include "MAC_INTERFACE/vars.h" -//#include "SCHED/defs.h" #include "SCHED/vars.h" #include "LAYER2/MAC/vars.h" @@ -88,13 +86,11 @@ struct gps_fix_t dummy_gps_data; #include "SCHED/phy_procedures_emos.h" #endif -#ifdef OPENAIR2 #include "LAYER2/MAC/defs.h" #include "LAYER2/MAC/vars.h" #include "LAYER2/MAC/proto.h" #include "RRC/LITE/vars.h" #include "PHY_INTERFACE/vars.h" -#endif #ifdef SMBV #include "PHY/TOOLS/smbv.h" diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index e72b4ec80a..28676f0156 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -75,13 +75,9 @@ #endif #include "PHY/extern.h" -#include "MAC_INTERFACE/extern.h" -//#include "SCHED/defs.h" #include "SCHED/extern.h" -#ifdef OPENAIR2 #include "LAYER2/MAC/extern.h" #include "LAYER2/MAC/proto.h" -#endif #include "UTIL/LOG/log_extern.h" #include "UTIL/OTG/otg_tx.h" diff --git a/targets/RT/USER/sched_dlsch.c b/targets/RT/USER/sched_dlsch.c index d582e79310..48fac642a9 100644 --- a/targets/RT/USER/sched_dlsch.c +++ b/targets/RT/USER/sched_dlsch.c @@ -51,14 +51,6 @@ #include "SCHED/defs.h" -#include "MAC_INTERFACE/extern.h" - -#ifdef CBMIMO1 -#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h" -#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h" -#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h" -#endif // CBMIMO1 - #include "UTIL/LOG/vcd_signal_dumper.h" #define DEBUG_PHY diff --git a/targets/RT/USER/sched_rx_pdsch.c b/targets/RT/USER/sched_rx_pdsch.c index be1ffbd752..e792fe737d 100644 --- a/targets/RT/USER/sched_rx_pdsch.c +++ b/targets/RT/USER/sched_rx_pdsch.c @@ -51,8 +51,6 @@ #include "SCHED/defs.h" #include "SCHED/extern.h" -#include "MAC_INTERFACE/extern.h" - #include "UTIL/LOG/vcd_signal_dumper.h" RTIME time0,time1; diff --git a/targets/SIMU/USER/channel_sim.c b/targets/SIMU/USER/channel_sim.c index e26129bca6..1e9b2afe7f 100644 --- a/targets/SIMU/USER/channel_sim.c +++ b/targets/SIMU/USER/channel_sim.c @@ -39,7 +39,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/extern.h" #ifdef OPENAIR2 #include "LAYER2/MAC/defs.h" diff --git a/targets/SIMU/USER/init_lte.c b/targets/SIMU/USER/init_lte.c index bbb99260eb..1d987b713e 100644 --- a/targets/SIMU/USER/init_lte.c +++ b/targets/SIMU/USER/init_lte.c @@ -38,14 +38,11 @@ #include "init_lte.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/extern.h" -#ifdef OPENAIR2 #include "LAYER2/MAC/defs.h" #include "LAYER2/MAC/extern.h" #include "UTIL/LOG/log_if.h" #include "PHY_INTERFACE/extern.h" -#endif diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c index 9e4880906d..6c987cdfbc 100644 --- a/targets/SIMU/USER/oaisim.c +++ b/targets/SIMU/USER/oaisim.c @@ -53,7 +53,6 @@ #include "PHY/defs.h" #include "PHY/LTE_TRANSPORT/proto.h" #include "PHY/vars.h" -#include "MAC_INTERFACE/vars.h" #include "SIMULATION/ETH_TRANSPORT/proto.h" diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c index 014a9e39d0..446174c988 100644 --- a/targets/SIMU/USER/oaisim_functions.c +++ b/targets/SIMU/USER/oaisim_functions.c @@ -51,7 +51,6 @@ #include "oaisim_functions.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/extern.h" #include "LAYER2/MAC/extern.h" #ifdef OPENAIR2 #include "LAYER2/MAC/proto.h" diff --git a/targets/SIMU/USER/sinr_sim.c b/targets/SIMU/USER/sinr_sim.c index 9ac1371d11..b235e16585 100644 --- a/targets/SIMU/USER/sinr_sim.c +++ b/targets/SIMU/USER/sinr_sim.c @@ -40,7 +40,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/extern.h" #include "oaisim_config.h" #ifdef OPENAIR2 From 20b6fee6327365d2eb346c4480eab480521f1686 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Sun, 27 Mar 2016 13:36:37 +0200 Subject: [PATCH 101/214] remove more warnings --- openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c | 2 +- openair1/PHY/LTE_TRANSPORT/dlsch_coding.c | 1 + openair1/SCHED/phy_procedures_lte_eNb.c | 1 + openair1/SCHED/phy_procedures_lte_ue.c | 2 ++ openair2/LAYER2/MAC/eNB_scheduler_bch.c | 4 ++-- openair2/LAYER2/MAC/pre_processor.c | 2 +- openair2/LAYER2/MAC/proto.h | 1 + openair2/LAYER2/MAC/ra_procedures.c | 7 ++++++- openair2/LAYER2/openair2_proc.c | 4 ++-- openair2/PHY_INTERFACE/defs.h | 11 ++++++++--- openair2/RRC/LITE/rrc_UE.c | 8 ++++++-- openair2/RRC/LITE/rrc_eNB_S1AP.c | 3 +++ openair2/RRC/LITE/vars.h | 14 ++++++++++---- openair2/UTIL/OTG/otg_kpi.c | 4 ++-- openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c | 2 +- openair3/NAS/UE/API/USIM/usim_api.c | 2 +- targets/RT/USER/lte-softmodem.c | 8 ++++---- targets/RT/USER/lte-ue.c | 2 +- targets/SIMU/USER/init_lte.c | 4 ++-- 19 files changed, 55 insertions(+), 27 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c index 378832ccf7..d5bfee81ed 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c @@ -48,7 +48,7 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB, LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNB->lte_eNB_common_vars; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms; PHY_MEASUREMENTS_eNB *phy_measurements = &phy_vars_eNB->PHY_measurements_eNB[eNB_id]; - int32_t *rb_mask = phy_vars_eNB->rb_mask_ul; + uint32_t *rb_mask = phy_vars_eNB->rb_mask_ul; uint32_t aarx /* ,rx_power_correction */; uint32_t rb; diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c index 95af038ab0..bf422fc37a 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c @@ -44,6 +44,7 @@ #include "PHY/CODING/extern.h" #include "PHY/CODING/lte_interleaver_inline.h" #include "PHY/LTE_TRANSPORT/defs.h" +#include "SCHED/defs.h" #include "defs.h" #include "UTIL/LOG/vcd_signal_dumper.h" diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 4042cb511c..e8c9ac670b 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -612,6 +612,7 @@ void phy_eNB_lte_check_measurement_thresholds(instance_t instanceP, ral_threshol #endif +unsigned int taus(void); void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag, relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn) diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index b29c229f27..e7b4980ac3 100755 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -902,6 +902,8 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra } */ + unsigned int taus(void); + for (i=0; ischedule_si); diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 39c4aedb4d..c744d1d90a 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -748,7 +748,7 @@ void dlsch_scheduler_pre_processor_reset (int module_idP, UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list; UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; rnti_t rnti = UE_RNTI(module_idP,UE_id); - uint8_t *vrb_map = &eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map; + uint8_t *vrb_map = eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map; int RBGsize = PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL/N_RBG; #ifdef SF05_LIMIT //int subframe05_limit=0; diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 9afe098d77..26656878f6 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -777,6 +777,7 @@ rrc_get_estimated_ue_distance( const int CC_idP, const uint8_t loc_typeP); +void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_eNB); #endif /** @}*/ diff --git a/openair2/LAYER2/MAC/ra_procedures.c b/openair2/LAYER2/MAC/ra_procedures.c index 43ec8b05ec..669077bf4f 100644 --- a/openair2/LAYER2/MAC/ra_procedures.c +++ b/openair2/LAYER2/MAC/ra_procedures.c @@ -152,6 +152,9 @@ void get_prach_resources(module_id_t module_idP, } } + /* TODO: gcc warns if this variable is not always set, let's put -1 for no more warning */ + messageSizeGroupA = -1; + if (!rach_ConfigCommon->preambleInfo.preamblesGroupAConfig) { noGroupB = 1; } else { @@ -171,6 +174,8 @@ void get_prach_resources(module_id_t module_idP, break; } + /* TODO: what value to use as default? */ + messagePowerOffsetGroupB = -9999; switch (rach_ConfigCommon->preambleInfo.preamblesGroupAConfig->messagePowerOffsetGroupB) { case 0: messagePowerOffsetGroupB = -9999; @@ -495,7 +500,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, UE_mac_inst[module_idP].RA_PREAMBLE_TRANSMISSION_COUNTER++; UE_mac_inst[module_idP].RA_prach_resources.ra_PREAMBLE_RECEIVED_TARGET_POWER += (rach_ConfigCommon->powerRampingParameters.powerRampingStep<<1); // 2dB increments in ASN.1 definition - int preambleTransMax; + int preambleTransMax = -1; switch (rach_ConfigCommon->ra_SupervisionInfo.preambleTransMax) { case RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n3: preambleTransMax = 3; diff --git a/openair2/LAYER2/openair2_proc.c b/openair2/LAYER2/openair2_proc.c index 284f91a7f8..e09adaea8c 100644 --- a/openair2/LAYER2/openair2_proc.c +++ b/openair2/LAYER2/openair2_proc.c @@ -150,7 +150,7 @@ int dump_eNB_l2_stats(char *buffer, int length) eNB->eNB_stats[CC_id].dlsch_pdus_tx, eNB->eNB_stats[CC_id].total_dlsch_pdus_tx); - len += sprintf(&buffer[len],"ULSCH bitrate (TTI %u, avg %u) kbps, Received bytes (TTI %u, total %u), Received PDU (TTI %u, total %lu) \n", + len += sprintf(&buffer[len],"ULSCH bitrate (TTI %u, avg %u) kbps, Received bytes (TTI %u, total %u), Received PDU (TTI %lu, total %u) \n", eNB->eNB_stats[CC_id].ulsch_bitrate, eNB->eNB_stats[CC_id].total_ulsch_bitrate, eNB->eNB_stats[CC_id].ulsch_bytes_rx, @@ -201,7 +201,7 @@ int dump_eNB_l2_stats(char *buffer, int length) UE_list->eNB_UE_stats[CC_id][UE_id].avg_overhead_bytes ); - len += sprintf(&buffer[len],"[MAC] UE %d (ULSCH), Status %d, RNTI %x : rx power (normalized %d, target %d), MCS (pre %d, post %d), RB (rx %d, retx %d, total %d), Current TBS %d \n", + len += sprintf(&buffer[len],"[MAC] UE %d (ULSCH), Status %s, RNTI %x : rx power (normalized %d, target %d), MCS (pre %d, post %d), RB (rx %d, retx %d, total %d), Current TBS %d \n", UE_id, map_int_to_str(rrc_status_names, UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status), UE_list->eNB_UE_stats[CC_id][UE_id].crnti, diff --git a/openair2/PHY_INTERFACE/defs.h b/openair2/PHY_INTERFACE/defs.h index 7b0367f537..c34bec28d7 100755 --- a/openair2/PHY_INTERFACE/defs.h +++ b/openair2/PHY_INTERFACE/defs.h @@ -241,19 +241,24 @@ typedef struct { uint16_t (*get_nCCE_max)(module_id_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe); - int (*get_nCCE_offset)(unsigned char L, int nCCE, int common_dci, unsigned short rnti, unsigned char subframe); + int (*get_nCCE_offset)(int *CCE_table, + const unsigned char L, + const int nCCE, + const int common_dci, + const unsigned short rnti, + const unsigned char subframe); /// Function to retrieve number of PRB in an rb_alloc uint32_t (*get_nb_rb)(uint8_t ra_header, uint32_t rb_alloc, int n_rb_dl); /// Function to convert VRB to PRB for distributed allocation - int (*get_prb)(int N_RB_DL,int odd_slot,int vrb,int Ngap); + uint32_t (*get_prb)(int N_RB_DL,int odd_slot,int vrb,int Ngap); /// Function to retrieve transmission mode for UE uint8_t (*get_transmission_mode)(module_id_t Mod_id,uint8_t CC_id,rnti_t rnti); /// Function to retrieve rb_alloc bitmap from dci rballoc field and VRB type - uint32_t (*get_rballoc)(uint8_t vrb_type, uint16_t rb_alloc_dci); + uint32_t (*get_rballoc)(vrb_t vrb_type, uint16_t rb_alloc_dci); /// Function for UE MAC to retrieve current PHY connectivity mode (PRACH,RA_RESPONSE,PUSCH) UE_MODE_t (*get_ue_mode)(module_id_t Mod_id, uint8_t CC_id,uint8_t eNB_index); diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c index ee35f317cd..25e24a864a 100644 --- a/openair2/RRC/LITE/rrc_UE.c +++ b/openair2/RRC/LITE/rrc_UE.c @@ -2268,6 +2268,9 @@ static const char* SIB2preambleTransMax( long value ) case 10: return "n200"; } + + /* unreachable but gcc warns... */ + return "ERR"; } static const char* SIB2ra_ResponseWindowSize( long value ) { @@ -3063,9 +3066,10 @@ uint64_t arfcn_to_freq(long arfcn) { return((uint64_t)3400000000 + ((arfcn-41590)*100000)); else if (arfcn <45590) // Band 43 return((uint64_t)3600000000 + ((arfcn-43950)*100000)); - else + else { LOG_E(RRC,"Unknown EARFCN %d\n",arfcn); - + exit(1); + } } static void dump_sib5( SystemInformationBlockType5_t *sib5 ) { diff --git a/openair2/RRC/LITE/rrc_eNB_S1AP.c b/openair2/RRC/LITE/rrc_eNB_S1AP.c index 679e629f16..e5738472c8 100644 --- a/openair2/RRC/LITE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LITE/rrc_eNB_S1AP.c @@ -60,6 +60,9 @@ #endif #include "msc.h" +#include "gtpv1u_eNB_task.h" +#include "RRC/LITE/rrc_eNB_GTPV1U.h" + /* Value to indicate an invalid UE initial id */ static const uint16_t UE_INITIAL_ID_INVALID = 0; diff --git a/openair2/RRC/LITE/vars.h b/openair2/RRC/LITE/vars.h index 122dea1df2..cb6e8c5238 100644 --- a/openair2/RRC/LITE/vars.h +++ b/openair2/RRC/LITE/vars.h @@ -88,18 +88,24 @@ struct LogicalChannelConfig__ul_SpecificParameters LCSRB2 = {3, }; +#ifdef Rel10 +struct LogicalChannelConfig__ext1 logicalChannelSR_Mask_r9_ext1 = { + logicalChannelSR_Mask_r9: &logicalChannelSR_Mask_r9 +}; +#endif + // These are the default SRB configurations from 36.331 (Chapter 9, p. 176-179 in v8.6) -LogicalChannelConfig_t SRB1_logicalChannelConfig_defaultValue = {&LCSRB1 +LogicalChannelConfig_t SRB1_logicalChannelConfig_defaultValue = {ul_SpecificParameters: &LCSRB1 #ifdef Rel10 , - &logicalChannelSR_Mask_r9 + ext1: &logicalChannelSR_Mask_r9_ext1 #endif }; -LogicalChannelConfig_t SRB2_logicalChannelConfig_defaultValue = {&LCSRB2 +LogicalChannelConfig_t SRB2_logicalChannelConfig_defaultValue = {ul_SpecificParameters: &LCSRB2 #ifdef Rel10 , - &logicalChannelSR_Mask_r9 + ext1: &logicalChannelSR_Mask_r9_ext1 #endif }; diff --git a/openair2/UTIL/OTG/otg_kpi.c b/openair2/UTIL/OTG/otg_kpi.c index 3aa55df05f..877150d892 100644 --- a/openair2/UTIL/OTG/otg_kpi.c +++ b/openair2/UTIL/OTG/otg_kpi.c @@ -61,7 +61,7 @@ void tx_throughput(int src, int dst, int application) else if (g_otg->flow_start[src][dst][application] < get_ctime() ) otg_info->tx_throughput[src][dst][application]=((double)otg_info->tx_num_bytes[src][dst][application] *1000*8)/ ((get_ctime() - g_otg->flow_start[src][dst][application])*1024); else - LOG_W("[src %d][dst %d][app %d] flow start time less than the simu time (start %d, duration %d, ctime %d)\n", + LOG_W(OTG, "[src %d][dst %d][app %d] flow start time less than the simu time (start %d, duration %d, ctime %d)\n", src, dst, application, g_otg->flow_start[src][dst][application], g_otg->flow_duration[src][dst][application], @@ -94,7 +94,7 @@ if ((g_otg->flow_start[src][dst][application]+g_otg->flow_duration[src][dst][app else if (g_otg->flow_start[src][dst][application] < get_ctime() ) otg_info->rx_goodput[src][dst][application]=((double)otg_info->rx_num_bytes[src][dst][application] *1000*8)/ ((get_ctime() - g_otg->flow_start[src][dst][application])*1024); else - LOG_W("[src %d][dst %d][app %d] flow start time less than the simu time (start %d, duration %d, ctime %d)\n", + LOG_W(OTG, "[src %d][dst %d][app %d] flow start time less than the simu time (start %d, duration %d, ctime %d)\n", src, dst, application, g_otg->flow_start[src][dst][application], g_otg->flow_duration[src][dst][application], diff --git a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c index f00441dfa2..2301cfe5dc 100644 --- a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c +++ b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c @@ -694,7 +694,7 @@ nwGtpv1uInitialize( NW_INOUT NwGtpv1uStackHandleT *hGtpuStackHandle, uint32_t st if(thiz) { thiz->id = (NwPtrT)thiz; thiz->stackType = stackType; - thiz->seq = (uint16_t) ((uint32_t)thiz) ; // FIXME interesting casts... don't know what this is good for... + thiz->seq = (uint16_t) ((uintptr_t)thiz) ; // FIXME interesting casts... don't know what this is good for... RB_INIT(&(thiz->outstandingTxSeqNumMap)); RB_INIT(&(thiz->outstandingRxSeqNumMap)); RB_INIT(&(thiz->sessionMap)); diff --git a/openair3/NAS/UE/API/USIM/usim_api.c b/openair3/NAS/UE/API/USIM/usim_api.c index 8a7a26de0d..51b99033bc 100644 --- a/openair3/NAS/UE/API/USIM/usim_api.c +++ b/openair3/NAS/UE/API/USIM/usim_api.c @@ -291,7 +291,7 @@ int usim_api_authenticate(const OctetString* rand_pP, const OctetString* autn_pP for (i = 0; i < USIM_API_SQN_MS_SIZE; i++) { //#warning "LG:BUG HERE TODO" sqn_ms[USIM_API_SQNMS_SIZE - i] = - ((uint8_t*)(_usim_api_data.sqn_ms))[USIM_API_SQN_MS_SIZE - i]; + ((uint8_t*)(&_usim_api_data.sqn_ms))[USIM_API_SQN_MS_SIZE - i]; } u8 sqnms[USIM_API_SQNMS_SIZE]; diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index c111e76879..1887e5a8bc 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -394,7 +394,7 @@ struct timespec clock_difftime(struct timespec start, struct timespec end) return temp; } -void print_difftimes() +void print_difftimes(void) { #ifdef DEBUG printf("difftimes min = %lu ns ; max = %lu ns\n", min_diff_time.tv_nsec, max_diff_time.tv_nsec); @@ -1055,7 +1055,7 @@ static void* eNB_thread_tx( void* param ) static int eNB_thread_tx_status[NUM_ENB_THREADS]; eNB_proc_t *proc = (eNB_proc_t*)param; - FILE *tx_time_file; + FILE *tx_time_file = NULL; char tx_time_name[101]; if (opp_enabled == 1) { @@ -1274,7 +1274,7 @@ static void* eNB_thread_rx( void* param ) eNB_proc_t *proc = (eNB_proc_t*)param; - FILE *rx_time_file; + FILE *rx_time_file = NULL; char rx_time_name[101]; //int i; @@ -1681,7 +1681,7 @@ static void* eNB_thread( void* arg ) #ifdef RTAI printf( "[SCHED][eNB] Started eNB main thread (id %p)\n", task ); #else - printf( "[SCHED][eNB] Started eNB main thread on CPU %d TID %d\n", sched_getcpu(), gettid()); + printf( "[SCHED][eNB] Started eNB main thread on CPU %d TID %ld\n", sched_getcpu(), gettid()); #endif #ifdef HARD_RT diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 4acb7e7a5f..f64d8d36f1 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -463,7 +463,7 @@ static void *UE_thread_synch(void *arg) if( UE->mode == rx_dump_frame ){ FILE *fd; if ((UE->frame_rx&1) == 0) { // this guarantees SIB1 is present - if (fd = fopen("rxsig_frame0.dat","w")) { + if ((fd = fopen("rxsig_frame0.dat","w")) != NULL) { fwrite((void*)&UE->lte_ue_common_vars.rxdata[0][0], sizeof(int32_t), 10*UE->lte_frame_parms.samples_per_tti, diff --git a/targets/SIMU/USER/init_lte.c b/targets/SIMU/USER/init_lte.c index bbb99260eb..85900387eb 100644 --- a/targets/SIMU/USER/init_lte.c +++ b/targets/SIMU/USER/init_lte.c @@ -211,11 +211,11 @@ PHY_VARS_RN* init_lte_RN(LTE_DL_FRAME_PARMS *frame_parms, if (eMBMS_active_state == multicast_relay) { for (i=0; i < 10 ; i++) { // num SF in a frame - PHY_vars_RN->dlsch_rn_MCH[i] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS_MBSFN,NSOFT,frame_parms->N_RB_DL, 0); + PHY_vars_RN->dlsch_rn_MCH[i] = new_ue_dlsch(1,1,NSOFT,MAX_TURBO_ITERATIONS_MBSFN,frame_parms->N_RB_DL, 0); LOG_D(PHY,"eNB %d : MCH[%d] %p\n",RN_id,i,PHY_vars_RN->dlsch_rn_MCH[i]); } } else { - PHY_vars_RN->dlsch_rn_MCH[0] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS,NSOFT,frame_parms->N_RB_DL, 0); + PHY_vars_RN->dlsch_rn_MCH[0] = new_ue_dlsch(1,1,NSOFT,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, 0); LOG_D(PHY,"eNB %d : MCH[0] %p\n",RN_id,PHY_vars_RN->dlsch_rn_MCH[0]); } From f514c0656d53cabf6cb484e7dfc5e3a5271706e6 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Sun, 27 Mar 2016 16:51:16 +0200 Subject: [PATCH 102/214] more warning removals: add const to asn1cpatch_3.p0 and update fix_asn1 --- cmake_targets/tools/fix_asn1 | 8 +-- openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 | 74 ++++++++++----------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/cmake_targets/tools/fix_asn1 b/cmake_targets/tools/fix_asn1 index 5f182c8f7e..0661d7878d 100755 --- a/cmake_targets/tools/fix_asn1 +++ b/cmake_targets/tools/fix_asn1 @@ -9,13 +9,13 @@ RRC_Rel10=( X2AP_Rel11_2=( "X2ap-CriticalityDiagnostics-IE-List.h" ae96308b37fcbcbf39da5012e42968135fc5f27b "fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff" - "NativeInteger.c" 9f173e87daa1e7378618dbb060a10aae752d74be "fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff" - "constr_SET_OF.c" 5352abd70c1784a0a2ef3c2e287b30ea3cdcf760 "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff" + "NativeInteger.c" 1a55f5402fd363318cf5444ffe1f67530dcf66ff "fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff" + "constr_SET_OF.c" 808cbbdf19b118c0bdb04e3acf2cbe6e4133be2b "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff" ) S1AP_Rel10_5=( - "NativeInteger.c" 9f173e87daa1e7378618dbb060a10aae752d74be "fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff" - "constr_SET_OF.c" 5352abd70c1784a0a2ef3c2e287b30ea3cdcf760 "fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff" + "NativeInteger.c" 1a55f5402fd363318cf5444ffe1f67530dcf66ff "fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff" + "constr_SET_OF.c" 808cbbdf19b118c0bdb04e3acf2cbe6e4133be2b "fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff" ) red_color="$(tput setaf 1)" diff --git a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 b/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 index b3517fd2d4..d5a936c101 100644 --- a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 +++ b/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 @@ -4,7 +4,7 @@ asn_enc_rval_t OCTET_STRING_encode_aper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *cts, void *sptr, asn_per_outp_t *po) { asn_enc_rval_t er = { 0, 0, 0 }; (void)td; (void)cts; (void)sptr; (void)po; return er; } -+asn_comp_rval_t * OCTET_STRING_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) { (void)td1; (void)sptr1; (void)td2; (void)sptr2; return 0; } ++asn_comp_rval_t * OCTET_STRING_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2) { (void)td1; (void)sptr1; (void)td2; (void)sptr2; return 0; } + size_t xer_whitespace_span(const void *chunk_buf, size_t chunk_size) { (void)chunk_buf; (void)chunk_size; return 0; } --- libasn1compiler/asn1c_C.c 2015-12-08 14:39:33.366543533 +0100 @@ -51,9 +51,9 @@ + if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index); + OUT("_compare(asn_TYPE_descriptor_t *td1,\n"); + INDENTED( -+ OUT("\tvoid *structure1,\n"); ++ OUT("\tconst void *structure1,\n"); + OUT("\tasn_TYPE_descriptor_t *td2,\n"); -+ OUT("\tvoid *structure2) {\n"); ++ OUT("\tconst void *structure2) {\n"); + OUT("asn_comp_rval_t * res = NULL;\n"); + OUT("%s_%d_inherit_TYPE_descriptor(td1);\n", + p, expr->_type_unique_index); @@ -142,8 +142,8 @@ +typedef struct asn_comp_rval_s { + enum COMPARE_ERR_CODE_e err_code; + char *name; // e_S1ap_ProtocolIE_ID not available for all ASN1 use (RRC vs S1AP, X2AP) -+ void *structure1; -+ void *structure2; ++ const void *structure1; ++ const void *structure2; + struct asn_comp_rval_s *next; +} asn_comp_rval_t; + @@ -234,7 +234,7 @@ + +asn_comp_rval_t * +BOOLEAN_compare(asn_TYPE_descriptor_t *td1, -+ void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) { ++ const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2) { + const BOOLEAN_t *st1 = (const BOOLEAN_t *)sptr1; + const BOOLEAN_t *st2 = (const BOOLEAN_t *)sptr2; + asn_comp_rval_t *res = NULL; @@ -279,9 +279,9 @@ + +typedef asn_comp_rval_t * (type_compare_f)( + struct asn_TYPE_descriptor_s *type_descriptor1, -+ void *struct_ptr1, ++ const void *struct_ptr1, + struct asn_TYPE_descriptor_s *type_descriptor2, -+ void *struct_ptr2 ++ const void *struct_ptr2 +); + + @@ -299,7 +299,7 @@ } + +asn_comp_rval_t * -+CHOICE_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) ++CHOICE_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2) +{ + asn_CHOICE_specifics_t *specs1 = (asn_CHOICE_specifics_t *)td1->specifics; + asn_CHOICE_specifics_t *specs2 = (asn_CHOICE_specifics_t *)td2->specifics; @@ -397,7 +397,7 @@ _ASN_ENCODED_OK(er); } + -+asn_comp_rval_t * SEQUENCE_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) { ++asn_comp_rval_t * SEQUENCE_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2) { + int edx; + asn_comp_rval_t *res = NULL; + asn_comp_rval_t *res2 = NULL; @@ -497,7 +497,7 @@ } + +asn_comp_rval_t * -+SET_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) ++SET_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2) +{ + int edx; + asn_comp_rval_t *res = NULL; @@ -568,7 +568,7 @@ } + +asn_comp_rval_t * -+SET_OF_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) ++SET_OF_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2) +{ + asn_TYPE_member_t *elm1 = td1->elements; + asn_TYPE_member_t *elm2 = td2->elements; @@ -665,10 +665,10 @@ } + +asn_comp_rval_t * -+ENUMERATED_compare(asn_TYPE_descriptor_t *td1, void *sptr1, -+ asn_TYPE_descriptor_t *td2, void *sptr2) { -+ ENUMERATED_t *st1 = (ENUMERATED_t *)sptr1; -+ ENUMERATED_t *st2 = (ENUMERATED_t *)sptr2; ++ENUMERATED_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, ++ asn_TYPE_descriptor_t *td2, const void *sptr2) { ++ const ENUMERATED_t *st1 = (const ENUMERATED_t *)sptr1; ++ const ENUMERATED_t *st2 = (const ENUMERATED_t *)sptr2; + asn_comp_rval_t *res = NULL; + + COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res) @@ -772,10 +772,10 @@ +asn_comp_rval_t * -+INTEGER_compare(asn_TYPE_descriptor_t *td1, void *sptr1, -+ asn_TYPE_descriptor_t *td2, void *sptr2) { -+ INTEGER_t *st1 = (INTEGER_t *)sptr1; -+ INTEGER_t *st2 = (INTEGER_t *)sptr2; ++INTEGER_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, ++ asn_TYPE_descriptor_t *td2, const void *sptr2) { ++ const INTEGER_t *st1 = (const INTEGER_t *)sptr1; ++ const INTEGER_t *st2 = (const INTEGER_t *)sptr2; + asn_comp_rval_t *res = NULL; + + COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res) @@ -855,8 +855,8 @@ } + +asn_comp_rval_t * -+NativeEnumerated_compare(asn_TYPE_descriptor_t *td1, void *sptr1, -+ asn_TYPE_descriptor_t *td2, void *sptr2) { ++NativeEnumerated_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, ++ asn_TYPE_descriptor_t *td2, const void *sptr2) { + const asn_INTEGER_enum_map_t *a = sptr1; + const asn_INTEGER_enum_map_t *b = sptr2; + asn_comp_rval_t *res = NULL; @@ -900,8 +900,8 @@ + +asn_comp_rval_t * -+NativeInteger_compare(asn_TYPE_descriptor_t *td1, void *sptr1, -+ asn_TYPE_descriptor_t *td2, void *sptr2) { ++NativeInteger_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, ++ asn_TYPE_descriptor_t *td2, const void *sptr2) { + const long *native1 = (const long *)sptr1; + const long *native2 = (const long *)sptr2; + asn_comp_rval_t *res = NULL; @@ -943,10 +943,10 @@ } +asn_comp_rval_t * -+NativeReal_compare(asn_TYPE_descriptor_t *td1, void *sptr1, -+ asn_TYPE_descriptor_t *td2, void *sptr2) { -+ REAL_t *st1 = (REAL_t *)sptr1; -+ REAL_t *st2 = (REAL_t *)sptr2; ++NativeReal_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, ++ asn_TYPE_descriptor_t *td2, const void *sptr2) { ++ const REAL_t *st1 = (const REAL_t *)sptr1; ++ const REAL_t *st2 = (const REAL_t *)sptr2; + asn_comp_rval_t *res = NULL; + + COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res) @@ -997,8 +997,8 @@ } + +asn_comp_rval_t * -+NULL_compare(asn_TYPE_descriptor_t *td1, void *sptr1, -+ asn_TYPE_descriptor_t *td2, void *sptr2) { ++NULL_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, ++ asn_TYPE_descriptor_t *td2, const void *sptr2) { + + return NULL; +} @@ -1066,9 +1066,9 @@ +asn_comp_rval_t * +OCTET_STRING_compare(asn_TYPE_descriptor_t *td1, -+ void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) { -+ OCTET_STRING_t *st1 = (OCTET_STRING_t *)sptr1; -+ OCTET_STRING_t *st2 = (OCTET_STRING_t *)sptr2; ++ const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2) { ++ const OCTET_STRING_t *st1 = (const OCTET_STRING_t *)sptr1; ++ const OCTET_STRING_t *st2 = (const OCTET_STRING_t *)sptr2; + asn_comp_rval_t *res = NULL; + + COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res) @@ -1132,10 +1132,10 @@ + + +asn_comp_rval_t * -+REAL_compare(asn_TYPE_descriptor_t *td1, void *sptr1, -+ asn_TYPE_descriptor_t *td2, void *sptr2) { -+ REAL_t *st1 = (REAL_t *)sptr1; -+ REAL_t *st2 = (REAL_t *)sptr2; ++REAL_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, ++ asn_TYPE_descriptor_t *td2, const void *sptr2) { ++ const REAL_t *st1 = (const REAL_t *)sptr1; ++ const REAL_t *st2 = (const REAL_t *)sptr2; + asn_comp_rval_t *res = NULL; + + COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res) From 5f823b401a9834149510587f919d2f4f69848898 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 28 Mar 2016 22:45:20 +0200 Subject: [PATCH 103/214] some more warning removals --- .../ETH_TRANSPORT/bypass_session_layer.c | 2 +- .../SIMULATION/ETH_TRANSPORT/emu_transport.c | 1 - openair1/SIMULATION/LTE_PHY/dlsim.c | 4 +++- openair1/SIMULATION/LTE_PHY/mbmssim.c | 8 +++---- openair1/SIMULATION/LTE_PHY/pbchsim.c | 17 +++++++------ openair1/SIMULATION/LTE_PHY/pdcchsim.c | 11 ++++++--- openair1/SIMULATION/LTE_PHY/prachsim.c | 24 ++++++++++++------- openair2/ENB_APP/enb_app.c | 6 +++++ openair2/ENB_APP/enb_config.c | 4 ++++ openair2/LAYER2/MAC/eNB_scheduler.c | 2 +- openair2/LAYER2/PDCP_v10.1.0/pdcp.c | 2 +- openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c | 4 +++- openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c | 12 ++++++++++ openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c | 2 +- openair2/LAYER2/RLC/rlc.c | 3 +++ openair2/LAYER2/RLC/rlc_rrc.c | 8 +++++++ openair2/RRC/LITE/L2_interface.c | 8 +++++-- openair2/RRC/LITE/rrc_UE.c | 7 +++++- openair2/RRC/LITE/rrc_common.c | 3 +++ openair2/RRC/LITE/rrc_eNB.c | 4 ++++ openair2/UTIL/LOG/log.c | 8 +++++++ openair2/UTIL/OMG/sumo.c | 2 +- targets/ARCH/COMMON/common_lib.c | 3 ++- .../ARCH/EXMIMO/USERSPACE/LIB/gain_control.h | 2 ++ .../ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.h | 2 ++ targets/RT/USER/lte-softmodem.c | 5 ++++ targets/RT/USER/lte-ue.c | 10 ++++---- targets/SIMU/USER/channel_sim.c | 4 ++-- targets/SIMU/USER/event_handler.c | 9 ++++--- targets/SIMU/USER/oaisim.c | 22 ++++++++++------- targets/SIMU/USER/oaisim_functions.c | 14 +++++------ 31 files changed, 151 insertions(+), 62 deletions(-) diff --git a/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c b/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c index 765952133a..0ced6e0ceb 100644 --- a/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c +++ b/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c @@ -288,7 +288,7 @@ int emu_transport_handle_ue_info(bypass_msg_header_t *messg, n_ue, total_header+total_tbs,total_header,total_tbs); } -#warning "CC id should be adjusted, set to zero for the moment" +//#warning "CC id should be adjusted, set to zero for the moment" memcpy(&UE_transport_info[n_ue][CC_id], UE_info, total_header + total_tbs); /* Go to the next UE info */ diff --git a/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c b/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c index 8c5516eabd..ec15e7c668 100644 --- a/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c +++ b/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c @@ -291,7 +291,6 @@ void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot LTE_eNB_DLSCH_t *dlsch_eNB; unsigned short ue_id; uint8_t nb_total_dci; - int i; // eNB // PBCH : copy payload diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index d67024810a..6f2c1f1d22 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -220,7 +220,7 @@ int main(int argc, char **argv) uint8_t N_RB_DL=25,osf=1; frame_t frame_type = FDD; int xforms=0; - FD_lte_phy_scope_ue *form_ue; + FD_lte_phy_scope_ue *form_ue = NULL; char title[255]; uint32_t DLSCH_RB_ALLOC = 0x1fff; int numCCE=0; @@ -2624,6 +2624,8 @@ PMI_FEEDBACK: num_pdcch_symbols, PHY_vars_eNB->dlsch_eNB[k][0], PHY_vars_eNB->dlsch_eNB[k][1]); + /* avoid gcc warnings */ + (void)re_allocated; stop_meas(&PHY_vars_eNB->dlsch_modulation_stats); /* diff --git a/openair1/SIMULATION/LTE_PHY/mbmssim.c b/openair1/SIMULATION/LTE_PHY/mbmssim.c index 0044b2ff51..8522b7be9a 100644 --- a/openair1/SIMULATION/LTE_PHY/mbmssim.c +++ b/openair1/SIMULATION/LTE_PHY/mbmssim.c @@ -583,10 +583,10 @@ int main(int argc, char **argv) mcs,N_RB_DL,mcs,N_RB_DL,errs[0], mcs,N_RB_DL,mcs,N_RB_DL,trials); else - fprintf(fd,"SNR_awgn_%d = [SNR_awgn_%d %d]; errs_mch_awgn_%d =[errs_mch_awgn_%f %d]; mch_trials_awgn_%d =[mch_trials_awgn_%d %d];\n", - mcs,N_RB_DL,mcs,N_RB_DL,SNR, - mcs,N_RB_DL,mcs,N_RB_DL,errs[0], - mcs,N_RB_DL,mcs,N_RB_DL,trials); + fprintf(fd,"SNR_awgn_%d = [SNR_awgn_%d %f]; errs_mch_awgn_%d =[errs_mch_awgn_%d %d]; mch_trials_awgn_%d =[mch_trials_awgn_%d %d];\n", + N_RB_DL,N_RB_DL,SNR, + N_RB_DL,N_RB_DL,errs[0], + N_RB_DL,N_RB_DL,trials); fflush(fd); diff --git a/openair1/SIMULATION/LTE_PHY/pbchsim.c b/openair1/SIMULATION/LTE_PHY/pbchsim.c index 319c2ed008..739c7e121f 100644 --- a/openair1/SIMULATION/LTE_PHY/pbchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pbchsim.c @@ -80,9 +80,9 @@ int main(int argc, char **argv) unsigned char pbch_pdu[6]; // int sync_pos, sync_pos_slot; // FILE *rx_frame_file; - FILE *output_fd; + FILE *output_fd = NULL; uint8_t write_output_file=0; - int result; + //int result; int freq_offset; // int subframe_offset; // char fname[40], vname[40]; @@ -91,8 +91,8 @@ int main(int argc, char **argv) uint16_t Nid_cell=0; int n_frames=1; - channel_desc_t *eNB2UE,*eNB2UE1,*eNB2UE2; - uint32_t nsymb,tx_lev,tx_lev1,tx_lev2; + channel_desc_t *eNB2UE,*eNB2UE1 = NULL,*eNB2UE2 = NULL; + uint32_t nsymb,tx_lev,tx_lev1 = 0,tx_lev2 = 0; uint8_t extended_prefix_flag=0; int8_t interf1=-21,interf2=-21; LTE_DL_FRAME_PARMS *frame_parms; @@ -104,12 +104,12 @@ int main(int argc, char **argv) char input_val_str[50],input_val_str2[50]; // double input_val1,input_val2; // uint16_t amask=0; - uint8_t frame_mod4,num_pdcch_symbols; + uint8_t frame_mod4,num_pdcch_symbols = 0; uint16_t NB_RB=25; SCM_t channel_model=AWGN;//Rayleigh1_anticorr; - DCI_ALLOC_t dci_alloc[8]; + //DCI_ALLOC_t dci_alloc[8]; uint8_t abstraction_flag=0;//,calibration_flag=0; double pbch_sinr; int pbch_tx_ant; @@ -782,7 +782,10 @@ int main(int argc, char **argv) i=0; while (!feof(input_fd)) { - fscanf(input_fd,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2); + if (fscanf(input_fd,"%s %s",input_val_str,input_val_str2) != 2) { //&input_val1,&input_val2); + printf("%s:%d:%s: error with fscanf, exiting\n", __FILE__, __LINE__, __FUNCTION__); + exit(1); + } if ((i%4)==0) { ((short*)txdata[0])[i/2] = (short)((1<<15)*strtod(input_val_str,NULL)); diff --git a/openair1/SIMULATION/LTE_PHY/pdcchsim.c b/openair1/SIMULATION/LTE_PHY/pdcchsim.c index 3c717d2625..0c51959f14 100644 --- a/openair1/SIMULATION/LTE_PHY/pdcchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pdcchsim.c @@ -67,9 +67,9 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2 uint32_t UL_alloc_pdu[2]; int i; - int dci_length_bytes,dci_length; - int BCCH_pdu_size_bits, BCCH_pdu_size_bytes; - int UL_pdu_size_bits, UL_pdu_size_bytes; + int dci_length_bytes=0,dci_length=0; + int BCCH_pdu_size_bits=0, BCCH_pdu_size_bytes=0; + int UL_pdu_size_bits=0, UL_pdu_size_bytes=0; int mcs = 3; DCI_pdu.Num_ue_spec_dci = 0; @@ -789,6 +789,11 @@ int main(int argc, char **argv) while (!feof(input_fd)) { ret=fscanf(input_fd,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2); + if (ret != 2) { + printf("%s:%d:%s: fscanf error, exiting\n", __FILE__, __LINE__, __FUNCTION__); + exit(1); + } + if ((i%4)==0) { ((short*)txdata[0])[i/2] = (short)((1<<15)*strtod(input_val_str,NULL)); ((short*)txdata[0])[(i/2)+1] = (short)((1<<15)*strtod(input_val_str2,NULL)); diff --git a/openair1/SIMULATION/LTE_PHY/prachsim.c b/openair1/SIMULATION/LTE_PHY/prachsim.c index 187a521e07..0fab08a3d1 100644 --- a/openair1/SIMULATION/LTE_PHY/prachsim.c +++ b/openair1/SIMULATION/LTE_PHY/prachsim.c @@ -58,6 +58,8 @@ PHY_VARS_UE *PHY_vars_UE; extern uint16_t prach_root_sequence_map0_3[838]; +void dump_prach_config(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe); + int main(int argc, char **argv) { @@ -74,7 +76,7 @@ int main(int argc, char **argv) int **txdata; double **s_re,**s_im,**r_re,**r_im; double iqim=0.0; - int trial, ntrials=1; + int trial; //, ntrials=1; uint8_t transmission_mode = 1,n_tx=1,n_rx=1; uint16_t Nid_cell=0; @@ -82,7 +84,7 @@ int main(int argc, char **argv) uint8_t hs_flag=0; int n_frames=1; channel_desc_t *UE2eNB; - uint32_t nsymb,tx_lev,tx_lev_dB; + uint32_t nsymb,tx_lev; //,tx_lev_dB; uint8_t extended_prefix_flag=0; // int8_t interf1=-19,interf2=-19; LTE_DL_FRAME_PARMS *frame_parms; @@ -101,8 +103,8 @@ int main(int argc, char **argv) uint16_t preamble_energy_list[64],preamble_tx=99,preamble_delay_list[64]; uint16_t preamble_max,preamble_energy_max; PRACH_RESOURCES_t prach_resources; - uint8_t prach_fmt; - int N_ZC; + //uint8_t prach_fmt; + //int N_ZC; int delay = 0; double delay_avg=0; double ue_speed = 0; @@ -126,7 +128,8 @@ int main(int argc, char **argv) case 'a': printf("Running AWGN simulation\n"); awgn_flag = 1; - ntrials=1; + /* ntrials not used later, no need to set */ + //ntrials=1; break; case 'd': @@ -404,9 +407,11 @@ int main(int argc, char **argv) PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag=hs_flag; PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset=0; - prach_fmt = get_prach_fmt(PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex, - PHY_vars_eNB->lte_frame_parms.frame_type); - N_ZC = (prach_fmt <4)?839:139; + /* N_ZC not used later, so prach_fmt is also useless, don't set */ + //prach_fmt = get_prach_fmt(PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex, + // PHY_vars_eNB->lte_frame_parms.frame_type); + /* N_ZC not used later, no need to set */ + //N_ZC = (prach_fmt <4)?839:139; compute_prach_seq(&PHY_vars_eNB->lte_frame_parms.prach_config_common,PHY_vars_eNB->lte_frame_parms.frame_type,PHY_vars_eNB->X_u); @@ -430,7 +435,8 @@ int main(int argc, char **argv) subframe, 0); //Nf - tx_lev_dB = (unsigned int) dB_fixed(tx_lev); + /* tx_lev_dB not used later, no need to set */ + //tx_lev_dB = (unsigned int) dB_fixed(tx_lev); write_output("txsig0_new.m","txs0", &txdata[0][subframe*frame_parms->samples_per_tti],frame_parms->samples_per_tti,1,1); //write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1); diff --git a/openair2/ENB_APP/enb_app.c b/openair2/ENB_APP/enb_app.c index 70fb5ad61f..6d95c215db 100644 --- a/openair2/ENB_APP/enb_app.c +++ b/openair2/ENB_APP/enb_app.c @@ -285,6 +285,9 @@ void *eNB_app_task(void *args_p) instance_t instance; int result; + /* for no gcc warnings */ + (void)instance; + itti_mark_task_ready (TASK_ENB_APP); # if defined(ENABLE_USE_MME) @@ -420,5 +423,8 @@ void *eNB_app_task(void *args_p) #endif + /* for no gcc warnings */ + (void)enb_properties_p; + return NULL; } diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index e96ef91326..51d5f3805f 100755 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -649,6 +649,10 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) char* osa_log_level = NULL; char* osa_log_verbosity = NULL; + /* for no gcc warnings */ + (void)astring; + (void)my_int; + memset((char*) (enb_properties.properties), 0 , MAX_ENB * sizeof(Enb_properties_t *)); memset((char*)active_enb, 0 , MAX_ENB * sizeof(char*)); diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 21e9337dbb..df867693a6 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -86,7 +86,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, int mbsfn_status[MAX_NUM_CCs]; protocol_ctxt_t ctxt; #ifdef EXMIMO - int ret; + //int ret; #endif #if defined(ENABLE_ITTI) MessageDef *msg_p; diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index 638c8051b0..d210b98f6a 100755 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -692,7 +692,7 @@ pdcp_data_ind( #if defined(USER_MODE) && defined(OAI_EMU) if (oai_emulation.info.otg_enabled == 1) { - unsigned int dst_instance; + //unsigned int dst_instance; int ctime; if ((pdcp_p->rlc_mode == RLC_MODE_AM)&&(MBMS_flagP==0) ) { diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c index 787d463b32..d7e1fe3551 100755 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c @@ -313,6 +313,8 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) hash_key_t key = HASHTABLE_NOT_A_KEY_VALUE; hashtable_rc_t h_rc; struct pdcp_netlink_element_s* data_p = NULL; + /* avoid gcc warnings */ + (void)data_p; module_id_t ue_id = 0; pdcp_t* pdcp_p = NULL; # if defined(PDCP_USE_NETLINK_QUEUES) @@ -565,7 +567,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) } } else { // rb_id =0, thus interpreated as broadcast and transported as multiple unicast // is a broadcast packet, we have to send this packet on all default RABS of all connected UEs -#warning CODE TO BE REVIEWED, ONLY WORK FOR SIMPLE TOPOLOGY CASES +//#warning CODE TO BE REVIEWED, ONLY WORK FOR SIMPLE TOPOLOGY CASES for (ue_id = 0; ue_id < NB_UE_INST; ue_id++) { if (oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt_cpy.module_id][ue_id] != NOT_A_RNTI) { ctxt.rnti = oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt_cpy.module_id][ue_id]; diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c index b92340348a..0b8abf3838 100755 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c @@ -682,6 +682,12 @@ rlc_am_mac_data_request ( MessageDef *msg_p; # endif int octet_index, index; + /* for no gcc warnings */ + (void)num_nack; + (void)message_string; + (void)message_string_size; + (void)octet_index; + (void)index; #endif list_init (&data_req.data, NULL); @@ -916,6 +922,12 @@ rlc_am_mac_data_indication ( MessageDef *msg_p; # endif int octet_index, index; + /* for no gcc warnings */ + (void)num_nack; + (void)message_string; + (void)message_string_size; + (void)octet_index; + (void)index; #endif (void)l_rlc_p; /* avoid gcc warning "unused variable" */ diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c index 8aab33f54c..7b0c9890ed 100755 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c @@ -745,7 +745,7 @@ rlc_um_data_req (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP, mem_block_t /* * Print every single octet in hexadecimal form */ - message_string_size += sprintf(&message_string[message_string_size], " %02x", (uint8_t*)(&sdu_pP->data[data_offset])[octet_index]); + message_string_size += sprintf(&message_string[message_string_size], " %02x", ((uint8_t*)(&sdu_pP->data[data_offset]))[octet_index]); /* * Align newline and pipes according to the octets in groups of 2 */ diff --git a/openair2/LAYER2/RLC/rlc.c b/openair2/LAYER2/RLC/rlc.c index e19c6b0b0a..1397387f22 100644 --- a/openair2/LAYER2/RLC/rlc.c +++ b/openair2/LAYER2/RLC/rlc.c @@ -602,6 +602,9 @@ rlc_module_init (void) int k; module_id_t module_id1; + /* for no gcc warnings */ + (void)k; + LOG_D(RLC, "MODULE INIT\n"); rlc_rrc_data_ind = NULL; rlc_rrc_data_conf = NULL; diff --git a/openair2/LAYER2/RLC/rlc_rrc.c b/openair2/LAYER2/RLC/rlc_rrc.c index f78cf90631..eccea461ab 100644 --- a/openair2/LAYER2/RLC/rlc_rrc.c +++ b/openair2/LAYER2/RLC/rlc_rrc.c @@ -87,6 +87,11 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP #endif + /* for no gcc warnings */ + (void)rlc_union_p; + (void)key; + (void)h_rc; + LOG_D(RLC, PROTOCOL_CTXT_FMT" CONFIG REQ ASN1 \n", PROTOCOL_CTXT_ARGS(ctxt_pP)); @@ -463,6 +468,9 @@ rlc_op_status_t rrc_rlc_remove_rlc ( #endif + /* for no gcc warnings */ + (void)lcid; + #ifdef Rel10 if (MBMS_flagP == TRUE) { diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c index 6a64095e92..70d0a20c08 100644 --- a/openair2/RRC/LITE/L2_interface.c +++ b/openair2/RRC/LITE/L2_interface.c @@ -355,6 +355,10 @@ mac_rrc_lite_data_ind( SRB_INFO *Srb_info; protocol_ctxt_t ctxt; sdu_size_t sdu_size = 0; + + /* for no gcc warnings */ + (void)sdu_size; + /* int si_window; */ @@ -389,7 +393,7 @@ mac_rrc_lite_data_ind( itti_send_msg_to_task (TASK_RRC_UE, ctxt.instance, message_p); } #else - decode_BCCH_DLSCH_Message(&ctxt,eNB_indexP,sduP,sdu_lenP, 0, 0); + decode_BCCH_DLSCH_Message(&ctxt,eNB_indexP,(uint8_t*)sduP,sdu_lenP, 0, 0); #endif } @@ -634,7 +638,7 @@ rrc_lite_data_ind( buffer_pP, sdu_sizeP); } else { -#warning "LG put 0 to arg4 that is eNB index" +//#warning "LG put 0 to arg4 that is eNB index" rrc_ue_decode_dcch( ctxt_pP, DCCH_index, diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c index 25e24a864a..ef4bbbeb1a 100644 --- a/openair2/RRC/LITE/rrc_UE.c +++ b/openair2/RRC/LITE/rrc_UE.c @@ -141,7 +141,9 @@ static uint8_t check_trigger_meas_event( Q_OffsetRange_t ofn, Q_OffsetRange_t ocn, Hysteresis_t hys, Q_OffsetRange_t ofs, Q_OffsetRange_t ocs, long a3_offset, TimeToTrigger_t ttt); +#ifdef Rel10 static void decode_MBSFNAreaConfiguration(module_id_t module_idP, uint8_t eNB_index, frame_t frameP,uint8_t mbsfn_sync_area); +#endif @@ -151,10 +153,13 @@ static void decode_MBSFNAreaConfiguration(module_id_t module_idP, uint8_t eNB_in /*------------------------------------------------------------------------------*/ +/* to avoid gcc warnings when compiling with certain options */ +#if defined(ENABLE_USE_MME) || ENABLE_RAL static Rrc_State_t rrc_get_state (module_id_t ue_mod_idP) { return UE_rrc_inst[ue_mod_idP].RrcState; } +#endif static Rrc_Sub_State_t rrc_get_sub_state (module_id_t ue_mod_idP) { @@ -1298,7 +1303,7 @@ rrc_ue_process_radioResourceConfigDedicated( UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]->cellAccessRelatedInfo.cellIdentity.buf[1], UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]->cellAccessRelatedInfo.cellIdentity.buf[2], UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]->cellAccessRelatedInfo.cellIdentity.buf[3]); -# endif OAI_EMU +# endif /* OAI_EMU */ #endif } diff --git a/openair2/RRC/LITE/rrc_common.c b/openair2/RRC/LITE/rrc_common.c index 2a37ccde00..86a3197d1e 100644 --- a/openair2/RRC/LITE/rrc_common.c +++ b/openair2/RRC/LITE/rrc_common.c @@ -253,6 +253,9 @@ openair_rrc_top_init( OAI_UECapability_t *UECap = NULL; int CC_id; + /* for no gcc warnings */ + (void)CC_id; + LOG_D(RRC, "[OPENAIR][INIT] Init function start: NB_UE_INST=%d, NB_eNB_INST=%d\n", NB_UE_INST, NB_eNB_INST); if (NB_UE_INST > 0) { diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index 5d7c99a586..657b8cba02 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -796,6 +796,8 @@ rrc_eNB_free_UE( protocol_ctxt_t ctxt; #if !defined(ENABLE_USE_MME) module_id_t ue_module_id; + /* avoid gcc warnings */ + (void)ue_module_id; #endif AssertFatal(enb_mod_idP < NB_eNB_INST, "eNB inst invalid (%d/%d) for UE %x!", enb_mod_idP, NB_eNB_INST, rntiP); ue_context_p = rrc_eNB_get_ue_context( @@ -1176,6 +1178,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration( CellsToAddModList_t *CellsToAddModList = NULL; struct RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList *dedicatedInfoNASList = NULL; DedicatedInfoNAS_t *dedicatedInfoNas = NULL; + /* for no gcc warnings */ + (void)dedicatedInfoNas; C_RNTI_t *cba_RNTI = NULL; #ifdef CBA diff --git a/openair2/UTIL/LOG/log.c b/openair2/UTIL/LOG/log.c index abbdbc01ab..0ef8f99d71 100755 --- a/openair2/UTIL/LOG/log.c +++ b/openair2/UTIL/LOG/log.c @@ -698,6 +698,10 @@ void logRecord_mt(const char *file, const char *func, int line, int comp, char *log_start; char *log_end; + /* for no gcc warnings */ + (void)log_start; + (void)log_end; + c = &g_log->log_component[comp]; // do not apply filtering for LOG_F @@ -971,6 +975,10 @@ void logRecord_mt(const char *file, const char *func, int line, int comp, */ char log_buffer[MAX_LOG_TOTAL]; + /* for no gcc warnings */ + (void)log_start; + (void)log_end; + c = &g_log->log_component[comp]; // do not apply filtering for LOG_F diff --git a/openair2/UTIL/OMG/sumo.c b/openair2/UTIL/OMG/sumo.c index f709a73e2a..4af34d0bc1 100644 --- a/openair2/UTIL/OMG/sumo.c +++ b/openair2/UTIL/OMG/sumo.c @@ -70,7 +70,7 @@ start_sumo_generator (omg_global_param omg_param_list) if ((pid = fork ()) == 0) { // Start SUMO in the child process - system (sumo_line); + if (system (sumo_line)) ; /* this if for no gcc warnings */ //childs addresss space } diff --git a/targets/ARCH/COMMON/common_lib.c b/targets/ARCH/COMMON/common_lib.c index dea02f2bba..de78cb80a6 100644 --- a/targets/ARCH/COMMON/common_lib.c +++ b/targets/ARCH/COMMON/common_lib.c @@ -147,7 +147,8 @@ int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cf int rc; //ToDo: EXMIMO harmonization is not complete. That is the reason for this ifdef #ifdef EXMIMO - device_init(device, openair0_cfg); + int device_init(openair0_device *device, openair0_config_t *openair0_cfg); + rc = device_init(device, openair0_cfg); #else rc=load_lib(device, openair0_cfg, NULL,BBU_LOCAL_RADIO_HEAD ); if ( rc >= 0) { diff --git a/targets/ARCH/EXMIMO/USERSPACE/LIB/gain_control.h b/targets/ARCH/EXMIMO/USERSPACE/LIB/gain_control.h index dd48683ad0..c71b51550e 100644 --- a/targets/ARCH/EXMIMO/USERSPACE/LIB/gain_control.h +++ b/targets/ARCH/EXMIMO/USERSPACE/LIB/gain_control.h @@ -30,8 +30,10 @@ #define TARGET_RX_POWER 50 // Target digital power for the AGC #define TARGET_RX_POWER_MAX 53 // Maximum digital power for AGC #define TARGET_RX_POWER_MIN 48 // Minimum digital power for AGC +#ifndef min #define min(a,b) (((a)<(b))?(a):(b)) #define max(a,b) (((a)>(b))?(a):(b)) +#endif void gain_control_all (unsigned int rx_power_fil_dB, unsigned int card); void gain_control (unsigned int rx_power_fil_dB, unsigned int ant, unsigned int card); diff --git a/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.h b/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.h index ae2ff8a36b..0abb27dee2 100644 --- a/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.h +++ b/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.h @@ -98,4 +98,6 @@ unsigned int *openair0_daq_cnt(void); // set the TX and RX frequencies (card 0 only for now, to retain USRP compatibility) int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config); +int openair0_set_gains(openair0_device* device, openair0_config_t *openair0_cfg); + #endif diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 1887e5a8bc..5271ca5d4a 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -1638,6 +1638,11 @@ static void* eNB_thread( void* arg ) int CC_id=0; struct timespec trx_time0, trx_time1, trx_time2; + /* avoid gcc warnings */ + (void)trx_time0; + (void)trx_time1; + (void)trx_time2; + #ifdef RTAI RT_TASK* task = rt_task_init_schmod(nam2num("eNBmain"), 0, 0, 0, SCHED_FIFO, 0xF); #else diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index f64d8d36f1..6ab133e5d6 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -1401,14 +1401,14 @@ void *UE_thread(void *arg) RT_TASK *task; #endif // RTIME in, out, diff; - int slot=0,frame=0,hw_slot,last_slot,next_slot; + int slot=0,frame=0,hw_slot; // unsigned int aa; int delay_cnt; RTIME time_in; - int hw_slot_offset=0,rx_offset_mbox=0,mbox_target=0,mbox_current=0; + int /* hw_slot_offset=0, */ rx_offset_mbox=0,mbox_target=0,mbox_current=0; int diff2; - int i, ret; - int CC_id,card; + int /* i, */ ret; + int /* CC_id, */ card; volatile unsigned int *DAQ_MBOX = openair0_daq_cnt(); int wait_sync_cnt = 0; @@ -1688,7 +1688,7 @@ void *UE_thread(void *arg) frame++; } } else if (UE->is_synchronized == 0) { // we are not yet synchronized - hw_slot_offset = 0; + //hw_slot_offset = 0; first_synch = 1; slot = 0; diff --git a/targets/SIMU/USER/channel_sim.c b/targets/SIMU/USER/channel_sim.c index e26129bca6..adb1fb92e7 100644 --- a/targets/SIMU/USER/channel_sim.c +++ b/targets/SIMU/USER/channel_sim.c @@ -97,7 +97,7 @@ void do_DL_sig(double **r_re0,double **r_im0, double rx_pwr; int32_t rx_pwr2; uint32_t i,aa; - uint32_t slot_offset,slot_offset_meas; + uint32_t slot_offset,slot_offset_meas = 0; double min_path_loss=-200; uint8_t hold_channel=0; @@ -105,7 +105,7 @@ void do_DL_sig(double **r_re0,double **r_im0, uint8_t nb_antennas_rx = eNB2UE[0][0][CC_id]->nb_rx; // number of rx antennas at UE uint8_t nb_antennas_tx = eNB2UE[0][0][CC_id]->nb_tx; // number of tx antennas at eNB - LTE_DL_FRAME_PARMS *fp; + //LTE_DL_FRAME_PARMS *fp; // int subframe_sched = ((next_slot>>1) == 0) ? 9 : ((next_slot>>1)-1); diff --git a/targets/SIMU/USER/event_handler.c b/targets/SIMU/USER/event_handler.c index 4072c6bfe7..1f7ecde72e 100644 --- a/targets/SIMU/USER/event_handler.c +++ b/targets/SIMU/USER/event_handler.c @@ -208,15 +208,15 @@ void schedule_events() a = 5; - uint16_t *priority[11];//={1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2}; + //uint16_t *priority[11];//={1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2}; - int tab[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; + //int tab[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; Application_Config* application_config; application_config = malloc(sizeof(Application_Config)); for(i=0; icustomized_traffic.aggregation_level[i]=i; } @@ -249,7 +249,7 @@ void schedule_events() //schedule(READ, MAC_ET, 500, NULL, ""); //schedule(WRITE, MAC_ET, 100, NULL, ""); //schedule(READ, TOPO_ET,110,NULL,"",0,0); - double b = (double) 45; + //double b = (double) 45; //schedule(READ, APP_ET,111,NULL,"",0,0); //schedule(READ, SYS_ET,112,NULL,"",0,0); //schedule(READ, EMU_ET,113,NULL,"",-1,-1); @@ -1844,7 +1844,6 @@ void update_emu_model(Event_t event) printf("\n\n\nA NEW EMU MODEL\n\n\n"); OAI_Emulation *oai_emulation; oai_emulation = get_OAI_emulation(); - int i=0; if(event.optype == READ) { if(event.key == NULL) { diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c index 9e4880906d..a0dcb7baaf 100644 --- a/targets/SIMU/USER/oaisim.c +++ b/targets/SIMU/USER/oaisim.c @@ -530,19 +530,23 @@ l2l1_task (void *args_p) if(abstraction_flag==0) { for (UE_inst=0; UE_instFK: OAI EMU channel abstraction does not work for MCS higher than" +//#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; @@ -1049,7 +1049,7 @@ void init_openair2(void) module_id_t enb_id; module_id_t UE_id; int CC_id; -#warning "eNB index is hard coded to zero" +//#warning "eNB index is hard coded to zero" for (CC_id=0; CC_idlte_frame_parms, @@ -1270,10 +1270,10 @@ void update_ocm() LOG_I(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); - 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; - distance = sqrt(dx * dx + dy * dy); + //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; + //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, UE_id, ue_data[UE_id]->x,ue_data[UE_id]->y, @@ -1313,7 +1313,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime) #if defined(USER_MODE) && defined(OAI_EMU) - int rrc_state=0; + //int rrc_state=0; if (oai_emulation.info.otg_enabled ==1 ) { From 87d1424762b590adadda5f5db2dc7479421020e6 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Tue, 29 Mar 2016 11:50:29 +0200 Subject: [PATCH 104/214] more warning removals --- openair2/RRC/LITE/rrc_UE.c | 4 ++++ openair2/RRC/LITE/rrc_eNB.c | 9 ++++++++- targets/SIMU/USER/oaisim.c | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c index ef4bbbeb1a..7da26897e8 100644 --- a/openair2/RRC/LITE/rrc_UE.c +++ b/openair2/RRC/LITE/rrc_UE.c @@ -704,6 +704,10 @@ rrc_ue_establish_drb( // add descriptor from RRC PDU #ifdef PDCP_USE_NETLINK int oip_ifup=0,ip_addr_offset3=0,ip_addr_offset4=0; + /* avoid gcc warnings */ + (void)oip_ifup; + (void)ip_addr_offset3; + (void)ip_addr_offset4; #endif LOG_I(RRC,"[UE %d] Frame %d: processing RRCConnectionReconfiguration: reconfiguring DRB %ld/LCID %d\n", diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index 657b8cba02..4c8e3d9d63 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -1147,7 +1147,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration( struct DRB_ToAddMod *DRB_config = NULL; struct RLC_Config *DRB_rlc_config = NULL; struct PDCP_Config *DRB_pdcp_config = NULL; - //struct PDCP_Config__rlc_AM *PDCP_rlc_AM = NULL; + struct PDCP_Config__rlc_AM *PDCP_rlc_AM = NULL; struct PDCP_Config__rlc_UM *PDCP_rlc_UM = NULL; struct LogicalChannelConfig *DRB_lchan_config = NULL; struct LogicalChannelConfig__ul_SpecificParameters @@ -1292,6 +1292,9 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration( DRB_pdcp_config->rlc_AM = NULL; DRB_pdcp_config->rlc_UM = NULL; + /* avoid gcc warnings */ + (void)PDCP_rlc_AM; + #ifdef RRC_DEFAULT_RAB_IS_AM // EXMIMO_IOT PDCP_rlc_AM = CALLOC(1, sizeof(*PDCP_rlc_AM)); DRB_pdcp_config->rlc_AM = PDCP_rlc_AM; @@ -3007,6 +3010,10 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( int oip_ifup = 0; int dest_ip_offset = 0; module_id_t ue_module_id = -1; + /* avoid gcc warnings */ + (void)oip_ifup; + (void)dest_ip_offset; + (void)ue_module_id; #endif uint8_t *kRRCenc = NULL; diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c index a0dcb7baaf..d09f61f06a 100644 --- a/targets/SIMU/USER/oaisim.c +++ b/targets/SIMU/USER/oaisim.c @@ -458,6 +458,7 @@ l2l1_task (void *args_p) char *xargv[1]; //#endif +#undef PRINT_STATS /* this undef is to avoid gcc warnings */ #define PRINT_STATS #ifdef PRINT_STATS int len; From 600cce17c72ede912cbcf8991b925cfcd7312875 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Tue, 29 Mar 2016 12:00:57 +0200 Subject: [PATCH 105/214] more warning removals --- openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c | 2 +- openair2/RRC/LITE/rrc_eNB.c | 1 + openair3/NAS/TOOLS/ue_data.c | 2 +- openair3/NAS/UE/EMM/SAP/emm_reg.c | 3 +++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c index d7e1fe3551..8ac79a61b9 100755 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c @@ -494,7 +494,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) pdcp_read_header_g.inst + oai_emulation.info.first_enb_local;*/ #else // OAI_EMU pdcp_read_header_g.inst = 0; -#warning "TO DO CORRCT VALUES FOR ue mod id, enb mod id" +//#warning "TO DO CORRCT VALUES FOR ue mod id, enb mod id" ctxt.frame = ctxt_cpy.frame; ctxt.enb_flag = ctxt_cpy.enb_flag; diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index 4c8e3d9d63..42e28f752f 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -1294,6 +1294,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration( /* avoid gcc warnings */ (void)PDCP_rlc_AM; + (void)PDCP_rlc_UM; #ifdef RRC_DEFAULT_RAB_IS_AM // EXMIMO_IOT PDCP_rlc_AM = CALLOC(1, sizeof(*PDCP_rlc_AM)); diff --git a/openair3/NAS/TOOLS/ue_data.c b/openair3/NAS/TOOLS/ue_data.c index 478119acda..5a463ad094 100644 --- a/openair3/NAS/TOOLS/ue_data.c +++ b/openair3/NAS/TOOLS/ue_data.c @@ -481,7 +481,7 @@ static void _display_emm_data(const emm_nvdata_t* data) data->imsi.u.num.digit13, data->imsi.u.num.digit14); } else { - printf("%u%u%u.%u%u%u.%u%u%u%u%u%u%u%u\n", + printf("%u%u%u.%u%u%u.%u%u%u%u%u%u%u%u%u\n", data->imsi.u.num.digit1, data->imsi.u.num.digit2, data->imsi.u.num.digit3, diff --git a/openair3/NAS/UE/EMM/SAP/emm_reg.c b/openair3/NAS/UE/EMM/SAP/emm_reg.c index 7f20b25151..b73f75975a 100755 --- a/openair3/NAS/UE/EMM/SAP/emm_reg.c +++ b/openair3/NAS/UE/EMM/SAP/emm_reg.c @@ -114,6 +114,9 @@ int emm_reg_send(const emm_reg_t *msg) emm_reg_primitive_t primitive = msg->primitive; assert( (primitive > _EMMREG_START) && (primitive < _EMMREG_END)); + /* avoid gcc warnings */ + (void)primitive; + /* Execute the EMM procedure */ rc = emm_fsm_process(msg); From 3d0ad079b1b4ce73f99da260016c5fee0b3cf680 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Wed, 30 Mar 2016 08:07:54 -0400 Subject: [PATCH 106/214] fix for kernel 4.2 --- targets/ARCH/EXMIMO/DRIVER/eurecom/module_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/targets/ARCH/EXMIMO/DRIVER/eurecom/module_main.c b/targets/ARCH/EXMIMO/DRIVER/eurecom/module_main.c index 4ef187b073..ce699a1b4f 100755 --- a/targets/ARCH/EXMIMO/DRIVER/eurecom/module_main.c +++ b/targets/ARCH/EXMIMO/DRIVER/eurecom/module_main.c @@ -190,15 +190,13 @@ static int __init openair_init_module( void ) mmio_length[card] = pci_resource_len (pdev[card], 0); mmio_flags[card] = pci_resource_flags(pdev[card], 0); - if (check_mem_region(mmio_start[card],256) < 0) { + if (request_mem_region(mmio_start[card],256,"openair_rf") == NULL) { printk("[openair][INIT_MODULE][FATAL] : Cannot get memory region 0, aborting\n"); mmio_start[card] = 0; openair_cleanup(); return -EBUSY; } else - printk("[openair][INIT_MODULE][INFO] : Reserving memory region 0 : mmio_start = 0x%x\n",(unsigned int)mmio_start[card]); - - request_mem_region(mmio_start[card], 256, "openair_rf"); + printk("[openair][INIT_MODULE][INFO] : Reserved memory region 0 : mmio_start = 0x%x\n",(unsigned int)mmio_start[card]); bar[card] = pci_iomap( pdev[card], 0, mmio_length[card] ); // get virtual kernel address for BAR0 From af98ae8c3576242b871e0c06abf79014cfd9f89a Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Thu, 31 Mar 2016 20:01:47 +0200 Subject: [PATCH 107/214] addition of Sony Experia M4 Phone tests --- cmake_targets/autotests/README.txt | 8 + cmake_targets/autotests/test_case_list.xml | 446 ++++++++++++++++++++- cmake_targets/tools/build_helper | 3 +- 3 files changed, 455 insertions(+), 2 deletions(-) diff --git a/cmake_targets/autotests/README.txt b/cmake_targets/autotests/README.txt index 6e9cbbd581..3ae18133c7 100644 --- a/cmake_targets/autotests/README.txt +++ b/cmake_targets/autotests/README.txt @@ -205,6 +205,14 @@ Obj.# Case# Test# Description 01 85 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX 01 85 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX +02 55 lte-softmodem tests with USRP B210 RF as eNB and ALU EPC w/ Sony Experia M4 COTS UE for TX/1RX +02 55 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX +02 55 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX +02 55 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX +02 55 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX +02 55 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX +02 55 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX + 01 64 lte-softmodem-noS1 tests diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index c4b0fc75e6..d8bdb34c8e 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -6,7 +6,7 @@ https://gitlab.eurecom.fr/oai/openair-cn.git develop develop - oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* hss hss_sim configure_cots_bandrich_ue* wvdial* iperf iperf_script ping tshark rrh_gw + oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* hss hss_sim configure_cots* wvdial* iperf iperf_script ping tshark rrh_gw sudo -S -E /opt/ltebox/tools/stop_ltebox $OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; uname -a; dmesg|tail 36000 @@ -6020,6 +6020,450 @@ + + lte-softmodem + + calisson + stevens + amerique + 390 + /tmp + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + $OPENAIR_DIR/cmake_targets/build_oai + --eNB -w USRP -x -c + + + $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + + + + + False + + /tmp + + + + + + sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue + + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + + + + False + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + + /tmp + + + + + + + + + /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 + + /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 + + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + + throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec + + False + USRPb210.ALU_EPC.SonyExperiaM4.5MHz.FDD.Band_7.UL.1TX.1RX + 10 + + + + + lte-softmodem + + calisson + stevens + amerique + 390 + /tmp + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + $OPENAIR_DIR/cmake_targets/build_oai + --eNB -w USRP -x -c + + + $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + + + + + False + + /tmp + + + + + + $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue + + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + + + + False + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + + /tmp + + + + + + + + + /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 + + /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 + + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + + throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec + + False + USRPb210.ALU_EPC.SonyExperiaM4.10MHz.FDD.Band_7.UL.1TX.1RX + 10 + + + + lte-softmodem + + calisson + stevens + amerique + 390 + /tmp + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + $OPENAIR_DIR/cmake_targets/build_oai + --eNB -w USRP -x -c + + + $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + + + + + False + + /tmp + + + + + + $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue + + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + + + + False + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + + /tmp + + + + + + + + + /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 + + /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 + + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + + throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec + + False + USRPb210.ALU_EPC.SonyExperiaM4.20MHz.FDD.Band_7.UL.1TX.1RX + 10 + + + + lte-softmodem + + calisson + stevens + amerique + 390 + /tmp + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + $OPENAIR_DIR/cmake_targets/build_oai + --eNB -w USRP -x -c + + + $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + + + + + False + + /tmp + + + + + + $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue + + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 + + False + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec + + + /tmp + + + + + + + + + /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 + + /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 + + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + + + False + USRPb210.ALU_EPC.SonyExperiaM4.5MHz.FDD.Band_7.DL.1TX.1RX + 10 + + + + lte-softmodem + + calisson + stevens + amerique + 390 + /tmp + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + $OPENAIR_DIR/cmake_targets/build_oai + --eNB -w USRP -x -c + + + $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + + + + + False + + /tmp + + + + + $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue + + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 + + throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec + + False + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + + + /tmp + + + + + + + + + /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 + + /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 + + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + + + False + USRPb210.ALU_EPC.SonyExperiaM4.10MHz.FDD.Band_7.DL.1TX.1RX + 10 + + + + lte-softmodem + + calisson + stevens + amerique + 390 + /tmp + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + $OPENAIR_DIR/cmake_targets/build_oai + --eNB -w USRP -x -c + + + $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + + + + + False + + /tmp + + + + + + $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue + + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 + + throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec + + False + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + + + /tmp + + + + + + + + + /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 + + /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 + + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + + + False + USRPb210.ALU_EPC.SonyExperiaM4.20MHz.FDD.Band_7.DL.1TX.1RX + 10 + + + diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 689c15dc5b..294c5006a5 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -270,7 +270,8 @@ check_install_oai_software() { wvdial \ python-numpy \ sshpass \ - libxslt1-dev + libxslt1-dev \ + android-tools-adb $SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so if [ `lsb_release -rs` = '12.04' ] ; then From 71f9a71a98746b55f43e850d3099d3fc61ea12da Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 1 Apr 2016 16:54:29 +0200 Subject: [PATCH 108/214] autotest scripts for Sony Experia M4 --- .../configure_cots_sony_experia_m4_ue.py | 119 ++++++++++++++++++ .../autotests/tools/iperf_script_phone | 20 +++ 2 files changed, 139 insertions(+) create mode 100755 cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py create mode 100755 cmake_targets/autotests/tools/iperf_script_phone diff --git a/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py b/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py new file mode 100755 index 0000000000..649759c3ea --- /dev/null +++ b/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py @@ -0,0 +1,119 @@ +#!/usr/bin/python + +import time +import serial +import os +from pyroute2 import IPRoute +import sys +import re +import threading +import signal +import traceback +import os +import commands + +# Find a device ID by running sudo adb devices +# The device ID below is for Sony Xperia M4 + +device_id='YT9115PX1E' + + +openair_dir = os.environ.get('OPENAIR_DIR') +if openair_dir == None: + print "Error getting OPENAIR_DIR environment variable" + sys.exit(1) + +sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/')) + +from lib_autotest import * + +def signal_handler(signal, frame): + print('You pressed Ctrl+C!') + print('Resetting the UE to detached state') + timeout=10 + exit_flag=1 + sys.exit(0) + +signal.signal(signal.SIGINT, signal_handler) + +# Find all the process IDs in a phone given the name of process +def kill_processes(name): + print " Killing all processes by name..." + name + while 1: + cmd = 'sudo adb -s ' + device_id +' shell "ps |grep ' + name + '"' + status, out = commands.getstatusoutput(cmd) + if status != 0: + print "Error execting command to kill process " + name + sys.exit(1) + print "Out = " + out + if out=='': + break; + out_arr = out.split() + pid_to_kill = out_arr[1] + print "Now killing process ID" + pid_to_kill + " on Phone" + cmd = 'sudo adb -s ' + device_id +' shell "kill ' + pid_to_kill + '"' + status, out = commands.getstatusoutput(cmd) + if status != 0: + print "Error execting command to kill process " + name + sys.exit(1) + print "Out = " + out + +def start_ue () : + #print 'Enter your commands below.\r\nInsert "exit" to leave the application.' + print 'Killing old iperf/ping sessions' + kill_processes('iperf') + kill_processes('ping') + print "Turning off airplane mode" + os.system('sudo -E adb devices') + os.system('sudo -E adb -s ' + device_id + ' shell \"settings put global airplane_mode_on 0; am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false\"') + + while 1: + time.sleep ( 2) + #Now we check if ppp0 interface is up and running + try: + cmd = 'sudo adb -s ' + device_id + ' shell netcfg |grep 192.' + status, out = commands.getstatusoutput(cmd) + if (out == '') : + print "Wating for UE to connect and get IP Address..." + sys.exit() + else : + print "UE is now connected. IP Address settings are..." + out + os.system('sleep 5') + os.system ('sudo adb -s ' + device_id + ' shell ping ' + gw) + break + except Exception, e: + error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e) + error = error + traceback.format_exc() + print error + + + +def stop_ue(): + print "Turning on airplane mode" + os.system('sudo adb devices') + os.system('sudo adb -s ' + device_id + ' shell \"settings put global airplane_mode_on 1; am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true\" ') + print "Killing iperf/ping sessions" + kill_processes('iperf') + kill_processes('ping') + +i=1 +gw='192.172.0.1' +while i < len(sys.argv): + arg=sys.argv[i] + if arg == '--start-ue' : + start_ue() + elif arg == '--stop-ue' : + stop_ue() + elif arg == '-gw' : + gw = sys.argv[i+1] + i=i+1 + elif arg == '-h' : + print "--stop-ue: Stop the UE. Turn on airplane mode" + print "--start-ue: Start the UE. Turn off airplane mode" + print "-gw: Specify the default gw as sometimes the gateway/route arguments are not set properly via wvdial" + else : + print " Script called with wrong arguments, arg = " + arg + sys.exit() + i = i +1 + + diff --git a/cmake_targets/autotests/tools/iperf_script_phone b/cmake_targets/autotests/tools/iperf_script_phone new file mode 100755 index 0000000000..09d0941bfd --- /dev/null +++ b/cmake_targets/autotests/tools/iperf_script_phone @@ -0,0 +1,20 @@ +#!/bin/bash + +#arg1 timeout to wait before running the script +#arg2 interface +#arg3 iperf arguments + +args=($*) +timeout=${args[0]} +device_id=${args[1]} +iperf_args=(${args[@]:2}) + +#array=${1:-1} +echo "args = ${args[@]}" +echo "timeout = $timeout" +echo "device_id = $device_id" +echo "iperf_args = ${iperf_args[@]}" + +sleep $timeout + +sudo adb -s $device_id shell /data/local/tmp/iperf ${iperf_args[@]} From 058aa8a28cda3dcb97aad07967ed9c9894627a18 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 1 Apr 2016 17:18:55 +0200 Subject: [PATCH 109/214] updates for adding Sony Experia M4 to test setup --- .../tools/configure_cots_sony_experia_m4_ue.py | 5 ++--- cmake_targets/autotests/tools/iperf_script_phone | 12 ++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py b/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py index 649759c3ea..399d10b5b1 100755 --- a/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py @@ -50,7 +50,7 @@ def kill_processes(name): break; out_arr = out.split() pid_to_kill = out_arr[1] - print "Now killing process ID" + pid_to_kill + " on Phone" + print "Now killing process ID " + pid_to_kill + " on Phone" cmd = 'sudo adb -s ' + device_id +' shell "kill ' + pid_to_kill + '"' status, out = commands.getstatusoutput(cmd) if status != 0: @@ -74,8 +74,7 @@ def start_ue () : cmd = 'sudo adb -s ' + device_id + ' shell netcfg |grep 192.' status, out = commands.getstatusoutput(cmd) if (out == '') : - print "Wating for UE to connect and get IP Address..." - sys.exit() + print "Waiting for UE to connect and get IP Address..." else : print "UE is now connected. IP Address settings are..." + out os.system('sleep 5') diff --git a/cmake_targets/autotests/tools/iperf_script_phone b/cmake_targets/autotests/tools/iperf_script_phone index 09d0941bfd..91f26ff3b9 100755 --- a/cmake_targets/autotests/tools/iperf_script_phone +++ b/cmake_targets/autotests/tools/iperf_script_phone @@ -17,4 +17,16 @@ echo "iperf_args = ${iperf_args[@]}" sleep $timeout +while true ; do + cmd=`sudo adb -s $device_id shell netcfg |grep 192.` + if [ -z "$cmd" ]; then + print "Wating for UE to connect and get IP Address..." + else + echo "UE is not connected. IP Address settings are... $cmd" + break + +done + +print "Starting iperf now..." + sudo adb -s $device_id shell /data/local/tmp/iperf ${iperf_args[@]} From 3471c652d67aa7629f2c6db43d984f61a47a4665 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 1 Apr 2016 17:39:37 +0200 Subject: [PATCH 110/214] minor bugfix for iperf script --- cmake_targets/autotests/tools/iperf_script_phone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/autotests/tools/iperf_script_phone b/cmake_targets/autotests/tools/iperf_script_phone index 91f26ff3b9..7b4d283c17 100755 --- a/cmake_targets/autotests/tools/iperf_script_phone +++ b/cmake_targets/autotests/tools/iperf_script_phone @@ -24,7 +24,7 @@ while true ; do else echo "UE is not connected. IP Address settings are... $cmd" break - + fi done print "Starting iperf now..." From 387edbdf1908393612bc4705d7351095b5d3e187 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 1 Apr 2016 17:46:01 +0200 Subject: [PATCH 111/214] minor fixes to test scripts for Sony Experia --- .../autotests/tools/configure_cots_sony_experia_m4_ue.py | 2 +- cmake_targets/autotests/tools/iperf_script_phone | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py b/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py index 399d10b5b1..eba3156976 100755 --- a/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py @@ -29,7 +29,7 @@ from lib_autotest import * def signal_handler(signal, frame): print('You pressed Ctrl+C!') - print('Resetting the UE to detached state') + print('Exiting now...') timeout=10 exit_flag=1 sys.exit(0) diff --git a/cmake_targets/autotests/tools/iperf_script_phone b/cmake_targets/autotests/tools/iperf_script_phone index 7b4d283c17..25693d13c3 100755 --- a/cmake_targets/autotests/tools/iperf_script_phone +++ b/cmake_targets/autotests/tools/iperf_script_phone @@ -20,7 +20,8 @@ sleep $timeout while true ; do cmd=`sudo adb -s $device_id shell netcfg |grep 192.` if [ -z "$cmd" ]; then - print "Wating for UE to connect and get IP Address..." + echo "Wating for UE to connect and get IP Address..." + sleep 1 else echo "UE is not connected. IP Address settings are... $cmd" break From b5114190906652ae6c16b0b96d96852cd6960d72 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 1 Apr 2016 09:17:37 -0700 Subject: [PATCH 112/214] resolved residual warnings after merge with develop (no warnings again for lte-softmodem) --- .../CODING/3gpplte_turbo_decoder_avx2_16bit.c | 2 +- openair1/PHY/CODING/defs.h | 6 ++ .../lte_dl_mbsfn_channel_estimation.c | 3 +- openair1/PHY/LTE_ESTIMATION/lte_sync_time.c | 15 +++-- openair1/PHY/LTE_TRANSPORT/prach.c | 6 +- openair1/PHY/LTE_TRANSPORT/print_stats.c | 31 +++++++-- openair1/PHY/TOOLS/defs.h | 4 +- openair1/PHY/TOOLS/lte_dfts.c | 66 +++++++++++++------ openair2/LAYER2/MAC/eNB_scheduler.c | 2 +- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 4 +- openair2/LAYER2/PDCP_v10.1.0/pdcp.c | 2 +- openair2/LAYER2/openair2_proc.c | 7 +- openair2/RRC/LITE/proto.h | 2 + openair2/RRC/LITE/rrc_eNB.c | 2 +- targets/RT/USER/lte-ue.c | 2 +- 15 files changed, 104 insertions(+), 50 deletions(-) diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c index 75e8eaf126..5c78dcf96e 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c @@ -1413,6 +1413,6 @@ unsigned char phy_threegpplte_turbo_decoder16avx2(int16_t *y, return(iteration_cnt); } -#endif __AVX2__ +#endif //__AVX2__ diff --git a/openair1/PHY/CODING/defs.h b/openair1/PHY/CODING/defs.h index b14cfb1c24..02d734ac64 100644 --- a/openair1/PHY/CODING/defs.h +++ b/openair1/PHY/CODING/defs.h @@ -303,6 +303,10 @@ void ccodedot11_init(void); \brief This function initializes the trellis structure for decoding an 802.11 convolutional code.*/ void ccodedot11_init_inv(void); +/*!\fn void teillis_table_init(void) +\brief This function initializes the trellis structure for 3GPP LTE Turbo code.*/ +void treillis_table_init(void); + /*\fn void threegpplte_turbo_encoder(uint8_t *input,uint16_t input_length_bytes,uint8_t *output,uint8_t F,uint16_t interleaver_f1,uint16_t interleaver_f2) \brief This function implements a rate 1/3 8-state parralel concatenated turbo code (3GPP-LTE). @param input Pointer to input buffer @@ -353,6 +357,8 @@ void ccodedab_init(void); \brief This function initializes the trellis structure for decoding an DAB convolutional code (first 3 bits).*/ void ccodedab_init_inv(void); + + /*!\fn void crcTableInit(void) \brief This function initializes the different crc tables.*/ void crcTableInit (void); diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c index dbb2ba231f..fd38ebcbff 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c @@ -771,7 +771,8 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *phy_vars_ue, break; case 75: idft1536((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET], - (int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa]); + (int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa], + 1); break; case 100: idft2048((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET], diff --git a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c index eb9547dac0..dfb39a510f 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c @@ -170,12 +170,13 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com case 75: idft1536((short*)syncF_tmp, /// complex input - (short*)sync_tmp); /// complex output + (short*)sync_tmp, + 1); /// complex output break; case 100: idft2048((short*)syncF_tmp, /// complex input - (short*)sync_tmp, /// complex output - 1); + (short*)sync_tmp, /// complex output + 1); break; default: LOG_E(PHY,"Unsupported N_RB_DL %d\n",frame_parms->N_RB_DL); @@ -217,8 +218,8 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com case 75: idft1536((short*)syncF_tmp, /// complex input - (short*)sync_tmp /// complex output - ); + (short*)sync_tmp, /// complex output + 1); break; case 100: idft2048((short*)syncF_tmp, /// complex input @@ -265,8 +266,8 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com case 75: idft1536((short*)syncF_tmp, /// complex input - (short*)sync_tmp /// complex output - ); + (short*)sync_tmp, /// complex output + 1); break; case 100: idft2048((short*)syncF_tmp, /// complex input diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c index e38015b65e..8173f35f67 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach.c +++ b/openair1/PHY/LTE_TRANSPORT/prach.c @@ -898,7 +898,7 @@ int32_t generate_prach( PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id, uint8_t subfra memmove( prach, prach+512, Ncp<<2 ); prach_len = 256+Ncp; } else { - idft1536(prachF,prach2); + idft1536(prachF,prach2,1); memmove( prach, prach+3072, Ncp<<2 ); prach_len = 1536+Ncp; @@ -1338,10 +1338,10 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene if (prach_fmt == 4) { dft256(prach2,rxsigF[aa],1); } else { - dft1536(prach2,rxsigF[aa]); + dft1536(prach2,rxsigF[aa],1); if (prach_fmt>1) - dft1536(prach2+3072,rxsigF[aa]+3072); + dft1536(prach2+3072,rxsigF[aa]+3072,1); } break; diff --git a/openair1/PHY/LTE_TRANSPORT/print_stats.c b/openair1/PHY/LTE_TRANSPORT/print_stats.c index 839bc68190..7445fca40f 100644 --- a/openair1/PHY/LTE_TRANSPORT/print_stats.c +++ b/openair1/PHY/LTE_TRANSPORT/print_stats.c @@ -639,8 +639,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH, dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB, dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB, - PUCCH1_THRES+phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm-dB_fixed(phy_vars_eNB->lte_frame_parms.N_RB_UL), - phy_vars_eNB->eNB_UE_stats[UE_id].sector); + PUCCH1_THRES+phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm-dB_fixed(phy_vars_eNB->lte_frame_parms.N_RB_UL)); len+= sprintf(&buffer[len],"DL mcs %d, UL mcs %d, UL rb %d, delta_TF %d, ", phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[0]->mcs, @@ -688,11 +687,33 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) phy_vars_eNB->eNB_UE_stats[UE_id].sr_total-phy_vars_eNB->eNB_UE_stats[UE_id].sr_received); len += sprintf(&buffer[len],"DL Subband CQI: "); - - for (i=0; i<25; i++) + + int nb_sb; + switch (phy_vars_eNB->lte_frame_parms.N_RB_DL) { + case 6: + nb_sb=0; + break; + case 15: + nb_sb = 4; + case 25: + nb_sb = 7; + break; + case 50: + nb_sb = 9; + break; + case 75: + nb_sb = 10; + break; + case 100: + nb_sb = 13; + break; + default: + nb_sb=0; + break; + } + for (i=0; ieNB_UE_stats[UE_id].DL_subband_cqi[0][i]); - len += sprintf(&buffer[len],"\n"); diff --git a/openair1/PHY/TOOLS/defs.h b/openair1/PHY/TOOLS/defs.h index 963c1384b7..8d30a7ea10 100644 --- a/openair1/PHY/TOOLS/defs.h +++ b/openair1/PHY/TOOLS/defs.h @@ -156,7 +156,7 @@ This function performs optimized fixed-point radix-2 FFT/IFFT. ); */ -void idft1536(int16_t *sigF,int16_t *sig); +void idft1536(int16_t *sigF,int16_t *sig,int scale); void idft6144(int16_t *sigF,int16_t *sig); @@ -168,7 +168,7 @@ void idft3072(int16_t *sigF,int16_t *sig); void idft24576(int16_t *sigF,int16_t *sig); -void dft1536(int16_t *sigF,int16_t *sig); +void dft1536(int16_t *sigF,int16_t *sig,int scale); void dft6144(int16_t *sigF,int16_t *sig); diff --git a/openair1/PHY/TOOLS/lte_dfts.c b/openair1/PHY/TOOLS/lte_dfts.c index 1ff95b5322..3a5a125bc2 100644 --- a/openair1/PHY/TOOLS/lte_dfts.c +++ b/openair1/PHY/TOOLS/lte_dfts.c @@ -5403,7 +5403,7 @@ void idft8192(int16_t *x,int16_t *y,int scale) #include "twiddle1536.h" // 512 x 3 -void idft1536(int16_t *input, int16_t *output) +void idft1536(int16_t *input, int16_t *output, int scale) { int i,i2,j; uint32_t tmp[3][512 ]__attribute__((aligned(32))); @@ -5428,24 +5428,26 @@ void idft1536(int16_t *input, int16_t *output) } - for (i=0; i<24; i++) { - y128p[0] = mulhi_int16(y128p[0],ONE_OVER_SQRT3_Q15_128); - y128p[1] = mulhi_int16(y128p[1],ONE_OVER_SQRT3_Q15_128); - y128p[2] = mulhi_int16(y128p[2],ONE_OVER_SQRT3_Q15_128); - y128p[3] = mulhi_int16(y128p[3],ONE_OVER_SQRT3_Q15_128); - y128p[4] = mulhi_int16(y128p[4],ONE_OVER_SQRT3_Q15_128); - y128p[5] = mulhi_int16(y128p[5],ONE_OVER_SQRT3_Q15_128); - y128p[6] = mulhi_int16(y128p[6],ONE_OVER_SQRT3_Q15_128); - y128p[7] = mulhi_int16(y128p[7],ONE_OVER_SQRT3_Q15_128); - y128p[8] = mulhi_int16(y128p[8],ONE_OVER_SQRT3_Q15_128); - y128p[9] = mulhi_int16(y128p[9],ONE_OVER_SQRT3_Q15_128); - y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT3_Q15_128); - y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT3_Q15_128); - y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT3_Q15_128); - y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT3_Q15_128); - y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT3_Q15_128); - y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT3_Q15_128); - y128p+=16; + if (scale==1) { + for (i=0; i<24; i++) { + y128p[0] = mulhi_int16(y128p[0],ONE_OVER_SQRT3_Q15_128); + y128p[1] = mulhi_int16(y128p[1],ONE_OVER_SQRT3_Q15_128); + y128p[2] = mulhi_int16(y128p[2],ONE_OVER_SQRT3_Q15_128); + y128p[3] = mulhi_int16(y128p[3],ONE_OVER_SQRT3_Q15_128); + y128p[4] = mulhi_int16(y128p[4],ONE_OVER_SQRT3_Q15_128); + y128p[5] = mulhi_int16(y128p[5],ONE_OVER_SQRT3_Q15_128); + y128p[6] = mulhi_int16(y128p[6],ONE_OVER_SQRT3_Q15_128); + y128p[7] = mulhi_int16(y128p[7],ONE_OVER_SQRT3_Q15_128); + y128p[8] = mulhi_int16(y128p[8],ONE_OVER_SQRT3_Q15_128); + y128p[9] = mulhi_int16(y128p[9],ONE_OVER_SQRT3_Q15_128); + y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT3_Q15_128); + y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT3_Q15_128); + y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT3_Q15_128); + y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT3_Q15_128); + y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT3_Q15_128); + y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT3_Q15_128); + y128p+=16; + } } _mm_empty(); @@ -5453,11 +5455,13 @@ void idft1536(int16_t *input, int16_t *output) } -void dft1536(int16_t *input, int16_t *output) +void dft1536(int16_t *input, int16_t *output, int scale) { int i,i2,j; uint32_t tmp[3][512] __attribute__((aligned(32))); uint32_t tmpo[3][512] __attribute__((aligned(32))); + simd_q15_t *y128p=(simd_q15_t*)output; + simd_q15_t ONE_OVER_SQRT3_Q15_128 = set1_int16(ONE_OVER_SQRT3_Q15); for (i=0,j=0; i<512; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -5485,6 +5489,28 @@ void dft1536(int16_t *input, int16_t *output) (simd_q15_t*)(twa1536+i),(simd_q15_t*)(twb1536+i)); } + if (scale==1) { + for (i=0; i<24; i++) { + y128p[0] = mulhi_int16(y128p[0],ONE_OVER_SQRT3_Q15_128); + y128p[1] = mulhi_int16(y128p[1],ONE_OVER_SQRT3_Q15_128); + y128p[2] = mulhi_int16(y128p[2],ONE_OVER_SQRT3_Q15_128); + y128p[3] = mulhi_int16(y128p[3],ONE_OVER_SQRT3_Q15_128); + y128p[4] = mulhi_int16(y128p[4],ONE_OVER_SQRT3_Q15_128); + y128p[5] = mulhi_int16(y128p[5],ONE_OVER_SQRT3_Q15_128); + y128p[6] = mulhi_int16(y128p[6],ONE_OVER_SQRT3_Q15_128); + y128p[7] = mulhi_int16(y128p[7],ONE_OVER_SQRT3_Q15_128); + y128p[8] = mulhi_int16(y128p[8],ONE_OVER_SQRT3_Q15_128); + y128p[9] = mulhi_int16(y128p[9],ONE_OVER_SQRT3_Q15_128); + y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT3_Q15_128); + y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT3_Q15_128); + y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT3_Q15_128); + y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT3_Q15_128); + y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT3_Q15_128); + y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT3_Q15_128); + y128p+=16; + } + } + _mm_empty(); _m_empty(); diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 160b8f9f5c..80190fe172 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -99,7 +99,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list; rnti_t rnti; void *DLSCH_dci=NULL; - int size_bits,size_bytes; + int size_bits=0,size_bytes=0; LOG_D(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler (UE_list->head %d)\n",module_idP, frameP, subframeP,UE_list->head); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index f6f45f8cf1..d68f26370b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -401,7 +401,7 @@ void rx_sdu( if (UE_id != -1) { // adjust buffer occupancy of the correponding logical channel group if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] >= rx_lengths[i]) - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] - rx_lengths[i]; + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] -= rx_lengths[i]; else UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0; @@ -451,7 +451,7 @@ void rx_sdu( UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]]); if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] >= rx_lengths[i]) - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] - rx_lengths[i]; + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] -= rx_lengths[i]; else UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0; diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index 1b949dc0de..495eb78ac9 100755 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -45,7 +45,7 @@ #include "pdcp_sequence_manager.h" #include "LAYER2/RLC/rlc.h" #include "LAYER2/MAC/extern.h" -#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" +#include "RRC/LITE/proto.h" #include "pdcp_primitives.h" #include "OCG.h" #include "OCG_extern.h" diff --git a/openair2/LAYER2/openair2_proc.c b/openair2/LAYER2/openair2_proc.c index 7bbe3177a8..8daa8afb70 100644 --- a/openair2/LAYER2/openair2_proc.c +++ b/openair2/LAYER2/openair2_proc.c @@ -201,11 +201,8 @@ int dump_eNB_l2_stats(char *buffer, int length) UE_list->eNB_UE_stats[CC_id][UE_id].avg_overhead_bytes ); -<<<<<<< HEAD - len += sprintf(&buffer[len],"[MAC] UE %d (ULSCH), Status %d, Failute timer %d, RNTI %x : rx power (normalized %d, target %d), MCS (pre %d, post %d), RB (rx %d, retx %d, total %d), Current TBS %d \n", -======= - len += sprintf(&buffer[len],"[MAC] UE %d (ULSCH), Status %s, RNTI %x : rx power (normalized %d, target %d), MCS (pre %d, post %d), RB (rx %d, retx %d, total %d), Current TBS %d \n", ->>>>>>> origin/develop + + len += sprintf(&buffer[len],"[MAC] UE %d (ULSCH), Status %s, Failute timer %d, RNTI %x : rx power (normalized %d, target %d), MCS (pre %d, post %d), RB (rx %d, retx %d, total %d), Current TBS %d \n", UE_id, map_int_to_str(rrc_status_names, UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status), UE_list->UE_sched_ctrl[UE_id].ul_failure_timer, diff --git a/openair2/RRC/LITE/proto.h b/openair2/RRC/LITE/proto.h index d14b129479..7b316ce953 100644 --- a/openair2/RRC/LITE/proto.h +++ b/openair2/RRC/LITE/proto.h @@ -38,6 +38,8 @@ * @{ */ +#include "RRC/LITE/defs.h" + //main.c int rrc_init_global_param(void); int L3_xface_init(void); diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index a89943dbcd..e67f0af0d3 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -841,7 +841,7 @@ rrc_eNB_free_UE(const module_id_t enb_mod_idP,const struct rrc_eNB_ue_context_s* rrc_eNB_remove_ue_context( &ctxt, &eNB_rrc_inst[enb_mod_idP], - ue_context_pP); + (struct rrc_eNB_ue_context_s*) ue_context_pP); } } diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index d2950678cc..68c1a44b2a 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -501,7 +501,7 @@ static void *UE_thread_synch(void *arg) if (abs(freq_offset) > 7500) { LOG_I( PHY, "[initial_sync] No cell synchronization found, abandoning\n" ); FILE *fd; - if (fd = fopen("rxsig_frame0.dat","w")) { + if ((fd = fopen("rxsig_frame0.dat","w"))!=NULL) { fwrite((void*)&UE->lte_ue_common_vars.rxdata[0][0], sizeof(int32_t), 10*UE->lte_frame_parms.samples_per_tti, From 85bb9813a248c4cbc25beec9f6119449dc347d15 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 1 Apr 2016 18:36:24 +0200 Subject: [PATCH 113/214] addition of Sony Experia M4 tests in xml file --- cmake_targets/autotests/test_case_list.xml | 40 ++++++++++++---------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index d8bdb34c8e..3941f12532 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -6070,7 +6070,7 @@ False - sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue /tmp @@ -6138,14 +6138,14 @@ - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue + sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 False - sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue /tmp @@ -6212,14 +6212,14 @@ - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue + sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 False - sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue /tmp @@ -6286,13 +6286,14 @@ - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue + sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + + False - sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue - throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue /tmp @@ -6355,17 +6356,18 @@ /tmp + - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue + sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 - throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec + False - sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue /tmp @@ -6432,14 +6434,14 @@ - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue + sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 - throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec + False - sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue /tmp From 08c688dc6d8c8728e31c4d3363c901622d61dfe9 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 1 Apr 2016 18:38:57 +0200 Subject: [PATCH 114/214] blacklisting 20MHz test cases on EXMIMO in test setup --- cmake_targets/autotests/test_case_list.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 3941f12532..d2b2d4972c 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -10,7 +10,7 @@ sudo -S -E /opt/ltebox/tools/stop_ltebox $OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; uname -a; dmesg|tail 36000 - 0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 016502 016505 0170+ 017502 017505 018002 018005 018502 018505 + 0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 016102 016105 016502 016505 0170+ 017502 017505 018002 018005 018502 018505 025502 025505 3 mozart calisson stevens nano amerique From 944720d26d24aa41ea92b9ea63c96773afe7b0bf Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sat, 2 Apr 2016 12:22:27 +0200 Subject: [PATCH 115/214] 8bit LLR on ULSCH decoding --- openair1/SCHED/phy_procedures_lte_eNb.c | 4 ++-- .../GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf | 4 ++-- .../PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 4db22e234f..8d40196c36 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -2539,7 +2539,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ sched_subframe, 0, // control_only_flag phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->V_UL_DAI, - 0);//phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb>20 ? 1 : 0); + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb>20 ? 1 : 0); } #ifdef PHY_ABSTRACTION @@ -3312,7 +3312,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ sched_subframe, 0, // control_only_flag phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->V_UL_DAI, - 0);//phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb>20 ? 1 : 0); + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb>20 ? 1 : 0); } #ifdef PHY_ABSTRACTION diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index d5d1f0d78a..ea92db22fa 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -140,10 +140,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf index 985017e8d5..7839a52d21 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf @@ -143,10 +143,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; From ce454d646f8c98f2475759612f2118a560b3c0c0 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sat, 2 Apr 2016 18:24:33 +0200 Subject: [PATCH 116/214] unitary simulations after ./build_oai -s --- openair1/SIMULATION/LTE_PHY/dlsim.c | 1 - openair1/SIMULATION/LTE_PHY/mbmssim.c | 1 - openair1/SIMULATION/LTE_PHY/pbchsim.c | 1 - openair1/SIMULATION/LTE_PHY/pdcchsim.c | 1 - openair1/SIMULATION/LTE_PHY/prachsim.c | 15 ------- openair1/SIMULATION/LTE_PHY/pucchsim.c | 54 -------------------------- openair1/SIMULATION/LTE_PHY/ulsim.c | 1 - 7 files changed, 74 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index d877a581d1..50afd8bcef 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -48,7 +48,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/vars.h" -#include "MAC_INTERFACE/vars.h" #include "SCHED/defs.h" #include "SCHED/vars.h" diff --git a/openair1/SIMULATION/LTE_PHY/mbmssim.c b/openair1/SIMULATION/LTE_PHY/mbmssim.c index 8522b7be9a..8b6e4f937e 100644 --- a/openair1/SIMULATION/LTE_PHY/mbmssim.c +++ b/openair1/SIMULATION/LTE_PHY/mbmssim.c @@ -38,7 +38,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/vars.h" -#include "MAC_INTERFACE/vars.h" #ifdef EMOS #include "SCHED/phy_procedures_emos.h" #endif diff --git a/openair1/SIMULATION/LTE_PHY/pbchsim.c b/openair1/SIMULATION/LTE_PHY/pbchsim.c index 739c7e121f..e99da5041b 100644 --- a/openair1/SIMULATION/LTE_PHY/pbchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pbchsim.c @@ -38,7 +38,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/vars.h" -#include "MAC_INTERFACE/vars.h" #ifdef EMOS #include "SCHED/phy_procedures_emos.h" diff --git a/openair1/SIMULATION/LTE_PHY/pdcchsim.c b/openair1/SIMULATION/LTE_PHY/pdcchsim.c index 0c51959f14..b87711348f 100644 --- a/openair1/SIMULATION/LTE_PHY/pdcchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pdcchsim.c @@ -34,7 +34,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/vars.h" -#include "MAC_INTERFACE/vars.h" #ifdef EMOS #include "SCHED/phy_procedures_emos.h" diff --git a/openair1/SIMULATION/LTE_PHY/prachsim.c b/openair1/SIMULATION/LTE_PHY/prachsim.c index 796cb8eb81..37fc3a6a10 100644 --- a/openair1/SIMULATION/LTE_PHY/prachsim.c +++ b/openair1/SIMULATION/LTE_PHY/prachsim.c @@ -34,10 +34,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/vars.h" -#include "MAC_INTERFACE/vars.h" -#ifdef IFFT_FPGA -#include "PHY/LTE_REFSIG/mod_table.h" -#endif #ifdef EMOS #include "SCHED/phy_procedures_emos.h" #endif @@ -70,9 +66,6 @@ int main(int argc, char **argv) uint8_t snr1set=0; uint8_t ue_speed1set=0; //mod_sym_t **txdataF; -#ifdef IFFT_FPGA - int **txdataF2; -#endif int **txdata; double **s_re,**s_im,**r_re,**r_im; double iqim=0.0; @@ -554,14 +547,6 @@ int main(int argc, char **argv) // printf("(%f,%f)\n",SNR,(double)prach_errors/(double)n_frames); } //SNR loop -#ifdef IFFT_FPGA - free(txdataF2[0]); - free(txdataF2[1]); - free(txdataF2); - free(txdata[0]); - free(txdata[1]); - free(txdata); -#endif for (i=0; i<2; i++) { free(s_re[i]); diff --git a/openair1/SIMULATION/LTE_PHY/pucchsim.c b/openair1/SIMULATION/LTE_PHY/pucchsim.c index 42de78ac74..fa96ac5843 100644 --- a/openair1/SIMULATION/LTE_PHY/pucchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pucchsim.c @@ -34,10 +34,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/vars.h" -#include "MAC_INTERFACE/vars.h" -#ifdef IFFT_FPGA -#include "PHY/LTE_REFSIG/mod_table.h" -#endif #ifdef EMOS #include "SCHED/phy_procedures_emos.h" #endif @@ -67,9 +63,6 @@ int main(int argc, char **argv) double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1=0.0; uint8_t snr1set=0; //mod_sym_t **txdataF; -#ifdef IFFT_FPGA - int **txdataF2; -#endif int **txdata; double **s_re,**s_im,**r_re,**r_im; double ricean_factor=0.0000005,iqim=0.0; @@ -338,23 +331,7 @@ int main(int argc, char **argv) frame_parms = &PHY_vars_eNB->lte_frame_parms; -#ifdef IFFT_FPGA - txdata = (int **)malloc16(2*sizeof(int*)); - txdata[0] = (int *)malloc16(FRAME_LENGTH_BYTES); - txdata[1] = (int *)malloc16(FRAME_LENGTH_BYTES); - - bzero(txdata[0],FRAME_LENGTH_BYTES); - bzero(txdata[1],FRAME_LENGTH_BYTES); - - txdataF2 = (int **)malloc16(2*sizeof(int*)); - txdataF2[0] = (int *)malloc16(FRAME_LENGTH_BYTES_NO_PREFIX); - txdataF2[1] = (int *)malloc16(FRAME_LENGTH_BYTES_NO_PREFIX); - - bzero(txdataF2[0],FRAME_LENGTH_BYTES_NO_PREFIX); - bzero(txdataF2[1],FRAME_LENGTH_BYTES_NO_PREFIX); -#else txdata = PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id]; -#endif s_re = malloc(2*sizeof(double*)); s_im = malloc(2*sizeof(double*)); @@ -420,27 +397,6 @@ int main(int argc, char **argv) &pucch_payload, AMP, //amp, subframe); //subframe -#ifdef IFFT_FPGA_UE - tx_lev=0; - - for (aa=0; aanb_antennas_tx; aa++) { - - if (frame_parms->Ncp == 1) - PHY_ofdm_mod(txdataF2[aa], // input - txdata[aa], // output - frame_parms->ofdm_symbol_size, - 2*nsymb, // number of symbols - frame_parms->nb_prefix_samples, // number of prefix samples - CYCLIC_PREFIX); - else - normal_prefix_mod(txdataF2[aa],txdata[aa],2*nsymb,frame_parms); - } - - tx_lev += signal_energy(&txdata[aa][OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES], - OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES); - -#else - write_output("txsigF0.m","txsF0", &PHY_vars_UE->lte_ue_common_vars.txdataF[0][2*subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX*nsymb,1,1); tx_lev = 0; @@ -472,7 +428,6 @@ int main(int argc, char **argv) OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES); } -#endif write_output("txsig0.m","txs0", txdata[0], FRAME_LENGTH_COMPLEX_SAMPLES,1,1); @@ -655,15 +610,6 @@ int main(int argc, char **argv) } -#ifdef IFFT_FPGA - free(txdataF2[0]); - free(txdataF2[1]); - free(txdataF2); - free(txdata[0]); - free(txdata[1]); - free(txdata); -#endif - for (i=0; i<2; i++) { free(s_re[i]); free(s_im[i]); diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 4117ac1a7d..440a5ec567 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -45,7 +45,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/vars.h" -#include "MAC_INTERFACE/vars.h" #include "SCHED/defs.h" #include "SCHED/vars.h" From b48c64d461d1a95e6ca9a5ced72435ad20b14d5b Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 4 Apr 2016 12:34:16 +0200 Subject: [PATCH 117/214] fixes to free memory in test setup --- .../autotests/run_exec_autotests.bash | 5 +- cmake_targets/autotests/test_case_list.xml | 534 +++++++++--------- 2 files changed, 271 insertions(+), 268 deletions(-) diff --git a/cmake_targets/autotests/run_exec_autotests.bash b/cmake_targets/autotests/run_exec_autotests.bash index 1029acc1e6..6587839c8f 100755 --- a/cmake_targets/autotests/run_exec_autotests.bash +++ b/cmake_targets/autotests/run_exec_autotests.bash @@ -111,6 +111,8 @@ function test_compile() { compile_log_dir=`eval echo \"$OPENAIR_DIR/cmake_targets/log/\"` echo "Removing compilation log files in $compile_log_dir" rm -frv $compile_log_dir + echo "Executing $pre_exec_file $pre_exe_args ...." + eval $pre_exec_file $pre_exec_args echo "Executing $compile_prog $compile_prog_args ...." eval $compile_prog $compile_prog_args echo "Copying compilation log files to test case log directory: $log_dir" @@ -280,7 +282,7 @@ function test_compile_and_run() { if [ -n "$pre_exec_file" ]; then { echo " Executing $pre_exec_file $pre_exec_args " - eval " echo '$mypassword' |sudo -S -E $pre_exec_file $pre_exec_args " ; }>> $temp_exec_log 2>&1 + eval " $pre_exec_file $pre_exec_args " ; }>> $temp_exec_log 2>&1 fi echo "Executing $main_exec $main_exec_args_array_index " @@ -503,6 +505,7 @@ for search_expr in "${test_case_array[@]}" echo "search_expr_false = $search_expr_false" echo "nruns = $nruns" + #eval $pre_exec compile_prog_out=`eval echo \"$compile_prog_out\"` diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index d2b2d4972c..6d7e2a72f3 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -23,7 +23,7 @@ $OPENAIR_DIR/cmake_targets/at_commands/build/at_nas_ue $OPENAIR_DIR/cmake_targets/nas_sim_tools/build/usim $OPENAIR_DIR/cmake_targets/nas_sim_tools/build/nvram - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash @@ -43,7 +43,7 @@ $OPENAIR_DIR/cmake_targets/at_commands/build/at_nas_ue $OPENAIR_DIR/cmake_targets/nas_sim_tools/build/usim $OPENAIR_DIR/cmake_targets/nas_sim_tools/build/nvram - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash @@ -63,7 +63,7 @@ $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/rb_tool $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/CMakeFiles/nasmesh/nasmesh.ko $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/CMakeFiles/oai_nw_drv/oai_nw_drv.ko - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash @@ -83,7 +83,7 @@ $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/rb_tool $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/CMakeFiles/nasmesh/nasmesh.ko $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/liboai_usrpdevif.so - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash @@ -105,7 +105,7 @@ $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/CMakeFiles/openair_rf/openair_rf.ko $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/updatefw $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/oarf_config_exmimo.oct - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash @@ -125,7 +125,7 @@ $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/rb_tool $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/CMakeFiles/nasmesh/nasmesh.ko $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/liboai_bladerfdevif.so - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash @@ -145,7 +145,7 @@ $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/rb_tool $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/CMakeFiles/nasmesh/nasmesh.ko $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/liboai_eth_transpro.so - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash @@ -165,7 +165,7 @@ --eNB -w USRP -r Rel10 -c $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem $OPENAIR_DIR/cmake_targets/lte_build_oai/build/liboai_usrpdevif.so - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash @@ -185,7 +185,7 @@ $OPENAIR_DIR/cmake_targets/lte_build_oai/build/CMakeFiles/openair_rf/openair_rf.ko $OPENAIR_DIR/cmake_targets/lte_build_oai/build/updatefw $OPENAIR_DIR/cmake_targets/lte_build_oai/build/oarf_config_exmimo.oct - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash @@ -203,7 +203,7 @@ --eNB -w BLADERF -r Rel10 -c $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem $OPENAIR_DIR/cmake_targets/lte_build_oai/build/liboai_bladerfdevif.so - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash @@ -221,7 +221,7 @@ --eNB -w None -t ETHERNET -r Rel10 -c $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem $OPENAIR_DIR/cmake_targets/lte_build_oai/build/liboai_eth_transpro.so - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash @@ -254,7 +254,7 @@ $OPENAIR_DIR/cmake_targets/lte-simulators/build/test_kdf $OPENAIR_DIR/cmake_targets/lte-simulators/build/test_aes128_cmac_encrypt $OPENAIR_DIR/cmake_targets/lte-simulators/build/test_secu_knas_encrypt_eia2 - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash @@ -274,7 +274,7 @@ $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_usrpdevif.so $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_eth_transpro.so - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash @@ -296,7 +296,7 @@ $OPENAIR_DIR/cmake_targets/rrh_gw/build/oarf_config_exmimo.oct $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_exmimodevif.so $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_eth_transpro.so - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash @@ -315,7 +315,7 @@ $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_bladerfdevif.so $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_eth_transpro.so - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash @@ -332,7 +332,7 @@ cp -vf $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf $OPENAIR_DIR/cmake_targets/build_oai --oaisim --noS1 -c - $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1 @@ -355,7 +355,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --oaisim --noS1 -c - $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1 -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1 -a -s15 @@ -377,7 +377,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --oaisim --noS1 -c - $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1 -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -s15 @@ -399,7 +399,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --oaisim --noS1 -c - $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1 -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -a -s15 @@ -420,7 +420,7 @@ cp -vf $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf $OPENAIR_DIR/cmake_targets/build_oai --oaisim --noS1 -c - $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1 @@ -442,7 +442,7 @@ cp -vf $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf $OPENAIR_DIR/cmake_targets/build_oai --oaisim --noS1 -c - $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1 @@ -464,7 +464,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --oaisim --noS1 -c - $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1 -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1 -F -s15 @@ -485,7 +485,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --oaisim --noS1 -c - $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1 -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1 -F -a -s15 @@ -506,7 +506,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --oaisim --noS1 -c - $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1 -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -F -s15 @@ -527,7 +527,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --oaisim --noS1 -c - $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1 -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -F -a -s15 @@ -548,7 +548,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --oaisim --noS1 -c - $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1 -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1 -F -c26 @@ -569,7 +569,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --oaisim --noS1 -c - $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1 -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1 -F -c26 -a @@ -590,7 +590,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --oaisim --noS1 -c - $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1 -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -l7 -x 1 -Q3 -n 100 -b1 -u1 @@ -606,7 +606,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --oaisim --noS1 -c - $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1 -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -l7 -x 1 -T mscbr -Q3 -n 100 -b1 -u1 @@ -622,7 +622,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --oaisim --noS1 -c - $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1 -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -l7 -F -T mscbr -x 1 -Q3 -n 100 -b1 -u1 @@ -638,7 +638,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --oaisim --noS1 -c - $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1 -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -l7 -c43 -F -T mbvbr -Q4 -j1 -n120 @@ -654,7 +654,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --core_simulators -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte-simulators/build/test_aes128_cmac_encrypt --verbose @@ -670,7 +670,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --core_simulators -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte-simulators/build/test_aes128_ctr_decrypt --verbose @@ -686,7 +686,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --core_simulators -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte-simulators/build/test_aes128_ctr_encrypt --verbose @@ -702,7 +702,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --core_simulators -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte-simulators/build/test_secu_kenb --verbose @@ -718,7 +718,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --core_simulators -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte-simulators/build/test_secu_knas --verbose @@ -734,7 +734,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --core_simulators -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte-simulators/build/test_secu_knas_encrypt_eea1 --verbose @@ -750,7 +750,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --core_simulators -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte-simulators/build/test_secu_knas_encrypt_eea2 --verbose @@ -766,7 +766,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --core_simulators -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte-simulators/build/test_secu_knas_encrypt_eia1 --verbose @@ -782,7 +782,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --core_simulators -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte-simulators/build/test_secu_knas_encrypt_eia1 --verbose @@ -798,7 +798,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --core_simulators -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte-simulators/build/test_kdf --verbose @@ -825,7 +825,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --phy_simulators -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte-simulators/build/dlsim -m5 -gF -s-1 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70 -L @@ -856,7 +856,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --phy_simulators -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte-simulators/build/ulsim -B25 -m5 -y1 -gN -x1 -s6 -w1.0 -e.1 -P -n500 -O70 -L @@ -898,7 +898,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -912,7 +912,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -930,7 +930,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -973,7 +973,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -987,7 +987,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -1005,7 +1005,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -1047,7 +1047,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -1061,7 +1061,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -1079,7 +1079,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -1121,7 +1121,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -1135,7 +1135,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -1153,7 +1153,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -1194,7 +1194,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -1207,7 +1207,7 @@ /tmp - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -1226,7 +1226,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -1267,7 +1267,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -1281,7 +1281,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -1300,7 +1300,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -1342,7 +1342,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -1356,7 +1356,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue;$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -1374,7 +1374,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -1417,7 +1417,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -1430,7 +1430,7 @@ /tmp > - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue;$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -1448,7 +1448,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -1490,7 +1490,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -1504,7 +1504,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -1522,7 +1522,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -1564,7 +1564,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -1578,7 +1578,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -1597,7 +1597,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -1638,7 +1638,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -1652,7 +1652,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -1671,7 +1671,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -1712,7 +1712,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -1726,7 +1726,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -1745,7 +1745,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -1788,7 +1788,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -1802,7 +1802,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -1829,7 +1829,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth5 add 192.172.0.1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth5 add 192.172.0.1 $OPENAIRCN_DIR/SCRIPTS/run_epc -i -r @@ -1872,7 +1872,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -1886,7 +1886,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -1913,7 +1913,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth5 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -i -r @@ -1956,7 +1956,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -1970,7 +1970,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -1997,7 +1997,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth5 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth5 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -i -r @@ -2040,7 +2040,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -2054,7 +2054,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -2081,7 +2081,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth5 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -i -r @@ -2124,7 +2124,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -2138,7 +2138,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -2165,7 +2165,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth5 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -i -r @@ -2208,7 +2208,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -2222,7 +2222,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -2249,7 +2249,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth5 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -i -r @@ -2292,7 +2292,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches'; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -2306,7 +2306,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -2334,7 +2334,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth0 add 192.172.0.1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1 $OPENAIRCN_DIR/SCRIPTS/run_epc -r @@ -2377,7 +2377,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -2391,7 +2391,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -2418,7 +2418,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -r @@ -2461,7 +2461,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0:3 192.170.0.2 up ; sudo -E ifconfig eth0:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0:3 192.170.0.2 up ; sudo -E ifconfig eth0:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -2475,7 +2475,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -2502,7 +2502,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -r @@ -2545,7 +2545,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -2559,7 +2559,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -2586,7 +2586,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -r @@ -2629,7 +2629,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -2643,7 +2643,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -2670,7 +2670,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -r @@ -2713,7 +2713,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -2727,7 +2727,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -2754,7 +2754,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ;cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ;cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -r @@ -2795,7 +2795,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf -W @@ -2808,7 +2808,7 @@ /tmp - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -2826,7 +2826,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -2867,7 +2867,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf -W @@ -2880,7 +2880,7 @@ /tmp - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -2898,7 +2898,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -2938,7 +2938,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf -W @@ -2952,7 +2952,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -2970,7 +2970,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -3010,7 +3010,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf -W @@ -3024,7 +3024,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -3042,7 +3042,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -3081,7 +3081,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf -W @@ -3095,7 +3095,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -3113,7 +3113,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -3166,7 +3166,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -3184,7 +3184,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -3226,7 +3226,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - sleep 15; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf -W @@ -3240,7 +3240,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -3267,7 +3267,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -r @@ -3309,7 +3309,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - sleep 15; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf -W @@ -3323,7 +3323,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -3350,7 +3350,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -r @@ -3390,7 +3390,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - sleep 15; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf -W @@ -3404,7 +3404,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -3431,7 +3431,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth0 add 192.172.0.1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1 $OPENAIRCN_DIR/SCRIPTS/run_epc -r @@ -3471,7 +3471,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - sleep 15; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf -W @@ -3485,7 +3485,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -3512,7 +3512,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -r @@ -3552,7 +3552,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - sleep 15; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf -W @@ -3566,7 +3566,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -3593,7 +3593,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf $OPENAIRCN_DIR/SCRIPTS/run_epc -r @@ -3633,7 +3633,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - sleep 15; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf -W @@ -3647,7 +3647,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -3674,7 +3674,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -r @@ -3714,7 +3714,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2; dmesg|tail + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -3727,7 +3727,7 @@ /tmp - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -3745,7 +3745,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -3786,7 +3786,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -3800,7 +3800,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -3818,7 +3818,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -3858,7 +3858,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -3872,7 +3872,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -3890,7 +3890,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -3930,7 +3930,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -3944,7 +3944,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -3962,7 +3962,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -4001,7 +4001,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -4015,7 +4015,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -4033,7 +4033,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -4072,7 +4072,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -4086,7 +4086,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -4104,7 +4104,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -4145,7 +4145,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - sleep 15; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf + sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -4160,7 +4160,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -4187,7 +4187,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth0 add 192.172.0.1 ;cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1 ;cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -r @@ -4229,7 +4229,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - sleep 15; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -4243,7 +4243,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -4270,7 +4270,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -r @@ -4310,7 +4310,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - sleep 15; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf + sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -4324,7 +4324,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -4351,7 +4351,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -r @@ -4391,7 +4391,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - sleep 15; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf + sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -4405,7 +4405,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -4432,7 +4432,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ;cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ;cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -r @@ -4472,7 +4472,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - sleep 15; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf + sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -4486,7 +4486,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -4513,7 +4513,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in $OPENAIRCN_DIR/SCRIPTS/run_epc -r @@ -4553,7 +4553,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - sleep 15; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -4567,7 +4567,7 @@ - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -4594,7 +4594,7 @@ $OPENAIRCN_DIR/SCRIPTS/build_hss -c -l --debug --random false - sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 $OPENAIRCN_DIR/SCRIPTS/run_epc -r @@ -4638,7 +4638,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w BLADERF -x -c - sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W @@ -4652,7 +4652,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -4670,7 +4670,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -4714,7 +4714,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w BLADERF -x -c - sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W @@ -4728,7 +4728,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -4746,7 +4746,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -4789,7 +4789,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w BLADERF -x -c - sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W @@ -4803,7 +4803,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -4821,7 +4821,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -4864,7 +4864,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w BLADERF -x -c - sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W @@ -4878,7 +4878,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -4896,7 +4896,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -4938,7 +4938,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w BLADERF -x -c - sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W @@ -4951,7 +4951,7 @@ /tmp - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -4970,7 +4970,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -5012,7 +5012,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w BLADERF -x -c - sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W @@ -5026,7 +5026,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -5045,7 +5045,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -5087,7 +5087,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w LMSSDR -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W @@ -5101,7 +5101,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -5119,7 +5119,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -5163,7 +5163,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w LMSSDR -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W @@ -5177,7 +5177,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -5195,7 +5195,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -5238,7 +5238,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w LMSSDR -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W @@ -5252,7 +5252,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -5270,7 +5270,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -5313,7 +5313,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w LMSSDR -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W @@ -5327,7 +5327,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -5345,7 +5345,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -5387,7 +5387,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w LMSSDR -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W @@ -5400,7 +5400,7 @@ /tmp - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -5419,7 +5419,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -5461,7 +5461,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w LMSSDR -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W @@ -5475,7 +5475,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -5494,7 +5494,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -5538,7 +5538,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=70;tx_scheduling_advance=9;rrh_gw_active=\"yes\";" $OPENAIR_DIR/cmake_targets/build_oai --eNB -w None -t ETHERNET -x -c --disable-deadline - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf -W @@ -5550,7 +5550,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --RRH -w USRP -t ETHERNET -c --disable-deadline - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw -n1 -x -m1 -i eth1 @@ -5562,7 +5562,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -5580,7 +5580,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -5626,7 +5626,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=113;tx_scheduling_advance=9;rrh_gw_active=\"yes\";" $OPENAIR_DIR/cmake_targets/build_oai --eNB -w None -t ETHERNET -x -c --disable-deadline - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf -W @@ -5638,7 +5638,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --RRH -w USRP -t ETHERNET -c --disable-deadline - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw -n1 -x -m1 -i eth1 @@ -5648,7 +5648,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -5666,7 +5666,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -5711,7 +5711,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=115;tx_scheduling_advance=11;rrh_gw_active=\"yes\";" $OPENAIR_DIR/cmake_targets/build_oai --eNB -w None -t ETHERNET -x -c --disable-deadline - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf -W @@ -5723,7 +5723,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --RRH -w USRP -t ETHERNET -c --disable-deadline - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw -n1 -x -m1 -i eth1 @@ -5733,7 +5733,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -5751,7 +5751,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -5796,7 +5796,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=70;tx_scheduling_advance=9;rrh_gw_active=\"yes\";" $OPENAIR_DIR/cmake_targets/build_oai --eNB -w None -t ETHERNET -x -c --disable-deadline - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf -W @@ -5808,7 +5808,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --RRH -w USRP -t ETHERNET -c --disable-deadline - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw -n1 -x -m1 -i eth1 @@ -5818,7 +5818,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -5836,7 +5836,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -5880,7 +5880,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=113;tx_scheduling_advance=9;rrh_gw_active=\"yes\";" $OPENAIR_DIR/cmake_targets/build_oai --eNB -w None -t ETHERNET -x -c --disable-deadline - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf -W @@ -5892,7 +5892,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --RRH -w USRP -t ETHERNET -c --disable-deadline - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw -n1 -x -m1 -i eth1 @@ -5901,7 +5901,7 @@ /tmp - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -5920,7 +5920,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -5964,7 +5964,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=115;tx_scheduling_advance=11;rrh_gw_active=\"yes\";" $OPENAIR_DIR/cmake_targets/build_oai --eNB -w None -t ETHERNET -x -c --disable-deadline - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sleep 5; $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf -W @@ -5976,7 +5976,7 @@ $OPENAIR_DIR/cmake_targets/build_oai --RRH -w USRP -t ETHERNET -c --disable-deadline - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw -n1 -x -m1 -i eth1 @@ -5986,7 +5986,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue @@ -6005,7 +6005,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -6047,7 +6047,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -6061,7 +6061,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue @@ -6079,7 +6079,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -6122,7 +6122,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -6136,7 +6136,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue @@ -6154,7 +6154,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -6196,7 +6196,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -6210,7 +6210,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue @@ -6228,7 +6228,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -6270,7 +6270,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -6284,11 +6284,11 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -s -i 1 -u -f m -B 192.172.0.2 @@ -6303,7 +6303,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -6344,7 +6344,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -6358,11 +6358,11 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1 -u -f m -B 192.172.0.2 @@ -6377,7 +6377,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 @@ -6418,7 +6418,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W @@ -6432,11 +6432,11 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1 -u -f m -B 192.172.0.2 @@ -6451,7 +6451,7 @@ - + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash /opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000 From 9eec54ae8fc1faa0158094ef19b85b9f44ca5390 Mon Sep 17 00:00:00 2001 From: Navid Nikaein Date: Mon, 4 Apr 2016 12:56:31 +0200 Subject: [PATCH 118/214] check if /proc/cpuinfo file exist in CMakeLists.txt --- cmake_targets/CMakeLists.txt | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index feee27bce7..51d779fa59 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -132,16 +132,19 @@ Message("Architecture is ${CMAKE_SYSTEM_PROCESSOR}") if (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l") set(C_FLAGS_PROCESSOR "-gdwarf-2 -mfloat-abi=hard -mfpu=neon -lgcc -lrt") else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l") - file(STRINGS "/proc/cpuinfo" CPUINFO REGEX flags LIMIT_COUNT 1) - #Message("CPUINFO is ${CPUINFO}") - if (CPUINFO MATCHES "avx2") - set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2") - endif() - if (CPUINFO MATCHES "sse4_1") - set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1") - endif() - if (CPUINFO MATCHES "ssse3") - set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3") + if(EXISTS "/proc/cpuinfo") + file(STRINGS "/proc/cpuinfo" CPUINFO REGEX flags LIMIT_COUNT 1) + if (CPUINFO MATCHES "avx2") + set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2") + endif() + if (CPUINFO MATCHES "sse4_1") + set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1") + endif() + if (CPUINFO MATCHES "ssse3") + set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3") + endif() + else() + Message("/proc/cpuinfo does not exit. We will use manual CPU flags") endif() endif() @@ -151,7 +154,7 @@ Message("C_FLAGS_PROCESSOR is ${C_FLAGS_PROCESSOR}") if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86") if ( (NOT( C_FLAGS_PROCESSOR MATCHES "ssse3")) OR (NOT( C_FLAGS_PROCESSOR MATCHES "msse4.1")) ) - Message(FATAL_ERROR "For x86 Architecture, you must have following flags: -mssse3 -msse4.1. The current detected flags are: ${C_FLAGS_PROCESSOR}. You can pass the flags manually in build script, for example: ./build_oai --cflags_processor \"-mssse3 -msse4.1\" ") + Message(FATAL_ERROR "For x86 Architecture, you must have following flags: -mssse3 -msse4.1. The current detected flags are: ${C_FLAGS_PROCESSOR}. You can pass the flags manually in build script, for example: ./build_oai --cflags_processor \"-mssse3 -msse4.1 -mavx2\" ") endif() endif() From 8cfe28f6d77670d4da5694d53fd1f59c5fd11b9b Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 4 Apr 2016 13:15:24 +0200 Subject: [PATCH 119/214] minor fix to reset the modem if serial ports not found --- .../tools/configure_cots_bandrich_ue.py | 26 +++++++++++-------- .../tools/configure_cots_huaweiE398_ue.py | 24 ++++++++++------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py index 99aed7c29f..64a1f7ca57 100755 --- a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py @@ -28,17 +28,21 @@ from lib_autotest import * def find_open_port(): global serial_port, ser max_ports=100 - if os.path.exists(serial_port) == True: - return serial_port - for port in range(2,100): - serial_port = '/dev/ttyUSB'+str(port) - if os.path.exists(serial_port) == True: - print 'New Serial Port : ' + serial_port - break - - ser = serial.Serial(port=serial_port) - return - + while True: + if os.path.exists(serial_port) == True: + return serial_port + for port in range(2,100): + serial_port_tmp = '/dev/ttyUSB'+str(port) + if os.path.exists(serial_port_tmp) == True: + print 'New Serial Port : ' + serial_port_tmp + serial_port = serial_port_tmp + break + if serial_port == '': + print" Not able to detect valid serial ports. Resetting the modem now..." + reset_ue() + else : + ser = serial.Serial(port=serial_port) + return #serial_port = '/dev/ttyUSB2' diff --git a/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py b/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py index 07d532c5d6..35c9000992 100755 --- a/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py @@ -28,16 +28,22 @@ from lib_autotest import * def find_open_port(): global serial_port, ser max_ports=100 - if os.path.exists(serial_port) == True: - return serial_port - for port in range(0,100): - serial_port = '/dev/ttyUSB'+str(port) - if os.path.exists(serial_port) == True: - print 'New Serial Port : ' + serial_port - break + while True: + if os.path.exists(serial_port) == True: + return serial_port + for port in range(2,100): + serial_port_tmp = '/dev/ttyUSB'+str(port) + if os.path.exists(serial_port_tmp) == True: + print 'New Serial Port : ' + serial_port_tmp + serial_port = serial_port_tmp + break + if serial_port == '': + print" Not able to detect valid serial ports. Resetting the modem now..." + reset_ue() + else : + ser = serial.Serial(port=serial_port) + return - ser = serial.Serial(port=serial_port) - return From 8b849e5c30d5a970154c21c9791d46511667418a Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 4 Apr 2016 14:20:53 +0200 Subject: [PATCH 120/214] minor fixes to throughput tests in Gitlab CI --- cmake_targets/autotests/test_case_list.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 6d7e2a72f3..4f4470f854 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -5992,7 +5992,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 - throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec + throughput_test min=10.0Mbits/sec max=10.0Mbits/sec average=10.0Mbits/sec False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue @@ -6011,7 +6011,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 15Mbits/s -B 192.172.0.1 False @@ -6290,12 +6290,12 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -s -i 1 -u -f m -B 192.172.0.2 - + throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue - + /tmp @@ -6364,7 +6364,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1 -u -f m -B 192.172.0.2 - + throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue @@ -6383,7 +6383,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 15Mbits/s -B 192.172.0.1 False @@ -6438,7 +6438,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1 -u -f m -B 192.172.0.2 - + throughput_test min=10.0Mbits/sec max=10.0Mbits/sec average=10.0Mbits/sec False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue @@ -6457,7 +6457,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 15Mbits/s -B 192.172.0.1 False From 691cdca257ca4139911733de2325012cf8d1dc76 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 4 Apr 2016 14:29:29 +0200 Subject: [PATCH 121/214] add license to autotest files --- .../autotests/run_exec_autotests.bash | 30 ++++++++++++++++++ cmake_targets/autotests/test_case_list.xml | 2 +- .../tools/configure_cots_bandrich_ue.py | 30 ++++++++++++++++++ .../tools/configure_cots_huaweiE398_ue.py | 30 ++++++++++++++++++ .../autotests/tools/find_usb_path.bash | 31 +++++++++++++++++++ cmake_targets/autotests/tools/iperf_script | 30 ++++++++++++++++++ .../autotests/tools/iperf_script_phone | 30 ++++++++++++++++++ cmake_targets/autotests/tools/lib_autotest.py | 30 ++++++++++++++++++ cmake_targets/autotests/tools/search_repl.py | 31 +++++++++++++++++++ 9 files changed, 243 insertions(+), 1 deletion(-) diff --git a/cmake_targets/autotests/run_exec_autotests.bash b/cmake_targets/autotests/run_exec_autotests.bash index 6587839c8f..2d3f193b30 100755 --- a/cmake_targets/autotests/run_exec_autotests.bash +++ b/cmake_targets/autotests/run_exec_autotests.bash @@ -1,4 +1,34 @@ #!/bin/bash +#****************************************************************************** + +# OpenAirInterface +# Copyright(c) 1999 - 2014 Eurecom + +# OpenAirInterface is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + + +# OpenAirInterface is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with OpenAirInterface.The full GNU General Public License is +# included in this distribution in the file called "COPYING". If not, +# see . + +# Contact Information +# OpenAirInterface Admin: openair_admin@eurecom.fr +# OpenAirInterface Tech : openair_tech@eurecom.fr +# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + +# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + +# *******************************************************************************/ +# \author Navid Nikaein, Rohit Gupta if [ -s $OPENAIR_DIR/cmake_targets/tools/build_helper ] ; then source $OPENAIR_DIR/cmake_targets/tools/build_helper diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 4f4470f854..eddc83c334 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1,4 +1,4 @@ - + mozart calisson stevens nano amerique /mnt/sradio/TEST_RESULTS/ diff --git a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py index 64a1f7ca57..8df675d8f1 100755 --- a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py @@ -1,4 +1,34 @@ #!/usr/bin/python +#****************************************************************************** + +# OpenAirInterface +# Copyright(c) 1999 - 2014 Eurecom + +# OpenAirInterface is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + + +# OpenAirInterface is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with OpenAirInterface.The full GNU General Public License is +# included in this distribution in the file called "COPYING". If not, +# see . + +# Contact Information +# OpenAirInterface Admin: openair_admin@eurecom.fr +# OpenAirInterface Tech : openair_tech@eurecom.fr +# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + +# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + +# *******************************************************************************/ +# \author Navid Nikaein, Rohit Gupta import time import serial diff --git a/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py b/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py index 35c9000992..eaa0c8298a 100755 --- a/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py @@ -1,4 +1,34 @@ #!/usr/bin/python +#****************************************************************************** + +# OpenAirInterface +# Copyright(c) 1999 - 2014 Eurecom + +# OpenAirInterface is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + + +# OpenAirInterface is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with OpenAirInterface.The full GNU General Public License is +# included in this distribution in the file called "COPYING". If not, +# see . + +# Contact Information +# OpenAirInterface Admin: openair_admin@eurecom.fr +# OpenAirInterface Tech : openair_tech@eurecom.fr +# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + +# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + +# *******************************************************************************/ +# \author Navid Nikaein, Rohit Gupta import time import serial diff --git a/cmake_targets/autotests/tools/find_usb_path.bash b/cmake_targets/autotests/tools/find_usb_path.bash index c8ec950292..d2a80cd6c2 100755 --- a/cmake_targets/autotests/tools/find_usb_path.bash +++ b/cmake_targets/autotests/tools/find_usb_path.bash @@ -1,4 +1,35 @@ #!/bin/bash +#****************************************************************************** + +# OpenAirInterface +# Copyright(c) 1999 - 2014 Eurecom + +# OpenAirInterface is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + + +# OpenAirInterface is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with OpenAirInterface.The full GNU General Public License is +# included in this distribution in the file called "COPYING". If not, +# see . + +# Contact Information +# OpenAirInterface Admin: openair_admin@eurecom.fr +# OpenAirInterface Tech : openair_tech@eurecom.fr +# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + +# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + +# *******************************************************************************/ +# \author Navid Nikaein, Rohit Gupta + #arg1 idVendor #arg2 idProduct diff --git a/cmake_targets/autotests/tools/iperf_script b/cmake_targets/autotests/tools/iperf_script index ecd2f7a996..5f9baff09f 100755 --- a/cmake_targets/autotests/tools/iperf_script +++ b/cmake_targets/autotests/tools/iperf_script @@ -1,4 +1,34 @@ #!/bin/bash +#****************************************************************************** + +# OpenAirInterface +# Copyright(c) 1999 - 2014 Eurecom + +# OpenAirInterface is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + + +# OpenAirInterface is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with OpenAirInterface.The full GNU General Public License is +# included in this distribution in the file called "COPYING". If not, +# see . + +# Contact Information +# OpenAirInterface Admin: openair_admin@eurecom.fr +# OpenAirInterface Tech : openair_tech@eurecom.fr +# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + +# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + +# *******************************************************************************/ +# \author Navid Nikaein, Rohit Gupta #arg1 timeout to wait before running the script #arg2 interface diff --git a/cmake_targets/autotests/tools/iperf_script_phone b/cmake_targets/autotests/tools/iperf_script_phone index 25693d13c3..343813d4e0 100755 --- a/cmake_targets/autotests/tools/iperf_script_phone +++ b/cmake_targets/autotests/tools/iperf_script_phone @@ -1,4 +1,34 @@ #!/bin/bash +#****************************************************************************** + +# OpenAirInterface +# Copyright(c) 1999 - 2014 Eurecom + +# OpenAirInterface is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + + +# OpenAirInterface is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with OpenAirInterface.The full GNU General Public License is +# included in this distribution in the file called "COPYING". If not, +# see . + +# Contact Information +# OpenAirInterface Admin: openair_admin@eurecom.fr +# OpenAirInterface Tech : openair_tech@eurecom.fr +# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + +# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + +# *******************************************************************************/ +# \author Navid Nikaein, Rohit Gupta #arg1 timeout to wait before running the script #arg2 interface diff --git a/cmake_targets/autotests/tools/lib_autotest.py b/cmake_targets/autotests/tools/lib_autotest.py index 67234de567..9ac2305250 100644 --- a/cmake_targets/autotests/tools/lib_autotest.py +++ b/cmake_targets/autotests/tools/lib_autotest.py @@ -1,4 +1,34 @@ #!/usr/bin/python +#****************************************************************************** + +# OpenAirInterface +# Copyright(c) 1999 - 2014 Eurecom + +# OpenAirInterface is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + + +# OpenAirInterface is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with OpenAirInterface.The full GNU General Public License is +# included in this distribution in the file called "COPYING". If not, +# see . + +# Contact Information +# OpenAirInterface Admin: openair_admin@eurecom.fr +# OpenAirInterface Tech : openair_tech@eurecom.fr +# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + +# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + +# *******************************************************************************/ +# \author Navid Nikaein, Rohit Gupta import os from pyroute2 import IPRoute diff --git a/cmake_targets/autotests/tools/search_repl.py b/cmake_targets/autotests/tools/search_repl.py index be0568599f..e43feccfb3 100755 --- a/cmake_targets/autotests/tools/search_repl.py +++ b/cmake_targets/autotests/tools/search_repl.py @@ -1,4 +1,35 @@ #!/usr/bin/python +#****************************************************************************** + +# OpenAirInterface +# Copyright(c) 1999 - 2014 Eurecom + +# OpenAirInterface is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + + +# OpenAirInterface is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with OpenAirInterface.The full GNU General Public License is +# included in this distribution in the file called "COPYING". If not, +# see . + +# Contact Information +# OpenAirInterface Admin: openair_admin@eurecom.fr +# OpenAirInterface Tech : openair_tech@eurecom.fr +# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + +# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + +# *******************************************************************************/ +# \author Navid Nikaein, Rohit Gupta + import sys import re import os From 5481e609ef79947659c2dcb0b0d7c70d2a51d590 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 4 Apr 2016 15:35:31 +0200 Subject: [PATCH 122/214] minor fix for serial port detection --- cmake_targets/autotests/tools/configure_cots_bandrich_ue.py | 1 + cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py | 1 + 2 files changed, 2 insertions(+) diff --git a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py index 8df675d8f1..3921afd8f2 100755 --- a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py @@ -58,6 +58,7 @@ from lib_autotest import * def find_open_port(): global serial_port, ser max_ports=100 + serial_port='' while True: if os.path.exists(serial_port) == True: return serial_port diff --git a/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py b/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py index eaa0c8298a..9646cc69ff 100755 --- a/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py @@ -58,6 +58,7 @@ from lib_autotest import * def find_open_port(): global serial_port, ser max_ports=100 + serial_port='' while True: if os.path.exists(serial_port) == True: return serial_port From 4ff17e2b03c1b05ec1f8bed09e31a77fecec7f97 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 4 Apr 2016 16:52:14 +0200 Subject: [PATCH 123/214] Fixed the rx gain setting of USRP --- .../GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf index 1ea7b64740..3583deb7e3 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf @@ -35,7 +35,7 @@ eNBs = nb_antennas_tx = 1; nb_antennas_rx = 1; tx_gain = 90; - rx_gain = 132; + rx_gain = 125; prach_root = 0; prach_config_index = 0; prach_high_speed = "DISABLE"; From ca5ff31f32992891cbea8276616712b031ab910b Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 5 Apr 2016 16:37:32 +0200 Subject: [PATCH 124/214] updates to eMBMS. mbmssim and UE channel estimation. will not affect current gitlab CI tests. --- .../lte_dl_mbsfn_channel_estimation.c | 10 +++---- openair1/SIMULATION/LTE_PHY/mbmssim.c | 26 ++++++++++++++----- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c index dbb2ba231f..e79392e0fe 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c @@ -755,26 +755,26 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *phy_vars_ue, if (phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa]) { switch (phy_vars_ue->lte_frame_parms.N_RB_DL) { case 6: - idft128((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET], + idft128((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8], (int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa], 1); break; case 25: - idft512((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET], + idft512((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8], (int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa], 1); break; case 50: - idft1024((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET], + idft1024((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8], (int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa], 1); break; case 75: - idft1536((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET], + idft1536((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8], (int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa]); break; case 100: - idft2048((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET], + idft2048((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8], (int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa], 1); break; diff --git a/openair1/SIMULATION/LTE_PHY/mbmssim.c b/openair1/SIMULATION/LTE_PHY/mbmssim.c index 8522b7be9a..e2fa439be5 100644 --- a/openair1/SIMULATION/LTE_PHY/mbmssim.c +++ b/openair1/SIMULATION/LTE_PHY/mbmssim.c @@ -128,7 +128,7 @@ int main(int argc, char **argv) char c; - int i,l,aa,aarx,k; + int i,l,l2,aa,aarx,k; double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1=0.0; uint8_t snr1set=0; double snr_step=1,input_snr_step=1; @@ -538,11 +538,25 @@ int main(int argc, char **argv) } } } - - rx_pmch(PHY_vars_UE, - 0, - subframe%10, - l); + + if (l==6) + for (l2=2;l2<7;l2++) + rx_pmch(PHY_vars_UE, + 0, + subframe%10, + l2); + if (l==6) + for (l2=2;l2<7;l2++) + rx_pmch(PHY_vars_UE, + 0, + subframe%10, + l2); + if (l==11) + for (l2=7;l2<12;l2++) + rx_pmch(PHY_vars_UE, + 0, + subframe%10, + l2); } PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->G = get_G(&PHY_vars_UE->lte_frame_parms, From 66dde65f2ea92e2c0df41d74bcfe0323a73d9001 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 5 Apr 2016 21:44:41 +0200 Subject: [PATCH 125/214] added a new check for illegal file permissions to mbmssim.c, to avoid a segfault if permissions are invalid. --- openair1/SIMULATION/LTE_PHY/mbmssim.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openair1/SIMULATION/LTE_PHY/mbmssim.c b/openair1/SIMULATION/LTE_PHY/mbmssim.c index e2fa439be5..0e14619cda 100644 --- a/openair1/SIMULATION/LTE_PHY/mbmssim.c +++ b/openair1/SIMULATION/LTE_PHY/mbmssim.c @@ -337,7 +337,11 @@ int main(int argc, char **argv) else sprintf(fname,"embms_awgn_%d_%d.m",mcs,N_RB_DL); - fd = fopen(fname,"w"); + if (!(fd = fopen(fname,"w"))) { + printf("Cannot open %s, check permissions\n",fname); + exit(-1); + } + if (awgn_flag==0) fprintf(fd,"SNR_%d_%d=[];errs_mch_%d_%d=[];mch_trials_%d_%d=[];\n", From 4a2e77ac561e521d73340378ffdf19e07f6c2e6b Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Wed, 6 Apr 2016 08:39:07 +0200 Subject: [PATCH 126/214] fixing a bug related to harq rounds introduced in 6f889b30e4616499dc4b7caa7bde2dd02da9577a --- openair1/SCHED/phy_procedures_lte_eNb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index e8c9ac670b..4420f2385d 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -2057,7 +2057,7 @@ void process_HARQ_feedback(uint8_t UE_id, // then Increment DLSCH round index dlsch_harq_proc->round++; - if (dlsch_harq_proc->round == 1/*dlsch->Mdlharq*/) { + if (dlsch_harq_proc->round == dlsch->Mdlharq) { // This was the last round for DLSCH so reset round and increment l2_error counter #ifdef DEBUG_PHY_PROC LOG_W(PHY,"[eNB %d][PDSCH %x/%d] DLSCH retransmissions exhausted, dropping packet\n",phy_vars_eNB->Mod_id, From 5d023411213e4d23ebabbc93e10efe7da5ca4c3f Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 6 Apr 2016 11:26:42 +0200 Subject: [PATCH 127/214] minor fix for iperf script for test setup --- cmake_targets/autotests/tools/iperf_script_phone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/autotests/tools/iperf_script_phone b/cmake_targets/autotests/tools/iperf_script_phone index 343813d4e0..77ce8774f3 100755 --- a/cmake_targets/autotests/tools/iperf_script_phone +++ b/cmake_targets/autotests/tools/iperf_script_phone @@ -58,6 +58,6 @@ while true ; do fi done -print "Starting iperf now..." +echo "Starting iperf now..." sudo adb -s $device_id shell /data/local/tmp/iperf ${iperf_args[@]} From 15cd4ab077f2b290e6e4597d663a4bb2c7d48a34 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Wed, 6 Apr 2016 11:27:19 +0200 Subject: [PATCH 128/214] cleanup for Mdlharq usage/meaning --- .../CODING/3gpplte_turbo_decoder_avx2_16bit.c | 13 +- openair1/PHY/CODING/defs.h | 11 + openair1/PHY/CODING/lte_rate_matching.c | 23 +- openair1/PHY/INIT/lte_init.c | 23 +- openair1/PHY/LTE_REFSIG/defs.h | 8 +- openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c | 8 +- openair1/PHY/LTE_REFSIG/lte_dl_mbsfn.c | 4 +- openair1/PHY/LTE_REFSIG/lte_dl_uespec.c | 4 +- openair1/PHY/LTE_TRANSPORT/dci.c | 14 +- openair1/PHY/LTE_TRANSPORT/defs.h | 16 +- openair1/PHY/LTE_TRANSPORT/dlsch_coding.c | 1 + openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c | 8 +- openair1/PHY/LTE_TRANSPORT/drs_modulation.c | 26 +- openair1/PHY/LTE_TRANSPORT/pbch.c | 4 +- openair1/PHY/LTE_TRANSPORT/pcfich.c | 4 +- openair1/PHY/LTE_TRANSPORT/phich.c | 8 +- openair1/PHY/LTE_TRANSPORT/pilots.c | 4 +- openair1/PHY/LTE_TRANSPORT/pilots_mbsfn.c | 2 +- openair1/PHY/LTE_TRANSPORT/proto.h | 36 +- openair1/PHY/LTE_TRANSPORT/pss.c | 2 +- openair1/PHY/LTE_TRANSPORT/pucch.c | 4 +- openair1/PHY/LTE_TRANSPORT/srs_modulation.c | 10 +- openair1/PHY/LTE_TRANSPORT/sss.c | 2 +- openair1/PHY/LTE_TRANSPORT/ulsch_coding.c | 11 +- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 27 +- openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c | 6 +- openair1/PHY/MODULATION/defs.h | 2 +- openair1/PHY/MODULATION/ofdm_mod.c | 2 +- openair1/PHY/TOOLS/lte_dfts.c | 1 - openair1/PHY/defs.h | 1 - openair1/PHY/impl_defs_lte.h | 5 +- openair1/PHY/impl_defs_top.h | 73 +- openair1/PHY/spec_defs.h | 745 ------------------ openair1/PHY/spec_defs_top.h | 68 -- openair1/SCHED/phy_procedures_lte_eNb.c | 19 +- targets/RT/USER/lte-softmodem.c | 4 +- targets/SIMU/USER/init_lte.c | 14 +- 37 files changed, 169 insertions(+), 1044 deletions(-) delete mode 100755 openair1/PHY/spec_defs.h delete mode 100755 openair1/PHY/spec_defs_top.h diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c index 5c78dcf96e..24f399a2b2 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c @@ -940,9 +940,8 @@ unsigned char phy_threegpplte_turbo_decoder16avx2(int16_t *y, uint32_t db; - __m128i *yp128,*yp128_cw2; __m256i tmp, zeros=_mm256_setzero_si256(); - __m128i tmpe,tmpe_cw2; + int offset8_flag=0; @@ -988,9 +987,6 @@ unsigned char phy_threegpplte_turbo_decoder16avx2(int16_t *y, } - yp128 = (__m128i*)y; - yp128_cw2 = (__m128i*)y2; - s = systematic0; s1 = systematic1; s2 = systematic2; @@ -999,6 +995,13 @@ unsigned char phy_threegpplte_turbo_decoder16avx2(int16_t *y, #if 0 + __m128i *yp128,*yp128_cw2; + __m128i tmpe,tmpe_cw2; + yp128 = (__m128i*)y; + yp128_cw2 = (__m128i*)y2; + + + for (i=0; i0) { // Downlink + Nir = Nsoft/Kmimo/cmin(8,Mdlharq); + Ncb = cmin(Nir/C,3*(RTC<<5)); + } + else { // Uplink + Nir=0; + Ncb = 3*(RTC<<5); // Kw + } #ifdef RM_DEBUG_TX if (rvidx==0 && r==0) { @@ -709,15 +715,20 @@ int lte_rate_matching_turbo_rx(uint32_t RTC, int nulled=0; #endif - if (Kmimo==0 || Mdlharq==0 || C==0 || Qm==0 || Nl==0) { + if (Kmimo==0 || C==0 || Qm==0 || Nl==0) { printf("lte_rate_matching.c: invalid parameters (Kmimo %d, Mdlharq %d, C %d, Qm %d, Nl %d\n", Kmimo,Mdlharq,C,Qm,Nl); return(-1); } - Nir = Nsoft/Kmimo/cmin(8,Mdlharq); - Ncb = cmin(Nir/C,3*(RTC<<5)); - + if (Mdlharq>0) { // Downlink + Nir = Nsoft/Kmimo/cmin(8,Mdlharq); + Ncb = cmin(Nir/C,3*(RTC<<5)); + } + else { // Uplink + Nir=0; + Ncb = 3*(RTC<<5); + } Gp = G/Nl/Qm; GpmodC = Gp%C; diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 7e69eac046..6a50c2d113 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -26,17 +26,6 @@ Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE *******************************************************************************/ -/* -#ifdef CBMIMO1 -#include "ARCH/COMMON/defs.h" -#include "ARCH/CBMIMO1/DEVICE_DRIVER/from_grlib_softconfig.h" -#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h" -#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h" -#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h" -#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_pci.h" -//#include "pci_commands.h" -#endif //CBMIMO1 -*/ #ifdef EXMIMO #include "openair0_lib.h" #endif @@ -1053,7 +1042,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue, // init TX buffers ue_common_vars->txdata = (int32_t**)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) ); - ue_common_vars->txdataF = (mod_sym_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(mod_sym_t*) ); + ue_common_vars->txdataF = (int32_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) ); for (i=0; inb_antennas_tx; i++) { #ifdef USER_MODE @@ -1061,7 +1050,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue, #else //USER_MODE ue_common_vars->txdata[i] = TX_DMA_BUFFER[0][i]; #endif //USER_MODE - ue_common_vars->txdataF[i] = (mod_sym_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t) ); + ue_common_vars->txdataF[i] = (int32_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t) ); } // init RX buffers @@ -1274,21 +1263,21 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNB, // TX vars eNB_common_vars->txdata[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) ); - eNB_common_vars->txdataF[eNB_id] = (mod_sym_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(mod_sym_t*) ); + eNB_common_vars->txdataF[eNB_id] = (int32_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) ); for (i=0; inb_antennas_tx; i++) { #ifdef USER_MODE eNB_common_vars->txdata[eNB_id][i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int32_t) ); - eNB_common_vars->txdataF[eNB_id][i] = (mod_sym_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t) ); + eNB_common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t) ); #else // USER_MODE eNB_common_vars->txdata[eNB_id][i] = TX_DMA_BUFFER[eNB_id][i]; - eNB_common_vars->txdataF[eNB_id][i] = (mod_sym_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t) ); + eNB_common_vars->txdataF[eNB_id][i] = (int32_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t) ); #endif //USER_MODE #ifdef DEBUG_PHY msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->txdata[%d][%d] = %p\n",eNB_id,i,eNB_common_vars->txdata[eNB_id][i]); msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->txdataF[%d][%d] = %p (%d bytes)\n", eNB_id,i,eNB_common_vars->txdataF[eNB_id][i], - FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t)); + FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t)); #endif } diff --git a/openair1/PHY/LTE_REFSIG/defs.h b/openair1/PHY/LTE_REFSIG/defs.h index b48403ff99..f8701a63a8 100644 --- a/openair1/PHY/LTE_REFSIG/defs.h +++ b/openair1/PHY/LTE_REFSIG/defs.h @@ -73,7 +73,7 @@ void lte_gold_mbsfn(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_mbsfn_tabl int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB, - mod_sym_t *output, + int32_t *output, short amp, unsigned char Ns, unsigned char l, @@ -89,7 +89,7 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB, */ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, uint8_t UE_id, - mod_sym_t *output, + int32_t *output, short amp, uint8_t Ns, uint8_t p, @@ -102,7 +102,7 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, @param Ns Slot number (0..19) @param l symbol (0,1,2) */ -int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, mod_sym_t *output, +int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output, short amp, int subframe, unsigned char l); @@ -148,7 +148,7 @@ void free_ul_ref_sigs(void); @sub_frame_offset Offset of this subframe in units of subframes */ -int lte_generate_srs(mod_sym_t **txdataF, +int lte_generate_srs(int32_t **txdataF, short amp, LTE_DL_FRAME_PARMS *frame_parms, unsigned int sub_frame_offset); diff --git a/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c b/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c index 8e64275b41..9ffda3a83d 100644 --- a/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c +++ b/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c @@ -41,7 +41,7 @@ //Calibration int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB, - mod_sym_t *output, + int32_t *output, short amp, unsigned char Ns, unsigned char l,//nb of sym per slot @@ -50,7 +50,7 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB, unsigned char nu,mprime,mprime_dword,mprime_qpsk_symb,m; unsigned short k,a; - mod_sym_t qpsk[4]; + int32_t qpsk[4]; a = (amp*ONE_OVER_SQRT2_Q15)>>15; ((short *)&qpsk[0])[0] = a; @@ -121,7 +121,7 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB, int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB, - mod_sym_t *output, + int32_t *output, short amp, unsigned char Ns, unsigned char l, @@ -130,7 +130,7 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB, unsigned char nu,mprime,mprime_dword,mprime_qpsk_symb,m; unsigned short k,a; - mod_sym_t qpsk[4]; + int32_t qpsk[4]; a = (amp*ONE_OVER_SQRT2_Q15)>>15; ((short *)&qpsk[0])[0] = a; diff --git a/openair1/PHY/LTE_REFSIG/lte_dl_mbsfn.c b/openair1/PHY/LTE_REFSIG/lte_dl_mbsfn.c index c3b141841a..9c3269b863 100644 --- a/openair1/PHY/LTE_REFSIG/lte_dl_mbsfn.c +++ b/openair1/PHY/LTE_REFSIG/lte_dl_mbsfn.c @@ -39,7 +39,7 @@ //extern unsigned int lte_gold_table[10][3][42]; //#define DEBUG_DL_MBSFN -int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, mod_sym_t *output, +int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output, short amp, int subframe, unsigned char l) @@ -47,7 +47,7 @@ int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, mod_sym_t *output, unsigned int mprime,mprime_dword,mprime_qpsk_symb,m; unsigned short k=0,a; - mod_sym_t qpsk[4]; + int32_t qpsk[4]; a = (amp*ONE_OVER_SQRT2_Q15)>>15; ((short *)&qpsk[0])[0] = a; diff --git a/openair1/PHY/LTE_REFSIG/lte_dl_uespec.c b/openair1/PHY/LTE_REFSIG/lte_dl_uespec.c index e7b3dd2ed1..9b094393c7 100644 --- a/openair1/PHY/LTE_REFSIG/lte_dl_uespec.c +++ b/openair1/PHY/LTE_REFSIG/lte_dl_uespec.c @@ -54,14 +54,14 @@ int Wbar_NCP[8][4] = {{1,1,1,1},{1,-1,1,-1},{1,1,1,1},{1,-1,1,-1},{1,1,-1,-1},{- int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, uint8_t UE_id, - mod_sym_t *output, + int32_t *output, short amp, uint8_t Ns, uint8_t p, int SS_flag ) { - mod_sym_t qpsk[4],nqpsk[4],*qpsk_p,*output_p; + int32_t qpsk[4],nqpsk[4],*qpsk_p,*output_p; int16_t a; int w,lprime,ind,l,ind_dword,ind_qpsk_symb,nPRB; // LTE_eNB_DLSCH_t *dlsch = phy_vars_eNB->dlsch_eNB[UE_id][0]; diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index 70761ac5ae..e79f603a49 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -272,12 +272,12 @@ uint32_t Y; //#define Mquad (Msymb/4) static uint32_t bitrev_cc_dci[32] = {1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31,0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30}; -static mod_sym_t wtemp[2][Msymb]; +static int32_t wtemp[2][Msymb]; -void pdcch_interleaving(LTE_DL_FRAME_PARMS *frame_parms,mod_sym_t **z, mod_sym_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi) +void pdcch_interleaving(LTE_DL_FRAME_PARMS *frame_parms,int32_t **z, int32_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi) { - mod_sym_t *wptr,*wptr2,*zptr; + int32_t *wptr,*wptr2,*zptr; uint32_t Mquad = get_nquad(n_symbols_pdcch,frame_parms,mi); uint32_t RCC = (Mquad>>5), ND; uint32_t row,col,Kpi,index; @@ -2027,7 +2027,7 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, uint32_t n_rnti, int16_t amp, LTE_DL_FRAME_PARMS *frame_parms, - mod_sym_t **txdataF, + int32_t **txdataF, uint32_t subframe) { @@ -2038,10 +2038,10 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, int16_t re_offset; uint8_t mi = get_mi(frame_parms,subframe); static uint8_t e[DCI_BITS_MAX]; - static mod_sym_t yseq0[Msymb],yseq1[Msymb],wbar0[Msymb],wbar1[Msymb]; + static int32_t yseq0[Msymb],yseq1[Msymb],wbar0[Msymb],wbar1[Msymb]; - mod_sym_t *y[2]; - mod_sym_t *wbar[2]; + int32_t *y[2]; + int32_t *wbar[2]; int nushiftmod3 = frame_parms->nushift%3; diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index 6c758b1c22..43bc7e3515 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -269,8 +269,10 @@ typedef struct { uint32_t G; /// Codebook index for this dlsch (0,1,2,3) uint8_t codebook_index; - /// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17) + /// Maximum number of HARQ processes (for definition see 36-212 V8.6 2009-03, p.17) uint8_t Mdlharq; + /// Maximum number of HARQ rounds + uint8_t Mlimit; /// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17) uint8_t Kmimo; /// Nsoft parameter related to UE Category @@ -315,11 +317,9 @@ typedef struct { /// Scrambled "b"-sequences (for definition see 36-211 V8.6 2009-03, p.14) uint8_t b_tilde[MAX_NUM_CHANNEL_BITS]; /// Modulated "d"-sequences (for definition see 36-211 V8.6 2009-03, p.14) - mod_sym_t d[MAX_NUM_RE]; + int32_t d[MAX_NUM_RE]; /// Transform-coded "z"-sequences (for definition see 36-211 V8.6 2009-03, p.14-15) - mod_sym_t z[MAX_NUM_RE]; - /// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17) - uint8_t Mdlharq; + int32_t z[MAX_NUM_RE]; /// "q" sequences for CQI/PMI (for definition see 36-212 V8.6 2009-03, p.27) uint8_t q[MAX_CQI_PAYLOAD]; /// coded and interleaved CQI bits @@ -468,8 +468,8 @@ typedef struct { typedef struct { /// Pointers to 8 HARQ processes for the ULSCH LTE_UL_eNB_HARQ_t *harq_processes[8]; - /// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17) - uint8_t Mdlharq; + /// Maximum number of HARQ rounds + uint8_t Mlimit; /// Maximum number of iterations used in eNB turbo decoder uint8_t max_turbo_iterations; /// ACK/NAK Bundling flag @@ -702,7 +702,7 @@ typedef struct { harq_status_t harq_ack[10]; /// Pointers to up to 8 HARQ processes LTE_DL_UE_HARQ_t *harq_processes[8]; - /// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17 + /// Maximum number of HARQ processes(for definition see 36-212 V8.6 2009-03, p.17 uint8_t Mdlharq; /// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17) uint8_t Kmimo; diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c index 338ee30cad..622ff51531 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c @@ -150,6 +150,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_ bzero(dlsch,sizeof(LTE_eNB_DLSCH_t)); dlsch->Kmimo = Kmimo; dlsch->Mdlharq = Mdlharq; + dlsch->Mlimit = 4; dlsch->Nsoft = Nsoft; for (i=0; i<10; i++) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c index 3b9c58ca1b..06aa2656be 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c @@ -137,7 +137,7 @@ void layer1prec2A(int32_t *antenna0_sample, int32_t *antenna1_sample, uint8_t pr } int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms, - mod_sym_t **txdataF, + int32_t **txdataF, uint32_t *jj, uint32_t *jj2, uint16_t re_offset, @@ -981,7 +981,7 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms, return(0); } -int allocate_REs_in_RB_MCH(mod_sym_t **txdataF, +int allocate_REs_in_RB_MCH(int32_t **txdataF, uint32_t *jj, uint16_t re_offset, uint32_t symbol_offset, @@ -1178,7 +1178,7 @@ uint8_t get_pmi(uint8_t N_RB_DL,LTE_DL_eNB_HARQ_t *dlsch_harq,uint16_t rb) } -int dlsch_modulation(mod_sym_t **txdataF, +int dlsch_modulation(int32_t **txdataF, int16_t amp, uint32_t subframe_offset, LTE_DL_FRAME_PARMS *frame_parms, @@ -1492,7 +1492,7 @@ int dlsch_modulation(mod_sym_t **txdataF, return (re_allocated); } -int mch_modulation(mod_sym_t **txdataF, +int mch_modulation(int32_t **txdataF, int16_t amp, uint32_t subframe_offset, LTE_DL_FRAME_PARMS *frame_parms, diff --git a/openair1/PHY/LTE_TRANSPORT/drs_modulation.c b/openair1/PHY/LTE_TRANSPORT/drs_modulation.c index 1b9df8046f..097bcdd691 100644 --- a/openair1/PHY/LTE_TRANSPORT/drs_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/drs_modulation.c @@ -63,7 +63,7 @@ int generate_drs_pusch(PHY_VARS_UE *phy_vars_ue, uint8_t cyclic_shift,cyclic_shift0,cyclic_shift1; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->lte_frame_parms; - mod_sym_t *txdataF = phy_vars_ue->lte_ue_common_vars.txdataF[ant]; + int32_t *txdataF = phy_vars_ue->lte_ue_common_vars.txdataF[ant]; uint32_t u,v,alpha_ind; uint32_t u0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[subframe<<1]; uint32_t u1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[1+(subframe<<1)]; @@ -147,13 +147,13 @@ int generate_drs_pusch(PHY_VARS_UE *phy_vars_ue, if (cyclic_shift == 0) { for (k=0; k<12; k++) { if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 1; + txdataF[symbol_offset+re_offset] = (int32_t) 1; else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 2; + txdataF[symbol_offset+re_offset] = (int32_t) 2; else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 3; + txdataF[symbol_offset+re_offset] = (int32_t) 3; else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 4; + txdataF[symbol_offset+re_offset] = (int32_t) 4; re_offset++; drs_offset++; @@ -165,22 +165,22 @@ int generate_drs_pusch(PHY_VARS_UE *phy_vars_ue, for (k=0; k<12; k++) { if(k%2 == 0) { if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 4; + txdataF[symbol_offset+re_offset] = (int32_t) 4; else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 3; + txdataF[symbol_offset+re_offset] = (int32_t) 3; else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 2; + txdataF[symbol_offset+re_offset] = (int32_t) 2; else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 1; + txdataF[symbol_offset+re_offset] = (int32_t) 1; } else { if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 1; + txdataF[symbol_offset+re_offset] = (int32_t) 1; else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 2; + txdataF[symbol_offset+re_offset] = (int32_t) 2; else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 3; + txdataF[symbol_offset+re_offset] = (int32_t) 3; else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 4; + txdataF[symbol_offset+re_offset] = (int32_t) 4; } re_offset++; diff --git a/openair1/PHY/LTE_TRANSPORT/pbch.c b/openair1/PHY/LTE_TRANSPORT/pbch.c index 0eee263a10..b7b7149c62 100755 --- a/openair1/PHY/LTE_TRANSPORT/pbch.c +++ b/openair1/PHY/LTE_TRANSPORT/pbch.c @@ -61,7 +61,7 @@ #define PBCH_A 24 int allocate_pbch_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms, - mod_sym_t **txdataF, + int32_t **txdataF, uint32_t *jj, uint16_t re_offset, uint32_t symbol_offset, @@ -160,7 +160,7 @@ int allocate_pbch_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms, //uint8_t pbch_d[96+(3*(16+PBCH_A))], pbch_w[3*3*(16+PBCH_A)],pbch_e[1920]; //one bit per byte int generate_pbch(LTE_eNB_PBCH *eNB_pbch, - mod_sym_t **txdataF, + int32_t **txdataF, int amp, LTE_DL_FRAME_PARMS *frame_parms, uint8_t *pbch_pdu, diff --git a/openair1/PHY/LTE_TRANSPORT/pcfich.c b/openair1/PHY/LTE_TRANSPORT/pcfich.c index 978492a500..915ce17a45 100644 --- a/openair1/PHY/LTE_TRANSPORT/pcfich.c +++ b/openair1/PHY/LTE_TRANSPORT/pcfich.c @@ -143,12 +143,12 @@ uint8_t pcfich_b[4][32]= {{0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1 void generate_pcfich(uint8_t num_pdcch_symbols, int16_t amp, LTE_DL_FRAME_PARMS *frame_parms, - mod_sym_t **txdataF, + int32_t **txdataF, uint8_t subframe) { uint8_t pcfich_bt[32],nsymb,pcfich_quad; - mod_sym_t pcfich_d[2][16]; + int32_t pcfich_d[2][16]; uint8_t i; uint32_t symbol_offset,m,re_offset,reg_offset; int16_t gain_lin_QPSK; diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index e08ad239bd..4c9986bf16 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -393,8 +393,8 @@ void generate_phich_emul(LTE_DL_FRAME_PARMS *frame_parms, } -mod_sym_t alam_bpsk_perm1[4] = {2,1,4,3}; // -conj(x) 1 (-1-j) -> 2 (1-j), 2->1, 3 (-1+j) -> (4) 1+j, 4->3 -mod_sym_t alam_bpsk_perm2[4] = {3,4,2,1}; // conj(x) 1 (-1-j) -> 3 (-1+j), 3->1, 2 (1-j) -> 4 (1+j), 4->2 +int32_t alam_bpsk_perm1[4] = {2,1,4,3}; // -conj(x) 1 (-1-j) -> 2 (1-j), 2->1, 3 (-1+j) -> (4) 1+j, 4->3 +int32_t alam_bpsk_perm2[4] = {3,4,2,1}; // conj(x) 1 (-1-j) -> 3 (-1+j), 3->1, 2 (1-j) -> 4 (1+j), 4->2 // This routine generates the PHICH @@ -404,7 +404,7 @@ void generate_phich(LTE_DL_FRAME_PARMS *frame_parms, uint8_t ngroup_PHICH, uint8_t HI, uint8_t subframe, - mod_sym_t **y) + int32_t **y) { int16_t d[24],*dp; @@ -1425,7 +1425,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_eNB->lte_frame_parms; LTE_eNB_ULSCH_t **ulsch_eNB = phy_vars_eNB->ulsch_eNB; - mod_sym_t **txdataF = phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id]; + int32_t **txdataF = phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id]; uint8_t harq_pid; uint8_t Ngroup_PHICH,ngroup_PHICH,nseq_PHICH; uint8_t NSF_PHICH = 4; diff --git a/openair1/PHY/LTE_TRANSPORT/pilots.c b/openair1/PHY/LTE_TRANSPORT/pilots.c index ba1eee293d..66e32fcb49 100644 --- a/openair1/PHY/LTE_TRANSPORT/pilots.c +++ b/openair1/PHY/LTE_TRANSPORT/pilots.c @@ -41,7 +41,7 @@ #include "PHY/defs.h" void generate_pilots(PHY_VARS_eNB *phy_vars_eNB, - mod_sym_t **txdataF, + int32_t **txdataF, int16_t amp, uint16_t Ntti) { @@ -168,7 +168,7 @@ void generate_pilots(PHY_VARS_eNB *phy_vars_eNB, } int generate_pilots_slot(PHY_VARS_eNB *phy_vars_eNB, - mod_sym_t **txdataF, + int32_t **txdataF, int16_t amp, uint16_t slot, int first_pilot_only) diff --git a/openair1/PHY/LTE_TRANSPORT/pilots_mbsfn.c b/openair1/PHY/LTE_TRANSPORT/pilots_mbsfn.c index a81eb38480..168f3db17c 100644 --- a/openair1/PHY/LTE_TRANSPORT/pilots_mbsfn.c +++ b/openair1/PHY/LTE_TRANSPORT/pilots_mbsfn.c @@ -42,7 +42,7 @@ int generate_mbsfn_pilot(PHY_VARS_eNB *phy_vars_eNB, - mod_sym_t **txdataF, + int32_t **txdataF, int16_t amp, uint16_t subframe) { diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index 15a8f53f54..69de638672 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -89,9 +89,9 @@ void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch); void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch); -LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag); +LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag); -LTE_UE_ULSCH_t *new_ue_ulsch(uint8_t Mdlharq, unsigned char N_RB_UL, uint8_t abstraction_flag); +LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag); /** \fn dlsch_encoding(uint8_t *input_buffer, LTE_DL_FRAME_PARMS *frame_parms, @@ -133,7 +133,7 @@ void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB, // Functions below implement 36-211 -/** \fn allocate_REs_in_RB(mod_sym_t **txdataF, +/** \fn allocate_REs_in_RB(int32_t **txdataF, uint32_t *jj, uint32_t *jj2, uint16_t re_offset, @@ -169,7 +169,7 @@ void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB, */ int32_t allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms, - mod_sym_t **txdataF, + int32_t **txdataF, uint32_t *jj, uint32_t *jj2, uint16_t re_offset, @@ -186,7 +186,7 @@ int32_t allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms, uint8_t skip_half); -/** \fn int32_t dlsch_modulation(mod_sym_t **txdataF, +/** \fn int32_t dlsch_modulation(int32_t **txdataF, int16_t amp, uint32_t sub_frame_offset, LTE_DL_FRAME_PARMS *frame_parms, @@ -203,7 +203,7 @@ int32_t allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms, @param dlsch1 Pointer to Transport Block 0 DLSCH descriptor for this allocation */ -int32_t dlsch_modulation(mod_sym_t **txdataF, +int32_t dlsch_modulation(int32_t **txdataF, int16_t amp, uint32_t sub_frame_offset, LTE_DL_FRAME_PARMS *frame_parms, @@ -218,7 +218,7 @@ int32_t dlsch_modulation(mod_sym_t **txdataF, @param frame_parms Pointer to frame descriptor @param dlsch Pointer to DLSCH descriptor for this allocation */ -int mch_modulation(mod_sym_t **txdataF, +int mch_modulation(int32_t **txdataF, int16_t amp, uint32_t subframe_offset, LTE_DL_FRAME_PARMS *frame_parms, @@ -279,7 +279,7 @@ void dump_mch(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per_co @param N Number of sub-frames to generate */ void generate_pilots(PHY_VARS_eNB *phy_vars_eNB, - mod_sym_t **txdataF, + int32_t **txdataF, int16_t amp, uint16_t N); @@ -292,17 +292,17 @@ void generate_pilots(PHY_VARS_eNB *phy_vars_eNB, @param first_pilot_only (0 no) */ int32_t generate_pilots_slot(PHY_VARS_eNB *phy_vars_eNB, - mod_sym_t **txdataF, + int32_t **txdataF, int16_t amp, uint16_t slot, int first_pilot_only); int32_t generate_mbsfn_pilot(PHY_VARS_eNB *phy_vars_eNB, - mod_sym_t **txdataF, + int32_t **txdataF, int16_t amp, uint16_t subframe); -int32_t generate_pss(mod_sym_t **txdataF, +int32_t generate_pss(int32_t **txdataF, int16_t amp, LTE_DL_FRAME_PARMS *frame_parms, uint16_t l, @@ -310,14 +310,14 @@ int32_t generate_pss(mod_sym_t **txdataF, int32_t generate_pss_emul(PHY_VARS_eNB *phy_vars_eNB,uint8_t sect_id); -int32_t generate_sss(mod_sym_t **txdataF, +int32_t generate_sss(int32_t **txdataF, short amp, LTE_DL_FRAME_PARMS *frame_parms, unsigned short symbol, unsigned short slot_offset); int32_t generate_pbch(LTE_eNB_PBCH *eNB_pbch, - mod_sym_t **txdataF, + int32_t **txdataF, int32_t amp, LTE_DL_FRAME_PARMS *frame_parms, uint8_t *pbch_pdu, @@ -1148,7 +1148,7 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, uint32_t n_rnti, int16_t amp, LTE_DL_FRAME_PARMS *frame_parms, - mod_sym_t **txdataF, + int32_t **txdataF, uint32_t sub_frame_offset); uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB, @@ -1341,7 +1341,7 @@ void init_ul_hopping(LTE_DL_FRAME_PARMS *frame_parms); int32_t compareints (const void * a, const void * b); -void ulsch_modulation(mod_sym_t **txdataF, +void ulsch_modulation(int32_t **txdataF, int16_t amp, frame_t frame, uint32_t subframe, @@ -1450,7 +1450,7 @@ void pcfich_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, void generate_pcfich(uint8_t num_pdcch_symbols, int16_t amp, LTE_DL_FRAME_PARMS *frame_parms, - mod_sym_t **txdataF, + int32_t **txdataF, uint8_t subframe); uint8_t rx_pcfich(LTE_DL_FRAME_PARMS *frame_parms, @@ -1609,7 +1609,7 @@ uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int sub uint8_t get_num_pdcch_symbols(uint8_t num_dci,DCI_ALLOC_t *dci_alloc,LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe); -void pdcch_interleaving(LTE_DL_FRAME_PARMS *frame_parms,mod_sym_t **z, mod_sym_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi); +void pdcch_interleaving(LTE_DL_FRAME_PARMS *frame_parms,int32_t **z, int32_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi); void pdcch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, uint8_t subframe, @@ -1638,7 +1638,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, void init_ncs_cell(LTE_DL_FRAME_PARMS *frame_parms,uint8_t ncs_cell[20][7]); -void generate_pucch(mod_sym_t **txdataF, +void generate_pucch(int32_t **txdataF, LTE_DL_FRAME_PARMS *frame_parms, uint8_t ncs_cell[20][7], PUCCH_FMT_t fmt, diff --git a/openair1/PHY/LTE_TRANSPORT/pss.c b/openair1/PHY/LTE_TRANSPORT/pss.c index cb954dedb4..e2a4c549da 100644 --- a/openair1/PHY/LTE_TRANSPORT/pss.c +++ b/openair1/PHY/LTE_TRANSPORT/pss.c @@ -47,7 +47,7 @@ #include "PHY/defs.h" #include "PHY/extern.h" -int generate_pss(mod_sym_t **txdataF, +int generate_pss(int32_t **txdataF, short amp, LTE_DL_FRAME_PARMS *frame_parms, unsigned short symbol, diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index e791fea1bd..e723eb67a4 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -121,7 +121,7 @@ int16_t W3_im[3][6] = {{0 ,0 ,0 }, char pucch_format_string[6][20] = {"format 1\0","format 1a\0","format 1b\0","format 2\0","format 2a\0","format 2b\0"}; -void generate_pucch(mod_sym_t **txdataF, +void generate_pucch(int32_t **txdataF, LTE_DL_FRAME_PARMS *frame_parms, uint8_t ncs_cell[20][7], PUCCH_FMT_t fmt, @@ -145,7 +145,7 @@ void generate_pucch(mod_sym_t **txdataF, uint8_t m,l,refs; uint8_t n_cs,S,alpha_ind,rem; int16_t tmp_re,tmp_im,ref_re,ref_im,W_re=0,W_im=0; - mod_sym_t *txptr; + int32_t *txptr; uint32_t symbol_offset; uint8_t deltaPUCCH_Shift = frame_parms->pucch_config_common.deltaPUCCH_Shift; diff --git a/openair1/PHY/LTE_TRANSPORT/srs_modulation.c b/openair1/PHY/LTE_TRANSPORT/srs_modulation.c index 1edc98cf2c..249fd81ee4 100644 --- a/openair1/PHY/LTE_TRANSPORT/srs_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/srs_modulation.c @@ -137,7 +137,7 @@ int32_t generate_srs_tx(PHY_VARS_UE *phy_vars_ue, LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_ue->lte_frame_parms; SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated=&phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id]; - mod_sym_t *txdataF = phy_vars_ue->lte_ue_common_vars.txdataF[0]; + int32_t *txdataF = phy_vars_ue->lte_ue_common_vars.txdataF[0]; uint16_t msrsb=0,Nb=0,nb,b,msrs0=0,k,Msc_RS,Msc_RS_idx,carrier_pos,symbol_offset; uint16_t *Msc_idx_ptr; int32_t k0; @@ -237,13 +237,13 @@ int32_t generate_srs_tx(PHY_VARS_UE *phy_vars_ue, for (k=0; k= 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] >= 0)) - txdataF[symbol_offset+carrier_pos] = (mod_sym_t) 4; + txdataF[symbol_offset+carrier_pos] = (int32_t) 4; else if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] >= 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] < 0)) - txdataF[symbol_offset+carrier_pos] = (mod_sym_t) 2; + txdataF[symbol_offset+carrier_pos] = (int32_t) 2; else if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] < 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] >= 0)) - txdataF[symbol_offset+carrier_pos] = (mod_sym_t) 3; + txdataF[symbol_offset+carrier_pos] = (int32_t) 3; else if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] < 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] < 0)) - txdataF[symbol_offset+carrier_pos] = (mod_sym_t) 1; + txdataF[symbol_offset+carrier_pos] = (int32_t) 1; carrier_pos+=2; diff --git a/openair1/PHY/LTE_TRANSPORT/sss.c b/openair1/PHY/LTE_TRANSPORT/sss.c index e1e6463b37..34d55daaea 100644 --- a/openair1/PHY/LTE_TRANSPORT/sss.c +++ b/openair1/PHY/LTE_TRANSPORT/sss.c @@ -44,7 +44,7 @@ //#define DEBUG_SSS -int generate_sss(mod_sym_t **txdataF, +int generate_sss(int32_t **txdataF, int16_t amp, LTE_DL_FRAME_PARMS *frame_parms, uint16_t symbol, diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c index 606f2d8dfc..1004cfa192 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c @@ -73,7 +73,7 @@ void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch) msg("Freeing ulsch %p\n",ulsch); #endif - for (i=0; iMdlharq; i++) { + for (i=0; i<8; i++) { #ifdef DEBUG_ULSCH_FREE msg("Freeing ulsch process %d\n",i); #endif @@ -118,7 +118,7 @@ void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch) } -LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char Mdlharq,unsigned char N_RB_UL, uint8_t abstraction_flag) +LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag) { LTE_UE_ULSCH_t *ulsch; @@ -147,9 +147,8 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char Mdlharq,unsigned char N_RB_UL, uint8_ if (ulsch) { memset(ulsch,0,sizeof(LTE_UE_ULSCH_t)); - ulsch->Mdlharq = Mdlharq; - for (i=0; iharq_processes[i] = (LTE_UL_UE_HARQ_t *)malloc16(sizeof(LTE_UL_UE_HARQ_t)); @@ -187,7 +186,7 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char Mdlharq,unsigned char N_RB_UL, uint8_ } if ((abstraction_flag == 0) && (exit_flag==0)) { - for (i=0; iharq_processes[i]->d[r][j] = LTE_NULL; @@ -541,7 +540,7 @@ uint32_t ulsch_encoding(uint8_t *a, ulsch->e+r_offset, ulsch->harq_processes[harq_pid]->C, // C NSOFT, // Nsoft, - ulsch->Mdlharq, + 0, // this means UL 1, ulsch->harq_processes[harq_pid]->rvidx, get_Qm_ul(ulsch->harq_processes[harq_pid]->mcs), diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 1d5ad11788..0b63541555 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -52,10 +52,6 @@ #include "PHY_INTERFACE/extern.h" #endif -#ifdef OMP -#include -#endif - #ifdef PHY_ABSTRACTION #include "UTIL/OCG/OCG.h" #include "UTIL/OCG/OCG_extern.h" @@ -70,7 +66,7 @@ void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch) int i,r; if (ulsch) { - for (i=0; iMdlharq; i++) { + for (i=0; i<8; i++) { if (ulsch->harq_processes[i]) { if (ulsch->harq_processes[i]->b) { free16(ulsch->harq_processes[i]->b,MAX_ULSCH_PAYLOAD_BYTES); @@ -98,7 +94,7 @@ void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch) } } -LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag) +LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag) { LTE_eNB_ULSCH_t *ulsch; @@ -127,10 +123,10 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint if (ulsch) { memset(ulsch,0,sizeof(LTE_eNB_ULSCH_t)); - ulsch->Mdlharq = Mdlharq; ulsch->max_turbo_iterations = max_turbo_iterations; + ulsch->Mlimit = 4; - for (i=0; iharq_processes[i] = (LTE_UL_eNB_HARQ_t *)malloc16(sizeof(LTE_UL_eNB_HARQ_t)); @@ -180,15 +176,13 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch) { - unsigned char Mdlharq; unsigned char i; //ulsch = (LTE_eNB_ULSCH_t *)malloc16(sizeof(LTE_eNB_ULSCH_t)); if (ulsch) { - Mdlharq = ulsch->Mdlharq; ulsch->rnti = 0; - for (i=0; iharq_processes[i]) { // ulsch->harq_processes[i]->Ndi = 0; ulsch->harq_processes[i]->status = 0; @@ -1266,7 +1260,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, ulsch_harq->e+r_offset, ulsch_harq->C, NSOFT, - ulsch->Mdlharq, + 0, //Uplink 1, ulsch_harq->rvidx, (ulsch_harq->round==0)?1:0, // clear @@ -1300,12 +1294,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, */ } -#ifdef OMP - #pragma omp parallel private(r,ret) shared(ulsch,harq_pid,crc_type,Kr,f1f2mat_old,phy_vars_eNB,status,iind,) - { - #pragma omp for nowait -#endif - for (r=0; rC; r++) { // msg("Clearing c, %p\n",ulsch_harq->c[r]); // memset(ulsch_harq->c[r],0,16);//block_length); @@ -1365,9 +1353,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, } -#ifdef OMP - } -#endif // Reassembly of Transport block here offset = 0; // msg("F %d, Fbytes %d\n",ulsch_harq->F,ulsch_harq->F>>3); diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c index e9780ee92b..b4f7f02480 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c @@ -50,7 +50,7 @@ //#define DEBUG_ULSCH_MODULATION #ifndef OFDMA_ULSCH -void dft_lte(mod_sym_t *z,mod_sym_t *d, int32_t Msc_PUSCH, uint8_t Nsymb) +void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb) { #if defined(__x86_64__) || defined(__i386__) @@ -373,7 +373,7 @@ void dft_lte(mod_sym_t *z,mod_sym_t *d, int32_t Msc_PUSCH, uint8_t Nsymb) } #endif -void ulsch_modulation(mod_sym_t **txdataF, +void ulsch_modulation(int32_t **txdataF, short amp, uint32_t frame, uint32_t subframe, @@ -393,7 +393,7 @@ void ulsch_modulation(mod_sym_t **txdataF, // uint8_t harq_pid = (rag_flag == 1) ? 0 : subframe2harq_pid_tdd(frame_parms->tdd_config,subframe); uint8_t harq_pid = subframe2harq_pid(frame_parms,frame,subframe); uint8_t Q_m; - mod_sym_t *txptr; + int32_t *txptr; uint32_t symbol_offset; uint16_t first_rb; uint16_t nb_rb; diff --git a/openair1/PHY/MODULATION/defs.h b/openair1/PHY/MODULATION/defs.h index 6005d6d49a..8b92e3886e 100644 --- a/openair1/PHY/MODULATION/defs.h +++ b/openair1/PHY/MODULATION/defs.h @@ -87,7 +87,7 @@ int slot_fep_ul(LTE_DL_FRAME_PARMS *frame_parms, void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRAME_PARMS *frame_parms); -void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms); +void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms); void remove_7_5_kHz(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe); diff --git a/openair1/PHY/MODULATION/ofdm_mod.c b/openair1/PHY/MODULATION/ofdm_mod.c index f27f0500b0..d7dd141fb5 100755 --- a/openair1/PHY/MODULATION/ofdm_mod.c +++ b/openair1/PHY/MODULATION/ofdm_mod.c @@ -237,7 +237,7 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input } -void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms) +void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms) { int aa, slot_offset, slot_offset_F; diff --git a/openair1/PHY/TOOLS/lte_dfts.c b/openair1/PHY/TOOLS/lte_dfts.c index 3a5a125bc2..033cb143fc 100644 --- a/openair1/PHY/TOOLS/lte_dfts.c +++ b/openair1/PHY/TOOLS/lte_dfts.c @@ -5973,7 +5973,6 @@ simd256_q15_t *W4_12_256=(simd256_q15_t *)W4_12s_256; simd256_q15_t *W6_12_256=(simd256_q15_t *)W6_12s_256; -static simd256_q15_t norm256; static inline void dft12f_simd256(simd256_q15_t *x0, simd256_q15_t *x1, diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index 909c30e018..26239b024c 100755 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -122,7 +122,6 @@ static inline void* malloc16_clear( size_t size ) #define UNUSED(x) (void)x; -#include "spec_defs_top.h" #include "impl_defs_top.h" #include "impl_defs_lte.h" diff --git a/openair1/PHY/impl_defs_lte.h b/openair1/PHY/impl_defs_lte.h index cd6ee4ecce..7c38048a55 100644 --- a/openair1/PHY/impl_defs_lte.h +++ b/openair1/PHY/impl_defs_lte.h @@ -43,7 +43,6 @@ #include "types.h" -#include "spec_defs_top.h" //#include "defs.h" #define LTE_NUMBER_OF_SUBFRAMES_PER_FRAME 10 @@ -605,7 +604,7 @@ typedef struct { /// - first index: eNB id [0..2] (hard coded) /// - second index: tx antenna [0..nb_antennas_tx[ /// - third index: sample [0..] - mod_sym_t **txdataF[3]; + int32_t **txdataF[3]; /// \brief Holds the received data in time domain. /// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER. /// - first index: eNB id [0..2] (hard coded) @@ -749,7 +748,7 @@ typedef struct { /// For IFFT_FPGA this points to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER. /// - first index: tx antenna [0..nb_antennas_tx[ /// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX[ - mod_sym_t **txdataF; + int32_t **txdataF; /// \brief Holds the received data in time domain. /// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER. /// - first index: rx antenna [0..nb_antennas_rx[ diff --git a/openair1/PHY/impl_defs_top.h b/openair1/PHY/impl_defs_top.h index 73d89cc242..75da3fab6d 100755 --- a/openair1/PHY/impl_defs_top.h +++ b/openair1/PHY/impl_defs_top.h @@ -115,7 +115,6 @@ */ #include "types.h" -#include "spec_defs_top.h" @@ -130,11 +129,7 @@ #define HALF_NUMBER_OF_USEFUL_CARRIERS (NUMBER_OF_USEFUL_CARRIERS>>1) #define HALF_NUMBER_OF_USEFUL_CARRIERS_BYTES (HALF_NUMBER_OF_USEFUL_CARRIERS>>2) #define FIRST_CARRIER_OFFSET (HALF_NUMBER_OF_USEFUL_CARRIERS+NUMBER_OF_ZERO_CARRIERS) -#ifdef OPENAIR_LTE #define NUMBER_OF_OFDM_SYMBOLS_PER_SLOT (NUMBER_OF_SYMBOLS_PER_FRAME/LTE_SLOTS_PER_FRAME) -#else -#define NUMBER_OF_OFDM_SYMBOLS_PER_SLOT 16 -#endif #ifdef EMOS #define EMOS_SCH_INDEX 1 @@ -267,66 +262,6 @@ /// Threshold for PUCCH Format 1a/1b detection #define PUCCH1a_THRES 4 -#ifndef OPENAIR_LTE -/// -/// PHY-MAC Interface Defs -/// - -/// Maximum number of parallel streams per slot -#define NB_STREAMS_MAX 4 - -/// Maximum number of frequency groups per slot -#define NB_GROUPS_MAX 16 - -/// Maximum number of control bytes per slot -#define NB_CNTL_BYTES_MAX 8 - -/// Maximum number of data bytes per slot -#define NB_DATA_BYTES_MAX 256 - -#define MAX_NUM_TB 32 -#define MAX_TB_SIZE_BYTES 128 - -/// Size of SACCH PDU in Bytes -#define SACCH_SIZE_BYTES (sizeof(UL_SACCH_PDU)+4) -/// Size of SACCH PDU in Bytes -#define SACCH_SIZE_BITS (SACCH_SIZE_BYTES<<3) - -#define MAX_SACH_SIZE_BYTES 1024 - - -#define SACH_ERROR 1 -#define SACCH_ERROR 2 -#define SACH_MISSING 3 -#define SACH_PARAM_INVALID 10 - -#endif //OPENAIR_LTE - -/* -enum STATUS_RX {STATUS_RX_OFF, - STATUS_RX_ON, - STATUS_RX_SYNCING, - STATUS_RX_CANNOT_SYNC, - STATUS_RX_DATA_PROBLEM, - STATUS_RX_LOST_SYNC, - STATUS_RX_ABORT, - STATUS_RX_TOO_LATE, - STATUS_RX_CLOCK_STOPPED}; - -enum STATUS_TX { - STATUS_TX_OFF, - STATUS_TX_ON, - STATUS_TX_INPUT_CORRUPT, - STATUS_TX_ABORT, - STATUS_TX_TOO_LATE, - STATUS_TX_CLOCK_STOPPED}; - -enum MODE { - SYNCHED, - SYNCHING, - NOT_SYNCHED}; -*/ - /// Data structure for transmission. typedef struct { /// RAW TX sample buffer @@ -341,6 +276,14 @@ typedef struct { int *RX_DMA_BUFFER[2]; } TX_RX_VARS; +/*! \brief Extension Type */ +typedef enum { + CYCLIC_PREFIX, + CYCLIC_SUFFIX, + ZEROS, + NONE +} Extension_t; + /// Measurement Variables #define NUMBER_OF_SUBBANDS_MAX 13 diff --git a/openair1/PHY/spec_defs.h b/openair1/PHY/spec_defs.h deleted file mode 100755 index c8a1e86e5e..0000000000 --- a/openair1/PHY/spec_defs.h +++ /dev/null @@ -1,745 +0,0 @@ -/******************************************************************************* - OpenAirInterface - Copyright(c) 1999 - 2014 Eurecom - - OpenAirInterface is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - - OpenAirInterface is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with OpenAirInterface.The full GNU General Public License is - included in this distribution in the file called "COPYING". If not, - see . - - Contact Information - OpenAirInterface Admin: openair_admin@eurecom.fr - OpenAirInterface Tech : openair_tech@eurecom.fr - OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr - - Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE - - *******************************************************************************/ -#ifndef __PHY_DEFS_SPEC_H__ -#define __PHY_DEFS_SPEC_H__ - -#include "types.h" - - -/*! \mainpage OpenAirInterface.org Specifications - -\section scope_openair Scope - -The present document specifies the architecture of the following components of a OpenAirInterface network --# \ref _RN_TOPOLOGY_ --# \ref _PHY_PROCEDURES_MESH_ --# \ref _PHY_PROCEDURES_CELL_ --# \ref _L2_PROTOCOLS -\subsection _RN_TOPOLOGY_ Radio Network Topology and Components -This section describes the different components which constitute the OpenAirInterface. Two types of network topologies are supported, mesh and cellular. -The mesh topology is depicted as: - -\image html mesh_topology_small.png "OpenAirInterface Mesh Topology" width=5cm -\image latex mesh_topology.pdf "OpenAirInterface Mesh Topology" - -The cellular topology is depicted as: - -\image html cellular_topology_small.png "OpenAirInterface Cellular Topology" width=5cm -\image latex cellular_topology.pdf "OpenAirInterface Cellular Topology" - -The mesh topology contains Clusterheads (CH) and Mesh Routers (MR) whereas the cellular topology contains Clusterheads/NodeB (CH/NodeB) and User Equipment (UE). -The main difference at the physical layer between the two topologies is that direct communications between UE is not permitted in a cellular topology. Other major -differences exist at layers 2 and 3. In both topologies, MR/UE can be connected to more than one CH at any time, if radio connectivity is possible. - -The two types of physical networking devices are specified as follows: - -- Cluster-head (CH or NodeB): A cluster-head can be defined as a node with a maximum visibility/connectivity in terms of number of nodes in its neighborhood. -From the point-of-view of the MAC layer, it assumes the fine-grain management of radio resources in the cluster (cell). It determines the frame partitioning -(see \ref _framing_modulation) and bandwidth allocation and communicates this information to nodes in the cluster through a beacon. At the -physical layer, the cluster-head provides mechanisms for timing and carrier frequency synchronization. The primary role of the CH is to manage radio resources in their cluster. The cluster is defined as the set of nodes which are characterized by one-hop connectivity with the clusterhead. One-hop connectivity is further defined as the capacity to reliably receive and transmit basic signaling channels with the clusterhead using at least at the lowest datarate communication mode. Reliable communication is defined by a transmission which falls below a maximal error probability threshold. -CH can only be connected to MR on the same frequency-carrier since they use the same temporal resources as other CH. Thus direct CH<->CH communication is not possible on the same frequency carrier. -The downlink (CH -> MR) signaling channels allow for the CH to schedule transmission of labels (in the form of time and frequency mappings on the radio resource) which each carry different types of traffic throughout the mesh network. The Uplink (UL) signaling channels (MR -> CH) are used for relaying bandwidth requirement indicators and channel quality measurements from nodes within the cluster. These feed the scheduling algorithms residing in the CH and allow for proper resource allocation satisfying quality-of-service (QoS) negotiations carried out using Layer 3 (L3) signaling. - -The CH further provides mechanisms for measurement reporting to L3 (for routing, QoS management, labeling, etc...). This is achieved by a set of signaling channels which relay measurement information (UL) for the nodes in the cluster to the CH. The CH processes these raw measurements into a form which is expected by L3 mechanisms. -Some CH can assume the role of network synchronization by sending special synchronization pilots (see Section 1.1.5). These will be called Primary CH when network synchronization is achieved using this method. Other CH using this method are called Secondary CH. - - - Regular node/Mesh Router (UE): All nodes have the ability to play at the same time the role of a host and of a router, although this functionality is not activated -in a cellular topology. - -The primary role of an MR is to interpret the scheduling information from the CH on the DL signaling channels in order to route the traffic corresponding to the -scheduled labels on the allocated physical resources. MR can be connected to other MR (direct link) in the same cluster. MR can also be connected to more than one cluster -at the same time. It is also expected to using the UL signaling channels to relay measurements to the CH with which is connected. -A secondary role of some MR is to search, on behalf of the CH, for isolated nodes which need to be connected to the mesh. These MR use a special signaling resource (MRBCH) to -exchange basic topological parameters with the IN which then results in overall network topology updates. If several IN are contending for access with the cluster, -joint processing of the requests will be performed by the mesh during topology adjustments. The most likely nodes to assume this role will be those at the extremities -of the mesh. - -Either type of equipment can also assume the role of relay/gateway to a secondary network. ` - -In mesh topologies some nodes (CH or MR) assume the role of and edge router (from a layer 2/3 perspective). An edge router is either a CH or MR with an IP interface to -another network. The role of ER is to aggregate traffic (ingress) from IP flows to MPLS-like labels for transmission in the mesh. On reception it must demultiplex -traffic (degress) from MPLS-like labels to IP for traffic exiting the mesh. Edge routers, potentially all CH and MR, must have MAC-layer interfaces to IP in order to -perform these functions. - -Both OpenAirInterface topologies require Network Synchronization (NS) at least between adjacent clusters. This must be on the order of a few microseconds. Three mechanisms are -supported to ensure NS. Firstly, a secondary synchronization source (e.g. GPS) can be used as a common time reference by all nodes. Secondly, one CH (Primary CH) in the -network use a special synchronization signal which has longer range than the range of communication, in order to cover the region which a common time reference. This is -suitable for small networks. Finally the method of distributed relaying of synchronization is possible. This is a method by which all nodes propagate a time reference. Nodes -switch between reception (for timing acquisition and tracking) and transmission of the reference. This guarantees coverage of network synchronization over long distances -in the absence of a secondary synchronization source. - - -\subsection _L2_PROTOCOLS Layer 2 Protocols -Layer 2 is structured as below. It comprises: -- A IP/MPLS networking device (NAS DRIVER) responsible for provision of IP/MPLS layer services to Layer 2 and vice-versa -- An MPLS label-switching entity (NAS MPLS) responsible for routing/forwarding within the mesh network (MESH topology only) -- A Radio resource control (RRC) entity responsible for MAC layer signalling for configuration of logical flows (labels) and retrieval of measurement information. -- A Radio Link Control (RLC) entity which is responsible for automatic repeat request protocols (ARQ) and IP/MPLS packet segmentation -- A convergence protocol (PDCP) responsible for IP interface and related functions (header compression, ciphering, etc.) -- A scheduling and multiplexing unit (\ref _openair_mac_layer_specs_) responsible for the mapping between logical channels (labels and control-plane signalling) -and transport channels. It implements the interface with the PHY, which is the collection of transport channels as well as a primitives for -collection of PHY measurements and configuration of PHY parameters. - -\image latex layer2_stack_overview.pdf "Global View of OpenAirInterface Protocol Stack and Communication Primitives" -\image html layer2_stack_overview.png "Global View of OpenAirInterface Protocol Stack and Communication Primitives" - -These entities are described in the following subsections. - -\subsubsection _RRC_ Radio Resource Control (RRC) -The radio resource control entity is responsible for the L2 signalling implementing the radio channels establishment. It also implements the control of -measurement procedures described in Section 1.3.4. Its internal state machine controls the basic procedures for startup, monitoring of synchronization -through the measurement system and update of the nodes role in the network (Sections 1.3-0). - -RRC is responsible for configuration of all MAC entities (and PHY via MAC), both dynamic (during label establishment) and static (control channels). This functionality -is in response to event occurring in the interaction with L3 and based on dynamic measurements of radio quality. - -RRC signalling makes use of DCCH, CCCH and BCCH for transport of the various protocols. - - -\subsubsection _RLC_ Radio Link Control (RLC) -RLC segments IP packets. The segment size is configurable for each QoS class and is signalled by higher layers during route establishment. The sizes -are chosen based on the granularity of the underlying MAC/PHY resources (transport blocks). - -RLC is responsible for ARQ and indexing of SDUs from the user traffic and signalling SDUs from RRC. The SDU inputs from LS form the -set of radio bearers, and those from RRC the set of signalling radio bearers. It has two modes of functionality: acknowledged and unacknowledged. -Each logical channel can have an associated ARQ process which is managed by RLC. The ARQ mechanisms are based on Release 6 3GPP RLC (25.8xx). -The interface with RRC for configuration is not yet described. The interface with MAC is designed such that data for each logical channel is -buffered in data queues, whose occupancy can be measured by the MAC scheduling entity. - -\subsubsection _MAC_ MAC scheduling Entity (MAC) -The MAC entity is responsible for scheduling control plane and user-plane traffic on the physical OFDMA resources. -On transmission, the inputs to this entity are connected to data queues originating in the RLC layer which form the set of logical channels. The -control plane traffic is represented by logical channels which form the interface with the RLC. Logical channels contain both user-plane (originating -in the IP/MPLS entity via the PDCP entity) and control-plane traffic (originating in the RRC entity). MAC layer specifications are found in \ref _openair_mac_layer_specs_. -The MAC is responsible the transport channel interface which exchange data (MAC SDUs) and PHY measurement data for RRC measurement procedures. - -\subsection _PHY_PROCEDURES_MESH_ Physical Layer Procedures - Mesh Topology -\subsection _PHY_PROCEDURES_CELL_ Physical Layer Procedures - Cellular Topology - -\subsubsection _POWER_ON_CH_ Power-on procedures of a CH -This clause briefly describes the power-on procedure of a CH. The CH RRC receives basic cell configuration information (CHBCH/RACH configuration) from -L3 Radio Resource Management (RRM) and configures the MAC and RLC layers. The MAC, in turn, configures the static paramters of the PHY. Upon completion -of this initialization phase it enters the steady-state mode. - -\subsubsection _POWER_ON_UE_ Power-on procedures of a UE -This clause briefly describes the power-on procedures of a UE which is managed by the UE-RRC state machine. The first function is to search for at least one -existing CH in range which is under the responsibility of the PHY. This procedure attempts to analyze the received signal power over a pre-defined time period. If a -signal is detected on the desired carrier, the node attempts PHY synchronization using the pilots of the candidate CHs. The postulated frame start position is used -to demodulate the CHBCH resources. If the PHY returns an error-free CHBCH with acceptable receive quality, the node is said to be pre-synchronized to the CH. -It then attempts to decode the CHBCH of the rest of the CH in range. At the end of this stage, it has a list of acceptable CH. This procedure is repeated periodically, -until active communication is sought with the network. - -Upon passing to the state of active communication, it demodulates the CHBCH continuously from the CHs to obtain the UL-CCCH configurations as well as MCCH/MTCH. -Once configured, it attempts to establish a connection (connection request) with each of the candidates using the RACH resources of each CH. Upon successful completion -of the association procedure it is said to be synchronized to the CH and enters the steady-state mode for each CH. - -\subsubsection _CH_SS_OP_ CH Steady-state operation -In TTI N, the CH transmits all DL flows as determined by the CHBCH scheduler during the end of TTI N-2. Furthermore, it detects the UL-SACCH for all UE flows and the -UE-SACH for all flows. It also detects the RACH (CCCH). At the end of each TTI, once it has received all feedback indicators (channel and queuing), it invokes -the CHBCH scheduling entity to determine the allocations for TTI N+2. The sequence of operations after receiving flows from TTI N (towards the end of TTI N+1) is: - -Entity: RRC TX - --# generate BCCH and CCCH to be conveyed in TTI N+2 --# program new logical channels and measurement procedures starting in TTI N+2 based on L3 signaling requests --# generate signaling radio bearers (measurement requests, UE radio bearer/logical channel configuration) for TTI N+2, and invoke RLC - -Entity: MAC TX - --# Invoke MAC Scheduler for TTI N+2 allocations : compute DL_SACCH_PDU and UL_ALLOC_PDU for N+2, corresponding to PHY allocations in N+3. --# Generate CHBCH PDU for TTI N+2 --# Retrieve RLC SDUs and generate DL_SACH for TTI N+2 --# Generate MACPHY_DATA_REQ for TX transport channels in TTI N+2 - -MAC RX - --# Generate MACPHY_DATA_REQ for RX transport channels in TTI N+2 (based on previously scheduled UL_ALLOC_PDU received by UE in TTI N, decoded by end of TTI N+1) --# Invoked by PHY through macphy_data_confirm, the received flows are routed to RLC data queues and MAC signaling information is -stored for MAC TX scheduling in next TTI. The MACPHY_DATA_IND primitive (invoked by PHY) also provides CH RX measurements information in an UL_MEAS structure. - -RRC RX - --# Retrieve RACH and process association requests --# Retrieve signaling radio bearers from RLC --# Retrieve CH RX measurements from PHY/MAC - -This sequence is invoked at the end of each TTI by the system scheduler. - -\subsubsection _UE_SS_OP_ UE Steady-state operation - -In the steady-state of TTI N, the UE PHY demodulates the CHBCH. The CHBCH PDU is then available during TTI N+1 for the MAC. to determine the allocations of the CH and -itself in TTI N+2. Based on the decoded information, its scheduling entity generates the transmission for the next TTI and configures the PHY to demodulate the data for -which it is destination in the current TTI. The UE RRC acts on PHY/MAC measurements to maintain proper synchronization and received signal quality, for example by -detecting a loss of connection of degradation of service. The sequence of operations at the end of TTI N is - -Entity: MAC RX - --# Parse CHBCH_PDU --# Generate macphy_data_req for RX transport channels in TTI N+2 (based on previously scheduled UL_ALLOC received by UE in TTI N, decoded by end of TTI N+1) --# Invoked by PHY through macphy_data_confirm, the received flows are routed to RLC data queues and MAC signaling information is stored for MAC TX scheduling in next TTI. The reported PHY RF measurements (i.e. in DL_MEAS structure) are processed and used to generate UL_SACCH_FB. --# Process measurements for RRC measurement reports and invoke mac_meas_ind for each logical channel requiring a measurement report. - -Entity: RRC RX - --# Retrieve BCCH and CCCH and generate association requests --# Retrieve signaling radio bearers from RLC --# Retrieve UE RX measurements from PHY/MAC for L3 measurement reporting - -Entity: RRC TX - --# program new logical channels and measurement procedures starting in TTI N+2 based on L3 signaling requests signaled by CH-RRC --# generate signaling radio bearers (measurement reports, configuration ACKs) for TTI N+2, and invoke RLC - -Entity: MAC TX - --# Invoke MAC multiplexer for TTI N+2 allocations : compute UL_SACCH_FB and UL_SACCH_PDU for N+2, corresponding to PHY allocations in N+3. --# Generate CHBCH PDU for TTI N+2 --# Retrieve RLC SDUs and generate UL_SACH for TTI N+2 --# Generate MACPHY_DATA_REQ for UL_SACH in TTI N+2 - -\subsubsection _QOS_MEAS_PROC_ QoS Measurement Procedures - -CH RRC manages L3 measurement reports at L2 for nodes within the cell. Measurement reports are exchanged between UE and CH using a logical channel (DCCH) -for topological control signaling, and edge routers can provide these measurements to IP -Since the CH scheduler has access to low-level PHY measurements, the MAC layer is responsible for measurement reporting on behalf of the PHY and itself. -The CH obtains raw measurements of all links in the cell. RRC acquires these measurements from MAC scheduling entity. -Measurements are processed in nodes to the degree required for higher level services. For example nodes will extract link quality (rate/delay) indicators from -low-level services (MAC to L3 measurement messages) which are transported using special signaling flows offered by the MAC. This is then used for L2.5 topology -maintenance (radio-bearer (re)-assignment). Edge routers will extract L2.5 measurement information on labels to provide IP with quality indicators. - -The interface with RRC for measurement reports is very similar to existing Release 6 HSPA. The types of measurements are: -- periodic (or one-shot) with configurable reporting interval and total number of measurements -- event-driven - in order to handle degradation of QoS level or loss of connection. - -The available measurements for CH RRC(L2) are: -- RSSI (dBm) on physical resources corresponding to logical channel. -- Average SINR (dB) on physical resources corresponding to logical channel. -- Average number of transmission rounds (times 10) on transport channel associated with logical channel. -- Average residual block error rate (times 1000) on transport channel associated with logical channel (after HARQ!). -- Actual Spectral efficiency (bits/symbol times 10) of transport channel associated with logical channel. -*/ - -/** @defgroup _openair_specs_ OpenAirInterface Layer1/2 Specifications -* @defgroup physical_layer_ OpenAirInterface Physical Layer (PHY) Specifications -* @ingroup _openair_specs_ -* @{ -This clause specifies the PHY layer for a multiple-antenna orthogonal frequency-division multiple-access (OFDMA) system applied and -the generic openair MAC interface. -\image html PHY_arch.png "openair PHY" -\image latex PHY_arch.png "openair PHY" width=15cm -The specification is intended for reconfigurable equipment, so that actual parameters and mechanisms can be configured -prior to deployment of the equipment or potentially over-the-air, although the latter is not yet supported by any of the openair MAC implementations. The -PHY and MAC layers are tightly coupled so that the MAC entity can directly influence the occupied physical resources. The OFDMA system provides the means for -transmitting several multiple-bitrate streams (multiplexed over sub-carriers and antennas) in parallel. Moreover, PHY signaling strategies are included to -provide the means for exploiting channel state feedback at the transmitters in order to allow for advanced PHY allocation of OFDMA resources via the MAC. -Modulation and channel coding formats are generic allowing for specific techniques to be employed in different deployment scenarios although configurations -based on the 802.11a legacy standard (binary/quaternary phase shift keying BPSK/QPSK, 16-point quadrature amplitude modulation (16-QAM), -64-QAM, rate 1/2,2/3,3/4 punctured convolutional codes) are provided here. The specifications are not specific to any frequency band or bandwidth, -although the minimum expected channel bandwidth should not be less than 1 MHz. -*/ - -/** @defgroup _phy_scope Scope -* @ingroup physical_layer_ -* @{ -This subclause describes the PHY services provided to the openair MAC. The openair PHY consists of several protocol functions which provide the interface -between the MAC and PHY for allocation MAC layer PDUs to physical resources. Physical channels are used to convey signaling, data and training information -across the radio medium. OpenAirInterface implements the following physical channels: - --# The PCHSCH (Physical Clusterhead Synchronization Channel) is a pilot resource reserved to a clusterhead (CH) which is responsible for -delivering synchronization information to nodes in the cluster. This channel is used by nodes to acquire timing information regarding the -beginning of the TTI and to perform initial frequency offset adjustments with respect to the carrier frequency of the CH. The channel -is also used by adjacent clusterheads to synchronize the network, in order to facilitate inter-cluster communication under quality-of-service guarantees. --# The PCHBCH (Physical Cluster-head Broadcast Channel) is a signaling resrouce reserved to a clusterhead which is responsible for delivering layer 2/3 -protocol information to the nodes of the cluster. It can also used by the nodes in the cluster to acquire accurate timing and frequency synchronization information. --# the PRACH (Physical Random Access Channel) is a signaling resource used by a node to provide layer 2 protocol information to its clusterhead. --# the PCHSCH (Physical Clusterhead Synchronization Channel) is a pilot resource used by a CH to allow the UE/MR to estimate the channel of CH and to acquire timing synchronization. --# the PSCH (Physical Synchronization Channel) is a pilot resource used by a node to allow the CH to estimate the channel of an MR/UE. --# the PSACH (Physical Scheduled-Access Channel) is a multi-cast data resource used by a node or CH to send MAC data PDUs to one or more destinations in -parallel (using multi-antenna OFDMA). --# the PSACCH (Physical Scheduled-Access Control Channel) is a signaling resource used by a node to provide MAC protocol information to the destinations of its -transmissions as well as the CH. --# the PMRBCH (Physical Mesh Router Broadcast Channel) is a signaling resource used by a node to provide layer 2 broadcast protocol information to neighbouring nodes -outside the range of clusterheads. It is used by nodes in mesh network topologies to relay network synchronization and provide initial configuration information to - -Transport channels constitute the control and user plane interfaces between the MAC and PHY layers. The are used to exchange both data and measurement information -and are mapped onto the above physical channels. OpenAirInterface implements the following transport channels: - --# The CHBCH (Clusterhead Broadcast Channel) is the transport channel mapped to the PCHBCH. --# The RACH (Random-Access Channel) is the transport channel mapped to the PRACH. --# The DL-SACH (Downlink Scheduled-Access Channel) is the transport channel mapped to the PSACH. --# The UL/MR-SACH (Uplink or Mesh-Router Scheduled-Access Channel) is the transport channel with components mapped to both the PSACH and PSACCH. --# The MRBCH (Mesh-Router Broadcast Channel) is the transport channel mappted to the PMRBCH. - -During reception, all transport channels convey measurement information. -* @} -*/ - -/** @defgroup _phy_framing Framing and Channel Multiplexing -* @ingroup physical_layer_ -* @{ -*/ - - -/** @defgroup _framing_modulation TTI and Modulation Parameters -* @ingroup _phy_framing - -The physical layer uses OFDM symbols organized into frames (corresponding to TTIs) of complex baseband samples at a sampling rate of \f$ f_\mathrm{s} \f$ samples/s. The carrier frequency is denoted \f$f_c\f$. Each TTI is made up of \f$N_{\mathrm{symb}}\f$ OFDM symbols. OFDM symbols, \f$\mathbf{s}\f$, of length \f$N_\mathrm{s}\f$ samples contain two distinct parts,\f$\mathbf{s}_\mathrm{I}\f$ and \f$\mathbf{s}_\mathrm{E}\f$. - -OpenAirMesh framing is completely configurable, but the nominal OFDMA configuration is shown below - -\image html mesh_frame.png "OpenAir PHY Framing" -\image latex mesh_frame.pdf "OpenAir PHY Framing" width=15cm - -One frame consists of 64 OFDM symbols and is divided in a CH transmission time interval (TTI) and a MR TTI. The first four symbols of the CH TTI are reserved for pilot symbols. Each CH transmits one common pilot symbol (CHSCH$_0$) at position 0 and one dedicated pilot symbol (CHSCH\f$_i\f$) at position \f$i \in \{1,2,3\}\f$. This way we can ensure orthogonality between the pilots of different CH received at one MR. The pilot symbols are followed by the broadcast channel (CH-BCH). The rest of the CH TTI frame is reserved for the multiplexed scheduled access channels (CH-SACH). - -The MR TTI contains the random access channel (MR-RACH) with an associated pilot symbol (SCH$_0$). The next two symbols are reserved for pilots. Each MR transmits a pilot symbol SCH\f$_i\f$, \f$i \in \{1,2\}\f$ corresponding to the cluster it belongs to. The pilot symbols are followed by the uplink broadcast channel (MR-BCH) with an associated pilot symbol (MRSCH). The rest of the uplink frame contains the multiplexed scheduled access channels (MR-SACH). The end of the CH and MR TTIs are protected by a guard interval of two symbols. All pilots are designed for MIMO and/or Multiuser channel estimation at the corresponding end. - -MAC PDUs arrive at the MAC interface from different logical resources (control, broadcast, multiple-user data streams) in parallel at the start of each TTI and must be mapped to the available radio resources. Each PDU is scrambled, encoded with a CRC check, and encoded using a channel code with associated bit-interleaving. The output of the channel coding block contains the information content to be transfered across the channel via the modulator. The modulated information content, \f$\mathbf{s}_\mathrm{I}\f$, is built starting either from a frequency-domain signal (classical OFDM) or several time-domain signals (digital FDM). Both techniques yield what are denoted herein as OFDM symbols. In the first method (classical OFDM), \f$\mathbf{S}_\mathrm{I}\f$ is specified in the frequency-domain and is made up of \f$N_\mathrm{d}\f$ samples. This is transfered to the time-domain via the inverse discrete-time Fourier transform (DFT) yielding a time-domain signal also of length \f$N_\mathrm{d}\f$ samples, \f$\mathbf{s}_\mathrm{I}=\mathrm{idft}(\mathbf{S}_\mathrm{I})\f$. In the second method, up to \f$N_\mathrm{f}\f$ different time-domain signals each comprising \f$N_{\mathrm{d,2}}=\frac{N_\mathrm{d}}{N_\mathrm{f}}\f$ samples, where \f$N_\mathrm{f}\f$ denots the number of frequency groups making up an OFDM symbol. Here each signal \f$\mathbf{s}_{i}\f$ is transformed to the frequency-domain via an \f$N_\mathrm{d,2}\f$-dimensional DFT yielding \f$\mathbf{S}_i\f$ and the combined frequency-domain signal is the concatenation of the \f$\mathbf{S}_i\f$, \f$\mathbf{S}_\mathrm{I} = [\mathbf{S}_0 | \mathbf{S}_1 | \cdots | \mathbf{S}_{N_\mathrm{f}-1}]\f$ - -The redundant (or null) portion, \f$\mathrm{s}_\mathrm{E}\f$, comprises \f$N_\mathrm{c}=N_\mathrm{s}-N_\mathrm{d}\f$ extra samples, and is concatenated to \f$\mathbf{s}_\mathrm{I}\f$. It is either a cyclic extension or zeros. The overall symbol is \f$\mathbf{s} = [\mathbf{s}_\mathrm{E} | \mathbf{s}_\mathrm{I}]\f$ (prefix configuration) or \f$\mathbf{s} = [\mathbf{s}_\mathrm{I} | \mathbf{s}_\mathrm{E}]\f$ (suffix configuration). - -The cyclic prefix or zero-padding is used to absorb a channel with a delay spread (including propagation delay of the primary paths) equal to its length so that adjacent OFDM symbols do not overlap in time. If the cyclic prefix method is used, then \f$s_{\mathrm{E},i} = s_{\mathrm{I},N_\mathrm{d}-N_\mathrm{c}+i}, i=0,\cdots,N_\mathrm{c}-1\f$, whereas if the cyclic suffix method is used, then \f$s_{\mathrm{E},i} = s_{\mathrm{I},i}, i=0,\cdots,N_\mathrm{c}-1\f$ otherwise \f$s_{\mathrm{E},i}=0, i=0,\cdots,N_\mathrm{c}-1\f$. The value \f$N_\mathrm{c}\f$ should be chosen based on the maximum propagation delay in the system. For outdoor channels this will be on the order of a few microseconds. In addition, for large \f$N_\mathrm{c}\f$, the value of \f$N_\mathrm{d}\f$ should also be large so that the overhead due to the propagation channel be kept to a minimum. \f$N_\mathrm{d}\f$ should be large enough to allow for frequency-domain multiplexing of user data streams if OFDMA is employed. Very large \f$N_\mathrm{c},N_\mathrm{d}\f$ are probably not required for openair except perhaps in the case of long-distance point-to-point links -(e.g. to link different hotspot areas). - -OFDM symbols typically provide for a certain spectral roll-off to satisfy RF spectral mask requirements and aid in transmit filtering and adjacent channel suppression. This is usually accomplished by inserting \f$N_{\mathrm{z}}\f$ zeros in \f$\mathbf{S}_f\f$. The total number of useful samples in \f$\mathbf{S}_f\f$ is therefore \f$N_\mathrm{d}-N_\mathrm{z}\f$. - -For use in OFDMA multiplexing, the useful carriers can be split into \f$N_\mathrm{f}\f$ groups of contiguous carriers. Each group of carriers can be used to transmit a different data stream in the same OFDM symbol. This particularly useful for achieving dynamic FDMA on the uplink of a cellular system. - -A summary of the framing parameters is given in following table and is represented by the primitive PHY_FRAMING. It represents part of the static configuration of the air-interface and is set during the initialization phase of the equipment via the MAC-layer interface (see \ref _mac_phy_primitives_,MACPHY_CONFIG_REQ) . - -*/ - - -/** @defgroup _chsch_sig Clusterhead Synchronization Channel (P-CHSCH,S-CHSCH) Signaling Format -* @ingroup _phy_framing - -The clusterhead synchronization channel is a signaling channel generated in the PHY layer and is comprised of -\f$N_{\mathrm{s,CHSCH}}(N_\mathrm{d}+N_\mathrm{c})\f$ samples, or the equivalent of one \f$N_{\mathrm{s,CHSCH}}\f$ OFDM symbols. The main purposes of -this channel are - --# Timing (TTI/symbol) synchronization for nodes inside the cluster --# Frequency sychronization for nodes inside the cluster --# Timing (TTI/symbol) sychronization for clusterheads in adjacent clusters --# Frequency synchronization for clusterheads in adjacent clusters - -It is emitted once per TTI in conjunction with the clusterhead broadcast channel (P-CHBCH,S-CHSCH). Aside from its primary purposes above, it is also -intended to be exploited for channel estimation prior to demodulation of the CHBCH, since the CHBCH does not comprise pilot signals and the clusterhead -does not use the MCH. The number of symbols required, \f$N_{\mathrm{s,CHSCH}}\f$, depend on the desired time and frequency acquisition precision. - -The x-CHSCH is a pseudo-random QPSK sequence defined in the frequency domain by the bit sequences -\f$\mathrm{Re}\{\mathbf{c}_i\}, \mathrm{Im}\{\mathbf{c}_i\}, i=0,1,\cdots,\lfloor(N_{\mathrm{d}} - N_{\mathrm{z}})N_{\mathrm{s,CHSCH}}/32 \rfloor -1\f$. -If multiple transmit antennas (up to \f$N_d/N_c\f$) are used on the same frequency carrier, the CHSCH sequence, -\f$\mathbf{c}_{\mathrm{CHSCH,2}}\f$, shall be cyclicly shifted by \f$iN_\mathrm{c}, i=1,2,\cdots,N_\mathrm{ant}\f$ samples on antenna \f$i\f$ prior to -cyclic extension. This is to allow nodes to estimate the different channels of the clusterhead efficiently in the frequency domain. - -The transmit power of the CHSCH shall be adjustable by higher layers in order to control the detection range of the clusterhead. - -The parameters of the CHSCH are summarized in the following table and represented by the primitive PHY_CHSCH - -*/ - - -/** @defgroup _CHBCH Clusterhead Broadcast Channel (P-CHBCH,S-CHBCH) Signaling Format -* @ingroup _phy_framing - - -The CHBCH is the signaling channel used by the DLC for passing basic protocol information from the clusterhead to the nodes in its -cluster. This information is used to distribute physical resources during the TTI and some additional protocol information -(association, QoS reservation, etc.). It is located in the first symbol in the TTI,\f$s_{\mathrm{CHBCH}}\f$. In the case of several -clusterheads operating on the same carrier frequency, the CHBCH of adjacent clusters (i.e. those within range of the CHSCH) cannot collide -and thus must be allocated different symbols in the TTI or use disjoint frequency carrier sets. The same is true of the CHBCH and MCH/RACH of -adjacent clusters. The time/frequency allocation of CHSCH/MCH/RACH across several clusters must be accomplished in a distributed fashion based on the -activation times of the different clusterheads and mobility of the clusters. This is beyond the scope of this preliminary specification. - -The CHBCH must use the lowest spectral efficiency (highest sensitivity) coded-modulation format in order to be detectable at large distances. -It will thus employ a rate 1/2 forward-error-correcting code with QPSK modulation \ref _phy_coded_modulation. Information will be coded -across \f$N_{\mathrm{s,CHBCH}}-1\f$ OFDM symbols using all non-zero carriers. Interleaving shall be performed across frequencies with depth -\f$IntDepth_{\mathrm{CHBCH}}\f$. \f$IntDepth_{\mathrm{CHBCH}}\f$ shall be an integer divisor of \f$N_{\mathrm{d}}-N_{\mathrm{z}}\f$. Prior to -forward-error correction coding, a CRC of length 32 bits shall be applied to the PDU arriving from the MAC layer interface. - -Channel estimation can be obtained from the CHSCH which is located in the adjacent OFDM symbols. The CHSCH symbols shall be found starting -in symbol number \f$\lfloor.5N_{\mathrm{symb}}\rfloor\f$ of the CHBCH. - -The number of bits per TTI delivered by the MAC layer interface (FEC + CRC) bits is determined by the formula -\f$(N_{\mathrm{symb}}-1)*(N_{\mathrm{d}}-N_{\mathrm{f}}) - 32\f$. - -If \f$N_\mathrm{pilot}\f$ additional pilot symbols per OFDM symbol are required to handle large frequency offsets due to high-mobility (Doppler) -or significant carrier frequency offsets due to the RF equipment, then these are to be placed at equally spaced positions starting from the -first non-zero carrier in each CHBCH symbol. These simply puncture the coded bit sequence. Care must be taken when choosing the value of -\f$N_\mathrm{f}\f$ with respect to \f$IntDepth_{\mathrm{CHBCH}}\f$ so that consecutive bits of the encoded sequence are not punctured. -A judicious choice would take \f$IntDepth_{\mathrm{CHBCH}}\f$ and \f$N_{\mathrm{d}}-N_{\mathrm{z}}\f$ to be relatively prime. - -In order to allow for multi-cell deployment the CHBCH can use a reduced set of subbands which is controlled by the parameter \f$FreqReuse\f$. It should be set to the maximum number of base stations. Let \f$N_{FreqGroup}\f$ be the number of carriers of one frequency group. Then, the set of carriers used by the \f$i^\mathrm{th}\f$ CHBCH \f$i=1,2,3\f$ (CHBCH 0 is unused) is given by -\f$\left\{((i-1) FreqReuse N_{pilot} ) + k*N_{FreqGroup}, k=0,\cdots,N_{Pilots}-1\right\}\f$. - -The transmit power of the CHBCH shall be adjustable by higher layers in order to control the detection range of the clusterhead. This value will be -transfered via higher layer signaling so that nodes may perform open-loop power control. The following table summarizes the parameters of the CHBCH -which are transfered from higher layers using the primitive PHY_CHBCH. - -*/ - - -/** @defgroup _RACH Random-Access Channel (RACH) Signaling Format -* @ingroup _phy_framing - - -The RACH is a signaling channel used only during the association phase of a node and for other management services. -Several RACHs can be used in parallel to reduce contention in dense networks, and the exact number are signaled by the higher layer. -This resource is not meant, however, to be used for intensive data transmission. Data streams consisting of small sporadic packets -could potentially use this channel if required. - -The RACH is subject to power control. The transmit power should be adjusted in a closed-loop fashion based on the -measured path loss between the node and the clusterhead. - -For adhoc/mesh configurations, one or more MCH are reserved for the RACH. For a cellular -scenario, a SACH resource is opened periodically for the RACH by the clusterhead. - -*/ - - -/** @defgroup _SACH Scheduled-Access (SACH) and Scheduled-Access Control Channel (SACCH) Signaling Format -* @ingroup _phy_framing - -The SACH/SACCH is a multiplexed resource containing both signaling information (Scheduled Access Control CHannel) and user plane traffic -(Scheduled Access CHannel). The SACH is a set of data streams multiplexed by multiple-antenna OFDMA containing user traffic for several -destinations. The SACCH contains low-layer protocol information regarding sequencing (for ARQ and channel decoding) and signaling for -channel feedback mechanisms. In AdHoc/Mesh configuration, the SACCH is a resource common to all destinations sharing the SACH and -its data is multiplexed with those of the SACH. In the cellular configuration, the SACCH -is located in the first allocated symbol and uses the lowest-order (highest protection) coded-modulation format. Aside from low-level signaling -it contains the allocation formats used by the set of streams in the SACH, specifically the coded-modulation formats and frequency-allocations in the -case of the AdHoc/Mesh configuration. In the downlink of a cellular configuration, the SACCH information is embedded in the CHBCH PDU. - -The transmission format of the SACH/SACCH can either use classical OFDM or digital FDM, and this is signaled by the higher layers. - -Each SACH/SACCH is made up of \f$N_{\mathrm{symb,SACH}}\f$ OFDM symbols. The number of symbols -used by a particular SACH in a particular TTI is broadcast via MAC-layer signaling in the CHBCH and depends QoS parameters and -measurements. It is thus a dynamic parameter known by all nodes in the cluster at the beginning of each TTI. - -A SACH/SACCH contains \f$N_\mathrm{pilot,SACCH}\f$ pilot symbols during the SACCH symbols to allow for multi-antenna wideband channel estimation, and -\f$N_\mathrm{pilot,SACH}\f$ pilot symbols per SACH symbol for carrier frequency offset tracking. The encoding rules for the SACCH -pilot symbols is identical to the MCH/RACH on the first transmit antenna. If multiple transmit antennas are employed, the pilot symbols for antenna -\f$i=0,1,\cdots,N_\mathrm{ant}\f$ in position $k$ is multiplied by the complex phasor sequence \f$e^{j*2*pi*kiN_\mathrm{p}/N_\mathrm{d}}\f$. -This phasor sequence ensures that the \f$N_\mathrm{ant}\f$ channel responses are orthogonal at the receiver provided -\f$N_\mathrm{ant}N_\mathrm{p}\leq N_\mathrm{d}\f$ and \f$N_\mathrm{p}\f$ is less than the maximum channel duration plus maximum propagation delay. - -Both \f$N_\mathrm{pilot,SACH}\f$ and \f$N_\mathrm{ant}\f$ are broadcast using higher layer signaling or pre-configured. - -The number of samples for SACH/SACCH data is -\f$N_\mathrm{samp,SACH} = N_\mathrm{symb,SACH}(N_\mathrm{d}-N_\mathrm{f} - N_\mathrm{pilot,SACCH} - N_\mathrm{pilot,SACH}) - 32\f$. -SACCH data is to be encoded using the lowest spectral efficiency coded-modulation format, namely a rate 1/2 forward error-correcting code with QPSK -modulation. If multiple transmit antennas are used, then the lowest spectral-efficiency BICM space-time code is to be employed. Prior to FEC coding a -CRC shall be computed on the SACCH data and should be concatenated to the tail of the information. The total number of -coded bits for the SACCH depends on the number of streams. It should be kept to a minimum with respect to the total number of data bits in the SACH -streams in order to guarantee efficiency. - -Since the SACH is a dynamically allocated resource based on channel quality measures, -sample interleaving across different OFDM carriers is not required. - -Prior to forward error-correction coding, a CRC of length 32 bits shall be applied to the PDU. - -The SACH is the only resource for which the output of the channel coding block is vectorial, in the case of multiple transmit antennas. Space-time signal -processing is therefore possible on the SACH data streams. Identical interleaving is performed on all antenna streams and the choice of coded-modulation -and space-time processing methods is determined by the MAC scheduler. A choice of 16 different formats are considered including some of the legacy -802.11a formats. The formats could potentially be reconfigurable and installed at run-time or over-the-air. This is discussed in \ref _phy_coded_modulation. -Each stream can use a separate coded-modulation format. - -Streams can use a subset of the OFDM carriers according to the frequency allocation vector as mentioned earlier. The allocations are chosen by the opportunistic -scheduling algorithm in the MAC layer in order to achieve multi-user diversity and potentially spatial-multiplexing. - -The configuration information for the SACH/SACCH resource are partially signaled by higher layers and partially computed dynamically by the scheduling algorithm in the MAC. They are described by the primitive PHY_SACH summarized in the following table. - - -*/ - -/*! \brief Extension Type */ -typedef enum { - CYCLIC_PREFIX, - CYCLIC_SUFFIX, - ZEROS, - NONE -} Extension_t; - - -/*! \brief Transmit Signal Format */ -typedef enum { - OFDM=0, - Digital_FDM -} Signal_format_t; - - -/*! \brief PHY Framing Structure -*/ - -typedef struct PHY_FRAMING { - u_long fc_khz; /*!< \brief Carrier Frequency (kHz)*/ - u_long fs_khz; /*!< \brief Sampling Frequency (kHz)*/ - u_short Nsymb ; /*!< \brief Number of OFDM Symbols per TTI */ - u_short Nd; /*!< \brief Number of OFDM Carriers */ - u_char log2Nd; /*!< \brief Log2 of Number of OFDM Carriers */ - u_short Nc; /*!< \brief Number of Prefix Samples*/ - u_short Nz; /*!< \brief Number of Zero Carriers*/ - u_char Nf; /*!< \brief Number of Frequency Groups*/ - Extension_t Extension_type; /*!< \brief Prefix method*/ -} PHY_FRAMING; - - -/*! \brief PHY_CHSCH Configuration Structure -*/ - -typedef struct PHY_CHSCH { - u_short symbol; /*!< \brief First Symbol of CHSCH in TTI */ - u_short Nsymb; /*!< \brief Number of Symbols of CHSCH in TTI*/ - u_char dd_offset; - u_long chsch_seq_re[32]; /*!< \brief Real part of \f$\mathbf{c}_i\f$ \f$(0\cdots n_1-1 \mathrm{LSBs})\f$*/ - u_long chsch_seq_im[32]; /*!< \brief Imaginary part of \f$\mathbf{c}_i\f$ \f$(0\cdots n_1-1 \mathrm{LSBs})\f$*/ - char CHSCH_POWER_dBm; /*!< \brief Average CHSCH Transmit Power*/ -} PHY_CHSCH; - -/*! \brief PHY_SCH Configuration Structure -*/ -typedef struct PHY_SCH { - u_short Nsymb; /*!< \brief Number of Symbols of SCH in TTI */ - u_char dd_offset; - u_long sch_seq_re[32]; /*!< \brief Real part of \f$\mathbf{c}_i\f$ \f$(0\cdots n_1-1 \mathrm{LSBs})\f$*/ - u_long sch_seq_im[32]; /*!< \brief Imaginary part of \f$\mathbf{c}_i\f$ \f$(0\cdots n_1-1 \mathrm{LSBs})\f$*/ - char SCH_POWER_dBm; /*!< \brief Average SCH Transmit Power*/ -} PHY_SCH; - - -/*! \brief PHY_CHBCH Configuration Structure -*/ - -typedef struct PHY_CHBCH { - u_short symbol; /*!< \brief First Symbol of CHBCH in TTI */ - u_short Nsymb; /*!< \brief Number of Symbols of CHBCH in TTI */ - u_short IntDepth; /*!< \brief Frequency Interleaving depth of CHBCH */ - u_char dd_offset; - u_short Npilot; /*!< \brief Number of pilot symbols in CHBCH */ - u_long pilot_re[8]; /*!< \brief Pilot symbols (Real part) */ - u_long pilot_im[8]; /*!< \brief Pilot symbols (Imag part) */ - u_char FreqReuse; /*!< \brief Frequency Reuse Factor */ - u_char FreqReuse_ind; /*!< \brief Frequency Reuse Index */ - char CHBCH_POWER_dBm; /*!< \brief Average CHBCH Transmit Power*/ -} PHY_CHBCH; - -typedef struct PHY_MRBCH { - u_short symbol; /*!< \brief First Symbol of MRBCH in TTI */ - u_short Nsymb; /*!< \brief Number of Symbols of MRBCH in TTI */ - u_short IntDepth; /*!< \brief Frequency Interleaving depth of MRBCH */ - u_char dd_offset; - u_short Npilot; /*!< \brief Number of pilot symbols in MRBCH */ - u_long pilot_re[8]; /*!< \brief Pilot symbols (Real part) */ - u_long pilot_im[8]; /*!< \brief Pilot symbols (Imag part) */ - u_char FreqReuse; /*!< \brief Frequency Reuse Factor */ - u_char FreqReuse_ind; /*!< \brief Frequency Reuse Index */ - char MRBCH_POWER_dBm; /*!< \brief Average MRBCH Transmit Power*/ -} PHY_MRBCH; - -/*! \brief PHY SACH/SACCH Configuration Structure -*/ - - -typedef struct PHY_SACH { - Signal_format_t Signal_format; /*!< \brief Transmit Signal format of SACH/SACCH*/ - u_char Npilot; /*!< \brief Number of pilot symbols */ - u_long pilot_re[8]; /*!< \brief Pilot symbols (real part) */ - u_long pilot_im[8]; /*!< \brief Pilot symbols (imag part) */ - char SACH_POWER_dBm; /*!< \brief Average MCH/RACH Transmit Power*/ -} PHY_SACH; - - -/* @}*/ - - - -/** @defgroup _phy_coded_modulation Coded Modulation and H-ARQ -* @ingroup physical_layer_ -* @{ -OpenAirMesh makes use of punctured binary codes (64-state rate 1/2 convolutional or 8-state rate 1/3 3GPP/LTE Turbo code). -Puncturing can use either 3GPP rate matching or random puncturing in order to fine tune the coding rate to adapt to -configurable transport block sizes delivered to PHY by the MAC. The overall coding sub-system is shown in -Figure below. New transport blocks arriving from the MAC layer (based on multi-user scheduling) are coded -using a CRC extension and the chosen binary code. These are then fed to the active transport block buffer along with -those that are to be retransmitted. Each transmitted block is punctured and then passed to a bit-interleaver and -modulation mapper (BICM). OpenAirMesh supports QPSK, 16-QAM and 64-QAM modulation. - -\image html openair_coding.png "Coded Modulation Subsystem" -\image latex openair_coding.png "Coded Modulation Subsystem" width=15cm - -The transmitted transport blocks can be split into to two spatial streams in the case of point-to-point MIMO transmission. -Each stream receives an adjustable amplitude and then each is passed to a different (orthogonal) space-time parser which -guarantees that both streams use different antennas in the same time/frequency dimension. This allows for low-complexity -successive detection at the receiver and maximizes diversity against fading. This is a form of superposition coding since -the two streams are combined additively in the air through the use of multiple transmit antennas. - -A second design objective for this coding strategy, in addition to low-complexity point-to-point MIMO operation, is that -the same transmitter and receiver structure can be used in a distributed MIMO scenario. Here one spatial stream is used -at each source and the second stream originates in another part of the network, either in the same cluster or an adjacent -cluster. Co-operation is needed in order to guarantee different STF parsing for the two streams so that they can be -decoupled at the SIC receiver. A particular user can decode both streams or simply select the one it requires. - -*/ -/** @defgroup _phy_scrambling Transport block Scrambling -* @ingroup _phy_coded_modulation - -Each transport block is scrambled using the LFSR shown in the following figure with a random initial state -in the LFSR determined at deployment time. The LFSR is used in the to descramble the SDU. Scrambling is always -performed on all transport channels. - -\image html scrambler.png "MAC SDU Scrambling" -\image latex scrambler.png "MAC SDU Scrambling" width=15cm - -\note More information on Linear feedback shift register (LFSR) can be found on http://homepage.mac.com/afj/lfsr.html or http://www-math.cudenver.edu/~wcherowi/courses/m5410/m5410fsr.html -*/ - -/** @defgroup _phy_crc Cyclic Redundancy Check -* @ingroup _phy_coded_modulation - -For the purpose of error-detection a cyclic-redundancy check (CRC) is applied to every transport block entering the -PHY coding subsystem, including those destined for the CHBCH,MCH, RACH and SACCH. To the latter are a applied an -8-bit systematic CRC defined by the generator \f$g_8(D)=1+D+D^3+D^4+D^7+D^8\f$. Data on the SACH is encoded using a -24-bit CRC defined by the generator \f$g_{16}(D)=1+D^5+D^{12}+D^{15}\f$. -\note: Basic information about CRC can be found at: http://www.mathpages.com/home/kmath458.htm or http://utopia.knoware.nl/users/eprebel/Communication/CRC/ -*/ - -/**@defgroup _phy_conv_cod Convolutional Coding -* @ingroup _phy_coded_modulation - -For coded-modulation formats using convolutional coding, the 802.11a rate 1/2 64-state convolutional coder shown -below shall be applied to the scrambled and parity-checked transport blocks. - -\image html convolutional.png "802.11a Convolutional Code" -\image latex convolutional.png "802.11a Convolutional Code" width=15cm - -*/ - -/** @defgroup _phy_puncturing_ Puncturing -* @ingroup _phy_coded_modulation - -Random puncturing makes use of a 32-bit Tausworthe random number generator. Let \f$S_i,i\in\{0,1,2\}\f$ be -the 32-bit initial values of the generator state given by - -\f$S_0(0) = \mathrm{1E23D852} + 16s\f$ - -\f$S_1(0) = \mathrm{81F38A1C} + 16s\f$ - -\f$S_2(0) = \mathrm{FE1A133E} + 16s\f$ - -where \f$s\f$ is a seed. The seed is typically different for each transport block and each round in the -HARQ protocol. It can be also used for layer 1 encryption. - -The state recursions at iteration \f$n\f$ are given by - -\f$b_0(n)=((2^{13}S_0(n-1))\oplus S_0(n-1))2^{-19}\f$ - -\f$b_1(n)=((2^{2}S_1(n-1))\oplus S_1(n-1))2^{-25}\f$ - -\f$b_2(n)=((2^{3}S_2(n-1))\oplus S_2(n-1))2^{-11}\f$ - -\f$S_0(n)=((S_0(n-1)\mathrm{and}\mathrm{FFFFFFFE})2^{12})\oplus b_0(n)\f$ - -\f$S_1(n)=((S_1(n-1)\mathrm{and}\mathrm{FFFFFFF8})2^{4})\oplus b_0(n)\f$ - -\f$S_2(n)=((S_2(n-1)\mathrm{and}\mathrm{FFFFFFF0})2^{17})\oplus b_0(n)\f$ - -and the output of the generator is \f$U(n)=S_0(n)\oplus S_1(n)\oplus S_2(n)\f$. - -Let \f$N_c\f$ be the number of coded bits after puncturing, \f$N_i\f$ be the number of input bits and -\f$N_{\mathrm{bps}}\f$ be the number bits per symbol \f$N_{\mathrm{bps}}\in\{2,4,6\}\f$. Let the -input sequence be denoted \f$c[i],i\in\{0,1,\cdots,N_i-1\}\f$. The -Tausworthe puncturing procedure is achieved according to the following algorithm for a rate 1/2 binary code: - -1. Based on \f$N_c\f$, \f$N_i\f$ check that the rate falls between (\f$\frac{N_{\mathrm{bps}}}{4}\f$,\f$\frac{3N_{\mathrm{bps}}}{8}\f$), -otherwise declare an error. - -2. Set the number of punctured bits to \f$N_p\leftarrow (N_i-N_c)/N_{\mathrm{bps}}\f$. - -3. Initially mark all \f$N_c\f$ coded bits to be transmitted. - -4. Set the initial seed of the Tausworthe to the function value \f$\mathrm{s}\f$ - -5. Set \f$N_{i2}\leftarrow \lfloor N_i/N_{\mathrm{bps}}\rfloor \f$. - -6. Set \f$i\leftarrow0\f$ - -7. Let \f$U(i)\f$ be the \f$i^{\mathrm{th}}\f$ output of the Tausworthe generator and -\f$U'(i)=U(i)\mathrm{mod}2^{\lceil \log_2(N_{i2})\rceil}\f$ - -8. if \f$U'(i) < N_{i2}\f$ and \f$\mathrm{c[U'(i)]}\f$ is not already punctured go to 10 - -9. goto 7 - -10. Mark \f$c[U' + jN_{i2}])\f$ as punctured for \f$j=0,1,\cdots,N_{\mathrm{bps}}-1\f$. - -11. Set \f$i\leftarrow i+1\f$ - -12. if \f$i. - - Contact Information - OpenAirInterface Admin: openair_admin@eurecom.fr - OpenAirInterface Tech : openair_tech@eurecom.fr - OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr - - Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE - - *******************************************************************************/ -#ifndef __PHY_SPEC_DEFS_TOP_H__ -#define __PHY_SPEC_DEFS_TOP_H__ - -#include "types.h" - - - -/*! \brief Extension Type */ -typedef enum { - CYCLIC_PREFIX, - CYCLIC_SUFFIX, - ZEROS, - NONE -} Extension_t; - - -/// mod_sym_t is the type of txdataF -#ifdef IFFT_FPGA -typedef unsigned char mod_sym_t; -#else -typedef int mod_sym_t; -#endif //IFFT_FPGA - - -#endif /*__PHY_SPEC_DEFS_TOP_H__ */ - - - - - - - - - - - - - - - diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 817eab8d5d..43d2120639 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -72,7 +72,6 @@ #define PUCCH 1 extern int exit_openair; -//extern void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms); unsigned char dlsch_input_buffer[2700] __attribute__ ((aligned(32))); @@ -636,7 +635,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e for (aa=0; aalte_frame_parms.nb_antennas_tx_eNB; aa++) { memset(&phy_vars_eNB->lte_eNB_common_vars.txdataF[0][aa][subframe*phy_vars_eNB->lte_frame_parms.ofdm_symbol_size*(phy_vars_eNB->lte_frame_parms.symbols_per_tti)], - 0,phy_vars_eNB->lte_frame_parms.ofdm_symbol_size*(phy_vars_eNB->lte_frame_parms.symbols_per_tti)*sizeof(mod_sym_t)); + 0,phy_vars_eNB->lte_frame_parms.ofdm_symbol_size*(phy_vars_eNB->lte_frame_parms.symbols_per_tti)*sizeof(int32_t)); } } @@ -1990,7 +1989,7 @@ void process_HARQ_feedback(uint8_t UE_id, // then Increment DLSCH round index dlsch_harq_proc->round++; - if (dlsch_harq_proc->round == 1/*dlsch->Mdlharq*/) { + if (dlsch_harq_proc->round == dlsch->Mlimit) { // This was the last round for DLSCH so reset round and increment l2_error counter #ifdef DEBUG_PHY_PROC LOG_W(PHY,"[eNB %d][PDSCH %x/%d] DLSCH retransmissions exhausted, dropping packet\n",phy_vars_eNB->Mod_id, @@ -2673,7 +2672,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->Mod_id,harq_pid, frame,subframe, i, phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round-1, - phy_vars_eNB->ulsch_eNB[i]->Mdlharq, + phy_vars_eNB->ulsch_eNB[i]->Mlimit, phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[0], phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[1]); @@ -2701,11 +2700,11 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ // dump_ulsch(phy_vars_eNB,sched_subframe,i); //mac_exit_wrapper("ULSCH error"); - if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round== phy_vars_eNB->ulsch_eNB[i]->Mdlharq) { - LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d ULSCH Mdlharq %d reached\n", + if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round== phy_vars_eNB->ulsch_eNB[i]->Mlimit) { + LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d ULSCH Mlimit %d reached\n", phy_vars_eNB->Mod_id,harq_pid, frame,subframe, i, - phy_vars_eNB->ulsch_eNB[i]->Mdlharq); + phy_vars_eNB->ulsch_eNB[i]->Mlimit); phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round=0; phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active=0; @@ -2817,7 +2816,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ //#endif //DEBUG_PHY_PROC for (k=0; k<8; k++) { //harq_processes - for (j=0; jdlsch_eNB[i][0]->Mdlharq; j++) { + for (j=0; jdlsch_eNB[i][0]->Mlimit; j++) { phy_vars_eNB->eNB_UE_stats[i].dlsch_NAK[k][j]=0; phy_vars_eNB->eNB_UE_stats[i].dlsch_ACK[k][j]=0; phy_vars_eNB->eNB_UE_stats[i].dlsch_trials[k][j]=0; @@ -2827,7 +2826,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[k]=0; phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors=0; - for (j=0; julsch_eNB[i]->Mdlharq; j++) { + for (j=0; julsch_eNB[i]->Mlimit; j++) { phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[k][j]=0; phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts_last[k][j]=0; phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[k][j]=0; @@ -3242,7 +3241,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ if ((frame % 100 == 0) && (subframe == 4)) { for (harq_idx=0; harq_idx<8; harq_idx++) { - for (round=0; roundulsch_eNB[i]->Mdlharq; round++) { + for (round=0; roundulsch_eNB[i]->Mlimit; round++) { if ((phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[harq_idx][round] - phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts_last[harq_idx][round]) != 0) { phy_vars_eNB->eNB_UE_stats[i].ulsch_round_fer[harq_idx][round] = diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 61e5bfb000..3a64711cfb 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -513,7 +513,7 @@ void reset_stats(FL_OBJECT *button, long arg) for (i=0; idlsch_eNB[i][0]->Mdlharq; j++) { + for (j=0; jdlsch_eNB[i][0]->Mlimit; j++) { phy_vars_eNB->eNB_UE_stats[i].dlsch_NAK[k][j]=0; phy_vars_eNB->eNB_UE_stats[i].dlsch_ACK[k][j]=0; phy_vars_eNB->eNB_UE_stats[i].dlsch_trials[k][j]=0; @@ -523,7 +523,7 @@ void reset_stats(FL_OBJECT *button, long arg) phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[k]=0; phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors=0; - for (j=0; julsch_eNB[i]->Mdlharq; j++) { + for (j=0; julsch_eNB[i]->Mlimit; j++) { phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[k][j]=0; phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts_last[k][j]=0; phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[k][j]=0; diff --git a/targets/SIMU/USER/init_lte.c b/targets/SIMU/USER/init_lte.c index 172a8e3324..c6784cc5a2 100644 --- a/targets/SIMU/USER/init_lte.c +++ b/targets/SIMU/USER/init_lte.c @@ -73,7 +73,7 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms, for (i=0; idlsch_eNB[i][j] = new_eNB_dlsch(1,NUMBER_OF_HARQ_PID_MAX,NSOFT,frame_parms->N_RB_DL,abstraction_flag); + PHY_vars_eNB->dlsch_eNB[i][j] = new_eNB_dlsch(1,8,NSOFT,frame_parms->N_RB_DL,abstraction_flag); if (!PHY_vars_eNB->dlsch_eNB[i][j]) { LOG_E(PHY,"Can't get eNB dlsch structures for UE %d \n", i); @@ -84,7 +84,7 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms, } } - PHY_vars_eNB->ulsch_eNB[1+i] = new_eNB_ulsch(NUMBER_OF_HARQ_PID_MAX,MAX_TURBO_ITERATIONS, frame_parms->N_RB_UL, abstraction_flag); + PHY_vars_eNB->ulsch_eNB[1+i] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,frame_parms->N_RB_UL, abstraction_flag); if (!PHY_vars_eNB->ulsch_eNB[1+i]) { LOG_E(PHY,"Can't get eNB ulsch structures\n"); @@ -118,18 +118,18 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms, } // ULSCH for RA - PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(NUMBER_OF_HARQ_PID_MAX,MAX_TURBO_ITERATIONS, frame_parms->N_RB_UL, abstraction_flag); + PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(MAX_TURBO_ITERATIONS, frame_parms->N_RB_UL, abstraction_flag); if (!PHY_vars_eNB->ulsch_eNB[0]) { LOG_E(PHY,"Can't get eNB ulsch structures\n"); exit(-1); } - PHY_vars_eNB->dlsch_eNB_SI = new_eNB_dlsch(1,1,NSOFT,frame_parms->N_RB_DL, abstraction_flag); + PHY_vars_eNB->dlsch_eNB_SI = new_eNB_dlsch(1,8,NSOFT,frame_parms->N_RB_DL, abstraction_flag); LOG_D(PHY,"eNB %d : SI %p\n",eNB_id,PHY_vars_eNB->dlsch_eNB_SI); - PHY_vars_eNB->dlsch_eNB_ra = new_eNB_dlsch(1,1,NSOFT,frame_parms->N_RB_DL, abstraction_flag); + PHY_vars_eNB->dlsch_eNB_ra = new_eNB_dlsch(1,8,NSOFT,frame_parms->N_RB_DL, abstraction_flag); LOG_D(PHY,"eNB %d : RA %p\n",eNB_id,PHY_vars_eNB->dlsch_eNB_ra); - PHY_vars_eNB->dlsch_eNB_MCH = new_eNB_dlsch(1,NUMBER_OF_HARQ_PID_MAX,NSOFT,frame_parms->N_RB_DL, 0); + PHY_vars_eNB->dlsch_eNB_MCH = new_eNB_dlsch(1,8,NSOFT,frame_parms->N_RB_DL, 0); LOG_D(PHY,"eNB %d : MCH %p\n",eNB_id,PHY_vars_eNB->dlsch_eNB_MCH); @@ -177,7 +177,7 @@ PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms, - PHY_vars_UE->ulsch_ue[i] = new_ue_ulsch(NUMBER_OF_HARQ_PID_MAX,frame_parms->N_RB_UL, abstraction_flag); + PHY_vars_UE->ulsch_ue[i] = new_ue_ulsch(frame_parms->N_RB_UL, abstraction_flag); if (!PHY_vars_UE->ulsch_ue[i]) { LOG_E(PHY,"Can't get ue ulsch structures\n"); From 87f7d2debd892cbda41f20165e419c6bea6bac02 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 6 Apr 2016 12:04:41 +0200 Subject: [PATCH 129/214] minor typo in iperf script in test setup --- cmake_targets/autotests/tools/iperf_script_phone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/autotests/tools/iperf_script_phone b/cmake_targets/autotests/tools/iperf_script_phone index 77ce8774f3..f9ec7973f4 100755 --- a/cmake_targets/autotests/tools/iperf_script_phone +++ b/cmake_targets/autotests/tools/iperf_script_phone @@ -53,7 +53,7 @@ while true ; do echo "Wating for UE to connect and get IP Address..." sleep 1 else - echo "UE is not connected. IP Address settings are... $cmd" + echo "UE is now connected. IP Address settings are... $cmd" break fi done From 31588ef6b348a66fc73f26934c2d245492ea7fd2 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Thu, 7 Apr 2016 16:38:43 +0200 Subject: [PATCH 130/214] USRP DC Offset fix (downgrade master clock for proper calibration) --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index ece81dc7c3..b899642c05 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -608,7 +608,7 @@ extern "C" { openair0_cfg[0].tx_scheduling_advance = 11*openair0_cfg[0].samples_per_packet; break; case 23040000: - s->usrp->set_master_clock_rate(46.08e6); + s->usrp->set_master_clock_rate(23.04e6); //to be checked openair0_cfg[0].samples_per_packet = 2048; openair0_cfg[0].tx_sample_advance = 113; openair0_cfg[0].tx_bw = 20e6; @@ -616,7 +616,7 @@ extern "C" { openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet; break; case 15360000: - s->usrp->set_master_clock_rate(30.72e6); + s->usrp->set_master_clock_rate(15.36e06); openair0_cfg[0].samples_per_packet = 2048; openair0_cfg[0].tx_sample_advance = 113; openair0_cfg[0].tx_bw = 10e6; @@ -624,7 +624,7 @@ extern "C" { openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; break; case 7680000: - s->usrp->set_master_clock_rate(30.72e6); + s->usrp->set_master_clock_rate(7.68e6); openair0_cfg[0].samples_per_packet = 1024; openair0_cfg[0].tx_sample_advance = 70;//103; openair0_cfg[0].tx_bw = 5e6; @@ -632,7 +632,7 @@ extern "C" { openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; break; case 1920000: - s->usrp->set_master_clock_rate(30.72e6); + s->usrp->set_master_clock_rate(7.68e6); openair0_cfg[0].samples_per_packet = 256; openair0_cfg[0].tx_sample_advance = 40; openair0_cfg[0].tx_bw = 1.25e6; @@ -686,6 +686,8 @@ extern "C" { // display USRP settings std::cout << boost::format("Actual master clock: %fMHz...") % (s->usrp->get_master_clock_rate()/1e6) << std::endl; + + sleep(1); // create tx & rx streamer uhd::stream_args_t stream_args_rx("sc16", "sc16"); From 48885f1f4148c2743d870de58511bc47de82fefd Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Thu, 7 Apr 2016 16:39:23 +0200 Subject: [PATCH 131/214] Pin USRP threads to CPU 0, and all other CPUs are reserved for lte-softmodem --- targets/RT/USER/lte-softmodem.c | 233 +++++++++++++++++++++++++++++++- 1 file changed, 226 insertions(+), 7 deletions(-) diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 5271ca5d4a..59eef9b657 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -50,8 +50,9 @@ #include #include #include - +#include #include "rt_wrapper.h" + #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all #include "assertions.h" @@ -1113,7 +1114,66 @@ static void* eNB_thread_tx( void* param ) LOG_I( HW, "[SCHED] eNB TX deadline thread %d(TID %ld) started on CPU %d\n", proc->subframe, gettid(), sched_getcpu() ); #else - LOG_I( HW, "[SCHED][eNB] TX thread %d started on CPU %d TID %d\n", proc->subframe, sched_getcpu(),gettid() ); + int policy, s, j; + struct sched_param sparam; + char cpu_affinity[1024]; + cpu_set_t cpuset; + + /* Set affinity mask to include CPUs 1 to MAX_CPUS */ + /* CPU 0 is reserved for UHD threads */ + CPU_ZERO(&cpuset); + for (j = 1; j < get_nprocs(); j++) + CPU_SET(j, &cpuset); + + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } + /* Check the actual affinity mask assigned to the thread */ + + s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_getaffinity_np"); + exit_fun("Error getting processor affinity "); + } + memset(cpu_affinity,0,sizeof(cpu_affinity)); + for (j = 0; j < CPU_SETSIZE; j++) + if (CPU_ISSET(j, &cpuset)) + { + char temp[1024]; + sprintf (temp, " CPU_%d", j); + strcat(cpu_affinity, temp); + } + + memset(&sparam, 0 , sizeof (sparam)); + sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; + policy = SCHED_FIFO ; + + s = pthread_setschedparam(pthread_self(), policy, &sparam); + if (s != 0) + { + perror("pthread_setschedparam : "); + exit_fun("Error setting thread priority"); + } + s = pthread_getschedparam(pthread_self(), &policy, &sparam); + if (s != 0) + { + perror("pthread_getschedparam : "); + exit_fun("Error getting thread priority"); + + } + + LOG_I( HW, "[SCHED][eNB] TX thread %d started on CPU %d TID %ld, sched_policy = %s , priority = %d, CPU Affinity=%s \n", proc->subframe, sched_getcpu(),gettid(), + (policy == SCHED_FIFO) ? "SCHED_FIFO" : + (policy == SCHED_RR) ? "SCHED_RR" : + (policy == SCHED_OTHER) ? "SCHED_OTHER" : + "???", + sparam.sched_priority, cpu_affinity ); + + #endif #endif @@ -1200,7 +1260,7 @@ static void* eNB_thread_tx( void* param ) /* short *txdata = (short*)&PHY_vars_eNB_g[0][proc->CC_id]->lte_eNB_common_vars.txdata[0][0][proc->subframe_tx*PHY_vars_eNB_g[0][proc->CC_id]->lte_frame_parms.samples_per_tti]; int i; - for (i=0;i<7680*2;i+=8) { + for (i=0;iCC_id]->lte_frame_parms.samples_per_tti*2;i+=8) { txdata[i] = 2047; txdata[i+1] = 0; txdata[i+2] = 0; @@ -1334,7 +1394,71 @@ static void* eNB_thread_rx( void* param ) LOG_I( HW, "[SCHED] eNB RX deadline thread %d(TID %ld) started on CPU %d\n", proc->subframe, gettid(), sched_getcpu() ); #else - LOG_I( HW, "[SCHED][eNB] RX thread %d started on CPU %d TID %d\n", proc->subframe, sched_getcpu(),gettid() ); + int policy, s, j; + struct sched_param sparam; + char cpu_affinity[1024]; + cpu_set_t cpuset; + + /* Set affinity mask to include CPUs 1 to MAX_CPUS */ + /* CPU 0 is reserved for UHD */ + CPU_ZERO(&cpuset); + for (j = 2; j < get_nprocs(); j++) + CPU_SET(j, &cpuset); + + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun (" Error setting processor affinity :"); + } + /* Check the actual affinity mask assigned to the thread */ + + s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror ("pthread_getaffinity_np"); + exit_fun (" Error getting processor affinity :"); + } + memset(cpu_affinity,0, sizeof(cpu_affinity)); + + for (j = 0; j < CPU_SETSIZE; j++) + if (CPU_ISSET(j, &cpuset)) + { + char temp[1024]; + sprintf (temp, " CPU_%d", j); + strcat(cpu_affinity, temp); + } + + + memset(&sparam, 0 , sizeof (sparam)); + sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; + + policy = SCHED_FIFO ; + s = pthread_setschedparam(pthread_self(), policy, &sparam); + if (s != 0) + { + perror("pthread_setschedparam : "); + exit_fun("Error setting thread priority"); + } + + memset(&sparam, 0 , sizeof (sparam)); + + s = pthread_getschedparam(pthread_self(), &policy, &sparam); + if (s != 0) + { + perror("pthread_getschedparam"); + exit_fun("Error getting thread priority"); + } + + +LOG_I( HW, "[SCHED][eNB] RX thread %d started on CPU %d TID %ld, sched_policy = %s, priority = %d, CPU Affinity = %s\n", proc->subframe, sched_getcpu(),gettid(), + (policy == SCHED_FIFO) ? "SCHED_FIFO" : + (policy == SCHED_RR) ? "SCHED_RR" : + (policy == SCHED_OTHER) ? "SCHED_OTHER" : + "???", + sparam.sched_priority, cpu_affinity); + + #endif #endif // RTAI @@ -1675,6 +1799,69 @@ static void* eNB_thread( void* arg ) gettid(),sched_getcpu()); } +#else + + int policy, s, j; + struct sched_param sparam; + char cpu_affinity[1024]; + cpu_set_t cpuset; + + /* Set affinity mask to include CPUs 1 to MAX_CPUS */ + /* CPU 0 is reserved for UHD threads */ + CPU_ZERO(&cpuset); + for (j = 1; j < get_nprocs(); j++) + CPU_SET(j, &cpuset); + + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } + /* Check the actual affinity mask assigned to the thread */ + + s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_getaffinity_np"); + exit_fun("Error getting processor affinity "); + } + memset(cpu_affinity, 0 , sizeof(cpu_affinity)); + for (j = 0; j < CPU_SETSIZE; j++) + if (CPU_ISSET(j, &cpuset)) + { + char temp[1024]; + sprintf(temp, " CPU_%d ", j); + strcat(cpu_affinity, temp); + } + + memset(&sparam, 0 , sizeof (sparam)); + sparam.sched_priority = sched_get_priority_max(SCHED_FIFO); + policy = SCHED_FIFO ; + + s = pthread_setschedparam(pthread_self(), policy, &sparam); + if (s != 0) + { + perror("pthread_setschedparam : "); + exit_fun("Error setting thread priority"); + } + s = pthread_getschedparam(pthread_self(), &policy, &sparam); + if (s != 0) + { + perror("pthread_getschedparam : "); + exit_fun("Error getting thread priority"); + + } + + + LOG_I( HW, "[SCHED][eNB] Started eNB main thread on CPU %d TID %ld , sched_policy = %s, priority = %d, CPU Affinity = %s \n", (int)sched_getcpu(), gettid(), + (policy == SCHED_FIFO) ? "SCHED_FIFO" : + (policy == SCHED_RR) ? "SCHED_RR" : + (policy == SCHED_OTHER) ? "SCHED_OTHER" : + "???", + (int) sparam.sched_priority, cpu_affinity); + + #endif #endif @@ -1684,9 +1871,7 @@ static void* eNB_thread( void* arg ) goto eNB_thread_cleanup; #ifdef RTAI - printf( "[SCHED][eNB] Started eNB main thread (id %p)\n", task ); -#else - printf( "[SCHED][eNB] Started eNB main thread on CPU %d TID %ld\n", sched_getcpu(), gettid()); + LOG_I( HW, "[SCHED][eNB] Started eNB main thread (id %p)\n", task ); #endif #ifdef HARD_RT @@ -3111,6 +3296,40 @@ int main( int argc, char **argv ) #endif } + cpu_set_t cpuset; + int s; + char cpu_affinity[1024]; + + LOG_I(HW, "Setting the affinity of main function to CPU 0, for device library to use CPU 0 only!\n"); + + CPU_ZERO(&cpuset); + CPU_SET(0, &cpuset); + + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } + /* Check the actual affinity mask assigned to the thread */ + + s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_getaffinity_np"); + exit_fun("Error getting processor affinity "); + } + memset(cpu_affinity, 0 , sizeof(cpu_affinity)); + for (int j = 0; j < CPU_SETSIZE; j++) + if (CPU_ISSET(j, &cpuset)) + { + char temp[1024]; + sprintf(temp, " CPU_%d ", j); + strcat(cpu_affinity, temp); + } + + LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity); + /* device host type is set*/ openair0.host_type = BBU_HOST; /* device type is initialized NONE_DEV (no RF device) when the RF device will be initiated device type will be set */ From b1388b69571f3bc981fd56ecde26d953fb118137 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 8 Apr 2016 18:29:12 +0200 Subject: [PATCH 132/214] file to free memory in test setup --- cmake_targets/autotests/tools/free_mem.bash | 36 +++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 cmake_targets/autotests/tools/free_mem.bash diff --git a/cmake_targets/autotests/tools/free_mem.bash b/cmake_targets/autotests/tools/free_mem.bash new file mode 100755 index 0000000000..873d6121e7 --- /dev/null +++ b/cmake_targets/autotests/tools/free_mem.bash @@ -0,0 +1,36 @@ +#!/bin/bash +#****************************************************************************** + +# OpenAirInterface +# Copyright(c) 1999 - 2014 Eurecom + +# OpenAirInterface is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + + +# OpenAirInterface is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with OpenAirInterface.The full GNU General Public License is +# included in this distribution in the file called "COPYING". If not, +# see . + +# Contact Information +# OpenAirInterface Admin: openair_admin@eurecom.fr +# OpenAirInterface Tech : openair_tech@eurecom.fr +# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + +# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + +# *******************************************************************************/ +# \author Navid Nikaein, Rohit Gupta + +# To free unused memory else test setup runs out of memory +sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches ' + + From 00b26f36a0aa68bcd2385dc22c5d7c90663922d8 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Sat, 9 Apr 2016 19:04:56 +0200 Subject: [PATCH 133/214] minor fix for CPU Affinity support in lte-softmodem --- targets/RT/USER/lte-softmodem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 59eef9b657..583be1ccb7 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -1402,7 +1402,7 @@ static void* eNB_thread_rx( void* param ) /* Set affinity mask to include CPUs 1 to MAX_CPUS */ /* CPU 0 is reserved for UHD */ CPU_ZERO(&cpuset); - for (j = 2; j < get_nprocs(); j++) + for (j = 1; j < get_nprocs(); j++) CPU_SET(j, &cpuset); s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); @@ -3296,6 +3296,8 @@ int main( int argc, char **argv ) #endif } + +#ifndef LOWLATENCY cpu_set_t cpuset; int s; char cpu_affinity[1024]; @@ -3329,6 +3331,7 @@ int main( int argc, char **argv ) } LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity); +#endif /* device host type is set*/ openair0.host_type = BBU_HOST; From 8aa61db4bad6b94a172b838999d0fa273b90e3b2 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Sat, 9 Apr 2016 19:54:44 +0200 Subject: [PATCH 134/214] CPU Affinity partitioninig between TX/RX threads when not using DEADLINE scheduler --- targets/RT/USER/lte-softmodem.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 4630df4a4f..dbe56f85cb 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -1122,9 +1122,10 @@ static void* eNB_thread_tx( void* param ) /* Set affinity mask to include CPUs 1 to MAX_CPUS */ /* CPU 0 is reserved for UHD threads */ + /* CPU 1 is reserved for all TX threads */ CPU_ZERO(&cpuset); - for (j = 1; j < get_nprocs(); j++) - CPU_SET(j, &cpuset); + //for (j = 1; j < get_nprocs(); j++) + CPU_SET(1, &cpuset); s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); if (s != 0) @@ -1402,8 +1403,10 @@ static void* eNB_thread_rx( void* param ) /* Set affinity mask to include CPUs 1 to MAX_CPUS */ /* CPU 0 is reserved for UHD */ + /* CPU 1 is reserved for all TX threads */ + /* CPU 2..MAX_CPUS is reserved for all RX threads */ CPU_ZERO(&cpuset); - for (j = 1; j < get_nprocs(); j++) + for (j = 2; j < get_nprocs(); j++) CPU_SET(j, &cpuset); s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); From 2dfe84a7e4da77d3fae2d44a85aac0946e9f7ae4 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 10 Apr 2016 23:25:58 +0200 Subject: [PATCH 135/214] bugfixing for UL. Remaining problems: CCE allocations in subframe 5 lead to occasional illegal DCI allocations (affects UL DCI which is missed by UE). waveform compliance with CQI in ULSCH. --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 10 +- openair1/PHY/LTE_TRANSPORT/phich.c | 6 +- openair1/PHY/LTE_TRANSPORT/prach.c | 64 +- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 516 ++----- openair1/SCHED/phy_procedures_lte_eNb.c | 1286 ++++++++--------- openair1/SIMULATION/LTE_PHY/dlsim.c | 4 +- openair1/SIMULATION/LTE_PHY/mbmssim.c | 3 +- openair1/SIMULATION/LTE_PHY/pbchsim.c | 13 +- openair1/SIMULATION/LTE_PHY/pdcchsim.c | 7 +- openair1/SIMULATION/LTE_PHY/ulsim.c | 4 +- openair2/LAYER2/MAC/eNB_scheduler.c | 12 + openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 17 +- openair2/UTIL/LOG/vcd_signal_dumper.c | 18 + openair2/UTIL/LOG/vcd_signal_dumper.h | 18 + .../CONF/enb.band7.tm1.100PRB.usrpb210.conf | 8 +- targets/RT/USER/eNB_usrp.gtkw | 40 +- 16 files changed, 810 insertions(+), 1216 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 852e610435..a163225f03 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -7127,10 +7127,10 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu, harq_pid = subframe2harq_pid(frame_parms, pdcch_alloc2ul_frame(frame_parms, - phy_vars_eNB->proc[sched_subframe].frame_tx, - subframe), + phy_vars_eNB->proc[sched_subframe].frame_tx, + subframe), pdcch_alloc2ul_subframe(frame_parms,subframe)); - + // printf("eNB: sched_subframe %d, subframe %d, frame_tx %d\n",sched_subframe,subframe,phy_vars_eNB->proc[sched_subframe].frame_tx); switch (frame_parms->N_RB_DL) { @@ -7598,9 +7598,9 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu, break; } } else { - ulsch->harq_processes[harq_pid]->O_RI = 0;//1; + ulsch->harq_processes[harq_pid]->O_RI = 0; ulsch->harq_processes[harq_pid]->Or2 = 0; - ulsch->harq_processes[harq_pid]->Or1 = 0;//sizeof_HLC_subband_cqi_nopmi_5MHz; + ulsch->harq_processes[harq_pid]->Or1 = 0; ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi; } diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index 4c9986bf16..8b3a6c8758 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -1466,7 +1466,6 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, nseq_PHICH = ((ulsch_eNB[UE_id]->harq_processes[harq_pid]->first_rb/Ngroup_PHICH) + ulsch_eNB[UE_id]->harq_processes[harq_pid]->n_DMRS)%(2*NSF_PHICH); - //#ifdef DEBUG_PHICH LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d dci_alloc %d)\n", phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx, subframe,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH, @@ -1474,7 +1473,6 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, ulsch_eNB[UE_id]->harq_processes[harq_pid]->first_rb, ulsch_eNB[UE_id]->harq_processes[harq_pid]->dci_alloc); - //#endif if (ulsch_eNB[UE_id]->Msg3_active == 1) { LOG_D(PHY,"[eNB %d][PUSCH %d][RAPROC] Frame %d, subframe %d: Generating Msg3 PHICH for UE %d, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d\n", phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe, @@ -1509,12 +1507,10 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d, subframe %d : PHICH NACK / (no format0 DCI) Setting subframe_scheduling_flag\n", phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe); ulsch_eNB[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 1; - // ulsch_eNB[UE_id]->harq_processes[harq_pid]->Ndi = 0; - // ulsch_eNB[UE_id]->harq_processes[harq_pid]->round++; //this is already done in phy_procedures ulsch_eNB[UE_id]->harq_processes[harq_pid]->rvidx = rv_table[ulsch_eNB[UE_id]->harq_processes[harq_pid]->round&3]; ulsch_eNB[UE_id]->harq_processes[harq_pid]->O_RI = 0; ulsch_eNB[UE_id]->harq_processes[harq_pid]->Or2 = 0; - ulsch_eNB[UE_id]->harq_processes[harq_pid]->Or1 = 0;//sizeof_HLC_subband_cqi_nopmi_5MHz; + ulsch_eNB[UE_id]->harq_processes[harq_pid]->Or1 = 0; ulsch_eNB[UE_id]->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi; } else { diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c index 8173f35f67..b93519d393 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach.c +++ b/openair1/PHY/LTE_TRANSPORT/prach.c @@ -1058,21 +1058,24 @@ int32_t generate_prach( PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id, uint8_t subfra } //__m128i mmtmpX0,mmtmpX1,mmtmpX2,mmtmpX3; -void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_energy_list, uint16_t *preamble_delay_list, uint16_t Nf, uint8_t tdd_mapindex) +void rx_prach(PHY_VARS_eNB *phy_vars_eNB, + uint8_t subframe, + uint16_t *preamble_energy_list, + uint16_t *preamble_delay_list, + uint16_t Nf, + uint8_t tdd_mapindex) { int i; - lte_frame_type_t frame_type = phy_vars_eNB->lte_frame_parms.frame_type; + lte_frame_type_t frame_type = phy_vars_eNB->lte_frame_parms.frame_type; - //uint8_t tdd_config = phy_vars_eNB->lte_frame_parms.tdd_config; - uint16_t rootSequenceIndex = phy_vars_eNB->lte_frame_parms.prach_config_common.rootSequenceIndex; - uint8_t prach_ConfigIndex = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex; - uint8_t Ncs_config = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig; - uint8_t restricted_set = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag; - //uint8_t n_ra_prboffset = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset; - int16_t *prachF = phy_vars_eNB->lte_eNB_prach_vars.prachF; - int16_t **rxsigF = phy_vars_eNB->lte_eNB_prach_vars.rxsigF; - int16_t **prach_ifft = phy_vars_eNB->lte_eNB_prach_vars.prach_ifft; + uint16_t rootSequenceIndex = phy_vars_eNB->lte_frame_parms.prach_config_common.rootSequenceIndex; + uint8_t prach_ConfigIndex = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex; + uint8_t Ncs_config = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig; + uint8_t restricted_set = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag; + int16_t *prachF = phy_vars_eNB->lte_eNB_prach_vars.prachF; + int16_t **rxsigF = phy_vars_eNB->lte_eNB_prach_vars.rxsigF; + int16_t **prach_ifft = phy_vars_eNB->lte_eNB_prach_vars.prach_ifft; int16_t *prach[4]; int16_t *prach2; uint8_t n_ra_prb; @@ -1086,12 +1089,8 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene uint16_t numshift=0; uint16_t *prach_root_sequence_map; uint8_t prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type); - //uint8_t Nsp=2; - //uint8_t f_ra,t1_ra; uint16_t N_ZC = (prach_fmt <4)?839:139; uint8_t not_found; - // LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms; - // uint16_t subframe_offset; int k; uint16_t u; int16_t *Xu; @@ -1107,7 +1106,6 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene for (aa=0; aalte_eNB_common_vars.rxdata[0][aa][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti-phy_vars_eNB->N_TA_offset]; - // remove_625_Hz(phy_vars_eNB,prach[aa]); } // First compute physical root sequence @@ -1134,37 +1132,6 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene n_ra_prb = get_prach_prb_offset(&(phy_vars_eNB->lte_frame_parms),tdd_mapindex,Nf); prach_root_sequence_map = (prach_fmt < 4) ? prach_root_sequence_map0_3 : prach_root_sequence_map4; - /* - // this code is now part of get_prach_prb_offset - if (frame_type == TDD) { // TDD - // adjust n_ra_prboffset for frequency multiplexing (p.36 36.211) - - f_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[tdd_mapindex].f_ra; - - if (prach_fmt < 4) { - if ((f_ra&1) == 0) { - n_ra_prb = n_ra_prboffset + 6*(f_ra>>1); - } else { - n_ra_prb = phy_vars_eNB->lte_frame_parms.N_RB_UL - 6 - n_ra_prboffset + 6*(f_ra>>1); - } - - } else { - if ((tdd_config >2) && (tdd_config<6)) - Nsp = 2; - - t1_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t1_ra; - - if ((((Nf&1)*(2-Nsp)+t1_ra)&1) == 0) { - n_ra_prb = 6*f_ra; - } else { - n_ra_prb = phy_vars_eNB->lte_frame_parms.N_RB_UL - 6*(f_ra+1); - } - - } - } - */ - - // printf("NCS %d\n",NCS); // PDP is oversampled, e.g. 1024 sample instead of 839 // Adapt the NCS (zero-correlation zones) with oversampling factor e.g. 1024/839 NCS2 = (N_ZC==839) ? ((NCS<<10)/839) : ((NCS<<8)/139); @@ -1217,9 +1184,6 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene break; } - // nsymb = (frame_parms->Ncp==0) ? 14:12; - // subframe_offset = (unsigned int)frame_parms->ofdm_symbol_size*subframe*nsymb; - preamble_offset_old = 99; for (preamble_index=0 ; preamble_index<64 ; preamble_index++) { diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 0b63541555..60838c44b7 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -246,7 +246,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, uint8_t *columnset; unsigned int sumKr=0; unsigned int Qprime,L,G,Q_CQI,Q_RI,H,Hprime,Hpp,Cmux,Rmux_prime,O_RCC; - unsigned int Qprime_ACK,Qprime_CQI,Qprime_RI,len_ACK=0,len_RI=0; + unsigned int Qprime_ACK,Qprime_RI,len_ACK=0,len_RI=0; // uint8_t q_ACK[MAX_ACK_PAYLOAD],q_RI[MAX_RI_PAYLOAD]; int metric,metric_new; uint8_t o_flip[8]; @@ -410,12 +410,13 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, else L=8; + // NOTE: we have to handle the case where we have a very small number of bits (condition on pg. 26 36.212) if (ulsch_harq->Or1 > 0) Qprime = (ulsch_harq->Or1 + L) * ulsch_harq->Msc_initial*ulsch_harq->Nsymb_initial * ulsch->beta_offset_cqi_times8; else Qprime=0; - if (Qprime > 0) { + if (Qprime > 0) { // check if ceiling is larger than floor in Q' expression if ((Qprime % (8*sumKr)) > 0) Qprime = 1+(Qprime/(8*sumKr)); else @@ -426,14 +427,10 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, - if (Qprime > (G - ulsch_harq->O_RI)) - Qprime = G - ulsch_harq->O_RI; - Q_CQI = Q_m * Qprime; #ifdef DEBUG_ULSCH_DECODING msg("ulsch_decoding: G %d, Q_RI %d, Q_CQI %d (L %d, Or1 %d) O_ACK %d\n",G,Q_RI,Q_CQI,L,ulsch_harq->Or1,ulsch_harq->O_ACK); #endif - Qprime_CQI = Qprime; G = G - Q_RI - Q_CQI; @@ -452,9 +449,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, // Rmux = Hpp*Q_m/Cmux; Rmux_prime = Hpp/Cmux; -#ifdef DEBUG_ULSCH_DECODING - msg("ulsch_decoding.c: G raw %d (%d symb), Hpp %d, Cmux %d, Rmux_prime %d\n",G,ulsch_harq->Nsymb_pusch,Hpp,Cmux,Rmux_prime); -#endif // Clear "tag" interleaving matrix to allow for CQI/DATA identification memset(ytag,0,Cmux*Rmux_prime); @@ -462,128 +456,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, i=0; memset(y,LTE_NULL,Q_m*Hpp); - /* - // Do RI coding - if (ulsch->O_RI == 1) { - switch (Q_m) { - case 2: - q_RI[0] = 0; - q_RI[1] = PUSCH_y; - len_RI=2; - break; - case 4: - q_RI[0] = 0; - q_RI[1] = PUSCH_y;//1; - q_RI[2] = PUSCH_x;//o_RI[0]; - q_RI[3] = PUSCH_x;//1; - len_RI=4; - break; - case 6: - q_RI[0] = 0; - q_RI[1] = PUSCH_y;//1; - q_RI[2] = PUSCH_x;//1; - q_RI[3] = PUSCH_x;//ulsch->o_RI[0]; - q_RI[4] = PUSCH_x;//1; - q_RI[5] = PUSCH_x;//1; - len_RI=6; - break; - } - } - else if (ulsch->O_RI > 1){ - LOG_E(PHY,"ulsch_decoding: FATAL, RI cannot be more than 1 bit yet\n"); - return(-1); - } - // 1-bit ACK/NAK - if (ulsch_harq->O_ACK == 1) { - switch (Q_m) { - case 2: - q_ACK[0] = 0; - q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : 0; - len_ACK = 2; - break; - case 4: - q_ACK[0] = 0; - q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : 0; - q_ACK[2] = PUSCH_x; - q_ACK[3] = PUSCH_x; - len_ACK = 4; - break; - case 6: - q_ACK[0] = 0; - q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : 0; - q_ACK[2] = PUSCH_x; - q_ACK[3] = PUSCH_x; - q_ACK[4] = PUSCH_x; - q_ACK[6] = PUSCH_x; - len_ACK = 6; - break; - } - } - // two-bit ACK/NAK - if (ulsch_harq->O_ACK == 2) { - switch (Q_m) { - case 2: - q_ACK[0] = 0; - q_ACK[1] = 0; - q_ACK[2] = 0; - q_ACK[3] = 0; - q_ACK[4] = 0; - q_ACK[5] = 0; - len_ACK = 6; - break; - case 4: - q_ACK[0] = 0; - q_ACK[1] = 0; - q_ACK[2] = PUSCH_x; - q_ACK[3] = PUSCH_x;//1; - q_ACK[4] = 0; - q_ACK[5] = 0; - q_ACK[6] = PUSCH_x; - q_ACK[7] = PUSCH_x;//1; - q_ACK[8] = 0; - q_ACK[9] = 0; - q_ACK[10] = PUSCH_x; - q_ACK[11] = PUSCH_x;//1; - len_ACK = 12; - break; - case 6: - q_ACK[0] = 0; - q_ACK[1] = 0; - q_ACK[2] = PUSCH_x; - q_ACK[3] = PUSCH_x; - q_ACK[4] = PUSCH_x; - q_ACK[5] = PUSCH_x; - - q_ACK[6] = 0; - q_ACK[7] = 0; - q_ACK[8] = PUSCH_x; - q_ACK[9] = PUSCH_x; - q_ACK[10] = PUSCH_x; - q_ACK[11] = PUSCH_x; - - q_ACK[12] = 0; - q_ACK[13] = 0; - q_ACK[14] = PUSCH_x; - q_ACK[15] = PUSCH_x; - q_ACK[16] = PUSCH_x; - q_ACK[17] = PUSCH_x; - len_ACK = 18; - - break; - } - } - if (ulsch_harq->O_ACK > 2) { - LOG_E(PHY,"ulsch_decoding: FATAL, ACK cannot be more than 2 bits yet\n"); - return(-1); - } - - - // RI BITS - - // memset(ytag2,0,Q_m*Hpp); - - */ // read in buffer and unscramble llrs for everything but placeholder bits // llrs stored per symbol correspond to columns of interleaving matrix @@ -724,40 +597,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, } - // for (q=0;q>(i&0x1f))&1); - - - - // if bits are tagged as placeholders (RI,ACK) - - if (ytag2[q+(Q_m*((r*Cmux)+j))] == PUSCH_y) { - - c=c_prev; - } - else if (ytag2[q+(Q_m*((r*Cmux)+j))] == PUSCH_x) { - c = 0; - #ifdef DEBUG_ULSCH_DECODING - // msg("ulsch_decoding.c: PUSCH_x in row %d, col %d: llr %d\n",r,j,ulsch_llr[i]); - #endif - } - c_prev = c; - #ifdef DEBUG_ULSCH_DECODING - // msg("llr[%d] = %d (c %d, ytag2 %d) ==> ",i,ulsch_llr[i],c,ytag2[q+(Q_m*((r*Cmux)+j))]); - #endif - // note flipped here for reverse polarity in 3GPP bit mapping - y[q+(Q_m*((r*Cmux)+j))] = (c==0) ? -ulsch_llr[i] : ulsch_llr[i]; - i++; - #ifdef DEBUG_ULSCH_DECODING - // msg("%d\n",y[q+(Q_m*((r*Cmux)+j))]); - #endif - */ stop_meas(&phy_vars_eNB->ulsch_demultiplexing_stats); if (i!=(H+Q_RI)) @@ -819,11 +658,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, for (q=0; qq_ACK[(q+(Q_m*i))%len_ACK] += y[q+(Q_m*((r*Cmux) + columnset[j]))]; - -#ifdef DEBUG_ULSCH_DECODING - // LOG_D(PHY,"ACK %d => %d (%d,%d,%d)\n",(q+(Q_m*i))%len_ACK,ulsch_harq->q_ACK[(q+(Q_m*i))%len_ACK],q+(Q_m*((r*Cmux) + columnset[j])),r,columnset[j]); - printf("ACK %d => %d (%d,%d,%d)\n",(q+(Q_m*i))%len_ACK,ulsch_harq->q_ACK[(q+(Q_m*i))%len_ACK],q+(Q_m*((r*Cmux) + columnset[j])),r,columnset[j]); -#endif y[q+(Q_m*((r*Cmux) + columnset[j]))]=0; // NULL LLRs in ACK positions } @@ -879,173 +713,129 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, j2=0; // r=0; - for (i=0; i0) { + for (i=0; i<(Q_CQI/Q_m); i++) { + + while (ytag[j]==LTE_NULL) { + j++; + j2+=Q_m; } - } - for (q=0;q127) - ulsch_harq->q[q+(Q_m*i)] = 127; - else if (ys<-128) - ulsch_harq->q[q+(Q_m*i)] = -128; - else - ulsch_harq->q[q+(Q_m*i)] = ys; - #ifdef DEBUG_ULSCH_DECODING - msg("ulsch_decoding.c: CQI %d, r %d, j %d, y[%d] %d\n",q+(Q_m*i),r,j, q+(Q_m*((r*Cmux) + j)),ys); - #endif - } - */ - while (ytag[j]==LTE_NULL) { - j++; + + for (q=0; q127) + ulsch_harq->q[q+(Q_m*i)] = 127; + else if (ys<-128) + ulsch_harq->q[q+(Q_m*i)] = -128; + else + ulsch_harq->q[q+(Q_m*i)] = ys; + } + j2+=Q_m; } - - for (q=0; q127) - ulsch_harq->q[q+(Q_m*i)] = 127; - else if (ys<-128) - ulsch_harq->q[q+(Q_m*i)] = -128; - else - ulsch_harq->q[q+(Q_m*i)] = ys; - -#ifdef DEBUG_ULSCH_DECODING - msg("ulsch_decoding.c: CQI %d, q %d, y[%d] %d\n",q+(Q_m*i),q,j2, q+j2,ys); -#endif - } - - j2+=Q_m; - } - - // j2=j*Q_m; - - switch (Q_m) { - case 2: - for (iprime=0; iprime<(Hprime-Qprime_CQI)<<1;) { - while (ytag[j]==LTE_NULL) { - j++; - j2+=2; + + + switch (Q_m) { + case 2: + for (iprime=0; iprimee[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + } - - ulsch_harq->e[iprime++] = y[j2++]; - ulsch_harq->e[iprime++] = y[j2++]; -#ifdef DEBUG_ULSCH_DECODING - // msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]); -#endif - - } - - // write_output("/tmp/ulsch_e.m","ulsch_e",ulsch->e,iprime,1,0); - break; - - case 4: - for (iprime=0; iprime<(Hprime-Qprime_CQI)<<2;) { - while (ytag[j]==LTE_NULL) { - j++; - j2+=4; + + + break; + + case 4: + for (iprime=0; iprimee[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + } - - ulsch_harq->e[iprime++] = y[j2++]; - ulsch_harq->e[iprime++] = y[j2++]; - ulsch_harq->e[iprime++] = y[j2++]; - ulsch_harq->e[iprime++] = y[j2++]; -#ifdef DEBUG_ULSCH_DECODING - // msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]); -#endif - - } - - break; - - case 6: - for (iprime=0; iprime<(Hprime-Qprime_CQI)*6;) { - while (ytag[j]==LTE_NULL) { - j++; - j2+=6; + + break; + + case 6: + for (iprime=0; iprimee[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + } + + break; - ulsch_harq->e[iprime++] = y[j2++]; - ulsch_harq->e[iprime++] = y[j2++]; - ulsch_harq->e[iprime++] = y[j2++]; - ulsch_harq->e[iprime++] = y[j2++]; - ulsch_harq->e[iprime++] = y[j2++]; - ulsch_harq->e[iprime++] = y[j2++]; -#ifdef DEBUG_ULSCH_DECODING - // msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]); -#endif - - } - - break; - - } - - /* - for (i=0,iprime=-Qprime_CQI;i127) - ulsch_harq->q[q+(Q_m*i)] = 127; - else if (ys<-128) - ulsch_harq->q[q+(Q_m*i)] = -128; - else - ulsch_harq->q[q+(Q_m*i)] = ys; - #ifdef DEBUG_ULSCH_DECODING - msg("ulsch_decoding.c: CQI %d, r %d, j %d, y[%d] %d\n",q+(Q_m*i),r,j, q+(Q_m*((r*Cmux) + j)),ys); - #endif - } - } - else { - for (q=0;qe[g] = y[q+(Q_m*((r*Cmux)+j))]; - #ifdef DEBUG_ULSCH_DECODING - // msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]); - #endif - } - } - j++; - if (j==Cmux) { - j=0; - r++; } } - */ - + else { + for (i=0; i<(Q_CQI/Q_m); i++) { + + for (q=0; q127) + ulsch_harq->q[q+(Q_m*i)] = 127; + else if (ys<-128) + ulsch_harq->q[q+(Q_m*i)] = -128; + else + ulsch_harq->q[q+(Q_m*i)] = ys; + } + + j2+=Q_m; + } + + switch (Q_m) { + case 2: + for (iprime=0; iprimee[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + } + break; + case 4: + for (iprime=0; iprimee[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + } + break; + case 6: + for (iprime=0; iprimee[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + } + break; + } + } // Do CQI/RI/HARQ-ACK Decoding first and pass to MAC // HARQ-ACK wACK_idx = (ulsch->bundling==0) ? 4 : ((Nbundled-1)&3); -#ifdef DEBUG_ULSCH_DECODING - msg("ulsch_decoding.c: Bundling %d, Nbundled %d, wACK_idx %d\n", - ulsch->bundling,Nbundled,wACK_idx); -#endif if (ulsch_harq->O_ACK == 1) { ulsch_harq->q_ACK[0] *= wACK_RX[wACK_idx][0]; @@ -1055,10 +845,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, ulsch_harq->o_ACK[0] = 0; else ulsch_harq->o_ACK[0] = 1; - -#ifdef DEBUG_ULSCH_DECODING - msg("ulsch_decoding.c: ulsch_q_ACK[0] %d (%d,%d)\n",ulsch_harq->q_ACK[0],wACK_RX[wACK_idx][0],wACK_RX[wACK_idx][1]); -#endif } if (ulsch_harq->O_ACK == 2) { @@ -1068,16 +854,12 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, ulsch_harq->q_ACK[0] = ulsch_harq->q_ACK[0]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[3]*wACK_RX[wACK_idx][1]; ulsch_harq->q_ACK[1] = ulsch_harq->q_ACK[1]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[4]*wACK_RX[wACK_idx][1]; ulsch_harq->q_ACK[2] = ulsch_harq->q_ACK[2]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[5]*wACK_RX[wACK_idx][1]; - break; - case 4: ulsch_harq->q_ACK[0] = ulsch_harq->q_ACK[0]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[5]*wACK_RX[wACK_idx][1]; ulsch_harq->q_ACK[1] = ulsch_harq->q_ACK[1]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[8]*wACK_RX[wACK_idx][1]; ulsch_harq->q_ACK[2] = ulsch_harq->q_ACK[4]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[9]*wACK_RX[wACK_idx][1]; - break; - case 6: ulsch_harq->q_ACK[0] = ulsch_harq->q_ACK[0]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[7]*wACK_RX[wACK_idx][1]; ulsch_harq->q_ACK[1] = ulsch_harq->q_ACK[1]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[12]*wACK_RX[wACK_idx][1]; @@ -1114,37 +896,15 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, } } -#ifdef DEBUG_ULSCH_DECODING - - for (i=0; iO_ACK; i++) - msg("ulsch_decoding: O_ACK[%d] %d, q_ACK => (%d,%d,%d)\n",i,ulsch_harq->o_ACK[i],ulsch_harq->q_ACK[0],ulsch_harq->q_ACK[1],ulsch_harq->q_ACK[2]); - -#endif - // RI if ((ulsch_harq->O_RI == 1) && (Qprime_RI > 0)) { ulsch_harq->o_RI[0] = ((ulsch_harq->q_RI[0] + ulsch_harq->q_RI[Q_m/2]) > 0) ? 0 : 1; } -#ifdef DEBUG_ULSCH_DECODING - - if (Qprime_RI > 0) { - for (i=0; i<2*ulsch_harq->O_RI; i++) - msg("ulsch_decoding: q_RI[%d] %d\n",i,ulsch_harq->q_RI[i]); - } - - if (Qprime_CQI > 0) { - for (i=0; iO_RI; i++) - LOG_D(PHY,"ulsch_decoding: O_RI[%d] %d\n",i,ulsch_harq->o_RI[i]); - } - -#endif - - // CQI - if (Qprime_CQI>0) { + if (Q_CQI>0) { memset((void *)&dummy_w_cc[0],0,3*(ulsch_harq->Or1+8+32)); O_RCC = generate_dummy_w_cc(ulsch_harq->Or1+8, @@ -1169,7 +929,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, else ulsch_harq->cqi_crc_status = 0; - //printf("crc(cqi) rx: %x\n",(crc8(o_flip,ulsch->Or1)>>24)); if (ulsch->harq_processes[harq_pid]->Or1<=32) { ulsch_harq->o[3] = o_flip[0] ; @@ -1274,44 +1033,21 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, stop_meas(&phy_vars_eNB->ulsch_rate_unmatching_stats); r_offset += E; - /* - msg("Subblock deinterleaving, d %p w %p\n", - ulsch_harq->d[r], - ulsch_harq->w); - */ + start_meas(&phy_vars_eNB->ulsch_deinterleaving_stats); sub_block_deinterleaving_turbo(4+Kr, &ulsch_harq->d[r][96], ulsch_harq->w[r]); stop_meas(&phy_vars_eNB->ulsch_deinterleaving_stats); - /* - #ifdef DEBUG_ULSCH_DECODING - msg("decoder input(segment %d) :",r); - for (i=0;i<(3*8*Kr_bytes)+12;i++) - msg("%d : %d\n",i,ulsch_harq->d[r][96+i]); - msg("\n"); - #endif - */ } for (r=0; rC; r++) { - // msg("Clearing c, %p\n",ulsch_harq->c[r]); - // memset(ulsch_harq->c[r],0,16);//block_length); - // msg("done\n"); + if (ulsch_harq->C == 1) crc_type = CRC24_A; else crc_type = CRC24_B; - /* - msg("decoder input(segment %d)\n",r); - for (i=0;i<(3*8*Kr_bytes)+12;i++) - if ((ulsch_harq->d[r][96+i]>7) || - (ulsch_harq->d[r][96+i] < -8)) - msg("%d : %d\n",i,ulsch_harq->d[r][96+i]); - msg("\n"); - */ - start_meas(&phy_vars_eNB->ulsch_turbo_decoding_stats); ret = tc(&ulsch_harq->d[r][96], @@ -1334,28 +1070,10 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, status[r] = ret; - if (ret==(1+ulsch->max_turbo_iterations)) {// a Code segment is in error so break; -#ifdef DEBUG_ULSCH_DECODING - msg("ULSCH harq_pid %d CRC failed\n",harq_pid); -#endif - /* - for (i=0;i %d\n",r,i,ulsch_harq->c[r][i]); - return(ret); - */ - } - -#ifdef DEBUG_ULSCH_DECODING - else - msg("ULSCH harq_pid %d CRC OK : %d iterations\n",harq_pid, ret); - -#endif - } // Reassembly of Transport block here offset = 0; - // msg("F %d, Fbytes %d\n",ulsch_harq->F,ulsch_harq->F>>3); ret = 1; @@ -1373,8 +1091,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, &ulsch_harq->c[0][(ulsch_harq->F>>3)], Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0)); offset = Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0); - // msg("copied %d bytes to b sequence\n", - // Kr_bytes - (ulsch_harq->F>>3)); } else { memcpy(ulsch_harq->b+offset, ulsch_harq->c[r], diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 43d2120639..18d20f6372 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -594,22 +594,12 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX,1); start_meas(&phy_vars_eNB->phy_proc_tx); -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[%s %"PRIu8"] Frame %d subframe %d : Doing phy_procedures_eNB_TX\n", - (r_type == multicast_relay) ? "RN/eNB" : "eNB", - phy_vars_eNB->Mod_id, frame, subframe); -#endif - for (i=0; ieNB_UE_stats[i].ulsch_consecutive_errors == ULSCH_max_consecutive_errors) { LOG_W(PHY,"[eNB %d, CC %d] frame %d, subframe %d, UE %d: ULSCH consecutive error count reached %u, triggering UL Failure\n", phy_vars_eNB->Mod_id,phy_vars_eNB->CC_id,frame,subframe, i, phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors); - /* - phy_vars_eNB->eNB_UE_stats[i].mode = PRACH; - remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB,abstraction_flag); - */ phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors=0; mac_xface->UL_failure_indication(phy_vars_eNB->Mod_id, phy_vars_eNB->CC_id, @@ -619,7 +609,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e } - //#endif + } @@ -689,9 +679,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e phy_vars_rn->Mod_id,phy_vars_rn->frame, subframe,subframe%5, phy_vars_rn->sync_area[subframe%5],mch_pduP->mcs,mch_pduP->Pdu_size); } else { - /* LOG_I(PHY,"[RN %d] Frame %d subframe %d: do not forward MCH pdu for MBSFN sync area %d (MCS %d, TBS %d)\n", - phy_vars_rn->Mod_id,phy_vars_rn->frame, next_slot>>1, - mch_pduP->sync_area,mch_pduP->mcs,mch_pduP->Pdu_size);*/ mch_pduP=NULL; } @@ -841,20 +828,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e -#ifdef DEBUG_PHY_PROC - uint16_t frame_tx = (((int) (pbch_pdu[2]&0x3))<<8) + ((int) (pbch_pdu[1]&0xfc)) + phy_vars_eNB->proc[sched_subframe].frame_tx%4; - - LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Generating PBCH, mode1_flag=%"PRIu8", frame_tx=%"PRIu16", pdu=%02"PRIx8"%02"PRIx8"%02"PRIx8"\n", - phy_vars_eNB->Mod_id, - phy_vars_eNB->proc[sched_subframe].frame_tx, - subframe, - phy_vars_eNB->lte_frame_parms.mode1_flag, - frame_tx, - pbch_pdu[2], - pbch_pdu[1], - pbch_pdu[0]); -#endif - if (abstraction_flag==0) { generate_pbch(&phy_vars_eNB->lte_eNB_pbch, @@ -881,7 +854,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e if (abstraction_flag==0) { if (phy_vars_eNB->lte_frame_parms.frame_type == TDD) { - // printf("Generating PSS (frame %d, subframe %d)\n",phy_vars_eNB->proc[sched_subframe].frame_tx,next_slot>>1); generate_pss(phy_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, &phy_vars_eNB->lte_frame_parms, @@ -932,7 +904,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e if (abstraction_flag==0) { if (phy_vars_eNB->lte_frame_parms.frame_type == TDD) { - // printf("Generating PSS (frame %d, subframe %d)\n",phy_vars_eNB->proc[sched_subframe].frame_tx,next_slot>>1); generate_pss(phy_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, &phy_vars_eNB->lte_frame_parms, @@ -986,10 +957,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e } } -#ifdef EMOS - //emos_dump_eNB.dci_cnt[next_slot>>1] = DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci; //nb_dci_common+nb_dci_ue_spec; -#endif - // clear previous allocation information for all UEs for (i=0; idlsch_eNB[i][0]->subframe_tx[subframe] = 0; @@ -1012,21 +979,17 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e #endif + + + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->num_pdcch_symbols); + for (i=0; iNum_common_dci + DCI_pdu->Num_ue_spec_dci ; i++) { LOG_D(PHY,"[eNB] Subframe %d: DCI %d/%d : rnti %x, CCEind %d\n",subframe,i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci,DCI_pdu->dci_alloc[i].rnti,DCI_pdu->dci_alloc[i].firstCCE); -#ifdef DEBUG_PHY_PROC - - if (DCI_pdu->dci_alloc[i].rnti != SI_RNTI) { - LOG_D(PHY,"[eNB] Subframe %d : Doing DCI index %"PRIu32"/%d\n",subframe,i,DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci); - dump_dci(&phy_vars_eNB->lte_frame_parms,&DCI_pdu->dci_alloc[i]); - } - -#endif + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->dci_alloc[i].rnti); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->dci_alloc[i].format); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->dci_alloc[i].firstCCE); if (DCI_pdu->dci_alloc[i].rnti == SI_RNTI) { -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %"PRIu8"] SI generate_eNB_dlsch_params_from_dci\n", phy_vars_eNB->Mod_id); -#endif generate_eNB_dlsch_params_from_dci(frame, subframe, @@ -1059,9 +1022,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e } else if (DCI_pdu->dci_alloc[i].ra_flag == 1) { -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %"PRIu8"] RA generate_eNB_dlsch_params_from_dci\n", phy_vars_eNB->Mod_id); -#endif generate_eNB_dlsch_params_from_dci(frame, subframe, @@ -1076,8 +1036,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e P_RNTI, phy_vars_eNB->eNB_UE_stats[0].DL_pmi_single); - // mac_xface->macphy_exit("Transmitted RAR, exiting\n"); - phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe] = DCI_pdu->dci_alloc[i].firstCCE; @@ -1097,10 +1055,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e else if (DCI_pdu->dci_alloc[i].format != format0) { // this is a normal DLSCH allocation -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB] Searching for RNTI %"PRIx16"\n",DCI_pdu->dci_alloc[i].rnti); -#endif - if (phy_vars_eNB->mac_enabled==1) UE_id = find_ue((int16_t)DCI_pdu->dci_alloc[i].rnti,phy_vars_eNB); else @@ -1152,14 +1106,11 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e #endif -#ifdef DEBUG_PHY_PROC - //if (phy_vars_eNB->proc[sched_subframe].frame_tx%100 == 0) LOG_D(PHY,"[eNB %"PRIu8"][DCI][PDSCH %"PRIx16"] Frame %d subframe %d UE_id %"PRId8" Generated DCI format %d, aggregation %d\n", phy_vars_eNB->Mod_id, DCI_pdu->dci_alloc[i].rnti, phy_vars_eNB->proc[sched_subframe].frame_tx, subframe,UE_id, DCI_pdu->dci_alloc[i].format, 1<dci_alloc[i].L); -#endif } else { LOG_D(PHY,"[eNB %"PRIu8"][PDSCH] Frame %d : No UE_id with corresponding rnti %"PRIx16", dropping DLSCH\n", phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,DCI_pdu->dci_alloc[i].rnti); @@ -1168,6 +1119,8 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e } + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,(frame*10)+subframe); + // Apply physicalConfigDedicated if needed phy_config_dedicated_eNB_step2(phy_vars_eNB); @@ -1180,7 +1133,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e if (harq_pid==255) { LOG_E(PHY,"[eNB %"PRIu8"] Frame %d: Bad harq_pid for ULSCH allocation\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx); - //mac_exit_wrapper("Invalid harq_pid (255) detected"); return; } @@ -1195,8 +1147,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e return; // not reached } - //#ifdef DEBUG_PHY_PROC - //if (phy_vars_eNB->proc[sched_subframe].frame_tx%100 == 0) LOG_D(PHY, "[eNB %"PRIu8"][PUSCH %"PRIu8"] Frame %d subframe %d UL Frame %"PRIu32", UL Subframe %"PRIu8", Generated ULSCH (format0) DCI (rnti %"PRIx16", dci %"PRIx8") (DCI pos %"PRIu32"/%d), aggregation %d\n", phy_vars_eNB->Mod_id, @@ -1212,10 +1162,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e i, DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci, 1<dci_alloc[i].L); - //#endif - - //dump_dci(&phy_vars_eNB->lte_frame_parms,&DCI_pdu->dci_alloc[i]); - //LOG_D(PHY,"[eNB] cba generate_eNB_ulsch_params_from_dci for ue %d for dci rnti %x\n", UE_id, DCI_pdu->dci_alloc[i].rnti); generate_eNB_ulsch_params_from_dci(&DCI_pdu->dci_alloc[i].dci_pdu[0], DCI_pdu->dci_alloc[i].rnti, @@ -1245,13 +1191,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %"PRIu8"][PUSCH %"PRIu8"] frame %d subframe %d Setting subframe_scheduling_flag for UE %"PRIu32" harq_pid %"PRIu8" (ul subframe %"PRIu8")\n", - phy_vars_eNB->Mod_id,harq_pid, - phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i,harq_pid, - pdcch_alloc2ul_subframe(&phy_vars_eNB->lte_frame_parms,subframe)); -#endif - if ((DCI_pdu->dci_alloc[i].rnti >= CBA_RNTI) && (DCI_pdu->dci_alloc[i].rnti < P_RNTI)) phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->harq_processes[harq_pid]->subframe_cba_scheduling_flag = 1; else @@ -1274,13 +1213,11 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e } if (abstraction_flag == 0) { - //#ifdef DEBUG_PHY_PROC if (DCI_pdu->Num_ue_spec_dci+DCI_pdu->Num_common_dci > 0) LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (common %"PRIu8",ue_spec %"PRIu8")\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, subframe, DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); - //#endif num_pdcch_symbols = generate_dci_top(DCI_pdu->Num_ue_spec_dci, DCI_pdu->Num_common_dci, @@ -1291,10 +1228,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e phy_vars_eNB->lte_eNB_common_vars.txdataF[0], subframe); -#ifdef DEBUG_PHY_PROC - // LOG_I(PHY,"[eNB %d] Frame %d, subframe %d: num_pdcch_symbols %d)\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, next_slot>>1,num_pdcch_symbols); - -#endif } #ifdef PHY_ABSTRACTION // FIXME this ifdef seems suspicious @@ -1307,10 +1240,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,0); -#ifdef DEBUG_PHY_PROC - //LOG_D(PHY,"[eNB %d] Frame %d, slot %d: num_pdcch_symbols=%d\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, next_slot,num_pdcch_symbols); -#endif - // Check for SI activity if (phy_vars_eNB->dlsch_eNB_SI->active == 1) { @@ -1339,21 +1268,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e smbv_configure_datalist_for_alloc(smbv_fname, smbv_alloc_cnt++, (smbv_frame_cnt*10) + (subframe), DLSCH_pdu, input_buffer_length); } -#endif - -#ifdef DEBUG_PHY_PROC -#ifdef DEBUG_DLSCH - //FIXME: The code below is commented as next_slot is not defined which results in failed compilation - /* - LOG_D(PHY,"[eNB %"PRIu8"][SI] Frame %d, slot %d: Calling generate_dlsch (SI) with input size = %"PRIu16", num_pdcch_symbols %"PRIu8"\n", - phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, next_slot, input_buffer_length,num_pdcch_symbols); // FIXME this code is broken (next_slot?) - - for (i=0; idlsch_eNB_ra->active == 1) { -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %"PRIu8"][RAPROC] Frame %d, subframe %d, RA active, filling RAR:\n", - phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, subframe); -#endif input_buffer_length = phy_vars_eNB->dlsch_eNB_ra->harq_processes[0]->TBS/8; @@ -1425,11 +1335,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e dlsch_input_buffer, phy_vars_eNB->lte_frame_parms.N_RB_UL, input_buffer_length); - /* - for (i=0;imacphy_exit("[PHY][eNB] Max user count reached.\n"); mac_xface->cancel_ra_proc(phy_vars_eNB->Mod_id, phy_vars_eNB->CC_id, phy_vars_eNB->proc[sched_subframe].frame_tx, @@ -1467,15 +1371,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->Msg3_frame, phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->Msg3_subframe); - /* - for (i=0; ieNB_UE_stats[0].UE_timing_offset)>>(2+4); // 7 MSBs of timing advance + divide by 4 - dlsch_input_buffer[2] = ((phy_vars_eNB->eNB_UE_stats[0].UE_timing_offset)<<(4-2))&0xf0; // 4 LSBs of timing advance + divide by 4 - //LOG_I(PHY,"UE %d: timing_offset = %d\n",UE_id,phy_vars_eNB->eNB_UE_stats[0].UE_timing_offset); - */ - #if defined(SMBV) && !defined(EXMIMO) // Configures the data source of allocation (allocation is configured by DCI) @@ -1486,13 +1381,13 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e #endif -#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %"PRIu8"][RAPROC] Frame %d, subframe %d: Calling generate_dlsch (RA) with input size = %"PRIu16",Msg3 frame %"PRIu32", Msg3 subframe %"PRIu8"\n", phy_vars_eNB->Mod_id, phy_vars_eNB->proc[sched_subframe].frame_tx, subframe,input_buffer_length, phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->Msg3_frame, phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->Msg3_subframe); -#endif + if (abstraction_flag == 0) { @@ -1538,11 +1433,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e LOG_D(PHY,"[eNB %"PRIu8"][RAPROC] Frame %d subframe %d Deactivating DLSCH RA\n",phy_vars_eNB->Mod_id, phy_vars_eNB->proc[sched_subframe].frame_tx,subframe); -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d, DLSCH (RA) re_allocated = %"PRIu16"\n",phy_vars_eNB->Mod_id, - phy_vars_eNB->proc[sched_subframe].frame_tx, subframe, re_allocated); -#endif - } //max user count phy_vars_eNB->dlsch_eNB_ra->active = 0; @@ -1558,7 +1448,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e input_buffer_length = phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->TBS/8; - //#ifdef DEBUG_PHY_PROC + LOG_D(PHY, "[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", G %d, nb_rb %"PRIu16", mcs %"PRIu8", pmi_alloc %"PRIx16", rv %"PRIu8" (round %"PRIu8")\n", phy_vars_eNB->Mod_id, phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti,harq_pid, @@ -1574,7 +1464,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e pmi2hex_2Ar1(phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->pmi_alloc), phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->rvidx, phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->round); - //#endif + #if defined(MESSAGE_CHART_GENERATOR_PHY) MSC_LOG_TX_MESSAGE( MSC_PHY_ENB,MSC_PHY_UE, @@ -1699,7 +1589,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e #endif phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->active = 0; - //mac_xface->macphy_exit("first dlsch transmitted\n"); } else if ((phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0])&& @@ -1708,16 +1597,13 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e // clear subframe TX flag since UE is not scheduled for PDSCH in this subframe (so that we don't look for PUCCH later) phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->subframe_tx[subframe]=0; -#ifdef DEBUG_PHY_PROC - //LOG_D(PHY,"[eNB %d] DCI: Clearing subframe_tx for subframe %d, UE %d\n",phy_vars_eNB->Mod_id,subframe,UE_id); -#endif } } // if we have PHICH to generate - // printf("[PHY][eNB] Frame %d subframe %d Checking for phich\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe); + if (is_phich_subframe(&phy_vars_eNB->lte_frame_parms,subframe)) { generate_phich_top(phy_vars_eNB, @@ -2226,7 +2112,6 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t LOG_D(PHY,"[eNB %d][RAPROC] Frame %d, Subframe %d : PRACH RX Signal Power : %d dBm\n",phy_vars_eNB->Mod_id, frame,subframe,dB_fixed(signal_energy(&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][0][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti],512)) - phy_vars_eNB->rx_total_gain_eNB_dB); - // LOG_I(PHY,"[eNB %d][RAPROC] PRACH: rootSequenceIndex %d, prach_ConfigIndex %d, zeroCorrelationZoneConfig %d, highSpeedFlag %d, prach_FreqOffset %d\n",phy_vars_eNB->Mod_id,phy_vars_eNB->lte_frame_parms.prach_config_common.rootSequenceIndex,phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex, phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag,phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset); rx_prach(phy_vars_eNB, subframe, @@ -2271,20 +2156,12 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t #endif if (preamble_energy_list[preamble_max] > 580) { - /* - write_output("prach_ifft0.m","prach_t0",prach_ifft[0],2048,1,1); - write_output("prach_rx0.m","prach_rx0",&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][0][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti],6144+792,1,1); - write_output("prach_rxF0.m","prach_rxF0",phy_vars_eNB->lte_eNB_prach_vars.rxsigF[0],24576,1,1); - - mac_xface->macphy_exit("Exiting for PRACH debug\n"); - */ - UE_id = find_next_ue_index(phy_vars_eNB); if (UE_id>=0) { phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset = preamble_delay_list[preamble_max]&0x1FFF; //limit to 13 (=11+2) bits - //phy_vars_eNb->eNB_UE_stats[(uint32_t)UE_id].mode = PRACH; + phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].sector = 0; LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure (UE_id %d) with preamble %d, energy %d.%d dB, delay %d\n", phy_vars_eNB->Mod_id, @@ -2344,13 +2221,9 @@ void ulsch_decoding_procedures(unsigned char subframe, unsigned int i, PHY_VARS_ } +void pucch_procedures(const unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,int UE_id,int harq_pid,const uint8_t abstraction_flag) { -void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,const uint8_t abstraction_flag,const relaying_type_t r_type) -{ - //RX processing - UNUSED(r_type); - uint32_t l, ret=0,i,j,k; - uint32_t harq_pid, harq_idx, round; + LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_eNB->lte_frame_parms; uint8_t SR_payload = 0,*pucch_payload=NULL,pucch_payload0[2]= {0,0},pucch_payload1[2]= {0,0}; int16_t n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3; uint8_t do_SR = 0; @@ -2358,12 +2231,486 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ int32_t metric0=0,metric1=0,metric0_SR=0; ANFBmode_t bundling_flag; PUCCH_FMT_t format; + + const int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx; + const int frame = phy_vars_eNB->proc[sched_subframe].frame_rx; + + if ((phy_vars_eNB->dlsch_eNB[UE_id][0]) && + (phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti>0) && + (phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag==0)) { + + // check SR availability + do_SR = is_SR_subframe(phy_vars_eNB,UE_id,sched_subframe); + // do_SR = 0; + + // Now ACK/NAK + // First check subframe_tx flag for earlier subframes + get_n1_pucch_eNB(phy_vars_eNB, + UE_id, + sched_subframe, + &n1_pucch0, + &n1_pucch1, + &n1_pucch2, + &n1_pucch3); + + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d, subframe %d Checking for PUCCH (%d,%d,%d,%d) SR %d\n", + phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti, + frame,subframe, + n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,do_SR); + + if ((n1_pucch0==-1) && (n1_pucch1==-1) && (do_SR==0)) { // no TX PDSCH that have to be checked and no SR for this UE_id + } else { + // otherwise we have some PUCCH detection to do + + // Null out PUCCH PRBs for noise measurement + switch(phy_vars_eNB->lte_frame_parms.N_RB_UL) { + case 6: + phy_vars_eNB->rb_mask_ul[0] |= (0x1 | (1<<5)); //position 5 + break; + case 15: + phy_vars_eNB->rb_mask_ul[0] |= (0x1 | (1<<14)); // position 14 + break; + case 25: + phy_vars_eNB->rb_mask_ul[0] |= (0x1 | (1<<24)); // position 24 + break; + case 50: + phy_vars_eNB->rb_mask_ul[0] |= 0x1; + phy_vars_eNB->rb_mask_ul[1] |= (1<<17); // position 49 (49-32) + break; + case 75: + phy_vars_eNB->rb_mask_ul[0] |= 0x1; + phy_vars_eNB->rb_mask_ul[2] |= (1<<10); // position 74 (74-64) + break; + case 100: + phy_vars_eNB->rb_mask_ul[0] |= 0x1; + phy_vars_eNB->rb_mask_ul[3] |= (1<<3); // position 99 (99-96) + break; + default: + LOG_E(PHY,"Unknown number for N_RB_UL %d\n",phy_vars_eNB->lte_frame_parms.N_RB_UL); + break; + } + + if (do_SR == 1) { + phy_vars_eNB->eNB_UE_stats[UE_id].sr_total++; + + if (abstraction_flag == 0) + metric0_SR = rx_pucch(phy_vars_eNB, + pucch_format1, + UE_id, + phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, + 0, // n2_pucch + 0, // shortened format, should be use_srs flag, later + &SR_payload, + subframe, + PUCCH1_THRES); + +#ifdef PHY_ABSTRACTION + else { + metric0_SR = rx_pucch_emul(phy_vars_eNB, + UE_id, + pucch_format1, + 0, + &SR_payload, + sched_subframe); + LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR (UE SR %d/%d)\n",phy_vars_eNB->Mod_id, + phy_vars_eNB->ulsch_eNB[UE_id]->rnti,frame,subframe,SR_payload,phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex); + } + +#endif + + if (SR_payload == 1) { + LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Got SR for PUSCH, transmitting to MAC\n",phy_vars_eNB->Mod_id, + phy_vars_eNB->ulsch_eNB[UE_id]->rnti,frame,subframe); + phy_vars_eNB->eNB_UE_stats[UE_id].sr_received++; + + if (phy_vars_eNB->first_sr[UE_id] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4 + /* is this test necessary? */ + if (phy_vars_eNB->dlsch_eNB[UE_id][0]->harq_processes[0]->status != SCH_IDLE) + put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[UE_id][0], 0); + phy_vars_eNB->first_sr[UE_id] = 0; + phy_vars_eNB->dlsch_eNB[UE_id][0]->harq_processes[0]->round=0; + phy_vars_eNB->dlsch_eNB[UE_id][0]->harq_processes[0]->status=SCH_IDLE; + LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d First SR\n", + phy_vars_eNB->Mod_id, + phy_vars_eNB->ulsch_eNB[UE_id]->rnti,frame,subframe); + } + + if (phy_vars_eNB->mac_enabled==1) { + mac_xface->SR_indication(phy_vars_eNB->Mod_id, + phy_vars_eNB->CC_id, + frame, + phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti,subframe); + } + } + }// do_SR==1 + + if ((n1_pucch0==-1) && (n1_pucch1==-1)) { // just check for SR + } else if (phy_vars_eNB->lte_frame_parms.frame_type==FDD) { // FDD + // if SR was detected, use the n1_pucch from SR, else use n1_pucch0 + // n1_pucch0 = (SR_payload==1) ? phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex:n1_pucch0; + + LOG_D(PHY,"Demodulating PUCCH for ACK/NAK: n1_pucch0 %d (%d), SR_payload %d\n",n1_pucch0,phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex,SR_payload); + + if (abstraction_flag == 0) { + + + + metric0 = rx_pucch(phy_vars_eNB, + pucch_format1a, + UE_id, + (uint16_t)n1_pucch0, + 0, //n2_pucch + 0, // shortened format + pucch_payload0, + subframe, + PUCCH1a_THRES); + + if (metric0 < metric0_SR) + metric0=rx_pucch(phy_vars_eNB, + pucch_format1a, + UE_id, + phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, + 0, //n2_pucch + 0, // shortened format + pucch_payload0, + subframe, + PUCCH1a_THRES); + } + else { +#ifdef PHY_ABSTRACTION + metric0 = rx_pucch_emul(phy_vars_eNB,UE_id, + pucch_format1a, + 0, + pucch_payload0, + subframe); +#endif + } + +#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d pucch1a (FDD) payload %d (metric %d)\n", + phy_vars_eNB->Mod_id, + phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti, + frame,subframe, + pucch_payload0[0],metric0); +#endif + + process_HARQ_feedback(UE_id,sched_subframe,phy_vars_eNB, + 0,// pusch_flag + pucch_payload0, + 2, + SR_payload); + + } // FDD + else { //TDD + + bundling_flag = phy_vars_eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode; + + // fix later for 2 TB case and format1b + + if ((frame_parms->frame_type==FDD) || + (bundling_flag==bundling) || + ((frame_parms->frame_type==TDD)&&(frame_parms->tdd_config==1)&&((subframe!=2)||(subframe!=7)))) { + format = pucch_format1a; + // msg("PUCCH 1a\n"); + } else { + format = pucch_format1b; + // msg("PUCCH 1b\n"); + } + + // if SR was detected, use the n1_pucch from SR + if (SR_payload==1) { +#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d with SR\n",phy_vars_eNB->Mod_id, + phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti, + frame,subframe, + n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format); +#endif + + if (abstraction_flag == 0) + metric0_SR = rx_pucch(phy_vars_eNB, + format, + UE_id, + phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, + 0, //n2_pucch + 0, // shortened format + pucch_payload0, + subframe, + PUCCH1a_THRES); + else { +#ifdef PHY_ABSTRACTION + metric0 = rx_pucch_emul(phy_vars_eNB,UE_id, + format, + 0, + pucch_payload0, + subframe); +#endif + } + } else { //using n1_pucch0/n1_pucch1 resources +#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d\n",phy_vars_eNB->Mod_id, + phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti, + frame,subframe, + n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format); +#endif + metric0=0; + metric1=0; + + // Check n1_pucch0 metric + if (n1_pucch0 != -1) { + if (abstraction_flag == 0) + metric0 = rx_pucch(phy_vars_eNB, + format, + UE_id, + (uint16_t)n1_pucch0, + 0, // n2_pucch + 0, // shortened format + pucch_payload0, + subframe, + PUCCH1a_THRES); + else { +#ifdef PHY_ABSTRACTION + metric0 = rx_pucch_emul(phy_vars_eNB,UE_id, + format, + 0, + pucch_payload0, + subframe); +#endif + } + } + + // Check n1_pucch1 metric + if (n1_pucch1 != -1) { + if (abstraction_flag == 0) + metric1 = rx_pucch(phy_vars_eNB, + format, + UE_id, + (uint16_t)n1_pucch1, + 0, //n2_pucch + 0, // shortened format + pucch_payload1, + subframe, + PUCCH1a_THRES); + else { +#ifdef PHY_ABSTRACTION + metric1 = rx_pucch_emul(phy_vars_eNB,UE_id, + format, + 1, + pucch_payload1, + subframe); + + +#endif + } + } + } + + if (SR_payload == 1) { + pucch_payload = pucch_payload0; + + if (bundling_flag == bundling) + pucch_sel = 2; + } else if (bundling_flag == multiplexing) { // multiplexing + no SR + pucch_payload = (metric1>metric0) ? pucch_payload1 : pucch_payload0; + pucch_sel = (metric1>metric0) ? 1 : 0; + } else { // bundling + no SR + if (n1_pucch1 != -1) + pucch_payload = pucch_payload1; + else if (n1_pucch0 != -1) + pucch_payload = pucch_payload0; + + pucch_sel = 2; // indicate that this is a bundled ACK/NAK + } + +#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d ACK/NAK metric 0 %d, metric 1 %d, sel %d, (%d,%d)\n",phy_vars_eNB->Mod_id, + phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti, + frame,subframe, + metric0,metric1,pucch_sel,pucch_payload[0],pucch_payload[1]); +#endif + process_HARQ_feedback(UE_id,sched_subframe,phy_vars_eNB, + 0,// pusch_flag + pucch_payload, + pucch_sel, + SR_payload); + } + } + + } +} + +void cba_procedures(const unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,int UE_id,int harq_pid,const uint8_t abstraction_flag) { + + uint8_t access_mode; + int num_active_cba_groups; + const int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx; + const int frame = phy_vars_eNB->proc[sched_subframe].frame_rx; + uint16_t rnti=0; + int ret=0; + + num_active_cba_groups = phy_vars_eNB->ulsch_eNB[UE_id]->num_active_cba_groups; + + if ((phy_vars_eNB->ulsch_eNB[UE_id]) && + (num_active_cba_groups > 0) && + (phy_vars_eNB->ulsch_eNB[UE_id]->cba_rnti[UE_id%num_active_cba_groups]>0) && + (phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->subframe_cba_scheduling_flag==1)) { + rnti=0; + +#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d Checking PUSCH/ULSCH CBA Reception for UE %d with cba rnti %x mode %s\n", + phy_vars_eNB->Mod_id,harq_pid, + frame,subframe, + UE_id, (uint16_t)phy_vars_eNB->ulsch_eNB[UE_id]->cba_rnti[UE_id%num_active_cba_groups],mode_string[phy_vars_eNB->eNB_UE_stats[UE_id].mode]); +#endif + + if (abstraction_flag==0) { + rx_ulsch(phy_vars_eNB, + sched_subframe, + phy_vars_eNB->eNB_UE_stats[UE_id].sector, // this is the effective sector id + UE_id, + phy_vars_eNB->ulsch_eNB, + 0); + } + +#ifdef PHY_ABSTRACTION + else { + rx_ulsch_emul(phy_vars_eNB, + subframe, + phy_vars_eNB->eNB_UE_stats[UE_id].sector, // this is the effective sector id + i); + } + +#endif + + if (abstraction_flag == 0) { + ret = ulsch_decoding(phy_vars_eNB, + UE_id, + sched_subframe, + 0, // control_only_flag + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->V_UL_DAI, + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->nb_rb>20 ? 1 : 0); + } + +#ifdef PHY_ABSTRACTION + else { + ret = ulsch_decoding_emul(phy_vars_eNB, + sched_subframe, + UE_id, + &rnti); + } + +#endif + + if (phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->cqi_crc_status == 1) { +#ifdef DEBUG_PHY_PROC + + print_CQI(phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->uci_format,0,phy_vars_eNB->lte_frame_parms.N_RB_DL); +#endif + access_mode = UNKNOWN_ACCESS; + extract_CQI(phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->o, + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->uci_format, + &phy_vars_eNB->eNB_UE_stats[UE_id], + phy_vars_eNB->lte_frame_parms.N_RB_DL, + &rnti, &access_mode); + phy_vars_eNB->eNB_UE_stats[UE_id].rank = phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->o_RI[0]; + } + + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->subframe_cba_scheduling_flag=0; + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->status= SCH_IDLE; + + if ((num_active_cba_groups > 0) && + (UE_id + num_active_cba_groups < NUMBER_OF_UE_MAX) && + (phy_vars_eNB->ulsch_eNB[UE_id+num_active_cba_groups]->cba_rnti[UE_id%num_active_cba_groups] > 0 ) && + (phy_vars_eNB->ulsch_eNB[UE_id+num_active_cba_groups]->num_active_cba_groups> 0)) { +#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d resetting the subframe_scheduling_flag for Ue %d cba groups %d members\n", + phy_vars_eNB->Mod_id,harq_pid,frame,subframe,UE_id,harq_pid, + UE_id+num_active_cba_groups, UE_id%phy_vars_eNB->ulsch_eNB[UE_id]->num_active_cba_groups); +#endif + phy_vars_eNB->ulsch_eNB[UE_id+num_active_cba_groups]->harq_processes[harq_pid]->subframe_cba_scheduling_flag=1; + phy_vars_eNB->ulsch_eNB[UE_id+num_active_cba_groups]->harq_processes[harq_pid]->status= CBA_ACTIVE; + phy_vars_eNB->ulsch_eNB[UE_id+num_active_cba_groups]->harq_processes[harq_pid]->TBS=phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->TBS; + } + + if (ret == (1+MAX_TURBO_ITERATIONS)) { + phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[harq_pid][phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->round]++; + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_active = 1; + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_ACK = 0; + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->round++; + } // ulsch in error + else { + LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d ULSCH received, setting round to 0, PHICH ACK\n", + phy_vars_eNB->Mod_id,harq_pid, + frame,subframe); + + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_active = 1; + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_ACK = 1; + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->round = 0; + phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_consecutive_errors = 0; +#ifdef DEBUG_PHY_PROC +#ifdef DEBUG_ULSCH + LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:", + frame,subframe, + harq_pid,phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->TBS>>3); + + for (j=0; julsch_eNB[UE_id]->harq_processes[harq_pid]->TBS>>3; j++) + LOG_T(PHY,"%x.",phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->b[j]); + + LOG_T(PHY,"\n"); +#endif +#endif + + if (access_mode > UNKNOWN_ACCESS) { + LOG_D(PHY,"[eNB %d] Frame %d, Subframe %d : received ULSCH SDU from CBA transmission, UE (%d,%x), CBA (group %d, rnti %x)\n", + phy_vars_eNB->Mod_id, frame,subframe, + UE_id, phy_vars_eNB->ulsch_eNB[UE_id]->rnti, + UE_id % phy_vars_eNB->ulsch_eNB[UE_id]->num_active_cba_groups, phy_vars_eNB->ulsch_eNB[UE_id]->cba_rnti[UE_id%num_active_cba_groups]); + + // detect if there is a CBA collision + if (phy_vars_eNB->cba_last_reception[UE_id%num_active_cba_groups] == 0 ) { + mac_xface->rx_sdu(phy_vars_eNB->Mod_id, + phy_vars_eNB->CC_id, + frame,subframe, + phy_vars_eNB->ulsch_eNB[UE_id]->rnti, + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->b, + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->TBS>>3, + harq_pid, + NULL); + + phy_vars_eNB->cba_last_reception[UE_id%num_active_cba_groups]+=1;//(subframe); + } else { + if (phy_vars_eNB->cba_last_reception[UE_id%num_active_cba_groups] == 1 ) + LOG_N(PHY,"[eNB%d] Frame %d subframe %d : first CBA collision detected \n ", + phy_vars_eNB->Mod_id,frame,subframe); + + LOG_N(PHY,"[eNB%d] Frame %d subframe %d : CBA collision set SR for UE %d in group %d \n ", + phy_vars_eNB->Mod_id,frame,subframe, + phy_vars_eNB->cba_last_reception[UE_id%num_active_cba_groups],UE_id%num_active_cba_groups ); + + phy_vars_eNB->cba_last_reception[UE_id%num_active_cba_groups]+=1; + + mac_xface->SR_indication(phy_vars_eNB->Mod_id, + phy_vars_eNB->CC_id, + frame, + phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti,subframe); + } + } // UNKNOWN_ACCESS + } // ULSCH CBA not in error + } + +} + +void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,const uint8_t abstraction_flag,const relaying_type_t r_type) +{ + //RX processing + UNUSED(r_type); + uint32_t l, ret=0,i,j,k; + uint32_t harq_pid, harq_idx, round; uint8_t nPRS; LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_eNB->lte_frame_parms; int sync_pos; uint16_t rnti=0; uint8_t access_mode; - int num_active_cba_groups; + const int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx; const int frame = phy_vars_eNB->proc[sched_subframe].frame_rx; @@ -2420,13 +2767,21 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ // Check for active processes in current subframe harq_pid = subframe2harq_pid(&phy_vars_eNB->lte_frame_parms, frame,subframe); + // reset the cba flag used for collision detection for (i=0; i < NUM_MAX_CBA_GROUP; i++) { phy_vars_eNB->cba_last_reception[i]=0; } + // Do PUCCH processing first + + for (i=0; imac_enabled==1) { if (phy_vars_eNB->eNB_UE_stats[i].mode == RA_RESPONSE) { process_Msg3(phy_vars_eNB,sched_subframe,i,harq_pid); @@ -2441,7 +2796,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ if ((phy_vars_eNB->ulsch_eNB[i]) && (phy_vars_eNB->ulsch_eNB[i]->rnti>0) && (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_scheduling_flag==1)) { - + // UE is has ULSCH scheduling round = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round; for (int rb=0; @@ -2456,14 +2811,13 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ frame,subframe,phy_vars_eNB->ulsch_eNB[i]->rnti,i); #endif -#ifdef DEBUG_PHY_PROC - if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) { LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for Msg3 in Sector %d\n", phy_vars_eNB->Mod_id, frame, subframe, phy_vars_eNB->eNB_UE_stats[i].sector); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_MSG3,1); } else { LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d Mode %s\n", phy_vars_eNB->Mod_id, @@ -2473,7 +2827,6 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ mode_string[phy_vars_eNB->eNB_UE_stats[i].mode]); } -#endif nPRS = phy_vars_eNB->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1]; @@ -2554,7 +2907,6 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ #endif stop_meas(&phy_vars_eNB->ulsch_decoding_stats); - //#ifdef DEBUG_PHY_PROC LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) RSSI (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n", phy_vars_eNB->Mod_id,harq_pid, frame,subframe, @@ -2594,8 +2946,12 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->lte_frame_parms.N_RB_DL, &rnti, &access_mode); phy_vars_eNB->eNB_UE_stats[i].rank = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_RI[0]; + } + if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_MSG3,0); + if (ret == (1+MAX_TURBO_ITERATIONS)) { phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[harq_pid][phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round]++; @@ -2652,21 +3008,10 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ frame, &phy_vars_eNB->ulsch_eNB[i]->Msg3_frame, &phy_vars_eNB->ulsch_eNB[i]->Msg3_subframe); - }/* - - LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:",frame,subframe, - harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3); - for (j=0;julsch_eNB[i]->harq_processes[harq_pid]->TBS>>3;j++) - printf("%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->c[0][j]); - printf("\n"); - */ - // dump_ulsch(phy_vars_eNB,sched_subframe,i); - //#ifndef EXMIMO_IOT + } LOG_D(PHY,"[eNB] Frame %d, Subframe %d: Msg3 in error, i = %d \n", frame,subframe,i); - //#else - //mac_exit_wrapper("Msg3 error"); - //#endif } // This is Msg3 error + else { //normal ULSCH LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n", phy_vars_eNB->Mod_id,harq_pid, @@ -2686,19 +3031,6 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round-1 ); #endif - /* - LOG_T(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:\n",frame,subframe, - harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3); - if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->c[0]!=NULL){ - for (j=0;julsch_eNB[i]->harq_processes[harq_pid]->TBS>>3;j++) - LOG_T(PHY,"%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->c[0][j]); - LOG_T(PHY,"\n"); - } - */ - - - // dump_ulsch(phy_vars_eNB,sched_subframe,i); - //mac_exit_wrapper("ULSCH error"); if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round== phy_vars_eNB->ulsch_eNB[i]->Mlimit) { LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d ULSCH Mlimit %d reached\n", @@ -2710,7 +3042,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active=0; phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[harq_pid]++; phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors++; - //dump_ulsch(phy_vars_eNB, sched_subframe, i); + // indicate error to MAC mac_xface->rx_sdu(phy_vars_eNB->Mod_id, phy_vars_eNB->CC_id, @@ -2762,11 +3094,6 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ hundred_times_log10_NPRB[phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb-1]/100 - get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 0)/100; - /* - dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[j]*phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb) - - phy_vars_eNB->rx_total_gain_eNB_dB - - hundred_times_log10_NPRB[phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb-1]/100 - - get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 0)/100;*/ phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 1; phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_ACK = 1; phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round = 0; @@ -2774,46 +3101,37 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) { if (phy_vars_eNB->mac_enabled==1) { - //#ifdef DEBUG_PHY_PROC - LOG_I(PHY,"[eNB %d][RAPROC] Frame %d Terminating ra_proc for harq %d, UE %d\n", - phy_vars_eNB->Mod_id, - frame,harq_pid,i); - //#endif - mac_xface->rx_sdu(phy_vars_eNB->Mod_id, - phy_vars_eNB->CC_id, - frame,subframe, - phy_vars_eNB->ulsch_eNB[i]->rnti, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3, - harq_pid, - &phy_vars_eNB->ulsch_eNB[i]->Msg3_flag); - // one-shot msg3 detection by MAC: empty PDU (e.g. CRNTI) - if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 0 ) { - phy_vars_eNB->eNB_UE_stats[i].mode = PRACH; - mac_xface->cancel_ra_proc(phy_vars_eNB->Mod_id, - phy_vars_eNB->CC_id, - frame, - phy_vars_eNB->eNB_UE_stats[i].crnti); - mac_phy_remove_ue(phy_vars_eNB->Mod_id,phy_vars_eNB->eNB_UE_stats[i].crnti); - phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 0; - } - - /* - mac_xface->terminate_ra_proc(phy_vars_eNB->Mod_id, - frame, - phy_vars_eNB->ulsch_eNB[i]->rnti, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3); - */ - } + LOG_I(PHY,"[eNB %d][RAPROC] Frame %d Terminating ra_proc for harq %d, UE %d\n", + phy_vars_eNB->Mod_id, + frame,harq_pid,i); + + mac_xface->rx_sdu(phy_vars_eNB->Mod_id, + phy_vars_eNB->CC_id, + frame,subframe, + phy_vars_eNB->ulsch_eNB[i]->rnti, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3, + harq_pid, + &phy_vars_eNB->ulsch_eNB[i]->Msg3_flag); + + // one-shot msg3 detection by MAC: empty PDU (e.g. CRNTI) + if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 0 ) { + phy_vars_eNB->eNB_UE_stats[i].mode = PRACH; + mac_xface->cancel_ra_proc(phy_vars_eNB->Mod_id, + phy_vars_eNB->CC_id, + frame, + phy_vars_eNB->eNB_UE_stats[i].crnti); + mac_phy_remove_ue(phy_vars_eNB->Mod_id,phy_vars_eNB->eNB_UE_stats[i].crnti); + phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 0; + } // Msg3_flag == 0 + + } // mac_enabled==1 phy_vars_eNB->eNB_UE_stats[i].mode = PUSCH; phy_vars_eNB->ulsch_eNB[i]->Msg3_flag = 0; - //#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][RAPROC] Frame %d : RX Subframe %d Setting UE %d mode to PUSCH\n",phy_vars_eNB->Mod_id,frame,subframe,i); - //#endif //DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %d][RAPROC] Frame %d : RX Subframe %d Setting UE %d mode to PUSCH\n",phy_vars_eNB->Mod_id,frame,subframe,i); for (k=0; k<8; k++) { //harq_processes for (j=0; jdlsch_eNB[i][0]->Mlimit; j++) { @@ -2837,9 +3155,8 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->eNB_UE_stats[i].dlsch_sliding_cnt=0; phy_vars_eNB->eNB_UE_stats[i].dlsch_NAK_round0=0; phy_vars_eNB->eNB_UE_stats[i].dlsch_mcs_offset=0; - - //mac_xface->macphy_exit("Mode PUSCH. Exiting.\n"); - } else { + } // Msg3_flag==1 + else { // Msg3_flag == 0 #ifdef DEBUG_PHY_PROC #ifdef DEBUG_ULSCH @@ -2852,38 +3169,30 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ LOG_T(PHY,"\n"); #endif #endif - //dump_ulsch(phy_vars_eNB,sched_subframe,i); - if (phy_vars_eNB->mac_enabled==1) { - // if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->calibration_flag == 0) { - mac_xface->rx_sdu(phy_vars_eNB->Mod_id, - phy_vars_eNB->CC_id, - frame,subframe, - phy_vars_eNB->ulsch_eNB[i]->rnti, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3, - harq_pid, - NULL); - //} - /* - else { - // Retrieve calibration information and do whatever - LOG_D(PHY,"[eNB][Auto-Calibration] Frame %d, Subframe %d : ULSCH PDU (RX) %d bytes\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3); - } - */ -#ifdef LOCALIZATION - start_meas(&phy_vars_eNB->localization_stats); - aggregate_eNB_UE_localization_stats(phy_vars_eNB, - i, - frame, - subframe, - get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 1)/100); - stop_meas(&phy_vars_eNB->localization_stats); -#endif - } - } + mac_xface->rx_sdu(phy_vars_eNB->Mod_id, + phy_vars_eNB->CC_id, + frame,subframe, + phy_vars_eNB->ulsch_eNB[i]->rnti, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3, + harq_pid, + NULL); + +#ifdef LOCALIZATION + start_meas(&phy_vars_eNB->localization_stats); + aggregate_eNB_UE_localization_stats(phy_vars_eNB, + i, + frame, + subframe, + get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 1)/100); + stop_meas(&phy_vars_eNB->localization_stats); +#endif + + } // mac_enabled==1 + } // Msg3_flag == 0 // estimate timing advance for MAC if (abstraction_flag == 0) { @@ -2932,313 +3241,18 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ #endif // dump stats to VCD - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS0+harq_pid,phy_vars_eNB->pusch_stats_mcs[0][(frame*10)+subframe]); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB0+harq_pid,phy_vars_eNB->pusch_stats_rb[0][(frame*10)+subframe]); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND0+harq_pid,phy_vars_eNB->pusch_stats_round[0][(frame*10)+subframe]); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI0+harq_pid,dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[0]->ulsch_power[0])); + if (i==0) { + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS0+harq_pid,phy_vars_eNB->pusch_stats_mcs[0][(frame*10)+subframe]); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB0+harq_pid,phy_vars_eNB->pusch_stats_rb[0][(frame*10)+subframe]); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND0+harq_pid,phy_vars_eNB->pusch_stats_round[0][(frame*10)+subframe]); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI0+harq_pid,dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[0]->ulsch_power[0])); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES0+harq_pid,ret); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN0+harq_pid,(frame*10)+subframe); + } } // ulsch_eNB[0] && ulsch_eNB[0]->rnti>0 && ulsch_eNB[0]->subframe_scheduling_flag == 1 - else if ((phy_vars_eNB->dlsch_eNB[i][0]) && - (phy_vars_eNB->dlsch_eNB[i][0]->rnti>0)) { // check for PUCCH - - // check SR availability - do_SR = is_SR_subframe(phy_vars_eNB,i,sched_subframe); - // do_SR = 0; - - // Now ACK/NAK - // First check subframe_tx flag for earlier subframes - get_n1_pucch_eNB(phy_vars_eNB, - i, - sched_subframe, - &n1_pucch0, - &n1_pucch1, - &n1_pucch2, - &n1_pucch3); - - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d, subframe %d Checking for PUCCH (%d,%d,%d,%d) SR %d\n", - phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[i][0]->rnti, - frame,subframe, - n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,do_SR); - - if ((n1_pucch0==-1) && (n1_pucch1==-1) && (do_SR==0)) { // no TX PDSCH that have to be checked and no SR for this UE_id - } else { - // otherwise we have some PUCCH detection to do - - // Null out PUCCH PRBs for noise measurement - switch(phy_vars_eNB->lte_frame_parms.N_RB_UL) { - case 6: - phy_vars_eNB->rb_mask_ul[0] |= (0x1 | (1<<5)); //position 5 - break; - case 15: - phy_vars_eNB->rb_mask_ul[0] |= (0x1 | (1<<14)); // position 14 - break; - case 25: - phy_vars_eNB->rb_mask_ul[0] |= (0x1 | (1<<24)); // position 24 - break; - case 50: - phy_vars_eNB->rb_mask_ul[0] |= 0x1; - phy_vars_eNB->rb_mask_ul[1] |= (1<<17); // position 49 (49-32) - break; - case 75: - phy_vars_eNB->rb_mask_ul[0] |= 0x1; - phy_vars_eNB->rb_mask_ul[2] |= (1<<10); // position 74 (74-64) - break; - case 100: - phy_vars_eNB->rb_mask_ul[0] |= 0x1; - phy_vars_eNB->rb_mask_ul[3] |= (1<<3); // position 99 (99-96) - break; - default: - LOG_E(PHY,"Unknown number for N_RB_UL %d\n",phy_vars_eNB->lte_frame_parms.N_RB_UL); - break; - } - - if (do_SR == 1) { - phy_vars_eNB->eNB_UE_stats[i].sr_total++; - - if (abstraction_flag == 0) - metric0_SR = rx_pucch(phy_vars_eNB, - pucch_format1, - i, - phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex, - 0, // n2_pucch - 0, // shortened format, should be use_srs flag, later - &SR_payload, - subframe, - PUCCH1_THRES); - -#ifdef PHY_ABSTRACTION - else { - metric0_SR = rx_pucch_emul(phy_vars_eNB, - i, - pucch_format1, - 0, - &SR_payload, - sched_subframe); - LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR (UE SR %d/%d)\n",phy_vars_eNB->Mod_id, - phy_vars_eNB->ulsch_eNB[i]->rnti,frame,subframe,SR_payload,phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex); - } - -#endif - - if (SR_payload == 1) { - LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Got SR for PUSCH, transmitting to MAC\n",phy_vars_eNB->Mod_id, - phy_vars_eNB->ulsch_eNB[i]->rnti,frame,subframe); - phy_vars_eNB->eNB_UE_stats[i].sr_received++; - - if (phy_vars_eNB->first_sr[i] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4 - /* is this test necessary? */ - if (phy_vars_eNB->dlsch_eNB[i][0]->harq_processes[0]->status != SCH_IDLE) - put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[i][0], 0); - phy_vars_eNB->first_sr[i] = 0; - phy_vars_eNB->dlsch_eNB[i][0]->harq_processes[0]->round=0; - phy_vars_eNB->dlsch_eNB[i][0]->harq_processes[0]->status=SCH_IDLE; - LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d First SR\n", - phy_vars_eNB->Mod_id, - phy_vars_eNB->ulsch_eNB[i]->rnti,frame,subframe); - } - - if (phy_vars_eNB->mac_enabled==1) { - mac_xface->SR_indication(phy_vars_eNB->Mod_id, - phy_vars_eNB->CC_id, - frame, - phy_vars_eNB->dlsch_eNB[i][0]->rnti,subframe); - } - } - }// do_SR==1 - - if ((n1_pucch0==-1) && (n1_pucch1==-1)) { // just check for SR - } else if (phy_vars_eNB->lte_frame_parms.frame_type==FDD) { // FDD - // if SR was detected, use the n1_pucch from SR, else use n1_pucch0 - // n1_pucch0 = (SR_payload==1) ? phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex:n1_pucch0; - - LOG_D(PHY,"Demodulating PUCCH for ACK/NAK: n1_pucch0 %d (%d), SR_payload %d\n",n1_pucch0,phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex,SR_payload); - - if (abstraction_flag == 0) { - - - - metric0 = rx_pucch(phy_vars_eNB, - pucch_format1a, - i, - (uint16_t)n1_pucch0, - 0, //n2_pucch - 0, // shortened format - pucch_payload0, - subframe, - PUCCH1a_THRES); - - if (metric0 < metric0_SR) - metric0=rx_pucch(phy_vars_eNB, - pucch_format1a, - i, - phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex, - 0, //n2_pucch - 0, // shortened format - pucch_payload0, - subframe, - PUCCH1a_THRES); - } - else { -#ifdef PHY_ABSTRACTION - metric0 = rx_pucch_emul(phy_vars_eNB,i, - pucch_format1a, - 0, - pucch_payload0, - subframe); -#endif - } - -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d pucch1a (FDD) payload %d (metric %d)\n", - phy_vars_eNB->Mod_id, - phy_vars_eNB->dlsch_eNB[i][0]->rnti, - frame,subframe, - pucch_payload0[0],metric0); -#endif - - process_HARQ_feedback(i,sched_subframe,phy_vars_eNB, - 0,// pusch_flag - pucch_payload0, - 2, - SR_payload); - - } // FDD - else { //TDD - - bundling_flag = phy_vars_eNB->pucch_config_dedicated[i].tdd_AckNackFeedbackMode; - - // fix later for 2 TB case and format1b - - if ((frame_parms->frame_type==FDD) || - (bundling_flag==bundling) || - ((frame_parms->frame_type==TDD)&&(frame_parms->tdd_config==1)&&((subframe!=2)||(subframe!=7)))) { - format = pucch_format1a; - // msg("PUCCH 1a\n"); - } else { - format = pucch_format1b; - // msg("PUCCH 1b\n"); - } - - // if SR was detected, use the n1_pucch from SR - if (SR_payload==1) { -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d with SR\n",phy_vars_eNB->Mod_id, - phy_vars_eNB->dlsch_eNB[i][0]->rnti, - frame,subframe, - n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format); -#endif - - if (abstraction_flag == 0) - metric0_SR = rx_pucch(phy_vars_eNB, - format, - i, - phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex, - 0, //n2_pucch - 0, // shortened format - pucch_payload0, - subframe, - PUCCH1a_THRES); - else { -#ifdef PHY_ABSTRACTION - metric0 = rx_pucch_emul(phy_vars_eNB,i, - format, - 0, - pucch_payload0, - subframe); -#endif - } - } else { //using n1_pucch0/n1_pucch1 resources -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d\n",phy_vars_eNB->Mod_id, - phy_vars_eNB->dlsch_eNB[i][0]->rnti, - frame,subframe, - n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format); -#endif - metric0=0; - metric1=0; - - // Check n1_pucch0 metric - if (n1_pucch0 != -1) { - if (abstraction_flag == 0) - metric0 = rx_pucch(phy_vars_eNB, - format, - i, - (uint16_t)n1_pucch0, - 0, // n2_pucch - 0, // shortened format - pucch_payload0, - subframe, - PUCCH1a_THRES); - else { -#ifdef PHY_ABSTRACTION - metric0 = rx_pucch_emul(phy_vars_eNB,i, - format, - 0, - pucch_payload0, - subframe); -#endif - } - } - - // Check n1_pucch1 metric - if (n1_pucch1 != -1) { - if (abstraction_flag == 0) - metric1 = rx_pucch(phy_vars_eNB, - format, - i, - (uint16_t)n1_pucch1, - 0, //n2_pucch - 0, // shortened format - pucch_payload1, - subframe, - PUCCH1a_THRES); - else { -#ifdef PHY_ABSTRACTION - metric1 = rx_pucch_emul(phy_vars_eNB,i, - format, - 1, - pucch_payload1, - subframe); - - -#endif - } - } - } - - if (SR_payload == 1) { - pucch_payload = pucch_payload0; - - if (bundling_flag == bundling) - pucch_sel = 2; - } else if (bundling_flag == multiplexing) { // multiplexing + no SR - pucch_payload = (metric1>metric0) ? pucch_payload1 : pucch_payload0; - pucch_sel = (metric1>metric0) ? 1 : 0; - } else { // bundling + no SR - if (n1_pucch1 != -1) - pucch_payload = pucch_payload1; - else if (n1_pucch0 != -1) - pucch_payload = pucch_payload0; - - pucch_sel = 2; // indicate that this is a bundled ACK/NAK - } - -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d ACK/NAK metric 0 %d, metric 1 %d, sel %d, (%d,%d)\n",phy_vars_eNB->Mod_id, - phy_vars_eNB->dlsch_eNB[i][0]->rnti, - frame,subframe, - metric0,metric1,pucch_sel,pucch_payload[0],pucch_payload[1]); -#endif - process_HARQ_feedback(i,sched_subframe,phy_vars_eNB, - 0,// pusch_flag - pucch_payload, - pucch_sel, - SR_payload); - } - } - - } + // update ULSCH statistics for tracing if ((frame % 100 == 0) && (subframe == 4)) { for (harq_idx=0; harq_idx<8; harq_idx++) { for (round=0; roundulsch_eNB[i]->Mlimit; round++) { @@ -3268,166 +3282,8 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->eNB_UE_stats[i].total_TBS_last = phy_vars_eNB->eNB_UE_stats[i].total_TBS; } - num_active_cba_groups = phy_vars_eNB->ulsch_eNB[i]->num_active_cba_groups; - - /*if (num_active_cba_groups > 0 ) - LOG_D(PHY,"[eNB] last slot %d trying cba transmission decoding UE %d num_grps %d rnti %x flag %d\n", - last_slot, i, num_active_cba_groups,phy_vars_eNB->ulsch_eNB[i]->cba_rnti[i%num_active_cba_groups], - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_cba_scheduling_flag ); - */ - if ((phy_vars_eNB->ulsch_eNB[i]) && - (num_active_cba_groups > 0) && - (phy_vars_eNB->ulsch_eNB[i]->cba_rnti[i%num_active_cba_groups]>0) && - (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_cba_scheduling_flag==1)) { - rnti=0; - -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d Checking PUSCH/ULSCH CBA Reception for UE %d with cba rnti %x mode %s\n", - phy_vars_eNB->Mod_id,harq_pid, - frame,subframe, - i, (uint16_t)phy_vars_eNB->ulsch_eNB[i]->cba_rnti[i%num_active_cba_groups],mode_string[phy_vars_eNB->eNB_UE_stats[i].mode]); -#endif - - if (abstraction_flag==0) { - rx_ulsch(phy_vars_eNB, - sched_subframe, - phy_vars_eNB->eNB_UE_stats[i].sector, // this is the effective sector id - i, - phy_vars_eNB->ulsch_eNB, - 0); - } - -#ifdef PHY_ABSTRACTION - else { - rx_ulsch_emul(phy_vars_eNB, - subframe, - phy_vars_eNB->eNB_UE_stats[i].sector, // this is the effective sector id - i); - } - -#endif - - if (abstraction_flag == 0) { - ret = ulsch_decoding(phy_vars_eNB, - i, - sched_subframe, - 0, // control_only_flag - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->V_UL_DAI, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb>20 ? 1 : 0); - } - -#ifdef PHY_ABSTRACTION - else { - ret = ulsch_decoding_emul(phy_vars_eNB, - sched_subframe, - i, - &rnti); - } - -#endif - - if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->cqi_crc_status == 1) { -#ifdef DEBUG_PHY_PROC - //if (((phy_vars_eNB->proc[sched_subframe].frame_tx%10) == 0) || (phy_vars_eNB->proc[sched_subframe].frame_tx < 50)) - print_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,0,phy_vars_eNB->lte_frame_parms.N_RB_DL); -#endif - access_mode = UNKNOWN_ACCESS; - extract_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format, - &phy_vars_eNB->eNB_UE_stats[i], - phy_vars_eNB->lte_frame_parms.N_RB_DL, - &rnti, &access_mode); - phy_vars_eNB->eNB_UE_stats[i].rank = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_RI[0]; - } - - /* LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d resetting the sched_subframeuling_flag, total cba groups %d %d\n", - phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i,harq_pid, - phy_vars_eNB->ulsch_eNB[i]->num_active_cba_groups,num_active_cba_groups); - */ - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_cba_scheduling_flag=0; - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->status= SCH_IDLE; - - if ((num_active_cba_groups > 0) && - // (i % num_active_cba_groups == 0) && // this ue is used a a template for the CBA - (i + num_active_cba_groups < NUMBER_OF_UE_MAX) && - (phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->cba_rnti[i%num_active_cba_groups] > 0 ) && - (phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->num_active_cba_groups> 0)) { -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d resetting the subframe_scheduling_flag for Ue %d cba groups %d members\n", - phy_vars_eNB->Mod_id,harq_pid,frame,subframe,i,harq_pid, - i+num_active_cba_groups, i%phy_vars_eNB->ulsch_eNB[i]->num_active_cba_groups); -#endif - phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->harq_processes[harq_pid]->subframe_cba_scheduling_flag=1; - phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->harq_processes[harq_pid]->status= CBA_ACTIVE; - phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->harq_processes[harq_pid]->TBS=phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS; - } - - if (ret == (1+MAX_TURBO_ITERATIONS)) { - phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[harq_pid][phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round]++; - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 1; - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_ACK = 0; - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round++; - } // ulsch in error - else { - LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d ULSCH received, setting round to 0, PHICH ACK\n", - phy_vars_eNB->Mod_id,harq_pid, - frame,subframe); - - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 1; - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_ACK = 1; - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round = 0; - phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors = 0; -#ifdef DEBUG_PHY_PROC -#ifdef DEBUG_ULSCH - LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:", - frame,subframe, - harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3); - - for (j=0; julsch_eNB[i]->harq_processes[harq_pid]->TBS>>3; j++) - LOG_T(PHY,"%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b[j]); - - LOG_T(PHY,"\n"); -#endif -#endif - - if (access_mode > UNKNOWN_ACCESS) { - LOG_D(PHY,"[eNB %d] Frame %d, Subframe %d : received ULSCH SDU from CBA transmission, UE (%d,%x), CBA (group %d, rnti %x)\n", - phy_vars_eNB->Mod_id, frame,subframe, - i, phy_vars_eNB->ulsch_eNB[i]->rnti, - i % phy_vars_eNB->ulsch_eNB[i]->num_active_cba_groups, phy_vars_eNB->ulsch_eNB[i]->cba_rnti[i%num_active_cba_groups]); - - // detect if there is a CBA collision - if (phy_vars_eNB->cba_last_reception[i%num_active_cba_groups] == 0 ) { - mac_xface->rx_sdu(phy_vars_eNB->Mod_id, - phy_vars_eNB->CC_id, - frame,subframe, - phy_vars_eNB->ulsch_eNB[i]->rnti, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3, - harq_pid, - NULL); - - phy_vars_eNB->cba_last_reception[i%num_active_cba_groups]+=1;//(subframe); - } else { - if (phy_vars_eNB->cba_last_reception[i%num_active_cba_groups] == 1 ) - LOG_N(PHY,"[eNB%d] Frame %d subframe %d : first CBA collision detected \n ", - phy_vars_eNB->Mod_id,frame,subframe); - - LOG_N(PHY,"[eNB%d] Frame %d subframe %d : CBA collision set SR for UE %d in group %d \n ", - phy_vars_eNB->Mod_id,frame,subframe, - phy_vars_eNB->cba_last_reception[i%num_active_cba_groups],i%num_active_cba_groups ); - - phy_vars_eNB->cba_last_reception[i%num_active_cba_groups]+=1; - - mac_xface->SR_indication(phy_vars_eNB->Mod_id, - phy_vars_eNB->CC_id, - frame, - phy_vars_eNB->dlsch_eNB[i][0]->rnti,subframe); - } - } - } // ULSCH CBA not in error - } - + // CBA (non-LTE) + cba_procedures(sched_subframe,phy_vars_eNB,i,harq_pid,abstraction_flag); } // loop i=0 ... NUMBER_OF_UE_MAX-1 if (abstraction_flag == 0) { diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 50afd8bcef..02fe3f1d29 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -99,7 +99,7 @@ uint64_t DLSCH_alloc_pdu_1[2]; #define CCCH_RB_ALLOC computeRIV(PHY_vars_eNB->lte_frame_parms.N_RB_UL,0,2) //#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13 //#define DLSCH_RB_ALLOC 0x0001 -void do_OFDM_mod_l(mod_sym_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms) +void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms) { int aa, slot_offset, slot_offset_F; @@ -2111,7 +2111,7 @@ PMI_FEEDBACK: // printf("Trial %d : Round %d, pmi_feedback %d \n",trials,round,pmi_feedback); for (aa=0; aalte_frame_parms.nb_antennas_tx; aa++) { - memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t)); + memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t)); } if (input_fd==NULL) { diff --git a/openair1/SIMULATION/LTE_PHY/mbmssim.c b/openair1/SIMULATION/LTE_PHY/mbmssim.c index 8b6e4f937e..9f09944609 100644 --- a/openair1/SIMULATION/LTE_PHY/mbmssim.c +++ b/openair1/SIMULATION/LTE_PHY/mbmssim.c @@ -131,7 +131,6 @@ int main(int argc, char **argv) double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1=0.0; uint8_t snr1set=0; double snr_step=1,input_snr_step=1; - //mod_sym_t **txdataF; int **txdata; double **s_re,**s_im,**r_re,**r_im; double iqim = 0.0; @@ -451,7 +450,7 @@ int main(int argc, char **argv) //if (trials%100==0) //eNB2UE[0]->first_run = 1; eNB2UE->first_run = 1; - memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t)); + memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t)); generate_mch(PHY_vars_eNB,sched_subframe,input_buffer,0); diff --git a/openair1/SIMULATION/LTE_PHY/pbchsim.c b/openair1/SIMULATION/LTE_PHY/pbchsim.c index e99da5041b..4a2b3f9351 100644 --- a/openair1/SIMULATION/LTE_PHY/pbchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pbchsim.c @@ -57,11 +57,11 @@ PHY_VARS_UE *PHY_vars_UE; #define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13 -mod_sym_t *dummybuf[4]; -mod_sym_t dummy0[2048*14]; -mod_sym_t dummy1[2048*14]; -mod_sym_t dummy2[2048*14]; -mod_sym_t dummy3[2048*14]; +int32_t *dummybuf[4]; +int32_t dummy0[2048*14]; +int32_t dummy1[2048*14]; +int32_t dummy2[2048*14]; +int32_t dummy3[2048*14]; int main(int argc, char **argv) @@ -72,7 +72,6 @@ int main(int argc, char **argv) int i,l,aa; double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1; uint8_t snr1set=0; - //mod_sym_t **txdataF; int **txdata,**txdata1,**txdata2; double **s_re,**s_im,**s_re1,**s_im1,**s_re2,**s_im2,**r_re,**r_im,**r_re1,**r_im1,**r_re2,**r_im2; double iqim = 0.0; @@ -603,7 +602,7 @@ int main(int argc, char **argv) dummybuf[2] = dummy2; dummybuf[3] = dummy3; generate_pbch(&PHY_vars_eNB->lte_eNB_pbch, - (mod_sym_t**)dummybuf, + (int32_t**)dummybuf, AMP, &PHY_vars_eNB->lte_frame_parms, pbch_pdu, diff --git a/openair1/SIMULATION/LTE_PHY/pdcchsim.c b/openair1/SIMULATION/LTE_PHY/pdcchsim.c index b87711348f..94bbbfaec3 100644 --- a/openair1/SIMULATION/LTE_PHY/pdcchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pdcchsim.c @@ -410,7 +410,6 @@ int main(int argc, char **argv) int i,l,aa; double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1; - //mod_sym_t **txdataF; int **txdata; double **s_re,**s_im,**r_re,**r_im; @@ -773,8 +772,8 @@ int main(int argc, char **argv) - PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(8,MAX_TURBO_ITERATIONS,N_RB_DL,0); - PHY_vars_UE->ulsch_ue[0] = new_ue_ulsch(8,N_RB_DL,0); + PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,N_RB_DL,0); + PHY_vars_UE->ulsch_ue[0] = new_ue_ulsch(N_RB_DL,0); PHY_vars_eNB->proc[subframe].frame_tx = 0; @@ -838,7 +837,7 @@ int main(int argc, char **argv) // printf("DCI (SF %d): txdataF %p (0 %p)\n",subframe,&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][512*14*subframe],&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][0]); for (aa=0; aalte_frame_parms.nb_antennas_tx_eNB; aa++) { - memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t)); + memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t)); /* re_offset = PHY_vars_eNB->lte_frame_parms.first_carrier_offset; diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 440a5ec567..4d0de016a2 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -635,8 +635,8 @@ int main(int argc, char **argv) UE2eNB->max_Doppler = maxDoppler; // NN: N_RB_UL has to be defined in ulsim - PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(8,max_turbo_iterations,N_RB_DL,0); - PHY_vars_UE->ulsch_ue[0] = new_ue_ulsch(8,N_RB_DL,0); + PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(max_turbo_iterations,N_RB_DL,0); + PHY_vars_UE->ulsch_ue[0] = new_ue_ulsch(N_RB_DL,0); // Create transport channel structures for 2 transport blocks (MIMO) for (i=0; i<2; i++) { diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 80190fe172..30272346f5 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -184,6 +184,12 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, size_bytes = sizeof(DCI1A_1_5MHz_FDD_t); size_bits = sizeof_DCI1A_1_5MHz_FDD_t; break; + case 15:/* + ((DCI1A_2_5MHz_FDD_t*)DLSCH_dci)->type = 1; + ((DCI1A_2_5MHz_FDD_t*)DLSCH_dci)->rballoc = 31; + size_bytes = sizeof(DCI1A_1_5MHz_FDD_t); + size_bits = sizeof_DCI1A_1_5MHz_FDD_t;*/ + break; case 25: ((DCI1A_5MHz_FDD_t*)DLSCH_dci)->type = 1; ((DCI1A_5MHz_FDD_t*)DLSCH_dci)->rballoc = 511; @@ -196,6 +202,12 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, size_bytes = sizeof(DCI1A_10MHz_FDD_t); size_bits = sizeof_DCI1A_10MHz_FDD_t; break; + case 75: + /* ((DCI1A_15MHz_FDD_t*)DLSCH_dci)->type = 1; + ((DCI1A_15MHz_FDD_t*)DLSCH_dci)->rballoc = 2047; + size_bytes = sizeof(DCI1A_10MHz_FDD_t); + size_bits = sizeof_DCI1A_10MHz_FDD_t;*/ + break; case 100: ((DCI1A_20MHz_FDD_t*)DLSCH_dci)->type = 1; ((DCI1A_20MHz_FDD_t*)DLSCH_dci)->rballoc = 8191; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index d68f26370b..2973bedd00 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -183,21 +183,10 @@ void rx_sdu( UE_list->UE_template[CC_idP][UE_id].bsr_info[lcgid] = (payload_ptr[0] & 0x3f); // update buffer info - // old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]; UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[lcgid]]; - UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]; - - /* - if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info) - UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info; - else - UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0; - */ - - if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= 300000) - UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 300000; + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]; PHY_vars_eNB_g[enb_mod_idP][CC_idP]->pusch_stats_bsr[UE_id][(frameP*10)+subframeP] = (payload_ptr[0] & 0x3f); if (UE_id == UE_list->head) @@ -784,7 +773,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, UE_sched_ctrl->ul_failure_timer); // reset the scheduling request UE_template->ul_SR = 0; - aggregation = process_ue_cqi(module_idP,UE_id); // =2 by default!! + aggregation = process_ue_cqi(module_idP,UE_id); status = mac_eNB_get_rrc_status(module_idP,rnti); if (status < RRC_CONNECTED) cqi_req = 0; @@ -838,7 +827,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power=target_rx_power; UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1=UE_template->pre_assigned_mcs_ul; mcs = cmin (UE_template->pre_assigned_mcs_ul, openair_daq_vars.target_ue_ul_mcs); // adjust, based on user-defined MCS - if ((cqi_req==1) && (mcs==20)) { + if ((cqi_req==1) && (mcs>19)) { mcs=19; } if (UE_template->pre_allocated_rb_table_index_ul >=0) { diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.c b/openair2/UTIL/LOG/vcd_signal_dumper.c index 4038c33bda..78e481f3d6 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.c +++ b/openair2/UTIL/LOG/vcd_signal_dumper.c @@ -119,6 +119,7 @@ const char* eurecomVariablesNames[] = { "mp_free", "ue_inst_cnt_rx", "ue_inst_cnt_tx", + "dci_info", "ue0_BSR", "ue0_BO", "ue0_scheduled", @@ -133,6 +134,14 @@ const char* eurecomVariablesNames[] = { "ue0_rssi5", "ue0_rssi6", "ue0_rssi7", + "ue0_res0", + "ue0_res1", + "ue0_res2", + "ue0_res3", + "ue0_res4", + "ue0_res5", + "ue0_res6", + "ue0_res7", "ue0_MCS0", "ue0_MCS1", "ue0_MCS2", @@ -157,6 +166,14 @@ const char* eurecomVariablesNames[] = { "ue0_ROUND5", "ue0_ROUND6", "ue0_ROUND7", + "ue0_SFN0", + "ue0_SFN1", + "ue0_SFN2", + "ue0_SFN3", + "ue0_SFN4", + "ue0_SFN5", + "ue0_SFN6", + "ue0_SFN7", }; const char* eurecomFunctionsNames[] = { @@ -238,6 +255,7 @@ const char* eurecomFunctionsNames[] = { "macxface_phy_config_sib2_eNB", "macxface_phy_config_dedicated_eNB", "phy_ue_compute_prach", + "phy_enb_ulsch_msg3", "phy_enb_ulsch_decoding0", "phy_enb_ulsch_decoding1", "phy_enb_ulsch_decoding2", diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.h b/openair2/UTIL/LOG/vcd_signal_dumper.h index 24a0efee27..a9e4339368 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.h +++ b/openair2/UTIL/LOG/vcd_signal_dumper.h @@ -91,6 +91,7 @@ typedef enum { VCD_SIGNAL_DUMPER_VARIABLE_MP_FREE, VCD_SIGNAL_DUMPER_VARIABLES_UE_INST_CNT_RX, VCD_SIGNAL_DUMPER_VARIABLES_UE_INST_CNT_TX, + VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO, VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR, VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO, VCD_SIGNAL_DUMPER_VARIABLES_UE0_SCHEDULED, @@ -105,6 +106,14 @@ typedef enum { VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI5, VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI6, VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI7, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES0, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES1, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES2, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES3, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES4, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES5, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES6, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES7, VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS0, VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS1, VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS2, @@ -129,6 +138,14 @@ typedef enum { VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND5, VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND6, VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND7, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN0, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN1, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN2, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN3, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN4, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN5, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN6, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN7, VCD_SIGNAL_DUMPER_VARIABLES_LAST, VCD_SIGNAL_DUMPER_VARIABLES_END = VCD_SIGNAL_DUMPER_VARIABLES_LAST, } vcd_signal_dump_variables; @@ -212,6 +229,7 @@ typedef enum { VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_CONFIG_SIB2_ENB, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_CONFIG_DEDICATED_ENB, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_UE_COMPUTE_PRACH, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_MSG3, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING1, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING2, diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf index e083ea0f4e..7d34889f67 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf @@ -36,7 +36,7 @@ eNBs = nb_antennas_tx = 1; nb_antennas_rx = 1; tx_gain = 90; - rx_gain = 127; + rx_gain = 125; prach_root = 0; prach_config_index = 0; prach_high_speed = "DISABLE"; @@ -66,7 +66,7 @@ eNBs = pusch_p0_Nominal = -90; pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; + pucch_p0_Nominal = -100; msg3_delta_Preamble = 6; pucch_deltaF_Format1 = "deltaF2"; pucch_deltaF_Format1b = "deltaF3"; @@ -140,10 +140,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/RT/USER/eNB_usrp.gtkw b/targets/RT/USER/eNB_usrp.gtkw index b7810896d5..935bf68b2e 100644 --- a/targets/RT/USER/eNB_usrp.gtkw +++ b/targets/RT/USER/eNB_usrp.gtkw @@ -1,15 +1,15 @@ [*] [*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI -[*] Thu Mar 17 23:50:10 2016 +[*] Sun Apr 10 20:34:38 2016 [*] [dumpfile] "/tmp/openair_dump_eNB.vcd" -[dumpfile_mtime] "Thu Mar 17 23:49:36 2016" -[dumpfile_size] 236045612 +[dumpfile_mtime] "Sun Apr 10 20:26:57 2016" +[dumpfile_size] 181182776 [savefile] "/home/papillon/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw" -[timestart] 10372000000 +[timestart] 19787100000 [size] 1535 876 [pos] -1 -1 -*-29.793451 12619679774 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +*-21.793451 19795882832 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 [sst_width] 284 [signals_width] 238 [sst_expanded] 1 @@ -51,82 +51,110 @@ functions.eNB_thread_tx9 functions.phy_procedures_eNb_tx functions.phy_procedures_eNb_rx @24 +variables.dci_info[63:0] variables.ue0_BO[63:0] @420 variables.ue0_BSR[63:0] -@421 variables.ue0_timing_advance[63:0] @28 functions.macxface_initiate_ra_proc functions.macxface_terminate_ra_proc +functions.phy_enb_ulsch_msg3 functions.macxface_SR_indication @420 variables.ue0_SR_ENERGY[63:0] variables.ue0_SR_THRES[63:0] +@25 +variables.dci_info[63:0] @28 functions.phy_enb_ulsch_decoding0 +@24 +variables.ue0_res0[63:0] @420 variables.ue0_rssi0[63:0] variables.ue0_MCS0[63:0] variables.ue0_RB0[63:0] @24 variables.ue0_ROUND0[63:0] +variables.ue0_SFN0[63:0] @28 functions.phy_enb_ulsch_decoding1 +@24 +variables.ue0_res1[63:0] @420 variables.ue0_rssi1[63:0] variables.ue0_MCS1[63:0] variables.ue0_RB1[63:0] @24 variables.ue0_ROUND1[63:0] +variables.ue0_SFN1[63:0] @28 functions.phy_enb_ulsch_decoding2 +@24 +variables.ue0_res2[63:0] @420 variables.ue0_rssi2[63:0] variables.ue0_MCS2[63:0] variables.ue0_RB2[63:0] @24 variables.ue0_ROUND2[63:0] +variables.ue0_SFN2[63:0] @28 functions.phy_enb_ulsch_decoding3 +@24 +variables.ue0_res3[63:0] @420 variables.ue0_rssi3[63:0] variables.ue0_MCS3[63:0] variables.ue0_RB3[63:0] @24 variables.ue0_ROUND3[63:0] +variables.ue0_SFN3[63:0] @28 functions.phy_enb_ulsch_decoding4 @420 variables.ue0_rssi4[63:0] +@24 +variables.ue0_res4[63:0] +@420 variables.ue0_MCS4[63:0] variables.ue0_RB4[63:0] @24 variables.ue0_ROUND4[63:0] +variables.ue0_SFN4[63:0] @28 functions.phy_enb_ulsch_decoding5 +@24 +variables.ue0_res5[63:0] @420 variables.ue0_rssi5[63:0] variables.ue0_MCS5[63:0] variables.ue0_RB5[63:0] @24 variables.ue0_ROUND5[63:0] +variables.ue0_SFN5[63:0] @28 functions.phy_enb_ulsch_decoding6 +@24 +variables.ue0_res6[63:0] @420 variables.ue0_rssi6[63:0] variables.ue0_MCS6[63:0] variables.ue0_RB6[63:0] @24 variables.ue0_ROUND6[63:0] +variables.ue0_SFN6[63:0] @28 functions.phy_enb_ulsch_decoding7 +@24 +variables.ue0_res7[63:0] @420 variables.ue0_rssi7[63:0] variables.ue0_MCS7[63:0] variables.ue0_RB7[63:0] @24 variables.ue0_ROUND7[63:0] +variables.ue0_SFN7[63:0] @28 functions.phy_enb_prach_rx functions.phy_eNB_dlsch_encoding From 20e2460913999148b15a3130c223fceabd72b6ea Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 12 Apr 2016 12:38:19 +0200 Subject: [PATCH 136/214] minor change in timing for 5 MHz on USRP B210 --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 2 +- .../CONF/enb.band7.tm1.50PRB.usrpb210.conf | 4 +- .../CONF/enb.band7.tm1.usrpb210.conf | 149 +++++++++--------- 3 files changed, 76 insertions(+), 79 deletions(-) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index fa900197b1..cdde7da204 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -627,7 +627,7 @@ extern "C" { case 7680000: s->usrp->set_master_clock_rate(7.68e6); openair0_cfg[0].samples_per_packet = 1024; - openair0_cfg[0].tx_sample_advance = 70;//103; + openair0_cfg[0].tx_sample_advance = 103; openair0_cfg[0].tx_bw = 5e6; openair0_cfg[0].rx_bw = 5e6; openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index ea92db22fa..d5d1f0d78a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -140,10 +140,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf index 7839a52d21..9d3a97346e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf @@ -23,85 +23,83 @@ eNBs = component_carriers = ( { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2680000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -29; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -100; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -100; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; } ); - srb1_parameters : { # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] @@ -131,7 +129,6 @@ eNBs = SCTP_OUTSTREAMS = 2; }; - ////////// MME parameters: mme_ip_address = ( { ipv4 = "192.168.12.11"; ipv6 = "192:168:30::17"; @@ -143,10 +140,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; From 6e5d7cdde79ab43ca6346512f3cd2b8e3488be76 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 12 Apr 2016 12:54:15 +0200 Subject: [PATCH 137/214] disable CPU affinity for UE and also for case when MAX_CPUS <=2 --- targets/RT/USER/lte-softmodem.c | 63 ++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 583be1ccb7..641990aabd 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -3298,39 +3298,46 @@ int main( int argc, char **argv ) } #ifndef LOWLATENCY - cpu_set_t cpuset; - int s; - char cpu_affinity[1024]; - LOG_I(HW, "Setting the affinity of main function to CPU 0, for device library to use CPU 0 only!\n"); + /* Currently we set affinity for UHD to CPU 0 for eNB only and only if number of CPUS >2 */ + /* ToDo: Set CPU affinity for UE */ + if (UE_flag == 0 && get_nprocs() > 2) + { + cpu_set_t cpuset; + int s; + char cpu_affinity[1024]; + + LOG_I(HW, "Setting the affinity of main function to CPU 0, for device library to use CPU 0 only!\n"); - CPU_ZERO(&cpuset); - CPU_SET(0, &cpuset); + CPU_ZERO(&cpuset); + CPU_SET(0, &cpuset); - s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); - if (s != 0) - { - perror( "pthread_setaffinity_np"); - exit_fun("Error setting processor affinity"); - } - /* Check the actual affinity mask assigned to the thread */ + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } - s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); - if (s != 0) - { - perror( "pthread_getaffinity_np"); - exit_fun("Error getting processor affinity "); + /* Check the actual affinity mask assigned to the thread */ + s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_getaffinity_np"); + exit_fun("Error getting processor affinity "); + } + memset(cpu_affinity, 0 , sizeof(cpu_affinity)); + for (int j = 0; j < CPU_SETSIZE; j++) + { + if (CPU_ISSET(j, &cpuset)) + { + char temp[1024]; + sprintf(temp, " CPU_%d ", j); + strcat(cpu_affinity, temp); + } + } + LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity); } - memset(cpu_affinity, 0 , sizeof(cpu_affinity)); - for (int j = 0; j < CPU_SETSIZE; j++) - if (CPU_ISSET(j, &cpuset)) - { - char temp[1024]; - sprintf(temp, " CPU_%d ", j); - strcat(cpu_affinity, temp); - } - - LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity); #endif /* device host type is set*/ From ea2f006742ffddea35e06fd2564378b019eb18e5 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 12 Apr 2016 16:18:15 +0200 Subject: [PATCH 138/214] copy UE Sim files to lte_build_dir/build --- cmake_targets/build_oai | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 821b3bca27..0f4e43e529 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -449,7 +449,7 @@ function main() { compilations \ $lte_build_dir ue_ip \ CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko - + # mkdir -p $DIR/at_commands/build # cd $DIR/at_commands/build # cmake .. @@ -472,6 +472,11 @@ function main() { # generate USIM data if [ -f $dbin/nvram ]; then install_nas_tools $dbin $dconf + echo_info "Copying UE specific part to $DIR/$lte_build_dir/build" + cp -Rvf $dbin/.ue_emm.nvram $DIR/$lte_build_dir/build + cp -Rvf $dbin/.ue.nvram $DIR/$lte_build_dir/build + cp -Rvf $dbin/.usim.nvram $DIR/$lte_build_dir/build + else echo_warning "not generated UE NAS files: binaries not found" fi From 2fbd85de22ba94ade6a82135a0dc7bef8c62f70d Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 12 Apr 2016 21:05:43 +0200 Subject: [PATCH 139/214] calibration for 10 MHz timing (after master clock change) --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index cdde7da204..aa20a317bb 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -619,7 +619,7 @@ extern "C" { case 15360000: s->usrp->set_master_clock_rate(15.36e06); openair0_cfg[0].samples_per_packet = 2048; - openair0_cfg[0].tx_sample_advance = 113; + openair0_cfg[0].tx_sample_advance = 153; openair0_cfg[0].tx_bw = 10e6; openair0_cfg[0].rx_bw = 10e6; openair0_cfg[0].tx_scheduling_advance = 10240; From b9cf09b2f4502fcb3e6d76ecf16df8ee408ffb20 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 13 Apr 2016 10:58:33 +0200 Subject: [PATCH 140/214] Disable CPU affinity for 2 CPUS + fix deadline scheduler --- targets/RT/USER/lte-softmodem.c | 56 ++++++++++++++++----------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index b1965f2f36..af09d715f5 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -1090,13 +1090,9 @@ static void* eNB_thread_tx( void* param ) #ifdef LOWLATENCY struct sched_attr attr; unsigned int flags = 0; - uint64_t runtime = (uint64_t) (get_runtime_tx(proc->subframe, runtime_phy_tx, target_dl_mcs,frame_parms[0]->N_RB_DL,cpuf,PHY_vars_eNB_g[0][0]->lte_frame_parms.nb_antennas_tx) * 1000000); + uint64_t runtime = 900000 ; uint64_t deadline = 1 * 1000000; // each tx thread will finish within 1ms uint64_t period = 1 * 10000000; // each tx thread has a period of 10ms from the starting point - if (runtime > 1000000 ){ - LOG_W(HW,"estimated runtime %d is larger than 1ms, adjusting\n",runtime); - runtime = (0.97 * 100) * 10000; - } attr.size = sizeof(attr); attr.sched_flags = 0; @@ -1123,16 +1119,19 @@ static void* eNB_thread_tx( void* param ) /* Set affinity mask to include CPUs 1 to MAX_CPUS */ /* CPU 0 is reserved for UHD threads */ /* CPU 1 is reserved for all TX threads */ + /* Enable CPU Affinity only if number of CPUs >2 */ CPU_ZERO(&cpuset); - //for (j = 1; j < get_nprocs(); j++) - CPU_SET(1, &cpuset); - - s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); - if (s != 0) + if (get_nprocs() > 2) { - perror( "pthread_setaffinity_np"); - exit_fun("Error setting processor affinity"); + CPU_SET(1, &cpuset); + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } } + /* Check the actual affinity mask assigned to the thread */ s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); @@ -1370,15 +1369,10 @@ static void* eNB_thread_rx( void* param ) #ifdef LOWLATENCY struct sched_attr attr; unsigned int flags = 0; - uint64_t runtime = get_runtime_rx(proc->subframe, runtime_phy_rx, target_ul_mcs,frame_parms[0]->N_RB_DL,cpuf,PHY_vars_eNB_g[0][0]->lte_frame_parms.nb_antennas_rx) * 1000000; + uint64_t runtime = 900000 ; uint64_t deadline = 1 * 1000000; uint64_t period = 1 * 10000000; // each rx thread has a period of 10ms from the starting point - if (runtime > 2300000 ) { - LOG_W(HW,"estimated rx runtime %d is larger than expected, adjusting\n",runtime); - runtime = 2300000; - deadline = runtime + 100000; - } - + attr.size = sizeof(attr); attr.sched_flags = 0; attr.sched_nice = 0; @@ -1405,16 +1399,21 @@ static void* eNB_thread_rx( void* param ) /* CPU 0 is reserved for UHD */ /* CPU 1 is reserved for all TX threads */ /* CPU 2..MAX_CPUS is reserved for all RX threads */ + /* Set CPU Affinity only if number of CPUs >2 */ CPU_ZERO(&cpuset); - for (j = 2; j < get_nprocs(); j++) - CPU_SET(j, &cpuset); - - s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); - if (s != 0) + if (get_nprocs() >2) { - perror( "pthread_setaffinity_np"); - exit_fun (" Error setting processor affinity :"); + for (j = 2; j < get_nprocs(); j++) + CPU_SET(j, &cpuset); + + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun (" Error setting processor affinity :"); + } } + /* Check the actual affinity mask assigned to the thread */ s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); @@ -3303,9 +3302,8 @@ int main( int argc, char **argv ) #ifndef LOWLATENCY - /* Currently we set affinity for UHD to CPU 0 for eNB only and only if number of CPUS >2 */ - /* ToDo: Set CPU affinity for UE */ - if (UE_flag == 0 && get_nprocs() > 2) + /* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */ + if (get_nprocs() > 2) { cpu_set_t cpuset; int s; From a5eb08b67bef794235cfbf29d5e43228c70f2a5f Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 13 Apr 2016 11:00:51 +0200 Subject: [PATCH 141/214] Enable CPU Affnity for UE threads --- targets/RT/USER/lte-ue.c | 188 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 182 insertions(+), 6 deletions(-) diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 68c1a44b2a..03871e865b 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -53,6 +53,7 @@ #include #include #include +#include #include "rt_wrapper.h" #include "assertions.h" @@ -211,6 +212,69 @@ static void *UE_thread_synch(void *arg) printf("UE_thread_sync in with PHY_vars_UE %p\n",arg); printf("waiting for sync (UE_thread_synch) \n"); +#ifndef LOWLATENCY + int policy, s, j; + struct sched_param sparam; + char cpu_affinity[1024]; + cpu_set_t cpuset; + + /* Set affinity mask to include CPUs 1 to MAX_CPUS */ + /* CPU 0 is reserved for UHD threads */ + CPU_ZERO(&cpuset); + for (j = 1; j < get_nprocs(); j++) + CPU_SET(j, &cpuset); + + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } + /* Check the actual affinity mask assigned to the thread */ + + s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_getaffinity_np"); + exit_fun("Error getting processor affinity "); + } + memset(cpu_affinity, 0 , sizeof(cpu_affinity)); + for (j = 0; j < CPU_SETSIZE; j++) + if (CPU_ISSET(j, &cpuset)) + { + char temp[1024]; + sprintf(temp, " CPU_%d ", j); + strcat(cpu_affinity, temp); + } + + memset(&sparam, 0 , sizeof (sparam)); + sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; + policy = SCHED_FIFO ; + + s = pthread_setschedparam(pthread_self(), policy, &sparam); + if (s != 0) + { + perror("pthread_setschedparam : "); + exit_fun("Error setting thread priority"); + } + s = pthread_getschedparam(pthread_self(), &policy, &sparam); + if (s != 0) + { + perror("pthread_getschedparam : "); + exit_fun("Error getting thread priority"); + + } + + LOG_I( HW, "[SCHED][UE] Started UE synch thread on CPU %d TID %ld , sched_policy = %s, priority = %d, CPU Affinity = %s \n", (int)sched_getcpu(), gettid(), + (policy == SCHED_FIFO) ? "SCHED_FIFO" : + (policy == SCHED_RR) ? "SCHED_RR" : + (policy == SCHED_OTHER) ? "SCHED_OTHER" : + "???", + (int) sparam.sched_priority, cpu_affinity); + +#endif + + pthread_mutex_lock(&sync_mutex); printf("Locked sync_mutex, waiting (UE_sync_thread)\n"); @@ -652,9 +716,65 @@ static void *UE_thread_tx(void *arg) } #else - struct sched_param sp; - sp.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; - pthread_setschedparam(pthread_self(),SCHED_FIFO,&sp); + int policy, s, j; + struct sched_param sparam; + char cpu_affinity[1024]; + cpu_set_t cpuset; + + /* Set affinity mask to include CPUs 1 to MAX_CPUS */ + /* CPU 0 is reserved for UHD threads */ + CPU_ZERO(&cpuset); + for (j = 1; j < get_nprocs(); j++) + CPU_SET(j, &cpuset); + + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } + /* Check the actual affinity mask assigned to the thread */ + + s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_getaffinity_np"); + exit_fun("Error getting processor affinity "); + } + memset(cpu_affinity, 0 , sizeof(cpu_affinity)); + for (j = 0; j < CPU_SETSIZE; j++) + if (CPU_ISSET(j, &cpuset)) + { + char temp[1024]; + sprintf(temp, " CPU_%d ", j); + strcat(cpu_affinity, temp); + } + + memset(&sparam, 0 , sizeof (sparam)); + sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; + policy = SCHED_FIFO ; + + s = pthread_setschedparam(pthread_self(), policy, &sparam); + if (s != 0) + { + perror("pthread_setschedparam : "); + exit_fun("Error setting thread priority"); + } + s = pthread_getschedparam(pthread_self(), &policy, &sparam); + if (s != 0) + { + perror("pthread_getschedparam : "); + exit_fun("Error getting thread priority"); + + } + + LOG_I( HW, "[SCHED][UE] Started UE thread TX on CPU %d TID %ld , sched_policy = %s, priority = %d, CPU Affinity = %s \n", (int)sched_getcpu(), gettid(), + (policy == SCHED_FIFO) ? "SCHED_FIFO" : + (policy == SCHED_RR) ? "SCHED_RR" : + (policy == SCHED_OTHER) ? "SCHED_OTHER" : + "???", + (int) sparam.sched_priority, cpu_affinity); + #endif #endif @@ -807,9 +927,65 @@ static void *UE_thread_rx(void *arg) } #else - struct sched_param sp; - sp.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; - pthread_setschedparam(pthread_self(),SCHED_FIFO,&sp); + int policy, s, j; + struct sched_param sparam; + char cpu_affinity[1024]; + cpu_set_t cpuset; + + /* Set affinity mask to include CPUs 1 to MAX_CPUS */ + /* CPU 0 is reserved for UHD threads */ + CPU_ZERO(&cpuset); + for (j = 1; j < get_nprocs(); j++) + CPU_SET(j, &cpuset); + + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } + /* Check the actual affinity mask assigned to the thread */ + + s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_getaffinity_np"); + exit_fun("Error getting processor affinity "); + } + memset(cpu_affinity, 0 , sizeof(cpu_affinity)); + for (j = 0; j < CPU_SETSIZE; j++) + if (CPU_ISSET(j, &cpuset)) + { + char temp[1024]; + sprintf(temp, " CPU_%d ", j); + strcat(cpu_affinity, temp); + } + + memset(&sparam, 0 , sizeof (sparam)); + sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; + policy = SCHED_FIFO ; + + s = pthread_setschedparam(pthread_self(), policy, &sparam); + if (s != 0) + { + perror("pthread_setschedparam : "); + exit_fun("Error setting thread priority"); + } + s = pthread_getschedparam(pthread_self(), &policy, &sparam); + if (s != 0) + { + perror("pthread_getschedparam : "); + exit_fun("Error getting thread priority"); + + } + + LOG_I( HW, "[SCHED][UE] Started UE RX thread on CPU %d TID %ld , sched_policy = %s, priority = %d, CPU Affinity = %s \n", (int)sched_getcpu(), gettid(), + (policy == SCHED_FIFO) ? "SCHED_FIFO" : + (policy == SCHED_RR) ? "SCHED_RR" : + (policy == SCHED_OTHER) ? "SCHED_OTHER" : + "???", + (int) sparam.sched_priority, cpu_affinity); + #endif #endif From 39f33013fedc1afcc4ee0954151f8943774ca0a2 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 13 Apr 2016 11:07:34 +0200 Subject: [PATCH 142/214] Removal of dead code --- cmake_targets/CMakeLists.txt | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 08e207f3a4..0c1a13084b 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -564,7 +564,6 @@ elseif (${RF_BOARD} STREQUAL "OAI_BLADERF") LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu") set(option_HW_lib "bladeRF -rdynamic -ldl") - #set(LOWLATENCY False) elseif (${RF_BOARD} STREQUAL "OAI_LMSSDR") include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB") @@ -2014,38 +2013,4 @@ endforeach(file) ADD_CUSTOM_TARGET(oarf DEPENDS ${OCT_FILES} ) - -#CMAKE INSTALL and CPACK -#INSTALL(PROGRAMS lte-softmodem ${OPENAIR_DIR}/targets DESTINATION bin) -#INSTALL(PROGRAMS oaisim ${OPENAIR_DIR}/targets DESTINATION bin) - - -#SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenAirInterface") -#SET(CPACK_PACKAGE_VENDOR "Eurecom") -#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OPENAIR_DIR}/README.txt") -#SET(CPACK_RESOURCE_FILE_LICENSE "${OPENAIR_DIR}/COPYING") -#SET(CPACK_PACKAGE_VERSION_MAJOR "1") -#SET(CPACK_PACKAGE_VERSION_MINOR "1") -#SET(CPACK_PACKAGE_VERSION_PATCH "1") - -#SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") -#SET(CPACK_STRIP_FILES "${OPENAIR_TARGETS}/bin") -#SET(CPACK_SOURCE_STRIP_FILES "") - -##debian specific -#SET(CPACK_DEBIAN_PACKAGE_NAME "OAI") -#SET(CPACK_DEBIAN_PACKAGE_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") -##dpkg --print-architecture (do not use i686 -#SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") - -#SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libgcc1 (>= 1:3.4.2-12)") -#SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpthread.so.0 libm.so.6 libconfig.so.9 librt.so.1 libcrypt.so.1 libcrypto.so.1.0.0 libnettle.so.4 libsctp.so.1 libc.so.6") -#SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "EURECOM-OSA") - -#SET(CPACK_PACKAGE_EXECUTABLES "lte-softmodem" "mme_gw.Rel10" "openair-hss") - -#SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "OpenAirInterface") -#SET(CPACK_DEBIAN_PACKAGE_Section "Beta-Release") - -#INCLUDE(CPack) From 41828d81bcb64edbd663f828f21d6b5ccbf174c5 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 13 Apr 2016 11:32:16 +0200 Subject: [PATCH 143/214] fixed the library linking from bin to cmake_current_binary_dir --- cmake_targets/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 0c1a13084b..23e46bd208 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -171,7 +171,7 @@ set(CMAKE_CXX_FLAGS ######################### -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${OPENAIR_TARGETS}/bin") +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CURRENT_BINARY_DIR}") ######################### # set a flag for changes in the source code # these changes are related to hardcoded path to include .h files From d67e4f5eb4d422e4eec387d3a5402607e6042de0 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 13 Apr 2016 12:42:55 +0200 Subject: [PATCH 144/214] updates to disable CPU Affinity --- cmake_targets/CMakeLists.txt | 4 +- cmake_targets/build_oai | 16 +++++- targets/RT/USER/lte-softmodem.c | 95 +++++++++++++++------------------ targets/RT/USER/lte-ue.c | 57 +++++++++++++------- 4 files changed, 101 insertions(+), 71 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 23e46bd208..b50c017a92 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -261,6 +261,7 @@ endif (${ENABLE_ITTI}) add_boolean_option(RTAI False "Use RTAI") if (${RTAI}) set(LOWLATENCY False) + set(CPU_AFFINITY False) add_definitions("-DENABLE_RTAI_CLOCK") add_definitions("-DCONFIG_RTAI_LXRT_INLINE") include_directories ("/usr/realtime/include") @@ -576,7 +577,6 @@ elseif (${RF_BOARD} STREQUAL "OAI_LMSSDR") LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lms7002m") LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/Si5351C") set(HW_SOURCE ${HW_SOURCE} ${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp) - set(LOWLATENCY False) set(option_HW_lib "-lLMS_SDR -lLMS7002M -lSi5351C -rdynamic -ldl") elseif (${RF_BOARD} STREQUAL "CPRIGW") @@ -606,6 +606,7 @@ endif (${TRANSP_PRO} STREQUAL "ETHERNET") include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON") Message("LOWLATENCY flag is ${LOWLATENCY}") +Message("CPU_Affinity flag is ${CPU_AFFINITY}") ############################################################## # ???!!! TO BE DOCUMENTED OPTIONS !!!??? @@ -619,6 +620,7 @@ add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "set the RLC mode to AM for the d add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????") add_boolean_option(DISABLE_USE_NAS False "???") add_boolean_option(LOWLATENCY True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14") +add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only valid without deadline scheduler). It is enabled only with >2 CPUs") add_boolean_option(NAS_ADDRESS_FIX False "specific to oaisim: for nasmesh driver") add_boolean_option(NAS_NETLINK False "???? Must be True to compile nasmesh driver without rtai") add_boolean_option(OAISIM False "specific to oaisim") diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 0f4e43e529..08d66533d3 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -47,6 +47,7 @@ PRINT_STATS="False" VCD_TIMING="False" LOWLATENCY_FLAG_USER="False" FORCE_LOWLATENCY_FLAG_USER="" +CPU_AFFINITY_FLAG_USER="True" #Only valid when lowlatecy flag is set to False REL="Rel10" HW="None" TP="None" @@ -125,6 +126,8 @@ Options Disables deadline scheduler of Linux kernel (>=3.14.x). --enable-deadline Disables deadline scheduler of Linux kernel (>=3.14.x). +--disable-cpu-affinity + Enables CPU Affinity between UHD/TX/RX Threads (Valid only when deadline scheduler is disabled). By defaulT, CPU Affinity is enabled when not using deadline scheduler. It is enabled only with >2 CPUs. For eNB, CPU_0-> Device library (UHD), CPU_1->TX Threads, CPU_2...CPU_MAX->Rx Threads. For UE, CPU_0->Device Library(UHD), CPU_1..CPU_MAX -> All the UE threads Usage (first build): oaisim (eNB + UE): ./build_oai -I -g --oaisim -x --install-system-files Eurecom EXMIMO + COTS UE : ./build_oai -I -g --eNB -x --install-system-files @@ -263,6 +266,10 @@ function main() { FORCE_LOWLATENCY_FLAG_USER="True" echo_info "Enabling the usage of deadline scheduler" shift 1;; + --disable-cpu-affinity) + CPU_AFFINITY_FLAG_USER="False" + echo_info "Disabling CPU Affinity (only valid when not using deadline scheduler)" + shift 1;; -h | --help) print_help exit 1;; @@ -328,8 +335,13 @@ function main() { LOWLATENCY_FLAG_USER=$FORCE_LOWLATENCY_FLAG_USER fi - echo_info "Flags for Deadline scheduler: $LOWLATENCY_FLAG_USER" + #Disable CPU Affinity for deadline scheduler + if [ "$LOWLATENCY_FLAG_USER" = "True" ] ; then + CPU_AFFINITY_FLAG_USER="False" + fi + echo_info "Flags for Deadline scheduler: $LOWLATENCY_FLAG_USER" + echo_info "Flags for CPU Affinity: $CPU_AFFINITY_FLAG_USER" ############################################ # setting and printing OAI envs, we should check here @@ -421,6 +433,7 @@ function main() { echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file echo "set(PACKAGE_NAME \"${lte_exec}\")" >> $cmake_file echo "set (LOWLATENCY \"${LOWLATENCY_FLAG_USER}\" )" >>$cmake_file + echo "set (CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file cd $DIR/$lte_build_dir/build cmake .. @@ -648,6 +661,7 @@ function main() { echo "set(TRANSP_PRO \"${TP}\")" >> $cmake_file echo 'set(PACKAGE_NAME "\"rrh_gw\"")' >> $cmake_file echo "set (LOWLATENCY \"${LOWLATENCY_FLAG_USER}\" )" >>$cmake_file + echo "set (CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file cd $DIR/$rrh_build_dir/build cmake .. diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index af09d715f5..b08b73788b 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -1121,6 +1121,8 @@ static void* eNB_thread_tx( void* param ) /* CPU 1 is reserved for all TX threads */ /* Enable CPU Affinity only if number of CPUs >2 */ CPU_ZERO(&cpuset); + + #ifdef CPU_AFFINITY if (get_nprocs() > 2) { CPU_SET(1, &cpuset); @@ -1131,6 +1133,7 @@ static void* eNB_thread_tx( void* param ) exit_fun("Error setting processor affinity"); } } + #endif /* Check the actual affinity mask assigned to the thread */ @@ -1401,6 +1404,7 @@ static void* eNB_thread_rx( void* param ) /* CPU 2..MAX_CPUS is reserved for all RX threads */ /* Set CPU Affinity only if number of CPUs >2 */ CPU_ZERO(&cpuset); + #ifdef CPU_AFFINITY if (get_nprocs() >2) { for (j = 2; j < get_nprocs(); j++) @@ -1413,7 +1417,7 @@ static void* eNB_thread_rx( void* param ) exit_fun (" Error setting processor affinity :"); } } - + #endif /* Check the actual affinity mask assigned to the thread */ s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); @@ -1788,12 +1792,6 @@ static void* eNB_thread( void* arg ) attr.sched_deadline = (0.9 * 100) * 10000; attr.sched_period = 1 * 1000000; - - /* pin the eNB main thread to CPU0*/ - /* if (pthread_setaffinity_np(pthread_self(), sizeof(mask),&mask) <0) { - perror("[MAIN_ENB_THREAD] pthread_setaffinity_np failed\n"); - }*/ - if (sched_setattr(0, &attr, flags) < 0 ) { perror("[SCHED] main eNB thread: sched_setattr failed\n"); exit_fun("Nothing to add"); @@ -1812,15 +1810,21 @@ static void* eNB_thread( void* arg ) /* Set affinity mask to include CPUs 1 to MAX_CPUS */ /* CPU 0 is reserved for UHD threads */ CPU_ZERO(&cpuset); - for (j = 1; j < get_nprocs(); j++) + #ifdef CPU_AFFINITY + if (get_nprocs() >2) + { + for (j = 1; j < get_nprocs(); j++) CPU_SET(j, &cpuset); - s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); - if (s != 0) - { - perror( "pthread_setaffinity_np"); - exit_fun("Error setting processor affinity"); + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } } + #endif + /* Check the actual affinity mask assigned to the thread */ s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); @@ -3303,43 +3307,43 @@ int main( int argc, char **argv ) #ifndef LOWLATENCY /* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */ + + cpu_set_t cpuset; + int s; + char cpu_affinity[1024]; + CPU_ZERO(&cpuset); + #ifdef CPU_AFFINITY if (get_nprocs() > 2) { - cpu_set_t cpuset; - int s; - char cpu_affinity[1024]; - - LOG_I(HW, "Setting the affinity of main function to CPU 0, for device library to use CPU 0 only!\n"); - - CPU_ZERO(&cpuset); CPU_SET(0, &cpuset); - s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); if (s != 0) { perror( "pthread_setaffinity_np"); exit_fun("Error setting processor affinity"); } - - /* Check the actual affinity mask assigned to the thread */ - s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); - if (s != 0) - { - perror( "pthread_getaffinity_np"); - exit_fun("Error getting processor affinity "); - } - memset(cpu_affinity, 0 , sizeof(cpu_affinity)); - for (int j = 0; j < CPU_SETSIZE; j++) - { - if (CPU_ISSET(j, &cpuset)) - { - char temp[1024]; - sprintf(temp, " CPU_%d ", j); - strcat(cpu_affinity, temp); - } - } - LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity); + LOG_I(HW, "Setting the affinity of main function to CPU 0, for device library to use CPU 0 only!\n"); } + #endif + + /* Check the actual affinity mask assigned to the thread */ + s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_getaffinity_np"); + exit_fun("Error getting processor affinity "); + } + memset(cpu_affinity, 0 , sizeof(cpu_affinity)); + for (int j = 0; j < CPU_SETSIZE; j++) + { + if (CPU_ISSET(j, &cpuset)) + { + char temp[1024]; + sprintf(temp, " CPU_%d ", j); + strcat(cpu_affinity, temp); + } + } + LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity); #endif /* device host type is set*/ @@ -3524,17 +3528,6 @@ int main( int argc, char **argv ) pthread_cond_init(&sync_cond,NULL); pthread_mutex_init(&sync_mutex, NULL); - /* this is moved to the eNB main thread */ - -//#if defined(ENABLE_ITTI) - // Wait for eNB application initialization to be complete (eNB registration to MME) - // if (UE_flag==0) { - // printf("Waiting for eNB application to be ready\n"); - //wait_system_ready ("Waiting for eNB application to be ready %s\r", &start_eNB); - // } - //#endif - - // this starts the DMA transfers #ifdef EXMIMO diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 03871e865b..561554516c 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -221,15 +221,22 @@ static void *UE_thread_synch(void *arg) /* Set affinity mask to include CPUs 1 to MAX_CPUS */ /* CPU 0 is reserved for UHD threads */ CPU_ZERO(&cpuset); - for (j = 1; j < get_nprocs(); j++) + + #ifdef CPU_AFFINITY + if (get_nprocs() >2) + { + for (j = 1; j < get_nprocs(); j++) CPU_SET(j, &cpuset); - s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); - if (s != 0) - { - perror( "pthread_setaffinity_np"); - exit_fun("Error setting processor affinity"); + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } } + #endif + /* Check the actual affinity mask assigned to the thread */ s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); @@ -724,15 +731,22 @@ static void *UE_thread_tx(void *arg) /* Set affinity mask to include CPUs 1 to MAX_CPUS */ /* CPU 0 is reserved for UHD threads */ CPU_ZERO(&cpuset); - for (j = 1; j < get_nprocs(); j++) + + #ifdef CPU_AFFINITY + if (get_nprocs() >2) + { + for (j = 1; j < get_nprocs(); j++) CPU_SET(j, &cpuset); - s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); - if (s != 0) - { - perror( "pthread_setaffinity_np"); - exit_fun("Error setting processor affinity"); + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } } + #endif + /* Check the actual affinity mask assigned to the thread */ s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); @@ -935,15 +949,22 @@ static void *UE_thread_rx(void *arg) /* Set affinity mask to include CPUs 1 to MAX_CPUS */ /* CPU 0 is reserved for UHD threads */ CPU_ZERO(&cpuset); - for (j = 1; j < get_nprocs(); j++) + + #ifdef CPU_AFFINITY + if (get_nprocs() >2) + { + for (j = 1; j < get_nprocs(); j++) CPU_SET(j, &cpuset); - s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); - if (s != 0) - { - perror( "pthread_setaffinity_np"); - exit_fun("Error setting processor affinity"); + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } } + #endif + /* Check the actual affinity mask assigned to the thread */ s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); From ccc6faf5782bafe89bb2277b17c62f8c021fe345 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 15 Apr 2016 10:31:14 +0200 Subject: [PATCH 145/214] minor typo in build script (help section) --- cmake_targets/build_oai | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 08d66533d3..77cf492b2b 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -127,7 +127,7 @@ Options --enable-deadline Disables deadline scheduler of Linux kernel (>=3.14.x). --disable-cpu-affinity - Enables CPU Affinity between UHD/TX/RX Threads (Valid only when deadline scheduler is disabled). By defaulT, CPU Affinity is enabled when not using deadline scheduler. It is enabled only with >2 CPUs. For eNB, CPU_0-> Device library (UHD), CPU_1->TX Threads, CPU_2...CPU_MAX->Rx Threads. For UE, CPU_0->Device Library(UHD), CPU_1..CPU_MAX -> All the UE threads + Disables CPU Affinity between UHD/TX/RX Threads (Valid only when deadline scheduler is disabled). By defaulT, CPU Affinity is enabled when not using deadline scheduler. It is enabled only with >2 CPUs. For eNB, CPU_0-> Device library (UHD), CPU_1->TX Threads, CPU_2...CPU_MAX->Rx Threads. For UE, CPU_0->Device Library(UHD), CPU_1..CPU_MAX -> All the UE threads Usage (first build): oaisim (eNB + UE): ./build_oai -I -g --oaisim -x --install-system-files Eurecom EXMIMO + COTS UE : ./build_oai -I -g --eNB -x --install-system-files From cac9ac40415dc9ac42fd21a1a76b07fd4b04c7c3 Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 18 Apr 2016 20:44:30 +0200 Subject: [PATCH 146/214] UHD interfacing (master clock 30.72, bandwidths on 5/10/20 @ 20 MHz), RX gain calibration back to normal. --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index aa20a317bb..584e9914ad 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -617,19 +617,19 @@ extern "C" { openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet; break; case 15360000: - s->usrp->set_master_clock_rate(15.36e06); + s->usrp->set_master_clock_rate(30.72e06); openair0_cfg[0].samples_per_packet = 2048; openair0_cfg[0].tx_sample_advance = 153; - openair0_cfg[0].tx_bw = 10e6; - openair0_cfg[0].rx_bw = 10e6; + openair0_cfg[0].tx_bw = 20e6; + openair0_cfg[0].rx_bw = 20e6; openair0_cfg[0].tx_scheduling_advance = 10240; break; case 7680000: - s->usrp->set_master_clock_rate(7.68e6); + s->usrp->set_master_clock_rate(30.72e6); openair0_cfg[0].samples_per_packet = 1024; - openair0_cfg[0].tx_sample_advance = 103; - openair0_cfg[0].tx_bw = 5e6; - openair0_cfg[0].rx_bw = 5e6; + openair0_cfg[0].tx_sample_advance = 153; + openair0_cfg[0].tx_bw = 20e6; + openair0_cfg[0].rx_bw = 20e6; openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; break; case 1920000: From b4d650e4f5d242b7d759666e5eb83aeebc2a9c94 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Tue, 19 Apr 2016 15:44:30 +0200 Subject: [PATCH 147/214] usrp_lib: setting master clock rate to 30.72 and filter to 20MHz for all cases to improve noise figure and channel response --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index ece81dc7c3..bc60c1f7c8 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -597,9 +597,10 @@ extern "C" { openair0_cfg[0].rx_gain_calib_table = calib_table_b210_38; bw_gain_adjust=1; } + s->usrp->set_master_clock_rate(30.72e6); + switch ((int)openair0_cfg[0].sample_rate) { case 30720000: - s->usrp->set_master_clock_rate(30.72e6); // from usrp_time_offset openair0_cfg[0].samples_per_packet = 4096; openair0_cfg[0].tx_sample_advance = 115; @@ -608,7 +609,6 @@ extern "C" { openair0_cfg[0].tx_scheduling_advance = 11*openair0_cfg[0].samples_per_packet; break; case 23040000: - s->usrp->set_master_clock_rate(46.08e6); openair0_cfg[0].samples_per_packet = 2048; openair0_cfg[0].tx_sample_advance = 113; openair0_cfg[0].tx_bw = 20e6; @@ -616,27 +616,24 @@ extern "C" { openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet; break; case 15360000: - s->usrp->set_master_clock_rate(30.72e6); openair0_cfg[0].samples_per_packet = 2048; openair0_cfg[0].tx_sample_advance = 113; - openair0_cfg[0].tx_bw = 10e6; - openair0_cfg[0].rx_bw = 10e6; + openair0_cfg[0].tx_bw = 20e6; + openair0_cfg[0].rx_bw = 20e6; openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; break; case 7680000: - s->usrp->set_master_clock_rate(30.72e6); openair0_cfg[0].samples_per_packet = 1024; openair0_cfg[0].tx_sample_advance = 70;//103; - openair0_cfg[0].tx_bw = 5e6; - openair0_cfg[0].rx_bw = 5e6; + openair0_cfg[0].tx_bw = 20e6; + openair0_cfg[0].rx_bw = 20e6; openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; break; case 1920000: - s->usrp->set_master_clock_rate(30.72e6); openair0_cfg[0].samples_per_packet = 256; openair0_cfg[0].tx_sample_advance = 40; - openair0_cfg[0].tx_bw = 1.25e6; - openair0_cfg[0].rx_bw = 1.25e6; + openair0_cfg[0].tx_bw = 20e6; + openair0_cfg[0].rx_bw = 20e6; openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet; break; default: From 972749b3bc9741a4673b5e76b2597ec049e9ca1f Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 19 Apr 2016 18:52:51 +0200 Subject: [PATCH 148/214] updates to USRP timing after changing master clock --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 584e9914ad..3a297bc3df 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -619,7 +619,7 @@ extern "C" { case 15360000: s->usrp->set_master_clock_rate(30.72e06); openair0_cfg[0].samples_per_packet = 2048; - openair0_cfg[0].tx_sample_advance = 153; + openair0_cfg[0].tx_sample_advance = 103; openair0_cfg[0].tx_bw = 20e6; openair0_cfg[0].rx_bw = 20e6; openair0_cfg[0].tx_scheduling_advance = 10240; @@ -627,7 +627,7 @@ extern "C" { case 7680000: s->usrp->set_master_clock_rate(30.72e6); openair0_cfg[0].samples_per_packet = 1024; - openair0_cfg[0].tx_sample_advance = 153; + openair0_cfg[0].tx_sample_advance = 90; openair0_cfg[0].tx_bw = 20e6; openair0_cfg[0].rx_bw = 20e6; openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; From bcbccfad935ee4dfe2e08480d6275aff103b7b3e Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 19 Apr 2016 18:53:48 +0200 Subject: [PATCH 149/214] change the default CPU Affinity configuration --- targets/RT/USER/lte-softmodem.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index b08b73788b..a33b025569 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -1090,8 +1090,8 @@ static void* eNB_thread_tx( void* param ) #ifdef LOWLATENCY struct sched_attr attr; unsigned int flags = 0; - uint64_t runtime = 900000 ; - uint64_t deadline = 1 * 1000000; // each tx thread will finish within 1ms + uint64_t runtime = 850000 ; + uint64_t deadline = 1 * 1000000 ; // each tx thread will finish within 1ms uint64_t period = 1 * 10000000; // each tx thread has a period of 10ms from the starting point attr.size = sizeof(attr); @@ -1125,7 +1125,8 @@ static void* eNB_thread_tx( void* param ) #ifdef CPU_AFFINITY if (get_nprocs() > 2) { - CPU_SET(1, &cpuset); + for (j = 1; j < get_nprocs(); j++) + CPU_SET(j, &cpuset); s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); if (s != 0) { @@ -1372,7 +1373,7 @@ static void* eNB_thread_rx( void* param ) #ifdef LOWLATENCY struct sched_attr attr; unsigned int flags = 0; - uint64_t runtime = 900000 ; + uint64_t runtime = 870000 ; uint64_t deadline = 1 * 1000000; uint64_t period = 1 * 10000000; // each rx thread has a period of 10ms from the starting point @@ -1407,7 +1408,7 @@ static void* eNB_thread_rx( void* param ) #ifdef CPU_AFFINITY if (get_nprocs() >2) { - for (j = 2; j < get_nprocs(); j++) + for (j = 1; j < get_nprocs(); j++) CPU_SET(j, &cpuset); s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); From 4fb09eebff45cfe276d3d724892f2c737037675d Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 19 Apr 2016 18:54:58 +0200 Subject: [PATCH 150/214] Disable lowlatency scheduler for EXMIMO --- cmake_targets/build_oai | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 77cf492b2b..3a3e8bbec3 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -316,7 +316,7 @@ function main() { #By default: EXMIMO: enable if [ "$FORCE_LOWLATENCY_FLAG_USER" = "" ]; then if [ "$HW" = "EXMIMO" ] ; then - LOWLATENCY_FLAG_USER="True" + LOWLATENCY_FLAG_USER="False" elif [ "$HW" = "ETHERNET" ] ; then LOWLATENCY_FLAG_USER="True" elif [ "$HW" = "OAI_USRP" ] ; then From 10d6eccb9f4e1dba0ff01acb5106426dc5e2f408 Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 20 Apr 2016 09:16:32 +0200 Subject: [PATCH 151/214] UL timing parameter for USRP B2x0, some adjustments in B2x0 configuration files for Band 7 --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 2 +- .../GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf | 2 +- targets/RT/USER/lte-softmodem.c | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 3a297bc3df..2705a13576 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -627,7 +627,7 @@ extern "C" { case 7680000: s->usrp->set_master_clock_rate(30.72e6); openair0_cfg[0].samples_per_packet = 1024; - openair0_cfg[0].tx_sample_advance = 90; + openair0_cfg[0].tx_sample_advance = 80; openair0_cfg[0].tx_bw = 20e6; openair0_cfg[0].rx_bw = 20e6; openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf index 9d3a97346e..9111346429 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf @@ -82,7 +82,7 @@ eNBs = rach_messagePowerOffsetGroupB = ; */ rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -100; + rach_preambleInitialReceivedTargetPower = -108; rach_preambleTransMax = 10; rach_raResponseWindowSize = 10; rach_macContentionResolutionTimer = 48; diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index a33b025569..b6c3e20464 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -3717,11 +3717,6 @@ int main( int argc, char **argv ) #endif - write_output("pusch_rb.m","puschrb",PHY_vars_eNB_g[0][0]->pusch_stats_rb,10240,1,2); - write_output("pusch_mcs.m","puschmcs",PHY_vars_eNB_g[0][0]->pusch_stats_mcs,10240,1,2); - write_output("pusch_round.m","puschround",PHY_vars_eNB_g[0][0]->pusch_stats_round,10240,1,2); - write_output("pusch_bsr.m","puschbsr",PHY_vars_eNB_g[0][0]->pusch_stats_bsr,10240,1,2); - write_output("pusch_BO.m","puschBO",PHY_vars_eNB_g[0][0]->pusch_stats_BO,10240,1,2); // stop threads #ifdef XFORMS printf("waiting for XFORMS thread\n"); From 9c14a20bd3ec13aaf5041510aa29c4a1282cf896 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 20 Apr 2016 15:17:22 +0200 Subject: [PATCH 152/214] updates to USRP calibration + few modifications in config files --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 26 +++++++++++++------ .../CONF/enb.band7.tm1.exmimo2.conf | 4 +-- .../CONF/enb.band7.tm1.usrpb210.conf | 18 ++++++------- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 2705a13576..763c27a158 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -620,16 +620,16 @@ extern "C" { s->usrp->set_master_clock_rate(30.72e06); openair0_cfg[0].samples_per_packet = 2048; openair0_cfg[0].tx_sample_advance = 103; - openair0_cfg[0].tx_bw = 20e6; - openair0_cfg[0].rx_bw = 20e6; + openair0_cfg[0].tx_bw = 10e6; + openair0_cfg[0].rx_bw = 10e6; openair0_cfg[0].tx_scheduling_advance = 10240; break; case 7680000: s->usrp->set_master_clock_rate(30.72e6); openair0_cfg[0].samples_per_packet = 1024; openair0_cfg[0].tx_sample_advance = 80; - openair0_cfg[0].tx_bw = 20e6; - openair0_cfg[0].rx_bw = 20e6; + openair0_cfg[0].tx_bw = 5e6; + openair0_cfg[0].rx_bw = 5e6; openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; break; case 1920000: @@ -656,8 +656,8 @@ extern "C" { for(i=0;iusrp->get_rx_num_channels();i++) { if (iusrp->set_rx_rate(openair0_cfg[0].sample_rate,i); - s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i); - printf("Setting rx freq/gain on channel %lu/%lu : BW %f (readback %f)\n",i,s->usrp->get_rx_num_channels(),openair0_cfg[0].rx_bw/1e6,s->usrp->get_rx_bandwidth(i)/1e6); + //s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i); + //printf("Setting rx freq/gain on channel %lu/%lu : BW %f (readback %f)\n",i,s->usrp->get_rx_num_channels(),openair0_cfg[0].rx_bw/1e6,s->usrp->get_rx_bandwidth(i)/1e6); s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[i],i); set_rx_gain_offset(&openair0_cfg[0],i,bw_gain_adjust); @@ -677,8 +677,8 @@ extern "C" { for(i=0;iusrp->get_tx_num_channels();i++) { if (iusrp->set_tx_rate(openair0_cfg[0].sample_rate,i); - s->usrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i); - printf("Setting tx freq/gain on channel %lu/%lu: BW %f (readback %f)\n",i,s->usrp->get_tx_num_channels(),openair0_cfg[0].tx_bw/1e6,s->usrp->get_tx_bandwidth(i)/1e6); + //s->usrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i); + //printf("Setting tx freq/gain on channel %lu/%lu: BW %f (readback %f)\n",i,s->usrp->get_tx_num_channels(),openair0_cfg[0].tx_bw/1e6,s->usrp->get_tx_bandwidth(i)/1e6); s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[i],i); s->usrp->set_tx_gain(openair0_cfg[0].tx_gain[i],i); } @@ -707,6 +707,16 @@ extern "C" { std::cout << boost::format("tx_max_num_samps %u") % (s->tx_stream->get_max_num_samps()) << std::endl; + /* Setting TX/RX BW after streamers are created due to USRP calibration issue */ + for(i=0;iusrp->get_tx_num_channels();i++) { + if (iusrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i); + s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i); + printf("Setting tx freq/gain on channel %lu/%lu: BW %f (readback %f)\n",i,s->usrp->get_tx_num_channels(),openair0_cfg[0].tx_bw/1e6,s->usrp->get_tx_bandwidth(i)/1e6); + printf("Setting rx freq/gain on channel %lu/%lu : BW %f (readback %f)\n",i,s->usrp->get_rx_num_channels(),openair0_cfg[0].rx_bw/1e6,s->usrp->get_rx_bandwidth(i)/1e6); + } + } + s->usrp->set_time_now(uhd::time_spec_t(0.0)); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf index 3ce32398f7..f1160e78ca 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf @@ -64,9 +64,9 @@ eNBs = srs_ackNackST =; srs_MaxUpPts =;*/ - pusch_p0_Nominal = -80; /*-85;*/ + pusch_p0_Nominal = -90; /*-85;*/ pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; /* -108 */ + pucch_p0_Nominal = -100; /* -108 */ msg3_delta_Preamble = 6; pucch_deltaF_Format1 = "deltaF2"; pucch_deltaF_Format1b = "deltaF3"; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf index 9111346429..967b0c0ca8 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf @@ -64,15 +64,15 @@ eNBs = srs_ackNackST =; srs_MaxUpPts =;*/ - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -100; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; + pusch_p0_Nominal = -90; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; rach_numberOfRA_Preambles = 64; rach_preamblesGroupAConfig = "DISABLE"; From 23efd459dd718af5a09afd2de16e50b222cf62f4 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 20 Apr 2016 16:34:59 +0200 Subject: [PATCH 153/214] Change the TX/RX BW for flat channel response --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 763c27a158..126496974e 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -620,16 +620,16 @@ extern "C" { s->usrp->set_master_clock_rate(30.72e06); openair0_cfg[0].samples_per_packet = 2048; openair0_cfg[0].tx_sample_advance = 103; - openair0_cfg[0].tx_bw = 10e6; - openair0_cfg[0].rx_bw = 10e6; + openair0_cfg[0].tx_bw = 20e6; + openair0_cfg[0].rx_bw = 20e6; openair0_cfg[0].tx_scheduling_advance = 10240; break; case 7680000: s->usrp->set_master_clock_rate(30.72e6); openair0_cfg[0].samples_per_packet = 1024; openair0_cfg[0].tx_sample_advance = 80; - openair0_cfg[0].tx_bw = 5e6; - openair0_cfg[0].rx_bw = 5e6; + openair0_cfg[0].tx_bw = 20e6; + openair0_cfg[0].rx_bw = 20e6; openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; break; case 1920000: From 4c5fd68efdcde82fb757c5a285f4e05e77d0abcd Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 20 Apr 2016 18:00:42 +0200 Subject: [PATCH 154/214] resetting bladeRF --- cmake_targets/autotests/test_case_list.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index eddc83c334..eb02cf0763 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -8,7 +8,7 @@ develop oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* hss hss_sim configure_cots* wvdial* iperf iperf_script ping tshark rrh_gw sudo -S -E /opt/ltebox/tools/stop_ltebox -$OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; uname -a; dmesg|tail +$OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; uname -a; dmesg|tail; $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py 36000 0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 016102 016105 016502 016505 0170+ 017502 017505 018002 018005 018502 018505 025502 025505 3 From a0ffa8ca17c6f2e8c409253f56ff49e7c6355069 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Thu, 21 Apr 2016 17:38:05 +0200 Subject: [PATCH 155/214] minor fix for installation of gnutls/nettle due to conflicts with openair-CN installation --- cmake_targets/tools/build_helper | 54 ++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 294c5006a5..a40bd8c996 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -132,10 +132,21 @@ compilations() { ############################################ install_nettle_from_source() { + nettle_install_log=$OPENAIR_DIR/cmake_targets/log/nettle_install_log.txt + echo_info "\nInstalling Nettle. The log file for nettle installation is here: $nettle_install_log " + ( cd /tmp echo "Downloading nettle archive" - rm -rf /tmp/nettle-2.5.tar.gz* /tmp/nettle-2.5 - wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz + $SUDO rm -rf /tmp/nettle-2.5.tar.gz* /tmp/nettle-2.5 + wget https://ftp.gnu.org/gnu/nettle/nettle-2.5.tar.gz + if [ $? -ne 0 ]; then + wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz + fi + if [ ! -f nettle-2.5.tar.gz ]; then + echo_error "Could not download nettle source files" + cd - + return + fi tar -xzf nettle-2.5.tar.gz cd nettle-2.5/ ./configure --disable-openssl --enable-shared --prefix=/usr @@ -143,21 +154,32 @@ install_nettle_from_source() { make -j`nproc` make check $SUDO make install - rm -rf /tmp/nettle-2.5.tar.gz /tmp/nettle-2.5 + ) >& $nettle_install_log } install_gnutls_from_source(){ + gnutls_install_log=$OPENAIR_DIR/cmake_targets/log/gnutls_install_log.txt + echo_info "\nInstalling Gnutls. The log file for Gnutls installation is here: $gnutls_install_log " + ( cd /tmp echo "Downloading gnutls archive" - rm -rf /tmp/gnutls-3.1.23.tar.xz* /tmp/gnutls-3.1.23 - wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz - tar -xzf gnutls-3.1.23.tar.xz + $SUDO rm -rf /tmp/gnutls-3.1.23.tar.xz* /tmp/gnutls-3.1.23 + wget http://mirrors.dotsrc.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz + if [ $? -ne 0 ]; then + wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz + fi + if [ ! -f gnutls-3.1.23.tar.xz ]; then + echo_error "Could not download gnutls source files" + cd - + return + fi + tar -xJf gnutls-3.1.23.tar.xz cd gnutls-3.1.23/ ./configure --prefix=/usr echo "Compiling gnutls" make -j`nproc` $SUDO make install - rm -rf /tmp/gnutls-3.1.23.tar.xz /tmp/gnutls-3.1.23 + )>& $gnutls_install_log } @@ -274,12 +296,12 @@ check_install_oai_software() { android-tools-adb $SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so - if [ `lsb_release -rs` = '12.04' ] ; then - install_nettle_from_source - install_gnutls_from_source - else - $SUDO apt-get install -y libgnutls-dev nettle-dev nettle-bin - fi + + # First we remove gnutls/nettle installation and then install from sources + $SUDO apt-get remove -y libgnutls-dev nettle-dev nettle-bin + install_nettle_from_source + install_gnutls_from_source + $SUDO pip install paramiko $SUDO pip install pyroute2 install_asn1c_from_source @@ -288,8 +310,8 @@ check_install_oai_software() { } install_asn1c_from_source(){ - asn1_install_dir=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt - echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_dir " + asn1_install_log=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt + echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log " ( $SUDO rm -rf /tmp/asn1c-r1516 mkdir -p /tmp/asn1c-r1516 @@ -303,7 +325,7 @@ install_asn1c_from_source(){ ./configure make -j`nproc` $SUDO make install - ) > $asn1_install_dir 2>&1 + ) > $asn1_install_log 2>&1 } ################################################# From 0ddf4208b08e748c6daadeb74be69a8ea6a9c3ca Mon Sep 17 00:00:00 2001 From: Navid Nikaein Date: Thu, 21 Apr 2016 18:26:25 +0200 Subject: [PATCH 156/214] disabling localization flag in RRC --- openair2/RRC/LITE/rrc_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/RRC/LITE/rrc_common.c b/openair2/RRC/LITE/rrc_common.c index 86a3197d1e..1955a5ac89 100644 --- a/openair2/RRC/LITE/rrc_common.c +++ b/openair2/RRC/LITE/rrc_common.c @@ -520,7 +520,7 @@ rrc_rx_tx( } else { // eNB check_handovers(ctxt_pP); // counetr, and get the value and aggregate -#ifdef LOCALIZATION +#ifdef RRC_LOCALIZATION /* for the localization, only primary CC_id might be relevant*/ gettimeofday(&ts, NULL); From a4a5dbbc703da54b75a864bc78cab06f6712e870 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Thu, 21 Apr 2016 18:39:30 +0200 Subject: [PATCH 157/214] added master clock for 5MHz --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 4b2a1dbb54..959945fd23 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -625,6 +625,7 @@ extern "C" { openair0_cfg[0].tx_scheduling_advance = 10240; break; case 7680000: + s->usrp->set_master_clock_rate(30.72e6); openair0_cfg[0].samples_per_packet = 1024; openair0_cfg[0].tx_sample_advance = 80; openair0_cfg[0].tx_bw = 20e6; From ba020c807f917fdc7355dc1250f628956f36c56b Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Thu, 21 Apr 2016 22:28:21 -0700 Subject: [PATCH 158/214] oaisim compilation error, ulsim 20 MHz segfault. ulsim tests. --- .../CODING/3gpplte_turbo_decoder_sse_8bit.c | 2 + openair1/PHY/INIT/lte_param_init.c | 1 + openair1/PHY/LTE_TRANSPORT/group_hopping.c | 20 +++++----- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 40 ++++++++++++++----- openair1/SCHED/phy_procedures_lte_eNb.c | 1 + openair1/SIMULATION/LTE_PHY/ulsim.c | 19 ++++----- targets/SIMU/USER/init_lte.c | 1 + targets/SIMU/USER/oaisim.h | 2 +- 8 files changed, 56 insertions(+), 30 deletions(-) diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c index ee78dd0773..0227a45a3d 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c @@ -1000,6 +1000,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y, #if defined(__x86_64__) || defined(__i386__) + // note: this makes valgrind freak __m128i avg=_mm_set1_epi32(0); for (i=0; i<(3*(n>>4))+1; i++) { @@ -1503,6 +1504,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y, tmp2=_mm_and_si128(tmp,mask); tmp2=_mm_cmpeq_epi16(tmp2,mask); + // printf("decoded_bytes %p\n",decoded_bytes); decoded_bytes[n_128*0+i]=(uint8_t) _mm_movemask_epi8(_mm_packs_epi16(tmp2,zeros)); int j; diff --git a/openair1/PHY/INIT/lte_param_init.c b/openair1/PHY/INIT/lte_param_init.c index 2b827dcb0e..0db51e8b17 100644 --- a/openair1/PHY/INIT/lte_param_init.c +++ b/openair1/PHY/INIT/lte_param_init.c @@ -45,6 +45,7 @@ void lte_param_init(unsigned char N_tx, lte_frame_parms->N_RB_UL = N_RB_DL; lte_frame_parms->threequarter_fs = threequarter_fs; lte_frame_parms->Ncp = extended_prefix_flag; + lte_frame_parms->Ncp_UL = extended_prefix_flag; lte_frame_parms->Nid_cell = Nid_cell; lte_frame_parms->nushift = Nid_cell%6; lte_frame_parms->nb_antennas_tx = N_tx; diff --git a/openair1/PHY/LTE_TRANSPORT/group_hopping.c b/openair1/PHY/LTE_TRANSPORT/group_hopping.c index 992ac3088d..64c0830386 100644 --- a/openair1/PHY/LTE_TRANSPORT/group_hopping.c +++ b/openair1/PHY/LTE_TRANSPORT/group_hopping.c @@ -52,7 +52,7 @@ void generate_grouphop(LTE_DL_FRAME_PARMS *frame_parms) x2 = frame_parms->Nid_cell/30; #ifdef DEBUG_GROUPHOP - msg("[PHY] GroupHop:"); + printf("[PHY] GroupHop:"); #endif for (ns=0; ns<20; ns++) { @@ -68,12 +68,12 @@ void generate_grouphop(LTE_DL_FRAME_PARMS *frame_parms) } #ifdef DEBUG_GROUPHOP - msg("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[ns]); + printf("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[ns]); #endif } #ifdef DEBUG_GROUPHOP - msg("\n"); + printf("\n"); #endif } @@ -89,7 +89,7 @@ void generate_seqhop(LTE_DL_FRAME_PARMS *frame_parms) s = lte_gold_generic(&x1,&x2,reset); #ifdef DEBUG_GROUPHOP - msg("[PHY] SeqHop:"); + printf("[PHY] SeqHop:"); #endif for (ns=0; ns<20; ns++) { @@ -100,12 +100,12 @@ void generate_seqhop(LTE_DL_FRAME_PARMS *frame_parms) frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[ns] = 0; #ifdef DEBUG_GROUPHOP - msg("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[ns]); + printf("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[ns]); #endif } #ifdef DEBUG_GROUPHOP - msg("\n"); + printf("\n"); #endif } @@ -116,7 +116,7 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms) uint8_t reset=1; uint32_t x1, x2, s=0; // This is from Section 5.5.1.3 - uint8_t Nsymb_UL = (frame_parms->Ncp_UL == 0) ? 7 : 6; + uint8_t Nsymb_UL = (frame_parms->Ncp_UL == NORMAL) ? 7 : 6; uint16_t next = 0; uint8_t ns=0; @@ -124,7 +124,7 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms) x2 = (32*(uint32_t)(frame_parms->Nid_cell/30)) + fss_pusch; #ifdef DEBUG_GROUPHOP - msg("[PHY] nPRS:"); + printf("[PHY] nPRS:"); #endif for (n=0; n<(20*Nsymb_UL); n++) { //loop over total number of bytes to generate @@ -137,7 +137,7 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms) if (n == next) { frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[ns] = ((uint8_t*)&s)[next&3]; #ifdef DEBUG_GROUPHOP - msg("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[ns]); + printf("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[ns]); #endif ns++; next+=Nsymb_UL; @@ -145,7 +145,7 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms) } #ifdef DEBUG_GROUPHOP - msg("\n"); + printf("\n"); #endif } diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 60838c44b7..a0a5602261 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -142,7 +142,6 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uin if (abstraction_flag==0) { for (r=0; rharq_processes[i]->c[r] = (uint8_t*)malloc16(((r==0)?8:0) + 3+768); - if (ulsch->harq_processes[i]->c[r]) memset(ulsch->harq_processes[i]->c[r],0,((r==0)?8:0) + 3+768); else @@ -338,6 +337,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, // CLEAR LLR's HERE for first packet in process } + // printf("after segmentation c[%d] = %p\n",0,ulsch_harq->c[0]); sumKr = 0; @@ -449,6 +449,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, // Rmux = Hpp*Q_m/Cmux; Rmux_prime = Hpp/Cmux; + // Clear "tag" interleaving matrix to allow for CQI/DATA identification memset(ytag,0,Cmux*Rmux_prime); @@ -457,6 +458,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, i=0; memset(y,LTE_NULL,Q_m*Hpp); + // printf("before unscrambling c[%d] = %p\n",0,ulsch_harq->c[0]); // read in buffer and unscramble llrs for everything but placeholder bits // llrs stored per symbol correspond to columns of interleaving matrix @@ -472,6 +474,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, s = lte_gold_generic(&x1, &x2, 0); } + // printf("after unscrambling c[%d] = %p\n",0,ulsch_harq->c[0]); + if (frame_parms->Ncp == 0) columnset = cs_ri_normal; else @@ -495,6 +499,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, } + // printf("after RI c[%d] = %p\n",0,ulsch_harq->c[0]); + // HARQ-ACK Bits (Note these overwrite some bits) if (frame_parms->Ncp == 0) columnset = cs_ack_normal; @@ -664,6 +670,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, j=(j+3)&3; } + // printf("after ACKNAK c[%d] = %p\n",0,ulsch_harq->c[0]); // RI BITS @@ -708,6 +715,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, j=(j+3)&3; } + // printf("after RI2 c[%d] = %p\n",0,ulsch_harq->c[0]); + // CQI and Data bits j=0; j2=0; @@ -736,10 +745,10 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, j2+=Q_m; } - + switch (Q_m) { case 2: - for (iprime=0; iprime0 else { + for (i=0; i<(Q_CQI/Q_m); i++) { for (q=0; qc[0]); switch (Q_m) { case 2: - for (iprime=0; iprimee[iprime++] = y[j2++]; ulsch_harq->e[iprime++] = y[j2++]; } break; case 4: - for (iprime=0; iprimee[iprime++] = y[j2++]; ulsch_harq->e[iprime++] = y[j2++]; ulsch_harq->e[iprime++] = y[j2++]; @@ -821,7 +833,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, } break; case 6: - for (iprime=0; iprimee[iprime++] = y[j2++]; ulsch_harq->e[iprime++] = y[j2++]; ulsch_harq->e[iprime++] = y[j2++]; @@ -832,6 +844,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, break; } } + // printf("after ACKNAK2 c[%d] = %p (iprime %d, G %d)\n",0,ulsch_harq->c[0],iprime,G); + // Do CQI/RI/HARQ-ACK Decoding first and pass to MAC // HARQ-ACK @@ -904,6 +918,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, // CQI + // printf("before cqi c[%d] = %p\n",0,ulsch_harq->c[0]); if (Q_CQI>0) { memset((void *)&dummy_w_cc[0],0,3*(ulsch_harq->Or1+8+32)); @@ -971,6 +986,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, for (r=0; rC; r++) { + // printf("before subblock deinterleaving c[%d] = %p\n",r,ulsch_harq->c[r]); // Get Turbo interleaver parameters if (rCminus) Kr = ulsch_harq->Kminus; @@ -1043,6 +1059,10 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, for (r=0; rC; r++) { + /* printf("c[%d] : %p\n",r, + ulsch_harq->c[r]); + */ + if (ulsch_harq->C == 1) crc_type = CRC24_A; else diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index ff3d17ad49..8e2cdf39f2 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -2547,6 +2547,7 @@ void cba_procedures(const unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eN const int frame = phy_vars_eNB->proc[sched_subframe].frame_rx; uint16_t rnti=0; int ret=0; + int i; num_active_cba_groups = phy_vars_eNB->ulsch_eNB[UE_id]->num_active_cba_groups; diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 4d0de016a2..56f8eb146a 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -308,7 +308,7 @@ int main(int argc, char **argv) break; default: - msg("Unsupported channel model!\n"); + printf("Unsupported channel model!\n"); exit(-1); break; } @@ -332,7 +332,7 @@ int main(int argc, char **argv) if ((transmission_mode!=1) && (transmission_mode!=2)) { - msg("Unsupported transmission mode %d\n",transmission_mode); + printf("Unsupported transmission mode %d\n",transmission_mode); exit(-1); } @@ -382,10 +382,10 @@ int main(int argc, char **argv) case 'i': input_fdUL = fopen(optarg,"r"); - msg("Reading in %s (%p)\n",optarg,input_fdUL); + printf("Reading in %s (%p)\n",optarg,input_fdUL); if (input_fdUL == (FILE*)NULL) { - msg("Unknown file %s\n",optarg); + printf("Unknown file %s\n",optarg); exit(-1); } @@ -509,7 +509,7 @@ int main(int argc, char **argv) // r_re0 = malloc(2*sizeof(double*)); // r_im0 = malloc(2*sizeof(double*)); - nsymb = (PHY_vars_eNB->lte_frame_parms.Ncp == 0) ? 14 : 12; + nsymb = (PHY_vars_eNB->lte_frame_parms.Ncp == NORMAL) ? 14 : 12; sprintf(bler_fname,"ULbler_mcs%d_nrb%d_ChannelModel%d_nsim%d.csv",mcs,nb_rb,chMod,n_frames); @@ -760,9 +760,9 @@ int main(int argc, char **argv) PHY_vars_eNB->proc[sf].subframe_rx=sf; } - msg("Init UL hopping UE\n"); + printf("Init UL hopping UE\n"); init_ul_hopping(&PHY_vars_UE->lte_frame_parms); - msg("Init UL hopping eNB\n"); + printf("Init UL hopping eNB\n"); init_ul_hopping(&PHY_vars_eNB->lte_frame_parms); PHY_vars_eNB->proc[subframe].frame_rx = PHY_vars_UE->frame_tx; @@ -1063,7 +1063,7 @@ int main(int argc, char **argv) start_meas(&PHY_vars_UE->ofdm_mod_stats); for (aa=0; aa<1; aa++) { - if (frame_parms->Ncp == 1) + if (frame_parms->Ncp == EXTENDED) PHY_ofdm_mod(&PHY_vars_UE->lte_ue_common_vars.txdataF[aa][subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX], // input &txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe], // output PHY_vars_UE->lte_frame_parms.ofdm_symbol_size, @@ -1257,6 +1257,7 @@ int main(int argc, char **argv) */ start_meas(&PHY_vars_eNB->ulsch_decoding_stats); + ret= ulsch_decoding(PHY_vars_eNB, 0, // UE_id subframe, @@ -1293,7 +1294,7 @@ int main(int argc, char **argv) if (PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->o_ACK[0] != PHY_vars_UE->ulsch_ue[0]->o_ACK[0]) ack_errors++; - // msg("ulsch_coding: O[%d] %d\n",i,o_flip[i]); + // printf("ulsch_coding: O[%d] %d\n",i,o_flip[i]); if (ret <= PHY_vars_eNB->ulsch_eNB[0]->max_turbo_iterations) { diff --git a/targets/SIMU/USER/init_lte.c b/targets/SIMU/USER/init_lte.c index c6784cc5a2..861bfa6cbf 100644 --- a/targets/SIMU/USER/init_lte.c +++ b/targets/SIMU/USER/init_lte.c @@ -247,6 +247,7 @@ void init_lte_vars(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs], (frame_parms[CC_id])->phich_config_common.phich_resource = oneSixth; (frame_parms[CC_id])->phich_config_common.phich_duration = normal; (frame_parms[CC_id])->Ncp = extended_prefix_flag; + (frame_parms[CC_id])->Ncp_UL = extended_prefix_flag; (frame_parms[CC_id])->Nid_cell = Nid_cell; (frame_parms[CC_id])->nushift = (Nid_cell%6); (frame_parms[CC_id])->nb_antennas_tx = (transmission_mode == 1) ? 1 : 2; diff --git a/targets/SIMU/USER/oaisim.h b/targets/SIMU/USER/oaisim.h index 8d3edbe9eb..6fb16b82db 100644 --- a/targets/SIMU/USER/oaisim.h +++ b/targets/SIMU/USER/oaisim.h @@ -73,7 +73,7 @@ int ulsch_abstraction(double* sinr_dB,uint8_t TM, uint8_t mcs,uint16_t nb_rb, ui void calc_path_loss(node_desc_t* node_tx, node_desc_t* node_rx, channel_desc_t *ch_desc, Environment_System_Config env_desc, double **SF); -void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, frame_t frame, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms); +void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, frame_t frame, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms); void reset_opp_meas(void); void print_opp_meas(void); From f970f11967e694784431b686c999d34239ab3ac1 Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 22 Apr 2016 08:37:12 +0200 Subject: [PATCH 159/214] removed warning when compiling for real-time --- openair1/SCHED/phy_procedures_lte_eNb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 8e2cdf39f2..6a785ebf33 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -2547,7 +2547,6 @@ void cba_procedures(const unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eN const int frame = phy_vars_eNB->proc[sched_subframe].frame_rx; uint16_t rnti=0; int ret=0; - int i; num_active_cba_groups = phy_vars_eNB->ulsch_eNB[UE_id]->num_active_cba_groups; @@ -2578,7 +2577,7 @@ void cba_procedures(const unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eN rx_ulsch_emul(phy_vars_eNB, subframe, phy_vars_eNB->eNB_UE_stats[UE_id].sector, // this is the effective sector id - i); + UE_id); } #endif From 1bba2d9de73e587c23826066d6cabb62ae46f579 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 22 Apr 2016 12:37:40 +0200 Subject: [PATCH 160/214] remove bladeRF initialization due to DC --- cmake_targets/autotests/test_case_list.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index eb02cf0763..1403885a70 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -8,7 +8,7 @@ develop oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* hss hss_sim configure_cots* wvdial* iperf iperf_script ping tshark rrh_gw sudo -S -E /opt/ltebox/tools/stop_ltebox -$OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; uname -a; dmesg|tail; $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py +$OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; uname -a; dmesg|tail 36000 0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 016102 016105 016502 016505 0170+ 017502 017505 018002 018005 018502 018505 025502 025505 3 @@ -4638,7 +4638,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w BLADERF -x -c - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W @@ -4714,7 +4714,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w BLADERF -x -c - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W @@ -4789,7 +4789,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w BLADERF -x -c - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W @@ -4864,7 +4864,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w BLADERF -x -c - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W @@ -4938,7 +4938,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w BLADERF -x -c - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W @@ -5012,7 +5012,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w BLADERF -x -c - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W From d1775abe2a2183c9bb6365b5f1d3fc32bede4401 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 22 Apr 2016 19:07:30 +0200 Subject: [PATCH 161/214] minor bugfix for USRP init --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 959945fd23..5173fc4653 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -711,8 +711,12 @@ extern "C" { for(i=0;iusrp->get_tx_num_channels();i++) { if (iusrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i); - s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i); printf("Setting tx freq/gain on channel %lu/%lu: BW %f (readback %f)\n",i,s->usrp->get_tx_num_channels(),openair0_cfg[0].tx_bw/1e6,s->usrp->get_tx_bandwidth(i)/1e6); + } + } + for(i=0;iusrp->get_rx_num_channels();i++) { + if (iusrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i); printf("Setting rx freq/gain on channel %lu/%lu : BW %f (readback %f)\n",i,s->usrp->get_rx_num_channels(),openair0_cfg[0].rx_bw/1e6,s->usrp->get_rx_bandwidth(i)/1e6); } } From 158177dc4e64bba5e2f9cc4fa9e9ab827540e735 Mon Sep 17 00:00:00 2001 From: ODROID Date: Mon, 25 Apr 2016 16:34:14 +0930 Subject: [PATCH 162/214] added fixes to build on odroid/xu4 platform --- openair1/PHY/CODING/3gpplte_sse.c | 2 +- openair1/PHY/TOOLS/lte_dfts.c | 8 ++++---- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/openair1/PHY/CODING/3gpplte_sse.c b/openair1/PHY/CODING/3gpplte_sse.c index ac4a1ae353..50c084d2a8 100755 --- a/openair1/PHY/CODING/3gpplte_sse.c +++ b/openair1/PHY/CODING/3gpplte_sse.c @@ -598,7 +598,7 @@ void threegpplte_turbo_encoder(unsigned char *input, #elif defined(__arm__) *ptr_output++ = vadd_u8(all_treillis[state0][cur_s1].systematic_andp1_64[code_rate], - all_treillis[state0][cur_s1].parity1_64[code_rate]); + all_treillis[state0][cur_s1].parity2_64[code_rate]); #endif } diff --git a/openair1/PHY/TOOLS/lte_dfts.c b/openair1/PHY/TOOLS/lte_dfts.c index 033cb143fc..1bdcb3ad60 100644 --- a/openair1/PHY/TOOLS/lte_dfts.c +++ b/openair1/PHY/TOOLS/lte_dfts.c @@ -635,7 +635,7 @@ static inline void bfly2_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x } #endif - + #if defined(__x86_64__) || defined(__i386__) @@ -689,9 +689,9 @@ static inline void bfly2_16_256(__m256i *x0, __m256i *x1, __m256i *y0, __m256i * #elif defined(__arm__) -static inline void bfly2_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8_t *y1)__attribute__((always_inline)); +static inline void bfly2_16(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8_t *y1, int16x8_t *tw, int16x8_t *twb)__attribute__((always_inline)); -static inline void bfly2_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8_t *y1) +static inline void bfly2_16(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8_t *y1, int16x8_t *tw, int16x8_t *twb) { *y0 = vqaddq_s16(*x0,*x1); @@ -2633,6 +2633,7 @@ int16_t tw64crep[192] __attribute__((aligned(32))) = { #define shiftright_int16_simd256(a,shift) _mm256_srai_epi16(a,shift) #define set1_int16_simd256(a) _mm256_set1_epi16(a); #define mulhi_int16_simd256(a,b) _mm256_slli_epi16(_mm256_mulhi_epi16(a,b),1); +#endif #elif defined(__arm__) #define simd_q15_t int16x8_t @@ -2643,7 +2644,6 @@ int16_t tw64crep[192] __attribute__((aligned(32))) = { #define _mm_empty() #define _m_empty() -#endif #endif #ifndef __AVX2__ diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 5173fc4653..72e79b44de 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -55,6 +55,10 @@ # include #endif +#ifdef __arm__ +# include +#endif + /** @addtogroup _USRP_PHY_RF_INTERFACE_ * @{ */ From 852775ac50f26e03055bc8f341c67445deb6c799 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 25 Apr 2016 19:24:54 +0200 Subject: [PATCH 163/214] cherry pick commits from bugfix-48-L1L2signalling to develop --- cmake_targets/CMakeLists.txt | 4 +-- cmake_targets/autotests/test_case_list.xml | 12 +++---- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 37 +++++++++++++++----- 3 files changed, 36 insertions(+), 17 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 51d779fa59..0b2a9c0b93 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -171,13 +171,13 @@ set(CMAKE_CXX_FLAGS ######################### -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${OPENAIR_TARGETS}/bin") +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CURRENT_BINARY_DIR}") ######################### # set a flag for changes in the source code # these changes are related to hardcoded path to include .h files add_definitions(-DCMAKER) set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3") -set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O2") +set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O3") set(GIT_BRANCH "UNKNOWN") diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index eddc83c334..1403885a70 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -4638,7 +4638,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w BLADERF -x -c - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W @@ -4714,7 +4714,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w BLADERF -x -c - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W @@ -4789,7 +4789,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w BLADERF -x -c - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W @@ -4864,7 +4864,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w BLADERF -x -c - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W @@ -4938,7 +4938,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w BLADERF -x -c - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W @@ -5012,7 +5012,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w BLADERF -x -c - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index bc60c1f7c8..7732cf8ff2 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -597,11 +597,10 @@ extern "C" { openair0_cfg[0].rx_gain_calib_table = calib_table_b210_38; bw_gain_adjust=1; } - s->usrp->set_master_clock_rate(30.72e6); switch ((int)openair0_cfg[0].sample_rate) { case 30720000: - // from usrp_time_offset + s->usrp->set_master_clock_rate(30.72e6); openair0_cfg[0].samples_per_packet = 4096; openair0_cfg[0].tx_sample_advance = 115; openair0_cfg[0].tx_bw = 20e6; @@ -609,6 +608,7 @@ extern "C" { openair0_cfg[0].tx_scheduling_advance = 11*openair0_cfg[0].samples_per_packet; break; case 23040000: + s->usrp->set_master_clock_rate(23.04e6); //to be checked openair0_cfg[0].samples_per_packet = 2048; openair0_cfg[0].tx_sample_advance = 113; openair0_cfg[0].tx_bw = 20e6; @@ -616,20 +616,23 @@ extern "C" { openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet; break; case 15360000: + s->usrp->set_master_clock_rate(30.72e06); openair0_cfg[0].samples_per_packet = 2048; - openair0_cfg[0].tx_sample_advance = 113; + openair0_cfg[0].tx_sample_advance = 103; openair0_cfg[0].tx_bw = 20e6; openair0_cfg[0].rx_bw = 20e6; - openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; + openair0_cfg[0].tx_scheduling_advance = 10240; break; case 7680000: + s->usrp->set_master_clock_rate(30.72e6); openair0_cfg[0].samples_per_packet = 1024; - openair0_cfg[0].tx_sample_advance = 70;//103; + openair0_cfg[0].tx_sample_advance = 80; openair0_cfg[0].tx_bw = 20e6; openair0_cfg[0].rx_bw = 20e6; openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; break; case 1920000: + s->usrp->set_master_clock_rate(7.68e6); openair0_cfg[0].samples_per_packet = 256; openair0_cfg[0].tx_sample_advance = 40; openair0_cfg[0].tx_bw = 20e6; @@ -652,8 +655,8 @@ extern "C" { for(i=0;iusrp->get_rx_num_channels();i++) { if (iusrp->set_rx_rate(openair0_cfg[0].sample_rate,i); - s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i); - printf("Setting rx freq/gain on channel %lu/%lu : BW %f (readback %f)\n",i,s->usrp->get_rx_num_channels(),openair0_cfg[0].rx_bw/1e6,s->usrp->get_rx_bandwidth(i)/1e6); + //s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i); + //printf("Setting rx freq/gain on channel %lu/%lu : BW %f (readback %f)\n",i,s->usrp->get_rx_num_channels(),openair0_cfg[0].rx_bw/1e6,s->usrp->get_rx_bandwidth(i)/1e6); s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[i],i); set_rx_gain_offset(&openair0_cfg[0],i,bw_gain_adjust); @@ -673,8 +676,8 @@ extern "C" { for(i=0;iusrp->get_tx_num_channels();i++) { if (iusrp->set_tx_rate(openair0_cfg[0].sample_rate,i); - s->usrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i); - printf("Setting tx freq/gain on channel %lu/%lu: BW %f (readback %f)\n",i,s->usrp->get_tx_num_channels(),openair0_cfg[0].tx_bw/1e6,s->usrp->get_tx_bandwidth(i)/1e6); + //s->usrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i); + //printf("Setting tx freq/gain on channel %lu/%lu: BW %f (readback %f)\n",i,s->usrp->get_tx_num_channels(),openair0_cfg[0].tx_bw/1e6,s->usrp->get_tx_bandwidth(i)/1e6); s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[i],i); s->usrp->set_tx_gain(openair0_cfg[0].tx_gain[i],i); } @@ -683,6 +686,8 @@ extern "C" { // display USRP settings std::cout << boost::format("Actual master clock: %fMHz...") % (s->usrp->get_master_clock_rate()/1e6) << std::endl; + + sleep(1); // create tx & rx streamer uhd::stream_args_t stream_args_rx("sc16", "sc16"); @@ -701,6 +706,20 @@ extern "C" { std::cout << boost::format("tx_max_num_samps %u") % (s->tx_stream->get_max_num_samps()) << std::endl; + /* Setting TX/RX BW after streamers are created due to USRP calibration issue */ + for(i=0;iusrp->get_tx_num_channels();i++) { + if (iusrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i); + printf("Setting tx freq/gain on channel %lu/%lu: BW %f (readback %f)\n",i,s->usrp->get_tx_num_channels(),openair0_cfg[0].tx_bw/1e6,s->usrp->get_tx_bandwidth(i)/1e6); + } + } + for(i=0;iusrp->get_rx_num_channels();i++) { + if (iusrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i); + printf("Setting rx freq/gain on channel %lu/%lu : BW %f (readback %f)\n",i,s->usrp->get_rx_num_channels(),openair0_cfg[0].rx_bw/1e6,s->usrp->get_rx_bandwidth(i)/1e6); + } + } + s->usrp->set_time_now(uhd::time_spec_t(0.0)); From 9eaa72d86bc29a1238bb73a39d1fc937af5a71e1 Mon Sep 17 00:00:00 2001 From: Chun-Yeow Yeoh Date: Tue, 14 Jul 2015 18:21:03 +0800 Subject: [PATCH 164/214] UE: add PCO in PDN Connectivity Request message Add the PCO so that MME allocates the IP address accordingly. The protocol ID known as "IP address allocation via NAS signalling" is assigned. Otherwise, the OAI UE will always has IP address set to 0.0.0.0 This has tested with OAI eNB with S1 interface using OAI EPC. Reference: http://www.sharetechnote.com/html/Handbook_LTE_ProtocolConfigurationOption.html This patch is merged with Cedric's patch and tested. Signed-off-by: Chun-Yeow Yeoh Signed-off-by: Cedric Roux --- openair3/NAS/UE/ESM/SAP/esm_send.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/openair3/NAS/UE/ESM/SAP/esm_send.c b/openair3/NAS/UE/ESM/SAP/esm_send.c index ab5341062a..51cd96fdc8 100755 --- a/openair3/NAS/UE/ESM/SAP/esm_send.c +++ b/openair3/NAS/UE/ESM/SAP/esm_send.c @@ -181,6 +181,35 @@ int esm_send_pdn_connectivity_request(int pti, int is_emergency, int pdn_type, } } + /* Add PCO */ +# define CONFIGURATION_PROTOCOL_PPP 0 +# define PROTOCOL_ID_IPCP 0x8021 +# define PROTOCOL_ID_DNS_SERVER_IPV4_ADDRESS 0x000D +# define PROTOCOL_ID_IP_ADDR_NAS_SIGNALING 0x000A + + msg->presencemask |= PDN_CONNECTIVITY_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT; + msg->protocolconfigurationoptions.configurationprotol = CONFIGURATION_PROTOCOL_PPP; + msg->protocolconfigurationoptions.num_protocol_id_or_container_id = 3; + msg->protocolconfigurationoptions.protocolid[0] = PROTOCOL_ID_IPCP; + msg->protocolconfigurationoptions.lengthofprotocolid[0] = 16; /* Size of PROTOCOL_ID_IPCP */ + msg->protocolconfigurationoptions.protocolidcontents[0].value = (uint8_t *) + /* PROTOCOL_ID_IPCP data */ + /* the format is as of RFC 1331 (see page 27) */ + "\x01" /* Configure-Request */ + "\x00" /* Indentifier (set to 0) */ + "\x00\x10" /* Length (16 bytes) */ + "\x81" /* Type = Primary DNS - see RFC 1877 */ + "\x06" /* length */ + "\x00\x00\x00\x00" /* IP address set to 0 */ + "\x83" /* Type = Secondary DNS - see RFC 1877 */ + "\x06" /* length */ + "\x00\x00\x00\x00"; /* IP address set to 0 */ + msg->protocolconfigurationoptions.protocolidcontents[0].length = 16; + msg->protocolconfigurationoptions.protocolid[1] = PROTOCOL_ID_DNS_SERVER_IPV4_ADDRESS; + msg->protocolconfigurationoptions.lengthofprotocolid[1] = 0x00; + msg->protocolconfigurationoptions.protocolid[2] = PROTOCOL_ID_IP_ADDR_NAS_SIGNALING; + msg->protocolconfigurationoptions.lengthofprotocolid[2] = 0x00; + LOG_TRACE(INFO, "ESM-SAP - Send PDN Connectivity Request message " "(pti=%d, ebi=%d)", msg->proceduretransactionidentity, msg->epsbeareridentity); From 2493ea4a3cdee73ec7c6052380691dd1e018817b Mon Sep 17 00:00:00 2001 From: Navid Nikaein Date: Tue, 26 Apr 2016 13:51:50 +0200 Subject: [PATCH 165/214] update the run_enb_ue_virt_s1 script to birng up oip interface automatically --- cmake_targets/tools/run_enb_ue_virt_s1 | 18 ++++++++++++++++-- openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c | 2 +- openair2/UTIL/OPT/probe.c | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/cmake_targets/tools/run_enb_ue_virt_s1 b/cmake_targets/tools/run_enb_ue_virt_s1 index 9cc226a698..8f7255332a 100755 --- a/cmake_targets/tools/run_enb_ue_virt_s1 +++ b/cmake_targets/tools/run_enb_ue_virt_s1 @@ -81,8 +81,10 @@ function help() echo_error " " echo_error "Options:" echo_error "Mandatory arguments to long options are mandatory for short options too." + echo_error " -a, --abstraction enable phy abstraction mode" echo_error " -c, -C, --config-file eNB_config_file eNB config file, (see $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF)" echo_error " Default eNB config file if not set is $1" + echo_error " -l, --log-level set the global log level (8:trace, 7:debug, 6:info, 4:warn, 3:error). Note that the log configuration is eNB config file is ignored for oaisim." echo_error " -g, --gdb Run with GDB." echo_error " -h, --help Print this help." echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)" @@ -114,8 +116,14 @@ function main() until [ -z "$1" ] do case "$1" in + -a | --abstraction ) + abstraction_flag=1 + echo "enabling abstraction mode" + exe_arguments="$exe_arguments -a" + shift; + ;; -c | -C | --config-file) - CONFIG_FILE_ENB=$2 + CONFIG_FILE_ENB=$2 # may be relative path if [ -f $(dirname $(readlink -f $0))/$CONFIG_FILE ]; then CONFIG_FILE_ENB=$(dirname $(readlink -f $0))/$CONFIG_FILE @@ -131,6 +139,11 @@ function main() fi shift 2; ;; + -l | --log-level) + echo "setting the log level to $2" + exe_arguments="$exe_arguments -l $2" + shift 2; + ;; -g | --gdb) run_gdb=1 echo "setting GDB flag to: $GDB" @@ -241,7 +254,8 @@ function main() if [ $? -ne 0 ]; then bash -c echo "200 lte " >> /etc/iproute2/rt_tables fi - ip rule add fwmark 1 table lte + ip rule add fwmark 1 table lte + ifconfig oip1 up ip route add default dev oip1 table lte exe_arguments="$exe_arguments -s15 -AAWGN -y1 -b1 -u1 -Q0" diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c index 8ac79a61b9..ea304f93ae 100755 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c @@ -484,7 +484,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ctxt.enb_flag = ENB_FLAG_NO; ctxt.module_id = pdcp_read_header_g.inst - oai_emulation.info.nb_enb_local + oai_emulation.info.first_ue_local; ctxt.rnti = pdcp_UE_UE_module_id_to_rnti[ctxt.module_id]; - rab_id = pdcp_read_header_g.rb_id; + rab_id = pdcp_read_header_g.rb_id % maxDRB; } CHECK_CTXT_ARGS(&ctxt); diff --git a/openair2/UTIL/OPT/probe.c b/openair2/UTIL/OPT/probe.c index effd0bee85..28bad4d6c9 100644 --- a/openair2/UTIL/OPT/probe.c +++ b/openair2/UTIL/OPT/probe.c @@ -515,7 +515,7 @@ int init_opt(char *path, char *ip, char *port, radio_type_t radio_type_p) strncpy( in_path, path, sizeof(in_path) ); in_path[sizeof(in_path) - 1] = 0; // terminate string } else { - strcpy( in_path, "/tmp/oai_opt.pcap" ); + strcpy( in_path, "/tmp/opt.pcap" ); } if (ip != NULL) { From 2f529ce8d18a31a70295049ca8328538b1559757 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 27 Apr 2016 11:23:58 +0200 Subject: [PATCH 166/214] hotfix for gnutls/nettle installation from source to avoid conflicts with openair-CN installation --- cmake_targets/tools/build_helper | 54 ++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 294c5006a5..a40bd8c996 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -132,10 +132,21 @@ compilations() { ############################################ install_nettle_from_source() { + nettle_install_log=$OPENAIR_DIR/cmake_targets/log/nettle_install_log.txt + echo_info "\nInstalling Nettle. The log file for nettle installation is here: $nettle_install_log " + ( cd /tmp echo "Downloading nettle archive" - rm -rf /tmp/nettle-2.5.tar.gz* /tmp/nettle-2.5 - wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz + $SUDO rm -rf /tmp/nettle-2.5.tar.gz* /tmp/nettle-2.5 + wget https://ftp.gnu.org/gnu/nettle/nettle-2.5.tar.gz + if [ $? -ne 0 ]; then + wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz + fi + if [ ! -f nettle-2.5.tar.gz ]; then + echo_error "Could not download nettle source files" + cd - + return + fi tar -xzf nettle-2.5.tar.gz cd nettle-2.5/ ./configure --disable-openssl --enable-shared --prefix=/usr @@ -143,21 +154,32 @@ install_nettle_from_source() { make -j`nproc` make check $SUDO make install - rm -rf /tmp/nettle-2.5.tar.gz /tmp/nettle-2.5 + ) >& $nettle_install_log } install_gnutls_from_source(){ + gnutls_install_log=$OPENAIR_DIR/cmake_targets/log/gnutls_install_log.txt + echo_info "\nInstalling Gnutls. The log file for Gnutls installation is here: $gnutls_install_log " + ( cd /tmp echo "Downloading gnutls archive" - rm -rf /tmp/gnutls-3.1.23.tar.xz* /tmp/gnutls-3.1.23 - wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz - tar -xzf gnutls-3.1.23.tar.xz + $SUDO rm -rf /tmp/gnutls-3.1.23.tar.xz* /tmp/gnutls-3.1.23 + wget http://mirrors.dotsrc.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz + if [ $? -ne 0 ]; then + wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz + fi + if [ ! -f gnutls-3.1.23.tar.xz ]; then + echo_error "Could not download gnutls source files" + cd - + return + fi + tar -xJf gnutls-3.1.23.tar.xz cd gnutls-3.1.23/ ./configure --prefix=/usr echo "Compiling gnutls" make -j`nproc` $SUDO make install - rm -rf /tmp/gnutls-3.1.23.tar.xz /tmp/gnutls-3.1.23 + )>& $gnutls_install_log } @@ -274,12 +296,12 @@ check_install_oai_software() { android-tools-adb $SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so - if [ `lsb_release -rs` = '12.04' ] ; then - install_nettle_from_source - install_gnutls_from_source - else - $SUDO apt-get install -y libgnutls-dev nettle-dev nettle-bin - fi + + # First we remove gnutls/nettle installation and then install from sources + $SUDO apt-get remove -y libgnutls-dev nettle-dev nettle-bin + install_nettle_from_source + install_gnutls_from_source + $SUDO pip install paramiko $SUDO pip install pyroute2 install_asn1c_from_source @@ -288,8 +310,8 @@ check_install_oai_software() { } install_asn1c_from_source(){ - asn1_install_dir=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt - echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_dir " + asn1_install_log=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt + echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log " ( $SUDO rm -rf /tmp/asn1c-r1516 mkdir -p /tmp/asn1c-r1516 @@ -303,7 +325,7 @@ install_asn1c_from_source(){ ./configure make -j`nproc` $SUDO make install - ) > $asn1_install_dir 2>&1 + ) > $asn1_install_log 2>&1 } ################################################# From 878e9d21a34c4dc4c44c57f5cb6dbc6470ca71e4 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 27 Apr 2016 17:27:35 +0200 Subject: [PATCH 167/214] minor fix for Huawei E398 modem script + stoppping UEs in test setup --- cmake_targets/autotests/test_case_list.xml | 2 +- .../tools/configure_cots_huaweiE398_ue.py | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 1403885a70..4aaf84e2b9 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -8,7 +8,7 @@ develop oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* hss hss_sim configure_cots* wvdial* iperf iperf_script ping tshark rrh_gw sudo -S -E /opt/ltebox/tools/stop_ltebox -$OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; uname -a; dmesg|tail +$OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py --stop-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue; uname -a; sudo -E dmesg|tail 36000 0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 016102 016105 016502 016505 0170+ 017502 017505 018002 018005 018502 018505 025502 025505 3 diff --git a/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py b/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py index 9646cc69ff..b173d6157c 100755 --- a/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py @@ -180,11 +180,16 @@ def start_ue () : thread_ppp.join() def stop_ue(): - timeout=60 - os.system('killall wvdial') - send_command('AT', 'OK' , timeout) - send_command('AT+CGATT=0' , 'OK|ERROR' , timeout) - #send_command('AT+CFUN=4' , 'OK' , timeout) + stringIdBandrich='Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard' + status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'') + if (out == '') : + print "Huawei E398 Adapter not found. Exiting now..." + sys.exit() + timeout=60 + os.system('killall wvdial') + send_command('AT', 'OK' , timeout) + send_command('AT+CGATT=0' , 'OK|ERROR' , timeout) + #send_command('AT+CFUN=4' , 'OK' , timeout) #reset the USB BUS of Bandrich UE @@ -192,7 +197,7 @@ def reset_ue(): stringIdBandrich='Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard' status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'') if (out == '') : - print "Bandrich 4G LTE Adapter not found. Exiting now..." + print "Huawei E398 Adapter not found. Exiting now..." sys.exit() p=re.compile('Bus\s*(\w+)\s*Device\s*(\w+):\s*ID\s*(\w+):(\w+)') res=p.findall(out) From a16127e85c02e5f4ecb144922f18e8c9e3c6ed32 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Thu, 28 Apr 2016 14:48:55 +0200 Subject: [PATCH 168/214] log test cases being executed in Gitlab CI --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8947453454..d4377fc324 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,7 @@ job1: - echo $NFS_SHARE_DIR - echo $EXTERNAL_SHARE_DIR - echo $SHELL + - echo $OAI_TEST_CASE_GROUP - git rev-parse --abbrev-ref HEAD - git_repo=`git config --get remote.origin.url` - git_head=`git rev-parse HEAD` From e47ee57d24c842f87214d4c208ddb251cab9fc51 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 29 Apr 2016 15:32:10 +0200 Subject: [PATCH 169/214] addding LMSSDR into the testbench --- cmake_targets/autotests/test_case_list.xml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 4aaf84e2b9..80a54947b8 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -10,7 +10,7 @@ sudo -S -E /opt/ltebox/tools/stop_ltebox $OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py --stop-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue; uname -a; sudo -E dmesg|tail 36000 - 0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 016102 016105 016502 016505 0170+ 017502 017505 018002 018005 018502 018505 025502 025505 + 0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 016102 016105 016502 016505 017002 017005 017502 017505 018002 018005 018502 018505 025502 025505 3 mozart calisson stevens nano amerique @@ -5090,7 +5090,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_5MHz_rx19dB_txfull.ini -W @@ -5130,7 +5130,7 @@ throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec False - SoDeRa.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX + LMSSDR.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX 10 @@ -5166,7 +5166,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_10MHz_rx19dB_txfull.ini -W @@ -5206,7 +5206,7 @@ throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec False - SoDeRa.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX + LMSSDR.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX 10 @@ -5241,7 +5241,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_20MHz_rx19dB_txfull.ini @@ -5281,7 +5281,7 @@ throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec False - SoDeRa.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX + LMSSDR.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX 10 @@ -5316,7 +5316,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_5MHz_rx19dB_txfull.ini @@ -5355,7 +5355,7 @@ False - BladeRF.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX + LMSSDR.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX 10 @@ -5390,7 +5390,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_10MHz_rx19dB_txfull.ini @@ -5464,7 +5464,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_20MHz_rx19dB_txfull.ini From 84fdd116c6092000f82dd196c2982f79454d959b Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 29 Apr 2016 18:18:38 +0200 Subject: [PATCH 170/214] BladeRF comments + warnings removal --- .../ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c | 69 +++++++++++-------- .../ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h | 21 ++++++ 2 files changed, 61 insertions(+), 29 deletions(-) diff --git a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c index d9b7bfa905..fe53830279 100644 --- a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c +++ b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c @@ -37,6 +37,7 @@ #include #include #include "bladerf_lib.h" +#include "math.h" /** @addtogroup _BLADERF_PHY_RF_INTERFACE_ * @{ @@ -58,14 +59,16 @@ int num_devices=0; /*! \brief BladeRF Init function (not used at the moment) * \param device RF frontend parameters set by application + * \returns 0 on success */ int trx_brf_init(openair0_device *device) { - + return 0; } /*! \brief get current timestamp *\param device the hardware to use *\param module the bladeRf module + *\returns timestamp of BladeRF */ openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module module) { @@ -83,28 +86,22 @@ openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module mod } /*! \brief Start BladeRF - *\param device the hardware to use + * \param device the hardware to use + * \returns 0 on success */ int trx_brf_start(openair0_device *device) { return 0; } -/*! \brief Get BladeRF stats - *\param device the hardware to use - */ -static void trx_brf_stats(openair0_device *device){ - - -} - /*! \brief Called to send samples to the BladeRF RF target - @param device pointer to the device structure specific to the RF hardware target - @param timestamp The timestamp at whicch the first sample MUST be sent - @param buff Buffer which holds the samples - @param nsamps number of samples to be sent - @param cc index of the component carrier - @param flags Ignored for the moment + \param device pointer to the device structure specific to the RF hardware target + \param timestamp The timestamp at whicch the first sample MUST be sent + \param buff Buffer which holds the samples + \param nsamps number of samples to be sent + \param cc index of the component carrier + \param flags Ignored for the moment + \returns 0 on success */ static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp, void **buff, int nsamps, int cc, int flags) { @@ -156,6 +153,7 @@ static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp, * \param[out] buff An array of pointers to buffers for received samples. The buffers must be large enough to hold the number of samples \ref nsamps. * \param nsamps Number of samples. One sample is 2 byte I + 2 byte Q => 4 byte. * \param cc Index of component carrier + * \returns number of samples read */ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) { @@ -176,9 +174,10 @@ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, brf->num_rx_errors++; } else if ( brf->meta_rx.status & BLADERF_META_STATUS_OVERRUN) { brf->num_overflows++; - printf("RX overrun (%d) is detected. t=%u. Got %u samples. nsymps %d\n", + printf("RX overrun (%d) is detected. t=" "%" PRIu64 "Got %u samples. nsymps %d\n", brf->num_overflows,brf->meta_rx.timestamp, brf->meta_rx.actual_count, nsamps); } + //printf("Current RX timestampe %u\n", brf->meta_rx.timestamp); //printf("[BRF] (buff %p) ts=0x%"PRIu64" %s\n",samples, brf->meta_rx.timestamp,bladerf_strerror(status)); brf->rx_current_ts=brf->meta_rx.timestamp; @@ -195,8 +194,9 @@ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, /*! \brief Terminate operation of the BladeRF transceiver -- free all associated resources * \param device the hardware to use + * \returns 0 in success */ -int trx_brf_end(openair0_device *device) { +void trx_brf_end(openair0_device *device) { int status; brf_state_t *brf = (brf_state_t*)device->priv; @@ -208,7 +208,6 @@ int trx_brf_end(openair0_device *device) { fprintf(stderr, "Failed to disable TX module: %s\n", bladerf_strerror(status)); } bladerf_close(brf->dev); - return 0; } /*! \brief print the BladeRF statistics @@ -231,10 +230,11 @@ int trx_brf_reset_stats(openair0_device* device) { } -/*! \brief Stop USRP - * \param device the hardware to use +/*! \brief Stop BladeRF + * \param card the hardware to use + * \returns 0 in success */ -int trx_brf_stop(openair0_device* device) { +int trx_brf_stop(int card) { return(0); @@ -242,9 +242,11 @@ int trx_brf_stop(openair0_device* device) { /*! \brief Set frequencies (TX/RX) * \param device the hardware to use + * \param openair0_cfg1 openair0 Config structure (ignored. It is there to comply with RF common API) + * \param exmimo_dump_config (ignored) * \returns 0 in success */ -int trx_brf_set_freq(openair0_device* device) { +int trx_brf_set_freq(openair0_device* device, openair0_config_t *openair0_cfg1,int exmimo_dump_config) { int status; brf_state_t *brf = (brf_state_t *)device->priv; @@ -269,9 +271,10 @@ int trx_brf_set_freq(openair0_device* device) { /*! \brief Set Gains (TX/RX) * \param device the hardware to use + * \param openair0_cfg openair0 Config structure * \returns 0 in success */ -int trx_brf_set_gains(openair0_device* device) { +int trx_brf_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) { return(0); @@ -283,12 +286,17 @@ int trx_brf_set_gains(openair0_device* device) { int16_t cos_fsover8[8] = {2047, 1447, 0, -1448, -2047, -1448, 0, 1447}; int16_t cos_3fsover8[8] = {2047, -1448, 0, 1447, -2047, 1447, 0, -1448}; +/*! \brief calibration table for LMSSDR */ rx_gain_calib_table_t calib_table_fx4[] = { {2300000000.0,53.5}, {1880000000.0,57.0}, {816000000.0,73.0}, {-1,0}}; +/*! \brief set RX gain offset from calibration table + * \param openair0_cfg RF frontend parameters set by application + * \param chain_index RF chain ID + */ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) { int i=0; @@ -310,6 +318,9 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) { } +/*! \brief Calibrate LMSSDR RF + * \param device the hardware to use + */ void calibrate_rf(openair0_device *device) { @@ -885,11 +896,10 @@ void calibrate_rf(openair0_device *device) { /*! \brief Initialize Openair BLADERF target. It returns 0 if OK * \param device the hardware to use * \param openair0_cfg RF frontend parameters set by application + * \returns 0 on success */ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { int status; - int card=0; - brf_state_t *brf = (brf_state_t*)malloc(sizeof(brf_state_t)); memset(brf, 0, sizeof(brf_state_t)); /* device specific */ @@ -1063,8 +1073,6 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { }else printf("[BRF] RX module calibrated DC \n"); - - bladerf_log_set_verbosity(get_brf_log_level(openair0_cfg->log_level)); printf("BLADERF: Initializing openair0_device\n"); @@ -1091,16 +1099,18 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { /*! \brief bladeRF error report * \param status + * \returns 0 on success */ int brf_error(int status) { //exit(-1); - //return 1; // or status error code + return status; // or status error code } /*! \brief Open BladeRF from serial port * \param serial name of serial port on which to open BladeRF device + * \returns bladerf device structure */ struct bladerf * open_bladerf_from_serial(const char *serial) { @@ -1131,6 +1141,7 @@ struct bladerf * open_bladerf_from_serial(const char *serial) { /*! \brief Get BladeRF log level * \param log_level log level + * \returns log level of BLADERF device */ int get_brf_log_level(int log_level){ diff --git a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h index 3a05c80e5c..743baf1bc8 100644 --- a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h +++ b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h @@ -106,6 +106,27 @@ typedef struct { /* * func prototypes */ +/*! \brief BladeRF Init function (not used at the moment) + * \param device RF frontend parameters set by application + */ +int trx_brf_init(openair0_device *device); +/*! \brief get current timestamp + *\param device the hardware to use + *\param module the bladeRf module + */ +openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module module); + +/*! \brief Get BladeRF log level + * \param log_level log level + * \returns log level of BLADERF device + */ +int get_brf_log_level(int log_level); + +/*! \brief bladeRF error report + * \param status + * \returns 0 on success + */ int brf_error(int status); + /*@}*/ From 0d88c9c42cc452575077be47152583c9689e99cc Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 29 Apr 2016 18:32:32 +0200 Subject: [PATCH 171/214] minor typo in BladeRF comments --- targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c index fe53830279..6cc1d8c5d2 100644 --- a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c +++ b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c @@ -194,7 +194,6 @@ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, /*! \brief Terminate operation of the BladeRF transceiver -- free all associated resources * \param device the hardware to use - * \returns 0 in success */ void trx_brf_end(openair0_device *device) { @@ -286,7 +285,7 @@ int trx_brf_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) int16_t cos_fsover8[8] = {2047, 1447, 0, -1448, -2047, -1448, 0, 1447}; int16_t cos_3fsover8[8] = {2047, -1448, 0, 1447, -2047, 1447, 0, -1448}; -/*! \brief calibration table for LMSSDR */ +/*! \brief calibration table for BladeRF */ rx_gain_calib_table_t calib_table_fx4[] = { {2300000000.0,53.5}, {1880000000.0,57.0}, From 1b3aec522c6e133261b647fce36ecf0d2ce42694 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 29 Apr 2016 18:34:09 +0200 Subject: [PATCH 172/214] LMSSDR doxygen comments integration --- targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp | 534 ++---------------- 1 file changed, 56 insertions(+), 478 deletions(-) diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp index 3ca15c6660..11c30c7458 100644 --- a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp @@ -69,6 +69,15 @@ extern "C" int write_output(const char *fname,const char *vname,void *data,int length,int dec,char format); } +/*! \brief Called to send samples to the LMSSDR RF target + \param device pointer to the device structure specific to the RF hardware target + \param timestamp The timestamp at whicch the first sample MUST be sent + \param buff Buffer which holds the samples + \param nsamps number of samples to be sent + \param antenna_id index of the antenna + \param flags Ignored for the moment + \returns 0 on success +*/ int trx_lms_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int antenna_id, int flags) { LMS_TRxWrite((int16_t*)buff[0], nsamps,0, timestamp); @@ -76,7 +85,17 @@ int trx_lms_write(openair0_device *device, openair0_timestamp timestamp, void ** return nsamps; } - +/*! \brief Receive samples from hardware. + * Read \ref nsamps samples from each channel to buffers. buff[0] is the array for + * the first channel. *ptimestamp is the time at which the first sample + * was received. + * \param device the hardware to use + * \param[out] ptimestamp the time at which the first sample was received. + * \param[out] buff An array of pointers to buffers for received samples. The buffers must be large enough to hold the number of samples \ref nsamps. + * \param nsamps Number of samples. One sample is 2 byte I + 2 byte Q => 4 byte. + * \param antenna_id Index of antenna port + * \returns number of samples read +*/ int trx_lms_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int antenna_id) { uint64_t timestamp; @@ -87,6 +106,11 @@ int trx_lms_read(openair0_device *device, openair0_timestamp *ptimestamp, void * return ret; } + +/*! \brief set RX gain offset from calibration table + * \param openair0_cfg RF frontend parameters set by application + * \param chain_index RF chain ID + */ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) { int i=0; @@ -107,469 +131,12 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) { } } -/* -void calibrate_rf(openair0_device *device) { - openair0_timestamp ptimestamp; - int16_t *calib_buffp,*calib_tx_buffp; - int16_t calib_buff[2*RXDCLENGTH]; - int16_t calib_tx_buff[2*RXDCLENGTH]; - int i,j; - int8_t offI,offQ,offIold,offQold,offInew,offQnew,offphase,offphaseold,offphasenew,offgain,offgainold,offgainnew; - int32_t meanI,meanQ,meanIold,meanQold; - int cnt=0,loop; - liblms7_status opStatus; - int16_t dcoffi; - int16_t dcoffq; - int16_t dccorri; - int16_t dccorrq; - const int16_t firCoefs[] = - { - -2531, - -517, - 2708, - 188, - -3059, - 216, - 3569, - -770, - -4199, - 1541, - 4886, - -2577, - -5552, - 3909, - 6108, - -5537, - -6457, - 7440, - 6507, - -9566, - -6174, - 11845, - 5391, - -14179, - -4110, - 16457, - 2310, - -18561, - 0, - 20369, - -2780, - -21752, - 5963, - 22610, - -9456, - -22859, - 13127, - 22444, - -16854, - -21319, - 20489, - 19492, - -23883, - -17002, - 26881, - 13902, - -29372, - -10313, - 31226, - 6345, - -32380, - -2141, - 32767, - -2141, - -32380, - 6345, - 31226, - -10313, - -29372, - 13902, - 26881, - -17002, - -23883, - 19492, - 20489, - -21319, - -16854, - 22444, - 13127, - -22859, - -9456, - 22610, - 5963, - -21752, - -2780, - 20369, - 0, - -18561, - 2310, - 16457, - -4110, - -14179, - 5391, - 11845, - -6174, - -9566, - 6507, - 7440, - -6457, - -5537, - 6108, - 3909, - -5552, - -2577, - 4886, - 1541, - -4199, - -770, - 3569, - 216, - -3059, - 188, - 2708, - -517, - -2531 - }; - - j=0; - for (i=0;iBackupAllRegisters(); - uint8_t ch = (uint8_t)lms7->Get_SPI_Reg_bits(LMS7param(MAC)); - //Stage 1 - uint8_t sel_band1_trf = (uint8_t)lms7->Get_SPI_Reg_bits(LMS7param(SEL_BAND1_TRF)); - uint8_t sel_band2_trf = (uint8_t)lms7->Get_SPI_Reg_bits(LMS7param(SEL_BAND2_TRF)); - { - uint16_t requiredRegs[] = { 0x0400, 0x040A, 0x010D, 0x040C }; - uint16_t requiredMask[] = { 0x6000, 0x3007, 0x0040, 0x00FF }; //CAPSEL, AGC_MODE, AGC_AVG, EN_DCOFF, Bypasses - uint16_t requiredValue[] = { 0x0000, 0x1007, 0x0040, 0x00BD }; - - lms7->Modify_SPI_Reg_mask(requiredRegs, requiredMask, requiredValue, 0, 3); - } - - // opStatus = lms7->SetFrequencySX(LMS7002M::Rx, device->openair0_cfg[0].tx_freq[0]/1e6,30.72); - // put TX on fs/4 - opStatus = lms7->CalibrateRxSetup(device->openair0_cfg[0].sample_rate/1e6); - if (opStatus != LIBLMS7_SUCCESS) { - printf("Cannot calibrate for %f MHz\n",device->openair0_cfg[0].sample_rate/1e6); - exit(-1); - } - // fill TX buffer with fs/8 complex sinusoid - offIold=offQold=64; - lms7->SetRxDCOFF(offIold,offQold); - LMS_RxStart(); - for (i=0;i (%d,%d)\n",offIold,offQold,meanIold,meanQold); - - offI=offQ=-64; - lms7->SetRxDCOFF(offI,offQ); - - for (i=0;i (%d,%d)\n",offI,offQ,meanI,meanQ); - - while (cnt++ < 7) { - - offInew=(offIold+offI)>>1; - offQnew=(offQold+offQ)>>1; - - if (meanI*meanI < meanIold*meanIold) { - meanIold = meanI; - offIold = offI; - printf("[LMS] *** RX DC: offI %d => %d\n",offIold,meanI); - } - if (meanQ*meanQ < meanQold*meanQold) { - meanQold = meanQ; - offQold = offQ; - printf("[LMS] *** RX DC: offQ %d => %d\n",offQold,meanQ); - } - offI = offInew; - offQ = offQnew; - - lms7->SetRxDCOFF(offI,offQ); - - for (i=0;i (%d,%d)\n",offI,offQ,meanI,meanQ); - } - - if (meanI*meanI < meanIold*meanIold) { - meanIold = meanI; - offIold = offI; - printf("[LMS] *** RX DC: offI %d => %d\n",offIold,meanI); - } - if (meanQ*meanQ < meanQold*meanQold) { - meanQold = meanQ; - offQold = offQ; - printf("[LMS] *** RX DC: offQ %d => %d\n",offQold,meanQ); - } - - printf("[LMS] RX DC: (%d,%d) => (%d,%d)\n",offIold,offQold,meanIold,meanQold); - - lms7->SetRxDCOFF(offIold,offQold); - - dcoffi = offIold; - dcoffq = offQold; - - lms7->Modify_SPI_Reg_bits(LMS7param(MAC), ch); - lms7->Modify_SPI_Reg_bits(LMS7param(AGC_MODE_RXTSP), 1); - lms7->Modify_SPI_Reg_bits(LMS7param(CAPSEL), 0); - - // TX LO leakage - offQold=offIold=127; - lms7->SPI_write(0x0204,(((int16_t)offIold)<<7)|offQold); - - { - uint16_t requiredRegs[] = { 0x0400, 0x040A, 0x010D, 0x040C }; - uint16_t requiredMask[] = { 0x6000, 0x3007, 0x0040, 0x00FF }; //CAPSEL, AGC_MODE, AGC_AVG, EN_DCOFF, Bypasses - uint16_t requiredValue[] = { 0x0000, 0x1007, 0x0040, 0x00BD }; - - lms7->Modify_SPI_Reg_mask(requiredRegs, requiredMask, requiredValue, 0, 3); - } - sel_band1_trf = (uint8_t)lms7->Get_SPI_Reg_bits(LMS7param(SEL_BAND1_TRF)); - sel_band2_trf = (uint8_t)lms7->Get_SPI_Reg_bits(LMS7param(SEL_BAND2_TRF)); - //B - lms7->Modify_SPI_Reg_bits(0x0100, 0, 0, 1); //EN_G_TRF 1 - if (sel_band1_trf == 1) - { - lms7->Modify_SPI_Reg_bits(LMS7param(PD_RLOOPB_1_RFE), 0); //PD_RLOOPB_1_RFE 0 - lms7->Modify_SPI_Reg_bits(LMS7param(EN_INSHSW_LB1_RFE), 0); //EN_INSHSW_LB1 0 - } - if (sel_band2_trf == 1) - { - lms7->Modify_SPI_Reg_bits(LMS7param(PD_RLOOPB_2_RFE), 0); //PD_RLOOPB_2_RFE 0 - lms7->Modify_SPI_Reg_bits(LMS7param(EN_INSHSW_LB2_RFE), 0); // EN_INSHSW_LB2 0 - } - // FixRXSaturation(); - - lms7->Modify_SPI_Reg_bits(LMS7param(GFIR3_BYP_RXTSP), 0); //GFIR3_BYP 0 - lms7->Modify_SPI_Reg_bits(LMS7param(HBD_OVR_RXTSP), 2); - lms7->Modify_SPI_Reg_bits(LMS7param(GFIR3_L_RXTSP), 7); - lms7->Modify_SPI_Reg_bits(LMS7param(GFIR3_N_RXTSP), 7); - - lms7->SetGFIRCoefficients(LMS7002M::Rx, 2, firCoefs, sizeof(firCoefs) / sizeof(int16_t)); - - for (i=0;i (%d,%d)\n",offIold,meanIold,meanQold); - - offI=-128; - lms7->SPI_write(0x0204,(((int16_t)offI)<<7)|offQold); - - for (i=0;i (%d,%d)\n",offI,meanI,meanQ); - cnt = 0; - while (cnt++ < 8) { - - offInew=(offIold+offI)>>1; - if (meanI*meanI+meanQ*meanQ < meanIold*meanIold +meanQold*meanQold) { - printf("[LMS] TX DC (offI): ([%d,%d]) => %d : %d\n",offIold,offI,offInew,meanI*meanI+meanQ*meanQ); - meanIold = meanI; - meanQold = meanQ; - offIold = offI; - } - offI = offInew; - lms7->SPI_write(0x0204,(((int16_t)offI)<<7)|offQold); - - for (i=0;i (%d,%d)\n",offI,meanI,meanQ); - } - - - if (meanI*meanI+meanQ*meanQ < meanIold*meanIold +meanQold*meanQold) { - printf("[LMS] TX DC (offI): ([%d,%d]) => %d : %d\n",offIold,offI,offInew,meanI*meanI+meanQ*meanQ); - meanIold = meanI; - meanQold = meanQ; - offIold = offI; - } - offQ=-128; - lms7->SPI_write(0x0204,(((int16_t)offIold)<<7)|offQ); - - for (i=0;i (%d,%d)\n",offQ,meanI,meanQ); - - cnt=0; - while (cnt++ < 8) { - - offQnew=(offQold+offQ)>>1; - if (meanI*meanI+meanQ*meanQ < meanIold*meanIold +meanQold*meanQold) { - printf("[LMS] TX DC (offQ): ([%d,%d]) => %d : %d\n",offQold,offQ,offQnew,meanI*meanI+meanQ*meanQ); - - meanIold = meanI; - meanQold = meanQ; - offQold = offQ; - } - offQ = offQnew; - lms7->SPI_write(0x0204,(((int16_t)offIold)<<7)|offQ); - - - for (i=0;i (%d,%d)\n",offQ,meanI,meanQ); - } - - LMS_RxStop(); - - printf("[LMS] TX DC: (%d,%d) => (%d,%d)\n",offIold,offQold,meanIold,meanQold); - - dccorri = offIold; - dccorrq = offQold; - - - lms7->RestoreAllRegisters(); - lms7->Modify_SPI_Reg_bits(LMS7param(MAC), ch); - - lms7->Modify_SPI_Reg_bits(LMS7param(DCOFFI_RFE), dcoffi); - lms7->Modify_SPI_Reg_bits(LMS7param(DCOFFQ_RFE), dcoffq); - lms7->Modify_SPI_Reg_bits(LMS7param(DCCORRI_TXTSP), dccorri); - lms7->Modify_SPI_Reg_bits(LMS7param(DCCORRQ_TXTSP), dccorrq); - // lms7->Modify_SPI_Reg_bits(LMS7param(GCORRI_TXTSP), gcorri); - // lms7->Modify_SPI_Reg_bits(LMS7param(GCORRQ_TXTSP), gcorrq); - // lms7->Modify_SPI_Reg_bits(LMS7param(IQCORR_TXTSP), iqcorr); - - // lms7->Modify_SPI_Reg_bits(LMS7param(DC_BYP_TXTSP), 0); //DC_BYP - lms7->Modify_SPI_Reg_bits(0x0208, 1, 0, 0); //GC_BYP PH_BYP - -} -*/ +/*! \brief Set Gains (TX/RX) on LMSSDR + * \param device the hardware to use + * \param openair0_cfg openair0 Config structure + * \returns 0 in success + */ int trx_lms_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) { @@ -589,6 +156,10 @@ int trx_lms_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) return(0); } +/*! \brief Start LMSSDR + * \param device the hardware to use + * \returns 0 on success + */ int trx_lms_start(openair0_device *device){ @@ -746,7 +317,10 @@ int trx_lms_start(openair0_device *device){ return 0; } - +/*! \brief Stop LMSSDR + * \param card Index of the RF card to use + * \returns 0 on success + */ int trx_lms_stop(int card) { /* LMS_DeviceClose(usbport); @@ -756,6 +330,12 @@ int trx_lms_stop(int card) { */ } +/*! \brief Set frequencies (TX/RX) + * \param device the hardware to use + * \param openair0_cfg openair0 Config structure (ignored. It is there to comply with RF common API) + * \param exmimo_dump_config (ignored) + * \returns 0 in success + */ int trx_lms_set_freq(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config) { //Control port must be connected @@ -768,6 +348,7 @@ int trx_lms_set_freq(openair0_device* device, openair0_config_t *openair0_cfg,in } // 31 = 19 dB => 105 dB total gain @ 2.6 GHz +/*! \brief calibration table for LMSSDR */ rx_gain_calib_table_t calib_table_sodera[] = { {3500000000.0,70.0}, {2660000000.0,80.0}, @@ -780,33 +361,30 @@ rx_gain_calib_table_t calib_table_sodera[] = { - - +/*! \brief Get LMSSDR Statistics + * \param device the hardware to use + * \returns 0 in success + */ int trx_lms_get_stats(openair0_device* device) { return(0); } +/*! \brief Reset LMSSDR Statistics + * \param device the hardware to use + * \returns 0 in success + */ int trx_lms_reset_stats(openair0_device* device) { return(0); } -int openair0_set_gains(openair0_device* device, - openair0_config_t *openair0_cfg) { - - return(0); -} - -int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg, int dummy) { - - return(0); -} - - +/*! \brief Terminate operation of the LMSSDR transceiver -- free all associated resources + * \param device the hardware to use + */ void trx_lms_end(openair0_device *device) { From b6d92ff8d552c732be5f8cb0aee457df92622d68 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 2 May 2016 11:16:18 +0200 Subject: [PATCH 173/214] Doxygen support for LMSSDR RF --- openair1/PHY/impl_defs_top.h | 1 + targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp | 4 ++++ targets/DOCS/Doxyfile | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/impl_defs_top.h b/openair1/PHY/impl_defs_top.h index 18b16b8670..b58ce6f9b0 100755 --- a/openair1/PHY/impl_defs_top.h +++ b/openair1/PHY/impl_defs_top.h @@ -50,6 +50,7 @@ * @defgroup _GENERIC_PHY_RF_INTERFACE_ Generic PHY - RF Interface * @defgroup _USRP_PHY_RF_INTERFACE_ PHY - USRP RF Interface * @defgroup _BLADERF_PHY_RF_INTERFACE_ PHY - BLADERF RF Interface + * @defgroup _LMSSDR_PHY_RF_INTERFACE_ PHY - LMSSDR RF Interface * @} * * @ingroup _ref_implementation_ diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp index 11c30c7458..4be796e588 100644 --- a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp @@ -49,6 +49,9 @@ #include +/** @addtogroup _LMSSDR_PHY_RF_INTERFACE_ + * @{ + */ ///define for parameter enumeration if prefix might be needed #define LMS7param(id) id @@ -455,3 +458,4 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg){ return 0; } } +/*@}*/ diff --git a/targets/DOCS/Doxyfile b/targets/DOCS/Doxyfile index ac6ee99480..a060f6597a 100644 --- a/targets/DOCS/Doxyfile +++ b/targets/DOCS/Doxyfile @@ -796,7 +796,8 @@ INPUT = $(OPENAIR1_DIR)/PHY/defs.h \ $(OPENAIR_TARGETS)/ARCH/COMMON/common_lib.h \ $(OPENAIR_TARGETS)/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp \ $(OPENAIR_TARGETS)/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c \ - $(OPENAIR_TARGETS)/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h + $(OPENAIR_TARGETS)/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h \ + $(OPENAIR_TARGETS)/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses From 8ada7ce50108f943a90b8b4ffbc365ef95843622 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 2 May 2016 12:24:56 +0200 Subject: [PATCH 174/214] update for Gitlab CI to detect failed machines --- .../autotests/run_exec_lte-softmodem_tests.py | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py index f1c165acbf..4893d199b5 100755 --- a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py +++ b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py @@ -321,13 +321,19 @@ def cleanOldPrograms(oai, programList, CleanUpAluLteBox, ExmimoRfStop): print "Killing old programs..." + result programArray = programList.split() programListJoin = '|'.join(programArray) + cmd = " ( date ;echo \"Starting cleaning old programs.. \" ; dmesg|tail )>& $HOME/.oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync" + result=oai.send_recv(cmd) cmd = cleanupOldProgramsScript + ' ' + '\''+programListJoin+'\'' #result = oai.send_recv(cmd) #print result result = oai.send_expect_false(cmd, 'Match found', False) print "Looking for old programs..." + result res=oai.send_recv(CleanUpAluLteBox, True) - res = oai.send_recv(ExmimoRfStop, False) + cmd = "( " + ExmimoRfStop + " ) >> $HOME/.oai_test_setup_cleanup.log.`hostname` ; sync " + res=oai.send_recv(cmd, False) + #res = oai.send_recv(ExmimoRfStop, False) + cmd = " ( date ;echo \"Finished cleaning old programs.. \" ; dmesg | tail)>> $HOME/.oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync" + res=oai.send_recv(cmd) # \brief Class thread to launch a generic command on remote machine # \param threadID number of thread (for book keeping) @@ -1514,6 +1520,22 @@ for testcase in testcaseList: threadListGlobal = wait_testcaseclass_generic_threads(threadListGlobal, Timeout_execution) #cleanOldProgramsAllMachines(oai_list, CleanUpOldProgs, CleanUpAluLteBox, ExmimoRfStop) handle_testcaseclass_softmodem (testcase, CleanUpOldProgs, logdirOAI5GRepo, logdirOpenaircnRepo, MachineList, user, pw, CleanUpAluLteBox, ExmimoRfStop, nruns_lte_softmodem, Timeout_cmd ) + + #The lines below are copied from below to trace the failure of some of the machines in test setup. These lines below need to be removed in long term + print "Creating xml file for overall results..." + cmd = "cat $OPENAIR_DIR/cmake_targets/autotests/log/*/*.xml > $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml " + res=os.system(cmd) + + print "Now copying files to NFS Share" + oai_localhost = openair('localdomain','localhost') + oai_localhost.connect(user,pw) + tlocaldir = locallogdir + '/' + testcasename + tremotedir = NFSTestsResultsDir + '/log' + cmd = ' mkdir -p ' + tremotedir + ' ; rm -fr ' + tremotedir + '/' + testcasename + res = oai_localhost.send_recv(cmd) + print "Copying files from GilabCI Runner Machine : " + host + " .tlocallogdir = " + tlocaldir + ", tremotedir = " + tremotedir + SSHSessionWrapper('localhost', user, None, pw , tremotedir , tlocaldir, "put_all") + elif (testcaseclass == 'compilation'): threadListGlobal = handle_testcaseclass_generic (testcasename, threadListGlobal, CleanUpOldProgs, logdirOAI5GRepo, MachineListGeneric, user, pw, CleanUpAluLteBox,Timeout_execution, ExmimoRfStop) elif (testcaseclass == 'execution'): From 3aab3bfa26660c3df00e8dd1432821fa563d26a5 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 2 May 2016 14:25:49 +0200 Subject: [PATCH 175/214] update for Gitlab CI to detect failed machines --- .../autotests/run_exec_lte-softmodem_tests.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py index 4893d199b5..159f1df412 100755 --- a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py +++ b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py @@ -1525,16 +1525,17 @@ for testcase in testcaseList: print "Creating xml file for overall results..." cmd = "cat $OPENAIR_DIR/cmake_targets/autotests/log/*/*.xml > $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml " res=os.system(cmd) - + os.system('sync') print "Now copying files to NFS Share" oai_localhost = openair('localdomain','localhost') oai_localhost.connect(user,pw) - tlocaldir = locallogdir + '/' + testcasename - tremotedir = NFSTestsResultsDir + '/log' - cmd = ' mkdir -p ' + tremotedir + ' ; rm -fr ' + tremotedir + '/' + testcasename + cmd = ' rm -fr ' + NFSTestsResultsDir + ' ; mkdir -p ' + NFSTestsResultsDir res = oai_localhost.send_recv(cmd) - print "Copying files from GilabCI Runner Machine : " + host + " .tlocallogdir = " + tlocaldir + ", tremotedir = " + tremotedir - SSHSessionWrapper('localhost', user, None, pw , tremotedir , tlocaldir, "put_all") + print "Deleting NFSTestResults Dir..." + res + + print "Copying files from GilabCI Runner Machine : " + host + " .locallogdir = " + locallogdir + ", NFSTestsResultsDir = " + NFSTestsResultsDir + SSHSessionWrapper('localhost', user, None, pw , NFSTestsResultsDir , locallogdir, "put_all") + oai_localhost.disconnect() elif (testcaseclass == 'compilation'): threadListGlobal = handle_testcaseclass_generic (testcasename, threadListGlobal, CleanUpOldProgs, logdirOAI5GRepo, MachineListGeneric, user, pw, CleanUpAluLteBox,Timeout_execution, ExmimoRfStop) @@ -1573,5 +1574,6 @@ print "Deleting NFSTestResults Dir..." + res print "Copying files from GilabCI Runner Machine : " + host + " .locallogdir = " + locallogdir + ", NFSTestsResultsDir = " + NFSTestsResultsDir SSHSessionWrapper('localhost', user, None, pw , NFSTestsResultsDir , locallogdir, "put_all") +oai_localhost.disconnect() sys.exit() From a363ffa8e0e888e1cc7563bc38485ededb0b2f96 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 9 May 2016 11:06:22 +0200 Subject: [PATCH 176/214] trace disk usage in test framework --- cmake_targets/autotests/run_exec_lte-softmodem_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py index 159f1df412..77eeff696e 100755 --- a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py +++ b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py @@ -321,7 +321,7 @@ def cleanOldPrograms(oai, programList, CleanUpAluLteBox, ExmimoRfStop): print "Killing old programs..." + result programArray = programList.split() programListJoin = '|'.join(programArray) - cmd = " ( date ;echo \"Starting cleaning old programs.. \" ; dmesg|tail )>& $HOME/.oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync" + cmd = " ( date ;echo \"Starting cleaning old programs.. \" ; dmesg|tail ; echo \"Current disk space.. \" ; df -h )>& $HOME/.oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync" result=oai.send_recv(cmd) cmd = cleanupOldProgramsScript + ' ' + '\''+programListJoin+'\'' #result = oai.send_recv(cmd) From cb50fd1d394ebf613cfcd04228d9e8d69d60d467 Mon Sep 17 00:00:00 2001 From: nikaeinn Date: Mon, 9 May 2016 19:26:05 +0200 Subject: [PATCH 177/214] add a new line between each configuration section --- .../GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf index ba77ad0edb..f7e1ee90be 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf @@ -140,6 +140,7 @@ eNBs = } ); + rrh_gw_config = ( { local_if_name = "eth0"; @@ -157,6 +158,8 @@ rrh_gw_config = ( tx_scheduling_advance = 9; } + + ); NETWORK_INTERFACES : From b133c791c96c86e4d242049f1b3b5a6a63fbd8aa Mon Sep 17 00:00:00 2001 From: nikaeinn Date: Tue, 10 May 2016 01:06:49 +0200 Subject: [PATCH 178/214] adjust the rrh config params --- .../CONF/enb.band7.tm1.rrh.usrpb210.conf | 40 +++++++++---------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf index f7e1ee90be..f4818eab9d 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf @@ -140,28 +140,6 @@ eNBs = } ); - -rrh_gw_config = ( - { - local_if_name = "eth0"; - #remote_address = "169.254.10.158"; - #local_address = "169.254.8.15"; - remote_address = "74:d4:35:cc:88:e3"; - local_address = "74:d4:35:cc:88:d1"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "raw"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 70; - tx_scheduling_advance = 9; - -} - - -); - NETWORK_INTERFACES : { @@ -172,6 +150,24 @@ rrh_gw_config = ( ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; + rrh_gw_config = ( + { + local_if_name = "eth0"; + #remote_address = "169.254.10.158"; + #local_address = "169.254.8.15"; + remote_address = "74:d4:35:cc:88:e3"; + local_address = "74:d4:35:cc:88:d1"; + local_port = 50000; #for raw option local port must be the same to remote + remote_port = 50000; + rrh_gw_active = "yes"; + tr_preference = "raw"; + rf_preference = "usrp_b200"; + iq_txshift = 4; + tx_sample_advance = 70; + tx_scheduling_advance = 9; + } + ); + log_config : { global_log_level ="info"; From 8df63bdfe8bc258c029b61b40e2ca62fd777ed5b Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 10 May 2016 08:29:11 +0200 Subject: [PATCH 179/214] Increased search matching packet range, may need to be increased again --- openair3/TEST/EPC_TEST/play_scenario_s1ap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c index 5d5a3672d3..64071981fb 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c @@ -666,7 +666,7 @@ int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) packet = g_scenario->last_rx_packet->next; } // not_found threshold may sure depend on number of mme, may be not sure on number of UE - while ((NULL != packet) && (not_found < 7)) { + while ((NULL != packet) && (not_found < 9)) { S1AP_DEBUG("%s() Considering packet num %d original frame number %u\n", __FUNCTION__, packet->packet_number, packet->original_frame_number); if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { comp_results = et_sctp_is_matching(&packet->sctp_hdr, &rx_packet->sctp_hdr, g_constraints); @@ -692,7 +692,7 @@ int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) return et_scenario_set_packet_received(packet); } } else if (strcmp(comp_results->name, "S1ap-TransportLayerAddress") == 0) { - S1AP_WARN("Some work needed there for %s, TODO in generic_scenario.xsl, add epc conf file in the process, anyway continuing...\n",comp_results->name); + S1AP_WARN("Some work needed there for %s, TODO in generic_scenario.xsl, add sgw conf file in the process, anyway continuing...\n",comp_results->name); packet->timestamp_packet.tv_sec = rx_packet->timestamp_packet.tv_sec; packet->timestamp_packet.tv_usec = rx_packet->timestamp_packet.tv_usec; return et_scenario_set_packet_received(packet); From 4070a3affa6c7a63f683955f0f581affb36bbdff Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Tue, 10 May 2016 19:34:36 +0200 Subject: [PATCH 180/214] fixed CCE allocation bug. --- openair1/SCHED/phy_mac_stub.c | 7 +++--- openair1/SCHED/phy_procedures_lte_eNb.c | 14 +++++------ openair2/LAYER2/MAC/defs.h | 2 +- openair2/LAYER2/MAC/eNB_scheduler.c | 23 +++++++++++++++++-- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 2 ++ .../LAYER2/MAC/eNB_scheduler_primitives.c | 14 ++++++----- .../CONF/enb.band7.tm1.50PRB.usrpb210.conf | 8 +++---- 7 files changed, 47 insertions(+), 23 deletions(-) diff --git a/openair1/SCHED/phy_mac_stub.c b/openair1/SCHED/phy_mac_stub.c index 286b11b4ad..3620b8bf27 100644 --- a/openair1/SCHED/phy_mac_stub.c +++ b/openair1/SCHED/phy_mac_stub.c @@ -571,12 +571,13 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e break;*/ } + /* DCI_pdu->nCCE = 0; for (i=0; iNum_common_dci+DCI_pdu->Num_ue_spec_dci; i++) { DCI_pdu->nCCE += (1<<(DCI_pdu->dci_alloc[i].L)); } - + */ } void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eNB) @@ -744,11 +745,11 @@ void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eN default: break; } - + /* DCI_pdu->nCCE = 0; for (i=0; iNum_common_dci+DCI_pdu->Num_ue_spec_dci; i++) { DCI_pdu->nCCE += (1<<(DCI_pdu->dci_alloc[i].L)); } - + */ } diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 6a785ebf33..161e2e5c58 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1,3 +1,4 @@ + /******************************************************************************* OpenAirInterface Copyright(c) 1999 - 2014 Eurecom @@ -965,7 +966,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e num_pdcch_symbols = DCI_pdu->num_pdcch_symbols; - LOG_D(PHY,"num_pdcch_symbols %"PRIu8", nCCE %u (dci commond %"PRIu8", dci uespec %"PRIu8"\n",num_pdcch_symbols,DCI_pdu->nCCE, + LOG_D(PHY,"num_pdcch_symbols %"PRIu8",(dci common %"PRIu8", dci uespec %"PRIu8"\n",num_pdcch_symbols, DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); #if defined(SMBV) && !defined(EXMIMO) @@ -1008,7 +1009,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe] = DCI_pdu->dci_alloc[i].firstCCE; LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (SI) => %"PRIu8"/%u\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe, - phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe],DCI_pdu->nCCE); + phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe],DCI_pdu->dci_alloc[i].firstCCE); #if defined(SMBV) && !defined(EXMIMO) @@ -1039,8 +1040,8 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe] = DCI_pdu->dci_alloc[i].firstCCE; - LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (RA) => %"PRIu8"/%u\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe, - phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe],DCI_pdu->nCCE); + LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (RA) => %"PRIu8"/%u (num_pdcch_symbols %d)\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe, + phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe],get_nCCE_mac(phy_vars_eNB->Mod_id,phy_vars_eNB->CC_id,num_pdcch_symbols,subframe),num_pdcch_symbols); #if defined(SMBV) && !defined(EXMIMO) // configure RA DCI @@ -1094,7 +1095,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe] = DCI_pdu->dci_alloc[i].firstCCE; LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for ue DCI (PDSCH %"PRIx16") => %"PRIu8"/%u\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe, - DCI_pdu->dci_alloc[i].rnti,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe],DCI_pdu->nCCE); + DCI_pdu->dci_alloc[i].rnti,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe],DCI_pdu->dci_alloc[i].firstCCE); #if defined(SMBV) && !defined(EXMIMO) @@ -1177,7 +1178,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resources for UE spec DCI (PUSCH %"PRIx16") => %d/%u\n", phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,DCI_pdu->dci_alloc[i].rnti, - DCI_pdu->dci_alloc[i].firstCCE,DCI_pdu->nCCE); + DCI_pdu->dci_alloc[i].firstCCE,DCI_pdu->dci_alloc[i].firstCCE); #if defined(SMBV) && !defined(EXMIMO) @@ -1218,7 +1219,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (common %"PRIu8",ue_spec %"PRIu8")\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, subframe, DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); - num_pdcch_symbols = generate_dci_top(DCI_pdu->Num_ue_spec_dci, DCI_pdu->Num_common_dci, DCI_pdu->dci_alloc, diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index 48d958f54d..bf166f6d64 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -251,7 +251,7 @@ typedef struct { typedef struct { uint8_t Num_ue_spec_dci ; uint8_t Num_common_dci ; - uint32_t nCCE; + // uint32_t nCCE; uint32_t num_pdcch_symbols; DCI_ALLOC_t dci_alloc[NUM_DCI_MAX] ; } DCI_PDU; diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 30272346f5..a6c4eaeb16 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -108,8 +108,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, for (CC_id=0; CC_idnCCE=0; - DCI_pdu[CC_id]->num_pdcch_symbols=1; mbsfn_status[CC_id]=0; // clear vrb_map memset(eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map,0,100); @@ -661,7 +659,28 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, for (CC_id=0;CC_idNum_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci; + i++) + if (DCI_pdu[CC_id]->dci_alloc[i].rnti==2) + dummy=1; + + if (dummy==1) + for (i=0; + iNum_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci; + i++) + LOG_I(MAC,"Frame %d, subframe %d: DCI %d/%d, format %d, rnti %x, NCCE %d(num_pdcch_symb %d)\n", + frameP,subframeP,i,DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci, + DCI_pdu[CC_id]->dci_alloc[i].format, + DCI_pdu[CC_id]->dci_alloc[i].rnti, + DCI_pdu[CC_id]->dci_alloc[i].firstCCE, + DCI_pdu[CC_id]->num_pdcch_symbols); + + LOG_D(MAC,"frameP %d, subframeP %d\n",frameP,subframeP); + */ stop_meas(&eNB_mac_inst[module_idP].eNB_scheduler); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 96ec0fd5e1..3f9872a590 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -251,6 +251,8 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un } if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,2,RA_template->RA_rnti)) { + LOG_D(MAC,"Frame %d: Subframe %d : Adding common DCI for RA_RNTI %x\n", + frameP,subframeP,RA_template->RA_rnti); add_common_dci(DCI_pdu, (void*)&RA_template->RA_alloc_pdu1[0], RA_template->RA_rnti, diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index a76763cbb1..ece06a5e09 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -993,17 +993,19 @@ int allocate_CCEs(int module_idP, int *CCE_table = eNB_mac_inst[module_idP].CCE_table[CC_idP]; DCI_PDU *DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_idP].DCI_pdu; - int nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,DCI_pdu->num_pdcch_symbols,subframeP); + int nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,1,subframeP); int fCCE; int i,j; int allocation_is_feasible = 1; DCI_ALLOC_t *dci_alloc; + int nCCE=0; LOG_D(MAC,"Allocate CCEs subframe %d, test %d : (common %d,uspec %d)\n",subframeP,test_onlyP,DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); + DCI_pdu->num_pdcch_symbols=1; while (allocation_is_feasible == 1) { init_CCE_table(module_idP,CC_idP); - DCI_pdu->nCCE=0; + nCCE=0; for (i=0;iNum_common_dci + DCI_pdu->Num_ue_spec_dci;i++) { dci_alloc = &DCI_pdu->dci_alloc[i]; @@ -1011,9 +1013,9 @@ int allocate_CCEs(int module_idP, i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci, DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci, dci_alloc->rnti,1<L, - DCI_pdu->nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols); + nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols); - if (DCI_pdu->nCCE + (1<L) > nCCE_max) { + if (nCCE + (1<L) > nCCE_max) { if (DCI_pdu->num_pdcch_symbols == 3) allocation_is_feasible = 0; else { @@ -1032,7 +1034,7 @@ int allocate_CCEs(int module_idP, LOG_D(MAC,"Allocating at nCCE %d\n",fCCE); if (test_onlyP == 0) { - DCI_pdu->nCCE += (1<L); + nCCE += (1<L); dci_alloc->firstCCE=fCCE; LOG_D(MAC,"Allocate CCEs subframe %d, test %d\n",subframeP,test_onlyP); } @@ -1049,7 +1051,7 @@ int allocate_CCEs(int module_idP, DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci, DCI_pdu->dci_alloc[j].rnti,DCI_pdu->dci_alloc[j].format, 1<dci_alloc[j].L, - DCI_pdu->nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols); + nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols); } } else { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index d5d1f0d78a..1ae8c45083 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -130,7 +130,7 @@ eNBs = }; ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; + mme_ip_address = ( { ipv4 = "127.0.0.3"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -139,11 +139,11 @@ eNBs = NETWORK_INTERFACES : { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; + ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; From 8c5ebac1c19686eebfac6e66a462696e0ad5d7ca Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Tue, 10 May 2016 19:47:33 +0200 Subject: [PATCH 181/214] fixed segfault in pdcchsim (lte_param_init missing threequarter_fs) --- openair1/SIMULATION/LTE_PHY/pdcchsim.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/pdcchsim.c b/openair1/SIMULATION/LTE_PHY/pdcchsim.c index 94bbbfaec3..4691875d3a 100644 --- a/openair1/SIMULATION/LTE_PHY/pdcchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pdcchsim.c @@ -392,11 +392,7 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2 - DCI_pdu.nCCE = 0; - for (i=0; i Date: Wed, 11 May 2016 00:50:23 +0200 Subject: [PATCH 182/214] removed minor AVX2 optimizations from 16-bit turbo decoder. had issues for small block lengths in UE. --- openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c index b70b1aee95..ab7d19407e 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c @@ -69,7 +69,7 @@ #define print_shorts(s,x) fprintf(fdsse4,"%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7]) #endif - +#undef __AVX2__ #ifdef DEBUG_LOGMAP FILE *fdsse4; From 4ea125e195d130d525e27d8419dda2bb37f7268c Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Wed, 11 May 2016 11:53:58 +0200 Subject: [PATCH 183/214] modified SoDeRa band 13 50 PRB configuration file for EPC on localhost with eNodeB --- .../CONF/enb.band13.tm1.50PRB.lmssdr.conf | 10 +++++----- .../CONF/enb.band7.tm1.50PRB.usrpb210.conf | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.lmssdr.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.lmssdr.conf index 4209490141..b81ac861f6 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.lmssdr.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.lmssdr.conf @@ -133,7 +133,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; + mme_ip_address = ( { ipv4 = "127.0.0.3"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -142,11 +142,11 @@ eNBs = NETWORK_INTERFACES : { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24"; + ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24"; + ENB_INTERFACE_NAME_FOR_S1U = "lo"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index 1ae8c45083..d00482edca 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -142,7 +142,7 @@ eNBs = ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; + ENB_INTERFACE_NAME_FOR_S1U = "lo"; ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; From cb0bc98dfad8e45ae404d15d02ca86c749c0bdf6 Mon Sep 17 00:00:00 2001 From: laurent Date: Mon, 16 May 2016 11:39:43 +0200 Subject: [PATCH 184/214] fix LOWLATENCY name --- cmake_targets/CMakeLists.txt | 6 ++-- cmake_targets/autotests/010101/CMakeLists.txt | 2 +- cmake_targets/autotests/010102/CMakeLists.txt | 2 +- cmake_targets/autotests/010103/CMakeLists.txt | 2 +- .../autotests/010103/CMakeLists.txt.Rel10 | 2 +- .../autotests/010103/CMakeLists.txt.Rel8 | 2 +- .../autotests/010103/CMakeLists.txt.USRP | 2 +- cmake_targets/autotests/010106/CMakeLists.txt | 2 +- cmake_targets/autotests/010107/CMakeLists.txt | 2 +- cmake_targets/autotests/010108/CMakeLists.txt | 2 +- cmake_targets/autotests/010120/CMakeLists.txt | 2 +- .../autotests/010200/CMakeLists.template | 2 +- cmake_targets/autotests/010200/CMakeLists.txt | 2 +- .../autotests/010201/CMakeLists.template | 2 +- cmake_targets/autotests/010201/CMakeLists.txt | 2 +- cmake_targets/autotests/010202/CMakeLists.txt | 2 +- cmake_targets/autotests/010203/CMakeLists.txt | 2 +- cmake_targets/autotests/010204/CMakeLists.txt | 2 +- cmake_targets/autotests/010205/CMakeLists.txt | 2 +- cmake_targets/autotests/010400/CMakeLists.txt | 2 +- cmake_targets/autotests/010401/CMakeLists.txt | 2 +- cmake_targets/autotests/010402/CMakeLists.txt | 2 +- cmake_targets/autotests/010403/CMakeLists.txt | 2 +- cmake_targets/build_oai | 34 +++++++++---------- cmake_targets/epc_test/CMakeLists.template | 2 +- .../oaisim_build_oai/CMakeLists.template | 2 +- .../oaisim_mme_build_oai/CMakeLists.template | 2 +- .../oaisim_noS1_build_oai/CMakeLists.template | 2 +- .../s1c_mme_test/CMakeLists.template | 2 +- 29 files changed, 47 insertions(+), 47 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index b50c017a92..ccff80a055 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -260,7 +260,7 @@ endif (${ENABLE_ITTI}) add_boolean_option(RTAI False "Use RTAI") if (${RTAI}) - set(LOWLATENCY False) + set(DEADLINE_SCHEDULER False) set(CPU_AFFINITY False) add_definitions("-DENABLE_RTAI_CLOCK") add_definitions("-DCONFIG_RTAI_LXRT_INLINE") @@ -605,7 +605,7 @@ endif (${TRANSP_PRO} STREQUAL "ETHERNET") include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON") -Message("LOWLATENCY flag is ${LOWLATENCY}") +Message("DEADLINE_SCHEDULER flag is ${DEADLINE_SCHEDULER}") Message("CPU_Affinity flag is ${CPU_AFFINITY}") ############################################################## @@ -619,7 +619,7 @@ add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "set the RLC mode to AM for the d add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????") add_boolean_option(DISABLE_USE_NAS False "???") -add_boolean_option(LOWLATENCY True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14") +add_boolean_option(DEADLINE_SCHEDULER True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14") add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only valid without deadline scheduler). It is enabled only with >2 CPUs") add_boolean_option(NAS_ADDRESS_FIX False "specific to oaisim: for nasmesh driver") add_boolean_option(NAS_NETLINK False "???? Must be True to compile nasmesh driver without rtai") diff --git a/cmake_targets/autotests/010101/CMakeLists.txt b/cmake_targets/autotests/010101/CMakeLists.txt index ed913b0fb9..3c9cb70c67 100644 --- a/cmake_targets/autotests/010101/CMakeLists.txt +++ b/cmake_targets/autotests/010101/CMakeLists.txt @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD True ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010102/CMakeLists.txt b/cmake_targets/autotests/010102/CMakeLists.txt index d05856ebb0..9ab131b7ed 100644 --- a/cmake_targets/autotests/010102/CMakeLists.txt +++ b/cmake_targets/autotests/010102/CMakeLists.txt @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD True ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010103/CMakeLists.txt b/cmake_targets/autotests/010103/CMakeLists.txt index 9603067fe1..930ab40d62 100644 --- a/cmake_targets/autotests/010103/CMakeLists.txt +++ b/cmake_targets/autotests/010103/CMakeLists.txt @@ -28,7 +28,7 @@ set ( LINUX False ) set ( LINUX_LIST False ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD True ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010103/CMakeLists.txt.Rel10 b/cmake_targets/autotests/010103/CMakeLists.txt.Rel10 index 6af3c58762..c58b193513 100644 --- a/cmake_targets/autotests/010103/CMakeLists.txt.Rel10 +++ b/cmake_targets/autotests/010103/CMakeLists.txt.Rel10 @@ -28,7 +28,7 @@ set ( LINUX False ) set ( LINUX_LIST False ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD True ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010103/CMakeLists.txt.Rel8 b/cmake_targets/autotests/010103/CMakeLists.txt.Rel8 index dafbed61d9..b63274535c 100644 --- a/cmake_targets/autotests/010103/CMakeLists.txt.Rel8 +++ b/cmake_targets/autotests/010103/CMakeLists.txt.Rel8 @@ -28,7 +28,7 @@ set ( LINUX False ) set ( LINUX_LIST False ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD True ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010103/CMakeLists.txt.USRP b/cmake_targets/autotests/010103/CMakeLists.txt.USRP index 9603067fe1..930ab40d62 100644 --- a/cmake_targets/autotests/010103/CMakeLists.txt.USRP +++ b/cmake_targets/autotests/010103/CMakeLists.txt.USRP @@ -28,7 +28,7 @@ set ( LINUX False ) set ( LINUX_LIST False ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD True ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010106/CMakeLists.txt b/cmake_targets/autotests/010106/CMakeLists.txt index 2b315ad411..8b74855c8d 100644 --- a/cmake_targets/autotests/010106/CMakeLists.txt +++ b/cmake_targets/autotests/010106/CMakeLists.txt @@ -22,7 +22,7 @@ set(LINUX_LIST False) set(LINUX True) set(LOCALIZATION False) set(LOG_NO_THREAD True) -set(LOWLATENCY False) +set(DEADLINE_SCHEDULER False) set(MAC_CONTEXT 1) set(MAX_NUM_CCs 1) set(MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010107/CMakeLists.txt b/cmake_targets/autotests/010107/CMakeLists.txt index a2aa19942e..bc89576612 100644 --- a/cmake_targets/autotests/010107/CMakeLists.txt +++ b/cmake_targets/autotests/010107/CMakeLists.txt @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD True ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010108/CMakeLists.txt b/cmake_targets/autotests/010108/CMakeLists.txt index 63bfb1066f..7b7f743414 100644 --- a/cmake_targets/autotests/010108/CMakeLists.txt +++ b/cmake_targets/autotests/010108/CMakeLists.txt @@ -22,7 +22,7 @@ set(LINUX_LIST False) set(LINUX True) set(LOCALIZATION False) set(LOG_NO_THREAD True) -set(LOWLATENCY False) +set(DEADLINE_SCHEDULER False) set(MAC_CONTEXT 1) set(MAX_NUM_CCs 1) set(MESSAGE_CHART_GENERATOR False) diff --git a/cmake_targets/autotests/010120/CMakeLists.txt b/cmake_targets/autotests/010120/CMakeLists.txt index d05856ebb0..9ab131b7ed 100644 --- a/cmake_targets/autotests/010120/CMakeLists.txt +++ b/cmake_targets/autotests/010120/CMakeLists.txt @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD True ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010200/CMakeLists.template b/cmake_targets/autotests/010200/CMakeLists.template index 1ccd57fffd..be572dc6e9 100644 --- a/cmake_targets/autotests/010200/CMakeLists.template +++ b/cmake_targets/autotests/010200/CMakeLists.template @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD 1 ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010200/CMakeLists.txt b/cmake_targets/autotests/010200/CMakeLists.txt index e6c4bdfe47..c5ab0cab02 100644 --- a/cmake_targets/autotests/010200/CMakeLists.txt +++ b/cmake_targets/autotests/010200/CMakeLists.txt @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD 1 ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010201/CMakeLists.template b/cmake_targets/autotests/010201/CMakeLists.template index 1ccd57fffd..be572dc6e9 100644 --- a/cmake_targets/autotests/010201/CMakeLists.template +++ b/cmake_targets/autotests/010201/CMakeLists.template @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD 1 ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010201/CMakeLists.txt b/cmake_targets/autotests/010201/CMakeLists.txt index e6c4bdfe47..c5ab0cab02 100644 --- a/cmake_targets/autotests/010201/CMakeLists.txt +++ b/cmake_targets/autotests/010201/CMakeLists.txt @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD 1 ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010202/CMakeLists.txt b/cmake_targets/autotests/010202/CMakeLists.txt index e6c4bdfe47..c5ab0cab02 100644 --- a/cmake_targets/autotests/010202/CMakeLists.txt +++ b/cmake_targets/autotests/010202/CMakeLists.txt @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD 1 ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010203/CMakeLists.txt b/cmake_targets/autotests/010203/CMakeLists.txt index e6c4bdfe47..c5ab0cab02 100644 --- a/cmake_targets/autotests/010203/CMakeLists.txt +++ b/cmake_targets/autotests/010203/CMakeLists.txt @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD 1 ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010204/CMakeLists.txt b/cmake_targets/autotests/010204/CMakeLists.txt index e6c4bdfe47..c5ab0cab02 100644 --- a/cmake_targets/autotests/010204/CMakeLists.txt +++ b/cmake_targets/autotests/010204/CMakeLists.txt @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD 1 ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010205/CMakeLists.txt b/cmake_targets/autotests/010205/CMakeLists.txt index e6c4bdfe47..c5ab0cab02 100644 --- a/cmake_targets/autotests/010205/CMakeLists.txt +++ b/cmake_targets/autotests/010205/CMakeLists.txt @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD 1 ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010400/CMakeLists.txt b/cmake_targets/autotests/010400/CMakeLists.txt index e6c4bdfe47..c5ab0cab02 100644 --- a/cmake_targets/autotests/010400/CMakeLists.txt +++ b/cmake_targets/autotests/010400/CMakeLists.txt @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD 1 ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010401/CMakeLists.txt b/cmake_targets/autotests/010401/CMakeLists.txt index e6c4bdfe47..c5ab0cab02 100644 --- a/cmake_targets/autotests/010401/CMakeLists.txt +++ b/cmake_targets/autotests/010401/CMakeLists.txt @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD 1 ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010402/CMakeLists.txt b/cmake_targets/autotests/010402/CMakeLists.txt index e6c4bdfe47..c5ab0cab02 100644 --- a/cmake_targets/autotests/010402/CMakeLists.txt +++ b/cmake_targets/autotests/010402/CMakeLists.txt @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD 1 ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/autotests/010403/CMakeLists.txt b/cmake_targets/autotests/010403/CMakeLists.txt index e6c4bdfe47..c5ab0cab02 100644 --- a/cmake_targets/autotests/010403/CMakeLists.txt +++ b/cmake_targets/autotests/010403/CMakeLists.txt @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD 1 ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 3a3e8bbec3..96adfa0040 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -45,8 +45,8 @@ MSC_GEN="False" XFORMS="True" PRINT_STATS="False" VCD_TIMING="False" -LOWLATENCY_FLAG_USER="False" -FORCE_LOWLATENCY_FLAG_USER="" +DEADLINE_SCHEDULER_FLAG_USER="False" +FORCE_DEADLINE_SCHEDULER_FLAG_USER="" CPU_AFFINITY_FLAG_USER="True" #Only valid when lowlatecy flag is set to False REL="Rel10" HW="None" @@ -125,7 +125,7 @@ Options --disable-deadline Disables deadline scheduler of Linux kernel (>=3.14.x). --enable-deadline - Disables deadline scheduler of Linux kernel (>=3.14.x). + Enable deadline scheduler of Linux kernel (>=3.14.x). --disable-cpu-affinity Disables CPU Affinity between UHD/TX/RX Threads (Valid only when deadline scheduler is disabled). By defaulT, CPU Affinity is enabled when not using deadline scheduler. It is enabled only with >2 CPUs. For eNB, CPU_0-> Device library (UHD), CPU_1->TX Threads, CPU_2...CPU_MAX->Rx Threads. For UE, CPU_0->Device Library(UHD), CPU_1..CPU_MAX -> All the UE threads Usage (first build): @@ -259,11 +259,11 @@ function main() { echo_info "Will build doxygen support" shift;; --disable-deadline) - FORCE_LOWLATENCY_FLAG_USER="False" + FORCE_DEADLINE_SCHEDULER_FLAG_USER="False" echo_info "Disabling the usage of deadline scheduler" shift 1;; --enable-deadline) - FORCE_LOWLATENCY_FLAG_USER="True" + FORCE_DEADLINE_SCHEDULER_FLAG_USER="True" echo_info "Enabling the usage of deadline scheduler" shift 1;; --disable-cpu-affinity) @@ -314,33 +314,33 @@ function main() { #By default: USRP: disable, #By default: BLADERF: enable, #By default: EXMIMO: enable - if [ "$FORCE_LOWLATENCY_FLAG_USER" = "" ]; then + if [ "$FORCE_DEADLINE_SCHEDULER_FLAG_USER" = "" ]; then if [ "$HW" = "EXMIMO" ] ; then - LOWLATENCY_FLAG_USER="False" + DEADLINE_SCHEDULER_FLAG_USER="False" elif [ "$HW" = "ETHERNET" ] ; then - LOWLATENCY_FLAG_USER="True" + DEADLINE_SCHEDULER_FLAG_USER="True" elif [ "$HW" = "OAI_USRP" ] ; then - LOWLATENCY_FLAG_USER="False" + DEADLINE_SCHEDULER_FLAG_USER="False" elif [ "$HW" = "OAI_BLADERF" ] ; then - LOWLATENCY_FLAG_USER="False" + DEADLINE_SCHEDULER_FLAG_USER="False" elif [ "$HW" = "OAI_LMSSDR" ] ; then - LOWLATENCY_FLAG_USER="False" + DEADLINE_SCHEDULER_FLAG_USER="False" elif [ "$HW" = "None" ] ; then - LOWLATENCY_FLAG_USER="False" + DEADLINE_SCHEDULER_FLAG_USER="False" else echo_error "Unknown HW type $HW. Exiting now..." exit fi else - LOWLATENCY_FLAG_USER=$FORCE_LOWLATENCY_FLAG_USER + DEADLINE_SCHEDULER_FLAG_USER=$FORCE_DEADLINE_SCHEDULER_FLAG_USER fi #Disable CPU Affinity for deadline scheduler - if [ "$LOWLATENCY_FLAG_USER" = "True" ] ; then + if [ "$DEADLINE_SCHEDULER_FLAG_USER" = "True" ] ; then CPU_AFFINITY_FLAG_USER="False" fi - echo_info "Flags for Deadline scheduler: $LOWLATENCY_FLAG_USER" + echo_info "Flags for Deadline scheduler: $DEADLINE_SCHEDULER_FLAG_USER" echo_info "Flags for CPU Affinity: $CPU_AFFINITY_FLAG_USER" ############################################ @@ -432,7 +432,7 @@ function main() { echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file echo "set(PACKAGE_NAME \"${lte_exec}\")" >> $cmake_file - echo "set (LOWLATENCY \"${LOWLATENCY_FLAG_USER}\" )" >>$cmake_file + echo "set (DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >>$cmake_file echo "set (CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file cd $DIR/$lte_build_dir/build @@ -660,7 +660,7 @@ function main() { echo "set(RF_BOARD \"${HW}\")" >> $cmake_file echo "set(TRANSP_PRO \"${TP}\")" >> $cmake_file echo 'set(PACKAGE_NAME "\"rrh_gw\"")' >> $cmake_file - echo "set (LOWLATENCY \"${LOWLATENCY_FLAG_USER}\" )" >>$cmake_file + echo "set (DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >>$cmake_file echo "set (CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file cd $DIR/$rrh_build_dir/build diff --git a/cmake_targets/epc_test/CMakeLists.template b/cmake_targets/epc_test/CMakeLists.template index 8a8223e4ae..76defbc7d7 100644 --- a/cmake_targets/epc_test/CMakeLists.template +++ b/cmake_targets/epc_test/CMakeLists.template @@ -29,7 +29,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD True ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False) diff --git a/cmake_targets/oaisim_build_oai/CMakeLists.template b/cmake_targets/oaisim_build_oai/CMakeLists.template index 76564d8fdd..0a05d68d10 100644 --- a/cmake_targets/oaisim_build_oai/CMakeLists.template +++ b/cmake_targets/oaisim_build_oai/CMakeLists.template @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD True ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False) diff --git a/cmake_targets/oaisim_mme_build_oai/CMakeLists.template b/cmake_targets/oaisim_mme_build_oai/CMakeLists.template index 1035a28599..69fa209b16 100644 --- a/cmake_targets/oaisim_mme_build_oai/CMakeLists.template +++ b/cmake_targets/oaisim_mme_build_oai/CMakeLists.template @@ -29,7 +29,7 @@ set ( LINUX_LIST False ) set ( LINUX False ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD False ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MIH_C_MEDIEVAL_EXTENSIONS False ) diff --git a/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template b/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template index a905510150..6d8fc6d26a 100644 --- a/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template +++ b/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD 1 ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/s1c_mme_test/CMakeLists.template b/cmake_targets/s1c_mme_test/CMakeLists.template index 4067202df1..994edf8352 100644 --- a/cmake_targets/s1c_mme_test/CMakeLists.template +++ b/cmake_targets/s1c_mme_test/CMakeLists.template @@ -29,7 +29,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD True ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False) From cb99f6a05a22f9fb1e79e79cedbb3dbc869f50b3 Mon Sep 17 00:00:00 2001 From: laurent Date: Mon, 16 May 2016 11:50:41 +0200 Subject: [PATCH 185/214] LOWLATENCY fix2 --- targets/RT/USER/Makefile | 10 +++++----- targets/RT/USER/eNB_transport_IQ.c | 8 ++++---- targets/RT/USER/lte-softmodem.c | 22 +++++++++++----------- targets/RT/USER/lte-ue.c | 12 ++++++------ targets/RT/USER/rrh_gw.c | 2 +- targets/RT/USER/rt_wrapper.c | 4 ++-- targets/RT/USER/rt_wrapper.h | 2 +- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/targets/RT/USER/Makefile b/targets/RT/USER/Makefile index c0efdd2f7c..621f30c5f4 100644 --- a/targets/RT/USER/Makefile +++ b/targets/RT/USER/Makefile @@ -8,14 +8,14 @@ include $(OPENAIR_TARGETS)/Makefile.common KERNEL_VERSION:=$(shell echo `uname -r | cut -d. -f-2`) KERNEL_TYPE:=$(shell echo `uname -r | cut -d. -f-3 | cut -d- -f3`) -LOWLATENCY_KERNEL:=$(shell if [ $(KERNEL_TYPE) = "lowlatency" ]; then echo "1" ; else echo "0" ; fi) +DEADLINE_SCHEDULER_KERNEL:=$(shell if [ $(KERNEL_TYPE) = "lowlatency" ]; then echo "1" ; else echo "0" ; fi) include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc ifdef EXMIMO -#ifdef LOWLATENCY # this ifdef is to be removed after the debugging -ifeq ($(LOWLATENCY_KERNEL),1) -CFLAGS+=-DLOWLATENCY +#ifdef DEADLINE_SCHEDULER # this ifdef is to be removed after the debugging +ifeq ($(DEADLINE_SCHEDULER_KERNEL),1) +CFLAGS+=-DDEADLINE_SCHEDULER endif #endif endif @@ -431,7 +431,7 @@ show: @echo IS_REL10 is $(IS_REL10) @echo openssl $(OPENSSL_FOUND) @echo nettle $(NETTLE_FOUND) - @echo lowlatency kernel: $(LOWLATENCY_KERNEL) + @echo lowlatency kernel: $(DEADLINE_SCHEDULER_KERNEL) beautiful: astyle --style=gnu -s2 $(SRC) diff --git a/targets/RT/USER/eNB_transport_IQ.c b/targets/RT/USER/eNB_transport_IQ.c index acb382386e..86080c2c33 100644 --- a/targets/RT/USER/eNB_transport_IQ.c +++ b/targets/RT/USER/eNB_transport_IQ.c @@ -254,7 +254,7 @@ void *rrh_eNB_thread(void *arg) { pthread_mutex_init(&sync_trx_mutex,NULL); /* create eNB module's TX/RX threads */ -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER error_code_eNB_rx = pthread_create(&eNB_rx_thread, NULL, rrh_eNB_rx_thread, (void *)dev); error_code_eNB_tx = pthread_create(&eNB_tx_thread, NULL, rrh_eNB_tx_thread, (void *)dev); LOG_I(RRH,"[eNB][SCHED] deadline scheduling applied to eNB TX/RX threads\n"); @@ -302,7 +302,7 @@ void *rrh_eNB_thread(void *arg) { timerspec.it_interval.tv_nsec = rt_period%1000000000; -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER error_code_timer = pthread_create(&main_timer_proc_thread, NULL, timer_proc, (void *)&timerspec); LOG_I(RRH,"[eNB][SCHED] deadline scheduling applied to timer thread \n"); #else @@ -368,7 +368,7 @@ void *rrh_eNB_rx_thread(void *arg) { measurements = dev->measurements; next_rx_pos = spp_eth; -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; @@ -560,7 +560,7 @@ void *rrh_eNB_tx_thread(void *arg) { unsigned int subframe=0,frame=0; unsigned int pck_tx=0; -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index b6c3e20464..5b5899198a 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -176,7 +176,7 @@ pthread_t main_ue_thread; pthread_attr_t attr_dlsch_threads; pthread_attr_t attr_UE_thread; -#ifndef LOWLATENCY +#ifndef DEADLINE_SCHEDULER struct sched_param sched_param_dlsch; #endif #endif @@ -192,7 +192,7 @@ struct sched_param sched_param_UE_thread; pthread_attr_t attr_eNB_proc_tx[MAX_NUM_CCs][NUM_ENB_THREADS]; pthread_attr_t attr_eNB_proc_rx[MAX_NUM_CCs][NUM_ENB_THREADS]; -#ifndef LOWLATENCY +#ifndef DEADLINE_SCHEDULER struct sched_param sched_param_eNB_proc_tx[MAX_NUM_CCs][NUM_ENB_THREADS]; struct sched_param sched_param_eNB_proc_rx[MAX_NUM_CCs][NUM_ENB_THREADS]; #endif @@ -1087,7 +1087,7 @@ static void* eNB_thread_tx( void* param ) } #else -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; uint64_t runtime = 850000 ; @@ -1295,7 +1295,7 @@ static void* eNB_thread_tx( void* param ) if (proc->frame_tx==1024) proc->frame_tx=0; stop_meas( &softmodem_stats_tx_sf[proc->subframe] ); -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER if (opp_enabled){ if(softmodem_stats_tx_sf[proc->subframe].diff_now/(cpuf) > attr.sched_runtime){ VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_TX_ENB, (softmodem_stats_tx_sf[proc->subframe].diff_now/cpuf - attr.sched_runtime)/1000000.0); @@ -1370,7 +1370,7 @@ static void* eNB_thread_rx( void* param ) } #else -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; uint64_t runtime = 870000 ; @@ -1534,7 +1534,7 @@ LOG_I( HW, "[SCHED][eNB] RX thread %d started on CPU %d TID %ld, sched_policy = proc->frame_rx=0; stop_meas( &softmodem_stats_rx_sf[proc->subframe] ); -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER if (opp_enabled){ if(softmodem_stats_rx_sf[proc->subframe].diff_now/(cpuf) > attr.sched_runtime){ VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_RX_ENB, (softmodem_stats_rx_sf[proc->subframe].diff_now/cpuf - attr.sched_runtime)/1000000.0); @@ -1576,7 +1576,7 @@ void init_eNB_proc(void) // set the stack size -#ifndef LOWLATENCY +#ifndef DEADLINE_SCHEDULER /* pthread_attr_init( &attr_eNB_proc_tx[CC_id][i] ); if (pthread_attr_setstacksize( &attr_eNB_proc_tx[CC_id][i], 64 *PTHREAD_STACK_MIN ) != 0) @@ -1603,7 +1603,7 @@ void init_eNB_proc(void) pthread_mutex_init( &PHY_vars_eNB_g[0][CC_id]->proc[i].mutex_rx, NULL); pthread_cond_init( &PHY_vars_eNB_g[0][CC_id]->proc[i].cond_tx, NULL); pthread_cond_init( &PHY_vars_eNB_g[0][CC_id]->proc[i].cond_rx, NULL); -#ifndef LOWLATENCY +#ifndef DEADLINE_SCHEDULER pthread_create( &PHY_vars_eNB_g[0][CC_id]->proc[i].pthread_tx, &attr_eNB_proc_tx[CC_id][i], eNB_thread_tx, &PHY_vars_eNB_g[0][CC_id]->proc[i] ); pthread_create( &PHY_vars_eNB_g[0][CC_id]->proc[i].pthread_rx, &attr_eNB_proc_rx[CC_id][i], eNB_thread_rx, &PHY_vars_eNB_g[0][CC_id]->proc[i] ); #else @@ -1778,7 +1778,7 @@ static void* eNB_thread( void* arg ) #ifdef RTAI RT_TASK* task = rt_task_init_schmod(nam2num("eNBmain"), 0, 0, 0, SCHED_FIFO, 0xF); #else -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; @@ -3305,7 +3305,7 @@ int main( int argc, char **argv ) #endif } -#ifndef LOWLATENCY +#ifndef DEADLINE_SCHEDULER /* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */ @@ -3608,7 +3608,7 @@ int main( int argc, char **argv ) pthread_attr_init (&attr_UE_thread); pthread_attr_setstacksize(&attr_UE_thread,8192);//5*PTHREAD_STACK_MIN); -#ifndef LOWLATENCY +#ifndef DEADLINE_SCHEDULER sched_param_UE_thread.sched_priority = sched_get_priority_max(SCHED_FIFO); pthread_attr_setschedparam(&attr_UE_thread,&sched_param_UE_thread); sched_param_dlsch.sched_priority = sched_get_priority_max(SCHED_FIFO); //OPENAIR_THREAD_PRIORITY; diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 561554516c..0e834a53ab 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -212,7 +212,7 @@ static void *UE_thread_synch(void *arg) printf("UE_thread_sync in with PHY_vars_UE %p\n",arg); printf("waiting for sync (UE_thread_synch) \n"); -#ifndef LOWLATENCY +#ifndef DEADLINE_SCHEDULER int policy, s, j; struct sched_param sparam; char cpu_affinity[1024]; @@ -701,7 +701,7 @@ static void *UE_thread_tx(void *arg) LOG_D(HW,"Started UE TX thread (id %p)\n",task); #else -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; @@ -920,7 +920,7 @@ static void *UE_thread_rx(void *arg) LOG_D(HW,"Started UE RX thread (id %p)\n",task); #else -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; @@ -1237,7 +1237,7 @@ void *UE_thread(void *arg) #else -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; @@ -1616,7 +1616,7 @@ void *UE_thread(void *arg) int wait_sync_cnt = 0; int first_synch = 1; -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; // unsigned long mask = 1; // processor 0 @@ -1640,7 +1640,7 @@ void *UE_thread(void *arg) #endif -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER attr.size = sizeof(attr); attr.sched_flags = 0; attr.sched_nice = 0; diff --git a/targets/RT/USER/rrh_gw.c b/targets/RT/USER/rrh_gw.c index 8084644b85..4fd687a3a5 100644 --- a/targets/RT/USER/rrh_gw.c +++ b/targets/RT/USER/rrh_gw.c @@ -387,7 +387,7 @@ void *timer_proc(void *arg) { struct itimerspec *old_value; -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; diff --git a/targets/RT/USER/rt_wrapper.c b/targets/RT/USER/rt_wrapper.c index a011cf8dfe..ed9eb4e798 100644 --- a/targets/RT/USER/rt_wrapper.c +++ b/targets/RT/USER/rt_wrapper.c @@ -28,7 +28,7 @@ *******************************************************************************/ /*! \file rt_wrapper.h -* \brief provides a wrapper for the timing function, runtime calculations for real-time opeartions depending on weather RTAI or LOWLATENCY kernels are used or not +* \brief provides a wrapper for the timing function, runtime calculations for real-time opeartions depending on weather RTAI or DEADLINE_SCHEDULER kernels are used or not * \author F. Kaltenberger and Navid Nikaein * \date 2013 * \version 0.1 @@ -241,7 +241,7 @@ double get_runtime_rx(int rx_subframe, uint16_t runtime_phy_rx[29][6], uint32_t return runtime; } -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER int sched_setattr(pid_t pid, const struct sched_attr *attr, unsigned int flags) { diff --git a/targets/RT/USER/rt_wrapper.h b/targets/RT/USER/rt_wrapper.h index 88a3d96efa..d67632054b 100644 --- a/targets/RT/USER/rt_wrapper.h +++ b/targets/RT/USER/rt_wrapper.h @@ -72,7 +72,7 @@ double get_runtime_rx(int rx_subframe, uint16_t runtime_phy_rx[29][6], uint32_t * see https://www.kernel.org/doc/Documentation/scheduler/sched-deadline.txt or * http://www.blaess.fr/christophe/2014/04/05/utiliser-un-appel-systeme-inconnu-de-la-libc/ */ -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER #define gettid() syscall(__NR_gettid) From ebfcbce425781b9c560ce4f81605c43c385f82de Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 25 May 2016 19:54:51 +0200 Subject: [PATCH 186/214] remove redundant config files of eNB --- ...b.band7.tm1.25PRB.usrpx310.epc.remote.conf | 169 ------------------ .../enb.band7.tm1.usrpb210.epc.local.conf | 169 ------------------ .../enb.band7.tm1.usrpb210.epc.remote.conf | 167 ----------------- 3 files changed, 505 deletions(-) delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf deleted file mode 100644 index d4b88383e2..0000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf +++ /dev/null @@ -1,169 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 32; - rx_gain = 116; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -16; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="debug"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf deleted file mode 100644 index 3583deb7e3..0000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf +++ /dev/null @@ -1,169 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - mobile_network_code = "95"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -26; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.170.0.1"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0:3"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.170.0.2/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0:4"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.170.1.2/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="debug"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); \ No newline at end of file diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf deleted file mode 100644 index 83b08cb4e0..0000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf +++ /dev/null @@ -1,167 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -26; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( {ipv4 = "192.168.12.170"; - ipv6="192:168:30::17"; - active="yes"; - preference="ipv4";}); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth4"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.242/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth4"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.242/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="debug"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); From aff21c43f7b949779566d402eefc53e6b3c1d468 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 25 May 2016 21:48:58 +0200 Subject: [PATCH 187/214] Gitlab CI update for change in config files + handling of resetting of UE --- cmake_targets/autotests/test_case_list.xml | 1288 ++++++++--------- .../tools/configure_cots_bandrich_ue.py | 2 + .../tools/configure_cots_huaweiE398_ue.py | 1 + 3 files changed, 647 insertions(+), 644 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 80a54947b8..ec1b698277 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -8,9 +8,9 @@ develop oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* hss hss_sim configure_cots* wvdial* iperf iperf_script ping tshark rrh_gw sudo -S -E /opt/ltebox/tools/stop_ltebox -$OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py --stop-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue; uname -a; sudo -E dmesg|tail +$OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py --stop-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue; uname -a; sudo -E dmesg|tail 36000 - 0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 016102 016105 016502 016505 017002 017005 017502 017505 018002 018005 018502 018505 025502 025505 + 010141 0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 016102 016105 016502 016505 017002 017005 017502 017505 018002 018005 018502 018505 025502 025505 3 mozart calisson stevens nano amerique @@ -879,29 +879,29 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -954,29 +954,29 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -1028,29 +1028,29 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -1102,29 +1102,29 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -1175,29 +1175,29 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -1248,29 +1248,29 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -1323,29 +1323,29 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 2 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 2 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -1398,29 +1398,29 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 2 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 2 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -1471,29 +1471,29 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 2 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 2 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -1545,29 +1545,29 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 2 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 2 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -1619,29 +1619,29 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 2 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 2 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -1693,29 +1693,29 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 2 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 2 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -2272,30 +2272,30 @@ nano 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf pdsch_referenceSignalPower -26 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -26 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -2357,30 +2357,30 @@ nano 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf pdsch_referenceSignalPower -29 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -2441,30 +2441,30 @@ nano 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf pdsch_referenceSignalPower -29 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0:3 192.170.0.2 up ; sudo -E ifconfig eth0:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0:3 192.170.0.2 up ; sudo -E ifconfig eth0:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -2525,30 +2525,30 @@ nano 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf pdsch_referenceSignalPower -26 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -26 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -2609,30 +2609,30 @@ nano 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf pdsch_referenceSignalPower -29 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -2693,30 +2693,30 @@ nano 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf pdsch_referenceSignalPower -29 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -c - sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -2778,27 +2778,27 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf -W @@ -2850,27 +2850,27 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf -W @@ -2921,27 +2921,27 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf -W @@ -2993,27 +2993,27 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf -W @@ -3064,27 +3064,27 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf -W @@ -3135,27 +3135,27 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf -W @@ -3209,27 +3209,27 @@ nano 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf -W @@ -3292,27 +3292,27 @@ nano 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf -W @@ -3373,27 +3373,27 @@ nano 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf -W @@ -3454,27 +3454,27 @@ nano 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf -W @@ -3535,27 +3535,27 @@ nano 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf $OPENAIR_TESTDIR/enb.conf sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf -W @@ -3616,27 +3616,27 @@ nano 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c - sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf -W @@ -6028,29 +6028,29 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -6103,29 +6103,29 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -6177,29 +6177,29 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -6251,29 +6251,29 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -6325,29 +6325,29 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W @@ -6399,29 +6399,29 @@ amerique 390 /tmp - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem - -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W + -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -W diff --git a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py index 3921afd8f2..d2173d4b61 100755 --- a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py @@ -200,10 +200,12 @@ def reset_ue(): ProductId=res[0][3] usb_dir= find_usb_path(VendorId, ProductId) print "Bandrich 4G LTE Adapter found in..." + usb_dir + print "Sleeping now for 45 seconds...please wait..." cmd = "sudo sh -c \"echo 0 > " + usb_dir + "/authorized\"" os.system(cmd + " ; sleep 15" ) cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\"" os.system(cmd + " ; sleep 30" ) + stop_ue() i=1 gw='192.172.0.1' diff --git a/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py b/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py index b173d6157c..70abe7aeec 100755 --- a/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py @@ -211,6 +211,7 @@ def reset_ue(): os.system(cmd + " ; sleep 15" ) cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\"" os.system(cmd + " ; sleep 30" ) + stop_ue() i=1 gw='192.172.0.1' From 64667fce6d9e7363441a497a66aaf2cee2ddd904 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 30 May 2016 20:14:42 +0200 Subject: [PATCH 188/214] remove binding to loopback interface for 0155* tests --- cmake_targets/autotests/test_case_list.xml | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index ec1b698277..a03d4b2ba1 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -8,7 +8,7 @@ develop oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* hss hss_sim configure_cots* wvdial* iperf iperf_script ping tshark rrh_gw sudo -S -E /opt/ltebox/tools/stop_ltebox -$OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py --stop-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue; uname -a; sudo -E dmesg|tail +$OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue; uname -a; sudo -E dmesg 36000 010141 0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 016102 016105 016502 016505 017002 017005 017502 017505 018002 018005 018502 018505 025502 025505 3 @@ -936,7 +936,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -1011,7 +1011,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -1085,7 +1085,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -1159,7 +1159,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -1232,7 +1232,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -1306,7 +1306,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -1380,7 +1380,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo iperf -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -1454,7 +1454,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=2.0Mbits/sec max=2.0Mbits/sec average=2.0Mbits/sec @@ -1528,7 +1528,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=4.0Mbits/sec max=4.0Mbits/sec average=4.0Mbits/sec @@ -1603,7 +1603,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -1677,7 +1677,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -1751,7 +1751,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False From 079f06c2e7e1824ae997895d1eb4f028f7c3f48c Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 30 May 2016 20:14:58 +0200 Subject: [PATCH 189/214] minor fix for timeout for resetting RF interface --- cmake_targets/autotests/run_exec_lte-softmodem_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py index 77eeff696e..e0a3b31381 100755 --- a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py +++ b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py @@ -330,7 +330,7 @@ def cleanOldPrograms(oai, programList, CleanUpAluLteBox, ExmimoRfStop): print "Looking for old programs..." + result res=oai.send_recv(CleanUpAluLteBox, True) cmd = "( " + ExmimoRfStop + " ) >> $HOME/.oai_test_setup_cleanup.log.`hostname` ; sync " - res=oai.send_recv(cmd, False) + res=oai.send_recv(cmd, False, timeout=600) #res = oai.send_recv(ExmimoRfStop, False) cmd = " ( date ;echo \"Finished cleaning old programs.. \" ; dmesg | tail)>> $HOME/.oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync" res=oai.send_recv(cmd) From aee83ada50cfc1e9e3abdc1fb42af9ec59b43d51 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 31 May 2016 11:43:04 +0200 Subject: [PATCH 190/214] Gitlab CI: remove binding to loopback interface for EPC --- cmake_targets/autotests/test_case_list.xml | 120 ++++++++++----------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index a03d4b2ba1..4ab353aec6 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1835,7 +1835,7 @@ -i -r sleep 10; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -1919,7 +1919,7 @@ -i -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -2003,7 +2003,7 @@ -i -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -2087,7 +2087,7 @@ -i -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s @@ -2171,7 +2171,7 @@ -i -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s @@ -2255,7 +2255,7 @@ -i -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s @@ -2340,7 +2340,7 @@ -r sleep 10; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -2424,7 +2424,7 @@ -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -2508,7 +2508,7 @@ -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -2592,7 +2592,7 @@ -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s @@ -2676,7 +2676,7 @@ -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s @@ -2760,7 +2760,7 @@ -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s @@ -2832,7 +2832,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -2904,7 +2904,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -2976,7 +2976,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -3048,7 +3048,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -3119,7 +3119,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -3190,7 +3190,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -3273,7 +3273,7 @@ -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -3356,7 +3356,7 @@ -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -3437,7 +3437,7 @@ -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -3518,7 +3518,7 @@ -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s @@ -3599,7 +3599,7 @@ -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s @@ -3680,7 +3680,7 @@ -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s @@ -3751,7 +3751,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -3824,7 +3824,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -3896,7 +3896,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -3968,7 +3968,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -4039,7 +4039,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -4110,7 +4110,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -4193,7 +4193,7 @@ -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -4276,7 +4276,7 @@ -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -4357,7 +4357,7 @@ -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -4438,7 +4438,7 @@ -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s @@ -4519,7 +4519,7 @@ -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s @@ -4600,7 +4600,7 @@ -r sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in @@ -4676,7 +4676,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -4752,7 +4752,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -4827,7 +4827,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -4902,7 +4902,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -4976,7 +4976,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -5051,7 +5051,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -5125,7 +5125,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -5201,7 +5201,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -5276,7 +5276,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -5351,7 +5351,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -5425,7 +5425,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -5500,7 +5500,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -5586,7 +5586,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -5672,7 +5672,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -5757,7 +5757,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -5842,7 +5842,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -5926,7 +5926,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -6011,7 +6011,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 15Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 15Mbits/s False @@ -6085,7 +6085,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -6160,7 +6160,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -6234,7 +6234,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -6309,7 +6309,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s False @@ -6383,7 +6383,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 15Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 15Mbits/s False @@ -6457,7 +6457,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 15Mbits/s -B 192.172.0.1 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 15Mbits/s False From db8b85d5f65713c1d9782bb4f5c8da271a5af028 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 31 May 2016 14:49:19 +0200 Subject: [PATCH 191/214] Gitlab CI: fix for search/replace in test case config file --- cmake_targets/autotests/tools/search_repl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake_targets/autotests/tools/search_repl.py b/cmake_targets/autotests/tools/search_repl.py index e43feccfb3..fefc142f08 100755 --- a/cmake_targets/autotests/tools/search_repl.py +++ b/cmake_targets/autotests/tools/search_repl.py @@ -54,9 +54,9 @@ file.close() if keyword == 'mme_ip_address': replacement_text = keyword + ' = ( { ' + replacement_text + ' } ) ; ' string = re.sub(r"mme_ip_address\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M) -elif keyword == 'IPV4_LIST': +elif keyword == 'IPV4_LIST' or keyword=='GUMMEI_LIST' or keyword == 'TAI_LIST': replacement_text = keyword + ' = ( ' + replacement_text + ' ) ; ' - string = re.sub(r"IPV4_LIST\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M) + string = re.sub(r"%s\s*=\s*\(([^\$]+?)\)\s*;" % keyword, replacement_text, string, re.M) elif keyword == 'rrh_gw_config': replacement_text = keyword + ' = ( { ' + replacement_text + ' } ) ; ' string = re.sub(r"rrh_gw_config\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M) From 4df4c009dc4c527fab0a6675584062914c6fd514 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 31 May 2016 20:17:20 +0200 Subject: [PATCH 192/214] Gitlab CI: iperf3 usage --- cmake_targets/autotests/tools/iperf3_script | 52 +++++++++++++++ .../autotests/tools/iperf3_script_phone | 63 +++++++++++++++++++ cmake_targets/tools/build_helper | 3 +- 3 files changed, 117 insertions(+), 1 deletion(-) create mode 100755 cmake_targets/autotests/tools/iperf3_script create mode 100755 cmake_targets/autotests/tools/iperf3_script_phone diff --git a/cmake_targets/autotests/tools/iperf3_script b/cmake_targets/autotests/tools/iperf3_script new file mode 100755 index 0000000000..35c20c0731 --- /dev/null +++ b/cmake_targets/autotests/tools/iperf3_script @@ -0,0 +1,52 @@ +#!/bin/bash +#****************************************************************************** + +# OpenAirInterface +# Copyright(c) 1999 - 2014 Eurecom + +# OpenAirInterface is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + + +# OpenAirInterface is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with OpenAirInterface.The full GNU General Public License is +# included in this distribution in the file called "COPYING". If not, +# see . + +# Contact Information +# OpenAirInterface Admin: openair_admin@eurecom.fr +# OpenAirInterface Tech : openair_tech@eurecom.fr +# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + +# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + +# *******************************************************************************/ +# \author Navid Nikaein, Rohit Gupta + +#arg1 timeout to wait before running the script +#arg2 interface +#arg3 iperf arguments + +args=($*) +timeout=${args[0]} +iface=${args[1]} +iperf3_args=(${args[@]:2}) + +#array=${1:-1} +echo "args = ${args[@]}" +echo "timeout = $timeout" +echo "iface = $iface" +echo "iperf_args = ${iperf_args[@]}" + +sleep $timeout + +while true; do var=`ifconfig $iface` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5 + +iperf3 ${iperf_args[@]} diff --git a/cmake_targets/autotests/tools/iperf3_script_phone b/cmake_targets/autotests/tools/iperf3_script_phone new file mode 100755 index 0000000000..eff4105d03 --- /dev/null +++ b/cmake_targets/autotests/tools/iperf3_script_phone @@ -0,0 +1,63 @@ +#!/bin/bash +#****************************************************************************** + +# OpenAirInterface +# Copyright(c) 1999 - 2014 Eurecom + +# OpenAirInterface is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + + +# OpenAirInterface is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with OpenAirInterface.The full GNU General Public License is +# included in this distribution in the file called "COPYING". If not, +# see . + +# Contact Information +# OpenAirInterface Admin: openair_admin@eurecom.fr +# OpenAirInterface Tech : openair_tech@eurecom.fr +# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + +# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + +# *******************************************************************************/ +# \author Navid Nikaein, Rohit Gupta + +#arg1 timeout to wait before running the script +#arg2 interface +#arg3 iperf arguments + +args=($*) +timeout=${args[0]} +device_id=${args[1]} +iperf3_args=(${args[@]:2}) + +#array=${1:-1} +echo "args = ${args[@]}" +echo "timeout = $timeout" +echo "device_id = $device_id" +echo "iperf_args = ${iperf_args[@]}" + +sleep $timeout + +while true ; do + cmd=`sudo adb -s $device_id shell netcfg |grep 192.` + if [ -z "$cmd" ]; then + echo "Wating for UE to connect and get IP Address..." + sleep 1 + else + echo "UE is now connected. IP Address settings are... $cmd" + break + fi +done + +echo "Starting iperf now..." + +sudo adb -s $device_id shell /data/local/tmp/iperf3 ${iperf_args[@]} diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index a40bd8c996..00f6842ffd 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -293,7 +293,8 @@ check_install_oai_software() { python-numpy \ sshpass \ libxslt1-dev \ - android-tools-adb + android-tools-adb \ + iperf3 $SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so From f6e4cc2b0a414df257660c08bdcd4fd7d8079cd2 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 31 May 2016 21:26:11 +0200 Subject: [PATCH 193/214] fix stop_exmimo2 script to avoid kernel crashes --- cmake_targets/tools/stop_exmimo2 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake_targets/tools/stop_exmimo2 b/cmake_targets/tools/stop_exmimo2 index a68fdb7d57..102c9e0680 100755 --- a/cmake_targets/tools/stop_exmimo2 +++ b/cmake_targets/tools/stop_exmimo2 @@ -8,8 +8,12 @@ if [ "$OPENAIR_DIR" == "" ]; then fi sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' -#load the module -sudo -E $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 +exmimo_mod=`lsmod |grep openair_rf` +#load the module only if absent to avoid kernel crashes +if [ -z "$exmimo_mod" ] +then + sudo -E $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 +fi #now we stop the card from transmitting anything cd $OPENAIR_DIR/targets/bin From c2311b64b99bd3a82c8a9a15ea0650b105e4fbc5 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 31 May 2016 22:21:30 +0200 Subject: [PATCH 194/214] Gitlab CI: minor fix for bandrich UE config --- cmake_targets/autotests/tools/configure_cots_bandrich_ue.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py index d2173d4b61..b8d4d05f01 100755 --- a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py @@ -141,6 +141,7 @@ def send_command (cmd, response, timeout): error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e) error = error + traceback.format_exc() print error + time.sleep(1) def start_ue () : From e4f8b35731954d59d7988af9bb45158d5c9f3ba5 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 31 May 2016 22:23:55 +0200 Subject: [PATCH 195/214] minor fix for iperf3 script --- cmake_targets/autotests/tools/iperf3_script | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake_targets/autotests/tools/iperf3_script b/cmake_targets/autotests/tools/iperf3_script index 35c20c0731..e82816f6e1 100755 --- a/cmake_targets/autotests/tools/iperf3_script +++ b/cmake_targets/autotests/tools/iperf3_script @@ -43,10 +43,10 @@ iperf3_args=(${args[@]:2}) echo "args = ${args[@]}" echo "timeout = $timeout" echo "iface = $iface" -echo "iperf_args = ${iperf_args[@]}" +echo "iperf3_args = ${iperf3_args[@]}" sleep $timeout while true; do var=`ifconfig $iface` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5 -iperf3 ${iperf_args[@]} +iperf3 ${iperf3_args[@]} From 5ffff3a8c8f13a2e3bef03dd3ac2368ee210b485 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 31 May 2016 22:48:29 +0200 Subject: [PATCH 196/214] Gitlab CI: minor fixes for UE configuration --- cmake_targets/autotests/tools/configure_cots_bandrich_ue.py | 1 + cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py index b8d4d05f01..768b88aa28 100755 --- a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py @@ -221,6 +221,7 @@ while i < len(sys.argv): print 'Using Serial port : ' + serial_port stop_ue() elif arg == '--reset-ue' : + find_open_port() reset_ue() elif arg == '-gw' : gw = sys.argv[i+1] diff --git a/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py b/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py index 70abe7aeec..929cc1c0a5 100755 --- a/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py @@ -143,6 +143,7 @@ def send_command (cmd, response, timeout): error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e) error = error + traceback.format_exc() print error + time.sleep(1) def start_ue () : @@ -226,6 +227,7 @@ while i < len(sys.argv): print 'Using Serial port : ' + serial_port stop_ue() elif arg == '--reset-ue' : + find_open_port() reset_ue() elif arg == '-gw' : gw = sys.argv[i+1] From d28e9e3d0d03af5a259afd1249420afb99971127 Mon Sep 17 00:00:00 2001 From: Navid Nikaein Date: Thu, 2 Jun 2016 10:33:02 +0200 Subject: [PATCH 197/214] update the readme file --- README.txt | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/README.txt b/README.txt index 2ff2e02190..b549f8122f 100644 --- a/README.txt +++ b/README.txt @@ -1,19 +1,27 @@ -OpenAirInterface is under GNU GPLv3 license. The full GNU General Public License is included in this distribution in the file called "COPYING". - -The OpenAirInterface (OAI) software is composed of six different parts: - -openair1: 3GPP LTE Rel-8 PHY layer + PHY RF simulation - -openair2: 3GPP LTE Rel-9 RLC/MAC/PDCP/RRC implementations, eNB application, X2AP. Note that for RLC, the following versions are userL UM_v9.3.0, TM_v9.3.0, and AM_v9.3.0. For PDCP, PDCP_v10.1.0 is used. For RRC, only LITE is used. - -openair3: 3GPP LTE Rel9 and 10 MME/NAS, S+P-GW, HSS, S1AP (ENB and MME). - -common: some common OAI utilities, other tools can be found at openair2/UTILS - -targets: scripts to compile and lauch different system targets (simulation, emulation and real-time platforms, user-space tools for these platforms (tbd)) - -see README files in these subdirectories for more information - -see also https://twiki.eurecom.fr/twiki/bin/view/OpenAirInterface/WebHome +OpenAirInterface is under OpenAirInterface Software Alliance license. +├── http://www.openairinterface.org/?page_id=101 +├── http://www.openairinterface.org/?page_id=698 +The OpenAirInterface (OAI) software is composed of the following parts: +openairinterface5g +├── cmake_targets: build utilities to compile (simulation, emulation and real-time platforms), and generated build files +├── common : some common OAI utilities, other tools can be found at openair2/UTILS +├── COPYING +├── maketags : script to generate emacs tags +├── openair1 : 3GPP LTE Rel-10 PHY layer + PHY RF simulation and a subset of Rel 12 Features. +├── openair2 :3GPP LTE Rel-10 RLC/MAC/PDCP/RRC/X2AP implementation. + ├── LAYER2/RLC/ with the following subdirectories: UM_v9.3.0, TM_v9.3.0, and AM_v9.3.0. + ├── LAYER2/PDCP/PDCP_v10.1.0. + ├── RRC/LITE + ├── PHY_INTERFACE + ├── X2AP + ├── ENB_APP +├── openair3: 3GPP LTE Rel10 for S1AP, NAS GTPV1-U for both ENB and UE. + ├── GTPV1-U + ├── NAS + ├── S1AP + ├── SCTP + ├── SECU + ├── UDP +└── targets: top level wrapper for unitary simulation for PHY channels, system-level emulation (eNB-UE with and without S1), and realtime eNB and UE and RRH GW. From 07d7fc70ed1315d796f319d8a2fe8e2ce409c492 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 3 Jun 2016 23:47:15 +0200 Subject: [PATCH 198/214] Gitlab CI: updates to test setup for new version of openair-cn --- cmake_targets/autotests/test_case_list.xml | 383 ++++++++++++--------- 1 file changed, 221 insertions(+), 162 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 4ab353aec6..fa2f085564 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -6,7 +6,7 @@ https://gitlab.eurecom.fr/oai/openair-cn.git develop develop - oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* hss hss_sim configure_cots* wvdial* iperf iperf_script ping tshark rrh_gw + oaisim oaisim_nos1 lte-softmodem lte-softmodem-nos1 mme_gw run_epc auth_request run_hss oai_hss mme spgw hss hss_sim configure_cots* wvdial iperf iperf_script ping tshark rrh_gw sudo -S -E /opt/ltebox/tools/stop_ltebox $OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue; uname -a; sudo -E dmesg 36000 @@ -1811,7 +1811,7 @@ False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp BUILD/EPC/epc.conf.in MCC \"208\" @@ -1895,7 +1895,7 @@ False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp BUILD/EPC/epc.conf.in MCC \"208\" @@ -1979,7 +1979,7 @@ False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp BUILD/EPC/epc.conf.in MCC \"208\" @@ -2063,7 +2063,7 @@ throughput_test min=10.0Mbits/sec max=10.5Mbits/sec average=11.0Mbits/sec False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp BUILD/EPC/epc.conf.in MCC \"208\" @@ -2147,7 +2147,7 @@ throughput_test min=20.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp BUILD/EPC/epc.conf.in MCC \"208\" @@ -2231,7 +2231,7 @@ throughput_test min=40.0Mbits/sec max=42.0Mbits/sec average=44.0Mbits/sec False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp BUILD/EPC/epc.conf.in MCC \"208\" @@ -2315,30 +2315,39 @@ False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp - BUILD/EPC/epc.conf.in MCC \"208\" - BUILD/EPC/epc.conf.in MNC \"92\" - BUILD/EPC/epc.conf.in TAC \"1\" - BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" - BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" - BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; - BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; - BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" - BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" - BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" - BUILD/EPC/epc.conf.in OUTPUT \"CONSOLE\" - $OPENAIRCN_DIR/SCRIPTS/build_epc - -c -l - $OPENAIRCN_DIR/SCRIPTS/build_hss - -c -l --debug --random false - + ETC/hss.conf MYSQL_user \"root\" + ETC/hss.conf MYSQL_pass \"linux\" + ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}" + ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" + ETC/mme.conf MME_PORT_FOR_S11_MME 2123 + ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/mme.conf OUTPUT \"CONSOLE\" + ETC/mme.conf HSS_HOSTNAME \"hss\" + ETC/mme_fd.conf Identity \"nano.openair4G.eur\" + ETC/hss_fd.conf Identity \"hss.openair4G.eur\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" + ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 + ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" + sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c + + sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c + +c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1 - $OPENAIRCN_DIR/SCRIPTS/run_epc - -r - sleep 10; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db + sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc + + cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m @@ -2400,31 +2409,41 @@ False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp - BUILD/EPC/epc.conf.in MCC \"208\" - BUILD/EPC/epc.conf.in MNC \"92\" - BUILD/EPC/epc.conf.in TAC \"1\" - BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" - BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" - BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; - BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; - BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" - BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" - BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" - $OPENAIRCN_DIR/SCRIPTS/build_epc - -c -l - $OPENAIRCN_DIR/SCRIPTS/build_hss - -c -l --debug --random false - - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + ETC/hss.conf MYSQL_user \"root\" + ETC/hss.conf MYSQL_pass \"linux\" + ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}" + ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" + ETC/mme.conf MME_PORT_FOR_S11_MME 2123 + ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/mme.conf OUTPUT \"CONSOLE\" + ETC/mme.conf HSS_HOSTNAME \"hss\" + ETC/mme_fd.conf Identity \"nano.openair4G.eur\" + ETC/hss_fd.conf Identity \"hss.openair4G.eur\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" + ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 + ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" + sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c + + sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c + +c + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1 - $OPENAIRCN_DIR/SCRIPTS/run_epc - -r - sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db + sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc + + cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -2484,31 +2503,41 @@ False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp - BUILD/EPC/epc.conf.in MCC \"208\" - BUILD/EPC/epc.conf.in MNC \"92\" - BUILD/EPC/epc.conf.in TAC \"1\" - BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" - BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" - BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; - BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; - BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" - BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" - BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" - $OPENAIRCN_DIR/SCRIPTS/build_epc - -c -l - $OPENAIRCN_DIR/SCRIPTS/build_hss - -c -l --debug --random false - - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + ETC/hss.conf MYSQL_user \"root\" + ETC/hss.conf MYSQL_pass \"linux\" + ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}" + ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" + ETC/mme.conf MME_PORT_FOR_S11_MME 2123 + ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/mme.conf OUTPUT \"CONSOLE\" + ETC/mme.conf HSS_HOSTNAME \"hss\" + ETC/mme_fd.conf Identity \"nano.openair4G.eur\" + ETC/hss_fd.conf Identity \"hss.openair4G.eur\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" + ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 + ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" + sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c + + sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c + +c + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1 - $OPENAIRCN_DIR/SCRIPTS/run_epc - -r - sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db + sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc + + cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -2563,36 +2592,46 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 10M -R - throughput_test min=10.0Mbits/sec max=10.5Mbits/sec average=11.0Mbits/sec + throughput_test min=9.0Mbits/sec max=9Mbits/sec average=9Mbits/sec False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp - BUILD/EPC/epc.conf.in MCC \"208\" - BUILD/EPC/epc.conf.in MNC \"92\" - BUILD/EPC/epc.conf.in TAC \"1\" - BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" - BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" - BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; - BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; - BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" - BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" - BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" - $OPENAIRCN_DIR/SCRIPTS/build_epc - -c -l - $OPENAIRCN_DIR/SCRIPTS/build_hss - -c -l --debug --random false - - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + ETC/hss.conf MYSQL_user \"root\" + ETC/hss.conf MYSQL_pass \"linux\" + ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}" + ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" + ETC/mme.conf MME_PORT_FOR_S11_MME 2123 + ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/mme.conf OUTPUT \"CONSOLE\" + ETC/mme.conf HSS_HOSTNAME \"hss\" + ETC/mme_fd.conf Identity \"nano.openair4G.eur\" + ETC/hss_fd.conf Identity \"hss.openair4G.eur\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" + ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 + ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" + sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c + + sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c + +c + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1 - $OPENAIRCN_DIR/SCRIPTS/run_epc - -r - sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db + sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc + + cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s + $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m @@ -2647,36 +2686,46 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 10M -R - throughput_test min=20.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec + throughput_test min=9Mbits/sec max=9Mbits/sec average=9Mbits/sec False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp - BUILD/EPC/epc.conf.in MCC \"208\" - BUILD/EPC/epc.conf.in MNC \"92\" - BUILD/EPC/epc.conf.in TAC \"1\" - BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" - BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" - BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; - BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; - BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" - BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" - BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" - $OPENAIRCN_DIR/SCRIPTS/build_epc - -c -l - $OPENAIRCN_DIR/SCRIPTS/build_hss - -c -l --debug --random false - - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + ETC/hss.conf MYSQL_user \"root\" + ETC/hss.conf MYSQL_pass \"linux\" + ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}" + ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" + ETC/mme.conf MME_PORT_FOR_S11_MME 2123 + ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/mme.conf OUTPUT \"CONSOLE\" + ETC/mme.conf HSS_HOSTNAME \"hss\" + ETC/mme_fd.conf Identity \"nano.openair4G.eur\" + ETC/hss_fd.conf Identity \"hss.openair4G.eur\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" + ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 + ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" + sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c + + sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c + +c + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1 - $OPENAIRCN_DIR/SCRIPTS/run_epc - -r - sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db + sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc + + cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s + $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m @@ -2731,36 +2780,46 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 9M -R - throughput_test min=20.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec + throughput_test min=9Mbits/sec max=9Mbits/sec average=9Mbits/sec False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp - BUILD/EPC/epc.conf.in MCC \"208\" - BUILD/EPC/epc.conf.in MNC \"92\" - BUILD/EPC/epc.conf.in TAC \"1\" - BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" - BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" - BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; - BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; - BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" - BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" - BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" - $OPENAIRCN_DIR/SCRIPTS/build_epc - -c -l - $OPENAIRCN_DIR/SCRIPTS/build_hss - -c -l --debug --random false - - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ;cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in + ETC/hss.conf MYSQL_user \"root\" + ETC/hss.conf MYSQL_pass \"linux\" + ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}" + ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" + ETC/mme.conf MME_PORT_FOR_S11_MME 2123 + ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/mme.conf OUTPUT \"CONSOLE\" + ETC/mme.conf HSS_HOSTNAME \"hss\" + ETC/mme_fd.conf Identity \"nano.openair4G.eur\" + ETC/hss_fd.conf Identity \"hss.openair4G.eur\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" + ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 + ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" + sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c + + sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c + +c + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1 - $OPENAIRCN_DIR/SCRIPTS/run_epc - -r - sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db + sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc + + cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s + $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m @@ -3249,7 +3308,7 @@ False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp BUILD/EPC/epc.conf.in MCC \"208\" @@ -3332,7 +3391,7 @@ False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp BUILD/EPC/epc.conf.in MCC \"208\" @@ -3413,7 +3472,7 @@ False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp BUILD/EPC/epc.conf.in MCC \"208\" @@ -3494,7 +3553,7 @@ throughput_test min=10.0Mbits/sec max=10.5Mbits/sec average=11.0Mbits/sec False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp BUILD/EPC/epc.conf.in MCC \"208\" @@ -3575,7 +3634,7 @@ throughput_test min=20.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp BUILD/EPC/epc.conf.in MCC \"208\" @@ -3656,7 +3715,7 @@ throughput_test min=20.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp BUILD/EPC/epc.conf.in MCC \"208\" @@ -3714,7 +3773,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2; dmesg|tail + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -3786,7 +3845,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -3858,7 +3917,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -3930,7 +3989,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -4001,7 +4060,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -4072,7 +4131,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail + $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -4145,7 +4204,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf + sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -4169,7 +4228,7 @@ False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp BUILD/EPC/epc.conf.in MCC \"208\" @@ -4229,7 +4288,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -4252,7 +4311,7 @@ False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp BUILD/EPC/epc.conf.in MCC \"208\" @@ -4310,7 +4369,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf + sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -4333,7 +4392,7 @@ False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp BUILD/EPC/epc.conf.in MCC \"208\" @@ -4391,7 +4450,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf + sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -4414,7 +4473,7 @@ throughput_test min=10.0Mbits/sec max=10.5Mbits/sec average=11.0Mbits/sec False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp BUILD/EPC/epc.conf.in MCC \"208\" @@ -4472,7 +4531,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf + sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -4495,7 +4554,7 @@ throughput_test min=20.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp BUILD/EPC/epc.conf.in MCC \"208\" @@ -4553,7 +4612,7 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w EXMIMO -x -c - sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf + sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W @@ -4576,7 +4635,7 @@ throughput_test min=20.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec False - $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue + sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue /tmp BUILD/EPC/epc.conf.in MCC \"208\" From fd8a6260c0bef558750c775d79c70b48fb00e4f6 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 3 Jun 2016 23:50:54 +0200 Subject: [PATCH 199/214] Gitlab CI: deleted reduntant files for test setup --- cmake_targets/autotests/010101/CMakeLists.txt | 106 ----------------- cmake_targets/autotests/010102/CMakeLists.txt | 106 ----------------- cmake_targets/autotests/010103/CMakeLists.txt | 107 ------------------ .../autotests/010103/CMakeLists.txt.Rel10 | 107 ------------------ .../autotests/010103/CMakeLists.txt.Rel8 | 107 ------------------ .../autotests/010103/CMakeLists.txt.USRP | 107 ------------------ cmake_targets/autotests/010104/CMakeLists.txt | 15 --- cmake_targets/autotests/010106/CMakeLists.txt | 75 ------------ cmake_targets/autotests/010107/CMakeLists.txt | 107 ------------------ cmake_targets/autotests/010108/CMakeLists.txt | 74 ------------ cmake_targets/autotests/010120/CMakeLists.txt | 106 ----------------- cmake_targets/autotests/010130/CMakeLists.txt | 6 - .../autotests/010200/CMakeLists.template | 82 -------------- cmake_targets/autotests/010200/CMakeLists.txt | 87 -------------- .../autotests/010201/CMakeLists.template | 82 -------------- cmake_targets/autotests/010201/CMakeLists.txt | 87 -------------- cmake_targets/autotests/010202/CMakeLists.txt | 87 -------------- cmake_targets/autotests/010203/CMakeLists.txt | 87 -------------- cmake_targets/autotests/010204/CMakeLists.txt | 87 -------------- cmake_targets/autotests/010205/CMakeLists.txt | 87 -------------- cmake_targets/autotests/010300/CMakeLists.txt | 15 --- cmake_targets/autotests/010301/CMakeLists.txt | 15 --- cmake_targets/autotests/010302/CMakeLists.txt | 15 --- cmake_targets/autotests/010303/CMakeLists.txt | 15 --- cmake_targets/autotests/010304/CMakeLists.txt | 15 --- cmake_targets/autotests/010305/CMakeLists.txt | 15 --- cmake_targets/autotests/010400/CMakeLists.txt | 87 -------------- cmake_targets/autotests/010401/CMakeLists.txt | 87 -------------- cmake_targets/autotests/010402/CMakeLists.txt | 87 -------------- cmake_targets/autotests/010403/CMakeLists.txt | 87 -------------- cmake_targets/autotests/015000/CMakeLists.txt | 15 --- cmake_targets/autotests/015001/CMakeLists.txt | 15 --- cmake_targets/autotests/015002/CMakeLists.txt | 15 --- cmake_targets/autotests/015003/CMakeLists.txt | 15 --- cmake_targets/autotests/015004/CMakeLists.txt | 15 --- cmake_targets/autotests/015005/CMakeLists.txt | 15 --- cmake_targets/autotests/015006/CMakeLists.txt | 15 --- cmake_targets/autotests/015007/CMakeLists.txt | 15 --- cmake_targets/autotests/015008/CMakeLists.txt | 15 --- cmake_targets/autotests/015009/CMakeLists.txt | 15 --- cmake_targets/autotests/015100/CMakeLists.txt | 15 --- cmake_targets/autotests/015101/CMakeLists.txt | 15 --- 42 files changed, 2327 deletions(-) delete mode 100644 cmake_targets/autotests/010101/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010102/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010103/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010103/CMakeLists.txt.Rel10 delete mode 100644 cmake_targets/autotests/010103/CMakeLists.txt.Rel8 delete mode 100644 cmake_targets/autotests/010103/CMakeLists.txt.USRP delete mode 100644 cmake_targets/autotests/010104/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010106/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010107/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010108/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010120/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010130/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010200/CMakeLists.template delete mode 100644 cmake_targets/autotests/010200/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010201/CMakeLists.template delete mode 100644 cmake_targets/autotests/010201/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010202/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010203/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010204/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010205/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010300/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010301/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010302/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010303/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010304/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010305/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010400/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010401/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010402/CMakeLists.txt delete mode 100644 cmake_targets/autotests/010403/CMakeLists.txt delete mode 100644 cmake_targets/autotests/015000/CMakeLists.txt delete mode 100644 cmake_targets/autotests/015001/CMakeLists.txt delete mode 100644 cmake_targets/autotests/015002/CMakeLists.txt delete mode 100644 cmake_targets/autotests/015003/CMakeLists.txt delete mode 100644 cmake_targets/autotests/015004/CMakeLists.txt delete mode 100644 cmake_targets/autotests/015005/CMakeLists.txt delete mode 100644 cmake_targets/autotests/015006/CMakeLists.txt delete mode 100644 cmake_targets/autotests/015007/CMakeLists.txt delete mode 100644 cmake_targets/autotests/015008/CMakeLists.txt delete mode 100644 cmake_targets/autotests/015009/CMakeLists.txt delete mode 100644 cmake_targets/autotests/015100/CMakeLists.txt delete mode 100644 cmake_targets/autotests/015101/CMakeLists.txt diff --git a/cmake_targets/autotests/010101/CMakeLists.txt b/cmake_targets/autotests/010101/CMakeLists.txt deleted file mode 100644 index 3c9cb70c67..0000000000 --- a/cmake_targets/autotests/010101/CMakeLists.txt +++ /dev/null @@ -1,106 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_USE_NAS False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 False ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI False ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_PGM_TRANSPORT True ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False ) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False) -set ( ENABLE_VCD_FIFO False ) -set ( ENB_MODE True ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False ) -set ( LINK_ENB_PDCP_TO_IP_DRIVER False ) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD True ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX False ) -set ( NAS_BUILT_IN_EPC False ) -set ( NAS_BUILT_IN_UE False ) -set ( NAS_MME False ) -set ( NAS_NETLINK False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX 2 ) -set ( NB_ANTENNAS_TX 2 ) -set ( NB_ANTENNAS_TXRX 2 ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET False ) -set ( OAI_NW_DRIVER_USE_NETLINK False ) -set ( OAISIM True ) -set ( OPENAIR1 True ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PBS_SIM False ) -set ( PC_DSP False ) -set ( PC_TARGET False ) -set ( PDCP_MSG_PRINT False ) -set ( PDCP_USE_NETLINK False ) -set ( PDCP_USE_NETLINK_QUEUES False ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION True ) -set ( PHY_CONTEXT 1 ) -set ( PHY_EMUL False ) -set ( PHYSIM False ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD "False" ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_ASN1_VERSION Rel8 ) -set ( RRC_DEFAULT_RAB_IS_AM False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( S1AP_LIMIT_STREAM_ID_TO_1 False ) -set ( S1AP_VERSION R10 ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( STOP_ON_IP_TRAFFIC_OVERLOAD False ) -set ( TEST_OMG False ) -set ( TRACE_RLC_AM_BO False ) -set ( TRACE_RLC_AM_FREE_SDU False ) -set ( TRACE_RLC_AM_HOLE False ) -set ( TRACE_RLC_AM_PDU True ) -set ( TRACE_RLC_AM_RESEGMENT False ) -set ( TRACE_RLC_AM_RX_DECODE False ) -set ( TRACE_RLC_AM_RX False ) -set ( TRACE_RLC_AM_STATUS_CREATION False ) -set ( TRACE_RLC_AM_TX False ) -set ( TRACE_RLC_AM_TX_STATUS False ) -set ( TRACE_RLC_PAYLOAD False ) -set ( TRACE_RLC_UM_DAR False ) -set ( TRACE_RLC_UM_DISPLAY_ASCII_DATA False ) -set ( TRACE_RLC_UM_PDU True ) -set ( TRACE_RLC_UM_RX False ) -set ( TRACE_RLC_UM_SEGMENT False ) -set ( TRACE_RLC_UM_TX_STATUS False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME "R8" ) -set ( USER_MODE True ) -set ( XER_PRINT True ) -set ( XFORMS False ) -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) \ No newline at end of file diff --git a/cmake_targets/autotests/010102/CMakeLists.txt b/cmake_targets/autotests/010102/CMakeLists.txt deleted file mode 100644 index 9ab131b7ed..0000000000 --- a/cmake_targets/autotests/010102/CMakeLists.txt +++ /dev/null @@ -1,106 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_USE_NAS False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 False ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI False ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_PGM_TRANSPORT True ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False ) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_VCD_FIFO True ) -set ( ENB_MODE True ) -set ( EPC_BUILD False ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False ) -set ( LINK_ENB_PDCP_TO_IP_DRIVER False ) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD True ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX False ) -set ( NAS_BUILT_IN_EPC False ) -set ( NAS_BUILT_IN_UE False ) -set ( NAS_MME False ) -set ( NAS_NETLINK False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX 2 ) -set ( NB_ANTENNAS_TX 2 ) -set ( NB_ANTENNAS_TXRX 2 ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET False ) -set ( OAI_NW_DRIVER_USE_NETLINK False ) -set ( OAISIM True ) -set ( OPENAIR1 False ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PBS_SIM False ) -set ( PC_DSP False ) -set ( PC_TARGET False ) -set ( PDCP_MSG_PRINT False ) -set ( PDCP_USE_NETLINK_QUEUES False ) -set ( PDCP_USE_NETLINK True ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION True ) -set ( PHY_CONTEXT 1 ) -set ( PHY_EMUL False ) -set ( PHYSIM False ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD False ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_ASN1_VERSION Rel8 ) -set ( RRC_DEFAULT_RAB_IS_AM False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( S1AP_LIMIT_STREAM_ID_TO_1 False ) -set ( S1AP_VERSION R10 ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( STOP_ON_IP_TRAFFIC_OVERLOAD False ) -set ( TEST_OMG False ) -set ( TRACE_RLC_AM_BO False ) -set ( TRACE_RLC_AM_FREE_SDU False ) -set ( TRACE_RLC_AM_HOLE False ) -set ( TRACE_RLC_AM_PDU True ) -set ( TRACE_RLC_AM_RESEGMENT False ) -set ( TRACE_RLC_AM_RX_DECODE False ) -set ( TRACE_RLC_AM_RX False ) -set ( TRACE_RLC_AM_STATUS_CREATION False ) -set ( TRACE_RLC_AM_TX False ) -set ( TRACE_RLC_AM_TX_STATUS False ) -set ( TRACE_RLC_PAYLOAD False ) -set ( TRACE_RLC_UM_DAR False ) -set ( TRACE_RLC_UM_DISPLAY_ASCII_DATA False ) -set ( TRACE_RLC_UM_PDU True ) -set ( TRACE_RLC_UM_RX False ) -set ( TRACE_RLC_UM_SEGMENT False ) -set ( TRACE_RLC_UM_TX_STATUS False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME False ) -set ( USER_MODE True ) -set ( XER_PRINT True ) -set ( XFORMS False ) -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010103/CMakeLists.txt b/cmake_targets/autotests/010103/CMakeLists.txt deleted file mode 100644 index 930ab40d62..0000000000 --- a/cmake_targets/autotests/010103/CMakeLists.txt +++ /dev/null @@ -1,107 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_USE_NAS False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI False ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST False ) -set ( ENABLE_PGM_TRANSPORT False ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False ) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_VCD_FIFO True ) -set ( ENB_MODE True ) -set ( EPC_BUILD False ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False ) -set ( LINK_ENB_PDCP_TO_IP_DRIVER False ) -set ( LINUX False ) -set ( LINUX_LIST False ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD True ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX False ) -set ( NAS_BUILT_IN_EPC False ) -set ( NAS_BUILT_IN_UE False ) -set ( NAS_MME False ) -set ( NAS_NETLINK False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX 2 ) -set ( NB_ANTENNAS_TX 2 ) -set ( NB_ANTENNAS_TXRX 2 ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU False ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET False ) -set ( OAI_NW_DRIVER_USE_NETLINK False ) -set ( OAISIM False ) -set ( OPENAIR1 True ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PBS_SIM False ) -set ( PC_DSP True ) -set ( PC_TARGET True ) -set ( PDCP_MSG_PRINT False ) -set ( PDCP_USE_NETLINK False ) -set ( PDCP_USE_NETLINK_QUEUES False ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION False ) -set ( PHY_CONTEXT 1 ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD OAI_USRP ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_ASN1_VERSION Rel10 ) -set ( RRC_DEFAULT_RAB_IS_AM False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( S1AP_LIMIT_STREAM_ID_TO_1 False ) -set ( S1AP_VERSION R10 ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( STOP_ON_IP_TRAFFIC_OVERLOAD False ) -set ( TEST_OMG False ) -set ( TRACE_RLC_AM_BO False ) -set ( TRACE_RLC_AM_FREE_SDU False ) -set ( TRACE_RLC_AM_HOLE False ) -set ( TRACE_RLC_AM_PDU False ) -set ( TRACE_RLC_AM_RESEGMENT False ) -set ( TRACE_RLC_AM_RX_DECODE False ) -set ( TRACE_RLC_AM_RX False ) -set ( TRACE_RLC_AM_STATUS_CREATION False ) -set ( TRACE_RLC_AM_TX False ) -set ( TRACE_RLC_AM_TX_STATUS False ) -set ( TRACE_RLC_PAYLOAD False ) -set ( TRACE_RLC_UM_DAR False ) -set ( TRACE_RLC_UM_DISPLAY_ASCII_DATA False ) -set ( TRACE_RLC_UM_PDU False ) -set ( TRACE_RLC_UM_RX False ) -set ( TRACE_RLC_UM_SEGMENT False ) -set ( TRACE_RLC_UM_TX_STATUS False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME False ) -set ( USER_MODE True ) -set ( XER_PRINT False ) -set ( XFORMS False ) -set(PACKAGE_NAME "lte-softmodem") -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010103/CMakeLists.txt.Rel10 b/cmake_targets/autotests/010103/CMakeLists.txt.Rel10 deleted file mode 100644 index c58b193513..0000000000 --- a/cmake_targets/autotests/010103/CMakeLists.txt.Rel10 +++ /dev/null @@ -1,107 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_USE_NAS False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI False ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST False ) -set ( ENABLE_PGM_TRANSPORT False ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False ) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_VCD_FIFO True ) -set ( ENB_MODE True ) -set ( EPC_BUILD False ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False ) -set ( LINK_ENB_PDCP_TO_IP_DRIVER False ) -set ( LINUX False ) -set ( LINUX_LIST False ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD True ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX False ) -set ( NAS_BUILT_IN_EPC False ) -set ( NAS_BUILT_IN_UE False ) -set ( NAS_MME False ) -set ( NAS_NETLINK False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX 2 ) -set ( NB_ANTENNAS_TX 2 ) -set ( NB_ANTENNAS_TXRX 2 ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU False ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET False ) -set ( OAI_NW_DRIVER_USE_NETLINK False ) -set ( OAISIM False ) -set ( OPENAIR1 True ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PBS_SIM False ) -set ( PC_DSP True ) -set ( PC_TARGET True ) -set ( PDCP_MSG_PRINT False ) -set ( PDCP_USE_NETLINK False ) -set ( PDCP_USE_NETLINK_QUEUES False ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION False ) -set ( PHY_CONTEXT 1 ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD EXMIMO ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_ASN1_VERSION Rel10 ) -set ( RRC_DEFAULT_RAB_IS_AM False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( S1AP_LIMIT_STREAM_ID_TO_1 False ) -set ( S1AP_VERSION R10 ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( STOP_ON_IP_TRAFFIC_OVERLOAD False ) -set ( TEST_OMG False ) -set ( TRACE_RLC_AM_BO False ) -set ( TRACE_RLC_AM_FREE_SDU False ) -set ( TRACE_RLC_AM_HOLE False ) -set ( TRACE_RLC_AM_PDU False ) -set ( TRACE_RLC_AM_RESEGMENT False ) -set ( TRACE_RLC_AM_RX_DECODE False ) -set ( TRACE_RLC_AM_RX False ) -set ( TRACE_RLC_AM_STATUS_CREATION False ) -set ( TRACE_RLC_AM_TX False ) -set ( TRACE_RLC_AM_TX_STATUS False ) -set ( TRACE_RLC_PAYLOAD False ) -set ( TRACE_RLC_UM_DAR False ) -set ( TRACE_RLC_UM_DISPLAY_ASCII_DATA False ) -set ( TRACE_RLC_UM_PDU False ) -set ( TRACE_RLC_UM_RX False ) -set ( TRACE_RLC_UM_SEGMENT False ) -set ( TRACE_RLC_UM_TX_STATUS False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME False ) -set ( USER_MODE True ) -set ( XER_PRINT False ) -set ( XFORMS False ) -set(PACKAGE_NAME "lte-softmodem") -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010103/CMakeLists.txt.Rel8 b/cmake_targets/autotests/010103/CMakeLists.txt.Rel8 deleted file mode 100644 index b63274535c..0000000000 --- a/cmake_targets/autotests/010103/CMakeLists.txt.Rel8 +++ /dev/null @@ -1,107 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_USE_NAS False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI False ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST False ) -set ( ENABLE_PGM_TRANSPORT False ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False ) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_VCD_FIFO True ) -set ( ENB_MODE True ) -set ( EPC_BUILD False ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False ) -set ( LINK_ENB_PDCP_TO_IP_DRIVER False ) -set ( LINUX False ) -set ( LINUX_LIST False ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD True ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX False ) -set ( NAS_BUILT_IN_EPC False ) -set ( NAS_BUILT_IN_UE False ) -set ( NAS_MME False ) -set ( NAS_NETLINK False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX 2 ) -set ( NB_ANTENNAS_TX 2 ) -set ( NB_ANTENNAS_TXRX 2 ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU False ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET False ) -set ( OAI_NW_DRIVER_USE_NETLINK False ) -set ( OAISIM False ) -set ( OPENAIR1 True ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PBS_SIM False ) -set ( PC_DSP True ) -set ( PC_TARGET True ) -set ( PDCP_MSG_PRINT False ) -set ( PDCP_USE_NETLINK False ) -set ( PDCP_USE_NETLINK_QUEUES False ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION False ) -set ( PHY_CONTEXT 1 ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD EXMIMO ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_ASN1_VERSION Rel8 ) -set ( RRC_DEFAULT_RAB_IS_AM False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( S1AP_LIMIT_STREAM_ID_TO_1 False ) -set ( S1AP_VERSION R10 ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( STOP_ON_IP_TRAFFIC_OVERLOAD False ) -set ( TEST_OMG False ) -set ( TRACE_RLC_AM_BO False ) -set ( TRACE_RLC_AM_FREE_SDU False ) -set ( TRACE_RLC_AM_HOLE False ) -set ( TRACE_RLC_AM_PDU False ) -set ( TRACE_RLC_AM_RESEGMENT False ) -set ( TRACE_RLC_AM_RX_DECODE False ) -set ( TRACE_RLC_AM_RX False ) -set ( TRACE_RLC_AM_STATUS_CREATION False ) -set ( TRACE_RLC_AM_TX False ) -set ( TRACE_RLC_AM_TX_STATUS False ) -set ( TRACE_RLC_PAYLOAD False ) -set ( TRACE_RLC_UM_DAR False ) -set ( TRACE_RLC_UM_DISPLAY_ASCII_DATA False ) -set ( TRACE_RLC_UM_PDU False ) -set ( TRACE_RLC_UM_RX False ) -set ( TRACE_RLC_UM_SEGMENT False ) -set ( TRACE_RLC_UM_TX_STATUS False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME False ) -set ( USER_MODE True ) -set ( XER_PRINT False ) -set ( XFORMS False ) -set(PACKAGE_NAME "lte-softmodem") -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010103/CMakeLists.txt.USRP b/cmake_targets/autotests/010103/CMakeLists.txt.USRP deleted file mode 100644 index 930ab40d62..0000000000 --- a/cmake_targets/autotests/010103/CMakeLists.txt.USRP +++ /dev/null @@ -1,107 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_USE_NAS False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI False ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST False ) -set ( ENABLE_PGM_TRANSPORT False ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False ) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_VCD_FIFO True ) -set ( ENB_MODE True ) -set ( EPC_BUILD False ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False ) -set ( LINK_ENB_PDCP_TO_IP_DRIVER False ) -set ( LINUX False ) -set ( LINUX_LIST False ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD True ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX False ) -set ( NAS_BUILT_IN_EPC False ) -set ( NAS_BUILT_IN_UE False ) -set ( NAS_MME False ) -set ( NAS_NETLINK False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX 2 ) -set ( NB_ANTENNAS_TX 2 ) -set ( NB_ANTENNAS_TXRX 2 ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU False ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET False ) -set ( OAI_NW_DRIVER_USE_NETLINK False ) -set ( OAISIM False ) -set ( OPENAIR1 True ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PBS_SIM False ) -set ( PC_DSP True ) -set ( PC_TARGET True ) -set ( PDCP_MSG_PRINT False ) -set ( PDCP_USE_NETLINK False ) -set ( PDCP_USE_NETLINK_QUEUES False ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION False ) -set ( PHY_CONTEXT 1 ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD OAI_USRP ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_ASN1_VERSION Rel10 ) -set ( RRC_DEFAULT_RAB_IS_AM False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( S1AP_LIMIT_STREAM_ID_TO_1 False ) -set ( S1AP_VERSION R10 ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( STOP_ON_IP_TRAFFIC_OVERLOAD False ) -set ( TEST_OMG False ) -set ( TRACE_RLC_AM_BO False ) -set ( TRACE_RLC_AM_FREE_SDU False ) -set ( TRACE_RLC_AM_HOLE False ) -set ( TRACE_RLC_AM_PDU False ) -set ( TRACE_RLC_AM_RESEGMENT False ) -set ( TRACE_RLC_AM_RX_DECODE False ) -set ( TRACE_RLC_AM_RX False ) -set ( TRACE_RLC_AM_STATUS_CREATION False ) -set ( TRACE_RLC_AM_TX False ) -set ( TRACE_RLC_AM_TX_STATUS False ) -set ( TRACE_RLC_PAYLOAD False ) -set ( TRACE_RLC_UM_DAR False ) -set ( TRACE_RLC_UM_DISPLAY_ASCII_DATA False ) -set ( TRACE_RLC_UM_PDU False ) -set ( TRACE_RLC_UM_RX False ) -set ( TRACE_RLC_UM_SEGMENT False ) -set ( TRACE_RLC_UM_TX_STATUS False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME False ) -set ( USER_MODE True ) -set ( XER_PRINT False ) -set ( XFORMS False ) -set(PACKAGE_NAME "lte-softmodem") -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010104/CMakeLists.txt b/cmake_targets/autotests/010104/CMakeLists.txt deleted file mode 100644 index 36a9eb75da..0000000000 --- a/cmake_targets/autotests/010104/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER Flase) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010106/CMakeLists.txt b/cmake_targets/autotests/010106/CMakeLists.txt deleted file mode 100644 index 8b74855c8d..0000000000 --- a/cmake_targets/autotests/010106/CMakeLists.txt +++ /dev/null @@ -1,75 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set(ADDR_CONF False) -set(DEBUG_OMG False) -set(DISABLE_XER_PRINT False) -set(DRIVER2013 False) -set(ENABLE_FXP True) -set(ENABLE_ITTI True) -set(ENABLE_NAS_UE_LOGGING False) -set(ENABLE_NEW_MULTICAST True) -set(ENABLE_PGM_TRANSPORT True) -set(ENABLE_RAL False) -set(ENABLE_SECURITY False) -set(ENABLE_USE_CPU_EXECUTION_TIME True) -set(ENABLE_USE_MME False) -set(ENABLE_VCD_FIFO True) -set(HARD_RT False) -set(JUMBO_FRAME True) -set(LARGE_SCALE False) -set(LINK_ENB_PDCP_TO_GTPV1U False) -set(LINUX_LIST False) -set(LINUX True) -set(LOCALIZATION False) -set(LOG_NO_THREAD True) -set(DEADLINE_SCHEDULER False) -set(MAC_CONTEXT 1) -set(MAX_NUM_CCs 1) -set(MESSAGE_CHART_GENERATOR False ) -set(MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set(MESSAGE_CHART_GENERATOR_PHY False ) -set(MIH_C_MEDIEVAL_EXTENSIONS False) -set(MSG_PRINT False) -set(MU_RECEIVER False) -set(NAS_ADDRESS_FIX true) -set(NAS_NETLINK True) -set(NAS_UE True) -set(NEW_FFT True) -set(NO_RRM True) -set(OAI_EMU True) -set(OAI_EMU True) -set(OAI_NW_DRIVER_TYPE_ETHERNET False) -set(OPENAIR1 False) -set(OPENAIR2 True) -set(OPENAIR_EMU True) -set(OPENAIR_LTE True) -set (PACKAGE_NAME "oaisim") -set(PACKAGE_NAME "oaisim") -set(PBS_SIM False) -set(PC_DSP False) -set(PC_TARGET False) -set(PDCP_MSG_PRINT False) -set(PERFECT_CE False) -set(PHY_ABSTRACTION True) -set(PHY_ABSTRACTION True) -set(PHY_EMUL False) -set(PHYSIM False) -set(PUCCH True) -set(RANDOM_BF False) -set(RF_BOARD "NoBoard") -set(RLC_STOP_ON_LOST_PDU False) -set(RRC_ASN1_VERSION Rel8) -set(RRC_ASN1_VERSION "Rel8") -set(RRC_MSG_PRINT False) -set(RTAI False) -set(SECU False) -set(SMBV False) -set(SPECTRA False) -set(TEST_OMG False) -set(USE_3GPP_ADDR_AS_LINK_ADDR False) -set(USE_MME False) -set(USER_MODE True) -set(XER_PRINT False) -set(XFORMS False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010107/CMakeLists.txt b/cmake_targets/autotests/010107/CMakeLists.txt deleted file mode 100644 index bc89576612..0000000000 --- a/cmake_targets/autotests/010107/CMakeLists.txt +++ /dev/null @@ -1,107 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_USE_NAS False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 False ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI False ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_PGM_TRANSPORT True ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False ) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_VCD_FIFO True ) -set ( ENB_MODE True ) -set ( EPC_BUILD False ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False ) -set ( LINK_ENB_PDCP_TO_IP_DRIVER False ) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD True ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX False ) -set ( NAS_BUILT_IN_EPC False ) -set ( NAS_BUILT_IN_UE False ) -set ( NAS_MME False ) -set ( NAS_NETLINK False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX 2 ) -set ( NB_ANTENNAS_TX 2 ) -set ( NB_ANTENNAS_TXRX 2 ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET False ) -set ( OAI_NW_DRIVER_USE_NETLINK False ) -set ( OAISIM True ) -set ( OPENAIR1 False ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PBS_SIM False ) -set ( PC_DSP False ) -set ( PC_TARGET False ) -set ( PDCP_MSG_PRINT False ) -set ( PDCP_USE_NETLINK False ) -set ( PDCP_USE_NETLINK_QUEUES False ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION True ) -set ( PHY_CONTEXT 1 ) -set ( PHY_EMUL False ) -set ( PHYSIM False ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD False ) -set ( RLC_STOP_ON_LOST_PDU True ) -set ( RRC_ASN1_VERSION Rel10 ) -set ( RRC_DEFAULT_RAB_IS_AM False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( S1AP_LIMIT_STREAM_ID_TO_1 False ) -set ( S1AP_VERSION R10 ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( STOP_ON_IP_TRAFFIC_OVERLOAD False ) -set ( TEST_OMG False ) -set ( TRACE_RLC_AM_BO False ) -set ( TRACE_RLC_AM_FREE_SDU False ) -set ( TRACE_RLC_AM_HOLE False ) -set ( TRACE_RLC_AM_PDU True ) -set ( TRACE_RLC_AM_RESEGMENT False ) -set ( TRACE_RLC_AM_RX_DECODE False ) -set ( TRACE_RLC_AM_RX False ) -set ( TRACE_RLC_AM_STATUS_CREATION False ) -set ( TRACE_RLC_AM_TX False ) -set ( TRACE_RLC_AM_TX_STATUS False ) -set ( TRACE_RLC_PAYLOAD False ) -set ( TRACE_RLC_UM_DAR False ) -set ( TRACE_RLC_UM_DISPLAY_ASCII_DATA False ) -set ( TRACE_RLC_UM_PDU True ) -set ( TRACE_RLC_UM_RX False ) -set ( TRACE_RLC_UM_SEGMENT False ) -set ( TRACE_RLC_UM_TX_STATUS False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME False ) -set ( USER_MODE True ) -set ( XER_PRINT True ) -set ( XFORMS False ) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010108/CMakeLists.txt b/cmake_targets/autotests/010108/CMakeLists.txt deleted file mode 100644 index 7b7f743414..0000000000 --- a/cmake_targets/autotests/010108/CMakeLists.txt +++ /dev/null @@ -1,74 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set(ADDR_CONF False) -set(DEBUG_OMG False) -set(DISABLE_XER_PRINT False) -set(DRIVER2013 False) -set(ENABLE_FXP True) -set(ENABLE_ITTI True) -set(ENABLE_NAS_UE_LOGGING False) -set(ENABLE_NEW_MULTICAST True) -set(ENABLE_PGM_TRANSPORT True) -set(ENABLE_RAL False) -set(ENABLE_SECURITY False) -set(ENABLE_USE_CPU_EXECUTION_TIME True) -set(ENABLE_USE_MME False) -set(ENABLE_VCD_FIFO True) -set(HARD_RT False) -set(JUMBO_FRAME True) -set(LARGE_SCALE False) -set(LINK_ENB_PDCP_TO_GTPV1U False) -set(LINUX_LIST False) -set(LINUX True) -set(LOCALIZATION False) -set(LOG_NO_THREAD True) -set(DEADLINE_SCHEDULER False) -set(MAC_CONTEXT 1) -set(MAX_NUM_CCs 1) -set(MESSAGE_CHART_GENERATOR False) -set(MESSAGE_CHART_GENERATOR_RLC_MAC False) -set(MESSAGE_CHART_GENERATOR_PHY False) -set(MIH_C_MEDIEVAL_EXTENSIONS False) -set(MSG_PRINT False) -set(MU_RECEIVER False) -set(NAS_ADDRESS_FIX true) -set(NAS_NETLINK True) -set(NAS_UE True) -set(NEW_FFT True) -set(NO_RRM True) -set(OAI_EMU True) -set(OAI_NW_DRIVER_TYPE_ETHERNET False) -set(OPENAIR1 False) -set(OPENAIR2 True) -set(OPENAIR_EMU True) -set(OPENAIR_LTE True) -set (PACKAGE_NAME "oaisim") -set(PACKAGE_NAME "oaisim") -set(PBS_SIM False) -set(PC_DSP False) -set(PC_TARGET False) -set(PDCP_MSG_PRINT False) -set(PERFECT_CE False) -set(PHY_ABSTRACTION True) -set(PHY_ABSTRACTION True) -set(PHY_EMUL False) -set(PHYSIM False) -set(PUCCH True) -set(RANDOM_BF False) -set(RF_BOARD "NoBoard") -set(RLC_STOP_ON_LOST_PDU True) -set(RRC_ASN1_VERSION Rel10) -set(RRC_ASN1_VERSION "Rel10") -set(RRC_MSG_PRINT False) -set(RTAI False) -set(SECU False) -set(SMBV False) -set(SPECTRA False) -set(TEST_OMG False) -set(USE_3GPP_ADDR_AS_LINK_ADDR False) -set(USE_MME False) -set(USER_MODE True) -set(XER_PRINT False) -set(XFORMS False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010120/CMakeLists.txt b/cmake_targets/autotests/010120/CMakeLists.txt deleted file mode 100644 index 9ab131b7ed..0000000000 --- a/cmake_targets/autotests/010120/CMakeLists.txt +++ /dev/null @@ -1,106 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_USE_NAS False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 False ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI False ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_PGM_TRANSPORT True ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False ) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_VCD_FIFO True ) -set ( ENB_MODE True ) -set ( EPC_BUILD False ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False ) -set ( LINK_ENB_PDCP_TO_IP_DRIVER False ) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD True ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX False ) -set ( NAS_BUILT_IN_EPC False ) -set ( NAS_BUILT_IN_UE False ) -set ( NAS_MME False ) -set ( NAS_NETLINK False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX 2 ) -set ( NB_ANTENNAS_TX 2 ) -set ( NB_ANTENNAS_TXRX 2 ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET False ) -set ( OAI_NW_DRIVER_USE_NETLINK False ) -set ( OAISIM True ) -set ( OPENAIR1 False ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PBS_SIM False ) -set ( PC_DSP False ) -set ( PC_TARGET False ) -set ( PDCP_MSG_PRINT False ) -set ( PDCP_USE_NETLINK_QUEUES False ) -set ( PDCP_USE_NETLINK True ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION True ) -set ( PHY_CONTEXT 1 ) -set ( PHY_EMUL False ) -set ( PHYSIM False ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD False ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_ASN1_VERSION Rel8 ) -set ( RRC_DEFAULT_RAB_IS_AM False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( S1AP_LIMIT_STREAM_ID_TO_1 False ) -set ( S1AP_VERSION R10 ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( STOP_ON_IP_TRAFFIC_OVERLOAD False ) -set ( TEST_OMG False ) -set ( TRACE_RLC_AM_BO False ) -set ( TRACE_RLC_AM_FREE_SDU False ) -set ( TRACE_RLC_AM_HOLE False ) -set ( TRACE_RLC_AM_PDU True ) -set ( TRACE_RLC_AM_RESEGMENT False ) -set ( TRACE_RLC_AM_RX_DECODE False ) -set ( TRACE_RLC_AM_RX False ) -set ( TRACE_RLC_AM_STATUS_CREATION False ) -set ( TRACE_RLC_AM_TX False ) -set ( TRACE_RLC_AM_TX_STATUS False ) -set ( TRACE_RLC_PAYLOAD False ) -set ( TRACE_RLC_UM_DAR False ) -set ( TRACE_RLC_UM_DISPLAY_ASCII_DATA False ) -set ( TRACE_RLC_UM_PDU True ) -set ( TRACE_RLC_UM_RX False ) -set ( TRACE_RLC_UM_SEGMENT False ) -set ( TRACE_RLC_UM_TX_STATUS False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME False ) -set ( USER_MODE True ) -set ( XER_PRINT True ) -set ( XFORMS False ) -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010130/CMakeLists.txt b/cmake_targets/autotests/010130/CMakeLists.txt deleted file mode 100644 index 45c99b01ab..0000000000 --- a/cmake_targets/autotests/010130/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(ENABLE_VCD_FIFO False ) -set(ENABLE_ITTI False ) -set(RF_BOARD "ETHERNET") -set(PACKAGE_NAME "\"rrh_gw\"") -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010200/CMakeLists.template b/cmake_targets/autotests/010200/CMakeLists.template deleted file mode 100644 index be572dc6e9..0000000000 --- a/cmake_targets/autotests/010200/CMakeLists.template +++ /dev/null @@ -1,82 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI True ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_PGM_TRANSPORT True ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False) -set ( ENABLE_VCD_FIFO False ) -set ( ENB_MODE True ) -set ( EXMIMO_IOT True ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD 1 ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX True ) -set ( NAS_BUILT_IN_UE False) -set ( NAS_MME False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX "2" ) -set ( NB_ANTENNAS_TX "2" ) -set ( NB_ANTENNAS_TXRX "2" ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU True ) -set ( OAISIM True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET True ) -set ( OAI_NW_DRIVER_USE_NETLINK True ) -set ( OPENAIR1 True ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PACKAGE_NAME "oaisim" ) -set ( PBS_SIM False ) -set ( PDCP_USE_NETLINK True ) -set ( PC_DSP True ) -set ( PC_TARGET True ) -set ( PDCP_MSG_PRINT False ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION True ) -set ( PHY_CONTEXT False ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD "False" ) -set ( RRC_ASN1_VERSION "Rel10" ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( SECU False ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( TEST_OMG False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME "R10" ) -set ( USER_MODE True ) -set ( XER_PRINT False ) diff --git a/cmake_targets/autotests/010200/CMakeLists.txt b/cmake_targets/autotests/010200/CMakeLists.txt deleted file mode 100644 index c5ab0cab02..0000000000 --- a/cmake_targets/autotests/010200/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI True ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_PGM_TRANSPORT True ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False) -set ( ENABLE_VCD_FIFO False ) -set ( ENB_MODE True ) -set ( EXMIMO_IOT True ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD 1 ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX True ) -set ( NAS_BUILT_IN_UE False) -set ( NAS_MME False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX "2" ) -set ( NB_ANTENNAS_TX "2" ) -set ( NB_ANTENNAS_TXRX "2" ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU True ) -set ( OAISIM True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET True ) -set ( OAI_NW_DRIVER_USE_NETLINK True ) -set ( OPENAIR1 True ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PACKAGE_NAME "oaisim" ) -set ( PBS_SIM False ) -set ( PDCP_USE_NETLINK True ) -set ( PC_DSP True ) -set ( PC_TARGET True ) -set ( PDCP_MSG_PRINT False ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION True ) -set ( PHY_CONTEXT False ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD "False" ) -set ( RRC_ASN1_VERSION "Rel10" ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( SECU False ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( TEST_OMG False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME "R10" ) -set ( USER_MODE True ) -set ( XER_PRINT False ) -set ( XFORMS False ) -set ( PRINT_STATS False ) -set ( RRC_ASN1_VERSION "Rel10") -set ( ENABLE_VCD_FIFO False ) -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010201/CMakeLists.template b/cmake_targets/autotests/010201/CMakeLists.template deleted file mode 100644 index be572dc6e9..0000000000 --- a/cmake_targets/autotests/010201/CMakeLists.template +++ /dev/null @@ -1,82 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI True ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_PGM_TRANSPORT True ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False) -set ( ENABLE_VCD_FIFO False ) -set ( ENB_MODE True ) -set ( EXMIMO_IOT True ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD 1 ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX True ) -set ( NAS_BUILT_IN_UE False) -set ( NAS_MME False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX "2" ) -set ( NB_ANTENNAS_TX "2" ) -set ( NB_ANTENNAS_TXRX "2" ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU True ) -set ( OAISIM True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET True ) -set ( OAI_NW_DRIVER_USE_NETLINK True ) -set ( OPENAIR1 True ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PACKAGE_NAME "oaisim" ) -set ( PBS_SIM False ) -set ( PDCP_USE_NETLINK True ) -set ( PC_DSP True ) -set ( PC_TARGET True ) -set ( PDCP_MSG_PRINT False ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION True ) -set ( PHY_CONTEXT False ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD "False" ) -set ( RRC_ASN1_VERSION "Rel10" ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( SECU False ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( TEST_OMG False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME "R10" ) -set ( USER_MODE True ) -set ( XER_PRINT False ) diff --git a/cmake_targets/autotests/010201/CMakeLists.txt b/cmake_targets/autotests/010201/CMakeLists.txt deleted file mode 100644 index c5ab0cab02..0000000000 --- a/cmake_targets/autotests/010201/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI True ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_PGM_TRANSPORT True ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False) -set ( ENABLE_VCD_FIFO False ) -set ( ENB_MODE True ) -set ( EXMIMO_IOT True ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD 1 ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX True ) -set ( NAS_BUILT_IN_UE False) -set ( NAS_MME False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX "2" ) -set ( NB_ANTENNAS_TX "2" ) -set ( NB_ANTENNAS_TXRX "2" ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU True ) -set ( OAISIM True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET True ) -set ( OAI_NW_DRIVER_USE_NETLINK True ) -set ( OPENAIR1 True ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PACKAGE_NAME "oaisim" ) -set ( PBS_SIM False ) -set ( PDCP_USE_NETLINK True ) -set ( PC_DSP True ) -set ( PC_TARGET True ) -set ( PDCP_MSG_PRINT False ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION True ) -set ( PHY_CONTEXT False ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD "False" ) -set ( RRC_ASN1_VERSION "Rel10" ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( SECU False ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( TEST_OMG False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME "R10" ) -set ( USER_MODE True ) -set ( XER_PRINT False ) -set ( XFORMS False ) -set ( PRINT_STATS False ) -set ( RRC_ASN1_VERSION "Rel10") -set ( ENABLE_VCD_FIFO False ) -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010202/CMakeLists.txt b/cmake_targets/autotests/010202/CMakeLists.txt deleted file mode 100644 index c5ab0cab02..0000000000 --- a/cmake_targets/autotests/010202/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI True ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_PGM_TRANSPORT True ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False) -set ( ENABLE_VCD_FIFO False ) -set ( ENB_MODE True ) -set ( EXMIMO_IOT True ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD 1 ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX True ) -set ( NAS_BUILT_IN_UE False) -set ( NAS_MME False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX "2" ) -set ( NB_ANTENNAS_TX "2" ) -set ( NB_ANTENNAS_TXRX "2" ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU True ) -set ( OAISIM True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET True ) -set ( OAI_NW_DRIVER_USE_NETLINK True ) -set ( OPENAIR1 True ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PACKAGE_NAME "oaisim" ) -set ( PBS_SIM False ) -set ( PDCP_USE_NETLINK True ) -set ( PC_DSP True ) -set ( PC_TARGET True ) -set ( PDCP_MSG_PRINT False ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION True ) -set ( PHY_CONTEXT False ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD "False" ) -set ( RRC_ASN1_VERSION "Rel10" ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( SECU False ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( TEST_OMG False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME "R10" ) -set ( USER_MODE True ) -set ( XER_PRINT False ) -set ( XFORMS False ) -set ( PRINT_STATS False ) -set ( RRC_ASN1_VERSION "Rel10") -set ( ENABLE_VCD_FIFO False ) -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010203/CMakeLists.txt b/cmake_targets/autotests/010203/CMakeLists.txt deleted file mode 100644 index c5ab0cab02..0000000000 --- a/cmake_targets/autotests/010203/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI True ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_PGM_TRANSPORT True ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False) -set ( ENABLE_VCD_FIFO False ) -set ( ENB_MODE True ) -set ( EXMIMO_IOT True ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD 1 ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX True ) -set ( NAS_BUILT_IN_UE False) -set ( NAS_MME False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX "2" ) -set ( NB_ANTENNAS_TX "2" ) -set ( NB_ANTENNAS_TXRX "2" ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU True ) -set ( OAISIM True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET True ) -set ( OAI_NW_DRIVER_USE_NETLINK True ) -set ( OPENAIR1 True ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PACKAGE_NAME "oaisim" ) -set ( PBS_SIM False ) -set ( PDCP_USE_NETLINK True ) -set ( PC_DSP True ) -set ( PC_TARGET True ) -set ( PDCP_MSG_PRINT False ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION True ) -set ( PHY_CONTEXT False ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD "False" ) -set ( RRC_ASN1_VERSION "Rel10" ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( SECU False ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( TEST_OMG False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME "R10" ) -set ( USER_MODE True ) -set ( XER_PRINT False ) -set ( XFORMS False ) -set ( PRINT_STATS False ) -set ( RRC_ASN1_VERSION "Rel10") -set ( ENABLE_VCD_FIFO False ) -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010204/CMakeLists.txt b/cmake_targets/autotests/010204/CMakeLists.txt deleted file mode 100644 index c5ab0cab02..0000000000 --- a/cmake_targets/autotests/010204/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI True ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_PGM_TRANSPORT True ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False) -set ( ENABLE_VCD_FIFO False ) -set ( ENB_MODE True ) -set ( EXMIMO_IOT True ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD 1 ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX True ) -set ( NAS_BUILT_IN_UE False) -set ( NAS_MME False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX "2" ) -set ( NB_ANTENNAS_TX "2" ) -set ( NB_ANTENNAS_TXRX "2" ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU True ) -set ( OAISIM True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET True ) -set ( OAI_NW_DRIVER_USE_NETLINK True ) -set ( OPENAIR1 True ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PACKAGE_NAME "oaisim" ) -set ( PBS_SIM False ) -set ( PDCP_USE_NETLINK True ) -set ( PC_DSP True ) -set ( PC_TARGET True ) -set ( PDCP_MSG_PRINT False ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION True ) -set ( PHY_CONTEXT False ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD "False" ) -set ( RRC_ASN1_VERSION "Rel10" ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( SECU False ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( TEST_OMG False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME "R10" ) -set ( USER_MODE True ) -set ( XER_PRINT False ) -set ( XFORMS False ) -set ( PRINT_STATS False ) -set ( RRC_ASN1_VERSION "Rel10") -set ( ENABLE_VCD_FIFO False ) -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010205/CMakeLists.txt b/cmake_targets/autotests/010205/CMakeLists.txt deleted file mode 100644 index c5ab0cab02..0000000000 --- a/cmake_targets/autotests/010205/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI True ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_PGM_TRANSPORT True ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False) -set ( ENABLE_VCD_FIFO False ) -set ( ENB_MODE True ) -set ( EXMIMO_IOT True ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD 1 ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX True ) -set ( NAS_BUILT_IN_UE False) -set ( NAS_MME False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX "2" ) -set ( NB_ANTENNAS_TX "2" ) -set ( NB_ANTENNAS_TXRX "2" ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU True ) -set ( OAISIM True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET True ) -set ( OAI_NW_DRIVER_USE_NETLINK True ) -set ( OPENAIR1 True ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PACKAGE_NAME "oaisim" ) -set ( PBS_SIM False ) -set ( PDCP_USE_NETLINK True ) -set ( PC_DSP True ) -set ( PC_TARGET True ) -set ( PDCP_MSG_PRINT False ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION True ) -set ( PHY_CONTEXT False ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD "False" ) -set ( RRC_ASN1_VERSION "Rel10" ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( SECU False ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( TEST_OMG False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME "R10" ) -set ( USER_MODE True ) -set ( XER_PRINT False ) -set ( XFORMS False ) -set ( PRINT_STATS False ) -set ( RRC_ASN1_VERSION "Rel10") -set ( ENABLE_VCD_FIFO False ) -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010300/CMakeLists.txt b/cmake_targets/autotests/010300/CMakeLists.txt deleted file mode 100644 index 36a9eb75da..0000000000 --- a/cmake_targets/autotests/010300/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER Flase) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010301/CMakeLists.txt b/cmake_targets/autotests/010301/CMakeLists.txt deleted file mode 100644 index 36a9eb75da..0000000000 --- a/cmake_targets/autotests/010301/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER Flase) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010302/CMakeLists.txt b/cmake_targets/autotests/010302/CMakeLists.txt deleted file mode 100644 index 36a9eb75da..0000000000 --- a/cmake_targets/autotests/010302/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER Flase) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010303/CMakeLists.txt b/cmake_targets/autotests/010303/CMakeLists.txt deleted file mode 100644 index 36a9eb75da..0000000000 --- a/cmake_targets/autotests/010303/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER Flase) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010304/CMakeLists.txt b/cmake_targets/autotests/010304/CMakeLists.txt deleted file mode 100644 index 36a9eb75da..0000000000 --- a/cmake_targets/autotests/010304/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER Flase) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010305/CMakeLists.txt b/cmake_targets/autotests/010305/CMakeLists.txt deleted file mode 100644 index 36a9eb75da..0000000000 --- a/cmake_targets/autotests/010305/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER Flase) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010400/CMakeLists.txt b/cmake_targets/autotests/010400/CMakeLists.txt deleted file mode 100644 index c5ab0cab02..0000000000 --- a/cmake_targets/autotests/010400/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI True ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_PGM_TRANSPORT True ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False) -set ( ENABLE_VCD_FIFO False ) -set ( ENB_MODE True ) -set ( EXMIMO_IOT True ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD 1 ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX True ) -set ( NAS_BUILT_IN_UE False) -set ( NAS_MME False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX "2" ) -set ( NB_ANTENNAS_TX "2" ) -set ( NB_ANTENNAS_TXRX "2" ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU True ) -set ( OAISIM True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET True ) -set ( OAI_NW_DRIVER_USE_NETLINK True ) -set ( OPENAIR1 True ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PACKAGE_NAME "oaisim" ) -set ( PBS_SIM False ) -set ( PDCP_USE_NETLINK True ) -set ( PC_DSP True ) -set ( PC_TARGET True ) -set ( PDCP_MSG_PRINT False ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION True ) -set ( PHY_CONTEXT False ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD "False" ) -set ( RRC_ASN1_VERSION "Rel10" ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( SECU False ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( TEST_OMG False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME "R10" ) -set ( USER_MODE True ) -set ( XER_PRINT False ) -set ( XFORMS False ) -set ( PRINT_STATS False ) -set ( RRC_ASN1_VERSION "Rel10") -set ( ENABLE_VCD_FIFO False ) -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010401/CMakeLists.txt b/cmake_targets/autotests/010401/CMakeLists.txt deleted file mode 100644 index c5ab0cab02..0000000000 --- a/cmake_targets/autotests/010401/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI True ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_PGM_TRANSPORT True ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False) -set ( ENABLE_VCD_FIFO False ) -set ( ENB_MODE True ) -set ( EXMIMO_IOT True ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD 1 ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX True ) -set ( NAS_BUILT_IN_UE False) -set ( NAS_MME False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX "2" ) -set ( NB_ANTENNAS_TX "2" ) -set ( NB_ANTENNAS_TXRX "2" ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU True ) -set ( OAISIM True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET True ) -set ( OAI_NW_DRIVER_USE_NETLINK True ) -set ( OPENAIR1 True ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PACKAGE_NAME "oaisim" ) -set ( PBS_SIM False ) -set ( PDCP_USE_NETLINK True ) -set ( PC_DSP True ) -set ( PC_TARGET True ) -set ( PDCP_MSG_PRINT False ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION True ) -set ( PHY_CONTEXT False ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD "False" ) -set ( RRC_ASN1_VERSION "Rel10" ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( SECU False ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( TEST_OMG False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME "R10" ) -set ( USER_MODE True ) -set ( XER_PRINT False ) -set ( XFORMS False ) -set ( PRINT_STATS False ) -set ( RRC_ASN1_VERSION "Rel10") -set ( ENABLE_VCD_FIFO False ) -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010402/CMakeLists.txt b/cmake_targets/autotests/010402/CMakeLists.txt deleted file mode 100644 index c5ab0cab02..0000000000 --- a/cmake_targets/autotests/010402/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI True ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_PGM_TRANSPORT True ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False) -set ( ENABLE_VCD_FIFO False ) -set ( ENB_MODE True ) -set ( EXMIMO_IOT True ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD 1 ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX True ) -set ( NAS_BUILT_IN_UE False) -set ( NAS_MME False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX "2" ) -set ( NB_ANTENNAS_TX "2" ) -set ( NB_ANTENNAS_TXRX "2" ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU True ) -set ( OAISIM True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET True ) -set ( OAI_NW_DRIVER_USE_NETLINK True ) -set ( OPENAIR1 True ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PACKAGE_NAME "oaisim" ) -set ( PBS_SIM False ) -set ( PDCP_USE_NETLINK True ) -set ( PC_DSP True ) -set ( PC_TARGET True ) -set ( PDCP_MSG_PRINT False ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION True ) -set ( PHY_CONTEXT False ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD "False" ) -set ( RRC_ASN1_VERSION "Rel10" ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( SECU False ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( TEST_OMG False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME "R10" ) -set ( USER_MODE True ) -set ( XER_PRINT False ) -set ( XFORMS False ) -set ( PRINT_STATS False ) -set ( RRC_ASN1_VERSION "Rel10") -set ( ENABLE_VCD_FIFO False ) -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/010403/CMakeLists.txt b/cmake_targets/autotests/010403/CMakeLists.txt deleted file mode 100644 index c5ab0cab02..0000000000 --- a/cmake_targets/autotests/010403/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) -set ( ADDR_CONF False ) -set ( DEBUG_OMG False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( EMOS False ) -set ( ENABLE_FXP True ) -set ( ENABLE_ITTI True ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_PGM_TRANSPORT True ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False) -set ( ENABLE_VCD_FIFO False ) -set ( ENB_MODE True ) -set ( EXMIMO_IOT True ) -set ( HARD_RT False ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD 1 ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MIH_C_MEDIEVAL_EXTENSIONS False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX True ) -set ( NAS_BUILT_IN_UE False) -set ( NAS_MME False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX "2" ) -set ( NB_ANTENNAS_TX "2" ) -set ( NB_ANTENNAS_TXRX "2" ) -set ( NEW_FFT True ) -set ( NO_RRM True ) -set ( OAI_EMU True ) -set ( OAISIM True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET True ) -set ( OAI_NW_DRIVER_USE_NETLINK True ) -set ( OPENAIR1 True ) -set ( OPENAIR2 True ) -set ( OPENAIR_EMU False ) -set ( OPENAIR_LTE True ) -set ( PACKAGE_NAME "oaisim" ) -set ( PBS_SIM False ) -set ( PDCP_USE_NETLINK True ) -set ( PC_DSP True ) -set ( PC_TARGET True ) -set ( PDCP_MSG_PRINT False ) -set ( PERFECT_CE False ) -set ( PHY_ABSTRACTION True ) -set ( PHY_CONTEXT False ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( PUCCH True ) -set ( RANDOM_BF False ) -set ( RF_BOARD "False" ) -set ( RRC_ASN1_VERSION "Rel10" ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_MSG_PRINT False ) -set ( RTAI False ) -set ( SECU False ) -set ( SMBV False ) -set ( SPECTRA False ) -set ( TEST_OMG False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME "R10" ) -set ( USER_MODE True ) -set ( XER_PRINT False ) -set ( XFORMS False ) -set ( PRINT_STATS False ) -set ( RRC_ASN1_VERSION "Rel10") -set ( ENABLE_VCD_FIFO False ) -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/015000/CMakeLists.txt b/cmake_targets/autotests/015000/CMakeLists.txt deleted file mode 100644 index 47cf5074b5..0000000000 --- a/cmake_targets/autotests/015000/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER False) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/015001/CMakeLists.txt b/cmake_targets/autotests/015001/CMakeLists.txt deleted file mode 100644 index 47cf5074b5..0000000000 --- a/cmake_targets/autotests/015001/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER False) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/015002/CMakeLists.txt b/cmake_targets/autotests/015002/CMakeLists.txt deleted file mode 100644 index 47cf5074b5..0000000000 --- a/cmake_targets/autotests/015002/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER False) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/015003/CMakeLists.txt b/cmake_targets/autotests/015003/CMakeLists.txt deleted file mode 100644 index 47cf5074b5..0000000000 --- a/cmake_targets/autotests/015003/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER False) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/015004/CMakeLists.txt b/cmake_targets/autotests/015004/CMakeLists.txt deleted file mode 100644 index 47cf5074b5..0000000000 --- a/cmake_targets/autotests/015004/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER False) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/015005/CMakeLists.txt b/cmake_targets/autotests/015005/CMakeLists.txt deleted file mode 100644 index 47cf5074b5..0000000000 --- a/cmake_targets/autotests/015005/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER False) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/015006/CMakeLists.txt b/cmake_targets/autotests/015006/CMakeLists.txt deleted file mode 100644 index 47cf5074b5..0000000000 --- a/cmake_targets/autotests/015006/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER False) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/015007/CMakeLists.txt b/cmake_targets/autotests/015007/CMakeLists.txt deleted file mode 100644 index 47cf5074b5..0000000000 --- a/cmake_targets/autotests/015007/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER False) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/015008/CMakeLists.txt b/cmake_targets/autotests/015008/CMakeLists.txt deleted file mode 100644 index 47cf5074b5..0000000000 --- a/cmake_targets/autotests/015008/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER False) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/015009/CMakeLists.txt b/cmake_targets/autotests/015009/CMakeLists.txt deleted file mode 100644 index 47cf5074b5..0000000000 --- a/cmake_targets/autotests/015009/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER False) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/015100/CMakeLists.txt b/cmake_targets/autotests/015100/CMakeLists.txt deleted file mode 100644 index 47cf5074b5..0000000000 --- a/cmake_targets/autotests/015100/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER False) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) diff --git a/cmake_targets/autotests/015101/CMakeLists.txt b/cmake_targets/autotests/015101/CMakeLists.txt deleted file mode 100644 index 47cf5074b5..0000000000 --- a/cmake_targets/autotests/015101/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(PACKAGE_NAME "unitary_tests_simulators") -set(PHYSIM True) -set(RF_BOARD None) -set(XFORMS False) - -set(DEBUG_PHY False) -set(MU_RECIEVER False) -set(RANDOM_BF False) -set(PBS_SIM False) -set(PERFECT_CE False) -set(NAS_UE False) -set(MESSAGE_CHART_GENERATOR False) - -include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt) From 6bb5ed5cf608d425ea68b823bb39cb9916543995 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Sat, 4 Jun 2016 00:21:42 +0200 Subject: [PATCH 200/214] warning removal --- openair1/SCHED/phy_mac_stub.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/openair1/SCHED/phy_mac_stub.c b/openair1/SCHED/phy_mac_stub.c index 3620b8bf27..7a8944b1b1 100644 --- a/openair1/SCHED/phy_mac_stub.c +++ b/openair1/SCHED/phy_mac_stub.c @@ -51,7 +51,6 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_eNB) { - int i; //uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag; uint8_t transmission_mode = phy_vars_eNB->transmission_mode[0]; @@ -583,7 +582,6 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eNB) { - int i; //uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag; uint8_t transmission_mode = phy_vars_eNB->transmission_mode[0]; From 7de74e858ef06d0615106851611005c73a8eaeec Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Sun, 5 Jun 2016 16:11:41 +0200 Subject: [PATCH 201/214] Gitlab CI: minor fixes --- .../autotests/run_exec_lte-softmodem_tests.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py index e0a3b31381..f387cce170 100755 --- a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py +++ b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py @@ -29,10 +29,7 @@ # *******************************************************************************/ -# \file test01.py -# \brief test 01 for OAI -# \author Navid Nikaein -# \date 2013 - 2015 +# \author Rohit Gupta # \version 0.1 # @ingroup _test @@ -1529,9 +1526,8 @@ for testcase in testcaseList: print "Now copying files to NFS Share" oai_localhost = openair('localdomain','localhost') oai_localhost.connect(user,pw) - cmd = ' rm -fr ' + NFSTestsResultsDir + ' ; mkdir -p ' + NFSTestsResultsDir + cmd = ' mkdir -p ' + NFSTestsResultsDir res = oai_localhost.send_recv(cmd) - print "Deleting NFSTestResults Dir..." + res print "Copying files from GilabCI Runner Machine : " + host + " .locallogdir = " + locallogdir + ", NFSTestsResultsDir = " + NFSTestsResultsDir SSHSessionWrapper('localhost', user, None, pw , NFSTestsResultsDir , locallogdir, "put_all") @@ -1568,12 +1564,15 @@ res=os.system(cmd) print "Now copying files to NFS Share" oai_localhost = openair('localdomain','localhost') oai_localhost.connect(user,pw) -cmd = ' rm -fr ' + NFSTestsResultsDir + ' ; mkdir -p ' + NFSTestsResultsDir +cmd = 'mkdir -p ' + NFSTestsResultsDir res = oai_localhost.send_recv(cmd) -print "Deleting NFSTestResults Dir..." + res print "Copying files from GilabCI Runner Machine : " + host + " .locallogdir = " + locallogdir + ", NFSTestsResultsDir = " + NFSTestsResultsDir SSHSessionWrapper('localhost', user, None, pw , NFSTestsResultsDir , locallogdir, "put_all") + +cmd = "cat " + NFSTestsResultsDir + "/log/*/*.xml > " + NFSTestsResultsDir + "/log/results_autotests.xml" +res = oai_localhost.send_recv(cmd) + oai_localhost.disconnect() sys.exit() From ed852796ba4a25eef29cd89cf128b82a367ba54b Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Sun, 5 Jun 2016 21:21:14 +0200 Subject: [PATCH 202/214] Gitlab CI: minor fix to iperf3 script --- cmake_targets/autotests/tools/iperf3_script_phone | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake_targets/autotests/tools/iperf3_script_phone b/cmake_targets/autotests/tools/iperf3_script_phone index eff4105d03..c191f72ec3 100755 --- a/cmake_targets/autotests/tools/iperf3_script_phone +++ b/cmake_targets/autotests/tools/iperf3_script_phone @@ -32,7 +32,7 @@ #arg1 timeout to wait before running the script #arg2 interface -#arg3 iperf arguments +#arg3 iperf3 arguments args=($*) timeout=${args[0]} @@ -43,7 +43,7 @@ iperf3_args=(${args[@]:2}) echo "args = ${args[@]}" echo "timeout = $timeout" echo "device_id = $device_id" -echo "iperf_args = ${iperf_args[@]}" +echo "iperf3_args = ${iperf3_args[@]}" sleep $timeout @@ -58,6 +58,6 @@ while true ; do fi done -echo "Starting iperf now..." +echo "Starting iperf3 now..." -sudo adb -s $device_id shell /data/local/tmp/iperf3 ${iperf_args[@]} +sudo adb -s $device_id shell /data/local/tmp/iperf3 ${iperf3_args[@]} From 659ee132017eb98ef0c64fa99ecd1268aed8b4fd Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Sun, 5 Jun 2016 22:14:46 +0200 Subject: [PATCH 203/214] minor fix to reset script for Sony Experia --- .../autotests/tools/configure_cots_sony_experia_m4_ue.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py b/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py index eba3156976..5d0bd220b8 100755 --- a/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py @@ -43,7 +43,8 @@ def kill_processes(name): cmd = 'sudo adb -s ' + device_id +' shell "ps |grep ' + name + '"' status, out = commands.getstatusoutput(cmd) if status != 0: - print "Error execting command to kill process " + name + print "Error executing command to kill process " + name + print "Error =" + out sys.exit(1) print "Out = " + out if out=='': From faf58fcec8ac3b2fa165a754d748bdef936aef44 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 6 Jun 2016 01:17:17 +0200 Subject: [PATCH 204/214] Gitlab CI: fixes for Sony Experia M4 --- cmake_targets/autotests/test_case_list.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index fa2f085564..59ccf05346 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -6146,7 +6146,7 @@ c $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m - throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec + throughput_test min=5.0Mbits/sec max=5.0Mbits/sec average=5.0Mbits/sec False USRPb210.ALU_EPC.SonyExperiaM4.5MHz.FDD.Band_7.UL.1TX.1RX @@ -6199,7 +6199,7 @@ c sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 20Mbits/s -B 192.172.0.2 @@ -6221,7 +6221,7 @@ c $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m - throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec + throughput_test min=10.0Mbits/sec max=10.0Mbits/sec average=10.0Mbits/sec False USRPb210.ALU_EPC.SonyExperiaM4.10MHz.FDD.Band_7.UL.1TX.1RX @@ -6347,7 +6347,7 @@ c sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -s -i 1 -u -f m -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script_phone 1 YT9115PX1E -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 10M -R throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec @@ -6368,7 +6368,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s + $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m False @@ -6421,7 +6421,7 @@ c sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1 -u -f m -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script_phone 1 YT9115PX1E -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 20M -R throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec @@ -6442,7 +6442,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 15Mbits/s + $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m False From 9b9f068224ec75a2b5f8535527c245e3fe93b269 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 6 Jun 2016 20:06:29 +0200 Subject: [PATCH 205/214] Gitlab CI: fix for killing iperf3 --- .../autotests/tools/configure_cots_sony_experia_m4_ue.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py b/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py index 5d0bd220b8..79fef06ee9 100755 --- a/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py @@ -63,6 +63,7 @@ def start_ue () : #print 'Enter your commands below.\r\nInsert "exit" to leave the application.' print 'Killing old iperf/ping sessions' kill_processes('iperf') + kill_processes('iperf3') kill_processes('ping') print "Turning off airplane mode" os.system('sudo -E adb devices') From 4a024f310de8a42fdb2e8638d7e29a75304aca1e Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 6 Jun 2016 20:18:34 +0200 Subject: [PATCH 206/214] send kill signal to iperf3 --- .../autotests/tools/configure_cots_sony_experia_m4_ue.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py b/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py index 79fef06ee9..c136067a61 100755 --- a/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py @@ -52,7 +52,7 @@ def kill_processes(name): out_arr = out.split() pid_to_kill = out_arr[1] print "Now killing process ID " + pid_to_kill + " on Phone" - cmd = 'sudo adb -s ' + device_id +' shell "kill ' + pid_to_kill + '"' + cmd = 'sudo adb -s ' + device_id +' shell "kill -9 ' + pid_to_kill + '"' status, out = commands.getstatusoutput(cmd) if status != 0: print "Error execting command to kill process " + name @@ -95,6 +95,7 @@ def stop_ue(): os.system('sudo adb -s ' + device_id + ' shell \"settings put global airplane_mode_on 1; am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true\" ') print "Killing iperf/ping sessions" kill_processes('iperf') + kill_processes('iperf3') kill_processes('ping') i=1 From 21155366eb03016056c2e4155e4ba930e8d67cb9 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 6 Jun 2016 20:20:17 +0200 Subject: [PATCH 207/214] Gitlab CI: send kill signal for previously running programs --- cmake_targets/autotests/run_exec_lte-softmodem_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py index f387cce170..77c3006fea 100755 --- a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py +++ b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py @@ -313,7 +313,7 @@ def SSHSessionWrapper(machine, username, key_file, password, logdir_remote, logd # \param CleanUpAluLteBox program to terminate AlU Bell Labs LTE Box # \param ExmimoRfStop String to stop EXMIMO card (specified in test_case_list.xml) def cleanOldPrograms(oai, programList, CleanUpAluLteBox, ExmimoRfStop): - cmd = 'killall -q -r ' + programList + cmd = 'killall -9 -q -r ' + programList result = oai.send(cmd, True) print "Killing old programs..." + result programArray = programList.split() From 5967d44ff952fcc7d8e75c77210b2dd388a0b25f Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 6 Jun 2016 21:13:30 +0200 Subject: [PATCH 208/214] Gitlab CI: add debugging info to gitlab logging --- .gitlab-ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d4377fc324..d35de04b12 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,3 +32,8 @@ job1: - sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $NFS_TEST_RESULTS_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$NFS_TEST_RESULTS_DIR - sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $EXTERNAL_SHARE_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$EXTERNAL_SHARE_DIR - cat $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml + - exce_log=`egrep -i 'warning|error|critical|exception' $NFS_TEST_RESULTS_DIR/log/python_autotest.log ` + - if [ -n "$exce_log" ]; then echo -e "\e[31mThere are errors in $NFS_TEST_RESULTS_DIR/log/python_autotest.log. Please check the logs\e[0m" ; fi + - exce_log=`egrep -i 'warning|error|critical|exception' $NFS_TEST_RESULTS_DIR/log/python_autotest_cleanup.log ` + - if [ -n "$exce_log" ]; then echo -e "\e[31mThere are errors in $NFS_TEST_RESULTS_DIR/log/python_autotest_cleanup.log. Please check the logs\e[0m" ; fi + From bc4bd8200f72679d124bbf3a050fe02b960ba0f6 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 7 Jun 2016 17:04:07 +0200 Subject: [PATCH 209/214] Fix for RRH Config file (10MHz) --- .../CONF/enb.band7.tm1.50PRB.rrh.usrpb210.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.usrpb210.conf index 004af14749..434dd056b4 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.usrpb210.conf @@ -151,7 +151,7 @@ rrh_gw_config = ( tr_preference = "raw"; rf_preference = "usrp_b200"; iq_txshift = 4; - tx_sample_advance = 113; + tx_sample_advance = 103; tx_scheduling_advance = 9; } @@ -185,4 +185,4 @@ rrh_gw_config = ( rrc_log_verbosity ="medium"; }; } -); +); \ No newline at end of file From eade3fe8d0744f067e90e1135c664d047490081f Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 7 Jun 2016 17:05:38 +0200 Subject: [PATCH 210/214] Fix for RRH Config file (5MHz) --- .../GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf index f4818eab9d..894781fdfd 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf @@ -163,7 +163,7 @@ eNBs = tr_preference = "raw"; rf_preference = "usrp_b200"; iq_txshift = 4; - tx_sample_advance = 70; + tx_sample_advance = 80; tx_scheduling_advance = 9; } ); @@ -186,4 +186,4 @@ eNBs = rrc_log_verbosity ="medium"; }; } -); +); \ No newline at end of file From 32c45ad51703b2b2a094ce21b3b5d60637fc058c Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Wed, 8 Jun 2016 01:59:43 +0200 Subject: [PATCH 211/214] Gitlab CI: updates to config file --- cmake_targets/autotests/test_case_list.xml | 64 +++++++++++----------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 59ccf05346..0104e912f9 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -6,7 +6,7 @@ https://gitlab.eurecom.fr/oai/openair-cn.git develop develop - oaisim oaisim_nos1 lte-softmodem lte-softmodem-nos1 mme_gw run_epc auth_request run_hss oai_hss mme spgw hss hss_sim configure_cots* wvdial iperf iperf_script ping tshark rrh_gw + oaisim oaisim_nos1 lte-softmodem lte-softmodem-nos1 mme_gw run_epc auth_request run_hss oai_hss mme spgw hss hss_sim configure_cots* wvdial iperf iperf_script iperf_script_phone ping tshark rrh_gw iperf3 iperf3_script iperf3_script_phone sudo -S -E /opt/ltebox/tools/stop_ltebox $OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue; uname -a; sudo -E dmesg 36000 @@ -916,7 +916,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/s -B 192.172.0.2 @@ -991,7 +991,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/s -B 192.172.0.2 @@ -1139,7 +1139,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 10M -R False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue @@ -1159,7 +1159,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s + $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m False @@ -1211,7 +1211,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 30M -R throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec @@ -1232,7 +1232,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s + $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m False @@ -1806,7 +1806,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/s -B 192.172.0.2 @@ -1890,7 +1890,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/s -B 192.172.0.2 @@ -2310,7 +2310,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/s -B 192.172.0.2 @@ -2404,7 +2404,7 @@ c $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/s -B 192.172.0.2 @@ -2871,7 +2871,7 @@ c $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/s -B 192.172.0.2 @@ -2891,7 +2891,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -f m -u throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec @@ -2943,7 +2943,7 @@ c $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/s -B 192.172.0.2 @@ -3087,7 +3087,7 @@ c $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 10M -R False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue @@ -3107,7 +3107,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s + $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m False @@ -3158,7 +3158,7 @@ c $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 20M -R False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue @@ -3178,7 +3178,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s + $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m False @@ -3790,7 +3790,7 @@ c $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/s -B 192.172.0.2 @@ -3863,7 +3863,7 @@ c $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/s -B 192.172.0.2 @@ -4007,7 +4007,7 @@ c $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 10M -R False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue @@ -4027,7 +4027,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s + $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m False @@ -4078,7 +4078,7 @@ c $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 20M -R False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue @@ -4098,7 +4098,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s + $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m False @@ -6124,7 +6124,7 @@ c sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 7Mbits/s -B 192.172.0.2 @@ -6199,7 +6199,7 @@ c sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 20Mbits/s -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 14Mbits/s -B 192.172.0.2 @@ -6347,7 +6347,7 @@ c sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script_phone 1 YT9115PX1E -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 10M -R + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1 -u -f m throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec @@ -6368,7 +6368,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 65 lo -c 192.172.0.2 -b 10Mbits/s -i 1 -f m -u False @@ -6421,7 +6421,7 @@ c sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script_phone 1 YT9115PX1E -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 20M -R + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1 -u -f m throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec @@ -6442,7 +6442,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 65 lo -c 192.172.0.2 -b 20Mbits/s -i 1 -f m -u False @@ -6495,7 +6495,7 @@ c sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1 -u -f m -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1 -u -f m throughput_test min=10.0Mbits/sec max=10.0Mbits/sec average=10.0Mbits/sec @@ -6516,7 +6516,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 15Mbits/s + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 65 lo -c 192.172.0.2 -b 40Mbits/s -i 1 -f m -u False From d350ee329d653a2304d4dd99b1e772f2ce82d1f3 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Wed, 8 Jun 2016 12:25:07 +0200 Subject: [PATCH 212/214] improve the use of the variable "frame" in oaisim --- targets/SIMU/USER/oaisim.c | 69 ++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 37 deletions(-) diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c index 8a5d23afac..63d13f20fc 100644 --- a/targets/SIMU/USER/oaisim.c +++ b/targets/SIMU/USER/oaisim.c @@ -608,8 +608,9 @@ l2l1_task (void *args_p) start_meas (&oaisim_stats); for (frame = 0; - (l2l1_state != L2L1_TERMINATED) - && (frame < oai_emulation.info.n_frames); + (l2l1_state != L2L1_TERMINATED) && + ((oai_emulation.info.n_frames_flag == 0) || + (frame < oai_emulation.info.n_frames)); frame++) { #if defined(ENABLE_ITTI) @@ -671,12 +672,6 @@ l2l1_task (void *args_p) //oai_emulation.info.time_ms += 1; oai_emulation.info.time_s += 0.01; // emu time in s, each frame lasts for 10 ms // JNote: TODO check the coherency of the time and frame (I corrected it to 10 (instead of 0.01) - // if n_frames not set by the user or is greater than max num frame then set adjust the frame counter - if ((oai_emulation.info.n_frames_flag == 0) - || (oai_emulation.info.n_frames >= 0xffff)) { - frame %= (oai_emulation.info.n_frames - 1); - } - update_omg (frame); // frequency is defined in the omg_global params configurable by the user update_omg_ocm (); @@ -708,7 +703,7 @@ l2l1_task (void *args_p) wait_for_slot_isr (); #if defined(ENABLE_ITTI) - itti_update_lte_time(frame, slot); + itti_update_lte_time(frame % MAX_FRAME_NUMBER, slot); #endif last_slot = (slot - 1) % 20; @@ -748,7 +743,7 @@ l2l1_task (void *args_p) LOG_D(EMU, "PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d) TDD %d/%d Nid_cell %d\n", eNB_inst, - frame, + frame % MAX_FRAME_NUMBER, slot, PHY_vars_eNB_g[eNB_inst][0]->proc[slot >> 1].subframe_tx, PHY_vars_eNB_g[eNB_inst][0]->proc[slot >> 1].subframe_rx, @@ -823,27 +818,27 @@ l2l1_task (void *args_p) { LOG_D(EMU, "PHY procedures UE %d for frame %d, slot %d (subframe TX %d, RX %d)\n", - UE_inst, frame, slot, next_slot >> 1, + UE_inst, frame % MAX_FRAME_NUMBER, slot, next_slot >> 1, last_slot >> 1); if (PHY_vars_UE_g[UE_inst][0]->UE_mode[0] != NOT_SYNCHED) { if (frame > 0) { - PHY_vars_UE_g[UE_inst][0]->frame_rx = frame; + PHY_vars_UE_g[UE_inst][0]->frame_rx = frame % MAX_FRAME_NUMBER; PHY_vars_UE_g[UE_inst][0]->slot_rx = last_slot; PHY_vars_UE_g[UE_inst][0]->slot_tx = next_slot; if (next_slot > 1) - PHY_vars_UE_g[UE_inst][0]->frame_tx = frame; + PHY_vars_UE_g[UE_inst][0]->frame_tx = frame % MAX_FRAME_NUMBER; else - PHY_vars_UE_g[UE_inst][0]->frame_tx = frame + 1; + PHY_vars_UE_g[UE_inst][0]->frame_tx = (frame + 1) % MAX_FRAME_NUMBER; #ifdef OPENAIR2 //Application update_otg_UE (UE_inst, oai_emulation.info.time_ms); //Access layer - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE_inst, 0, ENB_FLAG_NO, NOT_A_RNTI, frame, next_slot); + PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE_inst, 0, ENB_FLAG_NO, NOT_A_RNTI, frame % MAX_FRAME_NUMBER, next_slot); pdcp_run (&ctxt); #endif @@ -895,7 +890,7 @@ l2l1_task (void *args_p) if(last_slot==2 && frame%10==0) { if (UE_stats_th[UE_inst]) { - fprintf(UE_stats_th[UE_inst],"%d %d\n",frame, PHY_vars_UE_g[UE_inst][0]->bitrate[0]/1000); + fprintf(UE_stats_th[UE_inst],"%d %d\n",frame % MAX_FRAME_NUMBER, PHY_vars_UE_g[UE_inst][0]->bitrate[0]/1000); } } @@ -929,7 +924,7 @@ l2l1_task (void *args_p) exit(-1); } - PHY_vars_RN_g[RN_id]->frame = frame; + PHY_vars_RN_g[RN_id]->frame = frame % MAX_FRAME_NUMBER; if ( oai_emulation.info.frame_type == 0) { // RN == UE @@ -937,12 +932,12 @@ l2l1_task (void *args_p) if (PHY_vars_UE_g[UE_inst][0]->UE_mode[0] != NOT_SYNCHED) { LOG_D(EMU,"[RN %d] PHY procedures UE %d for frame %d, slot %d (subframe TX %d, RX %d)\n", RN_id, UE_inst, frame, slot, next_slot >> 1,last_slot>>1); - PHY_vars_UE_g[UE_inst][0]->frame_rx = frame; + PHY_vars_UE_g[UE_inst][0]->frame_rx = frame % MAX_FRAME_NUMBER; PHY_vars_UE_g[UE_inst][0]->slot_rx = last_slot; PHY_vars_UE_g[UE_inst][0]->slot_tx = next_slot; - if (next_slot>1) PHY_vars_UE_g[UE_inst][0]->frame_tx = frame; - else PHY_vars_UE_g[UE_inst][0]->frame_tx = frame+1; + if (next_slot>1) PHY_vars_UE_g[UE_inst][0]->frame_tx = frame % MAX_FRAME_NUMBER; + else PHY_vars_UE_g[UE_inst][0]->frame_tx = (frame+1) % MAX_FRAME_NUMBER; phy_procedures_UE_lte (PHY_vars_UE_g[UE_inst][0], 0, abstraction_flag,normal_txrx, r_type, PHY_vars_RN_g[RN_id]); @@ -953,7 +948,7 @@ l2l1_task (void *args_p) // RN == eNB LOG_D(EMU,"[RN %d] PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d)\n", - RN_id, eNB_inst, frame, slot, next_slot >> 1,last_slot>>1); + RN_id, eNB_inst, frame % MAX_FRAME_NUMBER, slot, next_slot >> 1,last_slot>>1); phy_procedures_eNB_lte(slot>>1, PHY_vars_eNB_g[eNB_inst], abstraction_flag, r_type, PHY_vars_RN_g[RN_id]); } else { @@ -963,7 +958,7 @@ l2l1_task (void *args_p) } #endif - emu_transport (frame, last_slot, next_slot, direction, + emu_transport (frame % MAX_FRAME_NUMBER, last_slot, next_slot, direction, oai_emulation.info.frame_type[0], ethernet_flag); if ((direction == SF_DL) @@ -1009,7 +1004,7 @@ l2l1_task (void *args_p) enb_data, ue_data, next_slot, abstraction_flag, &PHY_vars_eNB_g[0][CC_id]->lte_frame_parms, - frame, CC_id); + frame % MAX_FRAME_NUMBER, CC_id); } stop_meas (&ul_chan_stats); @@ -1078,7 +1073,7 @@ l2l1_task (void *args_p) next_slot, abstraction_flag, &PHY_vars_eNB_g[0][CC_id]->lte_frame_parms, - frame, CC_id); + frame % MAX_FRAME_NUMBER, CC_id); } stop_meas (&ul_chan_stats); @@ -1095,7 +1090,7 @@ l2l1_task (void *args_p) } } - if ((last_slot == 1) && (frame == 0) && (abstraction_flag == 0) + if ((last_slot == 1) && ((frame % MAX_FRAME_NUMBER) == 0) && (abstraction_flag == 0) && (oai_emulation.info.n_frames == 1)) { write_output ("dlchan0.m", @@ -1143,40 +1138,40 @@ l2l1_task (void *args_p) &&(Channel_Flag==0) #endif ) { - sprintf (fname, "UEtxsig%d.m", frame); - sprintf (vname, "txs%d", frame); + sprintf (fname, "UEtxsig%d.m", frame % MAX_FRAME_NUMBER); + sprintf (vname, "txs%d", frame % MAX_FRAME_NUMBER); write_output (fname, vname, PHY_vars_UE_g[0][0]->lte_ue_common_vars.txdata[0], PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti * 10, 1, 1); - sprintf (fname, "eNBtxsig%d.m", frame); - sprintf (vname, "txs%d", frame); + sprintf (fname, "eNBtxsig%d.m", frame % MAX_FRAME_NUMBER); + sprintf (vname, "txs%d", frame % MAX_FRAME_NUMBER); write_output (fname, vname, PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.txdata[0][0], PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti * 10, 1, 1); - sprintf (fname, "eNBtxsigF%d.m", frame); - sprintf (vname, "txsF%d", frame); + sprintf (fname, "eNBtxsigF%d.m", frame % MAX_FRAME_NUMBER); + sprintf (vname, "txsF%d", frame % MAX_FRAME_NUMBER); write_output (fname, vname, PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.txdataF[0][0], PHY_vars_eNB_g[0][0]->lte_frame_parms.symbols_per_tti * PHY_vars_eNB_g[0][0]->lte_frame_parms.ofdm_symbol_size, 1, 1); - sprintf (fname, "UErxsig%d.m", frame); - sprintf (vname, "rxs%d", frame); + sprintf (fname, "UErxsig%d.m", frame % MAX_FRAME_NUMBER); + sprintf (vname, "rxs%d", frame % MAX_FRAME_NUMBER); write_output (fname, vname, PHY_vars_UE_g[0][0]->lte_ue_common_vars.rxdata[0], PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti * 10, 1, 1); - sprintf (fname, "eNBrxsig%d.m", frame); - sprintf (vname, "rxs%d", frame); + sprintf (fname, "eNBrxsig%d.m", frame % MAX_FRAME_NUMBER); + sprintf (vname, "rxs%d", frame % MAX_FRAME_NUMBER); write_output (fname, vname, PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.rxdata[0][0], @@ -1209,7 +1204,7 @@ l2l1_task (void *args_p) #ifdef SMBV // Rohde&Schwarz SMBV100A vector signal generator - if ((frame == config_frames[0]) || (frame == config_frames[1]) || (frame == config_frames[2]) || (frame == config_frames[3])) { + if ((frame % MAX_FRAME_NUMBER == config_frames[0]) || (frame % MAX_FRAME_NUMBER == config_frames[1]) || (frame % MAX_FRAME_NUMBER == config_frames[2]) || (frame % MAX_FRAME_NUMBER == config_frames[3])) { smbv_frame_cnt++; } @@ -1269,7 +1264,7 @@ main (int argc, char **argv) int port,Process_Flag=0,wgt,Channel_Flag=0,temp; #endif //default parameters - oai_emulation.info.n_frames = 0xffff; //1024; //10; + oai_emulation.info.n_frames = MAX_FRAME_NUMBER; //1024; //10; oai_emulation.info.n_frames_flag = 0; //fixme snr_dB = 30; From 841078e66807dfa1040b48fad1cb6b179b329d01 Mon Sep 17 00:00:00 2001 From: Dominique Nussbaum Date: Thu, 26 May 2016 15:47:57 +0200 Subject: [PATCH 213/214] fixes for 20MHz --- openair1/SCHED/phy_mac_stub.c | 39 +++++++++++++------------ openair1/SCHED/phy_procedures_lte_eNb.c | 3 +- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/openair1/SCHED/phy_mac_stub.c b/openair1/SCHED/phy_mac_stub.c index 7a8944b1b1..9ef398be2e 100644 --- a/openair1/SCHED/phy_mac_stub.c +++ b/openair1/SCHED/phy_mac_stub.c @@ -56,6 +56,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e uint32_t rballoc = 0x7FFF; //uint32_t rballoc2 = 0x000F; + uint32_t rballoc_test = 0xFFFF; int subframe = phy_vars_eNB->proc[sched_subframe].subframe_tx; LTE_eNB_DLSCH_t *DLSCH_ptr = phy_vars_eNB->dlsch_eNB[0][0]; @@ -142,7 +143,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_10MHz_FDD_t; ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->type = 1; ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->vrb_type = 0; - ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3); + ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(50,10,3); ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->rv = 1; ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->mcs = 1; @@ -153,7 +154,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_10MHz_TDD_1_6_t; ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->type = 1; ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type = 0; - ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3); + ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(50,10,3); ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rv = 1; ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->mcs = 1; @@ -169,7 +170,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_20MHz_FDD_t; ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->type = 1; ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->vrb_type = 0; - ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3); + ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(100,10,3); ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->rv = 1; ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->mcs = 1; @@ -180,7 +181,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_20MHz_TDD_1_6_t; ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->type = 1; ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type = 0; - ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3); + ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(100,10,3); ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->rv = 1; ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->mcs = 1; @@ -230,14 +231,14 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) { DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_FDD_t; - ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc; + ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(25,10,3); ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC = 0; ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]; ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs; //((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28); ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0; - memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t)); + memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_FDD_t)); /* //user2 @@ -260,7 +261,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e } else { DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_TDD_t; - ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; + ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(25,10,3); ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->TPC = 0; ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->dai = 0; ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]; @@ -297,14 +298,14 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) { DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_10MHz_FDD_t; - ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc; + ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(50,10,3); ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->TPC = 0; ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]; ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs; //((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28); ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv = 0; - memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_TDD_t)); + memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_FDD_t)); /* //user2 @@ -327,7 +328,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e } else { DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_10MHz_TDD_t; - ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; + ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(50,10,3); ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->TPC = 0; ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->dai = 0; ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]; @@ -361,16 +362,16 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e case 100: if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) { - DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_FDD_t; + DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_20MHz_FDD_t; - ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc; - ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC = 0; - ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]; - ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs; + ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(100,10,3); + ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->TPC = 0; + ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]; + ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs; //((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28); - ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; - ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0; - memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t)); + ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; + ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rv = 0; + memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_20MHz_FDD_t)); /* //user2 @@ -393,7 +394,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e } else { DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_20MHz_TDD_t; - ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; + ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(100,10,3); ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->TPC = 0; ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->dai = 0; ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]; diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 161e2e5c58..5b38d495ec 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -562,6 +562,7 @@ void phy_eNB_lte_check_measurement_thresholds(instance_t instanceP, ral_threshol unsigned int taus(void); +DCI_PDU DCI_pdu_tmp; void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag, relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn) @@ -573,7 +574,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e uint8_t harq_pid; DCI_PDU *DCI_pdu; uint8_t *DLSCH_pdu=NULL; - DCI_PDU DCI_pdu_tmp; + //DCI_PDU DCI_pdu_tmp; uint8_t DLSCH_pdu_tmp[768*8]; int8_t UE_id; uint8_t num_pdcch_symbols=0; From ec905e7cf9c33f72aea7dfa3769bce8a0a211ee9 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Thu, 9 Jun 2016 12:16:57 +0200 Subject: [PATCH 214/214] fixed a bug in initialization of DCI --- openair1/SCHED/phy_mac_stub.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/openair1/SCHED/phy_mac_stub.c b/openair1/SCHED/phy_mac_stub.c index 9ef398be2e..5ed1b6837d 100644 --- a/openair1/SCHED/phy_mac_stub.c +++ b/openair1/SCHED/phy_mac_stub.c @@ -238,6 +238,8 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e //((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28); ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rah = 0; + memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_FDD_t)); /* @@ -269,6 +271,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e //((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28); ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rah = 0; memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t)); /* @@ -287,6 +290,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs; ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = 1; ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rah = 0; memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t)); */ } @@ -305,6 +309,8 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e //((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28); ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rah = 0; + memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_FDD_t)); /* @@ -323,6 +329,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs; ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = 1; ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rah = 0; memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_10MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_10MHz_TDD_t)); */ } else { @@ -336,6 +343,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e //((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28); ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rah = 0; memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_TDD_t)); /* @@ -354,6 +362,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs; ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = 1; ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rah = 0; memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_10MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_10MHz_TDD_t)); */ } @@ -371,6 +380,8 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e //((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28); ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rah = 0; + memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_20MHz_FDD_t)); /* @@ -389,6 +400,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs; ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = 1; ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rah = 0; memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t)); */ } else { @@ -402,6 +414,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e //((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28); ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rah = 0; memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_20MHz_TDD_t)); /* @@ -420,6 +433,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs; ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->ndi = 1; ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rah = 0; memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_20MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t)); */ }