diff --git a/CMakeLists.txt b/CMakeLists.txt index 976fdd728e..6e8758cea3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -674,6 +674,8 @@ target_link_libraries(UTIL PUBLIC instrumentation) set(SECURITY_SRC ${OPENAIR3_DIR}/SECU/secu_defs.c + ${OPENAIR3_DIR}/SECU/curve_25519.c + ${OPENAIR3_DIR}/SECU/x963_kdf.c ${OPENAIR3_DIR}/SECU/kdf.c ${OPENAIR3_DIR}/SECU/aes_128_ctr.c ${OPENAIR3_DIR}/SECU/aes_128_cbc_cmac.c @@ -1911,7 +1913,7 @@ target_link_libraries(nr-uesoftmodem PRIVATE target_link_libraries(nr-uesoftmodem PRIVATE pthread m CONFIG_LIB rt nr_ue_phy_meas) target_link_libraries(nr-uesoftmodem PRIVATE ${T_LIB}) -target_link_libraries(nr-uesoftmodem PRIVATE nr_nas lib_uicc usim_lib) +target_link_libraries(nr-uesoftmodem PRIVATE nr_nas lib_uicc usim_lib SECURITY) target_link_libraries(nr-uesoftmodem PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) # force the generation of ASN.1 so that we don't need to wait during the build diff --git a/NOTICE b/NOTICE index 7140f68045..ff1b993a0b 100644 --- a/NOTICE +++ b/NOTICE @@ -1,10 +1,10 @@ -The source code is distributed under [**Collaborative Standards Software -License (CSSL) v1.0**](LICENSE). Some files, such as for orchestration, -are distributed under [MIT license](preferred)(MIT.txt). Documentation is -distributed under [Creative Commons Attribution 4.0 International -license](LICENSES/preferred/CC-BY-4.0.txt). +The source code is distributed under Collaborative Standards Software License +(CSSL) v1.0. Some files, such as for orchestration, are distributed under MIT +license. Documentation is distributed under Creative Commons Attribution 4.0 +International license. All the files without an explicit copyright header have +an implicit "Copyright of OpenAirInterface Authors". For more details of the license, refer to the `LICENSES` directory for a list of preferred and exceptionally-applied licenses. diff --git a/README.md b/README.md index a2c04443a2..fea38ece08 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,18 @@ Some files, such as for orchestration, are distributed under [MIT license](preferred)(MIT.txt). Documentation is distributed under [Creative Commons Attribution 4.0 International license](LICENSES/preferred/CC-BY-4.0.txt). -Please see [NOTICE](NOTICE.md) for other licenses which are used in the software. +All the files without an explicit copyright header have an implicit "Copyright +of OpenAirInterface Authors". + +Please see [NOTICE](NOTICE) for other licenses which are used in the software. + +In the past OAI source code has been re-licensed sometimes, here is the +history: + +1. CSSL v1.0 starting tag 2026.w14 +2. OAI Public License v1.1 starting tag v1.0 till af4b0d53 +3. OAI Public License v1.0: starting tag v.04 till v1.0 +4. GPL 3: starting tag v.0 till v.04 (only initial implementation of 4G) # Where to Start # diff --git a/ci-scripts/Jenkinsfile-GitLab-Container b/ci-scripts/Jenkinsfile-GitLab-Container index c54d0314d0..d75b1888d4 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Container +++ b/ci-scripts/Jenkinsfile-GitLab-Container @@ -34,9 +34,7 @@ pipeline { stage ("Verify Parameters") { steps { script { - JOB_TIMESTAMP = sh returnStdout: true, script: 'date --utc --rfc-3339=seconds | sed -e "s#+00:00##"' - JOB_TIMESTAMP = JOB_TIMESTAMP.trim() - + env.JOB_TIMESTAMP = sh(returnStdout: true, script: 'date --utc --rfc-3339=seconds | sed -e "s#+00:00##"').trim() echo '\u2705 \u001B[32mVerify Parameters\u001B[0m' def allParametersPresent = true @@ -112,6 +110,23 @@ pipeline { } } } + stage ("Local-Repo-Push") { + steps { + script { + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { + triggerSlaveJob ('RAN-Local-Repo-Push', 'Local-Repo-Push') + } + } + } + post { + failure { + script { + echo "Push to local repository KO" + failingStages += '\n * RAN-Local-Repo-Push' + } + } + } + } // Build Stages are Mandatory stage ("Image Building Processes") { when { expression {doBuild} } @@ -855,25 +870,22 @@ pipeline { // ---- Slave Job functions def triggerSlaveJob (jobName, gitlabStatusName) { - if ("MERGE".equals(env.gitlabActionType)) { - MR_NUMBER = env.gitlabMergeRequestIid - } else { - MR_NUMBER = 'develop' - } + def MR_NUMBER = "MERGE".equals(env.gitlabActionType) ? env.gitlabMergeRequestIid : 'develop' // Workaround for the "cancelled" GitLab pipeline notification // The slave job is triggered with the propagate false so the following commands are executed // Its status is now PASS/SUCCESS from a stage pipeline point of view // localStatus variable MUST be analyzed to properly assess the status - localStatus = build job: jobName, + def localStatus = build job: jobName, parameters: [ string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), + string(name: 'SourceRepo', value: String.valueOf(env.gitlabSourceRepoHttpUrl)), string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)), string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)), string(name: 'eNB_MR', value: String.valueOf(MR_NUMBER)), booleanParam(name: 'eNB_mergeRequest', value: "MERGE".equals(env.gitlabActionType)), string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch)) ], propagate: false - localResult = localStatus.getResult() + def localResult = localStatus.getResult() echo "${jobName} Slave Job status is ${localResult}" gitlabCommitStatus(name: gitlabStatusName) { if (localStatus.resultIsBetterOrEqualTo('SUCCESS')) { @@ -899,11 +911,11 @@ def triggerCN5GSlaveJob (jobName, gitlabStatusName) { // The slave job is triggered with the propagate false so the following commands are executed // Its status is now PASS/SUCCESS from a stage pipeline point of view // localStatus variable MUST be analyzed to properly assess the status - localStatus = build job: jobName, + def localStatus = build job: jobName, parameters: [ string(name: 'FULL_RAN_TAG', value: String.valueOf(fullRanTag)) ], propagate: false - localResult = localStatus.getResult() + def localResult = localStatus.getResult() echo "${jobName} Slave Job status is ${localResult}" gitlabCommitStatus(name: gitlabStatusName) { if (localStatus.resultIsBetterOrEqualTo('SUCCESS')) { @@ -914,34 +926,6 @@ def triggerCN5GSlaveJob (jobName, gitlabStatusName) { } } -def triggerSlaveJobNoGitLab (jobName) { - if ("MERGE".equals(env.gitlabActionType)) { - MR_NUMBER = env.gitlabMergeRequestIid - } else { - MR_NUMBER = 'develop' - } - // Workaround for the "cancelled" GitLab pipeline notification - // The slave job is triggered with the propagate false so the following commands are executed - // Its status is now PASS/SUCCESS from a stage pipeline point of view - // localStatus variable MUST be analyzed to properly assess the status - localStatus = build job: jobName, - parameters: [ - string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), - string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)), - string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)), - string(name: 'eNB_MR', value: String.valueOf(MR_NUMBER)), - booleanParam(name: 'eNB_mergeRequest', value: "MERGE".equals(env.gitlabActionType)), - string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch)) - ], propagate: false - localResult = localStatus.getResult() - echo "${jobName} Slave Job status is ${localResult}" - if (localStatus.resultIsBetterOrEqualTo('SUCCESS')) { - echo "${jobName} Slave Job is OK" - } else { - error "${jobName} Slave Job is KO" - } -} - def finalizeSlaveJob(jobName) { lock ('Parent-Lock') { // In case of any non-success, we are retrieving the HTML report of the last completed @@ -957,7 +941,7 @@ def finalizeSlaveJob(jobName) { filter: 'test_results*.html', selector: lastCompleted()) if (fileExists(fileName)) { - sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' ${fileName}" + sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${env.JOB_TIMESTAMP}#' ${fileName}" } else { sh "echo \"could not copy results from ${jobName}, please check pipeline ${BUILD_URL}\" > ${fileName}" } diff --git a/ci-scripts/Jenkinsfile-push-local-repo b/ci-scripts/Jenkinsfile-push-local-repo new file mode 100644 index 0000000000..6a5ffd7e43 --- /dev/null +++ b/ci-scripts/Jenkinsfile-push-local-repo @@ -0,0 +1,103 @@ +#!/bin/groovy +/* + * SPDX-License-Identifier: LicenseRef-CSSL-1.0 + */ + +// Location of the python executor node shall be in the same subnet as the others servers +def nodeExecutor = params.nodeExecutor + +// SSH URL of the internal git repository +def internalRepoURL = params.internalRepoURL + +// Name of the resource +def lockResources = [] +if (params.LockResources != null && params.LockResources.trim().length() > 0) + params.LockResources.trim().split(",").each{lockResources += [resource: it.trim()]} + +pipeline { + agent { + label nodeExecutor + } + options { + ansiColor('xterm') + lock(extra: lockResources) + } + stages { + stage('Verify parameters') { + steps { + script { + def missingParams = [] + if (!params.SourceRepo?.trim()) { missingParams << 'SourceRepo' } + if (!params.eNB_Branch?.trim()) { missingParams << 'eNB_Branch' } + if (!params.eNB_CommitID?.trim()) { missingParams << 'eNB_CommitID' } + if (!params.eNB_TargetBranch?.trim()) { missingParams << 'eNB_TargetBranch' } + if (!params.eNB_Repository?.trim()) { missingParams << 'eNB_Repository' } + + if (missingParams) { + error "Missing required parameters: ${missingParams.join(', ')}" + } + + echo "Source Repo : ${params.SourceRepo}" + echo "Source Branch : ${params.eNB_Branch}" + echo "Source Commit : ${params.eNB_CommitID}" + echo "Target Branch : ${params.eNB_TargetBranch}" + echo "Target Repo : ${params.eNB_Repository}" + } + } + } + stage('Prepare workspace') { + steps { + sh """ + git config user.email "jenkins@openairinterface.org" + git config user.name "OAI Jenkins" + git remote remove source || true + git remote remove internal-repo || true + """ + } + } + stage('Add source repo & fetch branches') { + steps { + sh """ + git remote add source ${params.SourceRepo} || true + git fetch source ${params.eNB_Branch} + git fetch origin ${params.eNB_TargetBranch} + """ + } + } + stage('Create temporary branch for CI') { + steps { + script { + def shortCommit = params.eNB_CommitID.take(8) + env.NEW_BRANCH = "${params.eNB_Branch}-${shortCommit}" + echo "New branch: ${env.NEW_BRANCH}" + } + sh """ + # Checkout source commit + git checkout -B ${env.NEW_BRANCH} ${params.eNB_CommitID} + """ + } + } + stage('Merge target into source') { + steps { + sh """ + echo "Merging target branch ${params.eNB_TargetBranch} into source branch ${env.NEW_BRANCH}" + if ! git merge --ff origin/${params.eNB_TargetBranch} \ + -m "Merge ${params.eNB_TargetBranch} into ${params.eNB_Branch} for CI"; then + echo "Merge conflicts detected. Aborting." + git merge --abort || true + exit 1 + fi + """ + } + } + stage('Push merged branch to internal repository') { + steps { + sh """ + git remote add internal-repo ${internalRepoURL} || true + echo "Pushing ${env.NEW_BRANCH} to internal repo" + git push --force internal-repo ${env.NEW_BRANCH} + """ + } + } + } +} diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 503d80eabc..c7831136e2 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -483,10 +483,10 @@ class Containerize(): HTML.CreateHtmlTestRow('commit ' + tag, 'KO', CONST.ALL_PROCESSES_OK) return False - def BuildRunTests(self, ctx, node, HTML): + def BuildRunTests(self, ctx, node, dockerfile, runtime_opt, ctest_opt, HTML): lSourcePath = self.eNBSourceCodePath logging.debug('Building on server: ' + node) - cmd = cls_cmd.RemoteCmd(node) + cmd = cls_cmd.getConnection(node) cmd.cd(lSourcePath) ret = cmd.run('hostnamectl') @@ -513,9 +513,9 @@ class Containerize(): return False # build ran-unittests image - dockerfile = "ci-scripts/docker/Dockerfile.unittest.ubuntu" logfile = f'{lSourcePath}/cmake_targets/log/unittest-build.log' - ret = cmd.run(f'docker build --progress=plain --tag ran-unittests:{baseTag} --file {dockerfile} . &> {logfile}') + ret = cmd.run(f'docker build --progress=plain --tag ran-unittests:{baseTag} --file ci-scripts/{dockerfile} . &> {logfile}') + archiveArtifact(cmd, ctx, logfile) if ret.returncode != 0: logging.error(f'Cannot build unit tests') @@ -528,7 +528,7 @@ class Containerize(): # I would like to run it with --rm and mount the ctest result directory to avoid 'docker cp' # below, but then permissions are messed up and we can't remove the directory without sudo # making the next pipeline fail - ret = cmd.run(f'docker run -a STDOUT --workdir /oai-ran/build/ --env LD_LIBRARY_PATH=/oai-ran/build/ --name ran-unittests ran-unittests:{baseTag} ctest --no-label-summary -j$(nproc)') + ret = cmd.run(f'docker run -a STDOUT {runtime_opt} --workdir /oai-ran/build/ --env LD_LIBRARY_PATH=/oai-ran/build/ --name ran-unittests ran-unittests:{baseTag} ctest --no-label-summary -j$(nproc) {ctest_opt}') cmd.run('docker cp ran-unittests:/oai-ran/build/Testing/Temporary/LastTest.log .') archiveArtifact(cmd, ctx, f'{lSourcePath}/LastTest.log') cmd.run('docker cp ran-unittests:/oai-ran/build/Testing/Temporary/LastTestsFailed.log .') diff --git a/ci-scripts/conf_files/gnb-du.sa.band1.52prb.usrpb210.conf b/ci-scripts/conf_files/gnb-du.sa.band1.52prb.usrpb210.conf index 84dbc98add..9bf0aa8980 100644 --- a/ci-scripts/conf_files/gnb-du.sa.band1.52prb.usrpb210.conf +++ b/ci-scripts/conf_files/gnb-du.sa.band1.52prb.usrpb210.conf @@ -157,7 +157,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "f1"; local_n_address = "127.0.0.5"; @@ -171,7 +170,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 200; pucch0_dtx_threshold = 150; diff --git a/ci-scripts/conf_files/gnb-du.sa.band78.106prb.rfsim.conf b/ci-scripts/conf_files/gnb-du.sa.band78.106prb.rfsim.conf index 74d9a4a5c3..d31988f1f1 100644 --- a/ci-scripts/conf_files/gnb-du.sa.band78.106prb.rfsim.conf +++ b/ci-scripts/conf_files/gnb-du.sa.band78.106prb.rfsim.conf @@ -162,7 +162,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "f1"; local_n_address = "192.168.71.171"; @@ -176,7 +175,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 200; pucch0_dtx_threshold = 150; diff --git a/ci-scripts/conf_files/gnb-du.sa.band78.106prb.usrpb200.conf b/ci-scripts/conf_files/gnb-du.sa.band78.106prb.usrpb200.conf index e6da89d239..d811c47c84 100644 --- a/ci-scripts/conf_files/gnb-du.sa.band78.106prb.usrpb200.conf +++ b/ci-scripts/conf_files/gnb-du.sa.band78.106prb.usrpb200.conf @@ -191,7 +191,6 @@ rlc = { MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "f1"; local_n_address = "127.0.0.5"; @@ -205,7 +204,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 200; pucch0_dtx_threshold = 30; diff --git a/ci-scripts/conf_files/gnb-du.sa.band78.51prb.usrpb210.ho-pci0.conf b/ci-scripts/conf_files/gnb-du.sa.band78.51prb.usrpb210.ho-pci0.conf index 63089de024..9dc16a527f 100644 --- a/ci-scripts/conf_files/gnb-du.sa.band78.51prb.usrpb210.ho-pci0.conf +++ b/ci-scripts/conf_files/gnb-du.sa.band78.51prb.usrpb210.ho-pci0.conf @@ -156,7 +156,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "f1"; local_n_address = "172.21.19.98"; @@ -171,7 +170,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 100; pucch0_dtx_threshold = 10; diff --git a/ci-scripts/conf_files/gnb-du.sa.band78.51prb.usrpb210.ho-pci1.conf b/ci-scripts/conf_files/gnb-du.sa.band78.51prb.usrpb210.ho-pci1.conf index 775cacc16d..4b31453a8f 100644 --- a/ci-scripts/conf_files/gnb-du.sa.band78.51prb.usrpb210.ho-pci1.conf +++ b/ci-scripts/conf_files/gnb-du.sa.band78.51prb.usrpb210.ho-pci1.conf @@ -156,7 +156,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "f1"; local_n_address = "172.21.19.99"; @@ -171,7 +170,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 100; pucch0_dtx_threshold = 10; diff --git a/ci-scripts/conf_files/gnb-pnf.band66.rfsim.conf b/ci-scripts/conf_files/gnb-pnf.band66.rfsim.conf index 292ae955d6..a1f37686e2 100644 --- a/ci-scripts/conf_files/gnb-pnf.band66.rfsim.conf +++ b/ci-scripts/conf_files/gnb-pnf.band66.rfsim.conf @@ -2,7 +2,6 @@ L1s = ( { - num_cc = 1; tr_n_preference = "nfapi"; remote_n_address = "192.168.71.140"; // vnf addr local_n_address = "192.168.71.141"; // pnf addr diff --git a/ci-scripts/conf_files/gnb-pnf.band77.usrpn310.4x4.conf b/ci-scripts/conf_files/gnb-pnf.band77.usrpn310.4x4.conf index 6dbb840009..5e6248c54f 100644 --- a/ci-scripts/conf_files/gnb-pnf.band77.usrpn310.4x4.conf +++ b/ci-scripts/conf_files/gnb-pnf.band77.usrpn310.4x4.conf @@ -4,7 +4,6 @@ usrp-tx-thread-config = 1; tune-offset = 30720000; L1s = ({ - num_cc = 1; tr_n_preference = "nfapi"; remote_n_address = "127.0.0.1"; // vnf addr local_n_address = "127.0.0.1"; // pnf addr diff --git a/ci-scripts/conf_files/gnb-vnf.sa.band66.u0.25prb.nfapi.conf b/ci-scripts/conf_files/gnb-vnf.sa.band66.u0.25prb.nfapi.conf index d9356ff71f..5d027614de 100644 --- a/ci-scripts/conf_files/gnb-vnf.sa.band66.u0.25prb.nfapi.conf +++ b/ci-scripts/conf_files/gnb-vnf.sa.band66.u0.25prb.nfapi.conf @@ -173,14 +173,11 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "nfapi"; remote_s_address = "192.168.71.141"; // pnf addr [!] local_s_address = "192.168.71.140"; // vnf addr local_s_portc = 50001; // vnf p5 port - remote_s_portc = 50000; // pnf p5 port [!] local_s_portd = 50011; // vnf p7 port [!] - remote_s_portd = 50010; // pnf p7 port [!] tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; pucch_TargetSNRx10 = 200; diff --git a/ci-scripts/conf_files/gnb-vnf.sa.band77.162prb.nfapi.4x4.conf b/ci-scripts/conf_files/gnb-vnf.sa.band77.162prb.nfapi.4x4.conf index 3bc65aedfb..a09f495451 100644 --- a/ci-scripts/conf_files/gnb-vnf.sa.band77.162prb.nfapi.4x4.conf +++ b/ci-scripts/conf_files/gnb-vnf.sa.band77.162prb.nfapi.4x4.conf @@ -175,14 +175,11 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "nfapi"; remote_s_address = "127.0.0.1"; // pnf addr [!] local_s_address = "127.0.0.1"; // vnf addr local_s_portc = 50001; // vnf p5 port - remote_s_portc = 50000; // pnf p5 port [!] local_s_portd = 50011; // vnf p7 port [!] - remote_s_portd = 50010; // pnf p7 port [!] tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 300; diff --git a/ci-scripts/conf_files/gnb-vnf.sa.band78.273prb.aerial.conf b/ci-scripts/conf_files/gnb-vnf.sa.band78.273prb.aerial.conf index 8a83e37759..8e50055cd3 100644 --- a/ci-scripts/conf_files/gnb-vnf.sa.band78.273prb.aerial.conf +++ b/ci-scripts/conf_files/gnb-vnf.sa.band78.273prb.aerial.conf @@ -180,13 +180,10 @@ gNBs = MACRLCs = ( { - num_cc = 1; remote_s_address = "127.0.0.1"; // pnf addr [!] local_s_address = "127.0.0.2"; // vnf addr local_s_portc = 50001; // vnf p5 port - remote_s_portc = 50000; // pnf p5 port [!] local_s_portd = 50011; // vnf p7 port [!] - remote_s_portd = 50010; // pnf p7 port [!] tr_s_preference = "aerial"; tr_n_preference = "local_RRC"; pucch_RSSI_Threshold = -270; diff --git a/ci-scripts/conf_files/gnb-vnf.sa.band78.273prb.aerial.ul-heavy.conf b/ci-scripts/conf_files/gnb-vnf.sa.band78.273prb.aerial.ul-heavy.conf index a20d7512d9..c06c6ca069 100644 --- a/ci-scripts/conf_files/gnb-vnf.sa.band78.273prb.aerial.ul-heavy.conf +++ b/ci-scripts/conf_files/gnb-vnf.sa.band78.273prb.aerial.ul-heavy.conf @@ -180,13 +180,10 @@ gNBs = MACRLCs = ( { - num_cc = 1; remote_s_address = "127.0.0.1"; // pnf addr [!] local_s_address = "127.0.0.2"; // vnf addr local_s_portc = 50001; // vnf p5 port - remote_s_portc = 50000; // pnf p5 port [!] local_s_portd = 50011; // vnf p7 port [!] - remote_s_portd = 50010; // pnf p7 port [!] tr_s_preference = "aerial"; tr_n_preference = "local_RRC"; pucch_RSSI_Threshold = -270; diff --git a/ci-scripts/conf_files/gnb-vnf.sa.band78.78prb.aerial.conf b/ci-scripts/conf_files/gnb-vnf.sa.band78.78prb.aerial.conf index 075b6b33ab..2851ff5aaa 100644 --- a/ci-scripts/conf_files/gnb-vnf.sa.band78.78prb.aerial.conf +++ b/ci-scripts/conf_files/gnb-vnf.sa.band78.78prb.aerial.conf @@ -179,13 +179,10 @@ gNBs = MACRLCs = ( { - num_cc = 1; remote_s_address = "127.0.0.1"; // pnf addr [!] local_s_address = "127.0.0.2"; // vnf addr local_s_portc = 50001; // vnf p5 port - remote_s_portc = 50000; // pnf p5 port [!] local_s_portd = 50011; // vnf p7 port [!] - remote_s_portd = 50010; // pnf p7 port [!] tr_s_preference = "aerial"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 180; # 150; diff --git a/ci-scripts/conf_files/gnb.band66.106prb.rfsim.phytest-dora.conf b/ci-scripts/conf_files/gnb.band66.106prb.rfsim.phytest-dora.conf index 3e1254b750..9d960d6a73 100644 --- a/ci-scripts/conf_files/gnb.band66.106prb.rfsim.phytest-dora.conf +++ b/ci-scripts/conf_files/gnb.band66.106prb.rfsim.phytest-dora.conf @@ -161,7 +161,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; } @@ -169,7 +168,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/ci-scripts/conf_files/gnb.band77.273prb.fhi72.4x4-vvdn-phytest.conf b/ci-scripts/conf_files/gnb.band77.273prb.fhi72.4x4-vvdn-phytest.conf index 86a27fbe3c..1da7b2f723 100644 --- a/ci-scripts/conf_files/gnb.band77.273prb.fhi72.4x4-vvdn-phytest.conf +++ b/ci-scripts/conf_files/gnb.band77.273prb.fhi72.4x4-vvdn-phytest.conf @@ -173,7 +173,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 220; @@ -184,7 +183,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120 pucch0_dtx_threshold = 80; diff --git a/ci-scripts/conf_files/gnb.band78.106prb.rfsim.phytest-dora.conf b/ci-scripts/conf_files/gnb.band78.106prb.rfsim.phytest-dora.conf index 677b4e530a..a6badf3f3a 100644 --- a/ci-scripts/conf_files/gnb.band78.106prb.rfsim.phytest-dora.conf +++ b/ci-scripts/conf_files/gnb.band78.106prb.rfsim.phytest-dora.conf @@ -173,7 +173,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; } @@ -181,7 +180,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; } ); diff --git a/ci-scripts/conf_files/gnb.band79.106prb.usrpn300.phytest-dora.conf b/ci-scripts/conf_files/gnb.band79.106prb.usrpn300.phytest-dora.conf index 949ab4c118..4296e7709d 100644 --- a/ci-scripts/conf_files/gnb.band79.106prb.usrpn300.phytest-dora.conf +++ b/ci-scripts/conf_files/gnb.band79.106prb.usrpn300.phytest-dora.conf @@ -173,7 +173,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; } @@ -181,7 +180,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; } ); diff --git a/ci-scripts/conf_files/gnb.band79.162prb.usrpn300.phytest-dora.conf b/ci-scripts/conf_files/gnb.band79.162prb.usrpn300.phytest-dora.conf index 9deee529a6..724bafd19c 100644 --- a/ci-scripts/conf_files/gnb.band79.162prb.usrpn300.phytest-dora.conf +++ b/ci-scripts/conf_files/gnb.band79.162prb.usrpn300.phytest-dora.conf @@ -170,13 +170,11 @@ gNBs = ); MACRLCs = ({ - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; }); L1s = ({ - num_cc = 1; tr_n_preference = "local_mac"; }); diff --git a/ci-scripts/conf_files/gnb.band79.273prb.usrpn300.phytest-dora.conf b/ci-scripts/conf_files/gnb.band79.273prb.usrpn300.phytest-dora.conf index dc65ab7e5f..269fdf1d32 100644 --- a/ci-scripts/conf_files/gnb.band79.273prb.usrpn300.phytest-dora.conf +++ b/ci-scripts/conf_files/gnb.band79.273prb.usrpn300.phytest-dora.conf @@ -172,13 +172,11 @@ gNBs = ); MACRLCs = ({ - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; }); L1s = ({ - num_cc = 1; tr_n_preference = "local_mac"; }); diff --git a/ci-scripts/conf_files/gnb.nsa.band78.106prb.usrpb200.conf b/ci-scripts/conf_files/gnb.nsa.band78.106prb.usrpb200.conf index 5ae5472238..919aeeff4f 100644 --- a/ci-scripts/conf_files/gnb.nsa.band78.106prb.usrpb200.conf +++ b/ci-scripts/conf_files/gnb.nsa.band78.106prb.usrpb200.conf @@ -180,7 +180,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -190,7 +189,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf b/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf index 13bf2b2d2b..6a3284200c 100644 --- a/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf +++ b/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf @@ -197,7 +197,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -209,7 +208,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 150; pucch0_dtx_threshold = 150; diff --git a/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn.conf b/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn.conf index 1aeb106705..c38514c1aa 100644 --- a/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn.conf +++ b/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn.conf @@ -205,7 +205,6 @@ rlc = { MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -217,7 +216,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 150; pucch0_dtx_threshold = 150; diff --git a/ci-scripts/conf_files/gnb.sa.band257.u3.66prb.rfsim.conf b/ci-scripts/conf_files/gnb.sa.band257.u3.66prb.rfsim.conf index c58a805b5d..4182ce10be 100644 --- a/ci-scripts/conf_files/gnb.sa.band257.u3.66prb.rfsim.conf +++ b/ci-scripts/conf_files/gnb.sa.band257.u3.66prb.rfsim.conf @@ -172,7 +172,6 @@ gNBs = ); MACRLCs = ({ - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -185,7 +184,6 @@ MACRLCs = ({ L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; #pucch0_dtx_threshold = 120; diff --git a/ci-scripts/conf_files/gnb.sa.band66.106prb.rfsim.conf b/ci-scripts/conf_files/gnb.sa.band66.106prb.rfsim.conf index fbe2350352..cab0804a8a 100644 --- a/ci-scripts/conf_files/gnb.sa.band66.106prb.rfsim.conf +++ b/ci-scripts/conf_files/gnb.sa.band66.106prb.rfsim.conf @@ -172,7 +172,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; ulsch_max_slots_inactivity = 100; @@ -183,7 +182,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; pusch_proc_threads = 8; prach_dtx_threshold = 200; diff --git a/ci-scripts/conf_files/gnb.sa.band77.162prb.usrpn310.2x2.conf b/ci-scripts/conf_files/gnb.sa.band77.162prb.usrpn310.2x2.conf index aaf9a37b11..950d18c9f4 100644 --- a/ci-scripts/conf_files/gnb.sa.band77.162prb.usrpn310.2x2.conf +++ b/ci-scripts/conf_files/gnb.sa.band77.162prb.usrpn310.2x2.conf @@ -178,7 +178,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 320; @@ -192,7 +191,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pusch_dtx_threshold = 20; diff --git a/ci-scripts/conf_files/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf b/ci-scripts/conf_files/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf index f0e9636cd3..7e87941f0d 100644 --- a/ci-scripts/conf_files/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf +++ b/ci-scripts/conf_files/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf @@ -174,7 +174,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -185,7 +184,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 130 pucch0_dtx_threshold = 80; diff --git a/ci-scripts/conf_files/gnb.sa.band77.273prb.usrpn310.2x2.conf b/ci-scripts/conf_files/gnb.sa.band77.273prb.usrpn310.2x2.conf index 894a5a4364..ab5db0581a 100644 --- a/ci-scripts/conf_files/gnb.sa.band77.273prb.usrpn310.2x2.conf +++ b/ci-scripts/conf_files/gnb.sa.band77.273prb.usrpn310.2x2.conf @@ -171,7 +171,6 @@ gNBs = ( MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 320; @@ -185,7 +184,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; max_ldpc_iterations = 15; diff --git a/ci-scripts/conf_files/gnb.sa.band77.51prb.usrpb200.n2-ho.conf b/ci-scripts/conf_files/gnb.sa.band77.51prb.usrpb200.n2-ho.conf index 7d6aa7ef52..34c747f9cb 100644 --- a/ci-scripts/conf_files/gnb.sa.band77.51prb.usrpb200.n2-ho.conf +++ b/ci-scripts/conf_files/gnb.sa.band77.51prb.usrpb200.n2-ho.conf @@ -171,7 +171,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -182,7 +181,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 100; diff --git a/ci-scripts/conf_files/gnb.sa.band78.106prb.n310.7ds2u.conf b/ci-scripts/conf_files/gnb.sa.band78.106prb.n310.7ds2u.conf index 9cd45f7fd9..6baf3940c2 100644 --- a/ci-scripts/conf_files/gnb.sa.band78.106prb.n310.7ds2u.conf +++ b/ci-scripts/conf_files/gnb.sa.band78.106prb.n310.7ds2u.conf @@ -174,7 +174,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -184,7 +183,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 150; #pucch0_dtx_threshold = 150; diff --git a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.conf b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.conf index 6c7a7284c3..dab87bb6a3 100644 --- a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.conf +++ b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.conf @@ -176,7 +176,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -186,7 +185,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 200; # pucch0_dtx_threshold = 150; diff --git a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.flexric.conf b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.flexric.conf index a44f88d631..3d180c546c 100644 --- a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.flexric.conf +++ b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.flexric.conf @@ -166,7 +166,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -176,7 +175,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 200; # pucch0_dtx_threshold = 150; diff --git a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.neighbour.conf b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.neighbour.conf index d3aae08c2f..1c5441c491 100644 --- a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.neighbour.conf +++ b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.neighbour.conf @@ -174,7 +174,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 250; @@ -184,7 +183,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 100; diff --git a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.prs.conf b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.prs.conf index 2b0739c880..cf16ec27e6 100644 --- a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.prs.conf +++ b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.prs.conf @@ -167,7 +167,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -197,7 +196,6 @@ prs_config = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; } diff --git a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.yaml b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.yaml index 0c5af740bb..cc519ba0f0 100644 --- a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.yaml +++ b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.yaml @@ -143,16 +143,14 @@ gNBs: MACRLCs: - - num_cc: 1 - tr_s_preference: local_L1 + - tr_s_preference: local_L1 tr_n_preference: local_RRC pusch_TargetSNRx10: 200 pucch_TargetSNRx10: 200 stats_max_ue: 17 L1s: - - num_cc: 1 - tr_n_preference: local_mac + - tr_n_preference: local_mac prach_dtx_threshold: 200 # pucch0_dtx_threshold = 150; diff --git a/ci-scripts/conf_files/gnb.sa.band78.106prb.usrpb200.sc-fdma.conf b/ci-scripts/conf_files/gnb.sa.band78.106prb.usrpb200.sc-fdma.conf index 994b7a1720..df090801d0 100644 --- a/ci-scripts/conf_files/gnb.sa.band78.106prb.usrpb200.sc-fdma.conf +++ b/ci-scripts/conf_files/gnb.sa.band78.106prb.usrpb200.sc-fdma.conf @@ -178,7 +178,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -189,7 +188,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 150; pucch0_dtx_threshold = 30; diff --git a/ci-scripts/conf_files/gnb.sa.band78.106prb.vrtsim.2x2.yaml b/ci-scripts/conf_files/gnb.sa.band78.106prb.vrtsim.2x2.yaml index 02a9f7cde5..3391adb26c 100644 --- a/ci-scripts/conf_files/gnb.sa.band78.106prb.vrtsim.2x2.yaml +++ b/ci-scripts/conf_files/gnb.sa.band78.106prb.vrtsim.2x2.yaml @@ -146,15 +146,13 @@ gNBs: MACRLCs: - - num_cc: 1 - tr_s_preference: local_L1 + - tr_s_preference: local_L1 tr_n_preference: local_RRC pusch_TargetSNRx10: 200 pucch_TargetSNRx10: 200 L1s: - - num_cc: 1 - tr_n_preference: local_mac + - tr_n_preference: local_mac prach_dtx_threshold: 200 # pucch0_dtx_threshold = 150; diff --git a/ci-scripts/conf_files/gnb.sa.band78.24prb.rfsim.conf b/ci-scripts/conf_files/gnb.sa.band78.24prb.rfsim.conf index 2811375c61..1be573160f 100644 --- a/ci-scripts/conf_files/gnb.sa.band78.24prb.rfsim.conf +++ b/ci-scripts/conf_files/gnb.sa.band78.24prb.rfsim.conf @@ -169,7 +169,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -179,7 +178,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; pusch_proc_threads = 8; prach_dtx_threshold = 120; diff --git a/ci-scripts/conf_files/gnb.sa.band78.273prb.rfsim.2x2.conf b/ci-scripts/conf_files/gnb.sa.band78.273prb.rfsim.2x2.conf index fce7aba143..9ce0d34f8b 100644 --- a/ci-scripts/conf_files/gnb.sa.band78.273prb.rfsim.2x2.conf +++ b/ci-scripts/conf_files/gnb.sa.band78.273prb.rfsim.2x2.conf @@ -173,7 +173,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; } @@ -181,7 +180,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; tx_amp_backoff_dB = 30; diff --git a/ci-scripts/conf_files/gnb.sa.band78.51prb.aw2s.ddsuu.2x2.conf b/ci-scripts/conf_files/gnb.sa.band78.51prb.aw2s.ddsuu.2x2.conf index 979c4e3479..6e38413dcf 100644 --- a/ci-scripts/conf_files/gnb.sa.band78.51prb.aw2s.ddsuu.2x2.conf +++ b/ci-scripts/conf_files/gnb.sa.band78.51prb.aw2s.ddsuu.2x2.conf @@ -177,7 +177,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -187,7 +186,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 50; diff --git a/ci-scripts/conf_files/gnb.sa.band78.51prb.aw2s.ddsuu.conf b/ci-scripts/conf_files/gnb.sa.band78.51prb.aw2s.ddsuu.conf index c44462065c..27333a1e0d 100644 --- a/ci-scripts/conf_files/gnb.sa.band78.51prb.aw2s.ddsuu.conf +++ b/ci-scripts/conf_files/gnb.sa.band78.51prb.aw2s.ddsuu.conf @@ -179,7 +179,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -190,7 +189,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 50; diff --git a/ci-scripts/conf_files/gnb.sa.band78.51prb.usrpb200.conf b/ci-scripts/conf_files/gnb.sa.band78.51prb.usrpb200.conf index df6d4a9a71..dbac20b595 100644 --- a/ci-scripts/conf_files/gnb.sa.band78.51prb.usrpb200.conf +++ b/ci-scripts/conf_files/gnb.sa.band78.51prb.usrpb200.conf @@ -168,7 +168,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -179,7 +178,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 100; diff --git a/ci-scripts/conf_files/nrue.band78.106prb.l2sim.conf b/ci-scripts/conf_files/nrue.band78.106prb.l2sim.conf index 54344049da..b2c7cbfd9a 100644 --- a/ci-scripts/conf_files/nrue.band78.106prb.l2sim.conf +++ b/ci-scripts/conf_files/nrue.band78.106prb.l2sim.conf @@ -19,7 +19,6 @@ pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; }); MACRLCs = ( { - num_cc = 1; tr_n_preference = "nfapi"; remote_n_address = "127.0.0.1"; //Proxy IP local_n_address = "127.0.0.1"; diff --git a/ci-scripts/conf_files/nrue.vrtsim.chanmod.yaml b/ci-scripts/conf_files/nrue.vrtsim.chanmod.yaml index ffb4ac470c..0ca9c7a979 100644 --- a/ci-scripts/conf_files/nrue.vrtsim.chanmod.yaml +++ b/ci-scripts/conf_files/nrue.vrtsim.chanmod.yaml @@ -11,7 +11,7 @@ uicc0: thread-pool: "-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1" channelmod: - max_chan: 10; + max_chan: 10 modellist: DefaultChannelList DefaultChannelList: - model_name: client_tx_channel_model diff --git a/ci-scripts/conf_files/untested/episci/episci_rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/untested/episci/episci_rcc.band7.tm1.nfapi.conf index 8f5998ca54..3f47d23710 100644 --- a/ci-scripts/conf_files/untested/episci/episci_rcc.band7.tm1.nfapi.conf +++ b/ci-scripts/conf_files/untested/episci/episci_rcc.band7.tm1.nfapi.conf @@ -203,9 +203,7 @@ MACRLCs = ( remote_s_address = "127.0.0.1"; local_s_address = "127.0.0.1"; local_s_portc = 50001; - remote_s_portc = 50000; local_s_portd = 50011; - remote_s_portd = 50010; tr_s_preference = "nfapi"; tr_n_preference = "local_RRC"; scheduler_mode = "fairRR"; diff --git a/ci-scripts/conf_files/untested/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf b/ci-scripts/conf_files/untested/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf index 327250f0ac..276d4fb1e2 100644 --- a/ci-scripts/conf_files/untested/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf +++ b/ci-scripts/conf_files/untested/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf @@ -189,9 +189,7 @@ MACRLCs = ( remote_s_address = "127.0.0.1"; // pnf addr [!] local_s_address = "127.0.0.2"; // vnf addr local_s_portc = 50601; // vnf p5 port - remote_s_portc = 50600; // pnf p5 port [!] local_s_portd = 50611; // vnf p7 port [!] - remote_s_portd = 50610; // pnf p7 port [!] tr_s_preference = "nfapi"; tr_n_preference = "local_RRC"; } diff --git a/ci-scripts/conf_files/untested/episci/gnb_band78.sa.fr1.106PRB.2x2.l2sim.conf b/ci-scripts/conf_files/untested/episci/gnb_band78.sa.fr1.106PRB.2x2.l2sim.conf index 963b2f830f..03b71b4da0 100644 --- a/ci-scripts/conf_files/untested/episci/gnb_band78.sa.fr1.106PRB.2x2.l2sim.conf +++ b/ci-scripts/conf_files/untested/episci/gnb_band78.sa.fr1.106PRB.2x2.l2sim.conf @@ -177,9 +177,7 @@ MACRLCs = ( remote_s_address = "127.0.0.1"; // pnf addr [!] local_s_address = "127.0.0.2"; // vnf addr local_s_portc = 50601; // vnf p5 port - remote_s_portc = 50600; // pnf p5 port [!] local_s_portd = 50611; // vnf p7 port [!] - remote_s_portd = 50610; // pnf p7 port [!] tr_s_preference = "nfapi"; tr_n_preference = "local_RRC"; } diff --git a/ci-scripts/conf_files/untested/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/untested/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 53c9f5e96c..6f63a6b85e 100644 --- a/ci-scripts/conf_files/untested/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/untested/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -188,7 +188,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -198,7 +197,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; diff --git a/ci-scripts/conf_files/untested/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/untested/gNB_SA_n78_133PRB.2x2_usrpn310.conf index 971355190d..ebdfaa5988 100644 --- a/ci-scripts/conf_files/untested/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/untested/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -184,7 +184,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -194,7 +193,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; } diff --git a/ci-scripts/conf_files/untested/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/untested/gnb.band78.sa.fr1.106PRB.usrpn310.conf index 7379711001..1c7fc464ff 100644 --- a/ci-scripts/conf_files/untested/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/untested/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -192,7 +192,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -202,7 +201,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 200; # pucch0_dtx_threshold = 150; diff --git a/ci-scripts/conf_files/untested/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/untested/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index a2225507e7..af165cd287 100644 --- a/ci-scripts/conf_files/untested/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/untested/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -179,7 +179,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -189,7 +188,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/ci-scripts/conf_files/untested/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/untested/gnb.band78.tm1.fr1.106PRB.usrpn310.conf index abc27b2a92..5d6e275d1e 100644 --- a/ci-scripts/conf_files/untested/gnb.band78.tm1.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/untested/gnb.band78.tm1.fr1.106PRB.usrpn310.conf @@ -183,7 +183,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -193,7 +192,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; } ); diff --git a/ci-scripts/conf_files/untested/gnb.nsa.band78.106prb.usrpn310.2x2.conf b/ci-scripts/conf_files/untested/gnb.nsa.band78.106prb.usrpn310.2x2.conf index 846aec5e17..5462521df6 100644 --- a/ci-scripts/conf_files/untested/gnb.nsa.band78.106prb.usrpn310.2x2.conf +++ b/ci-scripts/conf_files/untested/gnb.nsa.band78.106prb.usrpn310.2x2.conf @@ -184,7 +184,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; } @@ -192,7 +191,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 80; diff --git a/ci-scripts/conf_files/untested/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/ci-scripts/conf_files/untested/gnb.sa.band66.fr1.106PRB.usrpn300.conf index 3c96388f91..4d81e4d0b8 100644 --- a/ci-scripts/conf_files/untested/gnb.sa.band66.fr1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/untested/gnb.sa.band66.fr1.106PRB.usrpn300.conf @@ -172,7 +172,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; ulsch_max_slots_inactivity = 100; @@ -183,7 +182,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; pusch_proc_threads = 8; prach_dtx_threshold = 200; diff --git a/ci-scripts/conf_files/untested/gnb.sa.band78.106prb.usrp310.2x2.conf b/ci-scripts/conf_files/untested/gnb.sa.band78.106prb.usrp310.2x2.conf index e31981b921..320003792e 100644 --- a/ci-scripts/conf_files/untested/gnb.sa.band78.106prb.usrp310.2x2.conf +++ b/ci-scripts/conf_files/untested/gnb.sa.band78.106prb.usrp310.2x2.conf @@ -175,7 +175,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 220; @@ -185,7 +184,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 150; # pucch0_dtx_threshold = 150; diff --git a/ci-scripts/conf_files/untested/gnb.sa.band78.106prb.usrpn310.ddsuu-2x2.conf b/ci-scripts/conf_files/untested/gnb.sa.band78.106prb.usrpn310.ddsuu-2x2.conf index 0188d43738..177b7a3c82 100644 --- a/ci-scripts/conf_files/untested/gnb.sa.band78.106prb.usrpn310.ddsuu-2x2.conf +++ b/ci-scripts/conf_files/untested/gnb.sa.band78.106prb.usrpn310.ddsuu-2x2.conf @@ -188,7 +188,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 220; @@ -198,7 +197,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 150; # pucch0_dtx_threshold = 150; diff --git a/ci-scripts/conf_files/untested/gnb.sa.band78.162prb.usrpn310.2x2.conf b/ci-scripts/conf_files/untested/gnb.sa.band78.162prb.usrpn310.2x2.conf index 07ed611b9a..057ba92573 100644 --- a/ci-scripts/conf_files/untested/gnb.sa.band78.162prb.usrpn310.2x2.conf +++ b/ci-scripts/conf_files/untested/gnb.sa.band78.162prb.usrpn310.2x2.conf @@ -189,7 +189,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; # pusch_TargetSNRx10 = 200; @@ -199,7 +198,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; diff --git a/ci-scripts/conf_files/untested/gnb.sa.band78.fr1.51PRB.usrpb210.conf b/ci-scripts/conf_files/untested/gnb.sa.band78.fr1.51PRB.usrpb210.conf index 2710651c6c..a4276e1071 100644 --- a/ci-scripts/conf_files/untested/gnb.sa.band78.fr1.51PRB.usrpb210.conf +++ b/ci-scripts/conf_files/untested/gnb.sa.band78.fr1.51PRB.usrpb210.conf @@ -167,7 +167,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -178,7 +177,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 100; diff --git a/ci-scripts/docker/Dockerfile.channelsim.ubuntu b/ci-scripts/docker/Dockerfile.channelsim.ubuntu index 5e2032b123..73904c5fcb 100644 --- a/ci-scripts/docker/Dockerfile.channelsim.ubuntu +++ b/ci-scripts/docker/Dockerfile.channelsim.ubuntu @@ -31,4 +31,4 @@ RUN cmake -GNinja -DENABLE_PHYSIM_TESTS=ON -DENABLE_TESTS=ON \ -DUSE_ATS_MEMORY=OFF \ -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/oai-ran/cmake_targets/ran_build/build \ .. && \ - ninja test_channel_scalability test_multipath test_noise + ninja test_channel_scalability diff --git a/ci-scripts/docker/Dockerfile.unittest.cuda.ubuntu b/ci-scripts/docker/Dockerfile.unittest.cuda.ubuntu new file mode 100644 index 0000000000..d58e8887e2 --- /dev/null +++ b/ci-scripts/docker/Dockerfile.unittest.cuda.ubuntu @@ -0,0 +1,25 @@ +# SPDX-License-Identifier: MIT + +FROM nvidia/cuda:12.9.1-devel-ubuntu22.04 AS cuda-image +FROM ran-base:develop AS ran-tests + +COPY --from=cuda-image /usr/local/cuda/ /usr/local/cuda/ + +# Set the LD_LIBRARY_PATH to ensure the system can find the copied libraries. +# This is crucial for applications that use CUDA. +ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/targets/sbsa-linux/lib +ENV PATH=/usr/local/cuda/bin:$PATH +ENV C_INCLUDE_PATH=/usr/local/cuda/include + +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \ + DEBIAN_FRONTEND=noninteractive apt-get install --yes \ + libgtest-dev \ + libyaml-cpp-dev + +RUN rm -Rf /oai-ran +WORKDIR /oai-ran +COPY . . + +WORKDIR /oai-ran/build +RUN cmake -GNinja -DENABLE_TESTS=ON -DCUDA_ENABLE=ON .. && ninja tests diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 579a90b28d..27cf36bcf8 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -70,6 +70,9 @@ def ExecuteActionWithParam(action, ctx, node): RAN.Build_eNB_args=test.findtext('Build_eNB_args') CONTAINERS.imageKind=test.findtext('kind') proxy_commit = test.findtext('proxy_commit') + dockerfile = test.findtext('dockerfile') or '' + runtime_opt = test.findtext('runtime-opt') or '' + ctest_opt = test.findtext('ctest-opt') or '' if proxy_commit is not None: CONTAINERS.proxyCommit = proxy_commit if action == 'Build_eNB': @@ -81,7 +84,7 @@ def ExecuteActionWithParam(action, ctx, node): elif action == 'Build_Cluster_Image': success = CLUSTER.BuildClusterImage(ctx, node, HTML) elif action == 'Build_Run_Tests': - success = CONTAINERS.BuildRunTests(ctx, node, HTML) + success = CONTAINERS.BuildRunTests(ctx, node, dockerfile, runtime_opt, ctest_opt, HTML) elif action == 'Initialize_eNB': RAN.Initialize_eNB_args=test.findtext('Initialize_eNB_args') diff --git a/ci-scripts/xml_files/container_build_run_gh_tests.xml b/ci-scripts/xml_files/container_build_run_gh_tests.xml new file mode 100644 index 0000000000..f994c5d4f9 --- /dev/null +++ b/ci-scripts/xml_files/container_build_run_gh_tests.xml @@ -0,0 +1,23 @@ + + + + build-run-test-gh-tab + Build and Run Unit Tests with CUDA + wrench + + + Create_Workspace + Create new Workspace + localhost + + + + Build_Run_Tests + Build and Run UnitTests + docker/Dockerfile.unittest.cuda.ubuntu + --gpus all + -L cuda + localhost + + + diff --git a/ci-scripts/xml_files/container_build_run_tests.xml b/ci-scripts/xml_files/container_build_run_tests.xml index c680ea4983..53341c8810 100644 --- a/ci-scripts/xml_files/container_build_run_tests.xml +++ b/ci-scripts/xml_files/container_build_run_tests.xml @@ -8,6 +8,7 @@ Build_Run_Tests Build and Run UnitTests + docker/Dockerfile.unittest.ubuntu obelix diff --git a/ci-scripts/yaml_files/sa_gnb_aerial_30MHz/cuphycontroller_P5G_WNC_GH.yaml b/ci-scripts/yaml_files/sa_gnb_aerial_30MHz/cuphycontroller_P5G_WNC_GH.yaml index d43e2b17ad..0d821ec670 100644 --- a/ci-scripts/yaml_files/sa_gnb_aerial_30MHz/cuphycontroller_P5G_WNC_GH.yaml +++ b/ci-scripts/yaml_files/sa_gnb_aerial_30MHz/cuphycontroller_P5G_WNC_GH.yaml @@ -236,7 +236,7 @@ cuphydriver_config: pusch_ldpc_algo_index: 0 pusch_ldpc_flags: 2 pusch_ldpc_use_half: 1 - pusch_nMaxPrb: 273 + pusch_nMaxPrb: 78 pusch_nMaxRx: 4 ul_gain_calibration: 78.68 lower_guard_bw: 845 diff --git a/cmake_targets/at_commands/CMakeLists.txt b/cmake_targets/at_commands/CMakeLists.txt index 30482cdf81..2f70e1e440 100755 --- a/cmake_targets/at_commands/CMakeLists.txt +++ b/cmake_targets/at_commands/CMakeLists.txt @@ -80,6 +80,8 @@ add_boolean_option(NAS_BUILT_IN_UE False "UE NAS layer present in this # SECU LIB ################################################################################ set(secu_cn_SRC + ${OPENAIR3_DIR}/SECU/curve_25519.c + ${OPENAIR3_DIR}/SECU/x963_kdf.c ${OPENAIR3_DIR}/SECU/aes_128_ctr.c ${OPENAIR3_DIR}/SECU/aes_128_cbc_cmac.c ${OPENAIR3_DIR}/SECU/sha_256_hmac.c diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index d8a16312ad..8580a0491b 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -25,6 +25,9 @@ #define NR_NB_SC_PER_RB 12 #define NR_MAX_NUM_LCID 32 #define NR_MAX_NUM_QFI 64 +#define MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER 36 +#define MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER 34 +#define NR_MAX_SLOTS_PER_FRAME 160 #define RNTI_NAMES /* see 38.321 Table 7.1-2 RNTI usage */ \ R(TYPE_C_RNTI_) /* Cell RNTI */ \ R(TYPE_CS_RNTI_) /* Configured Scheduling RNTI */ \ @@ -41,6 +44,11 @@ R(TYPE_TPC_SRS_RNTI_) \ R(TYPE_MCS_C_RNTI_) +/* FFS_NR_TODO it defines ue capability which is the number of slots */ +/* - between reception of pdsch and transmission of its acknowlegment (k1) */ +/* - between reception of un uplink grant and its related transmission (k2) */ +#define NR_UE_CAPABILITY_SLOT_RX_TO_TX (3) + #define R(k) k , typedef enum { RNTI_NAMES } nr_rnti_type_t; #undef R diff --git a/common/utils/ocp_itti/all_msg.h b/common/utils/ocp_itti/all_msg.h index f9e6831283..a298ba54d0 100644 --- a/common/utils/ocp_itti/all_msg.h +++ b/common/utils/ocp_itti/all_msg.h @@ -2,9 +2,7 @@ * SPDX-License-Identifier: LicenseRef-CSSL-1.0 */ -#include "openair2/COMMON/phy_messages_def.h" #include "openair2/COMMON/mac_messages_def.h" -#include "openair2/COMMON/rlc_messages_def.h" #include "openair2/COMMON/pdcp_messages_def.h" #include "openair2/COMMON/rrc_messages_def.h" #include "openair2/COMMON/nas_messages_def.h" @@ -13,7 +11,6 @@ #include "openair2/COMMON/m2ap_messages_def.h" #include "openair2/COMMON/m3ap_messages_def.h" #include "openair2/COMMON/sctp_messages_def.h" -#include "openair2/COMMON/udp_messages_def.h" #include "openair2/COMMON/gtpv1_u_messages_def.h" #include "openair2/COMMON/f1ap_messages_def.h" #include "openair2/COMMON/e1ap_messages_def.h" diff --git a/common/utils/ocp_itti/intertask_interface.h b/common/utils/ocp_itti/intertask_interface.h index 47d0ac216f..b31368bce7 100644 --- a/common/utils/ocp_itti/intertask_interface.h +++ b/common/utils/ocp_itti/intertask_interface.h @@ -53,9 +53,7 @@ typedef struct IttiMsgText_s { char text[]; } IttiMsgText; -#include #include -#include #include #include #include @@ -208,7 +206,6 @@ typedef struct IttiMsgText_s { #include #include #include -#include #include #include #include @@ -262,18 +259,14 @@ typedef struct { TASK_DEF(TASK_UNKNOWN, 50) \ TASK_DEF(TASK_TIMER, 10) \ TASK_DEF(TASK_L2L1, 200) \ - TASK_DEF(TASK_BM, 200) \ - TASK_DEF(TASK_PHY_ENB, 200) \ TASK_DEF(TASK_MAC_GNB, 200) \ TASK_DEF(TASK_RLC_ENB, 200) \ - TASK_DEF(TASK_RRC_ENB_NB_IoT, 200) \ TASK_DEF(TASK_PDCP_ENB, 200) \ TASK_DEF(TASK_PDCP_GNB, 200) \ TASK_DEF(TASK_DATA_FORWARDING, 200) \ TASK_DEF(TASK_END_MARKER, 200) \ TASK_DEF(TASK_RRC_ENB, 200) \ TASK_DEF(TASK_RRC_GNB, 200) \ - TASK_DEF(TASK_RAL_ENB, 200) \ TASK_DEF(TASK_S1AP, 200) \ TASK_DEF(TASK_NGAP, 200) \ TASK_DEF(TASK_NRPPA, 200) \ @@ -288,14 +281,12 @@ typedef struct { TASK_DEF(TASK_GNB_APP, 200) \ TASK_DEF(TASK_MCE_APP, 200) \ TASK_DEF(TASK_MME_APP, 200) \ - TASK_DEF(TASK_PHY_UE, 200) \ TASK_DEF(TASK_MAC_UE, 200) \ TASK_DEF(TASK_RLC_UE, 200) \ TASK_DEF(TASK_PDCP_UE, 200) \ TASK_DEF(TASK_RRC_UE, 200) \ TASK_DEF(TASK_RRC_NRUE, 200) \ TASK_DEF(TASK_NAS_UE, 200) \ - TASK_DEF(TASK_RAL_UE, 200) \ TASK_DEF(TASK_GTPV1_U, 1000) \ TASK_DEF(TASK_CU_F1, 200) \ TASK_DEF(TASK_DU_F1, 200) \ diff --git a/common/utils/shm_iq_channel/shm_td_iq_channel.c b/common/utils/shm_iq_channel/shm_td_iq_channel.c index 3c547fc534..fc93fb4bf0 100644 --- a/common/utils/shm_iq_channel/shm_td_iq_channel.c +++ b/common/utils/shm_iq_channel/shm_td_iq_channel.c @@ -33,6 +33,8 @@ typedef struct ShmTDIQChannel_s { char name[256]; sample_t *tx_iq_data; sample_t *rx_iq_data; + int nb_tx_ant; + int nb_rx_ant; bool abort; } ShmTDIQChannel; @@ -61,6 +63,8 @@ ShmTDIQChannel *shm_td_iq_channel_create(const char *name, int num_tx_ant, int n strncpy(channel->name, name, sizeof(channel->name) - 1); channel->tx_iq_data = (sample_t *)(shm_ptr + 1); channel->rx_iq_data = channel->tx_iq_data + tx_buffer_size / sizeof(sample_t); + channel->nb_tx_ant = num_tx_ant; + channel->nb_rx_ant = num_rx_ant; channel->data = shm_ptr; channel->type = IQ_CHANNEL_TYPE_SERVER; pthread_mutexattr_t mutex_attr; @@ -113,9 +117,15 @@ ShmTDIQChannel *shm_td_iq_channel_connect(const char *name, int timeout_in_secon ShmTDIQChannel *channel = calloc_or_fail(1, sizeof(ShmTDIQChannel)); channel->data = shm_ptr; - channel->tx_iq_data = (sample_t *)(shm_ptr + 1); + sample_t *tx_buffer = (sample_t *)(shm_ptr + 1); size_t tx_buffer_size = CIRCULAR_BUFFER_SIZE * sizeof(sample_t) * channel->data->num_antennas_tx; - channel->rx_iq_data = channel->tx_iq_data + tx_buffer_size / sizeof(sample_t); + sample_t *rx_buffer = tx_buffer + tx_buffer_size / sizeof(sample_t); + // Flip the order between TX and RX to simplify tx/rx functions + channel->tx_iq_data = rx_buffer; + channel->rx_iq_data = tx_buffer; + channel->nb_tx_ant = channel->data->num_antennas_rx; + channel->nb_rx_ant = channel->data->num_antennas_tx; + printf("\033[38;5;208mnb_tx_ant, nb_rx_ant: %d, %d\n\033[0m", channel->nb_tx_ant, channel->nb_rx_ant); channel->type = IQ_CHANNEL_TYPE_CLIENT; while (shm_ptr->magic != SHM_MAGIC_NUMBER) { printf("Waiting for server to initialize shared memory\n"); @@ -131,6 +141,7 @@ IQChannelErrorType shm_td_iq_channel_tx(ShmTDIQChannel *channel, int antenna, const sample_t *tx_iq_data) { + AssertFatal(antenna < channel->nb_tx_ant, "Invalid antenna index %d num_antennas %d\n", antenna, channel->nb_tx_ant); ShmTDIQChannelData *data = channel->data; // timestamp in the past uint64_t current_time = data->timestamp; @@ -142,12 +153,7 @@ IQChannelErrorType shm_td_iq_channel_tx(ShmTDIQChannel *channel, return CHANNEL_ERROR_TOO_EARLY; } - sample_t *base_ptr; - if (channel->type == IQ_CHANNEL_TYPE_CLIENT) { - base_ptr = channel->rx_iq_data + antenna * CIRCULAR_BUFFER_SIZE; - } else { - base_ptr = channel->tx_iq_data + antenna * CIRCULAR_BUFFER_SIZE; - } + sample_t *base_ptr = channel->tx_iq_data + antenna * CIRCULAR_BUFFER_SIZE; uint64_t first_sample = timestamp % CIRCULAR_BUFFER_SIZE; uint64_t last_sample = first_sample + num_samples - 1; @@ -167,6 +173,7 @@ IQChannelErrorType shm_td_iq_channel_rx(ShmTDIQChannel *channel, int antenna, sample_t *tx_iq_data) { + AssertFatal(antenna < channel->nb_rx_ant, "Invalid antenna index %d num_antennas %d\n", antenna, channel->nb_rx_ant); ShmTDIQChannelData *data = channel->data; // timestamp in the future uint64_t current_time = data->timestamp; @@ -178,12 +185,7 @@ IQChannelErrorType shm_td_iq_channel_rx(ShmTDIQChannel *channel, return CHANNEL_ERROR_TOO_LATE; } - sample_t *base_ptr; - if (channel->type == IQ_CHANNEL_TYPE_CLIENT) { - base_ptr = channel->tx_iq_data + antenna * CIRCULAR_BUFFER_SIZE; - } else { - base_ptr = channel->rx_iq_data + antenna * CIRCULAR_BUFFER_SIZE; - } + sample_t *base_ptr = channel->rx_iq_data + antenna * CIRCULAR_BUFFER_SIZE; uint64_t first_sample = timestamp % CIRCULAR_BUFFER_SIZE; uint64_t last_sample = first_sample + num_samples - 1; diff --git a/common/utils/threadPool/measurement_display.c b/common/utils/threadPool/measurement_display.c index c1ef6bc9f2..111c3ce9aa 100644 --- a/common/utils/threadPool/measurement_display.c +++ b/common/utils/threadPool/measurement_display.c @@ -3,8 +3,7 @@ */ #include - -#include "thread-pool.h" +#include "notified_fifo.h" #define SEP "\t" diff --git a/common/utils/utils.c b/common/utils/utils.c index c2e388b5fd..1b4d742ef7 100644 --- a/common/utils/utils.c +++ b/common/utils/utils.c @@ -94,6 +94,51 @@ char *itoa(int i) { return strdup(buffer); } +/**************************************************************************** + ** ** + ** Name: digit_string_to_bcd_value() ** + ** ** + ** Description: Converts a decimal ASCII coded string into its BCD encoded** + ** value. ** + ** ** + ** Inputs: bcd_value: Output buffer ** + ** digit_string: Input digit string ** + ** size: Size of bcd_value in bytes ** + ** ** + ** Outputs: bcd_value: Converted BCD value ** + ** Return: 0 on success, -1 on error ** + ** ** + ***************************************************************************/ +int digit_string_to_bcd_value(uint8_t *bcd_value, const char *digit_string, int size) +{ + int i; + uint8_t len = strlen(digit_string); + + /* Accept even (size*2) or odd (size*2 - 1) digit counts */ + if (len < size * 2 - 1 || len > size * 2) { + fprintf(stderr, "the string '%s' should be of length %d or %d\n", digit_string, size * 2 - 1, size * 2); + return -1; + } + + for (i = 0; i < size; i++) { + uint8_t low = digit_string[2 * i] - '0'; + uint8_t high = (2 * i + 1 < len) ? digit_string[2 * i + 1] - '0' : 0xF; + + if (low > 9 || (high > 9 && high != 0xF)) + goto error; + + bcd_value[i] = (high << 4) | low; + } + + return 0; + +error: + fprintf(stderr, "the string '%s' is not a valid digit string\n", digit_string); + for (i = 0; i < size; i++) + bcd_value[i] = 0; + return -1; +} + /** * @brief Convert a version string x.y.z into numbers. * diff --git a/common/utils/utils.h b/common/utils/utils.h index ada33e7ad9..796bfcbc1f 100644 --- a/common/utils/utils.h +++ b/common/utils/utils.h @@ -123,6 +123,8 @@ static inline void *malloc_or_fail(size_t size) int hex_char_to_hex_value (char c); // Converts an hexadecimal ASCII coded string into its value.** int hex_string_to_hex_value (uint8_t *hex_value, const char *hex_string, int size); +// Converts a decimal ASCII coded string into its BCD encoded value. +int digit_string_to_bcd_value(uint8_t *bcd_value, const char *digit_string, int size); /* Map task id to printable name. */ typedef struct { diff --git a/doc/5Gnas.md b/doc/5Gnas.md index 27fdaf99f5..27e1b48e55 100644 --- a/doc/5Gnas.md +++ b/doc/5Gnas.md @@ -78,18 +78,22 @@ The simulation reads values from a named section in the config file. **Config options in the `uicc` section**: -| Parameter | Description | Default value | -|---------------|-----------------------------------|--------------------------------------------| -| `imsi` | User IMSI | `2089900007487` | -| `nmc_size` | Number of digits in NMC | `2` | -| `key` | Subscription key (Ki) | `fec86ba6eb707ed08905757b1bb44b8f` | -| `opc` | OPc value | `c42449363bbad02b66d16bc975d77cc1` | -| `amf` | AMF value | `8000` | -| `sqn` | Sequence number | `000000` | -| `dnn` | Default DNN (APN) | `oai` | -| `nssai_sst` | NSSAI slice/service type | `1` | -| `nssai_sd` | NSSAI slice differentiator | `0xffffff` | -| `imeisv` | IMEISV string | `6754567890123413` | +| Parameter | Description | Default value | +|------------------------------|-----------------------------------|--------------------------------------------------------------------| +| `imsi` | User IMSI | `2089900007487` | +| `nmc_size` | Number of digits in NMC | `2` | +| `key` | Subscription key (Ki) | `fec86ba6eb707ed08905757b1bb44b8f` | +| `opc` | OPc value | `c42449363bbad02b66d16bc975d77cc1` | +| `amf` | AMF value | `8000` | +| `sqn` | Sequence number | `000000` | +| `dnn` | Default DNN (APN) | `oai` | +| `nssai_sst` | NSSAI slice/service type | `1` | +| `nssai_sd` | NSSAI slice differentiator | `0xffffff` | +| `imeisv` | IMEISV string | `6754567890123413` | +| `routing_indicator` | Routing Indicator | `0000` | +| `protection_scheme` | SUCI Profile Scheme | `0` | +| `home_network_public_key_id` | Home Network Public Key ID | `1` | +| `home_network_public_key` | Home Network Public Key | `5a8d38864820197c3394b92613b20b91633cbd897119273bf8e4a6f4eec0a650` | These are parsed and stored in the `uicc_t` structure. @@ -116,3 +120,37 @@ The **IMEISV**, is encoded using the `fill_imeisv()` helper. This function extra See TS 24.501 §4.4 for reference. +#### SUCI (Subscription Concealed Identifier) + +The **SUCI**, is generated using the `fill_suci()` helper. This function extracts the MCC, MNC, and MSIN from the configured `imsi` with the use of `nmc_size` in the UICC context and populates the mobile identity structure. + +Contains: +* MCC and MNC (public network identity) +* Routing Indicator +* Protection Scheme ID +* Home Network Public Key ID +* Concealed or clear MSIN depending on the protection scheme + +If the UE is unable to generate SUCI due to configuration or crypto limitations, the UE will fail to generate a `Registration Request`. + +###### 0. Null Scheme (TS 33.501 §C.2) + +MSIN in cleartext. + +###### 1. Profile A (TS 33.501 §C.3.4.1) + +MSIN is concealed using elliptic curve cryptography. +Based on: +* Curve25519 for key agreement +* X9.63 KDF for key derivation + +(requires OpenSSL ≥ 3.0) + +###### 2. Profile B (TS 33.501 §C.3.4.2) + +MSIN is concealed using elliptic curve cryptography. +Based on: +* P-256 for key agreement +* X9.63 KDF for key derivation + +(currently not supported) diff --git a/doc/BUILD.md b/doc/BUILD.md index 063c31dbe1..c8efd3a4b0 100644 --- a/doc/BUILD.md +++ b/doc/BUILD.md @@ -2,9 +2,9 @@ # OAI Build Procedures -[[_TOC_]] +This page describes how to build OAI. -This page is valid on tags starting from **`2019.w09`**. +[[_TOC_]] ## Overview @@ -12,7 +12,11 @@ The [OAI EPC](https://github.com/OPENAIRINTERFACE/openair-epc-fed/blob/master/do OAI softmodem sources, which aim to implement 3GPP compliant UEs, eNodeB and gNodeB can be downloaded from the Eurecom [gitlab repository](./GET_SOURCES.md). -Sources come with a build script [build_oai](../cmake_targets/build_oai) located at the root of the `openairinterface5g/cmake_targets` directory. This script is developed to build the oai binaries (executables,shared libraries) for different hardware platforms, and use cases. +The historically convential way to build OAI is +[build_oai](../cmake_targets/build_oai) located at the root of the +`openairinterface5g/cmake_targets` directory. This script is developed to build +the oai binaries (executables,shared libraries) for different hardware +platforms, and use cases, and is a wrapper on top of `cmake`. The main oai binaries, which are tested by the Continuous Integration process are: @@ -39,6 +43,81 @@ The oai softmodem supports many use cases, and new ones are regularly added. Mos - s1, noS1 - all simulators as the rfsimulator, the L2 simulator, with exception of PHY simulators, which are distinct executables. +## Dependencies + +TODO. + +## Running `cmake` directly + +As mentioned, `build_oai` is a wrapper on top of `cmake`. It is therefore +possible, and now recommended, to run `cmake` directly. To build all of OAI in +a default install: + +``` +cd openairinterface5g +mkdir build +cd build +cmake .. -GNinja +ninja +``` + +Alternatively, let cmake generate the directory: + +``` +cd openairinterface5g +cmake -B build -G Ninja +cmake --build build +``` + +To build additional libraries, e.g., telnetsrv, do the following: +```bash +cmake .. -GNinja -DENABLE_TELNETSRV=ON +ninja telnetsrv +``` + +A list of all libraries can be seen using `ccmake ..` or `cmake-gui ..`. + +The default target directory of `build_oai` is the following, for historical +reasons: +```bash +cd openairinterface5g/cmake_targets/ran_build/build +cmake ../../.. -GNinja +ccmake ../../.. +cmake-gui ../../.. +``` + +You can of course use all standard cmake/ninja/make commands in this directory, +assuming you already build with `build_oai`. For instance, to compile sources +after modifying the code, do +``` +cd cmake_targets/ran_build/build +ninja +``` + +### cmake presets + +CMake presets are common project configure options. See [here](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html). + +Configure presets: + + - `default`: Configure compilation with default options + - `tests`: Same as above but `ENABLE_TESTS` and `SANITIZE_ADDRESS` is ON + +Build presets: + + - `5gdefault`: Build the software for NR rfsimulator test + - `default`: same as 5gdefault + - `4gdefault`: Build the software for LTE rfsimulator test + - `tests`: build all unit tests + +To configure using configuration preset: + + cmake --preset + +To build using a build preset: + + cmake --build --preset + ## Running `build_oai` ### List of options @@ -176,60 +255,6 @@ Some libraries have further dependencies and might not build on every system: - `websrv`: npm and others - `ldpc_aal`: DPDK with patch -## Running `cmake` directly - -`build_oai` is a wrapper on top of `cmake`. It is therefore possible to run `cmake` directly. An example using `ninja`: to build all "main targets" for 5G, excluding additional libraries: -``` -cd openairinterface5g -mkdir build && cd build -cmake .. -GNinja && ninja nr-softmodem nr-uesoftmodem nr-cuup params_libconfig coding rfsimulator ldpc -``` - -To build additional libraries, e.g., telnetsrv, do the following: -```bash -cmake .. -GNinja -DENABLE_TELNETSRV=ON && ninja telnetsrv -``` - -A list of all libraries can be seen using `ccmake ..` or `cmake-gui ..`. - -It is currently not possible to build all targets in the form of `cmake .. --GNinja && ninja`: currently, SDRs are always exposed, even if you don't have -the dependencies, and some targets are simply broken. Again, `build_oai` list -all targets that it builds, and you can use them with `ninja` - -The default target directory of `build_oai` is the following, for historical reasons: -```bash -cd openairinterface5g/cmake_targets/ran_build/build -cmake ../../.. -GNinja -ccmake ../../.. -cmake-gui ../../.. -``` -You can of course use all standard cmake/ninja/make commands in this directory. - -### cmake presets - -CMake presets are common project configure options. See [here](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html). - -Configure presets: - - - `default`: Configure compilation with default options - - `tests`: Same as above but ENABLE_TESTS and SANITIZE_ADDRESS is ON - -Build presets: - - - `5gdefault`: Build the software for NR rfsimulator test - - `default`: same as 5gdefault - - `4gdefault`: Build the software for LTE rfsimulator test - - `tests`: build all unit tests - -To configure using configuration preset: - - cmake --preset - -To build using a build preset: - - cmake --build --preset - ## Cross Compile If you want to use cross-compiler on x86 platform for aarch64 version, please refer the [cross-compile.md](./cross-compile.md) for more information. diff --git a/doc/Doxyfile b/doc/Doxyfile index f89d2fd26f..fad5807544 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -1066,6 +1066,8 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../openair3/NGAP/ngap_gNB_overload.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair3/NGAP/ngap_gNB_default_values.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair3/SECU/secu_defs.c \ +@CMAKE_CURRENT_SOURCE_DIR@/../openair3/SECU/curve_25519.h \ +@CMAKE_CURRENT_SOURCE_DIR@/../openair3/SECU/x963_kdf.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair3/SECU/sha_256_hmac.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair3/SECU/nas_stream_eea0.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair3/SECU/aes_128_ecb.h \ @@ -1088,6 +1090,8 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../openair3/SECU/aes_128_ctr.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair3/SECU/nas_stream_eia2.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair3/SECU/snow3g.c \ +@CMAKE_CURRENT_SOURCE_DIR@/../openair3/SECU/curve_25519.c \ +@CMAKE_CURRENT_SOURCE_DIR@/../openair3/SECU/x963_kdf.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair3/SECU/sha_256_hmac.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair3/SECU/aes_128_cbc_cmac.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair3/SECU/nas_stream_eia1.c \ @@ -1797,34 +1801,27 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/pdcp_messages_def.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/mac_rrc_primitives.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/ngap_messages_def.h \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/rlc_messages_def.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/m3ap_messages_def.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/sctp_messages_def.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/x2ap_messages_types.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/commonDef.h \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/udp_messages_def.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/nas_messages_types.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/sctp_messages_types.h \ @CMAKE_CURRENT_SOURCE_DIR@/../common/platform_types.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/ngap_messages_types.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/gtpv1_u_messages_types.h \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/rlc_messages_types.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/e1ap_messages_def.h \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/phy_messages_def.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/s1ap_messages_types.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/networkDef.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/f1ap_messages_types.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/mac_messages_types.h \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/udp_messages_types.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/gtpv1_u_messages_def.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/s1ap_messages_def.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/rrc_messages_types.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/e1ap_messages_types.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/m3ap_messages_types.h \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/phy_messages_types.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/x2ap_messages_def.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/mac_messages_def.h \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/openair_defs.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/as_message.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/nas_messages_def.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/COMMON/pdcp_messages_types.h \ diff --git a/doc/LDPC_OFFLOAD_SETUP.md b/doc/LDPC_OFFLOAD_SETUP.md index 4030f2127a..bb30efaa8f 100644 --- a/doc/LDPC_OFFLOAD_SETUP.md +++ b/doc/LDPC_OFFLOAD_SETUP.md @@ -305,7 +305,6 @@ Example configuration snippet: ... MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 180; @@ -322,7 +321,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 100; diff --git a/doc/NR_SA_Tutorial_COTS_UE.md b/doc/NR_SA_Tutorial_COTS_UE.md index ea8e41155b..7f73be72f0 100644 --- a/doc/NR_SA_Tutorial_COTS_UE.md +++ b/doc/NR_SA_Tutorial_COTS_UE.md @@ -201,7 +201,7 @@ With devices like the USRP N300 and especially the X300, there is noise in the D There are two possible solution that can be enabled in OAI: * `--tune-offset`: it consists in shifting away the operational bandwidth to avoid the center frequency -* `ul_prbblacklist`: can be used to define specific PRBs that should not be used for uplink scheduling +* `gNBs.[0].ul_prbblacklist`: can be used to define specific PRBs that should not be used for uplink scheduling A spectrum clean from the noisy PRBs will eventually result in an enhanced UL throughput. diff --git a/doc/NR_SA_Tutorial_OAI_nrUE.md b/doc/NR_SA_Tutorial_OAI_nrUE.md index aa845965bc..4582b78ceb 100644 --- a/doc/NR_SA_Tutorial_OAI_nrUE.md +++ b/doc/NR_SA_Tutorial_OAI_nrUE.md @@ -179,39 +179,23 @@ uicc0 = { } ``` -| **Parameter** | **Description** | **Default Value** | -|---------------|-----------------|-------------------| -| **IMSI** | Unique identifier for the UE within the mobile network. Used by the network to identify the UE during authentication. It ensures that the UE is correctly identified by the network. | 001010000000001 | -| **key** | Cryptographic key shared between the UE and the network, used for encryption during the authentication process. | `fec86ba6eb707ed08905757b1bb44b8f` | -| **OPC** | Operator key for the Milenage Authentication and Key Agreement algorithm used for encryption during the authentication process. | Ensures secure communication between the UE and the network by matching the encryption keys. | `C42449363BBAD02B66D16BC975D77CC1` | -| **DNN** | _Deprecated_: Specifies the name of the data network the UE wishes to connect to, similar to an APN in 4G networks. | `oai` | -| **NSSAI** | _Deprecated_: Allows the UE to select the appropriate network slice, which provides different QoS. | `1` | -| **pdu_sessions** | list of PDU sessions to request | empty array (no PDU session) | +Further information about the meaning of these parameters is described in the +[dedicated nrUE configuration page](./runmodem-nrue.md). -Note that DNN and NSSAI parameters are deprecated, and `pdu_sessions` should be -used. If the `pdu_sessions` array is present, DNN and NSSAI are ignored. - -Each element within the `pdu_sessions` array takes the following parameters. -Multiple PDU sessions can be requested. - -| **Parameter** | **Description** | **Default Value** | -|---------------|-----------------|-------------------| -| `id` | ID of the PDU session to request | index of the current element (1..16) | -| `type` | Type of the PDU session to request (allowed: `IPv4`, `IPv6`, `IPv4v6`, `Ethernet` | `IPv4` | -| `dnn` | Specifies the name of the data network the UE wishes to connect to | `oai` | -| `nssai_sst` | Slice Service Type to request (1=eMBB, 2=URLLC, 3=mMTC) | `1` | -| `nssai_sd` | Slice Differentiator to request | `0xffffff` (meaning "no SD") | - -The UE configuration must match the one of the network's AMF. The nrUE can connect by default to OAI CN5G with no need to provide the configuration file. - -When running the `nr-uesoftmodem`, one can specify the nrUE configuration file using the `-O` option. E.g.: +The UE configuration must match the one of the network's AMF. When running the +`nr-uesoftmodem`, one can specify the nrUE configuration file using the `-O` +option. E.g.: ```bash sudo ./nr-uesoftmodem --rfsim --rfsimulator.[0].serveraddr 127.0.0.1 -r 106 --numerology 1 --band 78 -C 3619200000 -O ~/nrue.uicc.conf ``` -The CL option `--uicc0.imsi` can override the IMSI value in the configuration file if necessary (e.g. when running multiple UEs): `--uicc0.imsi 001010000000001`. -More details available at [ci-scripts/yaml_files/5g_rfsimulator/README.md](../ci-scripts/yaml_files/5g_rfsimulator/README.md). +The command line option `--uicc0.imsi` can override the IMSI value in the +configuration file if necessary (e.g. when running multiple UEs): `--uicc0.imsi +001010000000001`. + +More details can also be found at +[ci-scripts/yaml_files/5g_rfsimulator/README.md](../ci-scripts/yaml_files/5g_rfsimulator/README.md). **Note:** From tag `2024.w45`, OAI nrUE runs by default in standalone (SA) mode. In earlier versions the default mode was non-standalone (NSA). diff --git a/doc/ORAN_FHI7.2_Tutorial.md b/doc/ORAN_FHI7.2_Tutorial.md index 087c07a1a0..6e50afa3d2 100644 --- a/doc/ORAN_FHI7.2_Tutorial.md +++ b/doc/ORAN_FHI7.2_Tutorial.md @@ -378,7 +378,7 @@ Download ORAN FHI DU library, checkout the correct version, and apply the correc #### F release ```bash -git clone https://gerrit.o-ran-sc.org/r/o-du/phy.git ~/phy +git clone https://github.com/openairinterface/o-du-phy.git ~/phy cd ~/phy git checkout oran_f_release_v1.0 git apply ~/openairinterface5g/cmake_targets/tools/oran_fhi_integration_patches/F/oaioran_F.patch diff --git a/doc/README.md b/doc/README.md index a45cc68570..37fe2a980d 100644 --- a/doc/README.md +++ b/doc/README.md @@ -18,10 +18,6 @@ Beware if you previously pulled the `develop` branch that your repository may be - [FEATURE_SET.md](./FEATURE_SET.md): lists supported features - [GET_SOURCES.md](./GET_SOURCES.md): how to download the sources - [BUILD.md](./BUILD.md): how to build the sources -- [code-style-contrib.md](./code-style-contrib.md): overall working practices, code style, and review process -- [cross-compile.md](./cross-compile.md): how to cross-compile OAI for ARM -- [clang-format.md](./clang-format.md): how to format the code -- [sanitizers.md](./dev_tools/sanitizers.md): how to run with ASan/UBSan/MemSAN/TSan - [environment-variables.md](./environment-variables.md): the environment variables used by OAI - [tuning_and_security.md](./tuning_and_security.md): performance and security considerations @@ -34,20 +30,21 @@ There is some general information in the [OpenAirInterface Gitlab Wiki](https:// * [OAI gNB with COTS UE](./NR_SA_Tutorial_COTS_UE.md) * [OAI NR-UE](./NR_SA_Tutorial_OAI_nrUE.md) * [Multiple OAI NR-UE with RFsimulator](./NR_SA_Tutorial_OAI_multi_UE.md) -- [RUNMODEM.md](./RUNMODEM.md): Generic information on how to +- [RUNMODEM.md](./RUNMODEM.md): Information on how to run the gNB * Run simulators * Run with hardware - * Specific OAI modes (phy-test, do-ra, noS1) * (5G) Using SDAP and custom DRBs * IF setups and arbitrary frequencies * MIMO +- [nrUE-specific configuration and modes](./runmodem-nrue.md) + * Specific OAI modes (phy-test, do-ra, noS1) - [How to run OAI with O-RAN 7.2 FHI](./ORAN_FHI7.2_Tutorial.md) - [How to run a 5G-NSA setup](./TESTING_OAI_NSA_COTS_UE.md) - [How to run a 4G setup using L1 simulator](./L1SIM.md) _Note: we recommend the RFsimulator_ - [How to use the L2 simulator](./L2NFAPI.md) - [How to use the OAI channel simulator](../openair1/SIMULATION/TOOLS/DOC/channel_simulation.md) +- [How to run an NTN setup](./ntn-configuration.md) - [How to use GPU-accelerated channel simulation](../openair1/SIMULATION/TOOLS/DOC/gpu_acceleration.md) -- [How to use multiple BWPs](./RUN_NR_multiple_BWPs.md) - [How to run OAI-VNF and OAI-PNF](./nfapi.md): how to run the FAPI/nFAPI split, including some general remarks on FAPI/nFAPI. - [How to use the positioning reference signal (PRS)](./RUN_NR_PRS.md) @@ -133,7 +130,13 @@ The other SDRs (AW2S, LimeSDR, ...) have no READMEs. ## Developer tools +- [code-style-contrib.md](./code-style-contrib.md): overall working practices, code style, and review process +- [cross-compile.md](./cross-compile.md): how to cross-compile OAI for ARM +- [clang-format.md](./clang-format.md): how to format the code. See also the + next entry for an error detection tool. - [formatting](../tools/formatting/README.md) is a clang-format error detection tool +- [sanitizers.md](./dev_tools/sanitizers.md): how to run with ASan/UBSan/MemSAN/TSan - [iwyu](../tools/iwyu/README.md) is a tool to detect `#include` errors - [docker-dev-env](../tools/docker-dev-env/README.md) is a ubuntu24 docker development environment +- [performance analysis with tracy](./dev_tools/tracy.md) - [doc_best_practices.md](./doc_best_practices.md): overall best practices for writing documentations diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md index 3fc9410c2f..6fcf415364 100644 --- a/doc/RUNMODEM.md +++ b/doc/RUNMODEM.md @@ -1,596 +1,249 @@ -# Running OAI 5G Softmodems +# Running the OAI 5G gNB (nr-softmodem) + +This document is a general overview of running `nr-softmodem`, the OAI 5G +gNodeB executable. For build instructions see [BUILD.md](BUILD.md). For UE +documentation see [runmodem-nrue.md](runmodem-nrue.md). -This document explains some options for running 5G executables. -After you have [built the softmodem executables](BUILD.md) you can set your -default directory to the build directory `cmake_targets/ran_build/build/` and -start testing some use cases. Below, the description of the different OAI -functionalities should help you choose the OAI configuration that suits your -need. [[_TOC_]] -## Simulators +## Modes of operation + +`nr-softmodem` supports several deployment modes. The default is "standalone" +mode. + +| Option | Mode | Description | +|----------|------------|-------------| +| _none_ | standalone | Run gNB in SA mode (no flag). | +| `--nsa` | NSA | Non-standalone mode, requires an LTE eNB, see [NSA documentation](TESTING_OAI_NSA_COTS_UE.md). | +| phy-test | `--phy-test` | Test modes without random access, see [nrUE page](runmodem-nrue.md). | +| do-ra | `--do-ra` | Test mode without a core network or RRC connection, see [nrUE page](runmodem-nrue.md). | +| noS1 | `--noS1` | Manually inject traffic, suitable for phy-test/do-ra without core network. | + +## Basic invocation + +From the build directory (with `build_oai`, by default `cmake_targets/ran_build/build/`): + +```bash +sudo ./nr-softmodem -O [options] +``` + +Example with a USRP B210: +```bash +sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf -E --continuous-tx +``` + +CI-tested sample configuration files are in `ci-scripts/conf_files/`. Sample +configuration files for various hardware can be found under +`targets/PROJECTS/GENERIC-NR-5GC/CONF/`. + +## Configuration file + +The configuration file can use either libconfig (`.conf`) or YAML (`.yaml`) +syntax, based on the file ending. The main sections are: + +- `gNBs`: cell identity, PLMN, physical cell parameters, AMF address +- `MACRLCs`: MAC/RLC layer settings +- `L1s`: L1 layer settings and thread pinning +- `RUs`: radio unit configuration (device selection, antennas, gains) +- `security`: ciphering and integrity algorithm preferences +- `log_config`: per-module log levels + +Individual parameters can be overridden on the command line using the +`--Section.[index].param value` syntax, e.g. +`--gNBs.[0].min_rxtxtime 6`. + +### Core network connectivity + +In the `gNBs` section, set the following to connect to a 5G core (AMF): + +``` +gNBs = ( +{ + tracking_area_code = 1; + plmn_list = ({ mcc = 001; mnc = 01; mnc_length = 2; snssaiList = ({ sst = 1; sd = 0xffffff; }) }); + nr_cellid = 12345678L; + + amf_ip_address = ({ ipv4 = "192.168.70.132"; }); + + NETWORK_INTERFACES : + { + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129"; // N2 interface + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129"; // N3 interface + GNB_PORT_FOR_S1U = 2152; + }; +}); +``` + +- `plmn_list` must match the PLMN configured in the AMF. +- `amf_ip_address` is the IP address of the AMF. +- `GNB_IPV4_ADDRESS_FOR_NG_AMF` is the local IP address of the gNB's N2 interface. +- `GNB_IPV4_ADDRESS_FOR_NGU` is the local IP address of the gNB's N3 interface. + +### MAC configuration + +In the `MACRLCs` section, configure MAC parameters. See the [MAC user +documentation](MAC/mac-usage.md) for more information. + +### L1 configuration + +The `L1s` section configures the L1 (physical layer) processing pipeline. + +- `tr_n_preference`: transport to the MAC layer. Normally `local_mac` (shared + memory). Set to `nfapi` for a networked L1/MAC split; see [nFAPI docs](nfapi.md). +- `prach_dtx_threshold`: energy threshold (in dB x10) for PRACH preamble detection. Lower + values increase sensitivity but may cause false detections. Typical range: + 60–200. +- `pucch0_dtx_threshold`: energy threshold for PUCCH format 0 (SR/HARQ-ACK) + detection. Similar trade-off as `prach_dtx_threshold`. Typical range: 10–100. +- `pusch_dtx_threshold`: energy threshold for PUSCH detection. Similar + trade-off as `prach_dtx_threshold`. Typical range: 10–100. +- `ofdm_offset_divisor`: controls a small timing advance applied to the OFDM + signal to ensure samples arrive before the processing deadline. Set to + `UINT_MAX` (i.e., `4294967295`) for zero offset; a value of `8` gives an + offset of `frame_length / 8`. The default value of `8` works well in most + cases. +- `max_ldpc_iterations`: maximum number of LDPC decoder iterations. Fewer + iterations reduce CPU load at the cost of UL error rate. Default is 8, but + might be as high as 20 or more.. +- `L1_rx_thread_core` / `L1_tx_thread_core`: pin the L1 RX and TX threads to + specific isolated CPU cores. Recommended for real-time performance, especially + with O-RAN 7.2 fronthaul. +- `phase_compensation` (FHI 7.2 only): set to `0` if phase compensation is done + in the O-RU, `1` if it should be done in the DU (software). Must match the + O-RU configuration. +- `tx_amp_backoff_dB` (FHI 7.2 only): output amplitude backoff in dB relative + to full scale. Must be set according to the O-RU vendor documentation to avoid + exceeding the RU's power limits. + +### RU configuration + +The `RUs` section describes the radio unit, i.e., either an integrated RF device +(split 8 radio) or a remote RU connected via a fronthaul interface (e.g., O-RU). + +- `local_rf`: `"yes"` for a locally attached RF device (USRP, etc.), `"no"` + for a remote RU (e.g., O-RAN 7.2 fronthaul). +- `nb_tx` / `nb_rx`: number of TX and RX antenna ports. Must be consistent with + the antenna port configuration in `gNBs` (see [MIMO section](#5g-gnb-mimo-configuration)). +- `att_tx` / `att_rx`: software attenuation applied to TX/RX samples in dB. + Used to reduce signal levels in software before they reach the RF device. +- `bands`: list of NR band numbers this RU operates on, e.g. `[78]`. +- `max_pdschReferenceSignalPower`: maximum PDSCH reference signal power in dBm. + Used by the UE for path loss estimation. Should match the actual transmit + power level. +- `max_rxgain`: maximum RX gain of the RF device in dB. This is the hardware + gain limit; the actual gain used may be lower. +- `clock_src`: clock reference source. `"internal"` uses the device's own + oscillator; `"external"` expects an external 10 MHz reference; `"gpsdo"` + uses a GPS-disciplined oscillator. Applicable only for USRP. +- `sdr_addrs`: device address string passed to the RF driver. Used notably with + USRP and BladeRF devices. +- `ru_thread_core`: CPU core for the RU fronthaul thread. Should + be an isolated core (FHI 7.2 only). + +### Frequency and cell configuration + +Key parameters in `servingCellConfigCommon`: + +- `absoluteFrequencySSB` / `dl_absoluteFrequencyPointA`: DL frequency in NR-ARFCN for SSB and PointA +- `dl_frequencyBand` / `ul_frequencyBand`: NR band number +- `dl_carrierBandwidth` / `ul_carrierBandwidth`: bandwidth in PRBs +- `dl_subcarrierSpacing`: subcarrier spacing (0=15 kHz, 1=30 kHz, 2=60 kHz, 3=120 kHz) +- `ssPBCH_BlockPower`: SSB transmit power in dBm (EPRE of SSB resource elements) +- `prach_ConfigurationIndex`, `prach_msg1_FrequencyStart`: PRACH configuration + +For a reference of frequency parameters and band configurations see +[gNB frequency setup](gNB_frequency_setup.md). + +### Security + +The `security` section controls NAS/AS security algorithm selection: + +``` +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; +``` + +## Common radio devices ### RFsimulator -The RFsimulator is an OAI device replacing the radio heads (for example the -USRP device). It allows connecting the oai UE (LTE or 5G) and respectively the -oai eNodeB or gNodeB through a network interface carrying the time-domain -samples, getting rid of over the air unpredictable perturbations. This is the -ideal tool to check signal processing algorithms and protocols implementation. -The RFsimulator has some preliminary support for channel modeling. +The RFsimulator replaces the radio device with a virtual radio, allowing +gNB and UE to run without hardware. Built by default. Ideal for testing, +debugging, and development. Add `--rfsim` to the command line. -It is planned to enhance this simulator with the following functionalities: +See the [RFsimulator documentation](../radio/rfsimulator/README.md). -- Support for multiple eNodeB's or gNodeB's for hand-over tests +### USRP (B2xx, N3xx, X3xx, x4xx) -This is an easy use-case to setup and test, as no specific hardware is required. The [rfsimulator page](../radio/rfsimulator/README.md) contains the detailed documentation. +Build with `build_oai -w USRP`/`cmake -DOAI_USRP=ON`. The device is selected +automatically. Common per-device recommendations: -### L2 nFAPI Simulator +- B210: use `-E --continuous-tx`; limited to ~40 MHz bandwidth +- N3xx/X3xx: use `--usrp-tx-thread-config 1`; consider `--tune-offset` or + `ul_prbblacklist` for DC noise at high bandwidth -This simulator connects an eNodeB and UEs through an nFAPI interface, -short-cutting the L1 layer. The objective of this simulator is to allow multi -UEs simulation, with a large number of UEs (ideally up to 255). +For network tuning of 10G USRP devices (N300, X300): +```bash +sudo ethtool -G tx 4096 rx 4096 +sudo sysctl -w net.core.wmem_max=62500000 +sudo sysctl -w net.core.rmem_max=62500000 +``` -As for the RFsimulator, no specific hardware is required. The [L2 nfapi -simulator page](./L2NFAPI.md) contains the detailed documentation. +See also the [COTS UE tutorial](NR_SA_Tutorial_COTS_UE.md) and +[performance tuning guide](tuning_and_security.md). -## Running with a true radio head +### O-RAN 7.2 Fronthaul (FHI) -OAI supports different radio heads, the following are tested in the CI: +For O-RAN split 7.2 with an O-RU, build with `build_oai -t +oran_fhlib_5g`/`cmake -DOAI_FHI72=ON`. Configuration requires a `fhi_72` +section and DPDK setup. See the [O-RAN FHI 7.2 tutorial](ORAN_FHI7.2_Tutorial.md). -1. [Monolithic eNodeB](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNBNew) where the whole signal processing is performed in a single process -2. IF4P5 mode, where frequency domain samples are carried over ethernet, from the RRU which implement part of L1(FFT,IFFT,part of PRACH), to a RAU -3. Monolithic gNodeB: see next section, or the [standalone tutorial](NR_SA_Tutorial_COTS_UE.md) +## Higher-layer splits +### CU/DU (F1) and CU-CP/CU-UP (E1) splits -## 5G NR +F1 splits the gNB into a CU (RRC/PDCP/SDAP) and one or more DUs (RLC/MAC/L1). +See [F1AP docs](F1AP/F1-design.md). The CU and DU connect via F1AP over SCTP. +The DU configuration specifies the CU IP address. -### NSA setup with COTS UE - -This setup requires an EPC, an OAI eNB and gNB, and a COTS Phone. A dedicated page describe the setup can be found [here](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home/gNB-COTS-UE-testing). -The `--nsa` flag must be used to run gNB in non-standalone mode. - - -#### Launch eNB +To run a split gNB, start a CU and one or more DUs separately: ```bash -sudo ./lte-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50prb.usrpb210.conf +# CU +sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf + +# DU +sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf ``` -#### Launch gNB +E1 splits the CU into a CU-CP (RRC) and one or more CU-UPs (PDCP/SDAP) (and +therefore also requires F1). See [E1AP docs](E1AP/E1-design.md). -```bash -sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --nsa -``` +### FAPI/nFAPI splits -You should see the X2 messages in Wireshark and at the eNB. - -### SA setup with OAI NR-UE - -The standalone mode is the default mode. - -Before tag `2024.w45`, the default mode was NSA. Thus, in the past, to run -either the gNB or the UE in standalone mode, it was necessary to provide the -`--sa` flag in the command line. This is not the case anymore. If provided -the softmodem exits reporting that it does not know this option. - -The default (SA) mode does the following: -- At the gNB: -* The RRC encodes SIB1 according to the configuration file and transmits it through NR-BCCH-DL-SCH. - -- At the UE: -* Decode SIB1 and starts the 5G NR Initial Access Procedure for SA: - 1) 5G-NR RRC Connection Setup - 2) NAS Authentication and Security - 3) 5G-NR AS Security Procedure - 4) 5G-NR RRC Reconfiguration - 5) Start Downlink and Uplink Data Transfer - -Command line parameters for UE in standalone mode: -- `-C` : downlink carrier frequency in Hz (default value 0) -- `--CO` : uplink frequency offset for FDD in Hz (default value 0) -- `--numerology` : numerology index (default value 1) -- `-r` : bandwidth in terms of RBs (default value 106) -- `--band` : NR band number (default value 78) -- `--ssb` : SSB start subcarrier (default value 516) - -To simplify the configuration for the user testing OAI UE with OAI gNB, the latter prints the following LOG that guides the user to correctly set some of the UE command line parameters: - -```shell -[PHY] Command line parameters for OAI UE: -C 3319680000 -r 106 --numerology 1 --ssb 516 -``` - -You can run this, using USRPs, on two separate machines: - -```shell -sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --gNBs.[0].min_rxtxtime 6 -sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --ssb 516 -``` - -With the **RFsimulator** (on the same machine), just add the option `--rfsim` to both gNB and NR UE command lines. - -UE capabilities can be passed according to the [UE Capabilities](#UE-Capabilities) section. - -A detailed tutorial is provided at this page [NR_SA_Tutorial_OAI_nrUE.md](./NR_SA_Tutorial_OAI_nrUE.md). - -### Optional NR-UE command line options - -Here are some useful command line options for the NR UE: - -| Parameter | Description | -|--------------------------|---------------------------------------------------------------------------------------------------------------| -| `--ue-scan-carrier` | Scan for cells in current bandwidth. This option can be used if the SSB position of the gNB is unknown. If multiple cells are detected, the UE will try to connect to the first cell. By default, this option is disabled and the UE attempts to only decode SSB given by `--ssb`. | -| `--ue-fo-compensation` | Enables the initial frequency offset compensation at the UE. Useful when running over the air and/or without an external clock/time source. | -| `--cont-fo-comp` | Enables the continuous frequency offset (FO) estimation and compensation. Parameter value `1` specifies that the main FO contribution comes from the local oscillator's (LO) accuracy. Parameter value `2` specifies that the main FO contribution comes from Doppler shift. Parameter value `3` specifies that no measured residual DL FO is considered for UL FO pre-compensation. | -| `--initial-fo` | Sets the known initial frequency offset. Useful especially with large Doppler frequency, e.g. LEO satellite. | -| `--freq-sync-P` | Sets the coefficient for the Proportional part of the PI-controller for the continuous frequency offset compensation. Default value 0.01. | -| `--freq-sync-I` | Sets the coefficient for the Integrating part of the PI-controller for the continuous frequency offset compensation. Default value 0.001. | -| `--ntn-initial-time-drift` | Sets the initial NTN DL time drift (feeder link and service link), given in µs/s. | -| `--autonomous-ta` | Enables the autonomous TA update, based on DL drift (useful if main contribution to DL drift is movement, e.g. LEO satellite). | -| `--time-sync-P` | Sets the coefficient for the Proportional part of the PI-controller for the time synchronization. Default value 0.5. | -| `--time-sync-I` | Sets the coefficient for the Integrating part of the PI-controller for the time synchronization. Default value 0.0. | -| `--usrp-args` | Equivalent to the `sdr_addrs` field in the gNB config file. Used to identify the USRP and set some basic parameters (like the clock source). | -| `--clock-source` | Sets the clock source (internal or external). | -| `--time-source` | Sets the time source (internal or external). | - -You can view all available options by typing: - -```shell -./nr-uesoftmodem --help -``` - -### NR UE: Configure multiple RF-frontends (RUs) - -Multiple RF-frontends (also called RUs) can be defined for the nr-uesoftmodem. -Therefore, two sections in the NR UE configuration file are used: -- `RUs` -- `cells` - -The `RUs` section in the NR UE configuration file contains an array of elements, where each element has these properies: - -| Property name | Type | Default value | Description | -| ---------------- | -------------- | ------------- | ------------------------------------ | -| nb_tx | integer | 1 | Number of TX Antennas | -| nb_rx | integer | 1 | Number of RX Antennas | -| att_tx | integer | 0 | TX Attenuation in dB | -| att_rx | integer | 0 | RX Attenuation in dB | -| max_rxgain | integer | 120 | Maximum RX Gain at 0 dB Attenuation | -| sdr_addrs | string | type=b200 | SDR Parameter String | -| tx_subdev | string | | SDR TX Subdevice | -| rx_subdev | string | | SDR RX Subdevice | -| clock_src | string | internal | SDR Clock Source | -| time_src | string | internal | SDR Time Source | -| tune_offset | floating point | 0.0 | SDR Tune Offset in Hz | -| if_freq | integer | 0 | DL Intermediate Frequency in Hz | -| if_offset | integer | 0 | UL Intermediate Frequency Offset in Hz | - -The `cells` section in the NR UE configuration file contains an array of elements, where each element has these properies: - -| Property name | Type | Default value | Description | -| ---------------- | ------- | ------------- | ---------------------------------------- | -| ru_id | integer | 0 | ID of the associated RU from the `RUs` section | -| band | integer | 78 | 5G NR Band | -| rf_freq | integer | 0 | DL Carrier Centre Frequency in Hz | -| rf_offset | integer | 0 | DL Carrier Centre Frequency Offset in Hz | -| numerology | integer | 1 | 5G NR Numerology (µ) | -| N_RB_DL | integer | 106 | Number of DL Carrier Ressource Blocks | -| ssb_start | integer | 516 | Ressource Element where the SSB Starts | - -There are different scenarios where multiple RF-frontends (also called RUs) are beneficial for the NR UE: - -1. RF-Simulator Inter-Frequency Handover between multiple cells -2. Multiple UEs in one instance, each using their own RF-frontend (RF-Simulator connection) -3. Different Antennas connected to different RF-ports -4. Concurrent connection to multiple carriers (carrier aggregation CA) - -This would be and example configuration for the 1. scenario: - -``` -rfsimulator = ( - { - serveraddr = "127.0.0.2"; - serverport = 4043; - }, { - serveraddr = "127.0.0.3"; - serverport = 4044; - } -); - -RUs = ( - { - nb_tx = 1; - nb_rx = 1; - }, { - nb_tx = 1; - nb_rx = 1; - } -); - -cells = ( - { - ru_id = 0; - band = 78; - rf_freq = 3619200000L; - numerology = 1; - N_RB_DL = 106; - ssb_start = 516; - }, { - ru_id = 1; - band = 78; - rf_freq = 3649440000L; - numerology = 1; - N_RB_DL = 106; - ssb_start = 516; - } -); -``` - -An example for the 2. scenario can be found in the file [ci-scripts/yaml_files/5g_rfsimulator_multiue/nrue.uicc.conf](../ci-scripts/yaml_files/5g_rfsimulator_multiue/nrue.uicc.conf). - -The 3. scenario is similar to 1., but instead of providing RF-Simulator parameters, actual SDR parameters have to be provided. - -The 4. scenario is not supported, as the NR UE does not implement CA, yet. - -Current Limitations: -- Each RU can be used by only one cell. -- Each RU and cell can be used by only one UE (no RU sharing implemented, yet). -- The sampling rates of all RUs must be the same. - -### Common gNB and NR UE command line options - -#### Three-quarter sampling - -The command line option `-E` can be used to enable three-quarter sampling for split 8 sample rate. Required for certain radios (e.g., 40MHz with B210). If used on the gNB, it is a good idea to use for the UE as well (and vice versa). - -#### UE Capabilities - -The `--uecap_file` option can be used to pass the UE Capabilities input file (path location + filename), e.g.`--uecap_file ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports1.xml` for 1 layer or e.g. `--uecap_file ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports2.xml` for 2 layers. - -This option is available for the following combinations of operation modes and gNB/nrUE softmodems: - -| Mode | Executable | Description | -|------------|----------------|-----------------------------------------------------| -| SA | nr-uesoftmodem | Send UE capabilities from the UE to the gNB via RRC | -| phy-test | nr-softmodem | Mimic the reception of UE capabilities by the gNB | -| do-ra | nr-softmodem | Mimic the reception of UE capabilities by the gNB | - -e.g. - -```shell -sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3319680000 --ue-nb-ant-tx 2 --ue-nb-ant-rx 2 --uecap_file /opt/oai-nr-ue/etc/uecap.xml -``` - -### How to run a NTN configuration - -#### NTN channel - -A 5G NR NTN configuration only works in a non-terrestrial setup. -Therefore either SDR boards and a dedicated NTN channel emulator are required, or RFsimulator has to be configured to simulate a NTN channel. - -As shown on the [rfsimulator page](../radio/rfsimulator/README.md), RFsimulator provides different possibilities. -E.g. to perform a simple simulation of a satellite in geostationary orbit (GEO), these parameters should be added to both gNB and UE command lines: -``` ---rfsimulator.[0].prop_delay 238.74 -``` - -For simulation of a satellite in low earth orbit (LEO), two channel models have been added to rfsimulator: -- `SAT_LEO_TRANS`: transparent LEO satellite with gNB on ground -- `SAT_LEO_REGEN`: regenerative LEO satellite with gNB on board - -Both channel models simulate the delay and Doppler for a circular orbit at 600 km height according to the Matlab function [dopplerShiftCircularOrbit](https://de.mathworks.com/help/satcom/ref/dopplershiftcircularorbit.html). -An example configuration to simulate a transparent LEO satellite with rfsimulator would be: -``` -channelmod = { - max_chan=10; - modellist="modellist_rfsimu_1"; - modellist_rfsimu_1 = ( - { - model_name = "rfsimu_channel_enB0" - type = "SAT_LEO_TRANS"; - noise_power_dB = -100; - }, - { - model_name = "rfsimu_channel_ue0" - type = "SAT_LEO_TRANS"; - noise_power_dB = -100; - } - ); -}; -``` -This configuration is also provided in the file `targets/PROJECTS/GENERIC-NR-5GC/CONF/channelmod_rfsimu_LEO_satellite.conf`. - -Additionally, rfsimulator has to be configured to apply the channel model. -This can be done by either providing this line in the conf file in section `rfsimulator`: -``` - options = ("chanmod"); -``` -Or by providing this the the command line parameters: -``` ---rfsimulator.[0].options chanmod -``` - -#### gNB - -The main parameters to cope with the large NTN propagation delay are cellSpecificKoffset, ta-Common, ta-CommonDrift and the ephemeris data (satellite position and velocity vectors). - -The parameter `ntn-UlSyncValidityDuration-r17` indicates the maximum time duration from epochtime during which the UE can apply assistance information without having acquired new assistance information. i.e this enables UE to re-read SIB19 before timer with value ulSyncValidityDuration expires. The unit of the field is in seconds. Example values for GEO: 240s, MEO: 20s, LEO: 5s. -As epochtime is not implemented yet, UE starts the timer from the TTI where SIB19 is received with ntn-UlSyncValidityDuration-r17 IE. - -The parameter `cellSpecificKoffset_r17` is the scheduling offset used for the timing relationships that are modified for NTN (see TS 38.213). -The unit of the field Koffset is number of slots for a given subcarrier spacing of 15 kHz. - -The parameter `ta-Common-r17` is used to provide the propagation delay between the reference point (at the gNB) and the satellite. -The granularity of ta-Common is 4.072 × 10^(-3) µs. Values are given in unit of corresponding granularity. - -The parameter `ta-CommonDrift-r17` indicates the drift rate of the common TA. -The granularity of ta-CommonDrift is 0.2 × 10^(-3) µs/s. Values are given in unit of corresponding granularity. - -The satellite position and velocity vartors are provided using the following parameters: - -`positionX-r17`, `positionY-r17`, `positionZ-r17`: -X, Y, Z coordinate of satellite position state vector in ECEF. Unit is meter. -Step of 1.3 m. Actual value = field value * 1.3. - -`velocityVX-r17`, `velocityVY-r17`, `velocityVZ-r17`: -X, Y, Z coordinate of satellite velocity state vector in ECEF. Unit is meter/second. -Step of 0.06 m/s. Actual value = field value * 0.06. - -These parameters can be provided to the gNB in the conf file in the section `servingCellConfigCommon`: -``` -... -# GEO satellite - cellSpecificKoffset_r17 = 478; - ta-Common-r17 = 58629666; # 238.74 ms - positionX-r17 = 0; - positionY-r17 = 0; - positionZ-r17 = 32433846; - velocityVX-r17 = 0; - velocityVY-r17 = 0; - velocityVZ-r17 = 0; -# LEO satellite -# cellSpecificKoffset_r17 = 40; -# ta-Common-r17 = 4634000; # 18.87 ms -# ta-CommonDrift-r17 = -230000; # -46 µs/s -# positionX-r17 = 0; -# positionY-r17 = -2166908; # -2816980.4 m -# positionZ-r17 = 4910784; # 6384019.2 m -# velocityVX-r17 = 0; -# velocityVY-r17 = 115246; # 6914.76 m/s -# velocityVZ-r17 = 50853; # 3051.18 m/s -... -``` - -Besides this, some timers, e.g. `sr_ProhibitTimer_v1700`, `t300`, `t301` and `t319`, in the conf file section `gNBs.[0].TIMERS` might need to be extended for GEO satellites. -``` -... - TIMERS : - { - sr_ProhibitTimer = 0; - sr_TransMax = 64; - sr_ProhibitTimer_v1700 = 512; - t300 = 2000; - t301 = 2000; - t319 = 2000; - }; -... -``` - -To improve the achievable UL and DL throughput in conditions with large RTT (esp. GEO satellites), there is a feature defined in REL17 to disable HARQ feedback. -This allows to reuse HARQ processes immediately, but it breaks compatibility with UEs not supporting this REL17 feature. -To enable this feature, the `disable_harq` flag has to be added to the gNB conf file in the section `gNBs.[0]` -``` -... - min_rxtxtime = 6; - disable_harq = 1; // <-- - - servingCellConfigCommon = ( - { -... -``` - -The settings for a transparent GEO satellite scenario are already provided in the file `ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn.conf`. -Using this conf file, an example gNB command for FDD, 5 MHz BW, 15 kHz SCS, transparent GEO satellite 5G NR NTN is this: -``` -cd cmake_targets -sudo ./ran_build/build/nr-softmodem -O ../ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn.conf --rfsim -``` - -To configure NTN gNB with 32 HARQ processes in downlink and uplink, add these settings in conf files under section `gNBs.[0]` -``` -... - num_dlharq = 32; - num_ulharq = 32; -... -``` - -To simulate a LEO satellite channel model with rfsimulator in UL (DL is simulated at the UE side) either the `channelmod` section as shown before has to be added to the gNB conf file, or a channelmod conf file has to be included like this: -``` -@include "channelmod_rfsimu_LEO_satellite.conf" -``` - -The settings for a transparent LEO satellite scenario are already provided in the file `ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf`. -Using this conf file, an example gNB command for FDD, 5 MHz BW, 15 kHz SCS, trasparent LEO satellite 5G NR NTN is this: -``` -cd cmake_targets -sudo ./ran_build/build/nr-softmodem -O ../ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf --rfsim -``` - -#### NR UE - -At UE side, only few parameters have to be provided, as the UE receives most relevant parameters via SIB19 from the gNB. -But to calculate the UE specific TA, the UE position has to be provided in the `ue.conf` file. -Also the LEO channel model has to be configured, e.g. by using an `@include` statement, just like on the gNB side: -``` -... -position0 = { - x = 0.0; - y = 0.0; - z = 6377900.0; -} - -@include "channelmod_rfsimu_LEO_satellite.conf" -``` - -So an example NR UE command for FDD, 5MHz BW, 15 kHz SCS, transparent GEO satellite 5G NR NTN is this: -``` -cd cmake_targets -sudo ./ran_build/build/nr-uesoftmodem -O ../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --band 254 -C 2488400000 --CO -873500000 -r 25 --numerology 0 --ssb 60 --rfsim --rfsimulator.[0].prop_delay 238.74 -``` - -For LEO satellite scenarios, the parameter `--ntn-initial-time-drift` must be provided via command line, as the UE needs this value to compensate for the time drift during initial sync, before SIB19 was received. -This parameter provides the drift rate of the complete DL timing (incl. feeder link and service link) in µs/s. - -To perform an autonomous TA update based on the DL drift, the boolean parameter `--autonomous-ta` can be added. -If that parameter is omitted, the TA is continuously computed based on the SIB19 information. - -For LEO satellite scenario we assume the LO to be very accurate and the main FO contribution comes from Doppler shift. -Therefore, we use the command line parameter `--cont-fo-comp 2` to continuously compensate the DL Doppler and pre-compensate the UL Doppler. -The initial Doppler frequency offset must be provided via command line with the parameter `--initial-fo`. - -For other information on optional NR UE command line options, please refer [here](#optional-nr-ue-command-line-options). - -So an example NR UE command for FDD, 5MHz BW, 15 kHz SCS, transparent LEO satellite 5G NR NTN is this: -``` -cd cmake_targets -sudo ./ran_build/build/nr-uesoftmodem -O ../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --band 254 -C 2488400000 --CO -873500000 -r 25 --numerology 0 --ssb 60 --rfsim --rfsimulator.[0].prop_delay 20 --rfsimulator.[0].options chanmod --time-sync-I 0.1 --ntn-initial-time-drift -46 --initial-fo 57340 --cont-fo-comp 2 -``` - -## Specific OAI modes - -### phy-test setup with OAI UE - -The OAI UE can also be used in front of a OAI gNB without the support of eNB or EPC and circumventing random access. In this case both gNB and eNB need to be run with the `--phy-test` flag. At the gNB this flag does the following - - it reads the RRC configuration from the configuration file - - it encodes the RRCConfiguration and the RBconfig message and stores them in the binary files `rbconfig.raw` and `reconfig.raw` in the current directory - - the MAC uses a pre-configured allocation of PDSCH and PUSCH with randomly generated payload instead of the standard scheduler. The options `-m`, `-l`, `-t`, `-M`, `-T`, `-D`, and `-U` can be used to configure this scheduler. - - Options `-Dmod`, and `-Umod` were introduced to enable scheduling PDSCH/PUSCH on slots >= 64 in phy-test mode. (in case of >= 120Khz subcarrier spacing and FDD) - - For ex: `-Dmod 2' / '-Umod 2` allocates every 2nd slot for PDSCH or PUSCH respectively. - - See `./nr-softmodem -h` for more information. - -At the UE, the `--phy-test` flag will read the binary files `rbconfig.raw` and `reconfig.raw` from the current directory and process them. If you wish to provide a different path for these files, please use the options `--reconfig-file` and `--rbconfig-file`. - -```bash -sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --phy-test -``` - -```bash -sudo ./nr-uesoftmodem --phy-test [--reconfig-file ../../../ci-scripts/rrc-files/reconfig.raw --rbconfig-file ../../../ci-scripts/rrc-files/rbconfig.raw] -``` - -In summary: -- If you are running on the same machine and launched the 2 executables (`nr-softmodem` and `nr-uesoftmodem`) from the same directory, nothing has to be done. -- If you launched the 2 executables from 2 different folders, just point to the location where you launched the `nr-softmodem`: - * `sudo ./nr-uesoftmodem --rfsim --phy-test --reconfig-file /the/path/where/you/launched/nr-softmodem/reconfig-file --rbconfig-file /the/path/where/you/launched/nr-softmodem/rbconfig-file --rfsimulator.[0].serveraddr ` -- If you are not running on the same machine, you need to **COPY** the two raw files - * `scp usera@machineA:/the/path/where/you/launched/nr-softmodem/r*config.raw userb@machineB:/the/path/where/you/will/launch/nr-uesoftmodem/` - * Obviously this operation should be done before launching the `nr-uesoftmodem` executable. - -In phy-test mode it is possible to mimic the reception of UE Capabilities at gNB through the command line parameter `--uecap_file`. Refer to the [UE Capabilities](#UE-Capabilities) section for more details. - -### noS1 setup with OAI UE - -Instead of randomly generated payload, in the phy-test mode we can also -inject/receive user-plane traffic over a TUN interface. This is the so-called -noS1 mode. - -The noS1 mode is applicable to both gNB/UE, and enabled by passing `--noS1` as -an option. The gNB/UE will open a TUN interface which the interface names and -IP addresses `oaitun_enb1`/10.0.1.1, and `oaitun_ue1`/10.0.1.2, respectively. -You can then use these interfaces to send traffic, e.g., -```bash -iperf -sui1 -B 10.0.1.2 -``` -to open an iperf server on the UE side, and -```bash -iperf -uc 10.0.1.2 -B 10.0.1.1 -i1 -t10 -b1M -``` -to send data from the gNB down to the UE. - -> Note that this does not work if both interfaces are on the same host. We -recommend to use two different hosts, or at least network namespaces, to route -traffic through the gNB/UE tunnel. - -This option is only really helpful for phy-test/do-ra (see below) modes, in -which the UE does not connect to a core network. If the UE connects to a core -network, it receives an IP address for which it automatically opens a network -interface. - -### do-ra setup with OAI - -The do-ra flag is used to ran the NR Random Access procedures in contention-free mode. Currently OAI implements the RACH process from Msg1 to Msg3. - -In order to run the RA, the `--do-ra` flag is needed for both the gNB and the UE. - -In do-ra mode it is possible to mimic the reception of UE Capabilities at gNB through the command line parameter `--uecap_file`. Refer to the [UE Capabilities](#UE-Capabilities) section for more details. - -To run using the RFsimulator: - -```bash -sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --do-ra --rfsim -sudo ./nr-uesoftmodem --do-ra --rfsim --rfsimulator.[0].serveraddr 127.0.0.1 -``` - -Using USRPs: - -```bash -sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --do-ra -``` - -On a separate machine: - -```bash -sudo ./nr-uesoftmodem --do-ra -``` - - -#### Run OAI with SDAP & Custom DRBs - -SDAP is enabled by default. To disable SDAP, include `--gNBs.[0].enable_sdap 0` to the binary's arguments. - -The DRB creation is dependent on the 5QI. -If the 5QI corresponds to a GBR Flow it assigns a dedicated data radio bearer. -The Non-GBR flows use a shared data radio bearer. - -To hardcode the DRBs for testing purposes, simply add `--gNBs.[0].drbs x` to the binary's arguements, where `x` is the number of DRBs, along with SDAP. -The hardcoded DRBs will be treated like GBR Flows. Due to code limitations at this point the max. number of DRBs is 4. - -### IF setup with OAI - -OAI is also compatible with Intermediate Frequency (IF) equipment, allowing the -use of RF front-ends operating on arbitrary frequency bands that do not conform -to the standardized 3GPP NR bands. - -### OAIUE configuration -To configure IF frequencies on the UE side, provide the following command-line -options: -- `if_freq`: DL frequency in Hz -- `if_freq_off`: UL frequency offset in Hz - -### gNB configuration -On the gNB side, the corresponding parameters must be set in the RUs section of -the configuration file: -- `if_freq`: DL frequency in Hz -- `if_offset`: UL frequency offset in Hz - -> Note: When using a libconfig-based configuration file for the gNB, ensure that -> `if_freq` numeric value is suffixed with "L" so it is correctly parsed as -> 64-bit integer. - -#### Run OAI with custom DL/UL arbitrary frequencies - -The following example uses DL frequency 2169.080 MHz and UL frequency offset --400 MHz, with a configuration file for band 66 (FDD) at gNB side. - -On two separate machines with USRPs, run: - -``` -sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf -sudo ./nr-uesoftmodem --if_freq 2169080000 --if_freq_off -400000000 -``` +FAPI splits the L1 and MAC. It is used internally by the monolithic gNB. It is +possible to separate L1 and L2 into separate processes and use shared memory +between both. It is further possible use networked FAPI (nFAPI) to separate L1 +and L2 into separate processes on different hosts and use socket-based +communication. See the [FAPI/nFAPI documentation](nfapi.md) ## 5G gNB MIMO configuration @@ -611,3 +264,19 @@ Finally the number of TX physical antenna in the RU part of the configuration fi It is possible to limit the number supported DL MIMO layers via RRC configuration, e.g. to a value lower than the number of logical antenna ports configured, by using the configuration file parameter `maxMIMO_layers`. [Example of configuration file with parameters for 2-layer MIMO](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.2x2.usrpn300.conf) + +## IF (Intermediate Frequency) equipment + +OAI supports RF front-ends operating on arbitrary frequencies outside standard +3GPP NR bands. Configure in the `RUs` section of the gNB config file: + +- `if_freq`: DL frequency in Hz (suffix with `L` in libconfig, e.g. `2169080000L`) +- `if_offset`: UL frequency offset in Hz + +## Related documentation + +Further documentation not referenced above: + +- [Build instructions](BUILD.md) +- [NR SA tutorial with OAI nrUE](NR_SA_Tutorial_OAI_nrUE.md) +- [NTN configuration](ntn-configuration.md) diff --git a/doc/TESTING_OAI_NSA_COTS_UE.md b/doc/TESTING_OAI_NSA_COTS_UE.md index cf4552ebba..6608eddde6 100644 --- a/doc/TESTING_OAI_NSA_COTS_UE.md +++ b/doc/TESTING_OAI_NSA_COTS_UE.md @@ -1,8 +1,9 @@ -STATUS 2020/10/15 : added External Resources section and links +# How to run an NSA setup with eNB/gNB -**Table of Contents** +This page details how to run an non-standalone (NSA) setup, using an eNB and +gNB (both OAI). It might be outdated, but still contains valuable information. [[_TOC_]] @@ -227,6 +228,7 @@ Execute: ``` +You should see the X2 messages in Wireshark and at the eNB. ## Test Case diff --git a/doc/dev_tools/tracy.md b/doc/dev_tools/tracy.md new file mode 100644 index 0000000000..9b099b479f --- /dev/null +++ b/doc/dev_tools/tracy.md @@ -0,0 +1,58 @@ + + +# Performance analysis with the Tracy profiler + +[[_TOC_]] + +## Overview + +From the Tracy manual: + +> Tracy is a real-time, nanosecond resolution hybrid frame and sampling +> profiler that you can use for remote or embedded telemetry of games and other +> applications. It can profile CPU, GPU, memory allocations, locks, context +> switches, [...] + +- Sources are on [Github](https://github.com/wolfpld/tracy) +- There is a [web demo](https://tracy.nereid.pl/) +- You can [watch an intro video](https://youtu.be/ghXk3Bk5F2U?t=37) +- You can [read the manual](https://github.com/wolfpld/tracy/releases/download/v0.13.1/tracy.pdf) + +## OAI Integration + +To enable Tracy, compile `-DTRACY_ENABLE=ON` in cmake. Note that `build_oai` +has no native switch, but you can use `--cmake-opt -DTRACY_ENABLE=ON` instead. + +Furthermore, you will need the Tracy profiler: + +- Windows hosts: There is a precompiled `tracy-profiler.exe` on Github +- Linux hosts: Compile tracy-profiler from source as described in the manual. + +Start the OAI executable you want to profile. Then, open the profiler, and +click on connect to connect to the executable. + +It is also possible to collect data from within docker containers: + +- Open port 8086. +- To collect CPU data, make sure that you run docker with `--privileged --mount + "type=bind,source=/sys/kernel/debug,target=/sys/kernel/debug,readonly" --user + 0:0 --pid=host` or provide the corresponding options in docker-compose. + +## Instrumentation + +Instrumentation is done via the header `common/instrumentation.h`. A couple of +places in OAI have been instrumented already, search for the macros mentioned +in `common/instrumentation.h`. + +In short, main features already in use: + +- Measure specific code regions by surrounding them with `TracyCZone(ctx, true);` + and `TracyCZoneEnd(ctx);`. +- Record individual "Tracy frames" (in the OAI context, that's likely one 4G/5G + slot) with `TracyCFrameMark;` +- Plot values using `TracyCPlot(name, val);` + +More information about these macros can be found in the manual. + +Make sure to link `utils` into the static library you are modifying to get +tracy header definitions. diff --git a/doc/nfapi.md b/doc/nfapi.md index 2a9c643436..5e499f5bd5 100644 --- a/doc/nfapi.md +++ b/doc/nfapi.md @@ -160,7 +160,7 @@ patch is available [here](../cmake_targets/tools/install_wls_lib.patch) Clone the code and apply the patch - git clone -b oran_f_release https://gerrit.o-ran-sc.org/r/o-du/phy.git + git clone -b oran_f_release https://github.com/openairinterface/o-du-phy.git cd phy/wls_lib/ git apply ~/openairinterface5g/cmake_targets/tools/install_wls_lib.patch diff --git a/doc/ntn-configuration.md b/doc/ntn-configuration.md new file mode 100644 index 0000000000..9960eb006a --- /dev/null +++ b/doc/ntn-configuration.md @@ -0,0 +1,204 @@ + + +# How to run a NTN configuration + +This tutorial explains how to run non-terrestrial network (NTN) setup for both +low-earth orbit (LEO) and geostationary orbit (GEO) scenarios. + +It assumes you have a working terrestrial network (TN) setup, include core +network. + +[[_TOC_]] + +## NTN channel + +A 5G NR NTN configuration only works in a non-terrestrial setup. +Therefore either SDR boards and a dedicated NTN channel emulator are required, or RFsimulator has to be configured to simulate a NTN channel. + +As shown on the [rfsimulator page](../radio/rfsimulator/README.md), RFsimulator provides different possibilities. +E.g. to perform a simple simulation of a satellite in geostationary orbit (GEO), these parameters should be added to both gNB and UE command lines: +``` +--rfsimulator.[0].prop_delay 238.74 +``` + +For simulation of a satellite in low earth orbit (LEO), two channel models have been added to rfsimulator: +- `SAT_LEO_TRANS`: transparent LEO satellite with gNB on ground +- `SAT_LEO_REGEN`: regenerative LEO satellite with gNB on board + +Both channel models simulate the delay and Doppler for a circular orbit at 600 km height according to the Matlab function [dopplerShiftCircularOrbit](https://de.mathworks.com/help/satcom/ref/dopplershiftcircularorbit.html). +An example configuration to simulate a transparent LEO satellite with rfsimulator would be: +``` +channelmod = { + max_chan=10; + modellist="modellist_rfsimu_1"; + modellist_rfsimu_1 = ( + { + model_name = "rfsimu_channel_enB0" + type = "SAT_LEO_TRANS"; + noise_power_dB = -100; + }, + { + model_name = "rfsimu_channel_ue0" + type = "SAT_LEO_TRANS"; + noise_power_dB = -100; + } + ); +}; +``` +This configuration is also provided in the file `targets/PROJECTS/GENERIC-NR-5GC/CONF/channelmod_rfsimu_LEO_satellite.conf`. + +Additionally, rfsimulator has to be configured to apply the channel model. +This can be done by either providing this line in the conf file in section `rfsimulator`: +``` + options = ("chanmod"); +``` +Or by providing this the the command line parameters: +``` +--rfsimulator.[0].options chanmod +``` + +## gNB + +The main parameters to cope with the large NTN propagation delay are cellSpecificKoffset, ta-Common, ta-CommonDrift and the ephemeris data (satellite position and velocity vectors). + +The parameter `ntn-UlSyncValidityDuration-r17` indicates the maximum time duration from epochtime during which the UE can apply assistance information without having acquired new assistance information. i.e this enables UE to re-read SIB19 before timer with value ulSyncValidityDuration expires. The unit of the field is in seconds. Example values for GEO: 240s, MEO: 20s, LEO: 5s. +As epochtime is not implemented yet, UE starts the timer from the TTI where SIB19 is received with ntn-UlSyncValidityDuration-r17 IE. + +The parameter `cellSpecificKoffset_r17` is the scheduling offset used for the timing relationships that are modified for NTN (see TS 38.213). +The unit of the field Koffset is number of slots for a given subcarrier spacing of 15 kHz. + +The parameter `ta-Common-r17` is used to provide the propagation delay between the reference point (at the gNB) and the satellite. +The granularity of ta-Common is 4.072 × 10^(-3) µs. Values are given in unit of corresponding granularity. + +The parameter `ta-CommonDrift-r17` indicates the drift rate of the common TA. +The granularity of ta-CommonDrift is 0.2 × 10^(-3) µs/s. Values are given in unit of corresponding granularity. + +The satellite position and velocity vartors are provided using the following parameters: + +`positionX-r17`, `positionY-r17`, `positionZ-r17`: +X, Y, Z coordinate of satellite position state vector in ECEF. Unit is meter. +Step of 1.3 m. Actual value = field value * 1.3. + +`velocityVX-r17`, `velocityVY-r17`, `velocityVZ-r17`: +X, Y, Z coordinate of satellite velocity state vector in ECEF. Unit is meter/second. +Step of 0.06 m/s. Actual value = field value * 0.06. + +These parameters can be provided to the gNB in the conf file in the section `servingCellConfigCommon`: +``` +... +# GEO satellite + cellSpecificKoffset_r17 = 478; + ta-Common-r17 = 58629666; # 238.74 ms + positionX-r17 = 0; + positionY-r17 = 0; + positionZ-r17 = 32433846; + velocityVX-r17 = 0; + velocityVY-r17 = 0; + velocityVZ-r17 = 0; +# LEO satellite +# cellSpecificKoffset_r17 = 40; +# ta-Common-r17 = 4634000; # 18.87 ms +# ta-CommonDrift-r17 = -230000; # -46 µs/s +# positionX-r17 = 0; +# positionY-r17 = -2166908; # -2816980.4 m +# positionZ-r17 = 4910784; # 6384019.2 m +# velocityVX-r17 = 0; +# velocityVY-r17 = 115246; # 6914.76 m/s +# velocityVZ-r17 = 50853; # 3051.18 m/s +... +``` + +Besides this, some timers, e.g. `sr_ProhibitTimer_v1700`, `t300`, `t301` and `t319`, in the conf file section `gNBs.[0].TIMERS` might need to be extended for GEO satellites. +``` +... + TIMERS : + { + sr_ProhibitTimer = 0; + sr_TransMax = 64; + sr_ProhibitTimer_v1700 = 512; + t300 = 2000; + t301 = 2000; + t319 = 2000; + }; +... +``` + +To improve the achievable UL and DL throughput in conditions with large RTT (esp. GEO satellites), there is a feature defined in REL17 to disable HARQ feedback. +This allows to reuse HARQ processes immediately, but it breaks compatibility with UEs not supporting this REL17 feature. +To enable this feature, the `disable_harq` flag has to be added to the gNB conf file in the section `gNBs.[0]` +``` +... + min_rxtxtime = 6; + disable_harq = 1; // <-- + + servingCellConfigCommon = ( + { +... +``` + +The settings for a transparent GEO satellite scenario are already provided in the file `ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn.conf`. +Using this conf file, an example gNB command for FDD, 5 MHz BW, 15 kHz SCS, transparent GEO satellite 5G NR NTN is this: +``` +cd cmake_targets +sudo ./ran_build/build/nr-softmodem -O ../ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn.conf --rfsim +``` + +To configure NTN gNB with 32 HARQ processes in downlink and uplink, add these settings in conf files under section `gNBs.[0]` +``` +... + num_dlharq = 32; + num_ulharq = 32; +... +``` + +To simulate a LEO satellite channel model with rfsimulator in UL (DL is simulated at the UE side) either the `channelmod` section as shown before has to be added to the gNB conf file, or a channelmod conf file has to be included like this: +``` +@include "channelmod_rfsimu_LEO_satellite.conf" +``` + +The settings for a transparent LEO satellite scenario are already provided in the file `ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf`. +Using this conf file, an example gNB command for FDD, 5 MHz BW, 15 kHz SCS, trasparent LEO satellite 5G NR NTN is this: +``` +cd cmake_targets +sudo ./ran_build/build/nr-softmodem -O ../ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf --rfsim +``` + +## NR UE + +At UE side, only few parameters have to be provided, as the UE receives most relevant parameters via SIB19 from the gNB. +But to calculate the UE specific TA, the UE position has to be provided in the `ue.conf` file. +Also the LEO channel model has to be configured, e.g. by using an `@include` statement, just like on the gNB side: +``` +... +position0 = { + x = 0.0; + y = 0.0; + z = 6377900.0; +} + +@include "channelmod_rfsimu_LEO_satellite.conf" +``` + +So an example NR UE command for FDD, 5MHz BW, 15 kHz SCS, transparent GEO satellite 5G NR NTN is this: +``` +cd cmake_targets +sudo ./ran_build/build/nr-uesoftmodem -O ../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --band 254 -C 2488400000 --CO -873500000 -r 25 --numerology 0 --ssb 60 --rfsim --rfsimulator.[0].prop_delay 238.74 +``` + +For LEO satellite scenarios, the parameter `--ntn-initial-time-drift` must be provided via command line, as the UE needs this value to compensate for the time drift during initial sync, before SIB19 was received. +This parameter provides the drift rate of the complete DL timing (incl. feeder link and service link) in µs/s. + +To perform an autonomous TA update based on the DL drift, the boolean parameter `--autonomous-ta` can be added. +If that parameter is omitted, the TA is continuously computed based on the SIB19 information. + +For LEO satellite scenario we assume the LO to be very accurate and the main FO contribution comes from Doppler shift. +Therefore, we use the command line parameter `--cont-fo-comp 2` to continuously compensate the DL Doppler and pre-compensate the UL Doppler. +The initial Doppler frequency offset must be provided via command line with the parameter `--initial-fo`. + +For other information on optional NR UE command line options, please refer [here](#optional-nr-ue-command-line-options). + +So an example NR UE command for FDD, 5MHz BW, 15 kHz SCS, transparent LEO satellite 5G NR NTN is this: +``` +cd cmake_targets +sudo ./ran_build/build/nr-uesoftmodem -O ../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --band 254 -C 2488400000 --CO -873500000 -r 25 --numerology 0 --ssb 60 --rfsim --rfsimulator.[0].prop_delay 20 --rfsimulator.[0].options chanmod --time-sync-I 0.1 --ntn-initial-time-drift -46 --initial-fo 57340 --cont-fo-comp 2 +``` diff --git a/doc/physical-simulators.md b/doc/physical-simulators.md index 5b508ed103..0eae1c06b8 100644 --- a/doc/physical-simulators.md +++ b/doc/physical-simulators.md @@ -19,6 +19,7 @@ Physims are essential for: * Debugging and evaluating new PHY code in isolation * Regression testing * Ensuring correctness before merging new contributions into the repository +* Performance measurements These tests are run automatically as part of the following pipelines: @@ -54,9 +55,11 @@ Example: openair1/SIMULATION/NR_PHY/dlsim.c ``` +The actual tests are defined in `openair1/SIMULATION/tests/CMakeLists.txt`. + ## How to Run Simulators Using `ctest` -### Option 1: Using CMake +### Option 1: Using CMake (Recommended) Build the simulators and tests using the dedicated cmake option, then run `ctest` which will run all registered tests. @@ -102,6 +105,65 @@ parallel, type ctest -L nr_ulschsim -j 4 +Or you run all 5G tests that `-R` pattern-match on a `dl` pattern: + + ctest -R nr_dl + +Or you can see the test parameters that would be run for `nr_ulsim` without +actually running the tests + + ctest -R nr_ulsim -N -V + +Note that the lines `Test command:` show the actual shell code that will be +executed. For increased flexibility, tests are run indirectly through a cmake +script `openair1/SIMULATION/tests/RunTimedTest.cmake` that not only runs the +test, but can also analyze its output. The actual command is passed via a +variable `TEST_CMD` that lists the executable and parameters as a semicolon +(`;`) delimited list. See further below for an example of how to read this. + +## Performance evaluation + +Some simulators, notably `nr_dlsim` and `nr_ulsim`, provide the possibility to +show performance metrics via option `-P`. + +To discover predefined tests, you can search for test cases that define `-P` +like so (note the leading `;` to limit to the test case executable command line +as `-P` is also used by the cmake scripts themselves): + + $ ctest -N -V | grep Test\ command: | grep -- ';-P' | tail -n1 + 213: Test command: /usr/bin/cmake "-DTEST_CMD=/home/richie/oai/build/nr_ulsim;-P;-n300;-b14;-I15;-i;0,1;-g;C,l;-t70;-u;1;-m16;-R106;-r106;-U;1,1,1,2;-W2;-y2;-z4;-s11.2;-S11.2" "-DCHECK_SCRIPT=/home/richie/oai/openair1/SIMULATION/tests/analyze-timing.sh" "-P" "/home/richie/oai/openair1/SIMULATION/tests/RunTimedTest.cmake" + +From this, we see that the tests can be run like so, in the same directory as +cmake: + + ./nr_ulsim -P -n300 -b14 -I15 -i 0,1 -g C,l -t70 -u 1 -m16 -R106 -r106 -U 1,1,1,2 -W2 -y2 -z4 -s11.2 -S11.2 + +After invoking the tests, you should see processing times for UE TX and gNB RX: + +``` +UE TX +|__ PHY_PROC_TX 246.01 us (300 trials) ( 73.80 total [ms]) + +[...] + +gNB RX +Total PHY proc rx 2587.88 us (300 trials) + Statistics std=301.10, median=0.00, q1=0.00, q3=0.00 µs (on 0 trials) +|__ RX PUSCH time 875.68 us (300 trials) (262.70 total [ms]) +``` + +You can see average per-trial processing time in micro-seconds, and the total +test times for the 300 trials (`-n`) in milliseconds. + +Use `grep` to find the places where these stats are printed, and to see which +variable in the stacks traces the measurement. For `RX PUSCH time`, we can +identify the variable `rx_pusch_stats`: + +``` +$ git grep -n 'RX PUSCH time' ../ +../openair1/SIMULATION/NR_PHY/ulsim.c:1714: printStatIndent(&gNB->rx_pusch_stats, "RX PUSCH time"); +``` + ## Adding a New Physim Test To define a new test or modify existing ones, update the following file: diff --git a/doc/runmodem-nrue.md b/doc/runmodem-nrue.md new file mode 100644 index 0000000000..efbb7cd082 --- /dev/null +++ b/doc/runmodem-nrue.md @@ -0,0 +1,328 @@ + + +# General information for nrUE and configuration + +This page describes the configuration of the nrUE (applicable for use with any +gNB) as well as OAI-specific modes. + +[[_TOC_]] + +## General configuration + +Command line parameters for UE in standalone mode: +- `-C` : downlink carrier frequency in Hz (default value 0) +- `--CO` : uplink frequency offset for FDD in Hz (default value 0) +- `--numerology` : numerology index (default value 1) +- `-r` : bandwidth in terms of RBs (default value 106) +- `--band` : NR band number (default value 78) +- `--ssb` : SSB start subcarrier (default value 516) + +To simplify the configuration for the user testing OAI UE with OAI gNB, the latter prints the following LOG that guides the user to correctly set some of the UE command line parameters: + +```shell +[PHY] Command line parameters for OAI UE: -C 3319680000 -r 106 --numerology 1 --ssb 516 +``` + +You can run this, using USRPs, on two separate machines: + +```shell +sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --gNBs.[0].min_rxtxtime 6 +sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --ssb 516 +``` + +With the **RFsimulator** (on the same machine), just add the option `--rfsim` to both gNB and NR UE command lines. + +UE capabilities can be passed according to the [UE Capabilities](#UE-Capabilities) section. + +## Configuration file + +The UE can be provided a configuration file on the command line using `-O +`. At the very least, the configuration file should always contain +information on IMSI, key, and PDU session to use for the information: + +```shell +uicc0 = { + imsi = "001010000000001"; + key = "fec86ba6eb707ed08905757b1bb44b8f"; + opc = "C42449363BBAD02B66D16BC975D77CC1"; + pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; }); +} +``` + +| **Parameter** | **Description** | **Default Value** | +|---------------|-----------------|-------------------| +| **IMSI** | Unique identifier for the UE within the mobile network. Used by the network to identify the UE during authentication. It ensures that the UE is correctly identified by the network. | 001010000000001 | +| **key** | Cryptographic key shared between the UE and the network, used for encryption during the authentication process. | `fec86ba6eb707ed08905757b1bb44b8f` | +| **OPC** | Operator key for the Milenage Authentication and Key Agreement algorithm used for encryption during the authentication process. | Ensures secure communication between the UE and the network by matching the encryption keys. | `C42449363BBAD02B66D16BC975D77CC1` | +| **DNN** | _Deprecated_: Specifies the name of the data network the UE wishes to connect to, similar to an APN in 4G networks. Use `pdu_sessions` instead. | `oai` | +| **NSSAI** | _Deprecated_: Allows the UE to select the appropriate network slice, which provides different QoS. Use `pdu_sessions` instead. | `1` | +| **pdu_sessions** | list of PDU sessions to request | empty array (no PDU session) | + +Note that DNN and NSSAI parameters are deprecated, and `pdu_sessions` should be +used. If the `pdu_sessions` array is present, DNN and NSSAI are ignored. + +Each element within the `pdu_sessions` array takes the following parameters. +Multiple PDU sessions can be requested. + +| **Parameter** | **Description** | **Default Value** | +|---------------|-----------------|-------------------| +| `id` | ID of the PDU session to request | index of the current element (1..16) | +| `type` | Type of the PDU session to request (allowed: `IPv4`, `IPv6`, `IPv4v6`, `Ethernet` | `IPv4` | +| `dnn` | Specifies the name of the data network the UE wishes to connect to | `oai` | +| `nssai_sst` | Slice Service Type to request (1=eMBB, 2=URLLC, 3=mMTC) | `1` | +| `nssai_sd` | Slice Differentiator to request | `0xffffff` (meaning "no SD") | + +For instance, to request two PDU sessions with user-defined IDs, you could +use. + +``` +uicc0 = { + # ... + pdu_sessions = ( + { id=1; dnn = "oai.ipv4"; type = "IPv4", nssai_sst = 1; }, + { id=2; dnn = "oai.ipv6"; type = "IPv6", nssai_sst = 1; }, + ); +} +``` + +### Optional NR-UE command line options + +Here are some useful command line options for the NR UE: + +| Parameter | Description | +|--------------------------|---------------------------------------------------------------------------------------------------------------| +| `--ue-scan-carrier` | Scan for cells in current bandwidth. This option can be used if the SSB position of the gNB is unknown. If multiple cells are detected, the UE will try to connect to the first cell. By default, this option is disabled and the UE attempts to only decode SSB given by `--ssb`. | +| `--ue-fo-compensation` | Enables the initial frequency offset compensation at the UE. Useful when running over the air and/or without an external clock/time source. | +| `--cont-fo-comp` | Enables the continuous frequency offset (FO) estimation and compensation. Parameter value `1` specifies that the main FO contribution comes from the local oscillator's (LO) accuracy. Parameter value `2` specifies that the main FO contribution comes from Doppler shift. Parameter value `3` specifies that no measured residual DL FO is considered for UL FO pre-compensation. | +| `--initial-fo` | Sets the known initial frequency offset. Useful especially with large Doppler frequency, e.g. LEO satellite. | +| `--freq-sync-P` | Sets the coefficient for the Proportional part of the PI-controller for the continuous frequency offset compensation. Default value 0.01. | +| `--freq-sync-I` | Sets the coefficient for the Integrating part of the PI-controller for the continuous frequency offset compensation. Default value 0.001. | +| `--num-ues` | Run multiple UEs in one process | +| `--ntn-initial-time-drift` | Sets the initial NTN DL time drift (feeder link and service link), given in µs/s. | +| `--autonomous-ta` | Enables the autonomous TA update, based on DL drift (useful if main contribution to DL drift is movement, e.g. LEO satellite). | +| `--time-sync-P` | Sets the coefficient for the Proportional part of the PI-controller for the time synchronization. Default value 0.5. | +| `--time-sync-I` | Sets the coefficient for the Integrating part of the PI-controller for the time synchronization. Default value 0.0. | +| `--usrp-args` | Equivalent to the `sdr_addrs` field in the gNB config file. Used to identify the USRP and set some basic parameters (like the clock source). | +| `--clock-source` | Sets the clock source (internal or external). | +| `--time-source` | Sets the time source (internal or external). | + +You can view all available options by typing: + +```shell +./nr-uesoftmodem --help +``` + +### UE Capabilities + +The `--uecap_file` option can be used to pass the UE Capabilities input file (path location + filename), e.g.`--uecap_file ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports1.xml` for 1 layer or e.g. `--uecap_file ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports2.xml` for 2 layers. + +This option is available for the following combinations of operation modes and gNB/nrUE softmodems: + +| Mode | Executable | Description | +|------------|----------------|-----------------------------------------------------| +| SA | nr-uesoftmodem | Send UE capabilities from the UE to the gNB via RRC | +| phy-test | nr-softmodem | Mimic the reception of UE capabilities by the gNB | +| do-ra | nr-softmodem | Mimic the reception of UE capabilities by the gNB | + +e.g. + +```shell +sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3319680000 --ue-nb-ant-tx 2 --ue-nb-ant-rx 2 --uecap_file /opt/oai-nr-ue/etc/uecap.xml +``` + +## NR UE: Configure multiple RF-frontends (RUs) and UEs in one process + +Multiple RF-frontends (also called RUs) can be defined for the nr-uesoftmodem. +Therefore, two sections in the NR UE configuration file are used: +- `RUs` +- `cells` + +The `RUs` section in the NR UE configuration file contains an array of elements, where each element has these properies: + +| Property name | Type | Default value | Description | +| ---------------- | -------------- | ------------- | ------------------------------------ | +| nb_tx | integer | 1 | Number of TX Antennas | +| nb_rx | integer | 1 | Number of RX Antennas | +| att_tx | integer | 0 | TX Attenuation in dB | +| att_rx | integer | 0 | RX Attenuation in dB | +| max_rxgain | integer | 120 | Maximum RX Gain at 0 dB Attenuation | +| sdr_addrs | string | type=b200 | SDR Parameter String | +| tx_subdev | string | | SDR TX Subdevice | +| rx_subdev | string | | SDR RX Subdevice | +| clock_src | string | internal | SDR Clock Source | +| time_src | string | internal | SDR Time Source | +| tune_offset | floating point | 0.0 | SDR Tune Offset in Hz | +| if_freq | integer | 0 | DL Intermediate Frequency in Hz | +| if_offset | integer | 0 | UL Intermediate Frequency Offset in Hz | + +The `cells` section in the NR UE configuration file contains an array of elements, where each element has these properies: + +| Property name | Type | Default value | Description | +| ---------------- | ------- | ------------- | ---------------------------------------- | +| ru_id | integer | 0 | ID of the associated RU from the `RUs` section | +| band | integer | 78 | 5G NR Band | +| rf_freq | integer | 0 | DL Carrier Centre Frequency in Hz | +| rf_offset | integer | 0 | DL Carrier Centre Frequency Offset in Hz | +| numerology | integer | 1 | 5G NR Numerology (µ) | +| N_RB_DL | integer | 106 | Number of DL Carrier Ressource Blocks | +| ssb_start | integer | 516 | Ressource Element where the SSB Starts | + +There are different scenarios where multiple RF-frontends (also called RUs) are beneficial for the NR UE: + +1. RF-Simulator Inter-Frequency Handover between multiple cells +2. Multiple UEs in one instance, each using their own RF-frontend (RF-Simulator connection) +3. Different Antennas connected to different RF-ports +4. Concurrent connection to multiple carriers (carrier aggregation CA) + +This would be and example configuration for the 1. scenario: + +``` +rfsimulator = ( + { + serveraddr = "127.0.0.2"; + serverport = 4043; + }, { + serveraddr = "127.0.0.3"; + serverport = 4044; + } +); + +RUs = ( + { + nb_tx = 1; + nb_rx = 1; + }, { + nb_tx = 1; + nb_rx = 1; + } +); + +cells = ( + { + ru_id = 0; + band = 78; + rf_freq = 3619200000L; + numerology = 1; + N_RB_DL = 106; + ssb_start = 516; + }, { + ru_id = 1; + band = 78; + rf_freq = 3649440000L; + numerology = 1; + N_RB_DL = 106; + ssb_start = 516; + } +); +``` + +An example for the 2. scenario can be found in the file +[ci-scripts/yaml_files/5g_rfsimulator_multiue/nrue.uicc.conf](../ci-scripts/yaml_files/5g_rfsimulator_multiue/nrue.uicc.conf). +Multiple UEs run in one process, and since no RU sharing is implemented (see +below), each UE runs its own RF device, e.g., an RFsimulator connection. + +The number of UE instances is controlled by `--num-ues N`. This creates N +independent UE protocol stacks (PHY, MAC, NAS). UE instance `i` reads its +credentials from the `uicc{i}` config section and is assigned `cells[i]` in +order. The config must therefore have at least N `uicc`, `cells`, and `RUs` +entries. Note that **all RUs defined in the `RUs` section are opened and +initialized regardless of `--num-ues`**; extra entries consume resources +without being used by any UE instance. + +The 3. scenario is similar to 1., but instead of providing RF-Simulator parameters, actual SDR parameters have to be provided. + +The 4. scenario is not supported, as the NR UE does not implement CA, yet. + +Current Limitations: +- Each RU can be used by only one cell. +- Each RU and cell can be used by only one UE (no RU sharing implemented, yet). +- The sampling rates of all RUs must be the same. + +## Specific OAI modes + +These modes are applicable when running both OAI UE and OAI gNB together. + +### phy-test setup with OAI UE + +The OAI UE can also be used in front of a OAI gNB without the support of eNB or EPC and circumventing random access. In this case both gNB and eNB need to be run with the `--phy-test` flag. At the gNB this flag does the following + - it reads the RRC configuration from the configuration file + - it encodes the RRCConfiguration and the RBconfig message and stores them in the binary files `rbconfig.raw` and `reconfig.raw` in the current directory + - the MAC uses a pre-configured allocation of PDSCH and PUSCH with randomly generated payload instead of the standard scheduler. The options `-m`, `-l`, `-t`, `-M`, `-T`, `-D`, and `-U` can be used to configure this scheduler. + - Options `-Dmod`, and `-Umod` were introduced to enable scheduling PDSCH/PUSCH on slots >= 64 in phy-test mode. (in case of >= 120Khz subcarrier spacing and FDD) + - For ex: `-Dmod 2' / '-Umod 2` allocates every 2nd slot for PDSCH or PUSCH respectively. + - See `./nr-softmodem -h` for more information. + +At the UE, the `--phy-test` flag will read the binary files `rbconfig.raw` and `reconfig.raw` from the current directory and process them. If you wish to provide a different path for these files, please use the options `--reconfig-file` and `--rbconfig-file`. + +```bash +sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --phy-test +``` + +```bash +sudo ./nr-uesoftmodem --phy-test [--reconfig-file ../../../ci-scripts/rrc-files/reconfig.raw --rbconfig-file ../../../ci-scripts/rrc-files/rbconfig.raw] +``` + +In summary: +- If you are running on the same machine and launched the 2 executables (`nr-softmodem` and `nr-uesoftmodem`) from the same directory, nothing has to be done. +- If you launched the 2 executables from 2 different folders, just point to the location where you launched the `nr-softmodem`: + * `sudo ./nr-uesoftmodem --rfsim --phy-test --reconfig-file /the/path/where/you/launched/nr-softmodem/reconfig-file --rbconfig-file /the/path/where/you/launched/nr-softmodem/rbconfig-file --rfsimulator.[0].serveraddr ` +- If you are not running on the same machine, you need to **COPY** the two raw files + * `scp usera@machineA:/the/path/where/you/launched/nr-softmodem/r*config.raw userb@machineB:/the/path/where/you/will/launch/nr-uesoftmodem/` + * Obviously this operation should be done before launching the `nr-uesoftmodem` executable. + +In phy-test mode it is possible to mimic the reception of UE Capabilities at gNB through the command line parameter `--uecap_file`. Refer to the [UE Capabilities](#UE-Capabilities) section for more details. + +### noS1 setup with OAI UE + +Instead of randomly generated payload, in the phy-test mode we can also +inject/receive user-plane traffic over a TUN interface. This is the so-called +noS1 mode. + +The noS1 mode is applicable to both gNB/UE, and enabled by passing `--noS1` as +an option. The gNB/UE will open a TUN interface which the interface names and +IP addresses `oaitun_enb1`/10.0.1.1, and `oaitun_ue1`/10.0.1.2, respectively. +You can then use these interfaces to send traffic, e.g., +```bash +iperf -sui1 -B 10.0.1.2 +``` +to open an iperf server on the UE side, and +```bash +iperf -uc 10.0.1.2 -B 10.0.1.1 -i1 -t10 -b1M +``` +to send data from the gNB down to the UE. + +> Note that this does not work if both interfaces are on the same host. We +recommend to use two different hosts, or at least network namespaces, to route +traffic through the gNB/UE tunnel. + +This option is only really helpful for phy-test/do-ra (see below) modes, in +which the UE does not connect to a core network. If the UE connects to a core +network, it receives an IP address for which it automatically opens a network +interface. + +### do-ra setup with OAI + +The do-ra flag is used to ran the NR Random Access procedures in contention-free mode. Currently OAI implements the RACH process from Msg1 to Msg3. + +In order to run the RA, the `--do-ra` flag is needed for both the gNB and the UE. + +In do-ra mode it is possible to mimic the reception of UE Capabilities at gNB through the command line parameter `--uecap_file`. Refer to the [UE Capabilities](#UE-Capabilities) section for more details. + +To run using the RFsimulator: + +```bash +sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --do-ra --rfsim +sudo ./nr-uesoftmodem --do-ra --rfsim --rfsimulator.[0].serveraddr 127.0.0.1 +``` + +Using USRPs: + +```bash +sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --do-ra +``` + +On a separate machine: + +```bash +sudo ./nr-uesoftmodem --do-ra +``` diff --git a/doc/testing_oai_nsa_w_cots_ue_resources/gnb.conf b/doc/testing_oai_nsa_w_cots_ue_resources/gnb.conf index 7f244c0fec..5275469137 100755 --- a/doc/testing_oai_nsa_w_cots_ue_resources/gnb.conf +++ b/doc/testing_oai_nsa_w_cots_ue_resources/gnb.conf @@ -183,7 +183,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; } @@ -191,7 +190,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; } ); diff --git a/docker/Dockerfile.build.fhi72.native_arm.ubuntu b/docker/Dockerfile.build.fhi72.native_arm.ubuntu index d59a4787e2..8aa77c3b33 100644 --- a/docker/Dockerfile.build.fhi72.native_arm.ubuntu +++ b/docker/Dockerfile.build.fhi72.native_arm.ubuntu @@ -36,7 +36,7 @@ RUN wget http://fast.dpdk.org/rel/dpdk-20.11.9.tar.xz && \ ninja install -C build ## Build Fronthaul library -RUN git clone https://gerrit.o-ran-sc.org/r/o-du/phy.git /opt/phy && \ +RUN git clone https://github.com/openairinterface/o-du-phy.git /opt/phy && \ cd /opt/phy && \ git checkout oran_f_release_v1.0 &&\ git apply /oai-ran/cmake_targets/tools/oran_fhi_integration_patches/F/oaioran_F.patch && \ diff --git a/docker/Dockerfile.build.fhi72.rhel9 b/docker/Dockerfile.build.fhi72.rhel9 index 4e92a13638..315d1367bb 100644 --- a/docker/Dockerfile.build.fhi72.rhel9 +++ b/docker/Dockerfile.build.fhi72.rhel9 @@ -23,7 +23,7 @@ RUN wget http://fast.dpdk.org/rel/dpdk-20.11.9.tar.xz && \ ninja install -C build ## Build Fronthaul library -RUN git clone https://gerrit.o-ran-sc.org/r/o-du/phy.git /opt/phy && \ +RUN git clone https://github.com/openairinterface/o-du-phy.git /opt/phy && \ cd /opt/phy && \ git checkout oran_f_release_v1.0 &&\ git apply /oai-ran/cmake_targets/tools/oran_fhi_integration_patches/F/oaioran_F.patch && \ diff --git a/docker/Dockerfile.build.fhi72.ubuntu b/docker/Dockerfile.build.fhi72.ubuntu index 6e341f4688..3375be7ff7 100644 --- a/docker/Dockerfile.build.fhi72.ubuntu +++ b/docker/Dockerfile.build.fhi72.ubuntu @@ -36,7 +36,7 @@ RUN wget http://fast.dpdk.org/rel/dpdk-20.11.9.tar.xz && \ ninja install -C build ## Build Fronthaul library -RUN git clone https://gerrit.o-ran-sc.org/r/o-du/phy.git /opt/phy && \ +RUN git clone https://github.com/openairinterface/o-du-phy.git /opt/phy && \ cd /opt/phy && \ git checkout oran_f_release_v1.0 &&\ git apply /oai-ran/cmake_targets/tools/oran_fhi_integration_patches/F/oaioran_F.patch && \ diff --git a/executables/lte-ue.c b/executables/lte-ue.c index ccdf2d5525..f96de51f16 100644 --- a/executables/lte-ue.c +++ b/executables/lte-ue.c @@ -300,8 +300,6 @@ void init_UE(int nb_inst, UE_thread, (void *)UE), ""); } - - printf("UE threads created by %ld\n", gettid()); } // Initiating all UEs within a single set of threads for PHY_STUB. Future extensions -> multiple diff --git a/executables/nr-ru.c b/executables/nr-ru.c index f6e73b9e6a..7554c8a9a6 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -22,7 +22,6 @@ #include "PHY/LTE_TRANSPORT/if4_tools.h" -#include "PHY/types.h" #include "PHY/defs_nr_common.h" #include "PHY/phy_extern.h" #include "PHY/NR_TRANSPORT/nr_transport_proto.h" @@ -982,7 +981,7 @@ void *ru_thread(void *param) // Do PRACH RU processing prach_item_t *p = - find_nr_prach(&gNB->prach_list, proc->frame_rx, proc->tti_rx, gNB->frame_parms.nb_antennas_rx, SEARCH_EXIST); + find_nr_prach(&gNB->prach_list, proc->frame_rx, proc->tti_rx, gNB->frame_parms.nb_antennas_rx, NR_SEARCH_EXIST); if (p) { // need to extract RACH data for later processing by rx_nr_prach() rx_nr_prach_ru(p, ru->common.rxdata, ru->nr_frame_parms, ru->N_TA_offset); @@ -1016,7 +1015,6 @@ int nr_start_if(struct RU_t_s *ru, struct PHY_VARS_gNB_s *gNB) { for (int i = 0; i < ru->nb_rx; i++) ru->openair0_cfg.rxbase[i] = ru->common.rxdata[i]; ru->openair0_cfg.rxsize = ru->nr_frame_parms->samples_per_subframe*10; - reset_meas(&ru->ifdevice.tx_fhaul); return ru->ifdevice.trx_start_func(&ru->ifdevice); } diff --git a/executables/nr-softmodem-common.h b/executables/nr-softmodem-common.h index 13dabb2ace..bbf023998b 100644 --- a/executables/nr-softmodem-common.h +++ b/executables/nr-softmodem-common.h @@ -30,7 +30,6 @@ #include #include "radio/COMMON/common_lib.h" #include "assertions.h" -#include "PHY/types.h" /* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */ #define CONFIG_HLP_DLMCS_PHYTEST "Set the downlink MCS for PHYTEST mode\n" diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index c0b766cc13..1198e5bd02 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -55,7 +55,6 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "gnb_paramdef.h" #include "intertask_interface.h" #include "nfapi/oai_integration/vendor_ext.h" -#include "nfapi_interface.h" #include "nfapi_nr_interface_scf.h" #include "ngap_gNB.h" #include "nr-softmodem-common.h" @@ -595,7 +594,6 @@ int main( int argc, char **argv ) { : TIME_SOURCE_REALTIME); // start the main threads - number_of_cards = 1; wait_gNBs(); int sl_ahead = NFAPI_MODE == NFAPI_MODE_AERIAL ? 0 : 6; diff --git a/executables/nr-ue-ru.c b/executables/nr-ue-ru.c index e2c8cc5f40..52b234a137 100644 --- a/executables/nr-ue-ru.c +++ b/executables/nr-ue-ru.c @@ -5,6 +5,8 @@ #include "nr-ue-ru.h" #include "nr-uesoftmodem.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" +#include "common/config/config_paramdesc.h" +#include "common/config/config_userapi.h" /* NR UE RU configuration section name */ #define CONFIG_STRING_NRUE_RU_LIST "RUs" diff --git a/executables/nr-ue.c b/executables/nr-ue.c index cf5762e8c7..ac7dace077 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -5,7 +5,6 @@ #include "PHY/defs_nr_common.h" #define _GNU_SOURCE // For pthread_setname_np #include -#include #include "executables/nr-ue-ru.h" #include "executables/nr-uesoftmodem.h" #include "PHY/INIT/nr_phy_init.h" diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 50a1c7352b..2069da4c00 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -12,25 +12,18 @@ #include "T.h" #include "common/oai_version.h" #include "assertions.h" -#include "PHY/types.h" #include "PHY/defs_nr_UE.h" #include "SCHED_NR_UE/defs.h" #include "common/ran_context.h" #include "common/config/config_userapi.h" #include "common/utils/load_module_shlib.h" -//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all #include "common/utils/nr/nr_common.h" - #include "radio/COMMON/common_lib.h" #include "radio/ETHERNET/if_defs.h" - -//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all #include "openair1/PHY/MODULATION/nr_modulation.h" #include "PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h" #include "PHY/phy_vars_nr_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" -#include "PHY/NR_TRANSPORT/nr_dlsch.h" -//#include "../../SIMU/USER/init_lte.h" #include "PHY_INTERFACE/phy_interface_vars.h" #include "NR_IF_Module.h" @@ -69,8 +62,6 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "executables/thread-common.h" #include "nr_nas_msg.h" -#include -#include "openair2/GNB_APP/gnb_paramdef.h" #include "actor.h" THREAD_STRUCT thread_struct; @@ -450,7 +441,6 @@ int main(int argc, char **argv) LOG_I(PHY,"Intializing UE Threads for instance %d ...\n", inst); init_NR_UE_threads(PHY_vars_UE_g[inst][0]); } - printf("UE threads created by %ld\n", gettid()); // wait for end of program printf("TYPE TO TERMINATE\n"); diff --git a/executables/position_interface.c b/executables/position_interface.c index 195677f64d..f3c336745c 100644 --- a/executables/position_interface.c +++ b/executables/position_interface.c @@ -4,6 +4,7 @@ #include "position_interface.h" #include "executables/nr-uesoftmodem.h" +#include "common/config/config_userapi.h" static void read_position_coordinates(char *sectionName, position_t *position) { diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c index dd10a86a59..187580cd94 100644 --- a/nfapi/oai_integration/nfapi_pnf.c +++ b/nfapi/oai_integration/nfapi_pnf.c @@ -1090,14 +1090,13 @@ void pnf_nr_phy_deallocate_p7_vendor_ext(void *header) } -int pnf_phy_hi_dci0_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_hi_dci0_request_t *req) { +int pnf_phy_hi_dci0_req(nfapi_pnf_p7_config_t *pnf_p7, nfapi_hi_dci0_request_t *req) { if (req->hi_dci0_request_body.number_of_dci == 0 && req->hi_dci0_request_body.number_of_hi == 0) LOG_D(PHY,"[PNF] HI_DCI0_REQUEST SFN/SF:%05d dci:%d hi:%d\n", NFAPI_SFNSF2DEC(req->sfn_sf), req->hi_dci0_request_body.number_of_dci, req->hi_dci0_request_body.number_of_hi); //phy_info* phy = (phy_info*)(pnf_p7->user_data); struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; - if (proc ==NULL) - proc = &eNB->proc.L1_proc; + L1_rxtx_proc_t *proc = &eNB->proc.L1_proc; for (int i=0; ihi_dci0_request_body.number_of_dci + req->hi_dci0_request_body.number_of_hi; i++) { //LOG_D(PHY,"[PNF] HI_DCI0_REQ sfn_sf:%d PDU[%d]\n", NFAPI_SFNSF2DEC(req->sfn_sf), i); @@ -1119,7 +1118,7 @@ int pnf_phy_hi_dci0_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfa } -int pnf_phy_dl_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_dl_config_request_t *req) { +int pnf_phy_dl_config_req(nfapi_pnf_p7_config_t *pnf_p7, nfapi_dl_config_request_t *req) { if (RC.eNB == 0) { return -2; @@ -1137,8 +1136,7 @@ int pnf_phy_dl_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, n int sfn = NFAPI_SFNSF2SFN(req->sfn_sf); int sf = NFAPI_SFNSF2SF(req->sfn_sf); struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; - if (proc==NULL) - proc = &eNB->proc.L1_proc; + L1_rxtx_proc_t *proc = &eNB->proc.L1_proc; nfapi_dl_config_request_pdu_t *dl_config_pdu_list = req->dl_config_request_body.dl_config_pdu_list; LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[sf&1]; pdcch_vars->num_pdcch_symbols = req->dl_config_request_body.number_pdcch_ofdm_symbols; @@ -1236,7 +1234,7 @@ int pnf_phy_tx_req(nfapi_pnf_p7_config_t *pnf_p7, nfapi_tx_request_t *req) { return 0; } -int pnf_phy_ul_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_ul_config_request_t *req) { +int pnf_phy_ul_config_req(nfapi_pnf_p7_config_t *pnf_p7, nfapi_ul_config_request_t *req) { if (0)LOG_D(PHY,"[PNF] UL_CONFIG_REQ %s() sfn_sf:%d pdu:%d rach_prach_frequency_resources:%d srs_present:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), @@ -1262,8 +1260,7 @@ int pnf_phy_ul_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, n uint16_t curr_sfn = NFAPI_SFNSF2SFN(req->sfn_sf); uint16_t curr_sf = NFAPI_SFNSF2SF(req->sfn_sf); struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; - if (proc==NULL) - proc = &eNB->proc.L1_proc; + L1_rxtx_proc_t *proc = &eNB->proc.L1_proc; nfapi_ul_config_request_pdu_t *ul_config_pdu_list = req->ul_config_request_body.ul_config_pdu_list; for (int i=0; iul_config_request_body.number_of_pdus; i++) { diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 9873337b80..4e68bb116d 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -37,7 +37,6 @@ #include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h" #include "executables/lte-softmodem.h" #include "openair1/PHY/defs_gNB.h" - #include "common/ran_context.h" #include "openair2/PHY_INTERFACE/queue_t.h" #include "gnb_ind_vars.h" @@ -1710,6 +1709,7 @@ void configure_nr_nfapi_vnf(eth_params_t params) vnf->p7_vnfs[0].aperiodic_timing_enabled = 0; vnf->p7_vnfs[0].periodic_timing_period = 1; vnf->p7_vnfs[0].config = nfapi_vnf_p7_config_create(); + AssertFatal(params.remote_portc == 0 && params.remote_portd == 0, "remote ports not used, use 0\n"); #ifndef ENABLE_AERIAL NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %s() vnf->p7_vnfs[0].config:%p VNF ADDRESS:%s:%d\n", diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h index da0b0ee78b..1ccaf2ee68 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h @@ -10,7 +10,6 @@ #include "stddef.h" #include "common/platform_types.h" #include "fapi_nr_ue_constants.h" -#include "PHY/impl_defs_top.h" #include "PHY/impl_defs_nr.h" #include "common/utils/nr/nr_common.h" #include "executables/position_interface.h" diff --git a/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h b/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h index 6cf323da78..7e6926627a 100644 --- a/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h +++ b/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h @@ -706,7 +706,7 @@ typedef struct nfapi_pnf_p7_config * \return not currently used */ int (*dl_tti_req_fn)(gNB_L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_nr_dl_tti_request_t* req); - int (*dl_config_req)(L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_dl_config_request_t* req); + int (*dl_config_req)(nfapi_pnf_p7_config_t* config, nfapi_dl_config_request_t* req); /*! A callback for the UL_CONFIG.request * \param config A poiner to the PNF P7 config @@ -714,7 +714,7 @@ typedef struct nfapi_pnf_p7_config * \return not currently used */ int (*ul_tti_req_fn)(gNB_L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_nr_ul_tti_request_t* req); - int (*ul_config_req)(L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_ul_config_request_t* req); + int (*ul_config_req)(nfapi_pnf_p7_config_t* config, nfapi_ul_config_request_t* req); /*! A callback for the HI_DCI0.request * \param config A poiner to the PNF P7 config @@ -722,7 +722,7 @@ typedef struct nfapi_pnf_p7_config * \return not currently used */ int (*ul_dci_req_fn)(gNB_L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_nr_ul_dci_request_t* req); - int (*hi_dci0_req)(L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_hi_dci0_request_t* req); + int (*hi_dci0_req)(nfapi_pnf_p7_config_t* config, nfapi_hi_dci0_request_t* req); /*! A callback for the TX_REQ.request * \param config A poiner to the PNF P7 config diff --git a/nfapi/open-nFAPI/pnf/src/pnf_p7.c b/nfapi/open-nFAPI/pnf/src/pnf_p7.c index f935e30fb6..0b3ac77d86 100644 --- a/nfapi/open-nFAPI/pnf/src/pnf_p7.c +++ b/nfapi/open-nFAPI/pnf/src/pnf_p7.c @@ -639,20 +639,20 @@ void send_dummy_subframe(pnf_p7_t* pnf_p7, uint16_t sfn_sf) { pnf_p7->_public.dummy_subframe.dl_config_req->sfn_sf = sfn_sf; //NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy dl_config_req - enter\n"); - (pnf_p7->_public.dl_config_req)(NULL, &(pnf_p7->_public), pnf_p7->_public.dummy_subframe.dl_config_req); + (pnf_p7->_public.dl_config_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.dl_config_req); //NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy dl_config_req - exit\n"); } if(pnf_p7->_public.ul_config_req && pnf_p7->_public.dummy_subframe.ul_config_req) { pnf_p7->_public.dummy_subframe.ul_config_req->sfn_sf = sfn_sf; NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy ul_config_req - enter\n"); - (pnf_p7->_public.ul_config_req)(NULL, &pnf_p7->_public, pnf_p7->_public.dummy_subframe.ul_config_req); + (pnf_p7->_public.ul_config_req)(&pnf_p7->_public, pnf_p7->_public.dummy_subframe.ul_config_req); } if(pnf_p7->_public.hi_dci0_req && pnf_p7->_public.dummy_subframe.hi_dci0_req) { pnf_p7->_public.dummy_subframe.hi_dci0_req->sfn_sf = sfn_sf; NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy hi_dci0 - enter\n"); - (pnf_p7->_public.hi_dci0_req)(NULL, &pnf_p7->_public, pnf_p7->_public.dummy_subframe.hi_dci0_req); + (pnf_p7->_public.hi_dci0_req)(&pnf_p7->_public, pnf_p7->_public.dummy_subframe.hi_dci0_req); } if(pnf_p7->_public.lbt_dl_config_req && pnf_p7->_public.dummy_subframe.lbt_dl_config_req) { @@ -892,7 +892,7 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf) if(tx_subframe_buffer->dl_config_req != 0) { if(pnf_p7->_public.dl_config_req) - (pnf_p7->_public.dl_config_req)(NULL, &(pnf_p7->_public), tx_subframe_buffer->dl_config_req); + (pnf_p7->_public.dl_config_req)(&(pnf_p7->_public), tx_subframe_buffer->dl_config_req); //deallocate_nfapi_dl_config_request(subframe_buffer->dl_config_req, pnf_p7); } @@ -902,14 +902,14 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf) if(pnf_p7->_public.dl_config_req && pnf_p7->_public.dummy_subframe.dl_config_req) { pnf_p7->_public.dummy_subframe.dl_config_req->sfn_sf = sfn_sf_tx; - (pnf_p7->_public.dl_config_req)(NULL, &(pnf_p7->_public), pnf_p7->_public.dummy_subframe.dl_config_req); + (pnf_p7->_public.dl_config_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.dl_config_req); } } if(tx_subframe_buffer->hi_dci0_req != 0) { if(pnf_p7->_public.hi_dci0_req) - (pnf_p7->_public.hi_dci0_req)(NULL, &(pnf_p7->_public), tx_subframe_buffer->hi_dci0_req); + (pnf_p7->_public.hi_dci0_req)(&(pnf_p7->_public), tx_subframe_buffer->hi_dci0_req); //deallocate_nfapi_hi_dci0_request(subframe_buffer->hi_dci0_req, pnf_p7); } @@ -919,7 +919,7 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf) if(pnf_p7->_public.hi_dci0_req && pnf_p7->_public.dummy_subframe.hi_dci0_req) { pnf_p7->_public.dummy_subframe.hi_dci0_req->sfn_sf = sfn_sf_tx; - (pnf_p7->_public.hi_dci0_req)(NULL, &(pnf_p7->_public), pnf_p7->_public.dummy_subframe.hi_dci0_req); + (pnf_p7->_public.hi_dci0_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.hi_dci0_req); } } @@ -970,7 +970,7 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf) if(subframe_buffer->ul_config_req != 0) { if(pnf_p7->_public.ul_config_req) - (pnf_p7->_public.ul_config_req)(NULL, &(pnf_p7->_public), subframe_buffer->ul_config_req); + (pnf_p7->_public.ul_config_req)(&(pnf_p7->_public), subframe_buffer->ul_config_req); //deallocate_nfapi_ul_config_request(subframe_buffer->ul_config_req, pnf_p7); } @@ -980,7 +980,7 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf) if(pnf_p7->_public.ul_config_req && pnf_p7->_public.dummy_subframe.ul_config_req) { pnf_p7->_public.dummy_subframe.ul_config_req->sfn_sf = sfn_sf; - (pnf_p7->_public.ul_config_req)(NULL, &(pnf_p7->_public), pnf_p7->_public.dummy_subframe.ul_config_req); + (pnf_p7->_public.ul_config_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.ul_config_req); } } diff --git a/openair1/PHY/CODING/coding_defs.h b/openair1/PHY/CODING/coding_defs.h index 7503854c07..b705a1f81f 100644 --- a/openair1/PHY/CODING/coding_defs.h +++ b/openair1/PHY/CODING/coding_defs.h @@ -10,6 +10,7 @@ #include #include +#include #include "common/utils/nr/nr_common.h" #define CRC24_A 0 @@ -20,6 +21,37 @@ #define MAX_TURBO_ITERATIONS_MBSFN 8 #define MAX_TURBO_ITERATIONS max_turbo_iterations +typedef struct { + pthread_mutex_t mutex_failure; + bool failed; +} decode_abort_t; + +static inline void init_abort(decode_abort_t *ab) +{ + int ret = pthread_mutex_init(&ab->mutex_failure, NULL); + AssertFatal(ret == 0, "mutex failed with %d\n", ret); + ab->failed = false; +} + +static inline bool check_abort(decode_abort_t *ab) +{ + int ret = pthread_mutex_lock(&ab->mutex_failure); + AssertFatal(ret == 0, "mutex failed with %d\n", ret); + bool failed = ab->failed; + ret = pthread_mutex_unlock(&ab->mutex_failure); + AssertFatal(ret == 0, "mutex failed with %d\n", ret); + return failed; +} + +static inline void set_abort(decode_abort_t *ab, bool v) +{ + int ret = pthread_mutex_lock(&ab->mutex_failure); + AssertFatal(ret == 0, "mutex failed with %d\n", ret); + ab->failed = v; + ret = pthread_mutex_unlock(&ab->mutex_failure); + AssertFatal(ret == 0, "mutex failed with %d\n", ret); +} + static inline int lenWithCrc(int nbSeg, int len) { if (nbSeg > 1) diff --git a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c index 0da16183eb..534d103929 100644 --- a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c +++ b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c @@ -7,6 +7,8 @@ #include "PHY/sse_intrin.h" #include "reverse_bits.h" #include +#include "common/config/config_paramdesc.h" +#include "common/config/config_userapi.h" #define NR_LDPC_ENABLE_PARITY_CHECK #include "PHY/CODING/nrLDPC_decoder/nrLDPCdecoder_defs.h" diff --git a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h index 42bcd4aafe..901dfa1986 100644 --- a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h +++ b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h @@ -7,7 +7,7 @@ */ #include "common/utils/time_meas.h" -#include "openair1/PHY/defs_common.h" +#include "openair1/PHY/CODING/coding_defs.h" #include "common/utils/threadPool/thread-pool.h" #ifndef __NRLDPC_CODING_INTERFACE__H__ diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c index fbeb2fd5a4..4feabc1367 100644 --- a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c +++ b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c @@ -17,6 +17,7 @@ #include "nrLDPC_cnProc.h" #include "nrLDPC_bnProc.h" #include "openair1/PHY/CODING/coding_defs.h" +#include "log.h" #define UNROLL_CN_PROC 1 #define UNROLL_BN_PROC 1 #define UNROLL_BN_PROC_PC 1 diff --git a/openair1/PHY/CODING/nrLDPC_defs.h b/openair1/PHY/CODING/nrLDPC_defs.h index e63bbf855f..70d4f92761 100644 --- a/openair1/PHY/CODING/nrLDPC_defs.h +++ b/openair1/PHY/CODING/nrLDPC_defs.h @@ -7,6 +7,7 @@ #define __NRLDPC_DEFS__H__ #include #include "openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h" +#include "common/utils/threadPool/task_ans.h" /** \brief LDPC encoder parameter structure diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c index 865fbc5dc4..ab11be251d 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c @@ -1,10 +1,9 @@ /* * SPDX-License-Identifier: LicenseRef-CSSL-1.0 */ - +#include #include "PHY/CODING/nrPolar_tools/nr_polar_defs.h" #include "PHY/sse_intrin.h" -#include "PHY/impl_defs_top.h" // #define DEBUG_NEW_IMPL 1 diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 8fb5c3b124..d7d73e1c01 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -17,6 +17,7 @@ #include "openair2/COMMON/prs_nr_paramdef.h" #include "SCHED_NR_UE/harq_nr.h" #include "nr-uesoftmodem.h" +#include "common/config/config_userapi.h" void RCconfig_nrUE_prs(void *cfg) { @@ -322,8 +323,8 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue) sl_ue_free(ue); } -void free_nr_ue_dl_harq(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_DLSCH_HARQ_PROCESSES], int number_of_processes, int num_rb) { - +void free_nr_ue_dl_harq(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_HARQ_PROCESSES], int number_of_processes, int num_rb) +{ uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS; if (num_rb != 273) { a_segments = a_segments*num_rb; @@ -344,8 +345,8 @@ void free_nr_ue_dl_harq(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_DLSCH_HARQ_PROCESSES } } -void free_nr_ue_ul_harq(NR_UL_UE_HARQ_t harq_list[NR_MAX_ULSCH_HARQ_PROCESSES], int number_of_processes, int num_rb, int num_ant_tx) { - +void free_nr_ue_ul_harq(NR_UL_UE_HARQ_t harq_list[NR_MAX_HARQ_PROCESSES], int number_of_processes, int num_rb, int num_ant_tx) +{ int max_layers = (num_ant_tx < NR_MAX_NB_LAYERS) ? num_ant_tx : NR_MAX_NB_LAYERS; uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*max_layers; //number of segments to be allocated @@ -371,12 +372,12 @@ void term_nr_ue_transport(PHY_VARS_NR_UE *ue) { const int N_RB_DL = ue->frame_parms.N_RB_DL; const int N_RB_UL = ue->frame_parms.N_RB_UL; - free_nr_ue_dl_harq(ue->dl_harq_processes, NR_MAX_DLSCH_HARQ_PROCESSES, N_RB_DL); - free_nr_ue_ul_harq(ue->ul_harq_processes, NR_MAX_ULSCH_HARQ_PROCESSES, N_RB_UL, ue->frame_parms.nb_antennas_tx); + free_nr_ue_dl_harq(ue->dl_harq_processes, NR_MAX_HARQ_PROCESSES, N_RB_DL); + free_nr_ue_ul_harq(ue->ul_harq_processes, NR_MAX_HARQ_PROCESSES, N_RB_UL, ue->frame_parms.nb_antennas_tx); } -void nr_init_dl_harq_processes(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_DLSCH_HARQ_PROCESSES], int number_of_processes, int num_rb) { - +void nr_init_dl_harq_processes(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_HARQ_PROCESSES], int number_of_processes, int num_rb) +{ int a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS; //number of segments to be allocated if (num_rb != 273) { a_segments = a_segments*num_rb; @@ -403,8 +404,8 @@ void nr_init_dl_harq_processes(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_DLSCH_HARQ_PR } } -void nr_init_ul_harq_processes(NR_UL_UE_HARQ_t harq_list[NR_MAX_ULSCH_HARQ_PROCESSES], int number_of_processes, int num_rb, int num_ant_tx) { - +void nr_init_ul_harq_processes(NR_UL_UE_HARQ_t harq_list[NR_MAX_HARQ_PROCESSES], int number_of_processes, int num_rb, int num_ant_tx) +{ int max_layers = (num_ant_tx < NR_MAX_NB_LAYERS) ? num_ant_tx : NR_MAX_NB_LAYERS; uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*max_layers; //number of segments to be allocated @@ -447,24 +448,21 @@ void nr_init_ul_harq_processes(NR_UL_UE_HARQ_t harq_list[NR_MAX_ULSCH_HARQ_PROCE } } -void init_nr_ue_transport(PHY_VARS_NR_UE *ue) { - - nr_init_dl_harq_processes(ue->dl_harq_processes, NR_MAX_DLSCH_HARQ_PROCESSES, ue->frame_parms.N_RB_DL); - nr_init_ul_harq_processes(ue->ul_harq_processes, - NR_MAX_ULSCH_HARQ_PROCESSES, - ue->frame_parms.N_RB_UL, - ue->frame_parms.nb_antennas_tx); +void init_nr_ue_transport(PHY_VARS_NR_UE *ue) +{ + nr_init_dl_harq_processes(ue->dl_harq_processes, NR_MAX_HARQ_PROCESSES, ue->frame_parms.N_RB_DL); + nr_init_ul_harq_processes(ue->ul_harq_processes, NR_MAX_HARQ_PROCESSES, ue->frame_parms.N_RB_UL, ue->frame_parms.nb_antennas_tx); } void clean_UE_harq(PHY_VARS_NR_UE *UE) { - for (int harq_pid = 0; harq_pid < NR_MAX_DLSCH_HARQ_PROCESSES; harq_pid++) { + for (int harq_pid = 0; harq_pid < NR_MAX_HARQ_PROCESSES; harq_pid++) { for (int i = 0; i < 2; i++) { NR_DL_UE_HARQ_t *dl_harq_process = &UE->dl_harq_processes[i][harq_pid]; init_downlink_harq_status(dl_harq_process); } } - for (int harq_pid = 0; harq_pid < NR_MAX_ULSCH_HARQ_PROCESSES; harq_pid++) { + for (int harq_pid = 0; harq_pid < NR_MAX_HARQ_PROCESSES; harq_pid++) { NR_UL_UE_HARQ_t *ul_harq_process = &UE->ul_harq_processes[harq_pid]; ul_harq_process->round = 0; } diff --git a/openair1/PHY/INIT/nr_parms.h b/openair1/PHY/INIT/nr_parms.h new file mode 100644 index 0000000000..4959f28260 --- /dev/null +++ b/openair1/PHY/INIT/nr_parms.h @@ -0,0 +1,27 @@ +/* + * SPDX-License-Identifier: LicenseRef-CSSL-1.0 + */ + +#ifndef _NR_PARMS_H_ +#define _NR_PARMS_H_ +#include "fapi_nr_ue_interface.h" +#include "openair1/PHY/defs_nr_UE.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void nr_init_frame_parms(nfapi_nr_config_request_scf_t *config, NR_DL_FRAME_PARMS *frame_parms); +int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms, fapi_nr_config_request_t *config, uint16_t nr_band); +void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, const nrUE_cell_params_t *cell); +int nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *fp, + sl_nr_phy_config_request_t *config, + int threequarter_fs, + uint32_t ofdm_offset_divisor); +void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/openair1/PHY/INIT/nr_phy_init.h b/openair1/PHY/INIT/nr_phy_init.h index 30af36a503..d18106c7b9 100644 --- a/openair1/PHY/INIT/nr_phy_init.h +++ b/openair1/PHY/INIT/nr_phy_init.h @@ -7,19 +7,12 @@ #include "PHY/defs_gNB.h" #include "PHY/defs_nr_UE.h" +#include "nr_parms.h" int nr_get_ssb_start_symbol(const NR_DL_FRAME_PARMS *fp, uint8_t i_ssb); -void nr_init_frame_parms(nfapi_nr_config_request_scf_t *config, NR_DL_FRAME_PARMS *frame_parms); -int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms, fapi_nr_config_request_t *config, uint16_t nr_band); -void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, const nrUE_cell_params_t *cell); -int nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *fp, - sl_nr_phy_config_request_t *config, - int threequarter_fs, - uint32_t ofdm_offset_divisor); int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB); void term_nr_ue_signal(PHY_VARS_NR_UE *ue); void init_nr_ue_transport(PHY_VARS_NR_UE *ue); -void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms); void phy_init_nr_gNB(PHY_VARS_gNB *gNB); int init_codebook_gNB(PHY_VARS_gNB *gNB); void nr_phy_config_request(NR_PHY_Config_t *gNB); @@ -31,10 +24,10 @@ void reset_nr_transport(PHY_VARS_gNB *gNB); void RCconfig_nrUE_prs(void *cfg); void init_nr_prs_ue_vars(PHY_VARS_NR_UE *ue); -void nr_init_dl_harq_processes(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_DLSCH_HARQ_PROCESSES], int number_of_processes, int num_rb); -void nr_init_ul_harq_processes(NR_UL_UE_HARQ_t harq_list[NR_MAX_ULSCH_HARQ_PROCESSES], int number_of_processes, int num_rb, int num_ant_tx); -void free_nr_ue_dl_harq(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_DLSCH_HARQ_PROCESSES], int number_of_processes, int num_rb); -void free_nr_ue_ul_harq(NR_UL_UE_HARQ_t harq_list[NR_MAX_ULSCH_HARQ_PROCESSES], int number_of_processes, int num_rb, int num_ant_tx); +void nr_init_dl_harq_processes(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_HARQ_PROCESSES], int number_of_processes, int num_rb); +void nr_init_ul_harq_processes(NR_UL_UE_HARQ_t harq_list[NR_MAX_HARQ_PROCESSES], int number_of_processes, int num_rb, int num_ant_tx); +void free_nr_ue_dl_harq(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_HARQ_PROCESSES], int number_of_processes, int num_rb); +void free_nr_ue_ul_harq(NR_UL_UE_HARQ_t harq_list[NR_MAX_HARQ_PROCESSES], int number_of_processes, int num_rb, int num_ant_tx); void phy_init_nr_top(PHY_VARS_NR_UE *ue); void phy_term_nr_top(void); diff --git a/openair1/PHY/INIT/tests/test_nr_frame_params.cpp b/openair1/PHY/INIT/tests/test_nr_frame_params.cpp index 5c44308170..5593a74864 100644 --- a/openair1/PHY/INIT/tests/test_nr_frame_params.cpp +++ b/openair1/PHY/INIT/tests/test_nr_frame_params.cpp @@ -6,7 +6,8 @@ extern "C" { #include #include "openair1/PHY/defs_nr_common.h" -#include "openair1/PHY/INIT/nr_phy_init.h" +#include "openair1/PHY/INIT/nr_parms.h" +#include "common/config/config_userapi.h" static softmodem_params_t softmodem_params; softmodem_params_t *get_softmodem_params(void) diff --git a/openair1/PHY/LTE_REFSIG/defs_NB_IoT.h b/openair1/PHY/LTE_REFSIG/defs_NB_IoT.h index 8adf92c189..85342f006f 100644 --- a/openair1/PHY/LTE_REFSIG/defs_NB_IoT.h +++ b/openair1/PHY/LTE_REFSIG/defs_NB_IoT.h @@ -41,10 +41,6 @@ int lte_dl_cell_spec_NB_IoT(PHY_VARS_eNB_NB_IoT *phy_vars_eNB, unsigned char p, unsigned short RB_IoT_ID); - -unsigned int lte_gold_generic_NB_IoT(unsigned int *x1, - unsigned int *x2, - unsigned char reset); void generate_ul_ref_sigs_rx_NB_IoT(void); diff --git a/openair1/PHY/LTE_REFSIG/lte_refsig.h b/openair1/PHY/LTE_REFSIG/lte_refsig.h index 0521c9d3a5..66ac6e25a5 100644 --- a/openair1/PHY/LTE_REFSIG/lte_refsig.h +++ b/openair1/PHY/LTE_REFSIG/lte_refsig.h @@ -10,7 +10,7 @@ #define __LTE_REFSIG_DEFS__H__ #include "PHY/defs_eNB.h" #include "PHY/defs_UE.h" - +#include "PHY/gold.h" /** @ingroup _PHY_REF_SIG * @{ */ diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index bc6065606c..e15a3a35ec 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -184,12 +184,12 @@ void pdcch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, uint32_t x1 = 0, x2 = 0, s = 0; //LOG_D(PHY, "%s(fp, subframe:%d, e, length:%d)\n", __FUNCTION__, subframe, length); reset = 1; - // x1 is set in lte_gold_generic + // x1 is set in gold_generic x2 = (subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.8.2 for (i=0; i>1)<<9) + frame_parms->Nid_cell_mbsfn; //this is c_init in 36.211 Sec 6.3.1 for PMCH } - s = lte_gold_generic(&x1, &x2, 1); + s = gold_generic(&x1, &x2, 1); for (n=0; n<(1+(G>>5)); n++) { #ifdef DEBUG_SCRAMBLING @@ -132,7 +132,7 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, // This is not faster for some unknown reason // ((simde__m128i *)e)[0] = simde_mm_xor_si128(((simde__m128i *)e)[0],((simde__m128i *)scrambling_lut)[s&65535]); // ((simde__m128i *)e)[1] = simde_mm_xor_si128(((simde__m128i *)e)[1],((simde__m128i *)scrambling_lut)[s>>16]); - s = lte_gold_generic(&x1, &x2, 0); + s = gold_generic(&x1, &x2, 0); e += 32; } @@ -163,7 +163,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, uint32_t x1, x2, s=0; // reset = 1; - // x1 is set in first call to lte_gold_generic + // x1 is set in first call to gold_generic if (mbsfn_flag == 0) x2 = (dlsch->rnti<<14) + (q<<13) + ((Ns>>1)<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1 @@ -173,7 +173,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, #ifdef DEBUG_SCRAMBLING printf("unscrambling: rnti %x, q %d, Ns %d, Nid_cell %d G %d, x2 %x\n",dlsch->rnti,q,Ns,frame_parms->Nid_cell,G,x2); #endif - s = lte_gold_generic(&x1, &x2, 1); + s = gold_generic(&x1, &x2, 1); for (i=0; i<(1+(G>>5)); i++) { for (j=0; j<32; j++,k++) { @@ -186,7 +186,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, #endif } - s = lte_gold_generic(&x1, &x2, 0); + s = gold_generic(&x1, &x2, 0); } } diff --git a/openair1/PHY/LTE_TRANSPORT/edci.c b/openair1/PHY/LTE_TRANSPORT/edci.c index 7c46de8bba..f12ecb6838 100644 --- a/openair1/PHY/LTE_TRANSPORT/edci.c +++ b/openair1/PHY/LTE_TRANSPORT/edci.c @@ -38,7 +38,7 @@ void mpdcch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, mDCI_ALLOC_t *mdci, uint uint16_t i0 = mdci->i0; // Note: we could actually not do anything if i-i0 < Nacc, save it for later reset = 1; - // x1 is set in lte_gold_generic + // x1 is set in gold_generic if ((mdci->rnti == 0xFFFE) || (mdci->ce_mode == 2)) // CEModeB Note: also for mdci->rnti==SC_RNTI Nacc = frame_parms->frame_type == FDD ? 4 : 10; @@ -59,7 +59,7 @@ void mpdcch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, mDCI_ALLOC_t *mdci, uint for (n = 0; n < length; n++) { if ((n & 0x1f) == 0) { - s = lte_gold_generic(&x1, &x2, reset); + s = gold_generic(&x1, &x2, reset); //printf("lte_gold[%d]=%x\n",i,s); reset = 0; } @@ -354,7 +354,7 @@ void generate_mdci_top(PHY_VARS_eNB *eNB, int frame, int subframe, int16_t amp, // pilot scrambling initiatlization (note: this is for a single repetition) - // x1 is set in lte_gold_generic + // x1 is set in gold_generic // rule for BL/CE UEs from Section 6.10.3A.1 in 36.211 @@ -394,7 +394,7 @@ void generate_mdci_top(PHY_VARS_eNB *eNB, int frame, int subframe, int16_t amp, for (int mprime=0; mprime<3; mprime++,ii+=2) { if ((ii & 0x1f) == 0) { - s = lte_gold_generic(&x1, &x2, reset); + s = gold_generic(&x1, &x2, reset); reset = 0; } diff --git a/openair1/PHY/LTE_TRANSPORT/group_hopping.c b/openair1/PHY/LTE_TRANSPORT/group_hopping.c index 4c60eee146..3feae398a7 100644 --- a/openair1/PHY/LTE_TRANSPORT/group_hopping.c +++ b/openair1/PHY/LTE_TRANSPORT/group_hopping.c @@ -34,7 +34,7 @@ void generate_grouphop(LTE_DL_FRAME_PARMS *frame_parms) } else { if ((ns&3) == 0) { - s = lte_gold_generic(&x1,&x2,reset); + s = gold_generic(&x1,&x2,reset); reset = 0; } @@ -62,7 +62,7 @@ void generate_seqhop(LTE_DL_FRAME_PARMS *frame_parms) x2 = (32*(frame_parms->Nid_cell/30) + fss_pusch)%30; - s = lte_gold_generic(&x1,&x2,reset); + s = gold_generic(&x1,&x2,reset); #ifdef DEBUG_GROUPHOP printf("[PHY] SeqHop:"); #endif @@ -105,7 +105,7 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms) for (n=0; n<(20*Nsymb_UL); n++) { //loop over total number of bytes to generate if ((n&3) == 0) { - s = lte_gold_generic(&x1,&x2,reset); + s = gold_generic(&x1,&x2,reset); reset = 0; // printf("n %d : s (%d,%d,%d,%d)\n",n,((uint8_t*)&s)[0],((uint8_t*)&s)[1],((uint8_t*)&s)[2],((uint8_t*)&s)[3]); } diff --git a/openair1/PHY/LTE_TRANSPORT/pbch.c b/openair1/PHY/LTE_TRANSPORT/pbch.c index 971dad59f7..d9962a2c8e 100644 --- a/openair1/PHY/LTE_TRANSPORT/pbch.c +++ b/openair1/PHY/LTE_TRANSPORT/pbch.c @@ -125,13 +125,13 @@ void pbch_scrambling_fembms(LTE_DL_FRAME_PARMS *frame_parms, uint32_t x1 = 0, x2 = 0, s = 0; reset = 1; - // x1 is set in lte_gold_generic + // x1 is set in gold_generic x2 = frame_parms->Nid_cell + (1<<9); //this is c_init for FeMBMS in 36.211 Sec 6.6.1 // msg("pbch_scrambling: Nid_cell = %d\n",x2); for (i=0; iNid_cell; //this is c_init in 36.211 Sec 6.6.1 // msg("pbch_scrambling: Nid_cell = %d\n",x2); for (i=0; iNid_cell)+1)*(1+subframe))<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.7.1 for (i=0; i<32; i++) { if ((i&0x1f)==0) { - s = lte_gold_generic(&x1, &x2, reset); + s = gold_generic(&x1, &x2, reset); //printf("lte_gold[%d]=%x\n",i,s); reset = 0; } diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index 7ba5c344fa..efdedf7399 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -60,10 +60,10 @@ void generate_phich(LTE_DL_FRAME_PARMS *frame_parms, // c = (1-(2*HI))*SSS_AMP; - // x1 is set in lte_gold_generic + // x1 is set in gold_generic x2 = (((subframe+1)*((frame_parms->Nid_cell<<1)+1))<<9) + frame_parms->Nid_cell; - s = lte_gold_generic(&x1, &x2, reset); + s = gold_generic(&x1, &x2, reset); // compute scrambling sequence for (i=0; i<12; i++) { diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 73ed4d1940..2e8fc4004f 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -645,8 +645,8 @@ uint16_t pucchfmt3_Descramble( int16_t IFFTOutData_Fmt3[2][12][2], uint32_t x1; uint32_t s,s0,s1; cinit = (subframe + 1) * ((2 * Nid_cell + 1)<<16) + rnti; - s0 = lte_gold_generic(&x1,&cinit,1); - s1 = lte_gold_generic(&x1,&cinit,0); + s0 = gold_generic(&x1,&cinit,1); + s1 = gold_generic(&x1,&cinit,0); i=0; for (m=0; m>3) ^ (*x2>>2) + (*x2>>1) + *x2 - *x2 = *x2 ^ ((*x2 ^ (*x2>>1) ^ (*x2>>2) ^ (*x2>>3))<<31); - - // x1 and x2 contain bits n = 0,1,...,31 - - // Nc = 1600 bits are skipped at the beginning - // i.e., 1600 / 32 = 50 32bit words - - for (n = 1; n < 50; n++) - { - // Compute x1(0),...,x1(27) - *x1 = (*x1>>1) ^ (*x1>>4); - // Compute x1(28),..,x1(31) and xor - *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); - // Compute x2(0),...,x2(27) - *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); - // Compute x2(28),..,x2(31) and xor - *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); - } - } - - *x1 = (*x1>>1) ^ (*x1>>4); - *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); - *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); - *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); - - // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 - return(*x1^*x2); -} - - /**@}*/ #endif diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 8b71450d48..e0208e8435 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -405,7 +405,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB, else harq_pid = subframe2harq_pid(frame_parms,proc->frame_rx,subframe); - // x1 is set in lte_gold_generic + // x1 is set in gold_generic uint32_t x2 = ((uint32_t)ulsch->rnti << 14) + ((uint32_t)subframe << 9) + frame_parms->Nid_cell; // this is c_init in 36.211 Sec 6.3.1 LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dci_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/dci_ue.c index 909d3e96d1..32aa367fd6 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dci_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dci_ue.c @@ -1199,13 +1199,13 @@ void pdcch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, uint32_t x1 = 0, x2 = 0, s = 0; reset = 1; - // x1 is set in first call to lte_gold_generic + // x1 is set in first call to gold_generic x2 = (subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.8.2 for (i=0; iNid_cell; //this is c_init in 36.211 Sec 6.6.1 // msg("pbch_unscrambling: Nid_cell = %d\n",x2); for (i=0; iNid_cell+(1<<9); //this is c_init for FeMBMS in 36.211 Sec 6.6.1 //msg("pbch_unscrambling: Nid_cell = %d, x2 = %d, frame_mod4 %d length %d\n",frame_parms->Nid_cell,x2,frame_mod4,length); for (i=0; iNid_cell)+1)*(1+subframe))<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.7.1 for (uint32_t i=0; i<32; i++) { if ((i&0x1f)==0) { - s = lte_gold_generic(&x1, &x2, reset); + s = gold_generic(&x1, &x2, reset); //printf("lte_gold[%d]=%x\n",i,s); reset = 0; } diff --git a/openair1/PHY/LTE_UE_TRANSPORT/phich_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/phich_ue.c index b3c7673088..c922f32908 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/phich_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/phich_ue.c @@ -111,10 +111,10 @@ void rx_phich(PHY_VARS_UE *ue, memset(d,0,24*sizeof(int8_t)); phich_d_ptr = phich_d; - // x1 is set in lte_gold_generic + // x1 is set in gold_generic x2 = (((subframe+1)*((frame_parms->Nid_cell<<1)+1))<<9) + frame_parms->Nid_cell; - s = lte_gold_generic(&x1, &x2, reset); + s = gold_generic(&x1, &x2, reset); // compute scrambling sequence for (i=0; i<12; i++) { diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c index 2b856b63bb..dfece3a4a0 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c @@ -321,7 +321,7 @@ static inline void pucch2x_scrambling(LTE_DL_FRAME_PARMS *fp,int subframe,uint16 uint8_t c; x2 = (rnti) + ((uint32_t)(1+subframe)<<16)*(1+(fp->Nid_cell<<1)); //this is c_init in 36.211 Sec 6.3.1 - s = lte_gold_generic(&x1, &x2, 1); + s = gold_generic(&x1, &x2, 1); for (i=0;i<19;i++) { c = (uint8_t)((s>>i)&1); btilde[i] = (((B>>i)&1) ^ c); @@ -632,8 +632,8 @@ void generate_pucch3x(int32_t **txdataF, // Scrambling cinit = (subframe + 1) * ((2 * frame_parms->Nid_cell + 1)<<16) + rnti; - s0 = lte_gold_generic(&x1,&cinit,1); - s1 = lte_gold_generic(&x1,&cinit,0); + s0 = gold_generic(&x1,&cinit,1); + s1 = gold_generic(&x1,&cinit,0); for (i=0; i<48; i++) { s = (i<32)? s0:s1; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h index af1546a43e..210373ad74 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h +++ b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h @@ -8,6 +8,7 @@ #ifndef __LTE_TRANSPORT_PROTO_UE__H__ #define __LTE_TRANSPORT_PROTO_UE__H__ #include "PHY/defs_UE.h" +#include "PHY/defs_eNB.h" #include "PHY/LTE_TRANSPORT/transport_common_proto.h" #include #include "nfapi_interface.h" diff --git a/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c b/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c index c4ef20c98e..ae9ea15a26 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c @@ -164,7 +164,7 @@ void ulsch_modulation(int32_t **txdataF, return; } - // x1 is set in lte_gold_generic + // x1 is set in gold_generic x2 = (ulsch->rnti<<14) + (subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1 if (harq_pid>=8) { @@ -203,7 +203,7 @@ void ulsch_modulation(int32_t **txdataF, // scrambling (Note the placeholding bits are handled in ulsch_coding.c directly!) //printf("ulsch bits: "); - s = lte_gold_generic(&x1, &x2, 1); + s = gold_generic(&x1, &x2, 1); k=0; //printf("G %d\n",G); @@ -224,7 +224,7 @@ void ulsch_modulation(int32_t **txdataF, } - s = lte_gold_generic(&x1, &x2, 0); + s = gold_generic(&x1, &x2, 0); } //printf("\n"); diff --git a/openair1/PHY/MODULATION/modulation_common.h b/openair1/PHY/MODULATION/modulation_common.h index 956e546931..b0b6172175 100644 --- a/openair1/PHY/MODULATION/modulation_common.h +++ b/openair1/PHY/MODULATION/modulation_common.h @@ -10,6 +10,14 @@ * @{ */ +/*! \brief Extension Type */ +typedef enum { + CYCLIC_PREFIX, + CYCLIC_SUFFIX, + ZEROS, + NONE +} Extension_t; + /** \fn void PHY_ofdm_mod(int *input,int *output,int fftsize,unsigned char nb_symbols,unsigned short nb_prefix_samples,Extension_t etype) This function performs OFDM modulation with cyclic extension or zero-padding diff --git a/openair1/PHY/MODULATION/nr_modulation.c b/openair1/PHY/MODULATION/nr_modulation.c index 79e86edc02..e3afd9b93f 100644 --- a/openair1/PHY/MODULATION/nr_modulation.c +++ b/openair1/PHY/MODULATION/nr_modulation.c @@ -454,9 +454,9 @@ void nr_layer_mapping(int nbCodes, tx0++; *(uint32_t *)tx1 = vgetq_lane_u32(d4, 1); tx1++; - *(uint32_t *)tx2 = vgetq_lane_u32(d4, 0); + *(uint32_t *)tx2 = vgetq_lane_u32(d4, 2); tx2++; - *(uint32_t *)tx3 = vgetq_lane_u32(d4, 1); + *(uint32_t *)tx3 = vgetq_lane_u32(d4, 3); tx3++; } #endif diff --git a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c index 88f87326df..a901f8dba1 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c +++ b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c @@ -6,7 +6,6 @@ * \brief gNB measurement routines */ -#include "PHY/types.h" #include "PHY/defs_gNB.h" #include "nr_ul_estimation.h" diff --git a/openair1/PHY/NR_REFSIG/dmrs_nr.c b/openair1/PHY/NR_REFSIG/dmrs_nr.c index 32deaf440e..0e8246cce1 100644 --- a/openair1/PHY/NR_REFSIG/dmrs_nr.c +++ b/openair1/PHY/NR_REFSIG/dmrs_nr.c @@ -15,6 +15,7 @@ #include "PHY/NR_REFSIG/ss_pbch_nr.h" #include "PHY/NR_REFSIG/dmrs_nr.h" +#include "log.h" #include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h" uint8_t allowed_xlsch_re_in_dmrs_symbol(uint16_t k, @@ -154,88 +155,6 @@ void pseudo_random_sequence_optimised(unsigned int size, uint32_t *c, uint32_t c } } -/******************************************************************* -* -* NAME : lte_gold_new -* -* PARAMETERS : -* -* RETURN : generate pseudo-random sequence which is a length-31 Gold sequence -* -* DESCRIPTION : This function is the same as "lte_gold" function in file lte_gold.c -* It allows checking that optimization works fine. -* generated sequence is given in an array as a bit map. -* -*********************************************************************/ - -#define CELL_DMRS_LENGTH (224*2) -#define CHECK_GOLD_SEQUENCE - -void lte_gold_new(LTE_DL_FRAME_PARMS *frame_parms, uint32_t lte_gold_table[20][2][14], uint16_t Nid_cell) -{ - unsigned char ns,l,Ncp=1-frame_parms->Ncp; - uint32_t cinit; - -#ifdef CHECK_GOLD_SEQUENCE - - uint32_t dmrs_bitmap[20][2][14]; - uint32_t *dmrs_sequence = calloc(CELL_DMRS_LENGTH, sizeof(uint32_t)); - if (dmrs_sequence == NULL) { - msg("Fatal error: memory allocation problem \n"); - assert(0); - } - else - { - printf("Check of demodulation reference signal of pbch sequence \n"); - } - -#endif - - /* for each slot number */ - for (ns=0; ns<20; ns++) { - - /* for each ofdm position */ - for (l=0; l<2; l++) { - - cinit = Ncp + - (Nid_cell<<1) + - (((1+(Nid_cell<<1))*(1 + (((frame_parms->Ncp==0)?4:3)*l) + (7*(1+ns))))<<10); - - pseudo_random_sequence_optimised(14, &(lte_gold_table[ns][l][0]), cinit); - -#ifdef CHECK_GOLD_SEQUENCE - - pseudo_random_sequence(CELL_DMRS_LENGTH, dmrs_sequence, cinit); - - int j = 0; - int k = 0; - - /* format for getting bitmap from uint32_t */ - for (int i=0; i<14; i++) { - dmrs_bitmap[ns][l][i] = 0; - for (; j < k + 32; j++) { - dmrs_bitmap[ns][l][i] |= (dmrs_sequence[j]<SL_UE_PHY_PARAMS.init_params.psbch_dmrs_gold_sequences[slss_id][n] = lte_gold_generic(&x1, &x2, reset); + UE->SL_UE_PHY_PARAMS.init_params.psbch_dmrs_gold_sequences[slss_id][n] = gold_generic(&x1, &x2, reset); reset = 0; #ifdef SL_DEBUG_INIT_DATA diff --git a/openair1/PHY/NR_REFSIG/pss_nr.h b/openair1/PHY/NR_REFSIG/pss_nr.h index 598ffbe9f4..39a9dd3a4e 100644 --- a/openair1/PHY/NR_REFSIG/pss_nr.h +++ b/openair1/PHY/NR_REFSIG/pss_nr.h @@ -16,7 +16,6 @@ #define PSS_NR_H #include "PHY/defs_nr_common.h" -#include "PHY/types.h" #include "PHY/NR_REFSIG/ss_pbch_nr.h" /************** CODE GENERATION ***********************************/ diff --git a/openair1/PHY/NR_REFSIG/refsig.c b/openair1/PHY/NR_REFSIG/refsig.c index b22dcb6c2f..418d6aa702 100644 --- a/openair1/PHY/NR_REFSIG/refsig.c +++ b/openair1/PHY/NR_REFSIG/refsig.c @@ -3,7 +3,7 @@ */ #include "nr_refsig.h" -#include "openair1/PHY/LTE_TRANSPORT/transport_proto.h" // for lte_gold_generic() +#include "openair1/PHY/gold.h" #define REFRESH_RATE (1000 * 100) @@ -141,9 +141,9 @@ uint32_t *gold_cache(uint32_t key, int length) *new = (gold_cache_t){.key = key, .length = length, .usage = 1}; unsigned int x1 = 0, x2 = key; uint32_t *sequence = firstFree + roundedHeaderSz; - *sequence++ = lte_gold_generic(&x1, &x2, 1); + *sequence++ = gold_generic(&x1, &x2, 1); for (int n = 1; n < length; n++) - *sequence++ = lte_gold_generic(&x1, &x2, 0); + *sequence++ = gold_generic(&x1, &x2, 0); LOG_D(PHY, "created a gold sequence, start %d; len %d\n", key, length); return firstFree + roundedHeaderSz; } diff --git a/openair1/PHY/NR_REFSIG/sss_nr.h b/openair1/PHY/NR_REFSIG/sss_nr.h index 3d095d4c88..9b8998c317 100644 --- a/openair1/PHY/NR_REFSIG/sss_nr.h +++ b/openair1/PHY/NR_REFSIG/sss_nr.h @@ -16,7 +16,6 @@ #define SSS_NR_H #include "limits.h" -#include "PHY/types.h" #include "pss_nr.h" /************** DEFINE ********************************************/ diff --git a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c index e5fdffbef4..890be591e0 100644 --- a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c +++ b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c @@ -17,6 +17,7 @@ #include #include #include "defs.h" +#include "log.h" #include "PHY/NR_REFSIG/ul_ref_seq_nr.h" diff --git a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h index 5d95525d21..5e19fb979f 100644 --- a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h +++ b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h @@ -16,10 +16,8 @@ #ifndef LOWPAPR_SEQUENCES_NR_H #define LOWPAPR_SEQUENCES_NR_H -#include "PHY/types.h" #include "PHY/NR_REFSIG/ss_pbch_nr.h" #include "PHY/defs_nr_common.h" -#include "PHY/defs_gNB.h" /************** DEFINE ********************************************/ #define U_GROUP_NUMBER (30) /* maximum number of sequence-group */ diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.h b/openair1/PHY/NR_TRANSPORT/nr_dci.h index d0865d52f9..2d291667b8 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.h @@ -14,15 +14,11 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, NR_DL_FRAME_PARMS *frame_parms, int slot); -int16_t find_nr_pdcch(int frame,int slot, PHY_VARS_gNB *gNB,find_type_t type); - void nr_fill_dci(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu); -int16_t find_nr_ul_dci(int frame,int slot, PHY_VARS_gNB *gNB,find_type_t type); - void nr_fill_ul_dci(PHY_VARS_gNB *gNB, int frame, int slot, diff --git a/openair1/PHY/NR_TRANSPORT/nr_prach.c b/openair1/PHY/NR_TRANSPORT/nr_prach.c index 5aaa5f0291..c54c9ccc29 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_prach.c +++ b/openair1/PHY/NR_TRANSPORT/nr_prach.c @@ -27,7 +27,7 @@ void free_nr_prach_entry(prach_list_t *l, prach_item_t *p) pthread_mutex_unlock(&l->prach_list_mutex); } -prach_item_t *find_nr_prach(prach_list_t *l, int frame, int slot, int nb_rx, find_type_t type) +prach_item_t *find_nr_prach(prach_list_t *l, int frame, int slot, int nb_rx, nr_find_type_t type) { pthread_mutex_lock(&l->prach_list_mutex); AssertFatal(nb_rx, "Error! Number of antennas set to 0.\n"); @@ -37,7 +37,7 @@ prach_item_t *find_nr_prach(prach_list_t *l, int frame, int slot, int nb_rx, fin if ((*p) && (*p)->frame == frame && ((*p)->slot + (*p)->num_slots - 1) == slot) break; if (p == end) { - if (type == SEARCH_EXIST) { + if (type == NR_SEARCH_EXIST) { pthread_mutex_unlock(&l->prach_list_mutex); return NULL; } @@ -67,7 +67,7 @@ prach_item_t *find_nr_prach(prach_list_t *l, int frame, int slot, int nb_rx, fin prach_item_t *nr_schedule_rx_prach(PHY_VARS_gNB *gNB, int SFN, int Slot, nfapi_nr_prach_pdu_t *prach_pdu) { - prach_item_t *prach = find_nr_prach(&gNB->prach_list, SFN, Slot, gNB->frame_parms.nb_antennas_rx, SEARCH_EXIST_OR_FREE); + prach_item_t *prach = find_nr_prach(&gNB->prach_list, SFN, Slot, gNB->frame_parms.nb_antennas_rx, NR_SEARCH_EXIST_OR_FREE); if (!prach) { LOG_W(PHY, "no free space for a new detected rach, discarding\n"); return NULL; diff --git a/openair1/PHY/NR_TRANSPORT/nr_tbs_tools.c b/openair1/PHY/NR_TRANSPORT/nr_tbs_tools.c index 6bf2dd81b2..2fb70932d7 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_tbs_tools.c +++ b/openair1/PHY/NR_TRANSPORT/nr_tbs_tools.c @@ -9,6 +9,7 @@ #include "nr_transport_common_proto.h" #include "PHY/CODING/coding_defs.h" #include "PHY/defs_nr_common.h" +#include "log.h" uint32_t nr_get_G(uint16_t nb_rb, uint16_t nb_symb_sch, uint8_t nb_re_dmrs, uint16_t length_dmrs, uint32_t unav_res, uint8_t Qm, uint8_t Nl) diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h index 61d8df03b8..9f0dc43e8d 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h +++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h @@ -178,7 +178,12 @@ rx_prach_out_t rx_nr_prach(const prach_item_t *, int occasion); void rx_nr_prach_ru(prach_item_t *, int32_t **, NR_DL_FRAME_PARMS *frame_parms, int N_TA_offset); -prach_item_t *find_nr_prach(prach_list_t *, int frame, int slot, int nb_rx, find_type_t type); +typedef enum { + NR_SEARCH_EXIST = 0, + NR_SEARCH_EXIST_OR_FREE +} nr_find_type_t; + +prach_item_t *find_nr_prach(prach_list_t *, int frame, int slot, int nb_rx, nr_find_type_t type); void nr_fill_pucch(PHY_VARS_gNB *gNB, int frame, int slot, diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c index 4674800eb6..27d0a25b0f 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c @@ -5,7 +5,6 @@ #include "PHY/defs_gNB.h" #include "PHY/phy_extern.h" #include "nr_transport_proto.h" -#include "PHY/impl_defs_top.h" #include "PHY/NR_TRANSPORT/nr_sch_dmrs.h" #include "PHY/NR_REFSIG/dmrs_nr.h" #include "PHY/NR_REFSIG/ptrs_nr.h" diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_gain.c b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_gain.c index de25e5c7ea..e64f74a291 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_gain.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_gain.c @@ -2,11 +2,9 @@ * SPDX-License-Identifier: LicenseRef-CSSL-1.0 */ -#include "PHY/types.h" #include "PHY/defs_nr_UE.h" -void -phy_adjust_gain_nr (PHY_VARS_NR_UE *ue, uint32_t rx_power_fil_dB, uint8_t eNB_id) +void phy_adjust_gain_nr(PHY_VARS_NR_UE *ue, uint32_t rx_power_fil_dB, uint8_t eNB_id) { LOG_D(PHY,"Gain control: rssi %d (%d,%d)\n", diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c index 9a45ab52de..5b526ed65c 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c @@ -2,11 +2,8 @@ * SPDX-License-Identifier: LicenseRef-CSSL-1.0 */ -#include "PHY/types.h" #include "PHY/defs_nr_UE.h" #include "PHY/NR_UE_ESTIMATION/nr_estimation.h" -#include "PHY/impl_defs_top.h" - #include "executables/nr-uesoftmodem.h" //#define DEBUG_PHY diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index bda26b0d52..b2e3c276dc 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -1393,7 +1393,7 @@ void nr_pdsch_ptrs_processing(int nbRx, uint16_t *nb_rb = NULL; int nscid = 0; - if(dlsch0_harq->status == ACTIVE) { + if(dlsch0_harq->status == NR_ACTIVE) { symbInSlot = dlsch[0].dlsch_config.start_symbol + dlsch[0].dlsch_config.number_symbols; startSymbIndex = &dlsch[0].dlsch_config.start_symbol; nbSymb = &dlsch[0].dlsch_config.number_symbols; @@ -1437,7 +1437,7 @@ void nr_pdsch_ptrs_processing(int nbRx, phase_per_symbol[symbol].r = 0; // Real } - if(dlsch0_harq->status == ACTIVE) { + if(dlsch0_harq->status == NR_ACTIVE) { if(symbol == *startSymbIndex) { *ptrsSymbPos = 0; set_ptrs_symb_idx(ptrsSymbPos, diff --git a/openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.h b/openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.h index e4f32eb160..25a8f6ff81 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.h +++ b/openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.h @@ -17,7 +17,6 @@ #define CIC_FILTER_NR_H #include "PHY/defs_nr_UE.h" -#include "PHY/types.h" /************** DEFINE ********************************************/ diff --git a/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c b/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c index 3914837795..e2f1356692 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c +++ b/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c @@ -290,9 +290,10 @@ static int nr_csi_rs_channel_estimation( // loop over frequency resource elements within a group for (int kp = 0; kp <= csi_mapping->kprime; kp++) { - - uint16_t kinit = (fp->first_carrier_offset + rb*NR_NB_SC_PER_RB) % fp->ofdm_symbol_size; - uint16_t k = kinit + csi_mapping->koverline[cdm_id] + kp; + uint16_t kinit_rx = (fp->first_carrier_offset + rb * NR_NB_SC_PER_RB) % fp->ofdm_symbol_size; + uint16_t k_rx = kinit_rx + csi_mapping->koverline[cdm_id] + kp; + uint16_t kinit_tx = rb * NR_NB_SC_PER_RB; + uint16_t k_tx = kinit_tx + csi_mapping->koverline[cdm_id] + kp; // loop over time resource elements within a group for (int lp = 0; lp <= csi_mapping->lprime; lp++) { @@ -300,11 +301,12 @@ static int nr_csi_rs_channel_estimation( uint64_t symbol_offset = symb * fp->ofdm_symbol_size; const c16_t *tx_csi_rs_signal = &csi_rs_generated_signal[port_tx][symbol_offset]; const c16_t *rx_csi_rs_signal = &csi_rs_received_signal[ant_rx][symbol_offset]; - c16_t tmp = c16MulConjShift(tx_csi_rs_signal[k], rx_csi_rs_signal[k], nr_csi_info->csi_rs_generated_signal_bits); + c16_t tmp = + c16MulConjShift(tx_csi_rs_signal[k_tx], rx_csi_rs_signal[k_rx], nr_csi_info->csi_rs_generated_signal_bits); // This is not just the LS estimation for each (k,l), but also the sum of the different contributions // for the sake of optimizing the memory used. - csi_rs_ls_estimated_channel[ant_rx][port_tx][kinit].r += tmp.r; - csi_rs_ls_estimated_channel[ant_rx][port_tx][kinit].i += tmp.i; + csi_rs_ls_estimated_channel[ant_rx][port_tx][kinit_rx].r += tmp.r; + csi_rs_ls_estimated_channel[ant_rx][port_tx][kinit_rx].i += tmp.i; } } } @@ -576,10 +578,6 @@ int nr_csi_rs_pmi_estimation(const PHY_VARS_NR_UE *ue, // The first column is applicable if the UE is reporting a Rank = 1, whereas the second column is applicable if the // UE is reporting a Rank = 2. - if (interference_plus_noise_power == 0) { - return 0; - } - if (N_ports == 1) { // SISO case: SINR = E[|h|^2] / noise_power. No PMI to estimate. int64_t signal_power = 0; @@ -599,7 +597,8 @@ int nr_csi_rs_pmi_estimation(const PHY_VARS_NR_UE *ue, if (count > 0) { const int64_t avg_signal_power = signal_power / count; - const uint32_t sinr = avg_signal_power / interference_plus_noise_power; + // Non RF devices like ZMQ has virtually zero noise. So here we make noise as 1 to return maximum sinr. + const uint32_t sinr = avg_signal_power / ((interference_plus_noise_power == 0) ? 1 : interference_plus_noise_power); *precoded_sinr_dB = dB_fixed(sinr); } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index dcbf382c98..90e66cfb19 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -293,7 +293,7 @@ void nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, if (harq_process->decodeResult) { LOG_D(PHY, "DLSCH received ok \n"); - harq_process->status = SCH_IDLE; + harq_process->status = NR_SCH_IDLE; dlsch->last_iteration_cnt = dlsch->max_ldpc_iterations - 1; } else { LOG_D(PHY, "DLSCH received nok \n"); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index b7de100b57..bcae6e011b 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -994,7 +994,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, dlsch0_harq->status, dlsch1_harq->status); - if ((dlsch0_harq->status == ACTIVE) && (dlsch1_harq->status == ACTIVE)){ + if ((dlsch0_harq->status == NR_ACTIVE) && (dlsch1_harq->status == NR_ACTIVE)){ codeword_TB0 = dlsch0_harq->codeword; // SV: where is this set? revisit for DL MIMO. codeword_TB1 = dlsch1_harq->codeword; dlsch0_harq = &ue->dl_harq_processes[codeword_TB0][harq_pid]; @@ -1002,14 +1002,14 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, DEBUG_HARQ("[DEMOD] I am assuming both TBs are active, in cw0 %d and cw1 %d \n", codeword_TB0, codeword_TB1); - } else if ((dlsch0_harq->status == ACTIVE) && (dlsch1_harq->status != ACTIVE) ) { + } else if ((dlsch0_harq->status == NR_ACTIVE) && (dlsch1_harq->status != NR_ACTIVE) ) { codeword_TB0 = dlsch0_harq->codeword; dlsch0_harq = &ue->dl_harq_processes[codeword_TB0][harq_pid]; dlsch1_harq = NULL; DEBUG_HARQ("[DEMOD] I am assuming only TB0 is active, in cw %d \n", codeword_TB0); - } else if ((dlsch0_harq->status != ACTIVE) && (dlsch1_harq->status == ACTIVE)){ + } else if ((dlsch0_harq->status != NR_ACTIVE) && (dlsch1_harq->status == NR_ACTIVE)){ codeword_TB1 = dlsch1_harq->codeword; dlsch0_harq = NULL; dlsch1_harq = &ue->dl_harq_processes[codeword_TB1][harq_pid]; @@ -1023,7 +1023,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, return (-1); } } else if (dlsch0_harq) { - if (dlsch0_harq->status == ACTIVE) { + if (dlsch0_harq->status == NR_ACTIVE) { codeword_TB0 = dlsch0_harq->codeword; dlsch0_harq = &ue->dl_harq_processes[0][harq_pid]; DEBUG_HARQ("[DEMOD] I am assuming only TB0 is active\n"); @@ -1310,7 +1310,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, int nbSymb = 0; int pduBitmap = 0; - if(dlsch0_harq->status == ACTIVE) { + if(dlsch0_harq->status == NR_ACTIVE) { startSymbIdx = dlsch_config->start_symbol; nbSymb = dlsch_config->number_symbols; pduBitmap = dlsch_config->pduBitmap; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 87ab4abc57..5091b2c35d 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -5,7 +5,6 @@ /*! * \brief Routines for initial UE synchronization procedure (PSS,SSS,PBCH and frame format detection) */ -#include "PHY/types.h" #include "PHY/defs_nr_UE.h" #include "PHY/MODULATION/modulation_UE.h" #include "nr_transport_proto_ue.h" diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_psbch_tx.c b/openair1/PHY/NR_UE_TRANSPORT/nr_psbch_tx.c index f649d62a4b..6504b06c9a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_psbch_tx.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_psbch_tx.c @@ -7,6 +7,7 @@ #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" #include "PHY/CODING/nrPolar_tools/nr_polar_psbch_defs.h" #include "PHY/MODULATION/nr_modulation.h" +#include "PHY/gold.h" // #define SL_DEBUG @@ -19,7 +20,7 @@ void sl_psbch_scrambling(uint32_t *output, uint32_t id, uint16_t length) { uint32_t x1, x2, s = 0; - // x1 is set in lte_gold_generic + // x1 is set in gold_generic x2 = id; // C_INIT #ifdef SL_DEBUG @@ -29,7 +30,7 @@ void sl_psbch_scrambling(uint32_t *output, uint32_t id, uint16_t length) #endif // get initial 32 scrambing bits - s = lte_gold_generic(&x1, &x2, 1); + s = gold_generic(&x1, &x2, 1); #ifdef SL_DEBUG printf("s: %04x\t", s); #endif @@ -40,7 +41,7 @@ void sl_psbch_scrambling(uint32_t *output, uint32_t id, uint16_t length) output[i >> 5] ^= s; i += 32; - s = lte_gold_generic(&x1, &x2, 0); + s = gold_generic(&x1, &x2, 0); #ifdef SL_DEBUG printf("s: %04x\t", s); #endif diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h index 157b5efd46..32d03c1010 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -11,8 +11,6 @@ #include "SCHED_NR_UE/defs.h" #include "PHY/NR_TRANSPORT/nr_transport_common_proto.h" #include -#include "nfapi_interface.h" -#include #define NR_PUSCH_x 2 // UCI placeholder bit TS 38.212 V15.4.0 subclause 5.3.3.1 #define NR_PUSCH_y 3 // UCI placeholder bit diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h index 8d55da9d39..c57d0c74ce 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h @@ -8,8 +8,6 @@ #ifndef __NR_TRANSPORT_UE__H__ #define __NR_TRANSPORT_UE__H__ #include -#include "PHY/impl_defs_top.h" - #include "PHY/CODING/nrLDPC_decoder/nrLDPC_types.h" #include "nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h" #include "../NR_TRANSPORT/nr_transport_common_proto.h" @@ -54,8 +52,13 @@ typedef struct { uint32_t Z; } NR_UL_UE_HARQ_t; +typedef enum { + NR_SCH_IDLE = 0, + NR_ACTIVE +} NR_SCH_status_t; + typedef struct { - SCH_status_t status; + NR_SCH_status_t status; /// NDAPI struct for UE nfapi_nr_ue_pusch_pdu_t pusch_pdu; // UL number of harq processes @@ -72,7 +75,7 @@ typedef struct { /// Indicator of first reception uint8_t first_rx; /// DLSCH status flag indicating - SCH_status_t status; + NR_SCH_status_t status; /// Pointer to the payload (38.212 V15.4.0 section 5.1) uint8_t *b; /// Pointers to transport block segments diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index b985f10f92..df691ea362 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -5,7 +5,6 @@ /*! \file PHY/NR_UE_TRANSPORT/nr_ulsch_coding_slot.c */ -#include "PHY/defs_UE.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" #include "PHY/CODING/coding_defs.h" #include "PHY/CODING/coding_extern.h" diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 4806a48bda..8abd67c231 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -1075,7 +1075,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, int harq_pid = phy_data->ulsch.pusch_pdu.pusch_data.harq_process_id; - if (phy_data->ulsch.status != ACTIVE) + if (phy_data->ulsch.status != NR_ACTIVE) return; start_meas_nr_ue_phy(UE, PUSCH_PROC_STATS); diff --git a/openair1/PHY/TOOLS/calibration_scope.c b/openair1/PHY/TOOLS/calibration_scope.c index 64452fd67a..0839e40c49 100644 --- a/openair1/PHY/TOOLS/calibration_scope.c +++ b/openair1/PHY/TOOLS/calibration_scope.c @@ -3,7 +3,9 @@ */ #include -#include +#include "common/utils/system.h" +#include "common/utils/utils.h" +#include "common/utils/LOG/log.h" #include "executables/softmodem-common.h" #include "executables/nr-softmodem-common.h" #include diff --git a/openair1/PHY/TOOLS/calibration_test.c b/openair1/PHY/TOOLS/calibration_test.c index 6301f496d5..48aa5cc082 100644 --- a/openair1/PHY/TOOLS/calibration_test.c +++ b/openair1/PHY/TOOLS/calibration_test.c @@ -3,11 +3,12 @@ */ #include -#include +#include "openair1/PHY/defs_common.h" #include #include #include #include "nfapi/oai_integration/vendor_ext.h" +#include "common/config/config_userapi.h" int oai_exit=false; diff --git a/openair1/PHY/TOOLS/tests/CMakeLists.txt b/openair1/PHY/TOOLS/tests/CMakeLists.txt index 3326ef0c8d..bd77e00c6a 100644 --- a/openair1/PHY/TOOLS/tests/CMakeLists.txt +++ b/openair1/PHY/TOOLS/tests/CMakeLists.txt @@ -42,18 +42,38 @@ add_dependencies(tests test_sse_intrinsics) add_test(NAME test_sse_intrinsics COMMAND ./test_sse_intrinsics) +add_executable(benchmark_channel_pipeline benchmark_channel_pipeline.cpp test_channel_pipeline_tools.c) +target_link_libraries(benchmark_channel_pipeline PRIVATE UTIL SIMU PHY_COMMON LOG CONFIG_LIB shlib_loader m channel_pipeline benchmark::benchmark thread-pool) + +add_executable(test_channel_pipeline test_channel_pipeline.cpp test_channel_pipeline_tools.c) +target_link_libraries(test_channel_pipeline PRIVATE UTIL SIMU PHY_COMMON LOG CONFIG_LIB shlib_loader m channel_pipeline GTest::gtest thread-pool) + +if (CUDA_ENABLE) + target_compile_definitions(test_channel_pipeline PRIVATE CUDA_ENABLE) + add_dependencies(tests test_channel_pipeline) + add_test(NAME test_channel_pipeline COMMAND test_channel_pipeline) + set_tests_properties(test_channel_pipeline PROPERTIES LABELS "cuda") + + target_compile_definitions(benchmark_channel_pipeline PRIVATE CUDA_ENABLE) + add_dependencies(tests benchmark_channel_pipeline) + add_test(NAME benchmark_channel_pipeline COMMAND benchmark_channel_pipeline) + set_tests_properties(benchmark_channel_pipeline PROPERTIES LABELS "cuda") +endif() + if(CUDA_ENABLE) add_executable(test_multipath test_multipath.c) target_link_libraries(test_multipath PRIVATE UTIL SIMU LOG CONFIG_LIB shlib_loader m oai_cuda_lib) add_dependencies(tests test_multipath) add_test(NAME test_multipath COMMAND test_multipath) +set_tests_properties(test_multipath PROPERTIES LABELS "cuda") add_executable(test_noise test_noise.c) target_link_libraries(test_noise PRIVATE UTIL SIMU PHY_COMMON LOG CONFIG_LIB shlib_loader m oai_cuda_lib) add_dependencies(tests test_noise) add_test(NAME test_noise COMMAND test_noise) +set_tests_properties(test_noise PROPERTIES LABELS "cuda") add_executable(test_channel_simulation test_channel_simulation.c) target_link_libraries(test_channel_simulation PRIVATE UTIL SIMU PHY_COMMON LOG CONFIG_LIB shlib_loader m oai_cuda_lib) diff --git a/openair1/PHY/TOOLS/tests/benchmark_channel_pipeline.cpp b/openair1/PHY/TOOLS/tests/benchmark_channel_pipeline.cpp new file mode 100644 index 0000000000..681955aaa6 --- /dev/null +++ b/openair1/PHY/TOOLS/tests/benchmark_channel_pipeline.cpp @@ -0,0 +1,239 @@ +/* + * SPDX-License-Identifier: LicenseRef-CSSL-1.0 + */ + +#include +#include +#include +#include +#include +#include +#include "oai_cuda.h" +#include "common/config/config_userapi.h" +#include +#include "benchmark/benchmark.h" +#include "test_channel_pipeline_tools.h" +#include "channel_pipeline.h" +extern "C" { +#include "openair1/SIMULATION/TOOLS/sim.h" +} +configmodule_interface_t *uniqCfg = NULL; + +extern "C" void exit_function(const char *file, const char *function, const int line, const char *s, const int assert) +{ + fprintf(stderr, "FATAL: %s at %s:%s:%d\n", s, file, function, line); + exit(EXIT_FAILURE); +} + +#ifdef CUDA_ENABLE +static void BM_channel_convolution_gpu(benchmark::State &state) +{ + int nb_rx = state.range(0); + int nb_tx = state.range(1); + int num_samples = state.range(2); + int channel_length = 16; + + size_t num_input_samples = num_samples + channel_length - 1; + std::vector input(nb_tx); + for (int i = 0; i < nb_tx; ++i) { + input[i] = new c16_t[num_input_samples]; + } + + std::vector output(nb_rx); + for (int i = 0; i < nb_rx; ++i) { + output[i] = new c16_t[num_samples]; + } + + std::vector channel(nb_rx * nb_tx); + for (int i = 0; i < nb_rx * nb_tx; ++i) { + channel[i] = new cf_t[channel_length]; + } + + for (int i = 0; i < nb_rx * nb_tx; ++i) { + generate_random_signal_float(channel[i], channel_length); + } + + void *gpu_context = cuda_channel_pipeline_init(61440 * 4); + + for (int aatx = 0; aatx < nb_tx; aatx++) { + generate_random_signal(input[aatx], num_input_samples); + } + + size_t total_samples = 0; + for (auto _ : state) { + cuda_channel_pipeline(gpu_context, + (const cf_t **)channel.data(), + (const c16_t **)input.data(), + nullptr, + num_input_samples, + output.data(), + nullptr, + num_samples, + num_samples, + channel_length, + nb_tx, + nb_rx, + 0.0f); + total_samples += num_samples; + } + state.counters["MSPS"] = benchmark::Counter(total_samples / 1000000.f, benchmark::Counter::kIsRate); + + cuda_channel_pipeline_shutdown(gpu_context); +} +#endif + +static void BM_channel_convolution_cpu(benchmark::State &state) +{ + int nb_rx = state.range(0); + int nb_tx = state.range(1); + int num_samples = state.range(2); + int channel_length = 16; + + size_t num_input_samples = num_samples + channel_length - 1; + std::vector input(nb_tx); + for (int i = 0; i < nb_tx; ++i) { + input[i] = new c16_t[num_input_samples]; + } + + std::vector output(nb_rx); + for (int i = 0; i < nb_rx; ++i) { + output[i] = new c16_t[num_samples]; + } + + std::vector channel(nb_rx * nb_tx); + for (int i = 0; i < nb_rx * nb_tx; ++i) { + channel[i] = new cf_t[channel_length]; + } + + for (int i = 0; i < nb_rx * nb_tx; ++i) { + generate_random_signal_float(channel[i], channel_length); + } + for (int aatx = 0; aatx < nb_tx; aatx++) { + generate_random_signal(input[aatx], num_input_samples); + } + + size_t total_samples = 0; + for (auto _ : state) { + channel_convolution_cpu((const cf_t **)channel.data(), + (const c16_t **)input.data(), + nullptr, + num_input_samples, + output.data(), + nullptr, + num_samples, + num_samples, + channel_length, + nb_tx, + nb_rx); + total_samples += num_samples; + } + state.counters["MSPS"] = benchmark::Counter(total_samples / 1000000.0f, benchmark::Counter::kIsRate); + + for (int i = 0; i < nb_tx; ++i) + delete[] input[i]; + for (int i = 0; i < nb_rx * nb_tx; ++i) + delete[] channel[i]; + for (int i = 0; i < nb_rx; ++i) { + delete[] output[i]; + } +} + +static void BM_channel_convolution_tpool(benchmark::State &state) +{ + int nb_rx = state.range(0); + int nb_tx = state.range(1); + int num_samples = state.range(2); + int channel_length = 16; + + size_t num_input_samples = num_samples + channel_length - 1; + std::vector input(nb_tx); + for (int i = 0; i < nb_tx; ++i) { + input[i] = new c16_t[num_input_samples]; + } + + std::vector output(nb_rx); + for (int i = 0; i < nb_rx; ++i) { + output[i] = new c16_t[num_samples]; + } + + std::vector channel(nb_rx * nb_tx); + for (int i = 0; i < nb_rx * nb_tx; ++i) { + channel[i] = new cf_t[channel_length]; + } + + for (int i = 0; i < nb_rx * nb_tx; ++i) { + generate_random_signal_float(channel[i], channel_length); + } + for (int aatx = 0; aatx < nb_tx; aatx++) { + generate_random_signal(input[aatx], num_input_samples); + } + + void *tpool = init_tpool(16); + channel_pipeline_init(0.0f); + + size_t total_samples = 0; + for (auto _ : state) { + channel_pipeline(tpool, + (const cf_t **)channel.data(), + (const c16_t **)input.data(), + nullptr, + num_input_samples, + output.data(), + nullptr, + num_samples, + num_samples, + channel_length, + nb_tx, + nb_rx, + 0.0f); + total_samples += num_samples; + } + state.counters["MSPS"] = benchmark::Counter(total_samples / 1000000.f, benchmark::Counter::kIsRate); + + channel_pipeline_shutdown(); + + destroy_tpool(tpool); + + for (int i = 0; i < nb_tx; ++i) + delete[] input[i]; + for (int i = 0; i < nb_rx * nb_tx; ++i) + delete[] channel[i]; + for (int i = 0; i < nb_rx; ++i) { + delete[] output[i]; + } +} + +#ifdef CUDA_ENABLE +BENCHMARK(BM_channel_convolution_gpu) + ->ArgsProduct({ + {1, 2, 4, 16, 64}, // nb_rx + {1, 2, 4, 16, 64}, // nb_tx + {61440}, // num_samples + }) + ->Iterations(100); +#endif + +BENCHMARK(BM_channel_convolution_cpu) + ->ArgsProduct({ + {1, 2, 4}, // nb_rx + {1, 2, 4}, // nb_tx + {61440}, // num_samples + }) + ->Iterations(50); + +BENCHMARK(BM_channel_convolution_tpool) + ->ArgsProduct({ + {1, 2, 4, 8, 16}, // nb_rx + {1, 2, 4, 8, 16}, // nb_tx + {61440}, // num_samples + }) + ->Iterations(50); + +int main(int argc, char **argv) +{ + logInit(); + randominit(); + benchmark::Initialize(&argc, argv); + benchmark::RunSpecifiedBenchmarks(); + return 0; +} diff --git a/openair1/PHY/TOOLS/tests/test_channel_pipeline.cpp b/openair1/PHY/TOOLS/tests/test_channel_pipeline.cpp new file mode 100644 index 0000000000..e4b8d2cdf9 --- /dev/null +++ b/openair1/PHY/TOOLS/tests/test_channel_pipeline.cpp @@ -0,0 +1,277 @@ +/* + * SPDX-License-Identifier: LicenseRef-CSSL-1.0 + */ + +#include +#include +#include +#include +#include +#include "oai_cuda.h" +#include "test_channel_pipeline_tools.h" +#include "channel_pipeline.h" + +extern "C" { +#include "openair1/SIMULATION/TOOLS/sim.h" +} +configmodule_interface_t *uniqCfg = NULL; + +extern "C" void exit_function(const char *file, const char *function, const int line, const char *s, const int assert) +{ + fprintf(stderr, "FATAL: %s at %s:%s:%d\n", s, file, function, line); + exit(EXIT_FAILURE); +} + +class ChannelConvolutionTest : public ::testing::TestWithParam> { + protected: + void SetUp() override + { +#ifdef CUDA_ENABLE + gpu_context = cuda_channel_pipeline_init(614400 * 4); +#endif + tpool = init_tpool(8); + channel_pipeline_init(0.0f); + } + + void TearDown() override + { +#ifdef CUDA_ENABLE + cuda_channel_pipeline_shutdown(gpu_context); +#endif + destroy_tpool(tpool); + channel_pipeline_shutdown(); + } + + void *gpu_context = nullptr; + void *tpool = nullptr; +}; + +#ifdef CUDA_ENABLE +TEST_P(ChannelConvolutionTest, CompareCpuGpu) +{ + int nb_rx = std::get<0>(GetParam()); + int nb_tx = std::get<1>(GetParam()); + int num_samples = std::get<2>(GetParam()); + int channel_length = 16; + + // The input buffer must be padded at the beginning to handle the convolution history. + size_t num_input_samples = num_samples + channel_length - 1; + + std::vector input(nb_tx); + for (int i = 0; i < nb_tx; ++i) { + input[i] = new c16_t[num_input_samples]; + generate_random_signal(input[i], num_input_samples); + } + + std::vector channel(nb_rx * nb_tx); + for (int i = 0; i < nb_rx * nb_tx; ++i) { + channel[i] = new cf_t[channel_length]; + generate_random_signal_float(channel[i], channel_length); + } + + std::vector output_cpu(nb_rx); + std::vector output_gpu(nb_rx); + for (int i = 0; i < nb_rx; ++i) { + output_cpu[i] = new c16_t[num_samples]; + output_gpu[i] = new c16_t[num_samples]; + memset(output_cpu[i], 0, num_samples * sizeof(c16_t)); + memset(output_gpu[i], 0, num_samples * sizeof(c16_t)); + } + + // Run CPU implementation + channel_convolution_cpu((const cf_t **)channel.data(), + (const c16_t **)input.data(), + nullptr, + num_input_samples, + output_cpu.data(), + nullptr, + num_samples, + num_samples, + channel_length, + nb_tx, + nb_rx); + + // Run GPU implementation + cuda_channel_pipeline(gpu_context, + (const cf_t **)channel.data(), + (const c16_t **)input.data(), + nullptr, + num_input_samples, + output_gpu.data(), + nullptr, + num_samples, + num_samples, + channel_length, + nb_tx, + nb_rx, + 0.0f); + + // Compare results + for (int r = 0; r < nb_rx; ++r) { + for (int i = 0; i < num_samples; ++i) { + EXPECT_LE(std::abs(output_cpu[r][i].r - output_gpu[r][i].r), 1) << "Real part mismatch at rx=" << r << " sample=" << i; + EXPECT_LE(std::abs(output_cpu[r][i].i - output_gpu[r][i].i), 1) << "Imag part mismatch at rx=" << r << " sample=" << i; + } + } + + // Cleanup + for (int i = 0; i < nb_tx; ++i) + delete[] input[i]; + for (int i = 0; i < nb_rx * nb_tx; ++i) + delete[] channel[i]; + for (int i = 0; i < nb_rx; ++i) { + delete[] output_cpu[i]; + delete[] output_gpu[i]; + } +} +#endif + +TEST_P(ChannelConvolutionTest, CompareCpuTpool) +{ + int nb_rx = std::get<0>(GetParam()); + int nb_tx = std::get<1>(GetParam()); + int num_samples = std::get<2>(GetParam()); + int channel_length = 16; + + // The input buffer must be padded at the beginning to handle the convolution history. + size_t num_input_samples = num_samples + channel_length - 1; + + size_t num_input_samples_input0 = num_input_samples; + size_t num_input_samples_input1 = 0; + if (num_samples > 5000) { + num_input_samples_input1 = 5000; + num_input_samples_input0 = num_input_samples - num_input_samples_input1; + } + std::vector input(nb_tx); + for (int i = 0; i < nb_tx; ++i) { + input[i] = new c16_t[num_input_samples_input0]; + generate_random_signal(input[i], num_input_samples_input0); + } + std::vector input2(nb_tx); + if (num_input_samples_input1 > 0) { + for (int i = 0; i < nb_tx; i++) { + input2[i] = new c16_t[num_input_samples_input1]; + generate_random_signal(input2[i], num_input_samples_input1); + } + } + + std::vector channel(nb_rx * nb_tx); + for (int i = 0; i < nb_rx * nb_tx; ++i) { + channel[i] = new cf_t[channel_length]; + generate_random_signal_float(channel[i], channel_length); + } + + std::vector output_cpu(nb_rx); + std::vector output_cpu2(nb_rx); + std::vector output_tpool(nb_rx); + std::vector output_tpool2(nb_rx); + + size_t num_output_samples_output_0 = num_samples; + size_t num_output_samples_output_1 = 0; + if (num_samples > 10000) { + num_output_samples_output_1 = 10000; + num_output_samples_output_0 = num_samples - num_output_samples_output_1; + } + + for (int i = 0; i < nb_rx; ++i) { + output_cpu[i] = new c16_t[num_output_samples_output_0]; + output_tpool[i] = new c16_t[num_output_samples_output_0]; + memset(output_cpu[i], 0, num_output_samples_output_0 * sizeof(c16_t)); + memset(output_tpool[i], 0, num_output_samples_output_0 * sizeof(c16_t)); + } + + if (num_output_samples_output_1 > 0) { + for (int i = 0; i < nb_rx; ++i) { + output_cpu2[i] = new c16_t[num_output_samples_output_1]; + output_tpool2[i] = new c16_t[num_output_samples_output_1]; + memset(output_cpu2[i], 0, num_output_samples_output_1 * sizeof(c16_t)); + memset(output_tpool2[i], 0, num_output_samples_output_1 * sizeof(c16_t)); + } + } + + // Run CPU implementation + channel_convolution_cpu((const cf_t **)channel.data(), + (const c16_t **)input.data(), + num_input_samples_input1 > 0 ? (const c16_t **)input2.data() : nullptr, + num_input_samples_input0, + output_cpu.data(), + num_output_samples_output_1 > 0 ? output_cpu2.data() : nullptr, + num_output_samples_output_0, + num_samples, + channel_length, + nb_tx, + nb_rx); + + // Run tpool implementation + channel_pipeline(tpool, + (const cf_t **)channel.data(), + (const c16_t **)input.data(), + num_input_samples_input1 > 0 ? (const c16_t **)input2.data() : nullptr, + num_input_samples_input0, + output_tpool.data(), + num_output_samples_output_1 > 0 ? output_tpool2.data() : nullptr, + num_output_samples_output_0, + num_samples, + channel_length, + nb_tx, + nb_rx, + 0.0f); + + // Compare results + for (int r = 0; r < nb_rx; ++r) { + for (uint i = 0; i < num_output_samples_output_0; ++i) { + EXPECT_LE(std::abs(output_cpu[r][i].r - output_tpool[r][i].r), 1) << "Real part mismatch at rx=" << r << " sample=" << i; + EXPECT_LE(std::abs(output_cpu[r][i].i - output_tpool[r][i].i), 1) << "Imag part mismatch at rx=" << r << " sample=" << i; + } + } + + if (num_output_samples_output_1 > 0) { + for (int r = 0; r < nb_rx; ++r) { + for (uint i = 0; i < num_output_samples_output_1; ++i) { + EXPECT_LE(std::abs(output_cpu2[r][i].r - output_tpool2[r][i].r), 1) << "Real part mismatch at rx=" << r << " sample=" << i; + EXPECT_LE(std::abs(output_cpu2[r][i].i - output_tpool2[r][i].i), 1) << "Imag part mismatch at rx=" << r << " sample=" << i; + } + } + } + + // Cleanup + for (int i = 0; i < nb_tx; ++i) + delete[] input[i]; + if (num_input_samples_input1 > 0) + for (int i = 0; i < nb_tx; i++) + delete[] input2[i]; + for (int i = 0; i < nb_rx * nb_tx; ++i) + delete[] channel[i]; + for (int i = 0; i < nb_rx; ++i) { + delete[] output_cpu[i]; + delete[] output_tpool[i]; + } + if (num_output_samples_output_1 > 0) { + for (int i = 0; i < nb_rx; ++i) { + delete[] output_cpu2[i]; + delete[] output_tpool2[i]; + } + } +} + +INSTANTIATE_TEST_SUITE_P(ChannelConvolutionTests, + ChannelConvolutionTest, + ::testing::Combine(::testing::Values(1, 2, 4), + ::testing::Values(1, 2, 4), + ::testing::Values(100, 1024, 6000, 614400)), + [](const ::testing::TestParamInfo &info) { + int rx = std::get<0>(info.param); + int tx = std::get<1>(info.param); + int samples = std::get<2>(info.param); + std::ostringstream name; + name << "Rx" << rx << "_Tx" << tx << "_Samples" << samples; + return name.str(); + }); + +int main(int argc, char **argv) +{ + logInit(); + randominit(); + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/openair1/PHY/TOOLS/tests/test_channel_pipeline_tools.c b/openair1/PHY/TOOLS/tests/test_channel_pipeline_tools.c new file mode 100644 index 0000000000..34e7af3fae --- /dev/null +++ b/openair1/PHY/TOOLS/tests/test_channel_pipeline_tools.c @@ -0,0 +1,84 @@ +/* + * SPDX-License-Identifier: LicenseRef-CSSL-1.0 + */ + +#include +#include "test_channel_pipeline_tools.h" +#include "channel_pipeline.h" +#include "thread-pool.h" + +void *init_tpool(int num_threads) +{ + tpool_t *tpool = malloc(sizeof(*tpool)); + initFloatingCoresTpool(num_threads, tpool, false, NULL); + return tpool; +} + +void destroy_tpool(void *tpool) +{ + abortTpool((tpool_t *)tpool); + free(tpool); +} + +void channel_convolution_cpu(const cf_t **channel, + const c16_t **tx_sig0, + const c16_t **tx_sig1, + int num_samples_tx_sig0, + c16_t **rx_sig0, + c16_t **rx_sig1, + int num_samples_rx_sig0, + int num_samples, + int channel_length, + int nb_tx, + int nb_rx) +{ + for (int rx_ant = 0; rx_ant < nb_rx; rx_ant++) { + for (int i = 0; i < num_samples; i++) { + float rx_r = 0.0f; + float rx_i = 0.0f; + + for (int tx_ant = 0; tx_ant < nb_tx; tx_ant++) { + for (int l = 0; l < channel_length; l++) { + int idx = i + (channel_length - 1) - l; + c16_t in_sample; + if (idx < num_samples_tx_sig0) { + in_sample = tx_sig0[tx_ant][idx]; + } else { + in_sample = tx_sig1[tx_ant][idx - num_samples_tx_sig0]; + } + cf_t tx_sample = {(float)in_sample.r, (float)in_sample.i}; + + int chan_idx = tx_ant + nb_tx * rx_ant; + cf_t ch = channel[chan_idx][l]; + + rx_r += tx_sample.r * ch.r - tx_sample.i * ch.i; + rx_i += tx_sample.r * ch.i + tx_sample.i * ch.r; + } + } + + if (i < num_samples_rx_sig0) { + rx_sig0[rx_ant][i].r = (int16_t)rx_r; + rx_sig0[rx_ant][i].i = (int16_t)rx_i; + } else { + rx_sig1[rx_ant][i - num_samples_rx_sig0].r = (int16_t)rx_r; + rx_sig1[rx_ant][i - num_samples_rx_sig0].i = (int16_t)rx_i; + } + } + } +} + +void generate_random_signal(c16_t *sig, int num_samples) +{ + for (int i = 0; i < num_samples; i++) { + sig[i].r = (rand() % 2000) - 1000; + sig[i].i = (rand() % 2000) - 1000; + } +} + +void generate_random_signal_float(cf_t *sig, int num_samples) +{ + for (int i = 0; i < num_samples; i++) { + sig[i].r = (rand() % 2000) - 1000; + sig[i].i = (rand() % 2000) - 1000; + } +} diff --git a/openair1/PHY/TOOLS/tests/test_channel_pipeline_tools.h b/openair1/PHY/TOOLS/tests/test_channel_pipeline_tools.h new file mode 100644 index 0000000000..9057c6582e --- /dev/null +++ b/openair1/PHY/TOOLS/tests/test_channel_pipeline_tools.h @@ -0,0 +1,31 @@ +/* + * SPDX-License-Identifier: LicenseRef-CSSL-1.0 + */ + +#pragma once +#include "common/platform_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void channel_convolution_cpu(const cf_t **channel, + const c16_t **tx_sig0, + const c16_t **tx_sig1, + int num_samples_tx_sig0, + c16_t **rx_sig0, + c16_t **rx_sig1, + int num_samples_rx_sig0, + int num_samples, + int channel_length, + int nb_tx, + int nb_rx); + +void generate_random_signal(c16_t *sig, int num_samples); +void generate_random_signal_float(cf_t *sig, int num_samples); +void *init_tpool(int num_threads); +void destroy_tpool(void *tpool); + +#ifdef __cplusplus +} +#endif diff --git a/openair1/PHY/defs_L1_NB_IoT.h b/openair1/PHY/defs_L1_NB_IoT.h index 1b663c101f..f07cb4a3d4 100644 --- a/openair1/PHY/defs_L1_NB_IoT.h +++ b/openair1/PHY/defs_L1_NB_IoT.h @@ -22,6 +22,7 @@ //#include #include "assertions.h" #include "common/utils/LOG/log.h" +#include "common/cmake_defs.h" #define msg(aRGS...) LOG_D(PHY, ##aRGS) //use msg in the real-time thread context #define msg_nrt printf diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h index dbdcf8693d..06c96f7f0e 100644 --- a/openair1/PHY/defs_RU.h +++ b/openair1/PHY/defs_RU.h @@ -17,6 +17,7 @@ #include "nfapi_nr_interface_scf.h" #include "common/utils/threadPool/task_ans.h" #include "common/utils/threadPool/thread-pool.h" +#include "common/utils/threadPool/notified_fifo.h" #define MAX_BANDS_PER_RRU 4 #define MAX_RRU_CONFIG_SIZE 1024 @@ -34,14 +35,6 @@ typedef enum { rx_dump_frame=7, } runmode_t; -/*! \brief Extension Type */ -typedef enum { - CYCLIC_PREFIX, - CYCLIC_SUFFIX, - ZEROS, - NONE -} Extension_t; - enum transmission_access_mode { NO_ACCESS=0, POSTPONED_ACCESS, @@ -569,7 +562,7 @@ typedef struct RU_t_s { /// beamforming weight vectors int32_t **beam_weights[NUMBER_OF_eNB_MAX+1][15]; /// received frequency-domain signal for PRACH (IF4p5 RRU) - int16_t **prach_rxsigF[NUMBER_OF_NR_RU_PRACH_OCCASIONS_MAX]; + int16_t **prach_rxsigF[12]; /// received frequency-domain signal for PRACH BR (IF4p5 RRU) int16_t **prach_rxsigF_br[4]; /// sequence number for IF5 diff --git a/openair1/PHY/defs_UE.h b/openair1/PHY/defs_UE.h index c90a592305..ab092dc173 100644 --- a/openair1/PHY/defs_UE.h +++ b/openair1/PHY/defs_UE.h @@ -42,6 +42,7 @@ #include "common/platform_types.h" #include "PHY/LTE_UE_TRANSPORT/transport_ue.h" #include "PHY/LTE_TRANSPORT/transport_eNB.h" // for SIC +#include "PHY/defs_RU.h" #include #include "assertions.h" diff --git a/openair1/PHY/defs_common.h b/openair1/PHY/defs_common.h index c362becaae..482fe0c857 100644 --- a/openair1/PHY/defs_common.h +++ b/openair1/PHY/defs_common.h @@ -33,7 +33,6 @@ #include #include "assertions.h" -//#include #include "time_meas.h" #include "common/platform_types.h" #include "softmodem-common.h" @@ -42,7 +41,7 @@ #include #include "TOOLS/tools_defs.h" - +#include "PHY/CODING/coding_defs.h" #include "common/openairinterface5g_limits.h" #include "common/utils/LOG/log.h" @@ -965,39 +964,6 @@ extern int sync_var; #define MBSFN_FDD_SF7 0x08 #define MBSFN_FDD_SF8 0x04 -#define NUMBER_OF_NR_RU_PRACH_OCCASIONS_MAX 12 - -typedef struct { - pthread_mutex_t mutex_failure; - bool failed; -} decode_abort_t; - -static inline void init_abort(decode_abort_t *ab) -{ - int ret = pthread_mutex_init(&ab->mutex_failure, NULL); - AssertFatal(ret == 0, "mutex failed with %d\n", ret); - ab->failed = false; -} - -static inline bool check_abort(decode_abort_t *ab) -{ - int ret = pthread_mutex_lock(&ab->mutex_failure); - AssertFatal(ret == 0, "mutex failed with %d\n", ret); - bool failed = ab->failed; - ret = pthread_mutex_unlock(&ab->mutex_failure); - AssertFatal(ret == 0, "mutex failed with %d\n", ret); - return failed; -} - -static inline void set_abort(decode_abort_t *ab, bool v) -{ - int ret = pthread_mutex_lock(&ab->mutex_failure); - AssertFatal(ret == 0, "mutex failed with %d\n", ret); - ab->failed = v; - ret = pthread_mutex_unlock(&ab->mutex_failure); - AssertFatal(ret == 0, "mutex failed with %d\n", ret); -} - typedef uint8_t(decoder_if_t)(int16_t *y, int16_t *y2, uint8_t *decoded_bytes, diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index e0cd78509e..b9d4992d32 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -13,17 +13,46 @@ #include "defs_nr_common.h" #include "CODING/nrPolar_tools/nr_polar_pbch_defs.h" #include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h" -#include "PHY/impl_defs_top.h" #include "PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h" #include "PHY/CODING/nrLDPC_extern.h" #include "PHY/CODING/nrLDPC_decoder/nrLDPC_types.h" #include "nfapi_nr_interface_scf.h" +#include "common/utils/threadPool/task_ans.h" +#include "openair1/PHY/defs_RU.h" #define MAX_NUM_RU_PER_gNB 8 #define MAX_PUCCH0_NID 8 #define NR_SRS_IDFT_OVERSAMP_FACTOR 2 #define NR_SRS_DETECTION_THRESHOLD 10 +#define NUMBER_OF_NR_PRACH_MAX 8 +typedef struct { + int frame; + int slot; + int num_slots; // prach duration in slots + int beams[NFAPI_MAX_NUM_BG_IF]; + nfapi_nr_prach_pdu_t pdu; + int rootSequenceIndex; + int numrootSequenceIndex; + int msg1_frequencystart; + int mu; + int prach_sequence_length; + int restricted_set; + int numerology_index; + int nb_rx; + c16_t (*Xu)[839]; + time_stats_t *rx_prach; + c16_t (*prach_buf)[NUMBER_OF_NR_RU_PRACH_OCCASIONS_MAX][NR_PRACH_SEQ_LEN_L]; +} prach_item_t; + +typedef struct { + /// prach commands + prach_item_t *list[NUMBER_OF_NR_PRACH_MAX]; + /// mutex for prach_list access + pthread_mutex_t prach_list_mutex; +} prach_list_t; +void init_prach_list(prach_list_t *); + typedef struct { int nb_id; int Nid[MAX_PUCCH0_NID]; @@ -329,8 +358,6 @@ typedef struct PHY_VARS_gNB_s { gNB_L1_proc_t proc; int num_RU; RU_t *RU_list[MAX_NUM_RU_PER_gNB]; - /// Ethernet parameters for northbound midhaul interface - eth_params_t eth_params_n; /// Ethernet parameters for fronthaul interface eth_params_t eth_params; int rx_total_gain_dB; diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 385fef3a8e..a61cb30b95 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -19,7 +19,7 @@ #include "CODING/nrPolar_tools/nr_polar_pbch_defs.h" #include "PHY/defs_nr_sl_UE.h" #include "openair1/PHY/nr_phy_common/inc/nr_ue_phy_meas.h" - +#include "common/utils/threadPool/task_ans.h" #include #include #include @@ -59,7 +59,6 @@ // (0 + 0 * 20) % 512 = 0 #define NUM_PROCESS_SLOT_TX_BARRIERS 512 -#include "impl_defs_top.h" #include "impl_defs_nr.h" #include "time_meas.h" #include "PHY/CODING/coding_defs.h" @@ -67,6 +66,7 @@ #include "PHY/TOOLS/tools_defs.h" #include "common/platform_types.h" #include "NR_UE_TRANSPORT/nr_transport_ue.h" +#include "openair1/PHY/defs_common.h" #if defined(UPGRADE_RAT_NR) #include "PHY/NR_REFSIG/ss_pbch_nr.h" @@ -338,8 +338,8 @@ typedef struct PHY_VARS_NR_UE_s { NR_UE_PRACH *prach_vars[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_PRS *prs_vars[NR_MAX_PRS_COMB_SIZE]; uint8_t prs_active_gNBs; - NR_DL_UE_HARQ_t dl_harq_processes[2][NR_MAX_DLSCH_HARQ_PROCESSES]; - NR_UL_UE_HARQ_t ul_harq_processes[NR_MAX_ULSCH_HARQ_PROCESSES]; + NR_DL_UE_HARQ_t dl_harq_processes[2][NR_MAX_HARQ_PROCESSES]; + NR_UL_UE_HARQ_t ul_harq_processes[NR_MAX_HARQ_PROCESSES]; // Scrambling IDs used in PUSCH DMRS c16_t X_u[64][839]; diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index 44d19045f7..7cd439bcee 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -12,7 +12,7 @@ #include "PHY/impl_defs_top.h" #include "impl_defs_nr.h" #include "PHY/CODING/nrPolar_tools/nr_polar_defs.h" - +#include "radio/COMMON/common_lib.h" #include #define MAX_NUM_SUBCARRIER_SPACING 5 @@ -41,15 +41,11 @@ #define NR_MAX_PDCCH_AGG_LEVEL 16 // 3GPP TS 38.211 V15.8 Section 7.3.2 Table 7.3.2.1-1: Supported PDCCH aggregation levels -#define MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER 36 - -#define MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER 34 - #define MAX_NUM_NR_RE (4*14*273*12) #define MAX_NUM_NR_SRS_SYMBOLS 4 #define MAX_NUM_NR_SRS_AP 4 - +#define NUMBER_OF_NR_RU_PRACH_OCCASIONS_MAX 12 #define MAX_DELAY_COMP 20 @@ -102,34 +98,6 @@ typedef struct { int resource_type; } nr_srs_info_t; -#define NUMBER_OF_NR_PRACH_MAX 8 -typedef struct { - int frame; - int slot; - int num_slots; // prach duration in slots - int beams[NFAPI_MAX_NUM_BG_IF]; - nfapi_nr_prach_pdu_t pdu; - int rootSequenceIndex; - int numrootSequenceIndex; - int msg1_frequencystart; - int mu; - int prach_sequence_length; - int restricted_set; - int numerology_index; - int nb_rx; - c16_t (*Xu)[839]; - time_stats_t *rx_prach; - c16_t (*prach_buf)[NUMBER_OF_NR_RU_PRACH_OCCASIONS_MAX][NR_PRACH_SEQ_LEN_L]; -} prach_item_t; - -typedef struct { - /// prach commands - prach_item_t *list[NUMBER_OF_NR_PRACH_MAX]; - /// mutex for prach_list access - pthread_mutex_t prach_list_mutex; -} prach_list_t; -void init_prach_list(prach_list_t *); - typedef struct NR_DL_FRAME_PARMS_s { /// frequency range frequency_range_t freq_range; diff --git a/openair1/PHY/gold.h b/openair1/PHY/gold.h new file mode 100644 index 0000000000..fbaa580fe0 --- /dev/null +++ b/openair1/PHY/gold.h @@ -0,0 +1,46 @@ +/* + * SPDX-License-Identifier: LicenseRef-CSSL-1.0 + */ + +#ifndef __openair_GOLD_H__ +#define __openair_GOLD_H__ + +static inline uint32_t gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset) +{ + int32_t n; + // 3GPP 3x.211 + // Nc = 1600 + // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 + // x1(n+31) = [x1(n+3) + x1(n)]mod2 + // x2(n+31) = [x2(n+3) + x2(n+2) + x2(n+1) + x2(n)]mod2 + if (reset) { + // Init value for x1: x1(0) = 1, x1(n) = 0, n=1,2,...,30 + // x1(31) = [x1(3) + x1(0)]mod2 = 1 + *x1 = 1 + (1U << 31); + // Init value for x2: cinit = sum_{i=0}^30 x2*2^i + // x2(31) = [x2(3) + x2(2) + x2(1) + x2(0)]mod2 + // = (*x2>>3) ^ (*x2>>2) + (*x2>>1) + *x2 + *x2 = *x2 ^ ((*x2 ^ (*x2 >> 1) ^ (*x2 >> 2) ^ (*x2 >> 3)) << 31); + // x1 and x2 contain bits n = 0,1,...,31 + // Nc = 1600 bits are skipped at the beginning + // i.e., 1600 / 32 = 50 32bit words + for (n = 1; n < 50; n++) { + // Compute x1(0),...,x1(27) + *x1 = (*x1 >> 1) ^ (*x1 >> 4); + // Compute x1(28),..,x1(31) and xor + *x1 = *x1 ^ (*x1 << 31) ^ (*x1 << 28); + // Compute x2(0),...,x2(27) + *x2 = (*x2 >> 1) ^ (*x2 >> 2) ^ (*x2 >> 3) ^ (*x2 >> 4); + // Compute x2(28),..,x2(31) and xor + *x2 = *x2 ^ (*x2 << 31) ^ (*x2 << 30) ^ (*x2 << 29) ^ (*x2 << 28); + } + } + *x1 = (*x1 >> 1) ^ (*x1 >> 4); + *x1 = *x1 ^ (*x1 << 31) ^ (*x1 << 28); + *x2 = (*x2 >> 1) ^ (*x2 >> 2) ^ (*x2 >> 3) ^ (*x2 >> 4); + *x2 = *x2 ^ (*x2 << 31) ^ (*x2 << 30) ^ (*x2 << 29) ^ (*x2 << 28); + // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 + return(*x1 ^ *x2); +} + +#endif diff --git a/openair1/PHY/impl_defs_top.h b/openair1/PHY/impl_defs_top.h index 71faf25ac7..1af29b4ba5 100644 --- a/openair1/PHY/impl_defs_top.h +++ b/openair1/PHY/impl_defs_top.h @@ -86,7 +86,6 @@ #include #include -#include "defs_eNB.h" #include "types.h" /** @addtogroup _PHY_STRUCTURES_ @@ -205,17 +204,6 @@ #define AMP_OVER_SQRT2 ((AMP*ONE_OVER_SQRT2_Q15)>>15) #define AMP_OVER_2 (AMP>>1) -#define NB_NUMEROLOGIES_NR (5) -#define NR_MAX_SLOTS_PER_FRAME (160) /* number of slots per frame */ - -/* FFS_NR_TODO it defines ue capability which is the number of slots */ -/* - between reception of pdsch and transmission of its acknowlegment (k1) */ -/* - between reception of un uplink grant and its related transmission (k2) */ -#define NR_UE_CAPABILITY_SLOT_RX_TO_TX (3) - -#define NR_MAX_ULSCH_HARQ_PROCESSES (NR_MAX_HARQ_PROCESSES) /* cf 38.214 6.1 UE procedure for receiving the physical uplink shared channel */ -#define NR_MAX_DLSCH_HARQ_PROCESSES (NR_MAX_HARQ_PROCESSES) /* cf 38.214 5.1 UE procedure for receiving the physical downlink shared channel */ - /// Measurement Variables //#define NUMBER_OF_SUBBANDS_MAX 13 diff --git a/openair1/SCHED_NR/nr_prach_procedures.c b/openair1/SCHED_NR/nr_prach_procedures.c index 25acac547d..fcaf2f1c1b 100644 --- a/openair1/SCHED_NR/nr_prach_procedures.c +++ b/openair1/SCHED_NR/nr_prach_procedures.c @@ -27,7 +27,7 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_rac rach_ind->slot = slot; rach_ind->number_of_pdus = 0; - prach_item_t *prach_id = find_nr_prach(&gNB->prach_list, frame, slot, gNB->frame_parms.nb_antennas_rx, SEARCH_EXIST); + prach_item_t *prach_id = find_nr_prach(&gNB->prach_list, frame, slot, gNB->frame_parms.nb_antennas_rx, NR_SEARCH_EXIST); if (!prach_id) { return; } diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h index eb952035aa..0c2d2897c6 100644 --- a/openair1/SCHED_NR_UE/defs.h +++ b/openair1/SCHED_NR_UE/defs.h @@ -72,8 +72,6 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_ void processSlotTX(void *arg); -int8_t nr_find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB); - /*! \brief UL time alignment procedures for TA application @param ue @param slot_tx diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index a39927f4aa..4a521f5613 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -57,7 +57,7 @@ static void configure_dlsch(NR_UE_DLSCH_t *dlsch0, dlsch0_harq->DLround++; } downlink_harq_process(dlsch0_harq, current_harq_pid, dlsch_config_pdu->new_data_indicator, dlsch_config_pdu->rv, dlsch0->rnti_type); - if (dlsch0_harq->status != ACTIVE) { + if (dlsch0_harq->status != NR_ACTIVE) { // dlsch0_harq->status not ACTIVE due to false retransmission // Reset the following flag to skip PDSCH procedures in that case and retrasmit harq status dlsch0->active = false; @@ -305,7 +305,7 @@ static void nr_ue_scheduled_response_ul(PHY_VARS_NR_UE *phy, fapi_nr_ul_config_r pdu->pusch_config_pdu.tx_request_body.pdu_length); } - phy_data->ulsch.status = ACTIVE; + phy_data->ulsch.status = NR_ACTIVE; pdu->pdu_type = FAPI_NR_UL_CONFIG_TYPE_DONE; // not handle it any more } break; diff --git a/openair1/SCHED_NR_UE/harq_nr.c b/openair1/SCHED_NR_UE/harq_nr.c index 590ce42ec7..061e43d831 100644 --- a/openair1/SCHED_NR_UE/harq_nr.c +++ b/openair1/SCHED_NR_UE/harq_nr.c @@ -95,7 +95,7 @@ void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) { - dl_harq->status = SCH_IDLE; + dl_harq->status = NR_SCH_IDLE; dl_harq->first_rx = 1; dl_harq->DLround = 0; dl_harq->decodeResult = false; @@ -124,7 +124,7 @@ void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int dci_ndi, rnti_type == TYPE_P_RNTI_ || rnti_type == TYPE_RA_RNTI_) { dl_harq->DLround = 0; - dl_harq->status = ACTIVE; + dl_harq->status = NR_ACTIVE; dl_harq->first_rx = 1; } else { LOG_D(PHY, @@ -136,7 +136,7 @@ void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int dci_ndi, rnti_type, dci_ndi ? "yes" : "no"); AssertFatal(rv<4 && rv>=0, "invalid redondancy version %d\n", rv); - dl_harq->status = ACTIVE; + dl_harq->status = NR_ACTIVE; } } diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 0b853820f3..3d11c2af3b 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -836,8 +836,8 @@ static void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, uint8_t is_cw0_active = dl_harq0->status; uint8_t is_cw1_active = dl_harq1->status; int nb_dlsch = 0; - nb_dlsch += (is_cw0_active == ACTIVE) ? 1 : 0; - nb_dlsch += (is_cw1_active == ACTIVE) ? 1 : 0; + nb_dlsch += (is_cw0_active == NR_ACTIVE) ? 1 : 0; + nb_dlsch += (is_cw1_active == NR_ACTIVE) ? 1 : 0; uint16_t nb_symb_sch = dlsch[0].dlsch_config.number_symbols; uint8_t dmrs_type = dlsch[0].dlsch_config.dmrsConfigType; @@ -852,7 +852,7 @@ static void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_D(PHY, "AbsSubframe %d.%d Start LDPC Decoder for CW1 [harq_pid %d] ? %d \n", frame_rx % 1024, nr_slot_rx, harq_pid, is_cw1_active); // exit dlsch procedures as there are no active dlsch - if (is_cw0_active != ACTIVE && is_cw1_active != ACTIVE) { + if (is_cw0_active != ACTIVE && is_cw1_active != NR_ACTIVE) { // don't wait anymore LOG_E(NR_PHY, "Internal error nr_ue_dlsch_procedure() called but no active cw on slot %d, harq %d\n", nr_slot_rx, harq_pid); if (dlsch[0].dlsch_config.k1_feedback) { @@ -869,7 +869,7 @@ static void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, uint8_t *p_b[2] = {NULL}; for (uint8_t DLSCH_id = 0; DLSCH_id < 2; DLSCH_id++) { NR_DL_UE_HARQ_t *dl_harq = &ue->dl_harq_processes[DLSCH_id][harq_pid]; - if (dl_harq->status != ACTIVE) continue; + if (dl_harq->status != NR_ACTIVE) continue; DLSCH_ids[pdsch_id++] = DLSCH_id; fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config = &dlsch[DLSCH_id].dlsch_config; @@ -950,9 +950,9 @@ static void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, } uint32_t dlsch_bytes = a_segments * 1056; // allocated bytes per segment - if (ue->phy_sim_dlsch_b && is_cw0_active == ACTIVE) + if (ue->phy_sim_dlsch_b && is_cw0_active == NR_ACTIVE) memcpy(ue->phy_sim_dlsch_b, p_b[0], dlsch_bytes); - else if (ue->phy_sim_dlsch_b && is_cw1_active == ACTIVE) + else if (ue->phy_sim_dlsch_b && is_cw1_active == NR_ACTIVE) memcpy(ue->phy_sim_dlsch_b, p_b[1], dlsch_bytes); } diff --git a/openair1/SIMULATION/CMakeLists.txt b/openair1/SIMULATION/CMakeLists.txt index 8c9f720abd..9950c85508 100644 --- a/openair1/SIMULATION/CMakeLists.txt +++ b/openair1/SIMULATION/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LicenseRef-CSSL-1.0 +add_subdirectory(TOOLS) if(ENABLE_PHYSIM_TESTS) add_subdirectory(tests) - add_subdirectory(TOOLS) endif() diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 3299363c51..f07ad92ca9 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -406,7 +406,7 @@ int main(int argc, char **argv) exit(-1); } - nr_init_ul_harq_processes(UE->ul_harq_processes, NR_MAX_ULSCH_HARQ_PROCESSES, UE->frame_parms.N_RB_UL, UE->frame_parms.nb_antennas_tx); + nr_init_ul_harq_processes(UE->ul_harq_processes, NR_MAX_HARQ_PROCESSES, UE->frame_parms.N_RB_UL, UE->frame_parms.nb_antennas_tx); initFloatingCoresTpool(1, &nrUE_params.Tpool, false, "UE-tpool"); @@ -585,7 +585,7 @@ int main(int argc, char **argv) printf("\n"); } - free_nr_ue_ul_harq(UE->ul_harq_processes, NR_MAX_ULSCH_HARQ_PROCESSES, UE->frame_parms.N_RB_UL, UE->frame_parms.nb_antennas_tx); + free_nr_ue_ul_harq(UE->ul_harq_processes, NR_MAX_HARQ_PROCESSES, UE->frame_parms.N_RB_UL, UE->frame_parms.nb_antennas_tx); int nb_slots_to_set = (1 << mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME; for (int i = 0; i < nb_slots_to_set; ++i) diff --git a/openair1/SIMULATION/TOOLS/CMakeLists.txt b/openair1/SIMULATION/TOOLS/CMakeLists.txt index 587220c09f..4ea2d2373c 100644 --- a/openair1/SIMULATION/TOOLS/CMakeLists.txt +++ b/openair1/SIMULATION/TOOLS/CMakeLists.txt @@ -1,5 +1,18 @@ # SPDX-License-Identifier: LicenseRef-CSSL-1.0 +add_library(noise_device noise_device.c) +target_link_libraries(noise_device PRIVATE log_headers SIMU) +target_include_directories(noise_device PUBLIC ./) +set(CHANNEL_PIPELINE_SOURCES channel_pipeline.c) +if (CUDA_ENABLE) + list(APPEND CHANNEL_PIPELINE_SOURCES channel_pipeline_v2.cu) +endif() +add_library(channel_pipeline ${CHANNEL_PIPELINE_SOURCES}) +target_link_libraries(channel_pipeline PUBLIC thread-pool noise_device) +if (CUDA_ENABLE) + target_link_libraries(channel_pipeline PUBLIC CUDA::toolkit) +endif() + if(CUDA_ENABLE) add_library(oai_cuda_lib STATIC multipath_channel.cu @@ -12,4 +25,5 @@ if(CUDA_ENABLE) target_include_directories(oai_cuda_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) + target_link_libraries(channel_pipeline PUBLIC oai_cuda_lib) endif() diff --git a/openair1/SIMULATION/TOOLS/channel_pipeline.c b/openair1/SIMULATION/TOOLS/channel_pipeline.c new file mode 100644 index 0000000000..069222e2f4 --- /dev/null +++ b/openair1/SIMULATION/TOOLS/channel_pipeline.c @@ -0,0 +1,185 @@ +/* + * SPDX-License-Identifier: LicenseRef-CSSL-1.0 + */ + +#include +#include "utils.h" +#include "channel_pipeline.h" +#include "task_ans.h" +#include "noise_device.h" +#include "thread-pool.h" + +typedef struct { + const c16_t **tx_sig0; + const c16_t **tx_sig1; + int num_samples_tx_sig0; + int nb_tx; + int num_samples_rx_sig0; + int num_samples; + int channel_length; + int num_jobs; + task_ans_t *task_ans; + float noise_power; +} job_common_args_t; + +typedef struct { + job_common_args_t *common; + const cf_t **channel; + c16_t *rx_sig0; + c16_t *rx_sig1; + int job_index; +} job_args_t; + +void do_convolution_and_noise(int nb_tx, + int channel_length, + const cf_t **channel, + const c16_t **tx_sig0, + const c16_t **tx_sig1, + int num_samples_tx_sig0, + c16_t *rx_sig0, + c16_t *rx_sig1, + int num_samples_rx_sig0, + int num_samples, + int job_index, + int num_jobs, + float noise_power) +{ + const int batch_size = 4000; + cf_t work_buffer[batch_size] __attribute__((aligned(64))); + for (int batch_start = job_index * batch_size; batch_start < num_samples; batch_start += batch_size * num_jobs) { + int batch_end = min(batch_start + batch_size, num_samples); + if (noise_power > 0.0f) { + get_noise_vector((float *)work_buffer, batch_size * 2); + } + for (int i = batch_start; i < batch_end; i++) { + float rx_r = 0.0f; + float rx_i = 0.0f; + + for (int tx_ant = 0; tx_ant < nb_tx; tx_ant++) { + for (int l = 0; l < channel_length; l++) { + int idx = i + (channel_length - 1) - l; + c16_t in_sample; + if (idx < num_samples_tx_sig0) { + in_sample = tx_sig0[tx_ant][idx]; + } else { + in_sample = tx_sig1[tx_ant][idx - num_samples_tx_sig0]; + } + cf_t tx_sample = {(float)in_sample.r, (float)in_sample.i}; + cf_t ch = channel[tx_ant][l]; + + rx_r += tx_sample.r * ch.r - tx_sample.i * ch.i; + rx_i += tx_sample.r * ch.i + tx_sample.i * ch.r; + } + } + + if (noise_power > 0.0f) { + work_buffer[i - batch_start].r += rx_r; + work_buffer[i - batch_start].i += rx_i; + } else { + work_buffer[i - batch_start].r = rx_r; + work_buffer[i - batch_start].i = rx_i; + } + } + for (int i = batch_start; i < batch_end; i++) { + if (i < num_samples_rx_sig0) { + rx_sig0[i].r = work_buffer[i - batch_start].r; + rx_sig0[i].i = work_buffer[i - batch_start].i; + } else { + rx_sig1[i - num_samples_rx_sig0].r = work_buffer[i - batch_start].r; + rx_sig1[i - num_samples_rx_sig0].i = work_buffer[i - batch_start].i; + } + } + } +} + +void channel_job(void *args) +{ + job_args_t *job_args = (job_args_t *)args; + job_common_args_t *common = job_args->common; + do_convolution_and_noise(common->nb_tx, + common->channel_length, + job_args->channel, + common->tx_sig0, + common->tx_sig1, + common->num_samples_tx_sig0, + job_args->rx_sig0, + job_args->rx_sig1, + common->num_samples_rx_sig0, + common->num_samples, + job_args->job_index, + common->num_jobs, + common->noise_power); + completed_task_ans(common->task_ans); +} + +void channel_pipeline(void *tpool, + const cf_t **channel, + const c16_t **tx_sig0, + const c16_t **tx_sig1, + int num_samples_tx_sig0, + c16_t **rx_sig0, + c16_t **rx_sig1, + int num_samples_rx_sig0, + int num_samples, + int channel_length, + int nb_tx, + int nb_rx, + float noise_power) +{ + AssertFatal(nb_tx > 0, "nb_tx must be positive (%d)\n", nb_tx); + AssertFatal(nb_rx > 0, "nb_rx must be positive (%d)\n", nb_rx); + AssertFatal(nb_tx <= 64, "Number of TX antennas is too large (%d)\n", nb_tx); + AssertFatal(nb_rx <= 64, "Number of RX antennas is too large (%d)\n", nb_rx); + tpool_t *thread_pool = (tpool_t *)tpool; + size_t num_tpool_threads = thread_pool->len_thr; + job_common_args_t common_args; + common_args.tx_sig0 = tx_sig0; + if (tx_sig1) { + common_args.tx_sig1 = tx_sig1; + } else { + common_args.tx_sig1 = NULL; + } + + // At least 1 job per RX antenna. Attempt to saturate the threadpool + size_t num_jobs_per_rx_antenna = (num_tpool_threads + nb_rx - 1) / nb_rx; + + common_args.num_samples_tx_sig0 = num_samples_tx_sig0; + common_args.num_samples_rx_sig0 = num_samples_rx_sig0; + common_args.num_samples = num_samples; + common_args.channel_length = channel_length; + common_args.nb_tx = nb_tx; + common_args.num_jobs = num_jobs_per_rx_antenna; + common_args.noise_power = noise_power; + + task_ans_t task_ans; + init_task_ans(&task_ans, nb_rx * num_jobs_per_rx_antenna); + common_args.task_ans = &task_ans; + job_args_t job_args_array[nb_rx][num_jobs_per_rx_antenna]; + for (int aarx = 0; aarx < nb_rx; aarx++) { + for (int job_idx = 0; job_idx < num_jobs_per_rx_antenna; job_idx++) { + job_args_t *job_args = &job_args_array[aarx][job_idx]; + job_args->common = &common_args; + job_args->channel = &channel[nb_tx * aarx]; + job_args->rx_sig0 = rx_sig0[aarx]; + if (rx_sig1) { + job_args->rx_sig1 = rx_sig1[aarx]; + } else { + job_args->rx_sig1 = NULL; + } + job_args->job_index = job_idx; + task_t task; + task.args = job_args; + task.func = channel_job; + pushTpool(tpool, task); + } + } + join_task_ans(&task_ans); +} + +void channel_pipeline_init(float noise_power) { + init_noise_device(noise_power); +} + +void channel_pipeline_shutdown(void) { + free_noise_device(); +} diff --git a/openair1/SIMULATION/TOOLS/channel_pipeline.h b/openair1/SIMULATION/TOOLS/channel_pipeline.h new file mode 100644 index 0000000000..fc8d9e29c0 --- /dev/null +++ b/openair1/SIMULATION/TOOLS/channel_pipeline.h @@ -0,0 +1,49 @@ +/* + * SPDX-License-Identifier: LicenseRef-CSSL-1.0 + */ + +#ifndef _CHANNEL_CONVOLUTION_H_ +#define _CHANNEL_CONVOLUTION_H_ + +#ifdef __cplusplus +extern "C" { +#endif +#include "common/platform_types.h" + +#ifdef CUDA_ENABLE +void *cuda_channel_pipeline_init(int max_samples); +void cuda_channel_pipeline_shutdown(void *context_handle); +void cuda_channel_pipeline(void *context_handle, + const cf_t **channel, + const c16_t **tx_sig0, + const c16_t **tx_sig1, + int num_samples_tx_sig0, + c16_t **rx_sig0, + c16_t **rx_sig1, + int num_samples_rx_sig0, + int num_samples, + int channel_length, + int nb_tx, + int nb_rx, + float noise_power); +#endif +void channel_pipeline_init(float noise_power); +void channel_pipeline_shutdown(void); +void channel_pipeline(void *tpool, + const cf_t **channel, + const c16_t **tx_sig0, + const c16_t **tx_sig1, + int num_samples_tx_sig0, + c16_t **rx_sig0, + c16_t **rx_sig1, + int num_samples_rx_sig0, + int num_samples, + int channel_length, + int nb_tx, + int nb_rx, + float noise_power); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/openair1/SIMULATION/TOOLS/channel_pipeline_v2.cu b/openair1/SIMULATION/TOOLS/channel_pipeline_v2.cu new file mode 100644 index 0000000000..09fdcc1d5b --- /dev/null +++ b/openair1/SIMULATION/TOOLS/channel_pipeline_v2.cu @@ -0,0 +1,210 @@ +/* + * SPDX-License-Identifier: LicenseRef-CSSL-1.0 + */ + +#include "oai_cuda.h" +#include +#include +#include +#include "common/platform_types.h" +#include "common/utils/assertions.h" + +#define CHECK_CUDA(val) \ + { \ + if (val != cudaSuccess) { \ + fprintf(stderr, "CUDA Error at %s:%d: %s\n", __FILE__, __LINE__, cudaGetErrorString(val)); \ + exit(EXIT_FAILURE); \ + } \ + } + +__device__ __forceinline__ cf_t complex_mul(cf_t a, cf_t b) +{ + return cf_t{a.r * b.r - a.i * b.i, a.r * b.i + a.i * b.r}; +} + +__device__ __forceinline__ cf_t complex_add(cf_t a, cf_t b) +{ + return cf_t{a.r + b.r, a.i + b.i}; +} + +/** + * @brief CUDA kernel for performing multipath channel convolution and noise generation + * + * This kernel simulates the effect of a multipath channel by convolving the transmitted + * signal with the channel impulse response. It supports multiple transmit and receive + * antennas (MIMO). The input signal can be split across two buffers (tx_sig0 and tx_sig1), + * and the output is similarly written to two buffers (rx_sig0 and rx_sig1). + * + * @param channel Pointer to the channel impulse response coefficients for each link. + * @param tx_sig0 Pointer to the first part of the transmitted signal buffers. + * @param tx_sig1 Pointer to the second part of the transmitted signal buffers (optional). + * @param num_samples_tx_sig0 Number of samples in the first transmit buffer NOTE: The total input + samples provided to the kernel should be equal to num_samples + channel_length - 1. They + can be arbitrarily split between tx_sig0 and tx_sig1 via this parameter + * @param rx_sig0 Pointer to the first part of the received signal buffers. + * @param rx_sig1 Pointer to the second part of the received signal buffers (optional). + * @param num_samples_rx_sig0 Number of samples in the first receive buffer. NOTE: The total output + samples privided to the kernel should be equal to num_samples. They can be arbitrarily split + between rx_sig0 and rx_sig1 via this parameter + * @param num_samples Total number of output samples to compute. + * @param channel_length Number of taps in the multipath channel. + * @param nb_tx Number of transmit antennas. + * @param nb_rx Number of receive antennas. + */ +__global__ void channel_convolution_and_noise(const cf_t **__restrict__ channel, + const c16_t **__restrict__ tx_sig0, + const c16_t **__restrict__ tx_sig1, + int num_samples_tx_sig0, + c16_t **__restrict__ rx_sig0, + c16_t **__restrict__ rx_sig1, + int num_samples_rx_sig0, + int num_samples, + int channel_length, + int nb_tx, + int nb_rx, + float noise_power, + curandState_t *curand_states) +{ + extern __shared__ cf_t tx_sig[]; + const int i = blockIdx.x * blockDim.x + threadIdx.x; + const int rx_ant_idx = blockIdx.y; + const int padding_len = channel_length - 1; + + cf_t rx_tmp = cf_t{0.0f, 0.0f}; + + for (int aatx = 0; aatx < nb_tx; aatx++) { + const int tid = threadIdx.x; + const int block_start_idx = blockIdx.x * blockDim.x; + const int shared_mem_size = blockDim.x + padding_len; + + for (int k = tid; k < shared_mem_size; k += blockDim.x) { + int load_idx = block_start_idx + k; + if (load_idx < num_samples + padding_len) { + c16_t val; + if (load_idx < num_samples_tx_sig0) { + val = tx_sig0[aatx][load_idx]; + } else { + val = tx_sig1[aatx][load_idx - num_samples_tx_sig0]; + } + tx_sig[k] = cf_t{(float)val.r, (float)val.i}; + } else { + tx_sig[k] = cf_t{0.0f, 0.0f}; + } + } + __syncthreads(); + + if (i < num_samples) { + for (int l = 0; l < channel_length; l++) { + cf_t tx_sample = tx_sig[tid + (channel_length - 1) - l]; + int chan_link_idx = aatx + (rx_ant_idx * nb_tx); + cf_t chan_weight = channel[chan_link_idx][l]; + rx_tmp = complex_add(rx_tmp, complex_mul(tx_sample, chan_weight)); + } + } + __syncthreads(); + } + + if (i < num_samples) { + if (noise_power > 0.0f) { + curandState_t local_state = curand_states[rx_ant_idx * num_samples + i]; + float2 awgn = curand_normal2(&local_state); + if (i < num_samples_rx_sig0) { + rx_sig0[rx_ant_idx][i].r = rx_tmp.r + awgn.x * noise_power; + rx_sig0[rx_ant_idx][i].i = rx_tmp.i + awgn.y * noise_power; + } else { + rx_sig1[rx_ant_idx][i - num_samples_rx_sig0].r = rx_tmp.r + awgn.x * noise_power; + rx_sig1[rx_ant_idx][i - num_samples_rx_sig0].i = rx_tmp.i + awgn.y * noise_power; + } + curand_states[rx_ant_idx * num_samples + i] = local_state; + } else { + if (i < num_samples_rx_sig0) { + rx_sig0[rx_ant_idx][i].r = rx_tmp.r; + rx_sig0[rx_ant_idx][i].i = rx_tmp.i; + } else { + rx_sig1[rx_ant_idx][i - num_samples_rx_sig0].r = rx_tmp.r; + rx_sig1[rx_ant_idx][i - num_samples_rx_sig0].i = rx_tmp.i; + } + } + } +} + +struct GpuContext { + cudaStream_t stream; + curandState_t *curand_states; + size_t curand_states_size; +}; + +extern "C" void *cuda_channel_pipeline_init(int max_samples) +{ + GpuContext *ctx = new GpuContext(); + int dev = 0; + struct cudaDeviceProp prop; + CHECK_CUDA(cudaGetDeviceProperties(&prop, dev)); + int pageable; + int integrated; + cudaDeviceGetAttribute(&pageable, cudaDevAttrPageableMemoryAccess, dev); + cudaDeviceGetAttribute(&integrated, cudaDevAttrIntegrated,dev); + if (!(pageable)) { + return NULL; + } + CHECK_CUDA(cudaStreamCreate(&ctx->stream)); + ctx->curand_states = (curandState_t *)create_and_init_curand_states_cuda(max_samples, time(NULL)); + ctx->curand_states_size = max_samples; + return (void *)ctx; +} + +extern "C" void cuda_channel_pipeline_shutdown(void *context_handle) +{ + if (context_handle == nullptr) { + return; + } + GpuContext *ctx = (GpuContext *)context_handle; + CHECK_CUDA(cudaStreamDestroy(ctx->stream)); + destroy_curand_states_cuda((void *)ctx->curand_states); + delete ctx; +} + +extern "C" void cuda_channel_pipeline(void *context_handle, + const cf_t **channel, + const c16_t **tx_sig0, + const c16_t **tx_sig1, + int num_samples_tx_sig0, + c16_t **rx_sig0, + c16_t **rx_sig1, + int num_samples_rx_sig0, + int num_samples, + int channel_length, + int nb_tx, + int nb_rx, + float noise_power) +{ + AssertFatal(context_handle, "No context handle provided\n"); + AssertFatal(channel, "No channel provided\n"); + AssertFatal(tx_sig0, "No tx_sig0 provided\n"); + AssertFatal(num_samples_tx_sig0 == (num_samples + channel_length - 1) || tx_sig1, "No tx_sig1 provided\n"); + AssertFatal(rx_sig0, "No rx_sig0 provided\n"); + AssertFatal(num_samples_rx_sig0 == num_samples || rx_sig1, "No rx_sig1 provided\n"); + GpuContext *ctx = (GpuContext *)context_handle; + if (num_samples * nb_rx > ctx->curand_states_size) { + destroy_curand_states_cuda((void *)ctx->curand_states); + ctx->curand_states_size = num_samples * nb_rx; + ctx->curand_states = (curandState_t *)create_and_init_curand_states_cuda(ctx->curand_states_size, time(NULL)); + } + dim3 threadsPerBlock(512, 1); + dim3 numBlocks((num_samples + threadsPerBlock.x - 1) / threadsPerBlock.x, nb_rx); + size_t sharedMemSize = (threadsPerBlock.x + channel_length - 1) * sizeof(cf_t); + channel_convolution_and_noise<<stream>>>(channel, + tx_sig0, + tx_sig1, + num_samples_tx_sig0, + rx_sig0, + rx_sig1, + num_samples_rx_sig0, + num_samples, + channel_length, + nb_tx, + nb_rx, + noise_power, + ctx->curand_states); + CHECK_CUDA(cudaStreamSynchronize(ctx->stream)); +} diff --git a/openair1/SIMULATION/TOOLS/multipath_channel.cu b/openair1/SIMULATION/TOOLS/multipath_channel.cu index ec0e032b73..b8704c0da0 100644 --- a/openair1/SIMULATION/TOOLS/multipath_channel.cu +++ b/openair1/SIMULATION/TOOLS/multipath_channel.cu @@ -5,6 +5,7 @@ #include #include #include "oai_cuda.h" +#include "common/platform_types.h" #define CHECK_CUDA(val) checkCuda((val), #val, __FILE__, __LINE__) static void checkCuda(cudaError_t result, const char *const func, const char *const file, const int line) diff --git a/radio/vrtsim/noise_device.c b/openair1/SIMULATION/TOOLS/noise_device.c similarity index 100% rename from radio/vrtsim/noise_device.c rename to openair1/SIMULATION/TOOLS/noise_device.c diff --git a/radio/vrtsim/noise_device.h b/openair1/SIMULATION/TOOLS/noise_device.h similarity index 100% rename from radio/vrtsim/noise_device.h rename to openair1/SIMULATION/TOOLS/noise_device.h diff --git a/openair1/SIMULATION/TOOLS/oai_cuda.h b/openair1/SIMULATION/TOOLS/oai_cuda.h index 03d2ea15b8..3dfd79a067 100644 --- a/openair1/SIMULATION/TOOLS/oai_cuda.h +++ b/openair1/SIMULATION/TOOLS/oai_cuda.h @@ -8,10 +8,7 @@ #include #ifdef __NVCC__ -typedef struct complex16 { - int16_t r; - int16_t i; -} c16_t; +#include "common/platform_types.h" #else #include "PHY/TOOLS/tools_defs.h" #endif diff --git a/openair1/SIMULATION/tests/CMakeLists.txt b/openair1/SIMULATION/tests/CMakeLists.txt index bf342e448f..2235cd2771 100644 --- a/openair1/SIMULATION/tests/CMakeLists.txt +++ b/openair1/SIMULATION/tests/CMakeLists.txt @@ -42,6 +42,7 @@ function(add_physim_test test_name test_description test_exec) ENVIRONMENT "LD_LIBRARY_PATH=.;TEST_DESCRIPTION=${test_description}" ) set_tests_properties(${test_name} PROPERTIES CHECK_COUNT 0) + add_dependencies(tests ${test_exec}) endfunction() function(check_threshold testname threshold condition) @@ -439,8 +440,6 @@ endif() #################################################################################### if (CUDA_ENABLE) -add_physim_test(cuda.5g.channelsim.test_multipath "unitary test designed specifically to validate the multipath_channel_cuda" test_multipath) -add_physim_test(cuda.5g.channelsim.test_noise "unitary test that focuses on a single component: the add_noise_cuda function" test_noise) # --- Test Suite 1: 61440 samples, 2/4/8/32 TX - 2/4/8/32 RX --- add_physim_test(cuda.5g.channelsim.test_channel_scalability.test1 "16 channels 61440 samples 2T2R Batch" test_channel_scalability -c 16 -t 2 -r 2 -s 61440 -l 32 -m batch -n 12) diff --git a/openair2/COMMON/mac_primitives.h b/openair2/COMMON/mac_primitives.h deleted file mode 100644 index 707521a0ce..0000000000 --- a/openair2/COMMON/mac_primitives.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * SPDX-License-Identifier: LicenseRef-CSSL-1.0 - */ - -#ifndef __MAC_PRIMITIVES_H__ -#define __MAC_PRIMITIVES_H__ - - - -//void ue_decode_chbch(unsigned char Node_id); -//void ue_scheduler(unsigned char Node_id); -//void nodeb_decode_ul_sach(); -#endif diff --git a/openair2/COMMON/messages_def.h b/openair2/COMMON/messages_def.h deleted file mode 100644 index bdd590a53d..0000000000 --- a/openair2/COMMON/messages_def.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * SPDX-License-Identifier: LicenseRef-CSSL-1.0 - */ - -// These messages files are mandatory and must always be placed in first position -#include "intertask_messages_def.h" -#include "timer_messages_def.h" - -// Messages files used between tasks -#include "phy_messages_def.h" -#include "mac_messages_def.h" -#include "rlc_messages_def.h" -#include "pdcp_messages_def.h" -#include "rrc_messages_def.h" -#include "nas_messages_def.h" -#include "s1ap_messages_def.h" -#include "f1ap_messages_def.h" -#include "x2ap_messages_def.h" -#include "m2ap_messages_def.h" -#include "m3ap_messages_def.h" -#include "sctp_messages_def.h" -#include "udp_messages_def.h" -#include "gtpv1_u_messages_def.h" -#include "e1ap_messages_def.h" diff --git a/openair2/COMMON/openair_defs.h b/openair2/COMMON/openair_defs.h deleted file mode 100644 index 1ba95df5b8..0000000000 --- a/openair2/COMMON/openair_defs.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * SPDX-License-Identifier: LicenseRef-CSSL-1.0 - */ - -#ifndef __openair_DEFS_H__ -#define __openair_DEFS_H__ - -#include -#include -#include -#endif // /*__openair_DEFS_H__ */ - diff --git a/openair2/COMMON/phy_messages_def.h b/openair2/COMMON/phy_messages_def.h deleted file mode 100644 index 2846351b0c..0000000000 --- a/openair2/COMMON/phy_messages_def.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * SPDX-License-Identifier: LicenseRef-CSSL-1.0 - */ - -//-------------------------------------------------------------------------------------------// -// eNB: ENB_APP -> PHY messages -MESSAGE_DEF(PHY_CONFIGURATION_REQ, MESSAGE_PRIORITY_MED_PLUS, PhyConfigurationReq, phy_configuration_req) - -// UE: RRC -> PHY messages -MESSAGE_DEF(PHY_DEACTIVATE_REQ, MESSAGE_PRIORITY_MED_PLUS, PhyDeactivateReq, phy_deactivate_req) - -MESSAGE_DEF(PHY_FIND_CELL_REQ, MESSAGE_PRIORITY_MED_PLUS, PhyFindCellReq, phy_find_cell_req) -MESSAGE_DEF(PHY_FIND_NEXT_CELL_REQ, MESSAGE_PRIORITY_MED_PLUS, PhyFindNextCellReq, phy_find_next_cell_req) -MESSAGE_DEF(PHY_MEAS_THRESHOLD_REQ, MESSAGE_PRIORITY_MED_PLUS, PhyMeasThresholdReq, phy_meas_threshold_req) -// UE: PHY -> RRC messages -MESSAGE_DEF(PHY_FIND_CELL_IND, MESSAGE_PRIORITY_MED_PLUS, PhyFindCellInd, phy_find_cell_ind) -MESSAGE_DEF(PHY_MEAS_THRESHOLD_CONF, MESSAGE_PRIORITY_MED_PLUS, PhyMeasThresholdConf, phy_meas_threshold_conf) -MESSAGE_DEF(PHY_MEAS_REPORT_IND, MESSAGE_PRIORITY_MED_PLUS, PhyMeasReportInd, phy_meas_report_ind) diff --git a/openair2/COMMON/phy_messages_types.h b/openair2/COMMON/phy_messages_types.h deleted file mode 100644 index 9e758a92f7..0000000000 --- a/openair2/COMMON/phy_messages_types.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * SPDX-License-Identifier: LicenseRef-CSSL-1.0 - */ - -/* - * phy_messages_types.h - */ - -#ifndef PHY_MESSAGES_TYPES_H_ -#define PHY_MESSAGES_TYPES_H_ - -#include "PHY/defs_common.h" - -//-------------------------------------------------------------------------------------------// -// Defines to access message fields. -#define PHY_CONFIGURATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.phy_configuration_req - -#define PHY_DEACTIVATE_REQ(mSGpTR) (mSGpTR)->ittiMsg.phy_deactivate_req - -#define PHY_FIND_CELL_REQ(mSGpTR) (mSGpTR)->ittiMsg.phy_find_cell_req -#define PHY_FIND_NEXT_CELL_REQ(mSGpTR) (mSGpTR)->ittiMsg.phy_find_next_cell_req - -#define PHY_FIND_CELL_IND(mSGpTR) (mSGpTR)->ittiMsg.phy_find_cell_ind - -#define PHY_MEAS_THRESHOLD_REQ(mSGpTR) (mSGpTR)->ittiMsg.phy_meas_threshold_req -#define PHY_MEAS_THRESHOLD_CONF(mSGpTR) (mSGpTR)->ittiMsg.phy_meas_threshold_conf -#define PHY_MEAS_REPORT_IND(mSGpTR) (mSGpTR)->ittiMsg.phy_meas_report_ind -//-------------------------------------------------------------------------------------------// -#define MAX_REPORTED_CELL 10 - -/* Enhance absolute radio frequency channel number */ -typedef uint16_t Earfcn; - -/* Physical cell identity, valid value are from 0 to 503 */ -typedef int16_t PhyCellId; - -/* Reference signal received power, valid value are from 0 (rsrp < -140 dBm) to 97 (rsrp <= -44 dBm) */ -typedef int8_t Rsrp; - -/* Reference signal received quality, valid value are from 0 (rsrq < -19.50 dB) to 34 (rsrq <= -3 dB) */ -typedef int8_t Rsrq; - -typedef struct CellInfo_s { - Earfcn earfcn; - PhyCellId cell_id; - Rsrp rsrp; - Rsrq rsrq; -} CellInfo; - -//-------------------------------------------------------------------------------------------// -// eNB: ENB_APP -> PHY messages -typedef struct PhyConfigurationReq_s { - frame_type_t frame_type[MAX_NUM_CCs]; - lte_prefix_type_t prefix_type[MAX_NUM_CCs]; - uint32_t downlink_frequency[MAX_NUM_CCs]; - int32_t uplink_frequency_offset[MAX_NUM_CCs]; - int32_t nb_antennas_tx[MAX_NUM_CCs]; - int32_t nb_antennas_rx[MAX_NUM_CCs]; - int32_t tx_gain[MAX_NUM_CCs]; - int32_t rx_gain[MAX_NUM_CCs]; -} PhyConfigurationReq; - -// UE: RRC -> PHY messages -typedef struct PhyDeactivateReq_s { - // This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++ - // To be removed if the structure is filled - uint32_t dummy; -} PhyDeactivateReq; - -typedef struct PhyFindCellReq_s { - Earfcn earfcn_start; - Earfcn earfcn_end; -} PhyFindCellReq; - -typedef struct PhyFindNextCellReq_s { - // This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++ - // To be removed if the structure is filled - uint32_t dummy; -} PhyFindNextCellReq; - -typedef struct PhyMeasThresholdReq_s { - // This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++ - // To be removed if the structure is filled - uint32_t dummy; -} PhyMeasThresholdReq; - -typedef struct PhyMeasReportInd_s { - // This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++ - // To be removed if the structure is filled - uint32_t dummy; -} PhyMeasReportInd; - -// UE: PHY -> RRC messages -typedef struct PhyFindCellInd_s { - uint8_t cell_nb; - CellInfo cells[MAX_REPORTED_CELL]; -} PhyFindCellInd; - -typedef struct PhyMeasThresholdConf_s { - // This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++ - // To be removed if the structure is filled - uint32_t dummy; -} PhyMeasThresholdConf; -#endif /* PHY_MESSAGES_TYPES_H_ */ diff --git a/openair2/COMMON/rlc_messages_def.h b/openair2/COMMON/rlc_messages_def.h deleted file mode 100644 index 7d86f5b56b..0000000000 --- a/openair2/COMMON/rlc_messages_def.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * SPDX-License-Identifier: LicenseRef-CSSL-1.0 - */ - -/* - * rlc_messages_def.h - */ - -//-------------------------------------------------------------------------------------------// -// Messages for RLC logging - -#if defined(DISABLE_ITTI_XER_PRINT) - -#else -MESSAGE_DEF(RLC_AM_DATA_PDU_IND, MESSAGE_PRIORITY_MED_PLUS, IttiMsgText, rlc_am_data_pdu_ind) -MESSAGE_DEF(RLC_AM_DATA_PDU_REQ, MESSAGE_PRIORITY_MED_PLUS, IttiMsgText, rlc_am_data_pdu_req) -MESSAGE_DEF(RLC_AM_STATUS_PDU_IND, MESSAGE_PRIORITY_MED_PLUS, IttiMsgText, rlc_am_status_pdu_ind) -MESSAGE_DEF(RLC_AM_STATUS_PDU_REQ, MESSAGE_PRIORITY_MED_PLUS, IttiMsgText, rlc_am_status_pdu_req) -MESSAGE_DEF(RLC_AM_SDU_REQ, MESSAGE_PRIORITY_MED_PLUS, IttiMsgText, rlc_am_sdu_req) -MESSAGE_DEF(RLC_AM_SDU_IND, MESSAGE_PRIORITY_MED_PLUS, IttiMsgText, rlc_am_sdu_ind) - -MESSAGE_DEF(RLC_UM_DATA_PDU_IND, MESSAGE_PRIORITY_MED_PLUS, IttiMsgText, rlc_um_data_pdu_ind) -MESSAGE_DEF(RLC_UM_DATA_PDU_REQ, MESSAGE_PRIORITY_MED_PLUS, IttiMsgText, rlc_um_data_pdu_req) -MESSAGE_DEF(RLC_UM_SDU_REQ, MESSAGE_PRIORITY_MED_PLUS, IttiMsgText, rlc_um_sdu_req) -MESSAGE_DEF(RLC_UM_SDU_IND, MESSAGE_PRIORITY_MED_PLUS, IttiMsgText, rlc_um_sdu_ind) -#endif diff --git a/openair2/COMMON/rlc_messages_types.h b/openair2/COMMON/rlc_messages_types.h deleted file mode 100644 index ab9483669a..0000000000 --- a/openair2/COMMON/rlc_messages_types.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * SPDX-License-Identifier: LicenseRef-CSSL-1.0 - */ - -/* - * rlc_messages_types.h - */ - -#ifndef RLC_MESSAGES_TYPES_H_ -#define RLC_MESSAGES_TYPES_H_ - - - -#endif /* RLC_MESSAGES_TYPES_H_ */ diff --git a/openair2/COMMON/udp_messages_def.h b/openair2/COMMON/udp_messages_def.h deleted file mode 100644 index 03566ef09f..0000000000 --- a/openair2/COMMON/udp_messages_def.h +++ /dev/null @@ -1,7 +0,0 @@ -/* - * SPDX-License-Identifier: LicenseRef-CSSL-1.0 - */ - -MESSAGE_DEF(UDP_INIT, MESSAGE_PRIORITY_MED, udp_init_t, udp_init) -MESSAGE_DEF(UDP_DATA_REQ, MESSAGE_PRIORITY_MED, udp_data_req_t, udp_data_req) -MESSAGE_DEF(UDP_DATA_IND, MESSAGE_PRIORITY_MED, udp_data_ind_t, udp_data_ind) diff --git a/openair2/COMMON/udp_messages_types.h b/openair2/COMMON/udp_messages_types.h deleted file mode 100644 index 9db6dc78d7..0000000000 --- a/openair2/COMMON/udp_messages_types.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SPDX-License-Identifier: LicenseRef-CSSL-1.0 - */ - -#ifndef UDP_MESSAGES_TYPES_H_ -#define UDP_MESSAGES_TYPES_H_ - -#define UDP_INIT(mSGpTR) (mSGpTR)->ittiMsg.udp_init - -typedef struct { - uint32_t port; - char *address; -} udp_init_t; - -typedef struct { - uint8_t *buffer; - uint32_t buffer_length; - uint32_t buffer_offset; - uint32_t peer_address; - uint32_t peer_port; -} udp_data_req_t; - -typedef struct { - uint8_t *buffer; - uint32_t buffer_length; - uint32_t peer_address; - uint32_t peer_port; -} udp_data_ind_t; - -#endif /* UDP_MESSAGES_TYPES_H_ */ diff --git a/openair2/E1AP/e1ap_setup.c b/openair2/E1AP/e1ap_setup.c index 2247b47d9c..b14fe65fae 100644 --- a/openair2/E1AP/e1ap_setup.c +++ b/openair2/E1AP/e1ap_setup.c @@ -11,6 +11,8 @@ #include "common/utils/ocp_itti/intertask_interface.h" #include "openair2/GNB_APP/gnb_paramdef.h" #include "openair3/ocp-gtpu/gtp_itf.h" +#include "common/config/config_paramdesc.h" +#include "common/config/config_userapi.h" static void get_NGU_S1U_addr(char **addr, uint16_t *port) { diff --git a/openair2/GNB_APP/L1_nr_paramdef.h b/openair2/GNB_APP/L1_nr_paramdef.h index 0255603a58..1faa03c475 100644 --- a/openair2/GNB_APP/L1_nr_paramdef.h +++ b/openair2/GNB_APP/L1_nr_paramdef.h @@ -13,31 +13,29 @@ /* L1 configuration parameters names */ -#define CONFIG_STRING_L1_CC "num_cc" -#define CONFIG_STRING_L1_LOCAL_N_ADDRESS "local_n_address" -#define CONFIG_STRING_L1_REMOTE_N_ADDRESS "remote_n_address" -#define CONFIG_STRING_L1_LOCAL_N_PORTC "local_n_portc" -#define CONFIG_STRING_L1_REMOTE_N_PORTC "remote_n_portc" -#define CONFIG_STRING_L1_LOCAL_N_PORTD "local_n_portd" -#define CONFIG_STRING_L1_REMOTE_N_PORTD "remote_n_portd" -#define CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE "tr_n_preference" -#define CONFIG_STRING_L1_THREAD_POOL_SIZE "thread_pool_size" -#define CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR "ofdm_offset_divisor" -#define CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD "pucch0_dtx_threshold" -#define CONFIG_STRING_L1_PRACH_DTX_THRESHOLD "prach_dtx_threshold" -#define CONFIG_STRING_L1_PUSCH_DTX_THRESHOLD "pusch_dtx_threshold" -#define CONFIG_STRING_L1_SRS_DTX_THRESHOLD "srs_dtx_threshold" -#define CONFIG_STRING_L1_MAX_LDPC_ITERATIONS "max_ldpc_iterations" -#define CONFIG_STRING_L1_RX_THREAD_CORE "L1_rx_thread_core" -#define CONFIG_STRING_L1_TX_THREAD_CORE "L1_tx_thread_core" +#define L1_LOCAL_N_ADDRESS "local_n_address" +#define L1_REMOTE_N_ADDRESS "remote_n_address" +#define L1_REMOTE_N_PORTC "remote_n_portc" +#define L1_LOCAL_N_PORTD "local_n_portd" +#define L1_REMOTE_N_PORTD "remote_n_portd" +#define L1_TRANSPORT_N_PREFERENCE "tr_n_preference" +#define L1_THREAD_POOL_SIZE "thread_pool_size" +#define L1_OFDM_OFFSET_DIVISOR "ofdm_offset_divisor" +#define L1_PUCCH0_DTX_THRESHOLD "pucch0_dtx_threshold" +#define L1_PRACH_DTX_THRESHOLD "prach_dtx_threshold" +#define L1_PUSCH_DTX_THRESHOLD "pusch_dtx_threshold" +#define L1_SRS_DTX_THRESHOLD "srs_dtx_threshold" +#define L1_MAX_LDPC_ITERATIONS "max_ldpc_iterations" +#define L1_RX_THREAD_CORE "L1_rx_thread_core" +#define L1_TX_THREAD_CORE "L1_tx_thread_core" #define HLP_TP_SIZ "thread_pool_size paramter removed, please use --thread-pool" -#define CONFIG_STRING_L1_TX_AMP_BACKOFF_dB "tx_amp_backoff_dB" +#define L1_TX_AMP_BACKOFF_dB "tx_amp_backoff_dB" #define HLP_L1TX_BO "Backoff from full-scale output at the L1 entity(frequency domain), ex. 12 would corresponding to 14-bit input level (6 dB/bit). Default 36 dBFS for OAI RU entity" -#define CONFIG_STRING_L1_PHASE_COMP "phase_compensation" +#define L1_PHASE_COMP "phase_compensation" #define HLP_L1_PHASE_COMP "Apply NR symbolwise phase rotation" -#define CONFIG_STRING_NUM_ANTENNAS_PER_THREAD "dmrs_num_antennas_per_thread" +#define L1_NUM_ANTENNAS_PER_THREAD "dmrs_num_antennas_per_thread" #define HLP_NUM_ARX "Number of antennas per thread for PUSCH channel estimation" -#define CONFIG_STRING_ANALOG_DAS "enable_das" +#define L1_ANALOG_DAS "enable_das" /*----------------------------------------------------------------------------------------------------------------------------------------------------*/ /* L1 configuration parameters */ @@ -45,50 +43,27 @@ /*----------------------------------------------------------------------------------------------------------------------------------------------------*/ // clang-format off #define L1PARAMS_DESC { \ - {CONFIG_STRING_L1_CC, NULL, 0, .uptr=NULL, .defintval=1, TYPE_UINT, 0}, \ - {CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE, NULL, 0, .strptr=NULL, .defstrval="local_mac", TYPE_STRING, 0}, \ - {CONFIG_STRING_L1_LOCAL_N_ADDRESS, NULL, 0, .strptr=NULL, .defstrval="127.0.0.1", TYPE_STRING, 0}, \ - {CONFIG_STRING_L1_REMOTE_N_ADDRESS, NULL, 0, .strptr=NULL, .defstrval="127.0.0.2", TYPE_STRING, 0}, \ - {CONFIG_STRING_L1_LOCAL_N_PORTC, NULL, 0, .uptr=NULL, .defintval=50030, TYPE_UINT, 0}, \ - {CONFIG_STRING_L1_REMOTE_N_PORTC, NULL, 0, .uptr=NULL, .defintval=50030, TYPE_UINT, 0}, \ - {CONFIG_STRING_L1_LOCAL_N_PORTD, NULL, 0, .uptr=NULL, .defintval=50031, TYPE_UINT, 0}, \ - {CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, .uptr=NULL, .defintval=50031, TYPE_UINT, 0}, \ - {CONFIG_STRING_L1_THREAD_POOL_SIZE, HLP_TP_SIZ, 0, .uptr=NULL, .defintval=2022, TYPE_UINT, 0}, \ - {CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR, NULL, 0, .uptr=NULL, .defuintval=8, TYPE_UINT, 0}, \ - {CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD, NULL, 0, .uptr=NULL, .defintval=100, TYPE_UINT, 0}, \ - {CONFIG_STRING_L1_PRACH_DTX_THRESHOLD, NULL, 0, .uptr=NULL, .defintval=150, TYPE_UINT, 0}, \ - {CONFIG_STRING_L1_PUSCH_DTX_THRESHOLD, NULL, 0, .uptr=NULL, .defintval=50, TYPE_UINT, 0}, \ - {CONFIG_STRING_L1_SRS_DTX_THRESHOLD, NULL, 0, .uptr=NULL, .defintval=30, TYPE_UINT, 0}, \ - {CONFIG_STRING_L1_MAX_LDPC_ITERATIONS, NULL, 0, .uptr=NULL, .defintval=8, TYPE_UINT, 0}, \ - {CONFIG_STRING_L1_RX_THREAD_CORE, NULL, 0, .iptr=NULL, .defintval=-1, TYPE_INT, 0}, \ - {CONFIG_STRING_L1_TX_THREAD_CORE, NULL, 0, .iptr=NULL, .defintval=-1, TYPE_INT, 0}, \ - {CONFIG_STRING_L1_TX_AMP_BACKOFF_dB, HLP_L1TX_BO,0, .uptr=NULL, .defintval=36, TYPE_UINT, 0}, \ - {CONFIG_STRING_L1_PHASE_COMP, HLP_L1_PHASE_COMP,PARAMFLAG_BOOL, .uptr=NULL,.defintval=1, TYPE_UINT, 0}, \ - {CONFIG_STRING_NUM_ANTENNAS_PER_THREAD, HLP_NUM_ARX,0, .uptr=NULL, .defintval=1, TYPE_UINT, 0}, \ - {CONFIG_STRING_ANALOG_DAS, NULL, 0, .uptr=NULL, .defintval=0, TYPE_UINT, 0}, \ + {L1_TRANSPORT_N_PREFERENCE, NULL, 0, .strptr=NULL, .defstrval="local_mac", TYPE_STRING, 0}, \ + {L1_LOCAL_N_ADDRESS, NULL, 0, .strptr=NULL, .defstrval="127.0.0.1", TYPE_STRING, 0}, \ + {L1_REMOTE_N_ADDRESS, NULL, 0, .strptr=NULL, .defstrval="127.0.0.2", TYPE_STRING, 0}, \ + {L1_REMOTE_N_PORTC, NULL, 0, .uptr=NULL, .defintval=50030, TYPE_UINT, 0}, \ + {L1_LOCAL_N_PORTD, NULL, 0, .uptr=NULL, .defintval=50031, TYPE_UINT, 0}, \ + {L1_REMOTE_N_PORTD, NULL, 0, .uptr=NULL, .defintval=50031, TYPE_UINT, 0}, \ + {L1_THREAD_POOL_SIZE, HLP_TP_SIZ, 0, .uptr=NULL, .defintval=2022, TYPE_UINT, 0}, \ + {L1_OFDM_OFFSET_DIVISOR, NULL, 0, .uptr=NULL, .defuintval=8, TYPE_UINT, 0}, \ + {L1_PUCCH0_DTX_THRESHOLD, NULL, 0, .uptr=NULL, .defintval=100, TYPE_UINT, 0}, \ + {L1_PRACH_DTX_THRESHOLD, NULL, 0, .uptr=NULL, .defintval=150, TYPE_UINT, 0}, \ + {L1_PUSCH_DTX_THRESHOLD, NULL, 0, .uptr=NULL, .defintval=50, TYPE_UINT, 0}, \ + {L1_SRS_DTX_THRESHOLD, NULL, 0, .uptr=NULL, .defintval=30, TYPE_UINT, 0}, \ + {L1_MAX_LDPC_ITERATIONS, NULL, 0, .uptr=NULL, .defintval=8, TYPE_UINT, 0}, \ + {L1_RX_THREAD_CORE, NULL, 0, .iptr=NULL, .defintval=-1, TYPE_INT, 0}, \ + {L1_TX_THREAD_CORE, NULL, 0, .iptr=NULL, .defintval=-1, TYPE_INT, 0}, \ + {L1_TX_AMP_BACKOFF_dB, HLP_L1TX_BO,0, .uptr=NULL, .defintval=36, TYPE_UINT, 0}, \ + {L1_PHASE_COMP, HLP_L1_PHASE_COMP,PARAMFLAG_BOOL, .uptr=NULL,.defintval=1, TYPE_UINT, 0}, \ + {L1_NUM_ANTENNAS_PER_THREAD, HLP_NUM_ARX,0, .uptr=NULL, .defintval=1, TYPE_UINT, 0}, \ + {L1_ANALOG_DAS, NULL, 0, .uptr=NULL, .defintval=0, TYPE_UINT, 0}, \ } // clang-format on -#define L1_CC_IDX 0 -#define L1_TRANSPORT_N_PREFERENCE_IDX 1 -#define L1_LOCAL_N_ADDRESS_IDX 2 -#define L1_REMOTE_N_ADDRESS_IDX 3 -#define L1_LOCAL_N_PORTC_IDX 4 -#define L1_REMOTE_N_PORTC_IDX 5 -#define L1_LOCAL_N_PORTD_IDX 6 -#define L1_REMOTE_N_PORTD_IDX 7 -#define L1_THREAD_POOL_SIZE 8 -#define L1_OFDM_OFFSET_DIVISOR 9 -#define L1_PUCCH0_DTX_THRESHOLD 10 -#define L1_PRACH_DTX_THRESHOLD 11 -#define L1_PUSCH_DTX_THRESHOLD 12 -#define L1_SRS_DTX_THRESHOLD 13 -#define L1_MAX_LDPC_ITERATIONS 14 -#define L1_RX_THREAD_CORE 15 -#define L1_TX_THREAD_CORE 16 -#define L1_TX_AMP_BACKOFF_dB 17 -#define L1_PHASE_COMP 18 -#define NUM_ANTENNAS_PER_THREAD 19 -#define L1_ANALOG_DAS 20 /*----------------------------------------------------------------------------------------------------------------------------------------------------*/ #endif diff --git a/openair2/GNB_APP/MACRLC_nr_paramdef.h b/openair2/GNB_APP/MACRLC_nr_paramdef.h index 26e05f114b..32e510d80b 100644 --- a/openair2/GNB_APP/MACRLC_nr_paramdef.h +++ b/openair2/GNB_APP/MACRLC_nr_paramdef.h @@ -11,52 +11,49 @@ /*----------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* MACRLC configuration section names */ +#define MACRLC_LIST "MACRLCs" /* MACRLC configuration parameters names */ -#define CONFIG_STRING_MACRLC_CC "num_cc" -#define CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE "tr_n_preference" -#define CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS "local_n_address" -#define CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS_F1U "local_n_address_f1u" -#define CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS "remote_n_address" -#define CONFIG_STRING_MACRLC_LOCAL_N_PORTC "local_n_portc" -#define CONFIG_STRING_MACRLC_REMOTE_N_PORTC "remote_n_portc" -#define CONFIG_STRING_MACRLC_LOCAL_N_PORTD "local_n_portd" -#define CONFIG_STRING_MACRLC_REMOTE_N_PORTD "remote_n_portd" -#define CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE "tr_s_preference" -#define CONFIG_STRING_MACRLC_TRANSPORT_S_SHM_PREFIX "tr_s_shm_prefix" -#define CONFIG_STRING_MACRLC_TRANSPORT_S_POLL_CORE "tr_s_poll_core" -#define CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS "local_s_address" -#define CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS "remote_s_address" -#define CONFIG_STRING_MACRLC_LOCAL_S_PORTC "local_s_portc" -#define CONFIG_STRING_MACRLC_REMOTE_S_PORTC "remote_s_portc" -#define CONFIG_STRING_MACRLC_LOCAL_S_PORTD "local_s_portd" -#define CONFIG_STRING_MACRLC_REMOTE_S_PORTD "remote_s_portd" -#define CONFIG_STRING_MACRLC_ULSCH_MAX_FRAME_INACTIVITY "ulsch_max_frame_inactivity" -#define CONFIG_STRING_MACRLC_PUSCHTARGETSNRX10 "pusch_TargetSNRx10" -#define CONFIG_STRING_MACRLC_PUCCHTARGETSNRX10 "pucch_TargetSNRx10" -#define CONFIG_STRING_MACRLC_UL_PRBBLACK_SNR_THRESHOLD "ul_prbblack_SNR_threshold" -#define CONFIG_STRING_MACRLC_PUCCHFAILURETHRES "pucch_FailureThres" -#define CONFIG_STRING_MACRLC_PUSCHFAILURETHRES "pusch_FailureThres" -#define CONFIG_STRING_MACRLC_DL_BLER_TARGET_UPPER "dl_bler_target_upper" -#define CONFIG_STRING_MACRLC_DL_BLER_TARGET_LOWER "dl_bler_target_lower" -#define CONFIG_STRING_MACRLC_DL_MIN_MCS "dl_min_mcs" -#define CONFIG_STRING_MACRLC_DL_MAX_MCS "dl_max_mcs" -#define CONFIG_STRING_MACRLC_UL_BLER_TARGET_UPPER "ul_bler_target_upper" -#define CONFIG_STRING_MACRLC_UL_BLER_TARGET_LOWER "ul_bler_target_lower" -#define CONFIG_STRING_MACRLC_UL_MIN_MCS "ul_min_mcs" -#define CONFIG_STRING_MACRLC_UL_MAX_MCS "ul_max_mcs" -#define CONFIG_STRING_MACRLC_DL_HARQ_ROUND_MAX "dl_harq_round_max" -#define CONFIG_STRING_MACRLC_UL_HARQ_ROUND_MAX "ul_harq_round_max" -#define CONFIG_STRING_MACRLC_MIN_GRANT_PRB "min_grant_prb" -#define CONFIG_STRING_MACRLC_IDENTITY_PM "identity_precoding_matrix" -#define CONFIG_STRING_MACRLC_ANALOG_BEAMFORMING "set_analog_beamforming" -#define CONFIG_STRING_MACRLC_BEAM_DURATION "beam_duration" -#define CONFIG_STRING_MACRLC_BEAMS_PERIOD "beams_per_period" -#define CONFIG_STRING_MACRLC_BEAM_WEIGHTS_LIST "beam_weights" -#define CONFIG_STRING_MACRLC_DBT_FILE "dbt_file" -#define CONFIG_STRING_MACRLC_PUSCH_RSSI_THRESHOLD "pusch_RSSI_Threshold" -#define CONFIG_STRING_MACRLC_PUCCH_RSSI_THRESHOLD "pucch_RSSI_Threshold" -#define CONFIG_STRING_MACRLC_STATS_MAX_UE "stats_max_ue" +#define MACRLC_TRANSPORT_N_PREFERENCE "tr_n_preference" +#define MACRLC_LOCAL_N_ADDRESS "local_n_address" +#define MACRLC_LOCAL_N_ADDRESS_F1U "local_n_address_f1u" +#define MACRLC_REMOTE_N_ADDRESS "remote_n_address" +#define MACRLC_LOCAL_N_PORTD "local_n_portd" +#define MACRLC_REMOTE_N_PORTD "remote_n_portd" +#define MACRLC_TRANSPORT_S_PREFERENCE "tr_s_preference" +#define MACRLC_TRANSPORT_S_SHM_PREFIX "tr_s_shm_prefix" +#define MACRLC_TRANSPORT_S_POLL_CORE "tr_s_poll_core" +#define MACRLC_LOCAL_S_ADDRESS "local_s_address" +#define MACRLC_REMOTE_S_ADDRESS "remote_s_address" +#define MACRLC_LOCAL_S_PORTC "local_s_portc" +#define MACRLC_LOCAL_S_PORTD "local_s_portd" +#define MACRLC_ULSCH_MAX_FRAME_INACTIVITY "ulsch_max_frame_inactivity" +#define MACRLC_PUSCHTARGETSNRX10 "pusch_TargetSNRx10" +#define MACRLC_PUCCHTARGETSNRX10 "pucch_TargetSNRx10" +#define MACRLC_UL_PRBBLACK_SNR_THRESHOLD "ul_prbblack_SNR_threshold" +#define MACRLC_PUCCHFAILURETHRES "pucch_FailureThres" +#define MACRLC_PUSCHFAILURETHRES "pusch_FailureThres" +#define MACRLC_DL_BLER_TARGET_UPPER "dl_bler_target_upper" +#define MACRLC_DL_BLER_TARGET_LOWER "dl_bler_target_lower" +#define MACRLC_DL_MIN_MCS "dl_min_mcs" +#define MACRLC_DL_MAX_MCS "dl_max_mcs" +#define MACRLC_UL_BLER_TARGET_UPPER "ul_bler_target_upper" +#define MACRLC_UL_BLER_TARGET_LOWER "ul_bler_target_lower" +#define MACRLC_UL_MIN_MCS "ul_min_mcs" +#define MACRLC_UL_MAX_MCS "ul_max_mcs" +#define MACRLC_DL_HARQ_ROUND_MAX "dl_harq_round_max" +#define MACRLC_UL_HARQ_ROUND_MAX "ul_harq_round_max" +#define MACRLC_MIN_GRANT_PRB "min_grant_prb" +#define MACRLC_IDENTITY_PM "identity_precoding_matrix" +#define MACRLC_ANALOG_BEAMFORMING "set_analog_beamforming" +#define MACRLC_BEAM_DURATION "beam_duration" +#define MACRLC_BEAMS_PERIOD "beams_per_period" +#define MACRLC_BEAM_WEIGHTS_LIST "beam_weights" +#define MACRLC_DBT_FILE "dbt_file" +#define MACRLC_PUSCH_RSSI_THRESHOLD "pusch_RSSI_Threshold" +#define MACRLC_PUCCH_RSSI_THRESHOLD "pucch_RSSI_Threshold" +#define MACRLC_STATS_MAX_UE "stats_max_ue" #define HLP_MACRLC_UL_PRBBLACK "SNR threshold to decide whether a PRB will be blacklisted or not" #define HLP_MACRLC_DL_BLER_UP "Upper threshold of BLER to decrease DL MCS" @@ -85,100 +82,50 @@ /*-------------------------------------------------------------------------------------------------------------------------------------------------------*/ // clang-format off #define MACRLCPARAMS_DESC { \ - {CONFIG_STRING_MACRLC_CC, NULL, 0, .uptr=NULL, .defintval=50011, TYPE_UINT, 0}, \ - {CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE, NULL, 0, .strptr=NULL, .defstrval="local_L1", TYPE_STRING, 0}, \ - {CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS, NULL, 0, .strptr=NULL, .defstrval="127.0.0.1", TYPE_STRING, 0}, \ - {CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS, NULL, 0, .uptr=NULL, .defstrval="127.0.0.2", TYPE_STRING, 0}, \ - {CONFIG_STRING_MACRLC_LOCAL_N_PORTC, NULL, 0, .uptr=NULL, .defintval=50010, TYPE_UINT, 0}, \ - {CONFIG_STRING_MACRLC_REMOTE_N_PORTC, NULL, 0, .uptr=NULL, .defintval=50010, TYPE_UINT, 0}, \ - {CONFIG_STRING_MACRLC_LOCAL_N_PORTD, NULL, 0, .uptr=NULL, .defintval=50011, TYPE_UINT, 0}, \ - {CONFIG_STRING_MACRLC_REMOTE_N_PORTD, NULL, 0, .uptr=NULL, .defintval=50011, TYPE_UINT, 0}, \ - {CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE, NULL, 0, .strptr=NULL, .defstrval="local_RRC", TYPE_STRING, 0}, \ - {CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS, NULL, 0, .uptr=NULL, .defstrval="127.0.0.1", TYPE_STRING, 0}, \ - {CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS, NULL, 0, .uptr=NULL, .defstrval="127.0.0.2", TYPE_STRING, 0}, \ - {CONFIG_STRING_MACRLC_LOCAL_S_PORTC, NULL, 0, .uptr=NULL, .defintval=50020, TYPE_UINT, 0}, \ - {CONFIG_STRING_MACRLC_REMOTE_S_PORTC, NULL, 0, .uptr=NULL, .defintval=50020, TYPE_UINT, 0}, \ - {CONFIG_STRING_MACRLC_LOCAL_S_PORTD, NULL, 0, .uptr=NULL, .defintval=50021, TYPE_UINT, 0}, \ - {CONFIG_STRING_MACRLC_REMOTE_S_PORTD, NULL, 0, .uptr=NULL, .defintval=50021, TYPE_UINT, 0}, \ - {CONFIG_STRING_MACRLC_ULSCH_MAX_FRAME_INACTIVITY, NULL, 0, .uptr=NULL, .defintval=10, TYPE_UINT, 0}, \ - {CONFIG_STRING_MACRLC_PUSCHTARGETSNRX10, NULL, 0, .iptr=NULL, .defintval=200, TYPE_INT, 0}, \ - {CONFIG_STRING_MACRLC_PUCCHTARGETSNRX10, NULL, 0, .iptr=NULL, .defintval=150, TYPE_INT, 0}, \ - {CONFIG_STRING_MACRLC_UL_PRBBLACK_SNR_THRESHOLD, HLP_MACRLC_UL_PRBBLACK, 0, .iptr=NULL, .defintval=10, TYPE_INT, 0}, \ - {CONFIG_STRING_MACRLC_PUCCHFAILURETHRES, NULL, 0, .iptr=NULL, .defintval=10, TYPE_INT, 0}, \ - {CONFIG_STRING_MACRLC_PUSCHFAILURETHRES, NULL, 0, .iptr=NULL, .defintval=10, TYPE_INT, 0}, \ - {CONFIG_STRING_MACRLC_DL_BLER_TARGET_UPPER, HLP_MACRLC_DL_BLER_UP, 0, .dblptr=NULL, .defdblval=0.15, TYPE_DOUBLE, 0}, \ - {CONFIG_STRING_MACRLC_DL_BLER_TARGET_LOWER, HLP_MACRLC_DL_BLER_LO, 0, .dblptr=NULL, .defdblval=0.05, TYPE_DOUBLE, 0}, \ - {CONFIG_STRING_MACRLC_DL_MIN_MCS, HLP_MACRLC_DL_MIN_MCS, 0, .u8ptr=NULL, .defintval=0, TYPE_UINT8, 0}, \ - {CONFIG_STRING_MACRLC_DL_MAX_MCS, HLP_MACRLC_DL_MAX_MCS, 0, .u8ptr=NULL, .defintval=28, TYPE_UINT8, 0}, \ - {CONFIG_STRING_MACRLC_UL_BLER_TARGET_UPPER, HLP_MACRLC_UL_BLER_UP, 0, .dblptr=NULL, .defdblval=0.15, TYPE_DOUBLE, 0}, \ - {CONFIG_STRING_MACRLC_UL_BLER_TARGET_LOWER, HLP_MACRLC_UL_BLER_LO, 0, .dblptr=NULL, .defdblval=0.05, TYPE_DOUBLE, 0}, \ - {CONFIG_STRING_MACRLC_UL_MIN_MCS, HLP_MACRLC_UL_MIN_MCS, 0, .u8ptr=NULL, .defintval=0, TYPE_UINT8, 0}, \ - {CONFIG_STRING_MACRLC_UL_MAX_MCS, HLP_MACRLC_UL_MAX_MCS, 0, .u8ptr=NULL, .defintval=28, TYPE_UINT8, 0}, \ - {CONFIG_STRING_MACRLC_DL_HARQ_ROUND_MAX, HLP_MACRLC_DL_HARQ_MAX, 0, .u8ptr=NULL, .defintval=4, TYPE_UINT8, 0}, \ - {CONFIG_STRING_MACRLC_UL_HARQ_ROUND_MAX, HLP_MACRLC_UL_HARQ_MAX, 0, .u8ptr=NULL, .defintval=4, TYPE_UINT8, 0}, \ - {CONFIG_STRING_MACRLC_MIN_GRANT_PRB, HLP_MACRLC_MIN_GRANT_PRB, 0, .u16ptr=NULL, .defintval=5, TYPE_UINT16, 0}, \ - {CONFIG_STRING_MACRLC_IDENTITY_PM, HLP_MACRLC_IDENTITY_PM, PARAMFLAG_BOOL, .u8ptr=NULL, .defintval=0, TYPE_UINT8, 0}, \ - {CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS_F1U, NULL, 0, .strptr=NULL, .defstrval=NULL, TYPE_STRING, 0}, \ - {CONFIG_STRING_MACRLC_TRANSPORT_S_SHM_PREFIX, NULL, 0, .strptr=NULL, .defstrval="nvipc", TYPE_STRING, 0}, \ - {CONFIG_STRING_MACRLC_TRANSPORT_S_POLL_CORE, NULL, 0, .i8ptr=NULL, .defintval=-1, TYPE_INT8, 0}, \ - {CONFIG_STRING_MACRLC_ANALOG_BEAMFORMING, HLP_MACRLC_AB, 0, .strptr=NULL, .defstrval="none", TYPE_STRING, 0}, \ - {CONFIG_STRING_MACRLC_BEAM_DURATION, HLP_MACRLC_BEAM_DURATION, 0, .u8ptr=NULL, .defintval=1, TYPE_UINT8, 0}, \ - {CONFIG_STRING_MACRLC_BEAMS_PERIOD, HLP_MACRLC_BEAMS_PERIOD, 0, .u8ptr=NULL, .defintval=1, TYPE_UINT8, 0}, \ - {CONFIG_STRING_MACRLC_BEAM_WEIGHTS_LIST, NULL, 0, .iptr=NULL, .defintarrayval=0, TYPE_INTARRAY,0}, \ - {CONFIG_STRING_MACRLC_DBT_FILE, HLP_MACRLC_DBT_FILE, 0, .strptr=NULL, .defstrval=NULL, TYPE_STRING, 0}, \ - {CONFIG_STRING_MACRLC_PUSCH_RSSI_THRESHOLD, HLP_MACRLC_PUSCH_RSSI_THRESHOLD, \ + {MACRLC_TRANSPORT_N_PREFERENCE, NULL, 0, .strptr=NULL, .defstrval="local_L1", TYPE_STRING, 0}, \ + {MACRLC_LOCAL_N_ADDRESS, NULL, 0, .strptr=NULL, .defstrval="127.0.0.1", TYPE_STRING, 0}, \ + {MACRLC_REMOTE_N_ADDRESS, NULL, 0, .uptr=NULL, .defstrval="127.0.0.2", TYPE_STRING, 0}, \ + {MACRLC_LOCAL_N_PORTD, NULL, 0, .uptr=NULL, .defintval=50011, TYPE_UINT, 0}, \ + {MACRLC_REMOTE_N_PORTD, NULL, 0, .uptr=NULL, .defintval=50011, TYPE_UINT, 0}, \ + {MACRLC_TRANSPORT_S_PREFERENCE, NULL, 0, .strptr=NULL, .defstrval="local_RRC", TYPE_STRING, 0}, \ + {MACRLC_LOCAL_S_ADDRESS, NULL, 0, .uptr=NULL, .defstrval="127.0.0.1", TYPE_STRING, 0}, \ + {MACRLC_REMOTE_S_ADDRESS, NULL, 0, .uptr=NULL, .defstrval="127.0.0.2", TYPE_STRING, 0}, \ + {MACRLC_LOCAL_S_PORTC, NULL, 0, .uptr=NULL, .defintval=50020, TYPE_UINT, 0}, \ + {MACRLC_LOCAL_S_PORTD, NULL, 0, .uptr=NULL, .defintval=50021, TYPE_UINT, 0}, \ + {MACRLC_ULSCH_MAX_FRAME_INACTIVITY, NULL, 0, .uptr=NULL, .defintval=10, TYPE_UINT, 0}, \ + {MACRLC_PUSCHTARGETSNRX10, NULL, 0, .iptr=NULL, .defintval=200, TYPE_INT, 0}, \ + {MACRLC_PUCCHTARGETSNRX10, NULL, 0, .iptr=NULL, .defintval=150, TYPE_INT, 0}, \ + {MACRLC_UL_PRBBLACK_SNR_THRESHOLD, HLP_MACRLC_UL_PRBBLACK, 0, .iptr=NULL, .defintval=10, TYPE_INT, 0}, \ + {MACRLC_PUCCHFAILURETHRES, NULL, 0, .iptr=NULL, .defintval=10, TYPE_INT, 0}, \ + {MACRLC_PUSCHFAILURETHRES, NULL, 0, .iptr=NULL, .defintval=10, TYPE_INT, 0}, \ + {MACRLC_DL_BLER_TARGET_UPPER, HLP_MACRLC_DL_BLER_UP, 0, .dblptr=NULL, .defdblval=0.15, TYPE_DOUBLE, 0}, \ + {MACRLC_DL_BLER_TARGET_LOWER, HLP_MACRLC_DL_BLER_LO, 0, .dblptr=NULL, .defdblval=0.05, TYPE_DOUBLE, 0}, \ + {MACRLC_DL_MIN_MCS, HLP_MACRLC_DL_MIN_MCS, 0, .u8ptr=NULL, .defintval=0, TYPE_UINT8, 0}, \ + {MACRLC_DL_MAX_MCS, HLP_MACRLC_DL_MAX_MCS, 0, .u8ptr=NULL, .defintval=28, TYPE_UINT8, 0}, \ + {MACRLC_UL_BLER_TARGET_UPPER, HLP_MACRLC_UL_BLER_UP, 0, .dblptr=NULL, .defdblval=0.15, TYPE_DOUBLE, 0}, \ + {MACRLC_UL_BLER_TARGET_LOWER, HLP_MACRLC_UL_BLER_LO, 0, .dblptr=NULL, .defdblval=0.05, TYPE_DOUBLE, 0}, \ + {MACRLC_UL_MIN_MCS, HLP_MACRLC_UL_MIN_MCS, 0, .u8ptr=NULL, .defintval=0, TYPE_UINT8, 0}, \ + {MACRLC_UL_MAX_MCS, HLP_MACRLC_UL_MAX_MCS, 0, .u8ptr=NULL, .defintval=28, TYPE_UINT8, 0}, \ + {MACRLC_DL_HARQ_ROUND_MAX, HLP_MACRLC_DL_HARQ_MAX, 0, .u8ptr=NULL, .defintval=4, TYPE_UINT8, 0}, \ + {MACRLC_UL_HARQ_ROUND_MAX, HLP_MACRLC_UL_HARQ_MAX, 0, .u8ptr=NULL, .defintval=4, TYPE_UINT8, 0}, \ + {MACRLC_MIN_GRANT_PRB, HLP_MACRLC_MIN_GRANT_PRB, 0, .u16ptr=NULL, .defintval=5, TYPE_UINT16, 0}, \ + {MACRLC_IDENTITY_PM, HLP_MACRLC_IDENTITY_PM, PARAMFLAG_BOOL, .u8ptr=NULL, .defintval=0, TYPE_UINT8, 0}, \ + {MACRLC_LOCAL_N_ADDRESS_F1U, NULL, 0, .strptr=NULL, .defstrval=NULL, TYPE_STRING, 0}, \ + {MACRLC_TRANSPORT_S_SHM_PREFIX, NULL, 0, .strptr=NULL, .defstrval="nvipc", TYPE_STRING, 0}, \ + {MACRLC_TRANSPORT_S_POLL_CORE, NULL, 0, .i8ptr=NULL, .defintval=-1, TYPE_INT8, 0}, \ + {MACRLC_ANALOG_BEAMFORMING, HLP_MACRLC_AB, 0, .strptr=NULL, .defstrval="none", TYPE_STRING, 0}, \ + {MACRLC_BEAM_DURATION, HLP_MACRLC_BEAM_DURATION, 0, .u8ptr=NULL, .defintval=1, TYPE_UINT8, 0}, \ + {MACRLC_BEAMS_PERIOD, HLP_MACRLC_BEAMS_PERIOD, 0, .u8ptr=NULL, .defintval=1, TYPE_UINT8, 0}, \ + {MACRLC_BEAM_WEIGHTS_LIST, NULL, 0, .iptr=NULL, .defintarrayval=0, TYPE_INTARRAY,0}, \ + {MACRLC_DBT_FILE, HLP_MACRLC_DBT_FILE, 0, .strptr=NULL, .defstrval=NULL, TYPE_STRING, 0}, \ + {MACRLC_PUSCH_RSSI_THRESHOLD, HLP_MACRLC_PUSCH_RSSI_THRESHOLD, \ 0, .iptr=NULL, .defintval=0, TYPE_INT, 0}, \ - {CONFIG_STRING_MACRLC_PUCCH_RSSI_THRESHOLD, HLP_MACRLC_PUCCH_RSSI_THRESHOLD, \ + {MACRLC_PUCCH_RSSI_THRESHOLD, HLP_MACRLC_PUCCH_RSSI_THRESHOLD, \ 0, .iptr=NULL, .defintval=0, TYPE_INT, 0}, \ - {CONFIG_STRING_MACRLC_STATS_MAX_UE, HLP_MACRLC_STATS_MAX_UE, 0, .iptr=NULL, .defintval=8, TYPE_INT, 0}, \ + {MACRLC_STATS_MAX_UE, HLP_MACRLC_STATS_MAX_UE, 0, .iptr=NULL, .defintval=8, TYPE_INT, 0}, \ } // clang-format off -#define MACRLC_CC_IDX 0 -#define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1 -#define MACRLC_LOCAL_N_ADDRESS_IDX 2 -#define MACRLC_REMOTE_N_ADDRESS_IDX 3 -#define MACRLC_LOCAL_N_PORTC_IDX 4 -#define MACRLC_REMOTE_N_PORTC_IDX 5 -#define MACRLC_LOCAL_N_PORTD_IDX 6 -#define MACRLC_REMOTE_N_PORTD_IDX 7 -#define MACRLC_TRANSPORT_S_PREFERENCE_IDX 8 -#define MACRLC_LOCAL_S_ADDRESS_IDX 9 -#define MACRLC_REMOTE_S_ADDRESS_IDX 10 -#define MACRLC_LOCAL_S_PORTC_IDX 11 -#define MACRLC_REMOTE_S_PORTC_IDX 12 -#define MACRLC_LOCAL_S_PORTD_IDX 13 -#define MACRLC_REMOTE_S_PORTD_IDX 14 -#define MACRLC_ULSCH_MAX_FRAME_INACTIVITY 15 -#define MACRLC_PUSCHTARGETSNRX10_IDX 16 -#define MACRLC_PUCCHTARGETSNRX10_IDX 17 -#define MACRLC_UL_PRBBLACK_SNR_THRESHOLD_IDX 18 -#define MACRLC_PUCCHFAILURETHRES_IDX 19 -#define MACRLC_PUSCHFAILURETHRES_IDX 20 -#define MACRLC_DL_BLER_TARGET_UPPER_IDX 21 -#define MACRLC_DL_BLER_TARGET_LOWER_IDX 22 -#define MACRLC_DL_MIN_MCS_IDX 23 -#define MACRLC_DL_MAX_MCS_IDX 24 -#define MACRLC_UL_BLER_TARGET_UPPER_IDX 25 -#define MACRLC_UL_BLER_TARGET_LOWER_IDX 26 -#define MACRLC_UL_MIN_MCS_IDX 27 -#define MACRLC_UL_MAX_MCS_IDX 28 -#define MACRLC_DL_HARQ_ROUND_MAX_IDX 29 -#define MACRLC_UL_HARQ_ROUND_MAX_IDX 30 -#define MACRLC_MIN_GRANT_PRB_IDX 31 -#define MACRLC_IDENTITY_PM_IDX 32 -#define MACRLC_LOCAL_N_ADDRESS_F1U_IDX 33 -#define MACRLC_TRANSPORT_S_SHM_PREFIX 34 -#define MACRLC_TRANSPORT_S_POLL_CORE 35 -#define MACRLC_ANALOG_BEAMFORMING_IDX 36 -#define MACRLC_ANALOG_BEAM_DURATION_IDX 37 -#define MACRLC_ANALOG_BEAMS_PERIOD_IDX 38 -#define MACRLC_BEAMWEIGHTS_IDX 39 -#define MACRLC_DBT_FILE_IDX 40 -#define MACRLC_PUSCH_RSSI_THRES_IDX 41 -#define MACRLC_PUCCH_RSSI_THRES_IDX 42 -#define MACRLC_STATS_MAX_UE_IDX 43 - #define MACRLCPARAMS_CHECK { \ { .s5 = { NULL } }, \ { .s5 = { NULL } }, \ @@ -198,11 +145,6 @@ { .s5 = { NULL } }, \ { .s5 = { NULL } }, \ { .s5 = { NULL } }, \ - { .s5 = { NULL } }, \ - { .s5 = { NULL } }, \ - { .s5 = { NULL } }, \ - { .s5 = { NULL } }, \ - { .s5 = { NULL } }, \ { .s2 = { config_check_intrange, {0, 31} } }, /* DL min MCS */ \ { .s2 = { config_check_intrange, {0, 31} } }, /* DL max MCS */ \ { .s5 = { NULL } }, \ diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index a67f01526d..4928d98183 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -653,7 +653,7 @@ void RCconfig_verify(configmodule_interface_t *cfg, ngran_node_t node_type) // check for some general sections verify_section_notset(cfg, NULL, CONFIG_STRING_L1_LIST); verify_section_notset(cfg, NULL, CONFIG_STRING_RU_LIST); - verify_section_notset(cfg, NULL, CONFIG_STRING_MACRLC_LIST); + verify_section_notset(cfg, NULL, MACRLC_LIST); verify_section_notset(cfg, NULL, CONFIG_STRING_NR_RLC_LIST); } else if (NODE_IS_DU(node_type)) { // verify that there is no bearer config @@ -828,40 +828,36 @@ void RCconfig_NR_L1(void) GET_PARAMS_LIST(L1_ParamList, L1_Params, L1PARAMS_DESC, CONFIG_STRING_L1_LIST, NULL); if (L1_ParamList.numelt > 0) { - AssertFatal(*L1_ParamList.paramarray[j][L1_THREAD_POOL_SIZE].uptr == 2022, + const paramdef_t *params = L1_ParamList.paramarray[j]; + const int np = sizeofArray(L1_Params); + AssertFatal(*gpd(params, np, L1_THREAD_POOL_SIZE)->uptr == 2022, "thread_pool_size removed, please use --thread-pool\n"); - gNB->ofdm_offset_divisor = *(L1_ParamList.paramarray[j][L1_OFDM_OFFSET_DIVISOR].uptr); - gNB->pucch0_thres = *(L1_ParamList.paramarray[j][L1_PUCCH0_DTX_THRESHOLD].uptr); - gNB->prach_thres = *(L1_ParamList.paramarray[j][L1_PRACH_DTX_THRESHOLD].uptr); - gNB->pusch_thres = *(L1_ParamList.paramarray[j][L1_PUSCH_DTX_THRESHOLD].uptr); - gNB->srs_thres = *(L1_ParamList.paramarray[j][L1_SRS_DTX_THRESHOLD].uptr); - gNB->max_ldpc_iterations = *(L1_ParamList.paramarray[j][L1_MAX_LDPC_ITERATIONS].uptr); - gNB->L1_rx_thread_core = *(L1_ParamList.paramarray[j][L1_RX_THREAD_CORE].iptr); - gNB->L1_tx_thread_core = *(L1_ParamList.paramarray[j][L1_TX_THREAD_CORE].iptr); - LOG_I(NR_PHY, "L1_RX_THREAD_CORE %d (%d)\n", *(L1_ParamList.paramarray[j][L1_RX_THREAD_CORE].iptr), L1_RX_THREAD_CORE); - gNB->TX_AMP = min(32767.0 / pow(10.0, .05 * (double)(*L1_ParamList.paramarray[j][L1_TX_AMP_BACKOFF_dB].uptr)), INT16_MAX); - gNB->phase_comp = *L1_ParamList.paramarray[j][L1_PHASE_COMP].uptr; - gNB->dmrs_num_antennas_per_thread = *(L1_ParamList.paramarray[j][NUM_ANTENNAS_PER_THREAD].uptr); - gNB->enable_analog_das = *(L1_ParamList.paramarray[j][L1_ANALOG_DAS].uptr); - LOG_I(NR_PHY, "TX_AMP = %d (-%d dBFS)\n", gNB->TX_AMP, *L1_ParamList.paramarray[j][L1_TX_AMP_BACKOFF_dB].uptr); + gNB->ofdm_offset_divisor = *gpd(params, np, L1_OFDM_OFFSET_DIVISOR)->uptr; + gNB->pucch0_thres = *gpd(params, np, L1_PUCCH0_DTX_THRESHOLD)->uptr; + gNB->prach_thres = *gpd(params, np, L1_PRACH_DTX_THRESHOLD)->uptr; + gNB->pusch_thres = *gpd(params, np, L1_PUSCH_DTX_THRESHOLD)->uptr; + gNB->srs_thres = *gpd(params, np, L1_SRS_DTX_THRESHOLD)->uptr; + gNB->max_ldpc_iterations = *gpd(params, np, L1_MAX_LDPC_ITERATIONS)->uptr; + gNB->L1_rx_thread_core = *gpd(params, np, L1_RX_THREAD_CORE)->iptr; + gNB->L1_tx_thread_core = *gpd(params, np, L1_TX_THREAD_CORE)->iptr; + LOG_I(NR_PHY, "thread cores for L1_RX %d L1_TX %d\n", gNB->L1_rx_thread_core, gNB->L1_tx_thread_core); + gNB->TX_AMP = min(32767.0 / pow(10.0, .05 * (double)(*gpd(params, np, L1_TX_AMP_BACKOFF_dB)->uptr)), INT16_MAX); + LOG_I(NR_PHY, "TX_AMP = %d (-%d dBFS)\n", gNB->TX_AMP, *gpd(params, np, L1_TX_AMP_BACKOFF_dB)->uptr); AssertFatal(gNB->TX_AMP > 300, "TX_AMP is too small, must be larger than 300 (is %d)\n", gNB->TX_AMP); + gNB->phase_comp = *gpd(params, np, L1_PHASE_COMP)->uptr; + gNB->dmrs_num_antennas_per_thread = *gpd(params, np, L1_NUM_ANTENNAS_PER_THREAD)->uptr; + gNB->enable_analog_das = *gpd(params, np, L1_ANALOG_DAS)->uptr; // Midhaul configuration - if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_mac") == 0) { + if (strcmp(*gpd(params, np, L1_TRANSPORT_N_PREFERENCE)->strptr, "local_mac") == 0) { // do nothing - } else if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "nfapi") == 0) { - gNB->eth_params_n.my_addr = strdup(*(L1_ParamList.paramarray[j][L1_LOCAL_N_ADDRESS_IDX].strptr)); - gNB->eth_params_n.remote_addr = strdup(*(L1_ParamList.paramarray[j][L1_REMOTE_N_ADDRESS_IDX].strptr)); - gNB->eth_params_n.my_portc = *(L1_ParamList.paramarray[j][L1_LOCAL_N_PORTC_IDX].iptr); - gNB->eth_params_n.remote_portc = *(L1_ParamList.paramarray[j][L1_REMOTE_N_PORTC_IDX].iptr); - gNB->eth_params_n.my_portd = *(L1_ParamList.paramarray[j][L1_LOCAL_N_PORTD_IDX].iptr); - gNB->eth_params_n.remote_portd = *(L1_ParamList.paramarray[j][L1_REMOTE_N_PORTD_IDX].iptr); - gNB->eth_params_n.transp_preference = ETH_UDP_MODE; + } else if (strcmp(*gpd(params, np, L1_TRANSPORT_N_PREFERENCE)->strptr, "nfapi") == 0) { + char *my_addr = strdup(*gpd(params, np, L1_LOCAL_N_ADDRESS)->strptr); + char *remote_addr = strdup(*gpd(params, np, L1_REMOTE_N_ADDRESS)->strptr); + int remote_portc = *gpd(params, np, L1_REMOTE_N_PORTC)->iptr; + int my_portd = *gpd(params, np, L1_LOCAL_N_PORTD)->iptr; + int remote_portd = *gpd(params, np, L1_REMOTE_N_PORTD)->iptr; - configure_nr_nfapi_pnf(gNB->eth_params_n.remote_addr, - gNB->eth_params_n.remote_portc, - gNB->eth_params_n.my_addr, - gNB->eth_params_n.my_portd, - gNB->eth_params_n.remote_portd); + configure_nr_nfapi_pnf(remote_addr, remote_portc, my_addr, my_portd, remote_portd); } else { // other midhaul, do nothing } @@ -1517,7 +1513,7 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg) num_gnbs); // MAC / RLC - GET_PARAMS_LIST(MacRLC_ParamList, MacRLC_Params, MACRLCPARAMS_DESC, CONFIG_STRING_MACRLC_LIST, NULL, MACRLCPARAMS_CHECK); + GET_PARAMS_LIST(MacRLC_ParamList, MacRLC_Params, MACRLCPARAMS_DESC, MACRLC_LIST, NULL, MACRLCPARAMS_CHECK); nr_mac_config_t config = {0}; nr_pdsch_AntennaPorts_t *p = &config.pdsch_AntennaPorts; set_antenna_ports(&GNBParamList, &p->N1, &p->N2, &p->XP); @@ -1641,13 +1637,15 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg) nr_rlc_configuration_t default_rlc_config; config_rlc(cfg, &default_rlc_config); - config.pusch.target_snrx10 = *(MacRLC_ParamList.paramarray[0][MACRLC_PUSCHTARGETSNRX10_IDX].iptr); - config.pusch.rssi_threshold = *(MacRLC_ParamList.paramarray[0][MACRLC_PUSCH_RSSI_THRES_IDX].iptr); - config.pucch.rssi_threshold = *(MacRLC_ParamList.paramarray[0][MACRLC_PUCCH_RSSI_THRES_IDX].iptr); - config.pucch.target_snrx10 = *(MacRLC_ParamList.paramarray[0][MACRLC_PUCCHTARGETSNRX10_IDX].iptr); - config.ul_prbblack_SNR_threshold = *(MacRLC_ParamList.paramarray[0][MACRLC_UL_PRBBLACK_SNR_THRESHOLD_IDX].iptr); - config.pucch.failure_thres = *(MacRLC_ParamList.paramarray[0][MACRLC_PUCCHFAILURETHRES_IDX].iptr); - config.pusch.failure_thres = *(MacRLC_ParamList.paramarray[0][MACRLC_PUSCHFAILURETHRES_IDX].iptr); + const paramdef_t *params = MacRLC_ParamList.paramarray[0]; + const int np = sizeofArray(MacRLC_Params); + config.pusch.target_snrx10 = *gpd(params, np, MACRLC_PUSCHTARGETSNRX10)->iptr; + config.pusch.rssi_threshold = *gpd(params, np, MACRLC_PUSCH_RSSI_THRESHOLD)->iptr; + config.pucch.rssi_threshold = *gpd(params, np, MACRLC_PUCCH_RSSI_THRESHOLD)->iptr; + config.pucch.target_snrx10 = *gpd(params, np, MACRLC_PUCCHTARGETSNRX10)->iptr; + config.ul_prbblack_SNR_threshold = *gpd(params, np, MACRLC_UL_PRBBLACK_SNR_THRESHOLD)->iptr; + config.pucch.failure_thres = *gpd(params, np, MACRLC_PUCCHFAILURETHRES)->iptr; + config.pusch.failure_thres = *gpd(params, np, MACRLC_PUSCHFAILURETHRES)->iptr; LOG_I(NR_MAC, "PUSCH Target %d RSSI thresh %d Failure %d, PUCCH Target %d RSSI thresh %d Failure %d\n", @@ -1662,71 +1660,75 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg) mac_top_init_gNB(node_type, scc, &config, &default_rlc_config); for (j = 0; j < RC.nb_nr_macrlc_inst; j++) { - if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_RRC") == 0) { + params = MacRLC_ParamList.paramarray[j]; // RC.nb_nr_macrlc_inst == 1 as per assert, but keep consistent + if (strcmp(*gpd(params, np, MACRLC_TRANSPORT_N_PREFERENCE)->strptr, "local_RRC") == 0) { // check number of instances is same as RRC/PDCP - } else if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "f1") == 0 - || strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "cudu") == 0) { - char **f1caddr = MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_ADDRESS_IDX].strptr; + } else if (strcmp(*gpd(params, np, MACRLC_TRANSPORT_N_PREFERENCE)->strptr, "f1") == 0 + || strcmp(*gpd(params, np, MACRLC_TRANSPORT_N_PREFERENCE)->strptr, "cudu") == 0) { + char **f1caddr = gpd(params, np, MACRLC_LOCAL_N_ADDRESS)->strptr; RC.nrmac[j]->eth_params_n.my_addr = strdup(*f1caddr); - char **f1uaddr = MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_ADDRESS_F1U_IDX].strptr; + char **f1uaddr = gpd(params, np, MACRLC_LOCAL_N_ADDRESS_F1U)->strptr; RC.nrmac[j]->f1u_addr = f1uaddr != NULL ? strdup(*f1uaddr) : strdup(*f1caddr); - RC.nrmac[j]->eth_params_n.remote_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_ADDRESS_IDX].strptr)); - RC.nrmac[j]->eth_params_n.my_portc = *(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_PORTC_IDX].iptr); - RC.nrmac[j]->eth_params_n.remote_portc = *(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_PORTC_IDX].iptr); - RC.nrmac[j]->eth_params_n.my_portd = *(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_PORTD_IDX].iptr); - RC.nrmac[j]->eth_params_n.remote_portd = *(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_PORTD_IDX].iptr); + RC.nrmac[j]->eth_params_n.remote_addr = strdup(*gpd(params, np, MACRLC_REMOTE_N_ADDRESS)->strptr); + RC.nrmac[j]->eth_params_n.my_portc = 0; // not used + RC.nrmac[j]->eth_params_n.remote_portc = 0; // not used + RC.nrmac[j]->eth_params_n.my_portd = *gpd(params, np, MACRLC_LOCAL_N_PORTD)->iptr; + RC.nrmac[j]->eth_params_n.remote_portd = *gpd(params, np, MACRLC_REMOTE_N_PORTD)->iptr; RC.nrmac[j]->eth_params_n.transp_preference = ETH_UDP_MODE; } else { // other midhaul - AssertFatal(1 == 0, "MACRLC %d: %s unknown northbound midhaul\n", j, *(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr)); + AssertFatal(1 == 0, "MACRLC %d: %s unknown northbound midhaul\n", j, *gpd(params, np, MACRLC_TRANSPORT_N_PREFERENCE)->strptr); } - if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr), "local_L1") == 0) { - } else if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr), "nfapi") == 0) { - RC.nrmac[j]->eth_params_s.my_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_ADDRESS_IDX].strptr)); - RC.nrmac[j]->eth_params_s.remote_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_ADDRESS_IDX].strptr)); - RC.nrmac[j]->eth_params_s.my_portc = *(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_PORTC_IDX].iptr); - RC.nrmac[j]->eth_params_s.remote_portc = *(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_PORTC_IDX].iptr); - RC.nrmac[j]->eth_params_s.my_portd = *(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_PORTD_IDX].iptr); - RC.nrmac[j]->eth_params_s.remote_portd = *(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_PORTD_IDX].iptr); - RC.nrmac[j]->eth_params_s.transp_preference = ETH_UDP_MODE; - - configure_nr_nfapi_vnf(RC.nrmac[j]->eth_params_s); - } else if(strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr), "aerial") == 0){ + if (strcmp(*gpd(params, np, MACRLC_TRANSPORT_S_PREFERENCE)->strptr, "local_L1") == 0) { + } else if (strcmp(*gpd(params, np, MACRLC_TRANSPORT_S_PREFERENCE)->strptr, "nfapi") == 0) { + eth_params_t p = { + .my_addr = strdup(*gpd(params, np, MACRLC_LOCAL_S_ADDRESS)->strptr), + .remote_addr = strdup(*gpd(params, np, MACRLC_REMOTE_S_ADDRESS)->strptr), + .my_portc = *gpd(params, np, MACRLC_LOCAL_S_PORTC)->iptr, + .remote_portc = 0, // not used + .my_portd = *gpd(params, np, MACRLC_LOCAL_S_PORTD)->iptr, + .remote_portd = 0, // not used + }; + configure_nr_nfapi_vnf(p); + } else if(strcmp(*gpd(params, np, MACRLC_TRANSPORT_S_PREFERENCE)->strptr, "aerial") == 0){ #ifdef ENABLE_AERIAL - RC.nrmac[j]->nvipc_params_s.nvipc_shm_prefix = - strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_SHM_PREFIX].strptr)); - RC.nrmac[j]->nvipc_params_s.nvipc_poll_core = *(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_POLL_CORE].i8ptr); - LOG_I(GNB_APP, "Configuring VNF for Aerial connection with prefix %s\n", RC.nrmac[j]->eth_params_s.local_if_name); - configure_nr_nfapi_vnf(RC.nrmac[j]->eth_params_s); + nvipc_params_t nvipc_p = { + .nvipc_shm_prefix = strdup(*gpd(params, np, MACRLC_TRANSPORT_S_SHM_PREFIX)->strptr), + .nvipc_poll_core = *gpd(params, np, MACRLC_TRANSPORT_S_POLL_CORE)->i8ptr, + }; + RC.nrmac[j]->nvipc_params_s = nvipc_p; + LOG_I(GNB_APP, "Configuring VNF for Aerial connection with prefix %s\n", nvipc_p.nvipc_shm_prefix); + eth_params_t p = {0}; // not actually used but API requires it + configure_nr_nfapi_vnf(p); #endif } else { // other midhaul - AssertFatal(1 == 0, "MACRLC %d: %s unknown southbound midhaul\n", j, *(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr)); + AssertFatal(1 == 0, "MACRLC %d: %s unknown southbound midhaul\n", j, *gpd(params, np, MACRLC_TRANSPORT_S_PREFERENCE)->strptr); } - RC.nrmac[j]->ulsch_max_frame_inactivity = *(MacRLC_ParamList.paramarray[j][MACRLC_ULSCH_MAX_FRAME_INACTIVITY].uptr); - RC.nrmac[j]->stats_max_ue = *MacRLC_ParamList.paramarray[j][MACRLC_STATS_MAX_UE_IDX].iptr; + RC.nrmac[j]->ulsch_max_frame_inactivity = *gpd(params, np, MACRLC_ULSCH_MAX_FRAME_INACTIVITY)->uptr; + RC.nrmac[j]->stats_max_ue = *gpd(params, np, MACRLC_STATS_MAX_UE)->iptr; RC.nrmac[j]->print_ue_stats = RC.nrmac[j]->stats_max_ue > 0; NR_bler_options_t *dl_bler_options = &RC.nrmac[j]->dl_bler; - dl_bler_options->upper = *(MacRLC_ParamList.paramarray[j][MACRLC_DL_BLER_TARGET_UPPER_IDX].dblptr); - dl_bler_options->lower = *(MacRLC_ParamList.paramarray[j][MACRLC_DL_BLER_TARGET_LOWER_IDX].dblptr); - dl_bler_options->min_mcs = *(MacRLC_ParamList.paramarray[j][MACRLC_DL_MIN_MCS_IDX].u8ptr); - dl_bler_options->max_mcs = *(MacRLC_ParamList.paramarray[j][MACRLC_DL_MAX_MCS_IDX].u8ptr); + dl_bler_options->upper = *gpd(params, np, MACRLC_DL_BLER_TARGET_UPPER)->dblptr; + dl_bler_options->lower = *gpd(params, np, MACRLC_DL_BLER_TARGET_LOWER)->dblptr; + dl_bler_options->min_mcs = *gpd(params, np, MACRLC_DL_MIN_MCS)->u8ptr; + dl_bler_options->max_mcs = *gpd(params, np, MACRLC_DL_MAX_MCS)->u8ptr; if (config.disable_harq) dl_bler_options->harq_round_max = 1; else - dl_bler_options->harq_round_max = *(MacRLC_ParamList.paramarray[j][MACRLC_DL_HARQ_ROUND_MAX_IDX].u8ptr); + dl_bler_options->harq_round_max = *gpd(params, np, MACRLC_DL_HARQ_ROUND_MAX)->u8ptr; NR_bler_options_t *ul_bler_options = &RC.nrmac[j]->ul_bler; - ul_bler_options->upper = *(MacRLC_ParamList.paramarray[j][MACRLC_UL_BLER_TARGET_UPPER_IDX].dblptr); - ul_bler_options->lower = *(MacRLC_ParamList.paramarray[j][MACRLC_UL_BLER_TARGET_LOWER_IDX].dblptr); - ul_bler_options->min_mcs = *(MacRLC_ParamList.paramarray[j][MACRLC_UL_MIN_MCS_IDX].u8ptr); - ul_bler_options->max_mcs = *(MacRLC_ParamList.paramarray[j][MACRLC_UL_MAX_MCS_IDX].u8ptr); + ul_bler_options->upper = *gpd(params, np, MACRLC_UL_BLER_TARGET_UPPER)->dblptr; + ul_bler_options->lower = *gpd(params, np, MACRLC_UL_BLER_TARGET_LOWER)->dblptr; + ul_bler_options->min_mcs = *gpd(params, np, MACRLC_UL_MIN_MCS)->u8ptr; + ul_bler_options->max_mcs = *gpd(params, np, MACRLC_UL_MAX_MCS)->u8ptr; if (config.disable_harq) ul_bler_options->harq_round_max = 1; else - ul_bler_options->harq_round_max = *(MacRLC_ParamList.paramarray[j][MACRLC_UL_HARQ_ROUND_MAX_IDX].u8ptr); - RC.nrmac[j]->min_grant_prb = *(MacRLC_ParamList.paramarray[j][MACRLC_MIN_GRANT_PRB_IDX].u16ptr); - RC.nrmac[j]->identity_pm = *(MacRLC_ParamList.paramarray[j][MACRLC_IDENTITY_PM_IDX].u8ptr); + ul_bler_options->harq_round_max = *gpd(params, np, MACRLC_UL_HARQ_ROUND_MAX)->u8ptr; + RC.nrmac[j]->min_grant_prb = *gpd(params, np, MACRLC_MIN_GRANT_PRB)->u16ptr; + RC.nrmac[j]->identity_pm = *gpd(params, np, MACRLC_IDENTITY_PM)->u8ptr; // PRB Blacklist uint16_t prbbl[MAX_BWP_SIZE] = {0}; int num_ulprbbl = get_prb_blacklist(prbbl); @@ -1734,24 +1736,28 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg) LOG_I(NR_PHY, "Copying %d blacklisted PRB to L1 context\n", num_ulprbbl); memcpy(RC.nrmac[j]->ulprbbl, prbbl, MAX_BWP_SIZE * sizeof(prbbl[0])); } - RC.nrmac[j]->beam_info.beam_mode = config_get_processedint(cfg, &MacRLC_ParamList.paramarray[j][MACRLC_ANALOG_BEAMFORMING_IDX]); + // config_get_processedint() takes only paramdef_t *, so cast const away + paramdef_t *p_ab = (paramdef_t *)gpd(params, np, MACRLC_ANALOG_BEAMFORMING); + RC.nrmac[j]->beam_info.beam_mode = config_get_processedint(cfg, p_ab); if (RC.nrmac[j]->beam_info.beam_mode != NO_BEAM_MODE) { if (RC.nrmac[j]->beam_info.beam_mode == PRECONFIGURED_BEAM_IDX) AssertFatal(NFAPI_MODE == NFAPI_MONOLITHIC, "Analog beamforming only supported for monolithic scenario\n"); NR_beam_info_t *beam_info = &RC.nrmac[j]->beam_info; - int beams_per_period = *MacRLC_ParamList.paramarray[j][MACRLC_ANALOG_BEAMS_PERIOD_IDX].u8ptr; + int beams_per_period = *gpd(params, np, MACRLC_BEAMS_PERIOD)->u8ptr; beam_info->beam_allocation = malloc16(beams_per_period * sizeof(beam_info->beam_allocation)); - beam_info->beam_duration = *MacRLC_ParamList.paramarray[j][MACRLC_ANALOG_BEAM_DURATION_IDX].u8ptr; + beam_info->beam_duration = *gpd(params, np, MACRLC_BEAM_DURATION)->u8ptr; beam_info->beams_per_period = beams_per_period; beam_info->beam_allocation_size = -1; // to be initialized once we have information on frame configuration } bool das_enabled = false; if (NFAPI_MODE == NFAPI_MONOLITHIC) { GET_PARAMS_LIST(L1_ParamList, L1_Params, L1PARAMS_DESC, CONFIG_STRING_L1_LIST, NULL); - das_enabled = *(L1_ParamList.paramarray[j][L1_ANALOG_DAS].uptr); + const paramdef_t *l1_params = L1_ParamList.paramarray[j]; + const int l1_np = sizeofArray(L1_Params); + das_enabled = *gpd(l1_params, l1_np, L1_ANALOG_DAS)->uptr; } // TODO config_isparamset doesn't seem to work for array types, checking numelt instead - int n = MacRLC_ParamList.paramarray[j][MACRLC_BEAMWEIGHTS_IDX].numelt; + int n = gpd(params, np, MACRLC_BEAM_WEIGHTS_LIST)->numelt; if (n > 0) { AssertFatal(!das_enabled, "No need to set beam weights in case of DAS\n"); int num_beam = n; @@ -1766,9 +1772,9 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg) config.nb_bfw[1] = num_beam; // number of beams weights/indices config.bw_list = calloc_or_fail(n, sizeof(*config.bw_list)); for (int b = 0; b < n; b++) - config.bw_list[b] = MacRLC_ParamList.paramarray[j][MACRLC_BEAMWEIGHTS_IDX].iptr[b]; + config.bw_list[b] = gpd(params, np, MACRLC_BEAM_WEIGHTS_LIST)->iptr[b]; } else if (das_enabled) { - n = *MacRLC_ParamList.paramarray[j][MACRLC_ANALOG_BEAMS_PERIOD_IDX].u8ptr; + n = *gpd(params, np, MACRLC_BEAMS_PERIOD)->u8ptr; config.nb_bfw[0] = num_tx; // number of tx antennas config.nb_bfw[1] = n; // number of beams weights/indices config.bw_list = calloc_or_fail(n, sizeof(*config.bw_list)); @@ -1779,14 +1785,14 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg) config.bt.num_weights_per_beam = 0; config.bt.beam_ids = NULL; config.bt.beam_weights = NULL; - char **fptr = MacRLC_ParamList.paramarray[j][MACRLC_DBT_FILE_IDX].strptr; + char **fptr = gpd(params, np, MACRLC_DBT_FILE)->strptr; if (fptr && *fptr && **fptr != '\0') { LOG_I(GNB_APP, "loading DBT table from file %s\n", *fptr); config.bt.beam_weights = read_dbt_from_csv(*fptr, &config.bt.num_beams, &config.bt.num_weights_per_beam, &config.bt.beam_ids); } else { char prefix[MAX_OPTNAME_SIZE * 2 + 8]; - snprintf(prefix, sizeof(prefix), CONFIG_STRING_MACRLC_LIST ".[%d]", j); + snprintf(prefix, sizeof(prefix), MACRLC_LIST ".[%d]", j); config.bt.beam_weights = read_dbt_from_config(prefix, &config.bt.num_beams, &config.bt.num_weights_per_beam, &config.bt.beam_ids); } @@ -1820,8 +1826,8 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg) free(name); /* read_du_cell_info() allocated memory */ } else { // MacRLC_ParamList.numelt > 0 - LOG_E(PHY, "No %s configuration found\n", CONFIG_STRING_MACRLC_LIST); - // AssertFatal (0,"No " CONFIG_STRING_MACRLC_LIST " configuration found"); + LOG_E(PHY, "No %s configuration found\n", MACRLC_LIST); + // AssertFatal (0,"No " MACRLC_LIST " configuration found"); } } @@ -2297,7 +2303,7 @@ void NRRCConfig(void) RC.nb_nr_inst, NUMBER_OF_gNB_MAX); // Set num MACRLC instances - paramlist_def_t MACRLCParamList = {CONFIG_STRING_MACRLC_LIST, NULL, 0}; + paramlist_def_t MACRLCParamList = {MACRLC_LIST, NULL, 0}; config_getlist(config_get_if(), &MACRLCParamList, NULL, 0, NULL); RC.nb_nr_macrlc_inst = MACRLCParamList.numelt; @@ -2597,9 +2603,11 @@ ngran_node_t get_node_type(void) return ngran_gNB; // MAC/RLC params - GET_PARAMS_LIST(MacRLC_ParamList, MacRLC_Params, MACRLCPARAMS_DESC, CONFIG_STRING_MACRLC_LIST, NULL); + GET_PARAMS_LIST(MacRLC_ParamList, MacRLC_Params, MACRLCPARAMS_DESC, MACRLC_LIST, NULL); for (int j = 0; j < RC.nb_nr_macrlc_inst; j++) { - if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "f1") == 0) { + const paramdef_t *params = MacRLC_ParamList.paramarray[j]; + const int np = sizeofArray(MacRLC_Params); + if (strcmp(*gpd(params, np, MACRLC_TRANSPORT_N_PREFERENCE)->strptr, "f1") == 0) { return ngran_gNB_DU; // MACRLCs present in config: it must be a DU } } diff --git a/openair2/GNB_APP/gnb_config_ng.c b/openair2/GNB_APP/gnb_config_ng.c index 5ab77969c8..102b4efcf1 100644 --- a/openair2/GNB_APP/gnb_config_ng.c +++ b/openair2/GNB_APP/gnb_config_ng.c @@ -10,6 +10,7 @@ #include "common/config/config_paramdesc.h" #include "sctp_default_values.h" #include "gnb_paramdef.h" +#include "common/config/config_userapi.h" int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) { diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index 65f6dda1ca..8265303969 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -645,49 +645,6 @@ typedef enum { #define CONFIG_STRING_L1_LIST "L1s" -/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ -/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* MACRLC configuration section names */ -#define CONFIG_STRING_MACRLC_LIST "MACRLCs" - - -/* MACRLC configuration parameters names */ -#define CONFIG_STRING_MACRLC_CC "num_cc" -#define CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE "tr_n_preference" -#define CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS "local_n_address" -#define CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS "remote_n_address" -#define CONFIG_STRING_MACRLC_LOCAL_N_PORTC "local_n_portc" -#define CONFIG_STRING_MACRLC_REMOTE_N_PORTC "remote_n_portc" -#define CONFIG_STRING_MACRLC_LOCAL_N_PORTD "local_n_portd" -#define CONFIG_STRING_MACRLC_REMOTE_N_PORTD "remote_n_portd" -#define CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE "tr_s_preference" -#define CONFIG_STRING_MACRLC_TRANSPORT_S_SHM_PREFIX "tr_s_shm_prefix" -#define CONFIG_STRING_MACRLC_TRANSPORT_S_POLL_CORE "tr_s_poll_core" -#define CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS "local_s_address" -#define CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS "remote_s_address" -#define CONFIG_STRING_MACRLC_LOCAL_S_PORTC "local_s_portc" -#define CONFIG_STRING_MACRLC_REMOTE_S_PORTC "remote_s_portc" -#define CONFIG_STRING_MACRLC_LOCAL_S_PORTD "local_s_portd" -#define CONFIG_STRING_MACRLC_REMOTE_S_PORTD "remote_s_portd" - - -#define MACRLC_CC_IDX 0 -#define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1 -#define MACRLC_LOCAL_N_ADDRESS_IDX 2 -#define MACRLC_REMOTE_N_ADDRESS_IDX 3 -#define MACRLC_LOCAL_N_PORTC_IDX 4 -#define MACRLC_REMOTE_N_PORTC_IDX 5 -#define MACRLC_LOCAL_N_PORTD_IDX 6 -#define MACRLC_REMOTE_N_PORTD_IDX 7 -#define MACRLC_TRANSPORT_S_PREFERENCE_IDX 8 -#define MACRLC_LOCAL_S_ADDRESS_IDX 9 -#define MACRLC_REMOTE_S_ADDRESS_IDX 10 -#define MACRLC_LOCAL_S_PORTC_IDX 11 -#define MACRLC_REMOTE_S_PORTC_IDX 12 -#define MACRLC_LOCAL_S_PORTD_IDX 13 -#define MACRLC_REMOTE_S_PORTD_IDX 14 -#define MACRLC_SCHED_MODE_IDX 15 - /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /* security configuration */ /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue_sl.c b/openair2/LAYER2/NR_MAC_UE/config_ue_sl.c index f70eb83c32..b0ce4ffb1f 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue_sl.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue_sl.c @@ -172,10 +172,10 @@ static void sl_prepare_phy_config(int module_id, phycfg->sl_bwp_config.sl_start_symbol = (bwp_generic->sl_StartSymbol_r16) ? *bwp_generic->sl_StartSymbol_r16 : 0; - //0-EXTENDED, 1-NORMAL CP - phycfg->sl_bwp_config.sl_cyclic_prefix = (sl_bwp->cyclicPrefix) ? EXTENDED : NORMAL; + //0-NORMAL CP, 1-EXTENDED + phycfg->sl_bwp_config.sl_cyclic_prefix = (sl_bwp->cyclicPrefix) ? 1 : 0; - AssertFatal(phycfg->sl_bwp_config.sl_cyclic_prefix == NORMAL, "Only NORMAL-CP Supported. Ext CP not yet supported\n"); + AssertFatal(phycfg->sl_bwp_config.sl_cyclic_prefix == 0, "Only NORMAL-CP Supported. Ext CP not yet supported\n"); AssertFatal(phycfg->sl_bwp_config.sl_start_symbol >= 0 && phycfg->sl_bwp_config.sl_start_symbol <=7, diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 9d725418ae..224887252d 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -13,6 +13,7 @@ #include #include #include "common/platform_types.h" +#include "common/utils/threadPool/notified_fifo.h" /* IF */ #include "NR_IF_Module.h" @@ -405,7 +406,7 @@ typedef struct { typedef struct { /// SSB RSRP in dBm int ssb_rsrp_dBm; - float_t ssb_sinr_dB; + float ssb_sinr_dB; } NR_SSB_meas_t; typedef struct { diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_power_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_power_procedures.c index d29e0c6bfa..66c5104458 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_power_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_power_procedures.c @@ -14,7 +14,7 @@ // TODO: This should be part of mac instance /* TS 38.213 9.2.5.2 UE procedure for multiplexing HARQ-ACK/SR and CSI in a PUCCH */ /* this is a counter of number of pucch format 4 per subframe */ -static int nb_pucch_format_4_in_subframes[LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] = {0}; +static int nb_pucch_format_4_in_subframes[NR_NUMBER_OF_SUBFRAMES_PER_FRAME] = {0}; /* TS 38.211 Table 6.4.1.3.3.2-1: DM-RS positions for PUCCH format 3 and 4 */ static const int nb_symbols_excluding_dmrs[11][2][2] diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 035b750745..15c59716be 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -2552,7 +2552,7 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info) // Schedule ULSCH only if the current frame and slot match those in ul_config_req // AND if a UL grant (UL DCI or Msg3) has been received (as indicated by num_pdus) - uint8_t ulsch_input_buffer_array[NFAPI_MAX_NUM_UL_PDU][MAX_ULSCH_PAYLOAD_BYTES]; + uint8_t ulsch_input_buffer_array[FAPI_NR_UL_CONFIG_LIST_NUM][MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER * NR_MAX_NB_LAYERS * 1056]; int number_of_pdus = 0; fapi_nr_ul_config_request_pdu_t *ulcfg_pdu = lockGet_ul_iterator(mac, frame_tx, slot_tx); diff --git a/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_power_procedures.cpp b/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_power_procedures.cpp index a6b051a7c2..c6ac903a4c 100644 --- a/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_power_procedures.cpp +++ b/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_power_procedures.cpp @@ -691,7 +691,7 @@ TEST(test_srs_power, tpc_accumulation) int main(int argc, char** argv) { logInit(); - uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY); + load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY); g_log->log_component[MAC].level = OAILOG_DEBUG; g_log->log_component[NR_MAC].level = OAILOG_DEBUG; testing::InitGoogleTest(&argc, argv); diff --git a/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_ra_procedures.cpp b/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_ra_procedures.cpp index 296d1e2ab6..47c7ad4027 100644 --- a/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_ra_procedures.cpp +++ b/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_ra_procedures.cpp @@ -134,7 +134,7 @@ TEST(test_init_ra, four_step_cfra) int main(int argc, char **argv) { logInit(); - uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY); + load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY); g_log->log_component[MAC].level = OAILOG_DEBUG; g_log->log_component[NR_MAC].level = OAILOG_DEBUG; testing::InitGoogleTest(&argc, argv); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c index 53da2d310e..7d5efc04d3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c +++ b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c @@ -18,6 +18,7 @@ static f1ap_net_config_t read_DU_IP_config(const eth_params_t* f1_params, const char *f1u_ip_addr) { + AssertFatal(f1_params->my_portc == 0 && f1_params->remote_portc == 0, "portc not supported, must be 0\n"); f1ap_net_config_t nc = {0}; nc.CU_f1_ip_address= strdup(f1_params->remote_addr); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index d66df35f6d..f7ea466a94 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -906,8 +906,6 @@ typedef struct gNB_MAC_INST_s { eth_params_t eth_params_n; /// address for F1U to bind, ports in eth_params_n char *f1u_addr; - /// Ethernet parameters for fronthaul interface - eth_params_t eth_params_s; /// Nvipc parameters for FAPI interface with Aerial nvipc_params_t nvipc_params_s; /// Module diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h index 6fedbd430e..af9d027566 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h @@ -26,6 +26,7 @@ #include "LTE_PMCH-InfoList-r9.h" #include "openair3/SECU/secu_defs.h" +#include "common/utils/threadPool/notified_fifo.h" #define MAX_NUMBER_NETIF 1 //16 #define ENB_NAS_USE_TUN_W_MBMS_BIT (1<< 10) diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.h b/openair2/PHY_INTERFACE/phy_stub_UE.h index c0de476ad9..efc0371752 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.h +++ b/openair2/PHY_INTERFACE/phy_stub_UE.h @@ -12,6 +12,7 @@ #include #include "openair2/PHY_INTERFACE/IF_Module.h" +#include "PHY/defs_eNB.h" #include "nfapi_interface.h" #include "nfapi_pnf_interface.h" #include diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index 3a7b453bd0..c2e326d9cb 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -2819,8 +2819,6 @@ int decode_SIB1( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index, UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIB1systemInfoValueTag = sib1->systemInfoValueTag; if (!IS_SOFTMODEM_NOS1) { - int cell_valid = 0; - if (sib1->cellAccessRelatedInfo.cellBarred == LTE_SystemInformationBlockType1__cellAccessRelatedInfo__cellBarred_notBarred) { /* Cell is not barred */ int plmn; @@ -2863,24 +2861,11 @@ int decode_SIB1( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index, NAS_CELL_SELECTION_CNF (msg_p).rsrq = rsrq; NAS_CELL_SELECTION_CNF (msg_p).rsrp = rsrp; itti_send_msg_to_task(TASK_NAS_UE, ctxt_pP->instance, msg_p); - cell_valid = 1; UE_rrc_inst[ctxt_pP->module_id].selected_plmn_identity = plmn + 1; break; } } } - - if (cell_valid == 0) { - /* Cell can not be used, ask PHY to try the next one */ - MessageDef *msg_p; - msg_p = itti_alloc_new_message(TASK_RRC_UE, 0, PHY_FIND_NEXT_CELL_REQ); - itti_send_msg_to_task(TASK_PHY_UE, ctxt_pP->instance, msg_p); - LOG_E(RRC, - "Synched with a cell, but PLMN doesn't match our SIM " - "(selected_plmn_identity %d), the message PHY_FIND_NEXT_CELL_REQ " - "is sent but lost in current UE implementation!\n", - UE_rrc_inst[ctxt_pP->module_id].selected_plmn_identity); - } } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SIB1, VCD_FUNCTION_OUT ); @@ -4457,11 +4442,7 @@ void *rrc_ue_task( void *args_p ) { case RRC_STATE_IDLE: { /* Ask to layer 1 to find a cell matching the criterion */ - MessageDef *message_p; - message_p = itti_alloc_new_message(TASK_RRC_UE, 0, PHY_FIND_CELL_REQ); - PHY_FIND_CELL_REQ (message_p).earfcn_start = 1; - PHY_FIND_CELL_REQ (message_p).earfcn_end = 1; - itti_send_msg_to_task(TASK_PHY_UE, UE_MODULE_ID_TO_INSTANCE(ue_mod_id), message_p); + LOG_W(RRC, "PHY_FIND_CELL_REQ message to L1/PHY not implemented\n"); rrc_set_sub_state (ue_mod_id, RRC_SUB_STATE_IDLE_SEARCHING); break; } diff --git a/openair2/RRC/LTE/rrc_common.c b/openair2/RRC/LTE/rrc_common.c index 8ca158537f..e37c7a4da7 100644 --- a/openair2/RRC/LTE/rrc_common.c +++ b/openair2/RRC/LTE/rrc_common.c @@ -9,7 +9,6 @@ #include "rrc_defs.h" #include "rrc_extern.h" #include "LAYER2/MAC/mac_extern.h" -#include "COMMON/openair_defs.h" #include "common/platform_types.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" #include "LAYER2/RLC/rlc.h" diff --git a/openair2/RRC/LTE/utils.c b/openair2/RRC/LTE/utils.c deleted file mode 100644 index 016039cdf8..0000000000 --- a/openair2/RRC/LTE/utils.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * SPDX-License-Identifier: LicenseRef-CSSL-1.0 - */ - -#include "defs.h" -#include "extern.h" - - -//------------------------------------------------------------------------------------------------------------------// -uint16_t find_free_dtch_position(uint8_t Mod_id, uint16_t UE_CH_index) { - uint16_t i,j; - - if(UE_CH_index==0) { - j=0; - } else { - j=1; - } - - for(i=j; imacphy_exit("NO FREE DTCH LCHAN, exit"); - return 0; -} - -//-------------------------------------------------------------------------------------------// -uint8_t rrc_find_free_ue_index(uint8_t Mod_id) { - //-------------------------------------------------------------------------------------------// - uint16_t i; - - for(i=1; i<=NB_CNX_CH; i++) - if ( (CH_rrc_inst[Mod_id].Info.UE_info[i][0] == 0) && - (CH_rrc_inst[Mod_id].Info.UE_info[i][1] == 0) && - (CH_rrc_inst[Mod_id].Info.UE_info[i][2] == 0) && - (CH_rrc_inst[Mod_id].Info.UE_info[i][3] == 0) && - (CH_rrc_inst[Mod_id].Info.UE_info[i][4] == 0)) { - return i; - } - - return 0xff; -} - - -//-------------------------------------------------------------------------------------------// -unsigned short rrc_find_ue_index(unsigned char Mod_id, L2_ID Mac_id) { - //-------------------------------------------------------------------------------------------// - unsigned char i; - /* - for(i=0;i<=NB_CNX_CH;i++) - if( bcmp(Mac_id.L2_id,CH_rrc_inst[Mod_id].Info.UE_info[i].L2_id,sizeof(L2_ID))==0) - return i; - return i; - */ -} -//-------------------------------------------------------------------------------------------// -uint8_t rrc_is_node_isolated(uint8_t Mod_id) { - //-------------------------------------------------------------------------------------------// - /*uint8_t i; - for(i=0;iHeader->Rv_tb_idx=0; - // Rrc_buffer->W_idx=0; - //Rrc_buffer->R_idx=0; -} diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 2d876cce25..8cf5fb1378 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -166,7 +166,8 @@ static bool rrc_delay_transaction(instance_t instance, MessageDef *msg_p) AssertFatal(cu_ue_id > 0, "cu_ue_id not found in message %s\n", ITTI_MSG_NAME(msg_p)); rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[instance], cu_ue_id); - DevAssert(ue_context_p); + if (!ue_context_p) + return false; // nothing to delay gNB_RRC_UE_t *UE = &ue_context_p->ue_context; bool delay = UE->delayed_action.ongoing_transaction && UE->delayed_action.max_delays > 0; @@ -3041,7 +3042,10 @@ void rrc_gNB_process_e1_bearer_context_setup_resp(e1ap_bearer_setup_resp_t *resp { gNB_RRC_INST *rrc = RC.nrrrc[0]; rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_get_ue_context(rrc, resp->gNB_cu_cp_ue_id); - AssertFatal(ue_context_p != NULL, "did not find UE with CU UE ID %d\n", resp->gNB_cu_cp_ue_id); + if (ue_context_p == NULL) { + LOG_E(NR_RRC, "no UE with CU-CP UE ID %d found\n", resp->gNB_cu_cp_ue_id); + return; + } gNB_RRC_UE_t *UE = &ue_context_p->ue_context; // currently: we don't have "infrastructure" to save the CU-UP UE ID, so we diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index f2971f199b..035447be55 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -354,7 +354,9 @@ bool trigger_bearer_setup(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, int n, pdusession return false; } AssertFatal(UE->as_security_active, "logic bug: security should be active when activating DRBs\n"); - e1ap_bearer_setup_req_t bearer_req = {0}; + e1ap_bearer_setup_req_t bearer_req = { + .gNB_cu_cp_ue_id = UE->rrc_ue_id, + }; // Reject bearers setup if there's no CU-UP associated if (!is_cuup_associated(rrc)) { @@ -412,6 +414,10 @@ bool trigger_bearer_setup(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, int n, pdusession pdu->DRBnGRanList[0] = fill_e1_drb_to_setup(rrc_drb, session, rrc->configuration.um_on_default_drb, UE->redcap_cap); } } + if (bearer_req.numPDUSessions == 0) { + LOG_W(NR_RRC, "UE %d: No PDU sessions to setup, skipping bearer context setup\n", UE->rrc_ue_id); + return false; + } /* Limitation: we assume one fixed CU-UP per UE. We base the selection on * NSSAI, but the UE might have multiple PDU sessions with differing slices, * in which we might need to select different CU-UPs. In this case, we would diff --git a/openair2/UTIL/OPT/probe.c b/openair2/UTIL/OPT/probe.c index eb522d4bd4..45743bb9be 100644 --- a/openair2/UTIL/OPT/probe.c +++ b/openair2/UTIL/OPT/probe.c @@ -466,6 +466,7 @@ static void SendFrameNR(guint8 radioType, ws_trace_t *t) #include extern RAN_CONTEXT_t RC; #include +#include "openair1/PHY/defs_eNB.h" /* Remote serveraddress (where Wireshark is running) */ void trace_pdu_implementation(ws_trace_t *t) diff --git a/openair3/COMMON/messages_types.h b/openair3/COMMON/messages_types.h deleted file mode 100644 index de270ae027..0000000000 --- a/openair3/COMMON/messages_types.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * SPDX-License-Identifier: LicenseRef-CSSL-1.0 - */ - -#ifndef MESSAGES_TYPES_H_ -#define MESSAGES_TYPES_H_ - -#include "intertask_messages_types.h" -#include "timer_messages_types.h" - -#include "security_types.h" - -#include "gtpv1_u_messages_types.h" -#include "ip_forward_messages_types.h" -#include "s11_messages_types.h" -#include "s1ap_messages_types.h" -#include "nas_messages_types.h" -#include "s6a_messages_types.h" -#include "sctp_messages_types.h" -#include "sgw_lite_messages_types.h" -#include "udp_messages_types.h" -#include "mme_app_messages_types.h" -#include "m2ap_messages_types.h" -#include "ngap_messages_types.h" - - -#endif /* MESSAGES_TYPES_H_ */ diff --git a/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSMobileIdentity.c b/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSMobileIdentity.c index 6dec4a0fd5..a342ccd5a4 100644 --- a/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSMobileIdentity.c +++ b/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSMobileIdentity.c @@ -17,7 +17,7 @@ static int decode_guti_5gs_mobile_identity(Guti5GSMobileIdentity_t *guti, const uint8_t *buffer); static int encode_guti_5gs_mobile_identity(const Guti5GSMobileIdentity_t *guti, uint8_t *buffer); -static int encode_suci_5gs_mobile_identity(const Suci5GSMobileIdentity_t *suci, uint8_t *buffer); +static int encode_suci_5gs_mobile_identity(const Suci5GSMobileIdentity_t *suci, uint8_t *buffer, uint32_t len); static int encode_imeisv_5gs_mobile_identity(const Imeisv5GSMobileIdentity_t *imeisv, uint8_t *buffer); int encode_stmsi_5gs_mobile_identity(uint8_t *buffer, const Stmsi5GSMobileIdentity_t *stmsi, uint32_t len) @@ -121,7 +121,7 @@ int encode_5gs_mobile_identity(const FGSMobileIdentity *fgsmobileidentity, uint8 } if (fgsmobileidentity->suci.typeofidentity == FGS_MOBILE_IDENTITY_SUCI) { - encoded_rc = encode_suci_5gs_mobile_identity(&fgsmobileidentity->suci, buffer + encoded); + encoded_rc = encode_suci_5gs_mobile_identity(&fgsmobileidentity->suci, buffer + encoded, len); } if (fgsmobileidentity->imeisv.typeofidentity == FGS_MOBILE_IDENTITY_IMEISV) { @@ -218,9 +218,13 @@ static int encode_guti_5gs_mobile_identity(const Guti5GSMobileIdentity_t *guti, return encoded; } -static int encode_suci_5gs_mobile_identity(const Suci5GSMobileIdentity_t *suci, uint8_t *buffer) +static int encode_suci_5gs_mobile_identity(const Suci5GSMobileIdentity_t *suci, uint8_t *buffer, uint32_t len) { uint32_t encoded = 0; + + if (len < 8) + return -1; + *(buffer + encoded) = (suci->supiformat << 4) | (suci->typeofidentity); encoded++; *(buffer + encoded) = ((suci->mccdigit2 & 0xf) << 4) | (suci->mccdigit1 & 0xf); @@ -242,15 +246,34 @@ static int encode_suci_5gs_mobile_identity(const Suci5GSMobileIdentity_t *suci, *(buffer + encoded) = suci->homenetworkpki; encoded++; - const char *ptr = suci->schemeoutput; - while (ptr < suci->schemeoutput + strlen(suci->schemeoutput)) { - buffer[encoded] = ((*(ptr + 1) - '0') << 4) | (*(ptr) - '0'); - encoded++; - ptr += 2; - } + DevAssert(suci->schemeoutput); + size_t rawlen = strlen(suci->schemeoutput); + size_t outlen = (rawlen + 1) / 2; - if (strlen(suci->schemeoutput) % 2 == 1) - buffer[encoded++] = ((*(ptr - 1) - '0')) | 0xF0; + if (len - encoded < outlen) + return -1; + + if (suci->protectionschemeId == 0) { + AssertFatal(suci->homenetworkpki == 0, + "Invalid SUCI: homenetworkpki=%u with null protection scheme (must be 0)\n", + suci->homenetworkpki); + int rc = digit_string_to_bcd_value(buffer + encoded, suci->schemeoutput, outlen); + AssertFatal(rc == 0, + "BCD encoding failed (rc=%d, input=\"%s\", len=%zu, out_len=%zu)\n", + rc, + suci->schemeoutput, + rawlen, + outlen); + } else { + int rc = hex_string_to_hex_value(buffer + encoded, suci->schemeoutput, outlen); + AssertFatal(rc == 0, + "Encoding SUCI schemeoutput failed (rc=%d, input=\"%s\", len=%zu, out_len=%zu)\n", + rc, + suci->schemeoutput, + rawlen, + outlen); + } + encoded += outlen; return encoded; } diff --git a/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSMobileIdentity.h b/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSMobileIdentity.h index c9d29370f9..8cf8b1bc63 100644 --- a/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSMobileIdentity.h +++ b/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSMobileIdentity.h @@ -41,7 +41,7 @@ typedef struct { uint8_t spare6: 1; uint8_t protectionschemeId: 4; uint8_t homenetworkpki; - char schemeoutput[32]; + char schemeoutput[128]; } Suci5GSMobileIdentity_t; typedef struct { diff --git a/openair3/NAS/NR_UE/nr_nas_msg.c b/openair3/NAS/NR_UE/nr_nas_msg.c index 7f94b2a747..c6d227294d 100644 --- a/openair3/NAS/NR_UE/nr_nas_msg.c +++ b/openair3/NAS/NR_UE/nr_nas_msg.c @@ -9,6 +9,7 @@ #include "nr_nas_msg.h" #include #include "NR_NAS_defs.h" +#include #include #include #include @@ -53,6 +54,18 @@ #include "key_nas_deriver.h" #include "nr-uesoftmodem.h" +#if OPENSSL_VERSION_NUMBER >= 0x30000000L +#include "curve_25519.h" +#include "aes_128_ctr.h" +#include "x963_kdf.h" +#include "sha_256_hmac.h" +static const char hex[] = "0123456789abcdef"; +#elif OPENSSL_VERSION_NUMBER >= 0x10100000L +#define MY_OPENSSL_VERSION_STR OpenSSL_version(OPENSSL_VERSION) +#else +#define MY_OPENSSL_VERSION_STR SSLeay_version(SSLEAY_VERSION) +#endif + static nr_ue_nas_t nr_ue_nas[MAX_NUM_NR_UE_INST] = {0}; nr_ue_nas_t *get_nr_ue_nas_info(uint8_t ue_inst) @@ -388,6 +401,83 @@ static security_state_t nas_security_rx_process(nr_ue_nas_t *nas, byte_array_t b return NAS_SECURITY_INTEGRITY_PASSED; } +static void suci_profile_scheme_a_generate_output(const uint8_t home_network_public_key[32], + const char *msin, + const size_t msin_len, + char *schemeoutput) +{ + /* 1> Eph. key pair generation */ + uint8_t eph_priv[32] = {0}; + uint8_t eph_pub[32] = {0}; + x25519_generate_keypair(eph_priv, eph_pub); + + /* 2> Key agreement */ + uint8_t eph_shared_key[32] = {0}; + x25519_shared_secret(eph_priv, home_network_public_key, eph_shared_key); + + explicit_bzero(eph_priv, 32); + + /* 3> Key derivation */ + uint8_t kdf_output[64] = {0}; + byte_array_t kdf_secret = {.buf = eph_shared_key, .len = 32}; + byte_array_t kdf_info = {.buf = eph_pub, .len = 32}; + x963_kdf(kdf_secret, kdf_info, 64, kdf_output); + + explicit_bzero(eph_shared_key, 32); + + aes_128_t aes_ctx; + aes_ctx.type = AES_INITIALIZATION_VECTOR_16; + memcpy(aes_ctx.key, kdf_output, 16); + memcpy(aes_ctx.iv16.iv, kdf_output + 16, 16); + + uint8_t eph_mac_key[32] = {0}; + memcpy(eph_mac_key, kdf_output + 32, 32); + + explicit_bzero(kdf_output, 64); + + /* 4> Symmetric encryption */ + size_t msin_bcd_len = (msin_len + 1) / 2; + uint8_t msin_bcd[msin_bcd_len]; + memset(msin_bcd, 0, msin_bcd_len); + + int rc = digit_string_to_bcd_value(msin_bcd, msin, msin_bcd_len); + AssertFatal(rc == 0, "Encoding MSIN failed (rc=%d, input=\"%s\", len=%zu, out_len=%zu)", rc, msin, msin_len, msin_bcd_len); + + byte_array_t payload = {.buf = msin_bcd, .len = msin_bcd_len}; + uint8_t ciphertext[msin_bcd_len]; + aes_128_ctr(&aes_ctx, payload, msin_bcd_len, ciphertext); + + explicit_bzero(aes_ctx.key, 16); + explicit_bzero(aes_ctx.iv16.iv, 16); + explicit_bzero(msin_bcd, msin_bcd_len); + + /* 5> MAC function */ + uint8_t mac_full[32] = {0}; + byte_array_t mac_input = {.buf = ciphertext, .len = msin_bcd_len}; + sha_256_hmac(eph_mac_key, mac_input, 32, mac_full); + + explicit_bzero(eph_mac_key, 32); + + /* Build SUCI scheme output --- */ + /* eph_pub (32 bytes -> 64 hex chars) */ + for (int i = 0; i < 32; i++) { + *schemeoutput++ = hex[eph_pub[i] >> 4]; + *schemeoutput++ = hex[eph_pub[i] & 0x0F]; + } + + /* ciphertext (~45 bytes -> ~90 hex chars) */ + for (int i = 0; i < msin_bcd_len; i++) { + *schemeoutput++ = hex[ciphertext[i] >> 4]; + *schemeoutput++ = hex[ciphertext[i] & 0x0F]; + } + + /* MAC (8 bytes -> 16 hex chars) */ + for (int i = 0; i < 8; i++) { + *schemeoutput++ = hex[mac_full[i] >> 4]; + *schemeoutput++ = hex[mac_full[i] & 0x0F]; + } +} + static int fill_suci(FGSMobileIdentity *mi, const uicc_t *uicc) { mi->suci.typeofidentity = FGS_MOBILE_IDENTITY_SUCI; @@ -397,7 +487,50 @@ static int fill_suci(FGSMobileIdentity *mi, const uicc_t *uicc) mi->suci.mccdigit1 = uicc->imsiStr[0] - '0'; mi->suci.mccdigit2 = uicc->imsiStr[1] - '0'; mi->suci.mccdigit3 = uicc->imsiStr[2] - '0'; - memcpy(mi->suci.schemeoutput, uicc->imsiStr + 3 + uicc->nmc_size, strlen(uicc->imsiStr) - (3 + uicc->nmc_size)); + + mi->suci.routingindicatordigit1 = uicc->routing_indicatorStr[0] - '0'; + mi->suci.routingindicatordigit2 = uicc->routing_indicatorStr[1] - '0'; + mi->suci.routingindicatordigit3 = uicc->routing_indicatorStr[2] - '0'; + mi->suci.routingindicatordigit4 = uicc->routing_indicatorStr[3] - '0'; + + char *msin = uicc->imsiStr + 3 + uicc->nmc_size; + uint8_t msin_len = strlen(msin); + + mi->suci.protectionschemeId = uicc->protection_scheme; + switch (uicc->protection_scheme) { + case 0: /* Null scheme (TS 33.501 C.2) */ + { + mi->suci.homenetworkpki = 0; + memcpy(mi->suci.schemeoutput, msin, msin_len); + break; + } + case 1: /* Profile A (TS 33.501 C.3.4.1) */ + { +#if OPENSSL_VERSION_NUMBER >= 0x30000000L + mi->suci.homenetworkpki = uicc->home_network_public_key_id; + suci_profile_scheme_a_generate_output(uicc->home_network_public_key, msin, msin_len, mi->suci.schemeoutput); +#else + AssertFatal(false, + "Protection Scheme not supported when using a version below OpenSSL 3.0 %d (OpenSSL version: %s)\n", + uicc->protection_scheme, + MY_OPENSSL_VERSION_STR); +#endif + break; + } + case 2: /* Profile B (TS 33.501 C.3.4.2) */ + { + mi->suci.homenetworkpki = uicc->home_network_public_key_id; + + AssertFatal(false, "Unsupported Protection Scheme in UICC %d\n", uicc->protection_scheme); + + break; + } + default: // Unknown schemes + { + AssertFatal(false, "Unknown Protection Scheme in UICC %d\n", uicc->protection_scheme); + } + } + LOG_D(NAS, "SUCI in registration request: SUPI type: %d Type of Identity: %u MCC: %u%u%u, MNC: %u%u%u, \ Routing Indicator %d%d%d%d Protection Scheme ID: %u, Home Network PKI: %u, Scheme Output: %s\n", diff --git a/openair3/NRPPA/nrppa_gNB_config.c b/openair3/NRPPA/nrppa_gNB_config.c index ba6771fe1a..eaafb3b954 100644 --- a/openair3/NRPPA/nrppa_gNB_config.c +++ b/openair3/NRPPA/nrppa_gNB_config.c @@ -8,6 +8,7 @@ #include "openair1/PHY/defs_gNB.h" #include "common/ran_context.h" #include "positioning_nr_paramdef.h" +#include "common/config/config_userapi.h" positioning_config_t RCconfig_nr_positioning(void) { diff --git a/openair3/SECU/curve_25519.c b/openair3/SECU/curve_25519.c new file mode 100644 index 0000000000..64553259bd --- /dev/null +++ b/openair3/SECU/curve_25519.c @@ -0,0 +1,74 @@ +/* + * SPDX-License-Identifier: LicenseRef-CSSL-1.0 + */ + +#include "curve_25519.h" + +#if OPENSSL_VERSION_NUMBER >= 0x30000000L + +/* code for version 3.0 or greater */ + +#include "common/utils/assertions.h" + +#include +#include + +void x25519_generate_keypair(uint8_t priv[32], uint8_t pub[32]) +{ + DevAssert(priv != NULL); + DevAssert(pub != NULL); + + EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_X25519, NULL); + DevAssert(pctx != NULL); + + int rc = EVP_PKEY_keygen_init(pctx); + DevAssert(rc == 1); + + EVP_PKEY *pkey = NULL; + rc = EVP_PKEY_keygen(pctx, &pkey); + DevAssert(rc == 1); + + EVP_PKEY_CTX_free(pctx); + + size_t len = 32; + + rc = EVP_PKEY_get_raw_private_key(pkey, priv, &len); + DevAssert(rc == 1 && len == 32); + + rc = EVP_PKEY_get_raw_public_key(pkey, pub, &len); + DevAssert(rc == 1 && len == 32); + + EVP_PKEY_free(pkey); +} + +void x25519_shared_secret(const uint8_t priv[32], const uint8_t peer_pub[32], uint8_t secret[32]) +{ + DevAssert(priv != NULL); + DevAssert(peer_pub != NULL); + DevAssert(secret != NULL); + + EVP_PKEY *pkey = EVP_PKEY_new_raw_private_key(EVP_PKEY_X25519, NULL, priv, 32); + DevAssert(pkey != NULL); + + EVP_PKEY *peerkey = EVP_PKEY_new_raw_public_key(EVP_PKEY_X25519, NULL, peer_pub, 32); + DevAssert(peerkey != NULL); + + EVP_PKEY_CTX *ctx = EVP_PKEY_CTX_new(pkey, NULL); + DevAssert(ctx != NULL); + + int rc = EVP_PKEY_derive_init(ctx); + DevAssert(rc == 1); + + rc = EVP_PKEY_derive_set_peer(ctx, peerkey); + DevAssert(rc == 1); + + size_t len = 32; + rc = EVP_PKEY_derive(ctx, secret, &len); + DevAssert(rc == 1 && len == 32); + + EVP_PKEY_free(pkey); + EVP_PKEY_free(peerkey); + EVP_PKEY_CTX_free(ctx); +} + +#endif \ No newline at end of file diff --git a/openair3/SECU/curve_25519.h b/openair3/SECU/curve_25519.h new file mode 100644 index 0000000000..e49f2be8c7 --- /dev/null +++ b/openair3/SECU/curve_25519.h @@ -0,0 +1,23 @@ +/* + * SPDX-License-Identifier: LicenseRef-CSSL-1.0 + */ + +#ifndef CURVE_25519_OAI_H +#define CURVE_25519_OAI_H + +#include + +#if OPENSSL_VERSION_NUMBER >= 0x30000000L + +/* code for version 3.0 or greater */ + +#include +#include + +void x25519_generate_keypair(uint8_t priv[32], uint8_t pub[32]); + +void x25519_shared_secret(const uint8_t priv[32], const uint8_t peer_pub[32], uint8_t secret[32]); + +#endif + +#endif \ No newline at end of file diff --git a/openair3/SECU/x963_kdf.c b/openair3/SECU/x963_kdf.c new file mode 100644 index 0000000000..332ca38b2a --- /dev/null +++ b/openair3/SECU/x963_kdf.c @@ -0,0 +1,49 @@ +/* + * SPDX-License-Identifier: LicenseRef-CSSL-1.0 + */ + +#include "x963_kdf.h" + +#if OPENSSL_VERSION_NUMBER >= 0x30000000L + +/* code for version 3.0 or greater */ + +#include +#include "common/utils/assertions.h" +#include +#include +#include + +void x963_kdf(const byte_array_t sharedsecret, const byte_array_t sharedinfo, size_t len, uint8_t out[len]) +{ + DevAssert(sharedsecret.buf != NULL); + DevAssert(sharedsecret.len > 0); + DevAssert(out != NULL); + DevAssert(len > 0); + + EVP_KDF *kdf = EVP_KDF_fetch(NULL, "X963KDF", NULL); + DevAssert(kdf != NULL); + + EVP_KDF_CTX *kctx = EVP_KDF_CTX_new(kdf); + DevAssert(kctx != NULL); + + EVP_KDF_free(kdf); + + OSSL_PARAM params[4], *p = params; + + *p++ = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_DIGEST, SN_sha256, strlen(SN_sha256)); + *p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_KEY, sharedsecret.buf, sharedsecret.len); + + if (sharedinfo.buf != NULL && sharedinfo.len > 0) { + *p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_INFO, sharedinfo.buf, sharedinfo.len); + } + + *p = OSSL_PARAM_construct_end(); + + int rc = EVP_KDF_derive(kctx, out, len, params); + DevAssert(rc == 1); + + EVP_KDF_CTX_free(kctx); +} + +#endif \ No newline at end of file diff --git a/openair3/SECU/x963_kdf.h b/openair3/SECU/x963_kdf.h new file mode 100644 index 0000000000..e831617629 --- /dev/null +++ b/openair3/SECU/x963_kdf.h @@ -0,0 +1,23 @@ +/* + * SPDX-License-Identifier: LicenseRef-CSSL-1.0 + */ + +#ifndef x963_KDF_OAI_H +#define x963_KDF_OAI_H + +#include + +#if OPENSSL_VERSION_NUMBER >= 0x30000000L + +/* code for version 3.0 or greater */ + +#include +#include + +#include "byte_array.h" + +void x963_kdf(const byte_array_t sharedsecret, const byte_array_t sharedinfo, size_t len, uint8_t out[len]); + +#endif + +#endif diff --git a/openair3/UICC/usim_interface.c b/openair3/UICC/usim_interface.c index 40f69bfdc6..9ec066bad2 100644 --- a/openair3/UICC/usim_interface.c +++ b/openair3/UICC/usim_interface.c @@ -14,21 +14,26 @@ extern uint16_t NB_UE_INST; " key: cyphering key\n"\ " opc: cyphering OPc\n"\ " imiesv: string with IMEISV value\n" +#define DEFAULT_HOME_NETWORK_PUBLIC_KEY "5a8d38864820197c3394b92613b20b91633cbd897119273bf8e4a6f4eec0a650" /*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /* configuration parameters for the rfsimulator device */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ /*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -#define UICC_PARAMS_DESC { \ - {"imsi", "USIM IMSI\n", 0, .strptr=&uicc->imsiStr, .defstrval="2089900007487", TYPE_STRING, 0 }, \ - {"nmc_size" "number of digits in NMC", 0, .iptr=&uicc->nmc_size, .defintval=2, TYPE_INT, 0 }, \ - {"key", "USIM Ki\n", 0, .strptr=&uicc->keyStr, .defstrval="fec86ba6eb707ed08905757b1bb44b8f", TYPE_STRING, 0 }, \ - {"opc", "USIM OPc\n", 0, .strptr=&uicc->opcStr, .defstrval="c42449363bbad02b66d16bc975d77cc1", TYPE_STRING, 0 }, \ - {"amf", "USIM amf\n", 0, .strptr=&uicc->amfStr, .defstrval="8000", TYPE_STRING, 0 }, \ - {"sqn", "USIM sqn\n", 0, .strptr=&uicc->sqnStr, .defstrval="000000", TYPE_STRING, 0 }, \ - {"dnn", "UE dnn (apn)\n", 0, .strptr=&uicc->dnnStr, .defstrval="oai", TYPE_STRING, 0 }, \ - {"nssai_sst", "UE nssai\n", 0, .iptr=&uicc->nssai_sst, .defintval=1, TYPE_INT, 0 }, \ - {"nssai_sd", "UE nssai\n", 0, .iptr=&uicc->nssai_sd, .defintval=0xffffff, TYPE_INT, 0 }, \ - {"imeisv", "IMEISV\n", 0, .strptr=&uicc->imeisvStr, .defstrval="6754567890123413", TYPE_STRING, 0 }, \ +#define UICC_PARAMS_DESC { \ + {"imsi", "USIM IMSI\n", 0, .strptr=&uicc->imsiStr, .defstrval="2089900007487", TYPE_STRING, 0}, \ + {"nmc_size", "number of digits in NMC", 0, .iptr=&uicc->nmc_size, .defintval=2, TYPE_INT, 0}, \ + {"key", "USIM Ki\n", 0, .strptr=&uicc->keyStr, .defstrval="fec86ba6eb707ed08905757b1bb44b8f", TYPE_STRING, 0}, \ + {"opc", "USIM OPc\n", 0, .strptr=&uicc->opcStr, .defstrval="c42449363bbad02b66d16bc975d77cc1", TYPE_STRING, 0}, \ + {"amf", "USIM amf\n", 0, .strptr=&uicc->amfStr, .defstrval="8000", TYPE_STRING, 0}, \ + {"sqn", "USIM sqn\n", 0, .strptr=&uicc->sqnStr, .defstrval="000000", TYPE_STRING, 0}, \ + {"dnn", "UE dnn (apn)\n", 0, .strptr=&uicc->dnnStr, .defstrval="oai", TYPE_STRING, 0}, \ + {"nssai_sst", "UE nssai\n", 0, .iptr=&uicc->nssai_sst, .defintval=1, TYPE_INT, 0}, \ + {"nssai_sd", "UE nssai\n", 0, .iptr=&uicc->nssai_sd, .defintval=0xffffff, TYPE_INT, 0}, \ + {"imeisv", "IMEISV\n", 0, .strptr=&uicc->imeisvStr, .defstrval="6754567890123413", TYPE_STRING, 0}, \ + {"routing_indicator", "Routing Indicator\n", 0, .strptr = &uicc->routing_indicatorStr, .defstrval="0000", TYPE_STRING, 0}, \ + {"protection_scheme", "SUCI Profile Scheme\n", 0, .iptr = &uicc->protection_scheme, .defintval=0, TYPE_INT, 0}, \ + {"home_network_public_key_id", "Home Network Public Key ID\n", 0, .iptr=&uicc->home_network_public_key_id, .defintval=1, TYPE_INT, 0}, \ + {"home_network_public_key", "Home Network Public Key\n", 0, .strptr=&uicc->home_network_public_keyStr, .defstrval=DEFAULT_HOME_NETWORK_PUBLIC_KEY, TYPE_STRING, 0}, \ }; static uicc_t** uiccArray=NULL; @@ -62,6 +67,7 @@ uicc_t *init_uicc(char *sectionName) { to_hex(uicc->opcStr,uicc->opc, sizeof(uicc->opc) ); to_hex(uicc->sqnStr,uicc->sqn, sizeof(uicc->sqn) ); to_hex(uicc->amfStr,uicc->amf, sizeof(uicc->amf) ); + to_hex(uicc->home_network_public_keyStr, uicc->home_network_public_key, sizeof(uicc->home_network_public_key)); return uicc; } diff --git a/openair3/UICC/usim_interface.h b/openair3/UICC/usim_interface.h index 371915b3f6..09ba9f2dfb 100644 --- a/openair3/UICC/usim_interface.h +++ b/openair3/UICC/usim_interface.h @@ -37,6 +37,10 @@ typedef struct { int nssai_sd; pdu_session_config_t pdu_sessions[256]; int n_pdu_sessions; + char *routing_indicatorStr; + int protection_scheme; + char *home_network_public_keyStr; + int home_network_public_key_id; uint8_t key[16]; uint8_t opc[16]; uint8_t amf[2]; @@ -49,6 +53,7 @@ typedef struct { uint8_t ck[16]; uint8_t ik[16]; uint8_t milenage_res[8]; + uint8_t home_network_public_key[32]; } uicc_t; /* diff --git a/radio/BLADERF/bladerf_lib.c b/radio/BLADERF/bladerf_lib.c index 19d8a825af..43b2704226 100644 --- a/radio/BLADERF/bladerf_lib.c +++ b/radio/BLADERF/bladerf_lib.c @@ -8,6 +8,7 @@ #include #include "common_lib.h" +#include "log.h" /*! \brief BladeRF specific data structure */ typedef struct { diff --git a/radio/COMMON/common_lib.c b/radio/COMMON/common_lib.c index 0e02ded87c..000ae26703 100644 --- a/radio/COMMON/common_lib.c +++ b/radio/COMMON/common_lib.c @@ -17,6 +17,9 @@ #include "common/utils/load_module_shlib.h" #include "common/utils/LOG/log.h" #include "executables/softmodem-common.h" +#include "common/config/config_paramdesc.h" +#include "common/config/config_userapi.h" +#include "common/cmake_defs.h" #define MAX_GAP 100ULL const char *const devtype_names[MAX_RF_DEV_TYPE] = @@ -224,6 +227,9 @@ int openair0_write_reorder_common(nrue_ru_write_t nrue_ru_write, ctx->nextTS = timestamp; pthread_mutex_init(&ctx->mutex_write, NULL); pthread_mutex_init(&ctx->mutex_store, NULL); + for (int i = 0; i < WRITE_QUEUE_SZ; i++) { + ctx->queue[i].txp = malloc(sizeof(void *) * NB_ANTENNAS_TX); + } ctx->initDone = true; } if (pthread_mutex_trylock(&ctx->mutex_write) == 0) { @@ -270,8 +276,10 @@ void openair0_write_reorder_clear_context(openair0_device_t *device) LOG_E(HW, "write_reorder_clear_context call while still writing on the device\n"); pthread_mutex_destroy(&ctx->mutex_write); pthread_mutex_lock(&ctx->mutex_store); - for (int i = 0; i < WRITE_QUEUE_SZ; i++) + for (int i = 0; i < WRITE_QUEUE_SZ; i++) { ctx->queue[i].active = false; + free(ctx->queue[i].txp); + } pthread_mutex_unlock(&ctx->mutex_store); pthread_mutex_destroy(&ctx->mutex_store); ctx->initDone = false; diff --git a/radio/COMMON/common_lib.h b/radio/COMMON/common_lib.h index 42eaa46f89..72b24ca13e 100644 --- a/radio/COMMON/common_lib.h +++ b/radio/COMMON/common_lib.h @@ -11,10 +11,8 @@ #include #include #include -#include "common/cmake_defs.h" -#include +#include #include "record_player.h" -#include "common/utils/threadPool/notified_fifo.h" /* default name of shared library implementing the radio front end */ #define OAI_RF_LIBNAME "oai_device" @@ -140,14 +138,6 @@ typedef enum { TX_GPIO_CHANGE = 0x1000, } radio_tx_gpio_flag_t; -/*! \brief Structure used for initializing UDP read threads */ -typedef struct { - openair0_device_t *device; - int thread_id; - pthread_t pthread; - notifiedFIFO_t *resp; -} udp_ctx_t; - typedef enum { RU_GPIO_CONTROL_NONE, RU_GPIO_CONTROL_GENERIC, @@ -351,7 +341,7 @@ typedef struct { struct { bool active; openair0_timestamp_t timestamp; - void *txp[NB_ANTENNAS_TX]; + void **txp; int nsamps; int nbAnt; int flags; @@ -393,9 +383,6 @@ struct openair0_device { /*!brief pointer to FH state, used in ECPRI split 8*/ fhstate_t fhstate; - /*!brief UDP TX thread context*/ - udp_ctx_t **utx; - /*!brief Used in ECPRI split 8 to indicate numerator of sampling rate ratio*/ int sampling_rate_ratio_n; @@ -631,7 +618,6 @@ struct openair0_device { void *(*get_internal_parameter)(char *id); /* \brief timing statistics for TX fronthaul (ethernet) */ - time_stats_t tx_fhaul; re_order_t reOrder; }; @@ -689,10 +675,6 @@ extern void iqrecorder_end(openair0_device_t *device); int openair0_write_reorder(openair0_device_t *device, openair0_timestamp_t timestamp, void **txp, int nsamps, int nbAnt, int flags); void openair0_write_reorder_clear_context(openair0_device_t *device); -#include -#ifndef gettid -#define gettid() syscall(__NR_gettid) -#endif /**@}*/ #ifdef __cplusplus diff --git a/radio/COMMON/record_player.c b/radio/COMMON/record_player.c index 33567b3a7b..b54f745e22 100644 --- a/radio/COMMON/record_player.c +++ b/radio/COMMON/record_player.c @@ -11,6 +11,8 @@ #include "assertions.h" #include "common_lib.h" #include "record_player.h" +#include "common/config/config_paramdesc.h" +#include "common/config/config_userapi.h" /*! \brief read the oai recorder or player configuration, called from common device code * \param recplay_conf: store parameters diff --git a/radio/COMMON/record_player.h b/radio/COMMON/record_player.h index 5015ad56c3..be5b7381a7 100644 --- a/radio/COMMON/record_player.h +++ b/radio/COMMON/record_player.h @@ -9,8 +9,6 @@ #include #include #include -#include "common/config/config_paramdesc.h" -#include "common/config/config_userapi.h" #ifdef __cplusplus extern "C" diff --git a/radio/ETHERNET/eth_udp.c b/radio/ETHERNET/eth_udp.c index 56999f9846..935bc88396 100644 --- a/radio/ETHERNET/eth_udp.c +++ b/radio/ETHERNET/eth_udp.c @@ -365,7 +365,8 @@ void *trx_eth_write_udp_cmd(udpTXelem_t *udpTXelem) int trx_eth_write_udp(openair0_device_t *device, openair0_timestamp_t timestamp, void **buff, int fd_ind, int nsamps, int flags, int nant) { union udpTXReqUnion id = {.s={(uint64_t)timestamp,nsamps,0}}; - notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(udpTXelem_t), id.p, device->utx[fd_ind]->resp,NULL); + eth_state_t *eth = (eth_state_t*)device->priv; + notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(udpTXelem_t), id.p, eth->utx[fd_ind]->resp,NULL); udpTXelem_t * udptxelem=(udpTXelem_t *) NotifiedFifoData(req); udptxelem->device = device; udptxelem->timestamp = timestamp; @@ -375,7 +376,7 @@ int trx_eth_write_udp(openair0_device_t *device, openair0_timestamp_t timestamp, udptxelem->nsamps = nsamps; udptxelem->flags = flags; udptxelem->nant = nant; - pushNotifiedFIFO(device->utx[fd_ind]->resp, req); + pushNotifiedFIFO(eth->utx[fd_ind]->resp, req); LOG_D(PHY,"Pushed to TX FH FIFO, TS %llu, nsamps %d, nant %d buffs[0] %p buffs[1] %p\n", (unsigned long long)timestamp,nsamps,nant,udptxelem->buff[0],udptxelem->buff[1]); return(0); @@ -386,14 +387,11 @@ void *udp_write_thread(void *arg) { utx->resp = malloc(sizeof(*utx->resp)); initNotifiedFIFO(utx->resp); LOG_D(PHY,"UDP write thread started on core %d\n",sched_getcpu()); - reset_meas(&utx->device->tx_fhaul); while (oai_exit == 0) { notifiedFIFO_elt_t *res = pullNotifiedFIFO(utx->resp); udpTXelem_t *udptxelem = (udpTXelem_t *)NotifiedFifoData(res); LOG_D(PHY,"Pulled from TX FH FIFO, TS %llu, nsamps %d, nant %d\n",(unsigned long long)udptxelem->timestamp,udptxelem->nsamps,udptxelem->nant); - start_meas(&utx->device->tx_fhaul); trx_eth_write_udp_cmd(udptxelem); - stop_meas(&utx->device->tx_fhaul); // send data to RU delNotifiedFIFO_elt(res); } diff --git a/radio/ETHERNET/ethernet_lib.c b/radio/ETHERNET/ethernet_lib.c index dccb16095a..f1942f9f04 100644 --- a/radio/ETHERNET/ethernet_lib.c +++ b/radio/ETHERNET/ethernet_lib.c @@ -6,6 +6,7 @@ * \brief API to stream I/Q samples over standard ethernet */ +#include "utils.h" #include #include #include @@ -37,20 +38,30 @@ int trx_eth_start(openair0_device_t *device) AssertFatal(device->thirdparty_init != NULL, "device->thirdparty_init is null\n"); AssertFatal(device->thirdparty_init(device) == 0, "third-party init failed\n"); device->openair0_cfg->samples_per_packet = 256; - eth->num_fd = 1; //max(device->openair0_cfg->rx_num_channels,device->openair0_cfg->tx_num_channels); - udp_ctx_t *u[1+eth->num_fd]; - device->utx = (udp_ctx_t**)malloc(sizeof(device->utx)); - for (int i=0;inum_fd;i++) { - u[i] = malloc(sizeof(udp_ctx_t)); - u[i]->thread_id=i; - u[i]->device = device; - printf("UDP Read Thread %d on core %d\n",i,device->openair0_cfg->rxfh_cores[i]); - threadCreate(&u[i]->pthread,udp_read_thread,u[i],"udp read thread",device->openair0_cfg->rxfh_cores[i],OAI_PRIORITY_RT_MAX); - device->utx[i] = malloc(sizeof(udp_ctx_t)); - device->utx[i]->thread_id=i; - device->utx[i]->device = device; - printf("UDP Write Thread %d on core %d\n",i,device->openair0_cfg->txfh_cores[i]); - threadCreate(&device->utx[i]->pthread,udp_write_thread,device->utx[i],"udp write thread",device->openair0_cfg->txfh_cores[i],OAI_PRIORITY_RT_MAX); + eth->num_fd = 1; //max(device->openair0_cfg->rx_num_channels,device->openair0_cfg->tx_num_channels); + udp_ctx_t *u[1 + eth->num_fd]; + eth->utx = malloc_or_fail(sizeof(eth->utx)); + for (int i = 0; i < eth->num_fd; i++) { + u[i] = malloc_or_fail(sizeof(udp_ctx_t)); + u[i]->thread_id = i; + u[i]->device = device; + printf("UDP Read Thread %d on core %d\n", i, device->openair0_cfg->rxfh_cores[i]); + threadCreate(&u[i]->pthread, + udp_read_thread, + u[i], + "udp read thread", + device->openair0_cfg->rxfh_cores[i], + OAI_PRIORITY_RT_MAX); + eth->utx[i] = malloc_or_fail(sizeof(udp_ctx_t)); + eth->utx[i]->thread_id = i; + eth->utx[i]->device = device; + printf("UDP Write Thread %d on core %d\n", i, device->openair0_cfg->txfh_cores[i]); + threadCreate(ð->utx[i]->pthread, + udp_write_thread, + eth->utx[i], + "udp write thread", + device->openair0_cfg->txfh_cores[i], + OAI_PRIORITY_RT_MAX); } device->sampling_rate_ratio_n=1; device->sampling_rate_ratio_d=1; diff --git a/radio/ETHERNET/ethernet_lib.h b/radio/ETHERNET/ethernet_lib.h index 14c583a76e..8662f63d6b 100644 --- a/radio/ETHERNET/ethernet_lib.h +++ b/radio/ETHERNET/ethernet_lib.h @@ -17,6 +17,7 @@ #include #include #include +#include "common/utils/threadPool/notified_fifo.h" #define MAX_INST 4 @@ -29,6 +30,14 @@ #define APP_HEADER_SIZE_BYTES (ECPRICOMMON_BYTES + ECPRIPCID_BYTES + sizeof(openair0_timestamp_t)) #define ECPRIREV 1 // ECPRI Version 1, C=0 - single ECPRI message per OAI TX packet +/*! \brief Structure used for initializing UDP read threads */ +typedef struct { + openair0_device_t *device; + int thread_id; + pthread_t pthread; + notifiedFIFO_t *resp; +} udp_ctx_t; + /*!\brief opaque ethernet data structure */ typedef struct { @@ -115,6 +124,8 @@ typedef struct { struct ether_header ehd; /*!\brief local address (user) for RAW socket*/ struct sockaddr_ll local_addrd_ll; + /*!brief UDP TX thread context*/ + udp_ctx_t **utx; } eth_state_t; diff --git a/radio/USRP/README.md b/radio/USRP/README.md index 61577a2d64..8f5c579b47 100644 --- a/radio/USRP/README.md +++ b/radio/USRP/README.md @@ -15,6 +15,20 @@ Example files can be found in the `ci-scripts/conf_files/` directory with a `usrp` in the name, for instance [`gnb.sa.band78.106prb.usrpn310.ddsuu-2x2.conf`](../../ci-scripts/conf_files/gnb.sa.band78.106prb.usrpn310.ddsuu-2x2.conf). +## Build + +The OAI USRP driver in leverages the [USRP Hardware +Driver](https://github.com/EttusResearch/uhd) to interface with a USRP. +`build_oai` has support for installing UHD from package manager (Ubuntu) or from +source (other distributions or on request). See [`BUILD.md`](./BUILD.md) for +more information. + +Note that OAI comes with a patch for UHD as found in `cmake_targets/tools/`. +This patch is automatically applied when building UHD from source with +`build_oai`, and improves the TX/RX switching times of UHD. If you cannot apply +this patch, the `--continuous-tx` option can be an alternative as described +further below. + ## Configuration The USRP can be configured in the RU section of the config file. The field @@ -95,6 +109,45 @@ RUs = ( Hint: You cannot see TX/RX spread over multiple USRPs, if you use `internal` as a refrence of the clock and time source. -Furthur information about synchronization on the USRP N3xx devices can be found here: https://kb.ettus.com/Using_Ethernet-Based_Synchronization_on_the_USRP%E2%84%A2_N3xx_Devices +Furthur information about synchronization on the USRP N3xx devices can be found +[in the knowledge base article "Using Ethernet-Based +Synchronization"](https://kb.ettus.com/Using_Ethernet-Based_Synchronization_on_the_USRP%E2%84%A2_N3xx_Devices). When combining this with the multi USRP feature you can create a distributed antenna array with only 1 channel used at each USRP. + +## Further considerations + +### TX/RX switching times + +When using TDD (e.g., in 5G/NR band n78), the USRP has to frequently switch +between TX and RX directions. Certain USRPs, e.g., B210, might be too slow for +this, which can result in degraded radio link performance, especially in 5G/NR +operation. In order to get a good performance, there are two workarounds: + +1. At runtime: you can use the `--continuous-tx` options at gNB/nrUE. This will + continuously send TX samples, also when the current link direction is to + receive, and we found this to improve the radio link. +2. At compile/build time: apply the UHD patch described further above, which + obliveates the need for `--continuous-tx`. + +### Three-quarter sampling + +Not all sampling rates can be used with (a) given master sampling rate(s) of a +USRP. Depending on the bandwidth, you might employ (or not) three-quarter +sampling using option `-E`. As a basic rule of thump, 40MHz on B210 needs `-E`, +whereas most other bandwidths on USRPs do not (bu there are exceptions). + +### Noise on DC carrier + +Some USRPs have noise on the DC carrier, which can degrade the radio signal. +There are two workarounds: + +1. Use the `--tune-offset` parameter, which shifts the operating frequency of + the USRP to avoid the use of the DC carrier. +2. `--tune-offset` has a maximum shift frequency. If half the bandwidth is + larger than `--tune-offset`, the DC carrier will still lie within the + carrier. In this case, you can also mask these RBs by using + `gNBs.[0].ul_prbblacklist` in the configuration file. + +You can also find more information on this in the [5G/NR gNB with COTS UE +tutorial](./NR_SA_Tutorial_COTS_UE.md). diff --git a/radio/emulator/CMakeLists.txt b/radio/emulator/CMakeLists.txt index 17a8c1371d..13b75d9e71 100644 --- a/radio/emulator/CMakeLists.txt +++ b/radio/emulator/CMakeLists.txt @@ -2,4 +2,4 @@ add_library(rf_emulator MODULE rf_emulator.c) set_target_properties(rf_emulator PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) -target_link_libraries(rf_emulator PRIVATE noise_device log_headers) +target_link_libraries(rf_emulator PRIVATE noise_device log_headers noise_device) diff --git a/radio/emulator/rf_emulator.c b/radio/emulator/rf_emulator.c index 34b306c4fe..8f3bdb3ba7 100644 --- a/radio/emulator/rf_emulator.c +++ b/radio/emulator/rf_emulator.c @@ -13,9 +13,10 @@ #include #include "common/utils/threadPool/pthread_utils.h" #include "common_lib.h" -#include "radio/vrtsim/noise_device.h" +#include "noise_device.h" #include "simde/x86/avx512.h" #include "SIMULATION/TOOLS/sim.h" +#include "common/config/config_userapi.h" #define RF_EMULATOR_SECTION "rf_emulator" // clang-format off diff --git a/radio/fhi_72/oran-config.c b/radio/fhi_72/oran-config.c index 5209c34abe..8da11c64ed 100644 --- a/radio/fhi_72/oran-config.c +++ b/radio/fhi_72/oran-config.c @@ -14,6 +14,7 @@ #include "stdio.h" #include "string.h" +#include "log.h" #ifdef OAI_MPLANE #include "mplane/ru-mplane-api.h" diff --git a/radio/fhi_72/oran-params.h b/radio/fhi_72/oran-params.h index 8d2e65dc74..8ae5c18abc 100644 --- a/radio/fhi_72/oran-params.h +++ b/radio/fhi_72/oran-params.h @@ -7,6 +7,7 @@ #include "stdbool.h" #include "stdint.h" +#include "common/config/config_userapi.h" #define CONFIG_STRING_ORAN "fhi_72" diff --git a/radio/fhi_72/oran_isolate.h b/radio/fhi_72/oran_isolate.h index bf4ced15ca..afdf443596 100644 --- a/radio/fhi_72/oran_isolate.h +++ b/radio/fhi_72/oran_isolate.h @@ -13,7 +13,7 @@ #include "xran_fh_o_du.h" #include "openair1/PHY/impl_defs_nr.h" #include "openair1/PHY/TOOLS/tools_defs.h" -#include "openair1/PHY/defs_common.h" +#include "openair1/PHY/defs_nr_common.h" /* * Structure added to bear the information needed from OAI RU */ diff --git a/radio/rfsimulator/simulator.cpp b/radio/rfsimulator/simulator.cpp index 38b5351e40..ee2eb01343 100644 --- a/radio/rfsimulator/simulator.cpp +++ b/radio/rfsimulator/simulator.cpp @@ -30,6 +30,7 @@ #include #include #include "common_lib.h" +#include "common/utils/threadPool/pthread_utils.h" extern "C" { #include #include diff --git a/radio/vrtsim/CMakeLists.txt b/radio/vrtsim/CMakeLists.txt index 80de9de452..b60c955f72 100644 --- a/radio/vrtsim/CMakeLists.txt +++ b/radio/vrtsim/CMakeLists.txt @@ -1,9 +1,5 @@ # SPDX-License-Identifier: LicenseRef-CSSL-1.0 -# Noise device static lib -add_library(noise_device STATIC noise_device.c) -target_link_libraries(noise_device PRIVATE log_headers) - # vrtsim module add_library(vrtsim MODULE vrtsim.c @@ -20,12 +16,16 @@ target_link_libraries(vrtsim PRIVATE SIMU shm_td_iq_channel - actor noise_device log_headers - pthread yaml-cpp + channel_pipeline + thread-pool ) +if (CUDA_ENABLE) + target_compile_definitions(vrtsim PRIVATE CUDA_ENABLE) + target_compile_definitions(vrtsim PRIVATE CUDA_ENABLE) +endif() # Optional taps client add_boolean_option(OAI_VRTSIM_TAPS_CLIENT OFF "Enable taps client" ON) diff --git a/radio/vrtsim/vrtsim.c b/radio/vrtsim/vrtsim.c index edfb47a1bf..e63dc7ff5b 100644 --- a/radio/vrtsim/vrtsim.c +++ b/radio/vrtsim/vrtsim.c @@ -31,12 +31,12 @@ #include "common_lib.h" #include "shm_td_iq_channel.h" #include "SIMULATION/TOOLS/sim.h" -#include "actor.h" -#include "noise_device.h" #include "simde/x86/avx512.h" #include "taps_client.h" #include "cirdb_provider.h" #include "cirdb_yaml.h" +#include "channel_pipeline.h" +#include "thread-pool.h" // Simulator role typedef enum { ROLE_SERVER = 1, ROLE_CLIENT } role; @@ -56,6 +56,7 @@ typedef enum { ROLE_SERVER = 1, ROLE_CLIENT } role; #define CONNECTION_DESCRIPTOR_HLP "Path to the file written by the server that the client can use to connect." #define DEFAULT_CHANNEL_NAME "vrtsim_channel" #define DEFAULT_DESCRIPTOR "/tmp/vrtsim_connection" +#define TPOOL_HLP "Thread pool for channel modelling. Only used if CUDA support is disabled." // clang-format off #define VRTSIM_PARAMS_DESC \ @@ -77,6 +78,7 @@ typedef enum { ROLE_SERVER = 1, ROLE_CLIENT } role; {"cirdb_speed_mps", "Desired speed in m/s", 0, .dblptr = &vrtsim_state->cirdb_speed_mps, .defdblval = 1.5, TYPE_DOUBLE, 0}, \ {"num_ues", "Number of UE slots (server only)\n", 0, .iptr = &vrtsim_state->num_ues, .defintval = 1, TYPE_INT, 0}, \ {"ue_id", "UE slot index 0..num_ues-1 (client only)\n", 0, .iptr = &vrtsim_state->ue_id, .defintval = 0, TYPE_INT, 0}, \ + {"thread-pool", TPOOL_HLP, .strptr = &vrtsim_state->thread_pool_cores, .defstrval = "-1,-1,-1,-1", TYPE_STRING, 0} \ }; // clang-format on @@ -126,17 +128,15 @@ typedef struct { uint64_t rx_samples_late; uint64_t rx_early; uint64_t rx_samples_total; - tx_timing_t *tx_timing; + tx_timing_t tx_timing; + histogram_t chanmod_histogram; peer_info_t peer_info; int chanmod; double rx_freq; double tx_bw; int tx_num_channels; int rx_num_channels; - channel_desc_t *channel_desc; - channel_desc_t *channel_desc_per_ue[MAX_NUM_UES]; - pthread_mutex_t cirdb_mutex; - Actor_t *channel_modelling_actors; + channel_desc_t *channel_desc[MAX_NUM_UES]; char *taps_socket; int client_num_rx_antennas; struct timespec start_ts; @@ -155,11 +155,9 @@ typedef struct { ue_conf_t ue_conf[MAX_NUM_UES]; ue_conf_t ue; - // Totals - int total_ul_streams; - int total_dl_streams; - sample_t *ul_combine_buffer; - size_t ul_combine_buffer_len; + tpool_t tpool; + void *channel_pipeline_context; + char *thread_pool_cores; } vrtsim_state_t; static void histogram_add(histogram_t *histogram, double diff) @@ -171,9 +169,9 @@ static void histogram_add(histogram_t *histogram, double diff) } } -static void histogram_print(histogram_t *histogram) +static void histogram_print(histogram_t *histogram, char *title) { - LOG_I(HW, "VRTSIM: TX budget histogram: %d samples\n", histogram->num_samples); + LOG_I(HW, "%s: %d samples\n", title, histogram->num_samples); float bin_size = histogram->range / sizeofArray(histogram->diff); float bin_start = 0; for (int i = 0; i < sizeofArray(histogram->diff); i++) { @@ -182,14 +180,6 @@ static void histogram_print(histogram_t *histogram) } } -static void histogram_merge(histogram_t *dest, histogram_t *src) -{ - for (int i = 0; i < sizeofArray(dest->diff); i++) { - dest->diff[i] += src->diff[i]; - } - dest->num_samples += src->num_samples; -} - static void load_channel_model(vrtsim_state_t *vrtsim_state) { load_channellist(vrtsim_state->tx_num_channels, @@ -198,19 +188,30 @@ static void load_channel_model(vrtsim_state_t *vrtsim_state) vrtsim_state->rx_freq, vrtsim_state->tx_bw); char *model_name = vrtsim_state->role == ROLE_CLIENT ? "client_tx_channel_model" : "server_tx_channel_model"; - vrtsim_state->channel_desc = find_channel_desc_fromname(model_name); - AssertFatal(vrtsim_state->channel_desc != NULL, + vrtsim_state->channel_desc[0] = find_channel_desc_fromname(model_name); + channel_desc_t *channel_desc = vrtsim_state->channel_desc[0]; + AssertFatal(channel_desc != NULL, "Could not find model name %s. Make sure it is present in the config file\n", model_name); - LOG_I(HW, + LOG_A(HW, "Channel model %s parameters: path_loss_dB=%.2f, nb_tx=%d, nb_rx=%d, channel_length=%d\n", model_name, - vrtsim_state->channel_desc->path_loss_dB, - vrtsim_state->channel_desc->nb_tx, - vrtsim_state->channel_desc->nb_rx, - vrtsim_state->channel_desc->channel_length); - random_channel(vrtsim_state->channel_desc, 0); - AssertFatal(vrtsim_state->channel_desc != NULL, "Could not find channel model %s\n", model_name); + channel_desc->path_loss_dB, + channel_desc->nb_tx, + channel_desc->nb_rx, + channel_desc->channel_length); + random_channel(channel_desc, 0); + channel_desc->ch_ps = malloc(sizeof(*channel_desc->ch_ps) * channel_desc->nb_tx * channel_desc->nb_rx); + for (int aarx = 0; aarx < channel_desc->nb_rx; aarx++) { + for (int aatx = 0; aatx < channel_desc->nb_tx; aatx++) { + cf_t *channel_ps = (cf_t *)malloc(sizeof(cf_t) * channel_desc->channel_length); + channel_desc->ch_ps[aarx + (aatx * channel_desc->nb_rx)] = channel_ps; + for (int i = 0; i < channel_desc->channel_length; i++) { + struct complexd src = channel_desc->ch[aarx + (aatx * channel_desc->nb_rx)][i]; + channel_ps[i] = (cf_t){src.r, src.i}; + } + } + } } static void vrtsim_readconfig(vrtsim_state_t *vrtsim_state) @@ -385,11 +386,6 @@ static void compute_ue_antenna_offsets(vrtsim_state_t *vrtsim_state) tx_offset += vrtsim_state->ue_conf[i].tx_ant; rx_offset += vrtsim_state->ue_conf[i].rx_ant; } - - vrtsim_state->total_ul_streams = tx_offset; - vrtsim_state->total_dl_streams = rx_offset; - - LOG_I(HW, "VRTSIM: Total streams - UL: %d, DL: %d\n", vrtsim_state->total_ul_streams, vrtsim_state->total_dl_streams); } static int vrtsim_connect(openair0_device_t *device) @@ -400,15 +396,14 @@ static int vrtsim_connect(openair0_device_t *device) if (vrtsim_state->role == ROLE_SERVER) { parse_ue_config(vrtsim_state); compute_ue_antenna_offsets(vrtsim_state); - - int ul_streams = (vrtsim_state->chanmod || vrtsim_state->taps_socket || vrtsim_state->use_cirdb) - ? vrtsim_state->num_ues * device->openair0_cfg[0].rx_num_channels - : vrtsim_state->total_ul_streams; + int num_tx_streams = 0; + int num_rx_streams = vrtsim_state->num_ues * device->openair0_cfg[0].rx_num_channels; + for (int i = 0; i < vrtsim_state->num_ues; i++) { + num_tx_streams += vrtsim_state->ue_conf[i].rx_ant; + } vrtsim_state->channel = - shm_td_iq_channel_create(DEFAULT_CHANNEL_NAME, ul_streams, vrtsim_state->total_dl_streams); - size_t max_nsamps = 7680 * 2; - vrtsim_state->ul_combine_buffer = calloc_or_fail(max_nsamps, sizeof(sample_t)); - vrtsim_state->ul_combine_buffer_len = max_nsamps; + shm_td_iq_channel_create(DEFAULT_CHANNEL_NAME, num_tx_streams, num_rx_streams); + LOG_A(HW, "vrtsim created a shm_td_iq_channel with config tx: %d rx: %d\n", num_tx_streams, num_rx_streams); // Exchange peer info client_info_t client_info = { @@ -470,21 +465,13 @@ static int vrtsim_connect(openair0_device_t *device) } // Handle channel modelling after number of RX antennas are known - int num_tx_stats = 1; if (vrtsim_state->chanmod || vrtsim_state->taps_socket || vrtsim_state->use_cirdb) { - int num_actors = (vrtsim_state->role == ROLE_SERVER && vrtsim_state->num_ues > 1) ? vrtsim_state->total_dl_streams - : vrtsim_state->peer_info.num_rx_antennas; - - vrtsim_state->channel_modelling_actors = calloc_or_fail(num_actors, sizeof(Actor_t)); - for (int i = 0; i < num_actors; i++) { - init_actor(&vrtsim_state->channel_modelling_actors[i], "chanmod", -1); - } if (vrtsim_state->taps_socket) { taps_client_connect(0, vrtsim_state->taps_socket, device->openair0_cfg[0].tx_num_channels, vrtsim_state->peer_info.num_rx_antennas, - &vrtsim_state->channel_desc); + &vrtsim_state->channel_desc[0]); } else if (vrtsim_state->use_cirdb) { const char *yaml_path = NULL; const char *bin_path = NULL; @@ -515,8 +502,8 @@ static int vrtsim_connect(openair0_device_t *device) sel.yaml_path = yaml_path; sel.bin_path = bin_path; AssertFatal(vrtsim_state->cirdb_model_id >= 0 && vrtsim_state->cirdb_model_id <= 4, - "Invalid cirdb_model_id=%d (valid: 0..4)\n", - vrtsim_state->cirdb_model_id); + "Invalid cirdb_model_id=%d (valid: 0..4)\n", + vrtsim_state->cirdb_model_id); sel.want_model_id = vrtsim_state->cirdb_model_id; sel.want_ds_ns = (float)(vrtsim_state->cirdb_ds_ns > 0.0 ? vrtsim_state->cirdb_ds_ns : -1.0); sel.want_speed_mps = (float)(vrtsim_state->cirdb_speed_mps > 0.0 ? vrtsim_state->cirdb_speed_mps : -1.0); @@ -543,9 +530,9 @@ static int vrtsim_connect(openair0_device_t *device) device->openair0_cfg[0].tx_num_channels, vrtsim_state->ue_conf[u].rx_ant, &ue_sel, - &vrtsim_state->channel_desc_per_ue[u]); + &vrtsim_state->channel_desc[u]); - channel_desc_t *cd = vrtsim_state->channel_desc_per_ue[u]; + channel_desc_t *cd = vrtsim_state->channel_desc[u]; AssertFatal(cd != NULL, "CIRDB failed to create channel_desc for UE %d\n", u); AssertFatal(cd->nb_tx == device->openair0_cfg[0].tx_num_channels, "CIRDB shape mismatch UE%d: nb_tx=%d expected %d\n", @@ -556,33 +543,24 @@ static int vrtsim_connect(openair0_device_t *device) u, ue_sel.want_model_id, 'A' + ue_sel.want_model_id, device->openair0_cfg[0].tx_num_channels, vrtsim_state->ue_conf[u].rx_ant, cd->nb_rx); } - vrtsim_state->channel_desc = vrtsim_state->channel_desc_per_ue[0]; - pthread_mutex_init(&vrtsim_state->cirdb_mutex, NULL); LOG_A(HW, "VRTSIM: Multi-UE channel taps via CIR DB\n"); } else { cirdb_connect(0, device->openair0_cfg[0].tx_num_channels, vrtsim_state->peer_info.num_rx_antennas, &sel, - &vrtsim_state->channel_desc); + &vrtsim_state->channel_desc[0]); LOG_A(HW, "VRTSIM: channel taps via CIR DB\n"); } } else { load_channel_model(vrtsim_state); } - num_tx_stats = vrtsim_state->peer_info.num_rx_antennas; - if (vrtsim_state->role == ROLE_SERVER && vrtsim_state->num_ues > 1) { - vrtsim_state->peer_info.num_rx_antennas = vrtsim_state->total_dl_streams; - num_tx_stats = vrtsim_state->total_dl_streams; - } } - vrtsim_state->tx_timing = calloc_or_fail(num_tx_stats, sizeof(tx_timing_t)); - for (int i = 0; i < num_tx_stats; i++) { - vrtsim_state->tx_timing[i].tx_histogram.min_samples = 100; - // Set the histogram range to 3000uS. Anything above that is not interesting - vrtsim_state->tx_timing[i].tx_histogram.range = 3000.0; - } - + vrtsim_state->tx_timing.tx_histogram.min_samples = 100; + // Set the histogram range to 3000uS. Anything above that is not interesting + vrtsim_state->tx_timing.tx_histogram.range = 3000.0; + vrtsim_state->chanmod_histogram.range = 300.0; + vrtsim_state->chanmod_histogram.min_samples = 100; return 0; } @@ -590,11 +568,9 @@ static int vrtsim_write_internal(vrtsim_state_t *vrtsim_state, openair0_timestamp_t timestamp, c16_t *samples, int nsamps, - int aarx, - int flags, - int stats_index) + int aarx) { - tx_timing_t *tx_timing = &vrtsim_state->tx_timing[stats_index]; + tx_timing_t *tx_timing = &vrtsim_state->tx_timing; uint64_t sample = shm_td_iq_channel_get_current_sample(vrtsim_state->channel); int64_t diff = timestamp - sample; @@ -614,220 +590,116 @@ static int vrtsim_write_internal(vrtsim_state_t *vrtsim_state, return nsamps; } -typedef struct { - vrtsim_state_t *vrtsim_state; - openair0_timestamp_t timestamp; - c16_t *samples[MAX_NUM_ANTENNAS_TX]; - int nsamps; - int nbAnt; - int flags; - int aarx; - int batch_size; - int num_batches; - c16_t saved_samples[MAX_NUM_ANTENNAS_TX][SAVED_SAMPLES_LEN]; -} channel_modelling_args_t; - -static void perform_channel_modelling(void *arg) -{ - channel_modelling_args_t *channel_modelling_args = arg; - vrtsim_state_t *vrtsim_state = channel_modelling_args->vrtsim_state; - int nsamps = channel_modelling_args->nsamps; - int aarx = channel_modelling_args->aarx; - int nb_tx_ant = channel_modelling_args->nbAnt; - c16_t **input_samples = (c16_t **)channel_modelling_args->samples; - - channel_desc_t *channel_desc = vrtsim_state->channel_desc; - int local_aarx = aarx; - int global_aarx = aarx; - int target_ue = 0; - - if (vrtsim_state->role == ROLE_CLIENT) { - global_aarx = vrtsim_state->ue_id * vrtsim_state->peer_info.num_rx_antennas + aarx; - } - - if (vrtsim_state->role == ROLE_SERVER && vrtsim_state->num_ues > 1) { - if (aarx >= vrtsim_state->total_dl_streams) { - LOG_E(HW, "VRTSIM: aarx=%d >= total_dl_streams=%d\n", aarx, vrtsim_state->total_dl_streams); - return; - } - - bool found = false; - for (int u = 0; u < vrtsim_state->num_ues; u++) { - int offset = vrtsim_state->ue_conf[u].rx_offset; - int count = vrtsim_state->ue_conf[u].rx_ant; - if (aarx >= offset && aarx < offset + count) { - target_ue = u; - local_aarx = aarx - offset; - channel_desc = vrtsim_state->channel_desc_per_ue[u]; - found = true; - break; - } - } - - if (!found) { - LOG_E(HW, "VRTSIM: aarx=%d could not map to any UE (total_dl_streams=%d)\n", aarx, vrtsim_state->total_dl_streams); - return; - } - } - - if (channel_desc == NULL) { - LOG_E(HW, "VRTSIM: channel_desc is NULL for aarx=%d\n", aarx); - return; - } - - // Bounds check: ensure local_aarx is within channel_desc bounds - if (local_aarx >= channel_desc->nb_rx) { - LOG_E(HW, - "VRTSIM: UE%d local_aarx=%d >= nb_rx=%d (global aarx=%d). CIRDB shape mismatch.\n", - target_ue, - local_aarx, - channel_desc->nb_rx, - aarx); - return; - } - - if (vrtsim_state->use_cirdb) { - double seconds = (double)channel_modelling_args->timestamp / vrtsim_state->sample_rate; - uint64_t elapsed_ns = (uint64_t)(seconds * 1e9 + 0.5); - - // Lock for multi-UE to prevent concurrent CIRDB updates - if (vrtsim_state->role == ROLE_SERVER && vrtsim_state->num_ues > 1) { - pthread_mutex_lock(&vrtsim_state->cirdb_mutex); - } - - cirdb_update(elapsed_ns); - - if (vrtsim_state->role == ROLE_SERVER && vrtsim_state->num_ues > 1) { - pthread_mutex_unlock(&vrtsim_state->cirdb_mutex); - } - } - - cf_t channel_impulse_response[nb_tx_ant][channel_desc->channel_length]; - cf_t *channel_impulse_response_p[nb_tx_ant]; - if (!vrtsim_state->taps_socket && !vrtsim_state->use_cirdb) { - const float pathloss_linear = powf(10, channel_desc->path_loss_dB / 20.0); - // Convert channel impulse response to float + apply pathloss - for (int aatx = 0; aatx < nb_tx_ant; aatx++) { - const struct complexd *channelModel = channel_desc->ch[local_aarx + (aatx * channel_desc->nb_rx)]; - for (int i = 0; i < channel_desc->channel_length; i++) { - channel_impulse_response[aatx][i].r = channelModel[i].r * pathloss_linear; - channel_impulse_response[aatx][i].i = channelModel[i].i * pathloss_linear; - } - channel_impulse_response_p[aatx] = channel_impulse_response[aatx]; - } - } else { - for (int aatx = 0; aatx < nb_tx_ant; aatx++) { - struct complexf *channelModel = channel_desc->ch_ps[local_aarx + (aatx * channel_desc->nb_rx)]; - channel_impulse_response_p[aatx] = channelModel; - } - } - - for (int batch_index = 0; batch_index < channel_modelling_args->num_batches; batch_index++) { - const int start_sample = batch_index * channel_modelling_args->batch_size; - const int num_samples = min(channel_modelling_args->batch_size, nsamps - start_sample); - if (start_sample >= nsamps) { - break; - } - - const int aligned_batch = ceil_mod(num_samples, (512 / 8) / sizeof(cf_t)); - cf_t samples[aligned_batch] __attribute__((aligned(64))); - memset(samples, 0, sizeof(samples)); - - // Apply noise from global settings (only valid samples) - get_noise_vector((float *)samples, num_samples * 2); - - for (int aatx = 0; aatx < nb_tx_ant; aatx++) { - cf_t *impulse_response = channel_impulse_response_p[aatx]; - for (int i = 0; i < num_samples; i++) { - const int gi = start_sample + i; - for (int l = 0; l < channel_desc->channel_length; l++) { - const int idx = gi - l; - // TODO: Use AVX2 for this - c16_t tx_input = idx >= 0 ? input_samples[aatx][idx] - : channel_modelling_args->saved_samples[aatx][SAVED_SAMPLES_LEN + idx]; - samples[i].r += tx_input.r * impulse_response[l].r - tx_input.i * impulse_response[l].i; - samples[i].i += tx_input.i * impulse_response[l].r + tx_input.r * impulse_response[l].i; - } - } - } - - // Convert to c16_t (only once per batch) - c16_t samples_out[aligned_batch] __attribute__((aligned(64))); -#if defined(__AVX512F__) - for (int i = 0; i < aligned_batch / 8; i++) { - simde__m512 *in = (simde__m512 *)&samples[i * 8]; - simde__m256i *out = (simde__m256i *)&samples_out[i * 8]; - *out = simde_mm512_cvtsepi32_epi16(simde_mm512_cvtps_epi32(*in)); - } -#elif defined(__AVX2__) - for (int i = 0; i < aligned_batch / 4; i++) { - simde__m256 *in = (simde__m256 *)&samples[i * 4]; - simde__m128i *out = (simde__m128i *)&samples_out[i * 4]; - *out = simde_mm256_cvtsepi32_epi16(simde_mm256_cvtps_epi32(*in)); - } -#else - for (int i = 0; i < num_samples; i++) { - samples_out[i].r = lroundf(samples[i].r); - samples_out[i].i = lroundf(samples[i].i); - } -#endif - - // Write the batch as a single contiguous transfer - vrtsim_write_internal(channel_modelling_args->vrtsim_state, - channel_modelling_args->timestamp + start_sample, - samples_out, - num_samples, - global_aarx, - channel_modelling_args->flags, - aarx); - } -} - static int vrtsim_write_with_chanmod(vrtsim_state_t *vrtsim_state, openair0_timestamp_t timestamp, void **samplesVoid, int nsamps, - int nbAnt, - int flags) + int nbAnt) { // Sample history for channel impulse response static c16_t saved_samples[MAX_NUM_ANTENNAS_TX][SAVED_SAMPLES_LEN] __attribute__((aligned(32))) = {0}; - // Indicates what samples are saves in saved_samples - static openair0_timestamp_t last_timestamp = 0; - const int batch_size = 4096; + if (vrtsim_state->use_cirdb) { + double seconds = (double)timestamp / vrtsim_state->sample_rate; + uint64_t elapsed_ns = (uint64_t)(seconds * 1e9 + 0.5); + cirdb_update(elapsed_ns); + } - AssertFatal(nbAnt <= MAX_NUM_ANTENNAS_TX, "Number of antennas %d exceeds maximum %d\n", nbAnt, MAX_NUM_ANTENNAS_TX); - for (int aarx = 0; aarx < vrtsim_state->peer_info.num_rx_antennas; aarx++) { - notifiedFIFO_elt_t *task = newNotifiedFIFO_elt(sizeof(channel_modelling_args_t), 0, NULL, perform_channel_modelling); - channel_modelling_args_t *args = (channel_modelling_args_t *)NotifiedFifoData(task); - args->vrtsim_state = vrtsim_state; - args->timestamp = timestamp; - args->nsamps = nsamps; - args->nbAnt = nbAnt; - args->flags = flags; - args->aarx = aarx; - args->batch_size = batch_size; - args->num_batches = (nsamps + batch_size - 1) / batch_size; - for (int i = 0; i < nbAnt; i++) { - args->samples[i] = samplesVoid[i]; - } + if (!vrtsim_state->channel_desc[0]) { + LOG_E(HW, "No channel_desc found\n"); + return nsamps; + } - // Fill in saved_samples - size_t gap_samples = timestamp - last_timestamp; - if (gap_samples > 0) { - size_t gap_samples_needed = min(SAVED_SAMPLES_LEN, gap_samples); - for (int aatx = 0; aatx < nbAnt; aatx++) { - memset(&args->saved_samples[aatx][SAVED_SAMPLES_LEN - gap_samples_needed], 0, sizeof(c16_t) * gap_samples_needed); - if (gap_samples < SAVED_SAMPLES_LEN) { - size_t samples_from_saved = SAVED_SAMPLES_LEN - gap_samples_needed; - memcpy(&args->saved_samples[aatx][0], &saved_samples[aatx][SAVED_SAMPLES_LEN - samples_from_saved], sizeof(c16_t) * samples_from_saved); + int noise_power_dBFS = get_noise_power_dBFS(); + int16_t noise_power = noise_power_dBFS == INVALID_DBFS_VALUE ? 0 : (int16_t)(32767.0 / powf(10.0, .05 * -noise_power_dBFS)); + + int num_chan_desc = 1; + if (vrtsim_state->role == ROLE_SERVER) { + num_chan_desc = vrtsim_state->num_ues; + } + int rx_antenna_offset = 0; + int nb_tx = nbAnt; + for (int i = 0; i < num_chan_desc; i++) { + channel_desc_t *chan_desc = vrtsim_state->channel_desc[i]; + AssertFatal(chan_desc, "Channel not provided\n"); + int nb_rx = chan_desc->nb_rx; + size_t channel_length = chan_desc->channel_length; + AssertFatal((channel_length - 1) < SAVED_SAMPLES_LEN, + "Need to ensure at least %ld samples are saved between calls\n", + channel_length - 1); + + cf_t channel_impulse_response[nb_rx * nb_tx][channel_length] __attribute__((aligned(32))); + cf_t *channel_impulse_response_p[nb_rx * nb_tx] __attribute__((aligned(32))); + int channel_index = 0; + if (!vrtsim_state->taps_socket && !vrtsim_state->use_cirdb) { + const float pathloss_linear = powf(10, chan_desc->path_loss_dB / 20.0); + for (int aarx = 0; aarx < nb_rx; aarx++) { + for (int aatx = 0; aatx < nb_tx; aatx++) { + const cf_t *channelModel = chan_desc->ch_ps[aarx + (aatx * chan_desc->nb_rx)]; + for (int i = 0; i < channel_length; i++) { + channel_impulse_response[channel_index][i].r = channelModel[i].r * pathloss_linear; + channel_impulse_response[channel_index][i].i = channelModel[i].i * pathloss_linear; + } + channel_impulse_response_p[channel_index] = channel_impulse_response[channel_index]; + channel_index++; } } } else { - for (int aatx = 0; aatx < nbAnt; aatx++) - memcpy(&args->saved_samples[aatx][0], saved_samples[aatx], sizeof(c16_t) * SAVED_SAMPLES_LEN); + for (int aarx = 0; aarx < nb_rx; aarx++) { + for (int aatx = 0; aatx < nb_tx; aatx++) { + struct complexf *channelModel = chan_desc->ch_ps[aarx + (aatx * chan_desc->nb_rx)]; + channel_impulse_response_p[channel_index++] = channelModel; + } + } } - pushNotifiedFIFO(&vrtsim_state->channel_modelling_actors[aarx].fifo, task); + c16_t output[nb_rx][nsamps] __attribute__((aligned(32))); + c16_t *output_ptr[nb_rx] __attribute__((aligned(32))); + for (int aarx = 0; aarx < nb_rx; aarx++) { + output_ptr[aarx] = output[aarx]; + } + c16_t *input_ptr[nb_tx] __attribute__((aligned(32))); + for (int i = 0; i < nb_tx; i++) { + input_ptr[i] = samplesVoid[i]; + } + c16_t *saved_samples_ptr[nb_tx] __attribute__((aligned(32))); + for (int i = 0; i < nb_tx; i++) { + saved_samples_ptr[i] = &saved_samples[i][SAVED_SAMPLES_LEN - (channel_length - 1)]; + } + size_t saved_samples_input_len = channel_length - 1; + + #ifdef CUDA_ENABLE + cuda_channel_pipeline(vrtsim_state->channel_pipeline_context, + (const cf_t **)channel_impulse_response_p, + (const c16_t **)saved_samples_ptr, + (const c16_t **)input_ptr, + saved_samples_input_len, + output_ptr, + NULL, + nsamps, + nsamps, + channel_length, + nb_tx, + nb_rx, + noise_power); + #else + channel_pipeline(&vrtsim_state->tpool, + (const cf_t **)channel_impulse_response_p, + (const c16_t **)saved_samples_ptr, + (const c16_t **)input_ptr, + saved_samples_input_len, + output_ptr, + NULL, + nsamps, + nsamps, + channel_length, + nb_tx, + nb_rx, + noise_power); + #endif + + for (int aarx = 0; aarx < nb_rx; aarx++) { + vrtsim_write_internal(vrtsim_state, timestamp, output[aarx], nsamps, rx_antenna_offset + aarx); + } + rx_antenna_offset += nb_rx; } // Save samples for next round @@ -838,12 +710,11 @@ static int vrtsim_write_with_chanmod(vrtsim_state_t *vrtsim_state, } } else { for (int aatx = 0; aatx < nbAnt; aatx++) { - c16_t* samples = (c16_t*)samplesVoid[aatx]; + c16_t *samples = (c16_t *)samplesVoid[aatx]; memcpy(saved_samples[aatx], &samples[nsamps - SAVED_SAMPLES_LEN], sizeof(c16_t) * (SAVED_SAMPLES_LEN)); } } - last_timestamp = timestamp + nsamps; return nsamps; } @@ -864,12 +735,21 @@ static int vrtsim_write(openair0_device_t *device, vrtsim_state_t *vrtsim_state = (vrtsim_state_t *)device->priv; bool channel_modelling = vrtsim_state->chanmod || vrtsim_state->taps_socket || vrtsim_state->use_cirdb; if (channel_modelling) { - return vrtsim_write_with_chanmod(vrtsim_state, timestamp, samplesVoid, nsamps, nbAnt, flags); + struct timespec ts; + int ret = clock_gettime(CLOCK_MONOTONIC, &ts); + AssertFatal(ret == 0, "clock_gettime failed\n"); + int num_samples_processed = vrtsim_write_with_chanmod(vrtsim_state, timestamp, samplesVoid, nsamps, nbAnt); + struct timespec end; + ret = clock_gettime(CLOCK_MONOTONIC, &end); + AssertFatal(ret == 0, "clock_gettime failed\n"); + double microseconds = (end.tv_sec - ts.tv_sec) * 1e6 + (end.tv_nsec - ts.tv_nsec) / 1e3; + histogram_add(&vrtsim_state->chanmod_histogram, microseconds); + return num_samples_processed; } if (vrtsim_state->role == ROLE_CLIENT) { for (int aatx = 0; aatx < nbAnt; aatx++) { int global_ul_ant = vrtsim_state->ue.tx_offset + aatx; - vrtsim_write_internal(vrtsim_state, timestamp, (c16_t *)samplesVoid[aatx], nsamps, global_ul_ant, flags, 0); + vrtsim_write_internal(vrtsim_state, timestamp, (c16_t *)samplesVoid[aatx], nsamps, global_ul_ant); } return nsamps; } else { @@ -879,7 +759,7 @@ static int vrtsim_write(openair0_device_t *device, int num_rx_ant = vrtsim_state->ue_conf[u].rx_ant; for (int aarx = 0; aarx < num_rx_ant; aarx++) { int global_dl_ant = rx_offset + aarx; - vrtsim_write_internal(vrtsim_state, timestamp, (c16_t *)samplesVoid[0], nsamps, global_dl_ant, flags, 0); + vrtsim_write_internal(vrtsim_state, timestamp, (c16_t *)samplesVoid[0], nsamps, global_dl_ant); } } return nsamps; @@ -927,29 +807,24 @@ static int vrtsim_read(openair0_device_t *device, openair0_timestamp_t *ptimesta if (vrtsim_state->role == ROLE_SERVER) { if (vrtsim_state->num_ues > 1) { /* Multi-UE UL combining */ - if (nsamps > vrtsim_state->ul_combine_buffer_len) { - sample_t *tmp = realloc(vrtsim_state->ul_combine_buffer, nsamps * sizeof(sample_t)); - AssertFatal(tmp != NULL, "Failed to realloc UL combine buffer\n"); - vrtsim_state->ul_combine_buffer = tmp; - vrtsim_state->ul_combine_buffer_len = nsamps; - } for (int aarx = 0; aarx < nbAnt; aarx++) memset(samplesVoid[aarx], 0, nsamps * sizeof(sample_t)); for (int u = 0; u < vrtsim_state->num_ues; u++) { for (int aarx = 0; aarx < nbAnt; aarx++) { int stream = u * nbAnt + aarx; + sample_t buffer[nsamps]; int ret = shm_td_iq_channel_rx(vrtsim_state->channel, vrtsim_state->last_received_sample, nsamps, stream, - vrtsim_state->ul_combine_buffer); + buffer); if (ret == CHANNEL_ERROR_TOO_LATE) { vrtsim_state->rx_samples_late += nsamps; } else if (ret == CHANNEL_ERROR_TOO_EARLY) { vrtsim_state->rx_early += 1; } int16_t *out = (int16_t *)samplesVoid[aarx]; - int16_t *in = (int16_t *)vrtsim_state->ul_combine_buffer; + int16_t *in = (int16_t *)buffer; for (int i = 0; i < nsamps * 2; i++) { int32_t sum = (int32_t)out[i] + (int32_t)in[i]; out[i] = (int16_t)((sum > 32767) ? 32767 : (sum < -32768) ? -32768 : sum); @@ -996,34 +871,19 @@ static void vrtsim_end(openair0_device_t *device) AssertFatal(ret == 0, "pthread_join() failed: errno: %d, %s\n", errno, strerror(errno)); } - tx_timing_t *tx_timing = vrtsim_state->tx_timing; + tx_timing_t *tx_timing = &vrtsim_state->tx_timing; if (vrtsim_state->chanmod || vrtsim_state->taps_socket || vrtsim_state->use_cirdb) { - for (int i = 0; i < vrtsim_state->peer_info.num_rx_antennas; i++) { - shutdown_actor(&vrtsim_state->channel_modelling_actors[i]); - } - free(vrtsim_state->channel_modelling_actors); - if (vrtsim_state->use_cirdb && vrtsim_state->role == ROLE_SERVER && vrtsim_state->num_ues > 1) { - pthread_mutex_destroy(&vrtsim_state->cirdb_mutex); - } - for (int i = 1; i < vrtsim_state->peer_info.num_rx_antennas; i++) { - histogram_merge(&tx_timing->tx_histogram, &tx_timing[i].tx_histogram); - tx_timing->tx_early += tx_timing[i].tx_early; - tx_timing->tx_samples_late += tx_timing[i].tx_samples_late; - tx_timing->average_tx_budget += tx_timing[i].average_tx_budget; - tx_timing->tx_samples_total += tx_timing[i].tx_samples_total; - } - tx_timing->average_tx_budget /= vrtsim_state->peer_info.num_rx_antennas; - free_noise_device(); +#ifdef CUDA_ENABLE + cuda_channel_pipeline_shutdown(vrtsim_state->channel_pipeline_context); +#else + abortTpool(&vrtsim_state->tpool); +#endif if (vrtsim_state->use_cirdb) { cirdb_stop(); } else if (vrtsim_state->taps_socket) { taps_client_stop(); } } - if (vrtsim_state->role == ROLE_SERVER && vrtsim_state->ul_combine_buffer) { - free(vrtsim_state->ul_combine_buffer); - vrtsim_state->ul_combine_buffer = NULL; - } shm_td_iq_channel_abort(vrtsim_state->channel); sleep(1); shm_td_iq_channel_destroy(vrtsim_state->channel); @@ -1037,9 +897,11 @@ static void vrtsim_end(openair0_device_t *device) tx_timing->tx_early, vrtsim_state->rx_early); LOG_I(HW, "VRTSIM: Average TX budget %.3lf uS (more is better)\n", tx_timing->average_tx_budget); - histogram_print(&tx_timing->tx_histogram); - free(vrtsim_state->tx_timing); - + histogram_print(&tx_timing->tx_histogram, "VRTSIM: TX budget histogram"); + if (vrtsim_state->chanmod_histogram.num_samples > 0) { + LOG_I(HW, "VRTSIM: Channel modelling delay in uS (less is better)\n"); + histogram_print(&vrtsim_state->chanmod_histogram, "VRTSIM: Channel modelling delay histogram"); + } if (vrtsim_state->role == ROLE_SERVER) { int ret = remove(vrtsim_state->connection_descriptor); if (ret != 0) { @@ -1114,7 +976,13 @@ __attribute__((__visibility__("default"))) int device_init(openair0_device_t *de int noise_power_dBFS = get_noise_power_dBFS(); int16_t noise_power = noise_power_dBFS == INVALID_DBFS_VALUE ? 0 : (int16_t)(32767.0 / powf(10.0, .05 * -noise_power_dBFS)); LOG_A(HW, "VRTSIM: Noise power %d sample value\n", noise_power); - init_noise_device(noise_power); +#ifdef CUDA_ENABLE + size_t samples_in_one_ms = openair0_cfg->sample_rate / 1000 / 1000; + vrtsim_state->channel_pipeline_context = cuda_channel_pipeline_init(openair0_cfg->tx_num_channels * samples_in_one_ms); +#else + channel_pipeline_init(noise_power); + initNamedTpool(vrtsim_state->thread_pool_cores, &vrtsim_state->tpool, false, "vrtsim_chanmod"); +#endif } openair0_cfg->rx_gain[0] = 0; return 0; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index dd4cad0023..4851203f75 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -162,7 +162,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "f1"; local_n_address = "127.0.0.3"; @@ -175,7 +174,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band66.25prb.rfsim.pci0.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band66.25prb.rfsim.pci0.conf index 23ca35bddf..255b78c266 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band66.25prb.rfsim.pci0.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band66.25prb.rfsim.pci0.conf @@ -158,7 +158,6 @@ gNBs = ); MACRLCs = ({ - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "f1"; local_n_address = "127.0.0.4"; @@ -169,7 +168,6 @@ MACRLCs = ({ }); L1s = ({ - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 200; pucch0_dtx_threshold = 150; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band66.25prb.rfsim.pci1.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band66.25prb.rfsim.pci1.conf index f2bd6f00cc..669f07f161 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band66.25prb.rfsim.pci1.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band66.25prb.rfsim.pci1.conf @@ -158,7 +158,6 @@ gNBs = ); MACRLCs = ({ - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "f1"; local_n_address = "127.0.0.5"; @@ -169,7 +168,6 @@ MACRLCs = ({ }); L1s = ({ - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 200; pucch0_dtx_threshold = 150; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.4x4-benetel650.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.4x4-benetel650.conf index 882080f43a..e632c650ee 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.4x4-benetel650.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.4x4-benetel650.conf @@ -167,7 +167,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "f1"; local_n_address = "172.21.16.51"; @@ -188,7 +187,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 100; pucch0_dtx_threshold = 80; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.4x4-das-benetel650_650.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.4x4-das-benetel650_650.conf index c3adfa0968..044426471d 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.4x4-das-benetel650_650.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.4x4-das-benetel650_650.conf @@ -167,7 +167,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "f1"; local_n_address = "172.21.16.51"; @@ -192,7 +191,6 @@ MACRLCs = ( L1s = ( { enable_das = 1; - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 100; pucch0_dtx_threshold = 80; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.8x8-benetel650_650-mplane.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.8x8-benetel650_650-mplane.conf index bcd388c7c5..fc02a25601 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.8x8-benetel650_650-mplane.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.8x8-benetel650_650-mplane.conf @@ -167,7 +167,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "f1"; local_n_address = "172.21.16.51"; @@ -188,7 +187,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 100; pucch0_dtx_threshold = 80; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.8x8-benetel650_650.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.8x8-benetel650_650.conf index 735525dc5f..6e02f3ef0f 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.8x8-benetel650_650.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.8x8-benetel650_650.conf @@ -167,7 +167,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "f1"; local_n_address = "172.21.16.51"; @@ -188,7 +187,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 100; pucch0_dtx_threshold = 80; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf index 3e5e184ead..fd00e6483b 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf @@ -156,7 +156,6 @@ gNBs = ); MACRLCs = ({ - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "f1"; local_n_address = "127.0.0.4"; @@ -167,7 +166,6 @@ MACRLCs = ({ }); L1s = ({ - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 200; pucch0_dtx_threshold = 150; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci1.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci1.conf index df46fab501..69aa1a1f58 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci1.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci1.conf @@ -156,7 +156,6 @@ gNBs = ); MACRLCs = ({ - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "f1"; local_n_address = "127.0.0.5"; @@ -167,7 +166,6 @@ MACRLCs = ({ }); L1s = ({ - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 200; pucch0_dtx_threshold = 150; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-pnf.band78.rfsim.2x2.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-pnf.band78.rfsim.2x2.conf index 6f8829259f..fe58b16e90 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-pnf.band78.rfsim.2x2.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-pnf.band78.rfsim.2x2.conf @@ -7,7 +7,6 @@ log_config = { }; L1s = ({ - num_cc = 1; tr_n_preference = "nfapi"; remote_n_address = "127.0.0.1"; // vnf addr local_n_address = "127.0.0.1"; // pnf addr diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-pnf.band78.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-pnf.band78.rfsim.conf index 98b0dfb7d0..09fc61dc94 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-pnf.band78.rfsim.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-pnf.band78.rfsim.conf @@ -7,7 +7,6 @@ log_config = { }; L1s = ({ - num_cc = 1; tr_n_preference = "nfapi"; remote_n_address = "127.0.0.1"; // vnf addr local_n_address = "127.0.0.1"; // pnf addr diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.band78.106prb.nfapi.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.band78.106prb.nfapi.conf index 27b21fa8d9..d1774b50f9 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.band78.106prb.nfapi.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.band78.106prb.nfapi.conf @@ -175,13 +175,10 @@ gNBs = MACRLCs = ( { - num_cc = 1; remote_s_address = "127.0.0.1"; // pnf addr [!] local_s_address = "127.0.0.1"; // vnf addr local_s_portc = 50001; // vnf p5 port - remote_s_portc = 50000; // pnf p5 port [!] local_s_portd = 50011; // vnf p7 port [!] - remote_s_portd = 50010; // pnf p7 port [!] tr_s_preference = "nfapi"; tr_n_preference = "local_RRC"; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.band78.273prb.aerial.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.band78.273prb.aerial.conf index 72c5966f54..10e07193b2 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.band78.273prb.aerial.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.band78.273prb.aerial.conf @@ -177,13 +177,10 @@ gNBs = MACRLCs = ( { - num_cc = 1; remote_s_address = "127.0.0.1"; // pnf addr [!] local_s_address = "127.0.0.2"; // vnf addr local_s_portc = 50001; // vnf p5 port - remote_s_portc = 50000; // pnf p5 port [!] local_s_portd = 50011; // vnf p7 port [!] - remote_s_portd = 50010; // pnf p7 port [!] tr_s_preference = "aerial"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 280; # 150; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.band78.273prb.nfapi.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.band78.273prb.nfapi.conf index 8f2f48a15c..9ed2919bc1 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.band78.273prb.nfapi.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.band78.273prb.nfapi.conf @@ -179,13 +179,10 @@ gNBs = MACRLCs = ( { - num_cc = 1; remote_s_address = "127.0.0.1"; // pnf addr [!] local_s_address = "127.0.0.2"; // vnf addr local_s_portc = 50001; // vnf p5 port - remote_s_portc = 50000; // pnf p5 port [!] local_s_portd = 50011; // vnf p7 port [!] - remote_s_portd = 50010; // pnf p7 port [!] tr_s_preference = "nfapi"; tr_n_preference = "local_RRC"; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.cbrs.aerial.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.cbrs.aerial.conf index db52106e4b..acad81a2a2 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.cbrs.aerial.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.cbrs.aerial.conf @@ -177,14 +177,11 @@ gNBs = MACRLCs = ( { - num_cc = 1; local_s_if_name = "lo:"; remote_s_address = "127.0.0.1"; // pnf addr [!] local_s_address = "127.0.0.2"; // vnf addr local_s_portc = 50001; // vnf p5 port - remote_s_portc = 50000; // pnf p5 port [!] local_s_portd = 50011; // vnf p7 port [!] - remote_s_portd = 50010; // pnf p7 port [!] tr_s_preference = "aerial"; tr_n_preference = "local_RRC"; pusch_FailureThres = 10; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index 6c82e9e2c1..111fd2700a 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -204,7 +204,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; # pusch_TargetSNRx10 = 200; @@ -214,7 +213,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf index 18d51ac039..7fc3d62661 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf @@ -208,7 +208,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; #pusch_TargetSNRx10 = 200; @@ -218,7 +217,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band1.u0.52PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band1.u0.52PRB.usrpb210.conf index 8679467454..1bbcd2b853 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band1.u0.52PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band1.u0.52PRB.usrpb210.conf @@ -166,7 +166,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -176,7 +175,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 100; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band254.ntn.mu1.24prb.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band254.ntn.mu1.24prb.rfsim.conf index 2aef12de15..5b711040ae 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band254.ntn.mu1.24prb.rfsim.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band254.ntn.mu1.24prb.rfsim.conf @@ -193,7 +193,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -203,7 +202,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band255.ntn.mu0.25prb.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band255.ntn.mu0.25prb.rfsim.conf index 9add7136fb..6bdb33c981 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band255.ntn.mu0.25prb.rfsim.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band255.ntn.mu0.25prb.rfsim.conf @@ -192,7 +192,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -202,7 +201,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band256.ntn.mu0.25prb.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band256.ntn.mu0.25prb.rfsim.conf index 1c56bf2ed7..a7be3890e1 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band256.ntn.mu0.25prb.rfsim.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band256.ntn.mu0.25prb.rfsim.conf @@ -192,7 +192,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -202,7 +201,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.66prb.fhi72.2x2-liteon.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.66prb.fhi72.2x2-liteon.conf index 149f79cb30..2b785d6ee7 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.66prb.fhi72.2x2-liteon.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.66prb.fhi72.2x2-liteon.conf @@ -175,7 +175,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -194,7 +193,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 250; pucch0_dtx_threshold = 100; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.u3.32prb.usrpx410.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.u3.32prb.usrpx410.conf index 00fa4a5cea..dac5890728 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.u3.32prb.usrpx410.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.u3.32prb.usrpx410.conf @@ -173,7 +173,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; #pusch_TargetSNRx10 = 150; @@ -183,7 +182,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; #pucch0_dtx_threshold = 120; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index b43313c735..db724b9f8d 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -170,7 +170,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -183,7 +182,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 100; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.52PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.52PRB.usrpb210.conf index e1e7fb857b..d297aa7f14 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.52PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.52PRB.usrpb210.conf @@ -175,7 +175,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -185,7 +184,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; pusch_proc_threads = 8; prach_dtx_threshold = 120; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band512.ntn.mu3.132prb.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band512.ntn.mu3.132prb.rfsim.conf index b487b2eb22..b88ca99c91 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band512.ntn.mu3.132prb.rfsim.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band512.ntn.mu3.132prb.rfsim.conf @@ -205,7 +205,6 @@ rlc = { MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; } @@ -213,7 +212,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band512.ntn.mu3.32prb.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band512.ntn.mu3.32prb.rfsim.conf index c70e97b1b5..deedbb695c 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band512.ntn.mu3.32prb.rfsim.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band512.ntn.mu3.32prb.rfsim.conf @@ -207,7 +207,6 @@ rlc = { MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; } @@ -215,7 +214,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band512.ntn.mu3.66prb.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band512.ntn.mu3.66prb.rfsim.conf index dca5bfee22..5b18f6776e 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band512.ntn.mu3.66prb.rfsim.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band512.ntn.mu3.66prb.rfsim.conf @@ -206,7 +206,6 @@ rlc = { MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; } @@ -214,7 +213,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf index 802e7b27f3..602447e7e4 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf @@ -171,7 +171,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; ulsch_max_slots_inactivity = 100; @@ -182,7 +181,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpx300.conf index 0814b884e4..72b0d38c38 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpx300.conf @@ -186,7 +186,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -196,7 +195,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.24PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.24PRB.usrpx300.conf index 815f1364d9..fced0d90a3 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.24PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.24PRB.usrpx300.conf @@ -220,7 +220,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -232,7 +231,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 150; pucch0_dtx_threshold = 150; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.25PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.25PRB.usrpx300.conf index 46cf01a74d..b502554fd1 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.25PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.25PRB.usrpx300.conf @@ -220,7 +220,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -232,7 +231,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 150; pucch0_dtx_threshold = 150; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.u0.25prb.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.u0.25prb.rfsim.conf index c25ea1771b..44d453c285 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.u0.25prb.rfsim.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.u0.25prb.rfsim.conf @@ -171,7 +171,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -181,7 +180,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.106prb.fhi72.4x4-vvdn.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.106prb.fhi72.4x4-vvdn.conf index ea4a9b33ba..4032f9c275 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.106prb.fhi72.4x4-vvdn.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.106prb.fhi72.4x4-vvdn.conf @@ -175,7 +175,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -190,7 +189,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 110; pucch0_dtx_threshold = 80; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.162prb.usrpn310.4x4.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.162prb.usrpn310.4x4.conf index 5d23440284..74885407b0 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.162prb.usrpn310.4x4.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.162prb.usrpn310.4x4.conf @@ -178,7 +178,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 250; @@ -190,7 +189,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pusch_dtx_threshold = 20; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.2x2-benetel550-long-prach.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.2x2-benetel550-long-prach.conf index 61aa517afd..e22d5d566d 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.2x2-benetel550-long-prach.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.2x2-benetel550-long-prach.conf @@ -174,7 +174,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 180; @@ -190,7 +189,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 100; pucch0_dtx_threshold = 10; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.2x2-vvdn-16b.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.2x2-vvdn-16b.conf index 28a970caa5..dd2efe911c 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.2x2-vvdn-16b.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.2x2-vvdn-16b.conf @@ -172,7 +172,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 180; @@ -187,7 +186,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 130 pucch0_dtx_threshold = 80; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf index 46558e63bc..9edbd527c7 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf @@ -174,7 +174,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 180; @@ -189,7 +188,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 130 pucch0_dtx_threshold = 80; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.2x2.usrpn300.conf index 5a7d820a33..fdacd22737 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.2x2.usrpn300.conf @@ -170,7 +170,6 @@ gNBs = ( MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 300; @@ -181,7 +180,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 80; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.usrpx300.conf index 3527237ec9..c61b9e6769 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.usrpx300.conf @@ -170,7 +170,6 @@ gNBs = ( MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 300; @@ -181,7 +180,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 80; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.106PRB.usrpb210.RA_2-Step.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.106PRB.usrpb210.RA_2-Step.conf index b0eb1bf69f..4e5603884b 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.106PRB.usrpb210.RA_2-Step.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.106PRB.usrpb210.RA_2-Step.conf @@ -194,7 +194,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -204,7 +203,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 100; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.106prb.bladerf2.0xa4.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.106prb.bladerf2.0xa4.conf index e98f5efd6d..7b223bea88 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.106prb.bladerf2.0xa4.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.106prb.bladerf2.0xa4.conf @@ -171,7 +171,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -181,7 +180,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 200; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.106prb.fhi72.1x1-proto-ru.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.106prb.fhi72.1x1-proto-ru.conf index 23a932f727..7255b6a14e 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.106prb.fhi72.1x1-proto-ru.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.106prb.fhi72.1x1-proto-ru.conf @@ -174,7 +174,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 250; @@ -189,7 +188,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 200; pucch0_dtx_threshold = 100; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.2x2-benetel550-16b.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.2x2-benetel550-16b.conf index 9e75c482a7..6369df890b 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.2x2-benetel550-16b.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.2x2-benetel550-16b.conf @@ -175,7 +175,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 180; @@ -191,7 +190,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 100; pucch0_dtx_threshold = 80; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x2-benetel550.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x2-benetel550.conf index f5b6adf389..1b75f55d5f 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x2-benetel550.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x2-benetel550.conf @@ -173,7 +173,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 180; @@ -189,7 +188,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 100; pucch0_dtx_threshold = 80; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550-mplane.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550-mplane.conf index 1b532c71f0..cbde1e7cbd 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550-mplane.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550-mplane.conf @@ -175,7 +175,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 180; @@ -191,7 +190,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 100; pucch0_dtx_threshold = 80; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf index ba2635be13..81f1ebb6e9 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf @@ -175,7 +175,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 180; @@ -191,7 +190,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 100; pucch0_dtx_threshold = 80; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-foxconn.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-foxconn.conf index 1301875918..8894d1769b 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-foxconn.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-foxconn.conf @@ -174,7 +174,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 120; @@ -188,7 +187,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 130; pucch0_dtx_threshold = 80; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-liteon.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-liteon.conf index e883f08ca2..a520ac421f 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-liteon.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-liteon.conf @@ -174,7 +174,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -189,7 +188,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 130 pucch0_dtx_threshold = 80; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-metanoia.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-metanoia.conf index 23822e7fd6..f56f9e2dde 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-metanoia.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-metanoia.conf @@ -157,7 +157,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 220; @@ -171,7 +170,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 130; pucch0_dtx_threshold = 80; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.51PRB.bladerf2.0xa4.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.51PRB.bladerf2.0xa4.conf index 9bc72202ce..2a5f990d09 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.51PRB.bladerf2.0xa4.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.51PRB.bladerf2.0xa4.conf @@ -169,7 +169,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -179,7 +178,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 150; pucch0_dtx_threshold = 100; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 11e6cdd3e6..7522264325 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -172,7 +172,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; #pusch_TargetSNRx10 = 150; @@ -182,7 +181,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; #pucch0_dtx_threshold = 120; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci0.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci0.rfsim.conf index be3c4ad04b..8773e2a92d 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci0.rfsim.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci0.rfsim.conf @@ -173,7 +173,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -183,7 +182,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 100; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci1.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci1.rfsim.conf index af7df10aa2..444762c266 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci1.rfsim.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci1.rfsim.conf @@ -173,7 +173,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -183,7 +182,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 100; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.2pattern.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.2pattern.conf index 5988b3f08b..0fb2454d26 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.2pattern.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.2pattern.conf @@ -172,7 +172,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -182,7 +181,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 100; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.4layer.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.4layer.conf index 63a743b3a0..18ce0529ec 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.4layer.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.4layer.conf @@ -172,7 +172,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -182,7 +181,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; pusch_proc_threads = 8; prach_dtx_threshold = 120; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 39f9527576..e19b88cdd4 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -172,7 +172,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -182,7 +181,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 100; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.redcap.yaml b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.redcap.yaml index ce13467aa2..b5b5708811 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.redcap.yaml +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.redcap.yaml @@ -168,17 +168,13 @@ gNBs: GNB_PORT_FOR_S1U: 2152 # Spec 2152 MACRLCs: - - - num_cc: 1 - tr_s_preference: local_L1 + - tr_s_preference: local_L1 tr_n_preference: local_RRC pusch_TargetSNRx10: 150 pucch_TargetSNRx10: 200 L1s: - - - num_cc: 1 - tr_n_preference: local_mac + - tr_n_preference: local_mac prach_dtx_threshold: 120 pucch0_dtx_threshold: 100 ofdm_offset_divisor: 8 #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf index 0eae8d0b10..f0ffeda4ed 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf @@ -180,7 +180,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -190,7 +189,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.yaml b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.yaml index 3081592eb0..35863c042b 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.yaml +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.yaml @@ -149,17 +149,13 @@ gNBs: GNB_PORT_FOR_S1U: 2152 # Spec 2152 MACRLCs: - - - num_cc: 1 - tr_s_preference: local_L1 + - tr_s_preference: local_L1 tr_n_preference: local_RRC pusch_TargetSNRx10: 150 pucch_TargetSNRx10: 200 L1s: - - - num_cc: 1 - tr_n_preference: local_mac + - tr_n_preference: local_mac prach_dtx_threshold: 120 pucch0_dtx_threshold: 100 ofdm_offset_divisor: 8 #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf index a5e3678c49..6601237d9e 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -179,7 +179,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 300; @@ -190,7 +189,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 80; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.189PRB.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.189PRB.rfsim.conf index 1eb9642821..b0aefa7e42 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.189PRB.rfsim.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.189PRB.rfsim.conf @@ -176,7 +176,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -186,7 +185,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 200; # pucch0_dtx_threshold = 150; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.2x2.usrpn300.conf index df5bfd99ef..f1f2b28775 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.2x2.usrpn300.conf @@ -173,7 +173,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -184,7 +183,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 80; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.24PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.24PRB.usrpb210.conf index 707c08f580..93e24124c9 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.24PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.24PRB.usrpb210.conf @@ -170,7 +170,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -180,7 +179,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; pusch_proc_threads = 8; prach_dtx_threshold = 120; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb0.prs.band261.fr2.64PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb0.prs.band261.fr2.64PRB.usrpx310.conf index cb14d01411..b014794a78 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb0.prs.band261.fr2.64PRB.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb0.prs.band261.fr2.64PRB.usrpx310.conf @@ -183,7 +183,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -213,7 +212,6 @@ prs_config = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb0.prs.band78.fr1.106PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb0.prs.band78.fr1.106PRB.usrpx310.conf index 6dedc07362..6777091865 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb0.prs.band78.fr1.106PRB.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb0.prs.band78.fr1.106PRB.usrpx310.conf @@ -170,7 +170,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -180,7 +179,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 100; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb1.prs.band261.fr2.64PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb1.prs.band261.fr2.64PRB.usrpx310.conf index 78c9570ea3..192a6958d2 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb1.prs.band261.fr2.64PRB.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb1.prs.band261.fr2.64PRB.usrpx310.conf @@ -189,7 +189,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; @@ -219,7 +218,6 @@ prs_config = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb1.prs.band78.fr1.106PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb1.prs.band78.fr1.106PRB.usrpx310.conf index e5968ec010..d9da3fb77e 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb1.prs.band78.fr1.106PRB.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb1.prs.band78.fr1.106PRB.usrpx310.conf @@ -170,7 +170,6 @@ gNBs = MACRLCs = ( { - num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; @@ -180,7 +179,6 @@ MACRLCs = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 100; diff --git a/tests/nr-cu-nrppa/nr-nrppa-test.conf b/tests/nr-cu-nrppa/nr-nrppa-test.conf index 6db9c7b355..1bbda67679 100644 --- a/tests/nr-cu-nrppa/nr-nrppa-test.conf +++ b/tests/nr-cu-nrppa/nr-nrppa-test.conf @@ -53,7 +53,6 @@ positioning_config = ( L1s = ( { - num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; diff --git a/tests/nr-cuup/nr-cuup-load-test.c b/tests/nr-cuup/nr-cuup-load-test.c index f45ab2a0ff..e39dd9d267 100644 --- a/tests/nr-cuup/nr-cuup-load-test.c +++ b/tests/nr-cuup/nr-cuup-load-test.c @@ -12,6 +12,7 @@ #include "openair2/E1AP/e1ap.h" #include "openair3/ocp-gtpu/gtp_itf.h" #include "openair2/E1AP/lib/e1ap_interface_management.h" +#include "common/config/config_userapi.h" configmodule_interface_t *uniqCfg; diff --git a/tools/docker-dev-env/Dockerfile b/tools/docker-dev-env/Dockerfile index ab38735d9d..dfc7030bc7 100644 --- a/tools/docker-dev-env/Dockerfile +++ b/tools/docker-dev-env/Dockerfile @@ -25,7 +25,7 @@ RUN cd /oai-ran && \ ## Build Fronthaul library COPY cmake_targets/tools/oran_fhi_integration_patches/F/oaioran_F.patch /oaioran_F.patch -RUN git clone https://gerrit.o-ran-sc.org/r/o-du/phy.git /opt/phy && \ +RUN git clone https://github.com/openairinterface/o-du-phy.git /opt/phy && \ cd /opt/phy && \ git checkout oran_f_release_v1.0 &&\ git apply /oaioran_F.patch && \