Merge branch 'develop-nr' into nr-coreset-bug-fix
Resolved conflicts. rfsim not working.
This commit is contained in:
+2
-1
@@ -4,6 +4,7 @@
|
||||
# log and exec file
|
||||
cmake_targets/log/
|
||||
cmake_targets/*/build/
|
||||
cmake_targets/ran_build/
|
||||
log/
|
||||
lte_build_oai/
|
||||
targets/bin/
|
||||
targets/bin/
|
||||
|
||||
@@ -57,6 +57,9 @@ pipeline {
|
||||
|
||||
echo '\u2705 \u001B[32mVerify Parameters\u001B[0m'
|
||||
def allParametersPresent = true
|
||||
if (env.TESTPLATFORM_OWNER) {
|
||||
echo "Platform is ${env.TESTPLATFORM_OWNER}"
|
||||
}
|
||||
|
||||
if (params.RedHatRemoteServer == null) {
|
||||
allParametersPresent = false
|
||||
|
||||
@@ -44,7 +44,7 @@ function build_on_vm {
|
||||
STATUS=1
|
||||
return
|
||||
fi
|
||||
if [ ! -f /etc/apt/apt.conf.d/01proxy ]
|
||||
if [[ ! -f /etc/apt/apt.conf.d/01proxy ]] && [[ "$OPTIONAL_APTCACHER" != "true" ]]
|
||||
then
|
||||
echo "Missing /etc/apt/apt.conf.d/01proxy file!"
|
||||
echo "Is apt-cacher installed and configured?"
|
||||
@@ -96,12 +96,12 @@ function build_on_vm {
|
||||
else
|
||||
scp -o StrictHostKeyChecking=no $JENKINS_WKSP/localZip.zip ubuntu@$VM_IP_ADDR:/home/ubuntu
|
||||
fi
|
||||
scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$VM_IP_ADDR:/home/ubuntu
|
||||
[ -f /etc/apt/apt.conf.d/01proxy ] && scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$VM_IP_ADDR:/home/ubuntu
|
||||
|
||||
echo "############################################################"
|
||||
echo "Running install and build script on VM ($VM_NAME)"
|
||||
echo "############################################################"
|
||||
echo "sudo cp 01proxy /etc/apt/apt.conf.d/" > $VM_CMDS
|
||||
echo "[ -f 01proxy ] && sudo cp 01proxy /etc/apt/apt.conf.d/" > $VM_CMDS
|
||||
echo "touch /home/ubuntu/.hushlogin" >> $VM_CMDS
|
||||
echo "git config --global https.postBuffer 123289600" >> $VM_CMDS
|
||||
if [[ "$VM_NAME" == *"-cppcheck"* ]]
|
||||
|
||||
@@ -233,6 +233,7 @@ eNBs =
|
||||
#pdsch_maxNumRepetitionCEmodeB_r13 = "r384"; # NULL - 2
|
||||
|
||||
pusch_maxNumRepetitionCEmodeA_r13 = "r8"; #0
|
||||
pusch_repetitionLevelCEmodeA_r13 = "l1";
|
||||
#pusch_maxNumRepetitionCEmodeB_r13 = "r768"; #4 #NULL
|
||||
#pusch_HoppingOffset_v1310 = 5; #NULL
|
||||
|
||||
|
||||
+67
-17
@@ -542,8 +542,37 @@ class SSHConnection():
|
||||
self.command('git config user.email "jenkins@openairinterface.org"', '\$', 5)
|
||||
self.command('git config user.name "OAI Jenkins"', '\$', 5)
|
||||
if self.clean_repository:
|
||||
pass
|
||||
self.command('ls *.txt', '\$', 5)
|
||||
result = re.search('LAST_BUILD_INFO', str(self.ssh.before))
|
||||
if result is not None:
|
||||
mismatch = False
|
||||
self.command('grep SRC_COMMIT LAST_BUILD_INFO.txt', '\$', 2)
|
||||
result = re.search(self.ranCommitID, str(self.ssh.before))
|
||||
if result is None:
|
||||
mismatch = True
|
||||
self.command('grep MERGED_W_TGT_BRANCH LAST_BUILD_INFO.txt', '\$', 2)
|
||||
if (self.ranAllowMerge):
|
||||
result = re.search('YES', str(self.ssh.before))
|
||||
if result is None:
|
||||
mismatch = True
|
||||
self.command('grep TGT_BRANCH LAST_BUILD_INFO.txt', '\$', 2)
|
||||
if self.ranTargetBranch == '':
|
||||
result = re.search('develop', str(self.ssh.before))
|
||||
else:
|
||||
result = re.search(self.ranTargetBranch, str(self.ssh.before))
|
||||
if result is None:
|
||||
mismatch = True
|
||||
else:
|
||||
result = re.search('NO', str(self.ssh.before))
|
||||
if result is None:
|
||||
mismatch = True
|
||||
if not mismatch:
|
||||
self.close()
|
||||
self.CreateHtmlTestRow(self.Build_eNB_args, 'OK', ALL_PROCESSES_OK)
|
||||
return
|
||||
|
||||
self.command('echo ' + self.UEPassword + ' | sudo -S git clean -x -d -ff', '\$', 30)
|
||||
|
||||
# if the commit ID is provided use it to point to it
|
||||
if self.ranCommitID != '':
|
||||
self.command('git checkout -f ' + self.ranCommitID, '\$', 5)
|
||||
@@ -571,12 +600,23 @@ class SSHConnection():
|
||||
self.command('mkdir -p build_log_' + self.testCase_id, '\$', 5)
|
||||
self.command('mv log/* ' + 'build_log_' + self.testCase_id, '\$', 5)
|
||||
self.command('mv compile_oai_ue.log ' + 'build_log_' + self.testCase_id, '\$', 5)
|
||||
self.close()
|
||||
if buildStatus:
|
||||
logging.info('\u001B[1m Building OAI ' + ue_prefix + 'UE Pass\u001B[0m')
|
||||
# Generating a BUILD INFO file
|
||||
self.command('echo "SRC_BRANCH: ' + self.ranBranch + '" > ../LAST_BUILD_INFO.txt', '\$', 2)
|
||||
self.command('echo "SRC_COMMIT: ' + self.ranCommitID + '" >> ../LAST_BUILD_INFO.txt', '\$', 2)
|
||||
if (self.ranAllowMerge):
|
||||
self.command('echo "MERGED_W_TGT_BRANCH: YES" >> ../LAST_BUILD_INFO.txt', '\$', 2)
|
||||
if self.ranTargetBranch == '':
|
||||
self.command('echo "TGT_BRANCH: develop" >> ../LAST_BUILD_INFO.txt', '\$', 2)
|
||||
else:
|
||||
self.command('echo "TGT_BRANCH: ' + self.ranTargetBranch + '" >> ../LAST_BUILD_INFO.txt', '\$', 2)
|
||||
else:
|
||||
self.command('echo "MERGED_W_TGT_BRANCH: NO" >> ../LAST_BUILD_INFO.txt', '\$', 2)
|
||||
self.close()
|
||||
self.CreateHtmlTestRow(self.Build_OAI_UE_args, 'OK', ALL_PROCESSES_OK, 'OAI UE')
|
||||
else:
|
||||
logging.error('\u001B[1m Building OAI ' + ue_prefix + 'UE Failed\u001B[0m')
|
||||
self.close()
|
||||
logging.error('\u001B[1m Building OAI UE Failed\u001B[0m')
|
||||
self.CreateHtmlTestRow(self.Build_OAI_UE_args, 'KO', ALL_PROCESSES_OK, 'OAI UE')
|
||||
self.CreateHtmlTabFooter(False)
|
||||
sys.exit(1)
|
||||
@@ -738,13 +778,13 @@ class SSHConnection():
|
||||
# do not reset board twice in IF4.5 case
|
||||
result = re.search('^rru|^enb|^du.band', str(config_file))
|
||||
if result is not None:
|
||||
self.command('echo ' + lPassWord + ' | sudo -S uhd_find_devices', '\$', 10)
|
||||
self.command('echo ' + lPassWord + ' | sudo -S uhd_find_devices', '\$', 30)
|
||||
result = re.search('type: b200', str(self.ssh.before))
|
||||
if result is not None:
|
||||
logging.debug('Found a B2xx device --> resetting it')
|
||||
self.command('echo ' + lPassWord + ' | sudo -S b2xx_fx3_utils --reset-device', '\$', 10)
|
||||
# Reloading FGPA bin firmware
|
||||
self.command('echo ' + lPassWord + ' | sudo -S uhd_find_devices', '\$', 15)
|
||||
self.command('echo ' + lPassWord + ' | sudo -S uhd_find_devices', '\$', 30)
|
||||
# Make a copy and adapt to EPC / eNB IP addresses
|
||||
self.command('cp ' + full_config_file + ' ' + ci_full_config_file, '\$', 5)
|
||||
self.command('sed -i -e \'s/CI_MME_IP_ADDR/' + self.EPCIPAddress + '/\' ' + ci_full_config_file, '\$', 2);
|
||||
@@ -1138,7 +1178,7 @@ class SSHConnection():
|
||||
html_queue = SimpleQueue()
|
||||
self.checkDevTTYisUnlocked()
|
||||
if attach_status:
|
||||
html_cell = '<pre style="background-color:white">CAT-M module\nAttachment Completed in ' + str(attach_cnt+4) + ' seconds'
|
||||
html_cell = '<pre style="background-color:white">CAT-M module Attachment Completed in ' + str(attach_cnt+4) + ' seconds'
|
||||
if (nRSRQ is not None) and (nRSRP is not None):
|
||||
html_cell += '\n RSRQ = ' + str(-20+(nRSRQ/2)) + ' dB'
|
||||
html_cell += '\n RSRP = ' + str(-140+nRSRP) + ' dBm</pre>'
|
||||
@@ -1147,9 +1187,11 @@ class SSHConnection():
|
||||
html_queue.put(html_cell)
|
||||
self.CreateHtmlTestRowQueue('N/A', 'OK', 1, html_queue)
|
||||
else:
|
||||
html_cell = '<pre style="background-color:white">CAT-M module\nAttachment Failed</pre>'
|
||||
logging.error('\u001B[1m CAT-M module Attachment Failed\u001B[0m')
|
||||
html_cell = '<pre style="background-color:white">CAT-M module Attachment Failed</pre>'
|
||||
html_queue.put(html_cell)
|
||||
self.CreateHtmlTestRowQueue('N/A', 'KO', 1, html_queue)
|
||||
self.AutoTerminateUEandeNB()
|
||||
|
||||
def PingCatM(self):
|
||||
if self.EPCIPAddress == '' or self.EPCUserName == '' or self.EPCPassword == '' or self.EPCSourceCodePath == '':
|
||||
@@ -1160,7 +1202,7 @@ class SSHConnection():
|
||||
pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE)
|
||||
if (pStatus < 0):
|
||||
self.CreateHtmlTestRow(self.ping_args, 'KO', pStatus)
|
||||
self.prematureExit = True
|
||||
self.AutoTerminateUEandeNB()
|
||||
return
|
||||
try:
|
||||
statusQueue = SimpleQueue()
|
||||
@@ -1179,6 +1221,8 @@ class SSHConnection():
|
||||
if result is not None:
|
||||
moduleIPAddr = result.group('ipaddr')
|
||||
else:
|
||||
self.CreateHtmlTestRow(self.ping_args, 'KO', pStatus)
|
||||
self.AutoTerminateUEandeNB()
|
||||
return
|
||||
ping_time = re.findall("-c (\d+)",str(self.ping_args))
|
||||
device_id = 'catm'
|
||||
@@ -2409,15 +2453,16 @@ class SSHConnection():
|
||||
os.kill(os.getppid(),signal.SIGUSR1)
|
||||
|
||||
def IperfNoS1(self):
|
||||
if self.eNBIPAddress == '' or self.eNBUserName == '' or self.eNBPassword == '' or self.UEIPAddress == '' or self.UEUserName == '' or self.UEPassword == '':
|
||||
Usage()
|
||||
sys.exit('Insufficient Parameter')
|
||||
check_eNB = True
|
||||
check_OAI_UE = True
|
||||
pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE)
|
||||
if (pStatus < 0):
|
||||
self.CreateHtmlTestRow(self.iperf_args, 'KO', pStatus)
|
||||
self.AutoTerminateUEandeNB()
|
||||
if self.eNBIPAddress == '' or self.eNBUserName == '' or self.eNBPassword == '' or self.UEIPAddress == '' or self.UEUserName == '' or self.UEPassword == '':
|
||||
Usage()
|
||||
sys.exit('Insufficient Parameter')
|
||||
return
|
||||
server_on_enb = re.search('-R', str(self.iperf_args))
|
||||
if server_on_enb is not None:
|
||||
iServerIPAddr = self.eNBIPAddress
|
||||
@@ -3447,6 +3492,11 @@ class SSHConnection():
|
||||
self.ShowTestID()
|
||||
self.eNB_instance = '0'
|
||||
self.TerminateeNB()
|
||||
if self.flexranCtrlInstalled and self.flexranCtrlStarted:
|
||||
self.testCase_id = 'AUTO-KILL-flexran-ctl'
|
||||
self.desc = 'Automatic Termination of FlexRan CTL'
|
||||
self.ShowTestID()
|
||||
self.TerminateFlexranCtrl()
|
||||
self.prematureExit = True
|
||||
|
||||
def IdleSleep(self):
|
||||
@@ -3716,7 +3766,7 @@ class SSHConnection():
|
||||
if result is not None:
|
||||
self.UhdVersion = result.group('uhd_version')
|
||||
logging.debug('UHD Version is: ' + self.UhdVersion)
|
||||
self.command('echo ' + Password + ' | sudo -S uhd_find_devices', '\$', 12)
|
||||
self.command('echo ' + Password + ' | sudo -S uhd_find_devices', '\$', 30)
|
||||
usrp_boards = re.findall('product: ([0-9A-Za-z]+)\\\\r\\\\n', str(self.ssh.before))
|
||||
count = 0
|
||||
for board in usrp_boards:
|
||||
@@ -4564,7 +4614,11 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
|
||||
while cnt < SSH.repeatCounts[0] and SSH.prematureExit:
|
||||
SSH.prematureExit = False
|
||||
for test_case_id in todo_tests:
|
||||
if SSH.prematureExit:
|
||||
break
|
||||
for test in all_tests:
|
||||
if SSH.prematureExit:
|
||||
break
|
||||
id = test.get('id')
|
||||
if test_case_id != id:
|
||||
continue
|
||||
@@ -4645,10 +4699,6 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
|
||||
SSH.Perform_X2_Handover()
|
||||
else:
|
||||
sys.exit('Invalid action')
|
||||
if SSH.prematureExit:
|
||||
break
|
||||
if SSH.prematureExit:
|
||||
break
|
||||
cnt += 1
|
||||
if cnt == SSH.repeatCounts[0] and SSH.prematureExit:
|
||||
logging.debug('Testsuite failed ' + str(cnt) + ' time(s)')
|
||||
|
||||
@@ -140,10 +140,25 @@ function command_options_usage {
|
||||
echo ""
|
||||
}
|
||||
|
||||
# function to set specific behavior depending on the TESTPLATFORM_OWNER variable
|
||||
# which may be set by a jenkins server for exemple
|
||||
function platform_set {
|
||||
if [ "$TESTPLATFORM_OWNER" != "" ]
|
||||
then
|
||||
echo "Running on $TESTPLATFORM_OWNER platform"
|
||||
if [ -x "/usr/local/bin/oai_${TESTPLATFORM_OWNER}_setenv.sh" ]
|
||||
then
|
||||
. /usr/local/bin/oai_${TESTPLATFORM_OWNER}_setenv.sh
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function setvar_usage {
|
||||
declare -A HELP_VAR
|
||||
HELP_VAR["VM_OSREL"]="OS release to use in virtual machines"
|
||||
HELP_VAR["RUN_EXPERIMENTAL"]="Enforce execution of variants with EXPERIMENTAL variable set to \"true\""
|
||||
HELP_VAR["OPTIONAL_APTCACHER"]="build and Run tests will fail if apt-cacher not installed and this variable not set to \"true\""
|
||||
HELP_VAR["TESTPLATFORM_OWNER"]="Allow pipeline customization via execution of an externel scripts residing on the jenkins server"
|
||||
echo "--setvar_<varname> <value> where varname is one of:"
|
||||
for i in ${AUTHORIZED_VAR[@]}; do printf "%20s : %s\n" "$i" "${HELP_VAR[$i]}" ;done
|
||||
}
|
||||
@@ -177,7 +192,7 @@ function variant__v4__cppcheck {
|
||||
VM_MEMORY=4096
|
||||
LOG_PATTERN=cppcheck.xml
|
||||
NB_PATTERN_FILES=1
|
||||
BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 --suppressions-list=ci-scripts/cppcheck_suppressions.list -I common/utils -I openair3/NAS/COMMON/UTIL -j4"
|
||||
BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c --suppressions-list=ci-scripts/cppcheck_suppressions.list -I common/utils -I openair3/NAS/COMMON/UTIL -j4"
|
||||
}
|
||||
|
||||
function variant__v5__gnb_usrp {
|
||||
@@ -328,6 +343,7 @@ function check_setvar {
|
||||
exit 1
|
||||
}
|
||||
|
||||
platform_set
|
||||
MY_DIR=$(dirname $(readlink -f $0))
|
||||
. $MY_DIR/createVM.sh
|
||||
. $MY_DIR/buildOnVM.sh
|
||||
@@ -337,6 +353,7 @@ MY_DIR=$(dirname $(readlink -f $0))
|
||||
. $MY_DIR/reportBuildLocally.sh
|
||||
. $MY_DIR/reportTestLocally.sh
|
||||
|
||||
|
||||
if [ $# -lt 1 ]
|
||||
then
|
||||
echo "Syntax Error: too few arguments"
|
||||
@@ -454,7 +471,7 @@ RUN_OPTIONS="none"
|
||||
|
||||
|
||||
# list of variables that can be set via the --setvar option
|
||||
AUTHORIZED_VAR=("VM_OSREL RUN_EXPERIMENTAL")
|
||||
AUTHORIZED_VAR=("VM_OSREL RUN_EXPERIMENTAL OPTIONAL_APTCACHER TESTPLATFORM_OWNER")
|
||||
|
||||
|
||||
#variables to set which OS VM should use
|
||||
|
||||
@@ -476,7 +476,7 @@ function install_epc_on_vm {
|
||||
local LOC_EPC_VM_IP_ADDR=`uvt-kvm ip $LOC_EPC_VM_NAME`
|
||||
|
||||
echo "$LOC_EPC_VM_NAME has for IP addr = $LOC_EPC_VM_IP_ADDR"
|
||||
scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$LOC_EPC_VM_IP_ADDR:/home/ubuntu
|
||||
[ -f /etc/apt/apt.conf.d/01proxy ] && scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$LOC_EPC_VM_IP_ADDR:/home/ubuntu
|
||||
|
||||
# ltebox specific actions (install and start)
|
||||
LTE_BOX_TO_INSTALL=1
|
||||
@@ -500,7 +500,7 @@ function install_epc_on_vm {
|
||||
echo "############################################################"
|
||||
echo "Install EPC on EPC VM ($LOC_EPC_VM_NAME)"
|
||||
echo "############################################################"
|
||||
echo "sudo cp 01proxy /etc/apt/apt.conf.d/" > $LOC_EPC_VM_CMDS
|
||||
echo "sudo [ -f 01proxy ] && cp 01proxy /etc/apt/apt.conf.d/" > $LOC_EPC_VM_CMDS
|
||||
echo "touch /home/ubuntu/.hushlogin" >> $LOC_EPC_VM_CMDS
|
||||
echo "echo \"sudo apt-get --yes --quiet install zip openjdk-8-jre libconfuse-dev libreadline-dev liblog4c-dev libgcrypt-dev libsctp-dev python2.7 python2.7-dev daemon iperf\"" >> $LOC_EPC_VM_CMDS
|
||||
echo "sudo apt-get update > zip-install.txt 2>&1" >> $LOC_EPC_VM_CMDS
|
||||
|
||||
@@ -25,10 +25,23 @@
|
||||
<htmlTabName>EPC-Start</htmlTabName>
|
||||
<htmlTabIcon>log-in</htmlTabIcon>
|
||||
<TestCaseRequestedList>
|
||||
010101 090101
|
||||
050101 060101 070101
|
||||
</TestCaseRequestedList>
|
||||
<TestCaseExclusionList></TestCaseExclusionList>
|
||||
|
||||
<testCase id="010101">
|
||||
<class>Build_eNB</class>
|
||||
<desc>Build eNB (USRP)</desc>
|
||||
<Build_eNB_args>-w USRP -c --eNB</Build_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="090101">
|
||||
<class>Build_OAI_UE</class>
|
||||
<desc>Build OAI UE</desc>
|
||||
<Build_OAI_UE_args>-w USRP --UE</Build_OAI_UE_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="050101">
|
||||
<class>Initialize_HSS</class>
|
||||
<desc>Initialize HSS</desc>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<htmlTabRef>test-05-tm1-nos1-tunnel</htmlTabRef>
|
||||
<htmlTabName>Test-05MHz-TM1-noS1-tunnel</htmlTabName>
|
||||
<htmlTabIcon>tasks</htmlTabIcon>
|
||||
<repeatCount>2</repeatCount>
|
||||
<repeatCount>4</repeatCount>
|
||||
<TestCaseRequestedList>
|
||||
030201 090109
|
||||
030101 000001 090101 000002 040501 040502 000001 040601 040602 040641 040642 000001 090109 030201
|
||||
|
||||
@@ -25,10 +25,16 @@
|
||||
<htmlTabName>EPC-Closure</htmlTabName>
|
||||
<htmlTabIcon>log-out</htmlTabIcon>
|
||||
<TestCaseRequestedList>
|
||||
040202
|
||||
050201 060201 070201
|
||||
</TestCaseRequestedList>
|
||||
<TestCaseExclusionList></TestCaseExclusionList>
|
||||
|
||||
<testCase id="040202">
|
||||
<class>Terminate_CatM_module</class>
|
||||
<desc>Terminate CAT-M Module</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="050201">
|
||||
<class>Terminate_HSS</class>
|
||||
<desc>Terminate HSS</desc>
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
<htmlTabIcon>tasks</htmlTabIcon>
|
||||
<TestCaseRequestedList>
|
||||
030201 030202
|
||||
050202
|
||||
</TestCaseRequestedList>
|
||||
<TestCaseExclusionList></TestCaseExclusionList>
|
||||
|
||||
@@ -43,4 +44,9 @@
|
||||
<eNB_serverId>1</eNB_serverId>
|
||||
</testCase>
|
||||
|
||||
<testCase id="050202">
|
||||
<class>Terminate_FlexranCtrl</class>
|
||||
<desc>Stopping Flexran Controller</desc>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
|
||||
+124
-32
@@ -1332,7 +1332,11 @@ set(PHY_SRC_UE
|
||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_sch_dmrs.c
|
||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_ulsch_llr_computation.c
|
||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_dmrs_rx.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gold.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/filt16a_32.c
|
||||
${OPENAIR1_DIR}/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
|
||||
${OPENAIR1_DIR}/PHY/NR_ESTIMATION/nr_adjust_sync_gNB.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/file_output.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c
|
||||
#${OPENAIR1_DIR}/PHY/TOOLS/lte_dfts.c
|
||||
@@ -1377,6 +1381,7 @@ set(PHY_SRC_UE
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/ul_ref_seq_nr.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_dmrs_rx.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gold_ue.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/filt16a_32.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
|
||||
@@ -1561,6 +1566,44 @@ set(L2_SRC_UE
|
||||
${RRC_DIR}/L2_interface_common.c
|
||||
${RRC_DIR}/L2_interface_ue.c
|
||||
)
|
||||
|
||||
set(LTE_NR_L2_SRC_UE
|
||||
${PDCP_DIR}/pdcp.c
|
||||
${PDCP_DIR}/pdcp_fifo.c
|
||||
${PDCP_DIR}/pdcp_sequence_manager.c
|
||||
${PDCP_DIR}/pdcp_primitives.c
|
||||
${PDCP_DIR}/pdcp_util.c
|
||||
${PDCP_DIR}/pdcp_security.c
|
||||
${PDCP_DIR}/pdcp_netlink.c
|
||||
${RLC_AM_DIR}/rlc_am.c
|
||||
${RLC_AM_DIR}/rlc_am_init.c
|
||||
${RLC_AM_DIR}/rlc_am_timer_poll_retransmit.c
|
||||
${RLC_AM_DIR}/rlc_am_timer_reordering.c
|
||||
${RLC_AM_DIR}/rlc_am_timer_status_prohibit.c
|
||||
${RLC_AM_DIR}/rlc_am_segment.c
|
||||
${RLC_AM_DIR}/rlc_am_segments_holes.c
|
||||
${RLC_AM_DIR}/rlc_am_in_sdu.c
|
||||
${RLC_AM_DIR}/rlc_am_receiver.c
|
||||
${RLC_AM_DIR}/rlc_am_retransmit.c
|
||||
${RLC_AM_DIR}/rlc_am_windows.c
|
||||
${RLC_AM_DIR}/rlc_am_rx_list.c
|
||||
${RLC_AM_DIR}/rlc_am_reassembly.c
|
||||
${RLC_AM_DIR}/rlc_am_status_report.c
|
||||
${RLC_TM_DIR}/rlc_tm.c
|
||||
${RLC_TM_DIR}/rlc_tm_init.c
|
||||
${RLC_UM_DIR}/rlc_um.c
|
||||
${RLC_UM_DIR}/rlc_um_fsm.c
|
||||
${RLC_UM_DIR}/rlc_um_control_primitives.c
|
||||
${RLC_UM_DIR}/rlc_um_segment.c
|
||||
${RLC_UM_DIR}/rlc_um_reassembly.c
|
||||
${RLC_UM_DIR}/rlc_um_receiver.c
|
||||
${RLC_UM_DIR}/rlc_um_dar.c
|
||||
${RLC_DIR}/rlc_mac.c
|
||||
${RLC_DIR}/rlc.c
|
||||
${RLC_DIR}/rlc_rrc.c
|
||||
${RLC_DIR}/rlc_mpls.c
|
||||
${RRC_DIR}/L2_interface_common.c
|
||||
)
|
||||
|
||||
set(NR_L2_SRC_UE
|
||||
${NR_UE_RRC_DIR}/L2_interface_ue.c
|
||||
@@ -1613,7 +1656,7 @@ set (MAC_SRC_UE
|
||||
${MAC_DIR}/config_ue.c
|
||||
|
||||
)
|
||||
|
||||
|
||||
set (MAC_NR_SRC_UE
|
||||
${NR_UE_PHY_INTERFACE_DIR}/NR_IF_Module.c
|
||||
${NR_UE_MAC_DIR}/config_ue.c
|
||||
@@ -1669,6 +1712,10 @@ endif()
|
||||
add_dependencies(L2_UE rrc_flag s1ap_flag x2_flag)
|
||||
|
||||
add_library( NR_L2_UE ${NR_L2_SRC_UE} ${MAC_NR_SRC_UE} )
|
||||
|
||||
add_library ( LTE_NR_L2_UE
|
||||
${LTE_NR_L2_SRC_UE}
|
||||
)
|
||||
|
||||
add_library( MAC_NR_COMMON ${OPENAIR2_DIR}/LAYER2/NR_MAC_gNB/nr_mac_common.c )
|
||||
|
||||
@@ -2023,7 +2070,7 @@ add_library(LFDS7
|
||||
|
||||
# Simulation library
|
||||
##########################
|
||||
add_library(SIMU
|
||||
set (SIMUSRC
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/random_channel.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/rangen_double.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
|
||||
@@ -2034,9 +2081,13 @@ ${OPENAIR1_DIR}/SIMULATION/TOOLS/channel_sim.c
|
||||
${OPENAIR1_DIR}/SIMULATION/RF/rf.c
|
||||
${OPENAIR1_DIR}/SIMULATION/RF/dac.c
|
||||
${OPENAIR1_DIR}/SIMULATION/RF/adc.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
${OPENAIR_DIR}/targets/ARCH/rfsimulator/apply_channelmod.c
|
||||
#${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
)
|
||||
|
||||
# Simulation library
|
||||
##########################
|
||||
add_library( SIMU SHARED ${SIMUSRC} )
|
||||
|
||||
add_library(SIMU_ETH
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
@@ -2342,7 +2393,6 @@ add_executable(lte-uesoftmodem
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
|
||||
${OPENAIR_TARGETS}/RT/USER/ru_control.c
|
||||
${OPENAIR_TARGETS}/RT/USER/rfsim.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
|
||||
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
|
||||
@@ -2496,6 +2546,8 @@ add_executable(nr-uesoftmodem-nos1
|
||||
${rrc_h}
|
||||
${s1ap_h}
|
||||
# ${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
|
||||
${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
|
||||
${OPENAIR_DIR}/executables/nr-ue.c
|
||||
${OPENAIR_DIR}/executables/nr-uesoftmodem.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
|
||||
@@ -2509,9 +2561,10 @@ add_executable(nr-uesoftmodem-nos1
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
|
||||
|
||||
target_link_libraries (nr-uesoftmodem-nos1
|
||||
-Wl,--start-group
|
||||
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB PHY_COMMON PHY_NR_UE PHY_UE PHY_RU LFDS NR_L2_UE MAC_NR_COMMON
|
||||
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB PHY_COMMON PHY_NR_UE PHY_RU LFDS LTE_NR_L2_UE NR_L2_UE MAC_NR_COMMON
|
||||
${MSC_LIB} ${RAL_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
@@ -2566,69 +2619,108 @@ target_link_libraries (dlsim_tm4
|
||||
|
||||
add_executable(polartest
|
||||
${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/polartest.c
|
||||
${OPENAIR_DIR}/common/utils/backtrace.c)
|
||||
target_link_libraries(polartest SIMU PHY PHY_NR PHY_COMMON m ${ATLAS_LIBRARIES})
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${T_SOURCE}
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(polartest
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_UE CONFIG_LIB -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} dl
|
||||
)
|
||||
|
||||
|
||||
add_executable(smallblocktest
|
||||
add_executable(smallblocktest
|
||||
${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/smallblocktest.c
|
||||
${OPENAIR_DIR}/common/utils/backtrace.c)
|
||||
target_link_libraries(smallblocktest SIMU PHY PHY_NR PHY_COMMON m ${ATLAS_LIBRARIES})
|
||||
${T_SOURCE}
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(smallblocktest
|
||||
-Wl,--start-group UTIL SIMU PHY_NR CONFIG_LIB -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} dl
|
||||
)
|
||||
|
||||
add_executable(ldpctest
|
||||
${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/ldpctest.c
|
||||
${OPENAIR_DIR}/common/utils/backtrace.c)
|
||||
target_link_libraries(ldpctest SIMU PHY PHY_NR m ${ATLAS_LIBRARIES})
|
||||
${T_SOURCE}
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(ldpctest
|
||||
-Wl,--start-group UTIL SIMU PHY_NR CONFIG_LIB -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} dl
|
||||
)
|
||||
|
||||
add_executable(nr_dlschsim
|
||||
${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlschsim.c
|
||||
${OPENAIR_DIR}/common/utils/backtrace.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${UTIL_SRC}
|
||||
${T_SOURCE})
|
||||
target_link_libraries(nr_dlschsim -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl)
|
||||
${T_SOURCE}
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(nr_dlschsim
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl
|
||||
)
|
||||
|
||||
add_executable(nr_pbchsim
|
||||
${OPENAIR1_DIR}/SIMULATION/NR_PHY/pbchsim.c
|
||||
${OPENAIR_DIR}/common/utils/backtrace.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${UTIL_SRC}
|
||||
${T_SOURCE})
|
||||
target_link_libraries(nr_pbchsim -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl)
|
||||
${T_SOURCE}
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(nr_pbchsim
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl
|
||||
)
|
||||
|
||||
#PUCCH ---> Prashanth
|
||||
add_executable(nr_pucchsim
|
||||
${OPENAIR1_DIR}/SIMULATION/NR_PHY/pucchsim.c
|
||||
${OPENAIR_DIR}/common/utils/backtrace.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${UTIL_SRC}
|
||||
${T_SOURCE})
|
||||
target_link_libraries(nr_pucchsim -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl)
|
||||
${T_SOURCE}
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(nr_pucchsim
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl
|
||||
)
|
||||
#PUCCH ---> Prashanth
|
||||
|
||||
add_executable(nr_dlsim
|
||||
${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlsim.c
|
||||
${OPENAIR_DIR}/common/utils/backtrace.c
|
||||
${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlsim.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${UTIL_SRC}
|
||||
${T_SOURCE})
|
||||
target_link_libraries(nr_dlsim -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_NR -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl)
|
||||
${T_SOURCE}
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(nr_dlsim
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_NR -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl
|
||||
)
|
||||
|
||||
add_executable(nr_ulschsim
|
||||
${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulschsim.c
|
||||
${OPENAIR_DIR}/common/utils/backtrace.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${UTIL_SRC}
|
||||
${T_SOURCE})
|
||||
target_link_libraries(nr_ulschsim -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl)
|
||||
${T_SOURCE}
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(nr_ulschsim
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl
|
||||
)
|
||||
|
||||
add_executable(nr_ulsim
|
||||
${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulsim.c
|
||||
${OPENAIR_DIR}/common/utils/backtrace.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${UTIL_SRC}
|
||||
${T_SOURCE})
|
||||
target_link_libraries(nr_ulsim -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_NR -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl)
|
||||
${T_SOURCE}
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(nr_ulsim
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_NR -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl
|
||||
)
|
||||
|
||||
|
||||
foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim)
|
||||
|
||||
+16
-11
@@ -149,7 +149,7 @@ Options
|
||||
--build-eclipse
|
||||
Build eclipse project files. Paths are auto corrected by fixprj.sh
|
||||
--build-lib <libraries>
|
||||
Build optional shared library, <libraries> can be one or several of $OPTIONAL_LIBRARIES
|
||||
Build optional shared library, <libraries> can be one or several of $OPTIONAL_LIBRARIES or \"all\"
|
||||
--usrp-recplay
|
||||
Build for I/Q record-playback modes
|
||||
-h | --help
|
||||
@@ -346,16 +346,21 @@ function main() {
|
||||
shift 1;;
|
||||
--build-lib)
|
||||
BUILD_OPTLIB=""
|
||||
for alib in $2 ; do
|
||||
if [ "$2" == "all" ] ; then
|
||||
BUILD_OPTLIB="$OPTIONAL_LIBRARIES"
|
||||
echo_info "Enabling build of all optional shared libraries ($OPTIONAL_LIBRARIES)"
|
||||
else
|
||||
for alib in $2 ; do
|
||||
for oklib in $OPTIONAL_LIBRARIES ; do
|
||||
if [ "$alib" = "$oklib" ] ; then
|
||||
BUILD_OPTLIB="$BUILD_OPTLIB $alib"
|
||||
echo_info "Enabling build of lib${alib}.so"
|
||||
fi
|
||||
if [ "$alib" = "$oklib" ] ; then
|
||||
BUILD_OPTLIB="$BUILD_OPTLIB $alib"
|
||||
echo_info "Enabling build of lib${alib}.so"
|
||||
fi
|
||||
done
|
||||
done
|
||||
done
|
||||
if [ "${BUILD_OPTLIB## }" != "$2" ] ; then
|
||||
echo_fatal "Unknown optional library in $2, valid libraries are $OPTIONAL_LIBRARIES"
|
||||
if [ "${BUILD_OPTLIB## }" != "$2" ] ; then
|
||||
echo_fatal "Unknown optional library in $2, valid libraries are $OPTIONAL_LIBRARIES"
|
||||
fi
|
||||
fi
|
||||
shift 2;;
|
||||
--usrp-recplay)
|
||||
@@ -580,7 +585,8 @@ function main() {
|
||||
nr-uesoftmodem $dbin/nr-uesoftmodem.$REL
|
||||
fi
|
||||
|
||||
# mandatory shared lib
|
||||
# mandatory shared libraries common to UE and (e/g)NB
|
||||
|
||||
compilations \
|
||||
$build_dir $config_libconfig_shlib \
|
||||
lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
|
||||
@@ -864,7 +870,6 @@ function main() {
|
||||
ln -sf $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so
|
||||
echo_info "liboai_transpro.so is linked to ETHERNET transport"
|
||||
fi
|
||||
|
||||
|
||||
###################
|
||||
# Doxygen Support #
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
## config module management
|
||||
|
||||
```c
|
||||
configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t initflags)
|
||||
```
|
||||
@@ -14,23 +16,17 @@ void End_configmodule(void)
|
||||
* Free memory which has been allocated by the configuration module since its initialization.
|
||||
* Possibly calls the `config_<config source>_end` function
|
||||
|
||||
## Retrieving parameter's values
|
||||
|
||||
```c
|
||||
int config_get(paramdef_t *params,int numparams, char *prefix)
|
||||
```
|
||||
* Reads as many parameters as described in params, they must all be in the same configuration file section
|
||||
* Calls the `config_<config source>_get` function
|
||||
* Calls the `config_process_cmdline` function
|
||||
* `params` points to an array of `paramdef_t` structures which describes the parameters to be read, possibly including a pointer to a checking function. The following bits can possibly be set in the `paramflags` mask before calling
|
||||
- `PARAMFLAG_MANDATORY`: -1 is returned if the parameter is not explicitly defined in the config source.
|
||||
- `PARAMFLAG_DISABLECMDLINE`: parameter cannot be modified via the command line
|
||||
- `PARAMFLAG_DONOTREAD`: ignore the parameter, can be used at run-time, to alter a pre-defined `paramdef_t` array which is used in several `config_get` or/and `config_getlist` calls.
|
||||
- `PARAMFLAG_NOFREE`: do not free the memory possibly allocated by the config module to store the value of the parameter. Default behavior is for the config module to free the memory it has allocated when the `config_end` function is called.
|
||||
- `PARAMFLAG_BOOL`: Only relevant for integer types. tell the config module that when processing the command line, the corresponding option can be specified without any arggument and that in this case it must set the value to 1.
|
||||
* `params` points to an array of `paramdef_t` structures which describes the parameters to be read, possibly including a pointer to a checking function.The `paramflags` bit mask can be used to modify how a specific parameter is processed and the same mask is also used by the configuration module to return information about how the parameter has been processed. Bits definitions are described in the [`paramdef_t` structure description](./struct.md)
|
||||
|
||||
|
||||
* `params` is also used as an output parameter, `< XXX >ptr >` field is used by the config module to store the value it has read. The following bits can possibly be set in the `paramflags` mask after the call:
|
||||
- `PARAMFLAG_MALLOCINCONFIG`: memory has been allocated for the ` < XXX >ptr > ` field
|
||||
- `PARAMFLAG_PARAMSET`: parameter has been found in the config source, it is not set to default value.
|
||||
- `PARAMFLAG_PARAMSET`: parameter has been set to its default value
|
||||
* `numparams` is the number of entries in the params array
|
||||
* `prefix` is a character string to be appended to the parameters name, it defines the parameters position in the configuration file hierarchy (the section name in libconfig terminology).
|
||||
* The returned value is the number of parameters which have been assigned a value or -1 if a severe error occured
|
||||
@@ -44,6 +40,9 @@ int config_libconfig_getlist(paramlist_def_t *ParamList, paramdef_t *params, int
|
||||
* `ParamList` points to a structure, where `paramarray` field points to an array of `paramdef_t` structure, allocated by the function. It is used to return the values of the parameters.
|
||||
* The returned value is the number of occurrences in the list or -1 in case of severe error
|
||||
|
||||
## utility functions and macros
|
||||
|
||||
The configuration module also defines APIs to access the `paramdef_t` and `configmodule_interface_t` fields. They are listed in the configuration module [include file `common/config/config_userapi.h`](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/config/config_userapi.h)
|
||||
|
||||
[Configuration module developer main page](../../config/devusage.md)
|
||||
[Configuration module home](../../config.md)
|
||||
|
||||
@@ -5,6 +5,7 @@ It is defined in include file [ common/config/config_paramdesc.h ](https://gitla
|
||||
|:-----------|:------------------------------------------------------------------|----:|
|
||||
| `optname` | parameter name, as used when looking for it in the config source, 63 bytes max (64 with trailing \0) | I |
|
||||
| `helstr` | pointer to a C string printed when using --help on the command line | I |
|
||||
| `paramflags` | bit mask, used to modify how the parameter is processed, or to return to the API caller how the parameter has been set, see list in the next table | IO |
|
||||
| `strptr` `strlistptr` `u8ptr` `i8ptr` `u16ptr` `i16ptr` `uptr` `iptr` `u64ptr` `i64ptr` `dblptr` `voidptr` | a pointer to a variable where the parameter value(s) will be returned. This field is an anonymous union, the supported pointer types have been built to avoid type mismatch warnings at compile time. | O |
|
||||
| `defstrval` `defstrlistval` `defuintval` `defintval` `defint64val` `defintarrayval` `defdblval` | this field is an anonymous union, it can be used to define the default value for the parameter. It is ignored if `PARAMFLAG_MANDATORY` is set in the `paramflags` field.| I |
|
||||
| `type` | Supported parameter types are defined as integer macros. Supported simple types are `TYPE_STRING`, parameter value is returned in `strptr` field, `TYPE_INT8` `TYPE_UINT8` `TYPE_INT16` `TYPE_UINT16` `TYPE_INT32` `TYPE_UINT32` `TYPE_INT64` `TYPE_UINT64`, parameter value is returned in the corresponding uXptr or iXptr, `TYPE_MASK`, value is returned in `u32ptr`, `TYPE_DOUBLE` value is returned in `dblptr`, `TYPE_IPV4ADDR` value is returned in binary, network bytes order in `u32ptr` field. `TYPE_STRINGLIST`, `TYPE_INTARRAY` and `TYPE_UINTARRAY` are multiple values types. Multiple values are returned in respectively, `strlistptr`, `iptr` and `uptr` fields which then point to arrays. The `numelt` field gives the number of item in the array. | I |
|
||||
@@ -12,6 +13,22 @@ It is defined in include file [ common/config/config_paramdesc.h ](https://gitla
|
||||
| `chkPptr` | possible pointer to the structure containing the info used to check parameter values | I |
|
||||
| `processedvalue` | When `chkPptr` is not `ǸULL`, is used to return a value, computed from the original parameter, as read from the configuration source. | O |
|
||||
|
||||
## `paramflags` bits definition
|
||||
|
||||
|
||||
| C macro bit definition | usage | I/O |
|
||||
|:-------------------------------------|:---------------------------------------------------------------------------------------------------------------------|----:|
|
||||
| `PARAMFLAG_MANDATORY` | parameter is mandatory, comfiguration module will stop the process if it is not specified. Default value is ignored | I |
|
||||
| `PARAMFLAG_DISABLECMDLINE` | parameter cannot be specified on the command line | I |
|
||||
| `PARAMFLAG_DONOTREAD` | ignore the parameter, usefull when a parameter group is used in different context | I |
|
||||
| `PARAMFLAG_NOFREE` | The end_configmodule API won't free the memory which has been possibly allocated to store the value of the parameter.| I |
|
||||
| `PARAMFLAG_BOOL` | Parameter is a boolean, it can be specified without a value to set it to true | I |
|
||||
| `PARAMFLAG_CMDLINE_NOPREFIXENABLED` | parameter can be specified without the prefix on the command line. Must be used with care, carefuly checking unicity, especially for short parameter names | I |
|
||||
| `PARAMFLAG_MALLOCINCONFIG` | Memory for the parameter value has been allocated by the configuration module |O |
|
||||
| `PARAMFLAG_PARAMSET` | Parameter value has been explicitely set, as the parameter was specified either on the command line or the config source | O |
|
||||
| `PARAMFLAG_PARAMSETDEF` | Parameter value has been set to it's default | O |
|
||||
|
||||
|
||||
# `paramlist_def_t`structure
|
||||
It is defined in include file [ common/config/config_paramdesc.h ](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/config/config_paramdesc.h#L160).
|
||||
It is used as an argument to `config_getlist` calls, to get values of multiple occurrences of group of parameters.
|
||||
|
||||
@@ -167,8 +167,8 @@ int config_check_unknown_cmdlineopt(char *prefix) {
|
||||
char testprefix[CONFIG_MAXOPTLENGTH];
|
||||
int finalcheck = 0;
|
||||
memset(testprefix,0,sizeof(testprefix));
|
||||
|
||||
memset(testprefix,0,sizeof(testprefix));
|
||||
|
||||
if (prefix != NULL) {
|
||||
if (strcmp(prefix,CONFIG_CHECKALLSECTIONS) == 0)
|
||||
finalcheck = 1;
|
||||
@@ -253,7 +253,9 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
|
||||
}
|
||||
|
||||
if ( ((strlen(oneargv) == 2) && (strcmp(oneargv + 1,cfgpath) == 0)) || /* short option, one "-" */
|
||||
((strlen(oneargv) > 2) && (strcmp(oneargv + 2,cfgpath ) == 0 )) ) {
|
||||
((strlen(oneargv) > 2) && (strcmp(oneargv + 2,cfgpath ) == 0 )) || /* long option beginning with "--" */
|
||||
((strlen(oneargv) == 2) && (strcmp(oneargv + 1,cfgoptions[n].optname) == 0) && (cfgoptions[n].paramflags & PARAMFLAG_CMDLINE_NOPREFIXENABLED )) ||
|
||||
((strlen(oneargv) > 2) && (strcmp(oneargv + 2,cfgpath ) == 0 ) && (cfgoptions[n].paramflags & PARAMFLAG_CMDLINE_NOPREFIXENABLED )) ) {
|
||||
char *valptr=NULL;
|
||||
int ret;
|
||||
config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#define PARAMFLAG_DONOTREAD (1 << 2) // parameter must be ignored in get function
|
||||
#define PARAMFLAG_NOFREE (1 << 3) // don't free parameter in end function
|
||||
#define PARAMFLAG_BOOL (1 << 4) // integer param can be 0 or 1
|
||||
|
||||
#define PARAMFLAG_CMDLINE_NOPREFIXENABLED (1 << 5) // on the command line, allow a parameter to be specified without the prefix
|
||||
|
||||
/* Flags used by config modules to return info to calling modules and/or to for internal usage*/
|
||||
#define PARAMFLAG_MALLOCINCONFIG (1 << 15) // parameter allocated in config module
|
||||
|
||||
@@ -172,7 +172,7 @@ int config_get_processedint(paramdef_t *cfgoption) {
|
||||
return ret;
|
||||
}
|
||||
void config_printhelp(paramdef_t *params,int numparams, char *prefix) {
|
||||
printf("\n-----Help for section %-26s: %03i entries------\n",(prefix==NULL)?"(root section)":prefix ,numparams);
|
||||
printf("\n-----Help for section %-26s: %03i entries------\n",(prefix==NULL)?"(root section)":prefix,numparams);
|
||||
|
||||
for (int i=0 ; i<numparams ; i++) {
|
||||
printf(" %s%s: %s",
|
||||
@@ -204,6 +204,16 @@ int config_execcheck(paramdef_t *params, int numparams, char *prefix) {
|
||||
return st;
|
||||
}
|
||||
|
||||
int config_paramidx_fromname(paramdef_t *params, int numparams, char *name) {
|
||||
for (int i=0; i<numparams ; i++) {
|
||||
if (strcmp(name,params[i].optname) == 0)
|
||||
return i;
|
||||
}
|
||||
|
||||
fprintf(stderr,"[CONFIG]config_paramidx_fromname , %s is not a valid parameter name\n",name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int config_get(paramdef_t *params, int numparams, char *prefix) {
|
||||
int ret= -1;
|
||||
|
||||
@@ -438,7 +448,7 @@ int config_setdefault_intlist(paramdef_t *cfgoptions, char *prefix) {
|
||||
status=1;
|
||||
|
||||
for (int j=0; j<cfgoptions->numelt ; j++) {
|
||||
printf_params("[CONFIG] %s[%i] set to default value %i\n",cfgoptions->optname ,j,(int)cfgoptions->iptr[j]);
|
||||
printf_params("[CONFIG] %s[%i] set to default value %i\n",cfgoptions->optname,j,(int)cfgoptions->iptr[j]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,7 +462,7 @@ int config_setdefault_double(paramdef_t *cfgoptions, char *prefix) {
|
||||
if( ((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
*(cfgoptions->dblptr)=cfgoptions->defdblval;
|
||||
status=1;
|
||||
printf_params("[CONFIG] %s set to default value %lf\n",cfgoptions->optname , *(cfgoptions->dblptr));
|
||||
printf_params("[CONFIG] %s set to default value %lf\n",cfgoptions->optname, *(cfgoptions->dblptr));
|
||||
}
|
||||
|
||||
return status;
|
||||
@@ -460,7 +470,7 @@ int config_setdefault_double(paramdef_t *cfgoptions, char *prefix) {
|
||||
|
||||
int config_assign_ipv4addr(paramdef_t *cfgoptions, char *ipv4addr) {
|
||||
config_check_valptr(cfgoptions,(char **)&(cfgoptions->uptr), sizeof(int));
|
||||
int rst=inet_pton(AF_INET, ipv4addr ,cfgoptions->uptr );
|
||||
int rst=inet_pton(AF_INET, ipv4addr,cfgoptions->uptr );
|
||||
|
||||
if (rst == 1 && *(cfgoptions->uptr) > 0) {
|
||||
printf_params("[CONFIG] %s: %s\n",cfgoptions->optname, ipv4addr);
|
||||
|
||||
@@ -39,6 +39,7 @@ extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* utility functions to ease usage of config module structures */
|
||||
#define CONFIG_GETSOURCE ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgmode )
|
||||
#define CONFIG_GETNUMP ( (config_get_if()==NULL) ? 0 : config_get_if()->num_cfgP )
|
||||
#define CONFIG_GETP(P) ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgP[P] )
|
||||
@@ -46,6 +47,8 @@ extern "C"
|
||||
#define CONFIG_SETRTFLAG(P) if (config_get_if()) { config_get_if()->rtflags |= P; }
|
||||
#define CONFIG_CLEARRTFLAG(P) if (config_get_if()) { config_get_if()->rtflags &= (~P); }
|
||||
#define CONFIG_ISPARAMFLAGSET(P,F) ( !!(P.paramflags & F))
|
||||
extern int config_paramidx_fromname(paramdef_t *params,int numparams, char *name);
|
||||
|
||||
/* utility functions, to be used by configuration module and/or configuration libraries */
|
||||
extern configmodule_interface_t *config_get_if(void);
|
||||
extern char *config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) ;
|
||||
|
||||
@@ -232,7 +232,7 @@ int write_file_matlab(const char *fname,
|
||||
void log_getconfig(log_t *g_log)
|
||||
{
|
||||
char *gloglevel = NULL;
|
||||
int consolelog ;
|
||||
int consolelog = 0;
|
||||
paramdef_t logparams_defaults[] = LOG_GLOBALPARAMS_DESC;
|
||||
paramdef_t logparams_level[MAX_LOG_PREDEF_COMPONENTS];
|
||||
paramdef_t logparams_logfile[MAX_LOG_PREDEF_COMPONENTS];
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
* \date 2009 - 2014
|
||||
* \version 0.5
|
||||
* @ingroup util
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __LOG_H__
|
||||
@@ -297,7 +296,7 @@ extern "C" {
|
||||
# include "log_if.h"
|
||||
/*----------------------------------------------------------------------------*/
|
||||
int logInit (void);
|
||||
int isLogInitDone (void);
|
||||
int isLogInitDone (void);
|
||||
void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
|
||||
void vlogRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, va_list args );
|
||||
void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... );
|
||||
@@ -363,14 +362,14 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
|
||||
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* LOG globalconfiguration parameters */
|
||||
/* optname help paramflags XXXptr defXXXval type numelt */
|
||||
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* LOG globalconfiguration parameters */
|
||||
/* optname help paramflags XXXptr defXXXval type numelt */
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define LOG_GLOBALPARAMS_DESC { \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, "Default log level for all componemts\n", 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, "Default console output option, for all components\n", 0, iptr:&(consolelog), defintval:1, TYPE_INT, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_OPTIONS, LOG_CONFIG_HELP_OPTIONS, 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST,0} \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, "Default log level for all componemts\n", 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, "Default console output option, for all components\n", 0, iptr:&(consolelog), defintval:1, TYPE_INT, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_OPTIONS, LOG_CONFIG_HELP_OPTIONS, 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST, 0} \
|
||||
}
|
||||
|
||||
#define LOG_OPTIONS_IDX 2
|
||||
|
||||
@@ -634,7 +634,7 @@ void *vcd_dumper_thread_rt(void *args)
|
||||
uint32_t data_ready_wait;
|
||||
|
||||
# if defined(ENABLE_ITTI)
|
||||
signal_mask();
|
||||
return 0; //signal_mask(); //function defined at common/utils/ocp_itti/intertask_interface.cpp
|
||||
# endif
|
||||
|
||||
sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO) + 1;
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
#include <common/utils/system.h>
|
||||
|
||||
typedef struct timer_elm_s {
|
||||
timer_type_t type; ///< Timer type
|
||||
long instance;
|
||||
timer_type_t type; ///< Timer type
|
||||
long instance;
|
||||
long duration;
|
||||
uint64_t timeout;
|
||||
void *timer_arg; ///< Optional argument that will be passed when timer expires
|
||||
void *timer_arg; ///< Optional argument that will be passed when timer expires
|
||||
} timer_elm_t ;
|
||||
|
||||
typedef struct task_list_s {
|
||||
|
||||
@@ -25,7 +25,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
uint32_t interval_sec;
|
||||
uint32_t interval_us;
|
||||
long task_id;
|
||||
long task_id;
|
||||
int32_t instance;
|
||||
timer_type_t type;
|
||||
void *timer_arg;
|
||||
@@ -33,7 +33,7 @@ typedef struct {
|
||||
} timer_create_t;
|
||||
|
||||
typedef struct {
|
||||
long task_id;
|
||||
long task_id;
|
||||
long timer_id;
|
||||
} timer_delete_t;
|
||||
|
||||
@@ -536,6 +536,7 @@ int timer_setup(
|
||||
int timer_remove(long timer_id);
|
||||
#define timer_stop timer_remove
|
||||
int signal_handle(int *end);
|
||||
int signal_mask(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ void client_printf(const char *message, ...) {
|
||||
|
||||
if (telnetparams.new_socket > 0) {
|
||||
vsnprintf(telnetparams.msgbuff,sizeof(telnetparams.msgbuff)-1,message, va_args);
|
||||
send(telnetparams.new_socket,telnetparams.msgbuff , strlen(telnetparams.msgbuff), MSG_NOSIGNAL);
|
||||
send(telnetparams.new_socket,telnetparams.msgbuff, strlen(telnetparams.msgbuff), MSG_NOSIGNAL);
|
||||
} else {
|
||||
vprintf(message, va_args);
|
||||
}
|
||||
@@ -475,7 +475,7 @@ int process_command(char *buf) {
|
||||
memset(cmdb,0,sizeof(cmdb));
|
||||
bufbck=strdup(buf);
|
||||
rt=CMDSTATUS_NOTFOUND;
|
||||
j = sscanf(buf,"%9s %9s %9[^\t\n]",modulename,cmd,cmdb);
|
||||
j = sscanf(buf,"%19s %19s %19[^\t\n]",modulename,cmd,cmdb);
|
||||
|
||||
if (telnetparams.telnetdbg > 0)
|
||||
printf("process_command: %i words, module=%s cmd=%s, parameters= %s\n",j,modulename,cmd,cmdb);
|
||||
@@ -543,7 +543,7 @@ void run_telnetsrv(void) {
|
||||
char buf[TELNET_MAX_MSGLENGTH];
|
||||
struct sockaddr cli_addr;
|
||||
unsigned int cli_len = sizeof(cli_addr);
|
||||
int readc , filled;
|
||||
int readc, filled;
|
||||
int status;
|
||||
int optval = 1;
|
||||
pthread_setname_np(pthread_self(), "telnet");
|
||||
@@ -604,7 +604,7 @@ void run_telnetsrv(void) {
|
||||
}
|
||||
|
||||
if (telnetparams.telnetdbg > 0)
|
||||
printf("[TELNETSRV] Command received: readc %i filled %i \"%s\"\n", readc, filled ,buf);
|
||||
printf("[TELNETSRV] Command received: readc %i filled %i \"%s\"\n", readc, filled,buf);
|
||||
|
||||
if (buf[0] == '!') {
|
||||
if (buf[1] == '!') {
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ cd cmake_targets/
|
||||
```
|
||||
|
||||
- The `-I` option is to install pre-requisites, you only need it the first time you build the softmodem or when some oai dependencies have changed.
|
||||
- The `-w` option is to select the radio head support you want to include in your build. Radio head support is provided via a shared library, which is called the "oai device" The build script creates a soft link from `liboai_device.so` to the true device which will be used at run-time (here the USRP one,`liboai_usrpdevif.so` . USRP is the only hardware tested today in the Continuous Integration process.
|
||||
- The `-w` option is to select the radio head support you want to include in your build. Radio head support is provided via a shared library, which is called the "oai device" The build script creates a soft link from `liboai_device.so` to the true device which will be used at run-time (here the USRP one,`liboai_usrpdevif.so` . USRP is the only hardware tested today in the Continuous Integration process. The RF simulator[RF simulator](../targets/ARCH/rfsimulator/README.md) is implemented as a specific device replacing RF hardware, it can be build using `-w SIMU` option.
|
||||
- `--eNB` is to build the `lte-softmodem` executable and all required shared libraries
|
||||
- `--UE` is to build the `lte-uesoftmodem` executable and all required shared libraries
|
||||
|
||||
|
||||
+25
-21
@@ -99,17 +99,17 @@
|
||||
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
extern volatile int start_gNB;
|
||||
extern volatile int start_UE;
|
||||
extern volatile int start_gNB;
|
||||
extern volatile int start_UE;
|
||||
#endif
|
||||
extern volatile int oai_exit;
|
||||
extern volatile int oai_exit;
|
||||
|
||||
extern openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
|
||||
extern int transmission_mode;
|
||||
|
||||
uint16_t sl_ahead=4;
|
||||
uint16_t sf_ahead=4;
|
||||
uint16_t sl_ahead=6;
|
||||
uint16_t sf_ahead=6;
|
||||
//pthread_t main_gNB_thread;
|
||||
|
||||
time_stats_t softmodem_stats_mt; // main thread
|
||||
@@ -133,13 +133,14 @@ extern double cpuf;
|
||||
void init_gNB(int,int);
|
||||
void stop_gNB(int nb_inst);
|
||||
|
||||
int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot_tx,uint64_t timestamp_tx);
|
||||
int wakeup_tx(PHY_VARS_gNB *gNB,int frame_rx,int slot_rx,int frame_tx,int slot_tx,uint64_t timestamp_tx);
|
||||
extern PARALLEL_CONF_t get_thread_parallel_conf(void);
|
||||
extern WORKER_CONF_t get_thread_worker_conf(void);
|
||||
int wakeup_txfh(PHY_VARS_gNB *gNB, gNB_L1_rxtx_proc_t *proc, int frame_tx, int slot_tx, uint64_t timestamp_tx);
|
||||
int wakeup_tx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_tx, int slot_tx, uint64_t timestamp_tx);
|
||||
#include "executables/thread-common.h"
|
||||
//extern PARALLEL_CONF_t get_thread_parallel_conf(void);
|
||||
//extern WORKER_CONF_t get_thread_worker_conf(void);
|
||||
|
||||
|
||||
void wakeup_prach_gNB(PHY_VARS_gNB *gNB,RU_t *ru,int frame,int subframe);
|
||||
void wakeup_prach_gNB(PHY_VARS_gNB *gNB, RU_t *ru, int frame, int subframe);
|
||||
|
||||
extern uint8_t nfapi_mode;
|
||||
extern void oai_subframe_ind(uint16_t sfn, uint16_t sf);
|
||||
@@ -149,7 +150,7 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
|
||||
#define TICK_TO_US(ts) (ts.trials==0?0:ts.diff/ts.trials)
|
||||
|
||||
|
||||
static inline int rxtx(PHY_VARS_gNB *gNB,int frame_rx, int slot_rx, int frame_tx, int slot_tx, char *thread_name) {
|
||||
static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_tx, int slot_tx, char *thread_name) {
|
||||
start_meas(&softmodem_stats_rxtx_sf);
|
||||
|
||||
// *******************************************************************
|
||||
@@ -184,17 +185,20 @@ static inline int rxtx(PHY_VARS_gNB *gNB,int frame_rx, int slot_rx, int frame_tx
|
||||
// ****************************************
|
||||
// Common RX procedures subframe n
|
||||
T(T_GNB_PHY_DL_TICK, T_INT(gNB->Mod_id), T_INT(frame_tx), T_INT(slot_tx));
|
||||
/*
|
||||
// if this is IF5 or 3GPP_gNB
|
||||
if (gNB && gNB->RU_list && gNB->RU_list[0] && gNB->RU_list[0]->function < NGFI_RAU_IF4p5) {
|
||||
wakeup_prach_gNB(gNB,NULL,proc->frame_rx,proc->slot_rx);
|
||||
}
|
||||
/*
|
||||
// if this is IF5 or 3GPP_gNB
|
||||
if (gNB && gNB->RU_list && gNB->RU_list[0] && gNB->RU_list[0]->function < NGFI_RAU_IF4p5) {
|
||||
wakeup_prach_gNB(gNB,NULL,proc->frame_rx,proc->slot_rx);
|
||||
}
|
||||
|
||||
// UE-specific RX processing for subframe n
|
||||
if (nfapi_mode == 0 || nfapi_mode == 1) */
|
||||
|
||||
if (slot_rx == NR_UPLINK_SLOT || gNB->frame_parms.frame_type == FDD) {
|
||||
nfapi_nr_ul_config_ulsch_pdu_rel15_t *ulsch_pdu_rel15 = &gNB->ulsch[1][0]->harq_processes[0]->ulsch_pdu.ulsch_pdu_rel15;
|
||||
phy_procedures_gNB_uespec_RX(gNB, frame_rx, slot_rx, ulsch_pdu_rel15->start_symbol, ulsch_pdu_rel15->start_symbol + ulsch_pdu_rel15->number_symbols);
|
||||
}
|
||||
|
||||
// UE-specific RX processing for subframe n
|
||||
if (nfapi_mode == 0 || nfapi_mode == 1) {
|
||||
phy_procedures_gNB_uespec_RX(gNB, proc, no_relay );
|
||||
}
|
||||
*/
|
||||
pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||
gNB->UL_INFO.frame = frame_rx;
|
||||
gNB->UL_INFO.slot = slot_rx;
|
||||
|
||||
+80
-62
@@ -114,27 +114,22 @@ static int DEFENBS[] = {0};
|
||||
#include "T.h"
|
||||
#include "nfapi_interface.h"
|
||||
|
||||
extern volatile int oai_exit;
|
||||
extern volatile int oai_exit;
|
||||
|
||||
|
||||
extern void nr_phy_free_RU(RU_t *);
|
||||
extern void nr_phy_config_request(NR_PHY_Config_t *gNB);
|
||||
|
||||
extern PARALLEL_CONF_t get_thread_parallel_conf(void);
|
||||
extern WORKER_CONF_t get_thread_worker_conf(void);
|
||||
#include "executables/thread-common.h"
|
||||
//extern PARALLEL_CONF_t get_thread_parallel_conf(void);
|
||||
//extern WORKER_CONF_t get_thread_worker_conf(void);
|
||||
|
||||
void init_NR_RU(char *);
|
||||
void stop_RU(int nb_ru);
|
||||
void do_ru_sync(RU_t *ru);
|
||||
|
||||
void configure_ru(int idx,
|
||||
void *arg);
|
||||
|
||||
void configure_rru(int idx,
|
||||
void *arg);
|
||||
|
||||
void configure_ru(int idx, void *arg);
|
||||
void configure_rru(int idx, void *arg);
|
||||
int attach_rru(RU_t *ru);
|
||||
|
||||
int connect_rau(RU_t *ru);
|
||||
|
||||
extern uint16_t sl_ahead;
|
||||
@@ -659,6 +654,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
|
||||
ru->nb_rx);
|
||||
}
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
|
||||
proc->timestamp_rx = ts-ru->ts_offset;
|
||||
|
||||
@@ -730,12 +726,18 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
int i;
|
||||
T(T_ENB_PHY_OUTPUT_SIGNAL, T_INT(0), T_INT(0), T_INT(frame), T_INT(slot),
|
||||
T_INT(0), T_BUFFER(&ru->common.txdata[0][slot * fp->samples_per_slot], fp->samples_per_slot * 4));
|
||||
nr_subframe_t SF_type = nr_slot_select(cfg,slot%fp->slots_per_frame);
|
||||
int sf_extension = 0;
|
||||
nr_subframe_t SF_type = nr_slot_select(cfg,slot%fp->slots_per_frame);
|
||||
|
||||
if ((slot == 0) ||
|
||||
(slot == 1)) {
|
||||
int siglen=fp->samples_per_slot;
|
||||
int flags;
|
||||
if (slot==0)
|
||||
flags = 2;
|
||||
else if (slot==1)
|
||||
flags=3;
|
||||
|
||||
if ((SF_type == SF_DL) ||
|
||||
(SF_type == SF_S)) {
|
||||
int siglen=fp->samples_per_slot,flags=1;
|
||||
/*
|
||||
if (SF_type == SF_S) {
|
||||
siglen = fp->dl_symbols_in_S_subframe*(fp->ofdm_symbol_size+fp->nb_prefix_samples0);
|
||||
@@ -774,7 +776,7 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, subframe %d\n",ru->idx,
|
||||
(long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
|
||||
AssertFatal(txs == siglen+sf_extension,"TX : Timeout (sent %d/%d)\n",txs, siglen);
|
||||
AssertFatal(txs == siglen+sf_extension,"TX : Timeout (sent %u/%d)\n", txs, siglen);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1222,12 +1224,12 @@ static void *ru_stats_thread(void *param) {
|
||||
}
|
||||
|
||||
static void *ru_thread_tx( void *param ) {
|
||||
RU_t *ru = (RU_t *)param;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
PHY_VARS_gNB *gNB;
|
||||
gNB_L1_proc_t *gNB_proc;
|
||||
RU_t *ru = (RU_t *)param;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
PHY_VARS_gNB *gNB;
|
||||
gNB_L1_proc_t *gNB_proc;
|
||||
gNB_L1_rxtx_proc_t *L1_proc;
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
char filename[40];
|
||||
int print_frame = 8;
|
||||
int i = 0;
|
||||
@@ -1251,12 +1253,14 @@ static void *ru_thread_tx( void *param ) {
|
||||
// wait until eNBs are finished subframe RX n and TX n+4
|
||||
wait_on_condition(&proc->mutex_gNBs,&proc->cond_gNBs,&proc->instance_cnt_gNBs,"ru_thread_tx");
|
||||
|
||||
AssertFatal((ret=pthread_mutex_lock(&proc->mutex_gNBs))==0,"mutex_lock return %d\n",ret);
|
||||
ret = pthread_mutex_lock(&proc->mutex_gNBs);
|
||||
AssertFatal(ret == 0,"mutex_lock return %d\n",ret);
|
||||
int frame_tx=proc->frame_tx;
|
||||
int tti_tx =proc->tti_tx;
|
||||
uint64_t timestamp_tx = proc->timestamp_tx;
|
||||
|
||||
AssertFatal((ret=pthread_mutex_unlock(&proc->mutex_gNBs))==0,"mutex_lock returns %d\n",ret);
|
||||
ret = pthread_mutex_unlock(&proc->mutex_gNBs);
|
||||
AssertFatal(ret == 0,"mutex_lock returns %d\n",ret);
|
||||
|
||||
if (oai_exit) break;
|
||||
|
||||
@@ -1307,7 +1311,8 @@ static void *ru_thread_tx( void *param ) {
|
||||
gNB = ru->gNB_list[i];
|
||||
gNB_proc = &gNB->proc;
|
||||
L1_proc = (get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT)? &gNB_proc->L1_proc_tx : &gNB_proc->L1_proc;
|
||||
AssertFatal((ret=pthread_mutex_lock(&gNB_proc->mutex_RU_tx))==0,"mutex_lock returns %d\n",ret);
|
||||
ret = pthread_mutex_lock(&gNB_proc->mutex_RU_tx);
|
||||
AssertFatal(ret == 0,"mutex_lock returns %d\n",ret);
|
||||
|
||||
for (int j=0; j<gNB->num_RU; j++) {
|
||||
if (ru == gNB->RU_list[j]) {
|
||||
@@ -1320,12 +1325,15 @@ static void *ru_thread_tx( void *param ) {
|
||||
}
|
||||
|
||||
if (gNB_proc->RU_mask_tx != (1<<gNB->num_RU)-1) { // not all RUs have provided their information so return
|
||||
AssertFatal((ret=pthread_mutex_unlock(&gNB_proc->mutex_RU_tx))==0,"mutex_unlock returns %d\n",ret);
|
||||
ret = pthread_mutex_unlock(&gNB_proc->mutex_RU_tx);
|
||||
AssertFatal(ret == 0,"mutex_unlock returns %d\n",ret);
|
||||
} else { // all RUs TX are finished so send the ready signal to gNB processing
|
||||
gNB_proc->RU_mask_tx = 0;
|
||||
AssertFatal((ret=pthread_mutex_unlock(&gNB_proc->mutex_RU_tx))==0,"mutex_unlock returns %d\n",ret);
|
||||
ret = pthread_mutex_unlock(&gNB_proc->mutex_RU_tx);
|
||||
AssertFatal(ret == 0,"mutex_unlock returns %d\n",ret);
|
||||
|
||||
AssertFatal((ret=pthread_mutex_lock(&L1_proc->mutex_RUs_tx))==0,"mutex_lock returns %d\n",ret);
|
||||
ret = pthread_mutex_lock(&L1_proc->mutex_RUs_tx);
|
||||
AssertFatal(ret == 0,"mutex_lock returns %d\n",ret);
|
||||
// the thread can now be woken up
|
||||
if (L1_proc->instance_cnt_RUs==-1) {
|
||||
AssertFatal(pthread_cond_signal(&L1_proc->cond_RUs) == 0,
|
||||
@@ -1333,8 +1341,8 @@ static void *ru_thread_tx( void *param ) {
|
||||
} //else AssertFatal(1==0,"gNB TX thread is not ready\n");
|
||||
L1_proc->instance_cnt_RUs = 0;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE,L1_proc->instance_cnt_RUs);
|
||||
AssertFatal((ret=pthread_mutex_unlock(&L1_proc->mutex_RUs_tx))==0,"mutex_unlock returns %d\n",ret);
|
||||
|
||||
ret = pthread_mutex_unlock(&L1_proc->mutex_RUs_tx);
|
||||
AssertFatal(ret == 0,"mutex_unlock returns %d\n",ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1347,13 +1355,15 @@ static void *ru_thread( void *param ) {
|
||||
static int ru_thread_status;
|
||||
RU_t *ru = (RU_t *)param;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
int ret;
|
||||
int slot = fp->slots_per_frame-1;
|
||||
int frame =1023;
|
||||
char filename[40],threadname[40];
|
||||
int slot = fp->slots_per_frame-1;
|
||||
int frame = 1023;
|
||||
char filename[40], threadname[40];
|
||||
int print_frame = 8;
|
||||
int i = 0;
|
||||
int aa;
|
||||
|
||||
// set default return value
|
||||
ru_thread_status = 0;
|
||||
// set default return value
|
||||
@@ -1385,9 +1395,9 @@ static void *ru_thread( void *param ) {
|
||||
}
|
||||
|
||||
if (ru->if_south == LOCAL_RF) { // configure RF parameters only
|
||||
fill_rf_config(ru,ru->rf_config_file);
|
||||
nr_init_frame_parms(&ru->gNB_list[0]->gNB_config, fp);
|
||||
nr_dump_frame_parms(fp);
|
||||
fill_rf_config(ru,ru->rf_config_file);
|
||||
nr_phy_init_RU(ru);
|
||||
ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
|
||||
AssertFatal(ret==0,"Cannot connect to local radio\n");
|
||||
@@ -1446,6 +1456,7 @@ static void *ru_thread( void *param ) {
|
||||
}
|
||||
|
||||
// synchronization on input FH interface, acquire signals/data and block
|
||||
LOG_D(PHY,"[RU_thread] read data: frame_rx = %d, tti_rx = %d\n", frame, slot);
|
||||
if (ru->fh_south_in) ru->fh_south_in(ru,&frame,&slot);
|
||||
else AssertFatal(1==0, "No fronthaul interface at south port");
|
||||
|
||||
@@ -1470,7 +1481,19 @@ static void *ru_thread( void *param ) {
|
||||
if (ru->idx!=0) proc->frame_tx = (proc->frame_tx+proc->frame_offset)&1023;
|
||||
|
||||
// do RX front-end processing (frequency-shift, dft) if needed
|
||||
if (ru->feprx) ru->feprx(ru,proc->tti_rx);
|
||||
|
||||
if (proc->tti_rx == NR_UPLINK_SLOT || fp->frame_type == FDD) {
|
||||
|
||||
if (ru->feprx) ru->feprx(ru,proc->tti_rx);
|
||||
|
||||
}
|
||||
|
||||
LOG_D(PHY,"RU proc: frame_rx = %d, tti_rx = %d\n", proc->frame_rx, proc->tti_rx);
|
||||
LOG_D(PHY,"Copying rxdataF from RU to gNB\n");
|
||||
|
||||
for (aa=0;aa<ru->nb_rx;aa++)
|
||||
memcpy((void*)RC.gNB[0][0]->common_vars.rxdataF[aa],
|
||||
(void*)ru->common.rxdataF[aa], fp->symbols_per_slot*fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
|
||||
// At this point, all information for subframe has been received on FH interface
|
||||
|
||||
@@ -1620,14 +1643,6 @@ int stop_rf(RU_t *ru) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern void fep_full(RU_t *ru,int slot);
|
||||
extern void ru_fep_full_2thread(RU_t *ru,int slot);
|
||||
extern void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx);
|
||||
extern void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx);
|
||||
extern void feptx_prec(RU_t *ru, int frame_tx,int tti_tx);
|
||||
extern void init_fep_thread(RU_t *ru);
|
||||
extern void nr_init_feptx_thread(RU_t *ru);
|
||||
|
||||
void init_RU_proc(RU_t *ru) {
|
||||
int i=0;
|
||||
RU_proc_t *proc;
|
||||
@@ -1639,7 +1654,7 @@ void init_RU_proc(RU_t *ru) {
|
||||
memset((void *)proc,0,sizeof(RU_proc_t));
|
||||
proc->ru = ru;
|
||||
proc->instance_cnt_prach = -1;
|
||||
proc->instance_cnt_synch = -1; ;
|
||||
proc->instance_cnt_synch = -1;
|
||||
proc->instance_cnt_FH = -1;
|
||||
proc->instance_cnt_FH1 = -1;
|
||||
proc->instance_cnt_gNBs = -1;
|
||||
@@ -1692,7 +1707,7 @@ void init_RU_proc(RU_t *ru) {
|
||||
}
|
||||
|
||||
if (get_thread_worker_conf() == WORKER_ENABLE) {
|
||||
if (ru->feprx) init_fep_thread(ru);
|
||||
if (ru->feprx) nr_init_feprx_thread(ru);
|
||||
|
||||
if (ru->feptx_ofdm) nr_init_feptx_thread(ru);
|
||||
}
|
||||
@@ -1852,8 +1867,8 @@ void configure_ru(int idx,
|
||||
|
||||
if (capabilities->FH_fmt < MAX_FH_FMTs) LOG_I(PHY, "RU FH options %s\n",rru_format_options[capabilities->FH_fmt]);
|
||||
|
||||
AssertFatal((ret=check_capabilities(ru,capabilities)) == 0,
|
||||
"Cannot configure RRU %d, check_capabilities returned %d\n", idx,ret);
|
||||
ret = check_capabilities(ru,capabilities);
|
||||
AssertFatal(ret == 0, "Cannot configure RRU %d, check_capabilities returned %d\n", idx, ret);
|
||||
// take antenna capabilities of RRU
|
||||
ru->nb_tx = capabilities->nb_tx[0];
|
||||
ru->nb_rx = capabilities->nb_rx[0];
|
||||
@@ -1985,8 +2000,8 @@ void set_function_spec_param(RU_t *ru) {
|
||||
ru->fh_north_out = fh_if4p5_north_out; // send_IF4p5 on reception
|
||||
ru->fh_south_out = tx_rf; // send output to RF
|
||||
ru->fh_north_asynch_in = fh_if4p5_north_asynch_in; // TX packets come asynchronously
|
||||
ru->feprx = (get_thread_worker_conf() == WORKER_ENABLE) ? ru_fep_full_2thread : fep_full; // RX DFTs
|
||||
ru->feptx_ofdm = (get_thread_worker_conf() == WORKER_ENABLE) ? nr_feptx_ofdm_2thread : nr_feptx_ofdm; // this is fep with idft only (no precoding in RRU)
|
||||
ru->feprx = (get_thread_worker_conf() == WORKER_ENABLE) ? nr_fep_full_2thread : nr_fep_full; // RX DFTs
|
||||
ru->feptx_ofdm = (get_thread_worker_conf() == WORKER_ENABLE) ? nr_feptx_ofdm_2thread : nr_feptx_ofdm; // this is fep with idft only (no precoding in RRU)
|
||||
ru->feptx_prec = NULL;
|
||||
ru->nr_start_if = nr_start_if; // need to start the if interface for if4p5
|
||||
ru->ifdevice.host_type = RRU_HOST;
|
||||
@@ -2007,8 +2022,8 @@ void set_function_spec_param(RU_t *ru) {
|
||||
malloc_IF4p5_buffer(ru);
|
||||
} else if (ru->function == gNodeB_3GPP) {
|
||||
ru->do_prach = 0; // no prach processing in RU
|
||||
ru->feprx = (get_thread_worker_conf() == WORKER_ENABLE) ? ru_fep_full_2thread : fep_full; // RX DFTs
|
||||
ru->feptx_ofdm = (get_thread_worker_conf() == WORKER_ENABLE) ? nr_feptx_ofdm_2thread : nr_feptx_ofdm; // this is fep with idft and precoding
|
||||
ru->feprx = (get_thread_worker_conf() == WORKER_ENABLE) ? nr_fep_full_2thread : nr_fep_full; // RX DFTs
|
||||
ru->feptx_ofdm = (get_thread_worker_conf() == WORKER_ENABLE) ? nr_feptx_ofdm_2thread : nr_feptx_ofdm; // this is fep with idft and precoding
|
||||
ru->feptx_prec = NULL; // this is fep with idft and precoding
|
||||
ru->fh_north_in = NULL; // no incoming fronthaul from north
|
||||
ru->fh_north_out = NULL; // no outgoing fronthaul to north
|
||||
@@ -2037,13 +2052,13 @@ void set_function_spec_param(RU_t *ru) {
|
||||
|
||||
case REMOTE_IF5: // the remote unit is IF5 RRU
|
||||
ru->do_prach = 0;
|
||||
ru->feprx = fep_full; // this is frequency-shift + DFTs
|
||||
ru->feptx_prec = feptx_prec; // need to do transmit Precoding + IDFTs
|
||||
ru->feptx_ofdm = (get_thread_worker_conf() == WORKER_ENABLE) ? nr_feptx_ofdm_2thread : nr_feptx_ofdm; // need to do transmit Precoding + IDFTs
|
||||
ru->fh_south_in = fh_if5_south_in; // synchronous IF5 reception
|
||||
ru->fh_south_out = fh_if5_south_out; // synchronous IF5 transmission
|
||||
ru->fh_south_asynch_in = NULL; // no asynchronous UL
|
||||
ru->start_rf = NULL; // no local RF
|
||||
ru->feprx = (get_thread_worker_conf() == WORKER_ENABLE) ? nr_fep_full_2thread : nr_fep_full; // this is frequency-shift + DFTs
|
||||
ru->feptx_prec = feptx_prec; // need to do transmit Precoding + IDFTs
|
||||
ru->feptx_ofdm = (get_thread_worker_conf() == WORKER_ENABLE) ? nr_feptx_ofdm_2thread : nr_feptx_ofdm; // need to do transmit Precoding + IDFTs
|
||||
ru->fh_south_in = fh_if5_south_in; // synchronous IF5 reception
|
||||
ru->fh_south_out = fh_if5_south_out; // synchronous IF5 transmission
|
||||
ru->fh_south_asynch_in = NULL; // no asynchronous UL
|
||||
ru->start_rf = NULL; // no local RF
|
||||
ru->stop_rf = NULL;
|
||||
ru->nr_start_if = nr_start_if; // need to start if interface for IF5
|
||||
ru->ifdevice.host_type = RAU_HOST;
|
||||
@@ -2098,6 +2113,7 @@ void init_NR_RU(char *rf_config_file)
|
||||
{
|
||||
int ru_id;
|
||||
RU_t *ru;
|
||||
PHY_VARS_gNB *gNB_RC;
|
||||
PHY_VARS_gNB *gNB0= (PHY_VARS_gNB *)NULL;
|
||||
NR_DL_FRAME_PARMS *fp = (NR_DL_FRAME_PARMS *)NULL;
|
||||
int i;
|
||||
@@ -2141,6 +2157,7 @@ void init_NR_RU(char *rf_config_file)
|
||||
}
|
||||
}
|
||||
|
||||
gNB_RC = RC.gNB[0][0];
|
||||
gNB0 = ru->gNB_list[0];
|
||||
fp = ru->nr_frame_parms;
|
||||
LOG_D(PHY, "RU FUnction:%d ru->if_south:%d\n", ru->function, ru->if_south);
|
||||
@@ -2149,10 +2166,11 @@ void init_NR_RU(char *rf_config_file)
|
||||
if ((ru->function != NGFI_RRU_IF5) && (ru->function != NGFI_RRU_IF4p5))
|
||||
AssertFatal(gNB0!=NULL,"gNB0 is null!\n");
|
||||
|
||||
if (gNB0) {
|
||||
LOG_I(PHY,"Copying frame parms from gNB %d to ru %d\n",gNB0->Mod_id,ru->idx);
|
||||
memcpy((void *)fp,(void *)&gNB0->frame_parms,sizeof(NR_DL_FRAME_PARMS));
|
||||
memset((void *)ru->frame_parms, 0, sizeof(LTE_DL_FRAME_PARMS));
|
||||
if (gNB0 && gNB_RC) {
|
||||
LOG_I(PHY,"Copying frame parms from gNB in RC to gNB %d in ru %d and frame_parms in ru\n",gNB0->Mod_id,ru->idx);
|
||||
memset((void *)fp, 0, sizeof(NR_DL_FRAME_PARMS));
|
||||
memcpy((void *)fp,&gNB_RC->frame_parms,sizeof(NR_DL_FRAME_PARMS));
|
||||
memcpy((void *)&gNB0->frame_parms,(void *)&gNB_RC->frame_parms,sizeof(NR_DL_FRAME_PARMS));
|
||||
// attach all RU to all gNBs in its list/
|
||||
LOG_D(PHY,"ru->num_gNB:%d gNB0->num_RU:%d\n", ru->num_gNB, gNB0->num_RU);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef NR_SOFTMODEM_COMMON_H
|
||||
#define NR_SOFTMODEM_COMMON_H
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
@@ -98,6 +98,8 @@
|
||||
#define CONFIG_HLP_TELN "Start embedded telnet server \n"
|
||||
#define CONFIG_HLP_MSC "Enable the MSC tracing utility \n"
|
||||
#define CONFIG_HLP_SNR "Set average SNR in dB (for --siml1 option)\n"
|
||||
#define CONFIG_HLP_NOS1 "Disable s1 interface\n"
|
||||
#define CONFIG_HLP_NOKRNMOD "(noS1 only): Use tun instead of namesh module \n"
|
||||
/*--------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* command line parameters for LOG utility */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
|
||||
+35
-38
@@ -83,6 +83,8 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#include "PHY/TOOLS/nr_phy_scope.h"
|
||||
#include "stats.h"
|
||||
#include "nr-softmodem.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "executables/thread-common.h"
|
||||
#include "NB_IoT_interface.h"
|
||||
|
||||
short nr_mod_table[NR_MOD_TABLE_SIZE_SHORT] = {0,0,16384,16384,-16384,-16384,16384,16384,16384,-16384,-16384,16384,-16384,-16384,7327,7327,7327,21981,21981,7327,21981,21981,7327,-7327,7327,-21981,21981,-7327,21981,-21981,-7327,7327,-7327,21981,-21981,7327,-21981,21981,-7327,-7327,-7327,-21981,-21981,-7327,-21981,-21981,10726,10726,10726,3576,3576,10726,3576,3576,10726,17876,10726,25027,3576,17876,3576,25027,17876,10726,17876,3576,25027,10726,25027,3576,17876,17876,17876,25027,25027,17876,25027,25027,10726,-10726,10726,-3576,3576,-10726,3576,-3576,10726,-17876,10726,-25027,3576,-17876,3576,-25027,17876,-10726,17876,-3576,25027,-10726,25027,-3576,17876,-17876,17876,-25027,25027,-17876,25027,-25027,-10726,10726,-10726,3576,-3576,10726,-3576,3576,-10726,17876,-10726,25027,-3576,17876,-3576,25027,-17876,10726,-17876,3576,-25027,10726,-25027,3576,-17876,17876,-17876,25027,-25027,17876,-25027,25027,-10726,-10726,-10726,-3576,-3576,-10726,-3576,-3576,-10726,-17876,-10726,-25027,-3576,-17876,-3576,-25027,-17876,-10726,-17876,-3576,-25027,-10726,-25027,-3576,-17876,-17876,-17876,-25027,-25027,-17876,-25027,-25027,8886,8886,8886,12439,12439,8886,12439,12439,8886,5332,8886,1778,12439,5332,12439,1778,5332,8886,5332,12439,1778,8886,1778,12439,5332,5332,5332,1778,1778,5332,1778,1778,8886,19547,8886,15993,12439,19547,12439,15993,8886,23101,8886,26655,12439,23101,12439,26655,5332,19547,5332,15993,1778,19547,1778,15993,5332,23101,5332,26655,1778,23101,1778,26655,19547,8886,19547,12439,15993,8886,15993,12439,19547,5332,19547,1778,15993,5332,15993,1778,23101,8886,23101,12439,26655,8886,26655,12439,23101,5332,23101,1778,26655,5332,26655,1778,19547,19547,19547,15993,15993,19547,15993,15993,19547,23101,19547,26655,15993,23101,15993,26655,23101,19547,23101,15993,26655,19547,26655,15993,23101,23101,23101,26655,26655,23101,26655,26655,8886,-8886,8886,-12439,12439,-8886,12439,-12439,8886,-5332,8886,-1778,12439,-5332,12439,-1778,5332,-8886,5332,-12439,1778,-8886,1778,-12439,5332,-5332,5332,-1778,1778,-5332,1778,-1778,8886,-19547,8886,-15993,12439,-19547,12439,-15993,8886,-23101,8886,-26655,12439,-23101,12439,-26655,5332,-19547,5332,-15993,1778,-19547,1778,-15993,5332,-23101,5332,-26655,1778,-23101,1778,-26655,19547,-8886,19547,-12439,15993,-8886,15993,-12439,19547,-5332,19547,-1778,15993,-5332,15993,-1778,23101,-8886,23101,-12439,26655,-8886,26655,-12439,23101,-5332,23101,-1778,26655,-5332,26655,-1778,19547,-19547,19547,-15993,15993,-19547,15993,-15993,19547,-23101,19547,-26655,15993,-23101,15993,-26655,23101,-19547,23101,-15993,26655,-19547,26655,-15993,23101,-23101,23101,-26655,26655,-23101,26655,-26655,-8886,8886,-8886,12439,-12439,8886,-12439,12439,-8886,5332,-8886,1778,-12439,5332,-12439,1778,-5332,8886,-5332,12439,-1778,8886,-1778,12439,-5332,5332,-5332,1778,-1778,5332,-1778,1778,-8886,19547,-8886,15993,-12439,19547,-12439,15993,-8886,23101,-8886,26655,-12439,23101,-12439,26655,-5332,19547,-5332,15993,-1778,19547,-1778,15993,-5332,23101,-5332,26655,-1778,23101,-1778,26655,-19547,8886,-19547,12439,-15993,8886,-15993,12439,-19547,5332,-19547,1778,-15993,5332,-15993,1778,-23101,8886,-23101,12439,-26655,8886,-26655,12439,-23101,5332,-23101,1778,-26655,5332,-26655,1778,-19547,19547,-19547,15993,-15993,19547,-15993,15993,-19547,23101,-19547,26655,-15993,23101,-15993,26655,-23101,19547,-23101,15993,-26655,19547,-26655,15993,-23101,23101,-23101,26655,-26655,23101,-26655,26655,-8886,-8886,-8886,-12439,-12439,-8886,-12439,-12439,-8886,-5332,-8886,-1778,-12439,-5332,-12439,-1778,-5332,-8886,-5332,-12439,-1778,-8886,-1778,-12439,-5332,-5332,-5332,-1778,-1778,-5332,-1778,-1778,-8886,-19547,-8886,-15993,-12439,-19547,-12439,-15993,-8886,-23101,-8886,-26655,-12439,-23101,-12439,-26655,-5332,-19547,-5332,-15993,-1778,-19547,-1778,-15993,-5332,-23101,-5332,-26655,-1778,-23101,-1778,-26655,-19547,-8886,-19547,-12439,-15993,-8886,-15993,-12439,-19547,-5332,-19547,-1778,-15993,-5332,-15993,-1778,-23101,-8886,-23101,-12439,-26655,-8886,-26655,-12439,-23101,-5332,-23101,-1778,-26655,-5332,-26655,-1778,-19547,-19547,-19547,-15993,-15993,-19547,-15993,-15993,-19547,-23101,-19547,-26655,-15993,-23101,-15993,-26655,-23101,-19547,-23101,-15993,-26655,-19547,-26655,-15993,-23101,-23101,-23101,-26655,-26655,-23101,-26655,-26655};
|
||||
@@ -167,7 +169,7 @@ int rx_input_level_dBm;
|
||||
uint32_t do_forms=0;
|
||||
int otg_enabled;
|
||||
|
||||
//int number_of_cards = 1;
|
||||
//int number_of_cards = 1;
|
||||
|
||||
|
||||
//static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
|
||||
@@ -188,46 +190,10 @@ int transmission_mode=1;
|
||||
int emulate_rf = 0;
|
||||
int numerology = 0;
|
||||
|
||||
typedef struct {
|
||||
uint64_t optmask;
|
||||
THREAD_STRUCT thread_struct;
|
||||
char rf_config_file[1024];
|
||||
int phy_test;
|
||||
uint8_t usim_test;
|
||||
int emulate_rf;
|
||||
int wait_for_sync; //eNodeB only
|
||||
int single_thread_flag; //eNodeB only
|
||||
int chain_offset;
|
||||
int numerology;
|
||||
unsigned int start_msc;
|
||||
uint32_t clock_source;
|
||||
int hw_timing_advance;
|
||||
} softmodem_params_t;
|
||||
static softmodem_params_t softmodem_params;
|
||||
|
||||
static char *parallel_config = NULL;
|
||||
static char *worker_config = NULL;
|
||||
static THREAD_STRUCT thread_struct;
|
||||
|
||||
void set_parallel_conf(char *parallel_conf) {
|
||||
if(strcmp(parallel_conf,"PARALLEL_SINGLE_THREAD")==0) thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
|
||||
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_SPLIT;
|
||||
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_TRX_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_TRX_SPLIT;
|
||||
|
||||
printf("[CONFIG] parallel conf is set to %d\n",thread_struct.parallel_conf);
|
||||
}
|
||||
void set_worker_conf(char *worker_conf) {
|
||||
if(strcmp(worker_conf,"WORKER_DISABLE")==0) thread_struct.worker_conf = WORKER_DISABLE;
|
||||
else if(strcmp(worker_conf,"WORKER_ENABLE")==0) thread_struct.worker_conf = WORKER_ENABLE;
|
||||
|
||||
printf("[CONFIG] worker conf is set to %d\n",thread_struct.worker_conf);
|
||||
}
|
||||
PARALLEL_CONF_t get_thread_parallel_conf(void) {
|
||||
return thread_struct.parallel_conf;
|
||||
}
|
||||
WORKER_CONF_t get_thread_worker_conf(void) {
|
||||
return thread_struct.worker_conf;
|
||||
}
|
||||
|
||||
/* struct for ethernet specific parameters given in eNB conf file */
|
||||
eth_params_t *eth_params;
|
||||
@@ -507,7 +473,9 @@ static void get_options(void) {
|
||||
int tddflag, nonbiotflag;
|
||||
uint32_t online_log_messages;
|
||||
uint32_t glog_level, glog_verbosity;
|
||||
uint32_t start_telnetsrv;
|
||||
uint32_t start_telnetsrv = 0;
|
||||
uint32_t noS1;
|
||||
uint32_t nokrnmod;
|
||||
paramdef_t cmdline_params[] = CMDLINE_PARAMS_DESC_GNB ;
|
||||
paramdef_t cmdline_logparams[] = CMDLINE_LOGPARAMS_DESC_NR ;
|
||||
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
|
||||
@@ -545,6 +513,7 @@ static void get_options(void) {
|
||||
if(parallel_config != NULL) set_parallel_conf(parallel_config);
|
||||
|
||||
if(worker_config != NULL) set_worker_conf(worker_config);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -865,6 +834,30 @@ static void wait_nfapi_init(char *thread_name) {
|
||||
printf( "NFAPI: got sync (%s)\n", thread_name);
|
||||
}
|
||||
|
||||
void init_pdcp(void) {
|
||||
//if (!NODE_IS_DU(RC.rrc[0]->node_type)) {
|
||||
pdcp_layer_init();
|
||||
uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
|
||||
(PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
|
||||
|
||||
if (IS_SOFTMODEM_NOS1){
|
||||
printf("IS_SOFTMODEM_NOS1 option enabled \n");
|
||||
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT ;
|
||||
}
|
||||
|
||||
pdcp_module_init(pdcp_initmask);
|
||||
|
||||
/*if (NODE_IS_CU(RC.rrc[0]->node_type)) {
|
||||
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req);
|
||||
} else {*/
|
||||
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
|
||||
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
|
||||
//}
|
||||
/*} else {
|
||||
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) proto_agent_send_pdcp_data_ind);
|
||||
}*/
|
||||
}
|
||||
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
int i, ru_id, CC_id = 0;
|
||||
@@ -886,6 +879,7 @@ int main( int argc, char **argv )
|
||||
configure_linux();
|
||||
printf("Reading in command-line options\n");
|
||||
get_options ();
|
||||
get_common_options();
|
||||
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) {
|
||||
fprintf(stderr,"Getting configuration failed\n");
|
||||
@@ -948,6 +942,9 @@ init_opt();
|
||||
flexran_agent_start(i);
|
||||
}
|
||||
|
||||
if(IS_SOFTMODEM_NOS1)
|
||||
init_pdcp();
|
||||
|
||||
// init UE_PF_PO and mutex lock
|
||||
pthread_mutex_init(&ue_pf_po_mutex, NULL);
|
||||
memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*NUMBER_OF_UE_MAX*MAX_NUM_CCs);
|
||||
|
||||
+15
-10
@@ -5,18 +5,18 @@
|
||||
|
||||
#include "flexran_agent.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "proto_agent.h"
|
||||
|
||||
#define DEFAULT_DLF 2680000000
|
||||
|
||||
|
||||
/***************************************************************************************************************************************/
|
||||
/* command line options definitions, CMDLINE_XXXX_DESC macros are used to initialize paramdef_t arrays which are then used as argument
|
||||
when calling config_get or config_getlist functions */
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* command line parameters common to eNodeB and UE */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* command line parameters common to eNodeB and UE */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define CMDLINE_PARAMS_DESC_GNB { \
|
||||
{"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&rf_config_file, defstrval:NULL, TYPE_STRING, sizeof(rf_config_file)},\
|
||||
{"ulsch-max-errors", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \
|
||||
@@ -42,14 +42,19 @@
|
||||
{"parallel-config", CONFIG_HLP_PARALLEL_CMD,0, strptr:(char **)¶llel_config, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \
|
||||
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0} \
|
||||
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"noS1", CONFIG_HLP_NOS1, PARAMFLAG_BOOL, uptr:&noS1, defintval:0, TYPE_INT, 0}, \
|
||||
{"nokrnmod", CONFIG_HLP_NOKRNMOD, PARAMFLAG_BOOL, uptr:&nokrnmod, defintval:0, TYPE_INT, 0} \
|
||||
}
|
||||
|
||||
#define SOFTMODEM_NOS1_BIT (1<<0)
|
||||
#define SOFTMODEM_NOKRNMOD_BIT (1<<1)
|
||||
|
||||
typedef struct {
|
||||
int *argc;
|
||||
char **argv;
|
||||
} scopeParms_t;
|
||||
#define IS_SOFTMODEM_NOS1 ( get_softmodem_optmask() & SOFTMODEM_NOS1_BIT)
|
||||
#define IS_SOFTMODEM_NOKRNMOD ( get_softmodem_optmask() & SOFTMODEM_NOKRNMOD_BIT)
|
||||
|
||||
extern uint64_t get_softmodem_optmask(void);
|
||||
extern void get_common_options(void);
|
||||
|
||||
extern int T_port;
|
||||
extern int T_nowait;
|
||||
|
||||
+59
-7
@@ -45,6 +45,7 @@
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/system.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "executables/nr-softmodem.h"
|
||||
|
||||
#include "T.h"
|
||||
|
||||
@@ -141,8 +142,10 @@ PHY_VARS_NR_UE *init_nr_ue_vars(NR_DL_FRAME_PARMS *frame_parms,
|
||||
ue = (PHY_VARS_NR_UE *)malloc(sizeof(PHY_VARS_NR_UE));
|
||||
memset(ue,0,sizeof(PHY_VARS_NR_UE));
|
||||
memcpy(&(ue->frame_parms), frame_parms, sizeof(NR_DL_FRAME_PARMS));
|
||||
|
||||
ue->Mod_id = UE_id;
|
||||
ue->mac_enabled = 1;
|
||||
|
||||
// initialize all signal buffers
|
||||
init_nr_ue_signal(ue,1,abstraction_flag);
|
||||
// intialize transport
|
||||
@@ -353,6 +356,9 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
|
||||
|
||||
nr_dcireq_t dcireq;
|
||||
nr_scheduled_response_t scheduled_response;
|
||||
uint32_t nb_rb, start_rb;
|
||||
uint8_t nb_symb_sch, start_symbol, mcs, precod_nbr_layers, harq_pid, rvidx;
|
||||
uint16_t n_rnti;
|
||||
|
||||
// Process Rx data for one sub-frame
|
||||
if (slot_select_nr(&UE->frame_parms, proc->frame_tx, proc->nr_tti_tx) & NR_DOWNLINK_SLOT) {
|
||||
@@ -365,12 +371,38 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
|
||||
nr_ue_dcireq(&dcireq); //to be replaced with function pointer later
|
||||
|
||||
scheduled_response.dl_config = &dcireq.dl_config_req;
|
||||
scheduled_response.ul_config = NULL;
|
||||
scheduled_response.ul_config = &dcireq.ul_config_req;
|
||||
scheduled_response.tx_request = NULL;
|
||||
scheduled_response.module_id = UE->Mod_id;
|
||||
scheduled_response.CC_id = 0;
|
||||
scheduled_response.frame = proc->frame_rx;
|
||||
scheduled_response.slot = proc->nr_tti_rx;
|
||||
|
||||
//--------------------------Temporary configuration-----------------------------//
|
||||
n_rnti = 0x1234;
|
||||
nb_rb = 50;
|
||||
start_rb = 0;
|
||||
nb_symb_sch = 12;
|
||||
start_symbol = 2;
|
||||
precod_nbr_layers = 1;
|
||||
mcs = 9;
|
||||
harq_pid = 0;
|
||||
rvidx = 0;
|
||||
//------------------------------------------------------------------------------//
|
||||
|
||||
scheduled_response.ul_config->sfn_slot = NR_UPLINK_SLOT;
|
||||
scheduled_response.ul_config->number_pdus = 1;
|
||||
scheduled_response.ul_config->ul_config_list[0].pdu_type = FAPI_NR_UL_CONFIG_TYPE_PUSCH;
|
||||
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.rnti = n_rnti;
|
||||
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.number_rbs = nb_rb;
|
||||
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.start_rb = start_rb;
|
||||
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.number_symbols = nb_symb_sch;
|
||||
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.start_symbol = start_symbol;
|
||||
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.mcs = mcs;
|
||||
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.ndi = 0;
|
||||
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.rv = rvidx;
|
||||
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.n_layers = precod_nbr_layers;
|
||||
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.harq_process_nbr = harq_pid;
|
||||
nr_ue_scheduled_response(&scheduled_response);
|
||||
|
||||
#ifdef UE_SLOT_PARALLELISATION
|
||||
@@ -381,6 +413,15 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
|
||||
LOG_D(PHY,"phy_procedures_nrUE_RX: slot:%d, time %lu\n", proc->nr_tti_rx, (rdtsc()-a)/3500);
|
||||
//printf(">>> nr_ue_pdcch_procedures ended\n");
|
||||
#endif
|
||||
if(IS_SOFTMODEM_NOS1){ //&& proc->nr_tti_rx==1
|
||||
//Hardcoded rnti value
|
||||
protocol_ctxt_t ctxt;
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE->Mod_id, ENB_FLAG_NO,
|
||||
0x1234, proc->frame_rx,
|
||||
proc->nr_tti_rx, 0);
|
||||
//pdcp_run(&ctxt);
|
||||
pdcp_fifo_flush_sdus(&ctxt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -415,13 +456,14 @@ typedef struct processingData_s {
|
||||
} processingData_t;
|
||||
|
||||
void UE_processing(void *arg) {
|
||||
uint8_t thread_id;
|
||||
processingData_t *rxtxD=(processingData_t *) arg;
|
||||
UE_nr_rxtx_proc_t *proc = &rxtxD->proc;
|
||||
PHY_VARS_NR_UE *UE = rxtxD->UE;
|
||||
processSlotRX(UE, proc);
|
||||
//printf(">>> mac ended\n");
|
||||
// Prepare the future Tx data
|
||||
#if 0
|
||||
/*
|
||||
#ifndef NO_RAT_NR
|
||||
|
||||
if (slot_select_nr(&UE->frame_parms, proc->frame_tx, proc->nr_tti_tx) & NR_UPLINK_SLOT)
|
||||
@@ -429,11 +471,21 @@ void UE_processing(void *arg) {
|
||||
if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_UL) ||
|
||||
(UE->frame_parms.frame_type == FDD) )
|
||||
#endif
|
||||
*/
|
||||
|
||||
|
||||
if (proc->nr_tti_tx == NR_UPLINK_SLOT || UE->frame_parms.frame_type == FDD){
|
||||
|
||||
thread_id = PHY_vars_UE_g[UE->Mod_id][0]->current_thread_id[proc->nr_tti_tx];
|
||||
|
||||
|
||||
if (UE->mode != loop_through_memory)
|
||||
phy_procedures_nrUE_TX(UE,proc,0,0,UE->mode,no_relay);
|
||||
phy_procedures_nrUE_TX(UE,proc,0,thread_id);
|
||||
|
||||
}
|
||||
|
||||
//phy_procedures_UE_TX(UE,proc,0,0,UE->mode,no_relay);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
|
||||
if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_S) &&
|
||||
@@ -657,7 +709,7 @@ void *UE_thread(void *arg) {
|
||||
slot_nr*UE->frame_parms.samples_per_slot];
|
||||
|
||||
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
|
||||
txp[i] = (void *)&UE->common_vars.txdata[i][curMsg->proc.nr_tti_tx*UE->frame_parms.samples_per_slot];
|
||||
txp[i] = (void *)&UE->common_vars.txdata[i][((curMsg->proc.nr_tti_rx + DURATION_RX_TO_TX)%nb_slot_frame)*UE->frame_parms.samples_per_slot];
|
||||
|
||||
int readBlockSize, writeBlockSize;
|
||||
|
||||
@@ -683,7 +735,7 @@ void *UE_thread(void *arg) {
|
||||
AssertFatal( writeBlockSize ==
|
||||
UE->rfdevice.trx_write_func(&UE->rfdevice,
|
||||
timestamp+
|
||||
(2*UE->frame_parms.samples_per_slot) -
|
||||
(DURATION_RX_TO_TX*UE->frame_parms.samples_per_slot) -
|
||||
UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0 -
|
||||
openair0_cfg[0].tx_sample_advance,
|
||||
txp,
|
||||
@@ -734,7 +786,7 @@ void *UE_thread(void *arg) {
|
||||
msgToPush->key=slot_nr;
|
||||
pushTpool(Tpool, msgToPush);
|
||||
|
||||
if (getenv("RFSIMULATOR")) {
|
||||
if (getenv("RFSIMULATOR") || IS_SOFTMODEM_NOS1) { //getenv("RFSIMULATOR")
|
||||
// FixMe: Wait previous thread is done, because race conditions seems too bad
|
||||
// in case of actual RF board, the overlap between threads mitigate the issue
|
||||
// We must receive one message, that proves the slot processing is done
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "common/config/config_userapi.h"
|
||||
//#include "common/utils/threadPool/thread-pool.h"
|
||||
#include "common/utils/load_module_shlib.h"
|
||||
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
|
||||
@@ -77,9 +78,11 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
|
||||
#include <forms.h>
|
||||
|
||||
|
||||
/* Callbacks, globals and object handlers */
|
||||
|
||||
extern void reset_stats( FL_OBJECT *, long );
|
||||
//extern void initTpool(char *params,tpool_t *pool, bool performanceMeas);
|
||||
|
||||
/* Forms and Objects */
|
||||
|
||||
@@ -102,9 +105,11 @@ FD_phy_scope_nrue *form_nrue[NUMBER_OF_UE_MAX];
|
||||
//FD_lte_phy_scope_enb *form_enb[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||
//FD_stats_form *form_stats=NULL,*form_stats_l2=NULL;
|
||||
char title[255];
|
||||
static pthread_t forms_thread; //xforms
|
||||
static pthread_t forms_thread; //xforms
|
||||
|
||||
#include <executables/nr-uesoftmodem.h>
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "executables/thread-common.h"
|
||||
|
||||
RAN_CONTEXT_t RC;
|
||||
volatile int start_eNB = 0;
|
||||
@@ -147,7 +152,7 @@ double bw = 10.0e6;
|
||||
|
||||
static int tx_max_power[MAX_NUM_CCs] = {0};
|
||||
|
||||
char rf_config_file[1024];
|
||||
char rf_config_file[1024];
|
||||
|
||||
int chain_offset=0;
|
||||
int phy_test = 0;
|
||||
@@ -162,53 +167,18 @@ uint8_t nb_antenna_rx = 1;
|
||||
char ref[128] = "internal";
|
||||
char channels[128] = "0";
|
||||
|
||||
typedef struct {
|
||||
uint64_t optmask;
|
||||
THREAD_STRUCT thread_struct;
|
||||
char rf_config_file[1024];
|
||||
int phy_test;
|
||||
uint8_t usim_test;
|
||||
int emulate_rf;
|
||||
int wait_for_sync; //eNodeB only
|
||||
int single_thread_flag; //eNodeB only
|
||||
int chain_offset;
|
||||
int numerology;
|
||||
unsigned int start_msc;
|
||||
uint32_t clock_source;
|
||||
int hw_timing_advance;
|
||||
} softmodem_params_t;
|
||||
static softmodem_params_t softmodem_params;
|
||||
|
||||
static char *parallel_config = NULL;
|
||||
static char *worker_config = NULL;
|
||||
static THREAD_STRUCT thread_struct;
|
||||
|
||||
void set_parallel_conf(char *parallel_conf) {
|
||||
if(strcmp(parallel_conf,"PARALLEL_SINGLE_THREAD")==0) thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
|
||||
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_SPLIT;
|
||||
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_TRX_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_TRX_SPLIT;
|
||||
|
||||
printf("[CONFIG] parallel conf is set to %d\n",thread_struct.parallel_conf);
|
||||
}
|
||||
void set_worker_conf(char *worker_conf) {
|
||||
if(strcmp(worker_conf,"WORKER_DISABLE")==0) thread_struct.worker_conf = WORKER_DISABLE;
|
||||
else if(strcmp(worker_conf,"WORKER_ENABLE")==0) thread_struct.worker_conf = WORKER_ENABLE;
|
||||
|
||||
printf("[CONFIG] worker conf is set to %d\n",thread_struct.worker_conf);
|
||||
}
|
||||
PARALLEL_CONF_t get_thread_parallel_conf(void) {
|
||||
return thread_struct.parallel_conf;
|
||||
}
|
||||
WORKER_CONF_t get_thread_worker_conf(void) {
|
||||
return thread_struct.worker_conf;
|
||||
}
|
||||
int rx_input_level_dBm;
|
||||
|
||||
//static int online_log_messages=0;
|
||||
|
||||
uint32_t do_forms=0;
|
||||
int otg_enabled;
|
||||
//int number_of_cards = 1;
|
||||
//int number_of_cards = 1;
|
||||
|
||||
static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
|
||||
int16_t node_synch_ref[MAX_NUM_CCs];
|
||||
@@ -404,6 +374,8 @@ static void get_options(void) {
|
||||
uint32_t online_log_messages;
|
||||
uint32_t glog_level, glog_verbosity;
|
||||
uint32_t start_telnetsrv=0;
|
||||
//uint32_t noS1;
|
||||
//uint32_t nokrnmod;
|
||||
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC_UE ;
|
||||
paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC_NR ;
|
||||
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
|
||||
@@ -659,6 +631,27 @@ void init_openair0(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void init_pdcp(void) {
|
||||
uint32_t pdcp_initmask = (!IS_SOFTMODEM_NOS1) ? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT);
|
||||
|
||||
/*if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) {
|
||||
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
|
||||
}*/
|
||||
|
||||
if (IS_SOFTMODEM_NOKRNMOD)
|
||||
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
|
||||
|
||||
/*if (rlc_module_init() != 0) {
|
||||
LOG_I(RLC, "Problem at RLC initiation \n");
|
||||
}
|
||||
pdcp_layer_init();
|
||||
nr_ip_over_LTE_DRB_preconfiguration();*/
|
||||
pdcp_module_init(pdcp_initmask);
|
||||
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
|
||||
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
|
||||
LOG_I(PDCP, "Before getting out from init_pdcp() \n");
|
||||
}
|
||||
|
||||
|
||||
int main( int argc, char **argv ) {
|
||||
//uint8_t beta_ACK=0,beta_RI=0,beta_CQI=2;
|
||||
@@ -678,6 +671,7 @@ int main( int argc, char **argv ) {
|
||||
logInit();
|
||||
// get options and fill parameters from configuration file
|
||||
get_options (); //Command-line options, enb_properties
|
||||
get_common_options();
|
||||
#if T_TRACER
|
||||
T_Config_Init();
|
||||
#endif
|
||||
@@ -691,18 +685,22 @@ int main( int argc, char **argv ) {
|
||||
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
|
||||
|
||||
init_opt() ;
|
||||
if(IS_SOFTMODEM_NOS1)
|
||||
init_pdcp();
|
||||
|
||||
if (ouput_vcd) {
|
||||
vcd_signal_dumper_init("/tmp/openair_dump_nrUE.vcd");
|
||||
}
|
||||
|
||||
/*
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
netlink_init();
|
||||
#if defined(PDCP_USE_NETLINK_QUEUES)
|
||||
pdcp_netlink_init();
|
||||
#endif
|
||||
#endif
|
||||
#ifndef PACKAGE_VERSION
|
||||
*/
|
||||
#ifndef PACKAGE_VERSION
|
||||
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
|
||||
#endif
|
||||
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
|
||||
@@ -728,6 +726,7 @@ int main( int argc, char **argv ) {
|
||||
PHY_vars_UE_g[0][CC_id] = init_nr_ue_vars(frame_parms[CC_id], 0,abstraction_flag);
|
||||
UE[CC_id] = PHY_vars_UE_g[0][CC_id];
|
||||
|
||||
|
||||
if (phy_test==1)
|
||||
UE[CC_id]->mac_enabled = 0;
|
||||
else
|
||||
@@ -777,6 +776,7 @@ int main( int argc, char **argv ) {
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.chain=CC_id+chain_offset;
|
||||
#if defined(OAI_USRP) || defined(OAI_ADRV9371_ZC706)
|
||||
PHY_vars_UE_g[0][CC_id]->hw_timing_advance = timing_advance;
|
||||
PHY_vars_UE_g[0][CC_id]->timing_advance = timing_advance;
|
||||
#else
|
||||
PHY_vars_UE_g[0][CC_id]->hw_timing_advance = 160;
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef NR_UESOFTMODEM_H
|
||||
#define NR_UESOFTMODEM_H
|
||||
#include <executables/nr-softmodem-common.h>
|
||||
#include <executables/softmodem-common.h>
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
#include <openair2/LAYER2/NR_MAC_gNB/mac_proto.h>
|
||||
@@ -50,41 +51,41 @@
|
||||
{"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \
|
||||
{"r" , CONFIG_HLP_PRB, 0, iptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT, 0}, \
|
||||
{"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
|
||||
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200", TYPE_STRING, 0} \
|
||||
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200", TYPE_STRING, 0} \
|
||||
}
|
||||
|
||||
#define DEFAULT_DLF 2680000000
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* command line parameters common to eNodeB and UE */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* command line parameters common to eNodeB and UE */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define CMDLINE_PARAMS_DESC_UE { \
|
||||
{"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&rf_config_file, defstrval:NULL, TYPE_STRING, sizeof(rf_config_file)},\
|
||||
{"ulsch-max-errors", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \
|
||||
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&phy_test, defintval:0, TYPE_INT, 0}, \
|
||||
{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&usim_test, defintval:0, TYPE_UINT8, 0}, \
|
||||
{"external-clock", CONFIG_HLP_EXCCLK, PARAMFLAG_BOOL, uptr:&clock_source, defintval:0, TYPE_INT, 0}, \
|
||||
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
|
||||
{"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
|
||||
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
|
||||
{"C" , CONFIG_HLP_DLF, 0, uptr:&(downlink_frequency[0][0]), defuintval:2680000000, TYPE_UINT, 0}, \
|
||||
{"a" , CONFIG_HLP_CHOFF, 0, iptr:&chain_offset, defintval:0, TYPE_INT, 0}, \
|
||||
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:&do_forms, defintval:0, TYPE_INT, 0}, \
|
||||
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, iptr:&threequarter_fs, defintval:0, TYPE_INT, 0}, \
|
||||
{"m" , CONFIG_HLP_DLMCS, 0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \
|
||||
{"t" , CONFIG_HLP_ULMCS, 0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \
|
||||
{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \
|
||||
{"S" , CONFIG_HLP_MSLOTS, PARAMFLAG_BOOL, u8ptr:&exit_missed_slots, defintval:1, TYPE_UINT8, 0}, \
|
||||
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&numerology, defintval:0, TYPE_INT, 0}, \
|
||||
{"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&emulate_rf, defintval:0, TYPE_INT, 0}, \
|
||||
{"parallel-config", CONFIG_HLP_PARALLEL_CMD,0, strptr:(char **)¶llel_config, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \
|
||||
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&UE_no_timing_correction, defintval:0, TYPE_INT, 0} \
|
||||
{"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&rf_config_file, defstrval:NULL, TYPE_STRING, sizeof(rf_config_file)},\
|
||||
{"ulsch-max-errors", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \
|
||||
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&phy_test, defintval:0, TYPE_INT, 0}, \
|
||||
{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&usim_test, defintval:0, TYPE_UINT8, 0}, \
|
||||
{"external-clock", CONFIG_HLP_EXCCLK, PARAMFLAG_BOOL, uptr:&clock_source, defintval:0, TYPE_INT, 0}, \
|
||||
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
|
||||
{"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
|
||||
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
|
||||
{"C" , CONFIG_HLP_DLF, 0, uptr:&(downlink_frequency[0][0]), defuintval:2680000000, TYPE_UINT, 0}, \
|
||||
{"a" , CONFIG_HLP_CHOFF, 0, iptr:&chain_offset, defintval:0, TYPE_INT, 0}, \
|
||||
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:&do_forms, defintval:0, TYPE_INT, 0}, \
|
||||
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, iptr:&threequarter_fs, defintval:0, TYPE_INT, 0}, \
|
||||
{"m" , CONFIG_HLP_DLMCS, 0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \
|
||||
{"t" , CONFIG_HLP_ULMCS, 0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \
|
||||
{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \
|
||||
{"S" , CONFIG_HLP_MSLOTS, PARAMFLAG_BOOL, u8ptr:&exit_missed_slots, defintval:1, TYPE_UINT8, 0}, \
|
||||
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&numerology, defintval:0, TYPE_INT, 0}, \
|
||||
{"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&emulate_rf, defintval:0, TYPE_INT, 0}, \
|
||||
{"parallel-config", CONFIG_HLP_PARALLEL_CMD,0, strptr:(char **)¶llel_config, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \
|
||||
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&UE_no_timing_correction, defintval:0, TYPE_INT, 0} \
|
||||
}
|
||||
|
||||
|
||||
@@ -94,15 +95,12 @@ extern int T_dont_fork;
|
||||
|
||||
|
||||
// In nr-ue.c
|
||||
extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue,
|
||||
openair0_config_t *openair0_cfg);
|
||||
extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
|
||||
extern void fill_ue_band_info(void);
|
||||
extern void init_NR_UE(int);
|
||||
extern void reset_opp_meas(void);
|
||||
extern void print_opp_meas(void);
|
||||
void *UE_thread(void *arg);
|
||||
PHY_VARS_NR_UE *init_nr_ue_vars(NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t UE_id,
|
||||
uint8_t abstraction_flag);
|
||||
PHY_VARS_NR_UE *init_nr_ue_vars(NR_DL_FRAME_PARMS *frame_parms, uint8_t UE_id, uint8_t abstraction_flag);
|
||||
extern tpool_t *Tpool;
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef SOFTMODEM_COMMON_H
|
||||
#define SOFTMODEM_COMMON_H
|
||||
|
||||
typedef struct {
|
||||
uint64_t optmask;
|
||||
THREAD_STRUCT thread_struct;
|
||||
char rf_config_file[1024];
|
||||
int phy_test;
|
||||
uint8_t usim_test;
|
||||
int emulate_rf;
|
||||
int wait_for_sync; //eNodeB only
|
||||
int single_thread_flag; //eNodeB only
|
||||
int chain_offset;
|
||||
int numerology;
|
||||
unsigned int start_msc;
|
||||
uint32_t clock_source;
|
||||
uint32_t timing_source;
|
||||
int hw_timing_advance;
|
||||
uint32_t send_dmrs_sync;
|
||||
} softmodem_params_t;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,42 @@
|
||||
#ifndef THREAD_COMMON_H
|
||||
#define THREAD_COMMON_H
|
||||
|
||||
#include "PHY/defs_common.h"
|
||||
|
||||
THREAD_STRUCT thread_struct;
|
||||
|
||||
static inline void set_parallel_conf(char *parallel_conf) {
|
||||
mapping config[]= {
|
||||
FOREACH_PARALLEL(GENERATE_ENUMTXT)
|
||||
{NULL,-1}
|
||||
};
|
||||
thread_struct.parallel_conf = (PARALLEL_CONF_t)map_str_to_int(config, parallel_conf);
|
||||
if (thread_struct.parallel_conf == -1 ) {
|
||||
LOG_E(ENB_APP,"Impossible value: %s\n", parallel_conf);
|
||||
thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
|
||||
}
|
||||
printf("[CONFIG] parallel_conf is set to %d\n", thread_struct.parallel_conf);
|
||||
}
|
||||
|
||||
static inline void set_worker_conf(char *worker_conf) {
|
||||
mapping config[]={
|
||||
FOREACH_WORKER(GENERATE_ENUMTXT)
|
||||
{NULL, -1}
|
||||
};
|
||||
thread_struct.worker_conf = (WORKER_CONF_t)map_str_to_int(config, worker_conf);
|
||||
if (thread_struct.worker_conf == -1 ) {
|
||||
LOG_E(ENB_APP,"Impossible value: %s\n", worker_conf);
|
||||
thread_struct.worker_conf = WORKER_DISABLE ;
|
||||
}
|
||||
printf("[CONFIG] worker_conf is set to %d\n", thread_struct.worker_conf);
|
||||
}
|
||||
|
||||
static inline PARALLEL_CONF_t get_thread_parallel_conf(void) {
|
||||
return thread_struct.parallel_conf;
|
||||
}
|
||||
|
||||
static inline WORKER_CONF_t get_thread_worker_conf(void) {
|
||||
return thread_struct.worker_conf;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -23,13 +23,14 @@
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "assertions.h"
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
#include "PHY/CODING/nrLDPC_encoder/defs.h"
|
||||
#include "PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.h"
|
||||
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
|
||||
|
||||
#define MAX_NUM_DLSCH_SEGMENTS 16
|
||||
#define MAX_BLOCK_LENGTH 8448
|
||||
|
||||
#ifndef malloc16
|
||||
# ifdef __AVX2__
|
||||
@@ -42,7 +43,6 @@
|
||||
#define NR_LDPC_PROFILER_DETAIL
|
||||
#define NR_LDPC_ENABLE_PARITY_CHECK
|
||||
|
||||
|
||||
// 4-bit quantizer
|
||||
char quantize4bit(double D,double x)
|
||||
{
|
||||
@@ -76,31 +76,15 @@ char quantize8bit(double D,double x)
|
||||
return((char)qxd);
|
||||
}
|
||||
|
||||
char quantize(double D,double x,unsigned char B)
|
||||
{
|
||||
double qxd;
|
||||
short maxlev;
|
||||
qxd = floor(x/D);
|
||||
|
||||
maxlev = 1<<(B-1);//(char)(pow(2,B-1));
|
||||
|
||||
//printf("x=%f,qxd=%f,maxlev=%d\n",x,qxd, maxlev);
|
||||
|
||||
if (qxd <= -maxlev)
|
||||
qxd = -maxlev;
|
||||
else if (qxd >= maxlev)
|
||||
qxd = maxlev-1;
|
||||
|
||||
return((char)qxd);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
double n_iter_mean;
|
||||
double n_iter_std;
|
||||
int n_iter_max;
|
||||
double n_iter_mean;
|
||||
double n_iter_std;
|
||||
int n_iter_max;
|
||||
} n_iter_stats_t;
|
||||
|
||||
#define MAX_BLOCK_LENGTH 8448
|
||||
RAN_CONTEXT_t RC;
|
||||
PHY_VARS_UE ***PHY_vars_UE_g;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
|
||||
short lift_size[51]= {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384};
|
||||
|
||||
@@ -118,7 +102,7 @@ int test_ldpc(short No_iteration,
|
||||
unsigned int *crc_misses,
|
||||
time_stats_t *time_optim,
|
||||
time_stats_t *time_decoder,
|
||||
n_iter_stats_t * dec_iter)
|
||||
n_iter_stats_t *dec_iter)
|
||||
{
|
||||
//clock initiate
|
||||
//time_stats_t time,time_optim,tinput,tprep,tparity,toutput, time_decoder;
|
||||
@@ -146,12 +130,12 @@ int test_ldpc(short No_iteration,
|
||||
double *modulated_input[MAX_NUM_DLSCH_SEGMENTS];
|
||||
char *channel_output_fixed[MAX_NUM_DLSCH_SEGMENTS];
|
||||
unsigned int i,j,trial=0;
|
||||
short BG,Zc,Kb,nrows;//,ncols;
|
||||
short BG=0,Zc,Kb=0,nrows=0;//,ncols;
|
||||
int no_punctured_columns,removed_bit;
|
||||
int i1;
|
||||
int R_ind = 0;
|
||||
//Table of possible lifting sizes
|
||||
//short lift_size[51]= {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384};
|
||||
//short lift_size[51]= {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384};
|
||||
//int n_segments=1;
|
||||
int code_rate_vec[8] = {15, 13, 25, 12, 23, 34, 56, 89};
|
||||
//double code_rate_actual_vec[8] = {0.2, 0.33333, 0.4, 0.5, 0.66667, 0.73333, 0.81481, 0.88};
|
||||
@@ -227,15 +211,15 @@ int test_ldpc(short No_iteration,
|
||||
//determine number of bits in codeword
|
||||
if (block_length>3840)
|
||||
{
|
||||
BG=1;
|
||||
BG = 1;
|
||||
Kb = 22;
|
||||
nrows=46; //parity check bits
|
||||
nrows = 46; //parity check bits
|
||||
//ncols=22; //info bits
|
||||
}
|
||||
else if (block_length<=3840)
|
||||
{
|
||||
BG=2;
|
||||
nrows=42; //parity check bits
|
||||
BG = 2;
|
||||
nrows = 42; //parity check bits
|
||||
//ncols=10; // info bits
|
||||
|
||||
if (block_length>640)
|
||||
@@ -246,7 +230,7 @@ int test_ldpc(short No_iteration,
|
||||
Kb = 8;
|
||||
else
|
||||
Kb = 6;
|
||||
}
|
||||
}
|
||||
|
||||
if (nom_rate == 1)
|
||||
if (denom_rate == 5)
|
||||
@@ -298,7 +282,7 @@ int test_ldpc(short No_iteration,
|
||||
}
|
||||
}
|
||||
|
||||
printf("ldpc_test: codeword_length %d, n_segments %d, block_length %d, BG %d, Zc %d, Kb %d\n",n_segments *block_length, n_segments, block_length,BG, Zc, Kb);
|
||||
printf("ldpc_test: codeword_length %d, n_segments %d, block_length %d, BG %d, Zc %d, Kb %d\n",n_segments *block_length, n_segments, block_length, BG, Zc, Kb);
|
||||
no_punctured_columns=(int)((nrows-2)*Zc+block_length-block_length*(1/((float)nom_rate/(float)denom_rate)))/Zc;
|
||||
// printf("puncture:%d\n",no_punctured_columns);
|
||||
removed_bit=(nrows-no_punctured_columns-2) * Zc+block_length-(int)(block_length/((float)nom_rate/(float)denom_rate));
|
||||
@@ -330,11 +314,11 @@ int test_ldpc(short No_iteration,
|
||||
|
||||
if (ntrials==1)
|
||||
for (j=0;j<n_segments;j++)
|
||||
for (i = 0; i < block_length+(nrows-no_punctured_columns) * Zc - removed_bit; i++)
|
||||
if (channel_input[j][i]!=channel_input_optim[j][i]) {
|
||||
printf("differ in seg %d pos %d (%d,%d)\n",j,i,channel_input[j][i],channel_input_optim[j][i]);
|
||||
return (-1);
|
||||
}
|
||||
for (i = 0; i < block_length+(nrows-no_punctured_columns) * Zc - removed_bit; i++)
|
||||
if (channel_input[j][i]!=channel_input_optim[j][i]) {
|
||||
printf("differ in seg %u pos %u (%u,%u)\n", j, i, channel_input[j][i], channel_input_optim[j][i]);
|
||||
return (-1);
|
||||
}
|
||||
//else{
|
||||
// printf("NOT differ in seg %d pos %d (%d,%d)\n",j,i,channel_input[j][i],channel_input_optim[j][i]);
|
||||
// }
|
||||
@@ -344,7 +328,6 @@ int test_ldpc(short No_iteration,
|
||||
printf("removed_bit: %d\n", removed_bit);
|
||||
printf("To: %d\n", (Kb+nrows-no_punctured_columns) * Zc-removed_bit);
|
||||
printf("number of undecoded bits: %d\n", (Kb+nrows-no_punctured_columns-2) * Zc-removed_bit);
|
||||
|
||||
}
|
||||
|
||||
//print_meas_now(&time, "", stdout);
|
||||
@@ -359,7 +342,7 @@ int test_ldpc(short No_iteration,
|
||||
for (i = 2*Zc; i < (Kb+nrows-no_punctured_columns) * Zc-removed_bit; i++) {
|
||||
#ifdef DEBUG_CODER
|
||||
if ((i&0xf)==0)
|
||||
printf("\ne %d..%d: ",i,i+15);
|
||||
printf("\ne %u..%u: ",i,i+15);
|
||||
#endif
|
||||
|
||||
if (channel_input_optim[j][i-2*Zc]==0)
|
||||
@@ -369,7 +352,7 @@ int test_ldpc(short No_iteration,
|
||||
|
||||
///channel_output[i] = modulated_input[i] + gaussdouble(0.0,1.0) * 1/sqrt(2*SNR);
|
||||
//channel_output_fixed[i] = (char) ((channel_output[i]*128)<0?(channel_output[i]*128-0.5):(channel_output[i]*128+0.5)); //fixed point 9-7
|
||||
//printf("llr[%d]=%d\n",i,channel_output_fixed[i]);
|
||||
//printf("llr[%d]=%d\n",i,channel_output_fixed[i]);
|
||||
|
||||
//channel_output_fixed[i] = (char)quantize(sigma/4.0,(2.0*modulated_input[i]) - 1.0 + sigma*gaussdouble(0.0,1.0),qbits);
|
||||
channel_output_fixed[j][i] = (char)quantize(sigma/4.0/4.0,modulated_input[j][i] + sigma*gaussdouble(0.0,1.0),qbits);
|
||||
@@ -383,7 +366,7 @@ int test_ldpc(short No_iteration,
|
||||
//Uncoded BER
|
||||
if (channel_output_fixed[j][i]<0)
|
||||
channel_output_uncoded[j][i]=1; //QPSK demod
|
||||
else
|
||||
else
|
||||
channel_output_uncoded[j][i]=0;
|
||||
|
||||
if (channel_output_uncoded[j][i] != channel_input_optim[j][i-2*Zc])
|
||||
@@ -541,7 +524,7 @@ int main(int argc, char *argv[])
|
||||
time_stats_t time_optim[10], time_decoder[10];
|
||||
n_iter_stats_t dec_iter[3];
|
||||
|
||||
short BG,Zc,Kb;
|
||||
short BG=0,Zc,Kb;
|
||||
|
||||
while ((c = getopt (argc, argv, "q:r:s:S:l:n:d:i:t:u:h")) != -1)
|
||||
switch (c)
|
||||
@@ -571,8 +554,8 @@ int main(int argc, char *argv[])
|
||||
break;
|
||||
|
||||
case 'S':
|
||||
n_segments = atof(optarg);
|
||||
break;
|
||||
n_segments = atof(optarg);
|
||||
break;
|
||||
|
||||
case 't':
|
||||
SNR_step = atof(optarg);
|
||||
@@ -583,8 +566,8 @@ int main(int argc, char *argv[])
|
||||
break;
|
||||
|
||||
case 'u':
|
||||
test_uncoded = atoi(optarg);
|
||||
break;
|
||||
test_uncoded = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'h':
|
||||
default:
|
||||
@@ -622,14 +605,14 @@ int main(int argc, char *argv[])
|
||||
//determine number of bits in codeword
|
||||
if (block_length>3840)
|
||||
{
|
||||
BG=1;
|
||||
BG = 1;
|
||||
Kb = 22;
|
||||
//nrows=46; //parity check bits
|
||||
//ncols=22; //info bits
|
||||
}
|
||||
else if (block_length<=3840)
|
||||
{
|
||||
BG=2;
|
||||
BG = 2;
|
||||
//nrows=42; //parity check bits
|
||||
//ncols=10; // info bits
|
||||
|
||||
@@ -663,8 +646,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
fprintf(fd,"SNR BLER BER UNCODED_BER ENCODER_MEAN ENCODER_STD ENCODER_MAX DECODER_TIME_MEAN DECODER_TIME_STD DECODER_TIME_MAX DECODER_ITER_MEAN DECODER_ITER_STD DECODER_ITER_MAX\n");
|
||||
|
||||
for (SNR=SNR0;SNR<SNR0+20.0;SNR+=SNR_step)
|
||||
{
|
||||
for (SNR=SNR0;SNR<SNR0+20.0;SNR+=SNR_step) {
|
||||
//reset_meas(&time_optim);
|
||||
//reset_meas(&time_decoder);
|
||||
//n_iter_stats_t dec_iter = {0, 0, 0};
|
||||
@@ -689,9 +671,9 @@ int main(int argc, char *argv[])
|
||||
time_decoder,
|
||||
dec_iter);
|
||||
|
||||
printf("SNR %f, BLER %f (%d/%d)\n",SNR,(float)decoded_errors[i]/(float)n_trials,decoded_errors[i],n_trials);
|
||||
printf("SNR %f, BER %f (%d/%d)\n",SNR,(float)errors_bit/(float)n_trials/(float)block_length/(double)n_segments ,decoded_errors[i],n_trials);
|
||||
printf("SNR %f, Uncoded BER %f (%d/%d)\n",SNR,errors_bit_uncoded/(float)n_trials/(double)n_segments ,decoded_errors[i],n_trials);
|
||||
printf("SNR %f, BLER %f (%u/%d)\n", SNR, (float)decoded_errors[i]/(float)n_trials, decoded_errors[i], n_trials);
|
||||
printf("SNR %f, BER %f (%u/%d)\n", SNR, (float)errors_bit/(float)n_trials/(float)block_length/(double)n_segments, decoded_errors[i], n_trials);
|
||||
printf("SNR %f, Uncoded BER %f (%u/%d)\n",SNR, errors_bit_uncoded/(float)n_trials/(double)n_segments, decoded_errors[i], n_trials);
|
||||
printf("SNR %f, Mean iterations: %f\n",SNR, dec_iter->n_iter_mean);
|
||||
printf("SNR %f, Std iterations: %f\n",SNR, dec_iter->n_iter_std);
|
||||
printf("SNR %f, Max iterations: %d\n",SNR, dec_iter->n_iter_max);
|
||||
@@ -720,23 +702,11 @@ int main(int argc, char *argv[])
|
||||
dec_iter->n_iter_max
|
||||
);
|
||||
|
||||
if (decoded_errors[i] == 0)
|
||||
break;
|
||||
if (decoded_errors[i] == 0) break;
|
||||
|
||||
i=i+1;
|
||||
|
||||
|
||||
}
|
||||
fclose(fd);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h"
|
||||
#include "PHY/CODING/coding_defs.h"
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
|
||||
//#include "PHY/NR_TRANSPORT/nr_transport.h"
|
||||
//#include "common/utils/LOG/log.h"
|
||||
|
||||
@@ -18,7 +19,12 @@
|
||||
//#define DEBUG_POLAR_TIMING
|
||||
//#define DEBUG_POLARTEST
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
RAN_CONTEXT_t RC;
|
||||
PHY_VARS_UE ***PHY_vars_UE_g;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
//Default simulation values (Aim for iterations = 1000000.)
|
||||
int decoder_int16=0;
|
||||
int itr, iterations = 1000, arguments, polarMessageType = 0; //0=PBCH, 1=DCI, -1=UCI
|
||||
|
||||
@@ -1,27 +1,16 @@
|
||||
#include "PHY/CODING/nrSmallBlock/nr_small_block_defs.h"
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
#include <getopt.h>
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
#include "PHY/CODING/nrSmallBlock/nr_small_block_defs.h"
|
||||
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
|
||||
|
||||
//#define DEBUG_SMALLBLOCKTEST
|
||||
|
||||
signed char quantize(double D, double x, unsigned char B)
|
||||
RAN_CONTEXT_t RC;
|
||||
PHY_VARS_UE ***PHY_vars_UE_g;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
double qxd;
|
||||
short maxlev;
|
||||
qxd = floor(x/D);
|
||||
|
||||
maxlev = 1<<(B-1);//(char)(pow(2,B-1));
|
||||
|
||||
if (qxd <= -maxlev)
|
||||
qxd = -maxlev;
|
||||
else if (qxd >= maxlev)
|
||||
qxd = maxlev-1;
|
||||
|
||||
return((char)qxd);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
time_stats_t timeEncoder,timeDecoder;
|
||||
opp_enabled=1;
|
||||
cpu_freq_GHz = get_cpu_freq_GHz();
|
||||
|
||||
@@ -445,7 +445,7 @@ int ldpc_encoder_orig(unsigned char *test_input,unsigned char *channel_input,sho
|
||||
pointer_shift_values=(short *) pointer_shift_values_BG2;
|
||||
}
|
||||
else {
|
||||
AssertFatal(0,"BG %d is not supported yet\n",BG);
|
||||
AssertFatal(0,"BG %d is not supported yet\n",BG);
|
||||
}
|
||||
|
||||
no_punctured_columns=(int)((nrows-2)*Zc+block_length-block_length*3)/Zc;
|
||||
|
||||
@@ -601,7 +601,8 @@ void init_polar_deinterleaver_table(t_nrPolar_params *polarParams) {
|
||||
|
||||
uint32_t polar_decoder_int16(int16_t *input,
|
||||
uint64_t *out,
|
||||
const t_nrPolar_params *polarParams) {
|
||||
const t_nrPolar_params *polarParams)
|
||||
{
|
||||
int16_t d_tilde[polarParams->N];// = malloc(sizeof(double) * polarParams->N);
|
||||
nr_polar_rate_matching_int16(input, d_tilde, polarParams->rate_matching_pattern, polarParams->K, polarParams->N, polarParams->encoderLength);
|
||||
|
||||
@@ -645,8 +646,8 @@ uint32_t polar_decoder_int16(int16_t *input,
|
||||
//int len_mod64=len&63;
|
||||
int crclen = polarParams->crcParityBits;
|
||||
uint64_t rxcrc=B[0]&((1<<crclen)-1);
|
||||
uint32_t crc;
|
||||
uint64_t Ar;
|
||||
uint32_t crc = 0;
|
||||
uint64_t Ar = 0;
|
||||
AssertFatal(len<65,"A must be less than 65 bits\n");
|
||||
|
||||
if (len<=32) {
|
||||
|
||||
@@ -268,7 +268,7 @@ static inline void polar_rate_matching(t_nrPolar_params *polarParams,void *in,vo
|
||||
#endif
|
||||
for (int i=0; i<polarParams->encoderLength; i++) {
|
||||
#ifdef DEBUG_POLAR_ENCODER
|
||||
printf("%u<-%u : %llx.%llx =>",i,polarParams->rate_matching_pattern[i],((uint64_t *)out)[1],((uint64_t *)out)[0]);
|
||||
printf("%d<-%u : %llx.%llx =>",i,polarParams->rate_matching_pattern[i],((uint64_t *)out)[1],((uint64_t *)out)[0]);
|
||||
#endif
|
||||
tmp0 = (*in128&(((uint128_t)1)<<polarParams->rate_matching_pattern[i]));
|
||||
if (tmp0!=0) {
|
||||
|
||||
@@ -59,12 +59,12 @@ int32_t nr_segmentation(unsigned char *input_buffer,
|
||||
|
||||
Bprime = B+((*C)*L);
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("Bprime %d\n",Bprime);
|
||||
printf("Bprime %u\n",Bprime);
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((*C)>MAX_NUM_DLSCH_SEGMENTS) {
|
||||
LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime);
|
||||
LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ else
|
||||
Z = (Kprime/Kb);
|
||||
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("nr segmetation B %d Bprime %d Kprime %d z %d \n", B, Bprime, Kprime, Z);
|
||||
printf("nr segmetation B %u Bprime %u Kprime %u z %u \n", B, Bprime, Kprime, Z);
|
||||
#endif
|
||||
|
||||
if (Z <= 2) {
|
||||
@@ -120,7 +120,7 @@ else
|
||||
*K = *K + 8;
|
||||
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("Z_by_C %d , K2 %d\n",Z,*K);
|
||||
printf("Z_by_C %u , K2 %u\n",Z,*K);
|
||||
#endif
|
||||
} else if (Z <= 256) { // increase by 4 bytes til here
|
||||
*K = (Z>>4)<<4;
|
||||
@@ -149,8 +149,8 @@ else
|
||||
*F = ((*K) - Kprime);
|
||||
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("final nr seg output Z %d K %d F %d \n", *Zout, *K, *F);
|
||||
printf("C %d, K %d, Bprime_bytes %d, Bprime %d, F %d\n",*C,*K,Bprime>>3,Bprime,*F);
|
||||
printf("final nr seg output Z %u K %u F %u \n", *Zout, *K, *F);
|
||||
printf("C %u, K %u, Bprime_bytes %u, Bprime %u, F %u\n",*C,*K,Bprime>>3,Bprime,*F);
|
||||
#endif
|
||||
|
||||
if ((input_buffer) && (output_buffers)) {
|
||||
|
||||
+66
-25
@@ -19,6 +19,7 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include "executables/nr-softmodem-common.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/NR_REFSIG/nr_refsig.h"
|
||||
@@ -30,7 +31,7 @@
|
||||
#include "TDD-Config.h"
|
||||
#include "MBSFN-SubframeConfigList.h"*/
|
||||
#include "openair1/PHY/defs_RU.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "assertions.h"
|
||||
#include <math.h>
|
||||
|
||||
@@ -38,6 +39,7 @@
|
||||
#include "PHY/NR_REFSIG/nr_refsig.h"
|
||||
#include "SCHED_NR/fapi_nr_l1.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "nfapi_nr_interface.h"
|
||||
|
||||
/*
|
||||
extern uint32_t from_nrarfcn(int nr_bandP,uint32_t dl_nrarfcn);
|
||||
@@ -207,24 +209,32 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
for (int UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
//FIXME
|
||||
pusch_vars[UE_id] = (NR_gNB_PUSCH *)malloc16_clear( sizeof(NR_gNB_PUSCH) );
|
||||
pusch_vars[UE_id]->rxdataF_ext = (int32_t **)malloc16( 2*sizeof(int32_t *) );
|
||||
pusch_vars[UE_id]->rxdataF_ext2 = (int32_t **)malloc16( 2*sizeof(int32_t *) );
|
||||
pusch_vars[UE_id]->drs_ch_estimates = (int32_t **)malloc16( 2*sizeof(int32_t *) );
|
||||
pusch_vars[UE_id]->drs_ch_estimates_time = (int32_t **)malloc16( 2*sizeof(int32_t *) );
|
||||
pusch_vars[UE_id]->rxdataF_comp = (int32_t **)malloc16( 2*sizeof(int32_t *) );
|
||||
pusch_vars[UE_id]->ul_ch_mag = (int32_t **)malloc16( 2*sizeof(int32_t *) );
|
||||
pusch_vars[UE_id]->ul_ch_magb = (int32_t **)malloc16( 2*sizeof(int32_t *) );
|
||||
pusch_vars[UE_id]->rxdataF_ext = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pusch_vars[UE_id]->rxdataF_ext2 = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pusch_vars[UE_id]->ul_ch_estimates = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pusch_vars[UE_id]->ul_ch_estimates_ext = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pusch_vars[UE_id]->ul_ch_estimates_time = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pusch_vars[UE_id]->rxdataF_comp = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pusch_vars[UE_id]->ul_ch_mag0 = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pusch_vars[UE_id]->ul_ch_magb0 = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pusch_vars[UE_id]->ul_ch_mag = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pusch_vars[UE_id]->ul_ch_magb = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pusch_vars[UE_id]->rho = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
|
||||
for (i=0; i<2; i++) {
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
// RK 2 times because of output format of FFT!
|
||||
// FIXME We should get rid of this
|
||||
pusch_vars[UE_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*cfg->rf_config.ul_carrier_bandwidth.value*12*fp->symbols_per_slot );
|
||||
pusch_vars[UE_id]->rxdataF_ext2[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*cfg->rf_config.ul_carrier_bandwidth.value*12*fp->symbols_per_slot );
|
||||
pusch_vars[UE_id]->drs_ch_estimates[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*cfg->rf_config.ul_carrier_bandwidth.value*12*fp->symbols_per_slot );
|
||||
pusch_vars[UE_id]->drs_ch_estimates_time[i] = (int32_t *)malloc16_clear( 2*sizeof(int32_t)*fp->ofdm_symbol_size );
|
||||
pusch_vars[UE_id]->ul_ch_estimates[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*cfg->rf_config.ul_carrier_bandwidth.value*12*fp->symbols_per_slot );
|
||||
pusch_vars[UE_id]->ul_ch_estimates_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*cfg->rf_config.ul_carrier_bandwidth.value*12*fp->symbols_per_slot );
|
||||
pusch_vars[UE_id]->ul_ch_estimates_time[i] = (int32_t *)malloc16_clear( 2*sizeof(int32_t)*fp->ofdm_symbol_size );
|
||||
pusch_vars[UE_id]->rxdataF_comp[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*cfg->rf_config.ul_carrier_bandwidth.value*12*fp->symbols_per_slot );
|
||||
pusch_vars[UE_id]->ul_ch_mag0[i] = (int32_t *)malloc16_clear( fp->symbols_per_slot*sizeof(int32_t)*cfg->rf_config.ul_carrier_bandwidth.value*12 );
|
||||
pusch_vars[UE_id]->ul_ch_magb0[i] = (int32_t *)malloc16_clear( fp->symbols_per_slot*sizeof(int32_t)*cfg->rf_config.ul_carrier_bandwidth.value*12 );
|
||||
pusch_vars[UE_id]->ul_ch_mag[i] = (int32_t *)malloc16_clear( fp->symbols_per_slot*sizeof(int32_t)*cfg->rf_config.ul_carrier_bandwidth.value*12 );
|
||||
pusch_vars[UE_id]->ul_ch_magb[i] = (int32_t *)malloc16_clear( fp->symbols_per_slot*sizeof(int32_t)*cfg->rf_config.ul_carrier_bandwidth.value*12 );
|
||||
pusch_vars[UE_id]->rho[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(fp->N_RB_UL*12*7*2) );
|
||||
}
|
||||
|
||||
pusch_vars[UE_id]->llr = (int16_t *)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) ); // [hna] 6144 is LTE and (8*((3*8*6144)+12)) is not clear
|
||||
@@ -285,7 +295,7 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
//NR_DL_FRAME_PARMS* const fp = &gNB->frame_parms;
|
||||
//nfapi_nr_config_request_t *cfg = &gNB->gNB_config;
|
||||
NR_gNB_COMMON *const common_vars = &gNB->common_vars;
|
||||
//NR_gNB_PUSCH **const pusch_vars = gNB->pusch_vars;
|
||||
NR_gNB_PUSCH **const pusch_vars = gNB->pusch_vars;
|
||||
/*LTE_eNB_SRS *const srs_vars = gNB->srs_vars;
|
||||
LTE_eNB_PRACH *const prach_vars = &gNB->prach_vars;*/
|
||||
uint32_t ***pdcch_dmrs = gNB->nr_gold_pdcch_dmrs;
|
||||
@@ -321,29 +331,38 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
|
||||
free_and_zero(prach_vars->prach_ifft[0]);
|
||||
free_and_zero(prach_vars->rxsigF[0]);
|
||||
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
for (i = 0; i < 2; i++) {
|
||||
*/
|
||||
for (int UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
free_and_zero(pusch_vars[UE_id]->rxdataF_ext[i]);
|
||||
free_and_zero(pusch_vars[UE_id]->rxdataF_ext2[i]);
|
||||
free_and_zero(pusch_vars[UE_id]->drs_ch_estimates[i]);
|
||||
free_and_zero(pusch_vars[UE_id]->drs_ch_estimates_time[i]);
|
||||
free_and_zero(pusch_vars[UE_id]->ul_ch_estimates[i]);
|
||||
free_and_zero(pusch_vars[UE_id]->ul_ch_estimates_ext[i]);
|
||||
free_and_zero(pusch_vars[UE_id]->ul_ch_estimates_time[i]);
|
||||
free_and_zero(pusch_vars[UE_id]->rxdataF_comp[i]);
|
||||
free_and_zero(pusch_vars[UE_id]->ul_ch_mag0[i]);
|
||||
free_and_zero(pusch_vars[UE_id]->ul_ch_magb0[i]);
|
||||
free_and_zero(pusch_vars[UE_id]->ul_ch_mag[i]);
|
||||
free_and_zero(pusch_vars[UE_id]->ul_ch_magb[i]);
|
||||
free_and_zero(pusch_vars[UE_id]->rho[i]);
|
||||
}
|
||||
|
||||
free_and_zero(pusch_vars[UE_id]->rxdataF_ext);
|
||||
free_and_zero(pusch_vars[UE_id]->rxdataF_ext2);
|
||||
free_and_zero(pusch_vars[UE_id]->drs_ch_estimates);
|
||||
free_and_zero(pusch_vars[UE_id]->drs_ch_estimates_time);
|
||||
free_and_zero(pusch_vars[UE_id]->ul_ch_estimates);
|
||||
free_and_zero(pusch_vars[UE_id]->ul_ch_estimates_ext);
|
||||
free_and_zero(pusch_vars[UE_id]->ul_ch_estimates_time);
|
||||
free_and_zero(pusch_vars[UE_id]->rxdataF_comp);
|
||||
free_and_zero(pusch_vars[UE_id]->ul_ch_mag0);
|
||||
free_and_zero(pusch_vars[UE_id]->ul_ch_magb0);
|
||||
free_and_zero(pusch_vars[UE_id]->ul_ch_mag);
|
||||
free_and_zero(pusch_vars[UE_id]->ul_ch_magb);
|
||||
free_and_zero(pusch_vars[UE_id]->rho);
|
||||
|
||||
free_and_zero(pusch_vars[UE_id]->llr);
|
||||
free_and_zero(pusch_vars[UE_id]);
|
||||
} //UE_id
|
||||
|
||||
/*
|
||||
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) gNB->UE_stats_ptr[UE_id] = NULL;
|
||||
*/
|
||||
}
|
||||
@@ -410,23 +429,25 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config)
|
||||
gNB_config->sch_config.ssb_periodicity.value = phy_config->cfg->sch_config.ssb_periodicity.value;
|
||||
|
||||
if (phy_config->cfg->subframe_config.duplex_mode.value == 0) {
|
||||
gNB_config->subframe_config.duplex_mode.value = TDD;
|
||||
} else {
|
||||
gNB_config->subframe_config.duplex_mode.value = FDD;
|
||||
} else {
|
||||
gNB_config->subframe_config.duplex_mode.value = TDD;
|
||||
}
|
||||
|
||||
RC.gNB[Mod_id][CC_id]->mac_enabled = 1;
|
||||
fp->dl_CarrierFreq = from_nrarfcn(gNB_config->nfapi_config.rf_bands.rf_band[0],gNB_config->nfapi_config.nrarfcn.value);
|
||||
fp->ul_CarrierFreq = fp->dl_CarrierFreq - (get_nr_uldl_offset(gNB_config->nfapi_config.rf_bands.rf_band[0])*100000);
|
||||
get_band(fp->dl_CarrierFreq, &gNB_config->nfapi_config.rf_bands.rf_band[0], &uplink_frequency_offset[CC_id][0], &fp->frame_type);
|
||||
fp->ul_CarrierFreq = fp->dl_CarrierFreq + uplink_frequency_offset[CC_id][0];
|
||||
fp->threequarter_fs = openair0_cfg[0].threequarter_fs;
|
||||
LOG_I(PHY,"Configuring MIB for instance %d, CCid %d : (band %d,N_RB_DL %d, N_RB_UL %d, Nid_cell %d,DL freq %u)\n",
|
||||
LOG_I(PHY,"Configuring MIB for instance %d, CCid %d : (band %d,N_RB_DL %d, N_RB_UL %d, Nid_cell %d,DL freq %u, UL freq %u)\n",
|
||||
Mod_id,
|
||||
CC_id,
|
||||
gNB_config->nfapi_config.rf_bands.rf_band[0],
|
||||
gNB_config->rf_config.dl_carrier_bandwidth.value,
|
||||
gNB_config->rf_config.ul_carrier_bandwidth.value,
|
||||
gNB_config->sch_config.physical_cell_id.value,
|
||||
fp->dl_CarrierFreq );
|
||||
fp->dl_CarrierFreq,
|
||||
fp->ul_CarrierFreq);
|
||||
|
||||
nr_init_frame_parms(gNB_config, fp);
|
||||
|
||||
@@ -485,6 +506,26 @@ void init_nr_transport(PHY_VARS_gNB *gNB) {
|
||||
LOG_E(PHY,"Can't get gNB ulsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
LOG_I(PHY,"Initializing nFAPI for ULSCH, UE %d\n",i);
|
||||
// [hna] added here for RT implementation
|
||||
uint8_t harq_pid = 0;
|
||||
nfapi_nr_ul_config_ulsch_pdu *rel15_ul = &gNB->ulsch[i+1][j]->harq_processes[harq_pid]->ulsch_pdu;
|
||||
|
||||
// --------- setting rel15_ul parameters ----------
|
||||
rel15_ul->rnti = 0x1234;
|
||||
rel15_ul->ulsch_pdu_rel15.start_rb = 0;
|
||||
rel15_ul->ulsch_pdu_rel15.number_rbs = 50;
|
||||
rel15_ul->ulsch_pdu_rel15.start_symbol = 2;
|
||||
rel15_ul->ulsch_pdu_rel15.number_symbols = 12;
|
||||
rel15_ul->ulsch_pdu_rel15.nb_re_dmrs = 6;
|
||||
rel15_ul->ulsch_pdu_rel15.length_dmrs = 1;
|
||||
rel15_ul->ulsch_pdu_rel15.Qm = 2;
|
||||
rel15_ul->ulsch_pdu_rel15.mcs = 9;
|
||||
rel15_ul->ulsch_pdu_rel15.rv = 0;
|
||||
rel15_ul->ulsch_pdu_rel15.n_layers = 1;
|
||||
///////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
||||
|
||||
@@ -79,6 +79,32 @@ int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp, uint8_t i_ssb, uint8_t half_f
|
||||
return symbol;
|
||||
}
|
||||
|
||||
int nr_is_ssb_slot(nfapi_nr_config_request_t *cfg, int slot)
|
||||
{
|
||||
|
||||
uint8_t n_hf;
|
||||
int rel_slot;
|
||||
|
||||
n_hf = cfg->sch_config.half_frame_index.value;
|
||||
|
||||
// if SSB periodicity is 5ms, they are transmitted in both half frames
|
||||
if ( cfg->sch_config.ssb_periodicity.value == 5) {
|
||||
if (slot<10)
|
||||
n_hf=0;
|
||||
else
|
||||
n_hf=1;
|
||||
}
|
||||
|
||||
// to set a effective slot number between 0 to 9 in the half frame where the SSB is supposed to be
|
||||
rel_slot = (n_hf)? (slot-10) : slot;
|
||||
|
||||
if(rel_slot<10 && rel_slot>=0)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
int nr_init_frame_parms0(NR_DL_FRAME_PARMS *fp,
|
||||
int mu,
|
||||
@@ -224,6 +250,8 @@ int nr_init_frame_parms0(NR_DL_FRAME_PARMS *fp,
|
||||
fp->slots_per_frame = 10* fp->slots_per_subframe;
|
||||
|
||||
fp->nb_antenna_ports_eNB = 1; // default value until overwritten by RRCConnectionReconfiguration
|
||||
fp->nb_antennas_rx = 1; // default value until overwritten by RRCConnectionReconfiguration
|
||||
fp->nb_antennas_tx = 1; // default value until overwritten by RRCConnectionReconfiguration
|
||||
|
||||
fp->symbols_per_slot = ((Ncp == NORMAL)? 14 : 12); // to redefine for different slot formats
|
||||
fp->samples_per_subframe_wCP = fp->ofdm_symbol_size * fp->symbols_per_slot * fp->slots_per_subframe;
|
||||
@@ -254,7 +282,7 @@ int nr_init_frame_parms(nfapi_nr_config_request_t* config,
|
||||
{
|
||||
|
||||
fp->eutra_band = config->nfapi_config.rf_bands.rf_band[0];
|
||||
fp->frame_type = !(config->subframe_config.duplex_mode.value);
|
||||
fp->frame_type = config->subframe_config.duplex_mode.value;
|
||||
fp->L_ssb = config->sch_config.ssb_scg_position_in_burst.value;
|
||||
return nr_init_frame_parms0(fp,
|
||||
config->subframe_config.numerology_index_mu.value,
|
||||
@@ -286,6 +314,8 @@ void nr_dump_frame_parms(NR_DL_FRAME_PARMS *fp)
|
||||
LOG_I(PHY,"fp->samples_per_frame_wCP=%d\n",fp->samples_per_frame_wCP);
|
||||
LOG_I(PHY,"fp->samples_per_subframe=%d\n",fp->samples_per_subframe);
|
||||
LOG_I(PHY,"fp->samples_per_frame=%d\n",fp->samples_per_frame);
|
||||
LOG_I(PHY,"fp->dl_CarrierFreq=%u\n",fp->dl_CarrierFreq);
|
||||
LOG_I(PHY,"fp->ul_CarrierFreq=%u\n",fp->ul_CarrierFreq);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -378,6 +378,7 @@ void phy_config_request(PHY_Config_t *phy_config);
|
||||
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
|
||||
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
|
||||
int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp, uint8_t i_ssb, uint8_t half_frame_index);
|
||||
int nr_is_ssb_slot(nfapi_nr_config_request_t *cfg, int slot);
|
||||
int nr_init_frame_parms(nfapi_nr_config_request_t *config, NR_DL_FRAME_PARMS *frame_parms);
|
||||
int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms,int mu,int Ncp,int N_RB_DL,int n_ssb_crb,int ssb_subcarrier_offset);
|
||||
int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB,uint8_t abstraction_flag);
|
||||
|
||||
@@ -788,8 +788,9 @@ int16_t lte_ul_freq_offset_estimation(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int16_t Ravg[2];
|
||||
Ravg[0]=0;
|
||||
Ravg[1]=0;
|
||||
int16_t iv, rv, phase_idx;
|
||||
__m128i avg128U1, avg128U2, R[3], mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3;
|
||||
int16_t iv, rv, phase_idx = 0;
|
||||
__m128i avg128U1, avg128U2, R[3], mmtmpD0, mmtmpD1, mmtmpD2, mmtmpD3;
|
||||
|
||||
// round(tan((pi/4)*[1:1:N]/N)*pow2(15))
|
||||
int16_t alpha[128] = {201, 402, 603, 804, 1006, 1207, 1408, 1610, 1811, 2013, 2215, 2417, 2619, 2822, 3024, 3227, 3431, 3634, 3838, 4042, 4246, 4450, 4655, 4861, 5066, 5272, 5479, 5686, 5893, 6101, 6309, 6518, 6727, 6937, 7147, 7358, 7570, 7782, 7995, 8208, 8422, 8637, 8852, 9068, 9285, 9503, 9721, 9940, 10160, 10381, 10603, 10825, 11049, 11273, 11498, 11725, 11952, 12180, 12410, 12640, 12872, 13104, 13338, 13573, 13809, 14046, 14285, 14525, 14766, 15009, 15253, 15498, 15745, 15993, 16243, 16494, 16747, 17001, 17257, 17515, 17774, 18035, 18298, 18563, 18829, 19098, 19368, 19640, 19915, 20191, 20470, 20750, 21033, 21318, 21605, 21895, 22187, 22481, 22778, 23078, 23380, 23685, 23992, 24302, 24615, 24931, 25250, 25572, 25897, 26226, 26557, 26892, 27230, 27572, 27917, 28266, 28618, 28975, 29335, 29699, 30067, 30440, 30817, 31198, 31583, 31973, 32368, 32767};
|
||||
// compute log2_maxh (output_shift)
|
||||
|
||||
@@ -2001,6 +2001,11 @@ void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu
|
||||
ulsch->ue_type = ulsch_pdu->ulsch_pdu_rel13.ue_type;
|
||||
AssertFatal(harq_pid ==0 || ulsch->ue_type == NOCE, "Harq PID is not zero for BL/CE UE\n");
|
||||
|
||||
if(ulsch_pdu->ulsch_pdu_rel13.repetition_number >1) // Fill the Harq process parameters in the first Rep only
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//AssertFatal(ulsch->harq_processes[harq_pid]->nb_rb>0,"nb_rb = 0\n");
|
||||
if(ulsch->harq_processes[harq_pid]->nb_rb == 0) {
|
||||
LOG_E(PHY, "fill_ulsch UE_id %d nb_rb = 0\n", UE_id);
|
||||
@@ -2009,6 +2014,10 @@ void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu
|
||||
ulsch->harq_processes[harq_pid]->frame = frame;
|
||||
ulsch->harq_processes[harq_pid]->subframe = subframe;
|
||||
ulsch->harq_processes[harq_pid]->handled = 0;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
ulsch->harq_processes[harq_pid]->repetition_number = ulsch_pdu->ulsch_pdu_rel13.repetition_number ;
|
||||
ulsch->harq_processes[harq_pid]->total_number_of_repetitions = ulsch_pdu->ulsch_pdu_rel13.total_number_of_repetitions ;
|
||||
#endif
|
||||
ulsch->harq_processes[harq_pid]->first_rb = ulsch_pdu->ulsch_pdu_rel8.resource_block_start;
|
||||
ulsch->harq_processes[harq_pid]->nb_rb = ulsch_pdu->ulsch_pdu_rel8.number_of_resource_blocks;
|
||||
ulsch->harq_processes[harq_pid]->dci_alloc = 1;
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "targets/RT/USER/lte-softmodem.h"
|
||||
#include <syscall.h>
|
||||
#include "executables/thread-common.h"
|
||||
|
||||
//#define DEBUG_DLSCH_CODING
|
||||
//#define DEBUG_DLSCH_FREE 1
|
||||
@@ -57,9 +58,8 @@
|
||||
uint64_t runtime,
|
||||
uint64_t deadline,
|
||||
uint64_t period);*/
|
||||
extern WORKER_CONF_t get_thread_worker_conf(void);
|
||||
extern volatile int oai_exit;
|
||||
|
||||
extern volatile int oai_exit;
|
||||
|
||||
void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch) {
|
||||
int i, r, aa, layer;
|
||||
@@ -99,7 +99,14 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch) {
|
||||
}
|
||||
}
|
||||
|
||||
LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_t Nsoft,unsigned char N_RB_DL, uint8_t abstraction_flag, LTE_DL_FRAME_PARMS *frame_parms) {
|
||||
|
||||
LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,
|
||||
unsigned char Mdlharq,
|
||||
uint32_t Nsoft,
|
||||
unsigned char N_RB_DL,
|
||||
uint8_t abstraction_flag,
|
||||
LTE_DL_FRAME_PARMS *frame_parms)
|
||||
{
|
||||
LTE_eNB_DLSCH_t *dlsch;
|
||||
unsigned char exit_flag = 0,i,j,r,aa,layer;
|
||||
int re;
|
||||
@@ -221,6 +228,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
|
||||
void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch) {
|
||||
unsigned char Mdlharq;
|
||||
unsigned char i,j,r;
|
||||
@@ -257,8 +265,6 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int dlsch_encoding_2threads0(te_params *tep) {
|
||||
LTE_eNB_DLSCH_t *dlsch = tep->dlsch;
|
||||
unsigned int G = tep->G;
|
||||
@@ -358,7 +364,6 @@ void *te_thread(void *param) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
|
||||
unsigned char *a,
|
||||
uint8_t num_pdcch_symbols,
|
||||
@@ -548,6 +553,8 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int dlsch_encoding_all(PHY_VARS_eNB *eNB,
|
||||
unsigned char *a,
|
||||
uint8_t num_pdcch_symbols,
|
||||
@@ -812,10 +819,3 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -118,8 +118,7 @@ uint32_t get_TBS_UL(uint8_t mcs, uint16_t nb_rb) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol) {
|
||||
int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms, uint32_t *rb_alloc, uint8_t mod_order, uint8_t subframe, uint8_t symbol) {
|
||||
int rb,re_pbch_sss=0;
|
||||
int rb_alloc_ind,nsymb;
|
||||
nsymb = (frame_parms->Ncp==NORMAL) ? 14 : 12;
|
||||
@@ -205,7 +204,7 @@ int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_ord
|
||||
return(re_pbch_sss);
|
||||
}
|
||||
|
||||
int adjust_G(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe) {
|
||||
int adjust_G(LTE_DL_FRAME_PARMS *frame_parms, uint32_t *rb_alloc, uint8_t mod_order, uint8_t subframe) {
|
||||
int rb,re_pbch_sss=0;
|
||||
uint8_t rb_alloc_ind;
|
||||
|
||||
@@ -286,7 +285,16 @@ int adjust_G(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_orde
|
||||
return(0);
|
||||
}
|
||||
|
||||
int get_G(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint8_t mod_order,uint8_t Nl,uint8_t num_pdcch_symbols,int frame,uint8_t subframe,uint8_t beamforming_mode) {
|
||||
int get_G(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint16_t nb_rb,
|
||||
uint32_t *rb_alloc,
|
||||
uint8_t mod_order,
|
||||
uint8_t Nl,
|
||||
uint8_t num_pdcch_symbols,
|
||||
int frame,
|
||||
uint8_t subframe,
|
||||
uint8_t beamforming_mode)
|
||||
{
|
||||
int G_adj;
|
||||
|
||||
if (is_pmch_subframe(frame,subframe,frame_parms) == 0) {
|
||||
@@ -319,8 +327,16 @@ int get_G(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int get_G_khz_1dot25(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint8_t mod_order,uint8_t Nl,uint8_t num_pdcch_symbols,int frame,uint8_t subframe,uint8_t beamforming_mode) {
|
||||
int get_G_khz_1dot25(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint16_t nb_rb,
|
||||
uint32_t *rb_alloc,
|
||||
uint8_t mod_order,
|
||||
uint8_t Nl,
|
||||
uint8_t num_pdcch_symbols,
|
||||
int frame,
|
||||
uint8_t subframe,
|
||||
uint8_t beamforming_mode)
|
||||
{
|
||||
//int G_adj;
|
||||
/*if (is_pmch_subframe(frame,subframe,frame_parms) == 0) {
|
||||
G_adj= adjust_G(frame_parms,rb_alloc,mod_order,subframe);
|
||||
@@ -353,13 +369,10 @@ int get_G_khz_1dot25(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb
|
||||
return((int)frame_parms->N_RB_DL * mod_order * 120);
|
||||
}
|
||||
|
||||
|
||||
// following function requires dlsch_tbs_full.h
|
||||
#include "PHY/LTE_TRANSPORT/dlsch_tbs_full.h"
|
||||
|
||||
unsigned char SE2I_TBS(float SE,
|
||||
unsigned char N_PRB,
|
||||
unsigned char symbPerRB) {
|
||||
unsigned char SE2I_TBS(float SE, unsigned char N_PRB, unsigned char symbPerRB) {
|
||||
unsigned char I_TBS= -1;
|
||||
int throughPutGoal = 0;
|
||||
short diffOld = TBStable[0][N_PRB-1] - throughPutGoal; // always positive because of unsigned arithmetic
|
||||
@@ -393,7 +406,6 @@ unsigned char SE2I_TBS(float SE,
|
||||
}
|
||||
|
||||
//added for ALU icic purpose
|
||||
|
||||
uint8_t Get_SB_size(uint8_t n_rb_dl) {
|
||||
if(n_rb_dl<27)
|
||||
return 4;
|
||||
@@ -402,6 +414,4 @@ uint8_t Get_SB_size(uint8_t n_rb_dl) {
|
||||
else
|
||||
return 8;
|
||||
}
|
||||
|
||||
|
||||
//end ALU's algo
|
||||
|
||||
@@ -314,6 +314,12 @@ typedef struct {
|
||||
// int calibration_flag;
|
||||
/// delta_TF for power control
|
||||
int32_t delta_TF;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
// PUSCH Repetition Number for the current SF
|
||||
uint32_t repetition_number ;
|
||||
// PUSCH Total number of repetitions
|
||||
uint32_t total_number_of_repetitions;
|
||||
#endif
|
||||
} LTE_UL_eNB_HARQ_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -553,12 +553,18 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
|
||||
int G = ulsch_harq->G;
|
||||
unsigned int E;
|
||||
decoder_if_t *tc;
|
||||
static int32_t pusch_rep_buffer[3*(6144+64)];
|
||||
int max_Ncb;
|
||||
|
||||
if (llr8_flag == 0)
|
||||
tc = *decoder16;
|
||||
else
|
||||
tc = *decoder8;
|
||||
|
||||
if(ulsch_harq->repetition_number == 1){
|
||||
memset(pusch_rep_buffer,0,(sizeof(int32_t)*3*(6144+64))) ; // reset the buffer every new repetitions
|
||||
}
|
||||
|
||||
for (r=0; r<ulsch_harq->C; r++) {
|
||||
// printf("before subblock deinterleaving c[%d] = %p\n",r,ulsch_harq->c[r]);
|
||||
// Get Turbo interleaver parameters
|
||||
@@ -592,7 +598,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
|
||||
0, //Uplink
|
||||
1,
|
||||
ulsch_harq->rvidx,
|
||||
(ulsch_harq->round==0)?1:0, // clear
|
||||
(ulsch_harq->rvidx==0)?1:0, // clear
|
||||
ulsch_harq->Qm,
|
||||
1,
|
||||
r,
|
||||
@@ -602,6 +608,27 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
|
||||
}
|
||||
|
||||
stop_meas(&eNB->ulsch_rate_unmatching_stats);
|
||||
|
||||
max_Ncb = 3*ulsch_harq->RTC[r]*32 ;
|
||||
|
||||
if(ulsch_harq->total_number_of_repetitions > 1)
|
||||
{
|
||||
if (ulsch_harq->rvidx==1)
|
||||
{ // Store the result of HARQ combining in the last emtc repetitions of sequence 0,2,3,1
|
||||
for (int nn=0;nn<max_Ncb;nn++)
|
||||
{
|
||||
pusch_rep_buffer[nn] += ulsch_harq->w[r][nn] ;
|
||||
}
|
||||
}
|
||||
if (ulsch_harq->repetition_number == ulsch_harq->total_number_of_repetitions)
|
||||
{
|
||||
for (int nn=0;nn<max_Ncb;nn++)
|
||||
{
|
||||
ulsch_harq->w[r][nn] = pusch_rep_buffer[nn] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
r_offset += E;
|
||||
start_meas(&eNB->ulsch_deinterleaving_stats);
|
||||
sub_block_deinterleaving_turbo(4+Kr,
|
||||
|
||||
@@ -120,6 +120,103 @@ void nr_layer_mapping(int16_t **mod_symbs,
|
||||
}
|
||||
}
|
||||
|
||||
void nr_ue_layer_mapping(NR_UE_ULSCH_t **ulsch_ue,
|
||||
uint8_t n_layers,
|
||||
uint16_t n_symbs,
|
||||
int16_t **tx_layers) {
|
||||
|
||||
int16_t *mod_symbs;
|
||||
|
||||
switch (n_layers) {
|
||||
|
||||
case 1:
|
||||
mod_symbs = (int16_t *)ulsch_ue[0]->d_mod;
|
||||
for (int i=0; i<n_symbs; i++){
|
||||
tx_layers[0][i<<1] = (mod_symbs[i<<1]*AMP)>>15;
|
||||
tx_layers[0][(i<<1)+1] = (mod_symbs[(i<<1)+1]*AMP)>>15;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
mod_symbs = (int16_t *)ulsch_ue[0]->d_mod;
|
||||
|
||||
for (int i=0; i<n_symbs/n_layers; i++){
|
||||
for (int l=0; l<n_layers; l++) {
|
||||
tx_layers[l][i<<1] = (mod_symbs[(n_layers*i+l)<<1]*AMP)>>15;
|
||||
tx_layers[l][(i<<1)+1] = (mod_symbs[((n_layers*i+l)<<1)+1]*AMP)>>15;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
mod_symbs = (int16_t *)ulsch_ue[0]->d_mod;
|
||||
|
||||
for (int i=0; i<n_symbs>>1; i++)
|
||||
for (int l=0; l<2; l++) {
|
||||
tx_layers[l][i<<1] = (mod_symbs[((i<<1)+l)<<1]*AMP)>>15;
|
||||
tx_layers[l][(i<<1)+1] = (mod_symbs[(((i<<1)+l)<<1)+1]*AMP)>>15;
|
||||
}
|
||||
|
||||
mod_symbs = (int16_t *)ulsch_ue[1]->d_mod;
|
||||
|
||||
for (int i=0; i<n_symbs/3; i++)
|
||||
for (int l=2; l<5; l++) {
|
||||
tx_layers[l][i<<1] = (mod_symbs[(3*i+l)<<1]*AMP)>>15;
|
||||
tx_layers[l][(i<<1)+1] = (mod_symbs[((3*i+l)<<1)+1]*AMP)>>15;
|
||||
}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
for (int q=0; q<2; q++){
|
||||
|
||||
mod_symbs = (int16_t *)ulsch_ue[q]->d_mod;
|
||||
|
||||
for (int i=0; i<n_symbs/3; i++)
|
||||
for (int l=0; l<3; l++) {
|
||||
tx_layers[l][i<<1] = (mod_symbs[(3*i+l)<<1]*AMP)>>15;
|
||||
tx_layers[l][(i<<1)+1] = (mod_symbs[((3*i+l)<<1)+1]*AMP)>>15;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 7:
|
||||
mod_symbs = (int16_t *)ulsch_ue[1]->d_mod;
|
||||
|
||||
for (int i=0; i<n_symbs/3; i++)
|
||||
for (int l=0; l<3; l++) {
|
||||
tx_layers[l][i<<1] = (mod_symbs[(3*i+l)<<1]*AMP)>>15;
|
||||
tx_layers[l][(i<<1)+1] = (mod_symbs[((3*i+l)<<1)+1]*AMP)>>15;
|
||||
}
|
||||
|
||||
mod_symbs = (int16_t *)ulsch_ue[0]->d_mod;
|
||||
|
||||
for (int i=0; i<n_symbs/4; i++)
|
||||
for (int l=3; l<7; l++) {
|
||||
tx_layers[l][i<<1] = (mod_symbs[((i<<2)+l)<<1]*AMP)>>15;
|
||||
tx_layers[l][(i<<1)+1] = (mod_symbs[(((i<<2)+l)<<1)+1]*AMP)>>15;
|
||||
}
|
||||
break;
|
||||
|
||||
case 8:
|
||||
for (int q=0; q<2; q++){
|
||||
|
||||
mod_symbs = (int16_t *)ulsch_ue[q]->d_mod;
|
||||
|
||||
for (int i=0; i<n_symbs>>2; i++)
|
||||
for (int l=0; l<3; l++) {
|
||||
tx_layers[l][i<<1] = (mod_symbs[((i<<2)+l)<<1]*AMP)>>15;
|
||||
tx_layers[l][(i<<1)+1] = (mod_symbs[(((i<<2)+l)<<1)+1]*AMP)>>15;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(0, "Invalid number of layers %d\n", n_layers);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void nr_dft(int32_t *z, int32_t *d, uint32_t Msc_PUSCH)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <stdint.h>
|
||||
#include "PHY/defs_nr_common.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h"
|
||||
|
||||
#define DMRS_MOD_ORDER 2
|
||||
|
||||
@@ -52,6 +53,18 @@ void nr_layer_mapping(int16_t **mod_symbs,
|
||||
uint16_t n_symbs,
|
||||
int16_t **tx_layers);
|
||||
|
||||
/*! \brief Perform NR layer mapping. TS 38.211 V15.4.0 subclause 7.3.1.3
|
||||
@param[in] ulsch_ue, double Pointer to NR_UE_ULSCH_t struct
|
||||
@param[in] n_layers, number of layers
|
||||
@param[in] n_symbs, number of modulated symbols
|
||||
@param[out] tx_layers, modulated symbols for each layer
|
||||
*/
|
||||
|
||||
void nr_ue_layer_mapping(NR_UE_ULSCH_t **ulsch_ue,
|
||||
uint8_t n_layers,
|
||||
uint16_t n_symbs,
|
||||
int16_t **tx_layers);
|
||||
|
||||
|
||||
/*!
|
||||
\brief This function implements the OFDM front end processor on reception (FEP)
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
#endif*/
|
||||
|
||||
int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
||||
unsigned char symbol,
|
||||
unsigned char Ns,
|
||||
int sample_offset,
|
||||
int no_prefix)
|
||||
unsigned char symbol,
|
||||
unsigned char Ns,
|
||||
int sample_offset,
|
||||
int no_prefix)
|
||||
{
|
||||
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
NR_UE_COMMON *common_vars = &ue->common_vars;
|
||||
@@ -131,8 +131,8 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
// if (ue->frame <100)
|
||||
/*LOG_I(PHY,*/printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, sample_offset %d,rx_offset %d, frame_length_samples %d\n", ue->proc.proc_rxtx[(Ns)&1].frame_rx,Ns, symbol,
|
||||
nb_prefix_samples,nb_prefix_samples0,slot_offset,sample_offset,rx_offset,frame_length_samples);
|
||||
/*LOG_I(PHY,*/printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %u, nb_prefix_samples0 %u, slot_offset %u, sample_offset %d,rx_offset %u, frame_length_samples %u\n",
|
||||
ue->proc.proc_rxtx[(Ns)&1].frame_rx, Ns, symbol, nb_prefix_samples, nb_prefix_samples0, slot_offset, sample_offset, rx_offset, frame_length_samples);
|
||||
#endif
|
||||
|
||||
if (symbol==0) {
|
||||
@@ -192,7 +192,7 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
// if (ue->frame <100)
|
||||
printf("slot_fep: frame %d: symbol %d rx_offset %d\n", ue->proc.proc_rxtx[(Ns)&1].frame_rx, symbol,rx_offset);
|
||||
printf("slot_fep: frame %d: symbol %d rx_offset %u\n", ue->proc.proc_rxtx[(Ns)&1].frame_rx, symbol, rx_offset);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/NR_ESTIMATION/nr_adjust_sync_gNB.c
|
||||
* \brief TA estimation for TA updates
|
||||
* \author Ahmed Hussein
|
||||
* \date 2019
|
||||
* \version 0.1
|
||||
* \company Fraunhofer IIS
|
||||
* \email: ahmed.hussein@iis.fraunhofer.de
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "nr_ul_estimation.h"
|
||||
|
||||
int nr_est_timing_advance_pusch(PHY_VARS_gNB* gNB, int UE_id)
|
||||
{
|
||||
int temp, i, aa, max_pos = 0, max_val = 0;
|
||||
short Re, Im;
|
||||
uint8_t cyclic_shift = 0;
|
||||
|
||||
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||
NR_gNB_PUSCH *gNB_pusch_vars = gNB->pusch_vars[UE_id];
|
||||
int32_t **ul_ch_estimates_time = gNB_pusch_vars->ul_ch_estimates_time;
|
||||
|
||||
int sync_pos = (frame_parms->ofdm_symbol_size - cyclic_shift*frame_parms->ofdm_symbol_size/12) % (frame_parms->ofdm_symbol_size);
|
||||
|
||||
for (i = 0; i < frame_parms->ofdm_symbol_size; i++) {
|
||||
temp = 0;
|
||||
|
||||
for (aa = 0; aa < frame_parms->nb_antennas_rx; aa++) {
|
||||
Re = ((int16_t*)ul_ch_estimates_time[aa])[(i<<1)];
|
||||
Im = ((int16_t*)ul_ch_estimates_time[aa])[1+(i<<1)];
|
||||
temp += (Re*Re/2) + (Im*Im/2);
|
||||
}
|
||||
|
||||
if (temp > max_val) {
|
||||
max_pos = i;
|
||||
max_val = temp;
|
||||
}
|
||||
}
|
||||
|
||||
if (max_pos > frame_parms->ofdm_symbol_size/2)
|
||||
max_pos = max_pos - frame_parms->ofdm_symbol_size;
|
||||
|
||||
|
||||
return max_pos - sync_pos;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,325 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "nr_ul_estimation.h"
|
||||
#include "PHY/NR_REFSIG/nr_refsig.h"
|
||||
#include "PHY/NR_UE_ESTIMATION/filt16a_32.h"
|
||||
|
||||
//#define DEBUG_CH
|
||||
|
||||
|
||||
int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
uint8_t gNB_offset,
|
||||
unsigned char Ns,
|
||||
unsigned short p,
|
||||
unsigned char symbol,
|
||||
unsigned short bwp_start_subcarrier,
|
||||
unsigned short nb_rb_pusch)
|
||||
{
|
||||
int pilot[1320] __attribute__((aligned(16)));
|
||||
unsigned char aarx;
|
||||
unsigned short k;
|
||||
unsigned int pilot_cnt;
|
||||
int16_t ch[2],*pil,*rxF,*ul_ch,*fl,*fm,*fr,*fml,*fmr,*fmm;
|
||||
int ch_offset,symbol_offset, length_dmrs, UE_id = 0;
|
||||
unsigned short n_idDMRS[2] = {0,1}; //to update from pusch config
|
||||
int32_t temp_in_ifft_0[8192*2] __attribute__((aligned(16)));
|
||||
int32_t **ul_ch_estimates_time = gNB->pusch_vars[UE_id]->ul_ch_estimates_time;
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
FILE *debug_ch_est;
|
||||
debug_ch_est = fopen("debug_ch_est.txt","w");
|
||||
#endif
|
||||
|
||||
//uint16_t Nid_cell = (eNB_offset == 0) ? gNB->frame_parms.Nid_cell : gNB->measurements.adj_cell_id[eNB_offset-1];
|
||||
|
||||
uint8_t nushift;
|
||||
int **ul_ch_estimates = gNB->pusch_vars[UE_id]->ul_ch_estimates;
|
||||
int **rxdataF = gNB->common_vars.rxdataF;
|
||||
|
||||
nushift = (p>>1)&1;
|
||||
gNB->frame_parms.nushift = nushift;
|
||||
|
||||
ch_offset = gNB->frame_parms.ofdm_symbol_size*symbol;
|
||||
|
||||
symbol_offset = gNB->frame_parms.ofdm_symbol_size*symbol;
|
||||
|
||||
k = bwp_start_subcarrier;
|
||||
int re_offset = k;
|
||||
|
||||
/*
|
||||
#ifdef DEBUG_CH
|
||||
printf("PUSCH Channel Estimation : gNB_offset %d ch_offset %d, symbol_offset %d OFDM size %d, Ncp=%d, l=%d, Ns=%d, k=%d symbol %d\n", gNB_offset,ch_offset,symbol_offset,gNB->frame_parms.ofdm_symbol_size,
|
||||
gNB->frame_parms.Ncp,l,Ns,k, symbol);
|
||||
#endif
|
||||
*/
|
||||
switch (nushift) {
|
||||
case 0:
|
||||
fl = filt8_l0;
|
||||
fm = filt8_m0;
|
||||
fr = filt8_r0;
|
||||
fmm = filt8_mm0;
|
||||
fml = filt8_m0;
|
||||
fmr = filt8_mr0;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
fl = filt8_l1;
|
||||
fm = filt8_m1;
|
||||
fr = filt8_r1;
|
||||
fmm = filt8_mm1;
|
||||
fml = filt8_ml1;
|
||||
fmr = filt8_m1;
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("pusch_channel_estimation: nushift=%d -> ERROR\n",nushift);
|
||||
return(-1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//------------------generate DMRS------------------//
|
||||
|
||||
length_dmrs = 1; //to update from pusch config
|
||||
|
||||
nr_gold_pusch(gNB, symbol, n_idDMRS, length_dmrs);
|
||||
|
||||
nr_pusch_dmrs_rx(gNB, Ns, gNB->nr_gold_pusch[gNB_offset][Ns][0], &pilot[0], 1000, 0, nb_rb_pusch);
|
||||
|
||||
//------------------------------------------------//
|
||||
|
||||
for (aarx=0; aarx<gNB->frame_parms.nb_antennas_rx; aarx++) {
|
||||
|
||||
pil = (int16_t *)&pilot[0];
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+nushift)];
|
||||
ul_ch = (int16_t *)&ul_ch_estimates[aarx][ch_offset];
|
||||
|
||||
memset(ul_ch,0,4*(gNB->frame_parms.ofdm_symbol_size));
|
||||
|
||||
#ifdef DEBUG_PUSCH
|
||||
printf("ch est pilot addr %p RB_DL %d\n",&pilot[0], gNB->frame_parms.N_RB_DL);
|
||||
printf("k %d, first_carrier %d\n",k,gNB->frame_parms.first_carrier_offset);
|
||||
printf("rxF addr %p p %d\n", rxF,p);
|
||||
printf("ul_ch addr %p nushift %d\n",ul_ch,nushift);
|
||||
#endif
|
||||
//if ((gNB->frame_parms.N_RB_DL&1)==0) {
|
||||
|
||||
// Treat first 2 pilots specially (left edge)
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_PUSCH
|
||||
printf("ch 0 %d\n",((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1]));
|
||||
printf("pilot 0 : rxF - > (%d,%d) addr %p ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],&rxF[0],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("data 0 : rxF - > (%d,%d) addr %p ch -> (%d,%d), pil -> (%d,%d) \n",rxF[2],rxF[3],&rxF[2],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fl,
|
||||
ch,
|
||||
ul_ch,
|
||||
8);
|
||||
pil+=2;
|
||||
re_offset = (re_offset+2)&(gNB->frame_parms.ofdm_symbol_size-1);
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
//for (int i= 0; i<8; i++)
|
||||
//printf("ul_ch addr %p %d\n", ul_ch+i, *(ul_ch+i));
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_PUSCH
|
||||
printf("pilot 1 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fml,
|
||||
ch,
|
||||
ul_ch,
|
||||
8);
|
||||
pil+=2;
|
||||
re_offset = (re_offset+2)&(gNB->frame_parms.ofdm_symbol_size-1);
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
//printf("ul_ch addr %p\n",ul_ch);
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_PUSCH
|
||||
printf("pilot 2 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fmm,
|
||||
ch,
|
||||
ul_ch,
|
||||
8);
|
||||
|
||||
//for (int i= 0; i<16; i++)
|
||||
//printf("ul_ch addr %p %d\n", ul_ch+i, *(ul_ch+i));
|
||||
|
||||
pil+=2;
|
||||
re_offset = (re_offset+2)&(gNB->frame_parms.ofdm_symbol_size-1);
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
ul_ch+=8;
|
||||
|
||||
for (pilot_cnt=3; pilot_cnt<(6*nb_rb_pusch-3); pilot_cnt+=2) {
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
fprintf(debug_ch_est, "pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
//printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fm,
|
||||
ch,
|
||||
ul_ch,
|
||||
8);
|
||||
|
||||
pil+=2;
|
||||
re_offset = (re_offset+2)&(gNB->frame_parms.ofdm_symbol_size-1);
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_PUSCH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fmm,
|
||||
ch,
|
||||
ul_ch,
|
||||
8);
|
||||
pil+=2;
|
||||
re_offset = (re_offset+2)&(gNB->frame_parms.ofdm_symbol_size-1);
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
ul_ch+=8;
|
||||
|
||||
}
|
||||
|
||||
// Treat first 2 pilots specially (right edge)
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_PUSCH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fm,
|
||||
ch,
|
||||
ul_ch,
|
||||
8);
|
||||
|
||||
//for (int i= 0; i<8; i++)
|
||||
//printf("ul_ch addr %p %d\n", ul_ch+i, *(ul_ch+i));
|
||||
|
||||
pil+=2;
|
||||
re_offset = (re_offset+2)&(gNB->frame_parms.ofdm_symbol_size-1);
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_PUSCH
|
||||
printf("ch 0 %d\n",((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1]));
|
||||
printf("pilot %d: rxF - > (%d,%d) addr %p ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],&rxF[0],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fmr,
|
||||
ch,
|
||||
ul_ch,
|
||||
8);
|
||||
|
||||
pil+=2;
|
||||
re_offset = (re_offset+2)&(gNB->frame_parms.ofdm_symbol_size-1);
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
ul_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_PUSCH
|
||||
printf("pilot %d: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fr,
|
||||
ch,
|
||||
ul_ch,
|
||||
8);
|
||||
|
||||
// Convert to time domain
|
||||
memset(temp_in_ifft_0, 0, gNB->frame_parms.ofdm_symbol_size*sizeof(int32_t));
|
||||
memcpy(temp_in_ifft_0, &ul_ch_estimates[aarx][symbol_offset], nb_rb_pusch * NR_NB_SC_PER_RB * sizeof(int32_t));
|
||||
|
||||
switch (gNB->frame_parms.ofdm_symbol_size) {
|
||||
case 128:
|
||||
idft128((int16_t*) temp_in_ifft_0,
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 256:
|
||||
idft256((int16_t*) temp_in_ifft_0,
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 512:
|
||||
idft512((int16_t*) temp_in_ifft_0,
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
idft1024((int16_t*) temp_in_ifft_0,
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
idft1536((int16_t*) temp_in_ifft_0,
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
idft2048((int16_t*) temp_in_ifft_0,
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 4096:
|
||||
idft4096((int16_t*) temp_in_ifft_0,
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 8192:
|
||||
idft8192((int16_t*) temp_in_ifft_0,
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
default:
|
||||
idft512((int16_t*) temp_in_ifft_0,
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
fclose(debug_ch_est);
|
||||
#endif
|
||||
|
||||
return(0);
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef __NR_UL_ESTIMATION_DEFS__H__
|
||||
#define __NR_UL_ESTIMATION_DEFS__H__
|
||||
|
||||
|
||||
#include "PHY/defs_gNB.h"
|
||||
/** @addtogroup _PHY_PARAMETER_ESTIMATION_BLOCKS_
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\brief This function performs channel estimation including frequency interpolation
|
||||
\param gNB Pointer to gNB PHY variables
|
||||
\param Ns slot number (0..19)
|
||||
\param p
|
||||
\param symbol symbol within slot
|
||||
\param bwp_start_subcarrier, first allocated subcarrier
|
||||
\param nb_rb_pusch, number of allocated RBs for this UE
|
||||
*/
|
||||
|
||||
int32_t nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
uint8_t gNB_offset,
|
||||
unsigned char Ns,
|
||||
unsigned short p,
|
||||
unsigned char symbol,
|
||||
unsigned short bwp_start_subcarrier,
|
||||
unsigned short nb_rb_pusch);
|
||||
|
||||
int nr_est_timing_advance_pusch(PHY_VARS_gNB* phy_vars_gNB, int UE_id);
|
||||
|
||||
#endif
|
||||
@@ -36,6 +36,8 @@
|
||||
|
||||
#include "refsig_defs_ue.h"
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "nr_refsig.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
|
||||
/*Table 7.4.1.1.2-1/2 from 38.211 */
|
||||
int wf1[8][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,1}};
|
||||
@@ -48,14 +50,67 @@ short nr_rx_mod_table[14] = {0,0,23170,-23170,-23170,23170,23170,-23170,23170,2
|
||||
short nr_rx_nmod_table[14] = {0,0,-23170,23170,23170,-23170,-23170,23170,-23170,-23170,23170,23170,23170,-23170};
|
||||
|
||||
|
||||
int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB,
|
||||
unsigned int Ns,
|
||||
unsigned int *nr_gold_pusch,
|
||||
int32_t *output,
|
||||
unsigned short p,
|
||||
unsigned char lp,
|
||||
unsigned short nb_pusch_rb)
|
||||
{
|
||||
int8_t w,config_type;
|
||||
short *mod_table;
|
||||
unsigned char idx=0;
|
||||
|
||||
typedef int array_of_w[2];
|
||||
array_of_w *wf;
|
||||
array_of_w *wt;
|
||||
|
||||
config_type = 0; //to be updated by higher layer
|
||||
|
||||
wf = (config_type==0) ? wf1 : wf2;
|
||||
wt = (config_type==0) ? wt1 : wt2;
|
||||
|
||||
if (config_type > 1)
|
||||
LOG_E(PHY,"Bad PUSCH DMRS config type %d\n", config_type);
|
||||
|
||||
if ((p>=1000) && (p<((config_type==0) ? 1008 : 1012))) {
|
||||
if (gNB->frame_parms.Ncp == NORMAL) {
|
||||
|
||||
for (int i=0; i<nb_pusch_rb*((config_type==0) ? 6:4); i++) {
|
||||
|
||||
w = (wf[p-1000][i&1])*(wt[p-1000][lp]);
|
||||
mod_table = (w==1) ? nr_rx_mod_table : nr_rx_nmod_table;
|
||||
|
||||
idx = ((((nr_gold_pusch[(i<<1)>>5])>>((i<<1)&0x1f))&1)<<1) ^ (((nr_gold_pusch[((i<<1)+1)>>5])>>(((i<<1)+1)&0x1f))&1);
|
||||
((int16_t*)output)[i<<1] = mod_table[(NR_MOD_TABLE_QPSK_OFFSET + idx)<<1];
|
||||
((int16_t*)output)[(i<<1)+1] = mod_table[((NR_MOD_TABLE_QPSK_OFFSET + idx)<<1) + 1];
|
||||
#ifdef DEBUG_PUSCH
|
||||
printf("nr_pusch_dmrs_rx dmrs config type %d port %d nb_pusch_rb %d\n", config_type, p, nb_pusch_rb);
|
||||
printf("wf[%d] = %d wt[%d]= %d\n", i&1, wf[p-1000][i&1], lp, wt[p-1000][lp]);
|
||||
printf("i %d idx %d pusch gold %u b0-b1 %d-%d mod_dmrs %d %d\n", i, idx, nr_gold_pusch[(i<<1)>>5], (((nr_gold_pusch[(i<<1)>>5])>>((i<<1)&0x1f))&1),
|
||||
(((nr_gold_pusch[((i<<1)+1)>>5])>>(((i<<1)+1)&0x1f))&1), ((int16_t*)output)[i<<1], ((int16_t*)output)[(i<<1)+1]);
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY,"extended cp not supported for PUSCH DMRS yet\n");
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY,"Illegal p %d PUSCH DMRS port\n",p);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue,
|
||||
unsigned int Ns,
|
||||
unsigned int *nr_gold_pdsch,
|
||||
int32_t *output,
|
||||
unsigned short p,
|
||||
unsigned char lp,
|
||||
unsigned short nb_pdsch_rb)
|
||||
unsigned int Ns,
|
||||
unsigned int *nr_gold_pdsch,
|
||||
int32_t *output,
|
||||
unsigned short p,
|
||||
unsigned char lp,
|
||||
unsigned short nb_pdsch_rb)
|
||||
{
|
||||
int8_t w,config_type;
|
||||
short *mod_table;
|
||||
@@ -101,15 +156,15 @@ int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue,
|
||||
return(0);
|
||||
}
|
||||
|
||||
int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue,
|
||||
uint8_t eNB_offset,
|
||||
unsigned int Ns,
|
||||
unsigned int *nr_gold_pdcch,
|
||||
int32_t *output,
|
||||
unsigned short p,
|
||||
unsigned short nb_rb_coreset)
|
||||
{
|
||||
|
||||
int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue,
|
||||
uint8_t eNB_offset,
|
||||
unsigned int Ns,
|
||||
unsigned int *nr_gold_pdcch,
|
||||
int32_t *output,
|
||||
unsigned short p,
|
||||
unsigned short nb_rb_coreset)
|
||||
{
|
||||
uint8_t idx=0;
|
||||
//uint8_t pdcch_rb_offset =0;
|
||||
//nr_gold_pdcch += ((int)floor(ue->frame_parms.ssb_start_subcarrier/12)+pdcch_rb_offset)*3/32;
|
||||
@@ -121,8 +176,8 @@ int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue,
|
||||
((int16_t*)output)[(i<<1)+1] = nr_rx_mod_table[((NR_MOD_TABLE_QPSK_OFFSET + idx)<<1) + 1];
|
||||
#ifdef DEBUG_PDCCH
|
||||
if (i<8)
|
||||
printf("i %d idx %d pdcch gold %u b0-b1 %d-%d mod_dmrs %d %d\n", i, idx, nr_gold_pdcch[(i<<1)>>5], (((nr_gold_pdcch[(i<<1)>>5])>>((i<<1)&0x1f))&1),
|
||||
(((nr_gold_pdcch[((i<<1)+1)>>5])>>(((i<<1)+1)&0x1f))&1), ((int16_t*)output)[i<<1], ((int16_t*)output)[(i<<1)+1],&output[0]);
|
||||
printf("i %d idx %d pdcch gold %u b0-b1 %d-%d mod_dmrs %d %d addr %p\n", i, idx, nr_gold_pdcch[(i<<1)>>5], (((nr_gold_pdcch[(i<<1)>>5])>>((i<<1)&0x1f))&1),
|
||||
(((nr_gold_pdcch[((i<<1)+1)>>5])>>(((i<<1)+1)&0x1f))&1), ((int16_t*)output)[i<<1], ((int16_t*)output)[(i<<1)+1],&output[0]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -130,7 +185,10 @@ int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue,
|
||||
return(0);
|
||||
}
|
||||
|
||||
int nr_pbch_dmrs_rx(int symbol,unsigned int *nr_gold_pbch,int32_t *output )
|
||||
|
||||
int nr_pbch_dmrs_rx(int symbol,
|
||||
unsigned int *nr_gold_pbch,
|
||||
int32_t *output)
|
||||
{
|
||||
int m,m0,m1;
|
||||
uint8_t idx=0;
|
||||
@@ -164,6 +222,3 @@ int nr_pbch_dmrs_rx(int symbol,unsigned int *nr_gold_pbch,int32_t *output )
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -101,3 +101,59 @@ void nr_init_pdsch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void nr_gold_pusch(PHY_VARS_gNB* gNB, unsigned short lbar,unsigned short *n_idDMRS, unsigned short length_dmrs)
|
||||
{
|
||||
|
||||
unsigned char ns,l;
|
||||
unsigned int n,x1,x2,x2tmp0;
|
||||
int nscid;
|
||||
unsigned int nid;
|
||||
|
||||
/// to be updated from higher layer
|
||||
//unsigned short lbar = 0;
|
||||
|
||||
for (nscid=0; nscid<2; nscid++) {
|
||||
if (n_idDMRS)
|
||||
nid = n_idDMRS[nscid];
|
||||
else
|
||||
nid = gNB->frame_parms.Nid_cell;
|
||||
|
||||
//printf("gold pdsch nid %d lbar %d\n",nid,lbar);
|
||||
|
||||
for (ns=0; ns<20; ns++) {
|
||||
|
||||
for (l=0; l<length_dmrs; l++) {
|
||||
|
||||
x2tmp0 = ((14*ns+(lbar+l)+1)*((nid<<1)+1))<<17;
|
||||
x2 = (x2tmp0+(nid<<1)+nscid)%(1<<31); //cinit
|
||||
|
||||
//printf("ns %d gold pdsch x2 %d\n",ns,x2);
|
||||
|
||||
x1 = 1+ (1<<31);
|
||||
x2=x2 ^ ((x2 ^ (x2>>1) ^ (x2>>2) ^ (x2>>3))<<31);
|
||||
|
||||
// skip first 50 double words (1600 bits)
|
||||
for (n=1; n<50; n++) {
|
||||
x1 = (x1>>1) ^ (x1>>4);
|
||||
x1 = x1 ^ (x1<<31) ^ (x1<<28);
|
||||
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
|
||||
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
|
||||
//printf("x1 : %x, x2 : %x\n",x1,x2);
|
||||
}
|
||||
|
||||
for (n=0; n<NR_MAX_PUSCH_DMRS_INIT_LENGTH_DWORD; n++) {
|
||||
x1 = (x1>>1) ^ (x1>>4);
|
||||
x1 = x1 ^ (x1<<31) ^ (x1<<28);
|
||||
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
|
||||
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
|
||||
gNB->nr_gold_pusch[nscid][ns][l][n] = x1^x2;
|
||||
// if ((ns==2)&&(l==0))
|
||||
//printf("n=%d : c %x\n",n,x1^x2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,4 +39,13 @@ void nr_init_pbch_dmrs(PHY_VARS_gNB* gNB);
|
||||
void nr_init_pdcch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid);
|
||||
void nr_init_pdsch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid);
|
||||
|
||||
void nr_gold_pusch(PHY_VARS_gNB* gNB, unsigned short lbar,unsigned short *n_idDMRS, unsigned short length_dmrs);
|
||||
|
||||
int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB,
|
||||
unsigned int Ns,
|
||||
unsigned int *nr_gold_pusch,
|
||||
int32_t *output,
|
||||
unsigned short p,
|
||||
unsigned char lp,
|
||||
unsigned short nb_pusch_rb);
|
||||
#endif
|
||||
|
||||
@@ -54,7 +54,9 @@
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
int16_t *base_sequence_less_than_36(unsigned int M_ZC, unsigned int u, unsigned int scaling)
|
||||
int16_t *base_sequence_less_than_36(unsigned int M_ZC,
|
||||
unsigned int u,
|
||||
unsigned int scaling)
|
||||
{
|
||||
char *phi_table;
|
||||
int16_t *rv_overbar;
|
||||
@@ -77,7 +79,7 @@ int16_t *base_sequence_less_than_36(unsigned int M_ZC, unsigned int u, unsigned
|
||||
case 30:
|
||||
break;
|
||||
default:
|
||||
printf("function base_sequence_less_than 36_: unsupported base sequence size : %d \n", M_ZC);
|
||||
printf("function base_sequence_less_than 36_: unsupported base sequence size : %u \n", M_ZC);
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
@@ -121,7 +123,10 @@ int16_t *base_sequence_less_than_36(unsigned int M_ZC, unsigned int u, unsigned
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
int16_t *base_sequence_36_or_larger(unsigned int Msc_RS, unsigned int u, unsigned int v, unsigned int scaling)
|
||||
int16_t *base_sequence_36_or_larger(unsigned int Msc_RS,
|
||||
unsigned int u,
|
||||
unsigned int v,
|
||||
unsigned int scaling)
|
||||
{
|
||||
int16_t *rv_overbar;
|
||||
unsigned int N_ZC;
|
||||
|
||||
@@ -138,6 +138,7 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
|
||||
nfapi_nr_config_request_t *cfg = &gNB->gNB_config;
|
||||
NR_gNB_DLSCH_t *dlsch;
|
||||
|
||||
|
||||
uint16_t N_RB = params_rel15->n_RB_BWP;
|
||||
uint8_t fsize=0, pos=0, cand_idx=0;
|
||||
|
||||
@@ -182,12 +183,12 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
|
||||
// Freq domain assignment
|
||||
fsize = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) );
|
||||
pos=fsize;
|
||||
*dci_pdu |= ((pdu_rel15->frequency_domain_assignment&((1<<fsize)-1)) << (dci_alloc->size-pos));
|
||||
*dci_pdu |= ((pdu_rel15->frequency_domain_assignment&((1<<fsize)-1)) << (dci_alloc->size-pos));
|
||||
#ifdef DEBUG_FILL_DCI
|
||||
printf("frequency-domain assignment %d (%d bits)=> %d (0x%lx)\n",pdu_rel15->frequency_domain_assignment,fsize,dci_alloc->size-pos,*dci_pdu);
|
||||
#endif
|
||||
// Time domain assignment
|
||||
pos+=4;
|
||||
pos+=4;
|
||||
*dci_pdu |= (((uint64_t)pdu_rel15->time_domain_assignment&0xf) << (dci_alloc->size-pos));
|
||||
#ifdef DEBUG_FILL_DCI
|
||||
printf("time-domain assignment %d (3 bits)=> %d (0x%lx)\n",pdu_rel15->time_domain_assignment,dci_alloc->size-pos,*dci_pdu);
|
||||
@@ -246,22 +247,22 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
|
||||
// UL/SUL indicator 1 bit
|
||||
pos++;
|
||||
*dci_pdu |= (pdu_rel15->ul_sul_indicator&1)<<(dci_alloc->size-pos);
|
||||
|
||||
|
||||
// SS/PBCH index 6 bits
|
||||
pos+=6;
|
||||
*dci_pdu |= ((pdu_rel15->ss_pbch_index&0x3f)<<(dci_alloc->size-pos));
|
||||
|
||||
|
||||
// prach_mask_index 4 bits
|
||||
pos+=4;
|
||||
*dci_pdu |= ((pdu_rel15->prach_mask_index&0xf)<<(dci_alloc->size-pos));
|
||||
|
||||
|
||||
} //end if
|
||||
|
||||
else {
|
||||
|
||||
// Time domain assignment 4bit
|
||||
|
||||
pos+=4;
|
||||
pos+=4;
|
||||
*dci_pdu |= ((pdu_rel15->time_domain_assignment&0xf) << (dci_alloc->size-pos));
|
||||
#ifdef DEBUG_FILL_DCI
|
||||
printf("Time domain assignment %d (%d bits)=> %d (0x%lx)\n",pdu_rel15->time_domain_assignment,4,dci_alloc->size-pos,*dci_pdu);
|
||||
@@ -286,7 +287,7 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
|
||||
*dci_pdu |= (pdu_rel15->ndi&1)<<(dci_alloc->size-pos);
|
||||
#ifdef DEBUG_FILL_DCI
|
||||
printf("NDI %d (%d bits)=> %d (0x%lx)\n",pdu_rel15->ndi,1,dci_alloc->size-pos,*dci_pdu);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Redundancy version 2bit
|
||||
pos+=2;
|
||||
@@ -334,7 +335,7 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
|
||||
break;
|
||||
|
||||
case NFAPI_NR_RNTI_P:
|
||||
|
||||
|
||||
// Short Messages Indicator – 2 bits
|
||||
for (int i=0; i<2; i++)
|
||||
*dci_pdu |= (((uint64_t)pdu_rel15->short_messages_indicator>>(1-i))&1)<<(dci_alloc->size-pos++);
|
||||
@@ -351,7 +352,7 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
|
||||
// VRB to PRB mapping 1 bit
|
||||
*dci_pdu |= ((uint64_t)pdu_rel15->vrb_to_prb_mapping&1)<<(dci_alloc->size-pos++);
|
||||
// MCS 5 bit
|
||||
for (int i=0; i<5; i++)
|
||||
for (int i=0; i<5; i++)
|
||||
*dci_pdu |= (((uint64_t)pdu_rel15->mcs>>(4-i))&1)<<(dci_alloc->size-pos++);
|
||||
|
||||
// TB scaling 2 bit
|
||||
@@ -360,7 +361,7 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case NFAPI_NR_RNTI_SI:
|
||||
// Freq domain assignment 0-16 bit
|
||||
fsize = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) );
|
||||
@@ -377,9 +378,9 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
|
||||
// Redundancy version 2bit
|
||||
for (int i=0; i<2; i++)
|
||||
*dci_pdu |= (((uint64_t)pdu_rel15->rv>>(1-i))&1)<<(dci_alloc->size-pos++);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case NFAPI_NR_RNTI_TC:
|
||||
// indicating a DL DCI format 1bit
|
||||
*dci_pdu |= ((uint64_t)pdu_rel15->format_indicator&1)<<(dci_alloc->size-pos++);
|
||||
@@ -400,14 +401,14 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
|
||||
// Redundancy version 2bit
|
||||
for (int i=0; i<2; i++)
|
||||
*dci_pdu |= (((uint64_t)pdu_rel15->rv>>(1-i))&1)<<(dci_alloc->size-pos++);
|
||||
// HARQ process number 4bit
|
||||
// HARQ process number 4bit
|
||||
for (int i=0; i<4; i++)
|
||||
*dci_pdu |= (((uint64_t)pdu_rel15->harq_pid>>(3-i))&1)<<(dci_alloc->size-pos++);
|
||||
|
||||
|
||||
// Downlink assignment index – 2 bits
|
||||
for (int i=0; i<2; i++)
|
||||
*dci_pdu |= (((uint64_t)pdu_rel15->dai>>(1-i))&1)<<(dci_alloc->size-pos++);
|
||||
|
||||
|
||||
// TPC command for scheduled PUCCH – 2 bits
|
||||
for (int i=0; i<2; i++)
|
||||
*dci_pdu |= (((uint64_t)pdu_rel15->tpc>>(1-i))&1)<<(dci_alloc->size-pos++);
|
||||
@@ -420,7 +421,7 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
|
||||
// PDSCH-to-HARQ_feedback timing indicator – 3 bits
|
||||
for (int i=0; i<3; i++)
|
||||
*dci_pdu |= (((uint64_t)pdu_rel15->pdsch_to_harq_feedback_timing_indicator>>(2-i))&1)<<(dci_alloc->size-pos++);
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -448,10 +449,10 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
|
||||
// Redundancy version 2bit
|
||||
for (int i=0; i<2; i++)
|
||||
*dci_pdu |= (((uint64_t)pdu_rel15->rv>>(1-i))&1)<<(dci_alloc->size-pos++);
|
||||
// HARQ process number 4bit
|
||||
// HARQ process number 4bit
|
||||
for (int i=0; i<4; i++)
|
||||
*dci_pdu |= (((uint64_t)pdu_rel15->harq_pid>>(3-i))&1)<<(dci_alloc->size-pos++);
|
||||
|
||||
|
||||
// TPC command for scheduled PUSCH – 2 bits
|
||||
for (int i=0; i<2; i++)
|
||||
*dci_pdu |= (((uint64_t)pdu_rel15->tpc>>(1-i))&1)<<(dci_alloc->size-pos++);
|
||||
@@ -463,11 +464,11 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
|
||||
// UL/SUL indicator – 1 bit
|
||||
if (cfg->pucch_config.pucch_GroupHopping.value)
|
||||
*dci_pdu |= ((uint64_t)pdu_rel15->ul_sul_indicator&1)<<(dci_alloc->size-pos++);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case NFAPI_NR_RNTI_TC:
|
||||
|
||||
|
||||
// indicating a DL DCI format 1bit
|
||||
*dci_pdu |= (pdu_rel15->format_indicator&1)<<(dci_alloc->size-pos++);
|
||||
// Freq domain assignment max 16 bit
|
||||
@@ -487,7 +488,7 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
|
||||
// Redundancy version 2bit
|
||||
for (int i=0; i<2; i++)
|
||||
*dci_pdu |= (((uint64_t)pdu_rel15->rv>>(1-i))&1)<<(dci_alloc->size-pos++);
|
||||
// HARQ process number 4bit
|
||||
// HARQ process number 4bit
|
||||
for (int i=0; i<4; i++)
|
||||
*dci_pdu |= (((uint64_t)pdu_rel15->harq_pid>>(3-i))&1)<<(dci_alloc->size-pos++);
|
||||
|
||||
@@ -504,7 +505,7 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
|
||||
*dci_pdu |= ((uint64_t)pdu_rel15->ul_sul_indicator&1)<<(dci_alloc->size-pos++);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch)
|
||||
dlsch->harq_processes[i]->d[r] = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
free16(dlsch->harq_processes[i],sizeof(NR_DL_gNB_HARQ_t));
|
||||
dlsch->harq_processes[i] = NULL;
|
||||
}
|
||||
@@ -103,7 +103,7 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch)
|
||||
|
||||
free16(dlsch,sizeof(NR_gNB_DLSCH_t));
|
||||
dlsch = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -269,10 +269,11 @@ void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch)
|
||||
}
|
||||
}
|
||||
|
||||
int nr_dlsch_encoding(unsigned char *a,int frame,
|
||||
uint8_t slot,
|
||||
NR_gNB_DLSCH_t *dlsch,
|
||||
NR_DL_FRAME_PARMS* frame_parms)
|
||||
int nr_dlsch_encoding(unsigned char *a,
|
||||
int frame,
|
||||
uint8_t slot,
|
||||
NR_gNB_DLSCH_t *dlsch,
|
||||
NR_DL_FRAME_PARMS* frame_parms)
|
||||
{
|
||||
|
||||
unsigned int G;
|
||||
@@ -438,7 +439,7 @@ int nr_dlsch_encoding(unsigned char *a,int frame,
|
||||
}
|
||||
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
printf("Rate Matching, Code segment %d (coded bits (G) %d,unpunctured/repeated bits per code segment %d,mod_order %d, nb_rb %d)...\n",
|
||||
printf("Rate Matching, Code segment %d (coded bits (G) %u, unpunctured/repeated bits per code segment %d, mod_order %d, nb_rb %d)...\n",
|
||||
r,
|
||||
G,
|
||||
Kr*3,
|
||||
|
||||
@@ -65,7 +65,9 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
|
||||
*/
|
||||
void nr_ulsch_extract_rbs_single(int **rxdataF,
|
||||
int **ul_ch_estimates,
|
||||
int **rxdataF_ext,
|
||||
int **ul_ch_estimates_ext,
|
||||
uint32_t rxdataF_ext_offset,
|
||||
// unsigned int *rb_alloc, [hna] Resource Allocation Type 1 is assumed only for the moment
|
||||
unsigned char symbol,
|
||||
@@ -73,6 +75,54 @@ void nr_ulsch_extract_rbs_single(int **rxdataF,
|
||||
unsigned short nb_rb_pusch,
|
||||
NR_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
void nr_ulsch_scale_channel(int32_t **ul_ch_estimates_ext,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
NR_gNB_ULSCH_t **ulsch_gNB,
|
||||
uint8_t symbol,
|
||||
uint8_t start_symbol,
|
||||
uint16_t nb_rb);
|
||||
|
||||
|
||||
/** \brief This function computes the average channel level over all allocated RBs and antennas (TX/RX) in order to compute output shift for compensated signal
|
||||
@param ul_ch_estimates_ext Channel estimates in allocated RBs
|
||||
@param frame_parms Pointer to frame descriptor
|
||||
@param avg Pointer to average signal strength
|
||||
@param pilots_flag Flag to indicate pilots in symbol
|
||||
@param nb_rb Number of allocated RBs
|
||||
*/
|
||||
void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t *avg,
|
||||
uint8_t symbol,
|
||||
uint32_t len,
|
||||
unsigned short nb_rb);
|
||||
|
||||
|
||||
/** \brief This function performs channel compensation (matched filtering) on the received RBs for this allocation. In addition, it computes the squared-magnitude of the channel with weightings for 16QAM/64QAM detection as well as dual-stream detection (cross-correlation)
|
||||
@param rxdataF_ext Frequency-domain received signal in RBs to be demodulated
|
||||
@param ul_ch_estimates_ext Frequency-domain channel estimates in RBs to be demodulated
|
||||
@param ul_ch_mag First Channel magnitudes (16QAM/64QAM)
|
||||
@param ul_ch_magb Second weighted Channel magnitudes (64QAM)
|
||||
@param rxdataF_comp Compensated received waveform
|
||||
@param frame_parms Pointer to frame descriptor
|
||||
@param symbol Symbol on which to operate
|
||||
@param Qm Modulation order of allocation
|
||||
@param nb_rb Number of RBs in allocation
|
||||
@param output_shift Rescaling for compensated output (should be energy-normalizing)
|
||||
*/
|
||||
void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
int **ul_ch_estimates_ext,
|
||||
int **ul_ch_mag,
|
||||
int **ul_ch_magb,
|
||||
int **rxdataF_comp,
|
||||
int **rho,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned char symbol,
|
||||
uint8_t pilots,
|
||||
unsigned char mod_order,
|
||||
unsigned short nb_rb,
|
||||
unsigned char output_shift);
|
||||
|
||||
/*!
|
||||
\brief This function implements the idft transform precoding in PUSCH
|
||||
\param z Pointer to input in frequnecy domain, and it is also the output in time domain
|
||||
@@ -102,6 +152,7 @@ void nr_ulsch_qpsk_llr(int32_t *rxdataF_comp,
|
||||
void nr_ulsch_16qam_llr(int32_t *rxdataF_comp,
|
||||
int32_t **ul_ch_mag,
|
||||
int16_t *ulsch_llr,
|
||||
uint32_t nb_rb,
|
||||
uint32_t nb_re,
|
||||
uint8_t symbol);
|
||||
|
||||
@@ -118,6 +169,7 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp,
|
||||
int32_t **ul_ch_mag,
|
||||
int32_t **ul_ch_magb,
|
||||
int16_t *ulsch_llr,
|
||||
uint32_t nb_rb,
|
||||
uint32_t nb_re,
|
||||
uint8_t symbol);
|
||||
|
||||
@@ -135,6 +187,7 @@ void nr_ulsch_compute_llr(int32_t *rxdataF_comp,
|
||||
int32_t **ul_ch_mag,
|
||||
int32_t **ul_ch_magb,
|
||||
int16_t *ulsch_llr,
|
||||
uint32_t nb_rb,
|
||||
uint32_t nb_re,
|
||||
uint8_t symbol,
|
||||
uint8_t mod_order);
|
||||
@@ -75,7 +75,8 @@ void nr_ulsch_unscrambling(int16_t* llr,
|
||||
|
||||
|
||||
void nr_ulsch_procedures(PHY_VARS_gNB *gNB,
|
||||
gNB_L1_rxtx_proc_t *proc,
|
||||
int frame_rx,
|
||||
int slot_rx,
|
||||
int UE_id,
|
||||
uint8_t harq_pid);
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
//#define DEBUG_ULSCH_DECODING
|
||||
|
||||
#define OAI_UL_LDPC_MAX_NUM_LLR 27000//26112 // NR_LDPC_NCOL_BG1*NR_LDPC_ZMAX = 68*384
|
||||
#define PRINT_CRC_CHECK
|
||||
|
||||
static uint64_t nb_total_decod =0;
|
||||
static uint64_t nb_error_decod =0;
|
||||
@@ -176,96 +177,96 @@ void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch)
|
||||
unsigned char i, j;
|
||||
|
||||
if (ulsch) {
|
||||
ulsch->harq_mask = 0;
|
||||
ulsch->bundling = 0;
|
||||
ulsch->beta_offset_cqi_times8 = 0;
|
||||
ulsch->beta_offset_ri_times8 = 0;
|
||||
ulsch->beta_offset_harqack_times8 = 0;
|
||||
ulsch->Msg3_active = 0;
|
||||
ulsch->Msg3_flag = 0;
|
||||
ulsch->Msg3_subframe = 0;
|
||||
ulsch->Msg3_frame = 0;
|
||||
ulsch->rnti = 0;
|
||||
ulsch->rnti_type = 0;
|
||||
ulsch->cyclicShift = 0;
|
||||
ulsch->cooperation_flag = 0;
|
||||
ulsch->Mlimit = 0;
|
||||
ulsch->max_ldpc_iterations = 0;
|
||||
ulsch->last_iteration_cnt = 0;
|
||||
ulsch->num_active_cba_groups = 0;
|
||||
for (i=0;i<NUM_MAX_CBA_GROUP;i++) ulsch->cba_rnti[i] = 0;
|
||||
for (i=0;i<NR_MAX_SLOTS_PER_FRAME;i++) ulsch->harq_process_id[i] = 0;
|
||||
ulsch->harq_mask = 0;
|
||||
ulsch->bundling = 0;
|
||||
ulsch->beta_offset_cqi_times8 = 0;
|
||||
ulsch->beta_offset_ri_times8 = 0;
|
||||
ulsch->beta_offset_harqack_times8 = 0;
|
||||
ulsch->Msg3_active = 0;
|
||||
ulsch->Msg3_flag = 0;
|
||||
ulsch->Msg3_subframe = 0;
|
||||
ulsch->Msg3_frame = 0;
|
||||
ulsch->rnti = 0;
|
||||
ulsch->rnti_type = 0;
|
||||
ulsch->cyclicShift = 0;
|
||||
ulsch->cooperation_flag = 0;
|
||||
ulsch->Mlimit = 0;
|
||||
ulsch->max_ldpc_iterations = 0;
|
||||
ulsch->last_iteration_cnt = 0;
|
||||
ulsch->num_active_cba_groups = 0;
|
||||
for (i=0;i<NUM_MAX_CBA_GROUP;i++) ulsch->cba_rnti[i] = 0;
|
||||
for (i=0;i<NR_MAX_SLOTS_PER_FRAME;i++) ulsch->harq_process_id[i] = 0;
|
||||
|
||||
for (i=0; i<NR_MAX_ULSCH_HARQ_PROCESSES; i++) {
|
||||
if (ulsch->harq_processes[i]){
|
||||
/// Nfapi ULSCH PDU
|
||||
//nfapi_nr_ul_config_ulsch_pdu ulsch_pdu;
|
||||
ulsch->harq_processes[i]->frame=0;
|
||||
ulsch->harq_processes[i]->subframe=0;
|
||||
ulsch->harq_processes[i]->round=0;
|
||||
ulsch->harq_processes[i]->TPC=0;
|
||||
ulsch->harq_processes[i]->mimo_mode=0;
|
||||
ulsch->harq_processes[i]->dci_alloc=0;
|
||||
ulsch->harq_processes[i]->rar_alloc=0;
|
||||
ulsch->harq_processes[i]->status=0;
|
||||
ulsch->harq_processes[i]->subframe_scheduling_flag=0;
|
||||
ulsch->harq_processes[i]->subframe_cba_scheduling_flag=0;
|
||||
ulsch->harq_processes[i]->phich_active=0;
|
||||
ulsch->harq_processes[i]->phich_ACK=0;
|
||||
ulsch->harq_processes[i]->previous_first_rb=0;
|
||||
ulsch->harq_processes[i]->handled=0;
|
||||
ulsch->harq_processes[i]->delta_TF=0;
|
||||
for (i=0; i<NR_MAX_ULSCH_HARQ_PROCESSES; i++) {
|
||||
if (ulsch->harq_processes[i]){
|
||||
/// Nfapi ULSCH PDU
|
||||
//nfapi_nr_ul_config_ulsch_pdu ulsch_pdu;
|
||||
ulsch->harq_processes[i]->frame=0;
|
||||
ulsch->harq_processes[i]->subframe=0;
|
||||
ulsch->harq_processes[i]->round=0;
|
||||
ulsch->harq_processes[i]->TPC=0;
|
||||
ulsch->harq_processes[i]->mimo_mode=0;
|
||||
ulsch->harq_processes[i]->dci_alloc=0;
|
||||
ulsch->harq_processes[i]->rar_alloc=0;
|
||||
ulsch->harq_processes[i]->status=0;
|
||||
ulsch->harq_processes[i]->subframe_scheduling_flag=0;
|
||||
ulsch->harq_processes[i]->subframe_cba_scheduling_flag=0;
|
||||
ulsch->harq_processes[i]->phich_active=0;
|
||||
ulsch->harq_processes[i]->phich_ACK=0;
|
||||
ulsch->harq_processes[i]->previous_first_rb=0;
|
||||
ulsch->harq_processes[i]->handled=0;
|
||||
ulsch->harq_processes[i]->delta_TF=0;
|
||||
|
||||
ulsch->harq_processes[i]->TBS=0;
|
||||
/// Pointer to the payload (38.212 V15.4.0 section 5.1)
|
||||
//uint8_t *b;
|
||||
ulsch->harq_processes[i]->B=0;
|
||||
/// Pointers to code blocks after code block segmentation and CRC attachment (38.212 V15.4.0 section 5.2.2)
|
||||
//uint8_t *c[MAX_NUM_NR_ULSCH_SEGMENTS];
|
||||
ulsch->harq_processes[i]->K=0;
|
||||
ulsch->harq_processes[i]->F=0;
|
||||
ulsch->harq_processes[i]->C=0;
|
||||
/// Pointers to code blocks after LDPC coding (38.212 V15.4.0 section 5.3.2)
|
||||
//int16_t *d[MAX_NUM_NR_ULSCH_SEGMENTS];
|
||||
/// LDPC processing buffer
|
||||
//t_nrLDPC_procBuf* p_nrLDPC_procBuf[MAX_NUM_NR_ULSCH_SEGMENTS];
|
||||
ulsch->harq_processes[i]->Z=0;
|
||||
/// code blocks after bit selection in rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1)
|
||||
//int16_t e[MAX_NUM_NR_DLSCH_SEGMENTS][3*8448];
|
||||
ulsch->harq_processes[i]->E=0;
|
||||
ulsch->harq_processes[i]->TBS=0;
|
||||
/// Pointer to the payload (38.212 V15.4.0 section 5.1)
|
||||
//uint8_t *b;
|
||||
ulsch->harq_processes[i]->B=0;
|
||||
/// Pointers to code blocks after code block segmentation and CRC attachment (38.212 V15.4.0 section 5.2.2)
|
||||
//uint8_t *c[MAX_NUM_NR_ULSCH_SEGMENTS];
|
||||
ulsch->harq_processes[i]->K=0;
|
||||
ulsch->harq_processes[i]->F=0;
|
||||
ulsch->harq_processes[i]->C=0;
|
||||
/// Pointers to code blocks after LDPC coding (38.212 V15.4.0 section 5.3.2)
|
||||
//int16_t *d[MAX_NUM_NR_ULSCH_SEGMENTS];
|
||||
/// LDPC processing buffer
|
||||
//t_nrLDPC_procBuf* p_nrLDPC_procBuf[MAX_NUM_NR_ULSCH_SEGMENTS];
|
||||
ulsch->harq_processes[i]->Z=0;
|
||||
/// code blocks after bit selection in rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1)
|
||||
//int16_t e[MAX_NUM_NR_DLSCH_SEGMENTS][3*8448];
|
||||
ulsch->harq_processes[i]->E=0;
|
||||
|
||||
|
||||
ulsch->harq_processes[i]->n_DMRS=0;
|
||||
ulsch->harq_processes[i]->n_DMRS2=0;
|
||||
ulsch->harq_processes[i]->previous_n_DMRS=0;
|
||||
ulsch->harq_processes[i]->n_DMRS=0;
|
||||
ulsch->harq_processes[i]->n_DMRS2=0;
|
||||
ulsch->harq_processes[i]->previous_n_DMRS=0;
|
||||
|
||||
|
||||
ulsch->harq_processes[i]->cqi_crc_status=0;
|
||||
for (j=0;j<MAX_CQI_BYTES;j++) ulsch->harq_processes[i]->o[j]=0;
|
||||
ulsch->harq_processes[i]->uci_format=0;
|
||||
ulsch->harq_processes[i]->Or1=0;
|
||||
ulsch->harq_processes[i]->Or2=0;
|
||||
ulsch->harq_processes[i]->o_RI[0]=0; ulsch->harq_processes[i]->o_RI[1]=0;
|
||||
ulsch->harq_processes[i]->O_RI=0;
|
||||
ulsch->harq_processes[i]->o_ACK[0]=0; ulsch->harq_processes[i]->o_ACK[1]=0;
|
||||
ulsch->harq_processes[i]->o_ACK[2]=0; ulsch->harq_processes[i]->o_ACK[3]=0;
|
||||
ulsch->harq_processes[i]->O_ACK=0;
|
||||
ulsch->harq_processes[i]->V_UL_DAI=0;
|
||||
/// "q" sequences for CQI/PMI (for definition see 36-212 V8.6 2009-03, p.27)
|
||||
//int8_t q[MAX_CQI_PAYLOAD];
|
||||
ulsch->harq_processes[i]->o_RCC=0;
|
||||
/// coded and interleaved CQI bits
|
||||
//int8_t o_w[(MAX_CQI_BITS+8)*3];
|
||||
/// coded CQI bits
|
||||
//int8_t o_d[96+((MAX_CQI_BITS+8)*3)];
|
||||
for (j=0;j<MAX_ACK_PAYLOAD;j++) ulsch->harq_processes[i]->q_ACK[j]=0;
|
||||
for (j=0;j<MAX_RI_PAYLOAD;j++) ulsch->harq_processes[i]->q_RI[j]=0;
|
||||
/// Temporary h sequence to flag PUSCH_x/PUSCH_y symbols which are not scrambled
|
||||
//uint8_t h[MAX_NUM_CHANNEL_BITS];
|
||||
/// soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
|
||||
//int16_t w[MAX_NUM_ULSCH_SEGMENTS][3*(6144+64)];
|
||||
}
|
||||
}
|
||||
ulsch->harq_processes[i]->cqi_crc_status=0;
|
||||
for (j=0;j<MAX_CQI_BYTES;j++) ulsch->harq_processes[i]->o[j]=0;
|
||||
ulsch->harq_processes[i]->uci_format=0;
|
||||
ulsch->harq_processes[i]->Or1=0;
|
||||
ulsch->harq_processes[i]->Or2=0;
|
||||
ulsch->harq_processes[i]->o_RI[0]=0; ulsch->harq_processes[i]->o_RI[1]=0;
|
||||
ulsch->harq_processes[i]->O_RI=0;
|
||||
ulsch->harq_processes[i]->o_ACK[0]=0; ulsch->harq_processes[i]->o_ACK[1]=0;
|
||||
ulsch->harq_processes[i]->o_ACK[2]=0; ulsch->harq_processes[i]->o_ACK[3]=0;
|
||||
ulsch->harq_processes[i]->O_ACK=0;
|
||||
ulsch->harq_processes[i]->V_UL_DAI=0;
|
||||
/// "q" sequences for CQI/PMI (for definition see 36-212 V8.6 2009-03, p.27)
|
||||
//int8_t q[MAX_CQI_PAYLOAD];
|
||||
ulsch->harq_processes[i]->o_RCC=0;
|
||||
/// coded and interleaved CQI bits
|
||||
//int8_t o_w[(MAX_CQI_BITS+8)*3];
|
||||
/// coded CQI bits
|
||||
//int8_t o_d[96+((MAX_CQI_BITS+8)*3)];
|
||||
for (j=0;j<MAX_ACK_PAYLOAD;j++) ulsch->harq_processes[i]->q_ACK[j]=0;
|
||||
for (j=0;j<MAX_RI_PAYLOAD;j++) ulsch->harq_processes[i]->q_RI[j]=0;
|
||||
/// Temporary h sequence to flag PUSCH_x/PUSCH_y symbols which are not scrambled
|
||||
//uint8_t h[MAX_NUM_CHANNEL_BITS];
|
||||
/// soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
|
||||
//int16_t w[MAX_NUM_ULSCH_SEGMENTS][3*(6144+64)];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,7 +288,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
uint32_t r,r_offset=0,Kr=8424,Kr_bytes,K_bytes_F,err_flag=0;
|
||||
uint8_t crc_type;
|
||||
int8_t llrProcBuf[OAI_UL_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(32)));
|
||||
|
||||
|
||||
NR_gNB_ULSCH_t *ulsch = phy_vars_gNB->ulsch[UE_id+1][0];
|
||||
NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid];
|
||||
@@ -325,30 +325,52 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
|
||||
if (!ulsch_llr) {
|
||||
printf("ulsch_decoding.c: NULL ulsch_llr pointer\n");
|
||||
return(ulsch->max_ldpc_iterations);
|
||||
return (ulsch->max_ldpc_iterations + 1);
|
||||
}
|
||||
|
||||
if (!harq_process) {
|
||||
printf("ulsch_decoding.c: NULL harq_process pointer\n");
|
||||
return(ulsch->max_ldpc_iterations);
|
||||
return (ulsch->max_ldpc_iterations + 1);
|
||||
}
|
||||
|
||||
if (!frame_parms) {
|
||||
printf("ulsch_decoding.c: NULL frame_parms pointer\n");
|
||||
return(ulsch->max_ldpc_iterations);
|
||||
return (ulsch->max_ldpc_iterations + 1);
|
||||
}
|
||||
|
||||
// harq_process->trials[nfapi_ulsch_pdu_rel15->round]++;
|
||||
harq_process->TBS = nr_compute_tbs(Qm, R, nb_rb, number_symbols, nb_re_dmrs, length_dmrs, n_layers);
|
||||
|
||||
A = harq_process->TBS;
|
||||
ret = ulsch->max_ldpc_iterations;
|
||||
|
||||
G = nr_get_G(nb_rb, number_symbols, nb_re_dmrs, length_dmrs, Qm, n_layers);
|
||||
// G = 0;
|
||||
// G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, nfapi_ulsch_pdu_rel15->Qm, nfapi_ulsch_pdu_rel15->n_layers);
|
||||
ret = ulsch->max_ldpc_iterations + 1;
|
||||
|
||||
LOG_I(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_symb_sch %d nb_rb %d\n",harq_pid,A,G, mcs, n_layers, nb_symb_sch,nb_rb);
|
||||
G = nr_get_G(nb_rb, number_symbols, nb_re_dmrs, length_dmrs, Qm, n_layers);
|
||||
|
||||
LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_symb_sch %d nb_rb %d\n",harq_pid,A,G, mcs, n_layers, nb_symb_sch,nb_rb);
|
||||
|
||||
if (harq_process->round == 0) {
|
||||
|
||||
// This is a new packet, so compute quantities regarding segmentation
|
||||
harq_process->B = A+24;
|
||||
|
||||
// [hna] Perform nr_segmenation with input and output set to NULL to calculate only (B, C, K, Z, F)
|
||||
nr_segmentation(NULL,
|
||||
NULL,
|
||||
harq_process->B,
|
||||
&harq_process->C,
|
||||
&harq_process->K,
|
||||
&harq_process->Z, // [hna] Z is Zc
|
||||
&harq_process->F,
|
||||
p_decParams->BG);
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
printf("ulsch decoding nr segmentation Z %d\n", harq_process->Z);
|
||||
if (!frame%100)
|
||||
printf("K %d C %d Z %d nl %d \n", harq_process->K, harq_process->C, harq_process->Z, harq_process->Nl);
|
||||
#endif
|
||||
}
|
||||
|
||||
p_decParams->Z = harq_process->Z;
|
||||
|
||||
Coderate = (float) A /(float) G;
|
||||
|
||||
@@ -382,30 +404,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
}
|
||||
}
|
||||
|
||||
if (harq_process->round == 0) {
|
||||
|
||||
// This is a new packet, so compute quantities regarding segmentation
|
||||
harq_process->B = A+24;
|
||||
|
||||
// [hna] Perform nr_segmenation with input and output set to NULL to calculate only (B, C, K, Z, F)
|
||||
nr_segmentation(NULL,
|
||||
NULL,
|
||||
harq_process->B,
|
||||
&harq_process->C,
|
||||
&harq_process->K,
|
||||
&harq_process->Z, // [hna] Z is Zc
|
||||
&harq_process->F,
|
||||
p_decParams->BG);
|
||||
|
||||
p_decParams->Z = harq_process->Z;
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
printf("ulsch decoding nr segmentation Z %d\n", p_decParams->Z);
|
||||
if (!frame%100)
|
||||
printf("K %d C %d Z %d nl %d \n", harq_process->K, harq_process->C, p_decParams->Z, harq_process->Nl);
|
||||
#endif
|
||||
}
|
||||
|
||||
p_decParams->numMaxIter = ulsch->max_ldpc_iterations;
|
||||
p_decParams->outMode= 0;
|
||||
|
||||
@@ -427,15 +425,15 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
|
||||
if (harq_process->C > MAX_NUM_NR_ULSCH_SEGMENTS/bw_scaling) {
|
||||
LOG_E(PHY,"Illegal harq_process->C %d > %d\n",harq_process->C,MAX_NUM_NR_ULSCH_SEGMENTS/bw_scaling);
|
||||
return((1+ulsch->max_ldpc_iterations));
|
||||
return (ulsch->max_ldpc_iterations + 1);
|
||||
}
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
printf("Segmentation: C %d, K %d\n",harq_process->C,harq_process->K);
|
||||
#endif
|
||||
|
||||
opp_enabled=1;
|
||||
//opp_enabled=1;
|
||||
|
||||
Kr = harq_process->K; // [hna] overwrites this line "Kr = p_decParams->Z*kb"
|
||||
Kr = harq_process->K;
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
K_bytes_F = Kr_bytes-(harq_process->F>>3);
|
||||
@@ -505,7 +503,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
stop_meas(ulsch_rate_unmatching_stats);
|
||||
#endif
|
||||
LOG_E(PHY,"ulsch_decoding.c: Problem in rate_matching\n");
|
||||
return(ulsch->max_ldpc_iterations);
|
||||
return (ulsch->max_ldpc_iterations + 1);
|
||||
} else {
|
||||
#if gNB_TIMING_TRACE
|
||||
stop_meas(ulsch_rate_unmatching_stats);
|
||||
@@ -581,19 +579,22 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
p_procTime);
|
||||
|
||||
if (check_crc((uint8_t*)llrProcBuf,length_dec,harq_process->F,crc_type)) {
|
||||
#ifdef PRINT_CRC_CHECK
|
||||
LOG_I(PHY, "Segment %d CRC OK\n",r);
|
||||
ret = 2;
|
||||
#endif
|
||||
ret = no_iteration_ldpc;
|
||||
} else {
|
||||
#ifdef PRINT_CRC_CHECK
|
||||
LOG_I(PHY, "CRC NOK\n");
|
||||
ret = 1+ulsch->max_ldpc_iterations;
|
||||
#endif
|
||||
ret = ulsch->max_ldpc_iterations + 1;
|
||||
}
|
||||
|
||||
|
||||
nb_total_decod++;
|
||||
|
||||
if (no_iteration_ldpc > ulsch->max_ldpc_iterations){
|
||||
nb_error_decod++;
|
||||
}
|
||||
|
||||
ret=no_iteration_ldpc;
|
||||
|
||||
for (int m=0; m < Kr>>3; m ++) {
|
||||
harq_process->c[r][m]= (uint8_t) llrProcBuf[m];
|
||||
@@ -612,7 +613,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((err_flag == 0) && (ret>=(1+ulsch->max_ldpc_iterations))) {
|
||||
if ((err_flag == 0) && (ret >= (ulsch->max_ldpc_iterations + 1))) {
|
||||
// a Code segment is in error so break;
|
||||
LOG_D(PHY,"AbsSubframe %d.%d CRC failed, segment %d/%d \n",frame%1024,nr_tti_rx,r,harq_process->C-1);
|
||||
err_flag = 1;
|
||||
@@ -639,7 +640,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
// harq_process->harq_ack.harq_id = harq_pid;
|
||||
// harq_process->harq_ack.send_harq_status = 1;
|
||||
// harq_process->errors[harq_process->round]++;
|
||||
harq_process->round++;
|
||||
//harq_process->round++;
|
||||
|
||||
if (harq_process->round >= ulsch->Mlimit) {
|
||||
harq_process->status = SCH_IDLE;
|
||||
@@ -654,7 +655,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
}
|
||||
|
||||
harq_process->handled = 1;
|
||||
return((1+ulsch->max_ldpc_iterations));
|
||||
return (ulsch->max_ldpc_iterations + 1);
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
@@ -3,8 +3,13 @@
|
||||
#include "nr_transport_proto.h"
|
||||
#include "PHY/impl_defs_top.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_sch_dmrs.h"
|
||||
#include "PHY/NR_ESTIMATION/nr_ul_estimation.h"
|
||||
#include "PHY/defs_nr_common.h"
|
||||
|
||||
//#define DEBUG_CH_COMP
|
||||
//#define DEBUG_RB_EXT
|
||||
//#define DEBUG_CH_MAG
|
||||
|
||||
void nr_idft(uint32_t *z, uint32_t Msc_PUSCH)
|
||||
{
|
||||
|
||||
@@ -216,7 +221,9 @@ void nr_idft(uint32_t *z, uint32_t Msc_PUSCH)
|
||||
}
|
||||
|
||||
void nr_ulsch_extract_rbs_single(int **rxdataF,
|
||||
int **ul_ch_estimates,
|
||||
int **rxdataF_ext,
|
||||
int **ul_ch_estimates_ext,
|
||||
uint32_t rxdataF_ext_offset,
|
||||
// unsigned int *rb_alloc, [hna] Resource Allocation Type 1 is assumed only for the moment
|
||||
unsigned char symbol,
|
||||
@@ -227,12 +234,22 @@ void nr_ulsch_extract_rbs_single(int **rxdataF,
|
||||
unsigned short start_re, re, nb_re_pusch;
|
||||
unsigned char aarx, is_dmrs_symbol = 0;
|
||||
uint32_t rxF_ext_index = 0;
|
||||
uint32_t ul_ch0_ext_index = 0;
|
||||
uint32_t ul_ch0_index = 0;
|
||||
|
||||
int16_t *rxF,*rxF_ext;
|
||||
int *ul_ch0,*ul_ch0_ext;
|
||||
|
||||
#ifdef DEBUG_RB_EXT
|
||||
|
||||
printf("--------------------symbol = %d-----------------------\n", symbol);
|
||||
printf("--------------------ch_ext_index = %d-----------------------\n", symbol*NR_NB_SC_PER_RB * nb_rb_pusch);
|
||||
|
||||
#endif
|
||||
|
||||
is_dmrs_symbol = (symbol == 2) ? 1 : 0; //to be updated from config
|
||||
|
||||
start_re = frame_parms->first_carrier_offset + (start_rb * NR_NB_SC_PER_RB);
|
||||
start_re = (frame_parms->first_carrier_offset + (start_rb * NR_NB_SC_PER_RB))%frame_parms->ofdm_symbol_size;
|
||||
|
||||
nb_re_pusch = NR_NB_SC_PER_RB * nb_rb_pusch;
|
||||
|
||||
@@ -241,19 +258,710 @@ void nr_ulsch_extract_rbs_single(int **rxdataF,
|
||||
rxF = (int16_t *)&rxdataF[aarx][symbol * frame_parms->ofdm_symbol_size];
|
||||
rxF_ext = (int16_t *)&rxdataF_ext[aarx][symbol * nb_re_pusch]; // [hna] rxdataF_ext isn't contiguous in order to solve an alignment problem ib llr computation in case of mod_order = 4, 6
|
||||
|
||||
ul_ch0 = &ul_ch_estimates[aarx][(2*(frame_parms->ofdm_symbol_size))]; // DMRS REs are only in symbol 2 (to be updated from config)
|
||||
ul_ch0_ext = &ul_ch_estimates_ext[aarx][symbol*nb_re_pusch];
|
||||
|
||||
for (re = 0; re < nb_re_pusch; re++) {
|
||||
|
||||
if ( (is_dmrs_symbol && ((re&1) != 0)) || (is_dmrs_symbol == 0) ) { // [hna] (re&1) != frame_parms->nushift) assuming only dmrs type 1 and mapping type A
|
||||
// frame_parms->nushift should be initialized with 0
|
||||
rxF_ext[rxF_ext_index] = (rxF[ ((start_re + re)*2) % (frame_parms->ofdm_symbol_size*2)]);
|
||||
rxF_ext[rxF_ext_index + 1] = (rxF[(((start_re + re)*2) + 1) % (frame_parms->ofdm_symbol_size*2)]);
|
||||
ul_ch0_ext[ul_ch0_ext_index] = ul_ch0[ul_ch0_index];
|
||||
|
||||
#ifdef DEBUG_RB_EXT
|
||||
printf("rxF_ext[%d] = %d\n", rxF_ext_index, rxF_ext[rxF_ext_index]);
|
||||
printf("rxF_ext[%d] = %d\n", rxF_ext_index+1, rxF_ext[rxF_ext_index+1]);
|
||||
printf("ul_ch0_ext[%d] = %d\n", 2*ul_ch0_ext_index, ((int16_t *)ul_ch0_ext)[2*ul_ch0_ext_index]);
|
||||
printf("ul_ch0_ext[%d] = %d\n", 2*ul_ch0_ext_index + 1, ((int16_t *)ul_ch0_ext)[2*ul_ch0_ext_index + 1]);
|
||||
#endif
|
||||
|
||||
rxF_ext_index = rxF_ext_index + 2;
|
||||
ul_ch0_ext_index++;
|
||||
}
|
||||
ul_ch0_index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void nr_ulsch_scale_channel(int **ul_ch_estimates_ext,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
NR_gNB_ULSCH_t **ulsch_gNB,
|
||||
uint8_t symbol,
|
||||
uint8_t pilots,
|
||||
unsigned short nb_rb)
|
||||
{
|
||||
|
||||
#if defined(__x86_64__)||defined(__i386__)
|
||||
|
||||
short rb, ch_amp;
|
||||
unsigned char aatx,aarx;
|
||||
__m128i *ul_ch128, ch_amp128;
|
||||
|
||||
// Determine scaling amplitude based the symbol
|
||||
|
||||
ch_amp = 1024*8; //((pilots) ? (ulsch_gNB[0]->sqrt_rho_b) : (ulsch_gNB[0]->sqrt_rho_a));
|
||||
|
||||
LOG_D(PHY,"Scaling PUSCH Chest in OFDM symbol %d by %d, pilots %d nb_rb %d NCP %d symbol %d\n", symbol, ch_amp, pilots, nb_rb, frame_parms->Ncp, symbol);
|
||||
// printf("Scaling PUSCH Chest in OFDM symbol %d by %d\n",symbol_mod,ch_amp);
|
||||
|
||||
ch_amp128 = _mm_set1_epi16(ch_amp); // Q3.13
|
||||
|
||||
for (aatx=0; aatx < frame_parms->nb_antenna_ports_eNB; aatx++) {
|
||||
for (aarx=0; aarx < frame_parms->nb_antennas_rx; aarx++) {
|
||||
|
||||
ul_ch128 = (__m128i *)&ul_ch_estimates_ext[aarx][symbol*nb_rb*NR_NB_SC_PER_RB];
|
||||
|
||||
if (pilots==1){
|
||||
nb_rb = nb_rb>>1;
|
||||
}
|
||||
|
||||
|
||||
for (rb=0;rb<nb_rb;rb++) {
|
||||
|
||||
ul_ch128[0] = _mm_mulhi_epi16(ul_ch128[0], ch_amp128);
|
||||
ul_ch128[0] = _mm_slli_epi16(ul_ch128[0], 3);
|
||||
|
||||
ul_ch128[1] = _mm_mulhi_epi16(ul_ch128[1], ch_amp128);
|
||||
ul_ch128[1] = _mm_slli_epi16(ul_ch128[1], 3);
|
||||
|
||||
if (pilots) {
|
||||
ul_ch128+=2;
|
||||
} else {
|
||||
ul_ch128[2] = _mm_mulhi_epi16(ul_ch128[2], ch_amp128);
|
||||
ul_ch128[2] = _mm_slli_epi16(ul_ch128[2], 3);
|
||||
ul_ch128+=3;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//compute average channel_level on each (TX,RX) antenna pair
|
||||
void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t *avg,
|
||||
uint8_t symbol,
|
||||
uint32_t len,
|
||||
unsigned short nb_rb)
|
||||
{
|
||||
|
||||
#if defined(__x86_64__)||defined(__i386__)
|
||||
|
||||
short rb;
|
||||
unsigned char aatx, aarx;
|
||||
__m128i *ul_ch128, avg128U;
|
||||
|
||||
int16_t x = factor2(len);
|
||||
int16_t y = (len)>>x;
|
||||
|
||||
for (aatx = 0; aatx < frame_parms->nb_antennas_tx; aatx++)
|
||||
for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
|
||||
//clear average level
|
||||
avg128U = _mm_setzero_si128();
|
||||
|
||||
ul_ch128=(__m128i *)&ul_ch_estimates_ext[(aatx<<1)+aarx][symbol*nb_rb*12];
|
||||
|
||||
for (rb = 0; rb < nb_rb; rb++) {
|
||||
avg128U = _mm_add_epi32(avg128U, _mm_srai_epi32(_mm_madd_epi16(ul_ch128[0], ul_ch128[0]), x));
|
||||
avg128U = _mm_add_epi32(avg128U, _mm_srai_epi32(_mm_madd_epi16(ul_ch128[1], ul_ch128[1]), x));
|
||||
avg128U = _mm_add_epi32(avg128U, _mm_srai_epi32(_mm_madd_epi16(ul_ch128[2], ul_ch128[2]), x));
|
||||
ul_ch128+=3;
|
||||
}
|
||||
|
||||
avg[(aatx<<1)+aarx] = (((int32_t*)&avg128U)[0] +
|
||||
((int32_t*)&avg128U)[1] +
|
||||
((int32_t*)&avg128U)[2] +
|
||||
((int32_t*)&avg128U)[3] ) / y;
|
||||
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
#elif defined(__arm__)
|
||||
|
||||
short rb;
|
||||
unsigned char aatx, aarx, nre = 12, symbol_mod;
|
||||
int32x4_t avg128U;
|
||||
int16x4_t *ul_ch128;
|
||||
|
||||
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
|
||||
|
||||
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++)
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
//clear average level
|
||||
avg128U = vdupq_n_s32(0);
|
||||
// 5 is always a symbol with no pilots for both normal and extended prefix
|
||||
|
||||
ul_ch128 = (int16x4_t *)&ul_ch_estimates_ext[(aatx<<1)+aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
|
||||
for (rb = 0; rb < nb_rb; rb++) {
|
||||
// printf("rb %d : ",rb);
|
||||
// print_shorts("ch",&ul_ch128[0]);
|
||||
avg128U = vqaddq_s32(avg128U, vmull_s16(ul_ch128[0], ul_ch128[0]));
|
||||
avg128U = vqaddq_s32(avg128U, vmull_s16(ul_ch128[1], ul_ch128[1]));
|
||||
avg128U = vqaddq_s32(avg128U, vmull_s16(ul_ch128[2], ul_ch128[2]));
|
||||
avg128U = vqaddq_s32(avg128U, vmull_s16(ul_ch128[3], ul_ch128[3]));
|
||||
|
||||
if (((symbol_mod == 0) || (symbol_mod == (frame_parms->Ncp-1)))&&(frame_parms->nb_antenna_ports_eNB!=1)) {
|
||||
ul_ch128+=4;
|
||||
} else {
|
||||
avg128U = vqaddq_s32(avg128U, vmull_s16(ul_ch128[4], ul_ch128[4]));
|
||||
avg128U = vqaddq_s32(avg128U, vmull_s16(ul_ch128[5], ul_ch128[5]));
|
||||
ul_ch128+=6;
|
||||
}
|
||||
|
||||
/*
|
||||
if (rb==0) {
|
||||
print_shorts("ul_ch128",&ul_ch128[0]);
|
||||
print_shorts("ul_ch128",&ul_ch128[1]);
|
||||
print_shorts("ul_ch128",&ul_ch128[2]);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
if (symbol==2) //assume start symbol 2
|
||||
nre=6;
|
||||
else
|
||||
nre=12;
|
||||
|
||||
avg[(aatx<<1)+aarx] = (((int32_t*)&avg128U)[0] +
|
||||
((int32_t*)&avg128U)[1] +
|
||||
((int32_t*)&avg128U)[2] +
|
||||
((int32_t*)&avg128U)[3] ) / (nb_rb*nre);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
int **ul_ch_estimates_ext,
|
||||
int **ul_ch_mag,
|
||||
int **ul_ch_magb,
|
||||
int **rxdataF_comp,
|
||||
int **rho,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned char symbol,
|
||||
uint8_t pilots,
|
||||
unsigned char mod_order,
|
||||
unsigned short nb_rb,
|
||||
unsigned char output_shift)
|
||||
{
|
||||
|
||||
#ifdef DEBUG_CH_COMP
|
||||
int16_t *rxF, *ul_ch;
|
||||
int prnt_idx;
|
||||
|
||||
|
||||
rxF = (int16_t *)&rxdataF_ext[0][(symbol*nb_rb*12)];
|
||||
ul_ch = (int16_t *)&ul_ch_estimates_ext[0][symbol*nb_rb*12];
|
||||
|
||||
printf("--------------------symbol = %d, mod_order = %d, output_shift = %d-----------------------\n", symbol, mod_order, output_shift);
|
||||
printf("----------------Before compansation------------------\n");
|
||||
|
||||
for (prnt_idx=0;prnt_idx<12*nb_rb*2;prnt_idx++){
|
||||
|
||||
printf("rxF[%d] = %d\n", prnt_idx, rxF[prnt_idx]);
|
||||
printf("ul_ch[%d] = %d\n", prnt_idx, ul_ch[prnt_idx]);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_CH_MAG
|
||||
int16_t *ch_mag;
|
||||
int print_idx;
|
||||
|
||||
|
||||
ch_mag = (int16_t *)&ul_ch_mag[0][(symbol*nb_rb*12)];
|
||||
|
||||
printf("--------------------symbol = %d, mod_order = %d-----------------------\n", symbol, mod_order);
|
||||
printf("----------------Before computation------------------\n");
|
||||
|
||||
for (print_idx=0;print_idx<50;print_idx++){
|
||||
|
||||
printf("ch_mag[%d] = %d\n", print_idx, ch_mag[print_idx]);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__i386) || defined(__x86_64)
|
||||
|
||||
unsigned short rb;
|
||||
unsigned char aatx,aarx;
|
||||
__m128i *ul_ch128,*ul_ch128_2,*ul_ch_mag128,*ul_ch_mag128b,*rxdataF128,*rxdataF_comp128,*rho128;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b;
|
||||
QAM_amp128b = _mm_setzero_si128();
|
||||
|
||||
for (aatx=0; aatx<frame_parms->nb_antennas_tx; aatx++) {
|
||||
|
||||
if (mod_order == 4) {
|
||||
QAM_amp128 = _mm_set1_epi16(QAM16_n1); // 2/sqrt(10)
|
||||
QAM_amp128b = _mm_setzero_si128();
|
||||
} else if (mod_order == 6) {
|
||||
QAM_amp128 = _mm_set1_epi16(QAM64_n1); //
|
||||
QAM_amp128b = _mm_set1_epi16(QAM64_n2);
|
||||
}
|
||||
|
||||
// printf("comp: rxdataF_comp %p, symbol %d\n",rxdataF_comp[0],symbol);
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
|
||||
ul_ch128 = (__m128i *)&ul_ch_estimates_ext[(aatx<<1)+aarx][symbol*nb_rb*12];
|
||||
ul_ch_mag128 = (__m128i *)&ul_ch_mag[(aatx<<1)+aarx][symbol*nb_rb*12];
|
||||
ul_ch_mag128b = (__m128i *)&ul_ch_magb[(aatx<<1)+aarx][symbol*nb_rb*12];
|
||||
rxdataF128 = (__m128i *)&rxdataF_ext[aarx][symbol*nb_rb*12];
|
||||
rxdataF_comp128 = (__m128i *)&rxdataF_comp[(aatx<<1)+aarx][symbol*nb_rb*12];
|
||||
|
||||
|
||||
for (rb=0; rb<nb_rb; rb++) {
|
||||
if (mod_order>2) {
|
||||
// get channel amplitude if not QPSK
|
||||
|
||||
//print_shorts("ch:",(int16_t*)&ul_ch128[0]);
|
||||
|
||||
mmtmpD0 = _mm_madd_epi16(ul_ch128[0],ul_ch128[0]);
|
||||
mmtmpD0 = _mm_srai_epi32(mmtmpD0,output_shift);
|
||||
|
||||
mmtmpD1 = _mm_madd_epi16(ul_ch128[1],ul_ch128[1]);
|
||||
mmtmpD1 = _mm_srai_epi32(mmtmpD1,output_shift);
|
||||
|
||||
mmtmpD0 = _mm_packs_epi32(mmtmpD0,mmtmpD1);
|
||||
|
||||
// store channel magnitude here in a new field of ulsch
|
||||
|
||||
ul_ch_mag128[0] = _mm_unpacklo_epi16(mmtmpD0,mmtmpD0);
|
||||
ul_ch_mag128b[0] = ul_ch_mag128[0];
|
||||
ul_ch_mag128[0] = _mm_mulhi_epi16(ul_ch_mag128[0],QAM_amp128);
|
||||
ul_ch_mag128[0] = _mm_slli_epi16(ul_ch_mag128[0],1);
|
||||
|
||||
// print_ints("ch: = ",(int32_t*)&mmtmpD0);
|
||||
// print_shorts("QAM_amp:",(int16_t*)&QAM_amp128);
|
||||
// print_shorts("mag:",(int16_t*)&ul_ch_mag128[0]);
|
||||
|
||||
ul_ch_mag128[1] = _mm_unpackhi_epi16(mmtmpD0,mmtmpD0);
|
||||
ul_ch_mag128b[1] = ul_ch_mag128[1];
|
||||
ul_ch_mag128[1] = _mm_mulhi_epi16(ul_ch_mag128[1],QAM_amp128);
|
||||
ul_ch_mag128[1] = _mm_slli_epi16(ul_ch_mag128[1],1);
|
||||
|
||||
if (pilots==0) {
|
||||
mmtmpD0 = _mm_madd_epi16(ul_ch128[2],ul_ch128[2]);
|
||||
mmtmpD0 = _mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = _mm_packs_epi32(mmtmpD0,mmtmpD0);
|
||||
|
||||
ul_ch_mag128[2] = _mm_unpacklo_epi16(mmtmpD1,mmtmpD1);
|
||||
ul_ch_mag128b[2] = ul_ch_mag128[2];
|
||||
|
||||
ul_ch_mag128[2] = _mm_mulhi_epi16(ul_ch_mag128[2],QAM_amp128);
|
||||
ul_ch_mag128[2] = _mm_slli_epi16(ul_ch_mag128[2],1);
|
||||
}
|
||||
|
||||
ul_ch_mag128b[0] = _mm_mulhi_epi16(ul_ch_mag128b[0],QAM_amp128b);
|
||||
ul_ch_mag128b[0] = _mm_slli_epi16(ul_ch_mag128b[0],1);
|
||||
|
||||
|
||||
ul_ch_mag128b[1] = _mm_mulhi_epi16(ul_ch_mag128b[1],QAM_amp128b);
|
||||
ul_ch_mag128b[1] = _mm_slli_epi16(ul_ch_mag128b[1],1);
|
||||
|
||||
if (pilots==0) {
|
||||
ul_ch_mag128b[2] = _mm_mulhi_epi16(ul_ch_mag128b[2],QAM_amp128b);
|
||||
ul_ch_mag128b[2] = _mm_slli_epi16(ul_ch_mag128b[2],1);
|
||||
}
|
||||
}
|
||||
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = _mm_madd_epi16(ul_ch128[0],rxdataF128[0]);
|
||||
// print_ints("re",&mmtmpD0);
|
||||
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = _mm_shufflelo_epi16(ul_ch128[0],_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = _mm_shufflehi_epi16(mmtmpD1,_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = _mm_sign_epi16(mmtmpD1,*(__m128i*)&conjugate[0]);
|
||||
// print_ints("im",&mmtmpD1);
|
||||
mmtmpD1 = _mm_madd_epi16(mmtmpD1,rxdataF128[0]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = _mm_srai_epi32(mmtmpD0,output_shift);
|
||||
// print_ints("re(shift)",&mmtmpD0);
|
||||
mmtmpD1 = _mm_srai_epi32(mmtmpD1,output_shift);
|
||||
// print_ints("im(shift)",&mmtmpD1);
|
||||
mmtmpD2 = _mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
// print_ints("c0",&mmtmpD2);
|
||||
// print_ints("c1",&mmtmpD3);
|
||||
rxdataF_comp128[0] = _mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128);
|
||||
// print_shorts("ch:",ul_ch128);
|
||||
// print_shorts("pack:",rxdataF_comp128);
|
||||
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = _mm_madd_epi16(ul_ch128[1],rxdataF128[1]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = _mm_shufflelo_epi16(ul_ch128[1],_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = _mm_shufflehi_epi16(mmtmpD1,_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = _mm_sign_epi16(mmtmpD1,*(__m128i*)conjugate);
|
||||
mmtmpD1 = _mm_madd_epi16(mmtmpD1,rxdataF128[1]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = _mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = _mm_srai_epi32(mmtmpD1,output_shift);
|
||||
mmtmpD2 = _mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
|
||||
rxdataF_comp128[1] = _mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128+1);
|
||||
// print_shorts("ch:",ul_ch128+1);
|
||||
// print_shorts("pack:",rxdataF_comp128+1);
|
||||
|
||||
if (pilots==0) {
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = _mm_madd_epi16(ul_ch128[2],rxdataF128[2]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = _mm_shufflelo_epi16(ul_ch128[2],_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = _mm_shufflehi_epi16(mmtmpD1,_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = _mm_sign_epi16(mmtmpD1,*(__m128i*)conjugate);
|
||||
mmtmpD1 = _mm_madd_epi16(mmtmpD1,rxdataF128[2]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = _mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = _mm_srai_epi32(mmtmpD1,output_shift);
|
||||
mmtmpD2 = _mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
|
||||
rxdataF_comp128[2] = _mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128+2);
|
||||
// print_shorts("ch:",ul_ch128+2);
|
||||
// print_shorts("pack:",rxdataF_comp128+2);
|
||||
|
||||
ul_ch128+=3;
|
||||
ul_ch_mag128+=3;
|
||||
ul_ch_mag128b+=3;
|
||||
rxdataF128+=3;
|
||||
rxdataF_comp128+=3;
|
||||
} else { // we have a smaller PUSCH in symbols with pilots so skip last group of 4 REs and increment less
|
||||
ul_ch128+=2;
|
||||
ul_ch_mag128+=2;
|
||||
ul_ch_mag128b+=2;
|
||||
rxdataF128+=2;
|
||||
rxdataF_comp128+=2;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rho) {
|
||||
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
rho128 = (__m128i *)&rho[aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
ul_ch128 = (__m128i *)&ul_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
ul_ch128_2 = (__m128i *)&ul_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
|
||||
for (rb=0; rb<nb_rb; rb++) {
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = _mm_madd_epi16(ul_ch128[0],ul_ch128_2[0]);
|
||||
// print_ints("re",&mmtmpD0);
|
||||
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = _mm_shufflelo_epi16(ul_ch128[0],_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = _mm_shufflehi_epi16(mmtmpD1,_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = _mm_sign_epi16(mmtmpD1,*(__m128i*)&conjugate[0]);
|
||||
// print_ints("im",&mmtmpD1);
|
||||
mmtmpD1 = _mm_madd_epi16(mmtmpD1,ul_ch128_2[0]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = _mm_srai_epi32(mmtmpD0,output_shift);
|
||||
// print_ints("re(shift)",&mmtmpD0);
|
||||
mmtmpD1 = _mm_srai_epi32(mmtmpD1,output_shift);
|
||||
// print_ints("im(shift)",&mmtmpD1);
|
||||
mmtmpD2 = _mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
// print_ints("c0",&mmtmpD2);
|
||||
// print_ints("c1",&mmtmpD3);
|
||||
rho128[0] = _mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
|
||||
//print_shorts("rx:",ul_ch128_2);
|
||||
//print_shorts("ch:",ul_ch128);
|
||||
//print_shorts("pack:",rho128);
|
||||
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = _mm_madd_epi16(ul_ch128[1],ul_ch128_2[1]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = _mm_shufflelo_epi16(ul_ch128[1],_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = _mm_shufflehi_epi16(mmtmpD1,_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = _mm_sign_epi16(mmtmpD1,*(__m128i*)conjugate);
|
||||
mmtmpD1 = _mm_madd_epi16(mmtmpD1,ul_ch128_2[1]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = _mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = _mm_srai_epi32(mmtmpD1,output_shift);
|
||||
mmtmpD2 = _mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
|
||||
|
||||
rho128[1] =_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
//print_shorts("rx:",ul_ch128_2+1);
|
||||
//print_shorts("ch:",ul_ch128+1);
|
||||
//print_shorts("pack:",rho128+1);
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = _mm_madd_epi16(ul_ch128[2],ul_ch128_2[2]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = _mm_shufflelo_epi16(ul_ch128[2],_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = _mm_shufflehi_epi16(mmtmpD1,_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = _mm_sign_epi16(mmtmpD1,*(__m128i*)conjugate);
|
||||
mmtmpD1 = _mm_madd_epi16(mmtmpD1,ul_ch128_2[2]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = _mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = _mm_srai_epi32(mmtmpD1,output_shift);
|
||||
mmtmpD2 = _mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
|
||||
rho128[2] = _mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
//print_shorts("rx:",ul_ch128_2+2);
|
||||
//print_shorts("ch:",ul_ch128+2);
|
||||
//print_shorts("pack:",rho128+2);
|
||||
|
||||
ul_ch128+=3;
|
||||
ul_ch128_2+=3;
|
||||
rho128+=3;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
#elif defined(__arm__)
|
||||
|
||||
|
||||
unsigned short rb;
|
||||
unsigned char aatx,aarx,symbol_mod,pilots=0;
|
||||
|
||||
int16x4_t *ul_ch128,*ul_ch128_2,*rxdataF128;
|
||||
int32x4_t mmtmpD0,mmtmpD1,mmtmpD0b,mmtmpD1b;
|
||||
int16x8_t *ul_ch_mag128,*ul_ch_mag128b,mmtmpD2,mmtmpD3,mmtmpD4;
|
||||
int16x8_t QAM_amp128,QAM_amp128b;
|
||||
int16x4x2_t *rxdataF_comp128,*rho128;
|
||||
|
||||
int16_t conj[4]__attribute__((aligned(16))) = {1,-1,1,-1};
|
||||
int32x4_t output_shift128 = vmovq_n_s32(-(int32_t)output_shift);
|
||||
|
||||
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
|
||||
|
||||
if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp))) {
|
||||
if (frame_parms->nb_antenna_ports_eNB==1) { // 10 out of 12 so don't reduce size
|
||||
nb_rb=1+(5*nb_rb/6);
|
||||
}
|
||||
else {
|
||||
pilots=1;
|
||||
}
|
||||
}
|
||||
|
||||
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) {
|
||||
if (mod_order == 4) {
|
||||
QAM_amp128 = vmovq_n_s16(QAM16_n1); // 2/sqrt(10)
|
||||
QAM_amp128b = vmovq_n_s16(0);
|
||||
} else if (mod_order == 6) {
|
||||
QAM_amp128 = vmovq_n_s16(QAM64_n1); //
|
||||
QAM_amp128b = vmovq_n_s16(QAM64_n2);
|
||||
}
|
||||
// printf("comp: rxdataF_comp %p, symbol %d\n",rxdataF_comp[0],symbol);
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
ul_ch128 = (int16x4_t*)&ul_ch_estimates_ext[(aatx<<1)+aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
ul_ch_mag128 = (int16x8_t*)&ul_ch_mag[(aatx<<1)+aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
ul_ch_mag128b = (int16x8_t*)&ul_ch_magb[(aatx<<1)+aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
rxdataF128 = (int16x4_t*)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
rxdataF_comp128 = (int16x4x2_t*)&rxdataF_comp[(aatx<<1)+aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
|
||||
for (rb=0; rb<nb_rb; rb++) {
|
||||
if (mod_order>2) {
|
||||
// get channel amplitude if not QPSK
|
||||
mmtmpD0 = vmull_s16(ul_ch128[0], ul_ch128[0]);
|
||||
// mmtmpD0 = [ch0*ch0,ch1*ch1,ch2*ch2,ch3*ch3];
|
||||
mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),output_shift128);
|
||||
// mmtmpD0 = [ch0*ch0 + ch1*ch1,ch0*ch0 + ch1*ch1,ch2*ch2 + ch3*ch3,ch2*ch2 + ch3*ch3]>>output_shift128 on 32-bits
|
||||
mmtmpD1 = vmull_s16(ul_ch128[1], ul_ch128[1]);
|
||||
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),output_shift128);
|
||||
mmtmpD2 = vcombine_s16(vmovn_s32(mmtmpD0),vmovn_s32(mmtmpD1));
|
||||
// mmtmpD2 = [ch0*ch0 + ch1*ch1,ch0*ch0 + ch1*ch1,ch2*ch2 + ch3*ch3,ch2*ch2 + ch3*ch3,ch4*ch4 + ch5*ch5,ch4*ch4 + ch5*ch5,ch6*ch6 + ch7*ch7,ch6*ch6 + ch7*ch7]>>output_shift128 on 16-bits
|
||||
mmtmpD0 = vmull_s16(ul_ch128[2], ul_ch128[2]);
|
||||
mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),output_shift128);
|
||||
mmtmpD1 = vmull_s16(ul_ch128[3], ul_ch128[3]);
|
||||
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),output_shift128);
|
||||
mmtmpD3 = vcombine_s16(vmovn_s32(mmtmpD0),vmovn_s32(mmtmpD1));
|
||||
if (pilots==0) {
|
||||
mmtmpD0 = vmull_s16(ul_ch128[4], ul_ch128[4]);
|
||||
mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),output_shift128);
|
||||
mmtmpD1 = vmull_s16(ul_ch128[5], ul_ch128[5]);
|
||||
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),output_shift128);
|
||||
mmtmpD4 = vcombine_s16(vmovn_s32(mmtmpD0),vmovn_s32(mmtmpD1));
|
||||
}
|
||||
|
||||
ul_ch_mag128b[0] = vqdmulhq_s16(mmtmpD2,QAM_amp128b);
|
||||
ul_ch_mag128b[1] = vqdmulhq_s16(mmtmpD3,QAM_amp128b);
|
||||
ul_ch_mag128[0] = vqdmulhq_s16(mmtmpD2,QAM_amp128);
|
||||
ul_ch_mag128[1] = vqdmulhq_s16(mmtmpD3,QAM_amp128);
|
||||
|
||||
if (pilots==0) {
|
||||
ul_ch_mag128b[2] = vqdmulhq_s16(mmtmpD4,QAM_amp128b);
|
||||
ul_ch_mag128[2] = vqdmulhq_s16(mmtmpD4,QAM_amp128);
|
||||
}
|
||||
}
|
||||
|
||||
mmtmpD0 = vmull_s16(ul_ch128[0], rxdataF128[0]);
|
||||
//mmtmpD0 = [Re(ch[0])Re(rx[0]) Im(ch[0])Im(ch[0]) Re(ch[1])Re(rx[1]) Im(ch[1])Im(ch[1])]
|
||||
mmtmpD1 = vmull_s16(ul_ch128[1], rxdataF128[1]);
|
||||
//mmtmpD1 = [Re(ch[2])Re(rx[2]) Im(ch[2])Im(ch[2]) Re(ch[3])Re(rx[3]) Im(ch[3])Im(ch[3])]
|
||||
mmtmpD0 = vcombine_s32(vpadd_s32(vget_low_s32(mmtmpD0),vget_high_s32(mmtmpD0)),
|
||||
vpadd_s32(vget_low_s32(mmtmpD1),vget_high_s32(mmtmpD1)));
|
||||
//mmtmpD0 = [Re(ch[0])Re(rx[0])+Im(ch[0])Im(ch[0]) Re(ch[1])Re(rx[1])+Im(ch[1])Im(ch[1]) Re(ch[2])Re(rx[2])+Im(ch[2])Im(ch[2]) Re(ch[3])Re(rx[3])+Im(ch[3])Im(ch[3])]
|
||||
|
||||
mmtmpD0b = vmull_s16(vrev32_s16(vmul_s16(ul_ch128[0],*(int16x4_t*)conj)), rxdataF128[0]);
|
||||
//mmtmpD0 = [-Im(ch[0])Re(rx[0]) Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1]) Re(ch[1])Im(rx[1])]
|
||||
mmtmpD1b = vmull_s16(vrev32_s16(vmul_s16(ul_ch128[1],*(int16x4_t*)conj)), rxdataF128[1]);
|
||||
//mmtmpD0 = [-Im(ch[2])Re(rx[2]) Re(ch[2])Im(rx[2]) -Im(ch[3])Re(rx[3]) Re(ch[3])Im(rx[3])]
|
||||
mmtmpD1 = vcombine_s32(vpadd_s32(vget_low_s32(mmtmpD0b),vget_high_s32(mmtmpD0b)),
|
||||
vpadd_s32(vget_low_s32(mmtmpD1b),vget_high_s32(mmtmpD1b)));
|
||||
//mmtmpD1 = [-Im(ch[0])Re(rx[0])+Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1])+Re(ch[1])Im(rx[1]) -Im(ch[2])Re(rx[2])+Re(ch[2])Im(rx[2]) -Im(ch[3])Re(rx[3])+Re(ch[3])Im(rx[3])]
|
||||
|
||||
mmtmpD0 = vqshlq_s32(mmtmpD0,output_shift128);
|
||||
mmtmpD1 = vqshlq_s32(mmtmpD1,output_shift128);
|
||||
rxdataF_comp128[0] = vzip_s16(vmovn_s32(mmtmpD0),vmovn_s32(mmtmpD1));
|
||||
mmtmpD0 = vmull_s16(ul_ch128[2], rxdataF128[2]);
|
||||
mmtmpD1 = vmull_s16(ul_ch128[3], rxdataF128[3]);
|
||||
mmtmpD0 = vcombine_s32(vpadd_s32(vget_low_s32(mmtmpD0),vget_high_s32(mmtmpD0)),
|
||||
vpadd_s32(vget_low_s32(mmtmpD1),vget_high_s32(mmtmpD1)));
|
||||
mmtmpD0b = vmull_s16(vrev32_s16(vmul_s16(ul_ch128[2],*(int16x4_t*)conj)), rxdataF128[2]);
|
||||
mmtmpD1b = vmull_s16(vrev32_s16(vmul_s16(ul_ch128[3],*(int16x4_t*)conj)), rxdataF128[3]);
|
||||
mmtmpD1 = vcombine_s32(vpadd_s32(vget_low_s32(mmtmpD0b),vget_high_s32(mmtmpD0b)),
|
||||
vpadd_s32(vget_low_s32(mmtmpD1b),vget_high_s32(mmtmpD1b)));
|
||||
mmtmpD0 = vqshlq_s32(mmtmpD0,output_shift128);
|
||||
mmtmpD1 = vqshlq_s32(mmtmpD1,output_shift128);
|
||||
rxdataF_comp128[1] = vzip_s16(vmovn_s32(mmtmpD0),vmovn_s32(mmtmpD1));
|
||||
|
||||
if (pilots==0) {
|
||||
mmtmpD0 = vmull_s16(ul_ch128[4], rxdataF128[4]);
|
||||
mmtmpD1 = vmull_s16(ul_ch128[5], rxdataF128[5]);
|
||||
mmtmpD0 = vcombine_s32(vpadd_s32(vget_low_s32(mmtmpD0),vget_high_s32(mmtmpD0)),
|
||||
vpadd_s32(vget_low_s32(mmtmpD1),vget_high_s32(mmtmpD1)));
|
||||
|
||||
mmtmpD0b = vmull_s16(vrev32_s16(vmul_s16(ul_ch128[4],*(int16x4_t*)conj)), rxdataF128[4]);
|
||||
mmtmpD1b = vmull_s16(vrev32_s16(vmul_s16(ul_ch128[5],*(int16x4_t*)conj)), rxdataF128[5]);
|
||||
mmtmpD1 = vcombine_s32(vpadd_s32(vget_low_s32(mmtmpD0b),vget_high_s32(mmtmpD0b)),
|
||||
vpadd_s32(vget_low_s32(mmtmpD1b),vget_high_s32(mmtmpD1b)));
|
||||
|
||||
|
||||
mmtmpD0 = vqshlq_s32(mmtmpD0,output_shift128);
|
||||
mmtmpD1 = vqshlq_s32(mmtmpD1,output_shift128);
|
||||
rxdataF_comp128[2] = vzip_s16(vmovn_s32(mmtmpD0),vmovn_s32(mmtmpD1));
|
||||
|
||||
|
||||
ul_ch128+=6;
|
||||
ul_ch_mag128+=3;
|
||||
ul_ch_mag128b+=3;
|
||||
rxdataF128+=6;
|
||||
rxdataF_comp128+=3;
|
||||
|
||||
} else { // we have a smaller PUSCH in symbols with pilots so skip last group of 4 REs and increment less
|
||||
ul_ch128+=4;
|
||||
ul_ch_mag128+=2;
|
||||
ul_ch_mag128b+=2;
|
||||
rxdataF128+=4;
|
||||
rxdataF_comp128+=2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rho) {
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
rho128 = (int16x4x2_t*)&rho[aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
ul_ch128 = (int16x4_t*)&ul_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
ul_ch128_2 = (int16x4_t*)&ul_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
for (rb=0; rb<nb_rb; rb++) {
|
||||
mmtmpD0 = vmull_s16(ul_ch128[0], ul_ch128_2[0]);
|
||||
mmtmpD1 = vmull_s16(ul_ch128[1], ul_ch128_2[1]);
|
||||
mmtmpD0 = vcombine_s32(vpadd_s32(vget_low_s32(mmtmpD0),vget_high_s32(mmtmpD0)),
|
||||
vpadd_s32(vget_low_s32(mmtmpD1),vget_high_s32(mmtmpD1)));
|
||||
mmtmpD0b = vmull_s16(vrev32_s16(vmul_s16(ul_ch128[0],*(int16x4_t*)conj)), ul_ch128_2[0]);
|
||||
mmtmpD1b = vmull_s16(vrev32_s16(vmul_s16(ul_ch128[1],*(int16x4_t*)conj)), ul_ch128_2[1]);
|
||||
mmtmpD1 = vcombine_s32(vpadd_s32(vget_low_s32(mmtmpD0b),vget_high_s32(mmtmpD0b)),
|
||||
vpadd_s32(vget_low_s32(mmtmpD1b),vget_high_s32(mmtmpD1b)));
|
||||
|
||||
mmtmpD0 = vqshlq_s32(mmtmpD0,output_shift128);
|
||||
mmtmpD1 = vqshlq_s32(mmtmpD1,output_shift128);
|
||||
rho128[0] = vzip_s16(vmovn_s32(mmtmpD0),vmovn_s32(mmtmpD1));
|
||||
|
||||
mmtmpD0 = vmull_s16(ul_ch128[2], ul_ch128_2[2]);
|
||||
mmtmpD1 = vmull_s16(ul_ch128[3], ul_ch128_2[3]);
|
||||
mmtmpD0 = vcombine_s32(vpadd_s32(vget_low_s32(mmtmpD0),vget_high_s32(mmtmpD0)),
|
||||
vpadd_s32(vget_low_s32(mmtmpD1),vget_high_s32(mmtmpD1)));
|
||||
mmtmpD0b = vmull_s16(vrev32_s16(vmul_s16(ul_ch128[2],*(int16x4_t*)conj)), ul_ch128_2[2]);
|
||||
mmtmpD1b = vmull_s16(vrev32_s16(vmul_s16(ul_ch128[3],*(int16x4_t*)conj)), ul_ch128_2[3]);
|
||||
mmtmpD1 = vcombine_s32(vpadd_s32(vget_low_s32(mmtmpD0b),vget_high_s32(mmtmpD0b)),
|
||||
vpadd_s32(vget_low_s32(mmtmpD1b),vget_high_s32(mmtmpD1b)));
|
||||
|
||||
mmtmpD0 = vqshlq_s32(mmtmpD0,output_shift128);
|
||||
mmtmpD1 = vqshlq_s32(mmtmpD1,output_shift128);
|
||||
rho128[1] = vzip_s16(vmovn_s32(mmtmpD0),vmovn_s32(mmtmpD1));
|
||||
|
||||
mmtmpD0 = vmull_s16(ul_ch128[0], ul_ch128_2[0]);
|
||||
mmtmpD1 = vmull_s16(ul_ch128[1], ul_ch128_2[1]);
|
||||
mmtmpD0 = vcombine_s32(vpadd_s32(vget_low_s32(mmtmpD0),vget_high_s32(mmtmpD0)),
|
||||
vpadd_s32(vget_low_s32(mmtmpD1),vget_high_s32(mmtmpD1)));
|
||||
mmtmpD0b = vmull_s16(vrev32_s16(vmul_s16(ul_ch128[4],*(int16x4_t*)conj)), ul_ch128_2[4]);
|
||||
mmtmpD1b = vmull_s16(vrev32_s16(vmul_s16(ul_ch128[5],*(int16x4_t*)conj)), ul_ch128_2[5]);
|
||||
mmtmpD1 = vcombine_s32(vpadd_s32(vget_low_s32(mmtmpD0b),vget_high_s32(mmtmpD0b)),
|
||||
vpadd_s32(vget_low_s32(mmtmpD1b),vget_high_s32(mmtmpD1b)));
|
||||
|
||||
mmtmpD0 = vqshlq_s32(mmtmpD0,output_shift128);
|
||||
mmtmpD1 = vqshlq_s32(mmtmpD1,output_shift128);
|
||||
rho128[2] = vzip_s16(vmovn_s32(mmtmpD0),vmovn_s32(mmtmpD1));
|
||||
|
||||
|
||||
ul_ch128+=6;
|
||||
ul_ch128_2+=6;
|
||||
rho128+=3;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef DEBUG_CH_COMP
|
||||
|
||||
rxF = (int16_t *)&rxdataF_comp[0][(symbol*nb_rb*12)];
|
||||
|
||||
printf("----------------After compansation------------------\n");
|
||||
|
||||
for (prnt_idx=0;prnt_idx<12*nb_rb*2;prnt_idx++){
|
||||
|
||||
printf("rxF[%d] = %d\n", prnt_idx, rxF[prnt_idx]);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_CH_MAG
|
||||
|
||||
|
||||
ch_mag = (int16_t *)&ul_ch_mag[0][(symbol*nb_rb*12)];
|
||||
|
||||
printf("----------------After computation------------------\n");
|
||||
|
||||
for (print_idx=0;print_idx<12*nb_rb*2;print_idx++){
|
||||
|
||||
printf("ch_mag[%d] = %d\n", print_idx, ch_mag[print_idx]);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
uint8_t UE_id,
|
||||
@@ -263,24 +971,52 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
unsigned char harq_pid)
|
||||
{
|
||||
|
||||
uint8_t first_symbol_flag, aarx, aatx, pilots; // pilots, a flag to indicate DMRS REs in current symbol
|
||||
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||
nfapi_nr_ul_config_ulsch_pdu_rel15_t *rel15_ul = &gNB->ulsch[UE_id+1][0]->harq_processes[harq_pid]->ulsch_pdu.ulsch_pdu_rel15;
|
||||
uint32_t nb_re_pusch;
|
||||
|
||||
if(symbol == rel15_ul->start_symbol)
|
||||
gNB->pusch_vars[UE_id]->rxdataF_ext_offset = 0;
|
||||
uint32_t nb_re_pusch, bwp_start_subcarrier;
|
||||
int avgs;
|
||||
int avg[4];
|
||||
|
||||
if (symbol == 2) // [hna] here it is assumed that symbol 2 carries 6 DMRS REs (dmrs-type 1)
|
||||
pilots = 0;
|
||||
first_symbol_flag = 0;
|
||||
|
||||
if(symbol == rel15_ul->start_symbol){
|
||||
gNB->pusch_vars[UE_id]->rxdataF_ext_offset = 0;
|
||||
first_symbol_flag = 1;
|
||||
}
|
||||
|
||||
if (symbol == 2){ // [hna] here it is assumed that symbol 2 carries 6 DMRS REs (dmrs-type 1)
|
||||
nb_re_pusch = rel15_ul->number_rbs * 6;
|
||||
else
|
||||
pilots = 1;
|
||||
} else {
|
||||
nb_re_pusch = rel15_ul->number_rbs * NR_NB_SC_PER_RB;
|
||||
pilots = 0;
|
||||
}
|
||||
|
||||
bwp_start_subcarrier = (rel15_ul->start_rb*NR_NB_SC_PER_RB + frame_parms->first_carrier_offset) % frame_parms->ofdm_symbol_size;
|
||||
|
||||
//----------------------------------------------------------
|
||||
//--------------------- Channel estimation ---------------------
|
||||
//----------------------------------------------------------
|
||||
|
||||
if (pilots == 1)
|
||||
nr_pusch_channel_estimation(gNB,
|
||||
0,
|
||||
nr_tti_rx,
|
||||
0, // p
|
||||
symbol,
|
||||
bwp_start_subcarrier,
|
||||
rel15_ul->number_rbs);
|
||||
|
||||
//----------------------------------------------------------
|
||||
//--------------------- RBs extraction ---------------------
|
||||
//----------------------------------------------------------
|
||||
|
||||
nr_ulsch_extract_rbs_single(gNB->common_vars.rxdataF,
|
||||
gNB->pusch_vars[UE_id]->ul_ch_estimates,
|
||||
gNB->pusch_vars[UE_id]->rxdataF_ext,
|
||||
gNB->pusch_vars[UE_id]->ul_ch_estimates_ext,
|
||||
gNB->pusch_vars[UE_id]->rxdataF_ext_offset,
|
||||
// rb_alloc, [hna] Resource Allocation Type 1 is assumed only for the moment
|
||||
symbol,
|
||||
@@ -288,6 +1024,44 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
rel15_ul->number_rbs,
|
||||
frame_parms);
|
||||
|
||||
nr_ulsch_scale_channel(gNB->pusch_vars[UE_id]->ul_ch_estimates_ext,
|
||||
frame_parms,
|
||||
gNB->ulsch[UE_id+1],
|
||||
symbol,
|
||||
pilots,
|
||||
rel15_ul->number_rbs);
|
||||
|
||||
if (first_symbol_flag==1) {
|
||||
|
||||
nr_ulsch_channel_level(gNB->pusch_vars[UE_id]->ul_ch_estimates_ext,
|
||||
frame_parms,
|
||||
avg,
|
||||
symbol,
|
||||
nb_re_pusch,
|
||||
rel15_ul->number_rbs);
|
||||
avgs = 0;
|
||||
|
||||
for (aatx=0;aatx<frame_parms->nb_antennas_tx;aatx++)
|
||||
for (aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++)
|
||||
avgs = cmax(avgs,avg[(aatx<<1)+aarx]);
|
||||
|
||||
gNB->pusch_vars[UE_id]->log2_maxh = (log2_approx(avgs)/2)+1;
|
||||
|
||||
}
|
||||
|
||||
nr_ulsch_channel_compensation(gNB->pusch_vars[UE_id]->rxdataF_ext,
|
||||
gNB->pusch_vars[UE_id]->ul_ch_estimates_ext,
|
||||
gNB->pusch_vars[UE_id]->ul_ch_mag0,
|
||||
gNB->pusch_vars[UE_id]->ul_ch_magb0,
|
||||
gNB->pusch_vars[UE_id]->rxdataF_comp,
|
||||
(frame_parms->nb_antennas_tx>1) ? gNB->pusch_vars[UE_id]->rho : NULL,
|
||||
frame_parms,
|
||||
symbol,
|
||||
pilots,
|
||||
rel15_ul->Qm,
|
||||
rel15_ul->number_rbs,
|
||||
gNB->pusch_vars[UE_id]->log2_maxh);
|
||||
|
||||
#ifdef NR_SC_FDMA
|
||||
nr_idft(&((uint32_t*)gNB->pusch_vars[UE_id]->rxdataF_ext[0])[symbol * rel15_ul->number_rbs * NR_NB_SC_PER_RB], nb_re_pusch);
|
||||
#endif
|
||||
@@ -296,14 +1070,15 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
//-------------------- LLRs computation --------------------
|
||||
//----------------------------------------------------------
|
||||
|
||||
nr_ulsch_compute_llr(&gNB->pusch_vars[UE_id]->rxdataF_ext[0][symbol * rel15_ul->number_rbs * NR_NB_SC_PER_RB],
|
||||
gNB->pusch_vars[UE_id]->ul_ch_mag,
|
||||
gNB->pusch_vars[UE_id]->ul_ch_magb,
|
||||
nr_ulsch_compute_llr(&gNB->pusch_vars[UE_id]->rxdataF_comp[0][symbol * rel15_ul->number_rbs * NR_NB_SC_PER_RB],
|
||||
gNB->pusch_vars[UE_id]->ul_ch_mag0,
|
||||
gNB->pusch_vars[UE_id]->ul_ch_magb0,
|
||||
&gNB->pusch_vars[UE_id]->llr[gNB->pusch_vars[UE_id]->rxdataF_ext_offset * rel15_ul->Qm],
|
||||
rel15_ul->number_rbs,
|
||||
nb_re_pusch,
|
||||
symbol,
|
||||
rel15_ul->Qm);
|
||||
|
||||
|
||||
gNB->pusch_vars[UE_id]->rxdataF_ext_offset = gNB->pusch_vars[UE_id]->rxdataF_ext_offset + nb_re_pusch;
|
||||
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
* \warning
|
||||
*/
|
||||
|
||||
|
||||
#include "PHY/defs_nr_common.h"
|
||||
#include "PHY/sse_intrin.h"
|
||||
#include "PHY/impl_defs_top.h"
|
||||
@@ -71,23 +70,20 @@ void nr_ulsch_qpsk_llr(int32_t *rxdataF_comp,
|
||||
void nr_ulsch_16qam_llr(int32_t *rxdataF_comp,
|
||||
int32_t **ul_ch_mag,
|
||||
int16_t *ulsch_llr,
|
||||
uint32_t nb_rb,
|
||||
uint32_t nb_re,
|
||||
uint8_t symbol)
|
||||
{
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *rxF = (__m128i*)rxdataF_comp;
|
||||
// __m128i *ch_mag; // [hna] This should be uncommented once channel estimation is implemented
|
||||
__m128i *ch_mag;
|
||||
__m128i llr128[2];
|
||||
uint32_t *llr32;
|
||||
|
||||
// [hna] temp_channel and one_over_sqrt_2 are for temporary use until channel estimation is implemented
|
||||
// else ul_ch_mag and ul_ch_magb should be used after channel estimation has benn implemented
|
||||
__m128i temp_channel;
|
||||
int16_t one_over_sqrt_2 = 23170;
|
||||
|
||||
#elif defined(__arm__)
|
||||
int16x8_t *rxF = (int16x8_t*)&rxdataF_comp;
|
||||
// int16x8_t *ch_mag; // [hna] This should be uncommented once channel estimation is implemented
|
||||
int16x8_t *ch_mag;
|
||||
int16x8_t xmm0;
|
||||
int16_t *llr16;
|
||||
#endif
|
||||
@@ -103,21 +99,16 @@ void nr_ulsch_16qam_llr(int32_t *rxdataF_comp,
|
||||
llr16 = (int16_t*)ulsch_llr;
|
||||
#endif
|
||||
|
||||
// [hna] This should be uncommented once channel estimation is implemented
|
||||
// ------------------------------------------------------------
|
||||
// #if defined(__x86_64__) || defined(__i386__)
|
||||
// ch_mag = (__m128i*)&ul_ch_mag[0][(symbol*nb_rb*12)];
|
||||
// #elif defined(__arm__)
|
||||
// ch_mag = (int16x8_t*)&ul_ch_mag[0][(symbol*nb_rb*12)];
|
||||
// #endif
|
||||
// ------------------------------------------------------------
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
ch_mag = (__m128i*)&ul_ch_mag[0][(symbol*nb_rb*12)];
|
||||
#elif defined(__arm__)
|
||||
ch_mag = (int16x8_t*)&ul_ch_mag[0][(symbol*nb_rb*12)];
|
||||
#endif
|
||||
|
||||
len_mod4 = nb_re&3;
|
||||
nb_re >>= 2; // length in quad words (4 REs)
|
||||
nb_re += (len_mod4 == 0 ? 0 : 1);
|
||||
|
||||
temp_channel = _mm_set1_epi16((QAM16_n1 * one_over_sqrt_2)>>(2*15-AMP_SHIFT));
|
||||
|
||||
for (i=0; i<nb_re; i++) {
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386)
|
||||
@@ -125,7 +116,7 @@ void nr_ulsch_16qam_llr(int32_t *rxdataF_comp,
|
||||
xmm0 = _mm_abs_epi16(rxF[i]); // registers of even index in xmm0-> |y_R|, registers of odd index in xmm0-> |y_I|
|
||||
|
||||
|
||||
xmm0 = _mm_subs_epi16(temp_channel,xmm0); // registers of even index in xmm0-> |y_R|-|h|^2, registers of odd index in xmm0-> |y_I|-|h|^2
|
||||
xmm0 = _mm_subs_epi16(ch_mag[i],xmm0); // registers of even index in xmm0-> |y_R|-|h|^2, registers of odd index in xmm0-> |y_I|-|h|^2
|
||||
|
||||
llr128[0] = _mm_unpacklo_epi32(rxF[i],xmm0); // llr128[0] contains the llrs of the 1st and 2nd REs
|
||||
llr128[1] = _mm_unpackhi_epi32(rxF[i],xmm0); // llr128[1] contains the llrs of the 3rd and 4th REs
|
||||
@@ -186,52 +177,43 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp,
|
||||
int32_t **ul_ch_mag,
|
||||
int32_t **ul_ch_magb,
|
||||
int16_t *ulsch_llr,
|
||||
uint32_t nb_rb,
|
||||
uint32_t nb_re,
|
||||
uint8_t symbol)
|
||||
{
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *rxF = (__m128i*)rxdataF_comp;
|
||||
// __m128i *ch_mag,*ch_magb; // [hna] This should be uncommented once channel estimation is implemented
|
||||
|
||||
// [hna] temp_channel and one_over_sqrt_2 are for temporary use until channel estimation is implemented
|
||||
// else ul_ch_mag and ul_ch_magb should be used after channel estimation has been implemented
|
||||
__m128i temp_channel[2];
|
||||
int16_t one_over_sqrt_2 = 23170;
|
||||
|
||||
__m128i *ch_mag,*ch_magb;
|
||||
#elif defined(__arm__)
|
||||
int16x8_t *rxF = (int16x8_t*)&rxdataF_comp;
|
||||
// int16x8_t *ch_mag,*ch_magb; // [hna] This should be uncommented once channel estimation is implemented
|
||||
int16x8_t *ch_mag,*ch_magb; // [hna] This should be uncommented once channel estimation is implemented
|
||||
int16x8_t xmm1,xmm2;
|
||||
#endif
|
||||
|
||||
int i;
|
||||
unsigned char len_mod4;
|
||||
|
||||
// [hna] This should be uncommented once channel estimation is implemented
|
||||
// -------------------------------------------------------------------------
|
||||
// #if defined(__x86_64__) || defined(__i386__)
|
||||
// ch_mag = (__m128i*)&ul_ch_mag[0][(symbol*frame_parms->N_RB_UL*12)];
|
||||
// ch_magb = (__m128i*)&ul_ch_magb[0][(symbol*frame_parms->N_RB_UL*12)];
|
||||
// #elif defined(__arm__)
|
||||
// ch_mag = (int16x8_t*)&ul_ch_mag[0][(symbol*frame_parms->N_RB_UL*12)];
|
||||
// ch_magb = (int16x8_t*)&ul_ch_magb[0][(symbol*frame_parms->N_RB_UL*12)];
|
||||
// #endif
|
||||
// -------------------------------------------------------------------------
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
ch_mag = (__m128i*)&ul_ch_mag[0][(symbol*nb_rb*12)];
|
||||
ch_magb = (__m128i*)&ul_ch_magb[0][(symbol*nb_rb*12)];
|
||||
#elif defined(__arm__)
|
||||
ch_mag = (int16x8_t*)&ul_ch_mag[0][(symbol*nb_rb*12)];
|
||||
ch_magb = (int16x8_t*)&ul_ch_magb[0][(symbol*nb_rb*12)];
|
||||
#endif
|
||||
|
||||
len_mod4 = nb_re&3;
|
||||
nb_re = nb_re>>2; // length in quad words (4 REs)
|
||||
nb_re += ((len_mod4 == 0) ? 0 : 1);
|
||||
|
||||
temp_channel[0] = _mm_set1_epi16((QAM64_n1 * one_over_sqrt_2)>>(2*15-AMP_SHIFT));
|
||||
temp_channel[1] = _mm_set1_epi16((QAM64_n2 * one_over_sqrt_2)>>(2*15-AMP_SHIFT));
|
||||
|
||||
|
||||
for (i=0; i<nb_re; i++) {
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
xmm1 = _mm_abs_epi16(rxF[i]);
|
||||
xmm1 = _mm_subs_epi16(temp_channel[0],xmm1);
|
||||
xmm1 = _mm_subs_epi16(ch_mag[i],xmm1);
|
||||
xmm2 = _mm_abs_epi16(xmm1);
|
||||
xmm2 = _mm_subs_epi16(temp_channel[1],xmm2);
|
||||
xmm2 = _mm_subs_epi16(ch_magb[i],xmm2);
|
||||
#elif defined(__arm__)
|
||||
xmm1 = vabsq_s16(rxF[i]);
|
||||
xmm1 = vsubq_s16(ch_mag[i],xmm1);
|
||||
@@ -331,6 +313,7 @@ void nr_ulsch_compute_llr(int32_t *rxdataF_comp,
|
||||
int32_t **ul_ch_mag,
|
||||
int32_t **ul_ch_magb,
|
||||
int16_t *ulsch_llr,
|
||||
uint32_t nb_rb,
|
||||
uint32_t nb_re,
|
||||
uint8_t symbol,
|
||||
uint8_t mod_order)
|
||||
@@ -346,6 +329,7 @@ void nr_ulsch_compute_llr(int32_t *rxdataF_comp,
|
||||
nr_ulsch_16qam_llr(rxdataF_comp,
|
||||
ul_ch_mag,
|
||||
ulsch_llr,
|
||||
nb_rb,
|
||||
nb_re,
|
||||
symbol);
|
||||
break;
|
||||
@@ -354,6 +338,7 @@ void nr_ulsch_compute_llr(int32_t *rxdataF_comp,
|
||||
ul_ch_mag,
|
||||
ul_ch_magb,
|
||||
ulsch_llr,
|
||||
nb_rb,
|
||||
nb_re,
|
||||
symbol);
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
#include "filt16a_32.h"
|
||||
|
||||
short filt16a_l0[16] = {
|
||||
16384,12288,8192,4096,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_r0[16] = {
|
||||
0,0,0,0,0,4096,8192,12288,16384,20480,24576,28672,0,0,0,0};
|
||||
|
||||
short filt16a_m0[16] = {
|
||||
0,4096,8192,12288,16384,12288,8192,4096,0,-4096,-8192,-12288,0,0,0,0};
|
||||
|
||||
short filt16a_l1[16] = {
|
||||
20480,16384,12288,8192,4096,0,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_r1[16] = {
|
||||
0,0,0,0,0,0,4096,8192,12288,16384,20480,24576,0,0,0,0};
|
||||
|
||||
short filt16a_m1[16] = {
|
||||
-4096,0,4096,8192,12288,16384,12288,8192,4096,0,-4096,-8192,0,0,0,0};
|
||||
|
||||
short filt16a_l2[16] = {
|
||||
24576,20480,16384,12288,8192,4096,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_r2[16] = {
|
||||
0,0,0,0,0,0,0,4096,8192,12288,16384,20480,0,0,0,0};
|
||||
|
||||
short filt16a_m2[16] = {
|
||||
-8192,-4096,0,4096,8192,12288,16384,12288,8192,4096,0,-4096,0,0,0,0};
|
||||
|
||||
short filt16a_l3[16] = {
|
||||
28672,24576,20480,16384,12288,8192,4096,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_r3[16] = {
|
||||
0,0,0,0,0,0,0,0,4096,8192,12288,16384,0,0,0,0};
|
||||
|
||||
short filt16a_m3[16] = {
|
||||
-12288,-8192,-4096,0,4096,8192,12288,16384,12288,8192,4096,0,0,0,0,0};
|
||||
|
||||
short filt16a_l0_dc[16] = {
|
||||
16384,12288,8192,4096,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_r0_dc[16] = {
|
||||
0,0,0,0,0,3276,9830,13107,16384,19660,22937,26214,0,0,0,0};
|
||||
|
||||
short filt16a_m0_dc[16] = {
|
||||
0,4096,8192,12288,16384,13107,6553,3276,0,-3277,-6554,-9831,0,0,0,0};
|
||||
|
||||
short filt16a_l1_dc[16] = {
|
||||
16384,12288,8192,4096,0,-4096,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_r1_dc[16] = {
|
||||
0,0,0,0,0,0,6553,9830,13107,16384,19660,22937,0,0,0,0};
|
||||
|
||||
short filt16a_m1_dc[16] = {
|
||||
-4096,0,4096,8192,12288,16384,9830,6553,3276,0,-3277,-6554,0,0,0,0};
|
||||
|
||||
short filt16a_l2_dc[16] = {
|
||||
26214,22937,19660,16384,13107,9830,6553,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_r2_dc[16] = {
|
||||
0,0,0,0,0,0,0,4096,8192,12288,16384,20480,0,0,0,0};
|
||||
|
||||
short filt16a_m2_dc[16] = {
|
||||
-6554,-3277,0,3276,6553,6553,16384,12288,8192,4096,0,-4096,0,0,0,0};
|
||||
|
||||
short filt16a_l3_dc[16] = {
|
||||
26214,22937,19660,16384,13107,9830,3276,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_r3_dc[16] = {
|
||||
0,0,0,0,0,0,0,0,4096,8192,12288,16384,0,0,0,0};
|
||||
|
||||
short filt16a_m3_dc[16] = {
|
||||
-9831,-6554,-3277,0,3276,6553,9830,16384,12288,8192,4096,0,0,0,0,0};
|
||||
|
||||
short filt16a_1[16] = {
|
||||
16384,16384,16384,16384,16384,16384,16384,16384,16384,16384,16384,16384};
|
||||
|
||||
short filt16a_2l0[16] = {
|
||||
16384,12288,8192,4096,-4096,0,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_2r0[16] = {
|
||||
0,4096,8192,12288,16384,20480,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_2l1[16] = {
|
||||
20480,16384,12288,8192,4096,0,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_2r1[16] = {
|
||||
-4096,0,4096,8192,12288,16384,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
/*filter8*/
|
||||
short filt8_l0[8] = {
|
||||
16384,8192,0,0,0,0,0,0};
|
||||
|
||||
short filt8_mr0[8] = {
|
||||
0,0,0,8192,16384,8192,0,-8192};
|
||||
|
||||
short filt8_r0[8] = {
|
||||
0,8192,16384,24576,0,0,0,0};
|
||||
|
||||
short filt8_m0[8] = {
|
||||
0,8192,16384,8192,0,0,0,0};
|
||||
|
||||
short filt8_mm0[8]= {
|
||||
0,0,0,8192,16384,8192,0,0};
|
||||
|
||||
short filt8_l1[8] = {
|
||||
24576,16384,0,0,0,0,0,0};
|
||||
|
||||
short filt8_ml1[8] = {
|
||||
-8192,0,8192,16384,8192,0,0,0};
|
||||
|
||||
short filt8_r1[8] = {
|
||||
0,0,8192,16384,0,0,0,0};
|
||||
|
||||
short filt8_m1[8] = {
|
||||
0,0,8192,16384,8192,0,0,0};
|
||||
|
||||
short filt8_mm1[8]= {
|
||||
0,0,0,0,8192,16384,8192,0};
|
||||
@@ -1,117 +1,104 @@
|
||||
short filt16a_l0[16] = {
|
||||
16384,12288,8192,4096,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
short filt16a_r0[16] = {
|
||||
0,0,0,0,0,4096,8192,12288,16384,20480,24576,28672,0,0,0,0};
|
||||
#ifndef __FILT16A_32__H__
|
||||
#define __FILT16A_32__H__
|
||||
|
||||
short filt16a_m0[16] = {
|
||||
0,4096,8192,12288,16384,12288,8192,4096,0,-4096,-8192,-12288,0,0,0,0};
|
||||
extern short filt16a_l0[16];
|
||||
|
||||
short filt16a_l1[16] = {
|
||||
20480,16384,12288,8192,4096,0,0,0,0,0,0,0,0,0,0,0};
|
||||
extern short filt16a_r0[16];
|
||||
|
||||
short filt16a_r1[16] = {
|
||||
0,0,0,0,0,0,4096,8192,12288,16384,20480,24576,0,0,0,0};
|
||||
extern short filt16a_m0[16];
|
||||
|
||||
short filt16a_m1[16] = {
|
||||
-4096,0,4096,8192,12288,16384,12288,8192,4096,0,-4096,-8192,0,0,0,0};
|
||||
extern short filt16a_l1[16];
|
||||
|
||||
short filt16a_l2[16] = {
|
||||
24576,20480,16384,12288,8192,4096,0,0,0,0,0,0,0,0,0,0};
|
||||
extern short filt16a_r1[16];
|
||||
|
||||
short filt16a_r2[16] = {
|
||||
0,0,0,0,0,0,0,4096,8192,12288,16384,20480,0,0,0,0};
|
||||
extern short filt16a_m1[16];
|
||||
|
||||
short filt16a_m2[16] = {
|
||||
-8192,-4096,0,4096,8192,12288,16384,12288,8192,4096,0,-4096,0,0,0,0};
|
||||
extern short filt16a_l2[16];
|
||||
|
||||
short filt16a_l3[16] = {
|
||||
28672,24576,20480,16384,12288,8192,4096,0,0,0,0,0,0,0,0,0};
|
||||
extern short filt16a_r2[16];
|
||||
|
||||
short filt16a_r3[16] = {
|
||||
0,0,0,0,0,0,0,0,4096,8192,12288,16384,0,0,0,0};
|
||||
extern short filt16a_m2[16];
|
||||
|
||||
short filt16a_m3[16] = {
|
||||
-12288,-8192,-4096,0,4096,8192,12288,16384,12288,8192,4096,0,0,0,0,0};
|
||||
extern short filt16a_l3[16];
|
||||
|
||||
short filt16a_l0_dc[16] = {
|
||||
16384,12288,8192,4096,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
extern short filt16a_r3[16];
|
||||
|
||||
short filt16a_r0_dc[16] = {
|
||||
0,0,0,0,0,3276,9830,13107,16384,19660,22937,26214,0,0,0,0};
|
||||
extern short filt16a_m3[16];
|
||||
|
||||
short filt16a_m0_dc[16] = {
|
||||
0,4096,8192,12288,16384,13107,6553,3276,0,-3277,-6554,-9831,0,0,0,0};
|
||||
extern short filt16a_l0_dc[16];
|
||||
|
||||
short filt16a_l1_dc[16] = {
|
||||
16384,12288,8192,4096,0,-4096,0,0,0,0,0,0,0,0,0,0};
|
||||
extern short filt16a_r0_dc[16];
|
||||
|
||||
short filt16a_r1_dc[16] = {
|
||||
0,0,0,0,0,0,6553,9830,13107,16384,19660,22937,0,0,0,0};
|
||||
extern short filt16a_m0_dc[16];
|
||||
|
||||
short filt16a_m1_dc[16] = {
|
||||
-4096,0,4096,8192,12288,16384,9830,6553,3276,0,-3277,-6554,0,0,0,0};
|
||||
extern short filt16a_l1_dc[16];
|
||||
|
||||
short filt16a_l2_dc[16] = {
|
||||
26214,22937,19660,16384,13107,9830,6553,0,0,0,0,0,0,0,0,0};
|
||||
extern short filt16a_r1_dc[16];
|
||||
|
||||
short filt16a_r2_dc[16] = {
|
||||
0,0,0,0,0,0,0,4096,8192,12288,16384,20480,0,0,0,0};
|
||||
extern short filt16a_m1_dc[16];
|
||||
|
||||
short filt16a_m2_dc[16] = {
|
||||
-6554,-3277,0,3276,6553,6553,16384,12288,8192,4096,0,-4096,0,0,0,0};
|
||||
extern short filt16a_l2_dc[16];
|
||||
|
||||
short filt16a_l3_dc[16] = {
|
||||
26214,22937,19660,16384,13107,9830,3276,0,0,0,0,0,0,0,0,0};
|
||||
extern short filt16a_r2_dc[16];
|
||||
|
||||
short filt16a_r3_dc[16] = {
|
||||
0,0,0,0,0,0,0,0,4096,8192,12288,16384,0,0,0,0};
|
||||
extern short filt16a_m2_dc[16];
|
||||
|
||||
short filt16a_m3_dc[16] = {
|
||||
-9831,-6554,-3277,0,3276,6553,9830,16384,12288,8192,4096,0,0,0,0,0};
|
||||
extern short filt16a_l3_dc[16];
|
||||
|
||||
short filt16a_1[16] = {
|
||||
16384,16384,16384,16384,16384,16384,16384,16384,16384,16384,16384,16384};
|
||||
extern short filt16a_r3_dc[16];
|
||||
|
||||
short filt16a_2l0[16] = {
|
||||
16384,12288,8192,4096,-4096,0,0,0,0,0,0,0,0,0,0,0};
|
||||
extern short filt16a_m3_dc[16];
|
||||
|
||||
short filt16a_2r0[16] = {
|
||||
0,4096,8192,12288,16384,20480,0,0,0,0,0,0,0,0,0,0};
|
||||
extern short filt16a_1[16];
|
||||
|
||||
short filt16a_2l1[16] = {
|
||||
20480,16384,12288,8192,4096,0,0,0,0,0,0,0,0,0,0,0};
|
||||
extern short filt16a_2l0[16];
|
||||
|
||||
short filt16a_2r1[16] = {
|
||||
-4096,0,4096,8192,12288,16384,0,0,0,0,0,0,0,0,0,0};
|
||||
extern short filt16a_2r0[16];
|
||||
|
||||
extern short filt16a_2l1[16];
|
||||
|
||||
extern short filt16a_2r1[16];
|
||||
|
||||
/*filter8*/
|
||||
short filt8_l0[8] = {
|
||||
16384,8192,0,0,0,0,0,0};
|
||||
extern short filt8_l0[8];
|
||||
|
||||
short filt8_mr0[8] = {
|
||||
0,0,0,8192,16384,8192,0,-8192};
|
||||
extern short filt8_mr0[8];
|
||||
|
||||
short filt8_r0[8] = {
|
||||
0,8192,16384,24576,0,0,0,0};
|
||||
extern short filt8_r0[8];
|
||||
|
||||
short filt8_m0[8] = {
|
||||
0,8192,16384,8192,0,0,0,0};
|
||||
extern short filt8_m0[8];
|
||||
|
||||
short filt8_mm0[8]= {
|
||||
0,0,0,8192,16384,8192,0,0};
|
||||
extern short filt8_mm0[8];
|
||||
|
||||
short filt8_l1[8] = {
|
||||
24576,16384,0,0,0,0,0,0};
|
||||
extern short filt8_l1[8];
|
||||
|
||||
short filt8_ml1[8] = {
|
||||
-8192,0,8192,16384,8192,0,0,0};
|
||||
extern short filt8_ml1[8];
|
||||
|
||||
short filt8_r1[8] = {
|
||||
0,0,8192,16384,0,0,0,0};
|
||||
extern short filt8_r1[8];
|
||||
|
||||
short filt8_m1[8] = {
|
||||
0,0,8192,16384,8192,0,0,0};
|
||||
extern short filt8_m1[8];
|
||||
|
||||
short filt8_mm1[8]= {
|
||||
0,0,0,0,8192,16384,8192,0};
|
||||
extern short filt8_mm1[8];
|
||||
|
||||
#endif
|
||||
@@ -31,11 +31,11 @@
|
||||
|
||||
|
||||
int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
|
||||
uint8_t eNB_offset,
|
||||
unsigned char Ns,
|
||||
unsigned char symbol,
|
||||
int dmrss,
|
||||
NR_UE_SSB *current_ssb)
|
||||
uint8_t eNB_offset,
|
||||
unsigned char Ns,
|
||||
unsigned char symbol,
|
||||
int dmrss,
|
||||
NR_UE_SSB *current_ssb)
|
||||
{
|
||||
int pilot[200] __attribute__((aligned(16)));
|
||||
unsigned char aarx;
|
||||
@@ -149,7 +149,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
|
||||
current_ssb->c_im +=ch[1];
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
|
||||
pil+=2;
|
||||
@@ -165,7 +165,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
|
||||
current_ssb->c_im +=ch[1];
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
pil+=2;
|
||||
//re_offset = (re_offset+4)&(ue->frame_parms.ofdm_symbol_size-1);
|
||||
@@ -180,7 +180,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
|
||||
current_ssb->c_im +=ch[1];
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
|
||||
pil+=2;
|
||||
@@ -199,12 +199,12 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
|
||||
|
||||
|
||||
int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
uint8_t eNB_offset,
|
||||
unsigned char Ns,
|
||||
unsigned char symbol,
|
||||
int dmrss,
|
||||
uint8_t ssb_index,
|
||||
uint8_t n_hf)
|
||||
uint8_t eNB_offset,
|
||||
unsigned char Ns,
|
||||
unsigned char symbol,
|
||||
int dmrss,
|
||||
uint8_t ssb_index,
|
||||
uint8_t n_hf)
|
||||
{
|
||||
int pilot[200] __attribute__((aligned(16)));
|
||||
unsigned char aarx;
|
||||
@@ -367,7 +367,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fl,
|
||||
ch,
|
||||
@@ -387,7 +387,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fm,
|
||||
ch,
|
||||
@@ -403,7 +403,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
|
||||
multadd_real_vector_complex_scalar(fr,
|
||||
@@ -426,11 +426,11 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
|
||||
int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
uint8_t eNB_offset,
|
||||
unsigned char Ns,
|
||||
unsigned char symbol,
|
||||
unsigned short coreset_start_subcarrier,
|
||||
unsigned short nb_rb_coreset)
|
||||
uint8_t eNB_offset,
|
||||
unsigned char Ns,
|
||||
unsigned char symbol,
|
||||
unsigned short coreset_start_subcarrier,
|
||||
unsigned short nb_rb_coreset)
|
||||
{
|
||||
int pilot[200] __attribute__((aligned(16)));
|
||||
unsigned char aarx,p;
|
||||
@@ -550,7 +550,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_PDCCH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fl,
|
||||
ch,
|
||||
@@ -566,7 +566,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_PDCCH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fm,
|
||||
ch,
|
||||
@@ -645,7 +645,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
for (p=0; p<ue->frame_parms.nb_antenna_ports_eNB; p++) {
|
||||
if (ue->pdcch_vars[ue->current_thread_id[Ns]][eNB_offset]->dl_ch_estimates[(p<<1)+aarx])
|
||||
{
|
||||
LOG_I(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d \n", Ns, ue->current_thread_id[Ns], symbol);
|
||||
LOG_D(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d \n", Ns, ue->current_thread_id[Ns], symbol);
|
||||
idft((int16_t*) &ue->pdcch_vars[ue->current_thread_id[Ns]][eNB_offset]->dl_ch_estimates[(p<<1)+aarx][0],
|
||||
(int16_t*) ue->pdcch_vars[ue->current_thread_id[Ns]][eNB_offset]->dl_ch_estimates_time[(p<<1)+aarx],1);
|
||||
}
|
||||
@@ -656,14 +656,13 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
|
||||
int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
uint8_t eNB_offset,
|
||||
unsigned char Ns,
|
||||
unsigned short p,
|
||||
unsigned char symbol,
|
||||
unsigned short bwp_start_subcarrier,
|
||||
unsigned short nb_rb_pdsch)
|
||||
uint8_t eNB_offset,
|
||||
unsigned char Ns,
|
||||
unsigned short p,
|
||||
unsigned char symbol,
|
||||
unsigned short bwp_start_subcarrier,
|
||||
unsigned short nb_rb_pdsch)
|
||||
{
|
||||
|
||||
int pilot[1320] __attribute__((aligned(16)));
|
||||
unsigned char aarx;
|
||||
unsigned short k;
|
||||
@@ -807,7 +806,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_PDSCH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fm,
|
||||
ch,
|
||||
@@ -822,7 +821,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_PDSCH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fmm,
|
||||
ch,
|
||||
@@ -840,7 +839,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_PDSCH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fm,
|
||||
ch,
|
||||
@@ -859,7 +858,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_PDSCH
|
||||
printf("ch 0 %d\n",((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1]));
|
||||
printf("pilot %d: rxF - > (%d,%d) addr %p ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],&rxF[0],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u: rxF - > (%d,%d) addr %p ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],&rxF[0],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fmr,
|
||||
ch,
|
||||
@@ -875,7 +874,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_PDSCH
|
||||
printf("pilot %d: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fr,
|
||||
ch,
|
||||
|
||||
@@ -1173,7 +1173,7 @@ void nr_dci_decoding_procedure0(int s,
|
||||
} else {
|
||||
nb_candidates = (L2 == 4) ? 4 : ((L2 == 8)? 2 : 1); // according to Table 10.1-1 (38.213 section 10.1)
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> we are in common searchSpace and nb_candidates=%d for L2=%d\n",nb_candidates,L2);
|
||||
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> we are in common searchSpace and nb_candidates=%u for L2=%d\n", nb_candidates, L2);
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
@@ -1212,7 +1212,7 @@ void nr_dci_decoding_procedure0(int s,
|
||||
}
|
||||
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> L2(%d) | nCCE[%d](%d) | Yk(%d) | nb_candidates(%d)\n",L2,p,nCCE[p],Yk,nb_candidates);
|
||||
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> L2(%d) | nCCE[%d](%d) | Yk(%u) | nb_candidates(%u)\n", L2, p, nCCE[p], Yk, nb_candidates);
|
||||
#endif
|
||||
/* for (CCEind=0;
|
||||
CCEind<nCCE2;
|
||||
@@ -1225,7 +1225,7 @@ void nr_dci_decoding_procedure0(int s,
|
||||
if (L==4) m_p_s_L_max=1; // Table 10.1-2 is not defined for L=4
|
||||
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> m_max_slot_pdcch_Table10_1_2(%d)=%d\n",L,m_max_slot_pdcch_Table10_1_2[L]);
|
||||
if(0 <= L && L < 4) printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> m_max_slot_pdcch_Table10_1_2(%d)=%d\n",L,m_max_slot_pdcch_Table10_1_2[L]);
|
||||
#endif
|
||||
|
||||
for (m = 0; m < nb_candidates; m++) {
|
||||
@@ -1234,16 +1234,16 @@ void nr_dci_decoding_procedure0(int s,
|
||||
if (nCCE[p] < L2) return;
|
||||
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
int debug1 = nCCE[p] / L2;
|
||||
int debug2 = L2*m_p_s_L_max;
|
||||
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> debug1(%d)=nCCE[p]/L2 | nCCE[%d](%d) | L2(%d)\n",debug1,p,nCCE[p],L2);
|
||||
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> debug2(%d)=L2*m_p_s_L_max | L2(%d) | m_p_s_L_max(%d)\n",debug2,L2,m_p_s_L_max);
|
||||
int debug1 = nCCE[p] / L2;
|
||||
int debug2 = L2*m_p_s_L_max;
|
||||
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> debug1(%d)=nCCE[p]/L2 | nCCE[%d](%d) | L2(%d)\n",debug1,p,nCCE[p],L2);
|
||||
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> debug2(%d)=L2*m_p_s_L_max | L2(%d) | m_p_s_L_max(%d)\n",debug2,L2,m_p_s_L_max);
|
||||
#endif
|
||||
CCEind = (((Yk + (uint16_t)(floor((m*nCCE[p])/(L2*m_p_s_L_max))) + n_ci) % (uint16_t)(floor(nCCE[p] / L2))) * L2);
|
||||
CCEind = (((Yk + (uint16_t)(floor((m*nCCE[p])/(L2*m_p_s_L_max))) + n_ci) % (uint16_t)(floor(nCCE[p] / L2))) * L2);
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> CCEind(%d) = (((Yk(%d) + ((m(%d)*nCCE[p](%d))/(L2(%d)*m_p_s_L_max(%d)))) % (nCCE[p] / L2)) * L2)\n",
|
||||
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> CCEind(%d) = (((Yk(%u) + ((m(%u)*nCCE[p](%d))/(L2(%d)*m_p_s_L_max(%d)))) %% (nCCE[p] / L2)) * L2)\n",
|
||||
CCEind,Yk,m,nCCE[p],L2,m_p_s_L_max);
|
||||
printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> n_candidate(m)=%d | CCEind=%d |",m,CCEind);
|
||||
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> n_candidate(m)=%u | CCEind=%d |",m,CCEind);
|
||||
#endif
|
||||
|
||||
if (CCEind < 32)
|
||||
@@ -1252,7 +1252,7 @@ void nr_dci_decoding_procedure0(int s,
|
||||
CCEmap = CCEmap1;
|
||||
else if (CCEind < 96)
|
||||
CCEmap = CCEmap2;
|
||||
else AssertFatal(1==0,"Illegal CCEind %d (Yk %d, m %d, nCCE %d, L2 %d\n",CCEind, Yk, m, nCCE[p], L2);
|
||||
else AssertFatal(1==0,"Illegal CCEind %d (Yk %u, m %u, nCCE %d, L2 %d\n", CCEind, Yk, m, nCCE[p], L2);
|
||||
|
||||
switch (L2) {
|
||||
case 1:
|
||||
@@ -1284,7 +1284,7 @@ void nr_dci_decoding_procedure0(int s,
|
||||
CCEmap_cand = (*CCEmap) & CCEmap_mask;
|
||||
// CCE is not allocated yet
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> CCEmap_cand=%d \n",CCEmap_cand);
|
||||
printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> CCEmap_cand=%u \n",CCEmap_cand);
|
||||
#endif
|
||||
|
||||
if (CCEmap_cand == 0) {
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.h"
|
||||
#include "PHY/CODING/nrLDPC_decoder/nrLDPC_types.h"
|
||||
//#define DEBUG_DLSCH_DECODING
|
||||
//#define ENABLE_PHY_PAYLOAD_DEBUG 1
|
||||
|
||||
#define OAI_LDPC_MAX_NUM_LLR 27000//26112 // NR_LDPC_NCOL_BG1*NR_LDPC_ZMAX
|
||||
|
||||
@@ -302,6 +303,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
|
||||
A = harq_process->TBS;
|
||||
ret = dlsch->max_ldpc_iterations + 1;
|
||||
dlsch->last_iteration_cnt = ret;
|
||||
|
||||
harq_process->G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, harq_process->Qm,harq_process->Nl);
|
||||
G = harq_process->G;
|
||||
@@ -554,6 +556,8 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
// Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int
|
||||
if (check_crc((uint8_t*)llrProcBuf,length_dec,harq_process->F,crc_type)) {
|
||||
printf("\x1B[34m" "Segment %d CRC OK\n",r);
|
||||
//Temporary hack
|
||||
no_iteration_ldpc = dlsch->max_ldpc_iterations;
|
||||
ret = no_iteration_ldpc;
|
||||
}
|
||||
else {
|
||||
@@ -602,7 +606,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
|
||||
|
||||
if ((err_flag == 0) && (ret>=(1+dlsch->max_ldpc_iterations))) {// a Code segment is in error so break;
|
||||
LOG_D(PHY,"AbsSubframe %d.%d CRC failed, segment %d/%d \n",frame%1024,nr_tti_rx,r,harq_process->C-1);
|
||||
LOG_I(PHY,"AbsSubframe %d.%d CRC failed, segment %d/%d \n",frame%1024,nr_tti_rx,r,harq_process->C-1);
|
||||
err_flag = 1;
|
||||
}
|
||||
}
|
||||
@@ -616,10 +620,10 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
frame_rx_prev = frame_rx_prev%1024;
|
||||
|
||||
if (err_flag == 1) {
|
||||
#if UE_DEBUG_TRACE
|
||||
//#if UE_DEBUG_TRACE
|
||||
LOG_I(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n",
|
||||
phy_vars_ue->Mod_id, frame, nr_tti_rx, harq_pid,harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs,Kr,r,harq_process->round);
|
||||
#endif
|
||||
//#endif
|
||||
harq_process->harq_ack.ack = 0;
|
||||
harq_process->harq_ack.harq_id = harq_pid;
|
||||
harq_process->harq_ack.send_harq_status = 1;
|
||||
@@ -634,16 +638,16 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
|
||||
if(is_crnti)
|
||||
{
|
||||
LOG_D(PHY,"[UE %d] DLSCH: Setting NACK for nr_tti_rx %d (pid %d, pid status %d, round %d/Max %d, TBS %d)\n",
|
||||
LOG_I(PHY,"[UE %d] DLSCH: Setting NACK for nr_tti_rx %d (pid %d, pid status %d, round %d/Max %d, TBS %d)\n",
|
||||
phy_vars_ue->Mod_id,nr_tti_rx,harq_pid,harq_process->status,harq_process->round,dlsch->Mdlharq,harq_process->TBS);
|
||||
}
|
||||
|
||||
return((1 + dlsch->max_ldpc_iterations));
|
||||
} else {
|
||||
#if UE_DEBUG_TRACE
|
||||
//#if UE_DEBUG_TRACE
|
||||
LOG_I(PHY,"[UE %d] DLSCH: Setting ACK for nr_tti_rx %d TBS %d mcs %d nb_rb %d harq_process->round %d\n",
|
||||
phy_vars_ue->Mod_id,nr_tti_rx,harq_process->TBS,harq_process->mcs,harq_process->nb_rb, harq_process->round);
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
harq_process->status = SCH_IDLE;
|
||||
harq_process->round = 0;
|
||||
@@ -656,7 +660,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
|
||||
if(is_crnti)
|
||||
{
|
||||
LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for nr_tti_rx %d (pid %d, round %d, TBS %d)\n",phy_vars_ue->Mod_id,nr_tti_rx,harq_pid,harq_process->round,harq_process->TBS);
|
||||
LOG_I(PHY,"[UE %d] DLSCH: Setting ACK for nr_tti_rx %d (pid %d, round %d, TBS %d)\n",phy_vars_ue->Mod_id,nr_tti_rx,harq_pid,harq_process->round,harq_process->TBS);
|
||||
}
|
||||
//LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for subframe %d (pid %d, round %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round);
|
||||
|
||||
@@ -690,6 +694,20 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
harq_process->b[offset],
|
||||
harq_process->F>>3,
|
||||
harq_process->c[r]);
|
||||
|
||||
/*printf ("Printing payload bytes:");
|
||||
for (int i = 0; i < Kr_bytes; i++){
|
||||
printf("%d : %d \n", i, harq_process->b[i]);
|
||||
}*/
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_PHY_PAYLOAD_DEBUG)
|
||||
if (frame%100 == 0){
|
||||
LOG_I (PHY, "Printing 10 first payload bytes at frame: %d ", frame);
|
||||
for (int i = 0; i <10 ; i++){ //Kr_bytes
|
||||
LOG_I(PHY, "[%d] : %x ", i, harq_process->b[i]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
if(symbol > ue->frame_parms.symbols_per_tti>>1)
|
||||
if(symbol > ue->frame_parms.symbols_per_slot>>1)
|
||||
{
|
||||
slot = 1;
|
||||
}
|
||||
@@ -380,11 +380,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot]);
|
||||
#if DISABLE_LOG_X
|
||||
printf("[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,nr_tti_rx,slot,
|
||||
symbol,ue->high_speed_flag,type,symbol,ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot].p_time/(cpuf*1000.0));
|
||||
printf("[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",
|
||||
frame,nr_tti_rx,slot,symbol,ue->high_speed_flag,type,ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot].p_time/(cpuf*1000.0));
|
||||
#else
|
||||
LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,nr_tti_rx,slot,symbol,
|
||||
ue->high_speed_flag,type,ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot].p_time/(cpuf*1000.0));
|
||||
LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",
|
||||
frame,nr_tti_rx,slot,symbol,ue->high_speed_flag,type,ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot].p_time/(cpuf*1000.0));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1065,9 +1065,9 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
#if T_TRACER
|
||||
T(T_UE_PHY_PDSCH_IQ, T_INT(eNB_id), T_INT(ue->Mod_id), T_INT(frame%1024),
|
||||
T_INT(nr_tti_rx), T_INT(nb_rb),
|
||||
T_INT(frame_parms->N_RB_UL), T_INT(frame_parms->symbols_per_tti),
|
||||
T_INT(frame_parms->N_RB_UL), T_INT(frame_parms->symbols_per_slot),
|
||||
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));
|
||||
2 * /* ulsch[UE_id]->harq_processes[harq_pid]->nb_rb */ frame_parms->N_RB_UL *12*frame_parms->symbols_per_slot*2));
|
||||
#endif
|
||||
return(0);
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ uint16_t nr_pbch_extract(int **rxdataF,
|
||||
(i!=(nushiftmod4+8))) {
|
||||
rxF_ext[j]=rxF[rx_offset];
|
||||
#ifdef DEBUG_PBCH
|
||||
printf("rxF ext[%d] = (%d,%d) rxF [%d]= (%d,%d)\n",(9*rb) + j,
|
||||
printf("rxF ext[%d] = (%d,%d) rxF [%u]= (%d,%d)\n",(9*rb) + j,
|
||||
((int16_t *)&rxF_ext[j])[0],
|
||||
((int16_t *)&rxF_ext[j])[1],
|
||||
rx_offset,
|
||||
@@ -116,7 +116,7 @@ uint16_t nr_pbch_extract(int **rxdataF,
|
||||
(i!=(nushiftmod4+8))) {
|
||||
rxF_ext[j]=rxF[rx_offset];
|
||||
#ifdef DEBUG_PBCH
|
||||
printf("rxF ext[%d] = (%d,%d) rxF [%d]= (%d,%d)\n",(rb<4) ? (9*rb) + j : (9*(rb-12))+j,
|
||||
printf("rxF ext[%d] = (%d,%d) rxF [%u]= (%d,%d)\n",(rb<4) ? (9*rb) + j : (9*(rb-12))+j,
|
||||
((int16_t *)&rxF_ext[j])[0],
|
||||
((int16_t *)&rxF_ext[j])[1],
|
||||
rx_offset,
|
||||
@@ -611,7 +611,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
rx_ind.rx_indication_body[0].mib_pdu.ssb_index = i_ssb; // confirm with TCL
|
||||
rx_ind.rx_indication_body[0].mib_pdu.ssb_length = Lmax; // confirm with TCL
|
||||
rx_ind.rx_indication_body[0].mib_pdu.cell_id = frame_parms->Nid_cell; // confirm with TCL
|
||||
rx_ind.number_pdus = 1;
|
||||
rx_ind.number_pdus = 1; //rx_ind.number_pdus++;
|
||||
|
||||
if (ue->if_inst && ue->if_inst->dl_indication)
|
||||
ue->if_inst->dl_indication(&dl_indication);
|
||||
|
||||
@@ -1055,18 +1055,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
NR_DL_FRAME_PARMS* frame_parms,
|
||||
uint8_t harq_pid);
|
||||
|
||||
/*! \brief Fill up NR_UE_ULSCH_t and NR_UL_UE_HARQ_t structs
|
||||
@param[in] UE, Pointer to PHY_VARS_NR_UE struct
|
||||
@param[in] thread_id, thread id
|
||||
@param[in] gNB_id, gNB id
|
||||
@param[in] harq_pid, harq id
|
||||
*/
|
||||
|
||||
int generate_ue_ulsch_params(PHY_VARS_NR_UE *UE,
|
||||
uint8_t thread_id,
|
||||
int gNB_id,
|
||||
unsigned char harq_pid);
|
||||
|
||||
/*! \brief Perform PUSCH scrambling. TS 38.211 V15.4.0 subclause 6.3.1.1
|
||||
@param[in] in, Pointer to input bits
|
||||
@param[in] size, of input bits
|
||||
@@ -1088,19 +1076,21 @@ void nr_pusch_codeword_scrambling(uint8_t *in,
|
||||
- transform precoding
|
||||
*/
|
||||
|
||||
uint8_t nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
unsigned char harq_pid,
|
||||
uint8_t slot,
|
||||
uint8_t thread_id,
|
||||
int eNB_id);
|
||||
int gNB_id);
|
||||
|
||||
|
||||
/** \brief This function does IFFT for PUSCH
|
||||
*/
|
||||
|
||||
uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
|
||||
uint8_t harq_pid,
|
||||
uint8_t slot,
|
||||
uint8_t Nl,
|
||||
uint8_t thread_id,
|
||||
uint8_t gNB_id,
|
||||
NR_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
|
||||
|
||||
@@ -159,10 +159,6 @@ typedef struct {
|
||||
} NR_UL_UE_HARQ_t;
|
||||
|
||||
typedef struct {
|
||||
/// Current Number of Symbols
|
||||
uint8_t Nsymb_pusch;
|
||||
/// Nsc_pusch, number of allocated subcarriers for ULSCH
|
||||
uint16_t Nsc_pusch;
|
||||
/// number of DMRS resource elements
|
||||
uint8_t nb_re_dmrs;
|
||||
/// DMRS length
|
||||
|
||||
@@ -44,8 +44,7 @@
|
||||
|
||||
void free_nr_ue_ulsch(NR_UE_ULSCH_t *ulsch)
|
||||
{
|
||||
int i;
|
||||
int r;
|
||||
int i, r;
|
||||
|
||||
if (ulsch) {
|
||||
#ifdef DEBUG_ULSCH_FREE
|
||||
@@ -87,10 +86,10 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t *ulsch)
|
||||
}
|
||||
|
||||
|
||||
|
||||
NR_UE_ULSCH_t *new_nr_ue_ulsch(unsigned char N_RB_UL, int number_of_harq_pids, uint8_t abstraction_flag)
|
||||
NR_UE_ULSCH_t *new_nr_ue_ulsch(unsigned char N_RB_UL,
|
||||
int number_of_harq_pids,
|
||||
uint8_t abstraction_flag)
|
||||
{
|
||||
|
||||
NR_UE_ULSCH_t *ulsch;
|
||||
unsigned char exit_flag = 0,i,r;
|
||||
unsigned char bw_scaling =1;
|
||||
@@ -187,12 +186,10 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(unsigned char N_RB_UL, int number_of_harq_pids, u
|
||||
}
|
||||
|
||||
|
||||
|
||||
int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
NR_DL_FRAME_PARMS* frame_parms,
|
||||
uint8_t harq_pid)
|
||||
NR_DL_FRAME_PARMS* frame_parms,
|
||||
uint8_t harq_pid)
|
||||
{
|
||||
|
||||
/////////////////////////parameters and variables declaration/////////////////////////
|
||||
///////////
|
||||
|
||||
@@ -320,6 +317,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
///////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
opp_enabled=0;
|
||||
|
||||
///////////////////////// c---->| LDCP coding |---->d /////////////////////////
|
||||
///////////
|
||||
@@ -379,7 +377,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
}
|
||||
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
printf("Rate Matching, Code segment %d (coded bits (G) %d,unpunctured/repeated bits per code segment %d,mod_order %d, nb_rb %d)...\n",
|
||||
printf("Rate Matching, Code segment %d (coded bits (G) %u, unpunctured/repeated bits per code segment %d, mod_order %d, nb_rb %d)...\n",
|
||||
r,
|
||||
G,
|
||||
Kr*3,
|
||||
|
||||
@@ -43,80 +43,7 @@
|
||||
#include "PHY/TOOLS/tools_defs.h"
|
||||
|
||||
//#define DEBUG_SCFDMA
|
||||
|
||||
|
||||
int generate_ue_ulsch_params(PHY_VARS_NR_UE *UE,
|
||||
uint8_t thread_id,
|
||||
int gNB_id,
|
||||
unsigned char harq_pid){
|
||||
|
||||
int N_PRB_oh, N_RE_prime, cwd_idx, length_dmrs, Nid_cell;
|
||||
int nb_rb, Nsymb_pusch, first_rb, nb_codewords,mcs,rvidx;
|
||||
uint16_t n_rnti;
|
||||
unsigned char mod_order;
|
||||
uint16_t code_rate;
|
||||
|
||||
NR_UE_ULSCH_t *ulsch_ue;
|
||||
NR_UL_UE_HARQ_t *harq_process_ul_ue;
|
||||
|
||||
LOG_W(PHY,"This function should not be used. Use FAPI interfaces instead\n");
|
||||
|
||||
//--------------------------Temporary configuration-----------------------------//
|
||||
length_dmrs = 1;
|
||||
n_rnti = 0x1234;
|
||||
Nid_cell = 0;
|
||||
nb_rb = 50;
|
||||
first_rb = 30;
|
||||
Nsymb_pusch = 12;
|
||||
nb_codewords = 1;
|
||||
mcs = 9;
|
||||
rvidx = 0;
|
||||
//------------------------------------------------------------------------------//
|
||||
|
||||
for (cwd_idx = 0; cwd_idx < nb_codewords; cwd_idx++) {
|
||||
|
||||
ulsch_ue = UE->ulsch[thread_id][gNB_id][cwd_idx];
|
||||
harq_process_ul_ue = ulsch_ue->harq_processes[harq_pid];
|
||||
|
||||
ulsch_ue->length_dmrs = length_dmrs;
|
||||
ulsch_ue->rnti = n_rnti;
|
||||
ulsch_ue->Nid_cell = Nid_cell;
|
||||
ulsch_ue->Nsc_pusch = nb_rb*NR_NB_SC_PER_RB;
|
||||
ulsch_ue->Nsymb_pusch = Nsymb_pusch;
|
||||
ulsch_ue->nb_re_dmrs = UE->dmrs_UplinkConfig.pusch_maxLength*(UE->dmrs_UplinkConfig.pusch_dmrs_type == pusch_dmrs_type1)?6:4;
|
||||
|
||||
|
||||
N_PRB_oh = 0; // higher layer (RRC) parameter xOverhead in PUSCH-ServingCellConfig
|
||||
N_RE_prime = NR_NB_SC_PER_RB*Nsymb_pusch - ulsch_ue->nb_re_dmrs - N_PRB_oh;
|
||||
|
||||
if (harq_process_ul_ue) {
|
||||
|
||||
mod_order = nr_get_Qm_ul(mcs, 1);
|
||||
code_rate = nr_get_code_rate_ul(mcs, 1);
|
||||
|
||||
harq_process_ul_ue->mcs = mcs;
|
||||
harq_process_ul_ue->Nl = nb_codewords;
|
||||
harq_process_ul_ue->nb_rb = nb_rb;
|
||||
harq_process_ul_ue->first_rb = first_rb;
|
||||
harq_process_ul_ue->number_of_symbols = Nsymb_pusch;
|
||||
harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb*nb_codewords;
|
||||
harq_process_ul_ue->rvidx = rvidx;
|
||||
harq_process_ul_ue->TBS = nr_compute_tbs(mod_order,
|
||||
code_rate,
|
||||
nb_rb,
|
||||
Nsymb_pusch,
|
||||
ulsch_ue->nb_re_dmrs,
|
||||
length_dmrs,
|
||||
harq_process_ul_ue->Nl);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//#define DEBUG_PUSCH_MAPPING
|
||||
|
||||
void nr_pusch_codeword_scrambling(uint8_t *in,
|
||||
uint16_t size,
|
||||
@@ -157,39 +84,70 @@ void nr_pusch_codeword_scrambling(uint8_t *in,
|
||||
|
||||
}
|
||||
|
||||
uint8_t nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
unsigned char harq_pid,
|
||||
uint8_t slot,
|
||||
uint8_t thread_id,
|
||||
int eNB_id) {
|
||||
int gNB_id) {
|
||||
|
||||
unsigned int available_bits;
|
||||
uint8_t mod_order, cwd_index, num_of_codewords;
|
||||
uint32_t scrambled_output[NR_MAX_NB_CODEWORDS][NR_MAX_PDSCH_ENCODED_LENGTH>>5];
|
||||
int32_t *mod_symbols[MAX_NUM_NR_RE];
|
||||
uint32_t ***pusch_dmrs;
|
||||
int16_t **tx_layers;
|
||||
int32_t **txdataF;
|
||||
uint16_t start_sc, start_rb;
|
||||
int8_t Wf[2], Wt[2], l0, l_prime[2], delta;
|
||||
uint16_t n_dmrs,code_rate;
|
||||
uint8_t dmrs_type;
|
||||
uint8_t dmrs_type, length_dmrs;
|
||||
uint8_t mapping_type;
|
||||
int ap, start_symbol, i;
|
||||
int sample_offsetF;
|
||||
int ap, start_symbol, Nid_cell, i;
|
||||
int sample_offsetF, N_RE_prime, N_PRB_oh;
|
||||
uint16_t n_rnti;
|
||||
|
||||
NR_UE_ULSCH_t *ulsch_ue;
|
||||
NR_UL_UE_HARQ_t *harq_process_ul_ue;
|
||||
NR_DL_FRAME_PARMS *frame_parms = &UE->frame_parms;
|
||||
NR_UE_PUSCH *pusch_ue = UE->pusch_vars[thread_id][eNB_id];
|
||||
NR_UE_PUSCH *pusch_ue = UE->pusch_vars[thread_id][gNB_id];
|
||||
|
||||
num_of_codewords = 1; // tmp assumption
|
||||
length_dmrs = 1;
|
||||
n_rnti = 0x1234;
|
||||
Nid_cell = 0;
|
||||
N_PRB_oh = 0; // higher layer (RRC) parameter xOverhead in PUSCH-ServingCellConfig
|
||||
|
||||
for (cwd_index = 0;cwd_index < num_of_codewords; cwd_index++) {
|
||||
|
||||
ulsch_ue = UE->ulsch[thread_id][eNB_id][cwd_index];
|
||||
ulsch_ue = UE->ulsch[thread_id][gNB_id][cwd_index];
|
||||
harq_process_ul_ue = ulsch_ue->harq_processes[harq_pid];
|
||||
|
||||
ulsch_ue->length_dmrs = length_dmrs;
|
||||
ulsch_ue->rnti = n_rnti;
|
||||
ulsch_ue->Nid_cell = Nid_cell;
|
||||
ulsch_ue->nb_re_dmrs = UE->dmrs_UplinkConfig.pusch_maxLength*(UE->dmrs_UplinkConfig.pusch_dmrs_type == pusch_dmrs_type1)?6:4;
|
||||
|
||||
N_RE_prime = NR_NB_SC_PER_RB*harq_process_ul_ue->number_of_symbols - ulsch_ue->nb_re_dmrs - N_PRB_oh;
|
||||
|
||||
harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*harq_process_ul_ue->nb_rb*num_of_codewords;
|
||||
|
||||
mod_order = nr_get_Qm_ul(harq_process_ul_ue->mcs, 1);
|
||||
code_rate = nr_get_code_rate_ul(harq_process_ul_ue->mcs, 1);
|
||||
|
||||
harq_process_ul_ue->TBS = nr_compute_tbs( mod_order, harq_process_ul_ue->nb_rb, code_rate, harq_process_ul_ue->number_of_symbols, ulsch_ue->nb_re_dmrs, ulsch_ue->length_dmrs, harq_process_ul_ue->Nl);
|
||||
|
||||
//-----------------------------------------------------//
|
||||
// to be removed later when MAC is ready
|
||||
|
||||
if (harq_process_ul_ue != NULL){
|
||||
for (i = 0; i < harq_process_ul_ue->TBS / 8; i++)
|
||||
harq_process_ul_ue->a[i] = (unsigned char) rand();
|
||||
} else {
|
||||
LOG_E(PHY, "[phy_procedures_nrUE_TX] harq_process_ul_ue is NULL !!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------//
|
||||
|
||||
/////////////////////////ULSCH coding/////////////////////////
|
||||
///////////
|
||||
|
||||
@@ -204,7 +162,7 @@ uint8_t nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
mod_order = nr_get_Qm_ul(harq_process_ul_ue->mcs, 1);
|
||||
|
||||
available_bits = nr_get_G(harq_process_ul_ue->nb_rb,
|
||||
ulsch_ue->Nsymb_pusch,
|
||||
harq_process_ul_ue->number_of_symbols,
|
||||
ulsch_ue->nb_re_dmrs,
|
||||
ulsch_ue->length_dmrs,
|
||||
mod_order,
|
||||
@@ -230,22 +188,19 @@ uint8_t nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
mod_order,
|
||||
(int16_t *)ulsch_ue->d_mod);
|
||||
|
||||
|
||||
// pusch_transform_precoding(ulsch_ue, frame_parms, harq_pid);
|
||||
|
||||
///////////
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
mod_symbols[cwd_index] = (int32_t *)malloc16((NR_MAX_PUSCH_ENCODED_LENGTH)*sizeof(int32_t*));
|
||||
|
||||
memcpy(mod_symbols[cwd_index],ulsch_ue->d_mod,(available_bits/mod_order)*sizeof(int32_t));
|
||||
|
||||
}
|
||||
|
||||
start_symbol = 14 - ulsch_ue->Nsymb_pusch;
|
||||
start_symbol = 14 - harq_process_ul_ue->number_of_symbols;
|
||||
|
||||
/////////////////////////DMRS Modulation/////////////////////////
|
||||
///////////
|
||||
|
||||
pusch_dmrs = UE->nr_gold_pusch_dmrs[slot];
|
||||
n_dmrs = (harq_process_ul_ue->nb_rb*ulsch_ue->nb_re_dmrs);
|
||||
int16_t mod_dmrs[n_dmrs<<1];
|
||||
@@ -255,7 +210,6 @@ uint8_t nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
l0 = get_l0_ul(mapping_type, 2);
|
||||
nr_modulation(pusch_dmrs[l0][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated
|
||||
|
||||
|
||||
///////////
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -264,13 +218,10 @@ uint8_t nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
|
||||
tx_layers = (int16_t **)pusch_ue->txdataF_layers;
|
||||
|
||||
nr_layer_mapping((int16_t **)mod_symbols,
|
||||
nr_ue_layer_mapping(UE->ulsch[thread_id][gNB_id],
|
||||
harq_process_ul_ue->Nl,
|
||||
available_bits/mod_order,
|
||||
tx_layers);
|
||||
|
||||
for (uint32_t i = 0; i < 2*available_bits/mod_order; i++)
|
||||
tx_layers[0][i] = (tx_layers[0][i] * AMP) >> 15;
|
||||
|
||||
///////////
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -286,7 +237,7 @@ uint8_t nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
uint32_t nb_re_pusch, nb_re_dmrs_per_rb;
|
||||
uint32_t y_offset = 0;
|
||||
|
||||
for (l = start_symbol; l < start_symbol + ulsch_ue->Nsymb_pusch; l++) {
|
||||
for (l = start_symbol; l < start_symbol + harq_process_ul_ue->number_of_symbols; l++) {
|
||||
|
||||
if(l == dmrs_symbol)
|
||||
nb_re_dmrs_per_rb = ulsch_ue->nb_re_dmrs; // [hna] ulsch_ue->nb_re_dmrs = 6 in this configuration
|
||||
@@ -330,7 +281,7 @@ uint8_t nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
uint8_t k_prime=0;
|
||||
uint16_t m=0, n=0, dmrs_idx=0, k=0;
|
||||
|
||||
for (l=start_symbol; l<start_symbol+ulsch_ue->Nsymb_pusch; l++) {
|
||||
for (l=start_symbol; l<start_symbol+harq_process_ul_ue->number_of_symbols; l++) {
|
||||
|
||||
k = start_sc;
|
||||
|
||||
@@ -344,11 +295,12 @@ uint8_t nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15;
|
||||
|
||||
#ifdef DEBUG_PUSCH_MAPPING
|
||||
printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n",
|
||||
printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t dmrs: %d %d\n",
|
||||
dmrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[(sample_offsetF)<<1],
|
||||
((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1]);
|
||||
#endif
|
||||
|
||||
|
||||
dmrs_idx++;
|
||||
k_prime++;
|
||||
k_prime&=1;
|
||||
@@ -378,23 +330,37 @@ uint8_t nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
///////////
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
|
||||
uint8_t harq_pid,
|
||||
uint8_t slot,
|
||||
uint8_t Nl,
|
||||
uint8_t thread_id,
|
||||
uint8_t gNB_id,
|
||||
NR_DL_FRAME_PARMS *frame_parms) {
|
||||
|
||||
int tx_offset, ap;
|
||||
int32_t **txdata;
|
||||
int32_t **txdataF;
|
||||
int timing_advance;
|
||||
uint8_t Nl = UE->ulsch[thread_id][gNB_id][0]->harq_processes[harq_pid]->Nl; // cw 0
|
||||
|
||||
/////////////////////////IFFT///////////////////////
|
||||
///////////
|
||||
|
||||
tx_offset = slot*frame_parms->samples_per_slot;
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706)
|
||||
timing_advance = UE->timing_advance;
|
||||
#else
|
||||
timing_advance = 0;
|
||||
#endif
|
||||
|
||||
tx_offset = slot*frame_parms->samples_per_slot - timing_advance;
|
||||
|
||||
if (tx_offset < 0)
|
||||
tx_offset += frame_parms->samples_per_frame;
|
||||
|
||||
txdata = UE->common_vars.txdata;
|
||||
txdataF = UE->common_vars.txdataF;
|
||||
|
||||
@@ -413,7 +379,6 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
|
||||
frame_parms);
|
||||
}
|
||||
}
|
||||
|
||||
///////////
|
||||
////////////////////////////////////////////////////
|
||||
return 0;
|
||||
|
||||
@@ -234,8 +234,8 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2)
|
||||
if (N_ID_2 == 0) {
|
||||
char output_file[255];
|
||||
char sequence_name[255];
|
||||
sprintf(output_file, "pss_seq_%d_%d.m", N_ID_2, length);
|
||||
sprintf(sequence_name, "pss_seq_%d_%d", N_ID_2, length);
|
||||
sprintf(output_file, "pss_seq_%d_%u.m", N_ID_2, length);
|
||||
sprintf(sequence_name, "pss_seq_%d_%u", N_ID_2, length);
|
||||
printf("file %s sequence %s\n", output_file, sequence_name);
|
||||
|
||||
LOG_M(output_file, sequence_name, primary_synchro, LENGTH_PSS_NR, 1, 1);
|
||||
@@ -298,14 +298,14 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2)
|
||||
if (N_ID_2 == 0) {
|
||||
char output_file[255];
|
||||
char sequence_name[255];
|
||||
sprintf(output_file, "%s%d_%d%s","pss_seq_t_", N_ID_2, length, ".m");
|
||||
sprintf(sequence_name, "%s%d_%d","pss_seq_t_", N_ID_2, length);
|
||||
sprintf(output_file, "%s%d_%u%s","pss_seq_t_", N_ID_2, length, ".m");
|
||||
sprintf(sequence_name, "%s%d_%u","pss_seq_t_", N_ID_2, length);
|
||||
|
||||
printf("file %s sequence %s\n", output_file, sequence_name);
|
||||
|
||||
LOG_M(output_file, sequence_name, primary_synchro_time, length, 1, 1);
|
||||
sprintf(output_file, "%s%d_%d%s","pss_seq_f_", N_ID_2, length, ".m");
|
||||
sprintf(sequence_name, "%s%d_%d","pss_seq_f_", N_ID_2, length);
|
||||
sprintf(output_file, "%s%d_%u%s","pss_seq_f_", N_ID_2, length, ".m");
|
||||
sprintf(sequence_name, "%s%d_%u","pss_seq_f_", N_ID_2, length);
|
||||
LOG_M(output_file, sequence_name, synchroF_tmp, length, 1, 1);
|
||||
}
|
||||
|
||||
@@ -900,7 +900,7 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain
|
||||
pss_source = pss_index;
|
||||
|
||||
#ifdef DEBUG_PSS_NR
|
||||
printf("pss_index %d: n %6d peak_value %15llu\n", pss_index, n, (unsigned long long)pss_corr_ue[pss_index][n]);
|
||||
printf("pss_index %d: n %6u peak_value %15llu\n", pss_index, n, (unsigned long long)pss_corr_ue[pss_index][n]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -559,7 +559,10 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
}
|
||||
|
||||
chest_f_abs = (float*) calloc(nsymb_ce*nb_antennas_rx*nb_antennas_tx,sizeof(float));
|
||||
llr = (float*) calloc(coded_bits_per_codeword,sizeof(float)); // init to zero
|
||||
//llr = (float*) calloc(coded_bits_per_codeword,sizeof(float)); // Cppcheck returns "invalidFunctionArg" error.
|
||||
llr = (float*) malloc(coded_bits_per_codeword*sizeof(float));
|
||||
memset((void *)llr, 0,coded_bits_per_codeword*sizeof(float)); // init to zero
|
||||
|
||||
bit = malloc(coded_bits_per_codeword*sizeof(float));
|
||||
llr_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float)); // init to zero
|
||||
bit_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float));
|
||||
@@ -572,7 +575,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
pdcch_llr = (int8_t*) phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->llr;
|
||||
pdcch_comp = (int16_t*) phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp[0];
|
||||
pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->llr[0]; // stream 0
|
||||
// pdsch_llr = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars_SI[eNB_id]->llr[0]; // stream 0
|
||||
//pdsch_llr = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars_SI[eNB_id]->llr[0]; // stream 0
|
||||
pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp0[0];
|
||||
pdsch_mag = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_mag0[0];
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ float tput_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
|
||||
float tput_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
|
||||
float tput_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
|
||||
float tput_ue_max[NUMBER_OF_UE_MAX] = {0};
|
||||
|
||||
static void ia_receiver_on_off( FL_OBJECT *button, long arg)
|
||||
{
|
||||
if (fl_get_button(button)) {
|
||||
@@ -43,6 +44,7 @@ static void ia_receiver_on_off( FL_OBJECT *button, long arg)
|
||||
fl_set_object_color(button, FL_RED, FL_RED);
|
||||
}
|
||||
}
|
||||
|
||||
static void dl_traffic_on_off( FL_OBJECT *button, long arg)
|
||||
{
|
||||
if (fl_get_button(button)) {
|
||||
@@ -140,6 +142,7 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
|
||||
fdui->lte_phy_scope_enb->fdui = fdui;
|
||||
return fdui;
|
||||
}
|
||||
|
||||
void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
PHY_VARS_eNB *phy_vars_enb,
|
||||
int UE_id)
|
||||
@@ -325,7 +328,9 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
free(bit);
|
||||
free(chest_f_abs);
|
||||
}
|
||||
FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) {
|
||||
|
||||
FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void )
|
||||
{
|
||||
FL_OBJECT *obj;
|
||||
FD_lte_phy_scope_ue *fdui = fl_malloc( sizeof *fdui );
|
||||
// Define form
|
||||
@@ -429,11 +434,13 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) {
|
||||
fdui->lte_phy_scope_ue->fdui = fdui;
|
||||
return fdui;
|
||||
}
|
||||
|
||||
void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
PHY_VARS_UE *phy_vars_ue,
|
||||
int eNB_id,
|
||||
int UE_id,
|
||||
uint8_t subframe){
|
||||
uint8_t subframe)
|
||||
{
|
||||
int i,arx,atx,ind,k;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->frame_parms;
|
||||
int nsymb_ce = frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti;
|
||||
@@ -492,14 +499,14 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
if (phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]!=NULL) {
|
||||
mod0 = get_Qm(mcs0);
|
||||
coded_bits_per_codeword0 = get_G(frame_parms,
|
||||
phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->nb_rb,
|
||||
phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->rb_alloc_even,
|
||||
get_Qm(mcs0),
|
||||
phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->Nl,
|
||||
num_pdcch_symbols,
|
||||
frame,
|
||||
subframe,
|
||||
beamforming_mode);
|
||||
phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->nb_rb,
|
||||
phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->rb_alloc_even,
|
||||
get_Qm(mcs0),
|
||||
phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->Nl,
|
||||
num_pdcch_symbols,
|
||||
frame,
|
||||
subframe,
|
||||
beamforming_mode);
|
||||
} else {
|
||||
coded_bits_per_codeword0 = 0; //frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti);
|
||||
mod0=0;
|
||||
@@ -507,14 +514,14 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
if (phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]!=NULL) {
|
||||
mod1 = get_Qm(mcs1);
|
||||
coded_bits_per_codeword1 = get_G(frame_parms,
|
||||
phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]->harq_processes[harq_pid]->nb_rb,
|
||||
phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]->harq_processes[harq_pid]->rb_alloc_even,
|
||||
get_Qm(mcs1),
|
||||
phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]->harq_processes[harq_pid]->Nl,
|
||||
num_pdcch_symbols,
|
||||
frame,
|
||||
subframe,
|
||||
beamforming_mode);
|
||||
phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]->harq_processes[harq_pid]->nb_rb,
|
||||
phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]->harq_processes[harq_pid]->rb_alloc_even,
|
||||
get_Qm(mcs1),
|
||||
phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]->harq_processes[harq_pid]->Nl,
|
||||
num_pdcch_symbols,
|
||||
frame,
|
||||
subframe,
|
||||
beamforming_mode);
|
||||
} else {
|
||||
coded_bits_per_codeword1 = 0; //frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti);
|
||||
mod1=0;
|
||||
@@ -526,9 +533,14 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
chest_t_abs[arx] = (float*) calloc(frame_parms->ofdm_symbol_size,sizeof(float));
|
||||
}
|
||||
chest_f_abs = (float*) calloc(nsymb_ce*nb_antennas_rx*nb_antennas_tx,sizeof(float));
|
||||
llr0 = (float*) calloc(coded_bits_per_codeword0,sizeof(float)); // init to zero
|
||||
//llr0 = (float*) calloc(coded_bits_per_codeword0,sizeof(float)); // Cppcheck returns "invalidFunctionArg" error.
|
||||
llr0 = (float*) malloc(coded_bits_per_codeword0*sizeof(float));
|
||||
memset((void *)llr0, 0,coded_bits_per_codeword0*sizeof(float)); // init to zero
|
||||
bit0 = malloc(coded_bits_per_codeword0*sizeof(float));
|
||||
llr1 = (float*) calloc(coded_bits_per_codeword1,sizeof(float)); // init to zero
|
||||
|
||||
//llr1 = (float*) calloc(coded_bits_per_codeword1,sizeof(float)); // Cppcheck returns "invalidFunctionArg" error.
|
||||
llr1 = (float*) malloc(coded_bits_per_codeword1*sizeof(float));
|
||||
memset((void *)llr1, 0,coded_bits_per_codeword1*sizeof(float)); // init to zero
|
||||
bit1 = malloc(coded_bits_per_codeword1*sizeof(float));
|
||||
llr_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float)); // init to zero
|
||||
bit_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float));
|
||||
@@ -822,6 +834,4 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
for (int m=0; m<coded_bits_per_codeword1; ++m)
|
||||
phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[0][m]=0;
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "nr_phy_scope.h"
|
||||
#include "executables/nr-softmodem-common.h"
|
||||
|
||||
#define TPUT_WINDOW_LENGTH 100
|
||||
int otg_enabled;
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h>
|
||||
#include "common/ran_context.h"
|
||||
#include <openair1/PHY/defs_gNB.h>
|
||||
#include <nr-softmodem.h>
|
||||
#include <forms.h>
|
||||
#include "PHY/defs_gNB.h"
|
||||
//#include "PHY/defs_nrUE.h"
|
||||
@@ -67,6 +66,11 @@ typedef struct {
|
||||
FL_OBJECT * button_0;
|
||||
} FD_phy_scope_nrue;
|
||||
|
||||
typedef struct {
|
||||
int *argc;
|
||||
char **argv;
|
||||
} scopeParms_t;
|
||||
|
||||
extern unsigned char scope_enb_num_ue;
|
||||
FD_phy_scope_gnb * create_phy_scope_gnb( void );
|
||||
FD_phy_scope_nrue * create_phy_scope_nrue( void );
|
||||
@@ -82,5 +86,10 @@ void phy_scope_nrUE(FD_phy_scope_nrue *form,
|
||||
int eNB_id,
|
||||
int UE_id,
|
||||
uint8_t subframe);
|
||||
|
||||
|
||||
void startScope(scopeParms_t * p);
|
||||
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
#endif
|
||||
|
||||
@@ -898,39 +898,6 @@ typedef struct THREAD_STRUCT_s {
|
||||
PARALLEL_CONF_t parallel_conf;
|
||||
WORKER_CONF_t worker_conf;
|
||||
} THREAD_STRUCT;
|
||||
/*extern THREAD_STRUCT thread_struct;
|
||||
|
||||
static inline void set_parallel_conf(char *parallel_conf) {
|
||||
mapping config[]= {
|
||||
FOREACH_PARALLEL(GENERATE_ENUMTXT)
|
||||
{NULL,-1}
|
||||
};
|
||||
thread_struct.parallel_conf = (PARALLEL_CONF_t)map_str_to_int(config, parallel_conf);
|
||||
if (thread_struct.parallel_conf == -1 ) {
|
||||
LOG_E(ENB_APP,"Impossible value: %s\n", parallel_conf);
|
||||
thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void set_worker_conf(char *worker_conf) {
|
||||
mapping config[]={
|
||||
FOREACH_WORKER(GENERATE_ENUMTXT)
|
||||
{NULL, -1}
|
||||
};
|
||||
thread_struct.worker_conf = (WORKER_CONF_t)map_str_to_int(config, worker_conf);
|
||||
if (thread_struct.worker_conf == -1 ) {
|
||||
LOG_E(ENB_APP,"Impossible value: %s\n", worker_conf);
|
||||
thread_struct.worker_conf = WORKER_DISABLE ;
|
||||
}
|
||||
}
|
||||
|
||||
static inline PARALLEL_CONF_t get_thread_parallel_conf(void) {
|
||||
return thread_struct.parallel_conf;
|
||||
}
|
||||
|
||||
static inline WORKER_CONF_t get_thread_worker_conf(void) {
|
||||
return thread_struct.worker_conf;
|
||||
}*/
|
||||
|
||||
typedef enum {SF_DL, SF_UL, SF_S} lte_subframe_t;
|
||||
|
||||
|
||||
+31
-2
@@ -366,11 +366,15 @@ typedef struct {
|
||||
/// \brief Hold the channel estimates in time domain based on DRS.
|
||||
/// - first index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - second index: ? [0..4*ofdm_symbol_size[
|
||||
int32_t **drs_ch_estimates_time;
|
||||
int32_t **ul_ch_estimates_time;
|
||||
/// \brief Hold the channel estimates in frequency domain based on DRS.
|
||||
/// - first index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - second index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
int32_t **drs_ch_estimates;
|
||||
int32_t **ul_ch_estimates;
|
||||
/// \brief Uplink channel estimates extracted in PRBS.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
int32_t **ul_ch_estimates_ext;
|
||||
/// \brief Holds the compensated signal.
|
||||
/// - first index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - second index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
@@ -383,6 +387,28 @@ typedef struct {
|
||||
/// - first index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - second index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
int32_t **ul_ch_magb;
|
||||
/// \brief Cross-correlation of two UE signals.
|
||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
||||
/// - second index: symbol [0..]
|
||||
int32_t **rho;
|
||||
/// \f$\log_2(\max|H_i|^2)\f$
|
||||
int16_t log2_maxh;
|
||||
/// \brief Magnitude of Uplink Channel first layer (16QAM level/First 64QAM level).
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_UL[
|
||||
int32_t **ul_ch_mag0;
|
||||
/// \brief Magnitude of Uplink Channel second layer (16QAM level/First 64QAM level).
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_UL[
|
||||
int32_t **ul_ch_mag1[8][8];
|
||||
/// \brief Magnitude of Uplink Channel, first layer (2nd 64QAM level).
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_UL[
|
||||
int32_t **ul_ch_magb0;
|
||||
/// \brief Magnitude of Uplink Channel second layer (2nd 64QAM level).
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_UL[
|
||||
int32_t **ul_ch_magb1[8][8];
|
||||
/// measured RX power based on DRS
|
||||
int ulsch_power[2];
|
||||
/// \brief llr values.
|
||||
@@ -643,6 +669,9 @@ typedef struct PHY_VARS_gNB_s {
|
||||
|
||||
/// PDSCH DMRS sequence
|
||||
uint32_t ****nr_gold_pdsch_dmrs;
|
||||
|
||||
/// PUSCH DMRS
|
||||
uint32_t nr_gold_pusch[2][20][2][NR_MAX_PUSCH_DMRS_INIT_LENGTH_DWORD];
|
||||
|
||||
/// Indicator set to 0 after first SR
|
||||
uint8_t first_sr[NUMBER_OF_UE_MAX];
|
||||
|
||||
@@ -208,6 +208,7 @@
|
||||
|
||||
/// First Amplitude for QAM16 (\f$ 2^{15} \times 2/\sqrt{10}\f$)
|
||||
#define QAM16_n1 20724
|
||||
|
||||
/// Second Amplitude for QAM16 (\f$ 2^{15} \times 1/\sqrt{10}\f$)
|
||||
#define QAM16_n2 10362
|
||||
|
||||
|
||||
@@ -1134,6 +1134,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
|
||||
const int subframe = proc->subframe_rx;
|
||||
const int frame = proc->frame_rx;
|
||||
uint32_t harq_pid0 = subframe2harq_pid(&eNB->frame_parms,frame,subframe);
|
||||
int rvidx_tab[4] = {0,2,3,1};
|
||||
|
||||
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
|
||||
ulsch = eNB->ulsch[i];
|
||||
@@ -1150,8 +1151,8 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
|
||||
if ((ulsch) &&
|
||||
(ulsch->rnti>0) &&
|
||||
(ulsch_harq->status == ACTIVE) &&
|
||||
(ulsch_harq->frame == frame) &&
|
||||
(ulsch_harq->subframe == subframe) &&
|
||||
((ulsch_harq->frame == frame) || (ulsch_harq->repetition_number >1) ) &&
|
||||
((ulsch_harq->subframe == subframe) || (ulsch_harq->repetition_number >1) ) &&
|
||||
(ulsch_harq->handled == 0)) {
|
||||
// UE has ULSCH scheduling
|
||||
for (int rb=0;
|
||||
@@ -1208,6 +1209,10 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
|
||||
ulsch_harq->cqi_crc_status,
|
||||
ulsch_harq->O_ACK,
|
||||
eNB->ulsch_decoding_stats.p_time, eNB->ulsch_decoding_stats.max);
|
||||
if (ulsch_harq->repetition_number < ulsch_harq->total_number_of_repetitions){
|
||||
ulsch_harq->rvidx = rvidx_tab[(ulsch_harq->repetition_number%4)] ; // Set the correct rvidx for the next emtc repetitions
|
||||
ulsch_harq->repetition_number +=1 ; // Increment repetition_number for the next ULSCH allocation
|
||||
}
|
||||
//compute the expected ULSCH RX power (for the stats)
|
||||
ulsch_harq->delta_TF = get_hundred_times_delta_IF_eNB(eNB,i,harq_pid, 0); // 0 means bw_factor is not considered
|
||||
|
||||
@@ -1263,7 +1268,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
|
||||
*/
|
||||
ulsch_harq->handled = 1;
|
||||
} // ulsch in error
|
||||
else {
|
||||
else if(ulsch_harq->repetition_number == ulsch_harq->total_number_of_repetitions){
|
||||
fill_crc_indication(eNB,i,frame,subframe,0); // indicate ACK to MAC
|
||||
fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC
|
||||
ulsch_harq->status = SCH_IDLE;
|
||||
|
||||
@@ -54,6 +54,44 @@ void handle_nr_nfapi_bch_pdu(PHY_VARS_gNB *gNB,
|
||||
// adjust transmit amplitude here based on NFAPI info
|
||||
}
|
||||
|
||||
/*void handle_nr_nfapi_dlsch_pdu(PHY_VARS_gNB *gNB,int frame,int subframe,gNB_L1_rxtx_proc_t *proc,
|
||||
uint8_t codeword_index,
|
||||
uint8_t *sdu)
|
||||
{
|
||||
|
||||
int UE_id = 0; //Hardcode UE_id for now
|
||||
int harq_pid;
|
||||
|
||||
NR_gNB_DLSCH_t *dlsch0=NULL, *dlsch1=NULL;
|
||||
NR_DL_gNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL;
|
||||
|
||||
// Based on nr_fill_dci_and_dlsch only gNB->dlsch[0][0] gets filled now. So maybe we do not need dlsch1.
|
||||
dlsch0 = gNB->dlsch[UE_id][0];
|
||||
dlsch1 = gNB->dlsch[UE_id][1];
|
||||
|
||||
harq_pid = dlsch0->harq_ids[subframe];
|
||||
dlsch0_harq = dlsch0->harq_processes[harq_pid];
|
||||
dlsch1_harq = dlsch1->harq_processes[harq_pid];
|
||||
|
||||
|
||||
//if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU
|
||||
if(sdu == NULL) {
|
||||
LOG_E(PHY,"NFAPI: SFN/SF:%04d%d proc:TX:[frame %d subframe %d]: programming dlsch for round 0 \n",
|
||||
frame,subframe,
|
||||
proc->frame_tx,proc->slot_tx);
|
||||
return;
|
||||
}
|
||||
//AssertFatal(sdu!=NULL,"NFAPI: SFN/SF:%04d%d proc:TX:[frame %d subframe %d]: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d dlsch0_harq[round:%d SFN/SF:%d%d pdu:%p mcs:%d ndi:%d pdschstart:%d]\n",
|
||||
// frame,subframe,
|
||||
// proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid,
|
||||
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index,dlsch0_harq->round,dlsch0_harq->frame,dlsch0_harq->subframe,dlsch0_harq->pdu,dlsch0_harq->mcs,dlsch0_harq->ndi,dlsch0_harq->pdsch_start);
|
||||
if (codeword_index == 0) dlsch0_harq->pdu = sdu;
|
||||
else dlsch1_harq->pdu = sdu;
|
||||
LOG_I(PHY, "SFN/SF: %d/%d DLSCH PDU filled \n",frame, subframe);
|
||||
// }
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
void handle_nfapi_nr_dci_dl_pdu(PHY_VARS_gNB *gNB,
|
||||
int frame, int slot,
|
||||
@@ -156,7 +194,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (nfapi_mode && do_oai && !dont_send) {
|
||||
oai_nfapi_tx_req(Sched_INFO->TX_req);
|
||||
|
||||
|
||||
@@ -36,10 +36,13 @@
|
||||
#include "nfapi_nr_interface.h"
|
||||
|
||||
void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO);
|
||||
|
||||
void handle_nfapi_nr_dci_dl_pdu(PHY_VARS_gNB *gNB,
|
||||
int frame, int subframe,
|
||||
nfapi_nr_dl_config_dci_dl_pdu *dcl_dl_pdu);
|
||||
|
||||
void handle_nr_nfapi_dlsch_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
|
||||
nfapi_nr_dl_config_dlsch_pdu *dlsch_pdu,
|
||||
uint8_t *sdu);
|
||||
|
||||
void nr_fill_rx_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t harq_pid);
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "sched_nr.h"
|
||||
#include "PHY/MODULATION/modulation_common.h"
|
||||
|
||||
#include "PHY/MODULATION/nr_modulation.h"
|
||||
#include "PHY/LTE_TRANSPORT/if4_tools.h"
|
||||
#include "PHY/LTE_TRANSPORT/if5_tools.h"
|
||||
|
||||
@@ -248,3 +248,177 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx) {
|
||||
dB_fixed(signal_energy_nodc(ru->common.txdataF_BF[aa],2*slot_sizeF)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
void nr_fep0(RU_t *ru, int first_half) {
|
||||
|
||||
uint8_t start_symbol, end_symbol, l, aa;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
|
||||
if(first_half == 1) {
|
||||
start_symbol = 0;
|
||||
end_symbol = NR_SYMBOLS_PER_SLOT/2;
|
||||
} else {
|
||||
start_symbol = NR_SYMBOLS_PER_SLOT/2;
|
||||
end_symbol = NR_SYMBOLS_PER_SLOT;
|
||||
}
|
||||
|
||||
LOG_D(PHY,"In fep0 for slot = %d, first_half = %d, start_symbol = %d, end_symbol = %d\n", proc->tti_rx, first_half, start_symbol, end_symbol);
|
||||
// printf("fep0: slot %d\n",slot);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+proc->tti_rx, 1);
|
||||
|
||||
// remove_7_5_kHz(ru,(slot&1)+(proc->tti_rx<<1));
|
||||
for (l = start_symbol; l < end_symbol; l++) {
|
||||
for (aa = 0; aa < fp->nb_antennas_rx; aa++) {
|
||||
nr_slot_fep_ul(fp,
|
||||
ru->common.rxdata[aa],
|
||||
ru->common.rxdataF[aa],
|
||||
l,
|
||||
proc->tti_rx,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+proc->tti_rx, 0);
|
||||
}
|
||||
|
||||
|
||||
static void *nr_feprx_thread(void *param) {
|
||||
|
||||
RU_t *ru = (RU_t *)param;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
|
||||
|
||||
while (!oai_exit) {
|
||||
|
||||
if (wait_on_condition(&proc->mutex_fep,&proc->cond_fep,&proc->instance_cnt_fep,"NR feprx thread")<0) break;
|
||||
|
||||
if (oai_exit) break;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1, 1 );
|
||||
|
||||
nr_fep0(ru, 0);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1, 0 );
|
||||
|
||||
if (release_thread(&proc->mutex_fep,&proc->instance_cnt_fep,"nr_feprx thread")<0) break;
|
||||
|
||||
if (pthread_cond_signal(&proc->cond_fep) != 0) {
|
||||
printf("[gNB] ERROR pthread_cond_signal for nr_feprx thread exit\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void nr_init_feprx_thread(RU_t *ru) {
|
||||
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
|
||||
proc->instance_cnt_fep = -1;
|
||||
|
||||
pthread_mutex_init( &proc->mutex_fep, NULL);
|
||||
pthread_cond_init( &proc->cond_fep, NULL);
|
||||
|
||||
threadCreate(&proc->pthread_fep, nr_feprx_thread, (void*)ru, "feprx", -1, OAI_PRIORITY_RT);
|
||||
}
|
||||
|
||||
|
||||
void nr_fep_full_2thread(RU_t *ru, int slot) {
|
||||
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
|
||||
struct timespec wait;
|
||||
|
||||
// NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
|
||||
// if ((fp->frame_type == TDD) &&
|
||||
// (subframe_select(fp,proc->tti_rx) != SF_UL)) return;
|
||||
|
||||
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 );
|
||||
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=5000000L;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 );
|
||||
start_meas(&ru->ofdm_demod_stats);
|
||||
|
||||
if (pthread_mutex_timedlock(&proc->mutex_fep,&wait) != 0) {
|
||||
printf("[RU] ERROR pthread_mutex_lock for nr_feprx thread (IC %d)\n", proc->instance_cnt_fep);
|
||||
exit_fun( "error locking mutex_fep" );
|
||||
return;
|
||||
}
|
||||
|
||||
if (proc->instance_cnt_fep==0) {
|
||||
printf("[RU] FEP thread busy\n");
|
||||
exit_fun("FEP thread busy");
|
||||
pthread_mutex_unlock( &proc->mutex_fep );
|
||||
return;
|
||||
}
|
||||
|
||||
++proc->instance_cnt_fep;
|
||||
|
||||
|
||||
if (pthread_cond_signal(&proc->cond_fep) != 0) {
|
||||
printf("[RU] ERROR pthread_cond_signal for nr_feprx thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return;
|
||||
}
|
||||
//start_meas(&ru->ofdm_demod_wakeup_stats);
|
||||
|
||||
pthread_mutex_unlock( &proc->mutex_fep );
|
||||
|
||||
// call second slot in this symbol
|
||||
nr_fep0(ru, 1);
|
||||
|
||||
start_meas(&ru->ofdm_demod_wait_stats);
|
||||
wait_on_busy_condition(&proc->mutex_fep,&proc->cond_fep,&proc->instance_cnt_fep,"nr_feprx thread");
|
||||
stop_meas(&ru->ofdm_demod_wait_stats);
|
||||
if(opp_enabled == 1 && ru->ofdm_demod_wakeup_stats.p_time>30*3000){
|
||||
print_meas_now(&ru->ofdm_demod_wakeup_stats,"fep wakeup",stderr);
|
||||
printf("delay in fep wait on codition in frame_rx: %d subframe_rx: %d \n",proc->frame_rx,proc->tti_rx);
|
||||
}
|
||||
|
||||
stop_meas(&ru->ofdm_demod_stats);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 0 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void nr_fep_full(RU_t *ru, int slot) {
|
||||
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
int l, aa;
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
|
||||
// if ((fp->frame_type == TDD) &&
|
||||
// (subframe_select(fp,proc->tti_rx) != SF_UL)) return;
|
||||
|
||||
start_meas(&ru->ofdm_demod_stats);
|
||||
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 );
|
||||
|
||||
// remove_7_5_kHz(ru,proc->tti_rx<<1);
|
||||
// remove_7_5_kHz(ru,1+(proc->tti_rx<<1));
|
||||
|
||||
for (l = 0; l < fp->symbols_per_slot; l++) {
|
||||
for (aa = 0; aa < fp->nb_antennas_rx; aa++) {
|
||||
nr_slot_fep_ul(fp,
|
||||
ru->common.rxdata[aa],
|
||||
ru->common.rxdataF[aa],
|
||||
l,
|
||||
proc->tti_rx,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 0 );
|
||||
stop_meas(&ru->ofdm_demod_stats);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -31,12 +31,15 @@
|
||||
*/
|
||||
|
||||
#include "sched_nr.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
|
||||
nr_subframe_t nr_slot_select(nfapi_nr_config_request_t *cfg,
|
||||
unsigned char slot)
|
||||
{
|
||||
if (cfg->subframe_config.duplex_mode.value == FDD)
|
||||
if (cfg->subframe_config.duplex_mode.value == FDD || slot == NR_DOWNLINK_SLOT || nr_is_ssb_slot(cfg, slot) == 1)
|
||||
return(SF_DL);
|
||||
LOG_E(PHY,"Not developped TDD mode\n");
|
||||
else if (slot == NR_UPLINK_SLOT)
|
||||
return (SF_UL);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -26,10 +26,13 @@
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_dlsch.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
|
||||
#include "PHY/NR_ESTIMATION/nr_ul_estimation.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "sched_nr.h"
|
||||
#include "SCHED/sched_common_extern.h"
|
||||
#include "nfapi_interface.h"
|
||||
#include "SCHED/fapi_l1.h"
|
||||
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h"
|
||||
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h"
|
||||
#include "fapi_nr_l1.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
@@ -210,10 +213,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
|
||||
|
||||
void nr_ulsch_procedures(PHY_VARS_gNB *gNB,
|
||||
gNB_L1_rxtx_proc_t *proc,
|
||||
int UE_id,
|
||||
uint8_t harq_pid)
|
||||
void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int UE_id, uint8_t harq_pid)
|
||||
{
|
||||
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||
nfapi_nr_ul_config_ulsch_pdu *rel15_ul = &gNB->ulsch[UE_id+1][0]->harq_processes[harq_pid]->ulsch_pdu;
|
||||
@@ -249,9 +249,9 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB,
|
||||
UE_id,
|
||||
gNB->pusch_vars[UE_id]->llr,
|
||||
frame_parms,
|
||||
proc->frame_rx,
|
||||
frame_rx,
|
||||
nfapi_ulsch_pdu_rel15->number_symbols,
|
||||
proc->slot_rx,
|
||||
slot_rx,
|
||||
harq_pid,
|
||||
0);
|
||||
|
||||
@@ -261,7 +261,74 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
|
||||
|
||||
void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, gNB_L1_rxtx_proc_t *proc) {
|
||||
void nr_fill_rx_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t harq_pid)
|
||||
{
|
||||
// --------------------
|
||||
// [hna] TO BE CLEANED
|
||||
// --------------------
|
||||
|
||||
// nfapi_rx_indication_pdu_t *pdu;
|
||||
|
||||
int timing_advance_update;
|
||||
int sync_pos;
|
||||
|
||||
// pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||
|
||||
// gNB->UL_INFO.rx_ind.sfn_sf = frame<<4| slot_rx;
|
||||
// gNB->UL_INFO.rx_ind.rx_indication_body.tl.tag = NFAPI_RX_INDICATION_BODY_TAG;
|
||||
|
||||
// pdu = &gNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list[gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus];
|
||||
|
||||
// pdu->rx_ue_information.handle = gNB->ulsch[UE_id+1][0]->handle;
|
||||
// pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
|
||||
// pdu->rx_ue_information.rnti = gNB->ulsch[UE_id+1][0]->rnti;
|
||||
// pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
|
||||
// pdu->rx_indication_rel8.length = gNB->ulsch[UE_id+1][0]->harq_processes[harq_pid]->TBS>>3;
|
||||
// pdu->rx_indication_rel8.offset = 1; // DJP - I dont understand - but broken unless 1 ???? 0; // filled in at the end of the UL_INFO formation
|
||||
// pdu->data = gNB->ulsch[UE_id+1][0]->harq_processes[harq_pid]->b;
|
||||
// estimate timing advance for MAC
|
||||
sync_pos = nr_est_timing_advance_pusch(gNB, UE_id);
|
||||
timing_advance_update = sync_pos; // - gNB->frame_parms.nb_prefix_samples/4; //to check
|
||||
// printf("\x1B[33m" "timing_advance_update = %d\n" "\x1B[0m", timing_advance_update);
|
||||
|
||||
switch (gNB->frame_parms.N_RB_DL) {
|
||||
// case 6: /* nothing to do */ break;
|
||||
// case 15: timing_advance_update /= 2; break;
|
||||
// case 25: timing_advance_update /= 4; break;
|
||||
// case 50: timing_advance_update /= 8; break;
|
||||
// case 75: timing_advance_update /= 12; break;
|
||||
case 106: timing_advance_update /= 16; break;
|
||||
case 217: timing_advance_update /= 32; break;
|
||||
default: abort();
|
||||
}
|
||||
|
||||
// put timing advance command in 0..63 range
|
||||
timing_advance_update += 31;
|
||||
|
||||
if (timing_advance_update < 0) timing_advance_update = 0;
|
||||
if (timing_advance_update > 63) timing_advance_update = 63;
|
||||
|
||||
// pdu->rx_indication_rel8.timing_advance = timing_advance_update;
|
||||
|
||||
// estimate UL_CQI for MAC (from antenna port 0 only)
|
||||
// int SNRtimes10 = dB_fixed_times10(gNB->pusch_vars[UE_id]->ulsch_power[0]) - 300;//(10*gNB->measurements.n0_power_dB[0]);
|
||||
|
||||
// if (SNRtimes10 < -640) pdu->rx_indication_rel8.ul_cqi=0;
|
||||
// else if (SNRtimes10 > 635) pdu->rx_indication_rel8.ul_cqi=255;
|
||||
// else pdu->rx_indication_rel8.ul_cqi=(640+SNRtimes10)/5;
|
||||
|
||||
// LOG_D(PHY,"[PUSCH %d] Frame %d Subframe %d Filling RX_indication with SNR %d (%d), timing_advance %d (update %d)\n",
|
||||
// harq_pid,frame,slot_rx,SNRtimes10,pdu->rx_indication_rel8.ul_cqi,pdu->rx_indication_rel8.timing_advance,
|
||||
// timing_advance_update);
|
||||
|
||||
// gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus++;
|
||||
// gNB->UL_INFO.rx_ind.sfn_sf = frame<<4 | slot_rx;
|
||||
|
||||
// pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
||||
}
|
||||
|
||||
|
||||
void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
|
||||
uint8_t symbol;
|
||||
unsigned char aa;
|
||||
@@ -273,7 +340,7 @@ void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, gNB_L1_rxtx_proc_t *proc) {
|
||||
gNB->common_vars.rxdata[aa],
|
||||
gNB->common_vars.rxdataF[aa],
|
||||
symbol,
|
||||
proc->slot_rx,
|
||||
slot_rx,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
@@ -282,23 +349,18 @@ void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, gNB_L1_rxtx_proc_t *proc) {
|
||||
}
|
||||
|
||||
|
||||
void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, gNB_L1_rxtx_proc_t *proc, uint8_t symbol_start, uint8_t symbol_end) {
|
||||
void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, uint8_t symbol_start, uint8_t symbol_end) {
|
||||
|
||||
uint8_t UE_id;
|
||||
uint8_t symbol;
|
||||
uint8_t harq_pid = 0; // [hna] Previously in LTE, the harq_pid was obtained from the subframe number (Synchronous HARQ)
|
||||
// In NR, this should be signaled through uplink scheduling dci (i.e, DCI 0_0, 0_1) (Asynchronous HARQ)
|
||||
|
||||
for (UE_id = 0; UE_id < NUMBER_OF_NR_UE_MAX; UE_id++) {
|
||||
|
||||
for (UE_id = 0; UE_id < 1; UE_id++) { // temporary set to 1 untill list of connected UEs is implemented
|
||||
for(symbol = symbol_start; symbol < symbol_end; symbol++) {
|
||||
|
||||
nr_rx_pusch(gNB, UE_id, proc->frame_rx, proc->slot_rx, symbol, harq_pid);
|
||||
|
||||
nr_rx_pusch(gNB, UE_id, frame_rx, slot_rx, symbol, harq_pid);
|
||||
}
|
||||
|
||||
nr_ulsch_procedures(gNB, proc, UE_id, harq_pid);
|
||||
|
||||
nr_ulsch_procedures(gNB, frame_rx, slot_rx, UE_id, harq_pid);
|
||||
nr_fill_rx_indication(gNB, frame_rx, slot_rx, UE_id, harq_pid); // indicate SDU to MAC
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -37,14 +37,16 @@
|
||||
nr_slot_t nr_slot_select (nfapi_nr_config_request_t *cfg, unsigned char slot);
|
||||
void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PARMS *fp);
|
||||
void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, int frame_tx, int slot_tx, int do_meas);
|
||||
void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, gNB_L1_rxtx_proc_t *proc);
|
||||
void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, gNB_L1_rxtx_proc_t *proc, uint8_t symbol_start, uint8_t symbol_end);
|
||||
void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx);
|
||||
void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, uint8_t symbol_start, uint8_t symbol_end);
|
||||
void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot);
|
||||
void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx);
|
||||
void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx);
|
||||
void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols);
|
||||
void nr_init_feptx_thread(RU_t *ru);
|
||||
void fep_full(RU_t *ru,int slot);
|
||||
void nr_init_feprx_thread(RU_t *ru);
|
||||
void nr_fep_full(RU_t *ru, int slot);
|
||||
void nr_fep_full_2thread(RU_t *ru, int slot);
|
||||
void feptx_prec(RU_t *ru,int frame_tx,int tti_tx);
|
||||
int nr_phy_init_RU(RU_t *ru);
|
||||
|
||||
|
||||
@@ -2464,56 +2464,28 @@ void ue_pucch_procedures(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_
|
||||
|
||||
|
||||
void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
uint8_t gNB_id,
|
||||
uint8_t thread_id)
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
uint8_t gNB_id,
|
||||
uint8_t thread_id)
|
||||
{
|
||||
//NR_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
|
||||
NR_UE_ULSCH_t *ulsch_ue;
|
||||
NR_UL_UE_HARQ_t *harq_process_ul_ue;
|
||||
//int32_t ulsch_start=0;
|
||||
int slot_tx = proc->nr_tti_tx;
|
||||
int frame_tx = proc->frame_tx;
|
||||
int harq_pid, i, TBS;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,VCD_FUNCTION_IN);
|
||||
|
||||
LOG_D(PHY,"****** start TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx);
|
||||
LOG_I(PHY,"****** start TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx);
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&ue->phy_proc_tx);
|
||||
#endif
|
||||
|
||||
|
||||
harq_pid = 0; //temporary implementation
|
||||
|
||||
/*
|
||||
generate_ue_ulsch_params(ue,
|
||||
0,
|
||||
gNB_id,
|
||||
harq_pid);
|
||||
*/
|
||||
|
||||
ulsch_ue = ue->ulsch[thread_id][gNB_id][0]; // cwd_index = 0
|
||||
harq_process_ul_ue = ulsch_ue->harq_processes[harq_pid];
|
||||
|
||||
//-----------------------------------------------------//
|
||||
// to be removed later when MAC is ready
|
||||
|
||||
uint8_t Qm = nr_get_Qm_ul(harq_process_ul_ue->mcs, 1);
|
||||
uint16_t R = nr_get_code_rate_ul(harq_process_ul_ue->mcs, 1);
|
||||
TBS = nr_compute_tbs( Qm, R, harq_process_ul_ue->nb_rb, ulsch_ue->Nsymb_pusch, ulsch_ue->nb_re_dmrs, ulsch_ue->length_dmrs, harq_process_ul_ue->Nl);
|
||||
|
||||
|
||||
for (i = 0; i < TBS / 8; i++)
|
||||
harq_process_ul_ue->a[i] = (unsigned char) rand();
|
||||
|
||||
//-----------------------------------------------------//
|
||||
uint8_t harq_pid = 0; //temporary implementation
|
||||
|
||||
nr_ue_ulsch_procedures(ue,
|
||||
harq_pid,
|
||||
slot_tx,
|
||||
0,
|
||||
thread_id,
|
||||
gNB_id);
|
||||
|
||||
|
||||
@@ -2528,11 +2500,14 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
|
||||
|
||||
|
||||
nr_ue_pusch_common_procedures(ue,
|
||||
harq_pid,
|
||||
slot_tx,
|
||||
harq_process_ul_ue->Nl,
|
||||
thread_id,
|
||||
gNB_id,
|
||||
&ue->frame_parms);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
if ((ue->UE_mode[eNB_id] == PRACH) &&
|
||||
(ue->frame_parms.prach_config_common.prach_Config_enabled==1)) {
|
||||
@@ -2549,7 +2524,7 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
*/
|
||||
|
||||
LOG_D(PHY,"****** end TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx);
|
||||
LOG_I(PHY,"****** end TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT);
|
||||
#if UE_TIMING_TRACE
|
||||
@@ -3047,7 +3022,7 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,
|
||||
&format_found,
|
||||
crc_scrambled_values);
|
||||
#ifdef NR_PDCCH_SCHED_DEBUG
|
||||
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Ending function nr_dci_decoding_procedure() -> dci_cnt=%d\n",dci_cnt);
|
||||
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Ending function nr_dci_decoding_procedure() -> dci_cnt=%u\n",dci_cnt);
|
||||
#endif
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DCI_DECODING, VCD_FUNCTION_OUT);
|
||||
@@ -3409,7 +3384,7 @@ void nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int eNB
|
||||
first_symbol_flag = 0;
|
||||
#if UE_TIMING_TRACE
|
||||
uint8_t slot = 0;
|
||||
if(m >= ue->frame_parms.symbols_per_tti>>1)
|
||||
if(m >= ue->frame_parms.symbols_per_slot>>1)
|
||||
slot = 1;
|
||||
start_meas(&ue->dlsch_llr_stats_parallelization[ue->current_thread_id[nr_tti_rx]][slot]);
|
||||
#endif
|
||||
@@ -3561,14 +3536,19 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
|
||||
uint8_t nb_re_dmrs = 6; //(dmrs_type==NFAPI_NR_DMRS_TYPE1)?6:4;
|
||||
uint16_t length_dmrs = 1; //cfg->pdsch_config.dmrs_max_length.value;
|
||||
uint16_t nb_symb_sch = 9;
|
||||
nr_downlink_indication_t dl_indication;
|
||||
fapi_nr_rx_indication_t rx_ind;
|
||||
|
||||
if (dlsch0==NULL)
|
||||
AssertFatal(0,"dlsch0 should be defined at this level \n");
|
||||
|
||||
|
||||
harq_pid = dlsch0->current_harq_pid;
|
||||
is_cw0_active = dlsch0->harq_processes[harq_pid]->status;
|
||||
nb_symb_sch = dlsch0->harq_processes[harq_pid]->nb_symbols;
|
||||
|
||||
|
||||
|
||||
if(dlsch1)
|
||||
is_cw1_active = dlsch1->harq_processes[harq_pid]->status;
|
||||
|
||||
@@ -3792,6 +3772,33 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
|
||||
LOG_D(PHY," ------ end ldpc decoder for AbsSubframe %d.%d ------ \n", frame_rx, nr_tti_rx);
|
||||
|
||||
LOG_I(PHY, "harq_pid: %d, TBS expected dlsch0: %d, TBS expected dlsch1: %d \n",harq_pid, dlsch0->harq_processes[harq_pid]->TBS, dlsch1->harq_processes[harq_pid]->TBS);
|
||||
|
||||
if(ret<dlsch0->max_ldpc_iterations+1){
|
||||
// fill dl_indication message
|
||||
dl_indication.module_id = ue->Mod_id;
|
||||
dl_indication.cc_id = ue->CC_id;
|
||||
dl_indication.gNB_index = eNB_id;
|
||||
dl_indication.frame = frame_rx;
|
||||
dl_indication.slot = nr_tti_rx;
|
||||
|
||||
dl_indication.rx_ind = &rx_ind; // hang on rx_ind instance
|
||||
dl_indication.proc=proc;
|
||||
|
||||
//dl_indication.rx_ind->number_pdus
|
||||
rx_ind.rx_indication_body[0].pdu_type = FAPI_NR_RX_PDU_TYPE_DLSCH;
|
||||
rx_ind.rx_indication_body[0].pdsch_pdu.pdu = dlsch0->harq_processes[harq_pid]->b;
|
||||
rx_ind.rx_indication_body[0].pdsch_pdu.pdu_length = dlsch0->harq_processes[harq_pid]->TBS>>3;
|
||||
LOG_D(PHY, "PDU length in bits: %d, in bytes: %d \n", dlsch0->harq_processes[harq_pid]->TBS, rx_ind.rx_indication_body[0].pdsch_pdu.pdu_length);
|
||||
rx_ind.number_pdus = 1;
|
||||
|
||||
//ue->dl_indication.rx_ind = &dlsch1->harq_processes[harq_pid]->b; //no data, only dci for now
|
||||
dl_indication.dci_ind = NULL; //&ue->dci_ind;
|
||||
// send to mac
|
||||
if (ue->if_inst && ue->if_inst->dl_indication)
|
||||
ue->if_inst->dl_indication(&dl_indication);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3902,7 +3909,7 @@ void *UE_thread_slot1_dl_processing(void *arg) {
|
||||
0);
|
||||
*/
|
||||
// 1- perform FFT
|
||||
for (int l=1; l<ue->frame_parms.symbols_per_tti>>1; l++)
|
||||
for (int l=1; l<ue->frame_parms.symbols_per_slot>>1; l++)
|
||||
{
|
||||
//if( (l != pilot0) && (l != pilot1))
|
||||
{
|
||||
@@ -3934,7 +3941,7 @@ void *UE_thread_slot1_dl_processing(void *arg) {
|
||||
}
|
||||
|
||||
// 2- perform Channel Estimation for slot1
|
||||
for (int l=1; l<ue->frame_parms.symbols_per_tti>>1; l++)
|
||||
for (int l=1; l<ue->frame_parms.symbols_per_slot>>1; l++)
|
||||
{
|
||||
if(l == pilot1)
|
||||
{
|
||||
@@ -4022,8 +4029,8 @@ void *UE_thread_slot1_dl_processing(void *arg) {
|
||||
PDSCH,
|
||||
ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0],
|
||||
NULL,
|
||||
(ue->frame_parms.symbols_per_tti>>1),
|
||||
ue->frame_parms.symbols_per_tti-1,
|
||||
(ue->frame_parms.symbols_per_slot>>1),
|
||||
ue->frame_parms.symbols_per_slot-1,
|
||||
abstraction_flag);
|
||||
LOG_D(PHY," ------ end PDSCH ChannelComp/LLR slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, nr_tti_rx);
|
||||
LOG_D(PHY," ------ --> PDSCH Turbo Decoder slot 0/1: AbsSubframe %d.%d ------ \n", frame_rx%1024, nr_tti_rx);
|
||||
@@ -4037,8 +4044,8 @@ void *UE_thread_slot1_dl_processing(void *arg) {
|
||||
SI_PDSCH,
|
||||
ue->dlsch_SI[eNB_id],
|
||||
NULL,
|
||||
(ue->frame_parms.symbols_per_tti>>1),
|
||||
ue->frame_parms.symbols_per_tti-1,
|
||||
(ue->frame_parms.symbols_per_slot>>1),
|
||||
ue->frame_parms.symbols_per_slot-1,
|
||||
abstraction_flag);
|
||||
}
|
||||
|
||||
@@ -4050,8 +4057,8 @@ void *UE_thread_slot1_dl_processing(void *arg) {
|
||||
P_PDSCH,
|
||||
ue->dlsch_p[eNB_id],
|
||||
NULL,
|
||||
(ue->frame_parms.symbols_per_tti>>1),
|
||||
ue->frame_parms.symbols_per_tti-1,
|
||||
(ue->frame_parms.symbols_per_slot>>1),
|
||||
ue->frame_parms.symbols_per_slot-1,
|
||||
abstraction_flag);
|
||||
}
|
||||
// do procedures for RA-RNTI
|
||||
@@ -4062,8 +4069,8 @@ void *UE_thread_slot1_dl_processing(void *arg) {
|
||||
RA_PDSCH,
|
||||
ue->dlsch_ra[eNB_id],
|
||||
NULL,
|
||||
(ue->frame_parms.symbols_per_tti>>1),
|
||||
ue->frame_parms.symbols_per_tti-1,
|
||||
(ue->frame_parms.symbols_per_slot>>1),
|
||||
ue->frame_parms.symbols_per_slot-1,
|
||||
abstraction_flag);
|
||||
}
|
||||
|
||||
@@ -4119,10 +4126,10 @@ int is_pbch_in_slot(fapi_nr_pbch_config_t *pbch_config, int frame, int slot, int
|
||||
|
||||
|
||||
int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
uint8_t eNB_id,
|
||||
uint8_t do_pdcch_flag,
|
||||
runmode_t mode)
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
uint8_t eNB_id,
|
||||
uint8_t do_pdcch_flag,
|
||||
runmode_t mode)
|
||||
{
|
||||
int frame_rx = proc->frame_rx;
|
||||
int nr_tti_rx = proc->nr_tti_rx;
|
||||
@@ -4234,7 +4241,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
//set active for testing, to be removed
|
||||
ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active = 1;
|
||||
}
|
||||
else
|
||||
else
|
||||
ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active = 0;
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
@@ -4309,7 +4316,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
// looking for pbch only in slot where it is supposed to be
|
||||
if ((ue->decode_MIB == 1) && slot_pbch)
|
||||
{
|
||||
LOG_D(PHY," ------ PBCH ChannelComp/LLR: frame.slot %d.%d ------ \n", frame_rx%1024, nr_tti_rx);
|
||||
LOG_I(PHY," ------ PBCH ChannelComp/LLR: frame.slot %d.%d ------ \n", frame_rx%1024, nr_tti_rx);
|
||||
|
||||
for (int i=1; i<4; i++) {
|
||||
|
||||
@@ -4334,6 +4341,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
// do procedures for C-RNTI
|
||||
if (ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active == 1) {
|
||||
|
||||
LOG_I(PHY, "DLSCH data reception at nr_tti_rx: %d \n \n", nr_tti_rx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN);
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
|
||||
@@ -922,7 +922,7 @@ boolean_t select_pucch_resource(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int uci_size
|
||||
/* a valid resource has already be found outside this function */
|
||||
resource_set_found = TRUE;
|
||||
ready_pucch_resource_id = TRUE;
|
||||
pucch_resource_indicator = pucch_resource_indicator;
|
||||
//pucch_resource_indicator = pucch_resource_indicator;
|
||||
}
|
||||
|
||||
if (resource_set_found == TRUE) {
|
||||
|
||||
@@ -35,38 +35,30 @@
|
||||
#include <unistd.h>
|
||||
#include <execinfo.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
#include "common/config/config_load_configmodule.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "LAYER2/MAC/mac_vars.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/defs_UE.h"
|
||||
#include "PHY/phy_vars.h"
|
||||
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "SCHED/sched_common_vars.h"
|
||||
#include "LAYER2/MAC/mac_vars.h"
|
||||
|
||||
#include "OCG_vars.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "UTIL/LISTS/list.h"
|
||||
|
||||
#include "unitary_defs.h"
|
||||
|
||||
|
||||
#include "PHY/TOOLS/lte_phy_scope.h"
|
||||
|
||||
#include "dummy_functions.c"
|
||||
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
|
||||
#include "PHY/MODULATION/modulation_common.h"
|
||||
#include "PHY/MODULATION/modulation_eNB.h"
|
||||
#include "PHY/MODULATION/modulation_UE.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
|
||||
#include "PHY/TOOLS/lte_phy_scope.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "SCHED/sched_common_vars.h"
|
||||
#include "SCHED_UE/sched_UE.h"
|
||||
#include "common/config/config_load_configmodule.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
#include "UTIL/LISTS/list.h"
|
||||
#include "OCG_vars.h"
|
||||
#include "unitary_defs.h"
|
||||
#include "dummy_functions.c"
|
||||
#include "executables/thread-common.h"
|
||||
|
||||
void feptx_ofdm(RU_t *ru, int frame, int subframe);
|
||||
void feptx_prec(RU_t *ru, int frame, int subframe);
|
||||
@@ -85,30 +77,6 @@ double t_rx_min = 1000000000; /*!< \brief initial min process time for rx */
|
||||
int n_tx_dropped = 0; /*!< \brief initial max process time for tx */
|
||||
int n_rx_dropped = 0; /*!< \brief initial max process time for rx */
|
||||
|
||||
//THREAD_STRUCT thread_struct;
|
||||
static THREAD_STRUCT thread_struct;
|
||||
|
||||
void set_parallel_conf(char *parallel_conf) {
|
||||
if(strcmp(parallel_conf,"PARALLEL_SINGLE_THREAD")==0) thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
|
||||
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_SPLIT;
|
||||
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_TRX_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_TRX_SPLIT;
|
||||
|
||||
printf("[CONFIG] parallel conf is set to %d\n",thread_struct.parallel_conf);
|
||||
}
|
||||
void set_worker_conf(char *worker_conf) {
|
||||
if(strcmp(worker_conf,"WORKER_DISABLE")==0) thread_struct.worker_conf = WORKER_DISABLE;
|
||||
else if(strcmp(worker_conf,"WORKER_ENABLE")==0) thread_struct.worker_conf = WORKER_ENABLE;
|
||||
|
||||
printf("[CONFIG] worker conf is set to %d\n",thread_struct.worker_conf);
|
||||
}
|
||||
PARALLEL_CONF_t get_thread_parallel_conf(void) {
|
||||
return thread_struct.parallel_conf;
|
||||
}
|
||||
WORKER_CONF_t get_thread_worker_conf(void) {
|
||||
return thread_struct.worker_conf;
|
||||
}
|
||||
|
||||
|
||||
int emulate_rf = 0;
|
||||
|
||||
void handler(int sig) {
|
||||
@@ -122,8 +90,6 @@ void handler(int sig) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//DCI2_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2_2A[2];
|
||||
|
||||
DCI1E_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2_1E[2];
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
#define BW 5.0
|
||||
|
||||
|
||||
PHY_VARS_eNB *PHY_vars_eNB,*PHY_vars_eNB1,*PHY_vars_eNB2;
|
||||
PHY_VARS_eNB *PHY_vars_eNB, *PHY_vars_eNB1, *PHY_vars_eNB2;
|
||||
PHY_VARS_UE *PHY_vars_UE[2];
|
||||
|
||||
#define DLSCH_RB_ALLOC 0x1fff // igore DC component,RB13
|
||||
@@ -699,7 +699,7 @@ int main(int argc, char **argv) {
|
||||
bzero(txdataF2[0],FRAME_LENGTH_BYTES_NO_PREFIX);
|
||||
bzero(txdataF2[1],FRAME_LENGTH_BYTES_NO_PREFIX);
|
||||
#else
|
||||
txdata = PHY_vars_eNB->lte_eNB_common_vars.txdata[eNb_id];
|
||||
txdata = PHY_vars_eNB->common_vars.txdataF[eNb_id];
|
||||
txdata1 = PHY_vars_eNB1->lte_eNB_common_vars.txdata[eNb_id];
|
||||
txdata2 = PHY_vars_eNB2->lte_eNB_common_vars.txdata[eNb_id];
|
||||
#endif
|
||||
|
||||
@@ -33,30 +33,28 @@
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
#include "LAYER2/MAC/mac_vars.h"
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs_common.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/defs_UE.h"
|
||||
#include "PHY/phy_vars.h"
|
||||
#include "targets/RT/USER/lte-softmodem.h"
|
||||
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
|
||||
#include "PHY/TOOLS/lte_phy_scope.h"
|
||||
#include "SCHED/sched_common_vars.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "SCHED_UE/sched_UE.h"
|
||||
#include "LAYER2/MAC/mac_vars.h"
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
#include "OCG_vars.h"
|
||||
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
|
||||
#include "unitary_defs.h"
|
||||
|
||||
#include "PHY/TOOLS/lte_phy_scope.h"
|
||||
#include "dummy_functions.c"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "common/config/config_load_configmodule.h"
|
||||
#include "executables/thread-common.h"
|
||||
#include "targets/RT/USER/lte-softmodem.h"
|
||||
|
||||
double cpuf;
|
||||
#define inMicroS(a) (((double)(a))/(cpu_freq_GHz*1000.0))
|
||||
//#define MCS_COUNT 23//added for PHY abstraction
|
||||
@@ -96,7 +94,6 @@ nfapi_tx_request_pdu_t tx_pdu_list[MAX_NUM_TX_REQUEST_PDU];
|
||||
nfapi_tx_request_t TX_req;
|
||||
Sched_Rsp_t sched_resp;
|
||||
|
||||
THREAD_STRUCT thread_struct;
|
||||
|
||||
void
|
||||
fill_nfapi_ulsch_config_request(nfapi_ul_config_request_pdu_t *ul_config_pdu,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user