diff --git a/README.md b/README.md
index 4f38f77e4e..2077b3d20b 100644
--- a/README.md
+++ b/README.md
@@ -21,28 +21,14 @@
# OpenAirInterface License #
-### Included Fixes: ###
-- Ease of use of gprof and address sanitizer for debugging purposes
-- Updated json files to allow for GDB, real-time debugging capabilities
-- Updated logging features to minimally log only key connection milestones. This imroves scalability of multiple UEs.
-- Updated logging to include time stamp for timing analysis
-- Updated memory allocation procedures to correct size requirements
-- Added debugging features to handle signal terminations
-- nfapi.c pullarray8 fix invalid pointer math
-- Overlapping destination and source memory in memcpy, so updated to memmove to check for this bug
-- Advanced error checking mechanisms in critical pack and unpack functions
-- Created option for CPU assignment to UE to improve scalability
-- Added EPC integration to allow multiple individual UE entities to each have their USIM information parced by the executables
-- Updated random value seeds to minimize probability of error in generation of random values
-- Enables capability round robin scheduler if desired
-- Enables capability real time scheduler if desired
-- Added new standalone functions to the UE phy-layer (phy_stub_ue.c) to incorporate individual UE entities
-- Updated sending and packing functions in UE (lte_ue.c) to incorporate new standalone changes
-- Incorporated semaphores to control timing of incoming downlink packets
-- Implemented new queuing system to handle message exchange from UE to eNB and vice versa
-- Updated global value in nFAPI for size of subframe
-- Updated global value to increase scalability in system
+ * [OAI License Model](http://www.openairinterface.org/?page_id=101)
+ * [OAI License v1.1 on our website](http://www.openairinterface.org/?page_id=698)
+It is distributed under **OAI Public License V1.1**.
+
+The license information is distributed under [LICENSE](LICENSE) file in the same directory.
+
+Please see [NOTICE](NOTICE.md) file for third party software that is included in the sources.
# Where to Start #
diff --git a/ci-scripts/cls_log_mgt.py b/ci-scripts/cls_log_mgt.py
index cf7b91d3c0..905a105512 100644
--- a/ci-scripts/cls_log_mgt.py
+++ b/ci-scripts/cls_log_mgt.py
@@ -30,11 +30,15 @@
-
+import logging
import re
import subprocess
-import logging
-import math
+import sshconnection
+
+logging.basicConfig(
+ level=logging.DEBUG,
+ format="[%(asctime)s] %(name)s:%(levelname)s: %(message)s"
+)
class Log_Mgt:
@@ -49,40 +53,25 @@ class Log_Mgt:
#-----------------$
- def __CheckAvailSpace(self):
+ def __CheckUsedSpace(self):
HOST=self.Username+'@'+self.IPAddress
COMMAND="df "+ self.path
ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
result = ssh.stdout.readlines()
s=result[1].decode('utf-8').rstrip()#result[1] is the second line with the results we are looking for
- tmp=s.split()
- return tmp[3] #return avail space from the line
+ used=s.split()[4] #get 4th field ex: 70%
+ m = re.match('^(\d+)\%',used)
+ if m is not None:
+ return int(m.group(1))
- def __GetOldestFile(self):
- HOST=self.Username+'@'+self.IPAddress
- COMMAND="ls -rtl "+ self.path #-rtl will bring oldest file on top
- ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
- result = ssh.stdout.readlines()
- s=result[1].decode('utf-8').rstrip()
- tmp=s.split()
- return tmp[8]#return filename from the line
+ def __RemoveOldest(self):
+ mySSH = sshconnection.SSHConnection()
+ mySSH.open(self.IPAddress, self.Username, self.Password)
+ COMMAND='echo ' + self.Password + ' | sudo -S find ' + self.path + ' -type f -mtime +14 -delete'
+ mySSH.command(COMMAND,'\$',20)
+ mySSH.close()
- def __AvgSize(self):
- HOST=self.Username+'@'+self.IPAddress
- COMMAND="ls -rtl "+ self.path
- ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
- result = ssh.stdout.readlines()
- if len(result)>1: #at least 1 file present
- total_size=0
- for i in range(1,len(result)):
- s=result[i].decode('utf-8').rstrip()
- tmp=s.split()
- total_size+=int(tmp[4]) #get filesize
- return math.floor(total_size/(len(result)-1)) #compute average file/artifact size
- else:#empty,no files
- return 0
-
#-----------------$
#PUBLIC Methods$
@@ -90,17 +79,15 @@ class Log_Mgt:
def LogRotation(self):
- avail_space =int(self.__CheckAvailSpace())*1000 #avail space in target folder, initially displayed in Gb
- avg_size=self.__AvgSize() #average size of artifacts in the target folder
- logging.debug("Avail Space : " + str(avail_space) + " / Artifact Avg Size : " + str(avg_size))
- if avail_space < 50*avg_size: #reserved space is 50x artifact file ; oldest file will be deleted
- oldestfile=self.__GetOldestFile()
- HOST=self.Username+'@'+self.IPAddress
- COMMAND="echo " + self.Password + " | sudo -S rm "+ self.path + "/" + oldestfile
- logging.debug(COMMAND)
- ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+ used_space = self.__CheckUsedSpace() #avail space in target folder
+ if used_space > 80 :
+ logging.debug('\u001B[1;37;41m Used Disk > 80%, on ' + self.Username+'@'+self.IPAddress + '\u001B[0m')
+ logging.debug('\u001B[1;37;41m Removing Artifacts older than 14 days \u001B[0m')
+ self.__RemoveOldest()
else:
- logging.debug("Still some space left for artifacts storage")
+ logging.debug('Used Disk < 80%, on ' + self.Username+'@'+self.IPAddress +', no cleaning required')
+
+
diff --git a/ci-scripts/conf_files/gNB_SA_CU.conf b/ci-scripts/conf_files/gNB_SA_CU.conf
index 1e84e479bc..39c9a43ad4 100644
--- a/ci-scripts/conf_files/gNB_SA_CU.conf
+++ b/ci-scripts/conf_files/gNB_SA_CU.conf
@@ -84,17 +84,8 @@ gNBs =
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1;
#pdcch-ConfigCommon
- initialDLBWPcontrolResourceSetZero = 12;
+ initialDLBWPcontrolResourceSetZero = 11;
initialDLBWPsearchSpaceZero = 0;
- #pdsch-ConfigCommon
- #pdschTimeDomainAllocationList (up to 16 entries)
- initialDLBWPk0_0 = 0; #for DL slot
- initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
- initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
-
- initialDLBWPk0_1 = 0; #for mixed slot
- initialDLBWPmappingType_1 = 0;
- initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
#uplinkConfigCommon
#frequencyInfoUL
@@ -149,19 +140,6 @@ gNBs =
# 0=unrestricted, 1=restricted type A, 2=restricted type B
restrictedSetConfig = 0,
- # pusch-ConfigCommon (up to 16 elements)
- initialULBWPk2_0 = 6; # used for UL slot
- initialULBWPmappingType_0 = 1
- initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13
-
- initialULBWPk2_1 = 6; # used for mixed slot
- initialULBWPmappingType_1 = 1;
- initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4
-
- initialULBWPk2_2 = 7; # used for Msg.3 during RA
- initialULBWPmappingType_2 = 1;
- initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
-
msg3_DeltaPreamble = 1;
p0_NominalWithGrant =-90;
diff --git a/ci-scripts/conf_files/gNB_SA_DU.conf b/ci-scripts/conf_files/gNB_SA_DU.conf
index 95fa75bc1d..c30805a2d9 100644
--- a/ci-scripts/conf_files/gNB_SA_DU.conf
+++ b/ci-scripts/conf_files/gNB_SA_DU.conf
@@ -76,17 +76,8 @@ gNBs =
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1;
#pdcch-ConfigCommon
- initialDLBWPcontrolResourceSetZero = 12;
+ initialDLBWPcontrolResourceSetZero = 11;
initialDLBWPsearchSpaceZero = 0;
- #pdsch-ConfigCommon
- #pdschTimeDomainAllocationList (up to 16 entries)
- initialDLBWPk0_0 = 0; #for DL slot
- initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
- initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
-
- initialDLBWPk0_1 = 0; #for mixed slot
- initialDLBWPmappingType_1 = 0;
- initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
#uplinkConfigCommon
#frequencyInfoUL
@@ -141,19 +132,6 @@ gNBs =
# 0=unrestricted, 1=restricted type A, 2=restricted type B
restrictedSetConfig = 0,
- # pusch-ConfigCommon (up to 16 elements)
- initialULBWPk2_0 = 6; # used for UL slot
- initialULBWPmappingType_0 = 1
- initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13
-
- initialULBWPk2_1 = 6; # used for mixed slot
- initialULBWPmappingType_1 = 1;
- initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4
-
- initialULBWPk2_2 = 7; # used for Msg.3 during RA
- initialULBWPmappingType_2 = 1;
- initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
-
msg3_DeltaPreamble = 1;
p0_NominalWithGrant =-90;
diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf
index 082cc826f3..8b14b74556 100644
--- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf
+++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf
@@ -258,7 +258,7 @@ RUs = (
## beamforming 4x4 matrix:
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
- sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
+ sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
}
);
diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf
index 6af8a23407..02035ea827 100644
--- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf
+++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf
@@ -254,7 +254,7 @@ RUs = (
## beamforming 4x4 matrix:
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
- sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
+ sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
}
);
diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf
index e798e40d64..84b66060d9 100644
--- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf
@@ -232,7 +232,7 @@ RUs = (
bf_weights = [0x00007fff, 0x00007fff];
#clock_src = "external";
sf_extension = 0
- sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
+ sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
}
);
diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf
index b92c7df92d..9f5c2875b3 100644
--- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf
+++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf
@@ -261,7 +261,7 @@ RUs = (
## beamforming 4x4 matrix:
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
sf_extension = 0
- sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
+ sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
}
);
diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf
index 6c778a7c31..594bd5e4c8 100644
--- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf
@@ -265,7 +265,7 @@ RUs = (
## beamforming 4x4 matrix:
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
sf_extension = 0
- sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
+ sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
}
);
diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf
index 5c826ca862..2361437f7c 100644
--- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf
+++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf
@@ -260,7 +260,7 @@ RUs = (
## beamforming 4x4 matrix:
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
sf_extension = 0
- sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
+ sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
}
);
diff --git a/ci-scripts/cppcheck_suppressions.list b/ci-scripts/cppcheck_suppressions.list
index f8438a4276..ff4cac20b3 100644
--- a/ci-scripts/cppcheck_suppressions.list
+++ b/ci-scripts/cppcheck_suppressions.list
@@ -50,10 +50,6 @@ memleak:openair1/PHY/CODING/TESTBENCH/ltetest.c
invalidPrintfArgType_sint:openair1/PHY/CODING/TESTBENCH/pdcch_test.c
//
//-----------------------------------------------------------------------------
-// oaisim deprecated, remove?
-doubleFree:openair3/TEST/oaisim_mme_list_benchmark.c
-//
-//-----------------------------------------------------------------------------
// is itti analyzer deprecated
nullPointer:common/utils/itti_analyzer/itti_analyzer.c
nullPointerRedundantCheck:common/utils/itti_analyzer/libbuffers/buffers.c
diff --git a/ci-scripts/datalog_rt_stats.2x2.yaml b/ci-scripts/datalog_rt_stats.2x2.yaml
index 9e2b66862d..a93ef6aa8c 100644
--- a/ci-scripts/datalog_rt_stats.2x2.yaml
+++ b/ci-scripts/datalog_rt_stats.2x2.yaml
@@ -4,16 +4,14 @@
Title : Processing Time (us)
ColNames :
- Metric
- - Average
- - Max
- - Average vs Reference Deviation (Reference Value ; Acceptability Threshold)
+ - Average; Max; Count
+ - Average vs Reference Deviation (Reference Value; Acceptability Threshold)
Ref :
feprx : 120.0
feptx_prec : 8.0
feptx_ofdm : 50.0
feptx_total : 75.0
- L1 Tx processing thread 0 : 300.0
- L1 Tx processing thread 1 : 300.0
+ L1 Tx processing : 300.0
DLSCH encoding : 230.0
L1 Rx processing : 175.0
PUSCH inner-receiver : 100.0
@@ -25,8 +23,7 @@ Threshold :
feptx_prec : 1.25
feptx_ofdm : 1.25
feptx_total : 1.25
- L1 Tx processing thread 0 : 1.25
- L1 Tx processing thread 1 : 1.25
+ L1 Tx processing : 1.25
DLSCH encoding : 1.25
L1 Rx processing : 1.25
PUSCH inner-receiver : 1.25
diff --git a/ci-scripts/datalog_rt_stats.default.yaml b/ci-scripts/datalog_rt_stats.default.yaml
index a2d4768752..02a90c86f4 100644
--- a/ci-scripts/datalog_rt_stats.default.yaml
+++ b/ci-scripts/datalog_rt_stats.default.yaml
@@ -4,16 +4,14 @@
Title : Processing Time (us)
ColNames :
- Metric
- - Average
- - Max
- - Average vs Reference Deviation (Reference Value ; Acceptability Threshold)
+ - Average; Max; Count
+ - Average vs Reference Deviation (Reference Value; Acceptability Threshold)
Ref :
feprx : 60.0
feptx_prec : 8.0
feptx_ofdm : 50.0
feptx_total : 75.0
- L1 Tx processing thread 0 : 300.0
- L1 Tx processing thread 1 : 300.0
+ L1 Tx processing : 300.0
DLSCH encoding : 230.0
L1 Rx processing : 175.0
PUSCH inner-receiver : 100.0
@@ -25,8 +23,7 @@ Threshold :
feptx_prec : 1.25
feptx_ofdm : 1.25
feptx_total : 1.25
- L1 Tx processing thread 0 : 1.25
- L1 Tx processing thread 1 : 1.25
+ L1 Tx processing : 1.25
DLSCH encoding : 1.25
L1 Rx processing : 1.25
PUSCH inner-receiver : 1.25
diff --git a/ci-scripts/html.py b/ci-scripts/html.py
index b172ffb711..13a1ab8691 100644
--- a/ci-scripts/html.py
+++ b/ci-scripts/html.py
@@ -478,21 +478,19 @@ class HTMLManagement():
self.htmlFile.write(' \n')
self.htmlFile.write('
\n')
self.htmlFile.write(' | '+ DataLog['ColNames'][0] +' | \n')
- self.htmlFile.write(' ' + DataLog['ColNames'][1] + ' | \n')
- self.htmlFile.write(' ' + DataLog['ColNames'][2] + ' | \n')
- self.htmlFile.write(' '+ DataLog['ColNames'][3] +' | \n')
+ self.htmlFile.write(' ' + DataLog['ColNames'][1] + ' | \n')
+ self.htmlFile.write(' '+ DataLog['ColNames'][2] +' | \n')
self.htmlFile.write('
\n')
for k in DataLog['Data']:
# TestRow
self.htmlFile.write(' \n')
self.htmlFile.write(' | ' + k + ' | \n')
- self.htmlFile.write(' ' + DataLog['Data'][k][0] + ' | \n')
- self.htmlFile.write(' ' + DataLog['Data'][k][1] + ' | \n')
- if float(DataLog['Data'][k][2])> DataLog['Threshold'][k]:
- self.htmlFile.write(' ' + DataLog['Data'][k][2] + ' (Ref = ' + str(DataLog['Ref'][k]) + ' ; Thres = ' +str(DataLog['Threshold'][k])+') ' + ' | \n')
+ self.htmlFile.write(' ' + DataLog['Data'][k][0] + '; ' + DataLog['Data'][k][1] + '; ' + DataLog['Data'][k][2] + ' | \n')
+ if float(DataLog['Data'][k][3])> DataLog['Threshold'][k]:
+ self.htmlFile.write(' ' + DataLog['Data'][k][3] + ' (Ref = ' + str(DataLog['Ref'][k]) + ' ; Thres = ' +str(DataLog['Threshold'][k])+') ' + ' | \n')
else:
- self.htmlFile.write(' ' + DataLog['Data'][k][2] + ' (Ref = ' + str(DataLog['Ref'][k]) + ' ; Thres = ' +str(DataLog['Threshold'][k])+') ' + ' | \n')
+ self.htmlFile.write(' ' + DataLog['Data'][k][3] + ' (Ref = ' + str(DataLog['Ref'][k]) + ' ; Thres = ' +str(DataLog['Threshold'][k])+') ' + ' | \n')
self.htmlFile.write('
\n')
self.htmlFile.close()
diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py
index 9bb2a816ab..e5d0f10ee4 100644
--- a/ci-scripts/ran.py
+++ b/ci-scripts/ran.py
@@ -1174,17 +1174,19 @@ class RANManagement():
datalog_rt_stats['Data']={}
if len(real_time_stats)!=0: #check if dictionary is not empty
for k in real_time_stats:
- tmp=re.match(r'^(?P.*):\s+(?P\d+\.\d+) us;\s+\d+;\s+(?P\d+\.\d+) us;',real_time_stats[k])
+ tmp=re.match(r'^(?P.*):\s+(?P\d+\.\d+) us;\s+(?P\d+);\s+(?P\d+\.\d+) us;',real_time_stats[k])
if tmp is not None:
metric=tmp.group('metric')
avg=float(tmp.group('avg'))
max=float(tmp.group('max'))
- datalog_rt_stats['Data'][metric]=["{:.0f}".format(avg),"{:.0f}".format(max),"{:.2f}".format(avg/datalog_rt_stats['Ref'][metric])]
+ count=int(tmp.group('count'))
+ datalog_rt_stats['Data'][metric]=["{:.0f}".format(avg),"{:.0f}".format(max),"{:d}".format(count),"{:.2f}".format(avg/datalog_rt_stats['Ref'][metric])]
#once all metrics are collected, store the data as a class attribute to build a dedicated HTML table afterward
self.datalog_rt_stats=datalog_rt_stats
#check if there is a fail => will render the test as failed
for k in datalog_rt_stats['Data']:
- if float(datalog_rt_stats['Data'][k][2])> datalog_rt_stats['Threshold'][k]: #condition for fail : avg/ref is greater than the fixed threshold
+ if float(datalog_rt_stats['Data'][k][3])> datalog_rt_stats['Threshold'][k]: #condition for fail : avg/ref is greater than the fixed threshold
+ logging.debug('\u001B[1;30;43m datalog_rt_stats metric ' + k + '=' + datalog_rt_stats['Data'][k][3] + ' > threshold ' + str(datalog_rt_stats['Threshold'][k]) + ' \u001B[0m')
RealTimeProcessingIssue = True
else:
statMsg = 'No real time stats found in the log file\n'
diff --git a/ci-scripts/stats_monitor_conf.yaml b/ci-scripts/stats_monitor_conf.yaml
index 8760c067fc..9a2ececd18 100644
--- a/ci-scripts/stats_monitor_conf.yaml
+++ b/ci-scripts/stats_monitor_conf.yaml
@@ -20,8 +20,7 @@ gnb :
feptx_prec:
feptx_ofdm:
feptx_total:
- L1 Tx processing thread 0:
- L1 Tx processing thread 1:
+ L1 Tx processing:
DLSCH encoding:
L1 Rx processing:
PUSCH inner-receiver:
@@ -40,12 +39,11 @@ gnb :
rt.feptx_ofdm:
rt.feptx_total:
page3:
- rt.L1 Tx processing thread 0:
- rt.L1 Tx processing thread 1:
+ rt.L1 Tx processing:
rt.DLSCH encoding:
rt.L1 Rx processing:
page4:
rt.PUSCH inner-receiver:
rt.PUSCH decoding:
rt.DL & UL scheduling timing stats:
- rt.UL Indication:
\ No newline at end of file
+ rt.UL Indication:
diff --git a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml
index 23cc6d25b8..f756083ea6 100644
--- a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml
+++ b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml
@@ -96,8 +96,8 @@
Iperf
- iperf (DL/140Mbps/UDP)(60 sec)(single-ue profile)
- -u -b 140M -t 60
+ iperf (DL/200Mbps/UDP)(60 sec)(single-ue profile)
+ -u -b 200M -t 60
DL
nrmodule2_quectel
50
diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml
index 3e497ede13..0ab8bf6b08 100644
--- a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml
+++ b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml
@@ -42,6 +42,8 @@
000001
071004
000001
+ 071005
+ 000001
011002
081000
@@ -148,7 +150,16 @@
90
single-ue
-
+
+ Iperf
+ iperf (DL/130Mbps/UDP)(30 sec)(single-ue profile)
+ -u -b 130M -t 30
+ DL
+ nrmodule2_quectel
+ 50
+ 50
+ single-ue
+
diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt
index 7c60d316e1..7975d4bc77 100644
--- a/cmake_targets/CMakeLists.txt
+++ b/cmake_targets/CMakeLists.txt
@@ -690,19 +690,13 @@ add_list1_option(NB_ANTENNAS_RX "4" "Number of antennas in reception" "1" "2" "4
add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4")
#NOKIA config enhancement
-set (CONFIG_ROOTDIR
- ${OPENAIR_DIR}/common/config
- )
-set (CONFIG_SOURCES
+set (CONFIG_ROOTDIR ${OPENAIR_DIR}/common/config)
+add_library(CONFIG_LIB
${CONFIG_ROOTDIR}/config_load_configmodule.c
${CONFIG_ROOTDIR}/config_userapi.c
${CONFIG_ROOTDIR}/config_cmdline.c
- )
-set (CONFIG_LIBCONFIG_SOURCES
- ${CONFIG_ROOTDIR}/libconfig/config_libconfig.c
- )
-add_library(CONFIG_LIB ${CONFIG_SOURCES})
-add_library(params_libconfig MODULE ${CONFIG_LIBCONFIG_SOURCES} )
+)
+add_library(params_libconfig MODULE ${CONFIG_ROOTDIR}/libconfig/config_libconfig.c)
target_link_libraries(params_libconfig config)
# shared library loader
set (SHLIB_LOADER_SOURCES
@@ -1003,8 +997,6 @@ include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/RRC")
include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/PDCP")
include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/S1AP")
include_directories("${OPENAIR2_DIR}/UTIL/OSA")
-include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds6.1.1/liblfds611/inc")
-include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/inc")
include_directories("${OPENAIR2_DIR}/UTIL/MEM")
include_directories("${OPENAIR2_DIR}/UTIL/LISTS")
include_directories("${OPENAIR2_DIR}/UTIL/FIFO")
@@ -1019,8 +1011,29 @@ include_directories("${OPENAIR2_DIR}/UTIL/OMV")
include_directories("${OPENAIR2_DIR}/RRC/LTE/MESSAGES")
include_directories("${OPENAIR_DIR}")
-# Utilities Library
+# flexran
################
+# Make lfds as a own source code (even if it is a outside library)
+# only user: Flexran, please don't use lfds in any other component
+###################################################################
+
+set(lfds7 ${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/src/)
+file(GLOB lfds7_queue ${lfds7}/lfds700_queue/*.c)
+file(GLOB lfds7_ring ${lfds7}/lfds700_ringbuffer/*.c)
+file(GLOB lfds7_qbss ${lfds7}/lfds700_queue_bounded_singleconsumer_singleproducer/*.c)
+file(GLOB lfds7_stack ${lfds7}/lfds700_stack/*.c)
+file(GLOB lfds7_freelist ${lfds7}/lfds700_freelist/*.c)
+file(GLOB lfds7_btree ${lfds7}/lfds700_btree_addonly_unbalanced/*.c)
+file(GLOB lfds7_hash ${lfds7}/lfds700_hash_addonly/*.c)
+file(GLOB lfds7_ordered_list ${lfds7}/lfds700_list_addonly_ordered_singlylinked/*.c)
+file(GLOB lfds7_unordered_list ${lfds7}/lfds700_list_addonly_singlylinked_unordered/*.c)
+file(GLOB lfds7_misc ${lfds7}/lfds700_misc/*.c)
+
+add_library(LFDS7
+ ${lfds7_queue} ${lfds7_ring} ${lfds7_qbss} ${lfds7_stack} ${lfds7_freelist} ${lfds7_btree} ${lfds7_hash} ${lfds7_ordered_list} ${lfds7_unordered_list} ${lfds7_misc}
+)
+
+target_include_directories(LFDS7 PRIVATE "${lfds7}")
# set the version of protobuf messages, V3 not supported yet
add_list1_option(FLPT_VERSION V2 "FLPT MSG protobuf grammar version" V2 V3)
@@ -1068,6 +1081,9 @@ add_library(FLPT_MSG
${FLPT_OAI_generated}
${FLPT_source}
)
+target_link_libraries(FLPT_MSG LFDS7)
+add_dependencies(FLPT_MSG LFDS7)
+
set(FLPT_MSG_LIB FLPT_MSG)
#message("prpt c dir is : ${FLPT_C_DIR}")
include_directories (${FLPT_C_DIR})
@@ -1079,6 +1095,7 @@ add_library(ASYNC_IF
${OPENAIR2_DIR}/UTIL/ASYNC_IF/ringbuffer_queue.c
)
set(ASYNC_IF_LIB ASYNC_IF)
+target_include_directories(ASYNC_IF PRIVATE "${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/inc")
include_directories(${OPENAIR2_DIR}/UTIL/ASYNC_IF)
add_library(FLEXRAN_AGENT
@@ -1101,7 +1118,9 @@ add_library(FLEXRAN_AGENT
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_slice_verification.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_app.c
)
-add_dependencies(FLEXRAN_AGENT rrc_flag)
+add_dependencies(FLEXRAN_AGENT rrc_flag ASYNC_IF)
+target_link_libraries(FLEXRAN_AGENT ASYNC_IF LFDS7)
+target_include_directories(FLEXRAN_AGENT PRIVATE "${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/inc")
set(FLEXRAN_AGENT_LIB FLEXRAN_AGENT)
add_library(flapp_sample SHARED
${OPENAIR2_DIR}/ENB_APP/flexran_apps/sample.c
@@ -1161,74 +1180,33 @@ set(FSPT_MSG_LIB FSPT_MSG)
message("fspt c dir is : ${FSPT_C_DIR}")
include_directories (${FSPT_C_DIR})
-# add_library(ASYNC_IF
-# ${OPENAIR2_DIR}/UTIL/ASYNC_IF/socket_link.c
-# ${OPENAIR2_DIR}/UTIL/ASYNC_IF/link_manager.c
-# ${OPENAIR2_DIR}/UTIL/ASYNC_IF/message_queue.c
-# ${OPENAIR2_DIR}/UTIL/ASYNC_IF/ringbuffer_queue.c
-# )
-# set(ASYNC_IF_LIB ASYNC_IF)
-# include_directories(${OPENAIR2_DIR}/UTIL/ASYNC_IF)
-
set(PROTOBUF_LIB "protobuf-c")
#set(PROTOBUF_LIB "protobuf") #for Cpp
+###########
+# Utilities
+###############
+
add_library(HASHTABLE
${OPENAIR_DIR}/common/utils/hashtable/hashtable.c
${OPENAIR_DIR}/common/utils/hashtable/obj_hashtable.c
)
include_directories(${OPENAIR_DIR}/common/utils/hashtable)
-set(UTIL_SRC
- # ${OPENAIR2_DIR}/UTIL/CLI/cli.c
- # ${OPENAIR2_DIR}/UTIL/CLI/cli_cmd.c
- # ${OPENAIR2_DIR}/UTIL/CLI/cli_server.c
- ${OPENAIR2_DIR}/UTIL/FIFO/pad_list.c
+add_library(UTIL
${OPENAIR2_DIR}/UTIL/LISTS/list.c
${OPENAIR2_DIR}/UTIL/LISTS/list2.c
${OPENAIR_DIR}/common/utils/LOG/log.c
${OPENAIR_DIR}/common/utils/LOG/vcd_signal_dumper.c
${OPENAIR2_DIR}/UTIL/MATH/oml.c
- # ${OPENAIR2_DIR}/UTIL/MEM/mem_block.c
- # ${OPENAIR2_DIR}/UTIL/OCG/OCG.c
- # ${OPENAIR2_DIR}/UTIL/OCG/OCG_create_dir.c
- # ${OPENAIR2_DIR}/UTIL/OCG/OCG_detect_file.c
- # ${OPENAIR2_DIR}/UTIL/OCG/OCG_generate_report.c
- # ${OPENAIR2_DIR}/UTIL/OCG/OCG_parse_filename.c
- # ${OPENAIR2_DIR}/UTIL/OCG/OCG_parse_XML.c
- # ${OPENAIR2_DIR}/UTIL/OCG/OCG_save_XML.c
- # ${OPENAIR2_DIR}/UTIL/OMG/common.c
- # ${OPENAIR2_DIR}/UTIL/OMG/grid.c
- # ${OPENAIR2_DIR}/UTIL/OMG/job.c
- # ${OPENAIR2_DIR}/UTIL/OMG/mobility_parser.c
- # ${OPENAIR2_DIR}/UTIL/OMG/omg.c
- # ${OPENAIR2_DIR}/UTIL/OMG/omg_hashtable.c
- # ${OPENAIR2_DIR}/UTIL/OMG/rwalk.c
- # ${OPENAIR2_DIR}/UTIL/OMG/rwp.c
- # ${OPENAIR2_DIR}/UTIL/OMG/static.c
- # ${OPENAIR2_DIR}/UTIL/OMG/steadystaterwp.c
- # ${OPENAIR2_DIR}/UTIL/OMG/trace.c
- # ${OPENAIR2_DIR}/UTIL/OMG/trace_hashtable.c
${OPENAIR2_DIR}/UTIL/OPT/probe.c
- # ${OPENAIR2_DIR}/UTIL/OTG/otg_tx.c
- # ${OPENAIR2_DIR}/UTIL/OTG/otg.c
- # ${OPENAIR2_DIR}/UTIL/OTG/otg_kpi.c
- # ${OPENAIR2_DIR}/UTIL/OTG/otg_models.c
- # ${OPENAIR2_DIR}/UTIL/OTG/otg_form.c
- # ${OPENAIR2_DIR}/UTIL/OTG/otg_rx.c
- )
-add_library(UTIL ${UTIL_SRC})
-add_dependencies(UTIL rrc_flag)
-
-#set(OMG_SUMO_SRC
-# ${OPENAIR2_DIR}/UTIL/OMG/client_traci_OMG.c
-# ${OPENAIR2_DIR}/UTIL/OMG/id_manager.c
-# ${OPENAIR2_DIR}/UTIL/OMG/sumo.c
-# ${OPENAIR2_DIR}/UTIL/OMG/socket_traci_OMG.c
-# ${OPENAIR2_DIR}/UTIL/OMG/storage_traci_OMG.c
-# )
-#add_library(OMG_SUMO ${OMG_SUMO_SRC})
+ ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
+ ${OPENAIR_DIR}/common/utils/utils.c
+ ${OPENAIR_DIR}/common/utils/system.c
+ ${OPENAIR_DIR}/common/utils/backtrace.c
+ ${OPENAIR_DIR}/common/utils/time_meas.c
+)
set(SECU_OSA_SRC
${OPENAIR2_DIR}/UTIL/OSA/osa_key_deriver.c
@@ -1491,7 +1469,6 @@ set(PHY_SRC_COMMON
${OPENAIR1_DIR}/PHY/TOOLS/signal_energy.c
${OPENAIR1_DIR}/PHY/TOOLS/dB_routines.c
${OPENAIR1_DIR}/PHY/TOOLS/sqrt.c
- ${OPENAIR1_DIR}/PHY/TOOLS/time_meas.c
${OPENAIR1_DIR}/PHY/TOOLS/lut.c
)
@@ -1628,7 +1605,6 @@ set(PHY_SRC_UE
${OPENAIR1_DIR}/PHY/TOOLS/signal_energy.c
${OPENAIR1_DIR}/PHY/TOOLS/dB_routines.c
${OPENAIR1_DIR}/PHY/TOOLS/sqrt.c
- ${OPENAIR1_DIR}/PHY/TOOLS/time_meas.c
${OPENAIR1_DIR}/PHY/TOOLS/lut.c
${PHY_POLARSRC}
${PHY_SMALLBLOCKSRC}
@@ -1682,7 +1658,6 @@ set(PHY_SRC_UE
${OPENAIR1_DIR}/PHY/TOOLS/signal_energy.c
${OPENAIR1_DIR}/PHY/TOOLS/dB_routines.c
${OPENAIR1_DIR}/PHY/TOOLS/sqrt.c
- ${OPENAIR1_DIR}/PHY/TOOLS/time_meas.c
${OPENAIR1_DIR}/PHY/TOOLS/lut.c
${OPENAIR1_DIR}/PHY/INIT/nr_init_ue.c
# ${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/pucch_uci_test.c
@@ -1835,7 +1810,6 @@ set(L2_SRC
${PDCP_DIR}/pdcp_primitives.c
${PDCP_DIR}/pdcp_util.c
${PDCP_DIR}/pdcp_security.c
- ${PDCP_DIR}/pdcp_netlink.c
${OPENAIR2_DIR}/LAYER2/openair2_proc.c
# ${RRC_DIR}/rrc_UE.c
${RRC_DIR}/rrc_eNB.c
@@ -1890,7 +1864,6 @@ set(L2_SRC_UE
${PDCP_DIR}/pdcp_primitives.c
${PDCP_DIR}/pdcp_util.c
${PDCP_DIR}/pdcp_security.c
- ${PDCP_DIR}/pdcp_netlink.c
${RRC_DIR}/rrc_UE.c
${RRC_DIR}/rrc_common.c
${RRC_DIR}/L2_interface_common.c
@@ -1910,6 +1883,7 @@ set(NR_L2_SRC_UE
${NR_SDAP_SRC}
${NR_UE_RRC_DIR}/L2_interface_ue.c
${NR_UE_RRC_DIR}/main_ue.c
+ ${NR_RRC_DIR}/nr_rrc_config.c
${NR_UE_RRC_DIR}/rrc_UE.c
${NR_UE_RRC_DIR}/rrc_nsa.c
)
@@ -2430,43 +2404,6 @@ add_library(LIB_5GNAS_GNB
)
target_link_libraries(LIB_5GNAS_GNB SECU_CN ${CRYPTO_LIBRARIES})
-# Make lfds as a own source code (even if it is a outside library)
-# For better intergration with compilation flags & structure of cmake
-###################################################################
-set(lfds ${OPENAIR2_DIR}/UTIL/LFDS/liblfds6.1.1/liblfds611/src/)
-file(GLOB lfds_queue ${lfds}/lfds611_queue/*.c)
-file(GLOB lfds_ring ${lfds}/lfds611_ringbuffer/*.c)
-file(GLOB lfds_slist ${lfds}/lfds611_slist/*.c)
-file(GLOB lfds_stack ${lfds}/lfds611_stack/*.c)
-file(GLOB lfds_freelist ${lfds}/lfds611_freelist/*.c)
-
-include_directories(${lfds})
-add_library(LFDS
- ${lfds_queue} ${lfds_ring} ${lfds_slist} ${lfds_stack} ${lfds_freelist}
- ${lfds}/lfds611_liblfds/lfds611_liblfds_abstraction_test_helpers.c
- ${lfds}/lfds611_liblfds/lfds611_liblfds_aligned_free.c
- ${lfds}/lfds611_liblfds/lfds611_liblfds_aligned_malloc.c
- ${lfds}/lfds611_abstraction/lfds611_abstraction_free.c
- ${lfds}/lfds611_abstraction/lfds611_abstraction_malloc.c
-)
-
-set(lfds7 ${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/src/)
-file(GLOB lfds7_queue ${lfds7}/lfds700_queue/*.c)
-file(GLOB lfds7_ring ${lfds7}/lfds700_ringbuffer/*.c)
-file(GLOB lfds7_qbss ${lfds7}/lfds700_queue_bounded_singleconsumer_singleproducer/*.c)
-file(GLOB lfds7_stack ${lfds7}/lfds700_stack/*.c)
-file(GLOB lfds7_freelist ${lfds7}/lfds700_freelist/*.c)
-file(GLOB lfds7_btree ${lfds7}/lfds700_btree_addonly_unbalanced/*.c)
-file(GLOB lfds7_hash ${lfds7}/lfds700_hash_addonly/*.c)
-file(GLOB lfds7_ordered_list ${lfds7}/lfds700_list_addonly_ordered_singlylinked/*.c)
-file(GLOB lfds7_unordered_list ${lfds7}/lfds700_list_addonly_singlylinked_unordered/*.c)
-file(GLOB lfds7_misc ${lfds7}/lfds700_misc/*.c)
-
-include_directories(${lfds7})
-add_library(LFDS7
- ${lfds7_queue} ${lfds7_ring} ${lfds7_qbss} ${lfds7_stack} ${lfds7_freelist} ${lfds7_btree} ${lfds7_hash} ${lfds7_ordered_list} ${lfds7_unordered_list} ${lfds7_misc}
-)
-
add_library(SIMU_COMMON
${OPENAIR1_DIR}/SIMULATION/TOOLS/random_channel.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/rangen_double.c
@@ -2601,7 +2538,7 @@ add_library(minimal_lib
${OPENAIR_DIR}/common/utils/minimal_stub.c
${T_SOURCE}
)
-target_link_libraries(minimal_lib pthread dl ${T_LIB} ${CONFIG_LIB})
+target_link_libraries(minimal_lib pthread dl ${T_LIB} CONFIG_LIB)
add_executable(nfapi_test
${OPENAIR_DIR}/openair2/NR_PHY_INTERFACE/nfapi_5g_test.c
@@ -2630,7 +2567,6 @@ add_executable(lte-softmodem
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/ru_control.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c
- ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
${OPENAIR_DIR}/executables/softmodem-common.c
${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
@@ -2645,14 +2581,11 @@ add_executable(lte-softmodem
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
- ${OPENAIR_DIR}/common/utils/utils.c
- ${OPENAIR_DIR}/common/utils/system.c
${PHY_INTERFACE_DIR}/queue_t.c
${OPENAIR_DIR}/common/utils/lte/ue_power.c
${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${XFORMSINTERFACE_SOURCE}
${T_SOURCE}
- ${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag oai_iqplayer)
@@ -2660,19 +2593,18 @@ add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag oai_iqplayer)
target_link_libraries (lte-softmodem
-Wl,--start-group
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U F1AP_LIB F1AP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB
- PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB LFDS7
- ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB}
+ PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
+ ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB}
-Wl,--end-group z dl)
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
-target_link_libraries (lte-softmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
+target_link_libraries (lte-softmodem pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-softmodem ${T_LIB})
add_executable(ocp-enb
${OPENAIR_DIR}/executables/main-ocp.c
- ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
${OPENAIR_DIR}/executables/softmodem-common.c
${OPENAIR_DIR}/executables/main-fs6.c
${OPENAIR_DIR}/executables/transport_split.c
@@ -2688,14 +2620,11 @@ add_executable(ocp-enb
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
- ${OPENAIR_DIR}/common/utils/utils.c
- ${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/lte/ue_power.c
${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${PHY_INTERFACE_DIR}/queue_t.c
${XFORMSINTERFACE_SOURCE}
${T_SOURCE}
- ${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
add_dependencies(ocp-enb rrc_flag s1ap_flag x2_flag oai_iqplayer coding params_libconfig rfsimulator)
@@ -2704,10 +2633,10 @@ target_link_libraries (ocp-enb
-Wl,--start-group
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB
- PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON
- ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB}
+ PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB SIMU_COMMON
+ ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB}
-Wl,--end-group z dl)
-target_link_libraries (ocp-enb ${LIBXML2_LIBRARIES} pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${LIB_LMS_LIBRARIES} ${T_LIB})
+target_link_libraries (ocp-enb ${LIBXML2_LIBRARIES} pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${LIB_LMS_LIBRARIES} ${T_LIB})
add_executable(oairu
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
@@ -2716,23 +2645,18 @@ add_executable(oairu
${OPENAIR_TARGETS}/ARCH/COMMON/record_player.c
${OPENAIR_DIR}/executables/softmodem-common.c
${OPENAIR_DIR}/openair1/SCHED/phy_procedures_lte_common.c
- ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
${OPENAIR_DIR}/executables/main_ru.c
${T_SOURCE}
- ${OPENAIR_DIR}/common/utils/LOG/log.c
- ${CONFIG_SOURCES}
- ${OPENAIR_DIR}/common/utils/utils.c
- ${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${SHLIB_LOADER_SOURCES}
)
target_link_libraries (oairu
-Wl,--start-group
SCHED_RU_LIB
- PHY_COMMON PHY_RU
+ PHY_COMMON PHY_RU UTIL
-Wl,--end-group z dl)
-target_link_libraries (oairu pthread m ${CONFIG_LIB} rt ${CMAKE_DL_LIBS} ${T_LIB})
+target_link_libraries (oairu pthread m CONFIG_LIB rt ${CMAKE_DL_LIBS} ${T_LIB})
# lte-uesoftmodem is UE implementation
@@ -2751,13 +2675,10 @@ add_executable(lte-uesoftmodem
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
- ${OPENAIR_DIR}/common/utils/utils.c
- ${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/lte/ue_power.c
${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${XFORMSINTERFACE_SOURCE}
${T_SOURCE}
- ${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
@@ -2770,12 +2691,12 @@ target_link_libraries (lte-uesoftmodem
-Wl,--start-group
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB
SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON
- PHY_UE PHY_RU LFDS L2_UE L2_LTE LFDS7 SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
- ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES}
+ PHY_UE PHY_RU L2_UE L2_LTE SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
+ ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ATLAS_LIBRARIES}
-Wl,--end-group z dl)
target_link_libraries (lte-uesoftmodem ${LIBXML2_LIBRARIES})
-target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
+target_link_libraries (lte-uesoftmodem pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (lte-uesoftmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-uesoftmodem ${T_LIB})
@@ -2788,7 +2709,6 @@ add_executable(nr-softmodem
${s1ap_h}
# ${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_DIR}/executables/nr-gnb.c
- ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
${OPENAIR_DIR}/executables/nr-ru.c
${OPENAIR_DIR}/executables/nr-softmodem.c
${OPENAIR_DIR}/executables/softmodem-common.c
@@ -2798,74 +2718,31 @@ add_executable(nr-softmodem
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
- ${OPENAIR_DIR}/common/utils/utils.c
- ${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/lte/ue_power.c
${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
${PHY_INTERFACE_DIR}/queue_t.c
${XFORMSINTERFACE_SOURCE}
${T_SOURCE}
- ${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
${OPENAIR2_DIR}/ENB_APP/flexran_agent_ran_api_to_fix.c
)
target_link_libraries (nr-softmodem
-Wl,--start-group
- UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
- ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
+ UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECU_CN SECU_OSA
+ ITTI ${FLPT_MSG_LIB} ${FLEXRAN_AGENT_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${FSPT_MSG_LIB}
-Wl,--end-group z dl)
target_link_libraries (nr-softmodem ${LIBXML2_LIBRARIES})
-target_link_libraries (nr-softmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
+target_link_libraries (nr-softmodem pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (nr-softmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (nr-softmodem ${T_LIB})
add_dependencies( nr-softmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc )
-add_executable(ocp-gnb
- ${rrc_h}
- ${nr_rrc_h}
- ${s1ap_h}
-# ${OPENAIR_BIN_DIR}/messages_xml.h
- ${OPENAIR_DIR}/executables/ocp-gnb.c
- ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
- ${OPENAIR_DIR}/executables/softmodem-common.c
- ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
- ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
- ${OPENAIR_TARGETS}/ARCH/COMMON/record_player.c
- ${OPENAIR2_DIR}/RRC/NAS/nas_config.c
- ${OPENAIR2_DIR}/RRC/NAS/rb_config.c
- ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
- ${OPENAIR_DIR}/common/utils/nr/nr_common.c
- ${OPENAIR_DIR}/common/utils/utils.c
- ${OPENAIR_DIR}/common/utils/system.c
- ${PHY_INTERFACE_DIR}/queue_t.c
- ${XFORMS_SOURCE_NR}
- ${T_SOURCE}
- ${CONFIG_SOURCES}
- ${SHLIB_LOADER_SOURCES}
- ${XFORMSINTERFACE_SOURCE}
- )
-
-target_link_libraries (ocp-gnb
- -Wl,--start-group
- UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
- ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
- NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
- X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB SIMU_COMMON
- -Wl,--end-group z dl)
-
-target_link_libraries (ocp-gnb ${LIBXML2_LIBRARIES} )
-target_link_libraries (ocp-gnb pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
-target_link_libraries (ocp-gnb ${LIB_LMS_LIBRARIES})
-target_link_libraries (ocp-gnb ${T_LIB})
-add_dependencies(ocp-gnb ldpc_orig ldpc_optim ldpc_optim8seg ldpc params_libconfig rfsimulator oai_usrpdevif rfsimulator nrscope)
-
-
# nr-uesoftmodem is UE implementation
#######################################
@@ -2873,7 +2750,6 @@ add_executable(nr-uesoftmodem
${rrc_h}
${s1ap_h}
# ${OPENAIR_BIN_DIR}/messages_xml.h
- ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
${OPENAIR_DIR}/executables/nr-uesoftmodem.c
${OPENAIR_DIR}/executables/nr-ue.c
${OPENAIR_DIR}/executables/softmodem-common.c
@@ -2885,28 +2761,24 @@ add_executable(nr-uesoftmodem
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
- ${OPENAIR_DIR}/common/utils/utils.c
- ${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
${XFORMSINTERFACE_SOURCE}
${T_SOURCE}
- ${UTIL_SRC}
- ${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
target_link_libraries (nr-uesoftmodem
-Wl,--start-group
RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB
- PHY_COMMON PHY_NR_COMMON PHY_UE PHY_NR_UE PHY_RU LFDS NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB
+ PHY_COMMON PHY_NR_COMMON PHY_UE PHY_NR_UE PHY_RU NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB
NFAPI_USER_LIB MISC_NFAPI_NR_LIB S1AP_LIB S1AP_ENB
- ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
+ ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ATLAS_LIBRARIES}
NFAPI_USER_LIB S1AP_LIB S1AP_ENB
- ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB}
+ ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB}
-Wl,--end-group z dl)
target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES})
-target_link_libraries (nr-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
+target_link_libraries (nr-uesoftmodem pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (nr-uesoftmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (nr-uesoftmodem ${T_LIB})
@@ -2914,7 +2786,6 @@ add_dependencies( nr-uesoftmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc )
if (CUDA_FOUND)
add_dependencies( nr-uesoftmodem ldpc_cuda)
add_dependencies( nr-softmodem ldpc_cuda)
- add_dependencies( ocp-gnb ldpc_cuda)
endif (CUDA_FOUND)
###################################"
# Addexecutables for tests
@@ -2928,30 +2799,25 @@ endif (CUDA_FOUND)
add_executable(dlsim_tm4
${OPENAIR1_DIR}/SIMULATION/LTE_PHY/dlsim_tm4.c
${OPENAIR1_DIR}/PHY/TOOLS/lte_phy_scope_tm4.c
- ${OPENAIR_DIR}/common/utils/system.c
${T_SOURCE}
)
target_link_libraries (dlsim_tm4
- -Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB PHY LFDS ITTI -Wl,--end-group
- pthread m rt ${CONFIG_LIB} ${ATLAS_LIBRARIES} ${T_LIB}
+ -Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB PHY ITTI -Wl,--end-group
+ pthread m rt CONFIG_LIB ${ATLAS_LIBRARIES} ${T_LIB}
)
add_executable(rftest
${OPENAIR_DIR}/openair1/PHY/TOOLS/calibration_test.c
${OPENAIR_DIR}/openair1/PHY/TOOLS/calibration_scope.c
- ${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR_DIR}/executables/softmodem-common.c
- ${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
-target_link_libraries(rftest minimal_lib PHY_NR_COMMON pthread dl m forms ${T_LIB} )
+target_link_libraries(rftest minimal_lib CONFIG_LIB PHY_NR_COMMON UTIL pthread dl m forms ${T_LIB} )
add_executable(polartest
${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/polartest.c
- ${OPENAIR_DIR}/common/utils/backtrace.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
- ${OPENAIR_DIR}/common/utils/system.c
${T_SOURCE}
${SHLIB_LOADER_SOURCES}
)
@@ -2962,9 +2828,7 @@ target_link_libraries(polartest
add_executable(smallblocktest
${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/smallblocktest.c
- ${OPENAIR_DIR}/common/utils/backtrace.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
- ${OPENAIR_DIR}/common/utils/system.c
${T_SOURCE}
${SHLIB_LOADER_SOURCES}
)
@@ -2994,11 +2858,7 @@ target_link_libraries(ldpctest
add_executable(nr_dlschsim
${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlschsim.c
- ${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
- ${OPENAIR_DIR}/common/utils/utils.c
- ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
- ${UTIL_SRC}
${T_SOURCE}
${SHLIB_LOADER_SOURCES}
)
@@ -3009,11 +2869,7 @@ target_link_libraries(nr_dlschsim
add_executable(nr_pbchsim
${OPENAIR1_DIR}/SIMULATION/NR_PHY/pbchsim.c
- ${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
- ${OPENAIR_DIR}/common/utils/utils.c
- ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
- ${UTIL_SRC}
${T_SOURCE}
${SHLIB_LOADER_SOURCES}
)
@@ -3025,12 +2881,7 @@ target_link_libraries(nr_pbchsim
#PUCCH ---> Prashanth
add_executable(nr_pucchsim
${OPENAIR1_DIR}/SIMULATION/NR_PHY/pucchsim.c
- ${OPENAIR_DIR}/common/utils/backtrace.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
- ${OPENAIR_DIR}/common/utils/system.c
- ${OPENAIR_DIR}/common/utils/utils.c
- ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
- ${UTIL_SRC}
${T_SOURCE}
${SHLIB_LOADER_SOURCES}
)
@@ -3041,17 +2892,13 @@ target_link_libraries(nr_pucchsim
add_executable(nr_dlsim
${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlsim.c
- ${OPENAIR_DIR}/common/utils/utils.c
- ${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
${OPENAIR_DIR}/executables/softmodem-common.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${NR_UE_RRC_DIR}/rrc_nsa.c
${NFAPI_USER_DIR}/nfapi.c
- ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
${PHY_INTERFACE_DIR}/queue_t.c
- ${UTIL_SRC}
${T_SOURCE}
${SHLIB_LOADER_SOURCES}
)
@@ -3063,17 +2910,13 @@ target_compile_definitions(nr_dlsim PUBLIC -DPHYSICAL_SIMULATOR)
add_executable(nr_prachsim
${OPENAIR1_DIR}/SIMULATION/NR_PHY/prachsim.c
- ${OPENAIR_DIR}/common/utils/utils.c
- ${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
${OPENAIR1_DIR}/SCHED_NR/phy_procedures_nr_common.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${NR_UE_RRC_DIR}/rrc_nsa.c
${NFAPI_USER_DIR}/nfapi.c
- ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
${PHY_INTERFACE_DIR}/queue_t.c
- ${UTIL_SRC}
${T_SOURCE}
${SHLIB_LOADER_SOURCES})
target_link_libraries(nr_prachsim
@@ -3082,12 +2925,8 @@ target_link_libraries(nr_prachsim
add_executable(nr_ulschsim
${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulschsim.c
- ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
- ${OPENAIR_DIR}/common/utils/utils.c
- ${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
${PHY_INTERFACE_DIR}/queue_t.c
- ${UTIL_SRC}
${T_SOURCE}
${SHLIB_LOADER_SOURCES}
)
@@ -3098,9 +2937,6 @@ target_link_libraries(nr_ulschsim
add_executable(nr_ulsim
${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulsim.c
- ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
- ${OPENAIR_DIR}/common/utils/utils.c
- ${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
${OPENAIR_DIR}/executables/softmodem-common.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
@@ -3108,7 +2944,6 @@ add_executable(nr_ulsim
${NR_UE_RRC_DIR}/rrc_nsa.c
${NFAPI_USER_DIR}/nfapi.c
${PHY_INTERFACE_DIR}/queue_t.c
- ${UTIL_SRC}
${T_SOURCE}
${SHLIB_LOADER_SOURCES}
)
@@ -3122,58 +2957,21 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr
add_executable(${myExe}
${OPENAIR1_DIR}/SIMULATION/LTE_PHY/${myExe}.c
- ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
- ${OPENAIR_DIR}/common/utils/backtrace.c
- ${OPENAIR_DIR}/common/utils/system.c
- ${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/lte/ue_power.c
${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c
${XFORMS_SOURCE}
${T_SOURCE}
- ${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
${NFAPI_USER_DIR}/nfapi.c
)
target_link_libraries (${myExe}
- -Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_NR_COMMON PHY PHY_UE PHY_RU LFDS ITTI LFDS7 -Wl,--end-group
- pthread m rt ${CONFIG_LIB} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl
+ -Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_NR_COMMON PHY PHY_UE PHY_RU ITTI -Wl,--end-group
+ pthread m rt CONFIG_LIB ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl
)
endforeach(myExe)
-add_executable(test_epc_generate_scenario
- ${OPENAIR3_DIR}/TEST/EPC_TEST/generate_scenario.c
- ${OPENAIR3_DIR}/TEST/EPC_TEST/generate_scenario.h
- ${OPENAIR2_DIR}/ENB_APP/enb_config.h
- ${OPENAIR2_DIR}/COMMON/commonDef.h
- ${OPENAIR2_DIR}/COMMON/messages_def.h
- ${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h
- )
-target_link_libraries (test_epc_generate_scenario
- -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB PHY LFDS ITTI L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
- )
-
-add_executable(test_epc_play_scenario
- ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.c
- ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_decode.c
- ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_display.c
- ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_fsm.c
- ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_parse.c
- ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap.c
- ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c
- ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h
- ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_sctp.c
- ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.h
- ${OPENAIR2_DIR}/COMMON/commonDef.h
- ${OPENAIR2_DIR}/COMMON/messages_def.h
- )
-target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c)
-target_link_libraries (test_epc_play_scenario
- -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
- )
-
-
#unitary tests for Core NEtwork pieces
#################################
foreach(myExe s1ap
@@ -3190,7 +2988,7 @@ foreach(myExe s1ap
${OPENAIR3_DIR}/TEST/test_${myExe}.c
)
target_link_libraries (test_${myExe}
- -Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
+ -Wl,--start-group SECU_CN UTIL -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} CONFIG_LIB
)
endforeach(myExe)
@@ -3211,12 +3009,12 @@ if (${T_TRACER})
ITTI RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP
params_libconfig oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer
oai_eth_transpro oai_mobipass tcp_bridge tcp_bridge_oai
- coding FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE UTIL OMG_SUMO
+ coding FLPT_MSG FLEXRAN_AGENT HASHTABLE UTIL OMG_SUMO
SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_NR MAC_UE_NR NGAP_GNB
- CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
+ CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
ldpc_orig ldpc_optim ldpc_optim8seg ldpc dfts)
if (TARGET ${i})
add_dependencies(${i} generate_T)
@@ -3309,30 +3107,26 @@ add_executable(nr-ittisim
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
- ${OPENAIR_DIR}/common/utils/utils.c
- ${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
- ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
${OPENAIR_DIR}/common/utils/lte/ue_power.c
${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_ran_api_to_fix.c
${XFORMSINTERFACE_SOURCE}
${T_SOURCE}
- ${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
target_link_libraries (nr-ittisim
-Wl,--start-group
- UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
- ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB
+ UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECU_CN SECU_OSA
+ ITTI ${FLPT_MSG_LIB} ${FLEXRAN_AGENT_LIB} ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB
NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${FSPT_MSG_LIB}
PHY_NR_UE SCHED_NR_UE_LIB NR_L2_UE
-Wl,--end-group z dl)
target_link_libraries (nr-ittisim ${LIBXML2_LIBRARIES})
-target_link_libraries (nr-ittisim pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
+target_link_libraries (nr-ittisim pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (nr-ittisim ${LIB_LMS_LIBRARIES})
target_link_libraries (nr-ittisim ${T_LIB})
diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml
index 6450b64298..ce1b9dcdf4 100755
--- a/cmake_targets/autotests/test_case_list.xml
+++ b/cmake_targets/autotests/test_case_list.xml
@@ -1093,17 +1093,18 @@
(Test8: 217 PRB 100 PDSCH-PRBs 110 PDSCH-Offset),
(Test9: 106 PRBs 50 PDSCH-PRBs MCS Index 27),
(Test10: 106 PRBs 50 PDSCH-PRBs MCS Index 16),
- (Test11: HARQ test 25% TP (4 rounds),
- (Test12: HARQ test 33% TP (3 rounds),
- (Test13: HARQ test 50% TP (2 rounds),
- (Test14: 3 PTRS, 8 Interpolated Symbols),
- (Test15: 6 PTRS, 5 Interpolated Symbols),
- (Test16: 11 PTRS, 0 Interpolated Symbols),
- (Test17: Mapping type A, 2 DMRS Symbols),
- (Test18: Mapping type A, 3 DMRS Symbols),
- (Test19: Mapping type B, 4 DMRS Symbols),
- (Test20: 4x4 MIMO, 1 Layer),
- (Test21: 4x4 MIMO, 2 Layers)
+ (Test11: 106 MCS-TABLE 256 QAM MCS Index 27),
+ (Test12: HARQ test 25% TP 4 rounds),
+ (Test13: HARQ test 33% TP 3 rounds),
+ (Test14: HARQ test 50% TP 2 rounds),
+ (Test15: 3 PTRS, 8 Interpolated Symbols),
+ (Test16: 6 PTRS, 5 Interpolated Symbols),
+ (Test17: 11 PTRS, 0 Interpolated Symbols),
+ (Test18: Mapping type A, 2 DMRS Symbols),
+ (Test19: Mapping type A, 3 DMRS Symbols),
+ (Test20: Mapping type B, 4 DMRS Symbols),
+ (Test21: 4x4 MIMO, 1 Layer),
+ (Test22: 4x4 MIMO, 2 Layers)
$OPENAIR_DIR/cmake_targets/build_oai
--phy_simulators -c
@@ -1118,8 +1119,9 @@
-n100 -R217 -b100 -s5
-n100 -R217 -a80 -s5
-n100 -R217 -a110 -s5 -b100
- -n100 -e27 -s30
- -n100 -e16 -s10
+ -n100 -e27 -s30
+ -n100 -e16 -s10
+ -n100 -q1 -e27 -s30
-n100 -s1 -t25
-n100 -s1 -t33
-n100 -s1 -t50
@@ -1131,7 +1133,7 @@
-n100 -s2 -U 2 1 3
-n10 -s20 -U 3 0 0 2 -gR -x1 -y4 -z4
-n10 -s20 -U 3 0 0 2 -gR -x2 -y4 -z4
- nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10 nr_dlsim.test11 nr_dlsim.test12 nr_dlsim.test13 nr_dlsim.test14 nr_dlsim.test15 nr_dlsim.test16 nr_dlsim.test17 nr_dlsim.test18 nr_dlsim.test19 nr_dlsim.test20 nr_dlsim.test21
+ nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10 nr_dlsim.test11 nr_dlsim.test12 nr_dlsim.test13 nr_dlsim.test14 nr_dlsim.test15 nr_dlsim.test16 nr_dlsim.test17 nr_dlsim.test18 nr_dlsim.test19 nr_dlsim.test20 nr_dlsim.test21 nr_dlsim.test22
PDSCH test OK
segmentation fault|assertion|exiting|fatal
3
diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h
index d73fc03ed9..1fbf42f62d 100644
--- a/common/utils/LOG/log.h
+++ b/common/utils/LOG/log.h
@@ -346,7 +346,7 @@ typedef struct {
@param format data format (0 = real 16-bit, 1 = complex 16-bit,2 real 32-bit, 3 complex 32-bit,4 = real 8-bit, 5 = complex 8-bit)
@param multiVec create new file or append to existing (useful for writing multiple vectors to same file. Just call the function multiple times with same file name and with this parameter set to 1)
*/
-#define MATLAB_RAW (1<<31)
+#define MATLAB_RAW (1U<<31)
#define MATLAB_SHORT 0
#define MATLAB_CSHORT 1
#define MATLAB_INT 2
@@ -473,130 +473,6 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
/* @}*/
-static __inline__ uint64_t rdtsc(void) {
- uint32_t a, d;
- __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
- return (((uint64_t)d)<<32) | ((uint64_t)a);
-}
-
-#define DEBUG_REALTIME 1
-#if DEBUG_REALTIME
-
-extern double cpuf;
-
-static inline uint64_t checkTCPU(int timeout,
- char *file,
- int line)
-{
- static uint64_t __thread lastCPUTime=0;
- static uint64_t __thread last=0;
- uint64_t cur=rdtsc();
- struct timespec CPUt;
- clock_gettime(CLOCK_THREAD_CPUTIME_ID, &CPUt);
- uint64_t CPUTime=CPUt.tv_sec*1000*1000+CPUt.tv_nsec/1000;
- double microCycles=(double)(cpuf*1000);
- int duration=(int)((cur-last)/microCycles);
-
- if ( last!=0 && duration > timeout ) {
- //struct timespec ts;
- //clock_gettime(CLOCK_MONOTONIC, &ts);
- printf("%s:%d lte-ue delay %d (exceed %d), CPU for this period: %lld\n", file, line,
- duration, timeout, (long long)CPUTime-lastCPUTime );
- }
-
- last=cur;
- lastCPUTime=CPUTime;
- return cur;
-}
-
-static inline unsigned long long checkT(int timeout,
- char *file,
- int line)
-{
- static unsigned long long __thread last=0;
- unsigned long long cur=rdtsc();
- int microCycles=(int)(cpuf*1000);
- int duration=(int)((cur-last)/microCycles);
-
- if ( last!=0 && duration > timeout )
- printf("%s:%d lte-ue delay %d (exceed %d)\n", file, line,
- duration, timeout);
-
- last=cur;
- return cur;
-}
-
-typedef struct m {
- uint64_t iterations;
- uint64_t sum;
- uint64_t maxArray[11];
-} Meas;
-
-static inline void printMeas(char *txt,
- Meas *M,
- int period)
-{
- if (M->iterations%period == 0 ) {
- char txt2[512];
- sprintf(txt2,"%s avg=%" PRIu64 " iterations=%" PRIu64 " max=%"
- PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 "\n",
- txt,
- M->sum/M->iterations,
- M->iterations,
- M->maxArray[1],M->maxArray[2], M->maxArray[3],M->maxArray[4], M->maxArray[5],
- M->maxArray[6],M->maxArray[7], M->maxArray[8],M->maxArray[9],M->maxArray[10]);
-#if T_TRACER
- LOG_W(PHY,"%s",txt2);
-#else
- printf("%s",txt2);
-#endif
- }
-}
-
-static inline int cmpint(const void *a,
- const void *b)
-{
- uint64_t *aa=(uint64_t *)a;
- uint64_t *bb=(uint64_t *)b;
- return (int)(*aa-*bb);
-}
-
-static inline void updateTimes(uint64_t start,
- Meas *M,
- int period,
- char *txt)
-{
- if (start!=0) {
- uint64_t end=rdtsc();
- long long diff=(end-start)/(cpuf*1000);
- M->maxArray[0]=diff;
- M->sum+=diff;
- M->iterations++;
- qsort(M->maxArray, 11, sizeof(uint64_t), cmpint);
- printMeas(txt,M,period);
- }
-}
-
-#define check(a) do { checkT(a,__FILE__,__LINE__); } while (0)
-#define checkcpu(a) do { checkTCPU(a,__FILE__,__LINE__); } while (0)
-#define initRefTimes(a) static __thread Meas a= {0}
-#define pickTime(a) uint64_t a=rdtsc()
-#define readTime(a) a
-#define initStaticTime(a) static __thread uint64_t a={0}
-#define pickStaticTime(a) do { a=rdtsc(); } while (0)
-
-#else
-#define check(a) do {} while (0)
-#define checkcpu(a) do {} while (0)
-#define initRefTimes(a) do {} while (0)
-#define initStaticTime(a) do {} while (0)
-#define pickTime(a) do {} while (0)
-#define readTime(a) 0
-#define pickStaticTime(a) do {} while (0)
-#define updateTimes(a,b,c,d) do {} while (0)
-#define printMeas(a,b,c) do {} while (0)
-#endif
-
#ifdef __cplusplus
}
#endif
diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c
index b0a6266d34..49743b3bdc 100644
--- a/common/utils/nr/nr_common.c
+++ b/common/utils/nr/nr_common.c
@@ -36,6 +36,27 @@
const char *duplex_mode[]={"FDD","TDD"};
+int tables_5_3_2[5][11] = {
+ {25, 52, 79, 106, 133, 160, 216, 270, -1, -1, -1}, // 15 FR1
+ {11, 24, 38, 51, 65, 78, 106, 133, 162, 217, 273}, // 30 FR1
+ {-1, 11, 18, 24, 31, 38, 51, 65, 79, 107, 135}, // 60 FR1
+ {66, 132, 264, -1 , -1, -1, -1, -1, -1, -1, -1}, // 60 FR2
+ {32, 66, 132, 264, -1, -1, -1, -1, -1, -1, -1} // 120FR2
+};
+
+int get_supported_band_index(int scs, int band, int n_rbs){
+
+ int scs_index = scs;
+ if (band>256)
+ scs_index++;
+ for (int i=0; i<11; i++) {
+ if(n_rbs == tables_5_3_2[scs][i])
+ return i;
+ }
+ return (-1); // not found
+}
+
+
// Table 5.2-1 NR operating bands in FR1 & FR2 (3GPP TS 38.101)
// Table 5.4.2.3-1 Applicable NR-ARFCN per operating band in FR1 & FR2 (3GPP TS 38.101)
// Notes:
@@ -500,7 +521,6 @@ int get_subband_size(int NPRB,int size) {
}
-
// from start symbol index and nb or symbols to symbol occupation bitmap in a slot
uint16_t SL_to_bitmap(int startSymbolIndex, int nrOfSymbols) {
return ((1<incomingFifo, myThread);
- if (tp->measurePerf) elt->startProcessingTime=rdtsc();
+ if (tp->measurePerf) elt->startProcessingTime=rdtsc_oai();
elt->processingFunc(NotifiedFifoData(elt));
- if (tp->measurePerf) elt->endProcessingTime=rdtsc();
+ if (tp->measurePerf) elt->endProcessingTime=rdtsc_oai();
if (elt->reponseFifo) {
// Check if the job is still alive, else it has been aborted
@@ -97,7 +97,7 @@ void initNamedTpool(char *params,tpool_t *pool, bool performanceMeas, char *name
char *measr=getenv("threadPoolMeasurements");
pool->measurePerf=performanceMeas;
// force measurement if the output is defined
- pool->measurePerf=measr!=NULL;
+ pool->measurePerf |= measr!=NULL;
if (measr) {
mkfifo(measr,0666);
diff --git a/common/utils/threadPool/thread-pool.h b/common/utils/threadPool/thread-pool.h
index a8f8572cfe..d06f2195ee 100644
--- a/common/utils/threadPool/thread-pool.h
+++ b/common/utils/threadPool/thread-pool.h
@@ -27,11 +27,11 @@
#include
#include
#include
+#include
#include
-#include
-#include
-#include
-//#include
+#include "assertions.h"
+#include "common/utils/time_meas.h"
+#include "common/utils/system.h"
#ifdef DEBUG
#define THREADINIT PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
@@ -60,10 +60,10 @@ typedef struct notifiedFIFO_elt_s {
struct notifiedFIFO_s *reponseFifo;
void (*processingFunc)(void *);
bool malloced;
- uint64_t creationTime;
- uint64_t startProcessingTime;
- uint64_t endProcessingTime;
- uint64_t returnTime;
+ oai_cputime_t creationTime;
+ oai_cputime_t startProcessingTime;
+ oai_cputime_t endProcessingTime;
+ oai_cputime_t returnTime;
void *msgData;
} notifiedFIFO_elt_t;
@@ -97,12 +97,11 @@ static inline void *NotifiedFifoData(notifiedFIFO_elt_t *elt) {
static inline void delNotifiedFIFO_elt(notifiedFIFO_elt_t *elt) {
if (elt->malloced) {
- elt->malloced=false;
+ elt->malloced = false;
free(elt);
- } else
- printf("delNotifiedFIFO on something not allocated by newNotifiedFIFO\n");
-
- //LOG_W(UTIL,"delNotifiedFIFO on something not allocated by newNotifiedFIFO\n");
+ }
+ /* it is allowed to call delNotifiedFIFO_elt when the memory is managed by
+ * the caller */
}
static inline void initNotifiedFIFO_nothreadSafe(notifiedFIFO_t *nf) {
@@ -141,8 +140,7 @@ static inline notifiedFIFO_elt_t *pullNotifiedFIFO_nothreadSafe(notifiedFIFO_t
notifiedFIFO_elt_t *ret=nf->outF;
- if (nf->outF==nf->outF->next)
- LOG_E(UTIL,"Circular list in thread pool: push several times the same buffer is forbidden\n");
+ AssertFatal(nf->outF != nf->outF->next,"Circular list in thread pool: push several times the same buffer is forbidden\n");
nf->outF=nf->outF->next;
@@ -174,6 +172,20 @@ static inline notifiedFIFO_elt_t *pollNotifiedFIFO(notifiedFIFO_t *nf) {
return ret;
}
+static inline time_stats_t exec_time_stats_NotifiedFIFO(const notifiedFIFO_elt_t* elt)
+{
+ time_stats_t ts = {0};
+ if (elt->startProcessingTime == 0 && elt->endProcessingTime == 0)
+ return ts; /* no measurements done */
+ ts.in = elt->startProcessingTime;
+ ts.diff = elt->endProcessingTime - ts.in;
+ ts.p_time = ts.diff;
+ ts.diff_square = ts.diff * ts.diff;
+ ts.max = ts.diff;
+ ts.trials = 1;
+ return ts;
+}
+
// This function aborts all messages matching the key
// If the queue is used in thread pools, it doesn't cancels already running processing
// because the message has already been picked
@@ -224,18 +236,18 @@ typedef struct thread_pool {
} tpool_t;
static inline void pushTpool(tpool_t *t, notifiedFIFO_elt_t *msg) {
- if (t->measurePerf) msg->creationTime=rdtsc();
+ if (t->measurePerf) msg->creationTime=rdtsc_oai();
if ( t->activated)
pushNotifiedFIFO(&t->incomingFifo, msg);
else {
if (t->measurePerf)
- msg->startProcessingTime=rdtsc();
+ msg->startProcessingTime=rdtsc_oai();
msg->processingFunc(NotifiedFifoData(msg));
if (t->measurePerf)
- msg->endProcessingTime=rdtsc();
+ msg->endProcessingTime=rdtsc_oai();
if (msg->reponseFifo)
pushNotifiedFIFO(msg->reponseFifo, msg);
@@ -246,7 +258,7 @@ static inline notifiedFIFO_elt_t *pullTpool(notifiedFIFO_t *responseFifo, tpool_
notifiedFIFO_elt_t *msg= pullNotifiedFIFO(responseFifo);
AssertFatal(t->traceFd, "Thread pool used while not initialized");
if (t->measurePerf)
- msg->returnTime=rdtsc();
+ msg->returnTime=rdtsc_oai();
if (t->traceFd > 0)
if(write(t->traceFd, msg, sizeof(*msg)));
@@ -261,7 +273,7 @@ static inline notifiedFIFO_elt_t *tryPullTpool(notifiedFIFO_t *responseFifo, tpo
return NULL;
if (t->measurePerf)
- msg->returnTime=rdtsc();
+ msg->returnTime=rdtsc_oai();
if (t->traceFd)
if(write(t->traceFd, msg, sizeof(*msg)));
diff --git a/openair1/PHY/TOOLS/time_meas.c b/common/utils/time_meas.c
similarity index 97%
rename from openair1/PHY/TOOLS/time_meas.c
rename to common/utils/time_meas.c
index 353f170434..df2bfd64de 100644
--- a/openair1/PHY/TOOLS/time_meas.c
+++ b/common/utils/time_meas.c
@@ -267,6 +267,15 @@ void init_meas(void) {
AssertFatal(rt==0, "couldn't create cpu measurment thread: %s\n",strerror(errno));
}
+void send_meas(time_stats_t *ts, int msgid) {
+ if (MEASURE_ENABLED(ts) ) {
+ ts->tstatptr->timestat_id=ts->meas_index;
+ ts->tstatptr->msgid = msgid ;
+ ts->tstatptr->ts = rdtsc_oai();
+ pushNotifiedFIFO(&measur_fifo, ts->tpoolmsg);
+ }
+ }
+
void end_meas(void) {
notifiedFIFO_elt_t *nfe = newNotifiedFIFO_elt(sizeof(time_stats_msg_t),0,NULL,NULL);
time_stats_msg_t *msg = (time_stats_msg_t *)NotifiedFifoData(nfe);
diff --git a/openair1/PHY/TOOLS/time_meas.h b/common/utils/time_meas.h
similarity index 83%
rename from openair1/PHY/TOOLS/time_meas.h
rename to common/utils/time_meas.h
index ed4e9a125f..382dd7455a 100644
--- a/openair1/PHY/TOOLS/time_meas.h
+++ b/common/utils/time_meas.h
@@ -31,15 +31,14 @@
#include
#include
#include
-#include "common/utils/threadPool/thread-pool.h"
// global var to enable openair performance profiler
extern int opp_enabled;
extern double cpu_freq_GHz __attribute__ ((aligned(32)));;
// structure to store data to compute cpu measurment
#if defined(__x86_64__) || defined(__i386__)
- #define OAI_CPUTIME_TYPE long long
+ typedef long long oai_cputime_t;
#elif defined(__arm__)
- #define OAI_CPUTIME_TYPE uint32_t
+ typedef uint32_t oai_cputime_t;
#else
#error "building on unsupported CPU architecture"
#endif
@@ -54,23 +53,23 @@ typedef void(*meas_printfunc_t)(const char* format, ...);
typedef struct {
int msgid; /*!< \brief message id, as defined by TIMESTAT_MSGID_X macros */
int timestat_id; /*!< \brief points to the time_stats_t entry in cpumeas table */
- OAI_CPUTIME_TYPE ts; /*!< \brief time stamp */
+ oai_cputime_t ts; /*!< \brief time stamp */
meas_printfunc_t displayFunc; /*!< \brief function to call when DISPLAY message is received*/
} time_stats_msg_t;
-
-typedef struct {
- OAI_CPUTIME_TYPE in; /*!< \brief time at measure starting point */
- OAI_CPUTIME_TYPE diff; /*!< \brief average difference between time at starting point and time at endpoint*/
- OAI_CPUTIME_TYPE p_time; /*!< \brief absolute process duration */
- OAI_CPUTIME_TYPE diff_square; /*!< \brief process duration square */
- OAI_CPUTIME_TYPE max; /*!< \brief maximum difference between time at starting point and time at endpoint*/
+struct notifiedFIFO_elt_s;
+typedef struct time_stats {
+ oai_cputime_t in; /*!< \brief time at measure starting point */
+ oai_cputime_t diff; /*!< \brief average difference between time at starting point and time at endpoint*/
+ oai_cputime_t p_time; /*!< \brief absolute process duration */
+ oai_cputime_t diff_square; /*!< \brief process duration square */
+ oai_cputime_t max; /*!< \brief maximum difference between time at starting point and time at endpoint*/
int trials; /*!< \brief number of start point - end point iterations */
int meas_flag; /*!< \brief 1: stop_meas not called (consecutive calls of start_meas) */
char *meas_name; /*!< \brief name to use when printing the measure (not used for PHY simulators)*/
int meas_index; /*!< \brief index of this measure in the measure array (not used for PHY simulators)*/
int meas_enabled; /*!< \brief per measure enablement flag. send_meas tests this flag, unused today in start_meas and stop_meas*/
- notifiedFIFO_elt_t *tpoolmsg; /*!< \brief message pushed to the cpu measurment queue to report a measure START or STOP */
+ struct notifiedFIFO_elt_s *tpoolmsg; /*!< \brief message pushed to the cpu measurment queue to report a measure START or STOP */
time_stats_msg_t *tstatptr; /*!< \brief pointer to the time_stats_msg_t data in the tpoolmsg, stored here for perf considerations*/
} time_stats_t;
#define MEASURE_ENABLED(X) (X->meas_enabled)
@@ -179,7 +178,7 @@ static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts) {
}
}
-static inline void merge_meas(time_stats_t *dst_ts, time_stats_t *src_ts)
+static inline void merge_meas(time_stats_t *dst_ts, const time_stats_t *src_ts)
{
if (!opp_enabled)
return;
@@ -189,25 +188,17 @@ static inline void merge_meas(time_stats_t *dst_ts, time_stats_t *src_ts)
dst_ts->max = src_ts->max;
}
-extern notifiedFIFO_t measur_fifo;
#define CPUMEASUR_SECTION "cpumeasur"
#define CPUMEASUR_PARAMS_DESC { \
{"max_cpumeasur", "Max number of cpu measur entries", 0, uptr:&max_cpumeasur, defintval:100, TYPE_UINT, 0},\
}
- void init_meas(void);
- time_stats_t *register_meas(char *name);
- #define START_MEAS(X) send_meas(X, TIMESTAT_MSGID_START)
- #define STOP_MEAS(X) send_meas(X, TIMESTAT_MSGID_STOP)
- static inline void send_meas(time_stats_t *ts, int msgid) {
- if (MEASURE_ENABLED(ts) ) {
- ts->tstatptr->timestat_id=ts->meas_index;
- ts->tstatptr->msgid = msgid ;
- ts->tstatptr->ts = rdtsc_oai();
- pushNotifiedFIFO(&measur_fifo, ts->tpoolmsg);
- }
- }
- void end_meas(void);
+void init_meas(void);
+time_stats_t *register_meas(char *name);
+#define START_MEAS(X) send_meas(X, TIMESTAT_MSGID_START)
+#define STOP_MEAS(X) send_meas(X, TIMESTAT_MSGID_STOP)
+void send_meas(time_stats_t *ts, int msgid);
+void end_meas(void);
#endif
diff --git a/doc/5Gnas.md b/doc/5Gnas.md
index 3d33af426c..db0c19f07e 100644
--- a/doc/5Gnas.md
+++ b/doc/5Gnas.md
@@ -23,7 +23,6 @@ This tuto for 5G gNB NAS design
# source files
-executables/ocp-gnb.c: a main loop to create a debuggable gNB, see document SW_archi.md
openair2/RRC/NR/nr_ngap_gNB.c: skeleton for interface with NGAP
openair3/NAS/COMMON/milenage.h: a simple milenage implementation, depend only on crypto library
openair3/NAS/COMMON/NR_NAS_defs.h: messages defined for NAS implemented in C: C struct, C enums and automatic conversion to labels for debug messages
diff --git a/doc/L2NFAPI.md b/doc/L2NFAPI.md
index 137e4847e4..5b8c0f546c 100644
--- a/doc/L2NFAPI.md
+++ b/doc/L2NFAPI.md
@@ -18,6 +18,10 @@ The UE executable is able to "simulate" multiple UEs in order to stimulate the s
**This simulator is available starting the `v1.0.0` release on the `master` branch.**
+**2022/03/08: CAUTION, THIS TUTORIAL IS NO LONGER VALID on the `develop` branch after the `2022.w01` tag.**
+
+**2022/03/08: CAUTION, THE LAST VALID TAG on `develop` branch is `2021.w51_c`.**
+
Currently the Continuous Integration process is validating this simulator the following way:
* the LTE modem executable is run on one host (in our CI deployment it is a **Xenial Virtual Machine**)
@@ -31,6 +35,17 @@ Normally it should be fine to run both executables on the same host using the `l
1. [With S1 -- eNB and UE on 2 hosts](L2NFAPI_S1.md)
2. [No S1 -- eNB and UE on 2 hosts](L2NFAPI_NOS1.md)
+
+**2022/03/08: Starting the `2022.w01` tag on the `develop` branch, the L2 nFAPI simulation is using a proxy.**
+
+A tutorial is available on the [EpiSci GitHub Repository](https://github.com/EpiSci/oai-lte-5g-multi-ue-proxy#readme).
+
+This proxy allows to perform L2 nFAPI simulator for:
+
+* LTE
+* 5G-NSA
+* 5G-SA
+
----
[oai wiki home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
diff --git a/doc/L2NFAPI_NOS1.md b/doc/L2NFAPI_NOS1.md
index bb4c32ec08..4f56be3416 100644
--- a/doc/L2NFAPI_NOS1.md
+++ b/doc/L2NFAPI_NOS1.md
@@ -12,6 +12,10 @@
+**2022/03/08: CAUTION, THIS TUTORIAL IS NO LONGER VALID on the `develop` branch after the `2022.w01` tag.**
+
+**2022/03/08: CAUTION, THE LAST VALID TAG on `develop` branch is `2021.w51_c`.**
+
## Table of Contents ##
1. [Environment](#1-environment)
diff --git a/doc/L2NFAPI_S1.md b/doc/L2NFAPI_S1.md
index 9fd6d51818..824e9e469a 100644
--- a/doc/L2NFAPI_S1.md
+++ b/doc/L2NFAPI_S1.md
@@ -12,6 +12,10 @@
+**2022/03/08: CAUTION, THIS TUTORIAL IS NO LONGER VALID on the `develop` branch after the `2022.w01` tag.**
+
+**2022/03/08: CAUTION, THE LAST VALID TAG on `develop` branch is `2021.w51_c`.**
+
## Table of Contents ##
1. [Environment](#1-environment)
diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md
index 449859b042..7ee3ae9d7e 100644
--- a/doc/RUNMODEM.md
+++ b/doc/RUNMODEM.md
@@ -33,7 +33,7 @@ It is planned to enhance this simulator with the following functionalities:
This simulator connects a eNodeB and UEs through a nfapi interface, short-cutting the L1 layer. The objective of this simulator is to allow multi UEs simulation, with a large number of UEs (ideally up to 255 ) .Here to ease the platform setup, UEs are simulated via a single `lte-uesoftmodem` instance. Today the CI tests just with one UE and architecture has to be reviewed to allow a number of UE above about 16. This work is on-going.
-As for the rf simulator, no specific hardware is required. The [L2 nfapi simlator page](L2NFAPI.md) contains the detailed documentation.
+As for the rf simulator, no specific hardware is required. The [L2 nfapi simulator page](L2NFAPI.md) contains the detailed documentation.
# L1 Simulator
diff --git a/doc/SW_archi.md b/doc/SW_archi.md
index 7648fb2e16..0a53bf3793 100644
--- a/doc/SW_archi.md
+++ b/doc/SW_archi.md
@@ -85,10 +85,6 @@ end
This tuto for 5G gNB design, with Open Cells main
{: .text-center}
-# Top file: executables/ocp-gnb.c
-
-the function main() initializes the data from configuration file
-
# The main thread is in ru_thread()
The infinite loop:
## rx_rf()
diff --git a/executables/main-fs6.c b/executables/main-fs6.c
index 9e92f2e41a..fff4c51155 100644
--- a/executables/main-fs6.c
+++ b/executables/main-fs6.c
@@ -55,6 +55,59 @@ int sum(uint8_t *b, int s) {
return sum;
}
+
+extern double cpuf;
+
+typedef struct m {
+ uint64_t iterations;
+ uint64_t sum;
+ uint64_t maxArray[11];
+} Meas;
+
+int cmpint(const void *a, const void *b)
+{
+ uint64_t *aa=(uint64_t *)a;
+ uint64_t *bb=(uint64_t *)b;
+ return (int)(*aa-*bb);
+}
+
+static inline void printMeas(char *txt,
+ Meas *M,
+ int period)
+{
+ if (M->iterations%period == 0 ) {
+ char txt2[512];
+ sprintf(txt2,"%s avg=%" PRIu64 " iterations=%" PRIu64 " max=%"
+ PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 "\n",
+ txt,
+ M->sum/M->iterations,
+ M->iterations,
+ M->maxArray[1],M->maxArray[2], M->maxArray[3],M->maxArray[4], M->maxArray[5],
+ M->maxArray[6],M->maxArray[7], M->maxArray[8],M->maxArray[9],M->maxArray[10]);
+#if T_TRACER
+ LOG_W(PHY,"%s",txt2);
+#else
+ printf("%s",txt2);
+#endif
+ }
+}
+
+void updateTimes(uint64_t start, Meas *M, int period, char *txt)
+{
+ if (start!=0) {
+ uint64_t end=rdtsc_oai();
+ long long diff=(end-start)/(cpuf*1000);
+ M->maxArray[0]=diff;
+ M->sum+=diff;
+ M->iterations++;
+ qsort(M->maxArray, 11, sizeof(uint64_t), cmpint);
+ printMeas(txt,M,period);
+ }
+}
+
+#define initStaticTime(a) static __thread uint64_t a={0}
+#define pickStaticTime(a) do { a=rdtsc_oai(); } while (0)
+#define initRefTimes(a) static __thread Meas a= {0}
static inline int cmpintRev(const void *a, const void *b) {
uint64_t *aa=(uint64_t *)a;
uint64_t *bb=(uint64_t *)b;
@@ -82,7 +135,7 @@ static inline void printMeas2(char *txt, Meas *M, int period, bool MaxMin) {
static inline void updateTimesReset(uint64_t start, Meas *M, int period, bool MaxMin, char *txt) {
if (start!=0) {
- uint64_t end=rdtsc();
+ uint64_t end=rdtsc_oai();
long long diff=(end-start)/(cpuf*1000);
M->maxArray[0]=diff;
M->sum+=diff;
@@ -107,7 +160,7 @@ static inline void updateTimesReset(uint64_t start, Meas *M, int period, bool Ma
static inline void measTransportTime(uint64_t DuSend, uint64_t CuMicroSec, Meas *M, int period, bool MaxMin, char *txt) {
if (DuSend!=0) {
- uint64_t end=rdtsc();
+ uint64_t end=rdtsc_oai();
long long diff=(end-DuSend)/(cpuf*1000)-CuMicroSec;
M->maxArray[0]=diff;
M->sum+=diff;
@@ -894,7 +947,7 @@ void phy_procedures_eNB_TX_fromsplit(uint8_t *bufferZone, int nbBlocks, PHY_VARS
memcpy(eNB->pbch_pdu,hDL(bufferZone)->pbch_pdu, 4);
// Remove all scheduled DL, we will populate from the CU sending
- for (int UE_id=0; UE_iddlsch[UE_id][0];
if ( dlsch0 && dlsch0->rnti>0 ) {
@@ -1463,7 +1516,7 @@ void DL_cu_fs6(RU_t *ru, L1_rxtx_proc_t *proc, uint64_t DuClock, uint64_t start
}
hDL(bufferZone)->DuClock=DuClock;
- hDL(bufferZone)->CuSpentMicroSec=(rdtsc()-startCycle)/(cpuf*1000);
+ hDL(bufferZone)->CuSpentMicroSec=(rdtsc_oai()-startCycle)/(cpuf*1000);
updateTimesReset(startCycle, &CUprocessing, 1000, true,"CU entire processing from recv to send");
sendSubFrame(&sockFS6, bufferZone, sizeof(fs6_dl_t), CTsentCUv0 );
return;
@@ -1476,7 +1529,7 @@ void UL_cu_fs6(RU_t *ru, L1_rxtx_proc_t *proc, uint64_t *TS, uint64_t *DuClock,
pickStaticTime(begingWait);
int nb_blocks=receiveSubFrame(&sockFS6, bufferZone, sizeof(bufferZone), CTsentDUv0 );
* DuClock=hUDP(bufferZone)->senderClock;
- * startProcessing=rdtsc();
+ * startProcessing=rdtsc_oai();
updateTimesReset(begingWait, &fullLoop, 1000, false, "CU wait DU");
if (nb_blocks ==0) {
diff --git a/executables/main-ocp.c b/executables/main-ocp.c
index 04315a4d57..c9388e179d 100644
--- a/executables/main-ocp.c
+++ b/executables/main-ocp.c
@@ -87,10 +87,10 @@ AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB]= {0};
AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB]= {0};
void flexran_agent_slice_update(mid_t module_idP) {
}
-int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p) {
+int proto_agent_start(mid_t mod_id, const cudu_params_t *p) {
return 0;
}
-void proto_agent_stop(mod_id_t mod_id) {
+void proto_agent_stop(mid_t mod_id) {
}
static void *ru_thread( void *param );
diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c
index 2b1c36407b..4793ef4e95 100644
--- a/executables/nr-gnb.c
+++ b/executables/nr-gnb.c
@@ -177,15 +177,14 @@ void rx_func(void *param) {
void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch);
int j;
for (j = 0; j < NUMBER_OF_NR_ULSCH_MAX; j++)
- if (gNB->ulsch[j][0]->rnti == rnti_to_remove[i]) {
- gNB->ulsch[j][0]->rnti = 0;
- gNB->ulsch[j][0]->harq_mask = 0;
- //clean_gNB_ulsch(gNB->ulsch[j][0]);
+ if (gNB->ulsch[j]->rnti == rnti_to_remove[i]) {
+ gNB->ulsch[j]->rnti = 0;
+ gNB->ulsch[j]->harq_mask = 0;
int h;
for (h = 0; h < NR_MAX_ULSCH_HARQ_PROCESSES; h++) {
- gNB->ulsch[j][0]->harq_processes[h]->status = SCH_IDLE;
- gNB->ulsch[j][0]->harq_processes[h]->round = 0;
- gNB->ulsch[j][0]->harq_processes[h]->handled = 0;
+ gNB->ulsch[j]->harq_processes[h]->status = SCH_IDLE;
+ gNB->ulsch[j]->harq_processes[h]->round = 0;
+ gNB->ulsch[j]->harq_processes[h]->handled = 0;
}
up_removed++;
}
@@ -210,7 +209,6 @@ void rx_func(void *param) {
if (pthread_mutex_unlock(&rnti_to_remove_mutex)) exit(1);
// RX processing
- int tx_slot_type = nr_slot_select(cfg,frame_tx,slot_tx);
int rx_slot_type = nr_slot_select(cfg,frame_rx,slot_rx);
if (rx_slot_type == NR_UPLINK_SLOT || rx_slot_type == NR_MIXED_SLOT) {
// UE-specific RX processing for subframe n
@@ -244,7 +242,8 @@ void rx_func(void *param) {
gNB->if_inst->NR_UL_indication(&gNB->UL_INFO);
pthread_mutex_unlock(&gNB->UL_INFO_mutex);
stop_meas(&gNB->ul_indication_stats);
-
+
+ int tx_slot_type = nr_slot_select(cfg,frame_rx,slot_tx);
if (tx_slot_type == NR_DOWNLINK_SLOT || tx_slot_type == NR_MIXED_SLOT) {
notifiedFIFO_elt_t *res;
processingData_L1tx_t *syncMsg;
@@ -256,8 +255,17 @@ void rx_func(void *param) {
syncMsg->timestamp_tx = info->timestamp_tx;
res->key = slot_tx;
pushTpool(gNB->threadPool, res);
+ } else if (get_softmodem_params()->continuous_tx) {
+ notifiedFIFO_elt_t *res = pullTpool(gNB->L1_tx_free, gNB->threadPool);
+ processingData_L1tx_t *syncMsg = (processingData_L1tx_t *)NotifiedFifoData(res);
+ syncMsg->gNB = gNB;
+ syncMsg->timestamp_tx = info->timestamp_tx;
+ syncMsg->frame = frame_tx;
+ syncMsg->slot = slot_tx;
+ res->key = slot_tx;
+ pushNotifiedFIFO(gNB->L1_tx_out, res);
}
-
+
#if 0
LOG_D(PHY, "rxtx:%lld nfapi:%lld phy:%lld tx:%lld rx:%lld prach:%lld ofdm:%lld ",
softmodem_stats_rxtx_sf.diff_now, nfapi_meas.diff_now,
@@ -300,8 +308,7 @@ void rx_func(void *param) {
}
static void dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output) {
int stroff = 0;
- stroff += print_meas_log(gNB->phy_proc_tx[0], "L1 Tx processing thread 0", NULL, NULL, output);
- //stroff += print_meas_log(gNB->phy_proc_tx[1], "L1 Tx processing thread 1", NULL, NULL, output+stroff);
+ stroff += print_meas_log(&gNB->phy_proc_tx, "L1 Tx processing", NULL, NULL, output);
stroff += print_meas_log(&gNB->dlsch_encoding_stats, "DLSCH encoding", NULL, NULL, output+stroff);
stroff += print_meas_log(&gNB->phy_proc_rx, "L1 Rx processing", NULL, NULL, output+stroff);
stroff += print_meas_log(&gNB->ul_indication_stats, "UL Indication", NULL, NULL, output+stroff);
@@ -337,8 +344,7 @@ void *nrL1_stats_thread(void *param) {
fd=fopen("nrL1_stats.log","w");
AssertFatal(fd!=NULL,"Cannot open nrL1_stats.log\n");
- reset_meas(gNB->phy_proc_tx[0]);
- //reset_meas(gNB->phy_proc_tx[1]);
+ reset_meas(&gNB->phy_proc_tx);
reset_meas(&gNB->dlsch_encoding_stats);
reset_meas(&gNB->phy_proc_rx);
reset_meas(&gNB->ul_indication_stats);
@@ -397,7 +403,11 @@ void *tx_reorder_thread(void* param) {
syncMsgRU.slot_tx = syncMsgL1->slot;
syncMsgRU.timestamp_tx = syncMsgL1->timestamp_tx;
syncMsgRU.ru = gNB->RU_list[0];
- next_tx_slot = get_next_downlink_slot(gNB, &gNB->gNB_config, syncMsgRU.frame_tx, syncMsgRU.slot_tx);
+ if (get_softmodem_params()->continuous_tx) {
+ int slots_per_frame = gNB->frame_parms.slots_per_frame;
+ next_tx_slot = (syncMsgRU.slot_tx + 1) % slots_per_frame;
+ } else
+ next_tx_slot = get_next_downlink_slot(gNB, &gNB->gNB_config, syncMsgRU.frame_tx, syncMsgRU.slot_tx);
pushNotifiedFIFO(gNB->L1_tx_free, resL1);
if (resL1==resL1Reserve)
resL1Reserve=NULL;
@@ -425,7 +435,7 @@ void init_gNB_Tpool(int inst) {
s_offset += 3;
}
if (getenv("noThreads")) strcpy(pool, "n");
- initTpool(pool, gNB->threadPool, false);
+ initTpool(pool, gNB->threadPool, cpumeas(CPUMEAS_GETSTATE));
// ULSCH decoder result FIFO
gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
initNotifiedFIFO(gNB->respDecode);
@@ -450,8 +460,6 @@ void init_gNB_Tpool(int inst) {
processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx);
init_DLSCH_struct(gNB, msgDataTx);
memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t));
- reset_meas(&msgDataTx->phy_proc_tx);
- gNB->phy_proc_tx[i] = &msgDataTx->phy_proc_tx;
pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); // to unblock the process in the beginning
}
diff --git a/executables/nr-ru.c b/executables/nr-ru.c
index 08decf0f67..45ef0f9baf 100644
--- a/executables/nr-ru.c
+++ b/executables/nr-ru.c
@@ -703,46 +703,53 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
nfapi_nr_config_request_scf_t *cfg = &ru->config;
void *txp[ru->nb_tx];
unsigned int txs;
- int i,txsymb=fp->symbols_per_slot;
+ 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][fp->get_samples_slot_timestamp(slot,fp,0)], fp->samples_per_subframe * 4));
- int slot_type = nr_slot_select(cfg,frame,slot%fp->slots_per_frame);
- int prevslot_type = nr_slot_select(cfg,frame,(slot+(fp->slots_per_frame-1))%fp->slots_per_frame);
- int nextslot_type = nr_slot_select(cfg,frame,(slot+1)%fp->slots_per_frame);
int sf_extension = 0;
int siglen=fp->get_samples_per_slot(slot,fp);
- int flags=1;
+ int flags = 0;
- //nr_subframe_t SF_type = nr_slot_select(cfg,slot%fp->slots_per_frame);
- if (slot_type == NR_DOWNLINK_SLOT || slot_type == NR_MIXED_SLOT || IS_SOFTMODEM_RFSIM) {
- if (cfg->cell_config.frame_duplex_type.value == TDD) {
- if(slot_type == NR_MIXED_SLOT) {
- txsymb = 0;
+ if (cfg->cell_config.frame_duplex_type.value == TDD && !get_softmodem_params()->continuous_tx) {
+ int slot_type = nr_slot_select(cfg,frame,slot%fp->slots_per_frame);
+ if(slot_type == NR_MIXED_SLOT) {
+ int txsymb = 0;
- for(int symbol_count = 0; symbol_counttdd_table.max_tdd_periodicity_list[slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value == 0)
- txsymb++;
- }
-
- AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb);
-
- if(slot%(fp->slots_per_subframe/2))
- siglen = txsymb * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
- else
- siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0) + (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
-
- //+ ru->end_of_burst_delay;
- flags = 3; // end of burst
+ for(int symbol_count = 0; symbol_counttdd_table.max_tdd_periodicity_list[slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value == 0)
+ txsymb++;
}
- if (slot_type == NR_DOWNLINK_SLOT && prevslot_type == NR_UPLINK_SLOT) {
+ AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb);
+
+ if(slot%(fp->slots_per_subframe/2))
+ siglen = txsymb * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
+ else
+ siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0) + (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
+
+ //+ ru->end_of_burst_delay;
+ flags = 3; // end of burst
+ } else if (slot_type == NR_DOWNLINK_SLOT) {
+ int prevslot_type = nr_slot_select(cfg,frame,(slot+(fp->slots_per_frame-1))%fp->slots_per_frame);
+ int nextslot_type = nr_slot_select(cfg,frame,(slot+1)%fp->slots_per_frame);
+ if (prevslot_type == NR_UPLINK_SLOT) {
flags = 2; // start of burst
sf_extension = ru->sf_extension;
- }
- if (slot_type == NR_DOWNLINK_SLOT && nextslot_type == NR_UPLINK_SLOT)
+ } else if (nextslot_type == NR_UPLINK_SLOT) {
flags = 3; // end of burst
+ } else {
+ flags = 1; // middle of burst
+ }
}
+ } else { // FDD
+ if (proc->first_tx == 1) {
+ flags = 2; // start of burst
+ } else {
+ flags = 1; // middle of burst
+ }
+ }
+ if (flags) {
if (fp->freq_range==nr_FR2) {
// the beam index is written in bits 8-10 of the flags
// bit 11 enables the gpio programming
diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c
index 6452036912..ac5a1b0132 100644
--- a/executables/nr-softmodem.c
+++ b/executables/nr-softmodem.c
@@ -62,8 +62,6 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
-//#include "PHY/TOOLS/time_meas.h"
-
#include "intertask_interface.h"
#include "PHY/INIT/phy_init.h"
diff --git a/executables/nr-ue.c b/executables/nr-ue.c
index 9c9ca4db4c..3cc71b8b3a 100644
--- a/executables/nr-ue.c
+++ b/executables/nr-ue.c
@@ -18,7 +18,8 @@
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
-#define _GNU_SOURCE
+
+#define _GNU_SOURCE
#include
#include
#include "executables/nr-uesoftmodem.h"
@@ -766,9 +767,9 @@ void processSlotRX(void *arg) {
#ifdef UE_SLOT_PARALLELISATION
phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, no_relay, NULL );
#else
- uint64_t a=rdtsc();
+ uint64_t a=rdtsc_oai();
phy_procedures_nrUE_RX(UE, proc, gNB_id, get_nrUE_params()->nr_dlsch_parallel, &rxtxD->txFifo);
- LOG_D(PHY, "In %s: slot %d, time %lu\n", __FUNCTION__, proc->nr_slot_rx, (rdtsc()-a)/3500);
+ LOG_D(PHY, "In %s: slot %d, time %llu\n", __FUNCTION__, proc->nr_slot_rx, (rdtsc_oai()-a)/3500);
#endif
if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa){
@@ -1125,9 +1126,8 @@ void *UE_thread(void *arg) {
}
int flags = 0;
- int slot_tx_usrp = slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH;
- if (openair0_cfg[0].duplex_mode == duplex_mode_TDD) {
+ if (openair0_cfg[0].duplex_mode == duplex_mode_TDD && !get_softmodem_params()->continuous_tx) {
uint8_t tdd_period = mac->phy_config.config_req.tdd_table.tdd_period_in_slots;
int nrofUplinkSlots, nrofUplinkSymbols;
@@ -1139,8 +1139,9 @@ void *UE_thread(void *arg) {
nrofUplinkSlots = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
nrofUplinkSymbols = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols;
}
- uint8_t num_UL_slots = nrofUplinkSlots + (nrofUplinkSymbols != 0);
+ int slot_tx_usrp = slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH;
+ uint8_t num_UL_slots = nrofUplinkSlots + (nrofUplinkSymbols != 0);
uint8_t first_tx_slot = tdd_period - num_UL_slots;
if (slot_tx_usrp % tdd_period == first_tx_slot)
diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c
index 7663e9ebd8..76c21bb422 100644
--- a/executables/nr-uesoftmodem.c
+++ b/executables/nr-uesoftmodem.c
@@ -61,7 +61,6 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "UTIL/OPT/opt.h"
#include "enb_config.h"
-//#include "PHY/TOOLS/time_meas.h"
#include "intertask_interface.h"
diff --git a/executables/ocp-gnb.c b/executables/ocp-gnb.c
deleted file mode 100644
index 23fd3ae132..0000000000
--- a/executables/ocp-gnb.c
+++ /dev/null
@@ -1,1006 +0,0 @@
-/*
- * Author: Laurent Thomas, Open Cells Project
- * all rights reserved
- */
-
-#define _GNU_SOURCE
-#include
-#include "assertions.h"
-#include
-#include
-
-#include "PHY/types.h"
-
-#include "PHY/INIT/phy_init.h"
-
-#include "PHY/defs_gNB.h"
-#include "SCHED/sched_eNB.h"
-#include "SCHED_NR/sched_nr.h"
-#include "SCHED_NR/fapi_nr_l1.h"
-#include "PHY/LTE_TRANSPORT/transport_proto.h"
-#include "../../ARCH/COMMON/common_lib.h"
-
-#include "PHY/phy_extern.h"
-#include "LAYER2/MAC/mac.h"
-#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
-#include "LAYER2/MAC/mac_proto.h"
-#include "RRC/LTE/rrc_extern.h"
-#include "PHY_INTERFACE/phy_interface.h"
-#include "common/utils/LOG/log_extern.h"
-#include "UTIL/OTG/otg_tx.h"
-#include "UTIL/OTG/otg_externs.h"
-#include "UTIL/MATH/oml.h"
-#include "common/utils/LOG/vcd_signal_dumper.h"
-#include "UTIL/OPT/opt.h"
-#include "enb_config.h"
-#include "s1ap_eNB.h"
-#include "SIMULATION/ETH_TRANSPORT/proto.h"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-// should be in a shared lib
-#include
-#include
-#include
-#include
-
-// Global vars
-#include
-#include
-#include
-#include
-volatile int oai_exit;
-int single_thread_flag=1;
-uint32_t do_forms=0;
-unsigned int mmapped_dma=0;
-int8_t threequarter_fs=0;
-
-int chain_offset=0;
-uint16_t sl_ahead=6;
-uint16_t sf_ahead=6;
-uint32_t timing_advance = 0;
-int transmission_mode=1;
-int emulate_rf = 0;
-int numerology = 0;
-
-
-int config_sync_var=-1;
-pthread_mutex_t nfapi_sync_mutex;
-pthread_cond_t nfapi_sync_cond;
-int nfapi_sync_var=-1;
-double cpuf;
-
-THREAD_STRUCT thread_struct;
-
-pthread_cond_t sync_cond;
-pthread_mutex_t sync_mutex;
-int sync_var=-1; //!< protected by mutex \ref sync_mutex.
-
-
-uint64_t downlink_frequency[MAX_NUM_CCs][4];
-int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
-time_stats_t softmodem_stats_mt; // main thread
-time_stats_t softmodem_stats_hw; // hw acquisition
-time_stats_t softmodem_stats_rxtx_sf; // total tx time
-time_stats_t nfapi_meas; // total tx time
-time_stats_t softmodem_stats_rx_sf; // total rx time
-// not used but needed for link
-openair0_config_t openair0_cfg[MAX_CARDS];
-uint16_t slot_ahead=6;
-AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB];
-AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB];
-int flexran_agent_start(mid_t mod_id) {
- memset (agent_rrc_xface, 0, sizeof(agent_rrc_xface));
- memset (agent_mac_xface, 0, sizeof(agent_mac_xface));
- return 0;
-}
-void flexran_agent_slice_update(mid_t module_idP) {
-}
-int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p) {
- return 0;
-}
-void proto_agent_stop(mod_id_t mod_id) {
-}
-int split73=0;
-void sendFs6Ul(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int segmentID, int16_t *data, int dataLen, int r_offset) {
- AssertFatal(false, "Must not be called in this context\n");
-}
-int stop_L1L2(module_id_t gnb_id) {
- AssertFatal(false, "Must not be called in this context\n");
-}
-int restart_L1L2(module_id_t gnb_id) {
- AssertFatal(false, "Must not be called in this context\n");
-}
-
-static int wait_for_sync = 0;
-static double snr_dB=20;
-static int DEFBANDS[] = {7};
-static int DEFENBS[] = {0};
-static int DEFBFW[] = {0x00007fff};
-
-extern double cpuf;
-
-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};
-
-static inline int ocp_rxtx(PHY_VARS_gNB *gNB, gNB_L1_rxtx_proc_t *proc) {
- nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
- start_meas(&softmodem_stats_rxtx_sf);
-
- // *******************************************************************
-
- if (nfapi_mode == NFAPI_MODE_PNF) {
- // I am a PNF and I need to let nFAPI know that we have a (sub)frame tick
- //add_subframe(&frame, &subframe, 4);
- //oai_subframe_ind(proc->frame_tx, proc->subframe_tx);
- //LOG_D(PHY, "oai_subframe_ind(frame:%u, subframe:%d) - NOT CALLED ********\n", frame, subframe);
- start_meas(&nfapi_meas);
- oai_subframe_ind(proc->frame_rx, proc->slot_rx);
- stop_meas(&nfapi_meas);
- /*if (gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus||
- gNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs ||
- gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs ||
- gNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles ||
- gNB->UL_INFO.cqi_ind.number_of_cqis
- ) {
- LOG_D(PHY, "UL_info[rx_ind:%05d:%d harqs:%05d:%d crcs:%05d:%d preambles:%05d:%d cqis:%d] RX:%04d%d TX:%04d%d \n",
- NFAPI_SFNSF2DEC(gNB->UL_INFO.rx_ind.sfn_sf), gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus,
- NFAPI_SFNSF2DEC(gNB->UL_INFO.harq_ind.sfn_sf), gNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs,
- NFAPI_SFNSF2DEC(gNB->UL_INFO.crc_ind.sfn_sf), gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs,
- NFAPI_SFNSF2DEC(gNB->UL_INFO.rach_ind.sfn_sf), gNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles,
- gNB->UL_INFO.cqi_ind.number_of_cqis,
- frame_rx, slot_rx,
- frame_tx, slot_tx);
- }*/
- }
-
- /// NR disabling
- // ****************************************
- // Common RX procedures subframe n
- pthread_mutex_lock(&gNB->UL_INFO_mutex);
- gNB->UL_INFO.frame = proc->frame_rx;
- gNB->UL_INFO.slot = proc->slot_rx;
- gNB->UL_INFO.module_id = gNB->Mod_id;
- gNB->UL_INFO.CC_id = gNB->CC_id;
- gNB->if_inst->NR_UL_indication(&gNB->UL_INFO);
- pthread_mutex_unlock(&gNB->UL_INFO_mutex);
- // RX processing
- int tx_slot_type = nr_slot_select(cfg,proc->frame_tx,proc->slot_tx);
- int rx_slot_type = nr_slot_select(cfg,proc->frame_rx,proc->slot_rx);
-
- if (rx_slot_type == NR_UPLINK_SLOT || rx_slot_type == NR_MIXED_SLOT) {
- // Do PRACH RU processing
- L1_nr_prach_procedures(gNB,proc->frame_rx,proc->slot_rx);
- phy_procedures_gNB_uespec_RX(gNB, proc->frame_rx, proc->slot_rx);
- }
-
- if (oai_exit) return(-1);
-
- // *****************************************
- // TX processing for subframe n+sf_ahead
- // run PHY TX procedures the one after the other for all CCs to avoid race conditions
- // (may be relaxed in the future for performance reasons)
- // *****************************************
-
- if (tx_slot_type == NR_DOWNLINK_SLOT || tx_slot_type == NR_MIXED_SLOT) {
- phy_procedures_gNB_TX(gNB, proc->frame_tx,proc->slot_tx, 1);
- }
-
- stop_meas( &softmodem_stats_rxtx_sf );
- LOG_D(PHY,"%s() Exit proc[rx:%d%d tx:%d%d]\n", __FUNCTION__, proc->frame_rx, proc->slot_rx, proc->frame_tx, proc->slot_tx);
- return(0);
-}
-
-
-static void *process_stats_thread(void *param) {
- PHY_VARS_gNB *gNB = (PHY_VARS_gNB *)param;
- reset_meas(&gNB->dlsch_encoding_stats);
- reset_meas(&gNB->dlsch_scrambling_stats);
- reset_meas(&gNB->dlsch_modulation_stats);
-
- while(!oai_exit) {
- sleep(1);
- print_meas(&gNB->dlsch_encoding_stats, "pdsch_encoding", NULL, NULL);
- print_meas(&gNB->dlsch_scrambling_stats, "pdsch_scrambling", NULL, NULL);
- print_meas(&gNB->dlsch_modulation_stats, "pdsch_modulation", NULL, NULL);
- }
-
- return(NULL);
-}
-
-void init_gNB_proc(int inst) {
- PHY_VARS_gNB *gNB = RC.gNB[inst];
- gNB_L1_proc_t *proc = &gNB->proc;
- gNB_L1_rxtx_proc_t *L1_proc = &proc->L1_proc;
- gNB_L1_rxtx_proc_t *L1_proc_tx = &proc->L1_proc_tx;
- L1_proc->instance_cnt = -1;
- L1_proc_tx->instance_cnt = -1;
- L1_proc->instance_cnt_RUs = 0;
- L1_proc_tx->instance_cnt_RUs = 0;
- proc->instance_cnt_prach = -1;
- proc->instance_cnt_asynch_rxtx = -1;
- proc->CC_id = 0;
- proc->first_rx =1;
- proc->first_tx =1;
- proc->RU_mask =0;
- proc->RU_mask_tx = (1<num_RU)-1;
- proc->RU_mask_prach =0;
- pthread_mutex_init( &gNB->UL_INFO_mutex, NULL);
- gNB->threadPool = (tpool_t *)malloc(sizeof(tpool_t));
- gNB->respDecode = (notifiedFIFO_t *) malloc(sizeof(notifiedFIFO_t));
- char ul_pool[] = "-1,-1";
- initTpool(ul_pool, gNB->threadPool, false);
- initNotifiedFIFO(gNB->respDecode);
-}
-
-/// eNB kept in function name for nffapi calls, TO FIX
-void init_gNB_phase2(RU_t *ru) {
- int inst;
- LOG_I(PHY,"%s() RC.nb_nr_inst:%d\n", __FUNCTION__, RC.nb_nr_inst);
-
- for (inst=0; instnum_RU:%d\n", gNB->num_RU);
- phy_init_nr_gNB(gNB,0,0);
- RC.gNB[inst]->num_RU=1;
- RC.gNB[inst]->RU_list[0]=ru;
- //init_precoding_weights(RC.gNB[inst][CC_id]);
- }
-}
-
-void init_gNB(int single_thread_flag,int wait_for_sync) {
- for (int inst=0; instRCconfig_NR_L1\n");
- PHY_VARS_gNB *gNB= RC.gNB[inst];
- gNB->abstraction_flag = false;
- gNB->single_thread_flag = true;
- /*nr_polar_init(&gNB->nrPolar_params,
- NR_POLAR_PBCH_MESSAGE_TYPE,
- NR_POLAR_PBCH_PAYLOAD_BITS,
- NR_POLAR_PBCH_AGGREGATION_LEVEL);*/
- LOG_I(PHY,"Registering with MAC interface module\n");
- AssertFatal((gNB->if_inst = NR_IF_Module_init(inst))!=NULL,"Cannot register interface");
- gNB->if_inst->NR_Schedule_response = nr_schedule_response;
- gNB->if_inst->NR_PHY_config_req = nr_phy_config_request;
- memset((void *)&gNB->UL_INFO,0,sizeof(gNB->UL_INFO));
- memset((void *)&gNB->UL_tti_req,0,sizeof(nfapi_nr_ul_tti_request_t));
- //memset((void *)&gNB->Sched_INFO,0,sizeof(gNB->Sched_INFO));
- LOG_I(PHY,"Setting indication lists\n");
- gNB->UL_INFO.rx_ind.pdu_list = gNB->rx_pdu_list;
- gNB->UL_INFO.crc_ind.crc_list = gNB->crc_pdu_list;
- /*gNB->UL_INFO.sr_ind.sr_indication_body.sr_pdu_list = gNB->sr_pdu_list;
- gNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list = gNB->harq_pdu_list;
- gNB->UL_INFO.cqi_ind.cqi_pdu_list = gNB->cqi_pdu_list;
- gNB->UL_INFO.cqi_ind.cqi_raw_pdu_list = gNB->cqi_raw_pdu_list;*/
- gNB->prach_energy_counter = 0;
- }
-
- LOG_I(PHY,"[nr-softmodem.c] gNB structure allocated\n");
-}
-
-
-void stop_gNB(int nb_inst) {
-}
-
-static void get_options(void) {
- paramdef_t cmdline_params[] = CMDLINE_PARAMS_DESC_GNB ;
- config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
-
- if ( !(CONFIG_ISFLAGSET(CONFIG_ABORT)) ) {
- memset((void *)&RC,0,sizeof(RC));
- /* Read RC configuration file */
- NRRCConfig();
- printf("Configuration: nb_rrc_inst %d, nb_nr_L1_inst %d, nb_ru %hhd\n", RC.nb_nr_inst,RC.nb_nr_L1_inst,RC.nb_RU);
- }
-
- AssertFatal(RC.nb_nr_L1_inst == 1 && RC.nb_RU == 1, "Only one gNB, one RU and one carrier is supported\n");
-}
-
-void set_default_frame_parms(nfapi_nr_config_request_t *config[MAX_NUM_CCs],
- NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
- for (int CC_id=0; CC_idsubframe_config.numerology_index_mu.value =1;
- config[CC_id]->subframe_config.duplex_mode.value = 1; //FDD
- config[CC_id]->subframe_config.dl_cyclic_prefix_type.value = 0; //NORMAL
- config[CC_id]->rf_config.dl_carrier_bandwidth.value = 106;
- config[CC_id]->rf_config.ul_carrier_bandwidth.value = 106;
- config[CC_id]->sch_config.physical_cell_id.value = 0;
- }
-}
-
-static 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 ;
- }
-
- nr_pdcp_module_init(pdcp_initmask, 0);
- pdcp_set_rlc_data_req_func(rlc_data_req);
- pdcp_set_pdcp_data_ind_func(pdcp_data_ind);
-}
-
-void init_main_gNB(void) {
- RCconfig_NR_L1();
- RCconfig_nr_macrlc();
-
- if (RC.nb_nr_L1_inst>0)
- AssertFatal(l1_north_init_gNB()==0,"could not initialize L1 north interface\n");
-
- LOG_I(GNB_APP,"Allocating gNB_RRC_INST for %d instances\n",RC.nb_nr_inst);
- RC.nrrrc = (gNB_RRC_INST **)calloc(RC.nb_nr_inst*sizeof(gNB_RRC_INST *),1);
- LOG_I(PHY, "%s() RC.nb_nr_inst:%d RC.nrrrc:%p\n", __FUNCTION__, RC.nb_nr_inst, RC.nrrrc);
- int gnb_id=0; // only 1 gnb per process, index 0 for now
- RC.nrrrc[gnb_id] = (gNB_RRC_INST *)calloc(sizeof(gNB_RRC_INST),1);
- MessageDef *msg_p = itti_alloc_new_message (TASK_GNB_APP, 0, NRRRC_CONFIGURATION_REQ);
- RCconfig_NRRRC(msg_p,gnb_id, RC.nrrrc[gnb_id]);
- openair_rrc_gNB_configuration(GNB_INSTANCE_TO_MODULE_ID(ITTI_MSG_DESTINATION_INSTANCE(msg_p)), &NRRRC_CONFIGURATION_REQ(msg_p));
- //AssertFatal(itti_create_task(TASK_GNB_APP, gNB_app_task, NULL) >= 0, "");
- AssertFatal(itti_create_task(TASK_RRC_GNB, rrc_gnb_task, NULL) >= 0, "");
- //AssertFatal(itti_create_task(TASK_X2AP, x2ap_task, NULL) >= 0, "");
-}
-
-static void wait_nfapi_init(char *thread_name) {
- printf( "waiting for NFAPI PNF connection and population of global structure (%s)\n",thread_name);
- pthread_mutex_lock( &nfapi_sync_mutex );
-
- while (nfapi_sync_var<0)
- pthread_cond_wait( &nfapi_sync_cond, &nfapi_sync_mutex );
-
- pthread_mutex_unlock(&nfapi_sync_mutex);
- printf( "NFAPI: got sync (%s)\n", thread_name);
-}
-
-void exit_function(const char *file, const char *function, const int line, const char *s) {
- if (s != NULL) {
- printf("%s:%d %s() Exiting OAI softmodem: %s\n",file,line, function, s);
- }
-
- oai_exit = 1;
- sleep(1); //allow lte-softmodem threads to exit first
- exit(1);
-}
-
-void stop_RU(int nb_ru) {
- return;
-}
-
-void OCPconfig_RU(RU_t *ru) {
- int i = 0, j = 0; // Ru and gNB cardinality
- paramdef_t RUParams[] = RUPARAMS_DESC;
- paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0};
- config_getlist( &RUParamList, RUParams, sizeof(RUParams)/sizeof(paramdef_t), NULL);
- AssertFatal( RUParamList.numelt == 1 && RC.nb_nr_L1_inst ==1,"" );
- ru->idx=0;
- ru->nr_frame_parms = (NR_DL_FRAME_PARMS *)calloc(sizeof(NR_DL_FRAME_PARMS),1);
- ru->frame_parms = (LTE_DL_FRAME_PARMS *)calloc(sizeof(LTE_DL_FRAME_PARMS),1);
- ru->if_timing = synch_to_ext_device;
- ru->num_gNB = RUParamList.paramarray[j][RU_ENB_LIST_IDX].numelt;
- ru->gNB_list[i] = &RC.gNB[RUParamList.paramarray[j][RU_ENB_LIST_IDX].iptr[i]][0];
-
- if (config_isparamset(RUParamList.paramarray[j], RU_SDR_ADDRS)) {
- ru->openair0_cfg.sdr_addrs = strdup(*(RUParamList.paramarray[j][RU_SDR_ADDRS].strptr));
- }
-
- if (config_isparamset(RUParamList.paramarray[j], RU_SDR_CLK_SRC)) {
- if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "internal") == 0) {
- ru->openair0_cfg.clock_source = internal;
- LOG_D(PHY, "RU clock source set as internal\n");
- } else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "external") == 0) {
- ru->openair0_cfg.clock_source = external;
- LOG_D(PHY, "RU clock source set as external\n");
- } else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "gpsdo") == 0) {
- ru->openair0_cfg.clock_source = gpsdo;
- LOG_D(PHY, "RU clock source set as gpsdo\n");
- } else {
- LOG_E(PHY, "Erroneous RU clock source in the provided configuration file: '%s'\n", *(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr));
- }
- } else {
- ru->openair0_cfg.clock_source = unset;
- }
-
- if (strcmp(*(RUParamList.paramarray[j][RU_LOCAL_RF_IDX].strptr), "yes") == 0) {
- if ( !(config_isparamset(RUParamList.paramarray[j],RU_LOCAL_IF_NAME_IDX)) ) {
- ru->if_south = REMOTE_IF5; //TBD: max value to avoid to call "ru" functions
- ru->function = gNodeB_3GPP;
- printf("Setting function for RU %d to gNodeB_3GPP\n",j);
- } else {
- }
-
- ru->max_pdschReferenceSignalPower = *(RUParamList.paramarray[j][RU_MAX_RS_EPRE_IDX].uptr);;
- ru->max_rxgain = *(RUParamList.paramarray[j][RU_MAX_RXGAIN_IDX].uptr);
- ru->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt;
-
- for (i=0; inum_bands; i++) ru->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i];
- } //strcmp(local_rf, "yes") == 0
- else {
- }
-
- ru->nb_tx = *(RUParamList.paramarray[j][RU_NB_TX_IDX].uptr);
- ru->nb_rx = *(RUParamList.paramarray[j][RU_NB_RX_IDX].uptr);
- ru->att_tx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr);
- ru->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr);
-
- if (config_isparamset(RUParamList.paramarray[j], RU_BF_WEIGHTS_LIST_IDX)) {
- ru->nb_bfw = RUParamList.paramarray[j][RU_BF_WEIGHTS_LIST_IDX].numelt;
-
- for (i=0; inum_gNB; i++) {
- ru->bw_list[i] = (int32_t *)malloc16_clear((ru->nb_bfw)*sizeof(int32_t));
-
- for (int b=0; bnb_bfw; b++) ru->bw_list[i][b] = RUParamList.paramarray[j][RU_BF_WEIGHTS_LIST_IDX].iptr[b];
- }
- }
-
- return;
-}
-
-// this is for RU with local RF unit
-void fill_rf_config(RU_t *ru, char *rf_config_file) {
- int i;
- NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
- nfapi_nr_config_request_scf_t *gNB_config = &ru->gNB_list[0]->gNB_config; //tmp index
- openair0_config_t *cfg = &ru->openair0_cfg;
- int mu = gNB_config->ssb_config.scs_common.value;
- int N_RB = gNB_config->carrier_config.dl_grid_size[gNB_config->ssb_config.scs_common.value].value;
- fp->threequarter_fs=threequarter_fs;
-
- if (mu == NR_MU_0) { //or if LTE
- if(N_RB == 100) {
- if (fp->threequarter_fs) {
- cfg->sample_rate=23.04e6;
- cfg->samples_per_frame = 230400;
- cfg->tx_bw = 10e6;
- cfg->rx_bw = 10e6;
- } else {
- cfg->sample_rate=30.72e6;
- cfg->samples_per_frame = 307200;
- cfg->tx_bw = 10e6;
- cfg->rx_bw = 10e6;
- }
- } else if(N_RB == 50) {
- cfg->sample_rate=15.36e6;
- cfg->samples_per_frame = 153600;
- cfg->tx_bw = 5e6;
- cfg->rx_bw = 5e6;
- } else if (N_RB == 25) {
- cfg->sample_rate=7.68e6;
- cfg->samples_per_frame = 76800;
- cfg->tx_bw = 2.5e6;
- cfg->rx_bw = 2.5e6;
- } else if (N_RB == 6) {
- cfg->sample_rate=1.92e6;
- cfg->samples_per_frame = 19200;
- cfg->tx_bw = 1.5e6;
- cfg->rx_bw = 1.5e6;
- } else AssertFatal(1==0,"Unknown N_RB %d\n",N_RB);
- } else if (mu == NR_MU_1) {
- if(N_RB == 273) {
- if (fp->threequarter_fs) {
- AssertFatal(0 == 1,"three quarter sampling not supported for N_RB 273\n");
- } else {
- cfg->sample_rate=122.88e6;
- cfg->samples_per_frame = 1228800;
- cfg->tx_bw = 100e6;
- cfg->rx_bw = 100e6;
- }
- } else if(N_RB == 217) {
- if (fp->threequarter_fs) {
- cfg->sample_rate=92.16e6;
- cfg->samples_per_frame = 921600;
- cfg->tx_bw = 80e6;
- cfg->rx_bw = 80e6;
- } else {
- cfg->sample_rate=122.88e6;
- cfg->samples_per_frame = 1228800;
- cfg->tx_bw = 80e6;
- cfg->rx_bw = 80e6;
- }
- } else if(N_RB == 106) {
- if (fp->threequarter_fs) {
- cfg->sample_rate=46.08e6;
- cfg->samples_per_frame = 460800;
- cfg->tx_bw = 40e6;
- cfg->rx_bw = 40e6;
- } else {
- cfg->sample_rate=61.44e6;
- cfg->samples_per_frame = 614400;
- cfg->tx_bw = 40e6;
- cfg->rx_bw = 40e6;
- }
- } else {
- AssertFatal(0==1,"N_RB %d not yet supported for numerology %d\n",N_RB,mu);
- }
- } else if (mu == NR_MU_3) {
- if (N_RB == 66) {
- cfg->sample_rate = 122.88e6;
- cfg->samples_per_frame = 1228800;
- cfg->tx_bw = 100e6;
- cfg->rx_bw = 100e6;
- } else if(N_RB == 32) {
- cfg->sample_rate=61.44e6;
- cfg->samples_per_frame = 614400;
- cfg->tx_bw = 50e6;
- cfg->rx_bw = 50e6;
- }
- } else {
- AssertFatal(0 == 1,"Numerology %d not supported for the moment\n",mu);
- }
-
- if (gNB_config->cell_config.frame_duplex_type.value==TDD)
- cfg->duplex_mode = duplex_mode_TDD;
- else //FDD
- cfg->duplex_mode = duplex_mode_FDD;
-
- cfg->Mod_id = 0;
- cfg->num_rb_dl=N_RB;
- cfg->tx_num_channels=ru->nb_tx;
- cfg->rx_num_channels=ru->nb_rx;
-
- for (i=0; inb_tx; i++) {
- if (ru->if_frequency == 0) {
- cfg->tx_freq[i] = (double)fp->dl_CarrierFreq;
- cfg->rx_freq[i] = (double)fp->ul_CarrierFreq;
- } else {
- cfg->tx_freq[i] = (double)ru->if_frequency;
- cfg->rx_freq[i] = (double)(ru->if_frequency+fp->ul_CarrierFreq-fp->dl_CarrierFreq);
- }
-
- cfg->tx_gain[i] = ru->att_tx;
- cfg->rx_gain[i] = ru->max_rxgain-ru->att_rx;
- cfg->configFilename = rf_config_file;
- printf("channel %d, Setting tx_gain offset %f, rx_gain offset %f, tx_freq %f, rx_freq %f\n",
- i, cfg->tx_gain[i],
- cfg->rx_gain[i],
- cfg->tx_freq[i],
- cfg->rx_freq[i]);
- }
-}
-
-/* this function maps the RU tx and rx buffers to the available rf chains.
- Each rf chain is is addressed by the card number and the chain on the card. The
- rf_map specifies for each antenna port, on which rf chain the mapping should start. Multiple
- antennas are mapped to successive RF chains on the same card. */
-int setup_RU_buffers(RU_t *ru) {
- int i,j;
- int card,ant;
- //uint16_t N_TA_offset = 0;
- NR_DL_FRAME_PARMS *frame_parms;
- nfapi_nr_config_request_scf_t *config = &ru->config;
-
- if (ru) {
- frame_parms = ru->nr_frame_parms;
- printf("setup_RU_buffers: frame_parms = %p\n",frame_parms);
- } else {
- printf("ru pointer is NULL\n");
- return(-1);
- }
-
- int mu = config->ssb_config.scs_common.value;
- int N_RB = config->carrier_config.dl_grid_size[config->ssb_config.scs_common.value].value;
-
- if (config->cell_config.frame_duplex_type.value == TDD) {
- int N_TA_offset = config->carrier_config.uplink_frequency.value < 6000000 ? 400 : 431; // reference samples for 25600Tc @ 30.72 Ms/s for FR1, same @ 61.44 Ms/s for FR2
- double factor=1;
-
- switch (mu) {
- case 0: //15 kHz scs
- AssertFatal(N_TA_offset == 400,"scs_common 15kHz only for FR1\n");
-
- if (N_RB <= 25) factor = .25; // 7.68 Ms/s
- else if (N_RB <=50) factor = .5; // 15.36 Ms/s
- else if (N_RB <=75) factor = 1.0; // 30.72 Ms/s
- else if (N_RB <=100) factor = 1.0; // 30.72 Ms/s
- else AssertFatal(1==0,"Too many PRBS for mu=0\n");
-
- break;
-
- case 1: //30 kHz sc
- AssertFatal(N_TA_offset == 400,"scs_common 30kHz only for FR1\n");
-
- if (N_RB <= 106) factor = 2.0; // 61.44 Ms/s
- else if (N_RB <= 275) factor = 4.0; // 122.88 Ms/s
-
- break;
-
- case 2: //60 kHz scs
- AssertFatal(1==0,"scs_common should not be 60 kHz\n");
- break;
-
- case 3: //120 kHz scs
- AssertFatal(N_TA_offset == 431,"scs_common 120kHz only for FR2\n");
- break;
-
- case 4: //240 kHz scs
- AssertFatal(1==0,"scs_common should not be 60 kHz\n");
-
- if (N_RB <= 32) factor = 1.0; // 61.44 Ms/s
- else if (N_RB <= 66) factor = 2.0; // 122.88 Ms/s
- else AssertFatal(1==0,"N_RB %d is too big for curretn FR2 implementation\n",N_RB);
-
- break;
-
- if (N_RB == 100) ru->N_TA_offset = 624;
- else if (N_RB == 50) ru->N_TA_offset = 624/2;
- else if (N_RB == 25) ru->N_TA_offset = 624/4;
- }
-
- if (frame_parms->threequarter_fs == 1) factor = factor*.75;
-
- ru->N_TA_offset = (int)(N_TA_offset * factor);
- LOG_I(PHY,"RU %d Setting N_TA_offset to %d samples (factor %f, UL Freq %d, N_RB %d)\n",ru->idx,ru->N_TA_offset,factor,
- config->carrier_config.uplink_frequency.value, N_RB);
- } else ru->N_TA_offset = 0;
-
- if (ru->openair0_cfg.mmapped_dma == 1) {
- // replace RX signal buffers with mmaped HW versions
- for (i=0; inb_rx; i++) {
- card = i/4;
- ant = i%4;
- printf("Mapping RU id %u, rx_ant %d, on card %d, chain %d\n",ru->idx,i,ru->rf_map.card+card, ru->rf_map.chain+ant);
- free(ru->common.rxdata[i]);
- ru->common.rxdata[i] = ru->openair0_cfg.rxbase[ru->rf_map.chain+ant];
- printf("rxdata[%d] @ %p\n",i,ru->common.rxdata[i]);
-
- for (j=0; j<16; j++) {
- printf("rxbuffer %d: %x\n",j,ru->common.rxdata[i][j]);
- ru->common.rxdata[i][j] = 16-j;
- }
- }
-
- for (i=0; inb_tx; i++) {
- card = i/4;
- ant = i%4;
- printf("Mapping RU id %u, tx_ant %d, on card %d, chain %d\n",ru->idx,i,ru->rf_map.card+card, ru->rf_map.chain+ant);
- free(ru->common.txdata[i]);
- ru->common.txdata[i] = ru->openair0_cfg.txbase[ru->rf_map.chain+ant];
- printf("txdata[%d] @ %p\n",i,ru->common.txdata[i]);
-
- for (j=0; j<16; j++) {
- printf("txbuffer %d: %x\n",j,ru->common.txdata[i][j]);
- ru->common.txdata[i][j] = 16-j;
- }
- }
- } else { // not memory-mapped DMA
- //nothing to do, everything already allocated in lte_init
- }
-
- return(0);
-}
-int rx_rf(int rxBufOffet, int nbSamples, int nb_rx, int32_t **rxdata, openair0_device *rfdevice, openair0_timestamp *HWtimeStamp) {
- void *rxp[nb_rx];
-
- for (int i=0; itrx_read_func(rfdevice,
- HWtimeStamp,
- rxp,
- nbSamples,
- nb_rx);
-
- if (rxs != nbSamples )
- LOG_E(PHY, "rx_rf: Asked for %d samples, got %d from USRP\n",nbSamples,rxs);
-
- return rxs;
-}
-
-void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
- RU_proc_t *proc = &ru->proc;
- NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
- nfapi_nr_config_request_scf_t *cfg = &ru->gNB_list[0]->gNB_config;
- int i,txsymb;
- int slot_type = nr_slot_select(cfg,frame,slot%fp->slots_per_frame);
- int prevslot_type = nr_slot_select(cfg,frame,(slot+(fp->slots_per_frame-1))%fp->slots_per_frame);
- int nextslot_type = nr_slot_select(cfg,frame,(slot+1)%fp->slots_per_frame);
- int sf_extension = 0; //sf_extension = ru->sf_extension;
- int siglen=fp->get_samples_per_slot(slot,fp);
- int flags=1;
-
- //nr_subframe_t SF_type = nr_slot_select(cfg,slot%fp->slots_per_frame);
- if (slot_type == NR_DOWNLINK_SLOT || slot_type == NR_MIXED_SLOT || IS_SOFTMODEM_RFSIM) {
- if(slot_type == NR_MIXED_SLOT) {
- txsymb = 0;
-
- for(int symbol_count =0; symbol_counttdd_table.max_tdd_periodicity_list[slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value==0)
- txsymb++;
- }
-
- AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb);
-
- if(slot%(fp->slots_per_subframe/2))
- siglen = txsymb * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
- else
- siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0) + (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
-
- //+ ru->end_of_burst_delay;
- flags=3; // end of burst
- }
-
- if (cfg->cell_config.frame_duplex_type.value == TDD &&
- slot_type == NR_DOWNLINK_SLOT &&
- prevslot_type == NR_UPLINK_SLOT) {
- flags = 2; // start of burst
- }
-
- if (cfg->cell_config.frame_duplex_type.value == TDD &&
- slot_type == NR_DOWNLINK_SLOT &&
- nextslot_type == NR_UPLINK_SLOT) {
- flags = 3; // end of burst
- }
-
- if (fp->freq_range==nr_FR2) {
- // the beam index is written in bits 8-10 of the flags
- // bit 11 enables the gpio programming
- int beam=0;
-
- if (slot==0) beam = 11; //3 for boresight & 8 to enable
-
- /*
- if (slot==0 || slot==40) beam=0&8;
- if (slot==10 || slot==50) beam=1&8;
- if (slot==20 || slot==60) beam=2&8;
- if (slot==30 || slot==70) beam=3&8;
- */
- flags |= beam<<8;
- }
-
- void *txp[ru->nb_tx];
-
- for (i=0; inb_tx; i++)
- txp[i] = (void *)&ru->common.txdata[i][fp->get_samples_slot_timestamp(slot,fp,0)-sf_extension];
-
- // prepare tx buffer pointers
- unsigned int txs = ru->rfdevice.trx_write_func(&ru->rfdevice,
- timestamp+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension,
- txp,
- siglen+sf_extension,
- ru->nb_tx,
- flags);
- LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, slot %d\n",ru->idx,
- (long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot);
- AssertFatal(txs == siglen+sf_extension,"TX : Timeout (sent %u/%d)\n", txs, siglen);
- }
-}
-
-static void *ru_thread( void *param ) {
- RU_t *ru = (RU_t *)param;
- NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
- LOG_I(PHY,"Starting RU %d (%s,%s),\n",ru->idx,NB_functions[ru->function],NB_timing[ru->if_timing]);
- nr_dump_frame_parms(fp);
- AssertFatal(openair0_device_load(&ru->rfdevice,&ru->openair0_cfg)==0,"Cannot connect to local radio\n");
- AssertFatal(ru->rfdevice.trx_start_func(&ru->rfdevice) == 0,"Could not start the RF device\n");
- int64_t slot=-1;
- int64_t nextHWTSshouldBe=0, nextRxTSlogical=0;
- // weird globals, used in NR_IF_Module.c
- sf_ahead = (uint16_t) ceil((float)6/(0x01<numerology_index));
- sl_ahead = sf_ahead*fp->slots_per_subframe;
-
- // This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices
-
- while (!oai_exit) {
- int nextSlot=(slot+1)%fp->slots_per_frame;
- uint32_t samples_per_slot = fp->get_samples_per_slot(nextSlot,fp);
- int rxBuffOffset=fp->get_samples_slot_timestamp(nextSlot,fp,0);
- AssertFatal(rxBuffOffset + samples_per_slot <= fp->samples_per_frame, "Will read outside allocated buffer\n");
- int samples=fp->get_samples_per_slot(nextSlot,fp);
- openair0_timestamp HWtimeStamp=0; //for multi RU
- int rxs=rx_rf(rxBuffOffset,
- samples,
- ru->nb_rx,
- ru->common.rxdata,
- &ru->rfdevice,
- &HWtimeStamp);
- LOG_D(PHY,"Reading %d samples for slot %d\n",samples_per_slot,nextSlot);
-
- if ( HWtimeStamp != nextHWTSshouldBe)
- LOG_E(HW,"reading a stream must be continuous, %ld, %ld\n", HWtimeStamp, nextHWTSshouldBe);
-
- nextHWTSshouldBe=HWtimeStamp+rxs;
- ru->proc.timestamp_rx=nextRxTSlogical;
- nextRxTSlogical+=samples_per_slot;
- int64_t HW_to_logical_RxTSoffset=(int64_t)HWtimeStamp-(int64_t)ru->proc.timestamp_rx;
- ru->proc.frame_rx = (ru->proc.timestamp_rx / (fp->samples_per_subframe*10))&1023;
- uint32_t idx_sf = ru->proc.timestamp_rx / fp->samples_per_subframe;
- float offsetInSubframe=ru->proc.timestamp_rx % fp->samples_per_subframe;
- ru->proc.tti_rx = (idx_sf * fp->slots_per_subframe +
- lroundf(offsetInSubframe / fp->samples_per_slot0))%
- fp->slots_per_frame;
- LOG_D(PHY,"RU %d/%d TS %llu (off %d), frame %d, slot %d.%d / %d\n",
- ru->idx, 0,
- (unsigned long long int)ru->proc.timestamp_rx,
- (int)ru->ts_offset,ru->proc.frame_rx,ru->proc.tti_rx,ru->proc.tti_tx,fp->slots_per_frame);
- int slot_type = nr_slot_select(&ru->gNB_list[0]->gNB_config,ru->proc.frame_rx,ru->proc.tti_rx);
-
- if (slot_type == NR_UPLINK_SLOT || slot_type == NR_MIXED_SLOT) {
- nr_fep_full(ru,ru->proc.tti_rx);
-
- for (int aa=0; aanb_rx; aa++)
- memcpy((void *)RC.gNB[0]->common_vars.rxdataF[aa],
- (void *)ru->common.rxdataF[aa], fp->symbols_per_slot*fp->ofdm_symbol_size*sizeof(int32_t));
-
- LOG_D(PHY, "rxdataF energy: %d\n", signal_energy(ru->common.rxdataF[0], fp->symbols_per_slot*fp->ofdm_symbol_size));
- }
-
- gNB_L1_proc_t *gNBproc=&RC.gNB[0][0].proc;
- gNB_L1_rxtx_proc_t *L1_proc = &gNBproc->L1_proc;
- NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
- gNBproc->timestamp_rx = ru->proc.timestamp_rx;
- L1_proc->frame_rx = gNBproc->frame_rx = gNBproc->frame_prach = ru->proc.frame_rx =
- (ru->proc.timestamp_rx / (fp->samples_per_subframe*10))&1023;
- L1_proc->slot_rx = gNBproc->slot_rx = gNBproc->slot_prach =
- ru->proc.tti_rx; // computed before in caller function
- L1_proc->timestamp_tx = gNBproc->timestamp_tx = ru->proc.timestamp_tx =
- ru->proc.timestamp_rx +
- sf_ahead*fp->samples_per_subframe;
- L1_proc->frame_tx = gNBproc->frame_tx = ru->proc.frame_tx =
- (gNBproc->timestamp_tx / (fp->samples_per_subframe*10))&1023;
- L1_proc->slot_tx = ru->proc.tti_tx =
- (L1_proc->slot_rx + sl_ahead)%fp->slots_per_frame;
-
- if (ocp_rxtx(&RC.gNB[0][0],L1_proc) < 0)
- LOG_E(PHY,"gNB %d CC_id %d failed during execution\n",RC.gNB[0][0].Mod_id,RC.gNB[0][0].CC_id);
-
- // do TX front-end processing if needed (precoding and/or IDFTs)
- //ru->feptx_prec(ru,proc->frame_tx,proc->tti_tx);
- nr_feptx_prec(ru,ru->proc.frame_tx,ru->proc.tti_tx);
- // do OFDM with/without TX front-end processing if needed
- //ru->feptx_ofdm
- nfapi_nr_config_request_scf_t *cfg = &ru->gNB_list[0]->gNB_config;
-
- if (nr_slot_select(cfg,ru->proc.frame_tx, ru->proc.tti_tx ) != NR_UPLINK_SLOT) {
- int aa=0; // antenna 0 hardcoded
- NR_DL_FRAME_PARMS *fp=ru->nr_frame_parms;
- nr_feptx0(ru,ru->proc.tti_tx,0,fp->symbols_per_slot,aa);
- int *txdata = &ru->common.txdata[aa][fp->get_samples_slot_timestamp(ru->proc.tti_tx,fp,0)];
- int slot_sizeF = (fp->ofdm_symbol_size)*
- ((NFAPI_CP_NORMAL == 1) ? 12 : 14);
- LOG_D(PHY,"feptx_ofdm (TXPATH): frame %d, slot %d: txp (time %ld) %d dB, txp (freq) %d dB\n",
- ru->proc.frame_tx,ru->proc.tti_tx,ru->proc.timestamp_tx,
- dB_fixed(signal_energy((int32_t *)txdata,fp->get_samples_per_slot(ru->proc.tti_tx,fp))),
- dB_fixed(signal_energy_nodc(ru->common.txdataF_BF[aa],2*slot_sizeF)));
- }
-
- // do outgoing fronthaul (south) if needed
- tx_rf(ru,ru->proc.frame_tx,ru->proc.tti_tx,ru->proc.timestamp_tx+HW_to_logical_RxTSoffset);
- slot++;
- }
-
- printf( "Exiting ru_thread \n");
- ru->rfdevice.trx_end_func(&ru->rfdevice);
- static int ru_thread_status = 0;
- return &ru_thread_status;
-}
-
-void launch_NR_RU(RU_t *ru, char *rf_config_file) {
- LOG_I(PHY,"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",
- RC.nb_nr_L1_inst,RC.nb_RU,get_nprocs());
- LOG_D(PHY,"Process RUs RC.nb_RU:%d\n",RC.nb_RU);
-
- for (int ru_id=0; ru_idrf_config_file = rf_config_file;
- ru->idx = ru_id;
- ru->ts_offset = 0;
- // use gNB_list[0] as a reference for RU frame parameters
- // NOTE: multiple CC_id are not handled here yet!
- LOG_D(PHY, "%s() RC.ru[%d].num_gNB:%d ru->gNB_list[0]:%p rf_config_file:%s\n",
- __FUNCTION__, ru_id, ru->num_gNB, ru->gNB_list[0], ru->rf_config_file);
- LOG_E(PHY,"ru->gNB_list ru->num_gNB hardcoded: one RU connected to carrier 0 of gNB 0\n");
- ru->gNB_list[0] = &RC.gNB[0][0];
- ru->num_gNB=1;
- LOG_I(PHY,"Copying frame parms from gNB in RC to ru %d and frame_parms in ru\n",ru->idx);
- RU_proc_t *proc = &ru->proc;
- threadCreate( &proc->pthread_FH, ru_thread, (void *)ru, "MainLoop", -1, OAI_PRIORITY_RT_MAX );
- }
-}
-
-void init_eNB_afterRU(void) {
- AssertFatal(false,"");
-}
-
-int main( int argc, char **argv ) {
- AssertFatal(load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY),
- "[SOFTMODEM] Error, configuration module init failed\n");
- logInit();
-#ifndef PACKAGE_VERSION
-# define PACKAGE_VERSION "UNKNOWN"
-#endif
- LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
- set_latency_target();
- get_options ();
- get_common_options(SOFTMODEM_GNB_BIT );
- AssertFatal(!CONFIG_ISFLAGSET(CONFIG_ABORT),"Getting configuration failed\n");
- cpuf=get_cpu_freq_GHz();
- itti_init(TASK_MAX, tasks_info);
- set_taus_seed (0);
- init_opt();
- init_pdcp();
- init_main_gNB();
- init_gNB(true, wait_for_sync);
- /* Start the agent. If it is turned off in the configuration, it won't start */
- RCconfig_nr_flexran();
-
- for (int i = 0; i < RC.nb_nr_L1_inst; i++) {
- flexran_agent_start(i);
- }
-
- /*
- *nfapi stuff very buggy in 4G, not yet implemented in 5G
- */
- // init UE_PF_PO and mutex lock (paging from S1AP)
- pthread_mutex_init(&ue_pf_po_mutex, NULL);
- printf("NFAPI*** - mutex and cond created - will block shortly for completion of PNF connection\n");
- pthread_cond_init(&nfapi_sync_cond,NULL);
- pthread_mutex_init(&nfapi_sync_mutex, NULL);
- const char *nfapi_mode_str[] = {
- "MONOLITHIC", "PNF", "VNF",
- };
- AssertFatal(nfapi_mode < 3,"");
- printf("NFAPI MODE:%s\n", nfapi_mode_str[nfapi_mode]);
-
- if (nfapi_mode==NFAPI_MODE_VNF) // VNF
- wait_nfapi_init("main?");
-
- for (int i=0; iconfigured, "Remain threads to manage\n");
-
- printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU);
- config_sync_var=0;
-
- if (nfapi_mode==NFAPI_MODE_PNF) { // PNF
- wait_nfapi_init("main?");
- }
-
- printf("wait RUs\n");
- printf("ALL RUs READY!\n");
- printf("RC.nb_RU:%d\n", RC.nb_RU);
- // once all RUs are ready initialize the rest of the gNBs ((dependence on final RU parameters after configuration)
- printf("ALL RUs ready - init gNBs\n");
- LOG_E(PHY,"configuring RU from file, hardcoded one gNB for one RU, one carrier\n");
- RU_t ru= {0};
- OCPconfig_RU(&ru);
- ru.nr_frame_parms->threequarter_fs=threequarter_fs;
- fill_rf_config(&ru,ru.rf_config_file);
- init_gNB_phase2(&ru);
- memcpy((void *)ru.nr_frame_parms,&RC.gNB[0][0].frame_parms,sizeof(NR_DL_FRAME_PARMS));
- memcpy((void *)&ru.config,(void *)&RC.gNB[0]->gNB_config,sizeof(ru.config));
- AssertFatal(setup_RU_buffers(&ru)==0,"Inconsistent configuration");
- nr_phy_init_RU(&ru);
- init_gNB_proc(0); // only instance 0 (one gNB per process)
-
- if (RC.nb_RU >0) {
- printf("Initializing RU threads\n");
- launch_NR_RU(&ru, get_softmodem_params()->rf_config_file);
- }
-
- if (opp_enabled ==1) {
- pthread_t t;
- threadCreate(&t, process_stats_thread,
- (void *)NULL, "time_meas", -1, OAI_PRIORITY_RT_LOW);
- }
-
- if(IS_SOFTMODEM_DOSCOPE) {
- scopeParms_t tmp= {&argc, argv, &ru, RC.gNB[0]};
- load_softscope("nr",&tmp);
- }
-
- while(!oai_exit)
- sleep(1);
-
- logClean();
- printf("Bye.\n");
- return 0;
-}
diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h
index 16014c6024..8d6735b199 100644
--- a/executables/softmodem-common.h
+++ b/executables/softmodem-common.h
@@ -99,6 +99,7 @@ extern "C"
#define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n"
#define CONFIG_HLP_NFAPI "Change the nFAPI mode for NR\n"
#define CONFIG_L1_EMULATOR "Run in L1 emulated mode (disable PHY layer)\n"
+#define CONFIG_HLP_CONTINUOUS_TX "perform continuous transmission, even in TDD mode (to work around USRP issues)\n"
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters common to eNodeB and UE */
@@ -120,13 +121,13 @@ extern "C"
#define TIMING_SOURCE softmodem_params.timing_source
#define SEND_DMRSSYNC softmodem_params.send_dmrs_sync
#define USIM_TEST softmodem_params.usim_test
-#define USE_256QAM_TABLE softmodem_params.use_256qam_table
#define PRB_INTERPOLATION softmodem_params.prb_interpolation
#define NFAPI softmodem_params.nfapi
#define NSA softmodem_params.nsa
#define NODE_NUMBER softmodem_params.node_number
#define NON_STOP softmodem_params.non_stop
#define EMULATE_L1 softmodem_params.emulate_l1
+#define CONTINUOUS_TX softmodem_params.continuous_tx
#define DEFAULT_RFCONFIG_FILE "/usr/local/etc/syriq/ue.band7.tm1.PRB100.NR40.dat";
@@ -158,7 +159,6 @@ extern int usrp_tx_thread;
{"basicsim", CONFIG_HLP_RFSIM, PARAMFLAG_BOOL, uptr:&basicsim, defintval:0, TYPE_INT, 0}, \
{"nokrnmod", CONFIG_HLP_NOKRNMOD, PARAMFLAG_BOOL, uptr:&nokrnmod, defintval:0, TYPE_INT, 0}, \
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, uptr:&nonbiot, defuintval:0, TYPE_INT, 0}, \
- {"use-256qam-table", CONFIG_HLP_256QAM, PARAMFLAG_BOOL, iptr:&USE_256QAM_TABLE, defintval:0, TYPE_INT, 0}, \
{"nsa", CONFIG_HLP_NSA, PARAMFLAG_BOOL, iptr:&NSA, defintval:0, TYPE_INT, 0}, \
{"node-number", NULL, 0, u16ptr:&NODE_NUMBER, defuintval:0, TYPE_UINT16, 0}, \
{"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \
@@ -166,6 +166,7 @@ extern int usrp_tx_thread;
{"nfapi", CONFIG_HLP_NFAPI, 0, u8ptr:&nfapi_mode, defintval:0, TYPE_UINT8, 0}, \
{"non-stop", CONFIG_HLP_NONSTOP, PARAMFLAG_BOOL, iptr:&NON_STOP, defintval:0, TYPE_INT, 0}, \
{"emulate-l1", CONFIG_L1_EMULATOR, PARAMFLAG_BOOL, iptr:&EMULATE_L1, defintval:0, TYPE_INT, 0}, \
+ {"continuous-tx", CONFIG_HLP_CONTINUOUS_TX,PARAMFLAG_BOOL, iptr:&CONTINUOUS_TX, defintval:0, TYPE_INT, 0}, \
}
#define CONFIG_HLP_NSA "Enable NSA mode \n"
@@ -250,13 +251,13 @@ typedef struct {
uint32_t timing_source;
int hw_timing_advance;
uint32_t send_dmrs_sync;
- int use_256qam_table;
int prb_interpolation;
uint8_t nfapi;
int nsa;
uint16_t node_number;
int non_stop;
int emulate_l1;
+ int continuous_tx;
} softmodem_params_t;
extern uint64_t get_softmodem_optmask(void);
diff --git a/executables/transport_split.c b/executables/transport_split.c
index f380eb90e3..e7199637cc 100644
--- a/executables/transport_split.c
+++ b/executables/transport_split.c
@@ -156,7 +156,7 @@ int receiveSubFrame(UDPsock_t *sock, void *bufferZone, int bufferSize, uint16_t
int sendSubFrame(UDPsock_t *sock, void *bufferZone, ssize_t secondHeaderSize, uint16_t contentType) {
commonUDP_t *UDPheader=(commonUDP_t *)bufferZone ;
UDPheader->contentType=contentType;
- UDPheader->senderClock=rdtsc();
+ UDPheader->senderClock=rdtsc_oai();
int nbBlocks=UDPheader->nbBlocks;
int blockId=0;
diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c
index 58d649d011..41b2d4fe84 100644
--- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c
+++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c
@@ -117,7 +117,7 @@ int test_ldpc(short No_iteration,
sigma = 1.0/sqrt(2*SNR);
opp_enabled=1;
//short test_input[block_length];
- unsigned char *test_input[MAX_NUM_NR_DLSCH_SEGMENTS]={NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};;
+ unsigned char *test_input[MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS]={NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};;
//short *c; //padded codeword
unsigned char estimated_output[MAX_NUM_DLSCH_SEGMENTS][block_length];
memset(estimated_output, 0, sizeof(estimated_output));
diff --git a/openair1/PHY/CODING/crc_byte.c b/openair1/PHY/CODING/crc_byte.c
index 7e37abcf81..9ad18cc1a6 100644
--- a/openair1/PHY/CODING/crc_byte.c
+++ b/openair1/PHY/CODING/crc_byte.c
@@ -72,10 +72,10 @@ unsigned int crcbit (unsigned char * inputptr,
unsigned int i, crc = 0, c;
while (octetlen-- > 0) {
- c = (*inputptr++) << 24;
+ c = ((unsigned int)(*inputptr++)) << 24;
for (i = 8; i != 0; i--) {
- if ((1 << 31) & (c ^ crc))
+ if ((1U << 31) & (c ^ crc))
crc = (crc << 1) ^ poly;
else
crc <<= 1;
diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h
index 99b6f75f93..b7b15b5d33 100644
--- a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h
+++ b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h
@@ -31,7 +31,7 @@
#ifndef __NR_LDPC_TYPES__H__
#define __NR_LDPC_TYPES__H__
-#include "PHY/TOOLS/time_meas.h"
+#include "time_meas.h"
#include "nrLDPCdecoder_defs.h"
// ==============================================================================
// TYPES
diff --git a/openair1/PHY/CODING/nrLDPC_defs.h b/openair1/PHY/CODING/nrLDPC_defs.h
index 0d7ff9ef9f..a6fb44cb0d 100644
--- a/openair1/PHY/CODING/nrLDPC_defs.h
+++ b/openair1/PHY/CODING/nrLDPC_defs.h
@@ -57,7 +57,7 @@ typedef struct {
/// Number of "Filler" bits
uint32_t F;
/// LDPC-code outputs
- uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS];
+ uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS];
} encoder_implemparams_t;
#define INIT0_LDPCIMPLEMPARAMS {0,0,0,NULL,NULL,NULL,NULL}
typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params *p_decParams, int8_t *p_llr, int8_t *p_out);
diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c
index 69d2ac4972..d36398a13a 100644
--- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c
+++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c
@@ -33,7 +33,6 @@
#include
#include
#include
-#include
#include "assertions.h"
#include "common/utils/LOG/log.h"
diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c
index 76f92574ba..d5669fbbab 100644
--- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c
+++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c
@@ -35,7 +35,6 @@
#include
#include
#include
-#include
#include "defs.h"
#include "assertions.h"
#include "openair1/PHY/CODING/nrLDPC_defs.h"
@@ -280,4 +279,4 @@ int ldpc_encoder_orig(unsigned char *test_input,unsigned char *channel_input,int
int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc,int Kb,short block_length, short BG, encoder_implemparams_t *impp) {
return ldpc_encoder_orig(test_input[0],channel_input[0],Zc,Kb,block_length,BG,impp->gen_code);
-}
\ No newline at end of file
+}
diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c
index bef5b291dc..73c165a2c8 100644
--- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c
+++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c
@@ -36,7 +36,7 @@
#include
#include "assertions.h"
#include "common/utils/LOG/log.h"
-#include "PHY/TOOLS/time_meas.h"
+#include "time_meas.h"
#include "defs.h"
#include "ldpc384_byte.c"
diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c
index 07062f6123..d05ced18c6 100644
--- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c
+++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c
@@ -33,10 +33,9 @@
#include
#include
#include
-#include
#include "assertions.h"
#include "common/utils/LOG/log.h"
-#include "PHY/TOOLS/time_meas.h"
+#include "time_meas.h"
#include "openair1/PHY/CODING/nrLDPC_defs.h"
#include "ldpc_encode_parity_check.c"
#include "ldpc_generate_coefficient.c"
diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c
index 6fa9c5ff53..958ef5aca7 100644
--- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c
+++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c
@@ -33,10 +33,9 @@
#include
#include
#include
-#include
#include "assertions.h"
#include "common/utils/LOG/log.h"
-#include "PHY/TOOLS/time_meas.h"
+#include "time_meas.h"
#include "openair1/PHY/CODING/nrLDPC_defs.h"
#include "ldpc_encode_parity_check.c"
#include "ldpc_generate_coefficient.c"
diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
index 15d4481eb6..9ef8cbfe65 100644
--- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
+++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
@@ -33,10 +33,9 @@
#include
#include
#include
-#include
#include "assertions.h"
#include "common/utils/LOG/log.h"
-#include "PHY/TOOLS/time_meas.h"
+#include "time_meas.h"
#include "openair1/PHY/CODING/nrLDPC_defs.h"
#include "ldpc_encode_parity_check.c"
diff --git a/openair1/PHY/CODING/nr_segmentation.c b/openair1/PHY/CODING/nr_segmentation.c
index 0eede23766..281e61cda5 100644
--- a/openair1/PHY/CODING/nr_segmentation.c
+++ b/openair1/PHY/CODING/nr_segmentation.c
@@ -63,11 +63,6 @@ int32_t nr_segmentation(unsigned char *input_buffer,
#endif
}
- if ((*C)>MAX_NUM_NR_DLSCH_SEGMENTS) {
- LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime);
- return(-1);
- }
-
// Find K+
Kprime = Bprime/(*C);
diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c
index bf360d347a..ff3bdf3b8e 100644
--- a/openair1/PHY/INIT/nr_init.c
+++ b/openair1/PHY/INIT/nr_init.c
@@ -117,12 +117,15 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
gNB->bad_pucch = 0;
+ // ceil(((NB_RB<<1)*3)/32) // 3 RE *2(QPSK)
+ int pdcch_dmrs_init_length = (((fp->N_RB_DL<<1)*3)>>5)+1;
+
for (int slot=0; slotslots_per_frame; slot++) {
pdcch_dmrs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *));
AssertFatal(pdcch_dmrs[slot]!=NULL, "NR init: pdcch_dmrs for slot %d - malloc failed\n", slot);
for (int symb=0; symbsymbols_per_slot; symb++) {
- pdcch_dmrs[slot][symb] = (uint32_t *)malloc16(NR_MAX_PDCCH_DMRS_INIT_LENGTH_DWORD*sizeof(uint32_t));
+ pdcch_dmrs[slot][symb] = (uint32_t *)malloc16(pdcch_dmrs_init_length*sizeof(uint32_t));
LOG_D(PHY,"pdcch_dmrs[%d][%d] %p\n",slot,symb,pdcch_dmrs[slot][symb]);
AssertFatal(pdcch_dmrs[slot][symb]!=NULL, "NR init: pdcch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb);
}
@@ -136,16 +139,19 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
gNB->nr_gold_pdsch_dmrs = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***));
uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs;
+ // ceil(((NB_RB*6(k)*2(QPSK)/32) // 3 RE *2(QPSK)
+ int pdsch_dmrs_init_length = ((fp->N_RB_DL*12)>>5)+1;
for (int slot=0; slotslots_per_frame; slot++) {
pdsch_dmrs[slot] = (uint32_t ***)malloc16(fp->symbols_per_slot*sizeof(uint32_t **));
AssertFatal(pdsch_dmrs[slot]!=NULL, "NR init: pdsch_dmrs for slot %d - malloc failed\n", slot);
+ int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
for (int symb=0; symbsymbols_per_slot; symb++) {
- pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_MAX_NB_CODEWORDS*sizeof(uint32_t *));
+ pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(nb_codewords*sizeof(uint32_t *));
AssertFatal(pdsch_dmrs[slot][symb]!=NULL, "NR init: pdsch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb);
- for (int q=0; qnr_gold_pusch_dmrs;
+ // ceil(((NB_RB*6(k)*2(QPSK)/32) // 3 RE *2(QPSK)
+ int pusch_dmrs_init_length = ((fp->N_RB_UL*12)>>5)+1;
for(int nscid=0; nscid<2; nscid++) {
pusch_dmrs[nscid] = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **));
AssertFatal(pusch_dmrs[nscid]!=NULL, "NR init: pusch_dmrs for nscid %d - malloc failed\n", nscid);
@@ -167,7 +175,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
AssertFatal(pusch_dmrs[nscid][slot]!=NULL, "NR init: pusch_dmrs for slot %d - malloc failed\n", slot);
for (int symb=0; symbsymbols_per_slot; symb++) {
- pusch_dmrs[nscid][slot][symb] = (uint32_t *)malloc16(NR_MAX_PUSCH_DMRS_INIT_LENGTH_DWORD*sizeof(uint32_t));
+ pusch_dmrs[nscid][slot][symb] = (uint32_t *)malloc16(pusch_dmrs_init_length*sizeof(uint32_t));
AssertFatal(pusch_dmrs[nscid][slot][symb]!=NULL, "NR init: pusch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb);
}
}
@@ -182,12 +190,15 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
uint32_t ***csi_rs = gNB->nr_gold_csi_rs;
AssertFatal(csi_rs!=NULL, "NR init: csi reference signal malloc failed\n");
+ // ceil((NB_RB*8(max allocation per RB)*2(QPSK))/32)
+ int csi_dmrs_init_length = ((fp->N_RB_DL<<4)>>5)+1;
+
for (int slot=0; slotslots_per_frame; slot++) {
csi_rs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *));
AssertFatal(csi_rs[slot]!=NULL, "NR init: csi reference signal for slot %d - malloc failed\n", slot);
for (int symb=0; symbsymbols_per_slot; symb++) {
- csi_rs[slot][symb] = (uint32_t *)malloc16(NR_MAX_CSI_RS_INIT_LENGTH_DWORD*sizeof(uint32_t));
+ csi_rs[slot][symb] = (uint32_t *)malloc16(csi_dmrs_init_length*sizeof(uint32_t));
AssertFatal(csi_rs[slot][symb]!=NULL, "NR init: csi reference signal for slot %d symbol %d - malloc failed\n", slot, symb);
}
}
@@ -196,6 +207,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
for (int id=0; idnr_srs_info[id] = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t));
+ gNB->nr_srs_info[id]->sc_list = (uint16_t *) malloc16_clear(6*fp->N_RB_UL*sizeof(uint16_t));
gNB->nr_srs_info[id]->srs_generated_signal = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
gNB->nr_srs_info[id]->noise_power = (uint32_t*)malloc16_clear(sizeof(uint32_t));
gNB->nr_srs_info[id]->srs_received_signal = (int32_t **)malloc16(Prx*sizeof(int32_t*));
@@ -314,9 +326,10 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
free_and_zero(pdcch_dmrs);
uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs;
+ int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
for (int slot = 0; slot < fp->slots_per_frame; slot++) {
for (int symb = 0; symb < fp->symbols_per_slot; symb++) {
- for (int q = 0; q < NR_MAX_NB_CODEWORDS; q++)
+ for (int q = 0; q < nb_codewords; q++)
free_and_zero(pdsch_dmrs[slot][symb][q]);
free_and_zero(pdsch_dmrs[slot][symb]);
}
@@ -351,6 +364,7 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time[i]);
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i]);
}
+ free_and_zero(gNB->nr_srs_info[id]->sc_list);
free_and_zero(gNB->nr_srs_info[id]->srs_generated_signal);
free_and_zero(gNB->nr_srs_info[id]->noise_power);
free_and_zero(gNB->nr_srs_info[id]->srs_received_signal);
@@ -559,9 +573,10 @@ void init_DLSCH_struct(PHY_VARS_gNB *gNB, processingData_L1tx_t *msg) {
uint16_t grid_size = cfg->carrier_config.dl_grid_size[fp->numerology_index].value;
msg->num_pdsch_slot = 0;
+ int num_cw = NR_MAX_NB_LAYERS > 4? 2:1;
for (int i=0; inumber_of_nr_dlsch_max; i++) {
LOG_I(PHY,"Allocating Transport Channel Buffers for DLSCH %d/%d\n",i,gNB->number_of_nr_dlsch_max);
- for (int j=0; j<2; j++) {
+ for (int j=0; jdlsch[i][j] = new_gNB_dlsch(fp,1,16,NSOFT,0,grid_size);
AssertFatal(msg->dlsch[i][j]!=NULL,"Can't initialize dlsch %d \n", i);
}
@@ -573,9 +588,10 @@ void reset_DLSCH_struct(const PHY_VARS_gNB *gNB, processingData_L1tx_t *msg)
const NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
const nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
const uint16_t grid_size = cfg->carrier_config.dl_grid_size[fp->numerology_index].value;
+ int num_cw = NR_MAX_NB_LAYERS > 4? 2:1;
for (int i=0; inumber_of_nr_dlsch_max; i++)
- for (int j=0; j<2; j++)
- free_gNB_dlsch(&msg->dlsch[i][j], grid_size);
+ for (int j=0; jdlsch[i][j], grid_size, fp);
}
void init_nr_transport(PHY_VARS_gNB *gNB) {
@@ -600,22 +616,16 @@ void init_nr_transport(PHY_VARS_gNB *gNB) {
LOG_I(PHY,"Allocating Transport Channel Buffer for ULSCH %d/%d\n",i,gNB->number_of_nr_ulsch_max);
- for (int j=0; j<2; j++) {
- // ULSCH for data
- gNB->ulsch[i][j] = new_gNB_ulsch(MAX_LDPC_ITERATIONS, fp->N_RB_UL);
-
- if (!gNB->ulsch[i][j]) {
- LOG_E(PHY,"Can't get gNB ulsch structures\n");
- exit(-1);
- }
+ gNB->ulsch[i] = new_gNB_ulsch(MAX_LDPC_ITERATIONS, fp->N_RB_UL);
+ if (!gNB->ulsch[i]) {
+ LOG_E(PHY,"Can't get gNB ulsch structures\n");
+ exit(-1);
}
-
}
gNB->rx_total_gain_dB=130;
-
//fp->pucch_config_common.deltaPUCCH_Shift = 1;
}
@@ -630,6 +640,5 @@ void reset_nr_transport(PHY_VARS_gNB *gNB)
free_gNB_srs(gNB->srs[i]);
for (int i=0; inumber_of_nr_ulsch_max; i++)
- for (int j=0; j<2; j++)
- free_gNB_ulsch(&gNB->ulsch[i][j], fp->N_RB_UL);
+ free_gNB_ulsch(&gNB->ulsch[i], fp->N_RB_UL);
}
diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c
index a27c541c80..75315187d9 100644
--- a/openair1/PHY/INIT/nr_init_ue.c
+++ b/openair1/PHY/INIT/nr_init_ue.c
@@ -57,6 +57,7 @@ extern uint16_t beta_cqi[16];
*/
void phy_init_nr_ue__PDSCH(NR_UE_PDSCH *const pdsch,
const NR_DL_FRAME_PARMS *const fp) {
+
AssertFatal( pdsch, "pdsch==0" );
pdsch->pmi_ext = (uint8_t *)malloc16_clear( fp->N_RB_DL );
pdsch->llr[0] = (int16_t *)malloc16_clear( (8*(3*8*6144))*sizeof(int16_t) );
@@ -154,21 +155,6 @@ void phy_term_nr_ue__PDSCH(NR_UE_PDSCH* pdsch, const NR_DL_FRAME_PARMS *const fp
free_and_zero(pdsch->dl_ch_ptrs_estimates_ext);
}
-void phy_init_nr_ue_PUSCH(NR_UE_PUSCH *const pusch,
- const NR_DL_FRAME_PARMS *const fp) {
- AssertFatal( pusch, "pusch==0" );
-
- for (int i=0; itxdataF_layers[i] = (int32_t *)malloc16_clear(NR_MAX_PUSCH_ENCODED_LENGTH*sizeof(int32_t));
- }
-}
-
-void phy_term_nr_ue_PUSCH(NR_UE_PUSCH *pusch)
-{
- for (int i = 0; i < NR_MAX_NB_LAYERS; i++)
- free_and_zero(pusch->txdataF_layers[i]);
-}
-
int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
{
// create shortcuts
@@ -176,13 +162,15 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
NR_UE_COMMON *const common_vars = &ue->common_vars;
NR_UE_PBCH **const pbch_vars = ue->pbch_vars;
NR_UE_PRACH **const prach_vars = ue->prach_vars;
+ int i,j,k,l,slot,symb;
+
NR_UE_SRS **const srs_vars = ue->srs_vars;
- int i,j,k,l,slot,symb,q;
int gNB_id;
int th_id;
- uint32_t ****pusch_dmrs;
+
LOG_I(PHY, "Initializing UE vars for gNB TXant %u, UE RXant %u\n", fp->nb_antennas_tx, fp->nb_antennas_rx);
+
phy_init_nr_top(ue);
// many memory allocation sizes are hard coded
AssertFatal( fp->nb_antennas_rx <= 4, "hard coded allocation for ue_common_vars->dl_ch_estimates[gNB_id]" );
@@ -210,15 +198,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
// init NR modulation lookup tables
nr_generate_modulation_table();
- /////////////////////////PUSCH init/////////////////////////
- ///////////
- for (th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
- for (gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) {
- ue->pusch_vars[th_id][gNB_id] = (NR_UE_PUSCH *)malloc16(sizeof(NR_UE_PUSCH));
- phy_init_nr_ue_PUSCH( ue->pusch_vars[th_id][gNB_id], fp );
- }
- }
-
/////////////////////////PUCCH init/////////////////////////
///////////
for (th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
@@ -234,21 +213,21 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
/////////////////////////PUSCH DMRS init/////////////////////////
///////////
- ue->nr_gold_pusch_dmrs = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***));
- pusch_dmrs = ue->nr_gold_pusch_dmrs;
+
+ // ceil(((NB_RB*6(k)*2(QPSK)/32) // 3 RE *2(QPSK)
+ int pusch_dmrs_init_length = ((fp->N_RB_UL*12)>>5)+1;
+
+ ue->nr_gold_pusch_dmrs = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **));
+ uint32_t ***pusch_dmrs = ue->nr_gold_pusch_dmrs;
for (slot=0; slotslots_per_frame; slot++) {
- pusch_dmrs[slot] = (uint32_t ***)malloc16(fp->symbols_per_slot*sizeof(uint32_t **));
+ pusch_dmrs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *));
AssertFatal(pusch_dmrs[slot]!=NULL, "init_nr_ue_signal: pusch_dmrs for slot %d - malloc failed\n", slot);
for (symb=0; symbsymbols_per_slot; symb++) {
- pusch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_MAX_NB_CODEWORDS*sizeof(uint32_t *));
+ pusch_dmrs[slot][symb] = (uint32_t *)malloc16(pusch_dmrs_init_length*sizeof(uint32_t));
AssertFatal(pusch_dmrs[slot][symb]!=NULL, "init_nr_ue_signal: pusch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb);
- for (q=0; qN_RB_DL<<1)*3)>>5)+1;
//PDCCH DMRS init (gNB offset = 0)
ue->nr_gold_pdcch[0] = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **));
uint32_t ***pdcch_dmrs = ue->nr_gold_pdcch[0];
@@ -307,11 +288,14 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
AssertFatal(pdcch_dmrs[slot]!=NULL, "NR init: pdcch_dmrs for slot %d - malloc failed\n", slot);
for (int symb=0; symbsymbols_per_slot; symb++) {
- pdcch_dmrs[slot][symb] = (uint32_t *)malloc16(NR_MAX_PDCCH_DMRS_INIT_LENGTH_DWORD*sizeof(uint32_t));
+ pdcch_dmrs[slot][symb] = (uint32_t *)malloc16(pdcch_dmrs_init_length*sizeof(uint32_t));
AssertFatal(pdcch_dmrs[slot][symb]!=NULL, "NR init: pdcch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb);
}
}
+ // ceil(((NB_RB*6(k)*2(QPSK)/32) // 3 RE *2(QPSK)
+ int pdsch_dmrs_init_length = ((fp->N_RB_DL*12)>>5)+1;
+
//PDSCH DMRS init (eNB offset = 0)
ue->nr_gold_pdsch[0] = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***));
uint32_t ****pdsch_dmrs = ue->nr_gold_pdsch[0];
@@ -320,12 +304,13 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
pdsch_dmrs[slot] = (uint32_t ***)malloc16(fp->symbols_per_slot*sizeof(uint32_t **));
AssertFatal(pdsch_dmrs[slot]!=NULL, "NR init: pdsch_dmrs for slot %d - malloc failed\n", slot);
+ int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
for (int symb=0; symbsymbols_per_slot; symb++) {
- pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_MAX_NB_CODEWORDS*sizeof(uint32_t *));
+ pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(nb_codewords*sizeof(uint32_t *));
AssertFatal(pdsch_dmrs[slot][symb]!=NULL, "NR init: pdsch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb);
- for (int q=0; qactive = false;
ue->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t));
+ ue->nr_srs_info->sc_list = (uint16_t *) malloc16_clear(6*fp->N_RB_UL*sizeof(uint16_t));
ue->nr_srs_info->srs_generated_signal = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) );
ue->nr_srs_info->noise_power = (uint32_t*)malloc16_clear(sizeof(uint32_t));
ue->nr_srs_info->srs_received_signal = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
@@ -445,29 +431,10 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
}
}
- // PBCH
- pbch_vars[gNB_id]->rxdataF_ext = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
- pbch_vars[gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
- pbch_vars[gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
- pbch_vars[gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
- pbch_vars[gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
- pbch_vars[gNB_id]->llr = (int16_t *)malloc16_clear( 1920 ); //
+ // RACH
prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
prach_vars[gNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
- for (i=0; inb_antennas_rx; i++) {
- pbch_vars[gNB_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
-
- for (j=0; j<4; j++) {//fp->nb_antennas_tx;j++) {
- int idx = (j*fp->nb_antennas_rx)+i;
- pbch_vars[gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
- pbch_vars[gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) );
- pbch_vars[gNB_id]->dl_ch_estimates_time[idx]= (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) );
- pbch_vars[gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
- }
- }
-
- pbch_vars[gNB_id]->decoded_output = (uint8_t *)malloc16_clear(64);
}
// initialization for the last instance of pdsch_vars (used for MU-MIMO)
@@ -502,16 +469,12 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
for (int gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) {
- phy_term_nr_ue_PUSCH(ue->pusch_vars[th_id][gNB_id]);
- free_and_zero(ue->pusch_vars[th_id][gNB_id]);
free_and_zero(ue->pucch_vars[th_id][gNB_id]);
}
}
for (int slot = 0; slot < fp->slots_per_frame; slot++) {
for (int symb = 0; symb < fp->symbols_per_slot; symb++) {
- for (int q = 0; q < NR_MAX_NB_CODEWORDS; q++)
- free_and_zero(ue->nr_gold_pusch_dmrs[slot][symb][q]);
free_and_zero(ue->nr_gold_pusch_dmrs[slot][symb]);
}
free_and_zero(ue->nr_gold_pusch_dmrs[slot]);
@@ -545,9 +508,10 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
}
free_and_zero(ue->nr_gold_pdcch[0]);
+ int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
for (int slot=0; slotslots_per_frame; slot++) {
for (int symb=0; symbsymbols_per_slot; symb++) {
- for (int q=0; qnr_gold_pdsch[0][slot][symb][q]);
free_and_zero(ue->nr_gold_pdsch[0][slot][symb]);
}
@@ -629,6 +593,7 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
free_and_zero(ue->nr_srs_info->srs_estimated_channel_time[i]);
free_and_zero(ue->nr_srs_info->srs_estimated_channel_time_shifted[i]);
}
+ free_and_zero(ue->nr_srs_info->sc_list);
free_and_zero(ue->nr_srs_info->srs_generated_signal);
free_and_zero(ue->nr_srs_info->noise_power);
free_and_zero(ue->nr_srs_info->srs_received_signal);
@@ -640,25 +605,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
free_and_zero(ue->srs_vars[gNB_id]);
- for (int i = 0; i < fp->nb_antennas_rx; i++) {
- free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_ext[i]);
-
- for (int j = 0; j < 4; j++) {
- int idx = (j*fp->nb_antennas_rx)+i;
- free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_comp[idx]);
- free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates[idx]);
- free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_time[idx]);
- free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_ext[idx]);
- }
- }
-
- free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_ext);
- free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_comp);
- free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates);
- free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_ext);
- free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_time);
- free_and_zero(ue->pbch_vars[gNB_id]->llr);
- free_and_zero(ue->pbch_vars[gNB_id]->decoded_output);
free_and_zero(ue->pbch_vars[gNB_id]);
free_and_zero(ue->prach_vars[gNB_id]->prachF);
@@ -683,7 +629,8 @@ void term_nr_ue_transport(PHY_VARS_NR_UE *ue)
for (int j = 0; j < 2; j++) {
for (int k = 0; k < RX_NB_TH_MAX; k++) {
free_nr_ue_dlsch(&ue->dlsch[k][i][j], N_RB_DL);
- free_nr_ue_ulsch(&ue->ulsch[k][i][j], N_RB_DL);
+ if (j==0)
+ free_nr_ue_ulsch(&ue->ulsch[k][i], N_RB_DL);
}
}
@@ -694,15 +641,19 @@ void term_nr_ue_transport(PHY_VARS_NR_UE *ue)
free_nr_ue_dlsch(&ue->dlsch_MCH[0], N_RB_DL);
}
-void init_nr_ue_transport(PHY_VARS_NR_UE *ue)
-{
+void init_nr_ue_transport(PHY_VARS_NR_UE *ue) {
+
+ int num_codeword = NR_MAX_NB_LAYERS > 4? 2:1;
+
for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) {
- for (int j=0; j<2; j++) {
+ for (int j=0; jdlsch[k][i][j] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL))!=NULL,"Can't get ue dlsch structures\n");
LOG_D(PHY,"dlsch[%d][%d][%d] => %p\n",k,i,j,ue->dlsch[k][i][j]);
- AssertFatal((ue->ulsch[k][i][j] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES))!=NULL,"Can't get ue ulsch structures\n");
- LOG_D(PHY,"ulsch[%d][%d][%d] => %p\n",k,i,j,ue->ulsch[k][i][j]);
+ if (j==0) {
+ AssertFatal((ue->ulsch[k][i] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES))!=NULL,"Can't get ue ulsch structures\n");
+ LOG_D(PHY,"ulsch[%d][%d] => %p\n",k,i,ue->ulsch[k][i]);
+ }
}
}
diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c
index 35bc28d9c1..757a8d965f 100644
--- a/openair1/PHY/INIT/nr_parms.c
+++ b/openair1/PHY/INIT/nr_parms.c
@@ -253,7 +253,6 @@ int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg,
LOG_I(PHY,"Initializing frame parms for mu %d, N_RB %d, Ncp %d\n",mu, fp->N_RB_DL, Ncp);
-
if (Ncp == NFAPI_CP_EXTENDED)
AssertFatal(mu == NR_MU_2,"Invalid cyclic prefix %d for numerology index %d\n", Ncp, mu);
diff --git a/openair1/PHY/MODULATION/nr_modulation.c b/openair1/PHY/MODULATION/nr_modulation.c
index c81a88ff30..4cb3185b67 100644
--- a/openair1/PHY/MODULATION/nr_modulation.c
+++ b/openair1/PHY/MODULATION/nr_modulation.c
@@ -320,98 +320,16 @@ void nr_layer_mapping(int16_t **mod_symbs,
}
}
-void nr_ue_layer_mapping(NR_UE_ULSCH_t **ulsch_ue,
+void nr_ue_layer_mapping(int16_t *mod_symbs,
uint8_t n_layers,
uint16_t n_symbs,
- int16_t **tx_layers)
-{
- int16_t *mod_symbs;
+ int16_t **tx_layers) {
- switch (n_layers) {
-
- case 1:
- mod_symbs = (int16_t *)ulsch_ue[0]->d_mod;
- for (int i=0; i>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>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>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>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>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>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>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>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);
+ for (int i=0; i>15;
+ tx_layers[l][(i<<1)+1] = (mod_symbs[((n_layers*i+l)<<1)+1]*AMP)>>15;
+ }
}
}
diff --git a/openair1/PHY/MODULATION/nr_modulation.h b/openair1/PHY/MODULATION/nr_modulation.h
index 75541a1361..db15e3d9ef 100644
--- a/openair1/PHY/MODULATION/nr_modulation.h
+++ b/openair1/PHY/MODULATION/nr_modulation.h
@@ -66,7 +66,7 @@ void nr_layer_mapping(int16_t **mod_symbs,
@param[out] tx_layers, modulated symbols for each layer
*/
-void nr_ue_layer_mapping(NR_UE_ULSCH_t **ulsch_ue,
+void nr_ue_layer_mapping(int16_t *mod_symbs,
uint8_t n_layers,
uint16_t n_symbs,
int16_t **tx_layers);
diff --git a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
index cfb5a2e56e..f4761489f5 100644
--- a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
+++ b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
@@ -184,7 +184,7 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq
PHY_MEASUREMENTS_gNB *meas = &gNB->measurements;
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
int ch_offset = fp->ofdm_symbol_size * symbol;
- int N_RB_UL = gNB->ulsch[ulsch_id][0]->harq_processes[harq_pid]->ulsch_pdu.rb_size;
+ int N_RB_UL = gNB->ulsch[ulsch_id]->harq_processes[harq_pid]->ulsch_pdu.rb_size;
rx_power_tot[ulsch_id] = 0;
diff --git a/openair1/PHY/NR_REFSIG/nr_gold.c b/openair1/PHY/NR_REFSIG/nr_gold.c
index 7930839832..b593dcbb47 100644
--- a/openair1/PHY/NR_REFSIG/nr_gold.c
+++ b/openair1/PHY/NR_REFSIG/nr_gold.c
@@ -60,6 +60,7 @@ void nr_init_pdcch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid)
uint8_t reset;
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
uint32_t ***pdcch_dmrs = gNB->nr_gold_pdcch_dmrs;
+ int pdcch_dmrs_init_length = (((fp->N_RB_DL<<1)*3)>>5)+1;
for (uint8_t slot=0; slotslots_per_frame; slot++) {
for (uint8_t symb=0; symbsymbols_per_slot; symb++) {
@@ -67,7 +68,7 @@ void nr_init_pdcch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid)
reset = 1;
x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((Nid<<1)+1) + (Nid<<1));
LOG_D(PHY,"PDCCH DMRS slot %d, symb %d, Nid %d, x2 %x\n",slot,symb,Nid,x2);
- for (uint32_t n=0; nframe_parms;
uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs;
-
- uint16_t N_n_scid[NR_MAX_NB_CODEWORDS]={Nid, Nid}; // Not correct, appropriate scrambling IDs have to be updated to support DCI 1_1
+ int pdsch_dmrs_init_length = ((fp->N_RB_DL*12)>>5)+1;
+ int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
+ uint16_t N_n_scid[2]={Nid, Nid};
uint8_t n_scid=0; // again works only for 1_0
for (uint8_t slot=0; slotslots_per_frame; slot++) {
@@ -93,13 +95,13 @@ void nr_init_pdsch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid)
reset = 1;
x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid[n_scid]<<1)+1) +((N_n_scid[n_scid]<<1)+n_scid));
LOG_D(PHY,"PDSCH DMRS slot %d, symb %d x2 %x, N_n_scid %d,n_scid %d\n",slot,symb,x2,N_n_scid[n_scid],n_scid);
- for (uint32_t n=0; n1)
+ memcpy(pdsch_dmrs[slot][symb][1],pdsch_dmrs[slot][symb][0],sizeof(uint32_t)*pdsch_dmrs_init_length);
}
}
}
@@ -113,6 +115,7 @@ void nr_gold_pusch(PHY_VARS_gNB* gNB, uint32_t *Nid) {
unsigned int nid;
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
unsigned short l;
+ int pusch_dmrs_init_length = ((fp->N_RB_UL*12)>>5)+1;
for (nscid=0; nscid<2; nscid++) {
nid = Nid[nscid];
@@ -122,7 +125,7 @@ void nr_gold_pusch(PHY_VARS_gNB* gNB, uint32_t *Nid) {
x2 = ((1<<17) * (fp->symbols_per_slot*ns+l+1) * ((nid<<1)+1) +((nid<<1)+nscid));
LOG_D(PHY,"DMRS slot %d, symb %d x2 %x\n",ns,l,x2);
- for (n=0; nnr_gold_pusch_dmrs[nscid][ns][l][n] = lte_gold_generic(&x1, &x2, reset);
reset = 0;
}
@@ -138,6 +141,7 @@ void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid)
uint32_t ***csi_rs = gNB->nr_gold_csi_rs;
uint32_t x1, x2;
uint8_t reset;
+ int csi_dmrs_init_length = ((fp->N_RB_DL<<4)>>5)+1;
for (uint8_t slot=0; slotslots_per_frame; slot++) {
for (uint8_t symb=0; symbsymbols_per_slot; symb++) {
@@ -145,7 +149,7 @@ void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid)
reset = 1;
x2 = ((1<<10) * (fp->symbols_per_slot*slot+symb+1) * ((Nid<<1)+1) + (Nid));
- for (uint32_t n=0; nframe_parms.N_RB_DL<<1)*3)>>5)+1;
for (ns=0; nsframe_parms.slots_per_frame; ns++) {
@@ -64,9 +65,9 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue,
reset = 1;
x2tmp0 = ((ue->frame_parms.symbols_per_slot*ns+l+1)*((nid<<1)+1))<<17;
- x2 = (x2tmp0+(nid<<1))%(1<<31); //cinit
+ x2 = (x2tmp0+(nid<<1))%(1U<<31); //cinit
- for (n=0; nnr_gold_pdcch[0][ns][l][n] = lte_gold_generic(&x1, &x2, reset);
reset = 0;
}
@@ -77,28 +78,28 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue,
void nr_gold_pdsch(PHY_VARS_NR_UE* ue,
unsigned short *n_idDMRS)
{
- unsigned char l;
- unsigned int n,x1,x2,x2tmp0,ns;
- int nscid;
+
+ unsigned int x1,x2,x2tmp0;
unsigned int nid;
uint8_t reset;
-
+ int pdsch_dmrs_init_length = ((ue->frame_parms.N_RB_DL*12)>>5)+1;
+ int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
/// to be updated from higher layer
//unsigned short lbar = 0;
- for (nscid=0; nscid<2; nscid++) {
- for (ns=0; nsframe_parms.slots_per_frame; ns++) {
+ for (int nscid=0; nscidframe_parms.slots_per_frame; ns++) {
nid = n_idDMRS[nscid];
- for (l=0; lframe_parms.symbols_per_slot; l++) {
+ for (int l=0; lframe_parms.symbols_per_slot; l++) {
reset = 1;
x2tmp0 = ((ue->frame_parms.symbols_per_slot*ns+l+1)*((nid<<1)+1))<<17;
- x2 = (x2tmp0+(nid<<1)+nscid)%(1<<31); //cinit
+ x2 = (x2tmp0+(nid<<1)+nscid)%(1U<<31); //cinit
LOG_D(PHY,"UE DMRS slot %d, symb %d, x2 %x, nscid %d\n",ns,l,x2,nscid);
- for (n=0; nnr_gold_pdsch[0][ns][l][nscid][n] = lte_gold_generic(&x1, &x2, reset);
reset = 0;
}
@@ -112,9 +113,10 @@ void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue,
uint8_t n_scid)
{
uint32_t x1, x2, n;
- uint8_t reset, slot, symb, q;
+ uint8_t reset, slot, symb;
NR_DL_FRAME_PARMS *fp = &ue->frame_parms;
- uint32_t ****pusch_dmrs = ue->nr_gold_pusch_dmrs;
+ uint32_t ***pusch_dmrs = ue->nr_gold_pusch_dmrs;
+ int pusch_dmrs_init_length = ((fp->N_RB_UL*12)>>5)+1;
for (slot=0; slotslots_per_frame; slot++) {
@@ -123,13 +125,10 @@ void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue,
reset = 1;
x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid[n_scid]<<1)+1) +((N_n_scid[n_scid]<<1)+n_scid));
- for (n=0; ncommon_vars.txdataF;
int txdataF_offset = slot*frame_parms.samples_per_slot_wCP;
uint32_t **gold_csi_rs = gNB->nr_gold_csi_rs[slot];
- int16_t mod_csi[frame_parms.symbols_per_slot][NR_MAX_CSI_RS_LENGTH>>1] __attribute__((aligned(16)));;
+ //*8(max allocation per RB)*2(QPSK))
+ int csi_rs_length = frame_parms.N_RB_DL<<4;
+ int16_t mod_csi[frame_parms.symbols_per_slot][csi_rs_length>>1] __attribute__((aligned(16)));;
uint16_t b = csi_params.freq_domain;
uint16_t n, csi_bw, csi_start, p, k, l, mprime, na, kpn, csi_length;
uint8_t size, ports, kprime, lprime, i, gs;
@@ -59,7 +61,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
for (uint8_t symb=0; symb>5)+1; n++) {
gold_csi_rs[symb][n] = lte_gold_generic(&x1, &x2, reset);
reset = 0;
}
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
index 37ef5fb207..876d6cc83a 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
@@ -79,10 +79,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process;
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &harq->pdsch_pdu.pdsch_pdu_rel15;
- uint32_t scrambled_output[NR_MAX_NB_CODEWORDS][NR_MAX_PDSCH_ENCODED_LENGTH>>5];
int16_t **mod_symbs = (int16_t**)dlsch->mod_symbs;
int16_t **tx_layers = (int16_t**)dlsch->txdataF;
- int16_t **txdataF_precoding = (int16_t**)dlsch->txdataF_precoding;
int8_t Wf[2], Wt[2], l0, l_prime, l_overline, delta;
uint8_t dmrs_Type = rel15->dmrsConfigType;
int nb_re_dmrs;
@@ -100,6 +98,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
uint16_t nb_re = ((12*rel15->NrOfSymbols)-nb_re_dmrs*dmrs_len-xOverhead)*rel15->rbSize*rel15->nrOfLayers;
uint8_t Qm = rel15->qamModOrder[0];
uint32_t encoded_length = nb_re*Qm;
+ uint32_t scrambled_output[rel15->NrOfCodewords][(encoded_length>>5)+1];
int16_t mod_dmrs[n_dmrs<<1] __attribute__ ((aligned(16)));
/* PTRS */
@@ -121,8 +120,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
/// CRC, coding, interleaving and rate matching
AssertFatal(harq->pdu!=NULL,"harq->pdu is null\n");
- unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32)));
- bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
+ unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * Qm * rel15->nrOfLayers] __attribute__((aligned(32)));
+ bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * Qm * rel15->nrOfLayers);
start_meas(dlsch_encoding_stats);
if (nr_dlsch_encoding(gNB,
@@ -147,20 +146,18 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
}
printf("\n");
#endif
-
-
-
+
/// scrambling
start_meas(dlsch_scrambling_stats);
- for (int q=0; qNrOfCodewords; q++)
- memset((void*)scrambled_output[q], 0, (encoded_length>>5)*sizeof(uint32_t));
- for (int q=0; qNrOfCodewords; q++)
+ for (int q=0; qNrOfCodewords; q++) {
+ memset((void*)scrambled_output[q], 0, ((encoded_length>>5)+1)*sizeof(uint32_t));
nr_pdsch_codeword_scrambling(output,
encoded_length,
q,
rel15->dataScramblingId,
rel15->rnti,
scrambled_output[q]);
+ }
stop_meas(dlsch_scrambling_stats);
#ifdef DEBUG_DLSCH
@@ -219,6 +216,9 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
start_sc -= frame_parms->ofdm_symbol_size;
int txdataF_offset = slot*frame_parms->samples_per_slot_wCP;
+ int16_t **txdataF_precoding = (int16_t **)malloc16(rel15->nrOfLayers*sizeof(int16_t *));
+ for (int layer = 0; layernrOfLayers; layer++)
+ txdataF_precoding[layer] = (int16_t *)malloc16(2*14*frame_parms->ofdm_symbol_size*sizeof(int16_t));
#ifdef DEBUG_DLSCH_MAPPING
printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n",
@@ -295,7 +295,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
ptrs_symbol = is_ptrs_symbol(l,dlPtrsSymPos);
if(ptrs_symbol) {
/* PTRS QPSK Modulation for each OFDM symbol in a slot */
- printf("Doing ptrs modulation for symbol %d, n_ptrs %d\n",l,n_ptrs);
+ LOG_D(PHY,"Doing ptrs modulation for symbol %d, n_ptrs %d\n",l,n_ptrs);
nr_modulation(pdsch_dmrs[l][0], (n_ptrs<<1), DMRS_MOD_ORDER, mod_ptrs);
}
}
@@ -535,6 +535,9 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
else {
LOG_D(PHY,"beam index for PDSCH allocation already taken\n");
}
+ for (int layer = 0; layernrOfLayers; layer++)
+ free16(txdataF_precoding[layer],2*14*frame_parms->ofdm_symbol_size);
+ free16(txdataF_precoding,rel15->nrOfLayers);
}// dlsch loop
}
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h
index 77db12672f..28676b49f2 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h
@@ -68,7 +68,6 @@ void nr_fill_dlsch(processingData_L1tx_t *msgTx,
void nr_generate_pdsch(processingData_L1tx_t *msgTx,
int frame,
int slot);
-void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB);
void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch);
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
index 90f6909d0b..73bb9bd991 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
@@ -50,10 +50,14 @@
//#define DEBUG_DLSCH_FREE 1
-void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) {
- int r;
+void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr,
+ uint16_t N_RB,
+ const NR_DL_FRAME_PARMS* frame_parms) {
+
NR_gNB_DLSCH_t *dlsch = *dlschptr;
- uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated
+
+ int max_layers = (frame_parms->nb_antennas_txnb_antennas_tx : NR_MAX_NB_LAYERS;
+ uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*max_layers;
if (N_RB != 273) {
a_segments = a_segments*N_RB;
@@ -65,26 +69,30 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) {
free16(harq->b, a_segments * 1056);
harq->b = NULL;
}
- for (r = 0; r < a_segments; r++) {
+ for (int r = 0; r < a_segments; r++) {
free(harq->c[r]);
harq->c[r] = NULL;
}
+ free(harq->c);
free(harq->pdu);
for (int aa = 0; aa < 64; aa++)
free(dlsch->calib_dl_ch_estimates[aa]);
free(dlsch->calib_dl_ch_estimates);
- for (int q=0; q 4 ? 2 : 1;
+ for (int q=0; qmod_symbs[q]);
+ free(dlsch->mod_symbs);
- for (int layer = 0; layer < NR_MAX_NB_LAYERS; layer++) {
- free(dlsch->txdataF_precoding[layer]);
+ for (int layer = 0; layer < max_layers; layer++) {
free(dlsch->txdataF[layer]);
for (int aa = 0; aa < 64; aa++)
free(dlsch->ue_spec_bf_weights[layer][aa]);
free(dlsch->ue_spec_bf_weights[layer]);
}
+ free(dlsch->txdataF);
+ free(dlsch->ue_spec_bf_weights);
free(dlsch);
*dlschptr = NULL;
@@ -96,9 +104,9 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
uint32_t Nsoft,
uint8_t abstraction_flag,
uint16_t N_RB) {
- unsigned char i,r,aa,layer;
- int re;
- uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated
+
+ int max_layers = (frame_parms->nb_antennas_txnb_antennas_tx : NR_MAX_NB_LAYERS;
+ uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*max_layers; //number of segments to be allocated
if (N_RB != 273) {
a_segments = a_segments*N_RB;
@@ -114,31 +122,36 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
dlsch->Mlimit = 4;
dlsch->Nsoft = Nsoft;
- for (layer=0; layerN_RB_DL*NR_SYMBOLS_PER_SLOT*NR_NB_SC_PER_RB*8; // max pdsch encoded length for each layer
+
+ dlsch->txdataF = (int32_t **)malloc16(max_layers*sizeof(int32_t *));
+
+ dlsch->ue_spec_bf_weights = (int32_t ***)malloc16(max_layers*sizeof(int32_t **));
+ for (int layer=0; layerue_spec_bf_weights[layer] = (int32_t **)malloc16(64*sizeof(int32_t *));
- for (aa=0; aa<64; aa++) {
+ for (int aa=0; aa<64; aa++) {
dlsch->ue_spec_bf_weights[layer][aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
- for (re=0; reue_spec_bf_weights[layer][aa][re] = 0x00007fff;
}
}
-
- dlsch->txdataF[layer] = (int32_t *)malloc16((NR_MAX_PDSCH_ENCODED_LENGTH/NR_MAX_NB_LAYERS)*sizeof(int32_t)); // NR_MAX_NB_LAYERS is already included in NR_MAX_PDSCH_ENCODED_LENGTH
- dlsch->txdataF_precoding[layer] = (int32_t *)malloc16(2*14*frame_parms->ofdm_symbol_size*sizeof(int32_t));
+ dlsch->txdataF[layer] = (int32_t *)malloc16((txdataf_size)*sizeof(int32_t));
}
- for (int q=0; qmod_symbs[q] = (int32_t *)malloc16(NR_MAX_PDSCH_ENCODED_LENGTH*sizeof(int32_t));
+ int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
+ dlsch->mod_symbs = (int32_t **)malloc16(nb_codewords*sizeof(int32_t *));
+ for (int q=0; qmod_symbs[q] = (int32_t *)malloc16(txdataf_size*max_layers*sizeof(int32_t));
dlsch->calib_dl_ch_estimates = (int32_t **)malloc16(64*sizeof(int32_t *));
- for (aa=0; aa<64; aa++) {
+ for (int aa=0; aa<64; aa++) {
dlsch->calib_dl_ch_estimates[aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
}
- for (i=0; i<20; i++) {
+ for (int i=0; i<20; i++) {
dlsch->harq_ids[0][i] = 0;
dlsch->harq_ids[1][i] = 0;
}
@@ -153,7 +166,8 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
nr_emulate_dlsch_payload(harq->pdu, (dlsch_bytes) >> 3);
bzero(harq->b, dlsch_bytes);
- for (r = 0; r < a_segments; r++) {
+ harq->c = (uint8_t **)malloc16(a_segments*sizeof(uint8_t *));
+ for (int r = 0; r < a_segments; r++) {
// account for filler in first segment and CRCs for multiple segment case
// [hna] 8448 is the maximum CB size in NR
// 68*348 = 68*(maximum size of Zc)
@@ -311,6 +325,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
stats->current_Qm = rel15->qamModOrder[0];
}
+ int max_bytes = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*rel15->nrOfLayers*1056;
if (A > 3824) {
// Add 24-bit crc (polynomial A) to payload
crc = crc24a(a,A)>>8;
@@ -321,11 +336,11 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
//printf("a0 %d a1 %d a2 %d\n", a[A>>3], a[1+(A>>3)], a[2+(A>>3)]);
harq->B = A+24;
// harq->b = a;
- AssertFatal((A / 8) + 4 <= MAX_NR_DLSCH_PAYLOAD_BYTES,
+ AssertFatal((A / 8) + 4 <= max_bytes,
"A %d is too big (A/8+4 = %d > %d)\n",
A,
(A / 8) + 4,
- MAX_NR_DLSCH_PAYLOAD_BYTES);
+ max_bytes);
memcpy(harq->b, a, (A / 8) + 4); // why is this +4 if the CRC is only 3 bytes?
} else {
// Add 16-bit crc (polynomial A) to payload
@@ -336,11 +351,11 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
//printf("a0 %d a1 %d \n", a[A>>3], a[1+(A>>3)]);
harq->B = A+16;
// harq->b = a;
- AssertFatal((A / 8) + 3 <= MAX_NR_DLSCH_PAYLOAD_BYTES,
+ AssertFatal((A / 8) + 3 <= max_bytes,
"A %d is too big (A/8+3 = %d > %d)\n",
A,
(A / 8) + 3,
- MAX_NR_DLSCH_PAYLOAD_BYTES);
+ max_bytes);
memcpy(harq->b, a, (A / 8) + 3); // using 3 bytes to mimic the case of 24 bit crc
}
@@ -358,6 +373,11 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
impp.Kb = nr_segmentation(harq->b, harq->c, harq->B, &impp.n_segments, &impp.K, impp.Zc, &impp.F, impp.BG);
stop_meas(dlsch_segmentation_stats);
+ if (impp.n_segments>MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*rel15->nrOfLayers) {
+ LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d\n",impp.n_segments,harq->B);
+ return(-1);
+ }
+
for (int r=0; rd[r][0];
//channel_input[r] = &harq->d[r][0];
diff --git a/openair1/PHY/NR_TRANSPORT/nr_scrambling.c b/openair1/PHY/NR_TRANSPORT/nr_scrambling.c
index b68ad2d89f..4bbecfd994 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_scrambling.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_scrambling.c
@@ -40,7 +40,7 @@ void nr_codeword_scrambling(uint8_t *in,
__m256i c = ((__m256i*)in)[i];
uint32_t in32 = _mm256_movemask_epi8(_mm256_slli_epi16(c,7));
out[i]=(in32^s);
- //printf("in[%d] %x => %x\n",i,in32,out[i]);
+ LOG_D(PHY,"in[%d] %x => %x\n",i,in32,out[i]);
s=lte_gold_generic(&x1, &x2, 0);
}
#elif defined(__SSE4__)
diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
index b62698c748..f9478b7633 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
+++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
@@ -106,7 +106,7 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
uint8_t abstraction_flag,
uint16_t N_RB);
-void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB);
+void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB, const NR_DL_FRAME_PARMS* frame_parms);
/** \brief This function is the top-level entry point to PUSCH demodulation, after frequency-domain transformation and channel estimation. It performs
- RB extraction (signal and channel estimates)
@@ -146,7 +146,7 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
void nr_ulsch_scale_channel(int32_t **ul_ch_estimates_ext,
NR_DL_FRAME_PARMS *frame_parms,
- NR_gNB_ULSCH_t **ulsch_gNB,
+ NR_gNB_ULSCH_t *ulsch_gNB,
uint8_t symbol,
uint8_t start_symbol,
uint16_t nb_rb,
diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c
index 1cb503489b..3e3137739e 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c
@@ -42,15 +42,14 @@ int16_t find_nr_ulsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type) {
AssertFatal(gNB!=NULL,"gNB is null\n");
for (i=0; inumber_of_nr_ulsch_max; i++) {
AssertFatal(gNB->ulsch[i]!=NULL,"gNB->ulsch[%d] is null\n",i);
- AssertFatal(gNB->ulsch[i][0]!=NULL,"gNB->ulsch[%d][0] is null\n",i);
- LOG_D(PHY,"searching for rnti %x : ulsch_index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,gNB->ulsch[i][0]->harq_mask,gNB->ulsch[i][0]->rnti,first_free_index);
- if ((gNB->ulsch[i][0]->harq_mask >0) &&
- (gNB->ulsch[i][0]->rnti==rnti)) return i;
- else if ((gNB->ulsch[i][0]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
+ LOG_D(PHY,"searching for rnti %x : ulsch_index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,gNB->ulsch[i]->harq_mask,gNB->ulsch[i]->rnti,first_free_index);
+ if ((gNB->ulsch[i]->harq_mask >0) &&
+ (gNB->ulsch[i]->rnti==rnti)) return i;
+ else if ((gNB->ulsch[i]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
}
if (type == SEARCH_EXIST) return -1;
if (first_free_index != -1)
- gNB->ulsch[first_free_index][0]->rnti = 0;
+ gNB->ulsch[first_free_index]->rnti = 0;
return first_free_index;
}
@@ -64,7 +63,7 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB,
AssertFatal( (ulsch_id>=0) && (ulsch_idnumber_of_nr_ulsch_max),
"illegal or no ulsch_id found!!! rnti %04x ulsch_id %d\n",ulsch_pdu->rnti,ulsch_id);
- NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ulsch_id][0];
+ NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ulsch_id];
int harq_pid = ulsch_pdu->pusch_data.harq_process_id;
ulsch->rnti = ulsch_pdu->rnti;
//ulsch->rnti_type;
diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
index dc575030bc..06cc2aaea8 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
@@ -175,7 +175,7 @@ void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch)
//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];
+ //int16_t e[MAX_NUM_NR_ULSCH_SEGMENTS][3*8448];
ulsch->harq_processes[i]->E=0;
@@ -404,7 +404,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
#endif
- NR_gNB_ULSCH_t *ulsch = phy_vars_gNB->ulsch[ULSCH_id][0];
+ NR_gNB_ULSCH_t *ulsch = phy_vars_gNB->ulsch[ULSCH_id];
NR_gNB_PUSCH *pusch = phy_vars_gNB->pusch_vars[ULSCH_id];
NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid];
@@ -530,6 +530,12 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
&harq_process->F,
p_decParams->BG);
+ if (harq_process->C>MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*n_layers) {
+ LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d\n",harq_process->C,harq_process->B);
+ return(-1);
+ }
+
+
#ifdef DEBUG_ULSCH_DECODING
printf("ulsch decoding nr segmentation Z %d\n", harq_process->Z);
if (!frame%100)
diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
index 681a9eae16..03cee5afa1 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
@@ -403,7 +403,7 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
void nr_ulsch_scale_channel(int **ul_ch_estimates_ext,
NR_DL_FRAME_PARMS *frame_parms,
- NR_gNB_ULSCH_t **ulsch_gNB,
+ NR_gNB_ULSCH_t *ulsch_gNB,
uint8_t symbol,
uint8_t is_dmrs_symbol,
unsigned short nb_rb,
@@ -418,7 +418,7 @@ void nr_ulsch_scale_channel(int **ul_ch_estimates_ext,
// Determine scaling amplitude based the symbol
- ch_amp = 1024*8; //((pilots) ? (ulsch_gNB[0]->sqrt_rho_b) : (ulsch_gNB[0]->sqrt_rho_a));
+ ch_amp = 1024*8; //((pilots) ? (ulsch_gNB->sqrt_rho_b) : (ulsch_gNB->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, is_dmrs_symbol, nb_rb, frame_parms->Ncp, symbol);
// printf("Scaling PUSCH Chest in OFDM symbol %d by %d\n",symbol_mod,ch_amp);
@@ -1177,7 +1177,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
int avgs = 0;
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
- nfapi_nr_pusch_pdu_t *rel15_ul = &gNB->ulsch[ulsch_id][0]->harq_processes[harq_pid]->ulsch_pdu;
+ nfapi_nr_pusch_pdu_t *rel15_ul = &gNB->ulsch[ulsch_id]->harq_processes[harq_pid]->ulsch_pdu;
int avg[frame_parms->nb_antennas_rx*rel15_ul->nrOfLayers];
gNB->pusch_vars[ulsch_id]->dmrs_symbol = INVALID_VALUE;
diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c
index b85dbd1454..50c3b62f50 100644
--- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c
+++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c
@@ -457,7 +457,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
uci_pdu->harq->harq_list[1].harq_value = !(index&0x01);
uci_pdu->harq->harq_list[0].harq_value = !((index>>1)&0x01);
- LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d (0 pass, 1 fail) and %d with confidence level %d (0 is good, 1 is bad), xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n",
+ LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d (0 pass, 1 fail) with confidence level %d (0 is good, 1 is bad), xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n",
frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,gNB->ulsch_stats[0].sync_pos);
if (pucch_pdu->sr_flag == 1) {
uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr));
diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
index 15f3abad79..f4f183793f 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
@@ -36,6 +36,7 @@
void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
PHY_VARS_NR_UE *ue,
module_id_t gNB_id,
+ const int estimateSz, struct complex16 dl_ch_estimates_time[][estimateSz],
uint8_t frame,
uint8_t subframe,
unsigned char clear,
@@ -60,8 +61,8 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
int j = (i < 0) ? (i + frame_parms->ofdm_symbol_size) : i;
for (int aa = 0; aa < frame_parms->nb_antennas_rx; aa++) {
- int Re = ((int16_t*)ue->pbch_vars[gNB_id]->dl_ch_estimates_time[aa])[(j<<1)];
- int Im = ((int16_t*)ue->pbch_vars[gNB_id]->dl_ch_estimates_time[aa])[1+(j<<1)];
+ int Re = dl_ch_estimates_time[aa][j].r;
+ int Im = dl_ch_estimates_time[aa][j].i;
temp += (Re*Re/2) + (Im*Im/2);
}
diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
index 7281f8e290..96709b91a1 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
@@ -29,6 +29,7 @@
#include "PHY/NR_REFSIG/ptrs_nr.h"
#include "PHY/NR_TRANSPORT/nr_sch_dmrs.h"
#include "filt16a_32.h"
+#include
//#define DEBUG_PDSCH
//#define DEBUG_PDCCH
@@ -43,7 +44,6 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
NR_UE_SSB *current_ssb)
{
int pilot[200] __attribute__((aligned(16)));
- unsigned char aarx;
unsigned short k;
unsigned int pilot_cnt;
int16_t ch[2],*pil,*rxF;
@@ -77,7 +77,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
// generate pilot
nr_pbch_dmrs_rx(dmrss,ue->nr_gold_pbch[n_hf][ssb_index], &pilot[0]);
- for (aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) {
+ for (int aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) {
int re_offset = ssb_offset;
pil = (int16_t *)&pilot[0];
@@ -197,6 +197,9 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
+ int estimateSz,
+ struct complex16 dl_ch_estimates [][estimateSz],
+ struct complex16 dl_ch_estimates_time [][estimateSz],
UE_nr_rxtx_proc_t *proc,
uint8_t gNB_id,
unsigned char Ns,
@@ -206,16 +209,14 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
uint8_t n_hf)
{
int pilot[200] __attribute__((aligned(16)));
- unsigned char aarx,p;
unsigned short k;
unsigned int pilot_cnt;
- int16_t ch[2],*pil,*rxF,*dl_ch,*fl,*fm,*fr;
+ int16_t *pil,*rxF,*dl_ch,*fl,*fm,*fr;
int ch_offset,symbol_offset;
//int slot_pbch;
uint8_t nushift;
- int **dl_ch_estimates =ue->pbch_vars[gNB_id]->dl_ch_estimates;
- int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF;
+ int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF;
nushift = ue->frame_parms.Nid_cell%4;
ue->frame_parms.nushift = nushift;
@@ -269,17 +270,57 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
break;
}
+ idft_size_idx_t idftsizeidx;
+
+ switch (ue->frame_parms.ofdm_symbol_size) {
+ case 128:
+ idftsizeidx = IDFT_128;
+ break;
+
+ case 256:
+ idftsizeidx = IDFT_256;
+ break;
+
+ case 512:
+ idftsizeidx = IDFT_512;
+ break;
+
+ case 1024:
+ idftsizeidx = IDFT_1024;
+ break;
+
+ case 1536:
+ idftsizeidx = IDFT_1536;
+ break;
+
+ case 2048:
+ idftsizeidx = IDFT_2048;
+ break;
+
+ case 3072:
+ idftsizeidx = IDFT_3072;
+ break;
+
+ case 4096:
+ idftsizeidx = IDFT_4096;
+ break;
+
+ default:
+ printf("unsupported ofdm symbol size \n");
+ assert(0);
+ }
+
// generate pilot
nr_pbch_dmrs_rx(dmrss,ue->nr_gold_pbch[n_hf][ssb_index], &pilot[0]);
- for (aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) {
+ for (int aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) {
int re_offset = ssb_offset;
pil = (int16_t *)&pilot[0];
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)];
dl_ch = (int16_t *)&dl_ch_estimates[aarx][ch_offset];
- memset(dl_ch,0,4*(ue->frame_parms.ofdm_symbol_size));
+ memset(dl_ch,0,sizeof(*dl_ch)*(ue->frame_parms.ofdm_symbol_size));
#ifdef DEBUG_CH
printf("pbch ch est pilot addr %p RB_DL %d\n",&pilot[0], ue->frame_parms.N_RB_DL);
@@ -289,6 +330,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
#endif
// Treat first 2 pilots specially (left edge)
+ int16_t ch[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);
@@ -402,62 +444,18 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
}
- idft_size_idx_t idftsizeidx;
-
- switch (ue->frame_parms.ofdm_symbol_size) {
- case 128:
- idftsizeidx = IDFT_128;
- break;
-
- case 256:
- idftsizeidx = IDFT_256;
- break;
-
- case 512:
- idftsizeidx = IDFT_512;
- break;
-
- case 1024:
- idftsizeidx = IDFT_1024;
- break;
-
- case 1536:
- idftsizeidx = IDFT_1536;
- break;
-
- case 2048:
- idftsizeidx = IDFT_2048;
- break;
-
- case 3072:
- idftsizeidx = IDFT_3072;
- break;
-
- case 4096:
- idftsizeidx = IDFT_4096;
- break;
-
- default:
- printf("unsupported ofdm symbol size \n");
- assert(0);
- }
-
if( dmrss == 2) // update time statistics for last PBCH symbol
{
// do ifft of channel estimate
- for (aarx=0; aarxframe_parms.nb_antennas_rx; aarx++)
- for (p=0; pframe_parms.nb_antenna_ports_gNB; p++) {
- if (ue->pbch_vars[gNB_id]->dl_ch_estimates[(p*ue->frame_parms.nb_antennas_rx)+aarx])
- {
- LOG_D(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d ch_offset %d\n", Ns, proc->thread_id, symbol, ch_offset);
- idft(idftsizeidx,
- (int16_t*) &ue->pbch_vars[gNB_id]->dl_ch_estimates[(p*ue->frame_parms.nb_antennas_rx)+aarx][ch_offset],
- (int16_t*) ue->pbch_vars[gNB_id]->dl_ch_estimates_time[(p*ue->frame_parms.nb_antennas_rx)+aarx],1);
- }
- }
- }
-
- }
+ LOG_D(PHY,"Channel Impulse Computation Slot %d Symbol %d ch_offset %d\n", Ns, symbol, ch_offset);
+ idft(idftsizeidx,
+ (int16_t*) &dl_ch_estimates[aarx][ch_offset],
+ (int16_t*) dl_ch_estimates_time[aarx],
+ 1);
+}
+}
+ if (dmrss == 2)
+ UEscopeCopy(ue, pbchDlChEstimateTime, (void*)dl_ch_estimates_time, sizeof(struct complex16), ue->frame_parms.nb_antennas_rx, idftsizeidx);
return(0);
}
diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
index 4dec92143a..aa4b78e145 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
@@ -56,7 +56,10 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
NR_UE_SSB *current_ssb);
int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
- UE_nr_rxtx_proc_t *proc,
+ int estimateSz,
+ struct complex16 dl_ch_estimates [][estimateSz],
+ struct complex16 dl_ch_estimates_time [][estimateSz],
+ UE_nr_rxtx_proc_t *proc,
uint8_t gNB_id,
unsigned char Ns,
unsigned char symbol,
@@ -79,6 +82,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
PHY_VARS_NR_UE *ue,
module_id_t gNB_id,
+ int estimateSz,
+ struct complex16 dl_ch_estimates_time [][estimateSz],
uint8_t frame,
uint8_t subframe,
unsigned char clear,
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
index ffa26ad613..34081659ac 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
@@ -79,9 +79,11 @@ void init_dlsch_tpool(uint8_t num_dlsch_threads) {
free(params);
}
+
void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr, uint16_t N_RB_DL) {
- int i,r;
- uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated
+
+ uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS;
+
NR_UE_DLSCH_t *dlsch=*dlschptr;
if (dlsch) {
@@ -90,36 +92,23 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr, uint16_t N_RB_DL) {
a_segments = a_segments/273 +1;
}
- for (i=0; iMdlharq; i++) {
+ for (int i=0; iMdlharq; i++) {
if (dlsch->harq_processes[i]) {
if (dlsch->harq_processes[i]->b) {
free16(dlsch->harq_processes[i]->b,a_segments*1056);
dlsch->harq_processes[i]->b = NULL;
}
- for (r=0; rharq_processes[i]->c[r],1056);
dlsch->harq_processes[i]->c[r] = NULL;
+ free16(dlsch->harq_processes[i]->d[r],5*8448);
+ dlsch->harq_processes[i]->d[r] = NULL;
+ nrLDPC_free_mem(dlsch->harq_processes[i]->p_nrLDPC_procBuf[r]);
}
-
- for (r=0; rharq_processes[i]->d[r]) {
- free16(dlsch->harq_processes[i]->d[r],(5*8448)*sizeof(short));
- dlsch->harq_processes[i]->d[r] = NULL;
- }
-
- for (r=0; rharq_processes[i]->w[r]) {
- free16(dlsch->harq_processes[i]->w[r],(5*8448)*sizeof(short));
- dlsch->harq_processes[i]->w[r] = NULL;
- }
-
- for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r]) {
- nrLDPC_free_mem(dlsch->harq_processes[i]->p_nrLDPC_procBuf[r]);
- dlsch->harq_processes[i]->p_nrLDPC_procBuf[r] = NULL;
- }
- }
+ free16(dlsch->harq_processes[i]->c,a_segments);
+ free16(dlsch->harq_processes[i]->d,a_segments);
+ free16(dlsch->harq_processes[i]->p_nrLDPC_procBuf,a_segments);
free16(dlsch->harq_processes[i],sizeof(NR_DL_UE_HARQ_t));
dlsch->harq_processes[i] = NULL;
@@ -131,10 +120,13 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr, uint16_t N_RB_DL) {
}
}
+
NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_ldpc_iterations,uint16_t N_RB_DL) {
+
NR_UE_DLSCH_t *dlsch;
- uint8_t exit_flag = 0,i,r;
- uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated
+ uint8_t exit_flag = 0;
+
+ uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS; //number of segments to be allocated
if (N_RB_DL != 273) {
a_segments = a_segments*N_RB_DL;
@@ -153,7 +145,7 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint
dlsch->Mlimit = 4;
dlsch->max_ldpc_iterations = max_ldpc_iterations;
- for (i=0; iharq_processes[i] = (NR_DL_UE_HARQ_t *)malloc16(sizeof(NR_DL_UE_HARQ_t));
if (dlsch->harq_processes[i]) {
@@ -167,26 +159,17 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint
else
exit_flag=3;
- for (r=0; rharq_processes[i]->c = (uint8_t **)malloc16(a_segments*sizeof(uint8_t *));
+ dlsch->harq_processes[i]->d = (int16_t **)malloc16(a_segments*sizeof(int16_t *));
+ dlsch->harq_processes[i]->p_nrLDPC_procBuf = (t_nrLDPC_procBuf **)malloc16(a_segments*sizeof(t_nrLDPC_procBuf *));
+ for (int r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem();
dlsch->harq_processes[i]->c[r] = (uint8_t *)malloc16(1056);
-
+ dlsch->harq_processes[i]->d[r] = (int16_t *)malloc16(5*8448*sizeof(int16_t));
if (dlsch->harq_processes[i]->c[r])
memset(dlsch->harq_processes[i]->c[r],0,1056);
- else
- exit_flag=2;
-
- dlsch->harq_processes[i]->d[r] = (short *)malloc16((5*8448)*sizeof(short));
-
if (dlsch->harq_processes[i]->d[r])
- memset(dlsch->harq_processes[i]->d[r],0,(5*8448)*sizeof(short));
- else
- exit_flag=2;
-
- dlsch->harq_processes[i]->w[r] = (short *)malloc16((5*8448)*sizeof(short));
-
- if (dlsch->harq_processes[i]->w[r])
- memset(dlsch->harq_processes[i]->w[r],0,(5*8448)*sizeof(short));
+ memset(dlsch->harq_processes[i]->d[r],0,5*8448);
else
exit_flag=2;
}
@@ -320,11 +303,16 @@ void nr_processDLSegment(void* arg) {
t_nrLDPC_procBuf **p_nrLDPC_procBuf = harq_process->p_nrLDPC_procBuf;
+
+ int16_t w[5*8448];
+ memset(w,0,(5*8448)*sizeof(short));
+
start_meas(&rdata->ts_deinterleave);
+
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_IN);
nr_deinterleaving_ldpc(E,
Qm,
- harq_process->w[r], // [hna] w is e
+ w, // [hna] w is e
dlsch_llr+r_offset);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_OUT);
stop_meas(&rdata->ts_deinterleave);
@@ -346,7 +334,7 @@ void nr_processDLSegment(void* arg) {
p_decoderParms->BG,
p_decoderParms->Z,
harq_process->d[r],
- harq_process->w[r],
+ w,
harq_process->C,
harq_process->rvidx,
(harq_process->first_rx==1)?1:0,
@@ -577,6 +565,11 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
&harq_process->F,
p_decParams->BG);
+ if (harq_process->C>MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*harq_process->Nl) {
+ LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d\n",harq_process->C,harq_process->B);
+ return(-1);
+ }
+
if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD) && (!frame%100))
LOG_I(PHY,"K %d C %d Z %d nl %d \n", harq_process->K, harq_process->C, p_decParams->Z, harq_process->Nl);
}
@@ -588,7 +581,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
p_decParams->numMaxIter = dlsch->max_ldpc_iterations;
p_decParams->outMode= 0;
r_offset = 0;
- uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated
+ uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*harq_process->Nl; //number of segments to be allocated
if (nb_rb != 273) {
a_segments = a_segments*nb_rb;
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
index 75517b7a6f..f3baa45df4 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
@@ -202,7 +202,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
pdsch_vars = ue->pdsch_vars[proc->thread_id];
dlsch = ue->dlsch[proc->thread_id][gNB_id];
dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
- dlsch1_harq = dlsch[1]->harq_processes[harq_pid];
+ if (NR_MAX_NB_LAYERS>4)
+ dlsch1_harq = dlsch[1]->harq_processes[harq_pid];
beamforming_mode = ue->transmission_mode[gNB_id] < 7 ? 0 :ue->transmission_mode[gNB_id];
break;
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
index d7b1a030c9..ac918b4f3e 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
@@ -146,17 +146,23 @@ int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_ini
start_meas(&ue->dlsch_channel_estimation_stats);
// computing channel estimation for selected best ssb
+ const int estimateSz=7*2*frame_parms->ofdm_symbol_size;
+ __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates[frame_parms->nb_antennas_rx][estimateSz];
+ __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][estimateSz];
for(int i=pbch_initial_symbol; ii_ssb,temp_ptr->n_hf);
+ nr_pbch_channel_estimation(ue,estimateSz, dl_ch_estimates, dl_ch_estimates_time,
+ proc,0,0,i,i-pbch_initial_symbol,temp_ptr->i_ssb,temp_ptr->n_hf);
stop_meas(&ue->dlsch_channel_estimation_stats);
-
+ fapiPbch_t result;
ret = nr_rx_pbch(ue,
proc,
- ue->pbch_vars[0],
+ estimateSz, dl_ch_estimates,
+ ue->pbch_vars[0],
frame_parms,
0,
temp_ptr->i_ssb,
- SISO);
+ SISO,
+ &result);
temp_ptr=temp_ptr->next_ssb;
}
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
index 6b5185dc2c..2705132bc6 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
@@ -36,28 +36,30 @@
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "PHY/INIT/phy_init.h"
#include "openair1/SCHED_NR_UE/defs.h"
+#include
+#include
-//#define DEBUG_PBCH
+//#define DEBUG_PBCH
//#define DEBUG_PBCH_ENCODING
- //#include "PHY_INTERFACE/defs.h"
+//#include "PHY_INTERFACE/defs.h"
#define PBCH_A 24
-
+#define PBCH_MAX_RE_PER_SYMBOL (20*12)
+#define PBCH_MAX_RE (PBCH_MAX_RE_PER_SYMBOL*4)
#define print_shorts(s,x) printf("%s : %d,%d,%d,%d,%d,%d,%d,%d\n",s,((int16_t*)x)[0],((int16_t*)x)[1],((int16_t*)x)[2],((int16_t*)x)[3],((int16_t*)x)[4],((int16_t*)x)[5],((int16_t*)x)[6],((int16_t*)x)[7])
-uint16_t nr_pbch_extract(int **rxdataF,
- int **dl_ch_estimates,
- int **rxdataF_ext,
- int **dl_ch_estimates_ext,
- uint32_t symbol,
- uint32_t s_offset,
- NR_DL_FRAME_PARMS *frame_parms) {
+static uint16_t nr_pbch_extract(int **rxdataF,
+ const int estimateSz,
+ struct complex16 dl_ch_estimates[][estimateSz],
+ struct complex16 rxdataF_ext[][PBCH_MAX_RE_PER_SYMBOL],
+ struct complex16 dl_ch_estimates_ext[][PBCH_MAX_RE_PER_SYMBOL],
+ uint32_t symbol,
+ uint32_t s_offset,
+ NR_DL_FRAME_PARMS *frame_parms) {
uint16_t rb;
uint8_t i,j,aarx;
- int32_t *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext;
int nushiftmod4 = frame_parms->nushift;
-
AssertFatal(symbol>=1 && symbol<5,
"symbol %d illegal for PBCH extraction\n",
symbol);
@@ -65,9 +67,8 @@ uint16_t nr_pbch_extract(int **rxdataF,
for (aarx=0; aarxnb_antennas_rx; aarx++) {
unsigned int rx_offset = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier;
rx_offset = (rx_offset)%(frame_parms->ofdm_symbol_size);
-
- rxF = &rxdataF[aarx][(symbol+s_offset)*frame_parms->ofdm_symbol_size];
- rxF_ext = &rxdataF_ext[aarx][symbol*20*12];
+ struct complex16 *rxF = (struct complex16 *)&rxdataF[aarx][(symbol+s_offset)*frame_parms->ofdm_symbol_size];
+ struct complex16 *rxF_ext = rxdataF_ext[aarx];
#ifdef DEBUG_PBCH
printf("extract_rbs (nushift %d): rx_offset=%d, symbol %u\n",frame_parms->nushift,
(rx_offset + ((symbol+s_offset)*(frame_parms->ofdm_symbol_size))),symbol);
@@ -76,7 +77,6 @@ uint16_t nr_pbch_extract(int **rxdataF,
for (int i =0; i<8; i++) {
printf("rxF [%d]= %d\n",i,rxF[i]);
printf("pbch extract rxF %d %d addr %p\n", p[2*i], p[2*i+1], &p[2*i]);
- printf("rxF ext addr %p\n", &rxF_ext[i]);
}
#endif
@@ -91,19 +91,18 @@ 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 [%u]= (%d,%d)\n",(9*rb) + j,
- ((int16_t *)&rxF_ext[j])[0],
- ((int16_t *)&rxF_ext[j])[1],
+ printf("rxF ext[%d] = (%d,%d) rxF [%u]= (%d,%d)\n",
+ (9*rb) + j,
+ rxF_ext[j].r, rxF_ext[j].i,
rx_offset,
- ((int16_t *)&rxF[rx_offset])[0],
- ((int16_t *)&rxF[rx_offset])[1]);
+ rxF[rx_offset].r,rxF[rx_offset].j;
#endif
j++;
}
rx_offset=(rx_offset+1)%(frame_parms->ofdm_symbol_size);
//rx_offset = (rx_offset >= frame_parms->ofdm_symbol_size) ? (rx_offset - frame_parms->ofdm_symbol_size + 1) : (rx_offset+1);
- }
+ }
rxF_ext+=9;
} else { //symbol 2
@@ -115,11 +114,9 @@ uint16_t nr_pbch_extract(int **rxdataF,
rxF_ext[j]=rxF[rx_offset];
#ifdef DEBUG_PBCH
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],
+ rxF_ext[j].r, rxF_ext[j].i,
rx_offset,
- ((int16_t *)&rxF[rx_offset])[0],
- ((int16_t *)&rxF[rx_offset])[1]);
+ rxF[rx_offset].r,rxF[rx_offset].j;
#endif
j++;
}
@@ -129,16 +126,16 @@ uint16_t nr_pbch_extract(int **rxdataF,
}
rxF_ext+=9;
- } else{ //rx_offset = (rx_offset >= frame_parms->ofdm_symbol_size) ? (rx_offset - frame_parms->ofdm_symbol_size + 12) : (rx_offset+12);
- rx_offset = (rx_offset+12)%(frame_parms->ofdm_symbol_size);
- }
+ } else { //rx_offset = (rx_offset >= frame_parms->ofdm_symbol_size) ? (rx_offset - frame_parms->ofdm_symbol_size + 12) : (rx_offset+12);
+ rx_offset = (rx_offset+12)%(frame_parms->ofdm_symbol_size);
+ }
}
}
- dl_ch0 = &dl_ch_estimates[aarx][((symbol+s_offset)*(frame_parms->ofdm_symbol_size))];
+ struct complex16 *dl_ch0 = &dl_ch_estimates[aarx][((symbol+s_offset)*(frame_parms->ofdm_symbol_size))];
//printf("dl_ch0 addr %p\n",dl_ch0);
- dl_ch0_ext = &dl_ch_estimates_ext[aarx][symbol*20*12];
+ struct complex16 *dl_ch0_ext = dl_ch_estimates_ext[aarx];
for (rb=0; rb<20; rb++) {
j=0;
@@ -150,15 +147,11 @@ uint16_t nr_pbch_extract(int **rxdataF,
(i!=(nushiftmod4+8))) {
dl_ch0_ext[j]=dl_ch0[i];
#ifdef DEBUG_PBCH
-
if ((rb==0) && (i<2))
printf("dl ch0 ext[%d] = (%d,%d) dl_ch0 [%d]= (%d,%d)\n",j,
- ((int16_t *)&dl_ch0_ext[j])[0],
- ((int16_t *)&dl_ch0_ext[j])[1],
+ dl_ch0_ext[j].r, dl_ch0_ext[j].i,
i,
- ((int16_t *)&dl_ch0[i])[0],
- ((int16_t *)&dl_ch0[i])[1]);
-
+ dl_ch0[j].r, dl_ch0[j].i,
#endif
j++;
}
@@ -175,11 +168,9 @@ uint16_t nr_pbch_extract(int **rxdataF,
dl_ch0_ext[j]=dl_ch0[i];
#ifdef DEBUG_PBCH
printf("dl ch0 ext[%d] = (%d,%d) dl_ch0 [%d]= (%d,%d)\n",j,
- ((int16_t *)&dl_ch0_ext[j])[0],
- ((int16_t *)&dl_ch0_ext[j])[1],
+ dl_ch0_ext[j].r, dl_ch0_ext[j].i,
i,
- ((int16_t *)&dl_ch0[i])[0],
- ((int16_t *)&dl_ch0[i])[1]);
+ dl_ch0[j].r, dl_ch0[j].i,
#endif
j++;
}
@@ -199,11 +190,10 @@ uint16_t nr_pbch_extract(int **rxdataF,
//__m128i avg128;
//compute average channel_level on each (TX,RX) antenna pair
-int nr_pbch_channel_level(int **dl_ch_estimates_ext,
+int nr_pbch_channel_level(struct complex16 dl_ch_estimates_ext[][PBCH_MAX_RE_PER_SYMBOL],
NR_DL_FRAME_PARMS *frame_parms,
- uint32_t symbol) {
- int16_t rb, nb_rb=20;
- uint8_t aarx;
+ int nb_re) {
+ int16_t nb_rb=nb_re/12;
#if defined(__x86_64__) || defined(__i386__)
__m128i avg128;
__m128i *dl_ch128;
@@ -213,22 +203,23 @@ int nr_pbch_channel_level(int **dl_ch_estimates_ext,
#endif
int avg1=0,avg2=0;
- for (aarx=0; aarxnb_antennas_rx; aarx++) {
+ for (int aarx=0; aarxnb_antennas_rx; aarx++) {
//clear average level
#if defined(__x86_64__) || defined(__i386__)
avg128 = _mm_setzero_si128();
- dl_ch128=(__m128i *)&dl_ch_estimates_ext[aarx][symbol*20*12];
+ dl_ch128=(__m128i *)dl_ch_estimates_ext[aarx];
#elif defined(__arm__)
avg128 = vdupq_n_s32(0);
- dl_ch128=(int16x8_t *)&dl_ch_estimates_ext[aarx][symbol*20*12];
+ dl_ch128=(int16x8_t *)dl_ch_estimates_ext[aarx];
#endif
- for (rb=0; rb 0 && symbol < 4),
- "symbol %d is illegal for PBCH DM-RS\n",
- symbol);
-
- // printf("comp: symbol %d : nb_re %d\n",symbol,nb_re);
-
+static void nr_pbch_channel_compensation(struct complex16 rxdataF_ext[][PBCH_MAX_RE_PER_SYMBOL],
+ struct complex16 dl_ch_estimates_ext[][PBCH_MAX_RE_PER_SYMBOL],
+ int nb_re,
+ struct complex16 rxdataF_comp[][PBCH_MAX_RE_PER_SYMBOL],
+ NR_DL_FRAME_PARMS *frame_parms,
+ uint8_t output_shift) {
for (int aarx=0; aarxnb_antennas_rx; aarx++) {
- vect128 *dl_ch128 = (vect128 *)&dl_ch_estimates_ext[aarx][symbol*20*12];
- vect128 *rxdataF128 = (vect128 *)&rxdataF_ext[aarx][symbol*20*12];
- vect128 *rxdataF_comp128 = (vect128 *)&rxdataF_comp[aarx][symbol*20*12];
- /*
- printf("ch compensation dl_ch ext addr %p \n", &dl_ch_estimates_ext[aarx][symbol*20*12]);
- printf("rxdataf ext addr %p symbol %d\n", &rxdataF_ext[aarx][symbol*20*12], symbol);
- printf("rxdataf_comp addr %p\n",&rxdataF_comp[aarx][symbol*20*12]);
- */
+ vect128 *dl_ch128 = (vect128 *)dl_ch_estimates_ext[aarx];
+ vect128 *rxdataF128 = (vect128 *)rxdataF_ext[aarx];
+ vect128 *rxdataF_comp128 = (vect128 *)rxdataF_comp[aarx];
for (int re=0; rellr;
reset = 1;
// x1 is set in first call to lte_gold_generic
x2 = Nid; //this is c_init
@@ -361,10 +338,10 @@ static void nr_pbch_unscrambling(NR_UE_PBCH *pbch,
reset = 0;
}
- (pbch->pbch_a_interleaved) ^= ((unscrambling_mask>>i)&1)? ((pbch->pbch_a_prime>>i)&1)<pbch_a_prime>>i)&1) ^ ((s>>((k+offset)&0x1f))&1))<>i)&1)? ((pbch_a_prime>>i)&1)<>i)&1) ^ ((s>>((k+offset)&0x1f))&1))<>i)&1));
#ifdef DEBUG_PBCH_ENCODING
- printf("i %d k %d offset %d (unscrambling_mask>>i)&1) %d s: %08x\t pbch_a_interleaved 0x%08x (!((unscrambling_mask>>i)&1)) %d\n", i, k, offset, (unscrambling_mask>>i)&1, s, pbch->pbch_a_interleaved,
+ printf("i %d k %d offset %d (unscrambling_mask>>i)&1) %d s: %08x\t pbch_a_interleaved 0x%08x (!((unscrambling_mask>>i)&1)) %d\n", i, k, offset, (unscrambling_mask>>i)&1, s, *pbch_a_interleaved,
(!((unscrambling_mask>>i)&1)));
#endif
} else {
@@ -386,18 +363,16 @@ static void nr_pbch_unscrambling(NR_UE_PBCH *pbch,
}
}
-void nr_pbch_quantize(int16_t *pbch_llr8,
- int16_t *pbch_llr,
- uint16_t len) {
- uint16_t i;
-
- for (i=0; i31)
pbch_llr8[i]=32;
else if (pbch_llr[i]<-31)
pbch_llr8[i]=-32;
else
- pbch_llr8[i] = (char)(pbch_llr[i]);
+ pbch_llr8[i]=pbch_llr[i];
}
}
/*
@@ -410,36 +385,33 @@ uint8_t pbch_deinterleaving_pattern[32] = {28,0,31,30,7,29,25,27,5,8,24,9,10,11,
int nr_rx_pbch( PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
+ int estimateSz, struct complex16 dl_ch_estimates [][estimateSz],
NR_UE_PBCH *nr_ue_pbch_vars,
NR_DL_FRAME_PARMS *frame_parms,
uint8_t gNB_id,
uint8_t i_ssb,
- MIMO_mode_t mimo_mode) {
-
+ MIMO_mode_t mimo_mode,
+ fapiPbch_t *result) {
NR_UE_COMMON *nr_ue_common_vars = &ue->common_vars;
int max_h=0;
int symbol;
//uint8_t pbch_a[64];
-//FT ?? cppcheck doesn't like pbch_a allocation because of line 525..and i don't get what this variable is for..
-//uint8_t *pbch_a = malloc(sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS);
- //uint32_t pbch_a_prime;
- int16_t *pbch_e_rx;
- uint8_t *decoded_output = nr_ue_pbch_vars->decoded_output;
+ //FT ?? cppcheck doesn't like pbch_a allocation because of line 525..and i don't get what this variable is for..
+ //uint8_t *pbch_a = malloc(sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS);
uint8_t nushift;
uint16_t M;
- uint8_t Lmax=frame_parms->Lmax;
+ uint8_t Lmax=frame_parms->Lmax;
//uint16_t crc;
//unsigned short idx_demod =0;
uint32_t decoderState=0;
//uint8_t decoderListSize = 8, pathMetricAppr = 0;
//time_stats_t polar_decoder_init,polar_rate_matching,decoding,bit_extraction,deinterleaving;
//time_stats_t path_metric,sorting,update_LLR;
-// FT ?? cppcheck fix memset(&pbch_a[0], 0, sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS);
+ // FT ?? cppcheck fix memset(&pbch_a[0], 0, sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS);
//printf("nr_pbch_ue nid_cell %d\n",frame_parms->Nid_cell);
-
- pbch_e_rx = &nr_ue_pbch_vars->llr[0];
- // clear LLR buffer
- memset(nr_ue_pbch_vars->llr,0,NR_POLAR_PBCH_E);
+ int16_t pbch_e_rx[960]= {0}; //Fixme: previous version erase only NR_POLAR_PBCH_E bytes
+ int16_t pbch_unClipped[960]= {0};
+ int pbch_e_rx_idx=0;
int symbol_offset=1;
if (ue->is_synchronized > 0)
@@ -447,20 +419,24 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
else
symbol_offset=0;
-
#ifdef DEBUG_PBCH
//printf("address dataf %p",nr_ue_common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF);
write_output("rxdataF0_pbch.m","rxF0pbch",
&nr_ue_common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[0][(symbol_offset+1)*frame_parms->ofdm_symbol_size],frame_parms->ofdm_symbol_size*3,1,1);
#endif
-
// symbol refers to symbol within SSB. symbol_offset is the offset of the SSB wrt start of slot
- for (symbol=1; symbol<4; symbol++) {
+ double log2_maxh;
+ for (symbol=1; symbol<4; symbol++) {
+ const uint16_t nb_re=symbol == 2 ? 72 : 180;
+ struct complex16 rxdataF_ext[frame_parms->nb_antennas_rx][PBCH_MAX_RE_PER_SYMBOL];
+ struct complex16 dl_ch_estimates_ext[frame_parms->nb_antennas_rx][PBCH_MAX_RE_PER_SYMBOL];
+ memset(dl_ch_estimates_ext,0, sizeof dl_ch_estimates_ext);
nr_pbch_extract(nr_ue_common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF,
- nr_ue_pbch_vars->dl_ch_estimates,
- nr_ue_pbch_vars->rxdataF_ext,
- nr_ue_pbch_vars->dl_ch_estimates_ext,
+ estimateSz,
+ dl_ch_estimates,
+ rxdataF_ext,
+ dl_ch_estimates_ext,
symbol,
symbol_offset,
frame_parms);
@@ -470,142 +446,139 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
#endif
if (symbol == 1) {
- max_h = nr_pbch_channel_level(nr_ue_pbch_vars->dl_ch_estimates_ext,
+ max_h = nr_pbch_channel_level(dl_ch_estimates_ext,
frame_parms,
- symbol);
- nr_ue_pbch_vars->log2_maxh = 3+(log2_approx(max_h)/2);
+ nb_re);
+ log2_maxh = 3+(log2_approx(max_h)/2);
}
#ifdef DEBUG_PBCH
LOG_I(PHY,"[PHY] PBCH log2_maxh = %d (%d)\n",nr_ue_pbch_vars->log2_maxh,max_h);
#endif
- nr_pbch_channel_compensation(nr_ue_pbch_vars->rxdataF_ext,
- nr_ue_pbch_vars->dl_ch_estimates_ext,
- nr_ue_pbch_vars->rxdataF_comp,
+ struct complex16 rxdataF_comp[frame_parms->nb_antennas_rx][PBCH_MAX_RE_PER_SYMBOL];
+ nr_pbch_channel_compensation(rxdataF_ext,
+ dl_ch_estimates_ext,
+ nb_re,
+ rxdataF_comp,
frame_parms,
- symbol,
- nr_ue_pbch_vars->log2_maxh); // log2_maxh+I0_shift
+ log2_maxh); // log2_maxh+I0_shift
/*if (frame_parms->nb_antennas_rx > 1)
pbch_detection_mrc(frame_parms,
- nr_ue_pbch_vars->rxdataF_comp,
+ rxdataF_comp,
symbol);*/
/*
if (mimo_mode == ALAMOUTI) {
- nr_pbch_alamouti(frame_parms,nr_ue_pbch_vars->rxdataF_comp,symbol);
+ nr_pbch_alamouti(frame_parms,rxdataF_comp,symbol);
} else if (mimo_mode != SISO) {
LOG_I(PHY,"[PBCH][RX] Unsupported MIMO mode\n");
return(-1);
}
*/
- if (symbol==2) {
- nr_pbch_quantize(pbch_e_rx,
- (short *)&(nr_ue_pbch_vars->rxdataF_comp[0][symbol*240]),
- 144);
- pbch_e_rx+=144;
- } else {
- nr_pbch_quantize(pbch_e_rx,
- (short *)&(nr_ue_pbch_vars->rxdataF_comp[0][symbol*240]),
- 360);
- pbch_e_rx+=360;
- }
+ int nb=symbol==2 ? 144 : 360;
+ nr_pbch_quantize(pbch_e_rx+pbch_e_rx_idx,
+ (short *)rxdataF_comp[0],
+ nb);
+ memcpy(pbch_unClipped+pbch_e_rx_idx, rxdataF_comp[0], nb*sizeof(int16_t));
+ pbch_e_rx_idx+=nb;
}
+ // legacy code use int16, but it is complex16
+ UEscopeCopy(ue, pbchRxdataF_comp, pbch_unClipped, sizeof(struct complex16), frame_parms->nb_antennas_rx, pbch_e_rx_idx/2);
+ UEscopeCopy(ue, pbchLlr, pbch_e_rx, sizeof(int16_t), frame_parms->nb_antennas_rx, pbch_e_rx_idx);
#ifdef DEBUG_PBCH
- write_output("rxdataF_comp.m","rxFcomp",&nr_ue_pbch_vars->rxdataF_comp[0][240],240*3,1,1);
-#endif
- pbch_e_rx = nr_ue_pbch_vars->llr;
- //demod_pbch_e = nr_ue_pbch_vars->demod_pbch_e;
-// FT?? cppcheck fix - pbch_a = nr_ue_pbch_vars->pbch_a;
-#ifdef DEBUG_PBCH
- //pbch_e_rx = &nr_ue_pbch_vars->llr[0];
- short *p = (short *)&(nr_ue_pbch_vars->rxdataF_comp[0][20*12]);
-
+ write_output("rxdataF_comp.m","rxFcomp",rxdataF_comp[0],240*3,1,1);
+ short *p = (short *)rxdataF_comp[0]);
+
for (int cnt = 0; cnt < 864 ; cnt++)
printf("pbch rx llr %d\n",*(pbch_e_rx+cnt));
-
+
#endif
//un-scrambling
M = NR_POLAR_PBCH_E;
nushift = (Lmax==4)? i_ssb&3 : i_ssb&7;
uint32_t unscrambling_mask = (Lmax==64)?0x100006D:0x1000041;
-
- nr_pbch_unscrambling(nr_ue_pbch_vars,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0);
+ uint32_t pbch_a_interleaved=0;
+ uint32_t pbch_a_prime=0;
+ nr_pbch_unscrambling(nr_ue_pbch_vars, pbch_e_rx, frame_parms->Nid_cell, nushift, M, NR_POLAR_PBCH_E,
+ 0, 0, pbch_a_prime, &pbch_a_interleaved);
//polar decoding de-rate matching
- decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&nr_ue_pbch_vars->pbch_a_prime,0,
+ uint64_t tmp=0;
+ decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&tmp,0,
NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL);
+ pbch_a_prime=tmp;
+ if(decoderState)
+ return(decoderState);
- if(decoderState) return(decoderState);
-
- // printf("polar decoder output 0x%08x\n",nr_ue_pbch_vars->pbch_a_prime);
+ // printf("polar decoder output 0x%08x\n",pbch_a_prime);
// Decoder reversal
uint32_t a_reversed=0;
for (int i=0; ipbch_a_prime>>i)&1)<<(31-i);
+ a_reversed |= (((uint64_t)pbch_a_prime>>i)&1)<<(31-i);
- nr_ue_pbch_vars->pbch_a_prime = a_reversed;
+ pbch_a_prime = a_reversed;
//payload un-scrambling
- nr_ue_pbch_vars->pbch_a_interleaved=0;
M = (Lmax == 64)? (NR_POLAR_PBCH_PAYLOAD_BITS - 6) : (NR_POLAR_PBCH_PAYLOAD_BITS - 3);
- nushift = ((nr_ue_pbch_vars->pbch_a_prime>>24)&1) ^ (((nr_ue_pbch_vars->pbch_a_prime>>6)&1)<<1);
- nr_pbch_unscrambling(nr_ue_pbch_vars,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_PAYLOAD_BITS,1,unscrambling_mask);
- //printf("nushift %d sfn 3rd %d 2nd %d", nushift,((nr_ue_pbch_vars->pbch_a_prime>>6)&1), ((nr_ue_pbch_vars->pbch_a_prime>>24)&1) );
+ nushift = ((pbch_a_prime>>24)&1) ^ (((pbch_a_prime>>6)&1)<<1);
+ pbch_a_interleaved=0;
+ nr_pbch_unscrambling(nr_ue_pbch_vars, pbch_e_rx, frame_parms->Nid_cell, nushift, M, NR_POLAR_PBCH_PAYLOAD_BITS,
+ 1, unscrambling_mask, pbch_a_prime, &pbch_a_interleaved);
+ //printf("nushift %d sfn 3rd %d 2nd %d", nushift,((pbch_a_prime>>6)&1), ((pbch_a_prime>>24)&1) );
//payload deinterleaving
//uint32_t in=0;
uint32_t out=0;
for (int i=0; i<32; i++) {
- out |= ((nr_ue_pbch_vars->pbch_a_interleaved>>i)&1)<<(pbch_deinterleaving_pattern[i]);
+ out |= ((pbch_a_interleaved>>i)&1)<<(pbch_deinterleaving_pattern[i]);
#ifdef DEBUG_PBCH
- printf("i %d in 0x%08x out 0x%08x ilv %d (in>>i)&1) 0x%08x\n", i, nr_ue_pbch_vars->pbch_a_interleaved, out, pbch_deinterleaving_pattern[i], (nr_ue_pbch_vars->pbch_a_interleaved>>i)&1);
+ printf("i %d in 0x%08x out 0x%08x ilv %d (in>>i)&1) 0x%08x\n", i, pbch_a_interleaved, out, pbch_deinterleaving_pattern[i], (pbch_a_interleaved>>i)&1);
#endif
}
uint32_t payload = 0;
- //uint8_t xtra_byte = 0;
- nr_ue_pbch_vars->xtra_byte = (out>>24)&0xff;
+ result->xtra_byte = (out>>24)&0xff;
for (int i=0; i>i)&1)<<(NR_POLAR_PBCH_PAYLOAD_BITS-i-1);
-
+
for (int i=0; i<3; i++)
- decoded_output[i] = (uint8_t)((payload>>((3-i)<<3))&0xff);
-
- frame_parms->half_frame_bit = ((nr_ue_pbch_vars->xtra_byte>>4)&0x01); // computing the half frame index from the extra byte
-
+ result->decoded_output[i] = (uint8_t)((payload>>((3-i)<<3))&0xff);
+
+ frame_parms->half_frame_bit = (result->xtra_byte>>4)&0x01; // computing the half frame index from the extra byte
frame_parms->ssb_index = i_ssb; // ssb index corresponds to i_ssb for Lmax = 4,8
+
if (Lmax == 64) { // for Lmax = 64 ssb index 4th,5th and 6th bits are in extra byte
for (int i=0; i<3; i++)
- frame_parms->ssb_index += (((nr_ue_pbch_vars->xtra_byte>>(7-i))&0x01)<<(3+i));
+ frame_parms->ssb_index += (((result->xtra_byte>>(7-i))&0x01)<<(3+i));
}
ue->symbol_offset = nr_get_ssb_start_symbol(frame_parms,frame_parms->ssb_index);
+
if (frame_parms->half_frame_bit)
- ue->symbol_offset += (frame_parms->slots_per_frame>>1)*frame_parms->symbols_per_slot;
+ ue->symbol_offset += (frame_parms->slots_per_frame>>1)*frame_parms->symbols_per_slot;
uint8_t frame_number_4lsb = 0;
+
for (int i=0; i<4; i++)
- frame_number_4lsb |= ((nr_ue_pbch_vars->xtra_byte>>i)&1)<<(3-i);
-
+ frame_number_4lsb |= ((result->xtra_byte>>i)&1)<<(3-i);
+
proc->decoded_frame_rx = frame_number_4lsb;
-
#ifdef DEBUG_PBCH
- printf("xtra_byte %x payload %x\n", nr_ue_pbch_vars->xtra_byte, payload);
+ printf("xtra_byte %x payload %x\n", xtra_byte, payload);
for (int i=0; i<(NR_POLAR_PBCH_PAYLOAD_BITS>>3); i++) {
// printf("unscrambling pbch_a[%d] = %x \n", i,pbch_a[i]);
- printf("[PBCH] decoder payload[%d] = %x\n",i,decoded_output[i]);
+ printf("[PBCH] decoder payload[%d] = %x\n",i,result->decoded_output[i]);
}
-#endif
+#endif
nr_downlink_indication_t dl_indication;
fapi_nr_rx_indication_t *rx_ind=calloc(sizeof(*rx_ind),1);
uint16_t number_pdus = 1;
-
nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id);
- nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc);
+ nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc,(void *)result);
if (ue->if_inst && ue->if_inst->dl_indication)
ue->if_inst->dl_indication(&dl_indication, NULL);
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
index 9bc3643557..aac59a7da1 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
@@ -1152,11 +1152,14 @@ int rx_sss(PHY_VARS_NR_UE *phy_vars_ue,int32_t *tot_metric,uint8_t *flip_max,uin
*/
int nr_rx_pbch( PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
+ const int estimateSz,
+ struct complex16 dl_ch_estimates[][estimateSz],
NR_UE_PBCH *nr_ue_pbch_vars,
NR_DL_FRAME_PARMS *frame_parms,
uint8_t eNB_id,
uint8_t i_ssb,
- MIMO_mode_t mimo_mode);
+ MIMO_mode_t mimo_mode,
+ fapiPbch_t* result);
int nr_pbch_detection(UE_nr_rxtx_proc_t *proc,
PHY_VARS_NR_UE *ue,
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
index c50cd9ab4f..139913b544 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
@@ -88,9 +88,9 @@ typedef struct {
/// LDPC-code outputs
uint8_t *d[MAX_NUM_NR_ULSCH_SEGMENTS];
/// LDPC-code outputs (TS 36.212 V15.4.0, Sec 5.3.2 p. 17)
- uint8_t *e;
+ uint8_t *e;
/// Rate matching (Interleaving) outputs (TS 36.212 V15.4.0, Sec 5.4.2.2 p. 30)
- uint8_t *f;
+ uint8_t *f;
/// Number of code segments
uint32_t C;
/// Number of bits in code segments
@@ -122,55 +122,15 @@ typedef struct {
typedef struct {
/// SRS active flag
uint8_t srs_active;
-//#if defined(UPGRADE_RAT_NR)
-#if 1
// Pointers to HARQ processes for the ULSCH
NR_UL_UE_HARQ_t *harq_processes[NR_MAX_ULSCH_HARQ_PROCESSES];
int harq_process_id[NR_MAX_SLOTS_PER_FRAME];
// UL number of harq processes
uint8_t number_harq_processes_for_pusch;
-#endif
- /*
- /// Pointer to CQI data (+1 for 8 bits crc)
- uint8_t o[1+MAX_CQI_BYTES];
- /// Length of CQI data (bits)
- uint8_t O;
- /// Format of CQI data
- UCI_format_t uci_format;
- /// Rank information
- uint8_t o_RI[2];
- /// Length of rank information (bits)
- uint8_t O_RI;
- /// Pointer to ACK
- uint8_t o_ACK[4];
- */
/// Minimum number of CQI bits for PUSCH (36-212 r8.6, Sec 5.2.4.1 p. 37)
uint8_t O_CQI_MIN;
/// ACK/NAK Bundling flag
uint8_t bundling;
- /// Concatenated "g"-sequences (for definition see 36-212 V15.4.0 2018-12, p.31)
- uint8_t g[MAX_NUM_NR_CHANNEL_BITS] __attribute__ ((aligned(32)));
- /// Interleaved "h"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
- uint8_t h[MAX_NUM_NR_CHANNEL_BITS];
- /// Scrambled "b"-sequences (for definition see 36-211 V8.6 2009-03, p.14)
- uint8_t b_tilde[MAX_NUM_NR_CHANNEL_BITS];
- /// Modulated "d"-sequences (for definition see 36-211 V8.6 2009-03, p.14)
- int32_t d_mod[MAX_NUM_NR_RE] __attribute__ ((aligned(16)));
- /// Transform-coded "y"-sequences (for definition see 38-211 V15.3.0 2018-09, subsection 6.3.1.4)
- int32_t y[MAX_NUM_NR_RE] __attribute__ ((aligned(16)));
- /*
- /// "q" sequences for CQI/PMI (for definition see 36-212 V8.6 2009-03, p.27)
- uint8_t q[MAX_CQI_PAYLOAD];
-
- /// coded and interleaved CQI bits
- uint8_t o_w[(MAX_CQI_BITS+8)*3];
- /// coded CQI bits
- uint8_t o_d[96+((MAX_CQI_BITS+8)*3)];
- /// coded ACK bits
- uint8_t q_ACK[MAX_ACK_PAYLOAD];
- /// coded RI bits
- uint8_t q_RI[MAX_RI_PAYLOAD];
- */
/// beta_offset_cqi times 8
uint16_t beta_offset_cqi_times8;
/// beta_offset_ri times 8
@@ -219,7 +179,9 @@ typedef struct {
/// Pointer to the payload
uint8_t *b;
/// Pointers to transport block segments
- uint8_t *c[MAX_NUM_NR_DLSCH_SEGMENTS];
+ uint8_t **c;
+ /// soft bits for each received segment ("d"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
+ int16_t **d;
/// Index of current HARQ round for this DLSCH
uint8_t round;
/// MCS table for this DLSCH
@@ -234,14 +196,8 @@ typedef struct {
uint8_t rvidx;
/// MIMO mode for this DLSCH
MIMO_nrmode_t mimo_mode;
- /// soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
- int16_t *w[MAX_NUM_NR_DLSCH_SEGMENTS];
- /// for abstraction soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
- //double w_abs[MAX_NUM_NR_DLSCH_SEGMENTS][3*8448];
- /// soft bits for each received segment ("d"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
- int16_t *d[MAX_NUM_NR_DLSCH_SEGMENTS];
/// LDPC processing buffers
- t_nrLDPC_procBuf* p_nrLDPC_procBuf[MAX_NUM_NR_DLSCH_SEGMENTS];
+ t_nrLDPC_procBuf **p_nrLDPC_procBuf;
/// Number of code segments
uint32_t C;
/// Number of bits in code segments
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c
index 6530dd9512..d3f362b90c 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c
@@ -86,16 +86,17 @@ void nr_rf_card_config_freq(openair0_config_t *openair0_cfg,
uint8_t cc_id = 0;
PHY_VARS_NR_UE *ue = PHY_vars_UE_g[mod_id][cc_id];
int rf_chain = ue->rf_map.chain;
+ double freq_scale = (double)(dl_carrier + freq_offset) / dl_carrier;
for (int i = rf_chain; i < rf_chain + 4; i++) {
if (i < openair0_cfg->rx_num_channels)
- openair0_cfg->rx_freq[i + rf_chain] = dl_carrier + freq_offset;
+ openair0_cfg->rx_freq[i + rf_chain] = dl_carrier * freq_scale;
else
openair0_cfg->rx_freq[i] = 0.0;
if (itx_num_channels)
- openair0_cfg->tx_freq[i] = ul_carrier + freq_offset;
+ openair0_cfg->tx_freq[i] = ul_carrier * freq_scale;
else
openair0_cfg->tx_freq[i] = 0.0;
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
index a2e4d0a411..be51f1f8b2 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
@@ -171,44 +171,26 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
NR_UE_ULSCH_t *ulsch,
NR_DL_FRAME_PARMS* frame_parms,
uint8_t harq_pid,
- unsigned int G)
-{
+ unsigned int G) {
+
start_meas(&ue->ulsch_encoding_stats);
-/////////////////////////parameters and variables declaration/////////////////////////
-///////////
-
- unsigned int crc;
- NR_UL_UE_HARQ_t *harq_process;
- uint16_t nb_rb ;
- uint32_t A, F;
- uint32_t *pz;
- uint8_t mod_order;
- uint16_t Kr,r;
- uint32_t r_offset;
- uint32_t E,Kb;
- uint8_t Ilbrm;
- uint16_t R;
- float Coderate;
-
-///////////
-///////////////////////////////////////////////////////////////////////////////////////
-
/////////////////////////parameters and variables initialization/////////////////////////
///////////
- crc = 1;
- harq_process = ulsch->harq_processes[harq_pid];
- nb_rb = harq_process->pusch_pdu.rb_size;
- A = harq_process->pusch_pdu.pusch_data.tb_size*8;
- pz = &harq_process->Z;
- mod_order = nr_get_Qm_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table);
- R = nr_get_code_rate_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table);
- Kr=0;
- r_offset=0;
- F=0;
- Ilbrm = 0;
- Coderate = 0.0;
+ unsigned int crc = 1;
+ NR_UL_UE_HARQ_t *harq_process = ulsch->harq_processes[harq_pid];
+ uint16_t nb_rb = harq_process->pusch_pdu.rb_size;
+ uint32_t A = harq_process->pusch_pdu.pusch_data.tb_size*8;
+ uint32_t *pz = &harq_process->Z;
+ uint8_t mod_order = nr_get_Qm_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table);
+ uint16_t R = nr_get_code_rate_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table);
+ uint16_t Kr=0;
+ uint32_t r_offset=0;
+ uint32_t F=0;
+ uint8_t Ilbrm = 0;
+ float Coderate = 0.0;
+
///////////
/////////////////////////////////////////////////////////////////////////////////////////
@@ -284,14 +266,19 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_IN);
start_meas(&ue->ulsch_segmentation_stats);
- Kb=nr_segmentation(harq_process->b,
- harq_process->c,
- harq_process->B,
- &harq_process->C,
- &harq_process->K,
- pz,
- &harq_process->F,
- harq_process->BG);
+ uint32_t Kb=nr_segmentation(harq_process->b,
+ harq_process->c,
+ harq_process->B,
+ &harq_process->C,
+ &harq_process->K,
+ pz,
+ &harq_process->F,
+ harq_process->BG);
+
+ if (harq_process->C>MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*harq_process->pusch_pdu.nrOfLayers) {
+ LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d\n",harq_process->C,harq_process->B);
+ return(-1);
+ }
stop_meas(&ue->ulsch_segmentation_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_OUT);
@@ -308,7 +295,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
//printf("segment Z %d k %d Kr %d BG %d\n", *pz,harq_process->K,Kr,BG);
//start_meas(te_stats);
- for (r=0; rC; r++) {
+ for (int r=0; rC; r++) {
//channel_input[r] = &harq_process->d[r][0];
#ifdef DEBUG_ULSCH_CODING
printf("Encoder: B %d F %d \n",harq_process->B, harq_process->F);
@@ -343,8 +330,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LDPC_ENCODER_OPTIM, VCD_FUNCTION_IN);
start_meas(&ue->ulsch_ldpc_encoding_stats);
- for(int j = 0; j < (harq_process->C/8 + 1); j++)
- {
+ for(int j = 0; j < (harq_process->C/8 + 1); j++) {
impp.macro_num = j;
nrLDPC_encoder(harq_process->c,harq_process->d,*pz,Kb,Kr,harq_process->BG,&impp);
}
@@ -367,14 +353,13 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
F = harq_process->F;
Kr = harq_process->K;
- for (r=0; rC; r++) { // looping over C segments
-
+ for (int r=0; rC; r++) { // looping over C segments
if (harq_process->F>0) {
- for (int k=(Kr-F-2*(*pz)); kd[r][k] = NR_NULL;
- //if (k<(Kr-F+8))
- //printf("r %d filler bits [%d] = %d \n", r,k, harq_process->d[r][k]);
- }
+ for (int k=(Kr-F-2*(*pz)); kd[r][k] = NR_NULL;
+ //if (k<(Kr-F+8))
+ //printf("r %d filler bits [%d] = %d \n", r,k, harq_process->d[r][k]);
+ }
}
@@ -389,7 +374,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
///////////////////////// d---->| Rate matching bit selection |---->e /////////////////////////
///////////
- E = nr_get_E(G, harq_process->C, mod_order, harq_process->pusch_pdu.nrOfLayers, r);
+ uint32_t E = nr_get_E(G, harq_process->C, mod_order, harq_process->pusch_pdu.nrOfLayers, r);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_IN);
start_meas(&ue->ulsch_rate_matching_stats);
@@ -430,9 +415,9 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
start_meas(&ue->ulsch_interleaving_stats);
nr_interleaving_ldpc(E,
- mod_order,
- harq_process->e+r_offset,
- harq_process->f+r_offset);
+ mod_order,
+ harq_process->e+r_offset,
+ harq_process->f+r_offset);
stop_meas(&ue->ulsch_interleaving_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_INTERLEAVING_LDPC, VCD_FUNCTION_OUT);
@@ -454,8 +439,6 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
}
- memcpy(ulsch->g,harq_process->f,G); // g is the concatenated code block
-
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT);
stop_meas(&ue->ulsch_encoding_stats);
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
index 41cf9c2ffa..802cb55e03 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
@@ -105,18 +105,15 @@ void nr_pusch_codeword_scrambling(uint8_t *in,
}
void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
- unsigned char harq_pid,
- uint32_t frame,
- uint8_t slot,
- uint8_t thread_id,
- int gNB_id) {
+ unsigned char harq_pid,
+ uint32_t frame,
+ uint8_t slot,
+ uint8_t thread_id,
+ int gNB_id) {
LOG_D(PHY,"nr_ue_ulsch_procedures hard_id %d %d.%d\n",harq_pid,frame,slot);
uint32_t available_bits;
- uint8_t cwd_index, l;
- uint32_t scrambled_output[NR_MAX_NB_CODEWORDS][NR_MAX_PDSCH_ENCODED_LENGTH>>5];
- int16_t **tx_layers;
int32_t **txdataF;
int8_t Wf[2], Wt[2];
int l_prime[2], delta;
@@ -125,102 +122,100 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
int sample_offsetF, N_RE_prime;
NR_DL_FRAME_PARMS *frame_parms = &UE->frame_parms;
- NR_UE_PUSCH *pusch_ue = UE->pusch_vars[thread_id][gNB_id];
- uint8_t num_of_codewords = 1; // tmp assumption
int N_PRB_oh = 0; // higher layer (RRC) parameter xOverhead in PUSCH-ServingCellConfig
uint16_t number_dmrs_symbols = 0;
- for (cwd_index = 0;cwd_index < num_of_codewords; cwd_index++) {
+ NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[thread_id][gNB_id];
+ NR_UL_UE_HARQ_t *harq_process_ul_ue = ulsch_ue->harq_processes[harq_pid];
+ nfapi_nr_ue_pusch_pdu_t *pusch_pdu = &harq_process_ul_ue->pusch_pdu;
- NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[thread_id][gNB_id][cwd_index];
- NR_UL_UE_HARQ_t *harq_process_ul_ue = ulsch_ue->harq_processes[harq_pid];
- nfapi_nr_ue_pusch_pdu_t *pusch_pdu = &harq_process_ul_ue->pusch_pdu;
+ int start_symbol = pusch_pdu->start_symbol_index;
+ uint16_t ul_dmrs_symb_pos = pusch_pdu->ul_dmrs_symb_pos;
+ uint8_t number_of_symbols = pusch_pdu->nr_of_symbols;
+ uint8_t dmrs_type = pusch_pdu->dmrs_config_type;
+ uint16_t start_rb = pusch_pdu->rb_start;
+ uint16_t nb_rb = pusch_pdu->rb_size;
+ uint8_t Nl = pusch_pdu->nrOfLayers;
+ uint8_t mod_order = pusch_pdu->qam_mod_order;
+ uint16_t rnti = pusch_pdu->rnti;
+ uint8_t cdm_grps_no_data = pusch_pdu->num_dmrs_cdm_grps_no_data;
+ uint16_t start_sc = frame_parms->first_carrier_offset + (start_rb+pusch_pdu->bwp_start)*NR_NB_SC_PER_RB;
- int start_symbol = pusch_pdu->start_symbol_index;
- uint16_t ul_dmrs_symb_pos = pusch_pdu->ul_dmrs_symb_pos;
- uint8_t number_of_symbols = pusch_pdu->nr_of_symbols;
- uint8_t dmrs_type = pusch_pdu->dmrs_config_type;
- uint16_t start_rb = pusch_pdu->rb_start;
- uint16_t nb_rb = pusch_pdu->rb_size;
- uint8_t Nl = pusch_pdu->nrOfLayers;
- uint8_t mod_order = pusch_pdu->qam_mod_order;
- uint16_t rnti = pusch_pdu->rnti;
- uint8_t cdm_grps_no_data = pusch_pdu->num_dmrs_cdm_grps_no_data;
- uint16_t start_sc = frame_parms->first_carrier_offset + (start_rb+pusch_pdu->bwp_start)*NR_NB_SC_PER_RB;
+ if (start_sc >= frame_parms->ofdm_symbol_size)
+ start_sc -= frame_parms->ofdm_symbol_size;
- if (start_sc >= frame_parms->ofdm_symbol_size)
- start_sc -= frame_parms->ofdm_symbol_size;
+ ulsch_ue->Nid_cell = frame_parms->Nid_cell;
- ulsch_ue->Nid_cell = frame_parms->Nid_cell;
+ for (int i = start_symbol; i < start_symbol + number_of_symbols; i++) {
+ if((ul_dmrs_symb_pos >> i) & 0x01)
+ number_dmrs_symbols += 1;
+ }
- for (int i = start_symbol; i < start_symbol + number_of_symbols; i++) {
- if((ul_dmrs_symb_pos >> i) & 0x01)
- number_dmrs_symbols += 1;
- }
+ nb_dmrs_re_per_rb = ((dmrs_type == pusch_dmrs_type1) ? 6:4)*cdm_grps_no_data;
- nb_dmrs_re_per_rb = ((dmrs_type == pusch_dmrs_type1) ? 6:4)*cdm_grps_no_data;
+ LOG_D(PHY,"ulsch %x : start_rb %d bwp_start %d start_sc %d start_symbol %d num_symbols %d cdmgrpsnodata %d num_dmrs %d dmrs_re_per_rb %d\n",
+ rnti,start_rb,pusch_pdu->bwp_start,start_sc,start_symbol,number_of_symbols,cdm_grps_no_data,number_dmrs_symbols,nb_dmrs_re_per_rb);
- LOG_D(PHY,"ulsch %x : start_rb %d bwp_start %d start_sc %d start_symbol %d num_symbols %d cdmgrpsnodata %d num_dmrs %d dmrs_re_per_rb %d\n",
- rnti,start_rb,pusch_pdu->bwp_start,start_sc,start_symbol,number_of_symbols,cdm_grps_no_data,number_dmrs_symbols,nb_dmrs_re_per_rb);
+ // TbD num_of_mod_symbols is set but never used
+ N_RE_prime = NR_NB_SC_PER_RB*number_of_symbols - nb_dmrs_re_per_rb*number_dmrs_symbols - N_PRB_oh;
+ harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb;
- // TbD num_of_mod_symbols is set but never used
- N_RE_prime = NR_NB_SC_PER_RB*number_of_symbols - nb_dmrs_re_per_rb*number_dmrs_symbols - N_PRB_oh;
- harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb*num_of_codewords;
+ /////////////////////////ULSCH coding/////////////////////////
+ ///////////
- /////////////////////////ULSCH coding/////////////////////////
- ///////////
-
- unsigned int G = nr_get_G(nb_rb, number_of_symbols,
- nb_dmrs_re_per_rb, number_dmrs_symbols, mod_order, Nl);
+ unsigned int G = nr_get_G(nb_rb, number_of_symbols,
+ nb_dmrs_re_per_rb, number_dmrs_symbols, mod_order, Nl);
- trace_NRpdu(DIRECTION_UPLINK,
- ulsch_ue->harq_processes[harq_pid]->a,
- ulsch_ue->harq_processes[harq_pid]->pusch_pdu.pusch_data.tb_size,
- 0, WS_C_RNTI, rnti, frame, slot, 0, 0);
+ trace_NRpdu(DIRECTION_UPLINK,
+ harq_process_ul_ue->a,
+ harq_process_ul_ue->pusch_pdu.pusch_data.tb_size,
+ 0, WS_C_RNTI, rnti, frame, slot, 0, 0);
- if (nr_ulsch_encoding(UE, ulsch_ue, frame_parms, harq_pid, G) == -1)
- return;
+ if (nr_ulsch_encoding(UE, ulsch_ue, frame_parms, harq_pid, G) == -1)
+ return;
- ///////////
- ////////////////////////////////////////////////////////////////////
+ ///////////
+ ////////////////////////////////////////////////////////////////////
- /////////////////////////ULSCH scrambling/////////////////////////
- ///////////
+ /////////////////////////ULSCH scrambling/////////////////////////
+ ///////////
- available_bits = G;
+ available_bits = G;
+ uint32_t scrambled_output[(available_bits>>5)+1];
+ memset(scrambled_output, 0, ((available_bits>>5)+1)*sizeof(uint32_t));
- memset(scrambled_output[cwd_index], 0, ((available_bits>>5)+1)*sizeof(uint32_t));
+ nr_pusch_codeword_scrambling(harq_process_ul_ue->f,
+ available_bits,
+ ulsch_ue->Nid_cell,
+ rnti,
+ false,
+ scrambled_output);
- nr_pusch_codeword_scrambling(ulsch_ue->g,
- available_bits,
- ulsch_ue->Nid_cell,
- rnti,
- false,
- scrambled_output[cwd_index]); // assume one codeword for the moment
+ /////////////
+ //////////////////////////////////////////////////////////////////////////
+ /////////////////////////ULSCH modulation/////////////////////////
+ ///////////
- /////////////
- //////////////////////////////////////////////////////////////////////////
+ int max_num_re = number_of_symbols*nb_rb*NR_NB_SC_PER_RB;
+ int32_t d_mod[max_num_re] __attribute__ ((aligned(16)));
- /////////////////////////ULSCH modulation/////////////////////////
- ///////////
-
- nr_modulation(scrambled_output[cwd_index], // assume one codeword for the moment
- available_bits,
- mod_order,
- (int16_t *)ulsch_ue->d_mod);
+ nr_modulation(scrambled_output, // assume one codeword for the moment
+ available_bits,
+ mod_order,
+ (int16_t *)d_mod);
- ///////////
- ////////////////////////////////////////////////////////////////////////
+ ///////////
+ ////////////////////////////////////////////////////////////////////////
/////////////////////////DMRS Modulation/////////////////////////
///////////
- uint32_t ***pusch_dmrs = UE->nr_gold_pusch_dmrs[slot];
+ uint32_t **pusch_dmrs = UE->nr_gold_pusch_dmrs[slot];
uint16_t n_dmrs = (pusch_pdu->bwp_start + start_rb + nb_rb)*((dmrs_type == pusch_dmrs_type1) ? 6:4);
int16_t mod_dmrs[n_dmrs<<1] __attribute((aligned(16)));
///////////
@@ -256,9 +251,11 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
/////////////////////////ULSCH layer mapping/////////////////////////
///////////
- tx_layers = (int16_t **)pusch_ue->txdataF_layers;
+ int16_t **tx_layers = (int16_t **)malloc16_clear(Nl*sizeof(int16_t *));
+ for (int nl=0; nlulsch[thread_id][gNB_id],
+ nr_ue_layer_mapping((int16_t *)d_mod,
Nl,
available_bits/mod_order,
tx_layers);
@@ -276,13 +273,16 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
uint8_t u = 0, v = 0;
int16_t *dmrs_seq = NULL;
+ /// Transform-coded "y"-sequences (for definition see 38-211 V15.3.0 2018-09, subsection 6.3.1.4)
+ int32_t y[max_num_re] __attribute__ ((aligned(16)));
+
// if transform precoding is enbaled (value 0)
if (pusch_pdu->transform_precoding == 0) {
uint32_t nb_re_pusch=nb_rb * NR_NB_SC_PER_RB;
uint32_t y_offset = 0;
uint16_t num_dmrs_res_per_symbol = nb_rb*(NR_NB_SC_PER_RB/2);
-
+
// Calculate index to dmrs seq array based on number of DMRS Subcarriers on this symbol
index = get_index_for_dmrs_lowpapr_seq(num_dmrs_res_per_symbol);
u = pusch_pdu->dfts_ofdm.low_papr_group_number;
@@ -291,59 +291,54 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
AssertFatal(index >= 0, "Num RBs not configured according to 3GPP 38.211 section 6.3.1.4. For PUSCH with transform precoding, num RBs cannot be multiple of any other primenumber other than 2,3,5\n");
AssertFatal(dmrs_seq != NULL, "DMRS low PAPR seq not found, check if DMRS sequences are generated");
-
+
LOG_D(PHY,"Transform Precoding params. u: %d, v: %d, index for dmrsseq: %d\n", u, v, index);
- for (l = start_symbol; l < start_symbol + number_of_symbols; l++) {
+ for (int l = start_symbol; l < start_symbol + number_of_symbols; l++) {
if((ul_dmrs_symb_pos >> l) & 0x01)
/* In the symbol with DMRS no data would be transmitted CDM groups is 2*/
continue;
- nr_dft(&ulsch_ue->y[y_offset], &((int32_t*)tx_layers[0])[y_offset], nb_re_pusch);
+ nr_dft(&y[y_offset], &((int32_t*)tx_layers[0])[y_offset], nb_re_pusch);
y_offset = y_offset + nb_re_pusch;
LOG_D(PHY,"Transform precoding being done on data- symbol: %d, nb_re_pusch: %d, y_offset: %d\n", l, nb_re_pusch, y_offset);
- #ifdef DEBUG_PUSCH_MAPPING
- printf("NR_ULSCH_UE: y_offset %d\t nb_re_pusch %d \t Symbol %d \t nb_rb %d \n",
- y_offset, nb_re_pusch, l, nb_rb);
- #endif
+#ifdef DEBUG_PUSCH_MAPPING
+ printf("NR_ULSCH_UE: y_offset %d\t nb_re_pusch %d \t Symbol %d \t nb_rb %d \n",
+ y_offset, nb_re_pusch, l, nb_rb);
+#endif
}
- #ifdef DEBUG_DFT_IDFT
- int32_t debug_symbols[MAX_NUM_NR_RE] __attribute__ ((aligned(16)));
- int offset = 0;
- printf("NR_ULSCH_UE: available_bits: %d, mod_order: %d", available_bits,mod_order);
+#ifdef DEBUG_DFT_IDFT
+ int32_t debug_symbols[max_num_re] __attribute__ ((aligned(16)));
+ int offset = 0;
+ printf("NR_ULSCH_UE: available_bits: %d, mod_order: %d", available_bits,mod_order);
- for (int ll = 0; ll < (available_bits/mod_order); ll++) {
- debug_symbols[ll] = ulsch_ue->y[ll];
- }
-
- printf("NR_ULSCH_UE: numSym: %d, num_dmrs_sym: %d", number_of_symbols,number_dmrs_symbols);
- for (int ll = 0; ll < (number_of_symbols-number_dmrs_symbols); ll++) {
+ for (int ll = 0; ll < (available_bits/mod_order); ll++) {
+ debug_symbols[ll] = y[ll];
+ }
- nr_idft(&debug_symbols[offset], nb_re_pusch);
-
- offset = offset + nb_re_pusch;
-
- }
- LOG_M("preDFT_all_symbols.m","UE_preDFT", tx_layers[0],number_of_symbols*nb_re_pusch,1,1);
- LOG_M("postDFT_all_symbols.m","UE_postDFT", ulsch_ue->y,number_of_symbols*nb_re_pusch,1,1);
- LOG_M("DEBUG_IDFT_SYMBOLS.m","UE_Debug_IDFT", debug_symbols,number_of_symbols*nb_re_pusch,1,1);
- LOG_M("UE_DMRS_SEQ.m","UE_DMRS_SEQ", dmrs_seq,nb_re_pusch,1,1);
- #endif
+ printf("NR_ULSCH_UE: numSym: %d, num_dmrs_sym: %d", number_of_symbols,number_dmrs_symbols);
+ for (int ll = 0; ll < (number_of_symbols-number_dmrs_symbols); ll++) {
+ nr_idft(&debug_symbols[offset], nb_re_pusch);
+ offset = offset + nb_re_pusch;
+ }
+ LOG_M("preDFT_all_symbols.m","UE_preDFT", tx_layers[0],number_of_symbols*nb_re_pusch,1,1);
+ LOG_M("postDFT_all_symbols.m","UE_postDFT", y,number_of_symbols*nb_re_pusch,1,1);
+ LOG_M("DEBUG_IDFT_SYMBOLS.m","UE_Debug_IDFT", debug_symbols,number_of_symbols*nb_re_pusch,1,1);
+ LOG_M("UE_DMRS_SEQ.m","UE_DMRS_SEQ", dmrs_seq,nb_re_pusch,1,1);
+#endif
}
else
- memcpy(ulsch_ue->y, tx_layers[0], (available_bits/mod_order)*sizeof(int32_t));
+ memcpy(y, tx_layers[0], (available_bits/mod_order)*sizeof(int32_t));
-
- ///////////
- ////////////////////////////////////////////////////////////////////////
-
-
+ for (int nl = 0; nl < Nl; nl++)
+ free_and_zero(tx_layers[nl]);
+ free_and_zero(tx_layers);
/////////////////////////ULSCH RE mapping/////////////////////////
///////////
@@ -356,18 +351,16 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
uint16_t m = 0;
- #ifdef DEBUG_PUSCH_MAPPING
- printf("NR_ULSCH_UE: Value of CELL ID %d /t, u %d \n", frame_parms->Nid_cell, u);
- #endif
-
-
+#ifdef DEBUG_PUSCH_MAPPING
+ printf("NR_ULSCH_UE: Value of CELL ID %d /t, u %d \n", frame_parms->Nid_cell, u);
+#endif
// DMRS params for this ap
get_Wt(Wt, ap, dmrs_type);
get_Wf(Wf, ap, dmrs_type);
delta = get_delta(ap, dmrs_type);
- for (l=start_symbol; lpdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) {
AssertFatal(pusch_pdu->transform_precoding == 1, "PTRS NOT SUPPORTED IF TRANSFORM PRECODING IS ENABLED\n");
if(is_ptrs_symbol(l, ulsch_ue->ptrs_symbols)) {
is_ptrs_sym = 1;
- nr_modulation(pusch_dmrs[l][0], nb_rb, DMRS_MOD_ORDER, mod_ptrs);
+ nr_modulation(pusch_dmrs[l], nb_rb, DMRS_MOD_ORDER, mod_ptrs);
}
}
@@ -417,15 +407,15 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
if (k == ((start_sc+get_dmrs_freq_idx_ul(n, k_prime, delta, dmrs_type))%frame_parms->ofdm_symbol_size))
is_dmrs = 1;
} else if (is_ptrs_sym) {
- is_ptrs = is_ptrs_subcarrier(k,
- rnti,
- ap,
- dmrs_type,
- K_ptrs,
- nb_rb,
- pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset,
- start_sc,
- frame_parms->ofdm_symbol_size);
+ is_ptrs = is_ptrs_subcarrier(k,
+ rnti,
+ ap,
+ dmrs_type,
+ K_ptrs,
+ nb_rb,
+ pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset,
+ start_sc,
+ frame_parms->ofdm_symbol_size);
}
if (is_dmrs == 1) {
@@ -434,19 +424,19 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*dmrs_seq[2*dmrs_idx]) >> 15;
((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*dmrs_seq[(2*dmrs_idx) + 1]) >> 15;
-
+
} else {
- ((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*mod_dmrs[dmrs_idx<<1]) >> 15;
- ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15;
+ ((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*mod_dmrs[dmrs_idx<<1]) >> 15;
+ ((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 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
+#ifdef DEBUG_PUSCH_MAPPING
+ 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++;
@@ -463,14 +453,14 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
} else if (!is_dmrs_sym || allowed_xlsch_re_in_dmrs_symbol(k, start_sc, frame_parms->ofdm_symbol_size, cdm_grps_no_data, dmrs_type)) {
- ((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = ((int16_t *) ulsch_ue->y)[m<<1];
- ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = ((int16_t *) ulsch_ue->y)[(m<<1) + 1];
+ ((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = ((int16_t *) y)[m<<1];
+ ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = ((int16_t *) y)[(m<<1) + 1];
- #ifdef DEBUG_PUSCH_MAPPING
+#ifdef DEBUG_PUSCH_MAPPING
printf("m %d\t l %d \t k %d \t txdataF: %d %d\n",
- m, l, k, ((int16_t*)txdataF[ap])[(sample_offsetF)<<1],
- ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1]);
- #endif
+ m, l, k, ((int16_t*)txdataF[ap])[(sample_offsetF)<<1],
+ ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1]);
+#endif
m++;
@@ -486,10 +476,9 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
}
}
}
- }
NR_UL_UE_HARQ_t *harq_process_ulsch=NULL;
- harq_process_ulsch = UE->ulsch[thread_id][gNB_id][0]->harq_processes[harq_pid];
+ harq_process_ulsch = UE->ulsch[thread_id][gNB_id]->harq_processes[harq_pid];
harq_process_ulsch->status = SCH_IDLE;
///////////
diff --git a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c
index 88bdc3a9cd..54712cb64e 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c
@@ -861,7 +861,7 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain
/* perform correlation of rx data and pss sequence ie it is a dot product */
result = dot_product64((short*)primary_synchro_time_nr[pss_index],
- (short*) &(rxdata[ar][n+is*frame_parms->samples_per_frame]),
+ (short*)&(rxdata[ar][n+is*frame_parms->samples_per_frame]),
frame_parms->ofdm_symbol_size,
shift);
pss_corr_ue[pss_index][n] += abs64(result);
diff --git a/openair1/PHY/TOOLS/lte_ue_scope.c b/openair1/PHY/TOOLS/lte_ue_scope.c
index 00560f2d74..9b3f65d7d1 100644
--- a/openair1/PHY/TOOLS/lte_ue_scope.c
+++ b/openair1/PHY/TOOLS/lte_ue_scope.c
@@ -51,7 +51,7 @@ void reset_stats(FL_OBJECT *button, long arg) {
int i,j,k;
PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0];
- for (i=0; idlsch[i][0]->Mlimit; j++) {
phy_vars_eNB->UE_stats[i].dlsch_NAK[k][j]=0;
diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c
index 5594d56693..fe0f785ef4 100644
--- a/openair1/PHY/TOOLS/nr_phy_scope.c
+++ b/openair1/PHY/TOOLS/nr_phy_scope.c
@@ -40,6 +40,13 @@ const FL_COLOR water_colors[4] = {FL_BLUE,FL_GREEN,FL_YELLOW,FL_RED};
typedef struct complex16 scopeSample_t;
#define SquaredNorm(VaR) ((VaR).r*(VaR).r+(VaR).i*(VaR).i)
+typedef struct {
+ int dataSize;
+ int elementSz;
+ int colSz;
+ int lineSz;
+} scopeGraphData_t;
+
typedef struct OAIgraph {
FL_OBJECT *graph;
FL_OBJECT *text;
@@ -56,7 +63,7 @@ typedef struct OAIgraph {
boolean_t initDone;
int iteration;
void (*gNBfunct) (struct OAIgraph *graph, scopeData_t *p, int UE_id);
- void (*nrUEfunct)(struct OAIgraph *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id);
+ void (*nrUEfunct)(scopeGraphData_t **data, struct OAIgraph *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id);
} OAIgraph_t;
/* Forms and Objects */
@@ -140,7 +147,7 @@ static OAIgraph_t gNBcommonGraph( void (*funct) (OAIgraph_t *graph, scopeData_t
return graph;
}
-static OAIgraph_t nrUEcommonGraph( void (*funct) (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id),
+static OAIgraph_t nrUEcommonGraph( void (*funct) (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id),
int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label, FL_COLOR pointColor) {
OAIgraph_t graph;
commonGraph(&graph, type, x, y, w, h, label, pointColor);
@@ -341,7 +348,7 @@ static void timeResponse (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) {
static void gNBfreqWaterFall (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) {
NR_DL_FRAME_PARMS *frame_parms=&p->gNB->frame_parms;
//use 1st antenna
- genericWaterFall(graph, (scopeSample_t *)p->rxdataF, frame_parms->samples_per_frame_wCP,
+ genericWaterFall(graph, (scopeSample_t *)p->liveData, frame_parms->samples_per_frame_wCP,
frame_parms->slots_per_frame,
"X axis: Frequency domain, one subframe");
}
@@ -515,6 +522,7 @@ void phy_scope_gNB(OAI_phy_scope_t *form,
//fl_check_forms();
}
+
static void *scope_thread_gNB(void *arg) {
scopeData_t *p=(scopeData_t *) arg;
size_t stksize=0;
@@ -539,11 +547,12 @@ static void *scope_thread_gNB(void *arg) {
return NULL;
}
+
static void copyRxdataF(int32_t *data, int slot, void *scopeData) {
scopeData_t *scope=(scopeData_t *)scopeData;
- memcpy(scope->rxdataF + slot*scope->gNB->frame_parms.samples_per_slot_wCP,
+ memcpy(((int32_t *)scope->liveData) + slot*scope->gNB->frame_parms.samples_per_slot_wCP,
data,
- scope->gNB->frame_parms.samples_per_slot_wCP);
+ scope->gNB->frame_parms.samples_per_slot_wCP*sizeof(int32_t));
}
void gNBinitScope(scopeParms_t *p) {
@@ -554,11 +563,11 @@ void gNBinitScope(scopeParms_t *p) {
scope->ru=p->ru;
scope->gNB=p->gNB;
scope->slotFunc=copyRxdataF;
- AssertFatal(scope->rxdataF=(int32_t *) calloc(p->gNB->frame_parms.samples_per_frame_wCP*sizeof(int32_t),1),"");
+ AssertFatal(scope->liveData= calloc(p->gNB->frame_parms.samples_per_frame_wCP*sizeof(int32_t),1),"");
pthread_t forms_thread;
threadCreate(&forms_thread, scope_thread_gNB, p->gNB->scopeData, "scope", -1, OAI_PRIORITY_RT_LOW);
}
-static void ueWaterFall (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) {
+static void ueWaterFall (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) {
// Received signal in time domain of receive antenna 0
genericWaterFall(graph,
(scopeSample_t *) phy_vars_ue->common_vars.rxdata[0],
@@ -574,13 +583,19 @@ static void ueTimeResponse (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int
phy_vars_ue->frame_parms.samples_per_frame);
}
*/
-static void ueChannelResponse (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) {
+
+static void ueChannelResponse (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) {
// Channel Impulse Response
- genericPowerPerAntena(graph, phy_vars_ue->frame_parms.nb_antennas_rx,
- (const scopeSample_t **) phy_vars_ue->pbch_vars[eNB_id]->dl_ch_estimates_time,
- phy_vars_ue->frame_parms.ofdm_symbol_size>>3);
+ if (!data[pbchDlChEstimateTime])
+ return;
+
+ const scopeSample_t *tmp=(scopeSample_t *)(data[pbchDlChEstimateTime]+1);
+ genericPowerPerAntena(graph, data[pbchDlChEstimateTime]->colSz,
+ &tmp,
+ data[pbchDlChEstimateTime]->lineSz);
}
-static void ueFreqWaterFall (OAIgraph_t *graph,PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id ) {
+
+static void ueFreqWaterFall (scopeGraphData_t **data, OAIgraph_t *graph,PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id ) {
NR_DL_FRAME_PARMS *frame_parms=&phy_vars_ue->frame_parms;
//use 1st antenna
genericWaterFall(graph,
@@ -624,56 +639,44 @@ static void uePbchFrequencyResp (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue
oai_xygraph(graph,freq,chest_f_abs,frame_parms->ofdm_symbol_size,0,10);
}
*/
-static void uePbchLLR (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) {
+static void uePbchLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) {
// PBCH LLRs
- if ( !phy_vars_ue->pbch_vars[eNB_id]->llr)
+ if ( !data[pbchLlr])
return;
- int16_t *pbch_llr = (int16_t *) phy_vars_ue->pbch_vars[eNB_id]->llr;
+ const int sz=data[pbchLlr]->lineSz;
+ //const int antennas=data[pbchLlr]->colSz;
+ // We take the first antenna only for now
+ int16_t *llrs = (int16_t *) (data[pbchLlr]+1);
float *llr_pbch, *bit_pbch;
- oai_xygraph_getbuff(graph, &bit_pbch, &llr_pbch, 864, 0);
+ oai_xygraph_getbuff(graph, &bit_pbch, &llr_pbch, sz, 0);
- for (int i=0; i<864; i++) {
- llr_pbch[i] = (float) pbch_llr[i];
+ for (int i=0; ipbch_vars[eNB_id]->rxdataF_comp[0])
+ if (!data[pbchRxdataF_comp])
return;
- scopeSample_t *pbch_comp = (scopeSample_t *) phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0];
+ scopeSample_t *pbch_comp = (scopeSample_t *) (data[pbchRxdataF_comp]+1);
+ const int sz=data[pbchRxdataF_comp]->lineSz;
float *I, *Q;
- oai_xygraph_getbuff(graph, &I, &Q, 180*3, 0);
- memset(I,0,180*3*sizeof(*I));
- memset(Q,0,180*3*sizeof(*Q));
- int first_symbol=1;
- int base=0;
+ oai_xygraph_getbuff(graph, &I, &Q, sz, 0);
- for (int symbol=first_symbol; symbol<(first_symbol+3); symbol++) {
- int nb_re;
-
- if (symbol == 2 || symbol == 6)
- nb_re = 72;
- else
- nb_re = 180;
-
- AssertFatal(base+nb_re<180*3,"");
-
- for (int i=0; ipdcch_vars[0][eNB_id]->llr)
return;
@@ -698,7 +701,7 @@ static void uePcchLLR (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_
AssertFatal(base <= coded_bits_per_codeword*RX_NB_TH_MAX, "");
oai_xygraph(graph,bit,llr,base,0,10);
}
-static void uePcchIQ (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) {
+static void uePcchIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) {
// PDCCH I/Q of MF Output
if (!phy_vars_ue->pdcch_vars[0][eNB_id]->rxdataF_comp[0])
return;
@@ -722,7 +725,7 @@ static void uePcchIQ (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_i
AssertFatal(base <= nb*RX_NB_TH_MAX, "");
oai_xygraph(graph,I,Q,base,0,10);
}
-static void uePdschLLR (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) {
+static void uePdschLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) {
// PDSCH LLRs
if (!phy_vars_ue->pdsch_vars[0][eNB_id]->llr[0])
return;
@@ -749,7 +752,7 @@ static void uePdschLLR (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB
//fl_set_xyplot_xbounds(form->pdsch_llr,0,coded_bits_per_codeword);
oai_xygraph(graph,bit,llr,base,0,10);
}
-static void uePdschIQ (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) {
+static void uePdschIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) {
// PDSCH I/Q of MF Output
if (!phy_vars_ue->pdsch_vars[0][eNB_id]->rxdataF_comp0[0])
return;
@@ -776,7 +779,7 @@ static void uePdschIQ (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_
AssertFatal(base <= sz*RX_NB_TH_MAX, "");
oai_xygraph(graph,I,Q,sz*RX_NB_TH_MAX,0,10);
}
-static void uePdschThroughput (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) {
+static void uePdschThroughput (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) {
/*
float tput_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float tput_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
@@ -869,7 +872,9 @@ static OAI_phy_scope_t *create_phy_scope_nrue( int ID ) {
fl_show_form (fdui->phy_scope, FL_PLACE_HOTSPOT, FL_FULLBORDER, buf);
return fdui;
}
-void phy_scope_nrUE(OAI_phy_scope_t *form,
+
+void phy_scope_nrUE(scopeGraphData_t **UEliveData,
+ OAI_phy_scope_t *form,
PHY_VARS_NR_UE *phy_vars_ue,
int eNB_id,
int UE_id) {
@@ -886,26 +891,29 @@ void phy_scope_nrUE(OAI_phy_scope_t *form,
int i=0;
while (form->graph[i].graph) {
- form->graph[i].nrUEfunct(form->graph+i, phy_vars_ue, eNB_id, UE_id);
+ form->graph[i].nrUEfunct(UEliveData, form->graph+i, phy_vars_ue, eNB_id, UE_id);
i++;
}
//fl_check_forms();
}
+
static void *nrUEscopeThread(void *arg) {
PHY_VARS_NR_UE *ue=(PHY_VARS_NR_UE *)arg;
size_t stksize;
- pthread_attr_t atr={0};
+ pthread_attr_t atr= {0};
pthread_attr_getstacksize(&atr, &stksize);
pthread_attr_setstacksize(&atr,32*1024*1024 );
int fl_argc=1;
char *name="5G-UE-scope";
fl_initialize (&fl_argc, &name, NULL, 0, 0);
OAI_phy_scope_t *form_nrue=create_phy_scope_nrue(0);
+ (( scopeData_t *)ue->scopeData)->liveData=calloc(sizeof(scopeGraphData_t *), UEdataTypeNumberOfItems);
while (!oai_exit) {
fl_freeze_form(form_nrue->phy_scope);
- phy_scope_nrUE(form_nrue,
+ phy_scope_nrUE((( scopeData_t *)ue->scopeData)->liveData,
+ form_nrue,
ue,
0,0);
fl_unfreeze_form(form_nrue->phy_scope);
@@ -915,10 +923,41 @@ static void *nrUEscopeThread(void *arg) {
pthread_exit((void *)arg);
}
+
+void UEcopyData(PHY_VARS_NR_UE *ue, enum UEdataType type, void *dataIn, int elementSz, int colSz, int lineSz) {
+ scopeData_t *tmp=(scopeData_t *)ue->scopeData;
+
+ if (tmp) {
+ scopeGraphData_t *live= ((scopeGraphData_t **)tmp->liveData)[type];
+
+ if (live == NULL || live->dataSize < elementSz*colSz*lineSz) {
+ scopeGraphData_t *ptr=realloc(live, sizeof(scopeGraphData_t) + elementSz*colSz*lineSz);
+
+ if (!ptr) {
+ LOG_E(PHY,"can't realloc\n");
+ return;
+ } else {
+ live=ptr;
+ }
+ }
+
+ live->dataSize=elementSz*colSz*lineSz;
+ live->elementSz=elementSz;
+ live->colSz=colSz;
+ live->lineSz=lineSz;
+ memcpy(live+1, dataIn, elementSz*colSz*lineSz);
+ ((scopeGraphData_t **)tmp->liveData)[type]=live;
+ }
+}
+
void nrUEinitScope(PHY_VARS_NR_UE *ue) {
+ AssertFatal(ue->scopeData=malloc(sizeof(scopeData_t)),"");
+ scopeData_t *scope=(scopeData_t *) ue->scopeData;
+ scope->copyData=UEcopyData;
pthread_t forms_thread;
threadCreate(&forms_thread, nrUEscopeThread, ue, "scope", -1, OAI_PRIORITY_RT_LOW);
}
+
void nrscope_autoinit(void *dataptr) {
AssertFatal( (IS_SOFTMODEM_GNB_BIT||IS_SOFTMODEM_5GUE_BIT),"Scope cannot find NRUE or GNB context");
diff --git a/openair1/PHY/TOOLS/phy_scope_interface.h b/openair1/PHY/TOOLS/phy_scope_interface.h
index 8b747d575d..9cd8e1dc40 100644
--- a/openair1/PHY/TOOLS/phy_scope_interface.h
+++ b/openair1/PHY/TOOLS/phy_scope_interface.h
@@ -32,6 +32,8 @@
#ifndef __PHY_SCOPE_INTERFACE_H__
#define __PHY_SCOPE_INTERFACE_H__
#include
+#include
+
typedef struct {
int *argc;
char **argv;
@@ -39,16 +41,25 @@ typedef struct {
PHY_VARS_gNB *gNB;
} scopeParms_t;
+enum UEdataType {
+ pbchDlChEstimateTime,
+ pbchLlr,
+ pbchRxdataF_comp,
+ UEdataTypeNumberOfItems
+};
typedef struct scopeData_s {
int *argc;
char **argv;
RU_t *ru;
PHY_VARS_gNB *gNB;
- int32_t * rxdataF;
- void (*slotFunc)(int32_t* data, int slot, void * scopeData);
+ void *liveData;
+ void (*slotFunc)(int32_t *data, int slot, void *scopeData);
+ void (*copyData)(PHY_VARS_NR_UE *,enum UEdataType, void *data, int elementSz, int colSz, int lineSz);
} scopeData_t;
int load_softscope(char *exectype, void *initarg);
int end_forms(void) ;
+
+#define UEscopeCopy(ue, type, ...) if(ue->scopeData) ((scopeData_t*)ue->scopeData)->copyData(ue, type, ##__VA_ARGS__);
#endif
diff --git a/openair1/PHY/defs_L1_NB_IoT.h b/openair1/PHY/defs_L1_NB_IoT.h
index a4552c8c27..b4aee78310 100644
--- a/openair1/PHY/defs_L1_NB_IoT.h
+++ b/openair1/PHY/defs_L1_NB_IoT.h
@@ -122,7 +122,7 @@ static inline void* malloc16_clear( size_t size )
#include "PHY/impl_defs_top_NB_IoT.h"
#include "PHY/impl_defs_lte_NB_IoT.h"
-#include "PHY/TOOLS/time_meas.h"
+#include "time_meas.h"
//#include "PHY/CODING/defs.h"
#include "PHY/CODING/defs_NB_IoT.h"
#include "openair2/PHY_INTERFACE/IF_Module_NB_IoT.h"
@@ -452,9 +452,6 @@ typedef struct {
int sub_frame_start;
///
int sub_frame_step;
- ///
- unsigned long long gotIQs;
-
} UE_rxtx_proc_NB_IoT_t;
/// Context data structure for eNB subframe processing
diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h
index 76dd92ef5d..6b18e55c4b 100644
--- a/openair1/PHY/defs_RU.h
+++ b/openair1/PHY/defs_RU.h
@@ -36,7 +36,7 @@
#include "common_lib.h"
#include "openairinterface5g_limits.h"
-#include "PHY/TOOLS/time_meas.h"
+#include "time_meas.h"
#include "defs_common.h"
#include "nfapi_nr_interface_scf.h"
diff --git a/openair1/PHY/defs_UE.h b/openair1/PHY/defs_UE.h
index fc3d939f65..7f4d07ddae 100644
--- a/openair1/PHY/defs_UE.h
+++ b/openair1/PHY/defs_UE.h
@@ -59,7 +59,7 @@
#include "defs_common.h"
#include "impl_defs_top.h"
-#include "PHY/TOOLS/time_meas.h"
+#include "time_meas.h"
#include "PHY/CODING/coding_defs.h"
#include "PHY/TOOLS/tools_defs.h"
#include "platform_types.h"
@@ -154,7 +154,6 @@ typedef struct {
int sub_frame_start;
int sub_frame_step;
- unsigned long long gotIQs;
} UE_rxtx_proc_t;
/// Context data structure for eNB subframe processing
@@ -838,6 +837,7 @@ typedef struct {
/// RF and Interface devices per CC
openair0_device rfdevice;
+ void *scopeData;
} PHY_VARS_UE;
/* this structure is used to pass both UE phy vars and
diff --git a/openair1/PHY/defs_common.h b/openair1/PHY/defs_common.h
index c79530434a..86df85db5c 100644
--- a/openair1/PHY/defs_common.h
+++ b/openair1/PHY/defs_common.h
@@ -58,7 +58,7 @@
#include "assertions.h"
//#include
-#include "PHY/TOOLS/time_meas.h"
+#include "time_meas.h"
#include "platform_types.h"
#define MAX_NUM_RU_PER_eNB 64
diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h
index 995a4a934e..3a48dc51d6 100644
--- a/openair1/PHY/defs_eNB.h
+++ b/openair1/PHY/defs_eNB.h
@@ -58,7 +58,7 @@
#include "defs_common.h"
#include "defs_RU.h"
#include "impl_defs_top.h"
-#include "PHY/TOOLS/time_meas.h"
+#include "time_meas.h"
//#include "PHY/CODING/coding_defs.h"
#include "PHY/TOOLS/tools_defs.h"
#include "platform_types.h"
@@ -202,7 +202,7 @@ typedef struct {
int repetition_number[4];
} LTE_eNB_PRACH;
-#include "PHY/TOOLS/time_meas.h"
+#include "time_meas.h"
#include "PHY/CODING/coding_defs.h"
#include "PHY/TOOLS/tools_defs.h"
#include "PHY/LTE_TRANSPORT/transport_eNB.h"
diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h
index 837c043f8b..8faf4a50ce 100644
--- a/openair1/PHY/defs_gNB.h
+++ b/openair1/PHY/defs_gNB.h
@@ -89,7 +89,7 @@ typedef struct {
/// Pointer to the payload
uint8_t *b;
/// Pointers to transport block segments
- uint8_t *c[MAX_NUM_NR_DLSCH_SEGMENTS];
+ uint8_t **c;
/// Frame where current HARQ round was sent
uint32_t frame;
/// Subframe where current HARQ round was sent
@@ -157,13 +157,11 @@ typedef struct {
/// Pointers to variables related to DLSCH harq process
NR_DL_gNB_HARQ_t harq_process;
/// TX buffers for UE-spec transmission (antenna layers 1,...,4 after to precoding)
- int32_t *txdataF[NR_MAX_NB_LAYERS];
- /// TX buffers for UE-spec transmission (antenna ports 1000 or 1001,...,1007, before precoding)
- int32_t *txdataF_precoding[NR_MAX_NB_LAYERS];
+ int32_t **txdataF;
/// Modulated symbols buffer
- int32_t *mod_symbs[NR_MAX_NB_CODEWORDS];
+ int32_t **mod_symbs;
/// beamforming weights for UE-spec transmission (antenna ports 5 or 7..14), for each codeword, maximum 4 layers?
- int32_t **ue_spec_bf_weights[NR_MAX_NB_LAYERS];
+ int32_t ***ue_spec_bf_weights;
/// dl channel estimates (estimated from ul channel estimates)
int32_t **calib_dl_ch_estimates;
/// Allocated RNTI (0 means DLSCH_t is not currently used)
@@ -287,7 +285,7 @@ typedef struct {
/// LDPC lifting size (38.212 V15.4.0 table 5.3.2-1)
uint32_t Z;
/// 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];
+ int16_t e[MAX_NUM_NR_ULSCH_SEGMENTS][3*8448];
/// Number of bits in each code block after rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1)
uint32_t E;
/// Number of segments processed so far
@@ -771,7 +769,7 @@ typedef struct PHY_VARS_gNB_s {
NR_gNB_PDCCH_t pdcch_pdu[NUMBER_OF_NR_PDCCH_MAX];
NR_gNB_UL_PDCCH_t ul_pdcch_pdu[NUMBER_OF_NR_PDCCH_MAX];
NR_gNB_DLSCH_t *dlsch[NUMBER_OF_NR_DLSCH_MAX][2]; // Nusers times two spatial streams
- NR_gNB_ULSCH_t *ulsch[NUMBER_OF_NR_ULSCH_MAX][2]; // [Nusers times][2 codewords]
+ NR_gNB_ULSCH_t *ulsch[NUMBER_OF_NR_ULSCH_MAX]; // [Nusers times]
NR_gNB_DLSCH_t *dlsch_SI,*dlsch_ra,*dlsch_p;
NR_gNB_DLSCH_t *dlsch_PCH;
/// statistics for DLSCH measurement collection
@@ -856,7 +854,7 @@ typedef struct PHY_VARS_gNB_s {
/*
time_stats_t phy_proc;
*/
- time_stats_t *phy_proc_tx[2];
+ time_stats_t phy_proc_tx;
time_stats_t phy_proc_rx;
time_stats_t rx_prach;
/*
@@ -972,7 +970,6 @@ typedef struct processingData_L1tx {
uint16_t num_pdsch_slot;
int num_dl_pdcch;
int num_ul_pdcch;
- time_stats_t phy_proc_tx;
} processingData_L1tx_t;
#endif
diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h
index 653b435e12..04080e7215 100644
--- a/openair1/PHY/defs_nr_UE.h
+++ b/openair1/PHY/defs_nr_UE.h
@@ -96,7 +96,7 @@
#include "impl_defs_top.h"
#include "impl_defs_nr.h"
-#include "PHY/TOOLS/time_meas.h"
+#include "time_meas.h"
#include "PHY/CODING/coding_defs.h"
#include "PHY/TOOLS/tools_defs.h"
#include "platform_types.h"
@@ -225,11 +225,6 @@ typedef struct {
} NR_UE_COMMON_PER_THREAD;
-typedef struct {
- /// TX buffers for multiple layers
- int32_t *txdataF_layers[NR_MAX_NB_LAYERS];
- } NR_UE_PUSCH;
-
typedef struct {
bool active[2];
fapi_nr_ul_config_pucch_pdu pucch_pdu[2];
@@ -654,40 +649,6 @@ typedef struct {
#define PBCH_A 24
typedef struct {
- /// \brief Pointers to extracted PBCH symbols in frequency-domain.
- /// - first index: rx antenna [0..nb_antennas_rx[
- /// - second index: ? [0..287] (hard coded)
- int32_t **rxdataF_ext;
- /// \brief Pointers to extracted and compensated PBCH symbols in frequency-domain.
- /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
- /// - second index: ? [0..287] (hard coded)
- int32_t **rxdataF_comp;
- /// \brief Hold the channel estimates in frequency domain.
- /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
- /// - second index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[
- int32_t **dl_ch_estimates;
- /// \brief Pointers to downlink channel estimates in frequency-domain extracted in PRBS.
- /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
- /// - second index: ? [0..287] (hard coded)
- int32_t **dl_ch_estimates_ext;
- /// \brief Hold the channel estimates in time domain (used for tracking).
- /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
- /// - second index: samples? [0..2*ofdm_symbol_size[
- int32_t **dl_ch_estimates_time;
- int log2_maxh;
- uint8_t pbch_a[NR_POLAR_PBCH_PAYLOAD_BITS>>3];
- uint32_t pbch_a_interleaved;
- uint32_t pbch_a_prime;
- uint8_t pbch_e[NR_POLAR_PBCH_E];
- int16_t demod_pbch_e[NR_POLAR_PBCH_E];
- /// \brief Pointer to PBCH llrs.
- /// - first index: ? [0..1919] (hard coded)
- int16_t *llr;
- /// \brief Pointer to PBCH decoded output.
- /// - first index: ? [0..63] (hard coded)
- uint8_t *decoded_output;
- /// \brief PBCH additional bits
- uint8_t xtra_byte;
/// \brief Total number of PDU errors.
uint32_t pdu_errors;
/// \brief Total number of PDU errors 128 frames ago.
@@ -695,7 +656,7 @@ typedef struct {
/// \brief Total number of consecutive PDU errors.
uint32_t pdu_errors_conseq;
/// \brief FER (in percent) .
- uint32_t pdu_fer;
+ //uint32_t pdu_fer;
} NR_UE_PBCH;
typedef struct {
@@ -819,10 +780,9 @@ typedef struct {
NR_UE_PDCCH *pdcch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX];
NR_UE_PRACH *prach_vars[NUMBER_OF_CONNECTED_gNB_MAX];
NR_UE_SRS *srs_vars[NUMBER_OF_CONNECTED_gNB_MAX];
- NR_UE_PUSCH *pusch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX];
NR_UE_PUCCH *pucch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX];
- NR_UE_DLSCH_t *dlsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX][NR_MAX_NB_CODEWORDS]; // two RxTx Threads
- NR_UE_ULSCH_t *ulsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX][NR_MAX_NB_CODEWORDS]; // two code words
+ NR_UE_DLSCH_t *dlsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX][NR_MAX_NB_LAYERS>4 ? 2:1]; // two RxTx Threads
+ NR_UE_ULSCH_t *ulsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX];
NR_UE_DLSCH_t *dlsch_SI[NUMBER_OF_CONNECTED_gNB_MAX];
NR_UE_DLSCH_t *dlsch_ra[NUMBER_OF_CONNECTED_gNB_MAX];
NR_UE_DLSCH_t *dlsch_p[NUMBER_OF_CONNECTED_gNB_MAX];
@@ -866,7 +826,7 @@ typedef struct {
uint16_t scramblingID_pdcch;
/// PUSCH DMRS sequence
- uint32_t ****nr_gold_pusch_dmrs;
+ uint32_t ***nr_gold_pusch_dmrs;
uint32_t X_u[64][839];
@@ -1073,7 +1033,7 @@ typedef struct {
#endif
int dl_stats[5];
-
+ void* scopeData;
} PHY_VARS_NR_UE;
/* this structure is used to pass both UE phy vars and
diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h
index d3352fb520..0a58ff3dc1 100644
--- a/openair1/PHY/defs_nr_common.h
+++ b/openair1/PHY/defs_nr_common.h
@@ -44,8 +44,6 @@
#define MAX_NUM_SUBCARRIER_SPACING 5
-#define NR_MAX_NB_RB 275
-
#define NR_NB_SC_PER_RB 12
#define NR_NB_REG_PER_CCE 6
@@ -67,22 +65,9 @@
#define NR_PBCH_DMRS_LENGTH 144 // in mod symbols
#define NR_PBCH_DMRS_LENGTH_DWORD 10 // ceil(2(QPSK)*NR_PBCH_DMRS_LENGTH/32)
-/*These max values are for the gold sequences which are generated at init for the
- * full carrier bandwidth*/
-#define NR_MAX_PDCCH_DMRS_INIT_LENGTH ((NR_MAX_NB_RB<<1)*3) // 3 symbols *2(QPSK)
-#define NR_MAX_PDCCH_DMRS_INIT_LENGTH_DWORD 52 // ceil(NR_MAX_PDCCH_DMRS_LENGTH/32)
/*used for the resource mapping*/
#define NR_MAX_PDCCH_DMRS_LENGTH 576 // 16(L)*2(QPSK)*3(3 DMRS symbs per REG)*6(REG per CCE)
-#define NR_MAX_PDSCH_DMRS_LENGTH 3300 //275*6(k)*2(QPSK real+imag)
-#define NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD 104 // ceil(NR_MAX_PDSCH_DMRS_LENGTH/32)
-
-#define NR_MAX_CSI_RS_LENGTH 4400 //275*8(max allocation per RB)*2(QPSK)
-#define NR_MAX_CSI_RS_INIT_LENGTH_DWORD 138 // ceil(NR_MAX_CSI_RS_LENGTH/32)
-
-#define NR_MAX_PUSCH_DMRS_LENGTH NR_MAX_PDSCH_DMRS_LENGTH
-#define NR_MAX_PUSCH_DMRS_INIT_LENGTH_DWORD NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD
-
#define NR_MAX_DCI_PAYLOAD_SIZE 64
#define NR_MAX_DCI_SIZE 1728 //16(L)*2(QPSK)*9(12 RE per REG - 3(DMRS))*6(REG per CCE)
#define NR_MAX_DCI_SIZE_DWORD 54 // ceil(NR_MAX_DCI_SIZE/32)
@@ -93,24 +78,19 @@
#define NR_MAX_CSET_DURATION 3
#define NR_MAX_NB_RBG 18
-#define NR_MAX_NB_LAYERS 2 // 8 // SU-MIMO (3GPP TS 38.211 V15.4.0 section 7.3.1.3)
-#define NR_MAX_NB_CODEWORDS 2
+#define NR_MAX_NB_LAYERS 4 // 8
#define NR_MAX_NB_HARQ_PROCESSES 16
-#define NR_MAX_PDSCH_ENCODED_LENGTH (NR_MAX_NB_RB*NR_SYMBOLS_PER_SLOT*NR_NB_SC_PER_RB*8*NR_MAX_NB_LAYERS) // 8 is the maximum modulation order (it was 950984 before !!)
-#define NR_MAX_PUSCH_ENCODED_LENGTH NR_MAX_PDSCH_ENCODED_LENGTH
+
#define NR_MAX_PDSCH_TBS 3824
#define NR_MAX_SIB_LENGTH 2976 // 3GPP TS 38.331 section 5.2.1 - The physical layer imposes a limit to the maximum size a SIB can take. The maximum SIB1 or SI message size is 2976 bits.
-#define MAX_NUM_NR_DLSCH_SEGMENTS (NR_MAX_NB_LAYERS*34)
-#define MAX_NR_DLSCH_PAYLOAD_BYTES (MAX_NUM_NR_DLSCH_SEGMENTS*1056)
+#define MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER 34
#define MAX_NUM_NR_ULSCH_SEGMENTS 34
#define MAX_NR_ULSCH_PAYLOAD_BYTES (MAX_NUM_NR_ULSCH_SEGMENTS*1056)
#define MAX_NUM_NR_SRS_SYMBOLS 4
-#define MAX_NUM_NR_CHANNEL_BITS (14*273*12*8) // 14 symbols, 273 RB
-#define MAX_NUM_NR_RE (14*273*12)
#define NR_RX_NB_TH 1
#define NR_NB_TH_SLOT 2
@@ -253,7 +233,7 @@ typedef struct {
typedef struct {
uint16_t sc_list_length;
- uint16_t sc_list[6 * NR_MAX_NB_RB];
+ uint16_t *sc_list;
uint8_t srs_generated_signal_bits;
int32_t *srs_generated_signal;
int32_t **srs_received_signal;
diff --git a/openair1/PHY/thread_NR_UE.h b/openair1/PHY/thread_NR_UE.h
index 901d8faec9..a3cc2d9782 100644
--- a/openair1/PHY/thread_NR_UE.h
+++ b/openair1/PHY/thread_NR_UE.h
@@ -62,7 +62,6 @@ typedef struct {
int sub_frame_start;
int sub_frame_step;
- unsigned long long gotIQs;
uint8_t decoder_thread_available1;
int dci_err_cnt;
} UE_nr_rxtx_proc_t;
diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c
index ee1e0be49a..1a35f6ee68 100644
--- a/openair1/SCHED/phy_procedures_lte_eNb.c
+++ b/openair1/SCHED/phy_procedures_lte_eNb.c
@@ -1938,6 +1938,8 @@ void fill_ulsch_harq_indication (PHY_VARS_eNB *eNB, LTE_UL_eNB_HARQ_t *ulsch_har
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
}
+#define packetError(ConD, fmt, args...) if (!(ConD)) { LOG_E(PHY, fmt, args); goodPacket=false; }
+
void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask) {
if ( split73 == SPLIT73_DU ) {
sendFs6Ulharq(fs6ULindicationHarq, UEid, eNB, uci, frame, subframe, harq_ack, tdd_mapping_mode, tdd_multiplexing_mask, 0, 0);
@@ -1953,6 +1955,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
}
pthread_mutex_lock(&eNB->UL_INFO_mutex);
+ bool goodPacket=true;
nfapi_harq_indication_t *ind = &eNB->UL_INFO.harq_ind;
nfapi_harq_indication_body_t *body = &ind->harq_indication_body;
assert(eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs <= NFAPI_HARQ_IND_MAX_PDU);
@@ -1985,73 +1988,87 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG;
pdu->harq_indication_fdd_rel13.mode = 0;
pdu->harq_indication_fdd_rel13.number_of_ack_nack = 1;
- AssertFatal (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n", harq_ack[0]);
- pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0];
- // release DLSCH if needed
- release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
+ packetError (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n", harq_ack[0]);
+ if (goodPacket) {
+ pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0];
+ // release DLSCH if needed
+ release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
+ }
} else if (uci->pucch_fmt == pucch_format1b) {
pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG;
pdu->harq_indication_fdd_rel13.mode = 0;
pdu->harq_indication_fdd_rel13.number_of_ack_nack = 2;
- AssertFatal (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n", harq_ack[0]);
- AssertFatal (harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n", harq_ack[1]);
- pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0];
- pdu->harq_indication_fdd_rel13.harq_tb_n[1] = harq_ack[1];
- // release DLSCH if needed
- release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
- release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1);
- } else AssertFatal(1==0,"only format 1a/b for now, received %d\n",uci->pucch_fmt);
+ packetError (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n", harq_ack[0]);
+ packetError (harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n", harq_ack[1]);
+ if (goodPacket) {
+ pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0];
+ pdu->harq_indication_fdd_rel13.harq_tb_n[1] = harq_ack[1];
+ // release DLSCH if needed
+ release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
+ release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1);
+ }
+ } else
+ packetError(1==0,"only format 1a/b for now, received %d\n",uci->pucch_fmt);
} else { // TDD
- AssertFatal (tdd_mapping_mode == 0 || tdd_mapping_mode == 1 || tdd_mapping_mode == 2, "Illegal tdd_mapping_mode %d\n", tdd_mapping_mode);
- pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
- pdu->harq_indication_tdd_rel13.mode = tdd_mapping_mode;
- LOG_D(PHY,"%s(eNB, uci_harq format %d, rnti:%04x, frame:%d, subframe:%d, tdd_mapping_mode:%d) harq_ack[0]:%d harq_ack[1]:%d\n", __FUNCTION__, uci->pucch_fmt,uci->rnti, frame, subframe,
- tdd_mapping_mode,harq_ack[0],harq_ack[1]);
+ packetError (tdd_mapping_mode == 0 || tdd_mapping_mode == 1 || tdd_mapping_mode == 2, "Illegal tdd_mapping_mode %d\n", tdd_mapping_mode);
+ if (goodPacket) {
+ pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
+ pdu->harq_indication_tdd_rel13.mode = tdd_mapping_mode;
+ LOG_D(PHY,"%s(eNB, uci_harq format %d, rnti:%04x, frame:%d, subframe:%d, tdd_mapping_mode:%d) harq_ack[0]:%d harq_ack[1]:%d\n", __FUNCTION__, uci->pucch_fmt,uci->rnti, frame, subframe,
+ tdd_mapping_mode,harq_ack[0],harq_ack[1]);
- switch (tdd_mapping_mode) {
+ switch (tdd_mapping_mode) {
case 0: // bundling
if (uci->pucch_fmt == pucch_format1a) {
pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1;
LOG_D(PHY,"bundling, pucch1a, number of ack nack %d\n",pdu->harq_indication_tdd_rel13.number_of_ack_nack);
- AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]);
- pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0];
- // release all bundled DLSCH if needed
- release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
+ packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]);
+ if (goodPacket) {
+ pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0];
+ // release all bundled DLSCH if needed
+ release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
+ }
} else if (uci->pucch_fmt == pucch_format1b) {
pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2;
- AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]);
- AssertFatal(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]);
- pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
- pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0];
- pdu->harq_indication_tdd_rel13.harq_data[1].bundling.value_0 = harq_ack[1];
- // release all DLSCH if needed
- release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
- release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1);
+ packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]);
+ packetError(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]);
+ if (goodPacket) {
+ pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
+ pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0];
+ pdu->harq_indication_tdd_rel13.harq_data[1].bundling.value_0 = harq_ack[1];
+ // release all DLSCH if needed
+ release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
+ release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1);
+ }
}
break;
case 1: // multiplexing
- AssertFatal (uci->pucch_fmt == pucch_format1b, "uci->pucch_format %d is not format1b\n", uci->pucch_fmt);
-
- if (uci->num_pucch_resources == 1 && uci->pucch_fmt == pucch_format1a) {
- pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
- pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1;
- AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]);
- pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0];
- // release all DLSCH if needed
- release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
+ packetError (uci->pucch_fmt == pucch_format1b, "uci->pucch_format %d is not format1b\n", uci->pucch_fmt);
+ if (goodPacket) {
+ if (uci->num_pucch_resources == 1 && uci->pucch_fmt == pucch_format1a) {
+ pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
+ pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1;
+ packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]);
+ if (goodPacket) {
+ pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0];
+ // release all DLSCH if needed
+ release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
+ }
} else if (uci->num_pucch_resources == 1 && uci->pucch_fmt == pucch_format1b) {
- pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
- pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2;
- AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]);
- AssertFatal(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]);
- pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0];
- pdu->harq_indication_tdd_rel13.harq_data[1].multiplex.value_0 = harq_ack[1];
- // release all DLSCH if needed
- release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
- release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1);
+ pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
+ pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2;
+ packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]);
+ packetError(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]);
+ if (goodPacket) {
+ pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0];
+ pdu->harq_indication_tdd_rel13.harq_data[1].multiplex.value_0 = harq_ack[1];
+ // release all DLSCH if needed
+ release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
+ release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1);
+ }
} else { // num_pucch_resources (M) > 1
pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
pdu->harq_indication_tdd_rel13.number_of_ack_nack = uci->num_pucch_resources;
@@ -2067,7 +2084,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
release_harq(eNB,DLSCH_id,1,frame,subframe,tdd_multiplexing_mask, 1 /* force release? previous code was unconditional */);
}
- break;
+ break;
case 2: // special bundling (SR collision)
pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
@@ -2117,16 +2134,23 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
} else {
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 0;
}
-
+
break;
}
break;
+ }
+ }
}
} //TDD
-
- eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs++;
- LOG_D(PHY,"Incremented eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs:%d\n", eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs);
+
+ if (goodPacket) {
+ eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs++;
+ LOG_D(PHY,"Incremented eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs:%d\n", eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs);
+ } else {
+ LOG_W(PHY,"discarded a PUCCH because the decoded values are impossible\n");
+ }
+
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
}
diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c
index 2dbaa738dc..4b9f9534f0 100644
--- a/openair1/SCHED_NR/fapi_nr_l1.c
+++ b/openair1/SCHED_NR/fapi_nr_l1.c
@@ -165,6 +165,8 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
notifiedFIFO_elt_t *res;
res = pullTpool(gNB->L1_tx_free, gNB->threadPool);
processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res);
+ const time_stats_t ts = exec_time_stats_NotifiedFIFO(res);
+ merge_meas(&gNB->phy_proc_tx, &ts);
msgTx->num_pdsch_slot=0;
msgTx->num_dl_pdcch=0;
diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c
index 41f395c090..ee7f734ae2 100644
--- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c
+++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c
@@ -134,8 +134,6 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,1);
- if (do_meas==1) start_meas(&msgTx->phy_proc_tx);
-
// clear the transmit data array and beam index for the current slot
for (aa=0; aacarrier_config.num_tx_ant.value; aa++) {
memset(&gNB->common_vars.txdataF[aa][txdataF_offset],0,fp->samples_per_slot_wCP*sizeof(int32_t));
@@ -193,8 +191,6 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0);
-
- if (do_meas==1) stop_meas(&msgTx->phy_proc_tx);
}
void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
@@ -202,7 +198,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
NR_UL_gNB_HARQ_t *ulsch_harq = rdata->ulsch_harq;
NR_gNB_ULSCH_t *ulsch = rdata->ulsch;
int r = rdata->segment_r;
- nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[rdata->ulsch_id][0]->harq_processes[rdata->harq_pid]->ulsch_pdu;
+ nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[rdata->ulsch_id]->harq_processes[rdata->harq_pid]->ulsch_pdu;
bool decodeSuccess = (rdata->decodeIterations <= rdata->decoderParms.numMaxIter);
ulsch_harq->processedSegments++;
@@ -307,7 +303,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH_id, uint8_t harq_pid)
{
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
- nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[ULSCH_id][0]->harq_processes[harq_pid]->ulsch_pdu;
+ nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->ulsch_pdu;
uint8_t l, number_dmrs_symbols = 0;
uint32_t G;
@@ -383,13 +379,13 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id,
pthread_mutex_lock(&gNB->UL_INFO_mutex);
- NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0];
+ NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id];
NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid];
NR_gNB_SCH_STATS_t *stats=get_ulsch_stats(gNB,ulsch);
nfapi_nr_pusch_pdu_t *pusch_pdu = &harq_process->ulsch_pdu;
- // pdu->data = gNB->ulsch[ULSCH_id+1][0]->harq_processes[harq_pid]->b;
+ // pdu->data = gNB->ulsch[ULSCH_id+1]->harq_processes[harq_pid]->b;
int sync_pos = nr_est_timing_advance_pusch(gNB, ULSCH_id); // estimate timing advance for MAC
// scale the 16 factor in N_TA calculation in 38.213 section 4.2 according to the used FFT size
@@ -552,7 +548,7 @@ void fill_ul_rb_mask(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
}
for (int ULSCH_id=0;ULSCH_idnumber_of_nr_ulsch_max;ULSCH_id++) {
- NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0];
+ NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id];
int harq_pid;
NR_UL_gNB_HARQ_t *ulsch_harq;
if ((ulsch) &&
@@ -712,7 +708,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
}
for (int ULSCH_id=0;ULSCH_idnumber_of_nr_ulsch_max;ULSCH_id++) {
- NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0];
+ NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id];
int harq_pid;
int no_sig;
NR_UL_gNB_HARQ_t *ulsch_harq;
diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h
index c362bb470f..eeea57ffc6 100644
--- a/openair1/SCHED_NR_UE/defs.h
+++ b/openair1/SCHED_NR_UE/defs.h
@@ -82,6 +82,11 @@
#define DAQ_AGC_OFF 0
+typedef struct {
+ uint8_t decoded_output[64];
+ uint8_t xtra_byte;
+} fapiPbch_t;
+
/** @addtogroup _PHY_PROCEDURES_
* @{
*/
@@ -395,7 +400,8 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
NR_UE_DLSCH_t *dlsch0,
NR_UE_DLSCH_t *dlsch1,
uint16_t n_pdus,
- UE_nr_rxtx_proc_t *proc);
+ UE_nr_rxtx_proc_t *proc,
+ void * typeSpecific);
bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
index f6daaccef2..a0beb033dd 100644
--- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
+++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
@@ -282,7 +282,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
thread_id = scheduled_response->thread_id;
NR_UE_DLSCH_t *dlsch0 = NULL;
NR_UE_PDCCH *pdcch_vars = PHY_vars_UE_g[module_id][cc_id]->pdcch_vars[thread_id][0];
- NR_UE_ULSCH_t *ulsch0 = PHY_vars_UE_g[module_id][cc_id]->ulsch[thread_id][0][0];
+ NR_UE_ULSCH_t *ulsch = PHY_vars_UE_g[module_id][cc_id]->ulsch[thread_id][0];
NR_UE_PUCCH *pucch_vars = PHY_vars_UE_g[module_id][cc_id]->pucch_vars[thread_id][0];
if(scheduled_response->dl_config != NULL){
@@ -369,8 +369,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
// pusch config pdu
pusch_config_pdu = &ul_config->ul_config_list[i].pusch_config_pdu;
current_harq_pid = pusch_config_pdu->pusch_data.harq_process_id;
- NR_UL_UE_HARQ_t *harq_process_ul_ue = ulsch0->harq_processes[current_harq_pid];
- harq_process_ul_ue->status = 0;
+ NR_UL_UE_HARQ_t *harq_process_ul_ue = ulsch->harq_processes[current_harq_pid];
if (harq_process_ul_ue){
@@ -378,7 +377,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
memcpy(pusch_pdu, pusch_config_pdu, sizeof(nfapi_nr_ue_pusch_pdu_t));
- ulsch0->f_pusch = pusch_config_pdu->absolute_delta_PUSCH;
+ ulsch->f_pusch = pusch_config_pdu->absolute_delta_PUSCH;
if (scheduled_response->tx_request) {
for (int j=0; jtx_request->number_of_pdus; j++) {
@@ -386,15 +385,16 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
if ((tx_req_body->pdu_index == i) && (tx_req_body->pdu_length > 0)) {
LOG_D(PHY,"%d.%d Copying %d bytes to harq_process_ul_ue->a (harq_pid %d)\n",scheduled_response->frame,slot,tx_req_body->pdu_length,current_harq_pid);
memcpy(harq_process_ul_ue->a, tx_req_body->pdu, tx_req_body->pdu_length);
- harq_process_ul_ue->status = ACTIVE;
- ul_config->ul_config_list[i].pdu_type = FAPI_NR_UL_CONFIG_TYPE_DONE; // not handle it any more
- pdu_done++;
- LOG_D(PHY, "%d.%d ul A ul_config %p t %d pdu_done %d number_pdus %d\n", scheduled_response->frame, slot, ul_config, pdu_type, pdu_done, ul_config->number_pdus);
break;
}
}
}
+ harq_process_ul_ue->status = ACTIVE;
+ ul_config->ul_config_list[i].pdu_type = FAPI_NR_UL_CONFIG_TYPE_DONE; // not handle it any more
+ pdu_done++;
+ LOG_D(PHY, "%d.%d ul A ul_config %p t %d pdu_done %d number_pdus %d\n", scheduled_response->frame, slot, ul_config, pdu_type, pdu_done, ul_config->number_pdus);
+
} else {
LOG_E(PHY, "[phy_procedures_nrUE_TX] harq_process_ul_ue is NULL !!\n");
diff --git a/openair1/SCHED_NR_UE/harq_nr.c b/openair1/SCHED_NR_UE/harq_nr.c
index 4d92509d48..4afe5f41d3 100644
--- a/openair1/SCHED_NR_UE/harq_nr.c
+++ b/openair1/SCHED_NR_UE/harq_nr.c
@@ -123,7 +123,7 @@ void config_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int thread_id, i
memset(ulsch,0,sizeof(NR_UE_ULSCH_t));
- ue->ulsch[thread_id][gNB_id][code_word_idx] = ulsch;
+ ue->ulsch[thread_id][gNB_id] = ulsch;
}
else {
LOG_E(PHY, "Fatal memory allocation problem at line %d in function %s of file %s \n", __LINE__ , __func__, __FILE__);
@@ -148,7 +148,7 @@ void config_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int thread_id, i
}
for (int slot_tx = 0; slot_tx < NR_MAX_SLOTS_PER_FRAME; slot_tx++) {
- ue->ulsch[thread_id][gNB_id][code_word_idx]->harq_process_id[slot_tx] = NR_MAX_HARQ_PROCESSES;
+ ue->ulsch[thread_id][gNB_id]->harq_process_id[slot_tx] = NR_MAX_HARQ_PROCESSES;
}
}
@@ -167,7 +167,7 @@ void config_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int thread_id, i
void release_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int thread_id, int code_word_idx)
{
- NR_UE_ULSCH_t *ulsch = ue->ulsch[thread_id][gNB_id][code_word_idx];
+ NR_UE_ULSCH_t *ulsch = ue->ulsch[thread_id][gNB_id];
for (int process_id = 0; process_id < ulsch->number_harq_processes_for_pusch; process_id++) {
@@ -178,7 +178,7 @@ void release_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int thread_id,
free16(ulsch, sizeof(NR_UE_ULSCH_t));
- ue->ulsch[thread_id][gNB_id][code_word_idx] = NULL;
+ ue->ulsch[thread_id][gNB_id] = NULL;
}
/*******************************************************************
diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
index 0d284de71c..ddddcd09e2 100644
--- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
@@ -118,7 +118,8 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
NR_UE_DLSCH_t *dlsch0,
NR_UE_DLSCH_t *dlsch1,
uint16_t n_pdus,
- UE_nr_rxtx_proc_t *proc ){
+ UE_nr_rxtx_proc_t *proc,
+ void * typeSpecific){
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
@@ -162,8 +163,11 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.pdu_length = dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS / 8;
break;
case FAPI_NR_RX_PDU_TYPE_SSB:
- rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.pdu = ue->pbch_vars[gNB_id]->decoded_output;
- rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.additional_bits = ue->pbch_vars[gNB_id]->xtra_byte;
+ rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.pdu=malloc(sizeof(((fapiPbch_t*)typeSpecific)->decoded_output));
+ memcpy(rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.pdu,
+ ((fapiPbch_t*)typeSpecific)->decoded_output,
+ sizeof(((fapiPbch_t*)typeSpecific)->decoded_output));
+ rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.additional_bits = ((fapiPbch_t*)typeSpecific)->xtra_byte;
rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.ssb_index = (frame_parms->ssb_index)&0x7;
rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.ssb_length = frame_parms->Lmax;
rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.cell_id = frame_parms->Nid_cell;
@@ -285,8 +289,9 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
start_meas(&ue->phy_proc_tx);
if (ue->UE_mode[gNB_id] <= PUSCH){
- for (uint8_t harq_pid = 0; harq_pid < ue->ulsch[proc->thread_id][gNB_id][0]->number_harq_processes_for_pusch; harq_pid++) {
- if (ue->ulsch[proc->thread_id][gNB_id][0]->harq_processes[harq_pid]->status == ACTIVE)
+
+ for (uint8_t harq_pid = 0; harq_pid < ue->ulsch[proc->thread_id][gNB_id]->number_harq_processes_for_pusch; harq_pid++) {
+ if (ue->ulsch[proc->thread_id][gNB_id]->harq_processes[harq_pid]->status == ACTIVE)
nr_ue_ulsch_procedures(ue, harq_pid, frame_tx, slot_tx, proc->thread_id, gNB_id);
}
}
@@ -353,10 +358,9 @@ void nr_ue_measurement_procedures(uint16_t l,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_MEASUREMENT_PROCEDURES, VCD_FUNCTION_OUT);
}
-void nr_ue_pbch_procedures(uint8_t gNB_id,
+static void nr_ue_pbch_procedures(uint8_t gNB_id,
PHY_VARS_NR_UE *ue,
- UE_nr_rxtx_proc_t *proc,
- uint8_t abstraction_flag)
+ UE_nr_rxtx_proc_t *proc,int estimateSz, struct complex16 dl_ch_estimates[][estimateSz])
{
int ret = 0;
@@ -368,13 +372,15 @@ void nr_ue_pbch_procedures(uint8_t gNB_id,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PBCH_PROCEDURES, VCD_FUNCTION_IN);
LOG_D(PHY,"[UE %d] Frame %d Slot %d, Trying PBCH (NidCell %d, gNB_id %d)\n",ue->Mod_id,frame_rx,nr_slot_rx,ue->frame_parms.Nid_cell,gNB_id);
-
+ fapiPbch_t result;
ret = nr_rx_pbch(ue, proc,
+ estimateSz, dl_ch_estimates,
ue->pbch_vars[gNB_id],
&ue->frame_parms,
gNB_id,
(ue->frame_parms.ssb_index)&7,
- SISO);
+ SISO,
+ &result);
if (ret==0) {
@@ -444,7 +450,6 @@ void nr_ue_pbch_procedures(uint8_t gNB_id,
}
if (frame_rx % 100 == 0) {
- ue->pbch_vars[gNB_id]->pdu_fer = ue->pbch_vars[gNB_id]->pdu_errors - ue->pbch_vars[gNB_id]->pdu_errors_last;
ue->pbch_vars[gNB_id]->pdu_errors_last = ue->pbch_vars[gNB_id]->pdu_errors;
}
@@ -795,16 +800,16 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
switch (pdsch) {
case RA_PDSCH:
nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id);
- nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_RAR, gNB_id, ue, dlsch0, NULL, number_pdus, proc);
+ nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_RAR, gNB_id, ue, dlsch0, NULL, number_pdus, proc, NULL);
ue->UE_mode[gNB_id] = RA_RESPONSE;
break;
case PDSCH:
nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id);
- nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_DLSCH, gNB_id, ue, dlsch0, NULL, number_pdus, proc);
+ nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_DLSCH, gNB_id, ue, dlsch0, NULL, number_pdus, proc, NULL);
break;
case SI_PDSCH:
nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id);
- nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SIB, gNB_id, ue, dlsch0, NULL, number_pdus, proc);
+ nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SIB, gNB_id, ue, dlsch0, NULL, number_pdus, proc, NULL);
break;
default:
break;
@@ -1400,6 +1405,9 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
if (slot_ssb) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PBCH, VCD_FUNCTION_IN);
LOG_D(PHY," ------ PBCH ChannelComp/LLR: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx);
+ const int estimateSz=7*2*sizeof(int)*fp->ofdm_symbol_size;
+ __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates[fp->nb_antennas_rx][estimateSz];
+ __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates_time[fp->nb_antennas_rx][estimateSz];
for (int i=1; i<4; i++) {
nr_slot_fep(ue,
@@ -1409,7 +1417,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
start_meas(&ue->dlsch_channel_estimation_stats);
- nr_pbch_channel_estimation(ue,proc,gNB_id,nr_slot_rx,(ue->symbol_offset+i)%(fp->symbols_per_slot),i-1,(fp->ssb_index)&7,fp->half_frame_bit);
+ nr_pbch_channel_estimation(ue, estimateSz, dl_ch_estimates, dl_ch_estimates_time,proc,gNB_id,nr_slot_rx,(ue->symbol_offset+i)%(fp->symbols_per_slot),i-1,(fp->ssb_index)&7,fp->half_frame_bit);
stop_meas(&ue->dlsch_channel_estimation_stats);
}
@@ -1418,13 +1426,14 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
if ((ue->decode_MIB == 1) && slot_pbch) {
LOG_D(PHY," ------ Decode MIB: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx);
- nr_ue_pbch_procedures(gNB_id, ue, proc, 0);
+ nr_ue_pbch_procedures(gNB_id, ue, proc, estimateSz, dl_ch_estimates);
if (ue->no_timing_correction==0) {
LOG_D(PHY,"start adjust sync slot = %d no timing %d\n", nr_slot_rx, ue->no_timing_correction);
nr_adjust_synch_ue(fp,
ue,
gNB_id,
+ estimateSz, dl_ch_estimates_time,
frame_rx,
nr_slot_rx,
0,
@@ -1619,13 +1628,17 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
start_meas(&ue->dlsch_procedures_stat[proc->thread_id]);
+ NR_UE_DLSCH_t *dlsch1 = NULL;
+ if (NR_MAX_NB_LAYERS>4)
+ dlsch1 = ue->dlsch[proc->thread_id][gNB_id][1];
+
if (ret_pdsch >= 0)
nr_ue_dlsch_procedures(ue,
proc,
gNB_id,
PDSCH,
ue->dlsch[proc->thread_id][gNB_id][0],
- ue->dlsch[proc->thread_id][gNB_id][1],
+ dlsch1,
&ue->dlsch_errors[gNB_id]);
stop_meas(&ue->dlsch_procedures_stat[proc->thread_id]);
diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c
index 495b6803a6..231d63cf04 100644
--- a/openair1/SIMULATION/LTE_PHY/dlsim.c
+++ b/openair1/SIMULATION/LTE_PHY/dlsim.c
@@ -129,7 +129,6 @@ void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1);
for (aa=0; aanb_antennas_tx; aa++) {
- // printf("Thread %d starting ... aa %d (%llu)\n",omp_get_thread_num(),aa,rdtsc());
if (frame_parms->Ncp == 1)
PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input
&txdata[aa][slot_offset], // output
diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c
index 3b4e6782da..57c06e3b13 100644
--- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c
+++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c
@@ -112,7 +112,6 @@ void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1);
for (aa=0; aanb_antennas_tx; aa++) {
- // printf("Thread %d starting ... aa %d (%llu)\n",omp_get_thread_num(),aa,rdtsc());
if (frame_parms->Ncp == 1)
PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input
diff --git a/openair1/SIMULATION/LTE_PHY/framegen.c b/openair1/SIMULATION/LTE_PHY/framegen.c
index f5b1e6d45e..b9f0221b2d 100644
--- a/openair1/SIMULATION/LTE_PHY/framegen.c
+++ b/openair1/SIMULATION/LTE_PHY/framegen.c
@@ -333,7 +333,6 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1);
for (aa=0; aanb_antennas_tx; aa++) {
- // printf("Thread %d starting ... aa %d (%llu)\n",omp_get_thread_num(),aa,rdtsc());
if (frame_parms->Ncp == 1)
PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input
diff --git a/openair1/SIMULATION/LTE_PHY/mbmssim.c b/openair1/SIMULATION/LTE_PHY/mbmssim.c
index 31c3b47227..7efe9f4530 100644
--- a/openair1/SIMULATION/LTE_PHY/mbmssim.c
+++ b/openair1/SIMULATION/LTE_PHY/mbmssim.c
@@ -121,7 +121,6 @@ void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1);
for (aa=0; aanb_antennas_tx; aa++) {
- // printf("Thread %d starting ... aa %d (%llu)\n",omp_get_thread_num(),aa,rdtsc());
if (frame_parms->Ncp == 1)
PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input
&txdata[aa][slot_offset], // output
diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c
index eeb90a0a9d..0971a1358f 100644
--- a/openair1/SIMULATION/NR_PHY/dlschsim.c
+++ b/openair1/SIMULATION/NR_PHY/dlschsim.c
@@ -396,19 +396,6 @@ int main(int argc, char **argv)
load_pbch_desc(pbch_file_fd);
}
- /* for (int k=0; k<2; k++) {
- // Create transport channel structures for 2 transport blocks (MIMO)
- for (i=0; i<2; i++) {
- gNB->dlsch[k][i] = new_gNB_dlsch(Kmimo,8,Nsoft,0,frame_parms,gNB_config);
-
- if (!gNB->dlsch[k][i]) {
- printf("Can't get eNB dlsch structures\n");
- exit(-1);
- }
- gNB->dlsch[k][i]->Nsoft = 10;
- gNB->dlsch[k][i]->rnti = n_rnti+k;
- }
- }*/
//configure UE
UE = malloc(sizeof(PHY_VARS_NR_UE));
memcpy(&UE->frame_parms, frame_parms, sizeof(NR_DL_FRAME_PARMS));
@@ -421,10 +408,10 @@ int main(int argc, char **argv)
//nr_init_frame_parms_ue(&UE->frame_parms);
//init_nr_ue_transport(UE, 0);
+ int num_codeword = NR_MAX_NB_LAYERS > 4? 2:1;
for (int sf = 0; sf < 2; sf++) {
- for (i = 0; i < 2; i++) {
+ for (i = 0; i < num_codeword; i++) {
UE->dlsch[sf][0][i] = new_nr_ue_dlsch(Kmimo, 8, Nsoft, 5, N_RB_DL);
-
if (!UE->dlsch[sf][0][i]) {
printf("Can't get ue dlsch structures\n");
exit(-1);
@@ -435,8 +422,8 @@ int main(int argc, char **argv)
}
unsigned char harq_pid = 0; //dlsch->harq_ids[subframe];
- processingData_L1tx_t msgDataTx;
- init_DLSCH_struct(gNB, &msgDataTx);
+ processingData_L1tx_t msgDataTx;
+ init_DLSCH_struct(gNB, &msgDataTx);
NR_gNB_DLSCH_t *dlsch = msgDataTx.dlsch[0][0];
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->harq_process.pdsch_pdu.pdsch_pdu_rel15;
//time_stats_t *rm_stats, *te_stats, *i_stats;
@@ -645,8 +632,9 @@ int main(int argc, char **argv)
free(RC.gNB[0]);
free(RC.gNB);
+ int num_cw = NR_MAX_NB_LAYERS > 4? 2:1;
for (int sf = 0; sf < 2; sf++)
- for (int i = 0; i < 2; i++)
+ for (int i = 0; i < num_cw; i++)
free_nr_ue_dlsch(&UE->dlsch[sf][0][i], N_RB_DL);
term_nr_ue_signal(UE, 1);
free(UE);
diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c
index cfc7cb00b0..c3ff79ab07 100644
--- a/openair1/SIMULATION/NR_PHY/dlsim.c
+++ b/openair1/SIMULATION/NR_PHY/dlsim.c
@@ -441,7 +441,7 @@ int main(int argc, char **argv)
FILE *scg_fd=NULL;
- while ((c = getopt (argc, argv, "f:hA:pf:g:in:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:d:e:m:w:T:U:qX:")) != -1) {
+ while ((c = getopt (argc, argv, "f:hA:pf:g:in:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:d:e:q:m:w:T:U:X:")) != -1) {
switch (c) {
case 'f':
scg_fd = fopen(optarg,"r");
@@ -607,16 +607,17 @@ int main(int argc, char **argv)
case 'b':
g_rbSize = atoi(optarg);
break;
+
case 'D':
dlsch_threads = atoi(optarg);
- break;
+ break;
+
case 'e':
g_mcsIndex = atoi(optarg);
break;
case 'q':
- g_mcsTableIdx = 1;
- get_softmodem_params()->use_256qam_table = 1;
+ g_mcsTableIdx = atoi(optarg);
break;
case 'm':
@@ -655,7 +656,7 @@ int main(int argc, char **argv)
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("-L \n");
+ printf("-L \n");
//printf("-p Use extended prefix mode\n");
//printf("-d Use TDD\n");
printf("-n Number of frames to simulate\n");
@@ -680,7 +681,7 @@ int main(int argc, char **argv)
printf("-c Start symbol for PDSCH (fixed for now)\n");
printf("-j Number of symbols for PDSCH (fixed for now)\n");
printf("-e MSC index\n");
- printf("-q Use 2nd MCS table (256 QAM table) for PDSCH\n");
+ printf("-q MCS Table index\n");
printf("-t Acceptable effective throughput (in percentage)\n");
printf("-T Enable PTRS, arguments list L_PTRS{0,1,2} K_PTRS{2,4}, e.g. -T 2 0 2 \n");
printf("-U Change DMRS Config, arguments list DMRS TYPE{0=A,1=B} DMRS AddPos{0:2} DMRS ConfType{1:2}, e.g. -U 3 0 2 1 \n");
@@ -781,11 +782,14 @@ int main(int argc, char **argv)
fill_scc_sim(rrc.carrier.servingcellconfigcommon,&ssb_bitmap,N_RB_DL,N_RB_DL,mu,mu);
ssb_bitmap = 1;// Enable only first SSB with index ssb_indx=0
fix_scc(scc,ssb_bitmap);
-
prepare_scd(scd);
- fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 6, 0, 0, 0);
+ NR_UE_NR_Capability_t* UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t));
+ prepare_sim_uecap(UE_Capability_nr,scc,mu,
+ N_RB_DL,g_mcsTableIdx);
+ // TODO do a UECAP for phy-sim
+ fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, UE_Capability_nr, 0, 1, n_tx, 6, 0, 0, 0);
/* RRC parameter validation for secondaryCellGroup */
fix_scd(scd);
@@ -1014,8 +1018,6 @@ int main(int argc, char **argv)
msgDataTx->slot = slot;
msgDataTx->frame = frame;
memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t));
- reset_meas(&msgDataTx->phy_proc_tx);
- gNB->phy_proc_tx[0] = &msgDataTx->phy_proc_tx;
for (SNR = snr0; SNR < snr1; SNR += .2) {
@@ -1108,7 +1110,7 @@ int main(int argc, char **argv)
pdsch_pdu_rel15->dlDmrsSymbPos);
ptrsSymbPerSlot = get_ptrs_symbols_in_slot(dlPtrsSymPos, pdsch_pdu_rel15->StartSymbolIndex, pdsch_pdu_rel15->NrOfSymbols);
ptrsRePerSymb = ((rel15->rbSize + rel15->PTRSFreqDensity - 1)/rel15->PTRSFreqDensity);
- printf("[DLSIM] PTRS Symbols in a slot: %2u, RE per Symbol: %3u, RE in a slot %4d\n", ptrsSymbPerSlot,ptrsRePerSymb, ptrsSymbPerSlot*ptrsRePerSymb );
+ LOG_D(PHY,"[DLSIM] PTRS Symbols in a slot: %2u, RE per Symbol: %3u, RE in a slot %4d\n", ptrsSymbPerSlot,ptrsRePerSymb, ptrsSymbPerSlot*ptrsRePerSymb );
}
msgDataTx->ssb[0].ssb_pdu.ssb_pdu_rel15.bchPayload=0x001234;
@@ -1265,7 +1267,7 @@ int main(int argc, char **argv)
available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, rel15->nrOfLayers);
if(pdu_bit_map & 0x1) {
available_bits-= (ptrsSymbPerSlot * ptrsRePerSymb *rel15->nrOfLayers* 2);
- printf("[DLSIM][PTRS] Available bits are: %5u, removed PTRS bits are: %5u \n",available_bits, (ptrsSymbPerSlot * ptrsRePerSymb *rel15->nrOfLayers* 2) );
+ LOG_D(PHY,"[DLSIM][PTRS] Available bits are: %5u, removed PTRS bits are: %5u \n",available_bits, (ptrsSymbPerSlot * ptrsRePerSymb *rel15->nrOfLayers* 2) );
}
/*
@@ -1322,14 +1324,15 @@ int main(int argc, char **argv)
printf("*****************************************\n");
printf("\n");
dump_pdsch_stats(stdout,gNB);
- printf("SNR %f : n_errors (negative CRC) = %d/%d, Avg round %.2f, Channel BER %e, BLER %.2f, Eff Rate %.4f bits/slot, Eff Throughput %.2f, TBS %u bits/slot\n", SNR, n_errors, n_trials,roundStats[snrRun],berStats[snrRun],blerStats[snrRun],effRate,effRate/TBS*100,TBS);
+ printf("SNR %f : n_errors (negative CRC) = %d/%d, Avg round %.2f, Channel BER %e, BLER %.2f, Eff Rate %.4f bits/slot, Eff Throughput %.2f, TBS %u bits/slot\n",
+ SNR, n_errors, n_trials,roundStats[snrRun],berStats[snrRun],blerStats[snrRun],effRate,effRate/TBS*100,TBS);
printf("\n");
if (print_perf==1) {
printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, block %d)\n",
1000>>*scc->ssbSubcarrierSpacing, g_rbSize, g_mcsIndex,
msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3);
- printDistribution(gNB->phy_proc_tx[0],table_tx,"PHY proc tx");
+ printDistribution(&gNB->phy_proc_tx,table_tx,"PHY proc tx");
printStatIndent2(&gNB->dlsch_encoding_stats,"DLSCH encoding time");
printStatIndent3(&gNB->dlsch_segmentation_stats,"DLSCH segmentation time");
printStatIndent3(&gNB->tinput,"DLSCH LDPC input processing time");
diff --git a/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c b/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c
index 7a47410129..351c2f33c4 100644
--- a/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c
+++ b/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c
@@ -1,5 +1,6 @@
#include "nfapi/oai_integration/vendor_ext.h"
+
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return(0); }
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); }
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); }
@@ -35,4 +36,5 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
NR_UE_DLSCH_t *dlsch0,
NR_UE_DLSCH_t *dlsch1,
uint16_t n_pdus,
- UE_nr_rxtx_proc_t *proc) {}
+ UE_nr_rxtx_proc_t *proc,
+ void * typeSpecific ) {}
diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c
index f3a8d21fdd..8fc6410538 100644
--- a/openair1/SIMULATION/NR_PHY/pbchsim.c
+++ b/openair1/SIMULATION/NR_PHY/pbchsim.c
@@ -438,6 +438,7 @@ int main(int argc, char **argv)
printf("Initializing gNodeB for mu %d, N_RB_DL %d\n",mu,N_RB_DL);
+
RC.gNB = (PHY_VARS_gNB**) malloc(sizeof(PHY_VARS_gNB *));
RC.gNB[0] = malloc16_clear(sizeof(*(RC.gNB[0])));
gNB = RC.gNB[0];
@@ -531,13 +532,13 @@ int main(int argc, char **argv)
s_im = malloc(2*sizeof(double*));
r_re = malloc(2*sizeof(double*));
r_im = malloc(2*sizeof(double*));
- txdata = malloc(2*sizeof(int*));
+ txdata = calloc(2,sizeof(int*));
for (i=0; i<2; i++) {
+
s_re[i] = malloc16_clear(frame_length_complex_samples*sizeof(double));
s_im[i] = malloc16_clear(frame_length_complex_samples*sizeof(double));
-
r_re[i] = malloc16_clear(frame_length_complex_samples*sizeof(double));
r_im[i] = malloc16_clear(frame_length_complex_samples*sizeof(double));
printf("Allocating %d samples for txdata\n",frame_length_complex_samples);
@@ -550,6 +551,7 @@ int main(int argc, char **argv)
//configure UE
+
UE = malloc16_clear(sizeof(*UE));
memcpy(&UE->frame_parms,frame_parms,sizeof(UE->frame_parms));
//phy_init_nr_top(UE); //called from init_nr_ue_signal
@@ -722,6 +724,9 @@ int main(int argc, char **argv)
UE_nr_rxtx_proc_t proc={0};
UE->rx_offset=0;
uint8_t ssb_index = 0;
+ const int estimateSz=7*2*sizeof(int)*frame_parms->ofdm_symbol_size;
+ __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates[frame_parms->nb_antennas_rx][estimateSz];
+ __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][estimateSz];
while (!((SSB_positions >> ssb_index) & 0x01)) ssb_index++; // to select the first transmitted ssb
UE->symbol_offset = nr_get_ssb_start_symbol(frame_parms,ssb_index);
@@ -732,17 +737,20 @@ int main(int argc, char **argv)
i%frame_parms->symbols_per_slot,
ssb_slot);
- nr_pbch_channel_estimation(UE,&proc,0,ssb_slot,i%frame_parms->symbols_per_slot,i-(UE->symbol_offset+1),ssb_index%8,n_hf);
+ nr_pbch_channel_estimation(UE,estimateSz, dl_ch_estimates, dl_ch_estimates_time, &proc,
+ 0,ssb_slot,i%frame_parms->symbols_per_slot,i-(UE->symbol_offset+1),ssb_index%8,n_hf);
}
-
+ fapiPbch_t result;
ret = nr_rx_pbch(UE,
&proc,
- UE->pbch_vars[0],
+ estimateSz, dl_ch_estimates,
+ UE->pbch_vars[0],
frame_parms,
0,
ssb_index%8,
- SISO);
+ SISO,
+ &result);
if (ret==0) {
//UE->rx_ind.rx_indication_body->mib_pdu.ssb_index; //not yet detected automatically
@@ -751,9 +759,9 @@ int main(int argc, char **argv)
for (int i=0; i<8; i++)
gNB_xtra_byte |= ((gNB->pbch.pbch_a>>(31-i))&1)<<(7-i);
- payload_ret = (UE->pbch_vars[0]->xtra_byte == gNB_xtra_byte);
+ payload_ret = (result.xtra_byte == gNB_xtra_byte);
for (i=0;i<3;i++){
- payload_ret += (UE->pbch_vars[0]->decoded_output[i] == ((msgDataTx.ssb[ssb_index].ssb_pdu.ssb_pdu_rel15.bchPayload>>(8*i)) & 0xff));
+ payload_ret += (result.decoded_output[i] == ((msgDataTx.ssb[ssb_index].ssb_pdu.ssb_pdu_rel15.bchPayload>>(8*i)) & 0xff));
}
//printf("xtra byte gNB: 0x%02x UE: 0x%02x\n",gNB_xtra_byte, UE->pbch_vars[0]->xtra_byte);
//printf("ret %d\n", payload_ret);
diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c
index 6cdf0b90cd..f6227e1769 100644
--- a/openair1/SIMULATION/NR_PHY/ulschsim.c
+++ b/openair1/SIMULATION/NR_PHY/ulschsim.c
@@ -407,15 +407,10 @@ int main(int argc, char **argv)
}
for (sf = 0; sf < 2; sf++) {
- for (i = 0; i < 2; i++) {
-
- UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8);
-
- if (!UE->ulsch[sf][0][i]) {
- printf("Can't get ue ulsch structures.\n");
- exit(-1);
- }
-
+ UE->ulsch[sf][0] = new_nr_ue_ulsch(N_RB_UL, 8);
+ if (!UE->ulsch[sf][0]) {
+ printf("Can't get ue ulsch structures.\n");
+ exit(-1);
}
}
@@ -431,11 +426,11 @@ int main(int argc, char **argv)
uint8_t rvidx = 0;
uint8_t UE_id = 0;
- NR_gNB_ULSCH_t *ulsch_gNB = gNB->ulsch[UE_id][0];
+ NR_gNB_ULSCH_t *ulsch_gNB = gNB->ulsch[UE_id];
NR_UL_gNB_HARQ_t *harq_process_gNB = ulsch_gNB->harq_processes[harq_pid];
nfapi_nr_pusch_pdu_t *rel15_ul = &harq_process_gNB->ulsch_pdu;
- NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[0][0][0];
+ NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[0][0];
mod_order = nr_get_Qm_ul(Imcs, 0);
code_rate = nr_get_code_rate_ul(Imcs, 0);
@@ -525,7 +520,7 @@ int main(int argc, char **argv)
}
*/
- if (ulsch_ue->g[i] == 0)
+ if (ulsch_ue->harq_processes[harq_pid]->f[i] == 0)
modulated_input[i] = 1.0; ///sqrt(2); //QPSK
else
modulated_input[i] = -1.0; ///sqrt(2);
@@ -615,8 +610,7 @@ int main(int argc, char **argv)
}
for (sf = 0; sf < 2; sf++)
- for (i = 0; i < 2; i++)
- free_nr_ue_ulsch(&UE->ulsch[sf][0][i], N_RB_UL);
+ free_nr_ue_ulsch(&UE->ulsch[sf][0], N_RB_UL);
term_nr_ue_signal(UE, 1);
free(UE);
diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c
index aebaf42483..5e4ae2deb7 100644
--- a/openair1/SIMULATION/NR_PHY/ulsim.c
+++ b/openair1/SIMULATION/NR_PHY/ulsim.c
@@ -689,7 +689,6 @@ int main(int argc, char **argv)
notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_free,NULL);
processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx);
msgDataTx->slot = -1;
- gNB->phy_proc_tx[0] = &msgDataTx->phy_proc_tx;
//gNB_config = &gNB->gNB_config;
//memset((void *)&gNB->UL_INFO,0,sizeof(gNB->UL_INFO));
@@ -731,7 +730,8 @@ int main(int argc, char **argv)
prepare_scd(scd);
- fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0, 0);
+ // TODO do a UECAP for phy-sim
+ fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, NULL, 0, 1, n_tx, 0, 0, 0, 0);
// xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup);
@@ -804,7 +804,7 @@ int main(int argc, char **argv)
unsigned char harq_pid = 0;
- NR_gNB_ULSCH_t *ulsch_gNB = gNB->ulsch[UE_id][0];
+ NR_gNB_ULSCH_t *ulsch_gNB = gNB->ulsch[UE_id];
//nfapi_nr_ul_config_ulsch_pdu *rel15_ul = &ulsch_gNB->harq_processes[harq_pid]->ulsch_pdu;
nfapi_nr_ul_tti_request_t *UL_tti_req = malloc(sizeof(*UL_tti_req));
NR_Sched_Rsp_t *Sched_INFO = malloc(sizeof(*Sched_INFO));
@@ -813,7 +813,7 @@ int main(int argc, char **argv)
nfapi_nr_pusch_pdu_t *pusch_pdu = &UL_tti_req->pdus_list[0].pusch_pdu;
- NR_UE_ULSCH_t **ulsch_ue = UE->ulsch[0][0];
+ NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[0][0];
unsigned char *estimated_output_bit;
unsigned char *test_input_bit;
@@ -1044,8 +1044,8 @@ int main(int argc, char **argv)
memset((void*)roundStats,0,50*sizeof(roundStats[0]));
while (roundharq_processes[harq_pid]->round = round;
- gNB->ulsch[0][0]->harq_processes[harq_pid]->round = round;
+ ulsch_ue->harq_processes[harq_pid]->round = round;
+ gNB->ulsch[0]->harq_processes[harq_pid]->round = round;
rv_index = nr_rv_round_map[round];
UE_proc.thread_id = 0;
@@ -1186,7 +1186,7 @@ int main(int argc, char **argv)
//nr_fill_ulsch(gNB,frame,slot,pusch_pdu); // Not needed as its its already filled as apart of "nr_schedule_response(Sched_INFO);"
- for (int i=0;i<(TBS/8);i++) ulsch_ue[0]->harq_processes[harq_pid]->a[i]=i&0xff;
+ for (int i=0;i<(TBS/8);i++) ulsch_ue->harq_processes[harq_pid]->a[i]=i&0xff;
if (input_fd == NULL) {
// set FAPI parameters for UE, put them in the scheduled response and call
@@ -1361,8 +1361,8 @@ int main(int argc, char **argv)
}
////////////////////////////////////////////////////////////
- if ((gNB->ulsch[0][0]->last_iteration_cnt >=
- gNB->ulsch[0][0]->max_ldpc_iterations+1) || ul_proc_error == 1) {
+ if ((gNB->ulsch[0]->last_iteration_cnt >=
+ gNB->ulsch[0]->max_ldpc_iterations+1) || ul_proc_error == 1) {
error_flag = 1;
n_errors[round][snrRun]++;
crc_status = 1;
@@ -1387,8 +1387,8 @@ int main(int argc, char **argv)
for (i = 0; i < available_bits; i++) {
- if(((ulsch_ue[0]->g[i] == 0) && (gNB->pusch_vars[UE_id]->llr[i] <= 0)) ||
- ((ulsch_ue[0]->g[i] == 1) && (gNB->pusch_vars[UE_id]->llr[i] >= 0)))
+ if(((ulsch_ue->harq_processes[harq_pid]->f[i] == 0) && (gNB->pusch_vars[UE_id]->llr[i] <= 0)) ||
+ ((ulsch_ue->harq_processes[harq_pid]->f[i] == 1) && (gNB->pusch_vars[UE_id]->llr[i] >= 0)))
{
/*if(errors_scrambling == 0)
printf("\x1B[34m" "[frame %d][trial %d]\t1st bit in error in unscrambling = %d\n" "\x1B[0m", frame, trial, i);*/
@@ -1406,7 +1406,7 @@ int main(int argc, char **argv)
for (i = 0; i < TBS; i++) {
estimated_output_bit[i] = (ulsch_gNB->harq_processes[harq_pid]->b[i/8] & (1 << (i & 7))) >> (i & 7);
- test_input_bit[i] = (ulsch_ue[0]->harq_processes[harq_pid]->b[i/8] & (1 << (i & 7))) >> (i & 7);
+ test_input_bit[i] = (ulsch_ue->harq_processes[harq_pid]->b[i/8] & (1 << (i & 7))) >> (i & 7);
if (estimated_output_bit[i] != test_input_bit[i]) {
/*if(errors_decoding == 0)
@@ -1415,13 +1415,13 @@ int main(int argc, char **argv)
}
}
if (n_trials == 1) {
- for (int r=0;rharq_processes[harq_pid]->C;r++)
- for (int i=0;iharq_processes[harq_pid]->K>>3;i++) {
- if ((ulsch_ue[0]->harq_processes[harq_pid]->c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]) != 0) printf("************");
+ for (int r=0;rharq_processes[harq_pid]->C;r++)
+ for (int i=0;iharq_processes[harq_pid]->K>>3;i++) {
+ if ((ulsch_ue->harq_processes[harq_pid]->c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]) != 0) printf("************");
/*printf("r %d: in[%d] %x, out[%d] %x (%x)\n",r,
- i,ulsch_ue[0]->harq_processes[harq_pid]->c[r][i],
+ i,ulsch_ue->harq_processes[harq_pid]->c[r][i],
i,ulsch_gNB->harq_processes[harq_pid]->c[r][i],
- ulsch_ue[0]->harq_processes[harq_pid]->c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]);*/
+ ulsch_ue->harq_processes[harq_pid]->c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]);*/
}
}
if (errors_decoding > 0 && error_flag == 0) {
diff --git a/openair1/SIMULATION/TOOLS/channel_sim.c b/openair1/SIMULATION/TOOLS/channel_sim.c
index 197a296a51..de8db5d7cb 100644
--- a/openair1/SIMULATION/TOOLS/channel_sim.c
+++ b/openair1/SIMULATION/TOOLS/channel_sim.c
@@ -40,7 +40,6 @@
#include "PHY_INTERFACE/phy_interface_extern.h"
#include "UTIL/OCG/OCG.h"
#include "UTIL/OPT/opt.h" // to test OPT
-#include "UTIL/FIFO/types.h"
#define RF
diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c
index 2795c07ce7..f5ff7ddf9e 100644
--- a/openair2/GNB_APP/gnb_config.c
+++ b/openair2/GNB_APP/gnb_config.c
@@ -624,15 +624,18 @@ void RCconfig_NR_L1(void) {
config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL);
char *ulprbbl = *GNBParamList.paramarray[0][GNB_ULPRBBLACKLIST_IDX].strptr;
if (ulprbbl) LOG_I(NR_PHY,"PRB blacklist %s\n",ulprbbl);
- char *pt = strtok(ulprbbl,",");
+ char *save = NULL;
+ char *pt = strtok_r(ulprbbl, ",", &save);
int prbbl[275];
int num_prbbl=0;
memset(prbbl,0,275*sizeof(int));
while (pt) {
- prbbl[atoi(pt)] = 1;
+ const int rb = atoi(pt);
+ AssertFatal(rb < 275, "RB %d out of bounds (max 275)\n", rb);
+ prbbl[rb] = 0x3FFF; // all symbols taken
LOG_I(NR_PHY,"Blacklisting prb %d\n",atoi(pt));
- pt = strtok(NULL,",");
+ pt = strtok_r(NULL, ",", &save);
num_prbbl++;
}
@@ -736,15 +739,16 @@ void RCconfig_nr_macrlc() {
config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL);
char *ulprbbl = *GNBParamList.paramarray[0][GNB_ULPRBBLACKLIST_IDX].strptr;
- char *pt = strtok(ulprbbl,",");
- int prbbl[275];
+ char *save = NULL;
+ char *pt = strtok_r(ulprbbl, ",", &save);
+ uint16_t prbbl[275];
int num_prbbl=0;
- int prb;
- memset(prbbl,0,275*sizeof(int));
+ memset(prbbl,0,sizeof(prbbl));
while (pt) {
- prb=atoi(pt);
- prbbl[prb] = 1;
- pt = strtok(NULL,",");
+ const int prb = atoi(pt);
+ AssertFatal(prb < 275, "RB %d out of bounds (max 275)\n", prb);
+ prbbl[prb] = 0x3FFF; // all symbols taken
+ pt = strtok_r(NULL, ",", &save);
num_prbbl++;
}
@@ -1458,7 +1462,8 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
// NGAP_REGISTER_GNB_REQ (msg_p).enb_interface_name_for_NGU = strdup(enb_interface_name_for_NGU);
cidr = *(NETParams[GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX].strptr);
- address = strtok(cidr, "/");
+ char *save = NULL;
+ address = strtok_r(cidr, "/", &save);
NGAP_REGISTER_GNB_REQ (msg_p).gnb_ip_address.ipv6 = 0;
NGAP_REGISTER_GNB_REQ (msg_p).gnb_ip_address.ipv4 = 1;
@@ -1730,7 +1735,8 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) {
}
cidr = *(NETParams[ENB_IPV4_ADDR_FOR_X2C_IDX].strptr);
- address = strtok(cidr, "/");
+ char *save = NULL;
+ address = strtok_r(cidr, "/", &save);
X2AP_REGISTER_ENB_REQ (msg_p).enb_x2_ip_address.ipv6 = 0;
X2AP_REGISTER_ENB_REQ (msg_p).enb_x2_ip_address.ipv4 = 1;
strcpy(X2AP_REGISTER_ENB_REQ (msg_p).enb_x2_ip_address.ipv4_address, address);
diff --git a/openair2/LAYER2/MAC/mac.h b/openair2/LAYER2/MAC/mac.h
index cb93c2feb8..6637d05a8a 100644
--- a/openair2/LAYER2/MAC/mac.h
+++ b/openair2/LAYER2/MAC/mac.h
@@ -69,7 +69,7 @@
#include "nfapi_interface.h"
#include "PHY_INTERFACE/IF_Module.h"
-#include "PHY/TOOLS/time_meas.h"
+#include "time_meas.h"
#include "PHY/defs_common.h" // for PRACH_RESOURCES_t
#include "PHY/LTE_TRANSPORT/transport_common.h"
diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
index e1058e1173..bc9895ac2e 100644
--- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
@@ -1119,7 +1119,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
tx_req.number_of_pdus = 0;
for (int j = 0; j < ul_config->number_pdus; j++) {
- uint8_t *ulsch_input_buffer = &(ulsch_input_buffer_array[tx_req.number_of_pdus][MAX_ULSCH_PAYLOAD_BYTES]);
+ uint8_t *ulsch_input_buffer = ulsch_input_buffer_array[tx_req.number_of_pdus];
fapi_nr_ul_config_request_pdu_t *ulcfg_pdu = &ul_config->ul_config_list[j];
diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c
index e703d5aa65..7833b41f0b 100644
--- a/openair2/LAYER2/NR_MAC_gNB/config.c
+++ b/openair2/LAYER2/NR_MAC_gNB/config.c
@@ -627,6 +627,8 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
process_CellGroup(CellGroup,&UE_info->UE_sched_ctrl[UE_id]);
const NR_ServingCellConfig_t *servingCellConfig = CellGroup ? CellGroup->spCellConfig->spCellConfigDedicated : NULL;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
+ sched_ctrl->update_pdsch_ps = true;
+ sched_ctrl->update_pusch_ps = true;
const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig ? servingCellConfig->pdsch_ServingCellConfig->choice.setup : NULL;
if (get_softmodem_params()->sa) {
// add all available DL HARQ processes for this UE in SA
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
index 51541353f4..540198a22a 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
@@ -318,7 +318,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
const int num_slots = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
const int last_slot = (slot + num_slots - 1) % num_slots;
uint16_t *vrb_map_UL = cc[CC_id].vrb_map_UL;
- memset(&vrb_map_UL[last_slot * MAX_BWP_SIZE], 0, sizeof(uint16_t) * MAX_BWP_SIZE);
+ memcpy(&vrb_map_UL[last_slot * MAX_BWP_SIZE], &RC.nrmac[module_idP]->ulprbbl, sizeof(uint16_t) * MAX_BWP_SIZE);
clear_nr_nfapi_information(RC.nrmac[module_idP], CC_id, frame, slot);
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
index 86ca851978..a00276c5f5 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
@@ -389,7 +389,7 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP
const int16_t N_RA_RB = get_N_RA_RB(cfg->prach_config.prach_sub_c_spacing.value, mu_pusch);
uint16_t *vrb_map_UL = &cc->vrb_map_UL[slotP * MAX_BWP_SIZE];
for (int i = 0; i < N_RA_RB * fdm; ++i)
- vrb_map_UL[bwp_start + rach_ConfigGeneric->msg1_FrequencyStart + i] = 0xff; // all symbols
+ vrb_map_UL[bwp_start + rach_ConfigGeneric->msg1_FrequencyStart + i] = SL_to_bitmap(start_symbol, N_t_slot*N_dur);
}
}
}
@@ -772,6 +772,8 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t
int scs = scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing;
int fh = 0;
int startSymbolAndLength = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[ra->Msg3_tda_id]->startSymbolAndLength;
+ int StartSymbolIndex, NrOfSymbols;
+ SLIV2SL(startSymbolAndLength, &StartSymbolIndex, &NrOfSymbols);
int mappingtype = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[ra->Msg3_tda_id]->mappingType;
uint16_t *vrb_map_UL = &RC.nrmac[module_idP]->common_channels[CC_id].vrb_map_UL[sched_slot * MAX_BWP_SIZE];
@@ -780,7 +782,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t
int BWPSize = nr_mac->type0_PDCCH_CSS_config[ra->beam_id].num_rbs;
int rbStart = 0;
for (int i = 0; (i < ra->msg3_nb_rb) && (rbStart <= (BWPSize - ra->msg3_nb_rb)); i++) {
- if (vrb_map_UL[rbStart + BWPStart + i]) {
+ if (vrb_map_UL[rbStart + BWPStart + i]&SL_to_bitmap(StartSymbolIndex, NrOfSymbols)) {
rbStart += i;
i = 0;
}
@@ -898,7 +900,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t
aggregation_level);
for (int rb = 0; rb < ra->msg3_nb_rb; rb++) {
- vrb_map_UL[rbStart + BWPStart + rb] = 1;
+ vrb_map_UL[rbStart + BWPStart + rb] |= SL_to_bitmap(StartSymbolIndex, NrOfSymbols);
}
// reset state to wait msg3
@@ -928,6 +930,9 @@ void nr_get_Msg3alloc(module_id_t module_id,
int mu = ubwp ?
ubwp->bwp_Common->genericParameters.subcarrierSpacing :
scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing;
+ int StartSymbolIndex = 0;
+ int NrOfSymbols = 0;
+ int startSymbolAndLength = 0;
int temp_slot = 0;
ra->Msg3_tda_id = 16; // initialization to a value above limit
@@ -942,6 +947,8 @@ void nr_get_Msg3alloc(module_id_t module_id,
int nb_periods_per_frame = get_nb_periods_per_frame(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity);
int nb_slots_per_period = ((1<list.count; i++) {
+ startSymbolAndLength = pusch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength;
+ SLIV2SL(startSymbolAndLength, &StartSymbolIndex, &NrOfSymbols);
k2 = *pusch_TimeDomainAllocationList->list.array[i]->k2;
// we want to transmit in the uplink symbols of mixed slot
if ((k2 + DELTA[mu])%nb_slots_per_period == 0) {
@@ -949,6 +956,8 @@ void nr_get_Msg3alloc(module_id_t module_id,
ra->Msg3_slot = temp_slot%nr_slots_per_frame[mu];
if (is_xlsch_in_slot(RC.nrmac[module_id]->ulsch_slot_bitmap[ra->Msg3_slot / 64], ra->Msg3_slot)) {
ra->Msg3_tda_id = i;
+ ra->msg3_startsymb = StartSymbolIndex;
+ ra->msg3_nrsymb = NrOfSymbols;
break;
}
}
@@ -1002,11 +1011,12 @@ void nr_get_Msg3alloc(module_id_t module_id,
while (rbSize < msg3_nb_rb) {
rbStart += rbSize; /* last iteration rbSize was not enough, skip it */
rbSize = 0;
- while (rbStart < bwpSize && vrb_map_UL[rbStart + bwpStart])
+ while (rbStart < bwpSize &&
+ (vrb_map_UL[rbStart + bwpStart]&SL_to_bitmap(StartSymbolIndex, NrOfSymbols)))
rbStart++;
AssertFatal(rbStart < bwpSize - msg3_nb_rb, "no space to allocate Msg 3 for RA!\n");
while (rbStart + rbSize < bwpSize
- && !vrb_map_UL[rbStart + bwpStart + rbSize]
+ && !(vrb_map_UL[rbStart + bwpStart + rbSize]&SL_to_bitmap(StartSymbolIndex, NrOfSymbols))
&& rbSize < msg3_nb_rb)
rbSize++;
}
@@ -1113,7 +1123,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t
i + ra->msg3_first_rb,
ra->Msg3_frame,
ra->Msg3_slot);
- vrb_map_UL[i + ra->msg3_first_rb + ra->msg3_bwp_start] = 1;
+ vrb_map_UL[i + ra->msg3_first_rb + ra->msg3_bwp_start] |= SL_to_bitmap(ra->msg3_startsymb, ra->msg3_nrsymb);
}
LOG_D(NR_MAC, "[gNB %d][RAPROC] Frame %d, Slot %d : CC_id %d RA is active, Msg3 in (%d,%d)\n", module_idP, frameP, slotP, CC_id, ra->Msg3_frame, ra->Msg3_slot);
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
index 33dc95c151..9f0462c4df 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
@@ -644,7 +644,7 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
nfapi_nr_pdu_t *tx_req = &gNB_mac->TX_req[CC_id].pdu_list[ntx_req];
// Data to be transmitted
- bzero(tx_req->TLVs[0].value.direct,MAX_NR_DLSCH_PAYLOAD_BYTES);
+ bzero(tx_req->TLVs[0].value.direct,MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*1056);
memcpy(tx_req->TLVs[0].value.direct, sib1_payload, sib1_sdu_length);
tx_req->PDU_length = TBS;
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
index 1750ec722a..462b0e4922 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
@@ -393,12 +393,17 @@ int nr_write_ce_dlsch_pdu(module_id_t module_idP,
#define BLER_UPDATE_FRAME 10
#define BLER_FILTER 0.9f
-int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t slot, int UE_id)
+int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t slot, int UE_id, int mcs_table)
{
gNB_MAC_INST *nrmac = RC.nrmac[mod_id];
const NR_ServingCellConfigCommon_t *scc = nrmac->common_channels[CC_id].ServingCellConfigCommon;
const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
+ int max_allowed_mcs = (mcs_table == 1) ? 27 : 28;
+ int max_mcs = nrmac->dl_max_mcs;
+ if (nrmac->dl_max_mcs>max_allowed_mcs)
+ max_mcs = max_allowed_mcs;
+
NR_DL_bler_stats_t *bler_stats = &nrmac->UE_info.UE_sched_ctrl[UE_id].dl_bler_stats;
/* first call: everything is zero. Initialize to sensible default */
if (bler_stats->last_frame_slot == 0 && bler_stats->mcs == 0) {
@@ -444,7 +449,7 @@ int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t
if (bler_stats->rd2_bler > nrmac->dl_rd2_bler_threshold && old_mcs > 6) {
new_mcs -= 2;
} else if (bler_stats->rd2_bler < nrmac->dl_rd2_bler_threshold) {*/
- if (bler_stats->bler < nrmac->dl_bler_target_lower && old_mcs < nrmac->dl_max_mcs && dtx > 9)
+ if (bler_stats->bler < nrmac->dl_bler_target_lower && old_mcs < max_mcs && dtx > 9)
new_mcs += 1;
else if (bler_stats->bler > nrmac->dl_bler_target_upper && old_mcs > 6)
new_mcs -= 1;
@@ -586,8 +591,10 @@ bool allocate_dl_retransmission(module_id_t module_id,
}
/* check whether we need to switch the TDA allocation since the last
* (re-)transmission */
- if (ps->time_domain_allocation != tda)
- nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, ps->nrOfLayers, sched_ctrl, ps);
+ if (ps->time_domain_allocation != tda || sched_ctrl->update_pdsch_ps) {
+ nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, ps->nrOfLayers, sched_ctrl, ps);
+ sched_ctrl->update_pdsch_ps = false;
+ }
} else {
/* the retransmission will use a different time domain allocation, check
* that we have enough resources */
@@ -684,7 +691,7 @@ bool allocate_dl_retransmission(module_id_t module_id,
/* retransmissions: directly allocate */
*n_rb_sched -= sched_ctrl->sched_pdsch.rbSize;
for (int rb = 0; rb < sched_ctrl->sched_pdsch.rbSize; rb++)
- rballoc_mask[rb + sched_ctrl->sched_pdsch.rbStart] -= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
+ rballoc_mask[rb + sched_ctrl->sched_pdsch.rbStart] ^= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
return true;
}
@@ -744,7 +751,7 @@ void pf_dl(module_id_t module_id,
/* Calculate coeff */
set_dl_mcs(sched_pdsch,sched_ctrl,&mac->dl_max_mcs,ps->mcsTableIdx);
- sched_pdsch->mcs = get_mcs_from_bler(module_id, /* CC_id = */ 0, frame, slot, UE_id);
+ sched_pdsch->mcs = get_mcs_from_bler(module_id, /* CC_id = */ 0, frame, slot, UE_id, ps->mcsTableIdx);
layers[UE_id] = set_dl_nrOfLayers(sched_ctrl);
const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx);
const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx);
@@ -863,8 +870,11 @@ void pf_dl(module_id_t module_id,
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
if (ps->nrOfLayers != layers[UE_id] ||
- ps->time_domain_allocation != tda)
+ ps->time_domain_allocation != tda ||
+ sched_ctrl->update_pdsch_ps) {
nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, layers[UE_id], sched_ctrl, ps);
+ sched_ctrl->update_pdsch_ps = false;
+ }
const uint16_t slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
// Freq-demain allocation
@@ -900,7 +910,7 @@ void pf_dl(module_id_t module_id,
/* transmissions: directly allocate */
n_rb_sched -= sched_pdsch->rbSize;
for (int rb = 0; rb < sched_pdsch->rbSize; rb++)
- rballoc_mask[rb + sched_pdsch->rbStart] -= slbitmap;
+ rballoc_mask[rb + sched_pdsch->rbStart] ^= slbitmap;
}
}
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
index fddf084a38..7866cc4915 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
@@ -55,8 +55,6 @@ extern RAN_CONTEXT_t RC;
//#define ENABLE_MAC_PAYLOAD_DEBUG 1
-//uint8_t mac_pdu[MAX_NR_DLSCH_PAYLOAD_BYTES];
-
/*Scheduling of DLSCH with associated DCI in common search space
* current version has only a DCI for type 1 PDCCH for C_RNTI*/
void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
@@ -481,9 +479,8 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_
uint16_t *vrb_map_UL =
&RC.nrmac[module_id]->common_channels[CC_id].vrb_map_UL[sched_slot * MAX_BWP_SIZE];
- const uint16_t symb = ((1 << ps->nrOfSymbols) - 1) << ps->startSymbolIndex;
for (int i = rbStart; i < rbStart + rbSize; ++i) {
- if ((vrb_map_UL[i+BWPStart] & symb) != 0) {
+ if ((vrb_map_UL[i+BWPStart] & SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)) != 0) {
LOG_E(MAC,
"%s(): %4d.%2d RB %d is already reserved, cannot schedule UE\n",
__func__,
@@ -561,6 +558,6 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_
sched_ctrl->aggregation_level);
for (int rb = rbStart; rb < rbStart + rbSize; rb++)
- vrb_map_UL[rb+BWPStart] = 1;
+ vrb_map_UL[rb+BWPStart] |= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
return true;
}
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
index dbfaf7ac76..ac0b186218 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
@@ -532,6 +532,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
ps->mcsTableIdx = 2;
}
else ps->mcsTableIdx = 0;
+ LOG_D(NR_MAC,"MCS Table Index: %d\n",ps->mcsTableIdx);
NR_PDSCH_Config_t *pdsch_Config;
if (bwp &&
@@ -1234,23 +1235,26 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
else { // this is the default PUCCH configuration, PUCCH format 0 or 1
LOG_D(NR_MAC,"pucch_acknak: Filling default PUCCH configuration from Tables (r_pucch %d, bwp %p)\n",r_pucch,bwp);
int rsetindex = *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon;
- int prboffset = r_pucch/default_pucch_csset[rsetindex];
- int prboffsetm8 = (r_pucch-8)/default_pucch_csset[rsetindex];
- pucch_pdu->prb_start = (r_pucch>>3)==0 ?
- default_pucch_prboffset[rsetindex] + prboffset:
- pucch_pdu->bwp_size-1-default_pucch_prboffset[rsetindex]-prboffsetm8;
+ int prb_start, second_hop_prb, nr_of_symb, start_symb;
+ set_r_pucch_parms(rsetindex,
+ r_pucch,
+ pucch_pdu->bwp_size,
+ &prb_start,
+ &second_hop_prb,
+ &nr_of_symb,
+ &start_symb);
+
+ pucch_pdu->prb_start = prb_start;
pucch_pdu->rnti = rnti;
pucch_pdu->freq_hop_flag = 1;
- pucch_pdu->second_hop_prb = (r_pucch>>3)==0?
- pucch_pdu->bwp_size-1-default_pucch_prboffset[rsetindex]-prboffset:
- default_pucch_prboffset[rsetindex] + prboffsetm8;
+ pucch_pdu->second_hop_prb = second_hop_prb;
pucch_pdu->format_type = default_pucch_fmt[rsetindex];
pucch_pdu->initial_cyclic_shift = r_pucch%default_pucch_csset[rsetindex];
if (rsetindex==3||rsetindex==7||rsetindex==11) pucch_pdu->initial_cyclic_shift*=6;
else if (rsetindex==1||rsetindex==2) pucch_pdu->initial_cyclic_shift*=3;
else pucch_pdu->initial_cyclic_shift*=4;
- pucch_pdu->nr_of_symbols = default_pucch_numbsymb[rsetindex];
- pucch_pdu->start_symbol_index = default_pucch_firstsymb[rsetindex];
+ pucch_pdu->nr_of_symbols = nr_of_symb;
+ pucch_pdu->start_symbol_index = start_symb;
if (pucch_pdu->format_type == 1) pucch_pdu->time_domain_occ_idx = 0; // check this!!
pucch_pdu->sr_flag = O_sr;
pucch_pdu->prb_size=1;
@@ -1258,6 +1262,32 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
}
+void set_r_pucch_parms(int rsetindex,
+ int r_pucch,
+ int bwp_size,
+ int *prb_start,
+ int *second_hop_prb,
+ int *nr_of_symbols,
+ int *start_symbol_index) {
+
+ // procedure described in 38.213 section 9.2.1
+
+ int prboffset = r_pucch/default_pucch_csset[rsetindex];
+ int prboffsetm8 = (r_pucch-8)/default_pucch_csset[rsetindex];
+
+ *prb_start = (r_pucch>>3)==0 ?
+ default_pucch_prboffset[rsetindex] + prboffset:
+ bwp_size-1-default_pucch_prboffset[rsetindex]-prboffsetm8;
+
+ *second_hop_prb = (r_pucch>>3)==0?
+ bwp_size-1-default_pucch_prboffset[rsetindex]-prboffset:
+ default_pucch_prboffset[rsetindex] + prboffsetm8;
+
+ *nr_of_symbols = default_pucch_numbsymb[rsetindex];
+ *start_symbol_index = default_pucch_firstsymb[rsetindex];
+}
+
+
void prepare_dci(const NR_CellGroupConfig_t *CellGroup,
dci_pdu_rel15_t *dci_pdu_rel15,
nr_dci_format_t format,
@@ -1943,7 +1973,6 @@ void create_nr_list(NR_list_t *list, int len)
{
list->head = -1;
list->next = malloc(len * sizeof(*list->next));
- LOG_W(NR_MAC, "NR list->next %p\n", list->next);
AssertFatal(list->next, "cannot malloc() memory for NR_list_t->next\n");
for (int i = 0; i < len; ++i)
list->next[i] = -1;
@@ -2278,8 +2307,16 @@ void create_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl,
add_tail_nr_list(&sched_ctrl->available_dl_harq, harq);
create_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ);
create_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ);
+ } else if (sched_ctrl->available_dl_harq.len == nrofHARQ) {
+ LOG_D(NR_MAC, "nrofHARQ %d already configured\n", nrofHARQ);
} else {
+ const int old_nrofHARQ = sched_ctrl->available_dl_harq.len;
+ AssertFatal(nrofHARQ > old_nrofHARQ,
+ "cannot resize HARQ list to be smaller (nrofHARQ %d, old_nrofHARQ %d)\n",
+ nrofHARQ, old_nrofHARQ);
resize_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ);
+ for (int harq = old_nrofHARQ; harq < nrofHARQ; harq++)
+ add_tail_nr_list(&sched_ctrl->available_dl_harq, harq);
resize_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ);
resize_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ);
}
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
index cfff41a6ad..cedc78097e 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
@@ -79,7 +79,9 @@ void nr_fill_nfapi_pucch(module_id_t mod_id,
NR_BWP_UplinkDedicated_t *ubwpd;
ubwpd = cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL;
- LOG_D(NR_MAC,"pucch_acknak: %d.%d Calling nr_configure_pucch (ubwpd %p,r_pucch %d) pucch in %d.%d\n",frame,slot,ubwpd,pucch->r_pucch,pucch->frame,pucch->ul_slot);
+ LOG_D(NR_MAC,"%d.%d Calling nr_configure_pucch (ubwpd %p,r_pucch %d) pucch to be scheduled in %d.%d\n",
+ frame,slot,ubwpd,pucch->r_pucch,pucch->frame,pucch->ul_slot);
+
nr_configure_pucch(pucch_pdu,
scc,
UE_info->CellGroup[UE_id],
@@ -758,16 +760,16 @@ void nr_csi_meas_reporting(int Mod_idP,
switch(pucchres->format.present){
case NR_PUCCH_Resource__format_PR_format2:
len = pucchres->format.choice.format2->nrofPRBs;
- mask = ((1 << pucchres->format.choice.format2->nrofSymbols) - 1) << pucchres->format.choice.format2->startingSymbolIndex;
+ mask = SL_to_bitmap(pucchres->format.choice.format2->startingSymbolIndex, pucchres->format.choice.format2->nrofSymbols);
curr_pucch->simultaneous_harqcsi = pucch_Config->format2->choice.setup->simultaneousHARQ_ACK_CSI;
break;
case NR_PUCCH_Resource__format_PR_format3:
len = pucchres->format.choice.format3->nrofPRBs;
- mask = ((1 << pucchres->format.choice.format3->nrofSymbols) - 1) << pucchres->format.choice.format3->startingSymbolIndex;
+ mask = SL_to_bitmap(pucchres->format.choice.format3->startingSymbolIndex, pucchres->format.choice.format3->nrofSymbols);
curr_pucch->simultaneous_harqcsi = pucch_Config->format3->choice.setup->simultaneousHARQ_ACK_CSI;
break;
case NR_PUCCH_Resource__format_PR_format4:
- mask = ((1 << pucchres->format.choice.format4->nrofSymbols) - 1) << pucchres->format.choice.format4->startingSymbolIndex;
+ mask = SL_to_bitmap(pucchres->format.choice.format4->startingSymbolIndex, pucchres->format.choice.format4->nrofSymbols);
curr_pucch->simultaneous_harqcsi = pucch_Config->format4->choice.setup->simultaneousHARQ_ACK_CSI;
break;
default:
@@ -775,7 +777,12 @@ void nr_csi_meas_reporting(int Mod_idP,
}
// verify resources are free
for (int i = start; i < start + len; ++i) {
- vrb_map_UL[i+bwp_start] |= mask;
+ if((vrb_map_UL[i+bwp_start] & mask) != 0) {
+ LOG_E(NR_MAC, "%4d.%2d VRB MAP in %4d.%2d not free. Can't schedule CSI reporting on PUCCH.\n", frame, slot, frame, sched_slot);
+ memset(curr_pucch, 0, sizeof(*curr_pucch));
+ }
+ else
+ vrb_map_UL[i+bwp_start] |= mask;
}
}
}
@@ -1506,6 +1513,61 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
}
}
+bool test_acknack_vrb_occupation(NR_UE_sched_ctrl_t *sched_ctrl,
+ NR_sched_pucch_t *pucch,
+ uint16_t *vrb_map_UL,
+ const NR_ServingCellConfigCommon_t *scc,
+ NR_PUCCH_Config_t *pucch_Config,
+ int r_pucch,
+ int bwp_start,
+ int bwp_size) {
+
+ // We assume initial cyclic shift is always 0 so different pucch resources can't overlap
+
+ NR_sched_pucch_t *csi_pucch = &sched_ctrl->sched_pucch[1];
+ if (csi_pucch &&
+ csi_pucch->csi_bits > 0 &&
+ csi_pucch->frame == pucch->frame &&
+ csi_pucch->ul_slot == pucch->ul_slot &&
+ csi_pucch->simultaneous_harqcsi &&
+ (csi_pucch->csi_bits + csi_pucch->dai_c) < 11)
+ return true; // available resources for csi_pucch already verified
+
+ if(r_pucch<0){
+ const NR_PUCCH_Resource_t *resource = pucch_Config->resourceToAddModList->list.array[0];
+ DevAssert(resource->format.present == NR_PUCCH_Resource__format_PR_format0);
+ pucch->second_hop_prb = resource->secondHopPRB!= NULL ? *resource->secondHopPRB : 0;
+ pucch->nr_of_symb = resource->format.choice.format0->nrofSymbols;
+ pucch->start_symb = resource->format.choice.format0->startingSymbolIndex;
+ pucch->prb_start = resource->startingPRB;
+ }
+ else{
+ int rsetindex = *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon;
+ set_r_pucch_parms(rsetindex,
+ r_pucch,
+ bwp_size,
+ &pucch->prb_start,
+ &pucch->second_hop_prb,
+ &pucch->nr_of_symb,
+ &pucch->start_symb);
+ }
+
+ // verifying occupation of PRBs for ACK/NACK on dedicated pucch
+ for (int l=0; lnr_of_symb; l++) {
+ uint16_t symb = SL_to_bitmap(pucch->start_symb+l, 1);
+ int prb;
+ if (l==1 && pucch->second_hop_prb != 0)
+ prb = pucch->second_hop_prb;
+ else
+ prb = pucch->prb_start;
+ if ((vrb_map_UL[bwp_start+prb] & symb) != 0) {
+ return false;
+ break;
+ }
+ }
+ return true;
+}
+
// this function returns an index to NR_sched_pucch structure
// currently this structure contains PUCCH0 at index 0 and PUCCH2 at index 1
@@ -1545,6 +1607,24 @@ int nr_acknack_scheduling(int mod_id,
* later)
* * each UE has dedicated PUCCH Format 0 resources, and we use index 0! */
NR_UE_sched_ctrl_t *sched_ctrl = &RC.nrmac[mod_id]->UE_info.UE_sched_ctrl[UE_id];
+ NR_CellGroupConfig_t *cg = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id];
+
+ NR_PUCCH_Config_t *pucch_Config = NULL;
+ if (sched_ctrl->active_ubwp) {
+ pucch_Config = sched_ctrl->active_ubwp->bwp_Dedicated->pucch_Config->choice.setup;
+ } else if (cg &&
+ cg->spCellConfig &&
+ cg->spCellConfig->spCellConfigDedicated &&
+ cg->spCellConfig->spCellConfigDedicated->uplinkConfig &&
+ cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP) {
+ pucch_Config = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup;
+ }
+ NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ?
+ &sched_ctrl->active_ubwp->bwp_Common->genericParameters:
+ &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
+ int bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE);
+ int bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
+
NR_sched_pucch_t *pucch = &sched_ctrl->sched_pucch[0];
LOG_D(NR_MAC, "In %s: %d.%d Trying to allocate pucch, current DAI %d\n", __FUNCTION__, frame, slot, pucch->dai_c);
@@ -1590,7 +1670,6 @@ int nr_acknack_scheduling(int mod_id,
LOG_D(NR_MAC, "In %s: pucch_acknak 1. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n", __FUNCTION__, frame, slot, pucch->frame, pucch->ul_slot, pucch->dai_c);
// this is hardcoded for now as ue specific only if we are not on the initialBWP (to be fixed to allow ue_Specific also on initialBWP
- NR_CellGroupConfig_t *cg = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id];
NR_BWP_UplinkDedicated_t *ubwpd=NULL;
if (cg &&
@@ -1664,23 +1743,36 @@ int nr_acknack_scheduling(int mod_id,
// Find the right timing_indicator value.
int ind_found = -1;
// while we are within the feedback limits
+ uint16_t *vrb_map_UL;
while ((n_slots_frame + pucch->ul_slot - slot) % n_slots_frame <= max_fb_time) {
- int i = 0;
- while (i < 8) {
- LOG_D(NR_MAC, "In %s: pdsch_to_harq_feedback[%d] = %d (pucch->ul_slot %d - slot %d)\n", __FUNCTION__,
- i,pdsch_to_harq_feedback[i],pucch->ul_slot,slot);
- int diff = pucch->ul_slot - slot;
- if (diff<0)
- diff += n_slots_frame;
- if (pdsch_to_harq_feedback[i] == diff &&
- pdsch_to_harq_feedback[i] >= minfbtime) {
- ind_found = i;
- break;
+ // checking if in ul_slot the resources potentially to be assigned to this PUCCH are available
+ vrb_map_UL = &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[pucch->ul_slot * MAX_BWP_SIZE];
+ bool ret = test_acknack_vrb_occupation(sched_ctrl,
+ pucch,
+ vrb_map_UL,
+ scc,
+ pucch_Config,
+ r_pucch,
+ bwp_start,
+ bwp_size);
+ if (ret) {
+ int i = 0;
+ while (i < 8) {
+ LOG_D(NR_MAC,"pdsch_to_harq_feedback[%d] = %d (pucch->ul_slot %d - slot %d)\n",
+ i,pdsch_to_harq_feedback[i],pucch->ul_slot,slot);
+ int diff = pucch->ul_slot - slot;
+ if (diff<0)
+ diff += n_slots_frame;
+ if (pdsch_to_harq_feedback[i] == diff &&
+ pdsch_to_harq_feedback[i] >= minfbtime) {
+ ind_found = i;
+ break;
+ }
+ ++i;
}
- ++i;
+ if (ind_found!=-1)
+ break;
}
- if (ind_found!=-1)
- break;
// advance to the next ul slot
const int f = pucch->frame;
const int s = pucch->ul_slot;
@@ -1741,46 +1833,16 @@ int nr_acknack_scheduling(int mod_id,
pucch->dai_c++;
pucch->resource_indicator = 0; // each UE has dedicated PUCCH resources
pucch->r_pucch=r_pucch;
- NR_PUCCH_Config_t *pucch_Config = NULL;
- if (sched_ctrl->active_ubwp) {
- pucch_Config = sched_ctrl->active_ubwp->bwp_Dedicated->pucch_Config->choice.setup;
- } else if (RC.nrmac[mod_id]->UE_info.CellGroup[UE_id] &&
- RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig &&
- RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated &&
- RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig &&
- RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP &&
- RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup) {
- pucch_Config = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup;
- }
- NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ?
- &sched_ctrl->active_ubwp->bwp_Common->genericParameters:
- &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
- int bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE);
-
- /* verify that at that slot and symbol, resources are free. We only do this
- * for initialCyclicShift 0 (we assume it always has that one), so other
- * initialCyclicShifts can overlap with ICS 0!*/
-
- if (pucch_Config) {
- const NR_PUCCH_Resource_t *resource = pucch_Config->resourceToAddModList->list.array[pucch->resource_indicator];
- DevAssert(resource->format.present == NR_PUCCH_Resource__format_PR_format0);
- int second_hop_prb = resource->secondHopPRB!= NULL ? *resource->secondHopPRB : 0;
- int nr_of_symbols = resource->format.choice.format0->nrofSymbols;
- if (resource->format.choice.format0->initialCyclicShift == 0) {
- uint16_t *vrb_map_UL = &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[pucch->ul_slot * MAX_BWP_SIZE];
- for (int l=0; lformat.choice.format0->startingSymbolIndex + l);
- int prb;
- if (l==1 && second_hop_prb != 0)
- prb = second_hop_prb;
- else
- prb = resource->startingPRB;
- if ((vrb_map_UL[bwp_start+prb] & symb) != 0)
- LOG_W(MAC, "symbol 0x%x is not free for PUCCH alloc in vrb_map_UL at RB %ld and slot %d.%d\n", symb, resource->startingPRB, pucch->frame, pucch->ul_slot);
- vrb_map_UL[bwp_start+prb] |= symb;
- }
- }
+ vrb_map_UL = &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[pucch->ul_slot * MAX_BWP_SIZE];
+ for (int l=0; lnr_of_symb; l++) {
+ uint16_t symb = SL_to_bitmap(pucch->start_symb+l, 1);
+ int prb;
+ if (l==1 && pucch->second_hop_prb != 0)
+ prb = pucch->second_hop_prb;
+ else
+ prb = pucch->prb_start;
+ vrb_map_UL[bwp_start+prb] |= symb;
}
return 0;
}
@@ -1880,12 +1942,13 @@ void nr_sr_reporting(int Mod_idP, frame_t SFN, sub_frame_t slot)
}
curr_pucch->sr_flag = true;
} else {
- NR_sched_pucch_t sched_sr;
- memset(&sched_sr, 0, sizeof(sched_sr));
- sched_sr.frame = SFN;
- sched_sr.ul_slot = slot;
- sched_sr.resource_indicator = found;
- sched_sr.sr_flag = true;
+ NR_sched_pucch_t sched_sr = {
+ .frame = SFN,
+ .ul_slot = slot,
+ .sr_flag = true,
+ .resource_indicator = found,
+ .r_pucch = -1
+ };
nr_fill_nfapi_pucch(Mod_idP, SFN, slot, &sched_sr, UE_id);
}
}
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
index 34d4496eee..aa49b14fe5 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
@@ -977,13 +977,6 @@ bool allocate_ul_retransmission(module_id_t module_id,
LOG_D(NR_MAC,"retInfo->time_domain_allocation = %d, tda = %d\n", retInfo->time_domain_allocation, tda);
LOG_D(NR_MAC,"num_dmrs_cdm_grps_no_data %d, tbs %d\n",num_dmrs_cdm_grps_no_data, retInfo->tb_size);
if (tda == retInfo->time_domain_allocation) {
- /* Check the resource is enough for retransmission */
- while (rbStart < bwpSize && !rballoc_mask[rbStart])
- rbStart++;
- if (rbStart + retInfo->rbSize > bwpSize) {
- LOG_W(NR_MAC, "cannot allocate retransmission of UE %d/RNTI %04x: no resources (rbStart %d, retInfo->rbSize %d, bwpSize %d\n", UE_id, UE_info->rnti[UE_id], rbStart, retInfo->rbSize, bwpSize);
- return false;
- }
/* check whether we need to switch the TDA allocation since tha last
* (re-)transmission */
NR_pusch_semi_static_t *ps = &sched_ctrl->pusch_semi_static;
@@ -992,20 +985,34 @@ bool allocate_ul_retransmission(module_id_t module_id,
if (ps->time_domain_allocation != tda
|| ps->dci_format != dci_format
- || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
+ || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data
+ || sched_ctrl->update_pusch_ps) {
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps);
+ sched_ctrl->update_pusch_ps = false;
+ }
+
+ /* Check the resource is enough for retransmission */
+ while (rbStart < bwpSize &&
+ !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)))
+ rbStart++;
+ if (rbStart + retInfo->rbSize > bwpSize) {
+ LOG_W(NR_MAC, "cannot allocate retransmission of UE %d/RNTI %04x: no resources (rbStart %d, retInfo->rbSize %d, bwpSize %d\n", UE_id, UE_info->rnti[UE_id], rbStart, retInfo->rbSize, bwpSize);
+ return false;
+ }
LOG_D(NR_MAC, "%s(): retransmission keeping TDA %d and TBS %d\n", __func__, tda, retInfo->tb_size);
} else {
- /* the retransmission will use a different time domain allocation, check
- * that we have enough resources */
- while (rbStart < bwpSize && !rballoc_mask[rbStart])
- rbStart++;
- int rbSize = 0;
- while (rbStart + rbSize < bwpSize && rballoc_mask[rbStart + rbSize])
- rbSize++;
NR_pusch_semi_static_t temp_ps;
int dci_format = get_dci_format(sched_ctrl);
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp,ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, &temp_ps);
+ /* the retransmission will use a different time domain allocation, check
+ * that we have enough resources */
+ while (rbStart < bwpSize &&
+ !(rballoc_mask[rbStart]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols)))
+ rbStart++;
+ int rbSize = 0;
+ while (rbStart + rbSize < bwpSize &&
+ (rballoc_mask[rbStart + rbSize]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols)))
+ rbSize++;
uint32_t new_tbs;
uint16_t new_rbSize;
bool success = nr_find_nb_rb(retInfo->Qm,
@@ -1088,7 +1095,7 @@ bool allocate_ul_retransmission(module_id_t module_id,
/* Mark the corresponding RBs as used */
n_rb_sched -= sched_pusch->rbSize;
for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++)
- rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] = 0;
+ rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] ^= SL_to_bitmap(sched_ctrl->pusch_semi_static.startSymbolIndex, sched_ctrl->pusch_semi_static.nrOfSymbols);
return true;
}
@@ -1206,8 +1213,25 @@ void pf_ul(module_id_t module_id,
if (max_num_ue < 0)
return;
+ /* Save PUSCH field */
+ /* we want to avoid a lengthy deduction of DMRS and other parameters in
+ * every TTI if we can save it, so check whether dci_format, TDA, or
+ * num_dmrs_cdm_grps_no_data has changed and only then recompute */
+ const uint8_t num_dmrs_cdm_grps_no_data = (sched_ctrl->active_ubwp || ubwpd) ? 1 : 2;
+ int dci_format = get_dci_format(sched_ctrl);
+ const int tda = sched_ctrl->active_ubwp ? nrmac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0;
+ if (ps->time_domain_allocation != tda
+ || ps->dci_format != dci_format
+ || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data
+ || sched_ctrl->update_pusch_ps) {
+ nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps);
+ sched_ctrl->update_pusch_ps = false;
+ }
+
LOG_D(NR_MAC,"Looking for min_rb %d RBs, starting at %d\n", min_rb, rbStart);
- while (rbStart < bwpSize && !rballoc_mask[rbStart]) rbStart++;
+ while (rbStart < bwpSize &&
+ !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)))
+ rbStart++;
if (rbStart + min_rb >= bwpSize) {
LOG_W(NR_MAC, "cannot allocate continuous UL data for UE %d/RNTI %04x: no resources (rbStart %d, min_rb %d, bwpSize %d\n",
UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize);
@@ -1221,17 +1245,6 @@ void pf_ul(module_id_t module_id,
CCEIndex,
sched_ctrl->aggregation_level);
- /* Save PUSCH field */
- /* we want to avoid a lengthy deduction of DMRS and other parameters in
- * every TTI if we can save it, so check whether dci_format, TDA, or
- * num_dmrs_cdm_grps_no_data has changed and only then recompute */
- const uint8_t num_dmrs_cdm_grps_no_data = (sched_ctrl->active_ubwp || ubwpd) ? 1 : 2;
- int dci_format = get_dci_format(sched_ctrl);
- const int tda = sched_ctrl->active_ubwp ? nrmac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0;
- if (ps->time_domain_allocation != tda
- || ps->dci_format != dci_format
- || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
- nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps);
NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch;
sched_pusch->mcs = 9;
update_ul_ue_R_Qm(sched_pusch, ps);
@@ -1250,7 +1263,7 @@ void pf_ul(module_id_t module_id,
/* Mark the corresponding RBs as used */
n_rb_sched -= sched_pusch->rbSize;
for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++)
- rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] = 0;
+ rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] ^= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
continue;
}
@@ -1325,19 +1338,6 @@ void pf_ul(module_id_t module_id,
NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch;
NR_pusch_semi_static_t *ps = &sched_ctrl->pusch_semi_static;
- while (rbStart < bwpSize && !rballoc_mask[rbStart]) rbStart++;
- sched_pusch->rbStart = rbStart;
- uint16_t max_rbSize = 1;
- while (rbStart + max_rbSize < bwpSize && rballoc_mask[rbStart + max_rbSize])
- max_rbSize++;
-
- if (rbStart + min_rb >= bwpSize) {
- LOG_W(NR_MAC, "cannot allocate UL data for UE %d/RNTI %04x: no resources (rbStart %d, min_rb %d, bwpSize %d\n",
- UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize);
- return;
- }
- else LOG_D(NR_MAC,"allocating UL data for UE %d/RNTI %04x (rbStsart %d, min_rb %d, bwpSize %d\n",UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize);
-
/* Save PUSCH field */
/* we want to avoid a lengthy deduction of DMRS and other parameters in
* every TTI if we can save it, so check whether dci_format, TDA, or
@@ -1347,10 +1347,30 @@ void pf_ul(module_id_t module_id,
const int tda = sched_ctrl->active_ubwp ? nrmac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0;
if (ps->time_domain_allocation != tda
|| ps->dci_format != dci_format
- || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
+ || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data
+ || sched_ctrl->update_pusch_ps) {
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps);
+ sched_ctrl->update_pusch_ps = false;
+ }
update_ul_ue_R_Qm(sched_pusch, ps);
+ while (rbStart < bwpSize &&
+ !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)))
+ rbStart++;
+ sched_pusch->rbStart = rbStart;
+ uint16_t max_rbSize = 1;
+ while (rbStart + max_rbSize < bwpSize &&
+ (rballoc_mask[rbStart + max_rbSize]&&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)))
+ max_rbSize++;
+
+ if (rbStart + min_rb >= bwpSize) {
+ LOG_W(NR_MAC, "cannot allocate UL data for UE %d/RNTI %04x: no resources (rbStart %d, min_rb %d, bwpSize %d\n",
+ UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize);
+ return;
+ }
+ else LOG_D(NR_MAC,"allocating UL data for UE %d/RNTI %04x (rbStsart %d, min_rb %d, bwpSize %d\n",UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize);
+
+
/* Calculate the current scheduling bytes and the necessary RBs */
const int B = cmax(sched_ctrl->estimated_ul_buffer - sched_ctrl->sched_ul_bytes, 0);
uint16_t rbSize = 0;
@@ -1381,7 +1401,7 @@ void pf_ul(module_id_t module_id,
n_rb_sched -= sched_pusch->rbSize;
for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++)
- rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] = 0;
+ rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] ^= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
}
}
@@ -1464,11 +1484,9 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength;
int startSymbolIndex, nrOfSymbols;
SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols);
- const uint16_t symb = ((1 << nrOfSymbols) - 1) << startSymbolIndex;
+ const uint16_t symb = SL_to_bitmap(startSymbolIndex, nrOfSymbols);
int st = 0, e = 0, len = 0;
- for (int i = 0; i < bwpSize; i++)
- if (RC.nrmac[module_id]->ulprbbl[i] == 1) vrb_map_UL[i]=symb;
for (int i = 0; i < bwpSize; i++) {
while ((vrb_map_UL[bwpStart + i] & symb) != 0 && i < bwpSize)
@@ -1489,7 +1507,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
/* Calculate mask: if any RB in vrb_map_UL is blocked (1), the current RB will be 0 */
for (int i = 0; i < bwpSize; i++)
- rballoc_mask[i] = i >= st && i <= e;
+ rballoc_mask[i] = (i >= st && i <= e)*SL_to_bitmap(startSymbolIndex, nrOfSymbols);
/* proportional fair scheduling algorithm */
pf_ul(module_id,
diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h
index 28e9d689fa..8b734e3b95 100644
--- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h
@@ -291,6 +291,14 @@ void prepare_dci(const NR_CellGroupConfig_t *CellGroup,
nr_dci_format_t format,
int bwp_id);
+void set_r_pucch_parms(int rsetindex,
+ int r_pucch,
+ int bwp_size,
+ int *prb_start,
+ int *second_hop_prb,
+ int *nr_of_symbols,
+ int *start_symbol_index);
+
/* find coreset within the search space */
NR_ControlResourceSet_t *get_coreset(module_id_t module_idP,
NR_ServingCellConfigCommon_t *scc,
diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
index 22a0932c3f..eccffca031 100644
--- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
+++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
@@ -55,7 +55,7 @@
/* PHY */
#include "PHY/defs_gNB.h"
-#include "PHY/TOOLS/time_meas.h"
+#include "time_meas.h"
/* Interface */
#include "nfapi_nr_interface_scf.h"
@@ -171,6 +171,8 @@ typedef struct {
uint8_t msg3_round;
/// Flag to indicate if Msg3 carries a DCCH or DTCH message
bool msg3_dcch_dtch;
+ int msg3_startsymb;
+ int msg3_nrsymb;
/// TBS used for Msg4
int msg4_TBsize;
/// MCS used for Msg4
@@ -327,6 +329,10 @@ typedef struct NR_sched_pucch {
uint8_t timing_indicator;
uint8_t resource_indicator;
int r_pucch;
+ int prb_start;
+ int second_hop_prb;
+ int nr_of_symb;
+ int start_symb;
} NR_sched_pucch_t;
/* PUSCH semi-static configuration: as long as the TDA and DCI format remain
@@ -620,6 +626,8 @@ typedef struct {
int ul_failure;
struct CSI_Report CSI_report;
bool SR;
+ bool update_pdsch_ps;
+ bool update_pusch_ps;
bool set_mcs;
/// information about every HARQ process
NR_UE_harq_t harq_processes[NR_MAX_NB_HARQ_PROCESSES];
@@ -722,7 +730,7 @@ typedef struct gNB_MAC_INST_s {
/// current PDU index (BCH,DLSCH)
uint16_t pdu_index[NFAPI_CC_MAX];
int num_ulprbbl;
- int ulprbbl[275];
+ uint16_t ulprbbl[275];
/// NFAPI Config Request Structure
nfapi_nr_config_request_scf_t config[NFAPI_CC_MAX];
/// NFAPI DL Config Request Structure
diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
index 9bce0e8843..f7323010cb 100644
--- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
+++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
@@ -1175,7 +1175,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_
(dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.ssb_length,
(dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.ssb_start_subcarrier,
(dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.cell_id)) << FAPI_NR_RX_PDU_TYPE_SSB;
-
+ free((dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.pdu);
break;
case FAPI_NR_RX_PDU_TYPE_SIB:
ret_mask |= (handle_bcch_dlsch(dl_info->module_id,
diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c
index c3e41978e5..bd09540627 100644
--- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c
+++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c
@@ -4297,6 +4297,7 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer,
If we delete this asn1cCalloc statement, eNB will crash in NSA mode.
Please don't delete the following line unless the bug has been found. */
asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2);
+ (void) measresult_cgi2;
struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult;
asn1cCallocOne(measResult->rsrpResult, rsrp_tar);
asn1cCallocOne(measResult->rsrqResult, rsrq_tar);
diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c
index 7c8ecad91f..d04ed78270 100755
--- a/openair2/RRC/NR/MESSAGES/asn1_msg.c
+++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c
@@ -1451,6 +1451,30 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr
ASN_SEQUENCE_ADD(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig_drb);
}
+void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
+ rrc_gNB_carrier_data_t *carrier,
+ NR_UE_NR_Capability_t *uecap) {
+
+ NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig;
+ if (SpCellConfig == NULL) return;
+
+ NR_ServingCellConfigCommon_t *scc = carrier->servingcellconfigcommon;
+
+ NR_BWP_DownlinkDedicated_t *bwp_Dedicated = SpCellConfig->spCellConfigDedicated->initialDownlinkBWP;
+ set_dl_mcs_table(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing,
+ uecap, bwp_Dedicated, scc);
+
+ struct NR_ServingCellConfig__downlinkBWP_ToAddModList *DL_BWP_list = SpCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList;
+ if (DL_BWP_list) {
+ for (int i=0; ilist.count; i++){
+ NR_BWP_Downlink_t *bwp = DL_BWP_list->list.array[i];
+ int scs = bwp->bwp_Common->genericParameters.subcarrierSpacing;
+ set_dl_mcs_table(scs, uecap, bwp->bwp_Dedicated, carrier->servingcellconfigcommon);
+ }
+ }
+}
+
+
void fill_initial_cellGroupConfig(int uid,
NR_CellGroupConfig_t *cellGroupConfig,
NR_ServingCellConfigCommon_t *scc,
@@ -1870,6 +1894,8 @@ int16_t do_RRCReconfiguration(
NR_SDAP_Config_t *sdap_config,
NR_MeasConfig_t *meas_config,
struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList,
+ rrc_gNB_ue_context_t *const ue_context_pP,
+ rrc_gNB_carrier_data_t *carrier,
NR_MAC_CellGroupConfig_t *mac_CellGroupConfig,
NR_CellGroupConfig_t *cellGroupConfig)
//------------------------------------------------------------------------------
@@ -1906,15 +1932,6 @@ int16_t do_RRCReconfiguration(
ie->radioBearerConfig->srb3_ToRelease = NULL;
ie->radioBearerConfig->drb_ToReleaseList = DRB_releaseList;
}
- /******************** Secondary Cell Group ********************/
- // rrc_gNB_carrier_data_t *carrier = &(gnb_rrc_inst->carrier);
- // fill_default_secondaryCellGroup( carrier->servingcellconfigcommon,
- // ue_context_pP->ue_context.secondaryCellGroup,
- // 1,
- // 1,
- // carrier->pdsch_AntennaPorts,
- // carrier->initial_csi_index[ue_context_p->local_uid + 1],
- // ue_context_pP->local_uid);
/******************** Meas Config ********************/
// measConfig
@@ -1930,6 +1947,9 @@ int16_t do_RRCReconfiguration(
}
if(cellGroupConfig!=NULL){
+ update_cellGroupConfig(cellGroupConfig,
+ carrier,
+ ue_context_pP->ue_context.UE_Capability_nr);
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
NULL,
(void *)cellGroupConfig,
diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h
index cb971acd60..7fe08704c2 100644
--- a/openair2/RRC/NR/MESSAGES/asn1_msg.h
+++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h
@@ -110,6 +110,10 @@ void fill_initial_cellGroupConfig(int uid,
NR_ServingCellConfigCommon_t *scc,
rrc_gNB_carrier_data_t *carrier);
+void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
+ rrc_gNB_carrier_data_t *carrier,
+ NR_UE_NR_Capability_t *uecap);
+
void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup);
uint8_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
@@ -145,6 +149,8 @@ int16_t do_RRCReconfiguration(
NR_SDAP_Config_t *sdap_config,
NR_MeasConfig_t *meas_config,
struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList,
+ rrc_gNB_ue_context_t *const ue_context_pP,
+ rrc_gNB_carrier_data_t *carrier,
NR_MAC_CellGroupConfig_t *mac_CellGroupConfig,
NR_CellGroupConfig_t *cellGroupConfig);
diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c
index ba969ac1be..f8f05f2fe5 100644
--- a/openair2/RRC/NR/nr_rrc_config.c
+++ b/openair2/RRC/NR/nr_rrc_config.c
@@ -31,6 +31,50 @@
#include "nr_rrc_config.h"
#include "common/utils/nr/nr_common.h"
+void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
+ NR_ServingCellConfigCommon_t *scc,
+ int numerology,
+ int rbsize,
+ int mcs_table) {
+
+ int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
+ NR_BandNR_t *nr_bandnr = CALLOC(1,sizeof(NR_BandNR_t));
+ nr_bandnr->bandNR = band;
+ ASN_SEQUENCE_ADD(&cap->rf_Parameters.supportedBandListNR.list,
+ nr_bandnr);
+ if (mcs_table == 1) {
+ int bw = get_supported_band_index(numerology, band, rbsize);
+ if (band>256) {
+ NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[0];
+ bandNRinfo->pdsch_256QAM_FR2 = CALLOC(1,sizeof(*bandNRinfo->pdsch_256QAM_FR2));
+ *bandNRinfo->pdsch_256QAM_FR2 = NR_BandNR__pdsch_256QAM_FR2_supported;
+ }
+ else{
+ cap->phy_Parameters.phy_ParametersFR1 = CALLOC(1,sizeof(*cap->phy_Parameters.phy_ParametersFR1));
+ NR_Phy_ParametersFR1_t *phy_fr1 = cap->phy_Parameters.phy_ParametersFR1;
+ phy_fr1->pdsch_256QAM_FR1 = CALLOC(1,sizeof(*phy_fr1->pdsch_256QAM_FR1));
+ *phy_fr1->pdsch_256QAM_FR1 = NR_Phy_ParametersFR1__pdsch_256QAM_FR1_supported;
+ }
+ cap->featureSets = CALLOC(1,sizeof(*cap->featureSets));
+ NR_FeatureSets_t *fs=cap->featureSets;
+ fs->featureSetsDownlinkPerCC = CALLOC(1,sizeof(*fs->featureSetsDownlinkPerCC));
+ NR_FeatureSetDownlinkPerCC_t *fs_cc = CALLOC(1,sizeof(NR_FeatureSetDownlinkPerCC_t));
+ fs_cc->supportedSubcarrierSpacingDL = numerology;
+ if(band>256) {
+ fs_cc->supportedBandwidthDL.present = NR_SupportedBandwidth_PR_fr2;
+ fs_cc->supportedBandwidthDL.choice.fr2 = bw;
+ }
+ else{
+ fs_cc->supportedBandwidthDL.present = NR_SupportedBandwidth_PR_fr1;
+ fs_cc->supportedBandwidthDL.choice.fr1 = bw;
+ }
+ fs_cc->supportedModulationOrderDL = CALLOC(1,sizeof(*fs_cc->supportedModulationOrderDL));
+ *fs_cc->supportedModulationOrderDL = NR_ModulationOrder_qam256;
+ ASN_SEQUENCE_ADD(&fs->featureSetsDownlinkPerCC->list,
+ fs_cc);
+ }
+}
+
void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){
lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing);
@@ -105,6 +149,52 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){
ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation_msg3);
}
}
-
}
+
+void set_dl_mcs_table(int scs, NR_UE_NR_Capability_t *cap,
+ NR_BWP_DownlinkDedicated_t *bwp_Dedicated,
+ NR_ServingCellConfigCommon_t *scc) {
+
+ if (cap == NULL){
+ bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NULL;
+ return;
+ }
+
+ int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
+ struct NR_FrequencyInfoDL__scs_SpecificCarrierList scs_list = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList;
+ int bw_rb = -1;
+ for(int i=0; isubcarrierSpacing){
+ bw_rb = scs_list.list.array[i]->carrierBandwidth;
+ break;
+ }
+ }
+ AssertFatal(bw_rb>0,"Could not find scs-SpecificCarrierList element for scs %d",scs);
+ int bw = get_supported_band_index(scs, band, bw_rb);
+ AssertFatal(bw>0,"Supported band corresponding to %d RBs not found\n", bw_rb);
+
+ bool supported = false;
+ if (band>256) {
+ for (int i=0;irf_Parameters.supportedBandListNR.list.count;i++) {
+ NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i];
+ if(bandNRinfo->bandNR == band && bandNRinfo->pdsch_256QAM_FR2) {
+ supported = true;
+ break;
+ }
+ }
+ }
+ else if (cap->phy_Parameters.phy_ParametersFR1 && cap->phy_Parameters.phy_ParametersFR1->pdsch_256QAM_FR1)
+ supported = true;
+
+ if (supported) {
+ if(bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table == NULL)
+ bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = calloc(1, sizeof(*bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table));
+ *bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NR_PDSCH_Config__mcs_Table_qam256;
+ }
+ else
+ bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NULL;
+}
+
+
+
diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h
index 192fee754e..1a0d091e35 100644
--- a/openair2/RRC/NR/nr_rrc_config.h
+++ b/openair2/RRC/NR/nr_rrc_config.h
@@ -113,6 +113,14 @@ typedef struct physicalcellgroup_s{
void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc);
void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay);
+void set_dl_mcs_table(int scs, NR_UE_NR_Capability_t *cap,
+ NR_BWP_DownlinkDedicated_t *bwp_Dedicated,
+ NR_ServingCellConfigCommon_t *scc);
+void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
+ NR_ServingCellConfigCommon_t *scc,
+ int numerology,
+ int rbsize,
+ int mcs_table);
#endif
diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h
index 5008af6fa8..7dceb55a4b 100644
--- a/openair2/RRC/NR/nr_rrc_proto.h
+++ b/openair2/RRC/NR/nr_rrc_proto.h
@@ -76,6 +76,7 @@ void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti);
void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
NR_ServingCellConfig_t *servingcellconfigdedicated,
NR_CellGroupConfig_t *secondaryCellGroup,
+ NR_UE_NR_Capability_t *uecap,
int scg_id,
int servCellIndex,
int dl_antenna_ports,
@@ -94,6 +95,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
NR_ServingCellConfig_t *servingcellconfigdedicated,
NR_RRCReconfiguration_IEs_t *reconfig,
NR_CellGroupConfig_t *secondaryCellGroup,
+ NR_UE_NR_Capability_t *uecap,
int dl_antenna_ports,
int minRXTXTIMEpdsch,
int do_csirs,
diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c
index 0a30569b81..d6c658f01d 100755
--- a/openair2/RRC/NR/rrc_gNB.c
+++ b/openair2/RRC/NR/rrc_gNB.c
@@ -709,6 +709,8 @@ rrc_gNB_generate_defaultRRCReconfiguration(
dedicatedNAS_MessageList = NULL;
}
+ gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
+ gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
memset(buffer, 0, sizeof(buffer));
size = do_RRCReconfiguration(ctxt_pP, buffer, sizeof(buffer),
xid,
@@ -719,8 +721,10 @@ rrc_gNB_generate_defaultRRCReconfiguration(
NULL,
NULL,
dedicatedNAS_MessageList,
+ ue_context_pP,
+ &rrc->carrier,
NULL,
- NULL);
+ ue_p->masterCellGroup);
free(ue_context_pP->ue_context.nas_pdu.buffer);
@@ -980,6 +984,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
NULL,
NULL,
dedicatedNAS_MessageList,
+ ue_context_pP,
+ &rrc->carrier,
NULL,
cellGroupConfig);
LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size,"[MSG] RRC Reconfiguration\n");
@@ -1151,6 +1157,8 @@ rrc_gNB_modify_dedicatedRRCReconfiguration(
NULL,
dedicatedNAS_MessageList,
NULL,
+ NULL,
+ NULL,
NULL);
LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Reconfiguration\n");
@@ -1249,6 +1257,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release(
NULL,
dedicatedNAS_MessageList,
NULL,
+ NULL,
+ NULL,
NULL);
ue_context_pP->ue_context.pdu_session_release_command_flag = 1;
@@ -1798,6 +1808,8 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete(
NULL, // MeasObj_list,
NULL,
NULL,
+ NULL,
+ NULL,
NULL);
LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size,
"[MSG] RRC Reconfiguration\n");
@@ -3340,51 +3352,6 @@ unsigned int get_ul_bw_mask(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) {
return(0);
}
-int is_dl_256QAM_supported(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) {
- int common_band = *rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
- int common_scs = rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
- if (common_band>256) {
- for (int i=0;irf_Parameters.supportedBandListNR.list.count;i++) {
- NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i];
- if (bandNRinfo->bandNR == common_band && !bandNRinfo->pdsch_256QAM_FR2) return (0);
- }
- }
- else if (cap->phy_Parameters.phy_ParametersFR1 && !cap->phy_Parameters.phy_ParametersFR1->pdsch_256QAM_FR1) return(0);
-
- // check featureSet
- NR_FeatureSets_t *fs=cap->featureSets;
- if (fs) {
- // go through DL feature sets and look for one with current SCS
- for (int i=0;ifeatureSetsDownlinkPerCC->list.count;i++) {
- if (fs->featureSetsDownlinkPerCC->list.array[i]->supportedSubcarrierSpacingDL == common_scs &&
- fs->featureSetsDownlinkPerCC->list.array[i]->supportedModulationOrderDL &&
- *fs->featureSetsDownlinkPerCC->list.array[i]->supportedModulationOrderDL == NR_ModulationOrder_qam256) return(1);
- }
- }
- return(0);
-}
-
-int is_ul_256QAM_supported(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) {
- int common_band = *rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0];
- int common_scs = rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
- for (int i=0;irf_Parameters.supportedBandListNR.list.count;i++) {
- NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i];
- if (bandNRinfo->bandNR == common_band && !bandNRinfo->pusch_256QAM) return (0);
- }
-
- // check featureSet
- NR_FeatureSets_t *fs=cap->featureSets;
- if (fs) {
- // go through UL feature sets and look for one with current SCS
- for (int i=0;ifeatureSetsUplinkPerCC->list.count;i++) {
- if (fs->featureSetsUplinkPerCC->list.array[i]->supportedSubcarrierSpacingUL == common_scs &&
- fs->featureSetsUplinkPerCC->list.array[i]->supportedModulationOrderUL &&
- *fs->featureSetsUplinkPerCC->list.array[i]->supportedModulationOrderUL == NR_ModulationOrder_qam256) return(1);
- }
- }
- return(0);
-}
-
int get_ul_mimo_layersCB(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) {
int common_scs = rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
@@ -3454,11 +3421,9 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
}
if (ue_context_p->ue_context.UE_Capability_nr) {
- fprintf(fd,"NR RRC UE cap: BW DL %x. BW UL %x, 256 QAM DL %s, 256 QAM UL %s, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d\n",
+ fprintf(fd,"NR RRC UE cap: BW DL %x. BW UL %x, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d\n",
get_dl_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr),
get_ul_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr),
- is_dl_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no",
- is_ul_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no",
get_dl_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr),
get_ul_mimo_layersCB(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr),
get_ul_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr));
diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c
index 4286ea0d62..4492380d7f 100644
--- a/openair2/RRC/NR/rrc_gNB_NGAP.c
+++ b/openair2/RRC/NR/rrc_gNB_NGAP.c
@@ -905,30 +905,27 @@ rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(
for (pdusession = 0; pdusession < ue_context_pP->ue_context.setup_pdu_sessions; pdusession++) {
// if (xid == ue_context_pP->ue_context.pdusession[pdusession].xid) {
if (ue_context_pP->ue_context.pduSession[pdusession].status == PDU_SESSION_STATUS_DONE) {
- NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].pdusession_id = ue_context_pP->ue_context.pduSession[pdusession].param.pdusession_id;
- // NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].pdusession_id = 1;
- NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].nb_of_qos_flow = ue_context_pP->ue_context.pduSession[pdusession].param.nb_qos;
- NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].gtp_teid = ue_context_pP->ue_context.gnb_gtp_teid[pdusession];
- NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].gNB_addr.pdu_session_type = PDUSessionType_ipv4;
- NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].gNB_addr.length = ue_context_pP->ue_context.gnb_gtp_addrs[pdusession].length;
- memcpy(NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].gNB_addr.buffer,
- ue_context_pP->ue_context.gnb_gtp_addrs[pdusession].buffer, sizeof(uint8_t)*20);
- for (qos_flow_index = 0; qos_flow_index < NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].nb_of_qos_flow; qos_flow_index++) {
- NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].associated_qos_flows[qos_flow_index].qfi =
+ pdusession_setup_t * tmp=&NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession];
+ tmp->pdusession_id = ue_context_pP->ue_context.pduSession[pdusession].param.pdusession_id;
+ // tmp->pdusession_id = 1;
+ tmp->nb_of_qos_flow = ue_context_pP->ue_context.pduSession[pdusession].param.nb_qos;
+ tmp->gtp_teid = ue_context_pP->ue_context.gnb_gtp_teid[pdusession];
+ tmp->gNB_addr.pdu_session_type = PDUSessionType_ipv4;
+ tmp->gNB_addr.length = ue_context_pP->ue_context.gnb_gtp_addrs[pdusession].length;
+ memcpy(tmp->gNB_addr.buffer,
+ ue_context_pP->ue_context.gnb_gtp_addrs[pdusession].buffer, tmp->gNB_addr.length);
+ for (qos_flow_index = 0; qos_flow_index < tmp->nb_of_qos_flow; qos_flow_index++) {
+ tmp->associated_qos_flows[qos_flow_index].qfi =
ue_context_pP->ue_context.pduSession[pdusession].param.qos[qos_flow_index].qfi;
- NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].associated_qos_flows[qos_flow_index].qos_flow_mapping_ind = QOSFLOW_MAPPING_INDICATION_DL;
+ tmp->associated_qos_flows[qos_flow_index].qos_flow_mapping_ind = QOSFLOW_MAPPING_INDICATION_DL;
}
ue_context_pP->ue_context.pduSession[pdusession].status = PDU_SESSION_STATUS_ESTABLISHED;
- LOG_I (NR_RRC,"gnb_gtp_addr (msg index %d, pdu_sessions index %d, status %d, xid %d): nb_of_pdusessions %d, pdusession_id %d, teid: %u, addr: %d.%d.%d.%d \n ",
+ LOG_I (NR_RRC,"gnb_gtp_addr (msg index %d, pdu_sessions index %d, status %d, xid %d): nb_of_pdusessions %d, pdusession_id %d, teid: %u \n ",
pdu_sessions_done, pdusession, ue_context_pP->ue_context.pduSession[pdusession].status, xid,
ue_context_pP->ue_context.nb_of_pdusessions,
NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].pdusession_id,
- NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].gtp_teid,
- NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].gNB_addr.buffer[0],
- NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].gNB_addr.buffer[1],
- NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].gNB_addr.buffer[2],
- NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].gNB_addr.buffer[3]);
+ NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].gtp_teid);
pdu_sessions_done++;
} else if ((ue_context_pP->ue_context.pduSession[pdusession].status == PDU_SESSION_STATUS_NEW) ||
(ue_context_pP->ue_context.pduSession[pdusession].status == PDU_SESSION_STATUS_ESTABLISHED)) {
diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c
index e55c9d4ed2..70dfebaaf7 100644
--- a/openair2/RRC/NR/rrc_gNB_nsa.c
+++ b/openair2/RRC/NR/rrc_gNB_nsa.c
@@ -245,6 +245,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
ue_context_p->ue_context.spCellConfig->spCellConfigDedicated,
reconfig_ies,
ue_context_p->ue_context.secondaryCellGroup,
+ ue_context_p->ue_context.UE_Capability_nr,
carrier->pdsch_AntennaPorts,
carrier->minRXTXTIME,
carrier->do_CSIRS,
@@ -255,6 +256,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
NULL,
reconfig_ies,
ue_context_p->ue_context.secondaryCellGroup,
+ ue_context_p->ue_context.UE_Capability_nr,
carrier->pdsch_AntennaPorts,
carrier->minRXTXTIME,
carrier->do_CSIRS,
diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c
index 6130cd256d..1de34804df 100644
--- a/openair2/RRC/NR/rrc_gNB_reconfig.c
+++ b/openair2/RRC/NR/rrc_gNB_reconfig.c
@@ -45,6 +45,7 @@
#include "SIMULATION/TOOLS/sim.h"
#include "executables/softmodem-common.h"
#include "LAYER2/nr_rlc/nr_rlc_oai_api.h"
+#include "nr_rrc_config.h"
#define false 0
#define true 1
@@ -52,6 +53,7 @@
void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
NR_ServingCellConfig_t *servingcellconfigdedicated,
NR_CellGroupConfig_t *secondaryCellGroup,
+ NR_UE_NR_Capability_t *uecap,
int scg_id,
int servCellIndex,
int dl_antenna_ports,
@@ -63,6 +65,9 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n");
AssertFatal(secondaryCellGroup!=NULL,"secondaryCellGroup is null\n");
+ if(uecap == NULL)
+ LOG_E(RRC,"No UE Capabilities available when programming default CellGroup in NSA\n");
+
// This assert will never happen in the current implementation because NUMBER_OF_UE_MAX = 4.
// However, if in the future NUMBER_OF_UE_MAX is increased, it will be necessary to improve the allocation of SRS resources,
// where the startPosition = 2 or 3 and sl160 = 17, 17, 27 ... 157 only give us 30 different allocations.
@@ -336,12 +341,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->rateMatchPatternGroup1=NULL;
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->rateMatchPatternGroup2=NULL;
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->rbg_Size=NR_PDSCH_Config__rbg_Size_config1;
- if (!get_softmodem_params()->use_256qam_table) {
- secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->mcs_Table=NULL;
- } else {
- secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->mcs_Table = calloc(1, sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->mcs_Table));
- *secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->mcs_Table = NR_PDSCH_Config__mcs_Table_qam256;
- }
+ secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->mcs_Table=NULL;
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI));
*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = NR_PDSCH_Config__maxNrofCodeWordsScheduledByDCI_n1;
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling;
@@ -605,43 +605,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup1=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup2=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->rbg_Size=NR_PDSCH_Config__rbg_Size_config1;
- if (!get_softmodem_params()->use_256qam_table) {
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table=NULL;
- } else {
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = calloc(1, sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table));
- *bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NR_PDSCH_Config__mcs_Table_qam256;
- }
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI));
- *bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = NR_PDSCH_Config__maxNrofCodeWordsScheduledByDCI_n1;
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling;
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling));
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize =
- calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize));
- *bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize = NR_PDSCH_Config__prb_BundlingType__staticBundling__bundleSize_wideband;
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->zp_CSI_RS_ResourceToAddModList=NULL;
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->zp_CSI_RS_ResourceToReleaseList=NULL;
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->aperiodic_ZP_CSI_RS_ResourceSetsToAddModList=NULL;
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->aperiodic_ZP_CSI_RS_ResourceSetsToReleaseList=NULL;
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->sp_ZP_CSI_RS_ResourceSetsToAddModList=NULL;
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->sp_ZP_CSI_RS_ResourceSetsToReleaseList=NULL;
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->p_ZP_CSI_RS_ResourceSet=NULL;
-
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToReleaseList=NULL;
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->vrb_ToPRB_Interleaver=NULL;
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->resourceAllocation=NR_PDSCH_Config__resourceAllocation_resourceAllocationType1;
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList=NULL;
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_AggregationFactor=NULL;
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternToAddModList=NULL;
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternToReleaseList=NULL;
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup1=NULL;
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup2=NULL;
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->rbg_Size=NR_PDSCH_Config__rbg_Size_config1;
- if (!get_softmodem_params()->use_256qam_table) {
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table=NULL;
- } else {
- bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = calloc(1, sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table));
- *bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NR_PDSCH_Config__mcs_Table_qam256;
- }
+ set_dl_mcs_table(bwp->bwp_Common->genericParameters.subcarrierSpacing, uecap, bwp->bwp_Dedicated, servingcellconfigcommon);
bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI));
*bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = NR_PDSCH_Config__maxNrofCodeWordsScheduledByDCI_n1;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling;
@@ -744,8 +708,8 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
pusch_Config->pusch_TimeDomainAllocationList = NULL;
pusch_Config->pusch_AggregationFactor=NULL;
pusch_Config->mcs_Table=NULL;
- pusch_Config->mcs_TableTransformPrecoder=NULL;
pusch_Config->transformPrecoder= NULL;
+ pusch_Config->mcs_TableTransformPrecoder=NULL;
/* if msg3_transformprecoding is set in conf file - pusch config should not disable it */
if (servingcellconfigcommon->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL) {
pusch_Config->transformPrecoder=calloc(1,sizeof(*pusch_Config->transformPrecoder));
@@ -1378,6 +1342,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
NR_ServingCellConfig_t *servingcellconfigdedicated,
NR_RRCReconfiguration_IEs_t *reconfig,
NR_CellGroupConfig_t *secondaryCellGroup,
+ NR_UE_NR_Capability_t *uecap,
int dl_antenna_ports,
int minRXTXTIME,
int do_csirs,
@@ -1392,6 +1357,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
fill_default_secondaryCellGroup(servingcellconfigcommon,
servingcellconfigdedicated,
secondaryCellGroup,
+ uecap,
1,
1,
dl_antenna_ports,
diff --git a/openair2/UTIL/FIFO/pad_list.c b/openair2/UTIL/FIFO/pad_list.c
deleted file mode 100644
index 124893a756..0000000000
--- a/openair2/UTIL/FIFO/pad_list.c
+++ /dev/null
@@ -1,607 +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
- */
-
-/*! \file pad_list.c
-* \brief list management primimtives
-* \author Mohamed Said MOSLI BOUKSIAA, Lionel GAUTHIER, Navid Nikaein
-* \date 2012 - 2014
-* \version 0.5
-* @ingroup util
-*/
-//#define LIST_C
-//#define NULL 0
-
-#include
-#include
-#include "pad_list.h"
-//#include
-
-
-void job_list_init (Job_List_t *listP) {
- listP->tail = NULL;
- listP->head = NULL;
- listP->nb_elements = 0;
-}
-
-void event_list_init (Event_List_t *listP) {
- listP->tail = NULL;
- listP->head = NULL;
- listP->nb_elements = 0;
-}
-
-void pkt_list_init (Packet_OTG_List_t *listP) {
- listP->tail = NULL;
- listP->head = NULL;
- listP->nb_elements = 0;
-}
-
-//-----------------------------------------------------------------------------
-
-void job_list_free (Job_List_t *listP) {
- Job_elt_t *le;
-
- while ((le = job_list_remove_head (listP))) {
- free(le);
- }
-}
-
-void event_list_free (Event_List_t *listP) {
- Event_elt_t *le;
-
- while ((le = event_list_remove_head (listP))) {
- free(le);
- }
-}
-
-void pkt_list_free (Packet_OTG_List_t *listP) {
- Packet_otg_elt_t *le;
-
- while ((le = pkt_list_remove_head (listP))) {
- free(le);
- }
-}
-
-//-----------------------------------------------------------------------------
-
-Job_elt_t *job_list_get_head (Job_List_t *listP) {
- return listP->head;
-}
-
-Event_elt_t *event_list_get_head (Event_List_t *listP) {
- return listP->head;
-}
-
-Packet_otg_elt_t *pkt_list_get_head (Packet_OTG_List_t *listP) {
- return listP->head;
-}
-
-//-----------------------------------------------------------------------------
-
-/*
- * remove an element from head of a list
- * @param pointer on targeted list
- * @return pointer on removed Job_elt_t
- */
-Job_elt_t *job_list_remove_head (Job_List_t *listP) {
- // access optimisation
- Job_elt_t *head;
- head = listP->head;
-
- // almost one element
- if (head != NULL) {
- listP->head = head->next;
- listP->nb_elements = listP->nb_elements - 1;
-
- // if only one element, update tail
- if (listP->head == NULL) {
- listP->tail = NULL;
- } else {
- head->next = NULL;
- }
- } else {
- //msg("[MEM_MGT][WARNING] remove_head_from_list(%s) no elements\n",listP->name);
- }
-
- return head;
-}
-
-Event_elt_t *event_list_remove_head (Event_List_t *listP) {
- // access optimisation
- Event_elt_t *head;
- head = listP->head;
-
- // almost one element
- if (head != NULL) {
- listP->head = head->next;
- listP->nb_elements = listP->nb_elements - 1;
-
- // if only one element, update tail
- if (listP->head == NULL) {
- listP->tail = NULL;
- } else {
- head->next = NULL;
- }
- } else {
- //msg("[MEM_MGT][WARNING] remove_head_from_list(%s) no elements\n",listP->name);
- }
-
- return head;
-}
-
-Packet_otg_elt_t *pkt_list_remove_head (Packet_OTG_List_t *listP) {
- // access optimisation
- Packet_otg_elt_t *head;
- head = listP->head;
-
- // almost one element
- if (head != NULL) {
- listP->head = head->next;
- listP->nb_elements = listP->nb_elements - 1;
-
- // if only one element, update tail
- if (listP->head == NULL) {
- listP->tail = NULL;
- } else {
- head->next = NULL;
- }
- } else {
- //msg("[MEM_MGT][WARNING] remove_head_from_list(%s) no elements\n",listP->name);
- }
-
- return head;
-}
-
-//-----------------------------------------------------------------------------
-
-Job_elt_t *job_list_remove_element (Job_elt_t *elementP, Job_List_t *listP) {
- // access optimisation;
- Job_elt_t *head;
-
- if (elementP != NULL) {
- // test head
- head = listP->head;
-
- if (listP->head == elementP) {
- // almost one element
- if (head != NULL) {
- listP->head = head->next;
- listP->nb_elements = listP->nb_elements - 1;
-
- // if only one element, update tail
- if (listP->head == NULL) {
- listP->tail = NULL;
- } else {
- head->next = NULL;
- }
- }
- } else {
- while (head) {
- if (head->next == elementP) {
- head->next = elementP->next;
- listP->nb_elements = listP->nb_elements - 1;
-
- if (listP->tail == elementP) {
- listP->tail = head;
- }
-
- return elementP;
- } else {
- head = head->next;
- }
- }
- }
- }
-
- return elementP;
-}
-
-Event_elt_t *event_list_remove_element (Event_elt_t *elementP, Event_List_t *listP) {
- // access optimisation;
- Event_elt_t *head;
-
- if (elementP != NULL) {
- // test head
- head = listP->head;
-
- if (listP->head == elementP) {
- // almost one element
- if (head != NULL) {
- listP->head = head->next;
- listP->nb_elements = listP->nb_elements - 1;
-
- // if only one element, update tail
- if (listP->head == NULL) {
- listP->tail = NULL;
- } else {
- head->next = NULL;
- }
- }
- } else {
- while (head) {
- if (head->next == elementP) {
- head->next = elementP->next;
- listP->nb_elements = listP->nb_elements - 1;
-
- if (listP->tail == elementP) {
- listP->tail = head;
- }
-
- return elementP;
- } else {
- head = head->next;
- }
- }
- }
- }
-
- return elementP;
-}
-
-Packet_otg_elt_t *pkt_list_remove_element (Packet_otg_elt_t *elementP, Packet_OTG_List_t *listP) {
- // access optimisation;
- Packet_otg_elt_t *head;
-
- if (elementP != NULL) {
- // test head
- head = listP->head;
-
- if (listP->head == elementP) {
- // almost one element
- if (head != NULL) {
- listP->head = head->next;
- listP->nb_elements = listP->nb_elements - 1;
-
- // if only one element, update tail
- if (listP->head == NULL) {
- listP->tail = NULL;
- } else {
- head->next = NULL;
- }
- }
- } else {
- while (head) {
- if (head->next == elementP) {
- head->next = elementP->next;
- listP->nb_elements = listP->nb_elements - 1;
-
- if (listP->tail == elementP) {
- listP->tail = head;
- }
-
- return elementP;
- } else {
- head = head->next;
- }
- }
- }
- }
-
- return elementP;
-}
-
-//-----------------------------------------------------------------------------
-/*
- * add an element to the beginning of a list
- * @param pointer on targeted list
- * @return pointer on removed Job_elt_t
- */
-
-void job_list_add_head (Job_elt_t *elementP, Job_List_t *listP) {
- // access optimisation;
- Job_elt_t *head;
-
- if (elementP != NULL) {
- head = listP->head;
- listP->nb_elements = listP->nb_elements + 1;
-
- // almost one element
- if (head == NULL) {
- listP->head = elementP;
- listP->tail = elementP;
- } else {
- elementP->next = head;
- listP->head = elementP;
- }
- }
-}
-
-void event_list_add_head (Event_elt_t *elementP, Event_List_t *listP) {
- // access optimisation;
- Event_elt_t *head;
-
- if (elementP != NULL) {
- head = listP->head;
- listP->nb_elements = listP->nb_elements + 1;
-
- // almost one element
- if (head == NULL) {
- listP->head = elementP;
- listP->tail = elementP;
- } else {
- elementP->next = head;
- listP->head = elementP;
- }
- }
-}
-
-void pkt_list_add_head (Packet_otg_elt_t *elementP, Packet_OTG_List_t *listP) {
- // access optimisation;
- Packet_otg_elt_t *head;
-
- if (elementP != NULL) {
- head = listP->head;
- listP->nb_elements = listP->nb_elements + 1;
-
- // almost one element
- if (head == NULL) {
- listP->head = elementP;
- listP->tail = elementP;
- } else {
- elementP->next = head;
- listP->head = elementP;
- }
- }
-}
-
-void event_list_add_element (Event_elt_t *elementP, Event_elt_t *previous, Event_List_t *listP) {
- // access optimisation;
- Event_elt_t *next;
-
- if (elementP != NULL && previous != NULL) {
- elementP->next = NULL;
- next = previous->next;
- listP->nb_elements = listP->nb_elements + 1;
-
- // almost one element
- if (next == NULL) {
- previous->next = elementP;
- listP->tail = elementP;
- } else {
- elementP->next = previous->next;
- previous->next = elementP;
- }
- }
-}
-
-
-//-----------------------------------------------------------------------------
-/*
- * add an element to the end of a list
- * @param pointer on targeted list
- * @return pointer on removed Job_elt_t
- */
-void job_list_add_tail_eurecom (Job_elt_t *elementP, Job_List_t *listP) {
- Job_elt_t *tail;
-
- if (elementP != NULL) {
- // access optimisation
- listP->nb_elements = listP->nb_elements + 1;
- elementP->next = NULL;
- tail = listP->tail;
-
- // almost one element
- if (tail == NULL) {
- listP->head = elementP;
- } else {
- tail->next = elementP;
- }
-
- listP->tail = elementP;
- } else {
- //msg("[CNT_LIST][ERROR] add_cnt_tail() element NULL\n");
- }
-}
-
-void event_list_add_tail_eurecom (Event_elt_t *elementP, Event_List_t *listP) {
- Event_elt_t *tail;
-
- if (elementP != NULL) {
- // access optimisation
- listP->nb_elements = listP->nb_elements + 1;
- elementP->next = NULL;
- tail = listP->tail;
-
- // almost one element
- if (tail == NULL) {
- listP->head = elementP;
- } else {
- tail->next = elementP;
- }
-
- listP->tail = elementP;
- } else {
- //msg("[CNT_LIST][ERROR] add_cnt_tail() element NULL\n");
- }
-}
-
-void pkt_list_add_tail_eurecom (Packet_otg_elt_t *elementP, Packet_OTG_List_t *listP) {
- Packet_otg_elt_t *tail;
-
- if (elementP != NULL) {
- // access optimisation
- listP->nb_elements = listP->nb_elements + 1;
- elementP->next = NULL;
- tail = listP->tail;
-
- // almost one element
- if (tail == NULL) {
- listP->head = elementP;
- } else {
- tail->next = elementP;
- }
-
- listP->tail = elementP;
- } else {
- //msg("[CNT_LIST][ERROR] add_cnt_tail() element NULL\n");
- }
-}
-
-//-----------------------------------------------------------------------------
-void job_list_add_list (Job_List_t *sublistP, Job_List_t *listP) {
- if (sublistP) {
- if (sublistP->head) {
- // access optimisation
- Job_elt_t *tail;
- tail = listP->tail;
-
- // almost one element
- if (tail == NULL) {
- listP->head = sublistP->head;
- } else {
- tail->next = sublistP->head;
- }
-
- listP->tail = sublistP->tail;
- // clear sublist
- sublistP->head = NULL;
- sublistP->tail = NULL;
- listP->nb_elements = listP->nb_elements + sublistP->nb_elements;
- sublistP->nb_elements = 0;
- }
- }
-}
-
-void event_list_add_list (Event_List_t *sublistP, Event_List_t *listP) {
- if (sublistP) {
- if (sublistP->head) {
- // access optimisation
- Event_elt_t *tail;
- tail = listP->tail;
-
- // almost one element
- if (tail == NULL) {
- listP->head = sublistP->head;
- } else {
- tail->next = sublistP->head;
- }
-
- listP->tail = sublistP->tail;
- // clear sublist
- sublistP->head = NULL;
- sublistP->tail = NULL;
- listP->nb_elements = listP->nb_elements + sublistP->nb_elements;
- sublistP->nb_elements = 0;
- }
- }
-}
-
-void pkt_list_add_list (Packet_OTG_List_t *sublistP, Packet_OTG_List_t *listP) {
- if (sublistP) {
- if (sublistP->head) {
- // access optimisation
- Packet_otg_elt_t *tail;
- tail = listP->tail;
-
- // almost one element
- if (tail == NULL) {
- listP->head = sublistP->head;
- } else {
- tail->next = sublistP->head;
- }
-
- listP->tail = sublistP->tail;
- // clear sublist
- sublistP->head = NULL;
- sublistP->tail = NULL;
- listP->nb_elements = listP->nb_elements + sublistP->nb_elements;
- sublistP->nb_elements = 0;
- }
- }
-}
-
-//-----------------------------------------------------------------------------
-void job_list_display (Job_List_t *listP) {
- //Correct the output once the content of struct Job is fixed
- /*Job_elt_t *cursor;
- unsigned short nb_elements = 0;
-
- if (listP) {
- cursor = listP->head;
- if (cursor) {
- while (cursor != NULL) {
- if (cursor->job.type == eNB_DL)
- printf ("DL eNB From (%d,%d)\n", (cursor->job).nid, (cursor->job).mid);
- else if (cursor->job.type == UE_DL)
- printf ("DL UE From (%d,%d)\n", (cursor->job).nid, (cursor->job).mid);
- else if (cursor->job.type == UE_UL)
- printf ("UL UE From (%d,%d)\n", (cursor->job).nid, (cursor->job).mid);
- else if (cursor->job.type == eNB_UL)
- printf ("UL eNB From (%d,%d)\n", (cursor->job).nid, (cursor->job).mid);
- //msg ("From (%d,%d) To (%d,%d)\n", (cursor->job).node1, (cursor->job).master1, (cursor->job).node2, (cursor->job).master2);
- cursor = cursor->next;
- nb_elements++;
- }
- printf ("Found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements);
- //msg ("Found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements);
- }
- } else {
- printf ("[SDU_MNGT][WARNING] display_cnt_dbl_lk_list_up() : list is NULL\n");
- //msg ("[SDU_MNGT][WARNING] display_cnt_dbl_lk_list_up() : list is NULL\n");
- }*/
-}
-
-void event_list_display (Event_List_t *listP) {
- Event_elt_t *cursor;
- unsigned short nb_elements = 0;
-
- if (listP) {
- cursor = listP->head;
-
- if (cursor) {
- while (cursor != NULL) {
- printf ("Ev (%d,%d)\n", (cursor->event).type, (cursor->event).frame);
- //msg ("From (%d,%d) To (%d,%d)\n", (cursor->job).node1, (cursor->job).master1, (cursor->job).node2, (cursor->job).master2);
- cursor = cursor->next;
- nb_elements++;
- }
-
- printf ("Found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements);
- //msg ("Found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements);
- }
- } else {
- printf ("[SDU_MNGT][WARNING] display_cnt_dbl_lk_list_up() : list is NULL\n");
- //msg ("[SDU_MNGT][WARNING] display_cnt_dbl_lk_list_up() : list is NULL\n");
- }
-}
-
-void pkt_list_display (Packet_OTG_List_t *listP) {
- Packet_otg_elt_t *cursor;
- unsigned short nb_elements = 0;
-
- if (listP) {
- cursor = listP->head;
-
- if (cursor) {
- while (cursor != NULL) {
- printf ("Pkt (DST %d, RB %ld)\n", (cursor->otg_pkt).dst_id, (cursor->otg_pkt).rb_id);
- //msg ("From (%d,%d) To (%d,%d)\n", (cursor->job).node1, (cursor->job).master1, (cursor->job).node2, (cursor->job).master2);
- cursor = cursor->next;
- nb_elements++;
- }
-
- printf ("Found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements);
- //msg ("Found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements);
- }
- } else {
- printf ("[SDU_MNGT][WARNING] display_cnt_dbl_lk_list_up() : list is NULL\n");
- //msg ("[SDU_MNGT][WARNING] display_cnt_dbl_lk_list_up() : list is NULL\n");
- }
-}
diff --git a/openair2/UTIL/FIFO/pad_list.h b/openair2/UTIL/FIFO/pad_list.h
deleted file mode 100644
index 2a9ef9893f..0000000000
--- a/openair2/UTIL/FIFO/pad_list.h
+++ /dev/null
@@ -1,87 +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
- */
-
-/*! \file pad_list.c
-* \brief list management primimtives
-* \author Mohamed Said MOSLI BOUKSIAA, Lionel GAUTHIER, Navid Nikaein
-* \date 2012 - 2014
-* \version 0.5
-* @ingroup util
-*/
-
-#ifndef __list_H__
-#define __list_H__
-
-#include "types.h"
-//-----------------------------------------------------------------------------
-
-typedef struct Job_List_s {
- Job_elt_t *head;
- Job_elt_t *tail;
- int nb_elements;
-} Job_List_t;
-
-typedef struct Event_List_s {
- Event_elt_t *head;
- Event_elt_t *tail;
- int nb_elements;
-} Event_List_t;
-
-typedef struct Packet_OTG_List_s {
- Packet_otg_elt_t *head;
- Packet_otg_elt_t *tail;
- int nb_elements;
-} Packet_OTG_List_t;
-
-//-----------------------------------------------------------------------------
-void job_list_init (Job_List_t*);
-void job_list_free (Job_List_t* listP);
-Job_elt_t* job_list_get_head (Job_List_t*);
-Job_elt_t* job_list_remove_head (Job_List_t* );
-Job_elt_t* job_list_remove_element (Job_elt_t*, Job_List_t*);
-void job_list_add_head (Job_elt_t* , Job_List_t* );
-void job_list_add_tail_eurecom (Job_elt_t* , Job_List_t* );
-void job_list_add_list (Job_List_t* , Job_List_t* );
-void job_list_display (Job_List_t* );
-
-void event_list_init (Event_List_t*);
-void event_list_free (Event_List_t* listP);
-Event_elt_t* event_list_get_head (Event_List_t*);
-Event_elt_t* event_list_remove_head (Event_List_t* );
-Event_elt_t* event_list_remove_element (Event_elt_t*, Event_List_t*);
-void event_list_add_head (Event_elt_t* , Event_List_t* );
-void event_list_add_element (Event_elt_t* , Event_elt_t* , Event_List_t* );
-void event_list_add_tail_eurecom (Event_elt_t* , Event_List_t* );
-void event_list_add_list (Event_List_t* , Event_List_t* );
-void event_list_display (Event_List_t* );
-
-void pkt_list_init (Packet_OTG_List_t*);
-void pkt_list_free (Packet_OTG_List_t* listP);
-Packet_otg_elt_t* pkt_list_get_head (Packet_OTG_List_t*);
-Packet_otg_elt_t* pkt_list_remove_head (Packet_OTG_List_t* );
-Packet_otg_elt_t* pkt_list_remove_element (Packet_otg_elt_t*, Packet_OTG_List_t*);
-void pkt_list_add_head (Packet_otg_elt_t* , Packet_OTG_List_t* );
-void pkt_list_add_element (Packet_otg_elt_t* , Packet_otg_elt_t* , Packet_OTG_List_t* );
-void pkt_list_add_tail_eurecom (Packet_otg_elt_t* , Packet_OTG_List_t* );
-void pkt_list_add_list (Packet_OTG_List_t* , Packet_OTG_List_t* );
-void pkt_list_display (Packet_OTG_List_t* );
-
-#endif
diff --git a/openair2/UTIL/FIFO/types.h b/openair2/UTIL/FIFO/types.h
deleted file mode 100644
index f949b2b72b..0000000000
--- a/openair2/UTIL/FIFO/types.h
+++ /dev/null
@@ -1,127 +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
- */
-
-/*! \file pad_list.c
-* \brief list management primimtives
-* \author Mohamed Said MOSLI BOUKSIAA, Lionel GAUTHIER, Navid Nikaein
-* \date 2012 - 2014
-* \version 0.5
-* @ingroup util
-*/
-
-#ifndef __FIFO_TYPES_H__
-#define __FIFO_TYPES_H__
-#include "platform_types.h"
-
-/* Types regrouping both user-defined and regular events */
-typedef enum {
- MIN_ET=0,
- OAI_ET=MIN_ET, // config events
- SYS_ET,
- TOPO_ET,
- APP_ET,
- EMU_ET,
- DL_ET, // frame events
- UL_ET,
- S_ET,
- PHY_ET, // protocol events
- MAC_ET,
- RLC_ET,
- PDCP_ET,
- RRC_ET,
- MAX_ET
-} Event_Type_t;
-
-/* decomposition of node functions into jobs for a given event */
-typedef enum Job_type_e { JT_OTG, JT_PDCP, JT_PHY_MAC, JT_INIT_SYNC, JT_DL, JT_UL, RN_DL, RN_UL, JT_END} Job_Type_t;
-
-typedef enum Operation_Type_e { READ, WRITE, RESET} Operation_Type_t;
-
-typedef struct Job_s {
- enum Job_type_e type;
- int exe_time; /* execution time at the worker*/
- int nid; /* node id*/
- eNB_flag_t eNB_flag;
- frame_t frame;
- int last_slot;
- int next_slot;
- int ctime;
-} Job_t;
-
-typedef struct Signal_buffers_s { // (s = transmit, r,r0 = receive)
- double **s_re;
- double **s_im;
- double **r_re;
- double **r_im;
- double **r_re0;
- double **r_im0;
-} Signal_buffers_t;
-
-/*!\brief sybframe type : DL, UL, SF, */
-
-typedef struct Packet_otg_s {
- unsigned int sdu_buffer_size;
- unsigned char *sdu_buffer;
- module_id_t module_id;
- rb_id_t rb_id;
- module_id_t dst_id;
- boolean_t is_ue;
- pdcp_transmission_mode_t mode;
-} Packet_otg_t;
-
-typedef struct {
- Event_Type_t type;
- enum Operation_Type_e optype; //op
- char *key;
- void *value;
- frame_t frame;
- int ue;
- int lcid;
-} Event_t;
-
-/*typedef struct Global_Time {
- uint32_t frame;
- int32_t slot;
- int32_t last_slot;
- int32_t next_slot;
- double time_s;
- double time_ms;
-};*/
-
-
-
-typedef struct Packet_otg_elt_s {
- struct Packet_otg_elt_s *next;
- struct Packet_otg_elt_s *previous;
- Packet_otg_t otg_pkt;
-} Packet_otg_elt_t;
-
-typedef struct Job_element_s {
- struct Job_element_s *next;
- Job_t job;
-} Job_elt_t;
-
-typedef struct Event_element_s {
- struct Event_element_s *next;
- struct Event_element_s *previous;
- Event_t event;
-} Event_elt_t;
-#endif
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/building.txt b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/building.txt
deleted file mode 100644
index 56b4be609f..0000000000
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/building.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-building liblfds
-================
-
-Windows (user-mode)
-===================
-1. Use Microsoft Visual Studio 2008 or Visual C++ 2008 Express Edition (or
- later versions) to load "liblfds.sln". The "Win32" platform is x86,
- the "x64" platform is x64.
-
-2. Use Microsoft Windows SDK and GNUmake to run makefile.windows (obviously
- you'll need to have run setenv.bat or the appropriate vcvars*.bat first;
- you can build for x64/64-bit and x86/32-bit - just run the correct batch
- file).
-
- Targets are "librel", "libdbg", "dllrel", "dlldbg" and "clean". You need
- to clean between switching targets.
-
-Windows (kernel)
-================
-Use the Windows Driver Kit "build" command. Prior to running "build",
-if you wish to build a static library, run the batch file
-"runme_before_win_kernel_static_lib_build.bat"; if you wish to
-build a dynamic library, instead run "runme_before_win_kernel_dynamic_lib_build.bat".
-
-The Windows kernel build system is rather limited and rather than
-really rather messing up the directory/file structure just for the
-Windows kernel platform, I've instead arranged it that these batch
-files do the necessary work so that "build" will work.
-
-The batch files are idempotent; you can run them as often as you
-like, in any order, at any time (before or after builds), and they'll
-do the right thing. You need to clean between switching targets.
-
-Linux
-=====
-Use GNUmake to run "makefile.linux". Targets are "arrel", "ardbg",
-"sorel", "sodbg" and "clean". You need to clean between switching
-targets.
-
-
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/dirs b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/dirs
deleted file mode 100644
index 0be5295378..0000000000
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/dirs
+++ /dev/null
@@ -1,2 +0,0 @@
-DIRS = src
-
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/inc/liblfds611.h b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/inc/liblfds611.h
deleted file mode 100644
index f2c05ee5e3..0000000000
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/inc/liblfds611.h
+++ /dev/null
@@ -1,334 +0,0 @@
-#ifndef __LIBLFDS611_H
-
-/***** library header *****/
-#define LFDS611_RELEASE_NUMBER_STRING "6.1.1"
-
-
-
-
-/***** lfds611_abstraction *****/
-
-/***** defines *****/
-#if (defined _WIN64 && defined _MSC_VER && !defined WIN_KERNEL_BUILD)
-// TRD : 64-bit Windows user-mode with the Microsoft C compiler, any CPU
-#include
-#include
-#include
-#include
-#include
-typedef unsigned __int64 lfds611_atom_t;
-#define LFDS611_INLINE __forceinline
-#define LFDS611_ALIGN(alignment) __declspec( align(alignment) )
-#define LFDS611_ALIGN_SINGLE_POINTER 8
-#define LFDS611_ALIGN_DOUBLE_POINTER 16
-#define LFDS611_BARRIER_COMPILER_LOAD _ReadBarrier()
-#define LFDS611_BARRIER_COMPILER_STORE _WriteBarrier()
-#define LFDS611_BARRIER_COMPILER_FULL _ReadWriteBarrier()
-#define LFDS611_BARRIER_PROCESSOR_LOAD _mm_lfence()
-#define LFDS611_BARRIER_PROCESSOR_STORE _mm_sfence()
-#define LFDS611_BARRIER_PROCESSOR_FULL _mm_mfence()
-#endif
-
-#if (!defined _WIN64 && defined _WIN32 && defined _MSC_VER && !defined WIN_KERNEL_BUILD)
-// TRD : 32-bit Windows user-mode with the Microsoft C compiler, any CPU
-#include
-#include
-#include
-#include
-#include
-typedef unsigned long int lfds611_atom_t;
-#define LFDS611_INLINE __forceinline
-#define LFDS611_ALIGN(alignment) __declspec( align(alignment) )
-#define LFDS611_ALIGN_SINGLE_POINTER 4
-#define LFDS611_ALIGN_DOUBLE_POINTER 8
-#define LFDS611_BARRIER_COMPILER_LOAD _ReadBarrier()
-#define LFDS611_BARRIER_COMPILER_STORE _WriteBarrier()
-#define LFDS611_BARRIER_COMPILER_FULL _ReadWriteBarrier()
-#define LFDS611_BARRIER_PROCESSOR_LOAD _mm_lfence()
-#define LFDS611_BARRIER_PROCESSOR_STORE _mm_sfence()
-#define LFDS611_BARRIER_PROCESSOR_FULL _mm_mfence()
-
-// TRD : this define is documented but missing in Microsoft Platform SDK v7.0
-#define _InterlockedCompareExchangePointer(destination, exchange, compare) _InterlockedCompareExchange((volatile long *) destination, (long) exchange, (long) compare)
-#endif
-
-#if (defined _WIN64 && defined _MSC_VER && defined WIN_KERNEL_BUILD)
-// TRD : 64-bit Windows kernel with the Microsoft C compiler, any CPU
-#include
-#include
-#include
-#include
-typedef unsigned __int64 lfds611_atom_t;
-#define LFDS611_INLINE __forceinline
-#define LFDS611_ALIGN(alignment) __declspec( align(alignment) )
-#define LFDS611_ALIGN_SINGLE_POINTER 8
-#define LFDS611_ALIGN_DOUBLE_POINTER 16
-#define LFDS611_BARRIER_COMPILER_LOAD _ReadBarrier()
-#define LFDS611_BARRIER_COMPILER_STORE _WriteBarrier()
-#define LFDS611_BARRIER_COMPILER_FULL _ReadWriteBarrier()
-#define LFDS611_BARRIER_PROCESSOR_LOAD _mm_lfence()
-#define LFDS611_BARRIER_PROCESSOR_STORE _mm_sfence()
-#define LFDS611_BARRIER_PROCESSOR_FULL _mm_mfence()
-#endif
-
-#if (!defined _WIN64 && defined _WIN32 && defined _MSC_VER && defined WIN_KERNEL_BUILD)
-// TRD : 32-bit Windows kernel with the Microsoft C compiler, any CPU
-#include
-#include
-#include
-#include
-typedef unsigned long int lfds611_atom_t;
-#define LFDS611_INLINE __forceinline
-#define LFDS611_ALIGN(alignment) __declspec( align(alignment) )
-#define LFDS611_ALIGN_SINGLE_POINTER 4
-#define LFDS611_ALIGN_DOUBLE_POINTER 8
-#define LFDS611_BARRIER_COMPILER_LOAD _ReadBarrier()
-#define LFDS611_BARRIER_COMPILER_STORE _WriteBarrier()
-#define LFDS611_BARRIER_COMPILER_FULL _ReadWriteBarrier()
-#define LFDS611_BARRIER_PROCESSOR_LOAD _mm_lfence()
-#define LFDS611_BARRIER_PROCESSOR_STORE _mm_sfence()
-#define LFDS611_BARRIER_PROCESSOR_FULL _mm_mfence()
-
-// TRD : this define is documented but missing in Microsoft Platform SDK v7.0
-#define _InterlockedCompareExchangePointer(destination, exchange, compare) _InterlockedCompareExchange((volatile long *) destination, (long) exchange, (long) compare)
-#endif
-
-#if (defined __unix__ && defined __x86_64__ && __GNUC__)
-// TRD : any UNIX with GCC on x64
-#include
-#include
-#include
-typedef unsigned long long int lfds611_atom_t;
-#define LFDS611_INLINE inline
-#define LFDS611_ALIGN(alignment) __attribute__( (aligned(alignment)) )
-#define LFDS611_ALIGN_SINGLE_POINTER 8
-#define LFDS611_ALIGN_DOUBLE_POINTER 16
-#define LFDS611_BARRIER_COMPILER_LOAD __asm__ __volatile__ ( "" : : : "memory" )
-#define LFDS611_BARRIER_COMPILER_STORE __asm__ __volatile__ ( "" : : : "memory" )
-#define LFDS611_BARRIER_COMPILER_FULL __asm__ __volatile__ ( "" : : : "memory" )
-#define LFDS611_BARRIER_PROCESSOR_LOAD __sync_synchronize()
-#define LFDS611_BARRIER_PROCESSOR_STORE __sync_synchronize()
-#define LFDS611_BARRIER_PROCESSOR_FULL __sync_synchronize()
-#endif
-
-#if (defined __unix__ && defined __i386__ && __GNUC__)
-// TRD : any UNIX with GCC on x86
-#include
-#include
-#include