Commit 861caa73 authored by laurent's avatar laurent

merge develop

parents 6bbf9011 e197824e
...@@ -14,7 +14,7 @@ eNBs = ...@@ -14,7 +14,7 @@ eNBs =
// Tracking area code, 0x0000 and 0xfffe are reserved values // Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1; tracking_area_code = 1;
plmn_list = ( { mcc = 208; mnc = 93; mnc_length = 2; } ); plmn_list = ( { mcc = 208; mnc = 92; mnc_length = 2; } );
tr_s_preference = "local_mac" tr_s_preference = "local_mac"
...@@ -171,7 +171,7 @@ eNBs = ...@@ -171,7 +171,7 @@ eNBs =
////////// MME parameters: ////////// MME parameters:
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; mme_ip_address = ( { ipv4 = "127.0.0.20";
ipv6 = "192:168:30::17"; ipv6 = "192:168:30::17";
active = "yes"; active = "yes";
preference = "ipv4"; preference = "ipv4";
...@@ -188,12 +188,13 @@ eNBs = ...@@ -188,12 +188,13 @@ eNBs =
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.10";
ENB_INTERFACE_NAME_FOR_S1U = "eth0"; ENB_INTERFACE_NAME_FOR_S1U = "lo";
ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.10";
ENB_PORT_FOR_S1U = 2152; # Spec 2152 ENB_PORT_FOR_S1U = 2152; # Spec 2152
ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR";
ENB_IPV4_ADDRESS_FOR_X2C = "127.0.0.1";
ENB_PORT_FOR_X2C = 36422; # Spec 36422 ENB_PORT_FOR_X2C = 36422; # Spec 36422
}; };
} }
...@@ -244,8 +245,8 @@ THREAD_STRUCT = ( ...@@ -244,8 +245,8 @@ THREAD_STRUCT = (
NETWORK_CONTROLLER : NETWORK_CONTROLLER :
{ {
FLEXRAN_ENABLED = "no"; FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "ens3"; FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR"; FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_PORT = 2210; FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache"; FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no"; FLEXRAN_AWAIT_RECONF = "no";
......
...@@ -1044,6 +1044,12 @@ class SSHConnection(): ...@@ -1044,6 +1044,12 @@ class SSHConnection():
logging.debug('Found a N3xx device --> resetting it') logging.debug('Found a N3xx device --> resetting it')
self.command('cd ' + self.UESourceCodePath, '\$', 5) self.command('cd ' + self.UESourceCodePath, '\$', 5)
# Initialize_OAI_UE_args usually start with -C and followed by the location in repository # Initialize_OAI_UE_args usually start with -C and followed by the location in repository
# in case of NR-UE, we may have rrc_config_path (Temporary?)
modifiedUeOptions = str(self.Initialize_OAI_UE_args)
if self.air_interface == 'nr':
result = re.search('--rrc_config_path ', modifiedUeOptions)
if result is not None:
modifiedUeOptions = modifiedUeOptions.replace('rrc_config_path ', 'rrc_config_path ' + self.UESourceCodePath + '/')
self.command('source oaienv', '\$', 5) self.command('source oaienv', '\$', 5)
self.command('cd cmake_targets/ran_build/build', '\$', 5) self.command('cd cmake_targets/ran_build/build', '\$', 5)
if self.air_interface == 'lte': if self.air_interface == 'lte':
...@@ -1058,7 +1064,7 @@ class SSHConnection(): ...@@ -1058,7 +1064,7 @@ class SSHConnection():
self.command('sed -e "s#93#92#" -e "s#8baf473f2f8fd09487cccbd7097c6862#fec86ba6eb707ed08905757b1bb44b8f#" -e "s#e734f8734007d6c5ce7a0508809e7e9c#C42449363BBAD02B66D16BC975D77CC1#" ../../../openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf > ../../../openair3/NAS/TOOLS/ci-ue_eurecom_test_sfr.conf', '\$', 5) self.command('sed -e "s#93#92#" -e "s#8baf473f2f8fd09487cccbd7097c6862#fec86ba6eb707ed08905757b1bb44b8f#" -e "s#e734f8734007d6c5ce7a0508809e7e9c#C42449363BBAD02B66D16BC975D77CC1#" ../../../openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf > ../../../openair3/NAS/TOOLS/ci-ue_eurecom_test_sfr.conf', '\$', 5)
self.command('echo ' + self.UEPassword + ' | sudo -S rm -Rf .u*', '\$', 5) self.command('echo ' + self.UEPassword + ' | sudo -S rm -Rf .u*', '\$', 5)
self.command('echo ' + self.UEPassword + ' | sudo -S ../../../targets/bin/conf2uedata -c ../../../openair3/NAS/TOOLS/ci-ue_eurecom_test_sfr.conf -o .', '\$', 5) self.command('echo ' + self.UEPassword + ' | sudo -S ../../../targets/bin/conf2uedata -c ../../../openair3/NAS/TOOLS/ci-ue_eurecom_test_sfr.conf -o .', '\$', 5)
self.command('echo "ulimit -c unlimited && ./'+ self.air_interface +'-uesoftmodem ' + self.Initialize_OAI_UE_args + '" > ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh', '\$', 5) self.command('echo "ulimit -c unlimited && ./'+ self.air_interface +'-uesoftmodem ' + modifiedUeOptions + '" > ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh', '\$', 5)
self.command('chmod 775 ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh', '\$', 5) self.command('chmod 775 ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh', '\$', 5)
self.command('echo ' + self.UEPassword + ' | sudo -S rm -Rf ' + self.UESourceCodePath + '/cmake_targets/ue_' + self.testCase_id + '.log', '\$', 5) self.command('echo ' + self.UEPassword + ' | sudo -S rm -Rf ' + self.UESourceCodePath + '/cmake_targets/ue_' + self.testCase_id + '.log', '\$', 5)
self.UELogFile = 'ue_' + self.testCase_id + '.log' self.UELogFile = 'ue_' + self.testCase_id + '.log'
...@@ -1105,6 +1111,9 @@ class SSHConnection(): ...@@ -1105,6 +1111,9 @@ class SSHConnection():
if result is not None: if result is not None:
self.command('echo ' + self.UEPassword + ' | sudo -S killall --signal=SIGINT -r *-uesoftmodem', '\$', 4) self.command('echo ' + self.UEPassword + ' | sudo -S killall --signal=SIGINT -r *-uesoftmodem', '\$', 4)
time.sleep(3) time.sleep(3)
outterLoopCounter = outterLoopCounter - 1
if (outterLoopCounter == 0):
doOutterLoop = False
continue continue
if self.air_interface == 'nr': if self.air_interface == 'nr':
fullSyncStatus = True fullSyncStatus = True
......
...@@ -182,7 +182,7 @@ function variant__v2__basic_sim { ...@@ -182,7 +182,7 @@ function variant__v2__basic_sim {
} }
function variant__v3__phy_sim { function variant__v3__phy_sim {
NB_PATTERN_FILES=12 NB_PATTERN_FILES=13
BUILD_OPTIONS="--phy_simulators" BUILD_OPTIONS="--phy_simulators"
VM_MEMORY=8192 VM_MEMORY=8192
VM_DISK=20 VM_DISK=20
......
...@@ -1199,7 +1199,7 @@ function start_rf_sim_gnb { ...@@ -1199,7 +1199,7 @@ function start_rf_sim_gnb {
echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
if [ $LOC_S1_CONFIGURATION -eq 0 ] if [ $LOC_S1_CONFIGURATION -eq 0 ]
then then
echo "echo \"RFSIMULATOR=server ./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim\" > ./my-nr-softmodem-run.sh " >> $1 echo "echo \"RFSIMULATOR=server ./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim --phy-test\" > ./my-nr-softmodem-run.sh " >> $1
fi fi
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1 echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
echo "cat ./my-nr-softmodem-run.sh" >> $1 echo "cat ./my-nr-softmodem-run.sh" >> $1
...@@ -1274,7 +1274,7 @@ function start_rf_sim_nr_ue { ...@@ -1274,7 +1274,7 @@ function start_rf_sim_nr_ue {
echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
if [ $LOC_S1_CONFIGURATION -eq 0 ] if [ $LOC_S1_CONFIGURATION -eq 0 ]
then then
echo "echo \"RFSIMULATOR=${LOC_GNB_VM_IP_ADDR} ./nr-uesoftmodem --numerology 1 -C ${LOC_FREQUENCY}000000 -r $LOC_PRB --nokrnmod 1 --rfsim --log_config.global_log_options level,nocolor --noS1\" > ./my-nr-softmodem-run.sh " >> $1 echo "echo \"RFSIMULATOR=${LOC_GNB_VM_IP_ADDR} ./nr-uesoftmodem --nokrnmod 1 --rfsim --phy-test --rrc_config_path /home/ubuntu/tmp/ci-scripts/rrc-files --log_config.global_log_options level,nocolor --noS1\" > ./my-nr-softmodem-run.sh " >> $1
fi fi
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1 echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
echo "cat ./my-nr-softmodem-run.sh" >> $1 echo "cat ./my-nr-softmodem-run.sh" >> $1
...@@ -1285,7 +1285,7 @@ function start_rf_sim_nr_ue { ...@@ -1285,7 +1285,7 @@ function start_rf_sim_nr_ue {
rm $1 rm $1
local i="0" local i="0"
echo "egrep -c \"rfsimulator: Success\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1 echo "egrep -c \"Initial sync: pbch decoded sucessfully\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1
while [ $i -lt 10 ] while [ $i -lt 10 ]
do do
sleep 5 sleep 5
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<htmlTabRef>run-oai-gnb-nr-ue</htmlTabRef> <htmlTabRef>run-oai-gnb-nr-ue</htmlTabRef>
<htmlTabName>Run-gNB-and-NR-UE</htmlTabName> <htmlTabName>Run-gNB-and-NR-UE</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon> <htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>4</repeatCount> <repeatCount>2</repeatCount>
<TestCaseRequestedList> <TestCaseRequestedList>
090101 000001 090102 000002 090108 090109 090101 000001 090102 000002 090108 090109
</TestCaseRequestedList> </TestCaseRequestedList>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<testCase id="090101"> <testCase id="090101">
<class>Initialize_eNB</class> <class>Initialize_eNB</class>
<desc>Initialize gNB USRP</desc> <desc>Initialize gNB USRP</desc>
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf</Initialize_eNB_args> <Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf --phy-test</Initialize_eNB_args>
<air_interface>NR</air_interface> <air_interface>NR</air_interface>
</testCase> </testCase>
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<testCase id="090102"> <testCase id="090102">
<class>Initialize_OAI_UE</class> <class>Initialize_OAI_UE</class>
<desc>Initialize NR UE USRP</desc> <desc>Initialize NR UE USRP</desc>
<Initialize_OAI_UE_args>-C 3510000000 --numerology 1 -r 106 --phy-test --usrp-args "addr=192.168.30.2,clock_source=external,time_source=external" --threadoffset 16</Initialize_OAI_UE_args> <Initialize_OAI_UE_args>--phy-test --usrp-args "addr=192.168.30.2,second_addr=192.168.50.2,clock_source=external,time_source=external" --threadoffset 16 --rrc_config_path ci-scripts/rrc-files</Initialize_OAI_UE_args>
<air_interface>NR</air_interface> <air_interface>NR</air_interface>
</testCase> </testCase>
......
This diff is collapsed.
...@@ -1082,32 +1082,31 @@ ...@@ -1082,32 +1082,31 @@
<desc>nr_dlsim Test cases. (Test1: 106 PRB), <desc>nr_dlsim Test cases. (Test1: 106 PRB),
(Test2: 217 PRB), (Test2: 217 PRB),
(Test3: 273 PRB), (Test3: 273 PRB),
(Test4: 106 PRB 12 CSET-Offset), (Test4: 106 PRB 25 PDSCH-Offset),
(Test5: 217 PRB 48 CSET-Offset), (Test5: 106 PRB 51 PDSCH-Offset),
(Test6: 106 PRB 25 PDSCH-Offset), (Test6: 217 PRB 100 PDSCH-PRBs),
(Test7: 106 PRB 51 PDSCH-Offset), (Test7: 217 PRB 80 PDSCH-Offset),
(Test8: 217 PRB 100 PDSCH-PRBs), (Test8: 217 PRB 100 PDSCH-PRBs 110 PDSCH-Offset),
(Test9: 217 PRB 80 PDSCH-Offset), (Test9: 106 PRBs 50 PDSCH-PRBs MCS Index 27)
(Test10: 217 PRB 100 PDSCH-PRBs 110 PDSCH-Offset), (Test10: 106 PRBs 50 PDSCH-PRBs MCS Index 16)</desc>
(Test11: 106 PRBs 50 PDSCH-PRBs MCS Index 28</desc>
<pre_compile_prog></pre_compile_prog> <pre_compile_prog></pre_compile_prog>
<compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
<compile_prog_args> --phy_simulators -c </compile_prog_args> <compile_prog_args> --phy_simulators -c </compile_prog_args>
<pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec> <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
<pre_exec_args></pre_exec_args> <pre_exec_args></pre_exec_args>
<main_exec> $OPENAIR_DIR/targets/bin/nr_dlsim.Rel15</main_exec> <main_exec> $OPENAIR_DIR/targets/bin/nr_dlsim.Rel15</main_exec>
<main_exec_args>-n100 -R106 -b106 <main_exec_args>-n100 -R106 -b106 -s5
-n100 -R217 -b217 -n100 -R217 -b217 -s5
-n100 -R273 -b273 -n100 -R273 -b273 -s5
-n100 -R106 -o12 -n100 -R106 -a25 -s5
-n100 -R217 -o48 -n100 -R106 -a51 -s5
-n100 -R106 -a25 -n100 -R217 -b100 -s5
-n100 -R106 -a51 -n100 -R217 -a80 -s5
-n100 -R217 -b100 -n100 -R217 -a110 -s5 -b100
-n100 -R217 -a80 -n100 -e27 -s30
-n100 -R217 -a110 -b100 -n100 -e16 -s10
-n100 -e28</main_exec_args> </main_exec_args>
<tags>nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10 nr_dlsim.test11</tags> <tags>nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10 </tags>
<search_expr_true>PDSCH test OK</search_expr_true> <search_expr_true>PDSCH 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>
...@@ -1249,11 +1248,11 @@ ...@@ -1249,11 +1248,11 @@
<pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec> <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
<pre_exec_args></pre_exec_args> <pre_exec_args></pre_exec_args>
<main_exec> $OPENAIR_DIR/targets/bin/nr_ulsim.Rel15</main_exec> <main_exec> $OPENAIR_DIR/targets/bin/nr_ulsim.Rel15</main_exec>
<main_exec_args>-f100 -m9 -r106 -s10 <main_exec_args>-n100 -m9 -r106 -s0
-f100 -m16 -s20 -n100 -m16 -s10
-f100 -m28 -s30 -n100 -m28 -s20
-f100 -m9 -R217 -r217 -s10 -n100 -m9 -R217 -r217 -s0
-f100 -m9 -R273 -r273 -s10</main_exec_args> -n100 -m9 -R273 -r273 -s0</main_exec_args>
<tags>nr_ulsim.test1 nr_ulsim.test2 nr_ulsim.test3 nr_ulsim.test4 nr_ulsim.test5</tags> <tags>nr_ulsim.test1 nr_ulsim.test2 nr_ulsim.test3 nr_ulsim.test4 nr_ulsim.test5</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>
......
...@@ -697,7 +697,7 @@ function main() { ...@@ -697,7 +697,7 @@ function main() {
if [ "$SIMUS_PHY" = "1" ] ; then if [ "$SIMUS_PHY" = "1" ] ; then
echo_info "Compiling physical unitary tests simulators" echo_info "Compiling physical unitary tests simulators"
# TODO: fix: dlsim_tm4 pucchsim prachsim pdcchsim pbchsim mbmssim # TODO: fix: dlsim_tm4 pucchsim prachsim pdcchsim pbchsim mbmssim
simlist="dlsim ulsim ldpctest polartest smallblocktest nr_pbchsim nr_dlschsim nr_ulschsim nr_dlsim nr_ulsim nr_pucchsim" simlist="dlsim ulsim ldpctest polartest smallblocktest nr_pbchsim nr_dlschsim nr_ulschsim nr_dlsim nr_ulsim nr_pucchsim nr_prachsim"
for f in $simlist ; do for f in $simlist ; do
compilations \ compilations \
phy_simulators $f \ phy_simulators $f \
......
...@@ -224,7 +224,6 @@ int config_get(paramdef_t *params, int numparams, char *prefix) { ...@@ -224,7 +224,6 @@ int config_get(paramdef_t *params, int numparams, char *prefix) {
} }
configmodule_interface_t *cfgif = config_get_if(); configmodule_interface_t *cfgif = config_get_if();
if (cfgif != NULL) { if (cfgif != NULL) {
ret = config_get_if()->get(params, numparams, prefix); ret = config_get_if()->get(params, numparams, prefix);
......
...@@ -85,8 +85,6 @@ typedef struct { ...@@ -85,8 +85,6 @@ typedef struct {
int nb_nr_L1_inst; int nb_nr_L1_inst;
/// Number of Component Carriers per instance in this node /// Number of Component Carriers per instance in this node
int *nb_L1_CC; int *nb_L1_CC;
/// Number of NR Component Carriers per instance in this node
int *nb_nr_L1_CC;
/// Number of RU instances in this node /// Number of RU instances in this node
int nb_RU; int nb_RU;
/// FlexRAN context variables /// FlexRAN context variables
...@@ -94,7 +92,7 @@ typedef struct { ...@@ -94,7 +92,7 @@ typedef struct {
/// eNB context variables /// eNB context variables
struct PHY_VARS_eNB_s ***eNB; struct PHY_VARS_eNB_s ***eNB;
/// gNB context variables /// gNB context variables
struct PHY_VARS_gNB_s ***gNB; struct PHY_VARS_gNB_s **gNB;
/// NB_IoT L1 context variables /// NB_IoT L1 context variables
struct PHY_VARS_eNB_NB_IoT_s **L1_NB_IoT; struct PHY_VARS_eNB_NB_IoT_s **L1_NB_IoT;
/// RRC context variables /// RRC context variables
......
...@@ -514,7 +514,8 @@ const char* eurecomFunctionsNames[] = { ...@@ -514,7 +514,8 @@ const char* eurecomFunctionsNames[] = {
/*NR softmodem signal*/ /*NR softmodem signal*/
"wakeup_txfh", "wakeup_txfh",
"gNB_thread_rxtx0", "gNB_thread_rxtx0",
"gNB_thread_rxtx1" "gNB_thread_rxtx1",
"ru_thread_tx_wait"
}; };
struct vcd_module_s vcd_modules[] = { struct vcd_module_s vcd_modules[] = {
......
...@@ -507,6 +507,7 @@ typedef enum { ...@@ -507,6 +507,7 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_WAKEUP_TXFH, VCD_SIGNAL_DUMPER_FUNCTIONS_WAKEUP_TXFH,
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX0, VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX0,
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1, VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1,
VCD_SIGNAL_DUMPER_FUNCTIONS_RU_TX_WAIT,
VCD_SIGNAL_DUMPER_FUNCTIONS_END VCD_SIGNAL_DUMPER_FUNCTIONS_END
} vcd_signal_dump_functions; } vcd_signal_dump_functions;
......
...@@ -73,7 +73,7 @@ typedef struct { ...@@ -73,7 +73,7 @@ typedef struct {
} T_cache_t; } T_cache_t;
/* number of VCD functions (to be kept up to date! see in T_messages.txt) */ /* number of VCD functions (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_FUNCTIONS (247) #define VCD_NUM_FUNCTIONS (248)
/* number of VCD variables (to be kept up to date! see in T_messages.txt) */ /* number of VCD variables (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_VARIABLES (186) #define VCD_NUM_VARIABLES (186)
......
...@@ -3378,3 +3378,8 @@ ID = VCD_FUNCTION_gNB_PROC_RXTX1 ...@@ -3378,3 +3378,8 @@ ID = VCD_FUNCTION_gNB_PROC_RXTX1
GROUP = ALL:VCD:ENB:VCD_FUNCTION GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value FORMAT = int,value
VCD_NAME = gNB_thread_rxtx1 VCD_NAME = gNB_thread_rxtx1
ID = VCD_FUNCTION_RU_TX_WAIT
DESC = VCD function RU_TX_WAIT
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = ru_thread_tx_wait
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/* \file config_ue.c
* \brief common utility functions for NR (gNB and UE)
* \author R. Knopp,
* \date 2019
* \version 0.1
* \company Eurecom
* \email: knopp@eurecom.fr
* \note
* \warning
*/
#include <stdint.h>
#include "assertions.h"
int NRRIV2BW(int locationAndBandwidth,int N_RB) {
int tmp = locationAndBandwidth/N_RB;
int tmp2 = locationAndBandwidth%N_RB;
if (tmp <= ((N_RB>>1)+1) && (tmp+tmp2)<N_RB) return(tmp+1);
else return(N_RB+1-tmp);
}
int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB) {
int tmp = locationAndBandwidth/N_RB;
int tmp2 = locationAndBandwidth%N_RB;
if (tmp <= ((N_RB>>1)+1) && (tmp+tmp2)<N_RB) return(tmp2);
else return(N_RB-1-tmp2);
}
int PRBalloc_to_locationandbandwidth0(int NPRB,int RBstart,int BWPsize) {
AssertFatal(NPRB>0 && (NPRB + RBstart <= BWPsize),"Illegal NPRB/RBstart Configuration (%d,%d) for BWPsize %d\n",NPRB,RBstart,BWPsize);
if (NPRB <= 1+(BWPsize>>1)) return(BWPsize*(NPRB-1)+RBstart);
else return(BWPsize*(BWPsize+1-NPRB) + (BWPsize-1-RBstart));
}
int PRBalloc_to_locationandbandwidth(int NPRB,int RBstart) {
return(PRBalloc_to_locationandbandwidth0(NPRB,RBstart,275));
}
/// Target code rate tables indexed by Imcs
uint16_t nr_target_code_rate_table1[29] = {120, 157, 193, 251, 308, 379, 449, 526, 602, 679, 340, 378, 434, 490, 553, \
616, 658, 438, 466, 517, 567, 616, 666, 719, 772, 822, 873, 910, 948};
// Imcs values 20 and 26 have been multiplied by 2 to avoid the floating point
uint16_t nr_target_code_rate_table2[28] = {120, 193, 308, 449, 602, 378, 434, 490, 553, 616, 658, 466, 517, 567, \
616, 666, 719, 772, 822, 873, 1365, 711, 754, 797, 841, 885, 1833, 948};
uint16_t nr_target_code_rate_table3[29] = {30, 40, 50, 64, 78, 99, 120, 157, 193, 251, 308, 379, 449, 526, 602, 340, \
378, 434, 490, 553, 616, 438, 466, 517, 567, 616, 666, 719, 772};
uint16_t nr_tbs_table[93] = {24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 208, 224, 240, 256, 272, 288, 304, 320, \
336, 352, 368, 384, 408, 432, 456, 480, 504, 528, 552, 576, 608, 640, 672, 704, 736, 768, 808, 848, 888, 928, 984, 1032, 1064, 1128, 1160, 1192, 1224, 1256, \
1288, 1320, 1352, 1416, 1480, 1544, 1608, 1672, 1736, 1800, 1864, 1928, 2024, 2088, 2152, 2216, 2280, 2408, 2472, 2536, 2600, 2664, 2728, 2792, 2856, 2976, \
3104, 3240, 3368, 3496, 3624, 3752, 3824};
uint8_t nr_get_Qm(uint8_t Imcs, uint8_t table_idx) {
switch(table_idx) {
case 1:
return (((Imcs<10)||(Imcs==29))?2:((Imcs<17)||(Imcs==30))?4:((Imcs<29)||(Imcs==31))?6:-1);
break;
case 2:
return (((Imcs<5)||(Imcs==28))?2:((Imcs<11)||(Imcs==29))?4:((Imcs<20)||(Imcs==30))?6:((Imcs<28)||(Imcs==31))?8:-1);
break;
case 3:
return (((Imcs<15)||(Imcs==29))?2:((Imcs<21)||(Imcs==30))?4:((Imcs<29)||(Imcs==31))?6:-1);
break;
default:
AssertFatal(0, "Invalid MCS table index %d (expected in range [1,3])\n", table_idx);
return(0);
break;
}
}
uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx) {
switch(table_idx) {
case 1:
return (nr_target_code_rate_table1[Imcs]);
break;
case 2:
return (nr_target_code_rate_table2[Imcs]);
break;
case 3:
return (nr_target_code_rate_table3[Imcs]);
break;
default:
AssertFatal(0, "Invalid MCS table index %d (expected in range [1,3])\n", table_idx);
return(0);
break;
}
}
int get_subband_size(int NPRB,int size) {
// implements table 5.2.1.4-2 from 36.214
//
//Bandwidth part (PRBs) Subband size (PRBs)
// < 24 N/A
//24 – 72 4, 8
//73 – 144 8, 16
//145 – 275 16, 32
if (NPRB<24) return(1);
if (NPRB<72) return (size==0 ? 4 : 8);
if (NPRB<144) return (size==0 ? 8 : 16);
if (NPRB<275) return (size==0 ? 16 : 32);
AssertFatal(1==0,"Shouldn't get here, NPRB %d\n",NPRB);
}
void SLIV2SL(int SLIV,int *S,int *L) {
int SLIVdiv14 = SLIV/14;
int SLIVmod14 = SLIV%14;
// Either SLIV = 14*(L-1) + S, or SLIV = 14*(14-L+1) + (14-1-S). Condition is 0 <= L <= 14-S
if ((SLIVdiv14 + 1) >= 0 && (SLIVdiv14 <= 13-SLIVmod14)) {
*L=SLIVdiv14+1;
*S=SLIVmod14;
} else {
*L=15-SLIVdiv14;
*S=13-SLIVmod14;
}
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/* \file config_ue.c
* \brief common utility functions for NR (gNB and UE)
* \author R. Knopp,
* \date 2019
* \version 0.1
* \company Eurecom
* \email: knopp@eurecom.fr
* \note
* \warning
*/
#include <stdint.h>
#include "assertions.h"
int NRRIV2BW(int locationAndBandwidth,int N_RB);
int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB);
int PRBalloc_to_locationandbandwidth0(int NPRB,int RBstart,int BWPsize);
int PRBalloc_to_locationandbandwidth(int NPRB,int RBstart);
extern uint16_t nr_target_code_rate_table1[29];
extern uint16_t nr_target_code_rate_table2[28];
extern uint16_t nr_target_code_rate_table3[29];
extern uint16_t nr_tbs_table[93];
uint8_t nr_get_Qm(uint8_t Imcs, uint8_t table_idx);
uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx);
int get_subband_size(int NPRB,int size);
void SLIV2SL(int SLIV,int *S,int *L);
#define CEILIDIV(a,b) ((a+b-1)/b)
#define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1))
#define cmax(a,b) ((a>b) ? (a) : (b))
#define cmax3(a,b,c) ((cmax(a,b)>c) ? (cmax(a,b)) : (c))
#define cmin(a,b) ((a<b) ? (a) : (b))
#ifdef __cplusplus
#ifdef min
#undef min
#undef max
#endif
#else
#define max(a,b) cmax(a,b)
#define min(a,b) cmin(a,b)
#endif
...@@ -86,6 +86,9 @@ task_list_t tasks[TASK_MAX]; ...@@ -86,6 +86,9 @@ task_list_t tasks[TASK_MAX];
temp->ittiMsgHeader.messageId = message_id; temp->ittiMsgHeader.messageId = message_id;
temp->ittiMsgHeader.originTaskId = origin_task_id; temp->ittiMsgHeader.originTaskId = origin_task_id;
temp->ittiMsgHeader.ittiMsgSize = size; temp->ittiMsgHeader.ittiMsgSize = size;
temp->ittiMsgHeader.destinationTaskId=TASK_UNKNOWN;
temp->ittiMsgHeader.instance=0;
temp->ittiMsgHeader.lte_time={0};
return temp; return temp;
//return itti_alloc_new_message_sized(origin_task_id, message_id, messages_info[message_id].size); //return itti_alloc_new_message_sized(origin_task_id, message_id, messages_info[message_id].size);
} }
......
...@@ -275,7 +275,7 @@ typedef struct { ...@@ -275,7 +275,7 @@ typedef struct {
//TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200, NULL, NULL) //TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200, NULL, NULL)
//TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL) //TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL)
//TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000, NULL, NULL) //TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000, NULL, NULL)
void * rrc_enb_process_msg(void*);
#define FOREACH_TASK(TASK_DEF) \ #define FOREACH_TASK(TASK_DEF) \
TASK_DEF(TASK_UNKNOWN, TASK_PRIORITY_MED, 50, NULL, NULL) \ TASK_DEF(TASK_UNKNOWN, TASK_PRIORITY_MED, 50, NULL, NULL) \
TASK_DEF(TASK_TIMER, TASK_PRIORITY_MED, 10, NULL, NULL) \ TASK_DEF(TASK_TIMER, TASK_PRIORITY_MED, 10, NULL, NULL) \
...@@ -288,7 +288,7 @@ typedef struct { ...@@ -288,7 +288,7 @@ typedef struct {
TASK_DEF(TASK_PDCP_ENB, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_PDCP_ENB, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_DATA_FORWARDING, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_DATA_FORWARDING, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_END_MARKER, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_END_MARKER, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200, rrc_enb_process_itti_msg,NULL)\ TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200, rrc_enb_process_msg,NULL)\
TASK_DEF(TASK_RRC_GNB, TASK_PRIORITY_MED, 200, NULL,NULL)\ TASK_DEF(TASK_RRC_GNB, TASK_PRIORITY_MED, 200, NULL,NULL)\
TASK_DEF(TASK_RAL_ENB, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_RAL_ENB, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 200, NULL, NULL) \
......
...@@ -53,7 +53,7 @@ volatile int oai_exit = 0; ...@@ -53,7 +53,7 @@ volatile int oai_exit = 0;
double cpuf; double cpuf;
uint16_t sf_ahead=4; uint16_t sf_ahead=4;
int otg_enabled; int otg_enabled;
uint32_t downlink_frequency[MAX_NUM_CCs][4]; uint64_t downlink_frequency[MAX_NUM_CCs][4];
int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
int split73; int split73;
char * split73_config; char * split73_config;
......
This diff is collapsed.
This diff is collapsed.
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
#define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n" #define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n"
#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n" #define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
#define CONFIG_HLP_DISABLETIMECORR "disable UE timing correction\n" #define CONFIG_HLP_DISABLETIMECORR "disable UE timing correction\n"
#define CONFIG_HLP_RRC_CFG_PATH "path for RRC configuration\n"
#define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n" #define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n"
#define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n" #define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n"
...@@ -126,7 +127,7 @@ extern pthread_mutex_t sync_mutex; ...@@ -126,7 +127,7 @@ extern pthread_mutex_t sync_mutex;
extern int sync_var; extern int sync_var;
extern uint32_t downlink_frequency[MAX_NUM_CCs][4]; extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
extern int rx_input_level_dBm; extern int rx_input_level_dBm;
......
This diff is collapsed.
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&wait_for_sync, defintval:0, TYPE_INT, 0}, \ {"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&wait_for_sync, defintval:0, TYPE_INT, 0}, \
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \ {"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \ {"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
{"C" , CONFIG_HLP_DLF, 0, uptr:&(downlink_frequency[0][0]), defuintval:DEFAULT_DLF, TYPE_UINT, 0}, \ {"C" , CONFIG_HLP_DLF, 0, u64ptr:&(downlink_frequency[0][0]), defuintval:DEFAULT_DLF, TYPE_UINT64, 0}, \
{"a" , CONFIG_HLP_CHOFF, 0, iptr:&chain_offset, defintval:0, TYPE_INT, 0}, \ {"a" , CONFIG_HLP_CHOFF, 0, iptr:&chain_offset, defintval:0, TYPE_INT, 0}, \
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \ {"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \ {"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \
......
This diff is collapsed.
...@@ -133,7 +133,7 @@ static double snr_dB=20; ...@@ -133,7 +133,7 @@ static double snr_dB=20;
int threequarter_fs=0; int threequarter_fs=0;
uint32_t downlink_frequency[MAX_NUM_CCs][4]; uint64_t downlink_frequency[MAX_NUM_CCs][4];
int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
//int32_t uplink_counter = 0; //int32_t uplink_counter = 0;
...@@ -221,6 +221,8 @@ tpool_t *Tpool; ...@@ -221,6 +221,8 @@ tpool_t *Tpool;
char *usrp_args=NULL; char *usrp_args=NULL;
char *rrc_config_path=NULL;
/* forward declarations */ /* forward declarations */
void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]); void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
...@@ -472,7 +474,7 @@ void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) { ...@@ -472,7 +474,7 @@ void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
/* Set some default values that may be overwritten while reading options */ /* Set some default values that may be overwritten while reading options */
frame_parms[CC_id] = (NR_DL_FRAME_PARMS *) calloc(sizeof(NR_DL_FRAME_PARMS),1); frame_parms[CC_id] = (NR_DL_FRAME_PARMS *) calloc(sizeof(NR_DL_FRAME_PARMS),1);
frame_parms[CC_id]->eutra_band = 78; frame_parms[CC_id]->nr_band = 78;
frame_parms[CC_id]->frame_type = FDD; frame_parms[CC_id]->frame_type = FDD;
frame_parms[CC_id]->tdd_config = 3; frame_parms[CC_id]->tdd_config = 3;
//frame_parms[CC_id]->tdd_config_S = 0; //frame_parms[CC_id]->tdd_config_S = 0;
...@@ -482,7 +484,7 @@ void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) { ...@@ -482,7 +484,7 @@ void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
//frame_parms[CC_id]->Ncp_UL = NORMAL; //frame_parms[CC_id]->Ncp_UL = NORMAL;
frame_parms[CC_id]->Nid_cell = 0; frame_parms[CC_id]->Nid_cell = 0;
//frame_parms[CC_id]->num_MBSFN_config = 0; //frame_parms[CC_id]->num_MBSFN_config = 0;
frame_parms[CC_id]->nb_antenna_ports_eNB = 1; frame_parms[CC_id]->nb_antenna_ports_gNB = 1;
frame_parms[CC_id]->nb_antennas_tx = 1; frame_parms[CC_id]->nb_antennas_tx = 1;
frame_parms[CC_id]->nb_antennas_rx = 1; frame_parms[CC_id]->nb_antennas_rx = 1;
//frame_parms[CC_id]->nushift = 0; //frame_parms[CC_id]->nushift = 0;
...@@ -500,8 +502,25 @@ void init_openair0(void) { ...@@ -500,8 +502,25 @@ void init_openair0(void) {
for (card=0; card<MAX_CARDS; card++) { for (card=0; card<MAX_CARDS; card++) {
openair0_cfg[card].configFilename = NULL; openair0_cfg[card].configFilename = NULL;
openair0_cfg[card].threequarter_fs = frame_parms[0]->threequarter_fs; openair0_cfg[card].threequarter_fs = frame_parms[0]->threequarter_fs;
numerology = frame_parms[0]->numerology_index;
if(frame_parms[0]->N_RB_DL == 217) { if(frame_parms[0]->N_RB_DL == 66) {
if (numerology==3) {
openair0_cfg[card].sample_rate=122.88e6;
openair0_cfg[card].samples_per_frame = 1228800;
} else {
LOG_E(PHY,"Unsupported numerology! FR2 supports only 120KHz SCS for now.\n");
exit(-1);
}
}else if(frame_parms[0]->N_RB_DL == 32) {
if (numerology==3) {
openair0_cfg[card].sample_rate=61.44e6;
openair0_cfg[card].samples_per_frame = 614400;
} else {
LOG_E(PHY,"Unsupported numerology! FR2 supports only 120KHz SCS for now.\n");
exit(-1);
}
}else if(frame_parms[0]->N_RB_DL == 217) {
if (numerology==1) { if (numerology==1) {
if (frame_parms[0]->threequarter_fs) { if (frame_parms[0]->threequarter_fs) {
openair0_cfg[card].sample_rate=92.16e6; openair0_cfg[card].sample_rate=92.16e6;
...@@ -584,12 +603,12 @@ void init_openair0(void) { ...@@ -584,12 +603,12 @@ void init_openair0(void) {
for (i=0; i<4; i++) { for (i=0; i<4; i++) {
if (i<openair0_cfg[card].tx_num_channels) if (i<openair0_cfg[card].tx_num_channels)
openair0_cfg[card].tx_freq[i] = downlink_frequency[0][i]+uplink_frequency_offset[0][i]; openair0_cfg[card].tx_freq[i] = frame_parms[0]->ul_CarrierFreq;
else else
openair0_cfg[card].tx_freq[i]=0.0; openair0_cfg[card].tx_freq[i]=0.0;
if (i<openair0_cfg[card].rx_num_channels) if (i<openair0_cfg[card].rx_num_channels)
openair0_cfg[card].rx_freq[i] = downlink_frequency[0][i]; openair0_cfg[card].rx_freq[i] = frame_parms[0]->dl_CarrierFreq;
else else
openair0_cfg[card].rx_freq[i]=0.0; openair0_cfg[card].rx_freq[i]=0.0;
...@@ -631,7 +650,7 @@ void init_pdcp(void) { ...@@ -631,7 +650,7 @@ void init_pdcp(void) {
} }
// Stupid function addition because UE itti messages queues definition is common with eNB // Stupid function addition because UE itti messages queues definition is common with eNB
void *rrc_enb_process_itti_msg(void *notUsed) { void *rrc_enb_process_msg(void *notUsed) {
return NULL; return NULL;
} }
...@@ -674,35 +693,28 @@ int main( int argc, char **argv ) { ...@@ -674,35 +693,28 @@ int main( int argc, char **argv ) {
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info); itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
init_opt() ; init_opt() ;
if(IS_SOFTMODEM_NOS1) load_nrLDPClib();
init_pdcp();
if (ouput_vcd) { if (ouput_vcd) {
vcd_signal_dumper_init("/tmp/openair_dump_nrUE.vcd"); vcd_signal_dumper_init("/tmp/openair_dump_nrUE.vcd");
} }
/* #ifndef PACKAGE_VERSION
#ifdef PDCP_USE_NETLINK
netlink_init();
#if defined(PDCP_USE_NETLINK_QUEUES)
pdcp_netlink_init();
#endif
#endif
*/
#ifndef PACKAGE_VERSION
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL" # define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
#endif #endif
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION); LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
// init the parameters init_NR_UE(1,rrc_config_path);
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { if(IS_SOFTMODEM_NOS1)
frame_parms[CC_id]->nb_antennas_tx = nb_antenna_tx; init_pdcp();
frame_parms[CC_id]->nb_antennas_rx = nb_antenna_rx; /*
frame_parms[CC_id]->nb_antenna_ports_eNB = 1; //initial value overwritten by initial sync later #ifdef PDCP_USE_NETLINK
frame_parms[CC_id]->threequarter_fs = threequarter_fs; netlink_init();
LOG_I(PHY,"Set nb_rx_antenna %d , nb_tx_antenna %d \n",frame_parms[CC_id]->nb_antennas_rx, frame_parms[CC_id]->nb_antennas_tx); #if defined(PDCP_USE_NETLINK_QUEUES)
get_band(downlink_frequency[CC_id][0], &frame_parms[CC_id]->eutra_band, &uplink_frequency_offset[CC_id][0], &frame_parms[CC_id]->frame_type); pdcp_netlink_init();
} #endif
#endif
*/
NB_UE_INST=1; NB_UE_INST=1;
NB_INST=1; NB_INST=1;
...@@ -710,17 +722,38 @@ int main( int argc, char **argv ) { ...@@ -710,17 +722,38 @@ int main( int argc, char **argv ) {
PHY_vars_UE_g[0] = malloc(sizeof(PHY_VARS_NR_UE *)*MAX_NUM_CCs); PHY_vars_UE_g[0] = malloc(sizeof(PHY_VARS_NR_UE *)*MAX_NUM_CCs);
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
printf("frame_parms %hu\n",frame_parms[CC_id]->ofdm_symbol_size); printf("frame_parms %d\n",frame_parms[CC_id]->ofdm_symbol_size);
nr_init_frame_parms_ue(frame_parms[CC_id],numerology,NORMAL,frame_parms[CC_id]->N_RB_DL,(frame_parms[CC_id]->N_RB_DL-20)>>1,0); frame_parms[CC_id]->nb_antennas_tx = nb_antenna_tx;
PHY_vars_UE_g[0][CC_id] = init_nr_ue_vars(frame_parms[CC_id], 0,abstraction_flag); frame_parms[CC_id]->nb_antennas_rx = nb_antenna_rx;
frame_parms[CC_id]->nb_antenna_ports_gNB = 1; //initial value overwritten by initial sync later
frame_parms[CC_id]->threequarter_fs = threequarter_fs;
LOG_I(PHY,"Set nb_rx_antenna %d , nb_tx_antenna %d \n",frame_parms[CC_id]->nb_antennas_rx, frame_parms[CC_id]->nb_antennas_tx);
PHY_vars_UE_g[0][CC_id] = (PHY_VARS_NR_UE *)malloc(sizeof(PHY_VARS_NR_UE));
UE[CC_id] = PHY_vars_UE_g[0][CC_id]; UE[CC_id] = PHY_vars_UE_g[0][CC_id];
memset(UE[CC_id],0,sizeof(PHY_VARS_NR_UE));
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
if(mac->if_module != NULL && mac->if_module->phy_config_request != NULL)
mac->if_module->phy_config_request(&mac->phy_config);
fapi_nr_config_request_t *nrUE_config = &UE[CC_id]->nrUE_config;
nr_init_frame_parms_ue(frame_parms[CC_id],nrUE_config,NORMAL);
// Overwrite DL frequency (for FR2 testing)
if (downlink_frequency[0][0]!=0)
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
init_nr_ue_vars(UE[CC_id],frame_parms[CC_id],0,abstraction_flag);
if (get_softmodem_params()->phy_test==1) if (get_softmodem_params()->phy_test==1)
UE[CC_id]->mac_enabled = 0; UE[CC_id]->mac_enabled = 0;
else else
UE[CC_id]->mac_enabled = 1; UE[CC_id]->mac_enabled = 1;
UE[CC_id]->mac_enabled = 1;
UE[CC_id]->if_inst = nr_ue_if_module_init(0);
UE[CC_id]->UE_scan = UE_scan; UE[CC_id]->UE_scan = UE_scan;
UE[CC_id]->UE_scan_carrier = UE_scan_carrier; UE[CC_id]->UE_scan_carrier = UE_scan_carrier;
UE[CC_id]->UE_fo_compensation = UE_fo_compensation; UE[CC_id]->UE_fo_compensation = UE_fo_compensation;
...@@ -728,13 +761,6 @@ int main( int argc, char **argv ) { ...@@ -728,13 +761,6 @@ int main( int argc, char **argv ) {
UE[CC_id]->no_timing_correction = UE_no_timing_correction; UE[CC_id]->no_timing_correction = UE_no_timing_correction;
printf("UE[%d]->mode = %d\n",CC_id,mode); printf("UE[%d]->mode = %d\n",CC_id,mode);
for (uint8_t i=0; i<RX_NB_TH_MAX; i++) {
if (UE[CC_id]->mac_enabled == 1)
UE[CC_id]->pdcch_vars[i][0]->crnti = 0x1234;
else
UE[CC_id]->pdcch_vars[i][0]->crnti = 0x1235;
}
UE[CC_id]->rx_total_gain_dB = (int)rx_gain[CC_id][0] + rx_gain_off; UE[CC_id]->rx_total_gain_dB = (int)rx_gain[CC_id][0] + rx_gain_off;
UE[CC_id]->tx_power_max_dBm = tx_max_power[CC_id]; UE[CC_id]->tx_power_max_dBm = tx_max_power[CC_id];
...@@ -769,11 +795,14 @@ int main( int argc, char **argv ) { ...@@ -769,11 +795,14 @@ int main( int argc, char **argv ) {
#else #else
PHY_vars_UE_g[0][CC_id]->hw_timing_advance = 160; PHY_vars_UE_g[0][CC_id]->hw_timing_advance = 160;
#endif #endif
} }
init_NR_UE_threads(1);
printf("UE threads created by %ld\n", gettid());
// wait for end of program // wait for end of program
printf("TYPE <CTRL-C> TO TERMINATE\n"); printf("TYPE <CTRL-C> TO TERMINATE\n");
init_NR_UE(1);
while(true) while(true)
sleep(3600); sleep(3600);
......
...@@ -54,8 +54,6 @@ ...@@ -54,8 +54,6 @@
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200", TYPE_STRING, 0} \ {"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200", TYPE_STRING, 0} \
} }
#define DEFAULT_DLF 2680000000
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters common to eNodeB and UE */ /* command line parameters common to eNodeB and UE */
/* optname helpstr paramflags XXXptr defXXXval type numelt */ /* optname helpstr paramflags XXXptr defXXXval type numelt */
...@@ -65,7 +63,7 @@ ...@@ -65,7 +63,7 @@
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \ {"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
{"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ {"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \ {"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
{"C" , CONFIG_HLP_DLF, 0, uptr:&(downlink_frequency[0][0]), defuintval:2680000000, TYPE_UINT, 0}, \ {"C" , CONFIG_HLP_DLF, 0, u64ptr:&(downlink_frequency[0][0]), defuintval:0,TYPE_UINT64, 0}, \
{"a" , CONFIG_HLP_CHOFF, 0, iptr:&chain_offset, defintval:0, TYPE_INT, 0}, \ {"a" , CONFIG_HLP_CHOFF, 0, iptr:&chain_offset, defintval:0, TYPE_INT, 0}, \
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:&do_forms, defintval:0, TYPE_INT, 0}, \ {"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:&do_forms, defintval:0, TYPE_INT, 0}, \
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, iptr:&threequarter_fs, defintval:0, TYPE_INT, 0}, \ {"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, iptr:&threequarter_fs, defintval:0, TYPE_INT, 0}, \
...@@ -74,13 +72,14 @@ ...@@ -74,13 +72,14 @@
{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \ {"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \ {"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
{"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \ {"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \
{"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&numerology, defintval:0, TYPE_INT, 0}, \ {"numerology" , CONFIG_HLP_NUMEROLOGY, 0, iptr:&numerology, defintval:0, TYPE_INT, 0}, \
{"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&emulate_rf, defintval:0, TYPE_INT, 0}, \ {"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&emulate_rf, defintval:0, TYPE_INT, 0}, \
{"parallel-config", CONFIG_HLP_PARALLEL_CMD,0, strptr:(char **)&parallel_config, defstrval:NULL, TYPE_STRING, 0}, \ {"parallel-config", CONFIG_HLP_PARALLEL_CMD,0, strptr:(char **)&parallel_config, defstrval:NULL, TYPE_STRING, 0}, \
{"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \ {"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \
{"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \ {"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0}, \ {"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0}, \
{"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&UE_no_timing_correction, defintval:0, TYPE_INT, 0} \ {"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&UE_no_timing_correction, defintval:0, TYPE_INT, 0}, \
{"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0} \
} }
...@@ -92,11 +91,12 @@ extern int T_dont_fork; ...@@ -92,11 +91,12 @@ extern int T_dont_fork;
// In nr-ue.c // In nr-ue.c
extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg); extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
extern void fill_ue_band_info(void); extern void fill_ue_band_info(void);
extern void init_NR_UE(int); extern void init_NR_UE(int, char*);
extern void init_NR_UE_threads(int);
extern void reset_opp_meas(void); extern void reset_opp_meas(void);
extern void print_opp_meas(void); extern void print_opp_meas(void);
void *UE_thread(void *arg); void *UE_thread(void *arg);
PHY_VARS_NR_UE *init_nr_ue_vars(NR_DL_FRAME_PARMS *frame_parms, uint8_t UE_id, uint8_t abstraction_flag); void init_nr_ue_vars(PHY_VARS_NR_UE *ue, NR_DL_FRAME_PARMS *frame_parms, uint8_t UE_id, uint8_t abstraction_flag);
extern tpool_t *Tpool; extern tpool_t *Tpool;
extern tpool_t *Tpool_dl; extern tpool_t *Tpool_dl;
#endif #endif
...@@ -144,7 +144,6 @@ void get_common_options(uint32_t execmask) { ...@@ -144,7 +144,6 @@ void get_common_options(uint32_t execmask) {
if(worker_config != NULL) set_worker_conf(worker_config); if(worker_config != NULL) set_worker_conf(worker_config);
} }
void softmodem_printresources(int sig, telnet_printfunc_t pf) { void softmodem_printresources(int sig, telnet_printfunc_t pf) {
struct rusage usage; struct rusage usage;
struct timespec stop; struct timespec stop;
...@@ -204,3 +203,4 @@ void set_softmodem_sighandler(void) { ...@@ -204,3 +203,4 @@ void set_softmodem_sighandler(void) {
signal(SIGTERM, signal_handler); signal(SIGTERM, signal_handler);
signal(SIGABRT, signal_handler); signal(SIGABRT, signal_handler);
} }
...@@ -117,7 +117,7 @@ extern "C" ...@@ -117,7 +117,7 @@ extern "C"
{"clock", CONFIG_HLP_CLK, 0, uptr:&CLOCK_SOURCE, defintval:0, TYPE_UINT, 0}, \ {"clock", CONFIG_HLP_CLK, 0, uptr:&CLOCK_SOURCE, defintval:0, TYPE_UINT, 0}, \
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&WAIT_FOR_SYNC, defintval:0, TYPE_INT, 0}, \ {"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&WAIT_FOR_SYNC, defintval:0, TYPE_INT, 0}, \
{"single-thread-enable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&SINGLE_THREAD_FLAG, defintval:0, TYPE_INT, 0}, \ {"single-thread-enable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&SINGLE_THREAD_FLAG, defintval:0, TYPE_INT, 0}, \
{"C" , CONFIG_HLP_DLF, 0, uptr:&(downlink_frequency[0][0]), defuintval:2680000000, TYPE_UINT, 0}, \ {"C" , CONFIG_HLP_DLF, 0, u64ptr:&(downlink_frequency[0][0]), defuintval:0, TYPE_UINT64, 0}, \
{"a" , CONFIG_HLP_CHOFF, 0, iptr:&CHAIN_OFFSET, defintval:0, TYPE_INT, 0}, \ {"a" , CONFIG_HLP_CHOFF, 0, iptr:&CHAIN_OFFSET, defintval:0, TYPE_INT, 0}, \
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \ {"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \
{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \ {"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \
...@@ -198,7 +198,7 @@ extern "C" ...@@ -198,7 +198,7 @@ extern "C"
typedef struct { typedef struct {
uint64_t optmask; uint64_t optmask;
THREAD_STRUCT thread_struct; //THREAD_STRUCT thread_struct;
char rf_config_file[1024]; char rf_config_file[1024];
char split73[1024]; char split73[1024];
char threadPoolConfig[1024]; char threadPoolConfig[1024];
...@@ -223,7 +223,7 @@ extern void get_common_options(uint32_t execmask); ...@@ -223,7 +223,7 @@ extern void get_common_options(uint32_t execmask);
extern char *get_softmodem_function(uint64_t *sofmodemfunc_mask_ptr); extern char *get_softmodem_function(uint64_t *sofmodemfunc_mask_ptr);
#define SOFTMODEM_RTSIGNAL (SIGRTMIN+1) #define SOFTMODEM_RTSIGNAL (SIGRTMIN+1)
extern void set_softmodem_sighandler(void); extern void set_softmodem_sighandler(void);
extern uint32_t downlink_frequency[MAX_NUM_CCs][4]; extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -23,5 +23,5 @@ ...@@ -23,5 +23,5 @@
#define NFAPI_PNF_H__ #define NFAPI_PNF_H__
int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind); int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port); void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
void oai_subframe_ind(uint16_t sfn, uint16_t sf);
#endif #endif
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include "nfapi_nr_interface.h" #include "nfapi_nr_interface_scf.h"
#include "nfapi_vnf_interface.h" #include "nfapi_vnf_interface.h"
#include "nfapi.h" #include "nfapi.h"
#include "vendor_ext.h" #include "vendor_ext.h"
...@@ -1169,7 +1169,7 @@ int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { ...@@ -1169,7 +1169,7 @@ int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) {
return retval; return retval;
} }
int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_tti_request_t *dl_config_req)
{ {
nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config; nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
...@@ -1177,9 +1177,9 @@ int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) ...@@ -1177,9 +1177,9 @@ int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req)
int retval = nfapi_vnf_p7_nr_dl_config_req(p7_config, dl_config_req); int retval = nfapi_vnf_p7_nr_dl_config_req(p7_config, dl_config_req);
dl_config_req->dl_config_request_body.number_dci = 0; dl_config_req->dl_tti_request_body.nPDUs = 0;
dl_config_req->dl_config_request_body.number_pdu = 0; dl_config_req->dl_tti_request_body.nGroup = 0;
dl_config_req->dl_config_request_body.number_pdsch_rnti = 0;
if (retval!=0) { if (retval!=0) {
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval); LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
......
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
#define FAPI_NR_MAX_NUM_ZP_CSI_RS_RESOURCE_PER_SET 16 #define FAPI_NR_MAX_NUM_ZP_CSI_RS_RESOURCE_PER_SET 16
#define FAPI_NR_MAX_NUM_CANDIDATE_BEAMS 16 #define FAPI_NR_MAX_NUM_CANDIDATE_BEAMS 16
#define FAPI_NR_MAX_RA_OCCASION_PER_CSIRS 64 #define FAPI_NR_MAX_RA_OCCASION_PER_CSIRS 64
// Constants Defined in 38.213
#define FAPI_NR_MAX_CORESET_PER_BWP 3
#define FAPI_NR_MAX_SS_PER_CORESET 10
/// RX_IND /// RX_IND
...@@ -41,8 +44,8 @@ ...@@ -41,8 +44,8 @@
#define FAPI_NR_DL_CONFIG_TYPE_DLSCH 0x02 #define FAPI_NR_DL_CONFIG_TYPE_DLSCH 0x02
#define CCE_REG_MAPPING_TYPE_INTERLEAVED 0x01 #define FAPI_NR_CCE_REG_MAPPING_TYPE_INTERLEAVED 0x01
#define CCE_REG_MAPPING_TYPE_NON_INTERLEAVED 0x02 #define FAPI_NR_CCE_REG_MAPPING_TYPE_NON_INTERLEAVED 0x02
#define PRECODER_GRANULARITY_SAME_AS_REG_BUNDLE 0x01 #define PRECODER_GRANULARITY_SAME_AS_REG_BUNDLE 0x01
#define PRECODER_GRANULARITY_ALL_CONTIGUOUS_RBS 0x02 #define PRECODER_GRANULARITY_ALL_CONTIGUOUS_RBS 0x02
......
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
#define _NFAPI_VNF_INTERFACE_H_ #define _NFAPI_VNF_INTERFACE_H_
#include "nfapi_interface.h" #include "nfapi_interface.h"
#include "nfapi_nr_interface.h" #include "nfapi_nr_interface_scf.h"
#include "debug.h" #include "debug.h"
#include "netinet/in.h" #include "netinet/in.h"
...@@ -938,7 +939,7 @@ int nfapi_vnf_p7_del_pnf(nfapi_vnf_p7_config_t* config, int phy_id); ...@@ -938,7 +939,7 @@ int nfapi_vnf_p7_del_pnf(nfapi_vnf_p7_config_t* config, int phy_id);
* may be released after this function call has returned or at a later pointer * may be released after this function call has returned or at a later pointer
*/ */
int nfapi_vnf_p7_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_dl_config_request_t* req); int nfapi_vnf_p7_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_dl_config_request_t* req);
int nfapi_vnf_p7_nr_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_nr_dl_config_request_t* req); int nfapi_vnf_p7_nr_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_nr_dl_tti_request_t* req);
/*! Send the UL_CONFIG.request /*! Send the UL_CONFIG.request
* \param config A pointer to the vnf p7 configuration * \param config A pointer to the vnf p7 configuration
......
...@@ -482,7 +482,7 @@ int nfapi_vnf_p7_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_dl_config_re ...@@ -482,7 +482,7 @@ int nfapi_vnf_p7_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_dl_config_re
return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header); return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
} }
int nfapi_vnf_p7_nr_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_nr_dl_config_request_t* req) int nfapi_vnf_p7_nr_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_nr_dl_tti_request_t* req)
{ {
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(config:%p req:%p)\n", __FUNCTION__, config, req); //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(config:%p req:%p)\n", __FUNCTION__, config, req);
......
...@@ -175,7 +175,7 @@ if (logFlag){ ...@@ -175,7 +175,7 @@ if (logFlag){
double channelOutput[coderLength]; //add noise double channelOutput[coderLength]; //add noise
int16_t channelOutput_int16[coderLength]; int16_t channelOutput_int16[coderLength];
t_nrPolar_params *currentPtr = nr_polar_params(polarMessageType, testLength, aggregation_level); t_nrPolar_params *currentPtr = nr_polar_params(polarMessageType, testLength, aggregation_level, 1, NULL);
#ifdef DEBUG_DCI_POLAR_PARAMS #ifdef DEBUG_DCI_POLAR_PARAMS
uint32_t dci_pdu[4]; uint32_t dci_pdu[4];
......
...@@ -481,6 +481,8 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm, ...@@ -481,6 +481,8 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm,
uint8_t *w, uint8_t *w,
uint8_t *e, uint8_t *e,
uint8_t C, uint8_t C,
uint32_t F,
uint32_t Foffset,
uint8_t rvidx, uint8_t rvidx,
uint32_t E); uint32_t E);
...@@ -493,7 +495,9 @@ int nr_rate_matching_ldpc_rx(uint8_t Ilbrm, ...@@ -493,7 +495,9 @@ int nr_rate_matching_ldpc_rx(uint8_t Ilbrm,
uint8_t C, uint8_t C,
uint8_t rvidx, uint8_t rvidx,
uint8_t clear, uint8_t clear,
uint32_t E); uint32_t E,
uint32_t F,
uint32_t Foffset);
decoder_if_t phy_threegpplte_turbo_decoder; decoder_if_t phy_threegpplte_turbo_decoder;
decoder_if_t phy_threegpplte_turbo_decoder8; decoder_if_t phy_threegpplte_turbo_decoder8;
......
...@@ -88,23 +88,29 @@ static inline void nrLDPC_cnProc_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_pr ...@@ -88,23 +88,29 @@ static inline void nrLDPC_cnProc_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_pr
// Set of results pointer to correct BN address // Set of results pointer to correct BN address
p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup); p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
__m256i *pj0 = &p_cnProcBuf[lut_idxCnProcG3[j][0]];
__m256i *pj1 = &p_cnProcBuf[lut_idxCnProcG3[j][1]];
// Loop over CNs // Loop over CNs
for (i=0; i<M; i++) for (i=0; i<M; i++)
{ {
// Abs and sign of 32 CNs (first BN) // Abs and sign of 32 CNs (first BN)
ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i]; // ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
ymm0 = pj0[i];
sgn = _mm256_sign_epi8(*p_ones, ymm0); sgn = _mm256_sign_epi8(*p_ones, ymm0);
min = _mm256_abs_epi8(ymm0); min = _mm256_abs_epi8(ymm0);
// 32 CNs of second BN // 32 CNs of second BN
ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][1] + i]; // ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][1] + i];
ymm0 = pj1[i];
min = _mm256_min_epu8(min, _mm256_abs_epi8(ymm0)); min = _mm256_min_epu8(min, _mm256_abs_epi8(ymm0));
sgn = _mm256_sign_epi8(sgn, ymm0); sgn = _mm256_sign_epi8(sgn, ymm0);
// Store result // Store result
min = _mm256_min_epu8(min, *p_maxLLR); // 128 in epi8 is -127 min = _mm256_min_epu8(min, *p_maxLLR); // 128 in epi8 is -127
*p_cnProcBufResBit = _mm256_sign_epi8(min, sgn); //*p_cnProcBufResBit = _mm256_sign_epi8(min, sgn);
p_cnProcBufResBit++; //p_cnProcBufResBit++;
p_cnProcBufResBit[i]=_mm256_sign_epi8(min, sgn);
} }
} }
} }
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#include "nrLDPC_bnProc.h" #include "nrLDPC_bnProc.h"
#define NR_LDPC_ENABLE_PARITY_CHECK #define NR_LDPC_ENABLE_PARITY_CHECK
//#define NR_LDPC_PROFILER_DETAIL #define NR_LDPC_PROFILER_DETAIL
#ifdef NR_LDPC_DEBUG_MODE #ifdef NR_LDPC_DEBUG_MODE
#include "nrLDPC_tools/nrLDPC_debug.h" #include "nrLDPC_tools/nrLDPC_debug.h"
......
...@@ -521,7 +521,6 @@ static inline void nrLDPC_cn2bnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf ...@@ -521,7 +521,6 @@ static inline void nrLDPC_cn2bnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
for (j=0; j<3; j++) for (j=0; j<3; j++)
{ {
p_cnProcBufRes = &cnProcBufRes[lut_startAddrCnGroups[0] + j*bitOffsetInGroup]; p_cnProcBufRes = &cnProcBufRes[lut_startAddrCnGroups[0] + j*bitOffsetInGroup];
for (i=0; i<lut_numCnInCnGroups[0]; i++) for (i=0; i<lut_numCnInCnGroups[0]; i++)
{ {
idxBn = lut_startAddrBnProcBuf_CNG3[j][i] + lut_bnPosBnProcBuf_CNG3[j][i]*Z; idxBn = lut_startAddrBnProcBuf_CNG3[j][i] + lut_bnPosBnProcBuf_CNG3[j][i]*Z;
...@@ -673,7 +672,6 @@ static inline void nrLDPC_cn2bnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf ...@@ -673,7 +672,6 @@ static inline void nrLDPC_cn2bnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
for (j=0; j<3; j++) for (j=0; j<3; j++)
{ {
p_cnProcBufRes = &cnProcBufRes[lut_startAddrCnGroups[0] + j*bitOffsetInGroup]; p_cnProcBufRes = &cnProcBufRes[lut_startAddrCnGroups[0] + j*bitOffsetInGroup];
nrLDPC_inv_circ_memcpy(&bnProcBuf[lut_startAddrBnProcBuf_CNG3[j][0]],p_cnProcBufRes,Z,lut_circShift_CNG3[j][0]); nrLDPC_inv_circ_memcpy(&bnProcBuf[lut_startAddrBnProcBuf_CNG3[j][0]],p_cnProcBufRes,Z,lut_circShift_CNG3[j][0]);
} }
...@@ -867,7 +865,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf ...@@ -867,7 +865,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
for (j=0; j<2; j++) for (j=0; j<2; j++)
{ {
p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[0] + j*bitOffsetInGroup]; p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[0] + j*bitOffsetInGroup];
for (i=0; i<lut_numCnInCnGroups[0]; i++) for (i=0; i<lut_numCnInCnGroups[0]; i++)
{ {
idxBn = lut_startAddrBnProcBuf_CNG3[j][i] + lut_bnPosBnProcBuf_CNG3[j][i]*Z; idxBn = lut_startAddrBnProcBuf_CNG3[j][i] + lut_bnPosBnProcBuf_CNG3[j][i]*Z;
...@@ -884,7 +881,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf ...@@ -884,7 +881,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
for (j=0; j<3; j++) for (j=0; j<3; j++)
{ {
p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[1] + j*bitOffsetInGroup]; p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[1] + j*bitOffsetInGroup];
for (i=0; i<lut_numCnInCnGroups[1]; i++) for (i=0; i<lut_numCnInCnGroups[1]; i++)
{ {
idxBn = lut_startAddrBnProcBuf_CNG4[j][i] + lut_bnPosBnProcBuf_CNG4[j][i]*Z; idxBn = lut_startAddrBnProcBuf_CNG4[j][i] + lut_bnPosBnProcBuf_CNG4[j][i]*Z;
...@@ -901,7 +897,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf ...@@ -901,7 +897,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
for (j=0; j<4; j++) for (j=0; j<4; j++)
{ {
p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[2] + j*bitOffsetInGroup]; p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[2] + j*bitOffsetInGroup];
for (i=0; i<lut_numCnInCnGroups[2]; i++) for (i=0; i<lut_numCnInCnGroups[2]; i++)
{ {
idxBn = lut_startAddrBnProcBuf_CNG5[j][i] + lut_bnPosBnProcBuf_CNG5[j][i]*Z; idxBn = lut_startAddrBnProcBuf_CNG5[j][i] + lut_bnPosBnProcBuf_CNG5[j][i]*Z;
...@@ -918,7 +913,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf ...@@ -918,7 +913,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
for (j=0; j<5; j++) for (j=0; j<5; j++)
{ {
p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[3] + j*bitOffsetInGroup]; p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[3] + j*bitOffsetInGroup];
for (i=0; i<lut_numCnInCnGroups[3]; i++) for (i=0; i<lut_numCnInCnGroups[3]; i++)
{ {
idxBn = lut_startAddrBnProcBuf_CNG6[j][i] + lut_bnPosBnProcBuf_CNG6[j][i]*Z; idxBn = lut_startAddrBnProcBuf_CNG6[j][i] + lut_bnPosBnProcBuf_CNG6[j][i]*Z;
...@@ -931,7 +925,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf ...@@ -931,7 +925,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
// CN group with 8 BNs // CN group with 8 BNs
bitOffsetInGroup = lut_numCnInCnGroups_BG2_R15[4]*NR_LDPC_ZMAX; bitOffsetInGroup = lut_numCnInCnGroups_BG2_R15[4]*NR_LDPC_ZMAX;
for (j=0; j<8; j++) for (j=0; j<8; j++)
{ {
p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[4] + j*bitOffsetInGroup]; p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[4] + j*bitOffsetInGroup];
...@@ -952,7 +945,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf ...@@ -952,7 +945,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
for (j=0; j<10; j++) for (j=0; j<10; j++)
{ {
p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[5] + j*bitOffsetInGroup]; p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[5] + j*bitOffsetInGroup];
for (i=0; i<lut_numCnInCnGroups[5]; i++) for (i=0; i<lut_numCnInCnGroups[5]; i++)
{ {
idxBn = lut_startAddrBnProcBuf_CNG10[j][i] + lut_bnPosBnProcBuf_CNG10[j][i]*Z; idxBn = lut_startAddrBnProcBuf_CNG10[j][i] + lut_bnPosBnProcBuf_CNG10[j][i]*Z;
...@@ -962,6 +954,7 @@ static inline void nrLDPC_bn2cnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf ...@@ -962,6 +954,7 @@ static inline void nrLDPC_bn2cnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
} }
} }
/** /**
\brief Copies the values in the BN processing results buffer to their corresponding place in the CN processing buffer for BG1. \brief Copies the values in the BN processing results buffer to their corresponding place in the CN processing buffer for BG1.
\param p_lut Pointer to decoder LUTs \param p_lut Pointer to decoder LUTs
...@@ -1019,10 +1012,9 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf ...@@ -1019,10 +1012,9 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
bitOffsetInGroup = lut_numCnInCnGroups_BG1_R13[0]*NR_LDPC_ZMAX; bitOffsetInGroup = lut_numCnInCnGroups_BG1_R13[0]*NR_LDPC_ZMAX;
for (j=0; j<2; j++) for (j=0;j<2; j++)
{ {
p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[0] + j*bitOffsetInGroup]; p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[0] + j*bitOffsetInGroup];
nrLDPC_circ_memcpy(p_cnProcBuf, &bnProcBufRes[lut_startAddrBnProcBuf_CNG3[j][0]], Z, lut_circShift_CNG3[j][0]); nrLDPC_circ_memcpy(p_cnProcBuf, &bnProcBufRes[lut_startAddrBnProcBuf_CNG3[j][0]], Z, lut_circShift_CNG3[j][0]);
} }
...@@ -1034,7 +1026,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf ...@@ -1034,7 +1026,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
for (j=0; j<3; j++) for (j=0; j<3; j++)
{ {
p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[1] + j*bitOffsetInGroup]; p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[1] + j*bitOffsetInGroup];
for (i=0; i<lut_numCnInCnGroups[1]; i++) for (i=0; i<lut_numCnInCnGroups[1]; i++)
{ {
idxBn = lut_startAddrBnProcBuf_CNG4[j][i] + lut_bnPosBnProcBuf_CNG4[j][i]*Z; idxBn = lut_startAddrBnProcBuf_CNG4[j][i] + lut_bnPosBnProcBuf_CNG4[j][i]*Z;
...@@ -1051,7 +1042,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf ...@@ -1051,7 +1042,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
for (j=0; j<4; j++) for (j=0; j<4; j++)
{ {
p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[2] + j*bitOffsetInGroup]; p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[2] + j*bitOffsetInGroup];
for (i=0; i<lut_numCnInCnGroups[2]; i++) for (i=0; i<lut_numCnInCnGroups[2]; i++)
{ {
idxBn = lut_startAddrBnProcBuf_CNG5[j][i] + lut_bnPosBnProcBuf_CNG5[j][i]*Z; idxBn = lut_startAddrBnProcBuf_CNG5[j][i] + lut_bnPosBnProcBuf_CNG5[j][i]*Z;
...@@ -1068,7 +1058,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf ...@@ -1068,7 +1058,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
for (j=0; j<5; j++) for (j=0; j<5; j++)
{ {
p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[3] + j*bitOffsetInGroup]; p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[3] + j*bitOffsetInGroup];
for (i=0; i<lut_numCnInCnGroups[3]; i++) for (i=0; i<lut_numCnInCnGroups[3]; i++)
{ {
idxBn = lut_startAddrBnProcBuf_CNG6[j][i] + lut_bnPosBnProcBuf_CNG6[j][i]*Z; idxBn = lut_startAddrBnProcBuf_CNG6[j][i] + lut_bnPosBnProcBuf_CNG6[j][i]*Z;
...@@ -1102,7 +1091,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf ...@@ -1102,7 +1091,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
for (j=0; j<7; j++) for (j=0; j<7; j++)
{ {
p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[5] + j*bitOffsetInGroup]; p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[5] + j*bitOffsetInGroup];
for (i=0; i<lut_numCnInCnGroups[5]; i++) for (i=0; i<lut_numCnInCnGroups[5]; i++)
{ {
idxBn = lut_startAddrBnProcBuf_CNG8[j][i] + lut_bnPosBnProcBuf_CNG8[j][i]*Z; idxBn = lut_startAddrBnProcBuf_CNG8[j][i] + lut_bnPosBnProcBuf_CNG8[j][i]*Z;
...@@ -1119,7 +1107,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf ...@@ -1119,7 +1107,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
for (j=0; j<8; j++) for (j=0; j<8; j++)
{ {
p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[6] + j*bitOffsetInGroup]; p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[6] + j*bitOffsetInGroup];
for (i=0; i<lut_numCnInCnGroups[6]; i++) for (i=0; i<lut_numCnInCnGroups[6]; i++)
{ {
idxBn = lut_startAddrBnProcBuf_CNG9[j][i] + lut_bnPosBnProcBuf_CNG9[j][i]*Z; idxBn = lut_startAddrBnProcBuf_CNG9[j][i] + lut_bnPosBnProcBuf_CNG9[j][i]*Z;
...@@ -1136,7 +1123,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf ...@@ -1136,7 +1123,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
for (j=0; j<9; j++) for (j=0; j<9; j++)
{ {
p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[7] + j*bitOffsetInGroup]; p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[7] + j*bitOffsetInGroup];
for (i=0; i<lut_numCnInCnGroups[7]; i++) for (i=0; i<lut_numCnInCnGroups[7]; i++)
{ {
idxBn = lut_startAddrBnProcBuf_CNG10[j][i] + lut_bnPosBnProcBuf_CNG10[j][i]*Z; idxBn = lut_startAddrBnProcBuf_CNG10[j][i] + lut_bnPosBnProcBuf_CNG10[j][i]*Z;
...@@ -1153,7 +1139,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf ...@@ -1153,7 +1139,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf
for (j=0; j<19; j++) for (j=0; j<19; j++)
{ {
p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[8] + j*bitOffsetInGroup]; p_cnProcBuf = &cnProcBuf[lut_startAddrCnGroups[8] + j*bitOffsetInGroup];
for (i=0; i<lut_numCnInCnGroups[8]; i++) for (i=0; i<lut_numCnInCnGroups[8]; i++)
{ {
idxBn = lut_startAddrBnProcBuf_CNG19[j][i] + lut_bnPosBnProcBuf_CNG19[j][i]*Z; idxBn = lut_startAddrBnProcBuf_CNG19[j][i] + lut_bnPosBnProcBuf_CNG19[j][i]*Z;
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
#define NR_LDPC_SIZE_BN_PROC_BUF NR_LDPC_NUM_EDGE_BG1*NR_LDPC_ZMAX #define NR_LDPC_SIZE_BN_PROC_BUF NR_LDPC_NUM_EDGE_BG1*NR_LDPC_ZMAX
/** Maximum number of possible input LLR = NR_LDPC_NCOL_BG1*NR_LDPC_ZMAX */ /** Maximum number of possible input LLR = NR_LDPC_NCOL_BG1*NR_LDPC_ZMAX */
#define NR_LDPC_MAX_NUM_LLR 26112 #define NR_LDPC_MAX_NUM_LLR 27000
// ============================================================================== // ==============================================================================
// GLOBAL CONSTANT VARIABLES // GLOBAL CONSTANT VARIABLES
......
This diff is collapsed.
...@@ -58,8 +58,7 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc ...@@ -58,8 +58,7 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc
macro_segment = 8*impp->macro_num; macro_segment = 8*impp->macro_num;
// macro_segment_end = (n_segments > 8*(macro_num+1)) ? 8*(macro_num+1) : n_segments; macro_segment_end = (impp->n_segments > 8*(impp->macro_num+1)) ? 8*(impp->macro_num+1) : impp->n_segments;
macro_segment_end = macro_segment + (impp->n_segments > 8 ? 8 : impp->n_segments);
///printf("macro_segment: %d\n", macro_segment); ///printf("macro_segment: %d\n", macro_segment);
///printf("macro_segment_end: %d\n", macro_segment_end ); ///printf("macro_segment_end: %d\n", macro_segment_end );
......
...@@ -187,7 +187,9 @@ void nr_polar_print_polarParams(t_nrPolar_params *polarParams); ...@@ -187,7 +187,9 @@ void nr_polar_print_polarParams(t_nrPolar_params *polarParams);
t_nrPolar_params *nr_polar_params (int8_t messageType, t_nrPolar_params *nr_polar_params (int8_t messageType,
uint16_t messageLength, uint16_t messageLength,
uint8_t aggregation_level); uint8_t aggregation_level,
int decoder_flag,
t_nrPolar_params **polarList_ext);
uint16_t nr_polar_aggregation_prime (uint8_t aggregation_level); uint16_t nr_polar_aggregation_prime (uint8_t aggregation_level);
......
...@@ -40,7 +40,8 @@ static int intcmp(const void *p1,const void *p2) { ...@@ -40,7 +40,8 @@ static int intcmp(const void *p1,const void *p2) {
static void nr_polar_init(t_nrPolar_params * *polarParams, static void nr_polar_init(t_nrPolar_params * *polarParams,
int8_t messageType, int8_t messageType,
uint16_t messageLength, uint16_t messageLength,
uint8_t aggregation_level) { uint8_t aggregation_level,
int decoder_flag) {
t_nrPolar_params *currentPtr = *polarParams; t_nrPolar_params *currentPtr = *polarParams;
uint16_t aggregation_prime = nr_polar_aggregation_prime(aggregation_level); uint16_t aggregation_prime = nr_polar_aggregation_prime(aggregation_level);
...@@ -150,7 +151,7 @@ static void nr_polar_init(t_nrPolar_params * *polarParams, ...@@ -150,7 +151,7 @@ static void nr_polar_init(t_nrPolar_params * *polarParams,
newPolarInitNode->i_bil, newPolarInitNode->i_bil,
newPolarInitNode->encoderLength); newPolarInitNode->encoderLength);
free(J); free(J);
build_decoder_tree(newPolarInitNode); if (decoder_flag == 1) build_decoder_tree(newPolarInitNode);
build_polar_tables(newPolarInitNode); build_polar_tables(newPolarInitNode);
init_polar_deinterleaver_table(newPolarInitNode); init_polar_deinterleaver_table(newPolarInitNode);
//printf("decoder tree nodes %d\n",newPolarInitNode->tree.num_nodes); //printf("decoder tree nodes %d\n",newPolarInitNode->tree.num_nodes);
...@@ -183,10 +184,13 @@ void nr_polar_print_polarParams(t_nrPolar_params *polarParams) { ...@@ -183,10 +184,13 @@ void nr_polar_print_polarParams(t_nrPolar_params *polarParams) {
t_nrPolar_params *nr_polar_params (int8_t messageType, t_nrPolar_params *nr_polar_params (int8_t messageType,
uint16_t messageLength, uint16_t messageLength,
uint8_t aggregation_level) { uint8_t aggregation_level,
int decoding_flag,
t_nrPolar_params **polarList_ext) {
static t_nrPolar_params *polarList = NULL; static t_nrPolar_params *polarList = NULL;
nr_polar_init(&polarList, messageType,messageLength,aggregation_level); nr_polar_init(polarList_ext != NULL ? polarList_ext : &polarList,
t_nrPolar_params *polarParams=polarList; messageType,messageLength,aggregation_level,decoding_flag);
t_nrPolar_params *polarParams=polarList_ext != NULL ? *polarList_ext : polarList;
const int tag=messageType * messageLength * nr_polar_aggregation_prime(aggregation_level); const int tag=messageType * messageLength * nr_polar_aggregation_prime(aggregation_level);
while (polarParams != NULL) { while (polarParams != NULL) {
......
This diff is collapsed.
...@@ -63,7 +63,7 @@ int32_t nr_segmentation(unsigned char *input_buffer, ...@@ -63,7 +63,7 @@ int32_t nr_segmentation(unsigned char *input_buffer,
#endif #endif
} }
if ((*C)>MAX_NUM_DLSCH_SEGMENTS) { if ((*C)>MAX_NUM_NR_DLSCH_SEGMENTS) {
LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime); LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime);
return(-1); return(-1);
} }
......
...@@ -161,6 +161,8 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -161,6 +161,8 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,
if (frame_parms->frame_type == TDD) set_S_config(frame_parms); if (frame_parms->frame_type == TDD) set_S_config(frame_parms);
frame_parms->samples_per_subframe=frame_parms->samples_per_tti;
frame_parms->samples_per_slot=frame_parms->samples_per_tti>>1;
// frame_parms->tdd_config=3; // frame_parms->tdd_config=3;
return(0); return(0);
} }
......
This diff is collapsed.
...@@ -41,6 +41,13 @@ int nr_phy_init_RU(RU_t *ru) { ...@@ -41,6 +41,13 @@ int nr_phy_init_RU(RU_t *ru) {
LOG_I(PHY,"Initializing RU signal buffers (if_south %s) nb_tx %d\n",ru_if_types[ru->if_south],ru->nb_tx); LOG_I(PHY,"Initializing RU signal buffers (if_south %s) nb_tx %d\n",ru_if_types[ru->if_south],ru->nb_tx);
nfapi_nr_config_request_scf_t *cfg;
ru->nb_log_antennas=0;
for (int n=0;n<RC.nb_nr_L1_inst;n++) {
cfg = &RC.gNB[n]->gNB_config;
if (cfg->carrier_config.num_tx_ant.value > ru->nb_log_antennas) ru->nb_log_antennas = cfg->carrier_config.num_tx_ant.value;
}
AssertFatal(ru->nb_log_antennas > 0 && ru->nb_log_antennas < 13, "ru->nb_log_antennas %d ! \n",ru->nb_log_antennas);
if (ru->if_south <= REMOTE_IF5) { // this means REMOTE_IF5 or LOCAL_RF, so allocate memory for time-domain signals if (ru->if_south <= REMOTE_IF5) { // this means REMOTE_IF5 or LOCAL_RF, so allocate memory for time-domain signals
// Time-domain signals // Time-domain signals
ru->common.txdata = (int32_t**)malloc16(ru->nb_tx*sizeof(int32_t*)); ru->common.txdata = (int32_t**)malloc16(ru->nb_tx*sizeof(int32_t*));
...@@ -75,8 +82,8 @@ int nr_phy_init_RU(RU_t *ru) { ...@@ -75,8 +82,8 @@ int nr_phy_init_RU(RU_t *ru) {
// allocate precoding input buffers (TX) // allocate precoding input buffers (TX)
ru->common.txdataF = (int32_t **)malloc16(15*sizeof(int32_t*)); ru->common.txdataF = (int32_t **)malloc16(ru->nb_tx*sizeof(int32_t*));
for(i=0; i< 15; ++i) ru->common.txdataF[i] = (int32_t*)malloc16_clear(fp->samples_per_frame_wCP*sizeof(int32_t)); // [hna] samples_per_frame without CP for(i=0; i< ru->nb_tx; ++i) ru->common.txdataF[i] = (int32_t*)malloc16_clear(fp->samples_per_frame_wCP*sizeof(int32_t)); // [hna] samples_per_frame without CP
// allocate IFFT input buffers (TX) // allocate IFFT input buffers (TX)
ru->common.txdataF_BF = (int32_t **)malloc16(ru->nb_tx*sizeof(int32_t*)); ru->common.txdataF_BF = (int32_t **)malloc16(ru->nb_tx*sizeof(int32_t*));
...@@ -98,7 +105,6 @@ int nr_phy_init_RU(RU_t *ru) { ...@@ -98,7 +105,6 @@ int nr_phy_init_RU(RU_t *ru) {
// AssertFatal(ru->nb_rx <= sizeof(ru->prach_rxsigF) / sizeof(ru->prach_rxsigF[0]), // AssertFatal(ru->nb_rx <= sizeof(ru->prach_rxsigF) / sizeof(ru->prach_rxsigF[0]),
// "nb_antennas_rx too large"); // "nb_antennas_rx too large");
ru->prach_rxsigF = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*)); ru->prach_rxsigF = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*));
for (j=0;j<4;j++) ru->prach_rxsigF_br[j] = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*));
for (i=0; i<ru->nb_rx; i++) { for (i=0; i<ru->nb_rx; i++) {
ru->prach_rxsigF[i] = (int16_t*)malloc16_clear( fp->ofdm_symbol_size*12*2*sizeof(int16_t) ); ru->prach_rxsigF[i] = (int16_t*)malloc16_clear( fp->ofdm_symbol_size*12*2*sizeof(int16_t) );
...@@ -111,8 +117,8 @@ int nr_phy_init_RU(RU_t *ru) { ...@@ -111,8 +117,8 @@ int nr_phy_init_RU(RU_t *ru) {
LOG_E(PHY,"[INIT] %s() RC.nb_nr_L1_inst:%d \n", __FUNCTION__, RC.nb_nr_L1_inst); LOG_E(PHY,"[INIT] %s() RC.nb_nr_L1_inst:%d \n", __FUNCTION__, RC.nb_nr_L1_inst);
int beam_count = 0; int beam_count = 0;
if (ru->nb_tx>1) { if (ru->nb_log_antennas>1) {
for (p=0;p<fp->Lmax;p++) { for (p=0;p<ru->nb_log_antennas;p++) {
if ((fp->L_ssb >> p) & 0x01) if ((fp->L_ssb >> p) & 0x01)
beam_count++; beam_count++;
} }
...@@ -120,7 +126,7 @@ int nr_phy_init_RU(RU_t *ru) { ...@@ -120,7 +126,7 @@ int nr_phy_init_RU(RU_t *ru) {
int l_ind = 0; int l_ind = 0;
for (i=0; i<RC.nb_nr_L1_inst; i++) { for (i=0; i<RC.nb_nr_L1_inst; i++) {
for (p=0;p<fp->Lmax;p++) { for (p=0;p<ru->nb_log_antennas;p++) {
if ((fp->L_ssb >> p) & 0x01) { if ((fp->L_ssb >> p) & 0x01) {
ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*)); ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*));
for (j=0; j<ru->nb_tx; j++) { for (j=0; j<ru->nb_tx; j++) {
...@@ -177,9 +183,6 @@ void nr_phy_free_RU(RU_t *ru) ...@@ -177,9 +183,6 @@ void nr_phy_free_RU(RU_t *ru)
for (i = 0; i < ru->nb_rx; i++) { for (i = 0; i < ru->nb_rx; i++) {
free_and_zero(ru->prach_rxsigF[i]); free_and_zero(ru->prach_rxsigF[i]);
} }
for (j = 0; j < 4; j++) free_and_zero(ru->prach_rxsigF_br[j]);
free_and_zero(ru->prach_rxsigF);
/* ru->prach_rxsigF_br is not allocated -> don't free */
for (i = 0; i < RC.nb_nr_L1_inst; i++) { for (i = 0; i < RC.nb_nr_L1_inst; i++) {
for (p = 0; p < 15; p++) { for (p = 0; p < 15; p++) {
......
This diff is collapsed.
This diff is collapsed.
...@@ -392,10 +392,9 @@ void phy_config_update_sib13_request(PHY_Config_t *phy_config); ...@@ -392,10 +392,9 @@ void phy_config_update_sib13_request(PHY_Config_t *phy_config);
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf); int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms); void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp, uint8_t i_ssb, uint8_t half_frame_index); int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp);
int nr_is_ssb_slot(nfapi_nr_config_request_t *cfg, int slot, int frame); int nr_init_frame_parms(nfapi_nr_config_request_scf_t *config, NR_DL_FRAME_PARMS *frame_parms);
int nr_init_frame_parms(nfapi_nr_config_request_t *config, NR_DL_FRAME_PARMS *frame_parms); int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms,fapi_nr_config_request_t *config,int Ncp);
int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms,int mu,int Ncp,int N_RB_DL,int n_ssb_crb,int ssb_subcarrier_offset);
int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB,uint8_t abstraction_flag); int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB,uint8_t abstraction_flag);
void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag); void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag);
void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms); void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms);
......
...@@ -54,6 +54,12 @@ int nr_slot_fep(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -54,6 +54,12 @@ int nr_slot_fep(PHY_VARS_NR_UE *phy_vars_ue,
int sample_offset, int sample_offset,
int no_prefix); int no_prefix);
int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue,
unsigned char symbol,
unsigned char Ns,
int sample_offset,
int no_prefix);
int slot_fep_mbsfn(PHY_VARS_UE *phy_vars_ue, int slot_fep_mbsfn(PHY_VARS_UE *phy_vars_ue,
unsigned char l, unsigned char l,
int subframe, int subframe,
......
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.
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.
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.
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.
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.
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