diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index 3042ada815afe4ad4a60c7efb4a096ee432f3187..54be9b653d53d92ad8720c82e3ec39e949fa5076 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -136,16 +136,6 @@ pipeline { // For the moment, there is no fail criteria. Just a notification of number of files that do not follow sh "./ci-scripts/checkCodingFormattingRules.sh" } - // With Mosaic 5G being part of OSA and making all it's repositories public - // No need to pass credentials to clone flexran-rtc - if (doMandatoryTests) { - sh "mkdir flexran" - dir ('flexran') { - sh "git clone https://gitlab.eurecom.fr/flexran/flexran-rtc.git . > ../git_clone.log 2>&1" - sh "git checkout develop >> ../git_clone.log 2>&1" - sh "zip -r -qq flexran.zip ." - } - } } } post { @@ -159,16 +149,6 @@ pipeline { } } - stage ("Start VM -- basic-sim") { - steps { - lock (vmResource) { - timeout (time: 5, unit: 'MINUTES') { - sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" - } - } - } - } - stage ("Start VM -- gnb-usrp") { steps { lock (vmResource) { @@ -211,15 +191,6 @@ pipeline { stage ("Variant Builds") { parallel { - stage ("Build basic simulator") { - steps { - gitlabCommitStatus(name: "Build basic-sim") { - timeout (time: 45, unit: 'MINUTES') { - sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" - } - } - } - } stage ("Build 5G gNB-USRP") { steps { gitlabCommitStatus(name: "Build gNB-USRP") { @@ -270,9 +241,9 @@ pipeline { script { dir ('archives') { if (fileExists('red_hat')) { - sh "zip -r -qq vm_build_logs.zip basic_sim enb_eth ue_eth gnb_usrp nr_ue_usrp red_hat" + sh "zip -r -qq vm_build_logs.zip enb_eth ue_eth gnb_usrp nr_ue_usrp red_hat" } else { - sh "zip -r -qq vm_build_logs.zip basic_sim enb_eth ue_eth gnb_usrp nr_ue_usrp" + sh "zip -r -qq vm_build_logs.zip enb_eth ue_eth gnb_usrp nr_ue_usrp" } } if(fileExists('archives/vm_build_logs.zip')) { @@ -306,44 +277,6 @@ pipeline { parallel { stage ("VM-based tests") { stages { - stage ("Build Flexran Controller") { - when { - expression {doMandatoryTests} - } - steps { - lock (vmResource) { - script { - timeout (time: 20, unit: 'MINUTES') { - try { - sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant flexran-rtc --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" - } catch (Exception e) { - currentBuild.result = 'FAILURE' - } - } - } - } - } - } - stage ("Test basic simulator") { - when { - expression {doMandatoryTests} - } - steps { - lock (vmResource) { - script { - timeout (time: 30, unit: 'MINUTES') { - try { - gitlabCommitStatus(name: "Test basic-sim") { - sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}" - } - } catch (Exception e) { - currentBuild.result = 'FAILURE' - } - } - } - } - } - } stage ("Test L1 simulator") { when { expression {doMandatoryTests} @@ -581,7 +514,7 @@ pipeline { script { if (doMandatoryTests) { dir ('archives') { - sh "if [ -d basic_sim/test ] || [ -d rf_sim/test ] || [ -d l2_sim/test ]; then zip -r -qq vm_tests_logs.zip */test ; fi" + sh "if [ -d rf_sim/test ] || [ -d l2_sim/test ]; then zip -r -qq vm_tests_logs.zip */test ; fi" } if(fileExists('archives/vm_tests_logs.zip')) { archiveArtifacts artifacts: 'archives/vm_tests_logs.zip' diff --git a/ci-scripts/buildOnVM.sh b/ci-scripts/buildOnVM.sh index f4cf3931dd327827dc36731ce8d45855059f3c00..eaca22f550b3cefc0ac36e66409840821f2a7962 100755 --- a/ci-scripts/buildOnVM.sh +++ b/ci-scripts/buildOnVM.sh @@ -62,7 +62,7 @@ function build_on_vm { echo "ARCHIVES_LOC = $ARCHIVES_LOC" echo "BUILD_OPTIONS = $BUILD_OPTIONS" - if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] + if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-basic-sim"* ]] || [[ "$VM_NAME" == *"-flexran-rtc"* ]] then echo "This VM type is no longer supported in the pipeline framework" return diff --git a/ci-scripts/ci_ueinfra.yaml b/ci-scripts/ci_ueinfra.yaml index 51acb75968e13c6ea87acfb008e775fac06eb46d..0a915740f243cbb114120ed6971140ee7c3e5ee6 100644 --- a/ci-scripts/ci_ueinfra.yaml +++ b/ci-scripts/ci_ueinfra.yaml @@ -27,11 +27,11 @@ nrmodule2_quectel: Apn : OAICN5G : oai OAI-Rel14-Docker : oai.ipv4 - WakeupScript : ci_ctl_qtel.py /dev/ttyUSB7 wup - DetachScript : ci_ctl_qtel.py /dev/ttyUSB7 detach + WakeupScript : ci_ctl_qtel.py /dev/ttyUSB2 wup + DetachScript : ci_ctl_qtel.py /dev/ttyUSB2 detach LogStore : /media/ci_qlogs PLMN : 20897 - UENetwork : wwan1 + UENetwork : wwan0 HostIPAddress : 192.168.18.189 HostUsername : nrmodule2 HostPassword : linux diff --git a/ci-scripts/doc/vm_based_simulator_build.md b/ci-scripts/doc/vm_based_simulator_build.md index 28fbc955d59de0788ac3032065f9288c94f16ec2..16faa3ce9bff5433536dcd0c2ce4fc14e1bfaca4 100644 --- a/ci-scripts/doc/vm_based_simulator_build.md +++ b/ci-scripts/doc/vm_based_simulator_build.md @@ -52,7 +52,6 @@ Options: -------- # OpenAirInterface Build Variants --variant enb-usrp OR -v1 ( build and test ) - --variant basic-sim OR -v2 ( build and test ) --variant phy-sim OR -v3 ( build and test ) --variant cppcheck OR -v4 ( build and test ) --variant gnb-usrp OR -v5 ( build and test ) diff --git a/ci-scripts/doc/vm_based_simulator_create.md b/ci-scripts/doc/vm_based_simulator_create.md index 09ce26c5536956c9891e4c0683970e291d2e2236..46817380385a9e8d4fca3d60dd30cd686c3266b4 100644 --- a/ci-scripts/doc/vm_based_simulator_create.md +++ b/ci-scripts/doc/vm_based_simulator_create.md @@ -45,7 +45,6 @@ Mandatory Options: # OpenAirInterface Build Variants --variant enb-usrp OR -v1 ( build and test ) - --variant basic-sim OR -v2 ( build and test ) --variant phy-sim OR -v3 ( build and test ) --variant cppcheck OR -v4 ( build and test ) --variant gnb-usrp OR -v5 ( build and test ) diff --git a/ci-scripts/doc/vm_based_simulator_main_scripts.md b/ci-scripts/doc/vm_based_simulator_main_scripts.md index 000d89a1eba1fbbd6c3ae0c81cba953e29251774..0d54d035210018cc8c36b793fe18889c785f75b2 100644 --- a/ci-scripts/doc/vm_based_simulator_main_scripts.md +++ b/ci-scripts/doc/vm_based_simulator_main_scripts.md @@ -109,12 +109,6 @@ You can get the list of variant specific variables specifying the variant argume NB_PATTERN_FILES=9 BUILD_OPTIONS="" LOG_PATTERN=.Rel15.txt - --variant basic-sim OR -v2 ( build and test ) - VM_NAME=ci-basic-sim ARCHIVES_LOC=basic_sim - VM_MEMORY=8192 VM_CPU=4 - NB_PATTERN_FILES=13 BUILD_OPTIONS="--eNB --UE" - LOG_PATTERN=.Rel15.txt - --variant phy-sim OR -v3 ( build and test ) VM_NAME=ci-phy-sim ARCHIVES_LOC=phy_sim VM_MEMORY=2048 VM_CPU=4 diff --git a/ci-scripts/doc/vm_based_simulator_test.md b/ci-scripts/doc/vm_based_simulator_test.md index 73308b972e5fa4eef268cb7fd496ca0cc6c73462..ab2810154381dfae15569b6d9555edbe98d05d92 100644 --- a/ci-scripts/doc/vm_based_simulator_test.md +++ b/ci-scripts/doc/vm_based_simulator_test.md @@ -18,16 +18,14 @@ 2. [Detailed Description](#2-detailed-description) 3. [Typical Usage](#3-typical-usage) 1. [Testing the physical simulators](#31-testing-the-physicals-simulators) - 2. [Testing the basic simulator](#32-testing-the-basic-simulator) - 3. [Testing the RF simulator](#33-testing-the-rf-simulator) - 4. [Testing the L2-nFAPI simulator](#33-testing-the-l2-nfapi-simulator) + 2. [Testing the RF simulator](#33-testing-the-rf-simulator) + 3. [Testing the L2-nFAPI simulator](#33-testing-the-l2-nfapi-simulator) # 1. Introduction # -Currently 2 build variants can be directly tested: +Currently 1 build variant can be directly tested: * Physical Simulators -* Basic Simulator In addition, 2 build variants are used: @@ -73,7 +71,6 @@ Options: # OpenAirInterface Build Variants --variant enb-usrp OR -v1 ( build and test ) - --variant basic-sim OR -v2 ( build and test ) --variant phy-sim OR -v3 ( build and test ) --variant cppcheck OR -v4 ( build and test ) --variant gnb-usrp OR -v5 ( build and test ) @@ -143,64 +140,7 @@ $ ./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-dev Note that the VM instance is destroyed. You do that when you are sure your test is passing. -## 3.2. Testing the basic simulator ## - -```bash -$ ./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-develop --variant basic-sim --job-name RAN-CI-develop --build-id 48 -15:11:13 ############################################################ -15:11:13 OAI CI VM script -15:11:13 ############################################################ -15:11:13 VM_NAME = RAN-CI-develop-b48-basic-sim -15:11:13 VM_CMD_FILE = RAN-CI-develop-b48-basic-sim_cmds.txt -15:11:13 JENKINS_WKSP = /var/jenkins/workspace/RAN-CI-develop -15:11:13 ARCHIVES_LOC = /var/jenkins/workspace/RAN-CI-develop/archives/basic_sim/test -15:11:13 ############################################################ -15:11:13 Waiting for VM to be started -15:11:13 ############################################################ -15:11:14 Warning: Permanently added '192.168.122.29' (ECDSA) to the list of known hosts. -15:11:15 RAN-CI-develop-b48-basic-sim has for IP addr = 192.168.122.29 -15:11:15 ############################################################ -15:11:15 Test EPC on VM (RAN-CI-develop-b48-epc) will be using ltebox -15:11:15 ############################################################ -15:11:15 EPC_VM_CMD_FILE = RAN-CI-develop-b48-epc_cmds.txt -15:11:15 ############################################################ -15:11:15 Creating test EPC VM (RAN-CI-develop-b48-epc) on Ubuntu Cloud Image base -15:11:15 ############################################################ -15:11:18 Waiting for VM to be started -15:13:25 Warning: Permanently added '192.168.122.156' (ECDSA) to the list of known hosts. -15:13:25 RAN-CI-develop-b48-epc has for IP addr = 192.168.122.156 -15:13:25 Warning: Permanently added '192.168.122.156' (ECDSA) to the list of known hosts. -15:13:25 ls: cannot access '/opt/ltebox/tools/start_ltebox': No such file or directory -15:13:25 ############################################################ -15:13:25 Copying ltebox archives into EPC VM (RAN-CI-develop-b48-epc) -15:13:25 ############################################################ -15:13:25 ############################################################ -15:13:25 Install EPC on EPC VM (RAN-CI-develop-b48-epc) -15:13:25 ############################################################ -.... -15:24:39 ############################################################ -15:24:39 Terminate EPC -15:24:39 ############################################################ -15:24:39 cd /opt/ltebox/tools -15:24:39 sudo ./stop_ltebox -15:24:40 sudo daemon --name=simulated_hss --stop -15:24:40 sudo killall --signal SIGKILL hss_sim -15:24:40 ############################################################ -15:24:40 Destroying VMs -15:24:40 ############################################################ -15:24:41 # Host 192.168.122.29 found: line 18 -15:24:41 /home/eurecom/.ssh/known_hosts updated. -15:24:41 Original contents retained as /home/eurecom/.ssh/known_hosts.old -15:24:43 # Host 192.168.122.60 found: line 20 -15:24:43 /home/eurecom/.ssh/known_hosts updated. -15:24:43 Original contents retained as /home/eurecom/.ssh/known_hosts.old -15:24:43 ############################################################ -15:24:43 Checking run status -15:24:43 ############################################################ -15:24:43 STATUS seems OK -``` - -## 3.3. Test the RF simulator ## +## 3.2. Test the RF simulator ## ```bash ./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-develop --variant rf-sim --job-name RAN-CI-develop --build-id 48 --keep-vm-alive @@ -209,7 +149,7 @@ $ ./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-dev 15:24:45 STATUS seems OK ``` -## 3.4. Testing the L2-nFAPI simulator +## 3.3. Testing the L2-nFAPI simulator ```bash ./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-develop --variant l2-sim --job-name RAN-CI-develop --build-id 48 diff --git a/ci-scripts/oai-ci-vm-tool b/ci-scripts/oai-ci-vm-tool index 5ee653c8e15768303ff5a67d505c13ce95157bb1..8363c91461a1800e5d6a792ce4c86de34dc9031c 100755 --- a/ci-scripts/oai-ci-vm-tool +++ b/ci-scripts/oai-ci-vm-tool @@ -174,7 +174,7 @@ function variant__v1__enb_usrp { BUILD_OPTIONS="--eNB -w USRP --mu" VM_MEMORY=3072 } - + function variant__v2__basic_sim { NB_PATTERN_FILES=11 BUILD_OPTIONS="--eNB --UE" @@ -200,28 +200,28 @@ function variant__v4__cppcheck { function variant__v5__gnb_usrp { VM_MEMORY=10240 VM_CPU=8 - NB_PATTERN_FILES=7 + NB_PATTERN_FILES=6 BUILD_OPTIONS="--gNB -w USRP" } function variant__v6__nr_ue_usrp { VM_MEMORY=4096 VM_CPU=4 - NB_PATTERN_FILES=7 + NB_PATTERN_FILES=6 BUILD_OPTIONS="--nrUE -w USRP" } function variant__v7__enb_ethernet { VM_MEMORY=4096 ARCHIVES_LOC=enb_eth - NB_PATTERN_FILES=7 + NB_PATTERN_FILES=6 BUILD_OPTIONS="--eNB -w USRP" } function variant__v8__ue_ethernet { VM_MEMORY=4096 ARCHIVES_LOC=ue_eth - NB_PATTERN_FILES=11 + NB_PATTERN_FILES=10 BUILD_OPTIONS="--UE -w USRP" } diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index e5d0f10ee4ce6b9a785df156fc2bd824dc5369d2..3b32a75542db080ea50a91ffdc13e530709010a1 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -677,13 +677,13 @@ class RANManagement(): # if T tracer was run with option 0 (no logs), analyze logs # from textlog, otherwise do normal analysis (e.g., option 2) result = re.search('T_stdout 0', str(self.Initialize_eNB_args)) + enbLogFile = self.eNBLogFiles[int(self.eNB_instance)] + raw_record_file = enbLogFile.replace('.log', '_record.raw') + replay_log_file = enbLogFile.replace('.log', '_replay.log') if (result is not None): logging.debug('\u001B[1m Replaying RAW record file\u001B[0m') mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.command('cd ' + lSourcePath + '/common/utils/T/tracer/', '\$', 5) - enbLogFile = self.eNBLogFiles[int(self.eNB_instance)] - raw_record_file = enbLogFile.replace('.log', '_record.raw') - replay_log_file = enbLogFile.replace('.log', '_replay.log') extracted_txt_file = enbLogFile.replace('.log', '_extracted_messages.txt') extracted_log_file = enbLogFile.replace('.log', '_extracted_messages.log') mySSH.command('./extract_config -i ' + lSourcePath + '/cmake_targets/' + raw_record_file + ' > ' + lSourcePath + '/cmake_targets/' + extracted_txt_file, '\$', 5) @@ -706,6 +706,8 @@ class RANManagement(): mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*stats.log', '.') mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*.pickle', '.') mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*.png', '.') + mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/'+raw_record_file, '.') + mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/'+replay_log_file, '.') # copyin_res = mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/' + fileToAnalyze, '.') if (copyin_res == -1): @@ -721,7 +723,9 @@ class RANManagement(): mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './nrL1_stats.log', self.eNBSourceCodePath + '/cmake_targets/') mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './nrMAC_stats.log', self.eNBSourceCodePath + '/cmake_targets/') mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './gnb_stats_monitor.pickle', self.eNBSourceCodePath + '/cmake_targets/') - mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './gnb_stats_monitor.png', self.eNBSourceCodePath + '/cmake_targets/') + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './gnb_stats_monitor.png', self.eNBSourceCodePath + '/cmake_targets/')#RH 21/02/2002 this does not work, there are more than 1 png file + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword,'./'+raw_record_file, self.eNBSourceCodePath + '/cmake_targets/') + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword,'./'+replay_log_file, self.eNBSourceCodePath + '/cmake_targets/') # mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './' + fileToAnalyze, self.eNBSourceCodePath + '/cmake_targets/') logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + fileToAnalyze) diff --git a/ci-scripts/reportBuildLocally.sh b/ci-scripts/reportBuildLocally.sh index 8b6db9261a57945d5c2621d7ef5a7229dddb83f6..bcd3e2f7fecf0ed24cc9ea921cb0bdc6fdddd8c3 100755 --- a/ci-scripts/reportBuildLocally.sh +++ b/ci-scripts/reportBuildLocally.sh @@ -574,7 +574,6 @@ function report_build { summary_table_row "OAI ETHERNET transport - Release 15" ./archives/enb_eth/oai_eth_transpro.Rel15.txt "Built target oai_eth_transpro" ./enb_eth_row3.html summary_table_row "Parameters Lib Config - Release 15" ./archives/enb_eth/params_libconfig.Rel15.txt "Built target params_libconfig" ./enb_eth_row4.html summary_table_row "RF Simulator - Release 15" ./archives/enb_eth/rfsimulator.Rel15.txt "Built target rfsimulator" ./enb_eth_row5.html - summary_table_row "TCP OAI Bridge - Release 15" ./archives/enb_eth/tcp_bridge_oai.Rel15.txt "Built target tcp_bridge_oai" ./enb_eth_row6.html summary_table_row "OAI USRP device if - Release 15" ./archives/enb_eth/oai_usrpdevif.Rel15.txt "Built target oai_usrpdevif" ./enb_eth_row7.html summary_table_footer @@ -584,7 +583,6 @@ function report_build { summary_table_row "OAI ETHERNET transport - Release 15" ./archives/ue_eth/oai_eth_transpro.Rel15.txt "Built target oai_eth_transpro" ./ue_eth_row3.html summary_table_row "Parameters Lib Config - Release 15" ./archives/ue_eth/params_libconfig.Rel15.txt "Built target params_libconfig" ./ue_eth_row4.html summary_table_row "RF Simulator - Release 15" ./archives/ue_eth/rfsimulator.Rel15.txt "Built target rfsimulator" ./ue_eth_row5.html - summary_table_row "TCP OAI Bridge - Release 15" ./archives/ue_eth/tcp_bridge_oai.Rel15.txt "Built target tcp_bridge_oai" ./ue_eth_row6.html summary_table_row "Conf 2 UE Data - Release 15" ./archives/ue_eth/conf2uedata.Rel15.txt "Built target conf2uedata" ./ue_eth_row7.html summary_table_row "NVRAM - Release 15" ./archives/ue_eth/nvram.Rel15.txt "Built target nvram" ./ue_eth_row8.html summary_table_row "UE IP - Release 15" ./archives/ue_eth/ue_ip.Rel15.txt "Built target ue_ip" ./ue_eth_row9.html @@ -592,20 +590,6 @@ function report_build { summary_table_row "OAI USRP device if - Release 15" ./archives/ue_eth/oai_usrpdevif.Rel15.txt "Built target oai_usrpdevif" ./ue_eth_row9b.html summary_table_footer - summary_table_header "OAI Build: 4G LTE basic simulator option" ./archives/basic_sim - summary_table_row "LTE SoftModem - Release 15" ./archives/basic_sim/lte-softmodem.Rel15.txt "Built target lte-softmodem" ./basic_sim_row1.html - summary_table_row "LTE UE SoftModem - Release 15" ./archives/basic_sim/lte-uesoftmodem.Rel15.txt "Built target lte-uesoftmodem" ./basic_sim_row2.htm - summary_table_row "Coding - Release 15" ./archives/basic_sim/coding.Rel15.txt "Built target coding" ./basic_sim_row3.html - summary_table_row "Conf 2 UE data - Release 15" ./archives/basic_sim/conf2uedata.Rel15.txt "Built target conf2uedata" ./basic_sim_row4.html - summary_table_row "OAI ETHERNET transport - Release 15" ./archives/basic_sim/oai_eth_transpro.Rel15.txt "Built target oai_eth_transpro" ./basic_sim_row5.html - summary_table_row "Parameters Lib Config - Release 15" ./archives/basic_sim/params_libconfig.Rel15.txt "Built target params_libconfig" ./basic_sim_row7.html - summary_table_row "RF Simulator - Release 15" ./archives/basic_sim/rfsimulator.Rel15.txt "Built target rfsimulator" ./basic_sim_row9.html - summary_table_row "TCP Bridge - Release 15" ./archives/basic_sim/tcp_bridge_oai.Rel15.txt "Built target tcp_bridge_oai" ./basic_sim_row10.html - summary_table_row "UE IP - Release 15" ./archives/basic_sim/ue_ip.Rel15.txt "Built target ue_ip" ./basic_sim_row11.html - summary_table_row "USIM - Release 15" ./archives/basic_sim/usim.Rel15.txt "Built target usim" ./basic_sim_row12.html - summary_table_row "NVRAM - Release 15" ./archives/basic_sim/nvram.Rel15.txt "Built target nvram" ./basic_sim_row13.html - summary_table_footer - if [ -f archives/gnb_usrp/nr-softmodem.Rel15.txt ] then summary_table_header "OAI Build: 5G NR gNB -- USRP option" ./archives/gnb_usrp @@ -658,13 +642,6 @@ 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 ] || [ -f ./basic_sim_row4.html ] || [ -f ./basic_sim_row5.html ] - then - for DETAILS_TABLE in `ls ./basic_sim_row*.html` - do - cat $DETAILS_TABLE >> ./build_results.html - done - fi if [ -f ./gnb_usrp_row1.html ] || [ -f ./gnb_usrp_row2.html ] || [ -f ./gnb_usrp_row3.html ] || [ -f ./gnb_usrp_row4.html ] then for DETAILS_TABLE in `ls ./gnb_usrp_row*.html` diff --git a/ci-scripts/reportTestLocally.sh b/ci-scripts/reportTestLocally.sh index d22bfe177a88fa99b271067dc2337b00eb080f81..c137fcdcbbb52ada1aa7571ea70f7b74a1f7bc42 100755 --- a/ci-scripts/reportTestLocally.sh +++ b/ci-scripts/reportTestLocally.sh @@ -250,156 +250,6 @@ function report_test { echo " </table>" >> ./test_simulator_results.html echo " <h2>Test Summary</h2>" >> ./test_simulator_results.html - ARCHIVES_LOC=archives/basic_sim/test - if [ -d $ARCHIVES_LOC ] - then - echo " <h3>4G LTE Basic Simulator Check</h3>" >> ./test_simulator_results.html - - if [ -f $ARCHIVES_LOC/test_final_status.log ] - then - if [ `grep -c TEST_OK $ARCHIVES_LOC/test_final_status.log` -eq 1 ] - then - echo " <div class=\"alert alert-success\">" >> ./test_simulator_results.html - echo " <strong>TEST was SUCCESSFUL <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./test_simulator_results.html - echo " </div>" >> ./test_simulator_results.html - else - echo " <div class=\"alert alert-danger\">" >> ./test_simulator_results.html - echo " <strong>TEST was a FAILURE! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./test_simulator_results.html - echo " </div>" >> ./test_simulator_results.html - fi - else - echo " <div class=\"alert alert-danger\">" >> ./test_simulator_results.html - echo " <strong>COULD NOT DETERMINE TEST FINAL STATUS! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./test_simulator_results.html - echo " </div>" >> ./test_simulator_results.html - fi - - echo " <button data-toggle=\"collapse\" data-target=\"#oai-basic-sim-test-details\">More details on Basic Simulator test results</button>" >> ./test_simulator_results.html - echo " <div id=\"oai-basic-sim-test-details\" class=\"collapse\">" >> ./test_simulator_results.html - echo " <table border = \"1\">" >> ./test_simulator_results.html - echo " <tr bgcolor = \"#33CCFF\" >" >> ./test_simulator_results.html - echo " <th>Log File Name</th>" >> ./test_simulator_results.html - echo " <th>Command</th>" >> ./test_simulator_results.html - echo " <th>Status</th>" >> ./test_simulator_results.html - echo " <th>Statistics</th>" >> ./test_simulator_results.html - echo " </tr>" >> ./test_simulator_results.html - - TRANS_MODES=("fdd" "tdd") - BW_CASES=(05 10 20) - for TMODE in ${TRANS_MODES[@]} - do - echo " <tr bgcolor = \"#8FBC8F\" >" >> ./test_simulator_results.html - if [[ $TMODE =~ .*fdd.* ]] - then - echo " <td align = \"center\" colspan = 4 >Test in FDD</td>" >> ./test_simulator_results.html - else - echo " <td align = \"center\" colspan = 4 >Test in TDD</td>" >> ./test_simulator_results.html - fi - echo " </tr>" >> ./test_simulator_results.html - for BW in ${BW_CASES[@]} - do - ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}MHz_enb.log - UE_LOG=`echo $ENB_LOG | sed -e "s#enb#ue#"` - if [ -f $ENB_LOG ] && [ -f $UE_LOG ] - then - NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"` - NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"` - echo " <tr>" >> ./test_simulator_results.html - echo " <td>$NAME_ENB --- $NAME_UE</td>" >> ./test_simulator_results.html - echo " <td>N/A</td>" >> ./test_simulator_results.html - 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 "got UE capabilities for UE" $ENB_LOG` - if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -eq 2 ] && [ $NB_ENB_SYNCED_WITH_UE -eq 1 ] - then - echo " <td bgcolor = \"green\" >OK</td>" >> ./test_simulator_results.html - else - echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html - fi - echo " <td><pre>" >> ./test_simulator_results.html - if [ $NB_ENB_GOT_SYNC -gt 0 ] - then - echo "<font color = \"blue\">- eNB --> got sync</font>" >> ./test_simulator_results.html - else - echo "<font color = \"red\"><b>- eNB NEVER got sync</b></font>" >> ./test_simulator_results.html - fi - if [ $NB_UE_GOT_SYNC -eq 2 ] - then - echo "<font color = \"blue\">- UE --> got sync</font>" >> ./test_simulator_results.html - else - echo "<font color = \"red\"><b>- UE NEVER got sync</b></font>" >> ./test_simulator_results.html - fi - if [ $NB_ENB_SYNCED_WITH_UE -eq 1 ] - then - echo "<font color = \"blue\">- UE attached to eNB</font>" >> ./test_simulator_results.html - else - echo "<font color = \"red\"><b>- UE NEVER attached to eNB</b></font>" >> ./test_simulator_results.html - fi - NB_SEGFAULT_ENB=`egrep -i -c "Segmentation Fault" $ENB_LOG` - if [ $NB_SEGFAULT_ENB -ne 0 ] - then - echo "<font color = \"red\"><b>- eNB --> Segmentation Fault</b></font>" >> ./test_simulator_results.html - fi - NB_SEGFAULT_UE=`egrep -i -c "Segmentation Fault" $UE_LOG` - if [ $NB_SEGFAULT_UE -ne 0 ] - then - echo "<font color = \"red\"><b>- UE --> Segmentation Fault</b></font>" >> ./test_simulator_results.html - fi - NB_ASSERTION_ENB=`egrep -i -c "Assertion" $ENB_LOG` - if [ $NB_ASSERTION_ENB -ne 0 ] - then - echo "<font color = \"red\"><b>- eNB --> Assertion</b></font>" >> ./test_simulator_results.html - awk 'BEGIN{assertion=10}{if(assertion < 3){print " " $0; assertion++};if ($0 ~/Assertion/){print " " $0;assertion=1}}END{}' $ENB_LOG >> ./test_simulator_results.html - fi - NB_ASSERTION_UE=`egrep -i -c "Assertion" $UE_LOG` - if [ $NB_ASSERTION_UE -ne 0 ] - then - echo "<font color = \"red\"><b>- eNB --> Assertion</b></font>" >> ./test_simulator_results.html - awk 'BEGIN{assertion=10}{if(assertion < 3){print " " $0; assertion++};if ($0 ~/Assertion/){print " " $0;assertion=1}}END{}' $UE_LOG >> ./test_simulator_results.html - fi - echo " </pre></td>" >> ./test_simulator_results.html - echo " </tr>" >> ./test_simulator_results.html - fi - PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_ping_ue.txt 2> /dev/null` - analyzePingFiles - - IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}*iperf*client*txt 2> /dev/null` - analyzeIperfFiles - done - done - - echo " </table>" >> ./test_simulator_results.html - echo " </div>" >> ./test_simulator_results.html - fi - - if [ -e $JENKINS_WKSP/flexran/flexran_build_complete.txt ] - then - echo " <h3>4G LTE Basic Simulator + FlexRan Controller Check</h3>" >> ./test_simulator_results.html - echo " <div class=\"alert alert-success\">" >> ./test_simulator_results.html - echo " <strong>TEST was SUCCESSFUL <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./test_simulator_results.html - echo " </div>" >> ./test_simulator_results.html - echo " <button data-toggle=\"collapse\" data-target=\"#oai-flexran-test-details\">More details on Basic Simulator + Fleran Controller test results</button>" >> ./test_simulator_results.html - echo " <div id=\"oai-flexran-test-details\" class=\"collapse\">" >> ./test_simulator_results.html - echo " <table border = \"1\">" >> ./test_simulator_results.html - echo " <tr bgcolor = \"#33CCFF\" >" >> ./test_simulator_results.html - echo " <th>Log File Name</th>" >> ./test_simulator_results.html - echo " <th>JSON Query Response</th>" >> ./test_simulator_results.html - echo " </tr>" >> ./test_simulator_results.html - - FLEXRAN_QUERIES=`ls $ARCHIVES_LOC/flexran_ctl_query_*log` - for QUERY in $FLEXRAN_QUERIES - do - echo " <tr>" >> ./test_simulator_results.html - NAME=`echo $QUERY | sed -e "s#$ARCHIVES_LOC/##"` - echo " <td>$NAME</td>" >> ./test_simulator_results.html - echo " <td><pre><code>" >> ./test_simulator_results.html - egrep -v "LOG_NAME|\-\-\-\-\-" $QUERY >> ./test_simulator_results.html - echo " </code></pre></td>" >> ./test_simulator_results.html - echo " </tr>" >> ./test_simulator_results.html - done - echo " </table>" >> ./test_simulator_results.html - echo " </div>" >> ./test_simulator_results.html - fi - ARCHIVES_LOC=archives/rf_sim/test if [ -d $ARCHIVES_LOC ] then diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index b5abb5ff45257157c0a51fab84527a6ede4eb261..31ffa9d727053deb6577ae6e351f0418966b1dda 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -36,137 +36,6 @@ function test_usage { command_options_usage } -function start_basic_sim_enb { - local LOC_VM_IP_ADDR=$2 - local LOC_EPC_IP_ADDR=$3 - local LOC_LOG_FILE=$4 - local LOC_NB_RBS=$5 - local LOC_CONF_FILE=$6 - local LOC_FLEXRAN_CTL_IP_ADRR=$7 - echo "cd /home/ubuntu/tmp" > $1 - echo "echo \"sudo apt-get --yes --quiet install daemon \"" >> $1 - echo "sudo apt-get --yes install daemon >> /home/ubuntu/tmp/cmake_targets/log/daemon-install.txt 2>&1" >> $1 - echo "echo \"export ENODEB=1\"" >> $1 - echo "export ENODEB=1" >> $1 - echo "echo \"source oaienv\"" >> $1 - echo "source oaienv" >> $1 - echo "cd ci-scripts/conf_files/" >> $1 - echo "cp $LOC_CONF_FILE ci-$LOC_CONF_FILE" >> $1 - echo "sed -i -e 's#N_RB_DL.*=.*;#N_RB_DL = $LOC_NB_RBS;#' -e 's#CI_MME_IP_ADDR#$LOC_EPC_IP_ADDR#' -e 's#CI_ENB_IP_ADDR#$LOC_VM_IP_ADDR#' ci-$LOC_CONF_FILE" >> $1 - if [[ $LOC_FLEXRAN_CTL_IP_ADRR =~ .*none.* ]] - then - echo "sed -i -e 's#CI_FLEXRAN_CTL_IP_ADDR#127.0.0.1#' ci-$LOC_CONF_FILE" >> $1 - else - echo "sed -i -e 's#FLEXRAN_ENABLED = .*no.*;#FLEXRAN_ENABLED = \"yes\";#' -e 's#CI_FLEXRAN_CTL_IP_ADDR#$LOC_FLEXRAN_CTL_IP_ADRR#' ci-$LOC_CONF_FILE" >> $1 - 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/ran_build/build/\"" >> $1 - echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/" >> $1 - echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $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,time --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/ran_build/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 - sleep 5 - - local i="0" - echo "egrep -c \"got sync\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1 - while [ $i -lt 10 ] - do - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1` - if [ $CONNECTED -ne 0 ] - then - i="100" - else - sleep 5 - i=$[$i+1] - fi - done - ENB_SYNC=0 - echo "echo \"free -m\"" > $1 - echo "free -m" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1 - rm $1 - if [ $i -lt 50 ] - then - ENB_SYNC=0 - echo "Basic-Sim eNB: eNB did NOT got sync" - else - echo "Basic-Sim eNB: eNB GOT SYNC --> waiting for UE to connect" - fi - sleep 5 -} - -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/ran_build/build/\"" > $1 - echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build" >> $1 - echo "echo \"./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_NB_RBS --log_config.global_log_options nocolor,line_num,level --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/ran_build/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 - - local i="0" - echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1 - while [ $i -lt 10 ] - do - sleep 5 - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1` - if [ $CONNECTED -eq 1 ] - then - i="100" - else - i=$[$i+1] - fi - done - UE_SYNC=1 - rm $1 - if [ $i -lt 50 ] - then - UE_SYNC=0 - echo "Basic-Sim UE: oaitun_ue1 is DOWN and/or NOT CONFIGURED" - else - echo "Basic-Sim UE: oaitun_ue1 is UP and CONFIGURED" - fi - i="0" - echo "egrep -c \"Generating RRCConnectionReconfigurationComplete\" /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE" > $1 - while [ $i -lt 10 ] - do - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1` - if [ $CONNECTED -ne 0 ] - then - i="100" - else - sleep 5 - i=$[$i+1] - fi - done - echo "echo \"free -m\"" > $1 - echo "free -m" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 - rm $1 - if [ $i -lt 50 ] - then - UE_SYNC=0 - echo "Basic-Sim UE: UE did NOT complete RRC Connection" - else - echo "Basic-Sim UE: UE did COMPLETE RRC Connection" - fi -} - function get_ue_ip_addr { local LOC_IF_ID=$3 echo "ifconfig oaitun_ue${LOC_IF_ID} | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $1 @@ -417,7 +286,6 @@ function check_iperf { local LOC_REQ_BW_MINUS_TWO=`echo "$LOC_REQ_BW - 2" | bc -l` local LOC_REQ_BW_MINUS_THREE=`echo "$LOC_REQ_BW - 3" | bc -l` local LOC_IS_DL=`echo $LOC_BASE_LOG | grep -c _dl` - local LOC_IS_BASIC_SIM=`echo $LOC_BASE_LOG | grep -c basic_sim` local LOC_IS_RF_SIM=`echo $LOC_BASE_LOG | grep -c rf_sim` local LOC_IS_NR=`echo $LOC_BASE_LOG | grep -c _106prb` if [ -f ${LOC_BASE_LOG}_client.txt ] @@ -438,28 +306,17 @@ function check_iperf { local EFFECTIVE_BANDWIDTH=`tail -n3 ${LOC_BASE_LOG}_client.txt | egrep "Kbits/sec" | sed -e "s#^.*KBytes *##" -e "s#sec.*#sec#"` local BW_PREFIX="K" fi - if [ $LOC_IS_DL -eq 1 ] && [ $LOC_IS_BASIC_SIM -eq 1 ] + if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*${BW_PREFIX}bits.* ]] then - if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_TWO}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_THREE}.*${BW_PREFIX}bits.* ]] + if [ $LOC_IS_DL -eq 1 ] then echo "got requested DL bandwidth: $EFFECTIVE_BANDWIDTH" else - echo "got LESS than requested DL bandwidth: $EFFECTIVE_BANDWIDTH" - IPERF_STATUS=-1 + echo "got requested UL bandwidth: $EFFECTIVE_BANDWIDTH" fi else - if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*${BW_PREFIX}bits.* ]] - then - if [ $LOC_IS_DL -eq 1 ] - then - echo "got requested DL bandwidth: $EFFECTIVE_BANDWIDTH" - else - echo "got requested UL bandwidth: $EFFECTIVE_BANDWIDTH" - fi - else - echo "got LESS than requested DL bandwidth: $EFFECTIVE_BANDWIDTH" - IPERF_STATUS=-1 - fi + echo "got LESS than requested DL bandwidth: $EFFECTIVE_BANDWIDTH" + IPERF_STATUS=-1 fi fi else @@ -526,22 +383,6 @@ function full_terminate { sleep 10 } -function full_basic_sim_destroy { - if [ $KEEP_VM_ALIVE -eq 0 ] - then - echo "############################################################" - echo "Destroying VMs" - echo "############################################################" - uvt-kvm destroy $VM_NAME - ssh-keygen -R $VM_IP_ADDR - if [ -e $JENKINS_WKSP/flexran/flexran_build_complete.txt ] - then - uvt-kvm destroy $FLEXRAN_CTL_VM_NAME - ssh-keygen -R $FLEXRAN_CTL_VM_IP_ADDR - fi - fi -} - function install_epc_on_vm { local LOC_EPC_VM_NAME=$1 local LOC_EPC_VM_CMDS=$2 @@ -744,35 +585,6 @@ function terminate_epc { fi } -function start_flexran_ctrl { - echo "cd /home/ubuntu/tmp" > $1 - echo "if [ -f cmake_targets/log/flexran_ctl_run.log ]; then rm -f cmake_targets/log/flexran_ctl_run.log cmake_targets/log/flexran_ctl_query*.log; fi" >> $1 - echo "echo \" sudo build/rt_controller -c log_config/basic_log\"" >> $1 - echo "nohup sudo build/rt_controller -c log_config/basic_log > cmake_targets/log/flexran_ctl_run.log 2>&1 &" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 - rm $1 - sleep 10 -} - -function stop_flexran_ctrl { - echo "echo \"sudo killall --signal SIGKILL rt_controller\"" > $1 - echo "sudo killall --signal SIGKILL rt_controller" > $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 - rm $1 - sleep 2 -} - -function query_flexran_ctrl_status { - local LOC_MESSAGE=$3 - echo "cd /home/ubuntu/tmp" > $1 - echo "echo \"------------------------------------------------------------\" > cmake_targets/log/flexran_ctl_query_${LOC_MESSAGE}.log" >> $1 - echo "echo \"LOG_NAME: $LOC_MESSAGE\" >> cmake_targets/log/flexran_ctl_query_${LOC_MESSAGE}.log" >> $1 - echo "echo \"------------------------------------------------------------\" >> cmake_targets/log/flexran_ctl_query_${LOC_MESSAGE}.log" >> $1 - echo "curl http://localhost:9999/stats | jq '.' | tee -a cmake_targets/log/flexran_ctl_query_${LOC_MESSAGE}.log" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 - rm $1 -} - function build_ue_on_separate_folder { echo "mkdir tmp-ue" > $1 echo "cd tmp-ue" >> $1 @@ -1480,6 +1292,11 @@ function run_test_on_vm { echo "This VM test type is no longer supported in the pipeline framework" return fi + if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-basic-sim.* )) ]] + then + echo "This VM test type is no longer supported in the pipeline framework" + return + fi if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf-sim.* )) ]] then ENB_VM_NAME=`echo $VM_NAME | sed -e "s#rf-sim#enb-ethernet#"` @@ -1667,234 +1484,6 @@ function run_test_on_vm { fi fi - if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-basic-sim.* ]] - then - PING_STATUS=0 - IPERF_STATUS=0 - if [ -d $ARCHIVES_LOC ] - then - rm -Rf $ARCHIVES_LOC - fi - mkdir --parents $ARCHIVES_LOC - - # Creating a VM for EPC and installing SW - EPC_VM_NAME=`echo $VM_NAME | sed -e "s#basic-sim#epc#"` - EPC_VM_CMDS=${EPC_VM_NAME}_cmds.txt - LTEBOX=0 - if [[ "$EPC_IPADDR" == "" ]] - then - # Creating a VM for EPC and installing SW - install_epc_on_vm $EPC_VM_NAME $EPC_VM_CMDS - EPC_VM_IP_ADDR=`uvt-kvm ip $EPC_VM_NAME` - - # Starting EPC - start_epc $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR - else - echo "We will use EPC on $EPC_IPADDR" - EPC_VM_IP_ADDR=$EPC_IPADDR - fi - - # Retrieve EPC real IP address - retrieve_real_epc_ip_addr $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR - - TRANS_MODES=("fdd" "tdd") - BW_CASES=(05 10 20) - - for TMODE in ${TRANS_MODES[@]} - do - for BW in ${BW_CASES[@]} - do - # Not Running in TDD-20MHz : too unstable - if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*20.* ]]; then continue; fi - - if [[ $BW =~ .*05.* ]]; then PRB=25; fi - if [[ $BW =~ .*10.* ]]; then PRB=50; fi - if [[ $BW =~ .*20.* ]]; then PRB=100; fi - if [[ $TMODE =~ .*fdd.* ]]; then FREQUENCY=2680; else FREQUENCY=2350; fi - - echo "############################################################" - echo "Starting the eNB in ${TMODE}-${BW}MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=${TMODE}_${BW}MHz_enb.log - start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE $PRB lte-${TMODE}-basic-sim.conf none - - echo "############################################################" - echo "Starting the UE in ${TMODE}-${BW}MHz mode" - echo "############################################################" - CURRENT_UE_LOG_FILE=${TMODE}_${BW}MHz_ue.log - start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE $PRB $FREQUENCY - if [ $UE_SYNC -eq 0 ] - then - echo "Problem w/ eNB and UE not syncing" - full_terminate - STATUS=-1 - continue - fi - get_ue_ip_addr $VM_CMDS $VM_IP_ADDR 1 - - echo "############################################################" - echo "Pinging the UE" - echo "############################################################" - PING_LOG_FILE=${TMODE}_${BW}MHz_ping_ue.txt - ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE 0 - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - - # Not more testing in any TDD : too unstable - if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*05.* ]]; then full_terminate; continue; fi - if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*10.* ]]; then full_terminate; continue; fi - if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*20.* ]]; then full_terminate; continue; fi - echo "############################################################" - echo "Iperf DL" - echo "############################################################" - if [[ $TMODE =~ .*fdd.* ]] - then - if [[ $BW =~ .*20.* ]]; then THROUGHPUT=12; else THROUGHPUT=10; fi - else - THROUGHPUT=6 - fi - CURR_IPERF_LOG_BASE=${TMODE}_${BW}MHz_iperf_dl - generic_iperf $VM_CMDS $VM_IP_ADDR $UE_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR $REAL_EPC_IP_ADDR $THROUGHPUT $CURR_IPERF_LOG_BASE 0 0 - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT - - # Not more testing in FDD-20MHz : too unstable - if [[ $TMODE =~ .*fdd.* ]] && [[ $BW =~ .*20.* ]]; then full_terminate; continue; fi - echo "############################################################" - echo "Iperf UL" - echo "############################################################" - THROUGHPUT=2 - CURR_IPERF_LOG_BASE=${TMODE}_${BW}MHz_iperf_ul - generic_iperf $EPC_VM_CMDS $EPC_VM_IP_ADDR $REAL_EPC_IP_ADDR $VM_CMDS $VM_IP_ADDR $UE_IP_ADDR $THROUGHPUT $CURR_IPERF_LOG_BASE 0 0 - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT - - full_terminate - - done - done - - if [ -d $JENKINS_WKSP/flexran ] - then - echo "############################################################" - echo "Flexran testing is possible" - echo "############################################################" - local j="0" - while [ $j -lt 20 ] - do - if [ -e $JENKINS_WKSP/flexran/flexran_build_complete.txt ] - then - echo "Found an proper flexran controller vm build" - j="100" - else - j=$[$j+1] - sleep 30 - fi - done - if [ $j -lt 50 ] - then - echo "ERROR: compiling flexran controller on vm went wrong" - terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - STATUS=-1 - return - fi - FLEXRAN_CTL_VM_NAME=`echo $VM_NAME | sed -e "s#basic-sim#flexran-rtc#"` - FLEXRAN_CTL_VM_CMDS=`echo $VM_CMDS | sed -e "s#cmds#flexran-rtc-cmds#"` - IS_FLEXRAN_VM_ALIVE=`uvt-kvm list | grep -c $FLEXRAN_CTL_VM_NAME` - if [ $IS_FLEXRAN_VM_ALIVE -eq 0 ] - then - echo "ERROR: Flexran Ctl VM is not alive" - terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - full_basic_sim_destroy - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - STATUS=-1 - return - fi - uvt-kvm wait $FLEXRAN_CTL_VM_NAME --insecure - FLEXRAN_CTL_VM_IP_ADDR=`uvt-kvm ip $FLEXRAN_CTL_VM_NAME` - - echo "$FLEXRAN_CTL_VM_NAME has for IP addr = $FLEXRAN_CTL_VM_IP_ADDR" - echo "FLEXRAN_CTL_VM_CMDS = $FLEXRAN_CTL_VM_CMDS" - echo "############################################################" - echo "Starting the FLEXRAN CONTROLLER" - echo "############################################################" - start_flexran_ctrl $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR - query_flexran_ctrl_status $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR 01_no_enb_connected - - echo "############################################################" - echo "Starting the eNB in FDD-5MHz mode with Flexran ON" - echo "############################################################" - CURRENT_ENB_LOG_FILE=fdd_05fMHz_enb.log - start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 lte-fdd-basic-sim.conf $FLEXRAN_CTL_VM_IP_ADDR - query_flexran_ctrl_status $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR 02_enb_connected - - echo "############################################################" - echo "Starting the UE in FDD-5MHz mode" - echo "############################################################" - CURRENT_UE_LOG_FILE=fdd_05fMHz_ue.log - start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 25 2680 - if [ $UE_SYNC -eq 0 ] - then - echo "Problem w/ eNB and UE not syncing" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR 0 - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - stop_flexran_ctrl $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - STATUS=-1 - return - fi - query_flexran_ctrl_status $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR 03_enb_ue_connected - get_ue_ip_addr $VM_CMDS $VM_IP_ADDR 1 - - sleep 30 - echo "############################################################" - echo "Terminate enb/ue simulators" - echo "############################################################" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR 0 - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - sleep 10 - - echo "############################################################" - echo "Stopping the FLEXRAN CONTROLLER" - echo "############################################################" - stop_flexran_ctrl $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR - scp -o StrictHostKeyChecking=no ubuntu@$FLEXRAN_CTL_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/flexran_ctl_*.log $ARCHIVES_LOC - fi - - echo "############################################################" - echo "Terminate EPC" - echo "############################################################" - - if [[ "$EPC_IPADDR" == "" ]] - then - terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - fi - - full_basic_sim_destroy - - echo "############################################################" - echo "Checking run status" - echo "############################################################" - - if [ $PING_STATUS -ne 0 ]; then STATUS=-1; fi - if [ $IPERF_STATUS -ne 0 ]; then STATUS=-1; fi - - if [ $STATUS -eq 0 ] - then - echo "TEST_OK" > $ARCHIVES_LOC/test_final_status.log - else - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - fi - fi - if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-rf-sim.* ]] then PING_STATUS=0 @@ -2343,11 +1932,11 @@ function run_test_on_vm { echo "SA test NOT OK" echo "try_cnt = " $try_cnt try_cnt=$((try_cnt+1)) - SA_106PRB_STATUS = -1 + SA_106PRB_STATUS=-1 else echo "SA test OK" try_cnt=$((try_cnt+10)) - SA_106PRB_STATUS = 0 + SA_106PRB_STATUS=0 fi done ########### end SA test @@ -2426,11 +2015,11 @@ function run_test_on_vm { echo "SA test NOT OK" echo "try_cnt = " $try_cnt try_cnt=$((try_cnt+1)) - SA_24PRB_STATUS = -1 + SA_24PRB_STATUS=-1 else echo "SA test OK" try_cnt=$((try_cnt+10)) - SA_24PRB_STATUS = 0 + SA_24PRB_STATUS=0 fi done ########### end SA test diff --git a/ci-scripts/waitBuildOnVM.sh b/ci-scripts/waitBuildOnVM.sh index 4a604a1fe94d8d1c466608a76fc6a174e0f18583..73a8b558fe506adc291e1ca4f3fd90ec6af38d17 100755 --- a/ci-scripts/waitBuildOnVM.sh +++ b/ci-scripts/waitBuildOnVM.sh @@ -47,7 +47,7 @@ function wait_on_vm_build { echo "ARCHIVES_LOC = $ARCHIVES_LOC" echo "BUILD_OPTIONS = $BUILD_OPTIONS" - if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] + if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-basic-sim"* ]] || [[ "$VM_NAME" == *"-flexran-rtc"* ]] then echo "This VM type is no longer supported in the pipeline framework" return @@ -93,7 +93,7 @@ function wait_on_vm_build { } function check_on_vm_build { - if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] + if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-basic-sim"* ]] || [[ "$VM_NAME" == *"-flexran-rtc"* ]] then echo "This VM type is no longer supported in the pipeline framework" return @@ -174,13 +174,13 @@ function check_on_vm_build { fi # If we were building the FlexRan Controller, flag-touch for basic-simulator to continue - if [[ "$VM_NAME" == *"-flexran-rtc"* ]] - then - if [[ $STATUS -eq 0 ]] - then - touch $JENKINS_WKSP/flexran/flexran_build_complete.txt - fi - fi + #if [[ "$VM_NAME" == *"-flexran-rtc"* ]] + #then + # if [[ $STATUS -eq 0 ]] + # then + # touch $JENKINS_WKSP/flexran/flexran_build_complete.txt + # fi + #fi if [[ "$VM_NAME" == *"-cppcheck"* ]] then diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 2476a75427d41e2f62c199a570510bebbac595a1..5dbd36f00d323af2240bb675acfb251827b020f5 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -75,7 +75,7 @@ <testCase id="040000"> <class>Initialize_eNB</class> <desc>Initialize gNB</desc> - <Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf -q --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time,line_num,function</Initialize_eNB_args> + <Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf -q --usrp-tx-thread-config 1 --T_stdout 2 --log_config.global_log_options level,nocolor,time,line_num,function</Initialize_eNB_args> <eNB_instance>1</eNB_instance> <eNB_serverId>1</eNB_serverId> <air_interface>nr</air_interface> diff --git a/ci-scripts/yaml_files/5g_rfsimulator/README.md b/ci-scripts/yaml_files/5g_rfsimulator/README.md index fc562dd1eb97521aef7471435d04c1daef2ccc70..5eb2a789a94c30ae294a65680cd1864f0d476ffc 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator/README.md +++ b/ci-scripts/yaml_files/5g_rfsimulator/README.md @@ -23,6 +23,7 @@ This page is only valid for an `Ubuntu18` host. 1. [Deploy OAI 5G Core Network](#21-deploy-oai-5g-core-network) 2. [Deploy OAI gNB in RF simulator mode and in Standalone Mode](#22-deploy-oai-gnb-in-rf-simulator-mode-and-in-standalone-mode) 3. [Deploy OAI NR-UE in RF simulator mode and in Standalone Mode](#23-deploy-oai-nr-ue-in-rf-simulator-mode-and-in-standalone-mode) + 4. [Deploy Second OAI NR-UE in RF simulator mode and in Standalone Mode](#24-deploy-second-oai-nr-ue-in-rf-simulator-mode-and-in-standalone-mode) 3. [Check traffic](#3-check-traffic) 1. [Check your Internet connectivity](#31-check-your-internet-connectivity) 2. [Start the iperf server inside the NR-UE container](#32-start-the-iperf-server-inside-the-nr-ue-container) @@ -203,6 +204,8 @@ $ docker logs rfsim5g-oai-amf $ docker-compose up -d oai-nr-ue rfsim5g-mysql is up-to-date rfsim5g-oai-nrf is up-to-date +rfsim5g-oai-amf is up-to-date +rfsim5g-oai-smf is up-to-date rfsim5g-oai-spgwu is up-to-date rfsim5g-oai-ext-dn is up-to-date rfsim5g-oai-gnb is up-to-date @@ -255,6 +258,98 @@ oaitun_ue1: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ``` +## 2.4. Deploy Second OAI NR-UE in RF simulator mode and in Standalone Mode ## + +```bash +Create a entry for new IMSI (208990100001101) in oai_db.sql file +Refer Section - [Making the NR-UE connect to the core network](#51-making-the-nr-ue-connect-to-the-core-network) + +Create entry for Second UE in docker-compose.yaml file as follows: + oai-nr-ue2: + image: oai-nr-ue:develop + privileged: true + container_name: rfsim5g-oai-nr-ue2 + environment: + RFSIMULATOR: 192.168.71.136 + FULL_IMSI: '208990100001101' + FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' + OPC: 'C42449363BBAD02B66D16BC975D77CC1' + DNN: oai + NSSAI_SST: 1 + NSSAI_SD: 1 + USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 -C 3619200000 --nokrnmod --log_config.global_log_options level,nocolor,time + depends_on: + - oai-gnb + networks: + public_net: + ipv4_address: 192.168.71.138 + healthcheck: + test: /bin/bash -c "pgrep nr-uesoftmodem" + interval: 10s + timeout: 5s + retries: 5 +``` + + +```bash +$ docker-compose up -d oai-nr-ue2 +rfsim5g-mysql is up-to-date +rfsim5g-oai-nrf is up-to-date +rfsim5g-oai-amf is up-to-date +rfsim5g-oai-smf is up-to-date +rfsim5g-oai-spgwu is up-to-date +rfsim5g-oai-ext-dn is up-to-date +rfsim5g-oai-gnb is up-to-date +Creating rfsim5g-oai-nr-ue2 ... done +``` + +Wait for a bit. + +```bash +$ docker-compose ps -a + Name Command State Ports +------------------------------------------------------------------------------------------------- +rfsim5g-mysql docker-entrypoint.sh mysqld Up (healthy) 3306/tcp, 33060/tcp +rfsim5g-oai-amf /bin/bash /openair-amf/bin ... Up (healthy) 38412/sctp, 80/tcp, 9090/tcp +rfsim5g-oai-ext-dn /bin/bash -c apt update; ... Up (healthy) +rfsim5g-oai-gnb /opt/oai-gnb/bin/entrypoin ... Up (healthy) +rfsim5g-oai-nr-ue /opt/oai-nr-ue/bin/entrypo ... Up (healthy) +rfsim5g-oai-nr-ue2 /opt/oai-nr-ue/bin/entrypo ... Up (healthy) +rfsim5g-oai-nrf /bin/bash /openair-nrf/bin ... Up (healthy) 80/tcp, 9090/tcp +rfsim5g-oai-smf /bin/bash /openair-smf/bin ... Up (healthy) 80/tcp, 8805/udp, 9090/tcp +rfsim5g-oai-spgwu /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp +``` + +Making sure the Second OAI UE is connected: + +```bash +$ docker exec -it rfsim5g-oai-nr-ue2 /bin/bash +root@bb4d400a832d:/opt/oai-nr-ue# ifconfig +eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 + inet 192.168.71.138 netmask 255.255.255.192 broadcast 192.168.71.191 + ether 02:42:c0:a8:47:8a txqueuelen 0 (Ethernet) + RX packets 3192021 bytes 67784900946 (67.7 GB) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 3397743 bytes 91320004542 (91.3 GB) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 + +lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 + inet 127.0.0.1 netmask 255.0.0.0 + loop txqueuelen 1000 (Local Loopback) + RX packets 0 bytes 0 (0.0 B) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 0 bytes 0 (0.0 B) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 + +oaitun_ue1: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500 + inet 12.1.1.3 netmask 255.255.255.0 destination 12.1.1.3 + unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC) + RX packets 0 bytes 0 (0.0 B) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 0 bytes 0 (0.0 B) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 +``` + # 3. Check traffic # ## 3.1. Check your Internet connectivity ## @@ -299,6 +394,9 @@ Let now try to check UDP traffic in Downlink. You will need 2 terminals: one in the NR-UE container, one in the ext-dn container. +Note: +Similarly, Second OAI UE Internet connectivity can be checked. + ## 3.2. Start the `iperf` server inside the NR-UE container ## ```bash @@ -384,24 +482,26 @@ The `500 Kbits/sec` value may change depending on your CPU power! ```bash $ docker-compose down +Stopping rfsim5g-oai-nr-ue2 ... done Stopping rfsim5g-oai-nr-ue ... done Stopping rfsim5g-oai-gnb ... done Stopping rfsim5g-oai-ext-dn ... done +Stopping rfsim5g-oai-spgwu ... done Stopping rfsim5g-oai-smf ... done Stopping rfsim5g-oai-amf ... done -Stopping rfsim5g-oai-spgwu ... done Stopping rfsim5g-oai-nrf ... done Stopping rfsim5g-mysql ... done +Removing rfsim5g-oai-nr-ue2 ... done Removing rfsim5g-oai-nr-ue ... done Removing rfsim5g-oai-gnb ... done Removing rfsim5g-oai-ext-dn ... done +Removing rfsim5g-oai-spgwu ... done Removing rfsim5g-oai-smf ... done Removing rfsim5g-oai-amf ... done -Removing rfsim5g-oai-spgwu ... done Removing rfsim5g-oai-nrf ... done Removing rfsim5g-mysql ... done Removing network rfsim5g-oai-public-net -Removing network rfsim5g-oai-traffic_net-net +Removing network rfsim5g-oai-traffic-net ``` # 5. Explanations on the configuration in the `docker-compose.yaml` # @@ -419,13 +519,19 @@ This value is also present in the `oai_db.sql` file: ```bash INSERT INTO `users` VALUES ('208990100001100','1','55000000000000',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0xfec86ba6eb707ed08905757b1bb44b8f,0,0,0x40,'ebd07771ace8677a',0xc42449363bbad02b66d16bc975d77cc1); +INSERT INTO `users` VALUES ('208990100001101','1','55000000000000',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0xfec86ba6eb707ed08905757b1bb44b8f,0,0,0x40,'ebd07771ace8677a',0xc42449363bbad02b66d16bc975d77cc1); ``` As you can see, 2 other values shall match in the NR-UE section of `docker-compose.yaml`: +OAI UE - 1 * `FULL_IMSI: '208990100001100'` * `FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'` +OAI UE - 2 +* `FULL_IMSI: '208990100001101'` +* `FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'` + We are also using a dedicated `oai-smf.conf` for the `SMF` container: the `oai` DNN shall match the one in the NR-UE section of `docker-compose.yaml` (`DNN: oai`). ## 5.2. Making the gNB connect to the core network ## diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 7975d4bc77c2a05579a18f6006aa32f85d195227..46e33e880334ba7e8b8ab4858e4b6a7b62525832 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -755,27 +755,6 @@ add_library(oai_irisdevif MODULE ${HWLIB_IRIS_SOURCE}) target_include_directories(oai_irisdevif PRIVATE /usr/local/lib/SoapySDR/modules0.7/) target_link_libraries(oai_irisdevif SoapySDR) -# TCP bridge libraries -###################################################################### - -# this one is for internal use at Eurecom and is not documented -set(HWLIB_TCP_BRIDGE_SOURCE - ${OPENAIR_TARGETS}/ARCH/tcp_bridge/tcp_bridge.c - ) -add_library(tcp_bridge MODULE ${HWLIB_TCP_BRIDGE_SOURCE} ) - -#get_target_property(tcp_bridge_cflags tcp_bridge COMPILE_FLAGS) -#set_target_properties(tcp_bridge PROPERTIES COMPILE_FLAGS "${tcp_bridge_cflags} -fvisibility=hidden") -set_target_properties(tcp_bridge PROPERTIES COMPILE_FLAGS "-fvisibility=hidden") - -# this one is to connect OAI eNB and OAI UE in the basic simulator -# see targets/ARCH/tcp_bridge/README.tcp_bridge_oai for usage -set(HWLIB_TCP_BRIDGE_OAI_SOURCE - ${OPENAIR_TARGETS}/ARCH/tcp_bridge/tcp_bridge_oai.c - ) -add_library(tcp_bridge_oai MODULE ${HWLIB_TCP_BRIDGE_OAI_SOURCE} ) -set_target_properties(tcp_bridge_oai PROPERTIES COMPILE_FLAGS "-fvisibility=hidden") - # Benetel 4G library ###################################################################### @@ -3008,8 +2987,7 @@ if (${T_TRACER}) #all "add_library" definitions ITTI RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP params_libconfig oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer - oai_eth_transpro oai_mobipass tcp_bridge tcp_bridge_oai - coding FLPT_MSG FLEXRAN_AGENT HASHTABLE UTIL OMG_SUMO + oai_eth_transpro oai_mobipass coding FLPT_MSG FLEXRAN_AGENT HASHTABLE UTIL OMG_SUMO SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 930f2a7f77f6960553c613f85cadc6242bf03bf7..c65728a41d623917680f3be13205369e1ae3e3bb 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -894,11 +894,6 @@ function main() { compilations \ $BUILD_DIR rfsimulator \ librfsimulator.so $dbin/librfsimulator.so.$REL - - echo_info "Compiling tcp_bridge_oai" - compilations \ - $BUILD_DIR tcp_bridge_oai \ - libtcp_bridge_oai.so $dbin/libtcp_bridge_oai.so.$REL fi #build transport protocol libraries (currently only ETHERNET is available) diff --git a/common/utils/T/T.c b/common/utils/T/T.c index 49742bf600795016afb6f168003bcfd2d31137a2..2d724ffd0024dd08c9a25663a5039cebbb3df642 100644 --- a/common/utils/T/T.c +++ b/common/utils/T/T.c @@ -33,12 +33,6 @@ volatile int _T_freelist_head; volatile int *T_freelist_head = &_T_freelist_head; T_cache_t *T_cache; -#if BASIC_SIMULATOR - /* global variables used by T_GET_SLOT, see in T.h */ - volatile uint64_t T_next_id; - volatile uint64_t T_active_id; -#endif - static void get_message(int s) { char t; int l; diff --git a/common/utils/T/T.h b/common/utils/T/T.h index 014294505454bd8640fa55525812e6c0dccf543e..df1e95d2df3289f2919b76f070a5a1fa88ad52f2 100644 --- a/common/utils/T/T.h +++ b/common/utils/T/T.h @@ -111,39 +111,8 @@ typedef struct { extern volatile int *T_freelist_head; extern T_cache_t *T_cache; extern int *T_active; -/* When running the basic simulator, we may fill the T cache too fast. - * Let's serialize write accesses to the T cache. For that, we use a - * 'ticket' mechanism. To acquire a T slot the caller needs to own the - * current active ticket. We also wait for the slot to be free if - * it is already in use. - */ -#if BASIC_SIMULATOR -# define T_GET_SLOT \ - do { \ - extern volatile uint64_t T_next_id; \ - extern volatile uint64_t T_active_id; \ - uint64_t id; \ - /* get a ticket */ \ - id = __sync_fetch_and_add(&T_next_id, 1); \ - /* wait for our turn */ \ - while (id != __sync_fetch_and_add(&T_active_id, 0)) /* busy wait */; \ - /* this is our turn, try to acquire the slot until it's free */ \ - do { \ - T_LOCAL_busy = __sync_fetch_and_or(&T_cache[T_LOCAL_slot].busy, 0x01); \ - if (T_LOCAL_busy & 0x01) usleep(100); \ - } while (T_LOCAL_busy & 0x01); \ - /* check that there are still some tickets */ \ - if (__sync_fetch_and_add(&T_active_id, 0) == 0xffffffffffffffff) { \ - printf("T: reached the end of times, bye...\n"); \ - abort(); \ - } \ - /* free our ticket, which signals the next waiter that it's its turn */ \ - (void)__sync_fetch_and_add(&T_active_id, 1); \ - } while (0) -#else -# define T_GET_SLOT \ +#define T_GET_SLOT \ T_LOCAL_busy = __sync_fetch_and_or(&T_cache[T_LOCAL_slot].busy, 0x01); -#endif /* used at header of Tn, allocates buffer */ #define T_LOCAL_DATA \ diff --git a/common/utils/T/T_defs.h b/common/utils/T/T_defs.h index b74c0567ce7333544d8a29f95419b1f08eb57f85..00e0df496304b9888869aaf04dfb5652c58d199e 100644 --- a/common/utils/T/T_defs.h +++ b/common/utils/T/T_defs.h @@ -40,20 +40,10 @@ #define T_MAX_ARGS 16 /* maximum size of a message - increase if needed */ -#if BASIC_SIMULATOR - /* let's have 100 RBs functional for the basic simulator */ -# define T_BUFFER_MAX (1024*64*4) -#else -# define T_BUFFER_MAX (1024*64*4) -#endif +#define T_BUFFER_MAX (1024*64*4) /* size of the local cache for messages (must be pow(2,something)) */ -#if BASIC_SIMULATOR - /* we don't need much space for the basic simulator */ -# define T_CACHE_SIZE 1024 -#else -# define T_CACHE_SIZE (8192) -#endif +#define T_CACHE_SIZE (8192) /* maximum number of bytes a message can contain */ #ifdef T_SEND_TIME diff --git a/common/utils/T/local_tracer.c b/common/utils/T/local_tracer.c index 539e72b2239e0268f7fb949ac8dd9c93bf15f975..b4f1804c41c2bf8dd0962ac6c983858e20610e8f 100644 --- a/common/utils/T/local_tracer.c +++ b/common/utils/T/local_tracer.c @@ -357,22 +357,6 @@ static void forward(void *_forwarder, char *buf, int size) { if (f->tail != NULL) f->tail->next = new; f->tail = new; -#if BASIC_SIMULATOR - /* When runnng the basic simulator, the tracer may be too slow. - * Let's not take too much memory in the tracee and - * wait if there is too much data to send. 200MB is - * arbitrary. - */ - while (f->memusage > 200 * 1024 * 1024) { - if (pthread_cond_signal(&f->cond)) abort(); - - if (pthread_mutex_unlock(&f->lock)) abort(); - - usleep(1000); - - if (pthread_mutex_lock(&f->lock)) abort(); - } -#endif f->memusage += size+4; /* warn every 100MB */ diff --git a/doc/BASIC_SIM.md b/doc/BASIC_SIM.md deleted file mode 100644 index 1bfc6e76d203c222d520a190a4053590fc6e1d96..0000000000000000000000000000000000000000 --- a/doc/BASIC_SIM.md +++ /dev/null @@ -1,191 +0,0 @@ -<table style="border-collapse: collapse; border: none;"> - <tr style="border-collapse: collapse; border: none;"> - <td style="border-collapse: collapse; border: none;"> - <a href="http://www.openairinterface.org/"> - <img src="./images/oai_final_logo.png" alt="" border=3 height=50 width=150> - </img> - </a> - </td> - <td style="border-collapse: collapse; border: none; vertical-align: center;"> - <b><font size = "5">Running OAI Basic Simulator</font></b> - </td> - </tr> -</table> - -This page is valid on the following branches: - -- `master` starting from tag `v1.1.0` -- `develop` starting from tag `2019.w11` - -# 1. Building the basic-simulator. - -After the build simplification, the basic simulator is available directly from the standard build. - -```bash -$ source oaienv -$ cd cmake_targets -$ ./build_oai --eNB --UE -``` - -Both eNB (lte-softmodem) and UE (lte-uesoftmodem) are present on `cmake_targets/ran_build/build` folder. - -More details are available on the [build page](BUILD.md). - -# 2. Running the basic simulator. - -The basic simulator is a oai device replacing the radio heads (for example the USRP device). It allows connecting the oai UE and the oai eNodeB through a network interface carrying the time-domain samples, getting rid of over the air unpredictable perturbations. - -This is the ideal tool to check signal processing algorithms and protocols implementation and having debug sessions without any HW radio equipment. - -The main limitations are: - -- A single OAI UE will connect to the OAI eNB -- No channel noise - -## 2.1. Starting eNB - -The basic simulator is able to run with a connected EPC or without any (the so-called "noS1" mode). - -Example 1: running in FDD mode with EPC. - -```bash -$ source oaienv -$ cd cmake_targets/ran_build/build -$ ENODEB=1 sudo -E ./lte-softmodem -O $OPENAIR_HOME/ci-scripts/conf_files/lte-fdd-basic-sim.conf --basicsim -``` - -Edit previously the `ci-scripts/conf_files/lte-fdd-basic-sim.conf` file to modify: - -- `N_RB_DL` field to change the Bandwidth (25, 50, 100) -- `CI_MME_IP_ADDR` with the EPC IP address -- `CI_ENB_IP_ADDR` with the container (physical server, virtual machine, ...) on which you are executing the eNB soft-modem - -Example 2: running in TDD mode without any EPC. - -```bash -$ source oaienv -$ cd cmake_targets/ran_build/build -$ ENODEB=1 sudo -E ./lte-softmodem -O $OPENAIR_HOME/ci-scripts/conf_files/lte-tdd-basic-sim.conf --basicsim --noS1 -``` - -## 2.2. Starting UE - -Before starting the UE, you may need to edit the SIM parameters to adapt to your eNB configuration and HSS database. - -The <conf> file to use for conf2uedate is `openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf` - -You need to set the correct OPC, USIM_API_K, MSIN (this is the end par of the IMSI), HPLMN (the front part of IMSI) to match values from HSS. - -```bash -$ source oaienv -# Edit openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -$ cd cmake_targets/ran_build/build -$ ../../nas_sim_tools/build/conf2uedata -c $OPENAIR_HOME/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -o . -$ sudo -E ./lte-uesoftmodem -C 2625000000 -r 25 --ue-rxgain 140 --basicsim [--noS1] -``` - -The `-r 25` is to use if in the conf file of the eNB you use N_RB_DL=25. Use 50 if you have N_RB_DL=50 and 100 if you have N_RB_DL=100. - -The `-C 2625000000` is the downlink frequency. Use the same value as `downlink_frequency` in the eNB configuration file. - -The `--noS1` is mandatory if you started the eNB in that mode. - -# 3. Testing the data plane - -# 3.1. In S1 mode - -First we need to retrieve the IP address allocated to the OAI UE. - -On the server that runs the UE: - -```bash -$ ifconfig oaitun_ue1 -oaitun_ue1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 - inet addr:192.172.0.2 P-t-P:192.172.0.2 Mask:255.255.255.0 -... -``` - -`192.172.0.2` is the IP address that has been allocated by the SPGW in the EPC. - -On the server that runs the EPC: - -```bash -$ ping -c 20 192.172.0.2 - --- 192.172.0.2 ping statistics --- - 20 packets transmitted, 20 received, 0% packet loss, time 19020ms - rtt min/avg/max/mdev = 13.241/18.999/24.208/2.840 ms -``` - -You can ping the EPC from the UE: - -```bash -$ ping -I oaitun_ue1 -c 20 192.172.0.1 - --- 192.172.0.1 ping statistics --- -... - 20 packets transmitted, 20 received, 0% packet loss, time 19019ms - rtt min/avg/max/mdev = 13.015/18.674/23.738/2.917 ms -``` - -For DL iperf testing: - -On the server that runs the UE. - -```bash -$ iperf -B 192.172.0.2 -u -s -i 1 -fm -p 5001 -``` - -On the server that runs the EPC. - -```bash -$ iperf -c 192.172.0.2 -u -t 30 -b 10M -i 1 -fm -B 192.172.0.1 -p 5001 -``` - -For UL iperf testing: - -On the server that runs the EPC. - -```bash -$ iperf -B 192.172.0.1 -u -s -i 1 -fm -p 5001 -``` - -On the server that runs the UE. - -```bash -$ iperf -c 192.172.0.1 -u -t 30 -b 2M -i 1 -fm -B 192.172.0.2 -p 5001 -``` - -# 3.2. In noS1 mode - -The IP addresses are fixed. But we can still retrieve them programmatically. - -For the UE it is quite the same: - -```bash -$ ifconfig oaitun_ue1 -oaitun_ue1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 - inet addr:10.0.1.2 P-t-P:10.0.1.2 Mask:255.255.255.0 -... -``` - -For the eNB: - -```bash -$ ifconfig oaitun_enb1 -oaitun_enb1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 - inet addr:10.0.1.1 P-t-P:10.0.1.1 Mask:255.255.255.0 -... -``` - -Pinging like this: - -```bash -$ ping -I oaitun_ue1 -c 20 10.0.1.1 -$ ping -I oaitun_enb1 -c 20 10.0.1.2 -``` - -And the same for iperf: - -```bash -$ iperf -B 10.0.1.2 -u -s -i 1 -fm -$ iperf -c 10.0.1.2 -u -b 1.00M -t 30 -i 1 -fm -B 10.0.1.1 -``` diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md index 7ee3ae9d7e6d01bf42fdb0c961754f06fbad2f02..919bbc2dc06fdf1a6b783d51e79711c2f9cc5bc7 100644 --- a/doc/RUNMODEM.md +++ b/doc/RUNMODEM.md @@ -14,10 +14,6 @@ After you have [built the softmodem executables](BUILD.md) you can set your default directory to the build directory `cmake_targets/ran_build/build/` and start testing some use cases. Below, the description of the different oai functionalities should help you choose the oai configuration that suits your need. -# Basic Simulator - -See the [dedicated page](BASIC_SIM.md). - # RF Simulator The rf simulator is a oai device replacing the radio heads (for example the USRP device). It allows connecting the oai UE (LTE or 5G) and respectively the oai eNodeB or gNodeB through a network interface carrying the time-domain samples, getting rid of over the air unpredictable perturbations. This is the ideal tool to check signal processing algorithms and protocols implementation. The rf simulator has some preliminary support for channel modeling. diff --git a/docker/Dockerfile.eNB.rhel8.2 b/docker/Dockerfile.eNB.rhel8.2 index 6c921a493226808c49ac80dde8d55dcf697c65a9..7924f5bd78844f99c7603f79a5f31f218945491b 100644 --- a/docker/Dockerfile.eNB.rhel8.2 +++ b/docker/Dockerfile.eNB.rhel8.2 @@ -62,7 +62,6 @@ COPY --from=enb-build \ COPY --from=enb-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libcoding.so \ diff --git a/docker/Dockerfile.eNB.rhel8.2.oc4-4 b/docker/Dockerfile.eNB.rhel8.2.oc4-4 index 5b784c08a28f0c47d79e384c08bc46f3834ade68..03f6ec8e45472d70bdbb211c6cf2f80ef53b3f92 100644 --- a/docker/Dockerfile.eNB.rhel8.2.oc4-4 +++ b/docker/Dockerfile.eNB.rhel8.2.oc4-4 @@ -62,7 +62,6 @@ COPY --from=enb-build /oai-ran/targets/bin/lte-softmodem.Rel15 . WORKDIR /usr/local/lib/ COPY --from=enb-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 . -COPY --from=enb-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 . COPY --from=enb-build /oai-ran/targets/bin/librfsimulator.so.Rel15 . COPY --from=enb-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 . COPY --from=enb-build /oai-ran/targets/bin/libcoding.so . @@ -95,7 +94,6 @@ RUN ldconfig #debug RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15 -RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15 RUN ldd /usr/local/lib/librfsimulator.so.Rel15 RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15 RUN ldd /usr/local/lib/libcoding.so diff --git a/docker/Dockerfile.eNB.ubuntu18 b/docker/Dockerfile.eNB.ubuntu18 index 1f375a20dc9ab0725258024ad1433128008946c8..222a7f42bbac0cf7f0c61c6fc86cc264f1db6adb 100644 --- a/docker/Dockerfile.eNB.ubuntu18 +++ b/docker/Dockerfile.eNB.ubuntu18 @@ -69,7 +69,6 @@ COPY --from=enb-build \ COPY --from=enb-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libcoding.so \ diff --git a/docker/Dockerfile.gNB.rhel8.2 b/docker/Dockerfile.gNB.rhel8.2 index 703f4c67b5e1748a9405f5e348522bc659c40b5b..6a1b447a6253941542614a0e49d1f994d727e221 100644 --- a/docker/Dockerfile.gNB.rhel8.2 +++ b/docker/Dockerfile.gNB.rhel8.2 @@ -64,7 +64,6 @@ COPY --from=gnb-build \ COPY --from=gnb-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libcoding.so \ diff --git a/docker/Dockerfile.gNB.rhel8.2.oc4-4 b/docker/Dockerfile.gNB.rhel8.2.oc4-4 index 1e1eba016e34c503f9b87ae3c26f5cbf2df21430..6c88d3ad8e6fa09b73cd561060bd37145838e45a 100644 --- a/docker/Dockerfile.gNB.rhel8.2.oc4-4 +++ b/docker/Dockerfile.gNB.rhel8.2.oc4-4 @@ -65,7 +65,6 @@ COPY --from=gnb-build /oai-ran/targets/bin/nr-softmodem.Rel15 . WORKDIR /usr/local/lib/ COPY --from=gnb-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 . -COPY --from=gnb-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 . COPY --from=gnb-build /oai-ran/targets/bin/librfsimulator.so.Rel15 . COPY --from=gnb-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 . COPY --from=gnb-build /oai-ran/targets/bin/libcoding.so . @@ -102,7 +101,6 @@ RUN ldconfig #debug RUN ldd /opt/oai-gnb/bin/nr-softmodem.Rel15 RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15 -RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15 RUN ldd /usr/local/lib/librfsimulator.so.Rel15 RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15 RUN ldd /usr/local/lib/libcoding.so diff --git a/docker/Dockerfile.gNB.ubuntu18 b/docker/Dockerfile.gNB.ubuntu18 index 24e4bcbc7c16762ea0787a9109934dfc2d517d4f..6f990db833575f21f519d1cc6f909c11a636e299 100644 --- a/docker/Dockerfile.gNB.ubuntu18 +++ b/docker/Dockerfile.gNB.ubuntu18 @@ -68,7 +68,6 @@ COPY --from=gnb-build \ COPY --from=gnb-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libcoding.so \ diff --git a/docker/Dockerfile.lteRU.rhel8.2 b/docker/Dockerfile.lteRU.rhel8.2 index 5addbca65565be888cb3fc07772c8e97ba23fd94..b41aee36dcac74969c1cc76fbbbc3db9202fa1a9 100644 --- a/docker/Dockerfile.lteRU.rhel8.2 +++ b/docker/Dockerfile.lteRU.rhel8.2 @@ -59,7 +59,6 @@ COPY --from=ru-build \ COPY --from=ru-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libparams_libconfig.so \ diff --git a/docker/Dockerfile.lteRU.ubuntu18 b/docker/Dockerfile.lteRU.ubuntu18 index 1f1c903a159fc19a3decf88f9f54633bef231635..1810afb621551a6f12e03869f06ff5780320ca93 100644 --- a/docker/Dockerfile.lteRU.ubuntu18 +++ b/docker/Dockerfile.lteRU.ubuntu18 @@ -64,7 +64,6 @@ COPY --from=ru-build \ COPY --from=ru-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libparams_libconfig.so \ diff --git a/docker/Dockerfile.lteUE.rhel8.2 b/docker/Dockerfile.lteUE.rhel8.2 index f547558bdb7cab32f41da185f9ee4ca79de6a788..cc1be3d41d5c68e93be5298f89401db25cf59ca3 100644 --- a/docker/Dockerfile.lteUE.rhel8.2 +++ b/docker/Dockerfile.lteUE.rhel8.2 @@ -66,7 +66,6 @@ COPY --from=lte-ue-build \ COPY --from=lte-ue-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libcoding.so \ diff --git a/docker/Dockerfile.lteUE.rhel8.2.oc4-4 b/docker/Dockerfile.lteUE.rhel8.2.oc4-4 index 1339d18de62c244d7db97b6bdd5bf3a292e1d1ca..cc492882f53d49f6cb9d4b9bbda8ba138b134d97 100644 --- a/docker/Dockerfile.lteUE.rhel8.2.oc4-4 +++ b/docker/Dockerfile.lteUE.rhel8.2.oc4-4 @@ -68,7 +68,6 @@ COPY --from=lte-ue-build /oai-ran/targets/bin/.usim.nvram0 . WORKDIR /usr/local/lib/ COPY --from=lte-ue-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 . -COPY --from=lte-ue-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 . COPY --from=lte-ue-build /oai-ran/targets/bin/librfsimulator.so.Rel15 . COPY --from=lte-ue-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 . COPY --from=lte-ue-build /oai-ran/targets/bin/libcoding.so . @@ -105,7 +104,6 @@ RUN ldd /opt/oai-lte-ue/bin/conf2uedata RUN ldd /opt/oai-lte-ue/bin/nvram RUN ldd /opt/oai-lte-ue/bin/usim RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15 -RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15 RUN ldd /usr/local/lib/librfsimulator.so.Rel15 RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15 RUN ldd /usr/local/lib/libcoding.so diff --git a/docker/Dockerfile.lteUE.ubuntu18 b/docker/Dockerfile.lteUE.ubuntu18 index a5bf4cfe9441c5fa0d4c9c9b2fefb4bf6db4de1e..292ac37e5f0f09520fbfb7fa2cda5ede1ca0291c 100644 --- a/docker/Dockerfile.lteUE.ubuntu18 +++ b/docker/Dockerfile.lteUE.ubuntu18 @@ -73,7 +73,6 @@ COPY --from=lte-ue-build \ COPY --from=lte-ue-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libcoding.so \ diff --git a/docker/Dockerfile.nrUE.rhel8.2 b/docker/Dockerfile.nrUE.rhel8.2 index cbc8d8c65fd87db590233a6012b59def69bbc04e..d38e81bd71eec16ce5782c29ff2a21a8dfc3ad8e 100644 --- a/docker/Dockerfile.nrUE.rhel8.2 +++ b/docker/Dockerfile.nrUE.rhel8.2 @@ -66,7 +66,6 @@ COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/nr-ue-sim.conf . COPY --from=nr-ue-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libcoding.so \ diff --git a/docker/Dockerfile.nrUE.rhel8.2.oc4-4 b/docker/Dockerfile.nrUE.rhel8.2.oc4-4 index d900fff998d633eccaa0685dc71bad20820de92a..2d018c96af0232105340a01e1064c30c19ade449 100644 --- a/docker/Dockerfile.nrUE.rhel8.2.oc4-4 +++ b/docker/Dockerfile.nrUE.rhel8.2.oc4-4 @@ -64,7 +64,6 @@ COPY --from=nr-ue-build /oai-ran/targets/bin/nr-uesoftmodem.Rel15 . WORKDIR /usr/local/lib/ COPY --from=nr-ue-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 . -COPY --from=nr-ue-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 . COPY --from=nr-ue-build /oai-ran/targets/bin/librfsimulator.so.Rel15 . COPY --from=nr-ue-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 . COPY --from=nr-ue-build /oai-ran/targets/bin/libcoding.so . @@ -100,7 +99,6 @@ COPY --from=nr-ue-build /usr/local/lib64/libuhd.so.4.0.0 /usr/local/lib64 RUN ldconfig RUN ldd /opt/oai-nr-ue/bin/nr-uesoftmodem.Rel15 RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15 -RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15 RUN ldd /usr/local/lib/librfsimulator.so.Rel15 RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15 RUN ldd /usr/local/lib/libcoding.so diff --git a/docker/Dockerfile.nrUE.ubuntu18 b/docker/Dockerfile.nrUE.ubuntu18 index 126f268e000e24bdf552dbe27482d4573eec8379..0fa219296b7b7e52327b46baf190c630ec5a5b0f 100644 --- a/docker/Dockerfile.nrUE.ubuntu18 +++ b/docker/Dockerfile.nrUE.ubuntu18 @@ -71,7 +71,6 @@ COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/nr-ue-sim.conf . COPY --from=nr-ue-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libcoding.so \ diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 76c21bb422043d1aa1e00111d366e0a21a6401ed..00f019c03ae82bb64ddd5c18ab897d1575150d71 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -373,7 +373,7 @@ void init_openair0(void) { static void init_pdcp(int ue_id) { uint32_t pdcp_initmask = (!IS_SOFTMODEM_NOS1) ? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT); - /*if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) { + /*if (IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) { pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT; }*/ diff --git a/executables/softmodem-common.c b/executables/softmodem-common.c index 12c60e98fdf17446583e96da7ba9938dce09ff4e..c78fc70243c6e138f06e9a2cb89fc0be46e2c8c9 100644 --- a/executables/softmodem-common.c +++ b/executables/softmodem-common.c @@ -89,7 +89,7 @@ void get_common_options(uint32_t execmask) { uint32_t glog_level=0 ; uint32_t start_telnetsrv = 0, start_telnetclt = 0; uint32_t noS1 = 0, nokrnmod = 1, nonbiot = 0; - uint32_t rfsim = 0, basicsim = 0, do_forms = 0; + uint32_t rfsim = 0, do_forms = 0; char *logmem_filename = NULL; paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ; paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ; @@ -141,10 +141,6 @@ void get_common_options(uint32_t execmask) { set_softmodem_optmask(SOFTMODEM_RFSIM_BIT); } - if (basicsim) { - set_softmodem_optmask(SOFTMODEM_BASICSIM_BIT); - } - if (do_forms) { set_softmodem_optmask(SOFTMODEM_DOSCOPE_BIT); } diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h index 8d6735b1994bece407133eb757131fea5fb6c24d..48ce73149f1612e04412ace6737abda0f0b40a6c 100644 --- a/executables/softmodem-common.h +++ b/executables/softmodem-common.h @@ -93,7 +93,7 @@ extern "C" #define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n" #define CONFIG_HLP_NOS1 "Disable s1 interface\n" -#define CONFIG_HLP_RFSIM "Run in rf simulator mode (also known as basic simulator)\n" +#define CONFIG_HLP_RFSIM "Run in rf simulator mode\n" #define CONFIG_HLP_NOKRNMOD "(noS1 only): Use tun instead of namesh module \n" #define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n" #define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n" @@ -156,7 +156,6 @@ extern int usrp_tx_thread; {"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \ {"noS1", CONFIG_HLP_NOS1, PARAMFLAG_BOOL, uptr:&noS1, defintval:0, TYPE_INT, 0}, \ {"rfsim", CONFIG_HLP_RFSIM, PARAMFLAG_BOOL, uptr:&rfsim, defintval:0, TYPE_INT, 0}, \ - {"basicsim", CONFIG_HLP_RFSIM, PARAMFLAG_BOOL, uptr:&basicsim, defintval:0, TYPE_INT, 0}, \ {"nokrnmod", CONFIG_HLP_NOKRNMOD, PARAMFLAG_BOOL, uptr:&nokrnmod, defintval:0, TYPE_INT, 0}, \ {"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, uptr:&nonbiot, defuintval:0, TYPE_INT, 0}, \ {"nsa", CONFIG_HLP_NSA, PARAMFLAG_BOOL, iptr:&NSA, defintval:0, TYPE_INT, 0}, \ @@ -204,7 +203,6 @@ extern int usrp_tx_thread; #define SOFTMODEM_NOKRNMOD_BIT (1<<1) #define SOFTMODEM_NONBIOT_BIT (1<<2) #define SOFTMODEM_RFSIM_BIT (1<<10) -#define SOFTMODEM_BASICSIM_BIT (1<<11) #define SOFTMODEM_SIML1_BIT (1<<12) #define SOFTMODEM_DOSCOPE_BIT (1<<15) #define SOFTMODEM_RECPLAY_BIT (1<<16) @@ -221,7 +219,6 @@ extern int usrp_tx_thread; #define IS_SOFTMODEM_NOKRNMOD ( get_softmodem_optmask() & SOFTMODEM_NOKRNMOD_BIT) #define IS_SOFTMODEM_NONBIOT ( get_softmodem_optmask() & SOFTMODEM_NONBIOT_BIT) #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_DOSCOPE ( get_softmodem_optmask() & SOFTMODEM_DOSCOPE_BIT) #define IS_SOFTMODEM_IQPLAYER ( get_softmodem_optmask() & SOFTMODEM_RECPLAY_BIT) diff --git a/openair1/PHY/INIT/lte_param_init.c b/openair1/PHY/INIT/lte_param_init.c index 504c8fa80a0f284d732d549c3d6d2af6c03d7d12..5b661d7c2df82d6f3fda08fc1add7275211fcde1 100644 --- a/openair1/PHY/INIT/lte_param_init.c +++ b/openair1/PHY/INIT/lte_param_init.c @@ -151,11 +151,5 @@ void lte_param_init(PHY_VARS_eNB **eNBp, else if (eNB->frame_parms.N_RB_DL == 25) ru->N_TA_offset = 624/4; } else ru->N_TA_offset=0; - if (IS_SOFTMODEM_BASICSIM) - /* this is required for the basic simulator in TDD mode - * TODO: find a proper cleaner solution - */ - UE->N_TA_offset = 0; - printf("Done lte_param_init\n"); } diff --git a/openair1/PHY/LTE_TRANSPORT/pss.c b/openair1/PHY/LTE_TRANSPORT/pss.c index 9ebd841430927e1c165d14234099948f37f0793b..ce524ef611c3e9cf98528166d7d01d6e9a864858 100644 --- a/openair1/PHY/LTE_TRANSPORT/pss.c +++ b/openair1/PHY/LTE_TRANSPORT/pss.c @@ -72,10 +72,6 @@ int generate_pss(int32_t **txdataF, a = (frame_parms->nb_antenna_ports_eNB == 1) ? amp: (amp*ONE_OVER_SQRT2_Q15)>>15; //printf("[PSS] amp=%d, a=%d\n",amp,a); - if (IS_SOFTMODEM_BASICSIM) - /* a hack to remove at some point (the UE doesn't synch with 100 RBs) */ - a = (frame_parms->nb_antenna_ports_eNB == 1) ? 4*amp: (amp*ONE_OVER_SQRT2_Q15)>>15; - Nsymb = (frame_parms->Ncp==NORMAL)?14:12; for (aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) { diff --git a/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c b/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c index ba904629a1ccd34cc46c012b30d1bdf8b61370d0..ff7affe1b3a2855d5db9faf8785c364b533f63f9 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c @@ -557,11 +557,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { 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 ) - phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0); - } else { - if (IS_SOFTMODEM_BASICSIM ) - phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0); } return ret; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c index 929f63e9fc0092f56ac42203f7a8e5d1d54676b8..82120dc3c333833eb338083596b2758a422a8b17 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c @@ -81,29 +81,20 @@ 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 ( !(IS_SOFTMODEM_BASICSIM ) ) { - prach_start = (ue->rx_offset+subframe*ue->frame_parms.samples_per_tti-ue->hw_timing_advance-ue->N_TA_offset); + 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); + 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); - } + 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); // First compute physical root sequence if (restricted_set == 0) { @@ -476,40 +467,32 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 AssertFatal(prach_fmt<4, "prach_fmt4 not fully implemented" ); - if (!(IS_SOFTMODEM_BASICSIM ) ) { - 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 ); + 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; i<min(ue->frame_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=prach_start,j=0; i<min(ue->frame_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; i<overflow; 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; i<overflow; 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]; + } #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) ; k<prach_start ; k++) { - if (k<0) - ue->common_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 { // simulators - for (i=0; i<prach_len; i++) { - ((int16_t *)(&ue->common_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]; - } + // 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) ; k<prach_start ; k++) { + if (k<0) + ue->common_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 #if defined(PRACH_WRITE_OUTPUT_DEBUG) LOG_M("prach_txF0.m","prachtxF0",prachF,prach_len-Ncp,1,1); diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 876d6cc83adfb9496dc62edcc0aaecdf68b58d1d..e0c445d3852eb2cb709e0f83b9d8a2d3c25bf6d9 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -457,14 +457,34 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, pmi = 0;//no precoding if (pmi == 0) {//unitary Precoding - if(ap<rel15->nrOfLayers) - memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], - (void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + k)], - NR_NB_SC_PER_RB*sizeof(int32_t)); - else - memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], - 0, - NR_NB_SC_PER_RB*sizeof(int32_t)); + if (k + NR_NB_SC_PER_RB <= frame_parms->ofdm_symbol_size) { // RB does not cross DC + if(ap<rel15->nrOfLayers) + memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], + (void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + k)], + NR_NB_SC_PER_RB*sizeof(int32_t)); + else + memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], + 0, + NR_NB_SC_PER_RB*sizeof(int32_t)); + } else { // RB does cross DC + int neg_length = frame_parms->ofdm_symbol_size - k; + int pos_length = NR_NB_SC_PER_RB - neg_length; + if (ap<rel15->nrOfLayers) { + memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], + (void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + k)], + neg_length*sizeof(int32_t)); + memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset], + (void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size)], + pos_length*sizeof(int32_t)); + } else { + memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], + 0, + neg_length*sizeof(int32_t)); + memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset], + 0, + pos_length*sizeof(int32_t)); + } + } k += NR_NB_SC_PER_RB; if (k >= frame_parms->ofdm_symbol_size) { k -= frame_parms->ofdm_symbol_size; diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c index 03cee5afa1c8f80a649985af17b61bd208a47c37..355830c07829b8f0b49f853d51c0b04ee71ddcf9 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c @@ -356,7 +356,7 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF, if (is_dmrs_symbol == 0) { // //rxF[ ((start_re + re)*2) % (frame_parms->ofdm_symbol_size*2)]); - if (start_re + nb_re_pusch < frame_parms->ofdm_symbol_size) { + if (start_re + nb_re_pusch <= frame_parms->ofdm_symbol_size) { memcpy1((void*)rxF_ext, (void*)&rxF[start_re*2], nb_re_pusch*sizeof(int32_t)); diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 96709b91a19f4b3ccfb159056ede9d8df00e81ab..30836ded01426a2645122656dd43ffa4c1f8564c 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -534,8 +534,12 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, 16); pil += 2; rxF += 8; - //for (int i= 0; i<8; i++) - //printf("dl_ch addr %p %d\n", dl_ch+i, *(dl_ch+i)); + k += 4; + + if (k >= ue->frame_parms.ofdm_symbol_size) { + k -= ue->frame_parms.ofdm_symbol_size; + rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)]; + } ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); @@ -548,6 +552,12 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, 16); pil += 2; rxF += 8; + k += 4; + + if (k >= ue->frame_parms.ofdm_symbol_size) { + k -= ue->frame_parms.ofdm_symbol_size; + rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)]; + } ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); @@ -560,23 +570,22 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, ch, dl_ch, 16); - -#ifdef DEBUG_PDCCH +#ifdef DEBUG_PDCCH for (int m =0; m<12; m++) printf("data : dl_ch -> (%d,%d)\n",dl_ch[0+2*m],dl_ch[1+2*m]); -#endif +#endif + dl_ch += 24; + pil += 2; rxF += 8; - dl_ch += 24; - k += 12; - - + k += 4; for (pilot_cnt=3; pilot_cnt<(3*nb_rb_coreset); pilot_cnt += 3) { - if (k >= ue->frame_parms.ofdm_symbol_size){ - k-=ue->frame_parms.ofdm_symbol_size; - rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)];} + if (k >= ue->frame_parms.ofdm_symbol_size) { + k -= ue->frame_parms.ofdm_symbol_size; + rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)]; + } ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); @@ -593,6 +602,12 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, pil += 2; rxF += 8; + k += 4; + + if (k >= ue->frame_parms.ofdm_symbol_size) { + k -= ue->frame_parms.ofdm_symbol_size; + rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)]; + } ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); @@ -605,6 +620,12 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, 16); pil += 2; rxF += 8; + k += 4; + + if (k >= ue->frame_parms.ofdm_symbol_size) { + k -= ue->frame_parms.ofdm_symbol_size; + rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)]; + } ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); @@ -617,11 +638,15 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, ch, dl_ch, 16); - pil += 2; - rxF += 8; +#ifdef DEBUG_PDCCH + for (int m =0; m<12; m++) + printf("data : dl_ch -> (%d,%d)\n",dl_ch[0+2*m],dl_ch[1+2*m]); +#endif dl_ch += 24; - k += 12; + pil += 2; + rxF += 8; + k += 4; } diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 5e18f6cc6d799ea0e7f608e0d93601e525fb3ad8..b5cc765be4443a8086bfbb58aa1016b8d7dfd786 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -61,12 +61,8 @@ char nr_dci_format_string[8][30] = { //#define NR_LTE_PDCCH_DCI_SWITCH //#define NR_PDCCH_DCI_DEBUG // activates NR_PDCCH_DCI_DEBUG logs #ifdef NR_PDCCH_DCI_DEBUG -#define LOG_DNL(a, ...) printf("\n\t\t<-NR_PDCCH_DCI_DEBUG (%s)-> " a, __func__, ##__VA_ARGS__ ) -#define LOG_DD(a, ...) printf("\t<-NR_PDCCH_DCI_DEBUG (%s)-> " a, __func__, ##__VA_ARGS__ ) -#define LOG_DDD(a, ...) printf("\t\t<-NR_PDCCH_DCI_DEBUG (%s)-> " a, __func__, ##__VA_ARGS__ ) +#define LOG_DDD(a, ...) printf("<-NR_PDCCH_DCI_DEBUG (%s)-> " a, __func__, ##__VA_ARGS__ ) #else -#define LOG_DNL(a...) -#define LOG_DD(a...) #define LOG_DDD(a...) #endif #define NR_NBR_CORESET_ACT_BWP 3 // The number of CoreSets per BWP is limited to 3 (including initial CORESET: ControlResourceId 0) @@ -371,11 +367,6 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF, uint8_t i, j, aarx; int32_t *dl_ch0, *dl_ch0_ext, *rxF, *rxF_ext; -#ifdef DEBUG_DCI_DECODING - uint8_t symbol_mod = (symbol >= (7 - frame_parms->Ncp)) ? symbol - (7 - frame_parms->Ncp) : symbol; - LOG_I(PHY, "extract_rbs_single: symbol_mod %d\n",symbol_mod); -#endif - for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) { dl_ch0 = &dl_ch_estimates[aarx][frame_parms->ofdm_symbol_size*symbol]; LOG_DDD("dl_ch0 = &dl_ch_estimates[aarx = (%d)][0]\n",aarx); @@ -397,9 +388,9 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF, * 1.2 The RB is >= than the N_RB_DL/2 -> IQ symbols are in the first half of the rxdataF (from element 0) * 2. Number of RBs in the system bandwidth is odd * (particular case when the RB with DC as it is treated differently: it is situated in symbol borders of rxdataF) - * 2.1 The RB is <= than the N_RB_DL/2 -> IQ symbols are in the second half of the rxdataF (from first_carrier_offset) - * 2.2 The RB is > than the N_RB_DL/2+1 -> IQ symbols are in the first half of the rxdataF (from element 0 + 2nd half RB containing DC) - * 2.3 The RB is == N_RB_DL/2+1 -> IQ symbols are in the lower border of the rxdataF for first 6 IQ element and the upper border of the rxdataF for the last 6 IQ elements + * 2.1 The RB is < than the N_RB_DL/2 -> IQ symbols are in the second half of the rxdataF (from first_carrier_offset) + * 2.2 The RB is > than the N_RB_DL/2 -> IQ symbols are in the first half of the rxdataF (from element 0 + 2nd half RB containing DC) + * 2.3 The RB is == N_RB_DL/2 -> IQ symbols are in the upper border of the rxdataF for first 6 IQ element and the lower border of the rxdataF for the last 6 IQ elements * If the first RB containing PDCCH within the UE BWP and within the CORESET is higher than half of the system bandwidth (N_RB_DL), * then the IQ symbol is going to be found at the position 0+c_rb-N_RB_DL/2 in rxdataF and * we have to point the pointer at (1+c_rb-N_RB_DL/2) in rxdataF @@ -429,64 +420,65 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF, if (((c_rb + n_BWP_start) >= (frame_parms->N_RB_DL >> 1)) && ((frame_parms->N_RB_DL & 1) == 0)) { // number of RBs is even and c_rb is higher than half system bandwidth (we don't skip DC) // if these conditions are true the pointer has to be situated at the 1st part of the rxdataF - rxF = &rxdataF[aarx][(12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size)))+n_BWP_start*12]; // we point at the 1st part of the rxdataF in symbol - LOG_DDD("in even case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][(12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n", - c_rb,aarx,(12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size)))); - //rxF = &rxdataF[aarx][(1 + 12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size)))]; // we point at the 1st part of the rxdataF in symbol - //#ifdef NR_PDCCH_DCI_DEBUG - // LOG_DDD("in even case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][(1 + 12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n", - // c_rb,aarx,(1 + 12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size)))); - //#endif + rxF = &rxdataF[aarx][12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) + symbol * frame_parms->ofdm_symbol_size]; // we point at the 1st part of the rxdataF in symbol + LOG_DDD("in even case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) + symbol * frame_parms->ofdm_symbol_size = (%d)]\n", + c_rb,aarx,(12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) + symbol * frame_parms->ofdm_symbol_size)); } if (((c_rb + n_BWP_start) < (frame_parms->N_RB_DL >> 1)) && ((frame_parms->N_RB_DL & 1) != 0)) { //if RB to be treated is lower than middle system bandwidth then rxdataF pointed at (offset + c_br + symbol * ofdm_symbol_size): odd case - rxF = &rxdataF[aarx][(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size)))+n_BWP_start*12]; -#ifdef NR_PDCCH_DCI_DEBUG - LOG_D(PHY,"in odd case c_rb (%d) is lower or equal than half N_RB_DL -> rxF = &rxdataF[aarx = (%d)][(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n", - c_rb,aarx,(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size)))); -#endif + rxF = &rxdataF[aarx][frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size]; + LOG_DDD("in odd case c_rb (%d) is lower or equal than half N_RB_DL -> rxF = &rxdataF[aarx = (%d)][frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size = (%d)]\n", + c_rb,aarx,(frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size)); } if (((c_rb + n_BWP_start) > (frame_parms->N_RB_DL >> 1)) && ((frame_parms->N_RB_DL & 1) != 0)) { // number of RBs is odd and c_rb is higher than half system bandwidth + 1 // if these conditions are true the pointer has to be situated at the 1st part of the rxdataF just after the first IQ symbols of the RB containing DC - rxF = &rxdataF[aarx][(12*(c_rb - (frame_parms->N_RB_DL>>1)) - 6 + (symbol * (frame_parms->ofdm_symbol_size)))+n_BWP_start*12]; // we point at the 1st part of the rxdataF in symbol -#ifdef NR_PDCCH_DCI_DEBUG - LOG_D(PHY,"in odd case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][(12*(c_rb - frame_parms->N_RB_DL) - 5 + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n", - c_rb,aarx,(12*(c_rb - (frame_parms->N_RB_DL>>1)) - 6 + (symbol * (frame_parms->ofdm_symbol_size)))); -#endif + rxF = &rxdataF[aarx][12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) - 6 + symbol * frame_parms->ofdm_symbol_size]; // we point at the 1st part of the rxdataF in symbol + LOG_DDD("in odd case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) - 6 + symbol * frame_parms->ofdm_symbol_size = (%d)]\n", + c_rb,aarx,(12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) - 6 + symbol * frame_parms->ofdm_symbol_size)); } if (((c_rb + n_BWP_start) == (frame_parms->N_RB_DL >> 1)) && ((frame_parms->N_RB_DL & 1) != 0)) { // treatment of RB containing the DC // if odd number RBs in system bandwidth and first RB to be treated is higher than middle system bandwidth (around DC) // we have to treat the RB in two parts: first part from i=0 to 5, the data is at the end of rxdataF (pointing at the end of the table) - rxF = &rxdataF[aarx][(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size)))+n_BWP_start*12]; -#ifdef NR_PDCCH_DCI_DEBUG - LOG_D(PHY,"in odd case c_rb (%d) is half N_RB_DL + 1 we treat DC case -> rxF = &rxdataF[aarx = (%d)][(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n", - c_rb,aarx,(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size)))); -#endif + rxF = &rxdataF[aarx][frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size]; + LOG_DDD("in odd case c_rb (%d) is half N_RB_DL + 1 we treat DC case -> rxF = &rxdataF[aarx = (%d)][frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size = (%d)]\n", + c_rb,aarx,(frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size)); j = 0; for (i = 0; i < 6; i++) { //treating first part of the RB note that i=5 would correspond to DC. We treat it in NR if ((i != 1) && (i != 5)) { dl_ch0_ext[j] = dl_ch0[i]; - rxF_ext[j++] = rxF[i]; - // printf("**extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1])); + rxF_ext[j] = rxF[i]; + LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d)\n", + c_rb, i, j, *(short *) &rxF_ext[j],*(1 + (short *) &rxF_ext[j]), i, + *(short *) &rxF[i], *(1 + (short *) &rxF[i])); + j++; + } else { + LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d) \t\t <==> DM-RS PDCCH, this is a pilot symbol\n", + c_rb, i, j, *(short *) &rxF_ext[j], *(1 + (short *) &rxF_ext[j]), i, + *(short *) &rxF[i], *(1 + (short *) &rxF[i])); } } // then we point at the begining of the symbol part of rxdataF do process second part of RB - rxF = &rxdataF[aarx][((symbol * (frame_parms->ofdm_symbol_size)))]; // we point at the 1st part of the rxdataF in symbol -#ifdef NR_PDCCH_DCI_DEBUG - LOG_D(PHY,"in odd case c_rb (%d) is half N_RB_DL +1 we treat DC case -> rxF = &rxdataF[aarx = (%d)][(symbol * (frame_parms->ofdm_symbol_size)) = (%d)]\n", - c_rb,aarx,(symbol * (frame_parms->ofdm_symbol_size))); -#endif + rxF = &rxdataF[aarx][symbol * frame_parms->ofdm_symbol_size]; // we point at the 1st part of the rxdataF in symbol + LOG_DDD("in odd case c_rb (%d) is half N_RB_DL +1 we treat DC case -> rxF = &rxdataF[aarx = (%d)][symbol * frame_parms->ofdm_symbol_size = (%d)]\n", + c_rb,aarx,(symbol * frame_parms->ofdm_symbol_size)); for (; i < 12; i++) { if ((i != 9)) { dl_ch0_ext[j] = dl_ch0[i]; - rxF_ext[j++] = rxF[(1 + i - 6)]; - // printf("**extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1])); + rxF_ext[j] = rxF[i - 6]; + LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d)\n", + c_rb, i, j, *(short *) &rxF_ext[j],*(1 + (short *) &rxF_ext[j]), i, + *(short *) &rxF[i-6], *(1 + (short *) &rxF[i-6])); + j++; + } else { + LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d) \t\t <==> DM-RS PDCCH, this is a pilot symbol\n", + c_rb, i, j, *(short *) &rxF_ext[j], *(1 + (short *) &rxF_ext[j]), i, + *(short *) &rxF[i-6], *(1 + (short *) &rxF[i-6])); } } @@ -494,32 +486,21 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF, dl_ch0_ext += NBR_RE_PER_RB_WITHOUT_DMRS; rxF_ext += NBR_RE_PER_RB_WITHOUT_DMRS; dl_ch0 += 12; - //rxF += 7; - //c_rb++; - //n_BWP_start++; // We have to increment this variable here to be consequent in the for loop afterwards - //} } else { // treatment of any RB that does not contain the DC j = 0; for (i = 0; i < 12; i++) { if ((i != 1) && (i != 5) && (i != 9)) { rxF_ext[j] = rxF[i]; -#ifdef NR_PDCCH_DCI_DEBUG - LOG_D(PHY,"RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d)\n", + LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d)\n", c_rb, i, j, *(short *) &rxF_ext[j],*(1 + (short *) &rxF_ext[j]), i, *(short *) &rxF[i], *(1 + (short *) &rxF[i])); -#endif dl_ch0_ext[j] = dl_ch0[i]; - - //LOG_DDD("ch %d => dl_ch0(%d,%d)\n", i, *(short *) &dl_ch0[i], *(1 + (short*) &dl_ch0[i])); - //printf("\t-> dl_ch0[%d] => dl_ch0_ext[%d](%d,%d)\n", i,j, *(short *) &dl_ch0[i], *(1 + (short*) &dl_ch0[i])); j++; } else { -#ifdef NR_PDCCH_DCI_DEBUG - LOG_D(PHY,"RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d) \t\t <==> DM-RS PDCCH, this is a pilot symbol\n", + LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d) \t\t <==> DM-RS PDCCH, this is a pilot symbol\n", c_rb, i, j, *(short *) &rxF_ext[j], *(1 + (short *) &rxF_ext[j]), i, *(short *) &rxF[i], *(1 + (short *) &rxF[i])); -#endif } } @@ -527,8 +508,6 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF, dl_ch0_ext += NBR_RE_PER_RB_WITHOUT_DMRS; rxF_ext += NBR_RE_PER_RB_WITHOUT_DMRS; dl_ch0 += 12; - //rxF += 12; - //} } } } @@ -783,7 +762,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, rel15->CCE, rel15->L); - LOG_D(PHY,"we end nr_pdcch_unscrambling()\n"); + LOG_D(PHY,"we end nr_pdcch_demapping_deinterleaving()\n"); LOG_D(PHY,"Ending nr_rx_pdcch() function\n"); return (0); @@ -883,8 +862,8 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, int dci_length = rel15->dci_length_options[k]; uint64_t dci_estimation[2]= {0}; - LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n", - j, rel15->number_of_candidates, CCEind, e_rx_cand_idx, L, dci_length,nr_dci_format_string[rel15->dci_format_options[k]]); + LOG_D(PHY, "(%i.%i) Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n", + proc->frame_rx, proc->nr_slot_rx, j, rel15->number_of_candidates, CCEind, e_rx_cand_idx, L, dci_length, nr_dci_format_string[rel15->dci_format_options[k]]); nr_pdcch_unscrambling(&pdcch_vars->e_rx[e_rx_cand_idx], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e); @@ -892,7 +871,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, uint32_t *z = (uint32_t *) &pdcch_vars->e_rx[e_rx_cand_idx]; for (int index_z = 0; index_z < L*6; index_z++){ for (int i=0; i<9; i++) { - LOG_D(PHY,"z[%d]=(%d,%d) \n", (9*index_z + i), *(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i])); + LOG_I(PHY,"z[%d]=(%d,%d) \n", (9*index_z + i), *(int16_t *) &z[9*index_z + i],*(1 + (int16_t *) &z[9*index_z + i])); } } #endif diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 24bfa9ffc8a257dbed961be464cc4a5d6e267ba2..52eda10e9e4bc4c370cc4e5698a3840525be86f4 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -641,28 +641,29 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, // Please keep it: useful for debugging #ifdef DEBUG_PDSCH_RX - char filename[40]; + char filename[50]; uint8_t aa = 0; - snprintf(filename, 40, "rxdataF0_symb_%d_nr_slot_rx_%d.m", symbol, nr_slot_rx); + snprintf(filename, 50, "rxdataF0_symb_%d_nr_slot_rx_%d.m", symbol, nr_slot_rx); write_output(filename, "rxdataF0", &common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[0][0], NR_SYMBOLS_PER_SLOT*frame_parms->ofdm_symbol_size, 1, 1); - snprintf(filename, 40, "dl_ch_estimates0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx); + snprintf(filename, 50, "dl_ch_estimates0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx); write_output(filename, "dl_ch_estimates", &pdsch_vars[gNB_id]->dl_ch_estimates[aa][0], NR_SYMBOLS_PER_SLOT*frame_parms->ofdm_symbol_size, 1, 1); - snprintf(filename, 40, "rxdataF_ext0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx); + snprintf(filename, 50, "rxdataF_ext0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx); write_output(filename, "rxdataF_ext", &pdsch_vars[gNB_id]->rxdataF_ext[aa][0], NR_SYMBOLS_PER_SLOT*frame_parms->N_RB_DL*NR_NB_SC_PER_RB, 1, 1); - snprintf(filename, 40, "dl_ch_estimates_ext0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx); + snprintf(filename, 50, "dl_ch_estimates_ext0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx); write_output(filename, "dl_ch_estimates_ext00", &pdsch_vars[gNB_id]->dl_ch_estimates_ext[aa][0], NR_SYMBOLS_PER_SLOT*frame_parms->N_RB_DL*NR_NB_SC_PER_RB, 1, 1); - snprintf(filename, 40, "rxdataF_comp0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx); + snprintf(filename, 50, "rxdataF_comp0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx); write_output(filename, "rxdataF_comp00", &pdsch_vars[gNB_id]->rxdataF_comp0[aa][0], NR_SYMBOLS_PER_SLOT*frame_parms->N_RB_DL*NR_NB_SC_PER_RB, 1, 1); - +/* for (int i=0; i < 2; i++){ - snprintf(filename, 40, "llr%d_symb_%d_nr_slot_rx_%d.m", i, symbol, nr_slot_rx); + snprintf(filename, 50, "llr%d_symb_%d_nr_slot_rx_%d.m", i, symbol, nr_slot_rx); write_output(filename,"llr", &pdsch_vars[gNB_id]->llr[i][0], (NR_SYMBOLS_PER_SLOT*nb_rb*NR_NB_SC_PER_RB*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm), 1, 0); } +*/ #endif #if T_TRACER @@ -882,9 +883,11 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1); rxdataF_comp128[1] = _mm_packs_epi32(mmtmpD2,mmtmpD3); - //print_shorts("rx:",(int16_t*)&rxdataF128[1]); - //print_shorts("ch:",(int16_t*)&dl_ch128[1]); - //print_shorts("pack:",(int16_t*)&rxdataF_comp128[1]); +#ifdef DEBUG_DLSCH_DEMOD + print_shorts("rx:",(int16_t*)&rxdataF128[1]); + print_shorts("ch:",(int16_t*)&dl_ch128[1]); + print_shorts("pack:",(int16_t*)&rxdataF_comp128[1]); +#endif // multiply by conjugated channel mmtmpD0 = _mm_madd_epi16(dl_ch128[2],rxdataF128[2]); @@ -900,9 +903,11 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1); rxdataF_comp128[2] = _mm_packs_epi32(mmtmpD2,mmtmpD3); - //print_shorts("rx:",(int16_t*)&rxdataF128[2]); - //print_shorts("ch:",(int16_t*)&dl_ch128[2]); - //print_shorts("pack:",(int16_t*)&rxdataF_comp128[2]); +#ifdef DEBUG_DLSCH_DEMOD + print_shorts("rx:",(int16_t*)&rxdataF128[2]); + print_shorts("ch:",(int16_t*)&dl_ch128[2]); + print_shorts("pack:",(int16_t*)&rxdataF_comp128[2]); +#endif dl_ch128+=3; dl_ch_mag128+=3; @@ -1987,87 +1992,88 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF, NR_DL_FRAME_PARMS *frame_parms, uint16_t dlDmrsSymbPos) { - - unsigned short k,rb; - unsigned char nushift,i,aarx; - int *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext; - - int8_t validDmrsEst = 0; //store last DMRS Symbol index - - unsigned char j=0; - - if (config_type==NFAPI_NR_DMRS_TYPE1) { + if (config_type == NFAPI_NR_DMRS_TYPE1) { AssertFatal(n_dmrs_cdm_groups == 1 || n_dmrs_cdm_groups == 2, "n_dmrs_cdm_groups %d is illegal\n",n_dmrs_cdm_groups); - nushift = n_dmrs_cdm_groups -1;//delta in Table 7.4.1.1.2-1 - } else { AssertFatal(n_dmrs_cdm_groups == 1 || n_dmrs_cdm_groups == 2 || n_dmrs_cdm_groups == 3, "n_dmrs_cdm_groups %d is illegal\n",n_dmrs_cdm_groups); - nushift = (n_dmrs_cdm_groups -1)<<1;//delta in Table 7.4.1.1.2-2 - } - - for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { + } - k = frame_parms->first_carrier_offset + NR_NB_SC_PER_RB*start_rb; + const unsigned short start_re = (frame_parms->first_carrier_offset + start_rb * NR_NB_SC_PER_RB) % frame_parms->ofdm_symbol_size; + const int8_t validDmrsEst = get_valid_dmrs_idx_for_channel_est(dlDmrsSymbPos, symbol); - validDmrsEst = get_valid_dmrs_idx_for_channel_est(dlDmrsSymbPos,symbol); + for (unsigned char aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) { - dl_ch0 = &dl_ch_estimates[aarx][(validDmrsEst*(frame_parms->ofdm_symbol_size))]; + int32_t *dl_ch0 = &dl_ch_estimates[aarx][validDmrsEst * frame_parms->ofdm_symbol_size]; + int32_t *dl_ch0_ext = &dl_ch_estimates_ext[aarx][symbol * nb_rb_pdsch * NR_NB_SC_PER_RB]; + int32_t *rxF_ext = &rxdataF_ext[aarx][symbol * nb_rb_pdsch * NR_NB_SC_PER_RB]; + int32_t *rxF = &rxdataF[aarx][symbol * frame_parms->ofdm_symbol_size]; - dl_ch0_ext = &dl_ch_estimates_ext[aarx][symbol*(nb_rb_pdsch*12)]; + if (pilots == 0) { //data symbol only + if (start_re + nb_rb_pdsch * NR_NB_SC_PER_RB <= frame_parms->ofdm_symbol_size) { + memcpy((void*)rxF_ext, (void*)&rxF[start_re], nb_rb_pdsch * NR_NB_SC_PER_RB * sizeof(int32_t)); + } else { + int neg_length = frame_parms->ofdm_symbol_size - start_re; + int pos_length = nb_rb_pdsch * NR_NB_SC_PER_RB - neg_length; - rxF_ext = &rxdataF_ext[aarx][symbol*(nb_rb_pdsch*12)]; - rxF = &rxdataF[aarx][(k+(symbol*(frame_parms->ofdm_symbol_size)))]; - - for (rb = 0; rb < nb_rb_pdsch; rb++) { - if (k>=frame_parms->ofdm_symbol_size) { - k = k-frame_parms->ofdm_symbol_size; - rxF = &rxdataF[aarx][(k+(symbol*(frame_parms->ofdm_symbol_size)))]; + memcpy((void*)rxF_ext, (void*)&rxF[start_re], neg_length * sizeof(int32_t)); + memcpy((void*)&rxF_ext[neg_length], (void*)rxF, pos_length * sizeof(int32_t)); } - if (pilots==0) { - memcpy((void*)rxF_ext,(void*)rxF,12*sizeof(*rxF_ext)); - memcpy((void*)dl_ch0_ext,(void*)dl_ch0,12*sizeof(*dl_ch0_ext)); - dl_ch0_ext+=12; - rxF_ext+=12; - } else {//the symbol contains DMRS - j=0; - if (config_type==NFAPI_NR_DMRS_TYPE1){ - if (nushift == 0) {//data is multiplexed - for (i = (1-nushift); i<12; i+=2) { - rxF_ext[j]=rxF[i]; - dl_ch0_ext[j]=dl_ch0[i]; - j++; - } - dl_ch0_ext+=6; - rxF_ext+=6; - } - } else {//NFAPI_NR_DMRS_TYPE2 - for (i = (2+nushift); i<6; i++) { - rxF_ext[j]=rxF[i]; - dl_ch0_ext[j]=dl_ch0[i]; - j++; - } - for (i = (8+nushift); i<12; i++) { - rxF_ext[j]=rxF[i]; - dl_ch0_ext[j]=dl_ch0[i]; - j++; - } - dl_ch0_ext+= j; - rxF_ext+= j; + memcpy((void*)dl_ch0_ext, (void*)dl_ch0, nb_rb_pdsch * NR_NB_SC_PER_RB * sizeof(int32_t)); + } + else if (config_type == NFAPI_NR_DMRS_TYPE1){ + if (n_dmrs_cdm_groups == 1) { //data is multiplexed + unsigned short k = start_re; + for (unsigned short j = 0; j < 6*nb_rb_pdsch; j += 3) { + rxF_ext[j] = rxF[k+1]; + rxF_ext[j+1] = rxF[k+3]; + rxF_ext[j+2] = rxF[k+5]; + dl_ch0_ext[j] = dl_ch0[1]; + dl_ch0_ext[j+1] = dl_ch0[3]; + dl_ch0_ext[j+2] = dl_ch0[5]; + dl_ch0 += 6; + k += 6; + if (k >= frame_parms->ofdm_symbol_size) + k -= frame_parms->ofdm_symbol_size; } } - - dl_ch0+=12; - rxF+=12; - k+=12; - if (k>=frame_parms->ofdm_symbol_size) { - k = k-(frame_parms->ofdm_symbol_size); - rxF = &rxdataF[aarx][k+(symbol*(frame_parms->ofdm_symbol_size))]; + } + else {//NFAPI_NR_DMRS_TYPE2 + if (n_dmrs_cdm_groups == 1) { //data is multiplexed + unsigned short k = start_re; + for (unsigned short j = 0; j < 8*nb_rb_pdsch; j += 4) { + rxF_ext[j] = rxF[k+2]; + rxF_ext[j+1] = rxF[k+3]; + rxF_ext[j+2] = rxF[k+4]; + rxF_ext[j+3] = rxF[k+5]; + dl_ch0_ext[j] = dl_ch0[2]; + dl_ch0_ext[j+1] = dl_ch0[3]; + dl_ch0_ext[j+2] = dl_ch0[4]; + dl_ch0_ext[j+3] = dl_ch0[5]; + dl_ch0 += 6; + k += 6; + if (k >= frame_parms->ofdm_symbol_size) + k -= frame_parms->ofdm_symbol_size; + } + } + else if (n_dmrs_cdm_groups == 2) { //data is multiplexed + unsigned short k = start_re; + for (unsigned short j = 0; j < 4*nb_rb_pdsch; j += 2) { + rxF_ext[j] = rxF[k+4]; + rxF_ext[j+1] = rxF[k+5]; + dl_ch0_ext[j] = dl_ch0[4]; + dl_ch0_ext[j+1] = dl_ch0[5]; + dl_ch0 += 6; + k += 6; + if (k >= frame_parms->ofdm_symbol_size) + k -= frame_parms->ofdm_symbol_size; + } } } } - return(nb_rb_pdsch); + + return nb_rb_pdsch; } unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF, diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h index 6b18e55c4bc433933933adb87c4f11fb4f197916..0b20aa409ba69edc3f49b734f91248dc73c43e44 100644 --- a/openair1/PHY/defs_RU.h +++ b/openair1/PHY/defs_RU.h @@ -458,8 +458,6 @@ typedef struct RU_t_s { int emulate_rf; /// numerology index int numerology; - /// flag to indicate basicsim operation - int basicsim; /// flag to indicate the RU is in sync with a master reference int in_synch; /// timing offset diff --git a/openair1/SCHED_UE/phy_procedures_lte_ue.c b/openair1/SCHED_UE/phy_procedures_lte_ue.c index 4635f2b7412eea602cbf2e1714131c5f5854c048..b02f24e04eafcd5e77e64fd3e38f1433dfc060cf 100644 --- a/openair1/SCHED_UE/phy_procedures_lte_ue.c +++ b/openair1/SCHED_UE/phy_procedures_lte_ue.c @@ -1150,20 +1150,14 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, nsymb = (frame_parms->Ncp == 0) ? 14 : 12; - if (!IS_SOFTMODEM_BASICSIM) { - 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 < 0) - ulsch_start = ulsch_start + (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti); - - 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; - } + 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 < 0) + ulsch_start = ulsch_start + (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti); + + 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 (empty_subframe) { overflow = ulsch_start - 9*frame_parms->samples_per_tti; @@ -1181,8 +1175,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, } for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) { - int *Buff = IS_SOFTMODEM_BASICSIM ? &ue->common_vars.txdata[aa][ulsch_start] :dummy_tx_buffer; - + int *Buff = dummy_tx_buffer; if (frame_parms->Ncp == 1) { PHY_ofdm_mod(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size], Buff, @@ -1202,41 +1195,33 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, &ue->frame_parms); } - if (IS_SOFTMODEM_BASICSIM) { - 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); - } + apply_7_5_kHz(ue,dummy_tx_buffer,0); + apply_7_5_kHz(ue,dummy_tx_buffer,1); - if (!(IS_SOFTMODEM_BASICSIM) ) { - overflow = ulsch_start - 9*frame_parms->samples_per_tti; + overflow = ulsch_start - 9*frame_parms->samples_per_tti; - for (k=ulsch_start,l=0; k<cmin(frame_parms->samples_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=ulsch_start,l=0; k<cmin(frame_parms->samples_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; k<overflow; 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; k<overflow; 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 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) ; k<ulsch_start ; k++) { - if (k<0) - ue->common_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 + // 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) ; k<ulsch_start ; k++) { + if (k<0) + ue->common_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 /* only for debug @@ -1314,14 +1299,7 @@ void ue_prach_procedures(PHY_VARS_UE *ue, ue->prach_resources[eNB_id]->ra_RNTI); ue->tx_total_RE[subframe_tx] = 96; - if (IS_SOFTMODEM_BASICSIM) { - 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; - } + 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", @@ -1688,14 +1666,10 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue, ue->tx_total_RE[subframe_tx] = nb_rb*12; - if (IS_SOFTMODEM_BASICSIM) { - 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); - } + 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)); @@ -1765,17 +1739,13 @@ void ue_srs_procedures(PHY_VARS_UE *ue, Po_SRS = ue->tx_power_max_dBm; } - if (IS_SOFTMODEM_BASICSIM) { - tx_amp = AMP; + 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 (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; - } + tx_amp = AMP; } 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, @@ -2008,14 +1978,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue, ue->tx_power_dBm[subframe_tx] = Po_PUCCH; ue->tx_total_RE[subframe_tx] = 12; - if (IS_SOFTMODEM_BASICSIM) { - tx_amp = AMP; - } else { - tx_amp = get_tx_amp(Po_PUCCH, - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - 1); - } + 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))); @@ -2089,14 +2055,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue, ue->tx_power_dBm[subframe_tx] = Po_PUCCH; ue->tx_total_RE[subframe_tx] = 12; - if (IS_SOFTMODEM_BASICSIM) { - tx_amp = AMP; - } else { - tx_amp = get_tx_amp(Po_PUCCH, - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - 1); - } + 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))); @@ -2344,9 +2306,6 @@ void ue_measurement_procedures(uint16_t l, // symbol index of each slot [0..6 // AGC VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_IN); - if (IS_SOFTMODEM_BASICSIM) - 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; diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 7833b41f0bae369c98de6dcf8f86246f7e23f268..3bc45b42ca87e86620145d1cfc93531eb144815b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -58,19 +58,42 @@ void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddModList * struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_bearer2release_list, NR_UE_sched_ctrl_t *sched_ctrl) { + if (rlc_bearer2release_list) { + for (int i = 0; i < rlc_bearer2release_list->list.count; i++) { + for (int idx = 0; idx < sched_ctrl->dl_lc_num; idx++) { + if (sched_ctrl->dl_lc_ids[idx] == *rlc_bearer2release_list->list.array[i]) { + const int remaining_lcs = sched_ctrl->dl_lc_num - idx - 1; + memmove(&sched_ctrl->dl_lc_ids[idx], &sched_ctrl->dl_lc_ids[idx + 1], sizeof(sched_ctrl->dl_lc_ids[idx]) * remaining_lcs); + sched_ctrl->dl_lc_num--; + break; + } + } + } + } + + if (rlc_bearer2add_list) { + // keep lcids + for (int i = 0; i < rlc_bearer2add_list->list.count; i++) { + const int lcid = rlc_bearer2add_list->list.array[i]->logicalChannelIdentity; + bool found = false; + for (int idx = 0; idx < sched_ctrl->dl_lc_num; idx++) { + if (sched_ctrl->dl_lc_ids[idx] == lcid) { + found = true; + break; + } + } - if (rlc_bearer2add_list) - // keep lcids - for (int i=0;i<rlc_bearer2add_list->list.count;i++) { - sched_ctrl->lcid_mask |= (1<<rlc_bearer2add_list->list.array[i]->logicalChannelIdentity); - LOG_I(NR_MAC,"Adding LCID %d (%s %d)\n", - (int)rlc_bearer2add_list->list.array[i]->logicalChannelIdentity, - rlc_bearer2add_list->list.array[i]->logicalChannelIdentity<4 ? "SRB" : "DRB", - (int)rlc_bearer2add_list->list.array[i]->logicalChannelIdentity); + if (!found) { + sched_ctrl->dl_lc_num++; + sched_ctrl->dl_lc_ids[sched_ctrl->dl_lc_num - 1] = lcid; + LOG_D(NR_MAC, "Adding LCID %d (%s %d)\n", lcid, lcid < 4 ? "SRB" : "DRB", lcid); + } } - if (rlc_bearer2release_list) - for (int i=0;i<rlc_bearer2release_list->list.count;i++) - sched_ctrl->lcid_mask |= (1<<*rlc_bearer2release_list->list.array[i]); + } + + LOG_D(NR_MAC, "In %s: total num of active bearers %d) \n", + __FUNCTION__, + sched_ctrl->dl_lc_num); } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 80704a7a0467625ea7eb3df2fb1e3307411d4266..f030c40a01d1fc5ae22cdf827ddedebd19e98bb0 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -471,76 +471,49 @@ void nr_store_dlsch_buffer(module_id_t module_id, NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info; for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) { - NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; + NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; sched_ctrl->num_total_bytes = 0; + sched_ctrl->dl_pdus_total = 0; - int lcid; - const uint16_t rnti = UE_info->rnti[UE_id]; - LOG_D(NR_MAC,"UE %d/%x : lcid_mask %x\n",UE_id,rnti,sched_ctrl->lcid_mask); - if ((sched_ctrl->lcid_mask&(1<<2)) > 0) - sched_ctrl->rlc_status[DL_SCH_LCID_DCCH1] = mac_rlc_status_ind(module_id, + /* loop over all activated logical channels */ + // Note: DL_SCH_LCID_DCCH, DL_SCH_LCID_DCCH1, DL_SCH_LCID_DTCH + for (int i = 0; i < sched_ctrl->dl_lc_num; ++i) { + + const int lcid = sched_ctrl->dl_lc_ids[i]; + const uint16_t rnti = UE_info->rnti[UE_id]; + LOG_D(NR_MAC, "In %s: UE %d/%x: LCID %d\n", __FUNCTION__, UE_id, rnti, lcid); + start_meas(&RC.nrmac[module_id]->rlc_status_ind); + sched_ctrl->rlc_status[lcid] = mac_rlc_status_ind(module_id, rnti, module_id, frame, slot, ENB_FLAG_YES, MBMS_FLAG_NO, - DL_SCH_LCID_DCCH1, + lcid, 0, 0); - if ((sched_ctrl->lcid_mask&(1<<1)) > 0) - sched_ctrl->rlc_status[DL_SCH_LCID_DCCH] = mac_rlc_status_ind(module_id, - rnti, - module_id, - frame, - slot, - ENB_FLAG_YES, - MBMS_FLAG_NO, - DL_SCH_LCID_DCCH, - 0, - 0); - if ((sched_ctrl->lcid_mask&(1<<4)) > 0) { - start_meas(&RC.nrmac[module_id]->rlc_status_ind); - sched_ctrl->rlc_status[DL_SCH_LCID_DTCH] = mac_rlc_status_ind(module_id, - rnti, - module_id, - frame, - slot, - ENB_FLAG_YES, - MBMS_FLAG_NO, - DL_SCH_LCID_DTCH, - 0, - 0); - stop_meas(&RC.nrmac[module_id]->rlc_status_ind); - } - if(sched_ctrl->rlc_status[DL_SCH_LCID_DCCH].bytes_in_buffer > 0){ - lcid = DL_SCH_LCID_DCCH; - } - else if (sched_ctrl->rlc_status[DL_SCH_LCID_DCCH1].bytes_in_buffer > 0) - { - lcid = DL_SCH_LCID_DCCH1; - }else{ - lcid = DL_SCH_LCID_DTCH; - } - - sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer; - //later multiplex here. Just select DCCH/SRB before DTCH/DRB - sched_ctrl->lcid_to_schedule = lcid; + stop_meas(&RC.nrmac[module_id]->rlc_status_ind); - if (sched_ctrl->num_total_bytes == 0 - && !sched_ctrl->ta_apply) /* If TA should be applied, give at least one RB */ - continue; + if (sched_ctrl->rlc_status[lcid].bytes_in_buffer == 0) + continue; - LOG_D(NR_MAC, - "[%s][%d.%d], %s%d->DLSCH, RLC status %d bytes TA %d\n", - __func__, - frame, - slot, - lcid<4?"DCCH":"DTCH", - lcid, - sched_ctrl->rlc_status[lcid].bytes_in_buffer, - sched_ctrl->ta_apply); + sched_ctrl->dl_pdus_total += sched_ctrl->rlc_status[lcid].pdus_in_buffer; + sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer; + LOG_D(MAC, + "[gNB %d][%4d.%2d] %s%d->DLSCH, RLC status for UE %d: %d bytes in buffer, total DL buffer size = %d bytes, %d total PDU bytes, %s TA command\n", + module_id, + frame, + slot, + lcid < 4 ? "DCCH":"DTCH", + lcid, + UE_id, + sched_ctrl->rlc_status[lcid].bytes_in_buffer, + sched_ctrl->num_total_bytes, + sched_ctrl->dl_pdus_total, + sched_ctrl->ta_apply ? "send":"do not send"); + } } } @@ -862,6 +835,10 @@ void pf_dl(module_id_t module_id, CCEIndex, sched_ctrl->aggregation_level); + /* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE */ + max_num_ue--; + if (max_num_ue < 0) return; + /* MCS has been set above */ const int tda = RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0][slot]; @@ -892,7 +869,12 @@ void pf_dl(module_id_t module_id, sched_pdsch->pucch_allocation = alloc; uint32_t TBS = 0; uint16_t rbSize; - const int oh = 3 + 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024); + // Fix me: currently, the RLC does not give us the total number of PDUs + // awaiting. Therefore, for the time being, we put a fixed overhead of 12 + // (for 4 PDUs) and optionally + 2 for TA. Once RLC gives the number of + // PDUs, we replace with 3 * numPDUs + const int oh = 3 * 4 + 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024); + //const int oh = 3 * sched_ctrl->dl_pdus_total + 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024); nr_find_nb_rb(sched_pdsch->Qm, sched_pdsch->R, ps->nrOfLayers, @@ -1337,68 +1319,72 @@ void nr_schedule_ue_spec(module_id_t module_id, buf += written; int size = TBS - written; DevAssert(size >= 0); - /* next, get RLC data */ - // const int lcid = DL_SCH_LCID_DTCH; - const int lcid = sched_ctrl->lcid_to_schedule; - int dlsch_total_bytes = 0; start_meas(&gNB_mac->rlc_data_req); if (sched_ctrl->num_total_bytes > 0) { - tbs_size_t len = 0; - while (size > 3) { - // we do not know how much data we will get from RLC, i.e., whether it - // will be longer than 256B or not. Therefore, reserve space for long header, then - // fetch data, then fill real length - NR_MAC_SUBHEADER_LONG *header = (NR_MAC_SUBHEADER_LONG *) buf; - buf += 3; - size -= 3; - - /* limit requested number of bytes to what preprocessor specified, or - * such that TBS is full */ - const rlc_buffer_occupancy_t ndata = min(sched_ctrl->rlc_status[lcid].bytes_in_buffer, size); - - len = mac_rlc_data_req(module_id, - rnti, - module_id, - frame, - ENB_FLAG_YES, - MBMS_FLAG_NO, - lcid, - ndata, - (char *)buf, - 0, - 0); - - LOG_D(NR_MAC, - "%4d.%2d RNTI %04x: %d bytes from %s %d (ndata %d, remaining size %d)\n", - frame, - slot, - rnti, - len, - lcid < 4 ? "DCCH" : "DTCH", - lcid, - ndata, - size); - if (len == 0) - break; - - header->R = 0; - header->F = 1; - header->LCID = lcid; - header->L1 = (len >> 8) & 0xff; - header->L2 = len & 0xff; - size -= len; - buf += len; - dlsch_total_bytes += len; - } - if (len == 0) { - /* RLC did not have data anymore, mark buffer as unused */ - buf -= 3; - size += 3; + + /* loop over all activated logical channels */ + for (int i = 0; i < sched_ctrl->dl_lc_num; ++i) { + + const int lcid = sched_ctrl->dl_lc_ids[i]; + if (sched_ctrl->rlc_status[lcid].bytes_in_buffer == 0) + continue; // no data for this LC + + int dlsch_total_bytes = 0; + while (size > 3) { + // we do not know how much data we will get from RLC, i.e., whether it + // will be longer than 256B or not. Therefore, reserve space for long header, then + // fetch data, then fill real length + NR_MAC_SUBHEADER_LONG *header = (NR_MAC_SUBHEADER_LONG *) buf; + buf += 3; + size -= 3; + + /* limit requested number of bytes to what preprocessor specified, or + * such that TBS is full */ + const rlc_buffer_occupancy_t ndata = min(sched_ctrl->rlc_status[lcid].bytes_in_buffer, size); + tbs_size_t len = mac_rlc_data_req(module_id, + rnti, + module_id, + frame, + ENB_FLAG_YES, + MBMS_FLAG_NO, + lcid, + ndata, + (char *)buf, + 0, + 0); + + LOG_D(NR_MAC, + "%4d.%2d RNTI %04x: %d bytes from %s %d (ndata %d, remaining size %d)\n", + frame, + slot, + rnti, + len, + lcid < 4 ? "DCCH" : "DTCH", + lcid, + ndata, + size); + if (len == 0) { + /* RLC did not have data anymore, mark buffer as unused */ + buf -= 3; + size += 3; + break; + } + + header->R = 0; + header->F = 1; + header->LCID = lcid; + header->L1 = (len >> 8) & 0xff; + header->L2 = len & 0xff; + size -= len; + buf += len; + dlsch_total_bytes += len; + } + + UE_info->mac_stats[UE_id].lc_bytes_tx[lcid] += dlsch_total_bytes; } - } - else if (get_softmodem_params()->phy_test || get_softmodem_params()->do_ra || get_softmodem_params()->sa) { + } else if (get_softmodem_params()->phy_test || get_softmodem_params()->do_ra) { /* we will need the large header, phy-test typically allocates all * resources and fills to the last byte below */ NR_MAC_SUBHEADER_LONG *header = (NR_MAC_SUBHEADER_LONG *) buf; @@ -1416,7 +1402,6 @@ void nr_schedule_ue_spec(module_id_t module_id, header->L2 = size & 0xff; size -= size; buf += size; - dlsch_total_bytes += size; } stop_meas(&gNB_mac->rlc_data_req); @@ -1436,7 +1421,6 @@ void nr_schedule_ue_spec(module_id_t module_id, UE_info->mac_stats[UE_id].dlsch_total_bytes += TBS; UE_info->mac_stats[UE_id].dlsch_current_bytes = TBS; - UE_info->mac_stats[UE_id].lc_bytes_tx[lcid] += dlsch_total_bytes; /* save retransmission information */ harq->sched_pdsch = *sched_pdsch; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 7866cc49156bea72c93c869a4d6b6f491793f37c..7891c5bcd330849b8dc02f9ae65ee6c8ff445b4d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -312,7 +312,9 @@ void nr_preprocessor_phytest(module_id_t module_id, } sched_ctrl->num_total_bytes = 0; + sched_ctrl->dl_lc_num = 1; const int lcid = DL_SCH_LCID_DTCH; + sched_ctrl->dl_lc_ids[sched_ctrl->dl_lc_num - 1] = lcid; const uint16_t rnti = UE_info->rnti[UE_id]; /* update sched_ctrl->num_total_bytes so that postprocessor schedules data, * if available */ @@ -327,7 +329,6 @@ void nr_preprocessor_phytest(module_id_t module_id, 0, 0); sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer; - sched_ctrl->lcid_to_schedule = lcid; uint8_t nr_of_candidates; for (int i=0; i<5; i++) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 3267f8484c3722c104f052f15374ac3b68901a4b..38f34f710b7e39db220fdee74eb1e8df6698667e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2209,10 +2209,6 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; memset(sched_ctrl, 0, sizeof(*sched_ctrl)); sched_ctrl->set_mcs = TRUE; - sched_ctrl->lcid_mask = 0; - if (!get_softmodem_params()->phy_test && !get_softmodem_params()->do_ra && !get_softmodem_params()->sa) { - sched_ctrl->lcid_mask = 1<<DL_SCH_LCID_DTCH; - } sched_ctrl->ta_frame = 0; sched_ctrl->ta_update = 31; sched_ctrl->ta_apply = false; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 74618e18a7ddb05449fdb75a78dac641117d09ad..c4582918dc4a3bb98967d39ecd5eebe8cfd2b422 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -818,6 +818,8 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); UE_info->active[UE_id] = true; + process_CellGroup(ra->CellGroup, UE_scheduling_control); + } else { LOG_A(NR_MAC,"[RAPROC] RA-Msg3 received (sdu_lenP %d)\n",sdu_lenP); @@ -956,7 +958,7 @@ int next_list_entry_looped(NR_list_t *list, int UE_id) bool allocate_ul_retransmission(module_id_t module_id, frame_t frame, sub_frame_t slot, - uint8_t *rballoc_mask, + uint16_t *rballoc_mask, int *n_rb_sched, int UE_id, int harq_pid) @@ -1119,7 +1121,7 @@ void pf_ul(module_id_t module_id, NR_list_t *UE_list, int max_num_ue, int n_rb_sched, - uint8_t *rballoc_mask) { + uint16_t *rballoc_mask) { const int CC_id = 0; gNB_MAC_INST *nrmac = RC.nrmac[module_id]; @@ -1503,7 +1505,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t LOG_D(NR_MAC,"UL %d.%d : start_prb %d, end PRB %d\n",frame,slot,st,e); - uint8_t rballoc_mask[bwpSize]; + uint16_t rballoc_mask[bwpSize]; /* Calculate mask: if any RB in vrb_map_UL is blocked (1), the current RB will be 0 */ for (int i = 0; i < bwpSize; i++) diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index eccffca031aaafc04ef1f12c8086f27a3223bde0..4141976b5dd3ff6af6d4b6f729e9e214560eaf4d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -603,14 +603,13 @@ typedef struct { /// total amount of data awaiting for this UE uint32_t num_total_bytes; + uint16_t dl_pdus_total; /// per-LC status data - mac_rlc_status_resp_t rlc_status[MAX_NUM_LCID]; + mac_rlc_status_resp_t rlc_status[NR_MAX_NUM_LCID]; /// Estimation of HARQ from BLER NR_DL_bler_stats_t dl_bler_stats; - int lcid_mask; - int lcid_to_schedule; uint16_t ta_frame; int16_t ta_update; bool ta_apply; @@ -646,6 +645,12 @@ typedef struct { /// UL HARQ processes that await retransmission NR_list_t retrans_ul_harq; NR_UE_mac_ce_ctrl_t UE_mac_ce_ctrl;// MAC CE related information + + /// number of active DL LCs + uint8_t dl_lc_num; + /// order in which DLSCH scheduler should allocate LCs + uint8_t dl_lc_ids[NR_MAX_NUM_LCID]; + } NR_UE_sched_ctrl_t; typedef struct { diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index 1f66400af1a67765afc38b8673dec7062d7d240a..7d1e2f493184ae675882b8f2aeaa900506b6b37e 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -1149,9 +1149,9 @@ void nr_DRB_preconfiguration(uint16_t crnti) drb_ToAddMod->pdcp_Config->drb->discardTimer = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb->discardTimer)); *drb_ToAddMod->pdcp_Config->drb->discardTimer=NR_PDCP_Config__drb__discardTimer_infinity; drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL)); - *drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL = NR_PDCP_Config__drb__pdcp_SN_SizeUL_len12bits; + *drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL = NR_PDCP_Config__drb__pdcp_SN_SizeUL_len18bits; drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL)); - *drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL = NR_PDCP_Config__drb__pdcp_SN_SizeDL_len12bits; + *drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL = NR_PDCP_Config__drb__pdcp_SN_SizeDL_len18bits; drb_ToAddMod->pdcp_Config->drb->headerCompression.present = NR_PDCP_Config__drb__headerCompression_PR_notUsed; drb_ToAddMod->pdcp_Config->drb->headerCompression.choice.notUsed = 0; @@ -1181,7 +1181,8 @@ void nr_DRB_preconfiguration(uint16_t crnti) NR_RLC_BearerConfig_t *RLC_BearerConfig = calloc(1,sizeof(*RLC_BearerConfig)); nr_rlc_bearer_init(RLC_BearerConfig,NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity); - nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am); + nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_um_Bi_Directional); + //nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am); nr_rlc_bearer_init_ul_spec(RLC_BearerConfig->mac_LogicalChannelConfig); Rlc_Bearer_ToAdd_list = calloc(1,sizeof(*Rlc_Bearer_ToAdd_list)); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 1de34804df719c3051b3e049d2df29c746b9c604..1a67a9c164df38d3dbf76e01d9bb99ff7ac8e916 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -94,10 +94,8 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco secondaryCellGroup->cellGroupId = scg_id; NR_RLC_BearerConfig_t *RLC_BearerConfig = calloc(1,sizeof(*RLC_BearerConfig)); nr_rlc_bearer_init(RLC_BearerConfig, NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity); - if (get_softmodem_params()->do_ra || get_softmodem_params()->sa) - nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_um_Bi_Directional); - else - nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am); + nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_um_Bi_Directional); + //nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am); nr_rlc_bearer_init_ul_spec(RLC_BearerConfig->mac_LogicalChannelConfig); secondaryCellGroup->rlc_BearerToAddModList = calloc(1,sizeof(*secondaryCellGroup->rlc_BearerToAddModList)); diff --git a/targets/ARCH/COMMON/common_lib.c b/targets/ARCH/COMMON/common_lib.c index 08daf58cf7d149dadf0d84bc68bf35243f4d50b0..4d681b8d62465cb69769a7e9766d068ff3048bc3 100644 --- a/targets/ARCH/COMMON/common_lib.c +++ b/targets/ARCH/COMMON/common_lib.c @@ -116,9 +116,6 @@ int load_lib(openair0_device *device, deflibname=OAI_IQPLAYER_LIBNAME; shlib_fdesc[0].fname="device_init"; set_softmodem_optmask(SOFTMODEM_RECPLAY_BIT); // softmodem has to know we use the iqplayer to workaround randomized algorithms - } else if ( IS_SOFTMODEM_BASICSIM ) { - deflibname=OAI_BASICSIM_LIBNAME; - shlib_fdesc[0].fname="device_init"; } else if (IS_SOFTMODEM_RFSIM && flag == RAU_LOCAL_RADIO_HEAD) { deflibname=OAI_RFSIM_LIBNAME; shlib_fdesc[0].fname="device_init"; diff --git a/targets/ARCH/COMMON/common_lib.h b/targets/ARCH/COMMON/common_lib.h index 38a7b0fa67aac05b71d4f1a8635f0ba4e2895ed2..a60d5e78fc93f06a411918ef73e99db17fd9b636 100644 --- a/targets/ARCH/COMMON/common_lib.h +++ b/targets/ARCH/COMMON/common_lib.h @@ -46,8 +46,6 @@ #define OAI_THIRDPARTY_TP_LIBNAME "thirdparty_transpro" /* name of shared library implementing the rf simulator */ #define OAI_RFSIM_LIBNAME "rfsimulator" -/* name of shared library implementing the basic simulator */ -#define OAI_BASICSIM_LIBNAME "tcp_bridge_oai" /* name of shared library implementing the iq player */ #define OAI_IQPLAYER_LIBNAME "oai_iqplayer" diff --git a/targets/ARCH/tcp_bridge/README b/targets/ARCH/tcp_bridge/README deleted file mode 100644 index 9bd1a16e59293f3c9634c07257fa9b9e11ee23b8..0000000000000000000000000000000000000000 --- a/targets/ARCH/tcp_bridge/README +++ /dev/null @@ -1,4 +0,0 @@ -This is sort of a "TCP driver" to ease debugging. This is mostly internal -to EURECOM. You probably don't want to use it. - -Same license as the rest. diff --git a/targets/ARCH/tcp_bridge/README.tcp_bridge_oai b/targets/ARCH/tcp_bridge/README.tcp_bridge_oai deleted file mode 100644 index 05a520f6ae0286c82abd7a228160df34bad228ff..0000000000000000000000000000000000000000 --- a/targets/ARCH/tcp_bridge/README.tcp_bridge_oai +++ /dev/null @@ -1,42 +0,0 @@ -The driver tcp_bridge_oai.c is to be used with the basic simulator. - -To build the basic simulator: - cd [openair top directory] - . oaienv - cd cmake_targets - ./build_oai -I -w USRP - ./build_oai --basic-simulator - cd ../common/utils/T/tracer - make - -To use it, you need to run the eNB and the UE. - -The eNB requires the T tracer. -Open two terminals. -In one terminal, run: - cd [openair top directory] - cd common/utils/T/tracer - ./enb -d ../T_messages.txt -In the other terminal, run: - cd [openair top directory] - cd cmake_targets/basic_simulator/enb - export ENODEB=1 - sudo -E ./lte-softmodem -O [configuration file] --T_stdout 0 -[configuration file] is just a regular configuration file. -The eNB needs an EPC. - -To run the UE, open a terminal and run: - cd [openair top directory] - cd cmake_targets/basic_simulator/ue - sudo ./lte-uesoftmodem -C 2680000000 -r 25 --ue-rxgain 140 -Adapt the value of -r, it has to match the value N_RB_DL in the configuration -file of the eNB. (Same for -C which should match the value downlink_frequency -in the configuration file.) - -The UE configuration (security keys) is generated from the file -openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf. You need to configure -your EPC to know about the UE. If you change the file -openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf then you need to -regenerate the configuration files using the program targets/bin/conf2uedata. -You run it as: - $OPENAIR_DIR/targets/bin/conf2uedata -c $OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -o $OPENAIR_DIR/cmake_targets/basic_simulator/ue diff --git a/targets/ARCH/tcp_bridge/tcp_bridge.c b/targets/ARCH/tcp_bridge/tcp_bridge.c deleted file mode 100644 index f8c12dcb7acb0e89140f106b6b43eb246dd87c1b..0000000000000000000000000000000000000000 --- a/targets/ARCH/tcp_bridge/tcp_bridge.c +++ /dev/null @@ -1,292 +0,0 @@ -#include <sys/socket.h> -#include <netinet/in.h> -#include <netinet/tcp.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <unistd.h> - -int fullread(int fd, void *_buf, int count) -{ - char *buf = _buf; - int ret = 0; - int l; - while (count) { - l = read(fd, buf, count); - if (l <= 0) return -1; - count -= l; - buf += l; - ret += l; - } - return ret; -} - -int fullwrite(int fd, void *_buf, int count) -{ - char *buf = _buf; - int ret = 0; - int l; - while (count) { - l = write(fd, buf, count); - if (l <= 0) return -1; - count -= l; - buf += l; - ret += l; - } - return ret; -} - -#include "common_lib.h" - -typedef struct { - int32_t data[30720]; /* max 20MHz */ - unsigned long timestamp; - int size; -} input_buffer; - -#define BSIZE 16 - -typedef struct { - int sock; - int samples_per_subframe; - input_buffer b[BSIZE]; - int bstart; - int blen; - unsigned long read_timestamp; -} tcp_bridge_state_t; - - -/****************************************************************************/ -/* buffer management */ -/* (could be simpler, we are synchronous) */ -/* maybe we should lock */ -/****************************************************************************/ - -void put_buffer(tcp_bridge_state_t *t, void *data, int size, unsigned long timestamp) -{ - int nextpos; - if (t->blen == BSIZE) { printf("tcp_bridge: buffer full\n"); exit(1); } - if (size > 30720*4) abort(); - if (t->blen) { - int lastpos = (t->bstart+t->blen-1) % BSIZE; - if (timestamp != t->b[lastpos].timestamp + t->samples_per_subframe) - { printf("tcp_bridge: discontinuity\n"); exit(1); } - } - nextpos = (t->bstart+t->blen) % BSIZE; - t->b[nextpos].timestamp = timestamp; - t->b[nextpos].size = size; - memcpy(t->b[nextpos].data, data, size); - t->blen++; -} - -void get_buffer(tcp_bridge_state_t *t, void *data, int size, unsigned long timestamp) -{ - int pos; - if (t->blen == 0) { printf("tcp_bridge: buffer empty\n"); exit(1); } - if (size >30720*4) abort(); - pos = t->bstart; - if (size != t->b[pos].size) { printf("tcp_bridge: bad size\n"); exit(1); } - memcpy(data, t->b[pos].data, size); - t->bstart = (t->bstart + 1) % BSIZE; - t->blen--; -} - -/****************************************************************************/ -/* end of buffer management */ -/****************************************************************************/ - - -/****************************************************************************/ -/* network management (read/write) */ -/****************************************************************************/ - -void read_data_from_network(int sock, input_buffer *b) -{ - if (fullread(sock, &b->timestamp, sizeof(b->timestamp)) != sizeof(b->timestamp)) goto err; - if (fullread(sock, &b->size, sizeof(b->size)) != sizeof(b->size)) goto err; - if (fullread(sock, b->data, b->size) != b->size) goto err; - return; - -err: - printf("tcp_bridge: read_data_from_network fails\n"); - exit(1); -} - -void write_data_to_network(int sock, input_buffer *b) -{ - if (fullwrite(sock, &b->timestamp, sizeof(b->timestamp)) != sizeof(b->timestamp)) goto err; - if (fullwrite(sock, &b->size, sizeof(b->size)) != sizeof(b->size)) goto err; - if (fullwrite(sock, b->data, b->size) != b->size) goto err; - return; - -err: - printf("tcp_bridge: write_data_to_network fails\n"); - exit(1); -} - -/****************************************************************************/ -/* end of network management */ -/****************************************************************************/ - - -int tcp_bridge_start(openair0_device *device) -{ - int i; - int port = 4042; - tcp_bridge_state_t *tcp_bridge = device->priv; - - int sock = socket(AF_INET, SOCK_STREAM, 0); - if (sock == -1) { perror("tcp_bridge: socket"); exit(1); } - - int enable = 1; - if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int))) - { perror("tcp_bridge: SO_REUSEADDR"); exit(1); } - - struct sockaddr_in addr = { - sin_family: AF_INET, - sin_port: htons(port), - sin_addr: { s_addr: INADDR_ANY } - }; - - if (bind(sock, (struct sockaddr *)&addr, sizeof(addr))) - { perror("tcp_bridge: bind"); exit(1); } - - if (listen(sock, 5)) - { perror("tcp_bridge: listen"); exit(1); } - - printf("tcp_bridge: wait for connection on port %d\n", port); - - socklen_t len = sizeof(addr); - int sock2 = accept(sock, (struct sockaddr *)&addr, &len); - if (sock2 == -1) - { perror("tcp_bridge: accept"); exit(1); } - - close(sock); - - tcp_bridge->sock = sock2; - - /* the other end has to send 10 subframes at startup */ - for (i = 0; i < 10; i++) - read_data_from_network(sock2, &tcp_bridge->b[i]); - tcp_bridge->bstart = 0; - tcp_bridge->blen = 10; - - printf("tcp_bridge: connection established\n"); - - return 0; -} - -int tcp_bridge_request(openair0_device *device, void *msg, ssize_t msg_len) { abort(); return 0; } -int tcp_bridge_reply(openair0_device *device, void *msg, ssize_t msg_len) { abort(); return 0; } -int tcp_bridge_get_stats(openair0_device* device) { return 0; } -int tcp_bridge_reset_stats(openair0_device* device) { return 0; } -void tcp_bridge_end(openair0_device *device) {} -int tcp_bridge_stop(openair0_device *device) { return 0; } -int tcp_bridge_set_freq(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config) { return 0; } -int tcp_bridge_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) { return 0; } - -int tcp_bridge_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) -{ - tcp_bridge_state_t *t = device->priv; - input_buffer out; - int i; -//printf("write ts %ld nsamps %d\n", timestamp, nsamps); - - if (nsamps > 30720) abort(); - - /* read buffer timestamped with 'timestamp' if not already here */ - for (i = 0; i < t->blen; i++) { - input_buffer *b = &t->b[(t->bstart + i) % BSIZE]; - if (b->timestamp == timestamp) break; - } - if (i == t->blen) { - int nextpos = (t->bstart + t->blen) % BSIZE; - if (t->blen == BSIZE) abort(); - read_data_from_network(t->sock, &t->b[nextpos]); - t->blen++; - if (t->b[nextpos].timestamp != timestamp) abort(); - } - - memcpy(out.data, buff[0], nsamps * 4); - out.timestamp = timestamp; - out.size = nsamps * 4; - write_data_to_network(t->sock, &out); - - return nsamps; -} - -int tcp_bridge_read(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) -{ - tcp_bridge_state_t *t = device->priv; - input_buffer *b; - - if (cc != 1) abort(); - if (t->blen == 0) abort(); - - b = &t->b[t->bstart]; - - if (b->timestamp != t->read_timestamp) abort(); - if (b->size != nsamps * 4) abort(); - - *timestamp = b->timestamp; - memcpy(buff[0], b->data, b->size); - - t->read_timestamp += nsamps; - t->bstart = (t->bstart + 1) % BSIZE; - t->blen--; - -static unsigned long ts = 0; -//printf("read ts %ld nsamps %d\n", ts, nsamps); -*timestamp = ts; -ts += nsamps; - - return nsamps; -} - -int tcp_bridge_write_init(openair0_device *device) -{ - return 0; -} - -__attribute__((__visibility__("default"))) -int device_init(openair0_device* device, openair0_config_t *openair0_cfg) -{ - tcp_bridge_state_t *tcp_bridge = (tcp_bridge_state_t*)malloc(sizeof(tcp_bridge_state_t)); - memset(tcp_bridge, 0, sizeof(tcp_bridge_state_t)); - - /* only 25 or 50 PRBs handled for the moment */ - if (openair0_cfg[0].sample_rate != 61440000 && - openair0_cfg[0].sample_rate != 30720000 && - openair0_cfg[0].sample_rate != 15360000 && - openair0_cfg[0].sample_rate != 7680000) { - printf("tcp_bridge: ERROR: only sample rate 61.44, 30.72, 15.36, and 7.68 Msps supported\n"); - exit(1); - } - - device->trx_start_func = tcp_bridge_start; - device->trx_get_stats_func = tcp_bridge_get_stats; - device->trx_reset_stats_func = tcp_bridge_reset_stats; - device->trx_end_func = tcp_bridge_end; - device->trx_stop_func = tcp_bridge_stop; - device->trx_set_freq_func = tcp_bridge_set_freq; - device->trx_set_gains_func = tcp_bridge_set_gains; - device->trx_write_func = tcp_bridge_write; - device->trx_read_func = tcp_bridge_read; - device->trx_write_init = tcp_bridge_write_init; - - device->priv = tcp_bridge; - - switch ((int)openair0_cfg[0].sample_rate) { - case 61440000: tcp_bridge->samples_per_subframe = 61440; break; - case 30720000: tcp_bridge->samples_per_subframe = 30720; break; - case 15360000: tcp_bridge->samples_per_subframe = 15360; break; - case 7680000: tcp_bridge->samples_per_subframe = 7680; break; - } - - /* let's pretend to be a b2x0 */ - device->type = USRP_B200_DEV; - - device->openair0_cfg=&openair0_cfg[0]; - - return 0; -} diff --git a/targets/ARCH/tcp_bridge/tcp_bridge_oai.c b/targets/ARCH/tcp_bridge/tcp_bridge_oai.c deleted file mode 100644 index c3d5355876cde1e976f52f3ace43452ab35a1f63..0000000000000000000000000000000000000000 --- a/targets/ARCH/tcp_bridge/tcp_bridge_oai.c +++ /dev/null @@ -1,443 +0,0 @@ -#include <sys/socket.h> -#include <netinet/in.h> -#include <netinet/tcp.h> -#include <arpa/inet.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <errno.h> - -const int port = 4043; -#define helpTxt "\ -\x1b[31m\ -tcp_bridge: error: you have to run one UE and one eNB\n\ -For this, export TCPBRIDGE=enb (eNB case) or \n\ - TCPBRIDGE=<an ip address> (UE case)\n\ -\x1b[m" - -int fullread(int fd, void *_buf, int count) { - char *buf = _buf; - int ret = 0; - int l; - - while (count) { - l = read(fd, buf, count); - - if (l <= 0) return -1; - - count -= l; - buf += l; - ret += l; - } - - return ret; -} - -int fullwrite(int fd, void *_buf, int count) { - char *buf = _buf; - int ret = 0; - int l; - - while (count) { - l = write(fd, buf, count); - - if (l <= 0) return -1; - - count -= l; - buf += l; - ret += l; - } - - return ret; -} - -#include "common_lib.h" - -typedef struct { - int sock; - int samples_per_subframe; - uint64_t timestamp; - uint64_t next_tx_timestamp; - int is_enb; - char *ip; -} tcp_bridge_state_t; - -void verify_connection(int fd, int is_enb) { - char c = is_enb; - - if (fullwrite(fd, &c, 1) != 1) exit(1); - - if (fullread(fd, &c, 1) != 1) exit(1); - - if (c == is_enb) { - printf(helpTxt); - exit(1); - } -} - - -int start_enb(tcp_bridge_state_t *tcp_bridge) { - struct sockaddr_in addr = { -sin_family: - AF_INET, -sin_port: - htons(port), -sin_addr: - { s_addr: INADDR_ANY } - }; - - if (bind(tcp_bridge->sock, (struct sockaddr *)&addr, sizeof(addr))) { - perror("tcp_bridge: bind"); - exit(1); - } - - if (listen(tcp_bridge->sock, 5)) { - perror("tcp_bridge: listen"); - exit(1); - } - - printf("tcp_bridge: wait for connection on port %d\n", port); - socklen_t len = sizeof(addr); - int sockServ = accept(tcp_bridge->sock, (struct sockaddr *)&addr, &len); - - if ( sockServ == -1) { - perror("tcp_bridge: accept"); - exit(1); - } - - verify_connection(sockServ, tcp_bridge->is_enb); - printf("tcp_bridge: connection established\n"); - close(tcp_bridge->sock); - tcp_bridge->sock=sockServ; - return 0; -} - -int start_ue(tcp_bridge_state_t *tcp_bridge) { -struct sockaddr_in addr = {sin_family: - AF_INET, -sin_port: - htons(port), -sin_addr: - { s_addr: INADDR_ANY } - }; - addr.sin_addr.s_addr = inet_addr(tcp_bridge->ip); - - while(1) { - printf("tcp_bridge: trying to connect to %s:%d\n", tcp_bridge->ip, port); - - if (connect(tcp_bridge->sock, (struct sockaddr *)&addr, sizeof(addr)) == 0) { - verify_connection(tcp_bridge->sock, tcp_bridge->is_enb); - printf("tcp_bridge: connection established\n"); - return 0; - } - - perror("tcp_bridge"); - sleep(1); - } - - return 0; -} - -int tcp_bridge_start(openair0_device *device) { - tcp_bridge_state_t *tcp_bridge = device->priv; - tcp_bridge->sock = socket(AF_INET, SOCK_STREAM, 0); - - if (tcp_bridge->sock == -1) { - perror("tcp_bridge: socket"); - exit(1); - } - - int enable = 1; - - if (setsockopt(tcp_bridge->sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int))) { - perror("tcp_bridge: SO_REUSEADDR"); - exit(1); - } - - if ( tcp_bridge->is_enb ) - return start_enb(tcp_bridge); - else - return start_ue(tcp_bridge); -} - -int tcp_bridge_request(openair0_device *device, void *msg, ssize_t msg_len) { - abort(); - return 0; -} -int tcp_bridge_reply(openair0_device *device, void *msg, ssize_t msg_len) { - abort(); - return 0; -} -int tcp_bridge_get_stats(openair0_device *device) { - return 0; -} -int tcp_bridge_reset_stats(openair0_device *device) { - return 0; -} -void tcp_bridge_end(openair0_device *device) {} -int tcp_bridge_stop(openair0_device *device) { - return 0; -} -int tcp_bridge_set_freq(openair0_device *device, openair0_config_t *openair0_cfg,int exmimo_dump_config) { - return 0; -} -int tcp_bridge_set_gains(openair0_device *device, openair0_config_t *openair0_cfg) { - return 0; -} - -int tcp_bridge_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) { - if (cc != 1) { - printf("tcp_bridge: only 1 antenna supported\n"); - exit(1); - } - - tcp_bridge_state_t *t = device->priv; - - /* deal with discontinuities in output (think: eNB in TDD mode) */ - if (t->next_tx_timestamp && timestamp != t->next_tx_timestamp) { - uint32_t b[4096]; - uint64_t to_send = timestamp - t->next_tx_timestamp; - memset(b, 0, 4096 * sizeof(uint32_t)); - - while (to_send) { - int len = to_send > 4096 ? 4096 : to_send; - int n = fullwrite(t->sock, b, len * 4); - - if (n != len * 4) { - printf("tcp_bridge: write error ret %d error %s\n", n, strerror(errno)); - abort(); - } - - to_send -= len; - } - } - - int n = fullwrite(t->sock, buff[0], nsamps * 4); - - if (n != nsamps * 4) { - printf("tcp_bridge: write error ret %d (wanted %d) error %s\n", n, nsamps*4, strerror(errno)); - abort(); - } - - t->next_tx_timestamp = timestamp + nsamps; - return nsamps; -} - -int tcp_bridge_read(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) { - if (cc != 1) { - printf("tcp_bridge: only 1 antenna supported\n"); - exit(1); - } - - tcp_bridge_state_t *t = device->priv; - int n = fullread(t->sock, buff[0], nsamps * 4); - - if (n != nsamps * 4) { - printf("tcp_bridge: read error ret %d nsamps*4 %d error %s\n", n, nsamps * 4, strerror(errno)); - abort(); - } - - *timestamp = t->timestamp; - t->timestamp += nsamps; - return nsamps; -} - -int tcp_bridge_read_ue(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) { - if (cc != 1) { - printf("tcp_bridge: only 1 antenna supported\n"); - exit(1); - } - - tcp_bridge_state_t *t = device->priv; - int n; - - /* In synch mode, UE does not write, but we need to - send something to the eNodeB. - We know that UE is in synch mode when it reads - 10 subframes at a time. - */ - if (nsamps == t->samples_per_subframe * 10) { - uint32_t b[nsamps]; - memset(b, 0, nsamps * 4); - n = fullwrite(t->sock, b, nsamps * 4); - - if (n != nsamps * 4) { - printf("tcp_bridge: write error ret %d error %s\n", n, strerror(errno)); - abort(); - } - } - - return tcp_bridge_read(device, timestamp, buff, nsamps, cc); -} - -/* To startup proper communcation between eNB and UE, - we need to understand that: - - eNodeB starts reading subframe 0 - - then eNodeB starts sending subframe 4 - and then repeats read/write for each subframe. - The UE: - - reads 10 subframes at a time until it is synchronized - - then reads subframe n and writes subframe n+2 - We also want to enforce that the subframe 0 is read - at the beginning of the UE RX buffer, not in the middle - of it. - So it means: - - for the eNodeB: let it run as in normal mode (as with a B210) - - for the UE, on its very first read: - - we want this read to get data from subframe 0 - but the first write of eNodeB is subframe 4 - so we first need to read and ignore 6 subframes - - the UE will start its TX only at the subframe 2 - corresponding to the subframe 0 it just read, - so we need to write 12 subframes before anything - (the function tcp_bridge_read_ue takes care to - insert dummy TX data during the synch phase) - - Here is a drawing of the beginning of things to make - this logic clearer. - - We see that eNB starts RX at subframe 0, starts TX at subfram 4, - and that UE starts RX at subframe 10 and TX at subframe 12. - - We understand that the UE has to transmit 12 empty - subframes for the eNodeB to start its processing. - - And because the eNodeB starts its TX at subframe 4 and we - want the UE to start its RX at subframe 10, we need to - read and ignore 6 subframes in the UE. - - ------------------------------------------------------------------------- - eNB RX: | *0* | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 ... - ------------------------------------------------------------------------- - - ------------------------------------------------------------------------- - eNB TX: | 0 | 1 | 2 | 3 | *4* | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 ... - ------------------------------------------------------------------------- - - ------------------------------------------------------------------------- - UE RX: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | *10* | 11 | 12 | 13 | 14 ... - ------------------------------------------------------------------------- - - ------------------------------------------------------------------------- - UE TX: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | *12* | 13 | 14 ... - ------------------------------------------------------------------------- - - As a final note, we do TX before RX to ensure that the eNB will - get some data and send us something so there is no deadlock - at the beginning of things. Hopefully the kernel buffers for - the sockets are big enough so that the first (big) TX can - return to user mode before the buffers are full. If this - is wrong in some environment, we will need to work by smaller - units of data at a time. -*/ -int tcp_bridge_ue_first_read(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) { - if (cc != 1) { - printf("tcp_bridge: only 1 antenna supported\n"); - exit(1); - } - - tcp_bridge_state_t *t = device->priv; - uint32_t b[t->samples_per_subframe * 12]; - memset(b, 0, t->samples_per_subframe * 12 * 4); - int n = fullwrite(t->sock, b, t->samples_per_subframe * 12 * 4); - - if (n != t->samples_per_subframe * 12 * 4) { - printf("tcp_bridge: write error ret %d error %s\n", n, strerror(errno)); - abort(); - } - - n = fullread(t->sock, b, t->samples_per_subframe * 6 * 4); - - if (n != t->samples_per_subframe * 6 * 4) { - printf("tcp_bridge: read error ret %d error %s\n", n, strerror(errno)); - abort(); - } - - /* Due to some unknown bug in the eNB (or UE, or both), the first frames - * are not correctly generated (or handled), which leads to a bad behavior - * of the simulator in some cases (seen with 100 RBs: the UE reads a bad - * MIB and switches to 25 RBs, which results in a deadlock in this driver). - * Let's skip 10 frames to avoid this issue. - */ - for (int i = 0; i < 10 * 10; i++) { - memset(b, 0, t->samples_per_subframe * 4); - n = fullwrite(t->sock, b, t->samples_per_subframe * 4); - - if (n != t->samples_per_subframe * 4) { - printf("tcp_bridge: write error ret %d error %s\n", n, strerror(errno)); - abort(); - } - - n = fullread(t->sock, b, t->samples_per_subframe * 4); - - if (n != t->samples_per_subframe * 4) { - printf("tcp_bridge: read error ret %d error %s\n", n, strerror(errno)); - abort(); - } - } - - device->trx_read_func = tcp_bridge_read_ue; - return tcp_bridge_read_ue(device, timestamp, buff, nsamps, cc); -} - -__attribute__((__visibility__("default"))) -int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { - tcp_bridge_state_t *tcp_bridge = (tcp_bridge_state_t *)calloc(sizeof(tcp_bridge_state_t),1); - - if ((tcp_bridge->ip=getenv("TCPBRIDGE")) == NULL ) { - /* for compatibility, we test the ENB environment variable */ - if ((tcp_bridge->ip=getenv("ENODEB")) != NULL ) { - tcp_bridge->ip=strdup("enb"); - } else { - tcp_bridge->ip=strdup("127.0.0.1"); - } - } - - tcp_bridge->is_enb = strncasecmp(tcp_bridge->ip,"enb",3) == 0; - printf("tcp_bridge: running as %s\n", tcp_bridge->is_enb ? "eNB" : "UE"); - - if (openair0_cfg[0].sample_rate != 61440000 && - openair0_cfg[0].sample_rate != 30720000 && - openair0_cfg[0].sample_rate != 15360000 && - openair0_cfg[0].sample_rate != 7680000) { - printf("tcp_bridge: ERROR: only sample rate 61.44, 30.72, 15.36, and 7.68 Msps supported\n"); - exit(1); - } - - device->trx_start_func = tcp_bridge_start; - device->trx_get_stats_func = tcp_bridge_get_stats; - device->trx_reset_stats_func = tcp_bridge_reset_stats; - device->trx_end_func = tcp_bridge_end; - device->trx_stop_func = tcp_bridge_stop; - device->trx_set_freq_func = tcp_bridge_set_freq; - device->trx_set_gains_func = tcp_bridge_set_gains; - device->trx_write_func = tcp_bridge_write; - - if (tcp_bridge->is_enb) { - device->trx_read_func = tcp_bridge_read; - } else { - device->trx_read_func = tcp_bridge_ue_first_read; - } - - device->priv = tcp_bridge; - - switch ((int)openair0_cfg[0].sample_rate) { - case 30720000: - tcp_bridge->samples_per_subframe = 30720; - break; - - case 15360000: - tcp_bridge->samples_per_subframe = 15360; - break; - - case 7680000: - tcp_bridge->samples_per_subframe = 7680; - break; - } - - /* let's pretend to be a b2x0 */ - device->type = USRP_B200_DEV; - device->openair0_cfg=&openair0_cfg[0]; - return 0; -} diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 7e897c7debdbd3c32dd6f70920c8093b61eaf0e0..66ce6ef2474acaa36da14769254d8664e1e37d2d 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1387,12 +1387,6 @@ int setup_RU_buffers(RU_t *ru) { else if (frame_parms->N_RB_DL == 50) ru->N_TA_offset = 624/2; else if (frame_parms->N_RB_DL == 25) ru->N_TA_offset = 624/4; - if(IS_SOFTMODEM_BASICSIM) - /* this is required for the basic simulator in TDD mode - * TODO: find a proper cleaner solution - */ - ru->N_TA_offset = 0; - if (frame_parms->N_RB_DL == 100) /* no scaling to do */; else if (frame_parms->N_RB_DL == 50) { ru->sf_extension /= 2; diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 25da395b9010570f816bdf1626377a6cd272f55e..9010a40bf951feb6008f4a4acdb0d394f376aaa7 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -360,12 +360,6 @@ void init_UE(int nb_inst, } } else UE->N_TA_offset = 0; - if( IS_SOFTMODEM_BASICSIM) - /* this is required for the basic simulator in TDD mode - * TODO: find a proper cleaner solution - */ - UE->N_TA_offset = 0; - LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]); init_UE_threads(inst); @@ -883,7 +877,7 @@ static void *UE_thread_rxn_txnp4(void *arg) proc->instance_cnt_rxtx--; - if ( IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) { + if (IS_SOFTMODEM_RFSIM) { if (pthread_cond_signal(&proc->cond_rxtx) != 0) abort(); } @@ -1998,12 +1992,6 @@ void *UE_thread(void *arg) log_scheduler(__func__); while (!oai_exit) { - if (IS_SOFTMODEM_BASICSIM) - while (!(UE->proc.instance_cnt_synch < 0)) { - printf("ue sync not ready\n"); - usleep(500*1000); - } - AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synch), ""); int instance_cnt_synch = UE->proc.instance_cnt_synch; int is_synchronized = UE->is_synchronized; @@ -2131,7 +2119,7 @@ void *UE_thread(void *arg) // update thread index for received subframe UE->current_thread_id[sub_frame] = thread_idx; - if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) { + if (IS_SOFTMODEM_RFSIM ) { int t; for (t = 0; t < 2; t++) { @@ -2223,8 +2211,8 @@ void *UE_thread(void *arg) LOG_E(PHY,"can't compensate: diff =%d\n", first_symbols); } - /* no timeout in IS_SOFTMODEM_BASICSIM or IS_SOFTMODEM_RFSIM mode */ - if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) { + /* no timeout in IS_SOFTMODEM_RFSIM mode */ + if (IS_SOFTMODEM_RFSIM) { ret = pthread_mutex_lock(&proc->mutex_rxtx); } else { struct timespec tv; diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c index 2b39bd3f0fca94c7bef3f55d6f421b093b2a5254..8cdef647cab5063722aaccf0d3ccbe938677e6ef 100644 --- a/targets/RT/USER/lte-uesoftmodem.c +++ b/targets/RT/USER/lte-uesoftmodem.c @@ -519,7 +519,7 @@ int restart_L1L2(module_id_t enb_id) { static void init_pdcp(int ue_id) { uint32_t pdcp_initmask = (!IS_SOFTMODEM_NOS1) ? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT); - if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) { + if (IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) { pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT; }