diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index d118dd270d..9961d8a884 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -44,7 +44,7 @@ pipeline { disableConcurrentBuilds() timestamps() gitLabConnection('OAI GitLab') - gitlabBuilds(builds: ["Build basic-sim", "Build gNb-usrp", "Build nr-UE-usrp", "Build eNb-USRP", "Build phy-sim", "Build eNb-ethernet", "Build UE-ethernet", "Analysis with cppcheck", "Test phy-sim", "Test basic-sim", "Test L2-sim", "Test-Mono-FDD-Band7", "Test-Mono-TDD-Band40", "Test-IF4p5-FDD-Band7", "Test-IF4p5-TDD-Band40", "Test-Mono-FDD-Band13"]) + gitlabBuilds(builds: ["Build gNb-usrp", "Build nr-UE-usrp", "Build eNb-USRP", "Build basic-sim", "Build phy-sim", "Build eNb-ethernet", "Build UE-ethernet", "Analysis with cppcheck", "Test phy-sim", "Test basic-sim", "Test L2-sim", "Test-Mono-FDD-Band7", "Test-Mono-TDD-Band40", "Test-IF4p5-FDD-Band7", "Test-IF4p5-TDD-Band40", "Test-Mono-FDD-Band13", "Test-IF4p5-TDD-Band38-Multi-RRU"]) ansiColor('xterm') } @@ -515,6 +515,25 @@ pipeline { } } } + stage ("Test IF4p5 - TDD - Band 38 - B210 - MultiRRU") { + steps { + script { + triggerSlaveJob ('eNB-CI-IF4p5-TDD-Band38-MultiRRU-B210', 'Test-IF4p5-TDD-Band38-Multi-RRU') + } + } + post { + always { + script { + finalizeSlaveJob('eNB-CI-IF4p5-TDD-Band38-MultiRRU-B210') + } + } + failure { + script { + currentBuild.result = 'FAILURE' + } + } + } + } stage ("Test IF4p5 - TDD - Band 40 - B210") { steps { script { diff --git a/ci-scripts/Jenkinsfile-tmp-multi-enb b/ci-scripts/Jenkinsfile-tmp-multi-enb new file mode 100644 index 0000000000..c3b825ec06 --- /dev/null +++ b/ci-scripts/Jenkinsfile-tmp-multi-enb @@ -0,0 +1,282 @@ +#!/bin/groovy +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +// Template Jenkins Declarative Pipeline script to run Test w/ RF HW + +// Location of the python executor node shall be in the same subnet as the others servers +def pythonExecutor = params.pythonExecutor + +// Location of the test XML file to be run +def testXMLFile = params.pythonTestXmlFile +def mainPythonAllXmlFiles = "" +def buildStageStatus = true + +// Name of the test stage +def testStageName = params.pipelineTestStageName + +// Name of the phone resource +def ciSmartPhoneResource = params.smartphonesResource + +// Global Parameters. Normally they should be populated when the master job +// triggers the slave job with parameters +def eNB_Repository +def eNB_Branch +def eNB_CommitID +def eNB_AllowMergeRequestProcess = false +def eNB_TargetBranch + +pipeline { + agent { + label pythonExecutor + } + options { + disableConcurrentBuilds() + ansiColor('xterm') + lock (ciSmartPhoneResource) + } + stages { + stage ("Verify Parameters") { + steps { + script { + echo '\u2705 \u001B[32mVerify Parameters\u001B[0m' + def allParametersPresent = true + + // It is already to late to check it + if (params.pythonExecutor != null) { + echo "eNB CI executor node : ${pythonExecutor}" + } + // If not present picking a default Stage Name + if (params.pipelineTestStageName == null) { + // picking default + testStageName = 'Template Test Stage' + } + + if (params.smartphonesResource == null) { + allParametersPresent = false + } + // 1st eNB parameters + if (params.eNB_IPAddress == null) { + allParametersPresent = false + } + if (params.eNB_SourceCodePath == null) { + allParametersPresent = false + } + if (params.eNB_Credentials == null) { + allParametersPresent = false + } + // 2nd eNB parameters + if (params.eNB1_IPAddress == null) { + allParametersPresent = false + } + if (params.eNB1_SourceCodePath == null) { + allParametersPresent = false + } + if (params.eNB1_Credentials == null) { + allParametersPresent = false + } + // 3rd eNB parameters + if (params.eNB2_IPAddress == null) { + allParametersPresent = false + } + if (params.eNB2_SourceCodePath == null) { + allParametersPresent = false + } + if (params.eNB2_Credentials == null) { + allParametersPresent = false + } + // the following 4 parameters should be pushed by the master trigger + // if not present, take the job GIT variables (used for developing) + if (params.eNB_Repository == null) { + eNB_Repository = env.GIT_URL + } else { + eNB_Repository = params.eNB_Repository + } + echo "eNB_Repository : ${eNB_Repository}" + if (params.eNB_Branch == null) { + eNB_Branch = env.GIT_BRANCH + } else { + eNB_Branch = params.eNB_Branch + } + echo "eNB_Branch : ${eNB_Branch}" + if (params.eNB_CommitID == null) { + eNB_CommitID = env.GIT_COMMIT + } else { + eNB_CommitID = params.eNB_CommitID + } + echo "eNB_CommitID : ${eNB_CommitID}" + if (params.eNB_mergeRequest != null) { + eNB_AllowMergeRequestProcess = params.eNB_mergeRequest + if (eNB_AllowMergeRequestProcess) { + if (params.eNB_TargetBranch != null) { + eNB_TargetBranch = params.eNB_TargetBranch + } else { + eNB_TargetBranch = 'develop' + } + echo "eNB_TargetBranch : ${eNB_TargetBranch}" + } + } + + if (params.EPC_IPAddress == null) { + allParametersPresent = false + } + if (params.EPC_Type == null) { + allParametersPresent = false + } + if (params.EPC_SourceCodePath == null) { + allParametersPresent = false + } + if (params.EPC_Credentials == null) { + allParametersPresent = false + } + + if (params.ADB_IPAddress == null) { + allParametersPresent = false + } + if (params.ADB_Credentials == null) { + allParametersPresent = false + } + + if (allParametersPresent) { + echo "All parameters are present" + if (eNB_AllowMergeRequestProcess) { + sh "git fetch" + sh "./ci-scripts/doGitLabMerge.sh --src-branch ${eNB_Branch} --src-commit ${eNB_CommitID} --target-branch ${eNB_TargetBranch} --target-commit latest" + } else { + sh "git fetch" + sh "git checkout -f ${eNB_CommitID}" + } + } else { + echo "Some parameters are missing" + sh "./ci-scripts/fail.sh" + } + } + } + } + stage ("Build and Test") { + steps { + script { + dir ('ci-scripts') { + echo "\u2705 \u001B[32m${testStageName}\u001B[0m" + // If not present picking a default XML file + if (params.pythonTestXmlFile == null) { + // picking default + testXMLFile = 'xml_files/enb_usrpB210_band7_50PRB.xml' + echo "Test XML file(default): ${testXMLFile}" + mainPythonAllXmlFiles += "--XMLTestFile=" + testXMLFile + " " + } else { + String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") + for (xmlFile in myXmlTestSuite) { + if (fileExists(xmlFile)) { + mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " " + echo "Test XML file : ${xmlFile}" + } + } + } + withCredentials([ + [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'], + [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB1_Credentials}", usernameVariable: 'eNB1_Username', passwordVariable: 'eNB1_Password'], + [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB2_Credentials}", usernameVariable: 'eNB2_Username', passwordVariable: 'eNB2_Password'], + [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'], + [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ADB_Credentials}", usernameVariable: 'ADB_Username', passwordVariable: 'ADB_Password'] + ]) { + sh "python3 main.py --mode=InitiateHtml --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} ${mainPythonAllXmlFiles}" + String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") + for (xmlFile in myXmlTestSuite) { + if (fileExists(xmlFile)) { + try { + sh "python3 main.py --mode=TesteNB --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --eNB1IPAddress=${params.eNB1_IPAddress} --eNB1UserName=${eNB1_Username} --eNB1Password=${eNB1_Password} --eNB1SourceCodePath=${params.eNB1_SourceCodePath} --eNB2IPAddress=${params.eNB2_IPAddress} --eNB2UserName=${eNB2_Username} --eNB2Password=${eNB2_Password} --eNB2SourceCodePath=${params.eNB2_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} --XMLTestFile=${xmlFile}" + } catch (Exception e) { + currentBuild.result = 'FAILURE' + buildStageStatus = false + } + } + } + sh "python3 main.py --mode=FinalizeHtml --finalStatus=${buildStageStatus} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password}" + } + } + } + } + } + stage('Log Collection') { + parallel { + stage('Log Collection (eNB - Build)') { + steps { + withCredentials([ + [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'] + ]) { + echo '\u2705 \u001B[32mLog Collection (eNB - Build)\u001B[0m' + sh "python3 ci-scripts/main.py --mode=LogCollectBuild --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath}" + + echo '\u2705 \u001B[32mLog Transfer (eNB - Build)\u001B[0m' + sh "sshpass -p \'${eNB_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${eNB_Username}@${params.eNB_IPAddress}:${eNB_SourceCodePath}/cmake_targets/build.log.zip ./build.log.${env.BUILD_ID}.zip || true" + } + script { + if(fileExists("build.log.${env.BUILD_ID}.zip")) { + archiveArtifacts "build.log.${env.BUILD_ID}.zip" + } + } + } + } + stage('Log Collection (eNB - Run)') { + steps { + withCredentials([ + [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'] + ]) { + echo '\u2705 \u001B[32mLog Collection (eNB - Run)\u001B[0m' + sh "python3 ci-scripts/main.py --mode=LogCollecteNB --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath}" + + echo '\u2705 \u001B[32mLog Transfer (eNB - Run)\u001B[0m' + sh "sshpass -p \'${eNB_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${eNB_Username}@${params.eNB_IPAddress}:${eNB_SourceCodePath}/cmake_targets/enb.log.zip ./enb.log.${env.BUILD_ID}.zip || true" + } + script { + if(fileExists("enb.log.${env.BUILD_ID}.zip")) { + archiveArtifacts "enb.log.${env.BUILD_ID}.zip" + } + if(fileExists("ci-scripts/test_results.html")) { + sh "mv ci-scripts/test_results.html test_results-${JOB_NAME}.html" + sh "sed -i -e 's#TEMPLATE_JOB_NAME#${JOB_NAME}#' -e 's@build #TEMPLATE_BUILD_ID@build #${BUILD_ID}@' -e 's#Build-ID: TEMPLATE_BUILD_ID#Build-ID: ${BUILD_ID}#' -e 's#TEMPLATE_STAGE_NAME#${testStageName}#' test_results-${JOB_NAME}.html" + archiveArtifacts "test_results-${JOB_NAME}.html" + } + } + } + } + } + } + } + + post { + always { + script { + if (params.pipelineZipsConsoleLog != null) { + if (params.pipelineZipsConsoleLog) { + echo "Archiving Jenkins console log" + sh "wget --no-check-certificate --no-proxy ${env.JENKINS_URL}/job/${env.JOB_NAME}/${env.BUILD_ID}/consoleText -O consoleText.log || true" + sh "zip -m consoleText.log.${env.BUILD_ID}.zip consoleText.log || true" + if(fileExists("consoleText.log.${env.BUILD_ID}.zip")) { + archiveArtifacts "consoleText.log.${env.BUILD_ID}.zip" + } + } + } + } + } + } +} diff --git a/ci-scripts/conf_files/rcc.band38.tm1.50PRB.multi.rru.conf b/ci-scripts/conf_files/rcc.band38.tm1.50PRB.multi.rru.conf new file mode 100644 index 0000000000..9b19536ba0 --- /dev/null +++ b/ci-scripts/conf_files/rcc.band38.tm1.50PRB.multi.rru.conf @@ -0,0 +1,240 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + # real_time choice in {hard, rt-preempt, no} + real_time = "no"; + + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ( { mcc = 208; mnc = 92; mnc_length = 2; } ); + tr_s_preference = "local_mac" + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "NGFI_RCC_IF4p5"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "TDD"; + tdd_config = 1; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 38; + downlink_frequency = 2580000000L; + uplink_frequency_offset = 0; + Nid_cell = 0; + N_RB_DL = 50; #25; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + pbch_repetition = "FALSE"; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 0; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -27; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -104; #-96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; #-104; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + ue_TransmissionMode = 1; + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "enp129s0f0"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; + ENB_INTERFACE_NAME_FOR_S1U = "enp129s0f0"; + ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; #"127.0.0.4/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152\ + + ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; + ENB_PORT_FOR_X2C = 36422; # Spec 36422 + + }; + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + } +); + +RUs = ( + { + local_if_name = "enp129s0f0"; + local_address = "CI_ENB_IP_ADDR"; + remote_address = "CI_RRU1_IP_ADDR"; + local_portc = 50002; + remote_portc = 50002; + local_portd = 50003; + remote_portd = 50003; + local_rf = "no" + tr_preference = "udp_if4p5" + nb_tx = 1 + nb_rx = 1 + att_tx = 20 + att_rx = 20; + eNB_instances = [0]; + is_slave = "no"; + }, + { + local_if_name = "enp129s0f0"; + local_address = "CI_ENB_IP_ADDR"; + remote_address = "CI_RRU2_IP_ADDR"; + local_portc = 50010; + remote_portc = 50010; + local_portd = 50011; + remote_portd = 50011; + local_rf = "no" + tr_preference = "udp_if4p5" + nb_tx = 1 + nb_rx = 1 + att_tx = 20 + att_rx = 20; + eNB_instances = [0]; + is_slave = "yes"; + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_RU_L1_TRX_SPLIT"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +log_config = { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; +}; diff --git a/ci-scripts/conf_files/rru.band38.tm1.master.conf b/ci-scripts/conf_files/rru.band38.tm1.master.conf new file mode 100644 index 0000000000..2e4124c421 --- /dev/null +++ b/ci-scripts/conf_files/rru.band38.tm1.master.conf @@ -0,0 +1,46 @@ +RUs = ( + { + local_if_name = "enp1s0"; + remote_address = "CI_RCC_IP_ADDR"; + local_address = "CI_ENB_IP_ADDR"; + local_portc = 50002; + remote_portc = 50002; + local_portd = 50003; + remote_portd = 50003; + local_rf = "yes" + tr_preference = "udp_if4p5"; + nb_tx = 1; + nb_rx = 1; + max_pdschReferenceSignalPower = -12; + max_rxgain = 100; + bands = [38]; + is_slave = "no"; + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +log_config = { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; +}; + diff --git a/ci-scripts/conf_files/rru.band38.tm1.slave.conf b/ci-scripts/conf_files/rru.band38.tm1.slave.conf new file mode 100644 index 0000000000..e4c65e148e --- /dev/null +++ b/ci-scripts/conf_files/rru.band38.tm1.slave.conf @@ -0,0 +1,46 @@ +RUs = ( + { + local_if_name = "enp1s0"; + remote_address = "CI_RCC_IP_ADDR"; + local_address = "CI_ENB_IP_ADDR"; + local_portc = 50010; + remote_portc = 50010; + local_portd = 50011; + remote_portd = 50011; + local_rf = "yes" + tr_preference = "udp_if4p5"; + nb_tx = 1; + nb_rx = 1; + max_pdschReferenceSignalPower = -12; + max_rxgain = 100; + bands = [38]; + is_slave = "yes"; + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +log_config = { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; +}; + diff --git a/ci-scripts/doGitLabMerge.sh b/ci-scripts/doGitLabMerge.sh index dd93ff41b7..c4aa9157de 100755 --- a/ci-scripts/doGitLabMerge.sh +++ b/ci-scripts/doGitLabMerge.sh @@ -125,7 +125,16 @@ fi git config user.email "jenkins@openairinterface.org" git config user.name "OAI Jenkins" -git checkout -f $SOURCE_COMMIT_ID +git checkout -f $SOURCE_COMMIT_ID > checkout.txt 2>&1 +STATUS=`egrep -c "fatal: reference is not a tree" checkout.txt` +rm -f checkout.txt +if [ $STATUS -ne 0 ] +then + echo "fatal: reference is not a tree --> $SOURCE_COMMIT_ID" + STATUS=-1 + exit $STATUS +fi + git log -n1 --pretty=format:\"%s\" > .git/CI_COMMIT_MSG git merge --ff $TARGET_COMMIT_ID -m "Temporary merge for CI" diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 49850adb71..05f49c91ad 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -43,6 +43,7 @@ ENB_PROCESS_SEG_FAULT = -11 ENB_PROCESS_ASSERTION = -12 ENB_PROCESS_REALTIME_ISSUE = -13 ENB_PROCESS_NOLOGFILE_TO_ANALYZE = -14 +ENB_PROCESS_SLAVE_RRU_NOT_SYNCED = -15 HSS_PROCESS_FAILED = -2 HSS_PROCESS_OK = +2 MME_PROCESS_FAILED = -3 @@ -81,18 +82,26 @@ logging.basicConfig( #----------------------------------------------------------- class SSHConnection(): def __init__(self): + self.ranRepository = '' + self.ranBranch = '' + self.ranAllowMerge = False + self.ranCommitID = '' + self.ranTargetBranch = '' self.eNBIPAddress = '' - self.eNBRepository = '' - self.eNBBranch = '' - self.eNB_AllowMerge = False - self.eNBCommitID = '' - self.eNBTargetBranch = '' self.eNBUserName = '' self.eNBPassword = '' self.eNBSourceCodePath = '' self.EPCIPAddress = '' self.EPCUserName = '' self.EPCPassword = '' + self.eNB1IPAddress = '' + self.eNB1UserName = '' + self.eNB1Password = '' + self.eNB1SourceCodePath = '' + self.eNB2IPAddress = '' + self.eNB2UserName = '' + self.eNB2Password = '' + self.eNB2SourceCodePath = '' self.EPCSourceCodePath = '' self.EPCType = '' self.EPC_PcapFileName = '' @@ -104,13 +113,14 @@ class SSHConnection(): self.nbTestXMLfiles = 0 self.desc = '' self.Build_eNB_args = '' + self.backgroundBuild = False + self.backgroundBuildTestId = ['', '', ''] self.Initialize_eNB_args = '' - self.air_interface = 'lte' - self.eNBLogFile = '' + self.air_interface = 'lte' self.eNB_instance = '' - self.eNBOptions = '' - self.rruOptions = '' - self.rruLogFile = '' + self.eNB_serverId = '' + self.eNBLogFiles = ['', '', ''] + self.eNBOptions = ['', '', ''] self.ping_args = '' self.ping_packetloss_threshold = '' self.iperf_args = '' @@ -315,52 +325,162 @@ class SSHConnection(): sys.exit('SCP failed') def BuildeNB(self): - if self.eNBIPAddress == '' or self.eNBRepository == '' or self.eNBBranch == '' or self.eNBUserName == '' or self.eNBPassword == '' or self.eNBSourceCodePath == '': + if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '': Usage() sys.exit('Insufficient Parameter') - self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) - result = re.search('--gNB', self.Build_eNB_args) + if self.eNB_serverId == '0': + lIpAddr = self.eNBIPAddress + lUserName = self.eNBUserName + lPassWord = self.eNBPassword + lSourcePath = self.eNBSourceCodePath + elif self.eNB_serverId == '1': + lIpAddr = self.eNB1IPAddress + lUserName = self.eNB1UserName + lPassWord = self.eNB1Password + lSourcePath = self.eNB1SourceCodePath + elif self.eNB_serverId == '2': + lIpAddr = self.eNB2IPAddress + lUserName = self.eNB2UserName + lPassWord = self.eNB2Password + lSourcePath = self.eNB2SourceCodePath + if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '': + Usage() + sys.exit('Insufficient Parameter') + self.open(lIpAddr, lUserName, lPassWord) + result = re.search('--gNB', self.Build_eNB_args) if result is not None: self.air_interface = 'nr' nodeB_prefix = 'g' else: self.air_interface = 'lte' nodeB_prefix = 'e' - self.command('mkdir -p ' + self.eNBSourceCodePath, '\$', 5) - self.command('cd ' + self.eNBSourceCodePath, '\$', 5) - self.command('if [ ! -e .git ]; then stdbuf -o0 git clone ' + self.eNBRepository + ' .; else stdbuf -o0 git fetch; fi', '\$', 600) + self.command('mkdir -p ' + lSourcePath, '\$', 5) + self.command('cd ' + lSourcePath, '\$', 5) + self.command('if [ ! -e .git ]; then stdbuf -o0 git clone ' + self.ranRepository + ' .; else stdbuf -o0 git fetch; fi', '\$', 600) # Raphael: here add a check if git clone or git fetch went smoothly self.command('git config user.email "jenkins@openairinterface.org"', '\$', 5) self.command('git config user.name "OAI Jenkins"', '\$', 5) - self.command('echo ' + self.eNBPassword + ' | sudo -S git clean -x -d -ff', '\$', 30) + # Checking the BUILD INFO file + if not self.backgroundBuild: + self.command('ls *.txt', '\$', 5) + result = re.search('LAST_BUILD_INFO', str(self.ssh.before)) + if result is not None: + mismatch = False + self.command('grep SRC_COMMIT LAST_BUILD_INFO.txt', '\$', 2) + result = re.search(self.ranCommitID, str(self.ssh.before)) + if result is None: + mismatch = True + self.command('grep MERGED_W_TGT_BRANCH LAST_BUILD_INFO.txt', '\$', 2) + if (self.ranAllowMerge): + result = re.search('YES', str(self.ssh.before)) + if result is None: + mismatch = True + self.command('grep TGT_BRANCH LAST_BUILD_INFO.txt', '\$', 2) + if self.ranTargetBranch == '': + result = re.search('develop', str(self.ssh.before)) + else: + result = re.search(self.ranTargetBranch, str(self.ssh.before)) + if result is None: + mismatch = True + else: + result = re.search('NO', str(self.ssh.before)) + if result is None: + mismatch = True + if not mismatch: + self.close() + self.CreateHtmlTestRow(self.Build_eNB_args, 'OK', ALL_PROCESSES_OK) + return + self.command('echo ' + lPassWord + ' | sudo -S git clean -x -d -ff', '\$', 30) # if the commit ID is provided use it to point to it - if self.eNBCommitID != '': - self.command('git checkout -f ' + self.eNBCommitID, '\$', 5) + if self.ranCommitID != '': + self.command('git checkout -f ' + self.ranCommitID, '\$', 5) # if the branch is not develop, then it is a merge request and we need to do # the potential merge. Note that merge conflicts should already been checked earlier - if (self.eNB_AllowMerge): - if self.eNBTargetBranch == '': - if (self.eNBBranch != 'develop') and (self.eNBBranch != 'origin/develop'): + if (self.ranAllowMerge): + if self.ranTargetBranch == '': + if (self.ranBranch != 'develop') and (self.ranBranch != 'origin/develop'): self.command('git merge --ff origin/develop -m "Temporary merge for CI"', '\$', 5) else: - logging.debug('Merging with the target branch: ' + self.eNBTargetBranch) - self.command('git merge --ff origin/' + self.eNBTargetBranch + ' -m "Temporary merge for CI"', '\$', 5) + logging.debug('Merging with the target branch: ' + self.ranTargetBranch) + self.command('git merge --ff origin/' + self.ranTargetBranch + ' -m "Temporary merge for CI"', '\$', 5) self.command('source oaienv', '\$', 5) self.command('cd cmake_targets', '\$', 5) self.command('mkdir -p log', '\$', 5) self.command('chmod 777 log', '\$', 5) # no need to remove in log (git clean did the trick) - self.command('stdbuf -o0 ./build_oai ' + self.Build_eNB_args + ' 2>&1 | stdbuf -o0 tee compile_oai_enb.log', 'Bypassing the Tests|build have failed', 600) - self.command('ls ran_build/build', '\$', 3) - self.command('ls ran_build/build', '\$', 3) + if self.backgroundBuild: + self.command('echo "./build_oai ' + self.Build_eNB_args + '" > ./my-lte-softmodem-build.sh', '\$', 5) + self.command('chmod 775 ./my-lte-softmodem-build.sh', '\$', 5) + self.command('echo ' + lPassWord + ' | sudo -S -E daemon --inherit --unsafe --name=build_enb_daemon --chdir=' + lSourcePath + '/cmake_targets -o ' + lSourcePath + '/cmake_targets/compile_oai_enb.log ./my-lte-softmodem-build.sh', '\$', 5) + self.close() + self.CreateHtmlTestRow(self.Build_eNB_args, 'OK', ALL_PROCESSES_OK) + self.backgroundBuildTestId[int(self.eNB_instance)] = self.testCase_id + return + self.command('stdbuf -o0 ./build_oai ' + self.Build_eNB_args + ' 2>&1 | stdbuf -o0 tee compile_oai_enb.log', 'Bypassing the Tests|build have failed', 1500) + self.checkBuildeNB(lIpAddr, lUserName, lPassWord, lSourcePath, self.testCase_id) + + def WaitBuildeNBisFinished(self): + if self.eNB_serverId == '0': + lIpAddr = self.eNBIPAddress + lUserName = self.eNBUserName + lPassWord = self.eNBPassword + lSourcePath = self.eNBSourceCodePath + elif self.eNB_serverId == '1': + lIpAddr = self.eNB1IPAddress + lUserName = self.eNB1UserName + lPassWord = self.eNB1Password + lSourcePath = self.eNB1SourceCodePath + elif self.eNB_serverId == '2': + lIpAddr = self.eNB2IPAddress + lUserName = self.eNB2UserName + lPassWord = self.eNB2Password + lSourcePath = self.eNB2SourceCodePath + if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '': + Usage() + sys.exit('Insufficient Parameter') + self.open(lIpAddr, lUserName, lPassWord) + count = 40 + buildOAIprocess = True + while (count > 0) and buildOAIprocess: + self.command('ps aux | grep --color=never build_ | grep -v grep', '\$', 3) + result = re.search('build_oai', str(self.ssh.before)) + if result is None: + buildOAIprocess = False + else: + count -= 1 + time.sleep(30) + self.checkBuildeNB(lIpAddr, lUserName, lPassWord, lSourcePath, self.backgroundBuildTestId[int(self.eNB_instance)]) + + def checkBuildeNB(self, lIpAddr, lUserName, lPassWord, lSourcePath, testcaseId): + self.command('cd ' + lSourcePath + '/cmake_targets', '\$', 3) + self.command('ls lte_build_oai/build', '\$', 3) + self.command('ls lte_build_oai/build', '\$', 3) buildStatus = True result = re.search(self.air_interface + '-softmodem', str(self.ssh.before)) if result is None: buildStatus = False - self.command('mkdir -p build_log_' + self.testCase_id, '\$', 5) - self.command('mv log/* ' + 'build_log_' + self.testCase_id, '\$', 5) - self.command('mv compile_oai_enb.log ' + 'build_log_' + self.testCase_id, '\$', 5) - self.close() + self.command('mkdir -p build_log_' + testcaseId, '\$', 5) + self.command('mv log/* ' + 'build_log_' + testcaseId, '\$', 5) + self.command('mv compile_oai_enb.log ' + 'build_log_' + testcaseId, '\$', 5) + if self.eNB_serverId != '0': + self.command('cd cmake_targets', '\$', 5) + self.command('if [ -e tmp_build' + testcaseId + '.zip ]; then rm -f tmp_build' + testcaseId + '.zip; fi', '\$', 5) + self.command('zip -r -qq tmp_build' + testcaseId + '.zip build_log_' + testcaseId, '\$', 5) + self.close() + if (os.path.isfile('./tmp_build' + testcaseId + '.zip')): + os.remove('./tmp_build' + testcaseId + '.zip') + self.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/tmp_build' + testcaseId + '.zip', '.') + if (os.path.isfile('./tmp_build' + testcaseId + '.zip')): + self.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './tmp_build' + testcaseId + '.zip', self.eNBSourceCodePath + '/cmake_targets/.') + os.remove('./tmp_build' + testcaseId + '.zip') + self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) + self.command('cd ' + self.eNBSourceCodePath + '/cmake_targets', '\$', 5) + self.command('unzip -qq -DD tmp_build' + testcaseId + '.zip', '\$', 5) + self.command('rm -f tmp_build' + testcaseId + '.zip', '\$', 5) + self.close() + else: + self.close() + if buildStatus: logging.info('\u001B[1m Building OAI ' + nodeB_prefix + 'NB Pass\u001B[0m') self.CreateHtmlTestRow(self.Build_eNB_args, 'OK', ALL_PROCESSES_OK) @@ -371,7 +491,7 @@ class SSHConnection(): sys.exit(1) def BuildOAIUE(self): - if self.UEIPAddress == '' or self.eNBRepository == '' or self.eNBBranch == '' or self.UEUserName == '' or self.UEPassword == '' or self.UESourceCodePath == '': + if self.UEIPAddress == '' or self.ranRepository == '' or self.ranBranch == '' or self.UEUserName == '' or self.UEPassword == '' or self.UESourceCodePath == '': Usage() sys.exit('Insufficient Parameter') self.open(self.UEIPAddress, self.UEUserName, self.UEPassword) @@ -384,7 +504,7 @@ class SSHConnection(): ue_prefix = '' self.command('mkdir -p ' + self.UESourceCodePath, '\$', 5) self.command('cd ' + self.UESourceCodePath, '\$', 5) - self.command('if [ ! -e .git ]; then stdbuf -o0 git clone ' + self.eNBRepository + ' .; else stdbuf -o0 git fetch; fi', '\$', 600) + self.command('if [ ! -e .git ]; then stdbuf -o0 git clone ' + self.ranRepository + ' .; else stdbuf -o0 git fetch; fi', '\$', 600) # here add a check if git clone or git fetch went smoothly self.command('git config user.email "jenkins@openairinterface.org"', '\$', 5) self.command('git config user.name "OAI Jenkins"', '\$', 5) @@ -392,17 +512,17 @@ class SSHConnection(): pass self.command('echo ' + self.UEPassword + ' | sudo -S git clean -x -d -ff', '\$', 30) # if the commit ID is provided use it to point to it - if self.eNBCommitID != '': - self.command('git checkout -f ' + self.eNBCommitID, '\$', 5) + if self.ranCommitID != '': + self.command('git checkout -f ' + self.ranCommitID, '\$', 5) # if the branch is not develop, then it is a merge request and we need to do # the potential merge. Note that merge conflicts should already been checked earlier - if (self.eNB_AllowMerge): - if self.eNBTargetBranch == '': - if (self.eNBBranch != 'develop') and (self.eNBBranch != 'origin/develop'): + if (self.ranAllowMerge): + if self.ranTargetBranch == '': + if (self.ranBranch != 'develop') and (self.ranBranch != 'origin/develop'): self.command('git merge --ff origin/develop -m "Temporary merge for CI"', '\$', 5) else: - logging.debug('Merging with the target branch: ' + self.eNBTargetBranch) - self.command('git merge --ff origin/' + self.eNBTargetBranch + ' -m "Temporary merge for CI"', '\$', 5) + logging.debug('Merging with the target branch: ' + self.ranTargetBranch) + self.command('git merge --ff origin/' + self.ranTargetBranch + ' -m "Temporary merge for CI"', '\$', 5) self.command('source oaienv', '\$', 5) self.command('cd cmake_targets', '\$', 5) self.command('mkdir -p log', '\$', 5) @@ -519,7 +639,22 @@ class SSHConnection(): self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) def InitializeeNB(self): - if self.eNBIPAddress == '' or self.eNBUserName == '' or self.eNBPassword == '' or self.eNBSourceCodePath == '': + if self.eNB_serverId == '0': + lIpAddr = self.eNBIPAddress + lUserName = self.eNBUserName + lPassWord = self.eNBPassword + lSourcePath = self.eNBSourceCodePath + elif self.eNB_serverId == '1': + lIpAddr = self.eNB1IPAddress + lUserName = self.eNB1UserName + lPassWord = self.eNB1Password + lSourcePath = self.eNB1SourceCodePath + elif self.eNB_serverId == '2': + lIpAddr = self.eNB2IPAddress + lUserName = self.eNB2UserName + lPassWord = self.eNB2Password + lSourcePath = self.eNB2SourceCodePath + if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '': Usage() sys.exit('Insufficient Parameter') check_eNB = False @@ -540,10 +675,10 @@ class SSHConnection(): logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + '\u001B[0m') self.EPC_PcapFileName = 'enb_' + self.testCase_id + '_s1log.pcap' self.command('echo ' + self.EPCPassword + ' | sudo -S rm -f /tmp/' + self.EPC_PcapFileName, '\$', 5) - self.command('echo $USER; nohup sudo tshark -f "host ' + self.eNBIPAddress +'" -i ' + eth_interface + ' -w /tmp/' + self.EPC_PcapFileName + ' > /tmp/tshark.log 2>&1 &', self.EPCUserName, 5) + self.command('echo $USER; nohup sudo tshark -f "host ' + lIpAddr +'" -i ' + eth_interface + ' -w /tmp/' + self.EPC_PcapFileName + ' > /tmp/tshark.log 2>&1 &', self.EPCUserName, 5) self.close() - self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) - self.command('cd ' + self.eNBSourceCodePath, '\$', 5) + self.open(lIpAddr, lUserName, lPassWord) + self.command('cd ' + lSourcePath, '\$', 5) # Initialize_eNB_args usually start with -O and followed by the location in repository full_config_file = self.Initialize_eNB_args.replace('-O ','') extra_options = '' @@ -556,31 +691,34 @@ class SSHConnection(): logging.debug('\u001B[1m Compiling and launching T Tracer\u001B[0m') self.command('cd common/utils/T/tracer', '\$', 5) self.command('make', '\$', 10) - self.command('echo $USER; nohup ./record -d ../T_messages.txt -o ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + self.testCase_id + '_record.raw -ON -off VCD -off HEAVY -off LEGACY_GROUP_TRACE -off LEGACY_GROUP_DEBUG > ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + self.testCase_id + '_record.log 2>&1 &', self.eNBUserName, 5) - self.command('cd ' + self.eNBSourceCodePath, '\$', 5) + self.command('echo $USER; nohup ./record -d ../T_messages.txt -o ' + lSourcePath + '/cmake_targets/enb_' + self.testCase_id + '_record.raw -ON -off VCD -off HEAVY -off LEGACY_GROUP_TRACE -off LEGACY_GROUP_DEBUG > ' + lSourcePath + '/cmake_targets/enb_' + self.testCase_id + '_record.log 2>&1 &', lUserName, 5) + self.command('cd ' + lSourcePath, '\$', 5) full_config_file = full_config_file[:extIdx + 5] config_path, config_file = os.path.split(full_config_file) else: sys.exit('Insufficient Parameter') ci_full_config_file = config_path + '/ci-' + config_file rruCheck = False - result = re.search('rru|du.band', str(config_file)) + result = re.search('^rru|^rcc|^du.band', str(config_file)) if result is not None: rruCheck = True # do not reset board twice in IF4.5 case - result = re.search('rru|enb|du.band', str(config_file)) + result = re.search('^rru|^enb|^du.band', str(config_file)) if result is not None: - self.command('echo ' + self.eNBPassword + ' | sudo -S uhd_find_devices', '\$', 30) + self.command('echo ' + lPassWord + ' | sudo -S uhd_find_devices', '\$', 10) result = re.search('type: b200', str(self.ssh.before)) if result is not None: logging.debug('Found a B2xx device --> resetting it') - self.command('echo ' + self.eNBPassword + ' | sudo -S b2xx_fx3_utils --reset-device', '\$', 10) + self.command('echo ' + lPassWord + ' | sudo -S b2xx_fx3_utils --reset-device', '\$', 10) # Reloading FGPA bin firmware - self.command('echo ' + self.eNBPassword + ' | sudo -S uhd_find_devices', '\$', 30) + self.command('echo ' + lPassWord + ' | sudo -S uhd_find_devices', '\$', 15) # Make a copy and adapt to EPC / eNB IP addresses self.command('cp ' + full_config_file + ' ' + ci_full_config_file, '\$', 5) self.command('sed -i -e \'s/CI_MME_IP_ADDR/' + self.EPCIPAddress + '/\' ' + ci_full_config_file, '\$', 2); - self.command('sed -i -e \'s/CI_ENB_IP_ADDR/' + self.eNBIPAddress + '/\' ' + ci_full_config_file, '\$', 2); + self.command('sed -i -e \'s/CI_ENB_IP_ADDR/' + lIpAddr + '/\' ' + ci_full_config_file, '\$', 2); + self.command('sed -i -e \'s/CI_RCC_IP_ADDR/' + self.eNBIPAddress + '/\' ' + ci_full_config_file, '\$', 2); + self.command('sed -i -e \'s/CI_RRU1_IP_ADDR/' + self.eNB1IPAddress + '/\' ' + ci_full_config_file, '\$', 2); + self.command('sed -i -e \'s/CI_RRU2_IP_ADDR/' + self.eNB2IPAddress + '/\' ' + ci_full_config_file, '\$', 2); if self.flexranCtrlInstalled and self.flexranCtrlStarted: self.command('sed -i -e \'s/FLEXRAN_ENABLED.*;/FLEXRAN_ENABLED = "yes";/\' ' + ci_full_config_file, '\$', 2); else: @@ -588,18 +726,13 @@ class SSHConnection(): # Launch eNB with the modified config file self.command('source oaienv', '\$', 5) self.command('cd cmake_targets', '\$', 5) - self.command('echo "ulimit -c unlimited && ./ran_build/build/' + self.air_interface + '-softmodem -O ' + self.eNBSourceCodePath + '/' + ci_full_config_file + extra_options + '" > ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh ', '\$', 5) + self.command('echo "ulimit -c unlimited && ./ran_build/build/' + self.air_interface + '-softmodem -O ' + lSourcePath + '/' + ci_full_config_file + extra_options + '" > ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5) self.command('chmod 775 ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5) - self.command('echo ' + self.eNBPassword + ' | sudo -S rm -Rf enb_' + self.testCase_id + '.log', '\$', 5) - self.command('echo ' + self.eNBPassword + ' | sudo -S -E daemon --inherit --unsafe --name=enb' + str(self.eNB_instance) + '_daemon --chdir=' + self.eNBSourceCodePath + '/cmake_targets -o ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + self.testCase_id + '.log ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5) - result = re.search('rcc|enb|cu.band', str(config_file)) - if result is not None: - self.eNBLogFile = 'enb_' + self.testCase_id + '.log' - if extra_options != '': - self.eNBOptions = extra_options - result = re.search('rru|du.band', str(config_file)) - if result is not None: - self.rruLogFile = 'enb_' + self.testCase_id + '.log' + self.command('echo ' + lPassWord + ' | sudo -S rm -Rf enb_' + self.testCase_id + '.log', '\$', 5) + self.command('echo ' + lPassWord + ' | sudo -S -E daemon --inherit --unsafe --name=enb' + str(self.eNB_instance) + '_daemon --chdir=' + lSourcePath + '/cmake_targets -o ' + lSourcePath + '/cmake_targets/enb_' + self.testCase_id + '.log ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5) + self.eNBLogFiles[int(self.eNB_instance)] = 'enb_' + self.testCase_id + '.log' + if extra_options != '': + self.eNBOptions[int(self.eNB_instance)] = extra_options time.sleep(6) doLoop = True loopCounter = 10 @@ -629,7 +762,7 @@ class SSHConnection(): if self.EPC_PcapFileName != '': copyin_res = self.copyin(self.EPCIPAddress, self.EPCUserName, self.EPCPassword, '/tmp/' + self.EPC_PcapFileName, '.') if (copyin_res == 0): - self.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, self.EPC_PcapFileName, self.eNBSourceCodePath + '/cmake_targets/.') + self.copyout(lIpAddr, lUserName, lPassWord, self.EPC_PcapFileName, lSourcePath + '/cmake_targets/.') sys.exit(1) else: self.command('stdbuf -o0 cat enb_' + self.testCase_id + '.log | egrep --text --color=never -i "wait|sync|Starting"', '\$', 4) @@ -641,8 +774,6 @@ class SSHConnection(): time.sleep(6) else: doLoop = False - if rruCheck and extra_options != '': - self.rruOptions = extra_options self.CreateHtmlTestRow('-O ' + config_file + extra_options, 'OK', ALL_PROCESSES_OK) logging.debug('\u001B[1m Initialize eNB Completed\u001B[0m') time.sleep(10) @@ -829,85 +960,6 @@ class SSHConnection(): self.CreateHtmlTabFooter(False) sys.exit(1) - def InitializeOAIeNB(self): - if self.eNBIPAddress == '' or self.eNBUserName == '' or self.eNBPassword == '' or self.eNBSourceCodePath == '': - Usage() - sys.exit('Insufficient Parameter') - #initialize_OAI_eNB_flag = True - #pStatus = self.CheckOAIeNBProcessExist(initialize_OAI_eNB_flag) - #if (pStatus < 0): - # self.CreateHtmlTestRow(self.Initialize_OAI_eNB_args, 'KO', pStatus) - # self.CreateHtmlTabFooter(False) - # sys.exit(1) - self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) - self.command('cd ' + self.eNBSourceCodePath, '\$', 5) - if self.air_interface == 'lte': - nodeB_prefix = 'e' - else: - nodeB_prefix = 'g' - # Initialize_OAI_eNB_args usually start with -C and followed by the location in repository - #full_config_file = self.Initialize_OAI_eNB_args.replace('-O ','') - #extIdx = full_config_file.find('.conf') - #if (extIdx > 0): - # extra_options = full_config_file[extIdx + 5:] - # # if tracer options is on, compiling and running T Tracer - # result = re.search('T_stdout', str(extra_options)) - ## if result is not None: - # logging.debug('\u001B[1m Compiling and launching T Tracer\u001B[0m') - # self.command('cd common/utils/T/tracer', '\$', 5) - # self.command('make', '\$', 10) - # self.command('echo $USER; nohup ./record -d ../T_messages.txt -o ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + self.testCase_id + '_record.raw -ON -off VCD -off HEAVY -off LEGACY_GROUP_TRACE -off LEGACY_GROUP_DEBUG > ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + self.testCase_id + '_record.log 2>&1 &', self.eNBUserName, 5) - # self.command('cd ' + self.eNBSourceCodePath, '\$', 5) - # full_config_file = full_config_file[:extIdx + 5] - # config_path, config_file = os.path.split(full_config_file) - #ci_full_config_file = config_path + '/ci-' + config_file - #rruCheck = False - #result = re.search('rru', str(config_file)) - #if result is not None: - # rruCheck = True - ## Make a copy and adapt to EPC / eNB IP addresses - #self.command('cp ' + full_config_file + ' ' + ci_full_config_file, '\$', 5) - #self.command('sed -i -e \'s/CI_eNB_IP_ADDR/' + self.eNBIPAddress + '/\' ' + ci_full_config_file, '\$', 2); - # Launch eNB with the modified config file - self.command('source oaienv', '\$', 5) - self.command('cd cmake_targets/ran_build/build', '\$', 5) - self.eNBLogFile = 'enb_' + self.testCase_id + '.log' - self.command('echo "ulimit -c unlimited && ./' + self.air_interface + '-softmodem ' + self.Initialize_OAI_eNB_args + '" > ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5) - self.command('chmod 775 ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5) - self.command('echo ' + self.eNBPassword + ' | sudo -S rm -Rf ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + self.testCase_id + '.log', '\$', 5) - #use nohup instead of daemon - self.command('echo $USER; nohup sudo ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh' + ' > ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + self.testCase_id + '.log' + ' 2>&1 &', self.eNBUserName, 5) - #self.command('echo ' + self.eNBPassword + ' | sudo -S -E daemon --inherit --unsafe --name=enb' + str(self.eNB_instance) + '_daemon --chdir=' + self.eNBSourceCodePath + '/cmake_targets/ran_build/build -o ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + self.testCase_id + '.log ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5) - time.sleep(6) - self.command('cd ../..', '\$', 5) - doLoop = True - loopCounter = 10 - while (doLoop): - loopCounter = loopCounter - 1 - if (loopCounter == 0): - # In case of T tracer recording, we may need to kill it - #result = re.search('T_stdout', str(self.Initialize_OAI_eNB_args)) - #if result is not None: - # self.command('killall --signal SIGKILL record', '\$', 5) - self.close() - doLoop = False - logging.error('\u001B[1;37;41m ' + nodeB_prefix + 'NB logging system did not show got sync! \u001B[0m') - self.CreateHtmlTestRow(self.Initialize_OAI_eNB_args, 'KO', ALL_PROCESSES_OK, 'OAI eNB') - self.CreateHtmlTabFooter(False) - ## In case of T tracer recording, we need to kill tshark on EPC side - #result = re.search('T_stdout', str(self.Initialize_OAI_eNB_args)) - #if result is not None: - # self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) - # logging.debug('\u001B[1m Stopping tshark \u001B[0m') - # self.command('echo ' + self.EPCPassword + ' | sudo -S killall --signal SIGKILL tshark', '\$', 5) - # self.close() - # time.sleep(1) - # pcap_log_file = 'enb_' + self.testCase_id + '_s1log.pcap' - # copyin_res = self.copyin(self.EPCIPAddress, self.EPCUserName, self.EPCPassword, '/tmp/' + pcap_log_file, '.') - # if (copyin_res == 0): - # self.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, pcap_log_file, self.eNBSourceCodePath + '/cmake_targets/.') - sys.exit(1) - def checkDevTTYisUnlocked(self): self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) count = 0 @@ -2503,13 +2555,13 @@ class SSHConnection(): if (status < 0): result = status if result == ENB_PROCESS_FAILED: - fileCheck = re.search('enb_', str(self.eNBLogFile)) + fileCheck = re.search('enb_', str(self.eNBLogFiles[0])) if fileCheck is not None: - self.copyin(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, self.eNBSourceCodePath + '/cmake_targets/' + self.eNBLogFile, '.') - logStatus = self.AnalyzeLogFile_eNB(self.eNBLogFile) + self.copyin(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, self.eNBSourceCodePath + '/cmake_targets/' + self.eNBLogFiles[0], '.') + logStatus = self.AnalyzeLogFile_eNB(self.eNBLogFiles[0]) if logStatus < 0: result = logStatus - self.eNBLogFile = '' + self.eNBLogFiles[0] = '' if self.flexranCtrlInstalled and self.flexranCtrlStarted: self.TerminateFlexranCtrl() return result @@ -2647,17 +2699,20 @@ class SSHConnection(): cdrxActivationMessageCount = 0 dropNotEnoughRBs = 0 self.htmleNBFailureMsg = '' + isRRU = False + isSlave = False + slaveReceivesFrameResyncCmd = False for line in enb_log_file.readlines(): - if self.rruOptions != '': - res1 = re.search('max_rxgain (?P[0-9]+)', self.rruOptions) + if self.eNBOptions[int(self.eNB_instance)] != '': + res1 = re.search('max_rxgain (?P[0-9]+)', self.eNBOptions[int(self.eNB_instance)]) res2 = re.search('max_rxgain (?P[0-9]+)', str(line)) if res1 is not None and res2 is not None: requested_option = int(res1.group('requested_option')) applied_option = int(res2.group('applied_option')) if requested_option == applied_option: - self.htmleNBFailureMsg += ' Command line option(s) correctly applied ' + self.rruOptions + '\n\n' + self.htmleNBFailureMsg += ' Command line option(s) correctly applied ' + self.eNBOptions[int(self.eNB_instance)] + '\n\n' else: - self.htmleNBFailureMsg += ' Command line option(s) NOT applied ' + self.rruOptions + '\n\n' + self.htmleNBFailureMsg += ' Command line option(s) NOT applied ' + self.eNBOptions[int(self.eNB_instance)] + '\n\n' result = re.search('Exiting OAI softmodem', str(line)) if result is not None: exitSignalReceived = True @@ -2679,6 +2734,17 @@ class SSHConnection(): if foundAssertion and (msgLine < 3): msgLine += 1 msgAssertion += str(line) + result = re.search('Setting function for RU', str(line)) + if result is not None: + isRRU = True + if isRRU: + result = re.search('RU 0 is_slave=yes', str(line)) + if result is not None: + isSlave = True + if isSlave: + result = re.search('Received RRU_frame_resynch command', str(line)) + if result is not None: + slaveReceivesFrameResyncCmd = True result = re.search('LTE_RRCConnectionSetupComplete from UE', str(line)) if result is not None: rrcSetupComplete += 1 @@ -2780,6 +2846,17 @@ class SSHConnection(): rachMsg = nodeB_prefix + 'NB cancelled ' + str(rachCanceledProcedure) + ' RA procedure(s)' logging.debug('\u001B[1;30;43m ' + rachMsg + ' \u001B[0m') self.htmleNBFailureMsg += rachMsg + '\n' + if isRRU: + if isSlave: + if slaveReceivesFrameResyncCmd: + rruMsg = 'Slave RRU received the RRU_frame_resynch command from RAU' + logging.debug('\u001B[1;30;43m ' + rruMsg + ' \u001B[0m') + self.htmleNBFailureMsg += rruMsg + '\n' + else: + rruMsg = 'Slave RRU DID NOT receive the RRU_frame_resynch command from RAU' + logging.debug('\u001B[1;37;41m ' + rruMsg + ' \u001B[0m') + self.htmleNBFailureMsg += rruMsg + '\n' + return ENB_PROCESS_SLAVE_RRU_NOT_SYNCED if foundSegFault: logging.debug('\u001B[1;37;41m ' + nodeB_prefix + 'NB ended with a Segmentation Fault! \u001B[0m') return ENB_PROCESS_SEG_FAULT @@ -2997,8 +3074,26 @@ class SSHConnection(): return 0 def TerminateeNB(self): - self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) - self.command('cd ' + self.eNBSourceCodePath + '/cmake_targets', '\$', 5) + if self.eNB_serverId == '0': + lIpAddr = self.eNBIPAddress + lUserName = self.eNBUserName + lPassWord = self.eNBPassword + lSourcePath = self.eNBSourceCodePath + elif self.eNB_serverId == '1': + lIpAddr = self.eNB1IPAddress + lUserName = self.eNB1UserName + lPassWord = self.eNB1Password + lSourcePath = self.eNB1SourceCodePath + elif self.eNB_serverId == '2': + lIpAddr = self.eNB2IPAddress + lUserName = self.eNB2UserName + lPassWord = self.eNB2Password + lSourcePath = self.eNB2SourceCodePath + if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '': + Usage() + sys.exit('Insufficient Parameter') + self.open(lIpAddr, lUserName, lPassWord) + self.command('cd ' + lSourcePath + '/cmake_targets', '\$', 5) if self.air_interface == 'lte': nodeB_prefix = 'e' else: @@ -3006,13 +3101,14 @@ class SSHConnection(): self.command('stdbuf -o0 ps -aux | grep --color=never softmodem | grep -v grep', '\$', 5) result = re.search('-softmodem', str(self.ssh.before)) if result is not None: - self.command('echo ' + self.eNBPassword + ' | sudo -S daemon --name=enb' + str(self.eNB_instance) + '_daemon --stop', '\$', 5) - self.command('echo ' + self.eNBPassword + ' | sudo -S killall --signal SIGINT -r .*-softmodem || true', '\$', 5) + self.command('echo ' + lPassWord + ' | sudo -S daemon --name=enb' + str(self.eNB_instance) + '_daemon --stop', '\$', 5) + self.command('echo ' + lPassWord + ' | sudo -S killall --signal SIGINT -r .*-softmodem || true', '\$', 5) time.sleep(5) self.command('stdbuf -o0 ps -aux | grep --color=never softmodem | grep -v grep', '\$', 5) result = re.search('-softmodem', str(self.ssh.before)) if result is not None: - self.command('echo ' + self.eNBPassword + ' | sudo -S killall --signal SIGKILL -r .*-softmodem || true', '\$', 5) + self.command('echo ' + lPassWord + ' | sudo -S killall --signal SIGKILL -r .*-softmodem || true', '\$', 5) + time.sleep(2) self.command('rm -f my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5) self.close() # If tracer options is on, stopping tshark on EPC side @@ -3025,44 +3121,40 @@ class SSHConnection(): if self.EPC_PcapFileName != '': self.command('echo ' + self.EPCPassword + ' | sudo -S chmod 666 /tmp/' + self.EPC_PcapFileName, '\$', 5) self.copyin(self.EPCIPAddress, self.EPCUserName, self.EPCPassword, '/tmp/' + self.EPC_PcapFileName, '.') - self.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, self.EPC_PcapFileName, self.eNBSourceCodePath + '/cmake_targets/.') + self.copyout(lIpAddr, lUserName, lPassWord, self.EPC_PcapFileName, lSourcePath + '/cmake_targets/.') self.close() logging.debug('\u001B[1m Replaying RAW record file\u001B[0m') - self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) - self.command('cd ' + self.eNBSourceCodePath + '/common/utils/T/tracer/', '\$', 5) - raw_record_file = self.eNBLogFile.replace('.log', '_record.raw') - replay_log_file = self.eNBLogFile.replace('.log', '_replay.log') - extracted_txt_file = self.eNBLogFile.replace('.log', '_extracted_messages.txt') - extracted_log_file = self.eNBLogFile.replace('.log', '_extracted_messages.log') - self.command('./extract_config -i ' + self.eNBSourceCodePath + '/cmake_targets/' + raw_record_file + ' > ' + self.eNBSourceCodePath + '/cmake_targets/' + extracted_txt_file, '\$', 5) - self.command('echo $USER; nohup ./replay -i ' + self.eNBSourceCodePath + '/cmake_targets/' + raw_record_file + ' > ' + self.eNBSourceCodePath + '/cmake_targets/' + replay_log_file + ' 2>&1 &', self.eNBUserName, 5) - self.command('./textlog -d ' + self.eNBSourceCodePath + '/cmake_targets/' + extracted_txt_file + ' -no-gui -ON -full > ' + self.eNBSourceCodePath + '/cmake_targets/' + extracted_log_file, '\$', 5) + self.open(lIpAddr, lUserName, lPassWord) + self.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') + self.command('./extract_config -i ' + lSourcePath + '/cmake_targets/' + raw_record_file + ' > ' + lSourcePath + '/cmake_targets/' + extracted_txt_file, '\$', 5) + self.command('echo $USER; nohup ./replay -i ' + lSourcePath + '/cmake_targets/' + raw_record_file + ' > ' + lSourcePath + '/cmake_targets/' + replay_log_file + ' 2>&1 &', lUserName, 5) + self.command('./textlog -d ' + lSourcePath + '/cmake_targets/' + extracted_txt_file + ' -no-gui -ON -full > ' + lSourcePath + '/cmake_targets/' + extracted_log_file, '\$', 5) self.close() - self.copyin(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, self.eNBSourceCodePath + '/cmake_targets/' + extracted_log_file, '.') + self.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/' + extracted_log_file, '.') logging.debug('\u001B[1m Analyzing eNB replay logfile \u001B[0m') logStatus = self.AnalyzeLogFile_eNB(extracted_log_file) self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) - self.eNBLogFile = '' + self.eNBLogFiles[int(self.eNB_instance)] = '' else: - result = re.search('enb_', str(self.eNBLogFile)) analyzeFile = False - if result is not None: + if self.eNBLogFiles[int(self.eNB_instance)] != '': analyzeFile = True - fileToAnalyze = str(self.eNBLogFile) - self.eNBLogFile = '' - else: - result = re.search('enb_', str(self.rruLogFile)) - if result is not None: - analyzeFile = True - fileToAnalyze = str(self.rruLogFile) - self.rruLogFile = '' + fileToAnalyze = self.eNBLogFiles[int(self.eNB_instance)] + self.eNBLogFiles[int(self.eNB_instance)] = '' if analyzeFile: - copyin_res = self.copyin(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, self.eNBSourceCodePath + '/cmake_targets/' + fileToAnalyze, '.') + copyin_res = self.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/' + fileToAnalyze, '.') if (copyin_res == -1): logging.debug('\u001B[1;37;41m Could not copy ' + nodeB_prefix + 'NB logfile to analyze it! \u001B[0m') - self.htmleNBFailureMsg = 'Could not copy ' + nodeB_prefix + 'NB logfile to analyze it!' + self.htmleNBFailureMsg = 'Could not copy ' + nodeB_prefix + 'NB logfile to analyze it!' self.CreateHtmlTestRow('N/A', 'KO', ENB_PROCESS_NOLOGFILE_TO_ANALYZE) return + if self.eNB_serverId != '0': + self.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './' + fileToAnalyze, self.eNBSourceCodePath + '/cmake_targets/') logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + fileToAnalyze) logStatus = self.AnalyzeLogFile_eNB(fileToAnalyze) if (logStatus < 0): @@ -3458,46 +3550,46 @@ class SSHConnection(): self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' GIT Repository \n') - self.htmlFile.write(' ' + self.eNBRepository + '\n') + self.htmlFile.write(' ' + self.ranRepository + '\n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' Job Trigger \n') - if (self.eNB_AllowMerge): + if (self.ranAllowMerge): self.htmlFile.write(' Merge-Request\n') else: self.htmlFile.write(' Push to Branch\n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') - if (self.eNB_AllowMerge): + if (self.ranAllowMerge): self.htmlFile.write(' Source Branch \n') else: self.htmlFile.write(' Branch\n') - self.htmlFile.write(' ' + self.eNBBranch + '\n') + self.htmlFile.write(' ' + self.ranBranch + '\n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') - if (self.eNB_AllowMerge): + if (self.ranAllowMerge): self.htmlFile.write(' Source Commit ID \n') else: self.htmlFile.write(' Commit ID \n') - self.htmlFile.write(' ' + self.eNBCommitID + '\n') + self.htmlFile.write(' ' + self.ranCommitID + '\n') self.htmlFile.write(' \n') - if self.eNB_AllowMerge != '': - commit_message = subprocess.check_output("git log -n1 --pretty=format:\"%s\" " + self.eNBCommitID, shell=True, universal_newlines=True) + if self.ranAllowMerge != '': + commit_message = subprocess.check_output("git log -n1 --pretty=format:\"%s\" " + self.ranCommitID, shell=True, universal_newlines=True) commit_message = commit_message.strip() self.htmlFile.write(' \n') - if (self.eNB_AllowMerge): + if (self.ranAllowMerge): self.htmlFile.write(' Source Commit Message \n') else: self.htmlFile.write(' Commit Message \n') self.htmlFile.write(' ' + commit_message + '\n') self.htmlFile.write(' \n') - if (self.eNB_AllowMerge): + if (self.ranAllowMerge): self.htmlFile.write(' \n') self.htmlFile.write(' Target Branch \n') - if (self.eNBTargetBranch == ''): + if (self.ranTargetBranch == ''): self.htmlFile.write(' develop\n') else: - self.htmlFile.write(' ' + self.eNBTargetBranch + '\n') + self.htmlFile.write(' ' + self.ranTargetBranch + '\n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') @@ -3651,6 +3743,8 @@ class SSHConnection(): self.htmlFile.write(' KO - ' + machine + ' process faced Real Time issue(s)\n') elif (processesStatus == ENB_PROCESS_NOLOGFILE_TO_ANALYZE) or (processesStatus == OAI_UE_PROCESS_NOLOGFILE_TO_ANALYZE): self.htmlFile.write(' OK?\n') + elif (processesStatus == ENB_PROCESS_SLAVE_RRU_NOT_SYNCED): + self.htmlFile.write(' KO - ' + machine + ' Slave RRU could not synch\n') elif (processesStatus == OAI_UE_PROCESS_COULD_NOT_SYNC): self.htmlFile.write(' KO - UE could not sync\n') elif (processesStatus == HSS_PROCESS_FAILED): @@ -3746,12 +3840,12 @@ def Usage(): print(' InitiateHtml, FinalizeHtml') print(' TerminateeNB, TerminateUE, TerminateHSS, TerminateMME, TerminateSPGW') print(' LogCollectBuild, LogCollecteNB, LogCollectHSS, LogCollectMME, LogCollectSPGW, LogCollectPing, LogCollectIperf') + print(' --eNBRepository=[eNB\'s Repository URL] or --ranRepository=[OAI RAN Repository URL]') + print(' --eNBBranch=[eNB\'s Branch Name] or --ranBranch=[OAI RAN Repository Branch') + print(' --eNBCommitID=[eNB\'s Commit Number] or --ranCommitID=[OAI RAN Repository Commit SHA-1') + print(' --eNB_AllowMerge=[eNB\'s Allow Merge Request (with target branch)] or --ranAllowMerge=true/false') + print(' --eNBTargetBranch=[eNB\'s Target Branch in case of a Merge Request] or --ranTargetBranch=[Target Branch]') print(' --eNBIPAddress=[eNB\'s IP Address]') - print(' --eNBRepository=[eNB\'s Repository URL]') - print(' --eNBBranch=[eNB\'s Branch Name]') - print(' --eNBCommitID=[eNB\'s Commit Number]') - print(' --eNB_AllowMerge=[eNB\'s Allow Merge Request (with target branch)]') - print(' --eNBTargetBranch=[eNB\'s Target Branch in case of a Merge Request]') print(' --eNBUserName=[eNB\'s Login User Name]') print(' --eNBPassword=[eNB\'s Login Password]') print(' --eNBSourceCodePath=[eNB\'s Source Code Path]') @@ -3767,7 +3861,7 @@ def Usage(): print('------------------------------------------------------------') def CheckClassValidity(action,id): - if action != 'Build_eNB' and action != 'Initialize_eNB' and action != 'Terminate_eNB' and action != 'Initialize_UE' and action != 'Terminate_UE' and action != 'Attach_UE' and action != 'Detach_UE' and action != 'Build_OAI_UE' and action != 'Initialize_OAI_UE' and action != 'Terminate_OAI_UE' and action != 'Initialize_OAI_eNB' and action != 'DataDisable_UE' and action != 'DataEnable_UE' and action != 'CheckStatusUE' and action != 'Ping' and action != 'Iperf' and action != 'Reboot_UE' and action != 'Initialize_FlexranCtrl' and action != 'Terminate_FlexranCtrl' and action != 'Initialize_HSS' and action != 'Terminate_HSS' and action != 'Initialize_MME' and action != 'Terminate_MME' and action != 'Initialize_SPGW' and action != 'Terminate_SPGW' and action != 'Initialize_CatM_module' and action != 'Terminate_CatM_module' and action != 'Attach_CatM_module' and action != 'Detach_CatM_module' and action != 'Ping_CatM_module' and action != 'IdleSleep': + if action != 'Build_eNB' and action != 'WaitEndBuild_eNB' and action != 'Initialize_eNB' and action != 'Terminate_eNB' and action != 'Initialize_UE' and action != 'Terminate_UE' and action != 'Attach_UE' and action != 'Detach_UE' and action != 'Build_OAI_UE' and action != 'Initialize_OAI_UE' and action != 'Terminate_OAI_UE' and action != 'DataDisable_UE' and action != 'DataEnable_UE' and action != 'CheckStatusUE' and action != 'Ping' and action != 'Iperf' and action != 'Reboot_UE' and action != 'Initialize_FlexranCtrl' and action != 'Terminate_FlexranCtrl' and action != 'Initialize_HSS' and action != 'Terminate_HSS' and action != 'Initialize_MME' and action != 'Terminate_MME' and action != 'Initialize_SPGW' and action != 'Terminate_SPGW' and action != 'Initialize_CatM_module' and action != 'Terminate_CatM_module' and action != 'Attach_CatM_module' and action != 'Detach_CatM_module' and action != 'Ping_CatM_module' and action != 'IdleSleep': logging.debug('ERROR: test-case ' + id + ' has wrong class ' + action) return False return True @@ -3775,12 +3869,38 @@ def CheckClassValidity(action,id): def GetParametersFromXML(action): if action == 'Build_eNB': SSH.Build_eNB_args = test.findtext('Build_eNB_args') + SSH.eNB_instance = test.findtext('eNB_instance') + if (SSH.eNB_instance is None): + SSH.eNB_instance = '0' + SSH.eNB_serverId = test.findtext('eNB_serverId') + if (SSH.eNB_serverId is None): + SSH.eNB_serverId = '0' + xmlBgBuildField = test.findtext('backgroundBuild') + if (xmlBgBuildField is None): + SSH.backgroundBuild = False + else: + if re.match('true', xmlBgBuildField, re.IGNORECASE): + SSH.backgroundBuild = True + else: + SSH.backgroundBuild = False + + if action == 'WaitEndBuild_eNB': + SSH.Build_eNB_args = test.findtext('Build_eNB_args') + SSH.eNB_instance = test.findtext('eNB_instance') + if (SSH.eNB_instance is None): + SSH.eNB_instance = '0' + SSH.eNB_serverId = test.findtext('eNB_serverId') + if (SSH.eNB_serverId is None): + SSH.eNB_serverId = '0' if action == 'Initialize_eNB': SSH.Initialize_eNB_args = test.findtext('Initialize_eNB_args') SSH.eNB_instance = test.findtext('eNB_instance') if (SSH.eNB_instance is None): SSH.eNB_instance = '0' + SSH.eNB_serverId = test.findtext('eNB_serverId') + if (SSH.eNB_serverId is None): + SSH.eNB_serverId = '0' SSH.air_interface = test.findtext('air_interface') if (SSH.air_interface is None): SSH.air_interface = 'lte' @@ -3791,6 +3911,9 @@ def GetParametersFromXML(action): SSH.eNB_instance = test.findtext('eNB_instance') if (SSH.eNB_instance is None): SSH.eNB_instance = '0' + SSH.eNB_serverId = test.findtext('eNB_serverId') + if (SSH.eNB_serverId is None): + SSH.eNB_serverId = '0' SSH.air_interface = test.findtext('air_interface') if (SSH.air_interface is None): SSH.air_interface = 'lte' @@ -3829,17 +3952,6 @@ def GetParametersFromXML(action): SSH.air_interface = 'lte' else: SSH.air_interface = SSH.air_interface.lower() - - if action == 'Initialize_OAI_eNB': - SSH.Initialize_OAI_eNB_args = test.findtext('Initialize_OAI_eNB_args') - SSH.UE_instance = test.findtext('eNB_instance') - if (SSH.eNB_instance is None): - SSH.eNB_instance = '0' - SSH.air_interface = test.findtext('air_interface') - if (SSH.air_interface is None): - SSH.air_interface = 'lte' - else: - SSH.air_interface = SSH.air_interface.lower() if action == 'Terminate_OAI_UE': SSH.eNB_instance = test.findtext('UE_instance') @@ -3898,35 +4010,78 @@ while len(argvs) > 1: elif re.match('^\-\-mode=(.+)$', myArgv, re.IGNORECASE): matchReg = re.match('^\-\-mode=(.+)$', myArgv, re.IGNORECASE) mode = matchReg.group(1) - elif re.match('^\-\-eNBIPAddress=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNBIPAddress=(.+)$', myArgv, re.IGNORECASE) - SSH.eNBIPAddress = matchReg.group(1) - elif re.match('^\-\-eNBRepository=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNBRepository=(.+)$', myArgv, re.IGNORECASE) - SSH.eNBRepository = matchReg.group(1) - elif re.match('^\-\-eNB_AllowMerge=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNB_AllowMerge=(.+)$', myArgv, re.IGNORECASE) + elif re.match('^\-\-eNBRepository=(.+)$|^\-\-ranRepository(.+)$', myArgv, re.IGNORECASE): + if re.match('^\-\-eNBRepository=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-eNBRepository=(.+)$', myArgv, re.IGNORECASE) + else: + matchReg = re.match('^\-\-ranRepository=(.+)$', myArgv, re.IGNORECASE) + SSH.ranRepository = matchReg.group(1) + elif re.match('^\-\-eNB_AllowMerge=(.+)$|^\-\-ranAllowMerge=(.+)$', myArgv, re.IGNORECASE): + if re.match('^\-\-eNB_AllowMerge=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-eNB_AllowMerge=(.+)$', myArgv, re.IGNORECASE) + else: + matchReg = re.match('^\-\-ranAllowMerge=(.+)$', myArgv, re.IGNORECASE) doMerge = matchReg.group(1) if ((doMerge == 'true') or (doMerge == 'True')): - SSH.eNB_AllowMerge = True - elif re.match('^\-\-eNBBranch=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNBBranch=(.+)$', myArgv, re.IGNORECASE) - SSH.eNBBranch = matchReg.group(1) - elif re.match('^\-\-eNBCommitID=(.*)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNBCommitID=(.*)$', myArgv, re.IGNORECASE) - SSH.eNBCommitID = matchReg.group(1) - elif re.match('^\-\-eNBTargetBranch=(.*)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNBTargetBranch=(.*)$', myArgv, re.IGNORECASE) - SSH.eNBTargetBranch = matchReg.group(1) - elif re.match('^\-\-eNBUserName=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNBUserName=(.+)$', myArgv, re.IGNORECASE) - SSH.eNBUserName = matchReg.group(1) - elif re.match('^\-\-eNBPassword=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNBPassword=(.+)$', myArgv, re.IGNORECASE) - SSH.eNBPassword = matchReg.group(1) - elif re.match('^\-\-eNBSourceCodePath=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNBSourceCodePath=(.+)$', myArgv, re.IGNORECASE) - SSH.eNBSourceCodePath = matchReg.group(1) + SSH.ranAllowMerge = True + elif re.match('^\-\-eNBBranch=(.+)$|^\-\-ranBranch=(.+)$', myArgv, re.IGNORECASE): + if re.match('^\-\-eNBBranch=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-eNBBranch=(.+)$', myArgv, re.IGNORECASE) + else: + matchReg = re.match('^\-\-ranBranch=(.+)$', myArgv, re.IGNORECASE) + SSH.ranBranch = matchReg.group(1) + elif re.match('^\-\-eNBCommitID=(.*)$|^\-\-ranCommitID=(.*)$', myArgv, re.IGNORECASE): + if re.match('^\-\-eNBCommitID=(.*)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-eNBCommitID=(.*)$', myArgv, re.IGNORECASE) + else: + matchReg = re.match('^\-\-ranCommitID=(.*)$', myArgv, re.IGNORECASE) + SSH.ranCommitID = matchReg.group(1) + elif re.match('^\-\-eNBTargetBranch=(.*)$|^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE): + if re.match('^\-\-eNBTargetBranch=(.*)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-eNBTargetBranch=(.*)$', myArgv, re.IGNORECASE) + else: + matchReg = re.match('^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE) + SSH.ranTargetBranch = matchReg.group(1) + elif re.match('^\-\-eNBIPAddress=(.+)$|^\-\-eNB[1-2]IPAddress=(.+)$', myArgv, re.IGNORECASE): + if re.match('^\-\-eNBIPAddress=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-eNBIPAddress=(.+)$', myArgv, re.IGNORECASE) + SSH.eNBIPAddress = matchReg.group(1) + elif re.match('^\-\-eNB1IPAddress=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-eNB1IPAddress=(.+)$', myArgv, re.IGNORECASE) + SSH.eNB1IPAddress = matchReg.group(1) + elif re.match('^\-\-eNB2IPAddress=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-eNB2IPAddress=(.+)$', myArgv, re.IGNORECASE) + SSH.eNB2IPAddress = matchReg.group(1) + elif re.match('^\-\-eNBUserName=(.+)$|^\-\-eNB[1-2]UserName=(.+)$', myArgv, re.IGNORECASE): + if re.match('^\-\-eNBUserName=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-eNBUserName=(.+)$', myArgv, re.IGNORECASE) + SSH.eNBUserName = matchReg.group(1) + elif re.match('^\-\-eNB1UserName=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-eNB1UserName=(.+)$', myArgv, re.IGNORECASE) + SSH.eNB1UserName = matchReg.group(1) + elif re.match('^\-\-eNB2UserName=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-eNB2UserName=(.+)$', myArgv, re.IGNORECASE) + SSH.eNB2UserName = matchReg.group(1) + elif re.match('^\-\-eNBPassword=(.+)$|^\-\-eNB[1-2]Password=(.+)$', myArgv, re.IGNORECASE): + if re.match('^\-\-eNBPassword=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-eNBPassword=(.+)$', myArgv, re.IGNORECASE) + SSH.eNBPassword = matchReg.group(1) + elif re.match('^\-\-eNB1Password=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-eNB1Password=(.+)$', myArgv, re.IGNORECASE) + SSH.eNB1Password = matchReg.group(1) + elif re.match('^\-\-eNB2Password=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-eNB2Password=(.+)$', myArgv, re.IGNORECASE) + SSH.eNB2Password = matchReg.group(1) + elif re.match('^\-\-eNBSourceCodePath=(.+)$|^\-\-eNB[1-2]SourceCodePath=(.+)$', myArgv, re.IGNORECASE): + if re.match('^\-\-eNBSourceCodePath=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-eNBSourceCodePath=(.+)$', myArgv, re.IGNORECASE) + SSH.eNBSourceCodePath = matchReg.group(1) + elif re.match('^\-\-eNB1SourceCodePath=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-eNB1SourceCodePath=(.+)$', myArgv, re.IGNORECASE) + SSH.eNB1SourceCodePath = matchReg.group(1) + elif re.match('^\-\-eNB2SourceCodePath=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-eNB2SourceCodePath=(.+)$', myArgv, re.IGNORECASE) + SSH.eNB2SourceCodePath = matchReg.group(1) elif re.match('^\-\-EPCIPAddress=(.+)$', myArgv, re.IGNORECASE): matchReg = re.match('^\-\-EPCIPAddress=(.+)$', myArgv, re.IGNORECASE) SSH.EPCIPAddress = matchReg.group(1) @@ -3986,6 +4141,9 @@ if re.match('^TerminateeNB$', mode, re.IGNORECASE): if SSH.eNBIPAddress == '' or SSH.eNBUserName == '' or SSH.eNBPassword == '': Usage() sys.exit('Insufficient Parameter') + SSH.eNB_serverId = '0' + SSH.eNB_instance = '0' + SSH.eNBSourceCodePath = '/tmp/' SSH.TerminateeNB() elif re.match('^TerminateUE$', mode, re.IGNORECASE): if (SSH.ADBIPAddress == '' or SSH.ADBUserName == '' or SSH.ADBPassword == ''): @@ -4080,19 +4238,15 @@ elif re.match('^FinalizeHtml$', mode, re.IGNORECASE): SSH.CreateHtmlFooter(SSH.finalStatus) elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re.IGNORECASE): if re.match('^TesteNB$', mode, re.IGNORECASE): - if (SSH.eNBIPAddress == '' or SSH.eNBUserName == '' or SSH.eNBPassword == '') and (SSH.UEIPAddress == '' or SSH.UEUserName == '' or SSH.UEPassword == ''): - Usage() - sys.exit('Insufficient Parameter') - elif SSH.ADBIPAddress == 'none' and SSH.EPCIPAddress == 'none': - pass - elif SSH.EPCIPAddress == '' or SSH.EPCUserName == '' or SSH.EPCPassword == '' or SSH.EPCType == '' or SSH.EPCSourceCodePath == '' or SSH.ADBIPAddress == '' or SSH.ADBUserName == '' or SSH.ADBPassword == '': + if SSH.eNBIPAddress == '' or SSH.ranRepository == '' or SSH.ranBranch == '' or SSH.eNBUserName == '' or SSH.eNBPassword == '' or SSH.eNBSourceCodePath == '' or SSH.EPCIPAddress == '' or SSH.EPCUserName == '' or SSH.EPCPassword == '' or SSH.EPCType == '' or SSH.EPCSourceCodePath == '' or SSH.ADBIPAddress == '' or SSH.ADBUserName == '' or SSH.ADBPassword == '': Usage() sys.exit('Insufficient Parameter') + if (SSH.EPCIPAddress != '') and (SSH.EPCIPAddress != 'none'): SSH.copyout(SSH.EPCIPAddress, SSH.EPCUserName, SSH.EPCPassword, cwd + "/tcp_iperf_stats.awk", "/tmp") SSH.copyout(SSH.EPCIPAddress, SSH.EPCUserName, SSH.EPCPassword, cwd + "/active_net_interfaces.awk", "/tmp") else: - if SSH.UEIPAddress == '' or SSH.eNBRepository == '' or SSH.eNBBranch == '' or SSH.UEUserName == '' or SSH.UEPassword == '' or SSH.UESourceCodePath == '': + if SSH.UEIPAddress == '' or SSH.ranRepository == '' or SSH.ranBranch == '' or SSH.UEUserName == '' or SSH.UEPassword == '' or SSH.UESourceCodePath == '': Usage() sys.exit('UE: Insufficient Parameter') @@ -4135,7 +4289,8 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re else: logging.debug('ERROR: requested test is invalidly formatted: ' + test) sys.exit(1) - SSH.CheckFlexranCtrlInstallation() + if (SSH.EPCIPAddress != '') and (SSH.EPCIPAddress != 'none'): + SSH.CheckFlexranCtrlInstallation() #get the list of tests to be done todo_tests=[] @@ -4169,6 +4324,8 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re SSH.GetAllUEDevices(terminate_ue_flag) if action == 'Build_eNB': SSH.BuildeNB() + elif action == 'WaitEndBuild_eNB': + SSH.WaitBuildeNBisFinished() elif action == 'Initialize_eNB': SSH.InitializeeNB() elif action == 'Terminate_eNB': diff --git a/ci-scripts/xml_files/multi_rru_band38_build.xml b/ci-scripts/xml_files/multi_rru_band38_build.xml new file mode 100644 index 0000000000..614ef394f3 --- /dev/null +++ b/ci-scripts/xml_files/multi_rru_band38_build.xml @@ -0,0 +1,84 @@ + + + build-tab + Build + wrench + + 010101 010102 010103 + 000101 000102 000103 + + + + + Build_eNB + Build RCC + -w USRP -c --eNB + 0 + 0 + True + + + + WaitEndBuild_eNB + Wait for end of Build RCC + -w USRP -c --eNB + 0 + 0 + + + + Build_eNB + Build Master RRU + -w USRP -c --eNB + 1 + 1 + True + + + + WaitEndBuild_eNB + Wait for end of Build Master RRU + -w USRP -c --eNB + 1 + 1 + + + + Build_eNB + Build Slave RRU + -w USRP -c --eNB + 2 + 2 + True + + + + WaitEndBuild_eNB + Wait for end of Build Slave RRU + -w USRP -c --eNB + 2 + 2 + + + diff --git a/ci-scripts/xml_files/multi_rru_band38_full_termination.xml b/ci-scripts/xml_files/multi_rru_band38_full_termination.xml new file mode 100644 index 0000000000..d63c73aec5 --- /dev/null +++ b/ci-scripts/xml_files/multi_rru_band38_full_termination.xml @@ -0,0 +1,53 @@ + + + test-full-termintation + Test-RCC-RRUs-Termination + off + + 030211 030212 030213 + + + + + Terminate_eNB + Terminate RCC + 0 + 0 + + + + Terminate_eNB + Terminate Master RRU + 1 + 1 + + + + Terminate_eNB + Terminate Slave RRU + 2 + 2 + + + diff --git a/ci-scripts/xml_files/multi_rru_band38_test_10mhz_tm1.xml b/ci-scripts/xml_files/multi_rru_band38_test_10mhz_tm1.xml new file mode 100644 index 0000000000..70fba65f05 --- /dev/null +++ b/ci-scripts/xml_files/multi_rru_band38_test_10mhz_tm1.xml @@ -0,0 +1,86 @@ + + + test-multi-rru-10 + Test-Multi-RRU-10MHz + tasks + + 030211 030212 030213 + 030111 030112 030113 + 000001 + 030211 030212 030213 + + + + + IdleSleep + Sleep + 60 + + + + Initialize_eNB + Initialize RCC (TDD/Band38/10MHz) + -O ci-scripts/conf_files/rcc.band38.tm1.50PRB.multi.rru.conf --noS1 + 0 + 0 + + + + Initialize_eNB + Initialize Master RRU (TDD/Band38/10MHz) + -O ci-scripts/conf_files/rru.band38.tm1.master.conf --noS1 + 1 + 1 + + + + Initialize_eNB + Initialize Slave RRU (TDD/Band38/10MHz) + -O ci-scripts/conf_files/rru.band38.tm1.slave.conf --noS1 + 2 + 2 + + + + Terminate_eNB + Terminate RCC + 0 + 0 + + + + Terminate_eNB + Terminate Master RRU + 1 + 1 + + + + Terminate_eNB + Terminate Slave RRU + 2 + 2 + + + diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index ba4ebf6e3a..e556e6076c 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1100,8 +1100,8 @@ execution nr_dlschsim Test cases. (Test1: 106 PRB), - (Test2: 217 PRB), - (Test3: 273 PRB) + (Test2: 217 PRB), + (Test3: 273 PRB) $OPENAIR_DIR/cmake_targets/build_oai --phy_simulators -c @@ -1162,10 +1162,10 @@ execution - nr_nr_pucchsim Test cases. (Test1: Format 0 ACK miss 106 PRB), - (Test2: Format 1 ACK miss 106 PRB), - (Test3: Format 1 ACK miss 273 PRB), - (Test4: Format 1 NACKtoACK 106 PRB) + nr_pucchsim Test cases. (Test1: Format 0 ACK miss 106 PRB), + (Test2: Format 1 ACK miss 106 PRB), + (Test3: Format 1 ACK miss 273 PRB), + (Test4: Format 1 NACKtoACK 106 PRB) $OPENAIR_DIR/cmake_targets/build_oai --phy_simulators -c @@ -1173,7 +1173,7 @@ $OPENAIR_DIR/targets/bin/nr_pucchsim.Rel15 -R 106 -i 1 -P 0 -b 1 -s3 -n100 - -R 106 -i 14 -P 1 -b 1 -s-6 -n 100 + -R 106 -i 14 -P 1 -b 1 -s-6 -n 100 -R 273 -i 14 -P 1 -b 1 -s-6 -n100 -R 106 -i 14 -P 1 -b 1 -s-6 -T 0.001 -n1000 nr_pucchsim.test1 nr_pucchsim.test2 nr_pucchsim.test3 nr_pucchsim.test4 diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 291f85661c..f24039369e 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -666,7 +666,7 @@ function main() { if [ "$SIMUS_PHY" = "1" ] ; then echo_info "Compiling physical unitary tests simulators" # TODO: fix: dlsim_tm4 pucchsim prachsim pdcchsim pbchsim mbmssim - simlist="nr_pucchsim dlsim ulsim polartest ldpctest smallblocktest nr_pbchsim nr_dlschsim nr_dlsim nr_ulschsim nr_ulsim" + simlist="dlsim ulsim ldpctest polartest smallblocktest nr_pbchsim nr_dlschsim nr_ulschsim nr_dlsim nr_ulsim nr_pucchsim" for f in $simlist ; do compilations \ phy_simulators $f \ diff --git a/common/ran_context.h b/common/ran_context.h index 73bc536cc2..abe482c742 100644 --- a/common/ran_context.h +++ b/common/ran_context.h @@ -38,8 +38,7 @@ #include "PHY/defs_eNB.h" #include "PHY/types.h" #include "PHY/impl_defs_top.h" -#include "PHY/defs_L1_NB_IoT.h" -#include "PHY/defs_RU.h" + #include "ENB_APP/enb_config.h" #include "flexran_agent_defs.h" @@ -49,6 +48,7 @@ #include "NwGtpv1uPrivate.h" #include "gtpv1u_eNB_defs.h" +#include "PHY/defs_L1_NB_IoT.h" #include "RRC/LTE/defs_NB_IoT.h" #include "RRC/LTE/rrc_defs.h" #include "RRC/NR/nr_rrc_defs.h" diff --git a/common/utils/LOG/vcd_signal_dumper.c b/common/utils/LOG/vcd_signal_dumper.c index 89a04976b1..1d80670324 100644 --- a/common/utils/LOG/vcd_signal_dumper.c +++ b/common/utils/LOG/vcd_signal_dumper.c @@ -248,7 +248,6 @@ const char* eurecomVariablesNames[] = { "slot_number_TX1_gNB", "slot_number_RX0_gNB", "slot_number_RX1_gNB" - }; const char* eurecomFunctionsNames[] = { @@ -286,7 +285,7 @@ const char* eurecomFunctionsNames[] = { "do_DL_sig", "do_UL_sig", "UE_trx_read", - /* RRH signals */ + /* RRH signals */ "eNB_tx", "eNB_rx", "eNB_trx", @@ -296,7 +295,6 @@ const char* eurecomFunctionsNames[] = { "eNB_proc_sleep", "trx_read_rf", "trx_write_rf", - /* PHY signals */ "ue_synch", "ue_slot_fep", @@ -411,7 +409,6 @@ const char* eurecomFunctionsNames[] = { "phy_eNB_dlsch_scrambling", "phy_eNB_beam_precoding", "phy_eNB_ofdm_mod_l", - /* MAC signals */ "macxface_macphy_init", "macxface_macphy_exit", @@ -428,7 +425,6 @@ const char* eurecomFunctionsNames[] = { "mac_dlsch_preprocessor", "mac_schedule_dlsch", "mac_fill_dlsch_dci", - "macxface_out_of_sync_ind", "macxface_ue_decode_si", "macxface_ue_decode_pcch", @@ -440,9 +436,7 @@ const char* eurecomFunctionsNames[] = { "macxface_ue_process_rar", "macxface_ue_scheduler", "macxface_ue_get_sr", - "ue_send_mch_sdu", - /*RLC signals */ "rlc_data_req", // "rlc_data_ind", // this calls "pdcp_data_ind", @@ -452,7 +446,6 @@ const char* eurecomFunctionsNames[] = { "rlc_um_try_reassembly", "rlc_um_check_timer_dar_time_out", "rlc_um_receive_process_dar", - /* PDCP signals */ "pdcp_run", "pdcp_data_req", @@ -482,7 +475,6 @@ const char* eurecomFunctionsNames[] = { "itti_dump_enqueue_message_malloc", "itti_relay_thread", "test", - /* IF4/IF5 signals */ "send_if4_ru", "send_if4_ru1", @@ -492,10 +484,8 @@ const char* eurecomFunctionsNames[] = { "recv_if4_ru2", "send_if5", "recv_if5", - "compress_if", "decompress_if", - "nfapi_subframe", "generate_pcfich", "generate_dci0", @@ -505,11 +495,9 @@ const char* eurecomFunctionsNames[] = { "pdcch_modulation", "pdcch_interleaving", "pdcch_tx", - /*NR softmodem signal*/ "gNB_thread_rxtx0", "gNB_thread_rxtx1" - }; struct vcd_module_s vcd_modules[] = { diff --git a/common/utils/T/T_defs.h b/common/utils/T/T_defs.h index 257244538a..7d55d9b336 100644 --- a/common/utils/T/T_defs.h +++ b/common/utils/T/T_defs.h @@ -73,10 +73,10 @@ typedef struct { } T_cache_t; /* number of VCD functions (to be kept up to date! see in T_messages.txt) */ -#define VCD_NUM_FUNCTIONS (228) +#define VCD_NUM_FUNCTIONS (231) /* number of VCD variables (to be kept up to date! see in T_messages.txt) */ -#define VCD_NUM_VARIABLES (177) +#define VCD_NUM_VARIABLES (185) /* first VCD function (to be kept up to date! see in T_messages.txt) */ #define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP) diff --git a/common/utils/T/tracer/macpdu2wireshark.c b/common/utils/T/tracer/macpdu2wireshark.c index 8720efd8c0..c391a99786 100644 --- a/common/utils/T/tracer/macpdu2wireshark.c +++ b/common/utils/T/tracer/macpdu2wireshark.c @@ -52,6 +52,7 @@ typedef struct { int max_mib; int max_sib; int live; + int no_bind; /* runtime vars */ int cur_mib; int cur_sib; @@ -264,9 +265,11 @@ void *receiver(void *_d) { abort(); } - if (bind(s, (struct sockaddr *)&d->to, sizeof(struct sockaddr_in)) == -1) { - perror("bind"); - abort(); + if (d->no_bind == 0) { + if (bind(s, (struct sockaddr *)&d->to, sizeof(struct sockaddr_in)) == -1) { + perror("bind"); + abort(); + } } while (1) { @@ -290,6 +293,7 @@ void usage(void) { " -live run live\n" " -live-ip tracee's IP address (default %s)\n" " -live-port tracee's port (default %d)\n" + " -no-bind don't bind to IP address (for remote logging)\n" "-i and -live are mutually exclusive options. One of them must be provided\n" "but not both.\n", DEFAULT_IP, @@ -318,78 +322,18 @@ int main(int n, char **v) { for (i = 1; i < n; i++) { if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage(); - - if (!strcmp(v[i], "-d")) { - if (i > n-2) usage(); - - database_filename = v[++i]; - continue; - } - - if (!strcmp(v[i], "-i")) { - if (i > n-2) usage(); - - input_filename = v[++i]; - continue; - } - - if (!strcmp(v[i], "-ip")) { - if (i > n-2) usage(); - - ip = v[++i]; - continue; - } - - if (!strcmp(v[i], "-p")) { - if(i>n-2)usage(); - - port=atoi(v[++i]); - continue; - } - - if (!strcmp(v[i], "-no-mib")) { - d.no_mib = 1; - continue; - } - - if (!strcmp(v[i], "-no-sib")) { - d.no_sib = 1; - continue; - } - - if (!strcmp(v[i], "-max-mib")) { - if (i > n-2) usage(); - - d.max_mib = atoi(v[++i]); - continue; - } - - if (!strcmp(v[i], "-max-sib")) { - if (i > n-2) usage(); - - d.max_sib = atoi(v[++i]); - continue; - } - - if (!strcmp(v[i], "-live")) { - live = 1; - continue; - } - - if (!strcmp(v[i], "-live-ip")) { - if (i > n-2) usage(); - - live_ip = v[++i]; - continue; - } - - if (!strcmp(v[i], "-live-port")) { - if (i > n-2) usage(); - - live_port = atoi(v[++i]); - continue; - } - + if (!strcmp(v[i], "-d")) { if(i>n-2)usage(); database_filename = v[++i]; continue; } + if (!strcmp(v[i], "-i")) { if(i>n-2)usage(); input_filename = v[++i]; continue; } + if (!strcmp(v[i], "-ip")) { if(i>n-2)usage(); ip = v[++i]; continue; } + if (!strcmp(v[i], "-p")) { if(i>n-2)usage(); port = atoi(v[++i]); continue; } + if (!strcmp(v[i], "-no-mib")) { d.no_mib = 1; continue; } + if (!strcmp(v[i], "-no-sib")) { d.no_sib = 1; continue; } + if (!strcmp(v[i], "-max-mib")) { if(i>n-2)usage(); d.max_mib = atoi(v[++i]); continue; } + if (!strcmp(v[i], "-max-sib")) { if(i>n-2)usage(); d.max_sib = atoi(v[++i]); continue; } + if (!strcmp(v[i], "-live")) { live = 1; continue; } + if (!strcmp(v[i], "-live-ip")) { if(i>n-2)usage(); live_ip = v[++i]; continue; } + if (!strcmp(v[i], "-live-port")) { if(i>n-2)usage(); live_port = atoi(v[++i]); continue; } + if (!strcmp(v[i], "-no-bind")) { d.no_bind = 1; continue; } usage(); } diff --git a/openair1/PHY/CODING/nrPolar_tools/main_pucch.c b/openair1/PHY/CODING/nrPolar_tools/main_pucch.c deleted file mode 100644 index efbf27a5c0..0000000000 --- a/openair1/PHY/CODING/nrPolar_tools/main_pucch.c +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include -#include - -#include "nr_polar_defs.h" -#include "nr_polar_pucch_defs.h" - -void PUCCH_encoder(uint8_t a[], uint8_t A, uint8_t G, uint16_t* E_r, uint8_t** f); - -int main() -{ - uint16_t E_r; - uint8_t* f; - uint8_t A=32; //16, 32, 64, 128, 256, 512, 1024 Payload length - uint8_t G = 54; //, 108, 216, 432, 864, 1728, 3456, 6912, 13824}; encoded block length - - uint8_t j; - - uint8_t* a = (uint8_t *)malloc(sizeof(uint8_t)*A); - if (a == NULL) - { - fprintf(stderr, "malloc failed\n"); - exit(-1); - } - - printf("DEBUG: Send "); - for (j=0; j -#include -#include - -#include "nr_polar_defs.h" -#include "nr_polar_pucch_defs.h" - -void PUCCH_encoder(uint8_t a[], uint8_t A, uint8_t G, uint16_t* E_r, uint8_t** f) -{ -// PUCCH_ENCODER Polar encoder for the Physical Uplink Control Channel (PUCCH) and the -// Physical Uplink Shared Channel (PUSCH) of 3GPP New Radio, as defined in -// Section 6.3 of TS38.212. Implements the code block segmentation and -// Cyclic Redudancy Check (CRC) attachment of Sections 6.3.1.2.1 and 6.3.2.2.1, -// the channel coding of Sections 6.3.1.3.1 and 6.3.2.3.2, the rate matching of -// Sections 6.3.1.4.1 and 6.3.2.4.1, as well as the code block concatenation of -// Sections 6.3.1.5.1 and 6.3.2.5.1. Note that this code does not implement the -// UCI bit sequence generation of Sections 6.3.1.1 and 6.3.2.1, the -// determination of the encoded block length E_UCI of Sections 6.3.1.4.1 and -// 6.3.2.4.1, or the multiplexing of Sections 6.3.1.6 and 6.3.2.6. Also, this -// code does not implement the small block lengths, which are detailed in -// Sections 6.3.1.2.2, 6.3.1.3.2, 6.3.1.4.2, 6.3.2.2.2, 6.3.2.3.2 and 6.3.2.4.2. - - uint8_t C=0; - uint8_t i; - uint8_t crc_polynomial_pattern_length; - uint8_t P[32] = {0, 1, 2, 4, 3, 5, 6, 7, 8, 16, 9, 17, 10, 18, 11, 19, 12, 20, 13, 21, 14, 22, 15, 23, 24, 25, 26, 28, 27, 29, 30, 31}; - uint8_t* crc_polynomial_pattern; - - if (A < 12) { - fprintf(stderr, "A should be no less than 12."); - exit(-1); - } else if (A > 1706) { - fprintf(stderr, "A should be no greater than 1706."); - exit(-1); - } - else if (A <= 19) //Use PCCA-polar - { - // The CRC polynomial used with PCCA-polar in 3GPP PUCCH channel is D^6 + D^5 + 1 - crc_polynomial_pattern_length = 7; - crc_polynomial_pattern = (uint8_t *)malloc(sizeof(uint8_t)*crc_polynomial_pattern_length); - crc_polynomial_pattern[0] = 1; - crc_polynomial_pattern[1] = 1; - crc_polynomial_pattern[2] = 0; - crc_polynomial_pattern[3] = 0; - crc_polynomial_pattern[4] = 0; - crc_polynomial_pattern[5] = 0; - crc_polynomial_pattern[6] = 1; - - C = 1; // Use one segment - } - else // Use CA-polar - { - crc_polynomial_pattern_length = 12; - crc_polynomial_pattern = (uint8_t *)malloc(sizeof(uint8_t)*crc_polynomial_pattern_length); - crc_polynomial_pattern[0] = 1; - crc_polynomial_pattern[1] = 1; - crc_polynomial_pattern[2] = 1; - crc_polynomial_pattern[3] = 0; - crc_polynomial_pattern[4] = 0; - crc_polynomial_pattern[5] = 0; - crc_polynomial_pattern[6] = 1; - crc_polynomial_pattern[7] = 0; - crc_polynomial_pattern[8] = 0; - crc_polynomial_pattern[9] = 0; - crc_polynomial_pattern[10] = 0; - crc_polynomial_pattern[11] = 1; - - if (A >= 360 && G >= 1088 ) - C = 2; // Use two segments - else - C = 1; // Use one segment - } - - // Determine the number of information and CRC bits. - uint16_t K = ceil(A/C)+crc_polynomial_pattern_length-1; - - *E_r = floor((double)G/C); - - if(*E_r > 8192) { - fprintf(stderr, "G is too long."); - exit(-1); - } - - //Determine the number of bits used at the input and output of the polar encoder kernal. - uint16_t N = nr_polar_coding_output_length(K, *E_r, NR_POLAR_PUCCH_N_MAX); - uint8_t n = log2(N); - - //int N = get_3GPP_N(K,*E_r,10); //n_max = 10 is used in PUCCH channels - printf("DEBUG: The number of bits used at I/O of encoder kernal is %i\n", (int)N); - - // Get a rate matching pattern - uint16_t* rate_matching_pattern = (uint16_t*)malloc(sizeof(uint16_t) * (*E_r)); - uint16_t *J = malloc(sizeof(uint16_t) * N); - nr_polar_coding_rate_matching_pattern(rate_matching_pattern, J, P, K, N, *E_r); - - printf("DEBUG: The rate matching pattern is "); - for (i=0; i<*E_r; i++) { - printf("%i ", (int)rate_matching_pattern[i]); - } - printf("\n"); - - // Get a sequence pattern - uint16_t *Q_0_Nminus1 = nr_polar_coding_sequence_pattern(n); - printf("DEBUG: The sequence pattern is "); - for (i=0; i info_bit_pattern - printf("DEBUG: The information bit pattern is " ); - for (i=0; i 192) - get_PC_bit_pattern(N, n_PC, 1, Q_0_Nminus1, info_bit_pattern, &PC_bit_pattern); // -> PC_bit_pattern - else - get_PC_bit_pattern(N, n_PC, 0, Q_0_Nminus1, info_bit_pattern, &PC_bit_pattern); // -> PC_bit_pattern - - printf("DEBUG: The PC bit pattern is " ); - for (i=0; i G_P - nr_polar_crc(a, A, crc_polynomial_pattern_length-1, G_P, &b); //-> b - - //Bit insertion - u = (uint8_t*) malloc(sizeof(uint8_t)*N); - if (u == NULL) { - fprintf(stderr, "malloc failed\n"); - exit(-1); - } - nr_polar_bit_insertion_2(u, b, info_bit_pattern, PC_bit_pattern, N); // -> u - free(b); - - //encoding - d = malloc(sizeof(uint8_t) * N); - if (d == NULL) { - fprintf(stderr, "malloc failed\n"); - exit(-1); - } - nr_polar_kernel_operation(u, d, N); // -> d - free(u); - - //rate matching - e = malloc(sizeof(uint8_t) * N); - if (e == NULL) { - fprintf(stderr, "malloc failed\n"); - exit(-1); - } - nr_polar_coding_rate_matcher(d, e, rate_matching_pattern, (*E_r)); - free(d); - printf("\ne = "); - for(i=0;i<(*E_r);i++) - { - printf("%i ", e[i]); - } - - // Perform channel interleaving. - *f = (uint8_t*) malloc(sizeof(uint8_t)*(*E_r)); - nr_polar_coding_interleaver(e, *f, channel_interleaver_pattern, (uint16_t)(*E_r)); - free(e); - printf("\nf = "); - for(i=0;i<(*E_r);i++) - { - printf("%i ", (*f)[i]); - } - printf("\n\n\n "); - } else //Use CA-polar - { - n_PC = 0; - - // Get an information bit pattern. - get_3GPP_info_bit_pattern(K, n_PC, N, *E_r, P, Q_0_Nminus1, &info_bit_pattern); // -> info_bit_pattern - printf("DEBUG: The information bit pattern is " ); - for (i=0; i G_P - nr_polar_crc(a, A/C, crc_polynomial_pattern_length-1, G_P, &b); //-> b - - } else - { - //Attach CRC to the Transport Block. (a to b) - get_crc_generator_matrix(A, crc_polynomial_pattern_length-1, crc_polynomial_pattern, &G_P); // -> G_P - nr_polar_crc(a, A, crc_polynomial_pattern_length-1, G_P, &b); //-> b - } - - //Bit insertion - u = (uint8_t*) malloc(sizeof(uint8_t)*N); - if (u == NULL) { - fprintf(stderr, "malloc failed\n"); - exit(-1); - } - int j=0; - printf("\nu = "); - for(i=0; i d - free(u); - - //rate matching - e = malloc(sizeof(uint8_t) * N); - if (e == NULL) { - fprintf(stderr, "malloc failed\n"); - exit(-1); - } - nr_polar_coding_rate_matcher(d, e, rate_matching_pattern, (*E_r)); - free(d); - printf("\ne = "); - for(i=0;i<(*E_r);i++) - { - printf("%i ", e[i]); - } - - // Perform channel interleaving. - *f = (uint8_t*) malloc(sizeof(uint8_t)*(*E_r)); - nr_polar_coding_interleaver(e, *f, channel_interleaver_pattern, (uint16_t)(*E_r)); - free(e); - printf("\nf = "); - for(i=0;i<(*E_r);i++) - { - printf("%i ", (*f)[i]); - } - printf("\n\n\n "); - - - - - } -// -// free(crc_polynomial_pattern); -// //free others... - -} diff --git a/openair1/PHY/INIT/lte_init_ru.c b/openair1/PHY/INIT/lte_init_ru.c index 7a6e928edb..08943dcffa 100644 --- a/openair1/PHY/INIT/lte_init_ru.c +++ b/openair1/PHY/INIT/lte_init_ru.c @@ -34,8 +34,9 @@ void init_7_5KHz(void); -int phy_init_RU(RU_t *ru) { - LTE_DL_FRAME_PARMS *fp = &ru->frame_parms; +int phy_init_RU(RU_t *ru) +{ + LTE_DL_FRAME_PARMS *fp = ru->frame_parms; RU_CALIBRATION *calibration = &ru->calibration; int i,j,p,re; @@ -184,8 +185,7 @@ int phy_init_RU(RU_t *ru) { void phy_free_RU(RU_t *ru) { - int i,j; - int p; + int i,j,p; RU_CALIBRATION *calibration = &ru->calibration; LOG_I(PHY, "Feeing RU signal buffers (if_south %s) nb_tx %d\n", ru_if_types[ru->if_south], ru->nb_tx); diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index c90ed01eae..f032370730 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -596,7 +596,8 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, * \param[in] frame_parms LTE_DL_FRAME_PARMS structure. * \note This function is optimistic in that it expects malloc() to succeed. */ -void phy_init_nr_ue__PDSCH( NR_UE_PDSCH* const pdsch, const NR_DL_FRAME_PARMS* const fp ) +void phy_init_nr_ue__PDSCH(NR_UE_PDSCH* const pdsch, + const NR_DL_FRAME_PARMS* const fp) { AssertFatal( pdsch, "pdsch==0" ); @@ -646,22 +647,20 @@ void phy_init_nr_ue__PDSCH( NR_UE_PDSCH* const pdsch, const NR_DL_FRAME_PARMS* c } } -void phy_init_nr_ue_PUSCH( NR_UE_PUSCH* const pusch, const NR_DL_FRAME_PARMS* const fp ) +void phy_init_nr_ue_PUSCH(NR_UE_PUSCH* const pusch, + const NR_DL_FRAME_PARMS* const fp) { - - int i; AssertFatal( pusch, "pusch==0" ); - for (i=0; itxdataF_layers[i] = (int32_t *)malloc16_clear((NR_MAX_PUSCH_ENCODED_LENGTH)*sizeof(int32_t*)); - } } int init_nr_ue_signal(PHY_VARS_NR_UE *ue, - int nb_connected_eNB, - uint8_t abstraction_flag) + int nb_connected_eNB, + uint8_t abstraction_flag) { // create shortcuts NR_DL_FRAME_PARMS* const fp = &ue->frame_parms; @@ -986,13 +985,12 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, } -void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag) { - - int i,j,k; - - for (i=0; idlsch[k][i][j] = new_nr_ue_dlsch(1,NUMBER_OF_HARQ_PID_MAX,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL, abstraction_flag))!=NULL,"Can't get ue dlsch structures\n"); LOG_D(PHY,"dlsch[%d][%d][%d] => %p\n",k,i,j,ue->dlsch[k][i][j]); @@ -1043,8 +1041,9 @@ void phy_init_nr_top(PHY_VARS_NR_UE *ue) } -void set_default_frame_parms_single(nfapi_nr_config_request_t *config, NR_DL_FRAME_PARMS *frame_parms) { - +void set_default_frame_parms_single(nfapi_nr_config_request_t *config, + NR_DL_FRAME_PARMS *frame_parms) +{ //int CC_id; //for (CC_id=0; CC_idframe_parms : &eNB->frame_parms; + LTE_DL_FRAME_PARMS *frame_parms = (eNB==NULL) ? ru->frame_parms : &eNB->frame_parms; LTE_eNB_PUSCH *eNB_pusch_vars = (eNB!=NULL) ? eNB->pusch_vars[UE_id] : (LTE_eNB_PUSCH*)NULL; RU_CALIBRATION *calibration = &ru->calibration; int32_t **ul_ch_estimates_time = (eNB==NULL) ? calibration->drs_ch_estimates_time : eNB_pusch_vars->drs_ch_estimates_time; @@ -153,4 +154,3 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB *eNB,module_id_t UE_id) return max_pos - sync_pos; } - diff --git a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c index 04d598e8a7..0c98bdc5a5 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c @@ -26,15 +26,13 @@ */ //#include +#include +#include "LAYER2/MAC/mac.h" #include "PHY/defs_UE.h" #include "PHY/phy_extern_ue.h" -#include - - -#include "LAYER2/MAC/mac.h" -#include "RRC/LTE/rrc_extern.h" #include "PHY_INTERFACE/phy_interface.h" #include "PHY/LTE_REFSIG/lte_refsig.h" +#include "RRC/LTE/rrc_extern.h" // Note: this is for prototype of generate_drs_pusch (OTA synchronization of RRUs) #include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h" @@ -46,10 +44,8 @@ int sync_tmp[2048*4] __attribute__((aligned(32))); short syncF_tmp[2048*2] __attribute__((aligned(32))); - int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *common_vars { - int i,k; sync_corr_ue0 = (int *)malloc16(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int)*frame_parms->samples_per_tti); @@ -275,8 +271,6 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com ((int32_t*)primary_synch2_time)[i] = sync_tmp[i]; - - if ( LOG_DUMPFLAG(DEBUG_LTEESTIM)){ LOG_M("primary_sync0.m","psync0",primary_synch0_time,frame_parms->ofdm_symbol_size,1,1); LOG_M("primary_sync1.m","psync1",primary_synch1_time,frame_parms->ofdm_symbol_size,1,1); @@ -288,8 +282,6 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com void lte_sync_time_free(void) { - - if (sync_corr_ue0) { LOG_D(PHY,"Freeing sync_corr_ue (%p)...\n",sync_corr_ue0); free(sync_corr_ue0); @@ -328,19 +320,20 @@ void lte_sync_time_free(void) primary_synch2_time = NULL; } + static inline int abs32(int x) { return (((int)((short*)&x)[0])*((int)((short*)&x)[0]) + ((int)((short*)&x)[1])*((int)((short*)&x)[1])); } + #define SHIFT 17 + int lte_sync_time(int **rxdata, ///rx data in time domain LTE_DL_FRAME_PARMS *frame_parms, int *eNB_id) { - - // perform a time domain correlation using the oversampled sync sequence unsigned int n, ar, s, peak_pos, peak_val, sync_source; @@ -465,77 +458,74 @@ int lte_sync_time(int **rxdata, ///rx data in time domain } else { debug_cnt++; } -} - - - return(peak_pos); - } - + return(peak_pos); +} int ru_sync_time_init(RU_t *ru) // LTE_UE_COMMON *common_vars { - /* int16_t dmrs[2048]; int16_t *dmrsp[2] = {dmrs,NULL}; */ - int32_t dmrs[ru->frame_parms.ofdm_symbol_size*14] __attribute__((aligned(32))); -// int32_t *dmrsp[2] = {&dmrs[(3-ru->frame_parms.Ncp)*ru->frame_parms.ofdm_symbol_size],NULL}; + int32_t dmrs[ru->frame_parms->ofdm_symbol_size*14] __attribute__((aligned(32))); + //int32_t *dmrsp[2] = {&dmrs[(3-ru->frame_parms->Ncp)*ru->frame_parms->ofdm_symbol_size],NULL}; int32_t *dmrsp[2] = {&dmrs[0],NULL}; generate_ul_ref_sigs(); - ru->dmrssync = (int16_t*)malloc16_clear(ru->frame_parms.ofdm_symbol_size*2*sizeof(int16_t)); - ru->dmrs_corr = (uint64_t*)malloc16_clear(ru->frame_parms.samples_per_tti*10*sizeof(uint64_t)); + ru->dmrssync = (int16_t*)malloc16_clear(ru->frame_parms->ofdm_symbol_size*2*sizeof(int16_t)); + ru->dmrs_corr = (uint64_t*)malloc16_clear(ru->frame_parms->samples_per_tti*10*sizeof(uint64_t)); - generate_drs_pusch(NULL,NULL, - &ru->frame_parms, - dmrsp, - 0, - AMP, - 0, - 0, - ru->frame_parms.N_RB_DL, - 0); + generate_drs_pusch(NULL, + NULL, + ru->frame_parms, + dmrsp, + 0, + AMP, + 0, + 0, + ru->frame_parms->N_RB_DL, + 0); - switch (ru->frame_parms.N_RB_DL) { + switch (ru->frame_parms->N_RB_DL) { case 6: - idft128((int16_t*)(&dmrsp[0][3*ru->frame_parms.ofdm_symbol_size]), + idft128((int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]), ru->dmrssync, /// complex output 1); break; case 25: - idft512((int16_t*)(&dmrsp[0][3*ru->frame_parms.ofdm_symbol_size]), + idft512((int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]), ru->dmrssync, /// complex output 1); break; case 50: - idft1024((int16_t*)(&dmrsp[0][3*ru->frame_parms.ofdm_symbol_size]), + idft1024((int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]), ru->dmrssync, /// complex output 1); break; case 75: - idft1536((int16_t*)(&dmrsp[0][3*ru->frame_parms.ofdm_symbol_size]), + idft1536((int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]), ru->dmrssync, 1); /// complex output break; case 100: - idft2048((int16_t*)(&dmrsp[0][3*ru->frame_parms.ofdm_symbol_size]), + idft2048((int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]), ru->dmrssync, /// complex output 1); break; default: - AssertFatal(1==0,"Unsupported N_RB_DL %d\n",ru->frame_parms.N_RB_DL); + AssertFatal(1==0,"Unsupported N_RB_DL %d\n",ru->frame_parms->N_RB_DL); break; } return(0); } + void ru_sync_time_free(RU_t *ru) { AssertFatal(ru->dmrssync!=NULL,"ru->dmrssync is NULL\n"); @@ -551,7 +541,6 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain uint32_t *peak_val_out, uint32_t *sync_corr_eNB) { - // perform a time domain correlation using the oversampled sync sequence unsigned int n, ar, peak_val, peak_pos; @@ -634,17 +623,19 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain } + static inline int64_t abs64(int64_t x) { return (((int64_t)((int32_t*)&x)[0])*((int64_t)((int32_t*)&x)[0]) + ((int64_t) ((int32_t*)&x)[1])*((int64_t)((int32_t*)&x)[1])); } + int ru_sync_time(RU_t *ru, int64_t *lev, int64_t *avg) { - LTE_DL_FRAME_PARMS *frame_parms = &ru->frame_parms; + LTE_DL_FRAME_PARMS *frame_parms = ru->frame_parms; RU_CALIBRATION *calibration = &ru->calibration; // perform a time domain correlation using the oversampled sync sequence @@ -713,8 +704,4 @@ int ru_sync_time(RU_t *ru, if ((int64_t)maxlev0 > (10*avg0)) {*lev = maxlev0; *avg=avg0; return((length+maxpos0-dmrsoffset)%length);} return(-1); - - } - - diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c index eaed019a4f..2dbc58276d 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c @@ -35,13 +35,14 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32 #define SCALE 0x3FFF int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB, - L1_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, module_id_t UE_id, unsigned char l, - unsigned char Ns) { + unsigned char Ns) +{ RU_t *ru; ru = RC.ru[UE_id]; - LTE_DL_FRAME_PARMS *frame_parms = (eNB!=NULL) ? &eNB->frame_parms : &ru->frame_parms; + LTE_DL_FRAME_PARMS *frame_parms = (eNB!=NULL) ? &eNB->frame_parms : ru->frame_parms; LTE_eNB_PUSCH *pusch_vars = (eNB!=NULL) ? eNB->pusch_vars[UE_id] : NULL; RU_CALIBRATION *calibration = &ru->calibration; int32_t **ul_ch_estimates = (eNB!=NULL) ? pusch_vars->drs_ch_estimates : calibration->drs_ch_estimates; @@ -54,7 +55,7 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB, int32_t **rxdataF_ext = (eNB!=NULL) ? pusch_vars->rxdataF_ext : calibration->rxdataF_ext; - int subframe = (eNB!=NULL) ? proc->subframe_rx : ru->proc.subframe_rx; + int subframe = (eNB!=NULL) ? proc->subframe_rx : ru->proc.tti_rx; uint8_t harq_pid; int16_t delta_phase = 0; diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index b4b253a297..1913afab2d 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -291,24 +291,8 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, y[0] = &yseq0[0]; y[1] = &yseq1[0]; - if (IS_SOFTMODEM_BASICSIM) { - /* this should be the normal case - * but it has to be validated for all the various cases - * so let's just do it for the basic simulator - */ - // memset(e, 2, DCI_BITS_MAX); - } else { - // reset all bits to , here we set elements as 2 - // memset(e, 2, DCI_BITS_MAX); - // here we interpret NIL as a random QPSK sequence. That makes power estimation easier. - for (i=0; i, here we set elements as 2 */ + memset(e, 2, DCI_BITS_MAX); e_ptr = e; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DCI0,1); diff --git a/openair1/PHY/TOOLS/dB_routines.c b/openair1/PHY/TOOLS/dB_routines.c index e5cfa14f83..ed5c96a8c3 100644 --- a/openair1/PHY/TOOLS/dB_routines.c +++ b/openair1/PHY/TOOLS/dB_routines.c @@ -575,7 +575,6 @@ int16_t dB_fixed_times10(uint32_t x) { int16_t dB_power=0; - if (x==0) { dB_power = 0; } else if ( (x&0xff000000) != 0 ) { @@ -597,18 +596,11 @@ int16_t dB_fixed_times10(uint32_t x) return dB_power; } -uint8_t dB_fixed64(uint64_t x) { - if ((x<(((uint64_t)1)<<32))) return(dB_fixed((uint32_t)x)); - else return(4*dB_table[255]+dB_fixed((uint32_t)(x>>32))); - -} int8_t dB_fixed(uint32_t x) { - int8_t dB_power=0; - if (x==0) { dB_power = 0; } else if ( (x&0xff000000) != 0 ) { @@ -630,15 +622,16 @@ int8_t dB_fixed(uint32_t x) return dB_power; } + uint8_t dB_fixed64(uint64_t x) { - - if (x<(((uint64_t)1)<<32)) return(dB_fixed((uint32_t)x)); - else return(4*dB_table[255] + dB_fixed(x>>32)); - + if ((x<(((uint64_t)1)<<32))) return(dB_fixed((uint32_t)x)); + else return(4*dB_table[255]+dB_fixed((uint32_t)(x>>32))); } -int8_t dB_fixed2(uint32_t x, uint32_t y) + +int8_t dB_fixed2(uint32_t x, + uint32_t y) { if ((x>0) && (y>0) ) diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h index e40cb5136c..1cf58a26ac 100644 --- a/openair1/PHY/defs_RU.h +++ b/openair1/PHY/defs_RU.h @@ -37,6 +37,7 @@ #include "common_lib.h" #include "openairinterface5g_limits.h" #include "PHY/TOOLS/time_meas.h" +#include "openair1/PHY/defs_common.h" #define MAX_BANDS_PER_RRU 4 @@ -46,7 +47,18 @@ #ifdef OCP_FRAMEWORK #include #else -typedef enum {normal_txrx=0,rx_calib_ue=1,rx_calib_ue_med=2,rx_calib_ue_byp=3,debug_prach=4,no_L2_connect=5,calib_prach_tx=6,rx_dump_frame=7,loop_through_memory=8} runmode_t; + +typedef enum { + normal_txrx=0, + rx_calib_ue=1, + rx_calib_ue_med=2, + rx_calib_ue_byp=3, + debug_prach=4, + no_L2_connect=5, + calib_prach_tx=6, + rx_dump_frame=7, + loop_through_memory=8 +} runmode_t; /*! \brief Extension Type */ typedef enum { @@ -64,7 +76,7 @@ enum transmission_access_mode { SCHEDULED_ACCESS, CBA_ACCESS}; -typedef enum { +typedef enum { eNodeB_3GPP=0, // classical eNodeB function NGFI_RAU_IF5, // RAU with NGFI IF5 NGFI_RAU_IF4p5, // RAU with NFGI IF4p5 @@ -75,7 +87,6 @@ typedef enum { } node_function_t; typedef enum { - synch_to_ext_device=0, // synch to RF or Ethernet device synch_to_other, // synch to another source_(timer, other RU) synch_to_mobipass_standalone // special case for mobipass in standalone mode @@ -119,6 +130,22 @@ typedef struct { } RU_COMMON; +typedef struct { + /// \brief Received frequency-domain signal after extraction. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..168*N_RB_DL[ + int32_t **rxdataF_ext; + /// \brief Hold the channel estimates in time domain based on DRS. + /// - first index: rx antenna id [0..nb_antennas_rx[ + /// - second index: ? [0..4*ofdm_symbol_size[ + int32_t **drs_ch_estimates_time; + /// \brief Hold the channel estimates in frequency domain based on DRS. + /// - first index: rx antenna id [0..nb_antennas_rx[ + /// - second index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[ + int32_t **drs_ch_estimates; +} RU_CALIBRATION; + + typedef struct RU_proc_t_s { /// Pointer to associated RU descriptor struct RU_t_s *ru; diff --git a/openair1/PHY/defs_common.h b/openair1/PHY/defs_common.h index 3e59547e8b..d2cdf4e8ae 100644 --- a/openair1/PHY/defs_common.h +++ b/openair1/PHY/defs_common.h @@ -145,7 +145,6 @@ typedef struct { } PRACH_CONFIG_INFO; - /// PRACH-ConfigSIB or PRACH-Config from 36.331 RRC spec typedef struct { /// Parameter: RACH_ROOT_SEQUENCE, see TS 36.211 (5.7.1). \vr{[0..837]} @@ -157,12 +156,11 @@ typedef struct { } PRACH_CONFIG_COMMON; #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) - /// PRACH-eMTC-Config from 36.331 RRC spec typedef struct { /// Parameter: High-speed-flag, see TS 36.211 (5.7.2). \vr{[0..1]} 1 corresponds to Restricted set and 0 to Unrestricted set. uint8_t highSpeedFlag; -/// Parameter: \f$N_\text{CS}\f$, see TS 36.211 (5.7.2). \vr{[0..15]}\n Refer to table 5.7.2-2 for preamble format 0..3 and to table 5.7.2-3 for preamble format 4. + /// Parameter: \f$N_\text{CS}\f$, see TS 36.211 (5.7.2). \vr{[0..15]}\n Refer to table 5.7.2-2 for preamble format 0..3 and to table 5.7.2-3 for preamble format 4. uint8_t zeroCorrelationZoneConfig; /// Parameter: prach-FrequencyOffset, see TS 36.211 (5.7.1). \vr{[0..94]}\n For TDD the value range is dependent on the value of \ref prach_ConfigIndex. @@ -586,7 +584,7 @@ typedef struct { #endif -typedef struct { +typedef struct LTE_DL_FRAME_PARMS { /// Number of resource blocks (RB) in DL uint8_t N_RB_DL; /// Number of resource blocks (RB) in UL @@ -751,28 +749,29 @@ typedef enum { MMSE=2 } PRECODE_TYPE_t; -typedef enum {format0, - format1, - format1A, - format1B, - format1C, - format1D, - format1E_2A_M10PRB, - format2, - format2A, - format2B, - format2C, - format2D, - format3, - format3A, - format4, - format5, - format6_0A, - format6_0B, - format6_1A, - format6_1B, - format6_2 - } DCI_format_t; +typedef enum { + format0, + format1, + format1A, + format1B, + format1C, + format1D, + format1E_2A_M10PRB, + format2, + format2A, + format2B, + format2C, + format2D, + format3, + format3A, + format4, + format5, + format6_0A, + format6_0B, + format6_1A, + format6_1B, + format6_2 +} DCI_format_t; typedef struct { /// Length of DCI in bits @@ -1025,7 +1024,8 @@ typedef uint8_t(encoder_if_t)(uint8_t *input, uint8_t F); -static inline void wait_sync(char *thread_name) { +static inline void wait_sync(char *thread_name) +{ int rc; printf( "waiting for sync (%s,%d/%p,%p,%p)\n",thread_name,sync_var,&sync_var,&sync_cond,&sync_mutex); @@ -1044,7 +1044,14 @@ static inline void wait_sync(char *thread_name) { fflush(stderr); } -static inline int wakeup_thread(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name, int sleeptime,int sleep_cnt_max) { + +static inline int wakeup_thread(pthread_mutex_t *mutex, + pthread_cond_t *cond, + int *instance_cnt, + char *name, + int sleeptime, + int sleep_cnt_max) +{ int rc; int sleep_cnt=0; @@ -1074,18 +1081,24 @@ static inline int wakeup_thread(pthread_mutex_t *mutex,pthread_cond_t *cond,int return(0); } -static inline int timedwait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name,uint32_t time_ns) { + +static inline int timedwait_on_condition(pthread_mutex_t *mutex, + pthread_cond_t *cond, + int *instance_cnt, + char *name, + uint32_t time_ns) +{ int rc; int waitret=0; - struct timespec now,abstime; + struct timespec now, abstime; AssertFatal((rc = pthread_mutex_lock(mutex))==0,"[SCHED][eNB] timedwait_on_condition(): error locking mutex for %s (%d %s, %p)\n", name, rc, strerror(rc), (void *)mutex); - clock_gettime(CLOCK_REALTIME,&now); while (*instance_cnt < 0) { + clock_gettime(CLOCK_REALTIME, &now); // most of the time the thread is waiting here // proc->instance_cnt_rxtx is -1 - abstime.tv_sec=now.tv_sec; + abstime.tv_sec = now.tv_sec; abstime.tv_nsec = now.tv_nsec + time_ns; if (abstime.tv_nsec >= 1000*1000*1000) { @@ -1097,10 +1110,15 @@ static inline int timedwait_on_condition(pthread_mutex_t *mutex,pthread_cond_t * AssertFatal((rc = pthread_mutex_unlock(mutex)) == 0,"[SCHED][eNB] timedwait_on_condition(): error unlocking mutex return %d for %s\n", rc, name); - return(0); + return(waitret); } -static inline int wait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name) { + +static inline int wait_on_condition(pthread_mutex_t *mutex, + pthread_cond_t *cond, + int *instance_cnt, + char *name) +{ int rc; AssertFatal((rc = pthread_mutex_lock(mutex))==0,"[SCHED][eNB] wait_on_condition(): error locking mutex for %s (%d %s, %p)\n", name, rc, strerror(rc), (void *)mutex); @@ -1116,36 +1134,12 @@ static inline int wait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *cond, return(0); } -static inline int timedwait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name,uint32_t time_ns) { - int rc; - int waitret=0; - if ((rc = pthread_mutex_lock(mutex)) != 0) { - LOG_E(PHY, "[SCHED][eNB] wait_on_condition(): error locking mutex for %s (%d %s, %p)\n", - name, rc, strerror(rc), (void *)mutex); - exit_fun("nothing to add"); - return(-1); - } - struct timespec now,abstime; - - while (*instance_cnt < 0) { - clock_gettime(CLOCK_REALTIME,&now); - // most of the time the thread is waiting here - // proc->instance_cnt_rxtx is -1 - abstime.tv_sec=now.tv_sec; - abstime.tv_nsec = now.tv_nsec + time_ns; - if ((waitret = pthread_cond_timedwait(cond,mutex,&abstime))==ETIMEDOUT) break; // this unlocks mutex_rxtx while waiting and then locks it again - - } - - if (pthread_mutex_unlock(mutex) != 0) { - LOG_E(PHY,"[SCHED][eNB] error unlocking mutex for %s\n",name); - exit_fun("nothing to add"); - return(-1); - } - return(waitret); -} -static inline int wait_on_busy_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name) { +static inline int wait_on_busy_condition(pthread_mutex_t *mutex, + pthread_cond_t *cond, + int *instance_cnt, + char *name) +{ int rc; AssertFatal((rc = pthread_mutex_lock(mutex))==0,"[SCHED][eNB] wait_on_busy_condition(): error locking mutex for %s (%d %s, %p)\n", name, rc, strerror(rc), (void *)mutex); @@ -1160,7 +1154,11 @@ static inline int wait_on_busy_condition(pthread_mutex_t *mutex,pthread_cond_t * return(0); } -static inline int release_thread(pthread_mutex_t *mutex,int *instance_cnt,char *name) { + +static inline int release_thread(pthread_mutex_t *mutex, + int *instance_cnt, + char *name) +{ int rc; AssertFatal((rc = pthread_mutex_lock(mutex))==0,"[SCHED][eNB] release_thread(): error locking mutex for %s (%d %s, %p)\n", name, rc, strerror(rc), (void *)mutex); diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index fda8a6ba72..47b3f77d3e 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -231,13 +231,11 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,int frame, int subframe) { -void pdsch_procedures(PHY_VARS_eNB *eNB, +bool dlsch_procedures(PHY_VARS_eNB *eNB, L1_rxtx_proc_t *proc, int harq_pid, LTE_eNB_DLSCH_t *dlsch, - LTE_eNB_DLSCH_t *dlsch1, - LTE_eNB_UE_stats *ue_stats, - int ra_flag) { + LTE_eNB_UE_stats *ue_stats) { int frame=proc->frame_tx; int subframe=proc->subframe_tx; LTE_DL_eNB_HARQ_t *dlsch_harq=dlsch->harq_processes[harq_pid]; @@ -266,27 +264,6 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, dlsch_harq->round); } - MSC_LOG_TX_MESSAGE( - MSC_PHY_ENB,MSC_PHY_UE, - NULL,0, - "%05u:%02u PDSCH/DLSCH input size = %"PRIu16", G %d, nb_rb %"PRIu16", TBS %"PRIu16", pmi_alloc %"PRIx16", rv %"PRIu8" (round %"PRIu8")", - frame, subframe, - dlsch_harq->TBS/8, - get_G(fp, - dlsch_harq->nb_rb, - dlsch_harq->rb_alloc, - dlsch_harq->Qm, - dlsch_harq->Nl, - dlsch_harq->pdsch_start, - frame, - subframe, - dlsch_harq->mimo_mode==TM7?7:0), - dlsch_harq->nb_rb, - dlsch_harq->TBS, - pmi2hex_2Ar1(dlsch_harq->pmi_alloc), - dlsch_harq->rvidx, - dlsch_harq->round); - if (ue_stats) ue_stats->dlsch_sliding_cnt++; if (dlsch_harq->round == 0) { @@ -301,15 +278,17 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, #endif } - if (dlsch->rnti!=0xffff) LOG_D(PHY,"Generating DLSCH/PDSCH pdu:%p pdsch_start:%d frame:%d subframe:%d nb_rb:%d rb_alloc:%d Qm:%d Nl:%d round:%d\n", - dlsch_harq->pdu,dlsch_harq->pdsch_start,frame,subframe,dlsch_harq->nb_rb,dlsch_harq->rb_alloc[0],dlsch_harq->Qm,dlsch_harq->Nl,dlsch_harq->round); + if (dlsch->rnti!=0xffff) + LOG_D(PHY,"Generating DLSCH/PDSCH pdu:%p pdsch_start:%d frame:%d subframe:%d nb_rb:%d rb_alloc:%d Qm:%d Nl:%d round:%d\n", + dlsch_harq->pdu,dlsch_harq->pdsch_start,frame,subframe,dlsch_harq->nb_rb,dlsch_harq->rb_alloc[0], + dlsch_harq->Qm,dlsch_harq->Nl,dlsch_harq->round); // 36-212 if (NFAPI_MODE==NFAPI_MONOLITHIC || NFAPI_MODE==NFAPI_MODE_PNF) { // monolthic OR PNF - do not need turbo encoding on VNF if (dlsch_harq->pdu==NULL) { LOG_E(PHY,"dlsch_harq->pdu == NULL SFN/SF:%04d%d dlsch[rnti:%x] dlsch_harq[pdu:%p pdsch_start:%d Qm:%d Nl:%d round:%d nb_rb:%d rb_alloc[0]:%d]\n", frame,subframe,dlsch->rnti, dlsch_harq->pdu, dlsch_harq->pdsch_start,dlsch_harq->Qm,dlsch_harq->Nl,dlsch_harq->round,dlsch_harq->nb_rb,dlsch_harq->rb_alloc[0]); - return; + return false; } start_meas(&eNB->dlsch_encoding_stats); @@ -331,44 +310,57 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, if(eNB->dlsch_encoding_stats.p_time>500*3000 && opp_enabled == 1) { print_meas_now(&eNB->dlsch_encoding_stats,"total coding",stderr); } - - // 36-211 - start_meas(&eNB->dlsch_scrambling_stats); - dlsch_scrambling(fp, - 0, - dlsch, - harq_pid, - get_G(fp, - dlsch_harq->nb_rb, - dlsch_harq->rb_alloc, - dlsch_harq->Qm, - dlsch_harq->Nl, - dlsch_harq->pdsch_start, - frame,subframe, - 0), - 0, - frame, - subframe<<1); - stop_meas(&eNB->dlsch_scrambling_stats); - start_meas(&eNB->dlsch_modulation_stats); - dlsch_modulation(eNB, - eNB->common_vars.txdataF, - AMP, - frame, - subframe, - dlsch_harq->pdsch_start, - dlsch, - dlsch->ue_type==0 ? dlsch1 : (LTE_eNB_DLSCH_t *)NULL); - stop_meas(&eNB->dlsch_modulation_stats); - } - #ifdef PHY_TX_THREAD - dlsch->active[subframe] = 0; + dlsch->active[subframe] = 0; #else - dlsch->active = 0; + dlsch->active = 0; #endif - dlsch_harq->round++; - LOG_D(PHY,"Generating DLSCH/PDSCH dlsch_harq[round:%d]\n",dlsch_harq->round); + dlsch_harq->round++; + LOG_D(PHY,"Generated DLSCH dlsch_harq[round:%d]\n",dlsch_harq->round); + return true; + } + return false; +} + +void pdsch_procedures(PHY_VARS_eNB *eNB, + L1_rxtx_proc_t *proc, + int harq_pid, + LTE_eNB_DLSCH_t *dlsch, + LTE_eNB_DLSCH_t *dlsch1) { + int frame=proc->frame_tx; + int subframe=proc->subframe_tx; + LTE_DL_eNB_HARQ_t *dlsch_harq=dlsch->harq_processes[harq_pid]; + LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; + // 36-211 + start_meas(&eNB->dlsch_scrambling_stats); + dlsch_scrambling(fp, + 0, + dlsch, + harq_pid, + get_G(fp, + dlsch_harq->nb_rb, + dlsch_harq->rb_alloc, + dlsch_harq->Qm, + dlsch_harq->Nl, + dlsch_harq->pdsch_start, + frame,subframe, + 0), + 0, + frame, + subframe<<1); + stop_meas(&eNB->dlsch_scrambling_stats); + start_meas(&eNB->dlsch_modulation_stats); + dlsch_modulation(eNB, + eNB->common_vars.txdataF, + AMP, + frame, + subframe, + dlsch_harq->pdsch_start, + dlsch, + dlsch->ue_type==0 ? dlsch1 : (LTE_eNB_DLSCH_t *)NULL); + stop_meas(&eNB->dlsch_modulation_stats); + + LOG_D(PHY,"Generated PDSCH dlsch_harq[round:%d]\n",dlsch_harq->round); } @@ -532,14 +524,18 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, dlsch0->harq_ids[frame%2][6], dlsch0->harq_ids[frame%2][7]); } else { - // generate pdsch - pdsch_procedures(eNB, + if (dlsch_procedures(eNB, proc, harq_pid, dlsch0, - dlsch1, - &eNB->UE_stats[(uint32_t)UE_id], - 0); + &eNB->UE_stats[(uint32_t)UE_id])) { + // if we generate dlsch, we must generate pdsch + pdsch_procedures(eNB, + proc, + harq_pid, + dlsch0, + dlsch1); + } } } else if ((dlsch0)&&(dlsch0->rnti>0)&& #ifdef PHY_TX_THREAD diff --git a/openair1/SCHED/ru_procedures.c b/openair1/SCHED/ru_procedures.c index fadea8bf26..78475e986b 100644 --- a/openair1/SCHED/ru_procedures.c +++ b/openair1/SCHED/ru_procedures.c @@ -72,12 +72,13 @@ void feptx0(RU_t *ru, LTE_DL_FRAME_PARMS *fp = ru->frame_parms; //int dummy_tx_b[7680*2] __attribute__((aligned(32))); - unsigned int aa,slot_offset; + unsigned int aa, slot_offset; int slot_sizeF = (fp->ofdm_symbol_size) * ((fp->Ncp==1) ? 6 : 7); + int subframe = ru->proc.tti_tx; //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+slot , 1 ); - slot_offset = slot*(fp->samples_per_tti>>1); + slot_offset = slot*(fp->samples_per_tti>>1); //slot_offset = subframe*fp->samples_per_tti + (slot*(fp->samples_per_tti>>1)); //LOG_D(PHY,"SFN/SF:RU:TX:%d/%d Generating slot %d\n",ru->proc.frame_tx, ru->proc.subframe_tx,slot); @@ -88,10 +89,35 @@ void feptx0(RU_t *ru, 6, fp->nb_prefix_samples, CYCLIC_PREFIX); - else normal_prefix_mod(&ru->common.txdataF_BF[aa][(slot&1)*slot_sizeF], - (int*)&ru->common.txdata[aa][slot_offset], - 7, - fp); + else { + /* AssertFatal(ru->generate_dmrs_sync==1 && (fp->frame_type != TDD || ru->is_slave == 1), + "ru->generate_dmrs_sync should not be set, frame_type %d, is_slave %d\n", + fp->frame_type,ru->is_slave); + */ + int num_symb = 7; + + if (subframe_select(fp,subframe) == SF_S) num_symb=fp->dl_symbols_in_S_subframe+1; + + if (ru->generate_dmrs_sync == 1 && slot == 0 && subframe == 1 && aa==0) { + //int32_t dmrs[ru->frame_parms.ofdm_symbol_size*14] __attribute__((aligned(32))); + //int32_t *dmrsp[2] ={dmrs,NULL}; //{&dmrs[(3-ru->frame_parms.Ncp)*ru->frame_parms.ofdm_symbol_size],NULL}; + generate_drs_pusch((PHY_VARS_UE *)NULL, + (UE_rxtx_proc_t*)NULL, + fp, + ru->common.txdataF_BF, + 0, + AMP, + 0, + 0, + fp->N_RB_DL, + aa); + } + normal_prefix_mod(&ru->common.txdataF_BF[aa][(slot&1)*slot_sizeF], + (int*)&ru->common.txdata[aa][slot_offset], + num_symb, + fp); + } + /* len = fp->samples_per_tti>>1; diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index d6b947264d..eab194656c 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -2468,7 +2468,7 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t thread_id) { - NR_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; + //NR_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; NR_UE_ULSCH_t *ulsch_ue; NR_UL_UE_HARQ_t *harq_process_ul_ue; //int32_t ulsch_start=0; diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 1499bdea8b..d04403d43c 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -917,8 +917,7 @@ int main(int argc, char **argv) { if (transmission_mode>1) pa=dBm3; printf("dlsim: tmode %d, pa %d\n",transmission_mode,pa); - AssertFatal(load_configmodule(argc,argv, CONFIG_ENABLECMDLINEONLY) != NULL, - "cannot load configuration module, exiting\n"); + AssertFatal(load_configmodule(argc,argv, CONFIG_ENABLECMDLINEONLY) != NULL, "Cannot load configuration module, exiting\n"); logInit(); set_glog_onlinelog(true); // enable these lines if you need debug info diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 2c4128a80c..8cd9b98bb7 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -393,8 +393,7 @@ int main(int argc, char **argv) { cpuf = cpu_freq_GHz; set_parallel_conf("PARALLEL_SINGLE_THREAD"); printf("Detected cpu_freq %f GHz\n",cpu_freq_GHz); - AssertFatal(load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) != NULL, - "cannot load configuration module, exiting\n"); + AssertFatal(load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) != NULL, "Cannot load configuration module, exiting\n"); logInit(); set_glog(OAILOG_WARNING); T_stdout = 1; diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 96ce702e44..b67ff3a618 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -170,7 +170,7 @@ int main(int argc, char **argv) { cpuf = get_cpu_freq_GHz(); if (load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY) == 0) { - exit_fun("[SOFTMODEM] Error, configuration module init failed\n"); + exit_fun("[NR_DLSCHSIM] Error, configuration module init failed\n"); } //logInit(); diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 8f20998ffb..0605c07163 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -196,7 +196,7 @@ int main(int argc, char **argv) cpuf = get_cpu_freq_GHz(); if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0) { - exit_fun("[SOFTMODEM] Error, configuration module init failed\n"); + exit_fun("[NR_DLSIM] Error, configuration module init failed\n"); } randominit(0); diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 57ce2dc0aa..ba1e7b027b 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -146,7 +146,7 @@ int main(int argc, char **argv) cpuf = get_cpu_freq_GHz(); if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0) { - exit_fun("[SOFTMODEM] Error, configuration module init failed\n"); + exit_fun("[NR_PBCHSIM] Error, configuration module init failed\n"); } randominit(0); diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 2c96f33495..3d3af603dd 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -104,7 +104,7 @@ int main(int argc, char **argv) uint64_t SSB_positions=0x01; channel_desc_t *gNB2UE; int format=0; - uint8_t extended_prefix_flag=0; + //uint8_t extended_prefix_flag=0; FILE *input_fd=NULL; uint8_t nacktoack_flag=0; int16_t amp=0x7FFF; @@ -121,20 +121,22 @@ int main(int argc, char **argv) int N_RB_DL=273,mu=1; float target_error_rate=0.01; int frame_length_complex_samples; - int frame_length_complex_samples_no_prefix; + //int frame_length_complex_samples_no_prefix; NR_DL_FRAME_PARMS *frame_parms; - unsigned char frame_type = 0; + //unsigned char frame_type = 0; int loglvl=OAILOG_WARNING; cpuf = get_cpu_freq_GHz(); - if ( load_configmodule(argc,argv) == 0) { - exit_fun("[SOFTMODEM] Error, configuration module init failed\n"); + if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0) { + exit_fun("[NR_PUCCHSIM] Error, configuration module init failed\n"); } randominit(0); + logInit(); + set_glog(loglvl); - while ((c = getopt (argc, argv, "f:hA:pf:g:i:P:b:T:n:o:s:S:t:x:y:z:N:F:GR:d:IL")) != -1) { + while ((c = getopt (argc, argv, "f:hA:f:g:i:P:b:T:n:o:s:S:x:y:z:N:F:GR:IL")) != -1) { switch (c) { case 'f': //write_output_file=1; @@ -146,9 +148,7 @@ int main(int argc, char **argv) } break; - case 'd': - frame_type = 1; - break; + case 'g': switch((char)*optarg) { @@ -207,16 +207,19 @@ int main(int argc, char **argv) break; /* - case 't': + case 't': Td= atof(optarg); break; - */ + case 'p': extended_prefix_flag=1; break; - /* - case 'r': + case 'd': + frame_type = 1; + break; + + case 'r': ricean_factor = pow(10,-.1*atof(optarg)); if (ricean_factor>1) { printf("Ricean factor must be between 0 and 1\n"); @@ -317,10 +320,7 @@ int main(int argc, char **argv) exit (-1); break; } - } - logInit(); - set_glog(loglvl); - T_stdout = 1; + } if (snr1set==0) snr1 = snr0+10; @@ -386,7 +386,7 @@ int main(int argc, char **argv) } frame_length_complex_samples = frame_parms->samples_per_subframe*NR_NUMBER_OF_SUBFRAMES_PER_FRAME; - frame_length_complex_samples_no_prefix = frame_parms->samples_per_subframe_wCP; + //frame_length_complex_samples_no_prefix = frame_parms->samples_per_subframe_wCP; s_re = malloc(2*sizeof(double*)); s_im = malloc(2*sizeof(double*)); diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index d80327e1bd..b2072e97e6 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -135,7 +135,7 @@ int main(int argc, char **argv) { cpuf = get_cpu_freq_GHz(); if (load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY) == 0) { - exit_fun("[SOFTMODEM] Error, configuration module init failed\n"); + exit_fun("[NR_ULSCHSIM] Error, configuration module init failed\n"); } //logInit(); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 51e03f1f53..817a3e93c7 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -188,7 +188,7 @@ int main(int argc, char **argv) { if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0 ) { - exit_fun("[SOFTMODEM] Error, configuration module init failed\n"); + exit_fun("[NR_ULSIM] Error, configuration module init failed\n"); } //logInit(); @@ -477,17 +477,17 @@ int main(int argc, char **argv) { rel15_ul->ulsch_pdu_rel15.n_layers = precod_nbr_layers; /////////////////////////////////////////////////// - nr_scheduled_response_t scheduled_response; fapi_nr_ul_config_request_t ul_config; //fapi_nr_tx_request_t tx_request; + /*nr_scheduled_response_t scheduled_response; scheduled_response.module_id = 0; scheduled_response.CC_id = 0; scheduled_response.frame = frame; scheduled_response.slot = slot; scheduled_response.dl_config = NULL; scheduled_response.ul_config = &ul_config; - scheduled_response.dl_config = NULL; + scheduled_response.dl_config = NULL;*/ ul_config.sfn_slot = slot; diff --git a/openair1/SIMULATION/TOOLS/channel_sim.c b/openair1/SIMULATION/TOOLS/channel_sim.c index eb0bf21609..c5628fbcef 100644 --- a/openair1/SIMULATION/TOOLS/channel_sim.c +++ b/openair1/SIMULATION/TOOLS/channel_sim.c @@ -40,7 +40,6 @@ #include "PHY_INTERFACE/phy_interface_extern.h" #include "UTIL/OCG/OCG.h" #include "UTIL/OPT/opt.h" // to test OPT - #include "UTIL/FIFO/types.h" #define RF @@ -48,19 +47,16 @@ //#define DEBUG_SIM 1 - - void do_DL_sig(sim_t *sim, - uint16_t subframe, - uint32_t offset, - uint32_t length, - uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *ue_frame_parms, - uint8_t UE_id, - int CC_id) + uint16_t subframe, + uint32_t offset, + uint32_t length, + uint8_t abstraction_flag, + LTE_DL_FRAME_PARMS *ue_frame_parms, + uint8_t UE_id, + int CC_id) { - int32_t **txdata,**rxdata; - uint32_t ru_id=0; double tx_pwr; double rx_pwr; @@ -301,13 +297,14 @@ void do_DL_sig(sim_t *sim, } - - void do_UL_sig(sim_t *sim, - uint16_t subframe,uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms, - uint32_t frame,int ru_id,uint8_t CC_id) + uint16_t subframe, + uint8_t abstraction_flag, + LTE_DL_FRAME_PARMS *frame_parms, + uint32_t frame, + int ru_id, + uint8_t CC_id) { - int32_t **txdata,**rxdata; uint8_t UE_id=0; @@ -477,9 +474,4 @@ void do_UL_sig(sim_t *sim, UNUSED_VARIABLE(rx_pwr); UNUSED_VARIABLE(rx_pwr2); #endif - } - - - - diff --git a/openair1/SIMULATION/TOOLS/random_channel.c b/openair1/SIMULATION/TOOLS/random_channel.c index 8341c574da..f056d51b5d 100644 --- a/openair1/SIMULATION/TOOLS/random_channel.c +++ b/openair1/SIMULATION/TOOLS/random_channel.c @@ -1204,6 +1204,10 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx, return(chan_desc); } +void free_channel_desc_scm(channel_desc_t * ch) { + // Must be made cleanly, a lot of leaks... + free(ch); +} int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) { diff --git a/openair2/COMMON/x2ap_messages_types.h b/openair2/COMMON/x2ap_messages_types.h index d284f4d0b9..5a35b85fdb 100644 --- a/openair2/COMMON/x2ap_messages_types.h +++ b/openair2/COMMON/x2ap_messages_types.h @@ -205,7 +205,7 @@ typedef struct x2ap_handover_req_s { x2ap_lastvisitedcell_info_t lastvisitedcell_info; - uint8_t rrc_buffer[1024 /* arbitrary, big enough */]; + uint8_t rrc_buffer[8192 /* arbitrary, big enough */]; int rrc_buffer_size; int target_assoc_id; diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index ed931b575d..1ca6f2d7ec 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -111,7 +111,12 @@ typedef enum { #define RU_GNB_LIST_IDX 14 #define RU_ATT_TX_IDX 15 #define RU_ATT_RX_IDX 16 -#define RU_NBIOTRRC_LIST_IDX 17 +#define RU_IS_SLAVE_IDX 17 +#define RU_NBIOTRRC_LIST_IDX 18 +#define RU_SDR_ADDRS 19 +#define RU_SDR_CLK_SRC 20 +#define RU_SF_EXTENSION_IDX 21 +#define RU_END_OF_BURST_DELAY_IDX 22 diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 9fe0cc859c..78a94e5245 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -116,6 +116,10 @@ extern int rrc_eNB_process_security(const protocol_ctxt_t *const ctxt_pP, rrc_eN extern void process_eNB_security_key (const protocol_ctxt_t *const ctxt_pP, rrc_eNB_ue_context_t *const ue_context_pP, uint8_t *security_key_pP); extern int derive_keNB_star(const uint8_t *kenb_32, const uint16_t pci, const uint32_t earfcn_dl, const bool is_rel8_only, uint8_t * kenb_star); +pthread_mutex_t rrc_release_freelist; +RRC_release_list_t rrc_release_info; +pthread_mutex_t lock_ue_freelist; + void openair_rrc_on( const protocol_ctxt_t *const ctxt_pP @@ -4610,10 +4614,10 @@ rrc_eNB_generate_HandoverPreparationInformation( uint8_t *buffer, int *_size ) { - memset(buffer, 0, RRC_BUF_SIZE); + memset(buffer, 0, 8192); char *ho_buf = (char *) buffer; int ho_size; - ho_size = do_HandoverPreparation(ho_buf, 1024, ue_context_pP->ue_context.UE_Capability, ue_context_pP->ue_context.UE_Capability_size); + ho_size = do_HandoverPreparation(ho_buf, 8192, ue_context_pP->ue_context.UE_Capability, ue_context_pP->ue_context.UE_Capability_size); *_size = ho_size; } diff --git a/openair2/RRC/LTE/rrc_proto.h b/openair2/RRC/LTE/rrc_proto.h index e7e5e71d80..a8ee7ecabe 100644 --- a/openair2/RRC/LTE/rrc_proto.h +++ b/openair2/RRC/LTE/rrc_proto.h @@ -667,9 +667,11 @@ void openair_rrc_top_init_ue( uint8_t cba_group_active, uint8_t HO_active ); -pthread_mutex_t rrc_release_freelist; -RRC_release_list_t rrc_release_info; -pthread_mutex_t lock_ue_freelist; + +extern pthread_mutex_t rrc_release_freelist; +extern RRC_release_list_t rrc_release_info; +extern pthread_mutex_t lock_ue_freelist; + void remove_UE_from_freelist(module_id_t mod_id, rnti_t rnti); void put_UE_in_freelist(module_id_t mod_id, rnti_t rnti, boolean_t removeFlag); void release_UE_in_freeList(module_id_t mod_id); diff --git a/openair2/X2AP/x2ap_eNB_handler.c b/openair2/X2AP/x2ap_eNB_handler.c index 2a44501a33..41d92a695e 100644 --- a/openair2/X2AP/x2ap_eNB_handler.c +++ b/openair2/X2AP/x2ap_eNB_handler.c @@ -730,7 +730,7 @@ int x2ap_eNB_handle_handover_preparation (instance_t instance, X2AP_RRC_Context_t *c = &ie->value.choice.UE_ContextInformation.rRC_Context; - if (c->size > 1024 /* TODO: this is the size of rrc_buffer in struct x2ap_handover_req_ack_s*/) + if (c->size > 8192 /* TODO: this is the size of rrc_buffer in struct x2ap_handover_req_s */) { printf("%s:%d: fatal: buffer too big\n", __FILE__, __LINE__); abort(); } memcpy(X2AP_HANDOVER_REQ(msg).rrc_buffer, c->buf, c->size); @@ -821,7 +821,7 @@ int x2ap_eNB_handle_handover_response (instance_t instance, X2AP_TargeteNBtoSource_eNBTransparentContainer_t *c = &ie->value.choice.TargeteNBtoSource_eNBTransparentContainer; - if (c->size > 1024 /* TODO: this is the size of rrc_buffer in struct x2ap_handover_req_ack_s*/) + if (c->size > 1024 /* TODO: this is the size of rrc_buffer in struct x2ap_handover_req_ack_s */) { printf("%s:%d: fatal: buffer too big\n", __FILE__, __LINE__); abort(); } memcpy(X2AP_HANDOVER_REQ_ACK(msg).rrc_buffer, c->buf, c->size); diff --git a/openair3/SCTP/sctp_default_values.h b/openair3/SCTP/sctp_default_values.h index 5008ea0b72..528ffb5a05 100644 --- a/openair3/SCTP/sctp_default_values.h +++ b/openair3/SCTP/sctp_default_values.h @@ -26,6 +26,6 @@ #define SCTP_IN_STREAMS (16) #define SCTP_MAX_ATTEMPTS (2) #define SCTP_TIMEOUT (5) -#define SCTP_RECV_BUFFER_SIZE (1024) +#define SCTP_RECV_BUFFER_SIZE (8192) #endif /* SCTP_DEFAULT_VALUES_H_ */ diff --git a/openair3/SCTP/sctp_eNB_task.c b/openair3/SCTP/sctp_eNB_task.c index d8bf09a13c..cec8802f25 100644 --- a/openair3/SCTP/sctp_eNB_task.c +++ b/openair3/SCTP/sctp_eNB_task.c @@ -956,6 +956,11 @@ sctp_eNB_read_from_socket( return; } + if (!(flags & MSG_EOR)) { + SCTP_ERROR("fatal: partial SCTP messages are not handled\n"); + exit(1); + } + if (flags & MSG_NOTIFICATION) { union sctp_notification *snp; snp = (union sctp_notification *)buffer; diff --git a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h index 31a7173630..c9d0027bf2 100644 --- a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h +++ b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h @@ -27,7 +27,7 @@ #include #include "common_lib.h" -#include "log.h" +#include "LOG/log.h" /** @addtogroup _BLADERF_PHY_RF_INTERFACE_ * @{ diff --git a/targets/ARCH/COMMON/common_lib.c b/targets/ARCH/COMMON/common_lib.c index c6cb4a50c1..192578dea6 100644 --- a/targets/ARCH/COMMON/common_lib.c +++ b/targets/ARCH/COMMON/common_lib.c @@ -122,7 +122,7 @@ int load_lib(openair0_device *device, if ( IS_SOFTMODEM_BASICSIM ) { libname=OAI_BASICSIM_LIBNAME; shlib_fdesc[0].fname="device_init"; - } else if ( IS_SOFTMODEM_RFSIM ) { + } else if (IS_SOFTMODEM_RFSIM && flag == RAU_LOCAL_RADIO_HEAD) { libname=OAI_RFSIM_LIBNAME; shlib_fdesc[0].fname="device_init"; } else if (flag == RAU_LOCAL_RADIO_HEAD) { diff --git a/targets/ARCH/COMMON/common_lib.h b/targets/ARCH/COMMON/common_lib.h index f16ebed66c..603ee67ed3 100644 --- a/targets/ARCH/COMMON/common_lib.h +++ b/targets/ARCH/COMMON/common_lib.h @@ -100,7 +100,6 @@ typedef enum { /*!\brief device is UEDv2 */ UEDv2_DEV, MAX_RF_DEV_TYPE - } dev_type_t; /*!\brief transport protocol types @@ -112,7 +111,6 @@ typedef enum { /*!\brief no transport protocol*/ NONE_TP, MAX_TRANSP_TYPE - } transport_type_t; @@ -124,7 +122,6 @@ typedef enum { /*!\brief device functions within a RRU */ RRU_HOST, MAX_HOST_TYPE - } host_type_t; @@ -183,7 +180,6 @@ typedef struct { //! \brief memory //! \brief Pointer to Calibration table for RX gains rx_gain_calib_table_t *rx_gain_calib_table; - //! mode for rxgain (ExpressMIMO2) rx_gain_t rxg_mode[4]; //! \brief Gain for RX in dB. @@ -230,7 +226,6 @@ typedef struct { unsigned int sf_write_delay; // write delay in replay mode unsigned int eth_mtu; // ethernet MTU #endif - //! number of samples per tti unsigned int samples_per_tti; //! the sample rate for receive. @@ -239,7 +234,6 @@ typedef struct { double tx_sample_rate; //! check for threequarter sampling rate int8_t threequarter_fs; - } openair0_config_t; /*! \brief RF mapping */ @@ -271,7 +265,6 @@ typedef struct { uint8_t if_compress; } eth_params_t; - typedef struct { //! Tx buffer for if device, keep one per subframe now to allow multithreading void *tx[10]; @@ -281,7 +274,6 @@ typedef struct { void *rx; } if_buffer_t; - /*!\brief structure holds the parameters to configure USRP devices */ struct openair0_device_t { /*!brief Module ID of this device */ @@ -456,24 +448,11 @@ typedef struct { #define sample_t struct complex16 // 2*16 bits complex number -typedef struct { - uint64_t magic; // Magic value (see defines above) - uint32_t size; // Number of samples per antenna to follow this header - uint32_t nbAnt; // Total number of antennas following this header - // Samples per antenna follow this header, - // i.e. nbAnt = 2 => this header+samples_antenna_0+samples_antenna_1 - // data following this header in bytes is nbAnt*size*sizeof(sample_t) - uint64_t timestamp; // Timestamp value of first sample - uint32_t option_value; // Option value - uint32_t option_flag; // Option flag -} samplesBlockHeader_t; - #ifdef __cplusplus extern "C" { #endif - /*! \brief Initialize openair RF target. It returns 0 if OK */ int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg); /*! \brief Initialize transport protocol . It returns 0 if OK */ diff --git a/targets/ARCH/rfsimulator/simulator.c b/targets/ARCH/rfsimulator/simulator.c index 37a512f8fc..1acaa69050 100644 --- a/targets/ARCH/rfsimulator/simulator.c +++ b/targets/ARCH/rfsimulator/simulator.c @@ -85,7 +85,8 @@ typedef struct { either we regenerate the channel (call again random_channel(desc,0)), or we keep it over subframes legacy: we regenerate each sub frame in UL, and each frame only in DL */ -void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_sig, +void rxAddInput( struct complex16 *input_sig, + struct complex16 *after_channel_sig, int rxAnt, channel_desc_t *channelDesc, int nbSamples, @@ -106,7 +107,7 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si // −132.24 dBm is a LTE subcarrier noise, that was used in origin code (15KHz BW thermal noise) const double rxGain = 132.24 - snr_dB; // sqrt(4*noise_figure_watt) is the thermal noise factor (volts) - // fixme: the last constant is pure trial results to make decent noise + // fixme: the last constant is pure trial results to make decent noise const double noise_per_sample = sqrt(4*noise_figure_watt) * pow(10,rxGain/20) *10; // Fixme: we don't fill the offset length samples at begining ? // anyway, in today code, channel_offset=0 @@ -135,9 +136,6 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si } out_ptr->r += round(rx_tmp.x*pathLossLinear + noise_per_sample*gaussdouble(0.0,1.0)); - printf("in: %d, out %d= %f*%f + %f*%f\n", - input_sig[((TS+i)*nbTx)%CirSize].r, out_ptr->r , rx_tmp.x, - pathLossLinear, noise_per_sample,gaussdouble(0.0,1.0)); out_ptr->i += round(rx_tmp.y*pathLossLinear + noise_per_sample*gaussdouble(0.0,1.0)); out_ptr++; } @@ -325,17 +323,17 @@ sin_addr: return 0; } -uint64_t lastW=-1; int rfsimulator_write(openair0_device *device, openair0_timestamp timestamp, void **samplesVoid, int nsamps, int nbAnt, int flags) { rfsimulator_state_t *t = device->priv; LOG_D(HW,"sending %d samples at time: %ld\n", nsamps, timestamp); + for (int i=0; ibuf[i]; if (b->conn_sock >= 0 ) { if ( abs((double)b->lastWroteTS-timestamp) > (double)CirSize) - LOG_E(HW,"Tx/Rx shift too large Tx:%lu, Rx:%lu\n", b->lastWroteTS, b->lastReceivedTS); + LOG_E(HW,"Tx/Rx shift too large Tx:%lu, Rx:%lu\n", b->lastWroteTS, b->lastReceivedTS); samplesBlockHeader_t header= {t->typeStamp, nsamps, nbAnt, timestamp}; fullwrite(b->conn_sock,&header, sizeof(header), t); sample_t tmpSamples[nsamps][nbAnt]; @@ -354,7 +352,6 @@ int rfsimulator_write(openair0_device *device, openair0_timestamp timestamp, voi } } - lastW=timestamp; LOG_D(HW,"sent %d samples at time: %ld->%ld, energy in first antenna: %d\n", nsamps, timestamp, timestamp+nsamps, signal_energy(samplesVoid[0], nsamps) ); // Let's verify we don't have incoming data diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 05ba4100e7..8eb9303fd9 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -668,15 +668,12 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB, AssertFatal((ret=pthread_mutex_lock(&proc->mutex_RU_PRACH))==0,"mutex_lock return %d\n",ret); for (i=0; inum_RU; i++) { - if (ru == eNB->RU_list[i]) { - LOG_D(PHY,"frame %d, subframe %d: RU %d for eNB %d signals PRACH (mask %x, num_RU %d)\n",frame,subframe,i,eNB->Mod_id,proc->RU_mask_prach,eNB->num_RU); - - if ((proc->RU_mask_prach&(1< 0) - LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information (PRACH) from RU %d (num_RU %d, mask %x) has not been served yet!\n", - eNB->Mod_id,frame,subframe,ru->idx,eNB->num_RU,proc->RU_mask_prach); - - proc->RU_mask_prach |= (1<RU_list[i] && eNB->RU_list[i]->wait_cnt == 0) { + LOG_D(PHY,"frame %d, subframe %d: RU %d for eNB %d signals PRACH (mask %x, num_RU %d)\n",frame,subframe,i,eNB->Mod_id,proc->RU_mask_prach,eNB->num_RU); + proc->RU_mask_prach |= (1<RU_list[i]->state == RU_SYNC || eNB->RU_list[i]->wait_cnt > 0) { + proc->RU_mask_prach |= (1<RU_mask_prach != (1<num_RU)-1) { // not all RUs have provided their information so return diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 5bc0d555e6..d33008c2fd 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -230,6 +230,7 @@ void fh_if4p5_south_in(RU_t *ru, if (proc->symbol_mask[*subframe]==0) { // this is normal case, if not true then we received a PULTICK before the previous subframe was finished do { recv_IF4p5(ru, &f, &sf, &packet_type, &symbol_number); + LOG_D(PHY,"fh_if4p5_south_in: RU %d, frame %d, subframe %d, f %d, sf %d\n",ru->idx,*frame,*subframe,f,sf); if (oai_exit == 1 || ru->cmd== STOP_RU) break; if (packet_type == IF4p5_PULFFT) proc->symbol_mask[sf] = proc->symbol_mask[sf] | (1<symbol_mask[*subframe]); - } while(proc->symbol_mask[*subframe] != symbol_mask_full); - } else { + LOG_D(PHY,"rx_fh_if4p5 for RU %d: subframe %d, sf %d, symbol mask %x\n",ru->idx,*subframe,sf,proc->symbol_mask[sf]); + } while(proc->symbol_mask[sf] != symbol_mask_full); + } + else { f = *frame; sf = *subframe; } @@ -517,8 +519,11 @@ void fh_if4p5_north_asynch_in(RU_t *ru, proc->first_tx = 0; symbol_mask_full = ((subframe_select(fp,*subframe) == SF_S) ? (1<dl_symbols_in_S_subframe) : (1<symbols_per_tti))-1; } else { - AssertFatal(frame_tx == *frame, "frame_tx %d is not what we expect %d\n", frame_tx, *frame); - AssertFatal(tti_tx == *subframe, "In frame_tx %d : tti_tx %d is not what we expect %d\n", frame_tx, tti_tx, *subframe); + /* AssertFatal(frame_tx == *frame, "frame_tx %d is not what we expect %d\n",frame_tx,*frame); + AssertFatal(subframe_tx == *subframe, "In frame_tx %d : subframe_tx %d is not what we expect %d\n",frame_tx,subframe_tx,*subframe); + */ + *frame = frame_tx; + *subframe = tti_tx; } if (packet_type == IF4p5_PDLFFT) { @@ -1810,7 +1815,7 @@ static void *ru_thread( void *param ) proc->instance_cnt_asynch_rxtx=0; pthread_cond_signal(&proc->cond_asynch_rxtx); AssertFatal((ret=pthread_mutex_unlock(&proc->mutex_asynch_rxtx))==0,"mutex_unlock returns %d\n",ret); - } else LOG_I(PHY,"RU %d no asynch_south interface\n",ru->idx); + } else LOG_D(PHY,"RU %d no asynch_south interface\n",ru->idx); // if this is a slave RRU, try to synchronize on the DL frequency if ((ru->is_slave == 1) && (ru->if_south == LOCAL_RF)) do_ru_synch(ru); @@ -2023,7 +2028,8 @@ void *ru_thread_synch(void *arg) &avg); LOG_I(PHY,"RU synch cnt %d: %d, val %llu (%d dB,%d dB)\n",cnt,ru->rx_offset,(unsigned long long)peak_val,dB_fixed64(peak_val),dB_fixed64(avg)); cnt++; - if (/*ru->rx_offset >= 0*/dB_fixed(peak_val)>=85 && cnt>10) { + //if (/*ru->rx_offset >= 0*/dB_fixed(peak_val)>=85 && cnt>10) { + if (ru->rx_offset >= 0 && avg>0 && dB_fixed(peak_val/avg)>=15 && cnt>10) { LOG_I(PHY,"Estimated peak_val %d dB, avg %d => timing offset %llu\n",dB_fixed(peak_val),dB_fixed(avg),(unsigned long long int)ru->rx_offset); ru->in_synch = 1; /* @@ -2793,7 +2799,7 @@ void init_RU(char *rf_config_file, // NOTE: multiple CC_id are not handled here yet! ru->openair0_cfg.clock_source = clock_source; ru->openair0_cfg.time_source = time_source; -// ru->generate_dmrs_sync = (ru->is_slave == 0) ? 1 : 0; + ru->generate_dmrs_sync = (ru->is_slave == 0) ? 1 : 0; if (ru->generate_dmrs_sync == 1) { generate_ul_ref_sigs(); ru->dmrssync = (int16_t*)malloc16_clear(ofdm_symbol_size*2*sizeof(int16_t)); @@ -3085,6 +3091,8 @@ void RCconfig_RU(void) RC.ru[j]->max_pdschReferenceSignalPower = *(RUParamList.paramarray[j][RU_MAX_RS_EPRE_IDX].uptr);; RC.ru[j]->max_rxgain = *(RUParamList.paramarray[j][RU_MAX_RXGAIN_IDX].uptr); RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt; + /* sf_extension is in unit of samples for 30.72MHz here, has to be scaled later */ + RC.ru[j]->sf_extension = *(RUParamList.paramarray[j][RU_SF_EXTENSION_IDX].uptr); for (i=0;inum_bands;i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i]; } //strcmp(local_rf, "yes") == 0 else { diff --git a/targets/RT/USER/rfsim.c b/targets/RT/USER/rfsim.c index b430dd0a81..8b3ee97e50 100644 --- a/targets/RT/USER/rfsim.c +++ b/targets/RT/USER/rfsim.c @@ -51,6 +51,7 @@ #include "common/ran_context.h" #include "PHY/defs_UE.h" #include "PHY/defs_eNB.h" +#include "PHY/defs_RU.h" #include "common/utils/LOG/vcd_signal_dumper.h" RAN_CONTEXT_t RC; @@ -286,10 +287,6 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void ** sim.last_UE_rx_timestamp[UE_id][CC_id] += read_size; sample_count += read_size; - - - - } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_UE_TRX_READ,0);