[0-9\-]+) *bytes', mySSH.getBefore())
+ if result is not None:
+ imageSize = float(result.group('size'))
+ imageSize = imageSize / 1000
+ if imageSize < 1000:
+ logging.debug('\u001B[1m oai-physim size is ' + ('%.0f' % imageSize) + ' kbytes\u001B[0m')
+ else:
+ imageSize = imageSize / 1000
+ if imageSize < 1000:
+ logging.debug('\u001B[1m oai-physim size is ' + ('%.0f' % imageSize) + ' Mbytes\u001B[0m')
+ else:
+ imageSize = imageSize / 1000
+ logging.debug('\u001B[1m oai-physim is ' + ('%.3f' % imageSize) + ' Gbytes\u001B[0m')
+ else:
+ logging.debug('oai-physim size is unknown')
+
+ # logging to OC Cluster and then switch to corresponding project
+ mySSH.command(f'oc login -u {ocUserName} -p {ocPassword}', '\$', 6)
+ if mySSH.getBefore().count('Login successful.') == 0:
+ logging.error('\u001B[1m OC Cluster Login Failed\u001B[0m')
+ mySSH.close()
+ HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_LOGIN_FAIL)
+ RAN.prematureExit = True
+ return
+ else:
+ logging.debug('\u001B[1m Login to OC Cluster Successfully\u001B[0m')
+ mySSH.command(f'oc project {ocProjectName}', '\$', 6)
+ if mySSH.getBefore().count(f'Already on project "{ocProjectName}"') == 0 and mySSH.getBefore().count(f'Now using project "{self.OCProjectName}"') == 0:
+ logging.error(f'\u001B[1m Unable to access OC project {ocProjectName}\u001B[0m')
+ mySSH.close()
+ HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_PROJECT_FAIL)
+ RAN.prematureExit = True
+ return
+ else:
+ logging.debug(f'\u001B[1m Now using project {ocProjectName}\u001B[0m')
+
+ # Tag the image and push to the OC cluster
+ mySSH.command('oc whoami -t | sudo podman login -u ' + ocUserName + ' --password-stdin https://default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/ --tls-verify=false', '\$', 6)
+ if mySSH.getBefore().count('Login Succeeded!') == 0:
+ logging.error('\u001B[1m Podman Login to OC Cluster Registry Failed\u001B[0m')
+ mySSH.close()
+ HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_LOGIN_FAIL)
+ RAN.prematureExit = True
+ return
+ else:
+ logging.debug('\u001B[1m Podman Login to OC Cluster Registry Successfully\u001B[0m')
+ time.sleep(2)
+ mySSH.command('oc create -f openshift/oai-physim-image-stream.yml', '\$', 6)
+ if mySSH.getBefore().count('(AlreadyExists):') == 0 and mySSH.getBefore().count('created') == 0:
+ logging.error(f'\u001B[1m Image Stream "oai-physim" Creation Failed on OC Cluster {ocProjectName}\u001B[0m')
+ mySSH.close()
+ HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_IS_FAIL)
+ RAN.prematureExit = True
+ return
+ else:
+ logging.debug(f'\u001B[1m Image Stream "oai-physim" created on OC project {ocProjectName}\u001B[0m')
+ time.sleep(2)
+ mySSH.command(f'sudo podman tag oai-physim:{imageTag} default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/{self.OCProjectName}/oai-physim:{imageTag}', '\$', 6)
+ time.sleep(2)
+ mySSH.command(f'sudo podman push default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/{self.OCProjectName}/oai-physim:{imageTag} --tls-verify=false', '\$', 30)
+ if mySSH.getBefore().count('Storing signatures') == 0:
+ logging.error('\u001B[1m Image "oai-physim" push to OC Cluster Registry Failed\u001B[0m')
+ mySSH.close()
+ HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_IS_FAIL)
+ RAN.prematureExit = True
+ return
+ else:
+ logging.debug('\u001B[1m Image "oai-physim" push to OC Cluster Registry Successfully\u001B[0m')
+
+ # Using helm charts deployment
+ time.sleep(5)
+ mySSH.command(f'sed -i -e "s#TAG#{imageTag}#g" ./charts/physims/values.yaml', '\$', 6)
+ mySSH.command('helm install physim ./charts/physims/ | tee -a cmake_targets/log/physim_helm_summary.txt 2>&1', '\$', 6)
+ if mySSH.getBefore().count('STATUS: deployed') == 0:
+ logging.error('\u001B[1m Deploying PhySim Failed using helm chart on OC Cluster\u001B[0m')
+ mySSH.command('helm uninstall physim >> cmake_targets/log/physim_helm_summary.txt 2>&1', '\$', 6)
+ isFinished1 = False
+ while(isFinished1 == False):
+ time.sleep(20)
+ mySSH.command('oc get pods -l app.kubernetes.io/instance=physim', '\$', 6, resync=True)
+ if re.search('No resources found', mySSH.getBefore()):
+ isFinished1 = True
+ mySSH.command(f'sudo podman rmi default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/{self.OCProjectName}/oai-physim:{imageTag}', '\$', 6)
+ mySSH.command('oc delete is oai-physim', '\$', 6)
+ mySSH.close()
+ self.AnalyzeLogFile_phySim(HTML)
+ RAN.prematureExit = True
+ return
+ else:
+ logging.debug('\u001B[1m Deployed PhySim Successfully using helm chart\u001B[0m')
+ isRunning = False
+ count = 0
+ while(count < 2 and isRunning == False):
+ time.sleep(60)
+ mySSH.command('oc get pods -o wide -l app.kubernetes.io/instance=physim | tee -a cmake_targets/log/physim_pods_summary.txt', '\$', 6, resync=True)
+ if mySSH.getBefore().count('Running') == 12:
+ logging.debug('\u001B[1m Running the physim test Scenarios\u001B[0m')
+ isRunning = True
+ podNames = re.findall('oai-[\S\d\w]+', mySSH.getBefore())
+ count +=1
+ if isRunning == False:
+ logging.error('\u001B[1m Some PODS Running FAILED \u001B[0m')
+ mySSH.command('oc get pods -l app.kubernetes.io/instance=physim 2>&1 | tee -a cmake_targets/log/physim_pods_summary.txt', '\$', 6)
+ mySSH.command('helm uninstall physim >> cmake_targets/log/physim_helm_summary.txt 2>&1', '\$', 6)
+ self.AnalyzeLogFile_phySim(HTML)
+ isFinished1 = False
+ while(isFinished1 == False):
+ time.sleep(20)
+ mySSH.command('oc get pods -l app.kubernetes.io/instance=physim', '\$', 6, resync=True)
+ if re.search('No resources found', mySSH.getBefore()):
+ isFinished1 = True
+ mySSH.command(f'sudo podman rmi default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/{self.OCProjectName}/oai-physim:{imageTag}', '\$', 6)
+ mySSH.command('oc delete is oai-physim', '\$', 6)
+ HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_PHYSIM_DEPLOY_FAIL)
+ HTML.CreateHtmlTestRowPhySimTestResult(self.testSummary,self.testResult)
+ RAN.prematureExit = True
+ return
+ # Waiting to complete the running test
+ count = 0
+ isFinished = False
+ # doing a deep copy!
+ tmpPodNames = podNames.copy()
+ while(count < 28 and isFinished == False):
+ time.sleep(60)
+ for podName in tmpPodNames:
+ mySSH.command2(f'oc logs --tail=1 {podName} 2>&1', 6, silent=True)
+ if mySSH.cmd2Results.count('FINISHED') != 0:
+ logging.debug(podName + ' is finished')
+ tmpPodNames.remove(podName)
+ if not tmpPodNames:
+ isFinished = True
+ count += 1
+ if isFinished:
+ logging.debug('\u001B[1m PhySim test is Complete\u001B[0m')
+
+ # Getting the logs of each executables running in individual pods
+ for podName in podNames:
+ mySSH.command(f'oc logs {podName} >> cmake_targets/log/physim_test.txt 2>&1', '\$', 15, resync=True)
+ time.sleep(30)
+
+ # UnDeploy the physical simulator pods
+ mySSH.command('helm uninstall physim | tee -a cmake_targets/log/physim_helm_summary.txt 2>&1', '\$', 6)
+ isFinished1 = False
+ while(isFinished1 == False):
+ time.sleep(20)
+ mySSH.command('oc get pods -l app.kubernetes.io/instance=physim', '\$', 6, resync=True)
+ if re.search('No resources found', mySSH.getBefore()):
+ isFinished1 = True
+ if isFinished1 == True:
+ logging.debug('\u001B[1m UnDeployed PhySim Successfully on OC Cluster\u001B[0m')
+ mySSH.command(f'sudo podman rmi default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/{self.OCProjectName}/oai-physim:{imageTag}', '\$', 6)
+ mySSH.command('oc delete is oai-physim', '\$', 6)
+ logging.debug('\u001B[1m Deleted the Image and ImageStream\u001B[0m')
+ mySSH.command('oc logout', '\$', 6)
+ mySSH.close()
+ self.AnalyzeLogFile_phySim(HTML)
+ if self.testStatus:
+ HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
+ HTML.CreateHtmlTestRowPhySimTestResult(self.testSummary,self.testResult)
+ logging.info('\u001B[1m Physical Simulator Pass\u001B[0m')
+ else:
+ RAN.prematureExit = True
+ HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ALL_PROCESSES_OK)
+ HTML.CreateHtmlTestRowPhySimTestResult(self.testSummary,self.testResult)
+ logging.info('\u001B[1m Physical Simulator Fail\u001B[0m')
+
+ def AnalyzeLogFile_phySim(self, HTML):
+ lIpAddr = self.eNBIPAddress
+ lUserName = self.eNBUserName
+ lPassWord = self.eNBPassword
+ lSourcePath = self.eNBSourceCodePath
+ mySSH = SSH.SSHConnection()
+ mySSH.open(lIpAddr, lUserName, lPassWord)
+ mySSH.command('cd ' + lSourcePath, '\$', 5)
+ mySSH.command('cd ' + lSourcePath + '/cmake_targets', '\$', 5)
+ mySSH.command('mkdir -p physim_test_log_' + self.testCase_id, '\$', 5)
+ mySSH.command('cp log/physim_* ' + 'physim_test_log_' + self.testCase_id, '\$', 5)
+ if not os.path.exists(f'./physim_test_logs_{self.testCase_id}'):
+ os.mkdir(f'./physim_test_logs_{self.testCase_id}')
+ mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/physim_test_log_' + self.testCase_id + '/*', './physim_test_logs_' + self.testCase_id)
+ mySSH.command('rm -rf ./physim_test_log_'+ self.testCase_id, '\$', 5)
+ mySSH.close()
+ # physim test log analysis
+ nextt = 0
+ if (os.path.isfile(f'./physim_test_logs_{self.testCase_id}/physim_test.txt')):
+ with open(f'./physim_test_logs_{self.testCase_id}/physim_test.txt', 'r') as logfile:
+ for line in logfile:
+ if re.search('execution 015', str(line)) or re.search('Bypassing compilation', str(line)):
+ nextt = 1
+ elif nextt == 1:
+ if not re.search('Test Results', str(line)):
+ nextt = 0
+ ret2 = re.search('T[^\n]*', str(line))
+ if ret2 is not None:
+ ret3 = ret2.group()
+ ret3 = ret3.replace("[00m", "")
+ if re.search('execution 015', str(line)):
+ self.testCount[0] += 1
+ testName = line.split()
+ ret1 = re.search('Result = PASS', str(line))
+ if ret1 is not None:
+ self.testResult[testName[1]] = [ret3, 'PASS']
+ self.testCount[1] += 1
+ else:
+ self.testResult[testName[1]] = [ret3, 'FAIL']
+ self.testCount[2] += 1
+ self.testSummary['Nbtests'] = self.testCount[0]
+ self.testSummary['Nbpass'] = self.testCount[1]
+ self.testSummary['Nbfail'] = self.testCount[2]
+ if self.testSummary['Nbfail'] == 0:
+ self.testStatus = True
+ return 0
diff --git a/ci-scripts/cls_static_code_analysis.py b/ci-scripts/cls_static_code_analysis.py
index 980efb4f8a..1680f3e560 100644
--- a/ci-scripts/cls_static_code_analysis.py
+++ b/ci-scripts/cls_static_code_analysis.py
@@ -101,7 +101,7 @@ class StaticCodeAnalysis():
# on RedHat/CentOS .git extension is mandatory
result = re.search('([a-zA-Z0-9\:\-\.\/])+\.git', self.ranRepository)
if result is not None:
- full_ran_repo_name = self.ranRepository
+ full_ran_repo_name = self.ranRepository.replace('git/', 'git')
else:
full_ran_repo_name = self.ranRepository + '.git'
mySSH.command('mkdir -p ' + lSourcePath, '\$', 5)
@@ -115,7 +115,7 @@ class StaticCodeAnalysis():
mySSH.command('mkdir -p cmake_targets/log', '\$', 5)
# if the commit ID is provided use it to point to it
if self.ranCommitID != '':
- mySSH.command('git checkout -f ' + self.ranCommitID, '\$', 5)
+ mySSH.command('git checkout -f ' + self.ranCommitID, '\$', 30)
mySSH.command('docker image rm oai-cppcheck:bionic oai-cppcheck:xenial || true', '\$', 60)
mySSH.command('docker build --tag oai-cppcheck:xenial --file ci-scripts/docker/Dockerfile.cppcheck.xenial . > cmake_targets/log/cppcheck-xenial.txt 2>&1', '\$', 600)
diff --git a/ci-scripts/conf_files/benetel-5g.conf b/ci-scripts/conf_files/benetel-5g.conf
index c9f0a579e1..9adead3a68 100644
--- a/ci-scripts/conf_files/benetel-5g.conf
+++ b/ci-scripts/conf_files/benetel-5g.conf
@@ -92,9 +92,9 @@ gNBs =
prach_msg1_FDM = 0;
prach_msg1_FrequencyStart = 74;
zeroCorrelationZoneConfig = 13;
- preambleReceivedTargetPower = -118;
+ #preambleReceivedTargetPower = -118;
#preambleReceivedTargetPower = -104;
- #preambleReceivedTargetPower = -108;
+ preambleReceivedTargetPower = -108;
#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
preambleTransMax = 6;
#powerRampingStep
@@ -124,13 +124,13 @@ 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
+ initialULBWPk2_0 = 2; # used for UL slot
initialULBWPmappingType_0 = 1
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
- initialULBWPk2_1 = 6; # used for mixed slot
+ initialULBWPk2_1 = 2; # used for mixed slot
initialULBWPmappingType_1 = 1;
- initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2
+ initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2
initialULBWPk2_2 = 7; # used for Msg.3 during RA
initialULBWPmappingType_2 = 1;
diff --git a/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf
index 33aae14dac..fff3cd1b9a 100644
--- a/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf
@@ -244,7 +244,7 @@ MACRLCs = (
THREAD_STRUCT = (
{
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
- worker_config = "ENABLE";
+ worker_config = "WORKER_ENABLE";
}
);
@@ -260,11 +260,11 @@ RUs = (
local_rf = "yes"
nb_tx = 1
nb_rx = 1
- att_tx = 0
+ att_tx = 3
att_rx = 0;
bands = [7];
max_pdschReferenceSignalPower = -27;
- max_rxgain = 118;
+ max_rxgain = 115;
eNB_instances = [0];
# clock_src = "external";
}
diff --git a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf
index 0da833b3f7..e7dd563e45 100644
--- a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf
+++ b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf
@@ -58,27 +58,14 @@ gNBs =
initialDLBWPsearchSpaceZero = 0;
#pdsch-ConfigCommon
#pdschTimeDomainAllocationList (up to 16 entries)
- initialDLBWPk0_0 = 0;
- #initialULBWPmappingType
- #0=typeA,1=typeB
- initialDLBWPmappingType_0 = 0;
- #this is SS=2,L=3
- initialDLBWPstartSymbolAndLength_0 = 40;
+ 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;
- initialDLBWPmappingType_1 = 0;
- #this is SS=2,L=12
- initialDLBWPstartSymbolAndLength_1 = 53;
+ initialDLBWPk0_3 = 0; #for mixed slot
+ initialDLBWPmappingType_3 = 0;
+ initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5
- initialDLBWPk0_2 = 0;
- initialDLBWPmappingType_2 = 0;
- #this is SS=1,L=12
- initialDLBWPstartSymbolAndLength_2 = 54;
-
- initialDLBWPk0_3 = 0;
- initialDLBWPmappingType_3 = 0;
- #this is SS=1,L=4 //5 (4 is for 43, 5 is for 57)
- initialDLBWPstartSymbolAndLength_3 = 57; //43; //57;
#uplinkConfigCommon
#frequencyInfoUL
ul_frequencyBand = 261;
@@ -136,7 +123,7 @@ gNBs =
initialULBWPk2_0 = 6;
initialULBWPmappingType_0 = 1
# this is SS=0 L=11
- initialULBWPstartSymbolAndLength_0 = 55;
+ initialULBWPstartSymbolAndLength_0 = 41;
initialULBWPk2_1 = 6;
initialULBWPmappingType_1 = 1;
@@ -243,6 +230,7 @@ MACRLCs = (
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "local_RRC";
+ ulsch_max_slots_inactivity = 1;
}
);
diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf
index b8a601ce41..1209a6f227 100644
--- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf
+++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf
@@ -56,27 +56,14 @@ gNBs =
initialDLBWPsearchSpaceZero = 0;
#pdsch-ConfigCommon
#pdschTimeDomainAllocationList (up to 16 entries)
- initialDLBWPk0_0 = 0;
- #initialULBWPmappingType
- #0=typeA,1=typeB
- initialDLBWPmappingType_0 = 0;
- #this is SS=1,L=13
- initialDLBWPstartSymbolAndLength_0 = 40;
+ 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;
- initialDLBWPmappingType_1 = 0;
- #this is SS=2,L=12
- initialDLBWPstartSymbolAndLength_1 = 53;
+ initialDLBWPk0_3 = 0; #for mixed slot
+ initialDLBWPmappingType_3 = 0;
+ initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5
- initialDLBWPk0_2 = 0;
- initialDLBWPmappingType_2 = 0;
- #this is SS=1,L=12
- initialDLBWPstartSymbolAndLength_2 = 54;
-
- initialDLBWPk0_3 = 0;
- initialDLBWPmappingType_3 = 0;
- #this is SS=1,L=4
- initialDLBWPstartSymbolAndLength_3 = 57;
#uplinkConfigCommon
#frequencyInfoUL
ul_frequencyBand = 66;
@@ -132,20 +119,18 @@ gNBs =
# 0=unrestricted, 1=restricted type A, 2=restricted type B
restrictedSetConfig = 0,
# pusch-ConfigCommon (up to 16 elements)
- initialULBWPk2_0 = 6;
+ initialULBWPk2_0 = 6; # used for UL slot
initialULBWPmappingType_0 = 1
- # this is SS=0 L=11
- initialULBWPstartSymbolAndLength_0 = 55;
+ initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13
- initialULBWPk2_1 = 6;
+ initialULBWPk2_1 = 6; # used for mixed slot
initialULBWPmappingType_1 = 1;
- # this is SS=0 L=12
- initialULBWPstartSymbolAndLength_1 = 69;
+ initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2
- initialULBWPk2_2 = 7;
+ initialULBWPk2_2 = 7; # used for Msg.3 during RA
initialULBWPmappingType_2 = 1;
- # this is SS=10 L=4
- initialULBWPstartSymbolAndLength_2 = 52;
+ initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
+
msg3_DeltaPreamble = 1;
p0_NominalWithGrant =-90;
diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpb210.conf
new file mode 100644
index 0000000000..0efc071c91
--- /dev/null
+++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpb210.conf
@@ -0,0 +1,298 @@
+Active_gNBs = ( "gNB-Eurecom-DU");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+gNBs =
+(
+ {
+ ////////// Identification parameters:
+ gNB_ID = 0xe00;
+ gNB_name = "gNB-Eurecom-DU";
+
+ // Tracking area code, 0x0000 and 0xfffe are reserved values
+ tracking_area_code = 1;
+ plmn_list = ({
+ mcc = 222;
+ mnc = 01;
+ mnc_length = 2;
+ snssaiList = (
+ {
+ sst = 1;
+ sd = 0x1; // 0 false, else true
+ },
+ {
+ sst = 1;
+ sd = 0x112233; // 0 false, else true
+ }
+ );
+
+ });
+
+ nr_cellid = 12345678L;
+
+ ////////// Physical parameters:
+
+ ssb_SubcarrierOffset = 0;
+ pdsch_AntennaPorts = 1;
+ pusch_AntennaPorts = 1;
+
+ pdcch_ConfigSIB1 = (
+ {
+ controlResourceSetZero = 12;
+ searchSpaceZero = 0;
+ }
+ );
+
+ servingCellConfigCommon = (
+ {
+ #spCellConfigCommon
+
+ physCellId = 0;
+
+# downlinkConfigCommon
+ #frequencyInfoDL
+ # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
+ absoluteFrequencySSB = 641280;
+ dl_frequencyBand = 78;
+ # this is 3600 MHz
+ dl_absoluteFrequencyPointA = 640008;
+ #scs-SpecificCarrierList
+ dl_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ dl_subcarrierSpacing = 1;
+ dl_carrierBandwidth = 106;
+ #initialDownlinkBWP
+ #genericParameters
+ # this is RBstart=27,L=48 (275*(L-1))+RBstart
+ initialDLBWPlocationAndBandwidth = 12952; # 6366 12925 12956 28875 12952
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialDLBWPsubcarrierSpacing = 1;
+ #pdcch-ConfigCommon
+ initialDLBWPcontrolResourceSetZero = 12;
+ 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
+ ul_frequencyBand = 78;
+ #scs-SpecificCarrierList
+ ul_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ ul_subcarrierSpacing = 1;
+ ul_carrierBandwidth = 106;
+ pMax = 20;
+ #initialUplinkBWP
+ #genericParameters
+ initialULBWPlocationAndBandwidth = 12952;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialULBWPsubcarrierSpacing = 1;
+ #rach-ConfigCommon
+ #rach-ConfigGeneric
+ prach_ConfigurationIndex = 98;
+#prach_msg1_FDM
+#0 = one, 1=two, 2=four, 3=eight
+ prach_msg1_FDM = 0;
+ prach_msg1_FrequencyStart = 0;
+ zeroCorrelationZoneConfig = 13;
+ preambleReceivedTargetPower = -96;
+#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
+ preambleTransMax = 6;
+#powerRampingStep
+# 0=dB0,1=dB2,2=dB4,3=dB6
+ powerRampingStep = 1;
+#ra_ReponseWindow
+#1,2,4,8,10,20,40,80
+ ra_ResponseWindow = 4;
+#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
+#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
+#oneHalf (0..15) 4,8,12,16,...60,64
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14;
+#ra_ContentionResolutionTimer
+#(0..7) 8,16,24,32,40,48,56,64
+ ra_ContentionResolutionTimer = 7;
+ rsrp_ThresholdSSB = 19;
+#prach-RootSequenceIndex_PR
+#1 = 839, 2 = 139
+ prach_RootSequenceIndex_PR = 2;
+ prach_RootSequenceIndex = 1;
+ # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
+ #
+ msg1_SubcarrierSpacing = 1,
+# restrictedSetConfig
+# 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;
+
+# pucch-ConfigCommon setup :
+# pucchGroupHopping
+# 0 = neither, 1= group hopping, 2=sequence hopping
+ pucchGroupHopping = 0;
+ hoppingId = 40;
+ p0_nominal = -90;
+# ssb_PositionsInBurs_BitmapPR
+# 1=short, 2=medium, 3=long
+ ssb_PositionsInBurst_PR = 2;
+ ssb_PositionsInBurst_Bitmap = 1;
+
+# ssb_periodicityServingCell
+# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
+ ssb_periodicityServingCell = 2;
+
+# dmrs_TypeA_position
+# 0 = pos2, 1 = pos3
+ dmrs_TypeA_Position = 0;
+
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ subcarrierSpacing = 1;
+
+
+ #tdd-UL-DL-ConfigurationCommon
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ referenceSubcarrierSpacing = 1;
+ # pattern1
+ # dl_UL_TransmissionPeriodicity
+ # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
+ dl_UL_TransmissionPeriodicity = 6;
+ nrofDownlinkSlots = 7;
+ nrofDownlinkSymbols = 6;
+ nrofUplinkSlots = 2;
+ nrofUplinkSymbols = 4;
+
+ ssPBCH_BlockPower = -25;
+ }
+
+ );
+
+
+ # ------- SCTP definitions
+ SCTP :
+ {
+ # Number of streams to use in input/output
+ SCTP_INSTREAMS = 2;
+ SCTP_OUTSTREAMS = 2;
+ };
+
+
+ ////////// MME parameters:
+ amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
+ ipv6 = "192:168:30::17";
+ active = "yes";
+ preference = "ipv4";
+ }
+ );
+
+
+ NETWORK_INTERFACES :
+ {
+ GNB_INTERFACE_NAME_FOR_NG_AMF = "eth0";
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR";
+ GNB_INTERFACE_NAME_FOR_NGU = "eth0";
+ GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR";
+ GNB_PORT_FOR_S1U = 2152; # Spec 2152
+ };
+
+ }
+);
+
+MACRLCs = (
+ {
+ num_cc = 1;
+ tr_s_preference = "local_L1";
+ tr_n_preference = "local_RRC";
+ ulsch_max_slots_inactivity = 100;
+ }
+);
+
+L1s = (
+ {
+ num_cc = 1;
+ tr_n_preference = "local_mac";
+ pusch_proc_threads = 8;
+ }
+);
+
+RUs = (
+ {
+ local_rf = "yes"
+ nb_tx = 1
+ nb_rx = 1
+ att_tx = 0
+ att_rx = 0;
+ bands = [7];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 114;
+ eNB_instances = [0];
+ #beamforming 1x4 matrix:
+ bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
+ clock_src = "internal";
+ }
+);
+
+THREAD_STRUCT = (
+ {
+ #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
+ parallel_config = "PARALLEL_SINGLE_THREAD";
+ #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
+ worker_config = "WORKER_ENABLE";
+ }
+);
+
+rfsimulator :
+{
+ serveraddr = "server";
+ serverport = "4043";
+ options = (); #("saviq"); or/and "chanmod"
+ modelname = "AWGN";
+ IQfile = "/tmp/rfsimulator.iqs";
+};
+
+ log_config :
+ {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+ ngap_log_level ="debug";
+ ngap_log_verbosity ="medium";
+ };
+
diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf
index b1d72c2269..8d32e8b792 100644
--- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf
+++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf
@@ -56,27 +56,13 @@ gNBs =
initialDLBWPsearchSpaceZero = 0;
#pdsch-ConfigCommon
#pdschTimeDomainAllocationList (up to 16 entries)
- initialDLBWPk0_0 = 0;
- #initialULBWPmappingType
- #0=typeA,1=typeB
- initialDLBWPmappingType_0 = 0;
- #this is SS=1,L=13
- initialDLBWPstartSymbolAndLength_0 = 40;
+ 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;
- initialDLBWPmappingType_1 = 0;
- #this is SS=2,L=12
- initialDLBWPstartSymbolAndLength_1 = 53;
-
- initialDLBWPk0_2 = 0;
- initialDLBWPmappingType_2 = 0;
- #this is SS=1,L=12
- initialDLBWPstartSymbolAndLength_2 = 54;
-
- initialDLBWPk0_3 = 0;
- initialDLBWPmappingType_3 = 0;
- #this is SS=1,L=5
- initialDLBWPstartSymbolAndLength_3 = 57;
+ initialDLBWPk0_1 = 0; #for mixed slot
+ initialDLBWPmappingType_1 = 0;
+ initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
#uplinkConfigCommon
#frequencyInfoUL
@@ -132,20 +118,17 @@ gNBs =
restrictedSetConfig = 0,
# pusch-ConfigCommon (up to 16 elements)
- initialULBWPk2_0 = 6;
+ initialULBWPk2_0 = 6; # used for UL slot
initialULBWPmappingType_0 = 1
- # this is SS=0 L=11
- initialULBWPstartSymbolAndLength_0 = 55;
+ initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13
- initialULBWPk2_1 = 6;
+ initialULBWPk2_1 = 6; # used for mixed slot
initialULBWPmappingType_1 = 1;
- # this is SS=0 L=12
- initialULBWPstartSymbolAndLength_1 = 69;
+ initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2
- initialULBWPk2_2 = 7;
+ initialULBWPk2_2 = 7; # used for Msg.3 during RA
initialULBWPmappingType_2 = 1;
- # this is SS=10 L=4
- initialULBWPstartSymbolAndLength_2 = 52;
+ initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
msg3_DeltaPreamble = 1;
p0_NominalWithGrant =-90;
@@ -228,6 +211,7 @@ MACRLCs = (
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "local_RRC";
+ ulsch_max_slots_inactivity = 1;
}
);
@@ -248,7 +232,7 @@ RUs = (
att_rx = 0;
bands = [7];
max_pdschReferenceSignalPower = -27;
- max_rxgain = 75;
+ max_rxgain = 50;
eNB_instances = [0];
## beamforming 1x2 matrix: 1 layer x 2 antennas
bf_weights = [0x00007fff, 0x0000];
@@ -259,7 +243,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 = "addr=192.168.10.2,mgmt_addr=192.168.10.2,second_addr=192.168.20.2";
+ sdr_addrs = "addr=192.168.30.2,mgmt_addr=192.168.30.2,second_addr=192.168.50.2";
clock_src = "external";
}
);
diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf
index 7be25a24fa..86293f2297 100644
--- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf
@@ -58,27 +58,14 @@ gNBs =
initialDLBWPsearchSpaceZero = 0;
#pdsch-ConfigCommon
#pdschTimeDomainAllocationList (up to 16 entries)
- initialDLBWPk0_0 = 0;
- #initialULBWPmappingType
- #0=typeA,1=typeB
- initialDLBWPmappingType_0 = 0;
- #this is SS=1,L=13
- initialDLBWPstartSymbolAndLength_0 = 40;
+ 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;
- initialDLBWPmappingType_1 = 0;
- #this is SS=2,L=12
- initialDLBWPstartSymbolAndLength_1 = 53;
+ initialDLBWPk0_1 = 0; #for mixed slot
+ initialDLBWPmappingType_1 = 0;
+ initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
- initialDLBWPk0_2 = 0;
- initialDLBWPmappingType_2 = 0;
- #this is SS=1,L=12
- initialDLBWPstartSymbolAndLength_2 = 54;
-
- initialDLBWPk0_3 = 0;
- initialDLBWPmappingType_3 = 0;
- #this is SS=1,L=4 //5 (4 is for 43, 5 is for 57)
- initialDLBWPstartSymbolAndLength_3 = 57; //43; //57;
#uplinkConfigCommon
#frequencyInfoUL
ul_frequencyBand = 78;
@@ -133,20 +120,17 @@ gNBs =
# 0=unrestricted, 1=restricted type A, 2=restricted type B
restrictedSetConfig = 0,
# pusch-ConfigCommon (up to 16 elements)
- initialULBWPk2_0 = 2;
+ initialULBWPk2_0 = 6; # used for UL slot
initialULBWPmappingType_0 = 1
- # this is SS=0 L=11
- initialULBWPstartSymbolAndLength_0 = 55;
-
- initialULBWPk2_1 = 2;
- initialULBWPmappingType_1 = 1;
- # this is SS=0 L=12
- initialULBWPstartSymbolAndLength_1 = 69;
+ initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13
- initialULBWPk2_2 = 7;
+ 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;
- # this is SS=10 L=4
- initialULBWPstartSymbolAndLength_2 = 52;
+ initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
msg3_DeltaPreamble = 1;
p0_NominalWithGrant =-90;
@@ -260,11 +244,11 @@ RUs = (
local_rf = "yes"
nb_tx = 1
nb_rx = 1
- att_tx = 0
+ att_tx = 3
att_rx = 0;
bands = [7];
max_pdschReferenceSignalPower = -27;
- max_rxgain = 114;
+ max_rxgain = 111;
eNB_instances = [0];
# clock_src = "external";
}
diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf
index 809203f672..cb3e69faf3 100644
--- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf
@@ -61,24 +61,15 @@ gNBs =
initialDLBWPk0_0 = 0;
#initialULBWPmappingType
#0=typeA,1=typeB
- initialDLBWPmappingType_0 = 0;
+ initialDLBWPmappingType_0 = 0;#for DL slot
#this is SS=1,L=13
initialDLBWPstartSymbolAndLength_0 = 40;
- initialDLBWPk0_1 = 0;
+ initialDLBWPk0_1 = 0;#for mixed slot
initialDLBWPmappingType_1 = 0;
- #this is SS=2,L=12
- initialDLBWPstartSymbolAndLength_1 = 53;
+ #this is SS=1,L=5
+ initialDLBWPstartSymbolAndLength_1 = 57;
- initialDLBWPk0_2 = 0;
- initialDLBWPmappingType_2 = 0;
- #this is SS=1,L=12
- initialDLBWPstartSymbolAndLength_2 = 54;
-
- initialDLBWPk0_3 = 0;
- initialDLBWPmappingType_3 = 0;
- #this is SS=1,L=4 //5 (4 is for 43, 5 is for 57)
- initialDLBWPstartSymbolAndLength_3 = 57; //43; //57;
#uplinkConfigCommon
#frequencyInfoUL
ul_frequencyBand = 78;
@@ -103,7 +94,7 @@ gNBs =
prach_msg1_FDM = 0;
prach_msg1_FrequencyStart = 0;
zeroCorrelationZoneConfig = 13;
- preambleReceivedTargetPower = -100;
+ preambleReceivedTargetPower = -90;
#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
preambleTransMax = 6;
#powerRampingStep
@@ -136,7 +127,7 @@ gNBs =
initialULBWPk2_0 = 2;
initialULBWPmappingType_0 = 1
# this is SS=0 L=11
- initialULBWPstartSymbolAndLength_0 = 55;
+ initialULBWPstartSymbolAndLength_0 = 41;
initialULBWPk2_1 = 2;
initialULBWPmappingType_1 = 1;
@@ -188,7 +179,7 @@ gNBs =
nrofUplinkSlots = 2;
nrofUplinkSymbols = 4; //0; //4;
- ssPBCH_BlockPower = -25;
+ ssPBCH_BlockPower = -15;
}
);
diff --git a/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf
index 419598647b..7f6bff304d 100644
--- a/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf
+++ b/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf
@@ -19,54 +19,54 @@ eNBs =
tracking_area_code = 1;
plmn_list = ( { mcc = 208; mnc = 92; mnc_length = 2; } );
- ////////// Physical parameters:
+ ////////// Physical parameters:
component_carriers = (
{
- node_function = "NGFI_RCC_IF4p5";
- node_timing = "synch_to_ext_device";
- node_synch_ref = 0;
- frame_type = "TDD";
- tdd_config = 1;
- tdd_config_s = 0;
- prefix_type = "NORMAL";
- eutra_band = 40;
- downlink_frequency = 2350000000L;
- uplink_frequency_offset = 0;
- Nid_cell = 0;
- N_RB_DL = 25;
- Nid_cell_mbsfn = 0;
- nb_antenna_ports = 1;
- nb_antennas_tx = 1;
- nb_antennas_rx = 1;
- tx_gain = 90;
- rx_gain = 125;
- prach_root = 0;
- prach_config_index = 0;
- prach_high_speed = "DISABLE";
- prach_zero_correlation = 1;
- prach_freq_offset = 2;
- pucch_delta_shift = 1;
- pucch_nRB_CQI = 1;
- pucch_nCS_AN = 0;
- pucch_n1_AN = 0;
- pdsch_referenceSignalPower =-27;
- pdsch_p_b = 0;
- pusch_n_SB = 1;
- pusch_enable64QAM = "DISABLE";
- pusch_hoppingMode = "interSubFrame";
- pusch_hoppingOffset = 0;
- pusch_groupHoppingEnabled = "ENABLE";
- pusch_groupAssignment = 0;
- pusch_sequenceHoppingEnabled = "DISABLE";
- pusch_nDMRS1 = 1;
- phich_duration = "NORMAL";
- phich_resource = "ONESIXTH";
- srs_enable = "DISABLE";
- /* srs_BandwidthConfig =;
- srs_SubframeConfig =;
- srs_ackNackST =;
- srs_MaxUpPts =;*/
+ node_function = "NGFI_RCC_IF4p5";
+ node_timing = "synch_to_ext_device";
+ node_synch_ref = 0;
+ frame_type = "TDD";
+ tdd_config = 1;
+ tdd_config_s = 0;
+ prefix_type = "NORMAL";
+ eutra_band = 40;
+ downlink_frequency = 2350000000L;
+ uplink_frequency_offset = 0;
+ Nid_cell = 0;
+ N_RB_DL = 25;
+ Nid_cell_mbsfn = 0;
+ nb_antenna_ports = 1;
+ nb_antennas_tx = 1;
+ nb_antennas_rx = 1;
+ tx_gain = 90;
+ rx_gain = 125;
+ prach_root = 0;
+ prach_config_index = 0;
+ prach_high_speed = "DISABLE";
+ prach_zero_correlation = 1;
+ prach_freq_offset = 2;
+ pucch_delta_shift = 1;
+ pucch_nRB_CQI = 1;
+ pucch_nCS_AN = 0;
+ pucch_n1_AN = 0;
+ pdsch_referenceSignalPower =-27;
+ pdsch_p_b = 0;
+ pusch_n_SB = 1;
+ pusch_enable64QAM = "DISABLE";
+ pusch_hoppingMode = "interSubFrame";
+ pusch_hoppingOffset = 0;
+ pusch_groupHoppingEnabled = "ENABLE";
+ pusch_groupAssignment = 0;
+ pusch_sequenceHoppingEnabled = "DISABLE";
+ pusch_nDMRS1 = 1;
+ phich_duration = "NORMAL";
+ phich_resource = "ONESIXTH";
+ srs_enable = "DISABLE";
+ /* srs_BandwidthConfig =;
+ srs_SubframeConfig =;
+ srs_ackNackST =;
+ srs_MaxUpPts =;*/
pusch_p0_Nominal = -96;
pusch_alpha = "AL1";
@@ -76,7 +76,7 @@ eNBs =
pucch_deltaF_Format1b = "deltaF3";
pucch_deltaF_Format2 = "deltaF0";
pucch_deltaF_Format2a = "deltaF0";
- pucch_deltaF_Format2b = "deltaF0";
+ pucch_deltaF_Format2b = "deltaF0";
rach_numberOfRA_Preambles = 64;
rach_preamblesGroupAConfig = "DISABLE";
@@ -92,17 +92,17 @@ eNBs =
rach_macContentionResolutionTimer = 48;
rach_maxHARQ_Msg3Tx = 4;
- pcch_default_PagingCycle = 128;
- pcch_nB = "oneT";
- bcch_modificationPeriodCoeff = 2;
- ue_TimersAndConstants_t300 = 1000;
- ue_TimersAndConstants_t301 = 1000;
- ue_TimersAndConstants_t310 = 1000;
- ue_TimersAndConstants_t311 = 10000;
- ue_TimersAndConstants_n310 = 20;
- ue_TimersAndConstants_n311 = 1;
+ pcch_default_PagingCycle = 128;
+ pcch_nB = "oneT";
+ bcch_modificationPeriodCoeff = 2;
+ ue_TimersAndConstants_t300 = 1000;
+ ue_TimersAndConstants_t301 = 1000;
+ ue_TimersAndConstants_t310 = 1000;
+ ue_TimersAndConstants_t311 = 10000;
+ ue_TimersAndConstants_n310 = 20;
+ ue_TimersAndConstants_n311 = 1;
- ue_TransmissionMode = 1;
+ ue_TransmissionMode = 1;
}
);
@@ -148,7 +148,7 @@ eNBs =
enable_measurement_reports = "no";
///X2
- enable_x2 = "no";
+ enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */
tx2_reloc_overall = 2000; /* unit: millisecond */
t_dc_prep = 1000; /* unit: millisecond */
@@ -186,41 +186,41 @@ eNBs =
}
);
MACRLCs = (
- {
- num_cc = 1;
- tr_s_preference = "local_L1";
- tr_n_preference = "local_RRC";
- scheduler_mode = "fairRR";
- puSch10xSnr = 200;
- puCch10xSnr = 200;
- }
+ {
+ num_cc = 1;
+ tr_s_preference = "local_L1";
+ tr_n_preference = "local_RRC";
+ scheduler_mode = "fairRR";
+ puSch10xSnr = 200;
+ puCch10xSnr = 200;
+ }
);
L1s = (
- {
- num_cc = 1;
- tr_n_preference = "local_mac";
- }
+ {
+ num_cc = 1;
+ tr_n_preference = "local_mac";
+ }
);
RUs = (
- {
- local_if_name = "lo";
- remote_address = "127.0.0.2";
- local_address = "127.0.0.1";
- local_portc = 50000;
- remote_portc = 50000;
- local_portd = 50001;
- remote_portd = 50001;
- local_rf = "no"
- tr_preference = "udp_if4p5"
- nb_tx = 1
- nb_rx = 1
- att_tx = 0
- att_rx = 0;
- eNB_instances = [0];
- }
-);
+ {
+ local_if_name = "lo";
+ remote_address = "127.0.0.2";
+ local_address = "127.0.0.1";
+ local_portc = 50000;
+ remote_portc = 50000;
+ local_portd = 50001;
+ remote_portd = 50001;
+ local_rf = "no"
+ tr_preference = "udp_if4p5"
+ nb_tx = 1
+ nb_rx = 1
+ att_tx = 0
+ att_rx = 0;
+ eNB_instances = [0];
+ }
+);
THREAD_STRUCT = (
{
diff --git a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf
index 2c3c11b84f..574c8b2545 100644
--- a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf
@@ -25,51 +25,51 @@ eNBs =
component_carriers = (
{
- node_function = "NGFI_RCC_IF4p5";
- node_timing = "synch_to_ext_device";
- node_synch_ref = 0;
- frame_type = "FDD";
- tdd_config = 3;
- tdd_config_s = 0;
- prefix_type = "NORMAL";
- eutra_band = 7;
- downlink_frequency = 2680000000L;
- uplink_frequency_offset = -120000000;
- Nid_cell = 0;
- N_RB_DL = 25;
- Nid_cell_mbsfn = 0;
- nb_antenna_ports = 1;
- nb_antennas_tx = 1;
- nb_antennas_rx = 1;
- tx_gain = 90;
- rx_gain = 125;
- pbch_repetition = "FALSE";
- prach_root = 0;
- prach_config_index = 0;
- prach_high_speed = "DISABLE";
- prach_zero_correlation = 1;
- prach_freq_offset = 2;
- pucch_delta_shift = 1;
- pucch_nRB_CQI = 0;
- pucch_nCS_AN = 0;
- pucch_n1_AN = 0;
- pdsch_referenceSignalPower = -25;
- pdsch_p_b = 0;
- pusch_n_SB = 1;
- pusch_enable64QAM = "DISABLE";
- pusch_hoppingMode = "interSubFrame";
- pusch_hoppingOffset = 0;
- pusch_groupHoppingEnabled = "ENABLE";
- pusch_groupAssignment = 0;
- pusch_sequenceHoppingEnabled = "DISABLE";
- pusch_nDMRS1 = 1;
- phich_duration = "NORMAL";
- phich_resource = "ONESIXTH";
- srs_enable = "DISABLE";
- /* srs_BandwidthConfig =;
- srs_SubframeConfig =;
- srs_ackNackST =;
- srs_MaxUpPts =;*/
+ node_function = "NGFI_RCC_IF4p5";
+ node_timing = "synch_to_ext_device";
+ node_synch_ref = 0;
+ frame_type = "FDD";
+ tdd_config = 3;
+ tdd_config_s = 0;
+ prefix_type = "NORMAL";
+ eutra_band = 7;
+ downlink_frequency = 2680000000L;
+ uplink_frequency_offset = -120000000;
+ Nid_cell = 0;
+ N_RB_DL = 25;
+ Nid_cell_mbsfn = 0;
+ nb_antenna_ports = 1;
+ nb_antennas_tx = 1;
+ nb_antennas_rx = 1;
+ tx_gain = 90;
+ rx_gain = 125;
+ pbch_repetition = "FALSE";
+ prach_root = 0;
+ prach_config_index = 0;
+ prach_high_speed = "DISABLE";
+ prach_zero_correlation = 1;
+ prach_freq_offset = 2;
+ pucch_delta_shift = 1;
+ pucch_nRB_CQI = 0;
+ pucch_nCS_AN = 0;
+ pucch_n1_AN = 0;
+ pdsch_referenceSignalPower = -25;
+ pdsch_p_b = 0;
+ pusch_n_SB = 1;
+ pusch_enable64QAM = "DISABLE";
+ pusch_hoppingMode = "interSubFrame";
+ pusch_hoppingOffset = 0;
+ pusch_groupHoppingEnabled = "ENABLE";
+ pusch_groupAssignment = 0;
+ pusch_sequenceHoppingEnabled = "DISABLE";
+ pusch_nDMRS1 = 1;
+ phich_duration = "NORMAL";
+ phich_resource = "ONESIXTH";
+ srs_enable = "DISABLE";
+ /* srs_BandwidthConfig =;
+ srs_SubframeConfig =;
+ srs_ackNackST =;
+ srs_MaxUpPts =;*/
pusch_p0_Nominal = -96;
pusch_alpha = "AL1";
@@ -79,7 +79,7 @@ eNBs =
pucch_deltaF_Format1b = "deltaF3";
pucch_deltaF_Format2 = "deltaF0";
pucch_deltaF_Format2a = "deltaF0";
- pucch_deltaF_Format2b = "deltaF0";
+ pucch_deltaF_Format2b = "deltaF0";
rach_numberOfRA_Preambles = 64;
rach_preamblesGroupAConfig = "DISABLE";
@@ -97,25 +97,25 @@ eNBs =
pcch_default_PagingCycle = 128;
pcch_nB = "oneT";
- bcch_modificationPeriodCoeff = 2;
- ue_TimersAndConstants_t300 = 1000;
- ue_TimersAndConstants_t301 = 1000;
- ue_TimersAndConstants_t310 = 1000;
- ue_TimersAndConstants_t311 = 10000;
- ue_TimersAndConstants_n310 = 20;
- ue_TimersAndConstants_n311 = 1;
- ue_TransmissionMode = 1;
+ bcch_modificationPeriodCoeff = 2;
+ ue_TimersAndConstants_t300 = 1000;
+ ue_TimersAndConstants_t301 = 1000;
+ ue_TimersAndConstants_t310 = 1000;
+ ue_TimersAndConstants_t311 = 10000;
+ ue_TimersAndConstants_n310 = 20;
+ ue_TimersAndConstants_n311 = 1;
+ ue_TransmissionMode = 1;
//Parameters for SIB18
- rxPool_sc_CP_Len = "normal";
- rxPool_sc_Period = "sf40";
- rxPool_data_CP_Len = "normal";
- rxPool_ResourceConfig_prb_Num = 20;
- rxPool_ResourceConfig_prb_Start = 5;
- rxPool_ResourceConfig_prb_End = 44;
- rxPool_ResourceConfig_offsetIndicator_present = "prSmall";
- rxPool_ResourceConfig_offsetIndicator_choice = 0;
- rxPool_ResourceConfig_subframeBitmap_present = "prBs40";
+ rxPool_sc_CP_Len = "normal";
+ rxPool_sc_Period = "sf40";
+ rxPool_data_CP_Len = "normal";
+ rxPool_ResourceConfig_prb_Num = 20;
+ rxPool_ResourceConfig_prb_Start = 5;
+ rxPool_ResourceConfig_prb_End = 44;
+ rxPool_ResourceConfig_offsetIndicator_present = "prSmall";
+ rxPool_ResourceConfig_offsetIndicator_choice = 0;
+ rxPool_ResourceConfig_subframeBitmap_present = "prBs40";
rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "00000000000000000000";
rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
@@ -185,7 +185,7 @@ eNBs =
enable_measurement_reports = "no";
///X2
- enable_x2 = "no";
+ enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */
tx2_reloc_overall = 2000; /* unit: millisecond */
t_dc_prep = 1000; /* unit: millisecond */
@@ -205,21 +205,21 @@ eNBs =
);
MACRLCs = (
- {
- num_cc = 1;
- tr_s_preference = "local_L1";
- tr_n_preference = "local_RRC";
- phy_test_mode = 0;
- puSch10xSnr = 160;
- puCch10xSnr = 160;
- }
+ {
+ num_cc = 1;
+ tr_s_preference = "local_L1";
+ tr_n_preference = "local_RRC";
+ phy_test_mode = 0;
+ puSch10xSnr = 160;
+ puCch10xSnr = 160;
+ }
);
L1s = (
- {
- num_cc = 1;
- tr_n_preference = "local_mac";
- }
+ {
+ num_cc = 1;
+ tr_n_preference = "local_mac";
+ }
);
RUs = (
@@ -260,20 +260,20 @@ NETWORK_CONTROLLER :
FLEXRAN_AWAIT_RECONF = "no";
};
- log_config :
- {
- global_log_level ="info";
- global_log_verbosity ="medium";
- hw_log_level ="info";
- hw_log_verbosity ="medium";
- phy_log_level ="info";
- phy_log_verbosity ="medium";
- mac_log_level ="info";
- mac_log_verbosity ="high";
- rlc_log_level ="info";
- rlc_log_verbosity ="medium";
- pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
- rrc_log_level ="info";
- rrc_log_verbosity ="medium";
- };
+log_config :
+{
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+};
diff --git a/ci-scripts/constants.py b/ci-scripts/constants.py
index a0e1ac5c45..bb110bc0e8 100644
--- a/ci-scripts/constants.py
+++ b/ci-scripts/constants.py
@@ -60,6 +60,11 @@ OAI_UE_PROCESS_SEG_FAULT = -25
OAI_UE_PROCESS_NO_MBMS_MSGS = -26
OAI_UE_PROCESS_OK = +6
INVALID_PARAMETER = -50
+PHYSIM_IMAGE_ABSENT = -60
+OC_LOGIN_FAIL = -61
+OC_PROJECT_FAIL = -62
+OC_IS_FAIL = -63
+OC_PHYSIM_DEPLOY_FAIL = -64
UE_STATUS_DETACHED = 0
UE_STATUS_DETACHING = 1
diff --git a/ci-scripts/createVM.sh b/ci-scripts/createVM.sh
index ab859c10d7..f3f8ddaca2 100755
--- a/ci-scripts/createVM.sh
+++ b/ci-scripts/createVM.sh
@@ -87,7 +87,7 @@ function create_vm {
echo "VM_CPU = $VM_CPU"
echo "VM_DISK = $VM_DISK GBytes"
- if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]]
+ if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]]
then
echo "This VM type is no longer supported in the pipeline framework"
return
diff --git a/ci-scripts/datalog_rt_stats.yaml b/ci-scripts/datalog_rt_stats.yaml
new file mode 100644
index 0000000000..548caa0bdd
--- /dev/null
+++ b/ci-scripts/datalog_rt_stats.yaml
@@ -0,0 +1,33 @@
+#this is a configuration file
+#used to build real time processing statistics
+#for 5G NR phy test (gNB terminate)
+Title : Processing Time (us)
+ColNames :
+ - Metric
+ - Average
+ - Max
+ - 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 : 300.0
+ DLSCH encoding : 230.0
+ L1 Rx processing : 175.0
+ PUSCH inner-receiver : 100.0
+ PUSCH decoding : 140.0
+ DL & UL scheduling timing stats : 37.0
+ UL Indication : 38.0
+Threshold :
+ feprx : 1.25
+ feptx_prec : 1.25
+ feptx_ofdm : 1.25
+ feptx_total : 1.25
+ L1 Tx processing : 1.25
+ DLSCH encoding : 1.25
+ L1 Rx processing : 1.25
+ PUSCH inner-receiver : 1.25
+ PUSCH decoding : 1.25
+ DL & UL scheduling timing stats : 1.25
+ UL Indication : 1.25
diff --git a/ci-scripts/html.py b/ci-scripts/html.py
index a0ac638573..9eadf30279 100644
--- a/ci-scripts/html.py
+++ b/ci-scripts/html.py
@@ -47,7 +47,7 @@ import constants as CONST
class HTMLManagement():
def __init__(self):
-
+
self.htmlFile = ''
self.htmlHeaderCreated = False
self.htmlFooterCreated = False
@@ -86,13 +86,13 @@ class HTMLManagement():
#-----------------------------------------------------------
# Setters and Getters
#-----------------------------------------------------------
-
+
def SethtmlUEConnected(self, nbUEs):
if nbUEs > 0:
self.htmlUEConnected = nbUEs
else:
self.htmlUEConnected = 1
-
+
#-----------------------------------------------------------
@@ -365,6 +365,16 @@ class HTMLManagement():
self.htmlFile.write(' KO - SPGW process not found \n')
elif (processesStatus == CONST.UE_IP_ADDRESS_ISSUE):
self.htmlFile.write(' KO - Could not retrieve UE IP address \n')
+ elif (processesStatus == CONST.PHYSIM_IMAGE_ABSENT):
+ self.htmlFile.write(' KO - No such image oai-physim \n')
+ elif (processesStatus == CONST.OC_LOGIN_FAIL):
+ self.htmlFile.write(' KO - Could not log onto cluster \n')
+ elif (processesStatus == CONST.OC_PROJECT_FAIL):
+ self.htmlFile.write(' KO - Could not register into cluster project \n')
+ elif (processesStatus == CONST.OC_IS_FAIL):
+ self.htmlFile.write(' KO - Could not create Image Stream \n')
+ elif (processesStatus == CONST.OC_PHYSIM_DEPLOY_FAIL):
+ self.htmlFile.write(' KO - Could not properly deploy physim on cluster \n')
else:
self.htmlFile.write(' ' + str(status) + ' \n')
else:
@@ -412,7 +422,12 @@ class HTMLManagement():
for image in collectInfo:
files = collectInfo[image]
# TabHeader for image logs on built shared and target images
- self.htmlFile.write(' \n')
+ if allImagesSize[image].count('unknown') > 0:
+ self.htmlFile.write(' \n')
+ elif allImagesSize[image].count('Build Failed') > 0:
+ self.htmlFile.write(' \n')
+ else:
+ self.htmlFile.write(' \n')
self.htmlFile.write(' ---- ' + image + ' IMAGE STATUS ----> Size ' + allImagesSize[image] + ' \n')
self.htmlFile.write(' \n')
self.htmlFile.write(' \n')
@@ -431,21 +446,54 @@ class HTMLManagement():
self.htmlFile.write(' ' + str(parameters['errors']) + ' \n')
else:
self.htmlFile.write(' ' + str(parameters['errors']) + ' \n')
- if (parameters['warnings'] == 0):
+ if (parameters['errors'] > 0):
+ self.htmlFile.write(' ' + str(parameters['warnings']) + ' \n')
+ elif (parameters['warnings'] == 0):
self.htmlFile.write(' ' + str(parameters['warnings']) + ' \n')
elif ((parameters['warnings'] > 0) and (parameters['warnings'] <= 20)):
self.htmlFile.write(' ' + str(parameters['warnings']) + ' \n')
else:
- self.htmlFile.write(' ' + str(parameters['warnings']) + ' \n')
+ self.htmlFile.write(' ' + str(parameters['warnings']) + ' \n')
if (parameters['errors'] == 0) and (parameters['warnings'] == 0):
self.htmlFile.write(' OK \n')
elif (parameters['errors'] == 0) and ((parameters['warnings'] > 0) and (parameters['warnings'] <= 20)):
self.htmlFile.write(' OK \n')
else:
- self.htmlFile.write(' NOT OK \n')
+ self.htmlFile.write(' NOT OK \n')
self.htmlFile.write(' \n')
self.htmlFile.close()
+ #for the moment it is limited to 4 columns, to be made generic later
+ def CreateHtmlDataLogTable(self, DataLog):
+ if (self.htmlFooterCreated or (not self.htmlHeaderCreated)):
+ return
+ self.htmlFile = open('test_results.html', 'a')
+
+ # TabHeader
+ self.htmlFile.write(' \n')
+ self.htmlFile.write(' ---- ' + DataLog['Title'] + ' ---- \n')
+ 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(' \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')
+ else:
+ self.htmlFile.write(' ' + DataLog['Data'][k][2] + ' (Ref = ' + str(DataLog['Ref'][k]) + ' ; Thres = ' +str(DataLog['Threshold'][k])+') ' + ' \n')
+ self.htmlFile.write(' \n')
+ self.htmlFile.close()
+
+
def CreateHtmlTestRowQueue(self, options, status, ue_status, ue_queue):
if ((not self.htmlFooterCreated) and (self.htmlHeaderCreated)):
self.htmlFile = open('test_results.html', 'a')
@@ -562,5 +610,57 @@ class HTMLManagement():
self.htmlFile.write(' ' + str(CCR.nbWrongScanfArg[vId]) + ' \n')
self.htmlFile.write(' \n')
vId += 1
-
+
+ def CreateHtmlTestRowPhySimTestResult(self, testSummary, testResult):
+ if (self.htmlFooterCreated or (not self.htmlHeaderCreated)):
+ return
+ self.htmlFile = open('test_results.html', 'a')
+ if bool(testResult) == False and bool(testSummary) == False:
+ self.htmlFile.write(' \n')
+ self.htmlFile.write(' ----PHYSIM TESTING FAILED - Unable to recover the test logs ---- \n')
+ self.htmlFile.write(' \n')
+ else:
+ # Tab header
+ self.htmlFile.write(' \n')
+ self.htmlFile.write(' ---- PHYSIM TEST SUMMARY---- \n')
+ self.htmlFile.write(' \n')
+ self.htmlFile.write(' \n')
+ self.htmlFile.write(' LogFile Name \n')
+ self.htmlFile.write(' Nb Tests \n')
+ self.htmlFile.write(' Nb Failure \n')
+ self.htmlFile.write(' Nb Pass \n')
+ self.htmlFile.write(' \n')
+ self.htmlFile.write(' \n')
+ self.htmlFile.write(' physim_test.txt \n')
+ self.htmlFile.write(' ' + str(testSummary['Nbtests']) + ' \n')
+ if testSummary['Nbfail'] == 0:
+ self.htmlFile.write(' ' + str(testSummary['Nbfail']) + ' \n')
+ else:
+ self.htmlFile.write(' ' + str(testSummary['Nbfail']) + ' \n')
+ self.htmlFile.write(' ' + str(testSummary['Nbpass']) + ' \n')
+ self.htmlFile.write(' \n')
+ self.htmlFile.write(' \n')
+ self.htmlFile.write(' ---- PHYSIM TEST DETAIL INFO---- \n')
+ self.htmlFile.write(' \n')
+ self.htmlFile.write(' \n')
+ self.htmlFile.write(' Test Name \n')
+ self.htmlFile.write(' Test Description \n')
+ self.htmlFile.write(' Result \n')
+ self.htmlFile.write(' \n')
+ y = ''
+ for key, value in testResult.items():
+ x = key.split(".")
+ if x[0] != y:
+ self.htmlFile.write(' \n')
+ self.htmlFile.write(' "' + x[0] + '" series \n')
+ self.htmlFile.write(' \n')
+ y = x[0]
+ self.htmlFile.write(' \n')
+ self.htmlFile.write(' ' + key + ' \n')
+ self.htmlFile.write(' ' + value[0] + ' \n')
+ if 'PASS' in value:
+ self.htmlFile.write(' ' + value[1] + ' \n')
+ else:
+ self.htmlFile.write(' ' + value[1] + ' \n')
+
self.htmlFile.close()
diff --git a/ci-scripts/main.py b/ci-scripts/main.py
index f13df9beb5..0718ee6396 100644
--- a/ci-scripts/main.py
+++ b/ci-scripts/main.py
@@ -43,7 +43,8 @@ import cls_physim #class PhySim for physical simulators build and
import cls_cots_ue #class CotsUe for Airplane mode control
import cls_containerize #class Containerize for all container-based operations on RAN/UE objects
import cls_static_code_analysis #class for static code analysis
-
+import cls_ci_ueinfra #class defining the multi Ue infrastrucure
+import cls_physim1 #class PhySim for physical simulators deploy and run
import sshconnection
import epc
@@ -151,6 +152,7 @@ def GetParametersFromXML(action):
RAN.eNB_serverId[RAN.eNB_instance]=eNB_serverId
elif action == 'Initialize_eNB':
+ RAN.eNB_Trace=test.findtext('eNB_Trace')
RAN.Initialize_eNB_args=test.findtext('Initialize_eNB_args')
eNB_instance=test.findtext('eNB_instance')
if (eNB_instance is None):
@@ -193,13 +195,41 @@ def GetParametersFromXML(action):
else :
RAN.air_interface[RAN.eNB_instance] = 'ocp-enb'
+ elif action == 'Initialize_UE':
+ ue_id = test.findtext('id')
+ CiTestObj.ue_trace=test.findtext('UE_Trace')#temporary variable, to be passed to Module_UE in Initialize_UE call
+ if (ue_id is None):
+ CiTestObj.ue_id = ""
+ else:
+ CiTestObj.ue_id = ue_id
+
+ elif action == 'Detach_UE':
+ ue_id = test.findtext('id')
+ if (ue_id is None):
+ CiTestObj.ue_id = ""
+ else:
+ CiTestObj.ue_id = ue_id
+
elif action == 'Attach_UE':
+ ue_id = test.findtext('id')
+ if (ue_id is None):
+ CiTestObj.ue_id = ""
+ else:
+ CiTestObj.ue_id = ue_id
nbMaxUEtoAttach = test.findtext('nbMaxUEtoAttach')
if (nbMaxUEtoAttach is None):
CiTestObj.nbMaxUEtoAttach = -1
else:
CiTestObj.nbMaxUEtoAttach = int(nbMaxUEtoAttach)
+ elif action == 'Terminate_UE':
+ ue_id = test.findtext('id')
+ if (ue_id is None):
+ CiTestObj.ue_id = ""
+ else:
+ CiTestObj.ue_id = ue_id
+
+
elif action == 'CheckStatusUE':
expectedNBUE = test.findtext('expectedNbOfConnectedUEs')
if (expectedNBUE is None):
@@ -253,9 +283,20 @@ def GetParametersFromXML(action):
elif (action == 'Ping') or (action == 'Ping_CatM_module'):
CiTestObj.ping_args = test.findtext('ping_args')
CiTestObj.ping_packetloss_threshold = test.findtext('ping_packetloss_threshold')
+ ue_id = test.findtext('id')
+ if (ue_id is None):
+ CiTestObj.ue_id = ""
+ else:
+ CiTestObj.ue_id = ue_id
elif action == 'Iperf':
CiTestObj.iperf_args = test.findtext('iperf_args')
+ ue_id = test.findtext('id')
+ if (ue_id is None):
+ CiTestObj.ue_id = ""
+ else:
+ CiTestObj.ue_id = ue_id
+ CiTestObj.iperf_direction = test.findtext('direction')#used for modules only
CiTestObj.iperf_packetloss_threshold = test.findtext('iperf_packetloss_threshold')
CiTestObj.iperf_profile = test.findtext('iperf_profile')
if (CiTestObj.iperf_profile is None):
@@ -370,6 +411,20 @@ with open(yaml_file,'r') as f:
+#loading UE infrastructure from yaml
+ue_infra_file='ci_ueinfra.yaml'
+if (os.path.isfile(ue_infra_file)):
+ yaml_file=ue_infra_file
+elif (os.path.isfile('ci-scripts/'+ue_infra_file)):
+ yaml_file='ci-scripts/'+ue_infra_file
+else:
+ logging.error("UE infrastructure yaml file cannot be found")
+ sys.exit("UE infrastructure file cannot be found")
+InfraUE=cls_ci_ueinfra.InfraUE() #initialize UE infrastructure class
+InfraUE.Get_UE_Infra(yaml_file) #read the UE infra, filename is hardcoded and unique for the moment but should be passed as parameter from the test suite
+
+
+
mode = ''
CiTestObj = cls_oaicitest.OaiCiTest()
@@ -380,17 +435,17 @@ RAN = ran.RANManagement()
HTML = html.HTMLManagement()
CONTAINERS = cls_containerize.Containerize()
SCA = cls_static_code_analysis.StaticCodeAnalysis()
+PHYSIM = cls_physim1.PhySim()
ldpc=cls_physim.PhySim() #create an instance for LDPC test using GPU or CPU build
-
#-----------------------------------------------------------
# Parsing Command Line Arguments
#-----------------------------------------------------------
import args_parse
-py_param_file_present, py_params, mode = args_parse.ArgsParse(sys.argv,CiTestObj,RAN,HTML,EPC,ldpc,CONTAINERS,HELP,SCA)
+py_param_file_present, py_params, mode = args_parse.ArgsParse(sys.argv,CiTestObj,RAN,HTML,EPC,ldpc,CONTAINERS,HELP,SCA,PHYSIM)
@@ -428,13 +483,13 @@ elif re.match('^TerminateUE$', mode, re.IGNORECASE):
HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter')
signal.signal(signal.SIGUSR1, receive_signal)
- CiTestObj.TerminateUE(HTML,COTS_UE)
+ CiTestObj.TerminateUE(HTML,COTS_UE,InfraUE,CiTestObj.ue_trace)
elif re.match('^TerminateOAIUE$', mode, re.IGNORECASE):
if CiTestObj.UEIPAddress == '' or CiTestObj.UEUserName == '' or CiTestObj.UEPassword == '':
HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter')
signal.signal(signal.SIGUSR1, receive_signal)
- CiTestObj.TerminateOAIUE(HTML,RAN,COTS_UE,EPC)
+ CiTestObj.TerminateOAIUE(HTML,RAN,COTS_UE,EPC,InfraUE)
elif re.match('^TerminateHSS$', mode, re.IGNORECASE):
if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.Type == '' or EPC.SourceCodePath == '':
HELP.GenericHelp(CONST.Version)
@@ -673,39 +728,39 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
elif action == 'Terminate_eNB':
RAN.TerminateeNB(HTML, EPC)
elif action == 'Initialize_UE':
- CiTestObj.InitializeUE(HTML,COTS_UE)
+ CiTestObj.InitializeUE(HTML,RAN, EPC, COTS_UE, InfraUE, CiTestObj.ue_trace)
elif action == 'Terminate_UE':
- CiTestObj.TerminateUE(HTML,COTS_UE)
+ CiTestObj.TerminateUE(HTML,COTS_UE, InfraUE, CiTestObj.ue_trace)
elif action == 'Attach_UE':
- CiTestObj.AttachUE(HTML,RAN,EPC,COTS_UE)
+ CiTestObj.AttachUE(HTML,RAN,EPC,COTS_UE,InfraUE)
elif action == 'Detach_UE':
- CiTestObj.DetachUE(HTML,RAN,EPC,COTS_UE)
+ CiTestObj.DetachUE(HTML,RAN,EPC,COTS_UE,InfraUE)
elif action == 'DataDisable_UE':
CiTestObj.DataDisableUE(HTML)
elif action == 'DataEnable_UE':
CiTestObj.DataEnableUE(HTML)
elif action == 'CheckStatusUE':
- CiTestObj.CheckStatusUE(HTML,RAN,EPC,COTS_UE)
+ CiTestObj.CheckStatusUE(HTML,RAN,EPC,COTS_UE,InfraUE)
elif action == 'Build_OAI_UE':
CiTestObj.BuildOAIUE(HTML)
elif action == 'Initialize_OAI_UE':
- CiTestObj.InitializeOAIUE(HTML,RAN,EPC,COTS_UE)
+ CiTestObj.InitializeOAIUE(HTML,RAN,EPC,COTS_UE,InfraUE)
elif action == 'Terminate_OAI_UE':
- CiTestObj.TerminateOAIUE(HTML,RAN,COTS_UE,EPC)
+ CiTestObj.TerminateOAIUE(HTML,RAN,COTS_UE,EPC,InfraUE)
elif action == 'Initialize_CatM_module':
CiTestObj.InitializeCatM(HTML)
elif action == 'Terminate_CatM_module':
CiTestObj.TerminateCatM(HTML)
elif action == 'Attach_CatM_module':
- CiTestObj.AttachCatM(HTML,RAN,COTS_UE,EPC)
+ CiTestObj.AttachCatM(HTML,RAN,COTS_UE,EPC,InfraUE)
elif action == 'Detach_CatM_module':
CiTestObj.TerminateCatM(HTML)
elif action == 'Ping_CatM_module':
- CiTestObj.PingCatM(HTML,RAN,EPC,COTS_UE,EPC)
+ CiTestObj.PingCatM(HTML,RAN,EPC,COTS_UE,EPC,InfraUE)
elif action == 'Ping':
- CiTestObj.Ping(HTML,RAN,EPC,COTS_UE)
+ CiTestObj.Ping(HTML,RAN,EPC,COTS_UE, InfraUE)
elif action == 'Iperf':
- CiTestObj.Iperf(HTML,RAN,EPC,COTS_UE)
+ CiTestObj.Iperf(HTML,RAN,EPC,COTS_UE, InfraUE)
elif action == 'Reboot_UE':
CiTestObj.RebootUE(HTML,RAN,EPC)
elif action == 'Initialize_HSS':
@@ -745,6 +800,8 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
CONTAINERS.UndeployObject(HTML, RAN)
elif action == 'Cppcheck_Analysis':
SCA.CppCheckAnalysis(HTML)
+ elif action == 'Deploy_Run_PhySim':
+ PHYSIM.Deploy_PhySim(HTML, RAN)
else:
sys.exit('Invalid class (action) from xml')
if not RAN.prematureExit:
diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py
index f1f79a2435..470572f2ff 100644
--- a/ci-scripts/ran.py
+++ b/ci-scripts/ran.py
@@ -37,6 +37,8 @@ import logging
import os
import time
from multiprocessing import Process, Lock, SimpleQueue
+import yaml
+
#-----------------------------------------------------------
# OAI Testing modules
@@ -90,6 +92,8 @@ class RANManagement():
self.testCase_id = ''
self.epcPcapFile = ''
self.runtime_stats= ''
+ self.datalog_rt_stats={}
+ self.eNB_Trace = '' #if 'yes', Tshark will be launched at initialization
@@ -127,12 +131,16 @@ class RANManagement():
result = re.search('--eNBocp', self.Build_eNB_args)
if result is not None:
self.air_interface[self.eNB_instance] = 'ocp-enb'
- else:
- result = re.search('--gNB', self.Build_eNB_args)
+ else:
+ result = re.search('--RU', self.Build_eNB_args)
if result is not None:
- self.air_interface[self.eNB_instance] = 'nr-softmodem'
+ self.air_interface[self.eNB_instance] = 'oairu'
else:
- self.air_interface[self.eNB_instance] = 'lte-softmodem'
+ result = re.search('--gNB', self.Build_eNB_args)
+ if result is not None:
+ self.air_interface[self.eNB_instance] = 'nr-softmodem'
+ else:
+ self.air_interface[self.eNB_instance] = 'lte-softmodem'
# Worakround for some servers, we need to erase completely the workspace
if self.Build_eNB_forced_workspace_cleanup:
@@ -141,7 +149,7 @@ class RANManagement():
# on RedHat/CentOS .git extension is mandatory
result = re.search('([a-zA-Z0-9\:\-\.\/])+\.git', self.ranRepository)
if result is not None:
- full_ran_repo_name = self.ranRepository
+ full_ran_repo_name = self.ranRepository.replace('git/', 'git')
else:
full_ran_repo_name = self.ranRepository + '.git'
mySSH.command('mkdir -p ' + lSourcePath, '\$', 5)
@@ -184,7 +192,7 @@ class RANManagement():
mySSH.command('echo ' + lPassWord + ' | sudo -S git clean -x -d -ff', '\$', 30)
# if the commit ID is provided use it to point to it
if self.ranCommitID != '':
- mySSH.command('git checkout -f ' + self.ranCommitID, '\$', 5)
+ mySSH.command('git checkout -f ' + self.ranCommitID, '\$', 30)
# if the branch is not develop, then it is a merge request and we need to do
# the potential merge. Note that merge conflicts should already been checked earlier
if (self.ranAllowMerge):
@@ -239,7 +247,6 @@ class RANManagement():
while (count > 0) and buildOAIprocess:
mySSH.command('ps aux | grep --color=never build_ | grep -v grep', '\$', 6)
result = re.search('build_oai', mySSH.getBefore())
- print(result)
if result is None:
buildOAIprocess = False
else:
@@ -294,7 +301,7 @@ class RANManagement():
mySSH.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword)
mySSH.command('cd ' + self.eNBSourceCodePath + '/cmake_targets', '\$', 5)
#-qq quiet / -u update orcreate files
- mySSH.command('unzip -u -qq -DD tmp_build' + testcaseId + '.zip', '\$', 5)
+ mySSH.command('unzip -o -u -qq -DD tmp_build' + testcaseId + '.zip', '\$', 5)
mySSH.command('rm -f tmp_build' + testcaseId + '.zip', '\$', 5)
mySSH.close()
else:
@@ -338,6 +345,22 @@ class RANManagement():
HTML.CreateHtmlTestRow(self.air_interface[self.eNB_instance] + ' ' + self.Initialize_eNB_args, 'KO', self.pStatus)
HTML.CreateHtmlTabFooter(False)
sys.exit(1)
+ #Get pcap on S1 and X2 eNB interface, if enabled in the xml
+ #will not work for gNB at this stage
+ if ((self.air_interface[self.eNB_instance] == 'lte-softmodem') or (self.air_interface[self.eNB_instance] == 'ocp-enb')) and self.eNB_Trace=='yes':
+ mySSH.open(lIpAddr, lUserName, lPassWord)
+ mySSH.command('ip addr show | awk -f /tmp/active_net_interfaces.awk | egrep -v "lo|tun"', '\$', 5)
+ result = re.search('interfaceToUse=(?P[a-zA-Z0-9\-\_]+)done', mySSH.getBefore())
+ if result is not None:
+ eth_interface = result.group('eth_interface')
+ logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + '\u001B[0m')
+ pcapfile = 'enb_' + self.testCase_id + '_s1x2log.pcap'
+ mySSH.command('echo ' + lPassWord + ' | sudo -S rm -f /tmp/' + pcapfile , '\$', 5)
+ mySSH.command('echo $USER; nohup sudo -E tshark -i ' + eth_interface + ' -w /tmp/' + pcapfile + ' 2>&1 &','\$', 5)
+ mySSH.close()
+
+
+
# If tracer options is on, running tshark on EPC side and capture traffic b/ EPC and eNB
result = re.search('T_stdout', str(self.Initialize_eNB_args))
if (result is not None):
@@ -382,13 +405,13 @@ class RANManagement():
# do not reset board twice in IF4.5 case
result = re.search('^rru|^enb|^du.band', str(config_file))
if result is not None:
- mySSH.command('echo ' + lPassWord + ' | sudo -S uhd_find_devices', '\$', 60)
+ mySSH.command('echo ' + lPassWord + ' | sudo -S uhd_find_devices', '\$', 90)
result = re.search('type: b200', mySSH.getBefore())
if result is not None:
logging.debug('Found a B2xx device --> resetting it')
mySSH.command('echo ' + lPassWord + ' | sudo -S b2xx_fx3_utils --reset-device', '\$', 10)
# Reloading FGPA bin firmware
- mySSH.command('echo ' + lPassWord + ' | sudo -S uhd_find_devices', '\$', 60)
+ mySSH.command('echo ' + lPassWord + ' | sudo -S uhd_find_devices', '\$', 90)
# Make a copy and adapt to EPC / eNB IP addresses
mySSH.command('cp ' + full_config_file + ' ' + ci_full_config_file, '\$', 5)
localMmeIpAddr = EPC.MmeIPAddress
@@ -573,6 +596,10 @@ class RANManagement():
mySSH.command('echo ' + lPassWord + ' | sudo -S killall --signal SIGKILL -r .*-softmodem ocp-enb || true', '\$', 5)
time.sleep(5)
mySSH.command('rm -f my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5)
+ #stopping tshark (valid if eNB and enabled in xml, will not harm otherwise)
+ logging.debug('\u001B[1m Stopping tshark \u001B[0m')
+ mySSH.command('echo ' + lPassWord + ' | sudo -S killall --signal SIGKILL tshark', '\$', 5)
+ time.sleep(1)
mySSH.close()
# If tracer options is on, stopping tshark on EPC side
result = re.search('T_stdout', str(self.Initialize_eNB_args))
@@ -591,6 +618,7 @@ class RANManagement():
mySSH.close()
logging.debug('\u001B[1m Replaying RAW record file\u001B[0m')
mySSH.open(lIpAddr, lUserName, lPassWord)
+ mySSH.command('killall --signal SIGKILL record', '\$', 5)
mySSH.command('cd ' + lSourcePath + '/common/utils/T/tracer/', '\$', 5)
enbLogFile = self.eNBLogFiles[int(self.eNB_instance)]
raw_record_file = enbLogFile.replace('.log', '_record.raw')
@@ -633,6 +661,9 @@ class RANManagement():
HTML.CreateHtmlTestRow(self.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK)
else:
HTML.CreateHtmlTestRow(self.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK)
+ #display rt stats for gNB only
+ if len(self.datalog_rt_stats)!=0 and nodeB_prefix == 'g':
+ HTML.CreateHtmlDataLogTable(self.datalog_rt_stats)
self.eNBmbmsEnables[int(self.eNB_instance)] = False
self.eNBstatuses[int(self.eNB_instance)] = -1
@@ -641,9 +672,10 @@ class RANManagement():
mySSH.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword)
mySSH.command('cd ' + self.eNBSourceCodePath, '\$', 5)
mySSH.command('cd cmake_targets', '\$', 5)
+ mySSH.command('echo ' + self.eNBPassword + ' | sudo -S mv /tmp/enb_*_s1x2log.pcap .','\$',20)
mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm -f enb.log.zip', '\$', 5)
- mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip enb*.log core* enb_*record.raw enb_*.pcap enb_*txt physim_*.log', '\$', 60)
- mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap enb_*txt', '\$', 5)
+ mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip enb*.log core* enb_*record.raw enb_*.pcap enb_*txt physim_*.log *stats.log', '\$', 60)
+ mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap enb_*txt physim_*.log *stats.log', '\$', 5)
mySSH.close()
def AnalyzeLogFile_eNB(self, eNBlogFile, HTML):
@@ -698,8 +730,28 @@ class RANManagement():
real_time_stats = {}
#count "problem receiving samples" msg
pb_receiving_samples_cnt = 0
+ #count "removing UE" msg
+ removing_ue = 0
+ #NSA specific log markers
+ nsa_markers ={'SgNBReleaseRequestAcknowledge': [],'FAILURE': [], 'scgFailureInformationNR-r15': [], 'SgNBReleaseRequest': []}
+ #the datalog config file has to be loaded
+ datalog_rt_stats_file='datalog_rt_stats.yaml'
+ if (os.path.isfile(datalog_rt_stats_file)):
+ yaml_file=datalog_rt_stats_file
+ elif (os.path.isfile('ci-scripts/'+datalog_rt_stats_file)):
+ yaml_file='ci-scripts/'+datalog_rt_stats_file
+ else:
+ logging.error("Datalog RT stats yaml file cannot be found")
+ sys.exit("Datalog RT stats yaml file cannot be found")
+
+ with open(yaml_file,'r') as f:
+ datalog_rt_stats = yaml.load(f,Loader=yaml.FullLoader)
+ rt_keys = datalog_rt_stats['Ref'] #we use the keys from the Ref field
+
+ line_cnt=0 #log file line counter
for line in enb_log_file.readlines():
+ line_cnt+=1
# Runtime statistics
result = re.search('Run time:' ,str(line))
if result is not None:
@@ -857,25 +909,35 @@ class RANManagement():
#keys below are the markers we are loooking for, loop over this keys list
#everytime these markers are found in the log file, the previous ones are overwritten in the dict
#eventually we record and print only the last occurence
- keys = {'UE ID','dlsch_rounds','dlsch_total_bytes','ulsch_rounds','ulsch_total_bytes_scheduled', 'scheduling timing stats'}
+ keys = {'UE ID','dlsch_rounds','dlsch_total_bytes','ulsch_rounds','ulsch_total_bytes_scheduled'}
for k in keys:
result = re.search(k, line)
if result is not None:
#remove 1- all useless char before relevant info (ulsch or dlsch) 2- trailing char
dlsch_ulsch_stats[k]=re.sub(r'^.*\]\s+', r'' , line.rstrip())
- #real time statistics
- #same method as above
- keys = {'feprx','feptx_prec','feptx_ofdm','feptx_total','L1 Tx processing','DLSCH encoding','L1 Rx processing','PUSCH inner-receiver','PUSCH decoding'}
- for k in keys:
+ #real time statistics for gNB
+ for k in rt_keys:
result = re.search(k, line)
if result is not None:
#remove 1- all useless char before relevant info 2- trailing char
+ line=line.replace('[0m','')
tmp=re.match(rf'^.*?(\b{k}\b.*)',line.rstrip()) #from python 3.6 we can use literal string interpolation for the variable k, using rf' in the regex
real_time_stats[k]=tmp.group(1)
+
#count "problem receiving samples" msg
result = re.search('\[PHY\]\s+problem receiving samples', str(line))
if result is not None:
- pb_receiving_samples_cnt += 1
+ pb_receiving_samples_cnt += 1
+ #count "Removing UE" msg
+ result = re.search('\[MAC\]\s+Removing UE', str(line))
+ if result is not None:
+ removing_ue += 1
+
+ #nsa markers logging
+ for k in nsa_markers:
+ result = re.search(k, line)
+ if result is not None:
+ nsa_markers[k].append(line_cnt)
enb_log_file.close()
logging.debug(' File analysis completed')
@@ -884,7 +946,7 @@ class RANManagement():
else:
nodeB_prefix = 'g'
- if self.air_interface[self.eNB_instance] == 'nr-softmodem':
+ if nodeB_prefix == 'g':
if ulschReceiveOK > 0:
statMsg = nodeB_prefix + 'NB showed ' + str(ulschReceiveOK) + ' "ULSCH received ok" message(s)'
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
@@ -911,6 +973,22 @@ class RANManagement():
htmlMsg = statMsg+'\n'
logging.debug(statMsg)
htmleNBFailureMsg += htmlMsg
+ #nsa markers
+ statMsg = 'logfile line count = ' + str(line_cnt)
+ htmlMsg = statMsg+'\n'
+ logging.debug(statMsg)
+ htmleNBFailureMsg += htmlMsg
+ if len(nsa_markers['SgNBReleaseRequestAcknowledge'])!=0:
+ statMsg = 'SgNBReleaseRequestAcknowledge = ' + str(len(nsa_markers['SgNBReleaseRequestAcknowledge'])) + ' occurences , starting line ' + str(nsa_markers['SgNBReleaseRequestAcknowledge'][0])
+ else:
+ statMsg = 'SgNBReleaseRequestAcknowledge = ' + str(len(nsa_markers['SgNBReleaseRequestAcknowledge'])) + ' occurences'
+ htmlMsg = statMsg+'\n'
+ logging.debug(statMsg)
+ htmleNBFailureMsg += htmlMsg
+ statMsg = 'FAILURE = ' + str(len(nsa_markers['FAILURE'])) + ' occurences'
+ htmlMsg = statMsg+'\n'
+ logging.debug(statMsg)
+ htmleNBFailureMsg += htmlMsg
#ulsch and dlsch statistics
if len(dlsch_ulsch_stats)!=0: #check if dictionary is not empty
@@ -920,18 +998,52 @@ class RANManagement():
logging.debug(dlsch_ulsch_stats[key])
htmleNBFailureMsg += statMsg
- #real time statistics statistics
+ #real time statistics
+ datalog_rt_stats['Data']={}
if len(real_time_stats)!=0: #check if dictionary is not empty
- statMsg=''
- for key in real_time_stats: #for each dictionary key
- statMsg += real_time_stats[key] + '\n'
- logging.debug(real_time_stats[key])
- htmleNBFailureMsg += statMsg
+ 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])
+ 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])]
+ #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
+ #setting prematureExit is ok although not the best option
+ self.prematureExit=True
else:
statMsg = 'No real time stats found in the log file\n'
logging.debug('No real time stats found in the log file')
htmleNBFailureMsg += statMsg
+ else:
+ #Removing UE log
+ statMsg = '[MAC] Removing UE msg count = '+str(removing_ue)
+ htmlMsg = statMsg+'\n'
+ logging.debug(statMsg)
+ htmleNBFailureMsg += htmlMsg
+ #nsa markers
+ statMsg = 'logfile line count = ' + str(line_cnt)
+ htmlMsg = statMsg+'\n'
+ logging.debug(statMsg)
+ htmleNBFailureMsg += htmlMsg
+ if len(nsa_markers['SgNBReleaseRequest'])!=0:
+ statMsg = 'SgNBReleaseRequest = ' + str(len(nsa_markers['SgNBReleaseRequest'])) + ' occurences , starting line ' + str(nsa_markers['SgNBReleaseRequest'][0])
+ else:
+ statMsg = 'SgNBReleaseRequest = ' + str(len(nsa_markers['SgNBReleaseRequest'])) + ' occurences'
+ htmlMsg = statMsg+'\n'
+ logging.debug(statMsg)
+ htmleNBFailureMsg += htmlMsg
+ statMsg = 'scgFailureInformationNR-r15 = ' + str(len(nsa_markers['scgFailureInformationNR-r15'])) + ' occurences'
+ htmlMsg = statMsg+'\n'
+ logging.debug(statMsg)
+ htmleNBFailureMsg += htmlMsg
+
+
if uciStatMsgCount > 0:
statMsg = nodeB_prefix + 'NB showed ' + str(uciStatMsgCount) + ' "uci->stat" message(s)'
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
diff --git a/ci-scripts/ran_dashboard.py b/ci-scripts/ran_dashboard.py
index 601cda1722..4f18638e68 100644
--- a/ci-scripts/ran_dashboard.py
+++ b/ci-scripts/ran_dashboard.py
@@ -40,6 +40,8 @@ import shlex #lexical analysis
import json #json structures
import datetime #now() and date formating
from datetime import datetime
+import re
+import gitlab
#-----------------------------------------------------------
# Class Declaration
@@ -79,7 +81,7 @@ class gDashboard:
#line 2 empty
#line 3 is for the column names
i=3
- row =["MR","Created_at","Author","Title","Assignee", "Reviewer", "CAN START","IN PROGRESS","COMPLETED","OK MERGE","Merge conflicts"]
+ row =["MR","Created_at","Author","Title","Assignee", "Reviewer", "CAN START","IN PROGRESS","COMPLETED","Review Form","OK MERGE","Merge conflicts"]
self.sheet.insert_row(row, index=i, value_input_option='RAW')
#line 4 onward, MR data lines
@@ -120,10 +122,32 @@ class gDashboard:
else:
conflicts = ""
+
+ #add a column flagging that the review form is present
+ #we use gitlab API to parse the MR notes
+ gl = gitlab.Gitlab.from_config('OAI')
+ project_id = 223
+ project = gl.projects.get(project_id)
+ #get the opened MR in the project
+ mrs = project.mergerequests.list(state='opened')
+ for m in range (0,len(mrs)):
+ if mrs[m].iid==self.d[x]['iid']:#check the iid is the one we are on
+ mr_notes = mrs[m].notes.list(all=True)
+ n=0
+ found=False
+ review_form=""
+ while found==False and nUbuntu 16.04 LTS -- Summary" >> ./build_results.html
- if [ -f ./archives/cppcheck/cppcheck.xml ]
- then
- sca_summary_table_header ./archives/cppcheck/cppcheck.xml "OAI Static Code Analysis with CPPCHECK"
- sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Uninitialized variable" uninitvar
- sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Uninitialized struct member" uninitStructMember
- sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Memory leak" memleak
- sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Memory is freed twice" doubleFree
- sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Resource leak" resourceLeak
- sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Possible null pointer dereference" nullPointer
- sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Array access out of bounds" arrayIndexOutOfBounds
- sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Buffer is accessed out of bounds" bufferAccessOutOfBounds
- sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Expression depends on order of evaluation of side effects" unknownEvaluationOrder
- sca_summary_table_footer ./archives/cppcheck/cppcheck.xml
- fi
-
-# summary_table_header "OAI Build: 4G LTE eNB -- USRP option" ./archives/enb_usrp
-# summary_table_row "LTE SoftModem - Release 15" ./archives/enb_usrp/lte-softmodem.Rel15.txt "Built target lte-softmodem" ./enb_usrp_row1.html
-# summary_table_row "Coding - Release 15" ./archives/enb_usrp/coding.Rel15.txt "Built target coding" ./enb_usrp_row2.html
-# summary_table_row "OAI USRP device if - Release 15" ./archives/enb_usrp/oai_usrpdevif.Rel15.txt "Built target oai_usrpdevif" ./enb_usrp_row3.html
-# summary_table_row "OAI ETHERNET transport - Release 15" ./archives/enb_usrp/oai_eth_transpro.Rel15.txt "Built target oai_eth_transpro" ./enb_usrp_row4.html
-# summary_table_row "Parameters Lib Config - Release 15" ./archives/enb_usrp/params_libconfig.Rel15.txt "Built target params_libconfig" ./enb_usrp_row5.html
-# summary_table_row "NASMESH - Release 15" ./archives/enb_usrp/nasmesh.Rel15.txt "Built target nasmesh" ./enb_usrp_row6.html
-# summary_table_row "RB Tool - Release 15" ./archives/enb_usrp/rb_tool.Rel15.txt "Built target rb_tool" ./enb_usrp_row7.html
-# summary_table_row "RF Simulator - Release 15" ./archives/enb_usrp/rfsimulator.Rel15.txt "Built target rfsimulator" ./enb_usrp_row8.html
-# summary_table_row "TCP Bridge - Release 15" ./archives/enb_usrp/tcp_bridge_oai.Rel15.txt "Built target tcp_bridge_oai" ./enb_usrp_row9.html
-# summary_table_footer
-#
summary_table_header "OAI Build: 4G LTE eNB -- USRP option" ./archives/enb_eth
summary_table_row "LTE SoftModem - Release 15" ./archives/enb_eth/lte-softmodem.Rel15.txt "Built target lte-softmodem" ./enb_eth_row1.html
summary_table_row "Coding - Release 15" ./archives/enb_eth/coding.Rel15.txt "Built target coding" ./enb_eth_row2.html
@@ -637,48 +610,6 @@ function report_build {
summary_table_row "NVRAM - Release 15" ./archives/basic_sim/nvram.Rel15.txt "Built target nvram" ./basic_sim_row13.html
summary_table_footer
- summary_table_header "OAI Build: 4G LTE / 5G NR Physical simulators option" ./archives/phy_sim
- summary_table_row "LTE DL Simulator - Release 15" ./archives/phy_sim/dlsim.Rel15.txt "Built target dlsim" ./phy_sim_row1.html
- summary_table_row "LTE UL Simulator - Release 15" ./archives/phy_sim/ulsim.Rel15.txt "Built target ulsim" ./phy_sim_row2.html
- summary_table_row "Coding - Release 15" ./archives/phy_sim/coding.Rel15.txt "Built target coding" ./phy_sim_row3.html
- if [ -f ./archives/phy_sim/ldpctest.Rel15.txt ]
- then
- summary_table_row "NR LDPC Test - Release 15" ./archives/phy_sim/ldpctest.Rel15.txt "Built target ldpctest" ./phy_sim_row4.html
- fi
- if [ -f ./archives/phy_sim/polartest.Rel15.txt ]
- then
- summary_table_row "NR Polar Test - Release 15" ./archives/phy_sim/polartest.Rel15.txt "Built target polartest" ./phy_sim_row5.html
- fi
- if [ -f ./archives/phy_sim/nr_pbchsim.Rel15.txt ]
- then
- summary_table_row "NR PBCH Test - Release 15" ./archives/phy_sim/nr_pbchsim.Rel15.txt "Built target nr_pbchsim" ./phy_sim_row6.html
- fi
- if [ -f ./archives/phy_sim/nr_dlschsim.Rel15.txt ]
- then
- summary_table_row "NR DLSCH Test - Release 15" ./archives/phy_sim/nr_dlschsim.Rel15.txt "Built target nr_dlschsim" ./phy_sim_row7.html
- fi
- if [ -f ./archives/phy_sim/nr_pucchsim.Rel15.txt ]
- then
- summary_table_row "NR PUCCH Test - Release 15" ./archives/phy_sim/nr_pucchsim.Rel15.txt "Built target nr_pucchsim" ./phy_sim_row8.html
- fi
- if [ -f ./archives/phy_sim/smallblocktest.Rel15.txt ]
- then
- summary_table_row "NR Small Block Test - Release 15" ./archives/phy_sim/smallblocktest.Rel15.txt "Built target smallblocktest" ./phy_sim_row9.html
- fi
- if [ -f ./archives/phy_sim/nr_dlsim.Rel15.txt ]
- then
- summary_table_row "NR DL Sim Test - Release 15" ./archives/phy_sim/nr_dlsim.Rel15.txt "Built target nr_dlsim" ./phy_sim_row10.html
- fi
- if [ -f ./archives/phy_sim/nr_ulschsim.Rel15.txt ]
- then
- summary_table_row "NR ULSCH Test - Release 15" ./archives/phy_sim/nr_ulschsim.Rel15.txt "Built target nr_ulschsim" ./phy_sim_row11.html
- fi
- if [ -f ./archives/phy_sim/nr_ulsim.Rel15.txt ]
- then
- summary_table_row "NR UL Sim Test - Release 15" ./archives/phy_sim/nr_ulsim.Rel15.txt "Built target nr_ulsim" ./phy_sim_row12.html
- fi
- summary_table_footer
-
if [ -f archives/gnb_usrp/nr-softmodem.Rel15.txt ]
then
summary_table_header "OAI Build: 5G NR gNB -- USRP option" ./archives/gnb_usrp
@@ -721,13 +652,6 @@ function report_build {
echo " Details for Compilation Errors and Warnings " >> ./build_results.html
echo " " >> ./build_results.html
-# if [ -f ./enb_usrp_row1.html ] || [ -f ./enb_usrp_row2.html ] || [ -f ./enb_usrp_row3.html ] || [ -f ./enb_usrp_row4.html ]
-# then
-# for DETAILS_TABLE in `ls ./enb_usrp_row*.html`
-# do
-# cat $DETAILS_TABLE >> ./build_results.html
-# done
-# fi
if [ -f ./enb_eth_row1.html ] || [ -f ./enb_eth_row2.html ] || [ -f ./enb_eth_row3.html ] || [ -f ./enb_eth_row4.html ] || [ -f ./enb_eth_row5.html ] || [ -f ./enb_eth_row6.html ] || [ -f ./enb_eth_row7.html ] || [ -f ./enb_eth_row8.html ] || [ -f ./enb_eth_row9.html ]
then
for DETAILS_TABLE in `ls ./enb_eth_row*.html`
@@ -749,13 +673,6 @@ function report_build {
cat $DETAILS_TABLE >> ./build_results.html
done
fi
- if [ -f ./phy_sim_row1.html ] || [ -f ./phy_sim_row2.html ] || [ -f ./phy_sim_row3.html ] || [ -f ./phy_sim_row4.html ] || [ -f ./phy_sim_row5.html ] || [ -f ./phy_sim_row6.html ] || [ -f ./phy_sim_row7.html ] || [ -f ./phy_sim_row8.html ]
- then
- for DETAILS_TABLE in `ls ./phy_sim_row*.html`
- do
- cat $DETAILS_TABLE >> ./build_results.html
- done
- fi
if [ -f ./gnb_usrp_row1.html ] || [ -f ./gnb_usrp_row2.html ] || [ -f ./gnb_usrp_row3.html ] || [ -f ./gnb_usrp_row4.html ]
then
for DETAILS_TABLE in `ls ./gnb_usrp_row*.html`
@@ -770,13 +687,6 @@ function report_build {
cat $DETAILS_TABLE >> ./build_results.html
done
fi
- if [ -f ./enb_usrp_rh_row1.html ] || [ -f ./enb_usrp_rh_row2.html ] || [ -f ./enb_usrp_rh_row3.html ] || [ -f ./enb_usrp_rh_row4.html ]
- then
- for DETAILS_TABLE in `ls ./enb_usrp_rh_row*.html`
- do
- cat $DETAILS_TABLE >> ./build_results.html
- done
- fi
rm -f ./*_row*.html
echo "
" >> ./build_results.html
diff --git a/ci-scripts/reportTestLocally.sh b/ci-scripts/reportTestLocally.sh
index c4fa817b06..7290507b4e 100755
--- a/ci-scripts/reportTestLocally.sh
+++ b/ci-scripts/reportTestLocally.sh
@@ -309,14 +309,14 @@ function report_test {
NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG`
NB_UE_GOT_SYNC=`egrep -c "got sync" $UE_LOG`
NB_ENB_SYNCED_WITH_UE=`egrep -c "got UE capabilities for UE" $ENB_LOG`
- if [ $NB_ENB_GOT_SYNC -eq 1 ] && [ $NB_UE_GOT_SYNC -eq 2 ] && [ $NB_ENB_SYNCED_WITH_UE -eq 1 ]
+ if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -eq 2 ] && [ $NB_ENB_SYNCED_WITH_UE -eq 1 ]
then
echo " OK " >> ./test_simulator_results.html
else
echo " KO " >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
- if [ $NB_ENB_GOT_SYNC -eq 1 ]
+ if [ $NB_ENB_GOT_SYNC -gt 0 ]
then
echo "- eNB --> got sync " >> ./test_simulator_results.html
else
@@ -748,6 +748,82 @@ function report_test {
echo " Statistics " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
+ #SA
+ EPC_CONFIGS=("noS1")
+ TRANS_MODES=("tdd")
+ FR_MODE=("SA")
+ BW_CASES=(106)
+ for CN_CONFIG in ${EPC_CONFIGS[@]}
+ do
+ for TMODE in ${TRANS_MODES[@]}
+ do
+ for BW in ${BW_CASES[@]}
+ do
+ echo " " >> ./test_simulator_results.html
+ if [[ $CN_CONFIG =~ .*wS1.* ]]
+ then
+ echo " Test with EPC (aka withS1): ${TMODE} -- ${BW}PRB -- ${FR_MODE} " >> ./test_simulator_results.html
+ else
+ echo " Test without EPC (aka noS1): ${TMODE} -- ${BW}PRB -- ${FR_MODE} " >> ./test_simulator_results.html
+ fi
+ echo " " >> ./test_simulator_results.html
+
+
+ #SA test (--sa option)
+
+ SA_ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_gnb_sa_test.log
+ SA_UE_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_ue_sa_test.log
+ if [ -f $RA_ENB_LOG ] && [ -f $RA_UE_LOG ]
+ then
+ #get rid of full path
+ NAME_ENB=`echo $SA_ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"`
+ NAME_UE=`echo $SA_UE_LOG | sed -e "s#$ARCHIVES_LOC/##"`
+ echo " " >> ./test_simulator_results.html
+ echo " $NAME_ENB --- $NAME_UE " >> ./test_simulator_results.html
+ echo " Check if SA proc succeeded " >> ./test_simulator_results.html
+
+
+ RRC_CHECK=`egrep -c "Received rrcSetupComplete" $SA_ENB_LOG`
+ CBRA_CHECK=`egrep -c "Received Ack of RA-Msg4\. CBRA procedure succeeded" $SA_ENB_LOG`
+ SIB1_CHECK=`egrep -c "SIB1 decoded" $SA_UE_LOG`
+
+
+ if [ $RRC_CHECK -gt 0 ] && [ $CBRA_CHECK -gt 0 ] && [ $SIB1_CHECK -gt 0 ]
+ then
+ echo " OK " >> ./test_simulator_results.html
+ else
+ echo " KO " >> ./test_simulator_results.html
+ fi
+
+ echo " " >> ./test_simulator_results.html
+ if [ $RRC_CHECK -gt 0 ]
+ then
+ echo "- Received rrcSetupComplete OK " >> ./test_simulator_results.html
+ else
+ echo "- Received rrcSetupComplete KO " >> ./test_simulator_results.html
+ fi
+ if [ $CBRA_CHECK -gt 0 ]
+ then
+ echo "- CBRA procedure succeeded OK " >> ./test_simulator_results.html
+ else
+ echo "- CBRA procedure succeeded KO " >> ./test_simulator_results.html
+ fi
+ if [ $SIB1_CHECK -gt 0 ]
+ then
+ echo "- SIB1 decoded OK " >> ./test_simulator_results.html
+ else
+ echo "- SIB1 decoded KO " >> ./test_simulator_results.html
+ fi
+
+ echo " " >> ./test_simulator_results.html
+ echo " " >> ./test_simulator_results.html
+ fi
+
+ done
+ done
+ done
+
+
EPC_CONFIGS=("noS1")
TRANS_MODES=("tdd")
FR_MODE=("FR2")
diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh
index 6725d2f62b..058d64b0ba 100755
--- a/ci-scripts/runTestOnVM.sh
+++ b/ci-scripts/runTestOnVM.sh
@@ -277,6 +277,46 @@ function check_ping_result {
}
+function check_sa_result {
+ local LOC_GNB_LOG=$1
+ local LOC_UE_LOG=$2
+
+ #if log files exist
+ if [ -f $LOC_GNB_LOG ] && [ -f $LOC_UE_LOG ]
+ then
+
+ #gNB SA test
+ #console check
+ echo "Checking gNB Log for SA success"
+ egrep "Received rrcSetupComplete" $1
+ egrep "Received Ack of RA-Msg4\. CBRA procedure succeeded" $1
+
+ #script check
+ local RRC_CHECK=`egrep -c "Received rrcSetupComplete" $1`
+ local CBRA_CHECK=`egrep -c "Received Ack of RA-Msg4\. CBRA procedure succeeded" $1`
+
+ #UE SA test
+ #console check
+ echo 'Checking UE Log for SA success'
+ egrep "SIB1 decoded" $2
+ #script check
+ local SIB1_CHECK=`egrep -c "SIB1 decoded" $2`
+
+ #generate status
+ if [ $RRC_CHECK -eq 0 ] || [ $CBRA_CHECK -eq 0 ] || [ $SIB1_CHECK -eq 0 ]
+ then
+ SA_STATUS=-1
+ echo "SA test FAILED, could not find the markers"
+ fi
+ #case where log files do not exist
+ else
+ echo "SA test log files not present"
+ SA_STATUS=-1
+ fi
+
+}
+
+
function check_ra_result {
local LOC_GNB_LOG=$1
local LOC_UE_LOG=$2
@@ -964,6 +1004,12 @@ function start_l2_sim_ue {
echo "ifconfig" > $1
ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1
rm $1
+ else
+ echo "Setting Routes for all UEs"
+ echo "cd /home/ubuntu/tmp/cmake_targets/tools" > $1
+ echo "./setup_routes.sh $LOC_NB_UES" >> $1
+ ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1
+ rm $1
fi
}
@@ -1209,8 +1255,8 @@ function start_rf_sim_gnb {
local LOC_CONF_FILE=$5
# 1 is with S1 and 0 without S1 aka noS1
local LOC_S1_CONFIGURATION=$6
- #LOC_RA_TEST=1 will run the RA test check
- local LOC_RA_TEST=$7
+ #LOC_RA_SA_TEST=1 will run the RA test check ; =2 will run the SA test
+ local LOC_RA_SA_TEST=$7
if [ -e rbconfig.raw ]; then rm -f rbconfig.raw; fi
if [ -e reconfig.raw ]; then rm -f reconfig.raw; fi
@@ -1233,11 +1279,14 @@ function start_rf_sim_gnb {
echo "sudo rm -f r*config.raw" >> $1
if [ $LOC_S1_CONFIGURATION -eq 0 ]
then
- if [ $LOC_RA_TEST -eq 0 ] #no RA test => use --phy-test option
+ if [ $LOC_RA_SA_TEST -eq 0 ] #no RA test => use --phy-test option
then
- echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim --phy-test\" > ./my-nr-softmodem-run.sh " >> $1
- else #RA test => use --do-ra option
- echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --rfsim --do-ra\" > ./my-nr-softmodem-run.sh " >> $1
+ echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim --phy-test --lowmem --noS1\" > ./my-nr-softmodem-run.sh " >> $1
+ elif [ $LOC_RA_SA_TEST -eq 1 ] #RA test => use --do-ra option
+ then
+ echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --rfsim --do-ra --lowmem --noS1\" > ./my-nr-softmodem-run.sh " >> $1
+ else #SA test => use --sa option
+ echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --rfsim --sa --lowmem \" > ./my-nr-softmodem-run.sh " >> $1
fi
fi
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
@@ -1273,7 +1322,7 @@ function start_rf_sim_gnb {
fi
# check noS1 config only outside RA test (as it does not support noS1)
- if [ $LOC_S1_CONFIGURATION -eq 0 ] && [ $LOC_RA_TEST -eq 0 ]
+ if [ $LOC_S1_CONFIGURATION -eq 0 ] && [ $LOC_RA_SA_TEST -eq 0 ]
then
echo "ifconfig oaitun_enb1 | egrep -c \"inet addr\"" > $1
# Checking oaitun_enb1 interface has now an IP address
@@ -1318,8 +1367,8 @@ function start_rf_sim_nr_ue {
local LOC_FREQUENCY=$6
# 1 is with S1 and 0 without S1 aka noS1
local LOC_S1_CONFIGURATION=$7
- #LOC_RA_TEST=1 will run the RA test check
- local LOC_RA_TEST=$8
+ #LOC_RA_SA_TEST=1 will run the RA test check ; =2 will run the SA test
+ local LOC_RA_SA_TEST=$8
# Copy the RAW files from the gNB run
scp -o StrictHostKeyChecking=no rbconfig.raw ubuntu@$LOC_NR_UE_VM_IP_ADDR:/home/ubuntu/tmp
@@ -1336,11 +1385,14 @@ function start_rf_sim_nr_ue {
echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
if [ $LOC_S1_CONFIGURATION -eq 0 ]
then
- if [ $LOC_RA_TEST -eq 0 ] #no RA test => use --phy-test option
+ if [ $LOC_RA_SA_TEST -eq 0 ] #no RA test => use --phy-test option
then
echo "echo \"./nr-uesoftmodem --nokrnmod 1 --rfsim --phy-test --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/ --log_config.global_log_options level,nocolor --noS1\" > ./my-nr-softmodem-run.sh " >> $1
- else #RA test => use --do-ra option
+ elif [ $LOC_RA_SA_TEST -eq 1 ] #RA test => use --do-ra option
+ then
echo "echo \"./nr-uesoftmodem --rfsim --do-ra --log_config.global_log_options level,nocolor --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/\" > ./my-nr-softmodem-run.sh " >> $1
+ else #SA test => use --sa option
+ echo "echo \"./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa --log_config.global_log_options level,nocolor\" > ./my-nr-softmodem-run.sh " >> $1
fi
fi
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
@@ -1375,7 +1427,7 @@ function start_rf_sim_nr_ue {
echo "RF-SIM NR-UE is sync'ed w/ gNB"
fi
# Checking oaitun_ue1 interface has now an IP address (only outside RA test)
- if [ $LOC_RA_TEST -eq 0 ]
+ if [ $LOC_RA_SA_TEST -eq 0 ]
then
i="0"
echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1
@@ -1478,13 +1530,13 @@ function run_test_on_vm {
echo "$VM_NAME has for IP addr = $VM_IP_ADDR"
fi
- if [ "$RUN_OPTIONS" == "none" ]
+ if [ "$RUN_OPTIONS" == "none" ] || [[ $RUN_OPTIONS =~ .*run_exec_autotests.* ]]
then
echo "No run on VM testing for this variant currently"
return
fi
- if [[ $RUN_OPTIONS =~ .*run_exec_autotests.* ]]
+ if [[ $RUN_OPTIONS =~ .*run_XXXX_autotests.* ]]
then
echo "############################################################"
echo "Running test script on VM ($VM_NAME)"
@@ -2189,6 +2241,88 @@ function run_test_on_vm {
if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-rf-sim.* ]]
then
+ echo "############################################################"
+ echo "SA TEST"
+ echo "############################################################"
+ #SA test, attention : has a different config file from the rest of the test
+ CN_CONFIG="noS1"
+ CONF_FILE=gnb.band78.sa.fr1.106PRB.usrpb210.conf
+ S1_NOS1_CFG=0
+ PRB=106
+ FREQUENCY=3510
+
+ if [ ! -d $ARCHIVES_LOC ]
+ then
+ mkdir --parents $ARCHIVES_LOC
+ fi
+
+ local try_cnt=0
+ NR_STATUS=0
+
+ ######### start of SA TEST loop
+ while [ $try_cnt -lt 5 ] #5 because it hardly succeed within CI
+ do
+
+ SYNC_STATUS=0
+ SA_STATUS=0
+ rm -f $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}*sa_test.log
+
+ echo "############################################################"
+ echo "${CN_CONFIG} : Starting the gNB"
+ echo "############################################################"
+ CURRENT_GNB_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_gnb_sa_test.log
+ #last argument = 2 is to enable --sa for SA test
+ start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG 2
+
+ echo "############################################################"
+ echo "${CN_CONFIG} : Starting the NR-UE"
+ echo "############################################################"
+ CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue_sa_test.log
+ #last argument = 2 is to enable --sa for SA test
+ start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 2
+ if [ $NR_UE_SYNC -eq 0 ]
+ then
+ echo "Problem w/ gNB and NR-UE not syncing"
+ terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2
+ terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1
+ scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC
+ scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC
+ SYNC_STATUS=-1
+ try_cnt=$((try_cnt+1))
+ continue
+ fi
+
+ echo "############################################################"
+ echo "${CN_CONFIG} : Terminate gNB/NR-UE simulators"
+ echo "############################################################"
+ sleep 20
+ terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2
+ terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1
+ scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC
+ scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC
+
+ #check SA markers in gNB and NR UE log files
+ echo "############################################################"
+ echo "${CN_CONFIG} : Checking SA on gNB / NR-UE"
+ echo "############################################################"
+
+ # Proper check to be done when SA test is working!
+ check_sa_result $ARCHIVES_LOC/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC/$CURRENT_NR_UE_LOG_FILE
+ if [ $SA_STATUS -ne 0 ]
+ then
+ echo "SA test NOT OK"
+ echo "try_cnt = " $try_cnt
+ try_cnt=$((try_cnt+1))
+ else
+ try_cnt=$((try_cnt+10))
+ fi
+ done
+ ########### end SA test
+
+ sleep 30
+
+
+
echo "############################################################"
echo "RA TEST FR2"
echo "############################################################"
@@ -2493,6 +2627,7 @@ function run_test_on_vm {
echo "Checking run status"
echo "############################################################"
+ if [ $SA_STATUS -ne 0 ]; then NR_STATUS=-1; fi
if [ $RA_FR2_STATUS -ne 0 ]; then NR_STATUS=-1; fi
if [ $RA_STATUS -ne 0 ]; then NR_STATUS=-1; fi
if [ $SYNC_STATUS -ne 0 ]; then NR_STATUS=-1; fi
diff --git a/ci-scripts/sshconnection.py b/ci-scripts/sshconnection.py
index 5bfe5da70f..b4087c9695 100644
--- a/ci-scripts/sshconnection.py
+++ b/ci-scripts/sshconnection.py
@@ -35,6 +35,7 @@ import pexpect # pexpect
import logging
import time # sleep
import re
+import subprocess
import sys
#-----------------------------------------------------------
@@ -44,6 +45,9 @@ class SSHConnection():
def __init__(self):
self.ssh = ''
self.picocom_closure = False
+ self.ipaddress = ''
+ self.username = ''
+ self.cmd2Results = ''
def disablePicocomClosure(self):
self.picocom_closure = False
@@ -98,6 +102,8 @@ class SSHConnection():
pass
else:
sys.exit('SSH Connection Failed')
+ self.ipaddress = ipaddress
+ self.username = username
@@ -111,11 +117,20 @@ class SSHConnection():
self.sshresponse = self.ssh.expect(expected)
return self.sshresponse
- def command(self, commandline, expectedline, timeout):
- logging.debug(commandline)
+ def command(self, commandline, expectedline, timeout, silent=False, resync=False):
+ if not silent:
+ logging.debug(commandline)
self.ssh.timeout = timeout
- self.ssh.sendline(commandline)
- self.sshresponse = self.ssh.expect([expectedline, pexpect.EOF, pexpect.TIMEOUT])
+ # Nasty patch when pexpect output is out of sync.
+ # Much pronounced when running back-to-back-back oc commands
+ if resync:
+ self.ssh.send(commandline)
+ self.ssh.expect([commandline, pexpect.TIMEOUT])
+ self.ssh.send('\r\n')
+ self.sshresponse = self.ssh.expect([expectedline, pexpect.EOF, pexpect.TIMEOUT])
+ else:
+ self.ssh.sendline(commandline)
+ self.sshresponse = self.ssh.expect([expectedline, pexpect.EOF, pexpect.TIMEOUT])
if self.sshresponse == 0:
return 0
elif self.sshresponse == 1:
@@ -137,10 +152,23 @@ class SSHConnection():
logging.debug('Expected Line : ' + expectedline)
sys.exit(self.sshresponse)
+ def command2(self, commandline, timeout, silent=False):
+ if not silent:
+ logging.debug(commandline)
+ self.cmd2Results = ''
+ myHost = self.username + '@' + self.ipaddress
+ # CAUTION: THIS METHOD IMPLIES THAT THERE ARE VALID SSH KEYS
+ # BETWEEN THE PYTHON EXECUTOR NODE AND THE REMOTE HOST
+ # OTHERWISE IT WON'T WORK
+ lSsh = subprocess.Popen(["ssh", "%s" % myHost, commandline],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+ self.cmd2Results = str(lSsh.stdout.readlines())
+
def close(self):
self.ssh.timeout = 5
self.ssh.sendline('exit')
self.sshresponse = self.ssh.expect([pexpect.EOF, pexpect.TIMEOUT])
+ self.ipaddress = ''
+ self.username = ''
if self.sshresponse == 0:
pass
elif self.sshresponse == 1:
diff --git a/ci-scripts/waitBuildOnVM.sh b/ci-scripts/waitBuildOnVM.sh
index f7e300edf4..4a604a1fe9 100755
--- a/ci-scripts/waitBuildOnVM.sh
+++ b/ci-scripts/waitBuildOnVM.sh
@@ -47,7 +47,7 @@ function wait_on_vm_build {
echo "ARCHIVES_LOC = $ARCHIVES_LOC"
echo "BUILD_OPTIONS = $BUILD_OPTIONS"
- if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]]
+ if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]]
then
echo "This VM type is no longer supported in the pipeline framework"
return
@@ -93,7 +93,7 @@ function wait_on_vm_build {
}
function check_on_vm_build {
- if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]]
+ if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]]
then
echo "This VM type is no longer supported in the pipeline framework"
return
diff --git a/ci-scripts/xml_class_list.yml b/ci-scripts/xml_class_list.yml
index de16116124..2282e101e5 100755
--- a/ci-scripts/xml_class_list.yml
+++ b/ci-scripts/xml_class_list.yml
@@ -38,3 +38,4 @@
- Deploy_Object
- Undeploy_Object
- Cppcheck_Analysis
+ - Deploy_Run_PhySim
\ No newline at end of file
diff --git a/ci-scripts/xml_files/benetel_nsa_base.xml b/ci-scripts/xml_files/benetel_nsa_quectel.xml
similarity index 72%
rename from ci-scripts/xml_files/benetel_nsa_base.xml
rename to ci-scripts/xml_files/benetel_nsa_quectel.xml
index 0aed28dffa..ed93f59e81 100644
--- a/ci-scripts/xml_files/benetel_nsa_base.xml
+++ b/ci-scripts/xml_files/benetel_nsa_quectel.xml
@@ -21,49 +21,40 @@
-->
- TEST-FR1-TM1
- FR1
+ TEST-NSA-FR1-TM1
+ NSA Ping DL UL with QUECTEL
tasks
+ 3
- 010000
030000
040000
- 010001
- 000001
+ 000002
+ 010000
050000
050001
000001
- 060000
- 060001
- 000001
070000
+ 000001
070001
+ 000001
010002
000001
080001
080000
- 010003
Initialize_UE
- Initialize UE
+ Initialize Quectel
+ idefix
-
- Terminate_UE
- Terminate UE
-
-
-
- Attach_UE
- Attach UE
-
Detach_UE
Detach UE
+ idefix
@@ -74,27 +65,35 @@
0
0
lte
-
+
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/benetel-5g.conf
+ -O ci-scripts/conf_files/benetel-5g.conf -q
1
1
nr
+ IdleSleep
+ Sleep
+ 5
+
+
+
IdleSleep
Sleep
20
+
Ping
Ping: 20pings in 20sec
+ idefix
-c 20
50
@@ -102,46 +101,32 @@
Ping
Ping: 100pings in 20sec
+ idefix
-c 100 -i 0.2
50
-
-
- Iperf
- iperf (DL/2.5Mbps/UDP)(60 sec)(single-ue profile)
- -u -b 2.5M -t 60 -i 1
- 50
- single-ue
-
-
-
- Iperf
- iperf (UL/1.5Mbps/UDP)(60 sec)(single-ue profile)
- -u -b 1.5M -t 60 -i 1 -R
- 50
- single-ue
-
-
-
Iperf
- iperf (DL/20Mbps/UDP)(20 sec)(single-ue profile)
- -u -b 20M -t 20 -i 1
+ iperf (DL/20Mbps/UDP)(60 sec)(single-ue profile)
+ -u -b 20M -t 60 -i 1
+ DL
+ idefix
50
single-ue
Iperf
- iperf (UL/3Mbps/UDP)(20 sec)(single-ue profile)
- -u -b 3M -t 20 -i 1 -R
+ iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile)
+ -u -b 3M -t 60 -i 1
+ UL
+ idefix
50
single-ue
-
Terminate_eNB
Terminate eNB
diff --git a/ci-scripts/xml_files/benetel_nsa_quectel_longrun.xml b/ci-scripts/xml_files/benetel_nsa_quectel_longrun.xml
new file mode 100644
index 0000000000..93c0c5a00a
--- /dev/null
+++ b/ci-scripts/xml_files/benetel_nsa_quectel_longrun.xml
@@ -0,0 +1,149 @@
+
+
+ TEST-NSA-FR1-TM1
+ NSA Ping DL UL with QUECTEL
+ tasks
+ 3
+
+ 030000
+ 040000
+ 000002
+ 010000
+ 000001
+ 050000
+ 050001
+ 000001
+ 070000
+ 000001
+ 070001
+ 000001
+ 010002
+ 000001
+ 080001
+ 080000
+
+
+
+
+
+ Initialize_UE
+ Initialize Quectel
+ idefix
+
+
+
+
+ Detach_UE
+ Detach UE
+ idefix
+
+
+
+
+ Initialize_eNB
+ Initialize eNB
+ -O ci-scripts/conf_files/benetel-4g.conf
+ 0
+ 0
+ lte
+
+
+
+
+ Initialize_eNB
+ Initialize gNB
+ -O ci-scripts/conf_files/benetel-5g.conf -q
+ 1
+ 1
+ nr
+
+
+
+ IdleSleep
+ Sleep
+ 10
+
+
+
+ IdleSleep
+ Sleep
+ 30
+
+
+
+
+ Ping
+ Ping: 20pings in 20sec
+ idefix
+ -c 20
+ 50
+
+
+
+ Ping
+ Ping: 100pings in 20sec
+ idefix
+ -c 100 -i 0.2
+ 50
+
+
+
+ Iperf
+ iperf (DL/20Mbps/UDP)(20 min)(single-ue profile)
+ -u -b 20M -t 1200 -i 1
+ DL
+ idefix
+ 50
+ single-ue
+
+
+
+ Iperf
+ iperf (UL/3Mbps/UDP)(20 min)(single-ue profile)
+ -u -b 2M -t 1200 -i 1
+ UL
+ idefix
+ 50
+ single-ue
+
+
+
+
+ Terminate_eNB
+ Terminate eNB
+ 0
+ 0
+ lte
+
+
+
+ Terminate_eNB
+ Terminate gNB
+ 1
+ 1
+ nr
+
+
+
+
diff --git a/ci-scripts/xml_files/container_image_build.xml b/ci-scripts/xml_files/container_image_build.xml
index 430729c49c..e7eabc0794 100644
--- a/ci-scripts/xml_files/container_image_build.xml
+++ b/ci-scripts/xml_files/container_image_build.xml
@@ -35,6 +35,7 @@
all
0
0
+ True
diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_build.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_build.xml
index 64c3517166..bfaaceaa2d 100644
--- a/ci-scripts/xml_files/enb_ue_usrp210_band7_build.xml
+++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_build.xml
@@ -32,7 +32,7 @@
Build_eNB
Build eNB (USRP)
- -w USRP -c --eNB
+ -w USRP -c --eNB --ninja
diff --git a/ci-scripts/xml_files/enb_usrp210_band13_build.xml b/ci-scripts/xml_files/enb_usrp210_band13_build.xml
index 888a1230ae..53066573c8 100644
--- a/ci-scripts/xml_files/enb_usrp210_band13_build.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band13_build.xml
@@ -33,7 +33,7 @@
Build_eNB
Build eNB (USRP)
- -w USRP -c --eNB
+ -w USRP -c --eNB --ninja
diff --git a/ci-scripts/xml_files/enb_usrp210_band40_build.xml b/ci-scripts/xml_files/enb_usrp210_band40_build.xml
index 64c3517166..bfaaceaa2d 100644
--- a/ci-scripts/xml_files/enb_usrp210_band40_build.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band40_build.xml
@@ -32,7 +32,7 @@
Build_eNB
Build eNB (USRP)
- -w USRP -c --eNB
+ -w USRP -c --eNB --ninja
diff --git a/ci-scripts/xml_files/enb_usrp210_band7_build.xml b/ci-scripts/xml_files/enb_usrp210_band7_build.xml
index 64c3517166..bfaaceaa2d 100644
--- a/ci-scripts/xml_files/enb_usrp210_band7_build.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band7_build.xml
@@ -32,7 +32,7 @@
Build_eNB
Build eNB (USRP)
- -w USRP -c --eNB
+ -w USRP -c --eNB --ninja
diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml
new file mode 100644
index 0000000000..7ec3a5f140
--- /dev/null
+++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml
@@ -0,0 +1,149 @@
+
+
+ TEST-NSA-FR1-TM1
+ NSA Ping DL UL with QUECTEL
+ tasks
+ 1
+
+ 030000
+ 040000
+ 000002
+ 010000
+ 000001
+ 050000
+ 050001
+ 000001
+ 070000
+ 000001
+ 070001
+ 000001
+ 010002
+ 080001
+ 080000
+
+
+
+
+ Initialize_UE
+ Initialize Quectel
+ idefix
+ yes
+
+
+
+
+ Terminate_UE
+ Terminate Quectel
+ idefix
+
+
+
+
+ Initialize_eNB
+ Initialize eNB
+ -O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf
+ 0
+ 0
+ lte
+ yes
+
+
+
+
+ Initialize_eNB
+ Initialize gNB
+ -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q
+ 1
+ 1
+ nr
+
+
+
+ IdleSleep
+ Sleep
+ 5
+
+
+
+ IdleSleep
+ Sleep
+ 20
+
+
+
+
+ Ping
+ Ping: 20pings in 20sec
+ idefix
+ -c 20
+ 50
+
+
+
+ Ping
+ Ping: 100pings in 20sec
+ idefix
+ -c 100 -i 0.2
+ 50
+
+
+
+ Iperf
+ iperf (DL/20Mbps/UDP)(60 sec)(single-ue profile)
+ -u -b 20M -t 60
+ DL
+ idefix
+ 50
+ single-ue
+
+
+
+ Iperf
+ iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile)
+ -u -b 3M -t 60
+ UL
+ idefix
+ 50
+ single-ue
+
+
+
+
+ Terminate_eNB
+ Terminate eNB
+ 0
+ 0
+ lte
+
+
+
+ Terminate_eNB
+ Terminate gNB
+ 1
+ 1
+ nr
+
+
+
+
diff --git a/ci-scripts/xml_files/fr1_nsa_base_ref.xml b/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml
similarity index 76%
rename from ci-scripts/xml_files/fr1_nsa_base_ref.xml
rename to ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml
index fd47db10b2..2263f731c5 100644
--- a/ci-scripts/xml_files/fr1_nsa_base_ref.xml
+++ b/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml
@@ -22,48 +22,60 @@
-->
TEST-NSA-FR1-TM1
- NSA FULL
+ NSA Ping Attach Detach with QUECTEL
tasks
+ 1
- 010000
030000
040000
- 010001
+ 000002
+ 010000
000001
050000
- 050001
000001
- 060000
- 060001
+ 010004
+ 000001
+ 010003
+ 000001
+ 050000
+ 000001
+ 010004
+ 000001
+ 010003
+ 000001
+ 050000
000001
- 070000
010002
- 000001
080001
080000
- 010003
Initialize_UE
- Initialize UE
+ Initialize Quectel
+ idefix
+ yes
+
+
+
+
+ Terminate_UE
+ Terminate Quectel
+ idefix
- Terminate_UE
- Terminate UE
-
-
-
Attach_UE
- Attach UE
+ Attach Quectel
+ idefix
-
+
Detach_UE
- Detach UE
-
+ Detach Quectel
+ idefix
+
@@ -73,27 +85,36 @@
0
0
lte
-
+ yes
+
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E
+ -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q
1
1
nr
+ IdleSleep
+ Sleep
+ 5
+
+
+
IdleSleep
Sleep
20
+
Ping
Ping: 20pings in 20sec
+ idefix
-c 20
50
@@ -101,46 +122,32 @@
Ping
Ping: 100pings in 20sec
+ idefix
-c 100 -i 0.2
50
-
-
- Iperf
- iperf (DL/3Mbps/UDP)(20 sec)(single-ue profile)
- -u -b 3M -t 20 -i 1
- 50
- single-ue
-
-
-
- Iperf
- iperf (UL/1Mbps/UDP)(20 sec)(single-ue profile)
- -u -b 1M -t 20 -i 1 -R
- 50
- single-ue
-
-
-
Iperf
- iperf (DL/20Mbps/UDP)(20 sec)(single-ue profile)
- -u -b 20M -t 20 -i 1
+ iperf (DL/20Mbps/UDP)(60 sec)(single-ue profile)
+ -u -b 20M -t 60
+ DL
+ idefix
50
single-ue
Iperf
- iperf (UL/3Mbps/UDP)(20 sec)(single-ue profile)
- -u -b 3M -t 20 -i 1 -R
+ iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile)
+ -u -b 3M -t 60
+ UL
+ idefix
50
single-ue
-
Terminate_eNB
Terminate eNB
diff --git a/ci-scripts/xml_files/fr1_nsa_quectel_long.xml b/ci-scripts/xml_files/fr1_nsa_quectel_long.xml
new file mode 100644
index 0000000000..21ff7a63c5
--- /dev/null
+++ b/ci-scripts/xml_files/fr1_nsa_quectel_long.xml
@@ -0,0 +1,148 @@
+
+
+ TEST-NSA-FR1-TM1
+ NSA Ping DL UL with QUECTEL (Longer)
+ tasks
+ 1
+
+ 030000
+ 040000
+ 000002
+ 010000
+ 000001
+ 050000
+ 050001
+ 000001
+ 070000
+ 000001
+ 070001
+ 000001
+ 010002
+ 080001
+ 080000
+
+
+
+
+ Initialize_UE
+ Initialize Quectel
+ idefix
+
+
+
+
+ Terminate_UE
+ Terminate Quectel
+ idefix
+
+
+
+
+ Initialize_eNB
+ Initialize eNB
+ -O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf
+ 0
+ 0
+ lte
+ yes
+
+
+
+
+ Initialize_eNB
+ Initialize gNB
+ -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q
+ 1
+ 1
+ nr
+
+
+
+ IdleSleep
+ Sleep
+ 5
+
+
+
+ IdleSleep
+ Sleep
+ 20
+
+
+
+
+ Ping
+ Ping: 20pings in 20sec
+ idefix
+ -c 20
+ 50
+
+
+
+ Ping
+ Ping: 100pings in 20sec
+ idefix
+ -c 100 -i 0.2
+ 50
+
+
+
+ Iperf
+ iperf (DL/20Mbps/UDP)(600 sec)(single-ue profile)
+ -u -b 20M -t 600
+ DL
+ idefix
+ 50
+ single-ue
+
+
+
+ Iperf
+ iperf (UL/3Mbps/UDP)(600 sec)(single-ue profile)
+ -u -b 3M -t 600
+ UL
+ idefix
+ 50
+ single-ue
+
+
+
+
+ Terminate_eNB
+ Terminate eNB
+ 0
+ 0
+ lte
+
+
+
+ Terminate_eNB
+ Terminate gNB
+ 1
+ 1
+ nr
+
+
+
+
diff --git a/ci-scripts/xml_files/gnb_phytest_usrp_run.xml b/ci-scripts/xml_files/gnb_phytest_usrp_run.xml
index 00610d430e..9e798afdc4 100644
--- a/ci-scripts/xml_files/gnb_phytest_usrp_run.xml
+++ b/ci-scripts/xml_files/gnb_phytest_usrp_run.xml
@@ -24,7 +24,7 @@
gNB-PHY-Test
Run-gNB-PHY-Test
tasks
- 2
+ 3
090101 000001 090109
@@ -40,7 +40,7 @@
IdleSleep
Sleep
- 180
+ 300
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml
index ab221c918d..d383dbb61b 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml
@@ -33,7 +33,7 @@
Build_eNB
Build eNB (USRP -- Ethernet Fronthaul)
- -w USRP -c --eNB
+ -w USRP -c --eNB --ninja
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml
index ab221c918d..d383dbb61b 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml
@@ -33,7 +33,7 @@
Build_eNB
Build eNB (USRP -- Ethernet Fronthaul)
- -w USRP -c --eNB
+ -w USRP -c --eNB --ninja
diff --git a/ci-scripts/xml_files/multi_rru_band38_build.xml b/ci-scripts/xml_files/multi_rru_band38_build.xml
index ba45eab10a..1370a3a396 100644
--- a/ci-scripts/xml_files/multi_rru_band38_build.xml
+++ b/ci-scripts/xml_files/multi_rru_band38_build.xml
@@ -26,7 +26,7 @@
wrench
010101 010102 010103
- 000101 000102 000103
+ 000102 000103 000101
@@ -50,7 +50,7 @@
Build_eNB
Build Master RRU
- -w USRP -c --eNB --ninja
+ -w USRP -c --RU --ninja
1
1
True
@@ -59,7 +59,7 @@
WaitEndBuild_eNB
Wait for end of Build Master RRU
- -w USRP -c --eNB --ninja
+ -w USRP -c --RU --ninja
1
1
@@ -67,7 +67,7 @@
Build_eNB
Build Slave RRU
- -w USRP -c --eNB --ninja
+ -w USRP -c --RU --ninja
2
2
True
@@ -76,7 +76,7 @@
WaitEndBuild_eNB
Wait for end of Build Slave RRU
- -w USRP -c --eNB --ninja
+ -w USRP -c --RU --ninja
2
2
diff --git a/ci-scripts/xml_files/physim_deploy_run.xml b/ci-scripts/xml_files/physim_deploy_run.xml
new file mode 100644
index 0000000000..63152c1fb5
--- /dev/null
+++ b/ci-scripts/xml_files/physim_deploy_run.xml
@@ -0,0 +1,37 @@
+
+
+ build-tab
+ Physical Simulators Check
+ wrench
+
+ 010201
+
+
+
+
+ Deploy_Run_PhySim
+ Deploy and run physical simulator on openshift
+
+
+
diff --git a/ci-scripts/xml_files/x2ho_enb_usrp210_band13_build.xml b/ci-scripts/xml_files/x2ho_enb_usrp210_band13_build.xml
index c5a912a33d..0ac6bfcc0d 100644
--- a/ci-scripts/xml_files/x2ho_enb_usrp210_band13_build.xml
+++ b/ci-scripts/xml_files/x2ho_enb_usrp210_band13_build.xml
@@ -42,7 +42,7 @@
Build_eNB
Build Slave eNB (USRP)
- -w USRP -c --eNB
+ -w USRP -c --eNB --ninja
1
1
diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt
index b1f5fb5ab3..e7c2cbc6cd 100644
--- a/cmake_targets/CMakeLists.txt
+++ b/cmake_targets/CMakeLists.txt
@@ -62,6 +62,8 @@ elseif (${RF_BOARD} STREQUAL "OAI_IRIS")
endif (${RF_BOARD} STREQUAL "OAI_USRP")
+message("RU=${RU}")
+
pkg_search_module(OPENPGM openpgm-5.1 openpgm-5.2)
if(NOT ${OPENPGM_FOUND})
message("PACKAGE openpgm-5.1 is required by binaries such as oaisim: will fail later if this target is built")
@@ -318,7 +320,7 @@ if (CUDA_FOUND)
set(CUDA_CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic -std=c++11 -D CUDA_FLAG"
)
-
+
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -D${MKVER} -D CUDA_FLAG"
)
@@ -412,7 +414,6 @@ add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs
add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace")
add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace")
add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
-add_boolean_option(NEW_GTPU True "NEW_GTP")
set (OCP_ITTI ${OPENAIR_DIR}/common/utils/ocp_itti)
add_library(ITTI
@@ -437,7 +438,6 @@ set(asn1_generated_dir ${OPENAIR_BIN_DIR})
set(protoc_call "${OPENAIR_CMAKE}/tools/generate_protobuf")
set(protobuf_generated_dir ${OPENAIR_BIN_DIR})
-
# RRC
######
set (RRC_ASN1_VERSION "Rel15")
@@ -448,15 +448,18 @@ add_definitions(-DLTE_RRC_VERSION=${LTE_RRC_VERSION})
set (RRC_FULL_DIR ${asn1_generated_dir}/RRC_${RRC_ASN1_VERSION})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
-execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${RRC_FULL_DIR}" "${RRC_GRAMMAR}" "LTE_"
- RESULT_VARIABLE ret)
+if (${RU} STREQUAL 0)
+ execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "LTE_" " " "${RRC_FULL_DIR}" "${RRC_GRAMMAR}"
+ RESULT_VARIABLE ret)
+endif (${RU} STREQUAL 0)
+
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0)
file(GLOB rrc_source ${RRC_FULL_DIR}/*.c)
add_custom_target (
rrc_flag ALL
- ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${RRC_FULL_DIR}" "${RRC_GRAMMAR}" "LTE_"
+ ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "LTE_" " " "${RRC_FULL_DIR}" "${RRC_GRAMMAR}"
DEPENDS ${RRC_GRAMMAR}
)
@@ -477,20 +480,22 @@ add_definitions(-DNR_RRC_VERSION=${NR_RRC_VERSION})
set (NR_RRC_FULL_DIR ${asn1_generated_dir}/RRC_${NR_RRC_ASN1_VERSION})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
-execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${NR_RRC_FULL_DIR}" "${NR_RRC_GRAMMAR}" "NR_" "-findirect-choice"
- RESULT_VARIABLE ret)
+ execute_process(
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "NR_" "-findirect-choice" "${NR_RRC_FULL_DIR}" "${NR_RRC_GRAMMAR}"
+ RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error")
endif ()
file(GLOB nr_rrc_source ${NR_RRC_FULL_DIR}/*.c)
file(GLOB nr_rrc_h ${NR_RRC_FULL_DIR}/*.h)
+
add_custom_target (
nr_rrc_flag ALL
- ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${NR_RRC_FULL_DIR}" "${NR_RRC_GRAMMAR}" "NR_" "-findirect-choice"
+ ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "NR_" "-findirect-choice" "${NR_RRC_FULL_DIR}" "${NR_RRC_GRAMMAR}"
DEPENDS ${NR_RRC_GRAMMAR}
)
-add_library(NR_RRC_LIB ${nr_rrc_h} ${nr_rrc_source}
+add_library(NR_RRC_LIB ${nr_rrc_h} ${nr_rrc_source}
${OPENAIR2_DIR}/RRC/NR/MESSAGES/asn1_msg.c
)
add_dependencies(NR_RRC_LIB nr_rrc_flag)
@@ -511,18 +516,21 @@ set(S1AP_ASN_DIR ${S1AP_DIR}/MESSAGES/ASN1/${S1AP_RELEASE})
set(S1AP_C_DIR ${asn1_generated_dir}/S1AP_${S1AP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
-execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" "S1AP_" -fno-include-deps
- RESULT_VARIABLE ret)
-if (NOT ${ret} STREQUAL 0)
- message(FATAL_ERROR "${ret}: error")
-endif (NOT ${ret} STREQUAL 0)
-file(GLOB S1AP_source ${S1AP_C_DIR}/*.c)
+if (${RU} STREQUAL 0)
+ execute_process(
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "S1AP_" -fno-include-deps "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}"
+ RESULT_VARIABLE ret)
+ if (NOT ${ret} STREQUAL 0)
+ message(FATAL_ERROR "${ret}: error")
+ endif (NOT ${ret} STREQUAL 0)
+ file(GLOB S1AP_source ${S1AP_C_DIR}/*.c)
+endif (${RU} STREQUAL 0)
-add_custom_target (
- s1ap_flag ALL
- ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" "S1AP_" -fno-include-deps
- DEPENDS "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}"
-)
+ add_custom_target (
+ s1ap_flag ALL
+ ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "S1AP_" -fno-include-deps "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}"
+ DEPENDS "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}"
+ )
add_library(S1AP_LIB
${S1AP_source}
@@ -565,8 +573,9 @@ set(NGAP_ASN_DIR ${NGAP_DIR}/MESSAGES/ASN1/ASN1_files)
set(NGAP_C_DIR ${asn1_generated_dir}/NGAP_${NGAP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
-execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${NGAP_C_DIR}" "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}" "NGAP_" -fno-include-deps -findirect-choice
- RESULT_VARIABLE ret)
+execute_process(
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "NGAP_" "-fno-include-deps -findirect-choice" "${NGAP_C_DIR}" "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}"
+ RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0)
@@ -574,8 +583,8 @@ file(GLOB NGAP_source ${NGAP_C_DIR}/*.c)
add_custom_target (
ngap_flag ALL
- ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${NGAP_C_DIR}" "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}" "NGAP_" -fno-include-deps
- DEPENDS "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}"
+ ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "NGAP_" "-fno-include-deps -findirect-choice" "${NGAP_C_DIR}" "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}"
+ DEPENDS "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}"
)
add_library(NGAP_LIB
@@ -631,17 +640,20 @@ set(M2AP_ASN_DIR ${M2AP_DIR}/MESSAGES/ASN1/${M2AP_RELEASE})
set(M2AP_C_DIR ${asn1_generated_dir}/M2AP_${M2AP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
-execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${M2AP_C_DIR}" "${M2AP_ASN_DIR}/${M2AP_ASN_FILES}" "M2AP_" -fno-include-deps -DEMIT_ASN_DEBUG=1
- RESULT_VARIABLE ret)
-if (NOT ${ret} STREQUAL 0)
- message(FATAL_ERROR "${ret}: error")
-endif (NOT ${ret} STREQUAL 0)
+if (${RU} STREQUAL 0)
+ execute_process(
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M2AP_" "-fno-include-deps -DEMIT_ASN_DEBUG=1" "${M2AP_C_DIR}" "${M2AP_ASN_DIR}/${M2AP_ASN_FILES}"
+ RESULT_VARIABLE ret)
+ if (NOT ${ret} STREQUAL 0)
+ message(FATAL_ERROR "${ret}: error")
+ endif (NOT ${ret} STREQUAL 0)
+endif (${RU} STREQUAL 0)
file(GLOB M2AP_source ${M2AP_C_DIR}/*.c)
add_custom_target (
m2_flag ALL
- COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${M2AP_C_DIR}" "${M2AP_ASN_DIR}/${M2AP_ASN_FILES}" "M2AP_" -fno-include-deps
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M2AP_" "-fno-include-deps -DEMIT_ASN_DEBUG=1" "${M2AP_C_DIR}" "${M2AP_ASN_DIR}/${M2AP_ASN_FILES}"
DEPENDS ${M2AP_ASN_DIR}/${M2AP_ASN_FILES}
)
@@ -701,17 +713,20 @@ set(M3AP_ASN_DIR ${M3AP_DIR}/MESSAGES/ASN1/${M3AP_RELEASE})
set(M3AP_C_DIR ${asn1_generated_dir}/M3AP_${M3AP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
-execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${M3AP_C_DIR}" "${M3AP_ASN_DIR}/${M3AP_ASN_FILES}" "M3AP_" -fno-include-deps
- RESULT_VARIABLE ret)
-if (NOT ${ret} STREQUAL 0)
- message(FATAL_ERROR "${ret}: error")
-endif (NOT ${ret} STREQUAL 0)
+if (${RU} STREQUAL 0)
+ execute_process(
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M3AP_" -fno-include-deps "${M3AP_C_DIR}" "${M3AP_ASN_DIR}/${M3AP_ASN_FILES}"
+ RESULT_VARIABLE ret)
+ if (NOT ${ret} STREQUAL 0)
+ message(FATAL_ERROR "${ret}: error")
+ endif (NOT ${ret} STREQUAL 0)
+endif (${RU} STREQUAL 0)
file(GLOB M3AP_source ${M3AP_C_DIR}/*.c)
add_custom_target (
m3_flag ALL
- COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${M3AP_C_DIR}" "${M3AP_ASN_DIR}/${M3AP_ASN_FILES}" "M3AP_" -fno-include-deps
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M3AP_" -fno-include-deps "${M3AP_C_DIR}" "${M3AP_ASN_DIR}/${M3AP_ASN_FILES}"
DEPENDS ${M3AP_ASN_DIR}/${M3AP_ASN_FILES}
)
@@ -755,17 +770,20 @@ add_definitions(-DX2AP_VERSION=${X2AP_VERSION})
set(X2AP_ASN_DIR ${X2AP_DIR}/MESSAGES/ASN1/${X2AP_RELEASE})
set(X2AP_C_DIR ${asn1_generated_dir}/X2AP_${X2AP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
-execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${X2AP_C_DIR}" "${X2AP_ASN_DIR}/${X2AP_ASN_FILES}" "X2AP_" -fno-include-deps
- RESULT_VARIABLE ret)
-if (NOT ${ret} STREQUAL 0)
- message(FATAL_ERROR "${ret}: error")
-endif (NOT ${ret} STREQUAL 0)
+if (${RU} STREQUAL 0)
+ execute_process(
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "X2AP_" -fno-include-deps "${X2AP_C_DIR}" "${X2AP_ASN_DIR}/${X2AP_ASN_FILES}"
+ RESULT_VARIABLE ret)
+ if (NOT ${ret} STREQUAL 0)
+ message(FATAL_ERROR "${ret}: error")
+ endif (NOT ${ret} STREQUAL 0)
+endif (${RU} STREQUAL 0)
file(GLOB X2AP_source ${X2AP_C_DIR}/*.c)
add_custom_target (
x2_flag ALL
- COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${X2AP_C_DIR}" "${X2AP_ASN_DIR}/${X2AP_ASN_FILES}" "X2AP_" -fno-include-deps
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "X2AP_" -fno-include-deps "${X2AP_C_DIR}" "${X2AP_ASN_DIR}/${X2AP_ASN_FILES}"
DEPENDS ${X2AP_ASN_DIR}/${X2AP_ASN_FILES}
)
@@ -794,6 +812,7 @@ add_dependencies(X2AP_ENB X2AP_LIB rrc_flag x2_flag)
# F1AP
##############
+set (F1AP_RELEASE R16)
add_list1_option(F1AP_RELEASE R16 "F1AP ASN.1 grammar version" R16)
set(F1AP_DIR ${OPENAIR2_DIR}/F1AP)
if (${F1AP_RELEASE} STREQUAL "R16")
@@ -811,22 +830,28 @@ set(F1AP_ASN_FILES
${F1AP_ASN_DIR}/F1AP-Containers.asn
)
-set(F1AP_ASN_GENERATED_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR})
-message("calling ASN1C_PREFIX=F1AP_ asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}")
-execute_process(COMMAND mkdir -p ${F1AP_ASN_GENERATED_C_DIR}
- COMMAND env "ASN1C_PREFIX=F1AP_" asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}
- RESULT_VARIABLE ret
- OUTPUT_QUIET
- ERROR_QUIET)
+if (${RU} STREQUAL 0)
+ set(F1AP_ASN_GENERATED_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR})
+ message("calling ASN1C_PREFIX=F1AP_ asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}")
+ execute_process(
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "F1AP_" "-findirect-choice -fno-include-deps" ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}
+ RESULT_VARIABLE ret
+ )
-if (NOT ${ret} STREQUAL 0)
- message(FATAL_ERROR "asn1c: error")
-endif (NOT ${ret} STREQUAL 0)
+ if (NOT ${ret} STREQUAL 0)
+ message(FATAL_ERROR "asn1c: error")
+ endif (NOT ${ret} STREQUAL 0)
-file(GLOB F1AP_ASN_GENERATED_C_FILES ${F1AP_ASN_GENERATED_C_DIR}/*.c)
-add_library(F1AP_LIB
- ${F1AP_ASN_GENERATED_C_FILES}
-)
+ add_custom_target (
+ f1_flag ALL
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "F1AP_" "-findirect-choice -fno-include-deps" ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}
+ DEPENDS ${F1AP_ASN_FILES}
+ )
+ file(GLOB F1AP_ASN_GENERATED_C_FILES ${F1AP_ASN_GENERATED_C_DIR}/*.c)
+ add_library(F1AP_LIB
+ ${F1AP_ASN_GENERATED_C_FILES}
+ )
+ add_dependencies (F1AP_LIB f1_flag)
include_directories ("${F1AP_ASN_GENERATED_C_DIR}")
include_directories ("${F1AP_DIR}")
@@ -836,6 +861,7 @@ add_library(F1AP
${F1AP_C_FILES}
)
+endif (${RU} STREQUAL 0)
# Hardware dependant options
###################################
@@ -844,8 +870,6 @@ add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2"
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU")
-
-
add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET")
#NOKIA config enhancement
set (CONFIG_ROOTDIR
@@ -997,6 +1021,7 @@ add_boolean_option(PHY_TX_THREAD False "enable UE_EXPANSION w
add_boolean_option(PRE_SCD_THREAD False "enable UE_EXPANSION with max 256 UE")
add_boolean_option(UESIM_EXPANSION False "enable UESIM_EXPANSION with max 256 UE")
add_boolean_option(ITTI_SIM False "enable itti simulator")
+
########################
# Include order
##########################
@@ -1477,11 +1502,11 @@ add_dependencies(SCHED_UE_LIB rrc_flag)
set(SCHED_SRC_NR_UE
${OPENAIR1_DIR}/SCHED_NR_UE/phy_procedures_nr_ue.c
${OPENAIR1_DIR}/SCHED_NR/phy_procedures_nr_common.c
- ${OPENAIR1_DIR}/SCHED_NR_UE/fapi_nr_ue_l1.c
+ ${OPENAIR1_DIR}/SCHED_NR_UE/fapi_nr_ue_l1.c
${OPENAIR1_DIR}/SCHED_NR_UE/phy_frame_config_nr_ue.c
${OPENAIR1_DIR}/SCHED_NR_UE/harq_nr.c
${OPENAIR1_DIR}/SCHED_NR_UE/pucch_uci_ue_nr.c
- ${OPENAIR1_DIR}/SCHED_NR_UE/pucch_power_control_ue_nr.c
+ ${OPENAIR1_DIR}/SCHED_NR_UE/pucch_power_control_ue_nr.c
)
add_library(SCHED_NR_UE_LIB ${SCHED_SRC_NR_UE})
@@ -1641,7 +1666,6 @@ set(PHY_SRC_COMMON
${OPENAIR1_DIR}/PHY/CODING/viterbi_lte.c
${OPENAIR1_DIR}/PHY/INIT/init_top.c
${OPENAIR1_DIR}/PHY/INIT/lte_parms.c
- ${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c
${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c
${OPENAIR1_DIR}/PHY/TOOLS/dfts_load.c
${OPENAIR1_DIR}/PHY/TOOLS/log2_approx.c
@@ -1792,7 +1816,7 @@ set(PHY_SRC_UE
${PHY_POLARSRC}
${PHY_SMALLBLOCKSRC}
${PHY_NR_CODINGIF}
- ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/pucch_rx.c
+ ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/pucch_rx.c
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_uci_tools_common.c
)
set(PHY_NR_UE_SRC
@@ -1971,7 +1995,7 @@ set(NR_RLC_SRC
${OPENAIR2_DIR}/LAYER2/nr_rlc/nr_rlc_sdu.c
${OPENAIR2_DIR}/LAYER2/nr_rlc/nr_rlc_ue_manager.c
)
-
+
set(NR_PDCP_SRC
${OPENAIR2_DIR}/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
${OPENAIR2_DIR}/LAYER2/nr_pdcp/nr_pdcp_ue_manager.c
@@ -2004,7 +2028,7 @@ set(L2_SRC
${RRC_DIR}/L2_interface_common.c
${RRC_DIR}/L2_interface_ue.c
)
-
+
set(L2_RRC_SRC
${OPENAIR2_DIR}/LAYER2/openair2_proc.c
# ${RRC_DIR}/rrc_UE.c
@@ -2050,14 +2074,14 @@ set(L2_SRC_UE
${RRC_DIR}/L2_interface_common.c
${RRC_DIR}/L2_interface_ue.c
)
-
+
set(L2_RRC_SRC_UE
${RRC_DIR}/rrc_UE.c
${RRC_DIR}/rrc_common.c
${RRC_DIR}/L2_interface_common.c
${RRC_DIR}/L2_interface_ue.c
- )
-
+ )
+
set(NR_L2_SRC_UE
${NR_RLC_SRC}
${NR_PDCP_SRC}
@@ -2115,7 +2139,7 @@ set (MAC_SRC_UE
${MAC_DIR}/rar_tools_ue.c
${MAC_DIR}/config_ue.c
)
-
+
set (MAC_NR_SRC_UE
${NR_UE_PHY_INTERFACE_DIR}/NR_IF_Module.c
${NR_UE_MAC_DIR}/config_ue.c
@@ -2187,6 +2211,7 @@ add_library(L2_NR
${MAC_NR_SRC}
${GNB_APP_SRC}
)
+target_compile_definitions(L2_NR PUBLIC NEW_GTPU)
add_library(L2_LTE_NR
${L2_RRC_SRC}
@@ -2194,7 +2219,8 @@ add_library(L2_LTE_NR
${ENB_APP_SRC}
${MCE_APP_SRC}
)
-
+target_compile_definitions(L2_LTE_NR PUBLIC NEW_GTPU)
+
add_dependencies(L2_NR rrc_flag nr_rrc_flag s1ap_flag x2_flag)
add_library(L2_UE
@@ -2241,6 +2267,7 @@ add_library (GTPV1U_OCP
${RRC_DIR}/rrc_eNB_GTPV1U.c
${OPENAIR3_DIR}/ocp-gtpu/gtp_itf.cpp
)
+target_compile_definitions(GTPV1U_OCP PUBLIC NEW_GTPU)
add_dependencies(GTPV1U_OCP rrc_flag)
include_directories(${OPENAIR3_DIR}/ocp-gtp)
@@ -2259,12 +2286,6 @@ set (NR_GTPV1U_SRC
add_library(NR_GTPV1U ${NR_GTPV1U_SRC})
add_dependencies(NR_GTPV1U rrc_flag)
-if (${NEW_GTPU})
-set(GTPV1U GTPV1U_OCP)
-else()
-set(GTPV1U NR_GTPV1U)
-endif()
-
set (MME_APP_SRC
${OPENAIR3_DIR}/MME_APP/mme_app.c
${OPENAIR3_DIR}/MME_APP/mme_config.c
@@ -2654,7 +2675,7 @@ add_library(SIMU_COMMON
# Simulation library
##########################
-set (SIMUSRC
+set (SIMUSRC
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/multipath_channel.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/multipath_tv_channel.c
@@ -2717,7 +2738,7 @@ add_library(nrscope MODULE ${XFORMS_SOURCE_NR})
target_link_libraries(nrscope ${XFORMS_LIBRARIES})
-add_library(rfsimulator MODULE
+add_library(rfsimulator MODULE
${OPENAIR_TARGETS}/ARCH/rfsimulator/simulator.c
${OPENAIR_TARGETS}/ARCH/rfsimulator/apply_channelmod.c
${OPENAIR_TARGETS}/ARCH/rfsimulator/new_channel_sim.c
@@ -2725,7 +2746,7 @@ add_library(rfsimulator MODULE
)
target_link_libraries(rfsimulator SIMU_COMMON ${ATLAS_LIBRARIES})
-add_library(oai_iqplayer MODULE
+add_library(oai_iqplayer MODULE
${OPENAIR_TARGETS}/ARCH/iqplayer/iqplayer_lib.c
)
set(CMAKE_MODULE_PATH "${OPENAIR_DIR}/cmake_targets/tools/MODULES" "${CMAKE_MODULE_PATH}")
@@ -2795,7 +2816,7 @@ add_executable(measurement_display
${OPENAIR_DIR}/common/utils/threadPool/measurement_display.c)
target_link_libraries (measurement_display minimal_lib)
-add_executable(test5Gnas
+add_executable(test5Gnas
${OPENAIR_DIR}/openair3/TEST/test5Gnas.c
)
target_link_libraries (test5Gnas LIB_5GNAS_GNB CONFIG_LIB minimal_lib )
@@ -2820,12 +2841,15 @@ add_executable(lte-softmodem
${OPENAIR_TARGETS}/ARCH/COMMON/record_player.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
+ ${OPENAIR2_DIR}/F1AP/dummy_enb.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${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}
@@ -2836,11 +2860,11 @@ 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 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 UDP SCHED_LIB SCHED_RU_LIB
+ RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB NR_GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP 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
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_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 ${LIB_LMS_LIBRARIES})
@@ -2867,6 +2891,8 @@ add_executable(ocp-enb
${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}
@@ -2877,7 +2903,7 @@ add_dependencies(ocp-enb rrc_flag s1ap_flag x2_flag oai_iqplayer coding params_l
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 UDP SCHED_LIB SCHED_RU_LIB
+ RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB NR_GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP 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
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB}
-Wl,--end-group z dl)
@@ -2911,6 +2937,33 @@ target_link_libraries(du_test
${PROTO_AGENT_LIB} pthread UTIL ${T_LIB} dl ${ITTI_LIB}
)
+add_executable(oairu
+ ${OPENAIR_TARGETS}/RT/USER/lte-ru.c
+ ${OPENAIR_TARGETS}/RT/USER/ru_control.c
+ ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
+ ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
+ ${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
+ -Wl,--end-group z dl)
+
+target_link_libraries (oairu pthread m ${CONFIG_LIB} rt ${CMAKE_DL_LIBS} ${T_LIB})
+
+
# lte-uesoftmodem is UE implementation
#######################################
@@ -2919,9 +2972,6 @@ add_executable(lte-uesoftmodem
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c
${OPENAIR_DIR}/executables/softmodem-common.c
- ${OPENAIR_TARGETS}/RT/USER/lte-ru.c
- ${OPENAIR_TARGETS}/RT/USER/ru_control.c
- ${OPENAIR_TARGETS}/RT/USER/rfsim.c
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR_TARGETS}/ARCH/COMMON/record_player.c
@@ -2933,6 +2983,8 @@ add_executable(lte-uesoftmodem
${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}
@@ -2948,7 +3000,7 @@ 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 F1AP F1AP_LIB
- ${GTPV1U} SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON
+ NR_GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP 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
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES}
-Wl,--end-group z dl)
@@ -2979,6 +3031,8 @@ add_executable(nr-softmodem
${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
${XFORMSINTERFACE_SOURCE}
${T_SOURCE}
@@ -2987,10 +3041,11 @@ add_executable(nr-softmodem
${OPENAIR2_DIR}/ENB_APP/flexran_agent_ran_api_to_fix.c
)
+target_compile_definitions(nr-softmodem PUBLIC NEW_GTPU)
target_link_libraries (nr-softmodem
-Wl,--start-group
- UTIL HASHTABLE SCTP_CLIENT UDP 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_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
+ UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA
+ ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_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 ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB}
-Wl,--end-group z dl)
@@ -3028,8 +3083,8 @@ add_executable(ocp-gnb
target_link_libraries (ocp-gnb
-Wl,--start-group
- UTIL HASHTABLE SCTP_CLIENT UDP 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_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
+ UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA
+ ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${MSC_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 SIMU_COMMON
-Wl,--end-group z dl)
@@ -3075,7 +3130,9 @@ target_link_libraries (nr-uesoftmodem
RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP 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
NFAPI_USER_LIB MISC_NFAPI_NR_LIB S1AP_LIB S1AP_ENB
- ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE
+ ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
+ NFAPI_USER_LIB S1AP_LIB S1AP_ENB
+ ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB}
-Wl,--end-group z dl)
target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES})
@@ -3105,7 +3162,7 @@ target_link_libraries (dlsim_tm4
pthread m rt ${CONFIG_LIB} ${ATLAS_LIBRARIES} ${T_LIB}
)
-add_executable(rftest
+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
@@ -3116,7 +3173,7 @@ add_executable(rftest
)
target_link_libraries(rftest minimal_lib PHY_NR_COMMON pthread dl m forms ${T_LIB} )
-add_executable(polartest
+add_executable(polartest
${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/polartest.c
${OPENAIR_DIR}/common/utils/backtrace.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
@@ -3129,7 +3186,7 @@ target_link_libraries(polartest
m pthread ${ATLAS_LIBRARIES} dl
)
-add_executable(smallblocktest
+add_executable(smallblocktest
${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/smallblocktest.c
${OPENAIR_DIR}/common/utils/backtrace.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
@@ -3147,17 +3204,17 @@ target_link_libraries(smallblocktest
# temp_C_flag = CMAKE_C_FLAGS
#set(CMAKE_C_FLAGS " ")
-set (TEMP_C_FLAG ${CMAKE_C_FLAGS})
+set (TEMP_C_FLAG ${CMAKE_C_FLAGS})
set (CMAKE_C_FLAGS ${CUDA_CMAKE_C_FLAGS})
-set (TEMP_CXX_FLAG ${CMAKE_CXX_FLAGS})
+set (TEMP_CXX_FLAG ${CMAKE_CXX_FLAGS})
set (CMAKE_CXX_FLAGS ${CUDA_CMAKE_CXX_FLAGS})
if (CUDA_FOUND)
###################################################
-# For CUDA library
+# For CUDA library
###################################################
-
- CUDA_ADD_LIBRARY(LDPC_CU
+
+ CUDA_ADD_LIBRARY(LDPC_CU
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.cu
)
CUDA_ADD_CUFFT_TO_TARGET(LDPC_CU)
@@ -3167,14 +3224,14 @@ if (CUDA_FOUND)
${SHLIB_LOADER_SOURCES}
)
target_link_libraries(ldpctest -ldl
- -Wl,--start-group
- LDPC_CU UTIL SIMU PHY_NR CONFIG_LIB
+ -Wl,--start-group
+ LDPC_CU UTIL SIMU PHY_NR CONFIG_LIB
-Wl,--end-group
m pthread ${ATLAS_LIBRARIES} dl
)
else (CUDA_FOUND)
- add_executable(ldpctest
+ add_executable(ldpctest
${PHY_NR_CODINGIF}
${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/ldpctest.c
${T_SOURCE}
@@ -3186,21 +3243,21 @@ set (CMAKE_C_FLAGS ${TEMP_C_FLAG})
set (CMAKE_CXX_FLAGS ${TEMP_CXX_FLAG})
-# add_executable(ldpctest
+# add_executable(ldpctest
# ${PHY_NR_CODINGIF}
# ${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/ldpctest.c
# ${T_SOURCE}
# ${SHLIB_LOADER_SOURCES}
# )
-add_dependencies( ldpctest ldpc_orig ldpc_optim ldpc_optim8seg ldpc )
+add_dependencies( ldpctest ldpc_orig ldpc_optim ldpc_optim8seg ldpc )
target_link_libraries(ldpctest
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_NR PHY_COMMON PHY_NR_COMMON CONFIG_LIB -Wl,--end-group
m pthread ${ATLAS_LIBRARIES} dl
)
-add_executable(nr_dlschsim
- ${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlschsim.c
+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
@@ -3209,13 +3266,13 @@ add_executable(nr_dlschsim
${T_SOURCE}
${SHLIB_LOADER_SOURCES}
)
-target_link_libraries(nr_dlschsim
+target_link_libraries(nr_dlschsim
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl
)
-add_executable(nr_pbchsim
- ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pbchsim.c
+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
@@ -3230,8 +3287,8 @@ target_link_libraries(nr_pbchsim
)
#PUCCH ---> Prashanth
-add_executable(nr_pucchsim
- ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pucchsim.c
+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
@@ -3259,7 +3316,7 @@ add_executable(nr_dlsim
${UTIL_SRC}
${T_SOURCE}
${SHLIB_LOADER_SOURCES}
- )
+ )
target_link_libraries(nr_dlsim
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE X2AP_ENB X2AP_LIB SECU_CN NGAP_GNB -Wl,--end-group
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} ${OPENSSL_LIBRARIES} dl
@@ -3267,7 +3324,7 @@ target_link_libraries(nr_dlsim
target_compile_definitions(nr_dlsim PUBLIC -DPHYSICAL_SIMULATOR)
add_executable(nr_prachsim
- ${OPENAIR1_DIR}/SIMULATION/NR_PHY/prachsim.c
+ ${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
@@ -3279,7 +3336,7 @@ add_executable(nr_prachsim
${UTIL_SRC}
${T_SOURCE}
${SHLIB_LOADER_SOURCES})
-target_link_libraries(nr_prachsim
+target_link_libraries(nr_prachsim
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE X2AP_ENB X2AP_LIB SECU_CN NGAP_GNB -Wl,--end-group
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} ${OPENSSL_LIBRARIES} dl)
@@ -3319,13 +3376,16 @@ target_link_libraries(nr_ulsim
target_compile_definitions(nr_ulsim PUBLIC -DPHYSICAL_SIMULATOR)
foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim)
-
+
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}
@@ -3336,7 +3396,7 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr
-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_LIB} LFDS7 -Wl,--end-group
pthread m rt ${CONFIG_LIB} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl
)
-
+
endforeach(myExe)
add_executable(test_epc_generate_scenario
@@ -3348,7 +3408,7 @@ add_executable(test_epc_generate_scenario
${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 UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
+ -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP NR_GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} 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
@@ -3367,7 +3427,7 @@ add_executable(test_epc_play_scenario
)
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 UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
+ -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP NR_GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
)
@@ -3399,13 +3459,13 @@ endforeach(myExe)
if (${T_TRACER})
foreach(i
#all "add_executable" definitions (except tests, rb_tool, updatefw)
- lte-softmodem lte-uesoftmodem nr-softmodem
+ lte-softmodem lte-uesoftmodem nr-softmodem
nr-uesoftmodem dlsim dlsim_tm4 dlsim_tm7 nr-ittisim
ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim
syncsim nr_ulsim nr_dlsim nr_dlschsim nr_pbchsim nr_pucchsim
nr_ulschsim ldpctest polartest smallblocktest cu_test du_test
#all "add_library" definitions
- 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
+ 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 MSC UTIL OMG_SUMO
@@ -3413,7 +3473,7 @@ if (${T_TRACER})
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 UDP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
+ CN_UTILS NR_GTPV1U GTPV1U_OCP SCTP_CLIENT MME_APP UDP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
ldpc_orig ldpc_optim ldpc_optim8seg ldpc PROTO_AGENT dfts)
if (TARGET ${i})
add_dependencies(${i} generate_T)
@@ -3510,16 +3570,20 @@ add_executable(nr-ittisim
${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_compile_definitions(nr-ittisim PUBLIC NEW_GTPU)
target_link_libraries (nr-ittisim
-Wl,--start-group
- UTIL HASHTABLE SCTP_CLIENT UDP 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_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB
+ UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA
+ ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_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 ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB}
PHY_NR_UE SCHED_NR_UE_LIB NR_L2_UE
diff --git a/cmake_targets/at_commands/CMakeLists.txt b/cmake_targets/at_commands/CMakeLists.txt
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/README.txt b/cmake_targets/autotests/README.txt
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/core.py b/cmake_targets/autotests/core.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/log.py b/cmake_targets/autotests/log.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/openair.py b/cmake_targets/autotests/openair.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/templates/index.html b/cmake_targets/autotests/templates/index.html
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/templates/testcase_report.html b/cmake_targets/autotests/templates/testcase_report.html
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml
old mode 100644
new mode 100755
index b0511f63cc..3472b14efc
--- a/cmake_targets/autotests/test_case_list.xml
+++ b/cmake_targets/autotests/test_case_list.xml
@@ -1099,8 +1099,11 @@
(Test14: 3 PTRS, 8 Interpolated Symbols),
(Test15: 6 PTRS, 5 Interpolated Symbols),
(Test16: 11 PTRS, 0 Interpolated Symbols),
- (Test17: 2 DMRS Symbols),
- (Test18: 3 DMRS 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)
$OPENAIR_DIR/cmake_targets/build_oai
--phy_simulators -c
@@ -1124,8 +1127,11 @@
-n100 -s5 -T 2 1 2
-n100 -s5 -T 2 0 4
-n100 -s2 -U 2 0 1
- -n100 -s2 -U 2 0 2
- 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
+ -n100 -s2 -U 2 0 2
+ -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
PDSCH test OK
segmentation fault|assertion|exiting|fatal
3
@@ -1287,15 +1293,16 @@
(Test3: MCS 28 50 PRBs),
(Test4: MCS 9 217 PRBs),
(Test5: MCS 9 273 PRBs),
- (Test6: DMRS Type A, 3 DMRS, 4 PTRS, 5 Interpolated Symbols),
- (Test7: DMRS Type B, 3 DMRS, 2 PTRS, 7 Interpolated Symbols),
- (Test8: DMRS Type B, 3 DMRS, 2 PTRS, 3 Interpolated Symbols),
- (Test9: SC-FDMA, 50 PRBs),
- (Test10: SC-FDMA, 75 PRBs),
- (Test11: SC-FDMA, 216 PRBs),
- (Test12: SC-FDMA, 273 PRBs),
- (Test13: SC-FDMA, 3 DMRS),
- (Test14: MCS 16 50 PRBs 2 RX_Antenna)
+ (Test6: DMRS Type A, 2 DMRS Symbols),
+ (Test7: DMRS Type A, 3 DMRS, 4 PTRS, 5 Interpolated Symbols),
+ (Test8: DMRS Type B, 3 DMRS, 2 PTRS, 7 Interpolated Symbols),
+ (Test9: DMRS Type B, 3 DMRS, 2 PTRS, 3 Interpolated Symbols),
+ (Test10: SC-FDMA, 50 PRBs),
+ (Test11: SC-FDMA, 75 PRBs),
+ (Test12: SC-FDMA, 216 PRBs),
+ (Test13: SC-FDMA, 273 PRBs),
+ (Test14: SC-FDMA, 3 DMRS),
+ (Test15: MCS 16 50 PRBs 2 RX_Antenna)
$OPENAIR_DIR/cmake_targets/build_oai
--phy_simulators -c
@@ -1307,17 +1314,18 @@
-n100 -m28 -s20
-n100 -m9 -R217 -r217 -s5
-n100 -m9 -R273 -r273 -s5
+ -n100 -s5 -U 2 0 1
-n100 -s5 -T 2 1 2 -U 2 0 2
-n100 -s5 -T 2 2 2 -U 2 1 2
-n100 -s5 -a4 -b8 -T 2 1 2 -U 2 1 3
- -n100 -s2 -Z
- -n100 -s2 -Z -r75
- -n100 -s2 -Z -r216 -R217
- -n100 -s2 -Z -r270 -R273
- -n100 -s2 -Z -U 2 0 2
+ -n100 -s5 -Z
+ -n100 -s5 -Z -r75
+ -n50 -s5 -Z -r216 -R217
+ -n50 -s5 -Z -r270 -R273
+ -n100 -s5 -Z -U 2 0 2
-n100 -m16 -s10 -z2
- nr_ulsim.test1 nr_ulsim.test2 nr_ulsim.test3 nr_ulsim.test4 nr_ulsim.test5 nr_ulsim.test6 nr_ulsim.test7 nr_ulsim.test8 nr_ulsim.test9 nr_ulsim.test10 nr_ulsim.test11 nr_ulsim.test12 nr_ulsim.test13 nr_ulsim.test14
+ nr_ulsim.test1 nr_ulsim.test2 nr_ulsim.test3 nr_ulsim.test4 nr_ulsim.test5 nr_ulsim.test6 nr_ulsim.test7 nr_ulsim.test8 nr_ulsim.test9 nr_ulsim.test10 nr_ulsim.test11 nr_ulsim.test12 nr_ulsim.test13 nr_ulsim.test14 nr_ulsim.test15
PUSCH test OK
segmentation fault|assertion|exiting|fatal
3
diff --git a/cmake_targets/autotests/testsuite_ue_noS1.xml b/cmake_targets/autotests/testsuite_ue_noS1.xml
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/testsuite_ue_noS1_TCL.xml b/cmake_targets/autotests/testsuite_ue_noS1_TCL.xml
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/tools/lib_autotest.py b/cmake_targets/autotests/tools/lib_autotest.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/tools/lib_autotest_analyser.py b/cmake_targets/autotests/tools/lib_autotest_analyser.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/tools/wdial.bandrich.conf b/cmake_targets/autotests/tools/wdial.bandrich.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/3276.txt b/cmake_targets/autotests/v2/actions/3276.txt
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/alu_epc.bash b/cmake_targets/autotests/v2/actions/alu_epc.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/alu_epc_stop.bash b/cmake_targets/autotests/v2/actions/alu_epc_stop.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/alu_hss.bash b/cmake_targets/autotests/v2/actions/alu_hss.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/bandrich.txt b/cmake_targets/autotests/v2/actions/bandrich.txt
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/client_tcp.bash b/cmake_targets/autotests/v2/actions/client_tcp.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/client_udp.bash b/cmake_targets/autotests/v2/actions/client_udp.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/clone_repository.bash b/cmake_targets/autotests/v2/actions/clone_repository.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/compilation.bash b/cmake_targets/autotests/v2/actions/compilation.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/execution.bash b/cmake_targets/autotests/v2/actions/execution.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/execution_compile.bash b/cmake_targets/autotests/v2/actions/execution_compile.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/modem.py b/cmake_targets/autotests/v2/actions/modem.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/run_enb.bash b/cmake_targets/autotests/v2/actions/run_enb.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/server_tcp.bash b/cmake_targets/autotests/v2/actions/server_tcp.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/server_udp.bash b/cmake_targets/autotests/v2/actions/server_udp.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/start_3276.bash b/cmake_targets/autotests/v2/actions/start_3276.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/start_3276.py b/cmake_targets/autotests/v2/actions/start_3276.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/start_bandrich.bash b/cmake_targets/autotests/v2/actions/start_bandrich.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/start_bandrich.py b/cmake_targets/autotests/v2/actions/start_bandrich.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/stop_3276.py b/cmake_targets/autotests/v2/actions/stop_3276.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/stop_bandrich.py b/cmake_targets/autotests/v2/actions/stop_bandrich.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/wvdial.3276.conf b/cmake_targets/autotests/v2/actions/wvdial.3276.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/wvdial.bandrich.conf b/cmake_targets/autotests/v2/actions/wvdial.bandrich.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/alu_test.py b/cmake_targets/autotests/v2/alu_test.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/connection.py b/cmake_targets/autotests/v2/connection.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/machine_list.py b/cmake_targets/autotests/v2/machine_list.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/main.py b/cmake_targets/autotests/v2/main.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/task.py b/cmake_targets/autotests/v2/task.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/utils.py b/cmake_targets/autotests/v2/utils.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai
index 0579d00d0f..7e7556248e 100755
--- a/cmake_targets/build_oai
+++ b/cmake_targets/build_oai
@@ -70,6 +70,7 @@ NR="False"
ITTI_SIM="False"
SANITIZE_ADDRESS="False"
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope msc"
+RU=0
trap handle_ctrl_c INT
function print_help() {
@@ -104,6 +105,8 @@ Options
Makes the NR softmodem
--nrUE
Makes the NR UE softmodem
+--RU
+ Makes the OAI RRU (without full stack)
--UE
Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file
--UE-conf-nvram [configuration file]
@@ -241,28 +244,37 @@ function main() {
shift;;
--eNB)
eNB=1
+ RU=0
echo_info "Will compile eNB"
shift;;
--eNBocp)
eNBocp=1
+ RU=0
echo_info "Will compile OCP eNB"
shift;;
--gNB)
gNB=1
+ RU=0
NR="True"
echo_info "Will compile gNB"
shift;;
+ --RU)
+ RU=1
+ echo_info "Will compile RRU"
+ shift;;
-a | --agent)
echo_info "FlexRAN support is always compiled into the eNB"
shift;;
--UE)
+ RU=0
UE=1
echo_info "Will compile UE"
shift;;
--nrUE)
+ RU=0
nrUE=1
- NR="True"
rfsimNas=1
+ NR="True"
echo_info "Will compile NR UE"
shift;;
--mu)
@@ -297,6 +309,7 @@ function main() {
shift 2;;
-P | --phy_simulators)
SIMUS_PHY=1
+ RU=0
echo_info "Will compile dlsim, ulsim, ..."
shift;;
-S | --core_simulators)
@@ -465,7 +478,7 @@ function main() {
########################################################
# to be discussed
- if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$gNB" = "1" ] ; then
+ if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$gNB" = "1" -o "$RU" = "1" ] ; then
if [ "$HW" = "None" -a "$TP" = "None" ] ; then
echo_info "No local radio head and no transport protocol selected"
fi
@@ -592,7 +605,7 @@ function main() {
config_libconfig_shlib=params_libconfig
# first generate the CMakefile in the right directory
- if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$nrUE" = "1" -o "$HW" = "EXMIMO" -o "$ittiSIM" = "1" -o "$rfsimNas" = "1" ] ; then
+ if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$RU" = "1" -o "$nrUE" = "1" -o "$HW" = "EXMIMO" -o "$ittiSIM" = "1" -o "$rfsimNas" = "1" ] ; then
# softmodem compilation
@@ -616,6 +629,7 @@ function main() {
echo "set ( UE_TIMING_TRACE $UE_TIMING_TRACE )" >> $cmake_file
echo "set ( USRP_REC_PLAY $USRP_REC_PLAY )" >> $cmake_file
echo "set ( SKIP_SHARED_LIB_FLAG $SKIP_SHARED_LIB_FLAG )" >> $cmake_file
+ echo "set ( RU $RU )" >> $cmake_file
echo "set ( ITTI_SIM $ITTI_SIM )" >> $cmake_file
echo "set ( SANITIZE_ADDRESS $SANITIZE_ADDRESS )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
@@ -632,6 +646,9 @@ function main() {
if [ "$gNB" = "1" ] ; then
execlist="$execlist nr-softmodem"
fi
+ if [ "$RU" = "1" ] ; then
+ execlist="$execlist oairu"
+ fi
if [ "$UE" = 1 ] ; then
execlist="$execlist lte-uesoftmodem"
fi
@@ -660,28 +677,29 @@ function main() {
$build_dir $config_libconfig_shlib \
lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
- compilations \
- $build_dir coding \
- libcoding.so $dbin/libcoding.so
-
-
- #check if we run inside a container or not
- #IS_CONTAINER variable is defined in build_helper file
- #compile nasmesh and rb_tool only if NOT running in a container
- if [ $IS_CONTAINER -eq 0 ]
- then
- compilations \
- $build_dir nasmesh \
- CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
+ if [ "$RU" = "0" ] ; then
compilations \
- $build_dir rb_tool \
- rb_tool $dbin/rb_tool
+ $build_dir coding \
+ libcoding.so $dbin/libcoding.so
- cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin
- fi #IS_CONTAINER
+ #check if we run inside a container or not
+ #IS_CONTAINER variable is defined in build_helper file
+ #compile nasmesh and rb_tool only if NOT running in a container
+ if [ $IS_CONTAINER -eq 0 ]
+ then
+ compilations \
+ $build_dir nasmesh \
+ CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
+
+ compilations \
+ $build_dir rb_tool \
+ rb_tool $dbin/rb_tool
+
+ cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin
+ fi #IS_CONTAINER
+ fi
fi
-
fi
if [ "$UE" = 1 ] ; then
@@ -863,7 +881,7 @@ function main() {
####################################################
# Build RF device and transport protocol libraries #
####################################################
- if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$nrUE" = "1" -o "$HWLAT" = "1" ] ; then
+ if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$RU" = "1" -o "$nrUE" = "1" -o "$HWLAT" = "1" ] ; then
# build RF device libraries
if [ "$HW" != "None" ] ; then
diff --git a/cmake_targets/doxygen/CMakeLists.txt b/cmake_targets/doxygen/CMakeLists.txt
old mode 100644
new mode 100755
diff --git a/cmake_targets/epc_test/CMakeLists.template b/cmake_targets/epc_test/CMakeLists.template
old mode 100644
new mode 100755
diff --git a/cmake_targets/nas_sim_tools/CMakeLists.txt b/cmake_targets/nas_sim_tools/CMakeLists.txt
old mode 100644
new mode 100755
diff --git a/cmake_targets/phy_simulators/CMakeLists.txt b/cmake_targets/phy_simulators/CMakeLists.txt
old mode 100644
new mode 100755
index 447e90bcab..f8c659959f
--- a/cmake_targets/phy_simulators/CMakeLists.txt
+++ b/cmake_targets/phy_simulators/CMakeLists.txt
@@ -17,4 +17,5 @@ set ( UE_TIMING_TRACE False )
set ( USRP_REC_PLAY False )
set ( SKIP_SHARED_LIB_FLAG False )
set ( PHYSIM True)
+set ( RU 0)
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)
diff --git a/cmake_targets/s1c_mme_test/CMakeLists.template b/cmake_targets/s1c_mme_test/CMakeLists.template
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/Kbuild.cmake b/cmake_targets/tools/Kbuild.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/CMakeParseArguments.cmake b/cmake_targets/tools/MODULES/CMakeParseArguments.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/CMakeUserFindMySQL.cmake b/cmake_targets/tools/MODULES/CMakeUserFindMySQL.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/CMakeUserUseBison.cmake b/cmake_targets/tools/MODULES/CMakeUserUseBison.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/CMakeUserUseFlex.cmake b/cmake_targets/tools/MODULES/CMakeUserUseFlex.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindFreeDiameter.cmake b/cmake_targets/tools/MODULES/FindFreeDiameter.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindGCCXML.cmake b/cmake_targets/tools/MODULES/FindGCCXML.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindGcrypt.cmake b/cmake_targets/tools/MODULES/FindGcrypt.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindGnuTLS.cmake b/cmake_targets/tools/MODULES/FindGnuTLS.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindKbuild.cmake b/cmake_targets/tools/MODULES/FindKbuild.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindLibXml2.cmake b/cmake_targets/tools/MODULES/FindLibXml2.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindMySQL.cmake b/cmake_targets/tools/MODULES/FindMySQL.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindNettle.cmake b/cmake_targets/tools/MODULES/FindNettle.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindPostgreSQL.cmake b/cmake_targets/tools/MODULES/FindPostgreSQL.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindSCTP.cmake b/cmake_targets/tools/MODULES/FindSCTP.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/Kbuild.cmake b/cmake_targets/tools/MODULES/Kbuild.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/cmake_useful.cmake b/cmake_targets/tools/MODULES/cmake_useful.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/kbuild_system.cmake b/cmake_targets/tools/MODULES/kbuild_system.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/kmodule.cmake b/cmake_targets/tools/MODULES/kmodule.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/path_prefixes.cmake b/cmake_targets/tools/MODULES/path_prefixes.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/asn1tostruct.py b/cmake_targets/tools/asn1tostruct.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/example_enb_exmimo_mme_hss.txt b/cmake_targets/tools/example_enb_exmimo_mme_hss.txt
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/example_oaisim_enb_ue_mme_virtual.txt b/cmake_targets/tools/example_oaisim_enb_ue_mme_virtual.txt
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/exmimo2_2arxg.lime b/cmake_targets/tools/exmimo2_2arxg.lime
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/exmimo2_2brxg.lime b/cmake_targets/tools/exmimo2_2brxg.lime
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/exmimo_stop_octave.m b/cmake_targets/tools/exmimo_stop_octave.m
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff b/cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/fix_asn1.data/RRC.rel14/SystemInformation-NB-r13-IEs.h.diff b/cmake_targets/tools/fix_asn1.data/RRC.rel14/SystemInformation-NB-r13-IEs.h.diff
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/fix_asn1.data/RRC.rel14/SystemInformation-r8-IEs.h.diff b/cmake_targets/tools/fix_asn1.data/RRC.rel14/SystemInformation-r8-IEs.h.diff
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/make_asn1c_includes.sh b/cmake_targets/tools/make_asn1c_includes.sh
index 1598678a73..00c88d6497 100755
--- a/cmake_targets/tools/make_asn1c_includes.sh
+++ b/cmake_targets/tools/make_asn1c_includes.sh
@@ -1,13 +1,19 @@
#!/bin/bash
-GENERATED_FULL_DIR=$1
-shift
-ASN1_SOURCE_DIR=$1
-shift
export ASN1C_PREFIX=$1
shift
-options=$*
+options=$1
+shift
+GENERATED_FULL_DIR=$1
+shift
+ASN1_SOURCE_DIR=$*
done_flag="$GENERATED_FULL_DIR"/done
-if [ "$done_flag" -ot $ASN1_SOURCE_DIR ] ; then
+rebuild=0
+for f in $ASN1_SOURCE_DIR ; do
+ if [ "$done_flag" -ot "$f" ] ; then
+ rebuild=1
+ fi
+done
+if [ $rebuild -eq 1 ] ; then
rm -f "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}*.c "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}*.h
mkdir -p "$GENERATED_FULL_DIR"
asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example $options -D $GENERATED_FULL_DIR $ASN1_SOURCE_DIR |& egrep -v "^Copied|^Compiled" | sort -u
diff --git a/cmake_targets/tools/setup_routes.sh b/cmake_targets/tools/setup_routes.sh
new file mode 100755
index 0000000000..67fe250be7
--- /dev/null
+++ b/cmake_targets/tools/setup_routes.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+for i in $(seq 1 $1);
+do
+ let table=1000+$i
+ echo "sudo ip route add 10.0.1.0/24 dev oaitun_ue$i table $table"
+ sudo ip route add 10.0.1.0/24 dev oaitun_ue$i table $table
+ echo "sudo ip route add default via 10.0.1.1 dev oaitun_ue$i table $table"
+ sudo ip route add default via 10.0.1.1 dev oaitun_ue$i table $table
+ let octet=$i+1
+ echo "sudo ip rule add from 10.0.1.$octet table $table"
+ sudo ip rule add from 10.0.1.$octet table $table
+done
diff --git a/cmake_targets/tools/test_helper b/cmake_targets/tools/test_helper
old mode 100644
new mode 100755
diff --git a/common/config/config_cmdline.c b/common/config/config_cmdline.c
index 1df1bc16f7..f5dfae06b6 100644
--- a/common/config/config_cmdline.c
+++ b/common/config/config_cmdline.c
@@ -211,7 +211,7 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
while (c > 0 ) {
char *oneargv = strdup(config_get_if()->argv[i]); /* we use strtok_r which modifies its string paramater, and we don't want argv to be modified */
-
+ if(!oneargv) abort();
/* first check help options, either --help, -h or --help_ */
if (strncmp(oneargv, "-h",2) == 0 || strncmp(oneargv, "--help",6) == 0 ) {
char *tokctx = NULL;
diff --git a/common/ran_context.h b/common/ran_context.h
index 3f57c000a0..db981e9182 100644
--- a/common/ran_context.h
+++ b/common/ran_context.h
@@ -39,7 +39,7 @@
#include "PHY/types.h"
#include "PHY/impl_defs_top.h"
-#include "ENB_APP/enb_config.h"
+//#include "ENB_APP/enb_config.h"
#include "flexran_agent_defs.h"
#include "gtpv1u.h"
@@ -122,5 +122,5 @@ typedef struct {
pthread_cond_t ru_cond;
} RAN_CONTEXT_t;
-
+extern RAN_CONTEXT_t RC;
#endif
diff --git a/common/utils/lte/prach_utils.c b/common/utils/lte/prach_utils.c
new file mode 100644
index 0000000000..9ef29e55a5
--- /dev/null
+++ b/common/utils/lte/prach_utils.c
@@ -0,0 +1,425 @@
+/*
+ * 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 common/utils/lte/prach_utils.c
+ * \brief utils for PRACH common to both PHY and MAC
+ * \author R. Knopp
+ * \date 2020
+ * \version 0.1
+ * \company Eurecom
+ * \email: knopp@eurecom.fr
+ * \note
+ * \warning
+ */
+
+#include
+
+
+#include "PHY/LTE_TRANSPORT/transport_common.h"
+
+// This is table 5.7.1-4 from 36.211
+PRACH_TDD_PREAMBLE_MAP tdd_preamble_map[64][7] = {
+ // TDD Configuration Index 0
+ { {1,{{0,1,0,2}}},{1,{{0,1,0,1}}}, {1,{{0,1,0,0}}}, {1,{{0,1,0,2}}}, {1,{{0,1,0,1}}}, {1,{{0,1,0,0}}}, {1,{{0,1,0,2}}}},
+ // TDD Configuration Index 1
+ { {1,{{0,2,0,2}}},{1,{{0,2,0,1}}}, {1,{{0,2,0,0}}}, {1,{{0,2,0,2}}}, {1,{{0,2,0,1}}}, {1,{{0,2,0,0}}}, {1,{{0,2,0,2}}}},
+ // TDD Configuration Index 2
+ { {1,{{0,1,1,2}}},{1,{{0,1,1,1}}}, {1,{{0,1,1,0}}}, {1,{{0,1,0,1}}}, {1,{{0,1,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,1,1}}}},
+ // TDD Configuration Index 3
+ { {1,{{0,0,0,2}}},{1,{{0,0,0,1}}}, {1,{{0,0,0,0}}}, {1,{{0,0,0,2}}}, {1,{{0,0,0,1}}}, {1,{{0,0,0,0}}}, {1,{{0,0,0,2}}}},
+ // TDD Configuration Index 4
+ { {1,{{0,0,1,2}}},{1,{{0,0,1,1}}}, {1,{{0,0,1,0}}}, {1,{{0,0,0,1}}}, {1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,1,1}}}},
+ // TDD Configuration Index 5
+ { {1,{{0,0,0,1}}},{1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,1}}}},
+ // TDD Configuration Index 6
+ { {2,{{0,0,0,2},{0,0,1,2}}}, {2,{{0,0,0,1},{0,0,1,1}}}, {2,{{0,0,0,0},{0,0,1,0}}}, {2,{{0,0,0,1},{0,0,0,2}}}, {2,{{0,0,0,0},{0,0,0,1}}}, {2,{{0,0,0,0},{1,0,0,0}}}, {2,{{0,0,0,2},{0,0,1,1}}}},
+ // TDD Configuration Index 7
+ { {2,{{0,0,0,1},{0,0,1,1}}}, {2,{{0,0,0,0},{0,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,0},{0,0,0,2}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,1},{0,0,1,0}}}},
+ // TDD Configuration Index 8
+ { {2,{{0,0,0,0},{0,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,0},{0,0,0,1}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,0},{0,0,1,1}}}},
+ // TDD Configuration Index 9
+ { {3,{{0,0,0,1},{0,0,0,2},{0,0,1,2}}}, {3,{{0,0,0,0},{0,0,0,1},{0,0,1,1}}}, {3,{{0,0,0,0},{0,0,1,0},{1,0,0,0}}}, {3,{{0,0,0,0},{0,0,0,1},{0,0,0,2}}}, {3,{{0,0,0,0},{0,0,0,1},{1,0,0,1}}}, {3,{{0,0,0,0},{1,0,0,0},{2,0,0,0}}}, {3,{{0,0,0,1},{0,0,0,2},{0,0,1,1}}}},
+ // TDD Configuration Index 10
+ { {3,{{0,0,0,0},{0,0,1,0},{0,0,1,1}}}, {3,{{0,0,0,1},{0,0,1,0},{0,0,1,1}}}, {3,{{0,0,0,0},{0,0,1,0},{1,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,0},{0,0,0,1},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,0},{0,0,0,2},{0,0,1,0}}}},
+ // TDD Configuration Index 11
+ { {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,0},{0,0,0,1},{0,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,1},{0,0,1,0},{0,0,1,1}}}},
+ // TDD Configuration Index 12
+ { {4,{{0,0,0,1},{0,0,0,2},{0,0,1,1},{0,0,1,2}}}, {4,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1}}},
+ {4,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0}}},
+ {4,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,2}}},
+ {4,{{0,0,0,0},{0,0,0,1},{1,0,0,0},{1,0,0,1}}},
+ {4,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0}}},
+ {4,{{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1}}}
+ },
+ // TDD Configuration Index 13
+ { {4,{{0,0,0,0},{0,0,0,2},{0,0,1,0},{0,0,1,2}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,1}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,1}}}
+ },
+ // TDD Configuration Index 14
+ { {4,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,0},{0,0,0,2},{0,0,1,0},{0,0,1,1}}}
+ },
+ // TDD Configuration Index 15
+ { {5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,1},{0,0,1,2}}}, {5,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,0,1}}},
+ {5,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0}}}, {5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,1},{1,0,0,2}}},
+ {5,{{0,0,0,0},{0,0,0,1},{1,0,0,0},{1,0,0,1},{2,0,0,1}}}, {5,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0}}},
+ {5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1}}}
+ },
+ // TDD Configuration Index 16
+ { {5,{{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1},{0,0,1,2}}}, {5,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,1,1}}},
+ {5,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,1,0}}}, {5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,0},{1,0,0,2}}},
+ {5,{{0,0,0,0},{0,0,0,1},{1,0,0,0},{1,0,0,1},{2,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}
+ },
+ // TDD Configuration Index 17
+ { {5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,2}}}, {5,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,0},{1,0,0,1}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}
+ },
+ // TDD Configuration Index 18
+ { {6,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1},{0,0,1,2}}},
+ {6,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,0,1},{1,0,1,1}}},
+ {6,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0},{2,0,1,0}}},
+ {6,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,0},{1,0,0,1},{1,0,0,2}}},
+ {6,{{0,0,0,0},{0,0,0,1},{1,0,0,0},{1,0,0,1},{2,0,0,0},{2,0,0,1}}},
+ {6,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0},{5,0,0,0}}},
+ {6,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1},{1,0,0,2}}}
+ },
+ // TDD Configuration Index 19
+ { {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {6,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,0,0},{1,0,1,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {6,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1},{1,0,1,1}}}
+ },
+ // TDD Configuration Index 20
+ { {1,{{0,1,0,1}}},{1,{{0,1,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,0,1}}}, {1,{{0,1,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,0,1}}}},
+ // TDD Configuration Index 21
+ { {1,{{0,2,0,1}}},{1,{{0,2,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,2,0,1}}}, {1,{{0,2,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,2,0,1}}}},
+
+ // TDD Configuration Index 22
+ { {1,{{0,1,1,1}}},{1,{{0,1,1,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,1,0}}}},
+
+ // TDD Configuration Index 23
+ { {1,{{0,0,0,1}}},{1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,1}}}, {1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,1}}}},
+
+ // TDD Configuration Index 24
+ { {1,{{0,0,1,1}}},{1,{{0,0,1,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,1,0}}}},
+
+ // TDD Configuration Index 25
+ { {2,{{0,0,0,1},{0,0,1,1}}}, {2,{{0,0,0,0},{0,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,1},{1,0,0,1}}}, {2,{{0,0,0,0},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,1},{0,0,1,0}}}},
+
+ // TDD Configuration Index 26
+ { {3,{{0,0,0,1},{0,0,1,1},{1,0,0,1}}}, {3,{{0,0,0,0},{0,0,1,0},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,1},{1,0,0,1},{2,0,0,1}}}, {3,{{0,0,0,0},{1,0,0,0},{2,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,1},{0,0,1,0},{1,0,0,1}}}},
+
+ // TDD Configuration Index 27
+ { {4,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1}}}, {4,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1}}},
+ {4,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0}}}
+ },
+
+ // TDD Configuration Index 28
+ { {5,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1},{2,0,0,1}}}, {5,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {5,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1},{4,0,0,1}}},
+ {5,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {5,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0},{2,0,0,1}}}
+ },
+
+ // TDD Configuration Index 29
+ { {6,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1},{2,0,0,1},{2,0,1,1}}},
+ {6,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0},{2,0,1,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {6,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1},{4,0,0,1},{5,0,0,1}}},
+ {6,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0},{5,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {6,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0},{2,0,0,1},{2,0,1,0}}}
+ },
+
+
+ // TDD Configuration Index 30
+ { {1,{{0,1,0,1}}},{1,{{0,1,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,0,1}}}, {1,{{0,1,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,0,1}}}},
+
+ // TDD Configuration Index 31
+ { {1,{{0,2,0,1}}},{1,{{0,2,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,2,0,1}}}, {1,{{0,2,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,2,0,1}}}},
+
+ // TDD Configuration Index 32
+ { {1,{{0,1,1,1}}},{1,{{0,1,1,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,1,0}}}},
+
+ // TDD Configuration Index 33
+ { {1,{{0,0,0,1}}},{1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,1}}}, {1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,1}}}},
+
+ // TDD Configuration Index 34
+ { {1,{{0,0,1,1}}},{1,{{0,0,1,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,1,0}}}},
+
+ // TDD Configuration Index 35
+ { {2,{{0,0,0,1},{0,0,1,1}}}, {2,{{0,0,0,0},{0,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,1},{1,0,0,1}}}, {2,{{0,0,0,0},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,1},{0,0,1,0}}}},
+
+ // TDD Configuration Index 36
+ { {3,{{0,0,0,1},{0,0,1,1},{1,0,0,1}}}, {3,{{0,0,0,0},{0,0,1,0},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,1},{1,0,0,1},{2,0,0,1}}}, {3,{{0,0,0,0},{1,0,0,0},{2,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,1},{0,0,1,0},{1,0,0,1}}}},
+
+ // TDD Configuration Index 37
+ { {4,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1}}}, {4,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1}}},
+ {4,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0}}}
+ },
+
+ // TDD Configuration Index 38
+ { {5,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1},{2,0,0,1}}}, {5,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {5,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1},{4,0,0,1}}},
+ {5,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {5,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0},{2,0,0,1}}}
+ },
+
+ // TDD Configuration Index 39
+ { {6,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1},{2,0,0,1},{2,0,1,1}}},
+ {6,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0},{2,0,1,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {6,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1},{4,0,0,1},{5,0,0,1}}},
+ {6,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0},{5,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {6,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0},{2,0,0,1},{2,0,1,0}}}
+ },
+
+ // TDD Configuration Index 40
+ { {1,{{0,1,0,0}}},{0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,0,0}}}},
+ // TDD Configuration Index 41
+ { {1,{{0,2,0,0}}},{0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,2,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,2,0,0}}}},
+
+ // TDD Configuration Index 42
+ { {1,{{0,1,1,0}}},{0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}},
+
+ // TDD Configuration Index 43
+ { {1,{{0,0,0,0}}},{0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,0}}}},
+
+ // TDD Configuration Index 44
+ { {1,{{0,0,1,0}}},{0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}},
+
+ // TDD Configuration Index 45
+ { {2,{{0,0,0,0},{0,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,0},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,0},{1,0,0,0}}}},
+
+ // TDD Configuration Index 46
+ { {3,{{0,0,0,0},{0,0,1,0},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,0},{1,0,0,0},{2,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,0},{1,0,0,0},{2,0,0,0}}}},
+
+ // TDD Configuration Index 47
+ { {4,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0}}}
+ }
+};
+
+
+uint8_t get_prach_fmt(int prach_ConfigIndex,int frame_type) {
+ if (frame_type == FDD) // FDD
+ return(prach_ConfigIndex>>4);
+ else {
+ if (prach_ConfigIndex < 20)
+ return (0);
+
+ if (prach_ConfigIndex < 30)
+ return (1);
+
+ if (prach_ConfigIndex < 40)
+ return (2);
+
+ if (prach_ConfigIndex < 48)
+ return (3);
+ else
+ return (4);
+ }
+}
+
+uint8_t get_prach_prb_offset(int frame_type,
+ int tdd_config,
+ int N_RB_UL,
+ uint8_t prach_ConfigIndex,
+ uint8_t n_ra_prboffset,
+ uint8_t tdd_mapindex, uint16_t Nf) {
+ uint8_t n_ra_prb;
+ uint8_t f_ra,t1_ra;
+ uint8_t prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type);
+ uint8_t Nsp=2;
+
+ if (frame_type == TDD) { // TDD
+ if (tdd_preamble_map[prach_ConfigIndex][tdd_config].num_prach==0) {
+ LOG_E(PHY, "Illegal prach_ConfigIndex %"PRIu8"", prach_ConfigIndex);
+ return(-1);
+ }
+
+ // adjust n_ra_prboffset for frequency multiplexing (p.36 36.211)
+ f_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[tdd_mapindex].f_ra;
+
+ if (prach_fmt < 4) {
+ if ((f_ra&1) == 0) {
+ n_ra_prb = n_ra_prboffset + 6*(f_ra>>1);
+ } else {
+ n_ra_prb = N_RB_UL - 6 - n_ra_prboffset + 6*(f_ra>>1);
+ }
+ } else {
+ if ((tdd_config >2) && (tdd_config<6))
+ Nsp = 2;
+
+ t1_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t1_ra;
+
+ if ((((Nf&1)*(2-Nsp)+t1_ra)&1) == 0) {
+ n_ra_prb = 6*f_ra;
+ } else {
+ n_ra_prb = N_RB_UL - 6*(f_ra+1);
+ }
+ }
+ } else { //FDD
+ n_ra_prb = n_ra_prboffset;
+ }
+
+ return(n_ra_prb);
+}
+
+int is_prach_subframe0(int tdd_config,int frame_type,uint8_t prach_ConfigIndex,uint32_t frame, uint8_t subframe) {
+ uint8_t t0_ra;
+ uint8_t t1_ra;
+ uint8_t t2_ra;
+ int prach_mask = 0;
+
+ if (frame_type == FDD) { //FDD
+ //implement Table 5.7.1-2 from 36.211 (Rel-10, p.41)
+ if ((((frame&1) == 1) && (subframe < 9)) ||
+ (((frame&1) == 0) && (subframe == 9))) // This is an odd frame, ignore even-only PRACH frames
+ if (((prach_ConfigIndex&0xf)<3) || // 0,1,2,16,17,18,32,33,34,48,49,50
+ ((prach_ConfigIndex&0x1f)==18) || // 18,50
+ ((prach_ConfigIndex&0xf)==15)) // 15,47
+ return(0);
+
+ switch (prach_ConfigIndex&0x1f) {
+ case 0:
+ case 3:
+ if (subframe==1) prach_mask = 1;
+
+ break;
+
+ case 1:
+ case 4:
+ if (subframe==4) prach_mask = 1;
+
+ break;
+
+ case 2:
+ case 5:
+ if (subframe==7) prach_mask = 1;
+
+ break;
+
+ case 6:
+ if ((subframe==1) || (subframe==6)) prach_mask=1;
+
+ break;
+
+ case 7:
+ if ((subframe==2) || (subframe==7)) prach_mask=1;
+
+ break;
+
+ case 8:
+ if ((subframe==3) || (subframe==8)) prach_mask=1;
+
+ break;
+
+ case 9:
+ if ((subframe==1) || (subframe==4) || (subframe==7)) prach_mask=1;
+
+ break;
+
+ case 10:
+ if ((subframe==2) || (subframe==5) || (subframe==8)) prach_mask=1;
+
+ break;
+
+ case 11:
+ if ((subframe==3) || (subframe==6) || (subframe==9)) prach_mask=1;
+
+ break;
+
+ case 12:
+ if ((subframe&1)==0) prach_mask=1;
+
+ break;
+
+ case 13:
+ if ((subframe&1)==1) prach_mask=1;
+
+ break;
+
+ case 14:
+ prach_mask=1;
+ break;
+
+ case 15:
+ if (subframe==9) prach_mask=1;
+
+ break;
+ }
+ } else { // TDD
+ AssertFatal(prach_ConfigIndex<64,
+ "Illegal prach_ConfigIndex %d for ",prach_ConfigIndex);
+ AssertFatal(tdd_preamble_map[prach_ConfigIndex][tdd_config].num_prach>0,
+ "Illegal prach_ConfigIndex %d for ",prach_ConfigIndex);
+ t0_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t0_ra;
+ t1_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t1_ra;
+ t2_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t2_ra;
+#ifdef PRACH_DEBUG
+ LOG_I(PHY,"[PRACH] Checking for PRACH format (ConfigIndex %d) in TDD subframe %d (%d,%d,%d)\n",
+ prach_ConfigIndex,
+ subframe,
+ t0_ra,t1_ra,t2_ra);
+#endif
+
+ if ((((t0_ra == 1) && ((frame &1)==0))|| // frame is even and PRACH is in even frames
+ ((t0_ra == 2) && ((frame &1)==1))|| // frame is odd and PRACH is in odd frames
+ (t0_ra == 0)) && // PRACH is in all frames
+ (((subframe<5)&&(t1_ra==0)) || // PRACH is in 1st half-frame
+ (((subframe>4)&&(t1_ra==1))))) { // PRACH is in 2nd half-frame
+ if ((prach_ConfigIndex<48) && // PRACH only in normal UL subframe
+ (((subframe%5)-2)==t2_ra)) prach_mask=1;
+ else if ((prach_ConfigIndex>47) && (((subframe%5)-1)==t2_ra)) prach_mask=1; // PRACH can be in UpPTS
+ }
+ }
+
+ return(prach_mask);
+}
+
diff --git a/common/utils/lte/prach_utils.h b/common/utils/lte/prach_utils.h
new file mode 100644
index 0000000000..995805fbd2
--- /dev/null
+++ b/common/utils/lte/prach_utils.h
@@ -0,0 +1,40 @@
+/*
+ * 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 common/utils/prach_utils.h
+* \brief computation of some PRACH variables used in both MAC and PHY
+* \author R. Knopp
+* \date 2020
+* \version 0.1
+* \company Eurecom
+* \email: raymond.knopp@eurecom.fr, florian.kaltenberger@eurecom.fr, oscar.tonelli@yahoo.it
+* \note
+* \warning
+*/
+uint8_t get_prach_fmt(int prach_ConfigIndex,int frame_type);
+
+uint8_t get_prach_prb_offset(int frame_type,
+ int tdd_config,
+ int N_RB_UL,
+ uint8_t prach_ConfigIndex,
+ uint8_t n_ra_prboffset,
+ uint8_t tdd_mapindex, uint16_t Nf);
+int is_prach_subframe0(int tdd_config,int frame_type,uint8_t prach_ConfigIndex,uint32_t frame, uint8_t subframe);
diff --git a/common/utils/lte/ue_power.c b/common/utils/lte/ue_power.c
new file mode 100644
index 0000000000..b377abf2ff
--- /dev/null
+++ b/common/utils/lte/ue_power.c
@@ -0,0 +1,108 @@
+/*
+ * 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 ue_power.c
+* \brief Routines to compute UE TX power according to 36.213
+* \author R. Knopp, F. Kaltenberger
+* \date 2020
+* \version 0.1
+* \company Eurecom
+* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
+* \note
+* \warning
+*/
+
+#include
+#include
+#include "PHY/defs_eNB.h"
+#include "PHY/TOOLS/dB_routines.h"
+
+extern int16_t hundred_times_delta_TF[100];
+extern uint16_t hundred_times_log10_NPRB[100];
+
+int16_t estimate_ue_tx_power(int norm,uint32_t tbs, uint32_t nb_rb, uint8_t control_only, int ncp, uint8_t use_srs)
+{
+
+ /// The payload + CRC size in bits, "B"
+ uint32_t B;
+ /// Number of code segments
+ uint32_t C;
+ /// Number of "small" code segments
+ uint32_t Cminus;
+ /// Number of "large" code segments
+ uint32_t Cplus;
+ /// Number of bits in "small" code segments (<6144)
+ uint32_t Kminus;
+ /// Number of bits in "large" code segments (<6144)
+ uint32_t Kplus;
+ /// Total number of bits across all segments
+ uint32_t sumKr;
+ /// Number of "Filler" bits
+ uint32_t F;
+ // num resource elements
+ uint32_t num_re=0.0;
+ // num symbols
+ uint32_t num_symb=0.0;
+ /// effective spectral efficiency of the PUSCH
+ uint32_t MPR_x100=0;
+ /// beta_offset
+ uint16_t beta_offset_pusch_x8=8;
+ /// delta mcs
+ float delta_mcs=0.0;
+ /// bandwidth factor
+ float bw_factor=0.0;
+
+ B= tbs+24;
+ lte_segmentation(NULL,
+ NULL,
+ B,
+ &C,
+ &Cplus,
+ &Cminus,
+ &Kplus,
+ &Kminus,
+ &F);
+
+
+ sumKr = Cminus*Kminus + Cplus*Kplus;
+ num_symb = 12-(ncp<<1)-(use_srs==0?0:1);
+ num_re = num_symb * nb_rb * 12;
+
+ if (num_re == 0)
+ return(0);
+
+ MPR_x100 = 100*sumKr/num_re;
+
+ if (control_only == 1 )
+ beta_offset_pusch_x8=8; // fixme
+
+ //(beta_offset_pusch_x8=ue->ulsch[eNB_id]->harq_processes[harq_pid]->control_only == 1) ? ue->ulsch[eNB_id]->beta_offset_cqi_times8:8;
+
+ // if deltamcs_enabledm
+ delta_mcs = ((hundred_times_delta_TF[MPR_x100/6]+10*dB_fixed_times10((beta_offset_pusch_x8)>>3))/100.0);
+
+ bw_factor = (norm!=0) ? 0 : (hundred_times_log10_NPRB[nb_rb-1]/100.0);
+ LOG_D(PHY,"estimated ue tx power %d (num_re %d, sumKr %d, mpr_x100 %d, delta_mcs %f, bw_factor %f)\n",
+ (int16_t)ceil(delta_mcs + bw_factor), num_re, sumKr, MPR_x100, delta_mcs, bw_factor);
+ return (int16_t)ceil(delta_mcs + bw_factor);
+
+}
+
diff --git a/common/utils/lte/ue_power.h b/common/utils/lte/ue_power.h
new file mode 100644
index 0000000000..caeebec2c8
--- /dev/null
+++ b/common/utils/lte/ue_power.h
@@ -0,0 +1,34 @@
+/*
+ * 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 ue_power.h
+* \brief support routines used in MAC and PHY
+* \author R. Knopp, F. Kaltenberger
+* \date 2020
+* \version 0.1
+* \company Eurecom
+* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
+* \note
+* \warning
+*/
+
+int16_t estimate_ue_tx_power(int norm,uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs);
+
diff --git a/common/utils/system.c b/common/utils/system.c
index 4c6c1a4dc0..d8b66c51d3 100644
--- a/common/utils/system.c
+++ b/common/utils/system.c
@@ -96,6 +96,54 @@ static void read_pipe(int p, char *b, int size) {
}
}
+static int baseRunTimeCommand(char* cmd, size_t cmdSize) {
+ FILE *fp;
+ size_t retSize = 0;
+
+ fp = popen(cmd, "r");
+ if(fp) {
+ memset(cmd, 0, cmdSize);
+ retSize = fread(cmd, 1, cmdSize, fp);
+ fclose(fp);
+ } else {
+ LOG_D(HW,"%s:%d:%s: Cannot open %s\n", __FILE__, __LINE__, __FUNCTION__, cmd);
+ }
+
+ if (retSize == 0) {
+ return 0;
+ }
+ return atoi(cmd);
+}
+
+int checkIfFedoraDistribution(void) {
+ char cmd[200];
+
+ memset(cmd, 0, 200);
+ sprintf(cmd, "cat /etc/os-release | grep ID_LIKE | grep -ic fedora || true");
+ return baseRunTimeCommand(cmd, 200);
+}
+
+int checkIfGenericKernelOnFedora(void) {
+ char cmd[200];
+
+ memset(cmd, 0, 200);
+ sprintf(cmd, "uname -a | grep -c rt || true");
+ return (1 - baseRunTimeCommand(cmd, 200));
+}
+
+int checkIfInsideContainer(void) {
+ char cmd[200];
+ int res = 0;
+
+ memset(cmd, 0, 200);
+ sprintf(cmd, "cat /proc/self/cgroup | egrep -c 'libpod|podman|kubepods' || true");
+ res = baseRunTimeCommand(cmd, 200);
+ if (res > 0)
+ return 1;
+ else
+ return 0;
+}
+
/********************************************************************/
/* background process */
/********************************************************************/
@@ -200,29 +248,38 @@ void start_background_system(void) {
void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name, int affinity, int priority){
pthread_attr_t attr;
int ret;
+ int settingPriority = 1;
ret=pthread_attr_init(&attr);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
ret=pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
ret=pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
- ret=pthread_attr_setschedpolicy(&attr, SCHED_OAI);
- AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
- if(prioritysched_get_priority_max(SCHED_FIFO)) {
- LOG_E(TMR,"Prio not possible: %d, min is %d, max: %d, forced in the range\n",
- priority,
- sched_get_priority_min(SCHED_OAI),
- sched_get_priority_max(SCHED_OAI));
- if(prioritysched_get_priority_max(SCHED_OAI))
- priority=sched_get_priority_max(SCHED_OAI);
+ if (checkIfFedoraDistribution())
+ if (checkIfGenericKernelOnFedora())
+ if (checkIfInsideContainer())
+ settingPriority = 0;
+
+ if (settingPriority) {
+ ret=pthread_attr_setschedpolicy(&attr, SCHED_OAI);
+ AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
+ if(prioritysched_get_priority_max(SCHED_FIFO)) {
+ LOG_E(TMR,"Prio not possible: %d, min is %d, max: %d, forced in the range\n",
+ priority,
+ sched_get_priority_min(SCHED_OAI),
+ sched_get_priority_max(SCHED_OAI));
+ if(prioritysched_get_priority_max(SCHED_OAI))
+ priority=sched_get_priority_max(SCHED_OAI);
+ }
+ AssertFatal(priority<=sched_get_priority_max(SCHED_OAI),"");
+ struct sched_param sparam={0};
+ sparam.sched_priority = priority;
+ ret=pthread_attr_setschedparam(&attr, &sparam);
+ AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
}
- AssertFatal(priority<=sched_get_priority_max(SCHED_OAI),"");
- struct sched_param sparam={0};
- sparam.sched_priority = priority;
- ret=pthread_attr_setschedparam(&attr, &sparam);
- AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
+
ret=pthread_create(t, &attr, func, param);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
diff --git a/common/utils/system.h b/common/utils/system.h
index fbfd338a1a..c76fef9144 100644
--- a/common/utils/system.h
+++ b/common/utils/system.h
@@ -58,6 +58,14 @@ void thread_top_init(char *thread_name,
uint64_t deadline,
uint64_t period);
+/****************************************************
+ * Functions to check system at runtime.
+ ****************************************************/
+
+int checkIfFedoraDistribution(void);
+int checkIfGenericKernelOnFedora(void);
+int checkIfInsideContainer(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/common/utils/telnetsrv/telnetsrv.h b/common/utils/telnetsrv/telnetsrv.h
index b66641d5c8..59655501d3 100644
--- a/common/utils/telnetsrv/telnetsrv.h
+++ b/common/utils/telnetsrv/telnetsrv.h
@@ -31,6 +31,7 @@
#ifndef TELNETSRV_H
#define TELNETSRV_H
+#include
#define TELNETSRV_MODNAME "telnetsrv"
#define TELNET_PORT 9090
diff --git a/configuration/bladeRF/enb-band7-5mhz.conf b/configuration/bladeRF/enb-band7-5mhz.conf
index 9156a74fb0..9d19207522 100644
--- a/configuration/bladeRF/enb-band7-5mhz.conf
+++ b/configuration/bladeRF/enb-band7-5mhz.conf
@@ -238,7 +238,7 @@ MACRLCs = (
THREAD_STRUCT = (
{
parallel_config = "PARALLEL_RU_L1_TRX_SPLITaaaaaa";
- worker_config = "ENABLE";
+ worker_config = "WORKER_ENABLE";
}
);
diff --git a/doc/FEATURE_SET.md b/doc/FEATURE_SET.md
index 2171fc2f1f..7c202dc52d 100644
--- a/doc/FEATURE_SET.md
+++ b/doc/FEATURE_SET.md
@@ -257,7 +257,7 @@ The following features are valid for the gNB and the 5G-NR UE.
* FDD
* Normal CP
* 30 kHz subcarrier spacing
-* Bandwidths up to 80MHz (217 Physical Resource Blocks)
+* Bandwidths: 10, 20, 40, 80, 100MHz (273 Physical Resource Blocks)
* Intermediate downlink and uplink frequencies to interface with IF equipment
* Single antenna port (single beam)
* Slot format: 14 OFDM symbols in UL or DL
@@ -277,10 +277,20 @@ The following features are valid for the gNB and the 5G-NR UE.
- user-specific search space configured by RRC
- DCI formats: 00, 10 (01 and 11 **under integration**)
* Generation of NR-PDSCH (including Segmentation, LDPC encoding, rate matching, scrambling, modulation, RB mapping, etc).
- - Single symbol DMRS, DMRS-TypeA-Position Pos2, DMRS configuration type 1
- - PDSCH mapping type A
+ - PDSCH mapping type A and B
+ - DMRS configuration type 1 and 2
+ - Single and multiple DMRS symbols
+ - PTRS support
+ - Support for 1, 2 and 4 TX antennas
+ - Support for up to 2 layers (currently limited to DMRS configuration type 2)
* NR-CSI Generation of sequence at PHY (**under integration**)
* NR-PUSCH (including Segmentation, LDPC encoding, rate matching, scrambling, modulation, RB mapping, etc).
+ - PUSCH mapping type A and B
+ - DMRS configuration type 1 and 2
+ - Single and multiple DMRS symbols
+ - PTRS support
+ - Support for 1 RX antenna
+ - Support for 1 layer
* NR-PUCCH
- Format 0 (2 bits, mainly for ACK/NACK)
- Format 2 (up to 64 bits, mainly for CSI feedback)
@@ -320,27 +330,33 @@ The following features are valid for the gNB and the 5G-NR UE.
- Creates TUN interface to PDCP to inject and receive user-place traffic
- Will only work with OAI gNB configured in the same mode
-## UE PHY Layer ##
+## NR UE PHY Layer ##
* Initial synchronization
* Time tracking based on PBCH DMRS
-* Time tracking based on PBCH DMRS
* Frequency offset estimation
-* PBCH RX
-* PDCCH RX
-* PDSCH RX, including a first version of dual stream receiver for PDSCH
* 30KHz SCS for FR1 and 120 KHz SCS for FR2
-* Generation of NR-PSS/NR-SSS
+* Reception of NR-PSS/NR-SSS
* NR-PBCH supports multiple SSBs and flexible periodicity
-* Generation of NR-PDCCH for SIB1 (including generation of DCI, polar encoding, scrambling, modulation, RB mapping, etc)
+* Reception of NR-PDCCH for SIB1 (including reception of DCI, polar decoding, de-scrambling, de-modulation, RB de-mapping, etc)
- common search space configured by MIB
- user-specific search space configured by RRC
- DCI formats: 00, 10 (01 and 11 **under integration**)
-* Generation of NR-PDSCH (including Segmentation, LDPC encoding, rate matching, scrambling, modulation, RB mapping, etc).
- - Single symbol DMRS, DMRS-TypeA-Position Pos2, DMRS configuration type 1
- - PDSCH mapping type A
+* Reception of NR-PDSCH (including Segmentation, LDPC decoding, rate de-matching, de-scrambling, de-modulation, RB de-mapping, etc).
+ - PDSCH mapping type A and B
+ - DMRS configuration type 1 and 2
+ - Single and multiple DMRS symbols
+ - PTRS support
+ - Support for 1, 2 and 4 RX antennas
+ - Support for up to 2 layers (currently limited to DMRS configuration type 2)
* NR-CSI Generation of sequence at PHY (**under integration**)
* NR-PUSCH (including Segmentation, LDPC encoding, rate matching, scrambling, modulation, RB mapping, etc).
+ - PUSCH mapping type A and B
+ - DMRS configuration type 1 and 2
+ - Single and multiple DMRS symbols
+ - PTRS support
+ - Support for 1 TX antenna
+ - Support for 1 layer
* NR-PUCCH
- Format 0 (2 bits, mainly for ACK/NACK)
- Format 2 (up to 64 bits, mainly for CSI feedback)
@@ -351,7 +367,7 @@ The following features are valid for the gNB and the 5G-NR UE.
* Encoder and decoder for short block
-## UE Higher Layers ##
+## NR UE Higher Layers ##
**UE MAC**
* Minimum system information (MSI)
diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md
index 8d84646e07..dc7a982310 100644
--- a/doc/RUNMODEM.md
+++ b/doc/RUNMODEM.md
@@ -134,22 +134,24 @@ With the RF simulator (on the same machine):
## SA setup with OAI
-The sa flag is used to run gNB in standalone mode. Currently OAI in NR standalone mode transmits and receives SIB1 and triggers the RA procedure for initial access.
+The sa flag is used to run gNB in standalone mode.
-In order to run gNB in standalone mode, the following flag is needed at gNB:
+In order to run gNB and UE in standalone mode, the following flag is needed:
`--sa`
-### Run OAI in sa mode
-
-At the gNB the --sa flag does the following
-- it reads the RRC configuration from the configuration file
-- it encodes the RRCConfiguration and the RBconfig message and stores them in the binary files rbconfig.raw and reconfig.raw
-- the RRC encodes SIB1 according the configuration file and transmits it through PDSCH
+At the gNB the --sa flag does the following:
+- The RRC encodes SIB1 according to the configuration file and transmits it through NR-BCCH-DL-SCH.
At the UE the --sa flag will:
-- Read the binary files rbconfig.raw and reconfig.raw from the current directory (a different directory can be specified with the flag --rrc_config_path) and process them
-- After the successful decoding of a SIB1 at RRC, the UE will start the 5G NR Initial Access Procedure by triggering the RA procedure.
+- Decode SIB1 and starts the 5G NR Initial Access Procedure for SA:
+ 1) 5G-NR RRC Connection Setup
+ 2) NAS Authentication and Security
+ 3) 5G-NR AS Security Procedure
+ 4) 5G-NR RRC Reconfiguration
+ 5) Start Downlink and Uplink Data Transfer
+
+### Run OAI in SA mode
From the `cmake_targets/ran_build/build` folder:
@@ -159,13 +161,13 @@ gNB on machine 1:
UE on machine 2:
-`sudo ./nr-uesoftmodem --rrc_config_path . --sa`
+`sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --sa`
With the RF simulator (on the same machine):
`sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --rfsim --sa`
-`sudo ./nr-uesoftmodem --rrc_config_path . --rfsim --sa`
+`sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa`
## IF setup with OAI
diff --git a/doc/SW_archi.md b/doc/SW_archi.md
index 0d03591891..e5856d63bc 100644
--- a/doc/SW_archi.md
+++ b/doc/SW_archi.md
@@ -171,24 +171,31 @@ NR_sched_pusch_t (for values changing every TTI, e.g., frequency domain
allocation) and NR_sched_pusch_save_t (for values changing less frequently, at
least in FR1 [to my understanding], e.g., DMRS fields when the time domain
allocation stays between TTIs) structures. Furthermore, the preprocessor is an
-exchangeable module that might schedule differently, e.g., one user for
-phytest, multiple users in FR1, or maybe FR2: phytest is in
-nr_ul_preprocessor_phytest(), for FR1 is nr_simple_ulsch_preprocessor() [under
-development], for FR2 does not exist yet.
+exchangeable module that schedules differently based on a particular
+use-case/deployment type, e.g., one user for phytest [in
+nr_ul_preprocessor_phytest()], multiple users in FR1
+[nr_fr1_ulsch_preprocessor()], or maybe FR2 [does not exist yet]:
* calls preprocessor via pre_processor_ul(): the preprocessor is responsible
- for allocating CCEs (using allocate_nr_CCEs()). Note that we do not yet have
- scheduling requests or buffer status reports, and only one UE. E.g.,
- nr_simple_ulsch_preprocessor():
+ for allocating CCEs (using allocate_nr_CCEs()) and deciding on resource
+ allocation for the UEs including TB size. Note that we do not yet have
+ scheduling requests. What it typically does:
1) check whether the current frame/slot plus K2 is an UL slot, and return if
not.
2) Find first free start RB in vrb_map_UL, and as many free consecutive RBs
as possible.
- 3) allocate a CCE for the UE (and return if it is not possible)
- 4) Calculate DMRS stuff (nr_save_pusch_fields()) and the TBS.
- 5) Mark used resources in vrb_map_UL.
-* loop through all users: get a free HARQ PID and
- update statistics. Fill nFAPI structures directly for PUSCH, and call
- config_uldci() and fill_dci_pdu_rel15() for DCI filling and PDCCH messages.
+ 3) Either set up resource allocation directly (e.g., for a single UE,
+ phytest), or call into a function to perform actual resource allocation.
+ Currently, this is done using pf_ul() which implements a basic
+ proportional fair scheduler:
+ * for every UE, check for retransmission and allocate as necessary
+ * Calculate DMRS stuff (nr_set_pusch_semi_static())
+ * Calculate the PF coefficient and put eligible UEs into a list
+ * Allocate resources to the UE(s) with the highest coefficient
+ 4) Mark used resources in vrb_map_UL.
+* loop through all users: get a HARQ process as indicated through the
+ preprocessor, update statistics, fill nFAPI structures directly for PUSCH,
+ and call config_uldci() and fill_dci_pdu_rel15() for DCI filling and PDCCH
+ messages.
Calls nr_schedule_ue_spec(). It is divided into the "preprocessor" and the
"postprocessor": the first makes the scheduling decisions, the second fills
@@ -196,29 +203,28 @@ nFAPI structures to indicate to the PHY what it is supposed to do. To signal
which users have how many resources, the preprocessor populates the
NR_UE_sched_ctrl_t structure of affected users. In particular, the field rbSize
decides whether a user is to be allocated. Furthermore, the preprocessor is an
-exchangeable module that might schedule differently, e.g., one user for
-phytest, multiple users in FR1, or maybe FR2: phytest is in
-nr_preprocessor_phytest(), for FR1 is nr_simple_dlsch_preprocessor() [under
-development], for FR2 does not exist yet.
+exchangeable module that schedules differently based on a particular
+use-case/deployment type, e.g., one user for phytest [in
+nr_preprocessor_phytest()], multiple users in FR1
+[nr_fr1_dlsch_preprocessor()], or maybe FR2 [does not exist yet].
* calls preprocessor via pre_processor_dl(): the preprocessor is responsible
for allocating CCEs and PUCCH (using allocate_nr_CCEs() and
nr_acknack_scheduling()) and deciding on the frequency/time domain
- allocation. E.g., nr_simple_dlsch_preprocessor():
- 1) mac_rlc_status_ind() locks and checks directly inside rlc data the
- quantity of waiting data.
- 2) return from the preprocessor if there is no data and no timing advance to
- send,
- 3) otherwise, allocate a CCE for the UE (and return if it is not possible)
- 4) find a PUCCH occasion for HARQ
- 5a) check if there is a retransmission: if yes, find free resources to
- transmit using the same resources, else
- 5b) calculate the necessary RBs needed to get a TBS large enough to hold all
- data, or until no more resources are available
- 6) Mark taken resources in the vrb_map
+ allocation including the TB size. What it typically does:
+ 1) Check available resources in the vrb_map
+ 2) Checks the quantity of waiting data in RLC
+ 3) Either set up resource allocation directly (e.g., for a single UE,
+ phytest), or call into a function to perform actual resource allocation.
+ Currently, this is done using pf_dl() which implements a basic
+ proportional fair scheduler:
+ * for every UE, check for retransmission and allocate as necessary
+ * Calculate the PF coefficient and put eligible UEs into a list
+ * Allocate resources to the UE(s) with the highest coefficient
+ 4) Mark taken resources in the vrb_map
* loop through all users: check if a new TA is necessary. Then, if a user has
- allocated resources, compute its TBS, and fill nFAPI structures
- (nr_fill_nfapi_dl_pdu() to populate what should be done by the lower layers
- to make the Tx subframe). Update statistics (round, sent bytes).
+ allocated resources, update statistics (round, sent bytes), update HARQ
+ process information, and fill nFAPI structures (allocate a DCI and PDCCH
+ messages, TX_req, ...)
# RRC
RRC is a regular thread with itti loop on queue: TASK_RRC_GNB
diff --git a/doc/TESTING_5GSA_setup.md b/doc/TESTING_5GSA_setup.md
new file mode 100644
index 0000000000..786af5e27c
--- /dev/null
+++ b/doc/TESTING_5GSA_setup.md
@@ -0,0 +1,162 @@
+
+# OAI 5G SA tutorial [Under construction]
+
+In the following tutorial we describe how to deploy configure and test the two SA OAI setups:
+
+ - SA setup with OAI gNB and COTS UE
+ - SA setup with OAI gNB and OAI UE
+
+The operating system and hardware requirements to support OAI 5G NR are described [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/wikis/5g-nr-development-and-setup).
+
+# 1. SA setup with COTS UE
+At the moment of writing this document interoperability with the following COTS UE devices is being tested:
+
+ - [Quectel RM500Q-GL](https://www.quectel.com/product/5g-rm500q-gl/)
+ - [Simcom SIMCOM8200EA](https://www.simcom.com/product/SIM8200G.html)
+ - Huawei Mate 30 Pro
+
+ End-to-end control plane signaling to achieve a 5G SA connection, UE registration and PDU session establishment with the CN, as well as some basic user-plane traffic tests have been validated so far using the Quectel module and Huawei Mate 30 pro and partially validated with SIMCOM module. In terms of interoperability with different 5G Core Networks, so far this setup has been tested with:
+
+
+ - [OAI CN](https://openairinterface.org/oai-5g-core-network-project/)
+ - Nokia SA Box
+ - [Free CN](https://www.free5gc.org/)
+
+
+ ## 1.1 gNB build and configuration
+At the moment of writing this document, most of the code to support the SA setup is not merged into develop branch yet, but it is accessible through the following branches:
+
+ - NR_SA_F1AP_5GRECORDS
+ - develop-NR_SA_F1AP_5GRECORDS (up-to-date with latest develop branch)
+
+To build the gNB executable:
+```bash
+ cd cmake_targets
+ ./build_oai -I -w USRP #For OAI first time installation only to install software dependencies
+ ./build_oai --gNB -w USRP
+```
+
+A reference configuration file for the gNB is provided [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop-NR_SA_F1AP_5GRECORDS/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf).
+
+
+In the following, we highlight the fields of the file that have to be configured according to the configuration and interfaces of the Core Network. First, the PLMN section has to be filled with the proper values that match the configuration of the AMF and the UE USIM.
+```bash
+ // Tracking area code, 0x0000 and 0xfffe are reserved values
+ tracking_area_code = 1;
+ plmn_list = ({
+ mcc = 208;
+ mnc = 99;
+ mnc_length = 2;
+ snssaiList = (
+ {
+ sst = 1;
+ sd = 0x1; // 0 false, else true
+ },
+ {
+ sst = 1;
+ sd = 0x112233; // 0 false, else true
+ }
+ );
+ });
+```
+Then, the source and destination IP interfaces for the communication with
+the Core Network also need to be set as shown below.
+
+```bash
+ ////////// MME parameters:
+ amf_ip_address = ( { ipv4 = "192.168.70.132";
+ ipv6 = "192:168:30::17";
+ active = "yes";
+ preference = "ipv4";
+ }
+ );
+ NETWORK_INTERFACES :
+ {
+ GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai";
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24";
+ GNB_INTERFACE_NAME_FOR_NGU = "demo-oai";
+ GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24";
+ GNB_PORT_FOR_S1U = 2152; # Spec 2152
+ };
+```
+In the first part (*amf_ip_address*) we specify the IP of the AMF and in the second part (*NETWORK_INTERFACES*) we specify the gNB local interface with AMF (N2 interface) and the UPF (N3 interface).
+
+### **gNB configuration in CU/DU split mode**
+For the configuration of the gNB in CU and DU blocks the following sample configuration files are provided for the CU and DU entities respectively.
+......
+At the point of writing this document the control-plane exchanges between the CU and the DU over *F1-C* interface have been validated. The integration of *F1-U* over gtp-u for the support of data plane traffic is ongoing.
+
+## 1.2 OAI 5G Core Network installation and configuration
+The instructions for the installation of OAI CN components (AMF, SMF, NRF, UPF) using docker compose can be found [here](https://gitlab.eurecom.fr/oai/cn5g). Below are some complementary instructions which can be useful for the deployment.
+
+ ## 1.3 Execution of SA scenario
+
+After having configured the gNB, we can start the individual components in the following sequence:
+
+ - Launch Core Network
+ - Launch gNB
+ - Launch COTS UE (disable airplane mode)
+
+The execution command to start the gNB (in monolithic mode) is the following:
+```bash
+cd cmake_targets/ran_build/build
+sudo ./nr-softmodem -E --sa -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf
+```
+
+# 2. SA Setup with OAI UE
+The SA setup with OAI UE has been validated with RFSIMULATOR for the moment. The control plane for the successful UE registration and PDU Session establishment has been verified with OAI and Nokia SA Box CNs. User-plane traffic validation after the establishment of the 5G connection is still pending for this setup.
+
+In the following, we provide the instructions on how to build, configure and execute this SA setup.
+
+## 2.1 Build and configuration
+To build the gNB and OAI UE executables:
+
+```bash
+ cd cmake_targets
+ ./build_oai -I #For OAI first time installation only to install software dependencies
+ ./build_oai --gNB --nrUE -w SIMU
+```
+The gNB configuration can be performed according to what is described in section 1.1, using the same reference configuration file as with the RF scenario.
+
+### NAS configuration for the OAI UE
+At the moment, the NAS configuration parameters of the OAI UE are hardcoded in ***openair3/NAS/NR_UE/nr_nas_msg_sim.c***. More specifically:
+
+ - The SUCI (*Subscription Concealed Identifier*) corresponding to default IMSI 2089900007487 is hardcoded in functions *generateRegistrationRequest()* and *generateIdentityResponse()* through the following lines:
+```bash
+ mm_msg->registration_request.fgsmobileidentity.suci.typeofidentity = FGS_MOBILE_IDENTITY_SUCI;
+ mm_msg->registration_request.fgsmobileidentity.suci.mncdigit1 = 9;
+ mm_msg->registration_request.fgsmobileidentity.suci.mncdigit2 = 9;
+ mm_msg->registration_request.fgsmobileidentity.suci.mncdigit3 = 0xf;
+ mm_msg->registration_request.fgsmobileidentity.suci.mccdigit1 = 2;
+ mm_msg->registration_request.fgsmobileidentity.suci.mccdigit2 = 0;
+ mm_msg->registration_request.fgsmobileidentity.suci.mccdigit3 = 8;
+ mm_msg->registration_request.fgsmobileidentity.suci.schemeoutput = 0x4778;
+```
+ - USIM_API_K and OPc keys are hardcoded at the beginning of the file:
+```bash
+// USIM_API_K: fe c8 6b a6 eb 70 7e d0 89 05 75 7b 1b b4 4b 8f
+uint8_t k[16] = {0xfe, 0xc8, 0x6b, 0xa6, 0xeb, 0x70, 0x7e, 0xd0, 0x89, 0x05, 0x75, 0x7b, 0x1b, 0xb4, 0x4b, 0x8f};
+// OPC: c4 24 49 36 3b ba d0 2b 66 d1 6b c9 75 d7 7c c1
+const uint8_t opc[16] = {0xc4, 0x24, 0x49, 0x36, 0x3b, 0xba, 0xd0, 0x2b, 0x66, 0xd1, 0x6b, 0xc9, 0x75, 0xd7, 0x7c, 0xc1};
+```
+- The NSSAI (*Network Slice Assistance Information*) and DNN (*Data Network Name*) are hardcoded in function *generatePduSessionEstablishRequest()*
+```bash
+ uint8_t nssai[]={1,0,0,1}; //Corresponding to SST:1, SD:1
+ uint8_t dnn[4]={0x4,0x6f,0x61,0x69}; //Corresponding to dnn:"oai"
+```
+For interoperability with OAI or other CNs, it should be ensured that the configuration of the aforementioned parameters match the configuration of the corresponding subscribed user at the core network.
+Hardcoding of the USIM information will soon be substituted with parsing those parameters from a configuration file.
+
+## 2.2 Execution of SA scenario
+
+The order of starting the different components should be the same as the one described in section 1.3.
+
+ - To launch the gNB:
+ ```bash
+ sudo RFSIMULATOR=server ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --rfsim --sa
+ ```
+- To launch the OAI UE:
+ ```bash
+sudo RFSIMULATOR=127.0.0.1 ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa --nokrnmod
+```
+The IP address at the execution command of the OAI UE corresponds to the target IP of the gNB host that the RFSIMULATOR at the UE will connect to. In the above example, we assume that the gNB and UE are running on the same host so the specified address (127.0.0.1) is the one of the loopback interface.
diff --git a/doc/TESTING_GNB_W_COTS_UE.md b/doc/TESTING_GNB_W_COTS_UE.md
index 5f9299f0ef..84f43bfc27 100644
--- a/doc/TESTING_GNB_W_COTS_UE.md
+++ b/doc/TESTING_GNB_W_COTS_UE.md
@@ -44,6 +44,7 @@ Our code might not work with all 5G phones yet, but we are constantly improving
* Oppo Reno 5G
* Samsung A90 5G
+* Samsung A42 5G
* Google Pixel 5G (note1)
* Simcom SIMCOM8200EA
* Quectel RM500Q-GL
diff --git a/doc/testing_gnb_w_cots_ue_resources/enb.conf b/doc/testing_gnb_w_cots_ue_resources/enb.conf
index 35249aac25..a6bbd98bda 100755
--- a/doc/testing_gnb_w_cots_ue_resources/enb.conf
+++ b/doc/testing_gnb_w_cots_ue_resources/enb.conf
@@ -238,7 +238,7 @@ MACRLCs = (
THREAD_STRUCT = (
{
parallel_config = "PARALLEL_RU_L1_TRX_SPLITaaaaaa";
- worker_config = "ENABLE";
+ worker_config = "WORKER_ENABLE";
}
);
diff --git a/docker/Dockerfile.eNB.rhel8.2 b/docker/Dockerfile.eNB.rhel8.2
index aa8b9aa228..cf012502e0 100644
--- a/docker/Dockerfile.eNB.rhel8.2
+++ b/docker/Dockerfile.eNB.rhel8.2
@@ -25,7 +25,7 @@
#
#---------------------------------------------------------------------
-FROM localhost/ran-build:latest AS enb-build
+FROM ran-build:latest AS enb-build
RUN rm -Rf /oai-ran
WORKDIR /oai-ran
@@ -37,10 +37,9 @@ RUN /bin/sh oaienv && \
mkdir -p log && \
./build_oai --eNB --ninja -w USRP --verbose-ci
-# debug
-#RUN ldconfig -v && ldd /oai-ran/targets/bin/lte-softmodem.Rel15
-#RUN ls -ls /oai-ran/targets/bin
-#RUN ls -ls /oai-ran/cmake_targets/ran_build/build/*.so
+RUN yum install -y python3-pip && \
+ pip3 install --ignore-installed pyyaml && \
+ python3 ./docker/scripts/generateTemplate.py ./docker/scripts/enb_parameters.yaml
#start from scratch for target executable
FROM registry.access.redhat.com/ubi8/ubi:latest as oai-enb
@@ -59,6 +58,7 @@ RUN yum update -y && \
WORKDIR /opt/oai-enb/bin
COPY --from=enb-build /oai-ran/targets/bin/lte-softmodem.Rel15 .
+COPY --from=enb-build /oai-ran/docker/scripts/enb_entrypoint.sh entrypoint.sh
WORKDIR /usr/local/lib/
COPY --from=enb-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 .
@@ -93,34 +93,16 @@ COPY --from=enb-build /usr/local/lib64/libuhd.so.4.0.0 /usr/local/lib64
RUN ldconfig
-#debug
-#RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15
-#RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15
-#RUN ldd /usr/local/lib/librfsimulator.so.Rel15
-#RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15
-#RUN ldd /usr/local/lib/libcoding.so
-#RUN ldd /usr/local/lib/libparams_libconfig.so
-#RUN ldd /usr/local/lib/libdfts.so
-#RUN ldd /usr/local/lib/liboai_iqplayer.so
-#RUN ldd /opt/oai-enb/bin/lte-softmodem.Rel15
-
# Copy the relevant configuration files for eNB
WORKDIR /opt/oai-enb/etc
-COPY --from=enb-build /oai-ran/ci-scripts/conf_files/enb.* .
-COPY --from=enb-build /oai-ran/ci-scripts/conf_files/rcc.* .
-COPY --from=enb-build /oai-ran/ci-scripts/conf_files/cu.* .
-COPY --from=enb-build /oai-ran/ci-scripts/conf_files/du.* .
-COPY --from=enb-build /oai-ran/ci-scripts/conf_files/rru.* .
+COPY --from=enb-build /oai-ran/docker/etc .
WORKDIR /opt/oai-enb
-#EXPOSE 2152/udp # S1U, GTP/UDP
-#EXPOSE 22100/tcp # ?
-#EXPOSE 36412/udp # S1C, SCTP/UDP
-#EXPOSE 36422/udp # X2C, SCTP/UDP
-#EXPOSE 50000/udp # IF5 / ORI (control)
-#EXPOSE 50001/udp # IF5 / ECPRI (data)
+# 2152 --> S1U, GTP/UDP
+# 36412 --> S1C, SCTP/UDP
+# 36422 --> X2C, SCTP/UDP
+EXPOSE 2152/udp 36412/udp 36422/udp
-#CMD ["/opt/oai-enb/bin/lte-softmodem", "-O", "/opt/oai-enb/etc/enb.conf"]
-#ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"]
-CMD ["sleep", "infinity"]
+ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"]
+CMD ["/opt/oai-enb/bin/lte-softmodem.Rel15", "-O", "/opt/oai-enb/etc/enb.conf"]
diff --git a/docker/Dockerfile.eNB.ubuntu18 b/docker/Dockerfile.eNB.ubuntu18
index 95d7194c31..1f276094d5 100644
--- a/docker/Dockerfile.eNB.ubuntu18
+++ b/docker/Dockerfile.eNB.ubuntu18
@@ -41,11 +41,6 @@ RUN apt-get install -y python3-pip && \
pip3 install --ignore-installed pyyaml && \
python3 ./docker/scripts/generateTemplate.py ./docker/scripts/enb_parameters.yaml
-# debug
-#RUN ldconfig -v && ldd /oai-ran/targets/bin/lte-softmodem.Rel15
-#RUN ls -ls /oai-ran/targets/bin
-#RUN ls -ls /oai-ran/cmake_targets/ran_build/build/*.so
-
#start from scratch for target executable
FROM ubuntu:bionic as oai-enb
ENV DEBIAN_FRONTEND=noninteractive
@@ -98,17 +93,6 @@ COPY --from=enb-build /usr/local/lib/libprotobuf-c.so.1 .
RUN ldconfig
-#debug
-#RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15
-#RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15
-#RUN ldd /usr/local/lib/librfsimulator.so.Rel15
-#RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15
-#RUN ldd /usr/local/lib/libcoding.so
-#RUN ldd /usr/local/lib/libparams_libconfig.so
-#RUN ldd /usr/local/lib/libdfts.so
-#RUN ldd /usr/local/lib/liboai_iqplayer.so
-#RUN ldd /opt/oai-enb/bin/lte-softmodem.Rel15
-
# Copy the relevant configuration files for eNB
WORKDIR /opt/oai-enb/etc
COPY --from=enb-build /oai-ran/docker/etc .
diff --git a/docker/Dockerfile.lteRU.rhel8.2 b/docker/Dockerfile.lteRU.rhel8.2
new file mode 100644
index 0000000000..35078de007
--- /dev/null
+++ b/docker/Dockerfile.lteRU.rhel8.2
@@ -0,0 +1,99 @@
+#/*
+# * 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
+# */
+#---------------------------------------------------------------------
+#
+# Dockerfile for the Open-Air-Interface BUILD service
+# Valid for RHEL8
+#
+#---------------------------------------------------------------------
+
+FROM ran-build:latest AS ru-build
+
+RUN rm -Rf /oai-ran
+WORKDIR /oai-ran
+COPY . .
+
+#run build_oai to build the target image
+RUN /bin/sh oaienv && \
+ cd cmake_targets && \
+ mkdir -p log && \
+ ./build_oai --RU --ninja -w USRP --verbose-ci
+
+RUN yum install -y python3-pip && \
+ pip3 install --ignore-installed pyyaml && \
+ python3 ./docker/scripts/generateTemplate.py ./docker/scripts/enb_parameters.yaml
+
+#start from scratch for target executable
+FROM registry.access.redhat.com/ubi8/ubi:latest as oai-lte-ru
+ENV TZ=Europe/Paris
+
+RUN yum update -y && \
+ yum install -y --enablerepo="ubi-8-codeready-builder" \
+ tzdata \
+ atlas \
+ net-tools \
+ iputils \
+ iproute && \
+ echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
+ echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
+
+WORKDIR /opt/oai-lte-ru/bin
+COPY --from=ru-build /oai-ran/targets/bin/oairu.Rel15 .
+COPY --from=ru-build /oai-ran/docker/scripts/lte_ru_entrypoint.sh entrypoint.sh
+
+WORKDIR /usr/local/lib/
+COPY --from=ru-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 .
+COPY --from=ru-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 .
+COPY --from=ru-build /oai-ran/targets/bin/librfsimulator.so.Rel15 .
+COPY --from=ru-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 .
+COPY --from=ru-build /oai-ran/targets/bin/libparams_libconfig.so .
+COPY --from=ru-build /oai-ran/cmake_targets/ran_build/build/libdfts.so .
+
+# Copying from the ran-build image the USRP needed packages
+COPY --from=ru-build /lib64/libconfig.so.9 /lib64
+COPY --from=ru-build /lib64/libblas.so.3 /lib64
+COPY --from=ru-build /lib64/liblapack.so.3 /lib64
+COPY --from=ru-build /lib64/liblapacke.so.3 /lib64
+COPY --from=ru-build /lib64/libboost_chrono.so.1.66.0 /lib64
+COPY --from=ru-build /lib64/libboost_date_time.so.1.66.0 /lib64
+COPY --from=ru-build /lib64/libboost_filesystem.so.1.66.0 /lib64
+COPY --from=ru-build /lib64/libboost_program_options.so.1.66.0 /lib64
+COPY --from=ru-build /lib64/libboost_serialization.so.1.66.0 /lib64
+COPY --from=ru-build /lib64/libboost_thread.so.1.66.0 /lib64
+COPY --from=ru-build /lib64/libboost_system.so.1.66.0 /lib64
+COPY --from=ru-build /lib64/libboost_unit_test_framework.so.1.66.0 /lib64
+COPY --from=ru-build /lib64/libboost_atomic.so.1.66.0 /lib64
+COPY --from=ru-build /lib64/libboost_timer.so.1.66.0 /lib64
+COPY --from=ru-build /usr/local/lib64/libuhd.so.4.0.0 /usr/local/lib64
+
+RUN /bin/bash -c "ln -s /usr/local/lib/liboai_eth_transpro.so.Rel15 /usr/local/lib/liboai_transpro.so" && \
+ /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so.Rel15 /usr/local/lib/liboai_device.so" && \
+ /bin/bash -c "ln -s /usr/local/lib/librfsimulator.so.Rel15 /usr/local/lib/librfsimulator.so" && \
+ ldconfig
+
+# Copy the relevant configuration files for RRU
+WORKDIR /opt/oai-lte-ru/etc
+COPY --from=ru-build /oai-ran/docker/etc/rru* ./
+
+WORKDIR /opt/oai-lte-ru
+
+ENTRYPOINT ["/opt/oai-lte-ru/bin/entrypoint.sh"]
+CMD ["/opt/oai-lte-ru/bin/oairu.Rel15", "-O", "/opt/oai-lte-ru/etc/rru.conf"]
diff --git a/docker/Dockerfile.lteRU.ubuntu18 b/docker/Dockerfile.lteRU.ubuntu18
new file mode 100644
index 0000000000..381d63d9f3
--- /dev/null
+++ b/docker/Dockerfile.lteRU.ubuntu18
@@ -0,0 +1,94 @@
+#/*
+# * 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
+# */
+#---------------------------------------------------------------------
+#
+# Dockerfile for the Open-Air-Interface BUILD service
+# Valid for Ubuntu 18.04
+#
+#---------------------------------------------------------------------
+
+FROM ran-build:latest AS ru-build
+
+RUN rm -Rf /oai-ran
+WORKDIR /oai-ran
+COPY . .
+
+#run build_oai to build the target image
+RUN /bin/sh oaienv && \
+ cd cmake_targets && \
+ mkdir -p log && \
+ ./build_oai --RU --ninja -w USRP --verbose-ci
+
+RUN apt-get install -y python3-pip && \
+ pip3 install --ignore-installed pyyaml && \
+ python3 ./docker/scripts/generateTemplate.py ./docker/scripts/enb_parameters.yaml
+
+#start from scratch for target executable
+FROM ubuntu:bionic as oai-lte-ru
+ENV DEBIAN_FRONTEND=noninteractive
+ENV TZ=Europe/Paris
+
+RUN apt-get update && \
+ DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
+ DEBIAN_FRONTEND=noninteractive apt-get install --yes \
+ tzdata \
+ software-properties-common \
+ libblas3 \
+ libatlas3-base \
+ libconfig9 \
+ net-tools \
+ iputils-ping \
+ iproute2 && \
+ # Install UHD driver from ettus ppa
+ # At time of writing, it is 3.14
+ add-apt-repository ppa:ettusresearch/uhd --yes && \
+ apt-get update && \
+ DEBIAN_FRONTEND=noninteractive apt-get install --yes \
+ python \
+ libusb-1.0-0 \
+ libuhd003 \
+ uhd-host && \
+ rm -rf /var/lib/apt/lists/*
+
+WORKDIR /opt/oai-lte-ru/bin
+COPY --from=ru-build /oai-ran/targets/bin/oairu.Rel15 .
+COPY --from=ru-build /oai-ran/docker/scripts/lte_ru_entrypoint.sh entrypoint.sh
+
+WORKDIR /usr/local/lib/
+COPY --from=ru-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 .
+COPY --from=ru-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 .
+COPY --from=ru-build /oai-ran/targets/bin/librfsimulator.so.Rel15 .
+COPY --from=ru-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 .
+COPY --from=ru-build /oai-ran/targets/bin/libparams_libconfig.so .
+COPY --from=ru-build /oai-ran/cmake_targets/ran_build/build/libdfts.so .
+RUN /bin/bash -c "ln -s /usr/local/lib/liboai_eth_transpro.so.Rel15 /usr/local/lib/liboai_transpro.so" && \
+ /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so.Rel15 /usr/local/lib/liboai_device.so" && \
+ /bin/bash -c "ln -s /usr/local/lib/librfsimulator.so.Rel15 /usr/local/lib/librfsimulator.so" && \
+ ldconfig
+
+# Copy the relevant configuration files for RRU
+WORKDIR /opt/oai-lte-ru/etc
+COPY --from=ru-build /oai-ran/docker/etc/rru* ./
+
+WORKDIR /opt/oai-lte-ru
+
+ENTRYPOINT ["/opt/oai-lte-ru/bin/entrypoint.sh"]
+CMD ["/opt/oai-lte-ru/bin/oairu.Rel15", "-O", "/opt/oai-lte-ru/etc/rru.conf"]
diff --git a/docker/Dockerfile.lteUE.rhel8.2 b/docker/Dockerfile.lteUE.rhel8.2
index e22343d63c..731abed1a8 100644
--- a/docker/Dockerfile.lteUE.rhel8.2
+++ b/docker/Dockerfile.lteUE.rhel8.2
@@ -25,7 +25,7 @@
#
#---------------------------------------------------------------------
-FROM localhost/ran-build:latest AS lte-ue-build
+FROM ran-build:latest AS lte-ue-build
RUN rm -Rf /oai-ran
WORKDIR /oai-ran
@@ -37,10 +37,10 @@ RUN /bin/sh oaienv && \
mkdir -p log && \
./build_oai --UE --ninja -w USRP --verbose-ci
-# debug
-#RUN ldconfig -v && ldd /oai-ran/targets/bin/lte-uesoftmodem.Rel15
-#RUN ls -lst /oai-ran/targets/bin
-#RUN ls -lst /oai-ran/cmake_targets/ran_build/build/*.so
+RUN yum install -y python3-pip && \
+ pip3 install --ignore-installed pyyaml && \
+ python3 ./docker/scripts/generateTemplate.py ./docker/scripts/lte_ue_parameters.yaml && \
+ python3 ./docker/scripts/generateTemplate.py ./docker/scripts/lte_ue_sim_parameters.yaml
#start from scratch for target executable
FROM registry.access.redhat.com/ubi8/ubi:latest as oai-lte-ue
@@ -59,12 +59,10 @@ RUN yum update -y && \
WORKDIR /opt/oai-lte-ue/bin
COPY --from=lte-ue-build /oai-ran/targets/bin/lte-uesoftmodem.Rel15 .
+COPY --from=lte-ue-build /oai-ran/docker/scripts/lte_ue_entrypoint.sh entrypoint.sh
COPY --from=lte-ue-build /oai-ran/targets/bin/conf2uedata .
COPY --from=lte-ue-build /oai-ran/targets/bin/nvram .
COPY --from=lte-ue-build /oai-ran/targets/bin/usim .
-COPY --from=lte-ue-build /oai-ran/targets/bin/.ue_emm.nvram0 .
-COPY --from=lte-ue-build /oai-ran/targets/bin/.ue.nvram0 .
-COPY --from=lte-ue-build /oai-ran/targets/bin/.usim.nvram0 .
WORKDIR /usr/local/lib/
COPY --from=lte-ue-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 .
@@ -99,26 +97,10 @@ COPY --from=lte-ue-build /usr/local/lib64/libuhd.so.4.0.0 /usr/local/lib64
RUN ldconfig
-#debug
-#RUN ldd /opt/oai-lte-ue/bin/lte-uesoftmodem.Rel15
-#RUN ldd /opt/oai-lte-ue/bin/conf2uedata
-#RUN ldd /opt/oai-lte-ue/bin/nvram
-#RUN ldd /opt/oai-lte-ue/bin/usim
-#RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15
-#RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15
-#RUN ldd /usr/local/lib/librfsimulator.so.Rel15
-#RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15
-#RUN ldd /usr/local/lib/libcoding.so
-#RUN ldd /usr/local/lib/libparams_libconfig.so
-#RUN ldd /usr/local/lib/libSIMU.so
-#RUN ldd /usr/local/lib/libdfts.so
-
-# Copy the relevant configuration files for eNB
+# Copy the relevant configuration files for UE
WORKDIR /opt/oai-lte-ue/etc
-COPY --from=lte-ue-build /oai-ran/ci-scripts/conf_files/ue.* .
-COPY --from=lte-ue-build /oai-ran/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf ./ue_usim.conf
+COPY --from=lte-ue-build /oai-ran/docker/etc .
WORKDIR /opt/oai-lte-ue
-#CMD ["/opt/oai-lte-ue/bin/lte-uesoftmodem", "-O", "/opt/oai-lte-ue/etc/enb.conf"]
-#ENTRYPOINT ["/opt/oai-lte-ue/bin/entrypoint.sh"]
-CMD ["sleep", "infinity"]
+CMD ["/opt/oai-lte-ue/bin/lte-uesoftmodem.Rel15"]
+ENTRYPOINT ["/opt/oai-lte-ue/bin/entrypoint.sh"]
diff --git a/docker/Dockerfile.lteUE.ubuntu18 b/docker/Dockerfile.lteUE.ubuntu18
index 6af2e61991..6575a81899 100644
--- a/docker/Dockerfile.lteUE.ubuntu18
+++ b/docker/Dockerfile.lteUE.ubuntu18
@@ -37,11 +37,10 @@ RUN /bin/sh oaienv && \
mkdir -p log && \
./build_oai --UE --ninja -w USRP --verbose-ci
-# debug
-#RUN ldconfig -v
-#RUN ldd /oai-ran/targets/bin/lte-uesoftmodem.Rel15
-#RUN ls -lst /oai-ran/targets/bin
-#RUN ls -lst /oai-ran/cmake_targets/ran_build/build/*.so
+RUN apt-get install -y python3-pip && \
+ pip3 install --ignore-installed pyyaml && \
+ python3 ./docker/scripts/generateTemplate.py ./docker/scripts/lte_ue_parameters.yaml && \
+ python3 ./docker/scripts/generateTemplate.py ./docker/scripts/lte_ue_sim_parameters.yaml
#start from scratch for target executable
FROM ubuntu:bionic as oai-lte-ue
@@ -76,12 +75,10 @@ RUN apt-get update && \
WORKDIR /opt/oai-lte-ue/bin
COPY --from=lte-ue-build /oai-ran/targets/bin/lte-uesoftmodem.Rel15 .
+COPY --from=lte-ue-build /oai-ran/docker/scripts/lte_ue_entrypoint.sh entrypoint.sh
COPY --from=lte-ue-build /oai-ran/targets/bin/conf2uedata .
COPY --from=lte-ue-build /oai-ran/targets/bin/nvram .
COPY --from=lte-ue-build /oai-ran/targets/bin/usim .
-COPY --from=lte-ue-build /oai-ran/targets/bin/.ue_emm.nvram0 .
-COPY --from=lte-ue-build /oai-ran/targets/bin/.ue.nvram0 .
-COPY --from=lte-ue-build /oai-ran/targets/bin/.usim.nvram0 .
WORKDIR /usr/local/lib/
COPY --from=lte-ue-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 .
@@ -100,26 +97,10 @@ COPY --from=lte-ue-build /usr/local/lib/libprotobuf-c.so.1 .
RUN ldconfig
-#debug
-#RUN ldd /opt/oai-lte-ue/bin/lte-uesoftmodem.Rel15
-#RUN ldd /opt/oai-lte-ue/bin/conf2uedata
-#RUN ldd /opt/oai-lte-ue/bin/nvram
-#RUN ldd /opt/oai-lte-ue/bin/usim
-#RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15
-#RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15
-#RUN ldd /usr/local/lib/librfsimulator.so.Rel15
-#RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15
-#RUN ldd /usr/local/lib/libcoding.so
-#RUN ldd /usr/local/lib/libparams_libconfig.so
-#RUN ldd /usr/local/lib/libSIMU.so
-#RUN ldd /usr/local/lib/libdfts.so
-
-# Copy the relevant configuration files for eNB
+# Copy the relevant configuration files for UE
WORKDIR /opt/oai-lte-ue/etc
-COPY --from=lte-ue-build /oai-ran/ci-scripts/conf_files/ue.* ./
-COPY --from=lte-ue-build /oai-ran/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf ./ue_usim.conf
+COPY --from=lte-ue-build /oai-ran/docker/etc .
WORKDIR /opt/oai-lte-ue
-#CMD ["/opt/oai-lte-ue/bin/lte-uesoftmodem", "-O", "/opt/oai-lte-ue/etc/enb.conf"]
-#ENTRYPOINT ["/opt/oai-lte-ue/bin/entrypoint.sh"]
-CMD ["sleep", "infinity"]
+CMD ["/opt/oai-lte-ue/bin/lte-uesoftmodem.Rel15"]
+ENTRYPOINT ["/opt/oai-lte-ue/bin/entrypoint.sh"]
diff --git a/docker/scripts/enb_entrypoint.sh b/docker/scripts/enb_entrypoint.sh
index 31d99b2a67..6810a86416 100755
--- a/docker/scripts/enb_entrypoint.sh
+++ b/docker/scripts/enb_entrypoint.sh
@@ -2,17 +2,22 @@
set -euo pipefail
+PREFIX=/opt/oai-enb
+RRC_INACTIVITY_THRESHOLD=${RRC_INACTIVITY_THRESHOLD:-0}
+
# Based another env var, pick one template to use
-if [[ -v USE_FDD_CU ]]; then ln -s /opt/oai-enb/etc/cu.fdd.conf /opt/oai-enb/etc/enb.conf; fi
-if [[ -v USE_FDD_DU ]]; then ln -s /opt/oai-enb/etc/du.fdd.conf /opt/oai-enb/etc/enb.conf; fi
-if [[ -v USE_FDD_MONO ]]; then ln -s /opt/oai-enb/etc/enb.fdd.conf /opt/oai-enb/etc/enb.conf; fi
-if [[ -v USE_TDD_MONO ]]; then ln -s /opt/oai-enb/etc/enb.tdd.conf /opt/oai-enb/etc/enb.conf; fi
-if [[ -v USE_FDD_RCC ]]; then ln -s /opt/oai-enb/etc/rcc.if4p5.enb.fdd.conf /opt/oai-enb/etc/enb.conf; fi
-if [[ -v USE_FDD_RRU ]]; then ln -s /opt/oai-enb/etc/rru.fdd.conf /opt/oai-enb/etc/enb.conf; fi
-if [[ -v USE_TDD_RRU ]]; then ln -s /opt/oai-enb/etc/rru.tdd.conf /opt/oai-enb/etc/enb.conf; fi
+if [[ -v USE_FDD_CU ]]; then ln -s $PREFIX/etc/cu.fdd.conf $PREFIX/etc/enb.conf; fi
+if [[ -v USE_FDD_DU ]]; then ln -s $PREFIX/etc/du.fdd.conf $PREFIX/etc/enb.conf; fi
+if [[ -v USE_FDD_MONO ]]; then ln -s $PREFIX/etc/enb.fdd.conf $PREFIX/etc/enb.conf; fi
+if [[ -v USE_TDD_MONO ]]; then ln -s $PREFIX/etc/enb.tdd.conf $PREFIX/etc/enb.conf; fi
+if [[ -v USE_FDD_FAPI_RCC ]]; then ln -s $PREFIX/etc/rcc.nfapi.fdd.conf $PREFIX/etc/enb.conf; fi
+if [[ -v USE_FDD_IF4P5_RCC ]]; then ln -s $PREFIX/etc/rcc.if4p5.fdd.conf $PREFIX/etc/enb.conf; fi
+if [[ -v USE_TDD_IF4P5_RCC ]]; then ln -s $PREFIX/etc/rcc.if4p5.tdd.conf $PREFIX/etc/enb.conf; fi
+if [[ -v USE_FDD_RRU ]]; then ln -s $PREFIX/etc/rru.fdd.conf $PREFIX/etc/enb.conf; fi
+if [[ -v USE_TDD_RRU ]]; then ln -s $PREFIX/etc/rru.tdd.conf $PREFIX/etc/enb.conf; fi
# Only this template will be manipulated
-CONFIG_FILES=`ls /opt/oai-enb/etc/enb.conf`
+CONFIG_FILES=`ls $PREFIX/etc/enb.conf || true`
for c in ${CONFIG_FILES}; do
# grep variable names (format: ${VAR}) from template to be rendered
diff --git a/docker/scripts/enb_parameters.yaml b/docker/scripts/enb_parameters.yaml
index a60fc20e29..749600f47d 100644
--- a/docker/scripts/enb_parameters.yaml
+++ b/docker/scripts/enb_parameters.yaml
@@ -25,7 +25,7 @@
dest_dir: docker/etc
- configurations:
- - filePrefix: cu
+ - filePrefix: cu.band7.tm1.25PRB
outputfilename: "cu.fdd.conf"
config:
- key: Active_eNBs
@@ -68,7 +68,7 @@
- key: ENB_IPV4_ADDRESS_FOR_X2C
env: "@F1_CU_IP_ADDRESS@"
- - filePrefix: du
+ - filePrefix: du.band7.tm1.25PRB
outputfilename: "du.fdd.conf"
config:
- key: Active_eNBs
@@ -159,6 +159,8 @@
env: "@ENB_S1U_IP_ADDRESS@"
- key: ENB_IPV4_ADDRESS_FOR_X2C
env: "@ENB_X2_IP_ADDRESS@"
+ - key: rrc_inactivity_threshold
+ env: "@RRC_INACTIVITY_THRESHOLD@"
- key: FLEXRAN_ENABLED
env: "@FLEXRAN_ENABLED@"
- key: FLEXRAN_INTERFACE_NAME
@@ -204,7 +206,7 @@
env: "@F1_CU_IP_ADDRESS@"
- filePrefix: "rcc.band7.tm1.nfapi"
- outputfilename: "rcc.if4p5.enb.fdd.conf"
+ outputfilename: "rcc.nfapi.fdd.conf"
config:
- key: Active_eNBs
env: "@ENB_NAME@"
@@ -246,3 +248,89 @@
- key: ENB_IPV4_ADDRESS_FOR_X2C
env: "@F1_CU_IP_ADDRESS@"
+ - filePrefix: "rcc.band7.tm1.if4p5.lo.25PRB"
+ outputfilename: "rcc.if4p5.fdd.conf"
+ config:
+ - key: Active_eNBs
+ env: "@ENB_NAME@"
+ - key: eNB_name
+ env: "@ENB_NAME@"
+ - key: plmn_list
+ env:
+ mcc: "@MCC@"
+ mnc: "@MNC@"
+ mnc_length: "@MNC_LENGTH@"
+ - key: tracking_area_code
+ env: "@TAC@"
+ - key: eutra_band
+ env: "@UTRA_BAND_ID@"
+ - key: downlink_frequency
+ env: "@DL_FREQUENCY_IN_MHZ@000000"
+ - key: uplink_frequency_offset
+ env: "@UL_FREQUENCY_OFFSET_IN_MHZ@000000"
+ - key: Nid_cell
+ env: "@NID_CELL@"
+ - key: N_RB_DL
+ env: "@NB_PRB@"
+ - key: ipv4
+ env: "@MME_S1C_IP_ADDRESS@"
+ - key: ENB_INTERFACE_NAME_FOR_S1_MME
+ env: "@RCC_IF_NAME@"
+ - key: ENB_IPV4_ADDRESS_FOR_S1_MME
+ env: "@RCC_S1C_IP_ADDRESS@"
+ - key: ENB_INTERFACE_NAME_FOR_S1U
+ env: "@RCC_IF_NAME@"
+ - key: ENB_IPV4_ADDRESS_FOR_S1U
+ env: "@RCC_IP_ADDRESS@"
+ - key: ENB_IPV4_ADDRESS_FOR_X2C
+ env: "@RCC_IP_ADDRESS@"
+ - key: local_if_name
+ env: "@IF4P5_IF_NAME@"
+ - key: remote_address
+ env: "@IF4P5_RRU_IP_ADDRESS@"
+ - key: local_address
+ env: "@IF4P5_RCC_IP_ADDRESS@"
+
+ - filePrefix: "rcc.band40.tm1.25PRB"
+ outputfilename: "rcc.if4p5.tdd.conf"
+ config:
+ - key: Active_eNBs
+ env: "@ENB_NAME@"
+ - key: eNB_name
+ env: "@ENB_NAME@"
+ - key: plmn_list
+ env:
+ mcc: "@MCC@"
+ mnc: "@MNC@"
+ mnc_length: "@MNC_LENGTH@"
+ - key: tracking_area_code
+ env: "@TAC@"
+ - key: eutra_band
+ env: "@UTRA_BAND_ID@"
+ - key: downlink_frequency
+ env: "@DL_FREQUENCY_IN_MHZ@000000"
+ - key: uplink_frequency_offset
+ env: "@UL_FREQUENCY_OFFSET_IN_MHZ@000000"
+ - key: Nid_cell
+ env: "@NID_CELL@"
+ - key: N_RB_DL
+ env: "@NB_PRB@"
+ - key: ipv4
+ env: "@MME_S1C_IP_ADDRESS@"
+ - key: ENB_INTERFACE_NAME_FOR_S1_MME
+ env: "@RCC_IF_NAME@"
+ - key: ENB_IPV4_ADDRESS_FOR_S1_MME
+ env: "@RCC_S1C_IP_ADDRESS@"
+ - key: ENB_INTERFACE_NAME_FOR_S1U
+ env: "@RCC_IF_NAME@"
+ - key: ENB_IPV4_ADDRESS_FOR_S1U
+ env: "@RCC_IP_ADDRESS@"
+ - key: ENB_IPV4_ADDRESS_FOR_X2C
+ env: "@RCC_IP_ADDRESS@"
+ - key: local_if_name
+ env: "@IF4P5_IF_NAME@"
+ - key: remote_address
+ env: "@IF4P5_RRU_IP_ADDRESS@"
+ - key: local_address
+ env: "@IF4P5_RCC_IP_ADDRESS@"
+
diff --git a/docker/scripts/generateTemplate.py b/docker/scripts/generateTemplate.py
index 4949e9cf21..5ce0d146e5 100644
--- a/docker/scripts/generateTemplate.py
+++ b/docker/scripts/generateTemplate.py
@@ -35,21 +35,28 @@ def main():
data = yaml.full_load(f)
dir = os.listdir(f'{data[0]["paths"]["source_dir"]}')
-
#identify configs, read and replace corresponding values
for config in data[1]["configurations"]:
filePrefix = config["filePrefix"]
outputfilename = config["outputfilename"]
+ print('================================================')
+ print('filePrefix = ' + filePrefix)
+ print('outputfilename = ' + outputfilename)
for inputfile in dir:
if inputfile.find(filePrefix) >=0:
- prefix_outputfile = {"cu": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
- "du": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
+ prefix_outputfile = {"cu.band7.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
+ "du.band7.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"rru.fdd": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"rru.tdd": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"enb.band7.tm1.25PRB.usrpb210": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"enb.band40.tm1.25PRB.FairScheduler.usrpb210": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
- "rcc.band7.tm1.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}'
+ "rcc.band7.tm1.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
+ "rcc.band7.tm1.if4p5.lo.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
+ "rcc.band40.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
+ "ue.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
+ "ue_sim_ci": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}'
}
+ print('inputfile = ' + inputfile)
if filePrefix in prefix_outputfile:
outputfile1 = prefix_outputfile[filePrefix]
@@ -61,6 +68,9 @@ def main():
open(outputfile1, mode='w') as outputfile:
for line in inputfile:
count = 0
+ if re.search(r'EHPLMN_LIST', line):
+ outputfile.write(line)
+ continue
for key in config["config"]:
if line.find(key["key"]) >= 0:
count += 1
diff --git a/docker/scripts/lte_ru_entrypoint.sh b/docker/scripts/lte_ru_entrypoint.sh
new file mode 100755
index 0000000000..f466e25ec2
--- /dev/null
+++ b/docker/scripts/lte_ru_entrypoint.sh
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+set -euo pipefail
+
+PREFIX=/opt/oai-lte-ru
+
+# Based another env var, pick one template to use
+if [[ -v USE_FDD_RRU ]]; then ln -s $PREFIX/etc/rru.fdd.conf $PREFIX/etc/rru.conf; fi
+if [[ -v USE_TDD_RRU ]]; then ln -s $PREFIX/etc/rru.tdd.conf $PREFIX/etc/rru.conf; fi
+
+# Only this template will be manipulated
+CONFIG_FILES=`ls $PREFIX/etc/rru.conf || true`
+
+for c in ${CONFIG_FILES}; do
+ # grep variable names (format: ${VAR}) from template to be rendered
+ VARS=$(grep -oP '@[a-zA-Z0-9_]+@' ${c} | sort | uniq | xargs)
+
+ # create sed expressions for substituting each occurrence of ${VAR}
+ # with the value of the environment variable "VAR"
+ EXPRESSIONS=""
+ for v in ${VARS}; do
+ NEW_VAR=`echo $v | sed -e "s#@##g"`
+ if [[ "${!NEW_VAR}x" == "x" ]]; then
+ echo "Error: Environment variable '${NEW_VAR}' is not set." \
+ "Config file '$(basename $c)' requires all of $VARS."
+ exit 1
+ fi
+ EXPRESSIONS="${EXPRESSIONS};s|${v}|${!NEW_VAR}|g"
+ done
+ EXPRESSIONS="${EXPRESSIONS#';'}"
+
+ # render template and inline replace config file
+ sed -i "${EXPRESSIONS}" ${c}
+done
+
+# Load the USRP binaries
+if [[ -v USE_B2XX ]]; then
+ /usr/lib/uhd/utils/uhd_images_downloader.py -t b2xx
+elif [[ -v USE_X3XX ]]; then
+ /usr/lib/uhd/utils/uhd_images_downloader.py -t x3xx
+elif [[ -v USE_N3XX ]]; then
+ /usr/lib/uhd/utils/uhd_images_downloader.py -t n3xx
+fi
+
+echo "=================================="
+echo "== Starting eNB soft modem"
+if [[ -v USE_ADDITIONAL_OPTIONS ]]; then
+ echo "Additional option(s): ${USE_ADDITIONAL_OPTIONS}"
+ new_args=()
+ while [[ $# -gt 0 ]]; do
+ new_args+=("$1")
+ shift
+ done
+ for word in ${USE_ADDITIONAL_OPTIONS}; do
+ new_args+=("$word")
+ done
+ echo "${new_args[@]}"
+ exec "${new_args[@]}"
+else
+ echo "$@"
+ exec "$@"
+fi
diff --git a/docker/scripts/lte_ue_entrypoint.sh b/docker/scripts/lte_ue_entrypoint.sh
new file mode 100755
index 0000000000..235128f738
--- /dev/null
+++ b/docker/scripts/lte_ue_entrypoint.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+
+set -euo pipefail
+
+PREFIX=/opt/oai-lte-ue
+
+# Based another env var, pick one template to use
+if [[ -v USE_NFAPI ]]; then ln -s $PREFIX/etc/ue.nfapi.conf $PREFIX/etc/ue.conf; fi
+
+# Only this template will be manipulated and the USIM one!
+CONFIG_FILES=`ls $PREFIX/etc/ue.conf $PREFIX/etc/ue_usim.conf || true`
+
+for c in ${CONFIG_FILES}; do
+ # grep variable names (format: ${VAR}) from template to be rendered
+ VARS=$(grep -oP '@[a-zA-Z0-9_]+@' ${c} | sort | uniq | xargs)
+
+ # create sed expressions for substituting each occurrence of ${VAR}
+ # with the value of the environment variable "VAR"
+ EXPRESSIONS=""
+ for v in ${VARS}; do
+ NEW_VAR=`echo $v | sed -e "s#@##g"`
+ if [[ "${!NEW_VAR}x" == "x" ]]; then
+ echo "Error: Environment variable '${NEW_VAR}' is not set." \
+ "Config file '$(basename $c)' requires all of $VARS."
+ exit 1
+ fi
+ EXPRESSIONS="${EXPRESSIONS};s|${v}|${!NEW_VAR}|g"
+ done
+ EXPRESSIONS="${EXPRESSIONS#';'}"
+
+ # render template and inline replace config file
+ sed -i "${EXPRESSIONS}" ${c}
+done
+
+#now generate USIM files
+# At this point all operations will be run from $PREFIX!
+cd $PREFIX
+$PREFIX/bin/conf2uedata -c $PREFIX/etc/ue_usim.conf -o $PREFIX
+
+# Load the USRP binaries
+if [[ -v USE_B2XX ]]; then
+ /usr/lib/uhd/utils/uhd_images_downloader.py -t b2xx
+elif [[ -v USE_X3XX ]]; then
+ /usr/lib/uhd/utils/uhd_images_downloader.py -t x3xx
+elif [[ -v USE_N3XX ]]; then
+ /usr/lib/uhd/utils/uhd_images_downloader.py -t n3xx
+fi
+
+# in case we have conf file, append
+new_args=()
+while [[ $# -gt 0 ]]; do
+ new_args+=("$1")
+ shift
+done
+if [[ -v USE_NFAPI ]]; then
+ new_args+=("-O")
+ new_args+=("$PREFIX/etc/ue.conf")
+fi
+
+echo "=================================="
+echo "== Starting LTE UE soft modem"
+if [[ -v USE_ADDITIONAL_OPTIONS ]]; then
+ echo "Additional option(s): ${USE_ADDITIONAL_OPTIONS}"
+ for word in ${USE_ADDITIONAL_OPTIONS}; do
+ new_args+=("$word")
+ done
+ echo "${new_args[@]}"
+ exec "${new_args[@]}"
+else
+ echo "${new_args[@]}"
+ exec "${new_args[@]}"
+fi
diff --git a/docker/scripts/lte_ue_parameters.yaml b/docker/scripts/lte_ue_parameters.yaml
new file mode 100644
index 0000000000..977659bb54
--- /dev/null
+++ b/docker/scripts/lte_ue_parameters.yaml
@@ -0,0 +1,37 @@
+#/*
+# * 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
+# */
+
+---
+- paths:
+ source_dir: "ci-scripts/conf_files/"
+ dest_dir: docker/etc
+
+- configurations:
+ - filePrefix: ue.nfapi
+ outputfilename: "ue.nfapi.conf"
+ config:
+ - key: remote_n_address
+ env: "@ENB_IP_ADDRESS@"
+ - key: local_n_address
+ env: "@LTE_UE_IP_ADDRESS@"
+ - key: local_n_if_name
+ env: "@UE_NFAPI_IF_NAME@"
+
diff --git a/docker/scripts/lte_ue_sim_parameters.yaml b/docker/scripts/lte_ue_sim_parameters.yaml
new file mode 100644
index 0000000000..a339ed7504
--- /dev/null
+++ b/docker/scripts/lte_ue_sim_parameters.yaml
@@ -0,0 +1,47 @@
+#/*
+# * 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
+# */
+
+---
+- paths:
+ source_dir: "openair3/NAS/TOOLS/"
+ dest_dir: docker/etc
+
+- configurations:
+ - filePrefix: ue_sim_ci
+ outputfilename: "ue_usim.conf"
+ config:
+ - key: MNC
+ env: "@MNC@"
+ - key: MCC
+ env: "@MCC@"
+ - key: MSIN
+ env: "@SHORT_IMSI@"
+ - key: USIM_API_K
+ env: "@LTE_KEY@"
+ - key: OPC
+ env: "@OPC@"
+ - key: MSISDN
+ env: "@MSISDN@"
+ - key: HPLMN
+ env: "@HPLMN@"
+ - key: OPLMN_LIST
+ env: "@HPLMN@"
+
diff --git a/executables/main-fs6.c b/executables/main-fs6.c
index 5283ce5eaa..438edb4044 100644
--- a/executables/main-fs6.c
+++ b/executables/main-fs6.c
@@ -750,7 +750,7 @@ void phy_procedures_eNB_uespec_RX_fromsplit(uint8_t *bufferZone, int nbBlocks,PH
recvFs6Ul(bufferZone, nbBlocks, eNB, ul_propa);
// dirty memory allocation in OAI...
- for (int i = 0; i < NUMBER_OF_UCI_VARS_MAX; i++)
+ for (int i = 0; i < NUMBER_OF_UCI_MAX; i++)
if ( eNB->uci_vars[i].frame == proc->frame_rx &&
eNB->uci_vars[i].subframe == proc->subframe_rx )
eNB->uci_vars[i].active=0;
@@ -1145,7 +1145,7 @@ void appendFs6DLUEcch(uint8_t *bufferZone, PHY_VARS_eNB *eNB, int frame, int sub
commonUDP_t *newUDPheader=(commonUDP_t *) firstFreeByte;
bool first_UE=true;
- for (int i = 0; i < NUMBER_OF_UCI_VARS_MAX; i++) {
+ for (int i = 0; i < NUMBER_OF_UCI_MAX; i++) {
LTE_eNB_UCI *uci = &(eNB->uci_vars[i]);
if ((uci->active == 1) && (uci->frame == frame) && (uci->subframe == subframe)) {
diff --git a/executables/main-ocp.c b/executables/main-ocp.c
index 8ceab3d61c..0dd670790c 100644
--- a/executables/main-ocp.c
+++ b/executables/main-ocp.c
@@ -203,7 +203,6 @@ void init_eNB_afterRU(void) {
for (int inst=0; instframe_parms.nb_antennas_rx = 0;
eNB->frame_parms.nb_antennas_tx = 0;
eNB->prach_vars.rxsigF[0] = (int16_t **)malloc16(64*sizeof(int16_t *));
@@ -229,12 +228,26 @@ void init_eNB_afterRU(void) {
for (int ce_level=0; ce_level<4; ce_level++)
eNB->prach_vars_br.rxsigF[ce_level][aa] = eNB->RU_list[ru_id]->prach_rxsigF_br[ce_level][i];
- eNB->common_vars.rxdataF[aa] = eNB->RU_list[ru_id]->common.rxdataF[i];
}
}
- AssertFatal( eNB->frame_parms.nb_antennas_rx > 0 && eNB->frame_parms.nb_antennas_rx < 4, "");
- AssertFatal( eNB->frame_parms.nb_antennas_tx > 0 && eNB->frame_parms.nb_antennas_rx < 4, "");
+
+ AssertFatal( eNB->frame_parms.nb_antennas_rx > 0 && eNB->frame_parms.nb_antennas_rx < 5, "");
+ AssertFatal( eNB->frame_parms.nb_antennas_tx > 0 && eNB->frame_parms.nb_antennas_rx < 5, "");
+
+ phy_init_lte_eNB(eNB,0,0);
+
+ // need to copy rxdataF after L1 variables are allocated
+ for (int inst=0; instnum_RU; ru_id++) {
+ for (int i=0; iRU_list[ru_id]->nb_rx; aa++,i++)
+ eNB->common_vars.rxdataF[aa] = eNB->RU_list[ru_id]->common.rxdataF[i];
+ }
+ }
+ }
+
LOG_I(PHY,"inst %d, CC_id %d : nb_antennas_rx %d\n",inst,CC_id,eNB->frame_parms.nb_antennas_rx);
init_transport(eNB);
//init_precoding_weights(RC.eNB[inst][CC_id]);
@@ -801,7 +814,7 @@ int init_rf(RU_t *ru) {
pthread_setname_np(pthread_self(),name);
return ret;
}
-
+
void ocp_init_RU(RU_t *ru, char *rf_config_file, int send_dmrssync) {
PHY_VARS_eNB *eNB0= (PHY_VARS_eNB *)NULL;
int i;
diff --git a/executables/main_ru.c b/executables/main_ru.c
new file mode 100644
index 0000000000..93a580560e
--- /dev/null
+++ b/executables/main_ru.c
@@ -0,0 +1,382 @@
+/*
+ * 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 oairu.c
+ * \brief Top-level threads for radio-unit
+ * \author R. Knopp
+ * \date 2020
+ * \version 0.1
+ * \company Eurecom
+ * \email: knopp@eurecom.fr
+ * \note
+ * \warning
+ */
+
+
+#define _GNU_SOURCE /* See feature_test_macros(7) */
+#include
+
+
+
+
+#include "assertions.h"
+#include "PHY/types.h"
+
+#include "PHY/defs_RU.h"
+#include "common/config/config_userapi.h"
+#include "common/utils/load_module_shlib.h"
+
+
+#include "../../ARCH/COMMON/common_lib.h"
+#include "../../ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
+
+
+#include "PHY/phy_vars.h"
+#include "SCHED/sched_common_vars.h"
+#include "PHY/TOOLS/phy_scope_interface.h"
+#include "common/utils/LOG/log.h"
+#include "common/utils/LOG/vcd_signal_dumper.h"
+#include "PHY/INIT/phy_init.h"
+#include "openair2/ENB_APP/enb_paramdef.h"
+#include "system.h"
+
+#include
+#include
+#include
+
+static int DEFBANDS[] = {7};
+static int DEFENBS[] = {0};
+static int DEFBFW[] = {0x00007fff};
+
+THREAD_STRUCT thread_struct;
+
+pthread_cond_t sync_cond;
+pthread_mutex_t sync_mutex;
+int sync_var=-1; //!< protected by mutex \ref sync_mutex.
+int config_sync_var=-1;
+
+volatile int oai_exit = 0;
+uint16_t sf_ahead = 4;
+RU_t ru_m;
+
+
+extern void init_RU0(RU_t *ru,int ru_id,char *rf_config_file, int send_dmrssync);
+extern void init_RU_proc(RU_t *ru);
+extern void kill_RU_proc(RU_t *ru);
+extern void set_function_spec_param(RU_t *ru);
+
+int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
+
+
+void nfapi_setmode(nfapi_mode_t nfapi_mode) { return; }
+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);
+ }
+ close_log_mem();
+ oai_exit = 1;
+
+ if (ru_m.rfdevice.trx_end_func) {
+ ru_m.rfdevice.trx_end_func(&ru_m.rfdevice);
+ ru_m.rfdevice.trx_end_func = NULL;
+ }
+
+ if (ru_m.ifdevice.trx_end_func) {
+ ru_m.ifdevice.trx_end_func(&ru_m.ifdevice);
+ ru_m.ifdevice.trx_end_func = NULL;
+ }
+
+ pthread_mutex_destroy(ru_m.ru_mutex);
+ pthread_cond_destroy(ru_m.ru_cond);
+ sleep(1); //allow lte-softmodem threads to exit first
+ exit(1);
+}
+
+
+static void get_options(void) {
+ CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
+ get_common_options(SOFTMODEM_ENB_BIT );
+ CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP);
+
+ //RCConfig();
+
+}
+
+
+
+
+
+extern void phy_free_RU(RU_t *);
+
+nfapi_mode_t nfapi_getmode(void) {
+ return(NFAPI_MODE_PNF);
+}
+
+void oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind) {
+
+ AssertFatal(1==0,"This is bad ... please check why we get here\n");
+}
+
+void wait_eNBs(void){ return; }
+
+uint64_t downlink_frequency[MAX_NUM_CCs][4];
+
+
+int main ( int argc, char **argv )
+{
+
+ if ( load_configmodule(argc,argv,0) == NULL) {
+ exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
+ }
+
+ logInit();
+ printf("Reading in command-line options\n");
+ get_options ();
+
+ if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) {
+ fprintf(stderr,"Getting configuration failed\n");
+ exit(-1);
+ }
+
+#if T_TRACER
+ T_Config_Init();
+#endif
+ printf("configuring for RRU\n");
+
+#ifndef PACKAGE_VERSION
+# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
+#endif
+ LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
+
+ /* Read configuration */
+
+ printf("About to Init RU threads\n");
+
+
+ RU_t *ru=&ru_m;
+
+ 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);
+
+ int j=0;
+ uint64_t ru_mask=1;
+ pthread_mutex_t ru_mutex; pthread_mutex_init(&ru_mutex,NULL);
+ pthread_cond_t ru_cond; pthread_cond_init(&ru_cond,NULL);
+
+ ru->ru_mask= &ru_mask;
+ ru->ru_mutex = &ru_mutex;
+ ru->ru_cond = &ru_cond;
+
+ ru->if_timing = synch_to_ext_device;
+ ru->num_eNB = 0;
+ ru->has_ctrl_prt = 1;
+ 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 (config_isparamset(RUParamList.paramarray[j], RU_SDR_TME_SRC)) {
+ if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "internal") == 0) {
+ ru->openair0_cfg.time_source = internal;
+ LOG_D(PHY, "RU time source set as internal\n");
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "external") == 0) {
+ ru->openair0_cfg.time_source = external;
+ LOG_D(PHY, "RU time source set as external\n");
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "gpsdo") == 0) {
+ ru->openair0_cfg.time_source = gpsdo;
+ LOG_D(PHY, "RU time source set as gpsdo\n");
+ } else {
+ LOG_E(PHY, "Erroneous RU time source in the provided configuration file: '%s'\n", *(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr));
+ }
+ }
+ else {
+ ru->openair0_cfg.time_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)) ) {
+ AssertFatal(1==0,"IF_NAME is required\n");
+ } else {
+ ru->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr));
+ ru->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr));
+ ru->eth_params.remote_addr = strdup(*(RUParamList.paramarray[j][RU_REMOTE_ADDRESS_IDX].strptr));
+ ru->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr);
+ ru->eth_params.remote_portd = *(RUParamList.paramarray[j][RU_REMOTE_PORTD_IDX].uptr);
+
+ // Check if control port set
+ if (!(config_isparamset(RUParamList.paramarray[j],RU_REMOTE_PORTC_IDX)) ) {
+ printf("Removing control port for RU %d\n",j);
+ ru->has_ctrl_prt = 0;
+ } else {
+ ru->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr);
+ ru->eth_params.remote_portc = *(RUParamList.paramarray[j][RU_REMOTE_PORTC_IDX].uptr);
+ printf(" Control port %u \n",ru->eth_params.my_portc);
+ }
+
+ if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp") == 0) {
+ ru->if_south = LOCAL_RF;
+ ru->function = NGFI_RRU_IF5;
+ ru->eth_params.transp_preference = ETH_UDP_MODE;
+ printf("Setting function for RU %d to NGFI_RRU_IF5 (udp)\n",j);
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) {
+ ru->if_south = LOCAL_RF;
+ ru->function = NGFI_RRU_IF5;
+ ru->eth_params.transp_preference = ETH_RAW_MODE;
+ printf("Setting function for RU %d to NGFI_RRU_IF5 (raw)\n",j);
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_if4p5") == 0) {
+ ru->if_south = LOCAL_RF;
+ ru->function = NGFI_RRU_IF4p5;
+ ru->eth_params.transp_preference = ETH_UDP_IF4p5_MODE;
+ printf("Setting function for RU %d to NGFI_RRU_IF4p5 (udp)\n",j);
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw_if4p5") == 0) {
+ ru->if_south = LOCAL_RF;
+ ru->function = NGFI_RRU_IF4p5;
+ ru->eth_params.transp_preference = ETH_RAW_IF4p5_MODE;
+ printf("Setting function for RU %d to NGFI_RRU_IF4p5 (raw)\n",j);
+ }
+
+ printf("RU %d is_slave=%s\n",j,*(RUParamList.paramarray[j][RU_IS_SLAVE_IDX].strptr));
+
+ if (strcmp(*(RUParamList.paramarray[j][RU_IS_SLAVE_IDX].strptr), "yes") == 0) ru->is_slave=1;
+ else ru->is_slave=0;
+
+ printf("RU %d ota_sync_enabled=%s\n",j,*(RUParamList.paramarray[j][RU_OTA_SYNC_ENABLE_IDX].strptr));
+
+ if (strcmp(*(RUParamList.paramarray[j][RU_OTA_SYNC_ENABLE_IDX].strptr), "yes") == 0) ru->ota_sync_enable=1;
+ else ru->ota_sync_enable=0;
+ }
+
+ 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;
+ /* sf_extension is in unit of samples for 30.72MHz here, has to be scaled later */
+ ru->sf_extension = *(RUParamList.paramarray[j][RU_SF_EXTENSION_IDX].uptr);
+
+ for (int i=0; inum_bands; i++) ru->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i];
+ } //strcmp(local_rf, "yes") == 0
+ else {
+ printf("RU %d: Transport %s\n",j,*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr));
+ ru->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr));
+ ru->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr));
+ ru->eth_params.remote_addr = strdup(*(RUParamList.paramarray[j][RU_REMOTE_ADDRESS_IDX].strptr));
+ ru->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr);
+ ru->eth_params.remote_portc = *(RUParamList.paramarray[j][RU_REMOTE_PORTC_IDX].uptr);
+ ru->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr);
+ ru->eth_params.remote_portd = *(RUParamList.paramarray[j][RU_REMOTE_PORTD_IDX].uptr);
+
+ if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp") == 0) {
+ ru->if_south = REMOTE_IF5;
+ ru->function = NGFI_RAU_IF5;
+ ru->eth_params.transp_preference = ETH_UDP_MODE;
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) {
+ ru->if_south = REMOTE_IF5;
+ ru->function = NGFI_RAU_IF5;
+ ru->eth_params.transp_preference = ETH_RAW_MODE;
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_if4p5") == 0) {
+ ru->if_south = REMOTE_IF4p5;
+ ru->function = NGFI_RAU_IF4p5;
+ ru->eth_params.transp_preference = ETH_UDP_IF4p5_MODE;
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw_if4p5") == 0) {
+ ru->if_south = REMOTE_IF4p5;
+ ru->function = NGFI_RAU_IF4p5;
+ ru->eth_params.transp_preference = ETH_RAW_IF4p5_MODE;
+ }
+
+ if (strcmp(*(RUParamList.paramarray[j][RU_IS_SLAVE_IDX].strptr), "yes") == 0) ru->is_slave=1;
+ else ru->is_slave=0;
+ } /* strcmp(local_rf, "yes") != 0 */
+
+ 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);
+
+
+ set_worker_conf("WORKER_ENABLE");
+
+ mlockall(MCL_CURRENT | MCL_FUTURE);
+ pthread_cond_init(&sync_cond,NULL);
+ pthread_mutex_init(&sync_mutex, NULL);
+
+ init_RU0(ru,0,get_softmodem_params()->rf_config_file,get_softmodem_params()->send_dmrs_sync);
+ ru->rf_map.card=0;
+ ru->rf_map.chain=(get_softmodem_params()->chain_offset);
+
+ LOG_I(PHY, "Initializing RRU descriptor : (%s,%s,%d)\n", ru_if_types[ru->if_south], NB_timing[ru->if_timing], ru->function);
+ set_function_spec_param(ru);
+ LOG_I(PHY, "Starting ru_thread , is_slave %d, send_dmrs %d\n", ru->is_slave, ru->generate_dmrs_sync);
+ init_RU_proc(ru);
+
+ pthread_mutex_lock(&ru_mutex);
+ while (ru_mask>0)
+ pthread_cond_wait(&ru_cond,&ru_mutex);
+ pthread_mutex_unlock(&ru_mutex);
+ LOG_I(PHY,"RU configured, unlocking threads\n");
+ config_sync_var=0;
+ pthread_mutex_lock(&sync_mutex);
+ sync_var=0;
+ pthread_cond_broadcast(&sync_cond);
+ pthread_mutex_unlock(&sync_mutex);
+
+ while (oai_exit==0) sleep(1);
+ // stop threads
+
+ kill_RU_proc(ru);
+ phy_free_RU(ru);
+
+ free_lte_top();
+ end_configmodule();
+
+ if (ru->rfdevice.trx_end_func) {
+ ru->rfdevice.trx_end_func(&ru->rfdevice);
+ ru->rfdevice.trx_end_func = NULL;
+ }
+
+ if (ru->ifdevice.trx_end_func) {
+ ru->ifdevice.trx_end_func(&ru->ifdevice);
+ ru->ifdevice.trx_end_func = NULL;
+ }
+
+
+
+ logClean();
+ printf("Bye.\n");
+ return 0;
+}
diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c
index ff7d15a96d..e9319f9d3c 100644
--- a/executables/nr-gnb.c
+++ b/executables/nr-gnb.c
@@ -87,6 +87,7 @@
#include "nfapi/oai_integration/vendor_ext.h"
#include
#include
+#include
//#define DEBUG_THREADS 1
//#define USRP_DEBUG 1
@@ -358,7 +359,7 @@ void *nrL1_stats_thread(void *param) {
AssertFatal(fd!=NULL,"Cannot open nrL1_stats.log\n");
dump_nr_I0_stats(fd,gNB);
dump_pusch_stats(fd,gNB);
- // dump_uci_stats(fd,eNB,eNB->proc.L1_proc_tx.frame_tx);
+ // nr_dump_uci_stats(fd,eNB,eNB->proc.L1_proc_tx.frame_tx);
fclose(fd);
}
return(NULL);
@@ -372,7 +373,9 @@ void init_gNB_Tpool(int inst) {
// ULSCH decoding threadpool
gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
int numCPU = sysconf(_SC_NPROCESSORS_ONLN);
+ LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->pusch_proc_threads,numCPU);
int threadCnt = min(numCPU, gNB->pusch_proc_threads);
+ if (threadCnt < 2) LOG_E(PHY,"Number of threads for gNB should be more than 1. Allocated only %d\n",threadCnt);
char ul_pool[80];
sprintf(ul_pool,"-1");
int s_offset = 0;
@@ -402,7 +405,6 @@ void init_gNB_Tpool(int inst) {
if(opp_enabled == 1) threadCreate(&proc->process_stats_thread, process_stats_thread,(void *)gNB, "time_meas", -1, OAI_PRIORITY_RT_LOW);
threadCreate(&proc->L1_stats_thread,nrL1_stats_thread,(void*)gNB,"L1_stats",-1,OAI_PRIORITY_RT_LOW);
-
}
@@ -491,8 +493,6 @@ printf("after %p\n", gNB->common_vars.rxdataF[aa]);
}
-
-
void init_gNB(int single_thread_flag,int wait_for_sync) {
int inst;
diff --git a/executables/nr-ru.c b/executables/nr-ru.c
index b3acde7e99..be6d13daad 100644
--- a/executables/nr-ru.c
+++ b/executables/nr-ru.c
@@ -24,14 +24,8 @@
#include
#include
#include
-#include
-#include
-#include
#include
#include
-#include
-#include
-#include
#include
#include
@@ -39,7 +33,6 @@
#include "common/utils/assertions.h"
#include "common/utils/system.h"
-#include "msc.h"
#include "../../ARCH/COMMON/common_lib.h"
#include "../../ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
@@ -50,20 +43,15 @@
#include "PHY/types.h"
#include "PHY/defs_nr_common.h"
#include "PHY/phy_extern.h"
-#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
#include "PHY/INIT/phy_init.h"
-#include "SCHED/sched_eNB.h"
#include "SCHED_NR/sched_nr.h"
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
-#include "RRC/LTE/rrc_extern.h"
-#include "PHY_INTERFACE/phy_interface.h"
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
-#include "enb_config.h"
#include
#ifdef SMBV
@@ -112,6 +100,7 @@ void configure_ru(int idx, void *arg);
void configure_rru(int idx, void *arg);
int attach_rru(RU_t *ru);
int connect_rau(RU_t *ru);
+static void NRRCconfig_RU(void);
uint16_t sf_ahead;
uint16_t slot_ahead;
@@ -757,9 +746,9 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
// currently we switch beams every 10 slots (should = 1 TDD period in FR2) and we take the beam index of the first symbol of the first slot of this period
int beam=0;
if (slot%10==0) {
- if (ru->common.beam_id[0][slot*fp->symbols_per_slot] < 8) {
- beam = ru->common.beam_id[0][slot*fp->symbols_per_slot] | 8;
- }
+ if ( ru->common.beam_id && (ru->common.beam_id[0][slot*fp->symbols_per_slot] < 8)) {
+ beam = ru->common.beam_id[0][slot*fp->symbols_per_slot] | 8;
+ }
}
/*
if (slot==0 || slot==40) beam=0|8;
@@ -1397,7 +1386,6 @@ void *ru_thread( void *param ) {
}
}
-
// At this point, all information for subframe has been received on FH interface
res = pullTpool(gNB->resp_L1, gNB->threadPool);
syncMsg = (processingData_L1_t *)NotifiedFifoData(res);
@@ -1410,7 +1398,6 @@ void *ru_thread( void *param ) {
res->key = proc->tti_rx;
pushTpool(gNB->threadPool, res);
-
}
printf( "Exiting ru_thread \n");
@@ -1851,7 +1838,7 @@ void init_NR_RU(char *rf_config_file)
pthread_cond_init(&RC.ru_cond,NULL);
// read in configuration file)
printf("configuring RU from file\n");
- RCconfig_RU();
+ NRRCconfig_RU();
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);
@@ -1926,7 +1913,7 @@ void stop_RU(int nb_ru)
/* --------------------------------------------------------*/
/* from here function to use configuration module */
-void RCconfig_RU(void)
+static void NRRCconfig_RU(void)
{
int i = 0, j = 0;
paramdef_t RUParams[] = RUPARAMS_DESC;
@@ -1993,9 +1980,9 @@ void RCconfig_RU(void)
}
else {
LOG_I(PHY,"Setting time source to internal\n");
- RC.ru[j]->openair0_cfg.time_source = internal;
+ RC.ru[j]->openair0_cfg.time_source = internal;
}
-
+
if (strcmp(*(RUParamList.paramarray[j][RU_LOCAL_RF_IDX].strptr), "yes") == 0) {
if ( !(config_isparamset(RUParamList.paramarray[j],RU_LOCAL_IF_NAME_IDX)) ) {
RC.ru[j]->if_south = LOCAL_RF;
@@ -2065,7 +2052,7 @@ void RCconfig_RU(void)
RC.ru[j]->if_south = REMOTE_IF4p5;
RC.ru[j]->function = NGFI_RAU_IF4p5;
RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF4p5_MODE;
- }
+ }
} /* strcmp(local_rf, "yes") != 0 */
RC.ru[j]->nb_tx = *(RUParamList.paramarray[j][RU_NB_TX_IDX].uptr);
diff --git a/executables/nr-softmodem-common.h b/executables/nr-softmodem-common.h
index 813ffcf8fa..00f786dfdc 100644
--- a/executables/nr-softmodem-common.h
+++ b/executables/nr-softmodem-common.h
@@ -69,6 +69,7 @@
#define CONFIG_HLP_EXMCAL "Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n"
#define CONFIG_HLP_ITTIL "Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n"
#define CONFIG_HLP_DLMCS_PHYTEST "Set the downlink MCS for PHYTEST mode\n"
+#define CONFIG_HLP_DLNL_PHYTEST "Set the downlink nrOfLayers for PHYTEST mode\n"
#define CONFIG_HLP_STMON "Enable processing timing measurement of lte softmodem on per subframe basis \n"
#define CONFIG_HLP_PRB "Set the PRB, valid values: 6, 25, 50, 100 \n"
#define CONFIG_HLP_MSLOTS "Skip the missed slots/subframes \n"
diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c
index c7e636736b..ee82684b7b 100644
--- a/executables/nr-softmodem.c
+++ b/executables/nr-softmodem.c
@@ -163,10 +163,17 @@ int otg_enabled;
uint32_t timing_advance = 0;
uint64_t num_missed_slots=0; // counter for the number of missed slots
+#include
+#include
+
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");
}
+void sendFs6Ulharq(enum pckType type, 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, uint16_t rnti, int32_t stat) {
+ AssertFatal(false, "Must not be called in this context\n");
+}
+
extern void reset_opp_meas(void);
extern void print_opp_meas(void);
@@ -363,35 +370,10 @@ int create_gNB_tasks(uint32_t gnb_nb) {
}
}
- if (itti_create_task (TASK_GTPV1_U, &nr_gtpv1u_gNB_task, NULL) < 0) {
+ /*if (itti_create_task (TASK_GTPV1_U, &nr_gtpv1u_gNB_task, NULL) < 0) {
LOG_E(GTPU, "Create task for GTPV1U failed\n");
return -1;
- }
- }
- }
-
- if (AMF_MODE_ENABLED && (get_softmodem_params()->phy_test==0 && get_softmodem_params()->do_ra==1)){
- if (gnb_nb > 0) {
- if(NGAP_CONF_MODE){
- if (itti_create_task (TASK_NGAP, ngap_gNB_task, NULL) < 0) {
- LOG_E(NGAP, "Create task for NGAP failed\n");
- return -1;
- }
- } else {
- LOG_E(NGAP, "Ngap task not created\n");
- }
-
- if(!emulate_rf){
- if (itti_create_task (TASK_UDP, udp_eNB_task, NULL) < 0) {
- LOG_E(UDP_, "Create task for UDP failed\n");
- return -1;
- }
- }
-
- if (itti_create_task (TASK_GTPV1_U, &nr_gtpv1u_gNB_task, NULL) < 0) {
- LOG_E(GTPU, "Create task for GTPV1U failed\n");
- return -1;
- }
+ }*/
}
}
@@ -406,6 +388,13 @@ int create_gNB_tasks(uint32_t gnb_nb) {
LOG_E(NR_RRC, "Create task for NR RRC gNB failed\n");
return -1;
}
+ //Use check on x2ap to consider the NSA scenario and check on AMF_MODE_ENABLED for the SA scenario
+ if(is_x2ap_enabled() || AMF_MODE_ENABLED){
+ if (itti_create_task (TASK_GTPV1_U, &nr_gtpv1u_gNB_task, NULL) < 0) {
+ LOG_E(GTPU, "Create task for GTPV1U failed\n");
+ return -1;
+ }
+ }
}
return 0;
@@ -640,34 +629,6 @@ static void wait_nfapi_init(char *thread_name) {
printf( "NFAPI: got sync (%s)\n", thread_name);
}
-void init_pdcp(void) {
- if (!NODE_IS_DU(RC.nrrrc[0]->node_type)) {
- // pdcp_layer_init();
- // pdcp_layer_init_for_CU();
- uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
- (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
- if (IS_SOFTMODEM_NOS1) {
- printf("IS_SOFTMODEM_NOS1 option enabled \n");
- pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT;
- }
-
- pdcp_module_init(pdcp_initmask);
-
- if (NODE_IS_CU(RC.nrrrc[0]->node_type)) {
- LOG_I(PDCP, "node is CU, pdcp send rlc_data_req by proto_agent \n");
- pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req);
- } else {
- LOG_I(PDCP, "node is gNB \n");
- pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
- pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
- }
- } else {
- LOG_I(PDCP, "node is DU, rlc send pdcp_data_ind by proto_agent \n");
- pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) proto_agent_send_pdcp_data_ind);
- }
-}
-
-
int main( int argc, char **argv )
{
int ru_id, CC_id = 0;
@@ -739,20 +700,12 @@ if(!IS_SOFTMODEM_NOS1)
#endif
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
-
- if(IS_SOFTMODEM_NOS1)
- init_pdcp();
-
if (RC.nb_nr_L1_inst > 0)
RCconfig_NR_L1();
// don't create if node doesn't connect to RRC/S1/GTP
AssertFatal(create_gNB_tasks(1) == 0,"cannot create ITTI tasks\n");
-
-
-
-
/* Start the agent. If it is turned off in the configuration, it won't start */
/*
RCconfig_nr_flexran();
diff --git a/executables/nr-softmodem.h b/executables/nr-softmodem.h
index 928558013c..896c363cbf 100644
--- a/executables/nr-softmodem.h
+++ b/executables/nr-softmodem.h
@@ -22,6 +22,7 @@
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \
{"m" , CONFIG_HLP_DLMCS_PHYTEST,0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \
+ {"l" , CONFIG_HLP_DLNL_PHYTEST,0, uptr:&target_dl_Nl, defintval:0, TYPE_UINT, 0}, \
{"t" , CONFIG_HLP_ULMCS_PHYTEST,0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \
{"M" , CONFIG_HLP_DLBW_PHYTEST,0, uptr:&target_dl_bw, defintval:0, TYPE_UINT, 0}, \
{"T" , CONFIG_HLP_ULBW_PHYTEST,0, uptr:&target_ul_bw, defintval:0, TYPE_UINT, 0}, \
@@ -34,6 +35,7 @@
#include "threads_t.h"
extern threads_t threads;
extern uint32_t target_dl_mcs;
+extern uint32_t target_dl_Nl;
extern uint32_t target_ul_mcs;
extern uint32_t target_dl_bw;
extern uint32_t target_ul_bw;
diff --git a/executables/nr-ue.c b/executables/nr-ue.c
index 76a7f36439..53ec70330c 100644
--- a/executables/nr-ue.c
+++ b/executables/nr-ue.c
@@ -27,6 +27,8 @@
#include "SCHED_NR_UE/phy_frame_config_nr.h"
#include "SCHED_NR_UE/defs.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
+#include "executables/softmodem-common.h"
+#include "SCHED_NR_UE/pucch_uci_ue_nr.h"
/*
* NR SLOT PROCESSING SEQUENCE
@@ -85,6 +87,14 @@
*
*/
+#ifndef NO_RAT_NR
+ #define DURATION_RX_TO_TX (NR_UE_CAPABILITY_SLOT_RX_TO_TX) /* for NR this will certainly depends to such UE capability which is not yet defined */
+#else
+ #define DURATION_RX_TO_TX (6) /* For LTE, this duration is fixed to 4 and it is linked to LTE standard for both modes FDD/TDD */
+#endif
+#define RX_JOB_ID 0x1010
+#define TX_JOB_ID 100
+
typedef enum {
pss = 0,
pbch = 1,
@@ -101,6 +111,7 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue,
ue->Mod_id = UE_id;
ue->mac_enabled = 1;
ue->if_inst = nr_ue_if_module_init(0);
+ ue->dci_thres = 0;
// Setting UE mode to NOT_SYNCHED by default
for (gNB_id = 0; gNB_id < nb_connected_gNB; gNB_id++){
@@ -123,10 +134,7 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue,
* \param arg is a pointer to a \ref PHY_VARS_NR_UE structure.
*/
-typedef struct syncData_s {
- UE_nr_rxtx_proc_t proc;
- PHY_VARS_NR_UE *UE;
-} syncData_t;
+typedef nr_rxtx_thread_data_t syncData_t;
static void UE_synch(void *arg) {
syncData_t *syncD=(syncData_t *) arg;
@@ -273,7 +281,11 @@ static void UE_synch(void *arg) {
}
}
-void processSlotTX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
+void processSlotTX(void *arg) {
+
+ nr_rxtx_thread_data_t *rxtxD = (nr_rxtx_thread_data_t *) arg;
+ UE_nr_rxtx_proc_t *proc = &rxtxD->proc;
+ PHY_VARS_NR_UE *UE = rxtxD->UE;
fapi_nr_config_request_t *cfg = &UE->nrUE_config;
int tx_slot_type = nr_ue_slot_select(cfg, proc->frame_tx, proc->nr_slot_tx);
uint8_t gNB_id = 0;
@@ -305,10 +317,14 @@ void processSlotTX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
}
}
-void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
+void processSlotRX(void *arg) {
+ nr_rxtx_thread_data_t *rxtxD = (nr_rxtx_thread_data_t *) arg;
+ UE_nr_rxtx_proc_t *proc = &rxtxD->proc;
+ PHY_VARS_NR_UE *UE = rxtxD->UE;
fapi_nr_config_request_t *cfg = &UE->nrUE_config;
int rx_slot_type = nr_ue_slot_select(cfg, proc->frame_rx, proc->nr_slot_rx);
+ int tx_slot_type = nr_ue_slot_select(cfg, proc->frame_tx, proc->nr_slot_tx);
uint8_t gNB_id = 0;
if (rx_slot_type == NR_DOWNLINK_SLOT || rx_slot_type == NR_MIXED_SLOT){
@@ -324,7 +340,7 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, no_relay, NULL );
#else
uint64_t a=rdtsc();
- phy_procedures_nrUE_RX(UE, proc, gNB_id, get_nrUE_params()->nr_dlsch_parallel);
+ 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);
#endif
@@ -342,34 +358,38 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
nr_pdcp_tick(proc->frame_rx, proc->nr_slot_rx / UE->frame_parms.slots_per_subframe);
}
}
+
+ // Wait for PUSCH processing to finish
+ notifiedFIFO_elt_t *res;
+ res = pullTpool(&rxtxD->txFifo,&(get_nrUE_params()->Tpool));
+ delNotifiedFIFO_elt(res);
+
+ } else {
+ processSlotTX(rxtxD);
}
-}
+ if (tx_slot_type == NR_UPLINK_SLOT || tx_slot_type == NR_MIXED_SLOT){
+ if (UE->UE_mode[gNB_id] <= PUSCH) {
+ if (get_softmodem_params()->usim_test==0) {
+ pucch_procedures_ue_nr(UE,
+ gNB_id,
+ proc,
+ FALSE);
+ }
-/*!
- * \brief This is the UE thread for RX subframe n and TX subframe n+4.
- * This thread performs the phy_procedures_UE_RX() on every received slot.
- * then, if TX is enabled it performs TX for n+4.
- * \param arg is a pointer to a \ref PHY_VARS_NR_UE structure.
- * \returns a pointer to an int. The storage is not on the heap and must not be freed.
- */
+ LOG_D(PHY, "Sending Uplink data \n");
+ nr_ue_pusch_common_procedures(UE,
+ proc->nr_slot_tx,
+ &UE->frame_parms,1);
+ }
-typedef struct processingData_s {
- UE_nr_rxtx_proc_t proc;
- PHY_VARS_NR_UE *UE;
-} processingData_t;
-
-void UE_processing(void *arg) {
- processingData_t *rxtxD = (processingData_t *) arg;
- UE_nr_rxtx_proc_t *proc = &rxtxD->proc;
- PHY_VARS_NR_UE *UE = rxtxD->UE;
- int slot_tx = proc->nr_slot_tx;
- int frame_tx = proc->frame_tx;
-
- processSlotRX(UE, proc);
- processSlotTX(UE, proc);
- ue_ta_procedures(UE, slot_tx, frame_tx);
+ if (UE->UE_mode[gNB_id] > NOT_SYNCHED && UE->UE_mode[gNB_id] < PUSCH) {
+ nr_ue_prach_procedures(UE, proc, gNB_id);
+ }
+ LOG_D(PHY,"****** end TX-Chain for AbsSubframe %d.%d ******\n", proc->frame_tx, proc->nr_slot_tx);
+ }
+ ue_ta_procedures(UE, proc->nr_slot_tx, proc->frame_tx);
}
void dummyWrite(PHY_VARS_NR_UE *UE,openair0_timestamp timestamp, int writeBlockSize) {
@@ -486,25 +506,44 @@ void *UE_thread(void *arg) {
int start_rx_stream = 0;
AssertFatal(0== openair0_device_load(&(UE->rfdevice), &openair0_cfg[0]), "");
UE->rfdevice.host_type = RAU_HOST;
+ UE->lost_sync = 0;
+ UE->is_synchronized = 0;
AssertFatal(UE->rfdevice.trx_start_func(&UE->rfdevice) == 0, "Could not start the device\n");
+
notifiedFIFO_t nf;
initNotifiedFIFO(&nf);
- int nbSlotProcessing=0;
- int thread_idx=0;
+
notifiedFIFO_t freeBlocks;
initNotifiedFIFO_nothreadSafe(&freeBlocks);
+
+ int nbSlotProcessing=0;
+ int thread_idx=0;
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
int timing_advance = UE->timing_advance;
- for (int i=0; iframe_parms.slots_per_frame;
int absolute_slot=0, decoded_frame_rx=INT_MAX, trashed_frames=0;
+ for (int i=0; itxFifo);
+ pushNotifiedFIFO_nothreadSafe(&freeBlocks, newElt);
+ }
+
while (!oai_exit) {
+ if (UE->lost_sync) {
+ int nb = abortTpool(&(get_nrUE_params()->Tpool),RX_JOB_ID);
+ nb += abortNotifiedFIFO(&nf, RX_JOB_ID);
+ LOG_I(PHY,"Number of aborted slots %d\n",nb);
+ for (int i=0; iis_synchronized = 0;
+ UE->lost_sync = 0;
+ }
+
if (syncRunning) {
notifiedFIFO_elt_t *res=tryPullTpool(&nf,&(get_nrUE_params()->Tpool));
@@ -514,9 +553,10 @@ void *UE_thread(void *arg) {
if (UE->is_synchronized) {
decoded_frame_rx=(((mac->mib->systemFrameNumber.buf[0] >> mac->mib->systemFrameNumber.bits_unused)<<4) | tmp->proc.decoded_frame_rx);
// shift the frame index with all the frames we trashed meanwhile we perform the synch search
- decoded_frame_rx=(decoded_frame_rx + (!UE->init_sync_frame) + trashed_frames) % MAX_FRAME_NUMBER;
+ decoded_frame_rx=(decoded_frame_rx + UE->init_sync_frame + trashed_frames) % MAX_FRAME_NUMBER;
}
delNotifiedFIFO_elt(res);
+ start_rx_stream=0;
} else {
readFrame(UE, ×tamp, true);
trashed_frames+=2;
@@ -563,13 +603,13 @@ void *UE_thread(void *arg) {
// whatever means thread_idx
// Fix me: will be wrong when slot 1 is slow, as slot 2 finishes
- // Slot 3 will overlap if RX_NB_TH is 2
+ // Slot 3 will overlap if NR_RX_NB_TH is 2
// this is general failure in UE !!!
- thread_idx = absolute_slot % RX_NB_TH;
+ thread_idx = absolute_slot % NR_RX_NB_TH;
int slot_nr = absolute_slot % nb_slot_frame;
notifiedFIFO_elt_t *msgToPush;
AssertFatal((msgToPush=pullNotifiedFIFO_nothreadSafe(&freeBlocks)) != NULL,"chained list failure");
- processingData_t *curMsg=(processingData_t *)NotifiedFifoData(msgToPush);
+ nr_rxtx_thread_data_t *curMsg=(nr_rxtx_thread_data_t *)NotifiedFifoData(msgToPush);
curMsg->UE=UE;
// update thread index for received subframe
curMsg->proc.thread_id = thread_idx;
@@ -597,18 +637,18 @@ void *UE_thread(void *arg) {
for (int i=0; iframe_parms.nb_antennas_tx; i++)
txp[i] = (void *)&UE->common_vars.txdata[i][UE->frame_parms.get_samples_slot_timestamp(
- ((slot_nr + DURATION_RX_TO_TX - RX_NB_TH)%nb_slot_frame),&UE->frame_parms,0)];
+ ((slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH)%nb_slot_frame),&UE->frame_parms,0)];
int readBlockSize, writeBlockSize;
if (slot_nr<(nb_slot_frame - 1)) {
readBlockSize=get_readBlockSize(slot_nr, &UE->frame_parms);
- writeBlockSize=UE->frame_parms.get_samples_per_slot((slot_nr + DURATION_RX_TO_TX - RX_NB_TH) % nb_slot_frame, &UE->frame_parms);
+ writeBlockSize=UE->frame_parms.get_samples_per_slot((slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH) % nb_slot_frame, &UE->frame_parms);
} else {
UE->rx_offset_diff = computeSamplesShift(UE);
readBlockSize=get_readBlockSize(slot_nr, &UE->frame_parms) -
UE->rx_offset_diff;
- writeBlockSize=UE->frame_parms.get_samples_per_slot((slot_nr + DURATION_RX_TO_TX - RX_NB_TH) % nb_slot_frame, &UE->frame_parms)- UE->rx_offset_diff;
+ writeBlockSize=UE->frame_parms.get_samples_per_slot((slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH) % nb_slot_frame, &UE->frame_parms)- UE->rx_offset_diff;
}
AssertFatal(readBlockSize ==
@@ -640,27 +680,27 @@ void *UE_thread(void *arg) {
notifiedFIFO_elt_t *res;
- while (nbSlotProcessing >= RX_NB_TH) {
+ while (nbSlotProcessing >= NR_RX_NB_TH) {
res=pullTpool(&nf, &(get_nrUE_params()->Tpool));
nbSlotProcessing--;
- processingData_t *tmp=(processingData_t *)res->msgData;
+ nr_rxtx_thread_data_t *tmp=(nr_rxtx_thread_data_t *)res->msgData;
if (tmp->proc.decoded_frame_rx != -1)
decoded_frame_rx=(((mac->mib->systemFrameNumber.buf[0] >> mac->mib->systemFrameNumber.bits_unused)<<4) | tmp->proc.decoded_frame_rx);
- else
+ else
decoded_frame_rx=-1;
pushNotifiedFIFO_nothreadSafe(&freeBlocks,res);
}
- if ( decoded_frame_rx>0 && decoded_frame_rx != curMsg->proc.frame_rx)
+ if (decoded_frame_rx>0 && decoded_frame_rx != curMsg->proc.frame_rx)
LOG_E(PHY,"Decoded frame index (%d) is not compatible with current context (%d), UE should go back to synch mode\n",
- decoded_frame_rx, curMsg->proc.frame_rx );
+ decoded_frame_rx, curMsg->proc.frame_rx);
// use previous timing_advance value to compute writeTimestamp
writeTimestamp = timestamp+
UE->frame_parms.get_samples_slot_timestamp(slot_nr,&UE->frame_parms,DURATION_RX_TO_TX
- - RX_NB_TH) - firstSymSamp - openair0_cfg[0].tx_sample_advance -
+ - NR_RX_NB_TH) - firstSymSamp - openair0_cfg[0].tx_sample_advance -
UE->N_TA_offset - timing_advance;
// but use current UE->timing_advance value to compute writeBlockSize
@@ -670,16 +710,18 @@ void *UE_thread(void *arg) {
}
int flags = 0;
- int slot_tx_usrp = slot_nr + DURATION_RX_TO_TX - RX_NB_TH;
+ int slot_tx_usrp = slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH;
if (openair0_cfg[0].duplex_mode == duplex_mode_TDD) {
uint8_t tdd_period = mac->phy_config.config_req.tdd_table.tdd_period_in_slots;
+
int nrofUplinkSlots = 0;
if (mac->scc_SIB)
- nrofUplinkSlots = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
+ nrofUplinkSlots = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
else if (mac->scc)
- nrofUplinkSlots = mac->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
+ nrofUplinkSlots = mac->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
+
uint8_t num_UL_slots = nrofUplinkSlots + (nrofUplinkSlots != 0);
uint8_t first_tx_slot = tdd_period - num_UL_slots;
@@ -706,26 +748,9 @@ void *UE_thread(void *arg) {
memset(txp[i], 0, writeBlockSize);
nbSlotProcessing++;
- msgToPush->key=slot_nr;
+ LOG_D(PHY,"Number of slots being processed at the moment: %d\n",nbSlotProcessing);
pushTpool(&(get_nrUE_params()->Tpool), msgToPush);
- if (IS_SOFTMODEM_RFSIM) { //getenv("RFSIMULATOR")
- // FixMe: Wait previous thread is done, because race conditions seems too bad
- // in case of actual RF board, the overlap between threads mitigate the issue
- // We must receive one message, that proves the slot processing is done
- res=pullTpool(&nf, &(get_nrUE_params()->Tpool));
- nbSlotProcessing--;
- processingData_t *tmp=(processingData_t *)res->msgData;
-
- if (tmp->proc.decoded_frame_rx != -1)
- decoded_frame_rx=(((mac->mib->systemFrameNumber.buf[0] >> mac->mib->systemFrameNumber.bits_unused)<<4) | tmp->proc.decoded_frame_rx);
- else
- decoded_frame_rx=-1;
- //decoded_frame_rx=tmp->proc.decoded_frame_rx;
-
- pushNotifiedFIFO_nothreadSafe(&freeBlocks,res);
- }
-
} // while !oai_exit
return NULL;
diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c
index 1b0eefd078..9f7da6336f 100644
--- a/executables/nr-uesoftmodem.c
+++ b/executables/nr-uesoftmodem.c
@@ -82,7 +82,6 @@ unsigned short config_frames[4] = {2,9,11,13};
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
#include "PHY/TOOLS/phy_scope_interface.h"
#include "PHY/TOOLS/nr_phy_scope.h"
-#define NRUE_MAIN
#include
#include "executables/softmodem-common.h"
#include "executables/thread-common.h"
@@ -91,6 +90,7 @@ unsigned short config_frames[4] = {2,9,11,13};
extern const char *duplex_mode[];
THREAD_STRUCT thread_struct;
+nrUE_params_t nrUE_params;
// Thread variables
pthread_cond_t nfapi_sync_cond;
@@ -151,8 +151,9 @@ int transmission_mode = 1;
int numerology = 0;
int oaisim_flag = 0;
int emulate_rf = 0;
-uint32_t N_RB_DL=106;
-char uecap_xer[1024],uecap_xer_in=0;
+uint32_t N_RB_DL = 106;
+char uecap_xer_in = 0;
+char uecap_xer[1024];
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
* this is very hackish - find a proper solution
@@ -181,6 +182,7 @@ struct timespec clock_difftime(struct timespec start, struct timespec end) {
void print_difftimes(void) {
LOG_I(HW,"difftimes min = %lu ns ; max = %lu ns\n", min_diff_time.tv_nsec, max_diff_time.tv_nsec);
}
+
int create_tasks_nrue(uint32_t ue_nb) {
LOG_D(NR_RRC, "%s(ue_nb:%d)\n", __FUNCTION__, ue_nb);
itti_wait_ready(1);
@@ -235,9 +237,16 @@ nrUE_params_t *get_nrUE_params(void) {
}
/* initialie thread pools used for NRUE processing paralleliation */
void init_tpools(uint8_t nun_dlsch_threads) {
- char *params=calloc(1,(RX_NB_TH*3)+1);
- for (int i=0; iframe_type);
}
- LOG_I(PHY, "Set UE N_RB_DL %d\n", N_RB_DL);
fp->N_RB_DL = N_RB_DL;
+
+ LOG_I(PHY, "Set UE N_RB_DL %d\n", N_RB_DL);
LOG_I(PHY, "Set UE nb_rx_antenna %d, nb_tx_antenna %d, threequarter_fs %d\n", fp->nb_antennas_rx, fp->nb_antennas_tx, fp->threequarter_fs);
}
@@ -351,8 +360,8 @@ void init_openair0(void) {
openair0_cfg[card].num_rb_dl = frame_parms->N_RB_DL;
openair0_cfg[card].clock_source = get_softmodem_params()->clock_source;
openair0_cfg[card].time_source = get_softmodem_params()->timing_source;
- openair0_cfg[card].tx_num_channels = min(2, frame_parms->nb_antennas_tx);
- openair0_cfg[card].rx_num_channels = min(2, frame_parms->nb_antennas_rx);
+ openair0_cfg[card].tx_num_channels = min(4, frame_parms->nb_antennas_tx);
+ openair0_cfg[card].rx_num_channels = min(4, frame_parms->nb_antennas_rx);
LOG_I(PHY, "HW: Configuring card %d, sample_rate %f, tx/rx num_channels %d/%d, duplex_mode %s\n",
card,
@@ -372,7 +381,7 @@ void init_openair0(void) {
}
}
-void init_pdcp(void) {
+static void init_pdcp(void) {
uint32_t pdcp_initmask = (!IS_SOFTMODEM_NOS1) ? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT);
/*if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) {
@@ -418,6 +427,7 @@ int main( int argc, char **argv ) {
get_options (); //Command-line options specific for NRUE
get_common_options(SOFTMODEM_5GUE_BIT );
+ init_tpools(nrUE_params.nr_dlsch_parallel);
CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP);
#if T_TRACER
T_Config_Init();
@@ -440,10 +450,6 @@ int main( int argc, char **argv ) {
#endif
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
- RC.nrrrc = (gNB_RRC_INST **)malloc(1*sizeof(gNB_RRC_INST *));
- RC.nrrrc[0] = (gNB_RRC_INST*)malloc(sizeof(gNB_RRC_INST));
- RC.nrrrc[0]->node_type = ngran_gNB;
-
init_NR_UE(1,rrc_config_path);
if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa)
init_pdcp();
@@ -479,10 +485,12 @@ int main( int argc, char **argv ) {
nrUE_config->carrier_config.ul_grid_size[nrUE_config->ssb_config.scs_common] = UE[CC_id]->frame_parms.N_RB_DL;
nrUE_config->carrier_config.dl_frequency = (downlink_frequency[0][0] -(6*UE[CC_id]->frame_parms.N_RB_DL*(15000<ssb_config.scs_common)))/1000;
nrUE_config->carrier_config.uplink_frequency = (downlink_frequency[0][0] -(6*UE[CC_id]->frame_parms.N_RB_DL*(15000<ssb_config.scs_common)))/1000;
- nrUE_config->cell_config.frame_duplex_type = TDD;
nrUE_config->ssb_table.ssb_offset_point_a = (UE[CC_id]->frame_parms.N_RB_DL - 20)>>1;
-
+ // Initialize values, will be updated upon SIB1 reception
+ nrUE_config->cell_config.frame_duplex_type = TDD;
+ nrUE_config->ssb_table.ssb_mask_list[0].ssb_mask = 0xFFFFFFFF;
+ nrUE_config->ssb_table.ssb_period = 1;
}
nr_init_frame_parms_ue(&UE[CC_id]->frame_parms, nrUE_config,
@@ -519,14 +527,6 @@ int main( int argc, char **argv ) {
// wait for end of program
printf("TYPE TO TERMINATE\n");
- //Don't understand why generation of RRCSetupRequest is called here. It seems wrong
- protocol_ctxt_t ctxt_pP = {0};
- ctxt_pP.enb_flag = ENB_FLAG_NO;
- ctxt_pP.rnti = 0x1234;
- RC.nrrrc = (gNB_RRC_INST **)malloc(1*sizeof(gNB_RRC_INST *));
- RC.nrrrc[0] = (gNB_RRC_INST*)malloc(sizeof(gNB_RRC_INST));
- RC.nrrrc[0]->node_type = ngran_gNB;
- nr_rrc_ue_generate_RRCSetupRequest(ctxt_pP.module_id, 0);
if (create_tasks_nrue(1) < 0) {
printf("cannot create ITTI tasks\n");
exit(-1); // need a softer mode
diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h
index 5ef6bffd7e..be3ca2d1a2 100644
--- a/executables/nr-uesoftmodem.h
+++ b/executables/nr-uesoftmodem.h
@@ -72,9 +72,6 @@ extern uint64_t get_nrUE_optmask(void);
extern uint64_t set_nrUE_optmask(uint64_t bitmask);
extern nrUE_params_t *get_nrUE_params(void);
-#ifdef NRUE_MAIN
-nrUE_params_t nrUE_params;
-#endif
// In nr-ue.c
extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h
index a2eb66333e..b6a2b18215 100644
--- a/executables/softmodem-common.h
+++ b/executables/softmodem-common.h
@@ -73,6 +73,7 @@ extern "C"
#define CONFIG_HLP_STMON "Enable processing timing measurement of lte softmodem on per subframe basis \n"
#define CONFIG_HLP_256QAM "Use the 256 QAM mcs table for PDSCH\n"
+#define CONFIG_HLP_NONSTOP "Go back to frame sync mode after 100 consecutive PBCH failures\n"
//#define CONFIG_HLP_NUMUES "Set the number of UEs for the emulation"
#define CONFIG_HLP_MSLOTS "Skip the missed slots/subframes \n"
#define CONFIG_HLP_ULMCS "Set the maximum uplink MCS\n"
@@ -88,6 +89,8 @@ extern "C"
#define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n"
#define CONFIG_HLP_PARALLEL_CMD "three config for level of parallelism 'PARALLEL_SINGLE_THREAD', 'PARALLEL_RU_L1_SPLIT', or 'PARALLEL_RU_L1_TRX_SPLIT'\n"
#define CONFIG_HLP_WORKER_CMD "two option for worker 'WORKER_DISABLE' or 'WORKER_ENABLE'\n"
+#define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n"
+
#define CONFIG_HLP_NOS1 "Disable s1 interface\n"
#define CONFIG_HLP_RFSIM "Run in rf simulator mode (also known as basic simulator)\n"
#define CONFIG_HLP_NOKRNMOD "(noS1 only): Use tun instead of namesh module \n"
@@ -117,28 +120,29 @@ extern "C"
#define USIM_TEST softmodem_params.usim_test
#define USE_256QAM_TABLE softmodem_params.use_256qam_table
#define NFAPI softmodem_params.nfapi
+#define NON_STOP softmodem_params.non_stop
#define DEFAULT_RFCONFIG_FILE "/usr/local/etc/syriq/ue.band7.tm1.PRB100.NR40.dat";
extern int usrp_tx_thread;
#define CMDLINE_PARAMS_DESC { \
{"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&RF_CONFIG_FILE, defstrval:NULL, TYPE_STRING, sizeof(RF_CONFIG_FILE)},\
- {"split73", CONFIG_HLP_SPLIT73, 0, strptr:(char **)&SPLIT73, defstrval:NULL, TYPE_STRING, sizeof(SPLIT73)},\
- {"thread-pool", CONFIG_HLP_TPOOL, 0, strptr:(char **)&TP_CONFIG, defstrval:"n", TYPE_STRING, sizeof(TP_CONFIG)}, \
+ {"split73", CONFIG_HLP_SPLIT73, 0, strptr:(char **)&SPLIT73, defstrval:NULL, TYPE_STRING, sizeof(SPLIT73)}, \
+ {"thread-pool", CONFIG_HLP_TPOOL, 0, strptr:(char **)&TP_CONFIG, defstrval:"n", TYPE_STRING, sizeof(TP_CONFIG)}, \
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&PHY_TEST, defintval:0, TYPE_INT, 0}, \
{"do-ra", CONFIG_HLP_DORA, PARAMFLAG_BOOL, iptr:&DO_RA, defintval:0, TYPE_INT, 0}, \
- {"sa", CONFIG_HLP_SA, PARAMFLAG_BOOL, iptr:&SA, defintval:0, TYPE_INT, 0}, \
+ {"sa", CONFIG_HLP_SA, PARAMFLAG_BOOL, iptr:&SA, defintval:0, TYPE_INT, 0}, \
{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&USIM_TEST, defintval:0, TYPE_UINT8, 0}, \
- {"clock-source", CONFIG_HLP_CLK, 0, uptr:&CLOCK_SOURCE, defintval:0, TYPE_UINT, 0}, \
- {"time-source", CONFIG_HLP_TME, 0, uptr:&TIMING_SOURCE, defintval:0, TYPE_UINT, 0}, \
+ {"clock-source", CONFIG_HLP_CLK, 0, uptr:&CLOCK_SOURCE, defintval:0, TYPE_UINT, 0}, \
+ {"time-source", CONFIG_HLP_TME, 0, uptr:&TIMING_SOURCE, defintval:0, TYPE_UINT, 0}, \
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&WAIT_FOR_SYNC, defintval:0, TYPE_INT, 0}, \
{"single-thread-enable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&SINGLE_THREAD_FLAG, defintval:0, TYPE_INT, 0}, \
- {"C" , CONFIG_HLP_DLF, 0, u64ptr:&(downlink_frequency[0][0]), defuintval:0, TYPE_UINT64, 0}, \
- {"CO" , CONFIG_HLP_ULF, 0, iptr:&(uplink_frequency_offset[0][0]), defintval:0, TYPE_INT, 0}, \
+ {"C" , CONFIG_HLP_DLF, 0, u64ptr:&(downlink_frequency[0][0]), defuintval:3619200000, TYPE_UINT64, 0}, \
+ {"CO" , CONFIG_HLP_ULF, 0, iptr:&(uplink_frequency_offset[0][0]), defintval:0, TYPE_INT, 0}, \
{"a" , CONFIG_HLP_CHOFF, 0, iptr:&CHAIN_OFFSET, defintval:0, TYPE_INT, 0}, \
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \
{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \
- {"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&NUMEROLOGY, defintval:0, TYPE_INT, 0}, \
+ {"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&NUMEROLOGY, defintval:1, TYPE_INT, 0}, \
{"band" , CONFIG_HLP_BAND, PARAMFLAG_BOOL, iptr:&BAND, defintval:78, TYPE_INT, 0}, \
{"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&EMULATE_RF, defintval:0, TYPE_INT, 0}, \
{"parallel-config", CONFIG_HLP_PARALLEL_CMD, 0, strptr:(char **)¶llel_config, defstrval:NULL, TYPE_STRING, 0}, \
@@ -149,8 +153,9 @@ extern int usrp_tx_thread;
{"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}, \
- {"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \
- {"nfapi", CONFIG_HLP_NFAPI, 0, u8ptr:&nfapi_mode, defintval:0, TYPE_UINT8, 0}, \
+ {"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \
+ {"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}, \
}
@@ -242,6 +247,7 @@ typedef struct {
uint32_t send_dmrs_sync;
int use_256qam_table;
uint8_t nfapi;
+ int non_stop;
} softmodem_params_t;
extern uint64_t get_softmodem_optmask(void);
@@ -253,6 +259,7 @@ extern char *get_softmodem_function(uint64_t *sofmodemfunc_mask_ptr);
extern void set_softmodem_sighandler(void);
extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
+extern int usrp_tx_thread;
extern uint16_t sl_ahead;
extern uint16_t sf_ahead;
extern volatile int oai_exit;
diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
index 8b3cb6eec0..c0abf6acb0 100644
--- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
+++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
@@ -1058,12 +1058,6 @@ typedef struct {
fapi_nr_tdd_table_t tdd_table;
fapi_nr_prach_config_t prach_config;
- fapi_nr_dl_bwp_common_config_t dl_bwp_common;
- fapi_nr_dl_bwp_dedicated_config_t dl_bwp_dedicated;
-
- fapi_nr_ul_bwp_common_config_t ul_bwp_common;
- fapi_nr_ul_bwp_dedicated_config_t ul_bwp_dedicated;
-
} fapi_nr_config_request_t;
#endif
diff --git a/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h b/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h
index fc9cd66077..8520a5d162 100644
--- a/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h
+++ b/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h
@@ -27,7 +27,6 @@ extern "C" {
#include
#include "nfapi_nr_interface.h"
#include "nfapi_nr_interface_scf.h"
-
#include
#include "openair1/PHY/defs_gNB.h"
diff --git a/openair1/PHY/CODING/TESTBENCH/coding_unitary_defs.h b/openair1/PHY/CODING/TESTBENCH/coding_unitary_defs.h
new file mode 100644
index 0000000000..f77ffff2eb
--- /dev/null
+++ b/openair1/PHY/CODING/TESTBENCH/coding_unitary_defs.h
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The OpenAirInterface Software Alliance licenses this file to You under
+ * the OAI Public License, Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.openairinterface.org/?page_id=698
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * -------------------------------------------------------------------------------
+ * For more information about the OpenAirInterface (OAI) Software Alliance:
+ * contact@openairinterface.org
+ */
+
+#ifndef __CODING_UNITARY_DEFS__h__
+#define __CODING_UNITARY_DEFS__h__
+int oai_exit=0;
+unsigned int NB_UE_INST = 1;
+#include "openair1/PHY/defs_UE.h"
+PHY_VARS_UE ***PHY_vars_UE_g;
+#include "common/ran_context.h"
+RAN_CONTEXT_t RC;
+
+void exit_function(const char* file, const char* function, const int line, const char *s) {
+ const char * msg= s==NULL ? "no comment": s;
+ printf("Exiting at: %s:%d %s(), %s\n", file, line, function, msg);
+ exit(-1);
+}
+
+signed char quantize(double D, double x, unsigned char B) {
+ double qxd;
+ short maxlev;
+ qxd = floor(x / D);
+ maxlev = 1 << (B - 1); //(char)(pow(2,B-1));
+
+ if (qxd <= -maxlev)
+ qxd = -maxlev;
+ else if (qxd >= maxlev)
+ qxd = maxlev - 1;
+
+ return ((char) qxd);
+}
+
+
+#endif
+
diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c
index f6769251cd..91c5d59611 100644
--- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c
+++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c
@@ -26,9 +26,11 @@
#include "assertions.h"
#include "SIMULATION/TOOLS/sim.h"
#include "PHY/CODING/nrLDPC_extern.h"
-#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
+//#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
#include "openair1/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.h"
-#define MAX_NUM_DLSCH_SEGMENTS 16
+#include "openair1/PHY/defs_nr_common.h"
+#include "coding_unitary_defs.h"
+
#define MAX_BLOCK_LENGTH 8448
#ifndef malloc16
@@ -81,9 +83,6 @@ typedef struct {
int n_iter_max;
} n_iter_stats_t;
-RAN_CONTEXT_t RC;
-PHY_VARS_UE ***PHY_vars_UE_g;
-uint16_t NB_UE_INST = 1;
nrLDPC_encoderfunc_t encoder_orig;
short lift_size[51]= {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384};
@@ -117,7 +116,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_DLSCH_SEGMENTS]={NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};;
+ unsigned char *test_input[MAX_NUM_NR_DLSCH_SEGMENTS]={NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};;
//short *c; //padded codeword
unsigned char *estimated_output[MAX_NUM_DLSCH_SEGMENTS];
unsigned char *estimated_output_bit[MAX_NUM_DLSCH_SEGMENTS];
diff --git a/openair1/PHY/CODING/TESTBENCH/polartest.c b/openair1/PHY/CODING/TESTBENCH/polartest.c
index e43ba507ab..8e7e377542 100644
--- a/openair1/PHY/CODING/TESTBENCH/polartest.c
+++ b/openair1/PHY/CODING/TESTBENCH/polartest.c
@@ -11,16 +11,12 @@
#include "PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h"
#include "PHY/CODING/coding_defs.h"
#include "SIMULATION/TOOLS/sim.h"
-#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
//#include "common/utils/LOG/log.h"
-
+#include "coding_unitary_defs.h"
//#define DEBUG_DCI_POLAR_PARAMS
//#define DEBUG_POLAR_TIMING
//#define DEBUG_POLARTEST
-RAN_CONTEXT_t RC;
-PHY_VARS_UE ***PHY_vars_UE_g;
-uint16_t NB_UE_INST = 1;
int main(int argc, char *argv[])
{
diff --git a/openair1/PHY/CODING/TESTBENCH/smallblocktest.c b/openair1/PHY/CODING/TESTBENCH/smallblocktest.c
index f750d24977..c9ed678a8f 100644
--- a/openair1/PHY/CODING/TESTBENCH/smallblocktest.c
+++ b/openair1/PHY/CODING/TESTBENCH/smallblocktest.c
@@ -1,13 +1,10 @@
#include
#include "SIMULATION/TOOLS/sim.h"
#include "PHY/CODING/nrSmallBlock/nr_small_block_defs.h"
-#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
+#include "coding_unitary_defs.h"
//#define DEBUG_SMALLBLOCKTEST
-RAN_CONTEXT_t RC;
-PHY_VARS_UE ***PHY_vars_UE_g;
-uint16_t NB_UE_INST = 1;
int main(int argc, char *argv[])
{
diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
index 18db8a01fb..8fe115b23a 100644
--- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
+++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
@@ -40,9 +40,9 @@
#include "assertions.h"
int8_t polar_decoder(double *input,
- uint32_t *out,
- t_nrPolar_params *polarParams,
- uint8_t listSize)
+ uint32_t *out,
+ const t_nrPolar_params *polarParams,
+ uint8_t listSize)
{
//Assumes no a priori knowledge.
uint8_t ***bit = nr_alloc_uint8_3D_array(polarParams->N, (polarParams->n+1), 2*listSize);
@@ -299,7 +299,7 @@ int8_t polar_decoder(double *input,
int8_t polar_decoder_dci(double *input,
uint32_t *out,
- t_nrPolar_params *polarParams,
+ const t_nrPolar_params *polarParams,
uint8_t listSize,
uint16_t n_RNTI) {
uint8_t ***bit = nr_alloc_uint8_3D_array(polarParams->N, (polarParams->n+1), 2*listSize);
diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
index a44a08a701..c2e9fd9381 100644
--- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
+++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
@@ -138,22 +138,22 @@ typedef struct nrPolar_params t_nrPolar_params;
void polar_encoder(uint32_t *input,
uint32_t *output,
- t_nrPolar_params *polarParams);
+ const t_nrPolar_params *polarParams);
void polar_encoder_dci(uint32_t *in,
uint32_t *out,
- t_nrPolar_params *polarParams,
+ const t_nrPolar_params *polarParams,
uint16_t n_RNTI);
void polar_encoder_fast(uint64_t *A,
void *out,
int32_t crcmask,
uint8_t ones_flag,
- t_nrPolar_params *polarParams);
+ const t_nrPolar_params *polarParams);
int8_t polar_decoder(double *input,
- uint32_t *output,
- t_nrPolar_params *polarParams,
+ uint32_t *output,
+ const t_nrPolar_params *polarParams,
uint8_t listSize);
uint32_t polar_decoder_int16(int16_t *input,
@@ -163,21 +163,21 @@ uint32_t polar_decoder_int16(int16_t *input,
int8_t polar_decoder_dci(double *input,
uint32_t *out,
- t_nrPolar_params *polarParams,
+ const t_nrPolar_params *polarParams,
uint8_t listSize,
uint16_t n_RNTI);
void generic_polar_decoder(const t_nrPolar_params *pp,
- decoder_node_t *node);
+ decoder_node_t *node);
void applyFtoleft(const t_nrPolar_params *pp,
- decoder_node_t *node);
+ decoder_node_t *node);
void applyGtoright(const t_nrPolar_params *pp,
- decoder_node_t *node);
+ decoder_node_t *node);
void computeBeta(const t_nrPolar_params *pp,
- decoder_node_t *node);
+ decoder_node_t *node);
void build_decoder_tree(t_nrPolar_params *pp);
void build_polar_tables(t_nrPolar_params *polarParams);
diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
index 27c062c217..e61b3dff9b 100644
--- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
+++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
@@ -43,7 +43,7 @@
void polar_encoder(uint32_t *in,
uint32_t *out,
- t_nrPolar_params *polarParams) {
+ const t_nrPolar_params *polarParams) {
if (1) {//polarParams->idx == 0 || polarParams->idx == 1) { //PBCH or PDCCH
/*
uint64_t B = (((uint64_t)*in)&((((uint64_t)1)<<32)-1)) | (((uint64_t)crc24c((uint8_t*)in,polarParams->payloadBits)>>8)<payloadBits);
@@ -154,7 +154,7 @@ void polar_encoder(uint32_t *in,
void polar_encoder_dci(uint32_t *in,
uint32_t *out,
- t_nrPolar_params *polarParams,
+ const t_nrPolar_params *polarParams,
uint16_t n_RNTI) {
#ifdef DEBUG_POLAR_ENCODER_DCI
printf("[polar_encoder_dci] in: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\n", in[0], in[1], in[2], in[3]);
@@ -251,9 +251,9 @@ void polar_encoder_dci(uint32_t *in,
#endif
}
-static inline void polar_rate_matching(t_nrPolar_params *polarParams,void *in,void *out) __attribute__((always_inline));
+static inline void polar_rate_matching(const t_nrPolar_params *polarParams,void *in,void *out) __attribute__((always_inline));
-static inline void polar_rate_matching(t_nrPolar_params *polarParams,void *in,void *out) {
+static inline void polar_rate_matching(const t_nrPolar_params *polarParams,void *in,void *out) {
// handle rate matching with a single 128 bit word using bit shuffling
// can be done with SIMD intrisics if needed
@@ -411,7 +411,7 @@ void polar_encoder_fast(uint64_t *A,
void *out,
int32_t crcmask,
uint8_t ones_flag,
- t_nrPolar_params *polarParams) {
+ const t_nrPolar_params *polarParams) {
// AssertFatal(polarParams->K > 32, "K = %d < 33, is not supported yet\n",polarParams->K);
AssertFatal(polarParams->K < 129, "K = %d > 128, is not supported yet\n",polarParams->K);
AssertFatal(polarParams->payloadBits < 65, "payload bits = %d > 64, is not supported yet\n",polarParams->payloadBits);
diff --git a/openair1/PHY/CODING/nr_rate_matching.c b/openair1/PHY/CODING/nr_rate_matching.c
index 0553bc19bf..b1ce6ab0de 100644
--- a/openair1/PHY/CODING/nr_rate_matching.c
+++ b/openair1/PHY/CODING/nr_rate_matching.c
@@ -493,8 +493,8 @@ int nr_rate_matching_ldpc_rx(uint8_t Ilbrm,
}
ind = (index_k0[BG-1][rvidx]*Ncb/N)*Z;
-// AssertFatal(Foffset <= E,"Foffset %d > E %d\n",Foffset,E);
-// AssertFatal(Foffset <= Ncb,"Foffset %d > Ncb %d\n",Foffset,Ncb);
+ AssertFatal(Foffset <= E,"Foffset %d > E %d\n",Foffset,E);
+ AssertFatal(Foffset <= Ncb,"Foffset %d > Ncb %d\n",Foffset,Ncb);
#ifdef RM_DEBUG
printf("nr_rate_matching_ldpc_rx: Clear %d, E %d, k0 %d, Ncb %d, rvidx %d\n", clear, E, ind, Ncb, rvidx);
diff --git a/openair1/PHY/INIT/init_top.c b/openair1/PHY/INIT/init_top.c
index 0990a58266..81fb28cc98 100644
--- a/openair1/PHY/INIT/init_top.c
+++ b/openair1/PHY/INIT/init_top.c
@@ -73,7 +73,6 @@ void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms) {
init_unscrambling_lut();
init_scrambling_lut();
//set_taus_seed(1328);
- init_sss();
}
void free_lte_top(void) {
diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c
index 2c7e3e88eb..1daeb72187 100644
--- a/openair1/PHY/INIT/lte_init.c
+++ b/openair1/PHY/INIT/lte_init.c
@@ -35,7 +35,7 @@
#include "assertions.h"
#include
#include "nfapi/oai_integration/vendor_ext.h"
-
+#include
extern uint32_t from_earfcn(int eutra_bandP,uint32_t dl_earfcn);
extern int32_t get_uldl_offset(int eutra_bandP);
@@ -46,6 +46,17 @@ uint8_t dmrs1_tab[8] = { 0, 2, 3, 4, 6, 8, 9, 10 };
int N_RB_DL_array[6] = { 6, 15, 25, 50, 75, 100 };
+#include "common/ran_context.h"
+extern RAN_CONTEXT_t RC;
+
+void pdsch_procedures(PHY_VARS_eNB *eNB,
+ L1_rxtx_proc_t *proc,
+ int harq_pid,
+ LTE_eNB_DLSCH_t *dlsch,
+ LTE_eNB_DLSCH_t *dlsch1);
+
+void init_sss(void);
+
int
l1_north_init_eNB () {
int i,j;
@@ -347,6 +358,33 @@ void phy_config_sib13_eNB(module_id_t Mod_id,int CC_id,int mbsfn_Area_idx,
lte_gold_mbsfn_khz_1dot25 (fp, RC.eNB[Mod_id][CC_id]->lte_gold_mbsfn_khz_1dot25_table, fp->Nid_cell_mbsfn);
}
+void fill_subframe_mask(PHY_VARS_eNB *eNB) {
+
+ AssertFatal(eNB->subframe_mask!=NULL,"Subframe mask is null\n");
+ int32_t **dummy_tx=eNB->common_vars.txdataF;
+ eNB->common_vars.txdataF = eNB->subframe_mask;
+
+ for (int sf=0;sf<10;sf++) {
+ if (subframe_select(&eNB->frame_parms,sf)==SF_DL) {
+ LTE_DL_eNB_HARQ_t *dlsch_harq=eNB->dlsch[0][0]->harq_processes[0];
+ L1_rxtx_proc_t proc;
+ proc.frame_tx=0;
+ proc.subframe_tx=sf;
+ eNB->dlsch[0][0]->harq_ids[0][sf]=0;
+ eNB->dlsch[0][0]->rnti=0x1234;
+ dlsch_harq->nb_rb=48;
+ dlsch_harq->rb_alloc[0]=(uint32_t)0xffffffff;
+ dlsch_harq->Qm=2;
+ dlsch_harq->Nl=1;
+ dlsch_harq->pdsch_start=1;
+ dlsch_harq->mimo_mode=(eNB->frame_parms.nb_antenna_ports_eNB>1) ? ALAMOUTI : SISO;
+ dlsch_harq->dl_power_off = 1;
+ computeRhoB_eNB(4,eNB->frame_parms.pdsch_config_common.p_b,eNB->frame_parms.nb_antenna_ports_eNB,eNB->dlsch[0][0],dlsch_harq->dl_power_off);
+ pdsch_procedures(eNB,&proc,0,eNB->dlsch[0][0],NULL);
+ }
+ }
+ eNB->common_vars.txdataF = dummy_tx;
+}
int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
unsigned char is_secondary_eNB,
@@ -385,7 +423,9 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
lte_gold (fp, eNB->lte_gold_table, fp->Nid_cell);
generate_pcfich_reg_mapping (fp);
generate_phich_reg_mapping (fp);
+ init_sss();
+ init_fde();
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
eNB->first_run_timing_advance[UE_id] =
1; ///This flag used to be static. With multiple eNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
@@ -397,9 +437,13 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
eNB->first_run_I0_measurements =
1; ///This flag used to be static. With multiple eNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
+ eNB->use_DTX=1;
if (NFAPI_MODE!=NFAPI_MODE_VNF) {
common_vars->rxdata = (int32_t **)NULL;
common_vars->txdataF = (int32_t **)malloc16(NB_ANTENNA_PORTS_ENB*sizeof(int32_t *));
+ if (eNB->use_DTX==0) {
+ eNB->subframe_mask = (int32_t **)malloc16(NB_ANTENNA_PORTS_ENB*sizeof(int32_t *));
+ }
common_vars->rxdataF = (int32_t **)malloc16(64*sizeof(int32_t *));
LOG_I(PHY,"[INIT] NB_ANTENNA_PORTS_ENB:%d fp->nb_antenna_ports_eNB:%d\n", NB_ANTENNA_PORTS_ENB, fp->nb_antenna_ports_eNB);
@@ -409,17 +453,19 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
LOG_I(PHY,"[INIT] common_vars->txdataF[%d] = %p (%lu bytes)\n",
i,common_vars->txdataF[i],
fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t));
+ if (eNB->use_DTX==0 && inb_antenna_ports_eNB) eNB->subframe_mask[i] = malloc16_clear(fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
}
}
+ LOG_I(PHY,"[INIT]SRS allocation\n");
// Channel estimates for SRS
- for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
- srs_vars[UE_id].srs_ch_estimates = (int32_t **) malloc16 (64 * sizeof (int32_t *));
- srs_vars[UE_id].srs_ch_estimates_time = (int32_t **) malloc16 (64 * sizeof (int32_t *));
+ for (int srs_id = 0; srs_id < NUMBER_OF_SRS_MAX; srs_id++) {
+ srs_vars[srs_id].srs_ch_estimates = (int32_t **) malloc16 (64 * sizeof (int32_t *));
+ srs_vars[srs_id].srs_ch_estimates_time = (int32_t **) malloc16 (64 * sizeof (int32_t *));
for (i = 0; i < 64; i++) {
- srs_vars[UE_id].srs_ch_estimates[i] = (int32_t *) malloc16_clear (sizeof (int32_t) * fp->ofdm_symbol_size);
- srs_vars[UE_id].srs_ch_estimates_time[i] = (int32_t *) malloc16_clear (sizeof (int32_t) * fp->ofdm_symbol_size * 2);
+ srs_vars[srs_id].srs_ch_estimates[i] = (int32_t *) malloc16_clear (sizeof (int32_t) * fp->ofdm_symbol_size);
+ srs_vars[srs_id].srs_ch_estimates_time[i] = (int32_t *) malloc16_clear (sizeof (int32_t) * fp->ofdm_symbol_size * 2);
}
} //UE_id
@@ -427,10 +473,11 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
init_ulsch_power_LUT ();
// SRS
- for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
- srs_vars[UE_id].srs = (int32_t *) malloc16_clear (2 * fp->ofdm_symbol_size * sizeof (int32_t));
+ for (int srs_id = 0; srs_id < NUMBER_OF_SRS_MAX; srs_id++) {
+ srs_vars[srs_id].srs = (int32_t *) malloc16_clear (2 * fp->ofdm_symbol_size * sizeof (int32_t));
}
+ LOG_I(PHY,"PRACH allocation\n");
// PRACH
prach_vars->prachF = (int16_t *) malloc16_clear (1024 * 2 * sizeof (int16_t));
// assume maximum of 64 RX antennas for PRACH receiver
@@ -461,34 +508,33 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
LOG_D(PHY,"[INIT] prach_vars->rxsigF[%d] = %p\n",i,prach_vars->rxsigF[i]);
}*/
- for (UE_id=0; UE_idrxdataF_ext = (int32_t **) malloc16 (2 * sizeof (int32_t *));
- pusch_vars[UE_id]->rxdataF_ext2 = (int32_t **) malloc16 (2 * sizeof (int32_t *));
- pusch_vars[UE_id]->drs_ch_estimates = (int32_t **) malloc16 (2 * sizeof (int32_t *));
- pusch_vars[UE_id]->drs_ch_estimates_time = (int32_t **) malloc16 (2 * sizeof (int32_t *));
- pusch_vars[UE_id]->rxdataF_comp = (int32_t **) malloc16 (2 * sizeof (int32_t *));
- pusch_vars[UE_id]->ul_ch_mag = (int32_t **) malloc16 (2 * sizeof (int32_t *));
- pusch_vars[UE_id]->ul_ch_magb = (int32_t **) malloc16 (2 * sizeof (int32_t *));
+ pusch_vars[ULSCH_id] = (LTE_eNB_PUSCH *) malloc16_clear (NUMBER_OF_ULSCH_MAX * sizeof (LTE_eNB_PUSCH));
+ pusch_vars[ULSCH_id]->rxdataF_ext = (int32_t **) malloc16 (4 * sizeof (int32_t *));
+ pusch_vars[ULSCH_id]->rxdataF_ext2 = (int32_t **) malloc16 (4 * sizeof (int32_t *));
+ pusch_vars[ULSCH_id]->drs_ch_estimates = (int32_t **) malloc16 (4 * sizeof (int32_t *));
+ pusch_vars[ULSCH_id]->drs_ch_estimates_time = (int32_t **) malloc16 (4 * sizeof (int32_t *));
+ pusch_vars[ULSCH_id]->rxdataF_comp = (int32_t **) malloc16 (4 * sizeof (int32_t *));
+ pusch_vars[ULSCH_id]->ul_ch_mag = (int32_t **) malloc16 (4 * sizeof (int32_t *));
+ pusch_vars[ULSCH_id]->ul_ch_magb = (int32_t **) malloc16 (4 * sizeof (int32_t *));
AssertFatal (fp->ofdm_symbol_size > 127, "fp->ofdm_symbol_size %d<128\n", fp->ofdm_symbol_size);
AssertFatal (fp->symbols_per_tti > 11, "fp->symbols_per_tti %d < 12\n", fp->symbols_per_tti);
AssertFatal (fp->N_RB_UL > 5, "fp->N_RB_UL %d < 6\n", fp->N_RB_UL);
-
- for (i = 0; i < 2; i++) {
- // RK 2 times because of output format of FFT!
+ AssertFatal (fp->nb_antennas_rx > 0,"fp->nb_antennas_rx = %d\n",fp->nb_antennas_rx);
+ for (i = 0; i < fp->nb_antennas_rx; i++) {
// FIXME We should get rid of this
- pusch_vars[UE_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
- pusch_vars[UE_id]->rxdataF_ext2[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
- pusch_vars[UE_id]->drs_ch_estimates[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
- pusch_vars[UE_id]->drs_ch_estimates_time[i] = (int32_t *)malloc16_clear( 2*sizeof(int32_t)*fp->ofdm_symbol_size );
- pusch_vars[UE_id]->rxdataF_comp[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
- pusch_vars[UE_id]->ul_ch_mag[i] = (int32_t *)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
- pusch_vars[UE_id]->ul_ch_magb[i] = (int32_t *)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
+ pusch_vars[ULSCH_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
+ pusch_vars[ULSCH_id]->drs_ch_estimates[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
+ pusch_vars[ULSCH_id]->drs_ch_estimates_time[i] = (int32_t *)malloc16_clear( 4*sizeof(int32_t)*fp->ofdm_symbol_size );
+ pusch_vars[ULSCH_id]->rxdataF_comp[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
+ pusch_vars[ULSCH_id]->ul_ch_mag[i] = (int32_t *)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
+ pusch_vars[ULSCH_id]->ul_ch_magb[i] = (int32_t *)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
}
- pusch_vars[UE_id]->llr = (int16_t *)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
- } //UE_id
+ pusch_vars[ULSCH_id]->llr = (int16_t *)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
+ } //ULSCH_id
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++)
eNB->UE_stats_ptr[UE_id] = &eNB->UE_stats[UE_id];
@@ -518,19 +564,19 @@ void phy_free_lte_eNB(PHY_VARS_eNB *eNB) {
free_and_zero(common_vars->rxdataF);
// Channel estimates for SRS
- for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
+ for (int srs_id = 0; srs_id < NUMBER_OF_SRS_MAX; srs_id++) {
for (i=0; i<64; i++) {
- free_and_zero(srs_vars[UE_id].srs_ch_estimates[i]);
- free_and_zero(srs_vars[UE_id].srs_ch_estimates_time[i]);
+ free_and_zero(srs_vars[srs_id].srs_ch_estimates[i]);
+ free_and_zero(srs_vars[srs_id].srs_ch_estimates_time[i]);
}
- free_and_zero(srs_vars[UE_id].srs_ch_estimates);
- free_and_zero(srs_vars[UE_id].srs_ch_estimates_time);
+ free_and_zero(srs_vars[srs_id].srs_ch_estimates);
+ free_and_zero(srs_vars[srs_id].srs_ch_estimates_time);
} //UE_id
free_ul_ref_sigs();
- for (UE_id=0; UE_idprachF);
@@ -548,26 +594,26 @@ void phy_free_lte_eNB(PHY_VARS_eNB *eNB) {
free_and_zero(prach_vars_br->prachF);
free_and_zero(prach_vars->rxsigF[0]);
- for (UE_id=0; UE_idrxdataF_ext[i]);
- free_and_zero(pusch_vars[UE_id]->rxdataF_ext2[i]);
- free_and_zero(pusch_vars[UE_id]->drs_ch_estimates[i]);
- free_and_zero(pusch_vars[UE_id]->drs_ch_estimates_time[i]);
- free_and_zero(pusch_vars[UE_id]->rxdataF_comp[i]);
- free_and_zero(pusch_vars[UE_id]->ul_ch_mag[i]);
- free_and_zero(pusch_vars[UE_id]->ul_ch_magb[i]);
+ for (int ULSCH_id=0; ULSCH_idnb_antennas_rx; i++) {
+ free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext[i]);
+ free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext2[i]);
+ free_and_zero(pusch_vars[ULSCH_id]->drs_ch_estimates[i]);
+ free_and_zero(pusch_vars[ULSCH_id]->drs_ch_estimates_time[i]);
+ free_and_zero(pusch_vars[ULSCH_id]->rxdataF_comp[i]);
+ free_and_zero(pusch_vars[ULSCH_id]->ul_ch_mag[i]);
+ free_and_zero(pusch_vars[ULSCH_id]->ul_ch_magb[i]);
}
- free_and_zero(pusch_vars[UE_id]->rxdataF_ext);
- free_and_zero(pusch_vars[UE_id]->rxdataF_ext2);
- free_and_zero(pusch_vars[UE_id]->drs_ch_estimates);
- free_and_zero(pusch_vars[UE_id]->drs_ch_estimates_time);
- free_and_zero(pusch_vars[UE_id]->rxdataF_comp);
- free_and_zero(pusch_vars[UE_id]->ul_ch_mag);
- free_and_zero(pusch_vars[UE_id]->ul_ch_magb);
- free_and_zero(pusch_vars[UE_id]->llr);
- free_and_zero(pusch_vars[UE_id]);
+ free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext);
+ free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext2);
+ free_and_zero(pusch_vars[ULSCH_id]->drs_ch_estimates);
+ free_and_zero(pusch_vars[ULSCH_id]->drs_ch_estimates_time);
+ free_and_zero(pusch_vars[ULSCH_id]->rxdataF_comp);
+ free_and_zero(pusch_vars[ULSCH_id]->ul_ch_mag);
+ free_and_zero(pusch_vars[ULSCH_id]->ul_ch_magb);
+ free_and_zero(pusch_vars[ULSCH_id]->llr);
+ free_and_zero(pusch_vars[ULSCH_id]);
} //UE_id
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) eNB->UE_stats_ptr[UE_id] = NULL;
diff --git a/openair1/PHY/INIT/lte_init_ru.c b/openair1/PHY/INIT/lte_init_ru.c
index 8ad928f8a0..a856c33999 100644
--- a/openair1/PHY/INIT/lte_init_ru.c
+++ b/openair1/PHY/INIT/lte_init_ru.c
@@ -21,9 +21,8 @@
#include "phy_init.h"
#include "SCHED/sched_eNB.h"
-#include "PHY/phy_extern.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
-#include "SIMULATION/TOOLS/sim.h"
+//#include "SIMULATION/TOOLS/sim.h"
#include "LTE_RadioResourceConfigCommonSIB.h"
#include "LTE_RadioResourceConfigDedicated.h"
#include "LTE_TDD-Config.h"
@@ -34,6 +33,8 @@
void init_7_5KHz(void);
+extern const char ru_if_types[MAX_RU_IF_TYPES][20];
+
int phy_init_RU(RU_t *ru) {
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
RU_CALIBRATION *calibration = &ru->calibration;
@@ -44,6 +45,7 @@ int phy_init_RU(RU_t *ru) {
if (ru->is_slave == 1) {
generate_ul_ref_sigs_rx();
}
+ else generate_ul_ref_sigs();
if (ru->if_south <= REMOTE_IF5) { // this means REMOTE_IF5 or LOCAL_RF, so allocate memory for time-domain signals
// Time-domain signals
@@ -135,14 +137,14 @@ int phy_init_RU(RU_t *ru) {
}
}
- AssertFatal(RC.nb_L1_inst <= NUMBER_OF_eNB_MAX,"eNB instances %d > %d\n",
- RC.nb_L1_inst,NUMBER_OF_eNB_MAX);
- LOG_D(PHY,"[INIT] %s() RC.nb_L1_inst:%d \n", __FUNCTION__, RC.nb_L1_inst);
+ AssertFatal(ru->num_eNB <= NUMBER_OF_eNB_MAX,"eNB instances %d > %d\n",
+ ru->num_eNB,NUMBER_OF_eNB_MAX);
+ LOG_D(PHY,"[INIT] %s() ru->num_eNB:%d \n", __FUNCTION__, ru->num_eNB);
int starting_antenna_index=0;
for (i=0; iidx; i++) starting_antenna_index+=ru->nb_tx;
- for (i=0; inum_eNB; i++) {
for (p=0; p<15; p++) {
LOG_D(PHY,"[INIT] %s() nb_antenna_ports_eNB:%d \n", __FUNCTION__, ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB);
@@ -240,7 +242,7 @@ void phy_free_RU(RU_t *ru) {
free_and_zero(ru->prach_rxsigF[0]);
/* ru->prach_rxsigF_br is not allocated -> don't free */
- for (i = 0; i < RC.nb_L1_inst; i++) {
+ for (i = 0; i < ru->num_eNB; i++) {
for (p = 0; p < 15; p++) {
if (p < ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB || p == 5) {
for (j=0; jnb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]);
diff --git a/openair1/PHY/INIT/lte_init_ue.c b/openair1/PHY/INIT/lte_init_ue.c
index 64a5992a64..b756735816 100644
--- a/openair1/PHY/INIT/lte_init_ue.c
+++ b/openair1/PHY/INIT/lte_init_ue.c
@@ -39,6 +39,7 @@ void init_7_5KHz(void);
uint8_t dmrs1_tab_ue[8] = {0,2,3,4,6,8,9,10};
+void init_sss(void);
void phy_config_sib1_ue(module_id_t Mod_id,int CC_id,
uint8_t eNB_id,
@@ -629,6 +630,7 @@ int init_lte_ue_signal(PHY_VARS_UE *ue,
init_frame_parms(&ue->frame_parms,1);
lte_sync_time_init(&ue->frame_parms);
init_lte_top(&ue->frame_parms);
+ init_sss();
init_7_5KHz();
init_ul_hopping(&ue->frame_parms);
// many memory allocation sizes are hard coded
diff --git a/openair1/PHY/INIT/lte_param_init.c b/openair1/PHY/INIT/lte_param_init.c
index 1505ee018e..504c8fa80a 100644
--- a/openair1/PHY/INIT/lte_param_init.c
+++ b/openair1/PHY/INIT/lte_param_init.c
@@ -25,7 +25,6 @@
#include
#include
-#include "SIMULATION/TOOLS/sim.h"
#include "PHY/types.h"
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
@@ -33,7 +32,9 @@
#include "phy_init.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
-#include "targets/RT/USER/lte-softmodem.h"
+#include "executables/softmodem-common.h"
+#include "SIMULATION/TOOLS/sim.h"
+
extern PHY_VARS_eNB *eNB;
extern PHY_VARS_UE *UE;
extern RU_t *ru;
diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c
index e05045d3ed..dcff18f025 100644
--- a/openair1/PHY/INIT/nr_init.c
+++ b/openair1/PHY/INIT/nr_init.c
@@ -110,7 +110,7 @@ int l1_north_init_gNB() {
int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
unsigned char is_secondary_gNB,
- unsigned char abstraction_flag) {
+ unsigned char lowmem_flag) {
// shortcuts
NR_DL_FRAME_PARMS *const fp = &gNB->frame_parms;
nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
@@ -128,6 +128,15 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
while(gNB->configured == 0) usleep(10000);
+ if (lowmem_flag == 1) {
+ gNB->number_of_nr_dlsch_max = 2;
+ gNB->number_of_nr_ulsch_max = 2;
+ }
+ else {
+ gNB->number_of_nr_dlsch_max = NUMBER_OF_NR_DLSCH_MAX;
+ gNB->number_of_nr_ulsch_max = NUMBER_OF_NR_ULSCH_MAX;
+ }
+
load_dftslib();
LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_gNB][MOD %02"PRIu8"][]\n", gNB->Mod_id);
@@ -287,7 +296,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
int N_RB_UL = cfg->carrier_config.ul_grid_size[cfg->ssb_config.scs_common.value].value;
- for (int ULSCH_id=0; ULSCH_idnumber_of_nr_ulsch_max; ULSCH_id++) {
pusch_vars[ULSCH_id] = (NR_gNB_PUSCH *)malloc16_clear( sizeof(NR_gNB_PUSCH) );
pusch_vars[ULSCH_id]->rxdataF_ext = (int32_t **)malloc16(Prx*sizeof(int32_t *) );
pusch_vars[ULSCH_id]->rxdataF_ext2 = (int32_t **)malloc16(Prx*sizeof(int32_t *) );
@@ -372,7 +381,7 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
free_and_zero(prach_vars->prach_ifft[0]);
free_and_zero(prach_vars->rxsigF[0]);
*/
- for (int ULSCH_id=0; ULSCH_idnumber_of_nr_ulsch_max; ULSCH_id++) {
for (int i = 0; i < 2; i++) {
free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext[i]);
free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext2[i]);
@@ -563,9 +572,9 @@ void init_nr_transport(PHY_VARS_gNB *gNB) {
AssertFatal(gNB->pucch[i]!=NULL,"Can't initialize pucch %d \n", i);
}
- for (i=0; inumber_of_nr_dlsch_max; i++) {
- LOG_I(PHY,"Allocating Transport Channel Buffers for DLSCH %d/%d\n",i,NUMBER_OF_NR_DLSCH_MAX);
+ LOG_I(PHY,"Allocating Transport Channel Buffers for DLSCH %d/%d\n",i,gNB->number_of_nr_dlsch_max);
for (j=0; j<2; j++) {
gNB->dlsch[i][j] = new_gNB_dlsch(fp,1,16,NSOFT,0,grid_size);
@@ -573,9 +582,9 @@ void init_nr_transport(PHY_VARS_gNB *gNB) {
}
}
- for (i=0; inumber_of_nr_ulsch_max; i++) {
- LOG_I(PHY,"Allocating Transport Channel Buffer for ULSCH, UE %d\n",i);
+ LOG_I(PHY,"Allocating Transport Channel Buffer for ULSCH %d/%d\n",i,gNB->number_of_nr_ulsch_max);
for (j=0; j<2; j++) {
// ULSCH for data
@@ -586,27 +595,6 @@ void init_nr_transport(PHY_VARS_gNB *gNB) {
exit(-1);
}
- /*
- LOG_I(PHY,"Initializing nFAPI for ULSCH, UE %d\n",i);
- // [hna] added here for RT implementation
- uint8_t harq_pid = 0;
- nfapi_nr_ul_config_ulsch_pdu *rel15_ul = &gNB->ulsch[i+1][j]->harq_processes[harq_pid]->ulsch_pdu;
-
- // --------- setting rel15_ul parameters ----------
- rel15_ul->rnti = 0x1234;
- rel15_ul->ulsch_pdu_rel15.start_rb = 0;
- rel15_ul->ulsch_pdu_rel15.number_rbs = 50;
- rel15_ul->ulsch_pdu_rel15.start_symbol = 2;
- rel15_ul->ulsch_pdu_rel15.number_symbols = 12;
- rel15_ul->ulsch_pdu_rel15.length_dmrs = gNB->dmrs_UplinkConfig.pusch_maxLength;
- rel15_ul->ulsch_pdu_rel15.Qm = 2;
- rel15_ul->ulsch_pdu_rel15.R = 679;
- rel15_ul->ulsch_pdu_rel15.mcs = 9;
- rel15_ul->ulsch_pdu_rel15.rv = 0;
- rel15_ul->ulsch_pdu_rel15.n_layers = 1;
- ///////////////////////////////////////////////////
- */
-
}
}
diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c
index e711da6437..097c2b3ad2 100644
--- a/openair1/PHY/INIT/nr_init_ru.c
+++ b/openair1/PHY/INIT/nr_init_ru.c
@@ -21,9 +21,6 @@
#include "phy_init.h"
#include "SCHED/sched_common.h"
-#include "PHY/phy_extern.h"
-#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
-#include "SIMULATION/TOOLS/sim.h"
/*#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
#include "TDD-Config.h"
@@ -33,6 +30,10 @@
#include
#include "openair1/PHY/defs_RU.h"
+void init_prach_ru_list(RU_t *ru);
+
+extern const char ru_if_types[MAX_RU_IF_TYPES][20];
+
int nr_phy_init_RU(RU_t *ru) {
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
@@ -44,7 +45,7 @@ int nr_phy_init_RU(RU_t *ru) {
nfapi_nr_config_request_scf_t *cfg;
ru->nb_log_antennas=0;
- for (int n=0;nnum_gNB;n++) {
cfg = &ru->config;
if (cfg->carrier_config.num_tx_ant.value > ru->nb_log_antennas) ru->nb_log_antennas = cfg->carrier_config.num_tx_ant.value;
}
@@ -117,12 +118,12 @@ int nr_phy_init_RU(RU_t *ru) {
}
}
- AssertFatal(RC.nb_nr_L1_inst <= NUMBER_OF_eNB_MAX,"gNB instances %d > %d\n",
- RC.nb_nr_L1_inst,NUMBER_OF_gNB_MAX);
+ AssertFatal(ru->num_gNB <= NUMBER_OF_gNB_MAX,"gNB instances %d > %d\n",
+ ru->num_gNB,NUMBER_OF_gNB_MAX);
- LOG_E(PHY,"[INIT] %s() RC.nb_nr_L1_inst:%d \n", __FUNCTION__, RC.nb_nr_L1_inst);
-
- if (ru->do_precoding == 1) {
+ LOG_I(PHY,"[INIT] %s() ru->num_gNB:%d \n", __FUNCTION__, ru->num_gNB);
+
+ if (ru->do_precoding == 1) {
int beam_count = 0;
if (ru->nb_tx>1) {//Enable beamforming when nb_tx > 1
for (p=0;pnb_log_antennas;p++) {
@@ -131,22 +132,22 @@ int nr_phy_init_RU(RU_t *ru) {
}
AssertFatal(ru->nb_bfw==(beam_count*ru->nb_tx),"Number of beam weights from config file is %d while the expected number is %d",ru->nb_bfw,(beam_count*ru->nb_tx));
+ for (i=0; inum_gNB; i++) {
int l_ind = 0;
- for (i=0; inb_log_antennas;p++) {
+ for (p=0;pnb_log_antennas;p++) {
//if ((fp->L_ssb >> (63-p)) & 0x01) {
- ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*));
- for (j=0; jnb_tx; j++) {
- ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
- AssertFatal(ru->bw_list[i],"ru->bw_list[%d] is null\n",i);
- for (re=0; reofdm_symbol_size; re++)
- ru->beam_weights[i][p][j][re] = ru->bw_list[i][l_ind];
- //printf("Beam Weight %08x for beam %d and tx %d\n",ru->bw_list[i][l_ind],p,j);
- l_ind++;
- } // for j
- //}
- } // for p
- } //for i
+ ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*));
+ for (j=0; jnb_tx; j++) {
+ ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
+ AssertFatal(ru->bw_list[i],"ru->bw_list[%d] is null\n",i);
+ for (re=0; reofdm_symbol_size; re++)
+ ru->beam_weights[i][p][j][re] = ru->bw_list[i][l_ind];
+ //printf("Beam Weight %08x for beam %d and tx %d\n",ru->bw_list[i][l_ind],p,j);
+ l_ind++;
+ } // for j
+ //}
+ } // for p
+ } //for i
}
ru->common.beam_id = (uint8_t**)malloc16_clear(ru->nb_tx*sizeof(uint8_t*));
@@ -202,8 +203,7 @@ void nr_phy_free_RU(RU_t *ru)
free_and_zero(ru->prach_rxsigF[j][i]);
}
}
-
- for (i = 0; i < RC.nb_nr_L1_inst; i++) {
+ for (i = 0; i < ru->num_gNB; i++) {
for (p = 0; p < 15; p++) {
for (j=0; jnb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]);
free_and_zero(ru->beam_weights[i][p]);
diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c
index 855acc01ff..68947b0c6b 100644
--- a/openair1/PHY/INIT/nr_init_ue.c
+++ b/openair1/PHY/INIT/nr_init_ue.c
@@ -28,6 +28,7 @@
#include "TDD-Config.h"
#include "MBSFN-SubframeConfigList.h"*/
#include "openair1/PHY/defs_RU.h"
+#include "openair1/PHY/impl_defs_nr.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "assertions.h"
#include
@@ -142,8 +143,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
uint16_t N_n_scid[2] = {0,1}; // [HOTFIX] This is a temporary implementation of scramblingID0 and scramblingID1 which are given by DMRS-UplinkConfig
int n_scid;
abstraction_flag = 0;
- // dmrs_UplinkConfig_t *dmrs_Uplink_Config = &ue->pusch_config.dmrs_UplinkConfig;
- // ptrs_UplinkConfig_t *ptrs_Uplink_Config = &ue->pusch_config.dmrs_UplinkConfig.ptrs_UplinkConfig;
LOG_I(PHY, "Initializing UE vars (abstraction %u) for gNB TXant %u, UE RXant %u\n", abstraction_flag, fp->nb_antennas_tx, fp->nb_antennas_rx);
//LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_gNB_INST);
phy_init_nr_top(ue);
@@ -187,29 +186,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
/////////////////////////PUSCH DMRS init/////////////////////////
///////////
-
- // default values until overwritten by RRCConnectionReconfiguration
-
- for (i=0; ipusch_config.pusch_TimeDomainResourceAllocation[i] = (PUSCH_TimeDomainResourceAllocation_t *)malloc16(sizeof(PUSCH_TimeDomainResourceAllocation_t));
- ue->pusch_config.pusch_TimeDomainResourceAllocation[i]->mappingType = typeB;
- }
-
- for (i=0;iPDSCH_Config.pdsch_TimeDomainResourceAllocation[i] = (NR_PDSCH_TimeDomainResourceAllocation_t *)malloc16(sizeof(NR_PDSCH_TimeDomainResourceAllocation_t));
- ue->PDSCH_Config.pdsch_TimeDomainResourceAllocation[i]->mappingType = typeA;
- }
-
- //------------- config DMRS parameters--------------//
- // dmrs_Uplink_Config->pusch_dmrs_type = pusch_dmrs_type1;
- // dmrs_Uplink_Config->pusch_dmrs_AdditionalPosition = pusch_dmrs_pos0;
- // dmrs_Uplink_Config->pusch_maxLength = pusch_len1;
- //-------------------------------------------------//
- ue->dmrs_DownlinkConfig.pdsch_dmrs_type = pdsch_dmrs_type1;
- ue->dmrs_DownlinkConfig.pdsch_dmrs_AdditionalPosition = pdsch_dmrs_pos0;
- ue->dmrs_DownlinkConfig.pdsch_maxLength = pdsch_len1;
- //-------------------------------------------------//
-
ue->nr_gold_pusch_dmrs = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***));
pusch_dmrs = ue->nr_gold_pusch_dmrs;
n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization
diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c
index 9aabc5e1e9..3a9d8a6c18 100644
--- a/openair1/PHY/INIT/nr_parms.c
+++ b/openair1/PHY/INIT/nr_parms.c
@@ -261,11 +261,11 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
LOG_I(PHY, "Initializing frame parms: set nb_antenna_ports_gNB %d, tdd_config, %d, Nid_cell %d\n", fp->nb_antenna_ports_gNB, fp->tdd_config, fp->Nid_cell);
-
uint64_t dl_bw_khz = (12*config->carrier_config.dl_grid_size[config->ssb_config.scs_common])*(15<ssb_config.scs_common);
- LOG_I(PHY,"dl_bw_kHz %lu\n",dl_bw_khz);
fp->dl_CarrierFreq = ((dl_bw_khz>>1) + config->carrier_config.dl_frequency)*1000 ;
- LOG_I(PHY,"dl_CarrierFreq %lu\n",fp->dl_CarrierFreq);
+
+ LOG_D(PHY,"dl_bw_kHz %lu\n",dl_bw_khz);
+ LOG_D(PHY,"dl_CarrierFreq %lu\n",fp->dl_CarrierFreq);
uint64_t ul_bw_khz = (12*config->carrier_config.ul_grid_size[config->ssb_config.scs_common])*(15<ssb_config.scs_common);
fp->ul_CarrierFreq = ((ul_bw_khz>>1) + config->carrier_config.uplink_frequency)*1000 ;
diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h
index 2db0ccc258..2ab610739d 100644
--- a/openair1/PHY/INIT/phy_init.h
+++ b/openair1/PHY/INIT/phy_init.h
@@ -399,7 +399,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB,uint8_t abstractio
void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag);
void init_N_TA_offset(PHY_VARS_NR_UE *ue);
void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms);
-int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char abstraction_flag);
+int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char lowmem_flag);
void nr_phy_config_request(NR_PHY_Config_t *gNB);
void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,int Nid_cell,uint64_t position_in_burst);
void phy_free_nr_gNB(PHY_VARS_gNB *gNB);
@@ -408,6 +408,7 @@ void init_nr_transport(PHY_VARS_gNB *gNB);
void init_dfts(void);
+void fill_subframe_mask(PHY_VARS_eNB *eNB);
/** @} */
#endif
diff --git a/openair1/PHY/LTE_ESTIMATION/freq_equalization.c b/openair1/PHY/LTE_ESTIMATION/freq_equalization.c
index 3fd58a4989..6d382bdd63 100644
--- a/openair1/PHY/LTE_ESTIMATION/freq_equalization.c
+++ b/openair1/PHY/LTE_ESTIMATION/freq_equalization.c
@@ -20,11 +20,11 @@
*/
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
#include "PHY/sse_intrin.h"
+#include "PHY/LTE_ESTIMATION/lte_estimation.h"
-// This is 512/(1:256) in __m128i format
-int16_t inv_ch[256*8] = {512,512,512,512,512,512,512,512,
+// This is 4096/(1:4096) in __m128i format
+__m128i inv_ch[4096];/* = {512,512,512,512,512,512,512,512,
256,256,256,256,256,256,256,256,
170,170,170,170,170,170,170,170,
128,128,128,128,128,128,128,128,
@@ -280,7 +280,11 @@ int16_t inv_ch[256*8] = {512,512,512,512,512,512,512,512,
2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,
- };
+ };*/
+
+void init_fde() {
+ for (int i=1;i<4096;i++) inv_ch[i] = _mm_set1_epi16(4096/i);
+}
void freq_equalization(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
@@ -313,12 +317,12 @@ void freq_equalization(LTE_DL_FRAME_PARMS *frame_parms,
amp=(*((int16_t*)&ul_ch_mag128[re]));
- if (amp>255)
- amp=255;
+ if (amp>4095)
+ amp=4095;
- // printf("freq_eq: symbol %d re %d => %d,%d,%d, (%d) (%d,%d) => ",symbol,re,*((int16_t*)(&ul_ch_mag128[re])),amp,inv_ch[8*amp],*((int16_t*)(&ul_ch_mag128[re]))*inv_ch[8*amp],*(int16_t*)&(rxdataF_comp128[re]),*(1+(int16_t*)&(rxdataF_comp128[re])));
+ //printf("freq_eq: symbol %d re %d => mag %d,amp %d,inv %d, prod %d (%d,%d)\n",symbol,re,*((int16_t*)(&ul_ch_mag128[re])),amp,_mm_extract_epi16(inv_ch[amp],0),(*((int16_t*)(&ul_ch_mag128[re]))*_mm_extract_epi16(inv_ch[amp],0))>>3,*(int16_t*)&(rxdataF_comp128[re]),*(1+(int16_t*)&(rxdataF_comp128[re])));
#if defined(__x86_64__) || defined(__i386__)
- rxdataF_comp128[re] = _mm_mullo_epi16(rxdataF_comp128[re],*((__m128i *)&inv_ch[8*amp]));
+ rxdataF_comp128[re] = _mm_srai_epi16(_mm_mullo_epi16(rxdataF_comp128[re],inv_ch[amp]),3);
if (Qm==4)
ul_ch_mag128[re] = _mm_set1_epi16(324); // this is 512*2/sqrt(10)
@@ -327,7 +331,7 @@ void freq_equalization(LTE_DL_FRAME_PARMS *frame_parms,
ul_ch_magb128[re] = _mm_set1_epi16(158); // this is 512*2/sqrt(42)
}
#elif defined(__arm__)
- rxdataF_comp128[re] = vmulq_s16(rxdataF_comp128[re],*((int16x8_t *)&inv_ch[8*amp]));
+ rxdataF_comp128[re] = vmulq_s16(rxdataF_comp128[re],inv_ch[amp]);
if (Qm==4)
ul_ch_mag128[re] = vdupq_n_s16(324); // this is 512*2/sqrt(10)
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync_eNB.c b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync_eNB.c
index f85162e095..aac8e71828 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync_eNB.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync_eNB.c
@@ -21,7 +21,6 @@
#include "PHY/types.h"
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
@@ -118,12 +117,12 @@ int lte_est_timing_advance_pusch(LTE_DL_FRAME_PARMS *frame_parms,
int temp, i, aa, max_pos=0, max_val=0;
short Re,Im;
- uint8_t cyclic_shift = 0;
- int sync_pos = (frame_parms->ofdm_symbol_size-cyclic_shift*frame_parms->ofdm_symbol_size/12)%(frame_parms->ofdm_symbol_size);
+ // uint8_t cyclic_shift = 0;
+ int sync_pos = 0;//(frame_parms->ofdm_symbol_size-cyclic_shift*frame_parms->ofdm_symbol_size/12)%(frame_parms->ofdm_symbol_size);
AssertFatal(frame_parms->ofdm_symbol_size > 127,"frame_parms->ofdm_symbol_size %d<128\n",frame_parms->ofdm_symbol_size);
- AssertFatal(frame_parms->nb_antennas_rx >0 && frame_parms->nb_antennas_rx<3,"frame_parms->nb_antennas_rx %d not in [0,1]\n",
- frame_parms->nb_antennas_rx);
+ AssertFatal(frame_parms->nb_antennas_rx >0 && frame_parms->nb_antennas_rx<=4,"frame_parms->nb_antennas_rx %d not in [1...%d]\n",
+ frame_parms->nb_antennas_rx,4);
for (i = 0; i < frame_parms->ofdm_symbol_size; i++) {
temp = 0;
@@ -142,9 +141,5 @@ int lte_est_timing_advance_pusch(LTE_DL_FRAME_PARMS *frame_parms,
if (max_pos>frame_parms->ofdm_symbol_size/2)
max_pos = max_pos-frame_parms->ofdm_symbol_size;
- //#ifdef DEBUG_PHY
- LOG_D(PHY,"max_pos = %d, sync_pos=%d\n",max_pos,sync_pos);
- //#endif //DEBUG_PHY
-
return max_pos - sync_pos;
}
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c
index 2d79158920..7eeeb998ba 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c
@@ -32,6 +32,30 @@
int32_t rx_power_avg_eNB[3];
+void dump_I0_stats(FILE *fd,PHY_VARS_eNB *eNB) {
+
+
+ int min_I0=1000,max_I0=0;
+ int amin=0,amax=0;
+ for (int i=0; iframe_parms.N_RB_UL; i++) {
+ if (i==(eNB->frame_parms.N_RB_UL>>1) - 1) i+=2;
+
+ if (eNB->measurements.n0_subband_power_tot_dB[i]measurements.n0_subband_power_tot_dB[i]; amin=i;}
+
+ if (eNB->measurements.n0_subband_power_tot_dB[i]>max_I0) {max_I0 = eNB->measurements.n0_subband_power_tot_dB[i]; amax=i;}
+ }
+
+ for (int i=0; iframe_parms.N_RB_UL; i++) {
+ fprintf(fd,"%2d.",eNB->measurements.n0_subband_power_tot_dB[i]-eNB->measurements.n0_subband_power_avg_dB);
+ if (i%25 == 24) fprintf(fd,"\n");
+ }
+
+ fprintf(fd,"\nmax_I0 %d (rb %d), min_I0 %d (rb %d), avg I0 %d\n", max_I0, amax, min_I0, amin, eNB->measurements.n0_subband_power_avg_dB);
+
+ fprintf(fd,"prach_I0 = %d.%d dB\n",eNB->measurements.prach_I0/10,eNB->measurements.prach_I0%10);
+
+
+}
void lte_eNB_I0_measurements(PHY_VARS_eNB *eNB,
int subframe,
module_id_t eNB_id,
@@ -87,46 +111,45 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *eNB,
nb_rb++;
for (aarx=0; aarxnb_antennas_rx; aarx++) {
measurements->n0_subband_power[aarx][rb] = 0;
- for (int s=0;s<14-(frame_parms->Ncp<<1);s++) {
- // select the 7th symbol in an uplink subframe
- offset = offset0 + (s*frame_parms->ofdm_symbol_size);
- ul_ch = &common_vars->rxdataF[aarx][offset];
- len = 12;
+ for (int s=0;s<(14-(frame_parms->Ncp<<1));s++) {
+ offset = offset0 + (s*frame_parms->ofdm_symbol_size);
+ ul_ch = &common_vars->rxdataF[aarx][offset];
+ len = 12;
// just do first half of middle PRB for odd number of PRBs
- if (((frame_parms->N_RB_UL&1) == 1) &&
- (rb==(frame_parms->N_RB_UL>>1))) {
- len=6;
- }
+ if (((frame_parms->N_RB_UL&1) == 1) &&
+ (rb==(frame_parms->N_RB_UL>>1))) {
+ len=6;
+ }
- AssertFatal(ul_ch, "RX signal buffer (freq) problem");
+ AssertFatal(ul_ch, "RX signal buffer (freq) problem");
- measurements->n0_subband_power[aarx][rb] += signal_energy_nodc(ul_ch,len);
+ measurements->n0_subband_power[aarx][rb] += signal_energy_nodc(ul_ch,len);
- }
+ } // symbol
measurements->n0_subband_power[aarx][rb]/=(14-(frame_parms->Ncp<<1));
measurements->n0_subband_power_dB[aarx][rb] = dB_fixed(measurements->n0_subband_power[aarx][rb]);
n0_power_tot += measurements->n0_subband_power[aarx][rb];
- }
+ } //antenna
n0_power_tot/=frame_parms->nb_antennas_rx;
n0_power_tot2 += n0_power_tot;
- measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_power_tot/frame_parms->nb_antennas_rx);
+ measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_power_tot);
measurements->n0_subband_power_tot_dBm[rb] = measurements->n0_subband_power_tot_dB[rb] - eNB->rx_total_gain_dB - dB_fixed(frame_parms->N_RB_UL);
- }
- }
+ } //rb not used in subframe
+ } //rb
if (nb_rb>0) measurements->n0_subband_power_avg_dB = dB_fixed(n0_power_tot2/nb_rb);
}
void lte_eNB_srs_measurements(PHY_VARS_eNB *eNB,
module_id_t eNB_id,
- module_id_t UE_id,
+ module_id_t srs_id,
unsigned char init_averaging)
{
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
PHY_MEASUREMENTS_eNB *measurements = &eNB->measurements;
- LTE_eNB_SRS *srs_vars = &eNB->srs_vars[UE_id];
+ LTE_eNB_SRS *srs_vars = &eNB->srs_vars[srs_id];
int32_t aarx,rx_power_correction;
int32_t rx_power;
@@ -136,7 +159,7 @@ void lte_eNB_srs_measurements(PHY_VARS_eNB *eNB,
//printf("Running eNB_srs_measurements for eNB_id %d\n",eNB_id);
if (init_averaging == 1)
- rx_power_avg_eNB[UE_id] = 0;
+ rx_power_avg_eNB[srs_id] = 0;
rx_power = 0;
@@ -152,24 +175,24 @@ void lte_eNB_srs_measurements(PHY_VARS_eNB *eNB,
for (aarx=0; aarxnb_antennas_rx; aarx++) {
- measurements->rx_spatial_power[UE_id][0][aarx] =
+ measurements->rx_spatial_power[srs_id][0][aarx] =
((signal_energy_nodc(&srs_vars->srs_ch_estimates[aarx][frame_parms->first_carrier_offset],
(frame_parms->N_RB_DL*6)) +
signal_energy_nodc(&srs_vars->srs_ch_estimates[aarx][1],
(frame_parms->N_RB_DL*6)))*rx_power_correction) -
measurements->n0_power[aarx];
- measurements->rx_spatial_power[UE_id][0][aarx]<<=1; // because of noise only in odd samples
+ measurements->rx_spatial_power[srs_id][0][aarx]<<=1; // because of noise only in odd samples
- measurements->rx_spatial_power_dB[UE_id][0][aarx] = (unsigned short) dB_fixed(measurements->rx_spatial_power[UE_id][0][aarx]);
+ measurements->rx_spatial_power_dB[srs_id][0][aarx] = (unsigned short) dB_fixed(measurements->rx_spatial_power[srs_id][0][aarx]);
- measurements->wideband_cqi[UE_id][aarx] = measurements->rx_spatial_power[UE_id][0][aarx];
+ measurements->wideband_cqi[srs_id][aarx] = measurements->rx_spatial_power[srs_id][0][aarx];
// measurements->rx_power[UE_id][aarx]/=frame_parms->nb_antennas_tx;
- measurements->wideband_cqi_dB[UE_id][aarx] = (unsigned short) dB_fixed(measurements->wideband_cqi[UE_id][aarx]);
- rx_power += measurements->wideband_cqi[UE_id][aarx];
+ measurements->wideband_cqi_dB[srs_id][aarx] = (unsigned short) dB_fixed(measurements->wideband_cqi[srs_id][aarx]);
+ rx_power += measurements->wideband_cqi[srs_id][aarx];
// measurements->rx_avg_power_dB[UE_id] += measurements->rx_power_dB[UE_id][aarx];
}
@@ -177,14 +200,14 @@ void lte_eNB_srs_measurements(PHY_VARS_eNB *eNB,
// measurements->rx_avg_power_dB[UE_id]/=frame_parms->nb_antennas_rx;
if (init_averaging == 0)
- rx_power_avg_eNB[UE_id] = ((k1*rx_power_avg_eNB[UE_id]) + (k2*rx_power))>>10;
+ rx_power_avg_eNB[srs_id] = ((k1*rx_power_avg_eNB[srs_id]) + (k2*rx_power))>>10;
else
- rx_power_avg_eNB[UE_id] = rx_power;
+ rx_power_avg_eNB[srs_id] = rx_power;
- measurements->wideband_cqi_tot[UE_id] = dB_fixed2(rx_power,2*measurements->n0_power_tot);
+ measurements->wideband_cqi_tot[srs_id] = dB_fixed2(rx_power,2*measurements->n0_power_tot);
// times 2 since we have noise only in the odd carriers of the srs comb
- measurements->rx_rssi_dBm[UE_id] = (int32_t)dB_fixed(rx_power_avg_eNB[UE_id])-eNB->rx_total_gain_dB;
+ measurements->rx_rssi_dBm[srs_id] = (int32_t)dB_fixed(rx_power_avg_eNB[srs_id])-eNB->rx_total_gain_dB;
@@ -200,21 +223,21 @@ void lte_eNB_srs_measurements(PHY_VARS_eNB *eNB,
else if (rb>12)
ul_ch = &srs_vars->srs_ch_estimates[aarx][6 + (rb-13)*12];
else {
- measurements->subband_cqi_dB[UE_id][aarx][rb] = 0;
+ measurements->subband_cqi_dB[srs_id][aarx][rb] = 0;
continue;
}
// cqi
if (aarx==0)
- measurements->subband_cqi_tot[UE_id][rb]=0;
+ measurements->subband_cqi_tot[srs_id][rb]=0;
- measurements->subband_cqi[UE_id][aarx][rb] = (signal_energy_nodc(ul_ch,12))*rx_power_correction - measurements->n0_power[aarx];
+ measurements->subband_cqi[srs_id][aarx][rb] = (signal_energy_nodc(ul_ch,12))*rx_power_correction - measurements->n0_power[aarx];
- if (measurements->subband_cqi[UE_id][aarx][rb] < 0)
- measurements->subband_cqi[UE_id][aarx][rb]=0;
+ if (measurements->subband_cqi[srs_id][aarx][rb] < 0)
+ measurements->subband_cqi[srs_id][aarx][rb]=0;
- measurements->subband_cqi_tot[UE_id][rb] += measurements->subband_cqi[UE_id][aarx][rb];
- measurements->subband_cqi_dB[UE_id][aarx][rb] = dB_fixed2(measurements->subband_cqi[UE_id][aarx][rb],
+ measurements->subband_cqi_tot[srs_id][rb] += measurements->subband_cqi[srs_id][aarx][rb];
+ measurements->subband_cqi_dB[srs_id][aarx][rb] = dB_fixed2(measurements->subband_cqi[srs_id][aarx][rb],
2*measurements->n0_power[aarx]);
// 2*n0_power since we have noise from the odd carriers in the comb of the srs
@@ -225,7 +248,7 @@ void lte_eNB_srs_measurements(PHY_VARS_eNB *eNB,
for (rb=0; rbN_RB_DL; rb++) {
- measurements->subband_cqi_tot_dB[UE_id][rb] = dB_fixed2(measurements->subband_cqi_tot[UE_id][rb],
+ measurements->subband_cqi_tot_dB[srs_id][rb] = dB_fixed2(measurements->subband_cqi_tot[srs_id][rb],
measurements->n0_power_tot);
/*
if (measurements->subband_cqi_tot_dB[UE_id][rb] == 65)
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_estimation.h b/openair1/PHY/LTE_ESTIMATION/lte_estimation.h
index fc40280853..6ba901e29f 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_estimation.h
+++ b/openair1/PHY/LTE_ESTIMATION/lte_estimation.h
@@ -288,6 +288,8 @@ void freq_equalization(LTE_DL_FRAME_PARMS *frame_parms,
unsigned short Msc_RS,
unsigned char Qm);
+void init_fde(void);
+void dump_I0_stats(FILE *fd,PHY_VARS_eNB *eNB);
/** @} */
#endif
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c
index 57b4c28661..1fbc8b7ef2 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c
@@ -27,12 +27,9 @@
//#include
#include
-#include "LAYER2/MAC/mac.h"
#include "PHY/defs_UE.h"
#include "PHY/phy_extern_ue.h"
-#include "PHY_INTERFACE/phy_interface.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
-#include "RRC/LTE/rrc_extern.h"
// Note: this is for prototype of generate_drs_pusch (OTA synchronization of RRUs)
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
index 1d1b16e036..0ce716ef20 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
@@ -20,7 +20,7 @@
*/
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
+//#include "PHY/phy_extern.h"
#include "PHY/sse_intrin.h"
//#define DEBUG_CH
#include "common/utils/LOG/log.h"
@@ -34,12 +34,18 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32
#define SCALE 0x3FFF
+static const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
+//static const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
+
+extern unsigned short dftsizes[34];
+extern int16_t *ul_ref_sigs_rx[30][2][34];
+
int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
L1_rxtx_proc_t *proc,
- LTE_eNB_ULSCH_t * ulsch,
- int32_t **ul_ch_estimates,
- int32_t **ul_ch_estimates_time,
- int32_t **rxdataF_ext,
+ LTE_eNB_ULSCH_t * ulsch,
+ int32_t **ul_ch_estimates,
+ int32_t **ul_ch_estimates_time,
+ int32_t **rxdataF_ext,
module_id_t UE_id,
unsigned char l,
unsigned char Ns) {
diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c
index 4b06f67bbe..61af617d6e 100644
--- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c
+++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c
@@ -53,22 +53,25 @@
//#undef LOG_D
//#define LOG_D(A,B...) printf(B)
-int16_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) {
- uint16_t i;
- int16_t first_free_index=-1;
+int find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) {
+ int first_free_index=-1;
AssertFatal(eNB!=NULL,"eNB is null\n");
- for (i=0; idlsch[i]!=NULL,"eNB->dlsch[%d] is null\n",i);
- AssertFatal(eNB->dlsch[i]!=NULL,"eNB->dlsch[%d][0] is null\n",i);
+ for (int i=0; idlsch[i][0] == NULL) continue;
LOG_D(PHY,"searching for rnti %x : UE index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,eNB->dlsch[i][0]->harq_mask,eNB->dlsch[i][0]->rnti,first_free_index);
- if ((eNB->dlsch[i][0]->harq_mask >0) &&
- (eNB->dlsch[i][0]->rnti==rnti)) return i;
- else if ((eNB->dlsch[i][0]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
+ if (type == SEARCH_EXIST_RA) {
+ if (eNB->dlsch[i][0]->rnti==rnti) return i;
+ } else {
+ if ((eNB->dlsch[i][0]->harq_mask >0) &&
+ (eNB->dlsch[i][0]->rnti==rnti)) return i;
+ else if ((eNB->dlsch[i][0]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
+ }
+
}
- if (type == SEARCH_EXIST)
+ if (type == SEARCH_EXIST_RA || type == SEARCH_EXIST)
return -1;
if (first_free_index != -1)
@@ -78,20 +81,23 @@ int16_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) {
}
-int16_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) {
- uint16_t i;
- int16_t first_free_index=-1;
+int find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) {
+ int first_free_index=-1;
AssertFatal(eNB!=NULL,"eNB is null\n");
- for (i=0; iulsch[i]!=NULL,"eNB->ulsch[%d] is null\n",i);
+ for (int i=0; iulsch[i]==NULL) continue;
- if ((eNB->ulsch[i]->harq_mask >0) &&
- (eNB->ulsch[i]->rnti==rnti)) return i;
- else if ((eNB->ulsch[i]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
+ if (type == SEARCH_EXIST_RA) {
+ if (eNB->ulsch[i]->rnti == rnti) return i;
+ } else {
+ if ((eNB->ulsch[i]->harq_mask >0) &&
+ (eNB->ulsch[i]->rnti==rnti)) return i;
+ else if ((eNB->ulsch[i]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
+ }
}
- if (type == SEARCH_EXIST)
+ if (type == SEARCH_EXIST_RA || type == SEARCH_EXIST)
return -1;
if (first_free_index != -1)
@@ -301,7 +307,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,
UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE);
- if( (UE_id<0) || (UE_id>=NUMBER_OF_UE_MAX) ) {
+ if( (UE_id<0) || (UE_id>=NUMBER_OF_DLSCH_MAX) ) {
LOG_E(PHY,"illegal UE_id found!!! rnti %04x UE_id %d\n",rel8->rnti,UE_id);
return;
}
@@ -476,7 +482,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,
((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->harq_pid = rel8->harq_process;
((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->dai = rel8->downlink_assignment_index;
((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->padding = 0;
- // printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
+ //LOG_D(PHY,"TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",rel8->mcs_1,rel8->resource_block_coding,rel8->redundancy_version_1,NPRB);
} else {
dci_alloc->dci_length = sizeof_DCI1A_20MHz_FDD_t;
((DCI1A_20MHz_FDD_t *)dci_pdu)->type = 1;
@@ -535,7 +541,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,
dlsch0->harq_mask |= (1 << rel8->harq_process);
- if (rel8->rnti_type == 1) LOG_D(PHY,"DCI 1A: round %d, mcs %d, TBS %d, rballoc %x, rv %d, rnti %x, harq process %d\n",dlsch0_harq->round,rel8->mcs_1,dlsch0_harq->TBS,rel8->resource_block_coding,
+ if (rel8->rnti != SI_RNTI) LOG_D(PHY,"DCI 1A: round %d, mcs %d, TBS %d, rballoc %x, rv %d, rnti %x, harq process %d\n",dlsch0_harq->round,rel8->mcs_1,dlsch0_harq->TBS,rel8->resource_block_coding,
rel8->redundancy_version_1,rel8->rnti,rel8->harq_process);
break;
@@ -1550,7 +1556,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,mDCI_ALLOC_t *dc
dci_alloc->i0 = rel13->initial_transmission_sf_io;
UE_id = find_dlsch (rel13->rnti, eNB, SEARCH_EXIST_OR_FREE);
AssertFatal (UE_id != -1, "no free or exiting dlsch_context\n");
- AssertFatal (UE_id < NUMBER_OF_UE_MAX, "returned UE_id %d >= %d(NUMBER_OF_UE_MAX)\n", UE_id, NUMBER_OF_UE_MAX);
+ AssertFatal (UE_id < NUMBER_OF_DLSCH_MAX, "returned UE_id %d >= %d(NUMBER_OF_DLSCH_MAX)\n", UE_id, NUMBER_OF_DLSCH_MAX);
dlsch0 = eNB->dlsch[UE_id][0];
dlsch0_harq = dlsch0->harq_processes[rel13->harq_process];
dci_alloc->ra_flag = 0;
@@ -1955,7 +1961,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc,
if(frame_parms->frame_type == TDD) {
UE_id = find_ulsch(pdu->dci_pdu_rel8.rnti, eNB,SEARCH_EXIST_OR_FREE);
- if(UE_id != -1) {
+ if(UE_id >=0 -1 || UE_id < NUMBER_OF_ULSCH_MAX) {
eNB->ulsch[UE_id]->harq_processes[pdu->dci_pdu_rel8.harq_pid]->V_UL_DAI = dai +1;
}
}
diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c b/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c
index 583d12eedb..64e74ebfbf 100644
--- a/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c
+++ b/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c
@@ -32,7 +32,6 @@
#include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
-#include "SCHED/sched_eNB.h"
#ifdef DEBUG_DCI_TOOLS
#include "PHY/phy_vars.h"
#endif
@@ -43,7 +42,6 @@
//#define DEBUG_HARQ
-#include "LAYER2/MAC/mac.h"
//#define DEBUG_DCI
@@ -100,7 +98,6 @@ uint16_t RIV2nb_rb_LUT100[6000];
uint16_t RIV2first_rb_LUT100[6000];
uint16_t RIV_max100=0;
-extern RAN_CONTEXT_t RC;
extern uint32_t current_dlsch_cqi;
@@ -273,15 +270,6 @@ uint16_t get_nCCE(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uint
-uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe)
-{
-
- // check for eNB only !
- return(get_nCCE(num_pdcch_symbols,
- &RC.eNB[Mod_id][CC_id]->frame_parms,
- get_mi(&RC.eNB[Mod_id][CC_id]->frame_parms,subframe)));
-}
-
void conv_eMTC_rballoc (uint16_t resource_block_coding, uint32_t N_RB_DL, uint32_t * rb_alloc)
{
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
index 3eb44d98fa..b5bcb0848d 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
@@ -96,6 +96,7 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch) {
}
+
LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,
unsigned char Mdlharq,
uint32_t Nsoft,
@@ -110,7 +111,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,
switch (N_RB_DL) {
case 6:
- bw_scaling =16;
+ bw_scaling = 4;
break;
case 25:
@@ -160,7 +161,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,
for (i=0; iharq_processes[i] = (LTE_DL_eNB_HARQ_t *)malloc16(sizeof(LTE_DL_eNB_HARQ_t));
- LOG_T(PHY, "Required mem size %d (bw scaling %d), dlsch->harq_processes[%d] %p\n",
+ LOG_I(PHY, "Required DLSCH mem size %d (bw scaling %d), dlsch->harq_processes[%d] %p\n",
MAX_DLSCH_PAYLOAD_BYTES/bw_scaling,bw_scaling, i,dlsch->harq_processes[i]);
if (dlsch->harq_processes[i]) {
@@ -169,9 +170,9 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,
dlsch->harq_processes[i]->b = (unsigned char *)malloc16(MAX_DLSCH_PAYLOAD_BYTES/bw_scaling);
if (dlsch->harq_processes[i]->b) {
- bzero(dlsch->harq_processes[i]->b,MAX_DLSCH_PAYLOAD_BYTES/bw_scaling);
+ memset(dlsch->harq_processes[i]->b,0,MAX_DLSCH_PAYLOAD_BYTES/bw_scaling);
} else {
- printf("Can't get b\n");
+ AssertFatal(1==0,"Can't get b\n");
exit_flag=1;
}
@@ -181,15 +182,15 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,
dlsch->harq_processes[i]->c[r] = (uint8_t *)malloc16(((r==0)?8:0) + 3+ 768);
if (dlsch->harq_processes[i]->c[r]) {
- bzero(dlsch->harq_processes[i]->c[r],((r==0)?8:0) + 3+ 768);
+ memset(dlsch->harq_processes[i]->c[r],0,((r==0)?8:0) + 3+ 768);
} else {
- printf("Can't get c\n");
+ AssertFatal(1==0,"Can't get c\n");
exit_flag=2;
}
}
}
} else {
- printf("Can't get harq_p %d\n",i);
+ AssertFatal(1==0,"Can't get harq_p %d\n",i);
exit_flag=3;
}
}
@@ -203,7 +204,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,
}
}
- LOG_D(PHY,"new_eNB_dlsch exit flag %d, size of %ld\n",
+ LOG_I(PHY,"new_eNB_dlsch exit flag %d, size of %ld\n",
exit_flag, sizeof(LTE_eNB_DLSCH_t));
free_eNB_dlsch(dlsch);
return(NULL);
@@ -360,6 +361,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
proc->nbEncode=0;
+
// if (hadlsch->Ndi == 1) { // this is a new packet
if (hadlsch->round == 0) { // this is a new packet
// Add 24-bit crc (polynomial A) to payload
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
index 347fbb026b..aba4a464f2 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
@@ -2375,16 +2375,14 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
for (l=num_pdcch_symbols; lmimo_mode,
pmi2hex_2Ar2(dlsch0_harq->pmi_alloc),
mod_order0,
mod_order1,
rb_alloc[0]
);
-#endif
}
if (frame_parms->Ncp==0) { // normal prefix
@@ -2980,7 +2978,7 @@ int allocate_REs_in_RB_MCH_khz_1dot25(int32_t **txdataF,
case 2: //QPSK
- LOG_D(PHY,"%d : %d,%d => ",tti_offset,((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
+ LOG_D(PHY,"%d : %d,%d => ",tti_offset,((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
((int16_t*)&txdataF[0][tti_offset])[0] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //I //b_i
*jj = *jj + 1;
@@ -3082,7 +3080,7 @@ int mch_modulation_khz_1dot25(int32_t **txdataF,
uint8_t skip_dc=0;
uint8_t mod_order = dlsch->harq_processes[0]->Qm;
int16_t qam16_table_a[4],qam64_table_a[8];//,qam16_table_b[4],qam64_table_b[8];
- int16_t *qam_table_s;
+ int16_t *qam_table_s=qam16_table_a;
nsymb_pmch = 1;
nsymb = (frame_parms->Ncp == NORMAL) ? 14 : 12;
@@ -3125,12 +3123,8 @@ int mch_modulation_khz_1dot25(int32_t **txdataF,
}
- if (mod_order == 4)
- qam_table_s = qam16_table_a;
- else if (mod_order == 6)
+ if (mod_order == 6)
qam_table_s = qam64_table_a;
- else
- qam_table_s = NULL;
//LOG_I(PHY,"Allocated rb %d, subframe_offset %d,amp %d\n",rb,subframe_offset,amp);
allocate_REs_in_RB_MCH_khz_1dot25(txdataF,
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c b/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c
index b03f59fb78..015a95a862 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c
@@ -113,9 +113,6 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
x2 = ((Ns>>1)<<9) + frame_parms->Nid_cell_mbsfn; //this is c_init in 36.211 Sec 6.3.1 for PMCH
}
-#ifdef DEBUG_SCRAMBLING
- printf("scrambling: i0 %d rnti %x, q %d, Ns %d, Nid_cell %d, G %d x2 %x\n",dlsch->i0,dlsch->rnti,q,Ns,frame_parms->Nid_cell, G, x2);
-#endif
s = lte_gold_generic(&x1, &x2, 1);
for (n=0; n<(1+(G>>5)); n++) {
diff --git a/openair1/PHY/LTE_TRANSPORT/if4_tools.c b/openair1/PHY/LTE_TRANSPORT/if4_tools.c
index 95ad420028..09c0b4ba0f 100644
--- a/openair1/PHY/LTE_TRANSPORT/if4_tools.c
+++ b/openair1/PHY/LTE_TRANSPORT/if4_tools.c
@@ -30,10 +30,13 @@
* \warning
*/
-#include "PHY/defs_eNB.h"
+#include
+//#include "PHY/defs_eNB.h"
+#include "PHY/defs_RU.h"
#include "PHY/TOOLS/alaw_lut.h"
-#include "PHY/phy_extern.h"
-#include "SCHED/sched_eNB.h"
+//#include "PHY/phy_extern.h"
+//#include "SCHED/sched_eNB.h"
+lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
//#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
diff --git a/openair1/PHY/LTE_TRANSPORT/if5_tools.c b/openair1/PHY/LTE_TRANSPORT/if5_tools.c
index f39f3ef872..e2bec337aa 100644
--- a/openair1/PHY/LTE_TRANSPORT/if5_tools.c
+++ b/openair1/PHY/LTE_TRANSPORT/if5_tools.c
@@ -31,11 +31,11 @@
*/
#include
-#include "PHY/defs_eNB.h"
+#include
+#include "PHY/defs_RU.h"
#include "PHY/TOOLS/alaw_lut.h"
//#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
-#include
#include "common/utils/LOG/vcd_signal_dumper.h"
//#define DEBUG_DL_MOBIPASS
//#define DEBUG_UL_MOBIPASS
@@ -1469,7 +1469,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
// HYPOTHESIS: first packet per subframe has lowest timestamp of subframe
// should detect out of order and act accordingly ....
AssertFatal(aid==0 || aid==1,"aid %d != 0 or 1\n",aid);
- //LOG_I(PHY,"rxp[%d] %p, dest %p, offset %d (%lld,%lld)\n",aid,rxp[aid],rxp[aid]+(timestamp[packet_id]-timestamp[0]),(timestamp[packet_id]-timestamp[0]),timestamp[packet_id],timestamp[0]);
+ LOG_D(PHY,"rxp[%d] %p, dest %p, offset %d (%llu,%llu)\n",aid,rxp[aid],rxp[aid]+(timestamp[packet_id]-timestamp[0]),(int)(timestamp[packet_id]-timestamp[0]),(long long unsigned int)timestamp[packet_id],(long long unsigned int)timestamp[0]);
memcpy((void*)(rxp[aid]+(timestamp[packet_id]-timestamp[0])),
(void*)temp_rx,
spp_eth<<2);
diff --git a/openair1/PHY/LTE_TRANSPORT/pbch.c b/openair1/PHY/LTE_TRANSPORT/pbch.c
index dfa990269e..8e9a968827 100644
--- a/openair1/PHY/LTE_TRANSPORT/pbch.c
+++ b/openair1/PHY/LTE_TRANSPORT/pbch.c
@@ -72,6 +72,7 @@ int allocate_pbch_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
first_re=0;
last_re=12;
+
for (re=first_re; re
#include
+#include "common/utils/lte/prach_utils.h"
void rx_prach0(PHY_VARS_eNB *eNB,
RU_t *ru,
@@ -84,7 +85,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
uint8_t aa;
int32_t lev;
int16_t levdB;
- int fft_size,log2_ifft_size;
+ int fft_size=0,log2_ifft_size;
int16_t prach_ifft_tmp[2048*2] __attribute__((aligned(32)));
int32_t *prach_ifft=(int32_t *)NULL;
int32_t **prach_ifftp=(int32_t **)NULL;
@@ -112,7 +113,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
prach_ConfigIndex = fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[ce_level];
Ncs_config = fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig;
restricted_set = fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag;
- n_ra_prb = get_prach_prb_offset(fp,prach_ConfigIndex,
+ n_ra_prb = get_prach_prb_offset(fp->frame_type,fp->tdd_config,fp->N_RB_UL,fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[ce_level],
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],
tdd_mapindex,Nf);
// update pointers to results for ce_level
@@ -124,7 +125,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
prach_ConfigIndex = fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
Ncs_config = fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig;
restricted_set = fp->prach_config_common.prach_ConfigInfo.highSpeedFlag;
- n_ra_prb = get_prach_prb_offset(fp,prach_ConfigIndex,
+ n_ra_prb = get_prach_prb_offset(fp->frame_type,fp->tdd_config,fp->N_RB_UL,fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,
tdd_mapindex,Nf);
}
@@ -140,7 +141,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
rxsigF = eNB->prach_vars_br.rxsigF[ce_level];
if (LOG_DEBUGFLAG(PRACH)) {
- if (((frame_prach)&1023) < 20) LOG_I(PHY,
+ if (((frame_prach)&1023) < 20) LOG_D(PHY,
"PRACH (eNB) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d, rootSequenceIndex %d, repetition number %d,numRepetitionsPrePreambleAttempt %d\n",
br_flag,ce_level,frame_prach,subframe,
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],
@@ -153,24 +154,24 @@ void rx_prach0(PHY_VARS_eNB *eNB,
prachF = eNB->prach_vars.prachF;
rxsigF = eNB->prach_vars.rxsigF[0];
- if (LOG_DEBUGFLAG(PRACH)) {
- if (((frame_prach)&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n", subframe,
+ //if (LOG_DEBUGFLAG(PRACH)) {
+ if (((frame_prach)&1023) < 20) LOG_D(PHY,"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n", subframe,
fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex,rootSequenceIndex);
- }
+ //}
}
} else {
if (br_flag == 1) {
rxsigF = ru->prach_rxsigF_br[ce_level];
if (LOG_DEBUGFLAG(PRACH)) {
- if (((frame_prach)&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
+ if (((frame_prach)&1023) < 20) LOG_D(PHY,"PRACH (RU) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
br_flag,ce_level,frame_prach,subframe,fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],prach_ConfigIndex);
}
} else {
rxsigF = ru->prach_rxsigF[0];
if (LOG_DEBUGFLAG(PRACH)) {
- if (((frame_prach)&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
+ if (((frame_prach)&1023) < 20) LOG_D(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex);
}
}
@@ -299,11 +300,13 @@ void rx_prach0(PHY_VARS_eNB *eNB,
case 6:
if (prach_fmt == 4) {
dft(DFT_256,prach2,rxsigF[aa],1);
+ fft_size=256;
} else {
dft(DFT_1536,prach2,rxsigF[aa],1);
if (prach_fmt>1)
dft(DFT_1536,prach2+3072,rxsigF[aa]+3072,1);
+ fft_size=1536;
}
break;
@@ -311,13 +314,14 @@ void rx_prach0(PHY_VARS_eNB *eNB,
case 15:
if (prach_fmt == 4) {
dft(DFT_256,prach2,rxsigF[aa],1);
+ fft_size=256;
} else {
dft(DFT_3072,prach2,rxsigF[aa],1);
if (prach_fmt>1)
dft(DFT_3072,prach2+6144,rxsigF[aa]+6144,1);
}
-
+ fft_size=3072;
break;
case 25:
@@ -339,11 +343,13 @@ void rx_prach0(PHY_VARS_eNB *eNB,
case 50:
if (prach_fmt == 4) {
dft(DFT_2048,prach2,rxsigF[aa],1);
+ fft_size=2048;
} else {
dft(DFT_12288,prach2,rxsigF[aa],1);
if (prach_fmt>1)
dft(DFT_12288,prach2+24576,rxsigF[aa]+24576,1);
+ fft_size=12288;
}
break;
@@ -351,11 +357,13 @@ void rx_prach0(PHY_VARS_eNB *eNB,
case 75:
if (prach_fmt == 4) {
dft(DFT_3072,prach2,rxsigF[aa],1);
+ fft_size=3072;
} else {
dft(DFT_18432,prach2,rxsigF[aa],1);
if (prach_fmt>1)
dft(DFT_18432,prach2+36864,rxsigF[aa]+36864,1);
+ fft_size=18432;
}
break;
@@ -364,20 +372,24 @@ void rx_prach0(PHY_VARS_eNB *eNB,
if (fp->threequarter_fs==0) {
if (prach_fmt == 4) {
dft(DFT_4096,prach2,rxsigF[aa],1);
+ fft_size=2048;
} else {
dft(DFT_24576,prach2,rxsigF[aa],1);
if (prach_fmt>1)
dft(DFT_24576,prach2+49152,rxsigF[aa]+49152,1);
+ fft_size=24576;
}
} else {
if (prach_fmt == 4) {
dft(DFT_3072,prach2,rxsigF[aa],1);
+ fft_size=3072;
} else {
dft(DFT_18432,prach2,rxsigF[aa],1);
if (prach_fmt>1)
dft(DFT_18432,prach2+36864,rxsigF[aa]+36864,1);
+ fft_size=18432;
}
}
@@ -547,7 +559,6 @@ void rx_prach0(PHY_VARS_eNB *eNB,
}
log2_ifft_size = 10;
- fft_size = 6144;
if (new_dft == 1) {
new_dft = 0;
diff --git a/openair1/PHY/LTE_TRANSPORT/prach_common.c b/openair1/PHY/LTE_TRANSPORT/prach_common.c
index 393d4ca3f8..e366e8edbc 100644
--- a/openair1/PHY/LTE_TRANSPORT/prach_common.c
+++ b/openair1/PHY/LTE_TRANSPORT/prach_common.c
@@ -34,7 +34,7 @@
#include "PHY/phy_extern.h"
#include "PHY/phy_extern_ue.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
-
+#include "common/utils/lte/prach_utils.h"
uint16_t NCS_unrestricted[16] = {0,13,15,18,22,26,32,38,46,59,76,93,119,167,279,419};
uint16_t NCS_restricted[15] = {15,18,22,26,32,38,46,55,68,82,100,128,158,202,237}; // high-speed case
@@ -44,6 +44,9 @@ int16_t ru[2*839]; // quantized roots of unity
uint32_t ZC_inv[839]; // multiplicative inverse for roots u
uint16_t du[838];
+extern PRACH_TDD_PREAMBLE_MAP tdd_preamble_map[64][7];
+
+/*
// This is table 5.7.1-4 from 36.211
PRACH_TDD_PREAMBLE_MAP tdd_preamble_map[64][7] = {
// TDD Configuration Index 0
@@ -254,7 +257,7 @@ PRACH_TDD_PREAMBLE_MAP tdd_preamble_map[64][7] = {
}
};
-
+*/
uint16_t prach_root_sequence_map0_3[838] = { 129, 710, 140, 699, 120, 719, 210, 629, 168, 671, 84, 755, 105, 734, 93, 746, 70, 769, 60, 779,
2, 837, 1, 838,
@@ -378,192 +381,13 @@ uint8_t get_fid_prach_tdd(module_id_t Mod_id,uint8_t tdd_map_index) {
return(tdd_preamble_map[fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex][fp->tdd_config].map[tdd_map_index].f_ra);
}
-uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,lte_frame_type_t frame_type) {
- if (frame_type == FDD) // FDD
- return(prach_ConfigIndex>>4);
- else {
- if (prach_ConfigIndex < 20)
- return (0);
-
- if (prach_ConfigIndex < 30)
- return (1);
-
- if (prach_ConfigIndex < 40)
- return (2);
-
- if (prach_ConfigIndex < 48)
- return (3);
- else
- return (4);
- }
-}
-
-uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms,
- uint8_t prach_ConfigIndex,
- uint8_t n_ra_prboffset,
- uint8_t tdd_mapindex, uint16_t Nf) {
- lte_frame_type_t frame_type = frame_parms->frame_type;
- uint8_t tdd_config = frame_parms->tdd_config;
- uint8_t n_ra_prb;
- uint8_t f_ra,t1_ra;
- uint8_t prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type);
- uint8_t Nsp=2;
-
- if (frame_type == TDD) { // TDD
- if (tdd_preamble_map[prach_ConfigIndex][tdd_config].num_prach==0) {
- LOG_E(PHY, "Illegal prach_ConfigIndex %"PRIu8"", prach_ConfigIndex);
- return(-1);
- }
-
- // adjust n_ra_prboffset for frequency multiplexing (p.36 36.211)
- f_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[tdd_mapindex].f_ra;
-
- if (prach_fmt < 4) {
- if ((f_ra&1) == 0) {
- n_ra_prb = n_ra_prboffset + 6*(f_ra>>1);
- } else {
- n_ra_prb = frame_parms->N_RB_UL - 6 - n_ra_prboffset + 6*(f_ra>>1);
- }
- } else {
- if ((tdd_config >2) && (tdd_config<6))
- Nsp = 2;
-
- t1_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t1_ra;
-
- if ((((Nf&1)*(2-Nsp)+t1_ra)&1) == 0) {
- n_ra_prb = 6*f_ra;
- } else {
- n_ra_prb = frame_parms->N_RB_UL - 6*(f_ra+1);
- }
- }
- } else { //FDD
- n_ra_prb = n_ra_prboffset;
- }
-
- return(n_ra_prb);
-}
-
-int is_prach_subframe0(LTE_DL_FRAME_PARMS *frame_parms,uint8_t prach_ConfigIndex,uint32_t frame, uint8_t subframe) {
- // uint8_t prach_ConfigIndex = frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
- uint8_t tdd_config = frame_parms->tdd_config;
- uint8_t t0_ra;
- uint8_t t1_ra;
- uint8_t t2_ra;
- int prach_mask = 0;
-
- if (frame_parms->frame_type == FDD) { //FDD
- //implement Table 5.7.1-2 from 36.211 (Rel-10, p.41)
- if ((((frame&1) == 1) && (subframe < 9)) ||
- (((frame&1) == 0) && (subframe == 9))) // This is an odd frame, ignore even-only PRACH frames
- if (((prach_ConfigIndex&0xf)<3) || // 0,1,2,16,17,18,32,33,34,48,49,50
- ((prach_ConfigIndex&0x1f)==18) || // 18,50
- ((prach_ConfigIndex&0xf)==15)) // 15,47
- return(0);
-
- switch (prach_ConfigIndex&0x1f) {
- case 0:
- case 3:
- if (subframe==1) prach_mask = 1;
-
- break;
-
- case 1:
- case 4:
- if (subframe==4) prach_mask = 1;
-
- break;
-
- case 2:
- case 5:
- if (subframe==7) prach_mask = 1;
-
- break;
-
- case 6:
- if ((subframe==1) || (subframe==6)) prach_mask=1;
-
- break;
-
- case 7:
- if ((subframe==2) || (subframe==7)) prach_mask=1;
-
- break;
-
- case 8:
- if ((subframe==3) || (subframe==8)) prach_mask=1;
-
- break;
-
- case 9:
- if ((subframe==1) || (subframe==4) || (subframe==7)) prach_mask=1;
-
- break;
-
- case 10:
- if ((subframe==2) || (subframe==5) || (subframe==8)) prach_mask=1;
-
- break;
-
- case 11:
- if ((subframe==3) || (subframe==6) || (subframe==9)) prach_mask=1;
-
- break;
-
- case 12:
- if ((subframe&1)==0) prach_mask=1;
-
- break;
-
- case 13:
- if ((subframe&1)==1) prach_mask=1;
-
- break;
-
- case 14:
- prach_mask=1;
- break;
-
- case 15:
- if (subframe==9) prach_mask=1;
-
- break;
- }
- } else { // TDD
- AssertFatal(prach_ConfigIndex<64,
- "Illegal prach_ConfigIndex %d for ",prach_ConfigIndex);
- AssertFatal(tdd_preamble_map[prach_ConfigIndex][tdd_config].num_prach>0,
- "Illegal prach_ConfigIndex %d for ",prach_ConfigIndex);
- t0_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t0_ra;
- t1_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t1_ra;
- t2_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t2_ra;
-#ifdef PRACH_DEBUG
- LOG_I(PHY,"[PRACH] Checking for PRACH format (ConfigIndex %d) in TDD subframe %d (%d,%d,%d)\n",
- prach_ConfigIndex,
- subframe,
- t0_ra,t1_ra,t2_ra);
-#endif
-
- if ((((t0_ra == 1) && ((frame &1)==0))|| // frame is even and PRACH is in even frames
- ((t0_ra == 2) && ((frame &1)==1))|| // frame is odd and PRACH is in odd frames
- (t0_ra == 0)) && // PRACH is in all frames
- (((subframe<5)&&(t1_ra==0)) || // PRACH is in 1st half-frame
- (((subframe>4)&&(t1_ra==1))))) { // PRACH is in 2nd half-frame
- if ((prach_ConfigIndex<48) && // PRACH only in normal UL subframe
- (((subframe%5)-2)==t2_ra)) prach_mask=1;
- else if ((prach_ConfigIndex>47) && (((subframe%5)-1)==t2_ra)) prach_mask=1; // PRACH can be in UpPTS
- }
- }
-
- return(prach_mask);
-}
-
int is_prach_subframe(LTE_DL_FRAME_PARMS *frame_parms, uint32_t frame, uint8_t subframe) {
uint8_t prach_ConfigIndex = frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
- int prach_mask = is_prach_subframe0(frame_parms, prach_ConfigIndex, frame, subframe);
+ int prach_mask = is_prach_subframe0(frame_parms->tdd_config,frame_parms->frame_type, prach_ConfigIndex, frame, subframe);
for (int i=0; i<4; i++) {
if (frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[i] == 1)
- prach_mask |= (is_prach_subframe0(frame_parms, frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[i],
+ prach_mask |= (is_prach_subframe0(frame_parms->tdd_config,frame_parms->frame_type, frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[i],
frame, subframe) << (i+1));
}
diff --git a/openair1/PHY/LTE_TRANSPORT/prach_extern.h b/openair1/PHY/LTE_TRANSPORT/prach_extern.h
index 47fbd93ad7..3404646923 100644
--- a/openair1/PHY/LTE_TRANSPORT/prach_extern.h
+++ b/openair1/PHY/LTE_TRANSPORT/prach_extern.h
@@ -35,7 +35,7 @@
#include "PHY/sse_intrin.h"
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
+//#include "PHY/phy_extern.h"
//#define PRACH_DEBUG 1
//#define PRACH_WRITE_OUTPUT_DEBUG 1
@@ -74,17 +74,6 @@ uint8_t get_num_prach_tdd(module_id_t Mod_id);
uint8_t get_fid_prach_tdd(module_id_t Mod_id,uint8_t tdd_map_index);
-uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,lte_frame_type_t frame_type);
-
-
-uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms,
- uint8_t prach_ConfigIndex,
- uint8_t n_ra_prboffset,
- uint8_t tdd_mapindex, uint16_t Nf);
-
-
-int is_prach_subframe0(LTE_DL_FRAME_PARMS *frame_parms,uint8_t prach_ConfigIndex,uint32_t frame, uint8_t subframe);
-
int is_prach_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t subframe);
diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c
index c72fa1b480..3270066448 100644
--- a/openair1/PHY/LTE_TRANSPORT/pucch.c
+++ b/openair1/PHY/LTE_TRANSPORT/pucch.c
@@ -65,10 +65,41 @@ int16_t cfo_pucch_ep[24*6] = {24278,-22005,29621,-14010,32412,-4808,32412,4807,2
+void dump_uci_stats(FILE *fd,PHY_VARS_eNB *eNB,int frame) {
+
+ int strpos=0;
+ char output[16384];
+
+ for (int i=0;iuci_stats[i].rnti>0) {
+ eNB_UCI_STATS_t *uci_stats = &eNB->uci_stats[i];
+ strpos+=sprintf(output+strpos,"UCI %d RNTI %x: pucch1_trials %d, pucch1_n0 %d dB, pucch1_thres %d dB, current pucch1_stat_pos %d dB, current pucch1_stat_neg %d dB, positive SR count %d\n",
+ i,uci_stats->rnti,uci_stats->pucch1_trials,eNB->measurements.n0_pucch_dB/*max(eNB->measurements.n0_subband_power_tot_dB[0], eNB->measurements.n0_subband_power_tot_dB[eNB->frame_parms.N_RB_UL-1])*/,uci_stats->pucch1_thres,dB_fixed(uci_stats->current_pucch1_stat_pos),dB_fixed(uci_stats->current_pucch1_stat_neg),uci_stats->pucch1_positive_SR);
+ strpos+=sprintf(output+strpos,"UCI %d RNTI %x: pucch1_low (%d,%d)dB pucch1_high (%d,%d)dB\n",
+ i,uci_stats->rnti,
+ dB_fixed(uci_stats->pucch1_low_stat[0]),
+ dB_fixed(uci_stats->pucch1_low_stat[1]),
+ dB_fixed(uci_stats->pucch1_high_stat[0]),
+ dB_fixed(uci_stats->pucch1_high_stat[1]));
+
+ strpos+=sprintf(output+strpos,"UCI %d RNTI %x: pucch1a_trials %d, pucch1a_stat (%d,%d), pucch1b_trials %d, pucch1b_stat (%d,%d) pucch1ab_DTX %d\n",
+ i,uci_stats->rnti,
+ uci_stats->pucch1a_trials,
+ uci_stats->current_pucch1a_stat_re,
+ uci_stats->current_pucch1a_stat_im,
+ uci_stats->pucch1b_trials,
+ uci_stats->current_pucch1b_stat_re,
+ uci_stats->current_pucch1b_stat_im,
+ uci_stats->pucch1ab_DTX);
+ }
+ }
+ if (fd) fprintf(fd,"%s",output);
+ else printf("%s",output);
+}
/* PUCCH format3 >> */
/* SubCarrier Demap */
uint16_t pucchfmt3_subCarrierDeMapping( PHY_VARS_eNB *eNB,
- int16_t SubCarrierDeMapData[NB_ANTENNAS_RX][14][12][2],
+ int16_t SubCarrierDeMapData[4][14][12][2],
uint16_t n3_pucch ) {
LTE_eNB_COMMON *eNB_common_vars = &eNB->common_vars;
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
@@ -118,8 +149,8 @@ uint16_t pucchfmt3_subCarrierDeMapping( PHY_VARS_eNB *eNB,
}
/* cyclic shift hopping remove */
-uint16_t pucchfmt3_Baseseq_csh_remove( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX][14][12][2],
- int16_t CshData_fmt3[NB_ANTENNAS_RX][14][12][2],
+uint16_t pucchfmt3_Baseseq_csh_remove( int16_t SubCarrierDeMapData[4][14][12][2],
+ int16_t CshData_fmt3[4][14][12][2],
LTE_DL_FRAME_PARMS *frame_parms,
uint8_t subframe,
uint8_t ncs_cell[20][7] ) {
@@ -169,9 +200,9 @@ const int16_t TBL_3_SF5_GEN_N_DASH_NS[MAXROW_TBL_SF5_OS_IDX] = {0,3,6,8,10};
const int16_t TBL_3_SF4_GEN_N_DASH_NS[MAXROW_TBL_SF4_OS_IDX] = {0,3,6,9};
/* Channel estimation */
-uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX][14][12][2],
- double delta_theta[NB_ANTENNAS_RX][12],
- int16_t ChestValue[NB_ANTENNAS_RX][2][12][2],
+uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[4][14][12][2],
+ double delta_theta[4][12],
+ int16_t ChestValue[4][2][12][2],
int16_t *Interpw,
uint8_t subframe,
uint8_t shortened_format,
@@ -183,12 +214,12 @@ uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX
int16_t np, np_n, ip_ind=-1;
//int16_t npucch_sf;
int16_t calctmp[2];
- int16_t BsCshData[NB_ANTENNAS_RX][D_NSYM1SF][D_NSC1RB][2];
- //int16_t delta_theta_calctmp[NB_ANTENNAS_RX][4][D_NSC1RB][2], delta_theta_comp[NB_ANTENNAS_RX][D_NSC1RB][2];
- int16_t delta_theta_comp[NB_ANTENNAS_RX][D_NSC1RB][2];
- int16_t CsData_allavg[NB_ANTENNAS_RX][14][2];
- int16_t CsData_temp[NB_ANTENNAS_RX][D_NSYM1SF][D_NSC1RB][2];
- int32_t IP_CsData_allsfavg[NB_ANTENNAS_RX][14][4][2];
+ int16_t BsCshData[4][D_NSYM1SF][D_NSC1RB][2];
+ //int16_t delta_theta_calctmp[4][4][D_NSC1RB][2], delta_theta_comp[4][D_NSC1RB][2];
+ int16_t delta_theta_comp[4][D_NSC1RB][2];
+ int16_t CsData_allavg[4][14][2];
+ int16_t CsData_temp[4][D_NSYM1SF][D_NSC1RB][2];
+ int32_t IP_CsData_allsfavg[4][14][4][2];
int32_t IP_allavg[D_NPUCCH_SF5];
//int16_t temp_ch[2];
int16_t m[NUMBER_OF_UE_MAX], m_self=0, same_m_number;
@@ -432,9 +463,9 @@ uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX
}
/* Channel Equalization */
-uint16_t pucchfmt3_Equalization( int16_t CshData_fmt3[NB_ANTENNAS_RX][14][12][2],
- int16_t ChdetAfterValue_fmt3[NB_ANTENNAS_RX][14][12][2],
- int16_t ChestValue[NB_ANTENNAS_RX][2][12][2],
+uint16_t pucchfmt3_Equalization( int16_t CshData_fmt3[4][14][12][2],
+ int16_t ChdetAfterValue_fmt3[4][14][12][2],
+ int16_t ChestValue[4][2][12][2],
LTE_DL_FRAME_PARMS *frame_parms) {
int16_t aa, sltNo, symNo, k;
@@ -457,9 +488,9 @@ uint16_t pucchfmt3_Equalization( int16_t CshData_fmt3[NB_ANTENNAS_RX][14][12][2]
}
/* Frequency deviation remove AFC */
-uint16_t pucchfmt3_FrqDevRemove( int16_t ChdetAfterValue_fmt3[NB_ANTENNAS_RX][14][12][2],
- double delta_theta[NB_ANTENNAS_RX][12],
- int16_t RemoveFrqDev_fmt3[NB_ANTENNAS_RX][2][5][12][2],
+uint16_t pucchfmt3_FrqDevRemove( int16_t ChdetAfterValue_fmt3[4][14][12][2],
+ double delta_theta[4][12],
+ int16_t RemoveFrqDev_fmt3[4][2][5][12][2],
LTE_DL_FRAME_PARMS *frame_parms ) {
int16_t aa, sltNo, symNo1slt, k, n;
double calctmp[2];
@@ -509,8 +540,8 @@ const int16_t TBL_3_SF4[MAXROW_TBL_SF4_fmt3][MAXCLM_TBL_SF4][2] = {
};
/* orthogonal sequence remove */
-uint16_t pucchfmt3_OrthSeqRemove( int16_t RemoveFrqDev_fmt3[NB_ANTENNAS_RX][2][5][12][2],
- int16_t Fmt3xDataRmvOrth[NB_ANTENNAS_RX][2][5][12][2],
+uint16_t pucchfmt3_OrthSeqRemove( int16_t RemoveFrqDev_fmt3[4][2][5][12][2],
+ int16_t Fmt3xDataRmvOrth[4][2][5][12][2],
uint8_t shortened_format,
uint16_t n3_pucch,
LTE_DL_FRAME_PARMS *frame_parms ) {
@@ -556,7 +587,7 @@ uint16_t pucchfmt3_OrthSeqRemove( int16_t RemoveFrqDev_fmt3[NB_ANTENNAS_RX][2][5
}
/* averaging antenna */
-uint16_t pucchfmt3_AvgAnt( int16_t Fmt3xDataRmvOrth[NB_ANTENNAS_RX][2][5][12][2],
+uint16_t pucchfmt3_AvgAnt( int16_t Fmt3xDataRmvOrth[4][2][5][12][2],
int16_t Fmt3xDataAvgAnt[2][5][12][2],
uint8_t shortened_format,
LTE_DL_FRAME_PARMS *frame_parms ) {
@@ -856,7 +887,7 @@ uint32_t calc_pucch_1x_interference(PHY_VARS_eNB *eNB,
uint32_t rx_pucch(PHY_VARS_eNB *eNB,
PUCCH_FMT_t fmt,
- uint8_t UE_id,
+ uint8_t UCI_id,
uint16_t n1_pucch,
uint16_t n2_pucch,
uint8_t shortened_format,
@@ -871,15 +902,15 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
static int first_call = 1;
LTE_eNB_COMMON *common_vars = &eNB->common_vars;
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
- int8_t sigma2_dB = eNB->measurements.n0_pucch_dB;
+ int8_t sigma2_dB = /*max(eNB->measurements.n0_subband_power_tot_dB[0], eNB->measurements.n0_subband_power_tot_dB[eNB->frame_parms.N_RB_UL-1]); */eNB->measurements.n0_pucch_dB;
uint32_t u,v,n,aa;
uint32_t z[12*14];
int16_t *zptr;
- int16_t rxcomp[NB_ANTENNAS_RX][2*12*14];
+ int16_t rxcomp[4][2*12*14];
uint8_t ns,N_UL_symb,nsymb,n_oc,n_oc0,n_oc1;
uint8_t c = (frame_parms->Ncp==0) ? 3 : 2;
- uint16_t nprime,nprime0,nprime1;
+ int16_t nprime,nprime0,nprime1;
uint16_t i,j,re_offset,thres,h,off;
uint8_t Nprime_div_deltaPUCCH_Shift,Nprime,d;
uint8_t m,l,refs,phase,re,l2,phase_max=0;
@@ -887,12 +918,12 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
int16_t tmp_re,tmp_im,W_re=0,W_im=0;
int16_t *rxptr;
uint32_t symbol_offset;
- int16_t stat_ref_re,stat_ref_im,*cfo;
- int16_t chest0_re[NB_ANTENNAS_RX][12],chest0_im[NB_ANTENNAS_RX][12];
- int16_t chest1_re[NB_ANTENNAS_RX][12],chest1_im[NB_ANTENNAS_RX][12];
+ int16_t stat0_ref_re[4],stat0_ref_im[4],stat1_ref_re[4],stat1_ref_im[4],*cfo;
+ int16_t chest0_re[4][12],chest0_im[4][12];
+ int16_t chest1_re[4][12],chest1_im[4][12];
int32_t chest_mag;
- int32_t stat_re=0,stat_im=0;
- uint32_t stat,stat_max=0;
+ int32_t stat0_re[4],stat1_re[4],stat0_im[4],stat1_im[4];
+ uint32_t stat0[4],stat1[4],stat_max=0,stat0_max[4],stat1_max[4];
uint8_t log2_maxh;
uint8_t deltaPUCCH_Shift = frame_parms->pucch_config_common.deltaPUCCH_Shift;
uint8_t NRB2 = frame_parms->pucch_config_common.nRB_CQI;
@@ -905,13 +936,13 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
int chL;
/* PUCCH format3 >> */
uint16_t Ret = 0;
- int16_t SubCarrierDeMapData[NB_ANTENNAS_RX][14][12][2]; //[Antenna][Symbol][Subcarrier][Complex]
- int16_t CshData_fmt3[NB_ANTENNAS_RX][14][12][2]; //[Antenna][Symbol][Subcarrier][Complex]
- double delta_theta[NB_ANTENNAS_RX][12]; //[Antenna][Subcarrier][Complex]
- int16_t ChestValue[NB_ANTENNAS_RX][2][12][2]; //[Antenna][Slot][Subcarrier][Complex]
- int16_t ChdetAfterValue_fmt3[NB_ANTENNAS_RX][14][12][2]; //[Antenna][Symbol][Subcarrier][Complex]
- int16_t RemoveFrqDev_fmt3[NB_ANTENNAS_RX][2][5][12][2]; //[Antenna][Slot][PUCCH_Symbol][Subcarrier][Complex]
- int16_t Fmt3xDataRmvOrth[NB_ANTENNAS_RX][2][5][12][2]; //[Antenna][Slot][PUCCH_Symbol][Subcarrier][Complex]
+ int16_t SubCarrierDeMapData[4][14][12][2]; //[Antenna][Symbol][Subcarrier][Complex]
+ int16_t CshData_fmt3[4][14][12][2]; //[Antenna][Symbol][Subcarrier][Complex]
+ double delta_theta[4][12]; //[Antenna][Subcarrier][Complex]
+ int16_t ChestValue[4][2][12][2]; //[Antenna][Slot][Subcarrier][Complex]
+ int16_t ChdetAfterValue_fmt3[4][14][12][2]; //[Antenna][Symbol][Subcarrier][Complex]
+ int16_t RemoveFrqDev_fmt3[4][2][5][12][2]; //[Antenna][Slot][PUCCH_Symbol][Subcarrier][Complex]
+ int16_t Fmt3xDataRmvOrth[4][2][5][12][2]; //[Antenna][Slot][PUCCH_Symbol][Subcarrier][Complex]
int16_t Fmt3xDataAvgAnt[2][5][12][2]; //[Slot][PUCCH_Symbol][Subcarrier][Complex]
int16_t Fmt3xDataAvgSym[2][12][2]; //[Slot][Subcarrier][Complex]
int16_t IFFTOutData_Fmt3[2][12][2]; //[Slot][Subcarrier][Complex]
@@ -941,9 +972,27 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
first_call=0;
}
-
+ eNB_UCI_STATS_t *uci_stats = NULL;
if(fmt!=pucch_format3) { /* PUCCH format3 */
+
+ eNB_UCI_STATS_t *first_uci_stats=NULL;
+ for (int i=0;iuci_stats[i].rnti == eNB->uci_vars[UCI_id].rnti) {
+ uci_stats = &eNB->uci_stats[i];
+ break;
+ } else if (first_uci_stats == NULL && eNB->uci_stats[i].rnti == 0) first_uci_stats = &eNB->uci_stats[i];
+ if (uci_stats == NULL) {
+ if (first_uci_stats == NULL) {
+ LOG_E(PHY,"first_uci_stats is NULL\n");
+ return -1;
+ }
+ uci_stats=first_uci_stats;
+ uci_stats->rnti = eNB->uci_vars[UCI_id].rnti;
+ }
+
+ AssertFatal(uci_stats!=NULL,"No stat index found\n");
+ uci_stats->frame = frame;
// TODO
// "SR+ACK/NACK" length is only 7 bits.
// This restriction will be lifted in the future.
@@ -1149,57 +1198,63 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
// Do cfo correction and MRC across symbols
if (fmt == pucch_format1) {
+ uci_stats->pucch1_trials++;
#ifdef DEBUG_PUCCH_RX
printf("Doing PUCCH detection for format 1\n");
#endif
stat_max = 0;
for (phase=0; phase<7; phase++) {
- stat=0;
-
+ int stat=0;
for (aa=0; aanb_antennas_rx; aa++) {
+ stat0[aa]=0;stat1[aa]=0;
for (re=0; re<12; re++) {
- stat_re=0;
- stat_im=0;
+ stat0_re[aa]=0;
+ stat0_im[aa]=0;
+ stat1_re[aa]=0;
+ stat1_im[aa]=0;
off=re<<1;
cfo = (frame_parms->Ncp==0) ? &cfo_pucch_np[14*phase] : &cfo_pucch_ep[12*phase];
for (l=0; l<(nsymb>>1); l++) {
- stat_re += (((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15))/nsymb;
- stat_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15))/nsymb;
+ stat0_re[aa] += (((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15))/nsymb;
+ stat0_im[aa] += (((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15))/nsymb;
off+=2;
#ifdef DEBUG_PUCCH_RX
printf("[eNB] PUCCH subframe %d (%d,%d,%d) => (%d,%d) x (%d,%d) : (%d,%d) , stat %d\n",subframe,phase,l,re,
rxcomp[aa][off],rxcomp[aa][1+off],
cfo[l<<1],cfo[1+(l<<1)],
- stat_re,stat_im,stat);
+ stat0_re[aa],stat0_im[aa],stat);
#endif
}
for (l2=0,l=(nsymb>>1); l < nsymb; l++,l2++) {
- stat_re += (((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15))/nsymb;
- stat_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15))/nsymb;
+ stat1_re[aa] += (((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15))/nsymb;
+ stat1_im[aa] += (((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15))/nsymb;
off+=2;
#ifdef DEBUG_PUCCH_RX
printf("[eNB] PUCCH subframe %d (%d,%d,%d) => (%d,%d) x (%d,%d) : (%d,%d), stat %d\n",subframe,phase,l2,re,
rxcomp[aa][off],rxcomp[aa][1+off],
cfo[l2<<1],cfo[1+(l2<<1)],
- stat_re,stat_im,stat);
+ stat1_re[aa],stat1_im[aa],stat);
#endif
}
-
- stat += ((stat_re*stat_re) + (stat_im*stat_im));
+
+ stat0[aa] += ((stat0_re[aa]*stat0_re[aa]) + (stat0_im[aa]*stat0_im[aa]));
+ stat1[aa] += ((stat1_re[aa]*stat1_re[aa]) + (stat1_im[aa]*stat1_im[aa]));
} //re
+ stat+=(stat0[aa]+stat1[aa]);
} // aa
-
if (stat>stat_max) {
stat_max = stat;
phase_max = phase;
+ for (aa=0;aanb_antennas_rx;aa++) {
+ stat0_max[aa] = stat0[aa];
+ stat1_max[aa] = stat1[aa];
+ }
}
} //phase
- // stat_max *= nsymb; // normalize to energy per symbol
- // stat_max /= (frame_parms->N_RB_UL*12); //
stat_max /= 12;
#ifdef DEBUG_PUCCH_RX
printf("[eNB] PUCCH: stat %d, stat_max %d, phase_max %d\n", stat,stat_max,phase_max);
@@ -1207,12 +1262,14 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
#ifdef DEBUG_PUCCH_RX
LOG_I(PHY,"[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (%d, %d), phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,eNB->measurements.n0_subband_power_tot_dBm[6],pucch1_thres,phase_max);
#endif
- eNB->pucch1_stats[UE_id][(subframe<<10)+eNB->pucch1_stats_cnt[UE_id][subframe]] = stat_max;
- eNB->pucch1_stats_thres[UE_id][(subframe<<10)+eNB->pucch1_stats_cnt[UE_id][subframe]] = sigma2_dB+pucch1_thres;
- eNB->pucch1_stats_cnt[UE_id][subframe] = (eNB->pucch1_stats_cnt[UE_id][subframe]+1)&1023;
- T(T_ENB_PHY_PUCCH_1_ENERGY, T_INT(eNB->Mod_id), T_INT(eNB->uci_vars[UE_id].rnti), T_INT(frame), T_INT(subframe),
+ eNB->pucch1_stats[UCI_id][(subframe<<10)+eNB->pucch1_stats_cnt[UCI_id][subframe]] = stat_max;
+ eNB->pucch1_stats_thres[UCI_id][(subframe<<10)+eNB->pucch1_stats_cnt[UCI_id][subframe]] = sigma2_dB+pucch1_thres;
+ eNB->pucch1_stats_cnt[UCI_id][subframe] = (eNB->pucch1_stats_cnt[UCI_id][subframe]+1)&1023;
+ uci_stats->pucch1_thres = sigma2_dB+pucch1_thres;
+ T(T_ENB_PHY_PUCCH_1_ENERGY, T_INT(eNB->Mod_id), T_INT(eNB->uci_vars[UCI_id].rnti), T_INT(frame), T_INT(subframe),
T_INT(stat_max), T_INT(sigma2_dB+pucch1_thres));
+
/*
if (eNB->pucch1_stats_cnt[UE_id][subframe] == 0) {
LOG_M("pucch_debug.m","pucch_energy",
@@ -1226,11 +1283,18 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
// This is a moving average of the PUCCH1 statistics conditioned on being above or below the threshold
if (sigma2_dB<(dB_fixed(stat_max)-pucch1_thres)) {
*payload = 1;
+ uci_stats->current_pucch1_stat_pos = stat_max;
+ for (int aa=0;aanb_antennas_rx;aa++) {
+ uci_stats->pucch1_low_stat[aa]=stat0_max[aa];
+ uci_stats->pucch1_high_stat[aa]=stat1_max[aa];
+ uci_stats->pucch1_positive_SR++;
+ }
} else {
+ uci_stats->current_pucch1_stat_neg = stat_max;
*payload = 0;
}
- if (UE_id==0) {
+ if (UCI_id==0) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_ENERGY,dB_fixed(stat_max));
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_THRES,sigma2_dB+pucch1_thres);
}
@@ -1239,29 +1303,30 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
#ifdef DEBUG_PUCCH_RX
LOG_D(PHY,"Doing PUCCH detection for format 1a/1b\n");
#endif
-
+ int stat_re=0,stat_im=0;
for (phase=0; phase<7; phase++) {
- stat=0;
-
+ int stat=0;
for (aa=0; aanb_antennas_rx; aa++) {
+ stat0[aa]=0;
+ stat1[aa]=0;
for (re=0; re<12; re++) {
// compute received energy first slot, seperately for data and reference
// by coherent combining across symbols but not resource elements
// Note: assumption is that channel is stationary over symbols in slot after CFO
- stat_re=0;
- stat_im=0;
- stat_ref_re=0;
- stat_ref_im=0;
+ stat0_re[aa]=0;
+ stat0_im[aa]=0;
+ stat0_ref_re[aa]=0;
+ stat0_ref_im[aa]=0;
off=re<<1;
cfo = (frame_parms->Ncp==0) ? &cfo_pucch_np[14*phase] : &cfo_pucch_ep[12*phase];
for (l=0; l<(nsymb>>1); l++) {
if ((l<2)||(l>(nsymb>>1) - 3)) { //data symbols
- stat_re += ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
- stat_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
+ stat0_re[aa] += ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
+ stat0_im[aa] += ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
} else { //reference symbols
- stat_ref_re += ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
- stat_ref_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
+ stat0_ref_re[aa] += ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
+ stat0_ref_im[aa] += ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
}
off+=2;
@@ -1274,26 +1339,21 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
}
// this is total energy received, summed over data and reference
- if (fmt==pucch_format1a){
- stat += ((((stat_re*stat_re)) + ((stat_ref_re*stat_ref_re)) + ((stat_ref_im*stat_ref_im)))/nsymb);
- }else{
- stat += ((((stat_re*stat_re)) + ((stat_im*stat_im)) +
- ((stat_ref_re*stat_ref_re)) + ((stat_ref_im*stat_ref_im)))/nsymb);
- }
-
+ stat0[aa] += ((((stat0_re[aa]*stat0_re[aa])) + ((stat0_im[aa]*stat0_im[aa])) +
+ ((stat0_ref_re[aa]*stat0_ref_re[aa])) + ((stat0_ref_im[aa]*stat0_ref_im[aa])))/nsymb);
// now second slot
- stat_re=0;
- stat_im=0;
- stat_ref_re=0;
- stat_ref_im=0;
+ stat1_re[aa]=0;
+ stat1_im[aa]=0;
+ stat1_ref_re[aa]=0;
+ stat1_ref_im[aa]=0;
for (l2=0,l=(nsymb>>1); l< nsymb; l++,l2++) {
if ((l2<2) || ((l2>(nsymb>>1) - 3)) ) { // data symbols
- stat_re += ((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15);
- stat_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15);
+ stat1_re[aa] += ((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15);
+ stat1_im[aa] += ((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15);
} else { //reference_symbols
- stat_ref_re += ((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15);
- stat_ref_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15);
+ stat1_ref_re[aa] += ((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15);
+ stat1_ref_im[aa] += ((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15);
}
off+=2;
@@ -1308,20 +1368,16 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
#ifdef DEBUG_PUCCH_RX
printf("aa%d re %d : phase %d : stat %d\n",aa,re,phase,stat);
#endif
- if (fmt==pucch_format1a){
- stat += ((((stat_re*stat_re)) + ((stat_ref_re*stat_ref_re)) + ((stat_ref_im*stat_ref_im)))/nsymb);
- }else{
- stat += ((((stat_re*stat_re)) + ((stat_im*stat_im)) +
- ((stat_ref_re*stat_ref_re)) + ((stat_ref_im*stat_ref_im)))/nsymb);
- }
-
+ stat1[aa] += ((((stat1_re[aa]*stat1_re[aa])) + ((stat1_im[aa]*stat1_im[aa])) +
+ ((stat1_ref_re[aa]*stat1_ref_re[aa])) + ((stat1_ref_im[aa]*stat1_ref_im[aa])))/nsymb);
} //re
+ stat+=(stat0[aa]+stat1[aa]);
} // aa
#ifdef DEBUG_PUCCH_RX
LOG_D(PHY,"Format 1A: phase %d : stat %d\n",phase,stat);
#endif
-
+
if (stat>stat_max) {
stat_max = stat;
phase_max = phase;
@@ -1332,8 +1388,6 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
#ifdef DEBUG_PUCCH_RX
LOG_I(PHY,"[eNB] PUCCH fmt1a/b: stat_max : %d (%d : sigma2 %d), phase_max : %d\n",stat_max,dB_fixed(stat_max),sigma2_dB,phase_max);
#endif
- stat_re=0;
- stat_im=0;
// Do detection now
@@ -1341,13 +1395,12 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
// For instance i assume to skip pucch1_thres from the test below.
// Not 100% sure
- if (sigma2_dB<(dB_fixed(stat_max) - (IS_SOFTMODEM_IQPLAYER?0:pucch1_thres)) ) {//
+ if (sigma2_dB<(dB_fixed(stat_max) - (IS_SOFTMODEM_IQPLAYER?0:pucch1_thres)) ) {//
chL = (nsymb>>1)-4;
chest_mag=0;
cfo = (frame_parms->Ncp==0) ? &cfo_pucch_np[14*phase_max] : &cfo_pucch_ep[12*phase_max];
for (aa=0; aanb_antennas_rx; aa++) {
- // channel estimates first
for (re=0; re<12; re++) {
// channel estimate for first slot
chest0_re[aa][re]=0;
@@ -1381,6 +1434,11 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
// now do channel matched filter
for (aa=0; aanb_antennas_rx; aa++) {
+ stat0_re[aa]=0;
+ stat0_im[aa]=0;
+ stat1_re[aa]=0;
+ stat1_im[aa]=0;
+
for (re=0; re<12; re++) {
#ifdef DEBUG_PUCCH_RX
printf("[eNB] PUCCH subframe %d chest0[%d][%d] => (%d,%d)\n",subframe,aa,re,
@@ -1392,8 +1450,8 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
off=(re<<1) + (24*l);
tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
- stat_re += (((tmp_re*chest0_re[aa][re])>>log2_maxh) + ((tmp_im*chest0_im[aa][re])>>log2_maxh));
- stat_im += (((tmp_re*chest0_im[aa][re])>>log2_maxh) - ((tmp_im*chest0_re[aa][re])>>log2_maxh));
+ stat0_re[aa] += (((tmp_re*chest0_re[aa][re])>>log2_maxh) + ((tmp_im*chest0_im[aa][re])>>log2_maxh));
+ stat0_im[aa] += (((tmp_re*chest0_im[aa][re])>>log2_maxh) - ((tmp_im*chest0_re[aa][re])>>log2_maxh));
off+=2;
#ifdef DEBUG_PUCCH_RX
printf("[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d) => (%d,%d)\n",subframe,l,re,
@@ -1409,8 +1467,8 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
off=(re<<1) + (24*l);
tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
- stat_re += (((tmp_re*chest0_re[aa][re])>>log2_maxh) + ((tmp_im*chest0_im[aa][re])>>log2_maxh));
- stat_im += (((tmp_re*chest0_im[aa][re])>>log2_maxh) - ((tmp_im*chest0_re[aa][re])>>log2_maxh));
+ stat0_re[aa] += (((tmp_re*chest0_re[aa][re])>>log2_maxh) + ((tmp_im*chest0_im[aa][re])>>log2_maxh));
+ stat0_im[aa] += (((tmp_re*chest0_im[aa][re])>>log2_maxh) - ((tmp_im*chest0_re[aa][re])>>log2_maxh));
off+=2;
#ifdef DEBUG_PUCCH_RX
printf("[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d) => (%d,%d)\n",subframe,l,re,
@@ -1431,8 +1489,8 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
off=(re<<1) + (24*l) + (nsymb>>1)*24;
tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
- stat_re += (((tmp_re*chest1_re[aa][re])>>log2_maxh) + ((tmp_im*chest1_im[aa][re])>>log2_maxh));
- stat_im += (((tmp_re*chest1_im[aa][re])>>log2_maxh) - ((tmp_im*chest1_re[aa][re])>>log2_maxh));
+ stat1_re[aa] += (((tmp_re*chest1_re[aa][re])>>log2_maxh) + ((tmp_im*chest1_im[aa][re])>>log2_maxh));
+ stat1_im[aa] += (((tmp_re*chest1_im[aa][re])>>log2_maxh) - ((tmp_im*chest1_re[aa][re])>>log2_maxh));
off+=2;
#ifdef DEBUG_PUCCH_RX
printf("[PHY][eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d) => (%d,%d)\n",subframe,l,re,
@@ -1448,8 +1506,8 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
off=(re<<1) + (24*l) + (nsymb>>1)*24;
tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
- stat_re += (((tmp_re*chest1_re[aa][re])>>log2_maxh) + ((tmp_im*chest1_im[aa][re])>>log2_maxh));
- stat_im += (((tmp_re*chest1_im[aa][re])>>log2_maxh) - ((tmp_im*chest1_re[aa][re])>>log2_maxh));
+ stat1_re[aa] += (((tmp_re*chest1_re[aa][re])>>log2_maxh) + ((tmp_im*chest1_im[aa][re])>>log2_maxh));
+ stat1_im[aa] += (((tmp_re*chest1_im[aa][re])>>log2_maxh) - ((tmp_im*chest1_re[aa][re])>>log2_maxh));
off+=2;
#ifdef DEBUG_PUCCH_RX
printf("[PHY][eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d) => (%d,%d)\n",subframe,l,re,
@@ -1464,29 +1522,42 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
printf("aa%d re %d : stat %d,%d\n",aa,re,stat_re,stat_im);
#endif
} //re
+ stat_re+=stat0_re[aa]+stat1_re[aa];
+ stat_im+=stat0_im[aa]+stat1_im[aa];
} // aa
LOG_D(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im,
- (subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe]));
+ (subframe<<10) + (eNB->pucch1ab_stats_cnt[UCI_id][subframe]));
LOG_D(PHY,"In pucch.c PUCCH 1a/b: ACK subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
- eNB->pucch1ab_stats[UE_id][(subframe<<11) + 2*(eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_re);
- eNB->pucch1ab_stats[UE_id][(subframe<<11) + 1+2*(eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_im);
- eNB->pucch1ab_stats_cnt[UE_id][subframe] = (eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023;
+ eNB->pucch1ab_stats[UCI_id][(subframe<<11) + 2*(eNB->pucch1ab_stats_cnt[UCI_id][subframe])] = (stat_re);
+ eNB->pucch1ab_stats[UCI_id][(subframe<<11) + 1+2*(eNB->pucch1ab_stats_cnt[UCI_id][subframe])] = (stat_im);
+ eNB->pucch1ab_stats_cnt[UCI_id][subframe] = (eNB->pucch1ab_stats_cnt[UCI_id][subframe]+1)&1023;
/* frame not available here - set to -1 for the moment */
- T(T_ENB_PHY_PUCCH_1AB_IQ, T_INT(eNB->Mod_id), T_INT(eNB->uci_vars[UE_id].rnti), T_INT(-1), T_INT(subframe), T_INT(stat_re), T_INT(stat_im));
+ T(T_ENB_PHY_PUCCH_1AB_IQ, T_INT(eNB->Mod_id), T_INT(eNB->uci_vars[UCI_id].rnti), T_INT(-1), T_INT(subframe), T_INT(stat_re), T_INT(stat_im));
*payload = (stat_re<0) ? 1 : 2; // 1 == ACK, 2 == NAK
- if (fmt==pucch_format1b)
+ if (fmt==pucch_format1b) {
+ uci_stats->pucch1b_trials++;
*(1+payload) = (stat_im<0) ? 1 : 2;
+ uci_stats->current_pucch1b_stat_re = stat_re;
+ uci_stats->current_pucch1b_stat_im = stat_im;
+ }
+ else {
+ uci_stats->pucch1a_trials++;
+ uci_stats->current_pucch1a_stat_re = stat_re;
+ uci_stats->current_pucch1a_stat_im = stat_im;
+ }
+
} else { // insufficient energy on PUCCH so NAK
LOG_D(PHY,"In pucch.c PUCCH 1a/b: NAK subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
*payload = 4; // DTX
- ((int16_t *)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[0] = (int16_t)(stat_re);
- ((int16_t *)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[1] = (int16_t)(stat_im);
- eNB->pucch1ab_stats_cnt[UE_id][subframe] = (eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023;
+ ((int16_t *)&eNB->pucch1ab_stats[UCI_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UCI_id][subframe])])[0] = (int16_t)(stat_re);
+ ((int16_t *)&eNB->pucch1ab_stats[UCI_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UCI_id][subframe])])[1] = (int16_t)(stat_im);
+ eNB->pucch1ab_stats_cnt[UCI_id][subframe] = (eNB->pucch1ab_stats_cnt[UCI_id][subframe]+1)&1023;
if (fmt==pucch_format1b)
*(1+payload) = 4;
+ uci_stats->pucch1ab_DTX++;
}
} else {
LOG_E(PHY,"[eNB] PUCCH fmt2/2a/2b not supported\n");
diff --git a/openair1/PHY/LTE_TRANSPORT/pucch_common.c b/openair1/PHY/LTE_TRANSPORT/pucch_common.c
index 5b939b08d2..d7a500d5f7 100644
--- a/openair1/PHY/LTE_TRANSPORT/pucch_common.c
+++ b/openair1/PHY/LTE_TRANSPORT/pucch_common.c
@@ -31,7 +31,6 @@
*/
#include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
-#include "LAYER2/MAC/mac.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "common/utils/LOG/log.h"
diff --git a/openair1/PHY/LTE_TRANSPORT/transport_common.h b/openair1/PHY/LTE_TRANSPORT/transport_common.h
index fbdac0e7fb..135f3cdf4b 100644
--- a/openair1/PHY/LTE_TRANSPORT/transport_common.h
+++ b/openair1/PHY/LTE_TRANSPORT/transport_common.h
@@ -35,9 +35,9 @@
#include "dci.h"
#include "mdci.h"
//#include "uci.h"
-#ifndef STANDALONE_COMPILE
- #include "UTIL/LISTS/list.h"
-#endif
+//#ifndef STANDALONE_COMPILE
+// #include "UTIL/LISTS/list.h"
+//#endif
#define MOD_TABLE_QPSK_OFFSET 1
#define MOD_TABLE_16QAM_OFFSET 5
@@ -57,7 +57,7 @@
// maximum of 3 segments before each coding block if data length exceeds 6144 bits.
-#define MAX_NUM_DLSCH_SEGMENTS 16
+#define MAX_NUM_DLSCH_SEGMENTS 13
#define MAX_NUM_ULSCH_SEGMENTS MAX_NUM_DLSCH_SEGMENTS
#define MAX_DLSCH_PAYLOAD_BYTES (MAX_NUM_DLSCH_SEGMENTS*768)
#define MAX_ULSCH_PAYLOAD_BYTES (MAX_NUM_ULSCH_SEGMENTS*768)
@@ -77,7 +77,8 @@
#define PMI_2A_R1_1j 2
typedef enum { SEARCH_EXIST=0,
- SEARCH_EXIST_OR_FREE
+ SEARCH_EXIST_OR_FREE,
+ SEARCH_EXIST_RA
} find_type_t;
typedef enum {
diff --git a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h
index 1944f06fab..622f37b3bc 100644
--- a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h
+++ b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h
@@ -223,7 +223,9 @@ uint8_t get_num_prach_tdd(module_id_t Mod_id);
@param frame_type 0-FDD, 1-TDD
@returns 0-1 accordingly
*/
+/*
uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,lte_frame_type_t frame_type);
+*/
/*!
\brief Helper for MAC, returns frequency index of PRACH resource in TDD for a particular configuration index
@@ -306,12 +308,12 @@ void init_scrambling_lut(void);
void init_unscrambling_lut(void);
-
+/*
uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t prach_ConfigIndex,
uint8_t n_ra_prboffset,
uint8_t tdd_mapindex, uint16_t Nf);
-
+*/
uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,frame_t frame,uint8_t subframe);
uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n);
@@ -319,6 +321,6 @@ uint32_t conv_1C_RIV(int32_t rballoc,uint32_t N_RB_DL);
void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t *rb_alloc2);
-int16_t estimate_ue_tx_power(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs);
+int16_t estimate_ue_tx_power(int norm,uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs);
#endif
diff --git a/openair1/PHY/LTE_TRANSPORT/transport_eNB.h b/openair1/PHY/LTE_TRANSPORT/transport_eNB.h
index 5e446db5fd..b3985e973a 100644
--- a/openair1/PHY/LTE_TRANSPORT/transport_eNB.h
+++ b/openair1/PHY/LTE_TRANSPORT/transport_eNB.h
@@ -36,9 +36,9 @@
#include "dci.h"
#include "mdci.h"
#include "uci_common.h"
-#ifndef STANDALONE_COMPILE
- #include "UTIL/LISTS/list.h"
-#endif
+//#ifndef STANDALONE_COMPILE
+// #include "UTIL/LISTS/list.h"
+//#endif
// structures below implement 36-211 and 36-212
diff --git a/openair1/PHY/LTE_TRANSPORT/transport_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_proto.h
index 9e37821b05..19af50056c 100644
--- a/openair1/PHY/LTE_TRANSPORT/transport_proto.h
+++ b/openair1/PHY/LTE_TRANSPORT/transport_proto.h
@@ -520,6 +520,9 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *PHY_vars_eNB,
void dump_ulsch(PHY_VARS_eNB *phy_vars_eNB,int frame, int subframe, uint8_t UE_id,int round);
+void dump_ulsch_stats(FILE *fd,PHY_VARS_eNB *eNB,int frame);
+void dump_uci_stats(FILE *fd,PHY_VARS_eNB *eNB,int frame);
+
@@ -691,13 +694,11 @@ void conv_eMTC_rballoc(uint16_t resource_block_coding,
uint32_t N_RB_DL,
uint32_t *rb_alloc);
-int16_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type);
+int find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type);
-int16_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type);
+int find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type);
-int16_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type);
-
-uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,lte_frame_type_t frame_type);
+int find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type);
uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset);
diff --git a/openair1/PHY/LTE_TRANSPORT/uci_tools.c b/openair1/PHY/LTE_TRANSPORT/uci_tools.c
index f8ade9afc8..ae039bec2a 100644
--- a/openair1/PHY/LTE_TRANSPORT/uci_tools.c
+++ b/openair1/PHY/LTE_TRANSPORT/uci_tools.c
@@ -37,12 +37,11 @@
//#define DEBUG_UCI 1
-int16_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type) {
- uint16_t i;
- int16_t first_free_index=-1;
+int find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type) {
+ int first_free_index=-1;
AssertFatal(eNB!=NULL,"eNB is null\n");
- for (i=0; iuci_vars[i].active >0) &&
(eNB->uci_vars[i].rnti==rnti) &&
(eNB->uci_vars[i].frame==frame) &&
diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
index 476d7028b1..ae8c666d18 100644
--- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
+++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
@@ -468,6 +468,35 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
ulsch_harq->Nsymb_pusch,
nb_rb);
//#endif
+
+ eNB_SCH_STATS_t *stats=NULL;
+ int first_free=-1;
+ for (int i=0;iulsch_stats[i].rnti == 0 && first_free == -1) {
+ first_free = i;
+ stats=&eNB->ulsch_stats[i];
+ }
+ if (eNB->ulsch_stats[i].rnti == ulsch->rnti) {
+ stats=&eNB->ulsch_stats[i];
+ break;
+ }
+ }
+ if (stats) {
+ stats->rnti = ulsch->rnti;
+ stats->round_trials[ulsch_harq->round]++;
+ stats->frame=proc->frame_rx;
+ }
+ if (ulsch_harq->round == 0) {
+ if (stats) {
+ stats->current_Qm = Q_m;
+ stats->current_RI = 1;
+ stats->total_bytes_tx += ulsch_harq->TBS;
+ stats->current_TBS = ulsch_harq->TBS;
+ stats->current_G = ulsch_harq->G;
+ }
+ }
+
+
//if (ulsch_harq->round == 0) { // delete for RB shortage pattern
// This is a new packet, so compute quantities regarding segmentation
ulsch_harq->B = A+24;
@@ -1086,3 +1115,44 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
ret = ulsch_decoding_data_all(eNB,proc, UE_id,harq_pid,llr8_flag);
return(ret);
}
+
+#define STATSTRLEN 16384
+void dump_ulsch_stats(FILE *fd,PHY_VARS_eNB *eNB,int frame) {
+
+ char output[16384];
+ int stroff=0;
+ for (int i=0;iulsch_stats[i].rnti>0 && eNB->ulsch_stats[i].round_trials[0]>100) {
+ for (int aa=0;aaframe_parms.nb_antennas_rx;aa++)
+ stroff+=sprintf(output+stroff,"ULSCH RNTI %x: ulsch_power[%d] %d, ulsch_noise_power[%d] %d\n",
+ eNB->ulsch_stats[i].rnti, aa,eNB->ulsch_stats[i].ulsch_power[aa],aa,eNB->ulsch_stats[i].ulsch_noise_power[aa]);
+ AssertFatal(stroff<(STATSTRLEN-1000),"Increase STATSTRLEN\n");
+ stroff+=sprintf(output+stroff,"ULSCH RNTI %x: round_trials %d(%1.1e):%d(%1.1e):%d(%1.1e):%d\n",
+ eNB->ulsch_stats[i].rnti,
+ eNB->ulsch_stats[i].round_trials[0],
+ (double)eNB->ulsch_stats[i].round_trials[1]/eNB->ulsch_stats[i].round_trials[0],
+ eNB->ulsch_stats[i].round_trials[1],
+ (double)eNB->ulsch_stats[i].round_trials[2]/eNB->ulsch_stats[i].round_trials[0],
+ eNB->ulsch_stats[i].round_trials[2],
+ (double)eNB->ulsch_stats[i].round_trials[3]/eNB->ulsch_stats[i].round_trials[0],
+ eNB->ulsch_stats[i].round_trials[3]);
+ stroff+=sprintf(output+stroff,"ULSCH RNTI %x: current_Qm %d, current_G %d, current_TBS %d, current_rate %f,current_RI %d, timing_offset %d, total_bytes RX/SCHED %d/%d\n",
+ eNB->ulsch_stats[i].rnti,
+ eNB->ulsch_stats[i].current_Qm,
+ eNB->ulsch_stats[i].current_G,
+ eNB->ulsch_stats[i].current_TBS,
+ (double)eNB->ulsch_stats[i].current_G/eNB->ulsch_stats[i].current_TBS,
+ eNB->ulsch_stats[i].current_RI,
+ eNB->ulsch_stats[i].timing_offset,
+ eNB->ulsch_stats[i].total_bytes_rx,
+ eNB->ulsch_stats[i].total_bytes_tx);
+ }
+ fprintf(fd,"%s",output);
+}
+
+void clear_ulsch_stats(PHY_VARS_eNB *eNB) {
+
+ for (int i=0;iulsch_stats[i],0,sizeof(eNB->ulsch_stats[i]));
+}
+
diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
index eeab616097..3529df8e44 100644
--- a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
+++ b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
@@ -31,12 +31,12 @@
*/
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
+//#include "PHY/phy_extern.h"
#include "transport_eNB.h"
#include "PHY/sse_intrin.h"
#include "transport_common_proto.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
-#include "PHY/MODULATION/modulation_eNB.h"
+//#include "PHY/MODULATION/modulation_eNB.h"
#include "T.h"
@@ -45,8 +45,11 @@
//extern int **ulchmag_eren;
//eren
-static short jitter[8] __attribute__ ((aligned(16))) = {1,0,0,1,0,1,1,0};
-static short jitterc[8] __attribute__ ((aligned(16))) = {0,1,1,0,1,0,0,1};
+static const short jitter[8] __attribute__ ((aligned(16))) = {1,0,0,1,0,1,1,0};
+static const short jitterc[8] __attribute__ ((aligned(16))) = {0,1,1,0,1,0,0,1};
+static const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
+static const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
+
void lte_idft(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *z, uint16_t Msc_PUSCH) {
#if defined(__x86_64__) || defined(__i386__)
@@ -511,7 +514,6 @@ void ulsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
for (i=0; i<(nb_rb*3); i++) {
#if defined(__x86_64__) || defined(__i386__)
mmtmpU0 = _mm_abs_epi16(rxF[i]);
- // print_shorts("tmp0",&tmp0);
mmtmpU0 = _mm_subs_epi16(ch_mag[i],mmtmpU0);
(*llrp128)[0] = _mm_unpacklo_epi32(rxF[i],mmtmpU0);
(*llrp128)[1] = _mm_unpackhi_epi32(rxF[i],mmtmpU0);
@@ -627,11 +629,15 @@ void ulsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t symbol,
uint16_t nb_rb) {
#if defined(__x86_64__) || defined(__i386__)
- __m128i *rxdataF_comp128_0,*ul_ch_mag128_0,*ul_ch_mag128_0b;
- __m128i *rxdataF_comp128_1,*ul_ch_mag128_1,*ul_ch_mag128_1b;
+ __m128i *rxdataF_comp128_0=NULL,*ul_ch_mag128_0=NULL,*ul_ch_mag128_0b=NULL;
+ __m128i *rxdataF_comp128_1=NULL,*ul_ch_mag128_1=NULL,*ul_ch_mag128_1b=NULL;
+ __m128i *rxdataF_comp128_2=NULL,*ul_ch_mag128_2=NULL,*ul_ch_mag128_2b=NULL;
+ __m128i *rxdataF_comp128_3=NULL,*ul_ch_mag128_3=NULL,*ul_ch_mag128_3b=NULL;
#elif defined(__arm__)
int16x8_t *rxdataF_comp128_0,*ul_ch_mag128_0,*ul_ch_mag128_0b;
int16x8_t *rxdataF_comp128_1,*ul_ch_mag128_1,*ul_ch_mag128_1b;
+ int16x8_t *rxdataF_comp128_2,*ul_ch_mag128_2,*ul_ch_mag128_2b;
+ int16x8_t *rxdataF_comp128_3,*ul_ch_mag128_3,*ul_ch_mag128_3b;
#endif
int32_t i;
@@ -643,15 +649,39 @@ void ulsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
ul_ch_mag128_1 = (__m128i *)&ul_ch_mag[1][symbol*frame_parms->N_RB_DL*12];
ul_ch_mag128_0b = (__m128i *)&ul_ch_magb[0][symbol*frame_parms->N_RB_DL*12];
ul_ch_mag128_1b = (__m128i *)&ul_ch_magb[1][symbol*frame_parms->N_RB_DL*12];
-
- // MRC on each re of rb, both on MF output and magnitude (for 16QAM/64QAM llr computation)
- for (i=0; inb_antennas_rx>2) {
+ rxdataF_comp128_2 = (__m128i *)&rxdataF_comp[2][symbol*frame_parms->N_RB_DL*12];
+ ul_ch_mag128_2 = (__m128i *)&ul_ch_mag[2][symbol*frame_parms->N_RB_DL*12];
+ ul_ch_mag128_2b = (__m128i *)&ul_ch_magb[2][symbol*frame_parms->N_RB_DL*12];
+ }
+ if (frame_parms->nb_antennas_rx>3) {
+ rxdataF_comp128_3 = (__m128i *)&rxdataF_comp[3][symbol*frame_parms->N_RB_DL*12];
+ ul_ch_mag128_3 = (__m128i *)&ul_ch_mag[3][symbol*frame_parms->N_RB_DL*12];
+ ul_ch_mag128_3b = (__m128i *)&ul_ch_magb[3][symbol*frame_parms->N_RB_DL*12];
}
+ // MRC on each re of rb, both on MF output and magnitude (for 16QAM/64QAM llr computation)
+ if (frame_parms->nb_antennas_rx==2)
+ for (i=0; inb_antennas_rx==3)
+ for (i=0; inb_antennas_rx==4)
+ for (i=0; iN_RB_DL*12];
rxdataF_comp128_1 = (int16x8_t *)&rxdataF_comp[1][symbol*frame_parms->N_RB_DL*12];
@@ -795,7 +825,7 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
mmtmpU0 = _mm_srai_epi32(mmtmpU0,output_shift);
mmtmpU1 = _mm_packs_epi32(mmtmpU0,mmtmpU0);
ul_ch_mag128[2] = _mm_unpacklo_epi16(mmtmpU1,mmtmpU1);
- LOG_D(PHY,"comp: symbol %d rb %d => %d,%d,%d (output_shift %d)\n",symbol,rb,*((int16_t *)&ul_ch_mag128[0]),*((int16_t *)&ul_ch_mag128[1]),*((int16_t *)&ul_ch_mag128[2]),output_shift);
+ //LOG_I(PHY,"comp: ant %d symbol %d rb %d => %d,%d,%d (output_shift %d)\n",aarx,symbol,rb,*((int16_t *)&ul_ch_mag128[0]),*((int16_t *)&ul_ch_mag128[1]),*((int16_t *)&ul_ch_mag128[2]),output_shift);
#elif defined(__arm__)
mmtmpU0 = vmull_s16(ul_ch128[0], ul_ch128[0]);
mmtmpU0 = vqshlq_s32(vqaddq_s32(mmtmpU0,vrev64q_s32(mmtmpU0)),-output_shift128);
@@ -834,6 +864,7 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
// print_ints("c1",&mmtmpU3);
rxdataF_comp128[0] = _mm_packs_epi32(mmtmpU2,mmtmpU3);
/*
+ LOG_I(PHY,"Antenna %d:",aarx);
print_shorts("rx:",&rxdataF128[0]);
print_shorts("ch:",&ul_ch128[0]);
print_shorts("pack:",&rxdataF_comp128[0]);
@@ -851,9 +882,12 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
mmtmpU2 = _mm_unpacklo_epi32(mmtmpU0,mmtmpU1);
mmtmpU3 = _mm_unpackhi_epi32(mmtmpU0,mmtmpU1);
rxdataF_comp128[1] = _mm_packs_epi32(mmtmpU2,mmtmpU3);
- // print_shorts("rx:",rxdataF128[1]);
- // print_shorts("ch:",ul_ch128[1]);
- // print_shorts("pack:",rxdataF_comp128[1]);
+ /*
+ LOG_I(PHY,"Antenna %d:",aarx);
+ print_shorts("rx:",&rxdataF128[1]);
+ print_shorts("ch:",&ul_ch128[1]);
+ print_shorts("pack:",&rxdataF_comp128[1]);
+ */
// multiply by conjugated channel
mmtmpU0 = _mm_madd_epi16(ul_ch128[2],rxdataF128[2]);
// mmtmpU0 contains real part of 4 consecutive outputs (32-bit)
@@ -867,9 +901,12 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
mmtmpU2 = _mm_unpacklo_epi32(mmtmpU0,mmtmpU1);
mmtmpU3 = _mm_unpackhi_epi32(mmtmpU0,mmtmpU1);
rxdataF_comp128[2] = _mm_packs_epi32(mmtmpU2,mmtmpU3);
- // print_shorts("rx:",rxdataF128[2]);
- // print_shorts("ch:",ul_ch128[2]);
- // print_shorts("pack:",rxdataF_comp128[2]);
+ /*
+ LOG_I(PHY,"Antenna %d:",aarx);
+ print_shorts("rx:",&rxdataF128[2]);
+ print_shorts("ch:",&ul_ch128[2]);
+ print_shorts("pack:",&rxdataF_comp128[2]);
+ */
// Add a jitter to compensate for the saturation in "packs" resulting in a bias on the DC after IDFT
rxdataF_comp128[0] = _mm_add_epi16(rxdataF_comp128[0],(*(__m128i *)&jitter[0]));
rxdataF_comp128[1] = _mm_add_epi16(rxdataF_comp128[1],(*(__m128i *)&jitter[0]));
@@ -1078,6 +1115,15 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
}
for (i=0; inb_antennas_rx; i++) {
+ pusch_vars->ulsch_power[i] = signal_energy_nodc(pusch_vars->drs_ch_estimates[i],
+ ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12)/correction_factor;
+ LOG_D(PHY,"%4.4d.%d power harq_pid %d rb %2.2d TBS %2.2d (MPR_times_Ks %d correction %d) power %d dBtimes10\n", proc->frame_rx, proc->subframe_rx, harq_pid,
+ ulsch[UE_id]->harq_processes[harq_pid]->nb_rb, ulsch[UE_id]->harq_processes[harq_pid]->TBS,MPR_times_100Ks,correction_factor,dB_fixed_x10(pusch_vars->ulsch_power[i]));
+ pusch_vars->ulsch_noise_power[i]=0;
+ for (int rb=0;rbharq_processes[harq_pid]->nb_rb;rb++)
+ pusch_vars->ulsch_noise_power[i]+=eNB->measurements.n0_subband_power[i][rb]/ulsch[UE_id]->harq_processes[harq_pid]->nb_rb;
+ LOG_D(PHY,"noise power[%d] %d\n",i,dB_fixed_x10(pusch_vars->ulsch_noise_power[i]));
+/* Check this modification w.r.t to new PUSCH modifications
//symbol 3
int symbol_offset = frame_parms->N_RB_UL*12*(3 - frame_parms->Ncp);
pusch_vars->ulsch_interference_power[i] = interference_power(&pusch_vars->drs_ch_estimates[i][symbol_offset],ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12);
@@ -1100,7 +1146,7 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
}
LOG_D(PHY,"%4.4d.%d power harq_pid %d rb %2.2d TBS %2.2d (MPR_times_Ks %d correction %d) power %d dBtimes10\n", proc->frame_rx, proc->subframe_rx, harq_pid, ulsch[UE_id]->harq_processes[harq_pid]->nb_rb, ulsch[UE_id]->harq_processes[harq_pid]->TBS,MPR_times_100Ks,correction_factor,dB_fixed_x10(pusch_vars->ulsch_power[i]));
-
+ */
}
ulsch_channel_level(pusch_vars->drs_ch_estimates,
@@ -1113,8 +1159,7 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
for (aarx=0; aarxnb_antennas_rx; aarx++)
avgs = cmax(avgs,avgU[aarx]);
- // log2_maxh = 4+(log2_approx(avgs)/2);
- log2_maxh = (log2_approx(avgs)/2)+ log2_approx(frame_parms->nb_antennas_rx-1)+4;
+ log2_maxh = 4+(log2_approx(avgs)/2);
LOG_D(PHY,"[ULSCH] log2_maxh = %d (%d,%d)\n",log2_maxh,avgU[0],avgs);
for (l=0; l<(frame_parms->symbols_per_tti-ulsch[UE_id]->harq_processes[harq_pid]->srs_active); l++) {
@@ -1221,67 +1266,56 @@ void dump_ulsch(PHY_VARS_eNB *eNB,int frame,int subframe,uint8_t UE_id,int round
uint8_t harq_pid;
char fname[100],vname[100];
harq_pid = subframe2harq_pid(&eNB->frame_parms,frame,subframe);
- LOG_UI(PHY,"Dumping ULSCH in subframe %d with harq_pid %d, round %d for NB_rb %d, TBS %d, Qm %d, N_symb %d\n",
+ LOG_UI(PHY,"Dumping ULSCH in subframe %d with harq_pid %d, round %d for NB_rb %d, first_rb %d, TBS %d, Qm %d, N_symb %d\n",
subframe,harq_pid,round,eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,
+ eNB->ulsch[UE_id]->harq_processes[harq_pid]->first_rb,
eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS,eNB->ulsch[UE_id]->harq_processes[harq_pid]->Qm,
eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch);
+ for (int aa=0;aaframe_parms.nb_antennas_rx;aa++)
+ LOG_UI(PHY,"ulsch_power[%d] %d, ulsch_noise_power[%d] %d\n",aa,dB_fixed_x10(eNB->pusch_vars[UE_id]->ulsch_power[aa]),aa,dB_fixed_x10(eNB->pusch_vars[UE_id]->ulsch_noise_power[aa]));
sprintf(fname,"/tmp/ulsch_r%d_d",round);
sprintf(vname,"/tmp/ulsch_r%d_dseq",round);
LOG_UM(fname,vname,&eNB->ulsch[UE_id]->harq_processes[harq_pid]->d[0][96],
eNB->ulsch[UE_id]->harq_processes[harq_pid]->Kplus*3,1,0);
if (eNB->common_vars.rxdata) {
- sprintf(fname,"/tmp/rxsig0_r%d.m",round);
- sprintf(vname,"rxs0_r%d",round);
- LOG_UM(fname,vname, &eNB->common_vars.rxdata[0][0],eNB->frame_parms.samples_per_tti*10,1,1);
+ for (int aarx=0;aarxframe_parms.nb_antennas_rx;aarx++) {
+ sprintf(fname,"/tmp/rxsig%d_r%d.m",aarx,round);
+ sprintf(vname,"rxs%d_r%d",aarx,round);
+ LOG_UM(fname,vname, &eNB->common_vars.rxdata[aarx][0],eNB->frame_parms.samples_per_tti*10,1,1);
- if (eNB->frame_parms.nb_antennas_rx>1)
- if (eNB->common_vars.rxdata) {
- sprintf(fname,"/tmp/rxsig1_r%d.m",round);
- sprintf(vname,"rxs1_r%d",round);
- LOG_UM(fname,vname, &eNB->common_vars.rxdata[1][0],eNB->frame_parms.samples_per_tti*10,1,1);
- }
+ }
}
-
- sprintf(fname,"/tmp/rxsigF0_r%d.m",round);
- sprintf(vname,"rxsF0_r%d",round);
- LOG_UM(fname,vname, (void *)&eNB->common_vars.rxdataF[0][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
-
- if (eNB->frame_parms.nb_antennas_rx>1) {
- sprintf(fname,"/tmp/rxsigF1_r%d.m",round);
- sprintf(vname,"rxsF1_r%d",round);
- LOG_UM(vname,fname, &eNB->common_vars.rxdataF[1][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
+ if (eNB->common_vars.rxdataF) {
+ for (int aarx=0;aarxframe_parms.nb_antennas_rx;aarx++) {
+ sprintf(fname,"/tmp/rxsigF%d_r%d.m",aarx,round);
+ sprintf(vname,"rxsF%d_r%d",aarx,round);
+ LOG_UM(fname,vname, (void *)&eNB->common_vars.rxdataF[aarx][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
+ }
}
-
- sprintf(fname,"/tmp/rxsigF0_ext_r%d.m",round);
- sprintf(vname,"rxsF0_ext_r%d",round);
- LOG_UM(fname,vname, &eNB->pusch_vars[UE_id]->rxdataF_ext[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
-
- if (eNB->frame_parms.nb_antennas_rx>1) {
- sprintf(fname,"/tmp/rxsigF1_ext_r%d.m",round);
- sprintf(vname,"rxsF1_ext_r%d",round);
- LOG_UM(fname,vname,&eNB->pusch_vars[UE_id]->rxdataF_ext[1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
+ if (eNB->pusch_vars[UE_id]->rxdataF_ext) {
+ for (int aarx=0;aarxframe_parms.nb_antennas_rx;aarx++) {
+ sprintf(fname,"/tmp/rxsigF%d_ext_r%d.m",aarx,round);
+ sprintf(vname,"rxsF%d_ext_r%d",aarx,round);
+ LOG_UM(fname,vname, &eNB->pusch_vars[UE_id]->rxdataF_ext[aarx][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
+ }
}
-
/*
if (eNB->srs_vars[UE_id].srs_ch_estimates) LOG_UM("/tmp/srs_est0.m","srsest0",eNB->srs_vars[UE_id].srs_ch_estimates[0],eNB->frame_parms.ofdm_symbol_size,1,1);
if (eNB->frame_parms.nb_antennas_rx>1)
if (eNB->srs_vars[UE_id].srs_ch_estimates) LOG_UM("/tmp/srs_est1.m","srsest1",eNB->srs_vars[UE_id].srs_ch_estimates[1],eNB->frame_parms.ofdm_symbol_size,1,1);
*/
- sprintf(fname,"/tmp/drs_est0_r%d.m",round);
- sprintf(vname,"drsest0_r%d",round);
- LOG_UM(fname,vname,eNB->pusch_vars[UE_id]->drs_ch_estimates[0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
+ for (int aarx=0;aarxframe_parms.nb_antennas_rx;aarx++) {
+ sprintf(fname,"/tmp/drs_est%d_r%d.m",aarx,round);
+ sprintf(vname,"drsest%d_r%d",aarx,round);
+ LOG_UM(fname,vname,eNB->pusch_vars[UE_id]->drs_ch_estimates[aarx],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
- if (eNB->frame_parms.nb_antennas_rx>1) {
- sprintf(fname,"/tmp/drs_est1_r%d.m",round);
- sprintf(vname,"drsest1_r%d",round);
- LOG_UM(fname,vname,eNB->pusch_vars[UE_id]->drs_ch_estimates[1],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
+ sprintf(fname,"/tmp/ulsch%d_rxF_comp0_r%d.m",aarx,round);
+ sprintf(vname,"ulsch_rxF%d_comp0_r%d",aarx,round);
+ LOG_UM(fname,vname,&eNB->pusch_vars[UE_id]->rxdataF_comp[aarx][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
}
- sprintf(fname,"/tmp/ulsch0_rxF_comp0_r%d.m",round);
- sprintf(vname,"ulsch0_rxF_comp0_r%d",round);
- LOG_UM(fname,vname,&eNB->pusch_vars[UE_id]->rxdataF_comp[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
// LOG_M("ulsch_rxF_comp1.m","ulsch0_rxF_comp1",&eNB->pusch_vars[UE_id]->rxdataF_comp[0][1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
sprintf(fname,"/tmp/ulsch_rxF_llr_r%d.m",round);
sprintf(vname,"ulsch_llr_r%d",round);
diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c
index 7442a0ae7e..39900113b7 100644
--- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c
+++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c
@@ -78,7 +78,7 @@ LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_
switch (N_RB_DL) {
case 6:
- bw_scaling =16;
+ bw_scaling =4;
break;
case 25:
@@ -276,7 +276,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
switch (frame_parms->N_RB_DL) {
case 6:
- bw_scaling =16;
+ bw_scaling =4;
break;
case 25:
diff --git a/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c
index ab7c2b9091..929f63e9fc 100644
--- a/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c
+++ b/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c
@@ -41,6 +41,7 @@
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "../LTE_TRANSPORT/prach_extern.h"
+#include "common/utils/lte/prach_utils.h"
//#define PRACH_DEBUG 1
@@ -115,7 +116,9 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
NCS = NCS_restricted[Ncs_config];
}
- n_ra_prb = get_prach_prb_offset(&(ue->frame_parms),
+ n_ra_prb = get_prach_prb_offset(ue->frame_parms.frame_type,
+ ue->frame_parms.tdd_config,
+ ue->frame_parms.N_RB_UL,
ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset,
tdd_mapindex, Nf);
diff --git a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h
index 3299401443..7ab795cae9 100644
--- a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h
+++ b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h
@@ -1740,10 +1740,5 @@ double computeRhoB_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
LTE_UE_DLSCH_t *dlsch_ue);
*/
-uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms,
- uint8_t prach_ConfigIndex,
- uint8_t n_ra_prboffset,
- uint8_t tdd_mapindex, uint16_t Nf);
-
/**@}*/
#endif
diff --git a/openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h b/openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h
index 4c433a5683..6b84a5f969 100644
--- a/openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h
+++ b/openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h
@@ -36,9 +36,11 @@
#include "../LTE_TRANSPORT/mdci.h"
#include "../LTE_TRANSPORT/uci_common.h"
#include "../LTE_TRANSPORT/transport_common.h"
+/*
#ifndef STANDALONE_COMPILE
#include "UTIL/LISTS/list.h"
#endif
+*/
#include "../LTE_TRANSPORT/transport_common.h"
diff --git a/openair1/PHY/MODULATION/beamforming.c b/openair1/PHY/MODULATION/beamforming.c
index 4405c46abf..d592aa466e 100644
--- a/openair1/PHY/MODULATION/beamforming.c
+++ b/openair1/PHY/MODULATION/beamforming.c
@@ -44,7 +44,6 @@
#include "PHY/defs_common.h"
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
#include "PHY/CODING/coding_defs.h"
#include "PHY/CODING/coding_extern.h"
#include "PHY/CODING/lte_interleaver_inline.h"
diff --git a/openair1/PHY/MODULATION/slot_fep_ul.c b/openair1/PHY/MODULATION/slot_fep_ul.c
index 746f8dbc0e..ccb7ee5f3e 100644
--- a/openair1/PHY/MODULATION/slot_fep_ul.c
+++ b/openair1/PHY/MODULATION/slot_fep_ul.c
@@ -20,8 +20,8 @@
*/
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
-#include "modulation_eNB.h"
+//#include "PHY/phy_extern.h"
+//#include "modulation_eNB.h"
//#define DEBUG_FEP
diff --git a/openair1/PHY/MODULATION/ul_7_5_kHz.c b/openair1/PHY/MODULATION/ul_7_5_kHz.c
index a5b428a813..384b9d621c 100644
--- a/openair1/PHY/MODULATION/ul_7_5_kHz.c
+++ b/openair1/PHY/MODULATION/ul_7_5_kHz.c
@@ -20,7 +20,6 @@
*/
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
#include
#include "PHY/sse_intrin.h"
#include "modulation_extern.h"
diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h b/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h
index 7ecaa97f6a..89bb5b2807 100644
--- a/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h
+++ b/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h
@@ -47,6 +47,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
unsigned short bwp_start_subcarrier,
nfapi_nr_pusch_pdu_t *pusch_pdu);
+void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB);
+
void gNB_I0_measurements(PHY_VARS_gNB *gNB,int first_symb,int num_symb);
void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq_pid, unsigned char symbol);
diff --git a/openair1/PHY/NR_REFSIG/nr_dmrs_rx.c b/openair1/PHY/NR_REFSIG/nr_dmrs_rx.c
index 5a4b1adbb8..920b78eac2 100644
--- a/openair1/PHY/NR_REFSIG/nr_dmrs_rx.c
+++ b/openair1/PHY/NR_REFSIG/nr_dmrs_rx.c
@@ -111,9 +111,10 @@ int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue,
int32_t *output,
unsigned short p,
unsigned char lp,
- unsigned short nb_pdsch_rb)
+ unsigned short nb_pdsch_rb,
+ uint8_t config_type)
{
- int8_t w,config_type;
+ int8_t w;
short *mod_table;
unsigned char idx=0;
@@ -121,18 +122,16 @@ int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue,
array_of_w *wf;
array_of_w *wt;
- config_type = ue->dmrs_DownlinkConfig.pdsch_dmrs_type;
-
- wf = (config_type==pdsch_dmrs_type1) ? wf1 : wf2;
- wt = (config_type==pdsch_dmrs_type1) ? wt1 : wt2;
+ wf = (config_type==NFAPI_NR_DMRS_TYPE1) ? wf1 : wf2;
+ wt = (config_type==NFAPI_NR_DMRS_TYPE1) ? wt1 : wt2;
if (config_type > 1)
LOG_E(PHY,"Bad PDSCH DMRS config type %d\n", config_type);
- if ((p>=1000) && (p<((config_type==pdsch_dmrs_type1) ? 1008 : 1012))) {
+ if ((p>=1000) && (p<((config_type==NFAPI_NR_DMRS_TYPE1) ? 1008 : 1012))) {
if (ue->frame_parms.Ncp == NORMAL) {
- for (int i=0; i>1] __attribute__((aligned(16))); // 3 for the max coreset duration
uint16_t cset_start_sc;
@@ -85,7 +85,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
// compute rb_offset and n_prb based on frequency allocation
nr_fill_cce_list(gNB,0,pdcch_pdu_rel15);
get_coreset_rballoc(pdcch_pdu_rel15->FreqDomainResource,&n_rb,&rb_offset);
- cset_start_sc = frame_parms.first_carrier_offset + (pdcch_pdu_rel15->BWPStart + rb_offset) * NR_NB_SC_PER_RB;
+ cset_start_sc = frame_parms->first_carrier_offset + (pdcch_pdu_rel15->BWPStart + rb_offset) * NR_NB_SC_PER_RB;
for (int d=0;dnumDlDci;d++) {
/*The coreset is initialised
@@ -97,7 +97,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
cset_start_symb = pdcch_pdu_rel15->StartSymbolIndex;
cset_nsymb = pdcch_pdu_rel15->DurationSymbols;
dci_idx = 0;
- LOG_D(PHY, "Coreset rb_offset %d, nb_rb %d\n",rb_offset,n_rb);
+ LOG_D(PHY, "Coreset rb_offset %d, nb_rb %d BWP Start %d\n",rb_offset,n_rb,pdcch_pdu_rel15->BWPStart);
LOG_D(PHY, "Coreset starting subcarrier %d on symbol %d (%d symbols)\n", cset_start_sc, cset_start_symb, cset_nsymb);
// DMRS length is per OFDM symbol
uint32_t dmrs_length = n_rb*6; //2(QPSK)*3(per RB)*6(REG per CCE)
@@ -164,8 +164,8 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
/// Resource mapping
- if (cset_start_sc >= frame_parms.ofdm_symbol_size)
- cset_start_sc -= frame_parms.ofdm_symbol_size;
+ if (cset_start_sc >= frame_parms->ofdm_symbol_size)
+ cset_start_sc -= frame_parms->ofdm_symbol_size;
// Get cce_list indices by reg_idx in ascending order
int reg_list_index = 0;
@@ -181,62 +181,64 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
}
/*Mapping the encoded DCI along with the DMRS */
- for (int cce_count = 0; cce_count < dci_pdu->AggregationLevel; cce_count ++) {
+ for(int symbol_idx = 0; symbol_idx < pdcch_pdu_rel15->DurationSymbols; symbol_idx++) {
+ for (int cce_count = 0; cce_count < dci_pdu->AggregationLevel; cce_count+=pdcch_pdu_rel15->DurationSymbols) {
- int8_t cce_idx = reg_list_order[cce_count];
+ int8_t cce_idx = reg_list_order[cce_count];
- for (int reg_in_cce_idx = 0; reg_in_cce_idx < NR_NB_REG_PER_CCE; reg_in_cce_idx++) {
+ for (int reg_in_cce_idx = 0; reg_in_cce_idx < NR_NB_REG_PER_CCE; reg_in_cce_idx++) {
- k = cset_start_sc + gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].start_sc_idx;
+ k = cset_start_sc + gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].start_sc_idx;
- if (k >= frame_parms.ofdm_symbol_size)
- k -= frame_parms.ofdm_symbol_size;
+ if (k >= frame_parms->ofdm_symbol_size)
+ k -= frame_parms->ofdm_symbol_size;
- l = cset_start_symb + gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].symb_idx;
+ l = cset_start_symb + symbol_idx;
- // dmrs index depends on reference point for k according to 38.211 7.4.1.3.2
- if (pdcch_pdu_rel15->CoreSetType == NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG)
- dmrs_idx =gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx * 3;
- else
- dmrs_idx = (gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx + rb_offset) * 3;
+ // dmrs index depends on reference point for k according to 38.211 7.4.1.3.2
+ if (pdcch_pdu_rel15->CoreSetType == NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG)
+ dmrs_idx = (gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx) * 3;
+ else
+ dmrs_idx = (gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx + rb_offset) * 3;
- k_prime = 0;
+ k_prime = 0;
- for (int m = 0; m < NR_NB_SC_PER_RB; m++) {
- if (m == (k_prime << 2) + 1) { // DMRS if not already mapped
- ((int16_t *) txdataF)[(l * frame_parms.ofdm_symbol_size + k) << 1] =
- (amp * mod_dmrs[l][dmrs_idx << 1]) >> 15;
- ((int16_t *) txdataF)[((l * frame_parms.ofdm_symbol_size + k) << 1) + 1] =
- (amp * mod_dmrs[l][(dmrs_idx << 1) + 1]) >> 15;
+ for (int m = 0; m < NR_NB_SC_PER_RB; m++) {
+ if (m == (k_prime << 2) + 1) { // DMRS if not already mapped
+ ((int16_t *) txdataF)[(l * frame_parms->ofdm_symbol_size + k) << 1] =
+ (amp * mod_dmrs[l][dmrs_idx << 1]) >> 15;
+ ((int16_t *) txdataF)[((l * frame_parms->ofdm_symbol_size + k) << 1) + 1] =
+ (amp * mod_dmrs[l][(dmrs_idx << 1) + 1]) >> 15;
#ifdef DEBUG_PDCCH_DMRS
- printf("PDCCH DMRS: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms.ofdm_symbol_size + k)<<1],
- ((int16_t *)txdataF)[((l*frame_parms.ofdm_symbol_size + k)<<1)+1]);
+ printf("PDCCH DMRS: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms->ofdm_symbol_size + k)<<1],
+ ((int16_t *)txdataF)[((l*frame_parms->ofdm_symbol_size + k)<<1)+1]);
#endif
- dmrs_idx++;
- k_prime++;
+ dmrs_idx++;
+ k_prime++;
- } else { // DCI payload
- ((int16_t *) txdataF)[(l * frame_parms.ofdm_symbol_size + k) << 1] = (amp * mod_dci[dci_idx << 1]) >> 15;
- ((int16_t *) txdataF)[((l * frame_parms.ofdm_symbol_size + k) << 1) + 1] =
- (amp * mod_dci[(dci_idx << 1) + 1]) >> 15;
+ } else { // DCI payload
+ ((int16_t *) txdataF)[(l * frame_parms->ofdm_symbol_size + k) << 1] = (amp * mod_dci[dci_idx << 1]) >> 15;
+ ((int16_t *) txdataF)[((l * frame_parms->ofdm_symbol_size + k) << 1) + 1] =
+ (amp * mod_dci[(dci_idx << 1) + 1]) >> 15;
#ifdef DEBUG_DCI
- printf("PDCCH: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms.ofdm_symbol_size + k)<<1],
- ((int16_t *)txdataF)[((l*frame_parms.ofdm_symbol_size + k)<<1)+1]);
+ printf("PDCCH: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms->ofdm_symbol_size + k)<<1],
+ ((int16_t *)txdataF)[((l*frame_parms->ofdm_symbol_size + k)<<1)+1]);
#endif
- dci_idx++;
- }
+ dci_idx++;
+ }
- k++;
+ k++;
- if (k >= frame_parms.ofdm_symbol_size)
- k -= frame_parms.ofdm_symbol_size;
+ if (k >= frame_parms->ofdm_symbol_size)
+ k -= frame_parms->ofdm_symbol_size;
- } // m
- } // reg_in_cce_idx
- } // cce_count
+ } // m
+ } // reg_in_cce_idx
+ } // cce_count
+ } // symbol_idx
LOG_D(PHY,
"DCI: payloadSize = %d | payload = %llx\n",
@@ -251,17 +253,15 @@ void nr_generate_dci_top(PHY_VARS_gNB *gNB,
uint32_t **gold_pdcch_dmrs,
int32_t *txdataF,
int16_t amp,
- NR_DL_FRAME_PARMS frame_parms) {
+ NR_DL_FRAME_PARMS *frame_parms) {
AssertFatal(pdcch_pdu!=NULL || ul_dci_pdu!=NULL,"At least one pointer has to be !NULL\n");
- if (pdcch_pdu && ul_dci_pdu) {
+ if (pdcch_pdu) {
nr_generate_dci(gNB,&pdcch_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms);
+ }
+ if (ul_dci_pdu) {
nr_generate_dci(gNB,&ul_dci_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms);
}
- else if (pdcch_pdu)
- nr_generate_dci(gNB,&pdcch_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms);
- else
- nr_generate_dci(gNB,&ul_dci_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms);
}
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.h b/openair1/PHY/NR_TRANSPORT/nr_dci.h
index 1b57acc6f4..e3b53f9cf9 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dci.h
+++ b/openair1/PHY/NR_TRANSPORT/nr_dci.h
@@ -35,7 +35,7 @@ void nr_generate_dci_top(PHY_VARS_gNB *gNB,
uint32_t **gold_pdcch_dmrs,
int32_t *txdataF,
int16_t amp,
- NR_DL_FRAME_PARMS frame_parms);
+ NR_DL_FRAME_PARMS *frame_parms);
void nr_pdcch_scrambling(uint32_t *in,
uint32_t size,
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c
index 4775851a65..c562dfaa41 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c
@@ -136,7 +136,7 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_r
get_coreset_rballoc(pdcch_pdu_rel15->FreqDomainResource,&n_rb,&rb_offset);
- int N_reg = n_rb * pdcch_pdu_rel15->DurationSymbols;
+ int N_reg = n_rb;
int C=-1;
AssertFatal(N_reg > 0,"N_reg cannot be 0\n");
@@ -174,8 +174,8 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_r
for (uint8_t reg_idx=0; reg_idxreg_list[reg_idx];
reg->reg_idx = bsize*idx + reg_idx;
- reg->start_sc_idx = (reg->reg_idx/pdcch_pdu_rel15->DurationSymbols) * NR_NB_SC_PER_RB;
- reg->symb_idx = reg->reg_idx % pdcch_pdu_rel15->DurationSymbols;
+ reg->start_sc_idx = reg->reg_idx * NR_NB_SC_PER_RB;
+ reg->symb_idx = 0;
LOG_D(PHY, "reg %d symbol %d start subcarrier %d\n", reg->reg_idx, reg->symb_idx, reg->start_sc_idx);
}
}
@@ -185,8 +185,8 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_r
for (uint8_t reg_idx=0; reg_idxreg_list[reg_idx];
reg->reg_idx = cce->cce_idx*NR_NB_REG_PER_CCE + reg_idx;
- reg->start_sc_idx = (reg->reg_idx/pdcch_pdu_rel15->DurationSymbols) * NR_NB_SC_PER_RB;
- reg->symb_idx = reg->reg_idx % pdcch_pdu_rel15->DurationSymbols;
+ reg->start_sc_idx = reg->reg_idx * NR_NB_SC_PER_RB;
+ reg->symb_idx = 0;
LOG_D(PHY, "reg %d symbol %d start subcarrier %d\n", reg->reg_idx, reg->symb_idx, reg->start_sc_idx);
}
@@ -239,7 +239,7 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
//uint64_t *dci_pdu = (uint64_t*)pdcch_pdu_rel15->dci_pdu[i].Payload;
int dlsch_id = find_nr_dlsch(pdcch_pdu_rel15->dci_pdu[i].RNTI,gNB,SEARCH_EXIST_OR_FREE);
- if( (dlsch_id<0) || (dlsch_id>=NUMBER_OF_NR_DLSCH_MAX) ){
+ if( (dlsch_id<0) || (dlsch_id>=gNB->number_of_nr_dlsch_max) ){
LOG_E(PHY,"illegal dlsch_id found!!! rnti %04x dlsch_id %d\n",(unsigned int)pdcch_pdu_rel15->dci_pdu[i].RNTI,dlsch_id);
return;
}
@@ -255,10 +255,7 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
dlsch->harq_mask |= (1<rnti = pdcch_pdu_rel15->dci_pdu[i].RNTI;
- // nr_fill_cce_list(gNB,0);
-
-
-
+ // nr_fill_cce_list(gNB,0);
}
}
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
index d06c4bbb1c..03bd0ddf6c 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
@@ -82,7 +82,6 @@ void nr_pdsch_codeword_scrambling_optim(uint8_t *in,
s=lte_gold_generic(&x1, &x2, 1);
-
#if defined(__AVX2__)
for (int i=0; i<((size>>5)+((size&0x1f) > 0 ? 1 : 0)); i++) {
in32=_mm256_movemask_epi8(_mm256_slli_epi16(((__m256i*)in)[i],7));
@@ -133,7 +132,7 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
time_stats_t *dlsch_interleaving_stats=&gNB->dlsch_interleaving_stats;
time_stats_t *dlsch_segmentation_stats=&gNB->dlsch_segmentation_stats;
- for (int dlsch_id=0;dlsch_idnumber_of_nr_dlsch_max;dlsch_id++) {
dlsch = gNB->dlsch[dlsch_id][0];
if (dlsch->slot_tx[slot] == 0) continue;
@@ -160,8 +159,7 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
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;
- int16_t mod_dmrs[14][n_dmrs<<1] __attribute__ ((aligned(16)));
-
+ int16_t mod_dmrs[n_dmrs<<1] __attribute__ ((aligned(16)));
/* PTRS */
uint16_t beta_ptrs = 1;
@@ -266,24 +264,6 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
printf("\n");
}
#endif
-
- /// DMRS QPSK modulation
- // TODO: performance improvement, we can skip the modulation of DMRS symbols outside the bandwidth part
- for (int l=rel15->StartSymbolIndex; lStartSymbolIndex+rel15->NrOfSymbols; l++) {
- if (rel15->dlDmrsSymbPos & (1 << l)) {
- nr_modulation(pdsch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs[l]); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated
-
-#ifdef DEBUG_DLSCH
- printf("DMRS modulation (symbol %d, %d symbols, type %d):\n", l, n_dmrs, dmrs_Type);
- for (int i=0; i>4; i++) {
- for (int j=0; j<8; j++) {
- printf("%d %d\t", mod_dmrs[l][((i<<3)+j)<<1], mod_dmrs[l][(((i<<3)+j)<<1)+1]);
- }
- printf("\n");
- }
-#endif
- }
- }
/// Resource mapping
@@ -351,6 +331,21 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
}
}
+ /// DMRS QPSK modulation
+ if (rel15->dlDmrsSymbPos & (1 << l)) {
+ nr_modulation(pdsch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated
+
+#ifdef DEBUG_DLSCH
+ printf("DMRS modulation (symbol %d, %d symbols, type %d):\n", l, n_dmrs, dmrs_Type);
+ for (int i=0; i>4; i++) {
+ for (int j=0; j<8; j++) {
+ printf("%d %d\t", mod_dmrs[((i<<3)+j)<<1], mod_dmrs[(((i<<3)+j)<<1)+1]);
+ }
+ printf("\n");
+ }
+#endif
+ }
+
/* calculate if current symbol is PTRS symbols */
ptrs_idx = 0;
@@ -381,8 +376,8 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
/* Map DMRS Symbol */
if ( ( dmrs_symbol_map & (1 << l) ) && (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) {
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[l][dmrs_idx<<1]) >> 15;
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[l][(dmrs_idx<<1) + 1]) >> 15;
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15;
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15;
#ifdef DEBUG_DLSCH_MAPPING
printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n",
dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)],
@@ -453,7 +448,7 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
(void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + txdataF_offset+ k)],
NR_NB_SC_PER_RB*sizeof(int32_t));
else
- memset((void*)&txdataF[ap][rel15->StartSymbolIndex*frame_parms->ofdm_symbol_size + txdataF_offset +k],
+ memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k],
0,
NR_NB_SC_PER_RB*sizeof(int32_t));
k += NR_NB_SC_PER_RB;
@@ -545,6 +540,6 @@ void dump_pdsch_stats(PHY_VARS_gNB *gNB) {
void clear_pdsch_stats(PHY_VARS_gNB *gNB) {
- for (int i=0;inumber_of_nr_dlsch_max;i++)
memset((void*)&gNB->dlsch_stats[i],0,sizeof(gNB->dlsch_stats[i]));
}
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
index e1b5e7d586..2ae2549df3 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
@@ -192,14 +192,15 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
AssertFatal(harq->d[r], "cannot allocate harq->d[%d]\n", r); // max size for coded output
bzero(harq->c[r], 8448);
bzero(harq->d[r], (3 * 8448));
- harq->e = malloc16(14 * N_RB * 12 * 8);
- AssertFatal(harq->e, "cannot allocate harq->e\n");
- bzero(harq->e, 14 * N_RB * 12 * 8);
- harq->f = malloc16(14 * N_RB * 12 * 8);
- AssertFatal(harq->f, "cannot allocate harq->f\n");
- bzero(harq->f, 14 * N_RB * 12 * 8);
}
+ harq->e = malloc16(N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
+ AssertFatal(harq->e, "cannot allocate harq->e\n");
+ bzero(harq->e, N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
+ harq->f = malloc16(N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
+ AssertFatal(harq->f, "cannot allocate harq->f\n");
+ bzero(harq->f, N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
+
return(dlsch);
}
@@ -291,7 +292,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
}
G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs,mod_order,rel15->nrOfLayers);
- LOG_D(PHY,"dlsch coding A %d G %d (nb_rb %d, nb_symb_sch %d, nb_re_dmrs %d, length_dmrs %d, mod_order %d)\n", A,G, nb_rb,nb_symb_sch,nb_re_dmrs,length_dmrs,(int)mod_order);
+ LOG_D(NR_PHY,"dlsch coding A %d G %d (nb_rb %d, nb_symb_sch %d, nb_re_dmrs %d, length_dmrs %d, mod_order %d)\n", A,G, nb_rb,nb_symb_sch,nb_re_dmrs,length_dmrs,mod_order);
if (A > 3824) {
// Add 24-bit crc (polynomial A) to payload
@@ -409,7 +410,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
E = nr_get_E(G, harq->C, mod_order, rel15->nrOfLayers, r);
//#ifdef DEBUG_DLSCH_CODING
- LOG_D(PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d)...\n",
+ LOG_D(NR_PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d)...\n",
r,
harq->C,
G,
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
index 05d6c4c112..543002827d 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
@@ -260,7 +260,7 @@ int16_t find_nr_dlsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type) {
int16_t first_free_index=-1;
AssertFatal(gNB!=NULL,"gNB is null\n");
- for (i=0; inumber_of_nr_dlsch_max; i++) {
AssertFatal(gNB->dlsch[i]!=NULL,"gNB->dlsch[%d] is null\n",i);
AssertFatal(gNB->dlsch[i][0]!=NULL,"gNB->dlsch[%d][0] is null\n",i);
LOG_D(PHY,"searching for rnti %x : dlsch_index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,
@@ -286,7 +286,7 @@ void nr_fill_dlsch(PHY_VARS_gNB *gNB,
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &pdsch_pdu->pdsch_pdu_rel15;
int dlsch_id = find_nr_dlsch(rel15->rnti,gNB,SEARCH_EXIST);
- AssertFatal( (dlsch_id>=0) && (dlsch_id=0) && (dlsch_idnumber_of_nr_dlsch_max),
"illegal or no dlsch_id found!!! rnti %04x dlsch_id %d\n",rel15->rnti,dlsch_id);
NR_gNB_DLSCH_t *dlsch = gNB->dlsch[dlsch_id][0];
NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process;
diff --git a/openair1/PHY/NR_TRANSPORT/nr_prach.c b/openair1/PHY/NR_TRANSPORT/nr_prach.c
index bf944e27aa..000348ae87 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_prach.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_prach.c
@@ -872,24 +872,36 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
// Now do IFFT of size 1024 (N_ZC=839) or 256 (N_ZC=139)
if (N_ZC == 839) {
- log2_ifft_size = 10;
idft(IDFT_1024,prachF,prach_ifft_tmp,1);
// compute energy and accumulate over receive antennas
- for (i=0;i<2048;i++)
- prach_ifft[i] += ((int32_t)prach_ifft_tmp[i<<1]*(int32_t)prach_ifft_tmp[i<<1] + (int32_t)prach_ifft_tmp[1+(i<<1)]*(int32_t)prach_ifft_tmp[1+(i<<1)])/nb_rx;
+ for (i=0;i<1024;i++)
+ prach_ifft[i] += (int32_t)prach_ifft_tmp[i<<1]*(int32_t)prach_ifft_tmp[i<<1] + (int32_t)prach_ifft_tmp[1+(i<<1)]*(int32_t)prach_ifft_tmp[1+(i<<1)];
} else {
idft(IDFT_256,prachF,prach_ifft_tmp,1);
log2_ifft_size = 8;
- // compute energy and accumulate over receive antennas and repetitions for BR
- for (i=0;i<256;i++)
- prach_ifft[i] += ((int32_t)prach_ifft_tmp[i<<1]*(int32_t)prach_ifft_tmp[(i<<1)] + (int32_t)prach_ifft_tmp[1+(i<<1)]*(int32_t)prach_ifft_tmp[1+(i<<1)])/nb_rx;
- }
+ // compute energy and accumulate over receive antennas and repetitions for BR
+ for (i=0;i<256;i++)
+ prach_ifft[i] += (int32_t)prach_ifft_tmp[i<<1]*(int32_t)prach_ifft_tmp[(i<<1)] + (int32_t)prach_ifft_tmp[1+(i<<1)]*(int32_t)prach_ifft_tmp[1+(i<<1)];
+ }
+
+ if (LOG_DUMPFLAG(PRACH)) {
+ if (aa==0) LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
+ if (aa==1) LOG_M("prach_rxF_comp1.m","prach_rxF_comp1",prachF,1024,1,1);
+ }
- if (LOG_DUMPFLAG(PRACH)) {
- if (aa==0) LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
- if (aa==1) LOG_M("prach_rxF_comp1.m","prach_rxF_comp1",prachF,1024,1,1);
- }
}// antennas_rx
+
+ // Normalization of energy over ifft and receive antennas
+ if (N_ZC == 839) {
+ log2_ifft_size = 10;
+ for (i=0;i<1024;i++)
+ prach_ifft[i] = (prach_ifft[i]>>log2_ifft_size)/nb_rx;
+ } else {
+ log2_ifft_size = 8;
+ for (i=0;i<256;i++)
+ prach_ifft[i] = (prach_ifft[i]>>log2_ifft_size)/nb_rx;
+ }
+
} // new dft
// check energy in nth time shift, for
diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
index 5e6011c437..994ff18bc8 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
+++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
@@ -133,15 +133,13 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
@param ue Pointer to PHY variables
@param UE_id id of current UE
@param frame Frame number
- @param nr_tti_rx TTI number
- @param symbol Symbol on which to act (within-in nr_TTI_rx)
+ @param slot Slot number
@param harq_pid HARQ process ID
*/
int nr_rx_pusch(PHY_VARS_gNB *gNB,
uint8_t UE_id,
uint32_t frame,
- uint8_t nr_tti_rx,
- unsigned char symbol,
+ uint8_t slot,
unsigned char harq_pid);
/** \brief This function performs RB extraction (signal and channel estimates) (currently signal only until channel estimation and compensation are implemented)
diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c
index d50f5eb76c..53ff90404b 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c
@@ -41,7 +41,7 @@ int16_t find_nr_ulsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type) {
int16_t first_free_index=-1;
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);
@@ -62,7 +62,7 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB,
int ulsch_id = find_nr_ulsch(ulsch_pdu->rnti,gNB,SEARCH_EXIST_OR_FREE);
- AssertFatal( (ulsch_id>=0) && (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];
@@ -143,14 +143,14 @@ void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) {
char output[16384];
int stroff=0;
- for (int i=0;inumber_of_nr_ulsch_max;i++) {
if (gNB->ulsch_stats[i].rnti>0) {
- for (int aa=0;aaframe_parms.nb_antennas_rx;aa++)
- if (aa==0) stroff+=sprintf(output+stroff,"ULSCH RNTI %4x: ulsch_power[%d] %d,%d ulsch_noise_power[%d] %d.%d\n",
- gNB->ulsch_stats[i].rnti,
+ for (int aa=0;aaframe_parms.nb_antennas_rx;aa++)
+ if (aa==0) stroff+=sprintf(output+stroff,"ULSCH RNTI %4x: ulsch_power[%d] %d,%d ulsch_noise_power[%d] %d.%d\n",
+ gNB->ulsch_stats[i].rnti,
aa,gNB->ulsch_stats[i].power[aa]/10,gNB->ulsch_stats[i].power[aa]%10,
aa,gNB->ulsch_stats[i].noise_power[aa]/10,gNB->ulsch_stats[i].noise_power[aa]%10);
- else stroff+=sprintf(output+stroff," ulsch_power[%d] %d.%d, ulsch_noise_power[%d] %d.%d\n",
+ else stroff+=sprintf(output+stroff," ulsch_power[%d] %d.%d, ulsch_noise_power[%d] %d.%d\n",
aa,gNB->ulsch_stats[i].power[aa]/10,gNB->ulsch_stats[i].power[aa]%10,
aa,gNB->ulsch_stats[i].noise_power[aa]/10,gNB->ulsch_stats[i].noise_power[aa]%10);
@@ -170,21 +170,21 @@ void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) {
gNB->ulsch_stats[i].current_RI,
gNB->ulsch_stats[i].total_bytes_rx,
gNB->ulsch_stats[i].total_bytes_tx);
- }
+ }
}
fprintf(fd,"%s",output);
}
void clear_pusch_stats(PHY_VARS_gNB *gNB) {
- for (int i=0;inumber_of_nr_ulsch_max;i++)
memset((void*)&gNB->ulsch_stats[i],0,sizeof(gNB->ulsch_stats[i]));
}
NR_gNB_SCH_STATS_t *get_ulsch_stats(PHY_VARS_gNB *gNB,NR_gNB_ULSCH_t *ulsch) {
NR_gNB_SCH_STATS_t *stats=NULL;
int first_free=-1;
- for (int i=0;inumber_of_nr_ulsch_max;i++) {
if (gNB->ulsch_stats[i].rnti == 0 && first_free == -1) {
first_free = i;
stats=&gNB->ulsch_stats[i];
diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
index 197201155e..7a4555d254 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
@@ -12,6 +12,8 @@
//#define DEBUG_RB_EXT
//#define DEBUG_CH_MAG
+#define INVALID_VALUE 255
+
void nr_idft(int32_t *z, uint32_t Msc_PUSCH)
{
@@ -1157,12 +1159,11 @@ void nr_ulsch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms,
int nr_rx_pusch(PHY_VARS_gNB *gNB,
uint8_t ulsch_id,
uint32_t frame,
- uint8_t nr_tti_rx,
- unsigned char symbol,
+ uint8_t slot,
unsigned char harq_pid)
{
- uint8_t aarx, aatx, dmrs_symbol_flag; // dmrs_symbol_flag, a flag to indicate DMRS REs in current symbol
+ uint8_t aarx, aatx;
uint32_t nb_re_pusch, bwp_start_subcarrier;
int avgs;
int avg[4];
@@ -1170,209 +1171,202 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
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;
- dmrs_symbol_flag = 0;
-
- if(symbol == rel15_ul->start_symbol_index){
- gNB->pusch_vars[ulsch_id]->dmrs_symbol = 0;
- gNB->pusch_vars[ulsch_id]->cl_done = 0;
- }
-
+ gNB->pusch_vars[ulsch_id]->dmrs_symbol = INVALID_VALUE;
+ gNB->pusch_vars[ulsch_id]->cl_done = 0;
bwp_start_subcarrier = ((rel15_ul->rb_start + rel15_ul->bwp_start)*NR_NB_SC_PER_RB + frame_parms->first_carrier_offset) % frame_parms->ofdm_symbol_size;
-
- dmrs_symbol_flag = ((rel15_ul->ul_dmrs_symb_pos)>>symbol)&0x01;
-
- LOG_D(PHY,"symbol %d bwp_start_subcarrier %d, rb_start %d, first_carrier_offset %d\n",symbol,bwp_start_subcarrier,rel15_ul->rb_start,frame_parms->first_carrier_offset);
+ LOG_D(PHY,"bwp_start_subcarrier %d, rb_start %d, first_carrier_offset %d\n", bwp_start_subcarrier, rel15_ul->rb_start, frame_parms->first_carrier_offset);
LOG_D(PHY,"ul_dmrs_symb_pos %x\n",rel15_ul->ul_dmrs_symb_pos);
- if (dmrs_symbol_flag == 1){
- if (((rel15_ul->ul_dmrs_symb_pos)>>((symbol+1)%frame_parms->symbols_per_slot))&0x01)
- AssertFatal(1==0,"Double DMRS configuration is not yet supported\n");
-
- if (rel15_ul->dmrs_config_type == 0) {
- // if no data in dmrs cdm group is 1 only even REs have no data
- // if no data in dmrs cdm group is 2 both odd and even REs have no data
- nb_re_pusch = rel15_ul->rb_size *(12 - (rel15_ul->num_dmrs_cdm_grps_no_data*6));
- }
- else {
- nb_re_pusch = rel15_ul->rb_size *(12 - (rel15_ul->num_dmrs_cdm_grps_no_data*4));
- }
- LOG_D(PHY,"dmrs_symbol: nb_re_pusch %d\n",nb_re_pusch);
- gNB->pusch_vars[ulsch_id]->dmrs_symbol = symbol;
-
- } else {
- nb_re_pusch = rel15_ul->rb_size * NR_NB_SC_PER_RB;
- }
-
//----------------------------------------------------------
//--------------------- Channel estimation ---------------------
//----------------------------------------------------------
start_meas(&gNB->ulsch_channel_estimation_stats);
- if (dmrs_symbol_flag == 1) {
- nr_pusch_channel_estimation(gNB,
- nr_tti_rx,
- 0, // p
- symbol,
- ulsch_id,
- bwp_start_subcarrier,
- rel15_ul);
+ for(uint8_t symbol = rel15_ul->start_symbol_index; symbol < (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols); symbol++) {
+ uint8_t dmrs_symbol_flag = (rel15_ul->ul_dmrs_symb_pos >> symbol) & 0x01;
+ LOG_D(PHY, "symbol %d, dmrs_symbol_flag :%d\n", symbol, dmrs_symbol_flag);
+ if (dmrs_symbol_flag == 1) {
+ if (gNB->pusch_vars[ulsch_id]->dmrs_symbol == INVALID_VALUE)
+ gNB->pusch_vars[ulsch_id]->dmrs_symbol = symbol;
- nr_gnb_measurements(gNB, ulsch_id, harq_pid, symbol);
- for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
- if (symbol == rel15_ul->start_symbol_index) {
- gNB->pusch_vars[ulsch_id]->ulsch_power[aarx]=0;
- gNB->pusch_vars[ulsch_id]->ulsch_noise_power[aarx]=0;
+ nr_pusch_channel_estimation(gNB,
+ slot,
+ 0, // p
+ symbol,
+ ulsch_id,
+ bwp_start_subcarrier,
+ rel15_ul);
+
+ nr_gnb_measurements(gNB, ulsch_id, harq_pid, symbol);
+
+ for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
+ if (symbol == rel15_ul->start_symbol_index) {
+ gNB->pusch_vars[ulsch_id]->ulsch_power[aarx] = 0;
+ gNB->pusch_vars[ulsch_id]->ulsch_noise_power[aarx] = 0;
+ }
+ gNB->pusch_vars[ulsch_id]->ulsch_power[aarx] += signal_energy_nodc(
+ &gNB->pusch_vars[ulsch_id]->ul_ch_estimates[aarx][symbol * frame_parms->ofdm_symbol_size],
+ rel15_ul->rb_size * 12);
+ for (int rb = 0; rb < rel15_ul->rb_size; rb++) {
+ gNB->pusch_vars[ulsch_id]->ulsch_noise_power[aarx] +=
+ gNB->measurements.n0_subband_power[aarx][rel15_ul->bwp_start + rel15_ul->rb_start + rb] /
+ rel15_ul->rb_size;
+ }
}
- gNB->pusch_vars[ulsch_id]->ulsch_power[aarx] += signal_energy_nodc(&gNB->pusch_vars[ulsch_id]->ul_ch_estimates[aarx][symbol*frame_parms->ofdm_symbol_size],
- rel15_ul->rb_size*12);
- for (int rb=0;rbrb_size;rb++) {
- gNB->pusch_vars[ulsch_id]->ulsch_noise_power[aarx]+=gNB->measurements.n0_subband_power[aarx][rel15_ul->bwp_start+rel15_ul->rb_start+rb]/rel15_ul->rb_size;
- }
-
- }
+ }
}
stop_meas(&gNB->ulsch_channel_estimation_stats);
- //----------------------------------------------------------
- //--------------------- RBs extraction ---------------------
- //----------------------------------------------------------
- gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[symbol] = nb_re_pusch;
+#ifdef __AVX2__
+ int off = ((rel15_ul->rb_size&1) == 1)? 4:0;
+#else
+ int off = 0;
+#endif
+ uint32_t rxdataF_ext_offset = 0;
- if (nb_re_pusch > 0) {
+ for(uint8_t symbol = rel15_ul->start_symbol_index; symbol < (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols); symbol++) {
+ uint8_t dmrs_symbol_flag = (rel15_ul->ul_dmrs_symb_pos >> symbol) & 0x01;
+ if (dmrs_symbol_flag == 1) {
+ if ((rel15_ul->ul_dmrs_symb_pos >> ((symbol + 1) % frame_parms->symbols_per_slot)) & 0x01)
+ AssertFatal(1==0,"Double DMRS configuration is not yet supported\n");
- start_meas(&gNB->ulsch_rbs_extraction_stats);
- nr_ulsch_extract_rbs_single(gNB->common_vars.rxdataF,
- gNB->pusch_vars[ulsch_id],
- symbol,
- dmrs_symbol_flag,
- rel15_ul,
- frame_parms);
- stop_meas(&gNB->ulsch_rbs_extraction_stats);
+ gNB->pusch_vars[ulsch_id]->dmrs_symbol = symbol;
- //----------------------------------------------------------
- //--------------------- Channel Scaling --------------------
- //----------------------------------------------------------
-
- nr_ulsch_scale_channel(gNB->pusch_vars[ulsch_id]->ul_ch_estimates_ext,
- frame_parms,
- gNB->ulsch[ulsch_id],
- symbol,
- dmrs_symbol_flag,
- rel15_ul->rb_size,
- rel15_ul->dmrs_config_type);
-
-
- if (gNB->pusch_vars[ulsch_id]->cl_done==0) {
-
- nr_ulsch_channel_level(gNB->pusch_vars[ulsch_id]->ul_ch_estimates_ext,
- frame_parms,
- avg,
- symbol,
- nb_re_pusch,
- rel15_ul->rb_size);
-
- avgs = 0;
-
- for (aatx=0;aatxnb_antennas_rx;aarx++)
- avgs = cmax(avgs,avg[(aatx<<1)+aarx]);
-
- gNB->pusch_vars[ulsch_id]->log2_maxh = (log2_approx(avgs)/2)+3;
- gNB->pusch_vars[ulsch_id]->cl_done = 1;
+ if (rel15_ul->dmrs_config_type == 0) {
+ // if no data in dmrs cdm group is 1 only even REs have no data
+ // if no data in dmrs cdm group is 2 both odd and even REs have no data
+ nb_re_pusch = rel15_ul->rb_size *(12 - (rel15_ul->num_dmrs_cdm_grps_no_data*6));
+ }
+ else {
+ nb_re_pusch = rel15_ul->rb_size *(12 - (rel15_ul->num_dmrs_cdm_grps_no_data*4));
+ }
+ } else {
+ nb_re_pusch = rel15_ul->rb_size * NR_NB_SC_PER_RB;
}
- //----------------------------------------------------------
- //--------------------- Channel Compensation ---------------
- //----------------------------------------------------------
+ gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[symbol] = nb_re_pusch;
+ LOG_D(PHY,"symbol %d: nb_re_pusch %d, DMRS symbl used for Chest :%d \n", symbol, nb_re_pusch, gNB->pusch_vars[ulsch_id]->dmrs_symbol);
- start_meas(&gNB->ulsch_channel_compensation_stats);
- nr_ulsch_channel_compensation(gNB->pusch_vars[ulsch_id]->rxdataF_ext,
- gNB->pusch_vars[ulsch_id]->ul_ch_estimates_ext,
- gNB->pusch_vars[ulsch_id]->ul_ch_mag0,
- gNB->pusch_vars[ulsch_id]->ul_ch_magb0,
- gNB->pusch_vars[ulsch_id]->rxdataF_comp,
- (nb_antennas_ue_tx>1) ? gNB->pusch_vars[ulsch_id]->rho : NULL,
- frame_parms,
+ //----------------------------------------------------------
+ //--------------------- RBs extraction ---------------------
+ //----------------------------------------------------------
+ if (nb_re_pusch > 0) {
+
+ start_meas(&gNB->ulsch_rbs_extraction_stats);
+ nr_ulsch_extract_rbs_single(gNB->common_vars.rxdataF,
+ gNB->pusch_vars[ulsch_id],
symbol,
dmrs_symbol_flag,
- rel15_ul->qam_mod_order,
- rel15_ul->rb_size,
- gNB->pusch_vars[ulsch_id]->log2_maxh);
- stop_meas(&gNB->ulsch_channel_compensation_stats);
+ rel15_ul,
+ frame_parms);
+ stop_meas(&gNB->ulsch_rbs_extraction_stats);
- start_meas(&gNB->ulsch_mrc_stats);
- nr_ulsch_detection_mrc(frame_parms,
- gNB->pusch_vars[ulsch_id]->rxdataF_comp,
- gNB->pusch_vars[ulsch_id]->ul_ch_mag,
- gNB->pusch_vars[ulsch_id]->ul_ch_magb,
- symbol,
- rel15_ul->rb_size);
- stop_meas(&gNB->ulsch_mrc_stats);
+ //----------------------------------------------------------
+ //--------------------- Channel Scaling --------------------
+ //----------------------------------------------------------
+ nr_ulsch_scale_channel(gNB->pusch_vars[ulsch_id]->ul_ch_estimates_ext,
+ frame_parms,
+ gNB->ulsch[ulsch_id],
+ symbol,
+ dmrs_symbol_flag,
+ rel15_ul->rb_size,
+ rel15_ul->dmrs_config_type);
+ if (gNB->pusch_vars[ulsch_id]->cl_done==0) {
+ nr_ulsch_channel_level(gNB->pusch_vars[ulsch_id]->ul_ch_estimates_ext,
+ frame_parms,
+ avg,
+ symbol,
+ nb_re_pusch,
+ rel15_ul->rb_size);
+
+ avgs = 0;
+
+ for (aatx=0;aatxnb_antennas_rx;aarx++)
+ avgs = cmax(avgs,avg[(aatx<<1)+aarx]);
+
+ gNB->pusch_vars[ulsch_id]->log2_maxh = (log2_approx(avgs)/2)+3;
+ gNB->pusch_vars[ulsch_id]->cl_done = 1;
+ }
+
+ //----------------------------------------------------------
+ //--------------------- Channel Compensation ---------------
+ //----------------------------------------------------------
+ start_meas(&gNB->ulsch_channel_compensation_stats);
+ nr_ulsch_channel_compensation(gNB->pusch_vars[ulsch_id]->rxdataF_ext,
+ gNB->pusch_vars[ulsch_id]->ul_ch_estimates_ext,
+ gNB->pusch_vars[ulsch_id]->ul_ch_mag0,
+ gNB->pusch_vars[ulsch_id]->ul_ch_magb0,
+ gNB->pusch_vars[ulsch_id]->rxdataF_comp,
+ (nb_antennas_ue_tx>1) ? gNB->pusch_vars[ulsch_id]->rho : NULL,
+ frame_parms,
+ symbol,
+ dmrs_symbol_flag,
+ rel15_ul->qam_mod_order,
+ rel15_ul->rb_size,
+ gNB->pusch_vars[ulsch_id]->log2_maxh);
+ stop_meas(&gNB->ulsch_channel_compensation_stats);
+
+ start_meas(&gNB->ulsch_mrc_stats);
+ nr_ulsch_detection_mrc(frame_parms,
+ gNB->pusch_vars[ulsch_id]->rxdataF_comp,
+ gNB->pusch_vars[ulsch_id]->ul_ch_mag,
+ gNB->pusch_vars[ulsch_id]->ul_ch_magb,
+ symbol,
+ rel15_ul->rb_size);
+ stop_meas(&gNB->ulsch_mrc_stats);
+
+ if (rel15_ul->transform_precoding == transform_precoder_enabled) {
- if (rel15_ul->transform_precoding == transform_precoder_enabled) {
-
#ifdef __AVX2__
// For odd number of resource blocks need byte alignment to multiple of 8
int nb_re_pusch2 = nb_re_pusch + (nb_re_pusch&7);
#else
int nb_re_pusch2 = nb_re_pusch;
- #endif
-
- // perform IDFT operation on the compensated rxdata if transform precoding is enabled
- nr_idft(&gNB->pusch_vars[ulsch_id]->rxdataF_comp[0][symbol * nb_re_pusch2], nb_re_pusch);
- LOG_D(PHY,"Transform precoding being done on data- symbol: %d, nb_re_pusch: %d\n", symbol, nb_re_pusch);
- }
+ #endif
+ // perform IDFT operation on the compensated rxdata if transform precoding is enabled
+ nr_idft(&gNB->pusch_vars[ulsch_id]->rxdataF_comp[0][symbol * nb_re_pusch2], nb_re_pusch);
+ LOG_D(PHY,"Transform precoding being done on data- symbol: %d, nb_re_pusch: %d\n", symbol, nb_re_pusch);
+ }
- //----------------------------------------------------------
- //--------------------- PTRS Processing --------------------
- //----------------------------------------------------------
+ //----------------------------------------------------------
+ //--------------------- PTRS Processing --------------------
+ //----------------------------------------------------------
+ /* In case PTRS is enabled then LLR will be calculated after PTRS symbols are processed *
+ * otherwise LLR are calculated for each symbol based upon DMRS channel estimates only. */
+ if (rel15_ul->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) {
+ start_meas(&gNB->ulsch_ptrs_processing_stats);
+ nr_pusch_ptrs_processing(gNB,
+ frame_parms,
+ rel15_ul,
+ ulsch_id,
+ slot,
+ symbol,
+ nb_re_pusch);
+ stop_meas(&gNB->ulsch_ptrs_processing_stats);
- /* In case PTRS is enabled then LLR will be calculated after PTRS symbols are processed *
- * otherwise LLR are calculated for each symbol based upon DMRS channel estimates only. */
- if (rel15_ul->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS)
- {
- start_meas(&gNB->ulsch_ptrs_processing_stats);
- nr_pusch_ptrs_processing(gNB,
- frame_parms,
- rel15_ul,
- ulsch_id,
- nr_tti_rx,
- symbol,
- nb_re_pusch);
- stop_meas(&gNB->ulsch_ptrs_processing_stats);
+ /* Subtract total PTRS RE's in the symbol from PUSCH RE's */
+ gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[symbol] -= gNB->pusch_vars[ulsch_id]->ptrs_re_per_slot;
+ }
- /* Subtract total PTRS RE's in the symbol from PUSCH RE's */
- gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[symbol] -= gNB->pusch_vars[ulsch_id]->ptrs_re_per_slot;
- }
- }
-
- /*---------------------------------------------------------------------------------------------------- */
- /*-------------------- LLRs computation -------------------------------------------------------------*/
- /*-----------------------------------------------------------------------------------------------------*/
- if(symbol == (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols -1)) {
-
-#ifdef __AVX2__
- int off = ((rel15_ul->rb_size&1) == 1)? 4:0;
-#else
- int off = 0;
-#endif
- uint32_t rxdataF_ext_offset = 0;
- for(uint8_t i =rel15_ul->start_symbol_index; i< (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols);i++) {
+ /*---------------------------------------------------------------------------------------------------- */
+ /*-------------------- LLRs computation -------------------------------------------------------------*/
+ /*-----------------------------------------------------------------------------------------------------*/
start_meas(&gNB->ulsch_llr_stats);
- nr_ulsch_compute_llr(&gNB->pusch_vars[ulsch_id]->rxdataF_comp[0][i * (off + rel15_ul->rb_size * NR_NB_SC_PER_RB)],
- gNB->pusch_vars[ulsch_id]->ul_ch_mag0,
- gNB->pusch_vars[ulsch_id]->ul_ch_magb0,
- &gNB->pusch_vars[ulsch_id]->llr[rxdataF_ext_offset * rel15_ul->qam_mod_order],
- rel15_ul->rb_size,
- gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[i],
- i,
- rel15_ul->qam_mod_order);
+ nr_ulsch_compute_llr(&gNB->pusch_vars[ulsch_id]->rxdataF_comp[0][symbol * (off + rel15_ul->rb_size * NR_NB_SC_PER_RB)],
+ gNB->pusch_vars[ulsch_id]->ul_ch_mag0,
+ gNB->pusch_vars[ulsch_id]->ul_ch_magb0,
+ &gNB->pusch_vars[ulsch_id]->llr[rxdataF_ext_offset * rel15_ul->qam_mod_order],
+ rel15_ul->rb_size,
+ gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[symbol],
+ symbol,
+ rel15_ul->qam_mod_order);
stop_meas(&gNB->ulsch_llr_stats);
- rxdataF_ext_offset += gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[i];
- }// symbol loop
- }// last symbol check
-
- return (0);
+ rxdataF_ext_offset += gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[symbol];
+ }
+ } // symbol loop
+
+ return 0;
}
diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c
index 7e2ec05b7f..2b5343aa60 100644
--- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c
+++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c
@@ -174,15 +174,14 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
pucch_GroupHopping_t pucch_GroupHopping = pucch_pdu->group_hop_flag + (pucch_pdu->sequence_hop_flag<<1);
-
AssertFatal(pucch_pdu->bit_len_harq > 0 || pucch_pdu->sr_flag > 0,
"Either bit_len_harq (%d) or sr_flag (%d) must be > 0\n",
pucch_pdu->bit_len_harq,pucch_pdu->sr_flag);
NR_gNB_UCI_STATS_t *uci_stats=NULL;
NR_gNB_UCI_STATS_t *first_uci_stats=NULL;
- for (int i=0;iuci_stats[i].rnti == pucch_pdu->rnti) {
+ for (int i=0;iuci_stats[i].rnti == pucch_pdu->rnti) {
uci_stats = &gNB->uci_stats[i];
break;
} else if (first_uci_stats == NULL && gNB->uci_stats[i].rnti == 0) first_uci_stats = &gNB->uci_stats[i];
@@ -205,7 +204,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
nr_sequences=8>>(1-pucch_pdu->sr_flag);
}
- LOG_D(PHY,"pucch0: nr_symbols %d, start_symbol %d, prb_start %d, second_hop_prb %d, group_hop_flag %d, sequence_hop_flag %d, O_ACK %d, O_SR %d, mcs %d\n",pucch_pdu->nr_of_symbols,pucch_pdu->start_symbol_index,pucch_pdu->prb_start,pucch_pdu->second_hop_prb,pucch_pdu->group_hop_flag,pucch_pdu->sequence_hop_flag,pucch_pdu->bit_len_harq,pucch_pdu->sr_flag,mcs[0]);
+ LOG_D(PHY,"pucch0: nr_symbols %d, start_symbol %d, prb_start %d, second_hop_prb %d, group_hop_flag %d, sequence_hop_flag %d, O_ACK %d, O_SR %d, mcs %d\n",pucch_pdu->nr_of_symbols,pucch_pdu->start_symbol_index,pucch_pdu->prb_start,pucch_pdu->second_hop_prb,pucch_pdu->group_hop_flag,pucch_pdu->sequence_hop_flag,pucch_pdu->bit_len_harq,pucch_pdu->sr_flag,mcs[0]);
int cs_ind = get_pucch0_cs_lut_index(gNB,pucch_pdu);
/*
@@ -271,7 +270,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
for (l=0; lnr_of_symbols; l++) {
l2 = l+pucch_pdu->start_symbol_index;
re_offset[l] = (12*prb_offset[l]) + frame_parms->first_carrier_offset;
- if (re_offset[l]>= frame_parms->ofdm_symbol_size)
+ if (re_offset[l]>= frame_parms->ofdm_symbol_size)
re_offset[l]-=frame_parms->ofdm_symbol_size;
AssertFatal(re_offset[l]+12 < frame_parms->ofdm_symbol_size,"pucch straddles DC carrier, handle this!\n");
@@ -287,12 +286,18 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
#endif
}
}
- int32_t corr_re[2],corr_im[2],no_corr=0;
+
+ int32_t corr_re[2];
+ int32_t corr_im[2];
+ //int32_t no_corr = 0;
int seq_index;
- int64_t temp,av_corr=0;
+ int64_t temp;
+ int64_t av_corr=0;
+
for(i=0;inr_of_symbols;l++) {
- corr_re[l]=0;corr_im[l]=0;
+ corr_re[l]=0;
+ corr_im[l]=0;
seq_index = (pucch_pdu->initial_cyclic_shift+
mcs[i]+
gNB->pucch0_lut.lut[cs_ind][slot][l+pucch_pdu->start_symbol_index])%12;
@@ -331,8 +336,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
if (l==2) uci_stats->current_pucch0_stat1 = dB_fixed64((int64_t)corr_re[1]*corr_re[1] + (int64_t)corr_im[1]*corr_im[1]);
}
}
- if(nr_sequences>1)
- no_corr=(av_corr-xrtmag)/(nr_sequences-1)/l;
+
av_corr/=nr_sequences/l;
uint8_t xrtmag_dB = dB_fixed64(xrtmag);
@@ -343,7 +347,6 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
index=maxpos;
-
// estimate CQI for MAC (from antenna port 0 only)
int max_n0 = uci_stats->pucch0_n00>uci_stats->pucch0_n01 ? uci_stats->pucch0_n00:uci_stats->pucch0_n01;
int SNRtimes10 = dB_fixed_times10(signal_energy_nodc(&rxdataF[0][pucch_pdu->start_symbol_index*frame_parms->ofdm_symbol_size+re_offset[0]],12)) - (10*max_n0);
@@ -352,12 +355,13 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
else if (SNRtimes10 > 635) cqi=255;
else cqi=(640+SNRtimes10)/5;
- uci_stats->pucch0_thres = gNB->pucch0_thres + (10*max_n0);
+ uci_stats->pucch0_thres = gNB->pucch0_thres + (10*max_n0);
bool no_conf=false;
if (nr_sequences>1) {
- if (10*xrtmag_dB < uci_stats->pucch0_thres)
+ if (10*xrtmag_dB < uci_stats->pucch0_thres)
no_conf=true;
}
+ gNB->bad_pucch += no_conf;
// first bit of bitmap for sr presence and second bit for acknack presence
uci_pdu->pduBitmap = pucch_pdu->sr_flag | ((pucch_pdu->bit_len_harq>0)<<1);
uci_pdu->pucch_format = 0; // format 0
@@ -395,7 +399,6 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
uci_stats->pucch0_positive_SR++;
}
uci_stats->pucch01_trials++;
-
}
else {
uci_pdu->harq = calloc(1,sizeof(*uci_pdu->harq));
@@ -1596,7 +1599,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
if (pucch_pdu->bit_len_harq>0) {
int harq_bytes=pucch_pdu->bit_len_harq>>3;
if ((pucch_pdu->bit_len_harq&7) > 0) harq_bytes++;
- uci_pdu->pduBitmap|=1;
+ uci_pdu->pduBitmap|=2;
uci_pdu->harq.harq_payload = (uint8_t*)malloc(harq_bytes);
uci_pdu->harq.harq_crc = decoderState;
int i=0;
@@ -1610,7 +1613,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
}
if (pucch_pdu->sr_flag == 1) {
- uci_pdu->pduBitmap|=2;
+ uci_pdu->pduBitmap|=1;
uci_pdu->sr.sr_bit_len = 1;
uci_pdu->sr.sr_payload = malloc(1);
uci_pdu->sr.sr_payload[0] = decodedPayload[0]&1;
@@ -1638,9 +1641,8 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
uci_pdu->pduBitmap|=8;
}
}
-
-void dump_uci_stats(FILE *fd,PHY_VARS_gNB *gNB,int frame) {
+void nr_dump_uci_stats(FILE *fd,PHY_VARS_gNB *gNB,int frame) {
int strpos=0;
char output[16384];
@@ -1654,12 +1656,12 @@ void dump_uci_stats(FILE *fd,PHY_VARS_gNB *gNB,int frame) {
if (uci_stats->pucch01_trials > 0)
strpos+=sprintf(output+strpos,"UCI %d RNTI %x: pucch01_trials %d, pucch0_n00 %d dB, pucch0_n01 %d dB, pucch0_thres %d dB, current pucch0_stat0 %d dB, current pucch1_stat1 %d dB, pucch01_DTX %d\n",
i,uci_stats->rnti,uci_stats->pucch01_trials,uci_stats->pucch0_n01,uci_stats->pucch0_n01,uci_stats->pucch0_thres,dB_fixed(uci_stats->current_pucch0_stat0),dB_fixed(uci_stats->current_pucch0_stat1),uci_stats->pucch01_DTX);
-
+
if (uci_stats->pucch02_trials > 0)
strpos+=sprintf(output+strpos,"UCI %d RNTI %x: pucch01_trials %d, pucch0_n00 %d dB, pucch0_n01 %d dB, pucch0_thres %d dB, current pucch0_stat0 %d dB, current pucch0_stat1 %d dB, pucch01_DTX %d\n",
i,uci_stats->rnti,uci_stats->pucch02_trials,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,dB_fixed(uci_stats->current_pucch0_stat0),dB_fixed(uci_stats->current_pucch0_stat1),uci_stats->pucch02_DTX);
- if (uci_stats->pucch2_trials > 0)
+ if (uci_stats->pucch2_trials > 0)
strpos+=sprintf(output+strpos,"UCI %d RNTI %x: pucch2_trials %d, pucch2_DTX %d\n",
i,uci_stats->rnti,
uci_stats->pucch2_trials,
@@ -1667,5 +1669,5 @@ void dump_uci_stats(FILE *fd,PHY_VARS_gNB *gNB,int frame) {
}
}
if (fd) fprintf(fd,"%s",output);
- else printf("%s",output);
+ else printf("%s",output);
}
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 0318ed6478..a2f824e468 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
@@ -105,7 +105,7 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
{
first_time = 0;
ue->time_sync_cell = 1;
- if (get_softmodem_params()->do_ra) {
+ if (get_softmodem_params()->do_ra || get_softmodem_params()->sa) {
LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",ue->Mod_id);
//mac_resynch();
//dl_phy_sync_success(ue->Mod_id,frame,0,1);//ue->common_vars.eNb_id);
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 909d0b8954..8c4394e6e9 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
@@ -36,7 +36,7 @@
int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
- uint8_t eNB_offset,
+ uint8_t gNB_id,
unsigned char Ns,
unsigned char symbol,
int dmrss,
@@ -70,7 +70,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
k = nushift;
#ifdef DEBUG_CH
- printf("PBCH DMRS Correlation : ThreadId %d, eNB_offset %d , OFDM size %d, Ncp=%d, Ns=%d, k=%d symbol %d\n",proc->thread_id, eNB_offset,ue->frame_parms.ofdm_symbol_size,
+ printf("PBCH DMRS Correlation : ThreadId %d, gNB_id %d , OFDM size %d, Ncp=%d, Ns=%d, k=%d symbol %d\n",proc->thread_id, gNB_id,ue->frame_parms.ofdm_symbol_size,
ue->frame_parms.Ncp,Ns,k, symbol);
#endif
@@ -198,7 +198,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
- uint8_t eNB_offset,
+ uint8_t gNB_id,
unsigned char Ns,
unsigned char symbol,
int dmrss,
@@ -213,10 +213,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
int ch_offset,symbol_offset;
//int slot_pbch;
- //uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1];
-
uint8_t nushift;
- int **dl_ch_estimates =ue->pbch_vars[eNB_offset]->dl_ch_estimates;
+ 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;
nushift = ue->frame_parms.Nid_cell%4;
@@ -239,7 +237,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
k = nushift;
#ifdef DEBUG_CH
- printf("PBCH Channel Estimation : ThreadId %d, eNB_offset %d ch_offset %d, OFDM size %d, Ncp=%d, Ns=%d, k=%d symbol %d\n",proc->thread_id, eNB_offset,ch_offset,ue->frame_parms.ofdm_symbol_size,
+ printf("PBCH Channel Estimation : ThreadId %d, gNB_id %d ch_offset %d, OFDM size %d, Ncp=%d, Ns=%d, k=%d symbol %d\n",proc->thread_id, gNB_id,ch_offset,ue->frame_parms.ofdm_symbol_size,
ue->frame_parms.Ncp,Ns,k, symbol);
#endif
@@ -456,12 +454,12 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
// 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[eNB_offset]->dl_ch_estimates[(p*ue->frame_parms.nb_antennas_rx)+aarx])
+ 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[eNB_offset]->dl_ch_estimates[(p*ue->frame_parms.nb_antennas_rx)+aarx][ch_offset],
- (int16_t*) ue->pbch_vars[eNB_offset]->dl_ch_estimates_time[(p*ue->frame_parms.nb_antennas_rx)+aarx],1);
+ (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);
}
}
}
@@ -474,7 +472,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
- uint8_t eNB_offset,
+ uint8_t gNB_id,
unsigned char Ns,
unsigned char symbol,
unsigned short coreset_start_subcarrier,
@@ -487,9 +485,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
int16_t ch[2],*pil,*rxF,*dl_ch,*fl,*fm,*fr;
int ch_offset,symbol_offset;
- //uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1];
-
- int **dl_ch_estimates =ue->pdcch_vars[proc->thread_id][eNB_offset]->dl_ch_estimates;
+ int **dl_ch_estimates =ue->pdcch_vars[proc->thread_id][gNB_id]->dl_ch_estimates;
int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF;
@@ -500,10 +496,9 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
symbol_offset = ue->frame_parms.ofdm_symbol_size*symbol;
- k = coreset_start_subcarrier;
#ifdef DEBUG_PDCCH
- printf("PDCCH Channel Estimation : ThreadId %d, eNB_offset %d ch_offset %d, OFDM size %d, Ncp=%d, Ns=%d, k=%d symbol %d\n",proc->thread_id, eNB_offset,ch_offset,ue->frame_parms.ofdm_symbol_size,
+ printf("PDCCH Channel Estimation : ThreadId %d, gNB_id %d ch_offset %d, OFDM size %d, Ncp=%d, Ns=%d, k=%d symbol %d\n",proc->thread_id, gNB_id,ch_offset,ue->frame_parms.ofdm_symbol_size,
ue->frame_parms.Ncp,Ns,k, symbol);
#endif
@@ -521,11 +516,12 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
// generate pilot
int pilot[nb_rb_coreset * 3] __attribute__((aligned(16)));
- nr_pdcch_dmrs_rx(ue,eNB_offset,Ns,ue->nr_gold_pdcch[eNB_offset][Ns][symbol], &pilot[0],2000,nb_rb_coreset);
+ nr_pdcch_dmrs_rx(ue,gNB_id,Ns,ue->nr_gold_pdcch[gNB_id][Ns][symbol], &pilot[0],2000,nb_rb_coreset);
for (aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) {
+ k = coreset_start_subcarrier;
pil = (int16_t *)&pilot[0];
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)];
dl_ch = (int16_t *)&dl_ch_estimates[aarx][ch_offset];
@@ -656,7 +652,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
- uint8_t eNB_offset,
+ uint8_t gNB_id,
bool is_SI,
unsigned char Ns,
unsigned short p,
@@ -673,10 +669,12 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
int16_t *fl,*fm,*fr,*fml,*fmr,*fmm,*fdcl,*fdcr,*fdclh,*fdcrh, *frl, *frr;
int ch_offset,symbol_offset;
- //uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1];
+ NR_UE_DLSCH_t **dlsch = ue->dlsch[proc->thread_id][gNB_id];
+ const unsigned char harq_pid = dlsch[0]->current_harq_pid;
+ NR_DL_UE_HARQ_t *dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
uint8_t nushift;
- int **dl_ch_estimates =ue->pdsch_vars[proc->thread_id][eNB_offset]->dl_ch_estimates;
+ int **dl_ch_estimates =ue->pdsch_vars[proc->thread_id][gNB_id]->dl_ch_estimates;
int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF;
if (ue->high_speed_flag == 0)
@@ -690,7 +688,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
int re_offset = k;
#ifdef DEBUG_CH
- printf("PDSCH Channel Estimation : ThreadId %d, eNB_offset %d ch_offset %d, symbol_offset %d OFDM size %d, Ncp=%d, Ns=%d, k=%d symbol %d\n",proc->thread_id, eNB_offset,ch_offset,symbol_offset,ue->frame_parms.ofdm_symbol_size,
+ printf("PDSCH Channel Estimation : ThreadId %d, gNB_id %d ch_offset %d, symbol_offset %d OFDM size %d, Ncp=%d, Ns=%d, k=%d symbol %d\n",proc->thread_id, gNB_id,ch_offset,symbol_offset,ue->frame_parms.ofdm_symbol_size,
ue->frame_parms.Ncp,Ns,k, symbol);
#endif
@@ -699,19 +697,19 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
if (is_SI) {
rb_offset -= BWPStart;
}
- uint8_t config_type = ue->dmrs_DownlinkConfig.pdsch_dmrs_type;
+ uint8_t config_type = dlsch0_harq->dmrsConfigType;
int8_t delta = get_delta(p, config_type);
// checking if re-initialization of scrambling IDs is needed
- if ((ue->dmrs_DownlinkConfig.scramblingID0 != ue->scramblingID[0]) || (ue->dmrs_DownlinkConfig.scramblingID1 != ue->scramblingID[1])){
- ue->scramblingID[0]=ue->dmrs_DownlinkConfig.scramblingID0;
- ue->scramblingID[1]=ue->dmrs_DownlinkConfig.scramblingID1;
+ /*if ((XXX.scramblingID0 != ue->scramblingID[0]) || (XXX.scramblingID1 != ue->scramblingID[1])){
+ ue->scramblingID[0] = XXX.scramblingID0;
+ ue->scramblingID[1] = XXX.scramblingID1;
nr_gold_pdsch(ue,ue->scramblingID);
- }
+ }*/
- nr_pdsch_dmrs_rx(ue,Ns,ue->nr_gold_pdsch[eNB_offset][Ns][symbol][0], &pilot[0],1000+p,0,nb_rb_pdsch+rb_offset);
+ nr_pdsch_dmrs_rx(ue, Ns, ue->nr_gold_pdsch[gNB_id][Ns][symbol][0], &pilot[0], 1000+p, 0, nb_rb_pdsch+rb_offset, config_type);
- if (config_type == pdsch_dmrs_type1){
+ if (config_type == NFAPI_NR_DMRS_TYPE1){
nushift = (p>>1)&1;
if (p<4) ue->frame_parms.nushift = nushift;
switch (delta) {
@@ -751,7 +749,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
return -1;
break;
}
- } else {//pdsch_dmrs_type2
+ } else {//NFAPI_NR_DMRS_TYPE2
nushift = delta;
if (p<6) ue->frame_parms.nushift = nushift;
switch (delta) {
@@ -793,7 +791,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
}
for (aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) {
- pil = (int16_t *)&pilot[rb_offset*((config_type==pdsch_dmrs_type1) ? 6:4)];
+ pil = (int16_t *)&pilot[rb_offset*((config_type==NFAPI_NR_DMRS_TYPE1) ? 6:4)];
k = k % ue->frame_parms.ofdm_symbol_size;
re_offset = k;
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+re_offset+nushift)];
@@ -811,7 +809,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
printf("dl_ch addr %p nushift %d\n",dl_ch,nushift);
#endif
- if (config_type == pdsch_dmrs_type1) {
+ if (config_type == NFAPI_NR_DMRS_TYPE1) {
// Treat first 2 pilots specially (left edge)
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
@@ -944,11 +942,11 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
// check if PRB crosses DC and improve estimates around DC
if ((bwp_start_subcarrier < ue->frame_parms.ofdm_symbol_size) && (bwp_start_subcarrier+nb_rb_pdsch*12 >= ue->frame_parms.ofdm_symbol_size)) {
- dl_ch = (int16_t *)&dl_ch_estimates[aarx][ch_offset];
+ dl_ch = (int16_t *)&dl_ch_estimates[p*ue->frame_parms.nb_antennas_rx+aarx][ch_offset];
uint16_t idxDC = 2*(ue->frame_parms.ofdm_symbol_size - bwp_start_subcarrier);
uint16_t idxPil = idxDC/2;
re_offset = k;
- pil = (int16_t *)&pilot[rb_offset*((config_type==pdsch_dmrs_type1) ? 6:4)];
+ pil = (int16_t *)&pilot[rb_offset*((config_type==NFAPI_NR_DMRS_TYPE1) ? 6:4)];
pil += (idxPil-2);
dl_ch += (idxDC-4);
dl_ch = memset(dl_ch, 0, sizeof(int16_t)*10);
@@ -994,7 +992,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
8);
}
}
- } else { //pdsch_dmrs_type2 |dmrs_r,dmrs_l,0,0,0,0,dmrs_r,dmrs_l,0,0,0,0|
+ } else { //NFAPI_NR_DMRS_TYPE2 |dmrs_r,dmrs_l,0,0,0,0,dmrs_r,dmrs_l,0,0,0,0|
// Treat first 4 pilots specially (left edge)
ch_l[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
@@ -1224,16 +1222,15 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
*
* NAME : nr_pdsch_ptrs_processing
*
- * PARAMETERS : ue : ue data structure
+ * PARAMETERS : PHY_VARS_NR_UE : ue data structure
* NR_UE_PDSCH : pdsch_vars pointer
* NR_DL_FRAME_PARMS : frame_parms pointer
* NR_DL_UE_HARQ_t : dlsch0_harq pointer
* NR_DL_UE_HARQ_t : dlsch1_harq pointer
- * uint8_t : eNB_id,
+ * uint8_t : gNB_id,
* uint8_t : nr_slot_rx,
* unsigned char : symbol,
* uint32_t : nb_re_pdsch,
- * unsigned char : harq_pid
* uint16_t : rnti
* RX_type_t : rx_type
* RETURN : Nothing
@@ -1249,11 +1246,10 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
NR_DL_FRAME_PARMS *frame_parms,
NR_DL_UE_HARQ_t *dlsch0_harq,
NR_DL_UE_HARQ_t *dlsch1_harq,
- uint8_t eNB_id,
+ uint8_t gNB_id,
uint8_t nr_slot_rx,
unsigned char symbol,
uint32_t nb_re_pdsch,
- unsigned char harq_pid,
uint16_t rnti,
RX_type_t rx_type)
{
@@ -1284,7 +1280,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
ptrsSymbPos = &dlsch0_harq->ptrs_symbols;
ptrsSymbIdx = &dlsch0_harq->ptrs_symbol_index;
ptrsReOffset = &dlsch0_harq->PTRSReOffset;
- dmrsConfigType = &dlsch0_harq->ptrs_symbol_index;
+ dmrsConfigType = &dlsch0_harq->dmrsConfigType;
nb_rb = &dlsch0_harq->nb_rb;
}
if(dlsch1_harq) {
@@ -1297,13 +1293,13 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
ptrsSymbPos = &dlsch1_harq->ptrs_symbols;
ptrsSymbIdx = &dlsch1_harq->ptrs_symbol_index;
ptrsReOffset = &dlsch1_harq->PTRSReOffset;
- dmrsConfigType = &dlsch1_harq->ptrs_symbol_index;
+ dmrsConfigType = &dlsch1_harq->dmrsConfigType;
nb_rb = &dlsch1_harq->nb_rb;
}
/* loop over antennas */
for (int aarx=0; aarxnb_antennas_rx; aarx++) {
- phase_per_symbol = (int16_t*)pdsch_vars[eNB_id]->ptrs_phase_per_slot[aarx];
- ptrs_re_symbol = (int32_t*)pdsch_vars[eNB_id]->ptrs_re_per_slot[aarx];
+ phase_per_symbol = (int16_t*)pdsch_vars[gNB_id]->ptrs_phase_per_slot[aarx];
+ ptrs_re_symbol = (int32_t*)pdsch_vars[gNB_id]->ptrs_re_per_slot[aarx];
ptrs_re_symbol[symbol] = 0;
phase_per_symbol[(2*symbol)+1] = 0; // Imag
/* set DMRS estimates to 0 angle with magnitude 1 */
@@ -1337,11 +1333,11 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
/*------------------------------------------------------------------------------------------------------- */
nr_ptrs_cpe_estimation(*K_ptrs,*ptrsReOffset,*dmrsConfigType,*nb_rb,
rnti,
- (int16_t *)&pdsch_vars[eNB_id]->dl_ch_ptrs_estimates_ext[aarx][symbol*nb_re_pdsch],
+ (int16_t *)&pdsch_vars[gNB_id]->dl_ch_ptrs_estimates_ext[aarx][symbol*nb_re_pdsch],
nr_slot_rx,
symbol,frame_parms->ofdm_symbol_size,
- (int16_t*)&pdsch_vars[eNB_id]->rxdataF_comp0[aarx][(symbol * nb_re_pdsch)],
- ue->nr_gold_pdsch[eNB_id][nr_slot_rx][symbol][0],
+ (int16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(symbol * nb_re_pdsch)],
+ ue->nr_gold_pdsch[gNB_id][nr_slot_rx][symbol][0],
&phase_per_symbol[2* symbol],
&ptrs_re_symbol[symbol]);
}
@@ -1360,9 +1356,9 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
}
}
#ifdef DEBUG_DL_PTRS
- LOG_M("ptrsEst.m","est",pdsch_vars[eNB_id]->ptrs_phase_per_slot[aarx],frame_parms->symbols_per_slot,1,1 );
+ LOG_M("ptrsEst.m","est",pdsch_vars[gNB_id]->ptrs_phase_per_slot[aarx],frame_parms->symbols_per_slot,1,1 );
LOG_M("rxdataF_bf_ptrs_comp.m","bf_ptrs_cmp",
- &pdsch_vars[eNB_id]->rxdataF_comp0[aarx][(*startSymbIndex) * NR_NB_SC_PER_RB * (*nb_rb) ],
+ &pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(*startSymbIndex) * NR_NB_SC_PER_RB * (*nb_rb) ],
(*nb_rb) * NR_NB_SC_PER_RB * (*nbSymb),1,1);
#endif
/*------------------------------------------------------------------------------------------------------- */
@@ -1375,9 +1371,9 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
#ifdef DEBUG_DL_PTRS
printf("[PHY][DL][PTRS]: Rotate Symbol %2d with %d + j* %d\n", i, phase_per_symbol[2* i],phase_per_symbol[(2* i) +1]);
#endif
- rotate_cpx_vector((int16_t*)&pdsch_vars[eNB_id]->rxdataF_comp0[aarx][(i * (*nb_rb) * NR_NB_SC_PER_RB)],
+ rotate_cpx_vector((int16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(i * (*nb_rb) * NR_NB_SC_PER_RB)],
&phase_per_symbol[2* i],
- (int16_t*)&pdsch_vars[eNB_id]->rxdataF_comp0[aarx][(i * (*nb_rb) * NR_NB_SC_PER_RB)],
+ (int16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(i * (*nb_rb) * NR_NB_SC_PER_RB)],
((*nb_rb) * NR_NB_SC_PER_RB), 15);
}// if not DMRS Symbol
}// symbol loop
diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
index 1466fabe5d..c5330ce2f2 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
@@ -34,17 +34,14 @@
/*!
\brief This function performs channel estimation including frequency and temporal interpolation
-\param phy_vars_ue Pointer to UE PHY variables
-\param eNB_id Index of target eNB
-\param eNB_offset Offset for interfering eNB (in terms cell ID mod 3)
+\param ue Pointer to UE PHY variables
+\param gNB_id Index of target gNB
\param Ns slot number (0..19)
-\param p antenna port
-\param l symbol within slot
-\param symbol symbol within frame
+\param symbol symbol within slot
*/
int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
- uint8_t eNB_offset,
+ uint8_t gNB_id,
unsigned char Ns,
unsigned char symbol,
unsigned short coreset_start_subcarrier,
@@ -52,7 +49,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
- uint8_t eNB_offset,
+ uint8_t gNB_id,
unsigned char Ns,
unsigned char symbol,
int dmrss,
@@ -60,7 +57,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
- uint8_t eNB_offset,
+ uint8_t gNB_id,
unsigned char Ns,
unsigned char symbol,
int dmrss,
@@ -69,7 +66,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
- uint8_t eNB_offset,
+ uint8_t gNB_id,
bool is_SI,
unsigned char Ns,
unsigned short p,
@@ -80,7 +77,7 @@ 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 eNB_id,
+ module_id_t gNB_id,
uint8_t frame,
uint8_t subframe,
unsigned char clear,
@@ -102,7 +99,7 @@ void nr_ue_rrc_measurements(PHY_VARS_NR_UE *ue,
void phy_adjust_gain_nr(PHY_VARS_NR_UE *ue,
uint32_t rx_power_fil_dB,
- uint8_t eNB_id);
+ uint8_t gNB_id);
int16_t get_nr_PL(uint8_t Mod_id, uint8_t CC_id, uint8_t gNB_index);
@@ -111,11 +108,10 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
NR_DL_FRAME_PARMS *frame_parms,
NR_DL_UE_HARQ_t *dlsch0_harq,
NR_DL_UE_HARQ_t *dlsch1_harq,
- uint8_t eNB_id,
+ uint8_t gNB_id,
uint8_t nr_slot_rx,
unsigned char symbol,
uint32_t nb_re_pdsch,
- unsigned char harq_pid,
uint16_t rnti,
RX_type_t rx_type);
diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c b/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
index 3f52b29281..44f1844ae9 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
@@ -180,11 +180,11 @@ void nr_ue_measurements(PHY_VARS_NR_UE *ue,
ue->measurements.wideband_cqi_avg[gNB_id] = dB_fixed2(ue->measurements.rx_power_avg[gNB_id], ue->measurements.n0_power_avg);
ue->measurements.rx_rssi_dBm[gNB_id] = ue->measurements.rx_power_avg_dB[gNB_id] + 30 - 10*log10(pow(2, 30)) - ((int)openair0_cfg[0].rx_gain[0] - (int)openair0_cfg[0].rx_gain_offset[0]) - dB_fixed(ue->frame_parms.ofdm_symbol_size);
- LOG_I(PHY, "[gNB %d] Slot %d, RSSI %d dBm/RE, RSSI (digital) %d dB, WBandCQI %d dB, rxPwrAvg %d, n0PwrAvg %d \n",
+ LOG_D(PHY, "[gNB %d] Slot %d, RSSI %d dB (%d dBm/RE), WBandCQI %d dB, rxPwrAvg %d, n0PwrAvg %d\n",
gNB_id,
slot,
- ue->measurements.rx_rssi_dBm[gNB_id],
ue->measurements.rx_power_avg_dB[gNB_id],
+ ue->measurements.rx_rssi_dBm[gNB_id],
ue->measurements.wideband_cqi_avg[gNB_id],
ue->measurements.rx_power_avg[gNB_id],
ue->measurements.n0_power_tot);
diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
index 27bc569517..cffdf5092d 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
@@ -142,7 +142,7 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
if (reg_bundle_size_L != 0) { // interleaving will be done only if reg_bundle_size_L != 0
coreset_interleaved = 1;
- coreset_C = (uint32_t) ((coreset_nbr_rb * coreset_time_dur) / (coreset_interleaver_size_R * reg_bundle_size_L));
+ coreset_C = (uint32_t) (coreset_nbr_rb / (coreset_interleaver_size_R * reg_bundle_size_L));
} else {
reg_bundle_size_L = 6;
}
@@ -150,7 +150,7 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
int f_bundle_j_list[NR_MAX_PDCCH_AGG_LEVEL] = {};
- for (int reg = 0; reg < ((coreset_nbr_rb * coreset_time_dur)); reg++) {
+ for (int reg = 0; reg < coreset_nbr_rb; reg++) {
if ((reg % reg_bundle_size_L) == 0) {
if (r == coreset_interleaver_size_R) {
r = 0;
@@ -158,7 +158,7 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
}
bundle_j = (c * coreset_interleaver_size_R) + r;
- f_bundle_j = ((r * coreset_C) + c + n_shift) % ((coreset_nbr_rb * coreset_time_dur) / reg_bundle_size_L);
+ f_bundle_j = ((r * coreset_C) + c + n_shift) % (coreset_nbr_rb / reg_bundle_size_L);
if (coreset_interleaved == 0) f_bundle_j = bundle_j;
@@ -184,22 +184,28 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
}
}
- for(int reg=0; reg<((coreset_nbr_rb*coreset_time_dur)); reg++) {
+ int rb = 0;
+ for (int c_id = 0; c_id < number_of_candidates; c_id++ ) {
+ for (int symbol_idx = 0; symbol_idx < coreset_time_dur; symbol_idx++) {
+ for (int cce_count = CCE[c_id/coreset_time_dur]+c_id%coreset_time_dur; cce_count < CCE[c_id/coreset_time_dur]+c_id%coreset_time_dur+L[c_id]; cce_count += coreset_time_dur) {
+ for (int reg_in_cce_idx = 0; reg_in_cce_idx < NR_NB_REG_PER_CCE; reg_in_cce_idx++) {
- f_reg = (f_bundle_j_list_ord[reg/6]*reg_bundle_size_L)+(reg%reg_bundle_size_L);
- index_z = 9*reg;
- index_llr = 9*((uint16_t)floor(f_reg/coreset_time_dur)+((f_reg%coreset_time_dur)*(coreset_nbr_rb)));
+ f_reg = (f_bundle_j_list_ord[cce_count] * reg_bundle_size_L) + reg_in_cce_idx;
+ index_z = 9 * rb;
+ index_llr = (uint16_t) (f_reg + symbol_idx * coreset_nbr_rb) * 9;
- for (int i=0; i<9; i++) {
- z[index_z + i] = llr[index_llr + i];
+ for (int i = 0; i < 9; i++) {
+ z[index_z + i] = llr[index_llr + i];
#ifdef NR_PDCCH_DCI_DEBUG
- LOG_D(PHY,"[reg=%d,bundle_j=%d] z[%d]=(%d,%d) <-> \t[f_reg=%d,fbundle_j=%d] llr[%d]=(%d,%d) \n",
- reg,bundle_j,(index_z + i),*(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i]),
- f_reg,f_bundle_j,(index_llr + i),*(int16_t *) &llr[index_llr + i], *(1 + (int16_t *) &llr[index_llr + i]));
+ LOG_I(PHY,"[cce_count=%d,reg_in_cce_idx=%d,bundle_j=%d,symbol_idx=%d,candidate=%d] z[%d]=(%d,%d) <-> \t[f_reg=%d,fbundle_j=%d] llr[%d]=(%d,%d) \n",
+ cce_count,reg_in_cce_idx,bundle_j,symbol_idx,c_id,(index_z + i),*(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i]),
+ f_reg,f_bundle_j,(index_llr + i),*(int16_t *) &llr[index_llr + i], *(1 + (int16_t *) &llr[index_llr + i]));
#endif
+ }
+ rb++;
+ }
+ }
}
-
- if ((reg%reg_bundle_size_L) == 0) r++;
}
}
@@ -726,8 +732,10 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
rel15 = &pdcch_vars->pdcch_config[i];
int n_rb,rb_offset;
get_coreset_rballoc(rel15->coreset.frequency_domain_resource,&n_rb,&rb_offset);
+
LOG_D(PHY,"pdcch coreset: freq %x, n_rb %d, rb_offset %d\n",
- rel15->coreset.frequency_domain_resource[0],n_rb,rb_offset);
+ rel15->coreset.frequency_domain_resource[0],n_rb,rb_offset);
+
for (int s=rel15->coreset.StartSymbolIndex; s<(rel15->coreset.StartSymbolIndex+rel15->coreset.duration); s++) {
LOG_D(PHY,"in nr_pdcch_extract_rbs_single(rxdataF -> rxdataF_ext || dl_ch_estimates -> dl_ch_estimates_ext)\n");
@@ -753,7 +761,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++)
avgs = cmax(avgs, avgP[aarx]);
- log2_maxh = (log2_approx(avgs) / 2) + 5; //+frame_parms->nb_antennas_rx;
+ log2_maxh = (log2_approx(avgs) / 2) + 1; //+frame_parms->nb_antennas_rx;
#ifdef UE_DEBUG_TRACE
LOG_D(PHY,"slot %d: pdcch log2_maxh = %d (%d,%d)\n",slot,log2_maxh,avgP[0],avgs);
#endif
@@ -886,6 +894,33 @@ void nr_pdcch_unscrambling(int16_t *z,
#ifdef NR_PDCCH_DCI_RUN
+/* This function compares the received DCI bits with
+ * re-encoded DCI bits and returns the number of mismatched bits
+ */
+uint16_t nr_dci_false_detection(uint64_t *dci,
+ int16_t *soft_in,
+ const t_nrPolar_params *polar_param,
+ int encoded_length,
+ int rnti) {
+
+ uint32_t encoder_output[NR_MAX_DCI_SIZE_DWORD];
+ polar_encoder_fast(dci, (void*)encoder_output, rnti, 1, (t_nrPolar_params *)polar_param);
+ uint8_t *enout_p = (uint8_t*)encoder_output;
+ uint16_t x = 0;
+
+ for (int i=0; i> 15 ) & 1);
+ x += ( ( enout_p[i] >> 1 ) & 1 ) ^ ( ( soft_in[i*8+1] >> 15 ) & 1 );
+ x += ( ( enout_p[i] >> 2 ) & 1 ) ^ ( ( soft_in[i*8+2] >> 15 ) & 1 );
+ x += ( ( enout_p[i] >> 3 ) & 1 ) ^ ( ( soft_in[i*8+3] >> 15 ) & 1 );
+ x += ( ( enout_p[i] >> 4 ) & 1 ) ^ ( ( soft_in[i*8+4] >> 15 ) & 1 );
+ x += ( ( enout_p[i] >> 5 ) & 1 ) ^ ( ( soft_in[i*8+5] >> 15 ) & 1 );
+ x += ( ( enout_p[i] >> 6 ) & 1 ) ^ ( ( soft_in[i*8+6] >> 15 ) & 1 );
+ x += ( ( enout_p[i] >> 7 ) & 1 ) ^ ( ( soft_in[i*8+7] >> 15 ) & 1 );
+ }
+ return x;
+}
+
uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
fapi_nr_dci_indication_t *dci_ind) {
@@ -928,19 +963,27 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
currentPtrDCI);
n_rnti = rel15->rnti;
- LOG_D(PHY, "(%i.%i) dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d)\n", proc->frame_rx, proc->nr_slot_rx,n_rnti,nr_dci_format_string[rel15->dci_format_options[k]],CCEind,dci_length);
+ LOG_D(PHY, "(%i.%i) dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d)\n", proc->frame_rx, proc->nr_slot_rx,n_rnti,nr_dci_format_string[rel15->dci_format_options[k]],CCEind,dci_length);
if (crc == n_rnti) {
LOG_D(PHY, "(%i.%i) Received dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d,payload %llx)\n",
proc->frame_rx, proc->nr_slot_rx,n_rnti,nr_dci_format_string[rel15->dci_format_options[k]],CCEind,dci_length,*(unsigned long long*)dci_estimation);
- dci_ind->SFN = proc->frame_rx;
- dci_ind->slot = proc->nr_slot_rx;
- dci_ind->dci_list[dci_ind->number_of_dcis].rnti = n_rnti;
- dci_ind->dci_list[dci_ind->number_of_dcis].n_CCE = CCEind;
- dci_ind->dci_list[dci_ind->number_of_dcis].dci_format = rel15->dci_format_options[k];
- dci_ind->dci_list[dci_ind->number_of_dcis].payloadSize = dci_length;
- memcpy((void*)dci_ind->dci_list[dci_ind->number_of_dcis].payloadBits,(void*)dci_estimation,8);
- dci_ind->number_of_dcis++;
- break; // If DCI is found, no need to check for remaining DCI lengths
+ uint16_t mb = nr_dci_false_detection(dci_estimation,tmp_e,currentPtrDCI,L*108,n_rnti);
+ ue->dci_thres = (ue->dci_thres + mb) / 2;
+ if (mb > (ue->dci_thres+20)) {
+ LOG_W(PHY,"DCI false positive. Dropping DCI index %d. Mismatched bits: %d/%d. Current DCI threshold: %d\n",j,mb,L*108,ue->dci_thres);
+ continue;
+ }
+ else {
+ dci_ind->SFN = proc->frame_rx;
+ dci_ind->slot = proc->nr_slot_rx;
+ dci_ind->dci_list[dci_ind->number_of_dcis].rnti = n_rnti;
+ dci_ind->dci_list[dci_ind->number_of_dcis].n_CCE = CCEind;
+ dci_ind->dci_list[dci_ind->number_of_dcis].dci_format = rel15->dci_format_options[k];
+ dci_ind->dci_list[dci_ind->number_of_dcis].payloadSize = dci_length;
+ memcpy((void*)dci_ind->dci_list[dci_ind->number_of_dcis].payloadBits,(void*)dci_estimation,8);
+ dci_ind->number_of_dcis++;
+ break; // If DCI is found, no need to check for remaining DCI lengths
+ }
} else {
LOG_D(PHY,"(%i.%i) Decoded crc %x does not match rnti %x for DCI format %d\n", proc->frame_rx, proc->nr_slot_rx, crc, n_rnti, rel15->dci_format_options[k]);
}
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
index 5d98d8dd8f..4f6871ca4f 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
@@ -587,10 +587,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
ret = no_iteration_ldpc;
}
else {
- LOG_D(PHY,"CRC NOT OK\n\033[0m"); /*
- ret = 1 + dlsch->max_ldpc_iterations;
- dump_nrdlsch(phy_vars_ue,0,nr_slot_rx,&E,0,0);
- exit(-1);*/
+ LOG_D(PHY,"CRC NOT OK\n\033[0m");
}
@@ -704,7 +701,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_COMBINE_SEG, VCD_FUNCTION_OUT);
dlsch->last_iteration_cnt = ret;
- // log_dump(PHY, harq_process->b, 60, LOG_DUMP_CHAR,"nrue pdsch rx frame %d %d: ", frame, nr_slot_rx );
return(ret);
}
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
index 9fe53570a7..2174f569da 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
@@ -84,8 +84,8 @@ unsigned char offset_mumimo_llr_drange[29][3]={{8,8,8},{7,7,7},{7,7,7},{7,7,7},{
*/
//unsigned char offset_mumimo_llr_drange[29][3]= {{0, 6, 5},{0, 4, 5},{0, 4, 5},{0, 5, 4},{0, 5, 6},{0, 5, 3},{0, 4, 4},{0, 4, 4},{0, 3, 3},{0, 1, 2},{1, 1, 0},{1, 3, 2},{3, 4, 1},{2, 0, 0},{2, 2, 2},{1, 1, 1},{2, 1, 0},{2, 1, 1},{1, 0, 1},{1, 0, 1},{0, 0, 0},{1, 0, 0},{0, 0, 0},{0, 1, 0},{1, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0}};
-#define print_ints(s,x) printf("%s %d %d %d %d\n",s,(x)[0],(x)[1],(x)[2],(x)[3])
-#define print_shorts(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7])
+#define print_ints(s,x) printf("%s = %d %d %d %d\n",s,(x)[0],(x)[1],(x)[2],(x)[3])
+#define print_shorts(s,x) printf("%s = [%d+j*%d, %d+j*%d, %d+j*%d, %d+j*%d]\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7])
static void nr_dlsch_dual_stream_correlation_core(int **dl_ch_estimates_ext,
int **dl_ch_estimates_ext_i,
@@ -99,17 +99,21 @@ static void nr_dlsch_dual_stream_correlation_core(int **dl_ch_estimates_ext,
uint8_t nr_zero_forcing_rx_2layers(int **rxdataF_comp,
int **dl_ch_mag,
int **dl_ch_magb,
+ int **dl_ch_magr,
int **dl_ch_estimates_ext,
unsigned short nb_rb,
unsigned char n_rx,
unsigned char mod_order,
int shift,
- unsigned char symbol);
+ unsigned char symbol,
+ int length);
static void nr_dlsch_layer_demapping(int16_t **llr_cw,
uint8_t Nl,
uint8_t mod_order,
- uint16_t length,
+ uint32_t length,
+ int32_t codeword_TB0,
+ int32_t codeword_TB1,
int16_t **llr_layers);
@@ -182,8 +186,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
//int16_t *pllr_symbol_cw0_deint;
//int16_t *pllr_symbol_cw1_deint;
//uint16_t bundle_L = 2;
- uint8_t pilots=0;
- uint8_t config_type;// We should not use ue->dmrs_DownlinkConfig.pdsch_dmrs_type;
uint16_t n_tx=1, n_rx=1;
int32_t median[16];
uint32_t len;
@@ -340,8 +342,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
printf("Demod dlsch0_harq->pmi_alloc %d\n", dlsch0_harq->pmi_alloc);
#endif
- pilots = ((1<dlDmrsSymbPos)>0 ? 1 : 0;
- config_type = dlsch0_harq->dmrsConfigType;
+ uint8_t pilots = (dlsch0_harq->dlDmrsSymbPos >> symbol) & 1;
+ uint8_t config_type = dlsch0_harq->dmrsConfigType;
if (beamforming_mode==0) {//No beamforming
#if UE_TIMING_TRACE
@@ -385,7 +387,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
return(-1);
}
- len = (pilots==1)? ((config_type==pdsch_dmrs_type1)?nb_rb*(12-6*dlsch0_harq->n_dmrs_cdm_groups): nb_rb*(12-4*dlsch0_harq->n_dmrs_cdm_groups)):(nb_rb*12);
+ len = (pilots==1)? ((config_type==NFAPI_NR_DMRS_TYPE1)?nb_rb*(12-6*dlsch0_harq->n_dmrs_cdm_groups): nb_rb*(12-4*dlsch0_harq->n_dmrs_cdm_groups)):(nb_rb*12);
#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
@@ -412,7 +414,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
symbol,
pilots,
len,
- nb_rb);
+ nb_rb_pdsch);
#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
@@ -434,7 +436,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
avg,
symbol,
len,
- nb_rb);
+ nb_rb_pdsch);
avgs = 0;
for (aatx=0;aatxnb_antennas_rx)+aarx] = avg[(aatx*frame_parms->nb_antennas_rx)+aarx];
}
- pdsch_vars[gNB_id]->log2_maxh = (log2_approx(avgs)/2)+3;
+ pdsch_vars[gNB_id]->log2_maxh = (log2_approx(avgs)/2) + 1;
//LOG_I(PHY, "avgs Power per SC is %d lg2_maxh %d\n", avgs, pdsch_vars[gNB_id]->log2_maxh);
if (dlsch0_harq->mimo_mode == NR_DUALSTREAM) {
@@ -505,10 +507,10 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
frame_parms,
n_tx,
symbol,
- pilots,
+ len,
first_symbol_flag,
dlsch0_harq->Qm,
- nb_rb,
+ nb_rb_pdsch,
pdsch_vars[gNB_id]->log2_maxh,
measurements); // log2_maxh+I0_shift
}
@@ -556,20 +558,24 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
(n_tx>1)? pdsch_vars[gNB_id]->rho : NULL,
pdsch_vars[gNB_id]->dl_ch_mag0,
pdsch_vars[gNB_id]->dl_ch_magb0,
+ pdsch_vars[gNB_id]->dl_ch_magr0,
n_tx,
n_rx,
symbol,
- nb_rb);
+ nb_rb_pdsch,
+ len);
if (n_tx == 2)//Apply zero forcing for 2 Tx layers
nr_zero_forcing_rx_2layers(pdsch_vars[gNB_id]->rxdataF_comp0,
pdsch_vars[gNB_id]->dl_ch_mag0,
pdsch_vars[gNB_id]->dl_ch_magb0,
+ pdsch_vars[gNB_id]->dl_ch_magr0,
pdsch_vars[gNB_id]->dl_ch_estimates_ext,
- nb_rb,
+ nb_rb_pdsch,
n_rx,
dlsch0_harq->Qm,
pdsch_vars[gNB_id]->log2_maxh,
- symbol);
+ symbol,
+ len);
}
else if (dlsch0_harq->mimo_mode == NR_DUALSTREAM) {
nr_dlsch_detection_mrc_core(pdsch_vars[gNB_id]->rxdataF_comp0,
@@ -635,14 +641,13 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
nr_slot_rx,
symbol,
(nb_rb*12),
- harq_pid,
dlsch[0]->rnti,rx_type);
pdsch_vars[gNB_id]->dl_valid_re[symbol-1] -= pdsch_vars[gNB_id]->ptrs_re_per_slot[0][symbol];
}
/* at last symbol in a slot calculate LLR's for whole slot */
if(symbol == (startSymbIdx + nbSymb -1)) {
- for(uint8_t i =startSymbIdx; i <= nbSymb;i++) {
+ for(uint8_t i =startSymbIdx; i < (startSymbIdx+nbSymb);i++) {
/* re evaluating the first symbol flag as LLR's are done in symbol loop */
if(i == startSymbIdx && i < 3) {
first_symbol_flag =1;
@@ -662,16 +667,29 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
pdsch_vars[gNB_id]->dl_valid_re[i-1],
nr_slot_rx, beamforming_mode);
}
- }
- //nr_dlsch_deinterleaving(symbol,bundle_L,(int16_t*)pllr_symbol_cw0,(int16_t*)pllr_symbol_cw0_deint, nb_rb_pdsch);
-
- if (rx_type==rx_IC_dual_stream) {
+ int dmrs_type = dlsch[0]->harq_processes[harq_pid]->dmrsConfigType;
+ uint8_t nb_re_dmrs;
+ uint16_t dmrs_len = get_num_dmrs(dlsch[0]->harq_processes[harq_pid]->dlDmrsSymbPos);
+ if (dmrs_type==NFAPI_NR_DMRS_TYPE1) {
+ nb_re_dmrs = 6*dlsch[0]->harq_processes[harq_pid]->n_dmrs_cdm_groups;
+ } else {
+ nb_re_dmrs = 4*dlsch[0]->harq_processes[harq_pid]->n_dmrs_cdm_groups;
+ }
+ dlsch[0]->harq_processes[harq_pid]->G = nr_get_G(dlsch[0]->harq_processes[harq_pid]->nb_rb,
+ dlsch[0]->harq_processes[harq_pid]->nb_symbols,
+ nb_re_dmrs,
+ dmrs_len,
+ dlsch[0]->harq_processes[harq_pid]->Qm,
+ dlsch[0]->harq_processes[harq_pid]->Nl);
nr_dlsch_layer_demapping(pdsch_vars[gNB_id]->llr,
dlsch[0]->harq_processes[harq_pid]->Nl,
dlsch[0]->harq_processes[harq_pid]->Qm,
dlsch[0]->harq_processes[harq_pid]->G,
+ codeword_TB0,
+ codeword_TB1,
pdsch_vars[gNB_id]->layer_llr);
+
}
#if UE_TIMING_TRACE
@@ -780,7 +798,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
NR_DL_FRAME_PARMS *frame_parms,
uint8_t nb_aatx,
unsigned char symbol,
- uint8_t pilots,
+ int length,
uint8_t first_symbol_flag,
unsigned char mod_order,
unsigned short nb_rb,
@@ -794,8 +812,8 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
unsigned char aatx,aarx,atx;
__m128i *dl_ch128,*dl_ch128_2,*dl_ch_mag128,*dl_ch_mag128b,*dl_ch_mag128r,*rxdataF128,*rxdataF_comp128,*rho128;
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b,QAM_amp128r;
- QAM_amp128b = _mm_setzero_si128();
+ uint32_t nb_rb_0 = length/12 + ((length%12)?1:0);
for (aatx=0; aatxnb_antennas_rx)+aarx][symbol*nb_rb*12];
- for (rb=0; rb2) {
// get channel amplitude if not QPSK
@@ -832,7 +850,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
mmtmpD1 = _mm_madd_epi16(dl_ch128[1],dl_ch128[1]);
mmtmpD1 = _mm_srai_epi32(mmtmpD1,output_shift);
- mmtmpD0 = _mm_packs_epi32(mmtmpD0,mmtmpD1);
+ mmtmpD0 = _mm_packs_epi32(mmtmpD0,mmtmpD1); //|H[0]|^2 |H[1]|^2 |H[2]|^2 |H[3]|^2 |H[4]|^2 |H[5]|^2 |H[6]|^2 |H[7]|^2
// store channel magnitude here in a new field of dlsch
@@ -841,6 +859,13 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
dl_ch_mag128r[0] = dl_ch_mag128[0];
dl_ch_mag128[0] = _mm_mulhi_epi16(dl_ch_mag128[0],QAM_amp128);
dl_ch_mag128[0] = _mm_slli_epi16(dl_ch_mag128[0],1);
+
+ dl_ch_mag128b[0] = _mm_mulhi_epi16(dl_ch_mag128b[0],QAM_amp128b);
+ dl_ch_mag128b[0] = _mm_slli_epi16(dl_ch_mag128b[0],1);
+
+ dl_ch_mag128r[0] = _mm_mulhi_epi16(dl_ch_mag128r[0],QAM_amp128r);
+ dl_ch_mag128r[0] = _mm_slli_epi16(dl_ch_mag128r[0],1);
+
//print_ints("Re(ch):",(int16_t*)&mmtmpD0);
//print_shorts("QAM_amp:",(int16_t*)&QAM_amp128);
//print_shorts("mag:",(int16_t*)&dl_ch_mag128[0]);
@@ -850,39 +875,28 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
dl_ch_mag128[1] = _mm_mulhi_epi16(dl_ch_mag128[1],QAM_amp128);
dl_ch_mag128[1] = _mm_slli_epi16(dl_ch_mag128[1],1);
- if (pilots==0) {
- mmtmpD0 = _mm_madd_epi16(dl_ch128[2],dl_ch128[2]);
- mmtmpD0 = _mm_srai_epi32(mmtmpD0,output_shift);
- mmtmpD1 = _mm_packs_epi32(mmtmpD0,mmtmpD0);
-
- dl_ch_mag128[2] = _mm_unpacklo_epi16(mmtmpD1,mmtmpD1);
- dl_ch_mag128b[2] = dl_ch_mag128[2];
- dl_ch_mag128r[2] = dl_ch_mag128[2];
-
- dl_ch_mag128[2] = _mm_mulhi_epi16(dl_ch_mag128[2],QAM_amp128);
- dl_ch_mag128[2] = _mm_slli_epi16(dl_ch_mag128[2],1);
- }
-
- dl_ch_mag128b[0] = _mm_mulhi_epi16(dl_ch_mag128b[0],QAM_amp128b);
- dl_ch_mag128b[0] = _mm_slli_epi16(dl_ch_mag128b[0],1);
-
-
dl_ch_mag128b[1] = _mm_mulhi_epi16(dl_ch_mag128b[1],QAM_amp128b);
dl_ch_mag128b[1] = _mm_slli_epi16(dl_ch_mag128b[1],1);
- dl_ch_mag128r[0] = _mm_mulhi_epi16(dl_ch_mag128r[0],QAM_amp128r);
- dl_ch_mag128r[0] = _mm_slli_epi16(dl_ch_mag128r[0],1);
-
dl_ch_mag128r[1] = _mm_mulhi_epi16(dl_ch_mag128r[1],QAM_amp128r);
dl_ch_mag128r[1] = _mm_slli_epi16(dl_ch_mag128r[1],1);
- if (pilots==0) {
- dl_ch_mag128b[2] = _mm_mulhi_epi16(dl_ch_mag128b[2],QAM_amp128b);
- dl_ch_mag128b[2] = _mm_slli_epi16(dl_ch_mag128b[2],1);
+ mmtmpD0 = _mm_madd_epi16(dl_ch128[2],dl_ch128[2]);//[H_I(0)^2+H_Q(0)^2 H_I(1)^2+H_Q(1)^2 H_I(2)^2+H_Q(2)^2 H_I(3)^2+H_Q(3)^2]
+ mmtmpD0 = _mm_srai_epi32(mmtmpD0,output_shift);
+ mmtmpD1 = _mm_packs_epi32(mmtmpD0,mmtmpD0);//[|H(0)|^2 |H(1)|^2 |H(2)|^2 |H(3)|^2 |H(0)|^2 |H(1)|^2 |H(2)|^2 |H(3)|^2]
- dl_ch_mag128r[2] = _mm_mulhi_epi16(dl_ch_mag128r[2],QAM_amp128r);
- dl_ch_mag128r[2] = _mm_slli_epi16(dl_ch_mag128r[2],1);
- }
+ dl_ch_mag128[2] = _mm_unpacklo_epi16(mmtmpD1,mmtmpD1);//[|H(0)|^2 |H(0)|^2 |H(1)|^2 |H(1)|^2 |H(2)|^2 |H(2)|^2 |H(3)|^2 |H(3)|^2]
+ dl_ch_mag128b[2] = dl_ch_mag128[2];
+ dl_ch_mag128r[2] = dl_ch_mag128[2];
+
+ dl_ch_mag128[2] = _mm_mulhi_epi16(dl_ch_mag128[2],QAM_amp128);
+ dl_ch_mag128[2] = _mm_slli_epi16(dl_ch_mag128[2],1);
+
+ dl_ch_mag128b[2] = _mm_mulhi_epi16(dl_ch_mag128b[2],QAM_amp128b);
+ dl_ch_mag128b[2] = _mm_slli_epi16(dl_ch_mag128b[2],1);
+
+ dl_ch_mag128r[2] = _mm_mulhi_epi16(dl_ch_mag128r[2],QAM_amp128r);
+ dl_ch_mag128r[2] = _mm_slli_epi16(dl_ch_mag128r[2],1);
}
// multiply by conjugated channel
@@ -905,15 +919,17 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
// print_ints("c0",&mmtmpD2);
// print_ints("c1",&mmtmpD3);
rxdataF_comp128[0] = _mm_packs_epi32(mmtmpD2,mmtmpD3);
- //printf("arx%d atx%d rb_index %d symbol%d\n",aarx,aatx,rb,symbol);
- // print_shorts("rx:",rxdataF128);
- // print_shorts("ch:",dl_ch128);
- // print_shorts("pack:",rxdataF_comp128);
- //printf("arx%d atx%d rb_index %d symbol%d\n",aarx,aatx,rb,symbol);
- //print_shorts("rx:",(int16_t*)&rxdataF128[0]);
- //print_shorts("ch:",(int16_t*)&dl_ch128[0]);
- //print_shorts("pack:",(int16_t*)&rxdataF_comp128[0]);
+#ifdef DEBUG_DLSCH_DEMOD
+ printf("%%arx%d atx%d rb_index %d symbol %d shift %d\n",aarx,aatx,rb,symbol,output_shift);
+ printf("rx_%d(%d,:)",aarx+1,rb+1);
+ print_shorts(" ",(int16_t *)&rxdataF128[0]);
+ printf("ch_%d%d(%d,:)",aarx+1,aatx+1,rb+1);
+ print_shorts(" ",(int16_t *)&dl_ch128[0]);
+ printf("rx_comp_%d%d(%d,:)",aarx+1,aatx+1,rb+1);
+ print_shorts(" ",(int16_t *)&rxdataF_comp128[0]);
+#endif
+
// multiply by conjugated channel
mmtmpD0 = _mm_madd_epi16(dl_ch128[1],rxdataF128[1]);
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
@@ -932,40 +948,30 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
//print_shorts("ch:",(int16_t*)&dl_ch128[1]);
//print_shorts("pack:",(int16_t*)&rxdataF_comp128[1]);
- if (pilots==0) {
- // multiply by conjugated channel
- mmtmpD0 = _mm_madd_epi16(dl_ch128[2],rxdataF128[2]);
- // mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
- mmtmpD1 = _mm_shufflelo_epi16(dl_ch128[2],_MM_SHUFFLE(2,3,0,1));
- mmtmpD1 = _mm_shufflehi_epi16(mmtmpD1,_MM_SHUFFLE(2,3,0,1));
- mmtmpD1 = _mm_sign_epi16(mmtmpD1,*(__m128i*)conjugate);
- mmtmpD1 = _mm_madd_epi16(mmtmpD1,rxdataF128[2]);
- // mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
- mmtmpD0 = _mm_srai_epi32(mmtmpD0,output_shift);
- mmtmpD1 = _mm_srai_epi32(mmtmpD1,output_shift);
- mmtmpD2 = _mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
- mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
+ // multiply by conjugated channel
+ mmtmpD0 = _mm_madd_epi16(dl_ch128[2],rxdataF128[2]);
+ // mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
+ mmtmpD1 = _mm_shufflelo_epi16(dl_ch128[2],_MM_SHUFFLE(2,3,0,1));
+ mmtmpD1 = _mm_shufflehi_epi16(mmtmpD1,_MM_SHUFFLE(2,3,0,1));
+ mmtmpD1 = _mm_sign_epi16(mmtmpD1,*(__m128i*)conjugate);
+ mmtmpD1 = _mm_madd_epi16(mmtmpD1,rxdataF128[2]);
+ // mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
+ mmtmpD0 = _mm_srai_epi32(mmtmpD0,output_shift);
+ mmtmpD1 = _mm_srai_epi32(mmtmpD1,output_shift);
+ mmtmpD2 = _mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
+ mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
- rxdataF_comp128[2] = _mm_packs_epi32(mmtmpD2,mmtmpD3);
- //print_shorts("rx:",(int16_t*)&rxdataF128[2]);
- //print_shorts("ch:",(int16_t*)&dl_ch128[2]);
- //print_shorts("pack:",(int16_t*)&rxdataF_comp128[2]);
+ rxdataF_comp128[2] = _mm_packs_epi32(mmtmpD2,mmtmpD3);
+ //print_shorts("rx:",(int16_t*)&rxdataF128[2]);
+ //print_shorts("ch:",(int16_t*)&dl_ch128[2]);
+ //print_shorts("pack:",(int16_t*)&rxdataF_comp128[2]);
- dl_ch128+=3;
- dl_ch_mag128+=3;
- dl_ch_mag128b+=3;
- dl_ch_mag128r+=3;
- rxdataF128+=3;
- rxdataF_comp128+=3;
- }
- else { // we have a smaller PDSCH in symbols with pilots so skip last group of 4 REs and increment less
- dl_ch128+=2;
- dl_ch_mag128+=2;
- dl_ch_mag128b+=2;
- dl_ch_mag128r+=2;
- rxdataF128+=2;
- rxdataF_comp128+=2;
- }
+ dl_ch128+=3;
+ dl_ch_mag128+=3;
+ dl_ch_mag128b+=3;
+ dl_ch_mag128r+=3;
+ rxdataF128+=3;
+ rxdataF_comp128+=3;
}
}
}
@@ -989,7 +995,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
rho128 = (__m128i *)&rho[aarx][aatx*nb_aatx+atx][symbol*nb_rb*12];
dl_ch128_2 = (__m128i *)&dl_ch_estimates_ext[atx*frame_parms->nb_antennas_rx+aarx][symbol*nb_rb*12];
- for (rb=0; rbrx_correlation[0][0][aarx] = signal_energy(&rho[aarx][aatx*nb_aatx+atx][symbol*nb_rb*12],rb*12);
avg_rho_re[aarx][aatx*nb_aatx+atx] = 16*avg_rho_re[aarx][aatx*nb_aatx+atx]/(nb_rb*12);
avg_rho_im[aarx][aatx*nb_aatx+atx] = 16*avg_rho_im[aarx][aatx*nb_aatx+atx]/(nb_rb*12);
- printf("rho[rx]%d tx%d tx%d = Re: %d Im: %d\n",aarx, aatx,atx, avg_rho_re[aarx][aatx*nb_aatx+atx], avg_rho_im[aarx][aatx*nb_aatx+atx]);
+ //printf("rho[rx]%d tx%d tx%d = Re: %d Im: %d\n",aarx, aatx,atx, avg_rho_re[aarx][aatx*nb_aatx+atx], avg_rho_im[aarx][aatx*nb_aatx+atx]);
}
}
}
@@ -1097,7 +1103,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
#elif defined(__arm__)
unsigned short rb;
- unsigned char aatx,aarx,symbol_mod,pilots=0;
+ unsigned char aatx,aarx,symbol_mod;
int16x4_t *dl_ch128,*dl_ch128_2,*rxdataF128;
int32x4_t mmtmpD0,mmtmpD1,mmtmpD0b,mmtmpD1b;
@@ -1110,14 +1116,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
- if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp))) {
- if (frame_parms->nb_antenna_ports_gNB==1) { // 10 out of 12 so don't reduce size
- nb_rb=1+(5*nb_rb/6);
- }
- else {
- pilots=1;
- }
- }
+ uint32_t nb_rb_0 = length/12 + ((length%12)?1:0);
for (aatx=0; aatxnb_antenna_ports_gNB; aatx++) {
if (mod_order == 4) {
@@ -1136,7 +1135,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
rxdataF128 = (int16x4_t*)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12];
rxdataF_comp128 = (int16x4x2_t*)&rxdataF_comp[(aatx<<1)+aarx][symbol*frame_parms->N_RB_DL*12];
- for (rb=0; rb2) {
// get channel amplitude if not QPSK
mmtmpD0 = vmull_s16(dl_ch128[0], dl_ch128[0]);
@@ -1152,23 +1151,20 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
mmtmpD1 = vmull_s16(dl_ch128[3], dl_ch128[3]);
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),output_shift128);
mmtmpD3 = vcombine_s16(vmovn_s32(mmtmpD0),vmovn_s32(mmtmpD1));
- if (pilots==0) {
- mmtmpD0 = vmull_s16(dl_ch128[4], dl_ch128[4]);
- mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),output_shift128);
- mmtmpD1 = vmull_s16(dl_ch128[5], dl_ch128[5]);
- mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),output_shift128);
- mmtmpD4 = vcombine_s16(vmovn_s32(mmtmpD0),vmovn_s32(mmtmpD1));
- }
+
+ mmtmpD0 = vmull_s16(dl_ch128[4], dl_ch128[4]);
+ mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),output_shift128);
+ mmtmpD1 = vmull_s16(dl_ch128[5], dl_ch128[5]);
+ mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),output_shift128);
+ mmtmpD4 = vcombine_s16(vmovn_s32(mmtmpD0),vmovn_s32(mmtmpD1));
dl_ch_mag128b[0] = vqdmulhq_s16(mmtmpD2,QAM_amp128b);
dl_ch_mag128b[1] = vqdmulhq_s16(mmtmpD3,QAM_amp128b);
dl_ch_mag128[0] = vqdmulhq_s16(mmtmpD2,QAM_amp128);
dl_ch_mag128[1] = vqdmulhq_s16(mmtmpD3,QAM_amp128);
- if (pilots==0) {
- dl_ch_mag128b[2] = vqdmulhq_s16(mmtmpD4,QAM_amp128b);
- dl_ch_mag128[2] = vqdmulhq_s16(mmtmpD4,QAM_amp128);
- }
+ dl_ch_mag128b[2] = vqdmulhq_s16(mmtmpD4,QAM_amp128b);
+ dl_ch_mag128[2] = vqdmulhq_s16(mmtmpD4,QAM_amp128);
}
mmtmpD0 = vmull_s16(dl_ch128[0], rxdataF128[0]);
@@ -1202,36 +1198,29 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
mmtmpD1 = vqshlq_s32(mmtmpD1,output_shift128);
rxdataF_comp128[1] = vzip_s16(vmovn_s32(mmtmpD0),vmovn_s32(mmtmpD1));
- if (pilots==0) {
- mmtmpD0 = vmull_s16(dl_ch128[4], rxdataF128[4]);
- mmtmpD1 = vmull_s16(dl_ch128[5], rxdataF128[5]);
- mmtmpD0 = vcombine_s32(vpadd_s32(vget_low_s32(mmtmpD0),vget_high_s32(mmtmpD0)),
- vpadd_s32(vget_low_s32(mmtmpD1),vget_high_s32(mmtmpD1)));
- mmtmpD0b = vmull_s16(vrev32_s16(vmul_s16(dl_ch128[4],*(int16x4_t*)conj)), rxdataF128[4]);
- mmtmpD1b = vmull_s16(vrev32_s16(vmul_s16(dl_ch128[5],*(int16x4_t*)conj)), rxdataF128[5]);
- mmtmpD1 = vcombine_s32(vpadd_s32(vget_low_s32(mmtmpD0b),vget_high_s32(mmtmpD0b)),
- vpadd_s32(vget_low_s32(mmtmpD1b),vget_high_s32(mmtmpD1b)));
+ mmtmpD0 = vmull_s16(dl_ch128[4], rxdataF128[4]);
+ mmtmpD1 = vmull_s16(dl_ch128[5], rxdataF128[5]);
+ mmtmpD0 = vcombine_s32(vpadd_s32(vget_low_s32(mmtmpD0),vget_high_s32(mmtmpD0)),
+ vpadd_s32(vget_low_s32(mmtmpD1),vget_high_s32(mmtmpD1)));
+
+ mmtmpD0b = vmull_s16(vrev32_s16(vmul_s16(dl_ch128[4],*(int16x4_t*)conj)), rxdataF128[4]);
+ mmtmpD1b = vmull_s16(vrev32_s16(vmul_s16(dl_ch128[5],*(int16x4_t*)conj)), rxdataF128[5]);
+ mmtmpD1 = vcombine_s32(vpadd_s32(vget_low_s32(mmtmpD0b),vget_high_s32(mmtmpD0b)),
+ vpadd_s32(vget_low_s32(mmtmpD1b),vget_high_s32(mmtmpD1b)));
- mmtmpD0 = vqshlq_s32(mmtmpD0,output_shift128);
- mmtmpD1 = vqshlq_s32(mmtmpD1,output_shift128);
- rxdataF_comp128[2] = vzip_s16(vmovn_s32(mmtmpD0),vmovn_s32(mmtmpD1));
+ mmtmpD0 = vqshlq_s32(mmtmpD0,output_shift128);
+ mmtmpD1 = vqshlq_s32(mmtmpD1,output_shift128);
+ rxdataF_comp128[2] = vzip_s16(vmovn_s32(mmtmpD0),vmovn_s32(mmtmpD1));
- dl_ch128+=6;
- dl_ch_mag128+=3;
- dl_ch_mag128b+=3;
- rxdataF128+=6;
- rxdataF_comp128+=3;
+ dl_ch128+=6;
+ dl_ch_mag128+=3;
+ dl_ch_mag128b+=3;
+ rxdataF128+=6;
+ rxdataF_comp128+=3;
- } else { // we have a smaller PDSCH in symbols with pilots so skip last group of 4 REs and increment less
- dl_ch128+=4;
- dl_ch_mag128+=2;
- dl_ch_mag128b+=2;
- rxdataF128+=4;
- rxdataF_comp128+=2;
- }
}
}
}
@@ -1241,7 +1230,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
rho128 = (int16x4x2_t*)&rho[aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch128 = (int16x4_t*)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch128_2 = (int16x4_t*)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12];
- for (rb=0; rb4) ? 4 : x;
int16_t y = (len)>>x;
//printf("len = %d = %d * 2^(%d)\n",len,y,x);
+ uint32_t nb_rb_0 = len/12 + ((len%12)?1:0);
AssertFatal(y!=0,"Cannot divide by zero: in function %s of file %s\n", __func__, __FILE__);
@@ -1589,7 +1575,7 @@ void nr_dlsch_channel_level(int **dl_ch_estimates_ext,
dl_ch128=(__m128i *)&dl_ch_estimates_ext[(aatx*frame_parms->nb_antennas_rx)+aarx][symbol*nb_rb*12];
- for (rb=0;rb=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
-
+ uint32_t nb_rb_0 = len/12 + ((len%12)?1:0);
for (aatx=0; aatxnb_antenna_ports_gNB; aatx++)
for (aarx=0; aarxnb_antennas_rx; aarx++) {
//clear average level
@@ -1623,7 +1609,7 @@ void nr_dlsch_channel_level(int **dl_ch_estimates_ext,
dl_ch128=(int16x4_t *)&dl_ch_estimates_ext[(aatx<<1)+aarx][symbol*frame_parms->N_RB_DL*12];
- for (rb=0; rbofdm_symbol_size)))];
for (rb = 0; rb < nb_rb_pdsch; rb++) {
- if (k>frame_parms->ofdm_symbol_size) {
+ if (k>=frame_parms->ofdm_symbol_size) {
k = k-frame_parms->ofdm_symbol_size;
rxF = &rxdataF[aarx][(k+(symbol*(frame_parms->ofdm_symbol_size)))];
}
@@ -2108,7 +2094,7 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
rxF_ext+=12;
} else {//the symbol contains DMRS
j=0;
- if (config_type==pdsch_dmrs_type1){
+ if (config_type==NFAPI_NR_DMRS_TYPE1){
if (nushift == 0) {//data is multiplexed
for (i = (1-nushift); i<12; i+=2) {
rxF_ext[j]=rxF[i];
@@ -2118,7 +2104,7 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
dl_ch0_ext+=6;
rxF_ext+=6;
}
- } else {//pdsch_dmrs_type2
+ } else {//NFAPI_NR_DMRS_TYPE2
for (i = (2+nushift); i<6; i++) {
rxF_ext[j]=rxF[i];
dl_ch0_ext[j]=dl_ch0[i];
@@ -2166,7 +2152,7 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF,
int *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext;
int8_t validDmrsEst = 0; //store last DMRS Symbol index
- if (config_type==pdsch_dmrs_type1) {
+ if (config_type==NFAPI_NR_DMRS_TYPE1) {
AssertFatal(n_dmrs_cdm_groups == 1 || n_dmrs_cdm_groups == 2,
"n_dmrs_cdm_groups %d is illegal\n",n_dmrs_cdm_groups);
nushift = n_dmrs_cdm_groups -1;//delta in Table 7.4.1.1.2-1
@@ -2181,7 +2167,7 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF,
for (aarx=0; aarxnb_antennas_rx; aarx++) {
k = frame_parms->first_carrier_offset + NR_NB_SC_PER_RB*start_rb;
- if (k>frame_parms->ofdm_symbol_size)
+ if (k>=frame_parms->ofdm_symbol_size)
k = k-frame_parms->ofdm_symbol_size;
rxF_ext = &rxdataF_ext[aarx][symbol*(nb_rb_pdsch*12)];
@@ -2204,7 +2190,7 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF,
}
else {//the symbol contains DMRS
j=0;
- if (config_type==pdsch_dmrs_type1) {
+ if (config_type==NFAPI_NR_DMRS_TYPE1) {
if (nushift == 0) {//data is multiplexed
for (i = (1-nushift); i<12; i+=2) {
if (aatx==0) rxF_ext[j]=rxF[i];
@@ -2215,7 +2201,7 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF,
if (aatx==0) rxF_ext+=6;
}
}
- else {//pdsch_dmrs_type2
+ else {//NFAPI_NR_DMRS_TYPE2
for (i = (2+nushift); i<6; i++) {
if (aatx==0) rxF_ext[j]=rxF[i];
dl_ch0_ext[j]=dl_ch0[i];
@@ -2250,43 +2236,55 @@ void nr_dlsch_detection_mrc(int **rxdataF_comp,
int ***rho,
int **dl_ch_mag,
int **dl_ch_magb,
+ int **dl_ch_magr,
short n_tx,
short n_rx,
unsigned char symbol,
- unsigned short nb_rb) {
+ unsigned short nb_rb,
+ int length) {
#if defined(__x86_64__)||defined(__i386__)
unsigned char aatx, aarx;
int i;
- __m128i *rxdataF_comp128_0,*rxdataF_comp128_1,*dl_ch_mag128_0,*dl_ch_mag128_1,*dl_ch_mag128_0b,*dl_ch_mag128_1b;
+ __m128i *rxdataF_comp128_0,*rxdataF_comp128_1,*dl_ch_mag128_0,*dl_ch_mag128_1,*dl_ch_mag128_0b,*dl_ch_mag128_1b,*dl_ch_mag128_0r,*dl_ch_mag128_1r;
+
+ uint32_t nb_rb_0 = length/12 + ((length%12)?1:0);
if (n_rx>1) {
for (aatx=0; aatxN_RB_DL*12];
rho128_1 = (__m128i *) &rho[1][symbol*frame_parms->N_RB_DL*12];
- for (i=0; i>2);
+ //printf("det_%d = %d log2 =%d \n",k,(((int *)&det[0])[k]),log2_approx(((int *)&det[0])[k]));
+ }
+
+ xy_re_128 = _mm_slli_epi32(xy_re_128,5);
+ xy_re_128 = _mm_srai_epi32(xy_re_128,log2_approx(sum_det));
+ xy_re_128 = _mm_slli_epi32(xy_re_128,5);
+
+ xy_im_128 = _mm_slli_epi32(xy_im_128,5);
+ xy_im_128 = _mm_srai_epi32(xy_im_128,log2_approx(sum_det));
+ xy_im_128 = _mm_slli_epi32(xy_im_128,5);
+
+ tmp_z0 = _mm_unpacklo_epi32(xy_re_128,xy_im_128);
+ //print_ints("unpack lo:",&tmp_z0[0]);
+ tmp_z1 = _mm_unpackhi_epi32(xy_re_128,xy_im_128);
+ //print_ints("unpack hi:",&tmp_z1[0]);
+ output = _mm_packs_epi32(tmp_z0,tmp_z1);
+
+ _mm_empty();
+ _m_empty();
+ return(output);
+}
/* Zero Forcing Rx function: nr_construct_HhH_elements()
*
*
@@ -2534,15 +2585,16 @@ void nr_construct_HhH_elements(int *conjch00_ch00,
if (conjch21_ch20 != NULL) after_mf_10_128[0] =_mm_adds_epi16(after_mf_10_128[0],conjch21_ch20_128[0]);
if (conjch31_ch30 != NULL) after_mf_10_128[0] =_mm_adds_epi16(after_mf_10_128[0],conjch31_ch30_128[0]);
- /*if ((rb==0)&&(symbol==1))
+#ifdef DEBUG_DLSCH_DEMOD
+ if ((rb<=30))
{
printf(" \n construct_HhH_elements \n");
print_shorts("after_mf_00_128:",(int16_t*)&after_mf_00_128[0]);
print_shorts("after_mf_01_128:",(int16_t*)&after_mf_01_128[0]);
print_shorts("after_mf_10_128:",(int16_t*)&after_mf_10_128[0]);
print_shorts("after_mf_11_128:",(int16_t*)&after_mf_11_128[0]);
- }*/
-
+ }
+#endif
conjch00_ch00_128+=1;
conjch10_ch10_128+=1;
conjch01_ch01_128+=1;
@@ -2579,16 +2631,18 @@ void nr_construct_HhH_elements(int *conjch00_ch00,
uint8_t nr_zero_forcing_rx_2layers(int **rxdataF_comp,
int **dl_ch_mag,
int **dl_ch_magb,
+ int **dl_ch_magr,
int **dl_ch_estimates_ext,
unsigned short nb_rb,
unsigned char n_rx,
unsigned char mod_order,
int shift,
- unsigned char symbol)
+ unsigned char symbol,
+ int length)
{
int *ch00, *ch01, *ch10, *ch11;
int *ch20, *ch30, *ch21, *ch31;
-
+ uint32_t nb_rb_0 = length/12 + ((length%12)?1:0);
/* we need at least alignment to 16 bytes, let's put 32 to be sure
* (maybe not necessary but doesn't hurt)
*/
@@ -2656,49 +2710,49 @@ uint8_t nr_zero_forcing_rx_2layers(int **rxdataF_comp,
nr_conjch0_mult_ch1(ch00,
ch00,
conjch00_ch00,
- nb_rb,
+ nb_rb_0,
shift);
// (1/2^log2_maxh)*conj_H_10xH_10: (1/(64*2))conjH_10*H_10*2^15
nr_conjch0_mult_ch1(ch10,
ch10,
conjch10_ch10,
- nb_rb,
+ nb_rb_0,
shift);
// conj_H_00xH_01
nr_conjch0_mult_ch1(ch00,
ch01,
conjch00_ch01,
- nb_rb,
+ nb_rb_0,
shift); // this shift is equal to the channel level log2_maxh
// conj_H_10xH_11
nr_conjch0_mult_ch1(ch10,
ch11,
conjch10_ch11,
- nb_rb,
+ nb_rb_0,
shift);
// conj_H_01xH_01
nr_conjch0_mult_ch1(ch01,
ch01,
conjch01_ch01,
- nb_rb,
+ nb_rb_0,
shift);
// conj_H_11xH_11
nr_conjch0_mult_ch1(ch11,
ch11,
conjch11_ch11,
- nb_rb,
+ nb_rb_0,
shift);
// conj_H_01xH_00
nr_conjch0_mult_ch1(ch01,
ch00,
conjch01_ch00,
- nb_rb,
+ nb_rb_0,
shift);
// conj_H_11xH_10
nr_conjch0_mult_ch1(ch11,
ch10,
conjch11_ch10,
- nb_rb,
+ nb_rb_0,
shift);
}
if (n_rx==4){
@@ -2706,52 +2760,52 @@ uint8_t nr_zero_forcing_rx_2layers(int **rxdataF_comp,
nr_conjch0_mult_ch1(ch20,
ch20,
conjch20_ch20,
- nb_rb,
+ nb_rb_0,
shift);
// (1/2^log2_maxh)*conj_H_30xH_30: (1/(64*2*4))conjH_30*H_30*2^15
nr_conjch0_mult_ch1(ch30,
ch30,
conjch30_ch30,
- nb_rb,
+ nb_rb_0,
shift);
// (1/2^log2_maxh)*conj_H_20xH_20: (1/(64*2))conjH_20*H_20*2^15
nr_conjch0_mult_ch1(ch20,
ch21,
conjch20_ch21,
- nb_rb,
+ nb_rb_0,
shift);
nr_conjch0_mult_ch1(ch30,
ch31,
conjch30_ch31,
- nb_rb,
+ nb_rb_0,
shift);
nr_conjch0_mult_ch1(ch21,
ch21,
conjch21_ch21,
- nb_rb,
+ nb_rb_0,
shift);
nr_conjch0_mult_ch1(ch31,
ch31,
conjch31_ch31,
- nb_rb,
+ nb_rb_0,
shift);
// (1/2^log2_maxh)*conj_H_20xH_20: (1/(64*2))conjH_20*H_20*2^15
nr_conjch0_mult_ch1(ch21,
ch20,
conjch21_ch20,
- nb_rb,
+ nb_rb_0,
shift);
nr_conjch0_mult_ch1(ch31,
ch30,
conjch31_ch30,
- nb_rb,
+ nb_rb_0,
shift);
nr_construct_HhH_elements(conjch00_ch00,
@@ -2774,7 +2828,7 @@ uint8_t nr_zero_forcing_rx_2layers(int **rxdataF_comp,
af_mf_01,
af_mf_10,
af_mf_11,
- nb_rb,
+ nb_rb_0,
symbol);
}
if (n_rx==2){
@@ -2798,7 +2852,7 @@ uint8_t nr_zero_forcing_rx_2layers(int **rxdataF_comp,
af_mf_01,
af_mf_10,
af_mf_11,
- nb_rb,
+ nb_rb_0,
symbol);
}
//det_HhH = ad -bc
@@ -2807,8 +2861,9 @@ uint8_t nr_zero_forcing_rx_2layers(int **rxdataF_comp,
af_mf_10,//c
af_mf_11,//d
determ_fin,
- nb_rb,
- symbol);
+ nb_rb_0,
+ symbol,
+ shift);
/* 2- Compute the channel matrix inversion **********************************
*
* |(conj_H_00xH_00+conj_H_10xH_10) (conj_H_00xH_01+conj_H_10xH_11)|
@@ -2822,92 +2877,106 @@ uint8_t nr_zero_forcing_rx_2layers(int **rxdataF_comp,
*
*
**************************************************************************/
- __m128i *rxdataF_comp128_0,*rxdataF_comp128_1,*dl_ch_mag128_0,*dl_ch_mag128b_0,*dl_ch_mag128_1,*dl_ch_mag128b_1,*determ_fin_128;
- __m128i mmtmpD2,mmtmpD3,mmtmpD0,mmtmpD1,QAM_amp128,QAM_amp128b;
+ __m128i *rxdataF_comp128_0,*rxdataF_comp128_1,*dl_ch_mag128_0,*dl_ch_mag128b_0,*dl_ch_mag128r_0,*determ_fin_128;//*dl_ch_mag128_1,*dl_ch_mag128b_1,*dl_ch_mag128r_1
+ __m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3;
__m128i *after_mf_a_128,*after_mf_b_128, *after_mf_c_128, *after_mf_d_128;
+ __m128i QAM_amp128,QAM_amp128b,QAM_amp128r;
determ_fin_128 = (__m128i *)&determ_fin[0];
rxdataF_comp128_0 = (__m128i *)&rxdataF_comp[0][symbol*nb_rb*12];//aatx=0 @ aarx =0
rxdataF_comp128_1 = (__m128i *)&rxdataF_comp[n_rx][symbol*nb_rb*12];//aatx=1 @ aarx =0
- dl_ch_mag128_0 = (__m128i *)&dl_ch_mag[0][symbol*nb_rb*12];
- dl_ch_mag128_1 = (__m128i *)&dl_ch_mag[n_rx][symbol*nb_rb*12];
- dl_ch_mag128b_0 = (__m128i *)&dl_ch_magb[0][symbol*nb_rb*12];
- dl_ch_mag128b_1 = (__m128i *)&dl_ch_magb[n_rx][symbol*nb_rb*12];
-
after_mf_a_128 = (__m128i *)af_mf_00;
after_mf_b_128 = (__m128i *)af_mf_01;
after_mf_c_128 = (__m128i *)af_mf_10;
after_mf_d_128 = (__m128i *)af_mf_11;
- QAM_amp128b = _mm_setzero_si128();
-
- if (mod_order == 4) {
- QAM_amp128 = _mm_set1_epi16(QAM16_n1); // 2/sqrt(10)
- QAM_amp128b = _mm_setzero_si128();
- } else if (mod_order == 6) {
- QAM_amp128 = _mm_set1_epi16(QAM64_n1); //
- QAM_amp128b = _mm_set1_epi16(QAM64_n2);
+ if (mod_order>2) {
+ if (mod_order == 4) {
+ QAM_amp128 = _mm_set1_epi16(QAM16_n1); //2/sqrt(10)
+ QAM_amp128b = _mm_setzero_si128();
+ QAM_amp128r = _mm_setzero_si128();
+ } else if (mod_order == 6) {
+ QAM_amp128 = _mm_set1_epi16(QAM64_n1); //4/sqrt{42}
+ QAM_amp128b = _mm_set1_epi16(QAM64_n2); //2/sqrt{42}
+ QAM_amp128r = _mm_setzero_si128();
+ } else if (mod_order == 8) {
+ QAM_amp128 = _mm_set1_epi16(QAM256_n1); //8/sqrt{170}
+ QAM_amp128b = _mm_set1_epi16(QAM256_n2);//4/sqrt{170}
+ QAM_amp128r = _mm_set1_epi16(QAM256_n3);//2/sqrt{170}
+ }
+ dl_ch_mag128_0 = (__m128i *)&dl_ch_mag[0][symbol*nb_rb*12];
+ dl_ch_mag128b_0 = (__m128i *)&dl_ch_magb[0][symbol*nb_rb*12];
+ dl_ch_mag128r_0 = (__m128i *)&dl_ch_magr[0][symbol*nb_rb*12];
}
- for (int rb=0; rb<3*nb_rb; rb++) {
+ for (int rb=0; rb<3*nb_rb_0; rb++) {
if (mod_order>2) {
- // get channel determ (da -bc) if not QPSK
- mmtmpD0 = _mm_packs_epi32(determ_fin_128[0],determ_fin_128[0]);//convert 32 bits to 16 bits
+ int sum_det =0;
+ for (int k=0; k<4;k++) {
+ sum_det += ((((int *)&determ_fin_128[0])[k])>>2);
+ //printf("det_%d = %d\n",k,sum_det);
+ }
- dl_ch_mag128_0[0] = _mm_unpacklo_epi16(mmtmpD0,mmtmpD0);
- dl_ch_mag128b_0[0] = dl_ch_mag128_0[0];
+ mmtmpD2 = _mm_slli_epi32(determ_fin_128[0],5);
+ mmtmpD2 = _mm_srai_epi32(mmtmpD2,log2_approx(sum_det));
+ mmtmpD2 = _mm_slli_epi32(mmtmpD2,5);
+
+ mmtmpD3 = _mm_unpacklo_epi32(mmtmpD2,mmtmpD2);
+
+ mmtmpD2 = _mm_unpackhi_epi32(mmtmpD2,mmtmpD2);
+
+ mmtmpD2 = _mm_packs_epi32(mmtmpD3,mmtmpD2);
+
+ dl_ch_mag128_0[0] = mmtmpD2;
+ dl_ch_mag128b_0[0] = mmtmpD2;
+ dl_ch_mag128r_0[0] = mmtmpD2;
dl_ch_mag128_0[0] = _mm_mulhi_epi16(dl_ch_mag128_0[0],QAM_amp128);
- dl_ch_mag128_0[0] = _mm_slli_epi16(dl_ch_mag128_0[0],1);//aatx=0 @ aarx =0
- dl_ch_mag128_1[0] = dl_ch_mag128_0[0];//aatx=1 @ aarx =0
+ dl_ch_mag128_0[0] = _mm_slli_epi16(dl_ch_mag128_0[0],1);
dl_ch_mag128b_0[0] = _mm_mulhi_epi16(dl_ch_mag128b_0[0],QAM_amp128b);
- dl_ch_mag128b_0[0] = _mm_slli_epi16(dl_ch_mag128b_0[0],1);//aatx=0 @ aarx =
- dl_ch_mag128b_1[0] = dl_ch_mag128b_0[0];//aatx=1 @ aarx =0
+ dl_ch_mag128b_0[0] = _mm_slli_epi16(dl_ch_mag128b_0[0],1);
- if ((rb==0)&&(symbol==1)) {
- printf("\n Signal mag after ZF \n");
- print_shorts("mag layer 1:",(int16_t*)&dl_ch_mag128_0[0]);
- print_shorts("mag layer 2:",(int16_t*)&dl_ch_mag128_1[0]);
- print_shorts("magb layer 1:",(int16_t*)&dl_ch_mag128b_0[0]);
- print_shorts("magb layer 2:",(int16_t*)&dl_ch_mag128b_1[0]);
- }
+ dl_ch_mag128r_0[0] = _mm_mulhi_epi16(dl_ch_mag128r_0[0],QAM_amp128r);
+ dl_ch_mag128r_0[0] = _mm_slli_epi16(dl_ch_mag128r_0[0],1);
+
+ //print_shorts("mag layer 1:",(int16_t*)&dl_ch_mag128_0[0]);
+ //print_shorts("mag layer 2:",(int16_t*)&dl_ch_mag128_1[0]);
+ //print_shorts("magb layer 1:",(int16_t*)&dl_ch_mag128b_0[0]);
+ //print_shorts("magb layer 2:",(int16_t*)&dl_ch_mag128b_1[0]);
+ //print_shorts("magr layer 1:",(int16_t*)&dl_ch_mag128r_0[0]);
+ //print_shorts("magr layer 2:",(int16_t*)&dl_ch_mag128r_1[0]);
}
// multiply by channel Inv
//rxdataF_zf128_0 = rxdataF_comp128_0*d - b*rxdataF_comp128_1
//rxdataF_zf128_1 = rxdataF_comp128_1*a - c*rxdataF_comp128_0
- mmtmpD2 = nr_inv_comp_muli(rxdataF_comp128_0[0],//x
- after_mf_d_128[0]);//y
- mmtmpD3 = nr_inv_comp_muli(rxdataF_comp128_1[0],//x
- after_mf_b_128[0]);//y
- //mmtmpD2[0] - mmtmpD3[0]
- //rxdataF_zf128_0
- mmtmpD0 = _mm_sub_epi16(mmtmpD2, mmtmpD3);
+ //printf("layer_1 \n");
+ mmtmpD0 = nr_comp_muli_sum(rxdataF_comp128_0[0],
+ after_mf_d_128[0],
+ rxdataF_comp128_1[0],
+ after_mf_b_128[0],
+ determ_fin_128[0]);
- mmtmpD2 = nr_inv_comp_muli(rxdataF_comp128_1[0],//x
- after_mf_a_128[0]);//y
- mmtmpD3 = nr_inv_comp_muli(rxdataF_comp128_0[0],//x
- after_mf_c_128[0]);//y
- //mmtmpD2[0] - mmtmpD3[0]
- //rxdataF_zf128_1
- mmtmpD1 = _mm_sub_epi16(mmtmpD2, mmtmpD3);
+ //printf("layer_2 \n");
+ mmtmpD1 = nr_comp_muli_sum(rxdataF_comp128_1[0],
+ after_mf_a_128[0],
+ rxdataF_comp128_0[0],
+ after_mf_c_128[0],
+ determ_fin_128[0]);
rxdataF_comp128_0[0] = mmtmpD0;
rxdataF_comp128_1[0] = mmtmpD1;
-
- /*if ((rb==0)&&(symbol==1)) {
- printf("\n Rx signal after ZF \n");
- print_shorts("Rx layer 1:",(int16_t*)&rxdataF_comp128_0[0]);
- print_shorts("Rx layer 2:",(int16_t*)&rxdataF_comp128_1[0]);
- }*/
-
+#ifdef DEBUG_DLSCH_DEMOD
+ printf("\n Rx signal after ZF l%d rb%d\n",symbol,rb);
+ print_shorts(" Rx layer 1:",(int16_t*)&rxdataF_comp128_0[0]);
+ print_shorts(" Rx layer 2:",(int16_t*)&rxdataF_comp128_1[0]);
+#endif
determ_fin_128 += 1;
dl_ch_mag128_0 += 1;
dl_ch_mag128b_0 += 1;
- dl_ch_mag128_1 += 1;
- dl_ch_mag128b_1 += 1;
+ dl_ch_mag128r_0 += 1;
rxdataF_comp128_0 += 1;
rxdataF_comp128_1 += 1;
after_mf_a_128 += 1;
@@ -2923,13 +2992,18 @@ uint8_t nr_zero_forcing_rx_2layers(int **rxdataF_comp,
static void nr_dlsch_layer_demapping(int16_t **llr_cw,
uint8_t Nl,
uint8_t mod_order,
- uint16_t length,
+ uint32_t length,
+ int32_t codeword_TB0,
+ int32_t codeword_TB1,
int16_t **llr_layers) {
switch (Nl) {
-
case 1:
- memcpy((void*)llr_layers[0], (void*)llr_cw[0], (length)*sizeof(int16_t));
+ if (codeword_TB1 == -1)
+ memcpy((void*)llr_cw[0], (void*)llr_layers[0], (length)*sizeof(int16_t));
+ else if (codeword_TB0 == -1)
+ memcpy((void*)llr_cw[1], (void*)llr_layers[0], (length)*sizeof(int16_t));
+
break;
case 2:
@@ -2937,11 +3011,15 @@ static void nr_dlsch_layer_demapping(int16_t **llr_cw,
case 4:
for (int i=0; i<(length/Nl/mod_order); i++){
for (int l=0; l0 1 2 3
+ else if (codeword_TB0 == -1)
+ llr_cw[1][Nl*mod_order*i+l*mod_order+m] = llr_layers[l][i*mod_order+m];//i:0 -->0 1 2 3
+ //if (i<4) printf("length%d: llr_layers[l%d][m%d]=%d: \n",length,l,m,llr_layers[l][i*mod_order+m]);
+ }
+ }
}
- }
break;
default:
@@ -3009,299 +3087,110 @@ static int nr_dlsch_llr(NR_UE_PDSCH **pdsch_vars,
switch (dlsch0_harq->Qm) {
case 2 :
- if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
- nr_dlsch_qpsk_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- pllr_symbol_cw0,
- symbol,
- len,
- first_symbol_flag,
- nb_rb,
- beamforming_mode);
-
- } else if (codeword_TB0 == -1){
-
- nr_dlsch_qpsk_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- pllr_symbol_cw1,
- symbol,
- len,
- first_symbol_flag,
- nb_rb,
- beamforming_mode);
- }
- else if (rx_type >= rx_IC_single_stream) {
- if (dlsch1_harq->Qm == 2) {
- nr_dlsch_qpsk_qpsk_llr(frame_parms,
+ switch (rx_type) {
+ case rx_standard :
+ for(int l =0; lNl; l++)
+ nr_dlsch_qpsk_llr(frame_parms,
+ pdsch_vars[gNB_id]->rxdataF_comp0[l*frame_parms->nb_antennas_rx],
+ pdsch_vars[gNB_id]->layer_llr[l]+llr_offset_symbol,
+ symbol,
+ len,
+ first_symbol_flag,
+ nb_rb,
+ beamforming_mode);
+ break;
+ case rx_IC_single_stream ://not implemented yet
+ /*nr_dlsch_qpsk_qpsk_llr(frame_parms,
pdsch_vars[gNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,
pdsch_vars[gNB_id]->dl_ch_rho2_ext,
pdsch_vars[gNB_id]->layer_llr[0],
symbol,len,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,nr_slot_rx,symbol),
- pdsch_vars[gNB_id]->llr128);
- if (rx_type==rx_IC_dual_stream) {
- nr_dlsch_qpsk_qpsk_llr(frame_parms,
- rxdataF_comp_ptr,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
- pdsch_vars[gNB_id]->layer_llr[1],
- symbol,len,first_symbol_flag,nb_rb,
- adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,nr_slot_rx,symbol),
- pdsch_vars[gNB_id]->llr128_2ndstream);
- }
- }
- else if (dlsch1_harq->Qm == 4) {
- nr_dlsch_qpsk_16qam_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- rxdataF_comp_ptr,//i
- dl_ch_mag_ptr,//i
- pdsch_vars[gNB_id]->dl_ch_rho2_ext,
- pdsch_vars[gNB_id]->layer_llr[0],
- symbol,first_symbol_flag,nb_rb,
- adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,nr_slot_rx,symbol),
- pdsch_vars[gNB_id]->llr128);
- if (rx_type==rx_IC_dual_stream) {
- nr_dlsch_16qam_qpsk_llr(frame_parms,
- rxdataF_comp_ptr,
- pdsch_vars[gNB_id]->rxdataF_comp0,//i
- dl_ch_mag_ptr,
- pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
- pdsch_vars[gNB_id]->layer_llr[1],
- symbol,first_symbol_flag,nb_rb,
- adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,nr_slot_rx,symbol),
- pdsch_vars[gNB_id]->llr128_2ndstream);
- }
- }
- else {
- nr_dlsch_qpsk_64qam_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- rxdataF_comp_ptr,//i
- dl_ch_mag_ptr,//i
- pdsch_vars[gNB_id]->dl_ch_rho2_ext,
- pdsch_vars[gNB_id]->layer_llr[0],
- symbol,first_symbol_flag,nb_rb,
- adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,nr_slot_rx,symbol),
- pdsch_vars[gNB_id]->llr128);
- if (rx_type==rx_IC_dual_stream) {
- nr_dlsch_64qam_qpsk_llr(frame_parms,
- rxdataF_comp_ptr,
- pdsch_vars[gNB_id]->rxdataF_comp0,//i
- dl_ch_mag_ptr,
- pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
- pdsch_vars[gNB_id]->layer_llr[1],
- symbol,first_symbol_flag,nb_rb,
- adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,nr_slot_rx,symbol),
- pdsch_vars[gNB_id]->llr128_2ndstream);
- }
- }
+ pdsch_vars[gNB_id]->llr128);*/
+ break;
+ case rx_IC_dual_stream ://not implemented yet
+ /*nr_dlsch_qpsk_qpsk_llr(frame_parms,
+ rxdataF_comp_ptr,
+ pdsch_vars[gNB_id]->rxdataF_comp0,
+ pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
+ pdsch_vars[gNB_id]->layer_llr[1],
+ symbol,len,first_symbol_flag,nb_rb,
+ adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,nr_slot_rx,symbol),
+ pdsch_vars[gNB_id]->llr128_2ndstream);*/
+ break;
+ case rx_SIC_dual_stream ://not implemented yet
+ break;
}
break;
case 4 :
- if ((rx_type==rx_standard ) || (codeword_TB1 == -1)) {
- nr_dlsch_16qam_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- pdsch_vars[gNB_id]->llr[0],
- pdsch_vars[gNB_id]->dl_ch_mag0,
- symbol,len,first_symbol_flag,nb_rb,
- pdsch_vars[gNB_id]->llr128,
- beamforming_mode);
- } else if (codeword_TB0 == -1){
- nr_dlsch_16qam_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- pdsch_vars[gNB_id]->llr[1],
- pdsch_vars[gNB_id]->dl_ch_mag0,
- symbol,len,first_symbol_flag,nb_rb,
- pdsch_vars[gNB_id]->llr128_2ndstream,
- beamforming_mode);
- }
- else if (rx_type >= rx_IC_single_stream) {
- if (dlsch1_harq->Qm == 2) {
- nr_dlsch_16qam_qpsk_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- rxdataF_comp_ptr,//i
- pdsch_vars[gNB_id]->dl_ch_mag0,
- pdsch_vars[gNB_id]->dl_ch_rho2_ext,
- pdsch_vars[gNB_id]->layer_llr[0],
- symbol,first_symbol_flag,nb_rb,
- adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,nr_slot_rx,symbol),
- pdsch_vars[gNB_id]->llr128);
- if (rx_type==rx_IC_dual_stream) {
- nr_dlsch_qpsk_16qam_llr(frame_parms,
- rxdataF_comp_ptr,
- pdsch_vars[gNB_id]->rxdataF_comp0,//i
- pdsch_vars[gNB_id]->dl_ch_mag0,//i
- pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
- pdsch_vars[gNB_id]->layer_llr[1],
- symbol,first_symbol_flag,nb_rb,
- adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,nr_slot_rx,symbol),
- pdsch_vars[gNB_id]->llr128_2ndstream);
- }
- }
- else if (dlsch1_harq->Qm == 4) {
- nr_dlsch_16qam_16qam_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- rxdataF_comp_ptr,//i
- pdsch_vars[gNB_id]->dl_ch_mag0,
- dl_ch_mag_ptr,//i
- pdsch_vars[gNB_id]->dl_ch_rho2_ext,
- pdsch_vars[gNB_id]->layer_llr[0],
- symbol,len,first_symbol_flag,nb_rb,
- adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,nr_slot_rx,symbol),
- pdsch_vars[gNB_id]->llr128);
- if (rx_type==rx_IC_dual_stream) {
- nr_dlsch_16qam_16qam_llr(frame_parms,
- rxdataF_comp_ptr,
- pdsch_vars[gNB_id]->rxdataF_comp0,//i
- dl_ch_mag_ptr,
- pdsch_vars[gNB_id]->dl_ch_mag0,//i
- pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
- pdsch_vars[gNB_id]->layer_llr[1],
- symbol,len,first_symbol_flag,nb_rb,
- adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,nr_slot_rx,symbol),
- pdsch_vars[gNB_id]->llr128_2ndstream);
- }
- }
- else {
- nr_dlsch_16qam_64qam_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- rxdataF_comp_ptr,//i
- pdsch_vars[gNB_id]->dl_ch_mag0,
- dl_ch_mag_ptr,//i
- pdsch_vars[gNB_id]->dl_ch_rho2_ext,
- pdsch_vars[gNB_id]->layer_llr[0],
- symbol,first_symbol_flag,nb_rb,
- adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,nr_slot_rx,symbol),
- pdsch_vars[gNB_id]->llr128);
- if (rx_type==rx_IC_dual_stream) {
- nr_dlsch_64qam_16qam_llr(frame_parms,
- rxdataF_comp_ptr,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- dl_ch_mag_ptr,
- pdsch_vars[gNB_id]->dl_ch_mag0,
- pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
- pdsch_vars[gNB_id]->layer_llr[1],
- symbol,first_symbol_flag,nb_rb,
- adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,nr_slot_rx,symbol),
- pdsch_vars[gNB_id]->llr128_2ndstream);
- }
- }
+ switch (rx_type) {
+ case rx_standard :
+ for(int l =0; lNl; l++)
+ nr_dlsch_16qam_llr(frame_parms,
+ pdsch_vars[gNB_id]->rxdataF_comp0[l*frame_parms->nb_antennas_rx],
+ pdsch_vars[gNB_id]->layer_llr[l]+llr_offset_symbol,
+ pdsch_vars[gNB_id]->dl_ch_mag0[0],
+ symbol,
+ len,
+ first_symbol_flag,
+ nb_rb,
+ beamforming_mode);
+ break;
+ case rx_IC_single_stream ://not implemented yet
+ break;
+ case rx_IC_dual_stream ://not implemented yet
+ break;
+ case rx_SIC_dual_stream ://not implemented yet
+ break;
}
break;
case 6 :
- if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
- nr_dlsch_64qam_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- (int16_t*)pllr_symbol_cw0,
- pdsch_vars[gNB_id]->dl_ch_mag0,
- pdsch_vars[gNB_id]->dl_ch_magb0,
- symbol,len,first_symbol_flag,nb_rb,
- pdsch_vars[gNB_id]->llr_offset[symbol],
- beamforming_mode);
- } else if (codeword_TB0 == -1){
- nr_dlsch_64qam_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- pllr_symbol_cw1,
- pdsch_vars[gNB_id]->dl_ch_mag0,
- pdsch_vars[gNB_id]->dl_ch_magb0,
- symbol,len,first_symbol_flag,nb_rb,
- pdsch_vars[gNB_id]->llr_offset[symbol],
- beamforming_mode);
- }
- else if (rx_type >= rx_IC_single_stream) {
- if (dlsch1_harq->Qm == 2) {
- nr_dlsch_64qam_qpsk_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- rxdataF_comp_ptr,//i
- pdsch_vars[gNB_id]->dl_ch_mag0,
- pdsch_vars[gNB_id]->dl_ch_rho2_ext,
- pdsch_vars[gNB_id]->layer_llr[0],
- symbol,first_symbol_flag,nb_rb,
- adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,nr_slot_rx,symbol),
- pdsch_vars[gNB_id]->llr128);
- if (rx_type==rx_IC_dual_stream) {
- nr_dlsch_qpsk_64qam_llr(frame_parms,
- rxdataF_comp_ptr,
- pdsch_vars[gNB_id]->rxdataF_comp0,//i
- pdsch_vars[gNB_id]->dl_ch_mag0,
- pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
- pdsch_vars[gNB_id]->layer_llr[1],
- symbol,first_symbol_flag,nb_rb,
- adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,nr_slot_rx,symbol),
- pdsch_vars[gNB_id]->llr128_2ndstream);
- }
- }
- else if (dlsch1_harq->Qm == 4) {
- nr_dlsch_64qam_16qam_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- rxdataF_comp_ptr,//i
- pdsch_vars[gNB_id]->dl_ch_mag0,
- dl_ch_mag_ptr,//i
- pdsch_vars[gNB_id]->dl_ch_rho2_ext,
- pdsch_vars[gNB_id]->layer_llr[0],
- symbol,first_symbol_flag,nb_rb,
- adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,nr_slot_rx,symbol),
- pdsch_vars[gNB_id]->llr128);
- if (rx_type==rx_IC_dual_stream) {
- nr_dlsch_16qam_64qam_llr(frame_parms,
- rxdataF_comp_ptr,
- pdsch_vars[gNB_id]->rxdataF_comp0,//i
- dl_ch_mag_ptr,
- pdsch_vars[gNB_id]->dl_ch_mag0,//i
- pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
- pdsch_vars[gNB_id]->layer_llr[1],
- symbol,first_symbol_flag,nb_rb,
- adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,nr_slot_rx,symbol),
- pdsch_vars[gNB_id]->llr128_2ndstream);
- }
- }
- else {
- nr_dlsch_64qam_64qam_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- rxdataF_comp_ptr,//i
- pdsch_vars[gNB_id]->dl_ch_mag0,
- dl_ch_mag_ptr,//i
- pdsch_vars[gNB_id]->dl_ch_rho2_ext,
- (int16_t*)pllr_symbol_layer0,
- symbol,len,first_symbol_flag,nb_rb,
- adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,nr_slot_rx,symbol),
- pdsch_vars[gNB_id]->llr_offset[symbol]);
- if (rx_type==rx_IC_dual_stream) {
- nr_dlsch_64qam_64qam_llr(frame_parms,
- rxdataF_comp_ptr,
- pdsch_vars[gNB_id]->rxdataF_comp0,//i
- dl_ch_mag_ptr,
- pdsch_vars[gNB_id]->dl_ch_mag0,//i
- pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
- pllr_symbol_layer1,
- symbol,len,first_symbol_flag,nb_rb,
- adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,nr_slot_rx,symbol),
- pdsch_vars[gNB_id]->llr_offset[symbol]);
- }
- }
+ switch (rx_type) {
+ case rx_standard :
+ for(int l =0; lNl; l++)
+ nr_dlsch_64qam_llr(frame_parms,
+ pdsch_vars[gNB_id]->rxdataF_comp0[l*frame_parms->nb_antennas_rx],
+ pdsch_vars[gNB_id]->layer_llr[l]+llr_offset_symbol,
+ pdsch_vars[gNB_id]->dl_ch_mag0[0],
+ pdsch_vars[gNB_id]->dl_ch_magb0[0],
+ symbol,
+ len,
+ first_symbol_flag,
+ nb_rb,
+ beamforming_mode);
+ break;
+ case rx_IC_single_stream ://not implemented yet
+ break;
+ case rx_IC_dual_stream ://not implemented yet
+ break;
+ case rx_SIC_dual_stream ://not implemented yet
+ break;
}
+
break;
case 8:
- if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
- nr_dlsch_256qam_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- (int16_t*)pllr_symbol_cw0,
- pdsch_vars[gNB_id]->dl_ch_mag0,
- pdsch_vars[gNB_id]->dl_ch_magb0,
- pdsch_vars[gNB_id]->dl_ch_magr0,
- symbol,len,first_symbol_flag,nb_rb,
- pdsch_vars[gNB_id]->llr_offset[symbol],
- beamforming_mode);
- } else if (codeword_TB0 == -1){
- nr_dlsch_256qam_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- pllr_symbol_cw1,
- pdsch_vars[gNB_id]->dl_ch_mag0,
- pdsch_vars[gNB_id]->dl_ch_magb0,
- pdsch_vars[gNB_id]->dl_ch_magr0,
- symbol,len,first_symbol_flag,nb_rb,
- pdsch_vars[gNB_id]->llr_offset[symbol],
- beamforming_mode);
+ switch (rx_type) {
+ case rx_standard :
+ for(int l =0; lNl; l++)
+ nr_dlsch_256qam_llr(frame_parms,
+ pdsch_vars[gNB_id]->rxdataF_comp0[l*frame_parms->nb_antennas_rx],
+ pdsch_vars[gNB_id]->layer_llr[l]+llr_offset_symbol,
+ pdsch_vars[gNB_id]->dl_ch_mag0[0],
+ pdsch_vars[gNB_id]->dl_ch_magb0[0],
+ pdsch_vars[gNB_id]->dl_ch_magr0[0],
+ symbol,
+ len,
+ first_symbol_flag,
+ nb_rb,
+ beamforming_mode);
+ break;
+ case rx_IC_single_stream ://not implemented yet
+ break;
+ case rx_IC_dual_stream ://not implemented yet
+ break;
+ case rx_SIC_dual_stream ://not implemented yet
+ break;
}
break;
default:
@@ -3315,45 +3204,54 @@ static int nr_dlsch_llr(NR_UE_PDSCH **pdsch_vars,
case 2 :
if (rx_type==rx_standard) {
nr_dlsch_qpsk_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- pllr_symbol_cw0,
- symbol,len,first_symbol_flag,nb_rb,
+ pdsch_vars[gNB_id]->rxdataF_comp0[0],
+ pdsch_vars[gNB_id]->layer_llr[0]+llr_offset_symbol,
+ symbol,
+ len,
+ first_symbol_flag,
+ nb_rb,
beamforming_mode);
}
break;
case 4:
if (rx_type==rx_standard) {
nr_dlsch_16qam_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- pdsch_vars[gNB_id]->llr[0],
- pdsch_vars[gNB_id]->dl_ch_mag0,
- symbol,len,first_symbol_flag,nb_rb,
- pdsch_vars[gNB_id]->llr128,
+ pdsch_vars[gNB_id]->rxdataF_comp0[0],
+ pdsch_vars[gNB_id]->layer_llr[0]+llr_offset_symbol,
+ pdsch_vars[gNB_id]->dl_ch_mag0[0],
+ symbol,
+ len,
+ first_symbol_flag,
+ nb_rb,
beamforming_mode);
}
break;
case 6 :
if (rx_type==rx_standard) {
nr_dlsch_64qam_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- pllr_symbol_cw0,
- pdsch_vars[gNB_id]->dl_ch_mag0,
- pdsch_vars[gNB_id]->dl_ch_magb0,
- symbol,len,first_symbol_flag,nb_rb,
- pdsch_vars[gNB_id]->llr_offset[symbol],
- beamforming_mode);
+ pdsch_vars[gNB_id]->rxdataF_comp0[0],
+ pdsch_vars[gNB_id]->layer_llr[0]+llr_offset_symbol,
+ pdsch_vars[gNB_id]->dl_ch_mag0[0],
+ pdsch_vars[gNB_id]->dl_ch_magb0[0],
+ symbol,
+ len,
+ first_symbol_flag,
+ nb_rb,
+ beamforming_mode);
}
break;
case 8 :
if (rx_type==rx_standard) {
nr_dlsch_256qam_llr(frame_parms,
- pdsch_vars[gNB_id]->rxdataF_comp0,
- pllr_symbol_cw0,
- pdsch_vars[gNB_id]->dl_ch_mag0,
- pdsch_vars[gNB_id]->dl_ch_magb0,
- pdsch_vars[gNB_id]->dl_ch_magr0,
- symbol,len,first_symbol_flag,nb_rb,
- pdsch_vars[gNB_id]->llr_offset[symbol],
+ pdsch_vars[gNB_id]->rxdataF_comp0[0],
+ pdsch_vars[gNB_id]->layer_llr[0]+llr_offset_symbol,
+ pdsch_vars[gNB_id]->dl_ch_mag0[0],
+ pdsch_vars[gNB_id]->dl_ch_magb0[0],
+ pdsch_vars[gNB_id]->dl_ch_magr0[0],
+ symbol,
+ len,
+ first_symbol_flag,
+ nb_rb,
beamforming_mode);
}
break;
@@ -3368,97 +3266,6 @@ static int nr_dlsch_llr(NR_UE_PDSCH **pdsch_vars,
//==============================================================================================
-void dump_nrdlsch(PHY_VARS_NR_UE *ue,uint8_t gNB_id,uint8_t nr_slot_rx,unsigned int *coded_bits_per_codeword,int round, unsigned char harq_pid)
-{
- unsigned int nsymb = (ue->frame_parms.Ncp == 0) ? 14 : 12;
- char fname[32],vname[32];
- int N_RB_DL=ue->frame_parms.N_RB_DL;
-
- snprintf(fname, 32, "dlsch%d_rxF_r%d_ext0.m", gNB_id, round);
- snprintf(vname, 32, "dl%d_rxF_r%d_ext0", gNB_id, round);
- write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->rxdataF_ext[0],12*N_RB_DL*nsymb,1,1);
-
- if (ue->frame_parms.nb_antennas_rx >1) {
- snprintf(fname, 32, "dlsch%d_rxF_r%d_ext1.m", gNB_id, round);
- snprintf(vname, 32, "dl%d_rxF_r%d_ext1", gNB_id, round);
- write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->rxdataF_ext[1],12*N_RB_DL*nsymb,1,1);
- }
-
- snprintf(fname, 32, "dlsch%d_ch_r%d_ext00.m", gNB_id, round);
- snprintf(vname, 32, "dl%d_ch_r%d_ext00", gNB_id, round);
- write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->dl_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1);
-
- if (ue->transmission_mode[gNB_id]==7){
- snprintf(fname, 32, "dlsch%d_bf_ch_r%d.m", gNB_id, round);
- snprintf(vname, 32, "dl%d_bf_ch_r%d", gNB_id, round);
- write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->dl_bf_ch_estimates[0],512*nsymb,1,1);
- //write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[gNB_id]->dl_bf_ch_estimates[0],512,1,1);
-
- snprintf(fname, 32, "dlsch%d_bf_ch_r%d_ext00.m", gNB_id, round);
- snprintf(vname, 32, "dl%d_bf_ch_r%d_ext00", gNB_id, round);
- write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->dl_bf_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1);
- }
-
- if (ue->frame_parms.nb_antennas_rx == 2) {
- snprintf(fname, 32, "dlsch%d_ch_r%d_ext01.m", gNB_id, round);
- snprintf(vname, 32, "dl%d_ch_r%d_ext01", gNB_id, round);
- write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1);
- }
-
- if (ue->frame_parms.nb_antenna_ports_gNB == 2) {
- snprintf(fname, 32, "dlsch%d_ch_r%d_ext10.m", gNB_id, round);
- snprintf(vname, 32, "dl%d_ch_r%d_ext10", gNB_id, round);
- write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1);
-
- if (ue->frame_parms.nb_antennas_rx == 2) {
- snprintf(fname, 32, "dlsch%d_ch_r%d_ext11.m",gNB_id,round);
- snprintf(vname, 32, "dl%d_ch_r%d_ext11",gNB_id,round);
- write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb,1,1);
- }
- }
-
- snprintf(fname, 32, "dlsch%d_rxF_r%d_uespec0.m", gNB_id, round);
- snprintf(vname, 32, "dl%d_rxF_r%d_uespec0", gNB_id, round);
- write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->rxdataF_uespec_pilots[0],12*N_RB_DL,1,1);
-
- /*
- write_output("dlsch%d_ch_ext01.m","dl01_ch0_ext",pdsch_vars[gNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1);
- write_output("dlsch%d_ch_ext10.m","dl10_ch0_ext",pdsch_vars[gNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1);
- write_output("dlsch%d_ch_ext11.m","dl11_ch0_ext",pdsch_vars[gNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb,1,1);
- */
- snprintf(fname, 32, "dlsch%d_r%d_rho.m", gNB_id, round);
- snprintf(vname, 32, "dl_rho_r%d_%d", gNB_id, round);
-
- write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->dl_ch_rho_ext[harq_pid][round][0],12*N_RB_DL*nsymb,1,1);
-
- snprintf(fname, 32, "dlsch%d_r%d_rho2.m", gNB_id, round);
- snprintf(vname, 32, "dl_rho2_r%d_%d", gNB_id, round);
-
- write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->dl_ch_rho2_ext[0],12*N_RB_DL*nsymb,1,1);
-
- snprintf(fname, 32, "dlsch%d_rxF_r%d_comp0.m", gNB_id, round);
- snprintf(vname, 32, "dl%d_rxF_r%d_comp0", gNB_id, round);
- write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->rxdataF_comp0[0],12*N_RB_DL*nsymb,1,1);
- if (ue->frame_parms.nb_antenna_ports_gNB == 2) {
- snprintf(fname, 32, "dlsch%d_rxF_r%d_comp1.m", gNB_id, round);
- snprintf(vname, 32, "dl%d_rxF_r%d_comp1", gNB_id, round);
- write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->rxdataF_comp1[harq_pid][round][0],12*N_RB_DL*nsymb,1,1);
- }
-
- snprintf(fname, 32, "dlsch%d_rxF_r%d_llr.m", gNB_id, round);
- snprintf(vname, 32, "dl%d_r%d_llr", gNB_id, round);
- write_output(fname, vname, ue->pdsch_vars[0][gNB_id]->llr[0], coded_bits_per_codeword[0], 1, 0);
- snprintf(fname, 32, "dlsch%d_r%d_mag1.m", gNB_id, round);
- snprintf(vname, 32, "dl%d_r%d_mag1", gNB_id, round);
- write_output(fname, vname, ue->pdsch_vars[0][gNB_id]->dl_ch_mag0[0], 12*N_RB_DL*nsymb, 1, 1);
- snprintf(fname, 32, "dlsch%d_r%d_mag2.m", gNB_id, round);
- snprintf(vname, 32, "dl%d_r%d_mag2", gNB_id, round);
- write_output(fname, vname, ue->pdsch_vars[0][gNB_id]->dl_ch_magb0[0], 12*N_RB_DL*nsymb, 1, 1);
-
- // printf("log2_maxh = %d\n",ue->pdsch_vars[gNB_id]->log2_maxh);
-}
-
-
#ifdef DEBUG_DLSCH_DEMOD
/*
void print_bytes(char *s,__m128i *x)
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c
index 68a206e7c7..a064a91d87 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c
@@ -629,16 +629,16 @@ __m128i tmp_result4 __attribute__ ((aligned(16)));
//----------------------------------------------------------------------------------------------
int nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
- int32_t **rxdataF_comp,
+ int32_t *rxdataF_comp,
int16_t *dlsch_llr,
uint8_t symbol,
- uint32_t len,
- uint8_t first_symbol_flag,
+ uint32_t len,
+ uint8_t first_symbol_flag,
uint16_t nb_rb,
uint8_t beamforming_mode)
{
- uint32_t *rxF = (uint32_t*)&rxdataF_comp[0][((int32_t)symbol*nb_rb*12)];
+ uint32_t *rxF = (uint32_t *)&rxdataF_comp[((int32_t)symbol*nb_rb*12)];
uint32_t *llr32;
int i;
@@ -670,24 +670,23 @@ int nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
//----------------------------------------------------------------------------------------------
void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
- int32_t **rxdataF_comp,
+ int32_t *rxdataF_comp,
int16_t *dlsch_llr,
- int32_t **dl_ch_mag,
+ int32_t *dl_ch_mag,
uint8_t symbol,
- uint32_t len,
+ uint32_t len,
uint8_t first_symbol_flag,
uint16_t nb_rb,
- int16_t **llr32p,
uint8_t beamforming_mode)
{
#if defined(__x86_64__) || defined(__i386__)
- __m128i *rxF = (__m128i*)&rxdataF_comp[0][(symbol*nb_rb*12)];
+ __m128i *rxF = (__m128i*)&rxdataF_comp[(symbol*nb_rb*12)];
__m128i *ch_mag;
__m128i llr128[2];
uint32_t *llr32;
#elif defined(__arm__)
- int16x8_t *rxF = (int16x8_t*)&rxdataF_comp[0][(symbol*nb_rb*12)];
+ int16x8_t *rxF = (int16x8_t*)&rxdataF_comp[(symbol*nb_rb*12)];
int16x8_t *ch_mag;
int16x8_t xmm0;
int16_t *llr16;
@@ -699,30 +698,17 @@ void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
#if defined(__x86_64__) || defined(__i386__)
- if (first_symbol_flag==1) {
llr32 = (uint32_t*)dlsch_llr;
- } else {
- llr32 = (uint32_t*)*llr32p;
- }
#elif defined(__arm__)
- if (first_symbol_flag==1) {
llr16 = (int16_t*)dlsch_llr;
- } else {
- llr16 = (int16_t*)*llr32p;
- }
#endif
#if defined(__x86_64__) || defined(__i386__)
- ch_mag = (__m128i*)&dl_ch_mag[0][(symbol*nb_rb*12)];
+ ch_mag = (__m128i*)&dl_ch_mag[(symbol*nb_rb*12)];
#elif defined(__arm__)
- ch_mag = (int16x8_t*)&dl_ch_mag[0][(symbol*nb_rb*12)];
+ ch_mag = (int16x8_t*)&dl_ch_mag[(symbol*nb_rb*12)];
#endif
- // update output pointer according to number of REs in this symbol (<<2 because 4 bits per RE)
- if (first_symbol_flag == 1)
- *llr32p = dlsch_llr + (len<<2);
- else
- *llr32p += (len<<2);
// printf("len=%d\n", len);
len_mod4 = len&3;
@@ -786,47 +772,35 @@ void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
//----------------------------------------------------------------------------------------------
void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
- int32_t **rxdataF_comp,
+ int32_t *rxdataF_comp,
int16_t *dlsch_llr,
- int32_t **dl_ch_mag,
- int32_t **dl_ch_magb,
+ int32_t *dl_ch_mag,
+ int32_t *dl_ch_magb,
uint8_t symbol,
uint32_t len,
uint8_t first_symbol_flag,
uint16_t nb_rb,
- uint32_t llr_offset,
uint8_t beamforming_mode)
{
#if defined(__x86_64__) || defined(__i386__)
- __m128i *rxF = (__m128i*)&rxdataF_comp[0][(symbol*nb_rb*12)];
+ __m128i *rxF = (__m128i*)&rxdataF_comp[(symbol*nb_rb*12)];
__m128i *ch_mag,*ch_magb;
#elif defined(__arm__)
- int16x8_t *rxF = (int16x8_t*)&rxdataF_comp[0][(symbol*nb_rb*12)];
+ int16x8_t *rxF = (int16x8_t*)&rxdataF_comp[(symbol*nb_rb*12)];
int16x8_t *ch_mag,*ch_magb,xmm1,xmm2;
#endif
int i,len2;
unsigned char len_mod4;
- short *llr;
int16_t *llr2;
- int8_t *pllr_symbol;
- /*
- if (first_symbol_flag==1)
- llr = dlsch_llr;
- else
- llr = *llr_save;
- */
- llr = dlsch_llr;
-
- pllr_symbol = (int8_t*)dlsch_llr;
- pllr_symbol += llr_offset;
+ llr2 = dlsch_llr;
#if defined(__x86_64__) || defined(__i386__)
- ch_mag = (__m128i*)&dl_ch_mag[0][(symbol*nb_rb*12)];
- ch_magb = (__m128i*)&dl_ch_magb[0][(symbol*nb_rb*12)];
+ ch_mag = (__m128i*)&dl_ch_mag[(symbol*nb_rb*12)];
+ ch_magb = (__m128i*)&dl_ch_magb[(symbol*nb_rb*12)];
#elif defined(__arm__)
- ch_mag = (int16x8_t*)&dl_ch_mag[0][(symbol*nb_rb*12)];
- ch_magb = (int16x8_t*)&dl_ch_magb[0][(symbol*nb_rb*12)];
+ ch_mag = (int16x8_t*)&dl_ch_mag[(symbol*nb_rb*12)];
+ ch_magb = (int16x8_t*)&dl_ch_magb[(symbol*nb_rb*12)];
#endif
// printf("nr_dlsch_64qam_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
@@ -838,9 +812,6 @@ void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
dlsch_llr,
pllr_symbol);*/
- llr2 = llr;
- llr += (len*6);
-
len_mod4 =len&3;
len2=len>>2; // length in quad words (4 REs)
len2+=((len_mod4==0)?0:1);
@@ -1095,43 +1066,29 @@ void nr_dlsch_64qam_llr_SIC(NR_DL_FRAME_PARMS *frame_parms,
//----------------------------------------------------------------------------------------------
void nr_dlsch_256qam_llr(NR_DL_FRAME_PARMS *frame_parms,
- int32_t **rxdataF_comp,
+ int32_t *rxdataF_comp,
int16_t *dlsch_llr,
- int32_t **dl_ch_mag,
- int32_t **dl_ch_magb,
- int32_t **dl_ch_magr,
+ int32_t *dl_ch_mag,
+ int32_t *dl_ch_magb,
+ int32_t *dl_ch_magr,
uint8_t symbol,
uint32_t len,
uint8_t first_symbol_flag,
uint16_t nb_rb,
- uint32_t llr_offset,
uint8_t beamforming_mode)
{
- __m128i *rxF = (__m128i*)&rxdataF_comp[0][(symbol*nb_rb*12)];
+ __m128i *rxF = (__m128i*)&rxdataF_comp[(symbol*nb_rb*12)];
__m128i *ch_mag,*ch_magb,*ch_magr;
int i,len2;
unsigned char len_mod4;
- short *llr;
int16_t *llr2;
- int8_t *pllr_symbol;
- /*
- if (first_symbol_flag==1)
- llr = dlsch_llr;
- else
- llr = *llr_save;
- */
- llr = dlsch_llr;
+ llr2 = dlsch_llr;
- pllr_symbol = (int8_t*)dlsch_llr;
- pllr_symbol += llr_offset;
-
- ch_mag = (__m128i*)&dl_ch_mag[0][(symbol*nb_rb*12)];
- ch_magb = (__m128i*)&dl_ch_magb[0][(symbol*nb_rb*12)];
- ch_magr = (__m128i*)&dl_ch_magr[0][(symbol*nb_rb*12)];
- llr2 = llr;
- llr += (len*8);
+ ch_mag = (__m128i*)&dl_ch_mag[(symbol*nb_rb*12)];
+ ch_magb = (__m128i*)&dl_ch_magb[(symbol*nb_rb*12)];
+ ch_magr = (__m128i*)&dl_ch_magr[(symbol*nb_rb*12)];
len_mod4 =len&3;
len2=len>>2; // length in quad words (4 REs)
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
index bfef89ea85..df35f14869 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
@@ -308,12 +308,15 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, int n_frames)
// every 7*(1<symbol_offset/(7*(1<ofdm_symbol_size + fp->nb_prefix_samples0)+(ue->symbol_offset-n_symb_prefix0)*(fp->ofdm_symbol_size + fp->nb_prefix_samples);
- if (ue->ssb_offset < sync_pos_frame)
+ // for a correct computation of frame number to sync with the one decoded at MIB we need to take into account in which of the n_frames we got sync
+ ue->init_sync_frame = n_frames - 1 - is;
+ // we also need to take into account the shift by samples_per_frame in case the if is true
+ if (ue->ssb_offset < sync_pos_frame){
ue->rx_offset = fp->samples_per_frame - sync_pos_frame + ue->ssb_offset;
+ ue->init_sync_frame += 1;
+ }
else
ue->rx_offset = ue->ssb_offset - sync_pos_frame;
-
- ue->init_sync_frame = is;
}
/*
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
index c8ee94f510..f0e6e9984b 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
@@ -589,7 +589,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
frame_parms->ssb_index += (((nr_ue_pbch_vars->xtra_byte>>(7-i))&0x01)<<(3+i));
}
- ue->symbol_offset = nr_get_ssb_start_symbol(frame_parms,i_ssb);
+ 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;
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c b/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c
index 2b28cbb161..e7cf3c15a9 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c
@@ -74,6 +74,10 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
int prach_start, prach_sequence_length, i, prach_len, dftlen, mu, kbar, K, n_ra_prb, k, prachStartSymbol, sample_offset_slot;
//int restricted_Type;
+ fd_occasion = 0;
+ prach_len = 0;
+ dftlen = 0;
+ first_nonzero_root_idx = 0;
prach = prach_tmp;
prachF = ue->prach_vars[gNB_id]->prachF;
amp = ue->prach_vars[gNB_id]->amp;
@@ -83,14 +87,10 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
mu = nrUE_config->prach_config.prach_sub_c_spacing;
restricted_set = prach_pdu->restricted_set;
rootSequenceIndex = prach_pdu->root_seq_id;
- fd_occasion = 0;
n_ra_prb = nrUE_config->prach_config.num_prach_fd_occasions_list[fd_occasion].k1,//prach_pdu->freq_msg1;
NCS = prach_pdu->num_cs;
prach_fmt_id = prach_pdu->prach_format;
preamble_index = prach_resources->ra_PreambleIndex;
- prach_len = 0;
- dftlen = 0;
- first_nonzero_root_idx = 0;
kbar = 1;
K = 24;
k = 12*n_ra_prb - 6*fp->N_RB_UL;
@@ -218,12 +218,12 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
k *= 2;
LOG_I(PHY, "PRACH [UE %d] in slot %d, placing PRACH in position %d, msg1 frequency start %d (k1 %d), preamble_offset %d, first_nonzero_root_idx %d\n", Mod_id,
- slot,
- k,
- n_ra_prb,
- nrUE_config->prach_config.num_prach_fd_occasions_list[fd_occasion].k1,
- preamble_offset,
- first_nonzero_root_idx);
+ slot,
+ k,
+ n_ra_prb,
+ nrUE_config->prach_config.num_prach_fd_occasions_list[fd_occasion].k1,
+ preamble_offset,
+ first_nonzero_root_idx);
Xu = (int16_t*)ue->X_u[preamble_offset-first_nonzero_root_idx];
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 1e7e10def7..eb56c76366 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
@@ -471,7 +471,7 @@ int nr_dlsch_64qam_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
@param beamforming_mode beamforming mode
*/
int32_t nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
- int32_t **rxdataF_comp,
+ int32_t *rxdataF_comp,
int16_t *dlsch_llr,
uint8_t symbol,
uint32_t len,
@@ -505,14 +505,13 @@ int32_t nr_dlsch_qpsk_llr_SIC(NR_DL_FRAME_PARMS *frame_parms,
uint32_t rb_alloc);
void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
- int32_t **rxdataF_comp,
+ int32_t *rxdataF_comp,
int16_t *dlsch_llr,
- int32_t **dl_ch_mag,
+ int32_t *dl_ch_mag,
uint8_t symbol,
- uint32_t len,
+ uint32_t len,
uint8_t first_symbol_flag,
uint16_t nb_rb,
- int16_t **llr32p,
uint8_t beamforming_mode);
/**
\brief This function generates log-likelihood ratios (decoder input) for single-stream 16QAM received waveforms
@@ -553,28 +552,26 @@ void dlsch_64qam_llr_SIC(NR_DL_FRAME_PARMS *frame_parms,
uint32_t rb_alloc);
void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
- int32_t **rxdataF_comp,
+ int32_t *rxdataF_comp,
int16_t *dlsch_llr,
- int32_t **dl_ch_mag,
- int32_t **dl_ch_magb,
+ int32_t *dl_ch_mag,
+ int32_t *dl_ch_magb,
uint8_t symbol,
- uint32_t len,
+ uint32_t len,
uint8_t first_symbol_flag,
uint16_t nb_rb,
- uint32_t llr_offset,
uint8_t beamforming_mode);
void nr_dlsch_256qam_llr(NR_DL_FRAME_PARMS *frame_parms,
- int32_t **rxdataF_comp,
+ int32_t *rxdataF_comp,
int16_t *dlsch_llr,
- int32_t **dl_ch_mag,
- int32_t **dl_ch_magb,
- int32_t **dl_ch_magr,
+ int32_t *dl_ch_mag,
+ int32_t *dl_ch_magb,
+ int32_t *dl_ch_magr,
uint8_t symbol,
uint32_t len,
uint8_t first_symbol_flag,
uint16_t nb_rb,
- uint32_t llr_offset,
uint8_t beamforming_mode);
/** \fn dlsch_siso(NR_DL_FRAME_PARMS *frame_parms,
@@ -807,7 +804,7 @@ void nr_dlsch_channel_compensation(int32_t **rxdataF_ext,
NR_DL_FRAME_PARMS *frame_parms,
uint8_t nb_aatx,
uint8_t symbol,
- uint8_t start_symbol,
+ int length,
uint8_t first_symbol_flag,
uint8_t mod_order,
uint16_t nb_rb,
@@ -891,13 +888,15 @@ void nr_dlsch_channel_level_median(int **dl_ch_estimates_ext,
int start_point);
void nr_dlsch_detection_mrc(int **rxdataF_comp,
- int ***rho,
- int **dl_ch_mag,
- int **dl_ch_magb,
- short n_tx,
- short n_rx,
- unsigned char symbol,
- unsigned short nb_rb);
+ int ***rho,
+ int **dl_ch_mag,
+ int **dl_ch_magb,
+ int **dl_ch_magr,
+ short n_tx,
+ short n_rx,
+ unsigned char symbol,
+ unsigned short nb_rb,
+ int length);
void nr_dlsch_detection_mrc_core(int **rxdataF_comp,
int **rxdataF_comp_i,
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
index aa32ecc8c9..f3cca9e33d 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
@@ -38,10 +38,10 @@
//#include "PHY/defs_nr_UE.h"
#include "../NR_TRANSPORT/nr_transport_common_proto.h"
-#ifndef STANDALONE_COMPILE
+/*#ifndef STANDALONE_COMPILE
#include "UTIL/LISTS/list.h"
#endif
-
+*/
#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h"
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 76fc5f298f..6cf782d9d8 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c
@@ -31,13 +31,15 @@
#include "PHY/defs_nr_UE.h"
#include "PHY/phy_extern_nr_ue.h"
#include "nr_transport_proto_ue.h"
+#include "executables/softmodem-common.h"
void nr_get_carrier_frequencies(NR_DL_FRAME_PARMS *fp, uint64_t *dl_carrier, uint64_t *ul_carrier){
- if (downlink_frequency[0][0])
- *dl_carrier = downlink_frequency[0][0];
- else
+ if (get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra==1 || !downlink_frequency[0][0]) {
*dl_carrier = fp->dl_CarrierFreq;
+ } else {
+ *dl_carrier = downlink_frequency[0][0];
+ }
if (uplink_frequency_offset[0][0])
*ul_carrier = *dl_carrier + uplink_frequency_offset[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 d3cc8d5df4..5733ef6eb3 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
@@ -265,13 +265,15 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
LOG_D(PHY,"ulsch coding nb_rb %d, Nl = %d\n", nb_rb, harq_process->pusch_pdu.nrOfLayers);
LOG_D(PHY,"ulsch coding A %d G %d mod_order %d\n", A,G, mod_order);
- LOG_D(PHY,"harq_pid %d harq_process->ndi %d, pusch_data.new_data_indicator %d\n",harq_pid,harq_process->ndi,harq_process->pusch_pdu.pusch_data.new_data_indicator);
+ LOG_D(PHY,"harq_pid %d harq_process->ndi %d, pusch_data.new_data_indicator %d\n",
+ harq_pid,harq_process->ndi,harq_process->pusch_pdu.pusch_data.new_data_indicator);
+
if (harq_process->first_tx == 1 ||
harq_process->ndi != harq_process->pusch_pdu.pusch_data.new_data_indicator) { // this is a new packet
#ifdef DEBUG_ULSCH_CODING
printf("encoding thinks this is a new packet \n");
#endif
- harq_process->first_tx=0;
+ harq_process->first_tx = 0;
///////////////////////// a---->| add CRC |---->b /////////////////////////
///////////
/*
@@ -414,7 +416,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
///////////
///////////////////////////////////////////////////////////////////////////////
- LOG_D(PHY,"setting ndi to %d from pusch_data\n",harq_process->pusch_pdu.pusch_data.new_data_indicator);
+ LOG_D(PHY,"setting ndi to %d from pusch_data\n", harq_process->pusch_pdu.pusch_data.new_data_indicator);
harq_process->ndi = harq_process->pusch_pdu.pusch_data.new_data_indicator;
}
F = harq_process->F;
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
index 18fe11d40a..bab801e0e3 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
@@ -114,7 +114,6 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
NR_DL_FRAME_PARMS *frame_parms = &UE->frame_parms;
NR_UE_PUSCH *pusch_ue = UE->pusch_vars[thread_id][gNB_id];
- // ptrs_UplinkConfig_t *ptrs_Uplink_Config = &UE->pusch_config.dmrs_UplinkConfig.ptrs_UplinkConfig;
uint8_t num_of_codewords = 1; // tmp assumption
int Nid_cell = 0;
@@ -147,7 +146,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
get_num_re_dmrs(pusch_pdu, &nb_dmrs_re_per_rb, &number_dmrs_symbols);
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);
+ 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;
@@ -164,8 +163,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
///////////
////////////////////////////////////////////////////////////////////
- //log_dump(PHY, harq_process_ul_ue->a, 16, LOG_DUMP_CHAR,"nrue pusch tx frame %d %d: ", frame, slot);
-
+
/////////////////////////ULSCH scrambling/////////////////////////
///////////
@@ -365,7 +363,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
// TODO: performance improvement, we can skip the modulation of DMRS symbols outside the bandwidth part
// Perform this on gold sequence, not required when SC FDMA operation is done,
- LOG_D(PHY,"DMRS in symbol %d\n",l);
+ LOG_D(PHY,"DMRS in symbol %d\n",l);
nr_modulation(pusch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated
} else {
diff --git a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c
index 9a191ae6f9..c7bf459f6f 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c
@@ -59,11 +59,11 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
int16_t amp,
int nr_slot_tx,
uint8_t m0,
- uint8_t mcs,
+ uint8_t mcs,
uint8_t nrofSymbols,
uint8_t startingSymbolIndex,
uint16_t startingPRB,
- uint16_t secondHopPRB) {
+ uint16_t secondHopPRB) {
#ifdef DEBUG_NR_PUCCH_TX
printf("\t [nr_generate_pucch0] start function at slot(nr_slot_tx)=%d\n",nr_slot_tx);
#endif
@@ -112,9 +112,9 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
}
for (int l=0; l>15)
diff --git a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.h b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.h
index cb4b59c92f..665dec2443 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.h
+++ b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.h
@@ -54,11 +54,12 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
int16_t amp,
int nr_slot_tx,
uint8_t m0,
- uint8_t mcs,
+ uint8_t mcs,
uint8_t nrofSymbols,
uint8_t startingSymbolIndex,
uint16_t startingPRB,
- uint16_t secondHopPRB);
+ uint16_t secondHopPRB);
+
void nr_generate_pucch1(PHY_VARS_NR_UE *ue,
int32_t **txdataF,
NR_DL_FRAME_PARMS *frame_parms,
@@ -73,10 +74,11 @@ void nr_generate_pucch1(PHY_VARS_NR_UE *ue,
uint16_t startingPRB_intraSlotHopping,
uint8_t timeDomainOCC,
uint8_t nr_bit);
+
void nr_generate_pucch2(PHY_VARS_NR_UE *ue,
uint16_t crnti,
- uint32_t dmrs_scrambling_id,
- uint32_t data_scrambling_id,
+ uint32_t dmrs_scrambling_id,
+ uint32_t data_scrambling_id,
int32_t **txdataF,
NR_DL_FRAME_PARMS *frame_parms,
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
@@ -88,6 +90,7 @@ void nr_generate_pucch2(PHY_VARS_NR_UE *ue,
uint8_t nrofPRB,
uint16_t startingPRB,
uint8_t nr_bit);
+
void nr_generate_pucch3_4(PHY_VARS_NR_UE *ue,
uint16_t crnti,
int32_t **txdataF,
diff --git a/openair1/PHY/TOOLS/lte_phy_scope.h b/openair1/PHY/TOOLS/lte_phy_scope.h
index af9858ebad..1873fabea0 100644
--- a/openair1/PHY/TOOLS/lte_phy_scope.h
+++ b/openair1/PHY/TOOLS/lte_phy_scope.h
@@ -28,6 +28,7 @@
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
#include "PHY/impl_defs_top.h"
+#include
/* Forms and Objects */
diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c
index 90a252dc98..c840149507 100644
--- a/openair1/PHY/TOOLS/nr_phy_scope.c
+++ b/openair1/PHY/TOOLS/nr_phy_scope.c
@@ -240,7 +240,7 @@ static void genericWaterFall (OAIgraph_t *graph, scopeSample_t *values, const in
for (int pix=0; pixw; pix++) {
scopeSample_t *end=values+(pix+1)*samplesPerPixel;
end-=2;
- AssertFatal(end <= values+datasize,"diff : %u", end-values+datasize);
+ AssertFatal(end <= values+datasize,"diff : %ld", end-values+datasize);
double val=0;
for (scopeSample_t *s=values+(pix)*samplesPerPixel;
diff --git a/openair1/PHY/TOOLS/oai_dfts.c b/openair1/PHY/TOOLS/oai_dfts.c
index 6e85bca384..83207426fd 100644
--- a/openair1/PHY/TOOLS/oai_dfts.c
+++ b/openair1/PHY/TOOLS/oai_dfts.c
@@ -32,17 +32,17 @@
#define M_PI 3.14159265358979323846
#endif
#define OAIDFTS_MAIN
-#ifndef MR_MAIN
-#include "PHY/defs_common.h"
-#include "PHY/impl_defs_top.h"
-#else
+//#ifndef MR_MAIN
+//#include "PHY/defs_common.h"
+//#include "PHY/impl_defs_top.h"
+//#else
#include "time_meas.h"
#include "LOG/log.h"
#define debug_msg
#define ONE_OVER_SQRT2_Q15 23170
-int oai_exit=0;
-#endif
+//int oai_exit=0;
+//#endif
#define ONE_OVER_SQRT3_Q15 18919
@@ -50,6 +50,8 @@ int oai_exit=0;
#include "assertions.h"
+#include "tools_defs.h"
+
#define print_shorts(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7])
#define print_shorts256(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7],(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15])
diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h
index 86c94421f2..66cb51adc6 100644
--- a/openair1/PHY/defs_RU.h
+++ b/openair1/PHY/defs_RU.h
@@ -436,6 +436,14 @@ typedef enum {
typedef struct RU_t_s {
/// index of this ru
uint32_t idx;
+ /// pointer to first RU
+ struct RU_t_s *ru0;
+ /// pointer to ru_mask
+ uint64_t *ru_mask;
+ /// pointer to ru_mutex
+ pthread_mutex_t *ru_mutex;
+ /// pointer to ru_cond
+ pthread_cond_t *ru_cond;
/// Pointer to configuration file
char *rf_config_file;
/// southbound interface
@@ -446,6 +454,12 @@ typedef struct RU_t_s {
node_function_t function;
/// Ethernet parameters for fronthaul interface
eth_params_t eth_params;
+ /// flag to indicate RF emulation mode
+ int emulate_rf;
+ /// numerology index
+ int numerology;
+ /// flag to indicate basicsim operation
+ int basicsim;
/// flag to indicate the RU is in sync with a master reference
int in_synch;
/// timing offset
diff --git a/openair1/PHY/defs_common.h b/openair1/PHY/defs_common.h
index 70ca77fcc6..a371b2334b 100644
--- a/openair1/PHY/defs_common.h
+++ b/openair1/PHY/defs_common.h
@@ -945,6 +945,23 @@ extern int sync_var;
#define DECODE_NUM_FPTR 13
+// Mask for identifying subframe for MBMS
+#define MBSFN_TDD_SF3 0x80// for TDD
+#define MBSFN_TDD_SF4 0x40
+#define MBSFN_TDD_SF7 0x20
+#define MBSFN_TDD_SF8 0x10
+#define MBSFN_TDD_SF9 0x08
+
+
+
+#define MBSFN_FDD_SF1 0x80// for FDD
+#define MBSFN_FDD_SF2 0x40
+#define MBSFN_FDD_SF3 0x20
+#define MBSFN_FDD_SF6 0x10
+#define MBSFN_FDD_SF7 0x08
+#define MBSFN_FDD_SF8 0x04
+
+
typedef uint8_t(decoder_if_t)(int16_t *y,
int16_t *y2,
uint8_t *decoded_bytes,
diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h
index 0f1bf75114..030d50bc04 100644
--- a/openair1/PHY/defs_eNB.h
+++ b/openair1/PHY/defs_eNB.h
@@ -164,10 +164,10 @@ typedef struct {
/// - first index: rx antenna id [0..nb_antennas_rx[
/// - second index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t **ul_ch_magb;
- /// measured RX power based on DRS
- int ulsch_power[2];
- /// measured Interference power based on DRS
- int ulsch_interference_power[2];
+ /// measured RX power based on DMRS
+ int ulsch_power[4];
+ /// measured RX power of noise
+ int ulsch_noise_power[4];
/// \brief llr values.
/// - first index: ? [0..1179743] (hard coded)
int16_t *llr;
@@ -217,6 +217,58 @@ typedef struct {
int ret;
} td_params;
+/// Context data structure for RX/TX portion of subframe processing
+typedef struct {
+ /// Component Carrier index
+ uint8_t CC_id;
+ /// timestamp transmitted to HW
+ openair0_timestamp timestamp_tx;
+ openair0_timestamp timestamp_rx;
+ /// subframe to act upon for transmission
+ int subframe_tx;
+ /// subframe to act upon for reception
+ int subframe_rx;
+ /// frame to act upon for transmission
+ int frame_tx;
+ /// frame to act upon for reception
+ int frame_rx;
+ int frame_prach;
+ int subframe_prach;
+ int frame_prach_br;
+ int subframe_prach_br;
+ /// \brief Instance count for RXn-TXnp4 processing thread.
+ /// \internal This variable is protected by \ref mutex_rxtx.
+ int instance_cnt;
+ /// pthread structure for RXn-TXnp4 processing thread
+ pthread_t pthread;
+ /// pthread attributes for RXn-TXnp4 processing thread
+ pthread_attr_t attr;
+ /// condition variable for tx processing thread
+ pthread_cond_t cond;
+ /// mutex for RXn-TXnp4 processing thread
+ pthread_mutex_t mutex;
+ /// scheduling parameters for RXn-TXnp4 thread
+ struct sched_param sched_param_rxtx;
+
+ /// \internal This variable is protected by \ref mutex_RUs.
+ int instance_cnt_RUs;
+ /// condition variable for tx processing thread
+ pthread_cond_t cond_RUs;
+ /// mutex for RXn-TXnp4 processing thread
+ pthread_mutex_t mutex_RUs;
+ tpool_t *threadPool;
+ int nbEncode;
+ int nbDecode;
+ notifiedFIFO_t *respEncode;
+ notifiedFIFO_t *respDecode;
+ pthread_mutex_t mutex_emulateRF;
+ int instance_cnt_emulateRF;
+ pthread_t pthread_emulateRF;
+ pthread_attr_t attr_emulateRF;
+ pthread_cond_t cond_emulateRF;
+ int first_rx;
+} L1_rxtx_proc_t;
+
typedef struct {
struct PHY_VARS_eNB_s *eNB;
LTE_eNB_DLSCH_t *dlsch;
@@ -362,8 +414,11 @@ typedef struct L1_proc_t_s {
L1_rxtx_proc_t L1_proc,L1_proc_tx;
/// stats thread pthread descriptor
pthread_t process_stats_thread;
+ /// L1 stats pthread descriptor
+ pthread_t L1_stats_thread;
/// for waking up tx procedure
RU_proc_t *ru_proc;
+ struct PHY_VARS_eNB_s *eNB;
} L1_proc_t;
@@ -395,36 +450,73 @@ typedef struct {
short n0_subband_power_avg_dB;
// eNB measurements (per user)
//! estimated received spatial signal power (linear)
- unsigned int rx_spatial_power[NUMBER_OF_UE_MAX][2][2];
+ unsigned int rx_spatial_power[NUMBER_OF_SRS_MAX][2][2];
//! estimated received spatial signal power (dB)
- unsigned short rx_spatial_power_dB[NUMBER_OF_UE_MAX][2][2];
+ unsigned short rx_spatial_power_dB[NUMBER_OF_SRS_MAX][2][2];
//! estimated rssi (dBm)
- short rx_rssi_dBm[NUMBER_OF_UE_MAX];
+ short rx_rssi_dBm[NUMBER_OF_SRS_MAX];
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
- int rx_correlation[NUMBER_OF_UE_MAX][2];
+ int rx_correlation[NUMBER_OF_SRS_MAX][2];
//! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation)
- int rx_correlation_dB[NUMBER_OF_UE_MAX][2];
+ int rx_correlation_dB[NUMBER_OF_SRS_MAX][2];
/// Wideband CQI (= SINR)
- int wideband_cqi[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB];
+ int wideband_cqi[NUMBER_OF_SRS_MAX][MAX_NUM_RU_PER_eNB];
/// Wideband CQI in dB (= SINR dB)
- int wideband_cqi_dB[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB];
+ int wideband_cqi_dB[NUMBER_OF_SRS_MAX][MAX_NUM_RU_PER_eNB];
/// Wideband CQI (sum of all RX antennas, in dB)
- char wideband_cqi_tot[NUMBER_OF_UE_MAX];
+ char wideband_cqi_tot[NUMBER_OF_SRS_MAX];
/// Subband CQI per RX antenna and RB (= SINR)
- int subband_cqi[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB][100];
+ int subband_cqi[NUMBER_OF_SRS_MAX][MAX_NUM_RU_PER_eNB][100];
/// Total Subband CQI and RB (= SINR)
int subband_cqi_tot[NUMBER_OF_UE_MAX][100];
/// Subband CQI in dB and RB (= SINR dB)
- int subband_cqi_dB[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB][100];
+ int subband_cqi_dB[NUMBER_OF_SRS_MAX][MAX_NUM_RU_PER_eNB][100];
/// Total Subband CQI and RB
- int subband_cqi_tot_dB[NUMBER_OF_UE_MAX][100];
+ int subband_cqi_tot_dB[NUMBER_OF_SRS_MAX][100];
/// PRACH background noise level
int prach_I0;
/// PUCCH background noise level
int n0_pucch_dB;
} PHY_MEASUREMENTS_eNB;
+typedef struct {
+ uint16_t rnti;
+ int frame;
+ int round_trials[8];
+ int total_bytes_tx;
+ int total_bytes_rx;
+ int current_G;
+ int current_TBS;
+ int current_Qm;
+ int current_mcs;
+ int current_RI;
+ int timing_offset;
+ int ulsch_power[4];
+ int ulsch_noise_power[4];
+} eNB_SCH_STATS_t;
+
+typedef struct {
+ uint16_t rnti;
+ int frame;
+ int pucch1_trials;
+ int pucch1_thres;
+ int current_pucch1_stat_pos;
+ int current_pucch1_stat_neg;
+ int pucch1_positive_SR;
+ int pucch1_low_stat[4];
+ int pucch1_high_stat[4];
+ int pucch1_phase;
+ int pucch1a_trials;
+ int current_pucch1a_stat_re;
+ int current_pucch1a_stat_im;
+ int pucch1ab_DTX;
+ int pucch1b_trials;
+ int current_pucch1b_stat_re;
+ int current_pucch1b_stat_im;
+ int pucch3_trials;
+ int current_pucch3_stat;
+} eNB_UCI_STATS_t;
/// Top-level PHY Data Structure for eNB
typedef struct PHY_VARS_eNB_s {
@@ -472,13 +564,13 @@ typedef struct PHY_VARS_eNB_s {
LTE_eNB_MPDCCH mpdcch_vars[2];
LTE_eNB_PRACH prach_vars_br;
LTE_eNB_COMMON common_vars;
- LTE_eNB_UCI uci_vars[NUMBER_OF_UCI_VARS_MAX];
- LTE_eNB_SRS srs_vars[NUMBER_OF_UE_MAX];
+ LTE_eNB_UCI uci_vars[NUMBER_OF_UCI_MAX];
+ LTE_eNB_SRS srs_vars[NUMBER_OF_SRS_MAX];
LTE_eNB_PBCH pbch;
- LTE_eNB_PUSCH *pusch_vars[NUMBER_OF_UE_MAX];
+ LTE_eNB_PUSCH *pusch_vars[NUMBER_OF_ULSCH_MAX];
LTE_eNB_PRACH prach_vars;
- LTE_eNB_DLSCH_t *dlsch[NUMBER_OF_UE_MAX][2]; // Nusers times two spatial streams
- LTE_eNB_ULSCH_t *ulsch[NUMBER_OF_UE_MAX+1]; // Nusers + number of RA
+ LTE_eNB_DLSCH_t *dlsch[NUMBER_OF_DLSCH_MAX][2]; // Num active DLSCH contexts times two spatial streams
+ LTE_eNB_ULSCH_t *ulsch[NUMBER_OF_ULSCH_MAX]; // Num active ULSCH contexts
LTE_eNB_DLSCH_t *dlsch_SI,*dlsch_ra,*dlsch_p;
LTE_eNB_DLSCH_t *dlsch_MCH;
LTE_eNB_DLSCH_t *dlsch_PCH;
@@ -489,7 +581,7 @@ typedef struct PHY_VARS_eNB_s {
uint32_t lte_gold_table[20][2][14];
/// UE-specific reference symbols (p=5), TM 7
- uint32_t lte_gold_uespec_port5_table[NUMBER_OF_UE_MAX][20][38];
+ uint32_t lte_gold_uespec_port5_table[NUMBER_OF_DLSCH_MAX][20][38];
/// UE-specific reference symbols (p=7...14), TM 8/9/10
uint32_t lte_gold_uespec_table[2][20][2][21];
@@ -521,6 +613,9 @@ typedef struct PHY_VARS_eNB_s {
uint8_t pbch_pdu[4]; //PBCH_PDU_SIZE
char eNB_generate_rar;
+ /// indicator that eNB signal generation uses DTX (i.e. signal is cleared in each subframe
+ int use_DTX;
+ int32_t **subframe_mask;
/// Indicator set to 0 after first SR
uint8_t first_sr[NUMBER_OF_UE_MAX];
@@ -592,7 +687,12 @@ typedef struct PHY_VARS_eNB_s {
/// Information regarding TM5
MU_MIMO_mode mu_mimo_mode[NUMBER_OF_UE_MAX];
-
+ /// statistics for DLSCH measurement collection
+ eNB_SCH_STATS_t dlsch_stats[NUMBER_OF_SCH_STATS_MAX];
+ /// statistics for ULSCH measurement collection
+ eNB_SCH_STATS_t ulsch_stats[NUMBER_OF_SCH_STATS_MAX];
+ /// statis for UCI (PUCCH) measurement collection
+ eNB_UCI_STATS_t uci_stats[NUMBER_OF_SCH_STATS_MAX];
/// target_ue_dl_mcs : only for debug purposes
uint32_t target_ue_dl_mcs;
/// target_ue_ul_mcs : only for debug purposes
diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h
index 129f7a9a71..364e3a118a 100644
--- a/openair1/PHY/defs_gNB.h
+++ b/openair1/PHY/defs_gNB.h
@@ -751,7 +751,6 @@ typedef struct PHY_VARS_gNB_s {
// nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu;
// nfapi_nr_ul_dci_request_pdus_t *ul_dci_pdu;
-
uint16_t num_pdsch_rnti[80];
NR_gNB_SSB_t ssb[64];
NR_gNB_PBCH pbch;
@@ -886,6 +885,8 @@ typedef struct PHY_VARS_gNB_s {
tpool_t *threadPool;
int nbDecode;
uint8_t pusch_proc_threads;
+ int number_of_nr_dlsch_max;
+ int number_of_nr_ulsch_max;
void * scopeData;
} PHY_VARS_gNB;
diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h
index bf0a7bc9e5..0625c6b050 100644
--- a/openair1/PHY/defs_nr_UE.h
+++ b/openair1/PHY/defs_nr_UE.h
@@ -763,6 +763,8 @@ typedef struct {
int is_synchronized;
/// \brief Indicates on which frame is synchronized in a two frame synchronization
int is_synchronized_on_frame;
+ /// \brief Indicator that UE lost frame synchronization
+ int lost_sync;
/// Data structure for UE process scheduling
UE_nr_proc_t proc;
/// Flag to indicate the UE shouldn't do timing correction at all
@@ -789,6 +791,8 @@ typedef struct {
uint8_t ho_initiated;
/// \brief indicator that Handover procedure has been triggered
uint8_t ho_triggered;
+ /// threshold for false dci detection
+ int dci_thres;
/// \brief Measurement variables.
PHY_NR_MEASUREMENTS measurements;
NR_DL_FRAME_PARMS frame_parms;
@@ -959,25 +963,9 @@ typedef struct {
//#if defined(UPGRADE_RAT_NR)
#if 1
-
SystemInformationBlockType1_nr_t systemInformationBlockType1_nr;
-
- CellGroupConfig_t cell_group_config;
- PDSCH_ServingCellConfig_t PDSCH_ServingCellConfig;
- PDSCH_Config_t PDSCH_Config;
-
PUCCH_ConfigCommon_nr_t pucch_config_common_nr[NUMBER_OF_CONNECTED_gNB_MAX];
PUCCH_Config_t pucch_config_dedicated_nr[NUMBER_OF_CONNECTED_gNB_MAX];
-
- PUSCH_Config_t pusch_config;
- SRS_NR srs;
-
- crossCarrierSchedulingConfig_t crossCarrierSchedulingConfig;
- supplementaryUplink_t supplementaryUplink;
- dmrs_DownlinkConfig_t dmrs_DownlinkConfig;
- csi_MeasConfig_t csi_MeasConfig;
- PUSCH_ServingCellConfig_t PUSCH_ServingCellConfig;
-
#endif
uint8_t ncs_cell[20][7];
@@ -1080,6 +1068,7 @@ typedef struct {
typedef struct nr_rxtx_thread_data_s {
UE_nr_rxtx_proc_t proc;
PHY_VARS_NR_UE *UE;
+ notifiedFIFO_t txFifo;
} nr_rxtx_thread_data_t;
#include "SIMULATION/ETH_TRANSPORT/defs.h"
diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h
index 398252c37b..d333732d1f 100644
--- a/openair1/PHY/defs_nr_common.h
+++ b/openair1/PHY/defs_nr_common.h
@@ -93,22 +93,24 @@
#define NR_MAX_CSET_DURATION 3
#define NR_MAX_NB_RBG 18
-#define NR_MAX_NB_LAYERS 8 // SU-MIMO (3GPP TS 38.211 V15.4.0 section 7.3.1.3)
+#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_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_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 34
+#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_ULSCH_SEGMENTS MAX_NUM_NR_DLSCH_SEGMENTS
+#define MAX_NUM_NR_ULSCH_SEGMENTS 34
#define MAX_NR_ULSCH_PAYLOAD_BYTES (MAX_NUM_NR_ULSCH_SEGMENTS*1056)
#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
extern const uint8_t nr_rv_round_map[4];
extern const uint8_t nr_rv_round_map_ue[4];
diff --git a/openair1/PHY/impl_defs_nr.h b/openair1/PHY/impl_defs_nr.h
index fad578c8b0..93dbf513e8 100644
--- a/openair1/PHY/impl_defs_nr.h
+++ b/openair1/PHY/impl_defs_nr.h
@@ -36,7 +36,6 @@
#include
#include "types.h"
-#include "NR_PDSCH-TimeDomainResourceAllocation.h"
#ifdef DEFINE_VARIABLES_PHY_IMPLEMENTATION_DEFS_NR_H
#define EXTERN
@@ -340,116 +339,22 @@ typedef struct {
*
************************************************************************/
-/* FFS TODO_NR partial structure that should be complete */
-
-typedef enum {
- semiStatic = 0,
- dynamic = 1
-} pdsch_HARQ_ACK_Codebook_t;
-
-
-////////////////////////////////////////////////////////////////////////////////################################
#define MAX_NR_RATE_MATCH_PATTERNS 4
#define MAX_NR_ZP_CSI_RS_RESOURCES 32
#define MAX_NR_OF_DL_ALLOCATIONS 16
#define MAX_NR_OF_UL_ALLOCATIONS (16)
-typedef enum{
- dl_resourceAllocationType0 = 1,
- dl_resourceAllocationType1 = 2,
- dl_dynamicSwitch = 3
-} dl_resourceAllocation_t;
-typedef enum{
- dl_rgb_config1 = 1,
- dl_rgb_config2 = 2
-} dl_rgb_Size_t;
typedef enum {
- st_n4 = 1,
- st_wideband = 2
-} static_bundleSize_t;
-typedef enum {
- dy_1_n4 = 1,
- dy_1_wideband = 2,
- dy_1_n2_wideband = 3,
- dy_1_n4_wideband = 4
-} bundleSizeSet1_t;
-typedef enum {
- dy_2_n4 = 1,
- dy_2_wideband = 2,
-} bundleSizeSet2_t;
-typedef struct{
- bundleSizeSet1_t bundleSizeSet1;
- bundleSizeSet2_t bundleSizeSet2;
-} dynamic_bundleSize_t;
-typedef struct {
- static_bundleSize_t staticBundling;
- dynamic_bundleSize_t dynamicBundlig;
-} prb_bundleType_t;
-typedef enum {
- nb_code_n1 = 1,
- nb_code_n2 = 2
-} maxNrofCodeWordsScheduledByDCI_t;
-typedef struct{
-// to be defined FIXME!!!
-}rateMatchPattern_t;
-typedef struct{
-// to be defined FIXME!!!
-}zp_CSI_RS_Resource_t;
-typedef struct {
-/*
- * resourceAllocation
- */
- dl_resourceAllocation_t dl_resourceAllocation;
-/*
- * corresponds to I, where I the number of entries in the higher layer parameter pdsch-AllocationList
- */
- uint8_t n_pdsh_alloc_list;
-/*
- * rateMatchPatternToAddModList
- */
- rateMatchPattern_t rateMatchPatternToAddModList[MAX_NR_RATE_MATCH_PATTERNS];
-/*
- * rateMatchPatternToReleaseList
- */
- uint8_t rateMatchPatternToReleaseList[MAX_NR_RATE_MATCH_PATTERNS];
- /*
- * n_rateMatchPatterns indicates the number of rateMatchPatterns defined currently
- */
- uint8_t n_rateMatchPatterns;
- /*
- * zp-CSI-RS-ResourceToAddModList
- */
- zp_CSI_RS_Resource_t zp_CSI_RS_Resource[MAX_NR_ZP_CSI_RS_RESOURCES];
- /*
- * zp-CSI-RS-ResourceToReleaseList
- */
- uint8_t zp_CSI_RS_ResourceId[MAX_NR_ZP_CSI_RS_RESOURCES];
- /*
- * n_zp-CSI-RS-Resource
- */
- uint8_t n_zp_CSI_RS_ResourceId;
-/*
- * rgb_Size
- */
- dl_rgb_Size_t dl_rgbSize;
-/*
- * prb-BundlingType
- */
- prb_bundleType_t prbBundleType;
-/*
- * pdsch-HARQ-ACK-Codebook: this is part of the IE PhysicalCellGroupConfig which is used to configure cell-group specific L1 parameters (TS 38.331)
- */
- pdsch_HARQ_ACK_Codebook_t pdsch_HARQ_ACK_Codebook;
- ////////////////////////////////////////////////////////////////////////////////################################
+ typeA = 0,
+ typeB = 1
+} mappingType_t;
-/*
- Maximum number of code words that a single DCI may schedule. This changes the number of MCS/RV/NDI bits in the DCI message from 1 to 2.
-*/
- maxNrofCodeWordsScheduledByDCI_t maxNrofCodeWordsScheduledByDCI;
-
- NR_PDSCH_TimeDomainResourceAllocation_t *pdsch_TimeDomainResourceAllocation[MAX_NR_OF_DL_ALLOCATIONS];
-
-} PDSCH_Config_t;
+typedef enum {
+ pdsch_dmrs_pos0 = 0,
+ pdsch_dmrs_pos1 = 1,
+ pdsch_dmrs_pos2 = 2,
+ pdsch_dmrs_pos3 = 3,
+} pdsch_dmrs_AdditionalPosition_t;
/***********************************************************************
*
@@ -459,128 +364,20 @@ typedef struct {
*
************************************************************************/
-
-typedef enum {
- enable_tpc_accumulation = 0, /* by default it is enable */
- disable_tpc_accumulation = 1
-} tpc_Accumulation_t;
-
-typedef enum {
- typeA = 0,
- typeB = 1
-} mappingType_t;
-
-typedef struct {
- tpc_Accumulation_t tpc_Accumulation;
-} PUSCH_PowerControl_t;
-
-typedef struct {
-
- uint8_t k2;
- mappingType_t mappingType;
- uint8_t startSymbolAndLength;
-} PUSCH_TimeDomainResourceAllocation_t;
-////////////////////////////////////////////////////////////////////////////////################################
-typedef enum{
- maxCodeBlockGroupsPerTransportBlock_n2 = 2,
- maxCodeBlockGroupsPerTransportBlock_n4 = 4,
- maxCodeBlockGroupsPerTransportBlock_n6 = 6,
- maxCodeBlockGroupsPerTransportBlock_n8 = 8
-} maxCodeBlockGroupsPerTransportBlock_t;
-typedef struct{ // The IE PUSCH-ServingCellConfig is used to configure UE specific PUSCH parameters that are common across the UE's BWPs of one serving cell
- maxCodeBlockGroupsPerTransportBlock_t maxCodeBlockGroupsPerTransportBlock;
-} PUSCH_ServingCellConfig_t;
-typedef struct{ // CSI-MeasConfig IE is used to configure CSI-RS (reference signals)
- uint8_t reportTriggerSize;
-} csi_MeasConfig_t;
-typedef enum {
- pdsch_dmrs_type1 = 0,
- pdsch_dmrs_type2 = 1
-} pdsch_dmrs_type_t;
typedef enum {
pusch_dmrs_type1 = 0,
pusch_dmrs_type2 = 1
} pusch_dmrs_type_t;
-typedef enum {
- pdsch_dmrs_pos0 = 0,
- pdsch_dmrs_pos1 = 1,
- pdsch_dmrs_pos3 = 3,
-} pdsch_dmrs_AdditionalPosition_t;
typedef enum {
pusch_dmrs_pos0 = 0,
pusch_dmrs_pos1 = 1,
pusch_dmrs_pos2 = 2,
pusch_dmrs_pos3 = 3,
} pusch_dmrs_AdditionalPosition_t;
-typedef enum {
- offset00 = 0,
- offset01 = 1,
- offset10 = 2,
- offset11 = 3,
-} ptrs_resource_elementoffset_t;
-typedef enum {
- pdsch_len1 = 1,
- pdsch_len2 = 2
-} pdsch_maxLength_t;
typedef enum {
pusch_len1 = 1,
pusch_len2 = 2
} pusch_maxLength_t;
-typedef struct {
- uint8_t ptrs_mcs1;
- uint8_t ptrs_mcs2;
- uint8_t ptrs_mcs3;
-} ptrs_time_density_t;
-typedef struct {
- uint16_t n_rb0;
- uint16_t n_rb1;
-} ptrs_frequency_density_t;
-typedef struct { // The IE PTRS-UplinkConfig is used to configure uplink Phase-Tracking-Reference-Signals (PTRS)
- uint8_t num_ptrs_ports;
- ptrs_resource_elementoffset_t resourceElementOffset;
- ptrs_time_density_t timeDensity;
- ptrs_frequency_density_t frequencyDensity;
- uint32_t ul_ptrs_power;
-} ptrs_UplinkConfig_t;
-typedef struct { // The IE DMRS-DownlinkConfig is used to configure downlink demodulation reference signals for PDSCH
- pdsch_dmrs_type_t pdsch_dmrs_type;
- pdsch_dmrs_AdditionalPosition_t pdsch_dmrs_AdditionalPosition;
- pdsch_maxLength_t pdsch_maxLength;
- uint16_t scramblingID0;
- uint16_t scramblingID1;
-} dmrs_DownlinkConfig_t;
-typedef struct { // The IE DMRS-UplinkConfig is used to configure uplink demodulation reference signals for PUSCH
- pusch_dmrs_type_t pusch_dmrs_type;
- pusch_dmrs_AdditionalPosition_t pusch_dmrs_AdditionalPosition;
- pusch_maxLength_t pusch_maxLength;
- ptrs_UplinkConfig_t ptrs_UplinkConfig;
- uint16_t scramblingID0;
- uint16_t scramblingID1;
-} dmrs_UplinkConfig_t;
-typedef struct {
-/*
- * Serving cell ID of a PSCell. The PCell of the Master Cell Group uses ID = 0
- */
- uint8_t servCellIndex;
-}servCellIndex_t;
-typedef struct{
- uint8_t cif_presence;
-}own_t;
-typedef struct{
- servCellIndex_t scheduling_cell_id;
- uint8_t cif_InSchedulingCell;
-}other_t;
-typedef struct{
- own_t own;
- other_t other;
-}schedulingCellInfo_t;
-typedef struct{
- schedulingCellInfo_t schedulingCellInfo;
-} crossCarrierSchedulingConfig_t;
-typedef struct{
- // this variable will be filled with '1' if SUL is supported and '0' if SUL is not supported
- uint8_t supplementaryUplink;
-}supplementaryUplink_t;
typedef enum {
txConfig_codebook = 1,
@@ -621,57 +418,6 @@ typedef struct {
betaOffset_type_t betaOffset_type;
betaOffset_t betaOffset;
} uci_onPusch_t;
-typedef struct {
-/*
- * txConfig
- */
- txConfig_t txConfig;
-/*
- * frequencyHopping
- */
- frequencyHopping_t frequencyHopping;
-/*
- * frequencyHoppingOffsetLists
- */
- uint16_t frequencyHoppingOffsetLists[4];
- // n_frequencyHoppingOffsetLists contains the number of offsets listed. We can list up to 4 offsets
- uint8_t n_frequencyHoppingOffsetLists;
-/*
- * resourceAllocation
- */
- ul_resourceAllocation_t ul_resourceAllocation;
-/*
- * DMRS-Uplinkconfig
- */
- dmrs_UplinkConfig_t dmrs_UplinkConfig;
-/*
- * rgb_Size
- */
- ul_rgb_Size_t ul_rgbSize;
-/*
- * corresponds to I, where I the number of entries in the higher layer parameter pusch-AllocationList
- */
- uint8_t n_push_alloc_list;
-/*
- * transformPrecoder
- */
-transformPrecoder_t transformPrecoder;
-/*
- * codebookSubset
- */
-codebookSubset_t codebookSubset;
-/*
- * maxRank
- */
-uint8_t maxRank;
-/*
- * uci_onPusch
- */
-uci_onPusch_t uci_onPusch;
-////////////////////////////////////////////////////////////////////////////////################################
- PUSCH_PowerControl_t pusch_PowerControl;
- PUSCH_TimeDomainResourceAllocation_t *pusch_TimeDomainResourceAllocation[MAX_NR_OF_UL_ALLOCATIONS];
-} PUSCH_Config_t;
/***********************************************************************
*
@@ -890,150 +636,6 @@ typedef struct {
PUCCH_PowerControl_t pucch_PowerControl;
} PUCCH_Config_t;
-/***********************************************************************
-*
-* FUNCTIONALITY : PhysicalCellGroupConfig
-*
-* DESCRIPTION : Physical cell group configuration
-*
-************************************************************************/
-
-typedef uint16_t RNTI_value_t;
-
-typedef struct {
-/*
- -- Enables spatial bundling of HARQ ACKs. It is configured per cell group (i.e. for all the cells within the cell group) for PUCCH
- -- reporting of HARQ-ACK. It is only applicable when more than 4 layers are possible to schedule.
- -- Corresponds to L1 parameter 'HARQ-ACK-spatial-bundling' (see 38.213, section FFS_Section)
- -- Absence indicates that spatial bundling is disabled.
-*/
- bool harq_ACK_SpatialBundlingPUCCH;
-/*
- -- Enables spatial bundling of HARQ ACKs. It is configured per cell group (i.e. for all the cells within the cell group) for PUSCH
- -- reporting of HARQ-ACK. It is only applicable when more than 4 layers are possible to schedule.
- -- Corresponds to L1 parameter 'HARQ-ACK-spatial-bundling' (see 38.213, section FFS_Section)
- -- Absence indicates that spatial bundling is disabled.
-*/
- bool harq_ACK_SpatialBundlingPUSCH;
-/*
- -- The maximum transmit power to be used by the UE in this NR cell group.
-*/
- uint8_t p_NR;
-/*
- -- The PDSCH HARQ-ACK codebook is either semi-static of dynamic. This is applicable to both CA and none CA operation.
- -- Corresponds to L1 parameter 'HARQ-ACK-codebook' (see 38.213, section FFS_Section)
-*/
- pdsch_HARQ_ACK_Codebook_t pdsch_HARQ_ACK_Codebook;
-/*
- -- RNTI used for SRS TPC commands on DCI. Corresponds to L1 parameter 'TPC-SRS-RNTI' (see 38.213, section 10)
-*/
- RNTI_value_t tpc_SRS_RNTI;
-/*
- -- RNTI used for PUCCH TPC commands on DCI. Corresponds to L1 parameter 'TPC-PUCCH-RNTI' (see 38.213, section 10).
-*/
- RNTI_value_t tpc_PUCCH_RNTI;
-/*
- -- RNTI used for PUSCH TPC commands on DCI. Corresponds to L1 parameter 'TPC-PUSCH-RNTI' (see 38.213, section 10)
-*/
- RNTI_value_t tpc_PUSCH_RNTI;
-} PhysicalCellGroupConfig_t;
-
-/***********************************************************************
-*
-* FUNCTIONALITY : CellGroupConfig
-*
-* DESCRIPTION : Cell Group configuration
-*
-************************************************************************/
-
-/* FFS TODO_NR partial structure that should be complete */
-
-typedef struct {
-/*
- cellGroupId CellGroupId,
-
- -- Logical Channel configuration and association with radio bearers:
- rlc-BearerToAddModList SEQUENCE (SIZE(1..maxLC-ID)) OF RLC-Bearer-Config OPTIONAL, -- Need N
- rlc-BearerToReleaseList SEQUENCE (SIZE(1..maxLC-ID)) OF LogicalChannelIdentity OPTIONAL, -- Need N
-
- -- Parameters applicable for the entire cell group:
- mac-CellGroupConfig MAC-CellGroupConfig OPTIONAL, -- Need M
-*/
- PhysicalCellGroupConfig_t physicalCellGroupConfig;
-/*
- -- Serving Cell specific parameters (SpCell and SCells)
- spCellConfig SpCellConfig OPTIONAL, -- Need M
- sCellToAddModList SEQUENCE (SIZE (1..maxNrofSCells)) OF SCellConfig OPTIONAL, -- Need N
- -- List of seconary serving cells to be released (not applicable for SpCells)
- sCellToReleaseList SEQUENCE (SIZE (1..maxNrofSCells)) OF SCellIndex OPTIONAL, -- Need N
- ...
- */
-} CellGroupConfig_t;
-
-/***********************************************************************
-*
-* FUNCTIONALITY : PDSCH_ServingCellConfig
-*
-* DESCRIPTION : pdsch serving cell configuration
-*
-************************************************************************/
-
-/* FFS TODO_NR partial structure that should be complete */
-
-typedef int PDSCH_CodeBlockGroupTransmission_t; /* dummy struct which should be change by correct structure */
-
-typedef enum {
- xOh6 = 0,
- xOh12 = 1,
- xOh18 = 2
-} xOverhead_t;
-
-typedef enum {
- n2_dl_harq = 2,
- n4_dl_harq = 4,
- n6_dl_harq = 6,
- n10_dl_harq = 10,
- n12_dl_harq = 12,
- n16_dl_harq = 16
-} nrofHARQ_ProcessesForPDSCH_t;
-typedef enum{
- maxCodeBlockGroupsPerTransportBlock_dl_n2 = 2,
- maxCodeBlockGroupsPerTransportBlock_dl_n4 = 4,
- maxCodeBlockGroupsPerTransportBlock_dl_n6 = 6,
- maxCodeBlockGroupsPerTransportBlock_dl_n8 = 8
-} maxCodeBlockGroupsPerTransportBlock_dl_t;
-
-typedef struct {
-/*
- -- Enables and configures code-block-group (CBG) based transmission (see 38.213, section 9.1.1)
-*/
- PDSCH_CodeBlockGroupTransmission_t *codeBlockGroupTransmission;
-/*
- -- Accounts for overhead from CSI-RS, CORESET, etc. If the field is absent, the UE applies value xOh0.
- -- Corresponds to L1 parameter 'Xoh-PDSCH' (see 38.214, section 5.1.3.2)
-*/
- xOverhead_t xOverhead;
-/*
- -- The number of HARQ processes to be used on the PDSCH of a serving cell. n2 corresponds to 2 HARQ processes, n4 to 4 HARQ processes
- -- and so on. If the field is absent, the UE uses 8 HARQ processes.
- -- Corresponds to L1 parameter 'number-HARQ-process-PDSCH' (see 38.214, section REF)
-*/
- nrofHARQ_ProcessesForPDSCH_t nrofHARQ_ProcessesForPDSCH;
-/*
- -- The ID of the serving cell (of the same cell group) to use for PUCCH.
- -- If the field is absent, the UE sends the HARQ feedback on the PUCCH of the SpCell of this cell group.
-*/
- uint8_t pucch_Cell;
-/*
- * maxCodeBlockGroupsPerTransportBlock_dl_t
- */
- maxCodeBlockGroupsPerTransportBlock_dl_t maxCodeBlockGroupsPerTransportBlock_dl;
-/*
- * codeBlockGroupFlushIndicator (boolean)
- */
- uint8_t codeBlockGroupFlushIndicator;
-} PDSCH_ServingCellConfig_t;
-
/***********************************************************************
*
* FUNCTIONALITY : Scheduling Request Configuration (SR)
diff --git a/openair1/PHY/phy_extern.h b/openair1/PHY/phy_extern.h
index 4ba5e328e3..d5fea5aec6 100644
--- a/openair1/PHY/phy_extern.h
+++ b/openair1/PHY/phy_extern.h
@@ -23,7 +23,6 @@
#define __PHY_EXTERN_H__
#include "PHY/defs_common.h"
-#include "common/ran_context.h"
extern char* namepointer_chMag ;
extern char* namepointer_log2;
@@ -33,14 +32,13 @@ extern unsigned int RX_DMA_BUFFER[4][NB_ANTENNAS_RX];
extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX];
#include "PHY/LTE_TRANSPORT/transport_extern.h"
-//#include "SIMULATION/ETH_TRANSPORT/extern.h"
+#include "PHY/defs_RU.h"
extern unsigned int DAQ_MBOX;
extern int number_of_cards;
extern const short conjugate[8],conjugate2[8];
-extern RAN_CONTEXT_t RC;
extern short primary_synch0[144];
extern short primary_synch1[144];
diff --git a/openair1/PHY/phy_extern_ue.h b/openair1/PHY/phy_extern_ue.h
index fdaf6eaa89..9f227806fd 100644
--- a/openair1/PHY/phy_extern_ue.h
+++ b/openair1/PHY/phy_extern_ue.h
@@ -23,7 +23,6 @@
#define __PHY_EXTERN_UE__H__
#include "PHY/defs_UE.h"
-#include "common/ran_context.h"
extern char* namepointer_chMag ;
extern char* namepointer_log2;
diff --git a/openair1/PHY/phy_vars.h b/openair1/PHY/phy_vars.h
index dadb1649ec..9edb7031b9 100644
--- a/openair1/PHY/phy_vars.h
+++ b/openair1/PHY/phy_vars.h
@@ -25,7 +25,6 @@
#include "PHY/types.h"
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
-#include "common/ran_context.h"
char* namepointer_chMag ;
char fmageren_name2[512];
@@ -38,9 +37,10 @@ char* namepointer_log2;
#include "PHY/LTE_TRANSPORT/transport_vars.h"
#include "PHY/MODULATION/modulation_vars.h"
+#include "nfapi/oai_integration/vendor_ext.h"
+
PHY_VARS_UE ***PHY_vars_UE_g;
-RAN_CONTEXT_t RC;
UL_RCC_IND_t UL_RCC_INFO;
unsigned short rev[2048],rev_times4[8192],rev_half[1024];
diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c
index 3f342802b4..ecfec02193 100644
--- a/openair1/SCHED/fapi_l1.c
+++ b/openair1/SCHED/fapi_l1.c
@@ -32,11 +32,15 @@
#include "PHY/defs_eNB.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
+#include "PHY/LTE_TRANSPORT/transport_extern.h"
#include "SCHED/sched_eNB.h"
#include "nfapi/oai_integration/vendor_ext.h"
#include "nfapi_pnf_interface.h"
#include "fapi_l1.h"
+#include "common/ran_context.h"
+extern RAN_CONTEXT_t RC;
+
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req);
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req);
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req);
@@ -209,13 +213,13 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE);
- if( (UE_id<0) || (UE_id>=NUMBER_OF_UE_MAX) ) {
+ if( (UE_id<0) || (UE_id>=NUMBER_OF_DLSCH_MAX) ) {
LOG_E(PHY,"illegal UE_id found!!! rnti %04x UE_id %d\n",rel8->rnti,UE_id);
return;
}
//AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n");
- //AssertFatal(UE_id= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX);
+ //AssertFatal(UE_id= %d(NUMBER_OF_DLSCHMAX)\n",UE_id,NUMBER_OF_DLSCH_MAX);
dlsch0 = eNB->dlsch[UE_id][0];
dlsch1 = eNB->dlsch[UE_id][1];
@@ -291,7 +295,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
if ((rel13->pdsch_payload_type <2) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR/SI-BR
UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE);
AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n");
- AssertFatal(UE_id= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX);
+ AssertFatal(UE_id= %d(NUMBER_OF_DLSCH_MAX)\n",UE_id,NUMBER_OF_DLSCH_MAX);
dlsch0 = eNB->dlsch[UE_id][0];
dlsch0->harq_mask = 1;
dlsch0_harq = dlsch0->harq_processes[0];
@@ -366,7 +370,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
} else {
UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE);
AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n");
- AssertFatal(UE_id= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX);
+ AssertFatal(UE_id= %d(NUMBER_OF_DLSCH_MAX)\n",UE_id,NUMBER_OF_DLSCH_MAX);
dlsch0 = eNB->dlsch[UE_id][0];
dlsch1 = eNB->dlsch[UE_id][1];
dlsch0->sib1_br_flag=0;
@@ -596,7 +600,7 @@ void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,
uci->frame = frame;
uci->subframe = subframe;
uci->rnti = ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti;
- uci->ue_id = find_ulsch(ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE);
+ uci->ue_id = find_ulsch(ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE);
uci->type = SR;
uci->pucch_fmt = pucch_format1;
uci->num_antenna_ports = 1;
@@ -622,7 +626,7 @@ void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_
uci->frame = frame;
uci->subframe = subframe;
uci->rnti = ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti;
- uci->ue_id = find_ulsch(ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE);
+ uci->ue_id = find_ulsch(ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE);
uci->type = HARQ_SR;
uci->num_antenna_ports = 1;
uci->num_pucch_resources = 1;
@@ -660,7 +664,7 @@ void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_p
if (NFAPI_MODE==NFAPI_MODE_VNF) return;
- for (i=0; isoundingrs_ul_config_dedicated[i].active==1) continue;
eNB->soundingrs_ul_config_dedicated[i].active = 1;
@@ -676,7 +680,7 @@ void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_p
break;
}
- AssertFatal(imodule_id;
@@ -780,7 +785,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
nfapi_dl_config_request_pdu_t *dl_config_pdu;
nfapi_hi_dci0_request_pdu_t *hi_dci0_req_pdu;
nfapi_ul_config_request_pdu_t *ul_config_pdu;
- int i;
+
eNB->pdcch_vars[subframe&1].num_pdcch_symbols = number_pdcch_ofdm_symbols;
eNB->pdcch_vars[subframe&1].num_dci = 0;
eNB->phich_vars[subframe&1].num_hi = 0;
@@ -811,8 +816,8 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
// clear DCI allocation maps for new subframe
if (NFAPI_MODE!=NFAPI_MODE_VNF)
- for (i=0; iulsch[i]) {
+ for (int i=0; iulsch[i]!=NULL) {
ulsch_harq = eNB->ulsch[i]->harq_processes[harq_pid];
ulsch_harq->dci_alloc=0;
ulsch_harq->rar_alloc=0;
@@ -820,7 +825,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
}
}
- for (i=0; idl_config_request_body.dl_config_pdu_list[i];
//LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type);
@@ -969,7 +974,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
}
if (NFAPI_MODE!=NFAPI_MODE_VNF)
- for (i=0; ihi_dci0_request_body.hi_dci0_pdu_list[i];
LOG_D(PHY,"NFAPI: hi_dci0_pdu %d : type %d\n",i,hi_dci0_req_pdu->pdu_type);
@@ -993,7 +998,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
if (NFAPI_MODE!=NFAPI_MONOLITHIC) {
if (number_ul_pdu>0) {
uint8_t ulsch_pdu_num = 0;
- for (i=0; iul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) ||
(UL_req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) ||
(UL_req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) ||
@@ -1020,7 +1025,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
}
}
} else {
- for (i=0; iul_config_request_body.ul_config_pdu_list[i];
LOG_D(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type);
AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE ||
diff --git a/openair1/SCHED/fapi_l1.h b/openair1/SCHED/fapi_l1.h
index 6b9121e17f..b8f0ae1dd8 100644
--- a/openair1/SCHED/fapi_l1.h
+++ b/openair1/SCHED/fapi_l1.h
@@ -31,8 +31,6 @@
*/
#include "PHY/defs_eNB.h"
-#include "PHY/defs_gNB.h"
-#include "PHY/phy_extern.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "SCHED/sched_eNB.h"
#include "SCHED/sched_common.h"
@@ -82,4 +80,4 @@ void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu
void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe);
-void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc);
+void schedule_response(Sched_Rsp_t *Sched_INFO, void *proc);
diff --git a/openair1/SCHED/phy_procedures_lte_common.c b/openair1/SCHED/phy_procedures_lte_common.c
index 0b592b9c55..7033c52701 100644
--- a/openair1/SCHED/phy_procedures_lte_common.c
+++ b/openair1/SCHED/phy_procedures_lte_common.c
@@ -1085,73 +1085,3 @@ void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeri
}
}
-
-// uint8_t eNB_id,uint8_t harq_pid, uint8_t UE_id,
-int16_t estimate_ue_tx_power(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs)
-{
-
- /// The payload + CRC size in bits, "B"
- uint32_t B;
- /// Number of code segments
- uint32_t C;
- /// Number of "small" code segments
- uint32_t Cminus;
- /// Number of "large" code segments
- uint32_t Cplus;
- /// Number of bits in "small" code segments (<6144)
- uint32_t Kminus;
- /// Number of bits in "large" code segments (<6144)
- uint32_t Kplus;
- /// Total number of bits across all segments
- uint32_t sumKr;
- /// Number of "Filler" bits
- uint32_t F;
- // num resource elements
- uint32_t num_re=0.0;
- // num symbols
- uint32_t num_symb=0.0;
- /// effective spectral efficiency of the PUSCH
- uint32_t MPR_x100=0;
- /// beta_offset
- uint16_t beta_offset_pusch_x8=8;
- /// delta mcs
- float delta_mcs=0.0;
- /// bandwidth factor
- float bw_factor=0.0;
-
- B= tbs+24;
- lte_segmentation(NULL,
- NULL,
- B,
- &C,
- &Cplus,
- &Cminus,
- &Kplus,
- &Kminus,
- &F);
-
-
- sumKr = Cminus*Kminus + Cplus*Kplus;
- num_symb = 12-(ncp<<1)-(use_srs==0?0:1);
- num_re = num_symb * nb_rb * 12;
-
- if (num_re == 0)
- return(0);
-
- MPR_x100 = 100*sumKr/num_re;
-
- if (control_only == 1 )
- beta_offset_pusch_x8=8; // fixme
-
- //(beta_offset_pusch_x8=ue->ulsch[eNB_id]->harq_processes[harq_pid]->control_only == 1) ? ue->ulsch[eNB_id]->beta_offset_cqi_times8:8;
-
- // if deltamcs_enabledm
- delta_mcs = ((hundred_times_delta_TF[MPR_x100/6]+10*dB_fixed_x10((beta_offset_pusch_x8)>>3))/100.0);
- bw_factor = (hundred_times_log10_NPRB[nb_rb-1]/100.0);
-#ifdef DEBUG_SEGMENTATION
- printf("estimated ue tx power %d (num_re %d, sumKr %d, mpr_x100 %d, delta_mcs %f, bw_factor %f)\n",
- (int16_t)ceil(delta_mcs + bw_factor), num_re, sumKr, MPR_x100, delta_mcs, bw_factor);
-#endif
- return (int16_t)ceil(delta_mcs + bw_factor);
-
-}
diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c
index d894061acd..973c921d23 100644
--- a/openair1/SCHED/phy_procedures_lte_eNb.c
+++ b/openair1/SCHED/phy_procedures_lte_eNb.c
@@ -52,21 +52,24 @@
#define MBMS_NFAPI_SCHEDULER
+#include "common/ran_context.h"
+extern RAN_CONTEXT_t RC;
-int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *eNB,uint16_t UE_id,uint8_t harq_pid, uint8_t bw_factor) {
+
+int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *eNB,uint16_t ULSCH_id,uint8_t harq_pid, uint8_t bw_factor) {
uint32_t Nre,sumKr,MPR_x100,Kr,r;
uint16_t beta_offset_pusch;
- DevAssert( UE_id < NUMBER_OF_UE_MAX+1 );
+ DevAssert( ULSCH_id < NUMBER_OF_ULSCH_MAX+1 );
DevAssert( harq_pid < 8 );
- Nre = eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_initial *
- eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12;
+ Nre = eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->Nsymb_initial *
+ eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->nb_rb*12;
sumKr = 0;
- for (r=0; rulsch[UE_id]->harq_processes[harq_pid]->C; r++) {
- if (rulsch[UE_id]->harq_processes[harq_pid]->Cminus)
- Kr = eNB->ulsch[UE_id]->harq_processes[harq_pid]->Kminus;
+ for (r=0; rulsch[ULSCH_id]->harq_processes[harq_pid]->C; r++) {
+ if (rulsch[ULSCH_id]->harq_processes[harq_pid]->Cminus)
+ Kr = eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->Kminus;
else
- Kr = eNB->ulsch[UE_id]->harq_processes[harq_pid]->Kplus;
+ Kr = eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->Kplus;
sumKr += Kr;
}
@@ -79,14 +82,14 @@ int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *eNB,uint16_t UE_id,uint8_t
// FK 20140908 sumKr is only set after the ulsch_encoding
beta_offset_pusch = 8;
//(eNB->ulsch[UE_id]->harq_processes[harq_pid]->control_only == 1) ? eNB->ulsch[UE_id]->beta_offset_cqi_times8:8;
- DevAssert( UE_id < NUMBER_OF_UE_MAX );
+ DevAssert( ULSCH_id < NUMBER_OF_ULSCH_MAX );
//#warning "This condition happens sometimes. Need more investigation" // navid
//DevAssert( MPR_x100/6 < 100 );
if (1==1) { //eNB->ul_power_control_dedicated[UE_id].deltaMCS_Enabled == 1) {
// This is the formula from Section 5.1.1.1 in 36.213 10*log10(deltaIF_PUSCH = (2^(MPR*Ks)-1)*beta_offset_pusch)
if (bw_factor == 1) {
- uint8_t nb_rb = eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb;
+ uint8_t nb_rb = eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->nb_rb;
return(hundred_times_delta_TF[MPR_x100/6]+10*dB_fixed_x10((beta_offset_pusch)>>3)) + hundred_times_log10_NPRB[nb_rb-1];
} else
return(hundred_times_delta_TF[MPR_x100/6]+10*dB_fixed_x10((beta_offset_pusch)>>3));
@@ -97,21 +100,21 @@ int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *eNB,uint16_t UE_id,uint8_t
int16_t get_hundred_times_delta_IF_mac(module_id_t module_idP, uint8_t CC_id, rnti_t rnti, uint8_t harq_pid) {
- int8_t UE_id;
+ int8_t ULSCH_id;
if ((RC.eNB == NULL) || (module_idP > RC.nb_inst) || (CC_id > RC.nb_CC[module_idP])) {
LOG_E(PHY,"get_UE_stats: No eNB found (or not allocated) for Mod_id %d,CC_id %d\n",module_idP,CC_id);
return -1;
}
- UE_id = find_ulsch( rnti, RC.eNB[module_idP][CC_id],SEARCH_EXIST);
+ ULSCH_id = find_ulsch( rnti, RC.eNB[module_idP][CC_id],SEARCH_EXIST);
- if (UE_id == -1) {
+ if (ULSCH_id == -1) {
// not found
return 0;
}
- return get_hundred_times_delta_IF_eNB( RC.eNB[module_idP][CC_id], UE_id, harq_pid, 0 );
+ return get_hundred_times_delta_IF_eNB( RC.eNB[module_idP][CC_id], ULSCH_id, harq_pid, 0 );
}
int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
@@ -499,9 +502,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
int do_meas) {
int frame=proc->frame_tx;
int subframe=proc->subframe_tx;
- uint32_t i,aa;
uint8_t harq_pid;
- int16_t UE_id=0;
uint8_t num_pdcch_symbols=0;
uint8_t num_dci=0;
uint8_t num_mdci = 0;
@@ -516,12 +517,15 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+(eNB->CC_id),1);
if (do_meas==1) start_meas(&eNB->phy_proc_tx);
-
if (do_meas==1) start_meas(&eNB->dlsch_common_and_dci);
// clear the transmit data array for the current subframe
- for (aa = 0; aa < fp->nb_antenna_ports_eNB; aa++) {
- memset (&eNB->common_vars.txdataF[aa][subframe * fp->ofdm_symbol_size * (fp->symbols_per_tti)], 0, fp->ofdm_symbol_size * (fp->symbols_per_tti) * sizeof (int32_t));
+ for (int aa = 0; aa < fp->nb_antenna_ports_eNB; aa++) {
+ if (eNB->use_DTX==0)
+ memcpy(&eNB->common_vars.txdataF[aa][subframe * fp->ofdm_symbol_size * (fp->symbols_per_tti)],
+ &eNB->subframe_mask[aa][subframe*fp->ofdm_symbol_size*fp->symbols_per_tti],
+ fp->ofdm_symbol_size * (fp->symbols_per_tti) * sizeof (int32_t));
+ else memset(&eNB->common_vars.txdataF[aa][subframe * fp->ofdm_symbol_size * (fp->symbols_per_tti)], 0, fp->ofdm_symbol_size * (fp->symbols_per_tti) * sizeof (int32_t));
}
if (NFAPI_MODE==NFAPI_MONOLITHIC || NFAPI_MODE==NFAPI_MODE_PNF) {
@@ -556,7 +560,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
ul_frame = pdcch_alloc2ul_frame (fp, frame, subframe);
// clear previous allocation information for all UEs
- for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
+ for (volatile int i = 0; i < NUMBER_OF_DLSCH_MAX; i++) {
if (eNB->dlsch[i][0])
eNB->dlsch[i][0]->subframe_tx[subframe] = 0;
}
@@ -565,7 +569,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
//if ((ul_subframe < 10)&&
// (subframe_select(fp,ul_subframe)==SF_UL)) { // This means that there is a potential UL subframe that will be scheduled here
if (ul_subframe < 10) { // This means that there is a potential UL subframe that will be scheduled here
- for (i=0; iulsch[i] && eNB->ulsch[i]->ue_type >0) harq_pid = 0;
else
@@ -651,9 +655,9 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
// Now scan UE specific DLSCH
LTE_eNB_DLSCH_t *dlsch0,*dlsch1;
- for (UE_id=0; UE_iddlsch[(uint8_t)UE_id][0];
- dlsch1 = eNB->dlsch[(uint8_t)UE_id][1];
+ for (int DLSCH_id=0; DLSCH_iddlsch[(uint8_t)DLSCH_id][0];
+ dlsch1 = eNB->dlsch[(uint8_t)DLSCH_id][1];
if ((dlsch0)&&(dlsch0->rnti>0)&&
#ifdef PHY_TX_THREAD
@@ -663,12 +667,13 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
#endif
) {
// get harq_pid
- harq_pid = dlsch0->harq_ids[frame%2][subframe];
+ harq_pid = dlsch0->harq_ids[frame%2][subframe];
//AssertFatal(harq_pid>=0,"harq_pid is negative\n");
if((harq_pid < 0) || (harq_pid >= dlsch0->Mdlharq)) {
+
if (dlsch0->ue_type==0)
- LOG_E(PHY,"harq_pid:%d corrupt must be 0-7 UE_id:%d frame:%d subframe:%d rnti:%x [ %1d.%1d.%1d.%1d.%1d.%1d.%1d.%1d\n", harq_pid,UE_id,frame,subframe,dlsch0->rnti,
+ LOG_E(PHY,"harq_pid:%d corrupt must be 0-7 DLSCH_id:%d frame:%d subframe:%d rnti:%x [ %1d.%1d.%1d.%1d.%1d.%1d.%1d.%1d\n", harq_pid,DLSCH_id,frame,subframe,dlsch0->rnti,
dlsch0->harq_ids[frame%2][0],
dlsch0->harq_ids[frame%2][1],
dlsch0->harq_ids[frame%2][2],
@@ -682,7 +687,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
proc,
harq_pid,
dlsch0,
- &eNB->UE_stats[(uint32_t)UE_id])) {
+ &eNB->UE_stats[(uint32_t)DLSCH_id])) {
// if we generate dlsch, we must generate pdsch
pdsch_procedures(eNB,
proc,
@@ -717,6 +722,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
if (do_meas==1) stop_meas(&eNB->phy_proc_tx);
}
+/* This has to be updated with FAPI structures*/
void srs_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
@@ -728,7 +734,7 @@ void srs_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
// Do SRS processing
// check if there is SRS and we have to use shortened format
// TODO: check for exceptions in transmission of SRS together with ACK/NACK
- for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
+ for (i = 0; i < NUMBER_OF_SRS_MAX; i++) {
if (eNB->soundingrs_ul_config_dedicated[i].active == 1) {
if (lte_srs_channel_estimation (fp, &eNB->common_vars, &eNB->srs_vars[i], &eNB->soundingrs_ul_config_dedicated[i], subframe, 0 /*eNB_id */ )) {
LOG_E (PHY, "problem processing SRS\n");
@@ -793,7 +799,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
calc_pucch_1x_interference(eNB, frame, subframe, 0);
- for (int i = 0; i < NUMBER_OF_UCI_VARS_MAX; i++) {
+ for (int i = 0; i < NUMBER_OF_UCI_MAX; i++) {
uci = &(eNB->uci_vars[i]);
if ((uci->active == 1) && (uci->frame == frame) && (uci->subframe == subframe)) {
@@ -850,7 +856,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
int pucch1_thres = (uci->ue_type == 0) ? eNB->pucch1_DTX_threshold : eNB->pucch1_DTX_threshold_emtc[0];
metric_SR = rx_pucch(eNB,
uci->pucch_fmt,
- uci->ue_id,
+ i,//uci->ue_id,
uci->n_pucch_1_0_sr[0],
0, // n2_pucch
uci->srs_active, // shortened format
@@ -1275,7 +1281,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
#ifdef DEBUG_PHY_PROC
LOG_D (PHY, "[eNB %d][PDSCH %x] Frame %d subframe %d ACK/NAK metric 0 %d, metric 1 %d, (%d,%d)\n", eNB->Mod_id,
- eNB->dlsch[UE_id][0]->rnti, frame, subframe, metric0, metric1, pucch_b0b1[0], pucch_b0b1[1]);
+ eNB->dlsch[DLSCH_id][0]->rnti, frame, subframe, metric0, metric1, pucch_b0b1[0], pucch_b0b1[1]);
#endif
}
@@ -1298,7 +1304,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
}
}
} // end if ((uci->active == 1) && (uci->frame == frame) && (uci->subframe == subframe)) {
- } // end loop for (int i = 0; i < NUMBER_OF_UE_MAX; i++) {
+ } // end loop for (int i = 0; i < NUMBER_OF_UCI_MAX; i++) {
}
void postDecode(L1_rxtx_proc_t *proc, notifiedFIFO_elt_t *req) {
@@ -1325,7 +1331,7 @@ void postDecode(L1_rxtx_proc_t *proc, notifiedFIFO_elt_t *req) {
int nb=abortTpool(proc->threadPool, req->key);
nb+=abortNotifiedFIFO(proc->respDecode, req->key);
proc->nbDecode-=nb;
- LOG_I(PHY,"uplink segment error %d/%d, aborted %d segments\n",rdata->segment_r,rdata->nbSegments, nb);
+ LOG_D(PHY,"uplink segment error %d/%d, aborted %d segments\n",rdata->segment_r,rdata->nbSegments, nb);
AssertFatal(ulsch_harq->processedSegments+nb == rdata->nbSegments,"processed: %d, aborted: %d, total %d\n",
ulsch_harq->processedSegments, nb, rdata->nbSegments);
ulsch_harq->processedSegments=rdata->nbSegments;
@@ -1381,6 +1387,15 @@ void postDecode(L1_rxtx_proc_t *proc, notifiedFIFO_elt_t *req) {
fill_rx_indication(eNB,i,rdata->frame,rdata->subframe); // indicate SDU to MAC
ulsch_harq->status = SCH_IDLE;
ulsch->harq_mask &= ~(1 << rdata->harq_pid);
+ for (int j=0;julsch_stats[j].rnti == ulsch->rnti) {
+ eNB->ulsch_stats[j].total_bytes_rx+=ulsch_harq->TBS;
+ for (int aa=0;aaframe_parms.nb_antennas_rx;aa++) {
+ eNB->ulsch_stats[j].ulsch_power[aa] = dB_fixed_x10(eNB->pusch_vars[rdata->UEid]->ulsch_power[aa]);
+ eNB->ulsch_stats[j].ulsch_noise_power[aa] = dB_fixed_x10(eNB->pusch_vars[rdata->UEid]->ulsch_noise_power[aa]);
+ }
+ break;
+ }
T (T_ENB_PHY_ULSCH_UE_ACK, T_INT(eNB->Mod_id), T_INT(rdata->frame), T_INT(rdata->subframe), T_INT(ulsch->rnti),
T_INT(rdata->harq_pid));
} // ulsch not in error
@@ -1401,8 +1416,9 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
const int frame = proc->frame_rx;
uint32_t harq_pid0 = subframe2harq_pid(&eNB->frame_parms,frame,subframe);
- for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
+ for (i = 0; i < NUMBER_OF_ULSCH_MAX; i++) {
ulsch = eNB->ulsch[i];
+ if (!ulsch) continue;
if (ulsch->ue_type > 0) harq_pid = 0;
else harq_pid=harq_pid0;
@@ -1411,10 +1427,9 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
if (ulsch->rnti>0) LOG_D(PHY,"eNB->ulsch[%d]->harq_processes[harq_pid:%d] SFN/SF:%04d%d: PUSCH procedures, UE %d/%x ulsch_harq[status:%d SFN/SF:%04d%d handled:%d]\n",
i, harq_pid, frame,subframe,i,ulsch->rnti,
- ulsch_harq->status, ulsch_harq->frame, ulsch_harq->subframe, ulsch_harq->handled);
+ ulsch_harq->status, ulsch_harq->frame, ulsch_harq->subframe, ulsch_harq->handled);
- if ((ulsch) &&
- (ulsch->rnti>0) &&
+ if ((ulsch->rnti>0) &&
(ulsch_harq->status == ACTIVE) &&
((ulsch_harq->frame == frame) || (ulsch_harq->repetition_number >1) ) &&
((ulsch_harq->subframe == subframe) || (ulsch_harq->repetition_number >1) ) &&
@@ -1459,6 +1474,17 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
ulsch_harq->V_UL_DAI,
ulsch_harq->nb_rb>20 ? 1 : 0);
stop_meas(&eNB->ulsch_decoding_stats);
+/*
+ int ulsch_id=-1;
+ for (ulsch_id=0;ulsch_idrnti == eNB->ulsch_stats[ulsch_id].rnti) break;
+ AssertFatal(ulsch_id>=0,"no ulsch_id found\n");
+
+ if (eNB->ulsch_stats[ulsch_id].round_trials[0]>100) {
+ dump_ulsch(eNB,frame,subframe,i,ulsch_harq->round);
+ AssertFatal(1==0,"exiting\n");
+ }
+*/
}
else if ((ulsch) &&
(ulsch->rnti>0) &&
@@ -1472,7 +1498,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
ulsch->harq_mask &= ~(1 << harq_pid);
LOG_W (PHY, "Removing stale ULSCH config for UE %x harq_pid %d (harq_mask is now 0x%2.2x)\n", ulsch->rnti, harq_pid, ulsch->harq_mask);
}
- } // for (i=0; inbDecode > 0) {
notifiedFIFO_elt_t *req=pullTpool(proc->respDecode, proc->threadPool);
@@ -1537,7 +1563,7 @@ void kill_te_thread(PHY_VARS_eNB *eNB) {
}
void fill_rx_indication(PHY_VARS_eNB *eNB,
- int UE_id,
+ int ULSCH_id,
int frame,
int subframe) {
nfapi_rx_indication_pdu_t *pdu;
@@ -1545,7 +1571,7 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,
int sync_pos;
uint32_t harq_pid;
- if (eNB->ulsch[UE_id]->ue_type > 0) harq_pid = 0;
+ if (eNB->ulsch[ULSCH_id]->ue_type > 0) harq_pid = 0;
else {
harq_pid = subframe2harq_pid (&eNB->frame_parms,
frame, subframe);
@@ -1555,19 +1581,22 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,
eNB->UL_INFO.rx_ind.sfn_sf = frame<<4| subframe;
eNB->UL_INFO.rx_ind.rx_indication_body.tl.tag = NFAPI_RX_INDICATION_BODY_TAG;
pdu = &eNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list[eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus];
- // pdu->rx_ue_information.handle = eNB->ulsch[UE_id]->handle;
+ // pdu->rx_ue_information.handle = eNB->ulsch[ULSCH_id]->handle;
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
- pdu->rx_ue_information.rnti = eNB->ulsch[UE_id]->rnti;
+ pdu->rx_ue_information.rnti = eNB->ulsch[ULSCH_id]->rnti;
pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
- pdu->rx_indication_rel8.length = eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS>>3;
+ pdu->rx_indication_rel8.length = eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->TBS>>3;
pdu->rx_indication_rel8.offset = 1; // DJP - I dont understand - but broken unless 1 ???? 0; // filled in at the end of the UL_INFO formation
- pdu->data = eNB->ulsch[UE_id]->harq_processes[harq_pid]->decodedBytes;
+ pdu->data = eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->decodedBytes;
// estimate timing advance for MAC
- sync_pos = lte_est_timing_advance_pusch(&eNB->frame_parms, eNB->pusch_vars[UE_id]->drs_ch_estimates_time);
- timing_advance_update = sync_pos; // - eNB->frame_parms.nb_prefix_samples/4; //to check
+ sync_pos = lte_est_timing_advance_pusch(&eNB->frame_parms, eNB->pusch_vars[ULSCH_id]->drs_ch_estimates_time);
+ timing_advance_update = sync_pos;
- // if (timing_advance_update > 10) { dump_ulsch(eNB,frame,subframe,UE_id); exit(-1);}
- // if (timing_advance_update < -10) { dump_ulsch(eNB,frame,subframe,UE_id); exit(-1);}
+ for (int i=0;iulsch_stats[i].rnti == eNB->ulsch[ULSCH_id]->rnti)
+ eNB->ulsch_stats[i].timing_offset = sync_pos;
+ // if (timing_advance_update > 10) { dump_ulsch(eNB,frame,subframe,ULSCH_id); exit(-1);}
+ // if (timing_advance_update < -10) { dump_ulsch(eNB,frame,subframe,ULSCH_id); exit(-1);}
switch (eNB->frame_parms.N_RB_DL) {
case 6: /* nothing to do */
break;
@@ -1607,7 +1636,13 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,
pdu->rx_indication_rel8.timing_advance = timing_advance_update;
// estimate UL_CQI for MAC
- int SNRtimes10 = dB_fixed_x10(eNB->pusch_vars[UE_id]->ulsch_power[0] + ((eNB->frame_parms.nb_antennas_rx>1) ?eNB->pusch_vars[UE_id]->ulsch_power[1] : 0 ) ) - dB_fixed_x10(eNB->pusch_vars[UE_id]->ulsch_interference_power[0]+((eNB->frame_parms.nb_antennas_rx>1) ?eNB->pusch_vars[UE_id]->ulsch_interference_power[1] : 0 ) );
+ int total_power=0, avg_noise_power=0;
+ for (int i=0;iframe_parms.nb_antennas_rx;i++) {
+ total_power+=(eNB->pusch_vars[ULSCH_id]->ulsch_power[i]);
+ avg_noise_power+=(eNB->pusch_vars[ULSCH_id]->ulsch_noise_power[i])/eNB->frame_parms.nb_antennas_rx;
+ }
+ int SNRtimes10 = dB_fixed_x10(total_power) -
+ dB_fixed_x10(avg_noise_power);
if (SNRtimes10 < -640)
pdu->rx_indication_rel8.ul_cqi = 0;
@@ -1616,9 +1651,11 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,
else
pdu->rx_indication_rel8.ul_cqi = (640 + SNRtimes10) / 5;
- LOG_D(PHY,"[PUSCH %d] Frame %d Subframe %d Filling RX_indication with SNR %d (%d,%d), timing_advance %d (update %d)\n",
- harq_pid,frame,subframe,SNRtimes10,pdu->rx_indication_rel8.ul_cqi,eNB->measurements.n0_subband_power_avg_dB,pdu->rx_indication_rel8.timing_advance,
- timing_advance_update);
+ LOG_D(PHY,"[PUSCH %d] Frame %d Subframe %d Filling RX_indication with SNR %d (%d,%d,%d), timing_advance %d (update %d,sync_pos %d)\n",
+ harq_pid,frame,subframe,SNRtimes10,pdu->rx_indication_rel8.ul_cqi,dB_fixed_x10(total_power),dB_fixed_x10(avg_noise_power),pdu->rx_indication_rel8.timing_advance,timing_advance_update,sync_pos);
+ for (int i=0;iframe_parms.nb_antennas_rx;i++)
+ LOG_D(PHY,"antenna %d: ulsch_power %d, noise_power %d\n",i,dB_fixed_x10(eNB->pusch_vars[ULSCH_id]->ulsch_power[i]),dB_fixed_x10(eNB->pusch_vars[ULSCH_id]->ulsch_noise_power[i]));
+
eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus++;
eNB->UL_INFO.rx_ind.sfn_sf = frame<<4 | subframe;
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
@@ -1629,7 +1666,7 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,
* Release the harq process if its round is >= 'after_rounds'
*/
static void do_release_harq(PHY_VARS_eNB *eNB,
- int UE_id,
+ int DLSCH_id,
int tb,
uint16_t frame,
uint8_t subframe,
@@ -1644,10 +1681,10 @@ static void do_release_harq(PHY_VARS_eNB *eNB,
int harq_pid;
int subframe_tx;
int frame_tx;
- AssertFatal(UE_id != -1, "No existing dlsch context\n");
- AssertFatal(UE_id < NUMBER_OF_UE_MAX, "Returned UE_id %d >= %d (NUMBER_OF_UE_MAX)\n", UE_id, NUMBER_OF_UE_MAX);
- dlsch0 = eNB->dlsch[UE_id][0];
- dlsch1 = eNB->dlsch[UE_id][1];
+ AssertFatal(DLSCH_id != -1, "No existing dlsch context\n");
+ AssertFatal(DLSCH_id < NUMBER_OF_DLSCH_MAX, "Returned DLSCH_id %d >= %d (NUMBER_OF_DLSCH_MAX)\n", DLSCH_id, NUMBER_OF_DLSCH_MAX);
+ dlsch0 = eNB->dlsch[DLSCH_id][0];
+ dlsch1 = eNB->dlsch[DLSCH_id][1];
if (eNB->frame_parms.frame_type == FDD) {
subframe_tx = (subframe + 6) % 10;
@@ -1746,13 +1783,13 @@ static void do_release_harq(PHY_VARS_eNB *eNB,
} // end if TDD
}
-static void release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,uint8_t subframe,uint16_t mask, int is_ack) {
+static void release_harq(PHY_VARS_eNB *eNB,int DLSCH_id,int tb,uint16_t frame,uint8_t subframe,uint16_t mask, int is_ack) {
/*
* Maximum number of DL transmissions = 4.
* TODO: get the value from configuration.
* If is_ack is true then we release immediately. The value -1 can be used for that.
*/
- do_release_harq(eNB, UE_id, tb, frame, subframe, mask, is_ack ? -1 : 4);
+ do_release_harq(eNB, DLSCH_id, tb, frame, subframe, mask, is_ack ? -1 : 4);
}
int getM(PHY_VARS_eNB *eNB,int frame,int subframe) {
@@ -1832,14 +1869,14 @@ void fill_ulsch_cqi_indication (PHY_VARS_eNB *eNB, uint16_t frame, uint8_t subfr
}
void fill_ulsch_harq_indication (PHY_VARS_eNB *eNB, LTE_UL_eNB_HARQ_t *ulsch_harq, uint16_t rnti, int frame, int subframe, int bundling) {
- int UE_id = find_dlsch(rnti,eNB,SEARCH_EXIST);
+ int DLSCH_id = find_dlsch(rnti,eNB,SEARCH_EXIST);
- if( (UE_id<0) || (UE_id>=NUMBER_OF_UE_MAX) ) {
- LOG_E(PHY,"illegal UE_id found!!! rnti %04x UE_id %d\n",rnti,UE_id);
+ if( (DLSCH_id<0) || (DLSCH_id>=NUMBER_OF_DLSCH_MAX) ) {
+ LOG_E(PHY,"illegal DLSCH_id found!!! rnti %04x DLSCH_id %d\n",rnti,DLSCH_id);
return;
}
- //AssertFatal(UE_id>=0,"UE_id doesn't exist\n");
+ //AssertFatal(DLSCH_id>=0,"DLSCH_id doesn't exist\n");
pthread_mutex_lock(&eNB->UL_INFO_mutex);
nfapi_harq_indication_pdu_t *pdu = &eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list[eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs];
int M;
@@ -1861,7 +1898,7 @@ void fill_ulsch_harq_indication (PHY_VARS_eNB *eNB, LTE_UL_eNB_HARQ_t *ulsch_har
AssertFatal (ulsch_harq->o_ACK[i] == 0 || ulsch_harq->o_ACK[i] == 1, "harq_ack[%d] is %d, should be 1,2 or 4\n", i, ulsch_harq->o_ACK[i]);
pdu->harq_indication_fdd_rel13.harq_tb_n[i] = 2 - ulsch_harq->o_ACK[i];
// release DLSCH if needed
- release_harq(eNB,UE_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
+ release_harq(eNB,DLSCH_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
}
} else { // TDD
M = ul_ACK_subframe2_M (&eNB->frame_parms, subframe);
@@ -1877,14 +1914,14 @@ void fill_ulsch_harq_indication (PHY_VARS_eNB *eNB, LTE_UL_eNB_HARQ_t *ulsch_har
* We have to release the proper HARQ in case of ACK or NACK if max retransmission reached.
* Basically, call release_harq with 1 as last argument when ACK and 0 when NACK.
*/
- release_harq(eNB,UE_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
+ release_harq(eNB,DLSCH_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
- if (M==1 && ulsch_harq->O_ACK==1 && ulsch_harq->o_ACK[i] == 1) release_harq(eNB,UE_id,0,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
- else if (M==1 && ulsch_harq->O_ACK==2 && ulsch_harq->o_ACK[i] == 1) release_harq(eNB,UE_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
+ if (M==1 && ulsch_harq->O_ACK==1 && ulsch_harq->o_ACK[i] == 1) release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
+ else if (M==1 && ulsch_harq->O_ACK==2 && ulsch_harq->o_ACK[i] == 1) release_harq(eNB,DLSCH_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
else if (M>1 && ulsch_harq->o_ACK[i] == 1) {
// spatial bundling
- release_harq(eNB,UE_id,0,frame,subframe,1<o_ACK[i] == 1);
- release_harq(eNB,UE_id,1,frame,subframe,1<o_ACK[i] == 1);
+ release_harq(eNB,DLSCH_id,0,frame,subframe,1<o_ACK[i] == 1);
+ release_harq(eNB,DLSCH_id,1,frame,subframe,1<o_ACK[i] == 1);
}
}
}
@@ -1900,10 +1937,10 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
return;
}
- int UE_id=find_dlsch(uci->rnti,eNB,SEARCH_EXIST);
+ int DLSCH_id=find_dlsch(uci->rnti,eNB,SEARCH_EXIST);
- //AssertFatal(UE_id>=0,"UE_id doesn't exist rnti:%x\n", uci->rnti);
- if (UE_id < 0) {
+ //AssertFatal(DLSCH_id>=0,"DLSCH_id doesn't exist rnti:%x\n", uci->rnti);
+ if (DLSCH_id < 0) {
LOG_E(PHY,"SFN/SF:%04d%d Unable to find rnti:%x do not send HARQ\n", frame, subframe, uci->rnti);
return;
}
@@ -1943,7 +1980,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
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,UE_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
+ 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;
@@ -1953,8 +1990,8 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
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,UE_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
- release_harq(eNB,UE_id,1,frame,subframe,0xffff, harq_ack[1] == 1);
+ 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);
} else { // TDD
AssertFatal (tdd_mapping_mode == 0 || tdd_mapping_mode == 1 || tdd_mapping_mode == 2, "Illegal tdd_mapping_mode %d\n", tdd_mapping_mode);
@@ -1972,7 +2009,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
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,UE_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
+ 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]);
@@ -1981,8 +2018,8 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
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,UE_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
- release_harq(eNB,UE_id,1,frame,subframe,0xffff, harq_ack[1] == 1);
+ 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;
@@ -1996,7 +2033,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
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,UE_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
+ 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;
@@ -2005,8 +2042,8 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
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,UE_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
- release_harq(eNB,UE_id,1,frame,subframe,0xffff, harq_ack[1] == 1);
+ 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;
@@ -2018,8 +2055,8 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
if (uci->num_pucch_resources == 4) pdu->harq_indication_tdd_rel13.harq_data[3].multiplex.value_0 = harq_ack[3];
// spatial-bundling in this case so release both HARQ if necessary
- release_harq(eNB,UE_id,0,frame,subframe,tdd_multiplexing_mask, 1 /* force release? previous code was unconditional */);
- release_harq(eNB,UE_id,1,frame,subframe,tdd_multiplexing_mask, 1 /* force release? previous code was unconditional */);
+ release_harq(eNB,DLSCH_id,0,frame,subframe,tdd_multiplexing_mask, 1 /* force release? previous code was unconditional */);
+ release_harq(eNB,DLSCH_id,1,frame,subframe,tdd_multiplexing_mask, 1 /* force release? previous code was unconditional */);
}
break;
@@ -2043,8 +2080,8 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
if (uci->num_pucch_resources == 1 || uci->num_pucch_resources == 4 ||
tdd_config5_sf2scheds == 1 || tdd_config5_sf2scheds == 4 || tdd_config5_sf2scheds == 7) {
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 1;
- release_harq(eNB,UE_id,0,frame,subframe,0xffff, 1);
- release_harq(eNB,UE_id,1,frame,subframe,0xffff, 1);
+ release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, 1);
+ release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, 1);
} else {
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 0;
}
@@ -2055,8 +2092,8 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
if (uci->num_pucch_resources == 2 || tdd_config5_sf2scheds == 2 ||
tdd_config5_sf2scheds == 5 || tdd_config5_sf2scheds == 8) {
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 1;
- release_harq(eNB,UE_id,0,frame,subframe,0xffff, 1);
- release_harq(eNB,UE_id,1,frame,subframe,0xffff, 1);
+ release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, 1);
+ release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, 1);
} else {
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 0;
}
@@ -2067,8 +2104,8 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
if (uci->num_pucch_resources == 3 || tdd_config5_sf2scheds == 3 ||
tdd_config5_sf2scheds == 6 || tdd_config5_sf2scheds == 9) {
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 1;
- release_harq(eNB,UE_id,0,frame,subframe,0xffff, 1);
- release_harq(eNB,UE_id,1,frame,subframe,0xffff, 1);
+ release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, 1);
+ release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, 1);
} else {
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 0;
}
@@ -2085,7 +2122,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
}
-void fill_crc_indication (PHY_VARS_eNB *eNB, int UE_id, int frame, int subframe, uint8_t crc_flag) {
+void fill_crc_indication (PHY_VARS_eNB *eNB, int ULSCH_id, int frame, int subframe, uint8_t crc_flag) {
pthread_mutex_lock(&eNB->UL_INFO_mutex);
nfapi_crc_indication_pdu_t *pdu = &eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list[eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs];
eNB->UL_INFO.crc_ind.sfn_sf = frame<<4 | subframe;
@@ -2094,7 +2131,7 @@ void fill_crc_indication (PHY_VARS_eNB *eNB, int UE_id, int frame, int subframe,
pdu->instance_length = 0; // don't know what to do with this
// pdu->rx_ue_information.handle = handle;
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
- pdu->rx_ue_information.rnti = eNB->ulsch[UE_id]->rnti;
+ pdu->rx_ue_information.rnti = eNB->ulsch[ULSCH_id]->rnti;
pdu->crc_indication_rel8.tl.tag = NFAPI_CRC_INDICATION_REL8_TAG;
pdu->crc_indication_rel8.crc_flag = crc_flag;
eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs++;
@@ -2133,20 +2170,24 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
}
lte_eNB_I0_measurements (eNB, subframe, 0, eNB->first_run_I0_measurements);
- int min_I0=1000,max_I0=0;
- int amin=0,amax=0;
- if ((frame==0) && (subframe==3)) {
- for (int i=0; iframe_parms.N_RB_UL; i++) {
- if (i==(eNB->frame_parms.N_RB_UL>>1) - 1) i+=2;
- if (eNB->measurements.n0_subband_power_tot_dB[i]measurements.n0_subband_power_tot_dB[i]; amin=i;}
-
- if (eNB->measurements.n0_subband_power_tot_dB[i]>max_I0) {max_I0 = eNB->measurements.n0_subband_power_tot_dB[i]; amax=i;}
- }
-
- LOG_I (PHY, "max_I0 %d (rb %d), min_I0 %d (rb %d), avg I0 %d\n", max_I0, amax, min_I0, amin, eNB->measurements.n0_subband_power_avg_dB);
+ // clear unused statistics after 2 seconds
+ for (int i=0;iulsch_stats[i].frame <= frame) {
+ if ((eNB->ulsch_stats[i].frame + 200) < frame) memset(&eNB->ulsch_stats[i],0,sizeof(eNB->ulsch_stats[i]));
+ }
+ else {
+ if (eNB->ulsch_stats[i].frame + 200 < (frame+1024)) memset(&eNB->ulsch_stats[i],0,sizeof(eNB->ulsch_stats[i]));
+ }
+ if (eNB->uci_stats[i].frame <= frame) {
+ if ((eNB->uci_stats[i].frame + 200) < frame) memset(&eNB->uci_stats[i],0,sizeof(eNB->uci_stats[i]));
+ }
+ else {
+ if (eNB->uci_stats[i].frame + 200 < (frame+1024)) memset(&eNB->uci_stats[i],0,sizeof(eNB->uci_stats[i]));
+ }
}
+
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 0 );
}
@@ -2163,13 +2204,7 @@ void release_rnti_of_phy(module_id_t mod_id) {
eNB_PHY = RC.eNB[mod_id][CC_id];
rnti = release_rntis.ue_release_request_TLVs_list[i].rnti;
- for (j=0; julsch[j];
-
- if((ulsch != NULL) && (ulsch->rnti == rnti)) {
- LOG_I(PHY, "clean_eNb_ulsch ulsch[%d] UE %x\n", j, rnti);
- clean_eNb_ulsch(ulsch);
- }
+ for (j=0; jdlsch[j][0];
@@ -2179,14 +2214,18 @@ void release_rnti_of_phy(module_id_t mod_id) {
}
}
- ulsch = eNB_PHY->ulsch[j];
+ for (j=0;julsch[j];
- if((ulsch != NULL) && (ulsch->rnti == rnti)) {
- LOG_I(PHY, "clean_eNb_ulsch ulsch[%d] UE %x\n", j, rnti);
- clean_eNb_ulsch(ulsch);
+ if((ulsch != NULL) && (ulsch->rnti == rnti)) {
+ LOG_I(PHY, "clean_eNb_ulsch ulsch[%d] UE %x\n", j, rnti);
+ clean_eNb_ulsch(ulsch);
+ for (j=0;julsch_stats[j].rnti == rnti) {eNB_PHY->ulsch_stats[j].rnti=0; break;}
+ }
}
- for(j=0; juci_vars[j].rnti == rnti) {
LOG_I(PHY, "clean eNb uci_vars[%d] UE %x \n",j, rnti);
memset(&eNB_PHY->uci_vars[i],0,sizeof(LTE_eNB_UCI));
diff --git a/openair1/SCHED/prach_procedures.c b/openair1/SCHED/prach_procedures.c
index b99bb2ee7d..4d0fe428e8 100644
--- a/openair1/SCHED/prach_procedures.c
+++ b/openair1/SCHED/prach_procedures.c
@@ -31,8 +31,6 @@
*/
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
-#include "SCHED/sched_eNB.h"
#include "nfapi_interface.h"
#include "fapi_l1.h"
#include "nfapi_pnf.h"
@@ -46,7 +44,6 @@
#include
-#include "intertask_interface.h"
extern int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
@@ -188,7 +185,7 @@ void prach_procedures(PHY_VARS_eNB *eNB,
else {
eNB->measurements.prach_I0 = ((eNB->measurements.prach_I0*900)>>10) + ((avg_preamble_energy[0]*124)>>10);
- if (frame==0) LOG_I(PHY,"prach_I0 = %d.%d dB\n",eNB->measurements.prach_I0/10,eNB->measurements.prach_I0%10);
+ if (frame==0) LOG_D(PHY,"prach_I0 = %d.%d dB\n",eNB->measurements.prach_I0/10,eNB->measurements.prach_I0%10);
if (eNB->prach_energy_counter < 100) eNB->prach_energy_counter++;
}
diff --git a/openair1/SCHED/ru_procedures.c b/openair1/SCHED/ru_procedures.c
index 70399f0a23..15eba7b5bc 100644
--- a/openair1/SCHED/ru_procedures.c
+++ b/openair1/SCHED/ru_procedures.c
@@ -54,7 +54,6 @@
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
#include "SCHED/sched_eNB.h"
#include "PHY/MODULATION/modulation_eNB.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
@@ -140,27 +139,26 @@ void feptx0(RU_t *ru,
int num_symb = 7;
if (subframe_select(fp,subframe) == SF_S)
- num_symb = fp->dl_symbols_in_S_subframe+1;
+ num_symb = fp->dl_symbols_in_S_subframe+1;
- if (ru->generate_dmrs_sync == 1 && slot == 0 && subframe == 1 && aa==0) {
+ if (ru->generate_dmrs_sync == 1 && slot == 2 && aa==0) {
//int32_t dmrs[ru->frame_parms.ofdm_symbol_size*14] __attribute__((aligned(32)));
//int32_t *dmrsp[2] ={dmrs,NULL}; //{&dmrs[(3-ru->frame_parms.Ncp)*ru->frame_parms.ofdm_symbol_size],NULL};
-
- generate_drs_pusch((PHY_VARS_UE *)NULL,
- (UE_rxtx_proc_t*)NULL,
- fp,
- ru->common.txdataF_BF,
- 0,
- AMP,
- 0,
- 0,
- fp->N_RB_DL,
- aa);
+ generate_drs_pusch((PHY_VARS_UE *)NULL,
+ (UE_rxtx_proc_t*)NULL,
+ fp,
+ ru->common.txdataF_BF,
+ 0,
+ AMP,
+ 0,
+ 0,
+ fp->N_RB_DL,
+ aa);
}
- normal_prefix_mod(&ru->common.txdataF_BF[aa][(slot&1)*slot_sizeF],
- (int*)&ru->common.txdata[aa][slot_offset],
- num_symb,
- fp);
+ normal_prefix_mod(&ru->common.txdataF_BF[aa][(slot&1)*slot_sizeF],
+ (int*)&ru->common.txdata[aa][slot_offset],
+ num_symb,
+ fp);
}
}
@@ -474,15 +472,16 @@ void feptx_prec(RU_t *ru,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+ru->idx , 1);
for (aa=0;aanb_tx;aa++) {
- memset(ru->common.txdataF_BF[aa],0,sizeof(int32_t)*fp->ofdm_symbol_size*fp->symbols_per_tti);
- for (int p=0;pdo_precoding == 0) {
- if (p==0)
- memcpy((void*)ru->common.txdataF_BF[aa],
- (void*)&eNB->common_vars.txdataF[aa][subframe*fp->symbols_per_tti*fp->ofdm_symbol_size],
- sizeof(int32_t)*fp->ofdm_symbol_size*fp->symbols_per_tti);
- } else {
- if (pnb_antenna_ports_eNB) {
+ if (ru->do_precoding == 0) {
+ memcpy((void*)ru->common.txdataF_BF[aa],
+ (void*)&eNB->common_vars.txdataF[aa%fp->nb_antenna_ports_eNB][subframe*fp->symbols_per_tti*fp->ofdm_symbol_size],
+ sizeof(int32_t)*fp->ofdm_symbol_size*fp->symbols_per_tti);
+
+ }
+ else {
+ memset(ru->common.txdataF_BF[aa],0,sizeof(int32_t)*fp->ofdm_symbol_size*fp->symbols_per_tti);
+ for (int p=0;pnb_antenna_ports_eNB) {
// For the moment this does nothing different than below, except ignore antenna ports 5,7,8.
for (l=0;lnum_pdcch_symbols;l++)
beam_precoding(eNB->common_vars.txdataF,
@@ -494,10 +493,10 @@ void feptx_prec(RU_t *ru,
aa,
p,
eNB->Mod_id);
- } //if (pnb_antenna_ports_eNB)
+ } //if (pnb_antenna_ports_eNB)
// PDSCH region
- if (p