From 9b7367c0ce3f4ba19a2916ddf7f6c8bb121ad4f1 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 19 Mar 2019 17:52:14 +0100 Subject: [PATCH 01/28] Adding a parameter in configuration file to enable RRC Inactivity timers -- rrc_inactivity_threshold in seconds Adding support in CI to test it -- disable/enable data service on UEs -- no automatic check yet on the UE status certainly should be done w/ a Flexran controller command Signed-off-by: Raphael Defosseux --- .../enb.band7.tm1.25PRB.usrpb210.conf | 3 + ci-scripts/main.py | 126 +++++++++++++++++- .../enb_usrp210_band7_test_05mhz_tm1.xml | 41 +++++- openair2/ENB_APP/enb_config.c | 6 +- openair2/ENB_APP/enb_paramdef.h | 5 + 5 files changed, 175 insertions(+), 6 deletions(-) diff --git a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf index a0d3ba6d06..808a01fc54 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf @@ -18,6 +18,9 @@ eNBs = tr_s_preference = "local_mac" + // In seconds + rrc_inactivity_threshold = 30; + ////////// Physical parameters: component_carriers = ( diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 5b1dfd8901..5177e3f57c 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -509,6 +509,9 @@ class SSHConnection(): logging.debug('send adb commands') try: self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) + # enable data service + self.command('stdbuf -o0 adb -s ' + device_id + ' shell svc data enable', '\$', 60) + # The following commands are deprecated since we no longer work on Android 7+ # self.command('stdbuf -o0 adb -s ' + device_id + ' shell settings put global airplane_mode_on 1', '\$', 10) # self.command('stdbuf -o0 adb -s ' + device_id + ' shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true', '\$', 60) @@ -963,6 +966,54 @@ class SSHConnection(): job.join() self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) + def DataDisableUE_common(self, device_id): + try: + self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) + # enable data service + self.command('stdbuf -o0 adb -s ' + device_id + ' shell svc data disable', '\$', 60) + logging.debug('\u001B[1mUE (' + device_id + ') Disabled Data Service\u001B[0m') + self.close() + except: + os.kill(os.getppid(),signal.SIGUSR1) + + def DataDisableUE(self): + if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': + Usage() + sys.exit('Insufficient Parameter') + multi_jobs = [] + for device_id in self.UEDevices: + p = Process(target = self.DataDisableUE_common, args = (device_id,)) + p.daemon = True + p.start() + multi_jobs.append(p) + for job in multi_jobs: + job.join() + self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) + + def DataEnableUE_common(self, device_id): + try: + self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) + # enable data service + self.command('stdbuf -o0 adb -s ' + device_id + ' shell svc data enable', '\$', 60) + logging.debug('\u001B[1mUE (' + device_id + ') Enabled Data Service\u001B[0m') + self.close() + except: + os.kill(os.getppid(),signal.SIGUSR1) + + def DataEnableUE(self): + if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': + Usage() + sys.exit('Insufficient Parameter') + multi_jobs = [] + for device_id in self.UEDevices: + p = Process(target = self.DataEnableUE_common, args = (device_id,)) + p.daemon = True + p.start() + multi_jobs.append(p) + for job in multi_jobs: + job.join() + self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) + def GetAllUEDevices(self, terminate_ue_flag): if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': Usage() @@ -989,6 +1040,68 @@ class SSHConnection(): sys.exit(1) self.close() + def CheckUEStatus_common(self, lock, device_id, statusQueue): + try: + self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) + lock.acquire() + logging.debug('\u001B[1;37;44m Status Check (' + str(device_id) + ') \u001B[0m') + #logging.debug('\u001B[1;34m ' + pal_msg + '\u001B[0m') + #logging.debug('\u001B[1;34m ' + min_msg + '\u001B[0m') + #logging.debug('\u001B[1;34m ' + avg_msg + '\u001B[0m') + #logging.debug('\u001B[1;34m ' + max_msg + '\u001B[0m') + statusQueue.put(0) + statusQueue.put(device_id) + statusQueue.put('Nothing for the moment') + lock.release() + self.close() + except: + os.kill(os.getppid(),signal.SIGUSR1) + + def CheckStatusUE(self): + if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': + Usage() + sys.exit('Insufficient Parameter') + initialize_eNB_flag = False + pStatus = self.CheckProcessExist(initialize_eNB_flag) + if (pStatus < 0): + self.CreateHtmlTestRow('N/A', 'KO', pStatus) + self.CreateHtmlTabFooter(False) + sys.exit(1) + multi_jobs = [] + lock = Lock() + status_queue = SimpleQueue() + for device_id in self.UEDevices: + p = Process(target = self.CheckUEStatus_common, args = (lock,device_id,status_queue,)) + p.daemon = True + p.start() + multi_jobs.append(p) + for job in multi_jobs: + job.join() + + if (status_queue.empty()): + self.CreateHtmlTestRow('N/A', 'KO', ALL_PROCESSES_OK) + self.AutoTerminateUEandeNB() + self.CreateHtmlTabFooter(False) + sys.exit(1) + else: + check_status = True + html_queue = SimpleQueue() + while (not status_queue.empty()): + count = status_queue.get() + if (count < 0): + check_status = False + device_id = status_queue.get() + message = status_queue.get() + html_cell = '
UE (' + device_id + ')\n' + message + '
' + html_queue.put(html_cell) + if (check_status): + self.CreateHtmlTestRowQueue('N/A', 'OK', len(self.UEDevices), html_queue) + else: + self.CreateHtmlTestRowQueue('N/A', 'KO', len(self.UEDevices), html_queue) + self.AutoTerminateUEandeNB() + self.CreateHtmlTabFooter(False) + sys.exit(1) + def GetAllUEIPAddresses(self): if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': Usage() @@ -1795,7 +1908,7 @@ class SSHConnection(): result = re.search('LTE_RRCConnectionSetupComplete from UE', str(line)) if result is not None: rrcSetupComplete += 1 - result = re.search('Generate LTE_RRCConnectionRelease', str(line)) + result = re.search('Generate LTE_RRCConnectionRelease|Generate RRCConnectionRelease', str(line)) if result is not None: rrcReleaseRequest += 1 result = re.search('Generate LTE_RRCConnectionReconfiguration', str(line)) @@ -2006,6 +2119,7 @@ class SSHConnection(): def TerminateUE_common(self, device_id): try: self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) + # back in airplane mode on (ie radio off) self.command('stdbuf -o0 adb -s ' + device_id + ' shell /data/local/tmp/off', '\$', 60) logging.debug('\u001B[1mUE (' + device_id + ') Detach Completed\u001B[0m') @@ -2493,7 +2607,7 @@ def Usage(): print('------------------------------------------------------------') def CheckClassValidity(action,id): - if action != 'Build_eNB' and action != 'Initialize_eNB' and action != 'Terminate_eNB' and action != 'Initialize_UE' and action != 'Terminate_UE' and action != 'Attach_UE' and action != 'Detach_UE' and action != 'Ping' and action != 'Iperf' and action != 'Reboot_UE' and action != 'Initialize_HSS' and action != 'Terminate_HSS' and action != 'Initialize_MME' and action != 'Terminate_MME' and action != 'Initialize_SPGW' and action != 'Terminate_SPGW' and action != 'Initialize_CatM_module' and action != 'Terminate_CatM_module' and action != 'Attach_CatM_module' and action != 'Detach_CatM_module' and action != 'Ping_CatM_module' and action != 'IdleSleep': + if action != 'Build_eNB' and action != 'Initialize_eNB' and action != 'Terminate_eNB' and action != 'Initialize_UE' and action != 'Terminate_UE' and action != 'Attach_UE' and action != 'Detach_UE' and action != 'DataDisable_UE' and action != 'DataEnable_UE' and action != 'CheckStatusUE' and action != 'Ping' and action != 'Iperf' and action != 'Reboot_UE' and action != 'Initialize_HSS' and action != 'Terminate_HSS' and action != 'Initialize_MME' and action != 'Terminate_MME' and action != 'Initialize_SPGW' and action != 'Terminate_SPGW' and action != 'Initialize_CatM_module' and action != 'Terminate_CatM_module' and action != 'Attach_CatM_module' and action != 'Detach_CatM_module' and action != 'Ping_CatM_module' and action != 'IdleSleep': logging.debug('ERROR: test-case ' + id + ' has wrong class ' + action) return False return True @@ -2793,7 +2907,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE): continue SSH.ShowTestID() GetParametersFromXML(action) - if action == 'Initialize_UE' or action == 'Attach_UE' or action == 'Detach_UE' or action == 'Ping' or action == 'Iperf' or action == 'Reboot_UE': + if action == 'Initialize_UE' or action == 'Attach_UE' or action == 'Detach_UE' or action == 'Ping' or action == 'Iperf' or action == 'Reboot_UE' or action == 'DataDisable_UE' or action == 'DataEnable_UE' or action == 'CheckStatusUE': terminate_ue_flag = False SSH.GetAllUEDevices(terminate_ue_flag) if action == 'Build_eNB': @@ -2810,6 +2924,12 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE): SSH.AttachUE() elif action == 'Detach_UE': SSH.DetachUE() + elif action == 'DataDisable_UE': + SSH.DataDisableUE() + elif action == 'DataEnable_UE': + SSH.DataEnableUE() + elif action == 'CheckStatusUE': + SSH.CheckStatusUE() elif action == 'Initialize_CatM_module': SSH.InitializeCatM() elif action == 'Terminate_CatM_module': diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml index 0057eaefa4..017b39454e 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml @@ -26,10 +26,32 @@ tasks 040101 - 030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201 + 030101 040301 040501 000010 040302 000001 000011 040303 000002 040502 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201 + + IdleSleep + Waiting for 35 seconds + 35 + + + + IdleSleep + Waiting for 5 seconds + 5 + + + + CheckStatusUE + Check UE(s) status before data disabling + + + + CheckStatusUE + Check UE(s) status after data disabling + + Initialize_eNB Initialize eNB (FDD/Band7/5MHz) @@ -61,6 +83,16 @@ Detach UE + + DataDisable_UE + Disabling Data Service on UE + + + + DataEnable_UE + Enabling Data Service on UE + + Ping ping (5MHz - 20 sec) @@ -68,6 +100,13 @@ 5 + + Ping + ping (5MHz - 20 sec) + -c 20 + 5 + + Iperf iperf (5MHz - DL/15Mbps/UDP)(30 sec)(balanced profile) diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 6556a34e7b..e85fe5ac89 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -54,7 +54,7 @@ #include "RRC_config_tools.h" #include "enb_paramdef.h" -#define RRC_INACTIVITY_THRESH 0 +//#define RRC_INACTIVITY_THRESH 0 extern uint16_t sf_ahead; extern void set_parallel_conf(char *parallel_conf); @@ -428,7 +428,9 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { for (int I = 0; I < sizeof(PLMNParams) / sizeof(paramdef_t); ++I) PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]); - RRC_CONFIGURATION_REQ (msg_p).rrc_inactivity_timer_thres = RRC_INACTIVITY_THRESH; // set to 0 to deactivate + //RRC_CONFIGURATION_REQ (msg_p).rrc_inactivity_timer_thres = RRC_INACTIVITY_THRESH; // set to 0 to deactivate + // In the configuration file it is in seconds. For RRC it has to be in milliseconds + RRC_CONFIGURATION_REQ (msg_p).rrc_inactivity_timer_thres = (*ENBParamList.paramarray[i][ENB_RRC_INACTIVITY_THRES_IDX].uptr) * 1000; RRC_CONFIGURATION_REQ (msg_p).cell_identity = enb_id; RRC_CONFIGURATION_REQ (msg_p).tac = *ENBParamList.paramarray[i][ENB_TRACKING_AREA_CODE_IDX].uptr; AssertFatal(!ENBParamList.paramarray[i][ENB_MOBILE_COUNTRY_CODE_IDX_OLD].strptr diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index b44ec9de16..04c8795a2a 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -197,6 +197,7 @@ typedef enum { #define ENB_CONFIG_STRING_REMOTE_S_PORTC "remote_s_portc" #define ENB_CONFIG_STRING_LOCAL_S_PORTD "local_s_portd" #define ENB_CONFIG_STRING_REMOTE_S_PORTD "remote_s_portd" +#define ENB_CONFIG_STRING_RRC_INACTIVITY_THRESHOLD "rrc_inactivity_threshold" /*-----------------------------------------------------------------------------------------------------------------------------------------*/ /* cell configuration parameters */ @@ -217,6 +218,7 @@ typedef enum { {ENB_CONFIG_STRING_REMOTE_S_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ {ENB_CONFIG_STRING_LOCAL_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ {ENB_CONFIG_STRING_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_RRC_INACTIVITY_THRESHOLD, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ } #define ENB_ENB_ID_IDX 0 #define ENB_CELL_TYPE_IDX 1 @@ -232,6 +234,8 @@ typedef enum { #define ENB_REMOTE_S_PORTC_IDX 11 #define ENB_LOCAL_S_PORTD_IDX 12 #define ENB_REMOTE_S_PORTD_IDX 13 +#define ENB_RRC_INACTIVITY_THRES_IDX 14 + #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} #define ENBPARAMS_CHECK { \ @@ -249,6 +253,7 @@ typedef enum { { .s5 = { NULL } }, \ { .s5 = { NULL } }, \ { .s5 = { NULL } }, \ + { .s5 = { NULL } }, \ } /*-------------------------------------------------------------------------------------------------------------------------------------------------*/ From 5d82287fa5b5a543901185217c150664eb7ddb6f Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 20 Mar 2019 21:47:56 +0100 Subject: [PATCH 02/28] CI: fully testing RRC Inactivity timers -- Connecting eNB to a Flexran Ctrler -- Checking eNB status for UEs through flexran Signed-off-by: Raphael Defosseux --- .../enb.band7.tm1.25PRB.usrpb210.conf | 6 +- ci-scripts/main.py | 95 +++++++++++++++++-- .../enb_usrp210_band7_test_05mhz_tm1.xml | 36 ++++++- 3 files changed, 127 insertions(+), 10 deletions(-) diff --git a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf index 808a01fc54..f7ca1ef0b6 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf @@ -243,9 +243,9 @@ THREAD_STRUCT = ( NETWORK_CONTROLLER : { - FLEXRAN_ENABLED = "no"; - FLEXRAN_INTERFACE_NAME = "lo"; - FLEXRAN_IPV4_ADDRESS = "127.0.0.1"; + FLEXRAN_ENABLED = "yes"; + FLEXRAN_INTERFACE_NAME = "eth0"; + FLEXRAN_IPV4_ADDRESS = "CI_MME_IP_ADDR"; FLEXRAN_PORT = 2210; FLEXRAN_CACHE = "/mnt/oai_agent_cache"; FLEXRAN_AWAIT_RECONF = "no"; diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 5177e3f57c..79991dd2d1 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -129,6 +129,9 @@ class SSHConnection(): self.eNBCpuNb = '' self.eNBCpuModel = '' self.eNBCpuMHz = '' + self.flexranCtrlInstalled = False + self.flexranCtrlStarted = False + self.expectedNbOfConnectedUEs = 0 def open(self, ipaddress, username, password): count = 0 @@ -388,6 +391,37 @@ class SSHConnection(): self.close() self.CreateHtmlTestRow(self.EPCType, 'OK', ALL_PROCESSES_OK) + def CheckFlexranCtrlInstallation(self): + if self.EPCIPAddress == '' or self.EPCUserName == '' or self.EPCPassword == '': + return + self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) + self.command('ls -ls /opt/flexran_rtc/*/rt_controller', '\$', 5) + result = re.search('/opt/flexran_rtc/build/rt_controller', str(self.ssh.before)) + if result is not None: + self.flexranCtrlInstalled = True + logging.debug('Flexran Controller is installed') + self.close() + + def InitializeFlexranCtrl(self): + if self.flexranCtrlInstalled == False: + return + if self.EPCIPAddress == '' or self.EPCUserName == '' or self.EPCPassword == '': + Usage() + sys.exit('Insufficient Parameter') + self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) + self.command('cd /opt/flexran_rtc', '\$', 5) + self.command('echo ' + self.EPCPassword + ' | sudo -S rm -f log/*.log', '\$', 5) + self.command('echo ' + self.EPCPassword + ' | sudo -S echo "build/rt_controller -c log_config/basic_log" > ./my-flexran-ctl.sh', '\$', 5) + self.command('echo ' + self.EPCPassword + ' | sudo -S chmod 755 ./my-flexran-ctl.sh', '\$', 5) + self.command('echo ' + self.EPCPassword + ' | sudo -S daemon --unsafe --name=flexran_rtc_daemon --chdir=/opt/flexran_rtc -o /opt/flexran_rtc/log/flexranctl_' + self.testCase_id + '.log ././my-flexran-ctl.sh', '\$', 5) + self.command('ps -aux | grep --color=never rt_controller', '\$', 5) + result = re.search('rt_controller -c ', str(self.ssh.before)) + if result is not None: + logging.debug('\u001B[1m Initialize FlexRan Controller Completed\u001B[0m') + self.flexranCtrlStarted = True + self.close() + self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) + def InitializeeNB(self): if self.eNBIPAddress == '' or self.eNBUserName == '' or self.eNBPassword == '' or self.eNBSourceCodePath == '': Usage() @@ -449,6 +483,8 @@ class SSHConnection(): self.command('cp ' + full_config_file + ' ' + ci_full_config_file, '\$', 5) self.command('sed -i -e \'s/CI_MME_IP_ADDR/' + self.EPCIPAddress + '/\' ' + ci_full_config_file, '\$', 2); self.command('sed -i -e \'s/CI_ENB_IP_ADDR/' + self.eNBIPAddress + '/\' ' + ci_full_config_file, '\$', 2); + if self.flexranCtrlInstalled == False or self.flexranCtrlStarted == False: + self.command('sed -i -e \'s/FLEXRAN_ENABLED.*;/FLEXRAN_ENABLED = "no";/\' ' + ci_full_config_file, '\$', 2); # Launch eNB with the modified config file self.command('source oaienv', '\$', 5) self.command('cd cmake_targets', '\$', 5) @@ -1077,9 +1113,28 @@ class SSHConnection(): multi_jobs.append(p) for job in multi_jobs: job.join() + if self.flexranCtrlInstalled and self.flexranCtrlStarted: + self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) + self.command('cd /opt/flexran_rtc', '\$', 5) + self.command('curl http://localhost:9999/stats | jq \'.\' > log/check_status_' + self.testCase_id + '.log 2>&1', '\$', 5) + self.command('cat log/check_status_' + self.testCase_id + '.log | jq \'.eNB_config[0].UE\' | grep -c rnti | sed -e "s#^#Nb Connected UE = #"', '\$', 5) + result = re.search('Nb Connected UE = (?P[0-9]+)', str(self.ssh.before)) + passStatus = True + if result is not None: + nb_ues = int(result.group('nb_ues')) + htmlOptions = 'Nb Connected UE(s) to eNB = ' + str(nb_ues) + logging.debug(htmlOptions) + if self.expectedNbOfConnectedUEs > -1: + if nb_ues != self.expectedNbOfConnectedUEs: + passStatus = False + else: + htmlOptions = 'N/A' + self.close() + else: + htmlOptions = 'N/A' if (status_queue.empty()): - self.CreateHtmlTestRow('N/A', 'KO', ALL_PROCESSES_OK) + self.CreateHtmlTestRow(htmlOptions, 'KO', ALL_PROCESSES_OK) self.AutoTerminateUEandeNB() self.CreateHtmlTabFooter(False) sys.exit(1) @@ -1094,10 +1149,10 @@ class SSHConnection(): message = status_queue.get() html_cell = '
UE (' + device_id + ')\n' + message + '
' html_queue.put(html_cell) - if (check_status): - self.CreateHtmlTestRowQueue('N/A', 'OK', len(self.UEDevices), html_queue) + if check_status and passStatus: + self.CreateHtmlTestRowQueue(htmlOptions, 'OK', len(self.UEDevices), html_queue) else: - self.CreateHtmlTestRowQueue('N/A', 'KO', len(self.UEDevices), html_queue) + self.CreateHtmlTestRowQueue(htmlOptions, 'KO', len(self.UEDevices), html_queue) self.AutoTerminateUEandeNB() self.CreateHtmlTabFooter(False) sys.exit(1) @@ -1785,6 +1840,8 @@ class SSHConnection(): logStatus = self.AnalyzeLogFile_eNB(self.eNBLogFile) if logStatus < 0: result = logStatus + if self.flexranCtrlInstalled and self.flexranCtrlStarted: + self.TerminateFlexranCtrl() return result def CheckeNBProcess(self, status_queue): @@ -2079,7 +2136,6 @@ class SSHConnection(): else: self.command('cd ' + self.EPCSourceCodePath, '\$', 5) self.command('cd scripts', '\$', 5) - self.command('rm -f ./kill_hss.sh', '\$', 5) self.command('echo ' + self.EPCPassword + ' | sudo -S daemon --name=simulated_hss --stop', '\$', 5) time.sleep(1) self.command('echo ' + self.EPCPassword + ' | sudo -S killall --signal SIGKILL hss_sim', '\$', 5) @@ -2116,6 +2172,21 @@ class SSHConnection(): self.close() self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) + def TerminateFlexranCtrl(self): + if self.flexranCtrlInstalled == False or self.flexranCtrlStarted == False: + return + if self.EPCIPAddress == '' or self.EPCUserName == '' or self.EPCPassword == '': + Usage() + sys.exit('Insufficient Parameter') + self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) + self.command('echo ' + self.EPCPassword + ' | sudo -S daemon --name=flexran_rtc_daemon --stop', '\$', 5) + time.sleep(1) + self.command('echo ' + self.EPCPassword + ' | sudo -S killall --signal SIGKILL rt_controller', '\$', 5) + time.sleep(1) + self.close() + self.flexranCtrlStarted = False + self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) + def TerminateUE_common(self, device_id): try: self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) @@ -2607,7 +2678,7 @@ def Usage(): print('------------------------------------------------------------') def CheckClassValidity(action,id): - if action != 'Build_eNB' and action != 'Initialize_eNB' and action != 'Terminate_eNB' and action != 'Initialize_UE' and action != 'Terminate_UE' and action != 'Attach_UE' and action != 'Detach_UE' and action != 'DataDisable_UE' and action != 'DataEnable_UE' and action != 'CheckStatusUE' and action != 'Ping' and action != 'Iperf' and action != 'Reboot_UE' and action != 'Initialize_HSS' and action != 'Terminate_HSS' and action != 'Initialize_MME' and action != 'Terminate_MME' and action != 'Initialize_SPGW' and action != 'Terminate_SPGW' and action != 'Initialize_CatM_module' and action != 'Terminate_CatM_module' and action != 'Attach_CatM_module' and action != 'Detach_CatM_module' and action != 'Ping_CatM_module' and action != 'IdleSleep': + if action != 'Build_eNB' and action != 'Initialize_eNB' and action != 'Terminate_eNB' and action != 'Initialize_UE' and action != 'Terminate_UE' and action != 'Attach_UE' and action != 'Detach_UE' and action != 'DataDisable_UE' and action != 'DataEnable_UE' and action != 'CheckStatusUE' and action != 'Ping' and action != 'Iperf' and action != 'Reboot_UE' and action != 'Initialize_FlexranCtrl' and action != 'Terminate_FlexranCtrl' and action != 'Initialize_HSS' and action != 'Terminate_HSS' and action != 'Initialize_MME' and action != 'Terminate_MME' and action != 'Initialize_SPGW' and action != 'Terminate_SPGW' and action != 'Initialize_CatM_module' and action != 'Terminate_CatM_module' and action != 'Attach_CatM_module' and action != 'Detach_CatM_module' and action != 'Ping_CatM_module' and action != 'IdleSleep': logging.debug('ERROR: test-case ' + id + ' has wrong class ' + action) return False return True @@ -2634,6 +2705,13 @@ def GetParametersFromXML(action): else: SSH.nbMaxUEtoAttach = int(nbMaxUEtoAttach) + if action == 'CheckStatusUE': + expectedNBUE = test.findtext('expectedNbOfConnectedUEs') + if (expectedNBUE is None): + SSH.expectedNbOfConnectedUEs = -1 + else: + SSH.expectedNbOfConnectedUEs = int(expectedNBUE) + if action == 'Ping' or action == 'Ping_CatM_module': SSH.ping_args = test.findtext('ping_args') SSH.ping_packetloss_threshold = test.findtext('ping_packetloss_threshold') @@ -2881,6 +2959,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE): else: logging.debug('ERROR: requested test is invalidly formatted: ' + test) sys.exit(1) + SSH.CheckFlexranCtrlInstallation() #get the list of tests to be done todo_tests=[] @@ -2958,6 +3037,10 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE): SSH.InitializeSPGW() elif action == 'Terminate_SPGW': SSH.TerminateSPGW() + elif action == 'Initialize_FlexranCtrl': + SSH.InitializeFlexranCtrl() + elif action == 'Terminate_FlexranCtrl': + SSH.TerminateFlexranCtrl() elif action == 'IdleSleep': SSH.IdleSleep() else: diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml index 017b39454e..bbdc56be4b 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml @@ -26,7 +26,10 @@ tasks 040101 - 030101 040301 040501 000010 040302 000001 000011 040303 000002 040502 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201 + 030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201 + 050102 + 030102 040301 040502 000010 040302 000001 000011 040303 000002 000012 040503 040401 040201 030201 + 050202 @@ -45,11 +48,29 @@ CheckStatusUE Check UE(s) status before data disabling + 2 CheckStatusUE Check UE(s) status after data disabling + 0 + + + + CheckStatusUE + Check UE(s) status after data re-enabling + 2 + + + + Initialize_FlexranCtrl + Starting Flexran Controller + + + + Terminate_FlexranCtrl + Stopping Flexran Controller @@ -58,6 +79,12 @@ -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf + + Initialize_eNB + Initialize eNB (FDD/Band7/5MHz) + -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf + + Terminate_eNB Terminate eNB @@ -107,6 +134,13 @@ 5 + + Ping + ping (5MHz - 20 sec) + -c 20 + 5 + + Iperf iperf (5MHz - DL/15Mbps/UDP)(30 sec)(balanced profile) From 8bd3075a3bd222dc4129e25d442f15846f41df05 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 21 Mar 2019 16:18:16 +0100 Subject: [PATCH 03/28] CI: more details on the UE status Signed-off-by: Raphael Defosseux --- ci-scripts/main.py | 41 ++++++++++++++++--- .../enb_usrp210_band7_test_05mhz_tm1.xml | 12 ++++-- 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 79991dd2d1..5f737361ac 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -1079,15 +1079,44 @@ class SSHConnection(): def CheckUEStatus_common(self, lock, device_id, statusQueue): try: self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) + self.command('stdbuf -o0 adb -s ' + device_id + ' shell dumpsys telephony.registry', '\$', 15) + result = re.search('mServiceState=(?P[0-9]+)', str(self.ssh.before)) + serviceState = 'Service State: UNKNOWN' + if result is not None: + lServiceState = int(result.group('serviceState')) + if lServiceState == 3: + serviceState = 'Service State: RADIO_POWERED_OFF' + if lServiceState == 1: + serviceState = 'Service State: OUT_OF_SERVICE' + if lServiceState == 0: + serviceState = 'Service State: IN_SERVICE' + if lServiceState == 2: + serviceState = 'Service State: EMERGENCY_ONLY' + result = re.search('mDataConnectionState=(?P[0-9]+)', str(self.ssh.before)) + dataConnectionState = 'Data State: UNKNOWN' + if result is not None: + lDataConnectionState = int(result.group('dataConnectionState')) + if lDataConnectionState == 0: + dataConnectionState = 'Data State: DISCONNECTED' + if lDataConnectionState == 1: + dataConnectionState = 'Data State: CONNECTING' + if lDataConnectionState == 2: + dataConnectionState = 'Data State: CONNECTED' + if lDataConnectionState == 3: + dataConnectionState = 'Data State: SUSPENDED' + result = re.search('mDataConnectionReason=(?P[0-9a-zA-Z_]+)', str(self.ssh.before)) + dataConnectionReason = 'Data Reason: UNKNOWN' + if result is not None: + dataConnectionReason = 'Data Reason: ' + result.group('dataConnectionReason') lock.acquire() logging.debug('\u001B[1;37;44m Status Check (' + str(device_id) + ') \u001B[0m') - #logging.debug('\u001B[1;34m ' + pal_msg + '\u001B[0m') - #logging.debug('\u001B[1;34m ' + min_msg + '\u001B[0m') - #logging.debug('\u001B[1;34m ' + avg_msg + '\u001B[0m') - #logging.debug('\u001B[1;34m ' + max_msg + '\u001B[0m') + logging.debug('\u001B[1;34m ' + serviceState + '\u001B[0m') + logging.debug('\u001B[1;34m ' + dataConnectionState + '\u001B[0m') + logging.debug('\u001B[1;34m ' + dataConnectionReason + '\u001B[0m') statusQueue.put(0) statusQueue.put(device_id) - statusQueue.put('Nothing for the moment') + qMsg = serviceState + '\n' + dataConnectionState + '\n' + dataConnectionReason + statusQueue.put(qMsg) lock.release() self.close() except: @@ -1123,7 +1152,7 @@ class SSHConnection(): if result is not None: nb_ues = int(result.group('nb_ues')) htmlOptions = 'Nb Connected UE(s) to eNB = ' + str(nb_ues) - logging.debug(htmlOptions) + logging.debug('\u001B[1;37;44m ' + htmlOptions + ' \u001B[0m') if self.expectedNbOfConnectedUEs > -1: if nb_ues != self.expectedNbOfConnectedUEs: passStatus = False diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml index bbdc56be4b..63b96d7744 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml @@ -28,7 +28,7 @@ 040101 030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201 050102 - 030102 040301 040502 000010 040302 000001 000011 040303 000002 000012 040503 040401 040201 030201 + 030102 000010 040301 040502 000011 040302 000001 000012 040303 000002 000013 040503 040401 040201 030201 050202 @@ -46,18 +46,24 @@ + CheckStatusUE + Check UE(s) status before attachment + 0 + + + CheckStatusUE Check UE(s) status before data disabling 2 - + CheckStatusUE Check UE(s) status after data disabling 0 - + CheckStatusUE Check UE(s) status after data re-enabling 2 From c153ee12044a4e5019ac58489dabd2412f735819 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 16 Apr 2019 10:33:17 +0200 Subject: [PATCH 04/28] CI: fix after bad merge in main.py Signed-off-by: Raphael Defosseux --- ci-scripts/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 0395ed84b8..ab2ffc6606 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -1246,8 +1246,9 @@ class SSHConnection(): if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': Usage() sys.exit('Insufficient Parameter') - initialize_eNB_flag = False - pStatus = self.CheckProcessExist(initialize_eNB_flag) + check_eNB = True + check_OAI_UE = False + pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE) if (pStatus < 0): self.CreateHtmlTestRow('N/A', 'KO', pStatus) self.CreateHtmlTabFooter(False) @@ -3731,7 +3732,6 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re SSH.ShowTestID() GetParametersFromXML(action) if action == 'Initialize_UE' or action == 'Attach_UE' or action == 'Detach_UE' or action == 'Ping' or action == 'Iperf' or action == 'Reboot_UE' or action == 'DataDisable_UE' or action == 'DataEnable_UE' or action == 'CheckStatusUE': - if action == 'Initialize_UE' or action == 'Attach_UE' or action == 'Detach_UE' or action == 'Ping' or action == 'Iperf' or action == 'Reboot_UE': if (SSH.ADBIPAddress != 'none'): terminate_ue_flag = False SSH.GetAllUEDevices(terminate_ue_flag) From 24b46f3f020ca5f59033199b1a38fd0bbc26294d Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 19 Apr 2019 12:17:02 +0200 Subject: [PATCH 05/28] CI: running the RRC Inactivity Timer scenarion first once without flexran controller Signed-off-by: Raphael Defosseux --- .../enb.band7.tm1.25PRB.usrpb210.conf | 2 +- ci-scripts/main.py | 5 +- .../enb_usrp210_band7_test_05mhz_tm1.xml | 51 +++++++++++++++++-- 3 files changed, 53 insertions(+), 5 deletions(-) diff --git a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf index f7ca1ef0b6..c895151981 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf @@ -243,7 +243,7 @@ THREAD_STRUCT = ( NETWORK_CONTROLLER : { - FLEXRAN_ENABLED = "yes"; + FLEXRAN_ENABLED = "no"; FLEXRAN_INTERFACE_NAME = "eth0"; FLEXRAN_IPV4_ADDRESS = "CI_MME_IP_ADDR"; FLEXRAN_PORT = 2210; diff --git a/ci-scripts/main.py b/ci-scripts/main.py index ab2ffc6606..89c022e772 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -535,7 +535,9 @@ class SSHConnection(): self.command('cp ' + full_config_file + ' ' + ci_full_config_file, '\$', 5) self.command('sed -i -e \'s/CI_MME_IP_ADDR/' + self.EPCIPAddress + '/\' ' + ci_full_config_file, '\$', 2); self.command('sed -i -e \'s/CI_ENB_IP_ADDR/' + self.eNBIPAddress + '/\' ' + ci_full_config_file, '\$', 2); - if self.flexranCtrlInstalled == False or self.flexranCtrlStarted == False: + if self.flexranCtrlInstalled and self.flexranCtrlStarted: + self.command('sed -i -e \'s/FLEXRAN_ENABLED.*;/FLEXRAN_ENABLED = "yes";/\' ' + ci_full_config_file, '\$', 2); + else: self.command('sed -i -e \'s/FLEXRAN_ENABLED.*;/FLEXRAN_ENABLED = "no";/\' ' + ci_full_config_file, '\$', 2); # Launch eNB with the modified config file self.command('source oaienv', '\$', 5) @@ -1281,6 +1283,7 @@ class SSHConnection(): htmlOptions = 'N/A' self.close() else: + passStatus = True htmlOptions = 'N/A' if (status_queue.empty()): diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml index 63b96d7744..c9dd913309 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml @@ -27,8 +27,9 @@ 040101 030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201 - 050102 030102 000010 040301 040502 000011 040302 000001 000012 040303 000002 000013 040503 040401 040201 030201 + 050102 + 030102 000020 040301 040504 000021 040302 000001 000022 040303 000002 040504 000023 040401 040201 030201 050202 @@ -41,8 +42,8 @@ IdleSleep - Waiting for 5 seconds - 5 + Waiting for 10 seconds + 10 @@ -69,6 +70,30 @@ 2 + + CheckStatusUE + Check UE(s) status before attachment + 0 + + + + CheckStatusUE + Check UE(s) status before data disabling + 2 + + + + CheckStatusUE + Check UE(s) status after data disabling + 0 + + + + CheckStatusUE + Check UE(s) status after data re-enabling + 2 + + Initialize_FlexranCtrl Starting Flexran Controller @@ -91,6 +116,12 @@ -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf + + Initialize_eNB + Initialize eNB (FDD/Band7/5MHz) + -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf + + Terminate_eNB Terminate eNB @@ -147,6 +178,20 @@ 5 + + Ping + ping (5MHz - 20 sec) + -c 20 + 5 + + + + Ping + ping (5MHz - 20 sec) + -c 20 + 5 + + Iperf iperf (5MHz - DL/15Mbps/UDP)(30 sec)(balanced profile) From 615a56fff6412bd31b984a1cf69f9c3cdfca3ddd Mon Sep 17 00:00:00 2001 From: frtabu Date: Mon, 29 Apr 2019 18:33:59 +0200 Subject: [PATCH 06/28] Remove deprecated build options, now available as config options: noS1, basic_simulator. Remove DISABLE_LOG_X macros, disabling logs now available via disabling the T_TRACER --- cmake_targets/CMakeLists.txt | 84 +---- cmake_targets/build_oai | 229 ++----------- common/utils/LOG/log.h | 6 +- openair1/PHY/INIT/lte_parms.c | 198 +++++------ .../PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c | 52 +-- openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c | 318 +++++++----------- openair2/ENB_APP/flexran_agent_common.c | 38 ++- openair2/LAYER2/MAC/ue_procedures.c | 7 +- 8 files changed, 270 insertions(+), 662 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 7ff9e11297..f578fccb38 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -247,10 +247,7 @@ add_boolean_option(T_TRACER True "Activate the T tracer, a debugging add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs") add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace") add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace") -add_boolean_option(DISABLE_LOG_X False "Deactivate all LOG_* macros") add_boolean_option(USRP_REC_PLAY False "Enable USRP record playback mode") -#add_boolean_option(UE_NAS_USE_TUN False "Enable UE NAS TUN device instead of ue_ip.ko") -add_boolean_option(BASIC_SIMULATOR False "Has to be True when building the basic simulator, False otherwise") add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering") @@ -2116,46 +2113,6 @@ target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CR target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (lte-softmodem ${T_LIB}) -# lte-softmodem-nos1 is both eNB and UE implementation -################################################### -add_executable(lte-softmodem-nos1 - ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c - ${OPENAIR_TARGETS}/RT/USER/lte-enb.c - ${OPENAIR_TARGETS}/RT/USER/lte-ru.c - ${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c - ${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c - ${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c - ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c - ${OPENAIR_TARGETS}/COMMON/create_tasks.c - ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c - ${OPENAIR2_DIR}/RRC/NAS/nas_config.c - ${OPENAIR2_DIR}/RRC/NAS/rb_config.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/system.c - ${GTPU_need_ITTI} - ${XFORMS_SOURCE} - ${XFORMS_SOURCE_SOFTMODEM} - ${T_SOURCE} - ${CONFIG_SOURCES} - ${SHLIB_LOADER_SOURCES} - ) - -add_dependencies(lte-softmodem-nos1 rrc_flag s1ap_flag x2_flag) - -target_link_libraries (lte-softmodem-nos1 - -Wl,--start-group - RRC_LIB F1AP F1AP_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} LFDS7 - NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB - -Wl,--end-group z dl) - -target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES}) -target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES}) -target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES}) -target_link_libraries (lte-softmodem-nos1 ${T_LIB}) # lte-uesoftmodem is UE implementation ####################################### @@ -2197,46 +2154,7 @@ target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${ target_link_libraries (lte-uesoftmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (lte-uesoftmodem ${T_LIB}) -# lte-uesoftmodem-nos1 is UE implementation -################################################### -add_executable(lte-uesoftmodem-nos1 - ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c - ${OPENAIR_TARGETS}/RT/USER/lte-ue.c - ${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c - ${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c - ${OPENAIR_TARGETS}/RT/USER/lte-ru.c - ${OPENAIR_TARGETS}/RT/USER/rfsim.c - ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c - ${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c - ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c - ${OPENAIR2_DIR}/RRC/NAS/nas_config.c - ${OPENAIR2_DIR}/RRC/NAS/rb_config.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c - ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/system.c - ${XFORMS_SOURCE} - ${XFORMS_SOURCE_SOFTMODEM} - ${T_SOURCE} - ${CONFIG_SOURCES} - ${SHLIB_LOADER_SOURCES} - ) -add_dependencies(lte-uesoftmodem-nos1 rrc_flag s1ap_flag x2_flag) - -target_link_libraries (lte-uesoftmodem-nos1 - -Wl,--start-group - RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB F1AP F1AP_LIB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} - NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB - -Wl,--end-group z dl) - -target_link_libraries (lte-uesoftmodem-nos1 ${LIBXML2_LIBRARIES}) -target_link_libraries (lte-uesoftmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) -target_link_libraries (lte-uesoftmodem-nos1 ${LIB_LMS_LIBRARIES}) -target_link_libraries (lte-uesoftmodem-nos1 ${T_LIB}) # USIM process ################# #add_executable(usim @@ -2356,7 +2274,7 @@ endforeach(myExe) if (${T_TRACER}) foreach(i #all "add_executable" definitions (except tests, rb_tool, updatefw) - lte-softmodem lte-softmodem-nos1 lte-uesoftmodem lte-uesoftmodem-nos1 + lte-softmodem lte-uesoftmodem dlsim_tm4 dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim ulsim cu_test du_test #all "add_library" definitions diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 9d8a609671..74627d620d 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -52,7 +52,6 @@ CPU_AFFINITY_FLAG_USER="False" #Only valid when lowlatecy flag is set to False REL="Rel14" HW="None" TP="None" -NOS1=0 EPC=0 VERBOSE_COMPILE=0 CFLAGS_PROCESSOR_USER="" @@ -66,10 +65,8 @@ CMAKE_CMD="$CMAKE" UE_AUTOTEST_TRACE="False" UE_DEBUG_TRACE="False" UE_TIMING_TRACE="False" -DISABLE_LOG_X="False" USRP_REC_PLAY="False" BUILD_ECLIPSE=0 -UE_NAS_USE_TUN="False" BASIC_SIMULATOR=0 trap handle_ctrl_c INT @@ -130,8 +127,6 @@ Options --install-system-files Install OpenArInterface required files in Linux system (will ask root password) ---noS1 - Compiles lte-softmodem without S1 interface, using direct link to IP instead --verbose-compile Shows detailed compilation instructions in makefile --cflags_processor @@ -154,8 +149,6 @@ Options Enable traces for UE debugging --ue-timing Enable traces for timing ---disable-log - Disable all LOG_* macros --build-eclipse Build eclipse project files. Paths are auto corrected by fixprj.sh --build-telnet @@ -164,8 +157,6 @@ Options Build MSC tracing utility, specify --msc on command line to start it (eNB and UE) --usrp-recplay Build for I/Q record-playback modes ---ue-nas-use-tun - Use TUN devices for the UEs instead of ue_ip.ko --basic-simulator Generates a basic [1 UE + 1 eNB + no channel] simulator. See targets/ARCH/tcp_bridge/README.tcp_bridge_oai for documentation. @@ -294,10 +285,6 @@ function main() { INSTALL_SYSTEM_FILES=1 echo_info "Will copy OpenAirInterface files in Linux directories" shift;; - --noS1) - NOS1=1 - echo_info "Will compile without S1 interface" - shift;; --verbose-compile) VERBOSE_COMPILE=1 echo_info "Will compile with verbose instructions" @@ -340,11 +327,7 @@ function main() { shift 1;; --ue-timing) UE_TIMING_TRACE="True" - echo_info "Enabling UE timing trace" - shift 1;; - --disable-log) - DISABLE_LOG_X="True" - echo_info "Disabling all LOG_* traces" + x echo_info "Enabling UE timing trace" shift 1;; --uhd-images-dir) UHD_IMAGES_DIR=$2 @@ -367,17 +350,13 @@ function main() { USRP_REC_PLAY="True" echo_info "Enabling USRP record playback mode" shift 1;; - --ue-nas-use-tun) - UE_NAS_USE_TUN="True" - echo_info "Enabling UE NAS TUN device usage instead of ue_ip.ko" - shift 1;; --basic-simulator) BASIC_SIMULATOR=1 - echo_info "Compiling the basic simulator" + echo_info "Compiling the basic simulator device" shift 1;; --rfsimulator) RFSIMULATOR=true - echo_info "Compiling the RF simulator" + echo_info "Compiling the RF simulator device" shift 1;; -h | --help) print_help @@ -504,15 +483,10 @@ function main() { if [ "$T_TRACER" = "False" ] ; then noLOGDirsuffix="_noLOG" fi - if [ "$NOS1" = "1" ] ; then - noS1Dir="_noS1" - bin_suffix="-nos1" - else - lte_build_dir=lte_build_oai - bin_suffix="" - fi + lte_build_dir=lte_build_oai + bin_suffix="" - lte_build_dir="lte${noS1Dir}_build_oai${noLOGDirsuffix}" + lte_build_dir="lte_build_oai${noLOGDirsuffix}" # configuration module libraries, one currently available, using libconfig config_libconfig_shlib=params_libconfig @@ -545,13 +519,7 @@ function main() { echo "set (UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE)" >> $cmake_file echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)" >> $cmake_file echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file - echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file - if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then - echo_info "Compiling UE S1 build : enabling Linux and NETLINK" - echo "set (LINUX True )" >> $cmake_file - echo "set (PDCP_USE_NETLINK True )" >> $cmake_file - fi echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file cd $DIR/$lte_build_dir/build eval $CMAKE_CMD @@ -570,46 +538,41 @@ function main() { compilations \ $lte_build_dir coding \ libcoding.so $dbin/libcoding.so - - if [ "$NOS1" = "1" ] ; then - compilations \ - $lte_build_dir nasmesh \ - CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko - compilations \ - $lte_build_dir rb_tool \ - rb_tool $dbin/rb_tool - cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin - fi +# optional libs (used when noS1 with kernel modules + compilations \ + $lte_build_dir nasmesh \ + CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko + compilations \ + $lte_build_dir rb_tool \ + rb_tool $dbin/rb_tool + cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin fi if [ "$UE" = 1 ] ; then - lte_exec=lte-uesoftmodem${bin_suffix} - compilations \ - $lte_build_dir $lte_exec \ - $lte_exec $dbin/$lte_exec.$REL - - # mandatory shared lib - compilations \ - $lte_build_dir $config_libconfig_shlib \ - lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so - compilations \ - $lte_build_dir coding \ - libcoding.so $dbin/libcoding.so - - if [ "$NOS1" = "1" ] ; then - compilations \ - $lte_build_dir nasmesh \ - CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko - compilations \ - $lte_build_dir rb_tool \ - rb_tool $dbin/rb_tool - cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin - else - # ue_ip driver compilation - echo_info "Compiling UE specific part" + lte_exec=lte-uesoftmodem${bin_suffix} compilations \ - $lte_build_dir ue_ip \ - CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko + $lte_build_dir $lte_exec \ + $lte_exec $dbin/$lte_exec.$REL + + # mandatory shared lib + compilations \ + $lte_build_dir $config_libconfig_shlib \ + lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so + compilations \ + $lte_build_dir coding \ + libcoding.so $dbin/libcoding.so +# optional libs (used when noS1 with kernel modules + compilations \ + $lte_build_dir nasmesh \ + CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko + compilations \ + $lte_build_dir rb_tool \ + rb_tool $dbin/rb_tool + cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin + # ue_ip driver compilation + 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 @@ -644,7 +607,6 @@ function main() { echo_warning "not generated UE NAS files: binaries not found" fi fi - fi if [ "$SIMUS_PHY" = "1" -o "$SIMUS_CORE" = "1" ] ; then cd $OPENAIR_DIR/cmake_targets/lte-simulators @@ -854,123 +816,6 @@ function main() { echo_info "10. Bypassing the Tests ..." fi - # basic simulator - ##################### - if [ "$BASIC_SIMULATOR" = "1" ]; then - echo_info "Build basic simulator" - [ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/basic_simulator - [ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/nas_sim_tools/build - mkdir -p $OPENAIR_DIR/cmake_targets/basic_simulator - mkdir -p $OPENAIR_DIR/cmake_targets/basic_simulator/enb - mkdir -p $OPENAIR_DIR/cmake_targets/basic_simulator/ue - mkdir -p $OPENAIR_DIR/cmake_targets/nas_sim_tools/build - - # enb - - cmake_file=$OPENAIR_DIR/cmake_targets/basic_simulator/enb/CMakeLists.txt - echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file - echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file - echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file - echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file - echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file - echo "set ( XFORMS $XFORMS )" >> $cmake_file - echo "set ( RF_BOARD \"OAI_USRP\")" >> $cmake_file - echo "set ( TRANSP_PRO \"None\")" >> $cmake_file - echo "set(PACKAGE_NAME \"simulator_enb\")" >> $cmake_file - echo "set (DEADLINE_SCHEDULER \"False\" )" >> $cmake_file - echo "set (CPU_AFFINITY \"False\" )" >> $cmake_file - echo "set ( T_TRACER \"True\" )" >> $cmake_file - echo "set (UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE)" >> $cmake_file - echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)" >> $cmake_file - echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file - echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file - echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file - echo "set (BASIC_SIMULATOR \"True\" )" >> $cmake_file - echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)' >> $cmake_file - - echo_info "Build eNB" - echo_info "logs are in $dlog/basic_simulator_enb.txt" - set +e - { - cd $OPENAIR_DIR/cmake_targets/basic_simulator/enb - cmake . - make -j`nproc` lte-softmodem - make -j`nproc` coding params_libconfig tcp_bridge_oai - ln -sf libtcp_bridge_oai.so liboai_device.so - cd ../.. - } > $dlog/basic_simulator_enb.txt 2>&1 - set -e - if [ -s $OPENAIR_DIR/cmake_targets/basic_simulator/enb/lte-softmodem -a \ - -s $OPENAIR_DIR/cmake_targets/basic_simulator/enb/libcoding.so -a \ - -s $OPENAIR_DIR/cmake_targets/basic_simulator/enb/libparams_libconfig.so -a \ - -s $OPENAIR_DIR/cmake_targets/basic_simulator/enb/libtcp_bridge_oai.so ] ; then - echo_success "eNB compiled" - check_warnings "$dlog/basic_simulator_enb.txt" - else - echo_error "eNB compilation failed" - exit 1 - fi - - # ue - - echo_info "Compile conf2uedata" - cd $OPENAIR_DIR/cmake_targets/nas_sim_tools/build - eval $CMAKE_CMD - compilations \ - nas_sim_tools conf2uedata \ - conf2uedata $dbin/conf2uedata - - cmake_file=$OPENAIR_DIR/cmake_targets/basic_simulator/ue/CMakeLists.txt - echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file - echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file - echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file - echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file - echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file - echo "set ( XFORMS $XFORMS )" >> $cmake_file - echo "set ( RF_BOARD \"OAI_USRP\")" >> $cmake_file - echo "set ( TRANSP_PRO \"None\")" >> $cmake_file - echo "set(PACKAGE_NAME \"simulator_ue\")" >> $cmake_file - echo "set (DEADLINE_SCHEDULER \"False\" )" >> $cmake_file - echo "set (CPU_AFFINITY \"False\" )" >> $cmake_file - echo "set ( T_TRACER \"True\" )" >> $cmake_file - echo "set (UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE)" >> $cmake_file - echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)" >> $cmake_file - echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file - echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file - echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file - echo "set (LINUX True )" >> $cmake_file - echo "set (PDCP_USE_NETLINK True )" >> $cmake_file - echo "set (BASIC_SIMULATOR \"True\" )" >> $cmake_file -# echo "set (UE_NAS_USE_TUN \"True\" )" >> $cmake_file - echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)' >> $cmake_file - - echo_info "Build UE" - echo_info "logs are in $dlog/basic_simulator_ue.txt" - set +e - { - cd $OPENAIR_DIR/cmake_targets/basic_simulator/ue - cmake . - make -j`nproc` lte-uesoftmodem - make -j`nproc` coding params_libconfig tcp_bridge_oai - ln -sf libtcp_bridge_oai.so liboai_device.so - cd ../.. - } > $dlog/basic_simulator_ue.txt 2>&1 - set -e - if [ -s $OPENAIR_DIR/cmake_targets/basic_simulator/ue/lte-uesoftmodem -a \ - -s $OPENAIR_DIR/cmake_targets/basic_simulator/ue/libcoding.so -a \ - -s $OPENAIR_DIR/cmake_targets/basic_simulator/ue/libparams_libconfig.so -a \ - -s $OPENAIR_DIR/cmake_targets/basic_simulator/ue/libtcp_bridge_oai.so ] ; then - echo_success "UE compiled" - check_warnings "$dlog/basic_simulator_ue.txt" - else - echo_error "UE compilation failed" - exit 1 - fi - - echo_info "Generate UE SIM data" - $OPENAIR_DIR/targets/bin/conf2uedata -c $OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -o $OPENAIR_DIR/cmake_targets/basic_simulator/ue - - fi } main "$@" diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index dea756a3ac..1c413d580e 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -481,10 +481,10 @@ static inline void printMeas(char *txt, Meas *M, int period) { M->iterations, M->maxArray[1],M->maxArray[2], M->maxArray[3],M->maxArray[4], M->maxArray[5], M->maxArray[6],M->maxArray[7], M->maxArray[8],M->maxArray[9],M->maxArray[10]); -#if DISABLE_LOG_X - printf("%s",txt2); +#if T_TRACER + LOG_W(PHY,"%s",txt2); #else - LOG_W(PHY, "%s",txt2); + printf("%s",txt2); #endif } } diff --git a/openair1/PHY/INIT/lte_parms.c b/openair1/PHY/INIT/lte_parms.c index 03f226c637..4d149c0026 100644 --- a/openair1/PHY/INIT/lte_parms.c +++ b/openair1/PHY/INIT/lte_parms.c @@ -22,33 +22,22 @@ #include "phy_init.h" #include "common/utils/LOG/log.h" -uint16_t dl_S_table_normal[10]={3,9,10,11,12,3,9,10,11,6}; -uint16_t dl_S_table_extended[10]={3,8,9,10,3,8,9,5,0,0}; +uint16_t dl_S_table_normal[10]= {3,9,10,11,12,3,9,10,11,6}; +uint16_t dl_S_table_extended[10]= {3,8,9,10,3,8,9,5,0,0}; void set_S_config(LTE_DL_FRAME_PARMS *fp) { - int X = fp->srsX; - fp->ul_symbols_in_S_subframe=(1+X); if ((fp->Ncp==EXTENDED) && (fp->tdd_config_S>7)) AssertFatal(1==0,"Illegal S subframe configuration for Extended Prefix mode\n"); fp->dl_symbols_in_S_subframe = (fp->Ncp==NORMAL)?dl_S_table_normal[fp->tdd_config_S] : dl_S_table_extended[fp->tdd_config_S]; - - } -int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) -{ - +int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) { uint8_t log2_osf; - -#if DISABLE_LOG_X - printf("Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf); -#else LOG_I(PHY,"Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf); -#endif if (frame_parms->Ncp==EXTENDED) { frame_parms->nb_prefix_samples0=512; @@ -58,125 +47,109 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) frame_parms->nb_prefix_samples0 = 160; frame_parms->nb_prefix_samples = 144; frame_parms->symbols_per_tti = 14; - } - switch(osf) { - case 1: - log2_osf = 0; - break; + case 1: + log2_osf = 0; + break; - case 2: - log2_osf = 1; - break; + case 2: + log2_osf = 1; + break; - case 4: - log2_osf = 2; - break; + case 4: + log2_osf = 2; + break; - case 8: - log2_osf = 3; - break; + case 8: + log2_osf = 3; + break; - case 16: - log2_osf = 4; - break; + case 16: + log2_osf = 4; + break; - default: - AssertFatal(1==0,"Illegal oversampling %d\n",osf); - + default: + AssertFatal(1==0,"Illegal oversampling %d\n",osf); } switch (frame_parms->N_RB_DL) { + case 100: + AssertFatal(osf==1,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); - case 100: - AssertFatal(osf==1,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); - + if (frame_parms->threequarter_fs) { + frame_parms->ofdm_symbol_size = 1536; + frame_parms->samples_per_tti = 23040; + frame_parms->first_carrier_offset = 1536-600; + frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2; + frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2; + } else { + frame_parms->ofdm_symbol_size = 2048; + frame_parms->samples_per_tti = 30720; + frame_parms->first_carrier_offset = 2048-600; + } - if (frame_parms->threequarter_fs) { + frame_parms->N_RBGS = 4; + frame_parms->N_RBG = 25; + break; + + case 75: + AssertFatal(osf==1,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); frame_parms->ofdm_symbol_size = 1536; frame_parms->samples_per_tti = 23040; - frame_parms->first_carrier_offset = 1536-600; + frame_parms->first_carrier_offset = 1536-450; frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2; frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2; + frame_parms->N_RBGS = 4; + frame_parms->N_RBG = 25; + break; - } - else { - frame_parms->ofdm_symbol_size = 2048; - frame_parms->samples_per_tti = 30720; - frame_parms->first_carrier_offset = 2048-600; - } - frame_parms->N_RBGS = 4; - frame_parms->N_RBG = 25; - break; + case 50: + AssertFatal(osf==1,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); + frame_parms->ofdm_symbol_size = 1024*osf; + frame_parms->samples_per_tti = 15360*osf; + frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 300; + frame_parms->nb_prefix_samples>>=(1-log2_osf); + frame_parms->nb_prefix_samples0>>=(1-log2_osf); + frame_parms->N_RBGS = 3; + frame_parms->N_RBG = 17; + break; - case 75: - AssertFatal(osf==1,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); + case 25: + AssertFatal(osf<=2,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); + frame_parms->ofdm_symbol_size = 512*osf; + frame_parms->samples_per_tti = 7680*osf; + frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 150; + frame_parms->nb_prefix_samples>>=(2-log2_osf); + frame_parms->nb_prefix_samples0>>=(2-log2_osf); + frame_parms->N_RBGS = 2; + frame_parms->N_RBG = 13; + break; - frame_parms->ofdm_symbol_size = 1536; - frame_parms->samples_per_tti = 23040; - frame_parms->first_carrier_offset = 1536-450; - frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2; - frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2; - frame_parms->N_RBGS = 4; - frame_parms->N_RBG = 25; - break; + case 15: + frame_parms->ofdm_symbol_size = 256*osf; + frame_parms->samples_per_tti = 3840*osf; + frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 90; + frame_parms->nb_prefix_samples>>=(3-log2_osf); + frame_parms->nb_prefix_samples0>>=(3-log2_osf); + frame_parms->N_RBGS = 2; + frame_parms->N_RBG = 8; + break; - case 50: - AssertFatal(osf==1,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); + case 6: + frame_parms->ofdm_symbol_size = 128*osf; + frame_parms->samples_per_tti = 1920*osf; + frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 36; + frame_parms->nb_prefix_samples>>=(4-log2_osf); + frame_parms->nb_prefix_samples0>>=(4-log2_osf); + frame_parms->N_RBGS = 1; + frame_parms->N_RBG = 6; + break; - frame_parms->ofdm_symbol_size = 1024*osf; - frame_parms->samples_per_tti = 15360*osf; - frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 300; - frame_parms->nb_prefix_samples>>=(1-log2_osf); - frame_parms->nb_prefix_samples0>>=(1-log2_osf); - frame_parms->N_RBGS = 3; - frame_parms->N_RBG = 17; - break; - - case 25: - AssertFatal(osf<=2,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); - - - frame_parms->ofdm_symbol_size = 512*osf; - - - frame_parms->samples_per_tti = 7680*osf; - frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 150; - frame_parms->nb_prefix_samples>>=(2-log2_osf); - frame_parms->nb_prefix_samples0>>=(2-log2_osf); - frame_parms->N_RBGS = 2; - frame_parms->N_RBG = 13; - - break; - - case 15: - frame_parms->ofdm_symbol_size = 256*osf; - frame_parms->samples_per_tti = 3840*osf; - frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 90; - frame_parms->nb_prefix_samples>>=(3-log2_osf); - frame_parms->nb_prefix_samples0>>=(3-log2_osf); - frame_parms->N_RBGS = 2; - frame_parms->N_RBG = 8; - - break; - - case 6: - frame_parms->ofdm_symbol_size = 128*osf; - frame_parms->samples_per_tti = 1920*osf; - frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 36; - frame_parms->nb_prefix_samples>>=(4-log2_osf); - frame_parms->nb_prefix_samples0>>=(4-log2_osf); - frame_parms->N_RBGS = 1; - frame_parms->N_RBG = 6; - - break; - - default: - AssertFatal(1==0,"Number of resource blocks (N_RB_DL %d) undefined, frame_parms = %p \n",frame_parms->N_RB_DL, frame_parms); - - break; + default: + AssertFatal(1==0,"Number of resource blocks (N_RB_DL %d) undefined, frame_parms = %p \n",frame_parms->N_RB_DL, frame_parms); + break; } LOG_I(PHY,"lte_parms.c: Setting N_RB_DL to %d, ofdm_symbol_size %d\n",frame_parms->N_RB_DL, frame_parms->ofdm_symbol_size); @@ -188,8 +161,7 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) } -void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms) -{ +void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms) { LOG_I(PHY,"frame_parms->N_RB_DL=%d\n",frame_parms->N_RB_DL); LOG_I(PHY,"frame_parms->N_RB_UL=%d\n",frame_parms->N_RB_UL); LOG_I(PHY,"frame_parms->Nid_cell=%d\n",frame_parms->Nid_cell); diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c index aafd579899..9573f66f79 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c @@ -62,14 +62,6 @@ int16_t dlsch_demod_shift = 0; int16_t interf_unaw_shift = 13; -//#define DEBUG_HARQ - -//#define DEBUG_PHY 1 -//#define DEBUG_DLSCH_DEMOD 1 - -//#define DISABLE_LOG_X - -// [MCS][i_mod (0,1,2) = (2,4,6)] unsigned char offset_mumimo_llr_drange_fix=0; //inferference-free case unsigned char interf_unaw_shift_tm4_mcs[29]= {5, 3, 4, 3, 3, 2, 1, 1, 2, 0, 1, 1, 1, 1, 0, 0, @@ -379,14 +371,9 @@ int rx_pdsch(PHY_VARS_UE *ue, #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,subframe,slot, - symbol,ue->high_speed_flag,type,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#else LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,subframe,slot,symbol, ue->high_speed_flag,type,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); #endif -#endif #if UE_TIMING_TRACE start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif @@ -412,13 +399,7 @@ int rx_pdsch(PHY_VARS_UE *ue, #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#else LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#endif -#endif -#if UE_TIMING_TRACE start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif @@ -527,15 +508,8 @@ int rx_pdsch(PHY_VARS_UE *ue, #endif #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,subframe,slot,symbol,first_symbol_flag, - ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#else LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,subframe,slot,symbol,first_symbol_flag, ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#endif -#endif -#if UE_TIMING_TRACE start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif @@ -758,16 +732,8 @@ int rx_pdsch(PHY_VARS_UE *ue, #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n",frame,subframe,slot,symbol,pdsch_vars[eNB_id]->log2_maxh,proc->channel_level, - ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#else LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d Channel Comp %5.2f \n",frame,subframe,slot,symbol,pdsch_vars[eNB_id]->log2_maxh, ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#endif -#endif - // MRC -#if UE_TIMING_TRACE start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif @@ -840,13 +806,7 @@ int rx_pdsch(PHY_VARS_UE *ue, #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#else LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#endif -#endif -#if UE_TIMING_TRACE start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif //printf("LLR dlsch0_harq->Qm %d rx_type %d cw0 %d cw1 %d symbol %d \n",dlsch0_harq->Qm,rx_type,codeword_TB0,codeword_TB1,symbol); @@ -1210,11 +1170,7 @@ int rx_pdsch(PHY_VARS_UE *ue, #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#else LOG_D(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#endif #endif // Please keep it: useful for debugging #if 0 @@ -1224,7 +1180,7 @@ int rx_pdsch(PHY_VARS_UE *ue, if(1) { #if 1 - LOG_M("rxdataF0.m" , "rxdataF0", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1); + LOG_M("rxdataF0.m", "rxdataF0", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1); //LOG_M("rxdataF1.m" , "rxdataF1", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1); LOG_M("dl_ch_estimates00.m", "dl_ch_estimates00", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][0][0],14*frame_parms->ofdm_symbol_size,1,1); //LOG_M("dl_ch_estimates01.m", "dl_ch_estimates01", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][1][0],14*frame_parms->ofdm_symbol_size,1,1); @@ -4767,8 +4723,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF, dl_ch0+=12; rxF+=12; - } - else { // Odd number of RBs + } else { // Odd number of RBs for (rb=0; rbN_RB_DL>>1; rb++) { #ifdef DEBUG_DLSCH_DEMOD printf("dlch_ext %u\n",dl_ch0_ext-&dl_ch_estimates_ext[aarx][0]); @@ -5811,8 +5766,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, dl_ch0+=12; rxF+=12; - } - else { // Odd number of RBs + } else { // Odd number of RBs for (rb=0; rbN_RB_DL>>1; rb++) { skip_half=0; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c b/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c index aac636f07c..26ad1d24ef 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c @@ -45,61 +45,56 @@ extern openair0_config_t openair0_cfg[]; //#define DEBUG_INITIAL_SYNCH -int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) -{ - +int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { uint8_t l,pbch_decoded,frame_mod4,pbch_tx_ant,dummy; LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; char phich_resource[6]; - #ifdef DEBUG_INITIAL_SYNCH LOG_I(PHY,"[UE%d] Initial sync: starting PBCH detection (rx_offset %d)\n",ue->Mod_id, ue->rx_offset); #endif for (l=0; lsymbols_per_tti/2; l++) { - slot_fep(ue, - l, - 0, - ue->rx_offset, - 0, - 1); + l, + 0, + ue->rx_offset, + 0, + 1); } + for (l=0; lsymbols_per_tti/2; l++) { - slot_fep(ue, - l, - 1, - ue->rx_offset, - 0, - 1); + l, + 1, + ue->rx_offset, + 0, + 1); } + slot_fep(ue, - 0, - 2, - ue->rx_offset, - 0, - 1); - + 0, + 2, + ue->rx_offset, + 0, + 1); lte_ue_measurements(ue, - ue->rx_offset, - 0, + ue->rx_offset, + 0, + 0, 0, - 0, 0); - if (ue->frame_parms.frame_type == TDD) { ue_rrc_measurements(ue, - 2, - 0); - } - else { + 2, + 0); + } else { ue_rrc_measurements(ue, - 0, - 0); + 0, + 0); } + #ifdef DEBUG_INITIAL_SYNCH LOG_I(PHY,"[UE %d] RX RSSI %d dBm, digital (%d, %d) dB, linear (%d, %d), avg rx power %d dB (%d lin), RX gain %d dB\n", ue->Mod_id, @@ -111,7 +106,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) ue->measurements.rx_power_avg_dB[0], ue->measurements.rx_power_avg[0], ue->rx_total_gain_dB); - LOG_I(PHY,"[UE %d] N0 %d dBm digital (%d, %d) dB, linear (%d, %d), avg noise power %d dB (%d lin)\n", ue->Mod_id, ue->measurements.n0_power_tot_dBm, @@ -122,7 +116,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) ue->measurements.n0_power_avg_dB, ue->measurements.n0_power_avg); #endif - pbch_decoded = 0; for (frame_mod4=0; frame_mod4<4; frame_mod4++) { @@ -153,94 +146,85 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) } } - if (pbch_decoded) { - frame_parms->nb_antenna_ports_eNB = pbch_tx_ant; - // set initial transmission mode to 1 or 2 depending on number of detected TX antennas // openair_daq_vars.dlsch_transmission_mode = (pbch_tx_ant>1) ? 2 : 1; - - // flip byte endian on 24-bits for MIB // dummy = ue->pbch_vars[0]->decoded_output[0]; // ue->pbch_vars[0]->decoded_output[0] = ue->pbch_vars[0]->decoded_output[2]; // ue->pbch_vars[0]->decoded_output[2] = dummy; - // now check for Bandwidth of Cell dummy = (ue->pbch_vars[0]->decoded_output[2]>>5)&7; switch (dummy) { + case 0 : + frame_parms->N_RB_DL = 6; + break; - case 0 : - frame_parms->N_RB_DL = 6; - break; + case 1 : + frame_parms->N_RB_DL = 15; + break; - case 1 : - frame_parms->N_RB_DL = 15; - break; + case 2 : + frame_parms->N_RB_DL = 25; + break; - case 2 : - frame_parms->N_RB_DL = 25; - break; + case 3 : + frame_parms->N_RB_DL = 50; + break; - case 3 : - frame_parms->N_RB_DL = 50; - break; + case 4 : + frame_parms->N_RB_DL = 75; + break; - case 4 : - frame_parms->N_RB_DL = 75; - break; + case 5: + frame_parms->N_RB_DL = 100; + break; - case 5: - frame_parms->N_RB_DL = 100; - break; - - default: - LOG_E(PHY,"[UE%d] Initial sync: PBCH decoding: Unknown N_RB_DL\n",ue->Mod_id); - return -1; - break; + default: + LOG_E(PHY,"[UE%d] Initial sync: PBCH decoding: Unknown N_RB_DL\n",ue->Mod_id); + return -1; + break; } - // now check for PHICH parameters frame_parms->phich_config_common.phich_duration = (PHICH_DURATION_t)((ue->pbch_vars[0]->decoded_output[2]>>4)&1); dummy = (ue->pbch_vars[0]->decoded_output[2]>>2)&3; switch (dummy) { - case 0: - frame_parms->phich_config_common.phich_resource = oneSixth; - sprintf(phich_resource,"1/6"); - break; + case 0: + frame_parms->phich_config_common.phich_resource = oneSixth; + sprintf(phich_resource,"1/6"); + break; - case 1: - frame_parms->phich_config_common.phich_resource = half; - sprintf(phich_resource,"1/2"); - break; + case 1: + frame_parms->phich_config_common.phich_resource = half; + sprintf(phich_resource,"1/2"); + break; - case 2: - frame_parms->phich_config_common.phich_resource = one; - sprintf(phich_resource,"1"); - break; + case 2: + frame_parms->phich_config_common.phich_resource = one; + sprintf(phich_resource,"1"); + break; - case 3: - frame_parms->phich_config_common.phich_resource = two; - sprintf(phich_resource,"2"); - break; + case 3: + frame_parms->phich_config_common.phich_resource = two; + sprintf(phich_resource,"2"); + break; - default: - LOG_E(PHY,"[UE%d] Initial sync: Unknown PHICH_DURATION\n",ue->Mod_id); - return -1; - break; + default: + LOG_E(PHY,"[UE%d] Initial sync: Unknown PHICH_DURATION\n",ue->Mod_id); + return -1; + break; } - for(int i=0; iproc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2; - ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2; - - ue->proc.proc_rxtx[i].frame_tx = ue->proc.proc_rxtx[0].frame_rx; + for(int i=0; iproc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2; + ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2; + ue->proc.proc_rxtx[i].frame_tx = ue->proc.proc_rxtx[0].frame_rx; } + #ifdef DEBUG_INITIAL_SYNCH LOG_I(PHY,"[UE%d] Initial sync: pbch decoded sucessfully p %d, tx_ant %d, frame %d, N_RB_DL %d, phich_duration %d, phich_resource %s!\n", ue->Mod_id, @@ -255,16 +239,13 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) } else { return(-1); } - } char phich_string[13][4] = {"","1/6","","1/2","","","one","","","","","","two"}; char duplex_string[2][4] = {"FDD","TDD"}; char prefix_string[2][9] = {"NORMAL","EXTENDED"}; -int initial_sync(PHY_VARS_UE *ue, runmode_t mode) -{ - +int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { int32_t sync_pos,sync_pos2,sync_pos_slot; int32_t metric_fdd_ncp=0,metric_fdd_ecp=0,metric_tdd_ncp=0,metric_tdd_ecp=0; uint8_t phase_fdd_ncp,phase_fdd_ecp,phase_tdd_ncp,phase_tdd_ecp; @@ -281,7 +262,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) frame_parms->Ncp=NORMAL; frame_parms->frame_type=FDD; frame_parms->nb_antenna_ports_eNB = 2; - init_frame_parms(frame_parms,1); /* LOG_M("rxdata0.m","rxd0",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); @@ -300,9 +280,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) #ifdef DEBUG_INITIAL_SYNCH LOG_I(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id); #endif - // SSS detection - // PSS is hypothesized in last symbol of first slot in Frame sync_pos_slot = (frame_parms->samples_per_tti>>1) - frame_parms->ofdm_symbol_size - frame_parms->nb_prefix_samples; @@ -326,7 +304,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); ret = pbch_detection(ue,mode); // LOG_M("rxdata2.m","rxd2",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); - #ifdef DEBUG_INITIAL_SYNCH LOG_I(PHY,"FDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", frame_parms->Nid_cell,metric_fdd_ncp,phase_fdd_ncp,flip_fdd_ncp,ret); @@ -337,9 +314,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) #endif } - if (ret==-1) { - // Now FDD extended prefix frame_parms->Ncp=EXTENDED; frame_parms->frame_type=FDD; @@ -362,7 +337,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) if (((sync_pos2 - sync_pos_slot) >=0 ) && ((sync_pos2 - sync_pos_slot) < ((FRAME_LENGTH_COMPLEX_SAMPLES-frame_parms->samples_per_tti/2)))) { - rx_sss(ue,&metric_fdd_ecp,&flip_fdd_ecp,&phase_fdd_ecp); frame_parms->nushift = frame_parms->Nid_cell%6; @@ -413,11 +387,9 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) frame_parms->nushift = frame_parms->Nid_cell%6; init_frame_parms(&ue->frame_parms,1); - lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); ret = pbch_detection(ue,mode); // LOG_M("rxdata4.m","rxd4",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); - #ifdef DEBUG_INITIAL_SYNCH LOG_I(PHY,"TDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", frame_parms->Nid_cell,metric_tdd_ncp,phase_tdd_ncp,flip_tdd_ncp,ret); @@ -427,7 +399,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) // Now TDD extended prefix frame_parms->Ncp=EXTENDED; frame_parms->frame_type=TDD; - frame_parms->tdd_config=1; + frame_parms->tdd_config=1; init_frame_parms(frame_parms,1); sync_pos2 = sync_pos - frame_parms->nb_prefix_samples; @@ -453,8 +425,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) init_frame_parms(&ue->frame_parms,1); lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); ret = pbch_detection(ue,mode); - - // LOG_M("rxdata5.m","rxd5",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); + // LOG_M("rxdata5.m","rxd5",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); #ifdef DEBUG_INITIAL_SYNCH LOG_I(PHY,"TDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", frame_parms->Nid_cell,metric_tdd_ecp,phase_tdd_ecp,flip_tdd_ecp,ret); @@ -464,104 +435,51 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) } /* Consider this is a false detection if the offset is > 1000 Hz */ - if( (abs(ue->common_vars.freq_offset) > 150) && (ret == 0) ) - { - ret=-1; -#if DISABLE_LOG_X - printf("Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset); -#else - LOG_E(HW, "Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset); -#endif + if( (abs(ue->common_vars.freq_offset) > 150) && (ret == 0) ) { + ret=-1; + LOG_E(HW, "Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset); } if (ret==0) { // PBCH found so indicate sync to higher layers and configure frame parameters - - //#ifdef DEBUG_INITIAL_SYNCH -#if DISABLE_LOG_X - printf("[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset); -#else LOG_I(PHY, "[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset); -#endif - //#endif if (ue->UE_scan_carrier == 0) { - - #if UE_AUTOTEST_TRACE +#if UE_AUTOTEST_TRACE LOG_I(PHY,"[UE %d] AUTOTEST Cell Sync : frame = %d, rx_offset %d, freq_offset %d \n", - ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - ue->rx_offset, - ue->common_vars.freq_offset ); - #endif - -// send sync status to higher layers later when timing offset converge to target timing - + ue->Mod_id, + ue->proc.proc_rxtx[0].frame_rx, + ue->rx_offset, + ue->common_vars.freq_offset ); +#endif + // send sync status to higher layers later when timing offset converge to target timing generate_pcfich_reg_mapping(frame_parms); generate_phich_reg_mapping(frame_parms); - - ue->pbch_vars[0]->pdu_errors_conseq=0; - } -#if DISABLE_LOG_X - printf("[UE %d] Frame %d RRC Measurements => rssi %3.1f dBm (dig %3.1f dB, gain %d), N0 %d dBm, rsrp %3.1f dBm/RE, rsrq %3.1f dB\n",ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - 10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, - 10*log10(ue->measurements.rssi), - ue->rx_total_gain_dB, - ue->measurements.n0_power_tot_dBm, - 10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB, - (10*log10(ue->measurements.rsrq[0]))); - - - printf("[UE %d] Frame %d MIB Information => %s, %s, NidCell %d, N_RB_DL %d, PHICH DURATION %d, PHICH RESOURCE %s, TX_ANT %d\n", - ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - duplex_string[ue->frame_parms.frame_type], - prefix_string[ue->frame_parms.Ncp], - ue->frame_parms.Nid_cell, - ue->frame_parms.N_RB_DL, - ue->frame_parms.phich_config_common.phich_duration, - phich_string[ue->frame_parms.phich_config_common.phich_resource], - ue->frame_parms.nb_antenna_ports_eNB); -#else LOG_I(PHY, "[UE %d] Frame %d RRC Measurements => rssi %3.1f dBm (dig %3.1f dB, gain %d), N0 %d dBm, rsrp %3.1f dBm/RE, rsrq %3.1f dB\n",ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - 10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, - 10*log10(ue->measurements.rssi), - ue->rx_total_gain_dB, - ue->measurements.n0_power_tot_dBm, - 10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB, - (10*log10(ue->measurements.rsrq[0]))); - + ue->proc.proc_rxtx[0].frame_rx, + 10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, + 10*log10(ue->measurements.rssi), + ue->rx_total_gain_dB, + ue->measurements.n0_power_tot_dBm, + 10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB, + (10*log10(ue->measurements.rsrq[0]))); LOG_I(PHY, "[UE %d] Frame %d MIB Information => %s, %s, NidCell %d, N_RB_DL %d, PHICH DURATION %d, PHICH RESOURCE %s, TX_ANT %d\n", - ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - duplex_string[ue->frame_parms.frame_type], - prefix_string[ue->frame_parms.Ncp], - ue->frame_parms.Nid_cell, - ue->frame_parms.N_RB_DL, - ue->frame_parms.phich_config_common.phich_duration, - phich_string[ue->frame_parms.phich_config_common.phich_resource], - ue->frame_parms.nb_antenna_ports_eNB); -#endif - -#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) -# if DISABLE_LOG_X - printf("[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n", - ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset, - ue->common_vars.freq_offset); -# else + ue->Mod_id, + ue->proc.proc_rxtx[0].frame_rx, + duplex_string[ue->frame_parms.frame_type], + prefix_string[ue->frame_parms.Ncp], + ue->frame_parms.Nid_cell, + ue->frame_parms.N_RB_DL, + ue->frame_parms.phich_config_common.phich_duration, + phich_string[ue->frame_parms.phich_config_common.phich_resource], + ue->frame_parms.nb_antenna_ports_eNB); LOG_I(PHY, "[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n", - ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset, - ue->common_vars.freq_offset); -# endif -#endif + ue->Mod_id, + ue->proc.proc_rxtx[0].frame_rx, + openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset, + ue->common_vars.freq_offset); } else { #ifdef DEBUG_INITIAL_SYNC LOG_I(PHY,"[UE%d] Initial sync : PBCH not ok\n",ue->Mod_id); @@ -575,12 +493,10 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) LOG_I(PHY,"[UE%d] Initial sync : Estimated Nid_cell %d, Frame_type %d\n",ue->Mod_id, frame_parms->Nid_cell,frame_parms->frame_type); #endif - ue->UE_mode[0] = NOT_SYNCHED; ue->pbch_vars[0]->pdu_errors_last=ue->pbch_vars[0]->pdu_errors; ue->pbch_vars[0]->pdu_errors++; ue->pbch_vars[0]->pdu_errors_conseq++; - } // gain control @@ -590,43 +506,35 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) // do a measurement on the best guess of the PSS for (aarx=0; aarxnb_antennas_rx; aarx++) rx_power += signal_energy(&ue->common_vars.rxdata[aarx][sync_pos2], - frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples); + frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples); /* // do a measurement on the full frame for (aarx=0; aarxnb_antennas_rx; aarx++) rx_power += signal_energy(&ue->common_vars.rxdata[aarx][0], - frame_parms->samples_per_tti*10); + frame_parms->samples_per_tti*10); */ - // we might add a low-pass filter here later ue->measurements.rx_power_avg[0] = rx_power/frame_parms->nb_antennas_rx; - ue->measurements.rx_power_avg_dB[0] = dB_fixed(ue->measurements.rx_power_avg[0]); - #ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",ue->Mod_id,ue->measurements.rx_power_avg_dB[0] ); + LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",ue->Mod_id,ue->measurements.rx_power_avg_dB[0] ); #endif - #ifndef OAI_USRP #ifndef OAI_BLADERF #ifndef OAI_LMSSDR - phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0); + phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0); #endif #endif #endif - - } - else { - + } else { #ifndef OAI_USRP #ifndef OAI_BLADERF #ifndef OAI_LMSSDR - phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0); + phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0); #endif #endif #endif - } // exit_fun("debug exit"); diff --git a/openair2/ENB_APP/flexran_agent_common.c b/openair2/ENB_APP/flexran_agent_common.c index 539c7f2a5c..88db41bbe3 100644 --- a/openair2/ENB_APP/flexran_agent_common.c +++ b/openair2/ENB_APP/flexran_agent_common.c @@ -127,7 +127,6 @@ int flexran_agent_hello(mid_t mod_id, const void *params, Protocol__FlexranMessa hello_msg->bs_id = flexran_get_bs_id(mod_id); hello_msg->has_bs_id = 1; hello_msg->n_capabilities = flexran_get_capabilities(mod_id, &hello_msg->capabilities); - *msg = malloc(sizeof(Protocol__FlexranMessage)); if(*msg == NULL) @@ -296,15 +295,18 @@ int flexran_agent_destroy_enb_config_reply(Protocol__FlexranMessage *msg) { for (int i = 0; i < reply->n_cell_config; i++) { if (reply->cell_config[i]->mbsfn_subframe_config_rfoffset) free(reply->cell_config[i]->mbsfn_subframe_config_rfoffset); + if (reply->cell_config[i]->mbsfn_subframe_config_rfperiod) free(reply->cell_config[i]->mbsfn_subframe_config_rfperiod); - if (reply->cell_config[i]->mbsfn_subframe_config_sfalloc); + + if (reply->cell_config[i]->mbsfn_subframe_config_sfalloc) free(reply->cell_config[i]->mbsfn_subframe_config_sfalloc); if (reply->cell_config[i]->si_config) { for(int j = 0; j < reply->cell_config[i]->si_config->n_si_message; j++) { free(reply->cell_config[i]->si_config->si_message[j]); } + free(reply->cell_config[i]->si_config->si_message); free(reply->cell_config[i]->si_config); } @@ -319,6 +321,7 @@ int flexran_agent_destroy_enb_config_reply(Protocol__FlexranMessage *msg) { } free(reply->cell_config[i]->slice_config->dl); + for (int j = 0; j < reply->cell_config[i]->slice_config->n_ul; ++j) { if (reply->cell_config[i]->slice_config->ul[j]->n_sorting > 0) free(reply->cell_config[i]->slice_config->ul[j]->sorting); @@ -492,16 +495,15 @@ int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Fl goto error; lc_config_reply_msg->header = header; - /* the lc_config_reply entirely depends on MAC except for the * mac_eNB_get_rrc_status() function (which in the current OAI implementation * is reachable if F1 is present). Therefore we check here wether MAC CM is * present and the message gets properly filled if it is or remains empty if * not */ lc_config_reply_msg->n_lc_ue_config = - flexran_agent_get_mac_xface(mod_id) ? flexran_get_mac_num_ues(mod_id) : 0; - + flexran_agent_get_mac_xface(mod_id) ? flexran_get_mac_num_ues(mod_id) : 0; Protocol__FlexLcUeConfig **lc_ue_config = NULL; + if (lc_config_reply_msg->n_lc_ue_config > 0) { lc_ue_config = malloc(sizeof(Protocol__FlexLcUeConfig *) * lc_config_reply_msg->n_lc_ue_config); @@ -512,6 +514,7 @@ int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Fl // Fill the config for each UE for (int i = 0; i < lc_config_reply_msg->n_lc_ue_config; i++) { lc_ue_config[i] = malloc(sizeof(Protocol__FlexLcUeConfig)); + if (!lc_ue_config[i]) goto error; protocol__flex_lc_ue_config__init(lc_ue_config[i]); @@ -554,8 +557,7 @@ error: * ************************************ */ -int sort_ue_config(const void *a, const void *b) -{ +int sort_ue_config(const void *a, const void *b) { const Protocol__FlexUeConfig *fa = a; const Protocol__FlexUeConfig *fb = b; @@ -563,6 +565,7 @@ int sort_ue_config(const void *a, const void *b) return -1; else if (fa->rnti < fb->rnti) return 1; + return 0; } @@ -584,8 +587,8 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl goto error; ue_config_reply_msg->header = header; - ue_config_reply_msg->n_ue_config = 0; + if (flexran_agent_get_rrc_xface(mod_id)) ue_config_reply_msg->n_ue_config = flexran_get_rrc_num_ues(mod_id); else if (flexran_agent_get_mac_xface(mod_id)) @@ -597,7 +600,7 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl const int nmac = flexran_get_mac_num_ues(mod_id); ue_config_reply_msg->n_ue_config = nrrc < nmac ? nrrc : nmac; LOG_E(FLEXRAN_AGENT, "%s(): different numbers of UEs in RRC (%d) and MAC (%d), reporting for %lu UEs\n", - __func__, nrrc, nmac, ue_config_reply_msg->n_ue_config); + __func__, nrrc, nmac, ue_config_reply_msg->n_ue_config); } Protocol__FlexUeConfig **ue_config; @@ -608,8 +611,10 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl if (ue_config == NULL) { goto error; } + rnti_t rntis[ue_config_reply_msg->n_ue_config]; flexran_get_rrc_rnti_list(mod_id, rntis, ue_config_reply_msg->n_ue_config); + for (int i = 0; i < ue_config_reply_msg->n_ue_config; i++) { const rnti_t rnti = rntis[i]; ue_config[i] = malloc(sizeof(Protocol__FlexUeConfig)); @@ -617,11 +622,13 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl if (flexran_agent_get_rrc_xface(mod_id)) flexran_agent_fill_rrc_ue_config(mod_id, rnti, ue_config[i]); + if (flexran_agent_get_mac_xface(mod_id)) { const int UE_id = flexran_get_mac_ue_id_rnti(mod_id, rnti); flexran_agent_fill_mac_ue_config(mod_id, UE_id, ue_config[i]); } } + ue_config_reply_msg->ue_config = ue_config; } @@ -725,14 +732,20 @@ int flexran_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__F if(cell_conf == NULL) goto error; - for(int i = 0; i < enb_config_reply_msg->n_cell_config; i++){ + + for(int i = 0; i < enb_config_reply_msg->n_cell_config; i++) { cell_conf[i] = malloc(sizeof(Protocol__FlexCellConfig)); + if (!cell_conf[i]) goto error; + protocol__flex_cell_config__init(cell_conf[i]); + if (flexran_agent_get_phy_xface(mod_id)) flexran_agent_fill_phy_cell_config(mod_id, i, cell_conf[i]); + if (flexran_agent_get_rrc_xface(mod_id)) flexran_agent_fill_rrc_cell_config(mod_id, i, cell_conf[i]); + if (flexran_agent_get_mac_xface(mod_id)) flexran_agent_fill_mac_cell_config(mod_id, i, cell_conf[i]); @@ -804,10 +817,11 @@ int flexran_agent_handle_enb_config_reply(mid_t mod_id, const void *params, Prot if (enb_config->n_cell_config > 1) LOG_W(FLEXRAN_AGENT, "ignoring slice configs for other cell except cell 0\n"); + if (flexran_agent_get_mac_xface(mod_id) && enb_config->cell_config[0]->slice_config) { prepare_update_slice_config(mod_id, enb_config->cell_config[0]->slice_config); - //} else { - // initiate_soft_restart(mod_id, enb_config->cell_config[0]); + //} else { + // initiate_soft_restart(mod_id, enb_config->cell_config[0]); } *msg = NULL; diff --git a/openair2/LAYER2/MAC/ue_procedures.c b/openair2/LAYER2/MAC/ue_procedures.c index 6561cbf625..4be98d590a 100644 --- a/openair2/LAYER2/MAC/ue_procedures.c +++ b/openair2/LAYER2/MAC/ue_procedures.c @@ -3329,7 +3329,7 @@ SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subframeP) { - mac_rlc_status_resp_t rlc_status; //, rlc_status_data; + mac_rlc_status_resp_t rlc_status = {0,0,0,0,0}; //, rlc_status_data; uint32_t absSF = (frameP*10)+subframeP; UE_MAC_INST *ue = &UE_mac_inst[module_idP]; int rvtab[4] = {0,2,3,1}; @@ -3370,10 +3370,7 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_ (ue->sltx_active == 1)) { // every 4th subframe, check for new data from RLC // 10 PRBs, mcs 19 int TBS = 4584/8; - int req; - - if (TBS <= rlc_status.bytes_in_buffer) req = TBS; - else req = rlc_status.bytes_in_buffer; + int req = (TBS <= rlc_status.bytes_in_buffer) ? TBS : rlc_status.bytes_in_buffer; if (req>0) { sdu_length = mac_rlc_data_req(module_idP, From 0bf3d8f6bcb4b9885fec962fec5f8305c5e7d369 Mon Sep 17 00:00:00 2001 From: frtabu Date: Mon, 29 Apr 2019 18:33:59 +0200 Subject: [PATCH 07/28] Remove deprecated build options, now available as config options: noS1, basic_simulator. Remove DISABLE_LOG_X macros, disabling logs now available via disabling the T_TRACER --- cmake_targets/CMakeLists.txt | 84 +---- cmake_targets/build_oai | 229 ++----------- common/utils/LOG/log.h | 6 +- openair1/PHY/INIT/lte_parms.c | 198 +++++------ .../PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c | 52 +-- openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c | 318 +++++++----------- openair2/ENB_APP/flexran_agent_common.c | 14 +- openair2/LAYER2/MAC/ue_procedures.c | 7 +- 8 files changed, 254 insertions(+), 654 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 7ff9e11297..f578fccb38 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -247,10 +247,7 @@ add_boolean_option(T_TRACER True "Activate the T tracer, a debugging add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs") add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace") add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace") -add_boolean_option(DISABLE_LOG_X False "Deactivate all LOG_* macros") add_boolean_option(USRP_REC_PLAY False "Enable USRP record playback mode") -#add_boolean_option(UE_NAS_USE_TUN False "Enable UE NAS TUN device instead of ue_ip.ko") -add_boolean_option(BASIC_SIMULATOR False "Has to be True when building the basic simulator, False otherwise") add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering") @@ -2116,46 +2113,6 @@ target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CR target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (lte-softmodem ${T_LIB}) -# lte-softmodem-nos1 is both eNB and UE implementation -################################################### -add_executable(lte-softmodem-nos1 - ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c - ${OPENAIR_TARGETS}/RT/USER/lte-enb.c - ${OPENAIR_TARGETS}/RT/USER/lte-ru.c - ${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c - ${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c - ${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c - ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c - ${OPENAIR_TARGETS}/COMMON/create_tasks.c - ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c - ${OPENAIR2_DIR}/RRC/NAS/nas_config.c - ${OPENAIR2_DIR}/RRC/NAS/rb_config.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/system.c - ${GTPU_need_ITTI} - ${XFORMS_SOURCE} - ${XFORMS_SOURCE_SOFTMODEM} - ${T_SOURCE} - ${CONFIG_SOURCES} - ${SHLIB_LOADER_SOURCES} - ) - -add_dependencies(lte-softmodem-nos1 rrc_flag s1ap_flag x2_flag) - -target_link_libraries (lte-softmodem-nos1 - -Wl,--start-group - RRC_LIB F1AP F1AP_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} LFDS7 - NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB - -Wl,--end-group z dl) - -target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES}) -target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES}) -target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES}) -target_link_libraries (lte-softmodem-nos1 ${T_LIB}) # lte-uesoftmodem is UE implementation ####################################### @@ -2197,46 +2154,7 @@ target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${ target_link_libraries (lte-uesoftmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (lte-uesoftmodem ${T_LIB}) -# lte-uesoftmodem-nos1 is UE implementation -################################################### -add_executable(lte-uesoftmodem-nos1 - ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c - ${OPENAIR_TARGETS}/RT/USER/lte-ue.c - ${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c - ${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c - ${OPENAIR_TARGETS}/RT/USER/lte-ru.c - ${OPENAIR_TARGETS}/RT/USER/rfsim.c - ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c - ${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c - ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c - ${OPENAIR2_DIR}/RRC/NAS/nas_config.c - ${OPENAIR2_DIR}/RRC/NAS/rb_config.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c - ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/system.c - ${XFORMS_SOURCE} - ${XFORMS_SOURCE_SOFTMODEM} - ${T_SOURCE} - ${CONFIG_SOURCES} - ${SHLIB_LOADER_SOURCES} - ) -add_dependencies(lte-uesoftmodem-nos1 rrc_flag s1ap_flag x2_flag) - -target_link_libraries (lte-uesoftmodem-nos1 - -Wl,--start-group - RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB F1AP F1AP_LIB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} - NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB - -Wl,--end-group z dl) - -target_link_libraries (lte-uesoftmodem-nos1 ${LIBXML2_LIBRARIES}) -target_link_libraries (lte-uesoftmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) -target_link_libraries (lte-uesoftmodem-nos1 ${LIB_LMS_LIBRARIES}) -target_link_libraries (lte-uesoftmodem-nos1 ${T_LIB}) # USIM process ################# #add_executable(usim @@ -2356,7 +2274,7 @@ endforeach(myExe) if (${T_TRACER}) foreach(i #all "add_executable" definitions (except tests, rb_tool, updatefw) - lte-softmodem lte-softmodem-nos1 lte-uesoftmodem lte-uesoftmodem-nos1 + lte-softmodem lte-uesoftmodem dlsim_tm4 dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim ulsim cu_test du_test #all "add_library" definitions diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 9d8a609671..74627d620d 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -52,7 +52,6 @@ CPU_AFFINITY_FLAG_USER="False" #Only valid when lowlatecy flag is set to False REL="Rel14" HW="None" TP="None" -NOS1=0 EPC=0 VERBOSE_COMPILE=0 CFLAGS_PROCESSOR_USER="" @@ -66,10 +65,8 @@ CMAKE_CMD="$CMAKE" UE_AUTOTEST_TRACE="False" UE_DEBUG_TRACE="False" UE_TIMING_TRACE="False" -DISABLE_LOG_X="False" USRP_REC_PLAY="False" BUILD_ECLIPSE=0 -UE_NAS_USE_TUN="False" BASIC_SIMULATOR=0 trap handle_ctrl_c INT @@ -130,8 +127,6 @@ Options --install-system-files Install OpenArInterface required files in Linux system (will ask root password) ---noS1 - Compiles lte-softmodem without S1 interface, using direct link to IP instead --verbose-compile Shows detailed compilation instructions in makefile --cflags_processor @@ -154,8 +149,6 @@ Options Enable traces for UE debugging --ue-timing Enable traces for timing ---disable-log - Disable all LOG_* macros --build-eclipse Build eclipse project files. Paths are auto corrected by fixprj.sh --build-telnet @@ -164,8 +157,6 @@ Options Build MSC tracing utility, specify --msc on command line to start it (eNB and UE) --usrp-recplay Build for I/Q record-playback modes ---ue-nas-use-tun - Use TUN devices for the UEs instead of ue_ip.ko --basic-simulator Generates a basic [1 UE + 1 eNB + no channel] simulator. See targets/ARCH/tcp_bridge/README.tcp_bridge_oai for documentation. @@ -294,10 +285,6 @@ function main() { INSTALL_SYSTEM_FILES=1 echo_info "Will copy OpenAirInterface files in Linux directories" shift;; - --noS1) - NOS1=1 - echo_info "Will compile without S1 interface" - shift;; --verbose-compile) VERBOSE_COMPILE=1 echo_info "Will compile with verbose instructions" @@ -340,11 +327,7 @@ function main() { shift 1;; --ue-timing) UE_TIMING_TRACE="True" - echo_info "Enabling UE timing trace" - shift 1;; - --disable-log) - DISABLE_LOG_X="True" - echo_info "Disabling all LOG_* traces" + x echo_info "Enabling UE timing trace" shift 1;; --uhd-images-dir) UHD_IMAGES_DIR=$2 @@ -367,17 +350,13 @@ function main() { USRP_REC_PLAY="True" echo_info "Enabling USRP record playback mode" shift 1;; - --ue-nas-use-tun) - UE_NAS_USE_TUN="True" - echo_info "Enabling UE NAS TUN device usage instead of ue_ip.ko" - shift 1;; --basic-simulator) BASIC_SIMULATOR=1 - echo_info "Compiling the basic simulator" + echo_info "Compiling the basic simulator device" shift 1;; --rfsimulator) RFSIMULATOR=true - echo_info "Compiling the RF simulator" + echo_info "Compiling the RF simulator device" shift 1;; -h | --help) print_help @@ -504,15 +483,10 @@ function main() { if [ "$T_TRACER" = "False" ] ; then noLOGDirsuffix="_noLOG" fi - if [ "$NOS1" = "1" ] ; then - noS1Dir="_noS1" - bin_suffix="-nos1" - else - lte_build_dir=lte_build_oai - bin_suffix="" - fi + lte_build_dir=lte_build_oai + bin_suffix="" - lte_build_dir="lte${noS1Dir}_build_oai${noLOGDirsuffix}" + lte_build_dir="lte_build_oai${noLOGDirsuffix}" # configuration module libraries, one currently available, using libconfig config_libconfig_shlib=params_libconfig @@ -545,13 +519,7 @@ function main() { echo "set (UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE)" >> $cmake_file echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)" >> $cmake_file echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file - echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file - if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then - echo_info "Compiling UE S1 build : enabling Linux and NETLINK" - echo "set (LINUX True )" >> $cmake_file - echo "set (PDCP_USE_NETLINK True )" >> $cmake_file - fi echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file cd $DIR/$lte_build_dir/build eval $CMAKE_CMD @@ -570,46 +538,41 @@ function main() { compilations \ $lte_build_dir coding \ libcoding.so $dbin/libcoding.so - - if [ "$NOS1" = "1" ] ; then - compilations \ - $lte_build_dir nasmesh \ - CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko - compilations \ - $lte_build_dir rb_tool \ - rb_tool $dbin/rb_tool - cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin - fi +# optional libs (used when noS1 with kernel modules + compilations \ + $lte_build_dir nasmesh \ + CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko + compilations \ + $lte_build_dir rb_tool \ + rb_tool $dbin/rb_tool + cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin fi if [ "$UE" = 1 ] ; then - lte_exec=lte-uesoftmodem${bin_suffix} - compilations \ - $lte_build_dir $lte_exec \ - $lte_exec $dbin/$lte_exec.$REL - - # mandatory shared lib - compilations \ - $lte_build_dir $config_libconfig_shlib \ - lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so - compilations \ - $lte_build_dir coding \ - libcoding.so $dbin/libcoding.so - - if [ "$NOS1" = "1" ] ; then - compilations \ - $lte_build_dir nasmesh \ - CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko - compilations \ - $lte_build_dir rb_tool \ - rb_tool $dbin/rb_tool - cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin - else - # ue_ip driver compilation - echo_info "Compiling UE specific part" + lte_exec=lte-uesoftmodem${bin_suffix} compilations \ - $lte_build_dir ue_ip \ - CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko + $lte_build_dir $lte_exec \ + $lte_exec $dbin/$lte_exec.$REL + + # mandatory shared lib + compilations \ + $lte_build_dir $config_libconfig_shlib \ + lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so + compilations \ + $lte_build_dir coding \ + libcoding.so $dbin/libcoding.so +# optional libs (used when noS1 with kernel modules + compilations \ + $lte_build_dir nasmesh \ + CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko + compilations \ + $lte_build_dir rb_tool \ + rb_tool $dbin/rb_tool + cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin + # ue_ip driver compilation + 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 @@ -644,7 +607,6 @@ function main() { echo_warning "not generated UE NAS files: binaries not found" fi fi - fi if [ "$SIMUS_PHY" = "1" -o "$SIMUS_CORE" = "1" ] ; then cd $OPENAIR_DIR/cmake_targets/lte-simulators @@ -854,123 +816,6 @@ function main() { echo_info "10. Bypassing the Tests ..." fi - # basic simulator - ##################### - if [ "$BASIC_SIMULATOR" = "1" ]; then - echo_info "Build basic simulator" - [ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/basic_simulator - [ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/nas_sim_tools/build - mkdir -p $OPENAIR_DIR/cmake_targets/basic_simulator - mkdir -p $OPENAIR_DIR/cmake_targets/basic_simulator/enb - mkdir -p $OPENAIR_DIR/cmake_targets/basic_simulator/ue - mkdir -p $OPENAIR_DIR/cmake_targets/nas_sim_tools/build - - # enb - - cmake_file=$OPENAIR_DIR/cmake_targets/basic_simulator/enb/CMakeLists.txt - echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file - echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file - echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file - echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file - echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file - echo "set ( XFORMS $XFORMS )" >> $cmake_file - echo "set ( RF_BOARD \"OAI_USRP\")" >> $cmake_file - echo "set ( TRANSP_PRO \"None\")" >> $cmake_file - echo "set(PACKAGE_NAME \"simulator_enb\")" >> $cmake_file - echo "set (DEADLINE_SCHEDULER \"False\" )" >> $cmake_file - echo "set (CPU_AFFINITY \"False\" )" >> $cmake_file - echo "set ( T_TRACER \"True\" )" >> $cmake_file - echo "set (UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE)" >> $cmake_file - echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)" >> $cmake_file - echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file - echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file - echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file - echo "set (BASIC_SIMULATOR \"True\" )" >> $cmake_file - echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)' >> $cmake_file - - echo_info "Build eNB" - echo_info "logs are in $dlog/basic_simulator_enb.txt" - set +e - { - cd $OPENAIR_DIR/cmake_targets/basic_simulator/enb - cmake . - make -j`nproc` lte-softmodem - make -j`nproc` coding params_libconfig tcp_bridge_oai - ln -sf libtcp_bridge_oai.so liboai_device.so - cd ../.. - } > $dlog/basic_simulator_enb.txt 2>&1 - set -e - if [ -s $OPENAIR_DIR/cmake_targets/basic_simulator/enb/lte-softmodem -a \ - -s $OPENAIR_DIR/cmake_targets/basic_simulator/enb/libcoding.so -a \ - -s $OPENAIR_DIR/cmake_targets/basic_simulator/enb/libparams_libconfig.so -a \ - -s $OPENAIR_DIR/cmake_targets/basic_simulator/enb/libtcp_bridge_oai.so ] ; then - echo_success "eNB compiled" - check_warnings "$dlog/basic_simulator_enb.txt" - else - echo_error "eNB compilation failed" - exit 1 - fi - - # ue - - echo_info "Compile conf2uedata" - cd $OPENAIR_DIR/cmake_targets/nas_sim_tools/build - eval $CMAKE_CMD - compilations \ - nas_sim_tools conf2uedata \ - conf2uedata $dbin/conf2uedata - - cmake_file=$OPENAIR_DIR/cmake_targets/basic_simulator/ue/CMakeLists.txt - echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file - echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file - echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file - echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file - echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file - echo "set ( XFORMS $XFORMS )" >> $cmake_file - echo "set ( RF_BOARD \"OAI_USRP\")" >> $cmake_file - echo "set ( TRANSP_PRO \"None\")" >> $cmake_file - echo "set(PACKAGE_NAME \"simulator_ue\")" >> $cmake_file - echo "set (DEADLINE_SCHEDULER \"False\" )" >> $cmake_file - echo "set (CPU_AFFINITY \"False\" )" >> $cmake_file - echo "set ( T_TRACER \"True\" )" >> $cmake_file - echo "set (UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE)" >> $cmake_file - echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)" >> $cmake_file - echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file - echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file - echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file - echo "set (LINUX True )" >> $cmake_file - echo "set (PDCP_USE_NETLINK True )" >> $cmake_file - echo "set (BASIC_SIMULATOR \"True\" )" >> $cmake_file -# echo "set (UE_NAS_USE_TUN \"True\" )" >> $cmake_file - echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)' >> $cmake_file - - echo_info "Build UE" - echo_info "logs are in $dlog/basic_simulator_ue.txt" - set +e - { - cd $OPENAIR_DIR/cmake_targets/basic_simulator/ue - cmake . - make -j`nproc` lte-uesoftmodem - make -j`nproc` coding params_libconfig tcp_bridge_oai - ln -sf libtcp_bridge_oai.so liboai_device.so - cd ../.. - } > $dlog/basic_simulator_ue.txt 2>&1 - set -e - if [ -s $OPENAIR_DIR/cmake_targets/basic_simulator/ue/lte-uesoftmodem -a \ - -s $OPENAIR_DIR/cmake_targets/basic_simulator/ue/libcoding.so -a \ - -s $OPENAIR_DIR/cmake_targets/basic_simulator/ue/libparams_libconfig.so -a \ - -s $OPENAIR_DIR/cmake_targets/basic_simulator/ue/libtcp_bridge_oai.so ] ; then - echo_success "UE compiled" - check_warnings "$dlog/basic_simulator_ue.txt" - else - echo_error "UE compilation failed" - exit 1 - fi - - echo_info "Generate UE SIM data" - $OPENAIR_DIR/targets/bin/conf2uedata -c $OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -o $OPENAIR_DIR/cmake_targets/basic_simulator/ue - - fi } main "$@" diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index dea756a3ac..1c413d580e 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -481,10 +481,10 @@ static inline void printMeas(char *txt, Meas *M, int period) { M->iterations, M->maxArray[1],M->maxArray[2], M->maxArray[3],M->maxArray[4], M->maxArray[5], M->maxArray[6],M->maxArray[7], M->maxArray[8],M->maxArray[9],M->maxArray[10]); -#if DISABLE_LOG_X - printf("%s",txt2); +#if T_TRACER + LOG_W(PHY,"%s",txt2); #else - LOG_W(PHY, "%s",txt2); + printf("%s",txt2); #endif } } diff --git a/openair1/PHY/INIT/lte_parms.c b/openair1/PHY/INIT/lte_parms.c index 03f226c637..4d149c0026 100644 --- a/openair1/PHY/INIT/lte_parms.c +++ b/openair1/PHY/INIT/lte_parms.c @@ -22,33 +22,22 @@ #include "phy_init.h" #include "common/utils/LOG/log.h" -uint16_t dl_S_table_normal[10]={3,9,10,11,12,3,9,10,11,6}; -uint16_t dl_S_table_extended[10]={3,8,9,10,3,8,9,5,0,0}; +uint16_t dl_S_table_normal[10]= {3,9,10,11,12,3,9,10,11,6}; +uint16_t dl_S_table_extended[10]= {3,8,9,10,3,8,9,5,0,0}; void set_S_config(LTE_DL_FRAME_PARMS *fp) { - int X = fp->srsX; - fp->ul_symbols_in_S_subframe=(1+X); if ((fp->Ncp==EXTENDED) && (fp->tdd_config_S>7)) AssertFatal(1==0,"Illegal S subframe configuration for Extended Prefix mode\n"); fp->dl_symbols_in_S_subframe = (fp->Ncp==NORMAL)?dl_S_table_normal[fp->tdd_config_S] : dl_S_table_extended[fp->tdd_config_S]; - - } -int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) -{ - +int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) { uint8_t log2_osf; - -#if DISABLE_LOG_X - printf("Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf); -#else LOG_I(PHY,"Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf); -#endif if (frame_parms->Ncp==EXTENDED) { frame_parms->nb_prefix_samples0=512; @@ -58,125 +47,109 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) frame_parms->nb_prefix_samples0 = 160; frame_parms->nb_prefix_samples = 144; frame_parms->symbols_per_tti = 14; - } - switch(osf) { - case 1: - log2_osf = 0; - break; + case 1: + log2_osf = 0; + break; - case 2: - log2_osf = 1; - break; + case 2: + log2_osf = 1; + break; - case 4: - log2_osf = 2; - break; + case 4: + log2_osf = 2; + break; - case 8: - log2_osf = 3; - break; + case 8: + log2_osf = 3; + break; - case 16: - log2_osf = 4; - break; + case 16: + log2_osf = 4; + break; - default: - AssertFatal(1==0,"Illegal oversampling %d\n",osf); - + default: + AssertFatal(1==0,"Illegal oversampling %d\n",osf); } switch (frame_parms->N_RB_DL) { + case 100: + AssertFatal(osf==1,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); - case 100: - AssertFatal(osf==1,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); - + if (frame_parms->threequarter_fs) { + frame_parms->ofdm_symbol_size = 1536; + frame_parms->samples_per_tti = 23040; + frame_parms->first_carrier_offset = 1536-600; + frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2; + frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2; + } else { + frame_parms->ofdm_symbol_size = 2048; + frame_parms->samples_per_tti = 30720; + frame_parms->first_carrier_offset = 2048-600; + } - if (frame_parms->threequarter_fs) { + frame_parms->N_RBGS = 4; + frame_parms->N_RBG = 25; + break; + + case 75: + AssertFatal(osf==1,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); frame_parms->ofdm_symbol_size = 1536; frame_parms->samples_per_tti = 23040; - frame_parms->first_carrier_offset = 1536-600; + frame_parms->first_carrier_offset = 1536-450; frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2; frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2; + frame_parms->N_RBGS = 4; + frame_parms->N_RBG = 25; + break; - } - else { - frame_parms->ofdm_symbol_size = 2048; - frame_parms->samples_per_tti = 30720; - frame_parms->first_carrier_offset = 2048-600; - } - frame_parms->N_RBGS = 4; - frame_parms->N_RBG = 25; - break; + case 50: + AssertFatal(osf==1,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); + frame_parms->ofdm_symbol_size = 1024*osf; + frame_parms->samples_per_tti = 15360*osf; + frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 300; + frame_parms->nb_prefix_samples>>=(1-log2_osf); + frame_parms->nb_prefix_samples0>>=(1-log2_osf); + frame_parms->N_RBGS = 3; + frame_parms->N_RBG = 17; + break; - case 75: - AssertFatal(osf==1,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); + case 25: + AssertFatal(osf<=2,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); + frame_parms->ofdm_symbol_size = 512*osf; + frame_parms->samples_per_tti = 7680*osf; + frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 150; + frame_parms->nb_prefix_samples>>=(2-log2_osf); + frame_parms->nb_prefix_samples0>>=(2-log2_osf); + frame_parms->N_RBGS = 2; + frame_parms->N_RBG = 13; + break; - frame_parms->ofdm_symbol_size = 1536; - frame_parms->samples_per_tti = 23040; - frame_parms->first_carrier_offset = 1536-450; - frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2; - frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2; - frame_parms->N_RBGS = 4; - frame_parms->N_RBG = 25; - break; + case 15: + frame_parms->ofdm_symbol_size = 256*osf; + frame_parms->samples_per_tti = 3840*osf; + frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 90; + frame_parms->nb_prefix_samples>>=(3-log2_osf); + frame_parms->nb_prefix_samples0>>=(3-log2_osf); + frame_parms->N_RBGS = 2; + frame_parms->N_RBG = 8; + break; - case 50: - AssertFatal(osf==1,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); + case 6: + frame_parms->ofdm_symbol_size = 128*osf; + frame_parms->samples_per_tti = 1920*osf; + frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 36; + frame_parms->nb_prefix_samples>>=(4-log2_osf); + frame_parms->nb_prefix_samples0>>=(4-log2_osf); + frame_parms->N_RBGS = 1; + frame_parms->N_RBG = 6; + break; - frame_parms->ofdm_symbol_size = 1024*osf; - frame_parms->samples_per_tti = 15360*osf; - frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 300; - frame_parms->nb_prefix_samples>>=(1-log2_osf); - frame_parms->nb_prefix_samples0>>=(1-log2_osf); - frame_parms->N_RBGS = 3; - frame_parms->N_RBG = 17; - break; - - case 25: - AssertFatal(osf<=2,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); - - - frame_parms->ofdm_symbol_size = 512*osf; - - - frame_parms->samples_per_tti = 7680*osf; - frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 150; - frame_parms->nb_prefix_samples>>=(2-log2_osf); - frame_parms->nb_prefix_samples0>>=(2-log2_osf); - frame_parms->N_RBGS = 2; - frame_parms->N_RBG = 13; - - break; - - case 15: - frame_parms->ofdm_symbol_size = 256*osf; - frame_parms->samples_per_tti = 3840*osf; - frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 90; - frame_parms->nb_prefix_samples>>=(3-log2_osf); - frame_parms->nb_prefix_samples0>>=(3-log2_osf); - frame_parms->N_RBGS = 2; - frame_parms->N_RBG = 8; - - break; - - case 6: - frame_parms->ofdm_symbol_size = 128*osf; - frame_parms->samples_per_tti = 1920*osf; - frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 36; - frame_parms->nb_prefix_samples>>=(4-log2_osf); - frame_parms->nb_prefix_samples0>>=(4-log2_osf); - frame_parms->N_RBGS = 1; - frame_parms->N_RBG = 6; - - break; - - default: - AssertFatal(1==0,"Number of resource blocks (N_RB_DL %d) undefined, frame_parms = %p \n",frame_parms->N_RB_DL, frame_parms); - - break; + default: + AssertFatal(1==0,"Number of resource blocks (N_RB_DL %d) undefined, frame_parms = %p \n",frame_parms->N_RB_DL, frame_parms); + break; } LOG_I(PHY,"lte_parms.c: Setting N_RB_DL to %d, ofdm_symbol_size %d\n",frame_parms->N_RB_DL, frame_parms->ofdm_symbol_size); @@ -188,8 +161,7 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) } -void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms) -{ +void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms) { LOG_I(PHY,"frame_parms->N_RB_DL=%d\n",frame_parms->N_RB_DL); LOG_I(PHY,"frame_parms->N_RB_UL=%d\n",frame_parms->N_RB_UL); LOG_I(PHY,"frame_parms->Nid_cell=%d\n",frame_parms->Nid_cell); diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c index aafd579899..9573f66f79 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c @@ -62,14 +62,6 @@ int16_t dlsch_demod_shift = 0; int16_t interf_unaw_shift = 13; -//#define DEBUG_HARQ - -//#define DEBUG_PHY 1 -//#define DEBUG_DLSCH_DEMOD 1 - -//#define DISABLE_LOG_X - -// [MCS][i_mod (0,1,2) = (2,4,6)] unsigned char offset_mumimo_llr_drange_fix=0; //inferference-free case unsigned char interf_unaw_shift_tm4_mcs[29]= {5, 3, 4, 3, 3, 2, 1, 1, 2, 0, 1, 1, 1, 1, 0, 0, @@ -379,14 +371,9 @@ int rx_pdsch(PHY_VARS_UE *ue, #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,subframe,slot, - symbol,ue->high_speed_flag,type,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#else LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,subframe,slot,symbol, ue->high_speed_flag,type,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); #endif -#endif #if UE_TIMING_TRACE start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif @@ -412,13 +399,7 @@ int rx_pdsch(PHY_VARS_UE *ue, #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#else LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#endif -#endif -#if UE_TIMING_TRACE start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif @@ -527,15 +508,8 @@ int rx_pdsch(PHY_VARS_UE *ue, #endif #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,subframe,slot,symbol,first_symbol_flag, - ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#else LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,subframe,slot,symbol,first_symbol_flag, ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#endif -#endif -#if UE_TIMING_TRACE start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif @@ -758,16 +732,8 @@ int rx_pdsch(PHY_VARS_UE *ue, #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n",frame,subframe,slot,symbol,pdsch_vars[eNB_id]->log2_maxh,proc->channel_level, - ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#else LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d Channel Comp %5.2f \n",frame,subframe,slot,symbol,pdsch_vars[eNB_id]->log2_maxh, ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#endif -#endif - // MRC -#if UE_TIMING_TRACE start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif @@ -840,13 +806,7 @@ int rx_pdsch(PHY_VARS_UE *ue, #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#else LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#endif -#endif -#if UE_TIMING_TRACE start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif //printf("LLR dlsch0_harq->Qm %d rx_type %d cw0 %d cw1 %d symbol %d \n",dlsch0_harq->Qm,rx_type,codeword_TB0,codeword_TB1,symbol); @@ -1210,11 +1170,7 @@ int rx_pdsch(PHY_VARS_UE *ue, #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#else LOG_D(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#endif #endif // Please keep it: useful for debugging #if 0 @@ -1224,7 +1180,7 @@ int rx_pdsch(PHY_VARS_UE *ue, if(1) { #if 1 - LOG_M("rxdataF0.m" , "rxdataF0", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1); + LOG_M("rxdataF0.m", "rxdataF0", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1); //LOG_M("rxdataF1.m" , "rxdataF1", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1); LOG_M("dl_ch_estimates00.m", "dl_ch_estimates00", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][0][0],14*frame_parms->ofdm_symbol_size,1,1); //LOG_M("dl_ch_estimates01.m", "dl_ch_estimates01", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][1][0],14*frame_parms->ofdm_symbol_size,1,1); @@ -4767,8 +4723,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF, dl_ch0+=12; rxF+=12; - } - else { // Odd number of RBs + } else { // Odd number of RBs for (rb=0; rbN_RB_DL>>1; rb++) { #ifdef DEBUG_DLSCH_DEMOD printf("dlch_ext %u\n",dl_ch0_ext-&dl_ch_estimates_ext[aarx][0]); @@ -5811,8 +5766,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, dl_ch0+=12; rxF+=12; - } - else { // Odd number of RBs + } else { // Odd number of RBs for (rb=0; rbN_RB_DL>>1; rb++) { skip_half=0; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c b/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c index aac636f07c..26ad1d24ef 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c @@ -45,61 +45,56 @@ extern openair0_config_t openair0_cfg[]; //#define DEBUG_INITIAL_SYNCH -int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) -{ - +int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { uint8_t l,pbch_decoded,frame_mod4,pbch_tx_ant,dummy; LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; char phich_resource[6]; - #ifdef DEBUG_INITIAL_SYNCH LOG_I(PHY,"[UE%d] Initial sync: starting PBCH detection (rx_offset %d)\n",ue->Mod_id, ue->rx_offset); #endif for (l=0; lsymbols_per_tti/2; l++) { - slot_fep(ue, - l, - 0, - ue->rx_offset, - 0, - 1); + l, + 0, + ue->rx_offset, + 0, + 1); } + for (l=0; lsymbols_per_tti/2; l++) { - slot_fep(ue, - l, - 1, - ue->rx_offset, - 0, - 1); + l, + 1, + ue->rx_offset, + 0, + 1); } + slot_fep(ue, - 0, - 2, - ue->rx_offset, - 0, - 1); - + 0, + 2, + ue->rx_offset, + 0, + 1); lte_ue_measurements(ue, - ue->rx_offset, - 0, + ue->rx_offset, + 0, + 0, 0, - 0, 0); - if (ue->frame_parms.frame_type == TDD) { ue_rrc_measurements(ue, - 2, - 0); - } - else { + 2, + 0); + } else { ue_rrc_measurements(ue, - 0, - 0); + 0, + 0); } + #ifdef DEBUG_INITIAL_SYNCH LOG_I(PHY,"[UE %d] RX RSSI %d dBm, digital (%d, %d) dB, linear (%d, %d), avg rx power %d dB (%d lin), RX gain %d dB\n", ue->Mod_id, @@ -111,7 +106,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) ue->measurements.rx_power_avg_dB[0], ue->measurements.rx_power_avg[0], ue->rx_total_gain_dB); - LOG_I(PHY,"[UE %d] N0 %d dBm digital (%d, %d) dB, linear (%d, %d), avg noise power %d dB (%d lin)\n", ue->Mod_id, ue->measurements.n0_power_tot_dBm, @@ -122,7 +116,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) ue->measurements.n0_power_avg_dB, ue->measurements.n0_power_avg); #endif - pbch_decoded = 0; for (frame_mod4=0; frame_mod4<4; frame_mod4++) { @@ -153,94 +146,85 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) } } - if (pbch_decoded) { - frame_parms->nb_antenna_ports_eNB = pbch_tx_ant; - // set initial transmission mode to 1 or 2 depending on number of detected TX antennas // openair_daq_vars.dlsch_transmission_mode = (pbch_tx_ant>1) ? 2 : 1; - - // flip byte endian on 24-bits for MIB // dummy = ue->pbch_vars[0]->decoded_output[0]; // ue->pbch_vars[0]->decoded_output[0] = ue->pbch_vars[0]->decoded_output[2]; // ue->pbch_vars[0]->decoded_output[2] = dummy; - // now check for Bandwidth of Cell dummy = (ue->pbch_vars[0]->decoded_output[2]>>5)&7; switch (dummy) { + case 0 : + frame_parms->N_RB_DL = 6; + break; - case 0 : - frame_parms->N_RB_DL = 6; - break; + case 1 : + frame_parms->N_RB_DL = 15; + break; - case 1 : - frame_parms->N_RB_DL = 15; - break; + case 2 : + frame_parms->N_RB_DL = 25; + break; - case 2 : - frame_parms->N_RB_DL = 25; - break; + case 3 : + frame_parms->N_RB_DL = 50; + break; - case 3 : - frame_parms->N_RB_DL = 50; - break; + case 4 : + frame_parms->N_RB_DL = 75; + break; - case 4 : - frame_parms->N_RB_DL = 75; - break; + case 5: + frame_parms->N_RB_DL = 100; + break; - case 5: - frame_parms->N_RB_DL = 100; - break; - - default: - LOG_E(PHY,"[UE%d] Initial sync: PBCH decoding: Unknown N_RB_DL\n",ue->Mod_id); - return -1; - break; + default: + LOG_E(PHY,"[UE%d] Initial sync: PBCH decoding: Unknown N_RB_DL\n",ue->Mod_id); + return -1; + break; } - // now check for PHICH parameters frame_parms->phich_config_common.phich_duration = (PHICH_DURATION_t)((ue->pbch_vars[0]->decoded_output[2]>>4)&1); dummy = (ue->pbch_vars[0]->decoded_output[2]>>2)&3; switch (dummy) { - case 0: - frame_parms->phich_config_common.phich_resource = oneSixth; - sprintf(phich_resource,"1/6"); - break; + case 0: + frame_parms->phich_config_common.phich_resource = oneSixth; + sprintf(phich_resource,"1/6"); + break; - case 1: - frame_parms->phich_config_common.phich_resource = half; - sprintf(phich_resource,"1/2"); - break; + case 1: + frame_parms->phich_config_common.phich_resource = half; + sprintf(phich_resource,"1/2"); + break; - case 2: - frame_parms->phich_config_common.phich_resource = one; - sprintf(phich_resource,"1"); - break; + case 2: + frame_parms->phich_config_common.phich_resource = one; + sprintf(phich_resource,"1"); + break; - case 3: - frame_parms->phich_config_common.phich_resource = two; - sprintf(phich_resource,"2"); - break; + case 3: + frame_parms->phich_config_common.phich_resource = two; + sprintf(phich_resource,"2"); + break; - default: - LOG_E(PHY,"[UE%d] Initial sync: Unknown PHICH_DURATION\n",ue->Mod_id); - return -1; - break; + default: + LOG_E(PHY,"[UE%d] Initial sync: Unknown PHICH_DURATION\n",ue->Mod_id); + return -1; + break; } - for(int i=0; iproc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2; - ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2; - - ue->proc.proc_rxtx[i].frame_tx = ue->proc.proc_rxtx[0].frame_rx; + for(int i=0; iproc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2; + ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2; + ue->proc.proc_rxtx[i].frame_tx = ue->proc.proc_rxtx[0].frame_rx; } + #ifdef DEBUG_INITIAL_SYNCH LOG_I(PHY,"[UE%d] Initial sync: pbch decoded sucessfully p %d, tx_ant %d, frame %d, N_RB_DL %d, phich_duration %d, phich_resource %s!\n", ue->Mod_id, @@ -255,16 +239,13 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) } else { return(-1); } - } char phich_string[13][4] = {"","1/6","","1/2","","","one","","","","","","two"}; char duplex_string[2][4] = {"FDD","TDD"}; char prefix_string[2][9] = {"NORMAL","EXTENDED"}; -int initial_sync(PHY_VARS_UE *ue, runmode_t mode) -{ - +int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { int32_t sync_pos,sync_pos2,sync_pos_slot; int32_t metric_fdd_ncp=0,metric_fdd_ecp=0,metric_tdd_ncp=0,metric_tdd_ecp=0; uint8_t phase_fdd_ncp,phase_fdd_ecp,phase_tdd_ncp,phase_tdd_ecp; @@ -281,7 +262,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) frame_parms->Ncp=NORMAL; frame_parms->frame_type=FDD; frame_parms->nb_antenna_ports_eNB = 2; - init_frame_parms(frame_parms,1); /* LOG_M("rxdata0.m","rxd0",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); @@ -300,9 +280,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) #ifdef DEBUG_INITIAL_SYNCH LOG_I(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id); #endif - // SSS detection - // PSS is hypothesized in last symbol of first slot in Frame sync_pos_slot = (frame_parms->samples_per_tti>>1) - frame_parms->ofdm_symbol_size - frame_parms->nb_prefix_samples; @@ -326,7 +304,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); ret = pbch_detection(ue,mode); // LOG_M("rxdata2.m","rxd2",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); - #ifdef DEBUG_INITIAL_SYNCH LOG_I(PHY,"FDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", frame_parms->Nid_cell,metric_fdd_ncp,phase_fdd_ncp,flip_fdd_ncp,ret); @@ -337,9 +314,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) #endif } - if (ret==-1) { - // Now FDD extended prefix frame_parms->Ncp=EXTENDED; frame_parms->frame_type=FDD; @@ -362,7 +337,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) if (((sync_pos2 - sync_pos_slot) >=0 ) && ((sync_pos2 - sync_pos_slot) < ((FRAME_LENGTH_COMPLEX_SAMPLES-frame_parms->samples_per_tti/2)))) { - rx_sss(ue,&metric_fdd_ecp,&flip_fdd_ecp,&phase_fdd_ecp); frame_parms->nushift = frame_parms->Nid_cell%6; @@ -413,11 +387,9 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) frame_parms->nushift = frame_parms->Nid_cell%6; init_frame_parms(&ue->frame_parms,1); - lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); ret = pbch_detection(ue,mode); // LOG_M("rxdata4.m","rxd4",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); - #ifdef DEBUG_INITIAL_SYNCH LOG_I(PHY,"TDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", frame_parms->Nid_cell,metric_tdd_ncp,phase_tdd_ncp,flip_tdd_ncp,ret); @@ -427,7 +399,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) // Now TDD extended prefix frame_parms->Ncp=EXTENDED; frame_parms->frame_type=TDD; - frame_parms->tdd_config=1; + frame_parms->tdd_config=1; init_frame_parms(frame_parms,1); sync_pos2 = sync_pos - frame_parms->nb_prefix_samples; @@ -453,8 +425,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) init_frame_parms(&ue->frame_parms,1); lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); ret = pbch_detection(ue,mode); - - // LOG_M("rxdata5.m","rxd5",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); + // LOG_M("rxdata5.m","rxd5",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); #ifdef DEBUG_INITIAL_SYNCH LOG_I(PHY,"TDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", frame_parms->Nid_cell,metric_tdd_ecp,phase_tdd_ecp,flip_tdd_ecp,ret); @@ -464,104 +435,51 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) } /* Consider this is a false detection if the offset is > 1000 Hz */ - if( (abs(ue->common_vars.freq_offset) > 150) && (ret == 0) ) - { - ret=-1; -#if DISABLE_LOG_X - printf("Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset); -#else - LOG_E(HW, "Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset); -#endif + if( (abs(ue->common_vars.freq_offset) > 150) && (ret == 0) ) { + ret=-1; + LOG_E(HW, "Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset); } if (ret==0) { // PBCH found so indicate sync to higher layers and configure frame parameters - - //#ifdef DEBUG_INITIAL_SYNCH -#if DISABLE_LOG_X - printf("[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset); -#else LOG_I(PHY, "[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset); -#endif - //#endif if (ue->UE_scan_carrier == 0) { - - #if UE_AUTOTEST_TRACE +#if UE_AUTOTEST_TRACE LOG_I(PHY,"[UE %d] AUTOTEST Cell Sync : frame = %d, rx_offset %d, freq_offset %d \n", - ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - ue->rx_offset, - ue->common_vars.freq_offset ); - #endif - -// send sync status to higher layers later when timing offset converge to target timing - + ue->Mod_id, + ue->proc.proc_rxtx[0].frame_rx, + ue->rx_offset, + ue->common_vars.freq_offset ); +#endif + // send sync status to higher layers later when timing offset converge to target timing generate_pcfich_reg_mapping(frame_parms); generate_phich_reg_mapping(frame_parms); - - ue->pbch_vars[0]->pdu_errors_conseq=0; - } -#if DISABLE_LOG_X - printf("[UE %d] Frame %d RRC Measurements => rssi %3.1f dBm (dig %3.1f dB, gain %d), N0 %d dBm, rsrp %3.1f dBm/RE, rsrq %3.1f dB\n",ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - 10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, - 10*log10(ue->measurements.rssi), - ue->rx_total_gain_dB, - ue->measurements.n0_power_tot_dBm, - 10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB, - (10*log10(ue->measurements.rsrq[0]))); - - - printf("[UE %d] Frame %d MIB Information => %s, %s, NidCell %d, N_RB_DL %d, PHICH DURATION %d, PHICH RESOURCE %s, TX_ANT %d\n", - ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - duplex_string[ue->frame_parms.frame_type], - prefix_string[ue->frame_parms.Ncp], - ue->frame_parms.Nid_cell, - ue->frame_parms.N_RB_DL, - ue->frame_parms.phich_config_common.phich_duration, - phich_string[ue->frame_parms.phich_config_common.phich_resource], - ue->frame_parms.nb_antenna_ports_eNB); -#else LOG_I(PHY, "[UE %d] Frame %d RRC Measurements => rssi %3.1f dBm (dig %3.1f dB, gain %d), N0 %d dBm, rsrp %3.1f dBm/RE, rsrq %3.1f dB\n",ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - 10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, - 10*log10(ue->measurements.rssi), - ue->rx_total_gain_dB, - ue->measurements.n0_power_tot_dBm, - 10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB, - (10*log10(ue->measurements.rsrq[0]))); - + ue->proc.proc_rxtx[0].frame_rx, + 10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, + 10*log10(ue->measurements.rssi), + ue->rx_total_gain_dB, + ue->measurements.n0_power_tot_dBm, + 10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB, + (10*log10(ue->measurements.rsrq[0]))); LOG_I(PHY, "[UE %d] Frame %d MIB Information => %s, %s, NidCell %d, N_RB_DL %d, PHICH DURATION %d, PHICH RESOURCE %s, TX_ANT %d\n", - ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - duplex_string[ue->frame_parms.frame_type], - prefix_string[ue->frame_parms.Ncp], - ue->frame_parms.Nid_cell, - ue->frame_parms.N_RB_DL, - ue->frame_parms.phich_config_common.phich_duration, - phich_string[ue->frame_parms.phich_config_common.phich_resource], - ue->frame_parms.nb_antenna_ports_eNB); -#endif - -#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) -# if DISABLE_LOG_X - printf("[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n", - ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset, - ue->common_vars.freq_offset); -# else + ue->Mod_id, + ue->proc.proc_rxtx[0].frame_rx, + duplex_string[ue->frame_parms.frame_type], + prefix_string[ue->frame_parms.Ncp], + ue->frame_parms.Nid_cell, + ue->frame_parms.N_RB_DL, + ue->frame_parms.phich_config_common.phich_duration, + phich_string[ue->frame_parms.phich_config_common.phich_resource], + ue->frame_parms.nb_antenna_ports_eNB); LOG_I(PHY, "[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n", - ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset, - ue->common_vars.freq_offset); -# endif -#endif + ue->Mod_id, + ue->proc.proc_rxtx[0].frame_rx, + openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset, + ue->common_vars.freq_offset); } else { #ifdef DEBUG_INITIAL_SYNC LOG_I(PHY,"[UE%d] Initial sync : PBCH not ok\n",ue->Mod_id); @@ -575,12 +493,10 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) LOG_I(PHY,"[UE%d] Initial sync : Estimated Nid_cell %d, Frame_type %d\n",ue->Mod_id, frame_parms->Nid_cell,frame_parms->frame_type); #endif - ue->UE_mode[0] = NOT_SYNCHED; ue->pbch_vars[0]->pdu_errors_last=ue->pbch_vars[0]->pdu_errors; ue->pbch_vars[0]->pdu_errors++; ue->pbch_vars[0]->pdu_errors_conseq++; - } // gain control @@ -590,43 +506,35 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) // do a measurement on the best guess of the PSS for (aarx=0; aarxnb_antennas_rx; aarx++) rx_power += signal_energy(&ue->common_vars.rxdata[aarx][sync_pos2], - frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples); + frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples); /* // do a measurement on the full frame for (aarx=0; aarxnb_antennas_rx; aarx++) rx_power += signal_energy(&ue->common_vars.rxdata[aarx][0], - frame_parms->samples_per_tti*10); + frame_parms->samples_per_tti*10); */ - // we might add a low-pass filter here later ue->measurements.rx_power_avg[0] = rx_power/frame_parms->nb_antennas_rx; - ue->measurements.rx_power_avg_dB[0] = dB_fixed(ue->measurements.rx_power_avg[0]); - #ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",ue->Mod_id,ue->measurements.rx_power_avg_dB[0] ); + LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",ue->Mod_id,ue->measurements.rx_power_avg_dB[0] ); #endif - #ifndef OAI_USRP #ifndef OAI_BLADERF #ifndef OAI_LMSSDR - phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0); + phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0); #endif #endif #endif - - } - else { - + } else { #ifndef OAI_USRP #ifndef OAI_BLADERF #ifndef OAI_LMSSDR - phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0); + phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0); #endif #endif #endif - } // exit_fun("debug exit"); diff --git a/openair2/ENB_APP/flexran_agent_common.c b/openair2/ENB_APP/flexran_agent_common.c index 72b0866fd6..611b7bed4c 100644 --- a/openair2/ENB_APP/flexran_agent_common.c +++ b/openair2/ENB_APP/flexran_agent_common.c @@ -127,7 +127,6 @@ int flexran_agent_hello(mid_t mod_id, const void *params, Protocol__FlexranMessa hello_msg->bs_id = flexran_get_bs_id(mod_id); hello_msg->has_bs_id = 1; hello_msg->n_capabilities = flexran_get_capabilities(mod_id, &hello_msg->capabilities); - *msg = malloc(sizeof(Protocol__FlexranMessage)); if(*msg == NULL) @@ -725,14 +724,20 @@ int flexran_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__F if(cell_conf == NULL) goto error; - for(int i = 0; i < enb_config_reply_msg->n_cell_config; i++){ + + for(int i = 0; i < enb_config_reply_msg->n_cell_config; i++) { cell_conf[i] = malloc(sizeof(Protocol__FlexCellConfig)); + if (!cell_conf[i]) goto error; + protocol__flex_cell_config__init(cell_conf[i]); + if (flexran_agent_get_phy_xface(mod_id)) flexran_agent_fill_phy_cell_config(mod_id, i, cell_conf[i]); + if (flexran_agent_get_rrc_xface(mod_id)) flexran_agent_fill_rrc_cell_config(mod_id, i, cell_conf[i]); + if (flexran_agent_get_mac_xface(mod_id)) flexran_agent_fill_mac_cell_config(mod_id, i, cell_conf[i]); @@ -804,10 +809,11 @@ int flexran_agent_handle_enb_config_reply(mid_t mod_id, const void *params, Prot if (enb_config->n_cell_config > 1) LOG_W(FLEXRAN_AGENT, "ignoring slice configs for other cell except cell 0\n"); + if (flexran_agent_get_mac_xface(mod_id) && enb_config->cell_config[0]->slice_config) { prepare_update_slice_config(mod_id, enb_config->cell_config[0]->slice_config); - //} else { - // initiate_soft_restart(mod_id, enb_config->cell_config[0]); + //} else { + // initiate_soft_restart(mod_id, enb_config->cell_config[0]); } *msg = NULL; diff --git a/openair2/LAYER2/MAC/ue_procedures.c b/openair2/LAYER2/MAC/ue_procedures.c index 6561cbf625..4be98d590a 100644 --- a/openair2/LAYER2/MAC/ue_procedures.c +++ b/openair2/LAYER2/MAC/ue_procedures.c @@ -3329,7 +3329,7 @@ SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subframeP) { - mac_rlc_status_resp_t rlc_status; //, rlc_status_data; + mac_rlc_status_resp_t rlc_status = {0,0,0,0,0}; //, rlc_status_data; uint32_t absSF = (frameP*10)+subframeP; UE_MAC_INST *ue = &UE_mac_inst[module_idP]; int rvtab[4] = {0,2,3,1}; @@ -3370,10 +3370,7 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_ (ue->sltx_active == 1)) { // every 4th subframe, check for new data from RLC // 10 PRBs, mcs 19 int TBS = 4584/8; - int req; - - if (TBS <= rlc_status.bytes_in_buffer) req = TBS; - else req = rlc_status.bytes_in_buffer; + int req = (TBS <= rlc_status.bytes_in_buffer) ? TBS : rlc_status.bytes_in_buffer; if (req>0) { sdu_length = mac_rlc_data_req(module_idP, From 9f3bd99c52983591edb76e4d279aec5a448b54e0 Mon Sep 17 00:00:00 2001 From: frtabu Date: Tue, 30 Apr 2019 10:24:20 +0200 Subject: [PATCH 08/28] Fix NB_PATTERN_FILES and BUILD_OPTIONS in oai-ci-vm-tool, remove useless options (-t, basic_simulator, rf_simulator) as corresponding libraries always built --- ci-scripts/oai-ci-vm-tool | 28 ++++++++++++++-------------- cmake_targets/build_oai | 25 +++---------------------- 2 files changed, 17 insertions(+), 36 deletions(-) diff --git a/ci-scripts/oai-ci-vm-tool b/ci-scripts/oai-ci-vm-tool index c343e24d80..ab28cd5204 100755 --- a/ci-scripts/oai-ci-vm-tool +++ b/ci-scripts/oai-ci-vm-tool @@ -236,7 +236,7 @@ case $key in VM_NAME=ci-enb-usrp ARCHIVES_LOC=enb_usrp LOG_PATTERN=.Rel14.txt - NB_PATTERN_FILES=7 + NB_PATTERN_FILES=9 BUILD_OPTIONS="--eNB -w USRP --mu" NBARGS=$[$NBARGS+256] shift @@ -245,8 +245,8 @@ case $key in VM_NAME=ci-basic-sim ARCHIVES_LOC=basic_sim LOG_PATTERN=basic_simulator - NB_PATTERN_FILES=2 - BUILD_OPTIONS="--basic-simulator" + NB_PATTERN_FILES=13 + BUILD_OPTIONS="--eNB --UE" VM_MEMORY=8192 VM_CPU=4 RUN_OPTIONS="complex" @@ -279,8 +279,8 @@ case $key in VM_CPU=4 ARCHIVES_LOC=enb_eth LOG_PATTERN=.Rel14.txt - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--eNB -t ETHERNET" + NB_PATTERN_FILES=8 + BUILD_OPTIONS="--eNB" NBARGS=$[$NBARGS+256] shift ;; @@ -290,8 +290,8 @@ case $key in VM_CPU=4 ARCHIVES_LOC=ue_eth LOG_PATTERN=.Rel14.txt - NB_PATTERN_FILES=10 - BUILD_OPTIONS="--UE -t ETHERNET" + NB_PATTERN_FILES=12 + BUILD_OPTIONS="--UE" NBARGS=$[$NBARGS+256] shift ;; @@ -332,7 +332,7 @@ case $key in VM_NAME=ci-enb-usrp ARCHIVES_LOC=enb_usrp LOG_PATTERN=.Rel14.txt - NB_PATTERN_FILES=7 + NB_PATTERN_FILES=9 BUILD_OPTIONS="--eNB -w USRP --mu" NBARGS=$[$NBARGS+256] ;; @@ -340,8 +340,8 @@ case $key in VM_NAME=ci-basic-sim ARCHIVES_LOC=basic_sim LOG_PATTERN=basic_simulator - NB_PATTERN_FILES=2 - BUILD_OPTIONS="--basic-simulator" + NB_PATTERN_FILES=13 + BUILD_OPTIONS="--UE --eNB" VM_MEMORY=8192 VM_CPU=4 RUN_OPTIONS="complex" @@ -371,8 +371,8 @@ case $key in VM_CPU=4 ARCHIVES_LOC=enb_eth LOG_PATTERN=.Rel14.txt - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--eNB -t ETHERNET" + NB_PATTERN_FILES=8 + BUILD_OPTIONS="--eNB" NBARGS=$[$NBARGS+256] ;; ue-ethernet) @@ -381,8 +381,8 @@ case $key in VM_CPU=4 ARCHIVES_LOC=ue_eth LOG_PATTERN=.Rel14.txt - NB_PATTERN_FILES=10 - BUILD_OPTIONS="--UE -t ETHERNET" + NB_PATTERN_FILES=12 + BUILD_OPTIONS="--UE" NBARGS=$[$NBARGS+256] ;; flexran-rtc) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 74627d620d..b4b807331d 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -67,7 +67,7 @@ UE_DEBUG_TRACE="False" UE_TIMING_TRACE="False" USRP_REC_PLAY="False" BUILD_ECLIPSE=0 -BASIC_SIMULATOR=0 + trap handle_ctrl_c INT function print_help() { @@ -107,11 +107,8 @@ Options Rel8 limits the implementation to 3GPP Release 8 version Rel10 limits the implementation to 3GPP Release 10 version -w | --hardware - EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, IRIS, None (Default) + EXMIMO, USRP, BLADERF, LMSSDR, IRIS, None (Default) Adds this RF board support (in external packages installation and in compilation) --t | --transport protocol - ETHERNET , None - Adds this trasport protocol support in compilation --phy_simulators Makes the unitary tests Layer 1 simulators --core_simulators @@ -246,14 +243,6 @@ function main() { esac echo_info "Setting hardware to: $HW" shift 2;; - -t | --transport_protocol) - TP="$2" #"${i#*=}" - if [ "$TP" != "ETHERNET" -a "$TP" != "None" ] ; then - echo_fatal "Unknown TP type $TP will exit..." - else - echo_info "Setting transport protocol to: $TP" - fi - shift 2;; --phy_simulators) SIMUS_PHY=1 echo_info "Will compile dlsim, ulsim, ..." @@ -350,14 +339,6 @@ function main() { USRP_REC_PLAY="True" echo_info "Enabling USRP record playback mode" shift 1;; - --basic-simulator) - BASIC_SIMULATOR=1 - echo_info "Compiling the basic simulator device" - shift 1;; - --rfsimulator) - RFSIMULATOR=true - echo_info "Compiling the RF simulator device" - shift 1;; -h | --help) print_help exit 1;; @@ -377,7 +358,7 @@ function main() { if [ "$eNB" = "1" ] ; then if [ "$HW" = "None" -a "$TP" = "None" ] ; then - echo_fatal "Define a local radio head (e.g. -w EXMIMO) or a transport protocol (e.g. -t ETHERNET) to communicate with a remote radio head!" + echo_info "No local radio head and no transport protocol selected" fi if [ "$HW" = "None" ] ; then echo_info "No radio head has been selected (HW set to $HW)" From 582c6dd076af0620fb66cab08f4d503d82638053 Mon Sep 17 00:00:00 2001 From: frtabu Date: Tue, 30 Apr 2019 10:54:16 +0200 Subject: [PATCH 09/28] Try basic_simulator build failure (log file pattern Pb?) --- ci-scripts/oai-ci-vm-tool | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/oai-ci-vm-tool b/ci-scripts/oai-ci-vm-tool index ab28cd5204..7c5c02ba0b 100755 --- a/ci-scripts/oai-ci-vm-tool +++ b/ci-scripts/oai-ci-vm-tool @@ -244,7 +244,7 @@ case $key in -v2) VM_NAME=ci-basic-sim ARCHIVES_LOC=basic_sim - LOG_PATTERN=basic_simulator + LOG_PATTERN=Rel14.txt NB_PATTERN_FILES=13 BUILD_OPTIONS="--eNB --UE" VM_MEMORY=8192 @@ -339,7 +339,7 @@ case $key in basic-sim) VM_NAME=ci-basic-sim ARCHIVES_LOC=basic_sim - LOG_PATTERN=basic_simulator + LOG_PATTERN=.Rel14.txt NB_PATTERN_FILES=13 BUILD_OPTIONS="--UE --eNB" VM_MEMORY=8192 From d205c806de071266016af65521e8185a3320e58e Mon Sep 17 00:00:00 2001 From: frtabu Date: Tue, 30 Apr 2019 15:40:13 +0200 Subject: [PATCH 10/28] fix remaining deprecated commands in CI --- ci-scripts/runTestOnVM.sh | 30 +++++++++---------- .../xml_files/if4p5_usrp210_band40_build.xml | 2 +- .../xml_files/if4p5_usrp210_band7_build.xml | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index 95e712c2c4..a4bc4ed8f3 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -80,15 +80,15 @@ function start_basic_sim_enb { fi echo "echo \"grep N_RB_DL ci-$LOC_CONF_FILE\"" >> $1 echo "grep N_RB_DL ci-$LOC_CONF_FILE | sed -e 's#N_RB_DL.*=#N_RB_DL =#'" >> $1 - echo "echo \"cd /home/ubuntu/tmp/cmake_targets/basic_simulator/enb/\"" >> $1 - echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/basic_simulator" >> $1 - echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/basic_simulator/enb/" >> $1 - echo "cd /home/ubuntu/tmp/cmake_targets/basic_simulator/enb/" >> $1 - echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/\"" >> $1 + echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/lte_build_oai/" >> $1 + echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 + echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 + echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --basicsim\" > ./my-lte-softmodem-run.sh " >> $1 echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1 echo "cat ./my-lte-softmodem-run.sh" >> $1 echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE; fi" >> $1 - echo "sudo -E daemon --inherit --unsafe --name=enb_daemon --chdir=/home/ubuntu/tmp/cmake_targets/basic_simulator/enb -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-lte-softmodem-run.sh" >> $1 + echo "sudo -E daemon --inherit --unsafe --name=enb_daemon --chdir=/home/ubuntu/tmp/cmake_targets/lte_build_oai/build -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-lte-softmodem-run.sh" >> $1 ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1 rm $1 @@ -123,14 +123,14 @@ function start_basic_sim_ue { local LOC_UE_LOG_FILE=$3 local LOC_NB_RBS=$4 local LOC_FREQUENCY=$5 - echo "echo \"cd /home/ubuntu/tmp/cmake_targets/basic_simulator/ue\"" > $1 - echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/basic_simulator/ue" >> $1 - echo "cd /home/ubuntu/tmp/cmake_targets/basic_simulator/ue" >> $1 - echo "echo \"./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_NB_RBS --ue-rxgain 140\" > ./my-lte-uesoftmodem-run.sh" >> $1 + echo "echo \"cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/\"" > $1 + echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 + echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build" >> $1 + echo "echo \"./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_NB_RBS --ue-rxgain 140 --basicsim\" > ./my-lte-uesoftmodem-run.sh" >> $1 echo "chmod 775 ./my-lte-uesoftmodem-run.sh" >> $1 echo "cat ./my-lte-uesoftmodem-run.sh" >> $1 echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE; fi" >> $1 - echo "sudo -E daemon --inherit --unsafe --name=ue_daemon --chdir=/home/ubuntu/tmp/cmake_targets/basic_simulator/ue -o /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE ./my-lte-uesoftmodem-run.sh" >> $1 + echo "sudo -E daemon --inherit --unsafe --name=ue_daemon --chdir=/home/ubuntu/tmp/cmake_targets/lte_build_oai/build -o /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE ./my-lte-uesoftmodem-run.sh" >> $1 ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 rm $1 @@ -418,14 +418,14 @@ function recover_core_dump { then local TC=`echo $3 | sed -e "s#^.*enb_##" -e "s#Hz.*#Hz#"` echo "Segmentation fault detected on enb -> recovering core dump" - echo "cd /home/ubuntu/tmp/cmake_targets/basic_simulator/enb" > $1 + echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" > $1 echo "sync" >> $1 echo "sudo tar -cjhf basic-simulator-enb-core-${TC}.bz2 core lte-softmodem *.so ci-lte-basic-sim.conf my-lte-softmodem-run.sh" >> $1 echo "sudo rm core" >> $1 echo "rm ci-lte-basic-sim.conf" >> $1 echo "sync" >> $1 ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/basic_simulator/enb/basic-simulator-enb-core-${TC}.bz2 $4 + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/lte_build_oai/build/basic-simulator-enb-core-${TC}.bz2 $4 rm -f $1 fi } @@ -694,8 +694,8 @@ function build_ue_on_separate_folder { echo "cd cmake_targets/" >> $1 echo "mkdir log" >> $1 echo "chmod 777 log" >> $1 - echo "echo \"./build_oai --UE -t ETHERNET \"" >> $1 - echo "./build_oai --UE -t ETHERNET > log/ue-build.txt 2>&1" >> $1 + echo "echo \"./build_oai --UE \"" >> $1 + echo "./build_oai --UE > log/ue-build.txt 2>&1" >> $1 echo "cd tools" >> $1 echo "sudo ifconfig lo: 127.0.0.2 netmask 255.0.0.0 up" >> $1 echo "sudo chmod 666 /etc/iproute2/rt_tables" >> $1 diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml index 5bb7db5299..fafcc51051 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml @@ -34,7 +34,7 @@ Build_eNB Build eNB (USRP -- Ethernet Fronthaul) - -t ETHERNET -w USRP -c --eNB + -w USRP -c --eNB diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml index a0be9253db..a60662d799 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml @@ -34,7 +34,7 @@ Build_eNB Build eNB (USRP -- Ethernet Fronthaul) - -t ETHERNET -w USRP -c --eNB + -w USRP -c --eNB From fad83e4724e1b66dfed34b5e63ada281c8a095e1 Mon Sep 17 00:00:00 2001 From: frtabu Date: Tue, 30 Apr 2019 19:08:37 +0200 Subject: [PATCH 11/28] Update doc, remove color escape sequences from logs (use character to identify message level), try to fix basic simu Pb --- ci-scripts/runTestOnVM.sh | 20 ++++++++++---------- cmake_targets/build_oai | 9 --------- doc/BUILD.md | 6 ------ 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index a4bc4ed8f3..4ff5183106 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -84,7 +84,7 @@ function start_basic_sim_enb { echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/lte_build_oai/" >> $1 echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 - echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --basicsim\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --basicsim\" > ./my-lte-softmodem-run.sh " >> $1 echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1 echo "cat ./my-lte-softmodem-run.sh" >> $1 echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE; fi" >> $1 @@ -126,7 +126,7 @@ function start_basic_sim_ue { echo "echo \"cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/\"" > $1 echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build" >> $1 - echo "echo \"./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_NB_RBS --ue-rxgain 140 --basicsim\" > ./my-lte-uesoftmodem-run.sh" >> $1 + echo "echo \"./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_NB_RBS --log_config.global_log_options level,nocolor --basicsim\" > ./my-lte-uesoftmodem-run.sh" >> $1 echo "chmod 775 ./my-lte-uesoftmodem-run.sh" >> $1 echo "cat ./my-lte-uesoftmodem-run.sh" >> $1 echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE; fi" >> $1 @@ -729,9 +729,9 @@ function start_l2_sim_enb { echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 if [ $LOC_S1_CONFIGURATION -eq 0 ] then - echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --noS1\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --noS1\" > ./my-lte-softmodem-run.sh " >> $1 else - echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor \" > ./my-lte-softmodem-run.sh " >> $1 fi echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1 echo "cat ./my-lte-softmodem-run.sh" >> $1 @@ -837,9 +837,9 @@ function start_l2_sim_ue { echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 if [ $LOC_S1_CONFIGURATION -eq 0 ] then - echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --nokrnmod 1 --noS1\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --nokrnmod 1 --log_config.global_log_options level,nocolor --noS1\" > ./my-lte-softmodem-run.sh " >> $1 else - echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --nokrnmod 1\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --nokrnmod 1 --log_config.global_log_options level,nocolor \" > ./my-lte-softmodem-run.sh " >> $1 fi echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1 echo "cat ./my-lte-softmodem-run.sh" >> $1 @@ -949,9 +949,9 @@ function start_rf_sim_enb { echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 if [ $LOC_S1_CONFIGURATION -eq 0 ] then - echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --rfsim --noS1\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --rfsim --log_config.global_log_options level,nocolor --noS1\" > ./my-lte-softmodem-run.sh " >> $1 else - echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --rfsim\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --rfsim --log_config.global_log_options level,nocolor \" > ./my-lte-softmodem-run.sh " >> $1 fi echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1 echo "cat ./my-lte-softmodem-run.sh" >> $1 @@ -1028,9 +1028,9 @@ function start_rf_sim_ue { echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 if [ $LOC_S1_CONFIGURATION -eq 0 ] then - echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_PRB --nokrnmod 1 --rfsim --noS1\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_PRB --nokrnmod 1 --rfsim --log_config.global_log_options level,nocolor --noS1\" > ./my-lte-softmodem-run.sh " >> $1 else - echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_PRB --nokrnmod 1 --rfsim\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_PRB --nokrnmod 1 --rfsim --log_config.global_log_options level,nocolor\" > ./my-lte-softmodem-run.sh " >> $1 fi echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1 echo "cat ./my-lte-softmodem-run.sh" >> $1 diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index b4b807331d..65cc360056 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -154,12 +154,6 @@ Options Build MSC tracing utility, specify --msc on command line to start it (eNB and UE) --usrp-recplay Build for I/Q record-playback modes ---basic-simulator - Generates a basic [1 UE + 1 eNB + no channel] simulator. - See targets/ARCH/tcp_bridge/README.tcp_bridge_oai for documentation. ---rfsimulator - Generate virtual RF driver - to use it, set the environement variable RFSIMULATOR to \"enb\" in the eNB and to the eNB IP address in the UEs Usage (first build): NI/ETTUS B201 + COTS UE : ./build_oai -I --eNB -x --install-system-files -w USRP Usage (Regular): @@ -479,9 +473,6 @@ function main() { mkdir -p $DIR/$lte_build_dir/build cmake_file=$DIR/$lte_build_dir/CMakeLists.txt echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file -# if [ "$NOS1" = "1" ] ; then -# cat $DIR/$lte_build_dir/CMakeLists.template >> $cmake_file -# fi echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file echo "set ( XFORMS $XFORMS )" >> $cmake_file diff --git a/doc/BUILD.md b/doc/BUILD.md index 1f971b7776..3e312a2eab 100644 --- a/doc/BUILD.md +++ b/doc/BUILD.md @@ -94,7 +94,6 @@ The USRP record player today needs a specific build. Work to make it available a | --clean-kernel | unknown | no code in the script corresponding to this option | | --install-system-files | maintained | install oai built binaries in linux system files repositories | | -w | maintained and tested in CI for USRP device | build corresponding oai device and create the soft link to enforce this device usage at run-time | -| -t | maintained | build the specified transport library, which is used in some simulators and in non monolithic eNodeB deployments. Now of little interest as transport library build is enforced when building the eNodeB. | | --phy_simulators | maintained, tested in CI | build all PHY simulators, a set of executables allowing unitary tests of LTE channel implementation within oai. | | --core_simulators | | | | -s | | | @@ -113,17 +112,12 @@ The USRP record player today needs a specific build. Work to make it available a | -r | unknown, to be removed | specifies which 3GPP release to build for. Only the default (today rel14) is tested in CI and it is likely that future oai release will remove this option | | -V | deprecated | Used to build with support for synchronization diagram utility. This is now available via the T-Tracer and is included if T-Tracer is not disabled. | | -x | deprecated | Used to build with support for embedded signal analyzer. This is now available via the T-Tracer and is included if T-Tracer is not disabled. | -| --noS1 | deprecated, to be removed | build noS1 version of oai softmodem binaries. noS1 allows running oai eNodeB and UE without an LTE core network (EPC). This functionality is now available via a run-time option. | | --build-doxygen | unknown | build doxygen documentation, many oai source files do not include doxygen comments | | --disable-deadline --enable-deadline --disable-cpu-affinity | deprecated | These options were used to activate or de-activate specific code depending on the choice of a specific linux scheduling mode. This has not been tested for a while and should be implemented as configuration options | | --disable-T-Tracer | maintained, to be tested | Remove T_Tracer and console LOG messages except error messages. | | --disable-hardware-dependency | | | | --ue-autotest-trace --ue-timing --ue-trace | deprecated | Were used to enable conditional code implementing debugging messages or debugging statistics. These functionalities are now either available from run-time options or not maintained. | -| --disable-log | deprecated, to be removed | Was used to disable LOG messages, replaced by `--disable-T-Tracer` build option to remove tracing code from the build or `--T-stdout 0` run time option to redirect LOG messages to T-Tracer client interface. | -| --ue-nas-use-tun | deprecated to be removed | Usage of tun in place of specific kernel modules is now a run time option. `--nokrnmod 0` option disable the default behavior which is to use tun to send or receive ip packets to/from the linux ip stack. | | --build-eclipse | unknown | | -| --basic-simulator | deprecated tested in CI | builds the basic simulator device. Now of little interest as this device build is enforced when building the eNodeB and it can be used at run time with the `--basicsim` option. More over the rf simulator is an enhanced basic simulator. | -| --rfsimulator | maintained | builds the rf simulator device. Now of little interest as this device build is enforced when building the eNodeB and it can be used at run time with the `--rfsim` option. | | | | | [oai wiki home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home) From 28a4f53356eb2ab814b795cecf6ad336a10a320d Mon Sep 17 00:00:00 2001 From: frtabu Date: Mon, 6 May 2019 19:17:40 +0200 Subject: [PATCH 12/28] Fix basic simu problem, due to remaining #if OAI_USRP... macros in UE --- openair1/PHY/LTE_TRANSPORT/print_stats.c | 941 +++++++++---------- openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c | 81 +- openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c | 503 +++++----- openair1/SCHED_UE/phy_procedures_lte_ue.c | 376 ++++---- targets/RT/USER/lte-ue.c | 2 +- 5 files changed, 882 insertions(+), 1021 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/print_stats.c b/openair1/PHY/LTE_TRANSPORT/print_stats.c index e86b7ff376..defe86ef38 100644 --- a/openair1/PHY/LTE_TRANSPORT/print_stats.c +++ b/openair1/PHY/LTE_TRANSPORT/print_stats.c @@ -31,25 +31,23 @@ */ #include "PHY/LTE_TRANSPORT/proto.h" - +#include "targets/RT/USER/lte-softmodem.h" #include "PHY/defs.h" #include "PHY/extern.h" #include "SCHED/extern.h" #ifdef OPENAIR2 -#include "openair2/LAYER2/MAC/proto.h" -#include "openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.h" + #include "openair2/LAYER2/MAC/proto.h" + #include "openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.h" #endif extern int mac_get_rrc_status(uint8_t Mod_id,uint8_t eNB_flag,uint8_t index); -#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) + #include "common_lib.h" extern openair0_config_t openair0_cfg[]; -#endif -int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length, runmode_t mode, int input_level_dBm) -{ +int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char *buffer, int length, runmode_t mode, int input_level_dBm) { uint8_t eNB=0; uint32_t RRC_status; int len=length; @@ -60,13 +58,12 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length if ((mode == normal_txrx) || (mode == no_L2_connect)) { len += sprintf(&buffer[len], "[UE_PROC] UE %d, RNTI %x\n",ue->Mod_id, ue->pdcch_vars[0][0]->crnti); - len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %.2f dBm/RE, RSSI %.2f dBm, RSRQ[0] %.2f dB, N0 %d dBm/RE (NF %.1f dB)\n", - 10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB, - 10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, - 10*log10(ue->measurements.rsrq[0]), - ue->measurements.n0_power_tot_dBm, - (double)ue->measurements.n0_power_tot_dBm+132.24); - + len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %.2f dBm/RE, RSSI %.2f dBm, RSRQ[0] %.2f dB, N0 %d dBm/RE (NF %.1f dB)\n", + 10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB, + 10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, + 10*log10(ue->measurements.rsrq[0]), + ue->measurements.n0_power_tot_dBm, + (double)ue->measurements.n0_power_tot_dBm+132.24); /* len += sprintf(&buffer[len], "[UE PROC] Frame count: %d\neNB0 RSSI %d dBm/RE (%d dB, %d dB)\neNB1 RSSI %d dBm/RE (%d dB, %d dB)neNB2 RSSI %d dBm/RE (%d dB, %d dB)\nN0 %d dBm/RE, %f dBm/%dPRB (%d dB, %d dB)\n", @@ -86,31 +83,28 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ue->measurements.n0_power_dB[0], ue->measurements.n0_power_dB[1]); */ - #ifdef EXMIMO len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB (LNA %d, vga %d dB)\n",ue->rx_total_gain_dB, openair0_cfg[0].rxg_mode[0],(int)openair0_cfg[0].rx_gain[0]); #endif -#if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB\n",ue->rx_total_gain_dB); -#endif -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) len += sprintf(&buffer[len], "[UE_PROC] Frequency offset %d Hz, estimated carrier frequency %f Hz\n",ue->common_vars.freq_offset,openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset); -#endif len += sprintf(&buffer[len], "[UE PROC] UE mode = %s (%d)\n",mode_string[ue->UE_mode[0]],ue->UE_mode[0]); len += sprintf(&buffer[len], "[UE PROC] timing_advance = %d\n",ue->timing_advance); + if (ue->UE_mode[0]==PUSCH) { - len += sprintf(&buffer[len], "[UE PROC] Po_PUSCH = %d dBm (PL %d dB, Po_NOMINAL_PUSCH %d dBm, PHR %d dB)\n", - ue->ulsch[0]->Po_PUSCH, - get_PL(ue->Mod_id,ue->CC_id,0), - ue->frame_parms.ul_power_control_config_common.p0_NominalPUSCH, - ue->ulsch[0]->PHR); - len += sprintf(&buffer[len], "[UE PROC] Po_PUCCH = %d dBm (Po_NOMINAL_PUCCH %d dBm, g_pucch %d dB)\n", - get_PL(ue->Mod_id,ue->CC_id,0)+ - ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH+ - ue->dlsch[0][0][0]->g_pucch, - ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH, - ue->dlsch[0][0][0]->g_pucch); + len += sprintf(&buffer[len], "[UE PROC] Po_PUSCH = %d dBm (PL %d dB, Po_NOMINAL_PUSCH %d dBm, PHR %d dB)\n", + ue->ulsch[0]->Po_PUSCH, + get_PL(ue->Mod_id,ue->CC_id,0), + ue->frame_parms.ul_power_control_config_common.p0_NominalPUSCH, + ue->ulsch[0]->PHR); + len += sprintf(&buffer[len], "[UE PROC] Po_PUCCH = %d dBm (Po_NOMINAL_PUCCH %d dBm, g_pucch %d dB)\n", + get_PL(ue->Mod_id,ue->CC_id,0)+ + ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH+ + ue->dlsch[0][0][0]->g_pucch, + ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH, + ue->dlsch[0][0][0]->g_pucch); } + //for (eNB=0;eNBmeasurements.rx_spatial_power_dB[eNB][0][1], ue->measurements.rx_spatial_power_dB[eNB][1][0], ue->measurements.rx_spatial_power_dB[eNB][1][1]); - len += sprintf(&buffer[len], "[UE PROC] RX total power eNB%d: %d dB, avg: %d dB\n",eNB,ue->measurements.rx_power_tot_dB[eNB],ue->measurements.rx_power_avg_dB[eNB]); len += sprintf(&buffer[len], "[UE PROC] RX total power lin: %d, avg: %d, RX total noise lin: %d, avg: %d\n",ue->measurements.rx_power_tot[eNB], ue->measurements.rx_power_avg[eNB], ue->measurements.n0_power_tot, ue->measurements.n0_power_avg); @@ -127,351 +120,324 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length len += sprintf(&buffer[len], "[UE PROC] Wideband CQI eNB %d: %d dB, avg: %d dB\n",eNB,ue->measurements.wideband_cqi_tot[eNB],ue->measurements.wideband_cqi_avg[eNB]); switch (ue->frame_parms.N_RB_DL) { - case 6: - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][0][0], - ue->measurements.subband_cqi_dB[eNB][0][1], - ue->measurements.subband_cqi_dB[eNB][0][2], - ue->measurements.subband_cqi_dB[eNB][0][3], - ue->measurements.subband_cqi_dB[eNB][0][4], - ue->measurements.subband_cqi_dB[eNB][0][5]); + case 6: + len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d] dB\n", + eNB, + ue->measurements.subband_cqi_dB[eNB][0][0], + ue->measurements.subband_cqi_dB[eNB][0][1], + ue->measurements.subband_cqi_dB[eNB][0][2], + ue->measurements.subband_cqi_dB[eNB][0][3], + ue->measurements.subband_cqi_dB[eNB][0][4], + ue->measurements.subband_cqi_dB[eNB][0][5]); + len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d] dB\n", + eNB, + ue->measurements.subband_cqi_dB[eNB][1][0], + ue->measurements.subband_cqi_dB[eNB][1][1], + ue->measurements.subband_cqi_dB[eNB][1][2], + ue->measurements.subband_cqi_dB[eNB][1][3], + ue->measurements.subband_cqi_dB[eNB][1][4], + ue->measurements.subband_cqi_dB[eNB][1][5]); + len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", + eNB, + ue->measurements.subband_pmi_re[eNB][0][0], + ue->measurements.subband_pmi_im[eNB][0][0], + ue->measurements.subband_pmi_re[eNB][1][0], + ue->measurements.subband_pmi_im[eNB][1][0], + ue->measurements.subband_pmi_re[eNB][2][0], + ue->measurements.subband_pmi_im[eNB][2][0], + ue->measurements.subband_pmi_re[eNB][3][0], + ue->measurements.subband_pmi_im[eNB][3][0], + ue->measurements.subband_pmi_re[eNB][4][0], + ue->measurements.subband_pmi_im[eNB][4][0], + ue->measurements.subband_pmi_re[eNB][5][0], + ue->measurements.subband_pmi_im[eNB][5][0]); + len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", + eNB, + ue->measurements.subband_pmi_re[eNB][0][1], + ue->measurements.subband_pmi_im[eNB][0][1], + ue->measurements.subband_pmi_re[eNB][1][1], + ue->measurements.subband_pmi_im[eNB][1][1], + ue->measurements.subband_pmi_re[eNB][2][1], + ue->measurements.subband_pmi_im[eNB][2][1], + ue->measurements.subband_pmi_re[eNB][3][1], + ue->measurements.subband_pmi_im[eNB][3][1], + ue->measurements.subband_pmi_re[eNB][4][1], + ue->measurements.subband_pmi_im[eNB][4][1], + ue->measurements.subband_pmi_re[eNB][5][1], + ue->measurements.subband_pmi_im[eNB][5][1]); + len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d]\n", + eNB, + ue->measurements.selected_rx_antennas[eNB][0], + ue->measurements.selected_rx_antennas[eNB][1], + ue->measurements.selected_rx_antennas[eNB][2], + ue->measurements.selected_rx_antennas[eNB][3], + ue->measurements.selected_rx_antennas[eNB][4], + ue->measurements.selected_rx_antennas[eNB][5]); + len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,6))); + len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, + pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,6)), + pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,6))); + break; + case 25: + len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d] dB\n", + eNB, + ue->measurements.subband_cqi_dB[eNB][0][0], + ue->measurements.subband_cqi_dB[eNB][0][1], + ue->measurements.subband_cqi_dB[eNB][0][2], + ue->measurements.subband_cqi_dB[eNB][0][3], + ue->measurements.subband_cqi_dB[eNB][0][4], + ue->measurements.subband_cqi_dB[eNB][0][5], + ue->measurements.subband_cqi_dB[eNB][0][6]); + len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d] dB\n", + eNB, + ue->measurements.subband_cqi_dB[eNB][1][0], + ue->measurements.subband_cqi_dB[eNB][1][1], + ue->measurements.subband_cqi_dB[eNB][1][2], + ue->measurements.subband_cqi_dB[eNB][1][3], + ue->measurements.subband_cqi_dB[eNB][1][4], + ue->measurements.subband_cqi_dB[eNB][1][5], + ue->measurements.subband_cqi_dB[eNB][1][6]); + len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", + eNB, + ue->measurements.subband_pmi_re[eNB][0][0], + ue->measurements.subband_pmi_im[eNB][0][0], + ue->measurements.subband_pmi_re[eNB][1][0], + ue->measurements.subband_pmi_im[eNB][1][0], + ue->measurements.subband_pmi_re[eNB][2][0], + ue->measurements.subband_pmi_im[eNB][2][0], + ue->measurements.subband_pmi_re[eNB][3][0], + ue->measurements.subband_pmi_im[eNB][3][0], + ue->measurements.subband_pmi_re[eNB][4][0], + ue->measurements.subband_pmi_im[eNB][4][0], + ue->measurements.subband_pmi_re[eNB][5][0], + ue->measurements.subband_pmi_im[eNB][5][0], + ue->measurements.subband_pmi_re[eNB][6][0], + ue->measurements.subband_pmi_im[eNB][6][0]); + len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", + eNB, + ue->measurements.subband_pmi_re[eNB][0][1], + ue->measurements.subband_pmi_im[eNB][0][1], + ue->measurements.subband_pmi_re[eNB][1][1], + ue->measurements.subband_pmi_im[eNB][1][1], + ue->measurements.subband_pmi_re[eNB][2][1], + ue->measurements.subband_pmi_im[eNB][2][1], + ue->measurements.subband_pmi_re[eNB][3][1], + ue->measurements.subband_pmi_im[eNB][3][1], + ue->measurements.subband_pmi_re[eNB][4][1], + ue->measurements.subband_pmi_im[eNB][4][1], + ue->measurements.subband_pmi_re[eNB][5][1], + ue->measurements.subband_pmi_im[eNB][5][1], + ue->measurements.subband_pmi_re[eNB][6][1], + ue->measurements.subband_pmi_im[eNB][6][1]); + len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d]\n", + eNB, + ue->measurements.selected_rx_antennas[eNB][0], + ue->measurements.selected_rx_antennas[eNB][1], + ue->measurements.selected_rx_antennas[eNB][2], + ue->measurements.selected_rx_antennas[eNB][3], + ue->measurements.selected_rx_antennas[eNB][4], + ue->measurements.selected_rx_antennas[eNB][5], + ue->measurements.selected_rx_antennas[eNB][6]); + len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,7))); + len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, + pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,7)), + pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,7))); + break; - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][1][0], - ue->measurements.subband_cqi_dB[eNB][1][1], - ue->measurements.subband_cqi_dB[eNB][1][2], - ue->measurements.subband_cqi_dB[eNB][1][3], - ue->measurements.subband_cqi_dB[eNB][1][4], - ue->measurements.subband_cqi_dB[eNB][1][5]); + case 50: + len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d %d %d] dB\n", + eNB, + ue->measurements.subband_cqi_dB[eNB][0][0], + ue->measurements.subband_cqi_dB[eNB][0][1], + ue->measurements.subband_cqi_dB[eNB][0][2], + ue->measurements.subband_cqi_dB[eNB][0][3], + ue->measurements.subband_cqi_dB[eNB][0][4], + ue->measurements.subband_cqi_dB[eNB][0][5], + ue->measurements.subband_cqi_dB[eNB][0][6], + ue->measurements.subband_cqi_dB[eNB][0][7], + ue->measurements.subband_cqi_dB[eNB][0][8]); + len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d] dB\n", + eNB, + ue->measurements.subband_cqi_dB[eNB][1][0], + ue->measurements.subband_cqi_dB[eNB][1][1], + ue->measurements.subband_cqi_dB[eNB][1][2], + ue->measurements.subband_cqi_dB[eNB][1][3], + ue->measurements.subband_cqi_dB[eNB][1][4], + ue->measurements.subband_cqi_dB[eNB][1][5], + ue->measurements.subband_cqi_dB[eNB][1][6], + ue->measurements.subband_cqi_dB[eNB][1][7], + ue->measurements.subband_cqi_dB[eNB][1][8]); + len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", + eNB, + ue->measurements.subband_pmi_re[eNB][0][0], + ue->measurements.subband_pmi_im[eNB][0][0], + ue->measurements.subband_pmi_re[eNB][1][0], + ue->measurements.subband_pmi_im[eNB][1][0], + ue->measurements.subband_pmi_re[eNB][2][0], + ue->measurements.subband_pmi_im[eNB][2][0], + ue->measurements.subband_pmi_re[eNB][3][0], + ue->measurements.subband_pmi_im[eNB][3][0], + ue->measurements.subband_pmi_re[eNB][4][0], + ue->measurements.subband_pmi_im[eNB][4][0], + ue->measurements.subband_pmi_re[eNB][5][0], + ue->measurements.subband_pmi_im[eNB][5][0], + ue->measurements.subband_pmi_re[eNB][6][0], + ue->measurements.subband_pmi_im[eNB][6][0], + ue->measurements.subband_pmi_re[eNB][7][0], + ue->measurements.subband_pmi_im[eNB][7][0], + ue->measurements.subband_pmi_re[eNB][8][0], + ue->measurements.subband_pmi_im[eNB][8][0]); + len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", + eNB, + ue->measurements.subband_pmi_re[eNB][0][1], + ue->measurements.subband_pmi_im[eNB][0][1], + ue->measurements.subband_pmi_re[eNB][1][1], + ue->measurements.subband_pmi_im[eNB][1][1], + ue->measurements.subband_pmi_re[eNB][2][1], + ue->measurements.subband_pmi_im[eNB][2][1], + ue->measurements.subband_pmi_re[eNB][3][1], + ue->measurements.subband_pmi_im[eNB][3][1], + ue->measurements.subband_pmi_re[eNB][4][1], + ue->measurements.subband_pmi_im[eNB][4][1], + ue->measurements.subband_pmi_re[eNB][5][1], + ue->measurements.subband_pmi_im[eNB][5][1], + ue->measurements.subband_pmi_re[eNB][6][1], + ue->measurements.subband_pmi_im[eNB][6][1], + ue->measurements.subband_pmi_re[eNB][7][1], + ue->measurements.subband_pmi_im[eNB][7][1], + ue->measurements.subband_pmi_re[eNB][8][1], + ue->measurements.subband_pmi_im[eNB][8][1]); + len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d]\n", + eNB, + ue->measurements.selected_rx_antennas[eNB][0], + ue->measurements.selected_rx_antennas[eNB][1], + ue->measurements.selected_rx_antennas[eNB][2], + ue->measurements.selected_rx_antennas[eNB][3], + ue->measurements.selected_rx_antennas[eNB][4], + ue->measurements.selected_rx_antennas[eNB][5], + ue->measurements.selected_rx_antennas[eNB][6], + ue->measurements.selected_rx_antennas[eNB][7], + ue->measurements.selected_rx_antennas[eNB][8]); + len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,9))); + len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, + pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,9)), + pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,9))); + break; - - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][0], - ue->measurements.subband_pmi_im[eNB][0][0], - ue->measurements.subband_pmi_re[eNB][1][0], - ue->measurements.subband_pmi_im[eNB][1][0], - ue->measurements.subband_pmi_re[eNB][2][0], - ue->measurements.subband_pmi_im[eNB][2][0], - ue->measurements.subband_pmi_re[eNB][3][0], - ue->measurements.subband_pmi_im[eNB][3][0], - ue->measurements.subband_pmi_re[eNB][4][0], - ue->measurements.subband_pmi_im[eNB][4][0], - ue->measurements.subband_pmi_re[eNB][5][0], - ue->measurements.subband_pmi_im[eNB][5][0]); - - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][1], - ue->measurements.subband_pmi_im[eNB][0][1], - ue->measurements.subband_pmi_re[eNB][1][1], - ue->measurements.subband_pmi_im[eNB][1][1], - ue->measurements.subband_pmi_re[eNB][2][1], - ue->measurements.subband_pmi_im[eNB][2][1], - ue->measurements.subband_pmi_re[eNB][3][1], - ue->measurements.subband_pmi_im[eNB][3][1], - ue->measurements.subband_pmi_re[eNB][4][1], - ue->measurements.subband_pmi_im[eNB][4][1], - ue->measurements.subband_pmi_re[eNB][5][1], - ue->measurements.subband_pmi_im[eNB][5][1]); - - len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d]\n", - eNB, - ue->measurements.selected_rx_antennas[eNB][0], - ue->measurements.selected_rx_antennas[eNB][1], - ue->measurements.selected_rx_antennas[eNB][2], - ue->measurements.selected_rx_antennas[eNB][3], - ue->measurements.selected_rx_antennas[eNB][4], - ue->measurements.selected_rx_antennas[eNB][5]); - - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,6))); - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,6)), - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,6))); - break; - - case 25: - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][0][0], - ue->measurements.subband_cqi_dB[eNB][0][1], - ue->measurements.subband_cqi_dB[eNB][0][2], - ue->measurements.subband_cqi_dB[eNB][0][3], - ue->measurements.subband_cqi_dB[eNB][0][4], - ue->measurements.subband_cqi_dB[eNB][0][5], - ue->measurements.subband_cqi_dB[eNB][0][6]); - - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][1][0], - ue->measurements.subband_cqi_dB[eNB][1][1], - ue->measurements.subband_cqi_dB[eNB][1][2], - ue->measurements.subband_cqi_dB[eNB][1][3], - ue->measurements.subband_cqi_dB[eNB][1][4], - ue->measurements.subband_cqi_dB[eNB][1][5], - ue->measurements.subband_cqi_dB[eNB][1][6]); - - - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][0], - ue->measurements.subband_pmi_im[eNB][0][0], - ue->measurements.subband_pmi_re[eNB][1][0], - ue->measurements.subband_pmi_im[eNB][1][0], - ue->measurements.subband_pmi_re[eNB][2][0], - ue->measurements.subband_pmi_im[eNB][2][0], - ue->measurements.subband_pmi_re[eNB][3][0], - ue->measurements.subband_pmi_im[eNB][3][0], - ue->measurements.subband_pmi_re[eNB][4][0], - ue->measurements.subband_pmi_im[eNB][4][0], - ue->measurements.subband_pmi_re[eNB][5][0], - ue->measurements.subband_pmi_im[eNB][5][0], - ue->measurements.subband_pmi_re[eNB][6][0], - ue->measurements.subband_pmi_im[eNB][6][0]); - - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][1], - ue->measurements.subband_pmi_im[eNB][0][1], - ue->measurements.subband_pmi_re[eNB][1][1], - ue->measurements.subband_pmi_im[eNB][1][1], - ue->measurements.subband_pmi_re[eNB][2][1], - ue->measurements.subband_pmi_im[eNB][2][1], - ue->measurements.subband_pmi_re[eNB][3][1], - ue->measurements.subband_pmi_im[eNB][3][1], - ue->measurements.subband_pmi_re[eNB][4][1], - ue->measurements.subband_pmi_im[eNB][4][1], - ue->measurements.subband_pmi_re[eNB][5][1], - ue->measurements.subband_pmi_im[eNB][5][1], - ue->measurements.subband_pmi_re[eNB][6][1], - ue->measurements.subband_pmi_im[eNB][6][1]); - - len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d]\n", - eNB, - ue->measurements.selected_rx_antennas[eNB][0], - ue->measurements.selected_rx_antennas[eNB][1], - ue->measurements.selected_rx_antennas[eNB][2], - ue->measurements.selected_rx_antennas[eNB][3], - ue->measurements.selected_rx_antennas[eNB][4], - ue->measurements.selected_rx_antennas[eNB][5], - ue->measurements.selected_rx_antennas[eNB][6]); - - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,7))); - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,7)), - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,7))); - break; - - case 50: - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][0][0], - ue->measurements.subband_cqi_dB[eNB][0][1], - ue->measurements.subband_cqi_dB[eNB][0][2], - ue->measurements.subband_cqi_dB[eNB][0][3], - ue->measurements.subband_cqi_dB[eNB][0][4], - ue->measurements.subband_cqi_dB[eNB][0][5], - ue->measurements.subband_cqi_dB[eNB][0][6], - ue->measurements.subband_cqi_dB[eNB][0][7], - ue->measurements.subband_cqi_dB[eNB][0][8]); - - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][1][0], - ue->measurements.subband_cqi_dB[eNB][1][1], - ue->measurements.subband_cqi_dB[eNB][1][2], - ue->measurements.subband_cqi_dB[eNB][1][3], - ue->measurements.subband_cqi_dB[eNB][1][4], - ue->measurements.subband_cqi_dB[eNB][1][5], - ue->measurements.subband_cqi_dB[eNB][1][6], - ue->measurements.subband_cqi_dB[eNB][1][7], - ue->measurements.subband_cqi_dB[eNB][1][8]); - - - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][0], - ue->measurements.subband_pmi_im[eNB][0][0], - ue->measurements.subband_pmi_re[eNB][1][0], - ue->measurements.subband_pmi_im[eNB][1][0], - ue->measurements.subband_pmi_re[eNB][2][0], - ue->measurements.subband_pmi_im[eNB][2][0], - ue->measurements.subband_pmi_re[eNB][3][0], - ue->measurements.subband_pmi_im[eNB][3][0], - ue->measurements.subband_pmi_re[eNB][4][0], - ue->measurements.subband_pmi_im[eNB][4][0], - ue->measurements.subband_pmi_re[eNB][5][0], - ue->measurements.subband_pmi_im[eNB][5][0], - ue->measurements.subband_pmi_re[eNB][6][0], - ue->measurements.subband_pmi_im[eNB][6][0], - ue->measurements.subband_pmi_re[eNB][7][0], - ue->measurements.subband_pmi_im[eNB][7][0], - ue->measurements.subband_pmi_re[eNB][8][0], - ue->measurements.subband_pmi_im[eNB][8][0]); - - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][1], - ue->measurements.subband_pmi_im[eNB][0][1], - ue->measurements.subband_pmi_re[eNB][1][1], - ue->measurements.subband_pmi_im[eNB][1][1], - ue->measurements.subband_pmi_re[eNB][2][1], - ue->measurements.subband_pmi_im[eNB][2][1], - ue->measurements.subband_pmi_re[eNB][3][1], - ue->measurements.subband_pmi_im[eNB][3][1], - ue->measurements.subband_pmi_re[eNB][4][1], - ue->measurements.subband_pmi_im[eNB][4][1], - ue->measurements.subband_pmi_re[eNB][5][1], - ue->measurements.subband_pmi_im[eNB][5][1], - ue->measurements.subband_pmi_re[eNB][6][1], - ue->measurements.subband_pmi_im[eNB][6][1], - ue->measurements.subband_pmi_re[eNB][7][1], - ue->measurements.subband_pmi_im[eNB][7][1], - ue->measurements.subband_pmi_re[eNB][8][1], - ue->measurements.subband_pmi_im[eNB][8][1]); - - len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d]\n", - eNB, - ue->measurements.selected_rx_antennas[eNB][0], - ue->measurements.selected_rx_antennas[eNB][1], - ue->measurements.selected_rx_antennas[eNB][2], - ue->measurements.selected_rx_antennas[eNB][3], - ue->measurements.selected_rx_antennas[eNB][4], - ue->measurements.selected_rx_antennas[eNB][5], - ue->measurements.selected_rx_antennas[eNB][6], - ue->measurements.selected_rx_antennas[eNB][7], - ue->measurements.selected_rx_antennas[eNB][8]); - - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,9))); - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,9)), - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,9))); - break; - - case 100: - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d %d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][0][0], - ue->measurements.subband_cqi_dB[eNB][0][1], - ue->measurements.subband_cqi_dB[eNB][0][2], - ue->measurements.subband_cqi_dB[eNB][0][3], - ue->measurements.subband_cqi_dB[eNB][0][4], - ue->measurements.subband_cqi_dB[eNB][0][5], - ue->measurements.subband_cqi_dB[eNB][0][6], - ue->measurements.subband_cqi_dB[eNB][0][7], - ue->measurements.subband_cqi_dB[eNB][0][8], - ue->measurements.subband_cqi_dB[eNB][0][9], - ue->measurements.subband_cqi_dB[eNB][0][10], - ue->measurements.subband_cqi_dB[eNB][0][11], - ue->measurements.subband_cqi_dB[eNB][0][12]); - - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][1][0], - ue->measurements.subband_cqi_dB[eNB][1][1], - ue->measurements.subband_cqi_dB[eNB][1][2], - ue->measurements.subband_cqi_dB[eNB][1][3], - ue->measurements.subband_cqi_dB[eNB][1][4], - ue->measurements.subband_cqi_dB[eNB][1][5], - ue->measurements.subband_cqi_dB[eNB][1][6], - ue->measurements.subband_cqi_dB[eNB][1][7], - ue->measurements.subband_cqi_dB[eNB][1][8], - ue->measurements.subband_cqi_dB[eNB][1][9], - ue->measurements.subband_cqi_dB[eNB][1][10], - ue->measurements.subband_cqi_dB[eNB][1][11], - ue->measurements.subband_cqi_dB[eNB][1][12]); - - - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%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", - eNB, - ue->measurements.subband_pmi_re[eNB][0][0], - ue->measurements.subband_pmi_im[eNB][0][0], - ue->measurements.subband_pmi_re[eNB][1][0], - ue->measurements.subband_pmi_im[eNB][1][0], - ue->measurements.subband_pmi_re[eNB][2][0], - ue->measurements.subband_pmi_im[eNB][2][0], - ue->measurements.subband_pmi_re[eNB][3][0], - ue->measurements.subband_pmi_im[eNB][3][0], - ue->measurements.subband_pmi_re[eNB][4][0], - ue->measurements.subband_pmi_im[eNB][4][0], - ue->measurements.subband_pmi_re[eNB][5][0], - ue->measurements.subband_pmi_im[eNB][5][0], - ue->measurements.subband_pmi_re[eNB][6][0], - ue->measurements.subband_pmi_im[eNB][6][0], - ue->measurements.subband_pmi_re[eNB][7][0], - ue->measurements.subband_pmi_im[eNB][7][0], - ue->measurements.subband_pmi_re[eNB][8][0], - ue->measurements.subband_pmi_im[eNB][8][0], - ue->measurements.subband_pmi_re[eNB][9][0], - ue->measurements.subband_pmi_im[eNB][9][0], - ue->measurements.subband_pmi_re[eNB][10][0], - ue->measurements.subband_pmi_im[eNB][10][0], - ue->measurements.subband_pmi_re[eNB][11][0], - ue->measurements.subband_pmi_im[eNB][11][0], - ue->measurements.subband_pmi_re[eNB][12][0], - ue->measurements.subband_pmi_im[eNB][12][0]); - - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%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", - eNB, - ue->measurements.subband_pmi_re[eNB][0][1], - ue->measurements.subband_pmi_im[eNB][0][1], - ue->measurements.subband_pmi_re[eNB][1][1], - ue->measurements.subband_pmi_im[eNB][1][1], - ue->measurements.subband_pmi_re[eNB][2][1], - ue->measurements.subband_pmi_im[eNB][2][1], - ue->measurements.subband_pmi_re[eNB][3][1], - ue->measurements.subband_pmi_im[eNB][3][1], - ue->measurements.subband_pmi_re[eNB][4][1], - ue->measurements.subband_pmi_im[eNB][4][1], - ue->measurements.subband_pmi_re[eNB][5][1], - ue->measurements.subband_pmi_im[eNB][5][1], - ue->measurements.subband_pmi_re[eNB][6][1], - ue->measurements.subband_pmi_im[eNB][6][1], - ue->measurements.subband_pmi_re[eNB][7][1], - ue->measurements.subband_pmi_im[eNB][7][1], - ue->measurements.subband_pmi_re[eNB][8][1], - ue->measurements.subband_pmi_im[eNB][8][1], - ue->measurements.subband_pmi_re[eNB][9][1], - ue->measurements.subband_pmi_im[eNB][9][1], - ue->measurements.subband_pmi_re[eNB][10][1], - ue->measurements.subband_pmi_im[eNB][10][1], - ue->measurements.subband_pmi_re[eNB][11][1], - ue->measurements.subband_pmi_im[eNB][11][1], - ue->measurements.subband_pmi_re[eNB][12][1], - ue->measurements.subband_pmi_im[eNB][12][1]); - - len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d %d %d %d %d]\n", - eNB, - ue->measurements.selected_rx_antennas[eNB][0], - ue->measurements.selected_rx_antennas[eNB][1], - ue->measurements.selected_rx_antennas[eNB][2], - ue->measurements.selected_rx_antennas[eNB][3], - ue->measurements.selected_rx_antennas[eNB][4], - ue->measurements.selected_rx_antennas[eNB][5], - ue->measurements.selected_rx_antennas[eNB][6], - ue->measurements.selected_rx_antennas[eNB][7], - ue->measurements.selected_rx_antennas[eNB][8], - ue->measurements.selected_rx_antennas[eNB][9], - ue->measurements.selected_rx_antennas[eNB][10], - ue->measurements.selected_rx_antennas[eNB][11], - ue->measurements.selected_rx_antennas[eNB][12]); - - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,13))); - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,13)), - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,13))); - break; + case 100: + len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d %d %d %d %d %d %d] dB\n", + eNB, + ue->measurements.subband_cqi_dB[eNB][0][0], + ue->measurements.subband_cqi_dB[eNB][0][1], + ue->measurements.subband_cqi_dB[eNB][0][2], + ue->measurements.subband_cqi_dB[eNB][0][3], + ue->measurements.subband_cqi_dB[eNB][0][4], + ue->measurements.subband_cqi_dB[eNB][0][5], + ue->measurements.subband_cqi_dB[eNB][0][6], + ue->measurements.subband_cqi_dB[eNB][0][7], + ue->measurements.subband_cqi_dB[eNB][0][8], + ue->measurements.subband_cqi_dB[eNB][0][9], + ue->measurements.subband_cqi_dB[eNB][0][10], + ue->measurements.subband_cqi_dB[eNB][0][11], + ue->measurements.subband_cqi_dB[eNB][0][12]); + len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d %d %d %d %d] dB\n", + eNB, + ue->measurements.subband_cqi_dB[eNB][1][0], + ue->measurements.subband_cqi_dB[eNB][1][1], + ue->measurements.subband_cqi_dB[eNB][1][2], + ue->measurements.subband_cqi_dB[eNB][1][3], + ue->measurements.subband_cqi_dB[eNB][1][4], + ue->measurements.subband_cqi_dB[eNB][1][5], + ue->measurements.subband_cqi_dB[eNB][1][6], + ue->measurements.subband_cqi_dB[eNB][1][7], + ue->measurements.subband_cqi_dB[eNB][1][8], + ue->measurements.subband_cqi_dB[eNB][1][9], + ue->measurements.subband_cqi_dB[eNB][1][10], + ue->measurements.subband_cqi_dB[eNB][1][11], + ue->measurements.subband_cqi_dB[eNB][1][12]); + len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%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", + eNB, + ue->measurements.subband_pmi_re[eNB][0][0], + ue->measurements.subband_pmi_im[eNB][0][0], + ue->measurements.subband_pmi_re[eNB][1][0], + ue->measurements.subband_pmi_im[eNB][1][0], + ue->measurements.subband_pmi_re[eNB][2][0], + ue->measurements.subband_pmi_im[eNB][2][0], + ue->measurements.subband_pmi_re[eNB][3][0], + ue->measurements.subband_pmi_im[eNB][3][0], + ue->measurements.subband_pmi_re[eNB][4][0], + ue->measurements.subband_pmi_im[eNB][4][0], + ue->measurements.subband_pmi_re[eNB][5][0], + ue->measurements.subband_pmi_im[eNB][5][0], + ue->measurements.subband_pmi_re[eNB][6][0], + ue->measurements.subband_pmi_im[eNB][6][0], + ue->measurements.subband_pmi_re[eNB][7][0], + ue->measurements.subband_pmi_im[eNB][7][0], + ue->measurements.subband_pmi_re[eNB][8][0], + ue->measurements.subband_pmi_im[eNB][8][0], + ue->measurements.subband_pmi_re[eNB][9][0], + ue->measurements.subband_pmi_im[eNB][9][0], + ue->measurements.subband_pmi_re[eNB][10][0], + ue->measurements.subband_pmi_im[eNB][10][0], + ue->measurements.subband_pmi_re[eNB][11][0], + ue->measurements.subband_pmi_im[eNB][11][0], + ue->measurements.subband_pmi_re[eNB][12][0], + ue->measurements.subband_pmi_im[eNB][12][0]); + len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%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", + eNB, + ue->measurements.subband_pmi_re[eNB][0][1], + ue->measurements.subband_pmi_im[eNB][0][1], + ue->measurements.subband_pmi_re[eNB][1][1], + ue->measurements.subband_pmi_im[eNB][1][1], + ue->measurements.subband_pmi_re[eNB][2][1], + ue->measurements.subband_pmi_im[eNB][2][1], + ue->measurements.subband_pmi_re[eNB][3][1], + ue->measurements.subband_pmi_im[eNB][3][1], + ue->measurements.subband_pmi_re[eNB][4][1], + ue->measurements.subband_pmi_im[eNB][4][1], + ue->measurements.subband_pmi_re[eNB][5][1], + ue->measurements.subband_pmi_im[eNB][5][1], + ue->measurements.subband_pmi_re[eNB][6][1], + ue->measurements.subband_pmi_im[eNB][6][1], + ue->measurements.subband_pmi_re[eNB][7][1], + ue->measurements.subband_pmi_im[eNB][7][1], + ue->measurements.subband_pmi_re[eNB][8][1], + ue->measurements.subband_pmi_im[eNB][8][1], + ue->measurements.subband_pmi_re[eNB][9][1], + ue->measurements.subband_pmi_im[eNB][9][1], + ue->measurements.subband_pmi_re[eNB][10][1], + ue->measurements.subband_pmi_im[eNB][10][1], + ue->measurements.subband_pmi_re[eNB][11][1], + ue->measurements.subband_pmi_im[eNB][11][1], + ue->measurements.subband_pmi_re[eNB][12][1], + ue->measurements.subband_pmi_im[eNB][12][1]); + len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d %d %d %d %d]\n", + eNB, + ue->measurements.selected_rx_antennas[eNB][0], + ue->measurements.selected_rx_antennas[eNB][1], + ue->measurements.selected_rx_antennas[eNB][2], + ue->measurements.selected_rx_antennas[eNB][3], + ue->measurements.selected_rx_antennas[eNB][4], + ue->measurements.selected_rx_antennas[eNB][5], + ue->measurements.selected_rx_antennas[eNB][6], + ue->measurements.selected_rx_antennas[eNB][7], + ue->measurements.selected_rx_antennas[eNB][8], + ue->measurements.selected_rx_antennas[eNB][9], + ue->measurements.selected_rx_antennas[eNB][10], + ue->measurements.selected_rx_antennas[eNB][11], + ue->measurements.selected_rx_antennas[eNB][12]); + len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,13))); + len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, + pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,13)), + pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,13))); + break; } #ifdef OPENAIR2 RRC_status = mac_UE_get_rrc_status(ue->Mod_id, 0); len += sprintf(&buffer[len],"[UE PROC] RRC status = %d\n",RRC_status); #endif - - len += sprintf(&buffer[len], "[UE PROC] Transmission Mode %d \n",ue->transmission_mode[eNB]); len += sprintf(&buffer[len], "[UE PROC] PBCH err conseq %d, PBCH error total %d, PBCH FER %d\n", ue->pbch_vars[eNB]->pdu_errors_conseq, @@ -481,27 +447,31 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length if (ue->transmission_mode[eNB] == 6) len += sprintf(&buffer[len], "[UE PROC] Mode 6 Wideband CQI eNB %d : %d dB\n",eNB,ue->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,ue->dlsch[0][0][0]->harq_processes[harq_pid]->mcs); - for (round=0;round<8;round++) - len+=sprintf(&buffer[len],"%d/%d ", - ue->dlsch[0][0][0]->harq_processes[harq_pid]->errors[round], - ue->dlsch[0][0][0]->harq_processes[harq_pid]->trials[round]); - len+=sprintf(&buffer[len],"\n"); + 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,ue->dlsch[0][0][0]->harq_processes[harq_pid]->mcs); + + for (round=0; round<8; round++) + len+=sprintf(&buffer[len],"%d/%d ", + ue->dlsch[0][0][0]->harq_processes[harq_pid]->errors[round], + ue->dlsch[0][0][0]->harq_processes[harq_pid]->trials[round]); + + len+=sprintf(&buffer[len],"\n"); } + if (ue->dlsch[0][0] && ue->dlsch[0][0][0] && ue->dlsch[0][0][1]) { len += sprintf(&buffer[len], "[UE PROC] Saved PMI for DLSCH eNB %d : %jx (%p)\n",eNB,pmi2hex_2Ar1(ue->dlsch[0][0][0]->pmi_alloc),ue->dlsch[0][0][0]); - len += sprintf(&buffer[len], "[UE PROC] eNB %d: dl_power_off = %d\n",eNB,ue->dlsch[0][0][0]->harq_processes[0]->dl_power_off); - 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,ue->dlsch[0][0][1]->harq_processes[0]->mcs); - for (round=0;round<8;round++) - len+=sprintf(&buffer[len],"%d/%d ", - ue->dlsch[0][0][1]->harq_processes[harq_pid]->errors[round], - ue->dlsch[0][0][1]->harq_processes[harq_pid]->trials[round]); - len+=sprintf(&buffer[len],"\n"); - } + 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,ue->dlsch[0][0][1]->harq_processes[0]->mcs); + + for (round=0; round<8; round++) + len+=sprintf(&buffer[len],"%d/%d ", + ue->dlsch[0][0][1]->harq_processes[harq_pid]->errors[round], + ue->dlsch[0][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",ue->dlsch_received[0],ue->dlsch_errors[0],ue->dlsch_fer[0]); @@ -522,9 +492,7 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length len += sprintf(&buffer[len], "[UE PROC] DLSCH Bitrate %dkbps\n",(ue->bitrate[0]/1000)); len += sprintf(&buffer[len], "[UE PROC] Total Received Bits %dkbits\n",(ue->total_received_bits[0]/1000)); len += sprintf(&buffer[len], "[UE PROC] IA receiver %d\n",ue->use_ia_receiver); - } - } else { len += sprintf(&buffer[len], "[UE PROC] Frame count: %d, RSSI %3.2f dB (%d dB, %d dB), N0 %3.2f dB (%d dB, %d dB)\n", proc->frame_rx, @@ -546,7 +514,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length } len += sprintf(&buffer[len],"EOF\n"); - return len; } // is_clusterhead @@ -582,121 +549,121 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length) eNB->measurements.n0_power_dB[1]); len += sprintf(&buffer[len],"PRB I0 (%X.%X.%X.%X): ", - eNB->rb_mask_ul[0], - eNB->rb_mask_ul[1],eNB->rb_mask_ul[2],eNB->rb_mask_ul[3]); + eNB->rb_mask_ul[0], + eNB->rb_mask_ul[1],eNB->rb_mask_ul[2],eNB->rb_mask_ul[3]); for (i=0; iframe_parms.N_RB_UL; i++) { len += sprintf(&buffer[len],"%4d ", eNB->measurements.n0_subband_power_tot_dBm[i]); - if ((i>0) && ((i%25) == 0)) - len += sprintf(&buffer[len],"\n"); + if ((i>0) && ((i%25) == 0)) + len += sprintf(&buffer[len],"\n"); } len += sprintf(&buffer[len],"\n"); len += sprintf(&buffer[len],"\nPERFORMANCE PARAMETERS\n"); for (UE_id=0; UE_iddlsch!=NULL) && - (eNB->dlsch[(uint8_t)UE_id]!=NULL) && - (eNB->dlsch[(uint8_t)UE_id][0]->rnti>0)&& - (eNB->UE_stats[UE_id].mode == PUSCH)) { + (eNB->dlsch!=NULL) && + (eNB->dlsch[(uint8_t)UE_id]!=NULL) && + (eNB->dlsch[(uint8_t)UE_id][0]->rnti>0)&& + (eNB->UE_stats[UE_id].mode == PUSCH)) { eNB->total_dlsch_bitrate = eNB->UE_stats[UE_id].dlsch_bitrate + eNB->total_dlsch_bitrate; eNB->total_transmitted_bits = eNB->UE_stats[UE_id].total_TBS + eNB->total_transmitted_bits; //eNB->total_system_throughput = eNB->UE_stats[UE_id].total_transmitted_bits + eNB->total_system_throughput; - - for (i=0; i<8; i++) - success = success + (eNB->UE_stats[UE_id].dlsch_trials[i][0] - eNB->UE_stats[UE_id].dlsch_l2_errors[i]); - - - len += sprintf(&buffer[len],"Total DLSCH %d kbits / %d frames ",(eNB->total_transmitted_bits/1000),proc->frame_tx+1); - len += sprintf(&buffer[len],"Total DLSCH throughput %d kbps ",(eNB->total_dlsch_bitrate/1000)); - len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,proc->frame_tx+1); - //len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->FULL_MUMIMO_transmissions,eNB->check_for_total_transmissions); - //len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_MUMIMO_transmissions,eNB->check_for_total_transmissions); - //len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_SUMIMO_transmissions,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, - eNB->UE_stats[UE_id].crnti, - dB_fixed(eNB->pusch_vars[UE_id]->ulsch_power[0]), - dB_fixed(eNB->pusch_vars[UE_id]->ulsch_power[1]), - eNB->UE_stats[UE_id].UL_rssi[0], - eNB->UE_stats[UE_id].UL_rssi[1], - dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB, - eNB->frame_parms.ul_power_control_config_common.p0_NominalPUCCH, - dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH1_below/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB, - dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH1_above/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB, - PUCCH1_THRES+eNB->measurements.n0_power_tot_dBm-dB_fixed(eNB->frame_parms.N_RB_UL)); - - len+= sprintf(&buffer[len],"DL mcs %d, UL mcs %d, UL rb %d, delta_TF %d, ", - eNB->dlsch[(uint8_t)UE_id][0]->harq_processes[0]->mcs, - eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->mcs, - eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->nb_rb, - eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->delta_TF); - - len += sprintf(&buffer[len],"Wideband CQI: (%d,%d) dB\n", - eNB->measurements.wideband_cqi_dB[UE_id][0], - eNB->measurements.wideband_cqi_dB[UE_id][1]); - - len += sprintf(&buffer[len],"DL TM %d, DL_cqi %d, DL_pmi_single %jx ", - eNB->transmission_mode[UE_id], - eNB->UE_stats[UE_id].DL_cqi[0], - pmi2hex_2Ar1(eNB->UE_stats[UE_id].DL_pmi_single)); + for (i=0; i<8; i++) + success = success + (eNB->UE_stats[UE_id].dlsch_trials[i][0] - eNB->UE_stats[UE_id].dlsch_l2_errors[i]); + + + + len += sprintf(&buffer[len],"Total DLSCH %d kbits / %d frames ",(eNB->total_transmitted_bits/1000),proc->frame_tx+1); + len += sprintf(&buffer[len],"Total DLSCH throughput %d kbps ",(eNB->total_dlsch_bitrate/1000)); + len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,proc->frame_tx+1); + //len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->FULL_MUMIMO_transmissions,eNB->check_for_total_transmissions); + //len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_MUMIMO_transmissions,eNB->check_for_total_transmissions); + //len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_SUMIMO_transmissions,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, + eNB->UE_stats[UE_id].crnti, + dB_fixed(eNB->pusch_vars[UE_id]->ulsch_power[0]), + dB_fixed(eNB->pusch_vars[UE_id]->ulsch_power[1]), + eNB->UE_stats[UE_id].UL_rssi[0], + eNB->UE_stats[UE_id].UL_rssi[1], + dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB, + eNB->frame_parms.ul_power_control_config_common.p0_NominalPUCCH, + dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH1_below/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB, + dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH1_above/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB, + PUCCH1_THRES+eNB->measurements.n0_power_tot_dBm-dB_fixed(eNB->frame_parms.N_RB_UL)); + + len+= sprintf(&buffer[len],"DL mcs %d, UL mcs %d, UL rb %d, delta_TF %d, ", + eNB->dlsch[(uint8_t)UE_id][0]->harq_processes[0]->mcs, + eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->mcs, + eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->nb_rb, + eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->delta_TF); + + len += sprintf(&buffer[len],"Wideband CQI: (%d,%d) dB\n", + eNB->measurements.wideband_cqi_dB[UE_id][0], + eNB->measurements.wideband_cqi_dB[UE_id][1]); + + len += sprintf(&buffer[len],"DL TM %d, DL_cqi %d, DL_pmi_single %jx ", + eNB->transmission_mode[UE_id], + eNB->UE_stats[UE_id].DL_cqi[0], + pmi2hex_2Ar1(eNB->UE_stats[UE_id].DL_pmi_single)); + + len += sprintf(&buffer[len],"Timing advance %d samples (%d 16Ts), update %d ", + eNB->UE_stats[UE_id].UE_timing_offset, + eNB->UE_stats[UE_id].UE_timing_offset>>2, + eNB->UE_stats[UE_id].timing_advance_update); + + len += sprintf(&buffer[len],"Mode = %s(%d) ", + mode_string[eNB->UE_stats[UE_id].mode], + eNB->UE_stats[UE_id].mode); + UE_id_mac = find_UE_id(eNB->Mod_id,eNB->dlsch[(uint8_t)UE_id][0]->rnti); + + if (UE_id_mac != -1) { + RRC_status = mac_eNB_get_rrc_status(eNB->Mod_id,eNB->dlsch[(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],"Timing advance %d samples (%d 16Ts), update %d ", - eNB->UE_stats[UE_id].UE_timing_offset, - eNB->UE_stats[UE_id].UE_timing_offset>>2, - eNB->UE_stats[UE_id].timing_advance_update); - - len += sprintf(&buffer[len],"Mode = %s(%d) ", - mode_string[eNB->UE_stats[UE_id].mode], - eNB->UE_stats[UE_id].mode); - UE_id_mac = find_UE_id(eNB->Mod_id,eNB->dlsch[(uint8_t)UE_id][0]->rnti); - - if (UE_id_mac != -1) { - RRC_status = mac_eNB_get_rrc_status(eNB->Mod_id,eNB->dlsch[(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", eNB->UE_stats[UE_id].sr_received, eNB->UE_stats[UE_id].sr_total, eNB->UE_stats[UE_id].sr_total-eNB->UE_stats[UE_id].sr_received); - - len += sprintf(&buffer[len],"DL Subband CQI: "); - int nb_sb; - switch (eNB->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; iUE_stats[UE_id].DL_subband_cqi[0][i]); - len += sprintf(&buffer[len],"\n"); - + len += sprintf(&buffer[len],"DL Subband CQI: "); + + int nb_sb; + switch (eNB->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; iUE_stats[UE_id].DL_subband_cqi[0][i]); + len += sprintf(&buffer[len],"\n"); + ulsch_errors = 0; @@ -722,9 +689,9 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length) eNB->UE_stats[UE_id].ulsch_decoding_attempts[i][2], eNB->UE_stats[UE_id].ulsch_round_errors[i][3], eNB->UE_stats[UE_id].ulsch_decoding_attempts[i][3]); - if ((i&1) == 1) - len += sprintf(&buffer[len],"\n"); - + if ((i&1) == 1) + len += sprintf(&buffer[len],"\n"); + ulsch_errors+=eNB->UE_stats[UE_id].ulsch_errors[i]; for (j=0; j<4; j++) { @@ -767,8 +734,8 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length) eNB->UE_stats[UE_id].dlsch_ACK[i][3], eNB->UE_stats[UE_id].dlsch_NAK[i][3], eNB->UE_stats[UE_id].dlsch_trials[i][3]); - if ((i&1) == 1) - len += sprintf(&buffer[len],"\n"); + if ((i&1) == 1) + len += sprintf(&buffer[len],"\n"); dlsch_errors+=eNB->UE_stats[UE_id].dlsch_l2_errors[i]; @@ -790,15 +757,15 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length) len += sprintf(&buffer[len],"DLSCH total bits from MAC: %dkbit ",(eNB->UE_stats[UE_id].total_TBS_MAC)/1000); len += sprintf(&buffer[len],"DLSCH total bits ack'ed: %dkbit ",(eNB->UE_stats[UE_id].total_TBS)/1000); len += sprintf(&buffer[len],"DLSCH Average throughput (100 frames): %dkbps\n",(eNB->UE_stats[UE_id].dlsch_bitrate/1000)); - // len += sprintf(&buffer[len],"[eNB PROC] Transmission Mode %d\n",eNB->transmission_mode[UE_id]); + // len += sprintf(&buffer[len],"[eNB PROC] Transmission Mode %d\n",eNB->transmission_mode[UE_id]); } } len += sprintf(&buffer[len],"\n"); } - + len += sprintf(&buffer[len],"EOF\n"); - + return len; } */ diff --git a/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c b/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c index 26ad1d24ef..a3d63ea09b 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c @@ -31,6 +31,7 @@ */ #include "PHY/types.h" #include "PHY/defs_UE.h" +#include "targets/RT/USER/lte-softmodem.h" #include "PHY/phy_extern_ue.h" #include "SCHED_UE/sched_UE.h" #include "transport_proto_ue.h" @@ -49,10 +50,8 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { uint8_t l,pbch_decoded,frame_mod4,pbch_tx_ant,dummy; LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; char phich_resource[6]; -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"[UE%d] Initial sync: starting PBCH detection (rx_offset %d)\n",ue->Mod_id, + LOG_D(PHY,"[UE%d] Initial sync: starting PBCH detection (rx_offset %d)\n",ue->Mod_id, ue->rx_offset); -#endif for (l=0; lsymbols_per_tti/2; l++) { slot_fep(ue, @@ -95,8 +94,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { 0); } -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"[UE %d] RX RSSI %d dBm, digital (%d, %d) dB, linear (%d, %d), avg rx power %d dB (%d lin), RX gain %d dB\n", + LOG_D(PHY,"[UE %d] RX RSSI %d dBm, digital (%d, %d) dB, linear (%d, %d), avg rx power %d dB (%d lin), RX gain %d dB\n", ue->Mod_id, ue->measurements.rx_rssi_dBm[0] - ((ue->frame_parms.nb_antennas_rx==2) ? 3 : 0), ue->measurements.rx_power_dB[0][0], @@ -106,7 +104,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ue->measurements.rx_power_avg_dB[0], ue->measurements.rx_power_avg[0], ue->rx_total_gain_dB); - LOG_I(PHY,"[UE %d] N0 %d dBm digital (%d, %d) dB, linear (%d, %d), avg noise power %d dB (%d lin)\n", + LOG_D(PHY,"[UE %d] N0 %d dBm digital (%d, %d) dB, linear (%d, %d), avg noise power %d dB (%d lin)\n", ue->Mod_id, ue->measurements.n0_power_tot_dBm, ue->measurements.n0_power_dB[0], @@ -115,7 +113,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ue->measurements.n0_power[1], ue->measurements.n0_power_avg_dB, ue->measurements.n0_power_avg); -#endif pbch_decoded = 0; for (frame_mod4=0; frame_mod4<4; frame_mod4++) { @@ -225,8 +222,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ue->proc.proc_rxtx[i].frame_tx = ue->proc.proc_rxtx[0].frame_rx; } -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"[UE%d] Initial sync: pbch decoded sucessfully p %d, tx_ant %d, frame %d, N_RB_DL %d, phich_duration %d, phich_resource %s!\n", + LOG_D(PHY,"[UE%d] Initial sync: pbch decoded sucessfully p %d, tx_ant %d, frame %d, N_RB_DL %d, phich_duration %d, phich_resource %s!\n", ue->Mod_id, frame_parms->nb_antenna_ports_eNB, pbch_tx_ant, @@ -234,7 +230,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { frame_parms->N_RB_DL, frame_parms->phich_config_common.phich_duration, phich_resource); //frame_parms->phich_config_common.phich_resource); -#endif return(0); } else { return(-1); @@ -254,10 +249,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; int ret=-1; int aarx,rx_power=0; - /*#ifdef OAI_USRP - __m128i *rxdata128; - #endif*/ - // LOG_I(PHY,"**************************************************************\n"); // First try FDD normal prefix frame_parms->Ncp=NORMAL; frame_parms->frame_type=FDD; @@ -277,9 +268,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { else sync_pos2 = sync_pos + FRAME_LENGTH_COMPLEX_SAMPLES - frame_parms->nb_prefix_samples; -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id); -#endif + LOG_D(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id); // SSS detection // PSS is hypothesized in last symbol of first slot in Frame sync_pos_slot = (frame_parms->samples_per_tti>>1) - frame_parms->ofdm_symbol_size - frame_parms->nb_prefix_samples; @@ -291,9 +280,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { if (((sync_pos2 - sync_pos_slot) >=0 ) && ((sync_pos2 - sync_pos_slot) < ((FRAME_LENGTH_COMPLEX_SAMPLES-frame_parms->samples_per_tti/2)))) { -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"Calling sss detection (FDD normal CP)\n"); -#endif + LOG_D(PHY,"Calling sss detection (FDD normal CP)\n"); rx_sss(ue,&metric_fdd_ncp,&flip_fdd_ncp,&phase_fdd_ncp); frame_parms->nushift = frame_parms->Nid_cell%6; @@ -304,14 +291,10 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); ret = pbch_detection(ue,mode); // LOG_M("rxdata2.m","rxd2",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"FDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", + LOG_D(PHY,"FDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", frame_parms->Nid_cell,metric_fdd_ncp,phase_fdd_ncp,flip_fdd_ncp,ret); -#endif } else { -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"FDD Normal prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot); -#endif + LOG_D(PHY,"FDD Normal prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot); } if (ret==-1) { @@ -347,14 +330,10 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); ret = pbch_detection(ue,mode); // LOG_M("rxdata3.m","rxd3",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"FDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", + LOG_D(PHY,"FDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", frame_parms->Nid_cell,metric_fdd_ecp,phase_fdd_ecp,flip_fdd_ecp,ret); -#endif } else { -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"FDD Extended prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot); -#endif + LOG_D(PHY,"FDD Extended prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot); } if (ret==-1) { @@ -390,10 +369,8 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); ret = pbch_detection(ue,mode); // LOG_M("rxdata4.m","rxd4",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"TDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", + LOG_D(PHY,"TDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", frame_parms->Nid_cell,metric_tdd_ncp,phase_tdd_ncp,flip_tdd_ncp,ret); -#endif if (ret==-1) { // Now TDD extended prefix @@ -426,10 +403,8 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); ret = pbch_detection(ue,mode); // LOG_M("rxdata5.m","rxd5",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"TDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", + LOG_D(PHY,"TDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", frame_parms->Nid_cell,metric_tdd_ecp,phase_tdd_ecp,flip_tdd_ecp,ret); -#endif } } } @@ -481,18 +456,16 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset, ue->common_vars.freq_offset); } else { -#ifdef DEBUG_INITIAL_SYNC - LOG_I(PHY,"[UE%d] Initial sync : PBCH not ok\n",ue->Mod_id); - LOG_I(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id); + LOG_D(PHY,"[UE%d] Initial sync : PBCH not ok\n",ue->Mod_id); + LOG_D(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id); /* LOG_I(PHY,"[UE%d] Initial sync: (metric fdd_ncp %d (%d), metric fdd_ecp %d (%d), metric_tdd_ncp %d (%d), metric_tdd_ecp %d (%d))\n", ue->Mod_id, metric_fdd_ncp,Nid_cell_fdd_ncp, metric_fdd_ecp,Nid_cell_fdd_ecp, metric_tdd_ncp,Nid_cell_tdd_ncp, metric_tdd_ecp,Nid_cell_tdd_ecp);*/ - LOG_I(PHY,"[UE%d] Initial sync : Estimated Nid_cell %d, Frame_type %d\n",ue->Mod_id, + LOG_D(PHY,"[UE%d] Initial sync : Estimated Nid_cell %d, Frame_type %d\n",ue->Mod_id, frame_parms->Nid_cell,frame_parms->frame_type); -#endif ue->UE_mode[0] = NOT_SYNCHED; ue->pbch_vars[0]->pdu_errors_last=ue->pbch_vars[0]->pdu_errors; ue->pbch_vars[0]->pdu_errors++; @@ -517,27 +490,15 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { // we might add a low-pass filter here later ue->measurements.rx_power_avg[0] = rx_power/frame_parms->nb_antennas_rx; ue->measurements.rx_power_avg_dB[0] = dB_fixed(ue->measurements.rx_power_avg[0]); -#ifdef DEBUG_INITIAL_SYNCH LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",ue->Mod_id,ue->measurements.rx_power_avg_dB[0] ); -#endif -#ifndef OAI_USRP -#ifndef OAI_BLADERF -#ifndef OAI_LMSSDR - phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0); -#endif -#endif -#endif + + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) + phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0); } else { -#ifndef OAI_USRP -#ifndef OAI_BLADERF -#ifndef OAI_LMSSDR - phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0); -#endif -#endif -#endif + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) + phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0); } - // exit_fun("debug exit"); return ret; } diff --git a/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c index 481d0bcaf8..8139c496ae 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c @@ -31,6 +31,7 @@ */ #include "PHY/sse_intrin.h" #include "PHY/defs_UE.h" +#include "targets/RT/USER/lte-softmodem.h" #include "PHY/phy_extern_ue.h" //#include "prach.h" #include "PHY/LTE_TRANSPORT/if4_tools.h" @@ -43,9 +44,7 @@ //#define PRACH_DEBUG 1 -int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint16_t Nf ) -{ - +int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint16_t Nf ) { lte_frame_type_t frame_type = ue->frame_parms.frame_type; //uint8_t tdd_config = ue->frame_parms.tdd_config; uint16_t rootSequenceIndex = ue->frame_parms.prach_config_common.rootSequenceIndex; @@ -67,7 +66,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 uint16_t preamble_offset,preamble_shift; uint16_t preamble_index0,n_shift_ra,n_shift_ra_bar; uint16_t d_start,numshift; - uint8_t prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type); //uint8_t Nsp=2; //uint8_t f_ra,t1_ra; @@ -82,50 +80,46 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 int i, prach_len; uint16_t first_nonzero_root_idx=0; -#if defined(EXMIMO) || defined(OAI_USRP) - prach_start = (ue->rx_offset+subframe*ue->frame_parms.samples_per_tti-ue->hw_timing_advance-ue->N_TA_offset); + if ( !(IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ) { + prach_start = (ue->rx_offset+subframe*ue->frame_parms.samples_per_tti-ue->hw_timing_advance-ue->N_TA_offset); #ifdef PRACH_DEBUG LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id, - prach_start, - ue->rx_offset, - ue->hw_timing_advance, - ue->N_TA_offset); + prach_start, + ue->rx_offset, + ue->hw_timing_advance, + ue->N_TA_offset); #endif - if (prach_start<0) - prach_start+=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); - - if (prach_start>=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) - prach_start-=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); - -#else //normal case (simulation) - prach_start = subframe*ue->frame_parms.samples_per_tti-ue->N_TA_offset; - LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id, - prach_start, - ue->rx_offset, - ue->hw_timing_advance, - ue->N_TA_offset); - -#endif + if (prach_start<0) + prach_start+=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); + if (prach_start>=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) + prach_start-=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); + } else { //normal case (simulation) + prach_start = subframe*ue->frame_parms.samples_per_tti-ue->N_TA_offset; + LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id, + prach_start, + ue->rx_offset, + ue->hw_timing_advance, + ue->N_TA_offset); + } // First compute physical root sequence if (restricted_set == 0) { AssertFatal(Ncs_config <= 15, - "[PHY] FATAL, Illegal Ncs_config for unrestricted format %"PRIu8"\n", Ncs_config ); + "[PHY] FATAL, Illegal Ncs_config for unrestricted format %"PRIu8"\n", Ncs_config ); NCS = NCS_unrestricted[Ncs_config]; } else { AssertFatal(Ncs_config <= 14, - "[PHY] FATAL, Illegal Ncs_config for restricted format %"PRIu8"\n", Ncs_config ); + "[PHY] FATAL, Illegal Ncs_config for restricted format %"PRIu8"\n", Ncs_config ); NCS = NCS_restricted[Ncs_config]; } n_ra_prb = get_prach_prb_offset(&(ue->frame_parms), - ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex, - ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset, - tdd_mapindex, Nf); + ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex, + ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset, + tdd_mapindex, Nf); prach_root_sequence_map = (prach_fmt<4) ? prach_root_sequence_map0_3 : prach_root_sequence_map4; - /* // this code is not part of get_prach_prb_offset if (frame_type == TDD) { // TDD @@ -157,7 +151,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 } } */ - // This is the relative offset (for unrestricted case) in the root sequence table (5.7.2-4 from 36.211) for the given preamble index preamble_offset = ((NCS==0)? preamble_index : (preamble_index/(N_ZC/NCS))); @@ -166,11 +159,9 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 preamble_shift = (NCS==0)? 0 : (preamble_index % (N_ZC/NCS)); preamble_shift *= NCS; } else { // This is the high-speed case - #ifdef PRACH_DEBUG LOG_I(PHY,"[UE %d] High-speed mode, NCS_config %d\n",ue->Mod_id,Ncs_config); #endif - not_found = 1; preamble_index0 = preamble_index; // set preamble_offset to initial rootSequenceIndex and look if we need more root sequences for this @@ -190,7 +181,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 } u = prach_root_sequence_map[index]; - uint16_t n_group_ra = 0; if ( (du[u]<(N_ZC/3)) && (du[u]>=NCS) ) { @@ -217,7 +207,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 if (preamble_index0 < numshift) { not_found = 0; preamble_shift = (d_start * (preamble_index0/n_shift_ra)) + ((preamble_index0%n_shift_ra)*NCS); - } else { // skip to next rootSequenceIndex and recompute parameters preamble_offset++; preamble_index0 -= numshift; @@ -234,10 +223,8 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 preamble_offset,preamble_shift); #endif - // nsymb = (frame_parms->Ncp==0) ? 14:12; // subframe_offset = (unsigned int)frame_parms->ofdm_symbol_size*subframe*nsymb; - k = (12*n_ra_prb) - 6*ue->frame_parms.N_RB_UL; if (k<0) @@ -245,9 +232,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 k*=12; k+=13; - - Xu = (int16_t*)ue->X_u[preamble_offset-first_nonzero_root_idx]; - + Xu = (int16_t *)ue->X_u[preamble_offset-first_nonzero_root_idx]; /* k+=(12*ue->frame_parms.first_carrier_offset); if (k>(12*ue->frame_parms.ofdm_symbol_size)) @@ -256,36 +241,36 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 k*=2; switch (ue->frame_parms.N_RB_UL) { - case 6: - memset((void*)prachF,0,4*1536); - break; + case 6: + memset((void *)prachF,0,4*1536); + break; - case 15: - memset((void*)prachF,0,4*3072); - break; + case 15: + memset((void *)prachF,0,4*3072); + break; - case 25: - memset((void*)prachF,0,4*6144); - break; + case 25: + memset((void *)prachF,0,4*6144); + break; - case 50: - memset((void*)prachF,0,4*12288); - break; + case 50: + memset((void *)prachF,0,4*12288); + break; - case 75: - memset((void*)prachF,0,4*18432); - break; + case 75: + memset((void *)prachF,0,4*18432); + break; - case 100: - if (ue->frame_parms.threequarter_fs == 0) - memset((void*)prachF,0,4*24576); - else - memset((void*)prachF,0,4*18432); - break; + case 100: + if (ue->frame_parms.threequarter_fs == 0) + memset((void *)prachF,0,4*24576); + else + memset((void *)prachF,0,4*18432); + + break; } for (offset=0,offset2=0; offset= N_ZC) offset2 -= N_ZC; @@ -299,49 +284,49 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 } switch (prach_fmt) { - case 0: - Ncp = 3168; - break; + case 0: + Ncp = 3168; + break; - case 1: - case 3: - Ncp = 21024; - break; + case 1: + case 3: + Ncp = 21024; + break; - case 2: - Ncp = 6240; - break; + case 2: + Ncp = 6240; + break; - case 4: - Ncp = 448; - break; + case 4: + Ncp = 448; + break; - default: - Ncp = 3168; - break; + default: + Ncp = 3168; + break; } switch (ue->frame_parms.N_RB_UL) { - case 6: - Ncp>>=4; - prach+=4; // makes prach2 aligned to 128-bit - break; + case 6: + Ncp>>=4; + prach+=4; // makes prach2 aligned to 128-bit + break; - case 15: - Ncp>>=3; - break; + case 15: + Ncp>>=3; + break; - case 25: - Ncp>>=2; - break; + case 25: + Ncp>>=2; + break; - case 50: - Ncp>>=1; - break; + case 50: + Ncp>>=1; + break; - case 75: - Ncp=(Ncp*3)>>2; - break; + case 75: + Ncp=(Ncp*3)>>2; + break; } if (ue->frame_parms.threequarter_fs == 1) @@ -351,186 +336,184 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 // do IDFT switch (ue->frame_parms.N_RB_UL) { - case 6: - if (prach_fmt == 4) { - idft256(prachF,prach2,1); - memmove( prach, prach+512, Ncp<<2 ); - prach_len = 256+Ncp; - } else { - idft1536(prachF,prach2,1); - memmove( prach, prach+3072, Ncp<<2 ); - prach_len = 1536+Ncp; - - if (prach_fmt>1) { - memmove( prach2+3072, prach2, 6144 ); - prach_len = 2*1536+Ncp; - } - } - - break; - - case 15: - if (prach_fmt == 4) { - idft512(prachF,prach2,1); - //TODO: account for repeated format in dft output - memmove( prach, prach+1024, Ncp<<2 ); - prach_len = 512+Ncp; - } else { - idft3072(prachF,prach2,1); - memmove( prach, prach+6144, Ncp<<2 ); - prach_len = 3072+Ncp; - - if (prach_fmt>1) { - memmove( prach2+6144, prach2, 12288 ); - prach_len = 2*3072+Ncp; - } - } - - break; - - case 25: - default: - if (prach_fmt == 4) { - idft1024(prachF,prach2,1); - memmove( prach, prach+2048, Ncp<<2 ); - prach_len = 1024+Ncp; - } else { - idft6144(prachF,prach2,1); - /*for (i=0;i<6144*2;i++) - prach2[i]<<=1;*/ - memmove( prach, prach+12288, Ncp<<2 ); - prach_len = 6144+Ncp; - - if (prach_fmt>1) { - memmove( prach2+12288, prach2, 24576 ); - prach_len = 2*6144+Ncp; - } - } - - break; - - case 50: - if (prach_fmt == 4) { - idft2048(prachF,prach2,1); - memmove( prach, prach+4096, Ncp<<2 ); - prach_len = 2048+Ncp; - } else { - idft12288(prachF,prach2,1); - memmove( prach, prach+24576, Ncp<<2 ); - prach_len = 12288+Ncp; - - if (prach_fmt>1) { - memmove( prach2+24576, prach2, 49152 ); - prach_len = 2*12288+Ncp; - } - } - - break; - - case 75: - if (prach_fmt == 4) { - idft3072(prachF,prach2,1); - //TODO: account for repeated format in dft output - memmove( prach, prach+6144, Ncp<<2 ); - prach_len = 3072+Ncp; - } else { - idft18432(prachF,prach2,1); - memmove( prach, prach+36864, Ncp<<2 ); - prach_len = 18432+Ncp; - - if (prach_fmt>1) { - memmove( prach2+36834, prach2, 73728 ); - prach_len = 2*18432+Ncp; - } - } - - break; - - case 100: - if (ue->frame_parms.threequarter_fs == 0) { + case 6: if (prach_fmt == 4) { - idft4096(prachF,prach2,1); - memmove( prach, prach+8192, Ncp<<2 ); - prach_len = 4096+Ncp; + idft256(prachF,prach2,1); + memmove( prach, prach+512, Ncp<<2 ); + prach_len = 256+Ncp; } else { - idft24576(prachF,prach2,1); - memmove( prach, prach+49152, Ncp<<2 ); - prach_len = 24576+Ncp; - - if (prach_fmt>1) { - memmove( prach2+49152, prach2, 98304 ); - prach_len = 2* 24576+Ncp; - } - } - } - else { - if (prach_fmt == 4) { - idft3072(prachF,prach2,1); - //TODO: account for repeated format in dft output - memmove( prach, prach+6144, Ncp<<2 ); - prach_len = 3072+Ncp; - } else { - idft18432(prachF,prach2,1); - memmove( prach, prach+36864, Ncp<<2 ); - prach_len = 18432+Ncp; - printf("Generated prach for 100 PRB, 3/4 sampling\n"); - if (prach_fmt>1) { - memmove( prach2+36834, prach2, 73728 ); - prach_len = 2*18432+Ncp; - } - } - } + idft1536(prachF,prach2,1); + memmove( prach, prach+3072, Ncp<<2 ); + prach_len = 1536+Ncp; - break; + if (prach_fmt>1) { + memmove( prach2+3072, prach2, 6144 ); + prach_len = 2*1536+Ncp; + } + } + + break; + + case 15: + if (prach_fmt == 4) { + idft512(prachF,prach2,1); + //TODO: account for repeated format in dft output + memmove( prach, prach+1024, Ncp<<2 ); + prach_len = 512+Ncp; + } else { + idft3072(prachF,prach2,1); + memmove( prach, prach+6144, Ncp<<2 ); + prach_len = 3072+Ncp; + + if (prach_fmt>1) { + memmove( prach2+6144, prach2, 12288 ); + prach_len = 2*3072+Ncp; + } + } + + break; + + case 25: + default: + if (prach_fmt == 4) { + idft1024(prachF,prach2,1); + memmove( prach, prach+2048, Ncp<<2 ); + prach_len = 1024+Ncp; + } else { + idft6144(prachF,prach2,1); + /*for (i=0;i<6144*2;i++) + prach2[i]<<=1;*/ + memmove( prach, prach+12288, Ncp<<2 ); + prach_len = 6144+Ncp; + + if (prach_fmt>1) { + memmove( prach2+12288, prach2, 24576 ); + prach_len = 2*6144+Ncp; + } + } + + break; + + case 50: + if (prach_fmt == 4) { + idft2048(prachF,prach2,1); + memmove( prach, prach+4096, Ncp<<2 ); + prach_len = 2048+Ncp; + } else { + idft12288(prachF,prach2,1); + memmove( prach, prach+24576, Ncp<<2 ); + prach_len = 12288+Ncp; + + if (prach_fmt>1) { + memmove( prach2+24576, prach2, 49152 ); + prach_len = 2*12288+Ncp; + } + } + + break; + + case 75: + if (prach_fmt == 4) { + idft3072(prachF,prach2,1); + //TODO: account for repeated format in dft output + memmove( prach, prach+6144, Ncp<<2 ); + prach_len = 3072+Ncp; + } else { + idft18432(prachF,prach2,1); + memmove( prach, prach+36864, Ncp<<2 ); + prach_len = 18432+Ncp; + + if (prach_fmt>1) { + memmove( prach2+36834, prach2, 73728 ); + prach_len = 2*18432+Ncp; + } + } + + break; + + case 100: + if (ue->frame_parms.threequarter_fs == 0) { + if (prach_fmt == 4) { + idft4096(prachF,prach2,1); + memmove( prach, prach+8192, Ncp<<2 ); + prach_len = 4096+Ncp; + } else { + idft24576(prachF,prach2,1); + memmove( prach, prach+49152, Ncp<<2 ); + prach_len = 24576+Ncp; + + if (prach_fmt>1) { + memmove( prach2+49152, prach2, 98304 ); + prach_len = 2* 24576+Ncp; + } + } + } else { + if (prach_fmt == 4) { + idft3072(prachF,prach2,1); + //TODO: account for repeated format in dft output + memmove( prach, prach+6144, Ncp<<2 ); + prach_len = 3072+Ncp; + } else { + idft18432(prachF,prach2,1); + memmove( prach, prach+36864, Ncp<<2 ); + prach_len = 18432+Ncp; + printf("Generated prach for 100 PRB, 3/4 sampling\n"); + + if (prach_fmt>1) { + memmove( prach2+36834, prach2, 73728 ); + prach_len = 2*18432+Ncp; + } + } + } + + break; } //LOG_I(PHY,"prach_len=%d\n",prach_len); - AssertFatal(prach_fmt<4, - "prach_fmt4 not fully implemented" ); -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) - int j; - int overflow = prach_start + prach_len - LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*ue->frame_parms.samples_per_tti; - LOG_I( PHY, "prach_start=%d, overflow=%d\n", prach_start, overflow ); - - for (i=prach_start,j=0; iframe_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,prach_start+prach_len); i++,j++) { - ((int16_t*)ue->common_vars.txdata[0])[2*i] = prach[2*j]; - ((int16_t*)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1]; - } - - for (i=0; icommon_vars.txdata[0])[2*i] = prach[2*j]; - ((int16_t*)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1]; - } + "prach_fmt4 not fully implemented" ); + + if (!(IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ) { + int j; + int overflow = prach_start + prach_len - LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*ue->frame_parms.samples_per_tti; + LOG_I( PHY, "prach_start=%d, overflow=%d\n", prach_start, overflow ); + + for (i=prach_start,j=0; iframe_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,prach_start+prach_len); i++,j++) { + ((int16_t *)ue->common_vars.txdata[0])[2*i] = prach[2*j]; + ((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1]; + } + + for (i=0; icommon_vars.txdata[0])[2*i] = prach[2*j]; + ((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1]; + } + #if defined(EXMIMO) - // handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on - for (k=prach_start - (ue->frame_parms.samples_per_tti>>1) ; kcommon_vars.txdata[0][k+ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; - else if (k>(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) - ue->common_vars.txdata[0][k-ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; - else - ue->common_vars.txdata[0][k] &= 0xFFFEFFFE; - } + + // handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on + for (k=prach_start - (ue->frame_parms.samples_per_tti>>1) ; kcommon_vars.txdata[0][k+ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; + else if (k>(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) + ue->common_vars.txdata[0][k-ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; + else + ue->common_vars.txdata[0][k] &= 0xFFFEFFFE; + } + #endif -#else - - for (i=0; icommon_vars.txdata[0][prach_start]))[2*i] = prach[2*i]; - ((int16_t*)(&ue->common_vars.txdata[0][prach_start]))[2*i+1] = prach[2*i+1]; + } else { // simulators + for (i=0; icommon_vars.txdata[0][prach_start]))[2*i] = prach[2*i]; + ((int16_t *)(&ue->common_vars.txdata[0][prach_start]))[2*i+1] = prach[2*i+1]; + } } - -#endif - - #if defined(PRACH_WRITE_OUTPUT_DEBUG) LOG_M("prach_txF0.m","prachtxF0",prachF,prach_len-Ncp,1,1); LOG_M("prach_tx0.m","prachtx0",prach+(Ncp<<1),prach_len-Ncp,1,1); - LOG_M("txsig.m","txs",(int16_t*)(&ue->common_vars.txdata[0][0]),2*ue->frame_parms.samples_per_tti,1,1); + LOG_M("txsig.m","txs",(int16_t *)(&ue->common_vars.txdata[0][0]),2*ue->frame_parms.samples_per_tti,1,1); exit(-1); #endif - - return signal_energy( (int*)prach, 256 ); + return signal_energy( (int *)prach, 256 ); } diff --git a/openair1/SCHED_UE/phy_procedures_lte_ue.c b/openair1/SCHED_UE/phy_procedures_lte_ue.c index b49ca1eda2..8f78a673e0 100644 --- a/openair1/SCHED_UE/phy_procedures_lte_ue.c +++ b/openair1/SCHED_UE/phy_procedures_lte_ue.c @@ -76,9 +76,8 @@ extern double cpuf; void Msg1_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id); void Msg3_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id); -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) - extern uint32_t downlink_frequency[MAX_NUM_CCs][4]; -#endif +extern uint32_t downlink_frequency[MAX_NUM_CCs][4]; + void get_dumpparam(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, uint8_t nb_rb, uint32_t *alloc_even, uint8_t subframe,uint32_t Qm, uint32_t Nl, uint32_t tm, @@ -160,47 +159,7 @@ void dump_dlsch_SI(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t s } } -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) -//unsigned int gain_table[31] = {100,112,126,141,158,178,200,224,251,282,316,359,398,447,501,562,631,708,794,891,1000,1122,1258,1412,1585,1778,1995,2239,2512,2818,3162}; -/* - unsigned int get_tx_amp_prach(int power_dBm, int power_max_dBm, int N_RB_UL) - { - int gain_dB = power_dBm - power_max_dBm; - int amp_x_100; - - switch (N_RB_UL) { - case 6: - amp_x_100 = AMP; // PRACH is 6 PRBS so no scale - break; - case 15: - amp_x_100 = 158*AMP; // 158 = 100*sqrt(15/6) - break; - case 25: - amp_x_100 = 204*AMP; // 204 = 100*sqrt(25/6) - break; - case 50: - amp_x_100 = 286*AMP; // 286 = 100*sqrt(50/6) - break; - case 75: - amp_x_100 = 354*AMP; // 354 = 100*sqrt(75/6) - break; - case 100: - amp_x_100 = 408*AMP; // 408 = 100*sqrt(100/6) - break; - default: - LOG_E(PHY,"Unknown PRB size %d\n",N_RB_UL); - mac_xface->macphy_exit(""); - break; - } - if (gain_dB < -30) { - return(amp_x_100/3162); - } else if (gain_dB>0) - return(amp_x_100); - else - return(amp_x_100/gain_table[-gain_dB]); // 245 corresponds to the factor sqrt(25/6) - } -*/ unsigned int get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb) { int gain_dB; @@ -216,7 +175,6 @@ unsigned int get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb return((int)(AMP*sqrt(gain_lin*N_RB_UL/(double)nb_rb))); } -#endif void dump_dlsch_ra(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe) { if (LOG_DUMPFLAG(DEBUG_UE_PHYPROC)) { @@ -1130,10 +1088,8 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt int subframe_tx = proc->subframe_tx; int ulsch_start; int overflow=0; -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) int k,l; int dummy_tx_buffer[frame_parms->samples_per_tti] __attribute__((aligned(16))); -#endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_COMMON,VCD_FUNCTION_IN); if ( LOG_DEBUGFLAG(UE_TIMING)) { @@ -1141,23 +1097,21 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt } nsymb = (frame_parms->Ncp == 0) ? 14 : 12; -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)//this is the EXPRESS MIMO case - ulsch_start = (ue->rx_offset+subframe_tx*frame_parms->samples_per_tti- - ue->hw_timing_advance- - ue->timing_advance- - ue->N_TA_offset+5); - //LOG_E(PHY,"ul-signal [subframe: %d, ulsch_start %d]\n",subframe_tx, ulsch_start); - if(ulsch_start < 0) - ulsch_start = ulsch_start + (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti); + if (!(IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ) { + ulsch_start = (ue->rx_offset+subframe_tx*frame_parms->samples_per_tti- + ue->hw_timing_advance- + ue->timing_advance- + ue->N_TA_offset+5); - if (ulsch_start > (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti)) - ulsch_start = ulsch_start % (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti); + if(ulsch_start < 0) + ulsch_start = ulsch_start + (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti); - //LOG_E(PHY,"ul-signal [subframe: %d, ulsch_start %d]\n",subframe_tx, ulsch_start); -#else //this is the normal case - ulsch_start = (frame_parms->samples_per_tti*subframe_tx)-ue->N_TA_offset; //-ue->timing_advance; -#endif //else EXMIMO + if (ulsch_start > (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti)) + ulsch_start = ulsch_start % (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti); + } else { //this is the simulators case + ulsch_start = (frame_parms->samples_per_tti*subframe_tx)-ue->N_TA_offset; //-ue->timing_advance; + } if (empty_subframe) { overflow = ulsch_start - 9*frame_parms->samples_per_tti; @@ -1175,70 +1129,63 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt } for (aa=0; aanb_antennas_tx; aa++) { - if (frame_parms->Ncp == 1) + int *Buff = (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ? &ue->common_vars.txdata[aa][ulsch_start] :dummy_tx_buffer; + + if (frame_parms->Ncp == 1) { PHY_ofdm_mod(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size], -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) - dummy_tx_buffer, -#else - &ue->common_vars.txdata[aa][ulsch_start], -#endif + Buff, frame_parms->ofdm_symbol_size, nsymb, frame_parms->nb_prefix_samples, CYCLIC_PREFIX); - else { + } else { normal_prefix_mod(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size], -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) - dummy_tx_buffer, -#else - &ue->common_vars.txdata[aa][ulsch_start], -#endif + Buff, nsymb>>1, &ue->frame_parms); + Buff += (frame_parms->samples_per_tti>>1); normal_prefix_mod(&ue->common_vars.txdataF[aa][((subframe_tx*nsymb)+(nsymb>>1))*frame_parms->ofdm_symbol_size], -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) - dummy_tx_buffer+(frame_parms->samples_per_tti>>1), -#else - &ue->common_vars.txdata[aa][ulsch_start+(frame_parms->samples_per_tti>>1)], -#endif + Buff, nsymb>>1, &ue->frame_parms); } -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) - apply_7_5_kHz(ue,dummy_tx_buffer,0); - apply_7_5_kHz(ue,dummy_tx_buffer,1); -#else - apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],0); - apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],1); -#endif -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) - overflow = ulsch_start - 9*frame_parms->samples_per_tti; - - for (k=ulsch_start,l=0; ksamples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,ulsch_start+frame_parms->samples_per_tti); k++,l++) { - ((short *)ue->common_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l]; - ((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1]; + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) { + apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],0); + apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],1); + } else { + apply_7_5_kHz(ue,dummy_tx_buffer,0); + apply_7_5_kHz(ue,dummy_tx_buffer,1); } - for (k=0; kcommon_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l]; - ((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1]; - } + if (!(IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ) { + overflow = ulsch_start - 9*frame_parms->samples_per_tti; + + for (k=ulsch_start,l=0; ksamples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,ulsch_start+frame_parms->samples_per_tti); k++,l++) { + ((short *)ue->common_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l]; + ((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1]; + } + + for (k=0; kcommon_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l]; + ((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1]; + } #if defined(EXMIMO) - // handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on - for (k=ulsch_start - (frame_parms->samples_per_tti>>1) ; kcommon_vars.txdata[aa][k+frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; - else if (k>(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) - ue->common_vars.txdata[aa][k-frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; - else - ue->common_vars.txdata[aa][k] &= 0xFFFEFFFE; - } + // handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on + for (k=ulsch_start - (frame_parms->samples_per_tti>>1) ; kcommon_vars.txdata[aa][k+frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; + else if (k>(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) + ue->common_vars.txdata[aa][k-frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; + else + ue->common_vars.txdata[aa][k] &= 0xFFFEFFFE; + } #endif -#endif + } + /* only for debug LOG_I(PHY,"ul-signal [subframe: %d, ulsch_start %d, TA: %d, rxOffset: %d, timing_advance: %d, hw_timing_advance: %d]\n",subframe_tx, ulsch_start, ue->N_TA_offset, ue->rx_offset, ue->timing_advance, ue->hw_timing_advance); @@ -1310,14 +1257,15 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ue->prach_resources[eNB_id]->ra_TDD_map_index, ue->prach_resources[eNB_id]->ra_RNTI); ue->tx_total_RE[subframe_tx] = 96; -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) - ue->prach_vars[eNB_id]->amp = get_tx_amp(ue->tx_power_dBm[subframe_tx], - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - 6); -#else - ue->prach_vars[eNB_id]->amp = AMP; -#endif + + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) { + ue->prach_vars[eNB_id]->amp = get_tx_amp(ue->tx_power_dBm[subframe_tx], + ue->tx_power_max_dBm, + ue->frame_parms.N_RB_UL, + 6); + } else { + ue->prach_vars[eNB_id]->amp = AMP; + } if ((mode == calib_prach_tx) && (((proc->frame_tx&0xfffe)%100)==0)) LOG_D(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : PRACH TX power %d dBm, amp %d\n", @@ -1333,12 +1281,12 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_OUT); // stop_meas(&ue->tx_prach); LOG_I(PHY,"[UE %d][RAPROC] PRACH PL %d dB, power %d dBm (max %d dBm), digital power %d dB (amp %d)\n", - ue->Mod_id, - get_PL(ue->Mod_id,ue->CC_id,eNB_id), - ue->tx_power_dBm[subframe_tx], + ue->Mod_id, + get_PL(ue->Mod_id,ue->CC_id,eNB_id), + ue->tx_power_dBm[subframe_tx], ue->tx_power_max_dBm, - dB_fixed(prach_power), - ue->prach_vars[eNB_id]->amp); + dB_fixed(prach_power), + ue->prach_vars[eNB_id]->amp); if (ue->mac_enabled==1) { Msg1_transmitted(ue->Mod_id, @@ -1680,14 +1628,16 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB } ue->tx_total_RE[subframe_tx] = nb_rb*12; -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) - tx_amp = get_tx_amp(ue->tx_power_dBm[subframe_tx], - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - nb_rb); -#else - tx_amp = AMP; -#endif + + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) { + tx_amp = AMP; + } else { + tx_amp = get_tx_amp(ue->tx_power_dBm[subframe_tx], + ue->tx_power_max_dBm, + ue->frame_parms.N_RB_UL, + nb_rb); + } + T(T_UE_PHY_PUSCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), T_INT(tx_amp),T_INT(ue->ulsch[eNB_id]->f_pusch),T_INT(get_PL(Mod_id,0,eNB_id)),T_INT(nb_rb)); @@ -1751,20 +1701,19 @@ void ue_srs_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8 Po_SRS = ue->tx_power_max_dBm; } -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) - - if (ue->mac_enabled==1) { - tx_amp = get_tx_amp(Po_SRS, - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - nb_rb_srs); - } else { + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) { tx_amp = AMP; + } else { + if (ue->mac_enabled==1) { + tx_amp = get_tx_amp(Po_SRS, + ue->tx_power_max_dBm, + ue->frame_parms.N_RB_UL, + nb_rb_srs); + } else { + tx_amp = AMP; + } } -#else - tx_amp = AMP; -#endif LOG_D(PHY,"SRS PROC; TX_MAX_POWER %d, Po_SRS %d, NB_RB_UL %d, NB_RB_SRS %d TX_AMPL %d\n",ue->tx_power_max_dBm, Po_SRS, ue->frame_parms.N_RB_UL, @@ -1903,7 +1852,6 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin uint8_t isShortenPucch = (pSoundingrs_ul_config_dedicated->srsCellSubframe && frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission); bundling_flag = ue->pucch_config_dedicated[eNB_id].tdd_AckNackFeedbackMode; - // Part - I // Collect feedback that should be transmitted at this subframe // - SR @@ -1990,14 +1938,16 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ue->tx_power_dBm[subframe_tx] = Po_PUCCH; ue->tx_total_RE[subframe_tx] = 12; -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) - tx_amp = get_tx_amp(Po_PUCCH, - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - 1); -#else - tx_amp = AMP; -#endif + + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) { + tx_amp = AMP; + } else { + tx_amp = get_tx_amp(Po_PUCCH, + ue->tx_power_max_dBm, + ue->frame_parms.N_RB_UL, + 1); + } + T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), T_INT(tx_amp),T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id))); @@ -2069,14 +2019,16 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ue->tx_power_dBm[subframe_tx] = Po_PUCCH; ue->tx_total_RE[subframe_tx] = 12; -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) - tx_amp = get_tx_amp(Po_PUCCH, - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - 1); -#else - tx_amp = AMP; -#endif + + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) { + tx_amp = AMP; + } else { + tx_amp = get_tx_amp(Po_PUCCH, + ue->tx_power_max_dBm, + ue->frame_parms.N_RB_UL, + 1); + } + T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), T_INT(tx_amp),T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id))); @@ -2171,7 +2123,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui } if (subframe_select(&ue->frame_parms,proc->subframe_tx) == SF_UL || - ue->frame_parms.frame_type == FDD) { + ue->frame_parms.frame_type == FDD) { if (ue->UE_mode[eNB_id] > PRACH ) { // check cell srs subframe and ue srs subframe. This has an impact on pusch encoding isSubframeSRS = is_srs_occasion_common(&ue->frame_parms,proc->frame_tx,proc->subframe_tx); @@ -2313,13 +2265,10 @@ void ue_measurement_procedures( if (( (slot%2) == 0) && (l==(4-frame_parms->Ncp))) { // AGC VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_IN); -#ifndef OAI_USRP -#ifndef OAI_BLADERF -#ifndef OAI_LMSSDR - phy_adjust_gain (ue,dB_fixed(ue->measurements.rssi),0); -#endif -#endif -#endif + + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) + phy_adjust_gain (ue,dB_fixed(ue->measurements.rssi),0); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_OUT); eNB_id = 0; @@ -2752,6 +2701,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb), T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb), T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS)); + if (LOG_DEBUGFLAG(DEBUG_UE_PHYPROC)) { LOG_USEDINLOG_VAR(int8_t,harq_pid) = subframe2harq_pid(&ue->frame_parms, pdcch_alloc2ul_frame(&ue->frame_parms,proc->frame_rx,proc->subframe_rx), @@ -4205,72 +4155,72 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr } if (LOG_DEBUGFLAG(UE_TIMING)) { - stop_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]]); - LOG_I(PHY, "[AbsSFN %d.%d] Channel Decoder: %5.2f \n",frame_rx,subframe_rx,ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); -} + stop_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]]); + LOG_I(PHY, "[AbsSFN %d.%d] Channel Decoder: %5.2f \n",frame_rx,subframe_rx,ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); + } -// duplicate harq structure -uint8_t current_harq_pid = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->current_harq_pid; -LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_processes[current_harq_pid]; -harq_status_t *current_harq_ack = &ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_ack[subframe_rx]; + // duplicate harq structure + uint8_t current_harq_pid = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->current_harq_pid; + LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_processes[current_harq_pid]; + harq_status_t *current_harq_ack = &ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_ack[subframe_rx]; + + // For Debug parallelisation + //if (current_harq_ack->ack == 0) { + //printf("[slot0 dl processing][End of Channel Decoding] AbsSubframe %d.%d Decode Fail for HarqId%d Round%d\n",frame_rx,subframe_rx,current_harq_pid,current_harq_processes->round); + //} + for(uint8_t rx_th_idx=1; rx_th_idxdlsch[ue->current_thread_id[(subframe_rx+rx_th_idx)%10]][eNB_id][0]->harq_processes[current_harq_pid]; + harq_status_t *harq_ack_dest = &ue->dlsch[ue->current_thread_id[(subframe_rx+rx_th_idx)%10]][eNB_id][0]->harq_ack[subframe_rx]; + copy_harq_proc_struct(harq_processes_dest, current_harq_processes); + copy_ack_struct(harq_ack_dest, current_harq_ack); + } + + /* + LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[(subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; + LTE_DL_UE_HARQ_t *harq_processes_dest1 = ue->dlsch[(subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; + + harq_status_t *current_harq_ack = &ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; + harq_status_t *harq_ack_dest = &ue->dlsch[(subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; + harq_status_t *harq_ack_dest1 = &ue->dlsch[(subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; -// For Debug parallelisation -//if (current_harq_ack->ack == 0) { -//printf("[slot0 dl processing][End of Channel Decoding] AbsSubframe %d.%d Decode Fail for HarqId%d Round%d\n",frame_rx,subframe_rx,current_harq_pid,current_harq_processes->round); -//} -for(uint8_t rx_th_idx=1; rx_th_idxdlsch[ue->current_thread_id[(subframe_rx+rx_th_idx)%10]][eNB_id][0]->harq_processes[current_harq_pid]; - harq_status_t *harq_ack_dest = &ue->dlsch[ue->current_thread_id[(subframe_rx+rx_th_idx)%10]][eNB_id][0]->harq_ack[subframe_rx]; copy_harq_proc_struct(harq_processes_dest, current_harq_processes); copy_ack_struct(harq_ack_dest, current_harq_ack); -} -/* -LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[(subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; -LTE_DL_UE_HARQ_t *harq_processes_dest1 = ue->dlsch[(subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; + copy_harq_proc_struct(harq_processes_dest1, current_harq_processes); + copy_ack_struct(harq_ack_dest1, current_harq_ack); + */ + if (subframe_rx==9) { + if (frame_rx % 10 == 0) { + if ((ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]) != 0) + ue->dlsch_fer[eNB_id] = (100*(ue->dlsch_errors[eNB_id] - ue->dlsch_errors_last[eNB_id]))/(ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]); -harq_status_t *current_harq_ack = &ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; -harq_status_t *harq_ack_dest = &ue->dlsch[(subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; -harq_status_t *harq_ack_dest1 = &ue->dlsch[(subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; + ue->dlsch_errors_last[eNB_id] = ue->dlsch_errors[eNB_id]; + ue->dlsch_received_last[eNB_id] = ue->dlsch_received[eNB_id]; + } -copy_harq_proc_struct(harq_processes_dest, current_harq_processes); -copy_ack_struct(harq_ack_dest, current_harq_ack); - -copy_harq_proc_struct(harq_processes_dest1, current_harq_processes); -copy_ack_struct(harq_ack_dest1, current_harq_ack); -*/ -if (subframe_rx==9) { - if (frame_rx % 10 == 0) { - if ((ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]) != 0) - ue->dlsch_fer[eNB_id] = (100*(ue->dlsch_errors[eNB_id] - ue->dlsch_errors_last[eNB_id]))/(ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]); - - ue->dlsch_errors_last[eNB_id] = ue->dlsch_errors[eNB_id]; - ue->dlsch_received_last[eNB_id] = ue->dlsch_received[eNB_id]; - } - - ue->bitrate[eNB_id] = (ue->total_TBS[eNB_id] - ue->total_TBS_last[eNB_id])*100; - ue->total_TBS_last[eNB_id] = ue->total_TBS[eNB_id]; - LOG_D(PHY,"[UE %d] Calculating bitrate Frame %d: total_TBS = %d, total_TBS_last = %d, bitrate %f kbits\n", - ue->Mod_id,frame_rx,ue->total_TBS[eNB_id], - ue->total_TBS_last[eNB_id],(float) ue->bitrate[eNB_id]/1000.0); + ue->bitrate[eNB_id] = (ue->total_TBS[eNB_id] - ue->total_TBS_last[eNB_id])*100; + ue->total_TBS_last[eNB_id] = ue->total_TBS[eNB_id]; + LOG_D(PHY,"[UE %d] Calculating bitrate Frame %d: total_TBS = %d, total_TBS_last = %d, bitrate %f kbits\n", + ue->Mod_id,frame_rx,ue->total_TBS[eNB_id], + ue->total_TBS_last[eNB_id],(float) ue->bitrate[eNB_id]/1000.0); #if UE_AUTOTEST_TRACE - if ((frame_rx % 100 == 0)) { - LOG_I(PHY,"[UE %d] AUTOTEST Metric : UE_DLSCH_BITRATE = %5.2f kbps (frame = %d) \n", ue->Mod_id, (float) ue->bitrate[eNB_id]/1000.0, frame_rx); - } + if ((frame_rx % 100 == 0)) { + LOG_I(PHY,"[UE %d] AUTOTEST Metric : UE_DLSCH_BITRATE = %5.2f kbps (frame = %d) \n", ue->Mod_id, (float) ue->bitrate[eNB_id]/1000.0, frame_rx); + } #endif -} + } -VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); -if (LOG_DEBUGFLAG(UE_TIMING)) { - stop_meas(&ue->phy_proc_rx[ue->current_thread_id[subframe_rx]]); - LOG_I(PHY, "------FULL RX PROC [AbsSFN %d.%d]: %5.2f ------\n",frame_rx,subframe_rx,ue->phy_proc_rx[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); -} + if (LOG_DEBUGFLAG(UE_TIMING)) { + stop_meas(&ue->phy_proc_rx[ue->current_thread_id[subframe_rx]]); + LOG_I(PHY, "------FULL RX PROC [AbsSFN %d.%d]: %5.2f ------\n",frame_rx,subframe_rx,ue->phy_proc_rx[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); + } -LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); -return (0); + LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); + return (0); } #endif /*UE_SLOT_PARALLELISATION */ diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 0a6df78682..3fec30cd9f 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -1741,7 +1741,7 @@ void *UE_thread(void *arg) { } } - //usleep(3000); + // usleep(3000); if(sub_frame == 0) { //UE->proc.proc_rxtx[0].frame_rx++; //UE->proc.proc_rxtx[1].frame_rx++; From 00d90607118f0ae406d717a5500cd3d2032a318a Mon Sep 17 00:00:00 2001 From: frtabu Date: Thu, 9 May 2019 02:03:56 +0200 Subject: [PATCH 13/28] remove XFORM macro, move XFORM code in optional library --- cmake_targets/CMakeLists.txt | 49 ++++--- cmake_targets/build_oai | 16 ++- openair1/PHY/TOOLS/lte_enb_scope.c | 173 +++++++++++++++++++++++ openair1/PHY/TOOLS/lte_ue_scope.c | 150 ++++++++++++++++++++ openair1/PHY/TOOLS/phy_scope_interface.c | 53 +++++++ openair1/PHY/TOOLS/phy_scope_interface.h | 37 +++++ targets/RT/USER/lte-softmodem-common.c | 5 + targets/RT/USER/lte-softmodem.c | 162 ++------------------- targets/RT/USER/lte-softmodem.h | 6 +- targets/RT/USER/lte-uesoftmodem.c | 138 ++---------------- 10 files changed, 484 insertions(+), 305 deletions(-) create mode 100644 openair1/PHY/TOOLS/lte_enb_scope.c create mode 100644 openair1/PHY/TOOLS/lte_ue_scope.c create mode 100644 openair1/PHY/TOOLS/phy_scope_interface.c create mode 100644 openair1/PHY/TOOLS/phy_scope_interface.h diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index f578fccb38..22a00f0867 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -241,7 +241,6 @@ add_boolean_option(DEBUG_MAC_INTERFACE False "print MAC-RLC PDU exchange to stdo 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(T_TRACER True "Activate the T tracer, a debugging/monitoring framework" ) add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs") @@ -1988,16 +1987,28 @@ endif() list(APPEND ATLAS_LIBRARIES lapack lapacke) -if (${XFORMS}) - include_directories ("/usr/include/X11") - set(XFORMS_SOURCE - ${OPENAIR1_DIR}/PHY/TOOLS/lte_phy_scope.c - ) - set(XFORMS_SOURCE_SOFTMODEM - ${OPENAIR_TARGETS}/RT/USER/stats.c - ) - set(XFORMS_LIBRARIES "forms") -endif (${XFORMS}) +set(XFORMS_SOURCE + ${OPENAIR1_DIR}/PHY/TOOLS/lte_phy_scope.c + ) +set(XFORMS_ENB_SOURCE + ${OPENAIR1_DIR}/PHY/TOOLS/lte_enb_scope.c + ) +set(XFORMS_UE_SOURCE + ${OPENAIR1_DIR}/PHY/TOOLS/lte_ue_scope.c + ) +set(XFORMS_SOURCE_SOFTMODEM + ${OPENAIR_TARGETS}/RT/USER/stats.c + ) +set(XFORMS_LIBRARIES "forms") + + +set (XFORMSINTERFACE_SOURCE + ${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c + ) +add_library(enbscope MODULE ${XFORMS_SOURCE} ${XFORMS_ENB_SOURCE}) +add_library(uescope MODULE ${XFORMS_SOURCE} ${XFORMS_UE_SOURCE}) +target_link_libraries(enbscope ${XFORMS_LIBRARIES}) +target_link_libraries(uescope ${XFORMS_LIBRARIES}) set(CMAKE_MODULE_PATH "${OPENAIR_DIR}/cmake_targets/tools/MODULES" "${CMAKE_MODULE_PATH}") @@ -2065,8 +2076,7 @@ add_executable(lte-softmodem ${OPENAIR_DIR}/common/utils/utils.c ${OPENAIR_DIR}/common/utils/system.c ${GTPU_need_ITTI} - ${XFORMS_SOURCE} - ${XFORMS_SOURCE_SOFTMODEM} + ${XFORMSINTERFACE_SOURCE} ${T_SOURCE} ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} @@ -2109,7 +2119,7 @@ target_link_libraries(du_test ) target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES}) -target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES}) +target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES}) target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (lte-softmodem ${T_LIB}) @@ -2134,8 +2144,7 @@ add_executable(lte-uesoftmodem ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c ${OPENAIR_DIR}/common/utils/utils.c ${OPENAIR_DIR}/common/utils/system.c - ${XFORMS_SOURCE} - ${XFORMS_SOURCE_SOFTMODEM} + ${XFORMSINTERFACE_SOURCE} ${T_SOURCE} ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} @@ -2150,7 +2159,7 @@ target_link_libraries (lte-uesoftmodem -Wl,--end-group z dl) target_link_libraries (lte-uesoftmodem ${LIBXML2_LIBRARIES}) -target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) +target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) target_link_libraries (lte-uesoftmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (lte-uesoftmodem ${T_LIB}) @@ -2194,14 +2203,14 @@ add_executable(dlsim_tm4 ) target_link_libraries (dlsim_tm4 -Wl,--start-group SIMU UTIL SCHED_LIB SCHED_RU_LIB PHY LFDS ${ITTI_LIB} -Wl,--end-group - pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} + pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${T_LIB} ) foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim) add_executable(${myExe} ${OPENAIR1_DIR}/SIMULATION/LTE_PHY/${myExe}.c - ${XFORMS_SOURCE} + ${XFORMSINTERFACE_SOURCE} ${T_SOURCE} ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} @@ -2210,7 +2219,7 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr target_link_libraries (${myExe} -Wl,--start-group SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY PHY_UE PHY_RU LFDS ${ITTI_LIB} LFDS7 -Wl,--end-group - pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl + pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${T_LIB} dl ) endforeach(myExe) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 65cc360056..5a0a8ed9b5 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -260,7 +260,7 @@ function main() { EXE_ARGUMENTS="$EXE_ARGUMENTS -V" shift;; -x | --xforms) - XFORMS="True" + XFORMS=1 EXE_ARGUMENTS="$EXE_ARGUMENTS -d" echo_info "Will generate the software oscilloscope features" shift;; @@ -475,7 +475,6 @@ function main() { echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file - echo "set ( XFORMS $XFORMS )" >> $cmake_file echo "set ( UE_EXPANSION $UE_EXPANSION )" >> $cmake_file # echo "set ( PHY_TX_THREAD $UE_EXPANSION )" >> $cmake_file echo "set ( PRE_SCD_THREAD $UE_EXPANSION )" >> $cmake_file @@ -658,7 +657,18 @@ function main() { $lte_build_dir msc \ libmsc.so $dbin/libmsc.so - fi + fi + # softsope compilations + ##################### + if [ "$XFORMS" = "1" ] ; then + compilations \ + $lte_build_dir enbscope \ + libenbscope.so $dbin/libenbscope.so + compilations \ + $lte_build_dir uescope \ + libuescope.so $dbin/libuescope.so + + fi # build RF device and transport protocol libraries ##################################### if [ "$eNB" = "1" -o "$UE" = "1" ] ; then diff --git a/openair1/PHY/TOOLS/lte_enb_scope.c b/openair1/PHY/TOOLS/lte_enb_scope.c new file mode 100644 index 0000000000..2918a6aa5c --- /dev/null +++ b/openair1/PHY/TOOLS/lte_enb_scope.c @@ -0,0 +1,173 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file lte_enb_scope.c + * \brief enb specific softsope implementation + * \author Nokia BellLabs France, francois Taburet + * \date 2019 + * \version 0.1 + * \company Nokia Bell-Labs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ + +#include "targets/RT/USER/lte-softmodem.h" +#include "UTIL/OPT/opt.h" +#include "common/config/config_userapi.h" +#include "PHY/TOOLS/lte_phy_scope.h" +#include "targets/RT/USER/stats.h" + +// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0) +// at eNB 0, an UL scope for every UE +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 = 2; +static pthread_t forms_thread; //xforms +int otg_enabled=0; + +void reset_stats(FL_OBJECT *button, long arg) { + int i,j,k; + PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0]; + + for (i=0; idlsch[i][0]->Mlimit; j++) { + phy_vars_eNB->UE_stats[i].dlsch_NAK[k][j]=0; + phy_vars_eNB->UE_stats[i].dlsch_ACK[k][j]=0; + phy_vars_eNB->UE_stats[i].dlsch_trials[k][j]=0; + } + + phy_vars_eNB->UE_stats[i].dlsch_l2_errors[k]=0; + phy_vars_eNB->UE_stats[i].ulsch_errors[k]=0; + phy_vars_eNB->UE_stats[i].ulsch_consecutive_errors=0; + phy_vars_eNB->UE_stats[i].dlsch_sliding_cnt=0; + phy_vars_eNB->UE_stats[i].dlsch_NAK_round0=0; + phy_vars_eNB->UE_stats[i].dlsch_mcs_offset=0; + } + } +} + + + + + +static void *scope_thread_eNB(void *arg) { +# ifdef ENABLE_XFORMS_WRITE_STATS + FILE *eNB_stats; +# endif + 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); + printf("Scope thread has priority %d\n",sched_param.sched_priority); +# ifdef ENABLE_XFORMS_WRITE_STATS + eNB_stats = fopen("eNB_stats.txt", "w"); +#endif + + while (!oai_exit) { + ue_cnt=0; + + for(UE_id=0; UE_idstats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "l2 stats"); + form_stats = create_form_stats_form(); + fl_show_form (form_stats->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "stats"); + + for(UE_id=0; UE_idlte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); + + if (otg_enabled) { + fl_set_button(form_enb[CC_id][UE_id]->button_0,1); + fl_set_object_label(form_enb[CC_id][UE_id]->button_0,"DL Traffic ON"); + } else { + fl_set_button(form_enb[CC_id][UE_id]->button_0,0); + fl_set_object_label(form_enb[CC_id][UE_id]->button_0,"DL Traffic OFF"); + } + } // CC_id + } // UE_id + + int ret = pthread_create(&forms_thread, NULL, scope_thread_eNB, NULL); + + if (ret == 0) + pthread_setname_np( forms_thread, "xforms" ); + + printf("Scope thread created, ret=%d\n",ret); + return 0; +} // start_forms_eNB + + + +void end_forms(void) { + printf("waiting for XFORMS thread\n"); + pthread_join(forms_thread,NULL); + fl_hide_form(form_stats->stats_form); + fl_free_form(form_stats->stats_form); + fl_hide_form(form_stats_l2->stats_form); + fl_free_form(form_stats_l2->stats_form); + + for(int UE_id=0; UE_idlte_phy_scope_enb); + fl_free_form(form_enb[CC_id][UE_id]->lte_phy_scope_enb); + } + } +} // end_forms + diff --git a/openair1/PHY/TOOLS/lte_ue_scope.c b/openair1/PHY/TOOLS/lte_ue_scope.c new file mode 100644 index 0000000000..a5a5267cc5 --- /dev/null +++ b/openair1/PHY/TOOLS/lte_ue_scope.c @@ -0,0 +1,150 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + + +/*! \file lte_ue_scope.c + * \brief UE specific softsope implementation + * \author Nokia BellLabs France, francois Taburet + * \date 2019 + * \version 0.1 + * \company Nokia Bell-Labs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ + +#include "targets/RT/USER/lte-softmodem.h" +#include "UTIL/OPT/opt.h" +#include "common/config/config_userapi.h" +#include "PHY/TOOLS/lte_phy_scope.h" +#include "targets/RT/USER/stats.h" +#include "PHY/phy_vars_ue.h" +// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0) +// at eNB 0, an UL scope for every UE +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 = 2; +static pthread_t forms_thread; //xforms + + +void reset_stats(FL_OBJECT *button, long arg) { + int i,j,k; + PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0]; + + for (i=0; idlsch[i][0]->Mlimit; j++) { + phy_vars_eNB->UE_stats[i].dlsch_NAK[k][j]=0; + phy_vars_eNB->UE_stats[i].dlsch_ACK[k][j]=0; + phy_vars_eNB->UE_stats[i].dlsch_trials[k][j]=0; + } + + phy_vars_eNB->UE_stats[i].dlsch_l2_errors[k]=0; + phy_vars_eNB->UE_stats[i].ulsch_errors[k]=0; + phy_vars_eNB->UE_stats[i].ulsch_consecutive_errors=0; + phy_vars_eNB->UE_stats[i].dlsch_sliding_cnt=0; + phy_vars_eNB->UE_stats[i].dlsch_NAK_round0=0; + phy_vars_eNB->UE_stats[i].dlsch_mcs_offset=0; + } + } +} + + +static void *scope_thread_UE(void *arg) { + char stats_buffer[16384]; +# ifdef ENABLE_XFORMS_WRITE_STATS + FILE *UE_stats, *eNB_stats; +# endif + struct sched_param sched_param; + sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO)+1; + sched_setscheduler(0, SCHED_FIFO,&sched_param); + printf("Scope thread has priority %d\n",sched_param.sched_priority); +# ifdef ENABLE_XFORMS_WRITE_STATS + UE_stats = fopen("UE_stats.txt", "w"); +#endif + + while (!oai_exit) { + // dump_ue_stats (PHY_vars_UE_g[0][0], &PHY_vars_UE_g[0][0]->proc.proc_rxtx[0],stats_buffer, 0, mode,rx_input_level_dBm); + //fl_set_object_label(form_stats->stats_text, stats_buffer); + fl_clear_browser(form_stats->stats_text); + fl_add_browser_line(form_stats->stats_text, stats_buffer); + phy_scope_UE(form_ue[0], + PHY_vars_UE_g[0][0], + 0, + 0,7); + // printf("%s",stats_buffer); + } + +# ifdef ENABLE_XFORMS_WRITE_STATS + + if (UE_stats) { + rewind (UE_stats); + fwrite (stats_buffer, 1, len, UE_stats); + fclose (UE_stats); + } + +# endif + pthread_exit((void *)arg); +} + + +int uescope_autoinit(void) { + int UE_id; + int argc; + char *argv; + printf("XFORMS\n"); + fl_initialize (&argc, &argv, NULL, 0, 0); + form_stats = create_form_stats_form(); + fl_show_form (form_stats->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "stats"); + UE_id = 0; + form_ue[UE_id] = create_lte_phy_scope_ue(); + sprintf (title, "LTE DL SCOPE UE"); + fl_show_form (form_ue[UE_id]->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); + /* + if (openair_daq_vars.use_ia_receiver) { + fl_set_button(form_ue[UE_id]->button_0,1); + fl_set_object_label(form_ue[UE_id]->button_0, "IA Receiver ON"); + } else { + fl_set_button(form_ue[UE_id]->button_0,0); + fl_set_object_label(form_ue[UE_id]->button_0, "IA Receiver OFF"); + }*/ + fl_set_button(form_ue[UE_id]->button_0,0); + fl_set_object_label(form_ue[UE_id]->button_0, "IA Receiver OFF"); + int ret = pthread_create(&forms_thread, NULL, scope_thread_UE, NULL); + + if (ret == 0) + pthread_setname_np( forms_thread, "xforms" ); + + printf("Scope thread created, ret=%d\n",ret); + return 0; +} // start_forms_UE + + +void end_forms(void) { + printf("waiting for XFORMS thread\n"); + pthread_join(forms_thread,NULL); + fl_hide_form(form_stats->stats_form); + fl_free_form(form_stats->stats_form); + fl_hide_form(form_ue[0]->lte_phy_scope_ue); + fl_free_form(form_ue[0]->lte_phy_scope_ue); +} // end_forms diff --git a/openair1/PHY/TOOLS/phy_scope_interface.c b/openair1/PHY/TOOLS/phy_scope_interface.c new file mode 100644 index 0000000000..835fb4ea7b --- /dev/null +++ b/openair1/PHY/TOOLS/phy_scope_interface.c @@ -0,0 +1,53 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file openair1/PHY/TOOLS/phy_scope_interface.c + * \brief soft scope API interface implementation + * \author Nokia BellLabs France, francois Taburet + * \date 2019 + * \version 0.1 + * \company Nokia BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ +#include +#include "common/config/config_userapi.h" +#include "common/utils/load_module_shlib.h" +#include "phy_scope_interface.h" + +#define SOFTSCOPE_ENDFUNC_IDX 0 +static loader_shlibfunc_t scope_fdesc[]= {{"end_forms",NULL}}; + +int load_softscope(char *exectype) { + char libname[64]; + sprintf(libname,"%.10sscope",exectype); + return load_module_shlib(libname,scope_fdesc,1,NULL); +} + +int end_forms(void) { + if (scope_fdesc[SOFTSCOPE_ENDFUNC_IDX].fptr) { + scope_fdesc[SOFTSCOPE_ENDFUNC_IDX].fptr(); + return 0; + } + + return -1; +} diff --git a/openair1/PHY/TOOLS/phy_scope_interface.h b/openair1/PHY/TOOLS/phy_scope_interface.h new file mode 100644 index 0000000000..4081a9cd96 --- /dev/null +++ b/openair1/PHY/TOOLS/phy_scope_interface.h @@ -0,0 +1,37 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file phy_scope_interface.h + * \brief softscope interface API include file + * \author Nokia BellLabs France, francois Taburet + * \date 2019 + * \version 0.1 + * \company Nokia BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ + + +int load_softscope(char *exectype); +int end_forms(void) ; + + diff --git a/targets/RT/USER/lte-softmodem-common.c b/targets/RT/USER/lte-softmodem-common.c index 242d0b76d7..f152e7c83d 100644 --- a/targets/RT/USER/lte-softmodem-common.c +++ b/targets/RT/USER/lte-softmodem-common.c @@ -60,6 +60,7 @@ void get_common_options(void) { uint32_t nonbiot; uint32_t rfsim; uint32_t basicsim; + uint32_t do_forms; paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ; paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ; checkedparam_t cmdline_log_CheckParams[] = CMDLINE_LOGPARAMS_CHECK_DESC; @@ -100,6 +101,10 @@ void get_common_options(void) { set_softmodem_optmask(SOFTMODEM_BASICSIM_BIT); } + if (do_forms) { + set_softmodem_optmask(SOFTMODEM_DOFORMS_BIT); + } + #if BASIC_SIMULATOR set_softmodem_optmask(SOFTMODEM_BASICSIM_BIT); #endif diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 80b9c3a3fd..998fb4ecfa 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -64,6 +64,7 @@ #include "LAYER2/MAC/mac_proto.h" #include "RRC/LTE/rrc_vars.h" #include "PHY_INTERFACE/phy_interface_vars.h" +#include "PHY/TOOLS/phy_scope_interface.h" #include "nfapi/oai_integration/vendor_ext.h" #ifdef SMBV #include "PHY/TOOLS/smbv.h" @@ -90,22 +91,9 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "system.h" -#ifdef XFORMS - #include "PHY/TOOLS/lte_phy_scope.h" - #include "stats.h" -#endif + #include "lte-softmodem.h" #include "NB_IoT_interface.h" -#ifdef XFORMS - // current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0) - // at eNB 0, an UL scope for every UE - 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 = 2; - static pthread_t forms_thread; //xforms -#endif //XFORMS pthread_cond_t nfapi_sync_cond; @@ -163,12 +151,8 @@ char channels[128] = "0"; int rx_input_level_dBm; -#ifdef XFORMS - extern int otg_enabled; -#else - int otg_enabled; -#endif -//int number_of_cards = 1; + +int otg_enabled; uint8_t exit_missed_slots=1; @@ -301,75 +285,6 @@ void exit_function(const char *file, const char *function, const int line, const exit(1); } -#ifdef XFORMS - - -void reset_stats(FL_OBJECT *button, long arg) { - int i,j,k; - PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0]; - - for (i=0; idlsch[i][0]->Mlimit; j++) { - phy_vars_eNB->UE_stats[i].dlsch_NAK[k][j]=0; - phy_vars_eNB->UE_stats[i].dlsch_ACK[k][j]=0; - phy_vars_eNB->UE_stats[i].dlsch_trials[k][j]=0; - } - - phy_vars_eNB->UE_stats[i].dlsch_l2_errors[k]=0; - phy_vars_eNB->UE_stats[i].ulsch_errors[k]=0; - phy_vars_eNB->UE_stats[i].ulsch_consecutive_errors=0; - phy_vars_eNB->UE_stats[i].dlsch_sliding_cnt=0; - phy_vars_eNB->UE_stats[i].dlsch_NAK_round0=0; - phy_vars_eNB->UE_stats[i].dlsch_mcs_offset=0; - } - } -} - -static void *scope_thread(void *arg) { -# ifdef ENABLE_XFORMS_WRITE_STATS - FILE *eNB_stats; -# endif - 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); - printf("Scope thread has priority %d\n",sched_param.sched_priority); -# ifdef ENABLE_XFORMS_WRITE_STATS - eNB_stats = fopen("eNB_stats.txt", "w"); -#endif - - while (!oai_exit) { - ue_cnt=0; - - for(UE_id=0; UE_idnode_type)) { pdcp_layer_init(); 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) pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT ; + pdcp_module_init(pdcp_initmask); if (NODE_IS_CU(RC.rrc[0]->node_type)) { @@ -608,14 +525,8 @@ static void wait_nfapi_init(char *thread_name) { int main( int argc, char **argv ) { int i; -#if defined (XFORMS) - void *status; -#endif int CC_id = 0; int ru_id; -#if defined (XFORMS) - int ret; -#endif if ( load_configmodule(argc,argv,0) == NULL) { exit_fun("[SOFTMODEM] Error, configuration module init failed\n"); @@ -675,9 +586,9 @@ int main( int argc, char **argv ) { /* Read configuration */ if (RC.nb_inst > 0) { read_config_and_init(); - /* Start the agent. If it is turned off in the configuration, it won't start */ RCconfig_flexran(); + for (i = 0; i < RC.nb_inst; i++) { flexran_agent_start(i); } @@ -718,42 +629,10 @@ int main( int argc, char **argv ) { mlockall(MCL_CURRENT | MCL_FUTURE); pthread_cond_init(&sync_cond,NULL); pthread_mutex_init(&sync_mutex, NULL); -#ifdef XFORMS - int UE_id; - printf("XFORMS\n"); - if (get_softmodem_params()->do_forms==1) { - fl_initialize (&argc, argv, NULL, 0, 0); - form_stats_l2 = create_form_stats_form(); - fl_show_form (form_stats_l2->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "l2 stats"); - form_stats = create_form_stats_form(); - fl_show_form (form_stats->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "stats"); + if(IS_SOFTMODEM_DOFORMS) + load_softscope("enb"); - for(UE_id=0; UE_idlte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); - - if (otg_enabled) { - fl_set_button(form_enb[CC_id][UE_id]->button_0,1); - fl_set_object_label(form_enb[CC_id][UE_id]->button_0,"DL Traffic ON"); - } else { - fl_set_button(form_enb[CC_id][UE_id]->button_0,0); - fl_set_object_label(form_enb[CC_id][UE_id]->button_0,"DL Traffic OFF"); - } - } // CC_id - } // UE_id - - ret = pthread_create(&forms_thread, NULL, scope_thread, NULL); - - if (ret == 0) - pthread_setname_np( forms_thread, "xforms" ); - - printf("Scope thread created, ret=%d\n",ret); - } - -#endif rt_sleep_ns(10*100000000ULL); if (NFAPI_MODE!=NFAPI_MONOLITHIC) { @@ -845,26 +724,9 @@ int main( int argc, char **argv ) { // stop threads if (RC.nb_inst == 0 || !NODE_IS_CU(RC.rrc[0]->node_type)) { - int UE_id; -#ifdef XFORMS - printf("waiting for XFORMS thread\n"); + if(IS_SOFTMODEM_DOFORMS) + end_forms(); - if (get_softmodem_params()->do_forms==1) { - pthread_join(forms_thread,&status); - fl_hide_form(form_stats->stats_form); - fl_free_form(form_stats->stats_form); - fl_hide_form(form_stats_l2->stats_form); - fl_free_form(form_stats_l2->stats_form); - - for(UE_id=0; UE_idlte_phy_scope_enb); - fl_free_form(form_enb[CC_id][UE_id]->lte_phy_scope_enb); - } - } - } - -#endif LOG_I(ENB_APP,"stopping MODEM threads\n"); stop_eNB(NB_eNB_INST); stop_RU(RC.nb_RU); diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index 5900889e6d..e25cbed0b7 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -179,7 +179,6 @@ #define WAIT_FOR_SYNC softmodem_params.wait_for_sync #define SINGLE_THREAD_FLAG softmodem_params.single_thread_flag #define CHAIN_OFFSET softmodem_params.chain_offset -#define DO_FORMS softmodem_params.do_forms #define NUMEROLOGY softmodem_params.numerology #define EMULATE_RF softmodem_params.emulate_rf #define CLOCK_SOURCE softmodem_params.clock_source @@ -195,7 +194,7 @@ {"single-thread-enable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&SINGLE_THREAD_FLAG, defintval:0, TYPE_INT, 0}, \ {"C" , CONFIG_HLP_DLF, 0, uptr:&(downlink_frequency[0][0]), defuintval:2680000000, TYPE_UINT, 0}, \ {"a" , CONFIG_HLP_CHOFF, 0, iptr:&CHAIN_OFFSET, defintval:0, TYPE_INT, 0}, \ - {"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&DO_FORMS, defintval:0, TYPE_INT8, 0}, \ + {"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \ {"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \ {"S" , CONFIG_HLP_MSLOTS, PARAMFLAG_BOOL, u8ptr:&exit_missed_slots, defintval:1, TYPE_UINT8, 0}, \ {"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&NUMEROLOGY, defintval:0, TYPE_INT, 0}, \ @@ -245,6 +244,7 @@ #define SOFTMODEM_RFSIM_BIT (1<<10) #define SOFTMODEM_BASICSIM_BIT (1<<11) #define SOFTMODEM_SIML1_BIT (1<<12) +#define SOFTMODEM_DOFORMS_BIT (1<<15) typedef struct { uint64_t optmask; THREAD_STRUCT thread_struct; @@ -255,7 +255,6 @@ typedef struct { int wait_for_sync; //eNodeB only int single_thread_flag; //eNodeB only int chain_offset; - uint32_t do_forms; int numerology; unsigned int start_msc; uint32_t clock_source; @@ -268,6 +267,7 @@ typedef struct { #define IS_SOFTMODEM_RFSIM ( get_softmodem_optmask() & SOFTMODEM_RFSIM_BIT) #define IS_SOFTMODEM_BASICSIM ( get_softmodem_optmask() & SOFTMODEM_BASICSIM_BIT) #define IS_SOFTMODEM_SIML1 ( get_softmodem_optmask() & SOFTMODEM_SIML1_BIT) +#define IS_SOFTMODEM_DOFORMS ( get_softmodem_optmask() & SOFTMODEM_DOFORMS_BIT) extern uint64_t get_softmodem_optmask(void); extern uint64_t set_softmodem_optmask(uint64_t bitmask); extern void get_common_options(void); diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c index fdfdbfc1dd..74380913dd 100644 --- a/targets/RT/USER/lte-uesoftmodem.c +++ b/targets/RT/USER/lte-uesoftmodem.c @@ -66,7 +66,7 @@ #include "LAYER2/MAC/mac_proto.h" #include "RRC/LTE/rrc_vars.h" #include "PHY_INTERFACE/phy_interface_vars.h" - +#include "PHY/TOOLS/phy_scope_interface.h" #include "common/utils/LOG/log.h" #include "nfapi/oai_integration/vendor_ext.h" #include "UTIL/OTG/otg_tx.h" @@ -85,26 +85,14 @@ #include "system.h" -#ifdef XFORMS - #include "PHY/TOOLS/lte_phy_scope.h" - #include "stats.h" -#endif + #include "lte-softmodem.h" /* temporary compilation wokaround (UE/eNB split */ uint16_t sf_ahead; -#ifdef XFORMS - // current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0) - // at eNB 0, an UL scope for every UE - 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 = 2; - static pthread_t forms_thread; //xforms -#endif //XFORMS + pthread_cond_t nfapi_sync_cond; pthread_mutex_t nfapi_sync_mutex; @@ -148,7 +136,7 @@ int snr_dB=25; runmode_t mode = normal_txrx; FILE *input_fd=NULL; - +int otg_enabled=0; #if MAX_NUM_CCs == 1 rx_gain_t rx_gain_mode[MAX_NUM_CCs][4] = {{max_gain,max_gain,max_gain,max_gain}}; @@ -179,10 +167,6 @@ char channels[128] = "0"; int rx_input_level_dBm; -#ifdef XFORMS - extern int otg_enabled; -#endif -//int number_of_cards = 1; static LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; @@ -329,68 +313,8 @@ void exit_function(const char *file, const char *function, const int line, const exit(1); } -#ifdef XFORMS -void reset_stats(FL_OBJECT *button, long arg) { - int i,j,k; - PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0]; - - for (i=0; idlsch[i][0]->Mlimit; j++) { - phy_vars_eNB->UE_stats[i].dlsch_NAK[k][j]=0; - phy_vars_eNB->UE_stats[i].dlsch_ACK[k][j]=0; - phy_vars_eNB->UE_stats[i].dlsch_trials[k][j]=0; - } - - phy_vars_eNB->UE_stats[i].dlsch_l2_errors[k]=0; - phy_vars_eNB->UE_stats[i].ulsch_errors[k]=0; - phy_vars_eNB->UE_stats[i].ulsch_consecutive_errors=0; - phy_vars_eNB->UE_stats[i].dlsch_sliding_cnt=0; - phy_vars_eNB->UE_stats[i].dlsch_NAK_round0=0; - phy_vars_eNB->UE_stats[i].dlsch_mcs_offset=0; - } - } -} - -static void *scope_thread(void *arg) { - char stats_buffer[16384]; -# ifdef ENABLE_XFORMS_WRITE_STATS - FILE *UE_stats, *eNB_stats; -# endif - struct sched_param sched_param; - sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO)+1; - sched_setscheduler(0, SCHED_FIFO,&sched_param); - printf("Scope thread has priority %d\n",sched_param.sched_priority); -# ifdef ENABLE_XFORMS_WRITE_STATS - UE_stats = fopen("UE_stats.txt", "w"); -#endif - - while (!oai_exit) { - // dump_ue_stats (PHY_vars_UE_g[0][0], &PHY_vars_UE_g[0][0]->proc.proc_rxtx[0],stats_buffer, 0, mode,rx_input_level_dBm); - //fl_set_object_label(form_stats->stats_text, stats_buffer); - fl_clear_browser(form_stats->stats_text); - fl_add_browser_line(form_stats->stats_text, stats_buffer); - phy_scope_UE(form_ue[0], - PHY_vars_UE_g[0][0], - 0, - 0,7); - // printf("%s",stats_buffer); - } - -# ifdef ENABLE_XFORMS_WRITE_STATS - - if (UE_stats) { - rewind (UE_stats); - fwrite (stats_buffer, 1, len, UE_stats); - fclose (UE_stats); - } - -# endif - pthread_exit((void *)arg); -} -#endif @@ -675,9 +599,6 @@ void init_pdcp(void) { } int main( int argc, char **argv ) { -#if defined (XFORMS) - void *status; -#endif int CC_id; uint8_t abstraction_flag=0; #ifdef UESIM_EXPANSION @@ -687,9 +608,6 @@ int main( int argc, char **argv ) { // if not changed from the command line option --num-ues NB_UE_INST=1; NB_THREAD_INST=1; -#if defined (XFORMS) - int ret; -#endif configmodule_interface_t *config_mod; start_background_system(); config_mod = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY); @@ -749,9 +667,7 @@ int main( int argc, char **argv ) { MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX); init_opt(); - init_pdcp(); - //TTN for D2D printf ("RRC control socket\n"); rrc_control_socket_init(); @@ -898,37 +814,9 @@ int main( int argc, char **argv ) { PHY_vars_UE_g[0][0]->no_timing_correction = 1; } -#ifdef XFORMS - int UE_id; - printf("XFORMS\n"); + if(IS_SOFTMODEM_DOFORMS) + load_softscope("ue"); - if (get_softmodem_params()->do_forms==1) { - fl_initialize (&argc, argv, NULL, 0, 0); - form_stats = create_form_stats_form(); - fl_show_form (form_stats->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "stats"); - UE_id = 0; - form_ue[UE_id] = create_lte_phy_scope_ue(); - sprintf (title, "LTE DL SCOPE UE"); - fl_show_form (form_ue[UE_id]->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); - /* - if (openair_daq_vars.use_ia_receiver) { - fl_set_button(form_ue[UE_id]->button_0,1); - fl_set_object_label(form_ue[UE_id]->button_0, "IA Receiver ON"); - } else { - fl_set_button(form_ue[UE_id]->button_0,0); - fl_set_object_label(form_ue[UE_id]->button_0, "IA Receiver OFF"); - }*/ - fl_set_button(form_ue[UE_id]->button_0,0); - fl_set_object_label(form_ue[UE_id]->button_0, "IA Receiver OFF"); - ret = pthread_create(&forms_thread, NULL, scope_thread, NULL); - - if (ret == 0) - pthread_setname_np( forms_thread, "xforms" ); - - printf("Scope thread created, ret=%d\n",ret); - } - -#endif config_check_unknown_cmdlineopt(CONFIG_CHECKALLSECTIONS); printf("Sending sync to all threads (%p,%p,%p)\n",&sync_var,&sync_cond,&sync_mutex); pthread_mutex_lock(&sync_mutex); @@ -957,19 +845,11 @@ int main( int argc, char **argv ) { printf("Terminating application - oai_exit=%d\n",oai_exit); #endif + // stop threads -#ifdef XFORMS - printf("waiting for XFORMS thread\n"); + if(IS_SOFTMODEM_DOFORMS) + end_forms(); - if (get_softmodem_params()->do_forms==1) { - pthread_join(forms_thread,&status); - fl_hide_form(form_stats->stats_form); - fl_free_form(form_stats->stats_form); - fl_hide_form(form_ue[0]->lte_phy_scope_ue); - fl_free_form(form_ue[0]->lte_phy_scope_ue); - } - -#endif printf("stopping MODEM threads\n"); pthread_cond_destroy(&sync_cond); pthread_mutex_destroy(&sync_mutex); From da71492f259cc4c9e5ff3e38c32a8191e45f8418 Mon Sep 17 00:00:00 2001 From: frtabu Date: Thu, 9 May 2019 12:13:39 +0200 Subject: [PATCH 14/28] fix dlsim build, (dlsim has it's own scope start method...) --- cmake_targets/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 22a00f0867..ededd23446 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -2210,7 +2210,7 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr add_executable(${myExe} ${OPENAIR1_DIR}/SIMULATION/LTE_PHY/${myExe}.c - ${XFORMSINTERFACE_SOURCE} + ${XFORMS_SOURCE} ${T_SOURCE} ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} @@ -2219,7 +2219,7 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr target_link_libraries (${myExe} -Wl,--start-group SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY PHY_UE PHY_RU LFDS ${ITTI_LIB} LFDS7 -Wl,--end-group - pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${T_LIB} dl + pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl ) endforeach(myExe) From cd667e5563e86dfce415dd3b6780b8af43c112dd Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 13 May 2019 15:52:54 +0200 Subject: [PATCH 15/28] RRC: add an option to enable measurement reports In the configuration file, to enable measurements, add: enable_measurement_reports = "yes"; Note that if x2 is enabled then the option 'enable_measurement_reports' is not taken into account and the measurements are enabled. --- .../conf_files/enb.band13.tm1.50PRB.emtc.conf | 2 + ...d40.tm1.100PRB.FairScheduler.usrpb210.conf | 2 + ...nd40.tm1.25PRB.FairScheduler.usrpb210.conf | 2 + ...nd40.tm1.50PRB.FairScheduler.usrpb210.conf | 2 + .../enb.band7.tm1.100PRB.usrpb210.conf | 2 + .../enb.band7.tm1.25PRB.usrpb210.conf | 2 + .../enb.band7.tm1.50PRB.usrpb210.conf | 2 + .../enb.band7.tm2.25PRB.usrpb210.conf | 2 + ci-scripts/conf_files/lte-fdd-basic-sim.conf | 2 + ci-scripts/conf_files/lte-tdd-basic-sim.conf | 2 + ...d40.tm1.100PRB.FairScheduler.usrpb210.conf | 2 + ...nd40.tm1.25PRB.FairScheduler.usrpb210.conf | 2 + ...nd40.tm1.50PRB.FairScheduler.usrpb210.conf | 2 + ...cc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf | 2 + ...rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf | 2 + ...rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf | 2 + .../conf_files/rcc.band7.tm1.nfapi.conf | 2 + .../enb.band38.tm1.usrpb210.tdd.10MHz.conf | 2 + .../enb.band38.tm1.usrpb210.tdd.20MHz.conf | 2 + .../enb.band38.tm1.usrpb210.tdd.5MHz.conf | 2 + .../enb.band7.tm1.usrpb210.fdd.10MHz.conf | 2 + .../enb.band7.tm1.usrpb210.fdd.20MHz.conf | 2 + .../enb.band7.tm1.usrpb210.fdd.5MHz.conf | 2 + .../v2/config/rcc.band7.tm1.if4p5.10MHz.conf | 2 + .../v2/config/rcc.band7.tm1.if4p5.20MHz.conf | 2 + .../v2/config/rcc.band7.tm1.if4p5.5MHz.conf | 2 + ...ru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf | 2 + ...ru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf | 2 + ...rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf | 2 + configuration/bladeRF/enb-band7-5mhz.conf | 2 + openair2/COMMON/rrc_messages_types.h | 3 ++ openair2/ENB_APP/enb_config.c | 16 ++++++ openair2/ENB_APP/enb_paramdef.h | 6 +++ openair2/RRC/LTE/rrc_eNB.c | 54 ++++++++++--------- .../CONF/enb.centos.calisson.conf | 2 + .../CONF/enb.centos.memphis.conf | 2 + .../CONF/enb.centos.nord.conf | 2 + .../CONF/enb.band13.tm1.50PRB.emtc.conf | 2 + .../CONF/enb.band38.tm1.100PRB.usrpx310.conf | 2 + .../CONF/enb.band38.tm1.25PRB.iris030.conf | 2 + .../CONF/enb.band38.tm1.usrpx310.conf | 2 + .../CONF/enb.band42.tm1.25PRB.iris030.conf | 2 + .../CONF/enb.band7.tm1.100PRB.usrpx310.conf | 2 + .../CONF/enb.band7.tm1.25PRB.iris030.conf | 2 + .../enb.band7.tm1.25PRB.usrpb210.replay.conf | 2 + .../enb.band7.tm1.50PRB.usrpb210-d2d.conf | 2 + .../CONF/enb.band7.tm1.50PRB.usrpb210.conf | 2 + ...band7.tm1.50PRB.usrpb210_ue_expansion.conf | 2 + .../CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf | 2 + .../CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf | 2 + .../CONF/rcc.band7.tm1.50PRB.nfapi.conf | 2 + .../CONF/rcc.band7.tm1.if4p5.50PRB.conf | 2 + .../CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf | 2 + 53 files changed, 152 insertions(+), 25 deletions(-) diff --git a/ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf b/ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf index ea8a56e385..e0969fbc31 100644 --- a/ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf +++ b/ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf @@ -360,6 +360,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf index 370697660e..c588bc0c75 100644 --- a/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf index fbbc2f1154..9addb0c830 100644 --- a/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf index f49d860a51..a255e12680 100644 --- a/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf index c119e2f1c0..517c916c85 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf @@ -178,6 +178,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf index a0d3ba6d06..eb8b68b5b0 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf @@ -178,6 +178,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf index 92a6e6f0bc..bdcc201fd9 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf @@ -186,6 +186,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/enb.band7.tm2.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm2.25PRB.usrpb210.conf index b006e04e91..0bcdba99fb 100644 --- a/ci-scripts/conf_files/enb.band7.tm2.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm2.25PRB.usrpb210.conf @@ -181,6 +181,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/lte-fdd-basic-sim.conf b/ci-scripts/conf_files/lte-fdd-basic-sim.conf index cabbed871a..24a2b400e6 100644 --- a/ci-scripts/conf_files/lte-fdd-basic-sim.conf +++ b/ci-scripts/conf_files/lte-fdd-basic-sim.conf @@ -178,6 +178,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/lte-tdd-basic-sim.conf b/ci-scripts/conf_files/lte-tdd-basic-sim.conf index a376f45453..3afdb5df60 100644 --- a/ci-scripts/conf_files/lte-tdd-basic-sim.conf +++ b/ci-scripts/conf_files/lte-tdd-basic-sim.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf index d39f1e0620..2e13ba68a5 100644 --- a/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf @@ -144,6 +144,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf index 0ae17356de..70a034e647 100644 --- a/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf @@ -144,6 +144,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf index c58f05c82f..456d45faf2 100644 --- a/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf @@ -144,6 +144,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf index 6f6aa98788..b842480e5d 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf @@ -181,6 +181,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf index ec7fce3dbf..98a546e8b5 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf @@ -181,6 +181,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf index 4ebbff4bda..2a8506a660 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf @@ -181,6 +181,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf index 52c0593d1b..81fc7eedce 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf @@ -179,6 +179,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf index d99ca88807..7f920e7e38 100644 --- a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf index 86c54a82f7..e5c57ffda5 100644 --- a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf index dad0ab5a23..17a3380567 100644 --- a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf index 369b6184fd..6721504f36 100644 --- a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf index 14ae99c80c..4919ad3117 100644 --- a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf index 9302ac7c58..c26a0ad698 100644 --- a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf index 0ae9e659b4..ff0d3d7a00 100644 --- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf +++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf index 1d22c19ec8..8195b21157 100644 --- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf +++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf index 3f35175ff4..8b172a7d73 100644 --- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf +++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf index 0a6a8cccc6..0d9a243b31 100644 --- a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf +++ b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf @@ -143,6 +143,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf index 7ffdd063a6..ac8591841e 100644 --- a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf +++ b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf @@ -143,6 +143,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf index 409fa49910..93bfc2449f 100644 --- a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf +++ b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf @@ -143,6 +143,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/configuration/bladeRF/enb-band7-5mhz.conf b/configuration/bladeRF/enb-band7-5mhz.conf index 127c865422..df9b1cbc85 100644 --- a/configuration/bladeRF/enb-band7-5mhz.conf +++ b/configuration/bladeRF/enb-band7-5mhz.conf @@ -181,6 +181,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index 64810e644a..cac6056aa2 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -180,6 +180,9 @@ typedef struct RrcConfigurationReq_s { uint8_t mnc_digit_length[PLMN_LIST_MAX_SIZE]; uint8_t num_plmn; + int enable_measurement_reports; + int enable_x2; + uint32_t rrc_inactivity_timer_thres; // for testing, maybe change later paging_drx_t default_drx; diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index db2408a145..cc99ad061e 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -417,6 +417,22 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { RRC_CONFIGURATION_REQ(msg_p).mnc[l]); } + /* measurement reports enabled? */ + if (ENBParamList.paramarray[i][ENB_ENABLE_MEASUREMENT_REPORTS].strptr != NULL && + *(ENBParamList.paramarray[i][ENB_ENABLE_MEASUREMENT_REPORTS].strptr) != NULL && + !strcmp(*(ENBParamList.paramarray[i][ENB_ENABLE_MEASUREMENT_REPORTS].strptr), "yes")) + RRC_CONFIGURATION_REQ (msg_p).enable_measurement_reports = 1; + else + RRC_CONFIGURATION_REQ (msg_p).enable_measurement_reports = 0; + + /* x2 enabled? */ + if (ENBParamList.paramarray[i][ENB_ENABLE_X2].strptr != NULL && + *(ENBParamList.paramarray[i][ENB_ENABLE_X2].strptr) != NULL && + !strcmp(*(ENBParamList.paramarray[i][ENB_ENABLE_X2].strptr), "yes")) + RRC_CONFIGURATION_REQ (msg_p).enable_x2 = 1; + else + RRC_CONFIGURATION_REQ (msg_p).enable_x2 = 0; + // Parse optional physical parameters config_getlist( &CCsParamList,NULL,0,enbpath); LOG_I(RRC,"num component carriers %d \n",CCsParamList.numelt); diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index dff16ff9d7..dd3a5c745b 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -204,6 +204,8 @@ typedef enum { #define ENB_CONFIG_STRING_LOCAL_S_PORTD "local_s_portd" #define ENB_CONFIG_STRING_REMOTE_S_PORTD "remote_s_portd" #define ENB_CONFIG_STRING_NR_CELLID "nr_cellid" +#define ENB_CONFIG_STRING_MEASUREMENT_REPORTS "enable_measurement_reports" +#define ENB_CONFIG_STRING_X2 "enable_x2" /*-----------------------------------------------------------------------------------------------------------------------------------------*/ /* cell configuration parameters */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ @@ -224,6 +226,8 @@ typedef enum { {ENB_CONFIG_STRING_LOCAL_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ {ENB_CONFIG_STRING_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ {ENB_CONFIG_STRING_NR_CELLID, NULL, 0, u64ptr:NULL, defint64val:0, TYPE_UINT64, 0}, \ +{ENB_CONFIG_STRING_MEASUREMENT_REPORTS, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_X2, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ } #define ENB_ENB_ID_IDX 0 #define ENB_CELL_TYPE_IDX 1 @@ -240,6 +244,8 @@ typedef enum { #define ENB_LOCAL_S_PORTD_IDX 12 #define ENB_REMOTE_S_PORTD_IDX 13 #define ENB_NRCELLID_IDX 14 +#define ENB_ENABLE_MEASUREMENT_REPORTS 15 +#define ENB_ENABLE_X2 16 #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} #define ENBPARAMS_CHECK { \ diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 60a9f76a14..4ee71c13be 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -1460,7 +1460,7 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( /* for no gcc warnings */ (void)dedicatedInfoNas; LTE_C_RNTI_t *cba_RNTI = NULL; - int x2_enabled; + int measurements_enabled; uint8_t next_xid = rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id); ue_context_pP->ue_context.Status = RRC_CONNECTED; ue_context_pP->ue_context.ue_rrc_inactivity_timer = 1; // set rrc inactivity when UE goes into RRC_CONNECTED @@ -1872,7 +1872,8 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( dedicatedInfoNASList = NULL; } - x2_enabled = is_x2ap_enabled(); + measurements_enabled = RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_x2 || + RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_measurement_reports; // send LTE_RRCConnectionReconfiguration memset(buffer, 0, RRC_BUF_SIZE); @@ -1887,9 +1888,9 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( //#ifdef EXMIMO_IOT // NULL, NULL, NULL,NULL, //#else - x2_enabled ? (LTE_MeasObjectToAddModList_t *)MeasObj_list : NULL, // MeasObj_list, - x2_enabled ? (LTE_ReportConfigToAddModList_t *)ReportConfig_list : NULL, // ReportConfig_list, - x2_enabled ? (LTE_QuantityConfig_t *)quantityConfig : NULL, //quantityConfig, + measurements_enabled ? (LTE_MeasObjectToAddModList_t *)MeasObj_list : NULL, // MeasObj_list, + measurements_enabled ? (LTE_ReportConfigToAddModList_t *)ReportConfig_list : NULL, // ReportConfig_list, + measurements_enabled ? (LTE_QuantityConfig_t *)quantityConfig : NULL, //quantityConfig, (LTE_MeasIdToAddModList_t *)NULL, //#endif (LTE_MAC_MainConfig_t *)ue_context_pP->ue_context.mac_MainConfig, @@ -2798,7 +2799,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t /* For no gcc warnings */ (void) dedicatedInfoNas; LTE_C_RNTI_t *cba_RNTI = NULL; - int x2_enabled; + int measurements_enabled; uint8_t xid = rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id); //Transaction_id, uint8_t cc_id = ue_context_pP->ue_context.primaryCC_id; LTE_UE_EUTRA_Capability_t *UEcap = ue_context_pP->ue_context.UE_Capability; @@ -3340,7 +3341,8 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t dedicatedInfoNASList = NULL; } - x2_enabled = is_x2ap_enabled(); + measurements_enabled = RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_x2 || + RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_measurement_reports; memset(buffer, 0, RRC_BUF_SIZE); @@ -3352,10 +3354,10 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t (LTE_DRB_ToReleaseList_t *) NULL, // DRB2_list, (struct LTE_SPS_Config *) NULL, // *sps_Config, (struct LTE_PhysicalConfigDedicated *) *physicalConfigDedicated, - x2_enabled ? (LTE_MeasObjectToAddModList_t *) MeasObj_list : NULL, - x2_enabled ? (LTE_ReportConfigToAddModList_t *) ReportConfig_list : NULL, - x2_enabled ? (LTE_QuantityConfig_t *) quantityConfig : NULL, - x2_enabled ? (LTE_MeasIdToAddModList_t *) MeasId_list : NULL, + measurements_enabled ? (LTE_MeasObjectToAddModList_t *) MeasObj_list : NULL, + measurements_enabled ? (LTE_ReportConfigToAddModList_t *) ReportConfig_list : NULL, + measurements_enabled ? (LTE_QuantityConfig_t *) quantityConfig : NULL, + measurements_enabled ? (LTE_MeasIdToAddModList_t *) MeasId_list : NULL, (LTE_MAC_MainConfig_t *) mac_MainConfig, (LTE_MeasGapConfig_t *) NULL, (LTE_MobilityControlInfo_t *) NULL, @@ -3473,7 +3475,7 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt /* for no gcc warnings */ (void)dedicatedInfoNas; LTE_C_RNTI_t *cba_RNTI = NULL; - int x2_enabled; + int measurements_enabled; uint8_t xid = rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id); //Transaction_id, #ifdef CBA //struct PUSCH_CBAConfigDedicated_vlola *pusch_CBAConfigDedicated_vlola; @@ -3843,7 +3845,8 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt dedicatedInfoNASList = NULL; } - x2_enabled = is_x2ap_enabled(); + measurements_enabled = RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_x2 || + RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_measurement_reports; memset(buffer, 0, RRC_BUF_SIZE); size = do_RRCConnectionReconfiguration(ctxt_pP, @@ -3857,10 +3860,10 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt // #ifdef EXMIMO_IOT // NULL, NULL, NULL,NULL, // #else - x2_enabled ? (LTE_MeasObjectToAddModList_t *)MeasObj_list : NULL, - x2_enabled ? (LTE_ReportConfigToAddModList_t *)ReportConfig_list : NULL, - x2_enabled ? (LTE_QuantityConfig_t *)quantityConfig : NULL, - x2_enabled ? (LTE_MeasIdToAddModList_t *)MeasId_list : NULL, + measurements_enabled ? (LTE_MeasObjectToAddModList_t *)MeasObj_list : NULL, + measurements_enabled ? (LTE_ReportConfigToAddModList_t *)ReportConfig_list : NULL, + measurements_enabled ? (LTE_QuantityConfig_t *)quantityConfig : NULL, + measurements_enabled ? (LTE_MeasIdToAddModList_t *)MeasId_list : NULL, // #endif (LTE_MAC_MainConfig_t *)mac_MainConfig, (LTE_MeasGapConfig_t *)NULL, @@ -4108,7 +4111,7 @@ rrc_eNB_process_MeasurementReport( return; /* if X2AP is disabled, do nothing */ - if (!is_x2ap_enabled()) + if (!RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_x2) return; LOG_D(RRC, "A3 event is triggered...\n"); @@ -4498,7 +4501,7 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct /* for no gcc warnings */ (void)dedicatedInfoNas; LTE_C_RNTI_t *cba_RNTI = NULL; - int x2_enabled; + int measurements_enabled; uint8_t xid = rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id); //Transaction_id, #ifdef CBA //struct PUSCH_CBAConfigDedicated_vlola *pusch_CBAConfigDedicated_vlola; @@ -5260,7 +5263,8 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct #endif - x2_enabled = is_x2ap_enabled(); + measurements_enabled = RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_x2 || + RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_measurement_reports; memset(buffer, 0, RRC_BUF_SIZE); char rrc_buf[1000 /* arbitrary, should be big enough, has to be less than size of return buf by a few bits/bytes */]; @@ -5276,10 +5280,10 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct //#ifdef EXMIMO_IOT // NULL, NULL, NULL,NULL, //#else - x2_enabled ? (LTE_MeasObjectToAddModList_t *)MeasObj_list : NULL, - x2_enabled ? (LTE_ReportConfigToAddModList_t *)ReportConfig_list : NULL, - x2_enabled ? (LTE_QuantityConfig_t *)quantityConfig : NULL, - x2_enabled ? (LTE_MeasIdToAddModList_t *)MeasId_list : NULL, + measurements_enabled ? (LTE_MeasObjectToAddModList_t *)MeasObj_list : NULL, + measurements_enabled ? (LTE_ReportConfigToAddModList_t *)ReportConfig_list : NULL, + measurements_enabled ? (LTE_QuantityConfig_t *)quantityConfig : NULL, + measurements_enabled ? (LTE_MeasIdToAddModList_t *)MeasId_list : NULL, //#endif (LTE_MAC_MainConfig_t *)mac_MainConfig, (LTE_MeasGapConfig_t *)NULL, @@ -7458,7 +7462,7 @@ void rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX, VCD_FUNCTION_IN); - if (is_x2ap_enabled()) { + if (RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_x2) { /* send a tick to x2ap */ msg = itti_alloc_new_message(TASK_RRC_ENB, X2AP_SUBFRAME_PROCESS); itti_send_msg_to_task(TASK_X2AP, ctxt_pP->module_id, msg); diff --git a/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.calisson.conf b/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.calisson.conf index df60ee7fa8..d619ab2958 100644 --- a/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.calisson.conf +++ b/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.calisson.conf @@ -37,6 +37,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.memphis.conf b/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.memphis.conf index f5dce0a178..558676e99b 100644 --- a/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.memphis.conf +++ b/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.memphis.conf @@ -49,6 +49,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.nord.conf b/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.nord.conf index d75837ff97..9a4a863419 100644 --- a/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.nord.conf +++ b/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.nord.conf @@ -36,6 +36,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf index 1f5aeaf777..d79f5402d0 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf @@ -360,6 +360,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.100PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.100PRB.usrpx310.conf index 60142d8fe6..f248f515b8 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.100PRB.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.100PRB.usrpx310.conf @@ -142,6 +142,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf index addd70ca71..dee6c298a7 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf @@ -178,6 +178,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpx310.conf index 993acae34e..231581574a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpx310.conf @@ -142,6 +142,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf index 201a0c1839..54c12835ef 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf @@ -178,6 +178,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf index ac417c7e3a..feab0d6926 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf @@ -145,6 +145,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf index 3507906aff..1a0466aad3 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf @@ -178,6 +178,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.replay.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.replay.conf index a683326639..753c2d8b5c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.replay.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.replay.conf @@ -179,6 +179,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210-d2d.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210-d2d.conf index 5e750cb626..20646681d2 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210-d2d.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210-d2d.conf @@ -179,6 +179,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ 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 4b3ac5ffad..3449479256 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 @@ -179,6 +179,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210_ue_expansion.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210_ue_expansion.conf index 497db9a306..8971633ce0 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210_ue_expansion.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210_ue_expansion.conf @@ -146,6 +146,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf index ae2ba73782..d2c1aac31e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf @@ -148,6 +148,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf index f7be9e28d9..7c2c2e0170 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf @@ -148,6 +148,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf index 9d71b10740..723147daeb 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf @@ -179,6 +179,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf index ec20ac3abf..2e62970b3f 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf @@ -148,6 +148,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf index 5e5b191a0f..182568185e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf @@ -147,6 +147,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ From df90d4bc49be4d3980320cc7149eb1a7862e3eab Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 15 May 2019 10:44:25 +0200 Subject: [PATCH 16/28] CI: little scripts improvements -- in python: detection of a build failure, the tab should close nicely -- L2-nFAPi simulator: adding the num-ue-thread option -- Moved the VM destroy stage into the "VM-based test" branch. -- On "slave" job pipeline, moved the XML parsing after the git merge step so new test-cases are nicely taken care of. Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-gitlab | 12 +++--- ci-scripts/Jenkinsfile-tmp-full-ran | 30 +++++++-------- ci-scripts/Jenkinsfile-tmp-ran | 30 +++++++-------- ci-scripts/Jenkinsfile-tmp-ue | 59 ++++++++--------------------- ci-scripts/main.py | 34 ++++++++++++++--- ci-scripts/runTestOnVM.sh | 4 +- 6 files changed, 80 insertions(+), 89 deletions(-) diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index 994e6bedfd..2d89e00174 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -416,6 +416,11 @@ pipeline { } } } + stage ("Destroy all Virtual Machines") { + steps { + sh "./ci-scripts/oai-ci-vm-tool destroy --job-name ${JOB_NAME} --build-id ${BUILD_ID}" + } + } } } stage ("Test MONOLITHIC - FDD - Band 7 - B210") { @@ -576,17 +581,10 @@ pipeline { } } } - stage ("Destroy all Virtual Machines") { - steps { - sh "./ci-scripts/oai-ci-vm-tool destroy --job-name ${JOB_NAME} --build-id ${BUILD_ID}" - } - } } post { always { script { - // Stage destroy may not be run if error in previous stage - sh "./ci-scripts/oai-ci-vm-tool destroy --job-name ${JOB_NAME} --build-id ${BUILD_ID}" emailext attachmentsPattern: '*results*.html', body: '''Hi, diff --git a/ci-scripts/Jenkinsfile-tmp-full-ran b/ci-scripts/Jenkinsfile-tmp-full-ran index 4ade6086e8..500e4ba674 100644 --- a/ci-scripts/Jenkinsfile-tmp-full-ran +++ b/ci-scripts/Jenkinsfile-tmp-full-ran @@ -75,21 +75,6 @@ pipeline { if (params.pythonExecutor != null) { echo "eNB CI executor node : ${pythonExecutor}" } - // If not present picking a default XML file - if (params.pythonTestXmlFile == null) { - // picking default - testXMLFile = 'xml_files/enb_usrpB210_band7_50PRB.xml' - echo "Test XML file(default): ${testXMLFile}" - mainPythonAllXmlFiles += "--XMLTestFile=" + testXMLFile + " " - } else { - String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") - for (xmlFile in myXmlTestSuite) { - if (fileExists("ci-scripts/" + xmlFile)) { - mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " " - echo "Test XML file : ${xmlFile}" - } - } - } // If not present picking a default Stage Name if (params.pipelineTestStageName == null) { // picking default @@ -193,6 +178,21 @@ pipeline { script { dir ('ci-scripts') { echo "\u2705 \u001B[32m${testStageName}\u001B[0m" + // If not present picking a default XML file + if (params.pythonTestXmlFile == null) { + // picking default + testXMLFile = 'xml_files/enb_usrpB210_band7_50PRB.xml' + echo "Test XML file(default): ${testXMLFile}" + mainPythonAllXmlFiles += "--XMLTestFile=" + testXMLFile + " " + } else { + String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") + for (xmlFile in myXmlTestSuite) { + if (fileExists("ci-scripts/" + xmlFile)) { + mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " " + echo "Test XML file : ${xmlFile}" + } + } + } withCredentials([ [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'], [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.UE_Credentials}", usernameVariable: 'UE_Username', passwordVariable: 'UE_Password'], diff --git a/ci-scripts/Jenkinsfile-tmp-ran b/ci-scripts/Jenkinsfile-tmp-ran index 525ceec525..c0a967c627 100644 --- a/ci-scripts/Jenkinsfile-tmp-ran +++ b/ci-scripts/Jenkinsfile-tmp-ran @@ -106,21 +106,6 @@ pipeline { if (params.pythonExecutor != null) { echo "eNB CI executor node : ${pythonExecutor}" } - // If not present picking a default XML file - if (params.pythonTestXmlFile == null) { - // picking default - testXMLFile = 'xml_files/enb_usrpB210_band7_50PRB.xml' - echo "Test XML file(default): ${testXMLFile}" - mainPythonAllXmlFiles += "--XMLTestFile=" + testXMLFile + " " - } else { - String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") - for (xmlFile in myXmlTestSuite) { - if (fileExists("ci-scripts/" + xmlFile)) { - mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " " - echo "Test XML file : ${xmlFile}" - } - } - } // If not present picking a default Stage Name if (params.pipelineTestStageName == null) { // picking default @@ -212,6 +197,21 @@ pipeline { script { dir ('ci-scripts') { echo "\u2705 \u001B[32m${testStageName}\u001B[0m" + // If not present picking a default XML file + if (params.pythonTestXmlFile == null) { + // picking default + testXMLFile = 'xml_files/enb_usrpB210_band7_50PRB.xml' + echo "Test XML file(default): ${testXMLFile}" + mainPythonAllXmlFiles += "--XMLTestFile=" + testXMLFile + " " + } else { + String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") + for (xmlFile in myXmlTestSuite) { + if (fileExists("ci-scripts/" + xmlFile)) { + mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " " + echo "Test XML file : ${xmlFile}" + } + } + } withCredentials([ [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'], [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'], diff --git a/ci-scripts/Jenkinsfile-tmp-ue b/ci-scripts/Jenkinsfile-tmp-ue index 70fe29879f..0464c0374f 100644 --- a/ci-scripts/Jenkinsfile-tmp-ue +++ b/ci-scripts/Jenkinsfile-tmp-ue @@ -66,35 +66,6 @@ pipeline { ansiColor('xterm') lock (ciSmartPhoneResource) } - // the following parameter options are commented out so it shows the ones - // that you SHALL have to run the job. - // You can use them as template - /* - parameters { - //node-test parameters - string(name: 'pythonExecutor', defaultValue: 'nodea', description: 'Node where the pipeline - python scripts will be executed') - string(name: 'pythonTestXmlFile', defaultValue: 'enb_usrpB210_band7_50PRB.xml', description: 'Location of the Test XML to be run') - string(name: 'pipelineTestStageName', defaultValue: 'Test COTS-UE - OAI eNB - LTEBOX EPC', description: 'Naming of the Test Stage') - booleanParam(name: 'pipelineZipsConsoleLog', defaultValue: 'True', description: 'If true, the pipeline script retrieves the job console log, zips it and archives it as artifact') - string(name: 'smartphonesResource', defaultValue: 'CI-Bench-1-Phones', description: 'Lockeable Resource to prevent multiple jobs to run simultaneously with the same resource') - - //eNB parameters - string(name: 'eNB_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of eNB') - credentials(name: 'eNB_Credentials', defaultValue: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', credentialType: "Username with password", required: true, description: 'Credentials for eNB') - string(name: 'eNB_SourceCodePath', defaultValue: '/tmp/CI-enb', description: 'Full path of eNB source code') - - //EPC parameters - string(name: 'EPC_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of EPC') - string(name: 'EPC_Type', defaultValue: 'ltebox', description: 'EPC type: OAI or ltebox') - credentials(name: 'EPC_Credentials', defaultValue: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', credentialType: "Username with password", required: true, description: 'Credentials for EPC') - string(name: 'EPC_SourceCodePath', defaultValue: '/tmp/CI-enb', description: 'Full path of EPC source code') - - //ADB server parameters - string(name: 'ADB_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of ADB server') - credentials(name: 'ADB_Credentials', defaultValue: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', credentialType: "Username with password", required: true, description: 'Credentials for ADB') - } - */ - stages { stage ("Verify Parameters") { steps { @@ -106,21 +77,6 @@ pipeline { if (params.pythonExecutor != null) { echo "eNB CI executor node : ${pythonExecutor}" } - // If not present picking a default XML file - if (params.pythonTestXmlFile == null) { - // picking default - testXMLFile = 'xml_files/enb_usrpB210_band7_50PRB.xml' - echo "Test XML file(default): ${testXMLFile}" - mainPythonAllXmlFiles += "--XMLTestFile=" + testXMLFile + " " - } else { - String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") - for (xmlFile in myXmlTestSuite) { - if (fileExists("ci-scripts/" + xmlFile)) { - mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " " - echo "Test XML file : ${xmlFile}" - } - } - } // If not present picking a default Stage Name if (params.pipelineTestStageName == null) { // picking default @@ -212,6 +168,21 @@ pipeline { script { dir ('ci-scripts') { echo "\u2705 \u001B[32m${testStageName}\u001B[0m" + // If not present picking a default XML file + if (params.pythonTestXmlFile == null) { + // picking default + testXMLFile = 'xml_files/ue_band20_build.xml' + echo "Test XML file(default): ${testXMLFile}" + mainPythonAllXmlFiles += "--XMLTestFile=" + testXMLFile + " " + } else { + String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") + for (xmlFile in myXmlTestSuite) { + if (fileExists("ci-scripts/" + xmlFile)) { + mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " " + echo "Test XML file : ${xmlFile}" + } + } + } withCredentials([ [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.UE_Credentials}", usernameVariable: 'UE_Username', passwordVariable: 'UE_Password'], [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ADB_Credentials}", usernameVariable: 'ADB_Username', passwordVariable: 'ADB_Password'] diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 3732655898..9fb546f370 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -335,12 +335,24 @@ class SSHConnection(): self.command('mkdir -p log', '\$', 5) self.command('chmod 777 log', '\$', 5) # no need to remove in log (git clean did the trick) - self.command('stdbuf -o0 ./build_oai ' + self.Build_eNB_args + ' 2>&1 | stdbuf -o0 tee compile_oai_enb.log', 'Bypassing the Tests', 600) + self.command('stdbuf -o0 ./build_oai ' + self.Build_eNB_args + ' 2>&1 | stdbuf -o0 tee compile_oai_enb.log', 'Bypassing the Tests|build have failed', 600) + self.command('ls lte_build_oai/build', '\$', 3) + self.command('ls lte_build_oai/build', '\$', 3) + buildStatus = True + result = re.search('lte-softmodem', str(self.ssh.before)) + if result is None: + buildStatus = False self.command('mkdir -p build_log_' + self.testCase_id, '\$', 5) self.command('mv log/* ' + 'build_log_' + self.testCase_id, '\$', 5) self.command('mv compile_oai_enb.log ' + 'build_log_' + self.testCase_id, '\$', 5) self.close() - self.CreateHtmlTestRow(self.Build_eNB_args, 'OK', ALL_PROCESSES_OK) + if buildStatus: + self.CreateHtmlTestRow(self.Build_eNB_args, 'OK', ALL_PROCESSES_OK) + else: + logging.error('\u001B[1m Building OAI eNB Failed\u001B[0m') + self.CreateHtmlTestRow(self.Build_eNB_args, 'KO', ALL_PROCESSES_OK) + self.CreateHtmlTabFooter(False) + sys.exit(1) def BuildOAIUE(self): if self.UEIPAddress == '' or self.eNBRepository == '' or self.eNBBranch == '' or self.UEUserName == '' or self.UEPassword == '' or self.UESourceCodePath == '': @@ -371,13 +383,24 @@ class SSHConnection(): self.command('mkdir -p log', '\$', 5) self.command('chmod 777 log', '\$', 5) # no need to remove in log (git clean did the trick) - self.command('stdbuf -o0 ./build_oai ' + self.Build_OAI_UE_args + ' 2>&1 | stdbuf -o0 tee compile_oai_ue.log', 'Bypassing the Tests', 600) + self.command('stdbuf -o0 ./build_oai ' + self.Build_OAI_UE_args + ' 2>&1 | stdbuf -o0 tee compile_oai_ue.log', 'Bypassing the Tests|build have failed', 600) + self.command('ls lte_build_oai/build', '\$', 3) + self.command('ls lte_build_oai/build', '\$', 3) + buildStatus = True + result = re.search('lte-uesoftmodem', str(self.ssh.before)) + if result is None: + buildStatus = False self.command('mkdir -p build_log_' + self.testCase_id, '\$', 5) self.command('mv log/* ' + 'build_log_' + self.testCase_id, '\$', 5) self.command('mv compile_oai_ue.log ' + 'build_log_' + self.testCase_id, '\$', 5) self.close() - self.CreateHtmlTestRow(self.Build_OAI_UE_args, 'OK', ALL_PROCESSES_OK, 'OAI UE') - + if buildStatus: + self.CreateHtmlTestRow(self.Build_OAI_UE_args, 'OK', ALL_PROCESSES_OK, 'OAI UE') + else: + logging.error('\u001B[1m Building OAI UE Failed\u001B[0m') + self.CreateHtmlTestRow(self.Build_OAI_UE_args, 'KO', ALL_PROCESSES_OK, 'OAI UE') + self.CreateHtmlTabFooter(False) + sys.exit(1) def InitializeHSS(self): if self.EPCIPAddress == '' or self.EPCUserName == '' or self.EPCPassword == '' or self.EPCSourceCodePath == '' or self.EPCType == '': @@ -2660,7 +2683,6 @@ class SSHConnection(): else: self.command('cd ' + self.EPCSourceCodePath, '\$', 5) self.command('cd scripts', '\$', 5) - self.command('rm -f ./kill_hss.sh', '\$', 5) self.command('echo ' + self.EPCPassword + ' | sudo -S daemon --name=simulated_hss --stop', '\$', 5) time.sleep(1) self.command('echo ' + self.EPCPassword + ' | sudo -S killall --signal SIGKILL hss_sim', '\$', 5) diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index 4ff5183106..4362ce7077 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -837,9 +837,9 @@ function start_l2_sim_ue { echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 if [ $LOC_S1_CONFIGURATION -eq 0 ] then - echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --nokrnmod 1 --log_config.global_log_options level,nocolor --noS1\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --nums_ue_thread $LOC_NB_UES --nokrnmod 1 --log_config.global_log_options level,nocolor --noS1\" > ./my-lte-softmodem-run.sh " >> $1 else - echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --nokrnmod 1 --log_config.global_log_options level,nocolor \" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --nums_ue_thread $LOC_NB_UES --nokrnmod 1 --log_config.global_log_options level,nocolor \" > ./my-lte-softmodem-run.sh " >> $1 fi echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1 echo "cat ./my-lte-softmodem-run.sh" >> $1 From e19c0ab8511034510aa37702a92899950ed49521 Mon Sep 17 00:00:00 2001 From: frtabu Date: Mon, 29 Apr 2019 18:33:59 +0200 Subject: [PATCH 17/28] Remove deprecated build options, now available as config options: noS1, basic_simulator. Remove DISABLE_LOG_X macros, disabling logs now available via disabling the T_TRACER --- cmake_targets/build_oai | 7 ++++--- openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 5a0a8ed9b5..cafe8d5f6d 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -154,11 +154,12 @@ Options Build MSC tracing utility, specify --msc on command line to start it (eNB and UE) --usrp-recplay Build for I/Q record-playback modes + Usage (first build): - NI/ETTUS B201 + COTS UE : ./build_oai -I --eNB -x --install-system-files -w USRP + NI/ETTUS B201 + COTS UE : ./build_oai -I --eNB --install-system-files -w USRP Usage (Regular): - Eurecom EXMIMO + OAI ENB : ./build_oai --eNB -x - NI/ETTUS B201 + OAI ENB : ./build_oai --eNB -x -w USRP" + Eurecom EXMIMO + OAI ENB : ./build_oai --eNB + NI/ETTUS B201 + OAI ENB : ./build_oai --eNB -w USRP" } diff --git a/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c b/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c index a3d63ea09b..ce2e8b3ed0 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c @@ -50,6 +50,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { uint8_t l,pbch_decoded,frame_mod4,pbch_tx_ant,dummy; LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; char phich_resource[6]; + LOG_D(PHY,"[UE%d] Initial sync: starting PBCH detection (rx_offset %d)\n",ue->Mod_id, ue->rx_offset); @@ -94,6 +95,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { 0); } + LOG_D(PHY,"[UE %d] RX RSSI %d dBm, digital (%d, %d) dB, linear (%d, %d), avg rx power %d dB (%d lin), RX gain %d dB\n", ue->Mod_id, ue->measurements.rx_rssi_dBm[0] - ((ue->frame_parms.nb_antennas_rx==2) ? 3 : 0), @@ -104,6 +106,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ue->measurements.rx_power_avg_dB[0], ue->measurements.rx_power_avg[0], ue->rx_total_gain_dB); + LOG_D(PHY,"[UE %d] N0 %d dBm digital (%d, %d) dB, linear (%d, %d), avg noise power %d dB (%d lin)\n", ue->Mod_id, ue->measurements.n0_power_tot_dBm, @@ -113,6 +116,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ue->measurements.n0_power[1], ue->measurements.n0_power_avg_dB, ue->measurements.n0_power_avg); + pbch_decoded = 0; for (frame_mod4=0; frame_mod4<4; frame_mod4++) { @@ -222,6 +226,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ue->proc.proc_rxtx[i].frame_tx = ue->proc.proc_rxtx[0].frame_rx; } + LOG_D(PHY,"[UE%d] Initial sync: pbch decoded sucessfully p %d, tx_ant %d, frame %d, N_RB_DL %d, phich_duration %d, phich_resource %s!\n", ue->Mod_id, frame_parms->nb_antenna_ports_eNB, @@ -268,7 +273,9 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { else sync_pos2 = sync_pos + FRAME_LENGTH_COMPLEX_SAMPLES - frame_parms->nb_prefix_samples; + LOG_D(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id); + // SSS detection // PSS is hypothesized in last symbol of first slot in Frame sync_pos_slot = (frame_parms->samples_per_tti>>1) - frame_parms->ofdm_symbol_size - frame_parms->nb_prefix_samples; @@ -291,7 +298,9 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); ret = pbch_detection(ue,mode); // LOG_M("rxdata2.m","rxd2",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); + LOG_D(PHY,"FDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", + frame_parms->Nid_cell,metric_fdd_ncp,phase_fdd_ncp,flip_fdd_ncp,ret); } else { LOG_D(PHY,"FDD Normal prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot); @@ -369,7 +378,9 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); ret = pbch_detection(ue,mode); // LOG_M("rxdata4.m","rxd4",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); + LOG_D(PHY,"TDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", + frame_parms->Nid_cell,metric_tdd_ncp,phase_tdd_ncp,flip_tdd_ncp,ret); if (ret==-1) { @@ -403,7 +414,9 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); ret = pbch_detection(ue,mode); // LOG_M("rxdata5.m","rxd5",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); + LOG_D(PHY,"TDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", + frame_parms->Nid_cell,metric_tdd_ecp,phase_tdd_ecp,flip_tdd_ecp,ret); } } @@ -466,6 +479,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { metric_tdd_ecp,Nid_cell_tdd_ecp);*/ LOG_D(PHY,"[UE%d] Initial sync : Estimated Nid_cell %d, Frame_type %d\n",ue->Mod_id, frame_parms->Nid_cell,frame_parms->frame_type); + ue->UE_mode[0] = NOT_SYNCHED; ue->pbch_vars[0]->pdu_errors_last=ue->pbch_vars[0]->pdu_errors; ue->pbch_vars[0]->pdu_errors++; @@ -490,6 +504,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { // we might add a low-pass filter here later ue->measurements.rx_power_avg[0] = rx_power/frame_parms->nb_antennas_rx; ue->measurements.rx_power_avg_dB[0] = dB_fixed(ue->measurements.rx_power_avg[0]); + LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",ue->Mod_id,ue->measurements.rx_power_avg_dB[0] ); if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) @@ -497,6 +512,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { } else { if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0); + } return ret; From 83c2d32883ad3b2e40570fe5578eeedb8a0a7d1a Mon Sep 17 00:00:00 2001 From: frtabu Date: Wed, 15 May 2019 13:28:26 +0200 Subject: [PATCH 18/28] fix crash when attempting to use -d legacy softscope. Doesn't fix all problems but at least no crash and ready for anybody to fix diplay problems --- cmake_targets/CMakeLists.txt | 4 ++-- openair1/PHY/TOOLS/lte_enb_scope.c | 6 +++--- openair1/PHY/TOOLS/lte_phy_scope.c | 10 +++++----- openair1/PHY/TOOLS/lte_ue_scope.c | 6 +++--- targets/RT/USER/lte-softmodem.c | 5 +++-- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index ededd23446..5c9ab6d99d 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -2005,8 +2005,8 @@ set(XFORMS_LIBRARIES "forms") set (XFORMSINTERFACE_SOURCE ${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c ) -add_library(enbscope MODULE ${XFORMS_SOURCE} ${XFORMS_ENB_SOURCE}) -add_library(uescope MODULE ${XFORMS_SOURCE} ${XFORMS_UE_SOURCE}) +add_library(enbscope MODULE ${XFORMS_SOURCE} ${XFORMS_SOURCE_SOFTMODEM} ${XFORMS_ENB_SOURCE}) +add_library(uescope MODULE ${XFORMS_SOURCE} ${XFORMS_SOURCE_SOFTMODEM} ${XFORMS_UE_SOURCE}) target_link_libraries(enbscope ${XFORMS_LIBRARIES}) target_link_libraries(uescope ${XFORMS_LIBRARIES}) diff --git a/openair1/PHY/TOOLS/lte_enb_scope.c b/openair1/PHY/TOOLS/lte_enb_scope.c index 2918a6aa5c..e251c63898 100644 --- a/openair1/PHY/TOOLS/lte_enb_scope.c +++ b/openair1/PHY/TOOLS/lte_enb_scope.c @@ -120,9 +120,9 @@ static void *scope_thread_eNB(void *arg) { int enbscope_autoinit(void) { int UE_id; printf("XFORMS\n"); - int argc=0; - char *argv=NULL; - fl_initialize (&argc, &argv, NULL, 0, 0); + int argc=config_get_if()->argc; + char **argv=config_get_if()->argv; + fl_initialize (&argc, argv, NULL, 0, 0); form_stats_l2 = create_form_stats_form(); fl_show_form (form_stats_l2->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "l2 stats"); form_stats = create_form_stats_form(); diff --git a/openair1/PHY/TOOLS/lte_phy_scope.c b/openair1/PHY/TOOLS/lte_phy_scope.c index 000eb48615..3ac1676983 100644 --- a/openair1/PHY/TOOLS/lte_phy_scope.c +++ b/openair1/PHY/TOOLS/lte_phy_scope.c @@ -154,7 +154,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, PHY_VARS_eNB *phy_vars_enb, int UE_id) { - int eNB_id = 0; + int i,i2,arx,atx,ind,k; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_enb->frame_parms; int nsymb_ce = 12*frame_parms->N_RB_UL*frame_parms->symbols_per_tti; @@ -197,10 +197,10 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, llr = (float*) calloc(coded_bits_per_codeword,sizeof(float)); // init to zero bit = malloc(coded_bits_per_codeword*sizeof(float)); - rxsig_t = (int16_t**) phy_vars_enb->common_vars.rxdata[eNB_id]; + rxsig_t = (int16_t**) phy_vars_enb->RU_list[0]->common.rxdata; //chest_t = (int16_t**) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id]; - chest_t = (int16_t**) phy_vars_enb->srs_vars[UE_id].srs_ch_estimates[eNB_id]; - chest_f = (int16_t**) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates[eNB_id]; + chest_t = (int16_t**) phy_vars_enb->srs_vars[UE_id].srs_ch_estimates; + chest_f = (int16_t**) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates; pusch_llr = (int16_t*) phy_vars_enb->pusch_vars[UE_id]->llr; pusch_comp = (int32_t*) phy_vars_enb->pusch_vars[UE_id]->rxdataF_comp[0]; pucch1_comp = (int32_t*) phy_vars_enb->pucch1_stats[UE_id]; @@ -209,7 +209,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, // Received signal in time domain of receive antenna 0 if (rxsig_t != NULL) { - if (rxsig_t[0] != NULL) { + if (rxsig_t[0] != NULL ) { for (i=0; iargc; + char **argv=config_get_if()->argv; printf("XFORMS\n"); - fl_initialize (&argc, &argv, NULL, 0, 0); + fl_initialize (&argc, argv, NULL, 0, 0); form_stats = create_form_stats_form(); fl_show_form (form_stats->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "stats"); UE_id = 0; diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 998fb4ecfa..a117c6b9c1 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -630,8 +630,7 @@ int main( int argc, char **argv ) { pthread_cond_init(&sync_cond,NULL); pthread_mutex_init(&sync_mutex, NULL); - if(IS_SOFTMODEM_DOFORMS) - load_softscope("enb"); + rt_sleep_ns(10*100000000ULL); @@ -718,6 +717,8 @@ int main( int argc, char **argv ) { fflush(stderr); // end of CI modifications //getchar(); + if(IS_SOFTMODEM_DOFORMS) + load_softscope("enb"); itti_wait_tasks_end(); oai_exit=1; LOG_I(ENB_APP,"oai_exit=%d\n",oai_exit); From f47f3f65ba528acaad1000bb3b3ec3ce92fcd186 Mon Sep 17 00:00:00 2001 From: frtabu Date: Wed, 15 May 2019 18:20:16 +0200 Subject: [PATCH 19/28] More build_oai cleanup, add a generic option "--build-lib" to build optional shared libraries (telnet server for example) --- cmake_targets/build_oai | 65 ++++++++++++++++------------------------- doc/BUILD.md | 10 +++---- 2 files changed, 29 insertions(+), 46 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index cafe8d5f6d..a7ceb48758 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -67,7 +67,7 @@ UE_DEBUG_TRACE="False" UE_TIMING_TRACE="False" USRP_REC_PLAY="False" BUILD_ECLIPSE=0 - +OPTIONAL_LIBRARIES="telnetsrv enbscope uescope msc" trap handle_ctrl_c INT function print_help() { @@ -119,8 +119,6 @@ Options runs only specified test cases specified here. This flag is only valid with -s -V | --vcd Adds a debgging facility to the binary files: GUI with major internal synchronization events --x | --xforms - Adds a software oscilloscope feature to the produced binaries. --install-system-files Install OpenArInterface required files in Linux system (will ask root password) @@ -148,10 +146,8 @@ Options Enable traces for timing --build-eclipse Build eclipse project files. Paths are auto corrected by fixprj.sh ---build-telnet - Build telnet server, specify --telnetsrv on command line to start it (eNB only) ---build-msc - Build MSC tracing utility, specify --msc on command line to start it (eNB and UE) +--build-lib + Build optional shared library, can be one or several of $OPTIONAL_LIBRARIES --usrp-recplay Build for I/Q record-playback modes @@ -322,14 +318,20 @@ function main() { CMAKE_CMD="$CMAKE_CMD"' -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE -G"Eclipse CDT4 - Unix Makefiles"' echo_info "Enabling build eclipse project support" shift 1;; - --build-telnetsrv) - BUILD_TELNETSRV=1 - echo_info "Build embedded telnet server" - shift ;; - --build-msc) - MSC_GEN=1 - echo_info "Build MSC tracing utility" - shift ;; + --build-lib) + BUILD_OPTLIB="" + for alib in $2 ; do + for oklib in $OPTIONAL_LIBRARIES ; do + if [ "$alib" = "$oklib" ] ; then + BUILD_OPTLIB="$BUILD_OPTLIB $alib" + echo_info "Enabling build of lib${alib}.so" + fi + done + done + if [ "${BUILD_OPTLIB## }" != "$2" ] ; then + echo_fatal "Unknown optional library in $2, valid libraries are $OPTIONAL_LIBRARIES" + fi + shift 2;; --usrp-recplay) USRP_REC_PLAY="True" echo_info "Enabling USRP record playback mode" @@ -642,34 +644,17 @@ function main() { fi cp $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 $dbin fi - - # Telnet server compilation + # optional libraries ##################### - if [ "$BUILD_TELNETSRV" = "1" ] ; then - compilations \ - $lte_build_dir telnetsrv \ - libtelnetsrv.so $dbin/libtelnetsrv.so + if [ ! -z "$BUILD_OPTLIB" ] ; then + for oklib in $BUILD_OPTLIB ; do + compilations \ + $lte_build_dir $oklib \ + lib${oklib}.so $dbin/lib${oklib}.so + done fi - # msc library compilation - ##################### - if [ "$MSC_GEN" = "1" ] ; then - compilations \ - $lte_build_dir msc \ - libmsc.so $dbin/libmsc.so - - fi - # softsope compilations - ##################### - if [ "$XFORMS" = "1" ] ; then - compilations \ - $lte_build_dir enbscope \ - libenbscope.so $dbin/libenbscope.so - compilations \ - $lte_build_dir uescope \ - libuescope.so $dbin/libuescope.so - - fi + # build RF device and transport protocol libraries ##################################### if [ "$eNB" = "1" -o "$UE" = "1" ] ; then diff --git a/doc/BUILD.md b/doc/BUILD.md index 3e312a2eab..094900daac 100644 --- a/doc/BUILD.md +++ b/doc/BUILD.md @@ -70,13 +70,13 @@ After completing the build, the binaries are available in the `cmake_targets/lte ## Telnet Server -The telnet server can be built with the --build-telnet option, after building the softmodem or while building it. +The telnet server can be built with the `--build-lib telnetsrv` option, after building the softmodem or while building it. -`./build_oai -I -w USRP --eNB --UE --build-telnetsrv` +`./build_oai -I -w USRP --eNB --UE --build-lib telnetsrv` or -`./build_oai --build-telnetsrv` +`./build_oai --build-lib telnetsrv` ## USRP record player @@ -105,13 +105,11 @@ The USRP record player today needs a specific build. Work to make it available a | --eNB | maintained and tested in CI | build `lte-softmodem` the LTE eNodeB | | --UE | maintained and tested in CI | build `lte-uesoftmodem` the LTE UE | | --usrp-recplay | maintained | build with support for the record player. Implementation will be soon reviewed to switch to a run-time option. | -| --build-telnet | maintained | build the telnet server shared library, which can then be loaded at run time via the --telnetsrv command line option. | -| --build-msc | unknown | build the msc shared library, which can then be loaded at run time via the --msc command line option. msc is a tracing utility which status is unknown. | +| --build-lib | maintained | build optional shared library(ies), which can then be loaded at run time via command line option. Use the --help option to get the list of supported optional libraries. | | --UE-conf-nvram | | | | --UE-gen-nvram | | | | -r | unknown, to be removed | specifies which 3GPP release to build for. Only the default (today rel14) is tested in CI and it is likely that future oai release will remove this option | | -V | deprecated | Used to build with support for synchronization diagram utility. This is now available via the T-Tracer and is included if T-Tracer is not disabled. | -| -x | deprecated | Used to build with support for embedded signal analyzer. This is now available via the T-Tracer and is included if T-Tracer is not disabled. | | --build-doxygen | unknown | build doxygen documentation, many oai source files do not include doxygen comments | | --disable-deadline --enable-deadline --disable-cpu-affinity | deprecated | These options were used to activate or de-activate specific code depending on the choice of a specific linux scheduling mode. This has not been tested for a while and should be implemented as configuration options | | --disable-T-Tracer | maintained, to be tested | Remove T_Tracer and console LOG messages except error messages. | From 03ba3b7611265fb5ce45f8efec2c31e581ec76c9 Mon Sep 17 00:00:00 2001 From: frtabu Date: Wed, 15 May 2019 19:24:51 +0200 Subject: [PATCH 20/28] update telnet server documentation (build procedure modification, add measur command) # Please enter the commit message for your changes. Lines starting --- common/utils/telnetsrv/DOC/telnetmeasur.md | 54 ++++++++++++++++++++++ common/utils/telnetsrv/DOC/telnetusage.md | 3 +- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 common/utils/telnetsrv/DOC/telnetmeasur.md diff --git a/common/utils/telnetsrv/DOC/telnetmeasur.md b/common/utils/telnetsrv/DOC/telnetmeasur.md new file mode 100644 index 0000000000..bafb876929 --- /dev/null +++ b/common/utils/telnetsrv/DOC/telnetmeasur.md @@ -0,0 +1,54 @@ +measur command can be used to get cpu usage or signal processing statistics from a running eNB instance. + + +Measurments can be displayed by groups, the list of available groups can be retrieved using the `measur show groups` command. +```bash +softmodem> measur show groups + name type +00 enb ltestats +01 enbues ltestats +02 rlc ltestats +03 phycpu cpustats +04 maccpu cpustats +05 pdcpcpu cpustats +softmodem> +``` +By default the oai softmodem doesn't compute cpu usage measurments, a specific command allows to enable them. +```bash +softmodem> measur cpustats enable +softmodem> measur show phycpu +--------------------------------- cpu (4 GHz) measurements: PHY (cpustats enabled) --------------------------------- +00 phy_proc_tx: 40.217 us; 178 | 01 phy_proc_rx: 0.000 us; 0 | +02 rx_prach: 40.123 us; 9 | 03 ofdm_mod: 0.000 us; 0 | +04 dlsch_common_and_dci: 39.311 us; 178 | 05 dlsch_ue_specific: 0.878 us; 178 | +06 dlsch_encoding: 5.667 us; 11 | 07 dlsch_modulation: 5.398 us; 11 | +08 dlsch_scrambling: 1.398 us; 11 | 09 dlsch_rate_matching: 1.367 us; 11 | +10 dlsch_turbo_encod_prep: 0.000 us; 0 | 11 dlsch_turbo_encod_segm: 0.000 us; 0 | +12 dlsch_turbo_encod: 2.408 us; 11 | 13 dlsch_turbo_encod_waiting: 0.000 us; 0 | +14 dlsch_turbo_encod_signal: 0.000 us; 0 | 15 dlsch_turbo_encod_main: 0.000 us; 0 | +16 dlsch_turbo_encod_wakeup0: 0.000 us; 0 | 17 dlsch_turbo_encod_wakeup1: 0.000 us; 0 | +18 dlsch_interleaving: 0.503 us; 11 | 19 rx_dft: 0.000 us; 0 | +20 ulsch_channel_estimation: 0.000 us; 0 | 21 ulsch_freq_offset_estimation: 0.000 us; 0 | +22 ulsch_decoding: 0.000 us; 0 | 23 ulsch_demodulation: 0.000 us; 0 | +24 ulsch_rate_unmatching: 0.000 us; 0 | 25 ulsch_turbo_decoding: 0.000 us; 0 | +26 ulsch_deinterleaving: 0.000 us; 0 | 27 ulsch_demultiplexing: 0.000 us; 0 | +softmodem> measur cpustats disable +``` + +signal processing statistics are always available. +```bash +softmodem> measur show enb +--------------------------------- eNB 0 mac stats CC 0 frame 68 --------------------------------- + total_num_bcch_pdu = 44 bcch_buffer = 17 total_bcch_buffer = 937 + bcch_mcs = 2 total_num_ccch_pdu = 0 ccch_buffer = 0 + total_ccch_buffer = 0 ccch_mcs = 0 total_num_pcch_pdu = 0 + pcch_buffer = 0 total_pcch_buffer = 0 pcch_mcs = 0 + num_dlactive_UEs = 0 available_prbs = 25 total_available_prbs = 16924 + available_ncces = 0 dlsch_bitrate = 0 dlsch_bytes_tx = 0 + dlsch_pdus_tx = 0 total_dlsch_bitrate = 0 total_dlsch_bytes_tx = 0 + total_dlsch_pdus_tx = 0 ulsch_bitrate = 0 ulsch_bytes_rx = 0 + ulsch_pdus_rx = 0 total_ulsch_bitrate = 0 total_ulsch_bytes_rx = 0 + total_ulsch_pdus_rx = 0 sched_decisions = 0 missed_deadlines = 0 +``` +[oai telnetserver home](telnetsrv.md) +[oai telnetserver usage home](telnetusage.md) diff --git a/common/utils/telnetsrv/DOC/telnetusage.md b/common/utils/telnetsrv/DOC/telnetusage.md index 0356143226..8326155a6a 100644 --- a/common/utils/telnetsrv/DOC/telnetusage.md +++ b/common/utils/telnetsrv/DOC/telnetusage.md @@ -5,7 +5,7 @@ By default the embedded telnet server, which is implemented in a shared library, cd \/openairinterface5g source oaienv cd cmake_targets - ./build_oai --build-telnetsrv + ./build_oai --build-lib telnetsrv ``` This will create the `libtelnetsrv.so` file in the `targets/bin` and `cmake_targets/lte_build_oai/build` sub directories of the oai repository. @@ -23,6 +23,7 @@ Below are examples of telnet sessions: * [using the loop command](telnetloop.md) * [loader command](telnetloader.md) * [log command](telnetlog.md) +* [measur command](telnetmeasur.md) # telnet server parameters The telnet server is using the [oai configuration module](Config/Rtusage). Telnet parameters must be specified in the `telnetsrv` section. Some parameters can be modified via the telnet telnet server command, as specified in the last column of the following table. From aceb3a83ea565bff52333b5fa8f1eeeaf1134e8e Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 16 May 2019 15:54:03 +0200 Subject: [PATCH 21/28] Hack to break infinite loop when UE is released during RRC inactivity timeout Signed-off-by: Raphael Defosseux --- openair2/RRC/LTE/rrc_eNB_S1AP.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/openair2/RRC/LTE/rrc_eNB_S1AP.c b/openair2/RRC/LTE/rrc_eNB_S1AP.c index b26e2c1cb0..6357bcfc64 100644 --- a/openair2/RRC/LTE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LTE/rrc_eNB_S1AP.c @@ -257,23 +257,28 @@ rrc_eNB_S1AP_get_ue_ids( } if (ue_desc_p != NULL) { - result = rrc_eNB_S1AP_get_ue_ids(rrc_instance_pP, ue_desc_p->ue_initial_id, eNB_ue_s1ap_id); + if (ue_desc_p->ue_initial_id != UE_INITIAL_ID_INVALID) { + result = rrc_eNB_S1AP_get_ue_ids(rrc_instance_pP, ue_desc_p->ue_initial_id, eNB_ue_s1ap_id); - if (result != NULL) { - ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ENB_INSTANCE_TO_MODULE_ID(instance)], result->ue_rnti); + if (result != NULL) { + ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ENB_INSTANCE_TO_MODULE_ID(instance)], result->ue_rnti); - if ((ue_context_p != NULL) && (ue_context_p->ue_context.eNB_ue_s1ap_id == 0)) { - ue_context_p->ue_context.eNB_ue_s1ap_id = eNB_ue_s1ap_id; - } else { - LOG_E(RRC, "[eNB %ld] Incoherence between RRC context and S1AP context (%d != %d) for UE RNTI %d or UE RRC context doesn't exist\n", - rrc_instance_pP - RC.rrc[0], - (ue_context_p==NULL)?99999:ue_context_p->ue_context.eNB_ue_s1ap_id, - eNB_ue_s1ap_id, - result->ue_rnti); + if ((ue_context_p != NULL) && (ue_context_p->ue_context.eNB_ue_s1ap_id == 0)) { + ue_context_p->ue_context.eNB_ue_s1ap_id = eNB_ue_s1ap_id; + } else { + LOG_E(RRC, "[eNB %ld] Incoherence between RRC context and S1AP context (%d != %d) for UE RNTI %d or UE RRC context doesn't exist\n", + rrc_instance_pP - RC.rrc[0], + (ue_context_p==NULL)?99999:ue_context_p->ue_context.eNB_ue_s1ap_id, + eNB_ue_s1ap_id, + result->ue_rnti); + } } + } else { + LOG_E(S1AP, "[eNB %ld] S1AP context found but ue_initial_id is invalid (0)\n", rrc_instance_pP - RC.rrc[0]); + return NULL; } } else { - LOG_E(S1AP, "[eNB %ld] In hashtable_get, couldn't find in s1ap_id2_s1ap_ids eNB_ue_s1ap_id %"PRIu32", even when looking at S1AP context\n", + LOG_E(S1AP, "[eNB %ld] In hashtable_get, couldn't find in s1ap_id2_s1ap_ids eNB_ue_s1ap_id %"PRIu32", because ue_initial_id is invalid in S1AP context\n", rrc_instance_pP - RC.rrc[0], eNB_ue_s1ap_id); return NULL; From cba1659c1d31b4e5a09b9cb868b9a2b267032dd8 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 16 May 2019 16:21:46 +0200 Subject: [PATCH 22/28] CI: fix the formatting on build HTML report for basic-sim Signed-off-by: Raphael Defosseux --- ci-scripts/reportBuildLocally.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ci-scripts/reportBuildLocally.sh b/ci-scripts/reportBuildLocally.sh index b0709db15a..04ec5d83e6 100755 --- a/ci-scripts/reportBuildLocally.sh +++ b/ci-scripts/reportBuildLocally.sh @@ -566,9 +566,11 @@ function report_build { summary_table_footer summary_table_header "OAI Build basic simulator option" ./archives/basic_sim - summary_table_row "Basic Simulator eNb - Release 14" ./archives/basic_sim/basic_simulator_enb.txt "Built target lte-softmodem" ./basic_sim_row1.html - summary_table_row "Basic Simulator UE - Release 14" ./archives/basic_sim/basic_simulator_ue.txt "Built target lte-uesoftmodem" ./basic_sim_row2.html + summary_table_row "LTE SoftModem - Release 14" ./archives/basic_sim/lte-softmodem.Rel14.txt "Built target lte-softmodem" ./basic_sim_row1.html + summary_table_row "LTE UE SoftModem - Release 14" ./archives/basic_sim/lte-uesoftmodem.Rel14.txt "Built target lte-uesoftmodem" ./basic_sim_row2.htm summary_table_row "Conf 2 UE data - Release 14" ./archives/basic_sim/conf2uedata.Rel14.txt "Built target conf2uedata" ./basic_sim_row3.html + summary_table_row "RB Tool - Release 14" ./archives/basic_sim/rb_tool.Rel14.txt "Built target rb_tool" ./basic_sim_row4.html + summary_table_row "NASMESH - Release 14" ./archives/basic_sim/nasmesh.Rel14.txt "Built target nasmesh" ./basic_sim_row5.html summary_table_footer summary_table_header "OAI Build Physical simulators option" ./archives/phy_sim @@ -644,7 +646,7 @@ function report_build { cat $DETAILS_TABLE >> ./build_results.html done fi - if [ -f ./basic_sim_row1.html ] || [ -f ./basic_sim_row2.html ] || [ -f ./basic_sim_row3.html ] + if [ -f ./basic_sim_row1.html ] || [ -f ./basic_sim_row2.html ] || [ -f ./basic_sim_row3.html ] || [ -f ./basic_sim_row4.html ] || [ -f ./basic_sim_row5.html ] then for DETAILS_TABLE in `ls ./basic_sim_row*.html` do From 1efbfa530425c9ec304ddf1b46b1dc2762fd5b40 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 20 May 2019 11:26:06 +0200 Subject: [PATCH 23/28] bugfix: fix UE realtime bug When pushing traffic with iperf the UE was crashing. The argument passed to pthread_mutex_timedlock is absolute time based on the CLOCK_REALTIME timer, not relative time. That seems to be the root cause of the bug. (That there is a timeout is another story.) This commit uses absolute value. Also we separate cases between IS_SOFTMODEM_BASICSIM / IS_SOFTMODEM_RFSIM and standard realtime UE. In the 'sim' modes we don't care about timeout and just call pthread_mutex_lock. It seems to be the idea of the original work. If not, then to be fixed. --- targets/RT/USER/lte-ue.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 0a6df78682..d2e8c6ad46 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -1503,6 +1503,7 @@ void *UE_thread(void *arg) { int i; int th_id; static uint8_t thread_idx = 0; + int ret; cpu_set_t cpuset; CPU_ZERO(&cpuset); @@ -1724,15 +1725,27 @@ void *UE_thread(void *arg) { } pickTime(gotIQs); - struct timespec tv= {0}; - tv.tv_nsec=10*1000; - if( IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) - tv.tv_sec=INT_MAX; + /* no timeout in IS_SOFTMODEM_BASICSIM or IS_SOFTMODEM_RFSIM mode */ + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) { + ret = pthread_mutex_lock(&proc->mutex_rxtx); + } else { + struct timespec tv; + if (clock_gettime(CLOCK_REALTIME, &tv) != 0) { + perror("clock_gettime"); + exit(1); + } + tv.tv_nsec += 10*1000; + if (tv.tv_nsec >= 1000 * 1000 * 1000) { + tv.tv_sec++; + tv.tv_nsec -= 1000 * 1000 * 1000; + } + ret = pthread_mutex_timedlock(&proc->mutex_rxtx, &tv); + } // operate on thread sf mod 2 - if (pthread_mutex_timedlock(&proc->mutex_rxtx, &tv) !=0) { - if ( errno == ETIMEDOUT) { + if (ret != 0) { + if (ret == ETIMEDOUT) { LOG_E(PHY,"Missed real time\n"); continue; } else { From cbf1e1f7f233bb480fa200e973950924fe3ecf31 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 20 May 2019 16:37:19 +0200 Subject: [PATCH 24/28] CI: adding high throughput DL iperf tests w/ OAI UE Signed-off-by: Raphael Defosseux --- ci-scripts/reportTestLocally.sh | 8 ++++---- ci-scripts/runTestOnVM.sh | 2 +- .../xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml | 6 +++--- .../xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ci-scripts/reportTestLocally.sh b/ci-scripts/reportTestLocally.sh index e4195edde0..228f9882d7 100755 --- a/ci-scripts/reportTestLocally.sh +++ b/ci-scripts/reportTestLocally.sh @@ -508,26 +508,26 @@ function report_test { NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG` NB_UE_GOT_SYNC=`egrep -c "got sync" $UE_LOG` NB_ENB_SYNCED_WITH_UE=`egrep -c "Sending NFAPI_START_RESPONSE" $UE_LOG` - if [ $NB_ENB_GOT_SYNC -eq 1 ] && [ $NB_UE_GOT_SYNC -eq 3 ] && [ $NB_ENB_SYNCED_WITH_UE -eq 1 ] + if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -gt 2 ] && [ $NB_ENB_SYNCED_WITH_UE -gt 0 ] then echo " OK" >> ./test_simulator_results.html else echo " KO" >> ./test_simulator_results.html fi echo "
" >> ./test_simulator_results.html
-                    if [ $NB_ENB_GOT_SYNC -eq 1 ]
+                    if [ $NB_ENB_GOT_SYNC -gt 0 ]
                     then
                         echo "- eNB --> got sync" >> ./test_simulator_results.html
                     else
                         echo "- eNB NEVER got sync" >> ./test_simulator_results.html
                     fi
-                    if [ $NB_UE_GOT_SYNC -eq 3 ]
+                    if [ $NB_UE_GOT_SYNC -gt 2 ]
                     then
                         echo "- UE --> got sync" >> ./test_simulator_results.html
                     else
                         echo "- UE NEVER got sync" >> ./test_simulator_results.html
                     fi
-                    if [ $NB_ENB_SYNCED_WITH_UE -eq 1 ]
+                    if [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
                     then
                         echo "- UE attached to eNB" >> ./test_simulator_results.html
                     else
diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh
index 9433167e54..dbd2930dee 100755
--- a/ci-scripts/runTestOnVM.sh
+++ b/ci-scripts/runTestOnVM.sh
@@ -1279,7 +1279,7 @@ function run_test_on_vm {
           do
               # Not Running in TDD-10MHz and TDD-20MHz : too unstable
               #if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*10.* ]]; then continue; fi
-              #if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*20.* ]]; then continue; fi
+              if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*20.* ]]; then continue; fi
 
               if [[ $BW =~ .*05.* ]]; then PRB=25; fi
               if [[ $BW =~ .*10.* ]]; then PRB=50; fi
diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml
index cded08284a..f20001b29a 100644
--- a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml
@@ -26,7 +26,7 @@
 	tasks
 	
  030201 090109
- 030101 000001 090101 000002 040501 040502 000001 040601 040641 040642 000001 090109 030201
+ 030101 000001 090101 000002 040501 040502 000001 040601 040602 040641 040642 000001 090109 030201
 	
 	
 
@@ -93,8 +93,8 @@
 
         
 		Iperf
-		iperf (5MHz - DL/1.2Mbps/UDP)(30 sec)
-		-c 10.0.1.2 -u -b 1.2M -t 30 -i 1 -fm -B 10.0.1.1
+		iperf (5MHz - DL/14Mbps/UDP)(30 sec)
+		-c 10.0.1.2 -u -b 14M -t 30 -i 1 -fm -B 10.0.1.1
 		50
         
 
diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml
index 15735d94db..3a7ddfba0b 100644
--- a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml
+++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml
@@ -26,7 +26,7 @@
 	tasks
 	
  030201 090109
- 030102 000001 090102 000002 040503 000001 040603 040643 040644 000001 090109 030201
+ 030102 000001 090102 000002 040503 000001 040603 040604 040643 040644 000001 090109 030201
 	
 	
 
@@ -80,8 +80,8 @@
 
         
 		Iperf
-		iperf (5MHz - DL/1.2Mbps/UDP)(30 sec)
-		-b 1.2M -t 30 -i 1 -fm
+		iperf (5MHz - DL/14Mbps/UDP)(30 sec)
+		-u -b 14M -t 30 -i 1 -fm
 		50
         
 

From 28840df8f2a287a17b14297795ed0e5217739644 Mon Sep 17 00:00:00 2001
From: Raphael Defosseux 
Date: Wed, 22 May 2019 12:04:26 +0200
Subject: [PATCH 25/28] CI: fixing incorrect space indentation

Signed-off-by: Raphael Defosseux 
---
 ci-scripts/main.py                            |  11 +-
 .../enb_ue_usrp210_band7_epc_start.xml        |   4 +-
 .../enb_ue_usrp210_band7_test_05mhz_tm1.xml   |  80 +++----
 ...enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml |  58 ++---
 .../xml_files/enb_usrp210_band13_build.xml    |   4 +-
 .../enb_usrp210_band13_test_10mhz_tm1.xml     |  54 ++---
 .../xml_files/enb_usrp210_band40_build.xml    |   6 +-
 .../enb_usrp210_band40_epc_closure.xml        |  26 +--
 .../enb_usrp210_band40_test_05mhz_tm1.xml     |  50 ++--
 .../enb_usrp210_band40_test_10mhz_tm1.xml     |  90 +++----
 .../enb_usrp210_band40_test_20mhz_tm1.xml     |  90 +++----
 .../xml_files/enb_usrp210_band40_tracer.xml   |  20 +-
 .../xml_files/enb_usrp210_band7_build.xml     |   4 +-
 .../enb_usrp210_band7_test_05mhz_tm1.xml      | 220 +++++++++---------
 .../enb_usrp210_band7_test_10mhz_tm1.xml      |  56 ++---
 .../enb_usrp210_band7_test_20mhz_tm1.xml      |  56 ++---
 .../xml_files/enb_usrp210_band7_tracer.xml    |  18 +-
 .../xml_files/f1_usrp210_band7_test_05mhz.xml |  32 +--
 .../xml_files/f1_usrp210_band7_test_10mhz.xml |  32 +--
 .../xml_files/f1_usrp210_band7_test_20mhz.xml |  32 +--
 .../xml_files/if4p5_usrp210_band40_build.xml  |   6 +-
 .../if4p5_usrp210_band40_epc_closure.xml      |  26 +--
 .../if4p5_usrp210_band40_test_05mhz.xml       |  34 +--
 .../if4p5_usrp210_band40_test_10mhz.xml       |  52 ++---
 .../if4p5_usrp210_band40_test_20mhz.xml       |  44 ++--
 .../xml_files/if4p5_usrp210_band7_build.xml   |   4 +-
 .../if4p5_usrp210_band7_test_05mhz.xml        |  32 +--
 .../if4p5_usrp210_band7_test_10mhz.xml        |  32 +--
 .../if4p5_usrp210_band7_test_20mhz.xml        |  32 +--
 .../xml_files/ue_band20_test_10mhz_orange.xml |   6 +-
 .../xml_files/ue_band20_test_10mhz_sfr.xml    |   6 +-
 31 files changed, 609 insertions(+), 608 deletions(-)

diff --git a/ci-scripts/main.py b/ci-scripts/main.py
index c308a0ab70..96ff5ad20c 100644
--- a/ci-scripts/main.py
+++ b/ci-scripts/main.py
@@ -1,3 +1,4 @@
+# /*
 # * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 # * contributor license agreements.  See the NOTICE file distributed with
 # * this work for additional information regarding copyright ownership.
@@ -3795,10 +3796,10 @@ elif re.match('^LogCollectIperf$', mode, re.IGNORECASE):
 		sys.exit('Insufficient Parameter')
 	SSH.LogCollectIperf()
 elif re.match('^LogCollectOAIUE$', mode, re.IGNORECASE):
-        if SSH.UEIPAddress == '' or SSH.UEUserName == '' or SSH.UEPassword == '' or SSH.UESourceCodePath == '':
-                Usage()
-                sys.exit('Insufficient Parameter')
-        SSH.LogCollectOAIUE()
+	if SSH.UEIPAddress == '' or SSH.UEUserName == '' or SSH.UEPassword == '' or SSH.UESourceCodePath == '':
+		Usage()
+		sys.exit('Insufficient Parameter')
+	SSH.LogCollectOAIUE()
 elif re.match('^InitiateHtml$', mode, re.IGNORECASE):
 	if (SSH.ADBIPAddress == '' or SSH.ADBUserName == '' or SSH.ADBPassword == ''):
 		Usage()
@@ -3836,7 +3837,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
 			sys.exit('UE: Insufficient Parameter')
 
 	#read test_case_list.xml file
-        # if no parameters for XML file, use default value
+	# if no parameters for XML file, use default value
 	if (SSH.nbTestXMLfiles != 1):
 		xml_test_file = cwd + "/test_case_list.xml"
 	else:
diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_epc_start.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_epc_start.xml
index e22c5b4da2..aac71198f1 100644
--- a/ci-scripts/xml_files/enb_ue_usrp210_band7_epc_start.xml
+++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_epc_start.xml
@@ -29,10 +29,10 @@
 	
 	
 
-        
+	
 		Initialize_HSS
 		Initialize HSS
-        
+	
 
 	
 		Initialize_MME
diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml
index f20001b29a..710691d404 100644
--- a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml
@@ -30,23 +30,23 @@
 	
 	
 
-        
-                IdleSleep
-                Sleep
-                10
-        
+	
+		IdleSleep
+		Sleep
+		10
+	
 
-        
-                IdleSleep
-                Sleep
-                5
-        
+	
+		IdleSleep
+		Sleep
+		5
+	
 
-        
-                IdleSleep
-                Sleep
-                60
-        
+	
+		IdleSleep
+		Sleep
+		60
+	
 
 	
 		Initialize_eNB
@@ -59,44 +59,44 @@
 		Terminate eNB
 	
 
-        
-                Initialize_OAI_UE
-                Initialize OAI UE (FDD/Band7/5MHz)
-                -C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1 --noS1
-        
+	
+		Initialize_OAI_UE
+		Initialize OAI UE (FDD/Band7/5MHz)
+		-C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1 --noS1
+	
 
-        
-                Terminate_OAI_UE
-                Terminate OAI UE
-        
+	
+		Terminate_OAI_UE
+		Terminate OAI UE
+	
 
-        
-                Ping
-                ping (5MHz - 20 sec)(from eNB to OAI UE)
-                -I oaitun_enb1 -c 20 10.0.1.2
-                5
-        
+	
+		Ping
+		ping (5MHz - 20 sec)(from eNB to OAI UE)
+		-I oaitun_enb1 -c 20 10.0.1.2
+		5
+	
 
-        
-                Ping
-                ping (5MHz - 20 sec)(from OAI UE to eNB)
-                -I oaitun_ue1 -c 20 10.0.1.1
-                5
-        
+	
+		Ping
+		ping (5MHz - 20 sec)(from OAI UE to eNB)
+		-I oaitun_ue1 -c 20 10.0.1.1
+		5
+	
 
-        
+	
 		Iperf
 		iperf (5MHz - DL/1Mbps/UDP)(30 sec)
 		-c 10.0.1.2 -u -b 1M -t 30 -i 1 -fm -B 10.0.1.1
 		50
-        
+	
 
-        
+	
 		Iperf
 		iperf (5MHz - DL/14Mbps/UDP)(30 sec)
 		-c 10.0.1.2 -u -b 14M -t 30 -i 1 -fm -B 10.0.1.1
 		50
-        
+	
 
 	
 		Iperf
diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml
index 3a7ddfba0b..0effac9198 100644
--- a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml
+++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml
@@ -30,17 +30,17 @@
 	
 	
 
-        
-                IdleSleep
-                Sleep
-                10
-        
+	
+		IdleSleep
+		Sleep
+		10
+	
 
-        
-                IdleSleep
-                Sleep
-                5
-        
+	
+		IdleSleep
+		Sleep
+		5
+	
 
 	
 		Initialize_eNB
@@ -53,37 +53,37 @@
 		Terminate eNB
 	
 
-        
-                Initialize_OAI_UE
-                Initialize OAI UE (FDD/Band7/5MHz)
-                -C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1
-        
+	
+		Initialize_OAI_UE
+		Initialize OAI UE (FDD/Band7/5MHz)
+		-C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1
+	
 
-        
-                Terminate_OAI_UE
-                Terminate OAI UE
-        
+	
+		Terminate_OAI_UE
+		Terminate OAI UE
+	
 
-        
-                Ping
-                ping (5MHz - 20 sec)
-                -c 20
-                5
-        
+	
+		Ping
+		ping (5MHz - 20 sec)
+		-c 20
+		5
+	
 
-        
+	
 		Iperf
 		iperf (5MHz - DL/1Mbps/UDP)(30 sec)
 		-u -b 1M -t 30 -i 1 -fm
 		50
-        
+	
 
-        
+	
 		Iperf
 		iperf (5MHz - DL/14Mbps/UDP)(30 sec)
 		-u -b 14M -t 30 -i 1 -fm
 		50
-        
+	
 
 	
 		Iperf
diff --git a/ci-scripts/xml_files/enb_usrp210_band13_build.xml b/ci-scripts/xml_files/enb_usrp210_band13_build.xml
index 24283a52d0..96ab517b34 100644
--- a/ci-scripts/xml_files/enb_usrp210_band13_build.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band13_build.xml
@@ -37,10 +37,10 @@
 		-w USRP -c --eNB
 	
 
-        
+	
 		Initialize_HSS
 		Initialize HSS
-        
+	
 
 	
 		Initialize_MME
diff --git a/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml
index 5425428bc2..1f4a82710c 100644
--- a/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml
@@ -32,11 +32,11 @@
 	
 	
 
-        
-                IdleSleep
-                Waiting for a moment...
-                15
-        
+	
+		IdleSleep
+		Waiting for a moment...
+		15
+	
 
 	
 		Initialize_eNB
@@ -49,31 +49,31 @@
 		Terminate eNB
 	
 
-        
-                Initialize_CatM_module
-                Initialize CAT-M Module
-        
+	
+		Initialize_CatM_module
+		Initialize CAT-M Module
+	
 
-        
-                Terminate_CatM_module
-                Terminate CAT-M Module
-        
+	
+		Terminate_CatM_module
+		Terminate CAT-M Module
+	
 
-        
-                Attach_CatM_module
-                Attach CAT-M Module
-        
+	
+		Attach_CatM_module
+		Attach CAT-M Module
+	
 
-        
-                Detach_CatM_module
-                Detach CAT-M Module
-        
+	
+		Detach_CatM_module
+		Detach CAT-M Module
+	
 
-        
-                Ping_CatM_module
-                ping (10MHz - 20 sec)
-                -c 20
-                5
-        
+	
+		Ping_CatM_module
+		ping (10MHz - 20 sec)
+		-c 20
+		5
+	
 
 
diff --git a/ci-scripts/xml_files/enb_usrp210_band40_build.xml b/ci-scripts/xml_files/enb_usrp210_band40_build.xml
index 8f9489b03e..fd32019bb5 100644
--- a/ci-scripts/xml_files/enb_usrp210_band40_build.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band40_build.xml
@@ -24,7 +24,7 @@
 	build-tab
 	Build
 	wrench
-        
+	
  010101
  050101 060101 070101
 	
@@ -36,10 +36,10 @@
 		-w USRP -c --eNB
 	
 
-        
+	
 		Initialize_HSS
 		Initialize HSS
-        
+	
 
 	
 		Initialize_MME
diff --git a/ci-scripts/xml_files/enb_usrp210_band40_epc_closure.xml b/ci-scripts/xml_files/enb_usrp210_band40_epc_closure.xml
index ad34381a2a..07fb6951f8 100644
--- a/ci-scripts/xml_files/enb_usrp210_band40_epc_closure.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band40_epc_closure.xml
@@ -24,24 +24,24 @@
 	epc-closure
 	EPC-Closure
 	log-out
-        
+	
  050201 060201 070201
 	
 	
 
-        
-                Terminate_HSS
-                Terminate HSS
-        
+	
+		Terminate_HSS
+		Terminate HSS
+	
 
-        
-                Terminate_MME
-                Terminate MME
-        
+	
+		Terminate_MME
+		Terminate MME
+	
 
-        
-                Terminate_SPGW
-                Terminate SPGW
-        
+	
+		Terminate_SPGW
+		Terminate SPGW
+	
 
 
diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml
index 7fa7814238..6cf5634fcf 100644
--- a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml
@@ -24,7 +24,7 @@
 	test-05-tm1
 	Test-05MHz-TM1
 	tasks
-        
+	
  030201
  040101
  030104 040301 040501 040602 040601 040603 040604 040605 040642 040641 040643 040644 040645 040401 040201 030201
@@ -52,61 +52,61 @@
 		Terminate UE
 	
 
-        
-                Attach_UE
-                Attach UE
-        
+	
+		Attach_UE
+		Attach UE
+	
 
-        
-                Detach_UE
-                Detach UE
-        
+	
+		Detach_UE
+		Detach UE
+	
 
-        
-                Ping
-                ping (5MHz - 20 sec)
-                -c 20
-                25
-        
+	
+		Ping
+		ping (5MHz - 20 sec)
+		-c 20
+		25
+	
 
-        
+	
 		Iperf
 		iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(balanced)
 		-u -b 6.5M -t 30 -i 1
 		50
 		balanced
-        
+	
 
-        
+	
 		Iperf
 		iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(single-ue)
 		-u -b 6.5M -t 30 -i 1
 		50
 		single-ue
-        
+	
 
-        
+	
 		Iperf
 		iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(unbalanced)
 		-u -b 6.5M -t 30 -i 1
 		50
 		unbalanced
-        
+	
 
-        
+	
 		Iperf
 		iperf (5MHz - DL/TCP)(30 sec)(single-ue profile)
 		-t 30 -i 1 -fm
 		50
 		single-ue
-        
+	
 
-        
+	
 		Iperf
 		iperf (5MHz - DL/TCP)(30 sec)
 		-t 30 -i 1 -fm
 		50
-        
+	
 
 	
 		Iperf
diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml
index 7c1b4dc85c..29699d3b3d 100644
--- a/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml
@@ -24,7 +24,7 @@
 	test-10-tm1
 	Test-10MHz-TM1
 	tasks
-        
+	
  030201
  040101
  030114 040301 040511 040612 040611 040613 040614 040615 040652 040651 040653 040654 040655 040401 040201 030201
@@ -32,10 +32,10 @@
 	
 
 	
-                Initialize_eNB
-                Initialize eNB (TDD/Band40/10MHz/info)
-                -O ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf
-        
+		Initialize_eNB
+		Initialize eNB (TDD/Band40/10MHz/info)
+		-O ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf
+	
 
 	
 		Terminate_eNB
@@ -52,38 +52,38 @@
 		Terminate UE
 	
 
-        
-                Attach_UE
-                Attach UE
-        
+	
+		Attach_UE
+		Attach UE
+	
 
-        
-                Detach_UE
-                Detach UE
-        
+	
+		Detach_UE
+		Detach UE
+	
 
-        
-                Ping
-                ping (10MHz - 20 sec)
-                -c 20
-                25
-        
+	
+		Ping
+		ping (10MHz - 20 sec)
+		-c 20
+		25
+	
 
 	
-                Iperf
-                iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(balanced)
-                -u -b 13.5M -t 30 -i 1
-                50
-                balanced
-        
+		Iperf
+		iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(balanced)
+		-u -b 13.5M -t 30 -i 1
+		50
+		balanced
+	
 
-        
-                Iperf
-                iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue)
-                -u -b 13.5M -t 30 -i 1
-                50
-                single-ue
-        
+	
+		Iperf
+		iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue)
+		-u -b 13.5M -t 30 -i 1
+		50
+		single-ue
+	
 
 	
 		Iperf
@@ -93,20 +93,20 @@
 		unbalanced
 	
 
-        
-                Iperf
-                iperf (10MHz - DL/TCP)(30 sec)(single-ue)
-                -t 30 -i 1 -fm
-                50
-                single-ue
-        
+	
+		Iperf
+		iperf (10MHz - DL/TCP)(30 sec)(single-ue)
+		-t 30 -i 1 -fm
+		50
+		single-ue
+	
 
-        
-                Iperf
-                iperf (10MHz - DL/TCP)(30 sec)
-                -t 30 -i 1 -fm
-                50
-        
+	
+		Iperf
+		iperf (10MHz - DL/TCP)(30 sec)
+		-t 30 -i 1 -fm
+		50
+	
 
 	
 		Iperf
diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml
index bcbf742ef7..79fc0b305c 100644
--- a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml
@@ -24,7 +24,7 @@
 	test-20-tm1
 	Test-20MHz-TM1
 	tasks
-        
+	
  030201
  040101
  030124 040301 040521 040622 040621 040623 040624 040625 040662 040661 040663 040664 040665 040401 040201 030201
@@ -32,10 +32,10 @@
 	
 
 	
-                Initialize_eNB
-                Initialize eNB (TDD/Band40/20MHz/info)
-                -O ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf
-        
+		Initialize_eNB
+		Initialize eNB (TDD/Band40/20MHz/info)
+		-O ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf
+	
 
 	
 		Terminate_eNB
@@ -52,38 +52,38 @@
 		Terminate UE
 	
 
-        
-                Attach_UE
-                Attach UE
-        
+	
+		Attach_UE
+		Attach UE
+	
 
-        
-                Detach_UE
-                Detach UE
-        
+	
+		Detach_UE
+		Detach UE
+	
 
-        
-                Ping
-                ping (20MHz - 20 sec)
-                -c 20
-                25
-        
+	
+		Ping
+		ping (20MHz - 20 sec)
+		-c 20
+		25
+	
 
 	
-                Iperf
-                iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(balanced)
-                -u -b 13.5M -t 30 -i 1
-                50
-                balanced
-        
+		Iperf
+		iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(balanced)
+		-u -b 13.5M -t 30 -i 1
+		50
+		balanced
+	
 
-        
-                Iperf
-                iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue)
-                -u -b 13.5M -t 30 -i 1
-                50
-                single-ue
-        
+	
+		Iperf
+		iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue)
+		-u -b 13.5M -t 30 -i 1
+		50
+		single-ue
+	
 
 	
 		Iperf
@@ -93,20 +93,20 @@
 		unbalanced
 	
 
-        
-                Iperf
-                iperf (20MHz - DL/TCP)(30 sec)(single-ue)
-                -t 30 -i 1 -fm
-                50
-                single-ue
-        
+	
+		Iperf
+		iperf (20MHz - DL/TCP)(30 sec)(single-ue)
+		-t 30 -i 1 -fm
+		50
+		single-ue
+	
 
-        
-                Iperf
-                iperf (20MHz - DL/TCP)(30 sec)
-                -t 30 -i 1 -fm
-                50
-        
+	
+		Iperf
+		iperf (20MHz - DL/TCP)(30 sec)
+		-t 30 -i 1 -fm
+		50
+	
 
 	
 		Iperf
diff --git a/ci-scripts/xml_files/enb_usrp210_band40_tracer.xml b/ci-scripts/xml_files/enb_usrp210_band40_tracer.xml
index dceb6be97a..08cef07c8c 100644
--- a/ci-scripts/xml_files/enb_usrp210_band40_tracer.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band40_tracer.xml
@@ -24,7 +24,7 @@
 	tracer-test
 	T-Tracer
 	duplicate
-        
+	
  040101
  030100 040300 040401 040201 030201
 	
@@ -51,15 +51,15 @@
 		Terminate UE
 	
 
-        
-                Attach_UE
-                Attach single UE
-                1
-        
+	
+		Attach_UE
+		Attach single UE
+		1
+	
 
-        
-                Detach_UE
-                Detach UE
-        
+	
+		Detach_UE
+		Detach UE
+	
 
 
diff --git a/ci-scripts/xml_files/enb_usrp210_band7_build.xml b/ci-scripts/xml_files/enb_usrp210_band7_build.xml
index 31ee57e941..fd32019bb5 100644
--- a/ci-scripts/xml_files/enb_usrp210_band7_build.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band7_build.xml
@@ -36,10 +36,10 @@
 		-w USRP -c --eNB
 	
 
-        
+	
 		Initialize_HSS
 		Initialize HSS
-        
+	
 
 	
 		Initialize_MME
diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml
index 20ba63e37d..afafd3fb65 100644
--- a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml
@@ -35,75 +35,75 @@
 	
 	
 
-        
-                IdleSleep
-                Waiting for 35 seconds
-                35
-        
+	
+		IdleSleep
+		Waiting for 35 seconds
+		35
+	
 
-        
-                IdleSleep
-                Waiting for 10 seconds
-                10
-        
+	
+		IdleSleep
+		Waiting for 10 seconds
+		10
+	
 
-        
-                CheckStatusUE
-                Check UE(s) status before attachment
+	
+		CheckStatusUE
+		Check UE(s) status before attachment
 		0
-        
+	
 
-        
-                CheckStatusUE
-                Check UE(s) status before data disabling
+	
+		CheckStatusUE
+		Check UE(s) status before data disabling
 		2
-        
+	
 
-        
-                CheckStatusUE
-                Check UE(s) status after data disabling
+	
+		CheckStatusUE
+		Check UE(s) status after data disabling
 		0
-        
+	
 
-        
-                CheckStatusUE
-                Check UE(s) status after data re-enabling
+	
+		CheckStatusUE
+		Check UE(s) status after data re-enabling
 		2
-        
+	
 
-        
-                CheckStatusUE
-                Check UE(s) status before attachment
+	
+		CheckStatusUE
+		Check UE(s) status before attachment
 		0
-        
+	
 
-        
-                CheckStatusUE
-                Check UE(s) status before data disabling
+	
+		CheckStatusUE
+		Check UE(s) status before data disabling
 		2
-        
+	
 
-        
-                CheckStatusUE
-                Check UE(s) status after data disabling
+	
+		CheckStatusUE
+		Check UE(s) status after data disabling
 		0
-        
+	
 
-        
-                CheckStatusUE
-                Check UE(s) status after data re-enabling
+	
+		CheckStatusUE
+		Check UE(s) status after data re-enabling
 		2
-        
+	
 
-        
-                Initialize_FlexranCtrl
-                Starting Flexran Controller
-        
+	
+		Initialize_FlexranCtrl
+		Starting Flexran Controller
+	
 
-        
-                Terminate_FlexranCtrl
-                Stopping Flexran Controller
-        
+	
+		Terminate_FlexranCtrl
+		Stopping Flexran Controller
+	
 
 	
 		Initialize_eNB
@@ -138,100 +138,100 @@
 		Terminate UE
 	
 
-        
-                Attach_UE
-                Attach UE
-        
+	
+		Attach_UE
+		Attach UE
+	
 
-        
-                Detach_UE
-                Detach UE
-        
+	
+		Detach_UE
+		Detach UE
+	
 
-        
-                DataDisable_UE
-                Disabling Data Service on UE
-        
+	
+		DataDisable_UE
+		Disabling Data Service on UE
+	
 
-        
-                DataEnable_UE
-                Enabling Data Service on UE
-        
+	
+		DataEnable_UE
+		Enabling Data Service on UE
+	
 
-        
-                Ping
-                ping (5MHz - 20 sec)
-                -c 20
-                5
-        
+	
+		Ping
+		ping (5MHz - 20 sec)
+		-c 20
+		5
+	
 
-        
-                Ping
-                ping (5MHz - 20 sec)
-                -c 20
-                5
-        
+	
+		Ping
+		ping (5MHz - 20 sec)
+		-c 20
+		5
+	
 
-        
-                Ping
-                ping (5MHz - 20 sec)
-                -c 20
-                5
-        
+	
+		Ping
+		ping (5MHz - 20 sec)
+		-c 20
+		5
+	
 
-        
-                Ping
-                ping (5MHz - 20 sec)
-                -c 20
-                5
-        
+	
+		Ping
+		ping (5MHz - 20 sec)
+		-c 20
+		5
+	
 
-        
-                Ping
-                ping (5MHz - 20 sec)
-                -c 20
-                5
-        
+	
+		Ping
+		ping (5MHz - 20 sec)
+		-c 20
+		5
+	
 
-        
+	
 		Iperf
 		iperf (5MHz - DL/15Mbps/UDP)(30 sec)(balanced profile)
 		-u -b 15M -t 30 -i 1
 		50
 		balanced
-        
+	
 
-        
+	
 		Iperf
 		iperf (5MHz - DL/15Mbps/UDP)(30 sec)(single-ue profile)
 		-u -b 15M -t 30 -i 1
 		50
 		single-ue
-        
+	
 
-        
+	
 		Iperf
 		iperf (5MHz - DL/15Mbps/UDP)(30 sec)(unbalanced profile)
 		-u -b 15M -t 30 -i 1
 		50
 		unbalanced
-        
+	
 
-        
+	
 		Iperf
 		iperf (5MHz - DL/TCP)(30 sec)(single-ue profile)
 		-t 30 -i 1 -fm
 		50
 		single-ue
-        
+	
 
-        
+	
 		Iperf
 		iperf (5MHz - DL/TCP)(30 sec)(balanced profile)
 		-t 30 -i 1 -fm
 		50
 		balanced
-        
+	
 
 	
 		Iperf
@@ -249,20 +249,20 @@
 		single-ue
 	
 
-        
+	
 		Iperf
 		iperf (5MHz - UL/TCP)(30 sec)(single-ue profile)
 		-t 30 -i 1 -fm -R
 		50
 		single-ue
-        
+	
 
-        
+	
 		Iperf
 		iperf (5MHz - UL/TCP)(30 sec)(balanced profile)
 		-t 30 -i 1 -fm -R
 		50
 		balanced
-        
+	
 
 
diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml
index ccbe71cd14..fd6aabcbbc 100644
--- a/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml
@@ -52,62 +52,62 @@
 		Terminate UE
 	
 
-        
-                Attach_UE
-                Attach UE
-        
+	
+		Attach_UE
+		Attach UE
+	
 
-        
-                Detach_UE
-                Detach UE
-        
+	
+		Detach_UE
+		Detach UE
+	
 
-        
-                Ping
-                ping (10MHz - 20 sec)
-                -c 20
-                5
-        
+	
+		Ping
+		ping (10MHz - 20 sec)
+		-c 20
+		5
+	
 
-        
+	
 		Iperf
 		iperf (10MHz - DL/30Mbps/UDP)(30 sec)(balanced profile)
 		-u -b 30M -t 30 -i 1
 		50
 		balanced
-        
+	
 
-        
+	
 		Iperf
 		iperf (10MHz - DL/30Mbps/UDP)(30 sec)(single-ue profile)
 		-u -b 30M -t 30 -i 1
 		50
 		single-ue
-        
+	
 
-        
+	
 		Iperf
 		iperf (10MHz - DL/30Mbps/UDP)(30 sec)(unbalanced profile)
 		-u -b 30M -t 30 -i 1
 		50
 		unbalanced
-        
+	
 
-        
+	
 		Iperf
 		iperf (10MHz - DL/TCP)(30 sec)(single-ue profile)
 		-t 30 -i 1 -fm
 		50
 		single-ue
-        
+	
 
-        
+	
 		Iperf
 		iperf (10MHz - DL/TCP)(30 sec)(balanced profile)
 		-t 30 -i 1 -fm
 		50
 		balanced
-        
+	
 
 	
 		Iperf
@@ -125,20 +125,20 @@
 		single-ue
 	
 
-        
+	
 		Iperf
 		iperf (10MHz - UL/TCP)(30 sec)(single-ue profile)
 		-t 30 -i 1 -fm -R
 		50
 		single-ue
-        
+	
 
-        
+	
 		Iperf
 		iperf (10MHz - UL/TCP)(30 sec)(balanced profile)
 		-t 30 -i 1 -fm -R
 		50
 		balanced
-        
+	
 
 
diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml
index 03263bb86f..adde118128 100644
--- a/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml
@@ -52,62 +52,62 @@
 		Terminate UE
 	
 
-        
-                Attach_UE
-                Attach UE
-        
+	
+		Attach_UE
+		Attach UE
+	
 
-        
-                Detach_UE
-                Detach UE
-        
+	
+		Detach_UE
+		Detach UE
+	
 
-        
-                Ping
-                ping (20MHz - 20 sec)
-                -c 20
-                5
-        
+	
+		Ping
+		ping (20MHz - 20 sec)
+		-c 20
+		5
+	
 
-        
+	
 		Iperf
 		iperf (20MHz - DL/70Mbps/UDP)(30 sec)(balanced profile)
 		-u -b 70M -t 30 -i 1
 		50
 		balanced
-        
+	
 
-        
+	
 		Iperf
 		iperf (20MHz - DL/70Mbps/UDP)(30 sec)(single-ue profile)
 		-u -b 70M -t 30 -i 1
 		50
 		single-ue
-        
+	
 
-        
+	
 		Iperf
 		iperf (20MHz - DL/70Mbps/UDP)(30 sec)(unbalanced profile)
 		-u -b 70M -t 30 -i 1
 		50
 		unbalanced
-        
+	
 
-        
+	
 		Iperf
 		iperf (20MHz - DL/TCP)(30 sec)(single-ue profile)
 		-t 30 -i 1 -fm
 		50
 		single-ue
-        
+	
 
-        
+	
 		Iperf
 		iperf (20MHz - DL/TCP)(30 sec)(balanced profile)
 		-t 30 -i 1 -fm
 		50
 		balanced
-        
+	
 
 	
 		Iperf
@@ -125,20 +125,20 @@
 		single-ue
 	
 
-        
+	
 		Iperf
 		iperf (20MHz - UL/TCP)(30 sec)(single-ue profile)
 		-t 30 -i 1 -fm -R
 		50
 		single-ue
-        
+	
 
-        
+	
 		Iperf
 		iperf (20MHz - UL/TCP)(30 sec)(balanced profile)
 		-t 30 -i 1 -fm -R
 		50
 		balanced
-        
+	
 
 
diff --git a/ci-scripts/xml_files/enb_usrp210_band7_tracer.xml b/ci-scripts/xml_files/enb_usrp210_band7_tracer.xml
index 4c74f52b0f..e63f02ba3d 100644
--- a/ci-scripts/xml_files/enb_usrp210_band7_tracer.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band7_tracer.xml
@@ -51,15 +51,15 @@
 		Terminate UE
 	
 
-        
-                Attach_UE
-                Attach single UE
-                1
-        
+	
+		Attach_UE
+		Attach single UE
+		1
+	
 
-        
-                Detach_UE
-                Detach UE
-        
+	
+		Detach_UE
+		Detach UE
+	
 
 
diff --git a/ci-scripts/xml_files/f1_usrp210_band7_test_05mhz.xml b/ci-scripts/xml_files/f1_usrp210_band7_test_05mhz.xml
index fdf795fb30..2ed85f8a88 100644
--- a/ci-scripts/xml_files/f1_usrp210_band7_test_05mhz.xml
+++ b/ci-scripts/xml_files/f1_usrp210_band7_test_05mhz.xml
@@ -68,30 +68,30 @@
 		Terminate UE
 	
 
-        
-                Attach_UE
-                Attach UE
-        
+	
+		Attach_UE
+		Attach UE
+	
 
-        
-                Detach_UE
-                Detach UE
-        
+	
+		Detach_UE
+		Detach UE
+	
 
-        
-                Ping
-                ping (5MHz - 20 sec)
-                -c 20
-                5
-        
+	
+		Ping
+		ping (5MHz - 20 sec)
+		-c 20
+		5
+	
 
-        
+	
 		Iperf
 		iperf (5MHz - DL/15Mbps/UDP)(30 sec)(single-ue profile)
 		-u -b 15M -t 30 -i 1
 		50
 		single-ue
-        
+	
 
 	
 		Iperf
diff --git a/ci-scripts/xml_files/f1_usrp210_band7_test_10mhz.xml b/ci-scripts/xml_files/f1_usrp210_band7_test_10mhz.xml
index 3592759fc6..23569f2350 100644
--- a/ci-scripts/xml_files/f1_usrp210_band7_test_10mhz.xml
+++ b/ci-scripts/xml_files/f1_usrp210_band7_test_10mhz.xml
@@ -68,30 +68,30 @@
 		Terminate UE
 	
 
-        
-                Attach_UE
-                Attach UE
-        
+	
+		Attach_UE
+		Attach UE
+	
 
-        
-                Detach_UE
-                Detach UE
-        
+	
+		Detach_UE
+		Detach UE
+	
 
-        
-                Ping
-                ping (10MHz - 20 sec)
-                -c 20
-                5
-        
+	
+		Ping
+		ping (10MHz - 20 sec)
+		-c 20
+		5
+	
 
-        
+	
 		Iperf
 		iperf (10MHz - DL/32Mbps/UDP)(30 sec)(single-ue profile)
 		-u -b 32M -t 30 -i 1
 		50
 		single-ue
-        
+	
 
 	
 		Iperf
diff --git a/ci-scripts/xml_files/f1_usrp210_band7_test_20mhz.xml b/ci-scripts/xml_files/f1_usrp210_band7_test_20mhz.xml
index f2cb155127..1e4a835f84 100644
--- a/ci-scripts/xml_files/f1_usrp210_band7_test_20mhz.xml
+++ b/ci-scripts/xml_files/f1_usrp210_band7_test_20mhz.xml
@@ -68,30 +68,30 @@
 		Terminate UE
 	
 
-        
-                Attach_UE
-                Attach UE
-        
+	
+		Attach_UE
+		Attach UE
+	
 
-        
-                Detach_UE
-                Detach UE
-        
+	
+		Detach_UE
+		Detach UE
+	
 
-        
-                Ping
-                ping (20MHz - 20 sec)
-                -c 20
-                5
-        
+	
+		Ping
+		ping (20MHz - 20 sec)
+		-c 20
+		5
+	
 
-        
+	
 		Iperf
 		iperf (20MHz - DL/70Mbps/UDP)(30 sec)(single-ue profile)
 		-u -b 70M -t 30 -i 1
 		50
 		single-ue
-        
+	
 
 	
 		Iperf
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml
index fafcc51051..752049349f 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml
@@ -24,7 +24,7 @@
 	build-tab
 	Build
 	wrench
-        
+	
  010101
  050101 060101 070101
 	
@@ -37,10 +37,10 @@
 		-w USRP -c --eNB
 	
 
-        
+	
 		Initialize_HSS
 		Initialize HSS
-        
+	
 
 	
 		Initialize_MME
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_epc_closure.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_epc_closure.xml
index c04a8b3cf4..8587db959d 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band40_epc_closure.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band40_epc_closure.xml
@@ -24,25 +24,25 @@
 	epc-closure
 	EPC-Closure
 	log-out
-        
+	
  050201 060201 070201
 	
 	
 	
 
-        
-                Terminate_HSS
-                Terminate HSS
-        
+	
+		Terminate_HSS
+		Terminate HSS
+	
 
-        
-                Terminate_MME
-                Terminate MME
-        
+	
+		Terminate_MME
+		Terminate MME
+	
 
-        
-                Terminate_SPGW
-                Terminate SPGW
-        
+	
+		Terminate_SPGW
+		Terminate SPGW
+	
 
 
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml
index daa5c6fa43..06763aa995 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml
@@ -24,7 +24,7 @@
 	test-05
 	Test-05MHz
 	tasks
-        
+	
  030201
  040101
  030104 030105 040301 040501 040602 040642 040401 040201 030201 030202
@@ -68,30 +68,30 @@
 		Terminate UE
 	
 
-        
-                Attach_UE
-                Attach UE
-        
+	
+		Attach_UE
+		Attach UE
+	
 
-        
-                Detach_UE
-                Detach UE
-        
+	
+		Detach_UE
+		Detach UE
+	
 
-        
-                Ping
-                ping (5MHz - 20 sec)
-                -c 20
-                25
-        
+	
+		Ping
+		ping (5MHz - 20 sec)
+		-c 20
+		25
+	
 
-        
+	
 		Iperf
 		iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(single-ue)
 		-u -b 6.5M -t 30 -i 1
 		50
 		single-ue
-        
+	
 
 	
 		Iperf
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml
index 2638814cf6..e1644f3931 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml
@@ -24,7 +24,7 @@
 	test-10
 	Test-10MHz
 	tasks
-        
+	
  030201
  040101
  030114 030115 040301 040511 040612 040652 040401 040201 030201 030202
@@ -40,11 +40,11 @@
 	
 	
 	
-                Initialize_eNB
-                Initialize RCC (TDD/Band40/10MHz/info)
-                -O ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf
+		Initialize_eNB
+		Initialize RCC (TDD/Band40/10MHz/info)
+		-O ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf
 		1
-        
+	
 
 	
 		Terminate_eNB
@@ -68,30 +68,30 @@
 		Terminate UE
 	
 
-        
-                Attach_UE
-                Attach UE
-        
+	
+		Attach_UE
+		Attach UE
+	
 
-        
-                Detach_UE
-                Detach UE
-        
+	
+		Detach_UE
+		Detach UE
+	
 
-        
-                Ping
-                ping (10MHz - 20 sec)
-                -c 20
-                25
-        
+	
+		Ping
+		ping (10MHz - 20 sec)
+		-c 20
+		25
+	
 
-        
-                Iperf
-                iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue)
-                -u -b 13.5M -t 30 -i 1
-                50
-                single-ue
-        
+	
+		Iperf
+		iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue)
+		-u -b 13.5M -t 30 -i 1
+		50
+		single-ue
+	
 
 	
 		Iperf
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml
index a2356891f1..17ede3f830 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml
@@ -24,7 +24,7 @@
 	test-20
 	Test-20MHz
 	tasks
-        
+	
  030201
  040101
  030124 030125 040301 040521 040622 040662 040401 040201 030201 030202
@@ -68,30 +68,30 @@
 		Terminate UE
 	
 
-        
-                Attach_UE
-                Attach UE
-        
+	
+		Attach_UE
+		Attach UE
+	
 
-        
-                Detach_UE
-                Detach UE
-        
+	
+		Detach_UE
+		Detach UE
+	
 
-        
-                Ping
-                ping (20MHz - 20 sec)
-                -c 20
-                25
-        
+	
+		Ping
+		ping (20MHz - 20 sec)
+		-c 20
+		25
+	
 
-        
-                Iperf
-                iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue)
-                -u -b 13.5M -t 30 -i 1
-                50
-                single-ue
-        
+	
+		Iperf
+		iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue)
+		-u -b 13.5M -t 30 -i 1
+		50
+		single-ue
+	
 
 	
 		Iperf
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml
index a60662d799..8cbd2d84c6 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml
@@ -37,10 +37,10 @@
 		-w USRP -c --eNB
 	
 
-        
+	
 		Initialize_HSS
 		Initialize HSS
-        
+	
 
 	
 		Initialize_MME
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml
index 1464a4a624..d72633159d 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml
@@ -68,30 +68,30 @@
 		Terminate UE
 	
 
-        
-                Attach_UE
-                Attach UE
-        
+	
+		Attach_UE
+		Attach UE
+	
 
-        
-                Detach_UE
-                Detach UE
-        
+	
+		Detach_UE
+		Detach UE
+	
 
-        
-                Ping
-                ping (5MHz - 20 sec)
-                -c 20
-                5
-        
+	
+		Ping
+		ping (5MHz - 20 sec)
+		-c 20
+		5
+	
 
-        
+	
 		Iperf
 		iperf (5MHz - DL/15Mbps/UDP)(30 sec)(single-ue profile)
 		-u -b 15M -t 30 -i 1
 		50
 		single-ue
-        
+	
 
 	
 		Iperf
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml
index 1649e91b3e..98e1aed575 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml
@@ -68,30 +68,30 @@
 		Terminate UE
 	
 
-        
-                Attach_UE
-                Attach UE
-        
+	
+		Attach_UE
+		Attach UE
+	
 
-        
-                Detach_UE
-                Detach UE
-        
+	
+		Detach_UE
+		Detach UE
+	
 
-        
-                Ping
-                ping (10MHz - 20 sec)
-                -c 20
-                5
-        
+	
+		Ping
+		ping (10MHz - 20 sec)
+		-c 20
+		5
+	
 
-        
+	
 		Iperf
 		iperf (10MHz - DL/32Mbps/UDP)(30 sec)(single-ue profile)
 		-u -b 32M -t 30 -i 1
 		50
 		single-ue
-        
+	
 
 	
 		Iperf
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml
index d98fce2e83..2cf4e0fbf5 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml
@@ -68,30 +68,30 @@
 		Terminate UE
 	
 
-        
-                Attach_UE
-                Attach UE
-        
+	
+		Attach_UE
+		Attach UE
+	
 
-        
-                Detach_UE
-                Detach UE
-        
+	
+		Detach_UE
+		Detach UE
+	
 
-        
-                Ping
-                ping (20MHz - 20 sec)
-                -c 20
-                5
-        
+	
+		Ping
+		ping (20MHz - 20 sec)
+		-c 20
+		5
+	
 
-        
+	
 		Iperf
 		iperf (20MHz - DL/50Mbps/UDP)(30 sec)(single-ue profile)
 		-u -b 50M -t 30 -i 1
 		50
 		single-ue
-        
+	
 
 	
 		Iperf
diff --git a/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml b/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml
index 594ea7b923..19d08d5119 100644
--- a/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml
+++ b/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml
@@ -21,9 +21,9 @@
 
 -->
 
-        test-10mhz-orange
-        Test-10Mhz-Orange
-        tasks	
+	test-10mhz-orange
+	Test-10Mhz-Orange
+	tasks	
 	
  090109
  090110 000001 090109
diff --git a/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml b/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml
index 89370be983..50912d3458 100644
--- a/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml
+++ b/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml
@@ -21,9 +21,9 @@
 
 -->
 
-        test-10mHz-sfr
-        Test-10MHz-SFR
-        tasks
+	test-10mHz-sfr
+	Test-10MHz-SFR
+	tasks
 	
  090109
  090111 000001 090109

From a65d09cbdab70b3bd639054f41b838789c497837 Mon Sep 17 00:00:00 2001
From: Raphael Defosseux 
Date: Wed, 22 May 2019 12:08:42 +0200
Subject: [PATCH 26/28] CI: adding support to build for coverity-scan

Signed-off-by: Raphael Defosseux 
---
 cmake_targets/build_oai          | 24 ++++++++++++++++++++++--
 cmake_targets/tools/build_helper | 11 ++++++++---
 2 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai
index a7ceb48758..13c42424a4 100755
--- a/cmake_targets/build_oai
+++ b/cmake_targets/build_oai
@@ -58,6 +58,7 @@ CFLAGS_PROCESSOR_USER=""
 RUN_GROUP=0
 TEST_CASE_GROUP=""
 BUILD_DOXYGEN=0
+BUILD_COVERITY_SCAN=0
 T_TRACER="True"
 DISABLE_HARDWARE_DEPENDENCY="False"
 CMAKE_BUILD_TYPE=""
@@ -128,6 +129,8 @@ Options
    Manually Add CFLAGS of processor if they are not detected correctly by script. Only add these flags if you know your processor supports them. Example flags: -msse3 -msse4.1 -msse4.2 -mavx2
 --build-doxygen
    Builds doxygen based documentation.
+--build-coverity-scan
+   Builds Coverity-Scan objects for upload
 --disable-deadline
    Disables deadline scheduler of Linux kernel (>=3.14.x).
 --enable-deadline
@@ -277,6 +280,10 @@ function main() {
 	    BUILD_DOXYGEN=1
             echo_info "Will build doxygen support"
             shift;;     
+       --build-coverity-scan)
+           BUILD_COVERITY_SCAN=1
+            echo_info "Will build Coverity-Scan objects for upload"
+            shift;;
        --disable-deadline)
             FORCE_DEADLINE_SCHEDULER_FLAG_USER="False"
             echo_info "Disabling the usage of deadline scheduler"
@@ -307,7 +314,7 @@ function main() {
             shift 1;;
         --ue-timing)
             UE_TIMING_TRACE="True"
- x           echo_info "Enabling UE timing trace"
+            echo_info "Enabling UE timing trace"
             shift 1;;
         --uhd-images-dir)
             UHD_IMAGES_DIR=$2
@@ -345,7 +352,20 @@ function main() {
             break;;
    esac
   done
-  
+
+  #########################################################
+  # check if cov-build is installed
+  #########################################################
+  if [ "$BUILD_COVERITY_SCAN" == "1" ] ; then
+      echo_info "Checking cov-build is installed"
+      IS_INSTALLED=`which cov-build | grep -c cov-build || true`
+      if [ $IS_INSTALLED -eq 1 ] ; then
+          echo_info "Found cov-build"
+      else
+          echo_fatal "Did NOT find cov-build in PATH!"
+      fi
+  fi
+
   CMAKE_CMD="$CMAKE_CMD .."
   echo_info "CMAKE_CMD=$CMAKE_CMD"
   #########################################################
diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper
index 0021b673f2..70fc28f825 100755
--- a/cmake_targets/tools/build_helper
+++ b/cmake_targets/tools/build_helper
@@ -177,10 +177,15 @@ compilations() {
   set +e
   {
     rm -f $3
-    if [ "$VERBOSE_COMPILE" == "1" ]; then
-       make -j`nproc` $2 VERBOSE=$VERBOSE_COMPILE
+    if [ "$BUILD_COVERITY_SCAN" == "1" ]; then
+        COV_SCAN_PREFIX="cov-build --dir cov-int"
     else
-       make -j`nproc` $2
+        COV_SCAN_PREFIX=""
+    fi
+    if [ "$VERBOSE_COMPILE" == "1" ]; then
+       $COV_SCAN_PREFIX make -j`nproc` $2 VERBOSE=$VERBOSE_COMPILE
+    else
+       $COV_SCAN_PREFIX make -j`nproc` $2
     fi
 
   } > $dlog/$2.$REL.txt 2>&1

From 3c322792baf3e58ae2879b252ee2415335c4ec03 Mon Sep 17 00:00:00 2001
From: Raphael Defosseux 
Date: Wed, 22 May 2019 15:39:03 +0200
Subject: [PATCH 27/28] CI: fixig failing OAI UE + USRP + OAI eNB test   --
 scenarios were using FDD 5MHz conf file w/ active RRC inactivity timeout   --
 since we are waiting very long that UE is sync'ed w/ eNB, timeout occurs and
 UE is released   -- solution is to disable timeouts in command line in
 scenario   -- also python is fixed to handle properly wrong ping exits

Signed-off-by: Raphael Defosseux 
---
 ci-scripts/main.py                                     | 10 ++++++++++
 .../xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml  |  2 +-
 .../enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml         |  2 +-
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/ci-scripts/main.py b/ci-scripts/main.py
index 96ff5ad20c..9fc1846da6 100644
--- a/ci-scripts/main.py
+++ b/ci-scripts/main.py
@@ -1522,6 +1522,12 @@ class SSHConnection():
 		except:
 			os.kill(os.getppid(),signal.SIGUSR1)
 
+	def PingNoS1_wrong_exit(self, qMsg):
+		html_queue = SimpleQueue()
+		html_cell = '
OAI UE ping result\n' + qMsg + '
' + html_queue.put(html_cell) + self.CreateHtmlTestRowQueue(self.ping_args, 'KO', len(self.UEDevices), html_queue) + def PingNoS1(self): check_eNB = True check_OAI_UE = True @@ -1554,21 +1560,25 @@ class SSHConnection(): if ping_status < 0: message = 'Ping with OAI UE crashed due to TIMEOUT!' logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + self.PingNoS1_wrong_exit(message) return result = re.search(', (?P[0-9\.]+)% packet loss, time [0-9\.]+ms', str(self.ssh.before)) if result is None: message = 'Packet Loss Not Found!' logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + self.PingNoS1_wrong_exit(message) return packetloss = result.group('packetloss') if float(packetloss) == 100: message = 'Packet Loss is 100%' logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + self.PingNoS1_wrong_exit(message) return result = re.search('rtt min\/avg\/max\/mdev = (?P[0-9\.]+)\/(?P[0-9\.]+)\/(?P[0-9\.]+)\/[0-9\.]+ ms', str(self.ssh.before)) if result is None: message = 'Ping RTT_Min RTT_Avg RTT_Max Not Found!' logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + self.PingNoS1_wrong_exit(message) return rtt_min = result.group('rtt_min') rtt_avg = result.group('rtt_avg') diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml index 710691d404..29c9a29c2d 100644 --- a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml @@ -51,7 +51,7 @@ Initialize_eNB Initialize eNB (FDD/Band7/5MHz) - -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --noS1 + -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --noS1 --eNBs.[0].rrc_inactivity_threshold 0 diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml index 0effac9198..2e6b9a0dc6 100644 --- a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml +++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml @@ -45,7 +45,7 @@ Initialize_eNB Initialize eNB (FDD/Band7/5MHz) - -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf + -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --eNBs.[0].rrc_inactivity_threshold 0 From afdeaa631ced75b8813b06b50a1ad20210602998 Mon Sep 17 00:00:00 2001 From: "Louis-Adrien DUFRENE (Orange Labs)" Date: Thu, 23 May 2019 07:58:00 +0200 Subject: [PATCH 28/28] update feature list with RRC inactivity timer --- doc/FEATURE_SET.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/FEATURE_SET.md b/doc/FEATURE_SET.md index deb4fec994..d006e30912 100644 --- a/doc/FEATURE_SET.md +++ b/doc/FEATURE_SET.md @@ -122,6 +122,7 @@ The RRC layer is based on **3GPP 36.331** v14.3.0 and implements the following f - eMBMS for multicast and broadcast (experimental) - Handover (experimental) - Paging (soon) +- RRC inactivity timer (release of UE after a period of data inactivity) ## eNB X2AP ##