Commit a3c7af0a authored by Raymond Knopp's avatar Raymond Knopp

Merge remote-tracking branch 'origin/develop' into threading-rk

parents 2a6b1886 6022fe5a
...@@ -405,6 +405,26 @@ pipeline { ...@@ -405,6 +405,26 @@ pipeline {
} }
} }
} }
stage ("SA-AW2S-CN5G") {
when { expression {do5Gtest} }
steps {
script {
triggerSlaveJob ('RAN-SA-AW2S-CN5G', 'SA-AW2S-CN5G')
}
}
post {
always {
script {
finalizeSlaveJob('RAN-SA-AW2S-CN5G')
}
}
failure {
script {
currentBuild.result = 'FAILURE'
}
}
}
}
//avra is offline, re-enable once it is available //avra is offline, re-enable once it is available
//stage ("T1-Offload-Test") { //stage ("T1-Offload-Test") {
......
...@@ -211,10 +211,16 @@ pipeline { ...@@ -211,10 +211,16 @@ pipeline {
script { script {
dir ('ci-scripts') { dir ('ci-scripts') {
// Zipping all archived log files // Zipping all archived log files
sh "zip -r -qq physim_deploytest_logs_${env.BUILD_ID}.zip physim_test_logs_*/*" sh "mkdir test_logs"
sh "rm -rf physim_test_logs_*/" sh "mv *.log* test_logs || true"
if (fileExists("physim_deploytest_logs_${env.BUILD_ID}.zip")) { sh "zip -r -qq test_logs_${env.BUILD_ID}.zip *test_log*/"
archiveArtifacts artifacts: "physim_deploytest_logs_${env.BUILD_ID}.zip" sh "rm -rf *test_log*/"
if (fileExists("test_logs_${env.BUILD_ID}.zip")) {
archiveArtifacts artifacts: "test_logs_${env.BUILD_ID}.zip"
}
if (fileExists("test_logs_CN.zip")){
sh "mv test_logs_CN.zip test_logs_CN_${env.BUILD_ID}.zip"
archiveArtifacts artifacts: "test_logs_CN_${env.BUILD_ID}.zip"
} }
if (fileExists("test_results.html")) { if (fileExists("test_results.html")) {
sh "mv test_results.html test_results-${env.JOB_NAME}.html" sh "mv test_results.html test_results-${env.JOB_NAME}.html"
......
...@@ -197,6 +197,7 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,EPC,ldpc,CONTAINERS,HELP,SCA,PHYSIM,CLUST ...@@ -197,6 +197,7 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,EPC,ldpc,CONTAINERS,HELP,SCA,PHYSIM,CLUST
SCA.eNBSourceCodePath=matchReg.group(1) SCA.eNBSourceCodePath=matchReg.group(1)
PHYSIM.eNBSourceCodePath=matchReg.group(1) PHYSIM.eNBSourceCodePath=matchReg.group(1)
CLUSTER.eNBSourceCodePath=matchReg.group(1) CLUSTER.eNBSourceCodePath=matchReg.group(1)
EPC.eNBSourceCodePath=matchReg.group(1)
elif re.match('^\-\-eNB1SourceCodePath=(.+)$', myArgv, re.IGNORECASE): elif re.match('^\-\-eNB1SourceCodePath=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-eNB1SourceCodePath=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-eNB1SourceCodePath=(.+)$', myArgv, re.IGNORECASE)
RAN.eNB1SourceCodePath=matchReg.group(1) RAN.eNB1SourceCodePath=matchReg.group(1)
...@@ -219,10 +220,10 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,EPC,ldpc,CONTAINERS,HELP,SCA,PHYSIM,CLUST ...@@ -219,10 +220,10 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,EPC,ldpc,CONTAINERS,HELP,SCA,PHYSIM,CLUST
EPC.SourceCodePath=matchReg.group(1) EPC.SourceCodePath=matchReg.group(1)
elif re.match('^\-\-EPCType=(.+)$', myArgv, re.IGNORECASE): elif re.match('^\-\-EPCType=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-EPCType=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-EPCType=(.+)$', myArgv, re.IGNORECASE)
if re.match('OAI', matchReg.group(1), re.IGNORECASE) or re.match('ltebox', matchReg.group(1), re.IGNORECASE) or re.match('OAI-Rel14-CUPS', matchReg.group(1), re.IGNORECASE) or re.match('OAI-Rel14-Docker', matchReg.group(1), re.IGNORECASE): if re.match('OAI', matchReg.group(1), re.IGNORECASE) or re.match('ltebox', matchReg.group(1), re.IGNORECASE) or re.match('OAI-Rel14-CUPS', matchReg.group(1), re.IGNORECASE) or re.match('OAI-Rel14-Docker', matchReg.group(1), re.IGNORECASE) or re.match('OC-OAI-CN5G', matchReg.group(1), re.IGNORECASE):
EPC.Type=matchReg.group(1) EPC.Type=matchReg.group(1)
else: else:
sys.exit('Invalid EPC Type: ' + matchReg.group(1) + ' -- (should be OAI or ltebox or OAI-Rel14-CUPS or OAI-Rel14-Docker)') sys.exit('Invalid EPC Type: ' + matchReg.group(1) + ' -- (should be OAI or ltebox or OAI-Rel14-CUPS or OAI-Rel14-Docker or OC-OAI-CN5G)')
elif re.match('^\-\-EPCContainerPrefix=(.+)$', myArgv, re.IGNORECASE): elif re.match('^\-\-EPCContainerPrefix=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-EPCContainerPrefix=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-EPCContainerPrefix=(.+)$', myArgv, re.IGNORECASE)
EPC.ContainerPrefix=matchReg.group(1) EPC.ContainerPrefix=matchReg.group(1)
...@@ -260,14 +261,17 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,EPC,ldpc,CONTAINERS,HELP,SCA,PHYSIM,CLUST ...@@ -260,14 +261,17 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,EPC,ldpc,CONTAINERS,HELP,SCA,PHYSIM,CLUST
matchReg = re.match('^\-\-OCUserName=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-OCUserName=(.+)$', myArgv, re.IGNORECASE)
PHYSIM.OCUserName = matchReg.group(1) PHYSIM.OCUserName = matchReg.group(1)
CLUSTER.OCUserName = matchReg.group(1) CLUSTER.OCUserName = matchReg.group(1)
EPC.OCUserName = matchReg.group(1)
elif re.match('^\-\-OCPassword=(.+)$', myArgv, re.IGNORECASE): elif re.match('^\-\-OCPassword=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-OCPassword=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-OCPassword=(.+)$', myArgv, re.IGNORECASE)
PHYSIM.OCPassword = matchReg.group(1) PHYSIM.OCPassword = matchReg.group(1)
CLUSTER.OCPassword = matchReg.group(1) CLUSTER.OCPassword = matchReg.group(1)
EPC.OCPassword = matchReg.group(1)
elif re.match('^\-\-OCProjectName=(.+)$', myArgv, re.IGNORECASE): elif re.match('^\-\-OCProjectName=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-OCProjectName=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-OCProjectName=(.+)$', myArgv, re.IGNORECASE)
PHYSIM.OCProjectName = matchReg.group(1) PHYSIM.OCProjectName = matchReg.group(1)
CLUSTER.OCProjectName = matchReg.group(1) CLUSTER.OCProjectName = matchReg.group(1)
EPC.OCProjectName = matchReg.group(1)
elif re.match('^\-\-OCUrl=(.+)$', myArgv, re.IGNORECASE): elif re.match('^\-\-OCUrl=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-OCUrl=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-OCUrl=(.+)$', myArgv, re.IGNORECASE)
CLUSTER.OCUrl = matchReg.group(1) CLUSTER.OCUrl = matchReg.group(1)
......
/* UE simulator configuration file version 2021-06-17
* LTE / 5G Non StandAlone
* Copyright (C) 2019-2021 Amarisoft
*/
{
#define N_ANTENNA_DL 1
#define TDD 1
log_options: "all.level=warn,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1",
log_filename: "/tmp/ue1.log",
/* Enable remote API and Web interface */
com_addr: "0.0.0.0:9002",
include "rf_driver/1chan.cfg",
/* If true, allow the simulation of several UEs at the same time and
allow dynamic UE creation from remote API */
cell_groups: [{
group_type: "nr",
multi_ue: true,
cells: [{
rf_port: 0,
bandwidth: 20,
#if TDD == 1
band: 78,
dl_nr_arfcn:627360,
ssb_nr_arfcn:627360,
#else
band: 7,
dl_nr_arfcn: 536020,
ssb_nr_arfcn: 535930,
ssb_subcarrier_spacing: 15,
#endif
subcarrier_spacing: 30,
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: 1,
rx_to_tx_latency:2,
}],
}],
ue_list: [
{
/* UE capabilities */
/* USIM data */
"ue_id" : 1,
"imsi": "001010000000100",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, }, ],
default_pdu_session_snssai: { sst: 1, },
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
},
{
/* UE capabilities */
/* USIM data */
"ue_id" : 2,
"imsi": "001010000000101",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, }, ],
default_pdu_session_snssai: { sst: 1, },
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
},
{
/* UE capabilities */
/* USIM data */
"ue_id" : 3,
"imsi": "001010000000102",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, sd: 66051, }, ],
default_pdu_session_snssai: { sst: 1, sd: 66051, },
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
},
{
/* UE capabilities */
/* USIM data */
"ue_id" : 4,
"imsi": "001010000000103",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, sd: 66051, }, ],
default_pdu_session_snssai: { sst: 1, sd: 66051, },
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
},
{
/* UE capabilities */
/* USIM data */
"ue_id" : 5,
"imsi": "001010000000104",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, sd: 66051, }, ],
default_pdu_session_snssai: { sst: 1, sd: 66051, },
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
},
{
/* UE capabilities */
/* USIM data */
"ue_id" : 6,
"imsi": "001010000000105",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, sd: 66051, }, ],
default_pdu_session_snssai: { sst: 1, sd: 66051, },
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
},
{
/* UE capabilities */
/* USIM data */
"ue_id" : 7,
"imsi": "001010000000106",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [ { sst: 1, sd: 66051, }, ],
default_pdu_session_snssai: { sst: 1, sd: 66051, },
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
},
],
}
/* UE simulator configuration */
/* UE simulator configuration file version 2021-06-17
* LTE / 5G Non StandAlone
* Copyright (C) 2019-2021 Amarisoft
*/
{
#define N_ANTENNA_DL 1
#define TDD 1
#define CELL_BANDWIDTH 40
#define UE_COUNT 3 // number of simulated UEs 208970100001127, 208970100001128, 208970100001129
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1",
log_filename: "/tmp/ue0.log",
/* Enable remote API and Web interface */
com_addr: "0.0.0.0:9002",
include "rf_driver/1chan.cfg",
/* If true, allow the simulation of several UEs at the same time and allow dynamic UE creation from remote API */
cell_groups: [{
group_type: "nr",
multi_ue: true,
cells: [{
rf_port: 0,
bandwidth: CELL_BANDWIDTH,
#if TDD == 1
band: 78,
dl_nr_arfcn:621312,
ssb_nr_arfcn:621312,
//band: 41,
//dl_nr_arfcn:517020,
//ssb_nr_arfcn:516990,
#else
band: 7,
dl_nr_arfcn: 536020,
ssb_nr_arfcn: 535930,
ssb_subcarrier_spacing: 15,
#endif
subcarrier_spacing: 30,
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: 1,
rx_to_tx_latency:2,
}],
}],
/* Enable it to allow sim_events to be handled remotely */
//rue_bind_addr: "127.0.10.11",
ue_list: [
{
/* UE capabilities */
/* USIM data */
"ue_id" : 0,
"imsi": "208970100001127",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [
{
event: "power_on",
start_time: 5,
},
{
event: "power_off",
start_time: 30,
}
] /*end sim events */
}, /*end UE object 0*/
{
/* UE capabilities */
/* USIM data */
"ue_id" : 1,
"imsi": "208970100001128",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [
{
event: "power_on",
start_time: 5,
},
{
event: "power_off",
start_time: 30,
}
] /*end sim events */
}, /*end UE object 1*/
{
/* UE capabilities */
/* USIM data */
"ue_id" : 2,
"imsi": "208970100001129",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [
{
event: "power_on",
start_time: 5,
},
{
event: "power_off",
start_time: 30,
}
] /*end sim events */
} /*end UE object 2*/
],/*end UE list*/
}/*end json*/
/* UE simulator configuration */
/* UE simulator configuration file version 2021-06-17
* LTE / 5G Non StandAlone
* Copyright (C) 2019-2021 Amarisoft
*/
{
#define N_ANTENNA_DL 1
#define TDD 1
#define CELL_BANDWIDTH 40
#define UE_COUNT 2 // number of simulated UEs 208970100001127, 208970100001128, 208970100001129
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1",
log_filename: "/tmp/ue0.log",
/* Enable remote API and Web interface */
com_addr: "0.0.0.0:9002",
include "rf_driver/1chan.cfg",
/* If true, allow the simulation of several UEs at the same time and allow dynamic UE creation from remote API */
cell_groups: [{
group_type: "nr",
multi_ue: true,
cells: [{
rf_port: 0,
bandwidth: CELL_BANDWIDTH,
#if TDD == 1
band: 78,
dl_nr_arfcn:621312,
ssb_nr_arfcn:621312,
//band: 41,
//dl_nr_arfcn:517020,
//ssb_nr_arfcn:516990,
#else
band: 7,
dl_nr_arfcn: 536020,
ssb_nr_arfcn: 535930,
ssb_subcarrier_spacing: 15,
#endif
subcarrier_spacing: 30,
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: 1,
rx_to_tx_latency:2,
}],
}],
/* Enable it to allow sim_events to be handled remotely */
//rue_bind_addr: "127.0.10.11",
ue_list: [
{
/* UE capabilities */
/* USIM data */
"ue_id" : 1,
"imsi": "208970100001127",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [
{
event: "power_on",
start_time: 5,
},
{
event: "power_off",
start_time: 30,
}
] /*end sim events */
}, /*end UE object 0*/
{
/* UE capabilities */
/* USIM data */
"ue_id" : 2,
"imsi": "208970100001128",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [
{
event: "power_on",
start_time: 5,
},
{
"tag": "ping",
"prog":"oai_ext_app.sh",
start_time: 15,
end_time: 25,
"args":["ping 192.168.70.136"],
"event":"ext_app"
},
{
event: "power_off",
start_time: 30,
}
] /*end sim events */
} /*end UE object 1*/
],/*end UE list*/
}/*end json*/
/* UE simulator configuration */
/* UE simulator configuration file version 2021-06-17
* LTE / 5G Non StandAlone
* Copyright (C) 2019-2021 Amarisoft
*/
{
#define N_ANTENNA_DL 1
#define TDD 1
#define CELL_BANDWIDTH 40
#define UE_COUNT 2 // number of simulated UEs 208970100001127, 208970100001128, 208970100001129
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1",
log_filename: "/tmp/ue0.log",
/* Enable remote API and Web interface */
com_addr: "0.0.0.0:9002",
include "rf_driver/1chan.cfg",
/* If true, allow the simulation of several UEs at the same time and allow dynamic UE creation from remote API */
cell_groups: [{
group_type: "nr",
multi_ue: true,
cells: [{
rf_port: 0,
bandwidth: CELL_BANDWIDTH,
#if TDD == 1
band: 78,
dl_nr_arfcn:621312,
ssb_nr_arfcn:621312,
//band: 41,
//dl_nr_arfcn:517020,
//ssb_nr_arfcn:516990,
#else
band: 7,
dl_nr_arfcn: 536020,
ssb_nr_arfcn: 535930,
ssb_subcarrier_spacing: 15,
#endif
subcarrier_spacing: 30,
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: 1,
rx_to_tx_latency:2,
}],
}],
/* Enable it to allow sim_events to be handled remotely */
//rue_bind_addr: "127.0.10.11",
ue_list: [
{
/* UE capabilities */
/* USIM data */
"ue_id" : 1,
"imsi": "208970100001127",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [
{
event: "power_on",
start_time: 5,
},
{
"tag": "ping",
"prog":"oai_ext_app.sh",
start_time: 15,
end_time: 25,
"args":["ping 192.168.70.136"],
"event":"ext_app"
},
{
event: "power_off",
start_time: 30,
}
] /*end sim events */
}, /*end UE object 0*/
{
/* UE capabilities */
/* USIM data */
"ue_id" : 2,
"imsi": "208970100001128",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [
{
event: "power_on",
start_time: 5,
},
{
"tag": "ping",
"prog":"oai_ext_app.sh",
start_time: 15,
end_time: 25,
"args":["ping 192.168.70.136"],
"event":"ext_app"
},
{
event: "power_off",
start_time: 30,
}
] /*end sim events */
} /*end UE object 1*/
],/*end UE list*/
}/*end json*/
/* UE simulator configuration */
/* UE simulator configuration file version 2021-06-17
* LTE / 5G Non StandAlone
* Copyright (C) 2019-2021 Amarisoft
*/
{
#define N_ANTENNA_DL 1
#define TDD 1
#define CELL_BANDWIDTH 40
#define UE_COUNT 2 // number of simulated UEs 208970100001127, 208970100001128, 208970100001129
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1",
log_filename: "/tmp/ue0.log",
/* Enable remote API and Web interface */
com_addr: "0.0.0.0:9002",
include "rf_driver/1chan.cfg",
/* If true, allow the simulation of several UEs at the same time and allow dynamic UE creation from remote API */
cell_groups: [{
group_type: "nr",
multi_ue: true,
cells: [{
rf_port: 0,
bandwidth: CELL_BANDWIDTH,
#if TDD == 1
band: 78,
dl_nr_arfcn:621312,
ssb_nr_arfcn:621312,
//band: 41,
//dl_nr_arfcn:517020,
//ssb_nr_arfcn:516990,
#else
band: 7,
dl_nr_arfcn: 536020,
ssb_nr_arfcn: 535930,
ssb_subcarrier_spacing: 15,
#endif
subcarrier_spacing: 30,
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: 1,
rx_to_tx_latency:2,
}],
}],
/* Enable it to allow sim_events to be handled remotely */
//rue_bind_addr: "127.0.10.11",
ue_list: [
{
/* UE capabilities */
/* USIM data */
"ue_id" : 1,
"imsi": "208970100001127",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [
{
event: "power_on",
start_time: 5,
},
{
"tag": "ping",
"prog":"oai_ext_app.sh",
start_time: 20,
end_time: 30,
"args":["ping 192.168.70.136"],
"event":"ext_app"
},
{
event: "power_off",
start_time: 60,
}
] /*end sim events */
}, /*end UE object 0*/
{
/* UE capabilities */
/* USIM data */
"ue_id" : 2,
"imsi": "208970100001128",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [
{
event: "power_on",
start_time: 5,
},
{
"tag": "ping",
"prog":"oai_ext_app.sh",
start_time: 40,
end_time: 50,
"args":["ping 192.168.70.136"],
"event":"ext_app"
},
{
event: "power_off",
start_time: 60,
}
] /*end sim events */
} /*end UE object 1*/
],/*end UE list*/
}/*end json*/
/* UE simulator configuration */
/* UE simulator configuration file version 2021-06-17
* LTE / 5G Non StandAlone
* Copyright (C) 2019-2021 Amarisoft
*/
{
#define N_ANTENNA_DL 1
#define TDD 1
#define CELL_BANDWIDTH 40
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1",
log_filename: "/tmp/ue1.log",
/* Enable remote API and Web interface */
com_addr: "0.0.0.0:9002",
include "rf_driver/1chan.cfg",
/* If true, allow the simulation of several UEs at the same time and
allow dynamic UE creation from remote API */
cell_groups: [{
group_type: "nr",
multi_ue: false,
cells: [{
rf_port: 0,
bandwidth: CELL_BANDWIDTH,
#if TDD == 1
band: 78,
dl_nr_arfcn:621312,
ssb_nr_arfcn:621312,
//band: 41,
//dl_nr_arfcn:517020,
//ssb_nr_arfcn:516990,
#else
band: 7,
dl_nr_arfcn: 536020,
ssb_nr_arfcn: 535930,
ssb_subcarrier_spacing: 15,
#endif
subcarrier_spacing: 30,
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: 1,
rx_to_tx_latency:2,
}],
}],
/* Enable it to allow sim_events to be handled remotely */
//rue_bind_addr: "127.0.10.11",
ue_list: [
{
/* UE capabilities */
/* USIM data */
"imsi": "208970100001127",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [{
event: "power_on",
start_time: 5,
}, {
"tag": "ping",
"prog":"oai_ext_app.sh",
start_time: 15,
end_time: 25,
"args":["ping 192.168.70.136"],
"event":"ext_app"
},
{
event: "power_off",
start_time: 30,
}]
}
],
}
/* UE simulator configuration */
/* UE simulator configuration file version 2021-06-17
* LTE / 5G Non StandAlone
* Copyright (C) 2019-2021 Amarisoft
*/
{
#define N_ANTENNA_DL 1
#define TDD 1
#define CELL_BANDWIDTH 20
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1",
log_filename: "/tmp/ue0.log",
/* Enable remote API and Web interface */
com_addr: "0.0.0.0:9002",
include "rf_driver/1chan.cfg",
/* If true, allow the simulation of several UEs at the same time and
allow dynamic UE creation from remote API */
cell_groups: [{
group_type: "nr",
multi_ue: false,
cells: [{
rf_port: 0,
bandwidth: CELL_BANDWIDTH,
#if TDD == 1
// band: 78,
// dl_nr_arfcn:621312,
// ssb_nr_arfcn:621312,*/
band: 41,
dl_nr_arfcn:517020,
ssb_nr_arfcn:516990,
#else
band: 7,
dl_nr_arfcn: 536020,
ssb_nr_arfcn: 535930,
ssb_subcarrier_spacing: 15,
#endif
subcarrier_spacing: 30,
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: 1,
rx_to_tx_latency:2,
}],
}],
/* Enable it to allow sim_events to be handled remotely */
//rue_bind_addr: "127.0.10.11",
ue_list: [
{
/* UE capabilities */
/* USIM data */
"imsi": "208970100001127",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 1,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 1,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [{
event: "power_on",
start_time: 5,
}, {
event: "ext_app",
start_time: 15,
end_time: 25,
prog: "ext_app.sh",
args: ["iperf", " -c 172.21.10.5", " -u"," -b 1M"," -i 1"," -t 10"]
}, {
event: "power_off",
start_time: 30,
}]
}
],
}
...@@ -49,75 +49,75 @@ adb_ue_2: ...@@ -49,75 +49,75 @@ adb_ue_2:
amarisoft_ue: amarisoft_ue:
Host: amariue Host: amariue
InitScript: nohup /root/NV18-06-2022/ue/lteue /root/NV18-06-2022/ue/config/oaicicd-ue-ci-test.cfg & InitScript: /root/NV18-06-2022/lteue-linux-2023-03-17/lteue /root/oaicicd/ran_sa_aw2s_asue/aw2s-asue.cfg &
TermScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"quit"}' TermScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"quit"}'
amarisoft_ue_1: amarisoft_ue_1:
Host: amariue Host: amariue
AttachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":1}' AttachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":1}'
DetachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":1}' DetachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":1}'
UENetworkScript: ip netns exec ue1 ip a show dev pdn0 UENetworkScript: ip netns exec ue1 ip a show dev pdn0
CmdPrefix: ip netns exec ue1 CmdPrefix: ip netns exec ue1
MTU: 1500 MTU: 1500
amarisoft_ue_2: amarisoft_ue_2:
Host: amariue Host: amariue
AttachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":2}' AttachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":2}'
DetachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":2}' DetachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":2}'
UENetworkScript: ip netns exec ue2 ip a show dev pdn0 UENetworkScript: ip netns exec ue2 ip a show dev pdn0
CmdPrefix: ip netns exec ue2 CmdPrefix: ip netns exec ue2
MTU: 1500 MTU: 1500
amarisoft_ue_3: amarisoft_ue_3:
Host: amariue Host: amariue
AttachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":3}' AttachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":3}'
DetachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":3}' DetachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":3}'
UENetworkScript: ip netns exec ue3 ip a show dev pdn0 UENetworkScript: ip netns exec ue3 ip a show dev pdn0
CmdPrefix: ip netns exec ue3 CmdPrefix: ip netns exec ue3
MTU: 1500 MTU: 1500
amarisoft_ue_4: amarisoft_ue_4:
Host: amariue Host: amariue
AttachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":4}' AttachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":4}'
DetachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":4}' DetachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":4}'
UENetworkScript: ip netns exec ue4 ip a show dev pdn0 UENetworkScript: ip netns exec ue4 ip a show dev pdn0
CmdPrefix: ip netns exec ue4 CmdPrefix: ip netns exec ue4
MTU: 1500 MTU: 1500
amarisoft_ue_5: amarisoft_ue_5:
Host: amariue Host: amariue
AttachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":5}' AttachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":5}'
DetachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":5}' DetachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":5}'
UENetworkScript: ip netns exec ue5 ip a show dev pdn0 UENetworkScript: ip netns exec ue5 ip a show dev pdn0
CmdPrefix: ip netns exec ue5 CmdPrefix: ip netns exec ue5
MTU: 1500 MTU: 1500
amarisoft_ue_6: amarisoft_ue_6:
Host: amariue Host: amariue
AttachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":6}' AttachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":6}'
DetachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":6}' DetachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":6}'
UENetworkScript: ip netns exec ue6 ip a show dev pdn0 UENetworkScript: ip netns exec ue6 ip a show dev pdn0
CmdPrefix: ip netns exec ue6 CmdPrefix: ip netns exec ue6
MTU: 1500 MTU: 1500
amarisoft_ue_7: amarisoft_ue_7:
Host: amariue Host: amariue
AttachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":7}' AttachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":7}'
DetachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":7}' DetachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":7}'
UENetworkScript: ip netns exec ue7 ip a show dev pdn0 UENetworkScript: ip netns exec ue7 ip a show dev pdn0
CmdPrefix: ip netns exec ue7 CmdPrefix: ip netns exec ue7
MTU: 1500 MTU: 1500
amarisoft_ue_8: amarisoft_ue_8:
Host: amariue Host: amariue
AttachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":8}' AttachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":8}'
DetachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":8}' DetachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":8}'
UENetworkScript: ip netns exec ue8 ip a show dev pdn0 UENetworkScript: ip netns exec ue8 ip a show dev pdn0
CmdPrefix: ip netns exec ue8 CmdPrefix: ip netns exec ue8
MTU: 1500 MTU: 1500
amarisoft_ue_9: amarisoft_ue_9:
Host: amariue Host: amariue
AttachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":9}' AttachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":9}'
DetachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":9}' DetachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":9}'
UENetworkScript: ip netns exec ue9 ip a show dev pdn0 UENetworkScript: ip netns exec ue9 ip a show dev pdn0
CmdPrefix: ip netns exec ue9 CmdPrefix: ip netns exec ue9
MTU: 1500 MTU: 1500
amarisoft_ue_10: amarisoft_ue_10:
Host: amariue Host: amariue
AttachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":10}' AttachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":10}'
DetachScript: /root/NV18-06-2022/lteue-linux-2022-06-18/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":10}' DetachScript: /root/NV18-06-2022/lteue-linux-2023-03-17/doc/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":10}'
UENetworkScript: ip netns exec ue10 ip a show dev pdn0 UENetworkScript: ip netns exec ue10 ip a show dev pdn0
CmdPrefix: ip netns exec ue10 CmdPrefix: ip netns exec ue10
MTU: 1500 MTU: 1500
......
...@@ -40,6 +40,29 @@ import cls_cmd ...@@ -40,6 +40,29 @@ import cls_cmd
IMAGE_REGISTRY_SERVICE_NAME = "image-registry.openshift-image-registry.svc" IMAGE_REGISTRY_SERVICE_NAME = "image-registry.openshift-image-registry.svc"
NAMESPACE = "oaicicd-ran" NAMESPACE = "oaicicd-ran"
OCUrl = "https://api.oai.cs.eurecom.fr:6443"
OCRegistry = "default-route-openshift-image-registry.apps.oai.cs.eurecom.fr/"
def OC_login(cmd, ocUserName, ocPassword, ocProjectName):
if ocUserName == '' or ocPassword == '' or ocProjectName == '':
HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter: no OC Credentials')
if OCRegistry.startswith("http") and not self.OCRegistry.endswith("/"):
sys.exit(f'ocRegistry {OCRegistry} should not start with http:// or https:// and end on a slash /')
ret = cmd.run(f'oc login -u {ocUserName} -p {ocPassword} --server {OCUrl}')
if ret.returncode != 0:
logging.error('\u001B[1m OC Cluster Login Failed\u001B[0m')
return False
ret = cmd.run(f'oc project {ocProjectName}')
if ret.returncode != 0:
logging.error(f'\u001B[1mUnable to access OC project {ocProjectName}\u001B[0m')
OC_logout(cmd)
return False
return True
def OC_logout(cmd):
cmd.run(f'oc logout')
class Cluster: class Cluster:
def __init__(self): def __init__(self):
...@@ -57,7 +80,7 @@ class Cluster: ...@@ -57,7 +80,7 @@ class Cluster:
self.ranAllowMerge = False self.ranAllowMerge = False
self.ranTargetBranch = "" self.ranTargetBranch = ""
self.cmd = None self.cmd = None
self.imageToPull = ''
def _recreate_entitlements(self): def _recreate_entitlements(self):
# recreating entitlements, don't care if deletion fails # recreating entitlements, don't care if deletion fails
...@@ -170,11 +193,47 @@ class Cluster: ...@@ -170,11 +193,47 @@ class Cluster:
def _undeploy_pod(self, filename): def _undeploy_pod(self, filename):
self.cmd.run(f'oc delete -f {filename}') self.cmd.run(f'oc delete -f {filename}')
def PullClusterImage(self, HTML, RAN):
if self.imageToPull == '':
HELP.GenericHelp(CONST.Version)
HELP.EPCSrvHelp(self.imageToPull)
sys.exit('Insufficient eNB Parameters')
lIpAddr = self.eNBIPAddress
self.testCase_id = HTML.testCase_id
cmd = cls_cmd.getConnection(lIpAddr)
succeeded = OC_login(cmd, self.OCUserName, self.OCPassword, self.OCProjectName)
if not succeeded:
logging.error('\u001B[1m OC Cluster Login Failed\u001B[0m')
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_LOGIN_FAIL)
return False
ret = cmd.run(f'oc whoami -t | docker login -u oaicicd --password-stdin {self.OCRegistry}')
if ret.returncode != 0:
logging.error(f'\u001B[1m Unable to access OC project {ocProjectName}\u001B[0m')
OC_logout(cmd)
cmd.close()
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_LOGIN_FAIL)
return False
for image in self.imageToPull:
imagePrefix = f'{self.OCRegistry}{self.OCProjectName}'
imageTag = cls_containerize.ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge)
ret = cmd.run(f'docker pull {imagePrefix}/{imageTag}')
if ret.returncode != 0:
logging.error(f'Could not pull {image} from local registry : {self.OCRegistry}')
OC_logout(cmd)
cmd.close()
HTML.CreateHtmlTestRow('msg', 'KO', CONST.ALL_PROCESSES_OK)
return False
cmd.run(f'docker tag {imagePrefix}/{imageTag} oai-ci/{imageTag}')
cmd.run(f'docker rmi {imagePrefix}/{imageTag}')
OC_logout(cmd)
cmd.close()
HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
return True
def BuildClusterImage(self, HTML): def BuildClusterImage(self, HTML):
if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '': if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '':
HELP.GenericHelp(CONST.Version) HELP.GenericHelp(CONST.Version)
sys.exit(f'Insufficient Parameter: ranRepository {self.ranRepository} ranBranch {ranBranch} ranCommitID {self.ranCommitID}') sys.exit(f'Insufficient Parameter: ranRepository {self.ranRepository} ranBranch {ranBranch} ranCommitID {self.ranCommitID}')
lIpAddr = self.eNBIPAddress lIpAddr = self.eNBIPAddress
lSourcePath = self.eNBSourceCodePath lSourcePath = self.eNBSourceCodePath
if lIpAddr == '' or lSourcePath == '': if lIpAddr == '' or lSourcePath == '':
...@@ -204,7 +263,6 @@ class Cluster: ...@@ -204,7 +263,6 @@ class Cluster:
baseTag = 'develop' baseTag = 'develop'
forceBaseImageBuild = False forceBaseImageBuild = False
imageTag = 'develop'
if self.ranAllowMerge: # merging MR branch into develop -> temporary image if self.ranAllowMerge: # merging MR branch into develop -> temporary image
imageTag = f'{self.ranBranch}-{self.ranCommitID[0:8]}' imageTag = f'{self.ranBranch}-{self.ranCommitID[0:8]}'
if self.ranTargetBranch == 'develop': if self.ranTargetBranch == 'develop':
...@@ -214,6 +272,7 @@ class Cluster: ...@@ -214,6 +272,7 @@ class Cluster:
forceBaseImageBuild = True forceBaseImageBuild = True
baseTag = 'ci-temp' baseTag = 'ci-temp'
else: else:
imageTag = f'develop-{self.ranCommitID[0:8]}'
forceBaseImageBuild = True forceBaseImageBuild = True
# logging to OC Cluster and then switch to corresponding project # logging to OC Cluster and then switch to corresponding project
...@@ -273,11 +332,18 @@ class Cluster: ...@@ -273,11 +332,18 @@ class Cluster:
ranbuild_job = self._start_build('ran-build') ranbuild_job = self._start_build('ran-build')
attemptedImages += ['ran-build'] attemptedImages += ['ran-build']
wait = ranbuild_job is not None and physim_job is not None and self._wait_build_end([ranbuild_job, physim_job], 1200) self._recreate_is_tag('oai-clang', imageTag, 'openshift/oai-clang-is.yaml')
if not wait: logging.error('error during build of ranbuild_job or physim_job') self._recreate_bc('oai-clang', imageTag, 'openshift/oai-clang-bc.yaml')
self._retag_image_statement('ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.clang.rhel8.2')
clang_job = self._start_build('oai-clang')
attemptedImages += ['oai-clang']
wait = ranbuild_job is not None and physim_job is not None and clang_job is not None and self._wait_build_end([ranbuild_job, physim_job, clang_job], 1200)
if not wait: logging.error('error during build of ranbuild_job or physim_job or clang_job')
status = status and wait status = status and wait
self.cmd.run(f'oc logs {ranbuild_job} &> cmake_targets/log/ran-build.log') self.cmd.run(f'oc logs {ranbuild_job} &> cmake_targets/log/ran-build.log')
self.cmd.run(f'oc logs {physim_job} &> cmake_targets/log/oai-physim.log') self.cmd.run(f'oc logs {physim_job} &> cmake_targets/log/oai-physim.log')
self.cmd.run(f'oc logs {clang_job} &> cmake_targets/log/oai-clang.log')
self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log', '\$', 10) self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log', '\$', 10)
if status: if status:
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
#----------------------------------------------------------- #-----------------------------------------------------------
# Import # Import
#----------------------------------------------------------- #-----------------------------------------------------------
import sys # arg import sys # arg
import re # reg import re # reg
import logging import logging
import os import os
import shutil import shutil
...@@ -47,6 +47,7 @@ from zipfile import ZipFile ...@@ -47,6 +47,7 @@ from zipfile import ZipFile
#----------------------------------------------------------- #-----------------------------------------------------------
# OAI Testing modules # OAI Testing modules
#----------------------------------------------------------- #-----------------------------------------------------------
import cls_cluster as OC
import cls_cmd import cls_cmd
import sshconnection as SSH import sshconnection as SSH
import helpreadme as HELP import helpreadme as HELP
...@@ -90,6 +91,15 @@ def CreateWorkspace(sshSession, sourcePath, ranRepository, ranCommitID, ranTarge ...@@ -90,6 +91,15 @@ def CreateWorkspace(sshSession, sourcePath, ranRepository, ranCommitID, ranTarge
logging.debug(f'Merging with the target branch: {ranTargetBranch}') logging.debug(f'Merging with the target branch: {ranTargetBranch}')
sshSession.command(f'git merge --ff origin/{ranTargetBranch} -m "Temporary merge for CI"', '\$', 30) sshSession.command(f'git merge --ff origin/{ranTargetBranch} -m "Temporary merge for CI"', '\$', 30)
def ImageTagToUse(imageName, ranCommitID, ranBranch, ranAllowMerge):
shortCommit = ranCommitID[0:8]
if ranAllowMerge:
tagToUse = f'{ranBranch}-{shortCommit}'
else:
tagToUse = f'develop-{shortCommit}'
fullTag = f'{imageName}:{tagToUse}'
return fullTag
def CopyLogsToExecutor(cmd, sourcePath, log_name): def CopyLogsToExecutor(cmd, sourcePath, log_name):
cmd.cd(f'{sourcePath}/cmake_targets') cmd.cd(f'{sourcePath}/cmake_targets')
cmd.run(f'rm -f {log_name}.zip') cmd.run(f'rm -f {log_name}.zip')
...@@ -306,7 +316,6 @@ class Containerize(): ...@@ -306,7 +316,6 @@ class Containerize():
self.registrySvrId = '' self.registrySvrId = ''
self.testSvrId = '' self.testSvrId = ''
self.imageToPull = [] self.imageToPull = []
#checkers from xml #checkers from xml
self.ran_checkers={} self.ran_checkers={}
...@@ -383,7 +392,7 @@ class Containerize(): ...@@ -383,7 +392,7 @@ class Containerize():
CreateWorkspace(cmd, lSourcePath, self.ranRepository, self.ranCommitID, self.ranTargetBranch, self.ranAllowMerge) CreateWorkspace(cmd, lSourcePath, self.ranRepository, self.ranCommitID, self.ranTargetBranch, self.ranAllowMerge)
# if asterix, copy the entitlement and subscription manager configurations # if asterix, copy the entitlement and subscription manager configurations
if self.host == 'Red Hat': if self.host == 'Red Hat':
cmd.run('mkdir -p ./etc-pki-entitlement ./rhsm-conf ./rhsm-ca') cmd.run('mkdir -p ./etc-pki-entitlement ./rhsm-conf ./rhsm-ca')
cmd.run('cp /etc/rhsm/rhsm.conf ./rhsm-conf/') cmd.run('cp /etc/rhsm/rhsm.conf ./rhsm-conf/')
...@@ -649,15 +658,6 @@ class Containerize(): ...@@ -649,15 +658,6 @@ class Containerize():
HTML.CreateHtmlTestRow('commit ' + tag, 'OK', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow('commit ' + tag, 'OK', CONST.ALL_PROCESSES_OK)
HTML.CreateHtmlNextTabHeaderTestRow(collectInfo, allImagesSize) HTML.CreateHtmlNextTabHeaderTestRow(collectInfo, allImagesSize)
def ImageTagToUse(self, imageName):
shortCommit = self.ranCommitID[0:8]
if self.ranAllowMerge:
tagToUse = f'{self.ranBranch}-{shortCommit}'
else:
tagToUse = f'develop-{shortCommit}'
fullTag = f'porcepix.sboai.cs.eurecom.fr/{imageName}:{tagToUse}'
return fullTag
def Push_Image_to_Local_Registry(self, HTML): def Push_Image_to_Local_Registry(self, HTML):
if self.registrySvrId == '0': if self.registrySvrId == '0':
lIpAddr = self.eNBIPAddress lIpAddr = self.eNBIPAddress
...@@ -680,8 +680,8 @@ class Containerize(): ...@@ -680,8 +680,8 @@ class Containerize():
logging.debug('Pushing images from server: ' + lIpAddr) logging.debug('Pushing images from server: ' + lIpAddr)
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.open(lIpAddr, lUserName, lPassWord)
imagePrefix = 'porcepix.sboai.cs.eurecom.fr'
mySSH.command('docker login -u oaicicd -p oaicicd porcepix.sboai.cs.eurecom.fr', '\$', 5) mySSH.command(f'docker login -u oaicicd -p oaicicd {imagePrefix}', '\$', 5)
if re.search('Login Succeeded', mySSH.getBefore()) is None: if re.search('Login Succeeded', mySSH.getBefore()) is None:
msg = 'Could not log into local registry' msg = 'Could not log into local registry'
logging.error(msg) logging.error(msg)
...@@ -694,9 +694,9 @@ class Containerize(): ...@@ -694,9 +694,9 @@ class Containerize():
orgTag = 'ci-temp' orgTag = 'ci-temp'
imageNames = ['oai-enb', 'oai-gnb', 'oai-lte-ue', 'oai-nr-ue', 'oai-lte-ru', 'oai-nr-cuup'] imageNames = ['oai-enb', 'oai-gnb', 'oai-lte-ue', 'oai-nr-ue', 'oai-lte-ru', 'oai-nr-cuup']
for image in imageNames: for image in imageNames:
tagToUse = self.ImageTagToUse(image) tagToUse = ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge)
mySSH.command(f'docker image tag {image}:{orgTag} {tagToUse}', '\$', 5) mySSH.command(f'docker image tag {image}:{orgTag} {imagePrefix}/{tagToUse}', '\$', 5)
mySSH.command(f'docker push {tagToUse}', '\$', 120) mySSH.command(f'docker push {imagePrefix}/{tagToUse}', '\$', 120)
if re.search(': digest:', mySSH.getBefore()) is None: if re.search(': digest:', mySSH.getBefore()) is None:
logging.debug(mySSH.getBefore()) logging.debug(mySSH.getBefore())
msg = f'Could not push {image} to local registry : {tagToUse}' msg = f'Could not push {image} to local registry : {tagToUse}'
...@@ -704,9 +704,9 @@ class Containerize(): ...@@ -704,9 +704,9 @@ class Containerize():
mySSH.close() mySSH.close()
HTML.CreateHtmlTestRow(msg, 'KO', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow(msg, 'KO', CONST.ALL_PROCESSES_OK)
return False return False
mySSH.command(f'docker rmi {tagToUse} {image}:{orgTag}', '\$', 30) mySSH.command(f'docker rmi {imagePrefix}/{tagToUse} {image}:{orgTag}', '\$', 30)
mySSH.command('docker logout porcepix.sboai.cs.eurecom.fr', '\$', 5) mySSH.command(f'docker logout {imagePrefix}', '\$', 5)
if re.search('Removing login credentials', mySSH.getBefore()) is None: if re.search('Removing login credentials', mySSH.getBefore()) is None:
msg = 'Could not log off from local registry' msg = 'Could not log off from local registry'
logging.error(msg) logging.error(msg)
...@@ -739,25 +739,18 @@ class Containerize(): ...@@ -739,25 +739,18 @@ class Containerize():
if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '': if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '':
HELP.GenericHelp(CONST.Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
if lIpAddr != 'none': myCmd = cls_cmd.getConnection(lIpAddr)
logging.debug('Pulling images onto server: ' + lIpAddr) imagePrefix = 'porcepix.sboai.cs.eurecom.fr'
myCmd = cls_cmd.RemoteCmd(lIpAddr) response = myCmd.run(f'docker login -u oaicicd -p oaicicd {imagePrefix}')
else:
logging.debug('Pulling images locally')
myCmd = cls_cmd.LocalCmd()
cmd = 'docker login -u oaicicd -p oaicicd porcepix.sboai.cs.eurecom.fr'
response = myCmd.run(cmd)
if response.returncode != 0: if response.returncode != 0:
msg = 'Could not log into local registry' msg = 'Could not log into local registry'
logging.error(msg) logging.error(msg)
myCmd.close() myCmd.close()
HTML.CreateHtmlTestRow(msg, 'KO', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow(msg, 'KO', CONST.ALL_PROCESSES_OK)
return False return False
for image in self.imageToPull: for image in self.imageToPull:
tagToUse = self.ImageTagToUse(image) tagToUse = ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge)
cmd = f'docker pull {tagToUse}' cmd = f'docker pull {imagePrefix}/{tagToUse}'
response = myCmd.run(cmd, timeout=120) response = myCmd.run(cmd, timeout=120)
if response.returncode != 0: if response.returncode != 0:
logging.debug(response) logging.debug(response)
...@@ -766,16 +759,15 @@ class Containerize(): ...@@ -766,16 +759,15 @@ class Containerize():
myCmd.close() myCmd.close()
HTML.CreateHtmlTestRow('msg', 'KO', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow('msg', 'KO', CONST.ALL_PROCESSES_OK)
return False return False
myCmd.run(f'docker tag {imagePrefix}/{tagToUse} oai-ci/{tagToUse}')
cmd = 'docker logout porcepix.sboai.cs.eurecom.fr' myCmd.run(f'docker rmi {imagePrefix}/{tagToUse}')
response = myCmd.run(cmd) response = myCmd.run(f'docker logout {imagePrefix}')
if response.returncode != 0: if response.returncode != 0:
msg = 'Could not log off from local registry' msg = 'Could not log off from local registry'
logging.error(msg) logging.error(msg)
myCmd.close() myCmd.close()
HTML.CreateHtmlTestRow(msg, 'KO', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow(msg, 'KO', CONST.ALL_PROCESSES_OK)
return False return False
myCmd.close() myCmd.close()
HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
return True return True
...@@ -810,7 +802,8 @@ class Containerize(): ...@@ -810,7 +802,8 @@ class Containerize():
imageNames = ['oai-enb', 'oai-gnb', 'oai-lte-ue', 'oai-nr-ue', 'oai-lte-ru', 'oai-nr-cuup'] imageNames = ['oai-enb', 'oai-gnb', 'oai-lte-ue', 'oai-nr-ue', 'oai-lte-ru', 'oai-nr-cuup']
for image in imageNames: for image in imageNames:
cmd = f'docker rmi {self.ImageTagToUse(image)}' imageTag = ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge)
cmd = f'docker rmi oai-ci/{imageTag}'
myCmd.run(cmd, reportNonZero=False) myCmd.run(cmd, reportNonZero=False)
myCmd.close() myCmd.close()
...@@ -845,10 +838,10 @@ class Containerize(): ...@@ -845,10 +838,10 @@ class Containerize():
mySSH.command('cd ' + lSourcePath + '/' + self.yamlPath[self.eNB_instance], '\$', 5) mySSH.command('cd ' + lSourcePath + '/' + self.yamlPath[self.eNB_instance], '\$', 5)
mySSH.command('cp docker-compose.y*ml ci-docker-compose.yml', '\$', 5) mySSH.command('cp docker-compose.y*ml ci-docker-compose.yml', '\$', 5)
imagesList = ['oai-enb', 'oai-gnb', 'oai-nr-cuup'] imagesList = ['oai-enb', 'oai-gnb', 'oai-nr-cuup', 'oai-gnb-aw2s']
for image in imagesList: for image in imagesList:
imageToUse = self.ImageTagToUse(image) imageTag = ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge)
mySSH.command(f'sed -i -e "s#image: {image}:latest#image: {imageToUse}#" ci-docker-compose.yml', '\$', 2) mySSH.command(f'sed -i -e "s#image: {image}:latest#image: oai-ci/{imageTag}#" ci-docker-compose.yml', '\$', 2)
localMmeIpAddr = EPC.MmeIPAddress localMmeIpAddr = EPC.MmeIPAddress
mySSH.command('sed -i -e "s/CI_MME_IP_ADDR/' + localMmeIpAddr + '/" ci-docker-compose.yml', '\$', 2) mySSH.command('sed -i -e "s/CI_MME_IP_ADDR/' + localMmeIpAddr + '/" ci-docker-compose.yml', '\$', 2)
...@@ -966,6 +959,7 @@ class Containerize(): ...@@ -966,6 +959,7 @@ class Containerize():
logging.debug('\u001B[1m Undeploying OAI Object from server: ' + lIpAddr + '\u001B[0m') logging.debug('\u001B[1m Undeploying OAI Object from server: ' + lIpAddr + '\u001B[0m')
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.open(lIpAddr, lUserName, lPassWord)
mySSH.command('cd ' + lSourcePath + '/' + self.yamlPath[self.eNB_instance], '\$', 5) mySSH.command('cd ' + lSourcePath + '/' + self.yamlPath[self.eNB_instance], '\$', 5)
svcName = self.services[self.eNB_instance] svcName = self.services[self.eNB_instance]
...@@ -981,7 +975,7 @@ class Containerize(): ...@@ -981,7 +975,7 @@ class Containerize():
for s in allServices: for s in allServices:
mySSH.command(f'docker-compose -f ci-docker-compose.yml ps --all -- {s}', '\$', 5, silent=False) mySSH.command(f'docker-compose -f ci-docker-compose.yml ps --all -- {s}', '\$', 5, silent=False)
running = mySSH.getBefore().split('\r\n')[2:-1] running = mySSH.getBefore().split('\r\n')[2:-1]
#logging.debug(f'running services: {running}') logging.debug(f'running services: {running}')
if len(running) > 0: # something is running for that service if len(running) > 0: # something is running for that service
services.append(s) services.append(s)
logging.info(f'stopping services {services}') logging.info(f'stopping services {services}')
...@@ -1050,13 +1044,12 @@ class Containerize(): ...@@ -1050,13 +1044,12 @@ class Containerize():
myCmd.close() myCmd.close()
HTML.CreateHtmlTestRow('SVC not Found', 'KO', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow('SVC not Found', 'KO', CONST.ALL_PROCESSES_OK)
return return
cmd = 'cp docker-compose.y*ml docker-compose-ci.yml' cmd = 'cp docker-compose.y*ml docker-compose-ci.yml'
myCmd.run(cmd, silent=self.displayedNewTags) myCmd.run(cmd, silent=self.displayedNewTags)
imageNames = ['oai-enb', 'oai-gnb', 'oai-lte-ue', 'oai-nr-ue', 'oai-lte-ru', 'oai-nr-cuup'] imageNames = ['oai-enb', 'oai-gnb', 'oai-lte-ue', 'oai-nr-ue', 'oai-lte-ru', 'oai-nr-cuup']
for image in imageNames: for image in imageNames:
tagToUse = self.ImageTagToUse(image) tagToUse = ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge)
cmd = f'sed -i -e "s@oaisoftwarealliance/{image}:develop@{tagToUse}@" docker-compose-ci.yml' cmd = f'sed -i -e "s@oaisoftwarealliance/{image}:develop@oai-ci/{tagToUse}@" docker-compose-ci.yml'
myCmd.run(cmd, silent=self.displayedNewTags) myCmd.run(cmd, silent=self.displayedNewTags)
self.displayedNewTags = True self.displayedNewTags = True
...@@ -1193,13 +1186,12 @@ class Containerize(): ...@@ -1193,13 +1186,12 @@ class Containerize():
ymlPath = self.yamlPath[0].split('/') ymlPath = self.yamlPath[0].split('/')
logPath = '../cmake_targets/log/' + ymlPath[1] logPath = '../cmake_targets/log/' + ymlPath[1]
myCmd = cls_cmd.LocalCmd(d = self.yamlPath[0]) myCmd = cls_cmd.LocalCmd(d = self.yamlPath[0])
cmd = 'cp docker-compose.y*ml docker-compose-ci.yml' cmd = 'cp docker-compose.y*ml docker-compose-ci.yml'
myCmd.run(cmd, silent=self.displayedNewTags) myCmd.run(cmd, silent=self.displayedNewTags)
imageNames = ['oai-enb', 'oai-gnb', 'oai-lte-ue', 'oai-nr-ue', 'oai-lte-ru', 'oai-nr-cuup'] imageNames = ['oai-enb', 'oai-gnb', 'oai-lte-ue', 'oai-nr-ue', 'oai-lte-ru', 'oai-nr-cuup']
for image in imageNames: for image in imageNames:
tagToUse = self.ImageTagToUse(image) tagToUse = ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge)
cmd = f'sed -i -e "s@oaisoftwarealliance/{image}:develop@{tagToUse}@" docker-compose-ci.yml' cmd = f'sed -i -e "s@oaisoftwarealliance/{image}:develop@oai-ci/{tagToUse}@" docker-compose-ci.yml'
myCmd.run(cmd, silent=self.displayedNewTags) myCmd.run(cmd, silent=self.displayedNewTags)
self.displayedNewTags = True self.displayedNewTags = True
......
...@@ -605,6 +605,8 @@ class OaiCiTest(): ...@@ -605,6 +605,8 @@ class OaiCiTest():
Target = EPC.MmeIPAddress Target = EPC.MmeIPAddress
elif re.match('OAICN5G', EPC.Type, re.IGNORECASE): elif re.match('OAICN5G', EPC.Type, re.IGNORECASE):
Target = EPC.MmeIPAddress Target = EPC.MmeIPAddress
elif re.match('OC-OAI-CN5G', EPC.Type, re.IGNORECASE):
Target = "172.21.6.100"
else: else:
Target = EPC.IPAddress Target = EPC.IPAddress
#ping from module NIC rather than IP address to make sure round trip is over the air #ping from module NIC rather than IP address to make sure round trip is over the air
......
...@@ -114,7 +114,7 @@ class PhySim: ...@@ -114,7 +114,7 @@ class PhySim:
logging.debug('Merging with the target branch: ' + self.ranTargetBranch) logging.debug('Merging with the target branch: ' + self.ranTargetBranch)
mySSH.command('git merge --ff origin/' + self.ranTargetBranch + ' -m "Temporary merge for CI"', '\$', 30) mySSH.command('git merge --ff origin/' + self.ranTargetBranch + ' -m "Temporary merge for CI"', '\$', 30)
else: else:
imageTag = "develop" imageTag = f'develop-{self.ranCommitID[0:8]}'
# logging to OC Cluster and then switch to corresponding project # logging to OC Cluster and then switch to corresponding project
mySSH.command(f'oc login -u {ocUserName} -p {ocPassword} --server https://api.oai.cs.eurecom.fr:6443', '\$', 30) mySSH.command(f'oc login -u {ocUserName} -p {ocPassword} --server https://api.oai.cs.eurecom.fr:6443', '\$', 30)
......
This diff is collapsed.
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
#----------------------------------------------------------- #-----------------------------------------------------------
# Import # Import
#----------------------------------------------------------- #-----------------------------------------------------------
import sys # arg import sys # arg
import re # reg import re # reg
import logging import logging
import os import os
import time import time
...@@ -46,10 +46,13 @@ from multiprocessing import Process, Lock, SimpleQueue ...@@ -46,10 +46,13 @@ from multiprocessing import Process, Lock, SimpleQueue
import sshconnection as SSH import sshconnection as SSH
import helpreadme as HELP import helpreadme as HELP
import constants as CONST import constants as CONST
import cls_cluster as OC
import cls_cmd
#----------------------------------------------------------- #-----------------------------------------------------------
# Class Declaration # Class Declaration
#----------------------------------------------------------- #-----------------------------------------------------------
class EPCManagement(): class EPCManagement():
def __init__(self): def __init__(self):
...@@ -68,7 +71,13 @@ class EPCManagement(): ...@@ -68,7 +71,13 @@ class EPCManagement():
self.isMagmaUsed = False self.isMagmaUsed = False
self.cfgDeploy = '--type start-mini --scenario 1 --capture /tmp/oai-cn5g-v1.5.pcap' #from xml, 'mini' is default normal for docker-network.py self.cfgDeploy = '--type start-mini --scenario 1 --capture /tmp/oai-cn5g-v1.5.pcap' #from xml, 'mini' is default normal for docker-network.py
self.cfgUnDeploy = '--type stop-mini --scenario 1' #from xml, 'mini' is default normal for docker-network.py self.cfgUnDeploy = '--type stop-mini --scenario 1' #from xml, 'mini' is default normal for docker-network.py
self.OCUrl = "https://api.oai.cs.eurecom.fr:6443"
self.OCRegistry = "default-route-openshift-image-registry.apps.oai.cs.eurecom.fr/"
self.OCUserName = ''
self.OCPassword = ''
self.OCProjectName = ''
self.imageToPull = ''
self.eNBSourceCodePath = ''
#----------------------------------------------------------- #-----------------------------------------------------------
# EPC management functions # EPC management functions
...@@ -235,8 +244,7 @@ class EPCManagement(): ...@@ -235,8 +244,7 @@ class EPCManagement():
HELP.GenericHelp(CONST.Version) HELP.GenericHelp(CONST.Version)
HELP.EPCSrvHelp(self.IPAddress, self.UserName, self.Password, self.SourceCodePath, self.Type) HELP.EPCSrvHelp(self.IPAddress, self.UserName, self.Password, self.SourceCodePath, self.Type)
sys.exit('Insufficient EPC Parameters') sys.exit('Insufficient EPC Parameters')
mySSH = SSH.SSHConnection() mySSH = cls_cmd.getConnection(self.IPAddress)
mySSH.open(self.IPAddress, self.UserName, self.Password)
html_cell = '' html_cell = ''
if re.match('ltebox', self.Type, re.IGNORECASE): if re.match('ltebox', self.Type, re.IGNORECASE):
logging.debug('Using the SABOX simulated HSS') logging.debug('Using the SABOX simulated HSS')
...@@ -286,6 +294,40 @@ class EPCManagement(): ...@@ -286,6 +294,40 @@ class EPCManagement():
if res4 is not None: if res4 is not None:
html_cell += '(' + res4.group('date') + ')' html_cell += '(' + res4.group('date') + ')'
html_cell += '\n' html_cell += '\n'
elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE):
self.testCase_id = HTML.testCase_id
imageNames = ["oai-nrf", "oai-amf", "oai-smf", "oai-spgwu-tiny", "oai-ausf", "oai-udm", "oai-udr", "mysql","oai-traffic-server"]
logging.debug('Deploying OAI CN5G on Openshift Cluster')
lIpAddr = self.IPAddress
lSourcePath = self.SourceCodePath
succeeded = OC.OC_login(mySSH, self.OCUserName, self.OCPassword, self.OCProjectName)
if not succeeded:
logging.error('\u001B[1m OC Cluster Login Failed\u001B[0m')
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_LOGIN_FAIL)
return False
for ii in imageNames:
mySSH.run(f'helm uninstall {ii}', reportNonZero=False)
mySSH.run(f'helm spray {lSourcePath}/ci-scripts/charts/oai-5g-basic/.')
ret = mySSH.run(f'oc get pods', silent=True)
if ret.stdout.count('Running') != 9:
logging.error('\u001B[1m Deploying 5GCN Failed using helm chart on OC Cluster\u001B[0m')
for ii in imageNames:
mySSH.run('helm uninstall '+ ii)
ret = mySSH.run(f'oc get pods')
if re.search('No resources found', ret.stdout):
logging.debug('All pods uninstalled')
OC.OC_logout(mySSH)
mySSH.close()
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_PROJECT_FAIL)
return False
ret = mySSH.run(f'oc get pods', silent=True)
for line in ret.stdout.split('\n')[1:]:
columns = line.strip().split()
name = columns[0]
status = columns[2]
html_cell += status + ' ' + name
html_cell += '\n'
OC.OC_logout(mySSH)
else: else:
logging.error('This option should not occur!') logging.error('This option should not occur!')
mySSH.close() mySSH.close()
...@@ -311,6 +353,10 @@ class EPCManagement(): ...@@ -311,6 +353,10 @@ class EPCManagement():
else: else:
logging.error('no container with name oai-amf found, could not retrieve AMF IP address') logging.error('no container with name oai-amf found, could not retrieve AMF IP address')
mySSH.close() mySSH.close()
elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE):
mySSH = SSH.SSHConnection()
mySSH.open(self.IPAddress, self.UserName, self.Password)
response=mySSH.command3('oc pods ls -f name=oai-amf', 10)
def CheckHSSProcess(self, status_queue): def CheckHSSProcess(self, status_queue):
try: try:
...@@ -513,8 +559,9 @@ class EPCManagement(): ...@@ -513,8 +559,9 @@ class EPCManagement():
HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
def Terminate5GCN(self, HTML): def Terminate5GCN(self, HTML):
mySSH = SSH.SSHConnection() imageNames = ["mysql", "oai-nrf", "oai-amf", "oai-smf", "oai-spgwu-tiny", "oai-ausf", "oai-udm", "oai-udr", "oai-traffic-server"]
mySSH.open(self.IPAddress, self.UserName, self.Password) containerInPods = ["", "-c nrf", "-c amf", "-c smf", "-c spgwu", "-c ausf", "-c udm", "-c udr", ""]
mySSH = cls_cmd.getConnection(self.IPAddress)
message = '' message = ''
if re.match('ltebox', self.Type, re.IGNORECASE): if re.match('ltebox', self.Type, re.IGNORECASE):
logging.debug('Terminating SA BOX') logging.debug('Terminating SA BOX')
...@@ -545,6 +592,37 @@ class EPCManagement(): ...@@ -545,6 +592,37 @@ class EPCManagement():
else: else:
message = 'No Tracking area update request' message = 'No Tracking area update request'
logging.debug(message) logging.debug(message)
elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE):
logging.debug('Terminating OAI CN5G on Openshift Cluster')
lIpAddr = self.IPAddress
lSourcePath = self.SourceCodePath
mySSH.run(f'rm -Rf {lSourcePath}/logs')
mySSH.run(f'mkdir -p {lSourcePath}/logs')
logging.debug('OC OAI CN5G - Collecting Log files to workspace')
succeeded = OC.OC_login(mySSH, self.OCUserName, self.OCPassword, self.OCProjectName)
if not succeeded:
logging.error('\u001B[1m OC Cluster Login Failed\u001B[0m')
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_LOGIN_FAIL)
return False
mySSH.run(f'oc describe pod &> {lSourcePath}/logs/describe-pods-post-test.log')
mySSH.run(f'oc get pods.metrics.k8s &> {lSourcePath}/logs/nf-resource-consumption.log')
for ii, ci in zip(imageNames, containerInPods):
podName = mySSH.run(f"oc get pods | grep {ii} | awk \'{{print $1}}\'").stdout.strip()
if not podName:
logging.debug(f'{ii} pod not found!')
HTML.CreateHtmlTestRow(self.Type, 'KO', CONST.INVALID_PARAMETER)
HTML.CreateHtmlTabFooter(False)
mySSH.run(f'oc logs -f {podName} {ci} &> {lSourcePath}/logs/{ii}.log &')
mySSH.run(f'helm uninstall {ii}')
podName = ''
mySSH.run(f'cd {lSourcePath}/logs && zip -r -qq test_logs_CN.zip *.log')
mySSH.copyin(f'{lSourcePath}/logs/test_logs_CN.zip','test_logs_CN.zip')
ret = mySSH.run(f'oc get pods', silent=True)
res = re.search('No resources found in oaicicd-ran namespace.', ret.stdout)
if res is not None:
logging.debug('OC OAI CN5G components uninstalled')
message = 'OC OAI CN5G components uninstalled'
OC.OC_logout(mySSH)
else: else:
logging.error('This should not happen!') logging.error('This should not happen!')
mySSH.close() mySSH.close()
...@@ -784,6 +862,8 @@ class EPCManagement(): ...@@ -784,6 +862,8 @@ class EPCManagement():
mySSH.command('zip hss.log.zip hss_check_run.*', '\$', 60) mySSH.command('zip hss.log.zip hss_check_run.*', '\$', 60)
elif re.match('OAICN5G', self.Type, re.IGNORECASE): elif re.match('OAICN5G', self.Type, re.IGNORECASE):
logging.debug('LogCollect is bypassed for that variant') logging.debug('LogCollect is bypassed for that variant')
elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE):
logging.debug('LogCollect is bypassed for that variant')
elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE):
mySSH.command('zip hss.log.zip hss*.log', '\$', 60) mySSH.command('zip hss.log.zip hss*.log', '\$', 60)
mySSH.command('echo ' + self.Password + ' | sudo -S rm hss*.log', '\$', 5) mySSH.command('echo ' + self.Password + ' | sudo -S rm hss*.log', '\$', 5)
...@@ -798,10 +878,13 @@ class EPCManagement(): ...@@ -798,10 +878,13 @@ class EPCManagement():
mySSH.close() mySSH.close()
def LogCollectMME(self): def LogCollectMME(self):
mySSH = SSH.SSHConnection() if self.Type != 'OC-OAI-CN5G':
mySSH.open(self.IPAddress, self.UserName, self.Password) mySSH = SSH.SSHConnection()
mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) mySSH.open(self.IPAddress, self.UserName, self.Password)
mySSH.command('rm -f mme.log.zip', '\$', 5) mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5)
mySSH.command('rm -f mme.log.zip', '\$', 5)
else:
mySSH = cls_cmd.getConnection(self.IPAddress)
if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE):
mySSH.command('docker inspect prod-oai-mme', '\$', 10) mySSH.command('docker inspect prod-oai-mme', '\$', 10)
result = re.search('No such object', mySSH.getBefore()) result = re.search('No such object', mySSH.getBefore())
...@@ -819,6 +902,10 @@ class EPCManagement(): ...@@ -819,6 +902,10 @@ class EPCManagement():
mySSH.command('cp -f /tmp/oai-cn5g-v1.5.pcap .','\$', 30) mySSH.command('cp -f /tmp/oai-cn5g-v1.5.pcap .','\$', 30)
mySSH.command('zip mme.log.zip oai-amf.log oai-nrf.log oai-cn5g*.pcap','\$', 30) mySSH.command('zip mme.log.zip oai-amf.log oai-nrf.log oai-cn5g*.pcap','\$', 30)
mySSH.command('mv mme.log.zip ' + self.SourceCodePath + '/scripts','\$', 30) mySSH.command('mv mme.log.zip ' + self.SourceCodePath + '/scripts','\$', 30)
elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE):
mySSH.run('cd ' + self.SourceCodePath + '/logs')
mySSH.run('zip mme.log.zip oai-amf.log oai-nrf.log oai-cn5g*.pcap')
mySSH.run('mv mme.log.zip ' + self.SourceCodePath + '/scripts')
elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE):
mySSH.command('zip mme.log.zip mme*.log', '\$', 60) mySSH.command('zip mme.log.zip mme*.log', '\$', 60)
mySSH.command('echo ' + self.Password + ' | sudo -S rm mme*.log', '\$', 5) mySSH.command('echo ' + self.Password + ' | sudo -S rm mme*.log', '\$', 5)
...@@ -852,6 +939,10 @@ class EPCManagement(): ...@@ -852,6 +939,10 @@ class EPCManagement():
mySSH.command('cd ' + self.SourceCodePath + '/logs','\$', 5) mySSH.command('cd ' + self.SourceCodePath + '/logs','\$', 5)
mySSH.command('zip spgw.log.zip oai-smf.log oai-spgwu.log','\$', 30) mySSH.command('zip spgw.log.zip oai-smf.log oai-spgwu.log','\$', 30)
mySSH.command('mv spgw.log.zip ' + self.SourceCodePath + '/scripts','\$', 30) mySSH.command('mv spgw.log.zip ' + self.SourceCodePath + '/scripts','\$', 30)
elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE):
mySSH.command('cd ' + self.SourceCodePath + '/logs','\$', 5)
mySSH.command('zip spgw.log.zip oai-smf.log oai-spgwu.log','\$', 30)
mySSH.command('mv spgw.log.zip ' + self.SourceCodePath + '/scripts','\$', 30)
elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE):
mySSH.command('zip spgw.log.zip spgw*.log', '\$', 60) mySSH.command('zip spgw.log.zip spgw*.log', '\$', 60)
mySSH.command('echo ' + self.Password + ' | sudo -S rm spgw*.log', '\$', 5) mySSH.command('echo ' + self.Password + ' | sudo -S rm spgw*.log', '\$', 5)
......
...@@ -38,12 +38,12 @@ import helpreadme as HELP ...@@ -38,12 +38,12 @@ import helpreadme as HELP
import constants as CONST import constants as CONST
import cls_oaicitest #main class for OAI CI test framework import cls_oaicitest #main class for OAI CI test framework
import cls_physim #class PhySim for physical simulators build and test import cls_physim #class PhySim for physical simulators build and test
import cls_containerize #class Containerize for all container-based operations on RAN/UE objects 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_static_code_analysis #class for static code analysis
import cls_physim1 #class PhySim for physical simulators deploy and run import cls_physim1 #class PhySim for physical simulators deploy and run
import cls_cluster # class for building/deploying on cluster import cls_cluster # class for building/deploying on cluster
import sshconnection import sshconnection
import epc import epc
...@@ -430,7 +430,11 @@ def GetParametersFromXML(action): ...@@ -430,7 +430,11 @@ def GetParametersFromXML(action):
RAN.node = test.findtext('node') RAN.node = test.findtext('node')
RAN.command = test.findtext('command') RAN.command = test.findtext('command')
RAN.command_fail = test.findtext('command_fail') in ['True', 'true', 'Yes', 'yes'] RAN.command_fail = test.findtext('command_fail') in ['True', 'true', 'Yes', 'yes']
elif action == 'Pull_Cluster_Image':
# CLUSTER.imageToPull.clear()
string_field = test.findtext('images_to_pull')
if (string_field is not None):
CLUSTER.imageToPull = string_field.split()
else: else:
logging.warning(f"unknown action {action} from option-parsing point-of-view") logging.warning(f"unknown action {action} from option-parsing point-of-view")
...@@ -829,6 +833,9 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re ...@@ -829,6 +833,9 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
HTML=ldpc.Run_NRulsimTest(HTML,CONST,id) HTML=ldpc.Run_NRulsimTest(HTML,CONST,id)
if ldpc.exitStatus==1: if ldpc.exitStatus==1:
RAN.prematureExit = True RAN.prematureExit = True
elif action == 'Pull_Cluster_Image':
if not CLUSTER.PullClusterImage(HTML,RAN):
RAN.prematureExit = True
elif action == 'Build_Cluster_Image': elif action == 'Build_Cluster_Image':
if not CLUSTER.BuildClusterImage(HTML): if not CLUSTER.BuildClusterImage(HTML):
RAN.prematureExit = True RAN.prematureExit = True
......
- Build_Proxy - Build_Proxy
- Build_Cluster_Image - Build_Cluster_Image
- Pull_Cluster_Image
- Build_PhySim - Build_PhySim
- Run_LDPCTest - Run_LDPCTest
- Run_LDPCt1Test - Run_LDPCt1Test
......
<!--
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
-->
<testCaseList>
<htmlTabRef>TEST-5G-AW2S</htmlTabRef>
<htmlTabName>20 MHz TDD SA</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>1</repeatCount>
<TestCaseRequestedList>
010000
001000
020000
002000
002002
000100
000200
003000
004000
000002
030000
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="010000">
<class>Pull_Cluster_Image</class>
<desc>Pull Images from Cluster</desc>
<images_to_pull>oai-gnb-aw2s</images_to_pull>
</testCase>
<testCase id="020000">
<class>Deploy_Object</class>
<desc>Deploy gNB (TDD/Band78/20MHz/aw2s) in a container</desc>
<yaml_path>ci-scripts/yaml_files/sa_aw2s_gnb</yaml_path>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
</testCase>
<testCase id="001000">
<class>Initialize_UE</class>
<desc>Initialize Amarisoft UE</desc>
<id>amarisoft_ue</id>
</testCase>
<testCase id="002000">
<class>Attach_UE</class>
<desc>Attach UE</desc>
<id>amarisoft_ue_1</id>
</testCase>
<testCase id="002002">
<class>Attach_UE</class>
<desc>Attach UE</desc>
<id>amarisoft_ue_2</id>
</testCase>
<testCase id="000100">
<class>Ping</class>
<desc>Ping: 20pings in 20sec</desc>
<id>amarisoft_ue_1 amarisoft_ue_2</id>
<ping_args>-c 20</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>15</ping_rttavg_threshold>
</testCase>
<testCase id="000200">
<class>Ping</class>
<desc>Ping: 100pings in 20sec</desc>
<id>amarisoft_ue_1 amarisoft_ue_2</id>
<ping_args>-c 100 -i 0.2</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>15</ping_rttavg_threshold>
</testCase>
<testCase id="003000">
<class>Detach_UE</class>
<desc>Detach UE</desc>
<id>amarisoft_ue_1 amarisoft_ue_2</id>
</testCase>
<testCase id="004000">
<class>Terminate_UE</class>
<desc>Terminate UE</desc>
<id>amarisoft_ue</id>
</testCase>
<testCase id="000002">
<class>IdleSleep</class>
<desc>Sleep</desc>
<idle_sleep_time_in_sec>5</idle_sleep_time_in_sec>
</testCase>
<testCase id="030000">
<class>Undeploy_Object</class>
<desc>Undeploy gNB</desc>
<yaml_path>ci-scripts/yaml_files/sa_aw2s_gnb</yaml_path>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
<d_retx_th>20,100,100,100</d_retx_th>
<u_retx_th>20,100,100,100</u_retx_th>
</testCase>
</testCaseList>
version: '3.8'
services:
oai-gnb:
image: oai-gnb-aw2s:latest
privileged: true
network_mode: "host"
container_name: oai-gnb-aw2s
environment:
TZ: Europe/Paris
USE_VOLUMED_CONF: 'yes'
USE_ADDITIONAL_OPTIONS: --sa
volumes:
- ../../conf_files/gnb.sa.band78.51prb.aw2s.ddsuu.conf:/opt/oai-gnb-aw2s/etc/mounted.conf
healthcheck:
test: /bin/bash -c "pgrep nr-softmodem"
interval: 10s
timeout: 5s
retries: 5
...@@ -289,11 +289,13 @@ ...@@ -289,11 +289,13 @@
(Test10: Format 2 9-bit 2/106 PRB), (Test10: Format 2 9-bit 2/106 PRB),
(Test11: Format 2 10-bit 2/106 PRB), (Test11: Format 2 10-bit 2/106 PRB),
(Test12: Format 2 11-bit 2/106 PRB), (Test12: Format 2 11-bit 2/106 PRB),
(Test13: Format 2 12-bit 8/106 PRB), (Test13: Format 2 12-bit 4/106 PRB),
(Test14: Format 2 19-bit 8/106 PRB), (Test14: Format 2 19-bit 4/106 PRB),
(Test15: Format 2 32-bit 8/106 PRB), (Test15: Format 2 12-bit 8/106 PRB),
(Test16: Format 2 32-bit 16/106 PRB), (Test16: Format 2 19-bit 8/106 PRB),
(Test17: Format 2 64-bit 16/106 PRB)</desc> (Test17: Format 2 32-bit 8/106 PRB),
(Test18: Format 2 32-bit 16/106 PRB),
(Test19: Format 2 64-bit 16/106 PRB)</desc>
<main_exec>nr_pucchsim</main_exec> <main_exec>nr_pucchsim</main_exec>
<main_exec_args>-R 106 -i 1 -P 0 -b 1 -s-2 -n1000 <main_exec_args>-R 106 -i 1 -P 0 -b 1 -s-2 -n1000
-R 106 -i 1 -P 0 -b 2 -s-2 -n1000 -R 106 -i 1 -P 0 -b 2 -s-2 -n1000
...@@ -307,12 +309,14 @@ ...@@ -307,12 +309,14 @@
-R 106 -i 1 -P 2 -b 9 -s5 -n1000 -R 106 -i 1 -P 2 -b 9 -s5 -n1000
-R 106 -i 1 -P 2 -b 10 -s6 -n1000 -R 106 -i 1 -P 2 -b 10 -s6 -n1000
-R 106 -i 1 -P 2 -b 11 -s6 -n1000 -R 106 -i 1 -P 2 -b 11 -s6 -n1000
-R 106 -i 1 -P 2 -q4 -b 12 -s-3 -n1000
-R 106 -i 1 -P 2 -q4 -b 19 -s-3 -n1000
-R 106 -i 1 -P 2 -q8 -b 12 -s-3 -n1000 -R 106 -i 1 -P 2 -q8 -b 12 -s-3 -n1000
-R 106 -i 1 -P 2 -q8 -b 19 -s-3 -n1000 -R 106 -i 1 -P 2 -q8 -b 19 -s-3 -n1000
-R 106 -i 1 -P 2 -q8 -b 32 -s-3 -n1000 -R 106 -i 1 -P 2 -q8 -b 32 -s-3 -n1000
-R 106 -i 1 -P 2 -q16 -b 32 -s-3 -n1000 -R 106 -i 1 -P 2 -q16 -b 32 -s-3 -n1000
-R 106 -i 1 -P 2 -q16 -b 64 -s-3 -n1000</main_exec_args> -R 106 -i 1 -P 2 -q16 -b 64 -s-3 -n1000</main_exec_args>
<tags>test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 test12 test13 test14 test15 test16 test17</tags> <tags>test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 test12 test13 test14 test15 test16 test17 test18 test19</tags>
<search_expr_true>PUCCH test OK</search_expr_true> <search_expr_true>PUCCH test OK</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false> <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
<nruns>3</nruns> <nruns>3</nruns>
...@@ -351,22 +355,24 @@ ...@@ -351,22 +355,24 @@
</testCase> </testCase>
<testCase id="nr_ulsim.misc"> <testCase id="nr_ulsim.misc">
<desc>nr_ulsim Test cases. (Test1: MCS 9, 106 PRBs), <desc>nr_ulsim Test cases. (Test1: MCS 9 106 PRBs),
(Test2: MCS 16, 50 PRBs), (Test2: MCS 16 50 PRBs),
(Test3: MCS 28, 50 PRBs), (Test3: MCS 28 50 PRBs),
(Test4: MCS 9, 217 PRBs), (Test4: MCS 27 50 PRBs 256QAM),
(Test5: MCS 9, 273 PRBs), (Test5: MCS 9 217 PRBs),
(Test6: PUSCH Type A, 2 DMRS Symbols), (Test6: MCS 9 273 PRBs),
(Test7: PUSCH Type A, 3 DMRS, 4 PTRS, 5 Interpolated Symbols), (Test7: PUSCH Type A, 2 DMRS Symbols),
(Test8: PUSCH Type B, 3 DMRS, 2 PTRS, 7 Interpolated Symbols), (Test8: PUSCH Type A, 3 DMRS, 4 PTRS, 5 Interpolated Symbols),
(Test9: PUSCH Type B, 3 DMRS, 2 PTRS, 3 Interpolated Symbols), (Test9: PUSCH Type B, 3 DMRS, 2 PTRS, 7 Interpolated Symbols),
(Test10: 25 PRBs, 15 kHz SCS), (Test10: PUSCH Type B, 3 DMRS, 2 PTRS, 3 Interpolated Symbols),
(Test11: MCS 0, low SNR performance) (Test11: 25 PRBs, 15 kHz SCS),
(Test12: MCS 28, 106 PRBs, Time shift 8)</desc> (Test12: MCS 0, low SNR performance)
(Test13: MCS 28, 106 PRBs, Time shift 8)</desc>
<main_exec>nr_ulsim</main_exec> <main_exec>nr_ulsim</main_exec>
<main_exec_args>-n100 -m9 -r106 -s5 <main_exec_args>-n100 -m9 -r106 -s5
-n100 -m16 -s10 -n100 -m16 -s10
-n100 -m28 -s20 -n100 -m28 -s20
-n100 -m27 -s25 -q1
-n100 -m9 -R217 -r217 -s5 -n100 -m9 -R217 -r217 -s5
-n100 -m9 -R273 -r273 -s5 -n100 -m9 -R273 -r273 -s5
-n100 -s5 -U 0,1,1,1 -n100 -s5 -U 0,1,1,1
...@@ -376,7 +382,7 @@ ...@@ -376,7 +382,7 @@
-n100 -u0 -m0 -R25 -r25 -i 1,0 -n100 -u0 -m0 -R25 -r25 -i 1,0
-n100 -m0 -S -0.6 -i 1,0 -n100 -m0 -S -0.6 -i 1,0
-n100 -m 28 -R106 -r106 -t90 -s24 -S24 -d 8</main_exec_args> -n100 -m 28 -R106 -r106 -t90 -s24 -S24 -d 8</main_exec_args>
<tags>test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 test12</tags> <tags>test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 test12 test13</tags>
<search_expr_true>PUSCH test OK</search_expr_true> <search_expr_true>PUSCH test OK</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false> <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
<nruns>3</nruns> <nruns>3</nruns>
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
#define RLC_TX_MAXSIZE 10000000 #define RLC_TX_MAXSIZE 10000000
#define RLC_RX_MAXSIZE 10000000 #define RLC_RX_MAXSIZE 10000000
#define SEND_MRW_ON 240 #define SEND_MRW_ON 240
#define MAX_ANT 8
// CBA constant // CBA constant
#define NUM_MAX_CBA_GROUP 4 #define NUM_MAX_CBA_GROUP 4
......
...@@ -49,8 +49,8 @@ int get_supported_band_index(int scs, int band, int n_rbs) ...@@ -49,8 +49,8 @@ int get_supported_band_index(int scs, int band, int n_rbs)
int scs_index = scs; int scs_index = scs;
if (band > 256) if (band > 256)
scs_index++; scs_index++;
for (int i = 0; i < 11; i++) { for (int i = 0; i < 12; i++) {
if(n_rbs == tables_5_3_2[scs][i]) if(n_rbs == tables_5_3_2[scs_index][i])
return i; return i;
} }
return (-1); // not found return (-1); // not found
...@@ -130,34 +130,34 @@ const nr_bandentry_t nr_bandtable[] = { ...@@ -130,34 +130,34 @@ const nr_bandentry_t nr_bandtable[] = {
{261,27500040,28350000,27500040,28350000, 2,2070833, 120} {261,27500040,28350000,27500040,28350000, 2,2070833, 120}
}; };
int get_supported_bw_khz(frequency_range_t frequency_range, int bw_index) int get_supported_bw_mhz(frequency_range_t frequency_range, int bw_index)
{ {
if (frequency_range == FR1) { if (frequency_range == FR1) {
switch (bw_index) { switch (bw_index) {
case 0 : case 0 :
return 5000; // 5MHz return 5; // 5MHz
case 1 : case 1 :
return 10000; return 10;
case 2 : case 2 :
return 15000; return 15;
case 3 : case 3 :
return 20000; return 20;
case 4 : case 4 :
return 25000; return 25;
case 5 : case 5 :
return 30000; return 30;
case 6 : case 6 :
return 40000; return 40;
case 7 : case 7 :
return 50000; return 50;
case 8 : case 8 :
return 60000; return 60;
case 9 : case 9 :
return 80000; return 80;
case 10 : case 10 :
return 90000; return 90;
case 11 : case 11 :
return 100000; return 100;
default : default :
AssertFatal(false, "Invalid band index for FR1 %d\n", bw_index); AssertFatal(false, "Invalid band index for FR1 %d\n", bw_index);
} }
...@@ -165,13 +165,13 @@ int get_supported_bw_khz(frequency_range_t frequency_range, int bw_index) ...@@ -165,13 +165,13 @@ int get_supported_bw_khz(frequency_range_t frequency_range, int bw_index)
else { else {
switch (bw_index) { switch (bw_index) {
case 0 : case 0 :
return 50000; // 50MHz return 50; // 50MHz
case 1 : case 1 :
return 100000; return 100;
case 2 : case 2 :
return 200000; return 200;
case 3 : case 3 :
return 400000; return 400;
default : default :
AssertFatal(false, "Invalid band index for FR2 %d\n", bw_index); AssertFatal(false, "Invalid band index for FR2 %d\n", bw_index);
} }
...@@ -184,7 +184,7 @@ bool compare_relative_ul_channel_bw(int nr_band, int scs, int nb_ul, frame_type_ ...@@ -184,7 +184,7 @@ bool compare_relative_ul_channel_bw(int nr_band, int scs, int nb_ul, frame_type_
// Relative channel bandwidth <= 4% for TDD bands and <= 3% for FDD bands // Relative channel bandwidth <= 4% for TDD bands and <= 3% for FDD bands
int index = get_nr_table_idx(nr_band, scs); int index = get_nr_table_idx(nr_band, scs);
int bw_index = get_supported_band_index(scs, nr_band, nb_ul); int bw_index = get_supported_band_index(scs, nr_band, nb_ul);
int band_size_khz = get_supported_bw_khz(nr_band > 256 ? FR2 : FR1, bw_index); int band_size_khz = get_supported_bw_mhz(nr_band > 256 ? FR2 : FR1, bw_index) * 1000;
float limit = frame_type == TDD ? 0.04 : 0.03; float limit = frame_type == TDD ? 0.04 : 0.03;
float rel_bw = (float) (2 * band_size_khz) / (float) (nr_bandtable[index].ul_max + nr_bandtable[index].ul_min); float rel_bw = (float) (2 * band_size_khz) / (float) (nr_bandtable[index].ul_max + nr_bandtable[index].ul_min);
return rel_bw <= limit; return rel_bw <= limit;
...@@ -382,118 +382,6 @@ int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index) ...@@ -382,118 +382,6 @@ int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index)
return delta_duplex; return delta_duplex;
} }
uint16_t config_bandwidth(int mu, int nb_rb, int nr_band)
{
if (nr_band < 100) { //FR1
switch(mu) {
case 0 :
if (nb_rb<=25)
return 5;
if (nb_rb<=52)
return 10;
if (nb_rb<=79)
return 15;
if (nb_rb<=106)
return 20;
if (nb_rb<=133)
return 25;
if (nb_rb<=160)
return 30;
if (nb_rb<=216)
return 40;
if (nb_rb<=270)
return 50;
AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
break;
case 1 :
if (nb_rb<=11)
return 5;
if (nb_rb<=24)
return 10;
if (nb_rb<=38)
return 15;
if (nb_rb<=51)
return 20;
if (nb_rb<=65)
return 25;
if (nb_rb<=78)
return 30;
if (nb_rb<=106)
return 40;
if (nb_rb<=133)
return 50;
if (nb_rb<=162)
return 60;
if (nb_rb<=189)
return 70;
if (nb_rb<=217)
return 80;
if (nb_rb<=245)
return 90;
if (nb_rb<=273)
return 100;
AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
break;
case 2 :
if (nb_rb<=11)
return 10;
if (nb_rb<=18)
return 15;
if (nb_rb<=24)
return 20;
if (nb_rb<=31)
return 25;
if (nb_rb<=38)
return 30;
if (nb_rb<=51)
return 40;
if (nb_rb<=65)
return 50;
if (nb_rb<=79)
return 60;
if (nb_rb<=93)
return 70;
if (nb_rb<=107)
return 80;
if (nb_rb<=121)
return 90;
if (nb_rb<=135)
return 100;
AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
break;
default:
AssertFatal(1==0,"Numerology %d undefined for band %d in FR1\n", mu,nr_band);
}
}
else {
switch(mu) {
case 2 :
if (nb_rb<=66)
return 50;
if (nb_rb<=132)
return 100;
if (nb_rb<=264)
return 200;
AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
break;
case 3 :
if (nb_rb<=32)
return 50;
if (nb_rb<=66)
return 100;
if (nb_rb<=132)
return 200;
if (nb_rb<=264)
return 400;
AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
break;
default:
AssertFatal(1==0,"Numerology %d undefined for band %d in FR1\n", mu,nr_band);
}
}
}
// Returns the corresponding row index of the NR table // Returns the corresponding row index of the NR table
int get_nr_table_idx(int nr_bandP, uint8_t scs_index) { int get_nr_table_idx(int nr_bandP, uint8_t scs_index) {
int scs_khz = 15 << scs_index; int scs_khz = 15 << scs_index;
......
...@@ -76,7 +76,6 @@ int get_first_ul_slot(int nrofDownlinkSlots, int nrofDownlinkSymbols, int nrofUp ...@@ -76,7 +76,6 @@ int get_first_ul_slot(int nrofDownlinkSlots, int nrofDownlinkSymbols, int nrofUp
int cce_to_reg_interleaving(const int R, int k, int n_shift, const int C, int L, const int N_regs); int cce_to_reg_interleaving(const int R, int k, int n_shift, const int C, int L, const int N_regs);
int get_SLIV(uint8_t S, uint8_t L); int get_SLIV(uint8_t S, uint8_t L);
void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset); void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset);
uint16_t config_bandwidth(int mu, int nb_rb, int nr_band);
int get_nr_table_idx(int nr_bandP, uint8_t scs_index); int get_nr_table_idx(int nr_bandP, uint8_t scs_index);
int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index); int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index);
frame_type_t get_frame_type(uint16_t nr_bandP, uint8_t scs_index); frame_type_t get_frame_type(uint16_t nr_bandP, uint8_t scs_index);
...@@ -94,6 +93,7 @@ int get_supported_band_index(int scs, int band, int n_rbs); ...@@ -94,6 +93,7 @@ int get_supported_band_index(int scs, int band, int n_rbs);
long rrc_get_max_nr_csrs(const int max_rbs, long b_SRS); long rrc_get_max_nr_csrs(const int max_rbs, long b_SRS);
void get_K1_K2(int N1, int N2, int *K1, int *K2); void get_K1_K2(int N1, int N2, int *K1, int *K2);
bool compare_relative_ul_channel_bw(int nr_band, int scs, int nb_ul, frame_type_t frame_type); bool compare_relative_ul_channel_bw(int nr_band, int scs, int nb_ul, frame_type_t frame_type);
int get_supported_bw_mhz(frequency_range_t frequency_range, int bw_index);
void get_samplerate_and_bw(int mu, void get_samplerate_and_bw(int mu,
int n_rb, int n_rb,
int8_t threequarter_fs, int8_t threequarter_fs,
......
...@@ -96,10 +96,7 @@ void measurcmd_display_phyta(telnet_printfunc_t prnt) ...@@ -96,10 +96,7 @@ void measurcmd_display_phyta(telnet_printfunc_t prnt)
PHY_VARS_NR_UE *UE = PHY_vars_UE_g[0][0]; PHY_VARS_NR_UE *UE = PHY_vars_UE_g[0][0];
prnt("%s PHY TA stats\n", HDR); prnt("%s PHY TA stats\n", HDR);
prnt("N_TA_offset %d\n", UE->N_TA_offset); prnt("N_TA_offset %d\n", UE->N_TA_offset);
for (int i = 0; i < UE->n_connected_gNB; ++i) { prnt("TA command %d\n", UE->ta_command);
NR_UL_TIME_ALIGNMENT_t *ta = &UE->ul_time_alignment[i];
prnt("gNB %d TA command %d TA total %d TAG ID %d\n", i, ta->ta_command, ta->ta_total, ta->tag_id);
}
prnt("timing_advance %d (samples)\n", UE->timing_advance); prnt("timing_advance %d (samples)\n", UE->timing_advance);
} }
/* /*
......
...@@ -153,15 +153,17 @@ static inline void start_meas(time_stats_t *ts) { ...@@ -153,15 +153,17 @@ static inline void start_meas(time_stats_t *ts) {
static inline void stop_meas(time_stats_t *ts) { static inline void stop_meas(time_stats_t *ts) {
if (opp_enabled) { if (opp_enabled) {
long long out = rdtsc_oai(); long long out = rdtsc_oai();
ts->diff += (out-ts->in); if (ts->in) {
/// process duration is the difference between two clock points ts->diff += (out - ts->in);
ts->p_time = (out-ts->in); /// process duration is the difference between two clock points
ts->diff_square += ((double)out-ts->in)*((double)out-ts->in); ts->p_time = (out - ts->in);
ts->diff_square += ((double)out - ts->in) * ((double)out - ts->in);
if ((out-ts->in) > ts->max) if ((out - ts->in) > ts->max)
ts->max = out-ts->in; ts->max = out - ts->in;
ts->meas_flag=0; ts->meas_flag = 0;
}
} }
} }
......
...@@ -259,6 +259,7 @@ The following features are valid for the gNB and the 5G-NR UE. ...@@ -259,6 +259,7 @@ The following features are valid for the gNB and the 5G-NR UE.
- PTRS support - PTRS support
- Support for 1, 2 and 4 TX antennas - Support for 1, 2 and 4 TX antennas
- Support for up to 2 layers (currently limited to DMRS configuration type 2) - Support for up to 2 layers (currently limited to DMRS configuration type 2)
- Support for 256 QAM
* NR-CSIRS Generation of sequence at PHY * NR-CSIRS Generation of sequence at PHY
* NR-PUSCH (including Segmentation, LDPC encoding, rate matching, scrambling, modulation, RB mapping, etc). * NR-PUSCH (including Segmentation, LDPC encoding, rate matching, scrambling, modulation, RB mapping, etc).
- PUSCH mapping type A and B - PUSCH mapping type A and B
...@@ -267,6 +268,7 @@ The following features are valid for the gNB and the 5G-NR UE. ...@@ -267,6 +268,7 @@ The following features are valid for the gNB and the 5G-NR UE.
- PTRS support - PTRS support
- Support for up to 2 RX antenna - Support for up to 2 RX antenna
- Support for up to 2 layers - Support for up to 2 layers
- Support for 256 QAM
* NR-PUCCH * NR-PUCCH
- Format 0 (2 bits, for ACK/NACK and SR) - Format 0 (2 bits, for ACK/NACK and SR)
- Format 2 (up to 11 bits, mainly for CSI feedback) - Format 2 (up to 11 bits, mainly for CSI feedback)
......
...@@ -88,7 +88,7 @@ Some directories under `radio` contain READMEs: ...@@ -88,7 +88,7 @@ Some directories under `radio` contain READMEs:
- [RFsimulator](../radio/rfsimulator/README.md) - [RFsimulator](../radio/rfsimulator/README.md)
- [USRP](../radio/USRP/README.md) - [USRP](../radio/USRP/README.md)
- [BladeRF](../radio/BLADERF/README) - [BladeRF](../radio/BLADERF/README)
- [IQPlayer](../radio/iqplayer/DOC/iqrecordplayer_usage.md) - [IQPlayer](../radio/iqplayer/DOC/iqrecordplayer_usage.md), and [general documentation](./iqrecordplayer_usage.md)
The other SDRs (AW2S, LimeSDR, ...) have no READMEs. The other SDRs (AW2S, LimeSDR, ...) have no READMEs.
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
| starsky | 172.21.18.45 | CI-Starsky-Legacy-TDD-eNB | eNB (B40) | b200mini (30A3E3C) | | starsky | 172.21.18.45 | CI-Starsky-Legacy-TDD-eNB | eNB (B40) | b200mini (30A3E3C) |
| carabe | 172.21.18.47 | CI-Carabe-Legacy-FDD-OAI-LTE-UE | UE (B7UE) | B200mini (30AE8C9) | | carabe | 172.21.18.47 | CI-Carabe-Legacy-FDD-OAI-LTE-UE | UE (B7UE) | B200mini (30AE8C9) |
| nokiabox | 172.21.19.39 | _None_ | gNB (Nokia), 5GC | _Nokia RF integrated_ | | nokiabox | 172.21.19.39 | _None_ | gNB (Nokia), 5GC | _Nokia RF integrated_ |
| avra | 172.21.16.124 | CI-Avra-Usage | gNB (n78) | AW2S Jaguar (192.168.80.239) |
Note: The available resources, and their current usage, is indicated here: Note: The available resources, and their current usage, is indicated here:
- [Lockable resources of jenkins-oai](https://jenkins-oai.eurecom.fr/lockable-resources/): - [Lockable resources of jenkins-oai](https://jenkins-oai.eurecom.fr/lockable-resources/):
...@@ -56,8 +57,9 @@ Note: The available resources, and their current usage, is indicated here: ...@@ -56,8 +57,9 @@ Note: The available resources, and their current usage, is indicated here:
**Purpose**: AW2S tests with Amarisoft **Purpose**: AW2S tests with Amarisoft
Picture: TBD ![5G AW2S Testbench](testbenches_doc_resources/5g-aw2s-bench.png)
[PDF version](testbenches_doc_resources/5g-aw2s-bench.pdf) | [LaTeX/TikZ version](testbenches_doc_resources/5g-aw2s-bench.tex) if you want to modify to reflect your setup
### 4G Testbench(es) ### 4G Testbench(es)
...@@ -67,7 +69,6 @@ Picture: TBD ...@@ -67,7 +69,6 @@ Picture: TBD
[PDF version](testbenches_doc_resources/4g-faraday-bench.pdf) | [LaTeX/TikZ version](testbenches_doc_resources/4g-faraday-bench.tex) if you want to modify to reflect your setup [PDF version](testbenches_doc_resources/4g-faraday-bench.pdf) | [LaTeX/TikZ version](testbenches_doc_resources/4g-faraday-bench.tex) if you want to modify to reflect your setup
## Pipelines ## Pipelines
### [RAN-Container-Parent](https://jenkins-oai.eurecom.fr/job/RAN-Container-Parent/) ### [RAN-Container-Parent](https://jenkins-oai.eurecom.fr/job/RAN-Container-Parent/)
...@@ -115,6 +116,9 @@ Webhook ...@@ -115,6 +116,9 @@ Webhook
- basic SA test (20 MHz TDD), F1, reestablishment, ... - basic SA test (20 MHz TDD), F1, reestablishment, ...
- [RAN-Ubuntu20-Image-Builder](https://jenkins-oai.eurecom.fr/job/RAN-Ubuntu18-Image-Builder/) - [RAN-Ubuntu20-Image-Builder](https://jenkins-oai.eurecom.fr/job/RAN-Ubuntu18-Image-Builder/)
- obelix: Ubuntu 20 image build using docker (Note: builds U20 images while pipeline is named U18!) - obelix: Ubuntu 20 image build using docker (Note: builds U20 images while pipeline is named U18!)
- [RAN-SA-AW2S-CN5G](https://jenkins-oai.eurecom.fr/job/RAN-SA-AW2S-CN5G/)
- 5G-NR SA test setup: Avra(RHEL9.1)/Manarola(U22PRO) + AW2S, Amarisoft UE x1, OAI CN5G
- uses OpenShift cluster for CN deployment and container images for gNB deployment
### RAN-CI-NSA-Trigger ### RAN-CI-NSA-Trigger
......
# I/Q record-replay
## using the iq record-replay
This feature provides I/Q record-replay as initially presented in the 4th OAI workshop for LTE
(https://www.openairinterface.org/docs/workshop/4_OAI_Workshop_20171107/Talks/MONGAZON_Nokia-Bell-Labs-OAI-IQ.pdf)
The current implementation has been temporarily disrupted for LTE and only works for 5G SA
nr-uesoftmodem executable.
The I/Q record-replay feature is briefly described hereafter, it allows you to:
* record slots received by the USRP board in a file while the system is operating.
For example you can record a full nrUE connection/traffic/disconnection sequence.
Today the OAI USRP device is the only one supporting the recording feature.
* replay slots from a previously recorded file to operate the system,
possibly in multiple loops if the recorded sequence is convenient from the logical point of view.
The record-replay features are activated and configured using OAI configuration parameters
### Record mode
options for record mode are:
* `subframes-record` Activate record mode
* `subframes-file` Path of the file used for slots recording (default is `/tmp/iqfile`)
* `subframes-max` Maximum count of slots to be recorded in a file (default is 120000)
Note that the value of `--subframes-max` parameter needs to be tuned according to your RAM capabilities.
The default value is 120000, which allows for 120 seconds of record-replay but will require ~20GB of RAM and disk space.
If RAM does not allow for the parameter value, an error message will be displayed and the run will be aborted.
In record mode, to minimize performance impacts of operating software, slots are always saved into memory and
written to disk when the process terminates.
When you estimate the recorded sequence is achieved, you can terminate the nr-uesoftmodem by typing `CTRL-C`.
At that time, up to the value of `--subframes-max` slots will be written on disk.
The nr-uesoftmodem will indicate the exact count of slots written to disk, which may be less (but not higher)
than the value of `--subframes-max` parameter.
>Recording session example:
```bash
./nr-uesoftmodem -O /home/oaitests/mediatek_sim.conf --sa --nokrnmod 1 --numerology 1 -r 106 -C 3649440000 --band 78 -E --ue-fo-compensation --device.recplay.subframes-record 1 --device.recplay.subframes-file /home/iqs/oai-nrUE-17042023.dat --device.recplay.use-mmap 1 --device.recplay.subframes-max 30000
............................................
............................................
............................................
^C
[HW] Writing file header to /home/iqs/oai-nrUE-17042023.dat
[HW] Writing 4565 subframes to /home/iqs/oai-nrUE-17042023.dat
[HW] File /home/iqs/oai-nrUE-17042023.dat closed
[HW] releasing USRP
### Replay mode
Replaying I/Q works only for nr-uesoftmodem at 40MHz bandwidth 3/4 sampling.
Mismatch between file content and run time parameters might lead to unpredictable results.
options for replay mode are:
* `subframes-replay` Activate replay mode
* `subframes-file` Path of the file used for slots replay (default is `/tmp/iqfile`)
* `subframes-loops` Number of iterations to replay the entire slots file (default is 5)
* `use-mmap` Boolean, set to 1 (true) by default, iq file is map to memory if true, otherwise iq's are read from file.
>Replay mode session example:
```bash
./nr-uesoftmodem -O /home/oaitests/mediatek_sim.conf --sa --nokrnmod 1 --numerology 1 -r 106 -C 3649440000 --band 78 -E --ue-fo-compensation --device.recplay.subframes-replay 1 --device.recplay.subframes-file /home/iqs/oai-nrUE-17042023.dat --device.recplay.use-mmap 1 --device.recplay.subframes-loops 1
..................................
..................................
[HW] Replay iqs from USRP B200 device, bandwidth 4.000000e+07
[HW] Loaded 4565 subframes.
[HW] iqplayer device initialized, replay /home/iqs/oai-nrUE-17042023.dat for 1 iteration(s)
..................................
..................................
[OAI Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{backgrounds, positioning, shapes.symbols}
\usepackage{helvet}
\renewcommand*{\rmdefault}{\sfdefault}
\begin{document}
\begin{tikzpicture}
[
font=\footnotesize,
faraday/.style={minimum size=3cm, draw, dashed},
duplexer/.style={draw,fill=white},
]
\node[label=above:avra] (avra)
{\includegraphics[width=1.2cm]{server}};
\node[right=0.5cm of avra, label=above:AW2S] (aw2s)
{\includegraphics[width=1.2cm]{aw2s}} edge (avra);
\node[right=.2cm of aw2s, duplexer] (b78o) {n78} edge (aw2s);
\node[above right=-0.7cm and 0.35cm of b78o.east] (anto1)
{\includegraphics[width=0.3cm]{antenna}} edge (b78o);
\node[below right=-0.7cm and 0.35cm of b78o.east] (anto2)
{\includegraphics[width=0.3cm]{antenna}} edge (b78o);
\node[right=4cm of aw2s, label=above:Amarisoft UE] (amariue)
{\includegraphics[width=0.7cm]{amariue}};
\node[right=3cm of aw2s] (anto3)
{\includegraphics[width=0.3cm]{antenna}} edge (amariue);
\end{tikzpicture}
\end{document}
#/*
# * 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-base:latest AS oai-clang
RUN rm -Rf /oai-ran
WORKDIR /oai-ran
COPY . .
#only install LLVM (clang, ...) for this container, the others don't need it
RUN yum install -y llvm-toolset
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
mkdir -p log && \
export CC=/usr/bin/clang && \
export CXX=/usr/bin/clang++ && \
./build_oai --phy_simulators --gNB --eNB --nrUE --UE --ninja --verbose-ci --noavx512 -c --cmake-opt -DCMAKE_C_FLAGS=-Werror --cmake-opt -DCMAKE_CXX_FLAGS=-Werror
...@@ -84,6 +84,7 @@ COPY --from=gnb-base \ ...@@ -84,6 +84,7 @@ COPY --from=gnb-base \
/lib64/ /lib64/
RUN ln -s /usr/local/lib/libaw2sori_transpro.so /usr/local/lib/libthirdparty_transpro.so && \ RUN ln -s /usr/local/lib/libaw2sori_transpro.so /usr/local/lib/libthirdparty_transpro.so && \
ln -s /usr/local/lib/liboai_eth_transpro.so /usr/local/lib/liboai_transpro.so && \
ldconfig ldconfig
WORKDIR /opt/oai-gnb-aw2s WORKDIR /opt/oai-gnb-aw2s
......
...@@ -31,16 +31,14 @@ RUN rm -Rf /oai-ran ...@@ -31,16 +31,14 @@ RUN rm -Rf /oai-ran
WORKDIR /oai-ran WORKDIR /oai-ran
COPY . . COPY . .
#only install address sanitizer and LLVM (clang, ...) for this container, the others don't need it #only install address and undefined behavior sanitizer for this container, the others don't need it
RUN yum install -y libasan llvm-toolset RUN yum install -y libasan libubsan
#run build_oai to build the target image #run build_oai to build the target image
RUN /bin/sh oaienv && \ RUN /bin/sh oaienv && \
cd cmake_targets && \ cd cmake_targets && \
mkdir -p log && \ mkdir -p log && \
export CC=/usr/bin/clang && \ ./build_oai --phy_simulators --ninja --verbose-ci --sanitize --noavx512 -c --cmake-opt -DCMAKE_C_FLAGS=-Werror --cmake-opt -DCMAKE_CXX_FLAGS=-Werror
export CXX=/usr/bin/clang++ && \
./build_oai --phy_simulators --gNB --eNB --nrUE --UE --ninja --verbose-ci --sanitize-address --noavx512 -c --cmake-opt -DCMAKE_C_FLAGS=-Werror --cmake-opt -DCMAKE_CXX_FLAGS=-Werror
#start from scratch for target executable #start from scratch for target executable
FROM registry.access.redhat.com/ubi8/ubi:latest as oai-physim FROM registry.access.redhat.com/ubi8/ubi:latest as oai-physim
...@@ -89,6 +87,7 @@ COPY --from=phy-sim-build \ ...@@ -89,6 +87,7 @@ COPY --from=phy-sim-build \
/lib64/libexslt.so.0 \ /lib64/libexslt.so.0 \
/lib64/libxslt.so.1 \ /lib64/libxslt.so.1 \
/usr/lib64/libasan.so.5 \ /usr/lib64/libasan.so.5 \
/usr/lib64/libubsan.so.1 \
/oai-ran/cmake_targets/ran_build/build/libdfts.so \ /oai-ran/cmake_targets/ran_build/build/libdfts.so \
/oai-ran/cmake_targets/ran_build/build/libldpc.so \ /oai-ran/cmake_targets/ran_build/build/libldpc.so \
/oai-ran/cmake_targets/ran_build/build/libldpc_orig.so \ /oai-ran/cmake_targets/ran_build/build/libldpc_orig.so \
......
...@@ -154,7 +154,6 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue, ...@@ -154,7 +154,6 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue,
int nb_connected_gNB = 1; int nb_connected_gNB = 1;
ue->Mod_id = UE_id; ue->Mod_id = UE_id;
ue->mac_enabled = 1;
ue->if_inst = nr_ue_if_module_init(0); ue->if_inst = nr_ue_if_module_init(0);
ue->dci_thres = 0; ue->dci_thres = 0;
ue->target_Nid_cell = -1; ue->target_Nid_cell = -1;
...@@ -259,8 +258,6 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) ...@@ -259,8 +258,6 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
reset_queue(&nr_ul_dci_req_queue); reset_queue(&nr_ul_dci_req_queue);
reset_queue(&nr_ul_tti_req_queue); reset_queue(&nr_ul_tti_req_queue);
NR_UL_TIME_ALIGNMENT_t ul_time_alignment;
memset(&ul_time_alignment, 0, sizeof(ul_time_alignment));
int last_sfn_slot = -1; int last_sfn_slot = -1;
uint16_t sfn_slot = 0; uint16_t sfn_slot = 0;
...@@ -305,7 +302,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) ...@@ -305,7 +302,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
if (get_softmodem_params()->sa && mac->mib == NULL) { if (get_softmodem_params()->sa && mac->mib == NULL) {
LOG_D(NR_MAC, "We haven't gotten MIB. Lets see if we received it\n"); LOG_D(NR_MAC, "We haven't gotten MIB. Lets see if we received it\n");
nr_ue_dl_indication(&mac->dl_info, &ul_time_alignment); nr_ue_dl_indication(&mac->dl_info);
process_queued_nr_nfapi_msgs(mac, sfn_slot); process_queued_nr_nfapi_msgs(mac, sfn_slot);
} }
if (mac->scc == NULL && mac->scc_SIB == NULL) { if (mac->scc == NULL && mac->scc_SIB == NULL) {
...@@ -347,7 +344,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) ...@@ -347,7 +344,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
mac->dl_info.slot = slot; mac->dl_info.slot = slot;
mac->dl_info.dci_ind = NULL; mac->dl_info.dci_ind = NULL;
mac->dl_info.rx_ind = NULL; mac->dl_info.rx_ind = NULL;
nr_ue_dl_indication(&mac->dl_info, &ul_time_alignment); nr_ue_dl_indication(&mac->dl_info);
} }
if (pthread_mutex_unlock(&mac->mutex_dl_info)) abort(); if (pthread_mutex_unlock(&mac->mutex_dl_info)) abort();
...@@ -628,7 +625,7 @@ nr_phy_data_t UE_dl_preprocessing(PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) { ...@@ -628,7 +625,7 @@ nr_phy_data_t UE_dl_preprocessing(PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
if(UE->if_inst != NULL && UE->if_inst->dl_indication != NULL) { if(UE->if_inst != NULL && UE->if_inst->dl_indication != NULL) {
nr_downlink_indication_t dl_indication; nr_downlink_indication_t dl_indication;
nr_fill_dl_indication(&dl_indication, NULL, NULL, proc, UE, &phy_data); nr_fill_dl_indication(&dl_indication, NULL, NULL, proc, UE, &phy_data);
UE->if_inst->dl_indication(&dl_indication, NULL); UE->if_inst->dl_indication(&dl_indication);
} }
uint64_t a=rdtsc_oai(); uint64_t a=rdtsc_oai();
......
...@@ -50,7 +50,8 @@ ...@@ -50,7 +50,8 @@
#define FAPI_NR_DL_CONFIG_TYPE_P_DLSCH 0x05 #define FAPI_NR_DL_CONFIG_TYPE_P_DLSCH 0x05
#define FAPI_NR_DL_CONFIG_TYPE_CSI_RS 0x06 #define FAPI_NR_DL_CONFIG_TYPE_CSI_RS 0x06
#define FAPI_NR_DL_CONFIG_TYPE_CSI_IM 0x07 #define FAPI_NR_DL_CONFIG_TYPE_CSI_IM 0x07
#define FAPI_NR_DL_CONFIG_TYPES 0x07 #define FAPI_NR_CONFIG_TA_COMMAND 0x08
#define FAPI_NR_DL_CONFIG_TYPES 0x08
#define FAPI_NR_CCE_REG_MAPPING_TYPE_INTERLEAVED 0x01 #define FAPI_NR_CCE_REG_MAPPING_TYPE_INTERLEAVED 0x01
#define FAPI_NR_CCE_REG_MAPPING_TYPE_NON_INTERLEAVED 0x02 #define FAPI_NR_CCE_REG_MAPPING_TYPE_NON_INTERLEAVED 0x02
......
...@@ -526,6 +526,11 @@ typedef struct { ...@@ -526,6 +526,11 @@ typedef struct {
fapi_nr_dl_config_csiim_pdu_rel15_t csiim_config_rel15; fapi_nr_dl_config_csiim_pdu_rel15_t csiim_config_rel15;
} fapi_nr_dl_config_csiim_pdu; } fapi_nr_dl_config_csiim_pdu;
typedef struct {
int ta_frame;
int ta_slot;
int ta_command;
} fapi_nr_ta_command_pdu;
typedef struct { typedef struct {
uint8_t pdu_type; uint8_t pdu_type;
...@@ -534,6 +539,7 @@ typedef struct { ...@@ -534,6 +539,7 @@ typedef struct {
fapi_nr_dl_config_dlsch_pdu dlsch_config_pdu; fapi_nr_dl_config_dlsch_pdu dlsch_config_pdu;
fapi_nr_dl_config_csirs_pdu csirs_config_pdu; fapi_nr_dl_config_csirs_pdu csirs_config_pdu;
fapi_nr_dl_config_csiim_pdu csiim_config_pdu; fapi_nr_dl_config_csiim_pdu csiim_config_pdu;
fapi_nr_ta_command_pdu ta_command_pdu;
}; };
} fapi_nr_dl_config_request_pdu_t; } fapi_nr_dl_config_request_pdu_t;
......
...@@ -127,7 +127,7 @@ int main(int argc, char *argv[]) ...@@ -127,7 +127,7 @@ int main(int argc, char *argv[])
time_t currentTime; time_t currentTime;
char fileName[512], currentTimeInfo[25]; char fileName[512], currentTimeInfo[25];
char folderName[] = "."; char folderName[] = ".";
FILE *logFile; FILE *logFile = NULL;
/*folderName=getenv("HOME"); /*folderName=getenv("HOME");
strcat(folderName,"/Desktop/polartestResults");*/ strcat(folderName,"/Desktop/polartestResults");*/
......
...@@ -44,16 +44,16 @@ ...@@ -44,16 +44,16 @@
/*ref 36-212 v8.6.0 , pp 8-9 */ /*ref 36-212 v8.6.0 , pp 8-9 */
/* the highest degree is set by default */ /* the highest degree is set by default */
unsigned int poly24a = 0x864cfb00; // 1000 0110 0100 1100 1111 1011 uint32_t poly24a = 0x864cfb00; // 1000 0110 0100 1100 1111 1011
// D^24 + D^23 + D^18 + D^17 + D^14 + D^11 + D^10 + D^7 + D^6 + D^5 + D^4 + D^3 + D + 1 // D^24 + D^23 + D^18 + D^17 + D^14 + D^11 + D^10 + D^7 + D^6 + D^5 + D^4 + D^3 + D + 1
unsigned int poly24b = 0x80006300; // 1000 0000 0000 0000 0110 0011 uint32_t poly24b = 0x80006300; // 1000 0000 0000 0000 0110 0011
// D^24 + D^23 + D^6 + D^5 + D + 1 // D^24 + D^23 + D^6 + D^5 + D + 1
unsigned int poly24c = 0xb2b11700; // 1011 0010 1011 0001 0001 0111 uint32_t poly24c = 0xb2b11700; // 1011 0010 1011 0001 0001 0111
// D^24+D^23+D^21+D^20+D^17+D^15+D^13+D^12+D^8+D^4+D^2+D+1 // D^24+D^23+D^21+D^20+D^17+D^15+D^13+D^12+D^8+D^4+D^2+D+1
unsigned int poly16 = 0x10210000; // 0001 0000 0010 0001 D^16 + D^12 + D^5 + 1 uint32_t poly16 = 0x10210000; // 0001 0000 0010 0001 D^16 + D^12 + D^5 + 1
unsigned int poly12 = 0x80F00000; // 1000 0000 1111 D^12 + D^11 + D^3 + D^2 + D + 1 uint32_t poly12 = 0x80F00000; // 1000 0000 1111 D^12 + D^11 + D^3 + D^2 + D + 1
unsigned int poly8 = 0x9B000000; // 1001 1011 D^8 + D^7 + D^4 + D^3 + D + 1 uint32_t poly8 = 0x9B000000; // 1001 1011 D^8 + D^7 + D^4 + D^3 + D + 1
uint32_t poly6 = 0x84000000; // 10000100000... -> D^6+D^5+1 uint32_t poly6 = 0x84000000; // 10000100000... -> D^6+D^5+1
uint32_t poly11 = 0xc4200000; //11000100001000... -> D^11+D^10+D^9+D^5+1 uint32_t poly11 = 0xc4200000; //11000100001000... -> D^11+D^10+D^9+D^5+1
...@@ -65,14 +65,12 @@ For initialization && verification purposes, ...@@ -65,14 +65,12 @@ For initialization && verification purposes,
The first bit is in the MSB of each byte The first bit is in the MSB of each byte
*********************************************************/ *********************************************************/
unsigned int crcbit (unsigned char * inputptr, uint32_t crcbit(unsigned char* inputptr, int octetlen, uint32_t poly)
int octetlen,
unsigned int poly)
{ {
unsigned int i, crc = 0, c; uint32_t i, crc = 0, c;
while (octetlen-- > 0) { while (octetlen-- > 0) {
c = ((unsigned int)(*inputptr++)) << 24; c = ((uint32_t)(*inputptr++)) << 24;
for (i = 8; i != 0; i--) { for (i = 8; i != 0; i--) {
if ((1U << 31) & (c ^ crc)) if ((1U << 31) & (c ^ crc))
...@@ -92,14 +90,14 @@ unsigned int crcbit (unsigned char * inputptr, ...@@ -92,14 +90,14 @@ unsigned int crcbit (unsigned char * inputptr,
crc table initialization crc table initialization
*********************************************************/ *********************************************************/
static unsigned int crc24aTable[256]; static uint32_t crc24aTable[256];
static unsigned int crc24bTable[256]; static uint32_t crc24bTable[256];
static unsigned int crc24cTable[256]; static uint32_t crc24cTable[256];
static unsigned short crc16Table[256]; static uint32_t crc16Table[256];
static unsigned short crc12Table[256]; static uint32_t crc12Table[256];
static unsigned short crc11Table[256]; static uint32_t crc11Table[256];
static unsigned char crc8Table[256]; static uint32_t crc8Table[256];
static unsigned char crc6Table[256]; static uint32_t crc6Table[256];
#if USE_INTEL_CRC #if USE_INTEL_CRC
static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24a_pclmulqdq, 16) = { static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24a_pclmulqdq, 16) = {
...@@ -131,11 +129,11 @@ void crcTableInit (void) ...@@ -131,11 +129,11 @@ void crcTableInit (void)
crc24aTable[c] = crcbit (&c, 1, poly24a); crc24aTable[c] = crcbit (&c, 1, poly24a);
crc24bTable[c] = crcbit (&c, 1, poly24b); crc24bTable[c] = crcbit (&c, 1, poly24b);
crc24cTable[c] = crcbit (&c, 1, poly24c); crc24cTable[c] = crcbit (&c, 1, poly24c);
crc16Table[c] = (unsigned short) (crcbit (&c, 1, poly16) >> 16); crc16Table[c] = crcbit(&c, 1, poly16) >> 16;
crc12Table[c] = (unsigned short) (crcbit (&c, 1, poly12) >> 16); crc12Table[c] = crcbit(&c, 1, poly12) >> 16;
crc11Table[c] = (unsigned short) (crcbit (&c, 1, poly11) >> 16); crc11Table[c] = crcbit(&c, 1, poly11) >> 16;
crc8Table[c] = (unsigned char) (crcbit (&c, 1, poly8) >> 24); crc8Table[c] = crcbit(&c, 1, poly8) >> 24;
crc6Table[c] = (unsigned char) (crcbit (&c, 1, poly6) >> 24); crc6Table[c] = crcbit(&c, 1, poly6) >> 24;
} while (++c); } while (++c);
#if USE_INTEL_CRC #if USE_INTEL_CRC
crc_xmm_be_le_swap128 = _mm_setr_epi32(0x0c0d0e0f, 0x08090a0b, crc_xmm_be_le_swap128 = _mm_setr_epi32(0x0c0d0e0f, 0x08090a0b,
...@@ -151,19 +149,18 @@ assuming initial byte is 0 padded (in MSB) if necessary ...@@ -151,19 +149,18 @@ assuming initial byte is 0 padded (in MSB) if necessary
can use SIMD optimized Intel CRC for LTE/NR 24a/24b variants can use SIMD optimized Intel CRC for LTE/NR 24a/24b variants
*********************************************************/ *********************************************************/
unsigned int crc24a (unsigned char * inptr, uint32_t crc24a(unsigned char* inptr, int bitlen)
int bitlen)
{ {
int octetlen = bitlen / 8; /* Change in octets */ int octetlen = bitlen / 8; /* Change in octets */
if ( bitlen % 8 || !USE_INTEL_CRC ) { if ( bitlen % 8 || !USE_INTEL_CRC ) {
unsigned int crc = 0; uint32_t crc = 0;
int resbit= (bitlen % 8); int resbit = (bitlen % 8);
while (octetlen-- > 0) { while (octetlen-- > 0) {
// printf("crc24a: in %x => crc %x\n",crc,*inptr); // printf("crc24a: in %x => crc %x\n",crc,*inptr);
crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)]; crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)];
} }
if (resbit > 0) if (resbit > 0)
crc = (crc << resbit) ^ crc24aTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; crc = (crc << resbit) ^ crc24aTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))];
...@@ -188,19 +185,18 @@ static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24b_pclmulqdq, 16) = { ...@@ -188,19 +185,18 @@ static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24b_pclmulqdq, 16) = {
0ULL /**< res */ 0ULL /**< res */
}; };
#endif #endif
unsigned int crc24b (unsigned char * inptr, uint32_t crc24b(unsigned char* inptr, int bitlen)
int bitlen)
{ {
int octetlen = bitlen / 8; /* Change in octets */ int octetlen = bitlen / 8; /* Change in octets */
if ( bitlen % 8 || !USE_INTEL_CRC ) { if ( bitlen % 8 || !USE_INTEL_CRC ) {
unsigned int crc = 0; uint32_t crc = 0;
int resbit = (bitlen % 8); int resbit = (bitlen % 8);
while (octetlen-- > 0) { while (octetlen-- > 0) {
// printf("crc24b: in %x => crc %x (%x)\n",crc,*inptr,crc24bTable[(*inptr) ^ (crc >> 24)]); // printf("crc24b: in %x => crc %x (%x)\n",crc,*inptr,crc24bTable[(*inptr) ^ (crc >> 24)]);
crc = (crc << 8) ^ crc24bTable[(*inptr++) ^ (crc >> 24)]; crc = (crc << 8) ^ crc24bTable[(*inptr++) ^ (crc >> 24)];
} }
if (resbit > 0) if (resbit > 0)
crc = (crc << resbit) ^ crc24bTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; crc = (crc << resbit) ^ crc24bTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))];
...@@ -215,11 +211,10 @@ unsigned int crc24b (unsigned char * inptr, ...@@ -215,11 +211,10 @@ unsigned int crc24b (unsigned char * inptr,
#endif #endif
} }
unsigned int crc24c (unsigned char * inptr, uint32_t crc24c(unsigned char* inptr, int bitlen)
int bitlen)
{ {
int octetlen, resbit; int octetlen, resbit;
unsigned int crc = 0; uint32_t crc = 0;
octetlen = bitlen / 8; /* Change in octets */ octetlen = bitlen / 8; /* Change in octets */
resbit = (bitlen % 8); resbit = (bitlen % 8);
...@@ -234,11 +229,10 @@ unsigned int crc24c (unsigned char * inptr, ...@@ -234,11 +229,10 @@ unsigned int crc24c (unsigned char * inptr,
return crc; return crc;
} }
unsigned int uint32_t crc16(unsigned char* inptr, int bitlen)
crc16 (unsigned char * inptr, int bitlen)
{ {
int octetlen, resbit; int octetlen, resbit;
unsigned int crc = 0; uint32_t crc = 0;
octetlen = bitlen / 8; /* Change in octets */ octetlen = bitlen / 8; /* Change in octets */
resbit = (bitlen % 8); resbit = (bitlen % 8);
...@@ -253,11 +247,10 @@ crc16 (unsigned char * inptr, int bitlen) ...@@ -253,11 +247,10 @@ crc16 (unsigned char * inptr, int bitlen)
return crc; return crc;
} }
unsigned int uint32_t crc12(unsigned char* inptr, int bitlen)
crc12 (unsigned char * inptr, int bitlen)
{ {
int octetlen, resbit; int octetlen, resbit;
unsigned int crc = 0; uint32_t crc = 0;
octetlen = bitlen / 8; /* Change in octets */ octetlen = bitlen / 8; /* Change in octets */
resbit = (bitlen % 8); resbit = (bitlen % 8);
...@@ -271,11 +264,10 @@ crc12 (unsigned char * inptr, int bitlen) ...@@ -271,11 +264,10 @@ crc12 (unsigned char * inptr, int bitlen)
return crc; return crc;
} }
unsigned int uint32_t crc11(unsigned char* inptr, int bitlen)
crc11 (unsigned char * inptr, int bitlen)
{ {
int octetlen, resbit; int octetlen, resbit;
unsigned int crc = 0; uint32_t crc = 0;
octetlen = bitlen / 8; /* Change in octets */ octetlen = bitlen / 8; /* Change in octets */
resbit = (bitlen % 8); resbit = (bitlen % 8);
...@@ -289,29 +281,27 @@ crc11 (unsigned char * inptr, int bitlen) ...@@ -289,29 +281,27 @@ crc11 (unsigned char * inptr, int bitlen)
return crc; return crc;
} }
unsigned int uint32_t crc8(unsigned char* inptr, int bitlen)
crc8 (unsigned char * inptr, int bitlen)
{ {
int octetlen, resbit; int octetlen, resbit;
unsigned int crc = 0; uint32_t crc = 0;
octetlen = bitlen / 8; /* Change in octets */ octetlen = bitlen / 8; /* Change in octets */
resbit = (bitlen % 8); resbit = (bitlen % 8);
while (octetlen-- > 0) { while (octetlen-- > 0) {
crc = ((unsigned int)crc8Table[(*inptr++) ^ (crc >> 24)]) << 24; crc = ((uint32_t)crc8Table[(*inptr++) ^ (crc >> 24)]) << 24;
} }
if (resbit > 0) if (resbit > 0)
crc = (crc << resbit) ^ ((unsigned int)(crc8Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]) << 24); crc = (crc << resbit) ^ ((uint32_t)(crc8Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]) << 24);
return crc; return crc;
} }
unsigned int uint32_t crc6(unsigned char* inptr, int bitlen)
crc6 (unsigned char * inptr, int bitlen)
{ {
int octetlen, resbit; int octetlen, resbit;
unsigned int crc = 0; uint32_t crc = 0;
octetlen = bitlen / 8; /* Change in octets */ octetlen = bitlen / 8; /* Change in octets */
resbit = (bitlen % 8); resbit = (bitlen % 8);
......
...@@ -34,6 +34,21 @@ ...@@ -34,6 +34,21 @@
#include "time_meas.h" #include "time_meas.h"
#endif #endif
#include "nrLDPCdecoder_defs.h" #include "nrLDPCdecoder_defs.h"
typedef struct {
uint8_t* d;
int dim1;
int dim2;
} arr8_t;
typedef struct {
uint16_t* d;
int dim1;
int dim2;
} arr16_t;
typedef struct {
uint32_t* d;
int dim1;
int dim2;
} arr32_t;
// ============================================================================== // ==============================================================================
// TYPES // TYPES
...@@ -46,12 +61,12 @@ typedef struct nrLDPC_lut { ...@@ -46,12 +61,12 @@ typedef struct nrLDPC_lut {
const uint8_t* numBnInBnGroups; /**< Number of CNs in every BN group */ const uint8_t* numBnInBnGroups; /**< Number of CNs in every BN group */
const uint32_t* startAddrBnGroups; /**< Start addresses for BN groups in BN processing buffer */ const uint32_t* startAddrBnGroups; /**< Start addresses for BN groups in BN processing buffer */
const uint16_t* startAddrBnGroupsLlr; /**< Start addresses for BN groups in LLR processing buffer */ const uint16_t* startAddrBnGroupsLlr; /**< Start addresses for BN groups in LLR processing buffer */
const uint16_t** circShift[NR_LDPC_NUM_CN_GROUPS_BG1]; /**< LUT for circular shift values for all CN groups and Zs */ arr16_t circShift[NR_LDPC_NUM_CN_GROUPS_BG1]; /**< LUT for circular shift values for all CN groups and Zs */
const uint32_t** startAddrBnProcBuf[NR_LDPC_NUM_CN_GROUPS_BG1]; /**< LUT of start addresses of CN groups in BN proc buffer */ arr32_t startAddrBnProcBuf[NR_LDPC_NUM_CN_GROUPS_BG1]; /**< LUT of start addresses of CN groups in BN proc buffer */
const uint8_t** bnPosBnProcBuf[NR_LDPC_NUM_CN_GROUPS_BG1]; /**< LUT of BN positions in BG for CN groups */ arr8_t bnPosBnProcBuf[NR_LDPC_NUM_CN_GROUPS_BG1]; /**< LUT of BN positions in BG for CN groups */
const uint16_t* llr2llrProcBufAddr; /**< LUT for transferring input LLRs to LLR processing buffer */ const uint16_t* llr2llrProcBufAddr; /**< LUT for transferring input LLRs to LLR processing buffer */
const uint8_t* llr2llrProcBufBnPos; /**< LUT BN position in BG */ const uint8_t* llr2llrProcBufBnPos; /**< LUT BN position in BG */
const uint8_t** posBnInCnProcBuf[NR_LDPC_NUM_CN_GROUPS_BG1]; /**< LUT for llr2cnProcBuf */ arr8_t posBnInCnProcBuf[NR_LDPC_NUM_CN_GROUPS_BG1]; /**< LUT for llr2cnProcBuf */
} t_nrLDPC_lut; } t_nrLDPC_lut;
/** /**
......
...@@ -342,7 +342,8 @@ void build_polar_tables(t_nrPolar_params *polarParams) { ...@@ -342,7 +342,8 @@ void build_polar_tables(t_nrPolar_params *polarParams) {
} }
} }
AssertFatal(polarParams->N==512 || polarParams->N==256 || polarParams->N==128,"N = %d, not done yet\n",polarParams->N); AssertFatal(polarParams->N == 512 || polarParams->N == 256 || polarParams->N == 128 || polarParams->N == 64, "N = %d, not done yet\n", polarParams->N);
// build G bit vectors for information bit positions and convert the bit as bytes tables in nr_polar_kronecker_power_matrices.c to 64 bit packed vectors. // build G bit vectors for information bit positions and convert the bit as bytes tables in nr_polar_kronecker_power_matrices.c to 64 bit packed vectors.
// keep only rows of G which correspond to information/crc bits // keep only rows of G which correspond to information/crc bits
polarParams->G_N_tab = (uint64_t **)calloc((polarParams->K + polarParams->n_pc),sizeof(int64_t *)); polarParams->G_N_tab = (uint64_t **)calloc((polarParams->K + polarParams->n_pc),sizeof(int64_t *));
...@@ -410,19 +411,34 @@ void build_polar_tables(t_nrPolar_params *polarParams) { ...@@ -410,19 +411,34 @@ void build_polar_tables(t_nrPolar_params *polarParams) {
firstingroup_in,firstingroup_in+ccnt, firstingroup_in,firstingroup_in+ccnt,
firstingroup_out,firstingroup_out+ccnt); firstingroup_out,firstingroup_out+ccnt);
#endif #endif
AssertFatal(mingroupsize==4 || mingroupsize==8 || mingroupsize==16,"mingroupsize %d, needs to be handled\n",mingroupsize);
polarParams->groupsize=mingroupsize;
int shift=3;
if (mingroupsize == 16) shift=4; polarParams->groupsize = mingroupsize;
else if (mingroupsize == 4) shift=2;
int shift = 0;
switch (mingroupsize) {
case 2:
shift = 1;
break;
case 4:
shift = 2;
break;
case 8:
shift = 3;
break;
case 16:
shift = 4;
break;
default:
AssertFatal(1 == 0, "mingroupsize = %i is not supported\n", mingroupsize);
break;
}
polarParams->rm_tab=(int *)malloc(sizeof(int)*polarParams->encoderLength/mingroupsize); polarParams->rm_tab = (int *)malloc(sizeof(int) * (polarParams->encoderLength >> shift));
// rerun again to create groups
int tcnt=0;
for (int outpos=0; outpos<polarParams->encoderLength; outpos+=mingroupsize,tcnt++) // rerun again to create groups
polarParams->rm_tab[tcnt] = polarParams->rate_matching_pattern[outpos]>>shift; int tcnt = 0;
for (int outpos = 0; outpos < polarParams->encoderLength; outpos += mingroupsize, tcnt++)
polarParams->rm_tab[tcnt] = polarParams->rate_matching_pattern[outpos] >> shift;
} }
void polar_encoder_fast(uint64_t *A, void polar_encoder_fast(uint64_t *A,
...@@ -699,6 +715,11 @@ void polar_encoder_fast(uint64_t *A, ...@@ -699,6 +715,11 @@ void polar_encoder_fast(uint64_t *A,
#endif #endif
} }
} }
} else if (polarParams->N == 64) {
for (int i = 0; i < ((len > 63) ? 64 : len); i++) {
Cprime_i = -((Cprime[0] >> i) & 1);
D[0] ^= (Cprime_i & polarParams->G_N_tab[off + i][0]);
}
} }
memset((void*)out,0,polarParams->encoderLength>>3); memset((void*)out,0,polarParams->encoderLength>>3);
polar_rate_matching(polarParams,(void *)D, out); polar_rate_matching(polarParams,(void *)D, out);
......
...@@ -85,10 +85,8 @@ static void nr_polar_delete(void) { ...@@ -85,10 +85,8 @@ static void nr_polar_delete(void) {
pthread_mutex_unlock(&PolarListMutex); pthread_mutex_unlock(&PolarListMutex);
} }
t_nrPolar_params * nr_polar_params(int8_t messageType, t_nrPolar_params *nr_polar_params(int8_t messageType, uint16_t messageLength, uint8_t aggregation_level, int decoder_flag)
uint16_t messageLength, {
uint8_t aggregation_level,
int decoder_flag) {
// The lock is weak, because we never delete in the list, only at exit time // The lock is weak, because we never delete in the list, only at exit time
// therefore, returning t_nrPolar_params * from the list is safe for future usage // therefore, returning t_nrPolar_params * from the list is safe for future usage
pthread_mutex_lock(&PolarListMutex); pthread_mutex_lock(&PolarListMutex);
...@@ -123,8 +121,8 @@ t_nrPolar_params * nr_polar_params(int8_t messageType, ...@@ -123,8 +121,8 @@ t_nrPolar_params * nr_polar_params(int8_t messageType,
newPolarInitNode->idx = PolarKey; newPolarInitNode->idx = PolarKey;
newPolarInitNode->nextPtr = NULL; newPolarInitNode->nextPtr = NULL;
//printf("newPolarInitNode->idx %d, (%d,%d,%d:%d)\n",newPolarInitNode->idx,messageType,messageLength,aggregation_prime,aggregation_level); //printf("newPolarInitNode->idx %d, (%d,%d,%d:%d)\n",newPolarInitNode->idx,messageType,messageLength,aggregation_prime,aggregation_level);
if (messageType == 0) { //PBCH if (messageType == NR_POLAR_PBCH_MESSAGE_TYPE) {
newPolarInitNode->n_max = NR_POLAR_PBCH_N_MAX; newPolarInitNode->n_max = NR_POLAR_PBCH_N_MAX;
newPolarInitNode->i_il = NR_POLAR_PBCH_I_IL; newPolarInitNode->i_il = NR_POLAR_PBCH_I_IL;
newPolarInitNode->i_seg = NR_POLAR_PBCH_I_SEG; newPolarInitNode->i_seg = NR_POLAR_PBCH_I_SEG;
...@@ -135,9 +133,10 @@ t_nrPolar_params * nr_polar_params(int8_t messageType, ...@@ -135,9 +133,10 @@ t_nrPolar_params * nr_polar_params(int8_t messageType,
newPolarInitNode->payloadBits = NR_POLAR_PBCH_PAYLOAD_BITS; newPolarInitNode->payloadBits = NR_POLAR_PBCH_PAYLOAD_BITS;
newPolarInitNode->encoderLength = NR_POLAR_PBCH_E; newPolarInitNode->encoderLength = NR_POLAR_PBCH_E;
newPolarInitNode->crcCorrectionBits = NR_POLAR_PBCH_CRC_ERROR_CORRECTION_BITS; newPolarInitNode->crcCorrectionBits = NR_POLAR_PBCH_CRC_ERROR_CORRECTION_BITS;
newPolarInitNode->crc_generator_matrix = crc24c_generator_matrix(newPolarInitNode->payloadBits);//G_P newPolarInitNode->crc_generator_matrix = crc24c_generator_matrix(newPolarInitNode->payloadBits); // G_P
//printf("Initializing polar parameters for PBCH (K %d, E %d)\n",newPolarInitNode->payloadBits,newPolarInitNode->encoderLength); //printf("Initializing polar parameters for PBCH (K %d, E %d)\n",newPolarInitNode->payloadBits,newPolarInitNode->encoderLength);
} else if (messageType == 1) { //DCI
} else if (messageType == NR_POLAR_DCI_MESSAGE_TYPE) {
newPolarInitNode->n_max = NR_POLAR_DCI_N_MAX; newPolarInitNode->n_max = NR_POLAR_DCI_N_MAX;
newPolarInitNode->i_il = NR_POLAR_DCI_I_IL; newPolarInitNode->i_il = NR_POLAR_DCI_I_IL;
newPolarInitNode->i_seg = NR_POLAR_DCI_I_SEG; newPolarInitNode->i_seg = NR_POLAR_DCI_I_SEG;
...@@ -146,40 +145,55 @@ t_nrPolar_params * nr_polar_params(int8_t messageType, ...@@ -146,40 +145,55 @@ t_nrPolar_params * nr_polar_params(int8_t messageType,
newPolarInitNode->i_bil = NR_POLAR_DCI_I_BIL; newPolarInitNode->i_bil = NR_POLAR_DCI_I_BIL;
newPolarInitNode->crcParityBits = NR_POLAR_DCI_CRC_PARITY_BITS; newPolarInitNode->crcParityBits = NR_POLAR_DCI_CRC_PARITY_BITS;
newPolarInitNode->payloadBits = messageLength; newPolarInitNode->payloadBits = messageLength;
newPolarInitNode->encoderLength = aggregation_level*108; newPolarInitNode->encoderLength = aggregation_level * 108;
newPolarInitNode->crcCorrectionBits = NR_POLAR_DCI_CRC_ERROR_CORRECTION_BITS; newPolarInitNode->crcCorrectionBits = NR_POLAR_DCI_CRC_ERROR_CORRECTION_BITS;
newPolarInitNode->crc_generator_matrix=crc24c_generator_matrix(newPolarInitNode->payloadBits+newPolarInitNode->crcParityBits);//G_P newPolarInitNode->crc_generator_matrix = crc24c_generator_matrix(newPolarInitNode->payloadBits + newPolarInitNode->crcParityBits); // G_P
//printf("Initializing polar parameters for DCI (K %d, E %d, L %d)\n",newPolarInitNode->payloadBits,newPolarInitNode->encoderLength,aggregation_level); //printf("Initializing polar parameters for DCI (K %d, E %d, L %d)\n",newPolarInitNode->payloadBits,newPolarInitNode->encoderLength,aggregation_level);
} else if (messageType == 2) { //UCI PUCCH2
AssertFatal(aggregation_level>2,"Aggregation level (%d) for PUCCH 2 encoding is NPRB and should be > 2\n",aggregation_level);
AssertFatal(messageLength>11,"Message length %d is too short for polar encoding of UCI\n",messageLength);
newPolarInitNode->n_max = NR_POLAR_PUCCH_N_MAX;
newPolarInitNode->i_il = NR_POLAR_PUCCH_I_IL;
newPolarInitNode->encoderLength = aggregation_level * 16;
newPolarInitNode->i_seg = 0; } else if (messageType == NR_POLAR_UCI_PUCCH_MESSAGE_TYPE) {
AssertFatal(aggregation_level > 2, "Aggregation level (%d) for PUCCH 2 encoding is NPRB and should be > 2\n", aggregation_level);
if ((messageLength >= 360 && newPolarInitNode->encoderLength >= 1088)|| AssertFatal(messageLength > 11, "Message length %d is too short for polar encoding of UCI\n", messageLength);
(messageLength >= 1013)) newPolarInitNode->i_seg = 1;
newPolarInitNode->crcParityBits = 11; // TS 38.212 - Section 6.3.1.2.1 UCI encoded by Polar code
newPolarInitNode->n_pc = 0; int L = 0;
newPolarInitNode->n_pc_wm = 0; if (messageLength >= 12 && messageLength <= 19) {
L = 6;
} else if (messageLength >= 20) {
L = 11;
} else {
AssertFatal(1 == 0, "L = %i is an invalid value\n", L);
}
newPolarInitNode->encoderLength = aggregation_level * 16;
newPolarInitNode->i_seg = 0;
if ((messageLength >= 360 && newPolarInitNode->encoderLength >= 1088) || (messageLength >= 1013)) {
newPolarInitNode->i_seg = 1;
AssertFatal(1 == 0, "Segmentation is not supported yet (i_seg = %i)\n", newPolarInitNode->i_seg);
}
if (messageLength < 20) { // TS 38.212 - Section 6.3.1.3.1 UCI encoded by Polar code
newPolarInitNode->crcParityBits = 6; newPolarInitNode->n_max = NR_POLAR_PUCCH_N_MAX;
newPolarInitNode->i_il = NR_POLAR_PUCCH_I_IL;
newPolarInitNode->crcParityBits = L;
int Kr = messageLength + L;
if (Kr >= 18 && Kr <= 25) {
newPolarInitNode->n_pc = 3; newPolarInitNode->n_pc = 3;
if ((newPolarInitNode->encoderLength - messageLength - 6 + 3) < 193) newPolarInitNode->n_pc_wm = 1; if ((newPolarInitNode->encoderLength - Kr + 3) > 192) {
newPolarInitNode->n_pc_wm = 1;
} else {
newPolarInitNode->n_pc_wm = 0;
}
} else if (Kr > 30) {
newPolarInitNode->n_pc = 0;
newPolarInitNode->n_pc_wm = 0;
} else {
AssertFatal(1 == 0, "Kr = %i is an invalid value\n", Kr);
} }
newPolarInitNode->i_bil = NR_POLAR_PUCCH_I_BIL; newPolarInitNode->i_bil = NR_POLAR_PUCCH_I_BIL;
newPolarInitNode->payloadBits = messageLength; newPolarInitNode->payloadBits = messageLength;
newPolarInitNode->crcCorrectionBits = NR_POLAR_PUCCH_CRC_ERROR_CORRECTION_BITS; newPolarInitNode->crcCorrectionBits = NR_POLAR_PUCCH_CRC_ERROR_CORRECTION_BITS;
//newPolarInitNode->crc_generator_matrix=crc24c_generator_matrix(newPolarInitNode->payloadBits+newPolarInitNode->crcParityBits);//G_P
//LOG_D(PHY,"New polar node, encoderLength %d, aggregation_level %d\n",newPolarInitNode->encoderLength,aggregation_level); //LOG_D(PHY,"New polar node, encoderLength %d, aggregation_level %d\n",newPolarInitNode->encoderLength,aggregation_level);
} else { } else {
AssertFatal(1 == 0, "[nr_polar_init] Incorrect Message Type(%d)", messageType); AssertFatal(1 == 0, "[nr_polar_init] Incorrect Message Type(%d)", messageType);
} }
......
...@@ -706,23 +706,24 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB) ...@@ -706,23 +706,24 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB)
pusch->rxdataF_comp = (int32_t **)malloc16(n_buf * sizeof(int32_t *)); pusch->rxdataF_comp = (int32_t **)malloc16(n_buf * sizeof(int32_t *));
pusch->ul_ch_mag0 = (int32_t **)malloc16(n_buf * sizeof(int32_t *)); pusch->ul_ch_mag0 = (int32_t **)malloc16(n_buf * sizeof(int32_t *));
pusch->ul_ch_magb0 = (int32_t **)malloc16(n_buf * sizeof(int32_t *)); pusch->ul_ch_magb0 = (int32_t **)malloc16(n_buf * sizeof(int32_t *));
pusch->ul_ch_magc0 = (int32_t **)malloc16(n_buf * sizeof(int32_t *));
pusch->ul_ch_mag = (int32_t **)malloc16(n_buf * sizeof(int32_t *)); pusch->ul_ch_mag = (int32_t **)malloc16(n_buf * sizeof(int32_t *));
pusch->ul_ch_magb = (int32_t **)malloc16(n_buf * sizeof(int32_t *)); pusch->ul_ch_magb = (int32_t **)malloc16(n_buf * sizeof(int32_t *));
pusch->ul_ch_magc = (int32_t **)malloc16(n_buf * sizeof(int32_t *));
pusch->rho = (int32_t ***)malloc16(Prx * sizeof(int32_t **)); pusch->rho = (int32_t ***)malloc16(Prx * sizeof(int32_t **));
pusch->llr_layers = (int16_t **)malloc16(max_ul_mimo_layers * sizeof(int32_t *)); pusch->llr_layers = (int16_t **)malloc16(max_ul_mimo_layers * sizeof(int32_t *));
for (i = 0; i < Prx; i++) {
for (i=0; i<Prx; i++) {
pusch->rxdataF_ext[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot); pusch->rxdataF_ext[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot);
pusch->rho[i] = (int32_t **)malloc16_clear(NR_MAX_NB_LAYERS * NR_MAX_NB_LAYERS * sizeof(int32_t *)); pusch->rho[i] = (int32_t **)malloc16_clear(NR_MAX_NB_LAYERS * NR_MAX_NB_LAYERS * sizeof(int32_t *));
for (int j=0; j< max_ul_mimo_layers; j++) { for (int j = 0; j < max_ul_mimo_layers; j++) {
for (int k=0; k<max_ul_mimo_layers; k++) { for (int k = 0; k < max_ul_mimo_layers; k++) {
pusch->rho[i][j * max_ul_mimo_layers + k] = pusch->rho[i][j * max_ul_mimo_layers + k] =
(int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot); (int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot);
} }
} }
} }
for (i=0; i<n_buf; i++) { for (i = 0; i < n_buf; i++) {
pusch->ul_ch_estimates[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * fp->ofdm_symbol_size * fp->symbols_per_slot); pusch->ul_ch_estimates[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * fp->ofdm_symbol_size * fp->symbols_per_slot);
pusch->ul_ch_estimates_ext[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot); pusch->ul_ch_estimates_ext[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot);
pusch->ul_ch_estimates_time[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * fp->ofdm_symbol_size); pusch->ul_ch_estimates_time[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * fp->ofdm_symbol_size);
...@@ -730,8 +731,10 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB) ...@@ -730,8 +731,10 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB)
pusch->rxdataF_comp[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot); pusch->rxdataF_comp[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot);
pusch->ul_ch_mag0[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot); pusch->ul_ch_mag0[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot);
pusch->ul_ch_magb0[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot); pusch->ul_ch_magb0[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot);
pusch->ul_ch_magc0[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot);
pusch->ul_ch_mag[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot); pusch->ul_ch_mag[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot);
pusch->ul_ch_magb[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot); pusch->ul_ch_magb[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot);
pusch->ul_ch_magc[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot);
} }
for (i=0; i< max_ul_mimo_layers; i++) { for (i=0; i< max_ul_mimo_layers; i++) {
...@@ -753,7 +756,9 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB) ...@@ -753,7 +756,9 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
const int Prx = gNB->gNB_config.carrier_config.num_rx_ant.value; const int Prx = gNB->gNB_config.carrier_config.num_rx_ant.value;
const int max_ul_mimo_layers = 4; // taken from phy_init_nr_gNB() const int max_ul_mimo_layers = 4; // taken from phy_init_nr_gNB()
const int n_buf = Prx * max_ul_mimo_layers; const int n_buf = Prx * max_ul_mimo_layers;
PHY_MEASUREMENTS_gNB *meas=&gNB->measurements;
free_and_zero(meas->n0_subband_power);
free_and_zero(meas->n0_subband_power_dB);
int max_dl_mimo_layers =(fp->nb_antennas_tx<NR_MAX_NB_LAYERS) ? fp->nb_antennas_tx : NR_MAX_NB_LAYERS; int max_dl_mimo_layers =(fp->nb_antennas_tx<NR_MAX_NB_LAYERS) ? fp->nb_antennas_tx : NR_MAX_NB_LAYERS;
if (fp->nb_antennas_tx>1) { if (fp->nb_antennas_tx>1) {
for (int nl = 0; nl < max_dl_mimo_layers; nl++) { for (int nl = 0; nl < max_dl_mimo_layers; nl++) {
...@@ -867,8 +872,10 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB) ...@@ -867,8 +872,10 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
free_and_zero(pusch_vars->rxdataF_comp[i]); free_and_zero(pusch_vars->rxdataF_comp[i]);
free_and_zero(pusch_vars->ul_ch_mag0[i]); free_and_zero(pusch_vars->ul_ch_mag0[i]);
free_and_zero(pusch_vars->ul_ch_magb0[i]); free_and_zero(pusch_vars->ul_ch_magb0[i]);
free_and_zero(pusch_vars->ul_ch_magc0[i]);
free_and_zero(pusch_vars->ul_ch_mag[i]); free_and_zero(pusch_vars->ul_ch_mag[i]);
free_and_zero(pusch_vars->ul_ch_magb[i]); free_and_zero(pusch_vars->ul_ch_magb[i]);
free_and_zero(pusch_vars->ul_ch_magc[i]);
} }
free_and_zero(pusch_vars->llr_layers); free_and_zero(pusch_vars->llr_layers);
free_and_zero(pusch_vars->rxdataF_ext); free_and_zero(pusch_vars->rxdataF_ext);
...@@ -880,8 +887,10 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB) ...@@ -880,8 +887,10 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
free_and_zero(pusch_vars->rxdataF_comp); free_and_zero(pusch_vars->rxdataF_comp);
free_and_zero(pusch_vars->ul_ch_mag0); free_and_zero(pusch_vars->ul_ch_mag0);
free_and_zero(pusch_vars->ul_ch_magb0); free_and_zero(pusch_vars->ul_ch_magb0);
free_and_zero(pusch_vars->ul_ch_magc0);
free_and_zero(pusch_vars->ul_ch_mag); free_and_zero(pusch_vars->ul_ch_mag);
free_and_zero(pusch_vars->ul_ch_magb); free_and_zero(pusch_vars->ul_ch_magb);
free_and_zero(pusch_vars->ul_ch_magc);
free_and_zero(pusch_vars->rho); free_and_zero(pusch_vars->rho);
free_and_zero(pusch_vars->llr); free_and_zero(pusch_vars->llr);
...@@ -954,7 +963,8 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB, ...@@ -954,7 +963,8 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
} }
fp->threequarter_fs = 0; fp->threequarter_fs = 0;
gNB_config->carrier_config.dl_bandwidth.value = config_bandwidth(mu, N_RB_DL, fp->nr_band); int bw_index = get_supported_band_index(mu, fp->nr_band, N_RB_DL);
gNB_config->carrier_config.dl_bandwidth.value = get_supported_bw_mhz(fp->nr_band > 256 ? FR2 : FR1, bw_index);
nr_init_frame_parms(gNB_config, fp); nr_init_frame_parms(gNB_config, fp);
......
...@@ -234,9 +234,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) ...@@ -234,9 +234,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
ue->bitrate[gNB_id] = 0; ue->bitrate[gNB_id] = 0;
ue->total_received_bits[gNB_id] = 0; ue->total_received_bits[gNB_id] = 0;
ue->ul_time_alignment[gNB_id].apply_ta = 0;
ue->ul_time_alignment[gNB_id].ta_frame = -1;
ue->ul_time_alignment[gNB_id].ta_slot = -1;
} }
// init NR modulation lookup tables // init NR modulation lookup tables
nr_generate_modulation_table(); nr_generate_modulation_table();
...@@ -691,6 +688,8 @@ void init_N_TA_offset(PHY_VARS_NR_UE *ue){ ...@@ -691,6 +688,8 @@ void init_N_TA_offset(PHY_VARS_NR_UE *ue){
} }
ue->N_TA_offset = (int)(N_TA_offset * factor); ue->N_TA_offset = (int)(N_TA_offset * factor);
ue->ta_frame = -1;
ue->ta_slot = -1;
LOG_I(PHY,"UE %d Setting N_TA_offset to %d samples (factor %f, UL Freq %lu, N_RB %d, mu %d)\n", ue->Mod_id, ue->N_TA_offset, factor, fp->ul_CarrierFreq, fp->N_RB_DL, fp->numerology_index); LOG_I(PHY,"UE %d Setting N_TA_offset to %d samples (factor %f, UL Freq %lu, N_RB %d, mu %d)\n", ue->Mod_id, ue->N_TA_offset, factor, fp->ul_CarrierFreq, fp->N_RB_DL, fp->numerology_index);
} }
......
...@@ -1024,7 +1024,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue, ...@@ -1024,7 +1024,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
#elif defined(__arm__) || defined(__aarch64__) #elif defined(__arm__) || defined(__aarch64__)
int16x8_t *dl_ch0_128, *dl_ch1_128; int16x8_t *dl_ch0_128, *dl_ch1_128;
#endif #endif
int *dl_ch0,*dl_ch1; int *dl_ch0=NULL,*dl_ch1=NULL;
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
int nb_subbands,subband_size,last_subband_size; int nb_subbands,subband_size,last_subband_size;
......
...@@ -352,16 +352,16 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t ...@@ -352,16 +352,16 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t
if (ra_header==0) { if (ra_header==0) {
for (i=16; i>0; i--) { for (i=16; i>0; i--) {
if ((rb_alloc&(1<<i)) != 0) if ((rb_alloc & (1 << i)) != 0)
rb_alloc2[(3*(16-i))>>5] |= (7<<((3*(16-i))%32)); rb_alloc2[(3 * (16 - i)) >> 5] |= (7U << ((3 * (16 - i)) % 32));
} }
// bit mask across // bit mask across
if ((rb_alloc2[0]>>31)==1) if ((rb_alloc2[0]>>31)==1)
rb_alloc2[1] |= 1; rb_alloc2[1] |= 1;
if ((rb_alloc&1) != 0) if ((rb_alloc&1) != 0)
rb_alloc2[1] |= (3<<16); rb_alloc2[1] |= (3 << 16);
} }
else { else {
LOG_W(PHY,"resource type 1 not supported for N_RB_DL=50\n"); LOG_W(PHY,"resource type 1 not supported for N_RB_DL=50\n");
...@@ -371,10 +371,10 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t ...@@ -371,10 +371,10 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t
case 100: case 100:
if (ra_header==0) { if (ra_header==0) {
for (i=0; i<25; i++) { for (i=0; i<25; i++) {
if ((rb_alloc&(1<<(24-i))) != 0) if ((rb_alloc & (1 << (24 - i))) != 0)
rb_alloc2[(4*i)>>5] |= (0xf<<((4*i)%32)); rb_alloc2[(4 * i) >> 5] |= (0xfU << ((4 * i) % 32));
// printf("rb_alloc2[%d] (type 0) %x (%d)\n",(4*i)>>5,rb_alloc2[(4*i)>>5],rb_alloc&(1<<i)); // printf("rb_alloc2[%d] (type 0) %x (%d)\n",(4*i)>>5,rb_alloc2[(4*i)>>5],rb_alloc&(1<<i));
} }
} }
else { else {
...@@ -960,8 +960,8 @@ uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t ...@@ -960,8 +960,8 @@ uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t
case 2: case 2:
if ((subframe!=2) && (subframe!=7)) { if ((subframe!=2) && (subframe!=7)) {
LOG_E(PHY,"subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config); LOG_E(PHY, "subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n", subframe, frame_parms->tdd_config);
ret=255; ret = 255;
} }
else ret = (subframe/7); else ret = (subframe/7);
break; break;
...@@ -996,8 +996,7 @@ uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t ...@@ -996,8 +996,7 @@ uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t
} }
} }
AssertFatal(ret!=255, AssertFatal(ret != 255, "invalid harq_pid(%d) at SFN/SF = %d/%d\n", (int8_t)ret, frame, subframe);
"invalid harq_pid(%d) at SFN/SF = %d/%d\n", (int8_t)ret, frame, subframe);
return ret; return ret;
} }
......
...@@ -840,16 +840,16 @@ int allocate_REs_in_RB_no_pilots_16QAM_tm2(PHY_VARS_eNB* phy_vars_eNB, ...@@ -840,16 +840,16 @@ int allocate_REs_in_RB_no_pilots_16QAM_tm2(PHY_VARS_eNB* phy_vars_eNB,
(((uint32_t)x0p[4])<<5)|(((uint32_t)x0p[6])<<4)| (((uint32_t)x0p[4])<<5)|(((uint32_t)x0p[6])<<4)|
(((uint32_t)x0p[5])<<7)|(((uint32_t)x0p[7])<<6); (((uint32_t)x0p[5])<<7)|(((uint32_t)x0p[7])<<6);
txF0[0]=qam_table16_0[qam16_table_offset]; memcpy(txF0, &qam_table16_0[qam16_table_offset], sizeof(*txF0));
txF1[0]=qam_table16_1[qam16_table_offset]; memcpy(txF1, &qam_table16_1[qam16_table_offset], sizeof(*txF1));
x0p+=8; x0p+=8;
qam16_table_offset=(((uint32_t)x0p[0])<<1)|(((uint32_t)x0p[2]))| qam16_table_offset=(((uint32_t)x0p[0])<<1)|(((uint32_t)x0p[2]))|
(((uint32_t)x0p[1])<<3)|(((uint32_t)x0p[3])<<2) | (((uint32_t)x0p[1])<<3)|(((uint32_t)x0p[3])<<2) |
(((uint32_t)x0p[4])<<5)|(((uint32_t)x0p[6])<<4) | (((uint32_t)x0p[4])<<5)|(((uint32_t)x0p[6])<<4) |
(((uint32_t)x0p[5])<<7)|(((uint32_t)x0p[7])<<6); (((uint32_t)x0p[5])<<7)|(((uint32_t)x0p[7])<<6);
txF0[1]=qam_table16_0[qam16_table_offset]; memcpy(txF0 + 1, &qam_table16_0[qam16_table_offset], sizeof(*txF0));
txF1[1]=qam_table16_1[qam16_table_offset]; memcpy(txF1 + 1, &qam_table16_1[qam16_table_offset], sizeof(*txF1));
x0p+=8; x0p+=8;
qam16_table_offset=(((uint32_t)x0p[0])<<1)|(((uint32_t)x0p[2]))| qam16_table_offset=(((uint32_t)x0p[0])<<1)|(((uint32_t)x0p[2]))|
...@@ -857,8 +857,8 @@ int allocate_REs_in_RB_no_pilots_16QAM_tm2(PHY_VARS_eNB* phy_vars_eNB, ...@@ -857,8 +857,8 @@ int allocate_REs_in_RB_no_pilots_16QAM_tm2(PHY_VARS_eNB* phy_vars_eNB,
(((uint32_t)x0p[4])<<5)|(((uint32_t)x0p[6])<<4) | (((uint32_t)x0p[4])<<5)|(((uint32_t)x0p[6])<<4) |
(((uint32_t)x0p[5])<<7)|(((uint32_t)x0p[7])<<6); (((uint32_t)x0p[5])<<7)|(((uint32_t)x0p[7])<<6);
txF0[2]=qam_table16_0[qam16_table_offset]; memcpy(txF0 + 2, &qam_table16_0[qam16_table_offset], sizeof(*txF0));
txF1[2]=qam_table16_1[qam16_table_offset]; memcpy(txF1 + 2, &qam_table16_1[qam16_table_offset], sizeof(*txF1));
if(skip_half==0) { if(skip_half==0) {
if (skip_dc>0) { if (skip_dc>0) {
...@@ -872,23 +872,23 @@ int allocate_REs_in_RB_no_pilots_16QAM_tm2(PHY_VARS_eNB* phy_vars_eNB, ...@@ -872,23 +872,23 @@ int allocate_REs_in_RB_no_pilots_16QAM_tm2(PHY_VARS_eNB* phy_vars_eNB,
(((uint32_t)x0p[4])<<5)|(((uint32_t)x0p[6])<<4) | (((uint32_t)x0p[4])<<5)|(((uint32_t)x0p[6])<<4) |
(((uint32_t)x0p[5])<<7)|(((uint32_t)x0p[7])<<6); (((uint32_t)x0p[5])<<7)|(((uint32_t)x0p[7])<<6);
txF0[3]=qam_table16_0[qam16_table_offset]; memcpy(txF0 + 3, &qam_table16_0[qam16_table_offset], sizeof(*txF0));
txF1[3]=qam_table16_1[qam16_table_offset]; memcpy(txF1 + 3, &qam_table16_1[qam16_table_offset], sizeof(*txF1));
x0p+=8; x0p+=8;
qam16_table_offset=(((uint32_t)x0p[0])<<1)|(((uint32_t)x0p[2]))| qam16_table_offset=(((uint32_t)x0p[0])<<1)|(((uint32_t)x0p[2]))|
(((uint32_t)x0p[1])<<3)|(((uint32_t)x0p[3])<<2) | (((uint32_t)x0p[1])<<3)|(((uint32_t)x0p[3])<<2) |
(((uint32_t)x0p[4])<<5)|(((uint32_t)x0p[6])<<4) | (((uint32_t)x0p[4])<<5)|(((uint32_t)x0p[6])<<4) |
(((uint32_t)x0p[5])<<7)|(((uint32_t)x0p[7])<<6); (((uint32_t)x0p[5])<<7)|(((uint32_t)x0p[7])<<6);
txF0[4]=qam_table16_0[qam16_table_offset]; memcpy(txF0 + 4, &qam_table16_0[qam16_table_offset], sizeof(*txF0));
txF1[4]=qam_table16_1[qam16_table_offset]; memcpy(txF1 + 4, &qam_table16_1[qam16_table_offset], sizeof(*txF1));
x0p+=8; x0p+=8;
qam16_table_offset=(((uint32_t)x0p[0])<<1)|(((uint32_t)x0p[2]))| qam16_table_offset=(((uint32_t)x0p[0])<<1)|(((uint32_t)x0p[2]))|
(((uint32_t)x0p[1])<<3)|(((uint32_t)x0p[3])<<2) | (((uint32_t)x0p[1])<<3)|(((uint32_t)x0p[3])<<2) |
(((uint32_t)x0p[4])<<5)|(((uint32_t)x0p[6])<<4) | (((uint32_t)x0p[4])<<5)|(((uint32_t)x0p[6])<<4) |
(((uint32_t)x0p[5])<<7)|(((uint32_t)x0p[7])<<6); (((uint32_t)x0p[5])<<7)|(((uint32_t)x0p[7])<<6);
txF0[5]=qam_table16_0[qam16_table_offset]; memcpy(txF0 + 5, &qam_table16_0[qam16_table_offset], sizeof(*txF0));
txF1[5]=qam_table16_1[qam16_table_offset]; memcpy(txF1 + 5, &qam_table16_1[qam16_table_offset], sizeof(*txF1));
} }
if(skip_half!=0) if(skip_half!=0)
{ {
......
...@@ -4706,7 +4706,8 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF, ...@@ -4706,7 +4706,8 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
} }
if (rb_alloc_ind==1) { if (rb_alloc_ind==1) {
*pmi_ext = (pmi>>((rb>>2)<<1))&3; uint32_t tmp = (rb >> 2) << 1;
*pmi_ext = tmp >= 16 ? 0 : (pmi >> tmp) & 3;
memcpy(dl_ch0_ext,dl_ch0,12*sizeof(int)); memcpy(dl_ch0_ext,dl_ch0,12*sizeof(int));
/* /*
......
...@@ -146,7 +146,19 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb ...@@ -146,7 +146,19 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb
PHY_MEASUREMENTS_gNB *measurements = &gNB->measurements; PHY_MEASUREMENTS_gNB *measurements = &gNB->measurements;
int rb, nb_symb[275]={0}; int rb, nb_symb[275]={0};
memset(measurements->n0_subband_power, 0, sizeof(measurements->n0_subband_power)); allocCast2D(n0_subband_power,
unsigned int,
gNB->measurements.n0_subband_power,
frame_parms->nb_antennas_rx,
frame_parms->N_RB_UL,
false);
clearArray(gNB->measurements.n0_subband_power, unsigned int);
allocCast2D(n0_subband_power_dB,
unsigned int,
gNB->measurements.n0_subband_power_dB,
frame_parms->nb_antennas_rx,
frame_parms->N_RB_UL,
false);
for (int s=first_symb;s<(first_symb+num_symb);s++) { for (int s=first_symb;s<(first_symb+num_symb);s++) {
int offset0 = ((slot&3)*frame_parms->symbols_per_slot + s) * frame_parms->ofdm_symbol_size; int offset0 = ((slot&3)*frame_parms->symbols_per_slot + s) * frame_parms->ofdm_symbol_size;
...@@ -166,7 +178,7 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb ...@@ -166,7 +178,7 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb
} else { } else {
signal_energy = signal_energy_nodc(ul_ch, 12); signal_energy = signal_energy_nodc(ul_ch, 12);
} }
measurements->n0_subband_power[aarx][rb] += signal_energy; n0_subband_power[aarx][rb] += signal_energy;
LOG_D(PHY,"slot %d symbol %d RB %d aarx %d n0_subband_power %d\n", slot, s, rb, aarx, signal_energy); LOG_D(PHY,"slot %d symbol %d RB %d aarx %d n0_subband_power %d\n", slot, s, rb, aarx, signal_energy);
} //antenna } //antenna
} }
...@@ -182,10 +194,10 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb ...@@ -182,10 +194,10 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb
int32_t n0_subband_tot_perPRB=0; int32_t n0_subband_tot_perPRB=0;
if (nb_symb[rb] > 0) { if (nb_symb[rb] > 0) {
for (int aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++) { for (int aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++) {
measurements->n0_subband_power[aarx][rb]/=nb_symb[rb]; n0_subband_power[aarx][rb] /= nb_symb[rb];
measurements->n0_subband_power_dB[aarx][rb] = dB_fixed(measurements->n0_subband_power[aarx][rb]); n0_subband_power_dB[aarx][rb] = dB_fixed(n0_subband_power[aarx][rb]);
n0_subband_tot_perPRB+=measurements->n0_subband_power[aarx][rb]; n0_subband_tot_perPRB += n0_subband_power[aarx][rb];
n0_subband_tot_perANT[aarx]+=measurements->n0_subband_power[aarx][rb]; n0_subband_tot_perANT[aarx] += n0_subband_power[aarx][rb];
} }
n0_subband_tot_perPRB/=frame_parms->nb_antennas_rx; n0_subband_tot_perPRB/=frame_parms->nb_antennas_rx;
measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_subband_tot_perPRB); measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_subband_tot_perPRB);
...@@ -218,30 +230,31 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB, ...@@ -218,30 +230,31 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB,
unsigned short rx_power_avg_dB; unsigned short rx_power_avg_dB;
unsigned short rx_power_tot_dB; unsigned short rx_power_tot_dB;
double rx_gain = openair0_cfg[0].rx_gain[0]; double rx_gain = openair0_cfg[0].rx_gain[0];
double rx_gain_offset = openair0_cfg[0].rx_gain_offset[0]; double rx_gain_offset = openair0_cfg[0].rx_gain_offset[0];
PHY_MEASUREMENTS_gNB *meas = &gNB->measurements; PHY_MEASUREMENTS_gNB *meas = &gNB->measurements;
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
int ch_offset = fp->ofdm_symbol_size * symbol; int ch_offset = fp->ofdm_symbol_size * symbol;
int N_RB_UL = ulsch->harq_process->ulsch_pdu.rb_size; int N_RB_UL = ulsch->harq_process->ulsch_pdu.rb_size;
ulsch_measurements_gNB *ulsch_measurements = &ulsch->ulsch_measurements; ulsch_measurements_gNB *ulsch_measurements = &ulsch->ulsch_measurements;
int rx_power[fp->nb_antennas_rx]; int rx_power[fp->nb_antennas_rx];
allocCast2D(rx_spatial_power, int, ulsch_measurements->rx_spatial_power, nrOfLayers, fp->nb_antennas_rx, true);
allocCast2D(rx_spatial_power_dB, unsigned short, ulsch_measurements->rx_spatial_power_dB, nrOfLayers, fp->nb_antennas_rx, true);
for (int aarx = 0; aarx < fp->nb_antennas_rx; aarx++){ for (int aarx = 0; aarx < fp->nb_antennas_rx; aarx++){
rx_power[aarx] = 0; rx_power[aarx] = 0;
for (int aatx = 0; aatx < nrOfLayers; aatx++){ for (int aatx = 0; aatx < nrOfLayers; aatx++){
ulsch_measurements->rx_spatial_power[aatx][aarx] = rx_spatial_power[aatx][aarx] =
(signal_energy_nodc(&pusch_vars->ul_ch_estimates[aatx * fp->nb_antennas_rx + aarx][ch_offset], (signal_energy_nodc(&pusch_vars->ul_ch_estimates[aatx * fp->nb_antennas_rx + aarx][ch_offset],
N_RB_UL * NR_NB_SC_PER_RB)); N_RB_UL * NR_NB_SC_PER_RB));
if (ulsch_measurements->rx_spatial_power[aatx][aarx] < 0) { if (rx_spatial_power[aatx][aarx] < 0) {
ulsch_measurements->rx_spatial_power[aatx][aarx] = 0; rx_spatial_power[aatx][aarx] = 0;
} }
ulsch_measurements->rx_spatial_power_dB[aatx][aarx] = rx_spatial_power_dB[aatx][aarx] = (unsigned short)dB_fixed(rx_spatial_power[aatx][aarx]);
(unsigned short)dB_fixed(ulsch_measurements->rx_spatial_power[aatx][aarx]); rx_power[aarx] += rx_spatial_power[aatx][aarx];
rx_power[aarx] += ulsch_measurements->rx_spatial_power[aatx][aarx];
} }
LOG_D(PHY, "[RNTI %04x] RX power in antenna %d = %d\n", ulsch->rnti, aarx, rx_power[aarx]); LOG_D(PHY, "[RNTI %04x] RX power in antenna %d = %d\n", ulsch->rnti, aarx, rx_power[aarx]);
......
...@@ -72,7 +72,11 @@ void nr_chest_time_domain_avg(NR_DL_FRAME_PARMS *frame_parms, ...@@ -72,7 +72,11 @@ void nr_chest_time_domain_avg(NR_DL_FRAME_PARMS *frame_parms,
uint16_t dmrs_bitmap, uint16_t dmrs_bitmap,
uint16_t num_rbs); uint16_t num_rbs);
static inline uint8_t is_dmrs_symbol(uint8_t l, uint16_t dmrsSymbMask ) { return ((dmrsSymbMask >> l) & 0x1); } static inline uint8_t is_dmrs_symbol(uint8_t l, uint16_t dmrsSymbMask)
{
DevAssert(l < 32);
return ((dmrsSymbMask >> l) & 0x1);
}
#undef EXTERN #undef EXTERN
#endif /* DMRS_NR_H */ #endif /* DMRS_NR_H */
......
...@@ -373,7 +373,7 @@ int8_t nr_ptrs_process_slot(uint16_t dmrsSymbPos, ...@@ -373,7 +373,7 @@ int8_t nr_ptrs_process_slot(uint16_t dmrsSymbPos,
} }
/* check for left side first */ /* check for left side first */
/* right side a DMRS symbol then we need to left extrapolate */ /* right side a DMRS symbol then we need to left extrapolate */
if(is_dmrs_symbol(rightRef,dmrsSymbPos)) { if (rightRef != -1 && is_dmrs_symbol(rightRef, dmrsSymbPos)) {
/* calculate slope from next valid estimates*/ /* calculate slope from next valid estimates*/
tmp = get_next_estimate_in_slot(ptrsSymbPos,dmrsSymbPos,rightRef+1,symbInSlot); tmp = get_next_estimate_in_slot(ptrsSymbPos,dmrsSymbPos,rightRef+1,symbInSlot);
/* Special case when DMRS is not followed by PTRS symbol then reuse old slope */ /* Special case when DMRS is not followed by PTRS symbol then reuse old slope */
...@@ -382,22 +382,19 @@ int8_t nr_ptrs_process_slot(uint16_t dmrsSymbPos, ...@@ -382,22 +382,19 @@ int8_t nr_ptrs_process_slot(uint16_t dmrsSymbPos,
} }
ptrs_estimate_from_slope(estPerSymb,slope_p,leftRef, rightRef); ptrs_estimate_from_slope(estPerSymb,slope_p,leftRef, rightRef);
symb = rightRef -1; symb = rightRef -1;
} } else if (rightRef != -1 && is_ptrs_symbol(rightRef, ptrsSymbPos)) {
else if(is_ptrs_symbol(rightRef,ptrsSymbPos)) {
/* calculate slope from next valid estimates */ /* calculate slope from next valid estimates */
get_slope_from_estimates(leftRef,rightRef,estPerSymb, slope_p); get_slope_from_estimates(leftRef,rightRef,estPerSymb, slope_p);
ptrs_estimate_from_slope(estPerSymb,slope_p,leftRef, rightRef); ptrs_estimate_from_slope(estPerSymb,slope_p,leftRef, rightRef);
symb = rightRef -1; symb = rightRef -1;
} } else if ((rightRef == -1) && (symb < symbInSlot)) {
else if((rightRef ==-1) && (symb <symbInSlot)) {
// in right extrapolation use the last slope // in right extrapolation use the last slope
#ifdef DEBUG_PTRS #ifdef DEBUG_PTRS
printf("[PHY][PTRS]: Last Slop Reused :(%4f %4f)\n", slope_p[0],slope_p[1]); printf("[PHY][PTRS]: Last Slop Reused :(%4f %4f)\n", slope_p[0],slope_p[1]);
#endif #endif
ptrs_estimate_from_slope(estPerSymb,slope_p,symb-1,symbInSlot); ptrs_estimate_from_slope(estPerSymb,slope_p,symb-1,symbInSlot);
symb = symbInSlot; symb = symbInSlot;
} } else {
else {
printf("Wrong PTRS Setup, PTRS compensation will be skipped !"); printf("Wrong PTRS Setup, PTRS compensation will be skipped !");
return -1; return -1;
} }
......
...@@ -404,43 +404,68 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, ...@@ -404,43 +404,68 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
} }
} }
else { else {
__m64 *txF=(__m64*)&txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size+start_sc)<<1)]; __m128i *txF = (__m128i *)&txdataF_precoding[nl][((l * frame_parms->ofdm_symbol_size + start_sc) << 1)];
__m64 *txl = (__m64*)&tx_layers[nl][m<<1]; __m128i *txl = (__m128i *)&tx_layers[nl][m << 1];
__m64 amp64=_mm_set1_pi16(amp); __m128i amp64 = _mm_set1_epi16(amp);
for (int i=0; i<(upper_limit>>1); i++) { int i;
for (i = 0; i < (upper_limit >> 2); i++) {
txF[i] = _mm_mulhrs_pi16(amp64,txl[i]); const __m128i txL = _mm_loadu_si128(txl + i);
_mm_storeu_si128(txF + i, _mm_mulhrs_epi16(amp64, txL));
#ifdef DEBUG_DLSCH_MAPPING #ifdef DEBUG_DLSCH_MAPPING
if ((i&1) > 0) if ((i&1) > 0)
printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", printf("m %d\t l %d \t k %d \t txdataF: %d %d\n",
m, l, start_sc+(i>>1), txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1)], m,
txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + 1]); l,
start_sc + (i >> 1),
txdataF_precoding[nl][((l * frame_parms->ofdm_symbol_size + start_sc + (i >> 1)) << 1)],
txdataF_precoding[nl][((l * frame_parms->ofdm_symbol_size + start_sc + (i >> 1)) << 1) + 1]);
#endif #endif
/* handle this, mute RE */ /* handle this, mute RE */
/*else { /*else {
txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0; txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0;
txdataF_precoding[anl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0; txdataF_precoding[anl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0;
}*/ }*/
} //RE loop, first part }
if (i * 4 != upper_limit) {
c16_t *txFc = (c16_t *)&txdataF_precoding[nl][((l * frame_parms->ofdm_symbol_size + start_sc) << 1)];
c16_t *txlc = (c16_t *)&tx_layers[nl][m << 1];
for (i = (upper_limit >> 2) << 2; i < upper_limit; i++) {
txFc[i].r = ((txlc[i].r * amp) >> 14) + 1;
txFc[i].i = ((txlc[i].i * amp) >> 14) + 1;
}
}
m+=upper_limit; m+=upper_limit;
if (remaining_re > 0) { if (remaining_re > 0) {
txF = (__m64*)&txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size)<<1)]; txF = (__m128i *)&txdataF_precoding[nl][((l * frame_parms->ofdm_symbol_size) << 1)];
txl = (__m64*)&tx_layers[nl][m<<1]; txl = (__m128i *)&tx_layers[nl][m << 1];
for (int i=0; i<(remaining_re>>1); i++) { int i;
txF[i] = _mm_mulhrs_pi16(amp64,txl[i]); for (i = 0; i < (remaining_re >> 2); i++) {
const __m128i txL = _mm_loadu_si128(txl + i);
_mm_storeu_si128(txF + i, _mm_mulhrs_epi16(amp64, txL));
#ifdef DEBUG_DLSCH_MAPPING #ifdef DEBUG_DLSCH_MAPPING
if ((i&1) > 0) if ((i & 1) > 0)
printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", printf("m %d\t l %d \t k %d \t txdataF: %d %d\n",
m, l, i>>1, txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) ], m,
txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + 1]); l,
i >> 1,
txdataF_precoding[nl][((l * frame_parms->ofdm_symbol_size + (i >> 1)) << 1)],
txdataF_precoding[nl][((l * frame_parms->ofdm_symbol_size + (i >> 1)) << 1) + 1]);
#endif #endif
/* handle this, mute RE */ /* handle this, mute RE */
/*else { /*else {
txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0; txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0;
txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0; txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0;
}*/ }*/
} //RE loop, second part } // RE loop, second part
if (i * 4 != remaining_re) {
c16_t *txFc = (c16_t *)&txdataF_precoding[nl][((l * frame_parms->ofdm_symbol_size) << 1)];
c16_t *txlc = (c16_t *)&tx_layers[nl][m << 1];
for (i = (remaining_re >> 2) << 2; i < remaining_re; i++) {
txFc[i].r = ((txlc[i].r * amp) >> 14) + 1;
txFc[i].i = ((txlc[i].i * amp) >> 14) + 1;
}
}
} // } //
m+=remaining_re; m+=remaining_re;
} // N_RB_DL even } // N_RB_DL even
......
...@@ -176,8 +176,9 @@ void nr_ulsch_channel_level(int **ul_ch_estimates_ext, ...@@ -176,8 +176,9 @@ void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
/** \brief This function performs channel compensation (matched filtering) on the received RBs for this allocation. In addition, it computes the squared-magnitude of the channel with weightings for 16QAM/64QAM detection as well as dual-stream detection (cross-correlation) /** \brief This function performs channel compensation (matched filtering) on the received RBs for this allocation. In addition, it computes the squared-magnitude of the channel with weightings for 16QAM/64QAM detection as well as dual-stream detection (cross-correlation)
@param rxdataF_ext Frequency-domain received signal in RBs to be demodulated @param rxdataF_ext Frequency-domain received signal in RBs to be demodulated
@param ul_ch_estimates_ext Frequency-domain channel estimates in RBs to be demodulated @param ul_ch_estimates_ext Frequency-domain channel estimates in RBs to be demodulated
@param ul_ch_mag First Channel magnitudes (16QAM/64QAM) @param ul_ch_mag First Channel magnitudes (16QAM/64QAM/256QAM)
@param ul_ch_magb Second weighted Channel magnitudes (64QAM) @param ul_ch_magb Second weighted Channel magnitudes (64QAM/256QAM)
@param ul_ch_magc Third weighted Channel magnitudes (256QAM)
@param rxdataF_comp Compensated received waveform @param rxdataF_comp Compensated received waveform
@param frame_parms Pointer to frame descriptor @param frame_parms Pointer to frame descriptor
@param symbol Symbol on which to operate @param symbol Symbol on which to operate
...@@ -189,6 +190,7 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext, ...@@ -189,6 +190,7 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
int **ul_ch_estimates_ext, int **ul_ch_estimates_ext,
int **ul_ch_mag, int **ul_ch_mag,
int **ul_ch_magb, int **ul_ch_magb,
int **ul_ch_magc,
int **rxdataF_comp, int **rxdataF_comp,
int ***rho, int ***rho,
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
...@@ -250,6 +252,23 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp, ...@@ -250,6 +252,23 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp,
uint32_t nb_re, uint32_t nb_re,
uint8_t symbol); uint8_t symbol);
/** \brief This function generates log-likelihood ratios (decoder input) for single-stream 256 QAM received waveforms.
@param rxdataF_comp Compensated channel output
@param ul_ch_mag uplink channel magnitude multiplied by the 1st amplitude threshold in QAM 256
@param ul_ch_magb uplink channel magnitude multiplied by the 2bd amplitude threshold in QAM 256
@param ul_ch_magc uplink channel magnitude multiplied by the 3rd amplitude threshold in QAM 256
@param ulsch_llr llr output
@param nb_re number of REs for this allocation
@param symbol OFDM symbol index in sub-frame
*/
void nr_ulsch_256qam_llr(int32_t *rxdataF_comp,
int32_t **ul_ch_mag,
int32_t **ul_ch_magb,
int32_t **ul_ch_magc,
int16_t *ulsch_llr,
uint32_t nb_rb,
uint32_t nb_re,
uint8_t symbol);
/** \brief This function computes the log-likelihood ratios for 4, 16, and 64 QAM /** \brief This function computes the log-likelihood ratios for 4, 16, and 64 QAM
@param rxdataF_comp Compensated channel output @param rxdataF_comp Compensated channel output
...@@ -263,6 +282,7 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp, ...@@ -263,6 +282,7 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp,
void nr_ulsch_compute_llr(int32_t *rxdataF_comp, void nr_ulsch_compute_llr(int32_t *rxdataF_comp,
int32_t *ul_ch_mag, int32_t *ul_ch_mag,
int32_t *ul_ch_magb, int32_t *ul_ch_magb,
int32_t *ul_ch_magc,
int16_t *ulsch_llr, int16_t *ulsch_llr,
uint32_t nb_rb, uint32_t nb_rb,
uint32_t nb_re, uint32_t nb_re,
......
...@@ -88,8 +88,7 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_pusch_pdu_t ...@@ -88,8 +88,7 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_pusch_pdu_t
harq->round++; harq->round++;
memcpy(&ulsch->harq_process->ulsch_pdu, ulsch_pdu, sizeof(ulsch->harq_process->ulsch_pdu)); memcpy(&ulsch->harq_process->ulsch_pdu, ulsch_pdu, sizeof(ulsch->harq_process->ulsch_pdu));
LOG_D(PHY, "Initializing nFAPI for ULSCH, harq_pid %d, layers %d\n", harq_pid, ulsch_pdu->nrOfLayers);
LOG_D(PHY, "Initializing nFAPI for ULSCH, harq_pid %d\n", harq_pid);
} }
void reset_active_ulsch(PHY_VARS_gNB *gNB, int frame) void reset_active_ulsch(PHY_VARS_gNB *gNB, int frame)
......
...@@ -93,7 +93,7 @@ NR_gNB_ULSCH_t new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL) ...@@ -93,7 +93,7 @@ NR_gNB_ULSCH_t new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL)
} }
uint32_t ulsch_bytes = a_segments * 1056; // allocated bytes per segment uint32_t ulsch_bytes = a_segments * 1056; // allocated bytes per segment
NR_gNB_ULSCH_t ulsch; NR_gNB_ULSCH_t ulsch = {0};
ulsch.max_ldpc_iterations = max_ldpc_iterations; ulsch.max_ldpc_iterations = max_ldpc_iterations;
ulsch.harq_pid = -1; ulsch.harq_pid = -1;
......
...@@ -1704,8 +1704,10 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, ...@@ -1704,8 +1704,10 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
((int16_t*)&llrs[half_prb])[7]); ((int16_t*)&llrs[half_prb])[7]);
} // half_prb } // half_prb
} // symb } // symb
// run polar decoder on llrs // run polar decoder on llrs
decoderState = polar_decoder_int16((int16_t*)llrs, decodedPayload, 0, 2,nb_bit,pucch_pdu->prb_size); decoderState = polar_decoder_int16((int16_t *)llrs, decodedPayload, 0, NR_POLAR_UCI_PUCCH_MESSAGE_TYPE, nb_bit, pucch_pdu->prb_size);
LOG_D(PHY,"UCI decoderState %d, payload[0] %llu\n",decoderState,(unsigned long long)decodedPayload[0]); LOG_D(PHY,"UCI decoderState %d, payload[0] %llu\n",decoderState,(unsigned long long)decodedPayload[0]);
if (decoderState>0) decoderState=1; if (decoderState>0) decoderState=1;
corr_dB = dB_fixed64(corr); corr_dB = dB_fixed64(corr);
...@@ -1774,7 +1776,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, ...@@ -1774,7 +1776,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
} }
bit_left = pucch_pdu->bit_len_csi_part1-((csi_part1_bytes-1)<<3); bit_left = pucch_pdu->bit_len_csi_part1-((csi_part1_bytes-1)<<3);
uci_pdu->csi_part1.csi_part1_payload[i] = decodedPayload[0] & ((1<<bit_left)-1); uci_pdu->csi_part1.csi_part1_payload[i] = decodedPayload[0] & ((1<<bit_left)-1);
decodedPayload[0] >>= pucch_pdu->bit_len_csi_part1; decodedPayload[0] = pucch_pdu->bit_len_csi_part1 < 64 ? decodedPayload[0] >> pucch_pdu->bit_len_csi_part1 : 0;
} }
if (pucch_pdu->bit_len_csi_part2>0) { if (pucch_pdu->bit_len_csi_part2>0) {
......
...@@ -980,9 +980,8 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, c16_t r ...@@ -980,9 +980,8 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, c16_t r
fapi_nr_rx_indication_t rx_ind = {0}; fapi_nr_rx_indication_t rx_ind = {0};
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, NULL); nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, NULL);
nr_fill_rx_indication(&rx_ind, FAPI_NR_CSIRS_IND, ue, NULL, NULL, 1, proc, (void *)&csirs_measurements, NULL); nr_fill_rx_indication(&rx_ind, FAPI_NR_CSIRS_IND, ue, NULL, NULL, 1, proc, (void *)&csirs_measurements, NULL);
if (ue->if_inst && ue->if_inst->dl_indication) { if (ue->if_inst && ue->if_inst->dl_indication)
ue->if_inst->dl_indication(&dl_indication, NULL); ue->if_inst->dl_indication(&dl_indication);
}
return 0; return 0;
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -869,7 +869,6 @@ uint32_t tst_ue_get_SR(module_id_t module_idP,int CC_id,frame_t frameP,uint8_t e ...@@ -869,7 +869,6 @@ uint32_t tst_ue_get_SR(module_id_t module_idP,int CC_id,frame_t frameP,uint8_t e
*********************************************************************/ *********************************************************************/
void tst_set_sr_config(PHY_VARS_NR_UE *ue, int gNB_id) { void tst_set_sr_config(PHY_VARS_NR_UE *ue, int gNB_id) {
ue->mac_enabled = 1;
ue->scheduling_request_config[gNB_id].sr_ConfigIndex = 0; ue->scheduling_request_config[gNB_id].sr_ConfigIndex = 0;
p_nr_ue_get_SR = tst_ue_get_SR; p_nr_ue_get_SR = tst_ue_get_SR;
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment