Commit 5ed848c7 authored by Laurent OpenCells's avatar Laurent OpenCells

more fixes on gcc warnings, misleading indentation and CPU mitigation when the...

more fixes on gcc warnings, misleading indentation and CPU mitigation when the traffic demand in 5G exeeds the available througput
parent 78da8436
This diff is collapsed.
...@@ -170,7 +170,8 @@ int split73=0; ...@@ -170,7 +170,8 @@ int split73=0;
void sendFs6Ul(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int segmentID, int16_t *data, int dataLen, int r_offset) { void sendFs6Ul(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int segmentID, int16_t *data, int dataLen, int r_offset) {
AssertFatal(false, "Must not be called in this context\n"); AssertFatal(false, "Must not be called in this context\n");
} }
void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask, uint16_t rnti, int32_t stat) { void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask,
uint16_t rnti, int32_t stat) {
AssertFatal(false, "Must not be called in this context\n"); AssertFatal(false, "Must not be called in this context\n");
} }
...@@ -307,23 +308,22 @@ int create_gNB_tasks(uint32_t gnb_nb) { ...@@ -307,23 +308,22 @@ int create_gNB_tasks(uint32_t gnb_nb) {
LOG_D(GNB_APP, "%s(gnb_nb:%d)\n", __FUNCTION__, gnb_nb); LOG_D(GNB_APP, "%s(gnb_nb:%d)\n", __FUNCTION__, gnb_nb);
itti_wait_ready(1); itti_wait_ready(1);
if (gnb_nb > 0) { if (gnb_nb > 0) {
/* Last task to create, others task must be ready before its start */ /* Last task to create, others task must be ready before its start */
/*if (itti_create_task (TASK_GNB_APP, gNB_app_task, NULL) < 0) { /*if (itti_create_task (TASK_GNB_APP, gNB_app_task, NULL) < 0) {
LOG_E(GNB_APP, "Create task for gNB APP failed\n"); LOG_E(GNB_APP, "Create task for gNB APP failed\n");
return -1; return -1;
}*/ }*/
if(itti_create_task(TASK_SCTP, sctp_eNB_task, NULL) < 0){ if(itti_create_task(TASK_SCTP, sctp_eNB_task, NULL) < 0) {
LOG_E(SCTP, "Create task for SCTP failed\n"); LOG_E(SCTP, "Create task for SCTP failed\n");
return -1; return -1;
} }
if (is_x2ap_enabled()) { if (is_x2ap_enabled()) {
if(itti_create_task(TASK_X2AP, x2ap_task, NULL) < 0){ if(itti_create_task(TASK_X2AP, x2ap_task, NULL) < 0) {
LOG_E(X2AP, "Create task for X2AP failed\n"); LOG_E(X2AP, "Create task for X2AP failed\n");
} }
} } else {
else {
LOG_I(X2AP, "X2AP is disabled.\n"); LOG_I(X2AP, "X2AP is disabled.\n");
} }
} }
...@@ -333,18 +333,15 @@ int create_gNB_tasks(uint32_t gnb_nb) { ...@@ -333,18 +333,15 @@ int create_gNB_tasks(uint32_t gnb_nb) {
sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,0,GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG); sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,0,GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix); config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix);
for(int i = GNB_INTERFACE_NAME_FOR_NG_AMF_IDX; i <= GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX; i++){ for(int i = GNB_INTERFACE_NAME_FOR_NG_AMF_IDX; i <= GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX; i++) {
if( NETParams[i].strptr == NULL){ if( NETParams[i].strptr == NULL) {
LOG_E(NGAP, "No configuration in the file.\n"); LOG_E(NGAP, "No configuration in the file.\n");
NGAP_CONF_MODE = 0; NGAP_CONF_MODE = 0;
} } else {
else {
LOG_D(NGAP, "Configuration in the file: %s.\n",*NETParams[i].strptr); LOG_D(NGAP, "Configuration in the file: %s.\n",*NETParams[i].strptr);
} }
} }
if (AMF_MODE_ENABLED) { if (AMF_MODE_ENABLED) {
if (gnb_nb > 0) { if (gnb_nb > 0) {
/* /*
...@@ -353,7 +350,7 @@ int create_gNB_tasks(uint32_t gnb_nb) { ...@@ -353,7 +350,7 @@ int create_gNB_tasks(uint32_t gnb_nb) {
return -1; return -1;
} }
*/ */
if(NGAP_CONF_MODE){ if(NGAP_CONF_MODE) {
if (itti_create_task (TASK_NGAP, ngap_gNB_task, NULL) < 0) { if (itti_create_task (TASK_NGAP, ngap_gNB_task, NULL) < 0) {
LOG_E(NGAP, "Create task for NGAP failed\n"); LOG_E(NGAP, "Create task for NGAP failed\n");
return -1; return -1;
...@@ -362,8 +359,7 @@ int create_gNB_tasks(uint32_t gnb_nb) { ...@@ -362,8 +359,7 @@ int create_gNB_tasks(uint32_t gnb_nb) {
LOG_E(NGAP, "Ngap task not created\n"); LOG_E(NGAP, "Ngap task not created\n");
} }
if(!emulate_rf) {
if(!emulate_rf){
if (itti_create_task (TASK_UDP, udp_eNB_task, NULL) < 0) { if (itti_create_task (TASK_UDP, udp_eNB_task, NULL) < 0) {
LOG_E(UDP_, "Create task for UDP failed\n"); LOG_E(UDP_, "Create task for UDP failed\n");
return -1; return -1;
...@@ -384,12 +380,14 @@ int create_gNB_tasks(uint32_t gnb_nb) { ...@@ -384,12 +380,14 @@ int create_gNB_tasks(uint32_t gnb_nb) {
} }
LOG_I(NR_RRC,"Creating NR RRC gNB Task\n"); LOG_I(NR_RRC,"Creating NR RRC gNB Task\n");
if (itti_create_task (TASK_RRC_GNB, rrc_gnb_task, NULL) < 0) { if (itti_create_task (TASK_RRC_GNB, rrc_gnb_task, NULL) < 0) {
LOG_E(NR_RRC, "Create task for NR RRC gNB failed\n"); LOG_E(NR_RRC, "Create task for NR RRC gNB failed\n");
return -1; return -1;
} }
//Use check on x2ap to consider the NSA scenario and check on AMF_MODE_ENABLED for the SA scenario //Use check on x2ap to consider the NSA scenario and check on AMF_MODE_ENABLED for the SA scenario
if(is_x2ap_enabled() || AMF_MODE_ENABLED){ if(is_x2ap_enabled() || AMF_MODE_ENABLED) {
if (itti_create_task (TASK_GTPV1_U, &nr_gtpv1u_gNB_task, NULL) < 0) { if (itti_create_task (TASK_GTPV1_U, &nr_gtpv1u_gNB_task, NULL) < 0) {
LOG_E(GTPU, "Create task for GTPV1U failed\n"); LOG_E(GTPU, "Create task for GTPV1U failed\n");
return -1; return -1;
...@@ -402,18 +400,12 @@ int create_gNB_tasks(uint32_t gnb_nb) { ...@@ -402,18 +400,12 @@ int create_gNB_tasks(uint32_t gnb_nb) {
static void get_options(void) { static void get_options(void) {
paramdef_t cmdline_params[] = CMDLINE_PARAMS_DESC_GNB ; paramdef_t cmdline_params[] = CMDLINE_PARAMS_DESC_GNB ;
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP); CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
get_common_options(SOFTMODEM_GNB_BIT ); get_common_options(SOFTMODEM_GNB_BIT );
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP); CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP);
if ( !(CONFIG_ISFLAGSET(CONFIG_ABORT)) ) { if ( !(CONFIG_ISFLAGSET(CONFIG_ABORT)) ) {
memset((void *)&RC,0,sizeof(RC)); memset((void *)&RC,0,sizeof(RC));
/* Read RC configuration file */ /* Read RC configuration file */
...@@ -426,13 +418,11 @@ static void get_options(void) { ...@@ -426,13 +418,11 @@ static void get_options(void) {
if(parallel_config != NULL) set_parallel_conf(parallel_config); if(parallel_config != NULL) set_parallel_conf(parallel_config);
if(worker_config != NULL) set_worker_conf(worker_config); if(worker_config != NULL) set_worker_conf(worker_config);
} }
void set_default_frame_parms(nfapi_nr_config_request_scf_t *config[MAX_NUM_CCs], void set_default_frame_parms(nfapi_nr_config_request_scf_t *config[MAX_NUM_CCs],
NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
{
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
frame_parms[CC_id] = (NR_DL_FRAME_PARMS *) malloc(sizeof(NR_DL_FRAME_PARMS)); frame_parms[CC_id] = (NR_DL_FRAME_PARMS *) malloc(sizeof(NR_DL_FRAME_PARMS));
config[CC_id] = (nfapi_nr_config_request_scf_t *) malloc(sizeof(nfapi_nr_config_request_scf_t)); config[CC_id] = (nfapi_nr_config_request_scf_t *) malloc(sizeof(nfapi_nr_config_request_scf_t));
...@@ -507,7 +497,6 @@ void wait_gNBs(void) { ...@@ -507,7 +497,6 @@ void wait_gNBs(void) {
waiting=0; waiting=0;
for (i=0; i<RC.nb_nr_L1_inst; i++) { for (i=0; i<RC.nb_nr_L1_inst; i++) {
if (RC.gNB[i]->configured==0) { if (RC.gNB[i]->configured==0) {
waiting=1; waiting=1;
break; break;
...@@ -567,11 +556,8 @@ int stop_L1L2(module_id_t gnb_id) { ...@@ -567,11 +556,8 @@ int stop_L1L2(module_id_t gnb_id) {
LOG_I(GNB_APP, "calling kill_NR_RU_proc() for instance %d\n", gnb_id); LOG_I(GNB_APP, "calling kill_NR_RU_proc() for instance %d\n", gnb_id);
kill_NR_RU_proc(gnb_id); kill_NR_RU_proc(gnb_id);
oai_exit = 0; oai_exit = 0;
//free_transport(RC.gNB[gnb_id]); //free_transport(RC.gNB[gnb_id]);
phy_free_nr_gNB(RC.gNB[gnb_id]); phy_free_nr_gNB(RC.gNB[gnb_id]);
nr_phy_free_RU(RC.ru[gnb_id]); nr_phy_free_RU(RC.ru[gnb_id]);
free_lte_top(); free_lte_top();
return 0; return 0;
...@@ -586,17 +572,13 @@ int restart_L1L2(module_id_t gnb_id) { ...@@ -586,17 +572,13 @@ int restart_L1L2(module_id_t gnb_id) {
LOG_W(GNB_APP, "restarting nr-softmodem\n"); LOG_W(GNB_APP, "restarting nr-softmodem\n");
/* block threads */ /* block threads */
sync_var = -1; sync_var = -1;
RC.gNB[gnb_id]->configured = 0; RC.gNB[gnb_id]->configured = 0;
RC.ru_mask |= (1 << ru->idx); RC.ru_mask |= (1 << ru->idx);
set_function_spec_param(RC.ru[gnb_id]); set_function_spec_param(RC.ru[gnb_id]);
LOG_I(GNB_APP, "attempting to create ITTI tasks\n"); LOG_I(GNB_APP, "attempting to create ITTI tasks\n");
// No more rrc thread, as many race conditions are hidden behind // No more rrc thread, as many race conditions are hidden behind
rrc_enb_init(); rrc_enb_init();
itti_mark_task_ready(TASK_RRC_ENB); itti_mark_task_ready(TASK_RRC_ENB);
/* pass a reconfiguration request which will configure everything down to /* pass a reconfiguration request which will configure everything down to
* RC.eNB[i][j]->frame_parms, too */ * RC.eNB[i][j]->frame_parms, too */
msg_p = itti_alloc_new_message(TASK_ENB_APP, 0, RRC_CONFIGURATION_REQ); msg_p = itti_alloc_new_message(TASK_ENB_APP, 0, RRC_CONFIGURATION_REQ);
...@@ -634,6 +616,7 @@ void init_pdcp(void) { ...@@ -634,6 +616,7 @@ void init_pdcp(void) {
// pdcp_layer_init(); // pdcp_layer_init();
uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ? uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
(PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT; (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
if (IS_SOFTMODEM_NOS1) { if (IS_SOFTMODEM_NOS1) {
printf("IS_SOFTMODEM_NOS1 option enabled \n"); printf("IS_SOFTMODEM_NOS1 option enabled \n");
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT; pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT;
...@@ -656,16 +639,15 @@ void init_pdcp(void) { ...@@ -656,16 +639,15 @@ void init_pdcp(void) {
} }
int main( int argc, char **argv ) int main( int argc, char **argv ) {
{
int ru_id, CC_id = 0; int ru_id, CC_id = 0;
start_background_system(); start_background_system();
///static configuration for NR at the moment ///static configuration for NR at the moment
if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == NULL) { if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == NULL) {
exit_fun("[SOFTMODEM] Error, configuration module init failed\n"); exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
} }
set_softmodem_sighandler(); set_softmodem_sighandler();
#ifdef DEBUG_CONSOLE #ifdef DEBUG_CONSOLE
setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0);
...@@ -709,19 +691,16 @@ int main( int argc, char **argv ) ...@@ -709,19 +691,16 @@ int main( int argc, char **argv )
itti_init(TASK_MAX, tasks_info); itti_init(TASK_MAX, tasks_info);
// initialize mscgen log after ITTI // initialize mscgen log after ITTI
MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX); MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX);
init_opt(); init_opt();
#ifdef PDCP_USE_NETLINK #ifdef PDCP_USE_NETLINK
if(!IS_SOFTMODEM_NOS1)
if(!IS_SOFTMODEM_NOS1)
netlink_init(); netlink_init();
#if defined(PDCP_USE_NETLINK_QUEUES) #if defined(PDCP_USE_NETLINK_QUEUES)
pdcp_netlink_init(); pdcp_netlink_init();
#endif #endif
#endif #endif
#ifndef PACKAGE_VERSION #ifndef PACKAGE_VERSION
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL" # define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
#endif #endif
...@@ -732,7 +711,6 @@ if(!IS_SOFTMODEM_NOS1) ...@@ -732,7 +711,6 @@ if(!IS_SOFTMODEM_NOS1)
// don't create if node doesn't connect to RRC/S1/GTP // don't create if node doesn't connect to RRC/S1/GTP
AssertFatal(create_gNB_tasks(1) == 0,"cannot create ITTI tasks\n"); AssertFatal(create_gNB_tasks(1) == 0,"cannot create ITTI tasks\n");
/* Start the agent. If it is turned off in the configuration, it won't start */ /* Start the agent. If it is turned off in the configuration, it won't start */
/* /*
RCconfig_nr_flexran(); RCconfig_nr_flexran();
...@@ -740,15 +718,13 @@ if(!IS_SOFTMODEM_NOS1) ...@@ -740,15 +718,13 @@ if(!IS_SOFTMODEM_NOS1)
for (i = 0; i < RC.nb_nr_L1_inst; i++) { for (i = 0; i < RC.nb_nr_L1_inst; i++) {
flexran_agent_start(i); flexran_agent_start(i);
} }
*/ */
// init UE_PF_PO and mutex lock // init UE_PF_PO and mutex lock
pthread_mutex_init(&ue_pf_po_mutex, NULL); pthread_mutex_init(&ue_pf_po_mutex, NULL);
memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*NUMBER_OF_UE_MAX*MAX_NUM_CCs); memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*NUMBER_OF_UE_MAX*MAX_NUM_CCs);
mlockall(MCL_CURRENT | MCL_FUTURE); mlockall(MCL_CURRENT | MCL_FUTURE);
pthread_cond_init(&sync_cond,NULL); pthread_cond_init(&sync_cond,NULL);
pthread_mutex_init(&sync_mutex, NULL); pthread_mutex_init(&sync_mutex, NULL);
usleep(1000); usleep(1000);
if (NFAPI_MODE) { if (NFAPI_MODE) {
...@@ -819,6 +795,7 @@ if(!IS_SOFTMODEM_NOS1) ...@@ -819,6 +795,7 @@ if(!IS_SOFTMODEM_NOS1)
printf("RC.nb_RU:%d\n", RC.nb_RU); printf("RC.nb_RU:%d\n", RC.nb_RU);
// once all RUs are ready initialize the rest of the gNBs ((dependence on final RU parameters after configuration) // once all RUs are ready initialize the rest of the gNBs ((dependence on final RU parameters after configuration)
printf("ALL RUs ready - init gNBs\n"); printf("ALL RUs ready - init gNBs\n");
if(IS_SOFTMODEM_DOSCOPE) { if(IS_SOFTMODEM_DOSCOPE) {
sleep(1); sleep(1);
scopeParms_t p; scopeParms_t p;
...@@ -844,6 +821,7 @@ if(!IS_SOFTMODEM_NOS1) ...@@ -844,6 +821,7 @@ if(!IS_SOFTMODEM_NOS1)
pthread_cond_broadcast(&sync_cond); pthread_cond_broadcast(&sync_cond);
pthread_mutex_unlock(&sync_mutex); pthread_mutex_unlock(&sync_mutex);
} }
printf("About to call end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__); printf("About to call end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
end_configmodule(); end_configmodule();
printf("Called end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__); printf("Called end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
...@@ -855,7 +833,6 @@ if(!IS_SOFTMODEM_NOS1) ...@@ -855,7 +833,6 @@ if(!IS_SOFTMODEM_NOS1)
printf("Returned from ITTI signal handler\n"); printf("Returned from ITTI signal handler\n");
oai_exit=1; oai_exit=1;
printf("oai_exit=%d\n",oai_exit); printf("oai_exit=%d\n",oai_exit);
// stop threads // stop threads
/*#ifdef XFORMS /*#ifdef XFORMS
...@@ -914,7 +891,6 @@ if(!IS_SOFTMODEM_NOS1) ...@@ -914,7 +891,6 @@ if(!IS_SOFTMODEM_NOS1)
RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice); RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice);
} }
logClean(); logClean();
printf("Bye.\n"); printf("Bye.\n");
return 0; return 0;
......
...@@ -2727,7 +2727,7 @@ typedef struct { ...@@ -2727,7 +2727,7 @@ typedef struct {
} nfapi_cqi_indication_rel8_t; } nfapi_cqi_indication_rel8_t;
#define NFAPI_CQI_INDICATION_REL8_TAG 0x202f #define NFAPI_CQI_INDICATION_REL8_TAG 0x202f
#define NFAPI_CC_MAX 4 #define NFAPI_CC_MAX MAX_NUM_CCs
typedef struct { typedef struct {
nfapi_tl_t tl; nfapi_tl_t tl;
uint16_t length; uint16_t length;
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
...@@ -373,10 +373,10 @@ char interleave_compact_byte(short *base_interleaver,unsigned char *input, unsig ...@@ -373,10 +373,10 @@ char interleave_compact_byte(short *base_interleaver,unsigned char *input, unsig
short *ptr_intl=base_interleaver; short *ptr_intl=base_interleaver;
#if defined(__x86_64) || defined(__i386__) #if defined(__x86_64) || defined(__i386__)
#ifndef __AVX2__ #ifndef __AVX2__
__m128i tmp; __m128i tmp={0};
uint16_t *systematic2_ptr=(uint16_t *) output; uint16_t *systematic2_ptr=(uint16_t *) output;
#else #else
__m256i tmp; __m256i tmp={0};
uint32_t *systematic2_ptr=(uint32_t *) output; uint32_t *systematic2_ptr=(uint32_t *) output;
#endif #endif
#elif defined(__arm__) #elif defined(__arm__)
......
...@@ -1105,7 +1105,7 @@ uint8_t phy_threegpplte_turbo_decoder16(int16_t *y, ...@@ -1105,7 +1105,7 @@ uint8_t phy_threegpplte_turbo_decoder16(int16_t *y,
uint8_t temp; uint8_t temp;
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
__m128i *yp128; __m128i *yp128;
__m128i tmp, zeros=_mm_setzero_si128(); __m128i tmp={0}, zeros=_mm_setzero_si128();
__m128i tmpe; __m128i tmpe;
#elif defined(__arm__) #elif defined(__arm__)
int16x8_t *yp128; int16x8_t *yp128;
......
...@@ -819,7 +819,7 @@ uint8_t phy_threegpplte_turbo_decoder8(int16_t *y, ...@@ -819,7 +819,7 @@ uint8_t phy_threegpplte_turbo_decoder8(int16_t *y,
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
__m128i *yp128; __m128i *yp128;
__m128i tmp128[(n+8)>>3]; __m128i tmp128[(n+8)>>3];
__m128i tmp, zeros=_mm_setzero_si128(); __m128i tmp={0}, zeros=_mm_setzero_si128();
#elif defined(__arm__) #elif defined(__arm__)
int8x16_t *yp128; int8x16_t *yp128;
int8x16_t tmp128[(n+8)>>3]; int8x16_t tmp128[(n+8)>>3];
......
...@@ -35,7 +35,6 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32 ...@@ -35,7 +35,6 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32
#define SCALE 0x3FFF #define SCALE 0x3FFF
static const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1}; static const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
//static const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
extern unsigned short dftsizes[34]; extern unsigned short dftsizes[34];
extern int16_t *ul_ref_sigs_rx[30][2][34]; extern int16_t *ul_ref_sigs_rx[30][2][34];
......
...@@ -1234,7 +1234,7 @@ void dlsch_channel_compensation(int **rxdataF_ext, ...@@ -1234,7 +1234,7 @@ void dlsch_channel_compensation(int **rxdataF_ext,
unsigned short rb; unsigned short rb;
unsigned char aatx,aarx,symbol_mod,pilots=0; unsigned char aatx,aarx,symbol_mod,pilots=0;
__m128i *dl_ch128,*dl_ch128_2,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128,*rho128; __m128i *dl_ch128,*dl_ch128_2,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128,*rho128;
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128; __m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0};
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp))) { if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp))) {
...@@ -1657,11 +1657,11 @@ void dlsch_channel_compensation_core(int **rxdataF_ext, ...@@ -1657,11 +1657,11 @@ void dlsch_channel_compensation_core(int **rxdataF_ext,
int length_mod8 = 0; int length_mod8 = 0;
int length2; int length2;
__m128i *dl_ch128,*dl_ch_mag128,*dl_ch_mag128b, *dl_ch128_2, *rxdataF128,*rxdataF_comp128,*rho128; __m128i *dl_ch128,*dl_ch_mag128,*dl_ch_mag128b, *dl_ch128_2, *rxdataF128,*rxdataF_comp128,*rho128;
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128; __m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0};
int aatx = 0, aarx = 0; int aatx = 0, aarx = 0;
for (aatx=0; aatx<n_tx; aatx++) { for (aatx=0; aatx<n_tx; aatx++) {
__m128i QAM_amp128b; __m128i QAM_amp128b={0};
if (mod_order == 4) { if (mod_order == 4) {
QAM_amp128 = _mm_set1_epi16(QAM16_n1); // 2/sqrt(10) QAM_amp128 = _mm_set1_epi16(QAM16_n1); // 2/sqrt(10)
...@@ -2411,7 +2411,7 @@ void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -2411,7 +2411,7 @@ void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms,
int **rxdataF_comp0 = pdsch_vars->rxdataF_comp0; int **rxdataF_comp0 = pdsch_vars->rxdataF_comp0;
int **rxdataF_comp1 = pdsch_vars->rxdataF_comp1[harq_pid][round]; int **rxdataF_comp1 = pdsch_vars->rxdataF_comp1[harq_pid][round];
unsigned char *pmi_ext = pdsch_vars->pmi_ext; unsigned char *pmi_ext = pdsch_vars->pmi_ext;
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp0_128,QAM_amp1_128; __m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp0_128={0},QAM_amp1_128={0};
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp))) if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp)))
......
...@@ -328,7 +328,7 @@ void mch_channel_compensation(int **rxdataF_ext, ...@@ -328,7 +328,7 @@ void mch_channel_compensation(int **rxdataF_ext,
int aarx,nre,i; int aarx,nre,i;
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
__m128i *dl_ch128,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128; __m128i *dl_ch128,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128;
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b; __m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0},QAM_amp128b={0};
#elif defined(__arm__) #elif defined(__arm__)
#endif #endif
...@@ -455,7 +455,7 @@ void mch_channel_compensation_khz_1dot25(int **rxdataF_ext, ...@@ -455,7 +455,7 @@ void mch_channel_compensation_khz_1dot25(int **rxdataF_ext,
int aarx,nre,i; int aarx,nre,i;
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
__m128i *dl_ch128,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128; __m128i *dl_ch128,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128;
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b; __m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0},QAM_amp128b={0};
#elif defined(__arm__) #elif defined(__arm__)
#endif #endif
/*if ((symbol == 2) || (symbol == 6) || (symbol == 10)) /*if ((symbol == 2) || (symbol == 6) || (symbol == 10))
......
...@@ -629,7 +629,7 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext, ...@@ -629,7 +629,7 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
unsigned char aatx,aarx; unsigned char aatx,aarx;
char nb_antennas_ue_tx = 1; char nb_antennas_ue_tx = 1;
__m128i *ul_ch128,*ul_ch128_2,*ul_ch_mag128,*ul_ch_mag128b,*rxdataF128,*rxdataF_comp128,*rho128; __m128i *ul_ch128,*ul_ch128_2,*ul_ch_mag128,*ul_ch_mag128b,*rxdataF128,*rxdataF_comp128,*rho128;
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b; __m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0},QAM_amp128b={0};
QAM_amp128b = _mm_setzero_si128(); QAM_amp128b = _mm_setzero_si128();
for (aatx=0; aatx<nb_antennas_ue_tx; aatx++) { for (aatx=0; aatx<nb_antennas_ue_tx; aatx++) {
......
...@@ -793,7 +793,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, ...@@ -793,7 +793,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
unsigned short rb; unsigned short rb;
unsigned char aatx,aarx,atx; unsigned char aatx,aarx,atx;
__m128i *dl_ch128,*dl_ch128_2,*dl_ch_mag128,*dl_ch_mag128b,*dl_ch_mag128r,*rxdataF128,*rxdataF_comp128,*rho128; __m128i *dl_ch128,*dl_ch128_2,*dl_ch_mag128,*dl_ch_mag128b,*dl_ch_mag128r,*rxdataF128,*rxdataF_comp128,*rho128;
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b,QAM_amp128r; __m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0},QAM_amp128b={0},QAM_amp128r={0};
QAM_amp128b = _mm_setzero_si128(); QAM_amp128b = _mm_setzero_si128();
for (aatx=0; aatx<nb_aatx; aatx++) { for (aatx=0; aatx<nb_aatx; aatx++) {
...@@ -1314,7 +1314,7 @@ void nr_dlsch_channel_compensation_core(int **rxdataF_ext, ...@@ -1314,7 +1314,7 @@ void nr_dlsch_channel_compensation_core(int **rxdataF_ext,
int length_mod8 = 0; int length_mod8 = 0;
int length2; int length2;
__m128i *dl_ch128,*dl_ch_mag128,*dl_ch_mag128b, *dl_ch128_2, *rxdataF128,*rxdataF_comp128,*rho128; __m128i *dl_ch128,*dl_ch_mag128,*dl_ch_mag128b, *dl_ch128_2, *rxdataF128,*rxdataF_comp128,*rho128;
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b; __m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0},QAM_amp128b={0};
int aatx = 0, aarx = 0; int aatx = 0, aarx = 0;
for (aatx=0; aatx<n_tx; aatx++) { for (aatx=0; aatx<n_tx; aatx++) {
...@@ -2823,7 +2823,7 @@ uint8_t nr_zero_forcing_rx_2layers(int **rxdataF_comp, ...@@ -2823,7 +2823,7 @@ uint8_t nr_zero_forcing_rx_2layers(int **rxdataF_comp,
* *
**************************************************************************/ **************************************************************************/
__m128i *rxdataF_comp128_0,*rxdataF_comp128_1,*dl_ch_mag128_0,*dl_ch_mag128b_0,*dl_ch_mag128_1,*dl_ch_mag128b_1,*determ_fin_128; __m128i *rxdataF_comp128_0,*rxdataF_comp128_1,*dl_ch_mag128_0,*dl_ch_mag128b_0,*dl_ch_mag128_1,*dl_ch_mag128b_1,*determ_fin_128;
__m128i mmtmpD2,mmtmpD3,mmtmpD0,mmtmpD1,QAM_amp128,QAM_amp128b; __m128i mmtmpD2,mmtmpD3,mmtmpD0,mmtmpD1,QAM_amp128={0},QAM_amp128b={0};
__m128i *after_mf_a_128,*after_mf_b_128, *after_mf_c_128, *after_mf_d_128; __m128i *after_mf_a_128,*after_mf_b_128, *after_mf_c_128, *after_mf_d_128;
determ_fin_128 = (__m128i *)&determ_fin[0]; determ_fin_128 = (__m128i *)&determ_fin[0];
......
...@@ -894,7 +894,7 @@ void phy_scope_nrUE(OAI_phy_scope_t *form, ...@@ -894,7 +894,7 @@ void phy_scope_nrUE(OAI_phy_scope_t *form,
static void *nrUEscopeThread(void *arg) { static void *nrUEscopeThread(void *arg) {
PHY_VARS_NR_UE *ue=(PHY_VARS_NR_UE *)arg; PHY_VARS_NR_UE *ue=(PHY_VARS_NR_UE *)arg;
size_t stksize; size_t stksize;
pthread_attr_t atr; pthread_attr_t atr={0};
pthread_attr_getstacksize(&atr, &stksize); pthread_attr_getstacksize(&atr, &stksize);
pthread_attr_setstacksize(&atr,32*1024*1024 ); pthread_attr_setstacksize(&atr,32*1024*1024 );
int fl_argc=1; int fl_argc=1;
......
...@@ -216,7 +216,7 @@ int main(int argc, char **argv){ ...@@ -216,7 +216,7 @@ int main(int argc, char **argv){
char c; char c;
double sigma2, sigma2_dB = 0, SNR, snr0 = -2.0, snr1 = 0.0, ue_speed0 = 0.0, ue_speed1 = 0.0; double sigma2, sigma2_dB = 0, SNR, snr0 = -2.0, snr1 = 0.0, ue_speed0 = 0.0, ue_speed1 = 0.0;
double **s_re, **s_im, **r_re, **r_im, iqim = 0.0, delay_avg = 0, ue_speed = 0, fs, bw; double **s_re, **s_im, **r_re, **r_im, iqim = 0.0, delay_avg = 0, ue_speed = 0, fs=-1, bw;
int i, l, aa, aarx, **txdata, trial, n_frames = 1, prach_start, rx_prach_start; //, ntrials=1; int i, l, aa, aarx, **txdata, trial, n_frames = 1, prach_start, rx_prach_start; //, ntrials=1;
int N_RB_UL = 106, delay = 0, NCS_config = 13, rootSequenceIndex = 1, threequarter_fs = 0, mu = 1, fd_occasion = 0, loglvl = OAILOG_INFO, numRA = 0, prachStartSymbol = 0; int N_RB_UL = 106, delay = 0, NCS_config = 13, rootSequenceIndex = 1, threequarter_fs = 0, mu = 1, fd_occasion = 0, loglvl = OAILOG_INFO, numRA = 0, prachStartSymbol = 0;
uint8_t snr1set = 0, ue_speed1set = 0, transmission_mode = 1, n_tx = 1, n_rx = 1, awgn_flag = 0, msg1_frequencystart = 0, num_prach_fd_occasions = 1, prach_format=0; uint8_t snr1set = 0, ue_speed1set = 0, transmission_mode = 1, n_tx = 1, n_rx = 1, awgn_flag = 0, msg1_frequencystart = 0, num_prach_fd_occasions = 1, prach_format=0;
......
...@@ -285,7 +285,7 @@ int main(int argc, char **argv) ...@@ -285,7 +285,7 @@ int main(int argc, char **argv)
int gNB_id = 0; int gNB_id = 0;
int ap; int ap;
int tx_offset; int tx_offset;
int32_t txlev; int32_t txlev=0;
int start_rb = 0; int start_rb = 0;
int UE_id =0; // [hna] only works for UE_id = 0 because NUMBER_OF_NR_UE_MAX is set to 1 (phy_init_nr_gNB causes segmentation fault) int UE_id =0; // [hna] only works for UE_id = 0 because NUMBER_OF_NR_UE_MAX is set to 1 (phy_init_nr_gNB causes segmentation fault)
float target_error_rate = 0.01; float target_error_rate = 0.01;
......
...@@ -1529,7 +1529,7 @@ static int tx_list_size(nr_rlc_entity_am_t *entity, ...@@ -1529,7 +1529,7 @@ static int tx_list_size(nr_rlc_entity_am_t *entity,
{ {
int ret = 0; int ret = 0;
while (l != NULL) { while (l != NULL && ret < maxsize) {
ret += compute_pdu_header_size(entity, l) + l->size; ret += compute_pdu_header_size(entity, l) + l->size;
l = l->next; l = l->next;
} }
......
...@@ -78,7 +78,7 @@ static int tx_list_size(nr_rlc_entity_tm_t *entity, ...@@ -78,7 +78,7 @@ static int tx_list_size(nr_rlc_entity_tm_t *entity,
{ {
int ret = 0; int ret = 0;
while (l != NULL) { while (l != NULL && ret < maxsize) {
ret += l->size; ret += l->size;
l = l->next; l = l->next;
} }
......
...@@ -497,7 +497,7 @@ static int tx_list_size(nr_rlc_entity_um_t *entity, ...@@ -497,7 +497,7 @@ static int tx_list_size(nr_rlc_entity_um_t *entity,
{ {
int ret = 0; int ret = 0;
while (l != NULL) { while (l != NULL && ret < maxsize) {
ret += compute_pdu_header_size(entity, l) + l->size; ret += compute_pdu_header_size(entity, l) + l->size;
l = l->next; l = l->next;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment