Commit 1244c9a2 authored by Robert Schmidt's avatar Robert Schmidt

Merge branch 'integration_2024_w14' into 'develop'

Integration `2024.w14`

Closes #775 and #773

See merge request oai/openairinterface5g!2663

* !2411 Simple and generic trx_write support of out of time order requests
* !2532 moving decision on DCI format type to UE MAC
* !2565 improvements in security of nrUE
* !2656 remove stored G in UE DL, not needed and creating issues with DCI format 11/type0
* !2658 Fix sleeping ue at synchro
* !2649 NR SRS RRC assrtion removal
* !2662 Avoid concurrent write while filling RX/CRC.indication
* Remove obsolete "version" parameter from yaml files used on avra
* !2664 Remove duplicated NAS message send, already done above
* !2605 Improve performance polar encoder i.e., 3GPP 38.212 5.3.1.2 function
* !2629 Msg2 and Msg3 at gNB: check allocation before committing to Msg2
* !2657 replace transient malloc by stack allocation, add defense code on block size
* !2631 chore(ci): some docker improvements
* !2654 Pucch2 polar rx dynamic range fix
* !2666 [E2 Agent] Fix E2 Setup Request for ASan
* !2661 CI: iperf/iperf3 UDP analysis function fix → review in progress, review to be completed
#/*
# * 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
# */
/inet.*brd/{print "interfaceToUse="$NF"done"}
BEGIN{lineIdx=0;captureUEDesc=0}
{
if ($0 ~/UE0/) {
captureUEDesc = 1
}
if (captureUEDesc == 1) {
captureLine[lineIdx] = $0
lineIdx = lineIdx + 1
}
print $0
}
END {
for (ueIdx = 1; ueIdx < num_ues; ueIdx++) {
print ""
for (k = 0; k < lineIdx; k++) {
if (captureLine[k] ~/UE0/) {
mLine = captureLine[k]
gsub("UE0", "UE"ueIdx, mLine)
print mLine
} else {
if (captureLine[k] ~/MSIN=/) {
mLine = captureLine[k]
MSIN=sprintf("%08d", 1111+int(ueIdx))
gsub("00001111", MSIN, mLine)
print mLine
} else {
print captureLine[k]
}
}
}
}
}
BEGIN{lineIdx=0}
{
captureLine[lineIdx] = $0
lineIdx = lineIdx + 1
print $0
}
END{
for (ueIdx = 1; ueIdx < num_ues; ueIdx++) {
for (k = 0; k < lineIdx; k++) {
if (captureLine[k] ~/UserName=/) {
mLine = captureLine[k]
MSIN=sprintf("%08d", 1111+int(ueIdx))
gsub("00001111", MSIN, mLine)
print mLine
} else {
if (captureLine[k] ~/SubscriptionIndex/) {
mLine = captureLine[k]
MSIN=sprintf("%d", 111+int(ueIdx))
gsub("111", MSIN, mLine)
print mLine
} else {
print captureLine[k]
}
}
}
}
}
......@@ -169,6 +169,27 @@ def AnalyzeBuildLogs(buildRoot, images, globalStatus):
collectInfo[image] = files
return collectInfo
# pyshark livecapture launches 2 processes:
# * One using dumpcap -i lIfs -w - (ie redirecting the packets to STDOUT)
# * One using tshark -i - -w loFile (ie capturing from STDIN from previous process)
# but in fact the packets are read by the following loop before being in fact
# really written to loFile.
# So it is mandatory to keep the loop
def LaunchPySharkCapture(lIfs, lFilter, loFile):
capture = pyshark.LiveCapture(interface=lIfs, bpf_filter=lFilter, output_file=loFile, debug=False)
for packet in capture.sniff_continuously():
pass
def StopPySharkCapture(testcase):
with cls_cmd.LocalCmd() as myCmd:
cmd = 'killall tshark'
myCmd.run(cmd, reportNonZero=False)
cmd = 'killall dumpcap'
myCmd.run(cmd, reportNonZero=False)
time.sleep(5)
cmd = f'mv /tmp/capture_{testcase}.pcap ../cmake_targets/log/{testcase}/.'
myCmd.run(cmd, timeout=100, reportNonZero=False)
return False
#-----------------------------------------------------------
# Class Declaration
#-----------------------------------------------------------
......@@ -1183,17 +1204,6 @@ class Containerize():
self.UndeployGenObject(HTML, RAN, UE)
self.exitStatus = 1
# pyshark livecapture launches 2 processes:
# * One using dumpcap -i lIfs -w - (ie redirecting the packets to STDOUT)
# * One using tshark -i - -w loFile (ie capturing from STDIN from previous process)
# but in fact the packets are read by the following loop before being in fact
# really written to loFile.
# So it is mandatory to keep the loop
def LaunchPySharkCapture(self, lIfs, lFilter, loFile):
capture = pyshark.LiveCapture(interface=lIfs, bpf_filter=lFilter, output_file=loFile, debug=False)
for packet in capture.sniff_continuously():
pass
def CaptureOnDockerNetworks(self):
myCmd = cls_cmd.LocalCmd(d = self.yamlPath[0])
cmd = 'docker-compose -f docker-compose-ci.yml config | grep com.docker.network.bridge.name | sed -e "s@^.*name: @@"'
......@@ -1218,7 +1228,7 @@ class Containerize():
myCmd.run(cmd, timeout=5, reportNonZero=False)
myCmd.close()
return
x = threading.Thread(target = self.LaunchPySharkCapture, args = (interfaces,capture_filter,output_file,))
x = threading.Thread(target = LaunchPySharkCapture, args = (interfaces,capture_filter,output_file,))
x.daemon = True
x.start()
......@@ -1307,21 +1317,9 @@ class Containerize():
HTML.CreateHtmlTestRow('UE log Analysis', 'KO', logStatus)
else:
HTML.CreateHtmlTestRow('UE log Analysis', 'OK', CONST.ALL_PROCESSES_OK)
if self.tsharkStarted:
self.tsharkStarted = True
cmd = 'killall tshark'
myCmd2.run(cmd, reportNonZero=False)
cmd = 'killall dumpcap'
myCmd2.run(cmd, reportNonZero=False)
time.sleep(5)
ymlPath = self.yamlPath[0].split('/')
# The working dir is still logPath
cmd = f'mv /tmp/capture_{ymlPath[1]}.pcap .'
myCmd2.run(cmd, timeout=100, reportNonZero=False)
self.tsharkStarted = False
myCmd2.close()
if self.tsharkStarted:
self.tsharkStarted = StopPySharkCapture(ymlPath[1])
logging.debug('\u001B[1m Undeploying \u001B[0m')
logging.debug(f'Working dir is back {self.yamlPath[0]}')
cmd = 'docker-compose -f docker-compose-ci.yml down -v'
......
......@@ -66,26 +66,28 @@ import numpy as np
def Iperf_ComputeModifiedBW(idx, ue_num, profile, args):
result = re.search('-b\s*(?P<iperf_bandwidth>[0-9\.]+)(?P<unit>[KMG])', str(args))
if result is None:
raise Exception('Iperf bandwidth not found or in incorrect format!')
iperf_bandwidth = result.group('iperf_bandwidth')
raise ValueError(f'requested iperf bandwidth not found in iperf options "{args}"')
iperf_bandwidth = float(result.group('iperf_bandwidth'))
if iperf_bandwidth == 0:
raise ValueError('iperf bandwidth set to 0 - invalid value')
if profile == 'balanced':
iperf_bandwidth_new = float(iperf_bandwidth)/ue_num
if profile == 'single-ue':
iperf_bandwidth_new = float(iperf_bandwidth)
iperf_bandwidth_new = iperf_bandwidth/ue_num
if profile =='single-ue':
iperf_bandwidth_new = iperf_bandwidth
if profile == 'unbalanced':
# residual is 2% of max bw
residualBW = float(iperf_bandwidth) / 50
residualBW = iperf_bandwidth / 50
if idx == 0:
iperf_bandwidth_new = float(iperf_bandwidth) - ((ue_num - 1) * residualBW)
iperf_bandwidth_new = iperf_bandwidth - ((ue_num - 1) * residualBW)
else:
iperf_bandwidth_new = residualBW
iperf_bandwidth_str = result.group(0)
iperf_bandwidth_unit = result.group(2)
iperf_bandwidth_str_new = f"-b {'%.2f' % iperf_bandwidth_new}{iperf_bandwidth_unit}"
result = re.sub(iperf_bandwidth_str, iperf_bandwidth_str_new, str(args))
if result is None:
raise Exception('Calculate Iperf bandwidth failed!')
return result
args_new = re.sub(iperf_bandwidth_str, iperf_bandwidth_str_new, str(args))
if iperf_bandwidth_unit == 'K':
iperf_bandwidth_new = iperf_bandwidth_new / 1000
return iperf_bandwidth_new, args_new
def Iperf_ComputeTime(args):
result = re.search('-t\s*(?P<iperf_time>\d+)', str(args))
......@@ -140,7 +142,7 @@ def Iperf_analyzeV3BIDIRJson(filename):
msg += f'Receiver Bitrate UL : {receiver_bitrate_ul} Mbps\n'
return (True, msg)
def Iperf_analyzeV3UDP(filename, iperf_bitrate_threshold, iperf_packetloss_threshold):
def Iperf_analyzeV3UDP(filename, iperf_bitrate_threshold, iperf_packetloss_threshold, target_bitrate):
if (not os.path.isfile(filename)):
return (False, 'Iperf3 UDP: Log file not present')
if (os.path.getsize(filename)==0):
......@@ -171,15 +173,15 @@ def Iperf_analyzeV3UDP(filename, iperf_bitrate_threshold, iperf_packetloss_thres
sender_bitrate = float(sender_bitrate) / 1000
if receiver_unit == 'Kbits/sec':
receiver_bitrate = float(receiver_bitrate) / 1000
br_perf = 100 * float(receiver_bitrate) / float(sender_bitrate)
br_perf = 100 * float(receiver_bitrate) / float(target_bitrate)
br_perf = '%.2f ' % br_perf
sender_bitrate = '%.2f ' % float(sender_bitrate)
receiver_bitrate = '%.2f ' % float(receiver_bitrate)
req_msg = f'Sender Bitrate : {sender_bitrate} Mbps'
bir_msg = f'Receiver Bitrate : {receiver_bitrate} Mbps'
req_msg = f'Sender Bitrate : {sender_bitrate} Mbps'
bir_msg = f'Receiver Bitrate: {receiver_bitrate} Mbps'
brl_msg = f'{br_perf}%'
jit_msg = f'Jitter : {receiver_jitter}'
pal_msg = f'Packet Loss : {receiver_packetloss} %'
jit_msg = f'Jitter : {receiver_jitter}'
pal_msg = f'Packet Loss : {receiver_packetloss} %'
if float(br_perf) < float(iperf_bitrate_threshold):
brl_msg = f'too low! < {iperf_bitrate_threshold}%'
if float(receiver_packetloss) > float(iperf_packetloss_threshold):
......@@ -189,29 +191,21 @@ def Iperf_analyzeV3UDP(filename, iperf_bitrate_threshold, iperf_packetloss_thres
else:
return (False, 'Could not analyze iperf report')
def Iperf_analyzeV2UDP(server_filename, iperf_bitrate_threshold, iperf_packetloss_threshold, iperf_opt):
def Iperf_analyzeV2UDP(server_filename, iperf_bitrate_threshold, iperf_packetloss_threshold, target_bitrate):
result = None
if (not os.path.isfile(server_filename)):
return (False, 'Could not analyze, server report not found!')
return (False, 'Iperf UDP: Server report not found!')
if (os.path.getsize(server_filename)==0):
return (False, 'Iperf UDP: Log file is empty')
# Computing the requested bandwidth in float
req_bw = 1.0 # default iperf throughput, in Mbps
result = re.search('-b *(?P<iperf_bandwidth>[0-9\.]+)(?P<magnitude>[kKMG])', iperf_opt)
if result is not None:
req_bw = float(result.group('iperf_bandwidth'))
magn = result.group('magnitude')
if magn == "k" or magn == "K":
req_bw /= 1000
elif magn == "G":
req_bw *= 1000
statusTemplate = '(?:|\[ *\d+\].*) +0\.0-\s*(?P<duration>[0-9\.]+) +sec +[0-9\.]+ [kKMG]Bytes +(?P<bitrate>[0-9\.]+) (?P<magnitude>[kKMG])bits\/sec +(?P<jitter>[0-9\.]+) ms +(\d+\/ *\d+) +(\((?P<packetloss>[0-9\.]+)%\))'
statusTemplate = r'(?:|\[ *\d+\].*) +0\.0-\s*(?P<duration>[0-9\.]+) +sec +[0-9\.]+ [kKMG]Bytes +(?P<bitrate>[0-9\.]+) (?P<magnitude>[kKMG])bits\/sec +(?P<jitter>[0-9\.]+) ms +(\d+\/ *\d+) +(\((?P<packetloss>[0-9\.]+)%\))'
with open(server_filename, 'r') as server_file:
for line in server_file.readlines():
res = re.search(statusTemplate, str(line))
if res is not None:
result = res
result = re.search(statusTemplate, str(line))
if result is not None:
break
if result is None:
return (False, 'Could not parse server report!')
bitrate = float(result.group('bitrate'))
magn = result.group('magnitude')
if magn == "k" or magn == "K":
......@@ -220,16 +214,16 @@ def Iperf_analyzeV2UDP(server_filename, iperf_bitrate_threshold, iperf_packetlos
bitrate *= 1000
jitter = float(result.group('jitter'))
packetloss = float(result.group('packetloss'))
br_perf = float(bitrate)/float(req_bw) * 100
br_perf = float(bitrate)/float(target_bitrate) * 100
br_perf = '%.2f ' % br_perf
result = float(br_perf) >= float(iperf_bitrate_threshold) and float(packetloss) <= float(iperf_packetloss_threshold)
req_msg = f'Req Bitrate : {req_bw}'
bir_msg = f'Bitrate : {bitrate}'
req_msg = f'Req Bitrate : {target_bitrate}'
bir_msg = f'Bitrate : {bitrate}'
brl_msg = f'Bitrate Perf: {br_perf} %'
if float(br_perf) < float(iperf_bitrate_threshold):
brl_msg += f' (too low! <{iperf_bitrate_threshold}%)'
jit_msg = f'Jitter : {jitter}'
jit_msg = f'Jitter : {jitter}'
pal_msg = f'Packet Loss : {packetloss}'
if float(packetloss) > float(iperf_packetloss_threshold):
pal_msg += f' (too high! >{self.iperf_packetloss_threshold}%)'
......@@ -801,7 +795,7 @@ class OaiCiTest():
logPath = f'../cmake_targets/log/{ymlPath[1]}'
if udpIperf:
iperf_opt = Iperf_ComputeModifiedBW(idx, ue_num, self.iperf_profile, self.iperf_args)
target_bitrate, iperf_opt = Iperf_ComputeModifiedBW(idx, ue_num, self.iperf_profile, self.iperf_args)
# note: for UDP testing we don't want to use json report - reports 0 Mbps received bitrate
jsonReport = ""
# note: enable server report collection on the UE side, no need to store and collect server report separately on the server side
......@@ -819,7 +813,7 @@ class OaiCiTest():
cmd_svr.run(f'{svr.getCmdPrefix()} iperf -c {ueIP} -B {svrIP} {iperf_opt} -i1 2>&1 | tee {client_filename}', timeout=iperf_time*1.5)
cmd_ue.run(f'cp {client_filename} {logPath}/{client_filename}')
cmd_ue.run(f'cp {server_filename} {logPath}/{server_filename}')
status, msg = Iperf_analyzeV2UDP(server_filename, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, iperf_opt)
status, msg = Iperf_analyzeV2UDP(server_filename, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate)
else:
with cls_cmd.getConnection(ue.getHost()) as cmd_ue, cls_cmd.getConnection(EPC.IPAddress) as cmd_svr:
port = 5002 + idx
......@@ -835,7 +829,7 @@ class OaiCiTest():
else:
cmd_ue.copyin(f'/tmp/{client_filename}', client_filename)
if udpIperf:
status, msg = Iperf_analyzeV3UDP(client_filename, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold)
status, msg = Iperf_analyzeV3UDP(client_filename, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate)
elif bidirIperf:
status, msg = Iperf_analyzeV3BIDIRJson(client_filename)
else:
......
......@@ -85,7 +85,7 @@ gNBs =
powerRampingStep = 1;
#ra_ReponseWindow
#1,2,4,8,10,20,40,80
ra_ResponseWindow = 4;
ra_ResponseWindow = 5;
#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3;
......
......@@ -88,7 +88,7 @@ gNBs =
powerRampingStep = 1;
#ra_ReponseWindow
#1,2,4,8,10,20,40,80
ra_ResponseWindow = 4;
ra_ResponseWindow = 5;
#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3;
......
......@@ -82,7 +82,7 @@ gNBs =
powerRampingStep = 1;
#ra_ReponseWindow
#1,2,4,8,10,20,40,80
ra_ResponseWindow = 4;
ra_ResponseWindow = 5;
#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
......
......@@ -611,10 +611,6 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
if RAN.eNBIPAddress == '' or RAN.eNBUserName == '' or RAN.eNBPassword == '' or RAN.eNBSourceCodePath == '':
HELP.eNBSrvHelp(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, RAN.eNBSourceCodePath)
sys.exit('Insufficient Parameter')
if (EPC.IPAddress!= '') and (EPC.IPAddress != 'none'):
SSH.copyout(EPC.IPAddress, EPC.UserName, EPC.Password, cwd + "/tcp_iperf_stats.awk", "/tmp")
SSH.copyout(EPC.IPAddress, EPC.UserName, EPC.Password, cwd + "/active_net_interfaces.awk", "/tmp")
else:
if CiTestObj.UEIPAddress == '' or CiTestObj.ranRepository == '' or CiTestObj.ranBranch == '' or CiTestObj.UEUserName == '' or CiTestObj.UEPassword == '' or CiTestObj.UESourceCodePath == '':
HELP.GenericHelp(CONST.Version)
......
......@@ -366,7 +366,6 @@ class RANManagement():
self.testCase_id = HTML.testCase_id
mySSH = SSH.SSHConnection()
cwd = os.getcwd()
mySSH.copyout(lIpAddr,lUserName,lPassWord, cwd + "/active_net_interfaces.awk", "/tmp")
#Get pcap on enb and/or gnb if enabled in the xml
if self.eNB_Trace=='yes':
......
#/*
# * 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
# */
BEGIN{max=0;min=10000}
{
if ($0 ~/Mbits/) {
if ($0 ~/KBytes/) {
split($0,a,"KBytes")
} else {
split($0,a,"MBytes")
}
split(a[2],b)
if (b[1]>max) {
max=b[1]
}
if (b[1]<min) {
min=b[1]
}
}
}
END{print "Avg Bitrate : " b[1] " Mbits/sec Max Bitrate : " max " Mbits/sec Min Bitrate : " min " Mbits/sec"}
version: '3.8'
services:
oai-gnb:
image: oai-gnb:latest
......
version: '3.8'
services:
oai-gnb:
image: oai-gnb-aw2s:latest
......
......@@ -295,7 +295,16 @@
(Test16: Format 2 19-bit 8/106 PRB),
(Test17: Format 2 32-bit 8/106 PRB),
(Test18: Format 2 32-bit 16/106 PRB),
(Test19: Format 2 64-bit 16/106 PRB)</desc>
(Test19: Format 2 64-bit 16/106 PRB),
(Test20: Format 0 1-bit Ack miss 273 PRB),
(Test21: Format 0 2-bit Ack miss 273 PRB),
(Test22: Format 0 2-bit Ack miss+SR 273 PRB),
(Test23: Format 2 4-bit 2/273 PRB),
(Test24: Format 2 7-bit 2/273 PRB),
(Test25: Format 2 11-bit 2/273 PRB),
(Test26: Format 2 12-bit 8/273 PRB),
(Test27: Format 2 19-bit 8/273 PRB),
(Test28: Format 2 64-bit 16/273 PRB)</desc>
<main_exec>nr_pucchsim</main_exec>
<main_exec_args>-R 106 -i 1 -P 0 -b 1 -s-2 -n1000
-R 106 -i 1 -P 0 -b 2 -s-2 -n1000
......@@ -315,8 +324,17 @@
-R 106 -i 1 -P 2 -q8 -b 19 -s-3 -n1000
-R 106 -i 1 -P 2 -q8 -b 32 -s-3 -n1000
-R 106 -i 1 -P 2 -q16 -b 32 -s-3 -n1000
-R 106 -i 1 -P 2 -q16 -b 64 -s-3 -n1000</main_exec_args>
<tags>test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 test12 test13 test14 test15 test16 test17 test18 test19</tags>
-R 106 -i 1 -P 2 -q16 -b 64 -s-3 -n1000
-R 273 -z8 -i 1 -P 0 -b 1 -s-2 -n1000
-R 273 -z8 -i 1 -P 0 -b 2 -s-2 -n1000
-R 273 -z8 -i 1 -P 0 -b 2 -s-2 -c -n1000
-R 273 -z8 -i 1 -P 2 -b 4 -s0 -n1000
-R 273 -z8 -i 1 -P 2 -b 7 -s3 -n1000
-R 273 -z8 -i 1 -P 2 -b 11 -s6 -n1000
-R 273 -z8 -i 1 -P 2 -q8 -b 12 -s-3 -n1000
-R 273 -z8 -i 1 -P 2 -q8 -b 19 -s-3 -n1000
-R 273 -z8 -i 1 -P 2 -q16 -b 64 -s-3 -n1000</main_exec_args>
<tags>test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 test12 test13 test14 test15 test16 test17 test18 test19 test20 test21 test22 test23 test24 test25 test26 test27 test28</tags>
<search_expr_true>PUCCH test OK</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
<nruns>3</nruns>
......
......@@ -488,7 +488,7 @@ function main() {
[ "$CLEAN" = "1" ] && rm -rf $DIR/$BUILD_DIR/build
if [[ $TARGET_LIST != "" ]]; then
if [[ $TARGET_LIST != "" ]] && [[ -f $OPENAIR_DIR/CMakeLists.txt ]]; then
# add some default libraries that should always be built
# for eNB, gNB, UEs, simulators
if [[ $gNB == 1 || $eNB == 1 || $UE == 1 || $nrUE == 1 || $SIMUS_PHY == 1 || $RU == 1 ]]; then
......
......@@ -32,6 +32,7 @@
#include <stdint.h>
#include "assertions.h"
#include "common/utils/assertions.h"
#include "nr_common.h"
#include <complex.h>
......@@ -52,6 +53,15 @@ static const uint8_t bit_reverse_table_256[] = {
0x3B, 0xBB, 0x7B, 0xFB, 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7,
0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF};
void reverse_bits_u8(uint8_t const* in, size_t sz, uint8_t* out)
{
DevAssert(in != NULL);
DevAssert(out != NULL);
for(size_t i = 0; i < sz; ++i)
out[i] = bit_reverse_table_256[in[i]];
}
// Reverse bits implementation based on http://graphics.stanford.edu/~seander/bithacks.html
uint64_t reverse_bits(uint64_t in, int n_bits)
{
......
......@@ -34,6 +34,7 @@
#define __COMMON_UTILS_NR_NR_COMMON__H__
#include <stdint.h>
#include <stdlib.h>
#include "assertions.h"
#include "PHY/defs_common.h"
......@@ -175,8 +176,11 @@ static inline int get_num_dmrs(uint16_t dmrs_mask ) {
}
uint64_t reverse_bits(uint64_t in, int n_bits);
void reverse_bits_u8(uint8_t const* in, size_t sz, uint8_t* out);
uint64_t from_nrarfcn(int nr_bandP, uint8_t scs_index, uint32_t dl_nrarfcn);
uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint8_t scs_index, uint32_t bw);
int get_first_ul_slot(int nrofDownlinkSlots, int nrofDownlinkSymbols, int nrofUplinkSymbols);
int cce_to_reg_interleaving(const int R, int k, int n_shift, const int C, int L, const int N_regs);
int get_SLIV(uint8_t S, uint8_t L);
......
......@@ -67,9 +67,17 @@ RUN chmod +x /tini
# In some network environments, GIT proxy is required
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
#create the WORKDIR
# Copying only the needed files to create ran-base
WORKDIR /oai-ran/cmake_targets/tools
COPY cmake_targets/tools/build_helper \
cmake_targets/tools/uhd-4.x-tdd-patch.diff \
./
WORKDIR /oai-ran/cmake_targets
COPY cmake_targets/build_oai .
WORKDIR /oai-ran
COPY . .
COPY oaienv .
#run build_oai -I to get the builder image
RUN /bin/sh oaienv && \
......
......@@ -52,9 +52,17 @@ ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
#create the WORKDIR
# Copying only the needed files to create ran-base
WORKDIR /oai-ran/cmake_targets/tools
COPY cmake_targets/tools/build_helper \
cmake_targets/tools/uhd-4.x-tdd-patch.diff \
./
WORKDIR /oai-ran/cmake_targets
COPY cmake_targets/build_oai .
WORKDIR /oai-ran
COPY . .
COPY oaienv .
#run build_oai -I to get the builder image
RUN /bin/sh oaienv && \
......
......@@ -55,9 +55,17 @@ RUN chmod +x /tini
# In some network environments, GIT proxy is required
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
#create the WORKDIR
# Copying only the needed files to create ran-base
WORKDIR /oai-ran/cmake_targets/tools
COPY cmake_targets/tools/build_helper \
cmake_targets/tools/uhd-4.x-tdd-patch.diff \
./
WORKDIR /oai-ran/cmake_targets
COPY cmake_targets/build_oai .
WORKDIR /oai-ran
COPY . .
COPY oaienv .
#run build_oai -I to get the builder image
RUN /bin/sh oaienv && \
......
......@@ -79,9 +79,17 @@ ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
# create the WORKDIR
# Copying only the needed files to create ran-base
WORKDIR /oai-ran/cmake_targets/tools
COPY cmake_targets/tools/build_helper \
cmake_targets/tools/uhd-4.x-tdd-patch.diff \
./
WORKDIR /oai-ran/cmake_targets
COPY cmake_targets/build_oai .
WORKDIR /oai-ran
COPY . .
COPY oaienv .
#run build_oai -I to get the builder image
RUN /bin/sh oaienv && \
......
......@@ -40,9 +40,17 @@ RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
software-properties-common \
tzdata \
procps \
libsctp1 \
libboost-chrono1.71.0 \
libboost-date-time1.71.0 \
libboost-filesystem1.71.0 \
libboost-regex1.71.0 \
libboost-serialization1.71.0 \
libboost-thread1.71.0 \
libboost-system1.71.0 \
libboost-program-options1.71.0 \
tzdata \
libblas3 \
libatlas3-base \
libconfig9 \
......@@ -63,6 +71,7 @@ RUN apt-get update && \
libasan5 \
libubsan1 \
liblapacke; fi' && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt/oai-enb/bin
......@@ -86,16 +95,6 @@ COPY --from=enb-build \
COPY --from=enb-base /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=enb-base /usr/local/lib/libuhd.so.4.4.0 /usr/local/lib
COPY --from=enb-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-enb/bin
COPY --from=enb-base \
/usr/lib/x86_64-linux-gnu/libboost_chrono.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_regex.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_thread.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_system.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai_device.so" && \
/bin/bash -c "ln -s /usr/local/lib/liboai_eth_transpro.so /usr/local/lib/liboai_transpro.so" && \
......
......@@ -34,7 +34,7 @@ FROM ran-build:latest AS gnb-build
FROM ubuntu:focal as oai-gnb
ARG BUILD_OPTION
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe
ENV TZ=Europe/Paris
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
......@@ -42,6 +42,14 @@ RUN apt-get update && \
software-properties-common \
procps \
libsctp1 \
libboost-chrono1.71.0 \
libboost-date-time1.71.0 \
libboost-filesystem1.71.0 \
libboost-regex1.71.0 \
libboost-serialization1.71.0 \
libboost-thread1.71.0 \
libboost-system1.71.0 \
libboost-program-options1.71.0 \
tzdata \
libblas3 \
libatlas3-base \
......@@ -63,6 +71,7 @@ RUN apt-get update && \
libasan5 \
libubsan1 \
liblapacke; fi' && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt/oai-gnb/bin
......@@ -86,16 +95,6 @@ COPY --from=gnb-build \
COPY --from=gnb-base /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=gnb-base /usr/local/lib/libuhd.so.4.4.0 /usr/local/lib
COPY --from=gnb-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-gnb/bin
COPY --from=gnb-base \
/usr/lib/x86_64-linux-gnu/libboost_chrono.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_regex.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_thread.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_system.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai_device.so" && \
ldconfig && \
......
......@@ -40,9 +40,17 @@ RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
software-properties-common \
tzdata \
procps \
libsctp1 \
libboost-chrono1.71.0 \
libboost-date-time1.71.0 \
libboost-filesystem1.71.0 \
libboost-regex1.71.0 \
libboost-serialization1.71.0 \
libboost-thread1.71.0 \
libboost-system1.71.0 \
libboost-program-options1.71.0 \
tzdata \
liblapacke \
libatlas3-base \
libconfig9 \
......@@ -63,6 +71,7 @@ RUN apt-get update && \
libasan5 \
libubsan1 \
liblapacke; fi' && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt/oai-lte-ue/bin
......@@ -89,17 +98,6 @@ COPY --from=lte-ue-base /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=lte-ue-base /usr/local/lib/libuhd.so.4.4.0 /usr/local/lib
COPY --from=lte-ue-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-lte-ue/bin
COPY --from=lte-ue-base \
/usr/lib/x86_64-linux-gnu/libboost_chrono.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_regex.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_thread.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_system.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai_device.so" && \
ldconfig && \
ldd /opt/oai-lte-ue/bin/lte-uesoftmodem
......
......@@ -40,8 +40,16 @@ RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
software-properties-common \
libsctp1 \
procps \
libsctp1 \
libboost-chrono1.71.0 \
libboost-date-time1.71.0 \
libboost-filesystem1.71.0 \
libboost-regex1.71.0 \
libboost-serialization1.71.0 \
libboost-thread1.71.0 \
libboost-system1.71.0 \
libboost-program-options1.71.0 \
tzdata \
liblapacke \
libatlas3-base \
......@@ -62,6 +70,7 @@ RUN apt-get update && \
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
libasan5 \
libubsan1; fi' && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt/oai-nr-ue/bin
......@@ -89,17 +98,6 @@ COPY --from=nr-ue-base /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=nr-ue-base /usr/local/lib/libuhd.so.4.4.0 /usr/local/lib
COPY --from=nr-ue-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-nr-ue/bin
COPY --from=nr-ue-base \
/usr/lib/x86_64-linux-gnu/libboost_chrono.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_regex.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_thread.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_system.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai_device.so" && \
ldconfig && \
ldd /opt/oai-nr-ue/bin/nr-uesoftmodem
......
......@@ -94,10 +94,6 @@
*
*/
#define RX_JOB_ID 0x1010
#define TX_JOB_ID 100
typedef enum {
pss = 0,
pbch = 1,
......@@ -213,10 +209,6 @@ static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot)
.rach_ind = *rach_ind,
};
send_nsa_standalone_msg(&UL_INFO, rach_ind->header.message_id);
for (int i = 0; i < rach_ind->number_of_pdus; i++)
{
free_and_zero(rach_ind->pdu_list[i].preamble_list);
}
free_and_zero(rach_ind->pdu_list);
free_and_zero(rach_ind);
}
......@@ -503,7 +495,6 @@ static void RU_write(nr_rxtx_thread_data_t *rxtxD) {
if (mac->phy_config_request_sent &&
openair0_cfg[0].duplex_mode == duplex_mode_TDD &&
!get_softmodem_params()->continuous_tx) {
int slots_frame = UE->frame_parms.slots_per_frame;
int curr_slot = nr_ue_slot_select(&UE->nrUE_config, slot);
if (curr_slot != NR_DOWNLINK_SLOT) {
......@@ -520,18 +511,12 @@ static void RU_write(nr_rxtx_thread_data_t *rxtxD) {
flags = TX_BURST_MIDDLE;
}
if (flags || IS_SOFTMODEM_RFSIM)
AssertFatal(rxtxD->writeBlockSize ==
UE->rfdevice.trx_write_func(&UE->rfdevice,
proc->timestamp_tx,
txp,
rxtxD->writeBlockSize,
UE->frame_parms.nb_antennas_tx,
flags),"");
int tmp =
openair0_write_reorder(&UE->rfdevice, proc->timestamp_tx, txp, rxtxD->writeBlockSize, UE->frame_parms.nb_antennas_tx, flags);
AssertFatal(tmp == rxtxD->writeBlockSize, "");
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
memset(txp[i], 0, rxtxD->writeBlockSize);
}
void processSlotTX(void *arg)
......@@ -666,14 +651,8 @@ void dummyWrite(PHY_VARS_NR_UE *UE,openair0_timestamp timestamp, int writeBlockS
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
dummy_tx[i]=dummy_tx_data[i];
AssertFatal( writeBlockSize ==
UE->rfdevice.trx_write_func(&UE->rfdevice,
timestamp,
dummy_tx,
writeBlockSize,
UE->frame_parms.nb_antennas_tx,
4),"");
int tmp = UE->rfdevice.trx_write_func(&UE->rfdevice, timestamp, dummy_tx, writeBlockSize, UE->frame_parms.nb_antennas_tx, 4);
AssertFatal(writeBlockSize == tmp, "");
}
void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, bool toTrash) {
......@@ -690,13 +669,13 @@ void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, bool toTrash)
4*((x*UE->frame_parms.samples_per_subframe)+
UE->frame_parms.get_samples_slot_timestamp(slot,&UE->frame_parms,0));
}
AssertFatal( UE->frame_parms.get_samples_per_slot(slot,&UE->frame_parms) ==
UE->rfdevice.trx_read_func(&UE->rfdevice,
timestamp,
rxp,
UE->frame_parms.get_samples_per_slot(slot,&UE->frame_parms),
UE->frame_parms.nb_antennas_rx), "");
int tmp = UE->rfdevice.trx_read_func(&UE->rfdevice,
timestamp,
rxp,
UE->frame_parms.get_samples_per_slot(slot, &UE->frame_parms),
UE->frame_parms.nb_antennas_rx);
AssertFatal(UE->frame_parms.get_samples_per_slot(slot, &UE->frame_parms) == tmp, "");
if (IS_SOFTMODEM_RFSIM)
dummyWrite(UE,*timestamp, UE->frame_parms.get_samples_per_slot(slot,&UE->frame_parms));
......@@ -708,20 +687,20 @@ void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, bool toTrash)
}
static void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int rx_offset)
static void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, openair0_timestamp rx_offset)
{
LOG_I(PHY, "Resynchronizing RX by %d samples\n", rx_offset);
LOG_I(PHY, "Resynchronizing RX by %ld samples\n", rx_offset);
if (IS_SOFTMODEM_IQPLAYER || IS_SOFTMODEM_IQRECORDER) {
// Resynchonize by slot (will work with numerology 1 only)
for (int size = rx_offset; size > 0; size -= UE->frame_parms.samples_per_subframe / 2) {
int unitTransfer = size > UE->frame_parms.samples_per_subframe / 2 ? UE->frame_parms.samples_per_subframe / 2 : size;
AssertFatal(unitTransfer
== UE->rfdevice.trx_read_func(&UE->rfdevice,
timestamp,
(void **)UE->common_vars.rxdata,
unitTransfer,
UE->frame_parms.nb_antennas_rx),
"");
int tmp = UE->rfdevice.trx_read_func(&UE->rfdevice,
timestamp,
(void **)UE->common_vars.rxdata,
unitTransfer,
UE->frame_parms.nb_antennas_rx);
DevAssert(unitTransfer == tmp);
}
} else {
*timestamp += UE->frame_parms.get_samples_per_slot(1, &UE->frame_parms);
......@@ -731,13 +710,12 @@ static void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int r
// this happens here as the read size is samples_per_subframe which is very much larger than samp_per_slot
if (IS_SOFTMODEM_RFSIM)
dummyWrite(UE, *timestamp, unitTransfer);
AssertFatal(unitTransfer
== UE->rfdevice.trx_read_func(&UE->rfdevice,
timestamp,
(void **)UE->common_vars.rxdata,
unitTransfer,
UE->frame_parms.nb_antennas_rx),
"");
int res = UE->rfdevice.trx_read_func(&UE->rfdevice,
timestamp,
(void **)UE->common_vars.rxdata,
unitTransfer,
UE->frame_parms.nb_antennas_rx);
DevAssert(unitTransfer == res);
*timestamp += unitTransfer; // this does not affect the read but needed for RFSIM write
}
}
......@@ -767,10 +745,12 @@ void *UE_thread(void *arg)
void *rxp[NB_ANTENNAS_RX];
int start_rx_stream = 0;
fapi_nr_config_request_t *cfg = &UE->nrUE_config;
AssertFatal(0 == openair0_device_load(&(UE->rfdevice), &openair0_cfg[0]), "Could not load the device\n");
int tmp = openair0_device_load(&(UE->rfdevice), &openair0_cfg[0]);
AssertFatal(tmp == 0, "Could not load the device\n");
UE->rfdevice.host_type = RAU_HOST;
UE->is_synchronized = 0;
AssertFatal(UE->rfdevice.trx_start_func(&UE->rfdevice) == 0, "Could not start the device\n");
int tmp2 = UE->rfdevice.trx_start_func(&UE->rfdevice);
AssertFatal(tmp2 == 0, "Could not start the device\n");
notifiedFIFO_t nf;
initNotifiedFIFO(&nf);
......@@ -907,9 +887,8 @@ void *UE_thread(void *arg)
const int readBlockSize = get_readBlockSize(slot_nr, &UE->frame_parms) - iq_shift_to_apply;
openair0_timestamp rx_timestamp;
AssertFatal(readBlockSize
== UE->rfdevice.trx_read_func(&UE->rfdevice, &rx_timestamp, rxp, readBlockSize, UE->frame_parms.nb_antennas_rx),
"");
int tmp = UE->rfdevice.trx_read_func(&UE->rfdevice, &rx_timestamp, rxp, readBlockSize, UE->frame_parms.nb_antennas_rx);
AssertFatal(readBlockSize == tmp, "");
if(slot_nr == (nb_slot_frame - 1)) {
// read in first symbol of next frame and adjust for timing drift
......@@ -917,12 +896,13 @@ void *UE_thread(void *arg)
if (first_symbols > 0) {
openair0_timestamp ignore_timestamp;
AssertFatal(first_symbols ==
UE->rfdevice.trx_read_func(&UE->rfdevice,
&ignore_timestamp,
(void **)UE->common_vars.rxdata,
first_symbols,
UE->frame_parms.nb_antennas_rx),"");
int tmp = UE->rfdevice.trx_read_func(&UE->rfdevice,
&ignore_timestamp,
(void **)UE->common_vars.rxdata,
first_symbols,
UE->frame_parms.nb_antennas_rx);
AssertFatal(first_symbols == tmp, "");
} else
LOG_E(PHY,"can't compensate: diff =%d\n", first_symbols);
}
......@@ -988,7 +968,8 @@ void init_NR_UE(int nb_inst, char *uecap_file, char *reconfig_file, char *rbconf
for (int i = 0; i < nb_inst; i++) {
NR_UE_MAC_INST_t *mac = get_mac_inst(i);
AssertFatal((mac->if_module = nr_ue_if_module_init(i)) != NULL, "can not initialize IF module\n");
mac->if_module = nr_ue_if_module_init(i);
AssertFatal(mac->if_module, "can not initialize IF module\n");
if (!get_softmodem_params()->sa) {
init_nsa_message(rrc_inst, reconfig_file, rbconfig_file);
nr_rlc_activate_srb0(mac_inst->crnti, NULL, send_srb0_rrc);
......
......@@ -397,9 +397,6 @@ int aerial_phy_nr_rach_indication(nfapi_nr_rach_indication_t *ind)
rach_ind->pdu_list[i].avg_rssi = ind->pdu_list[i].avg_rssi;
rach_ind->pdu_list[i].avg_snr = ind->pdu_list[i].avg_snr;
rach_ind->pdu_list[i].num_preamble = ind->pdu_list[i].num_preamble;
rach_ind->pdu_list[i].preamble_list = CALLOC(ind->pdu_list[i].num_preamble, sizeof(nfapi_nr_prach_indication_preamble_t));
AssertFatal(rach_ind->pdu_list[i].preamble_list != NULL,
"Memory not allocated for rach_ind->pdu_list[i].preamble_list in phy_nr_rach_indication.");
for (int j = 0; j < ind->pdu_list[i].num_preamble; j++) {
rach_ind->pdu_list[i].preamble_list[j].preamble_index = ind->pdu_list[i].preamble_list[j].preamble_index;
rach_ind->pdu_list[i].preamble_list[j].timing_advance = ind->pdu_list[i].preamble_list[j].timing_advance;
......
......@@ -731,7 +731,6 @@ int phy_nr_rach_indication(nfapi_nr_rach_indication_t *ind)
rach_ind->pdu_list[i].num_preamble = ind->pdu_list[i].num_preamble;
rach_ind->pdu_list[i].freq_index = ind->pdu_list[i].freq_index;
rach_ind->pdu_list[i].symbol_index = ind->pdu_list[i].symbol_index;
rach_ind->pdu_list[i].preamble_list = CALLOC(ind->pdu_list[i].num_preamble, sizeof(nfapi_nr_prach_indication_preamble_t));
AssertFatal(rach_ind->pdu_list[i].preamble_list != NULL, "Memory not allocated for rach_ind->pdu_list[i].preamble_list in phy_nr_rach_indication.");
for (int j = 0; j < ind->number_of_pdus; j++)
{
......@@ -742,10 +741,6 @@ int phy_nr_rach_indication(nfapi_nr_rach_indication_t *ind)
if (!put_queue(&gnb_rach_ind_queue, rach_ind))
{
LOG_E(NR_MAC, "Put_queue failed for rach_ind\n");
for (int i = 0; i < ind->number_of_pdus; i++)
{
free(rach_ind->pdu_list[i].preamble_list);
}
free(rach_ind->pdu_list);
free(rach_ind);
}
......
......@@ -55,6 +55,12 @@ typedef enum {
RLM_in_sync = 2
} rlm_t;
typedef enum {
NFAPI_NR_FORMAT_0_0_AND_1_0,
NFAPI_NR_FORMAT_0_1_AND_1_1,
} nfapi_nr_dci_formats_e;
typedef struct {
uint32_t rsrp;
int rsrp_dBm;
......@@ -94,7 +100,7 @@ typedef struct {
typedef struct {
uint16_t rnti;
uint8_t dci_format;
nfapi_nr_dci_formats_e dci_format;
uint8_t coreset_type;
int ss_type;
// n_CCE index of first CCE for PDCCH reception
......@@ -427,7 +433,7 @@ typedef struct {
// needs to monitor only upto 2 DCI lengths for a given search space.
uint8_t num_dci_options; // Num DCIs the UE actually needs to decode (1 or 2)
uint8_t dci_length_options[2];
uint8_t dci_format_options[2];
nfapi_nr_dci_formats_e dci_format_options[2];
uint8_t ss_type_options[2];
} fapi_nr_dl_config_dci_dl_pdu_rel15_t;
......
......@@ -1759,7 +1759,7 @@ typedef struct{
uint8_t avg_rssi;
uint8_t avg_snr;
uint8_t num_preamble;
nfapi_nr_prach_indication_preamble_t* preamble_list;
nfapi_nr_prach_indication_preamble_t preamble_list[64];
}nfapi_nr_prach_indication_pdu_t;
......
......@@ -6302,14 +6302,11 @@ static uint8_t unpack_nr_rach_indication_body(nfapi_nr_prach_indication_pdu_t *v
return 0;
}
if (value->num_preamble > 0) {
value->preamble_list = nfapi_p7_allocate(sizeof(*value->preamble_list) * value->num_preamble, config);
for (int i = 0; i < value->num_preamble; i++) {
nfapi_nr_prach_indication_preamble_t *preamble = &(value->preamble_list[i]);
if (!(pull8(ppReadPackedMsg, &preamble->preamble_index, end) && pull16(ppReadPackedMsg, &preamble->timing_advance, end)
&& pull32(ppReadPackedMsg, &preamble->preamble_pwr, end))) {
return 0;
}
for (int i = 0; i < value->num_preamble; i++) {
nfapi_nr_prach_indication_preamble_t *preamble = &(value->preamble_list[i]);
if (!(pull8(ppReadPackedMsg, &preamble->preamble_index, end) && pull16(ppReadPackedMsg, &preamble->timing_advance, end)
&& pull32(ppReadPackedMsg, &preamble->preamble_pwr, end))) {
return 0;
}
}
return 1;
......
......@@ -282,7 +282,7 @@ void nr_polar_generate_u(uint64_t *u,
uint16_t N,
uint8_t n_pc);
void nr_polar_uxG(uint64_t *D, const uint64_t *u, const fourDimArray_t *G_N_tab, uint16_t N);
void nr_polar_uxG(uint8_t const* u, size_t N, uint8_t* D);
void nr_polar_info_extraction_from_u(uint64_t *Cprime,
const uint8_t *u,
......
......@@ -485,12 +485,13 @@ void build_polar_tables(t_nrPolar_params *polarParams) {
polarParams->rm_tab[tcnt] = polarParams->rate_matching_pattern[outpos] >> shift;
}
void polar_encoder_fast(uint64_t *A,
void *out,
int32_t crcmask,
uint8_t ones_flag,
int8_t messageType,
uint16_t messageLength,
int32_t crcmask,
uint8_t ones_flag,
int8_t messageType,
uint16_t messageLength,
uint8_t aggregation_level) {
t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false);
......@@ -687,8 +688,8 @@ void polar_encoder_fast(uint64_t *A,
printf("\n");
#endif
uint64_t D[8] = {0};
nr_polar_uxG(D, u, polarParams->G_N_tab, polarParams->N);
uint64_t D[8];
nr_polar_uxG((uint8_t *)u, polarParams->N, (uint8_t *)D);
#ifdef POLAR_CODING_DEBUG
printf("d: ");
......@@ -701,6 +702,7 @@ void polar_encoder_fast(uint64_t *A,
printf("%lu", (D[n1] >> n2) & 1);
}
printf("\n");
fflush(stdout);
#endif
memset((void*)out,0,polarParams->encoderLength>>3);
......
......@@ -30,8 +30,12 @@
* \warning
*/
#include "common/utils/nr/nr_common.h"
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
#include <assert.h>
#include <stdlib.h>
#include <stdint.h>
// TS 38.212 - Section 5.3.1.2 Polar encoding
void nr_polar_generate_u(uint64_t *u,
......@@ -119,23 +123,71 @@ void nr_polar_info_extraction_from_u(uint64_t *Cprime,
}
}
void nr_polar_uxG(uint64_t *D, const uint64_t *u, const fourDimArray_t *G_N_tab, uint16_t N)
static
void encode_packed_byte(uint8_t* in_out)
{
// *in_out ^= 0xAA & (*in_out << 1);
// *in_out ^= 0xCC & (*in_out << 2);
// *in_out ^= *in_out in_out << 4;
//
*in_out ^= 0x55 & (*in_out >> 1);
*in_out ^= 0x33 & (*in_out >> 2);
*in_out ^= *in_out >> 4;
}
static
void polar_encode_bits(uint8_t* in_out, size_t N)
{
size_t const num_bytes_per_block = N >> 3;
for(size_t i = 0; i < num_bytes_per_block; ++i){
encode_packed_byte(&in_out[i]);
}
}
static
uint32_t log2_floor(uint32_t x)
{
const int N64 = N / 64;
cast2Darray(g_n, uint64_t, G_N_tab);
for (int n = 0; n < N; n++) {
const uint64_t *Gn = g_n[N - 1 - n];
int n_ones = 0;
for (int a = 0; a < N64; a++)
n_ones += count_bits_set(u[a] & Gn[a]);
int n1 = n / 64;
int n2 = n - (n1 * 64);
D[n1] |= ((uint64_t)n_ones & 1) << n2;
if(x == 0)
return 0;
uint32_t clz = __builtin_clz(x);
return 31U - clz;
}
static
void polar_encode_bytes(uint8_t* in_out, size_t N)
{
size_t brnch_sz = 1;
size_t n_brnch = N >> 4;
size_t const blck_pwr = log2_floor(N);
for (size_t stage = 3; stage < blck_pwr; ++stage) {
for (size_t brnch = 0; brnch < n_brnch; ++brnch) {
for(size_t byte = 0; byte < brnch_sz; ++byte){
size_t const dst = 2*brnch_sz*brnch + byte;
in_out[dst] ^= in_out[dst + brnch_sz];
}
}
n_brnch >>= 1;
brnch_sz <<= 1;
}
}
void nr_polar_uxG(uint8_t const *u, size_t N, uint8_t *D2)
{
assert(N > 7);
uint8_t tmp[N/8];
for(int i = 0; i < N/8; ++i)
tmp[i] = u[N/8 - 1 - i];
reverse_bits_u8(tmp, N/8, D2);
// Do the encoding/xor for the bottom 3 levels of the tree.
// Thus, data remaining to encode, is in 2^3 type.
polar_encode_bits(D2, N);
// Xor the remaining tree levels. Use bytes for it
polar_encode_bytes(D2, N);
}
void nr_polar_bit_insertion(uint8_t *input,
uint8_t *output,
uint16_t N,
......
......@@ -292,10 +292,9 @@ int decode_offload(PHY_VARS_gNB *phy_vars_gNB,
}
if (crc_valid) {
LOG_D(PHY, "ULSCH: Setting ACK for slot %d TBS %d\n", ulsch->slot, harq_process->TBS);
nr_fill_indication(phy_vars_gNB, ulsch->frame, ulsch->slot, ULSCH_id, harq_pid, 0, 0);
ulsch->active = false;
harq_process->round = 0;
LOG_D(PHY, "ULSCH received ok \n");
nr_fill_indication(phy_vars_gNB, ulsch->frame, ulsch->slot, ULSCH_id, harq_pid, 0, 0);
} else {
LOG_D(PHY,
"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d)\n",
......@@ -306,10 +305,10 @@ int decode_offload(PHY_VARS_gNB *phy_vars_gNB,
ulsch->active,
harq_process->round,
harq_process->TBS);
nr_fill_indication(phy_vars_gNB, ulsch->frame, ulsch->slot, ULSCH_id, harq_pid, 1, 0);
ulsch->handled = 1;
decodeIterations = ulsch->max_ldpc_iterations + 1;
LOG_D(PHY, "ULSCH %d in error\n", ULSCH_id);
nr_fill_indication(phy_vars_gNB, ulsch->frame, ulsch->slot, ULSCH_id, harq_pid, 1, 0);
}
ulsch->last_iteration_cnt = decodeIterations;
......
......@@ -1519,7 +1519,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
corr_re = ( corr32_re[symb][half_prb>>2][aa]/(2*nc_group_size*4/2)+((int16_t*)(&prod_re[aa]))[0]);
corr_im = ( corr32_im[symb][half_prb>>2][aa]/(2*nc_group_size*4/2)+((int16_t*)(&prod_im[aa]))[0]);
corr_tmp += corr_re*corr_re + corr_im*corr_im;
corr_tmp += (corr_re*corr_re + corr_im*corr_im)>>(Prx/2);
/*
LOG_D(PHY,"pucch2 half_prb %d cw %d (%d,%d) aa %d: (%d,%d,%d,%d,%d,%d,%d,%d)x(%d,%d,%d,%d,%d,%d,%d,%d) (%d,%d)+(%d,%d)
= (%d,%d) => %d\n", half_prb,cw,cw&15,cw>>4,aa,
......
......@@ -43,15 +43,6 @@
#include "assertions.h"
#include "T.h"
static const char nr_dci_format_string[8][30] = {"NR_DL_DCI_FORMAT_1_0",
"NR_DL_DCI_FORMAT_1_1",
"NR_DL_DCI_FORMAT_2_0",
"NR_DL_DCI_FORMAT_2_1",
"NR_DL_DCI_FORMAT_2_2",
"NR_DL_DCI_FORMAT_2_3",
"NR_UL_DCI_FORMAT_0_0",
"NR_UL_DCI_FORMAT_0_1"};
//#define DEBUG_DCI_DECODING 1
//#define NR_PDCCH_DCI_DEBUG // activates NR_PDCCH_DCI_DEBUG logs
......@@ -699,24 +690,22 @@ static uint16_t nr_dci_false_detection(uint64_t *dci,
int rnti,
int8_t messageType,
uint16_t messageLength,
uint8_t aggregation_level
) {
uint8_t aggregation_level)
{
uint32_t encoder_output[NR_MAX_DCI_SIZE_DWORD];
polar_encoder_fast(dci, (void*)encoder_output, rnti, 1,
messageType, messageLength, aggregation_level);
polar_encoder_fast(dci, (void *)encoder_output, rnti, 1, messageType, messageLength, aggregation_level);
uint8_t *enout_p = (uint8_t*)encoder_output;
uint16_t x = 0;
for (int i=0; i<encoded_length/8; i++) {
x += ( enout_p[i] & 1 ) ^ ( ( soft_in[i*8] >> 15 ) & 1);
x += ( ( enout_p[i] >> 1 ) & 1 ) ^ ( ( soft_in[i*8+1] >> 15 ) & 1 );
x += ( ( enout_p[i] >> 2 ) & 1 ) ^ ( ( soft_in[i*8+2] >> 15 ) & 1 );
x += ( ( enout_p[i] >> 3 ) & 1 ) ^ ( ( soft_in[i*8+3] >> 15 ) & 1 );
x += ( ( enout_p[i] >> 4 ) & 1 ) ^ ( ( soft_in[i*8+4] >> 15 ) & 1 );
x += ( ( enout_p[i] >> 5 ) & 1 ) ^ ( ( soft_in[i*8+5] >> 15 ) & 1 );
x += ( ( enout_p[i] >> 6 ) & 1 ) ^ ( ( soft_in[i*8+6] >> 15 ) & 1 );
x += ( ( enout_p[i] >> 7 ) & 1 ) ^ ( ( soft_in[i*8+7] >> 15 ) & 1 );
x += (enout_p[i] & 1) ^ ((soft_in[i * 8] >> 15) & 1);
x += ((enout_p[i] >> 1) & 1) ^ ((soft_in[i * 8 + 1] >> 15) & 1);
x += ((enout_p[i] >> 2) & 1) ^ ((soft_in[i * 8 + 2] >> 15) & 1);
x += ((enout_p[i] >> 3) & 1) ^ ((soft_in[i * 8 + 3] >> 15) & 1);
x += ((enout_p[i] >> 4) & 1) ^ ((soft_in[i * 8 + 4] >> 15) & 1);
x += ((enout_p[i] >> 5) & 1) ^ ((soft_in[i * 8 + 5] >> 15) & 1);
x += ((enout_p[i] >> 6) & 1) ^ ((soft_in[i * 8 + 6] >> 15) & 1);
x += ((enout_p[i] >> 7) & 1) ^ ((soft_in[i * 8 + 7] >> 15) & 1);
}
return x;
}
......@@ -730,7 +719,7 @@ void nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
int e_rx_cand_idx = 0;
*dci_ind = (fapi_nr_dci_indication_t){.SFN = proc->frame_rx, .slot = proc->nr_slot_rx};
for (int j=0;j<rel15->number_of_candidates;j++) {
for (int j = 0; j < rel15->number_of_candidates; j++) {
int CCEind = rel15->CCE[j];
int L = rel15->L[j];
......@@ -738,20 +727,20 @@ void nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
for (int k = 0; k < rel15->num_dci_options; k++) {
// skip this candidate if we've already found one with the
// same rnti and format at a different aggregation level
// same rnti and size at a different aggregation level
int dci_length = rel15->dci_length_options[k];
int ind;
for (ind = 0; ind < dci_ind->number_of_dcis; ind++) {
if (rel15->rnti == dci_ind->dci_list[ind].rnti && rel15->dci_format_options[k] == dci_ind->dci_list[ind].dci_format) {
if (rel15->rnti == dci_ind->dci_list[ind].rnti && dci_length == dci_ind->dci_list[ind].payloadSize) {
break;
}
}
if (ind < dci_ind->number_of_dcis)
continue;
int dci_length = rel15->dci_length_options[k];
uint64_t dci_estimation[2]= {0};
uint64_t dci_estimation[2] = {0};
LOG_D(NR_PHY_DCI,
"(%i.%i) Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n",
"(%i.%i) Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %d\n",
proc->frame_rx,
proc->nr_slot_rx,
j,
......@@ -760,31 +749,31 @@ void nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
e_rx_cand_idx,
L,
dci_length,
nr_dci_format_string[rel15->dci_format_options[k]]);
rel15->dci_format_options[k]);
int16_t tmp_e[16 * 108];
nr_pdcch_unscrambling(&pdcch_e_rx[e_rx_cand_idx], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e);
// this polar version decodes 64 bits max, dci_estimation[1] will never be filled
uint16_t crc = polar_decoder_int16(tmp_e,
dci_estimation,
1,
NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L);
nr_pdcch_unscrambling(&pdcch_e_rx[e_rx_cand_idx],
rel15->coreset.scrambling_rnti,
L * 108,
rel15->coreset.pdcch_dmrs_scrambling_id,
tmp_e);
uint16_t crc = polar_decoder_int16(tmp_e, dci_estimation, 1, NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L);
rnti_t n_rnti = rel15->rnti;
LOG_D(NR_PHY_DCI,
"(%i.%i) dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d,payload %lx, is rnti: %d )\n",
proc->frame_rx,
proc->nr_slot_rx,
n_rnti,
nr_dci_format_string[rel15->dci_format_options[k]],
CCEind,
dci_length,
dci_estimation[0],
crc == n_rnti);
if (crc == n_rnti) {
uint16_t mb = nr_dci_false_detection(dci_estimation,tmp_e,L*108,n_rnti, NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L);
LOG_D(NR_PHY_DCI,
"(%i.%i) Received dci indication (rnti %x,dci format %d,n_CCE %d,payloadSize %d,payload %llx)\n",
proc->frame_rx,
proc->nr_slot_rx,
n_rnti,
rel15->dci_format_options[k],
CCEind,
dci_length,
*(unsigned long long *)dci_estimation);
uint16_t mb = nr_dci_false_detection(dci_estimation, tmp_e, L * 108, n_rnti, NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L);
ue->dci_thres = (ue->dci_thres + mb) / 2;
if (mb > (ue->dci_thres+30)) {
if (mb > (ue->dci_thres + 30)) {
LOG_W(NR_PHY_DCI,
"DCI false positive. Dropping DCI index %d. Mismatched bits: %d/%d. Current DCI threshold: %d\n",
j,
......
......@@ -274,7 +274,8 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
uint8_t nr_slot_rx,
uint8_t harq_pid,
int b_size,
uint8_t b[b_size])
uint8_t b[b_size],
int G)
{
uint32_t ret,offset;
uint32_t r,r_offset=0,Kr=8424,Kr_bytes;
......@@ -339,7 +340,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
uint32_t A = dlsch->dlsch_config.TBS;
ret = dlsch->max_ldpc_iterations + 1;
dlsch->last_iteration_cnt = ret;
uint32_t G = harq_process->G;
// target_code_rate is in 0.1 units
float Coderate = (float) dlsch->dlsch_config.targetCodeRate / 10240.0f;
......
......@@ -104,12 +104,14 @@ static void nr_dlsch_layer_demapping(int16_t *llr_cw[2],
uint32_t length,
int32_t codeword_TB0,
int32_t codeword_TB1,
int16_t *llr_layers[NR_MAX_NB_LAYERS]);
uint sz,
int16_t llr_layers[][sz]);
/* compute LLR */
static int nr_dlsch_llr(uint32_t rx_size_symbol,
int nbRx,
int16_t *layer_llr[NR_MAX_NB_LAYERS],
uint sz,
int16_t layer_llr[][sz],
NR_DL_FRAME_PARMS *frame_parms,
int32_t rxdataF_comp[][nbRx][rx_size_symbol * NR_SYMBOLS_PER_SLOT],
int32_t dl_ch_mag[rx_size_symbol],
......@@ -127,6 +129,7 @@ static int nr_dlsch_llr(uint32_t rx_size_symbol,
uint8_t nr_slot_rx,
NR_UE_DLSCH_t dlsch[2],
uint32_t llr_offset[NR_SYMBOLS_PER_SLOT]);
/** \fn nr_dlsch_extract_rbs
\brief This function extracts the received resource blocks, both channel estimates and data symbols, for the current
allocation and for multiple layer antenna gNB transmission.
......@@ -255,7 +258,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
int nbRx,
int32_t rxdataF_comp[][nbRx][rx_size_symbol * NR_SYMBOLS_PER_SLOT],
c16_t ptrs_phase_per_slot[][NR_SYMBOLS_PER_SLOT],
int32_t ptrs_re_per_slot[][NR_SYMBOLS_PER_SLOT])
int32_t ptrs_re_per_slot[][NR_SYMBOLS_PER_SLOT],
int G)
{
const int nl = dlsch[0].Nl;
const int matrixSz = ue->frame_parms.nb_antennas_rx * nl;
......@@ -335,9 +339,9 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
}
DEBUG_HARQ("[DEMOD] cw for TB0 = %d, cw for TB1 = %d\n", codeword_TB0, codeword_TB1);
int start_rb = dlsch[0].dlsch_config.start_rb;
int nb_rb_pdsch = dlsch[0].dlsch_config.number_rbs;
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config = &dlsch[0].dlsch_config;
int start_rb = dlsch_config->start_rb;
int nb_rb_pdsch = dlsch_config->number_rbs;
DevAssert(dlsch0_harq);
......@@ -361,8 +365,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
slot = 1;
}
uint8_t pilots = (dlsch[0].dlsch_config.dlDmrsSymbPos >> symbol) & 1;
uint8_t config_type = dlsch[0].dlsch_config.dmrsConfigType;
uint8_t pilots = (dlsch_config->dlDmrsSymbPos >> symbol) & 1;
uint8_t config_type = dlsch_config->dmrsConfigType;
//----------------------------------------------------------
//--------------------- RBs extraction ---------------------
//----------------------------------------------------------
......@@ -386,12 +390,12 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
symbol,
pilots,
config_type,
start_rb + dlsch[0].dlsch_config.BWPStart,
start_rb + dlsch_config->BWPStart,
nb_rb_pdsch,
dlsch[0].dlsch_config.n_dmrs_cdm_groups,
dlsch_config->n_dmrs_cdm_groups,
nl,
frame_parms,
dlsch[0].dlsch_config.dlDmrsSymbPos,
dlsch_config->dlDmrsSymbPos,
ue->chest_time);
if (meas_enabled) {
stop_meas(&meas);
......@@ -409,12 +413,12 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
memcpy(ue->phy_sim_pdsch_rxdataF_ext + offset, rxdataF_ext, rx_size_symbol * sizeof(c16_t));
}
nb_re_pdsch = (pilots == 1)
? ((config_type == NFAPI_NR_DMRS_TYPE1) ? nb_rb_pdsch * (12 - 6 * dlsch[0].dlsch_config.n_dmrs_cdm_groups) : nb_rb_pdsch * (12 - 4 * dlsch[0].dlsch_config.n_dmrs_cdm_groups))
: (nb_rb_pdsch * 12);
//----------------------------------------------------------
//--------------------- Channel Scaling --------------------
//----------------------------------------------------------
nb_re_pdsch = (pilots == 1) ? ((config_type == NFAPI_NR_DMRS_TYPE1) ? nb_rb_pdsch * (12 - 6 * dlsch_config->n_dmrs_cdm_groups)
: nb_rb_pdsch * (12 - 4 * dlsch_config->n_dmrs_cdm_groups))
: (nb_rb_pdsch * 12);
//----------------------------------------------------------
//--------------------- Channel Scaling --------------------
//----------------------------------------------------------
if (meas_enabled)
start_meas(&meas);
nr_dlsch_scale_channel(rx_size_symbol, dl_ch_estimates_ext, frame_parms, nl, n_rx, symbol, pilots, nb_re_pdsch, nb_rb_pdsch);
......@@ -493,7 +497,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
symbol,
nb_re_pdsch,
first_symbol_flag,
dlsch[0].dlsch_config.qamModOrder,
dlsch_config->qamModOrder,
nb_rb_pdsch,
*log2_maxh,
measurements); // log2_maxh+I0_shift
......@@ -535,7 +539,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
dl_ch_magr,
dl_ch_estimates_ext,
nb_rb_pdsch,
dlsch[0].dlsch_config.qamModOrder,
dlsch_config->qamModOrder,
*log2_maxh,
symbol,
nb_re_pdsch);
......@@ -561,9 +565,9 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
int pduBitmap = 0;
if(dlsch0_harq->status == ACTIVE) {
startSymbIdx = dlsch[0].dlsch_config.start_symbol;
nbSymb = dlsch[0].dlsch_config.number_symbols;
pduBitmap = dlsch[0].dlsch_config.pduBitmap;
startSymbIdx = dlsch_config->start_symbol;
nbSymb = dlsch_config->number_symbols;
pduBitmap = dlsch_config->pduBitmap;
}
/* Check for PTRS bitmap and process it respectively */
......@@ -572,16 +576,17 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
ue, nbRx, ptrs_phase_per_slot, ptrs_re_per_slot, rx_size_symbol, rxdataF_comp, frame_parms, dlsch0_harq, dlsch1_harq, gNB_id, nr_slot_rx, symbol, (nb_rb_pdsch * 12), dlsch[0].rnti, dlsch);
dl_valid_re[symbol-1] -= ptrs_re_per_slot[0][symbol];
}
/* at last symbol in a slot calculate LLR's for whole slot */
if(symbol == (startSymbIdx + nbSymb -1)) {
const uint32_t rx_llr_layer_size = (G + dlsch[0].Nl - 1) / dlsch[0].Nl;
const uint32_t rx_llr_layer_size = (dlsch0_harq->G + dlsch[0].Nl - 1) / dlsch[0].Nl;
if (dlsch[0].Nl == 0 || rx_llr_layer_size == 0 || rx_llr_layer_size > 10 * 1000 * 1000) {
LOG_E(PHY, "rx_llr_layer_size %d, G %d, Nl, %d, discarding this pdsch\n", rx_llr_layer_size, G, dlsch[0].Nl);
return -1;
}
int16_t* layer_llr[NR_MAX_NB_LAYERS];
for (int i = 0; i < NR_MAX_NB_LAYERS; i++)
layer_llr[i] = (int16_t *)malloc16_clear(rx_llr_layer_size * sizeof(int16_t));
for(uint8_t i = startSymbIdx; i < (startSymbIdx+nbSymb); i++) {
int16_t layer_llr[dlsch[0].Nl][rx_llr_layer_size];
for(int i = startSymbIdx; i < startSymbIdx+nbSymb; i++) {
/* re evaluating the first symbol flag as LLR's are done in symbol loop */
if(i == startSymbIdx && i < 3)
first_symbol_flag = 1;
......@@ -590,6 +595,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
/* Calculate LLR's for each symbol */
nr_dlsch_llr(rx_size_symbol,
nbRx,
rx_llr_layer_size,
layer_llr,
frame_parms,
rxdataF_comp,
......@@ -613,14 +619,12 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
nr_dlsch_layer_demapping(llr,
dlsch[0].Nl,
dlsch[0].dlsch_config.qamModOrder,
dlsch0_harq->G,
G,
codeword_TB0,
codeword_TB1,
rx_llr_layer_size,
layer_llr);
// if (llr[0][0]) abort();
for (int i=0; i<NR_MAX_NB_LAYERS; i++)
free(layer_llr[i]);
// Please keep it: useful for debugging
// Please keep it: useful for debugging
#ifdef DEBUG_PDSCH_RX
char filename[50];
uint8_t aa = 0;
......@@ -1874,8 +1878,9 @@ static void nr_dlsch_layer_demapping(int16_t *llr_cw[2],
uint32_t length,
int32_t codeword_TB0,
int32_t codeword_TB1,
int16_t *llr_layers[NR_MAX_NB_LAYERS]) {
uint sz,
int16_t llr_layers[][sz])
{
switch (Nl) {
case 1:
if (codeword_TB1 == -1)
......@@ -1908,7 +1913,8 @@ static void nr_dlsch_layer_demapping(int16_t *llr_cw[2],
static int nr_dlsch_llr(uint32_t rx_size_symbol,
int nbRx,
int16_t *layer_llr[NR_MAX_NB_LAYERS],
uint sz,
int16_t layer_llr[][sz],
NR_DL_FRAME_PARMS *frame_parms,
int32_t rxdataF_comp[][nbRx][rx_size_symbol * NR_SYMBOLS_PER_SLOT],
int32_t dl_ch_mag[rx_size_symbol],
......
......@@ -210,7 +210,8 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
uint8_t nr_slot_rx,
uint8_t harq_pid,
int b_size,
uint8_t b[b_size]);
uint8_t b[b_size],
int G);
int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
NR_UE_ULSCH_t *ulsch,
......@@ -410,7 +411,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
int nbRx,
int32_t rxdataF_comp[][nbRx][rx_size_symbol * NR_SYMBOLS_PER_SLOT],
c16_t ptrs_phase_per_slot[][NR_SYMBOLS_PER_SLOT],
int32_t ptrs_re_per_slot[][NR_SYMBOLS_PER_SLOT]);
int32_t ptrs_re_per_slot[][NR_SYMBOLS_PER_SLOT],
int G);
int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int frame, uint8_t slot);
......
......@@ -123,8 +123,6 @@ typedef struct {
uint32_t F;
/// LDPC lifting factor
uint32_t Z;
/// Number of soft channel bits
uint32_t G;
/// codeword this transport block is mapped to
uint8_t codeword;
/// HARQ-ACKs
......
......@@ -519,7 +519,7 @@ typedef struct {
//! estimated avg subband noise power (dB)
unsigned int n0_subband_power_avg_dB;
//! estimated avg subband noise power per antenna (dB)
unsigned int n0_subband_power_avg_perANT_dB[NB_ANTENNAS_RX];
unsigned int n0_subband_power_avg_perANT_dB[MAX_ANT];
//! estimated avg noise power per RB (dB)
int n0_subband_power_tot_dB[275];
//! estimated avg noise power per RB (dBm)
......@@ -531,7 +531,6 @@ typedef struct {
#define MAX_NUM_NR_RX_RACH_PDUS 4
#define MAX_NUM_NR_RX_PRACH_PREAMBLES 4
#define MAX_UL_PDUS_PER_SLOT 8
#define MAX_NUM_NR_SRS_PDUS 8
// the current RRC resource allocation is that each UE gets its
......@@ -573,8 +572,6 @@ typedef struct PHY_VARS_gNB_s {
nfapi_nr_uci_t uci_pdu_list[MAX_NUM_NR_UCI_PDUS];
/// NFAPI PRACH information
nfapi_nr_prach_indication_pdu_t prach_pdu_indication_list[MAX_NUM_NR_RX_RACH_PDUS];
/// NFAPI PRACH information
nfapi_nr_prach_indication_preamble_t preamble_list[MAX_NUM_NR_RX_PRACH_PREAMBLES];
nfapi_nr_ul_tti_request_t UL_tti_req;
nfapi_nr_uci_indication_t uci_indication;
......
......@@ -272,7 +272,7 @@
/* - between reception of pdsch and tarnsmission of its acknowlegment */
/* - between reception of un uplink grant and its related transmission */
// should be 2 as per NR standard, but current UE is not able to perform this value
#define NR_UE_CAPABILITY_SLOT_RX_TO_TX (3)
#define NR_UE_CAPABILITY_SLOT_RX_TO_TX (3)
#define DURATION_RX_TO_TX (NR_UE_CAPABILITY_SLOT_RX_TO_TX)
......
......@@ -152,38 +152,43 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot) {
gNB->prach_energy_counter);
if ((gNB->prach_energy_counter == 100) && (max_preamble_energy[0] > gNB->measurements.prach_I0+gNB->prach_thres)) {
LOG_I(NR_PHY,"[gNB %d][RAPROC] Frame %d, slot %d Initiating RA procedure with preamble %d, energy %d.%d dB (I0 %d, thres %d), delay %d start symbol %u freq index %u\n",
gNB->Mod_id,
frame,
slot,
max_preamble[0],
max_preamble_energy[0]/10,
max_preamble_energy[0]%10,
gNB->measurements.prach_I0,gNB->prach_thres,
max_preamble_delay[0],
prachStartSymbol,
prach_pdu->num_ra);
T(T_ENB_PHY_INITIATE_RA_PROCEDURE, T_INT(gNB->Mod_id), T_INT(frame), T_INT(slot),
T_INT(max_preamble[0]), T_INT(max_preamble_energy[0]), T_INT(max_preamble_delay[0]));
gNB->UL_INFO.rach_ind.number_of_pdus += 1;
gNB->prach_pdu_indication_list[pdu_index].phy_cell_id = gNB->gNB_config.cell_config.phy_cell_id.value;
gNB->prach_pdu_indication_list[pdu_index].symbol_index = prachStartSymbol;
gNB->prach_pdu_indication_list[pdu_index].slot_index = slot;
gNB->prach_pdu_indication_list[pdu_index].freq_index = prach_pdu->num_ra;
gNB->prach_pdu_indication_list[pdu_index].avg_rssi = (max_preamble_energy[0]<631) ? (128+(max_preamble_energy[0]/5)) : 254;
gNB->prach_pdu_indication_list[pdu_index].avg_snr = 0xff; // invalid for now
gNB->prach_pdu_indication_list[pdu_index].num_preamble = 1;
gNB->prach_pdu_indication_list[pdu_index].preamble_list = gNB->preamble_list;
gNB->prach_pdu_indication_list[pdu_index].preamble_list[0].preamble_index = max_preamble[0];
gNB->prach_pdu_indication_list[pdu_index].preamble_list[0].timing_advance = max_preamble_delay[0];
gNB->prach_pdu_indication_list[pdu_index].preamble_list[0].preamble_pwr = 0xffffffff;
pdu_index++;
LOG_I(NR_PHY,
"[RAPROC] %d.%d Initiating RA procedure with preamble %d, energy %d.%d dB (I0 %d, thres %d), delay %d start symbol "
"%u freq index %u\n",
frame,
slot,
max_preamble[0],
max_preamble_energy[0] / 10,
max_preamble_energy[0] % 10,
gNB->measurements.prach_I0,
gNB->prach_thres,
max_preamble_delay[0],
prachStartSymbol,
prach_pdu->num_ra);
T(T_ENB_PHY_INITIATE_RA_PROCEDURE,
T_INT(gNB->Mod_id),
T_INT(frame),
T_INT(slot),
T_INT(max_preamble[0]),
T_INT(max_preamble_energy[0]),
T_INT(max_preamble_delay[0]));
gNB->UL_INFO.rach_ind.number_of_pdus += 1;
nfapi_nr_prach_indication_pdu_t *ind = &gNB->prach_pdu_indication_list[pdu_index];
ind->phy_cell_id = gNB->gNB_config.cell_config.phy_cell_id.value;
ind->symbol_index = prachStartSymbol;
ind->slot_index = slot;
ind->freq_index = prach_pdu->num_ra;
ind->avg_rssi = (max_preamble_energy[0] < 631) ? (128 + (max_preamble_energy[0] / 5)) : 254;
ind->avg_snr = 0xff; // invalid for now
ind->num_preamble = 1;
ind->preamble_list[0].preamble_index = max_preamble[0];
ind->preamble_list[0].timing_advance = max_preamble_delay[0];
ind->preamble_list[0].preamble_pwr = 0xffffffff;
pdu_index++;
}
gNB->measurements.prach_I0 = ((gNB->measurements.prach_I0*900)>>10) + ((max_preamble_energy[0]*124)>>10);
if (frame==0) LOG_I(PHY,"prach_I0 = %d.%d dB\n",gNB->measurements.prach_I0/10,gNB->measurements.prach_I0%10);
......
......@@ -314,10 +314,10 @@ static void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req)
ulsch_harq->round,
ulsch_harq->TBS,
rdata->decodeIterations);
nr_fill_indication(gNB, ulsch->frame, ulsch->slot, rdata->ulsch_id, rdata->harq_pid, 0, 0);
LOG_D(PHY, "ULSCH received ok \n");
ulsch->active = false;
ulsch_harq->round = 0;
LOG_D(PHY, "ULSCH received ok \n");
nr_fill_indication(gNB, ulsch->frame, ulsch->slot, rdata->ulsch_id, rdata->harq_pid, 0, 0);
//dumpsig=1;
} else {
LOG_D(PHY,
......@@ -335,9 +335,9 @@ static void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req)
ulsch_harq->ulsch_pdu.rb_size,
ulsch_harq->TBS,
r);
nr_fill_indication(gNB, ulsch->frame, ulsch->slot, rdata->ulsch_id, rdata->harq_pid, 1, 0);
ulsch->handled = 1;
LOG_D(PHY, "ULSCH %d in error\n",rdata->ulsch_id);
nr_fill_indication(gNB, ulsch->frame, ulsch->slot, rdata->ulsch_id, rdata->harq_pid, 1, 0);
// dumpsig=1;
}
ulsch->last_iteration_cnt = rdata->decodeIterations;
......
......@@ -125,16 +125,14 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
rach_ind->pdu_list[pdu_index].freq_index = prach_pdu->num_ra;
rach_ind->pdu_list[pdu_index].avg_rssi = 128;
rach_ind->pdu_list[pdu_index].avg_snr = 0xff; // invalid for now
rach_ind->pdu_list[pdu_index].num_preamble = 1;
const int num_p = rach_ind->pdu_list[pdu_index].num_preamble;
rach_ind->pdu_list[pdu_index].preamble_list = calloc(num_p, sizeof(nfapi_nr_prach_indication_preamble_t));
AssertFatal(num_p == 1, "can handle only one preamble in preamble_list\n");
rach_ind->pdu_list[pdu_index].num_preamble = 1;
rach_ind->pdu_list[pdu_index].preamble_list[0].preamble_index = prach_pdu->ra_PreambleIndex;
rach_ind->pdu_list[pdu_index].preamble_list[0].timing_advance = 0;
rach_ind->pdu_list[pdu_index].preamble_list[0].preamble_pwr = 0xffffffff;
if (!put_queue(&nr_rach_ind_queue, rach_ind)) {
for (int pdu_index = 0; pdu_index < rach_ind->number_of_pdus; pdu_index++)
free(rach_ind->pdu_list[pdu_index].preamble_list);
free(rach_ind->pdu_list);
free(rach_ind);
}
......
......@@ -485,7 +485,8 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc,
NR_UE_DLSCH_t dlsch[2],
int16_t *llr[2],
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP])
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP],
int G)
{
int frame_rx = proc->frame_rx;
int nr_slot_rx = proc->nr_slot_rx;
......@@ -609,7 +610,8 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
ue->frame_parms.nb_antennas_rx,
rxdataF_comp,
ptrs_phase_per_slot,
ptrs_re_per_slot)
ptrs_re_per_slot,
G)
< 0)
return -1;
......@@ -639,7 +641,11 @@ static void send_dl_done_to_tx_thread(notifiedFIFO_t *nf, int rx_slot)
}
}
static bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, NR_UE_DLSCH_t dlsch[2], int16_t *llr[2])
static bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc,
NR_UE_DLSCH_t dlsch[2],
int16_t *llr[2],
int G)
{
if (dlsch[0].active == false) {
LOG_E(PHY, "DLSCH should be active when calling this function\n");
......@@ -685,12 +691,7 @@ static bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *
}
start_meas(&ue->dlsch_unscrambling_stats);
nr_dlsch_unscrambling(llr[0],
dl_harq0->G,
0,
dlsch[0].dlsch_config.dlDataScramblingId,
dlsch[0].rnti);
nr_dlsch_unscrambling(llr[0], G, 0, dlsch[0].dlsch_config.dlDataScramblingId, dlsch[0].rnti);
stop_meas(&ue->dlsch_unscrambling_stats);
......@@ -718,7 +719,8 @@ static bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *
nr_slot_rx,
harq_pid,
dlsch_bytes,
p_b);
p_b,
G);
LOG_T(PHY,"dlsch decoding, ret = %d\n", ret);
......@@ -773,19 +775,10 @@ static bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *
int ptrsSymbPerSlot = get_ptrs_symbols_in_slot(ptrsSymbPos, dlsch_config->start_symbol, dlsch_config->number_symbols);
unav_res = n_ptrs * ptrsSymbPerSlot;
}
dl_harq1->G = nr_get_G(dlsch_config->number_rbs,
nb_symb_sch,
nb_re_dmrs,
dmrs_len,
unav_res,
dlsch_config->qamModOrder,
dlsch[1].Nl);
int G1 =
nr_get_G(dlsch_config->number_rbs, nb_symb_sch, nb_re_dmrs, dmrs_len, unav_res, dlsch_config->qamModOrder, dlsch[1].Nl);
start_meas(&ue->dlsch_unscrambling_stats);
nr_dlsch_unscrambling(llr[1],
dl_harq1->G,
0,
dlsch[1].dlsch_config.dlDataScramblingId,
dlsch[1].rnti);
nr_dlsch_unscrambling(llr[1], G1, 0, dlsch[1].dlsch_config.dlDataScramblingId, dlsch[1].rnti);
stop_meas(&ue->dlsch_unscrambling_stats);
start_meas(&ue->dlsch_decoding_stats);
......@@ -802,7 +795,8 @@ static bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *
nr_slot_rx,
harq_pid,
dlsch_bytes,
p_b);
p_b,
G);
LOG_T(PHY,"CW dlsch decoding, ret1 = %d\n", ret1);
stop_meas(&ue->dlsch_decoding_stats);
......@@ -1048,15 +1042,14 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_
int ptrsSymbPerSlot = get_ptrs_symbols_in_slot(ptrsSymbPos, dlsch_config->start_symbol, dlsch_config->number_symbols);
unav_res = n_ptrs * ptrsSymbPerSlot;
}
NR_DL_UE_HARQ_t *dlsch0_harq = &ue->dl_harq_processes[0][dlsch_config->harq_process_nbr];
dlsch0_harq->G = nr_get_G(dlsch_config->number_rbs,
dlsch_config->number_symbols,
nb_re_dmrs,
dmrs_len,
unav_res,
dlsch_config->qamModOrder,
dlsch[0].Nl);
const uint32_t rx_llr_buf_sz = ((dlsch0_harq->G + 15) / 16) * 16;
int G = nr_get_G(dlsch_config->number_rbs,
dlsch_config->number_symbols,
nb_re_dmrs,
dmrs_len,
unav_res,
dlsch_config->qamModOrder,
dlsch[0].Nl);
const uint32_t rx_llr_buf_sz = ((G + 15) / 16) * 16;
const uint32_t nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
int16_t* llr[2];
for (int i = 0; i < nb_codewords; i++)
......@@ -1064,11 +1057,11 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_C, VCD_FUNCTION_IN);
// it returns -1 in case of internal failure, or 0 in case of normal result
int ret_pdsch = nr_ue_pdsch_procedures(ue, proc, dlsch, llr, rxdataF);
int ret_pdsch = nr_ue_pdsch_procedures(ue, proc, dlsch, llr, rxdataF, G);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_C, VCD_FUNCTION_OUT);
UEscopeCopy(ue, pdschLlr, llr[0], sizeof(int16_t), 1, dlsch0_harq->G, 0);
UEscopeCopy(ue, pdschLlr, llr[0], sizeof(int16_t), 1, G, 0);
LOG_D(PHY, "DLSCH data reception at nr_slot_rx: %d\n", nr_slot_rx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN);
......@@ -1076,7 +1069,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_
start_meas(&ue->dlsch_procedures_stat);
if (ret_pdsch >= 0)
nr_ue_dlsch_procedures(ue, proc, dlsch, llr);
nr_ue_dlsch_procedures(ue, proc, dlsch, llr, G);
else {
LOG_E(NR_PHY, "Demodulation impossible, internal error\n");
send_dl_done_to_tx_thread(
......
......@@ -472,8 +472,7 @@ int main(int argc, char **argv)
//estimated_output = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
unsigned char estimated_output_bit[16 * 68 * 384];
NR_UE_DLSCH_t *dlsch0_ue = &dlsch_ue[0];
NR_DL_UE_HARQ_t *harq_process = &UE->dl_harq_processes[0][harq_pid];
harq_process->G = available_bits;
NR_DL_UE_HARQ_t *harq_process = &UE->dl_harq_processes[0][harq_pid];
harq_process->first_rx = 1;
dlsch0_ue->dlsch_config.mcs = Imcs;
dlsch0_ue->dlsch_config.mcs_table = mcs_table;
......@@ -563,13 +562,24 @@ int main(int argc, char **argv)
}
uint32_t dlsch_bytes = a_segments*1056; // allocated bytes per segment
__attribute__ ((aligned(32))) uint8_t b[dlsch_bytes];
ret = nr_dlsch_decoding(UE, &proc, 0, channel_output_fixed, &UE->frame_parms,
dlsch0_ue, harq_process, frame, nb_symb_sch,
slot,harq_pid,dlsch_bytes,b);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DECODING0, VCD_FUNCTION_OUT);
if (ret > dlsch0_ue->max_ldpc_iterations)
ret = nr_dlsch_decoding(UE,
&proc,
0,
channel_output_fixed,
&UE->frame_parms,
dlsch0_ue,
harq_process,
frame,
nb_symb_sch,
slot,
harq_pid,
dlsch_bytes,
b,
available_bits);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DECODING0, VCD_FUNCTION_OUT);
if (ret > dlsch0_ue->max_ldpc_iterations)
n_errors++;
//count errors
......
......@@ -347,36 +347,35 @@ int main(int argc, char **argv)
default:
case 'h':
printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n", argv[0]);
printf("-h This message\n");
printf("-p Use extended prefix mode\n");
//printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n");
printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n");
printf("-b number of HARQ bits (1-2)\n");
printf("-B payload to be transmitted on PUCCH\n");
printf("-c Activate scheduling request\n");
printf("-d Use TDD\n");
printf("-f Output filename (.txt format) for Pe/SNR results\n");
printf("-F Input filename (.txt format) for RX conformance testing\n");
printf("-g [A,B,C,D,E,F,G] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models (ignores delay spread and Ricean factor)\n");
printf("-i Enter number of ofdm symbols for pucch\n");
printf("-I Starting symbol index for pucch\n");
printf("-h This message\n");
printf("-m initial cyclic shift m0\n");
printf("-n Number of frames to simulate\n");
printf("-N Nid_cell\n");
printf("-o Carrier frequency offset in Hz\n");
printf("-O oversampling factor (1,2,4,8,16)\n");
printf("-p Use extended prefix mode\n");
printf("-P Enter the format of PUCCH\n");
printf("-q PUCCH number of PRB\n");
printf("-r PUCCH starting PRB\n");
printf("-R N_RB_DL\n");
printf("-s Starting SNR, runs from SNR0 to SNR0 + 5 dB. If n_frames is 1 then just SNR is simulated\n");
printf("-S Ending SNR, runs from SNR0 to SNR1\n");
printf("-t Delay spread for multipath channel\n");
printf("-g [A,B,C,D,E,F,G] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models (ignores delay spread and Ricean factor)\n");
printf("-T to check nacktoack miss for format 1\n");
printf("-x Transmission mode (1,2,6 for the moment)\n");
printf("-y Number of TX antennas used in eNB\n");
printf("-z Number of RX antennas used in UE\n");
printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n");
printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n");
printf("-o Carrier frequency offset in Hz\n");
printf("-N Nid_cell\n");
printf("-R N_RB_DL\n");
printf("-O oversampling factor (1,2,4,8,16)\n");
printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n");
//printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n");
printf("-f Output filename (.txt format) for Pe/SNR results\n");
printf("-F Input filename (.txt format) for RX conformance testing\n");
printf("-i Enter number of ofdm symbols for pucch\n");
printf("-I Starting symbol index for pucch\n");
printf("-r PUCCH starting PRB\n");
printf("-q PUCCH number of PRB\n");
printf("-P Enter the format of PUCCH\n");
printf("-b number of HARQ bits (1-2)\n");
printf("-B payload to be transmitted on PUCCH\n");
printf("-m initial cyclic shift m0\n");
printf("-T to check nacktoack miss for format 1\n");
exit (-1);
break;
}
......
......@@ -88,14 +88,18 @@ typedef struct NRRrcDcchDataReq_s {
uint8_t gNB_index;
} NRRrcDcchDataReq;
#include "openair2/LAYER2/nr_pdcp/nr_pdcp_integrity_data.h"
typedef struct NRRrcDcchDataInd_s {
uint32_t frame;
uint8_t dcch_index;
uint32_t sdu_size;
uint8_t *sdu_p;
uint16_t rnti;
uint8_t module_id;
uint8_t gNB_index; // LG: needed in UE
uint16_t rnti;
uint8_t module_id;
uint8_t gNB_index; // LG: needed in UE
/* 'msg_integrity' is needed for RRC to check integrity of the PDCP SDU */
nr_pdcp_integrity_data_t msg_integrity;
} NRRrcDcchDataInd;
typedef struct RrcPcchDataReq_s {
......
......@@ -420,26 +420,29 @@ bool read_kpm_sm(void* data)
}
static const char* kpm_meas_du[] = {
"DRB.RlcSduDelayDl",
"DRB.UEThpDl",
"DRB.UEThpUl",
"RRU.PrbTotDl",
"DRB.RlcSduDelayDl",
"DRB.UEThpDl",
"DRB.UEThpUl",
"RRU.PrbTotDl",
"RRU.PrbTotUl",
NULL,
};
static const char* kpm_meas_gnb[] = {
"DRB.PdcpSduVolumeDL",
"DRB.PdcpSduVolumeUL",
"DRB.RlcSduDelayDl",
"DRB.UEThpDl",
"DRB.UEThpUl",
"RRU.PrbTotDl",
"DRB.PdcpSduVolumeDL",
"DRB.PdcpSduVolumeUL",
"DRB.RlcSduDelayDl",
"DRB.UEThpDl",
"DRB.UEThpUl",
"RRU.PrbTotDl",
"RRU.PrbTotUl",
NULL,
};
static const char* kpm_meas_cuup[] = {
"DRB.PdcpSduVolumeDL",
"DRB.PdcpSduVolumeUL",
"DRB.PdcpSduVolumeDL",
"DRB.PdcpSduVolumeUL",
NULL,
};
typedef const char** meas_list;
......
......@@ -100,7 +100,7 @@ By default, FlexRIC will build the nearRT-RIC with E2AP v2 and KPM v2. If you wa
```bash
git clone https://gitlab.eurecom.fr/mosaic5g/flexric flexric
cd flexric/
git checkout 34d6810f9ab435ac3a4023d5e1917669e24341da
git checkout f1c08ed2b9b1eceeda7941dd7bf435db0168dd56
```
### 2.2.2 Build FlexRIC
......
flexric @ f1c08ed2
Subproject commit 34d6810f9ab435ac3a4023d5e1917669e24341da
Subproject commit f1c08ed2b9b1eceeda7941dd7bf435db0168dd56
......@@ -1676,77 +1676,6 @@ void set_monitoring_periodicity_offset(NR_SearchSpace_t *ss,
}
void find_monitoring_periodicity_offset_common(NR_SearchSpace_t *ss,
uint16_t *slot_period,
uint16_t *offset) {
switch(ss->monitoringSlotPeriodicityAndOffset->present) {
case NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1:
*slot_period = 1;
*offset = 0;
break;
case NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl2:
*slot_period = 2;
*offset = ss->monitoringSlotPeriodicityAndOffset->choice.sl2;
break;
case NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl4:
*slot_period = 4;
*offset = ss->monitoringSlotPeriodicityAndOffset->choice.sl4;
break;
case NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl5:
*slot_period = 5;
*offset = ss->monitoringSlotPeriodicityAndOffset->choice.sl5;
break;
case NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl8:
*slot_period = 8;
*offset = ss->monitoringSlotPeriodicityAndOffset->choice.sl8;
break;
case NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl10:
*slot_period = 10;
*offset = ss->monitoringSlotPeriodicityAndOffset->choice.sl10;
break;
case NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl16:
*slot_period = 16;
*offset = ss->monitoringSlotPeriodicityAndOffset->choice.sl16;
break;
case NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl20:
*slot_period = 20;
*offset = ss->monitoringSlotPeriodicityAndOffset->choice.sl20;
break;
case NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl40:
*slot_period = 40;
*offset = ss->monitoringSlotPeriodicityAndOffset->choice.sl40;
break;
case NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl80:
*slot_period = 80;
*offset = ss->monitoringSlotPeriodicityAndOffset->choice.sl80;
break;
case NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl160:
*slot_period = 160;
*offset = ss->monitoringSlotPeriodicityAndOffset->choice.sl160;
break;
case NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl320:
*slot_period = 320;
*offset = ss->monitoringSlotPeriodicityAndOffset->choice.sl320;
break;
case NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl640:
*slot_period = 640;
*offset = ss->monitoringSlotPeriodicityAndOffset->choice.sl640;
break;
case NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1280:
*slot_period = 1280;
*offset = ss->monitoringSlotPeriodicityAndOffset->choice.sl1280;
break;
case NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl2560:
*slot_period = 2560;
*offset = ss->monitoringSlotPeriodicityAndOffset->choice.sl2560;
break;
default:
AssertFatal(1==0,"Invalid monitoring slot periodicity and offset value\n");
break;
}
}
int get_nr_prach_occasion_info_from_index(uint8_t index,
uint32_t pointa,
uint8_t mu,
......
......@@ -133,10 +133,6 @@ void find_aggregation_candidates(uint8_t *aggregation_level,
const NR_SearchSpace_t *ss,
int maxL);
void find_monitoring_periodicity_offset_common(NR_SearchSpace_t *ss,
uint16_t *slot_period,
uint16_t *offset);
int get_nr_prach_info_from_index(uint8_t index,
int frame,
int slot,
......
......@@ -39,8 +39,6 @@
extern const uint8_t nr_slots_per_frame[5];
extern dci_pdu_rel15_t *def_dci_pdu_rel15;
/* Scheduler */
extern RAN_CONTEXT_t RC;
extern uint8_t nfapi_mode;
......
......@@ -66,8 +66,6 @@ extern const uint8_t table_7_3_2_3_3_4_twoCodeword[6][14];
extern const uint16_t table_7_2_1[16];
extern dci_pdu_rel15_t *def_dci_pdu_rel15;
extern void mac_rlc_data_ind(const module_id_t module_idP,
const rnti_t rntiP,
const eNB_index_t eNB_index,
......
......@@ -120,18 +120,8 @@ subframe number \param[in] slotP slot number
*/
int8_t nr_ue_get_SR(NR_UE_MAC_INST_t *mac, frame_t frameP, slot_t slotP);
int8_t nr_ue_process_dci(NR_UE_MAC_INST_t *mac,
int cc_id,
frame_t frame,
int slot,
dci_pdu_rel15_t *dci,
fapi_nr_dci_indication_pdu_t *dci_ind);
int nr_ue_process_dci_indication_pdu(NR_UE_MAC_INST_t *mac,
int cc_id,
int gNB_index,
frame_t frame,
int slot,
fapi_nr_dci_indication_pdu_t *dci);
nr_dci_format_t nr_ue_process_dci_indication_pdu(NR_UE_MAC_INST_t *mac, frame_t frame, int slot, fapi_nr_dci_indication_pdu_t *dci);
int8_t nr_ue_process_csirs_measurements(NR_UE_MAC_INST_t *mac,
frame_t frame,
int slot,
......
......@@ -107,7 +107,6 @@ NR_ControlResourceSet_t *ue_get_coreset(const NR_BWP_PDCCH_t *config, const int
return coreset;
}
void config_dci_pdu(NR_UE_MAC_INST_t *mac,
fapi_nr_dl_config_request_t *dl_config,
const int rnti_type,
......@@ -160,36 +159,40 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac,
rel15->coreset.pdcch_dmrs_scrambling_id = mac->physCellId;
}
rel15->num_dci_options = (mac->ra.ra_state == nrRA_WAIT_RAR || rnti_type == TYPE_SI_RNTI_) ? 1 : 2;
int temp_num_dci_options = (mac->ra.ra_state == nrRA_WAIT_RAR || rnti_type == TYPE_SI_RNTI_) ? 1 : 2;
int dci_format[2] = {0};
if (ss->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific) {
if (ss->searchSpaceType->choice.ue_Specific->dci_Formats ==
NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0) {
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_0;
rel15->dci_format_options[1] = NR_UL_DCI_FORMAT_0_0;
dci_format[0] = NR_DL_DCI_FORMAT_1_0;
dci_format[1] = NR_UL_DCI_FORMAT_0_0;
}
else {
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_1;
rel15->dci_format_options[1] = NR_UL_DCI_FORMAT_0_1;
dci_format[0] = NR_DL_DCI_FORMAT_1_1;
dci_format[1] = NR_UL_DCI_FORMAT_0_1;
}
}
else { // common
AssertFatal(ss->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0,
"Only supporting format 10 and 00 for common SS\n");
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_0;
rel15->dci_format_options[1] = NR_UL_DCI_FORMAT_0_0;
dci_format[0] = NR_DL_DCI_FORMAT_1_0;
dci_format[1] = NR_UL_DCI_FORMAT_0_0;
}
NR_UE_ServingCell_Info_t *sc_info = &mac->sc_info;
// loop over RNTI type and configure resource allocation for DCI
for (int i = 0; i < rel15->num_dci_options; i++) {
// loop over DCI options and configure resource allocation
// need to configure mac->def_dci_pdu_rel15 for all possible format options
for (int i = 0; i < temp_num_dci_options; i++) {
rel15->ss_type_options[i] = ss->searchSpaceType->present;
const int dci_format = rel15->dci_format_options[i];
if (dci_format[i] == NR_DL_DCI_FORMAT_1_0 || dci_format[i] == NR_UL_DCI_FORMAT_0_0)
rel15->dci_format_options[i] = NFAPI_NR_FORMAT_0_0_AND_1_0;
else
rel15->dci_format_options[i] = NFAPI_NR_FORMAT_0_1_AND_1_1;
uint16_t alt_size = 0;
if(current_DL_BWP) {
// computing alternative size for padding
// computing alternative size for padding or truncation
dci_pdu_rel15_t temp_pdu;
if(dci_format == NR_DL_DCI_FORMAT_1_0)
if (dci_format[i] == NR_DL_DCI_FORMAT_1_0)
alt_size = nr_dci_size(current_DL_BWP,
current_UL_BWP,
sc_info,
......@@ -202,7 +205,7 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac,
ss->searchSpaceType->present,
mac->type0_PDCCH_CSS_config.num_rbs,
0);
if(dci_format == NR_UL_DCI_FORMAT_0_0)
if (dci_format[i] == NR_UL_DCI_FORMAT_0_0)
alt_size = nr_dci_size(current_DL_BWP,
current_UL_BWP,
sc_info,
......@@ -221,8 +224,8 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac,
current_UL_BWP,
sc_info,
mac->pdsch_HARQ_ACK_Codebook,
&mac->def_dci_pdu_rel15[dl_config->slot][dci_format],
dci_format,
&mac->def_dci_pdu_rel15[dl_config->slot][dci_format[i]],
dci_format[i],
rnti_type,
coreset,
dl_bwp_id,
......@@ -234,6 +237,13 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac,
rel15->dci_length_options[i] = dci_size;
}
// DCI 0_0 and 1_0 are same size, L1 just needs to look for 1 option
// L2 decides format based on format indicator in payload
if (rel15->dci_format_options[0] == NFAPI_NR_FORMAT_0_0_AND_1_0)
rel15->num_dci_options = 1;
else
rel15->num_dci_options = 2;
rel15->BWPStart = coreset_id == 0 ? mac->type0_PDCCH_CSS_config.cset_start_rb : current_DL_BWP->BWPStart;
rel15->BWPSize = coreset_id == 0 ? mac->type0_PDCCH_CSS_config.num_rbs : current_DL_BWP->BWPSize;
......
......@@ -654,11 +654,14 @@ static void config_common(gNB_MAC_INST *nrmac, nr_pdsch_AntennaPorts_t pdsch_Ant
scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots,
scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols);
if (periods_per_frame < 0)
LOG_E(NR_MAC, "TDD configuration can not be done\n");
else {
LOG_I(NR_MAC, "TDD has been properly configurated\n");
nrmac->tdd_beam_association = (int16_t *)malloc16(periods_per_frame * sizeof(int16_t));
AssertFatal(periods_per_frame > 0, "TDD configuration cannot be configured\n");
if (frequency_range == FR2) {
LOG_I(NR_MAC, "Configuring TDD beam association to default\n");
nrmac->tdd_beam_association = malloc16(periods_per_frame * sizeof(int16_t));
for (int i = 0; i < periods_per_frame; ++i)
nrmac->tdd_beam_association[i] = -1; /* default: beams not configured */
} else {
nrmac->tdd_beam_association = NULL; /* default: no beams */
}
}
......
......@@ -2071,20 +2071,6 @@ NR_UE_info_t *find_nr_UE(NR_UEs_t *UEs, rnti_t rntiP)
return NULL;
}
int find_nr_RA_id(module_id_t mod_idP, int CC_idP, rnti_t rntiP)
{
NR_RA_t *ra = RC.nrmac[mod_idP]->common_channels[CC_idP].ra;
for (int RA_id = 0; RA_id < NR_NB_RA_PROC_MAX; RA_id++) {
LOG_D(NR_MAC, "Checking RA_id %d for %x : state %s\n", RA_id, rntiP, nrra_text[ra[RA_id].ra_state]);
if (ra[RA_id].ra_state != nrRA_gNB_IDLE && ra[RA_id].rnti == rntiP)
return RA_id;
}
return -1;
}
int get_nrofHARQ_ProcessesForPDSCH(e_NR_PDSCH_ServingCellConfig__nrofHARQ_ProcessesForPDSCH n)
{
switch (n) {
......
......@@ -717,7 +717,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
if (no_sig) {
LOG_D(NR_MAC, "Random Access %i failed at state %s (no signal)\n", i, nrra_text[ra->ra_state]);
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
nr_clear_ra_proc(ra);
continue;
}
......@@ -732,7 +732,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
nrra_text[ra->ra_state],
ra->rnti,
current_rnti);
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
nr_clear_ra_proc(ra);
}
continue;
......@@ -747,7 +747,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
ra->rnti,
current_rnti);
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
nr_clear_ra_proc(ra);
return;
}
......@@ -778,7 +778,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
nr_mac_reset_ul_failure(UE_scheduling_control);
reset_dl_harq_list(UE_scheduling_control);
reset_ul_harq_list(UE_scheduling_control);
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
nr_clear_ra_proc(ra);
process_CellGroup(ra->CellGroup, UE);
} else {
......@@ -809,7 +809,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
// solution may be implemented
LOG_W(NR_MAC, "No UE found with C-RNTI %04x, ignoring Msg3 to have UE come back with new RA attempt\n", ra->rnti);
mac_remove_nr_ue(RC.nrmac[gnb_mod_idP], ra->rnti);
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
nr_clear_ra_proc(ra);
return;
}
......@@ -859,13 +859,13 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
// for CFRA (NSA) do not schedule retransmission of msg3
if (ra->cfra) {
LOG_D(NR_MAC, "Random Access %i failed at state %s (NSA msg3 reception failed)\n", i, nrra_text[ra->ra_state]);
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
nr_clear_ra_proc(ra);
return;
}
if (ra->msg3_round >= gNB_mac->ul_bler.harq_round_max - 1) {
LOG_W(NR_MAC, "Random Access %i failed at state %s (Reached msg3 max harq rounds)\n", i, nrra_text[ra->ra_state]);
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
nr_clear_ra_proc(ra);
return;
}
......
......@@ -115,7 +115,7 @@ void nr_schedule_RA(module_id_t module_idP,
void nr_initiate_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t slotP,
uint16_t preamble_index, uint8_t freq_index, uint8_t symbol, int16_t timing_offset);
void nr_clear_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, NR_RA_t *ra);
void nr_clear_ra_proc(NR_RA_t *ra);
int nr_allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t slotP, int test_only);
......@@ -302,8 +302,6 @@ void remove_front_nr_list(NR_list_t *listP);
NR_UE_info_t * find_nr_UE(NR_UEs_t* UEs, rnti_t rntiP);
int find_nr_RA_id(module_id_t mod_idP, int CC_idP, rnti_t rntiP);
void configure_UE_BWP(gNB_MAC_INST *nr_mac,
NR_ServingCellConfigCommon_t *scc,
NR_UE_sched_ctrl_t *sched_ctrl,
......
......@@ -612,7 +612,7 @@ void ue_context_modification_refuse(const f1ap_ue_context_modif_refuse_t *refuse
for (int i = 0; i < NR_NB_RA_PROC_MAX; i++) {
NR_RA_t *ra = &cc->ra[i];
if (ra->rnti == UE->rnti)
nr_clear_ra_proc(0, CC_id, 0 /* frame */, ra);
nr_clear_ra_proc(ra);
}
NR_SCHED_UNLOCK(&mac->sched_lock);
......
......@@ -164,8 +164,14 @@ typedef struct {
RA_gNB_state_t ra_state;
/// CORESET0 configured flag
int coreset0_configured;
/// Frame where preamble was received
int preamble_frame;
/// Slot where preamble was received
uint8_t preamble_slot;
/// Received preamble_index
uint8_t preamble_index;
/// Timing offset indicated by PHY
int16_t timing_offset;
/// Subframe where Msg2 is to be sent
uint8_t Msg2_slot;
/// Frame where Msg2 is to be sent
......@@ -182,14 +188,8 @@ typedef struct {
rnti_t rnti;
/// RA RNTI allocated from received PRACH
uint16_t RA_rnti;
/// Received preamble_index
uint8_t preamble_index;
/// Received UE Contention Resolution Identifier
uint8_t cont_res_id[6];
/// Timing offset indicated by PHY
int16_t timing_offset;
/// Timeout for RRC connection
int16_t RRC_timer;
/// Msg3 first RB
int msg3_first_rb;
/// Msg3 number of RB
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -87,6 +87,12 @@ void nr_pdcp_config_set_security(ue_id_t ue_id,
uint8_t *const kRRCint_pP,
uint8_t *const kUPenc_pP);
bool nr_pdcp_check_integrity_srb(ue_id_t ue_id,
int srb_id,
const uint8_t *msg,
int msg_size,
const nr_pdcp_integrity_data_t *msg_integrity);
bool cu_f1u_data_req(protocol_ctxt_t *ctxt_pP,
const srb_flag_t srb_flagP,
const rb_id_t rb_id,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment