mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-18 23:20:32 +00:00
Compare commits
161 Commits
dapp
...
rm_interle
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0fb553f2c8 | ||
|
|
d03ad27e65 | ||
|
|
571b3289eb | ||
|
|
49f4be942a | ||
|
|
22c3fae762 | ||
|
|
abb7cbe2bd | ||
|
|
9feed9f4d1 | ||
|
|
8a5960461e | ||
|
|
458fd3623a | ||
|
|
6fc2d06077 | ||
|
|
428ed54db4 | ||
|
|
a2719bd9d7 | ||
|
|
5f4aff8a1d | ||
|
|
9e4308030b | ||
|
|
228dad1ec2 | ||
|
|
d39a40dba2 | ||
|
|
181b5d89f8 | ||
|
|
870454d13d | ||
|
|
dd424a2e0c | ||
|
|
e83867a505 | ||
|
|
76b7972bc0 | ||
|
|
782ede870e | ||
|
|
9d35b9028c | ||
|
|
8a0be83745 | ||
|
|
7c29d27487 | ||
|
|
5fd1f07e7e | ||
|
|
c0835cca75 | ||
|
|
f39fb4a84b | ||
|
|
2d9ed6adc4 | ||
|
|
b5c460b17f | ||
|
|
2214ecd81a | ||
|
|
c555682fdc | ||
|
|
c89fe9737f | ||
|
|
36ed4d9ff1 | ||
|
|
04a9145fe1 | ||
|
|
7026366b5d | ||
|
|
b29e7bc2c6 | ||
|
|
4e6e0e529d | ||
|
|
d191447a01 | ||
|
|
5fcf815c56 | ||
|
|
e557ffdc57 | ||
|
|
328c4bc5fa | ||
|
|
58942c31a5 | ||
|
|
3b8f5c7191 | ||
|
|
c42928773b | ||
|
|
439d0d9d8d | ||
|
|
695cdb4b38 | ||
|
|
9050b3eb3c | ||
|
|
7827ac38b0 | ||
|
|
4ab102c680 | ||
|
|
4f74b2c7eb | ||
|
|
3959e80f4e | ||
|
|
8d6e3e4387 | ||
|
|
df21063668 | ||
|
|
73d2b9c7e2 | ||
|
|
51c773f411 | ||
|
|
4a325ccf09 | ||
|
|
f02c84fcfc | ||
|
|
b11cf166af | ||
|
|
ea1376a5c1 | ||
|
|
00d6cc034d | ||
|
|
5eb2480122 | ||
|
|
80088121d3 | ||
|
|
e95992927c | ||
|
|
04e9fcbef9 | ||
|
|
22bc4f690a | ||
|
|
4103703f56 | ||
|
|
d843877123 | ||
|
|
3c4081489a | ||
|
|
188d186ef9 | ||
|
|
1b1b5397c1 | ||
|
|
1df35d7994 | ||
|
|
9e95495c36 | ||
|
|
3016ada216 | ||
|
|
30bd2c183b | ||
|
|
e17823649a | ||
|
|
0a58095692 | ||
|
|
8097b4a479 | ||
|
|
275afe7d16 | ||
|
|
89deb54384 | ||
|
|
12d6f6eccd | ||
|
|
c9587a8876 | ||
|
|
12ac3ace12 | ||
|
|
534ec1755f | ||
|
|
084b02a38b | ||
|
|
95a9438d44 | ||
|
|
5a1af1a7db | ||
|
|
5f0f68caf8 | ||
|
|
3ad1b5c701 | ||
|
|
74decfcf30 | ||
|
|
8125f8a2eb | ||
|
|
652a9e455b | ||
|
|
c8b99ce011 | ||
|
|
6786df3102 | ||
|
|
17ff43168f | ||
|
|
ef971849bd | ||
|
|
4ad557a0e3 | ||
|
|
e041a2a078 | ||
|
|
04126759aa | ||
|
|
8ceb7ec37b | ||
|
|
302c1c0450 | ||
|
|
773e62077b | ||
|
|
f17b2bb805 | ||
|
|
f1b8d45bf9 | ||
|
|
43ec237a4f | ||
|
|
428859f218 | ||
|
|
c97820622a | ||
|
|
77aff40af7 | ||
|
|
835c80b39d | ||
|
|
522fb88c6e | ||
|
|
971436030d | ||
|
|
d085bb0ba0 | ||
|
|
ab00b2ff94 | ||
|
|
24dd7b5b9e | ||
|
|
d4c1731e97 | ||
|
|
6560403d3c | ||
|
|
4b5d5c1ae6 | ||
|
|
67e646aa7c | ||
|
|
9327b4be6b | ||
|
|
01add4ab43 | ||
|
|
7f13e04f75 | ||
|
|
226266743c | ||
|
|
ef505b55d7 | ||
|
|
89c9e89a9d | ||
|
|
fa4bb92d03 | ||
|
|
116c893d45 | ||
|
|
f9b0dd6af3 | ||
|
|
4b85b71523 | ||
|
|
e4b2125f1e | ||
|
|
d5c0e580ab | ||
|
|
c307e20ab9 | ||
|
|
6c39ea2b0b | ||
|
|
7e9d3cc328 | ||
|
|
4ab525aca1 | ||
|
|
d8962fa270 | ||
|
|
d420f8c123 | ||
|
|
e92dfe2f93 | ||
|
|
d1b777e0a5 | ||
|
|
35965a1418 | ||
|
|
103c1d48e3 | ||
|
|
0755086cc2 | ||
|
|
683d1b594f | ||
|
|
c8ff0819f8 | ||
|
|
ee4018b5d0 | ||
|
|
49e6575910 | ||
|
|
79ebf23a80 | ||
|
|
3cbf0927be | ||
|
|
6c534c3b76 | ||
|
|
b5e0cf6a2b | ||
|
|
4d67a6e513 | ||
|
|
ced388a0f4 | ||
|
|
134d750a88 | ||
|
|
13963ba70d | ||
|
|
28c1634fdd | ||
|
|
ec171483e9 | ||
|
|
d75b8963ab | ||
|
|
3329877914 | ||
|
|
0538ea4937 | ||
|
|
b5aa2d87fb | ||
|
|
ef0b4460b6 | ||
|
|
58f00921c8 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -34,5 +34,3 @@ nfapi_nr_interface_scf
|
||||
*.log
|
||||
*.out
|
||||
CMakeUserPresets.json
|
||||
|
||||
build/*
|
||||
|
||||
@@ -221,9 +221,9 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set(commonOpts "${commonOpts} -Wno-packed-bitfield-compat")
|
||||
endif()
|
||||
# clang: suppress complaints about unused command line argument (-rdynamic only
|
||||
# used during linking)
|
||||
# used during linking) and "const member leaves the object uninitialized"
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
set(commonOpts "${commonOpts} -Wno-unused-command-line-argument")
|
||||
set(commonOpts "${commonOpts} -Wno-unused-command-line-argument -Wno-default-const-init-field-unsafe")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS
|
||||
@@ -377,12 +377,6 @@ endif()
|
||||
add_boolean_option(ENABLE_IMSCOPE OFF "Enable phy scope based on imgui" OFF)
|
||||
add_boolean_option(ENABLE_IMSCOPE_RECORD OFF "Enable recording IQ data for imscope" OFF)
|
||||
|
||||
#########################
|
||||
##### E3 AGENT
|
||||
#########################
|
||||
set(E3_AGENT "OFF" CACHE STRING "O-RAN nGRG E3 Agent for dApps")
|
||||
set_property(CACHE E3_AGENT PROPERTY STRINGS "ON" "OFF")
|
||||
|
||||
##################################################
|
||||
# ASN.1 grammar C code generation & dependencies #
|
||||
##################################################
|
||||
@@ -735,9 +729,6 @@ set(SCHED_NR_SRC
|
||||
add_library(SCHED_NR_LIB ${SCHED_NR_SRC})
|
||||
target_link_libraries(SCHED_NR_LIB PRIVATE asn1_nr_rrc_hdrs UTIL)
|
||||
target_link_libraries(SCHED_NR_LIB PRIVATE NFAPI_LIB) # some FAPI messages pack "subPDUs"
|
||||
if(E3_AGENT)
|
||||
target_compile_definitions(SCHED_NR_LIB PRIVATE E3_AGENT)
|
||||
endif()
|
||||
|
||||
set(SCHED_SRC_RU
|
||||
${OPENAIR1_DIR}/SCHED/ru_procedures.c
|
||||
@@ -1145,12 +1136,20 @@ set(NR_PDCP_SRC
|
||||
${OPENAIR2_DIR}/LAYER2/nr_pdcp/nr_pdcp_integrity_nia2.c
|
||||
${OPENAIR2_DIR}/LAYER2/nr_pdcp/nr_pdcp_integrity_nia1.c
|
||||
${OPENAIR2_DIR}/LAYER2/nr_pdcp/asn1_utils.c
|
||||
)
|
||||
|
||||
# gNB: PDCP + CU-CP/CU-UP interface
|
||||
set(NR_PDCP_SRC_GNB
|
||||
${NR_PDCP_SRC}
|
||||
openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c
|
||||
openair2/LAYER2/nr_pdcp/cuup_cucp_if.c
|
||||
openair2/LAYER2/nr_pdcp/cuup_cucp_direct.c
|
||||
openair2/LAYER2/nr_pdcp/cuup_cucp_e1ap.c
|
||||
)
|
||||
|
||||
# UE build: PDCP only; CU-CP/CU-UP interface is gNB-only.
|
||||
set(NR_PDCP_SRC_UE ${NR_PDCP_SRC})
|
||||
|
||||
set(NR_SDAP_SRC
|
||||
${OPENAIR2_DIR}/SDAP/nr_sdap/nr_sdap.c
|
||||
${OPENAIR2_DIR}/SDAP/nr_sdap/nr_sdap_entity.c
|
||||
@@ -1194,7 +1193,7 @@ set(L2_LTE_SRC
|
||||
)
|
||||
|
||||
set(L2_NR_SRC
|
||||
${NR_PDCP_SRC}
|
||||
${NR_PDCP_SRC_GNB}
|
||||
${NR_SDAP_SRC}
|
||||
${NR_RRC_DIR}/rrc_gNB.c
|
||||
${NR_RRC_DIR}/mac_rrc_dl_direct.c
|
||||
@@ -1230,7 +1229,7 @@ set(L2_RRC_SRC_UE
|
||||
)
|
||||
|
||||
set(NR_L2_SRC_UE
|
||||
${NR_PDCP_SRC}
|
||||
${NR_PDCP_SRC_UE}
|
||||
${NR_SDAP_SRC}
|
||||
${NR_UE_RRC_DIR}/L2_interface_ue.c
|
||||
${NR_UE_RRC_DIR}/main_ue.c
|
||||
@@ -1348,7 +1347,6 @@ if(E2_AGENT)
|
||||
target_compile_definitions(L2 PRIVATE ${E2AP_VERSION} ${KPM_VERSION} E2_AGENT)
|
||||
endif()
|
||||
|
||||
|
||||
add_library(MAC_UE_NR ${MAC_NR_SRC_UE})
|
||||
target_link_libraries(MAC_UE_NR PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs PUBLIC nr_ue_power_procedures nr_ue_ra_procedures)
|
||||
|
||||
@@ -1375,18 +1373,14 @@ add_library(e1_if
|
||||
target_link_libraries(e1_if PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs asn1_f1ap SECURITY ${OPENSSL_LIBRARIES} e1ap GTPV1U)
|
||||
|
||||
target_link_libraries(L2_NR PRIVATE f1ap x2ap s1ap ngap nr_rrc e1ap nr_rlc nr_common)
|
||||
target_compile_definitions(L2_NR PRIVATE PDCP_CUCP_CUUP)
|
||||
if(OAI_AERIAL)
|
||||
target_compile_definitions(L2_NR PRIVATE ENABLE_AERIAL)
|
||||
endif()
|
||||
|
||||
if(E3_AGENT)
|
||||
target_compile_definitions(L2_NR PRIVATE E3_AGENT)
|
||||
endif()
|
||||
|
||||
add_library(L2_LTE_NR
|
||||
# temporary solution until 4G/5G code completely untangled (as evidenced by deletion of the following file)
|
||||
${MAC_DIR}/dummy_functions.c
|
||||
${ENB_APP_SRC}
|
||||
)
|
||||
|
||||
target_link_libraries(L2_LTE_NR PRIVATE f1ap s1ap nr_rrc)
|
||||
@@ -1903,11 +1897,6 @@ if(E2_AGENT)
|
||||
target_compile_definitions(nr-softmodem PRIVATE ${E2AP_VERSION} ${KPM_VERSION} E2_AGENT)
|
||||
endif()
|
||||
|
||||
if (E3_AGENT)
|
||||
target_link_libraries(nr-softmodem PRIVATE e3ap)
|
||||
target_compile_definitions(nr-softmodem PRIVATE E3_AGENT)
|
||||
endif()
|
||||
|
||||
|
||||
# force the generation of ASN.1 so that we don't need to wait during the build
|
||||
target_link_libraries(nr-softmodem PRIVATE
|
||||
@@ -1917,7 +1906,7 @@ add_executable(nr-cuup
|
||||
executables/nr-cuup.c
|
||||
${NR_RRC_DIR}/rrc_gNB_UE_context.c
|
||||
${OPENAIR2_DIR}/E1AP/e1ap_setup.c
|
||||
${NR_PDCP_SRC}
|
||||
${NR_PDCP_SRC_GNB}
|
||||
${NR_SDAP_SRC}
|
||||
)
|
||||
|
||||
@@ -1928,12 +1917,9 @@ target_link_libraries(nr-cuup PRIVATE
|
||||
alg
|
||||
dl pthread ${T_LIB})
|
||||
target_link_libraries(nr-cuup PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
|
||||
target_compile_definitions(nr-cuup PRIVATE PDCP_CUCP_CUUP)
|
||||
if(E2_AGENT)
|
||||
target_link_libraries(nr-cuup PRIVATE e2_agent e2_agent_arg e2_ran_func_cuup)
|
||||
if(E3_AGENT)
|
||||
target_link_libraries(nr-cuup PRIVATE e3ap)
|
||||
target_compile_definitions(nr-cuup PRIVATE E3_AGENT)
|
||||
endif()
|
||||
target_compile_definitions(nr-cuup PRIVATE ${E2AP_VERSION} ${KPM_VERSION} E2_AGENT)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
||||
|
||||
# Contributing to OpenAirInterface #
|
||||
# Contributing to OpenAirInterface
|
||||
|
||||
We want to make contributing to this project as easy and transparent as possible.
|
||||
|
||||
@@ -11,10 +11,10 @@ Please refer to the steps described on our website: [How to contribute to OAI](h
|
||||
if you do not have any.
|
||||
- We recommend that you register with a professional or student email address.
|
||||
- If your email domain (`@domain.com`) is not whitelisted, please contact us
|
||||
(mailto:contact@openairinterface.org).
|
||||
(mailto:oaicicdteam@openairinterface.org).
|
||||
- Eurecom GitLab does NOT accept public email domains.
|
||||
3. Provide the OAI team with the **username** of this account to
|
||||
(mailto:contact@openairinterface.org) ; we will give you the developer
|
||||
(mailto:oaicicdteam@openairinterface.org) ; we will give you the developer
|
||||
rights on this repository.
|
||||
4. The contributing policies are described in the [corresponding documentation
|
||||
page](doc/code-style-contrib.md).
|
||||
@@ -24,8 +24,43 @@ Please refer to the steps described on our website: [How to contribute to OAI](h
|
||||
request from a forked repository.
|
||||
* This decision was made for the license reasons.
|
||||
* The Continuous Integration will reject your merge request.
|
||||
5. Mandatory signing of all the commits using the email address used for CLA.
|
||||
|
||||
# License #
|
||||
## Commit Guidelines
|
||||
|
||||
### Signing Commits
|
||||
|
||||
To sign commits:
|
||||
|
||||
You can also get the verified label
|
||||
on your commits via using [SSH KEYS or GPG KEYS](https://docs.gitlab.com/user/project/repository/signed_commits/)
|
||||
|
||||
```
|
||||
# Edit .git/config in the git repository you are working on
|
||||
# Add the user section
|
||||
[user]
|
||||
name = YOUR NAME
|
||||
email = YOUR EMAIL ADDRESS
|
||||
|
||||
# If you use a signing key, use the below configuration instead
|
||||
[user]
|
||||
name = YOUR NAME
|
||||
email = YOUR EMAIL ADDRESS
|
||||
signingkey = LOCATION OF SSH KEYS or GPG KEY
|
||||
|
||||
[gpg]
|
||||
format = ssh
|
||||
|
||||
[commit]
|
||||
gpgsign = true
|
||||
```
|
||||
|
||||
> **NOTE:** If your commits are not signed the CI framework will not accept the MR.
|
||||
|
||||
For more information regarding contribution guidelines
|
||||
please check [this document](doc/code-style-contrib.md)
|
||||
|
||||
## License
|
||||
|
||||
By contributing to OpenAirInterface, you agree that your contributions will be
|
||||
licensed under
|
||||
|
||||
@@ -87,9 +87,20 @@ pipeline {
|
||||
// since a bit, in push events, gitlabUserEmail is not populated
|
||||
gitCommitAuthorEmailAddr = env.gitlabUserEmail
|
||||
echo "GitLab Usermail is ${gitCommitAuthorEmailAddr}"
|
||||
// GitLab-Jenkins plugin integration is lacking to perform the merge by itself
|
||||
// Doing it manually --> it may have merge conflicts
|
||||
sh "./ci-scripts/doGitLabMerge.sh --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
|
||||
// Validate MR commits: checks for missing Signed-off-by and merge commits
|
||||
def mrValidationLog = "signedCommit_${env.BUILD_NUMBER}.log"
|
||||
def mrValidationExitCode = sh(
|
||||
script: "bash ./ci-scripts/pre-ci-check.sh -s origin/${env.gitlabSourceBranch} -t origin/${env.gitlabTargetBranch} > ${mrValidationLog} 2>&1",
|
||||
returnStatus: true
|
||||
)
|
||||
def mrValidationMessage = readFile(mrValidationLog).trim()
|
||||
sh "rm -f ${mrValidationLog}"
|
||||
if (mrValidationExitCode >= 1) {
|
||||
addGitLabMRComment comment: "${mrValidationMessage}"
|
||||
}
|
||||
if (mrValidationExitCode >= 2) {
|
||||
error("${mrValidationMessage}")
|
||||
}
|
||||
} else {
|
||||
echo "Git Branch is ${GIT_BRANCH}"
|
||||
echo "Git Commit is ${GIT_COMMIT}"
|
||||
@@ -100,29 +111,19 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
failure {
|
||||
script {
|
||||
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Merge Conflicts -- Cannot perform CI"
|
||||
addGitLabMRComment comment: message
|
||||
currentBuild.result = 'FAILURE'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Local-Repo-Push") {
|
||||
steps {
|
||||
script {
|
||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||
triggerSlaveJob ('RAN-Local-Repo-Push', 'Local-Repo-Push')
|
||||
}
|
||||
triggerSlaveJob ('RAN-Local-Repo-Push', 'Local-Repo-Push')
|
||||
}
|
||||
}
|
||||
post {
|
||||
failure {
|
||||
script {
|
||||
echo "Push to local repository KO"
|
||||
failingStages += '\n * RAN-Local-Repo-Push'
|
||||
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Cannot perform CI - merge validation failed (merge conflict, git operation failure, or internal CI error)."
|
||||
addGitLabMRComment comment: message
|
||||
currentBuild.result = 'FAILURE'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -748,6 +749,29 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("SA-FHI72-MPLANE-CN5G") {
|
||||
when { expression {do5Gtest} }
|
||||
steps {
|
||||
script {
|
||||
triggerSlaveJob ('RAN-SA-FHI72-MPLANE-CN5G', 'SA-FHI72-MPLANE-CN5G')
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
// Using a unique variable name for each test stage to avoid overwriting on a global variable
|
||||
// due to parallel-time concurrency
|
||||
saFHI72MplaneStatus = finalizeSlaveJob('RAN-SA-FHI72-MPLANE-CN5G')
|
||||
}
|
||||
}
|
||||
failure {
|
||||
script {
|
||||
currentBuild.result = 'FAILURE'
|
||||
failingStages += saFHI72MplaneStatus
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("SA-Handover-CN5G") {
|
||||
when { expression {do5Gtest} }
|
||||
steps {
|
||||
@@ -876,14 +900,13 @@ def triggerSlaveJob (jobName, gitlabStatusName) {
|
||||
|
||||
def triggerCN5GSlaveJob (jobName, gitlabStatusName) {
|
||||
if ("MERGE".equals(env.gitlabActionType)) {
|
||||
shortenShaOne = sh returnStdout: true, script: 'git log -1 --pretty=format:"%h" --abbrev=8 ' + env.gitlabMergeRequestLastCommit
|
||||
shortenShaOne = shortenShaOne.trim()
|
||||
branchName = env.gitlabSourceBranch.replaceAll("/", "-").trim()
|
||||
fullRanTag = OAI_Registry + '/oai-gnb:' + env.gitlabSourceBranch + '-' + shortenShaOne
|
||||
shaOne = sh returnStdout: true, script: 'git log -1 --pretty=format:"%H" ' + env.gitlabMergeRequestLastCommit
|
||||
shaOne = shaOne.trim()
|
||||
fullRanTag = OAI_Registry + '/oai-gnb:' + env.gitlabSourceBranch + '-' + shaOne
|
||||
} else {
|
||||
shortenShaOne = sh returnStdout: true, script: 'git log -1 --pretty=format:"%h" --abbrev=8 ' + env.GIT_COMMIT
|
||||
shortenShaOne = shortenShaOne.trim()
|
||||
fullRanTag = OAI_Registry + '/oai-gnb:develop-' + shortenShaOne
|
||||
shaOne = sh returnStdout: true, script: 'git log -1 --pretty=format:"%H" ' + env.GIT_COMMIT
|
||||
shaOne = shaOne.trim()
|
||||
fullRanTag = OAI_Registry + '/oai-gnb:develop-' + shaOne
|
||||
}
|
||||
// Workaround for the "cancelled" GitLab pipeline notification
|
||||
// The slave job is triggered with the propagate false so the following commands are executed
|
||||
|
||||
@@ -67,8 +67,7 @@ pipeline {
|
||||
stage('Create temporary branch for CI') {
|
||||
steps {
|
||||
script {
|
||||
def shortCommit = params.eNB_CommitID.take(8)
|
||||
env.NEW_BRANCH = "${params.eNB_Branch}-${shortCommit}"
|
||||
env.NEW_BRANCH = "${params.eNB_Branch}-${params.eNB_CommitID}"
|
||||
echo "New branch: ${env.NEW_BRANCH}"
|
||||
}
|
||||
sh """
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Python for CI of OAI-eNB + COTS-UE
|
||||
# Python for CI testing
|
||||
#
|
||||
# Required Python Version
|
||||
# Python 3.x
|
||||
@@ -44,74 +44,46 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,CLUSTER):
|
||||
elif re.match(r'^\-\-mode=(.+)$', myArgv, re.IGNORECASE):
|
||||
matchReg = re.match(r'^\-\-mode=(.+)$', myArgv, re.IGNORECASE)
|
||||
mode = matchReg.group(1)
|
||||
elif re.match(r'^\-\-eNBRepository=(.+)$|^\-\-ranRepository(.+)$', myArgv, re.IGNORECASE):
|
||||
if re.match(r'^\-\-eNBRepository=(.+)$', myArgv, re.IGNORECASE):
|
||||
matchReg = re.match(r'^\-\-eNBRepository=(.+)$', myArgv, re.IGNORECASE)
|
||||
else:
|
||||
matchReg = re.match(r'^\-\-ranRepository=(.+)$', myArgv, re.IGNORECASE)
|
||||
CiTestObj.ranRepository = matchReg.group(1)
|
||||
RAN.ranRepository=matchReg.group(1)
|
||||
HTML.ranRepository=matchReg.group(1)
|
||||
CONTAINERS.ranRepository=matchReg.group(1)
|
||||
CLUSTER.ranRepository=matchReg.group(1)
|
||||
elif re.match(r'^\-\-eNB_AllowMerge=(.+)$|^\-\-ranAllowMerge=(.+)$', myArgv, re.IGNORECASE):
|
||||
if re.match(r'^\-\-eNB_AllowMerge=(.+)$', myArgv, re.IGNORECASE):
|
||||
matchReg = re.match(r'^\-\-eNB_AllowMerge=(.+)$', myArgv, re.IGNORECASE)
|
||||
else:
|
||||
matchReg = re.match(r'^\-\-ranAllowMerge=(.+)$', myArgv, re.IGNORECASE)
|
||||
elif re.match(r'^\-\-ranRepository(.+)$', myArgv, re.IGNORECASE):
|
||||
matchReg = re.match(r'^\-\-ranRepository=(.+)$', myArgv, re.IGNORECASE)
|
||||
CiTestObj.repository = matchReg.group(1)
|
||||
RAN.repository=matchReg.group(1)
|
||||
HTML.repository=matchReg.group(1)
|
||||
CONTAINERS.repository=matchReg.group(1)
|
||||
CLUSTER.repository=matchReg.group(1)
|
||||
elif re.match(r'^\-\-ranAllowMerge=(.+)$', myArgv, re.IGNORECASE):
|
||||
matchReg = re.match(r'^\-\-ranAllowMerge=(.+)$', myArgv, re.IGNORECASE)
|
||||
doMerge = matchReg.group(1)
|
||||
if ((doMerge == 'true') or (doMerge == 'True')):
|
||||
CiTestObj.ranAllowMerge = True
|
||||
RAN.ranAllowMerge=True
|
||||
HTML.ranAllowMerge=True
|
||||
CONTAINERS.ranAllowMerge=True
|
||||
CLUSTER.ranAllowMerge=True
|
||||
elif re.match(r'^\-\-eNBBranch=(.+)$|^\-\-ranBranch=(.+)$', myArgv, re.IGNORECASE):
|
||||
if re.match(r'^\-\-eNBBranch=(.+)$', myArgv, re.IGNORECASE):
|
||||
matchReg = re.match(r'^\-\-eNBBranch=(.+)$', myArgv, re.IGNORECASE)
|
||||
else:
|
||||
matchReg = re.match(r'^\-\-ranBranch=(.+)$', myArgv, re.IGNORECASE)
|
||||
CiTestObj.ranBranch = matchReg.group(1)
|
||||
RAN.ranBranch=matchReg.group(1)
|
||||
HTML.ranBranch=matchReg.group(1)
|
||||
CONTAINERS.ranBranch=matchReg.group(1)
|
||||
CLUSTER.ranBranch=matchReg.group(1)
|
||||
elif re.match(r'^\-\-eNBCommitID=(.*)$|^\-\-ranCommitID=(.*)$', myArgv, re.IGNORECASE):
|
||||
if re.match(r'^\-\-eNBCommitID=(.*)$', myArgv, re.IGNORECASE):
|
||||
matchReg = re.match(r'^\-\-eNBCommitID=(.*)$', myArgv, re.IGNORECASE)
|
||||
else:
|
||||
matchReg = re.match(r'^\-\-ranCommitID=(.*)$', myArgv, re.IGNORECASE)
|
||||
CiTestObj.ranCommitID = matchReg.group(1)
|
||||
RAN.ranCommitID=matchReg.group(1)
|
||||
HTML.ranCommitID=matchReg.group(1)
|
||||
CONTAINERS.ranCommitID=matchReg.group(1)
|
||||
CLUSTER.ranCommitID=matchReg.group(1)
|
||||
elif re.match(r'^\-\-eNBTargetBranch=(.*)$|^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE):
|
||||
if re.match(r'^\-\-eNBTargetBranch=(.*)$', myArgv, re.IGNORECASE):
|
||||
matchReg = re.match(r'^\-\-eNBTargetBranch=(.*)$', myArgv, re.IGNORECASE)
|
||||
else:
|
||||
matchReg = re.match(r'^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE)
|
||||
CiTestObj.ranTargetBranch = matchReg.group(1)
|
||||
RAN.ranTargetBranch=matchReg.group(1)
|
||||
HTML.ranTargetBranch=matchReg.group(1)
|
||||
CONTAINERS.ranTargetBranch=matchReg.group(1)
|
||||
CLUSTER.ranTargetBranch=matchReg.group(1)
|
||||
elif re.match(r'^\-\-eNBIPAddress=(.+)$|^\-\-eNB[1-2]IPAddress=(.+)$', myArgv, re.IGNORECASE):
|
||||
print("parameters --eNB*IPAddress ignored")
|
||||
elif re.match(r'^\-\-eNBUserName=(.+)$|^\-\-eNB[1-2]UserName=(.+)$', myArgv, re.IGNORECASE):
|
||||
print("parameters --eNB*UserName ignored")
|
||||
elif re.match(r'^\-\-eNBPassword=(.+)$|^\-\-eNB[1-2]Password=(.+)$', myArgv, re.IGNORECASE):
|
||||
print("parameter --eNB*Password ignored")
|
||||
RAN.merge=True
|
||||
HTML.merge=True
|
||||
CONTAINERS.merge=True
|
||||
CLUSTER.merge=True
|
||||
elif re.match(r'^\-\-ranBranch=(.+)$', myArgv, re.IGNORECASE):
|
||||
matchReg = re.match(r'^\-\-ranBranch=(.+)$', myArgv, re.IGNORECASE)
|
||||
CiTestObj.branch = matchReg.group(1)
|
||||
RAN.branch=matchReg.group(1)
|
||||
HTML.branch=matchReg.group(1)
|
||||
CONTAINERS.branch=matchReg.group(1)
|
||||
CLUSTER.branch=matchReg.group(1)
|
||||
elif re.match(r'^\-\-ranCommitID=(.*)$', myArgv, re.IGNORECASE):
|
||||
matchReg = re.match(r'^\-\-ranCommitID=(.*)$', myArgv, re.IGNORECASE)
|
||||
RAN.commitID=matchReg.group(1)
|
||||
HTML.commitID=matchReg.group(1)
|
||||
CONTAINERS.commitID=matchReg.group(1)
|
||||
CLUSTER.commitID=matchReg.group(1)
|
||||
elif re.match(r'^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE):
|
||||
matchReg = re.match(r'^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE)
|
||||
RAN.targetBranch=matchReg.group(1)
|
||||
HTML.targetBranch=matchReg.group(1)
|
||||
CONTAINERS.targetBranch=matchReg.group(1)
|
||||
CLUSTER.targetBranch=matchReg.group(1)
|
||||
elif re.match(r'^\-\-eNBSourceCodePath=(.+)$|^\-\-eNB[1-2]SourceCodePath=(.+)$', myArgv, re.IGNORECASE):
|
||||
if re.match(r'^\-\-eNBSourceCodePath=(.+)$', myArgv, re.IGNORECASE):
|
||||
matchReg = re.match(r'^\-\-eNBSourceCodePath=(.+)$', myArgv, re.IGNORECASE)
|
||||
RAN.eNBSourceCodePath=matchReg.group(1)
|
||||
CONTAINERS.eNBSourceCodePath=matchReg.group(1)
|
||||
CLUSTER.eNBSourceCodePath=matchReg.group(1)
|
||||
elif re.match(r'^\-\-eNB1SourceCodePath=(.+)$', myArgv, re.IGNORECASE):
|
||||
print("parameter --eNB1SourceCodePath ignored")
|
||||
elif re.match(r'^\-\-eNB2SourceCodePath=(.+)$', myArgv, re.IGNORECASE):
|
||||
print("parameter --eNB2SourceCodePath ignored")
|
||||
RAN.workspace=matchReg.group(1)
|
||||
CONTAINERS.workspace=matchReg.group(1)
|
||||
CLUSTER.workspace=matchReg.group(1)
|
||||
elif re.match(r'^\-\-XMLTestFile=(.+)$', myArgv, re.IGNORECASE):
|
||||
matchReg = re.match(r'^\-\-XMLTestFile=(.+)$', myArgv, re.IGNORECASE)
|
||||
CiTestObj.testXMLfiles.append(matchReg.group(1))
|
||||
|
||||
1004
ci-scripts/as_ue/multi-00105-100.cfg
Normal file
1004
ci-scripts/as_ue/multi-00105-100.cfg
Normal file
File diff suppressed because it is too large
Load Diff
1005
ci-scripts/as_ue/multi-00105-40.cfg
Normal file
1005
ci-scripts/as_ue/multi-00105-40.cfg
Normal file
File diff suppressed because it is too large
Load Diff
@@ -85,6 +85,14 @@ oc-cn5g-20897:
|
||||
Undeploy: "! scripts/oc-cn5g-undeploy.sh /opt/oai-cn5g-fed-develop-2026-apr oaicicd-core-for-fhi72"
|
||||
LogCollect: "! scripts/oc-cn5g-logcollect.sh /opt/oai-cn5g-fed-develop-2026-apr oaicicd-core-for-fhi72 %%log_dir%%"
|
||||
|
||||
oc-cn5g-00105:
|
||||
Host: cacofonix
|
||||
NetworkScript: echo "inet 172.21.6.118"
|
||||
RunIperf3Server: False
|
||||
Deploy: "! scripts/oc-cn5g-deploy.sh /opt/oai-cn5g-fed-develop-2026-apr-00105 oaicicd-core-for-fhi72"
|
||||
Undeploy: "! scripts/oc-cn5g-undeploy.sh /opt/oai-cn5g-fed-develop-2026-apr-00105 oaicicd-core-for-fhi72"
|
||||
LogCollect: "! scripts/oc-cn5g-logcollect.sh /opt/oai-cn5g-fed-develop-2026-apr-00105 oaicicd-core-for-fhi72 %%log_dir%%"
|
||||
|
||||
oc-cn5g-00103-ho:
|
||||
Host: groot
|
||||
NetworkScript: echo "inet 172.21.6.111"
|
||||
@@ -183,6 +191,16 @@ amarisoft_ue_2x2:
|
||||
InitScript: /root/lteue-linux-2025-03-15/lteue /root/oaicicd/ran_sa_aw2s_asue_20MHz_2x2/aw2s-multi-00102-2x2-v2.cfg &
|
||||
TermScript: /root/lteue-linux-2025-03-15/ws.js -t 10 127.0.0.1:9002 '{"message":"quit"}' || killall -KILL lteue-avx2
|
||||
NetworkScript: ip netns exec ue1 ip a show dev pdn0
|
||||
amarisoft_00105_40MHz:
|
||||
Host: amariue
|
||||
InitScript: /root/lteue-linux-2025-03-15/lteue /root/oaicicd/ran_sa_fhi72_mplane_40MHz/multi-00105-40.cfg &
|
||||
TermScript: /root/lteue-linux-2025-03-15/ws.js -t 10 127.0.0.1:9002 '{"message":"quit"}' || killall -KILL lteue-avx2
|
||||
NetworkScript: ip netns exec ue1 ip a show dev pdn0
|
||||
amarisoft_00105_100MHz:
|
||||
Host: amariue
|
||||
InitScript: /root/lteue-linux-2025-03-15/lteue /root/oaicicd/ran_sa_fhi72_mplane_100MHz/multi-00105-100.cfg &
|
||||
TermScript: /root/lteue-linux-2025-03-15/ws.js -t 10 127.0.0.1:9002 '{"message":"quit"}' || killall -KILL lteue-avx2
|
||||
NetworkScript: ip netns exec ue1 ip a show dev pdn0
|
||||
amarisoft_ue_1:
|
||||
Host: amariue
|
||||
AttachScript: /root/lteue-linux-2025-03-15/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":1}'
|
||||
|
||||
@@ -50,17 +50,17 @@ def OC_logout(cmd):
|
||||
|
||||
class Cluster:
|
||||
def __init__(self):
|
||||
self.eNBSourceCodePath = ""
|
||||
self.workspace = ""
|
||||
self.OCUserName = ""
|
||||
self.OCPassword = ""
|
||||
self.OCProjectName = ""
|
||||
self.OCUrl = OCUrl
|
||||
self.OCRegistry = OCRegistry
|
||||
self.ranRepository = ""
|
||||
self.ranBranch = ""
|
||||
self.ranCommitID = ""
|
||||
self.ranAllowMerge = False
|
||||
self.ranTargetBranch = ""
|
||||
self.repository = ""
|
||||
self.branch = ""
|
||||
self.commitID = ""
|
||||
self.merge = False
|
||||
self.targetBranch = ""
|
||||
self.cmd = None
|
||||
|
||||
def _recreate_entitlements(self):
|
||||
@@ -101,7 +101,7 @@ class Cluster:
|
||||
def _start_build(self, name):
|
||||
# will return "immediately" but build runs in background
|
||||
# if multiple builds are started at the same time, this can take some time, however
|
||||
ret = self.cmd.run(f'oc start-build {name} --from-dir={self.eNBSourceCodePath} --exclude=""')
|
||||
ret = self.cmd.run(f'oc start-build {name} --from-dir={self.workspace} --exclude=""')
|
||||
regres = re.search(r'build.build.openshift.io/(?P<jobname>[a-zA-Z0-9\-]+) started', ret.stdout)
|
||||
if ret.returncode != 0 or ret.stdout.count('Uploading finished') != 1 or regres is None:
|
||||
logging.error(f"error during oc start-build: {ret.stdout}")
|
||||
@@ -157,7 +157,7 @@ class Cluster:
|
||||
OC_logout(cmd)
|
||||
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_LOGIN_FAIL)
|
||||
return False
|
||||
tag = cls_containerize.CreateTag(self.ranCommitID, self.ranBranch, self.ranAllowMerge)
|
||||
tag = cls_containerize.CreateTag(self.commitID, self.branch, self.merge)
|
||||
registry = f'{self.OCRegistry}/{CI_OC_RAN_NAMESPACE}'
|
||||
success, msg = cls_containerize.Containerize.Pull_Image(cmd, images, tag, tag_prefix, registry, None, None)
|
||||
OC_logout(cmd)
|
||||
@@ -174,12 +174,12 @@ class Cluster:
|
||||
return (image, archiveArtifact(self.cmd, ctx, fn))
|
||||
|
||||
def BuildClusterImage(self, ctx, node, HTML):
|
||||
if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '':
|
||||
if self.repository == '' or self.branch == '' or self.commitID == '':
|
||||
HELP.GenericHelp(CONST.Version)
|
||||
raise ValueError(f'Insufficient Parameter: ranRepository {self.ranRepository} ranBranch {ranBranch} ranCommitID {self.ranCommitID}')
|
||||
lSourcePath = self.eNBSourceCodePath
|
||||
raise ValueError(f'Insufficient Parameter: repository {self.repository} branch {self.branch} commitID {self.commitID}')
|
||||
lSourcePath = self.workspace
|
||||
if node == '' or lSourcePath == '':
|
||||
raise ValueError('Insufficient Parameter: eNBSourceCodePath missing')
|
||||
raise ValueError('Insufficient Parameter: workspace missing')
|
||||
ocUserName = self.OCUserName
|
||||
ocPassword = self.OCPassword
|
||||
ocProjectName = self.OCProjectName
|
||||
@@ -200,22 +200,22 @@ class Cluster:
|
||||
|
||||
baseTag = 'develop'
|
||||
forceBaseImageBuild = False
|
||||
if self.ranAllowMerge: # merging MR branch into develop -> temporary image
|
||||
branchName = self.ranBranch.replace('/','-')
|
||||
imageTag = f'{branchName}-{self.ranCommitID[0:8]}'
|
||||
if self.ranTargetBranch == 'develop':
|
||||
if self.merge: # merging MR branch into develop -> temporary image
|
||||
branchName = self.branch.replace('/','-')
|
||||
imageTag = f'{branchName}-{self.commitID}'
|
||||
if self.targetBranch == 'develop':
|
||||
ret = self.cmd.run(f'git diff HEAD..origin/develop -- cmake_targets/build_oai cmake_targets/tools/build_helper docker/Dockerfile.base.rhel9 | grep --colour=never -i INDEX')
|
||||
result = re.search('index', ret.stdout)
|
||||
if result is not None:
|
||||
forceBaseImageBuild = True
|
||||
baseTag = 'ci-temp'
|
||||
# if the branch name contains integration_20xx_wyy, let rebuild ran-base
|
||||
result = re.search('integration_20([0-9]{2})_w([0-9]{2})', self.ranBranch)
|
||||
result = re.search('integration_20([0-9]{2})_w([0-9]{2})', self.branch)
|
||||
if not forceBaseImageBuild and result is not None:
|
||||
forceBaseImageBuild = True
|
||||
baseTag = 'ci-temp'
|
||||
else:
|
||||
imageTag = f'develop-{self.ranCommitID[0:8]}'
|
||||
imageTag = f'develop-{self.commitID}'
|
||||
forceBaseImageBuild = True
|
||||
|
||||
# logging to OC Cluster and then switch to corresponding project
|
||||
|
||||
@@ -32,33 +32,32 @@ from cls_ci_helper import archiveArtifact
|
||||
IMAGES = ['oai-enb', 'oai-lte-ru', 'oai-lte-ue', 'oai-gnb', 'oai-nr-cuup', 'oai-gnb-aw2s', 'oai-nr-ue', 'oai-enb-asan', 'oai-gnb-asan', 'oai-lte-ue-asan', 'oai-nr-ue-asan', 'oai-nr-cuup-asan', 'oai-gnb-aerial', 'oai-gnb-fhi72']
|
||||
DEFAULT_REGISTRY = "gracehopper3-oai.sboai.cs.eurecom.fr"
|
||||
|
||||
def CreateWorkspace(host, sourcePath, ranRepository, ranCommitID, ranTargetBranch, ranAllowMerge):
|
||||
if ranCommitID == '':
|
||||
logging.error('need ranCommitID in CreateWorkspace()')
|
||||
raise ValueError('Insufficient Parameter in CreateWorkspace(): need ranCommitID')
|
||||
def CreateWorkspace(host, sourcePath, repository, commitID, targetBranch, merge):
|
||||
if commitID == '':
|
||||
logging.error('need commitID in CreateWorkspace()')
|
||||
raise ValueError('Insufficient Parameter in CreateWorkspace(): need commitID')
|
||||
|
||||
script = "scripts/create_workspace.sh"
|
||||
options = f"{sourcePath} {ranRepository} {ranCommitID}"
|
||||
if ranAllowMerge:
|
||||
if ranTargetBranch == '':
|
||||
ranTargetBranch = 'develop'
|
||||
options += f" {ranTargetBranch}"
|
||||
options = f"{sourcePath} {repository} {commitID}"
|
||||
if merge:
|
||||
if targetBranch == '':
|
||||
targetBranch = 'develop'
|
||||
options += f" {targetBranch}"
|
||||
logging.info(f'execute "{script}" with options "{options}" on node {host}')
|
||||
with cls_cmd.getConnection(host) as c:
|
||||
ret = c.exec_script(script, 90, options)
|
||||
logging.debug(f'"{script}" finished with code {ret.returncode}, output:\n{ret.stdout}')
|
||||
return ret.returncode == 0
|
||||
|
||||
def CreateTag(ranCommitID, ranBranch, ranAllowMerge):
|
||||
if ranCommitID == 'develop':
|
||||
def CreateTag(commitID, branch, merge):
|
||||
if commitID == 'develop':
|
||||
return 'develop'
|
||||
shortCommit = ranCommitID[0:8]
|
||||
if ranAllowMerge:
|
||||
if merge:
|
||||
# Allowing contributor to have a name/branchName format
|
||||
branchName = ranBranch.replace('/','-')
|
||||
tagToUse = f'{branchName}-{shortCommit}'
|
||||
branchName = branch.replace('/','-')
|
||||
tagToUse = f'{branchName}-{commitID}'
|
||||
else:
|
||||
tagToUse = f'develop-{shortCommit}'
|
||||
tagToUse = f'develop-{commitID}'
|
||||
return tagToUse
|
||||
|
||||
def AnalyzeBuildLogs(image, lf):
|
||||
@@ -172,14 +171,13 @@ class Containerize():
|
||||
|
||||
def __init__(self):
|
||||
|
||||
self.ranRepository = ''
|
||||
self.ranBranch = ''
|
||||
self.ranAllowMerge = False
|
||||
self.ranCommitID = ''
|
||||
self.ranTargetBranch = ''
|
||||
self.eNBSourceCodePath = ''
|
||||
self.repository = ''
|
||||
self.branch = ''
|
||||
self.merge = False
|
||||
self.commitID = ''
|
||||
self.targetBranch = ''
|
||||
self.workspace = ''
|
||||
self.imageKind = ''
|
||||
self.proxyCommit = None
|
||||
self.yamlPath = ''
|
||||
self.services = ''
|
||||
self.deploymentTag = ''
|
||||
@@ -193,7 +191,7 @@ class Containerize():
|
||||
#-----------------------------------------------------------
|
||||
|
||||
def BuildImage(self, ctx, node, HTML):
|
||||
lSourcePath = self.eNBSourceCodePath
|
||||
lSourcePath = self.workspace
|
||||
logging.debug('Building on server: ' + node)
|
||||
cmd = cls_cmd.getConnection(node)
|
||||
log_files = []
|
||||
@@ -249,16 +247,16 @@ class Containerize():
|
||||
baseTag = 'develop'
|
||||
forceBaseImageBuild = False
|
||||
imageTag = 'develop'
|
||||
if (self.ranAllowMerge):
|
||||
if (self.merge):
|
||||
imageTag = 'ci-temp'
|
||||
if self.ranTargetBranch == 'develop':
|
||||
if self.targetBranch == 'develop':
|
||||
cmd.run(f'git diff HEAD..origin/develop -- cmake_targets/build_oai cmake_targets/tools/build_helper docker/Dockerfile.base{dockerfileprefix} | grep --colour=never -i INDEX')
|
||||
result = re.search('index', cmd.getBefore())
|
||||
if result is not None:
|
||||
forceBaseImageBuild = True
|
||||
baseTag = 'ci-temp'
|
||||
# if the branch name contains integration_20xx_wyy, let rebuild ran-base
|
||||
result = re.search('integration_20([0-9]{2})_w([0-9]{2})', self.ranBranch)
|
||||
result = re.search('integration_20([0-9]{2})_w([0-9]{2})', self.branch)
|
||||
if not forceBaseImageBuild and result is not None:
|
||||
forceBaseImageBuild = True
|
||||
baseTag = 'ci-temp'
|
||||
@@ -376,90 +374,8 @@ class Containerize():
|
||||
logging.error('\u001B[1m Building OAI Images Failed\u001B[0m')
|
||||
return status
|
||||
|
||||
def BuildProxy(self, ctx, node, HTML):
|
||||
lSourcePath = self.eNBSourceCodePath
|
||||
logging.debug('Building on server: ' + node)
|
||||
ssh = cls_cmd.getConnection(node)
|
||||
|
||||
oldRanCommidID = self.ranCommitID
|
||||
oldRanRepository = self.ranRepository
|
||||
oldRanAllowMerge = self.ranAllowMerge
|
||||
oldRanTargetBranch = self.ranTargetBranch
|
||||
self.ranCommitID = self.proxyCommit
|
||||
self.ranRepository = 'https://github.com/EpiSci/oai-lte-5g-multi-ue-proxy.git'
|
||||
self.ranAllowMerge = False
|
||||
self.ranTargetBranch = 'master'
|
||||
|
||||
# Let's remove any previous run artifacts if still there
|
||||
ssh.run('docker image prune --force')
|
||||
# Remove any previous proxy image
|
||||
ssh.run('docker image rm oai-lte-multi-ue-proxy:latest')
|
||||
|
||||
tag = self.proxyCommit
|
||||
logging.debug('building L2sim proxy image for tag ' + tag)
|
||||
# check if the corresponding proxy image with tag exists. If not, build it
|
||||
ret = ssh.run(f'docker image inspect --format=\'Size = {{{{.Size}}}} bytes\' proxy:{tag}')
|
||||
buildProxy = ret.returncode != 0 # if no image, build new proxy
|
||||
if buildProxy:
|
||||
ssh.run(f'rm -Rf {lSourcePath}')
|
||||
success = CreateWorkspace(node, lSourcePath, self.ranRepository, self.ranCommitID, self.ranTargetBranch, self.ranAllowMerge)
|
||||
if not success:
|
||||
raise Exception("could not clone proxy repository")
|
||||
|
||||
fullpath = f'{lSourcePath}/proxy_build.log'
|
||||
|
||||
ssh.run(f'docker build --target oai-lte-multi-ue-proxy --tag proxy:{tag} --file {lSourcePath}/docker/Dockerfile.ubuntu18.04 {lSourcePath} > {fullpath} 2>&1')
|
||||
archiveArtifact(ssh, ctx, fullpath)
|
||||
|
||||
ssh.run('docker image prune --force')
|
||||
ret = ssh.run(f'docker image inspect --format=\'Size = {{{{.Size}}}} bytes\' proxy:{tag}')
|
||||
if ret.returncode != 0:
|
||||
logging.error('\u001B[1m Build of L2sim proxy failed\u001B[0m')
|
||||
ssh.close()
|
||||
HTML.CreateHtmlTestRow('commit ' + tag, 'KO', CONST.ALL_PROCESSES_OK)
|
||||
return False
|
||||
else:
|
||||
logging.debug('L2sim proxy image for tag ' + tag + ' already exists, skipping build')
|
||||
|
||||
# retag the build images to that we pick it up later
|
||||
ssh.run(f'docker image tag proxy:{tag} oai-lte-multi-ue-proxy:latest')
|
||||
|
||||
# we assume that the host on which this is built will also run the proxy. The proxy
|
||||
# currently requires the following command, and the docker-compose up mechanism of
|
||||
# the CI does not allow to run arbitrary commands. Note that the following actually
|
||||
# belongs to the deployment, not the build of the proxy...
|
||||
logging.warning('the following command belongs to deployment, but no mechanism exists to exec it there!')
|
||||
ssh.run('sudo ifconfig lo: 127.0.0.2 netmask 255.0.0.0 up')
|
||||
|
||||
# to prevent accidentally overwriting data that might be used later
|
||||
self.ranCommitID = oldRanCommidID
|
||||
self.ranRepository = oldRanRepository
|
||||
self.ranAllowMerge = oldRanAllowMerge
|
||||
self.ranTargetBranch = oldRanTargetBranch
|
||||
|
||||
ret = ssh.run(f'docker image inspect --format=\'Size = {{{{.Size}}}} bytes\' proxy:{tag}')
|
||||
result = re.search(r'Size *= *(?P<size>[0-9\-]+) *bytes', ret.stdout)
|
||||
# Cleaning any created tmp volume
|
||||
ssh.run('docker volume prune --force')
|
||||
ssh.close()
|
||||
|
||||
allImagesSize = {}
|
||||
if result is not None:
|
||||
imageSize = float(result.group('size')) / 1000000
|
||||
logging.debug('\u001B[1m proxy size is ' + ('%.0f' % imageSize) + ' Mbytes\u001B[0m')
|
||||
allImagesSize['proxy'] = str(round(imageSize,1)) + ' Mbytes'
|
||||
logging.info('\u001B[1m Building L2sim Proxy Image Pass\u001B[0m')
|
||||
HTML.CreateHtmlTestRow('commit ' + tag, 'OK', CONST.ALL_PROCESSES_OK)
|
||||
return True
|
||||
else:
|
||||
logging.error('proxy size is unknown')
|
||||
allImagesSize['proxy'] = 'unknown'
|
||||
logging.error('\u001B[1m Build of L2sim proxy failed\u001B[0m')
|
||||
HTML.CreateHtmlTestRow('commit ' + tag, 'KO', CONST.ALL_PROCESSES_OK)
|
||||
return False
|
||||
|
||||
def BuildRunTests(self, ctx, node, dockerfile, runtime_opt, ctest_opt, HTML):
|
||||
lSourcePath = self.eNBSourceCodePath
|
||||
lSourcePath = self.workspace
|
||||
logging.debug('Building on server: ' + node)
|
||||
cmd = cls_cmd.getConnection(node)
|
||||
cmd.cd(lSourcePath)
|
||||
@@ -467,8 +383,8 @@ class Containerize():
|
||||
# check that ran-base image exists as we expect it
|
||||
baseImage = 'ran-base'
|
||||
baseTag = 'develop'
|
||||
if self.ranAllowMerge:
|
||||
if self.ranTargetBranch == 'develop':
|
||||
if self.merge:
|
||||
if self.targetBranch == 'develop':
|
||||
cmd.run(f'git diff HEAD..origin/develop -- cmake_targets/build_oai cmake_targets/tools/build_helper docker/Dockerfile.base.ubuntu | grep --colour=never -i INDEX')
|
||||
result = re.search('index', cmd.getBefore())
|
||||
if result is not None:
|
||||
@@ -511,7 +427,7 @@ class Containerize():
|
||||
return False
|
||||
|
||||
def Push_Image_to_Local_Registry(self, node, HTML, tag_prefix=""):
|
||||
lSourcePath = self.eNBSourceCodePath
|
||||
lSourcePath = self.workspace
|
||||
logging.debug('Pushing images to server: ' + node)
|
||||
ssh = cls_cmd.getConnection(node)
|
||||
imagePrefix = DEFAULT_REGISTRY
|
||||
@@ -524,10 +440,10 @@ class Containerize():
|
||||
return False
|
||||
|
||||
orgTag = 'develop'
|
||||
if self.ranAllowMerge:
|
||||
if self.merge:
|
||||
orgTag = 'ci-temp'
|
||||
for image in IMAGES:
|
||||
tagToUse = tag_prefix + CreateTag(self.ranCommitID, self.ranBranch, self.ranAllowMerge)
|
||||
tagToUse = tag_prefix + CreateTag(self.commitID, self.branch, self.merge)
|
||||
imageTag = f"{image}:{tagToUse}"
|
||||
ret = ssh.run(f'docker image tag {image}:{orgTag} {imagePrefix}/{imageTag}')
|
||||
if ret.returncode != 0:
|
||||
@@ -540,7 +456,7 @@ class Containerize():
|
||||
HTML.CreateHtmlTestRow(msg, 'KO', CONST.ALL_PROCESSES_OK)
|
||||
return False
|
||||
# Creating a develop tag on the local private registry
|
||||
if not self.ranAllowMerge:
|
||||
if not self.merge:
|
||||
devTag = f"{tag_prefix}develop"
|
||||
ssh.run(f'docker image tag {image}:{orgTag} {imagePrefix}/{image}:{devTag}')
|
||||
ssh.run(f'docker push {imagePrefix}/{image}:{devTag}')
|
||||
@@ -588,7 +504,7 @@ class Containerize():
|
||||
def Pull_Image_from_Registry(self, HTML, node, images, tag=None, tag_prefix="", registry=DEFAULT_REGISTRY, username="oaicicd", password="oaicicd"):
|
||||
logging.debug(f'\u001B[1m Pulling image(s) on server: {node}\u001B[0m')
|
||||
if not tag:
|
||||
tag = CreateTag(self.ranCommitID, self.ranBranch, self.ranAllowMerge)
|
||||
tag = CreateTag(self.commitID, self.branch, self.merge)
|
||||
with cls_cmd.getConnection(node) as cmd:
|
||||
success, msg = Containerize.Pull_Image(cmd, images, tag, tag_prefix, registry, username, password)
|
||||
param = f"on node {node}"
|
||||
@@ -601,7 +517,7 @@ class Containerize():
|
||||
def Clean_Test_Server_Images(self, HTML, node, images, tag=None):
|
||||
logging.debug(f'\u001B[1m Cleaning image(s) from server: {node}\u001B[0m')
|
||||
if not tag:
|
||||
tag = CreateTag(self.ranCommitID, self.ranBranch, self.ranAllowMerge)
|
||||
tag = CreateTag(self.commitID, self.branch, self.merge)
|
||||
|
||||
status = True
|
||||
with cls_cmd.getConnection(node) as myCmd:
|
||||
@@ -620,8 +536,8 @@ class Containerize():
|
||||
return status
|
||||
|
||||
def Create_Workspace(self, node, HTML):
|
||||
lSourcePath = self.eNBSourceCodePath
|
||||
success = CreateWorkspace(node, lSourcePath, self.ranRepository, self.ranCommitID, self.ranTargetBranch, self.ranAllowMerge)
|
||||
lSourcePath = self.workspace
|
||||
success = CreateWorkspace(node, lSourcePath, self.repository, self.commitID, self.targetBranch, self.merge)
|
||||
if success:
|
||||
HTML.CreateHtmlTestRowQueue('N/A', 'OK', [f"created workspace {lSourcePath}"])
|
||||
else:
|
||||
@@ -630,7 +546,7 @@ class Containerize():
|
||||
|
||||
def DeployObject(self, ctx, node, HTML):
|
||||
num_attempts = self.num_attempts
|
||||
lSourcePath = self.eNBSourceCodePath
|
||||
lSourcePath = self.workspace
|
||||
yaml = self.yamlPath.strip('/')
|
||||
wd = f'{lSourcePath}/{yaml}'
|
||||
wd_yaml = f'{wd}/docker-compose.y*ml'
|
||||
@@ -648,7 +564,7 @@ class Containerize():
|
||||
raise ValueError(f'Invalid value for num_attempts: {num_attempts}, must be greater than 0')
|
||||
for attempt in range(num_attempts):
|
||||
logging.info(f'will start services {services}')
|
||||
status = ssh.run(f'docker compose -f {wd_yaml} up -d --wait --wait-timeout 60 -- {services}')
|
||||
status = ssh.run(f'docker compose -f {wd_yaml} up -d --wait --wait-timeout 120 -- {services}')
|
||||
info = ssh.run(f"docker compose -f {wd_yaml} ps --all --format=\'table {{{{.Service}}}} [{{{{.Image}}}}] {{{{.Status}}}}\' -- {services} | column -t")
|
||||
deployed = status.returncode == 0
|
||||
if not deployed:
|
||||
@@ -674,7 +590,7 @@ class Containerize():
|
||||
return deployed
|
||||
|
||||
def StopObject(self, ctx, node, HTML):
|
||||
lSourcePath = self.eNBSourceCodePath
|
||||
lSourcePath = self.workspace
|
||||
if not self.services:
|
||||
raise ValueError(f'no services provided')
|
||||
logging.info(f'\u001B[1m Stopping objects "{self.services}" from server: {node}\u001B[0m')
|
||||
@@ -703,7 +619,7 @@ class Containerize():
|
||||
return success
|
||||
|
||||
def UndeployObject(self, ctx, node, HTML, to_analyze):
|
||||
lSourcePath = self.eNBSourceCodePath
|
||||
lSourcePath = self.workspace
|
||||
logging.info(f'\u001B[1m Undeploying all objects from server {node}\u001B[0m')
|
||||
yaml = self.yamlPath.strip('/')
|
||||
wd = f'{lSourcePath}/{yaml}'
|
||||
@@ -741,7 +657,7 @@ class Containerize():
|
||||
def AnalyzeRTStatsObject(self, HTML, node, ctx, thresholds, service=None):
|
||||
logging.info(f'Analyzing realtime stats from server: {node}')
|
||||
yaml = self.yamlPath.strip('/')
|
||||
wd = f'{self.eNBSourceCodePath}/{yaml}'
|
||||
wd = f'{self.workspace}/{yaml}'
|
||||
wd_yaml = f'{wd}/docker-compose.y*ml'
|
||||
|
||||
with cls_cmd.getConnection(node) as cmd:
|
||||
|
||||
@@ -33,11 +33,11 @@ class HTMLManagement():
|
||||
self.htmlHeaderCreated = False
|
||||
self.htmlFooterCreated = False
|
||||
|
||||
self.ranRepository = ''
|
||||
self.ranBranch = ''
|
||||
self.ranCommitID = ''
|
||||
self.ranAllowMerge = False
|
||||
self.ranTargetBranch = ''
|
||||
self.repository = ''
|
||||
self.branch = ''
|
||||
self.commitID = ''
|
||||
self.merge = False
|
||||
self.targetBranch = ''
|
||||
|
||||
self.nbTestXMLfiles = 0
|
||||
self.htmlTabRefs = []
|
||||
@@ -96,46 +96,46 @@ class HTMLManagement():
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td bgcolor = "lightcyan" > <span class="glyphicon glyphicon-cloud-upload"></span> GIT Repository </td>\n')
|
||||
self.htmlFile.write(' <td><a href="' + self.ranRepository + '">' + self.ranRepository + '</a></td>\n')
|
||||
self.htmlFile.write(' <td><a href="' + self.repository + '">' + self.repository + '</a></td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td bgcolor = "lightcyan" > <span class="glyphicon glyphicon-wrench"></span> Job Trigger </td>\n')
|
||||
if (self.ranAllowMerge):
|
||||
if (self.merge):
|
||||
self.htmlFile.write(' <td>Merge-Request</td>\n')
|
||||
else:
|
||||
self.htmlFile.write(' <td>Push to Branch</td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
if (self.ranAllowMerge):
|
||||
if (self.merge):
|
||||
self.htmlFile.write(' <td bgcolor = "lightcyan" > <span class="glyphicon glyphicon-log-out"></span> Source Branch </td>\n')
|
||||
else:
|
||||
self.htmlFile.write(' <td bgcolor = "lightcyan" > <span class="glyphicon glyphicon-tree-deciduous"></span> Branch</td>\n')
|
||||
self.htmlFile.write(' <td>' + self.ranBranch + '</td>\n')
|
||||
self.htmlFile.write(' <td>' + self.branch + '</td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
if (self.ranAllowMerge):
|
||||
if (self.merge):
|
||||
self.htmlFile.write(' <td bgcolor = "lightcyan" > <span class="glyphicon glyphicon-tag"></span> Source Commit ID </td>\n')
|
||||
else:
|
||||
self.htmlFile.write(' <td bgcolor = "lightcyan" > <span class="glyphicon glyphicon-tag"></span> Commit ID </td>\n')
|
||||
self.htmlFile.write(' <td>' + self.ranCommitID + '</td>\n')
|
||||
self.htmlFile.write(' <td>' + self.commitID + '</td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
if self.ranAllowMerge != '' and self.ranCommitID != 'develop':
|
||||
commit_message = subprocess.check_output("git log -n1 --pretty=format:\"%s\" " + self.ranCommitID, shell=True, universal_newlines=True)
|
||||
if self.merge != '' and self.commitID != 'develop':
|
||||
commit_message = subprocess.check_output("git log -n1 --pretty=format:\"%s\" " + self.commitID, shell=True, universal_newlines=True)
|
||||
commit_message = commit_message.strip()
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
if (self.ranAllowMerge):
|
||||
if (self.merge):
|
||||
self.htmlFile.write(' <td bgcolor = "lightcyan" > <span class="glyphicon glyphicon-comment"></span> Source Commit Message </td>\n')
|
||||
else:
|
||||
self.htmlFile.write(' <td bgcolor = "lightcyan" > <span class="glyphicon glyphicon-comment"></span> Commit Message </td>\n')
|
||||
self.htmlFile.write(' <td>' + commit_message + '</td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
if (self.ranAllowMerge):
|
||||
if (self.merge):
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td bgcolor = "lightcyan" > <span class="glyphicon glyphicon-log-in"></span> Target Branch </td>\n')
|
||||
if (self.ranTargetBranch == ''):
|
||||
if (self.targetBranch == ''):
|
||||
self.htmlFile.write(' <td>develop</td>\n')
|
||||
else:
|
||||
self.htmlFile.write(' <td>' + self.ranTargetBranch + '</td>\n')
|
||||
self.htmlFile.write(' <td>' + self.targetBranch + '</td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' </table>\n')
|
||||
|
||||
|
||||
@@ -65,6 +65,23 @@ def Iperf_ComputeTime(args):
|
||||
raise Exception('Iperf time not found!')
|
||||
return int(result.group('iperf_time'))
|
||||
|
||||
def Iperf_UpdateBindPort(opts, ueIP, idx):
|
||||
# search if bind address present. Extract if yes, add if no.
|
||||
bind_m = re.search(r'(-B|--bind)\s+(?P<ip>\d+\.\d+\.\d+\.\d+)', opts)
|
||||
if bind_m:
|
||||
bindIP = bind_m.group('ip')
|
||||
else:
|
||||
bindIP = ueIP
|
||||
opts += f" -B {ueIP}"
|
||||
# search if port present. Extract if yes, add if no.
|
||||
port_m = re.search(r'(-p|--port)\s+(?P<port>\d+)', opts)
|
||||
if port_m:
|
||||
port = port_m.group('port')
|
||||
else:
|
||||
port = 5002 + idx
|
||||
opts += f" -p {port}"
|
||||
return bindIP, port, opts
|
||||
|
||||
def convert_to_mbps(value, magnitude):
|
||||
value = float(value)
|
||||
if magnitude == 'K' or magnitude == 'k':
|
||||
@@ -265,12 +282,8 @@ def Deploy_Physim(ctx, HTML, node, workdir, script, options):
|
||||
class OaiCiTest():
|
||||
|
||||
def __init__(self):
|
||||
self.ranRepository = ''
|
||||
self.ranBranch = ''
|
||||
self.ranCommitID = ''
|
||||
self.ranAllowMerge = False
|
||||
self.ranTargetBranch = ''
|
||||
|
||||
self.repository = ''
|
||||
self.branch = ''
|
||||
self.testXMLfiles = []
|
||||
self.ping_args = ''
|
||||
self.ping_packetloss_threshold = ''
|
||||
@@ -457,7 +470,6 @@ class OaiCiTest():
|
||||
svrIP = cn.getIP()
|
||||
if not svrIP:
|
||||
return (False, f"Iperf server {cn.getName()} has no IP address")
|
||||
|
||||
iperf_opt = self.iperf_args
|
||||
jsonReport = "--json"
|
||||
serverReport = ""
|
||||
@@ -471,11 +483,11 @@ class OaiCiTest():
|
||||
# note: enable server report collection on the UE side, no need to store and collect server report separately on the server side
|
||||
serverReport = "--get-server-output"
|
||||
iperf_time = Iperf_ComputeTime(self.iperf_args)
|
||||
bindIP, port, iperf_opt = Iperf_UpdateBindPort(iperf_opt, ueIP, idx)
|
||||
# hack: the ADB UEs don't have iperf in $PATH, so we need to hardcode for the moment
|
||||
iperf_ue = '/data/local/tmp/iperf3' if re.search('adb', ue.getName()) else 'iperf3'
|
||||
ue_header = f'UE {ue.getName()} ({ueIP})'
|
||||
ue_header = f'UE {ue.getName()} ({bindIP})'
|
||||
with cls_cmd.getConnection(ue.getHost()) as cmd_ue, cls_cmd.getConnection(cn.getHost()) as cmd_svr:
|
||||
port = 5002 + idx
|
||||
# note: some core setups start an iperf3 server automatically, indicated in ci_infra by runIperf3Server: False`
|
||||
t = iperf_time * 2.5
|
||||
cmd_ue.run(f'rm {client_filename}', reportNonZero=False, silent=True)
|
||||
@@ -486,7 +498,7 @@ class OaiCiTest():
|
||||
if ret.returncode == 0:
|
||||
logging.warning(f'Iperf3 server on port {port} detected and terminated')
|
||||
cmd_svr.run(f'{cn.getCmdPrefix()} timeout -vk3 {t} iperf3 -s -B {svrIP} -p {port} -1 {jsonReport} >> /dev/null &', timeout=t)
|
||||
cmd_ue.run(f'{ue.getCmdPrefix()} timeout -vk3 {t} {iperf_ue} -B {ueIP} -c {svrIP} -p {port} {iperf_opt} {jsonReport} {serverReport} -O 5 >> {client_filename}', timeout=t)
|
||||
client_ret = cmd_ue.run(f'{ue.getCmdPrefix()} timeout -vk3 {t} {iperf_ue} -c {svrIP} {iperf_opt} {jsonReport} {serverReport} -O 5 >> {client_filename}', timeout=t, reportNonZero=False)
|
||||
dest_filename = archiveArtifact(cmd_ue, ctx, client_filename)
|
||||
if udpIperf:
|
||||
status, msg = Iperf_analyzeV3UDP(dest_filename, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate)
|
||||
@@ -495,6 +507,10 @@ class OaiCiTest():
|
||||
else:
|
||||
status, msg = Iperf_analyzeV3TCPJson(dest_filename, self.iperf_tcp_rate_target)
|
||||
|
||||
# add some diagnostic messages if the actual iperf command returned non-zero
|
||||
if client_ret.returncode != 0:
|
||||
msg = f'{msg}\nIperf client command failed on {bindIP} -> {svrIP}:{port} (return code: {client_ret.returncode})'
|
||||
|
||||
return (status, f'{ue_header}\n{msg}')
|
||||
|
||||
def Iperf(self, ctx, node, HTML, infra_file="ci_infra.yaml"):
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
Active_gNBs = ( "gNB-OAI");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
@@ -6,95 +8,87 @@ gNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
gNB_ID = 0xe01;
|
||||
gNB_ID = 0xe00;
|
||||
gNB_name = "gNB-OAI";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 1;
|
||||
plmn_list = ({ mcc = 001; mnc = 01; mnc_length = 2; snssaiList = ({ sst = 1 }) });
|
||||
plmn_list = ({ mcc = 001; mnc = 05; mnc_length = 2; snssaiList = ( { sst = 1; }); });
|
||||
|
||||
nr_cellid = 12345678L;
|
||||
nr_cellid = 1;
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 1;
|
||||
pdsch_AntennaPorts_XP = 2;
|
||||
pdsch_AntennaPorts_N1 = 2;
|
||||
maxMIMO_layers = 4;
|
||||
pusch_AntennaPorts = 4;
|
||||
do_CSIRS = 1;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
{
|
||||
controlResourceSetZero = 12;
|
||||
searchSpaceZero = 0;
|
||||
}
|
||||
);
|
||||
|
||||
servingCellConfigCommon = (
|
||||
{
|
||||
#spCellConfigCommon
|
||||
|
||||
physCellId = 0;
|
||||
|
||||
# downlinkConfigCommon
|
||||
#frequencyInfoDL
|
||||
# this is 3300.60 MHz + 81*12*30e-3 MHz = 3329.76
|
||||
absoluteFrequencySSB = 641280;
|
||||
# this is 3300.60 MHz
|
||||
dl_absoluteFrequencyPointA = 640008;
|
||||
# center frequency = 3350.01 MHz
|
||||
# selected SSB frequency = 3349.92 MHz
|
||||
absoluteFrequencySSB = 623328;
|
||||
dl_frequencyBand = 78;
|
||||
# frequency point A = 3330.93 MHz
|
||||
dl_absoluteFrequencyPointA = 622062;
|
||||
#scs-SpecificCarrierList
|
||||
dl_offstToCarrier = 0;
|
||||
dl_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
dl_subcarrierSpacing = 1;
|
||||
dl_carrierBandwidth = 106;
|
||||
dl_subcarrierSpacing = 1;
|
||||
dl_carrierBandwidth = 106;
|
||||
#initialDownlinkBWP
|
||||
#genericParameters
|
||||
# this is RBstart=0,L=162 (275*(275-L+1))+(274-RBstart))
|
||||
initialDLBWPlocationAndBandwidth = 28875;
|
||||
initialDLBWPlocationAndBandwidth = 28875; #38.101-1 Table 5.3.2-1
|
||||
#
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
#pdcch-ConfigCommon
|
||||
initialDLBWPcontrolResourceSetZero = 12;
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
initialDLBWPcontrolResourceSetZero = 11;
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 78;
|
||||
ul_frequencyBand = 78;
|
||||
#scs-SpecificCarrierList
|
||||
ul_offstToCarrier = 0;
|
||||
ul_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
ul_subcarrierSpacing = 1;
|
||||
ul_carrierBandwidth = 106;
|
||||
pMax = 20;
|
||||
ul_subcarrierSpacing = 1;
|
||||
ul_carrierBandwidth = 106;
|
||||
pMax = 23;
|
||||
#initialUplinkBWP
|
||||
#genericParameters
|
||||
initialULBWPlocationAndBandwidth = 28875;
|
||||
initialULBWPlocationAndBandwidth = 28875;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
#rach-ConfigCommon
|
||||
#rach-ConfigGeneric
|
||||
prach_ConfigurationIndex = 98;
|
||||
prach_ConfigurationIndex = 152;
|
||||
#prach_msg1_FDM
|
||||
#0 = one, 1=two, 2=four, 3=eight
|
||||
prach_msg1_FDM = 0;
|
||||
prach_msg1_FrequencyStart = 0;
|
||||
zeroCorrelationZoneConfig = 12;
|
||||
preambleReceivedTargetPower = -96;
|
||||
zeroCorrelationZoneConfig = 0;
|
||||
preambleReceivedTargetPower = -100;
|
||||
#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
|
||||
preambleTransMax = 6;
|
||||
preambleTransMax = 8;
|
||||
#powerRampingStep
|
||||
# 0=dB0,1=dB2,2=dB4,3=dB6
|
||||
powerRampingStep = 1;
|
||||
#ra_ReponseWindow
|
||||
#1,2,4,8,10,20,40,80
|
||||
ra_ResponseWindow = 4;
|
||||
powerRampingStep = 3;
|
||||
#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
|
||||
#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3;
|
||||
#oneHalf (0..15) 4,8,12,16,...60,64
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
|
||||
#one (0..15) 4,8,12,16,...60,64
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15;
|
||||
#ra_ContentionResolutionTimer
|
||||
#(0..7) 8,16,24,32,40,48,56,64
|
||||
@@ -111,19 +105,18 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
# this is the offset between the last PRACH preamble power and the Msg3 PUSCH, 2 times the field value in dB
|
||||
msg3_DeltaPreamble = 2;
|
||||
p0_NominalWithGrant = -96;
|
||||
|
||||
# pucch-ConfigCommon setup :
|
||||
# pucchGroupHopping
|
||||
# 0 = neither, 1= group hopping, 2=sequence hopping
|
||||
pucchGroupHopping = 0;
|
||||
hoppingId = 40;
|
||||
p0_nominal = -70;
|
||||
# ssb_PositionsInBurs_BitmapPR
|
||||
# 1=short, 2=medium, 3=long
|
||||
ssb_PositionsInBurst_PR = 2;
|
||||
ssb_PositionsInBurst_Bitmap = 1;
|
||||
hoppingId = 0;
|
||||
p0_nominal = -96;
|
||||
|
||||
ssb_PositionsInBurst_Bitmap = 0x1;
|
||||
|
||||
# ssb_periodicityServingCell
|
||||
# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
|
||||
@@ -145,15 +138,14 @@ gNBs =
|
||||
# pattern1
|
||||
# dl_UL_TransmissionPeriodicity
|
||||
# 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
|
||||
dl_UL_TransmissionPeriodicity = 6;
|
||||
nrofDownlinkSlots = 7;
|
||||
dl_UL_TransmissionPeriodicity = 5;
|
||||
nrofDownlinkSlots = 3;
|
||||
nrofDownlinkSymbols = 6;
|
||||
nrofUplinkSlots = 2;
|
||||
nrofUplinkSlots = 1;
|
||||
nrofUplinkSymbols = 4;
|
||||
|
||||
ssPBCH_BlockPower = -25;
|
||||
ssPBCH_BlockPower = -10;
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
|
||||
@@ -167,97 +159,60 @@ gNBs =
|
||||
|
||||
|
||||
////////// AMF parameters:
|
||||
amf_ip_address = ( { ipv4 = "10.188.63.150";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
amf_ip_address = ({ ipv4 = "172.21.6.116"; });
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
GNB_INTERFACE_NAME_FOR_NG_AMF = "eno1";
|
||||
GNB_IPV4_ADDRESS_FOR_NG_AMF = "10.188.63.150/24";
|
||||
GNB_INTERFACE_NAME_FOR_NGU = "eno1";
|
||||
GNB_IPV4_ADDRESS_FOR_NGU = "10.188.63.150/24";
|
||||
GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.150";
|
||||
GNB_IPV4_ADDRESS_FOR_NGU = "172.21.16.150";
|
||||
GNB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
pusch_TargetSNRx10 = 300;
|
||||
pusch_TargetSNRx10 = 250;
|
||||
pucch_TargetSNRx10 = 200;
|
||||
pusch_FailureThres = 1000;
|
||||
ulsch_max_frame_inactivity = 0;
|
||||
ul_max_mcs = 28;
|
||||
}
|
||||
);
|
||||
|
||||
L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
prach_dtx_threshold = 120;
|
||||
pucch0_dtx_threshold = 80;
|
||||
prach_dtx_threshold = 100;
|
||||
pucch0_dtx_threshold = 10;
|
||||
pusch_dtx_threshold = 10;
|
||||
max_ldpc_iterations = 15;
|
||||
tx_amp_backoff_dB = 12; # needs to match O-RU configuration
|
||||
L1_rx_thread_core = 3;
|
||||
L1_tx_thread_core = 4;
|
||||
phase_compensation = 0; # needs to match O-RU configuration
|
||||
}
|
||||
);
|
||||
|
||||
RUs = (
|
||||
{
|
||||
local_rf = "yes"
|
||||
nb_tx = 1;
|
||||
nb_rx = 1;
|
||||
att_tx = 0;
|
||||
local_rf = "no";
|
||||
nb_tx = 4;
|
||||
nb_rx = 4;
|
||||
att_tx = 24;
|
||||
att_rx = 0;
|
||||
bands = [78];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 85;
|
||||
max_rxgain = 75;
|
||||
sf_extension = 0;
|
||||
eNB_instances = [0];
|
||||
##beamforming 1x2 matrix: 1 layer x 2 antennas
|
||||
bf_weights = [0x00007fff, 0x0000];
|
||||
# Comment these two lines below for colosseum
|
||||
clock_src = "internal";
|
||||
time_source = "internal";
|
||||
# sdr_addrs = "addr=192.168.40.2"; # colosseum USRP IP
|
||||
sdr_addrs = "addr=192.168.40.34"; # local setup
|
||||
ru_thread_core = 5;
|
||||
sl_ahead = 10;
|
||||
tr_preference = "raw_if4p5"; # important: activate FHI7.2
|
||||
do_precoding = 0; # needs to match O-RU configuration
|
||||
}
|
||||
);
|
||||
|
||||
e2_agent = {
|
||||
near_ric_ip_addr = "127.0.0.1";
|
||||
sm_dir = "/usr/local/lib/flexric/"
|
||||
}
|
||||
|
||||
E3Configuration : {
|
||||
link = "zmq";
|
||||
transport = "ipc";
|
||||
};
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_SINGLE_THREAD";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
rfsimulator :
|
||||
{
|
||||
serveraddr = "server";
|
||||
serverport = "4043";
|
||||
options = (); #("saviq"); or/and "chanmod"
|
||||
modelname = "AWGN";
|
||||
IQfile = "/tmp/rfsimulator.iqs";
|
||||
};
|
||||
|
||||
security = {
|
||||
# preferred ciphering algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
@@ -277,14 +232,31 @@ security = {
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
hw_log_level ="info";
|
||||
phy_log_level ="info";
|
||||
mac_log_level ="info";
|
||||
rlc_log_level ="info";
|
||||
pdcp_log_level ="info";
|
||||
rrc_log_level ="info";
|
||||
ngap_log_level ="debug";
|
||||
f1ap_log_level ="debug";
|
||||
e3ap_log_level ="info";
|
||||
}
|
||||
global_log_level = "info";
|
||||
hw_log_level = "info";
|
||||
phy_log_level = "info";
|
||||
mac_log_level = "info";
|
||||
rlc_log_level = "info";
|
||||
pdcp_log_level = "info";
|
||||
rrc_log_level = "info";
|
||||
ngap_log_level = "info";
|
||||
f1ap_log_level = "info";
|
||||
};
|
||||
|
||||
fhi_72 = {
|
||||
dpdk_devices = ("0000:c3:11.0"); # one VF can be used as well
|
||||
system_core = 0;
|
||||
io_core = 1;
|
||||
worker_cores = (2);
|
||||
du_key_pair = ("/opt/oai-gnb/etc/id_rsa.pub", "/opt/oai-gnb/etc/id_rsa");
|
||||
du_addr = ("00:11:22:33:44:66");
|
||||
vlan_tag = (3); # only one needed if one VF configured
|
||||
ru_username = ("oranbenetel");
|
||||
ru_ip_addr = ("192.168.81.4");
|
||||
fh_config = ({
|
||||
T1a_cp_dl = (419, 470);
|
||||
T1a_cp_ul = (285, 336);
|
||||
T1a_up = (294, 345);
|
||||
Ta4 = (0, 200);
|
||||
});
|
||||
};
|
||||
@@ -1,57 +1,41 @@
|
||||
Active_gNBs = ( "oai-gnb");
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
Active_gNBs = ( "gNB-OAI");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
sa = 1;
|
||||
|
||||
gNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
gNB_ID = 0xe00;
|
||||
gNB_name = "oai-gnb";
|
||||
gNB_name = "gNB-OAI";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 1;
|
||||
plmn_list = ({
|
||||
mcc = 001;
|
||||
mnc = 01;
|
||||
mnc_length = 2;
|
||||
snssaiList = (
|
||||
{
|
||||
sst = 1, sd=0x0;
|
||||
},
|
||||
{
|
||||
sst = 1, sd=0xffffff;
|
||||
}
|
||||
);
|
||||
});
|
||||
plmn_list = ({ mcc = 001; mnc = 05; mnc_length = 2; snssaiList = ( { sst = 1; }); });
|
||||
|
||||
nr_cellid = 1;
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
pdsch_AntennaPorts_XP = 2;
|
||||
pusch_AntennaPorts = 2;
|
||||
pdsch_AntennaPorts_N1 = 1;
|
||||
maxMIMO_layers = 2;
|
||||
do_CSIRS = 1;
|
||||
do_SRS = 0;
|
||||
do_SINR = 1;
|
||||
# sib1_tda = 15;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
{
|
||||
controlResourceSetZero = 10;
|
||||
searchSpaceZero = 0;
|
||||
}
|
||||
);
|
||||
servingCellConfigCommon = (
|
||||
{
|
||||
#spCellConfigCommon
|
||||
|
||||
physCellId = 0;
|
||||
# downlinkConfigCommon
|
||||
#frequencyInfoDL
|
||||
# this is 3300.24 + 134*12*30e3 = 3348.48 MHz (5G NR GSCN: 7741)
|
||||
absoluteFrequencySSB = 649920;
|
||||
# center frequency = 3350.01 MHz
|
||||
# selected SSB frequency = 3349.92 MHz
|
||||
absoluteFrequencySSB = 623328;
|
||||
dl_frequencyBand = 78;
|
||||
# this is 3300.24 MHz
|
||||
dl_absoluteFrequencyPointA = 646724;
|
||||
# frequency point A = 3300.87 MHz
|
||||
dl_absoluteFrequencyPointA = 620058;
|
||||
#scs-SpecificCarrierList
|
||||
dl_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
@@ -60,15 +44,15 @@ gNBs =
|
||||
dl_carrierBandwidth = 273;
|
||||
#initialDownlinkBWP
|
||||
#genericParameters
|
||||
# this is RBstart=0,L=162 (275*(275-L+1))+(274-RBstart))
|
||||
initialDLBWPlocationAndBandwidth = 1099;
|
||||
initialDLBWPlocationAndBandwidth = 1099; #38.101-1 Table 5.3.2-1
|
||||
#
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
#pdcch-ConfigCommon
|
||||
initialDLBWPcontrolResourceSetZero = 12;
|
||||
initialDLBWPcontrolResourceSetZero = 11;
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 78;
|
||||
@@ -78,7 +62,7 @@ gNBs =
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
ul_subcarrierSpacing = 1;
|
||||
ul_carrierBandwidth = 273;
|
||||
pMax = 20;
|
||||
pMax = 23;
|
||||
#initialUplinkBWP
|
||||
#genericParameters
|
||||
initialULBWPlocationAndBandwidth = 1099;
|
||||
@@ -87,25 +71,22 @@ gNBs =
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
#rach-ConfigCommon
|
||||
#rach-ConfigGeneric
|
||||
prach_ConfigurationIndex = 151;# testMAC 158; OAI gNB 98
|
||||
prach_ConfigurationIndex = 152;
|
||||
#prach_msg1_FDM
|
||||
#0 = one, 1=two, 2=four, 3=eight
|
||||
prach_msg1_FDM = 0;
|
||||
prach_msg1_FrequencyStart = 0;
|
||||
zeroCorrelationZoneConfig = 12;
|
||||
preambleReceivedTargetPower = -96;
|
||||
zeroCorrelationZoneConfig = 0;
|
||||
preambleReceivedTargetPower = -100;
|
||||
#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
|
||||
preambleTransMax = 6;
|
||||
preambleTransMax = 8;
|
||||
#powerRampingStep
|
||||
# 0=dB0,1=dB2,2=dB4,3=dB6
|
||||
powerRampingStep = 1;
|
||||
#ra_ReponseWindow
|
||||
#1,2,4,8,10,20,40,80
|
||||
ra_ResponseWindow = 5;
|
||||
powerRampingStep = 3;
|
||||
#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
|
||||
#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3;
|
||||
#oneHalf (0..15) 4,8,12,16,...60,64
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
|
||||
#one (0..15) 4,8,12,16,...60,64
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15;
|
||||
#ra_ContentionResolutionTimer
|
||||
#(0..7) 8,16,24,32,40,48,56,64
|
||||
@@ -121,42 +102,51 @@ gNBs =
|
||||
# restrictedSetConfig
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
|
||||
# this is the offset between the last PRACH preamble power and the Msg3 PUSCH, 2 times the field value in dB
|
||||
msg3_DeltaPreamble = 2;
|
||||
p0_NominalWithGrant = -90;
|
||||
p0_NominalWithGrant = -96;
|
||||
|
||||
# pucch-ConfigCommon setup :
|
||||
# pucchGroupHopping
|
||||
# 0 = neither, 1= group hopping, 2=sequence hopping
|
||||
pucchGroupHopping = 0;
|
||||
hoppingId = 40;
|
||||
p0_nominal = -90;
|
||||
# ssb_PositionsInBurs_BitmapPR
|
||||
# 1=short, 2=medium, 3=long
|
||||
ssb_PositionsInBurst_PR = 2;
|
||||
ssb_PositionsInBurst_Bitmap = 1;
|
||||
hoppingId = 0;
|
||||
p0_nominal = -96;
|
||||
|
||||
ssb_PositionsInBurst_Bitmap = 0x1;
|
||||
|
||||
# ssb_periodicityServingCell
|
||||
# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
|
||||
ssb_periodicityServingCell = 2;
|
||||
|
||||
# dmrs_TypeA_position
|
||||
# 0 = pos2, 1 = pos3
|
||||
dmrs_TypeA_Position = 0;
|
||||
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
subcarrierSpacing = 1;
|
||||
#tdd-UL-DL-ConfigurationCommon
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
|
||||
|
||||
#tdd-UL-DL-ConfigurationCommon
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
referenceSubcarrierSpacing = 1;
|
||||
# pattern1
|
||||
# dl_UL_TransmissionPeriodicity
|
||||
# 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
|
||||
dl_UL_TransmissionPeriodicity = 6; #6;
|
||||
nrofDownlinkSlots = 7; #7;
|
||||
dl_UL_TransmissionPeriodicity = 5;
|
||||
nrofDownlinkSlots = 3;
|
||||
nrofDownlinkSymbols = 6;
|
||||
nrofUplinkSlots = 2; #2;
|
||||
nrofUplinkSlots = 1;
|
||||
nrofUplinkSymbols = 4;
|
||||
ssPBCH_BlockPower = 0;
|
||||
|
||||
ssPBCH_BlockPower = -11;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
@@ -165,67 +155,62 @@ gNBs =
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
////////// AMF parameters:
|
||||
amf_ip_address = ({ ipv4 = "172.30.134.111"; });
|
||||
|
||||
////////// AMF parameters:
|
||||
amf_ip_address = ({ ipv4 = "172.21.6.116"; });
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
GNB_IPV4_ADDRESS_FOR_NG_AMF = "10.130.0.20";
|
||||
GNB_IPV4_ADDRESS_FOR_NGU = "10.130.0.20";
|
||||
GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.150";
|
||||
GNB_IPV4_ADDRESS_FOR_NGU = "172.21.16.150";
|
||||
GNB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
pusch_TargetSNRx10 = 120;
|
||||
pucch_TargetSNRx10 = 260;
|
||||
ul_bler_target_upper=.15;
|
||||
ul_bler_target_lower=.05;
|
||||
pusch_FailureThres = 100;
|
||||
ul_max_mcs = 28;
|
||||
ulsch_max_frame_inactivity = 1;
|
||||
#pusch_RSSI_Threshold = -500;
|
||||
#pucch_RSSI_Threshold = -600;
|
||||
pusch_TargetSNRx10 = 200;
|
||||
pucch_TargetSNRx10 = 200;
|
||||
pusch_FailureThres = 1000;
|
||||
}
|
||||
);
|
||||
|
||||
L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
prach_dtx_threshold = 180;
|
||||
pucch0_dtx_threshold = 80;
|
||||
prach_dtx_threshold = 100;
|
||||
pucch0_dtx_threshold = 10;
|
||||
pusch_dtx_threshold = 10;
|
||||
max_ldpc_iterations = 15;
|
||||
tx_amp_backoff_dB = 24; # needs to match O-RU configuration
|
||||
L1_rx_thread_core = 47;
|
||||
L1_tx_thread_core = 49; # relevant after merge of l1_tx_thread
|
||||
tx_amp_backoff_dB = 12; # needs to match O-RU configuration
|
||||
L1_rx_thread_core = 3;
|
||||
L1_tx_thread_core = 4;
|
||||
phase_compensation = 0; # needs to match O-RU configuration
|
||||
}
|
||||
);
|
||||
|
||||
RUs = (
|
||||
{
|
||||
local_rf = "no";
|
||||
nb_tx = 2;
|
||||
nb_rx = 2;
|
||||
att_tx = 0
|
||||
att_tx = 24;
|
||||
att_rx = 0;
|
||||
bands = [78];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 75;
|
||||
sf_extension = 0;
|
||||
eNB_instances = [0];
|
||||
ru_thread_core = 51;
|
||||
sl_ahead = 5;
|
||||
##beamforming 1x2 matrix: 1 layer x 2 antennas
|
||||
bf_weights = [0x00007fff, 0x0000,0x00007fff, 0x0000];
|
||||
ru_thread_core = 5;
|
||||
sl_ahead = 10;
|
||||
tr_preference = "raw_if4p5"; # important: activate FHI7.2
|
||||
do_precoding = 0; # needs to match O-RU configuration
|
||||
do_precoding = 0; # needs to match O-RU configuration
|
||||
}
|
||||
);
|
||||
|
||||
security = {
|
||||
# preferred ciphering algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
@@ -245,51 +230,31 @@ security = {
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
hw_log_level ="info";
|
||||
phy_log_level ="info";
|
||||
mac_log_level ="info";
|
||||
rlc_log_level ="info";
|
||||
pdcp_log_level ="info";
|
||||
rrc_log_level ="info";
|
||||
ngap_log_level ="info";
|
||||
f1ap_log_level ="info";
|
||||
e3ap_log_level ="info";
|
||||
global_log_level = "info";
|
||||
hw_log_level = "info";
|
||||
phy_log_level = "info";
|
||||
mac_log_level = "info";
|
||||
rlc_log_level = "info";
|
||||
pdcp_log_level = "info";
|
||||
rrc_log_level = "info";
|
||||
ngap_log_level = "info";
|
||||
f1ap_log_level = "info";
|
||||
};
|
||||
|
||||
E3Configuration : {
|
||||
link = "zmq";
|
||||
transport = "tcp";
|
||||
};
|
||||
|
||||
|
||||
fhi_72 = {
|
||||
dpdk_devices = ("0000:a0:00.7", "0000:a0:01.7");
|
||||
system_core = 53;
|
||||
io_core = 55;
|
||||
worker_cores = (57);
|
||||
du_addr = ("56:89:79:bc:cd:3c", "56:89:79:bc:cd:3c");
|
||||
# ru_addr = ("b8:ce:f6:5e:6b:4a", "b8:ce:f6:5e:6b:4a");
|
||||
ru_addr = ("6c:ad:ad:00:04:de", "6c:ad:ad:00:04:de");
|
||||
mtu = 8000;
|
||||
file_prefix = "fhi_72";
|
||||
dpdk_devices = ("0000:c3:11.0"); # one VF can be used as well
|
||||
system_core = 0;
|
||||
io_core = 1;
|
||||
worker_cores = (2);
|
||||
du_key_pair = ("/opt/oai-gnb/etc/id_rsa.pub", "/opt/oai-gnb/etc/id_rsa");
|
||||
du_addr = ("00:11:22:33:44:66");
|
||||
vlan_tag = (3); # only one needed if one VF configured
|
||||
ru_username = ("oranbenetel");
|
||||
ru_ip_addr = ("192.168.81.4");
|
||||
fh_config = ({
|
||||
Tadv_cp_dl = 25;
|
||||
T2a_cp_dl = (285, 429); # (min, max)
|
||||
T2a_cp_ul = (285, 429); # (min, max)
|
||||
T2a_up = (71, 428); # (min, max)
|
||||
Ta3 = (20, 32); # (min, max)
|
||||
T1a_cp_dl = (285, 470); # (min, max)
|
||||
T1a_cp_ul = (285, 429); # (min, max)
|
||||
T1a_up = (96, 196); # (min, max) #96
|
||||
Ta4 = (0, 75); # (min, max)
|
||||
ru_config = {
|
||||
iq_width = 9;
|
||||
iq_width_prach = 9;
|
||||
fft_size = 12;
|
||||
};
|
||||
prach_config = {
|
||||
eAxC_offset = 2; # 4 if you want to use 4x4
|
||||
};
|
||||
T1a_cp_dl = (419, 470);
|
||||
T1a_cp_ul = (285, 336);
|
||||
T1a_up = (294, 345);
|
||||
Ta4 = (0, 200);
|
||||
});
|
||||
};
|
||||
@@ -5,8 +5,8 @@ uicc0 = {
|
||||
key = "fec86ba6eb707ed08905757b1bb44b8f";
|
||||
opc= "C42449363BBAD02B66D16BC975D77CC1";
|
||||
pdu_sessions = (
|
||||
{ id = 1; dnn = "oai"; nssai_sst = 1; },
|
||||
{ id = 2; dnn = "oai"; nssai_sst = 1; }
|
||||
{ id = 1; dnn = "oai"; nssai_sst = 1; nssai_sd = 0xFFFFFF; },
|
||||
{ id = 2; dnn = "openairinterface"; nssai_sst = 1; nssai_sd = 0x123456; }
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ channelmod:
|
||||
- model_name: rfsimu_channel_ue0
|
||||
type: AWGN
|
||||
ploss_dB: 20
|
||||
nose_power_dB: -2
|
||||
noise_power_dB: -2
|
||||
forgetfact: 0
|
||||
offset: 0
|
||||
ds_tdl: 0
|
||||
|
||||
@@ -21,4 +21,4 @@ WORKDIR /oai-ran
|
||||
COPY . .
|
||||
|
||||
WORKDIR /oai-ran/build
|
||||
RUN cmake -GNinja -DENABLE_TESTS=ON -DOAI_ZMQ=ON -DCMAKE_BUILD_TYPE=Debug -DSANITIZE_ADDRESS=True .. && ninja tests
|
||||
RUN cmake -GNinja -DENABLE_TESTS=ON -DOAI_ZMQ=ON -DCMAKE_BUILD_TYPE=Debug -DSANITIZE_ADDRESS=True .. && ninja
|
||||
|
||||
@@ -65,21 +65,16 @@ def ExecuteActionWithParam(action, ctx, node):
|
||||
global HTML
|
||||
global CONTAINERS
|
||||
global CLUSTER
|
||||
if action == 'Build_eNB' or action == 'Build_Image' or action == 'Build_Proxy' or action == "Build_Cluster_Image" or action == "Build_Run_Tests":
|
||||
if action == 'Build_eNB' or action == 'Build_Image' or action == "Build_Cluster_Image" or action == "Build_Run_Tests":
|
||||
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':
|
||||
success = cls_native.Native.Build(ctx, node, HTML, RAN.eNBSourceCodePath, RAN.Build_eNB_args)
|
||||
success = cls_native.Native.Build(ctx, node, HTML, RAN.workspace, RAN.Build_eNB_args)
|
||||
elif action == 'Build_Image':
|
||||
success = CONTAINERS.BuildImage(ctx, node, HTML)
|
||||
elif action == 'Build_Proxy':
|
||||
success = CONTAINERS.BuildProxy(ctx, node, HTML)
|
||||
elif action == 'Build_Cluster_Image':
|
||||
success = CLUSTER.BuildClusterImage(ctx, node, HTML)
|
||||
elif action == 'Build_Run_Tests':
|
||||
@@ -153,16 +148,16 @@ def ExecuteActionWithParam(action, ctx, node):
|
||||
elif action == 'Deploy_Run_OC_PhySim':
|
||||
oc_release = test.findtext('oc_release')
|
||||
script = "scripts/oc-deploy-physims.sh"
|
||||
image_tag = cls_containerize.CreateTag(CLUSTER.ranCommitID, CLUSTER.ranBranch, CLUSTER.ranAllowMerge)
|
||||
options = f"oaicicd-core-for-ci-ran {oc_release} {image_tag} {CLUSTER.eNBSourceCodePath}"
|
||||
workdir = CLUSTER.eNBSourceCodePath
|
||||
image_tag = cls_containerize.CreateTag(CLUSTER.commitID, CLUSTER.branch, CLUSTER.merge)
|
||||
options = f"oaicicd-core-for-ci-ran {oc_release} {image_tag} {CLUSTER.workspace}"
|
||||
workdir = CLUSTER.workspace
|
||||
success = cls_oaicitest.Deploy_Physim(ctx, HTML, node, workdir, script, options)
|
||||
|
||||
elif action == 'Build_Deploy_PhySim':
|
||||
ctest_opt = test.findtext('ctest-opt') or ''
|
||||
script = test.findtext('script')
|
||||
options = f"{CONTAINERS.eNBSourceCodePath} {ctest_opt}"
|
||||
workdir = CONTAINERS.eNBSourceCodePath
|
||||
options = f"{CONTAINERS.workspace} {ctest_opt}"
|
||||
workdir = CONTAINERS.workspace
|
||||
success = cls_oaicitest.Deploy_Physim(ctx, HTML, node, workdir, script, options)
|
||||
|
||||
elif action == 'DeployCoreNetwork' or action == 'UndeployCoreNetwork':
|
||||
@@ -174,7 +169,7 @@ def ExecuteActionWithParam(action, ctx, node):
|
||||
CONTAINERS.yamlPath = test.findtext('yaml_path')
|
||||
CONTAINERS.services = test.findtext('services')
|
||||
CONTAINERS.num_attempts = int(test.findtext('num_attempts') or 1)
|
||||
CONTAINERS.deploymentTag = cls_containerize.CreateTag(CONTAINERS.ranCommitID, CONTAINERS.ranBranch, CONTAINERS.ranAllowMerge)
|
||||
CONTAINERS.deploymentTag = cls_containerize.CreateTag(CONTAINERS.commitID, CONTAINERS.branch, CONTAINERS.merge)
|
||||
if action == 'Deploy_Object':
|
||||
success = CONTAINERS.DeployObject(ctx, node, HTML)
|
||||
elif action == 'Stop_Object':
|
||||
@@ -195,7 +190,7 @@ def ExecuteActionWithParam(action, ctx, node):
|
||||
success = CONTAINERS.Create_Workspace(node, HTML)
|
||||
|
||||
elif action == 'LicenceAndFormattingCheck':
|
||||
success = SCA.StaticCodeAnalysis.LicenceAndFormattingCheck(ctx, node, HTML, RAN.eNBSourceCodePath, RAN.ranBranch, RAN.ranAllowMerge, RAN.ranTargetBranch)
|
||||
success = SCA.StaticCodeAnalysis.LicenceAndFormattingCheck(ctx, node, HTML, RAN.workspace, RAN.branch, RAN.merge, RAN.targetBranch)
|
||||
|
||||
elif action == 'Push_Local_Registry':
|
||||
tag_prefix = test.findtext('tag_prefix') or ""
|
||||
@@ -219,14 +214,14 @@ def ExecuteActionWithParam(action, ctx, node):
|
||||
elif action == 'Custom_Command':
|
||||
command = test.findtext('command')
|
||||
# Allow referencing repository workspace path in XML via %%workspace%%
|
||||
command = command.replace("%%workspace%%", CONTAINERS.eNBSourceCodePath)
|
||||
command = command.replace("%%workspace%%", CONTAINERS.workspace)
|
||||
success = cls_oaicitest.Custom_Command(HTML, node, command)
|
||||
|
||||
elif action == 'Custom_Script':
|
||||
script = test.findtext('script')
|
||||
args = test.findtext('args')
|
||||
# Allow referencing repository workspace path in XML via %%workspace%%
|
||||
script = script.replace("%%workspace%%", CONTAINERS.eNBSourceCodePath)
|
||||
script = script.replace("%%workspace%%", CONTAINERS.workspace)
|
||||
success = cls_oaicitest.Custom_Script(HTML, node, script, args)
|
||||
|
||||
elif action == 'Pull_Cluster_Image':
|
||||
@@ -370,15 +365,15 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
|
||||
logging.info('\u001B[1m Starting Scenario: ' + CiTestObj.testXMLfiles[0] + '\u001B[0m')
|
||||
logging.info('\u001B[1m----------------------------------------\u001B[0m')
|
||||
if re.match('^TesteNB$', mode, re.IGNORECASE):
|
||||
if RAN.ranRepository == '' or RAN.ranBranch == '' or RAN.eNBSourceCodePath == '':
|
||||
if RAN.repository == '' or RAN.branch == '' or RAN.workspace == '':
|
||||
HELP.GenericHelp(CONST.Version)
|
||||
if RAN.ranRepository == '':
|
||||
HELP.GitSrvHelp(RAN.ranRepository, RAN.ranBranch, RAN.ranCommitID, RAN.ranAllowMerge, RAN.ranTargetBranch)
|
||||
if RAN.eNBSourceCodePath == '':
|
||||
HELP.eNBSrvHelp(RAN.eNBSourceCodePath)
|
||||
if RAN.repository == '':
|
||||
HELP.GitSrvHelp(RAN.repository, RAN.branch, RAN.commitID, RAN.merge, RAN.targetBranch)
|
||||
if RAN.workspace == '':
|
||||
HELP.eNBSrvHelp(RAN.workspace)
|
||||
sys.exit('Insufficient Parameter')
|
||||
else:
|
||||
if CiTestObj.ranRepository == '' or CiTestObj.ranBranch == '':
|
||||
if CiTestObj.repository == '' or CiTestObj.branch == '':
|
||||
HELP.GenericHelp(CONST.Version)
|
||||
sys.exit('UE: Insufficient Parameter')
|
||||
|
||||
|
||||
96
ci-scripts/pre-ci-check.sh
Executable file
96
ci-scripts/pre-ci-check.sh
Executable file
@@ -0,0 +1,96 @@
|
||||
#!/bin/bash
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
function usage {
|
||||
echo "OAI GitLab MR validation script (Signed-off-by and merge commits)"
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo "------"
|
||||
echo " $0 -s <source-branch> -t <target-branch>"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo "--------"
|
||||
echo " -s"
|
||||
echo " The source branch of the merge request. Default value is current Git Branch (HEAD)"
|
||||
echo ""
|
||||
echo " -t"
|
||||
echo " The target branch of the merge request. Default value is develop"
|
||||
echo ""
|
||||
echo " -h"
|
||||
echo " Print this help message."
|
||||
echo ""
|
||||
}
|
||||
|
||||
# Parse arguments properly
|
||||
SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
TARGET_BRANCH="origin/develop"
|
||||
|
||||
git fetch --quiet
|
||||
|
||||
while getopts ":s:t:h" opt; do
|
||||
case "$opt" in
|
||||
s)
|
||||
SOURCE_BRANCH="$OPTARG"
|
||||
;;
|
||||
t)
|
||||
TARGET_BRANCH="$OPTARG"
|
||||
;;
|
||||
h)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
:)
|
||||
echo "Error: Option -$OPTARG requires a value."
|
||||
echo ""
|
||||
usage
|
||||
exit 2
|
||||
;;
|
||||
\?)
|
||||
echo "Error: Invalid option -$OPTARG"
|
||||
echo ""
|
||||
usage
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# ----------------------------
|
||||
# Merged commits
|
||||
# ----------------------------
|
||||
mergeCommits=$(git rev-list --merges --abbrev-commit "$TARGET_BRANCH".."$SOURCE_BRANCH")
|
||||
if [[ ! "$SOURCE_BRANCH" =~ ^(origin/)?integration_[0-9]{4}_w[0-9]{2}$ ]]; then
|
||||
if [[ -n "$mergeCommits" ]]; then
|
||||
message="> ERROR: Following merge commits are found in the source branch history. Please rebase your branch.\n>\n"
|
||||
message+="> $(echo "$mergeCommits" | paste -sd ',' -)\n"
|
||||
echo -e "$message"
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
|
||||
# ----------------------------
|
||||
# Check unsigned commits
|
||||
# ----------------------------
|
||||
unsignedCommits=$(
|
||||
for c in $(git rev-list "$TARGET_BRANCH".."$SOURCE_BRANCH" --no-merges); do
|
||||
if ! git log -1 --format=%B "$c" | grep -q "Signed-off-by:"; then
|
||||
git log -1 --format='%h' "$c"
|
||||
fi
|
||||
done | paste -sd ","
|
||||
)
|
||||
|
||||
# ----------------------------
|
||||
# Report unsigned commits
|
||||
# ----------------------------
|
||||
message=""
|
||||
|
||||
if [ -n "$unsignedCommits" ]; then
|
||||
message="> WARNING: The following commit(s) are missing a Signed-off-by:\n>\n> $unsignedCommits\n>\n"
|
||||
message+="> Please use 'git commit -s' to sign your commits.\n>\n"
|
||||
message+="> For detailed instructions, refer to the CONTRIBUTING file at the root of this repository."
|
||||
echo -e "$message"
|
||||
exit 1
|
||||
else
|
||||
message="> All commits are signed off using 'git commit -s'."
|
||||
echo -e "$message"
|
||||
exit 0
|
||||
fi
|
||||
@@ -32,12 +32,12 @@ class RANManagement():
|
||||
|
||||
def __init__(self):
|
||||
|
||||
self.ranRepository = ''
|
||||
self.ranBranch = ''
|
||||
self.ranAllowMerge = False
|
||||
self.ranCommitID = ''
|
||||
self.ranTargetBranch = ''
|
||||
self.eNBSourceCodePath = ''
|
||||
self.repository = ''
|
||||
self.branch = ''
|
||||
self.merge = False
|
||||
self.commitID = ''
|
||||
self.targetBranch = ''
|
||||
self.workspace = ''
|
||||
self.Initialize_eNB_args = ''
|
||||
self.imageKind = ''
|
||||
self.eNBOptions = ['', '', '']
|
||||
@@ -57,7 +57,7 @@ class RANManagement():
|
||||
raise ValueError(f"{node=}")
|
||||
logging.debug('Starting eNB/gNB on server: ' + node)
|
||||
|
||||
lSourcePath = self.eNBSourceCodePath
|
||||
lSourcePath = self.workspace
|
||||
cmd = cls_cmd.getConnection(node)
|
||||
|
||||
# Initialize_eNB_args usually start with -O and followed by the location in repository
|
||||
@@ -103,7 +103,7 @@ class RANManagement():
|
||||
|
||||
def TerminateeNB(self, ctx, node, HTML, to_analyze):
|
||||
logging.debug('Stopping eNB/gNB on server: ' + node)
|
||||
lSourcePath = self.eNBSourceCodePath
|
||||
lSourcePath = self.workspace
|
||||
cmd = cls_cmd.getConnection(node)
|
||||
ret = cmd.run('ps -aux | grep --color=never -e softmodem | grep -v grep')
|
||||
result = re.search('-softmodem', ret.stdout)
|
||||
@@ -138,7 +138,7 @@ class RANManagement():
|
||||
|
||||
def AnalyzeRTStats(self, HTML, node, ctx, thresholds):
|
||||
logging.info(f'Analyzing realtime stats from server: {node}')
|
||||
lSourcePath = self.eNBSourceCodePath
|
||||
lSourcePath = self.workspace
|
||||
|
||||
logdir = f'{lSourcePath}/cmake_targets'
|
||||
with cls_cmd.getConnection(node) as cmd:
|
||||
|
||||
@@ -24,7 +24,7 @@ class TestBuild(unittest.TestCase):
|
||||
self._d = tempfile.mkdtemp()
|
||||
logging.warning(f"temporary directory: {self._d}")
|
||||
self.node = 'localhost'
|
||||
self.cont.eNBSourceCodePath = self._d
|
||||
self.cont.workspace = self._d
|
||||
self.ctx = TestCaseCtx.Default(tempfile.mkdtemp())
|
||||
|
||||
def tearDown(self):
|
||||
@@ -33,10 +33,5 @@ class TestBuild(unittest.TestCase):
|
||||
cmd.run(f"rm -rf {self._d}")
|
||||
cmd.run(f'rm -rf {self.ctx.logPath}')
|
||||
|
||||
def test_build_proxy(self):
|
||||
self.cont.proxyCommit = "b64d9bce986b38ca59e8582864ade3fcdd05c0dc"
|
||||
success = self.cont.BuildProxy(self.ctx, self.node, self.html)
|
||||
self.assertTrue(success)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
@@ -41,10 +41,10 @@ class TestDeploymentMethods(unittest.TestCase):
|
||||
self.ci = cls_oaicitest.OaiCiTest()
|
||||
self.cont = cls_containerize.Containerize()
|
||||
self.cont.yamlPath = ''
|
||||
self.cont.ranAllowMerge = True
|
||||
self.cont.ranBranch = ''
|
||||
self.cont.ranCommitID = ''
|
||||
self.cont.eNBSourceCodePath = os.getcwd()
|
||||
self.cont.merge = True
|
||||
self.cont.branch = ''
|
||||
self.cont.commitID = ''
|
||||
self.cont.workspace = os.getcwd()
|
||||
self.cont.num_attempts = 3
|
||||
self.node = 'localhost'
|
||||
self.ctx = TestCaseCtx.Default(tempfile.mkdtemp())
|
||||
@@ -136,13 +136,13 @@ class TestDeploymentMethods(unittest.TestCase):
|
||||
self.assertTrue(undeploy)
|
||||
|
||||
def test_create_workspace(self):
|
||||
self.cont.eNBSourceCodePath = tempfile.mkdtemp()
|
||||
self.cont.ranRepository = "https://gitlab.eurecom.fr/oai/openairinterface5g.git"
|
||||
self.cont.ranCommitID = "05f9c975eeecbca1bdff5940affad44465f1301f"
|
||||
self.cont.ranBranch = "develop"
|
||||
self.cont.workspace = tempfile.mkdtemp()
|
||||
self.cont.repository = "https://gitlab.eurecom.fr/oai/openairinterface5g.git"
|
||||
self.cont.commitID = "05f9c975eeecbca1bdff5940affad44465f1301f"
|
||||
self.cont.branch = "develop"
|
||||
ws = self.cont.Create_Workspace(self.node, self.html)
|
||||
with cls_cmd.LocalCmd() as cmd:
|
||||
cmd.run(f"rm -rf {self.cont.eNBSourceCodePath}")
|
||||
cmd.run(f"rm -rf {self.cont.workspace}")
|
||||
self.assertTrue(ws)
|
||||
|
||||
def test_undeploy_loganalysis(self):
|
||||
|
||||
@@ -82,5 +82,17 @@ class TestPingIperf(unittest.TestCase):
|
||||
success = self.ci.Iperf(self.ctx, self.node, self.html, infra_file=infra_file)
|
||||
self.assertTrue(success)
|
||||
|
||||
def test_iperf_new_bindport(self):
|
||||
self.ci.iperf_args = "-u -t 5 -b 22M -O 0 -p 10000 -B 127.0.0.3"
|
||||
self.ci.svr_id = "test"
|
||||
self.ci.svr_node = "localhost"
|
||||
self.ci.iperf_packetloss_threshold = "0"
|
||||
self.ci.iperf_bitrate_threshold = "0"
|
||||
self.ci.iperf_profile = "balanced"
|
||||
infra_file = "tests/config/infra_ping_iperf.yaml"
|
||||
# TODO Should need nothing but options and UE(s) to use
|
||||
success = self.ci.Iperf(self.ctx, self.node, self.html, infra_file=infra_file)
|
||||
self.assertTrue(success)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
@@ -22,7 +22,7 @@ class TestDeploymentMethods(unittest.TestCase):
|
||||
self.html = cls_oai_html.HTMLManagement()
|
||||
self.html.testCaseId = "000000"
|
||||
self.cont = cls_containerize.Containerize()
|
||||
self.cont.eNBSourceCodePath = os.getcwd()
|
||||
self.cont.workspace = os.getcwd()
|
||||
|
||||
def test_pull_clean_local_reg(self):
|
||||
# the pull function has the authentication at the internal cluster hardcoded
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
- Build_Proxy
|
||||
- Build_Cluster_Image
|
||||
- Pull_Cluster_Image
|
||||
- Build_eNB
|
||||
|
||||
@@ -41,6 +41,17 @@
|
||||
<node>localhost</node>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Ping</class>
|
||||
<desc>UL ping ext-dn from NR-UE</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<node>localhost</node>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>localhost</svr_node>
|
||||
<ping_args>-c 20 -i0.5</ping_args>
|
||||
<ping_packetloss_threshold>80</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Ping</class>
|
||||
<desc>Ping NR-UE from ext-dn</desc>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<desc>Deploy OAI 5G CoreNetwork</desc>
|
||||
<node>localhost</node>
|
||||
<yaml_path>ci-scripts/yaml_files/5g_rfsimulator_u0_25prb</yaml_path>
|
||||
<services>mysql oai-amf oai-smf oai-upf oai-ext-dn</services>
|
||||
<services>mysql oai-amf oai-smf oai-pcf oai-upf oai-ext-dn</services>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
@@ -41,28 +41,6 @@
|
||||
<node>localhost</node>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Ping</class>
|
||||
<desc>Ping ext-dn from NR-UE</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<node>localhost</node>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>localhost</svr_node>
|
||||
<ping_args>-c 20 -i 0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Ping</class>
|
||||
<desc>Ping NR-UE from ext-dn</desc>
|
||||
<id>rfsim5g_ext_dn</id>
|
||||
<node>localhost</node>
|
||||
<svr_id>rfsim5g_ue</svr_id>
|
||||
<svr_node>localhost</svr_node>
|
||||
<ping_args>-c 20 -i 0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Attach_UE</class>
|
||||
<desc>Verify 2nd PDU session is up</desc>
|
||||
@@ -71,14 +49,109 @@
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Ping</class>
|
||||
<desc>Ping ext-dn from NR-UE on PDU session ID 2</desc>
|
||||
<class>Custom_Command</class>
|
||||
<desc>Configure policy routing for PDU2 source IP</desc>
|
||||
<may_fail>true</may_fail>
|
||||
<node>localhost</node>
|
||||
<command>docker exec rfsim5g-oai-nr-ue sh -c "ip rule add from 12.1.2.2/32 table 1002 prio 1002; ip route replace default dev oaitun_ue1p2 src 12.1.2.2 table 1002"</command>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Custom_Command</class>
|
||||
<desc>Ping ext-dn from UE PDU session 1 interface</desc>
|
||||
<node>localhost</node>
|
||||
<command>docker exec rfsim5g-oai-nr-ue ping -I oaitun_ue1 -c 10 192.168.72.135</command>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Custom_Command</class>
|
||||
<desc>Ping ext-dn from UE PDU session 2 interface</desc>
|
||||
<node>localhost</node>
|
||||
<command>docker exec rfsim5g-oai-nr-ue ping -I oaitun_ue1p2 -c 10 192.168.72.135</command>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Iperf</class>
|
||||
<desc>Iperf (UL/1Mbps/UDP)(6 sec) QFI 1 (default) flow on PDU session 1 (port 5201)</desc>
|
||||
<iperf_args>-u -b 1M -t 6 -B 12.1.1.2 -p 5201</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<node>localhost</node>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>localhost</svr_node>
|
||||
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>10</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Iperf</class>
|
||||
<desc>Iperf (UL/1Mbps/UDP)(6 sec) QFI 2 flow on PDU session 1 (port 52080)</desc>
|
||||
<iperf_args>-u -b 1M -t 6 -B 12.1.1.2 -p 52080</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<node>localhost</node>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>localhost</svr_node>
|
||||
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>10</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Iperf</class>
|
||||
<desc>Iperf (UL/1Mbps/UDP)(6 sec) QFI 3 flow on PDU session 1 (port 52081)</desc>
|
||||
<iperf_args>-u -b 1M -t 6 -B 12.1.1.2 -p 52081</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<node>localhost</node>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>localhost</svr_node>
|
||||
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>10</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Iperf</class>
|
||||
<desc>Iperf (UL/1Mbps/UDP)(6 sec) default flow on PDU session 2 (port 5201)</desc>
|
||||
<iperf_args>-u -b 1M -t 6 -B 12.1.2.2 -p 5201</iperf_args>
|
||||
<id>rfsim5g_ue_pdu_2</id>
|
||||
<node>localhost</node>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>localhost</svr_node>
|
||||
<ping_args>-c 20 -i 0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>10</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Iperf</class>
|
||||
<desc>Iperf (DL/1Mbps/UDP)(6 sec) QFI 1 (default) flow on PDU session 1 (port 5201)</desc>
|
||||
<iperf_args>-u -b 1M -t 6 -R -B 12.1.1.2 -p 5201</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<node>localhost</node>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>localhost</svr_node>
|
||||
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>10</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Iperf</class>
|
||||
<desc>Iperf (DL/1Mbps/UDP)(6 sec) QFI 2 flow on PDU session 1 (port 52080)</desc>
|
||||
<iperf_args>-u -b 1M -t 6 -R -B 12.1.1.2 -p 52080</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<node>localhost</node>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>localhost</svr_node>
|
||||
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>10</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Iperf</class>
|
||||
<desc>Iperf (DL/1Mbps/UDP)(6 sec) QFI 3 flow on PDU session 1 (port 52081)</desc>
|
||||
<iperf_args>-u -b 1M -t 6 -R -B 12.1.1.2 -p 52081</iperf_args>
|
||||
<id>rfsim5g_ue</id>
|
||||
<node>localhost</node>
|
||||
<svr_id>rfsim5g_ext_dn</svr_id>
|
||||
<svr_node>localhost</svr_node>
|
||||
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>10</iperf_bitrate_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
<!-- SPDX-License-Identifier: LicenseRef-CSSL-1.0 -->
|
||||
|
||||
<testCaseList>
|
||||
<htmlTabRef>l2sim-4glte-5gnr-proxy-build</htmlTabRef>
|
||||
<htmlTabName>Build L2sim proxy image</htmlTabName>
|
||||
<htmlTabIcon>wrench</htmlTabIcon>
|
||||
|
||||
<testCase>
|
||||
<class>Build_Proxy</class>
|
||||
<desc>Build L2sim Proxy Image</desc>
|
||||
<node>localhost</node>
|
||||
<proxy_commit>b64d9bce986b38ca59e8582864ade3fcdd05c0dc</proxy_commit>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
@@ -0,0 +1,149 @@
|
||||
<!-- SPDX-License-Identifier: LicenseRef-CSSL-1.0 -->
|
||||
|
||||
<testCaseList>
|
||||
<htmlTabRef>test-5g-fhi72-benetel-2x2-100MHz-9b-mplane</htmlTabRef>
|
||||
<htmlTabName>100 MHz 2x2 9b TDD SA Benetel M-plane</htmlTabName>
|
||||
<htmlTabIcon>tasks</htmlTabIcon>
|
||||
|
||||
<testCase>
|
||||
<class>DeployCoreNetwork</class>
|
||||
<desc>Initialize 5G Core</desc>
|
||||
<cn_id>oc-cn5g-00105</cn_id>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Custom_Script</class>
|
||||
<desc>Configure system for low-latency RT performance</desc>
|
||||
<node>cacofonix</node>
|
||||
<script>yaml_files/sa_fhi_7.2_benetel550_2x2_100MHz_9b_mplane_gnb/setup_config.sh</script>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Pull_Local_Registry</class>
|
||||
<desc>Pull Images from Local Registry</desc>
|
||||
<node>cacofonix</node>
|
||||
<images>oai-gnb-fhi72</images>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Initialize_UE</class>
|
||||
<desc>Initialize Amarisoft UE</desc>
|
||||
<id>amarisoft_00105_100MHz</id>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Create_Workspace</class>
|
||||
<desc>Create new Workspace for server 0</desc>
|
||||
<node>cacofonix</node>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Deploy_Object</class>
|
||||
<desc>Deploy gNB (TDD/Band78/100MHz/Benetel) in a container</desc>
|
||||
<node>cacofonix</node>
|
||||
<yaml_path>ci-scripts/yaml_files/sa_fhi_7.2_benetel550_2x2_100MHz_9b_mplane_gnb</yaml_path>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach UE</desc>
|
||||
<id>amarisoft_ue_1</id>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Ping</class>
|
||||
<desc>Ping: 100 pings in 10 sec</desc>
|
||||
<id>amarisoft_ue_1</id>
|
||||
<svr_id>oc-cn5g-00105</svr_id>
|
||||
<ping_args>-c 100 -i 0.1</ping_args>
|
||||
<ping_packetloss_threshold>1</ping_packetloss_threshold>
|
||||
<ping_rttavg_threshold>15</ping_rttavg_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (DL/250Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 250M -t 30 -R</iperf_args>
|
||||
<id>amarisoft_ue_1</id>
|
||||
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
|
||||
<iperf_profile>balanced</iperf_profile>
|
||||
<svr_id>oc-cn5g-00105</svr_id>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (UL/35Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 35M -t 30</iperf_args>
|
||||
<id>amarisoft_ue_1</id>
|
||||
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
|
||||
<iperf_profile>balanced</iperf_profile>
|
||||
<svr_id>oc-cn5g-00105</svr_id>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (DL/TCP)(30 sec)</desc>
|
||||
<iperf_args>-t 30 -R</iperf_args>
|
||||
<id>amarisoft_ue_1</id>
|
||||
<iperf_tcp_rate_target>40</iperf_tcp_rate_target>
|
||||
<svr_id>oc-cn5g-00105</svr_id>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (UL/TCP)(30 sec)</desc>
|
||||
<iperf_args>-t 30</iperf_args>
|
||||
<id>amarisoft_ue_1</id>
|
||||
<iperf_tcp_rate_target>10</iperf_tcp_rate_target>
|
||||
<svr_id>oc-cn5g-00105</svr_id>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Detach_UE</class>
|
||||
<always_exec>true</always_exec>
|
||||
<desc>Detach UE</desc>
|
||||
<id>amarisoft_ue_1</id>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Terminate_UE</class>
|
||||
<always_exec>true</always_exec>
|
||||
<desc>Terminate UE</desc>
|
||||
<id>amarisoft_00105_100MHz</id>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>IdleSleep</class>
|
||||
<desc>Sleep</desc>
|
||||
<idle_sleep_time_in_sec>5</idle_sleep_time_in_sec>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Undeploy_Object</class>
|
||||
<always_exec>true</always_exec>
|
||||
<desc>Undeploy gNB</desc>
|
||||
<node>cacofonix</node>
|
||||
<yaml_path>ci-scripts/yaml_files/sa_fhi_7.2_benetel550_2x2_100MHz_9b_mplane_gnb</yaml_path>
|
||||
<analysis>
|
||||
<services>oai-gnb=EndsWithBye</services>
|
||||
</analysis>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Clean_Test_Server_Images</class>
|
||||
<always_exec>true</always_exec>
|
||||
<desc>Clean Test Images on Test Server</desc>
|
||||
<node>cacofonix</node>
|
||||
<images>oai-gnb-fhi72</images>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>UndeployCoreNetwork</class>
|
||||
<always_exec>true</always_exec>
|
||||
<desc>Terminate 5G Core</desc>
|
||||
<cn_id>oc-cn5g-00105</cn_id>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
@@ -0,0 +1,149 @@
|
||||
<!-- SPDX-License-Identifier: LicenseRef-CSSL-1.0 -->
|
||||
|
||||
<testCaseList>
|
||||
<htmlTabRef>test-5g-fhi72-benetel-40Mhz-4x4-9b-mplane</htmlTabRef>
|
||||
<htmlTabName>40MHz 4x4 9b TDD SA Benetel M-plane</htmlTabName>
|
||||
<htmlTabIcon>tasks</htmlTabIcon>
|
||||
|
||||
<testCase>
|
||||
<class>DeployCoreNetwork</class>
|
||||
<desc>Initialize 5G Core</desc>
|
||||
<cn_id>oc-cn5g-00105</cn_id>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Custom_Script</class>
|
||||
<desc>Configure system for low-latency RT performance</desc>
|
||||
<node>cacofonix</node>
|
||||
<script>yaml_files/sa_fhi_7.2_benetel550_4x4_40MHz_9b_mplane_gnb/setup_config.sh</script>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Pull_Local_Registry</class>
|
||||
<desc>Pull Images from Local Registry</desc>
|
||||
<node>cacofonix</node>
|
||||
<images>oai-gnb-fhi72</images>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Initialize_UE</class>
|
||||
<desc>Initialize Amarisoft UE</desc>
|
||||
<id>amarisoft_00105_40MHz</id>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Create_Workspace</class>
|
||||
<desc>Create new Workspace for server 0</desc>
|
||||
<node>cacofonix</node>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Deploy_Object</class>
|
||||
<desc>Deploy gNB (TDD/Band78/100MHz/Benetel) in a container</desc>
|
||||
<node>cacofonix</node>
|
||||
<yaml_path>ci-scripts/yaml_files/sa_fhi_7.2_benetel550_4x4_40MHz_9b_mplane_gnb</yaml_path>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach UE</desc>
|
||||
<id>amarisoft_ue_1</id>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Ping</class>
|
||||
<desc>Ping: 100 pings in 10 sec</desc>
|
||||
<id>amarisoft_ue_1</id>
|
||||
<svr_id>oc-cn5g-00105</svr_id>
|
||||
<ping_args>-c 100 -i 0.1</ping_args>
|
||||
<ping_packetloss_threshold>1</ping_packetloss_threshold>
|
||||
<ping_rttavg_threshold>15</ping_rttavg_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (DL/130Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 130M -t 30 -R</iperf_args>
|
||||
<id>amarisoft_ue_1</id>
|
||||
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
|
||||
<iperf_profile>balanced</iperf_profile>
|
||||
<svr_id>oc-cn5g-00105</svr_id>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (UL/15Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 15M -t 30</iperf_args>
|
||||
<id>amarisoft_ue_1</id>
|
||||
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
|
||||
<iperf_profile>balanced</iperf_profile>
|
||||
<svr_id>oc-cn5g-00105</svr_id>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (DL/TCP)(30 sec)</desc>
|
||||
<iperf_args>-t 30 -R</iperf_args>
|
||||
<id>amarisoft_ue_1</id>
|
||||
<iperf_tcp_rate_target>40</iperf_tcp_rate_target>
|
||||
<svr_id>oc-cn5g-00105</svr_id>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (UL/TCP)(30 sec)</desc>
|
||||
<iperf_args>-t 30</iperf_args>
|
||||
<id>amarisoft_ue_1</id>
|
||||
<iperf_tcp_rate_target>10</iperf_tcp_rate_target>
|
||||
<svr_id>oc-cn5g-00105</svr_id>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Detach_UE</class>
|
||||
<always_exec>true</always_exec>
|
||||
<desc>Detach UE</desc>
|
||||
<id>amarisoft_ue_1</id>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Terminate_UE</class>
|
||||
<always_exec>true</always_exec>
|
||||
<desc>Terminate UE</desc>
|
||||
<id>amarisoft_00105_40MHz</id>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>IdleSleep</class>
|
||||
<desc>Sleep</desc>
|
||||
<idle_sleep_time_in_sec>5</idle_sleep_time_in_sec>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Undeploy_Object</class>
|
||||
<always_exec>true</always_exec>
|
||||
<desc>Undeploy gNB</desc>
|
||||
<node>cacofonix</node>
|
||||
<yaml_path>ci-scripts/yaml_files/sa_fhi_7.2_benetel550_4x4_40MHz_9b_mplane_gnb</yaml_path>
|
||||
<analysis>
|
||||
<services>oai-gnb=EndsWithBye</services>
|
||||
</analysis>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>Clean_Test_Server_Images</class>
|
||||
<always_exec>true</always_exec>
|
||||
<desc>Clean Test Images on Test Server</desc>
|
||||
<node>cacofonix</node>
|
||||
<images>oai-gnb-fhi72</images>
|
||||
</testCase>
|
||||
|
||||
<testCase>
|
||||
<class>UndeployCoreNetwork</class>
|
||||
<desc>Terminate 5G Core</desc>
|
||||
<always_exec>true</always_exec>
|
||||
<cn_id>oc-cn5g-00105</cn_id>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
@@ -43,6 +43,12 @@ nfs:
|
||||
n4:
|
||||
interface_name: eth0
|
||||
port: 8805
|
||||
pcf:
|
||||
host: oai-pcf
|
||||
sbi:
|
||||
port: 8080
|
||||
api_version: v1
|
||||
interface_name: eth0
|
||||
|
||||
upf:
|
||||
host: oai-upf
|
||||
@@ -77,6 +83,10 @@ database:
|
||||
snssais:
|
||||
- &embb_slice1
|
||||
sst: 1
|
||||
sd: "FFFFFF"
|
||||
- &embb_slice2
|
||||
sst: 1
|
||||
sd: "123456"
|
||||
|
||||
############## NF-specific configuration
|
||||
amf:
|
||||
@@ -103,6 +113,7 @@ amf:
|
||||
tac: 0x0001
|
||||
nssai:
|
||||
- *embb_slice1
|
||||
- *embb_slice2
|
||||
supported_integrity_algorithms:
|
||||
- "NIA0"
|
||||
- "NIA1"
|
||||
@@ -116,7 +127,7 @@ smf:
|
||||
ue_mtu: 1500
|
||||
support_features:
|
||||
use_local_subscription_info: yes # Use infos from local_subscription_info or from UDM
|
||||
use_local_pcc_rules: yes # Use infos from local_pcc_rules or from PCF
|
||||
use_local_pcc_rules: no # Enforce PCC rules from PCF
|
||||
upfs:
|
||||
- host: oai-upf
|
||||
port: 8805
|
||||
@@ -144,6 +155,9 @@ smf:
|
||||
- sNssai: *embb_slice1
|
||||
dnnSmfInfoList:
|
||||
- dnn: "oai"
|
||||
- sNssai: *embb_slice2
|
||||
dnnSmfInfoList:
|
||||
- dnn: "openairinterface"
|
||||
local_subscription_infos:
|
||||
- single_nssai: *embb_slice1
|
||||
dnn: "oai"
|
||||
@@ -151,6 +165,19 @@ smf:
|
||||
5qi: 9
|
||||
session_ambr_ul: "200Mbps"
|
||||
session_ambr_dl: "400Mbps"
|
||||
- single_nssai: *embb_slice2
|
||||
dnn: "openairinterface"
|
||||
qos_profile:
|
||||
5qi: 9
|
||||
session_ambr_ul: "200Mbps"
|
||||
session_ambr_dl: "400Mbps"
|
||||
|
||||
pcf:
|
||||
local_policy:
|
||||
policy_decisions_path: /openair-pcf/policies/policy_decisions
|
||||
pcc_rules_path: /openair-pcf/policies/pcc_rules
|
||||
traffic_rules_path: /openair-pcf/policies/traffic_rules
|
||||
qos_data_path: /openair-pcf/policies/qos_data
|
||||
|
||||
upf:
|
||||
support_features:
|
||||
@@ -162,9 +189,15 @@ upf:
|
||||
- sNssai: *embb_slice1
|
||||
dnnUpfInfoList:
|
||||
- dnn: "oai"
|
||||
- sNssai: *embb_slice2
|
||||
dnnUpfInfoList:
|
||||
- dnn: "openairinterface"
|
||||
|
||||
## DNN configuration
|
||||
dnns:
|
||||
- dnn: "oai"
|
||||
pdu_session_type: "IPV4"
|
||||
ipv4_subnet: "12.1.1.0/24"
|
||||
- dnn: "openairinterface"
|
||||
pdu_session_type: "IPV4"
|
||||
ipv4_subnet: "12.1.2.0/24"
|
||||
|
||||
@@ -45,9 +45,26 @@ services:
|
||||
- ../5g_rfsimulator/mini_nonrf_config.yaml:/openair-smf/etc/config.yaml
|
||||
depends_on:
|
||||
- oai-amf
|
||||
- oai-pcf
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.133
|
||||
oai-pcf:
|
||||
container_name: "rfsim5g-oai-pcf"
|
||||
image: oaisoftwarealliance/oai-pcf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
- ../5g_rfsimulator/mini_nonrf_config.yaml:/openair-pcf/etc/config.yaml
|
||||
- ./policies/policy_decisions:/openair-pcf/policies/policy_decisions
|
||||
- ./policies/pcc_rules:/openair-pcf/policies/pcc_rules
|
||||
- ./policies/traffic_rules:/openair-pcf/policies/traffic_rules
|
||||
- ./policies/qos_data:/openair-pcf/policies/qos_data
|
||||
depends_on:
|
||||
- oai-amf
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.142
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
@@ -78,7 +95,8 @@ services:
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
"ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity"
|
||||
"ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0;"\
|
||||
"ip route add 12.1.2.0/24 via 192.168.72.134 dev eth0; sleep infinity"
|
||||
depends_on:
|
||||
- oai-upf
|
||||
networks:
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
gbr-rule-default-3mbps:
|
||||
flowInfos:
|
||||
- flowDescription: permit out ip from any to assigned
|
||||
packetFilterUsage: true
|
||||
precedence: 10
|
||||
refQosData:
|
||||
- gbr-qos-default-3mbps
|
||||
|
||||
gbr-rule-52080:
|
||||
flowInfos:
|
||||
- flowDescription: permit out ip from any to assigned 52080
|
||||
packetFilterUsage: true
|
||||
- flowDescription: permit in ip from assigned 52080 to any
|
||||
packetFilterUsage: true
|
||||
precedence: 7
|
||||
refQosData:
|
||||
- gbr-qos-52080-20mbps
|
||||
|
||||
gbr-rule-52081:
|
||||
flowInfos:
|
||||
- flowDescription: permit out ip from any to assigned 52081
|
||||
packetFilterUsage: true
|
||||
- flowDescription: permit in ip from assigned 52081 to any
|
||||
packetFilterUsage: true
|
||||
precedence: 8
|
||||
refQosData:
|
||||
- gbr-qos-52081-10mbps
|
||||
@@ -0,0 +1,35 @@
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
decision_default:
|
||||
default: true
|
||||
pcc_rules:
|
||||
- gbr-rule-default-3mbps
|
||||
|
||||
decision_dnn_oai:
|
||||
dnn: oai
|
||||
pcc_rules:
|
||||
- gbr-rule-default-3mbps
|
||||
- gbr-rule-52080
|
||||
- gbr-rule-52081
|
||||
|
||||
decision_dnn_openairinterface:
|
||||
dnn: openairinterface
|
||||
pcc_rules:
|
||||
- gbr-rule-default-3mbps
|
||||
|
||||
decision_supi2:
|
||||
pcc_rules:
|
||||
- gbr-rule-default-3mbps
|
||||
supi_imsi: 001010000059450
|
||||
decision_supi3:
|
||||
pcc_rules:
|
||||
- gbr-rule-default-3mbps
|
||||
supi_imsi: 001010000059451
|
||||
decision_supi4:
|
||||
pcc_rules:
|
||||
- gbr-rule-default-3mbps
|
||||
supi_imsi: 001010000059452
|
||||
decision_supi5:
|
||||
pcc_rules:
|
||||
- gbr-rule-default-3mbps
|
||||
supi_imsi: 001010000059453
|
||||
@@ -0,0 +1,37 @@
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
gbr-qos-default-3mbps:
|
||||
5qi: 9
|
||||
maxbrUl: 1000 Mbps
|
||||
maxbrDl: 1000 Mbps
|
||||
gbrUl: 3 Mbps
|
||||
gbrDl: 3 Mbps
|
||||
arp:
|
||||
priorityLevel: 8
|
||||
preemptCap: NOT_PREEMPT
|
||||
preemptVuln: NOT_PREEMPTABLE
|
||||
priorityLevel: 50
|
||||
|
||||
gbr-qos-52080-20mbps:
|
||||
5qi: 67
|
||||
maxbrUl: 1000 Mbps
|
||||
maxbrDl: 1000 Mbps
|
||||
gbrUl: 20 Mbps
|
||||
gbrDl: 20 Mbps
|
||||
arp:
|
||||
priorityLevel: 8
|
||||
preemptCap: NOT_PREEMPT
|
||||
preemptVuln: NOT_PREEMPTABLE
|
||||
priorityLevel: 30
|
||||
|
||||
gbr-qos-52081-10mbps:
|
||||
5qi: 69
|
||||
maxbrUl: 1000 Mbps
|
||||
maxbrDl: 1000 Mbps
|
||||
gbrUl: 10 Mbps
|
||||
gbrDl: 10 Mbps
|
||||
arp:
|
||||
priorityLevel: 8
|
||||
preemptCap: NOT_PREEMPT
|
||||
preemptVuln: NOT_PREEMPTABLE
|
||||
priorityLevel: 40
|
||||
@@ -3,7 +3,7 @@
|
||||
services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
image: mysql:9.6
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
@@ -26,7 +26,7 @@ services:
|
||||
ipv4_address: 192.168.71.131
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
volumes:
|
||||
@@ -38,7 +38,7 @@ services:
|
||||
ipv4_address: 192.168.71.132
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -50,7 +50,7 @@ services:
|
||||
ipv4_address: 192.168.71.133
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
@@ -74,7 +74,7 @@ services:
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
image: mysql:9.6
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
@@ -26,7 +26,7 @@ services:
|
||||
ipv4_address: 192.168.71.131
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
volumes:
|
||||
@@ -38,7 +38,7 @@ services:
|
||||
ipv4_address: 192.168.71.132
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -50,7 +50,7 @@ services:
|
||||
ipv4_address: 192.168.71.133
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
@@ -74,7 +74,7 @@ services:
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
services:
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:8.0
|
||||
image: mysql:9.6
|
||||
init: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
@@ -26,7 +26,7 @@ services:
|
||||
ipv4_address: 192.168.71.131
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
volumes:
|
||||
@@ -38,7 +38,7 @@ services:
|
||||
ipv4_address: 192.168.71.132
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
@@ -50,7 +50,7 @@ services:
|
||||
ipv4_address: 192.168.71.133
|
||||
oai-upf:
|
||||
container_name: "rfsim5g-oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:v2.1.10
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
init: true
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
@@ -74,7 +74,7 @@ services:
|
||||
oai-ext-dn:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:focal
|
||||
image: oaisoftwarealliance/trf-gen-cn5g:latest
|
||||
init: true
|
||||
entrypoint: /bin/bash -c \
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
services:
|
||||
dpdk-init:
|
||||
image: docker.io/library/oai-dpdk-init:latest
|
||||
network_mode: host
|
||||
container_name: dpdk-init
|
||||
entrypoint: "/tmp/setup_sriov.sh"
|
||||
privileged: true
|
||||
devices:
|
||||
- /dev/vfio:/dev/vfio/
|
||||
volumes:
|
||||
- ./setup_sriov_benetel.sh:/tmp/setup_sriov.sh
|
||||
- /lib/modules:/lib/modules
|
||||
- /usr/lib/modules:/usr/lib/modules
|
||||
oai-gnb:
|
||||
image: ${REGISTRY-oaisoftwarealliance/}oai-gnb-fhi72:${TAG:-develop}
|
||||
privileged: true
|
||||
network_mode: "host"
|
||||
container_name: oai-gnb
|
||||
environment:
|
||||
TZ: Europe/Paris
|
||||
USE_ADDITIONAL_OPTIONS: --thread-pool 7,8,9,10,11,12 --device.name oran_fhlib_5g_mplane --log_config.global_log_options level,nocolor,time,line_num,function
|
||||
devices:
|
||||
- /dev/vfio:/dev/vfio/
|
||||
volumes:
|
||||
- ../../conf_files/gnb.sa.band78.273prb.fhi72.2x2-benetel550-9b-mplane.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
- /dev/hugepages:/dev/hugepages
|
||||
- /home/oaicicd/.ssh/id_rsa.pub:/opt/oai-gnb/etc/id_rsa.pub
|
||||
- /home/oaicicd/.ssh/id_rsa:/opt/oai-gnb/etc/id_rsa
|
||||
# Please change these values based on your system
|
||||
cpuset: "0-12"
|
||||
depends_on:
|
||||
dpdk-init:
|
||||
condition: service_completed_successfully
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/opt/oai-gnb/bin/check-prach-io.sh"
|
||||
start_period: 60s
|
||||
start_interval: 500ms
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
set -e
|
||||
sudo cpupower idle-set -E > /dev/null
|
||||
sudo sysctl kernel.sched_rt_runtime_us=950000
|
||||
sudo sysctl kernel.timer_migration=1
|
||||
exit 0
|
||||
@@ -0,0 +1,6 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
set -e
|
||||
sudo cpupower idle-set -D 0 > /dev/null
|
||||
sudo sysctl kernel.sched_rt_runtime_us=-1
|
||||
sudo sysctl kernel.timer_migration=0
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
set -eu
|
||||
|
||||
pci_addr()
|
||||
{
|
||||
PF_IF=$1
|
||||
VF_INDEX=$2
|
||||
SYSFS_PATH="/sys/class/net/${PF_IF}/device/virtfn${VF_INDEX}"
|
||||
|
||||
if [ ! -e "$SYSFS_PATH" ]; then
|
||||
echo "VF $VF_INDEX not found for interface $PF_IF"
|
||||
exit 1
|
||||
fi
|
||||
PCI_ADDR=$(basename "$(readlink "$SYSFS_PATH")")
|
||||
echo "$PCI_ADDR"
|
||||
}
|
||||
IF_NAME=ens7f1
|
||||
## O-DU C Plane MAC ADDR and VLAN
|
||||
C_U_PLANE_MAC_ADD=00:11:22:33:44:66
|
||||
C_U_PLANE_VLAN=3
|
||||
MTU=9000
|
||||
DPDK_DEVBIND_PREFIX=/usr/local/bin
|
||||
NUM_VFs=1
|
||||
ethtool -G $IF_NAME rx 8160 tx 8160
|
||||
sh -c "echo 0 > /sys/class/net/$IF_NAME/device/sriov_numvfs"
|
||||
sh -c "echo $NUM_VFs > /sys/class/net/$IF_NAME/device/sriov_numvfs"
|
||||
C_U_PLANE_PCI=$(pci_addr $IF_NAME 0)
|
||||
# this next 2 lines is for C/U planes
|
||||
ip link set $IF_NAME vf 0 mac $C_U_PLANE_MAC_ADD vlan $C_U_PLANE_VLAN spoofchk off mtu $MTU
|
||||
sleep 1
|
||||
modprobe iavf
|
||||
${DPDK_DEVBIND_PREFIX}/dpdk-devbind.py --unbind $C_U_PLANE_PCI
|
||||
modprobe vfio-pci
|
||||
${DPDK_DEVBIND_PREFIX}/dpdk-devbind.py --bind vfio-pci $C_U_PLANE_PCI
|
||||
echo "Successfully configured C-PLANE and U-PLANE:
|
||||
- C-PLANE MAC: $C_U_PLANE_MAC_ADD, VLAN: $C_U_PLANE_VLAN, PCI: $C_U_PLANE_PCI"
|
||||
exit 0
|
||||
@@ -0,0 +1,42 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
services:
|
||||
dpdk-init:
|
||||
image: docker.io/library/oai-dpdk-init:latest
|
||||
network_mode: host
|
||||
container_name: dpdk-init
|
||||
entrypoint: "/tmp/setup_sriov.sh"
|
||||
privileged: true
|
||||
devices:
|
||||
- /dev/vfio:/dev/vfio/
|
||||
volumes:
|
||||
- ./setup_sriov_benetel.sh:/tmp/setup_sriov.sh
|
||||
- /lib/modules:/lib/modules
|
||||
- /usr/lib/modules:/usr/lib/modules
|
||||
oai-gnb:
|
||||
image: ${REGISTRY-oaisoftwarealliance/}oai-gnb-fhi72:${TAG:-develop}
|
||||
privileged: true
|
||||
network_mode: "host"
|
||||
container_name: oai-gnb
|
||||
environment:
|
||||
TZ: Europe/Paris
|
||||
USE_ADDITIONAL_OPTIONS: --thread-pool 7,8,9,10,11,12 --device.name oran_fhlib_5g_mplane --log_config.global_log_options level,nocolor,time,line_num,function
|
||||
devices:
|
||||
- /dev/vfio:/dev/vfio/
|
||||
volumes:
|
||||
- ../../conf_files/gnb.sa.band78.106prb.fhi72.4x4-benetel550-9b-mplane.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
- /dev/hugepages:/dev/hugepages
|
||||
- /home/oaicicd/.ssh/id_rsa.pub:/opt/oai-gnb/etc/id_rsa.pub
|
||||
- /home/oaicicd/.ssh/id_rsa:/opt/oai-gnb/etc/id_rsa
|
||||
# Please change these values based on your system
|
||||
cpuset: "0-12"
|
||||
depends_on:
|
||||
dpdk-init:
|
||||
condition: service_completed_successfully
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/opt/oai-gnb/bin/check-prach-io.sh"
|
||||
start_period: 60s
|
||||
start_interval: 500ms
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
set -e
|
||||
sudo cpupower idle-set -E > /dev/null
|
||||
sudo sysctl kernel.sched_rt_runtime_us=950000
|
||||
sudo sysctl kernel.timer_migration=1
|
||||
exit 0
|
||||
@@ -0,0 +1,6 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
set -e
|
||||
sudo cpupower idle-set -D 0 > /dev/null
|
||||
sudo sysctl kernel.sched_rt_runtime_us=-1
|
||||
sudo sysctl kernel.timer_migration=0
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
set -eu
|
||||
|
||||
pci_addr()
|
||||
{
|
||||
PF_IF=$1
|
||||
VF_INDEX=$2
|
||||
SYSFS_PATH="/sys/class/net/${PF_IF}/device/virtfn${VF_INDEX}"
|
||||
|
||||
if [ ! -e "$SYSFS_PATH" ]; then
|
||||
echo "VF $VF_INDEX not found for interface $PF_IF"
|
||||
exit 1
|
||||
fi
|
||||
PCI_ADDR=$(basename "$(readlink "$SYSFS_PATH")")
|
||||
echo "$PCI_ADDR"
|
||||
}
|
||||
IF_NAME=ens7f1
|
||||
## O-DU C Plane MAC ADDR and VLAN
|
||||
C_U_PLANE_MAC_ADD=00:11:22:33:44:66
|
||||
C_U_PLANE_VLAN=3
|
||||
MTU=9000
|
||||
DPDK_DEVBIND_PREFIX=/usr/local/bin
|
||||
NUM_VFs=1
|
||||
ethtool -G $IF_NAME rx 8160 tx 8160
|
||||
sh -c "echo 0 > /sys/class/net/$IF_NAME/device/sriov_numvfs"
|
||||
sh -c "echo $NUM_VFs > /sys/class/net/$IF_NAME/device/sriov_numvfs"
|
||||
C_U_PLANE_PCI=$(pci_addr $IF_NAME 0)
|
||||
# this next 2 lines is for C/U planes
|
||||
ip link set $IF_NAME vf 0 mac $C_U_PLANE_MAC_ADD vlan $C_U_PLANE_VLAN spoofchk off mtu $MTU
|
||||
sleep 1
|
||||
modprobe iavf
|
||||
${DPDK_DEVBIND_PREFIX}/dpdk-devbind.py --unbind $C_U_PLANE_PCI
|
||||
modprobe vfio-pci
|
||||
${DPDK_DEVBIND_PREFIX}/dpdk-devbind.py --bind vfio-pci $C_U_PLANE_PCI
|
||||
echo "Successfully configured C-PLANE and U-PLANE:
|
||||
- C-PLANE MAC: $C_U_PLANE_MAC_ADD, VLAN: $C_U_PLANE_VLAN, PCI: $C_U_PLANE_PCI"
|
||||
exit 0
|
||||
@@ -18,7 +18,7 @@ HWs=""
|
||||
BUILD_DIR=ran_build
|
||||
CMAKE_BUILD_TYPE="RelWithDebInfo"
|
||||
CMAKE_CMD="$CMAKE"
|
||||
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope ldpc_aal ldpc_xdma websrv oai_iqplayer imscope imscope_record"
|
||||
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope ldpc_aal websrv oai_iqplayer imscope imscope_record"
|
||||
TARGET_LIST=""
|
||||
BUILD_TOOL_OPT="-j$(nproc)"
|
||||
|
||||
@@ -43,8 +43,6 @@ Options:
|
||||
Sets build directory (will be <oai-root>/cmake_targets/<build-dir>/build)
|
||||
--build-e2
|
||||
Enable the the E2 Agent
|
||||
--build-e3
|
||||
Enable the the E3 Agent
|
||||
-I | --install-external-packages
|
||||
Installs required packages such as LibXML, asn1.1 compiler, ...
|
||||
This option will require root password
|
||||
@@ -145,10 +143,6 @@ function main() {
|
||||
CMAKE_CMD="$CMAKE_CMD -DE2_AGENT=ON"
|
||||
shift
|
||||
;;
|
||||
--build-e3 )
|
||||
CMAKE_CMD="$CMAKE_CMD -DE3_AGENT=ON"
|
||||
shift
|
||||
;;
|
||||
-I | --install-external-packages)
|
||||
INSTALL_EXTERNAL=1
|
||||
echo_info "Will install external packages"
|
||||
|
||||
@@ -96,6 +96,7 @@ check_supported_distribution() {
|
||||
"rhel9.5") return 0 ;;
|
||||
"rhel9.6") return 0 ;;
|
||||
"rhel9.7") return 0 ;;
|
||||
"rhel9.8") return 0 ;;
|
||||
"centos9") return 0 ;; # CentOS stream
|
||||
"rocky9.1") return 0 ;;
|
||||
"rocky9.2") return 0 ;;
|
||||
@@ -104,6 +105,7 @@ check_supported_distribution() {
|
||||
"rocky9.5") return 0 ;;
|
||||
"rocky9.6") return 0 ;;
|
||||
"rocky9.7") return 0 ;;
|
||||
"rocky9.8") return 0 ;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
@@ -36,25 +36,23 @@ typedef enum {
|
||||
|
||||
typedef enum { NON_DYNAMIC, DYNAMIC } fiveQI_t;
|
||||
|
||||
/* QoS Priority Level */
|
||||
typedef enum {
|
||||
QOS_PRIORITY_SPARE = 0,
|
||||
QOS_PRIORITY_HIGHEST,
|
||||
QOS_PRIORITY_2,
|
||||
QOS_PRIORITY_3,
|
||||
QOS_PRIORITY_4,
|
||||
QOS_PRIORITY_5,
|
||||
QOS_PRIORITY_6,
|
||||
QOS_PRIORITY_7,
|
||||
QOS_PRIORITY_8,
|
||||
QOS_PRIORITY_9,
|
||||
QOS_PRIORITY_10,
|
||||
QOS_PRIORITY_11,
|
||||
QOS_PRIORITY_12,
|
||||
QOS_PRIORITY_13,
|
||||
QOS_PRIORITY_LOWEST,
|
||||
QOS_NO_PRIORITY
|
||||
} qos_priority_t;
|
||||
/* 5QI (5G QoS Identifier) - 3GPP TS 23.501 §5.7.2.1
|
||||
* Range: 0..255
|
||||
* - Standardized 5QI values: have one-to-one mapping to standardized 5G QoS characteristics (Table 5.7.4-1)
|
||||
* - Pre-configured 5QI values: pre-configured in the AN
|
||||
* - Dynamically assigned 5QI values: require signaling of QoS characteristics as part of QoS profile */
|
||||
#define MIN_FIVEQI 0
|
||||
#define MAX_STANDARDIZED_FIVEQI 90
|
||||
#define MAX_FIVEQI 255
|
||||
|
||||
/* ARP Priority Level - 3GPP TS 23.501 §5.7.2.2
|
||||
* The ARP priority level defines the relative importance of a QoS Flow.
|
||||
* Range: 1 to 15, with 1 as the highest priority.
|
||||
* ARP priority levels 1-8: authorized by serving network (prioritized treatment)
|
||||
* ARP priority levels 9-15: authorized by home network (roaming scenarios) */
|
||||
typedef uint8_t qos_arp_priority_level_t;
|
||||
#define MIN_QOS_ARP_PRIORITY_LEVEL 1 // highest priority
|
||||
#define MAX_QOS_ARP_PRIORITY_LEVEL 15 // lowest priority
|
||||
|
||||
/* Pre-emption Capability */
|
||||
typedef enum {
|
||||
@@ -70,19 +68,101 @@ typedef enum {
|
||||
PEV_MAX,
|
||||
} qos_pev_t;
|
||||
|
||||
/* Allocation Retention Priority */
|
||||
/* Allocation and Retention Priority (ARP) - 3GPP TS 23.501 §5.7.2.2
|
||||
* Contains information about priority level, pre-emption capability and vulnerability.
|
||||
* Used for admission control of GBR traffic and pre-emption decisions. */
|
||||
typedef struct {
|
||||
qos_priority_t priority_level;
|
||||
// ARP priority level (1-15, 1 = highest)
|
||||
qos_arp_priority_level_t priority_level;
|
||||
qos_pec_t pre_emp_capability;
|
||||
qos_pev_t pre_emp_vulnerability;
|
||||
} qos_arp_t;
|
||||
|
||||
/* QoS Priority Level - 3GPP TS 23.501 §5.7.3.3
|
||||
* The Priority Level associated with 5G QoS characteristics indicates a priority
|
||||
* in scheduling resources among QoS Flows. The lowest Priority Level value
|
||||
* corresponds to the highest priority.
|
||||
* Range: 1 to 127, with 1 as the highest priority and 127 as the lowest priority.
|
||||
* Used for scheduling resources among QoS Flows (different from ARP priority level
|
||||
* which is used for admission control/preemption).
|
||||
* Every standardized 5QI is associated with a default Priority Level value. */
|
||||
typedef uint8_t qos_priority_level_t;
|
||||
#define MIN_QOS_PRIORITY_LEVEL 1 // highest priority
|
||||
#define MAX_QOS_PRIORITY_LEVEL 127 // lowest priority
|
||||
|
||||
/* Packet Delay Budget (PDB) - 3GPP TS 23.501 §5.7.3.4
|
||||
* Upper bound for packet delay between UE and UPF N6 termination point (0..1023 ms).
|
||||
* Used for scheduling and link layer configuration (e.g. HARQ target operating points).
|
||||
* For Delay-critical GBR flows, packets delayed more than PDB are counted as lost. */
|
||||
#define MIN_PACKET_DELAY_BUDGET 0
|
||||
#define MAX_PACKET_DELAY_BUDGET 1023
|
||||
|
||||
/* Packet Error Rate (PER) - 3GPP TS 23.501 §5.7.3.5
|
||||
* Upper bound for rate of non-congestion related packet losses (0..9 for scalar/exponent).
|
||||
* Used for link layer protocol configuration (e.g. RLC, HARQ).
|
||||
* PER = Scalar * 10^(-Exponent) */
|
||||
#define MIN_PACKET_ERROR_RATE_SCALAR 0
|
||||
#define MAX_PACKET_ERROR_RATE_SCALAR 9
|
||||
#define MIN_PACKET_ERROR_RATE_EXPONENT 0
|
||||
#define MAX_PACKET_ERROR_RATE_EXPONENT 9
|
||||
|
||||
typedef struct {
|
||||
// Packet Error Rate Scalar (0..9)
|
||||
uint8_t scalar;
|
||||
// Packet Error Rate Exponent (0..9)
|
||||
uint8_t exponent;
|
||||
} qos_per_t;
|
||||
|
||||
/** QoS Characteristics for a standardized or
|
||||
* pre-configured 5QI for downlink and uplink*/
|
||||
typedef struct {
|
||||
uint16_t fiveQI;
|
||||
qos_priority_level_t *qos_priority;
|
||||
} non_dynamic_5qi_t;
|
||||
|
||||
/** QoS Characteristics for a Non-standardised or
|
||||
* not pre-configured 5QI for downlink and uplink. */
|
||||
typedef struct {
|
||||
uint16_t *fiveQI;
|
||||
qos_priority_level_t qos_priority;
|
||||
// Packet Delay Budget (0..1023 ms)
|
||||
int packet_delay_budget;
|
||||
// Packet Error Rate (0..9 for scalar/exponent)
|
||||
qos_per_t per;
|
||||
} dynamic_5qi_t;
|
||||
|
||||
/* Bit Rate (kbps) - 3GPP TS 38.413 */
|
||||
typedef struct qos_bitrate_s {
|
||||
// Guaranteed Flow Bit Rate (GFBR) (kbps)
|
||||
uint64_t guaranteedFlowBitRate;
|
||||
// Maximum Flow Bit Rate (MFBR) (kbps)
|
||||
uint64_t maximumFlowBitRate;
|
||||
} qos_bitrate_t;
|
||||
|
||||
/* GBR QoS Flow Information - 3GPP TS 23.501 §5.7.1.2, TS 38.413 §9.3.1.19
|
||||
* Present only for GBR QoS flows (5QI < 5 for NonDynamic5QI, or Dynamic5QI with GBR).
|
||||
* For GBR QoS Flow only, the QoS profile SHALL include for DL and UL:
|
||||
* - Guaranteed Flow Bit Rate (GFBR)
|
||||
* - Maximum Flow Bit Rate (MFBR) */
|
||||
typedef struct gbr_qos_flow_information_s {
|
||||
// Downlink bit rates (kbps)
|
||||
qos_bitrate_t dl;
|
||||
// Uplink bit rates (kbps)
|
||||
qos_bitrate_t ul;
|
||||
} gbr_qos_flow_information_t;
|
||||
|
||||
typedef struct pdusession_level_qos_parameter_s {
|
||||
uint8_t qfi;
|
||||
uint64_t fiveQI;
|
||||
uint64_t qos_priority;
|
||||
// QoS Characteristics
|
||||
fiveQI_t fiveQI_type;
|
||||
union {
|
||||
non_dynamic_5qi_t non_dynamic;
|
||||
dynamic_5qi_t dynamic;
|
||||
} qos_characteristics;
|
||||
// NG-RAN Allocation and Retention Priority
|
||||
qos_arp_t arp;
|
||||
/* GBR QoS Flow Information (optional - only for GBR flows) */
|
||||
gbr_qos_flow_information_t *gbr_qos_flow_information;
|
||||
} pdusession_level_qos_parameter_t;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -126,37 +126,97 @@ int config_getlist(configmodule_interface_t *cfg, paramlist_def_t *ParamList, pa
|
||||
}
|
||||
const int ret = cfg->getlist(cfg, ParamList, params, numparams, prefix);
|
||||
|
||||
if (ret >= 0 && params) {
|
||||
char *newprefix;
|
||||
|
||||
if (prefix) {
|
||||
int rc = asprintf(&newprefix, "%s.%s", prefix, ParamList->listname);
|
||||
|
||||
if (rc < 0) newprefix = NULL;
|
||||
} else {
|
||||
newprefix = ParamList->listname;
|
||||
}
|
||||
|
||||
char cfgpath[MAX_OPTNAME_SIZE*2 + 6]; /* prefix.listname.[listindex] */
|
||||
|
||||
for (int i = 0; i < ParamList->numelt; ++i) {
|
||||
// TODO config_process_cmdline?
|
||||
sprintf(cfgpath, "%s.[%i]", newprefix, i);
|
||||
config_process_cmdline(cfg, ParamList->paramarray[i], numparams, cfgpath);
|
||||
if (cfg->rtflags & CONFIG_SAVERUNCFG) {
|
||||
cfg->set(ParamList->paramarray[i], numparams, cfgpath);
|
||||
}
|
||||
config_execcheck(cfg, ParamList->paramarray[i], numparams, cfgpath);
|
||||
}
|
||||
|
||||
if (prefix)
|
||||
free(newprefix);
|
||||
/* build newprefix OUTSIDE the params check so we can use it below too */
|
||||
char *newprefix = NULL;
|
||||
if (prefix) {
|
||||
int rc = asprintf(&newprefix, "%s.%s", prefix, ParamList->listname);
|
||||
if (rc < 0)
|
||||
newprefix = NULL;
|
||||
} else {
|
||||
newprefix = ParamList->listname;
|
||||
}
|
||||
|
||||
return ret;
|
||||
char cfgpath[MAX_OPTNAME_SIZE * 2 + 6]; /* prefix.listname.[listindex] */
|
||||
|
||||
if (ret >= 0 && params) {
|
||||
for (int i = 0; i < ParamList->numelt; ++i) {
|
||||
sprintf(cfgpath, "%s.[%i]", newprefix, i);
|
||||
config_process_cmdline(cfg, ParamList->paramarray[i], numparams, cfgpath);
|
||||
if (cfg->rtflags & CONFIG_SAVERUNCFG)
|
||||
cfg->set(ParamList->paramarray[i], numparams, cfgpath);
|
||||
config_execcheck(cfg, ParamList->paramarray[i], numparams, cfgpath);
|
||||
}
|
||||
}
|
||||
|
||||
if (params && newprefix && (ret >= 0 || ParamList->numelt == 0)) {
|
||||
sprintf(cfgpath, "%s", newprefix);
|
||||
char searchstr[MAX_OPTNAME_SIZE * 2 + 10];
|
||||
snprintf(searchstr, sizeof(searchstr), "--%s.", cfgpath);
|
||||
char *endptr;
|
||||
int valid_idx = ParamList->numelt;
|
||||
|
||||
for (int i = 1; i < cfg->argc; i++) {
|
||||
char *res = strstr(cfg->argv[i], searchstr);
|
||||
if (res != NULL) {
|
||||
char *bracket = strchr(res + strlen(searchstr), '[');
|
||||
bracket++;
|
||||
long num = strtol(bracket, &endptr, 10);
|
||||
if (num < valid_idx)
|
||||
continue;
|
||||
if (valid_idx == num) {
|
||||
valid_idx++;
|
||||
} else if (num > valid_idx) {
|
||||
LOG_E(HW, "Out of Order Element Creation\n index: %s, valid_idx: %d, num: %ld\n", cfg->argv[i], valid_idx, num);
|
||||
return -1;
|
||||
} else {
|
||||
LOG_E(HW, "[CONFIG] Invalid Configuration\n index: %s, valid_idx: %d, num: %ld\n", cfg->argv[i], valid_idx, num);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (ParamList->numelt < valid_idx) {
|
||||
int new_idx = ParamList->numelt;
|
||||
sprintf(cfgpath, "%s.[%i]", newprefix, new_idx);
|
||||
paramdef_t **old = ParamList->paramarray;
|
||||
ParamList->paramarray = config_allocate_new(cfg, (new_idx + 1) * sizeof(paramdef_t *), true);
|
||||
memcpy(ParamList->paramarray, old, new_idx * sizeof(paramdef_t *));
|
||||
ParamList->paramarray[new_idx] = config_allocate_new(cfg, numparams * sizeof(paramdef_t), true);
|
||||
memcpy(ParamList->paramarray[new_idx], params, sizeof(paramdef_t) * numparams);
|
||||
|
||||
for (int p = 0; p < numparams; p++) {
|
||||
ParamList->paramarray[new_idx][p].voidptr = NULL;
|
||||
}
|
||||
|
||||
ParamList->numelt++;
|
||||
fprintf(stderr, "[CONFIG] Created new array parameter %s.[%d]\n", newprefix, new_idx);
|
||||
config_process_cmdline(cfg, ParamList->paramarray[new_idx], numparams, cfgpath);
|
||||
|
||||
for (int p = 0; p < numparams; p++) {
|
||||
paramdef_t *pd = &ParamList->paramarray[new_idx][p];
|
||||
if (pd->paramflags & PARAMFLAG_PARAMSET)
|
||||
continue;
|
||||
config_common_getdefault(cfg, pd, cfgpath);
|
||||
}
|
||||
|
||||
config_execcheck(cfg, ParamList->paramarray[new_idx], numparams, cfgpath);
|
||||
|
||||
for (int p = 0; p < numparams; p++) {
|
||||
if (ParamList->paramarray[new_idx][p].paramflags & PARAMFLAG_PARAMSET)
|
||||
fprintf(stderr, "[CONFIG] New parameter set: %s\n", ParamList->paramarray[new_idx][p].optname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (prefix)
|
||||
free(newprefix);
|
||||
|
||||
/* when added parameters via CLI, return numelt instead of original ret */
|
||||
return (ParamList->numelt > 0) ? (int)ParamList->numelt : ret;
|
||||
}
|
||||
|
||||
int config_isparamset(paramdef_t *params,int paramidx) {
|
||||
int config_isparamset(paramdef_t *params, int paramidx)
|
||||
{
|
||||
if ((params[paramidx].paramflags & PARAMFLAG_PARAMSET) != 0) {
|
||||
return 1;
|
||||
} else {
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#define NB_RB_MAX (11 + 3) /* LTE_maxDRB from LTE_asn_constant.h + 3 SRBs */
|
||||
#define NR_NB_RB_MAX (29 + 3) /* NR_maxDRB from NR_asn_constant.hm + 3 SRBs */
|
||||
|
||||
#define NGAP_MAX_PDU_SESSION (256) /* As defined in TS 38.413 9.2.1.1 Range Bound for PDU Sessions. */
|
||||
#define NR_MAX_NB_PDU_SESSIONS (256)
|
||||
|
||||
#define MAX_DRBS_PER_UE (32) /* Maximum number of Data Radio Bearers per UE
|
||||
* defined for NGAP in TS 38.413 - maxnoofDRBs */
|
||||
|
||||
@@ -11,7 +11,7 @@ LOG_D(<component>,<format>,<argument>,...)
|
||||
LOG_T(<component>,<format>,<argument>,...)
|
||||
)
|
||||
```
|
||||
these macros are used in place of the printf C function. The additionnal ***component*** parameter identifies the functional module which generates the message. At run time, the message will only be printed if the configured log level for the component is greater or equal than the macro level used in the code.
|
||||
these macros are used in place of the printf C function. The additionnal ***component*** parameter identifies the functionnal module which generates the message. At run time, the message will only be printed if the configured log level for the component is greater or equal than the macro level used in the code.
|
||||
|
||||
| macro | level letter | level value | level name |
|
||||
|:---------|:---------------|:---------------|----------------:|
|
||||
|
||||
@@ -155,7 +155,6 @@ static const char *const flag_name[] = {FOREACH_FLAG(FLAG_TEXT) ""};
|
||||
COMP_DEF(NFAPI_PNF, log) \
|
||||
COMP_DEF(ITTI, log) \
|
||||
COMP_DEF(UTIL, log) \
|
||||
COMP_DEF(E3AP, log) \
|
||||
COMP_DEF(MAX_LOG_PREDEF_COMPONENTS, )
|
||||
|
||||
#define COMP_ENUM(comp, file_extension) comp,
|
||||
|
||||
@@ -159,10 +159,6 @@ ID = GNB_PHY_UL_SRS_TOA_NS
|
||||
DESC = gNB ToA estimate from SRS (in ns)
|
||||
GROUP = ALL:PHY:GNB
|
||||
FORMAT = int,gNB_ID : int,rnti : int,frame : int,subframe : buffer,toa_ns
|
||||
ID = GNB_PHY_UL_FREQ_SENSING_SYMBOL
|
||||
DESC = gNodeB output data in the freq domain for sensing symbols
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB
|
||||
FORMAT = int,gNB_ID : int,frame : int,slot : int,antenna : buffer,rxdata
|
||||
|
||||
#MAC logs
|
||||
ID = ENB_MAC_UE_DL_SDU
|
||||
@@ -430,27 +426,6 @@ ID = LEGACY_MAC_TRACE
|
||||
GROUP = ALL:LEGACY_MAC:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
ID = LEGACY_E3AP_INFO
|
||||
DESC = E3AP legacy logs - info level
|
||||
GROUP = ALL:LEGACY_E3AP:LEGACY_GROUP_INFO:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_E3AP_ERROR
|
||||
DESC = E3AP legacy logs - error level
|
||||
GROUP = ALL:LEGACY_E3AP:LEGACY_GROUP_ERROR:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_E3AP_WARNING
|
||||
DESC = E3AP legacy logs - warning level
|
||||
GROUP = ALL:LEGACY_E3AP:LEGACY_GROUP_WARNING:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_E3AP_DEBUG
|
||||
DESC = E3AP legacy logs - debug level
|
||||
GROUP = ALL:LEGACY_E3AP:LEGACY_GROUP_DEBUG:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_E3AP_TRACE
|
||||
DESC = E3AP legacy logs - trace level
|
||||
GROUP = ALL:LEGACY_E3AP:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
ID = LEGACY_NR_MAC_INFO
|
||||
DESC = NR_MAC legacy logs - info level
|
||||
GROUP = ALL:LEGACY_NR_MAC:LEGACY_GROUP_INFO:LEGACY
|
||||
@@ -1479,7 +1454,7 @@ ID = UE_PHY_PDCCH_ENERGY
|
||||
ID = UE_PHY_PDSCH_IQ
|
||||
DESC = UE PDSCH received IQ data
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,nb_rb : int,N_RB_UL : int,symbols_per_tti : buffer,pdsch_comp
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,nb_rb : int,N_RB_DL : int,symbols_per_tti : buffer,pdsch_comp
|
||||
ID = UE_PHY_PDSCH_ENERGY
|
||||
DESC = UE PDSCH 1 energy and threshold
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
|
||||
|
||||
@@ -229,8 +229,7 @@ static void ue_main_gui(ue_gui *e, gui *g, event_handler *h, void *database,
|
||||
e->pdsch_iq_ue_xy_plot = w;
|
||||
widget_add_child(g, line, w, -1);
|
||||
xy_plot_set_range(g, w, -500, 500, -500, 500);
|
||||
l = new_iqlog(h, database, "UE_PHY_PDSCH_IQ", "nb_rb",
|
||||
"N_RB_UL", "symbols_per_tti", "pusch_comp");
|
||||
l = new_iqlog(h, database, "UE_PHY_PDSCH_IQ", "nb_rb", "N_RB_DL", "symbols_per_tti", "pdsch_comp");
|
||||
v = new_view_xy(100*12*14,10,g,w,new_color(g,"#000"),XY_FORCED_MODE);
|
||||
logger_add_view(l, v);
|
||||
e->pdsch_iq_ue_logger = l;
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <math.h>
|
||||
#include <sys/un.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
void new_thread(void *(*f)(void *), void *data) {
|
||||
pthread_t t;
|
||||
@@ -235,117 +233,6 @@ again:
|
||||
return s;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/* unix domain socket */
|
||||
/****************************************************************************/
|
||||
|
||||
int try_connect_to_uds(char *path)
|
||||
{
|
||||
int s;
|
||||
struct sockaddr_un a;
|
||||
s = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
|
||||
if (s == -1) {
|
||||
perror("socket");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
memset(&a, 0, sizeof(struct sockaddr_un));
|
||||
a.sun_family = AF_UNIX;
|
||||
strncpy(a.sun_path, path, sizeof(a.sun_path) - 1);
|
||||
|
||||
if (connect(s, (struct sockaddr *)&a, sizeof(a)) == -1) {
|
||||
perror("connect");
|
||||
close(s);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
int connect_to_uds(char *path)
|
||||
{
|
||||
int s;
|
||||
printf("connecting to %s\n", path);
|
||||
again:
|
||||
s = try_connect_to_uds(path);
|
||||
|
||||
if (s == -1) {
|
||||
perror("trying again in 1s\n");
|
||||
sleep(1);
|
||||
goto again;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
int create_listen_uds_socket(char *path)
|
||||
{
|
||||
struct sockaddr_un a;
|
||||
int s;
|
||||
int v;
|
||||
s = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
|
||||
if (s == -1) {
|
||||
perror("socket");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
v = 1;
|
||||
|
||||
if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &v, sizeof(int))) {
|
||||
perror("setsockopt");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Bind the socket to a file path
|
||||
memset(&a, 0, sizeof(struct sockaddr_un));
|
||||
a.sun_family = AF_UNIX;
|
||||
strncpy(a.sun_path, path, sizeof(a.sun_path) - 1);
|
||||
|
||||
// Remove any existing socket file
|
||||
unlink(path);
|
||||
|
||||
if (bind(s, (struct sockaddr *)&a, sizeof(a)) == -1) {
|
||||
perror("Bind failed");
|
||||
close(s);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Set permissions to 770 (rwxrwx---) to make sure groups can access
|
||||
if (chmod(path, 0770) == -1) {
|
||||
perror("Failed to change permissions");
|
||||
close(s);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Listen for incoming connections
|
||||
if (listen(s, 5) == -1) {
|
||||
perror("Listen failed");
|
||||
close(s);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
int get_uds_connection(char *path)
|
||||
{
|
||||
int s, t;
|
||||
printf("waiting for connection on %s\n", path);
|
||||
s = create_listen_uds_socket(path);
|
||||
t = socket_accept(s);
|
||||
|
||||
if (t == -1) {
|
||||
perror("accept");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
close(s);
|
||||
printf("connected\n");
|
||||
return t;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/* buffer */
|
||||
/****************************************************************************/
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "spsc_q.h"
|
||||
|
||||
spsc_q_t spsc_q_alloc(size_t cnt, size_t elsiz)
|
||||
bool spsc_q_alloc(spsc_q_t *rbn, size_t cnt, size_t elsiz)
|
||||
{
|
||||
/* internally, use one element more: the ringbuffer is full if
|
||||
* (write_idx + 1) % cnt == read_idx, so it's full if one element is still
|
||||
@@ -17,7 +17,8 @@ spsc_q_t spsc_q_alloc(size_t cnt, size_t elsiz)
|
||||
cnt += 1;
|
||||
spsc_q_t rb = {.cnt = cnt, .elsiz = elsiz};
|
||||
rb.buf = calloc(cnt, elsiz);
|
||||
return rb;
|
||||
*rbn = rb;
|
||||
return rb.buf != NULL;
|
||||
}
|
||||
|
||||
void spsc_q_free(spsc_q_t *rb)
|
||||
|
||||
@@ -25,7 +25,7 @@ typedef struct spsc_q {
|
||||
atomic_size_t read_idx;
|
||||
} spsc_q_t;
|
||||
|
||||
spsc_q_t spsc_q_alloc(size_t cnt, size_t elsiz);
|
||||
bool spsc_q_alloc(spsc_q_t *rbn, size_t cnt, size_t elsiz);
|
||||
void spsc_q_free(spsc_q_t *rb);
|
||||
|
||||
bool spsc_q_put(spsc_q_t *rb, const void *src, size_t elsiz);
|
||||
|
||||
@@ -8,7 +8,8 @@ extern "C" {
|
||||
}
|
||||
|
||||
TEST(spsc_q, basic_test) {
|
||||
spsc_q_t rb = spsc_q_alloc(2, sizeof(int));
|
||||
spsc_q_t rb;
|
||||
EXPECT_TRUE(spsc_q_alloc(&rb, 2, sizeof(int)));
|
||||
|
||||
int a = 1;
|
||||
EXPECT_TRUE(spsc_q_put(&rb, &a, sizeof(a)));
|
||||
@@ -26,7 +27,8 @@ TEST(spsc_q, basic_test) {
|
||||
}
|
||||
|
||||
TEST(spsc_q, cont_write) {
|
||||
spsc_q_t rb = spsc_q_alloc(10, sizeof(int));
|
||||
spsc_q_t rb;
|
||||
EXPECT_TRUE(spsc_q_alloc(&rb, 10, sizeof(int)));
|
||||
|
||||
int a = 1;
|
||||
for (int i = 0; i < 1111; ++i) {
|
||||
@@ -57,7 +59,8 @@ bool count(const void *data, void *user)
|
||||
return true; /* count all */
|
||||
}
|
||||
TEST(spsc_q, iterator) {
|
||||
spsc_q_t rb = spsc_q_alloc(10, sizeof(int));
|
||||
spsc_q_t rb;
|
||||
EXPECT_TRUE(spsc_q_alloc(&rb, 10, sizeof(int)));
|
||||
int n = 8;
|
||||
for (int i = 0; i < n; ++i)
|
||||
EXPECT_TRUE(spsc_q_put(&rb, &i, sizeof(i)));
|
||||
@@ -85,7 +88,8 @@ bool drop(const void *data, void *user)
|
||||
return true; /* drop all */
|
||||
}
|
||||
TEST(spsc_q, drop) {
|
||||
spsc_q_t rb = spsc_q_alloc(10, sizeof(int));
|
||||
spsc_q_t rb;
|
||||
EXPECT_TRUE(spsc_q_alloc(&rb, 10, sizeof(int)));
|
||||
int n = 8;
|
||||
for (int i = 0; i < n; ++i)
|
||||
EXPECT_TRUE(spsc_q_put(&rb, &i, sizeof(i)));
|
||||
@@ -104,7 +108,8 @@ TEST(spsc_q, drop) {
|
||||
|
||||
TEST(spsc_q, full) {
|
||||
int n = 3;
|
||||
spsc_q_t rb = spsc_q_alloc(n, sizeof(int));
|
||||
spsc_q_t rb;
|
||||
EXPECT_TRUE(spsc_q_alloc(&rb, n, sizeof(int)));
|
||||
int a = 1;
|
||||
EXPECT_TRUE(spsc_q_put(&rb, &a, sizeof(a)));
|
||||
a++;
|
||||
|
||||
@@ -40,9 +40,9 @@ static void *consumer(void *arg)
|
||||
static void run_test(int range, int q_size)
|
||||
{
|
||||
q_args_t args = {
|
||||
.q = spsc_q_alloc(q_size, sizeof(int)),
|
||||
.range = range,
|
||||
};
|
||||
spsc_q_alloc(&args.q, q_size, sizeof(int));
|
||||
|
||||
pthread_t p, c;
|
||||
int ret;
|
||||
|
||||
@@ -71,7 +71,9 @@ static inline const char *rnti_types(nr_rnti_type_t rr)
|
||||
#define MAX_GSCN_BAND 620 // n78 has the highest GSCN range of 619
|
||||
#define NR_SYMBOLS_PER_SLOT 14
|
||||
#define NR_SYMBOLS_PER_SLOT_EXTENDED_CP 12
|
||||
#define NR_MAX_NB_LAYERS 4 // 8
|
||||
#define NR_MAX_NB_LAYERS 4
|
||||
#define MAX_NUM_NR_DLSCH_SEGMENTS (MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER * NR_MAX_NB_LAYERS)
|
||||
#define MAX_NUM_NR_ULSCH_SEGMENTS (MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER * NR_MAX_NB_LAYERS)
|
||||
#define NR_MAX_CSI_PORTS 12
|
||||
|
||||
// Since the IQ samples are represented by SQ15 R+I (see https://en.wikipedia.org/wiki/Q_(number_format)) we need to compensate when
|
||||
|
||||
@@ -301,7 +301,7 @@ static int trigger_ngap_pdu_session_release(char *buf, int debug, telnet_printfu
|
||||
ERROR_MSG_RET("Missing input. Usage: trigger_pdu_session_release [ue_id=gNB_ue_ngap_id(int,opt)],pdusession_id(int)[,pdusession_id(int)...]\n");
|
||||
}
|
||||
|
||||
char *tokens[NGAP_MAX_PDU_SESSION + 1];
|
||||
char *tokens[NR_MAX_NB_PDU_SESSIONS + 1];
|
||||
int count = 0;
|
||||
|
||||
for (char *tok = strtok(buf, ","); tok != NULL && count < (int)sizeofArray(tokens); tok = strtok(NULL, ",")) {
|
||||
|
||||
@@ -65,36 +65,3 @@ sequenceDiagram
|
||||
u->>c: BEARER CONTEXT MODIFICATION RESPONSE
|
||||
Note over c: e1apCUCP_handle_BEARER_CONTEXT_MODIFICATION_RESPONSE
|
||||
```
|
||||
|
||||
## PDU Session Release
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant AMF
|
||||
participant CUCP
|
||||
participant CUUP
|
||||
participant DU
|
||||
participant UE
|
||||
|
||||
AMF->>CUCP: NG PDU SESSION RESOURCE RELEASE COMMAND
|
||||
Note over CUCP: ngap_gNB_handle_pdusession_release_command
|
||||
CUCP->>CUCP: rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND
|
||||
Note over CUCP: set status PDU_SESSION_STATUS_TORELEASE
|
||||
CUCP->>CUUP: E1 Bearer Context Modification Request
|
||||
Note over CUUP: release_gtpu_tunnel (GTP tunnel, PDCP, SDAP)
|
||||
CUUP->>CUCP: E1 Bearer Context Modification Response
|
||||
Note over CUCP: rrc_gNB_send_f1_drb_release_request
|
||||
CUCP->>DU: F1 UE Context Modification Request
|
||||
Note over DU: handle_ue_context_drbs_release (release in MAC/RLC)
|
||||
DU->>CUCP: F1 UE Context Modification Response
|
||||
Note over CUCP: rrc_CU_process_ue_context_modification_response
|
||||
Note over CUCP: replace existing CellGroupConfig
|
||||
Note over CUCP: rrc_gNB_generate_dedicatedRRCReconfiguration
|
||||
CUCP->>UE: RRCReconfiguration (DRB release list, NAS PDU)
|
||||
UE->>CUCP: RRCReconfigurationComplete
|
||||
Note over CUCP: handle_rrcReconfigurationComplete
|
||||
Note over CUCP: rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE
|
||||
CUCP->>AMF: NG PDU SESSION RESOURCE RELEASE RESPONSE
|
||||
Note over CUCP: rm_drbs_by_pdusession (from stored RRC list)
|
||||
Note over CUCP: rm_pduSession (from stored RRC list)
|
||||
```
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
||||
|
||||
# LDPC offload with the XDMA driver
|
||||
|
||||
[TOC]
|
||||
|
||||
This documentation aims to provide a tutorial for using Xilinx PCIe-XDMA based FPGA LDPC decoding within OAI. LDPC decoding is offloaded to FPGA.
|
||||
|
||||
## XDMA Driver Build & Install
|
||||
|
||||
- Get XDMA driver source
|
||||
```bash
|
||||
git clone https://github.com/Xilinx/dma_ip_drivers.git
|
||||
cd dma_ip_drivers/XDMA/linux-kernel
|
||||
```
|
||||
The *xdma_driver* directory contains the following:
|
||||
|
||||
```bash
|
||||
dma_ip_drivers/XDMA/linux-kernel/
|
||||
├── COPYING
|
||||
├── include
|
||||
├── LICENSE
|
||||
├── readme.txt
|
||||
├── RELEASE
|
||||
├── tests
|
||||
├── tools
|
||||
└── xdma
|
||||
```
|
||||
|
||||
Before building the driver, ensure that your system recognizes the Xilinx device. You can check this using the `lspci` command:
|
||||
|
||||
```bash
|
||||
$ lspci | grep Xilinx
|
||||
01:00.0 Serial controller: Xilinx Corporation Device 8038
|
||||
```
|
||||
|
||||
Building and Installing the Driver
|
||||
|
||||
```bash
|
||||
cd ~/dma_ip_drivers/XDMA/linux-kernel/xdma
|
||||
make clean
|
||||
make
|
||||
# install to make the driver loading automatically at system startup
|
||||
sudo make install
|
||||
```
|
||||
|
||||
Load the Driver
|
||||
|
||||
```bash
|
||||
cd ~/dma_ip_drivers/XDMA/linux-kernel/tests
|
||||
sudo ./load_driver.sh
|
||||
```
|
||||
|
||||
## OAI Build
|
||||
|
||||
```bash
|
||||
# Get openairinterface5g source code
|
||||
git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git ~/openairinterface5g
|
||||
cd ~/openairinterface5g
|
||||
|
||||
# Install OAI dependencies
|
||||
cd ~/openairinterface5g/cmake_targets
|
||||
./build_oai -I
|
||||
|
||||
# Build OAI gNB & UE
|
||||
cd ~/openairinterface5g
|
||||
source oaienv
|
||||
cd cmake_targets
|
||||
./build_oai --ninja -w SIMU --gNB --nrUE -P --build-lib "ldpc_xdma" -C -c
|
||||
```
|
||||
|
||||
Shared object file *libldpc_xdma.so* is created during the compilation. This object is conditionally compiled. Selection of the library to compile is done using `--build-lib ldpc_xdma`.
|
||||
|
||||
## 5G PHY simulators
|
||||
|
||||
The simulated test uses the option `--loader.ldpc.shlibversion _xdma` to select the XDMA version for loading into the LDPC interface. Additionally, the option `--nrLDPC_coding_xdma.num_threads_prepare` is used to specify the number of threads for preparing data before the LDPC processing, specifically for the deinterleaving and rate matching parts.
|
||||
|
||||
Another way to activate the feature is to add the `xdma.conf` file with the following content:
|
||||
|
||||
```
|
||||
nrLDPC_coding_xdma : {
|
||||
num_threads_prepare : 2;
|
||||
};
|
||||
|
||||
loader : {
|
||||
ldpc : {
|
||||
shlibversion : "_xdma";
|
||||
};
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
and use option `-O xdma.conf`.
|
||||
|
||||
### nr_ulsim test
|
||||
|
||||
Example command for running nr_ulsim with LDPC decoding offload to the FPGA:
|
||||
|
||||
```bash
|
||||
cd ~/openairinterface5g/cmake_targets/ran_build/build
|
||||
sudo ./nr_ulsim -n100 -m28 -r273 -R273 -s22 -I10 -C8 -P --loader.ldpc.shlibversion _xdma --nrLDPC_coding_xdma.num_threads_prepare 2
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```
|
||||
sudo ./nr_ulsim -n100 -m28 -r273 -R273 -s22 -I10 -C8 -P -O xdma.conf
|
||||
```
|
||||
|
||||
## Run
|
||||
|
||||
Both gNB and nrUE use the option `--loader.ldpc.shlibversion _xdma` to select the XDMA version for loading into the LDPC interface and `--nrLDPC_coding_xdma.num_threads_prepare` to specify the number of threads for preparing data before the LDPC processing, specifically for the deinterleaving and rate matching parts.
|
||||
|
||||
Another way to activate the feature is to add the following content to the `.conf` file you want to use:
|
||||
|
||||
```
|
||||
nrLDPC_coding_xdma : {
|
||||
num_threads_prepare : 2;
|
||||
};
|
||||
|
||||
loader : {
|
||||
ldpc : {
|
||||
shlibversion : "_xdma";
|
||||
};
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
and use option `-O *.conf`.
|
||||
|
||||
### gNB
|
||||
|
||||
Example command using rfsim:
|
||||
|
||||
```bash
|
||||
cd ~/openairinterface5g/cmake_targets/ran_build/build
|
||||
sudo ./nr-softmodem --rfsim --log_config.global_log_options level,nocolor,time -O ../../../ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.conf --loader.ldpc.shlibversion _xdma --nrLDPC_coding_xdma.num_threads_prepare 2
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```bash
|
||||
sudo ./nr-softmodem --rfsim --log_config.global_log_options level,nocolor,time -O ../../../ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.conf
|
||||
```
|
||||
|
||||
if you have added the configuration to the `.conf` file.
|
||||
|
||||
### UE
|
||||
|
||||
Example command using rfsim:
|
||||
|
||||
```bash
|
||||
cd ~/openairinterface5g/cmake_targets/ran_build/build
|
||||
sudo ./nr-uesoftmodem --rfsim -r 106 --numerology 1 --band 78 -C 3319680000 --ue-nb-ant-tx 1 --ue-nb-ant-rx 1 -O ../../../ci-scripts/conf_files/nrue1.uicc.cluCN.conf --rfsimulator.[0].serveraddr 10.201.1.100 --loader.ldpc.shlibversion _xdma --nrLDPC_coding_xdma.num_threads_prepare 2
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```bash
|
||||
sudo ./nr-uesoftmodem --rfsim -r 106 --numerology 1 --band 78 -C 3319680000 --ue-nb-ant-tx 1 --ue-nb-ant-rx 1 -O ../../../ci-scripts/conf_files/nrue1.uicc.cluCN.conf --rfsimulator.[0].serveraddr 10.201.1.100
|
||||
```
|
||||
|
||||
if you have added the configuration to the `.conf` file.
|
||||
@@ -62,10 +62,13 @@ We tested the category A radio units listed below.
|
||||
|Vendor |Software Version |
|
||||
|-----------------|---------------------------------------------|
|
||||
|VVDN LPRU |03-v3.0.5 |
|
||||
|LiteON RU |01.00.08/02.00.03/02.00.10 |
|
||||
|Benetel 650 |RAN650-1v1.0.4-dda1bf5/RAN650-1v1.2.2-2fa04bc/RAN650-1v1.4.2-NM-c48047d|
|
||||
|Benetel 550 |RAN550-1v1.0.4-605a25a/RAN550-1v1.2.2-2fa04bc/RAN550-1v1.4.1-M-25fa970/RAN550-1v2.0.5-M-92a9d2c|
|
||||
|LiteON RU FR1 |01.00.08/02.00.03/02.00.10 |
|
||||
|LiteON RU FR2 |02.00.07 |
|
||||
|Metanoia RU FR1 |2.0.6 |
|
||||
|Benetel 650 |RAN650-1v2.1.0-M-0820797 |
|
||||
|Benetel 550 |RAN550-1v2.1.0-M-0820797 |
|
||||
|Foxconn RPQN |v3.1.15q.551_rc10 |
|
||||
|Microamp RU |0.1.174 |
|
||||
|
||||
Tested libxran releases:
|
||||
|
||||
@@ -617,9 +620,9 @@ jumboframe 1 # enable jumbo frame
|
||||
|
||||
###### FR2
|
||||
|
||||
The OAI configuration file [`gnb.sa.band257.66prb.fhi72.2x2-liteon.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.66prb.fhi72.2x2-liteon.conf) corresponds to:
|
||||
- TDD pattern `DDDDDDDSUU`, 1.25ms
|
||||
- Bandwidth 100MHz
|
||||
The OAI configuration file [`gnb.sa.band257.132prb.fhi72.2x2-liteon.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.132prb.fhi72.2x2-liteon.conf) corresponds to:
|
||||
- TDD pattern `DDDSU`, 0.625ms
|
||||
- Bandwidth 200MHz
|
||||
- FW v02.00.07
|
||||
- DL uses jumbo frame, UL uses standard MTU of 1500 bytes
|
||||
|
||||
@@ -630,82 +633,481 @@ eAXC_id 0 1 # set PRACH eAxC IDs
|
||||
...
|
||||
```
|
||||
|
||||
#### MICROAMP FR2
|
||||
#### Microamp FR2
|
||||
|
||||
#### Firmware starting from 0.1.174
|
||||
|
||||
Requirements:
|
||||
- sshpass:
|
||||
```bash
|
||||
#RHEL
|
||||
sudo dnf install sshpass -y
|
||||
#Ubuntu
|
||||
sudo apt install sshpass -y
|
||||
```
|
||||
|
||||
To check PTP status, you can use the following command:
|
||||
```bash
|
||||
sshpass -p microampcfg ssh remctl@<RU_IP_ADDR> "logs-ptp"
|
||||
```
|
||||
<details>
|
||||
<summary>PTP output will be similar to:</summary>
|
||||
|
||||
```
|
||||
Apr 27 11:58:35 bbv1 ptp4l[74545]: ptp4l[357120.237]: rms 8 max 16 freq -100 +/- 142 delay 1183 +/- 0
|
||||
Apr 27 11:58:34 bbv1 ptp4l[74545]: ptp4l[357119.114]: rms 1 max 1 freq +189 +/- 25 delay 1183 +/- 0
|
||||
Apr 27 11:58:33 bbv1 ptp4l[74545]: ptp4l[357117.991]: rms 1 max 1 freq +99 +/- 30 delay 1183 +/- 0
|
||||
Apr 27 11:58:32 bbv1 ptp4l[74545]: ptp4l[357116.869]: rms 1 max 1 freq +22 +/- 18 delay 1183 +/- 0
|
||||
Apr 27 11:58:31 bbv1 ptp4l[74545]: ptp4l[357115.746]: rms 1 max 1 freq -51 +/- 20 delay 1183 +/- 0
|
||||
Apr 27 11:58:30 bbv1 ptp4l[74545]: ptp4l[357114.624]: rms 1 max 2 freq -126 +/- 29 delay 1183 +/- 0
|
||||
Apr 27 11:58:29 bbv1 ptp4l[74545]: ptp4l[357113.501]: rms 8 max 16 freq -16 +/- 200 delay 1184 +/- 0
|
||||
Apr 27 11:58:28 bbv1 ptp4l[74545]: ptp4l[357112.378]: rms 1 max 2 freq +164 +/- 29 delay 1183 +/- 0
|
||||
Apr 27 11:58:26 bbv1 ptp4l[74545]: ptp4l[357111.256]: rms 1 max 2 freq +54 +/- 39 delay 1183 +/- 0
|
||||
Apr 27 11:58:25 bbv1 ptp4l[74545]: ptp4l[357110.133]: rms 1 max 2 freq -34 +/- 19 delay 1183 +/- 0
|
||||
Apr 27 11:58:24 bbv1 ptp4l[74545]: ptp4l[357109.010]: rms 1 max 2 freq -112 +/- 26 delay 1183 +/- 0
|
||||
Apr 27 11:58:23 bbv1 ptp4l[74545]: ptp4l[357107.888]: rms 8 max 16 freq -48 +/- 174 delay 1183 +/- 0
|
||||
Apr 27 11:58:22 bbv1 ptp4l[74545]: ptp4l[357106.766]: rms 1 max 1 freq +197 +/- 25 delay 1183 +/- 0
|
||||
Apr 27 11:58:21 bbv1 ptp4l[74545]: ptp4l[357105.642]: rms 1 max 2 freq +149 +/- 26 delay 1183 +/- 0
|
||||
Apr 27 11:58:20 bbv1 ptp4l[74545]: ptp4l[357104.519]: rms 1 max 2 freq +66 +/- 27 delay 1183 +/- 0
|
||||
Apr 27 11:58:19 bbv1 ptp4l[74545]: ptp4l[357103.396]: rms 1 max 2 freq -17 +/- 24 delay 1183 +/- 0
|
||||
Apr 27 11:58:17 bbv1 ptp4l[74545]: ptp4l[357102.273]: rms 1 max 1 freq -94 +/- 23 delay 1183 +/- 0
|
||||
Apr 27 11:58:16 bbv1 ptp4l[74545]: ptp4l[357101.150]: rms 7 max 16 freq +107 +/- 180 delay 1183 +/- 0
|
||||
Apr 27 11:58:15 bbv1 ptp4l[74545]: ptp4l[357100.027]: rms 1 max 2 freq +166 +/- 11 delay 1184 +/- 0
|
||||
Apr 27 11:58:14 bbv1 ptp4l[74545]: ptp4l[357098.906]: rms 1 max 1 freq +140 +/- 21 delay 1183 +/- 0
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
###### RU configuration
|
||||
|
||||
You can use the following command to display the current RU configuration:
|
||||
|
||||
```bash
|
||||
sshpass -p microampcfg ssh remctl@<RU_IP_ADDR> get-cfg
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
The OAI configuration file [`gnb.sa.band257.132prb.fhi72.2x2-microamp.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.132prb.fhi72.2x2-microamp.conf) corresponds to the following RU configuration:
|
||||
</summary>
|
||||
|
||||
```
|
||||
PRACH0 CC ID: 0
|
||||
PRACH0 RU port ID: 0
|
||||
PRACH1 CC ID: 1
|
||||
PRACH1 RU port ID: 1
|
||||
Bandwidth: 200M [Hz]
|
||||
Carrier frequency: 28049280000.0 [Hz]
|
||||
Compression enable: True
|
||||
TDD config: DDDSU
|
||||
eCPRI VLAN support enable: True
|
||||
eCPRI VLAN tag: 600
|
||||
MAC address: 10:70:fd:b8:86:02
|
||||
VLAN PTP status: ENABLED
|
||||
VLAN MGMT enabled: ENABLED
|
||||
State: ENABLED_WITH_VLAN
|
||||
Dynamic beamforming with mirrored beams
|
||||
PL MAC address:
|
||||
RU MAC: 10-70-FD-B8-86-02
|
||||
DU MAC: 50-7C-6F-31-00-61
|
||||
RF Power level: -5 dB - relative to maximum
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
Execute the following command to check how to configure the RU:
|
||||
|
||||
```bash
|
||||
sshpass -p microampcfg ssh remctl@<RU_IP_ADDR> "help"
|
||||
```
|
||||
<details>
|
||||
<summary>Help output will be similar to:</summary>
|
||||
|
||||
```
|
||||
Usage: remctl <subcommand> [options]
|
||||
|
||||
Allowed Subcommands:
|
||||
set-cfg, get-cfg, stat, logs-ptp, reboot, set-power, help, clear-cfg
|
||||
|
||||
Allowed 'set-cfg' options:
|
||||
--bandwidth
|
||||
--tdd-cfg
|
||||
--compression-enable
|
||||
--compression-disable
|
||||
--ecpri-vlan-tag
|
||||
--ecpri-vlan-support-enable
|
||||
--ecpri-vlan-support-disable
|
||||
--ru-mac
|
||||
--du-mac
|
||||
--beamforming
|
||||
--carrier-freq
|
||||
--eth-ipv4
|
||||
--prach0-cc-id
|
||||
--prach0-ru-port-id
|
||||
--prach1-cc-id
|
||||
--prach1-ru-port-id
|
||||
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
|
||||
You can also execute the following command to show fronthaul statistics including on-time/late packet' counters:
|
||||
```bash
|
||||
sshpass -p microampcfg ssh remctl@<RU_IP_ADDR> "stat"
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Statistics output will be similar to:</summary>
|
||||
|
||||
```
|
||||
ORAN RX C-plane on time: 71645874
|
||||
ORAN RX C-plane early: 0
|
||||
ORAN RX C-plane late: 16
|
||||
ORAN TX U-plane: 229686268
|
||||
ORAN RX DL C-plane on time: 53987559
|
||||
ORAN RX DL C-plane early: 0
|
||||
ORAN RX DL C-plane late: 12
|
||||
ORAN RX DL U-plane on time: 701836967
|
||||
ORAN RX DL U-plane early: 0
|
||||
ORAN RX DL U-plane late: 52
|
||||
ORAN RX UL C-plane on time: 17658315
|
||||
ORAN RX UL C-plane early: 0
|
||||
ORAN RX UL C-plane late: 4
|
||||
CLASSIFIER LLC: overflow protection: 0
|
||||
CLASSIFIER LLC: frame err: 28
|
||||
CLASSIFIER LLC: packet too long: 0
|
||||
CLASSIFIER LLC: dropped: 28
|
||||
CLASSIFIER LLC: passed: 804719078
|
||||
CLASSIFIER ETH: dst MAC addr err: 0
|
||||
CLASSIFIER ETH: VLAN LEGACY: 275571
|
||||
CLASSIFIER ETH: VLAN Dot1Q: 804443507
|
||||
CLASSIFIER ETH: VLAN Dot1AD: 0
|
||||
CLASSIFIER ETH: VLAN Tag ID pass: 773482909
|
||||
CLASSIFIER ETH: VLAN Tag ID error: 0
|
||||
CLASSIFIER ETH: multicast: 31233828
|
||||
CLASSIFIER ETH: PTP: 29502626
|
||||
CLASSIFIER ETH: eCPRI: 773482909
|
||||
CLASSIFIER ETH: to OS: 31236169
|
||||
CLASSIFIER ETH: dropped: 0
|
||||
CLASSIFIER ETH: passed: 804719078
|
||||
CLASSIFIER ECPRI: prot rev unsupported: 0
|
||||
CLASSIFIER ECPRI: concat unsupported: 0
|
||||
CLASSIFIER ECPRI: msg type unsupported: 0
|
||||
CLASSIFIER ECPRI: pld size err: 0
|
||||
CLASSIFIER ECPRI: U-Plane: 701837019
|
||||
CLASSIFIER ECPRI: C-Plane: 71645890
|
||||
CLASSIFIER ECPRI: delay: 0
|
||||
CLASSIFIER ECPRI: dropped: 0
|
||||
CLASSIFIER ECPRI: passed: 773482909
|
||||
CPLANE PARSER: ul early: 0
|
||||
CPLANE PARSER: ul late: 4
|
||||
CPLANE PARSER: ul on time: 17658315
|
||||
CPLANE PARSER: dl early: 0
|
||||
CPLANE PARSER: dl late: 12
|
||||
CPLANE PARSER: dl on time: 53987559
|
||||
CPLANE PARSER: timing dropped: 16
|
||||
CPLANE PARSER: timing passed: 71645874
|
||||
CPLANE PARSER: bad du port id: 0
|
||||
CPLANE PARSER: bad bandsector id: 0
|
||||
CPLANE PARSER: bad cc id: 663059
|
||||
CPLANE PARSER: bad ru port id: 2794
|
||||
CPLANE PARSER: bad sequence id: 0
|
||||
CPLANE PARSER: bad e bit: 0
|
||||
CPLANE PARSER: bad subsequence id: 0
|
||||
CPLANE PARSER: ecpri transport header dropped: 665623
|
||||
CPLANE PARSER: ecpri transport header passed: 70980251
|
||||
CPLANE PARSER: bad payloadversion: 0
|
||||
CPLANE PARSER: bad filterindex: 0
|
||||
CPLANE PARSER: bad subframeid: 0
|
||||
CPLANE PARSER: bad slotid: 0
|
||||
CPLANE PARSER: bad startsymbolid: 0
|
||||
CPLANE PARSER: bad numberofsections: 0
|
||||
CPLANE PARSER: bad sectiontype: 0
|
||||
CPLANE PARSER: bad timeoffset: 0
|
||||
CPLANE PARSER: bad fftsize: 0
|
||||
CPLANE PARSER: bad subcarrierspacing: 0
|
||||
CPLANE PARSER: bad cplength: 0
|
||||
CPLANE PARSER: bad udiqwidth: 0
|
||||
CPLANE PARSER: radio aplication header dropped: 0
|
||||
CPLANE PARSER: radio aplication header passed: 70980251
|
||||
CPLANE PARSER: bad rb: 0
|
||||
CPLANE PARSER: bad startprbc: 0
|
||||
CPLANE PARSER: bad numprbc: 0
|
||||
CPLANE PARSER: bad remask: 0
|
||||
CPLANE PARSER: bad numsymbol: 0
|
||||
CPLANE PARSER: bad ef: 0
|
||||
CPLANE PARSER: bad freqoffset: 0
|
||||
CPLANE PARSER: common section fields dropped: 0
|
||||
CPLANE PARSER: common section fields passed: 70980251
|
||||
CPLANE PARSER: bad section to symbol map: 0
|
||||
CPLANE PARSER: dropped: 0
|
||||
CPLANE PARSER: passed: 70980251
|
||||
CPLANE PARSER: expected uplanes number: 701813698
|
||||
UPLANE PARSER: sequence ID err: 0
|
||||
UPLANE PARSER: IQ pld size err: 0
|
||||
UPLANE PARSER: C-Plane match err: 114225
|
||||
UPLANE PARSER: eAxC ID unsupported: 24631
|
||||
UPLANE PARSER: any value unsupported: 24631
|
||||
UPLANE PARSER: dropped: 138886
|
||||
UPLANE PARSER: passed: 701698133
|
||||
UPLANE ENCAPSULATOR 0: false drop error: 0
|
||||
UPLANE ENCAPSULATOR 0: passed: 94598642
|
||||
UPLANE ENCAPSULATOR 1: false drop error: 0
|
||||
UPLANE ENCAPSULATOR 1: passed: 94598642
|
||||
UPLANE ENCAPSULATOR 2: false drop error: 0
|
||||
UPLANE ENCAPSULATOR 2: passed: 0
|
||||
UPLANE ENCAPSULATOR 3: false drop error: 0
|
||||
UPLANE ENCAPSULATOR 3: passed: 0
|
||||
COMMON COMMON: symbol counter: 57757250505
|
||||
DSP CHAIN 0: dl fft overflow: 0
|
||||
DSP CHAIN 0: ul fft overflow: 0
|
||||
DSP CHAIN 1: dl fft overflow: 0
|
||||
DSP CHAIN 1: ul fft overflow: 0
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
##### Firmware older than 0.1.174
|
||||
Interaction with RU is performed using `rucfg` utility provided by Microamp.
|
||||
|
||||
To check PTP status, you can use `rucfg ptp`. the output should be similar to:
|
||||
```bash
|
||||
[INFO] Check if RU is available
|
||||
[INFO] RU available
|
||||
[INFO] Check SSH to RU available
|
||||
[INFO] SSH to RU available
|
||||
[INFO] Getting PTP status
|
||||
[INFO] ptp4l status =
|
||||
{
|
||||
Feb 12 16:26:02 bbv1 ptp4l[23822]: ptp4l[6280.658]: rms 0 max 1 freq +2 +/- 7 delay 1184 +/- 0
|
||||
Feb 12 16:26:00 bbv1 ptp4l[23822]: ptp4l[6279.535]: rms 0 max 1 freq -8 +/- 13 delay 1184 +/- 0
|
||||
Feb 12 16:25:59 bbv1 ptp4l[23822]: ptp4l[6278.413]: rms 1 max 1 freq -35 +/- 13 delay 1184 +/- 0
|
||||
Feb 12 16:25:58 bbv1 ptp4l[23822]: ptp4l[6277.290]: rms 0 max 1 freq -68 +/- 9 delay 1184 +/- 0
|
||||
Feb 12 16:25:57 bbv1 ptp4l[23822]: ptp4l[6276.167]: rms 1 max 1 freq -69 +/- 10 delay 1184 +/- 0
|
||||
Feb 12 16:25:56 bbv1 ptp4l[23822]: ptp4l[6275.044]: rms 0 max 1 freq -46 +/- 9 delay 1184 +/- 0
|
||||
Feb 12 16:25:55 bbv1 ptp4l[23822]: ptp4l[6273.921]: rms 1 max 1 freq -65 +/- 10 delay 1184 +/- 0
|
||||
Feb 12 16:25:54 bbv1 ptp4l[23822]: ptp4l[6272.800]: rms 0 max 1 freq -91 +/- 6 delay 1184 +/- 0
|
||||
Feb 12 16:25:53 bbv1 ptp4l[23822]: ptp4l[6271.677]: rms 4 max 17 freq -107 +/- 48 delay 1184 +/- 0
|
||||
Feb 12 16:25:52 bbv1 ptp4l[23822]: ptp4l[6270.554]: rms 6 max 17 freq +179 +/- 106 delay 1184 +/- 0
|
||||
Feb 12 16:25:50 bbv1 ptp4l[23822]: ptp4l[6269.431]: rms 1 max 2 freq +191 +/- 12 delay 1184 +/- 0
|
||||
Feb 12 16:25:49 bbv1 ptp4l[23822]: ptp4l[6268.308]: rms 1 max 1 freq +119 +/- 21 delay 1184 +/- 0
|
||||
Feb 12 16:25:48 bbv1 ptp4l[23822]: ptp4l[6267.186]: rms 1 max 1 freq +103 +/- 13 delay 1184 +/- 0
|
||||
Feb 12 16:25:47 bbv1 ptp4l[23822]: ptp4l[6266.063]: rms 7 max 17 freq -101 +/- 160 delay 1184 +/- 0
|
||||
Feb 12 16:25:46 bbv1 ptp4l[23822]: ptp4l[6264.940]: rms 7 max 17 freq -65 +/- 154 delay 1184 +/- 0
|
||||
Feb 12 16:25:45 bbv1 ptp4l[23822]: ptp4l[6263.817]: rms 1 max 2 freq +176 +/- 33 delay 1183 +/- 0
|
||||
Feb 12 16:25:44 bbv1 ptp4l[23822]: ptp4l[6262.695]: rms 0 max 1 freq +100 +/- 7 delay 1184 +/- 0
|
||||
Feb 12 16:25:43 bbv1 ptp4l[23822]: ptp4l[6261.572]: rms 1 max 2 freq +56 +/- 34 delay 1184 +/- 0
|
||||
Feb 12 16:25:41 bbv1 ptp4l[23822]: ptp4l[6260.449]: rms 1 max 1 freq -37 +/- 14 delay 1184 +/- 0
|
||||
Feb 12 16:25:40 bbv1 ptp4l[23822]: ptp4l[6259.326]: rms 7 max 16 freq +114 +/- 149 delay 1183 +/- 0
|
||||
}
|
||||
To check PTP status, you can use `rucfg ptp`.
|
||||
|
||||
```
|
||||
|
||||
##### RU configuration
|
||||
<details>
|
||||
<summary>PTP output will be similar to:</summary>
|
||||
|
||||
You can use `rucfg show` to display the current RU configuration.
|
||||
```
|
||||
[INFO] Check if RU is available
|
||||
[INFO] RU available
|
||||
[INFO] Check SSH to RU available
|
||||
[INFO] SSH to RU available
|
||||
[INFO] Getting PTP status
|
||||
[INFO] ptp4l status =
|
||||
{
|
||||
Feb 12 16:26:02 bbv1 ptp4l[23822]: ptp4l[6280.658]: rms 0 max 1 freq +2 +/- 7 delay 1184 +/- 0
|
||||
Feb 12 16:26:00 bbv1 ptp4l[23822]: ptp4l[6279.535]: rms 0 max 1 freq -8 +/- 13 delay 1184 +/- 0
|
||||
Feb 12 16:25:59 bbv1 ptp4l[23822]: ptp4l[6278.413]: rms 1 max 1 freq -35 +/- 13 delay 1184 +/- 0
|
||||
Feb 12 16:25:58 bbv1 ptp4l[23822]: ptp4l[6277.290]: rms 0 max 1 freq -68 +/- 9 delay 1184 +/- 0
|
||||
Feb 12 16:25:57 bbv1 ptp4l[23822]: ptp4l[6276.167]: rms 1 max 1 freq -69 +/- 10 delay 1184 +/- 0
|
||||
Feb 12 16:25:56 bbv1 ptp4l[23822]: ptp4l[6275.044]: rms 0 max 1 freq -46 +/- 9 delay 1184 +/- 0
|
||||
Feb 12 16:25:55 bbv1 ptp4l[23822]: ptp4l[6273.921]: rms 1 max 1 freq -65 +/- 10 delay 1184 +/- 0
|
||||
Feb 12 16:25:54 bbv1 ptp4l[23822]: ptp4l[6272.800]: rms 0 max 1 freq -91 +/- 6 delay 1184 +/- 0
|
||||
Feb 12 16:25:53 bbv1 ptp4l[23822]: ptp4l[6271.677]: rms 4 max 17 freq -107 +/- 48 delay 1184 +/- 0
|
||||
Feb 12 16:25:52 bbv1 ptp4l[23822]: ptp4l[6270.554]: rms 6 max 17 freq +179 +/- 106 delay 1184 +/- 0
|
||||
Feb 12 16:25:50 bbv1 ptp4l[23822]: ptp4l[6269.431]: rms 1 max 2 freq +191 +/- 12 delay 1184 +/- 0
|
||||
Feb 12 16:25:49 bbv1 ptp4l[23822]: ptp4l[6268.308]: rms 1 max 1 freq +119 +/- 21 delay 1184 +/- 0
|
||||
Feb 12 16:25:48 bbv1 ptp4l[23822]: ptp4l[6267.186]: rms 1 max 1 freq +103 +/- 13 delay 1184 +/- 0
|
||||
Feb 12 16:25:47 bbv1 ptp4l[23822]: ptp4l[6266.063]: rms 7 max 17 freq -101 +/- 160 delay 1184 +/- 0
|
||||
Feb 12 16:25:46 bbv1 ptp4l[23822]: ptp4l[6264.940]: rms 7 max 17 freq -65 +/- 154 delay 1184 +/- 0
|
||||
Feb 12 16:25:45 bbv1 ptp4l[23822]: ptp4l[6263.817]: rms 1 max 2 freq +176 +/- 33 delay 1183 +/- 0
|
||||
Feb 12 16:25:44 bbv1 ptp4l[23822]: ptp4l[6262.695]: rms 0 max 1 freq +100 +/- 7 delay 1184 +/- 0
|
||||
Feb 12 16:25:43 bbv1 ptp4l[23822]: ptp4l[6261.572]: rms 1 max 2 freq +56 +/- 34 delay 1184 +/- 0
|
||||
Feb 12 16:25:41 bbv1 ptp4l[23822]: ptp4l[6260.449]: rms 1 max 1 freq -37 +/- 14 delay 1184 +/- 0
|
||||
Feb 12 16:25:40 bbv1 ptp4l[23822]: ptp4l[6259.326]: rms 7 max 16 freq +114 +/- 149 delay 1183 +/- 0
|
||||
}
|
||||
```
|
||||
|
||||
The OAI configuration file [`gnb.sa.band257.132prb.fhi72.2x2-microamp.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.132prb.fhi72.2x2-microamp.conf) corresponds to the following RU configuration:
|
||||
</details>
|
||||
|
||||
###### RU configuration
|
||||
|
||||
You can use `rucfg show` command to display the current RU configuration.
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
The OAI configuration file [`gnb.sa.band257.132prb.fhi72.2x2-microamp.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.132prb.fhi72.2x2-microamp.conf) corresponds to the following RU configuration:
|
||||
</summary>
|
||||
|
||||
```
|
||||
[INFO] Check if RU is available
|
||||
[INFO] RU available
|
||||
[INFO] Check SSH to RU available
|
||||
[INFO] SSH to RU available
|
||||
[INFO] Downloading oran_autostart
|
||||
[INFO] Downloading ructl_config.sh
|
||||
[INFO] Downloading udc_pll_configurator_startup
|
||||
[INFO] Downloaded Cellbox config =
|
||||
{
|
||||
eCPRI Compression: True
|
||||
RF Bandwidth: 200MHz
|
||||
CC Bandwidth: 200MHz
|
||||
CCs: 1
|
||||
LO frequency: 7.91642667e9
|
||||
UL compensation frequency: 28.04928e9
|
||||
DL compensation frequency: -28.04928e9
|
||||
RU MAC: 10:70:FD:B8:86:02
|
||||
DU MAC: 50:7C:6F:31:00:61
|
||||
TDD config: dddsu
|
||||
RF Power level: -5 dB - relative to maximum
|
||||
VLAN ORAN: Enabled, tag: 600
|
||||
VLAN PTP: Enabled, tag: 1
|
||||
VLAN MGMT: False
|
||||
Beamforming: dynamic-mirrored-beam
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
```bash
|
||||
[INFO] Check if RU is available
|
||||
[INFO] RU available
|
||||
[INFO] Check SSH to RU available
|
||||
[INFO] SSH to RU available
|
||||
[INFO] Downloading oran_autostart
|
||||
[INFO] Downloading ructl_config.sh
|
||||
[INFO] Downloading udc_pll_configurator_startup
|
||||
[INFO] Downloaded Cellbox config =
|
||||
{
|
||||
eCPRI Compression: True
|
||||
RF Bandwidth: 200MHz
|
||||
CC Bandwidth: 200MHz
|
||||
CCs: 1
|
||||
LO frequency: 7.91642667e9
|
||||
UL compensation frequency: 28.04928e9
|
||||
DL compensation frequency: -28.04928e9
|
||||
RU MAC: 10:70:FD:B8:86:02
|
||||
DU MAC: 50:7C:6F:31:00:61
|
||||
TDD config: dddsu
|
||||
RF Power level: -5 dB - relative to maximum
|
||||
VLAN ORAN: Enabled, tag: 600
|
||||
VLAN PTP: Enabled, tag: 1
|
||||
VLAN MGMT: False
|
||||
Beamforming: dynamic-mirrored-beam
|
||||
}
|
||||
```
|
||||
|
||||
Execute `rucfg config -h` to check how to configure the RU.
|
||||
|
||||
<details>
|
||||
<summary>Help output will be similar to:</summary>
|
||||
|
||||
```
|
||||
usage: rucfg config [-h] [-f frequency] [-b bandwidth] [-t TDD pattern] [-p RU Power]
|
||||
[--cc carrier components] [--compression compression] [--vlan-oran vlan-oran]
|
||||
[--vlan-ptp vlan-ptp] [--mac DU MAC address]
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
-f frequency, --freq frequency
|
||||
Sets the 5G NR frequency. Allowed range: 24.0-29.9 GHz, default: <no conf
|
||||
change>
|
||||
-b bandwidth, --bandwidth bandwidth
|
||||
Sets RF bandwidth 100/200 [MHz] per CC, default: <no conf change>
|
||||
-t TDD pattern, --tdd TDD pattern
|
||||
Sets TDD pattern DDDSU/DDSUU/DSUUU, default: <no conf change>
|
||||
-p RU Power, --power RU Power
|
||||
Sets Power in (0-100), default: <no conf change>
|
||||
--cc carrier components
|
||||
Sets number of carrier components 1/2, default: <no conf change>
|
||||
--compression compression
|
||||
Sets eCPRI compression True/False, default: <no conf change>
|
||||
--vlan-oran vlan-oran
|
||||
Sets ORAN VLAN to None or <TAG>, default: <no conf change>
|
||||
--vlan-ptp vlan-ptp Sets PTP VLAN to None or <TAG>, default: <no conf change>
|
||||
--mac DU MAC address Sets DU MAC address (where RU sends eCPRI packets), format
|
||||
AA:BB:CC:DD:EE:FF, default: <no conf change>
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
|
||||
You can also execute `rucfg stats` to show fronthaul statistics including on-time/late packet' counters.
|
||||
|
||||
|
||||
<details>
|
||||
<summary>Statistics output will be similar to:</summary>
|
||||
|
||||
```
|
||||
[INFO] Check if RU is available
|
||||
[INFO] RU available
|
||||
[INFO] Check SSH to RU available
|
||||
[INFO] SSH to RU available
|
||||
[INFO] Getting RU stats
|
||||
[WARN] Received non-zero rc from ructl: 255
|
||||
[INFO] ru stats =
|
||||
{
|
||||
Preaccumulator overflow detected
|
||||
ORAN RX C-plane on time: 5442384
|
||||
ORAN RX C-plane early: 0
|
||||
ORAN RX C-plane late: 4
|
||||
ORAN TX U-plane: 15908424
|
||||
ORAN RX DL C-plane on time: 3349166
|
||||
ORAN RX DL C-plane early: 0
|
||||
ORAN RX DL C-plane late: 0
|
||||
ORAN RX DL U-plane on time: 43538742
|
||||
ORAN RX DL U-plane early: 0
|
||||
ORAN RX DL U-plane late: 93
|
||||
ORAN RX UL C-plane on time: 2093218
|
||||
ORAN RX UL C-plane early: 0
|
||||
ORAN RX UL C-plane late: 4
|
||||
CLASSIFIER LLC: overflow protection: 0
|
||||
CLASSIFIER LLC: frame err: 0
|
||||
CLASSIFIER LLC: packet too long: 0
|
||||
CLASSIFIER LLC: dropped: 0
|
||||
CLASSIFIER LLC: passed: 49044133
|
||||
CLASSIFIER ETH: dst MAC addr err: 0
|
||||
CLASSIFIER ETH: VLAN LEGACY: 1524
|
||||
CLASSIFIER ETH: VLAN Dot1Q: 49042609
|
||||
CLASSIFIER ETH: VLAN Dot1AD: 0
|
||||
CLASSIFIER ETH: VLAN Tag ID pass: 48981223
|
||||
CLASSIFIER ETH: VLAN Tag ID error: 0
|
||||
CLASSIFIER ETH: multicast: 60260
|
||||
CLASSIFIER ETH: PTP: 56086
|
||||
CLASSIFIER ETH: eCPRI: 48981223
|
||||
CLASSIFIER ETH: to OS: 62910
|
||||
CLASSIFIER ETH: dropped: 0
|
||||
CLASSIFIER ETH: passed: 49044133
|
||||
CLASSIFIER ECPRI: prot rev unsupported: 0
|
||||
CLASSIFIER ECPRI: concat unsupported: 0
|
||||
CLASSIFIER ECPRI: msg type unsupported: 0
|
||||
CLASSIFIER ECPRI: pld size err: 0
|
||||
CLASSIFIER ECPRI: U-Plane: 43538835
|
||||
CLASSIFIER ECPRI: C-Plane: 5442388
|
||||
CLASSIFIER ECPRI: delay: 0
|
||||
CLASSIFIER ECPRI: dropped: 0
|
||||
CLASSIFIER ECPRI: passed: 48981223
|
||||
CPLANE PARSER: ul early: 0
|
||||
CPLANE PARSER: ul late: 4
|
||||
CPLANE PARSER: ul on time: 2093218
|
||||
CPLANE PARSER: dl early: 0
|
||||
CPLANE PARSER: dl late: 0
|
||||
CPLANE PARSER: dl on time: 3349166
|
||||
CPLANE PARSER: timing dropped: 4
|
||||
CPLANE PARSER: timing passed: 5442384
|
||||
CPLANE PARSER: bad du port id: 0
|
||||
CPLANE PARSER: bad bandsector id: 0
|
||||
CPLANE PARSER: bad cc id: 0
|
||||
CPLANE PARSER: bad ru port id: 0
|
||||
CPLANE PARSER: bad sequence id: 0
|
||||
CPLANE PARSER: bad e bit: 0
|
||||
CPLANE PARSER: bad subsequence id: 0
|
||||
CPLANE PARSER: ecpri transport header dropped: 0
|
||||
CPLANE PARSER: ecpri transport header passed: 5442384
|
||||
CPLANE PARSER: bad payloadversion: 0
|
||||
CPLANE PARSER: bad filterindex: 0
|
||||
CPLANE PARSER: bad subframeid: 0
|
||||
CPLANE PARSER: bad slotid: 0
|
||||
CPLANE PARSER: bad startsymbolid: 0
|
||||
CPLANE PARSER: bad numberofsections: 0
|
||||
CPLANE PARSER: bad sectiontype: 0
|
||||
CPLANE PARSER: bad timeoffset: 0
|
||||
CPLANE PARSER: bad fftsize: 0
|
||||
CPLANE PARSER: bad subcarrierspacing: 0
|
||||
CPLANE PARSER: bad cplength: 0
|
||||
CPLANE PARSER: bad udiqwidth: 0
|
||||
CPLANE PARSER: radio aplication header dropped: 0
|
||||
CPLANE PARSER: radio aplication header passed: 5442384
|
||||
CPLANE PARSER: bad rb: 0
|
||||
CPLANE PARSER: bad startprbc: 0
|
||||
CPLANE PARSER: bad numprbc: 0
|
||||
CPLANE PARSER: bad remask: 0
|
||||
CPLANE PARSER: bad numsymbol: 0
|
||||
CPLANE PARSER: bad ef: 0
|
||||
CPLANE PARSER: bad freqoffset: 0
|
||||
CPLANE PARSER: common section fields dropped: 0
|
||||
CPLANE PARSER: common section fields passed: 5442384
|
||||
CPLANE PARSER: bad section to symbol map: 0
|
||||
CPLANE PARSER: dropped: 0
|
||||
CPLANE PARSER: passed: 5442384
|
||||
UPLANE PARSER: sequence ID err: 0
|
||||
UPLANE PARSER: IQ pld size err: 0
|
||||
UPLANE PARSER: C-Plane match err: 7138
|
||||
UPLANE PARSER: eAxC ID unsupported: 0
|
||||
UPLANE PARSER: any value unsupported: 0
|
||||
UPLANE PARSER: dropped: 7231
|
||||
UPLANE PARSER: passed: 43531604
|
||||
UPLANE ENCAPSULATOR 0: false drop error: 0
|
||||
UPLANE ENCAPSULATOR 0: passed: 6698292
|
||||
UPLANE ENCAPSULATOR 1: false drop error: 0
|
||||
UPLANE ENCAPSULATOR 1: passed: 6698292
|
||||
UPLANE ENCAPSULATOR 2: false drop error: 0
|
||||
UPLANE ENCAPSULATOR 2: passed: 0
|
||||
UPLANE ENCAPSULATOR 3: false drop error: 0
|
||||
UPLANE ENCAPSULATOR 3: passed: 0
|
||||
COMMON COMMON: symbol counter: 111095058
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
#### VVDN LPRU
|
||||
|
||||
**Version 3.x**
|
||||
@@ -844,6 +1246,42 @@ sudo ./ru_emulator -c <path-to/protoru-OAI-B210-TDD-n78-40MHz-1x1-30kHz.yml>
|
||||
|
||||
Finally, start the OAI gNB.
|
||||
|
||||
#### WNC R1220
|
||||
|
||||
**Version 1.9.0**
|
||||
|
||||
The OAI configuration file [gnb.sa.band77.273prb.fhi72.4x4-wnc.conf](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-wnc.conf) corresponds to:
|
||||
|
||||
- TDD pattern `DDDDDDSUUU`, 5ms
|
||||
- Bandwidth 100MHz
|
||||
- 4TX4R
|
||||
|
||||
##### RU configuration
|
||||
|
||||
After switching on or rebooting the RU, you can check the RU PTP status with `show ptp clock` to make sure it's locked and run `show running-config` to check the current configuration.
|
||||
To enable RU transmission, use the `radio enable` command. Then verify the configuration with `show running-config`, which should reflect the enabled state:
|
||||
```
|
||||
radio 1
|
||||
no shutdown
|
||||
```
|
||||
|
||||
The required parameters to configure are:
|
||||
|
||||
1. `center-frequency` → 3849990
|
||||
2. `transmit-power` → 24
|
||||
3. `lna-shutdown` → **disabled**
|
||||
4. `transport-interface` → configure the sub-interface (VLAN ID is defined during sub-interface creation)
|
||||
5. `transport-peer-mac` → must match the DU MAC address
|
||||
6. `phase-compensation` → **enabled**
|
||||
7. `bandwidth` → 100
|
||||
8. `sub-carrier` → 30
|
||||
9. `compress-oran-compliant` → **enabled**
|
||||
|
||||
**Note**
|
||||
* Ensure that the VLAN configuration and MAC addressing are consistent with the DU setup.
|
||||
* The RU must be PTP synchronized before starting the gNB.
|
||||
* After reboot, the RU loads its `startup-config`. To save the current configuration, use `copy running-config startup-config`.
|
||||
|
||||
## Configure Network Interfaces and DPDK VFs
|
||||
|
||||
The 7.2 fronthaul uses the xran library, which requires DPDK. In this step, we
|
||||
@@ -1495,7 +1933,9 @@ sudo ldconfig
|
||||
If you would like to install these libraries in the custom path, please replace `/usr/local` default path to e.g. `/opt/mplane-v2`.
|
||||
|
||||
## Benetel O-RU
|
||||
Note: RAN550/650 v1.2.2 and v1.4.1 have been successfully tested.
|
||||
Note: RAN550-1v2.1.0-M-0820797 has been successfully tested.
|
||||
|
||||
We added a [CI M-plane pipeline](https://jenkins-oai.eurecom.fr/job/RAN-SA-FHI72-MPLANE-CN5G/) showcasing the M-plane integration.
|
||||
|
||||
#### One time steps
|
||||
Connect to the RU as user `root`, enable the mplane service, and reboot:
|
||||
|
||||
@@ -247,6 +247,242 @@ RRCReestablishmentRequest), the CU updates `du_assoc_id` and sets
|
||||
`f1_ue_context_active` is false, the CU triggers UE Context Setup on the new
|
||||
DU per TS 38.401 §8.7.
|
||||
|
||||
### PDU Session Management
|
||||
|
||||
#### PDU Session Modification
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant UE
|
||||
participant DU
|
||||
participant CUCP as CU-CP
|
||||
participant CUUP as CU-UP
|
||||
participant AMF
|
||||
|
||||
AMF->>CUCP: PDUSessionResourceModifyRequest
|
||||
Note over CUCP: ngap_gNB_handle_pdusession_modify_request
|
||||
CUCP->>CUCP: decodePDUSessionResourceModify
|
||||
CUCP->>CUCP: NGAP_PDUSESSION_MODIFY_REQ
|
||||
CUCP->>CUCP: rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ
|
||||
opt UE not found or AMF_UE_ID mismatch
|
||||
CUCP->>AMF: NGAP_PDUSESSION_MODIFY_RESP (Failed PDU Session)
|
||||
Note over CUCP: stop further processing
|
||||
end
|
||||
|
||||
loop nb_pdusessions_tomodify
|
||||
CUCP->>CUCP: Update PDU session DRB/QoS configuration<br/>(add/modify/release)
|
||||
end
|
||||
|
||||
alt !all_failed
|
||||
Note over CUCP: Pre-RRC step: E1/F1 updates
|
||||
Note over CUCP: Build E1AP DRB-To-Remove/To-Modify/To-Setup lists<br/>(populated during nr_rrc_update_pdusession)
|
||||
CUCP->>CUUP: E1 BEARER CONTEXT MOD REQUEST (DRB-To-Remove/To-Modify/To-Setup)
|
||||
Note over CUUP: e1_bearer_context_modif()<br/>Process DRB modifications, removals, and setups<br/>Update PDCP/SDAP entities, GTP tunnels
|
||||
CUUP->>CUCP: E1 BEARER CONTEXT MOD RESPONSE
|
||||
Note over CUCP: rrc_gNB_process_e1_bearer_context_modif_resp<br/>Save F1-U tunnel info for new DRBs<br/>Mark PDU sessions with new DRBs as PDU_SESSION_STATUS_NEW
|
||||
Note over CUCP, DU: F1-U tunnel changes (new DRBs or DRB releases)
|
||||
CUCP->>DU: F1 UE Context Modification Request
|
||||
Note over DU: handle_ue_context_drbs_setup/release
|
||||
DU->>CUCP: F1 UE Context Modification Response
|
||||
Note over CUCP: rrc_CU_process_ue_context_modification_response
|
||||
CUCP->>CUCP: rrc_gNB_generate_dedicatedRRCReconfiguration
|
||||
|
||||
Note over CUCP: <br/>Attach DRB_ToReleaseList (if any)<br/>Set transaction ID to RRC_PDUSESSION_MODIFY
|
||||
CUCP->>DU: rrc_deliver_dl_rrc_message
|
||||
DU->>UE: RRCReconfiguration (DCCH)
|
||||
UE->>DU: RRCReconfigurationComplete
|
||||
DU->>CUCP: F1AP_UL_RRC_MESSAGE
|
||||
Note over CUCP: rrc_gNB_decode_dcch
|
||||
Note over CUCP: handle_rrcReconfigurationComplete<br/>Calls rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP<br/>(DRBs already removed earlier in nr_rrc_update_pdusession)
|
||||
|
||||
CUCP->>CUCP: rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP
|
||||
loop UE->pduSessions (matching transaction ID)
|
||||
alt ESTABLISHED
|
||||
Note over CUCP: Update status to ESTABLISHED<br/>Fill NGAP message (modified)<br/>Include QoS flow list
|
||||
else PDU_SESSION_STATUS_FAILED
|
||||
Note over CUCP: Fill NGAP message (failed to modify)<br/>Include cause
|
||||
end
|
||||
end
|
||||
CUCP->>AMF: NGAP_PDUSESSION_MODIFY_RESP
|
||||
else msg->nb_of_pdusessions_failed > 0
|
||||
Note over CUCP: PDU Session failed to modify
|
||||
CUCP->>AMF: NGAP_PDUSESSION_MODIFY_RESP
|
||||
end
|
||||
```
|
||||
|
||||
#### PDU Session Release
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant AMF
|
||||
participant CUCP
|
||||
participant CUUP
|
||||
participant DU
|
||||
participant UE
|
||||
AMF->>CUCP: NG PDU SESSION RESOURCE RELEASE COMMAND
|
||||
Note over CUCP: ngap_gNB_handle_pdusession_release_command
|
||||
CUCP->>CUCP: rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND
|
||||
Note over CUCP: set status PDU_SESSION_STATUS_TORELEASE
|
||||
CUCP->>CUUP: E1 Bearer Context Modification Request
|
||||
Note over CUUP: release_gtpu_tunnel (GTP tunnel, PDCP, SDAP)
|
||||
CUUP->>CUCP: E1 Bearer Context Modification Response
|
||||
Note over CUCP: rrc_send_f1_ue_context_modification_request
|
||||
CUCP->>DU: F1 UE Context Modification Request
|
||||
Note over DU: handle_ue_context_drbs_release (release in MAC/RLC)
|
||||
DU->>CUCP: F1 UE Context Modification Response
|
||||
Note over CUCP: rrc_CU_process_ue_context_modification_response
|
||||
Note over CUCP: replace existing CellGroupConfig
|
||||
Note over CUCP: rrc_gNB_generate_dedicatedRRCReconfiguration
|
||||
CUCP->>UE: RRCReconfiguration (DRB release list, NAS PDU)
|
||||
UE->>CUCP: RRCReconfigurationComplete
|
||||
Note over CUCP: handle_rrcReconfigurationComplete
|
||||
Note over CUCP: rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE
|
||||
CUCP->>AMF: NG PDU SESSION RESOURCE RELEASE RESPONSE
|
||||
Note over CUCP: rm_drbs_by_pdusession (from stored RRC list)
|
||||
Note over CUCP: rm_pduSession (from stored RRC list)
|
||||
```
|
||||
|
||||
### QoS Flows Handling
|
||||
|
||||
This section describes the end-to-end handling of QoS flows in the OAI 5G SA implementation. QoS flows are
|
||||
the finest granularity of QoS differentiation in 5G systems. According to 3GPP specs, each PDU session can
|
||||
contain multiple QoS flows (maximum 64). Each QoS flow is mapped to exactly one Data Radio Bearer (DRB)
|
||||
within the gNB, but multiple QoS flows can be mapped to the same DRB. The mapping is determined by the
|
||||
CU-CP and configured in the CU-UP via E1AP, and in the UE via RRC signaling. Each PDU session is mapped
|
||||
to a SDAP entity and can contain multiple DRBs, each of which may carry multiple QoS flows.
|
||||
|
||||
Key Standards:
|
||||
- 3GPP TS 23.501: 5G System Architecture (6.2.5, Quality of service)
|
||||
- 3GPP TS 37.324: SDAP Protocol (QoS flow to DRB mapping, 5.3)
|
||||
- 3GPP TS 38.463: E1AP (Bearer Context Management with QoS flows)
|
||||
- 3GPP TS 29.281: GTP-U (QFI marking)
|
||||
- 3GPP TS 38.331: RRC (Radio Bearer Configuration)
|
||||
|
||||
Trigger: PDU Session Establishment or Modification from 5G Core (AMF/SMF)
|
||||
|
||||
The PDU session setup flow in OAI begins when the gNB receives an NGAP PDU Session Resource Setup Request
|
||||
from the AMF, containing session parameters and QoS flow information. These flows are stored in the UE
|
||||
context and passed to the RRC layer, which maps each QoS flow to a DRB and prepares the E1AP Bearer
|
||||
Context Setup Request for the CU-UP. The CU-UP then creates the corresponding PDCP and SDAP bearers,
|
||||
establishes F1-U and N3 GTP-U tunnels, and returns a Bearer Context Setup Response. The GTP-U layer stores
|
||||
QFI-to-DRB mappings for tunnel management, while the SDAP layer maintains QFI-to-DRB tables for both
|
||||
uplink and downlink packet routing.
|
||||
|
||||
During data transfer, uplink packets are demultiplexed using the QFI from the GTP-U header, and downlink
|
||||
packets are marked with their QFI before being sent to the UPF, ensuring consistent QoS-based traffic
|
||||
handling end-to-end.
|
||||
|
||||
#### CU-CP QoS-flow to DRB mapping
|
||||
|
||||
The QoS-flow-to-DRB algorithm runs in the CU-CP (RRC) when flows are added or updated (for example
|
||||
`nr_rrc_add_bearers`, `nr_rrc_assign_drb_to_qos_flow`, and `nr_rrc_find_suitable_drb_for_qos` in
|
||||
`openair2/RRC/NR/rrc_gNB_radio_bearers.c`). E1AP does not implement this policy: Bearer Context
|
||||
Setup/Modification simply carries the resulting PDU sessions, DRB lists, and QoS flows per DRB that RRC
|
||||
already chose.
|
||||
|
||||
The mapping is OAI-specific (3GPP defines that the gNB may map multiple QoS flows to one DRB but does
|
||||
not mandate these numeric caps).
|
||||
|
||||
DRB assignment uses a QoS-aware multiplexing strategy from standardized 5QI where available:
|
||||
|
||||
- Dedicated DRBs (one QoS flow per DRB in practice for these classes):
|
||||
- Delay-critical GBR (5QI 82–90): each such flow triggers a new DRB, existing DRBs that already carry
|
||||
DC-GBR are not reused for other flows.
|
||||
- Other flows treated as isolated: 5QI 4, 6, 7, 8, 9, 10, 70, 80, and 71-73.
|
||||
|
||||
- Multiplexed DRBs (when the new flow is not in the dedicated set, and reuse is allowed on a PDU session):
|
||||
- Non-delay-critical GBR flows: up to 2 QoS flows per DRB.
|
||||
- Non-GBR flows: up to 5 QoS flows per DRB.
|
||||
- Aggregate cap: at most 5 QoS flows per DRB in total (mixed GBR/non-GBR counts).
|
||||
|
||||
Per-DRB counting uses resource-type buckets (DC-GBR, GBR, non-GBR) derived from 3GPP TS 23.501
|
||||
table 5.7.4-1 (standardized 5QI).
|
||||
|
||||
Dynamic 5QI without a numeric 5QI: OAI uses a conservative heuristic (packet delay budget, packet
|
||||
error rate, and QoS priority thresholds) to decide whether the flow must use a new dedicated DRB or
|
||||
may share an existing DRB. That path is independent of the static 5QI lists above.
|
||||
|
||||
#### Sequence Diagram
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant UE
|
||||
participant DU
|
||||
participant CUCP as CU-CP
|
||||
participant CUUP as CU-UP
|
||||
participant AMF
|
||||
participant UPF
|
||||
|
||||
AMF->>CUCP: NGAP PDU Session Resource Setup Request
|
||||
Note over CUCP: QoS flows, QoS profile (e.g. 5QI, ARP, GFBR/MFBR)<br/>and N3 UP tunnel info
|
||||
Note over CUCP: ngap_gNB_handle_pdusession_setup_request<br/>ITTI to RRC
|
||||
CUCP->>CUCP: rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ
|
||||
CUCP->>CUCP: nr_rrc_add_bearers
|
||||
Note over CUCP: QoS-flow-to-DRB mapping
|
||||
CUCP->>CUCP: trigger_bearer_setup
|
||||
Note over CUCP: fill_e1_pdusession_to_setup / fill_e1_drb_to_setup<br/>per DRB (QoS flows, SDAP/PDCP)
|
||||
|
||||
Note over CUCP,CUUP: BEARER CONTEXT SETUP
|
||||
CUCP->>CUUP: E1AP Bearer Context Setup Request
|
||||
|
||||
Note over CUUP: e1_bearer_context_setup()
|
||||
loop Per PDU session
|
||||
loop Each DRB to setup
|
||||
CUUP->>CUUP: fill_e1_drb_setup
|
||||
CUUP->>CUUP: fill_e1_qos_flows_setup
|
||||
Note over CUUP: Copy QFIs from E1 request into E1 setup response
|
||||
Note over CUUP: f1_drb_gtpu_create<br/>gtpv1u_create_ngu_tunnel<br/>no QFI in F1-U GTP, one tunnel per DRB
|
||||
end
|
||||
CUUP->>CUUP: e1_add_bearers
|
||||
Note over CUUP: nr_sdap_addmod_entity, nr_pdcp_add_drb<br/>SDAP qfi2drb mapping
|
||||
CUUP->>CUUP: n3_gtpu_create
|
||||
Note over CUUP: gtpv1u_create_ngu_tunnel<br/>newGtpuCreateTunnel<br/>one N3 tunnel per PDU session
|
||||
end
|
||||
CUUP->>CUCP: E1AP Bearer Context Setup Response
|
||||
Note over CUCP,CUUP: F1-U TEID/addr per DRB
|
||||
Note over CUUP: N3 TEID (CU-UP) per PDU session
|
||||
|
||||
CUCP->>CUCP: rrc_gNB_process_e1_bearer_context_setup_resp
|
||||
alt First F1 UE context (!f1_ue_context_active)
|
||||
CUCP->>DU: F1 UE Context Setup Request
|
||||
Note over CUCP: rrc_f1_ue_context_setup_from_e1_response
|
||||
else F1 context already active
|
||||
CUCP->>DU: F1 UE Context Modification Request
|
||||
Note over CUCP: rrc_send_f1_ue_context_modification_request
|
||||
end
|
||||
Note over DU: handle_ue_context_drbs_setup<br/>QoS from F1 flows -> MAC logical channel config
|
||||
DU->>CUCP: F1 UE Context Setup or Modification Response
|
||||
|
||||
CUCP->>CUCP: rrc_gNB_generate_dedicatedRRCReconfiguration
|
||||
Note over CUCP: DRB-ToAddModList, SDAP-Config (QFI mapping)
|
||||
CUCP->>DU: rrc_deliver_dl_rrc_message / DL RRC Message Transfer
|
||||
DU->>UE: RRCReconfiguration (DCCH)
|
||||
|
||||
UE->>DU: RRCReconfigurationComplete
|
||||
DU->>CUCP: UL RRC Message Transfer (F1AP)
|
||||
Note over CUCP: rrc_gNB_decode_dcch, handle_rrcReconfigurationComplete
|
||||
|
||||
CUCP->>AMF: NGAP PDU Session Resource Setup Response
|
||||
|
||||
Note over UPF,UE: ===== Data Plane Active ===== (N3/F1-U)
|
||||
|
||||
Note over UPF,UE: DOWNLINK (N3 -> CU-UP)
|
||||
UPF->>CUUP: GTP-U with PDU Session Container (QFI)
|
||||
Note over CUUP: Gtpv1uHandleGpdu<br/>parse ext hdr -> QFI
|
||||
Note over CUUP: sdap_data_req<br/>SDAP qfi2drb_table -> DRB
|
||||
Note over CUUP: nr_pdcp_data_req_drb
|
||||
CUUP->>DU: F1-U GTP-U (no PDU Session Container / QFI marking)
|
||||
DU->>UE: DRB
|
||||
|
||||
Note over UE,UPF: UPLINK (CU-UP -> N3 UPF)
|
||||
UE->>DU: DRB
|
||||
DU->>CUUP: F1-U GTP-U (no QFI marking)
|
||||
Note over CUUP: PDCP -> SDAP UL RX
|
||||
Note over CUUP: QFI from SDAP UL header if configured<br/>else gtpv1uSendDirect (no QFI in GTP ext hdr)
|
||||
Note over CUUP: nr_sdap / gtpv1uSendDirectWithQFI<br/>bearer_id = PDU session id (N3 tunnel key)
|
||||
CUUP->>UPF: GTP-U PDU Session Container (UL PDU Session Info, QFI)
|
||||
```
|
||||
|
||||
### Inter-DU Handover (F1)
|
||||
|
||||
The basic handover (HO) structure is as follows. In order to support various
|
||||
|
||||
@@ -241,6 +241,12 @@ information on how the images are built.
|
||||
~5G-NR ~nrUE
|
||||
- 5G-NR SA test setup: OAI VNF + PNF/NVIDIA CUBB on gracehopper1-oai + WNC RU, OAIUE on jetson1-oai + B210, OAI CN5G
|
||||
- OpenShift cluster for CN deployment and container images for gNB and UE deployment
|
||||
- [RAN-SA-FHI72-MPLANE-CN5G](https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-SA-FHI72-MPLANE-CN5G/)
|
||||
~5G-NR
|
||||
- cacofonix + FHI72 + Benetel550 (gNB), AmarisoftUE, OAI CN5G
|
||||
- OpenShift cluster for CN deployment
|
||||
- FHI 7.2 testing with 40 MHz, 4x4 MIMO configuration and 100 MHz, 2x2 MIMO configuration
|
||||
- FHI 7.2 Configuration and Performance Management via NETCONF session of an O-RU
|
||||
|
||||
### RAN-CI-NSA-Trigger
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ services:
|
||||
ipv4_address: 192.168.70.139
|
||||
oai-udr:
|
||||
container_name: "oai-udr"
|
||||
image: oaisoftwarealliance/oai-udr:develop
|
||||
image: oaisoftwarealliance/oai-udr:v2.2.1
|
||||
expose:
|
||||
- 80/tcp
|
||||
- 8080/tcp
|
||||
@@ -52,7 +52,7 @@ services:
|
||||
ipv4_address: 192.168.70.136
|
||||
oai-udm:
|
||||
container_name: "oai-udm"
|
||||
image: oaisoftwarealliance/oai-udm:develop
|
||||
image: oaisoftwarealliance/oai-udm:v2.2.1
|
||||
expose:
|
||||
- 80/tcp
|
||||
- 8080/tcp
|
||||
@@ -67,7 +67,7 @@ services:
|
||||
ipv4_address: 192.168.70.137
|
||||
oai-ausf:
|
||||
container_name: "oai-ausf"
|
||||
image: oaisoftwarealliance/oai-ausf:develop
|
||||
image: oaisoftwarealliance/oai-ausf:v2.2.1
|
||||
expose:
|
||||
- 80/tcp
|
||||
- 8080/tcp
|
||||
@@ -82,7 +82,7 @@ services:
|
||||
ipv4_address: 192.168.70.138
|
||||
oai-nrf:
|
||||
container_name: "oai-nrf"
|
||||
image: oaisoftwarealliance/oai-nrf:develop
|
||||
image: oaisoftwarealliance/oai-nrf:v2.2.1
|
||||
expose:
|
||||
- 80/tcp
|
||||
- 8080/tcp
|
||||
@@ -95,7 +95,7 @@ services:
|
||||
ipv4_address: 192.168.70.130
|
||||
oai-amf:
|
||||
container_name: "oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:develop
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
expose:
|
||||
- 80/tcp
|
||||
- 8080/tcp
|
||||
@@ -113,8 +113,8 @@ services:
|
||||
ipv4_address: 192.168.70.132
|
||||
oai-lmf:
|
||||
container_name: "oai-lmf"
|
||||
image: oaisoftwarealliance/oai-lmf:develop
|
||||
#image: oai-lmf:psoElementwiseTdoAmeanVarTDoAfilter
|
||||
image: oaisoftwarealliance/oai-lmf:v2.2.1
|
||||
#image: oai-lmf:psoElementwiseTdoAmeanVarTDoAfilter
|
||||
expose:
|
||||
- 80/tcp
|
||||
- 8080/tcp
|
||||
@@ -131,7 +131,7 @@ services:
|
||||
ipv4_address: 192.168.70.141
|
||||
oai-smf:
|
||||
container_name: "oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:develop
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
expose:
|
||||
- 80/tcp
|
||||
- 8080/tcp
|
||||
@@ -148,7 +148,7 @@ services:
|
||||
ipv4_address: 192.168.70.133
|
||||
oai-upf:
|
||||
container_name: "oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:develop
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
expose:
|
||||
- 2152/udp
|
||||
- 8805/udp
|
||||
|
||||
@@ -36,7 +36,7 @@ services:
|
||||
ipv4_address: 192.168.70.139
|
||||
oai-udr:
|
||||
container_name: "oai-udr"
|
||||
image: oaisoftwarealliance/oai-udr:develop
|
||||
image: oaisoftwarealliance/oai-udr:v2.2.1
|
||||
expose:
|
||||
- 80/tcp
|
||||
- 8080/tcp
|
||||
@@ -52,7 +52,7 @@ services:
|
||||
ipv4_address: 192.168.70.136
|
||||
oai-udm:
|
||||
container_name: "oai-udm"
|
||||
image: oaisoftwarealliance/oai-udm:develop
|
||||
image: oaisoftwarealliance/oai-udm:v2.2.1
|
||||
expose:
|
||||
- 80/tcp
|
||||
- 8080/tcp
|
||||
@@ -67,7 +67,7 @@ services:
|
||||
ipv4_address: 192.168.70.137
|
||||
oai-ausf:
|
||||
container_name: "oai-ausf"
|
||||
image: oaisoftwarealliance/oai-ausf:develop
|
||||
image: oaisoftwarealliance/oai-ausf:v2.2.1
|
||||
expose:
|
||||
- 80/tcp
|
||||
- 8080/tcp
|
||||
@@ -82,7 +82,7 @@ services:
|
||||
ipv4_address: 192.168.70.138
|
||||
oai-nrf:
|
||||
container_name: "oai-nrf"
|
||||
image: oaisoftwarealliance/oai-nrf:develop
|
||||
image: oaisoftwarealliance/oai-nrf:v2.2.1
|
||||
expose:
|
||||
- 80/tcp
|
||||
- 8080/tcp
|
||||
@@ -95,7 +95,7 @@ services:
|
||||
ipv4_address: 192.168.70.130
|
||||
oai-amf:
|
||||
container_name: "oai-amf"
|
||||
image: oaisoftwarealliance/oai-amf:develop
|
||||
image: oaisoftwarealliance/oai-amf:v2.2.1
|
||||
expose:
|
||||
- 80/tcp
|
||||
- 8080/tcp
|
||||
@@ -113,7 +113,7 @@ services:
|
||||
ipv4_address: 192.168.70.132
|
||||
oai-smf:
|
||||
container_name: "oai-smf"
|
||||
image: oaisoftwarealliance/oai-smf:develop
|
||||
image: oaisoftwarealliance/oai-smf:v2.2.1
|
||||
expose:
|
||||
- 80/tcp
|
||||
- 8080/tcp
|
||||
@@ -130,7 +130,7 @@ services:
|
||||
ipv4_address: 192.168.70.133
|
||||
oai-upf:
|
||||
container_name: "oai-upf"
|
||||
image: oaisoftwarealliance/oai-upf:develop
|
||||
image: oaisoftwarealliance/oai-upf:v2.2.1
|
||||
expose:
|
||||
- 2152/udp
|
||||
- 8805/udp
|
||||
|
||||
@@ -22,13 +22,50 @@ RUN apt-get update && \
|
||||
xz-utils \
|
||||
pkg-config \
|
||||
libnuma-dev \
|
||||
python3-pyelftools && \
|
||||
python3-pyelftools \
|
||||
libpcre3-dev \
|
||||
libssh-dev \
|
||||
libxml2-dev \
|
||||
libpam0g \
|
||||
libnuma-dev && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN rm -Rf /oai-ran
|
||||
WORKDIR /oai-ran
|
||||
COPY . .
|
||||
|
||||
RUN git clone https://github.com/CESNET/libyang.git && \
|
||||
cd libyang && \
|
||||
git checkout v2.1.111 && \
|
||||
mkdir build && cd build && \
|
||||
cmake -DENABLE_TESTS=OFF \
|
||||
-DENABLE_VALGRIND_TESTS=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
||||
-DCMAKE_INSTALL_RPATH=/usr/local/lib \
|
||||
-DPLUGINS_DIR=/usr/local/lib/libyang \
|
||||
-DPLUGINS_DIR_EXTENSIONS=/usr/local/lib/libyang/extensions \
|
||||
-DPLUGINS_DIR_TYPES=/usr/local/lib/libyang/types \
|
||||
-DYANG_MODULE_DIR=/usr/local/share/yang/modules/libyang .. && \
|
||||
make && \
|
||||
make install
|
||||
|
||||
RUN git clone https://github.com/CESNET/libnetconf2.git && \
|
||||
cd libnetconf2 && \
|
||||
git checkout v2.1.37 && \
|
||||
mkdir build && cd build && \
|
||||
cmake -DENABLE_TESTS=OFF \
|
||||
-DENABLE_EXAMPLES=OFF \
|
||||
-DENABLE_VALGRIND_TESTS=OFF \
|
||||
-DCLIENT_SEARCH_DIR=/usr/local/share/yang/modules \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
||||
-DCMAKE_INSTALL_RPATH=/usr/local/lib \
|
||||
-DLIBYANG_INCLUDE_DIR=/usr/local/include \
|
||||
-DLIBYANG_LIBRARY=/usr/local/lib/libyang.so \
|
||||
-DLY_VERSION_PATH=/usr/local/include \
|
||||
-DYANG_MODULE_DIR=/usr/local/share/yang/modules/libnetconf2 .. && \
|
||||
make && \
|
||||
make install
|
||||
|
||||
## Download and build DPDK
|
||||
RUN wget --no-verbose http://fast.dpdk.org/rel/dpdk-24.11.4.tar.xz && \
|
||||
tar -xf dpdk-24.11.4.tar.xz && \
|
||||
@@ -53,7 +90,7 @@ RUN /bin/sh oaienv && \
|
||||
./build_oai \
|
||||
--ninja --gNB --nrRU \
|
||||
--build-lib "telnetsrv enbscope uescope nrscope" \
|
||||
-t oran_fhlib_5g --cmake-opt -Dxran_LOCATION=/opt/phy/fhi_lib/lib \
|
||||
-t oran_fhlib_5g_mplane --cmake-opt -Dxran_LOCATION=/opt/phy/fhi_lib/lib \
|
||||
--build-e2 --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION && \
|
||||
# Mainly to see if the sanitize option was perfectly executed
|
||||
ldd ran_build/build/nr-softmodem && \
|
||||
|
||||
@@ -57,7 +57,8 @@ COPY ./docker/scripts/check-prach-io.sh ./check-prach-io.sh
|
||||
|
||||
COPY --from=gnb-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/librfsimulator.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_transpro.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboran_fhlib_5g.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboran_fhlib_5g_mplane.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libcoding.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libparams_libconfig.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libdfts.so \
|
||||
@@ -65,7 +66,16 @@ COPY --from=gnb-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libtelnetsrv_ci.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libparams_yaml.so \
|
||||
/usr/local/lib/
|
||||
/usr/local/lib/libnetconf2.so \
|
||||
/usr/local/lib/libyang.so \
|
||||
/usr/local/lib
|
||||
|
||||
# default is CUS (no M plane)
|
||||
RUN ln -s /usr/local/lib/liboran_fhlib_5g.so /usr/local/lib/liboai_transpro.so
|
||||
|
||||
COPY --from=gnb-build \
|
||||
/oai-ran/radio/fhi_72/mplane/yang/models/ \
|
||||
/oai-ran/radio/fhi_72/mplane/yang/models/
|
||||
|
||||
## Libxran library
|
||||
COPY --from=gnb-build \
|
||||
|
||||
@@ -446,11 +446,6 @@ static void rx_rf(RU_t *ru, int *frame, int *slot)
|
||||
metadata mt = {.slot = *slot, .frame = *frame};
|
||||
gNBscopeCopyWithMetadata(ru, gNbTimeDomainSamples, rxp[0], sizeof(c16_t), 1, samples_per_slot, 0, &mt);
|
||||
|
||||
if (rxs != samples_per_slot) {
|
||||
//exit_fun( "problem receiving samples" );
|
||||
LOG_E(PHY, "problem receiving samples\n");
|
||||
}
|
||||
|
||||
stop_meas(&ru->rx_fhaul);
|
||||
}
|
||||
|
||||
@@ -864,7 +859,7 @@ void *ru_thread(void *param)
|
||||
}
|
||||
|
||||
LOG_I(PHY, "Starting IF interface for RU %d, nb_rx %d\n", ru->idx, ru->nb_rx);
|
||||
AssertFatal(ru->nr_start_if(ru, NULL) == 0, "Could not start the IF device\n");
|
||||
AssertFatal(ru->nr_start_if(ru) == 0, "Could not start the IF device\n");
|
||||
|
||||
} else if (ru->if_south == LOCAL_RF) { // configure RF parameters only
|
||||
ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
|
||||
@@ -1016,7 +1011,8 @@ int start_streaming(RU_t *ru) {
|
||||
return ru->ifdevice.thirdparty_startstreaming(&ru->ifdevice);
|
||||
}
|
||||
|
||||
int nr_start_if(struct RU_t_s *ru, struct PHY_VARS_gNB_s *gNB) {
|
||||
int nr_start_if(struct RU_t_s *ru)
|
||||
{
|
||||
if (ru->if_south <= REMOTE_IF5)
|
||||
for (int i = 0; i < ru->nb_rx; i++)
|
||||
ru->openair0_cfg.rxbase[i] = ru->common.rxdata[i];
|
||||
@@ -1024,11 +1020,13 @@ int nr_start_if(struct RU_t_s *ru, struct PHY_VARS_gNB_s *gNB) {
|
||||
return ru->ifdevice.trx_start_func(&ru->ifdevice);
|
||||
}
|
||||
|
||||
int start_rf(RU_t *ru) {
|
||||
int start_rf(RU_t *ru)
|
||||
{
|
||||
return(ru->rfdevice.trx_start_func(&ru->rfdevice));
|
||||
}
|
||||
|
||||
int stop_rf(RU_t *ru) {
|
||||
int stop_rf(RU_t *ru)
|
||||
{
|
||||
if (ru->rfdevice.trx_get_stats_func) {
|
||||
ru->rfdevice.trx_get_stats_func(&ru->rfdevice);
|
||||
}
|
||||
|
||||
@@ -19,11 +19,6 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#include "openair2/E2AP/flexric/src/agent/e2_agent_api.h"
|
||||
#include "openair2/E2AP/RAN_FUNCTION/init_ran_func.h"
|
||||
#endif
|
||||
|
||||
#ifdef E3_AGENT
|
||||
#include "openair2/E3AP/e3_agent.h"
|
||||
#endif
|
||||
|
||||
#include "nr-softmodem.h"
|
||||
#include <common/utils/assertions.h>
|
||||
#include <openair2/GNB_APP/gnb_app.h>
|
||||
@@ -75,6 +70,7 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#include "openair1/SCHED_NR/sched_nr.h"
|
||||
#include "openair2/SDAP/nr_sdap/nr_sdap.h"
|
||||
|
||||
RAN_CONTEXT_t RC;
|
||||
pthread_cond_t nfapi_sync_cond;
|
||||
pthread_mutex_t nfapi_sync_mutex;
|
||||
int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
|
||||
@@ -105,13 +101,6 @@ int chain_offset = 0;
|
||||
int numerology = 0;
|
||||
double cpuf;
|
||||
|
||||
/* hack: pdcp_run() is required by 4G scheduler which is compiled into
|
||||
* nr-softmodem because of linker issues */
|
||||
void pdcp_run(const protocol_ctxt_t *const ctxt_pP)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
unsigned int build_rflocal(int txi, int txq, int rxi, int rxq) {
|
||||
@@ -448,7 +437,7 @@ int start_L1L2(module_id_t gnb_id)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void wait_nfapi_init(char *thread_name)
|
||||
static void wait_nfapi_init()
|
||||
{
|
||||
pthread_mutex_lock( &nfapi_sync_mutex );
|
||||
|
||||
@@ -532,13 +521,6 @@ int main( int argc, char **argv ) {
|
||||
|
||||
softmodem_verify_mode(get_softmodem_params());
|
||||
|
||||
//////////////////////////////////
|
||||
//// Init the E3 Agent
|
||||
#ifdef E3_AGENT
|
||||
printf("Init E3 Agent\n");
|
||||
e3_init();
|
||||
#endif // E3_AGENT
|
||||
|
||||
#if T_TRACER
|
||||
T_Config_Init();
|
||||
#endif
|
||||
@@ -671,7 +653,7 @@ int main( int argc, char **argv ) {
|
||||
RC.gNB[idx]->if_inst->sl_ahead = sl_ahead;
|
||||
|
||||
if (NFAPI_MODE==NFAPI_MODE_PNF) {
|
||||
wait_nfapi_init("main?");
|
||||
wait_nfapi_init();
|
||||
}
|
||||
|
||||
if (IS_SOFTMODEM_IMSCOPE_ENABLED || IS_SOFTMODEM_IMSCOPE_RECORD_ENABLED) {
|
||||
@@ -745,11 +727,6 @@ int main( int argc, char **argv ) {
|
||||
|
||||
time_manager_finish();
|
||||
|
||||
#ifdef E3_AGENT
|
||||
printf("Destroy E3 Agent\n");
|
||||
e3_destroy();
|
||||
#endif // E3_AGENT
|
||||
|
||||
free(pckg);
|
||||
logClean();
|
||||
printf("Bye.\n");
|
||||
|
||||
@@ -186,11 +186,6 @@ static void set_fp_options(int cell_id, int ru_id)
|
||||
LOG_I(PHY, "Set UE nb_rx_antenna %d, nb_tx_antenna %d, threequarter_fs %d, ofdm_offset_divisor %d\n", fp->nb_antennas_rx, fp->nb_antennas_tx, fp->threequarter_fs, fp->ofdm_offset_divisor);
|
||||
}
|
||||
|
||||
// Stupid function addition because UE itti messages queues definition is common with eNB
|
||||
void *rrc_enb_process_msg(void *notUsed) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool stop_immediately = false;
|
||||
static void trigger_stop(int sig)
|
||||
{
|
||||
|
||||
@@ -155,7 +155,8 @@ void softmodem_verify_mode(const softmodem_params_t *p)
|
||||
AssertFatal(num_modes == 1, "--phy-test, --do-ra, and --nsa are mutually exclusive\n");
|
||||
}
|
||||
|
||||
void softmodem_printresources(int sig, telnet_printfunc_t pf) {
|
||||
static void softmodem_printresources(telnet_printfunc_t pf)
|
||||
{
|
||||
struct rusage usage;
|
||||
struct timespec stop;
|
||||
|
||||
@@ -163,7 +164,6 @@ void softmodem_printresources(int sig, telnet_printfunc_t pf) {
|
||||
|
||||
uint64_t elapse = (stop.tv_sec - start.tv_sec) ; // in seconds
|
||||
|
||||
|
||||
int st = getrusage(RUSAGE_SELF,&usage);
|
||||
if (!st) {
|
||||
pf("\nRun time: %lluh %llus\n",(unsigned long long)elapse/3600,(unsigned long long)(elapse - (elapse/3600)));
|
||||
@@ -195,7 +195,7 @@ void signal_handler(int sig) {
|
||||
exit(-1);
|
||||
} else {
|
||||
if(sig==SIGINT ||sig==SOFTMODEM_RTSIGNAL)
|
||||
softmodem_printresources(sig,(telnet_printfunc_t)printf);
|
||||
softmodem_printresources((telnet_printfunc_t)printf);
|
||||
if (sig != SOFTMODEM_RTSIGNAL) {
|
||||
printf("Linux signal %s...\n",strsignal(sig));
|
||||
exit_function(__FILE__, __FUNCTION__, __LINE__, "softmodem starting exit procedure\n", OAI_EXIT_NORMAL);
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
#include "stdint.h"
|
||||
#include "nfapi/open-nFAPI/fapi/inc/nr_fapi.h"
|
||||
|
||||
/* Number of bytes needed to hold n bits (ceiling division). */
|
||||
static inline uint16_t nr_bits_to_bytes(uint16_t bits)
|
||||
{
|
||||
return (bits + 7) / 8;
|
||||
}
|
||||
|
||||
bool eq_dl_tti_request(const nfapi_nr_dl_tti_request_t *a, const nfapi_nr_dl_tti_request_t *b);
|
||||
bool eq_ul_tti_request(const nfapi_nr_ul_tti_request_t *a, const nfapi_nr_ul_tti_request_t *b);
|
||||
bool eq_slot_indication(const nfapi_nr_slot_indication_scf_t *a, const nfapi_nr_slot_indication_scf_t *b);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
#include "nr_fapi.h"
|
||||
#include "nr_fapi_p7.h"
|
||||
#include "nr_fapi_p7_utils.h"
|
||||
#include "nr_nfapi_p7.h"
|
||||
#include "debug.h"
|
||||
|
||||
@@ -1805,7 +1806,7 @@ static uint8_t pack_nr_uci_pusch(void *tlv, uint8_t **ppWritePackedMsg, uint8_t
|
||||
return 0;
|
||||
if (!push16(value->harq.harq_bit_len, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
const uint16_t harq_len = (value->harq.harq_bit_len / 8) + 1;
|
||||
const uint16_t harq_len = nr_bits_to_bytes(value->harq.harq_bit_len);
|
||||
if (!pusharray8(value->harq.harq_payload, harq_len, harq_len, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
}
|
||||
@@ -1815,7 +1816,7 @@ static uint8_t pack_nr_uci_pusch(void *tlv, uint8_t **ppWritePackedMsg, uint8_t
|
||||
return 0;
|
||||
if (!push16(value->csi_part1.csi_part1_bit_len, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
const uint16_t csi_len = value->csi_part1.csi_part1_bit_len / 8 + 1;
|
||||
const uint16_t csi_len = nr_bits_to_bytes(value->csi_part1.csi_part1_bit_len);
|
||||
if (!pusharray8(value->csi_part1.csi_part1_payload, csi_len, csi_len, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
}
|
||||
@@ -1825,7 +1826,7 @@ static uint8_t pack_nr_uci_pusch(void *tlv, uint8_t **ppWritePackedMsg, uint8_t
|
||||
return 0;
|
||||
if (!push16(value->csi_part2.csi_part2_bit_len, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
const uint16_t csi_len = value->csi_part2.csi_part2_bit_len / 8 + 1;
|
||||
const uint16_t csi_len = nr_bits_to_bytes(value->csi_part2.csi_part2_bit_len);
|
||||
if (!pusharray8(value->csi_part2.csi_part2_payload, csi_len, csi_len, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
}
|
||||
@@ -1894,7 +1895,7 @@ static uint8_t pack_nr_uci_pucch_2_3_4(void *tlv, uint8_t **ppWritePackedMsg, ui
|
||||
if (value->pduBitmap & 0x01) { // SR
|
||||
if (!push16(value->sr.sr_bit_len, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
const uint16_t sr_len = value->sr.sr_bit_len / 8 + 1;
|
||||
const uint16_t sr_len = nr_bits_to_bytes(value->sr.sr_bit_len);
|
||||
if (!pusharray8(value->sr.sr_payload, sr_len, sr_len, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
}
|
||||
@@ -1904,7 +1905,7 @@ static uint8_t pack_nr_uci_pucch_2_3_4(void *tlv, uint8_t **ppWritePackedMsg, ui
|
||||
return 0;
|
||||
if (!push16(value->harq.harq_bit_len, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
const uint16_t harq_len = value->harq.harq_bit_len / 8 + 1;
|
||||
const uint16_t harq_len = nr_bits_to_bytes(value->harq.harq_bit_len);
|
||||
if (!pusharray8(value->harq.harq_payload, harq_len, harq_len, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
}
|
||||
@@ -1914,7 +1915,7 @@ static uint8_t pack_nr_uci_pucch_2_3_4(void *tlv, uint8_t **ppWritePackedMsg, ui
|
||||
return 0;
|
||||
if (!push16(value->csi_part1.csi_part1_bit_len, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
const uint16_t csi_len = value->csi_part1.csi_part1_bit_len / 8 + 1;
|
||||
const uint16_t csi_len = nr_bits_to_bytes(value->csi_part1.csi_part1_bit_len);
|
||||
if (!pusharray8(value->csi_part1.csi_part1_payload, csi_len, csi_len, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
}
|
||||
@@ -1924,7 +1925,7 @@ static uint8_t pack_nr_uci_pucch_2_3_4(void *tlv, uint8_t **ppWritePackedMsg, ui
|
||||
return 0;
|
||||
if (!push16(value->csi_part2.csi_part2_bit_len, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
const uint16_t csi_len = value->csi_part2.csi_part2_bit_len / 8 + 1;
|
||||
const uint16_t csi_len = nr_bits_to_bytes(value->csi_part2.csi_part2_bit_len);
|
||||
if (!pusharray8(value->csi_part2.csi_part2_payload, csi_len, csi_len, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
}
|
||||
@@ -2005,7 +2006,7 @@ static uint8_t unpack_nr_uci_pusch(nfapi_nr_uci_pusch_pdu_t *value, uint8_t **pp
|
||||
return 0;
|
||||
if (!pull16(ppReadPackedMsg, &value->harq.harq_bit_len, end))
|
||||
return 0;
|
||||
const uint16_t harq_len = value->harq.harq_bit_len / 8 + 1;
|
||||
const uint16_t harq_len = nr_bits_to_bytes(value->harq.harq_bit_len);
|
||||
value->harq.harq_payload = calloc(harq_len, sizeof(*value->harq.harq_payload));
|
||||
|
||||
if (value->harq.harq_payload == NULL) {
|
||||
@@ -2022,7 +2023,7 @@ static uint8_t unpack_nr_uci_pusch(nfapi_nr_uci_pusch_pdu_t *value, uint8_t **pp
|
||||
return 0;
|
||||
if (!pull16(ppReadPackedMsg, &value->csi_part1.csi_part1_bit_len, end))
|
||||
return 0;
|
||||
const uint16_t csi_len = value->csi_part1.csi_part1_bit_len / 8 + 1;
|
||||
const uint16_t csi_len = nr_bits_to_bytes(value->csi_part1.csi_part1_bit_len);
|
||||
value->csi_part1.csi_part1_payload = calloc(csi_len, sizeof(*value->csi_part1.csi_part1_payload));
|
||||
|
||||
if (value->csi_part1.csi_part1_payload == NULL) {
|
||||
@@ -2039,7 +2040,7 @@ static uint8_t unpack_nr_uci_pusch(nfapi_nr_uci_pusch_pdu_t *value, uint8_t **pp
|
||||
return 0;
|
||||
if (!pull16(ppReadPackedMsg, &value->csi_part2.csi_part2_bit_len, end))
|
||||
return 0;
|
||||
const uint16_t csi_len = value->csi_part2.csi_part2_bit_len / 8 + 1;
|
||||
const uint16_t csi_len = nr_bits_to_bytes(value->csi_part2.csi_part2_bit_len);
|
||||
value->csi_part2.csi_part2_payload = calloc(csi_len, sizeof(*value->csi_part2.csi_part2_payload));
|
||||
|
||||
if (value->csi_part2.csi_part2_payload == NULL) {
|
||||
@@ -2061,13 +2062,13 @@ static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t *valu
|
||||
&& pull8(ppReadPackedMsg, &value->ul_cqi, end) && pull16(ppReadPackedMsg, &value->timing_advance, end)
|
||||
&& pull16(ppReadPackedMsg, &value->rssi, end)))
|
||||
return 0;
|
||||
|
||||
if (value->pduBitmap & 0x01) { // SR
|
||||
if (!(pull8(ppReadPackedMsg, &value->sr.sr_indication, end) && pull8(ppReadPackedMsg, &value->sr.sr_confidence_level, end)))
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (((value->pduBitmap >> 1) & 0x01)) { // HARQ
|
||||
|
||||
if (!(pull8(ppReadPackedMsg, &value->harq.num_harq, end) && pull8(ppReadPackedMsg, &value->harq.harq_confidence_level, end)))
|
||||
return 0;
|
||||
if (value->harq.num_harq > 0) {
|
||||
@@ -2102,7 +2103,7 @@ static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t *
|
||||
if (value->pduBitmap & 0x01) { // SR
|
||||
if (!pull16(ppReadPackedMsg, &value->sr.sr_bit_len, end))
|
||||
return 0;
|
||||
const uint16_t sr_len = value->sr.sr_bit_len / 8 + 1;
|
||||
const uint16_t sr_len = nr_bits_to_bytes(value->sr.sr_bit_len);
|
||||
value->sr.sr_payload = calloc(sr_len, sizeof(*value->sr.sr_payload));
|
||||
|
||||
if (value->sr.sr_payload == NULL) {
|
||||
@@ -2119,7 +2120,7 @@ static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t *
|
||||
return 0;
|
||||
if (!pull16(ppReadPackedMsg, &value->harq.harq_bit_len, end))
|
||||
return 0;
|
||||
const uint16_t harq_len = value->harq.harq_bit_len / 8 + 1;
|
||||
const uint16_t harq_len = nr_bits_to_bytes(value->harq.harq_bit_len);
|
||||
value->harq.harq_payload = calloc(harq_len, sizeof(*value->harq.harq_payload));
|
||||
|
||||
if (value->harq.harq_payload == NULL) {
|
||||
@@ -2136,7 +2137,7 @@ static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t *
|
||||
return 0;
|
||||
if (!pull16(ppReadPackedMsg, &value->csi_part1.csi_part1_bit_len, end))
|
||||
return 0;
|
||||
const uint16_t csi_len = value->csi_part1.csi_part1_bit_len / 8 + 1;
|
||||
const uint16_t csi_len = nr_bits_to_bytes(value->csi_part1.csi_part1_bit_len);
|
||||
value->csi_part1.csi_part1_payload = calloc(csi_len, sizeof(*value->csi_part1.csi_part1_payload));
|
||||
|
||||
if (value->csi_part1.csi_part1_payload == NULL) {
|
||||
@@ -2153,7 +2154,7 @@ static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t *
|
||||
return 0;
|
||||
if (!pull16(ppReadPackedMsg, &value->csi_part2.csi_part2_bit_len, end))
|
||||
return 0;
|
||||
const uint16_t csi_len = value->csi_part2.csi_part2_bit_len / 8 + 1;
|
||||
const uint16_t csi_len = nr_bits_to_bytes(value->csi_part2.csi_part2_bit_len);
|
||||
value->csi_part2.csi_part2_payload = calloc(csi_len, sizeof(*value->csi_part2.csi_part2_payload));
|
||||
|
||||
if (value->csi_part2.csi_part2_payload == NULL) {
|
||||
|
||||
@@ -585,7 +585,7 @@ bool eq_crc_indication_CRC(const nfapi_nr_crc_t *a, const nfapi_nr_crc_t *b)
|
||||
EQ(a->tb_crc_status, b->tb_crc_status);
|
||||
EQ(a->num_cb, b->num_cb);
|
||||
if (a->num_cb > 0) {
|
||||
for (int cb = 0; cb < (a->num_cb / 8) + 1; ++cb) {
|
||||
for (int cb = 0; cb < nr_bits_to_bytes(a->num_cb); ++cb) {
|
||||
EQ(a->cb_crc_status[cb], b->cb_crc_status[cb]);
|
||||
}
|
||||
}
|
||||
@@ -618,7 +618,7 @@ bool eq_uci_indication_sr_pdu_0_1(const nfapi_nr_sr_pdu_0_1_t *a, const nfapi_nr
|
||||
bool eq_uci_indication_sr_pdu_2_3_4(const nfapi_nr_sr_pdu_2_3_4_t *a, const nfapi_nr_sr_pdu_2_3_4_t *b)
|
||||
{
|
||||
EQ(a->sr_bit_len, b->sr_bit_len);
|
||||
for (int i = 0; i < (a->sr_bit_len / 8) + 1; ++i) {
|
||||
for (int i = 0; i < nr_bits_to_bytes(a->sr_bit_len); ++i) {
|
||||
EQ(a->sr_payload[i], b->sr_payload[i]);
|
||||
}
|
||||
return true;
|
||||
@@ -638,7 +638,7 @@ bool eq_uci_indication_harq_pdu_2_3_4(const nfapi_nr_harq_pdu_2_3_4_t *a, const
|
||||
{
|
||||
EQ(a->harq_crc, b->harq_crc);
|
||||
EQ(a->harq_bit_len, b->harq_bit_len);
|
||||
for (int i = 0; i < (a->harq_bit_len / 8) + 1; ++i) {
|
||||
for (int i = 0; i < nr_bits_to_bytes(a->harq_bit_len); ++i) {
|
||||
EQ(a->harq_payload[i], b->harq_payload[i]);
|
||||
}
|
||||
return true;
|
||||
@@ -648,7 +648,7 @@ bool eq_uci_indication_csi_part1(const nfapi_nr_csi_part1_pdu_t *a, const nfapi_
|
||||
{
|
||||
EQ(a->csi_part1_crc, b->csi_part1_crc);
|
||||
EQ(a->csi_part1_bit_len, b->csi_part1_bit_len);
|
||||
for (int i = 0; i < (a->csi_part1_bit_len / 8) + 1; ++i) {
|
||||
for (int i = 0; i < nr_bits_to_bytes(a->csi_part1_bit_len); ++i) {
|
||||
EQ(a->csi_part1_payload[i], b->csi_part1_payload[i]);
|
||||
}
|
||||
return true;
|
||||
@@ -658,7 +658,7 @@ bool eq_uci_indication_csi_part2(const nfapi_nr_csi_part2_pdu_t *a, const nfapi_
|
||||
{
|
||||
EQ(a->csi_part2_crc, b->csi_part2_crc);
|
||||
EQ(a->csi_part2_bit_len, b->csi_part2_bit_len);
|
||||
for (int i = 0; i < (a->csi_part2_bit_len / 8) + 1; ++i) {
|
||||
for (int i = 0; i < nr_bits_to_bytes(a->csi_part2_bit_len); ++i) {
|
||||
EQ(a->csi_part2_payload[i], b->csi_part2_payload[i]);
|
||||
}
|
||||
return true;
|
||||
@@ -1583,7 +1583,7 @@ void copy_crc_indication_CRC(const nfapi_nr_crc_t *src, nfapi_nr_crc_t *dst)
|
||||
dst->tb_crc_status = src->tb_crc_status;
|
||||
dst->num_cb = src->num_cb;
|
||||
if (dst->num_cb > 0) {
|
||||
const uint16_t cb_len = (dst->num_cb / 8) + 1;
|
||||
const uint16_t cb_len = nr_bits_to_bytes(dst->num_cb);
|
||||
dst->cb_crc_status = calloc(cb_len, sizeof(uint8_t));
|
||||
for (int cb = 0; cb < cb_len; ++cb) {
|
||||
dst->cb_crc_status[cb] = src->cb_crc_status[cb];
|
||||
@@ -1641,7 +1641,7 @@ void copy_uci_indication_sr_pdu_0_1(const nfapi_nr_sr_pdu_0_1_t *src, nfapi_nr_s
|
||||
void copy_uci_indication_sr_pdu_2_3_4(const nfapi_nr_sr_pdu_2_3_4_t *src, nfapi_nr_sr_pdu_2_3_4_t *dst)
|
||||
{
|
||||
dst->sr_bit_len = src->sr_bit_len;
|
||||
const uint16_t sr_len = (dst->sr_bit_len / 8) + 1;
|
||||
const uint16_t sr_len = nr_bits_to_bytes(dst->sr_bit_len);
|
||||
dst->sr_payload = calloc(sr_len, sizeof(*dst->sr_payload));
|
||||
for (int i = 0; i < sr_len; ++i) {
|
||||
dst->sr_payload[i] = src->sr_payload[i];
|
||||
@@ -1661,7 +1661,7 @@ void copy_uci_indication_harq_pdu_2_3_4(const nfapi_nr_harq_pdu_2_3_4_t *src, nf
|
||||
{
|
||||
dst->harq_crc = src->harq_crc;
|
||||
dst->harq_bit_len = src->harq_bit_len;
|
||||
const uint16_t harq_length = (dst->harq_bit_len / 8) + 1;
|
||||
const uint16_t harq_length = nr_bits_to_bytes(dst->harq_bit_len);
|
||||
dst->harq_payload = calloc(harq_length, sizeof(*dst->harq_payload));
|
||||
for (int i = 0; i < harq_length; ++i) {
|
||||
dst->harq_payload[i] = src->harq_payload[i];
|
||||
@@ -1672,7 +1672,7 @@ void copy_uci_indication_csi_part1(const nfapi_nr_csi_part1_pdu_t *src, nfapi_nr
|
||||
{
|
||||
dst->csi_part1_crc = src->csi_part1_crc;
|
||||
dst->csi_part1_bit_len = src->csi_part1_bit_len;
|
||||
const uint16_t payload_length = (dst->csi_part1_bit_len / 8) + 1;
|
||||
const uint16_t payload_length = nr_bits_to_bytes(dst->csi_part1_bit_len);
|
||||
dst->csi_part1_payload = calloc(payload_length, sizeof(*dst->csi_part1_payload));
|
||||
for (int i = 0; i < payload_length; ++i) {
|
||||
dst->csi_part1_payload[i] = src->csi_part1_payload[i];
|
||||
@@ -1683,7 +1683,7 @@ void copy_uci_indication_csi_part2(const nfapi_nr_csi_part2_pdu_t *src, nfapi_nr
|
||||
{
|
||||
dst->csi_part2_crc = src->csi_part2_crc;
|
||||
dst->csi_part2_bit_len = src->csi_part2_bit_len;
|
||||
const uint16_t payload_length = (dst->csi_part2_bit_len / 8) + 1;
|
||||
const uint16_t payload_length = nr_bits_to_bytes(dst->csi_part2_bit_len);
|
||||
dst->csi_part2_payload = calloc(payload_length, sizeof(*dst->csi_part2_payload));
|
||||
for (int i = 0; i < payload_length; ++i) {
|
||||
dst->csi_part2_payload[i] = src->csi_part2_payload[i];
|
||||
@@ -1818,13 +1818,13 @@ size_t get_uci_indication_size(const nfapi_nr_uci_indication_t *msg)
|
||||
|
||||
// HARQ payload, CSI Part 1 and 2 are conditionally allocated
|
||||
if ((uci_pdu->pusch_pdu.pduBitmap >> 1) & 0x01) {
|
||||
total_size += uci_pdu->pusch_pdu.harq.harq_bit_len / 8 + 1;
|
||||
total_size += nr_bits_to_bytes(uci_pdu->pusch_pdu.harq.harq_bit_len);
|
||||
}
|
||||
if ((uci_pdu->pusch_pdu.pduBitmap >> 2) & 0x01) {
|
||||
total_size += uci_pdu->pusch_pdu.csi_part1.csi_part1_bit_len / 8 + 1;
|
||||
total_size += nr_bits_to_bytes(uci_pdu->pusch_pdu.csi_part1.csi_part1_bit_len);
|
||||
}
|
||||
if ((uci_pdu->pusch_pdu.pduBitmap >> 3) & 0x01) {
|
||||
total_size += uci_pdu->pusch_pdu.csi_part2.csi_part2_bit_len / 8 + 1;
|
||||
total_size += nr_bits_to_bytes(uci_pdu->pusch_pdu.csi_part2.csi_part2_bit_len);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1838,16 +1838,16 @@ size_t get_uci_indication_size(const nfapi_nr_uci_indication_t *msg)
|
||||
|
||||
// SR, HARQ, CSI Part 1, and CSI Part 2 are conditionally allocated
|
||||
if (uci_pdu->pucch_pdu_format_2_3_4.pduBitmap & 0x01) {
|
||||
total_size += uci_pdu->pucch_pdu_format_2_3_4.sr.sr_bit_len / 8 + 1;
|
||||
total_size += nr_bits_to_bytes(uci_pdu->pucch_pdu_format_2_3_4.sr.sr_bit_len);
|
||||
}
|
||||
if ((uci_pdu->pucch_pdu_format_2_3_4.pduBitmap >> 1) & 0x01) {
|
||||
total_size += uci_pdu->pucch_pdu_format_2_3_4.harq.harq_bit_len / 8 + 1;
|
||||
total_size += nr_bits_to_bytes(uci_pdu->pucch_pdu_format_2_3_4.harq.harq_bit_len);
|
||||
}
|
||||
if ((uci_pdu->pucch_pdu_format_2_3_4.pduBitmap >> 2) & 0x01) {
|
||||
total_size += uci_pdu->pucch_pdu_format_2_3_4.csi_part1.csi_part1_bit_len / 8 + 1;
|
||||
total_size += nr_bits_to_bytes(uci_pdu->pucch_pdu_format_2_3_4.csi_part1.csi_part1_bit_len);
|
||||
}
|
||||
if ((uci_pdu->pucch_pdu_format_2_3_4.pduBitmap >> 3) & 0x01) {
|
||||
total_size += uci_pdu->pucch_pdu_format_2_3_4.csi_part2.csi_part2_bit_len / 8 + 1;
|
||||
total_size += nr_bits_to_bytes(uci_pdu->pucch_pdu_format_2_3_4.csi_part2.csi_part2_bit_len);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1993,7 +1993,7 @@ static void dump_dl_dci_pdu(const nfapi_nr_dl_dci_pdu_t *pdu, int depth)
|
||||
INDENTED_PRINTF("powerControlOffsetSS = %d\n", pdu->powerControlOffsetSS);
|
||||
INDENTED_PRINTF("PayloadSizeBits = %d\n", pdu->PayloadSizeBits);
|
||||
INDENTED_PRINTF("Payload = ");
|
||||
for (int i = 0; i < (pdu->PayloadSizeBits + 7) / 8; ++i) {
|
||||
for (int i = 0; i < nr_bits_to_bytes(pdu->PayloadSizeBits); ++i) {
|
||||
printf("0x%02x ", pdu->Payload[i]);
|
||||
}
|
||||
printf("\n");
|
||||
@@ -2632,7 +2632,7 @@ void dump_crc_indication(const nfapi_nr_crc_indication_t *msg)
|
||||
INDENTED_PRINTF("HarqID = 0x%02x\n", crc->harq_id);
|
||||
INDENTED_PRINTF("TbCrcStatus = 0x%02x\n", crc->tb_crc_status);
|
||||
INDENTED_PRINTF("NumCb = 0x%02x\n", crc->num_cb);
|
||||
const uint16_t cb_len = (crc->num_cb / 8) + 1; // length is ceil(NumCb/8)
|
||||
const uint16_t cb_len = nr_bits_to_bytes(crc->num_cb); // length is ceil(NumCb/8)
|
||||
INDENTED_PRINTF("CbCrcStatus =\n");
|
||||
for (int j = 0; j < cb_len; j++) {
|
||||
printf("%02x ", crc->cb_crc_status[j]);
|
||||
@@ -2650,7 +2650,7 @@ static void dump_harq_2_3_4(const nfapi_nr_harq_pdu_2_3_4_t *harq, int depth)
|
||||
INDENTED_PRINTF("HARQ CRC = %01x\n", harq->harq_crc);
|
||||
INDENTED_PRINTF("HARQ Bit Length = %d\n", harq->harq_bit_len);
|
||||
INDENTED_PRINTF("HARQ Payload = ");
|
||||
for (int i = 0; i < harq->harq_bit_len / 8 + 1; i++) {
|
||||
for (int i = 0; i < nr_bits_to_bytes(harq->harq_bit_len); i++) {
|
||||
printf("%x ", harq->harq_payload[i]);
|
||||
}
|
||||
printf("\n");
|
||||
@@ -2661,7 +2661,7 @@ static void dump_csi_part_1(const nfapi_nr_csi_part1_pdu_t *csi, int depth)
|
||||
INDENTED_PRINTF("CSI Part 1 CRC = %01x\n", csi->csi_part1_crc);
|
||||
INDENTED_PRINTF("CSI Part 1 Bit Length = %d\n", csi->csi_part1_bit_len);
|
||||
INDENTED_PRINTF("CSI Part 1 Payload = ");
|
||||
for (int i = 0; i < csi->csi_part1_bit_len / 8 + 1; i++) {
|
||||
for (int i = 0; i < nr_bits_to_bytes(csi->csi_part1_bit_len); i++) {
|
||||
printf("%x ", csi->csi_part1_payload[i]);
|
||||
}
|
||||
printf("\n");
|
||||
@@ -2672,7 +2672,7 @@ static void dump_csi_part_2(const nfapi_nr_csi_part2_pdu_t *csi, int depth)
|
||||
INDENTED_PRINTF("CSI Part 1 CRC = %01x\n", csi->csi_part2_crc);
|
||||
INDENTED_PRINTF("CSI Part 1 Bit Length = %d\n", csi->csi_part2_bit_len);
|
||||
INDENTED_PRINTF("CSI Part 1 Payload = ");
|
||||
for (int i = 0; i < csi->csi_part2_bit_len / 8 + 1; i++) {
|
||||
for (int i = 0; i < nr_bits_to_bytes(csi->csi_part2_bit_len); i++) {
|
||||
printf("%x ", csi->csi_part2_payload[i]);
|
||||
}
|
||||
printf("\n");
|
||||
@@ -2740,7 +2740,7 @@ static void dump_sr_2_3_4(const nfapi_nr_sr_pdu_2_3_4_t *sr, int depth)
|
||||
{
|
||||
INDENTED_PRINTF("SR Bit Length = %d\n", sr->sr_bit_len);
|
||||
INDENTED_PRINTF("SR Payload ");
|
||||
for (int i = 0; i < sr->sr_bit_len / 8 + 1; i++) {
|
||||
for (int i = 0; i < nr_bits_to_bytes(sr->sr_bit_len); i++) {
|
||||
printf("%x ", sr->sr_payload[i]);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
@@ -14,8 +14,8 @@ static void fill_uci_indication_sr_pdu_0_1(nfapi_nr_sr_pdu_0_1_t *pdu)
|
||||
static void fill_uci_indication_sr_pdu_2_3_4(nfapi_nr_sr_pdu_2_3_4_t *pdu)
|
||||
{
|
||||
pdu->sr_bit_len = rand16_range(1, 8);
|
||||
pdu->sr_payload = calloc(((pdu->sr_bit_len / 8) + 1), sizeof(*pdu->sr_payload));
|
||||
for (int i = 0; i < (pdu->sr_bit_len / 8) + 1; ++i) {
|
||||
pdu->sr_payload = calloc(nr_bits_to_bytes(pdu->sr_bit_len), sizeof(*pdu->sr_payload));
|
||||
for (int i = 0; i < nr_bits_to_bytes(pdu->sr_bit_len); ++i) {
|
||||
pdu->sr_payload[i] = rand8();
|
||||
}
|
||||
}
|
||||
@@ -33,8 +33,8 @@ static void fill_uci_indication_harq_pdu_2_3_4(nfapi_nr_harq_pdu_2_3_4_t *pdu)
|
||||
{
|
||||
pdu->harq_crc = rand8_range(0, 2);
|
||||
pdu->harq_bit_len = rand16_range(1, 1706);
|
||||
pdu->harq_payload = calloc(((pdu->harq_bit_len / 8) + 1), sizeof(*pdu->harq_payload));
|
||||
for (int i = 0; i < (pdu->harq_bit_len / 8) + 1; ++i) {
|
||||
pdu->harq_payload = calloc(nr_bits_to_bytes(pdu->harq_bit_len), sizeof(*pdu->harq_payload));
|
||||
for (int i = 0; i < nr_bits_to_bytes(pdu->harq_bit_len); ++i) {
|
||||
pdu->harq_payload[i] = rand8();
|
||||
}
|
||||
}
|
||||
@@ -43,8 +43,8 @@ static void fill_uci_indication_csi_part1(nfapi_nr_csi_part1_pdu_t *pdu)
|
||||
{
|
||||
pdu->csi_part1_crc = rand8_range(0, 2);
|
||||
pdu->csi_part1_bit_len = rand16_range(1, 1706);
|
||||
pdu->csi_part1_payload = calloc(((pdu->csi_part1_bit_len / 8) + 1), sizeof(*pdu->csi_part1_payload));
|
||||
for (int i = 0; i < (pdu->csi_part1_bit_len / 8) + 1; ++i) {
|
||||
pdu->csi_part1_payload = calloc(nr_bits_to_bytes(pdu->csi_part1_bit_len), sizeof(*pdu->csi_part1_payload));
|
||||
for (int i = 0; i < nr_bits_to_bytes(pdu->csi_part1_bit_len); ++i) {
|
||||
pdu->csi_part1_payload[i] = rand8();
|
||||
}
|
||||
}
|
||||
@@ -53,8 +53,8 @@ static void fill_uci_indication_csi_part2(nfapi_nr_csi_part2_pdu_t *pdu)
|
||||
{
|
||||
pdu->csi_part2_crc = rand8_range(0, 2);
|
||||
pdu->csi_part2_bit_len = rand16_range(1, 1706);
|
||||
pdu->csi_part2_payload = calloc(((pdu->csi_part2_bit_len / 8) + 1), sizeof(*pdu->csi_part2_payload));
|
||||
for (int i = 0; i < (pdu->csi_part2_bit_len / 8) + 1; ++i) {
|
||||
pdu->csi_part2_payload = calloc(nr_bits_to_bytes(pdu->csi_part2_bit_len), sizeof(*pdu->csi_part2_payload));
|
||||
for (int i = 0; i < nr_bits_to_bytes(pdu->csi_part2_bit_len); ++i) {
|
||||
pdu->csi_part2_payload[i] = rand8();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,30 +48,6 @@ Please refer to the dedicated documentation at [LDPC_OFFLOAD_SETUP.md](file://..
|
||||
|
||||
`libldpc_aal.so` has its decoder and its encoder implemented in [nrLDPC_coding_aal.c](file://../nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c).
|
||||
|
||||
loading `libldpc_xdma.so` instead of `libldpc.so`:
|
||||
|
||||
`make ldpc_xdma` or `ninja ldpc_xdma`
|
||||
|
||||
This command creates the `libldpc_xdma.so` shared library.
|
||||
|
||||
```
|
||||
ninja ldpc_xdma
|
||||
[2/2] Linking C shared module libldpc_xdma.so
|
||||
```
|
||||
|
||||
At runtime, to successfully use the xdma, you need to install vendor specific drivers and tools.\
|
||||
Please refer to the dedicated documentation at [LDPC_XDMA_OFFLOAD_SETUP.md](file://../../../../doc/LDPC_XDMA_OFFLOAD_SETUP.md).
|
||||
|
||||
```
|
||||
./nr-softmodem -O libconfig:gnb.band78.sa.fr1.106PRB.usrpb210.conf:dbgl5 --rfsim --rfsimulator.[0].serveraddr server --log_config.gtpu_log_level info --loader.ldpc.shlibversion _xdma --nrLDPC_coding_xdma.num_threads_prepare 2
|
||||
```
|
||||
|
||||
`libldpc_xdma.so` has its decoder implemented in [nrLDPC_coding_xdma.c](file://../nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma.c).\
|
||||
Its encoder is implemented in [nrLDPC_coding_segment_encoder.c](file://../nrLDPC_coding/nrLDPC_coding_segment/nrLDPC_coding_segment_encoder.c).
|
||||
|
||||
*Note: `libldpc_xdma.so` relies on a segment coding library for encoding.*
|
||||
*The segment coding library is `libldpc.so` by default but it can be chosen with option `--nrLDPC_coding_xdma.encoder_shlibversion` followed by the library version - like with `--loder.ldpc.shlibversion` in the segment coding case above -*
|
||||
|
||||
#### Examples of ldpc shared lib selection when running ldpctest:
|
||||
|
||||
Slot coding libraries cannot be used yet within ldpctest.
|
||||
@@ -86,8 +62,6 @@ Libraries implementing the slotwise LDPC coding must be named `libldpc<_version>
|
||||
|
||||
`libldpc_aal.so` is completed.
|
||||
|
||||
`libldpc_xdma.so` is completed.
|
||||
|
||||
## LDPC segment coding
|
||||
The interface of the library is defined in [nrLDPC_defs.h](file://../nrLDPC_defs.h) as typedefs of the functions of the interface.
|
||||
The name of the functions implementing these typedefs can be found in [nrLDPC_extern.h](file://../nrLDPC_extern.h).
|
||||
|
||||
@@ -100,7 +100,7 @@ one_measurement_t test_ldpc(short max_iterations,
|
||||
double sigma;
|
||||
sigma = 1.0 / sqrt(2 * SNR);
|
||||
cpu_meas_enabled = 1;
|
||||
uint8_t *test_input[MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER * NR_MAX_NB_LAYERS];
|
||||
uint8_t *test_input[MAX_NUM_NR_DLSCH_SEGMENTS];
|
||||
uint8_t estimated_output[MAX_NUM_DLSCH_SEGMENTS][Kprime];
|
||||
memset(estimated_output, 0, sizeof(estimated_output));
|
||||
uint8_t *channel_input[MAX_NUM_DLSCH_SEGMENTS];
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
add_subdirectory(nrLDPC_coding_segment)
|
||||
add_subdirectory(nrLDPC_coding_xdma)
|
||||
add_subdirectory(nrLDPC_coding_aal)
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
* \param f2 input interleaved segment, 8 bits from 8 segments per byte
|
||||
* interleaved with E2 if there was a E shift in the segment group
|
||||
* \param E2 number of bits per segment in f2
|
||||
* \param Eshift flag indicating if there was a E shift within the segment group
|
||||
* \param E2_first_segment index of the first segment of size E2 if there is a E shift in the segment group
|
||||
* \param nb_segments number of segments in the group
|
||||
* \param output nrLDPC_coding_segment_encoder with concatenated segments and packed bits
|
||||
@@ -39,7 +38,6 @@ static void write_task_output(uint8_t *f,
|
||||
uint32_t E,
|
||||
uint8_t *f2,
|
||||
uint32_t E2,
|
||||
bool Eshift,
|
||||
uint32_t E2_first_segment,
|
||||
uint32_t nb_segments,
|
||||
uint8_t *output,
|
||||
@@ -173,9 +171,7 @@ static void write_task_output(uint8_t *f,
|
||||
Eoffset2 += E2;
|
||||
}
|
||||
output_p++;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -441,12 +437,10 @@ int nrLDPC_coding_encoder(nrLDPC_slot_encoding_parameters_t *nrLDPC_slot_encodin
|
||||
unsigned int macro_segment_end = (C > macro_segment + 8) ? macro_segment + 8 : C;
|
||||
const uint32_t E = nrLDPC_TB_encoding_parameters->segments[macro_segment].E;
|
||||
uint32_t E2 = E, E2_first_segment = macro_segment_end - macro_segment;
|
||||
bool Eshift = false;
|
||||
uint32_t Emax = E;
|
||||
for (int s = macro_segment; s < macro_segment_end; s++) {
|
||||
if (nrLDPC_TB_encoding_parameters->segments[s].E != E) {
|
||||
E2 = nrLDPC_TB_encoding_parameters->segments[s].E;
|
||||
Eshift = true;
|
||||
E2_first_segment = s-macro_segment;
|
||||
if(E2 > Emax)
|
||||
Emax = E2;
|
||||
@@ -464,7 +458,6 @@ int nrLDPC_coding_encoder(nrLDPC_slot_encoding_parameters_t *nrLDPC_slot_encodin
|
||||
E,
|
||||
&f2[nbTasks + j][0],
|
||||
E2,
|
||||
Eshift,
|
||||
E2_first_segment,
|
||||
macro_segment_end - macro_segment,
|
||||
nrLDPC_TB_encoding_parameters->output,
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
// #define RM_DEBUG 1
|
||||
|
||||
#define USE128BIT
|
||||
|
||||
static const uint8_t index_k0[2][4] = {{0, 17, 33, 56}, {0, 13, 25, 43}};
|
||||
|
||||
void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e, uint8_t *f)
|
||||
@@ -48,7 +49,7 @@ void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e, uint8_t *f)
|
||||
simde__m128i *f_128 = (simde__m128i *)f;
|
||||
simde__m128i *e0_128 = (simde__m128i *)e0;
|
||||
simde__m128i *e1_128 = (simde__m128i *)e1;
|
||||
for (; i < (EQm & ~15); i += 64) {
|
||||
for (; i < (EQm & ~15); i += 16) {
|
||||
simde__m128i e0j = simde_mm_loadu_si128(e0_128++);
|
||||
simde__m128i e1j = simde_mm_loadu_si128(e1_128++);
|
||||
simde_mm_storeu_si128(f_128++, simde_mm_unpacklo_epi8(e0j, e1j));
|
||||
@@ -342,14 +343,15 @@ void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e, uint8_t *f)
|
||||
f = (uint8_t *)f_512;
|
||||
#endif
|
||||
#ifdef USE128BIT
|
||||
e0_128 = (simde__m128i *)e0;
|
||||
e1_128 = (simde__m128i *)e1;
|
||||
e2_128 = (simde__m128i *)e2;
|
||||
e3_128 = (simde__m128i *)e3;
|
||||
e4_128 = (simde__m128i *)e4;
|
||||
e5_128 = (simde__m128i *)e5;
|
||||
e6_128 = (simde__m128i *)e6;
|
||||
e7_128 = (simde__m128i *)e7;
|
||||
simde__m128i *e0_128 = (simde__m128i *)e0;
|
||||
simde__m128i *e1_128 = (simde__m128i *)e1;
|
||||
simde__m128i *e2_128 = (simde__m128i *)e2;
|
||||
simde__m128i *e3_128 = (simde__m128i *)e3;
|
||||
simde__m128i *e4_128 = (simde__m128i *)e4;
|
||||
simde__m128i *e5_128 = (simde__m128i *)e5;
|
||||
simde__m128i *e6_128 = (simde__m128i *)e6;
|
||||
simde__m128i *e7_128 = (simde__m128i *)e7;
|
||||
simde__m128i *f_128 = (simde__m128i *)f;
|
||||
for (; i < (EQm & ~15); i += 16) {
|
||||
simde__m128i e0j = simde_mm_loadu_si128(e0_128++);
|
||||
simde__m128i e1j = simde_mm_loadu_si128(e1_128++);
|
||||
@@ -427,25 +429,452 @@ void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e, uint8_t *f)
|
||||
}
|
||||
}
|
||||
|
||||
void nr_interleaving_ldpc32(uint32_t E, uint8_t Qm, uint32_t *e, uint32_t *f)
|
||||
{
|
||||
const uint32_t EQm = E / Qm;
|
||||
memset(f, 0, E * sizeof(uint32_t));
|
||||
switch(Qm) {
|
||||
case 2: {
|
||||
uint32_t *e0 = e;
|
||||
uint32_t *e1 = e + EQm;
|
||||
int i = 0;
|
||||
for (; i < EQm; i++) {
|
||||
*f++ = *e0++;
|
||||
*f++ = *e1++;
|
||||
}
|
||||
} break;
|
||||
case 4: {
|
||||
uint32_t *e0 = e;
|
||||
uint32_t *e1 = e0 + EQm;
|
||||
uint32_t *e2 = e1 + EQm;
|
||||
uint32_t *e3 = e2 + EQm;
|
||||
int i = 0;
|
||||
for (; i < EQm; i++) {
|
||||
*f++ = *e0++;
|
||||
*f++ = *e1++;
|
||||
*f++ = *e2++;
|
||||
*f++ = *e3++;
|
||||
}
|
||||
} break;
|
||||
case 6: {
|
||||
uint32_t *e0 = e;
|
||||
uint32_t *e1 = e0 + EQm;
|
||||
uint32_t *e2 = e1 + EQm;
|
||||
uint32_t *e3 = e2 + EQm;
|
||||
uint32_t *e4 = e3 + EQm;
|
||||
uint32_t *e5 = e4 + EQm;
|
||||
int i = 0;
|
||||
#if 0
|
||||
simde__m128i *e0_128 = (simde__m128i *)e0;
|
||||
simde__m128i *e1_128 = (simde__m128i *)e1;
|
||||
simde__m128i *e2_128 = (simde__m128i *)e2;
|
||||
simde__m128i *e3_128 = (simde__m128i *)e3;
|
||||
simde__m128i *e4_128 = (simde__m128i *)e4;
|
||||
simde__m128i *e5_128 = (simde__m128i *)e5;
|
||||
simde__m128i *f128 = (simde__m128i *)f;
|
||||
for (; i < (EQm & ~3); i += 4) {
|
||||
simde__m128i e0j = simde_mm_loadu_si128(e0_128++);
|
||||
simde__m128i e1j = simde_mm_loadu_si128(e1_128++);
|
||||
simde__m128i e2j = simde_mm_loadu_si128(e2_128++);
|
||||
simde__m128i e3j = simde_mm_loadu_si128(e3_128++);
|
||||
simde__m128i e4j = simde_mm_loadu_si128(e4_128++);
|
||||
simde__m128i e5j = simde_mm_loadu_si128(e5_128++);
|
||||
|
||||
simde__m128i tmp0 = simde_mm_unpacklo_epi32(e0j, e1j); // e0(i) e1(i) e0(i+1) e1(i+1)
|
||||
simde__m128i tmp1 = simde_mm_unpacklo_epi32(e2j, e3j); // e2(i) e3(i) e2(i+1) e3(i+1)
|
||||
simde__m128i tmp2 = simde_mm_unpacklo_epi32(e4j, e5j); // e4(i) e5(i) e4(i+1) e5(i+1)
|
||||
|
||||
simde_mm_storeu_si128(f128++,simde_mm_unpacklo_epi64(tmp0, tmp1)); // e0(i) e1(i) e2(i) e3(i)
|
||||
simde_mm_storeu_si128(f128++,simde_mm_unpacklo_epi64(tmp2,simde_mm_unpackhi_epi64(tmp0,tmp0))); // e4(i) e5(i) e0(i+1) e1(i+1)
|
||||
simde_mm_storeu_si128(f128++,simde_mm_unpackhi_epi64(tmp1,tmp2)); // e2(i+1) e3(i+1) e4(i+1) e5(i+1)
|
||||
tmp0 = simde_mm_unpackhi_epi32(e0j, e1j); // e0(i+2) e1(i+2) e0(i+3) e1(i+3)
|
||||
tmp1 = simde_mm_unpackhi_epi32(e2j, e3j); // e2(i+2) e3(i+2) e2(i+3) e3(i+3)
|
||||
tmp2 = simde_mm_unpackhi_epi32(e4j, e5j); // e4(i+2) e5(i+2) e4(i+3) e5(i+3)
|
||||
|
||||
simde_mm_storeu_si128(f128++,simde_mm_unpacklo_epi64(tmp0, tmp1)); // e0(i+2) e1(i+2) e2(i+2) e3(i+2)
|
||||
simde_mm_storeu_si128(f128++,simde_mm_unpacklo_epi64(tmp2,simde_mm_unpackhi_epi64(tmp0,tmp0))); // e4(i+2) e5(i+2) e0(i+3) e1(i+3)
|
||||
simde_mm_storeu_si128(f128++,simde_mm_unpackhi_epi64(tmp1,tmp2)); // e2(i+3) e3(i+3) e4(i+3) e5(i+3)
|
||||
}
|
||||
e0 = (uint32_t *)e0_128;
|
||||
e1 = (uint32_t *)e1_128;
|
||||
e2 = (uint32_t *)e2_128;
|
||||
e3 = (uint32_t *)e3_128;
|
||||
e4 = (uint32_t *)e4_128;
|
||||
e5 = (uint32_t *)e5_128;
|
||||
f = (uint32_t *)f128;
|
||||
#endif
|
||||
for (; i < EQm; i++) {
|
||||
*f++ = *e0++;
|
||||
*f++ = *e1++;
|
||||
*f++ = *e2++;
|
||||
*f++ = *e3++;
|
||||
*f++ = *e4++;
|
||||
*f++ = *e5++;
|
||||
}
|
||||
} break;
|
||||
case 8: {
|
||||
uint32_t *e0 = e;
|
||||
uint32_t *e1 = e0 + EQm;
|
||||
uint32_t *e2 = e1 + EQm;
|
||||
uint32_t *e3 = e2 + EQm;
|
||||
uint32_t *e4 = e3 + EQm;
|
||||
uint32_t *e5 = e4 + EQm;
|
||||
uint32_t *e6 = e5 + EQm;
|
||||
uint32_t *e7 = e6 + EQm;
|
||||
|
||||
int i = 0;
|
||||
#if 0 /*def __AVX2__, this needs to be fixed, revert to 128-bit below*/
|
||||
simde__m256i *e0_256 = (simde__m256i *)e0;
|
||||
simde__m256i *e1_256 = (simde__m256i *)e1;
|
||||
simde__m256i *e2_256 = (simde__m256i *)e2;
|
||||
simde__m256i *e3_256 = (simde__m256i *)e3;
|
||||
simde__m256i *e4_256 = (simde__m256i *)e4;
|
||||
simde__m256i *e5_256 = (simde__m256i *)e5;
|
||||
simde__m256i *e6_256 = (simde__m256i *)e6;
|
||||
simde__m256i *e7_256 = (simde__m256i *)e7;
|
||||
simde__m256i *f256 = (simde__m256i *)f;
|
||||
|
||||
for (; i < (EQm & ~7); i += 8) {
|
||||
simde__m256i e0j = simde_mm256_loadu_si256(e0_256++);
|
||||
simde__m256i e1j = simde_mm256_loadu_si256(e1_256++);
|
||||
simde__m256i e2j = simde_mm256_loadu_si256(e2_256++);
|
||||
simde__m256i e3j = simde_mm256_loadu_si256(e3_256++);
|
||||
simde__m256i e4j = simde_mm256_loadu_si256(e4_256++);
|
||||
simde__m256i e5j = simde_mm256_loadu_si256(e5_256++);
|
||||
simde__m256i e6j = simde_mm256_loadu_si256(e6_256++);
|
||||
simde__m256i e7j = simde_mm256_loadu_si256(e7_256++);
|
||||
|
||||
simde__m256i tmp0 = simde_mm256_unpacklo_epi32(e0j, e1j); // e0(i) e1(i) e0(i+1) e1(i+1) e0(i+4) e1(i+4) e0(i+5) e1(i+5)
|
||||
simde__m256i tmp1 = simde_mm256_unpacklo_epi32(e2j, e3j); // e2(i) e3(i) e2(i+1) e3(i+1) e2(i+4) e3(i+4) e2(i+5) e3(i+5)
|
||||
simde__m256i tmp2 = simde_mm256_unpacklo_epi32(e4j, e5j); // e4(i) e5(i) e4(i+1) e5(i+1) e4(i+4) e5(i+4) e4(i+5) e5(i+5)
|
||||
simde__m256i tmp3 = simde_mm256_unpacklo_epi32(e6j, e7j); // e6(i) e7(i) e6(i+1) e7(i+1) e6(i+4) e7(i+4) e6(i+5) e7(i+5)
|
||||
//
|
||||
simde__m256i tmp4 = simde_mm256_unpacklo_epi64(tmp0, tmp1); // e0(i) e1(i) e2(i) e3(i) e0(i+4) e1(i+4) e2(i+4) e3(i+4)
|
||||
simde__m256i tmp5 = simde_mm256_unpacklo_epi64(tmp2, tmp3); // e4(i) e5(i) e6(i) e7(i) e4(i+4) e5(i+4) e6(i+4) e7(i+4)
|
||||
|
||||
simde_mm256_storeu_si256(f256++,_mm256_permute2x128_si256(tmp4,tmp5,0x20)); // e0(i) e1(i) e2(i) e3(i) e4(i) e5(i) e6(i) e7(i)
|
||||
|
||||
simde__m256i tmp6 = simde_mm256_unpackhi_epi64(tmp0, tmp1); // e0(i+1) e1(i+1) e2(i+1) e3(i+1) e0(i+5) e1(i+5) e2(i+5) e3(i+5)
|
||||
simde__m256i tmp7 = simde_mm256_unpackhi_epi64(tmp2, tmp3); // e4(i+1) e5(i+1) e6(i+1) e7(i+1) e4(i+5) e5(i+5) e6(i+5) e7(i+5)
|
||||
simde_mm256_storeu_si256(f256++,_mm256_permute2x128_si256(tmp6,tmp7,0x20)); // e0(i+1) e1(i+1) e2(i+1) e3(i+1) e4(i+1) e5(i+1) e6(i+1) e7(i+1)
|
||||
//
|
||||
tmp0 = simde_mm256_unpackhi_epi32(e0j, e1j); // e0(i+2) e1(i+2) e0(i+3) e1(i+3) e0(i+6) e1(i+6) e0(i+7) e1(i+7)
|
||||
tmp1 = simde_mm256_unpackhi_epi32(e2j, e3j); // e2(i+2) e3(i+2) e2(i+3) e3(i+3) e2(i+6) e3(i+6) e2(i+7) e3(i+7)
|
||||
tmp2 = simde_mm256_unpackhi_epi32(e4j, e5j); // e4(i+2) e5(i+2) e4(i+3) e5(i+3) e4(i+6) e5(i+6) e4(i+7) e5(i+7)
|
||||
tmp3 = simde_mm256_unpackhi_epi32(e6j, e7j); // e6(i+2) e7(i+2) e6(i+3) e7(i+3) e6(i+6) e7(i+6) e6(i+7) e7(i+7)
|
||||
//
|
||||
simde__m256i tmp8 = simde_mm256_unpacklo_epi64(tmp0, tmp1); // e0(i+2) e1(i+2) e2(i+2) e3(i+2) e0(i+6) e1(i+6) e2(i+6) e3(i+6)
|
||||
simde__m256i tmp9 = simde_mm256_unpacklo_epi64(tmp2, tmp3); // e4(i+2) e5(i+2) e6(i+2) e7(i+2) e4(i+6) e5(i+6) e6(i+6) e7(i+6)
|
||||
|
||||
simde_mm256_storeu_si256(f256++,_mm256_permute2x128_si256(tmp8,tmp9,0x20)); // e0(i+2) e1(i+2) e2(i+2) e3(i+2) e4(i+2) e5(i+2) e6(i+2) e7(i+2)
|
||||
simde__m256i tmp10 = simde_mm256_unpackhi_epi64(tmp0, tmp1); // e0(i+3) e1(i+3) e2(i+3) e3(i+3) e0(i+7) e1(i+7) e2(i+7) e3(i+7)
|
||||
simde__m256i tmp11 = simde_mm256_unpackhi_epi64(tmp2, tmp3); // e4(i+3) e5(i+3) e6(i+3) e7(i+3) e4(i+7) e5(i+7) e6(i+7) e7(i+7)
|
||||
simde_mm256_storeu_si256(f256++,_mm256_permute2x128_si256(tmp10,tmp11,0x20)); // e0(i+3) e1(i+3) e2(i+3) e3(i+3) e4(i+3) e5(i+3) e6(i+3) e7(i+3)
|
||||
simde_mm256_storeu_si256(f256++,_mm256_permute2x128_si256(tmp4,tmp5,0x31)); // e0(i+4) e1(i+4) e2(i+4) e3(i+4) e4(i+4) e5(i+4) e6(i+4) e7(i+4)
|
||||
simde_mm256_storeu_si256(f256++,_mm256_permute2x128_si256(tmp6,tmp7,0x31)); // e0(i+5) e1(i+5) e2(i+5) e3(i+5) e4(i+5) e5(i+5) e6(i+5) e7(i+5)
|
||||
simde_mm256_storeu_si256(f256++,_mm256_permute2x128_si256(tmp8,tmp9,0x31)); // e0(i+6) e1(i+6) e2(i+6) e3(i+6) e4(i+6) e5(i+6) e6(i+6) e7(i+6)
|
||||
simde_mm256_storeu_si256(f256++,_mm256_permute2x128_si256(tmp10,tmp11,0x31)); // e0(i+7) e1(i+7) e2(i+7) e3(i+7) e4(i+7) e5(i+7) e6(i+7) e7(i+7)
|
||||
}
|
||||
e0 = (uint32_t *)e0_256;
|
||||
e1 = (uint32_t *)e1_256;
|
||||
e2 = (uint32_t *)e2_256;
|
||||
e3 = (uint32_t *)e3_256;
|
||||
e4 = (uint32_t *)e4_256;
|
||||
e5 = (uint32_t *)e5_256;
|
||||
e6 = (uint32_t *)e6_256;
|
||||
e7 = (uint32_t *)e7_256;
|
||||
f = (uint32_t *)f256;
|
||||
#endif
|
||||
simde__m128i *e0_128 = (simde__m128i *)e0;
|
||||
simde__m128i *e1_128 = (simde__m128i *)e1;
|
||||
simde__m128i *e2_128 = (simde__m128i *)e2;
|
||||
simde__m128i *e3_128 = (simde__m128i *)e3;
|
||||
simde__m128i *e4_128 = (simde__m128i *)e4;
|
||||
simde__m128i *e5_128 = (simde__m128i *)e5;
|
||||
simde__m128i *e6_128 = (simde__m128i *)e6;
|
||||
simde__m128i *e7_128 = (simde__m128i *)e7;
|
||||
simde__m128i *f128 = (simde__m128i *)f;
|
||||
|
||||
|
||||
for (; i < (EQm & ~3); i += 4) {
|
||||
simde__m128i e0j = simde_mm_loadu_si128(e0_128++);
|
||||
simde__m128i e1j = simde_mm_loadu_si128(e1_128++);
|
||||
simde__m128i e2j = simde_mm_loadu_si128(e2_128++);
|
||||
simde__m128i e3j = simde_mm_loadu_si128(e3_128++);
|
||||
simde__m128i e4j = simde_mm_loadu_si128(e4_128++);
|
||||
simde__m128i e5j = simde_mm_loadu_si128(e5_128++);
|
||||
simde__m128i e6j = simde_mm_loadu_si128(e6_128++);
|
||||
simde__m128i e7j = simde_mm_loadu_si128(e7_128++);
|
||||
|
||||
simde__m128i tmp0 = simde_mm_unpacklo_epi32(e0j, e1j); // e0(i) e1(i) e0(i+1) e1(i+1)
|
||||
simde__m128i tmp1 = simde_mm_unpacklo_epi32(e2j, e3j); // e2(i) e3(i) e2(i+1) e3(i+1)
|
||||
simde__m128i tmp2 = simde_mm_unpacklo_epi32(e4j, e5j); // e4(i) e5(i) e4(i+1) e5(i+1)
|
||||
simde__m128i tmp3 = simde_mm_unpacklo_epi32(e6j, e7j); // e6(i) e7(i) e6(i+1) e7(i+1)
|
||||
|
||||
simde_mm_storeu_si128(f128++,simde_mm_unpacklo_epi64(tmp0, tmp1)); // e0(i) e1(i) e2(i) e3(i)
|
||||
simde_mm_storeu_si128(f128++,simde_mm_unpacklo_epi64(tmp2, tmp3)); // e4(i) e5(i) e6(i) e7(i)
|
||||
simde_mm_storeu_si128(f128++,simde_mm_unpackhi_epi64(tmp0, tmp1)); // e0(i+1) e1(i+1) e2(i+1) e3(i+1)
|
||||
simde_mm_storeu_si128(f128++,simde_mm_unpackhi_epi64(tmp2, tmp3)); // e4(i+1) e5(i+1) e6(i+1) e7(i+1)
|
||||
|
||||
tmp0 = simde_mm_unpackhi_epi32(e0j, e1j); // e0(i+2) e1(i+2) e0(i+3) e1(i+3)
|
||||
tmp1 = simde_mm_unpackhi_epi32(e2j, e3j); // e2(i+2) e3(i+2) e2(i+3) e3(i+3)
|
||||
tmp2 = simde_mm_unpackhi_epi32(e4j, e5j); // e4(i+2) e5(i+2) e4(i+3) e5(i+3)
|
||||
tmp3 = simde_mm_unpackhi_epi32(e6j, e7j); // e6(i+2) e7(i+2) e6(i+3) e7(i+3)
|
||||
|
||||
simde_mm_storeu_si128(f128++,simde_mm_unpacklo_epi64(tmp0, tmp1)); // e0(i+2) e1(i+2) e2(i+2) e3(i+2)
|
||||
simde_mm_storeu_si128(f128++,simde_mm_unpacklo_epi64(tmp2, tmp3)); // e4(i+2) e5(i+2) e6(i+2) e7(i+2)
|
||||
simde_mm_storeu_si128(f128++,simde_mm_unpackhi_epi64(tmp0, tmp1)); // e0(i+3) e1(i+3) e2(i+3) e3(i+3)
|
||||
simde_mm_storeu_si128(f128++,simde_mm_unpackhi_epi64(tmp2, tmp3)); //e4(i+3) e5(i+3) e6(i+3) e7(i+3)
|
||||
}
|
||||
e0 = (uint32_t *)e0_128;
|
||||
e1 = (uint32_t *)e1_128;
|
||||
e2 = (uint32_t *)e2_128;
|
||||
e3 = (uint32_t *)e3_128;
|
||||
e4 = (uint32_t *)e4_128;
|
||||
e5 = (uint32_t *)e5_128;
|
||||
e6 = (uint32_t *)e6_128;
|
||||
e7 = (uint32_t *)e7_128;
|
||||
f = (uint32_t *)f128;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(false, "Should be here!\n");
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__aarch64__)
|
||||
static inline uint8x16_t tbl96_u8(uint8x16_t b0, uint8x16_t b1, uint8x16_t b2,
|
||||
uint8x16_t b3, uint8x16_t b4, uint8x16_t b5,
|
||||
uint8x16_t idx /* 0..95 */)
|
||||
{
|
||||
// Table 0: bytes 0..63
|
||||
uint8x16x4_t T0 = {{ b0, b1, b2, b3 }};
|
||||
uint8x16_t r0 = vqtbl4q_u8(T0, idx);
|
||||
|
||||
// Table 1: bytes 64..95, presented as a 64-byte table:
|
||||
// bytes 0..31 map to original 64..95, bytes 32..63 are dummy (return 0)
|
||||
uint8x16_t z = vdupq_n_u8(0);
|
||||
uint8x16x4_t T1 = {{ b4, b5, z, z }};
|
||||
|
||||
// idx1 = idx - 64 (wrap-safe via unsigned subtract); only valid when idx>=64
|
||||
uint8x16_t idx1 = vsubq_u8(idx, vdupq_n_u8(64));
|
||||
uint8x16_t r1 = vqtbl4q_u8(T1, idx1);
|
||||
|
||||
// Select r1 where idx >= 64, else r0
|
||||
uint8x16_t sel = vcgeq_u8(idx, vdupq_n_u8(64)); // 0xFF where idx>=64
|
||||
return vbslq_u8(sel, r1, r0);
|
||||
}
|
||||
|
||||
static inline uint8x16_t tbl128_u8(uint8x16_t b0, uint8x16_t b1, uint8x16_t b2, uint8x16_t b3,
|
||||
uint8x16_t b4, uint8x16_t b5, uint8x16_t b6, uint8x16_t b7,
|
||||
uint8x16_t idx /* 0..127 */)
|
||||
{
|
||||
// Table low: bytes 0..63
|
||||
uint8x16x4_t T0 = {{ b0, b1, b2, b3 }};
|
||||
uint8x16_t r0 = vqtbl4q_u8(T0, idx);
|
||||
|
||||
// Table high: bytes 64..127, mapped to 0..63 by subtracting 64
|
||||
uint8x16x4_t T1 = {{ b4, b5, b6, b7 }};
|
||||
uint8x16_t idx1 = vsubq_u8(idx, vdupq_n_u8(64));
|
||||
uint8x16_t r1 = vqtbl4q_u8(T1, idx1);
|
||||
|
||||
// Select high where idx >= 64 else low
|
||||
uint8x16_t sel = vcgeq_u8(idx, vdupq_n_u8(64));
|
||||
return vbslq_u8(sel, r1, r0);
|
||||
}
|
||||
#elif defined(__AVX512BW__)
|
||||
|
||||
static inline __m512i idx_stride_u16(int ways, int k)
|
||||
{
|
||||
uint16_t idx[32] __attribute__((aligned(64)));
|
||||
for (int n = 0; n < 32; n++) idx[n] = (uint16_t)(k + ways*n);
|
||||
return _mm512_load_si512((const void*)idx);
|
||||
}
|
||||
|
||||
// Build indices for k = 0..5, lanes n=0..15: p = k + 6*n
|
||||
static inline __m512i make_idx_ab(int k) {
|
||||
uint16_t idx[32] __attribute__((aligned(64))) = { 0 };
|
||||
for (int n = 0; n < 16; n++) {
|
||||
idx[n] = (uint16_t)(k + 6*n); // p in [0..95]
|
||||
}
|
||||
return _mm512_load_si512((const void*)idx);
|
||||
}
|
||||
|
||||
static inline __m512i make_idx_bc(int k) {
|
||||
uint16_t idx[32] __attribute__((aligned(64))) = { 0 };
|
||||
|
||||
for (int n = 0; n < 16; n++) {
|
||||
int p = k + 6*n;
|
||||
// For (B,C) pair, global p maps to:
|
||||
// indices 0..31 -> B lanes 0..31 (global 32..63)
|
||||
// indices 32..63 -> C lanes 0..31 (global 64..95)
|
||||
// so use (p - 32) as index into [B|C] when p >= 32.
|
||||
idx[n] = (uint16_t)(p - 32);
|
||||
}
|
||||
return _mm512_load_si512((const void*)idx);
|
||||
}
|
||||
|
||||
static inline __mmask32 make_mask_bc(int k) {
|
||||
// lanes needing BC are those with p >= 64 (since AB covers global 0..63)
|
||||
__mmask32 m = 0;
|
||||
for (int n = 0; n < 16; n++) {
|
||||
int p = k + 6*n;
|
||||
if (p >= 64) m |= (1u << n);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
#endif
|
||||
|
||||
void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e, int16_t *f)
|
||||
{
|
||||
const uint32_t EQm = E / Qm;
|
||||
switch (Qm) {
|
||||
case 2: {
|
||||
AssertFatal(E % 2 == 0, "");
|
||||
int16_t *e1 = e + (E / 2);
|
||||
int16_t *end = f + E - 1;
|
||||
while (f < end) {
|
||||
int16_t *e1 = e + EQm;
|
||||
int i=0;
|
||||
#if defined(__aarch64__)
|
||||
for (; i + 8 <= EQm; i += 8) {
|
||||
int16x8x2_t v = vld2q_s16(f); // 8 groups
|
||||
f += 16;
|
||||
vst1q_s16(e, v.val[0]); e += 8;
|
||||
vst1q_s16(e1, v.val[1]); e1 += 8;
|
||||
}
|
||||
#elif defined(__AVX512BW__)
|
||||
const __m512i idx0 = idx_stride_u16(2, 0);
|
||||
const __m512i idx1 = idx_stride_u16(2, 1);
|
||||
|
||||
for (; i + 32 <= EQm; i += 32) {
|
||||
// 32 groups * 2 u16 = 64 u16 = 2x512b
|
||||
__m512i A = _mm512_loadu_si512((const void*)(f + 0)); // u16[0..31]
|
||||
__m512i B = _mm512_loadu_si512((const void*)(f + 32)); // u16[32..63]
|
||||
f += 64;
|
||||
__m512i o0 = _mm512_permutex2var_epi16(A, idx0, B);
|
||||
__m512i o1 = _mm512_permutex2var_epi16(A, idx1, B);
|
||||
_mm512_storeu_si512((void*)e, o0); e += 32;
|
||||
_mm512_storeu_si512((void*)e1, o1); e1 += 32;
|
||||
}
|
||||
#else
|
||||
simde__m128i *e0_128 = (simde__m128i *)e;
|
||||
simde__m128i *e1_128 = (simde__m128i *)e1;
|
||||
simde__m128i *f128 = (simde__m128i *)f;
|
||||
const uint8_t shuf4[16] __attribute__((aligned(16))) = {0,1,4,5,8,9,12,13,2,3,6,7,10,11,14,15};
|
||||
const simde__m128i *shuf4_128 = (const simde__m128i *)shuf4;
|
||||
for (; i < (EQm & ~7); i += 8) {
|
||||
simde__m128i f0j = simde_mm_loadu_si128(f128++); // f0(i) f0(i+1) f0(i+2) f0(i+3) f0(i+4) f0(i+5) f0(i+6) f0(i+7)
|
||||
simde__m128i f1j = simde_mm_loadu_si128(f128++); // f1(i) f1(i+1) f1(i+2) f1(i+3) f1(i+4) f1(i+5) f1(i+6) f1(i+7)
|
||||
simde__m128i tmp0 = simde_mm_shuffle_epi8(f0j,*shuf4_128); // f0(i) f0(i+2) f0(i+4) f0(i+6) f0(i+1) f0(i+3) f0(i+5) f0(i+7)
|
||||
simde__m128i tmp1 = simde_mm_shuffle_epi8(f1j,*shuf4_128); // f1(i) f1(i+2) f1(i+4) f1(i+6) f1(i+1) f1(i+3) f1(i+5) f1(i+7)
|
||||
simde_mm_storeu_si128(e0_128++,simde_mm_unpacklo_epi64(tmp0, tmp1)); // f0(i) f0(i+2) f0(i+4) f0(i+6) f1(i) f1(i+2) f1(i+4) f1(i+6)
|
||||
simde_mm_storeu_si128(e1_128++,simde_mm_unpackhi_epi64(tmp0, tmp1)); // f0(i+1) f0(i+3) f0(i+5) f0(i+7) f1(i+1) f1(i+3) f1(i+5) f1(i+7)
|
||||
}
|
||||
e=(int16_t *)e0_128;
|
||||
e1=(int16_t *)e1_128;
|
||||
f=(int16_t *)f128;
|
||||
#endif
|
||||
for (; i < EQm; i++) {
|
||||
*e++ = *f++;
|
||||
*e1++ = *f++;
|
||||
}
|
||||
} break;
|
||||
|
||||
case 4: {
|
||||
AssertFatal(E % 4 == 0, "");
|
||||
int16_t *e1 = e + (E / 4);
|
||||
int16_t *e2 = e1 + (E / 4);
|
||||
int16_t *e3 = e2 + (E / 4);
|
||||
int16_t *end = f + E - 3;
|
||||
while (f < end) {
|
||||
int i=0;
|
||||
int16_t *e1 = e + EQm;
|
||||
int16_t *e2 = e1 + EQm;
|
||||
int16_t *e3 = e2 + EQm;
|
||||
|
||||
#if defined(__aarch64__)
|
||||
for (; i + 8 <= EQm; i += 8) {
|
||||
int16x8x4_t v = vld4q_s16(f); // 8 groups
|
||||
f += 32;
|
||||
vst1q_s16(e, v.val[0]); e += 8;
|
||||
vst1q_s16(e1, v.val[1]); e1 += 8;
|
||||
vst1q_s16(e2, v.val[2]); e2 += 8;
|
||||
vst1q_s16(e3, v.val[3]); e3 += 8;
|
||||
}
|
||||
#elif defined(__AVX512BW__)
|
||||
const __m512i idx0 = idx_stride_u16(4, 0);
|
||||
const __m512i idx1 = idx_stride_u16(4, 1);
|
||||
const __m512i idx2 = idx_stride_u16(4, 2);
|
||||
const __m512i idx3 = idx_stride_u16(4, 3);
|
||||
|
||||
for (; i + 32 <= EQm; i += 32) {
|
||||
// 32 groups * 4 u16 = 128 u16 = 4x512b
|
||||
__m512i A = _mm512_loadu_si512((const void*)(f + 0));
|
||||
__m512i B = _mm512_loadu_si512((const void*)(f + 32));
|
||||
__m512i C = _mm512_loadu_si512((const void*)(f + 64));
|
||||
__m512i D = _mm512_loadu_si512((const void*)(f + 96));
|
||||
f += 128;
|
||||
// Build results from (A,B) and (C,D) with masking (boundary at 64 u16)
|
||||
__m512i o0_ab = _mm512_permutex2var_epi16(A, idx0, B);
|
||||
__m512i o1_ab = _mm512_permutex2var_epi16(A, idx1, B);
|
||||
__m512i o2_ab = _mm512_permutex2var_epi16(A, idx2, B);
|
||||
__m512i o3_ab = _mm512_permutex2var_epi16(A, idx3, B);
|
||||
|
||||
__m512i idx0_cd = _mm512_sub_epi16(idx0, _mm512_set1_epi16(64));
|
||||
__m512i idx1_cd = _mm512_sub_epi16(idx1, _mm512_set1_epi16(64));
|
||||
__m512i idx2_cd = _mm512_sub_epi16(idx2, _mm512_set1_epi16(64));
|
||||
__m512i idx3_cd = _mm512_sub_epi16(idx3, _mm512_set1_epi16(64));
|
||||
|
||||
__m512i o0_cd = _mm512_permutex2var_epi16(C, idx0_cd, D);
|
||||
__m512i o1_cd = _mm512_permutex2var_epi16(C, idx1_cd, D);
|
||||
__m512i o2_cd = _mm512_permutex2var_epi16(C, idx2_cd, D);
|
||||
__m512i o3_cd = _mm512_permutex2var_epi16(C, idx3_cd, D);
|
||||
|
||||
// lanes needing CD are those where idx >= 64
|
||||
__mmask32 m0 = _mm512_cmpge_epu16_mask(idx0, _mm512_set1_epi16(64));
|
||||
__mmask32 m1 = _mm512_cmpge_epu16_mask(idx1, _mm512_set1_epi16(64));
|
||||
__mmask32 m2 = _mm512_cmpge_epu16_mask(idx2, _mm512_set1_epi16(64));
|
||||
__mmask32 m3 = _mm512_cmpge_epu16_mask(idx3, _mm512_set1_epi16(64));
|
||||
|
||||
__m512i o0 = _mm512_mask_mov_epi16(o0_ab, m0, o0_cd);
|
||||
__m512i o1 = _mm512_mask_mov_epi16(o1_ab, m1, o1_cd);
|
||||
__m512i o2 = _mm512_mask_mov_epi16(o2_ab, m2, o2_cd);
|
||||
__m512i o3 = _mm512_mask_mov_epi16(o3_ab, m3, o3_cd);
|
||||
|
||||
_mm512_storeu_si512((void*)e, o0); e += 32;
|
||||
_mm512_storeu_si512((void*)e1, o1); e1 += 32;
|
||||
_mm512_storeu_si512((void*)e2, o2); e2 += 32;
|
||||
_mm512_storeu_si512((void*)e3, o3); e3 += 32;
|
||||
}
|
||||
#else
|
||||
simde__m128i *e0_128 = (simde__m128i *)e;
|
||||
simde__m128i *e1_128 = (simde__m128i *)e1;
|
||||
simde__m128i *e2_128 = (simde__m128i *)e2;
|
||||
simde__m128i *e3_128 = (simde__m128i *)e3;
|
||||
simde__m128i *f128 = (simde__m128i *)f;
|
||||
|
||||
const uint8_t shuf16[16] __attribute__((aligned(16))) = {0,1,8,9,2,3,10,11,4,5,12,13,6,7,14,15};
|
||||
const simde__m128i *shuf16_128 = (const simde__m128i *)shuf16;
|
||||
|
||||
for (i=0; i < (EQm & ~7); i += 8) {
|
||||
simde__m128i f0j = simde_mm_loadu_si128(f128++);
|
||||
simde__m128i f1j = simde_mm_loadu_si128(f128++);
|
||||
simde__m128i f2j = simde_mm_loadu_si128(f128++);
|
||||
simde__m128i f3j = simde_mm_loadu_si128(f128++);
|
||||
|
||||
simde__m128i tmp0 = simde_mm_shuffle_epi8(f0j,*shuf16_128); // f0(i) f0(i+4) f0(i+1) f0(i+5) f0(i+2) f0(i+6) f0(i+3) f0(i+7)
|
||||
simde__m128i tmp1 = simde_mm_shuffle_epi8(f1j,*shuf16_128); // f1(i) f1(i+4) f1(i+1) f1(i+5) f1(i+2) f1(i+6) f1(i+3) f1(i+7)
|
||||
simde__m128i tmp2 = simde_mm_shuffle_epi8(f2j,*shuf16_128); // f2(i) f2(i+4) f2(i+1) f2(i+5) f2(i+2) f2(i+6) f2(i+3) f2(i+7)
|
||||
simde__m128i tmp3 = simde_mm_shuffle_epi8(f3j,*shuf16_128); // f3(i) f3(i+2) f3(i+1) f3(i+5) f3(i+2) f3(i+6) f3(i+3) f3(i+7)
|
||||
simde__m128i tmp4 = simde_mm_unpacklo_epi32(tmp0,tmp1); // f0(i) f0(i+4) f1(i) f1(i+4) f0(i+1) f0(i+5) f1(i+1) f1(i+5)
|
||||
simde__m128i tmp5 = simde_mm_unpacklo_epi32(tmp2,tmp3); // f2(i) f2(i+4) f3(i) f3(i+4) f2(i+1) f2(i+5) f3(i+1) f3(i+5)
|
||||
simde_mm_storeu_si128(e0_128++,simde_mm_unpacklo_epi64(tmp4, tmp5)); // f0(i) f0(i+4) f1(i) f1(i+4) f2(i) f2(i+4) f3(i) f3(i+4)
|
||||
simde_mm_storeu_si128(e1_128++,simde_mm_unpackhi_epi64(tmp4, tmp5)); // f0(i+1) f0(i+5) f1(i+1) f1(i+5) f2(i+1) f2(i+5) f3(i+1) f3(i+5)
|
||||
tmp4 = simde_mm_unpackhi_epi32(tmp0,tmp1); // f0(i+2) f0(i+6) f1(i+2) f1(i+6) f0(i+3) f0(i+7) f1(i+3) f1(i+7)
|
||||
tmp5 = simde_mm_unpackhi_epi32(tmp2,tmp3); // f2(i+2) f2(i+6) f3(i+2) f3(i+6) f2(i+3) f2(i+7) f3(i+3) f3(i+7)
|
||||
simde_mm_storeu_si128(e2_128++,simde_mm_unpacklo_epi64(tmp4, tmp5)); // f0(i+2) f0(i+6) f1(i+2) f1(i+6) f2(i+2) f2(i+6) f3(i+2) f3(i+6)
|
||||
simde_mm_storeu_si128(e3_128++,simde_mm_unpackhi_epi64(tmp4, tmp5)); // f0(i+3) f0(i+7) f1(i+3) f1(i+7) f2(i+3) f2(i+7) f3(i+3) f3(i+7)
|
||||
}
|
||||
e=(int16_t *)e0_128;
|
||||
e1=(int16_t *)e1_128;
|
||||
e2=(int16_t *)e2_128;
|
||||
e3=(int16_t *)e3_128;
|
||||
f=(int16_t *)f128;
|
||||
#endif
|
||||
for (; i < EQm; i++) {
|
||||
*e++ = *f++;
|
||||
*e1++ = *f++;
|
||||
*e2++ = *f++;
|
||||
@@ -454,13 +883,108 @@ void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e, int16_t *f)
|
||||
} break;
|
||||
case 6: {
|
||||
AssertFatal(E % 6 == 0, "");
|
||||
int16_t *e1 = e + (E / 6);
|
||||
int16_t *e2 = e1 + (E / 6);
|
||||
int16_t *e3 = e2 + (E / 6);
|
||||
int16_t *e4 = e3 + (E / 6);
|
||||
int16_t *e5 = e4 + (E / 6);
|
||||
int16_t *end = f + E - 5;
|
||||
while (f < end) {
|
||||
int16_t *e1 = e + EQm;
|
||||
int16_t *e2 = e1 + EQm;
|
||||
int16_t *e3 = e2 + EQm;
|
||||
int16_t *e4 = e3 + EQm;
|
||||
int16_t *e5 = e4 + EQm;
|
||||
int i=0;
|
||||
#if defined(__aarch64__)
|
||||
|
||||
// Byte indices for extracting each stream
|
||||
// Each s16 occupies 2 bytes → indices are 2*(k + 6*n)
|
||||
const uint8x16_t idx0 = { 0, 1, 12, 13, 24, 25, 36, 37,
|
||||
48, 49, 60, 61, 72, 73, 84, 85 };
|
||||
const uint8x16_t idx1 = { 2, 3, 14, 15, 26, 27, 38, 39,
|
||||
50, 51, 62, 63, 74, 75, 86, 87 };
|
||||
const uint8x16_t idx2 = { 4, 5, 16, 17, 28, 29, 40, 41,
|
||||
52, 53, 64, 65, 76, 77, 88, 89 };
|
||||
const uint8x16_t idx3 = { 6, 7, 18, 19, 30, 31, 42, 43,
|
||||
54, 55, 66, 67, 78, 79, 90, 91 };
|
||||
const uint8x16_t idx4 = { 8, 9, 20, 21, 32, 33, 44, 45,
|
||||
56, 57, 68, 69, 80, 81, 92, 93 };
|
||||
const uint8x16_t idx5 = { 10, 11, 22, 23, 34, 35, 46, 47,
|
||||
58, 59, 70, 71, 82, 83, 94, 95 };
|
||||
|
||||
for (; i + 8 < EQm; i += 8) {
|
||||
// Load 96 bytes (48 u16)
|
||||
uint8x16_t b0 = vld1q_u8((const uint8_t*)(f + 0)); // bytes 0..15
|
||||
uint8x16_t b1 = vld1q_u8((const uint8_t*)(f + 8)); // bytes 16..31
|
||||
uint8x16_t b2 = vld1q_u8((const uint8_t*)(f + 16)); // bytes 32..47
|
||||
uint8x16_t b3 = vld1q_u8((const uint8_t*)(f + 24)); // bytes 48..63
|
||||
uint8x16_t b4 = vld1q_u8((const uint8_t*)(f + 32)); // bytes 64..79
|
||||
uint8x16_t b5 = vld1q_u8((const uint8_t*)(f + 40)); // bytes 80..95
|
||||
f += 48;
|
||||
uint8x16_t o0b = tbl96_u8(b0,b1,b2,b3,b4,b5, idx0);
|
||||
uint8x16_t o1b = tbl96_u8(b0,b1,b2,b3,b4,b5, idx1);
|
||||
uint8x16_t o2b = tbl96_u8(b0,b1,b2,b3,b4,b5, idx2);
|
||||
uint8x16_t o3b = tbl96_u8(b0,b1,b2,b3,b4,b5, idx3);
|
||||
uint8x16_t o4b = tbl96_u8(b0,b1,b2,b3,b4,b5, idx4);
|
||||
uint8x16_t o5b = tbl96_u8(b0,b1,b2,b3,b4,b5, idx5);
|
||||
|
||||
vst1q_s16(e, vreinterpretq_s16_u8(o0b)); e += 8;
|
||||
vst1q_s16(e1, vreinterpretq_s16_u8(o1b)); e1 += 8;
|
||||
vst1q_s16(e2, vreinterpretq_s16_u8(o2b)); e2 += 8;
|
||||
vst1q_s16(e3, vreinterpretq_s16_u8(o3b)); e3 += 8;
|
||||
vst1q_s16(e4, vreinterpretq_s16_u8(o4b)); e4 += 8;
|
||||
vst1q_s16(e5, vreinterpretq_s16_u8(o5b)); e5 += 8;
|
||||
}
|
||||
#elif defined(__AVX512BW__)
|
||||
|
||||
// Precompute permute control once (all compile-time constant patterns)
|
||||
const __m512i idx0_ab = make_idx_ab(0), idx1_ab = make_idx_ab(1);
|
||||
const __m512i idx2_ab = make_idx_ab(2), idx3_ab = make_idx_ab(3);
|
||||
const __m512i idx4_ab = make_idx_ab(4), idx5_ab = make_idx_ab(5);
|
||||
|
||||
const __m512i idx0_bc = make_idx_bc(0), idx1_bc = make_idx_bc(1);
|
||||
const __m512i idx2_bc = make_idx_bc(2), idx3_bc = make_idx_bc(3);
|
||||
const __m512i idx4_bc = make_idx_bc(4), idx5_bc = make_idx_bc(5);
|
||||
|
||||
const __mmask32 m0 = make_mask_bc(0), m1 = make_mask_bc(1), m2 = make_mask_bc(2);
|
||||
const __mmask32 m3 = make_mask_bc(3), m4 = make_mask_bc(4), m5 = make_mask_bc(5);
|
||||
|
||||
const __mmask32 store16 = 0xFFFFu; // store only first 16 lanes (16x u16)
|
||||
for (; i + 16 <= EQm; i += 16) {
|
||||
// 16 groups = 16*(6 u16) = 96 u16 = 192 bytes = 3 * 64B
|
||||
__m512i A = _mm512_loadu_si512((const void*)(f + 0)); // u16[0..31]
|
||||
__m512i B = _mm512_loadu_si512((const void*)(f + 32)); // u16[32..63]
|
||||
__m512i C = _mm512_loadu_si512((const void*)(f + 64)); // u16[64..95]
|
||||
f += 96;
|
||||
|
||||
// Gather from AB (global 0..63) and BC (global 32..95)
|
||||
__m512i o0_ab = _mm512_permutex2var_epi16(A, idx0_ab, B);
|
||||
__m512i o1_ab = _mm512_permutex2var_epi16(A, idx1_ab, B);
|
||||
__m512i o2_ab = _mm512_permutex2var_epi16(A, idx2_ab, B);
|
||||
__m512i o3_ab = _mm512_permutex2var_epi16(A, idx3_ab, B);
|
||||
__m512i o4_ab = _mm512_permutex2var_epi16(A, idx4_ab, B);
|
||||
__m512i o5_ab = _mm512_permutex2var_epi16(A, idx5_ab, B);
|
||||
|
||||
__m512i o0_bc = _mm512_permutex2var_epi16(B, idx0_bc, C);
|
||||
__m512i o1_bc = _mm512_permutex2var_epi16(B, idx1_bc, C);
|
||||
__m512i o2_bc = _mm512_permutex2var_epi16(B, idx2_bc, C);
|
||||
__m512i o3_bc = _mm512_permutex2var_epi16(B, idx3_bc, C);
|
||||
__m512i o4_bc = _mm512_permutex2var_epi16(B, idx4_bc, C);
|
||||
__m512i o5_bc = _mm512_permutex2var_epi16(B, idx5_bc, C);
|
||||
|
||||
// Select lanes that crossed the 64-element boundary
|
||||
__m512i o0 = _mm512_mask_mov_epi16(o0_ab, m0, o0_bc);
|
||||
__m512i o1 = _mm512_mask_mov_epi16(o1_ab, m1, o1_bc);
|
||||
__m512i o2 = _mm512_mask_mov_epi16(o2_ab, m2, o2_bc);
|
||||
__m512i o3 = _mm512_mask_mov_epi16(o3_ab, m3, o3_bc);
|
||||
__m512i o4 = _mm512_mask_mov_epi16(o4_ab, m4, o4_bc);
|
||||
__m512i o5 = _mm512_mask_mov_epi16(o5_ab, m5, o5_bc);
|
||||
|
||||
// Store only the first 16 lanes (16 groups) to each plane
|
||||
_mm512_mask_storeu_epi16((void*)e, store16, o0); e += 16;
|
||||
_mm512_mask_storeu_epi16((void*)e1, store16, o1); e1 += 16;
|
||||
_mm512_mask_storeu_epi16((void*)e2, store16, o2); e2 += 16;
|
||||
_mm512_mask_storeu_epi16((void*)e3, store16, o3); e3 += 16;
|
||||
_mm512_mask_storeu_epi16((void*)e4, store16, o4); e4 += 16;
|
||||
_mm512_mask_storeu_epi16((void*)e5, store16, o5); e5 += 16;
|
||||
}
|
||||
//
|
||||
#endif
|
||||
for (; i < EQm; i++) {
|
||||
*e++ = *f++;
|
||||
*e1++ = *f++;
|
||||
*e2++ = *f++;
|
||||
@@ -471,15 +995,181 @@ void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e, int16_t *f)
|
||||
} break;
|
||||
case 8: {
|
||||
AssertFatal(E % 8 == 0, "");
|
||||
int16_t *e1 = e + (E / 8);
|
||||
int16_t *e2 = e1 + (E / 8);
|
||||
int16_t *e3 = e2 + (E / 8);
|
||||
int16_t *e4 = e3 + (E / 8);
|
||||
int16_t *e5 = e4 + (E / 8);
|
||||
int16_t *e6 = e5 + (E / 8);
|
||||
int16_t *e7 = e6 + (E / 8);
|
||||
int16_t *end = f + E - 7;
|
||||
while (f < end) {
|
||||
int16_t *e1 = e + EQm;
|
||||
int16_t *e2 = e1 + EQm;
|
||||
int16_t *e3 = e2 + EQm;
|
||||
int16_t *e4 = e3 + EQm;
|
||||
int16_t *e5 = e4 + EQm;
|
||||
int16_t *e6 = e5 + EQm;
|
||||
int16_t *e7 = e6 + EQm;
|
||||
int i=0;
|
||||
#if 0 //defined(__aarch64__)
|
||||
// SIMDE version below is more efficient than tbl128
|
||||
// For 8 groups: byte indices for stream k are 2*(k + 8*n) for n=0..7.
|
||||
// That is: 2k + 16n (and +1 for the high byte of the u16).
|
||||
const uint8x16_t idx0 = { 0, 1, 16, 17, 32, 33, 48, 49, 64, 65, 80, 81, 96, 97,112,113 };
|
||||
const uint8x16_t idx1 = { 2, 3, 18, 19, 34, 35, 50, 51, 66, 67, 82, 83, 98, 99,114,115 };
|
||||
const uint8x16_t idx2 = { 4, 5, 20, 21, 36, 37, 52, 53, 68, 69, 84, 85,100,101,116,117 };
|
||||
const uint8x16_t idx3 = { 6, 7, 22, 23, 38, 39, 54, 55, 70, 71, 86, 87,102,103,118,119 };
|
||||
const uint8x16_t idx4 = { 8, 9, 24, 25, 40, 41, 56, 57, 72, 73, 88, 89,104,105,120,121 };
|
||||
const uint8x16_t idx5 = { 10, 11, 26, 27, 42, 43, 58, 59, 74, 75, 90, 91,106,107,122,123 };
|
||||
const uint8x16_t idx6 = { 12, 13, 28, 29, 44, 45, 60, 61, 76, 77, 92, 93,108,109,124,125 };
|
||||
const uint8x16_t idx7 = { 14, 15, 30, 31, 46, 47, 62, 63, 78, 79, 94, 95,110,111,126,127 };
|
||||
|
||||
for (; i + 8 <= EQm; i += 8) {
|
||||
// Load 128 bytes = 64 u16 = 8 groups (aligned-friendly, but vld1q_u8 is fine either way)
|
||||
uint8x16_t b0 = vld1q_u8((const uint8_t*)(f + 0)); // bytes 0..15
|
||||
uint8x16_t b1 = vld1q_u8((const uint8_t*)(f + 8)); // bytes 16..31
|
||||
uint8x16_t b2 = vld1q_u8((const uint8_t*)(f + 16)); // bytes 32..47
|
||||
uint8x16_t b3 = vld1q_u8((const uint8_t*)(f + 24)); // bytes 48..63
|
||||
uint8x16_t b4 = vld1q_u8((const uint8_t*)(f + 32)); // bytes 64..79
|
||||
uint8x16_t b5 = vld1q_u8((const uint8_t*)(f + 40)); // bytes 80..95
|
||||
uint8x16_t b6 = vld1q_u8((const uint8_t*)(f + 48)); // bytes 96..111
|
||||
uint8x16_t b7 = vld1q_u8((const uint8_t*)(f + 56)); // bytes 112..127
|
||||
f += 64; // consumed 64 u16
|
||||
|
||||
uint8x16_t o0b = tbl128_u8(b0,b1,b2,b3,b4,b5,b6,b7, idx0);
|
||||
uint8x16_t o1b = tbl128_u8(b0,b1,b2,b3,b4,b5,b6,b7, idx1);
|
||||
uint8x16_t o2b = tbl128_u8(b0,b1,b2,b3,b4,b5,b6,b7, idx2);
|
||||
uint8x16_t o3b = tbl128_u8(b0,b1,b2,b3,b4,b5,b6,b7, idx3);
|
||||
uint8x16_t o4b = tbl128_u8(b0,b1,b2,b3,b4,b5,b6,b7, idx4);
|
||||
uint8x16_t o5b = tbl128_u8(b0,b1,b2,b3,b4,b5,b6,b7, idx5);
|
||||
uint8x16_t o6b = tbl128_u8(b0,b1,b2,b3,b4,b5,b6,b7, idx6);
|
||||
uint8x16_t o7b = tbl128_u8(b0,b1,b2,b3,b4,b5,b6,b7, idx7);
|
||||
|
||||
vst1q_s16(e, vreinterpretq_s16_u8(o0b)); e += 8;
|
||||
vst1q_s16(e1, vreinterpretq_s16_u8(o1b)); e1 += 8;
|
||||
vst1q_s16(e2, vreinterpretq_s16_u8(o2b)); e2 += 8;
|
||||
vst1q_s16(e3, vreinterpretq_s16_u8(o3b)); e3 += 8;
|
||||
vst1q_s16(e4, vreinterpretq_s16_u8(o4b)); e4 += 8;
|
||||
vst1q_s16(e5, vreinterpretq_s16_u8(o5b)); e5 += 8;
|
||||
vst1q_s16(e6, vreinterpretq_s16_u8(o6b)); e6 += 8;
|
||||
vst1q_s16(e7, vreinterpretq_s16_u8(o7b)); e7 += 8;
|
||||
}
|
||||
#elif defined(__AVX512BW__)
|
||||
|
||||
// Precompute indices for each stream k=0..7
|
||||
const __m512i idx0 = idx_stride_u16(8,0);
|
||||
const __m512i idx1 = idx_stride_u16(8,1);
|
||||
const __m512i idx2 = idx_stride_u16(8,2);
|
||||
const __m512i idx3 = idx_stride_u16(8,3);
|
||||
const __m512i idx4 = idx_stride_u16(8,4);
|
||||
const __m512i idx5 = idx_stride_u16(8,5);
|
||||
const __m512i idx6 = idx_stride_u16(8,6);
|
||||
const __m512i idx7 = idx_stride_u16(8,7);
|
||||
|
||||
const __m512i c64 = _mm512_set1_epi16(64);
|
||||
const __m512i c128 = _mm512_set1_epi16(128);
|
||||
const __m512i c192 = _mm512_set1_epi16(192);
|
||||
|
||||
for (; i + 32 <= EQm; i += 32) {
|
||||
// 32 groups * 8 u16 = 256 u16 = 8 * 32 u16 = 8 ZMM vectors
|
||||
__m512i A = _mm512_loadu_si512((const void*)(f + 0)); // u16[ 0.. 31]
|
||||
__m512i B = _mm512_loadu_si512((const void*)(f + 32)); // u16[ 32.. 63]
|
||||
__m512i C = _mm512_loadu_si512((const void*)(f + 64)); // u16[ 64.. 95]
|
||||
__m512i D = _mm512_loadu_si512((const void*)(f + 96)); // u16[ 96..127]
|
||||
__m512i E = _mm512_loadu_si512((const void*)(f + 128)); // u16[128..159]
|
||||
__m512i F = _mm512_loadu_si512((const void*)(f + 160)); // u16[160..191]
|
||||
__m512i G = _mm512_loadu_si512((const void*)(f + 192)); // u16[192..223]
|
||||
__m512i H = _mm512_loadu_si512((const void*)(f + 224)); // u16[224..255]
|
||||
f += 256;
|
||||
// Helper macro: compute one stream (k) by permuting from 4 segments and blending
|
||||
#define DO_STREAM(IDX, OUTPTR) do { \
|
||||
/* segment masks based on global index p = k+8*n */ \
|
||||
__mmask32 m1 = _mm512_cmpge_epu16_mask((IDX), c64); \
|
||||
__mmask32 m2 = _mm512_cmpge_epu16_mask((IDX), c128); \
|
||||
__mmask32 m3 = _mm512_cmpge_epu16_mask((IDX), c192); \
|
||||
/* indices relative to each segment base */ \
|
||||
__m512i i0 = (IDX); \
|
||||
__m512i i1 = _mm512_sub_epi16((IDX), c64); \
|
||||
__m512i i2 = _mm512_sub_epi16((IDX), c128); \
|
||||
__m512i i3 = _mm512_sub_epi16((IDX), c192); \
|
||||
/* permute from each 64-u16 segment (two ZMMs per segment) */ \
|
||||
__m512i r0 = _mm512_permutex2var_epi16(A, i0, B); \
|
||||
__m512i r1 = _mm512_permutex2var_epi16(C, i1, D); \
|
||||
__m512i r2 = _mm512_permutex2var_epi16(E, i2, F); \
|
||||
__m512i r3 = _mm512_permutex2var_epi16(G, i3, H); \
|
||||
/* blend: later segments overwrite earlier where applicable */ \
|
||||
__m512i r = _mm512_mask_mov_epi16(r0, m1, r1); \
|
||||
r = _mm512_mask_mov_epi16(r, m2, r2); \
|
||||
r = _mm512_mask_mov_epi16(r, m3, r3); \
|
||||
_mm512_storeu_si512((void*)(OUTPTR), r); \
|
||||
(OUTPTR) += 32; \
|
||||
} while(0)
|
||||
DO_STREAM(idx0, e);
|
||||
DO_STREAM(idx1, e1);
|
||||
DO_STREAM(idx2, e2);
|
||||
DO_STREAM(idx3, e3);
|
||||
DO_STREAM(idx4, e4);
|
||||
DO_STREAM(idx5, e5);
|
||||
DO_STREAM(idx6, e6);
|
||||
DO_STREAM(idx7, e7);
|
||||
|
||||
#undef DO_STREAM
|
||||
}
|
||||
|
||||
#else
|
||||
simde__m128i *e0_128 = (simde__m128i *)e;
|
||||
simde__m128i *e1_128 = (simde__m128i *)e1;
|
||||
simde__m128i *e2_128 = (simde__m128i *)e2;
|
||||
simde__m128i *e3_128 = (simde__m128i *)e3;
|
||||
simde__m128i *e4_128 = (simde__m128i *)e4;
|
||||
simde__m128i *e5_128 = (simde__m128i *)e5;
|
||||
simde__m128i *e6_128 = (simde__m128i *)e6;
|
||||
simde__m128i *e7_128 = (simde__m128i *)e7;
|
||||
simde__m128i *f128 = (simde__m128i *)f;
|
||||
|
||||
for (i=0; i < (EQm & ~7); i += 8) {
|
||||
simde__m128i f0j = simde_mm_loadu_si128(f128++);
|
||||
simde__m128i f1j = simde_mm_loadu_si128(f128++);
|
||||
simde__m128i f2j = simde_mm_loadu_si128(f128++);
|
||||
simde__m128i f3j = simde_mm_loadu_si128(f128++);
|
||||
simde__m128i f4j = simde_mm_loadu_si128(f128++);
|
||||
simde__m128i f5j = simde_mm_loadu_si128(f128++);
|
||||
simde__m128i f6j = simde_mm_loadu_si128(f128++);
|
||||
simde__m128i f7j = simde_mm_loadu_si128(f128++);
|
||||
|
||||
simde__m128i tmp0 = simde_mm_unpacklo_epi16(f0j, f1j); // f0(i) f1(i) f0(i+1) f1(i+1) f0(i+2) f1(i+2) f0(i+3) f1(i+3)
|
||||
simde__m128i tmp1 = simde_mm_unpacklo_epi16(f2j, f3j); // f2(i) f3(i) f2(i+1) f3(i+1) f2(i+2) f3(i+2) f2(i+3) f3(i+3)
|
||||
simde__m128i tmp2 = simde_mm_unpacklo_epi16(f4j, f5j); // f4(i) f5(i) f4(i+1) f5(i+1) f4(i+2) f5(i+2) f4(i+3) f5(i+3)
|
||||
simde__m128i tmp3 = simde_mm_unpacklo_epi16(f6j, f7j); // f6(i) f7(i) f6(i+1) f7(i+1) f6(i+2) f7(i+2) f6(i+3) f7(i+3)
|
||||
//
|
||||
simde__m128i tmp4 = simde_mm_unpacklo_epi32(tmp0, tmp1); // f0(i) f1(i) f2(i) f3(i) f0(i+1) f1(i+1) f2(i+1) f3(i+1)
|
||||
simde__m128i tmp5 = simde_mm_unpacklo_epi32(tmp2, tmp3); // f4(i) f5(i) f6(i) f7(i) f4(i+1) f5(i+1) f6(i+1) f7(i+1)
|
||||
simde_mm_storeu_si128(e0_128++,simde_mm_unpacklo_epi64(tmp4, tmp5)); // f0(i) f1(i) f2(i) f3(i) f4(i) f5(i) f7(i) f7(i)
|
||||
simde_mm_storeu_si128(e1_128++,simde_mm_unpackhi_epi64(tmp4, tmp5));// f0(i+1) f1(i+1) f2(i+1) f3(i+1) f4(i+1) f5(i+1) f6(i+1) f7(i+1)
|
||||
//
|
||||
tmp4 = simde_mm_unpackhi_epi32(tmp0, tmp1); // f0(i+2) f1(i+2) f2(i+2) f3(i+2) f0(i+3) f1(i+3) f2(i+3) f3(i+3)
|
||||
tmp5 = simde_mm_unpackhi_epi32(tmp2, tmp3); // f4(i+2) f5(i+2) f6(i+2) f7(i+2) f4(i+3) f5(i+3) f6(i+3) f7(i+3)
|
||||
simde_mm_storeu_si128(e2_128++,simde_mm_unpacklo_epi64(tmp4, tmp5));// f0(i+2) f1(i+2) f2(i+2) f3(i+2) f4(i+2) f5(i+2) f7(i+2) f7(i+2)
|
||||
simde_mm_storeu_si128(e3_128++,simde_mm_unpackhi_epi64(tmp4, tmp5)); // f0(i+3) f1(i+3) f2(i+3) f3(i+3) f4(i+3) f5(i+3) f7(i+3) f7(i+3)
|
||||
|
||||
tmp0 = simde_mm_unpackhi_epi16(f0j, f1j); // f0(i+4) f1(i+4) f0(i+5) f1(i+5) f0(i+6) f1(i+6) f0(i+7) f1(i+7)
|
||||
tmp1 = simde_mm_unpackhi_epi16(f2j, f3j); // f2(i+4) f3(i+4) f2(i+5) f3(i+5) f2(i+6) f3(i+6) f2(i+7) f3(i+7)
|
||||
tmp2 = simde_mm_unpackhi_epi16(f4j, f5j); // f4(i+4) f5(i+4) f4(i+5) f5(i+5) f4(i+6) f5(i+6) f4(i+7) f5(i+7)
|
||||
tmp3 = simde_mm_unpackhi_epi16(f6j, f7j); // f6(i+4) f7(i+4) f6(i+5) f7(i+5) f6(i+6) f7(i+6) f6(i+7) f7(i+7)
|
||||
//
|
||||
tmp4 = simde_mm_unpacklo_epi32(tmp0, tmp1); // f0(i+4) f1(i+4) f2(i+4) f3(i+4) f0(i+5) f1(i+5) f2(i+5) f3(i+5)
|
||||
tmp5 = simde_mm_unpacklo_epi32(tmp2, tmp3); // f4(i+4) f5(i+4) f6(i+4) f7(i+4) f4(i+5) f5(i+5) f6(i+5) f7(i+5)
|
||||
|
||||
simde_mm_storeu_si128(e4_128++,simde_mm_unpacklo_epi64(tmp4, tmp5)); // f0(i+4) f1(i+4) f2(i+4) f3(i+4) f4(i+4) f5(i+4) f7(i+4) f7(i+4)
|
||||
simde_mm_storeu_si128(e5_128++,simde_mm_unpackhi_epi64(tmp4, tmp5));// f0(i+5) f1(i+5) f2(i+5) f3(i+5) f4(i+5) f5(i+5) f6(i+5) f7(i+5)
|
||||
tmp4 = simde_mm_unpackhi_epi32(tmp0, tmp1); // f0(i+6) f1(i+6) f2(i+6) f3(i+6) f0(i+6) f1(i+6) f2(i+6) f3(i+6)
|
||||
tmp5 = simde_mm_unpackhi_epi32(tmp2, tmp3); // f4(i+6) f5(i+6) f6(i+6) f7(i+6) f4(i+6) f5(i+6) f6(i+6) f7(i+6)
|
||||
simde_mm_storeu_si128(e6_128++,simde_mm_unpacklo_epi64(tmp4, tmp5));// f0(i+6) f1(i+6) f2(i+6) f3(i+6) f4(i+6) f5(i+6) f7(i+6) f7(i+6)
|
||||
simde_mm_storeu_si128(e7_128++,simde_mm_unpackhi_epi64(tmp4, tmp5)); // f0(i+7) f1(i+7) f2(i+7) f3(i+7) f4(i+7) f5(i+7) f7(i+7) f7(i+7)
|
||||
}
|
||||
e = (int16_t *)e0_128;
|
||||
e1 = (int16_t *)e1_128;
|
||||
e2 = (int16_t *)e2_128;
|
||||
e3 = (int16_t *)e3_128;
|
||||
e4 = (int16_t *)e4_128;
|
||||
e5 = (int16_t *)e5_128;
|
||||
e6 = (int16_t *)e6_128;
|
||||
e7 = (int16_t *)e7_128;
|
||||
f = (int16_t *)f128;
|
||||
#endif
|
||||
for(;i < EQm ; i++) {
|
||||
*e++ = *f++;
|
||||
*e1++ = *f++;
|
||||
*e2++ = *f++;
|
||||
@@ -494,6 +1184,7 @@ void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e, int16_t *f)
|
||||
AssertFatal(1 == 0, "Should not get here : Qm %d\n", Qm);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int nr_rate_matching_ldpc(uint32_t Tbslbrm,
|
||||
@@ -576,6 +1267,107 @@ int nr_rate_matching_ldpc(uint32_t Tbslbrm,
|
||||
}
|
||||
}
|
||||
|
||||
while (k < E) { // case where we do repetitions (low mcs)
|
||||
// chunk before filler: d[0 .. Foffset)
|
||||
if (Foffset > 0) {
|
||||
uint32_t n = min(Foffset, E - k);
|
||||
memcpy(e + k, d, n);
|
||||
k += n;
|
||||
if (k >= E)
|
||||
break;
|
||||
}
|
||||
// chunk after filler: d[Foffset+F .. Ncb)
|
||||
uint32_t after = Ncb - Foffset - F;
|
||||
if (after > 0) {
|
||||
uint32_t n = min(after, E - k);
|
||||
memcpy(e + k, d + Foffset + F, n);
|
||||
k += n;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nr_rate_matching_ldpc32(uint32_t Tbslbrm,
|
||||
uint8_t BG,
|
||||
uint16_t Z,
|
||||
uint32_t *d,
|
||||
uint32_t *e,
|
||||
uint8_t C,
|
||||
uint32_t F,
|
||||
uint32_t Foffset,
|
||||
uint8_t rvidx,
|
||||
uint32_t E)
|
||||
{
|
||||
if (C == 0) {
|
||||
LOG_E(PHY, "nr_rate_matching: invalid parameter C %d\n", C);
|
||||
return -1;
|
||||
}
|
||||
|
||||
//Bit selection
|
||||
uint32_t N = (BG == 1) ? (66 * Z) : (50 * Z);
|
||||
uint32_t Ncb;
|
||||
if (Tbslbrm == 0)
|
||||
Ncb = N;
|
||||
else {
|
||||
uint32_t Nref = 3 * Tbslbrm / (2 * C); //R_LBRM = 2/3
|
||||
Ncb = min(N, Nref);
|
||||
}
|
||||
|
||||
uint32_t ind = (index_k0[BG - 1][rvidx] * Ncb / N) * Z;
|
||||
|
||||
#ifdef RM_DEBUG
|
||||
printf("nr_rate_matching_ldpc: E %u, F %u, Foffset %u, k0 %u, Ncb %u, rvidx %d, Tbslbrm %u\n",
|
||||
E,
|
||||
F,
|
||||
Foffset,
|
||||
ind,
|
||||
Ncb,
|
||||
rvidx,
|
||||
Tbslbrm);
|
||||
#endif
|
||||
|
||||
if (Foffset > E) {
|
||||
LOG_E(PHY,
|
||||
"nr_rate_matching: invalid parameters (Foffset %d > E %d) F %d, k0 %d, Ncb %d, rvidx %d, Tbslbrm %d\n",
|
||||
Foffset,
|
||||
E,
|
||||
F,
|
||||
ind,
|
||||
Ncb,
|
||||
rvidx,
|
||||
Tbslbrm);
|
||||
return -1;
|
||||
}
|
||||
if (Foffset > Ncb) {
|
||||
LOG_E(PHY, "nr_rate_matching: invalid parameters (Foffset %d > Ncb %d)\n", Foffset, Ncb);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ind >= Foffset && ind < (F + Foffset))
|
||||
ind = F + Foffset;
|
||||
|
||||
uint32_t k = 0;
|
||||
if (ind < Foffset) { // case where we have some bits before the filler and the rest after
|
||||
memcpy((void *)e, (void *)(d + ind), (Foffset - ind)<<2);
|
||||
|
||||
if (E + F <= Ncb - ind) { // E+F doesn't contain all coded bits
|
||||
memcpy((void *)(e + Foffset - ind), (void *)(d + Foffset + F), (E - Foffset + ind)<<2);
|
||||
k = E;
|
||||
} else {
|
||||
memcpy((void *)(e + Foffset - ind), (void *)(d + Foffset + F), (Ncb - Foffset - F)<<2);
|
||||
k = Ncb - F - ind;
|
||||
}
|
||||
} else {
|
||||
if (E <= Ncb - ind) { // E+F doesn't contain all coded bits
|
||||
memcpy((void *)(e), (void *)(d + ind), E<<2);
|
||||
k = E;
|
||||
} else {
|
||||
memcpy((void *)(e), (void *)(d + ind), (Ncb - ind)<<2);
|
||||
k = Ncb - ind;
|
||||
}
|
||||
}
|
||||
|
||||
while (k < E) { // case where we do repetitions (low mcs)
|
||||
for (ind = 0; (ind < Ncb) && (k < E); ind++) {
|
||||
#ifdef RM_DEBUG
|
||||
@@ -593,6 +1385,11 @@ int nr_rate_matching_ldpc(uint32_t Tbslbrm,
|
||||
return 0;
|
||||
}
|
||||
|
||||
//#define USE_SCALAR 1
|
||||
#define RMLOOP for (;ind<(ind2&7);k+=8,ind+=8) \
|
||||
simde_mm_storeu_si128(&d[ind],simde_mm_adds_epi16(simde_mm_loadu_si128(&soft_input[k]),simde_mm_loadu_si128(&d[ind])));\
|
||||
for (; ind<ind2 ; ind++,k++) d[ind] += soft_input[k];
|
||||
|
||||
int nr_rate_matching_ldpc_rx(uint32_t Tbslbrm,
|
||||
uint8_t BG,
|
||||
uint16_t Z,
|
||||
@@ -645,7 +1442,8 @@ int nr_rate_matching_ldpc_rx(uint32_t Tbslbrm,
|
||||
memset(d, 0, Ncb * sizeof(int16_t));
|
||||
|
||||
uint32_t k = 0;
|
||||
if (ind < Foffset)
|
||||
if (ind < Foffset) {
|
||||
#ifdef USE_SCALAR
|
||||
for (; (ind < Foffset) && (k < E); ind++) {
|
||||
#ifdef RM_DEBUG
|
||||
printf("RM_RX k%u Ind %u(before filler): %d (%d)=>", k, ind, d[ind], soft_input[k]);
|
||||
@@ -655,9 +1453,14 @@ int nr_rate_matching_ldpc_rx(uint32_t Tbslbrm,
|
||||
printf("%d\n", d[ind]);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
int ind2 = ind + min(Foffset-ind,E);
|
||||
RMLOOP;
|
||||
#endif
|
||||
}
|
||||
if (ind >= Foffset && ind < Foffset + F)
|
||||
ind = Foffset + F;
|
||||
|
||||
#ifdef USE_SCALAR
|
||||
for (; (ind < Ncb) && (k < E); ind++) {
|
||||
#ifdef RM_DEBUG
|
||||
printf("RM_RX k%u Ind %u(after filler) %d (%d)=>", k, ind, d[ind], soft_input[k]);
|
||||
@@ -667,8 +1470,13 @@ int nr_rate_matching_ldpc_rx(uint32_t Tbslbrm,
|
||||
printf("%d\n", d[ind]);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
int ind2 = ind + min(Ncb-ind,E-k);
|
||||
RMLOOP;
|
||||
#endif
|
||||
|
||||
while (k < E) {
|
||||
#ifdef USE_SCALAR
|
||||
for (ind = 0; (ind < Foffset) && (k < E); ind++) {
|
||||
#ifdef RM_DEBUG
|
||||
printf("RM_RX k%u Ind %u(before filler) %d(%d)=>", k, ind, d[ind], soft_input[k]);
|
||||
@@ -687,6 +1495,14 @@ int nr_rate_matching_ldpc_rx(uint32_t Tbslbrm,
|
||||
printf("%d\n", d[ind]);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
ind=0;
|
||||
ind2 = min(Foffset,E-k);
|
||||
RMLOOP;
|
||||
ind = Foffset+F;
|
||||
ind2 = ind + min(Ncb-ind,E-k);
|
||||
RMLOOP;
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,15 @@
|
||||
*/
|
||||
void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e, uint8_t *f);
|
||||
|
||||
/**
|
||||
* \brief interleave a code segment after encoding and rate matching (32bit)
|
||||
* \param E size of the code segment in bits
|
||||
* \param Qm modulation order
|
||||
* \param e input rate matched segment
|
||||
* \param f output interleaved segment
|
||||
*/
|
||||
|
||||
void nr_interleaving_ldpc32(uint32_t E, uint8_t Qm, uint32_t *e, uint32_t *f);
|
||||
/**
|
||||
* \brief deinterleave a code segment before RX rate matching and decoding
|
||||
* \param E size of the code segment in bits
|
||||
@@ -49,6 +58,30 @@ int nr_rate_matching_ldpc(uint32_t Tbslbrm,
|
||||
uint8_t rvidx,
|
||||
uint32_t E);
|
||||
|
||||
/**
|
||||
* \brief rate match a code segment after encoding (32bit)
|
||||
* \Tbslbrm Transport Block size LBRM
|
||||
* \param BG LDPC base graph number
|
||||
* \param Z segment lifting size
|
||||
* \param d input encoded segment
|
||||
* \param e output rate matched segment
|
||||
* \param C number of segments in the Transport Block
|
||||
* \param F number of filler bits in the segment
|
||||
* \param Foffset offset of the filler bits in the segment
|
||||
* \param rvidx redundancy version index
|
||||
* \param E size of the code segment in bits
|
||||
*/
|
||||
int nr_rate_matching_ldpc32(uint32_t Tbslbrm,
|
||||
uint8_t BG,
|
||||
uint16_t Z,
|
||||
uint32_t *d,
|
||||
uint32_t *e,
|
||||
uint8_t C,
|
||||
uint32_t F,
|
||||
uint32_t Foffset,
|
||||
uint8_t rvidx,
|
||||
uint32_t E);
|
||||
|
||||
/**
|
||||
* \brief rate match a code segment before decoding
|
||||
* \Tbslbrm Transport Block size LBRM
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
##########################################################
|
||||
|
||||
# LDPC offload library - XDMA
|
||||
##########################################################
|
||||
|
||||
add_boolean_option(ENABLE_LDPC_XDMA OFF "Build support for LDPC Offload to XDMA library" OFF)
|
||||
|
||||
if (ENABLE_LDPC_XDMA)
|
||||
|
||||
add_library(ldpc_xdma MODULE
|
||||
nrLDPC_coding_xdma_offload.c
|
||||
nrLDPC_coding_xdma.c
|
||||
../nrLDPC_coding_segment/nr_rate_matching.c
|
||||
../nrLDPC_coding_segment/nrLDPC_coding_segment_encoder.c
|
||||
../../nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
|
||||
)
|
||||
target_include_directories(ldpc_xdma PRIVATE ../nrLDPC_coding_segment)
|
||||
|
||||
target_link_libraries(ldpc_xdma PRIVATE ldpc_gen_HEADERS log_headers)
|
||||
set_target_properties(ldpc_xdma PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
|
||||
add_dependencies(nr-softmodem ldpc_xdma)
|
||||
add_dependencies(nr-uesoftmodem ldpc_xdma)
|
||||
add_dependencies(nr_ulsim ldpc_xdma)
|
||||
add_dependencies(nr_ulschsim ldpc_xdma)
|
||||
add_dependencies(nr_dlsim ldpc_xdma)
|
||||
add_dependencies(nr_dlschsim ldpc_xdma)
|
||||
|
||||
endif()
|
||||
@@ -1,414 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
/*! \file PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma.c
|
||||
* \brief Top-level routines for decoding LDPC (ULSCH) transport channels
|
||||
* decoding implemented using a FEC IP core on FPGA through XDMA driver
|
||||
*/
|
||||
|
||||
// [from gNB coding]
|
||||
#include <syscall.h>
|
||||
|
||||
#include <nr_rate_matching.h>
|
||||
#include "PHY/CODING/coding_defs.h"
|
||||
#include "PHY/CODING/coding_extern.h"
|
||||
#include "PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma_offload.h"
|
||||
#include "PHY/CODING/nrLDPC_extern.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "defs.h"
|
||||
// #define DEBUG_ULSCH_DECODING
|
||||
// #define gNB_DEBUG_TRACE
|
||||
|
||||
#define OAI_UL_LDPC_MAX_NUM_LLR 27000 // 26112 // NR_LDPC_NCOL_BG1*NR_LDPC_ZMAX = 68*384
|
||||
// #define DEBUG_CRC
|
||||
#ifdef DEBUG_CRC
|
||||
#define PRINT_CRC_CHECK(a) a
|
||||
#else
|
||||
#define PRINT_CRC_CHECK(a)
|
||||
#endif
|
||||
|
||||
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h"
|
||||
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h"
|
||||
|
||||
#include "PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h"
|
||||
|
||||
// Global var to limit the rework of the dirty legacy code
|
||||
int num_threads_prepare_max = 0;
|
||||
char *user_device = NULL;
|
||||
char *enc_read_device = NULL;
|
||||
char *enc_write_device = NULL;
|
||||
char *dec_read_device = NULL;
|
||||
char *dec_write_device = NULL;
|
||||
|
||||
/*!
|
||||
* \typedef args_fpga_decode_prepare_t
|
||||
* \struct args_fpga_decode_prepare_s
|
||||
* \brief arguments structure for passing arguments to the nr_ulsch_FPGA_decoding_prepare_blocks function
|
||||
*/
|
||||
typedef struct args_fpga_decode_prepare_s {
|
||||
nrLDPC_TB_decoding_parameters_t *TB_params; /*!< transport blocks parameters */
|
||||
|
||||
uint8_t *multi_indata; /*!< pointer to the head of the block destination array that is then passed to the FPGA decoding */
|
||||
int no_iteration_ldpc; /*!< pointer to the number of iteration set by this function */
|
||||
uint32_t r_first; /*!< index of the first block to be prepared within this function */
|
||||
uint32_t r_span; /*!< number of blocks to be prepared within this function */
|
||||
int r_offset; /*!< r index expressed in bits */
|
||||
int input_CBoffset; /*!< */
|
||||
int Kc; /*!< ratio between the number of columns in the parity check graph and the lifting size */
|
||||
int Kprime; /*!< size of payload and CRC bits in a code block */
|
||||
task_ans_t *ans; /*!< pointer to the answer that is used by thread pool to detect job completion */
|
||||
} args_fpga_decode_prepare_t;
|
||||
|
||||
int32_t nrLDPC_coding_init(void);
|
||||
int32_t nrLDPC_coding_shutdown(void);
|
||||
int32_t nrLDPC_coding_decoder(nrLDPC_slot_decoding_parameters_t *slot_params, int frame_rx, int slot_rx);
|
||||
// int32_t nrLDPC_coding_encoder(void);
|
||||
int decoder_xdma(nrLDPC_TB_decoding_parameters_t *TB_params, int frame_rx, int slot_rx, tpool_t *ldpc_threadPool);
|
||||
void nr_ulsch_FPGA_decoding_prepare_blocks(void *args);
|
||||
|
||||
int32_t nrLDPC_coding_init(void)
|
||||
{
|
||||
paramdef_t LoaderParams[] = {
|
||||
{"num_threads_prepare", NULL, 0, .iptr = &num_threads_prepare_max, .defintval = 0, TYPE_INT, 0, NULL},
|
||||
{"user_device", NULL, 0, .strptr = &user_device, .defstrval = DEVICE_NAME_DEFAULT_USER, TYPE_STRING, 0, NULL},
|
||||
{"enc_read_device", NULL, 0, .strptr = &enc_read_device, .defstrval = DEVICE_NAME_DEFAULT_ENC_READ, TYPE_STRING, 0, NULL},
|
||||
{"enc_write_device", NULL, 0, .strptr = &enc_write_device, .defstrval = DEVICE_NAME_DEFAULT_ENC_WRITE, TYPE_STRING, 0, NULL},
|
||||
{"dec_read_device", NULL, 0, .strptr = &dec_read_device, .defstrval = DEVICE_NAME_DEFAULT_DEC_READ, TYPE_STRING, 0, NULL},
|
||||
{"dec_write_device", NULL, 0, .strptr = &dec_write_device, .defstrval = DEVICE_NAME_DEFAULT_DEC_WRITE, TYPE_STRING, 0, NULL}};
|
||||
config_get(config_get_if(), LoaderParams, sizeofArray(LoaderParams), "nrLDPC_coding_xdma");
|
||||
AssertFatal(num_threads_prepare_max != 0, "nrLDPC_coding_xdma.num_threads_prepare was not provided");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t nrLDPC_coding_shutdown(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t nrLDPC_coding_decoder(nrLDPC_slot_decoding_parameters_t *slot_params, int frame_rx, int slot_rx)
|
||||
{
|
||||
int nbDecode = 0;
|
||||
for (int ULSCH_id = 0; ULSCH_id < slot_params->nb_TBs; ULSCH_id++)
|
||||
nbDecode += decoder_xdma(&slot_params->TBs[ULSCH_id], frame_rx, slot_rx, slot_params->threadPool);
|
||||
return nbDecode;
|
||||
}
|
||||
|
||||
/*
|
||||
int32_t nrLDPC_coding_encoder(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
int decoder_xdma(nrLDPC_TB_decoding_parameters_t *TB_params, int frame_rx, int slot_rx, tpool_t *ldpc_threadPool)
|
||||
{
|
||||
const uint32_t K = TB_params->K;
|
||||
const int Kc = TB_params->BG == 2 ? 52 : 68;
|
||||
int r_offset = 0, offset = 0;
|
||||
int Kprime = K - TB_params->F;
|
||||
|
||||
// FPGA parameter preprocessing
|
||||
static uint8_t multi_indata[27000 * 25]; // FPGA input data
|
||||
static uint8_t multi_outdata[1100 * 25]; // FPGA output data
|
||||
|
||||
int bg_len = TB_params->BG == 1 ? 22 : 10;
|
||||
|
||||
// Calc input CB offset
|
||||
int input_CBoffset = TB_params->Z * Kc * 8;
|
||||
if ((input_CBoffset & 0x7F) == 0)
|
||||
input_CBoffset = input_CBoffset / 8;
|
||||
else
|
||||
input_CBoffset = 16 * ((input_CBoffset / 128) + 1);
|
||||
|
||||
DecIFConf dec_conf = {0};
|
||||
dec_conf.Zc = TB_params->Z;
|
||||
dec_conf.BG = TB_params->BG;
|
||||
dec_conf.max_iter = TB_params->max_ldpc_iterations;
|
||||
dec_conf.numCB = TB_params->C;
|
||||
// input soft bits length, Zc x 66 - length of filler bits
|
||||
dec_conf.numChannelLls = (Kprime - 2 * TB_params->Z) + (Kc * TB_params->Z - K);
|
||||
// filler bits length
|
||||
dec_conf.numFillerBits = TB_params->F;
|
||||
dec_conf.max_schedule = 0;
|
||||
dec_conf.SetIdx = 12;
|
||||
dec_conf.nRows = (dec_conf.BG == 1) ? 46 : 42;
|
||||
|
||||
dec_conf.user_device = user_device;
|
||||
dec_conf.enc_read_device = enc_read_device;
|
||||
dec_conf.enc_write_device = enc_write_device;
|
||||
dec_conf.dec_read_device = dec_read_device;
|
||||
dec_conf.dec_write_device = dec_write_device;
|
||||
|
||||
int out_CBoffset = dec_conf.Zc * bg_len;
|
||||
if ((out_CBoffset & 0x7F) == 0)
|
||||
out_CBoffset = out_CBoffset / 8;
|
||||
else
|
||||
out_CBoffset = 16 * ((out_CBoffset / 128) + 1);
|
||||
|
||||
#ifdef LDPC_DATA
|
||||
printf("\n------------------------\n");
|
||||
printf("BG:\t\t%d\n", dec_conf.BG);
|
||||
printf("TB_params->C: %d\n", TB_params->C);
|
||||
printf("TB_params->K: %d\n", TB_params->K);
|
||||
printf("TB_params->Z: %d\n", TB_params->Z);
|
||||
printf("TB_params->F: %d\n", TB_params->F);
|
||||
printf("numChannelLls:\t %d = (%d - 2 * %d) + (%d * %d - %d)\n",
|
||||
dec_conf.numChannelLls,
|
||||
Kprime,
|
||||
TB_params->Z,
|
||||
Kc,
|
||||
TB_params->Z,
|
||||
K);
|
||||
printf("numFillerBits:\t %d\n", TB_params->F);
|
||||
printf("------------------------\n");
|
||||
// ===================================
|
||||
// debug mode
|
||||
// ===================================
|
||||
FILE *fptr_llr, *fptr_ldpc;
|
||||
fptr_llr = fopen("../../../cmake_targets/log/ulsim_ldpc_llr.txt", "w");
|
||||
fptr_ldpc = fopen("../../../cmake_targets/log/ulsim_ldpc_output.txt", "w");
|
||||
// ===================================
|
||||
#endif
|
||||
|
||||
int length_dec = lenWithCrc(TB_params->C, TB_params->A);
|
||||
uint8_t crc_type = crcType(TB_params->C, TB_params->A);
|
||||
int no_iteration_ldpc = 2;
|
||||
|
||||
uint32_t num_threads_prepare = 0;
|
||||
|
||||
// calculate required number of jobs
|
||||
uint32_t r_while = 0;
|
||||
while (r_while < TB_params->C) {
|
||||
// calculate number of segments processed in the new job
|
||||
uint32_t modulus = (TB_params->C - r_while) % (num_threads_prepare_max - num_threads_prepare);
|
||||
uint32_t quotient = (TB_params->C - r_while) / (num_threads_prepare_max - num_threads_prepare);
|
||||
uint32_t r_span_max = modulus == 0 ? quotient : quotient + 1;
|
||||
|
||||
// saturate to be sure to not go above C
|
||||
uint32_t r_span = TB_params->C - r_while < r_span_max ? TB_params->C - r_while : r_span_max;
|
||||
|
||||
// increment
|
||||
num_threads_prepare++;
|
||||
r_while += r_span;
|
||||
}
|
||||
|
||||
args_fpga_decode_prepare_t arr[num_threads_prepare];
|
||||
task_ans_t ans[num_threads_prepare];
|
||||
memset(ans, 0, num_threads_prepare * sizeof(task_ans_t));
|
||||
thread_info_tm_t t_info = {.buf = (uint8_t *)arr, .len = 0, .cap = num_threads_prepare, .ans = ans};
|
||||
|
||||
// start the prepare jobs
|
||||
uint32_t r_remaining = 0;
|
||||
for (uint32_t r = 0; r < TB_params->C; r++) {
|
||||
nrLDPC_segment_decoding_parameters_t *segment_params = &TB_params->segments[r];
|
||||
if (r_remaining == 0) {
|
||||
// TODO: int nr_tti_rx = 0;
|
||||
|
||||
args_fpga_decode_prepare_t *args = &((args_fpga_decode_prepare_t *)t_info.buf)[t_info.len];
|
||||
DevAssert(t_info.len < t_info.cap);
|
||||
args->ans = &t_info.ans[t_info.len];
|
||||
t_info.len += 1;
|
||||
|
||||
args->TB_params = TB_params;
|
||||
args->multi_indata = multi_indata;
|
||||
args->no_iteration_ldpc = no_iteration_ldpc;
|
||||
args->r_first = r;
|
||||
|
||||
uint32_t modulus = (TB_params->C - r) % (num_threads_prepare_max - num_threads_prepare);
|
||||
uint32_t quotient = (TB_params->C - r) / (num_threads_prepare_max - num_threads_prepare);
|
||||
uint32_t r_span_max = modulus == 0 ? quotient : quotient + 1;
|
||||
|
||||
uint32_t r_span = TB_params->C - r < r_span_max ? TB_params->C - r : r_span_max;
|
||||
args->r_span = r_span;
|
||||
args->r_offset = r_offset;
|
||||
args->input_CBoffset = input_CBoffset;
|
||||
args->Kc = Kc;
|
||||
args->Kprime = Kprime;
|
||||
|
||||
r_remaining = r_span;
|
||||
|
||||
task_t t = {.func = &nr_ulsch_FPGA_decoding_prepare_blocks, .args = args};
|
||||
pushTpool(ldpc_threadPool, t);
|
||||
|
||||
LOG_D(PHY, "Added %d block(s) to prepare for decoding, in pipe: %d to %d\n", r_span, r, r + r_span - 1);
|
||||
}
|
||||
r_offset += segment_params->E;
|
||||
offset += ((K >> 3) - (TB_params->F >> 3) - ((TB_params->C > 1) ? 3 : 0));
|
||||
r_remaining -= 1;
|
||||
}
|
||||
|
||||
// reset offset in order to properly fill the output array later
|
||||
offset = 0;
|
||||
|
||||
DevAssert(num_threads_prepare == t_info.len);
|
||||
|
||||
// wait for the prepare jobs to complete
|
||||
join_task_ans(t_info.ans);
|
||||
|
||||
for (uint32_t job = 0; job < num_threads_prepare; job++) {
|
||||
args_fpga_decode_prepare_t *args = &arr[job];
|
||||
if (args->no_iteration_ldpc >= TB_params->max_ldpc_iterations)
|
||||
no_iteration_ldpc = TB_params->max_ldpc_iterations;
|
||||
}
|
||||
|
||||
// launch decode with FPGA
|
||||
LOG_I(PHY, "Run the LDPC ------[FPGA version]------\n");
|
||||
//==================================================================
|
||||
// Xilinx FPGA LDPC decoding function -> nrLDPC_decoder_FPGA_PYM()
|
||||
//==================================================================
|
||||
start_meas(&TB_params->segments[0].ts_ldpc_decode);
|
||||
nrLDPC_decoder_FPGA_PYM(&multi_indata[0], &multi_outdata[0], dec_conf);
|
||||
// printf("Xilinx FPGA -> CB = %d\n", harq_process->C);
|
||||
stop_meas(&TB_params->segments[0].ts_ldpc_decode);
|
||||
|
||||
*TB_params->processedSegments = 0;
|
||||
for (uint32_t r = 0; r < TB_params->C; r++) {
|
||||
// ------------------------------------------------------------
|
||||
// --------------------- copy FPGA output ---------------------
|
||||
// ------------------------------------------------------------
|
||||
nrLDPC_segment_decoding_parameters_t *segment_params = &TB_params->segments[r];
|
||||
if (check_crc(multi_outdata, length_dec, crc_type)) {
|
||||
#ifdef DEBUG_CRC
|
||||
LOG_I(PHY, "Segment %d CRC OK\n", r);
|
||||
#endif
|
||||
no_iteration_ldpc = 2;
|
||||
} else {
|
||||
#ifdef DEBUG_CRC
|
||||
LOG_I(PHY, "segment %d CRC NOK\n", r);
|
||||
#endif
|
||||
no_iteration_ldpc = TB_params->max_ldpc_iterations;
|
||||
}
|
||||
for (int i = 0; i < out_CBoffset; i++) {
|
||||
segment_params->c[i] = multi_outdata[i + r * out_CBoffset];
|
||||
}
|
||||
segment_params->decodeSuccess = (no_iteration_ldpc < TB_params->max_ldpc_iterations);
|
||||
if (segment_params->decodeSuccess) {
|
||||
*TB_params->processedSegments = *TB_params->processedSegments + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \fn nr_ulsch_FPGA_decoding_prepare_blocks(void *args)
|
||||
* \brief prepare blocks for LDPC decoding on FPGA
|
||||
*
|
||||
* \param args pointer to the arguments of the function in a structure of type args_fpga_decode_prepare_t
|
||||
*/
|
||||
void nr_ulsch_FPGA_decoding_prepare_blocks(void *args)
|
||||
{
|
||||
// extract the arguments
|
||||
args_fpga_decode_prepare_t *arguments = (args_fpga_decode_prepare_t *)args;
|
||||
|
||||
nrLDPC_TB_decoding_parameters_t *TB_params = arguments->TB_params;
|
||||
|
||||
uint8_t Qm = TB_params->Qm;
|
||||
|
||||
uint8_t BG = TB_params->BG;
|
||||
uint8_t rv_index = TB_params->rv_index;
|
||||
uint8_t max_ldpc_iterations = TB_params->max_ldpc_iterations;
|
||||
|
||||
uint32_t tbslbrm = TB_params->tbslbrm;
|
||||
uint32_t K = TB_params->K;
|
||||
uint32_t Z = TB_params->Z;
|
||||
uint32_t F = TB_params->F;
|
||||
|
||||
uint32_t C = TB_params->C;
|
||||
|
||||
nrLDPC_segment_decoding_parameters_t *segment_params = &TB_params->segments[0];
|
||||
|
||||
short *ulsch_llr = segment_params->llr;
|
||||
|
||||
uint8_t *multi_indata = arguments->multi_indata;
|
||||
int no_iteration_ldpc = arguments->no_iteration_ldpc;
|
||||
uint32_t r_first = arguments->r_first;
|
||||
uint32_t r_span = arguments->r_span;
|
||||
int r_offset = arguments->r_offset;
|
||||
int input_CBoffset = arguments->input_CBoffset;
|
||||
int Kc = arguments->Kc;
|
||||
int Kprime = arguments->Kprime;
|
||||
|
||||
int16_t z[68 * 384 + 16] __attribute__((aligned(16)));
|
||||
simde__m128i *pv = (simde__m128i *)&z;
|
||||
|
||||
// the function processes r_span blocks starting from block at index r_first in ulsch_llr
|
||||
for (uint32_t r = r_first; r < (r_first + r_span); r++) {
|
||||
nrLDPC_segment_decoding_parameters_t *segment_params = &TB_params->segments[r];
|
||||
// ----------------------- FPGA pre process ------------------------
|
||||
simde__m128i ones = simde_mm_set1_epi8(255); // Generate a vector with all elements set to 255
|
||||
simde__m128i *temp_multi_indata = (simde__m128i *)&multi_indata[r * input_CBoffset];
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
// code blocks after bit selection in rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1)
|
||||
int16_t harq_e[segment_params->E];
|
||||
// -------------------------------------------------------------------------------------------
|
||||
// deinterleaving
|
||||
// -------------------------------------------------------------------------------------------
|
||||
start_meas(&segment_params->ts_deinterleave);
|
||||
nr_deinterleaving_ldpc(segment_params->E, Qm, harq_e, ulsch_llr + r_offset);
|
||||
stop_meas(&segment_params->ts_deinterleave);
|
||||
// -------------------------------------------------------------------------------------------
|
||||
// dematching
|
||||
// -------------------------------------------------------------------------------------------
|
||||
start_meas(&segment_params->ts_rate_unmatch);
|
||||
if (nr_rate_matching_ldpc_rx(tbslbrm,
|
||||
BG,
|
||||
Z,
|
||||
segment_params->d,
|
||||
harq_e,
|
||||
C,
|
||||
rv_index,
|
||||
*segment_params->d_to_be_cleared,
|
||||
segment_params->E,
|
||||
F,
|
||||
K - F - 2 * Z)
|
||||
== -1) {
|
||||
stop_meas(&segment_params->ts_rate_unmatch);
|
||||
LOG_E(PHY, "ulsch_decoding.c: Problem in rate_matching\n");
|
||||
no_iteration_ldpc = max_ldpc_iterations;
|
||||
arguments->no_iteration_ldpc = no_iteration_ldpc;
|
||||
return;
|
||||
} else {
|
||||
stop_meas(&segment_params->ts_rate_unmatch);
|
||||
}
|
||||
|
||||
*segment_params->d_to_be_cleared = false;
|
||||
|
||||
memset(segment_params->c, 0, K >> 3);
|
||||
|
||||
// set first 2*Z_c bits to zeros
|
||||
memset(&z[0], 0, 2 * Z * sizeof(int16_t));
|
||||
// set Filler bits
|
||||
memset((&z[0] + Kprime), 127, F * sizeof(int16_t));
|
||||
// Move coded bits before filler bits
|
||||
memcpy((&z[0] + 2 * Z), segment_params->d, (Kprime - 2 * Z) * sizeof(int16_t));
|
||||
// skip filler bits
|
||||
memcpy((&z[0] + K), segment_params->d + (K - 2 * Z), (Kc * Z - K) * sizeof(int16_t));
|
||||
|
||||
// Saturate coded bits before decoding into 8 bits values
|
||||
for (int i = 0, j = 0; j < ((Kc * Z) >> 4); i += 2, j++) {
|
||||
temp_multi_indata[j] =
|
||||
simde_mm_xor_si128(simde_mm_packs_epi16(pv[i], pv[i + 1]),
|
||||
simde_mm_cmpeq_epi32(ones,
|
||||
ones)); // Perform NOT operation and write the result to temp_multi_indata[j]
|
||||
}
|
||||
|
||||
// the last bytes before reaching "Kc * harq_process->Z" should not be written 128 bits at a time to avoid overwritting the
|
||||
// following block in multi_indata
|
||||
simde__m128i tmp =
|
||||
simde_mm_xor_si128(simde_mm_packs_epi16(pv[2 * ((Kc * Z) >> 4)], pv[2 * ((Kc * Z) >> 4) + 1]),
|
||||
simde_mm_cmpeq_epi32(ones,
|
||||
ones)); // Perform NOT operation and write the result to temp_multi_indata[j]
|
||||
uint8_t *tmp_p = (uint8_t *)&tmp;
|
||||
for (int i = 0, j = ((Kc * Z) & 0xfffffff0); j < Kc * Z; i++, j++) {
|
||||
multi_indata[r * input_CBoffset + j] = tmp_p[i];
|
||||
}
|
||||
|
||||
r_offset += segment_params->E;
|
||||
}
|
||||
|
||||
arguments->no_iteration_ldpc = no_iteration_ldpc;
|
||||
}
|
||||
@@ -1,783 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2016-present, Xilinx, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license
|
||||
* the terms of the BSD Licence are reported below:
|
||||
*
|
||||
* BSD License
|
||||
*
|
||||
* For Xilinx DMA IP software
|
||||
*
|
||||
* Copyright (c) 2016-present, Xilinx, Inc. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name Xilinx nor the names of its contributors may be used to
|
||||
* endorse or promote products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#define _DEFAULT_SOURCE
|
||||
#define _XOPEN_SOURCE 500
|
||||
|
||||
#include <assert.h>
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
#include <byteswap.h>
|
||||
#include <signal.h>
|
||||
#include <ctype.h>
|
||||
#include <termios.h>
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "xdma_diag.h"
|
||||
#include "nrLDPC_coding_xdma_offload.h"
|
||||
|
||||
#include "common/utils/assertions.h"
|
||||
|
||||
typedef unsigned long long U64;
|
||||
void* map_base;
|
||||
int fd;
|
||||
int fd_enc_write, fd_enc_read;
|
||||
char *dev_enc_write, *dev_enc_read;
|
||||
int fd_dec_write, fd_dec_read;
|
||||
char *dev_dec_write, *dev_dec_read;
|
||||
char allocated_write[24 * 1024] __attribute__((aligned(4096)));
|
||||
char allocated_read[24 * 1024 * 3] __attribute__((aligned(4096)));
|
||||
|
||||
// dma_from_device.c
|
||||
|
||||
// [Start] #include "dma_utils.c" ===================================
|
||||
|
||||
/*
|
||||
* man 2 write:
|
||||
* On Linux, write() (and similar system calls) will transfer at most
|
||||
* 0x7ffff000 (2,147,479,552) bytes, returning the number of bytes
|
||||
* actually transferred. (This is true on both 32-bit and 64-bit
|
||||
* systems.)
|
||||
*/
|
||||
|
||||
#define RW_MAX_SIZE 0x7ffff000
|
||||
|
||||
int verbose = 0;
|
||||
|
||||
uint64_t getopt_integer(char* optarg)
|
||||
{
|
||||
int rc;
|
||||
uint64_t value;
|
||||
|
||||
rc = sscanf(optarg, "0x%lx", &value);
|
||||
if (rc <= 0)
|
||||
rc = sscanf(optarg, "%lu", &value);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
ssize_t read_to_buffer(char* fname, int fd, char* buffer, uint64_t size, uint64_t base)
|
||||
{
|
||||
ssize_t rc;
|
||||
uint64_t count = 0;
|
||||
char* buf = buffer;
|
||||
off_t offset = base;
|
||||
|
||||
while (count < size) {
|
||||
uint64_t bytes = size - count;
|
||||
|
||||
if (bytes > RW_MAX_SIZE)
|
||||
bytes = RW_MAX_SIZE;
|
||||
|
||||
if (offset) {
|
||||
rc = lseek(fd, offset, SEEK_SET);
|
||||
if (rc != offset) {
|
||||
fprintf(stderr, "%s, seek off 0x%lx != 0x%lx.\n", fname, rc, offset);
|
||||
perror("seek file");
|
||||
return -EIO;
|
||||
}
|
||||
}
|
||||
/* read data from file into memory buffer */
|
||||
rc = read(fd, buf, bytes);
|
||||
|
||||
if (rc != bytes) {
|
||||
fprintf(stderr, "%s, R off 0x%lx, 0x%lx != 0x%lx.\n", fname, count, rc, bytes);
|
||||
perror("read file");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
count += bytes;
|
||||
buf += bytes;
|
||||
offset += bytes;
|
||||
}
|
||||
|
||||
if (count != size) {
|
||||
fprintf(stderr, "%s, R failed 0x%lx != 0x%lx.\n", fname, count, size);
|
||||
return -EIO;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
ssize_t write_from_buffer(char* fname, int fd, char* buffer, uint64_t size, uint64_t base)
|
||||
{
|
||||
ssize_t rc;
|
||||
uint64_t count = 0;
|
||||
char* buf = buffer;
|
||||
off_t offset = base;
|
||||
|
||||
while (count < size) {
|
||||
uint64_t bytes = size - count;
|
||||
|
||||
if (bytes > RW_MAX_SIZE)
|
||||
bytes = RW_MAX_SIZE;
|
||||
|
||||
if (offset) {
|
||||
rc = lseek(fd, offset, SEEK_SET);
|
||||
if (rc != offset) {
|
||||
fprintf(stderr, "%s, seek off 0x%lx != 0x%lx.\n", fname, rc, offset);
|
||||
perror("seek file");
|
||||
return -EIO;
|
||||
}
|
||||
}
|
||||
|
||||
/* write data to file from memory buffer */
|
||||
rc = write(fd, buf, bytes);
|
||||
if (rc != bytes) {
|
||||
fprintf(stderr, "%s, W off 0x%lx, 0x%lx != 0x%lx.\n", fname, offset, rc, bytes);
|
||||
perror("write file");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
count += bytes;
|
||||
buf += bytes;
|
||||
offset += bytes;
|
||||
}
|
||||
|
||||
if (count != size) {
|
||||
fprintf(stderr, "%s, R failed 0x%lx != 0x%lx.\n", fname, count, size);
|
||||
return -EIO;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
// [End] #include "dma_utils.c" ===================================
|
||||
|
||||
int test_dma_enc_read(char* EncOut, EncIPConf Confparam)
|
||||
{
|
||||
ssize_t rc;
|
||||
|
||||
void* virt_addr;
|
||||
|
||||
uint64_t size;
|
||||
uint32_t writeval;
|
||||
|
||||
uint32_t Z_val;
|
||||
|
||||
uint16_t max_schedule, mb, id, bg, z_j, kb, z_a;
|
||||
uint16_t z_set;
|
||||
uint32_t ctrl_data;
|
||||
uint32_t CB_num = CB_PROCESS_NUMBER;
|
||||
|
||||
// this values should be given by Shane
|
||||
max_schedule = 0;
|
||||
mb = Confparam.mb;
|
||||
id = CB_num;
|
||||
bg = Confparam.BGSel - 1;
|
||||
z_set = Confparam.z_set - 1;
|
||||
z_j = Confparam.z_j;
|
||||
|
||||
if (z_set == 0)
|
||||
z_a = 2;
|
||||
else if (z_set == 1)
|
||||
z_a = 3;
|
||||
else if (z_set == 2)
|
||||
z_a = 5;
|
||||
else if (z_set == 3)
|
||||
z_a = 7;
|
||||
else if (z_set == 4)
|
||||
z_a = 9;
|
||||
else if (z_set == 5)
|
||||
z_a = 11;
|
||||
else if (z_set == 6)
|
||||
z_a = 13;
|
||||
else
|
||||
z_a = 15;
|
||||
|
||||
if (bg == 0)
|
||||
kb = 22;
|
||||
else if (bg == 1)
|
||||
kb = 10;
|
||||
else if (bg == 2)
|
||||
kb = 9;
|
||||
else if (bg == 3)
|
||||
kb = 8;
|
||||
else
|
||||
kb = 6;
|
||||
mb = Confparam.kb_1 + kb;
|
||||
Z_val = (unsigned int)(z_a << z_j);
|
||||
ctrl_data = (max_schedule << 30) | ((mb - kb) << 24) | (id << 19) | (bg << 6) | (z_set << 3) | z_j;
|
||||
uint32_t OutDataNUM = Z_val * mb;
|
||||
uint32_t Out_dwNumItems_p128;
|
||||
uint32_t Out_dwNumItems;
|
||||
|
||||
if ((OutDataNUM & 0x7F) == 0)
|
||||
Out_dwNumItems_p128 = OutDataNUM >> 5;
|
||||
else
|
||||
Out_dwNumItems_p128 = ((OutDataNUM >> 7) + 1) << 2;
|
||||
Out_dwNumItems = ((Out_dwNumItems_p128 << 2) * CB_num);
|
||||
size = Out_dwNumItems;
|
||||
writeval = ctrl_data;
|
||||
|
||||
/* calculate the virtual address to be accessed */
|
||||
virt_addr = map_base + OFFSET_ENC_OUT;
|
||||
|
||||
/* swap 32-bit endianess if host is not little-endian */
|
||||
writeval = htoll(writeval);
|
||||
*((uint32_t*)virt_addr) = writeval;
|
||||
if (fd_enc_read < 0) {
|
||||
fprintf(stderr, "unable to open device %s, %d.\n", dev_enc_read, fd_enc_read);
|
||||
perror("open device");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* lseek & read data from AXI MM into buffer using SGDMA */
|
||||
rc = read_to_buffer(dev_enc_read, fd_enc_read, EncOut, size, 0);
|
||||
if (rc < 0)
|
||||
goto out;
|
||||
|
||||
rc = 0;
|
||||
|
||||
out:
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int test_dma_enc_write(char* data, EncIPConf Confparam)
|
||||
{
|
||||
ssize_t rc;
|
||||
void* virt_addr;
|
||||
|
||||
uint64_t size;
|
||||
uint32_t writeval;
|
||||
|
||||
uint32_t Z_val;
|
||||
uint16_t max_schedule, mb, id, bg, z_j, kb, z_a;
|
||||
uint16_t z_set;
|
||||
uint32_t ctrl_data;
|
||||
uint32_t CB_num = CB_PROCESS_NUMBER;
|
||||
|
||||
// this values should be given by Shane
|
||||
max_schedule = 0;
|
||||
|
||||
mb = Confparam.mb;
|
||||
id = CB_num;
|
||||
bg = Confparam.BGSel - 1;
|
||||
z_set = Confparam.z_set - 1;
|
||||
z_j = Confparam.z_j;
|
||||
|
||||
if (z_set == 0)
|
||||
z_a = 2;
|
||||
else if (z_set == 1)
|
||||
z_a = 3;
|
||||
else if (z_set == 2)
|
||||
z_a = 5;
|
||||
else if (z_set == 3)
|
||||
z_a = 7;
|
||||
else if (z_set == 4)
|
||||
z_a = 9;
|
||||
else if (z_set == 5)
|
||||
z_a = 11;
|
||||
else if (z_set == 6)
|
||||
z_a = 13;
|
||||
else
|
||||
z_a = 15;
|
||||
|
||||
if (bg == 0)
|
||||
kb = 22;
|
||||
else if (bg == 1)
|
||||
kb = 10;
|
||||
else if (bg == 2)
|
||||
kb = 9;
|
||||
else if (bg == 3)
|
||||
kb = 8;
|
||||
else
|
||||
kb = 6;
|
||||
mb = Confparam.kb_1 + kb;
|
||||
Z_val = (unsigned int)(z_a << z_j);
|
||||
ctrl_data = (max_schedule << 30) | ((mb - kb) << 24) | (id << 19) | (bg << 6) | (z_set << 3) | z_j;
|
||||
uint32_t InDataNUM = Z_val * kb;
|
||||
uint32_t In_dwNumItems_p128;
|
||||
uint32_t In_dwNumItems;
|
||||
|
||||
if ((InDataNUM & 0x7F) == 0)
|
||||
In_dwNumItems_p128 = InDataNUM >> 5;
|
||||
else
|
||||
In_dwNumItems_p128 = ((InDataNUM >> 7) + 1) << 2;
|
||||
|
||||
In_dwNumItems = ((In_dwNumItems_p128 << 2) * CB_num);
|
||||
size = In_dwNumItems;
|
||||
writeval = ctrl_data;
|
||||
|
||||
/* calculate the virtual address to be accessed */
|
||||
virt_addr = map_base + OFFSET_ENC_IN;
|
||||
|
||||
/* swap 32-bit endianess if host is not little-endian */
|
||||
writeval = htoll(writeval);
|
||||
*((uint32_t*)virt_addr) = writeval;
|
||||
if (fd_enc_write < 0) {
|
||||
fprintf(stderr, "unable to open device %s, %d.\n", dev_enc_write, fd_enc_write);
|
||||
perror("open device");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rc = write_from_buffer(dev_enc_write, fd_enc_write, data, size, 0);
|
||||
if (rc < 0)
|
||||
goto out;
|
||||
rc = 0;
|
||||
|
||||
out:
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
// int test_dma_dec_read(unsigned int *DecOut, DecIPConf Confparam)
|
||||
int test_dma_dec_read(char* DecOut, DecIPConf Confparam)
|
||||
{
|
||||
ssize_t rc;
|
||||
|
||||
void* virt_addr;
|
||||
|
||||
uint64_t size;
|
||||
uint32_t writeval;
|
||||
|
||||
uint32_t Z_val;
|
||||
|
||||
uint16_t max_schedule, mb, id, bg, z_j, kb, z_a, max_iter, sc_idx;
|
||||
uint16_t z_set;
|
||||
uint32_t ctrl_data;
|
||||
uint32_t CB_num = Confparam.CB_num;
|
||||
|
||||
// this values should be given by Shane
|
||||
max_schedule = 0;
|
||||
mb = Confparam.mb;
|
||||
id = CB_num;
|
||||
bg = Confparam.BGSel - 1;
|
||||
z_set = Confparam.z_set - 1;
|
||||
z_j = Confparam.z_j;
|
||||
max_iter = 8;
|
||||
sc_idx = 12;
|
||||
|
||||
if (z_set == 0)
|
||||
z_a = 2;
|
||||
else if (z_set == 1)
|
||||
z_a = 3;
|
||||
else if (z_set == 2)
|
||||
z_a = 5;
|
||||
else if (z_set == 3)
|
||||
z_a = 7;
|
||||
else if (z_set == 4)
|
||||
z_a = 9;
|
||||
else if (z_set == 5)
|
||||
z_a = 11;
|
||||
else if (z_set == 6)
|
||||
z_a = 13;
|
||||
else
|
||||
z_a = 15;
|
||||
|
||||
if (bg == 0)
|
||||
kb = 22;
|
||||
else if (bg == 1)
|
||||
kb = 10;
|
||||
else if (bg == 2)
|
||||
kb = 9;
|
||||
else if (bg == 3)
|
||||
kb = 8;
|
||||
else
|
||||
kb = 6;
|
||||
|
||||
Z_val = (unsigned int)(z_a << z_j);
|
||||
ctrl_data =
|
||||
(max_schedule << 30) | ((mb - kb) << 24) | (id << 19) | (max_iter << 13) | (sc_idx << 9) | (bg << 6) | (z_set) << 3 | z_j;
|
||||
|
||||
uint32_t OutDataNUM = Z_val * kb;
|
||||
uint32_t Out_dwNumItems_p128;
|
||||
uint32_t Out_dwNumItems;
|
||||
|
||||
if (CB_num & 0x01) // odd cb number
|
||||
{
|
||||
if ((OutDataNUM & 0xFF) == 0)
|
||||
Out_dwNumItems_p128 = OutDataNUM;
|
||||
else
|
||||
Out_dwNumItems_p128 = 256 * ((OutDataNUM / 256) + 1);
|
||||
|
||||
Out_dwNumItems = (Out_dwNumItems_p128 * CB_num) >> 3;
|
||||
} else {
|
||||
if ((OutDataNUM & 0x7F) == 0)
|
||||
Out_dwNumItems_p128 = OutDataNUM;
|
||||
else
|
||||
Out_dwNumItems_p128 = 128 * ((OutDataNUM / 128) + 1);
|
||||
|
||||
Out_dwNumItems = (Out_dwNumItems_p128 * CB_num) >> 3;
|
||||
if ((Out_dwNumItems & 0x1f) != 0)
|
||||
Out_dwNumItems = ((Out_dwNumItems + 31) >> 5) << 5;
|
||||
|
||||
}
|
||||
size = Out_dwNumItems;
|
||||
writeval = ctrl_data;
|
||||
|
||||
/* calculate the virtual address to be accessed */
|
||||
virt_addr = map_base + OFFSET_DEC_OUT;
|
||||
|
||||
/* swap 32-bit endianess if host is not little-endian */
|
||||
writeval = htoll(writeval);
|
||||
*((uint32_t*)virt_addr) = writeval;
|
||||
|
||||
if (fd_dec_read < 0) {
|
||||
fprintf(stderr, "unable to open device %s, %d.\n", dev_dec_read, fd_dec_read);
|
||||
perror("open device");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* lseek & read data from AXI MM into buffer using SGDMA */
|
||||
rc = read_to_buffer(dev_dec_read, fd_dec_read, DecOut, size, 0);
|
||||
if (rc < 0)
|
||||
goto out;
|
||||
|
||||
rc = 0;
|
||||
|
||||
out:
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
// int test_dma_dec_write(unsigned int *data, DecIPConf Confparam)
|
||||
int test_dma_dec_write(char* data, DecIPConf Confparam)
|
||||
{
|
||||
ssize_t rc;
|
||||
|
||||
void* virt_addr;
|
||||
|
||||
uint64_t size;
|
||||
uint32_t writeval;
|
||||
|
||||
uint32_t Z_val;
|
||||
uint16_t max_schedule, mb, id, bg, z_j, kb, z_a, max_iter, sc_idx;
|
||||
uint16_t z_set;
|
||||
uint32_t ctrl_data;
|
||||
uint32_t CB_num = Confparam.CB_num; // CB_PROCESS_NUMBER_Dec;//
|
||||
|
||||
// this values should be given by Shane
|
||||
max_schedule = 0;
|
||||
mb = Confparam.mb;
|
||||
id = CB_num;
|
||||
bg = Confparam.BGSel - 1;
|
||||
z_set = Confparam.z_set - 1;
|
||||
z_j = Confparam.z_j;
|
||||
|
||||
max_iter = 8;
|
||||
sc_idx = 12;
|
||||
|
||||
if (z_set == 0)
|
||||
z_a = 2;
|
||||
else if (z_set == 1)
|
||||
z_a = 3;
|
||||
else if (z_set == 2)
|
||||
z_a = 5;
|
||||
else if (z_set == 3)
|
||||
z_a = 7;
|
||||
else if (z_set == 4)
|
||||
z_a = 9;
|
||||
else if (z_set == 5)
|
||||
z_a = 11;
|
||||
else if (z_set == 6)
|
||||
z_a = 13;
|
||||
else
|
||||
z_a = 15;
|
||||
|
||||
if (bg == 0)
|
||||
kb = 22;
|
||||
else if (bg == 1)
|
||||
kb = 10;
|
||||
else if (bg == 2)
|
||||
kb = 9;
|
||||
else if (bg == 3)
|
||||
kb = 8;
|
||||
else
|
||||
kb = 6;
|
||||
|
||||
Z_val = (unsigned int)(z_a << z_j);
|
||||
ctrl_data =
|
||||
(max_schedule << 30) | ((mb - kb) << 24) | (id << 19) | (max_iter << 13) | (sc_idx << 9) | (bg << 6) | (z_set) << 3 | z_j;
|
||||
|
||||
uint32_t InDataNUM = Z_val * mb;
|
||||
uint32_t In_dwNumItems_p128;
|
||||
uint32_t In_dwNumItems;
|
||||
|
||||
InDataNUM = Z_val * mb * 8;
|
||||
if ((InDataNUM & 0x7F) == 0)
|
||||
In_dwNumItems_p128 = InDataNUM;
|
||||
else
|
||||
In_dwNumItems_p128 = 128 * ((InDataNUM / 128) + 1);
|
||||
|
||||
In_dwNumItems = (In_dwNumItems_p128 * CB_num) >> 3;
|
||||
if ((In_dwNumItems & 0x1f) != 0)
|
||||
In_dwNumItems = ((In_dwNumItems + 31) >> 5) << 5;
|
||||
|
||||
size = In_dwNumItems;
|
||||
writeval = ctrl_data;
|
||||
|
||||
/* calculate the virtual address to be accessed */
|
||||
virt_addr = map_base + OFFSET_DEC_IN;
|
||||
|
||||
/* swap 32-bit endianess if host is not little-endian */
|
||||
writeval = htoll(writeval);
|
||||
*((uint32_t*)virt_addr) = writeval;
|
||||
|
||||
if (fd_dec_write < 0) {
|
||||
fprintf(stderr, "unable to open device %s, %d.\n", dev_dec_write, fd_dec_write);
|
||||
perror("open device");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rc = write_from_buffer(dev_dec_write, fd_dec_write, data, size, 0);
|
||||
if (rc < 0)
|
||||
goto out;
|
||||
|
||||
rc = 0;
|
||||
|
||||
out:
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
void test_dma_init(devices_t devices)
|
||||
{
|
||||
/* access width */
|
||||
char* device2 = devices.user_device;
|
||||
|
||||
AssertFatal((fd = open(device2, O_RDWR | O_SYNC)) != -1, "CHARACTER DEVICE %s OPEN FAILURE\n", device2);
|
||||
fflush(stdout);
|
||||
|
||||
/* map one page */
|
||||
map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
|
||||
AssertFatal(map_base != (void*)-1, "MEMORY MAP AT ADDRESS %p FAILED\n", map_base);
|
||||
|
||||
void* virt_addr;
|
||||
virt_addr = map_base + OFFSET_RESET;
|
||||
*((uint32_t*)virt_addr) = 1;
|
||||
|
||||
dev_enc_write = devices.enc_write_device;
|
||||
dev_enc_read = devices.enc_read_device;
|
||||
dev_dec_write = devices.dec_write_device;
|
||||
dev_dec_read = devices.dec_read_device;
|
||||
|
||||
fd_enc_write = open(dev_enc_write, O_RDWR);
|
||||
fd_enc_read = open(dev_enc_read, O_RDWR);
|
||||
fd_dec_write = open(dev_dec_write, O_RDWR);
|
||||
fd_dec_read = open(dev_dec_read, O_RDWR);
|
||||
|
||||
fflush(stdout);
|
||||
|
||||
}
|
||||
|
||||
void dma_reset(devices_t devices)
|
||||
{
|
||||
char* device2 = devices.user_device;
|
||||
|
||||
void* virt_addr;
|
||||
virt_addr = map_base + PCIE_OFF;
|
||||
*((uint32_t*)virt_addr) = 1;
|
||||
|
||||
AssertFatal(munmap(map_base, MAP_SIZE) != -1, "munmap failure");
|
||||
close(fd_enc_write);
|
||||
close(fd_enc_read);
|
||||
close(fd_dec_write);
|
||||
close(fd_dec_read);
|
||||
close(fd);
|
||||
|
||||
AssertFatal((fd = open(device2, O_RDWR | O_SYNC)) != -1, "CHARACTER DEVICE %s OPEN FAILURE\n", device2);
|
||||
fflush(stdout);
|
||||
|
||||
/* map one page */
|
||||
map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
|
||||
AssertFatal(map_base != (void*)-1, "MEMORY MAP AT ADDRESS %p FAILED\n", map_base);
|
||||
|
||||
virt_addr = map_base + PCIE_OFF;
|
||||
*((uint32_t*)virt_addr) = 1;
|
||||
|
||||
virt_addr = map_base + OFFSET_RESET;
|
||||
*((uint32_t*)virt_addr) = 1;
|
||||
|
||||
dev_enc_write = devices.enc_write_device;
|
||||
dev_enc_read = devices.enc_read_device;
|
||||
dev_dec_write = devices.dec_write_device;
|
||||
dev_dec_read = devices.dec_read_device;
|
||||
|
||||
fd_enc_write = open(dev_enc_write, O_RDWR);
|
||||
fd_enc_read = open(dev_enc_read, O_RDWR);
|
||||
fd_dec_write = open(dev_dec_write, O_RDWR);
|
||||
fd_dec_read = open(dev_dec_read, O_RDWR);
|
||||
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
void test_dma_shutdown()
|
||||
{
|
||||
|
||||
void* virt_addr;
|
||||
virt_addr = map_base + PCIE_OFF;
|
||||
*((uint32_t*)virt_addr) = 1;
|
||||
|
||||
AssertFatal(munmap(map_base, MAP_SIZE) != -1, "munmap failure");
|
||||
close(fd_enc_write);
|
||||
close(fd_enc_read);
|
||||
close(fd_dec_write);
|
||||
close(fd_dec_read);
|
||||
close(fd);
|
||||
|
||||
}
|
||||
|
||||
// reg_rx.c
|
||||
int nrLDPC_decoder_FPGA_PYM(uint8_t* buf_in, uint8_t* buf_out, DecIFConf dec_conf)
|
||||
{
|
||||
struct timespec ts_start0; // evaluate time from input setting to output setting including xdma
|
||||
|
||||
int Zc;
|
||||
int nRows;
|
||||
int baseGraph;
|
||||
int CB_num;
|
||||
|
||||
DecIPConf Confparam;
|
||||
int z_a, z_tmp;
|
||||
int z_j = 0;
|
||||
|
||||
|
||||
int input_CBoffset, output_CBoffset;
|
||||
|
||||
uint8_t i_LS;
|
||||
|
||||
devices_t devices = {
|
||||
.user_device = dec_conf.user_device,
|
||||
.enc_write_device = dec_conf.enc_write_device,
|
||||
.enc_read_device = dec_conf.enc_read_device,
|
||||
.dec_write_device = dec_conf.dec_write_device,
|
||||
.dec_read_device = dec_conf.dec_read_device
|
||||
};
|
||||
|
||||
static int init_flag = 0;
|
||||
if (init_flag == 0) {
|
||||
/*Init*/
|
||||
test_dma_init(devices);
|
||||
init_flag = 1;
|
||||
} else {
|
||||
dma_reset(devices);
|
||||
}
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts_start0); // time start0
|
||||
// LDPC input parameter
|
||||
Zc = dec_conf.Zc; // shifting size
|
||||
nRows = dec_conf.nRows; // number of Rows
|
||||
baseGraph = dec_conf.BG; // base graph
|
||||
CB_num = dec_conf.numCB; // 31 number of code block
|
||||
|
||||
// calc xdma LDPC parameter
|
||||
// calc i_LS
|
||||
if ((Zc % 15) == 0)
|
||||
i_LS = 7;
|
||||
else if ((Zc % 13) == 0)
|
||||
i_LS = 6;
|
||||
else if ((Zc % 11) == 0)
|
||||
i_LS = 5;
|
||||
else if ((Zc % 9) == 0)
|
||||
i_LS = 4;
|
||||
else if ((Zc % 7) == 0)
|
||||
i_LS = 3;
|
||||
else if ((Zc % 5) == 0)
|
||||
i_LS = 2;
|
||||
else if ((Zc % 3) == 0)
|
||||
i_LS = 1;
|
||||
else
|
||||
i_LS = 0;
|
||||
|
||||
// calc z_a
|
||||
if (i_LS == 0)
|
||||
z_a = 2;
|
||||
else
|
||||
z_a = i_LS * 2 + 1;
|
||||
|
||||
// calc z_j
|
||||
z_tmp = Zc / z_a;
|
||||
while (z_tmp % 2 == 0) {
|
||||
z_j = z_j + 1;
|
||||
z_tmp = z_tmp / 2;
|
||||
}
|
||||
|
||||
// calc CB_num and mb
|
||||
Confparam.CB_num = CB_num;
|
||||
if (baseGraph == 1)
|
||||
Confparam.mb = 22 + nRows;
|
||||
else
|
||||
Confparam.mb = 10 + nRows;
|
||||
|
||||
// set BGSel, z_set, z_j
|
||||
Confparam.BGSel = baseGraph;
|
||||
Confparam.z_set = i_LS + 1;
|
||||
Confparam.z_j = z_j;
|
||||
|
||||
// Calc input CB offset
|
||||
input_CBoffset = Zc * Confparam.mb * 8;
|
||||
if ((input_CBoffset & 0x7F) == 0)
|
||||
input_CBoffset = input_CBoffset / 8;
|
||||
else
|
||||
input_CBoffset = 16 * ((input_CBoffset / 128) + 1);
|
||||
|
||||
// Calc output CB offset
|
||||
output_CBoffset = Zc * (Confparam.mb - nRows);
|
||||
if ((output_CBoffset & 0x7F) == 0)
|
||||
output_CBoffset = output_CBoffset / 8;
|
||||
else
|
||||
output_CBoffset = 16 * ((output_CBoffset / 128) + 1);
|
||||
|
||||
// LDPC accelerator start
|
||||
// write into accelerator
|
||||
if (test_dma_dec_write((char *)buf_in, Confparam) != 0) {
|
||||
exit(1);
|
||||
printf("write exit!!\n");
|
||||
}
|
||||
|
||||
// read output of accelerator
|
||||
if (test_dma_dec_read((char *)buf_out, Confparam) != 0) {
|
||||
exit(1);
|
||||
printf("read exit!!\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \briefFPGA accelerator integrated into OAI (for one and multi code block)
|
||||
*/
|
||||
|
||||
#ifndef __NRLDPC_CODING_XDMA_OFFLOAD__H_
|
||||
|
||||
#define __NRLDPC_CODING_XDMA_OFFLOAD__H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define DEVICE_NAME_DEFAULT_USER "/dev/xdma0_user"
|
||||
#define DEVICE_NAME_DEFAULT_ENC_READ "/dev/xdma0_c2h_1"
|
||||
#define DEVICE_NAME_DEFAULT_ENC_WRITE "/dev/xdma0_h2c_1"
|
||||
#define DEVICE_NAME_DEFAULT_DEC_READ "/dev/xdma0_c2h_0"
|
||||
#define DEVICE_NAME_DEFAULT_DEC_WRITE "/dev/xdma0_h2c_0"
|
||||
|
||||
/**
|
||||
\brief LDPC input parameter
|
||||
\param Zc shifting size
|
||||
\param Rows
|
||||
\param baseGraph base graph
|
||||
\param CB_num number of code block
|
||||
\param numChannelLlrs input soft bits length, Zc x 66 - length of filler bits
|
||||
\param numFillerBits filler bits length
|
||||
*/
|
||||
typedef struct {
|
||||
char *user_device, *enc_write_device, *enc_read_device, *dec_write_device, *dec_read_device;
|
||||
unsigned char max_schedule;
|
||||
unsigned char SetIdx;
|
||||
int Zc;
|
||||
unsigned char numCB;
|
||||
unsigned char BG;
|
||||
unsigned char max_iter;
|
||||
int nRows;
|
||||
int numChannelLls;
|
||||
int numFillerBits;
|
||||
} DecIFConf;
|
||||
|
||||
int nrLDPC_decoder_FPGA_PYM(uint8_t *buf_in, uint8_t *buf_out, DecIFConf dec_conf);
|
||||
|
||||
#endif // __NRLDPC_CODING_XDMA_OFFLOAD__H_
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2016-present, Xilinx, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license
|
||||
* the terms of the BSD Licence are reported below:
|
||||
*
|
||||
* BSD License
|
||||
*
|
||||
* For Xilinx DMA IP software
|
||||
*
|
||||
* Copyright (c) 2016-present, Xilinx, Inc. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name Xilinx nor the names of its contributors may be used to
|
||||
* endorse or promote products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef MODULES_TXCTRL_INC_XDMA_DIAG_H_
|
||||
#define MODULES_TXCTRL_INC_XDMA_DIAG_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
unsigned char max_schedule; // max_schedule = 0;
|
||||
unsigned char mb; // mb = 32;
|
||||
unsigned char CB_num; // id = CB_num;
|
||||
unsigned char BGSel; // bg = 1;
|
||||
unsigned char z_set; // z_set = 0;
|
||||
unsigned char z_j; // z_j = 6;
|
||||
unsigned char max_iter; // max_iter = 8;
|
||||
unsigned char SetIdx; // sc_idx = 12;
|
||||
} DecIPConf;
|
||||
|
||||
typedef struct {
|
||||
int SetIdx;
|
||||
int NumCBSegm;
|
||||
int PayloadLen;
|
||||
int Z;
|
||||
int z_set;
|
||||
int z_j;
|
||||
int Kbmax;
|
||||
int BGSel;
|
||||
unsigned mb;
|
||||
unsigned char CB_num;
|
||||
unsigned char kb_1;
|
||||
} EncIPConf;
|
||||
|
||||
typedef struct {
|
||||
char *user_device, *enc_write_device, *enc_read_device, *dec_write_device, *dec_read_device;
|
||||
} devices_t;
|
||||
|
||||
/* ltoh: little to host */
|
||||
/* htol: little to host */
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
#define ltohl(x) (x)
|
||||
#define ltohs(x) (x)
|
||||
#define htoll(x) (x)
|
||||
#define htols(x) (x)
|
||||
#elif __BYTE_ORDER == __BIG_ENDIAN
|
||||
#define ltohl(x) __bswap_32(x)
|
||||
#define ltohs(x) __bswap_16(x)
|
||||
#define htoll(x) __bswap_32(x)
|
||||
#define htols(x) __bswap_16(x)
|
||||
#endif
|
||||
|
||||
#define MAP_SIZE (32 * 1024UL)
|
||||
#define MAP_MASK (MAP_SIZE - 1)
|
||||
|
||||
#define SIZE_DEFAULT (32)
|
||||
#define COUNT_DEFAULT (1)
|
||||
|
||||
#define OFFSET_DEC_IN 0x0000
|
||||
#define OFFSET_DEC_OUT 0x0004
|
||||
#define OFFSET_ENC_IN 0x0008
|
||||
#define OFFSET_ENC_OUT 0x000c
|
||||
#define OFFSET_RESET 0x0020
|
||||
#define PCIE_OFF 0x0030
|
||||
|
||||
#define CB_PROCESS_NUMBER 24 // add by JW
|
||||
#define CB_PROCESS_NUMBER_Dec 24
|
||||
|
||||
// dma_from_device.c
|
||||
|
||||
int test_dma_enc_read(char *EncOut, EncIPConf Confparam);
|
||||
int test_dma_enc_write(char *data, EncIPConf Confparam);
|
||||
int test_dma_dec_read(char *DecOut, DecIPConf Confparam);
|
||||
int test_dma_dec_write(char *data, DecIPConf Confparam);
|
||||
void test_dma_init(devices_t devices);
|
||||
void test_dma_shutdown();
|
||||
void dma_reset(devices_t devices);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -80,7 +80,7 @@
|
||||
#include "ldpc_BG2_Zc80_byte.c"
|
||||
#include "ldpc_BG2_Zc72_byte.c"
|
||||
|
||||
static void encode_parity_check_part_optim(uint8_t *cc, uint8_t *d, short BG,short Zc,short Kb, int simd_size, int ncols)
|
||||
static void encode_parity_check_part_optim(uint8_t *cc, uint8_t *d, short BG, short Zc, int simd_size, int ncols)
|
||||
{
|
||||
unsigned char c[2 * 22 * Zc * simd_size] __attribute__((aligned(64))); //double size matrix of c
|
||||
for (int i1 = 0; i1 < ncols; i1++) {
|
||||
@@ -198,6 +198,3 @@ static void encode_parity_check_part_optim(uint8_t *cc, uint8_t *d, short BG,sho
|
||||
} else
|
||||
AssertFatal(false, "BG %d is not supported\n", BG);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ int LDPCencoder(uint8_t **input, uint8_t *output, encoder_implemparams_t *impp)
|
||||
if(impp->tprep != NULL) stop_meas(impp->tprep);
|
||||
//parity check part
|
||||
if(impp->tparity != NULL) start_meas(impp->tparity);
|
||||
encode_parity_check_part_optim(cc, dd, BG, Zc, Kb, simd_size, ncols);
|
||||
encode_parity_check_part_optim(cc, dd, BG, Zc, simd_size, ncols);
|
||||
if(impp->tparity != NULL) stop_meas(impp->tparity);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -102,7 +102,7 @@ void phy_init_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
|
||||
int Ptx = cfg->carrier_config.num_tx_ant.value;
|
||||
int Prx = cfg->carrier_config.num_rx_ant.value;
|
||||
int max_ul_mimo_layers = 4;
|
||||
int max_ul_mimo_layers = NR_MAX_NB_LAYERS;
|
||||
|
||||
AssertFatal(Ptx > 0 && Ptx < 9,"Ptx %d is not supported\n", Ptx);
|
||||
AssertFatal(Prx > 0 && Prx < 9,"Prx %d is not supported\n", Prx);
|
||||
@@ -198,7 +198,7 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
{
|
||||
const int Ptx = gNB->gNB_config.carrier_config.num_tx_ant.value;
|
||||
const int Prx = gNB->gNB_config.carrier_config.num_rx_ant.value;
|
||||
const int max_ul_mimo_layers = 4; // taken from phy_init_nr_gNB()
|
||||
const int max_ul_mimo_layers = NR_MAX_NB_LAYERS;
|
||||
const int n_buf = Prx * max_ul_mimo_layers;
|
||||
|
||||
PHY_MEASUREMENTS_gNB *meas = &gNB->measurements;
|
||||
@@ -424,11 +424,15 @@ void init_nr_transport(PHY_VARS_gNB *gNB)
|
||||
gNB->max_nb_pusch = buffer_ul_slots ? MAX_MOBILES_PER_GNB * buffer_ul_slots : 1;
|
||||
|
||||
int max_nb_pucch = buffer_ul_slots ? MAX_MOBILES_PER_GNB * buffer_ul_slots : 1;
|
||||
gNB->pucch_queue = spsc_q_alloc(max_nb_pucch, sizeof(NR_gNB_PUCCH_job_t));
|
||||
gNB->pusch_queue = spsc_q_alloc(gNB->max_nb_pusch, sizeof(NR_gNB_PUSCH_job_t));
|
||||
bool ret;
|
||||
ret = spsc_q_alloc(&gNB->pucch_queue, max_nb_pucch, sizeof(NR_gNB_PUCCH_job_t));
|
||||
DevAssert(ret);
|
||||
ret = spsc_q_alloc(&gNB->pusch_queue, gNB->max_nb_pusch, sizeof(NR_gNB_PUSCH_job_t));
|
||||
DevAssert(ret);
|
||||
|
||||
int max_nb_srs = buffer_ul_slots ? buffer_ul_slots << 1 : 1; // assuming at most 2 SRS per slot
|
||||
gNB->srs_queue = spsc_q_alloc(max_nb_srs, sizeof(NR_gNB_SRS_job_t));
|
||||
ret = spsc_q_alloc(&gNB->srs_queue, max_nb_srs, sizeof(NR_gNB_SRS_job_t));
|
||||
DevAssert(ret);
|
||||
|
||||
gNB->ulsch = (NR_gNB_ULSCH_t *)malloc16(gNB->max_nb_pusch * sizeof(NR_gNB_ULSCH_t));
|
||||
for (int i = 0; i < gNB->max_nb_pusch; i++) {
|
||||
|
||||
@@ -321,7 +321,7 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue)
|
||||
|
||||
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;
|
||||
uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS;
|
||||
if (num_rb != 273) {
|
||||
a_segments = a_segments*num_rb;
|
||||
a_segments = (a_segments/273)+1;
|
||||
@@ -343,7 +343,7 @@ void free_nr_ue_dl_harq(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_HARQ_PROCESSES], int
|
||||
|
||||
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;
|
||||
int max_layers = min(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
|
||||
|
||||
if (num_rb != 273) {
|
||||
@@ -374,7 +374,7 @@ void term_nr_ue_transport(PHY_VARS_NR_UE *ue)
|
||||
|
||||
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
|
||||
int a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; // number of segments to be allocated
|
||||
if (num_rb != 273) {
|
||||
a_segments = a_segments*num_rb;
|
||||
a_segments = (a_segments/273)+1;
|
||||
@@ -402,7 +402,7 @@ void nr_init_dl_harq_processes(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_HARQ_PROCESSE
|
||||
|
||||
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;
|
||||
int max_layers = min(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
|
||||
|
||||
if (num_rb != 273) {
|
||||
|
||||
@@ -1466,11 +1466,14 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
}
|
||||
|
||||
#endif
|
||||
T(T_UE_PHY_PDSCH_IQ, T_INT(eNB_id), T_INT(frame%1024),
|
||||
T_INT(subframe), T_INT(nb_rb),
|
||||
T_INT(frame_parms->N_RB_UL), T_INT(frame_parms->symbols_per_tti),
|
||||
T_BUFFER(&pdsch_vars[eNB_id]->rxdataF_comp0[eNB_id][0],
|
||||
2 * /* ulsch[UE_id]->harq_processes[harq_pid]->nb_rb */ frame_parms->N_RB_UL *12*frame_parms->symbols_per_tti*2));
|
||||
T(T_UE_PHY_PDSCH_IQ,
|
||||
T_INT(eNB_id),
|
||||
T_INT(frame % 1024),
|
||||
T_INT(subframe),
|
||||
T_INT(nb_rb),
|
||||
T_INT(frame_parms->N_RB_DL),
|
||||
T_INT(frame_parms->symbols_per_tti),
|
||||
T_BUFFER(&pdsch_vars[eNB_id]->rxdataF_comp0[eNB_id][0], 2 * frame_parms->N_RB_DL * 12 * frame_parms->symbols_per_tti * 2));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -446,11 +446,11 @@ static void nr_pusch_antenna_processing(void *arg)
|
||||
completed_task_ans(rdata->ans);
|
||||
}
|
||||
|
||||
|
||||
int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
unsigned char Ns,
|
||||
int nl,
|
||||
unsigned short p,
|
||||
uint8_t lp,
|
||||
unsigned char symbol,
|
||||
NR_gNB_PUSCH *pusch_vars,
|
||||
int beam_nb,
|
||||
@@ -486,7 +486,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
gold,
|
||||
pilot,
|
||||
(1000 + p),
|
||||
0,
|
||||
lp % 2,
|
||||
nb_rb_pusch,
|
||||
(pusch_pdu->bwp_start + pusch_pdu->rb_start) * NR_NB_SC_PER_RB,
|
||||
pusch_pdu->dmrs_config_type,
|
||||
@@ -900,8 +900,7 @@ void nr_srs_noise_power_estimation(uint16_t ofdm_symbol_size,
|
||||
#endif
|
||||
}
|
||||
|
||||
int nr_srs_channel_interpolation(int ant,
|
||||
int p_index,
|
||||
int nr_srs_channel_interpolation(int p_index,
|
||||
uint16_t ofdm_symbol_size,
|
||||
uint16_t first_carrier_offset,
|
||||
uint8_t N_symb_SRS,
|
||||
@@ -933,7 +932,7 @@ int nr_srs_channel_interpolation(int ant,
|
||||
uint16_t srs_symbol_offset = srs_symb * ofdm_symbol_size;
|
||||
|
||||
#ifdef SRS_DEBUG
|
||||
LOG_I(NR_PHY, "====================== UE port %d --> gNB Rx antenna %i ======================\n", p_index, ant);
|
||||
LOG_I(NR_PHY, "============================== UE port %d ====================================\n", p_index);
|
||||
LOG_I(NR_PHY, "============================== SRS symbol index %d ===========================\n", srs_symb);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
unsigned char Ns,
|
||||
int nl,
|
||||
unsigned short p,
|
||||
uint8_t lp,
|
||||
unsigned char symbol,
|
||||
NR_gNB_PUSCH *pusch_vars,
|
||||
int beam_nb,
|
||||
@@ -70,8 +71,7 @@ int nr_srs_ls_channel_estimation(int ant,
|
||||
c16_t srs_ls_estimated_channel[ofdm_symbol_size * N_symb_SRS],
|
||||
delay_t *delay);
|
||||
|
||||
int nr_srs_channel_interpolation(int ant,
|
||||
int p_index,
|
||||
int nr_srs_channel_interpolation(int p_index,
|
||||
uint16_t ofdm_symbol_size,
|
||||
uint16_t first_carrier_offset,
|
||||
uint8_t N_symb_SRS,
|
||||
|
||||
@@ -241,7 +241,8 @@ void nr_chest_time_domain_avg(NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t num_symbols,
|
||||
uint8_t start_symbol,
|
||||
uint16_t dmrs_bitmap,
|
||||
uint16_t num_rbs)
|
||||
uint16_t num_rbs,
|
||||
uint8_t nb_layers)
|
||||
{
|
||||
simde__m128i *ul_ch128_0;
|
||||
simde__m128i *ul_ch128_1;
|
||||
@@ -250,64 +251,68 @@ void nr_chest_time_domain_avg(NR_DL_FRAME_PARMS *frame_parms,
|
||||
int num_dmrs_symb = count_bits64_with_mask(dmrs_bitmap, start_symbol, total_symbols);
|
||||
int first_dmrs_symb = get_next_dmrs_symbol_in_slot(dmrs_bitmap, start_symbol, total_symbols);
|
||||
AssertFatal(first_dmrs_symb > -1, "No DMRS symbol present in this slot\n");
|
||||
for (int aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
|
||||
for (int symb = first_dmrs_symb+1; symb < total_symbols; symb++) {
|
||||
ul_ch128_0 = (simde__m128i *)&ch_estimates[aarx][first_dmrs_symb*frame_parms->ofdm_symbol_size];
|
||||
if ((dmrs_bitmap >> symb) & 0x01) {
|
||||
ul_ch128_1 = (simde__m128i *)&ch_estimates[aarx][symb*frame_parms->ofdm_symbol_size];
|
||||
for (int rbIdx = 0; rbIdx < num_rbs; rbIdx++) {
|
||||
ul_ch128_0[0] = simde_mm_adds_epi16(ul_ch128_0[0], ul_ch128_1[0]);
|
||||
ul_ch128_0[1] = simde_mm_adds_epi16(ul_ch128_0[1], ul_ch128_1[1]);
|
||||
ul_ch128_0[2] = simde_mm_adds_epi16(ul_ch128_0[2], ul_ch128_1[2]);
|
||||
ul_ch128_0 += 3;
|
||||
ul_ch128_1 += 3;
|
||||
for (int nl = 0; nl < nb_layers; nl++) {
|
||||
for (int aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
|
||||
int ch_offset = nl * frame_parms->nb_antennas_rx + aarx;
|
||||
for (int symb = first_dmrs_symb + 1; symb < total_symbols; symb++) {
|
||||
ul_ch128_0 = (simde__m128i *)&ch_estimates[ch_offset][first_dmrs_symb * frame_parms->ofdm_symbol_size];
|
||||
if ((dmrs_bitmap >> symb) & 0x01) {
|
||||
ul_ch128_1 = (simde__m128i *)&ch_estimates[ch_offset][symb * frame_parms->ofdm_symbol_size];
|
||||
for (int rbIdx = 0; rbIdx < num_rbs; rbIdx++) {
|
||||
ul_ch128_0[0] = simde_mm_adds_epi16(ul_ch128_0[0], ul_ch128_1[0]);
|
||||
ul_ch128_0[1] = simde_mm_adds_epi16(ul_ch128_0[1], ul_ch128_1[1]);
|
||||
ul_ch128_0[2] = simde_mm_adds_epi16(ul_ch128_0[2], ul_ch128_1[2]);
|
||||
ul_ch128_0 += 3;
|
||||
ul_ch128_1 += 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
ul_ch128_0 = (simde__m128i *)&ch_estimates[ch_offset][first_dmrs_symb * frame_parms->ofdm_symbol_size];
|
||||
if (num_dmrs_symb == 2) {
|
||||
for (int rbIdx = 0; rbIdx < num_rbs; rbIdx++) {
|
||||
ul_ch128_0[0] = simde_mm_srai_epi16(ul_ch128_0[0], 1);
|
||||
ul_ch128_0[1] = simde_mm_srai_epi16(ul_ch128_0[1], 1);
|
||||
ul_ch128_0[2] = simde_mm_srai_epi16(ul_ch128_0[2], 1);
|
||||
ul_ch128_0 += 3;
|
||||
}
|
||||
} else if (num_dmrs_symb == 4) {
|
||||
for (int rbIdx = 0; rbIdx < num_rbs; rbIdx++) {
|
||||
ul_ch128_0[0] = simde_mm_srai_epi16(ul_ch128_0[0], 2);
|
||||
ul_ch128_0[1] = simde_mm_srai_epi16(ul_ch128_0[1], 2);
|
||||
ul_ch128_0[2] = simde_mm_srai_epi16(ul_ch128_0[2], 2);
|
||||
ul_ch128_0 += 3;
|
||||
}
|
||||
} else if (num_dmrs_symb == 3) {
|
||||
ul_ch16_0 = (int16_t *)&ch_estimates[ch_offset][first_dmrs_symb * frame_parms->ofdm_symbol_size];
|
||||
for (int rbIdx = 0; rbIdx < num_rbs; rbIdx++) {
|
||||
ul_ch16_0[0] /= 3;
|
||||
ul_ch16_0[1] /= 3;
|
||||
ul_ch16_0[2] /= 3;
|
||||
ul_ch16_0[3] /= 3;
|
||||
ul_ch16_0[4] /= 3;
|
||||
ul_ch16_0[5] /= 3;
|
||||
ul_ch16_0[6] /= 3;
|
||||
ul_ch16_0[7] /= 3;
|
||||
ul_ch16_0[8] /= 3;
|
||||
ul_ch16_0[9] /= 3;
|
||||
ul_ch16_0[10] /= 3;
|
||||
ul_ch16_0[11] /= 3;
|
||||
ul_ch16_0[12] /= 3;
|
||||
ul_ch16_0[13] /= 3;
|
||||
ul_ch16_0[14] /= 3;
|
||||
ul_ch16_0[15] /= 3;
|
||||
ul_ch16_0[16] /= 3;
|
||||
ul_ch16_0[17] /= 3;
|
||||
ul_ch16_0[18] /= 3;
|
||||
ul_ch16_0[19] /= 3;
|
||||
ul_ch16_0[20] /= 3;
|
||||
ul_ch16_0[21] /= 3;
|
||||
ul_ch16_0[22] /= 3;
|
||||
ul_ch16_0[23] /= 3;
|
||||
ul_ch16_0 += 24;
|
||||
}
|
||||
} else
|
||||
AssertFatal((num_dmrs_symb < 5) && (num_dmrs_symb > 0), "Illegal number of DMRS symbols in the slot\n");
|
||||
}
|
||||
ul_ch128_0 = (simde__m128i *)&ch_estimates[aarx][first_dmrs_symb*frame_parms->ofdm_symbol_size];
|
||||
if (num_dmrs_symb == 2) {
|
||||
for (int rbIdx = 0; rbIdx < num_rbs; rbIdx++) {
|
||||
ul_ch128_0[0] = simde_mm_srai_epi16(ul_ch128_0[0], 1);
|
||||
ul_ch128_0[1] = simde_mm_srai_epi16(ul_ch128_0[1], 1);
|
||||
ul_ch128_0[2] = simde_mm_srai_epi16(ul_ch128_0[2], 1);
|
||||
ul_ch128_0 += 3;
|
||||
}
|
||||
} else if (num_dmrs_symb == 4) {
|
||||
for (int rbIdx = 0; rbIdx < num_rbs; rbIdx++) {
|
||||
ul_ch128_0[0] = simde_mm_srai_epi16(ul_ch128_0[0], 2);
|
||||
ul_ch128_0[1] = simde_mm_srai_epi16(ul_ch128_0[1], 2);
|
||||
ul_ch128_0[2] = simde_mm_srai_epi16(ul_ch128_0[2], 2);
|
||||
ul_ch128_0 += 3;
|
||||
}
|
||||
} else if (num_dmrs_symb == 3) {
|
||||
ul_ch16_0 = (int16_t *)&ch_estimates[aarx][first_dmrs_symb*frame_parms->ofdm_symbol_size];
|
||||
for (int rbIdx = 0; rbIdx < num_rbs; rbIdx++) {
|
||||
ul_ch16_0[0] /= 3;
|
||||
ul_ch16_0[1] /= 3;
|
||||
ul_ch16_0[2] /= 3;
|
||||
ul_ch16_0[3] /= 3;
|
||||
ul_ch16_0[4] /= 3;
|
||||
ul_ch16_0[5] /= 3;
|
||||
ul_ch16_0[6] /= 3;
|
||||
ul_ch16_0[7] /= 3;
|
||||
ul_ch16_0[8] /= 3;
|
||||
ul_ch16_0[9] /= 3;
|
||||
ul_ch16_0[10] /= 3;
|
||||
ul_ch16_0[11] /= 3;
|
||||
ul_ch16_0[12] /= 3;
|
||||
ul_ch16_0[13] /= 3;
|
||||
ul_ch16_0[14] /= 3;
|
||||
ul_ch16_0[15] /= 3;
|
||||
ul_ch16_0[16] /= 3;
|
||||
ul_ch16_0[17] /= 3;
|
||||
ul_ch16_0[18] /= 3;
|
||||
ul_ch16_0[19] /= 3;
|
||||
ul_ch16_0[20] /= 3;
|
||||
ul_ch16_0[21] /= 3;
|
||||
ul_ch16_0[22] /= 3;
|
||||
ul_ch16_0[23] /= 3;
|
||||
ul_ch16_0 += 24;
|
||||
}
|
||||
} else AssertFatal((num_dmrs_symb < 5) && (num_dmrs_symb > 0), "Illegal number of DMRS symbols in the slot\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,8 @@ void nr_chest_time_domain_avg(NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t num_symbols,
|
||||
uint8_t start_symbol,
|
||||
uint16_t dmrs_bitmap,
|
||||
uint16_t num_rbs);
|
||||
uint16_t num_rbs,
|
||||
uint8_t nb_layers);
|
||||
|
||||
int8_t get_num_dmrs_re_per_rb(const uint8_t dmrs_type, const uint8_t num_cdm_grp_no_data);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user