Commit 9d3c8011 authored by Francesco Mani's avatar Francesco Mani

Revert "Merge branch 'ru-parallel-beamforming-merge' into nr_beamforming"

This reverts commit fe6130c8, reversing
changes made to 2406662e.
parent fe6130c8
...@@ -131,8 +131,8 @@ pipeline { ...@@ -131,8 +131,8 @@ pipeline {
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.FlexRanRtcGitLabRepository_Credentials}", usernameVariable: 'git_username', passwordVariable: 'git_password'] [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.FlexRanRtcGitLabRepository_Credentials}", usernameVariable: 'git_username', passwordVariable: 'git_password']
]) { ]) {
sh "git clone https://${git_username}:${git_password}@gitlab.eurecom.fr/flexran/flexran-rtc.git . > ../git_clone.log 2>&1" sh "git clone https://${git_username}:${git_password}@gitlab.eurecom.fr/flexran/flexran-rtc.git . > ../git_clone.log 2>&1"
sh "git checkout develop >> ../git_clone.log 2>&1"
} }
sh "sed -i -e 's#add-apt-repository.*cleishm.*neo4j#add-apt-repository ppa:cleishm/neo4j -y#' -e 's#libneo4j-client-dev#libneo4j-client-dev -y#' tools/install_dependencies"
sh "zip -r -qq flexran.zip ." sh "zip -r -qq flexran.zip ."
} }
} }
......
...@@ -179,12 +179,8 @@ function build_on_vm { ...@@ -179,12 +179,8 @@ function build_on_vm {
echo "cp /home/ubuntu/zip-install.txt cmake_targets/log" >> $VM_CMDS echo "cp /home/ubuntu/zip-install.txt cmake_targets/log" >> $VM_CMDS
echo "echo \"./tools/install_dependencies \"" >> $VM_CMDS echo "echo \"./tools/install_dependencies \"" >> $VM_CMDS
echo "./tools/install_dependencies > cmake_targets/log/install-build.txt 2>&1" >> $VM_CMDS echo "./tools/install_dependencies > cmake_targets/log/install-build.txt 2>&1" >> $VM_CMDS
echo "echo \"mkdir build\"" >> $VM_CMDS
echo "mkdir build" >> $VM_CMDS
echo "echo \"cd build\"" >> $VM_CMDS
echo "cd build" >> $VM_CMDS
echo "echo \"$BUILD_OPTIONS \"" >> $VM_CMDS echo "echo \"$BUILD_OPTIONS \"" >> $VM_CMDS
echo "$BUILD_OPTIONS > ../cmake_targets/log/rt_controller.Rel15.txt 2>&1" >> $VM_CMDS echo "$BUILD_OPTIONS > cmake_targets/log/rt_controller.Rel15.txt 2>&1" >> $VM_CMDS
fi fi
if [[ "$VM_NAME" != *"-cppcheck"* ]] && [[ "$VM_NAME" != *"-flexran-rtc"* ]] if [[ "$VM_NAME" != *"-cppcheck"* ]] && [[ "$VM_NAME" != *"-flexran-rtc"* ]]
then then
......
...@@ -372,7 +372,7 @@ class SSHConnection(): ...@@ -372,7 +372,7 @@ class SSHConnection():
self.air_interface = 'lte' self.air_interface = 'lte'
self.command('mkdir -p ' + lSourcePath, '\$', 5) self.command('mkdir -p ' + lSourcePath, '\$', 5)
self.command('cd ' + lSourcePath, '\$', 5) self.command('cd ' + lSourcePath, '\$', 5)
self.command('if [ ! -e .git ]; then stdbuf -o0 git clone ' + self.ranRepository + ' .; else stdbuf -o0 git fetch --prune; fi', '\$', 600) self.command('if [ ! -e .git ]; then stdbuf -o0 git clone ' + self.ranRepository + ' .; else stdbuf -o0 git fetch; fi', '\$', 600)
# Raphael: here add a check if git clone or git fetch went smoothly # Raphael: here add a check if git clone or git fetch went smoothly
self.command('git config user.email "jenkins@openairinterface.org"', '\$', 5) self.command('git config user.email "jenkins@openairinterface.org"', '\$', 5)
self.command('git config user.name "OAI Jenkins"', '\$', 5) self.command('git config user.name "OAI Jenkins"', '\$', 5)
...@@ -537,7 +537,7 @@ class SSHConnection(): ...@@ -537,7 +537,7 @@ class SSHConnection():
ue_prefix = '' ue_prefix = ''
self.command('mkdir -p ' + self.UESourceCodePath, '\$', 5) self.command('mkdir -p ' + self.UESourceCodePath, '\$', 5)
self.command('cd ' + self.UESourceCodePath, '\$', 5) self.command('cd ' + self.UESourceCodePath, '\$', 5)
self.command('if [ ! -e .git ]; then stdbuf -o0 git clone ' + self.ranRepository + ' .; else stdbuf -o0 git fetch --prune; fi', '\$', 600) self.command('if [ ! -e .git ]; then stdbuf -o0 git clone ' + self.ranRepository + ' .; else stdbuf -o0 git fetch; fi', '\$', 600)
# here add a check if git clone or git fetch went smoothly # here add a check if git clone or git fetch went smoothly
self.command('git config user.email "jenkins@openairinterface.org"', '\$', 5) self.command('git config user.email "jenkins@openairinterface.org"', '\$', 5)
self.command('git config user.name "OAI Jenkins"', '\$', 5) self.command('git config user.name "OAI Jenkins"', '\$', 5)
......
...@@ -222,7 +222,7 @@ function variant__v8__ue_ethernet { ...@@ -222,7 +222,7 @@ function variant__v8__ue_ethernet {
function variant__v10__flexran_rtc { function variant__v10__flexran_rtc {
ARCHIVES_LOC=flexran ARCHIVES_LOC=flexran
NB_PATTERN_FILES=1 NB_PATTERN_FILES=1
BUILD_OPTIONS="cmake .. && make -j2" BUILD_OPTIONS="cmake . && make -j2"
VARIANT_INFO="non-OSA" VARIANT_INFO="non-OSA"
} }
......
...@@ -1084,32 +1084,33 @@ ...@@ -1084,32 +1084,33 @@
(Test3: 273 PRB), (Test3: 273 PRB),
(Test4: 106 PRB 12 CSET-Offset), (Test4: 106 PRB 12 CSET-Offset),
(Test5: 217 PRB 48 CSET-Offset), (Test5: 217 PRB 48 CSET-Offset),
(Test6: 106 PRB 25 PDSCH-Offset), <!--(Test6: 106 PRB 25 PDSCH-Offset),
(Test7: 106 PRB 51 PDSCH-Offset), (Test7: 106 PRB 51 PDSCH-Offset),
(Test8: 217 PRB 100 PDSCH-PRBs), (Test8: 217 PRB 100 PDSCH-PRBs),
(Test9: 217 PRB 80 PDSCH-Offset), (Test9: 217 PRB 80 PDSCH-Offset),
(Test10: 217 PRB 100 PDSCH-PRBs 80 PDSCH-Offset), (Test10: 217 PRB 100 PDSCH-PRBs 80 PDSCH-Offset),
(Test11: 106 PRBs 50 PDSCH-PRBs MCS Index 28</desc> (Test6: 106 PRB 0 MCS),-->
(Test7: 273 PRB 28 MCS)</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
-n100 -R217 -b217 -n100 -R217
-n100 -R273 -b273 -n100 -R273
-n100 -R106 -o12 -n100 -R106 -o12
-n100 -R217 -o48 -n100 -R217 -o48
-n100 -R106 -a25 <!---n100 -R106 -a25
-n100 -R106 -a51 -n100 -R106 -a51
-n100 -R217 -b100 -n100 -R217 -b100
-n100 -R217 -a80 -n100 -R217 -a80
-n100 -R217 -a80 -b100 -n100 -R217 -a80 -b100
-n100 -e28</main_exec_args> -n100 -R106 -e0-->
<tags>nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 -n100 -R273 -e28</main_exec_args>
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-->nr_dlsim.test6 nr_dlsim.test7</tags>
<search_expr_true>PDSCH test OK</search_expr_true> <search_expr_true>"PDCCH test OK" "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>
</testCase> </testCase>
...@@ -1239,23 +1240,19 @@ ...@@ -1239,23 +1240,19 @@
<testCase id="015111"> <testCase id="015111">
<class>execution</class> <class>execution</class>
<desc>nr_ulsim Test cases. (Test1: MCS 9 106 PRBs), <desc>nr_ulsim Test cases. (Test1: MCS 9),
(Test2: MCS 16 50 PRBs), (Test2: MCS 16),
(Test3: MCS 28 50 PRBs), (Test3: MCS 28)</desc>
(Test4: MCS 9 217 PRBs),
(Test5: MCS 9 273 PRBs)</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_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>-f100 -m9 -s10
-f100 -m16 -s20 -f100 -m16 -s20
-f100 -m28 -s30 -f100 -m28 -s30</main_exec_args>
-f100 -m9 -R217 -r217 -s10 <tags>nr_ulsim.test1 nr_ulsim.test2 nr_ulsim.test3</tags>
-f100 -m9 -R273 -r273 -s10</main_exec_args>
<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>
<nruns>3</nruns> <nruns>3</nruns>
......
...@@ -247,8 +247,7 @@ const char* eurecomVariablesNames[] = { ...@@ -247,8 +247,7 @@ const char* eurecomVariablesNames[] = {
"slot_number_TX0_gNB", "slot_number_TX0_gNB",
"slot_number_TX1_gNB", "slot_number_TX1_gNB",
"slot_number_RX0_gNB", "slot_number_RX0_gNB",
"slot_number_RX1_gNB", "slot_number_RX1_gNB"
"ru_tx_ofdm_mask"
}; };
const char* eurecomFunctionsNames[] = { const char* eurecomFunctionsNames[] = {
...@@ -329,13 +328,6 @@ const char* eurecomFunctionsNames[] = { ...@@ -329,13 +328,6 @@ const char* eurecomFunctionsNames[] = {
"phy_procedures_ru_feptx_ofdm7", "phy_procedures_ru_feptx_ofdm7",
"phy_procedures_ru_feptx_ofdm8", "phy_procedures_ru_feptx_ofdm8",
"phy_procedures_ru_feptx_ofdm9", "phy_procedures_ru_feptx_ofdm9",
"phy_procedures_ru_feptx_ofdm10",
"phy_procedures_ru_feptx_ofdm11",
"phy_procedures_ru_feptx_ofdm12",
"phy_procedures_ru_feptx_ofdm13",
"phy_procedures_ru_feptx_ofdm14",
"phy_procedures_ru_feptx_ofdm15",
"phy_procedures_ru_feptx_ofdm16",
"phy_procedures_ru_feptx_prec0", "phy_procedures_ru_feptx_prec0",
"phy_procedures_ru_feptx_prec1", "phy_procedures_ru_feptx_prec1",
"phy_procedures_ru_feptx_prec2", "phy_procedures_ru_feptx_prec2",
...@@ -510,7 +502,6 @@ const char* eurecomFunctionsNames[] = { ...@@ -510,7 +502,6 @@ const char* eurecomFunctionsNames[] = {
"pdcch_interleaving", "pdcch_interleaving",
"pdcch_tx", "pdcch_tx",
/*NR softmodem signal*/ /*NR softmodem signal*/
"wakeup_txfh",
"gNB_thread_rxtx0", "gNB_thread_rxtx0",
"gNB_thread_rxtx1" "gNB_thread_rxtx1"
}; };
......
...@@ -225,7 +225,6 @@ typedef enum { ...@@ -225,7 +225,6 @@ typedef enum {
VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_TX1_GNB, VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_TX1_GNB,
VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_RX0_GNB, VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_RX0_GNB,
VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_RX1_GNB, VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_RX1_GNB,
VCD_SIGNAL_DUMPER_VARIABLES_RU_TX_OFDM_MASK,
VCD_SIGNAL_DUMPER_VARIABLES_END VCD_SIGNAL_DUMPER_VARIABLES_END
...@@ -310,13 +309,6 @@ typedef enum { ...@@ -310,13 +309,6 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM7, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM7,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM8, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM8,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM9, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM9,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM10,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM11,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM12,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM13,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM14,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM15,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM16,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC1, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC1,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC2, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC2,
...@@ -502,7 +494,6 @@ typedef enum { ...@@ -502,7 +494,6 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_TX, VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_TX,
/*NR softmodem signal*/ /*NR softmodem signal*/
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,
......
...@@ -73,10 +73,10 @@ typedef struct { ...@@ -73,10 +73,10 @@ 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 (245) #define VCD_NUM_FUNCTIONS (237)//(232)
/* 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 (185)
/* first VCD function (to be kept up to date! see in T_messages.txt) */ /* first VCD function (to be kept up to date! see in T_messages.txt) */
#define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP) #define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP)
......
...@@ -2050,11 +2050,6 @@ ID = VCD_VARIABLE_SLOT_NUMBER_RX1_GNB ...@@ -2050,11 +2050,6 @@ ID = VCD_VARIABLE_SLOT_NUMBER_RX1_GNB
GROUP = ALL:VCD:ENB:VCD_VARIABLE GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value FORMAT = ulong,value
VCD_NAME = slot_number_RX1_gNB VCD_NAME = slot_number_RX1_gNB
ID = VCD_VARIABLE_RU_TX_OFDM_MASK
DESC = VCD variable RU_TX_OFDM_MASK
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = ru_tx_ofdm_mask
#functions #functions
...@@ -2423,41 +2418,6 @@ ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM9 ...@@ -2423,41 +2418,6 @@ ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM9
GROUP = ALL:VCD:ENB:VCD_FUNCTION GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value FORMAT = int,value
VCD_NAME = phy_procedures_ru_feptx_ofdm9 VCD_NAME = phy_procedures_ru_feptx_ofdm9
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM10
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM10
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = phy_procedures_ru_feptx_ofdm10
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM11
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM11
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = phy_procedures_ru_feptx_ofdm11
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM12
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM12
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = phy_procedures_ru_feptx_ofdm12
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM13
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM13
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = phy_procedures_ru_feptx_ofdm13
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM14
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM14
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = phy_procedures_ru_feptx_ofdm14
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM15
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM15
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = phy_procedures_ru_feptx_ofdm15
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM16
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM16
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = phy_procedures_ru_feptx_ofdm16
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_PREC ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_PREC
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_PREC DESC = VCD function PHY_PROCEDURES_RU_FEPTX_PREC
GROUP = ALL:VCD:ENB:VCD_FUNCTION GROUP = ALL:VCD:ENB:VCD_FUNCTION
...@@ -3270,11 +3230,6 @@ ID = VCD_FUNCTION_PDCCH_TX ...@@ -3270,11 +3230,6 @@ ID = VCD_FUNCTION_PDCCH_TX
VCD_NAME = pdcch_tx VCD_NAME = pdcch_tx
#function for gNB #function for gNB
ID = VCD_FUNCTION_WAKEUP_TXFH
DESC = VCD function WAKEUP_TXFH
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = wakeup_txfh
ID = VCD_FUNCTION_gNB_PROC_RXTX0 ID = VCD_FUNCTION_gNB_PROC_RXTX0
DESC = VCD function gNB_PROC_RXTX0 DESC = VCD function gNB_PROC_RXTX0
GROUP = ALL:VCD:ENB:VCD_FUNCTION GROUP = ALL:VCD:ENB:VCD_FUNCTION
......
...@@ -290,8 +290,6 @@ static void *gNB_L1_thread_tx(void *param) { ...@@ -290,8 +290,6 @@ static void *gNB_L1_thread_tx(void *param) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_TX1_GNB,slot_tx); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_TX1_GNB,slot_tx);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_GNB,frame_tx); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_GNB,frame_tx);
phy_procedures_gNB_TX(gNB, frame_tx,slot_tx, 1); phy_procedures_gNB_TX(gNB, frame_tx,slot_tx, 1);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_WAKEUP_TXFH, 1 );
pthread_mutex_lock( &L1_proc_tx->mutex ); pthread_mutex_lock( &L1_proc_tx->mutex );
L1_proc_tx->instance_cnt = -1; L1_proc_tx->instance_cnt = -1;
...@@ -303,7 +301,6 @@ static void *gNB_L1_thread_tx(void *param) { ...@@ -303,7 +301,6 @@ static void *gNB_L1_thread_tx(void *param) {
pthread_mutex_unlock(&L1_proc_tx->mutex); pthread_mutex_unlock(&L1_proc_tx->mutex);
wakeup_txfh(gNB,L1_proc_tx,frame_tx,slot_tx,timestamp_tx); wakeup_txfh(gNB,L1_proc_tx,frame_tx,slot_tx,timestamp_tx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_WAKEUP_TXFH, 0 );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1, 0 );
} }
...@@ -423,10 +420,10 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot ...@@ -423,10 +420,10 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot
// note this should depend on the numerology used by the TX L1 thread, set here for 500us slot time // note this should depend on the numerology used by the TX L1 thread, set here for 500us slot time
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL,1);
waitret=wait_on_condition(&proc->mutex_RUs_tx,&proc->cond_RUs,&proc->instance_cnt_RUs,"wakeup_txfh"); waitret=timedwait_on_condition(&proc->mutex_RUs_tx,&proc->cond_RUs,&proc->instance_cnt_RUs,"wakeup_txfh",1000000);
AssertFatal(release_thread(&proc->mutex_RUs_tx,&proc->instance_cnt_RUs,"wakeup_txfh")==0, "error releaseing gNB lock on RUs\n");
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL,0);
AssertFatal(release_thread(&proc->mutex_RUs_tx,&proc->instance_cnt_RUs,"wakeup_txfh")==0, "error releaseing gNB lock on RUs\n");
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE,proc->instance_cnt_RUs); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE,proc->instance_cnt_RUs);
if (waitret == ETIMEDOUT) { if (waitret == ETIMEDOUT) {
...@@ -451,7 +448,7 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot ...@@ -451,7 +448,7 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot
ru = gNB->RU_list[i]; ru = gNB->RU_list[i];
ru_proc = &ru->proc; ru_proc = &ru->proc;
//AssertFatal((ret = pthread_mutex_lock(&ru_proc->mutex_gNBs))==0,"ERROR pthread_mutex_lock failed on mutex_gNBs L1_thread_tx with ret=%d\n",ret); AssertFatal((ret = pthread_mutex_lock(&ru_proc->mutex_gNBs))==0,"ERROR pthread_mutex_lock failed on mutex_gNBs L1_thread_tx with ret=%d\n",ret);
if (ru_proc->instance_cnt_gNBs == 0) { if (ru_proc->instance_cnt_gNBs == 0) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST_UE, 1); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST_UE, 1);
...@@ -459,7 +456,7 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot ...@@ -459,7 +456,7 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot
AssertFatal((ret=pthread_mutex_lock(&gNB->proc.mutex_RU_tx))==0,"mutex_lock returns %d\n",ret); AssertFatal((ret=pthread_mutex_lock(&gNB->proc.mutex_RU_tx))==0,"mutex_lock returns %d\n",ret);
gNB->proc.RU_mask_tx = 0; gNB->proc.RU_mask_tx = 0;
AssertFatal((ret=pthread_mutex_unlock(&gNB->proc.mutex_RU_tx))==0,"mutex_unlock returns %d\n",ret); AssertFatal((ret=pthread_mutex_unlock(&gNB->proc.mutex_RU_tx))==0,"mutex_unlock returns %d\n",ret);
//AssertFatal((ret=pthread_mutex_unlock( &ru_proc->mutex_gNBs ))==0,"mutex_unlock return %d\n",ret); AssertFatal((ret=pthread_mutex_unlock( &ru_proc->mutex_gNBs ))==0,"mutex_unlock return %d\n",ret);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST_UE, 0); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST_UE, 0);
return(-1); return(-1);
...@@ -525,8 +522,6 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) { ...@@ -525,8 +522,6 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) {
RU_proc_t *ru_proc=&ru->proc; RU_proc_t *ru_proc=&ru->proc;
int ret; int ret;
int i; int i;
struct timespec abstime;
int time_ns = 50000;
AssertFatal((ret=pthread_mutex_lock(&proc->mutex_RU))==0,"mutex_lock returns %d\n",ret); AssertFatal((ret=pthread_mutex_lock(&proc->mutex_RU))==0,"mutex_lock returns %d\n",ret);
for (i=0;i<gNB->num_RU;i++) { for (i=0;i<gNB->num_RU;i++) {
...@@ -547,22 +542,14 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) { ...@@ -547,22 +542,14 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) {
AssertFatal((ret=pthread_mutex_unlock(&proc->mutex_RU))==0,"muex_unlock returns %d\n",ret); AssertFatal((ret=pthread_mutex_unlock(&proc->mutex_RU))==0,"muex_unlock returns %d\n",ret);
} }
clock_gettime(CLOCK_REALTIME, &abstime);
abstime.tv_nsec = abstime.tv_nsec + time_ns;
if (abstime.tv_nsec >= 1000*1000*1000) {
abstime.tv_nsec -= 1000*1000*1000;
abstime.tv_sec += 1;
}
// wake up TX for subframe n+sl_ahead // wake up TX for subframe n+sl_ahead
// lock the TX mutex and make sure the thread is ready // lock the TX mutex and make sure the thread is ready
AssertFatal((ret=pthread_mutex_timedlock(&L1_proc->mutex, &abstime)) == 0,"mutex_lock returns %d\n", ret); AssertFatal((ret=pthread_mutex_lock(&L1_proc->mutex)) == 0,"mutex_lock returns %d\n", ret);
if (L1_proc->instance_cnt == 0) { // L1_thread is busy so abort the subframe if (L1_proc->instance_cnt == 0) { // L1_thread is busy so abort the subframe
AssertFatal((ret=pthread_mutex_unlock( &L1_proc->mutex))==0,"muex_unlock return %d\n",ret); AssertFatal((ret=pthread_mutex_unlock( &L1_proc->mutex))==0,"muex_unlock return %d\n",ret);
LOG_W(PHY,"L1_thread isn't ready in %d.%d, aborting RX processing\n",ru_proc->frame_rx,ru_proc->tti_rx); LOG_W(PHY,"L1_thread isn't ready in %d.%d, aborting RX processing\n",ru_proc->frame_rx,ru_proc->tti_rx);
return(-1);
} }
++L1_proc->instance_cnt; ++L1_proc->instance_cnt;
......
...@@ -678,6 +678,9 @@ void rx_rf(RU_t *ru,int *frame,int *slot) { ...@@ -678,6 +678,9 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_slot*fp->slots_per_frame))&1023; proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_slot*fp->slots_per_frame))&1023;
proc->tti_rx = (proc->timestamp_rx / fp->samples_per_slot)%fp->slots_per_frame; proc->tti_rx = (proc->timestamp_rx / fp->samples_per_slot)%fp->slots_per_frame;
// synchronize first reception to frame 0 subframe 0 // synchronize first reception to frame 0 subframe 0
proc->timestamp_tx = proc->timestamp_rx+(sl_ahead*fp->samples_per_slot);
proc->tti_tx = (proc->tti_rx+sl_ahead)%fp->slots_per_frame;
proc->frame_tx = (proc->tti_rx>(fp->slots_per_frame-1-sl_ahead)) ? (proc->frame_rx+1)&1023 : proc->frame_rx;
LOG_D(PHY,"RU %d/%d TS %llu (off %d), frame %d, slot %d.%d / %d\n", LOG_D(PHY,"RU %d/%d TS %llu (off %d), frame %d, slot %d.%d / %d\n",
ru->idx, ru->idx,
0, 0,
...@@ -762,22 +765,18 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { ...@@ -762,22 +765,18 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, frame ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, frame );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TTI_NUMBER_TX0_RU, slot ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TTI_NUMBER_TX0_RU, slot );
for (i=0; i<ru->nb_tx; i++){ for (i=0; i<ru->nb_tx; i++)
txp[i] = (void *)&ru->common.txdata[i][(slot*fp->samples_per_slot)-sf_extension]; txp[i] = (void *)&ru->common.txdata[i][(slot*fp->samples_per_slot)-sf_extension];
}
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (timestamp-ru->openair0_cfg.tx_sample_advance)&0xffffffff ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (timestamp-ru->openair0_cfg.tx_sample_advance)&0xffffffff );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 );
// prepare tx buffer pointers // prepare tx buffer pointers
start_meas(&ru->tx_fhaul);
txs = ru->rfdevice.trx_write_func(&ru->rfdevice, txs = ru->rfdevice.trx_write_func(&ru->rfdevice,
timestamp+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension, timestamp+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension,
txp, txp,
siglen+sf_extension, siglen+sf_extension,
ru->nb_tx, ru->nb_tx,
flags); flags);
stop_meas(&ru->tx_fhaul);
LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, subframe %d\n",ru->idx, LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, subframe %d\n",ru->idx,
(long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot); (long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
...@@ -786,7 +785,6 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { ...@@ -786,7 +785,6 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
} }
/*! /*!
* \brief The Asynchronous RX/TX FH thread of RAU/RCC/gNB/RRU. * \brief The Asynchronous RX/TX FH thread of RAU/RCC/gNB/RRU.
* This handles the RX FH for an asynchronous RRU/UE * This handles the RX FH for an asynchronous RRU/UE
...@@ -875,7 +873,7 @@ static void *ru_thread_prach( void *param ) { ...@@ -875,7 +873,7 @@ static void *ru_thread_prach( void *param ) {
0,0 0,0
); );
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 0 );*/ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 0 ); */
if (release_thread(&proc->mutex_prach,&proc->instance_cnt_prach,"ru_prach_thread") < 0) break; if (release_thread(&proc->mutex_prach,&proc->instance_cnt_prach,"ru_prach_thread") < 0) break;
} }
...@@ -1212,22 +1210,14 @@ static void *ru_stats_thread(void *param) { ...@@ -1212,22 +1210,14 @@ static void *ru_stats_thread(void *param) {
sleep(1); sleep(1);
if (opp_enabled == 1) { if (opp_enabled == 1) {
if (ru->feptx_prec) {
print_meas(&ru->precoding_stats,"feptx_prec",NULL,NULL);
}
if (ru->feprx) print_meas(&ru->ofdm_demod_stats,"feprx",NULL,NULL); if (ru->feprx) print_meas(&ru->ofdm_demod_stats,"feprx",NULL,NULL);
if (ru->feptx_ofdm){ if (ru->feptx_ofdm) print_meas(&ru->ofdm_mod_stats,"feptx_ofdm",NULL,NULL);
print_meas(&ru->txdataF_copy_stats,"txdataF_copy",NULL,NULL);
print_meas(&ru->ofdm_mod_stats,"feptx_ofdm",NULL,NULL);
print_meas(&ru->ofdm_total_stats,"feptx_total",NULL,NULL);
}
if (ru->fh_north_asynch_in) print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL); if (ru->fh_north_asynch_in) print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL);
print_meas(&ru->tx_fhaul,"tx_fhaul",NULL,NULL);
if (ru->fh_north_out) { if (ru->fh_north_out) {
print_meas(&ru->tx_fhaul,"tx_fhaul",NULL,NULL);
print_meas(&ru->compression,"compression",NULL,NULL); print_meas(&ru->compression,"compression",NULL,NULL);
print_meas(&ru->transport,"transport",NULL,NULL); print_meas(&ru->transport,"transport",NULL,NULL);
} }
...@@ -1282,7 +1272,7 @@ static void *ru_thread_tx( void *param ) { ...@@ -1282,7 +1272,7 @@ static void *ru_thread_tx( void *param ) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TTI_NUMBER_TX0_RU, tti_tx ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TTI_NUMBER_TX0_RU, tti_tx );
// do TX front-end processing if needed (precoding and/or IDFTs) // do TX front-end processing if needed (precoding and/or IDFTs)
//if (ru->feptx_prec) ru->feptx_prec(ru,frame_tx,tti_tx); if (ru->feptx_prec) ru->feptx_prec(ru,frame_tx,tti_tx);
// do OFDM if needed // do OFDM if needed
if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru,frame_tx,tti_tx); if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru,frame_tx,tti_tx);
...@@ -1295,17 +1285,8 @@ static void *ru_thread_tx( void *param ) { ...@@ -1295,17 +1285,8 @@ static void *ru_thread_tx( void *param ) {
} else { } else {
if(proc->frame_tx == print_frame) { if(proc->frame_tx == print_frame) {
for (i=0; i<ru->nb_tx; i++) { for (i=0; i<ru->nb_tx; i++) {
sprintf(filename,"tx%ddataF_frame%d_sl%d.m", i, print_frame, proc->tti_tx);
if(proc->tti_tx == 0) { LOG_M(filename,"txdataF_frame",&ru->common.txdataF_BF[i][0],fp->samples_per_subframe_wCP, 1, 1);
sprintf(filename,"gNBdataF_frame%d_sl%d.m", print_frame, proc->tti_tx);
LOG_M(filename,"txdataF_frame",&ru->gNB_list[0]->common_vars.txdataF[i][0],fp->samples_per_frame_wCP, 1, 1);
sprintf(filename,"tx%ddataF_frame%d_sl%d.m", i, print_frame, proc->tti_tx);
LOG_M(filename,"txdataF_frame",&ru->common.txdataF[i][0],fp->samples_per_frame_wCP, 1, 1);
sprintf(filename,"tx%ddataF_BF_frame%d_sl%d.m", i, print_frame, proc->tti_tx);
LOG_M(filename,"txdataF_BF_frame",&ru->common.txdataF_BF[i][0],fp->samples_per_subframe_wCP, 1, 1);
}
if(proc->tti_tx == 9) { if(proc->tti_tx == 9) {
sprintf(filename,"tx%ddata_frame%d.m", i, print_frame); sprintf(filename,"tx%ddata_frame%d.m", i, print_frame);
...@@ -1358,14 +1339,14 @@ static void *ru_thread_tx( void *param ) { ...@@ -1358,14 +1339,14 @@ static void *ru_thread_tx( void *param ) {
ret = pthread_mutex_lock(&L1_proc->mutex_RUs_tx); ret = pthread_mutex_lock(&L1_proc->mutex_RUs_tx);
AssertFatal(ret == 0,"mutex_lock returns %d\n",ret); AssertFatal(ret == 0,"mutex_lock returns %d\n",ret);
// the thread can now be woken up // the thread can now be woken up
//if (L1_proc->instance_cnt_RUs == -1) { if (L1_proc->instance_cnt_RUs==-1) {
L1_proc->instance_cnt_RUs = 0; AssertFatal(pthread_cond_signal(&L1_proc->cond_RUs) == 0,
AssertFatal(pthread_cond_signal(&L1_proc->cond_RUs) == 0,
"ERROR pthread_cond_signal for gNB_L1_thread\n"); "ERROR pthread_cond_signal for gNB_L1_thread\n");
//} //else AssertFatal(1==0,"gNB TX thread is not ready\n"); } //else AssertFatal(1==0,"gNB TX thread is not ready\n");
L1_proc->instance_cnt_RUs = 0;
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE,L1_proc->instance_cnt_RUs);
ret = pthread_mutex_unlock(&L1_proc->mutex_RUs_tx); ret = pthread_mutex_unlock(&L1_proc->mutex_RUs_tx);
AssertFatal(ret == 0,"mutex_unlock returns %d\n",ret); AssertFatal(ret == 0,"mutex_unlock returns %d\n",ret);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE,L1_proc->instance_cnt_RUs);
} }
} }
} }
...@@ -1525,7 +1506,7 @@ static void *ru_thread( void *param ) { ...@@ -1525,7 +1506,7 @@ static void *ru_thread( void *param ) {
if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD || ru->num_gNB==0) { if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD || ru->num_gNB==0) {
// do TX front-end processing if needed (precoding and/or IDFTs) // do TX front-end processing if needed (precoding and/or IDFTs)
//if (ru->feptx_prec) ru->feptx_prec(ru,proc->frame_tx,proc->tti_tx); if (ru->feptx_prec) ru->feptx_prec(ru,proc->frame_tx,proc->tti_tx);
// do OFDM if needed // do OFDM if needed
if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru,proc->frame_tx,proc->tti_tx); if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru,proc->frame_tx,proc->tti_tx);
...@@ -1689,7 +1670,6 @@ void init_RU_proc(RU_t *ru) { ...@@ -1689,7 +1670,6 @@ void init_RU_proc(RU_t *ru) {
proc->frame_offset = 0; proc->frame_offset = 0;
proc->num_slaves = 0; proc->num_slaves = 0;
proc->frame_tx_unwrap = 0; proc->frame_tx_unwrap = 0;
proc->feptx_mask = 0;
for (i=0; i<10; i++) proc->symbol_mask[i]=0; for (i=0; i<10; i++) proc->symbol_mask[i]=0;
...@@ -1735,7 +1715,6 @@ void init_RU_proc(RU_t *ru) { ...@@ -1735,7 +1715,6 @@ void init_RU_proc(RU_t *ru) {
if (ru->feprx) nr_init_feprx_thread(ru); if (ru->feprx) nr_init_feprx_thread(ru);
if (ru->feptx_ofdm) nr_init_feptx_thread(ru); if (ru->feptx_ofdm) nr_init_feptx_thread(ru);
//if (ru->feptx_prec) nr_init_feptx_prec_thread(ru);
} }
if (opp_enabled == 1) threadCreate(&ru->ru_stats_thread,ru_stats_thread,(void *)ru, "emulateRF", -1, OAI_PRIORITY_RT_LOW); if (opp_enabled == 1) threadCreate(&ru->ru_stats_thread,ru_stats_thread,(void *)ru, "emulateRF", -1, OAI_PRIORITY_RT_LOW);
......
...@@ -74,10 +74,6 @@ int nr_phy_init_RU(RU_t *ru) { ...@@ -74,10 +74,6 @@ int nr_phy_init_RU(RU_t *ru) {
} }
// allocate precoding input buffers (TX)
ru->common.txdataF = (int32_t **)malloc16(15*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
// 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*));
LOG_I(PHY,"[INIT] common.txdata_BF= %p (%lu bytes)\n",ru->common.txdataF_BF, LOG_I(PHY,"[INIT] common.txdata_BF= %p (%lu bytes)\n",ru->common.txdataF_BF,
...@@ -162,10 +158,6 @@ void nr_phy_free_RU(RU_t *ru) ...@@ -162,10 +158,6 @@ void nr_phy_free_RU(RU_t *ru)
for (i = 0; i < ru->nb_rx; i++) free_and_zero(ru->common.rxdata_7_5kHz[i]); for (i = 0; i < ru->nb_rx; i++) free_and_zero(ru->common.rxdata_7_5kHz[i]);
free_and_zero(ru->common.rxdata_7_5kHz); free_and_zero(ru->common.rxdata_7_5kHz);
// free beamforming input buffers (TX)
for (i = 0; i < 15; i++) free_and_zero(ru->common.txdataF[i]);
free_and_zero(ru->common.txdataF);
// free IFFT input buffers (TX) // free IFFT input buffers (TX)
for (i = 0; i < ru->nb_tx; i++) free_and_zero(ru->common.txdataF_BF[i]); for (i = 0; i < ru->nb_tx; i++) free_and_zero(ru->common.txdataF_BF[i]);
free_and_zero(ru->common.txdataF_BF); free_and_zero(ru->common.txdataF_BF);
......
...@@ -144,12 +144,12 @@ int nr_beam_precoding(int32_t **txdataF, ...@@ -144,12 +144,12 @@ int nr_beam_precoding(int32_t **txdataF,
int32_t ***beam_weights, int32_t ***beam_weights,
int slot, int slot,
int symbol, int symbol,
int aa, int aa)
int nb_antenna_ports)
{ {
uint8_t p; uint8_t p;
int nb_antenna_ports = frame_parms->Lmax; // for now logical antenna ports corresponds to SSB
// clear txdata_BF[aa][re] for each call of ue_spec_beamforming // clear txdata_BF[aa][re] for each call of ue_spec_beamforming
memset(&txdataF_BF[aa][symbol*frame_parms->ofdm_symbol_size],0,sizeof(int32_t)*(frame_parms->ofdm_symbol_size)); memset(&txdataF_BF[aa][symbol*frame_parms->ofdm_symbol_size],0,sizeof(int32_t)*(frame_parms->ofdm_symbol_size));
...@@ -164,5 +164,5 @@ int nr_beam_precoding(int32_t **txdataF, ...@@ -164,5 +164,5 @@ int nr_beam_precoding(int32_t **txdataF,
15); 15);
} }
} }
return 0; return 0;
} }
...@@ -99,8 +99,6 @@ int nr_beam_precoding(int32_t **txdataF, ...@@ -99,8 +99,6 @@ int nr_beam_precoding(int32_t **txdataF,
int32_t ***beam_weights, int32_t ***beam_weights,
int slot, int slot,
int symbol, int symbol,
int aa, int aa);
int nb_antenna_ports
);
#endif #endif
...@@ -86,8 +86,6 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input ...@@ -86,8 +86,6 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
) )
{ {
if(nb_symbols == 0) return;
short temp[4096*4] __attribute__((aligned(32))); short temp[4096*4] __attribute__((aligned(32)));
unsigned short i,j; unsigned short i,j;
short k; short k;
......
...@@ -37,12 +37,11 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -37,12 +37,11 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
unsigned short bwp_start_subcarrier, unsigned short bwp_start_subcarrier,
unsigned short nb_rb_pusch) unsigned short nb_rb_pusch)
{ {
int pilot[3280] __attribute__((aligned(16))); int pilot[1320] __attribute__((aligned(16)));
unsigned char aarx; unsigned char aarx;
unsigned short k; unsigned short k;
unsigned int pilot_cnt; unsigned int pilot_cnt;
int16_t ch[2],*pil,*rxF,*ul_ch; int16_t ch[2],*pil,*rxF,*ul_ch,*fl,*fm,*fr,*fml,*fmr,*fmm;
int16_t *fl,*fm,*fr,*fml,*fmr,*fmm,*fdcl,*fdcr,*fdclh,*fdcrh;
int ch_offset,symbol_offset, length_dmrs, UE_id = 0; int ch_offset,symbol_offset, length_dmrs, UE_id = 0;
unsigned short n_idDMRS[2] = {0,1}; //to update from pusch config unsigned short n_idDMRS[2] = {0,1}; //to update from pusch config
int32_t temp_in_ifft_0[8192*2] __attribute__((aligned(16))); int32_t temp_in_ifft_0[8192*2] __attribute__((aligned(16)));
...@@ -83,10 +82,6 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -83,10 +82,6 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
fmm = filt8_mm0; fmm = filt8_mm0;
fml = filt8_m0; fml = filt8_m0;
fmr = filt8_mr0; fmr = filt8_mr0;
fdcl = filt8_dcl0;
fdcr = filt8_dcr0;
fdclh = filt8_dcl0_h;
fdcrh = filt8_dcr0_h;
break; break;
case 1: case 1:
...@@ -96,10 +91,6 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -96,10 +91,6 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
fmm = filt8_mm1; fmm = filt8_mm1;
fml = filt8_ml1; fml = filt8_ml1;
fmr = filt8_m1; fmr = filt8_m1;
fdcl = filt8_dcl1;
fdcr = filt8_dcr1;
fdclh = filt8_dcl1_h;
fdcrh = filt8_dcr1_h;
break; break;
default: default:
...@@ -128,12 +119,12 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -128,12 +119,12 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
memset(ul_ch,0,4*(gNB->frame_parms.ofdm_symbol_size)); memset(ul_ch,0,4*(gNB->frame_parms.ofdm_symbol_size));
#ifdef DEBUG_PUSCH #ifdef DEBUG_PUSCH
printf("ch est pilot addr %p RB_DL %d\n",&pilot[0], gNB->frame_parms.N_RB_UL); printf("ch est pilot addr %p RB_DL %d\n",&pilot[0], gNB->frame_parms.N_RB_DL);
printf("k %d, first_carrier %d\n",k,gNB->frame_parms.first_carrier_offset); printf("k %d, first_carrier %d\n",k,gNB->frame_parms.first_carrier_offset);
printf("rxF addr %p p %d\n", rxF,p); printf("rxF addr %p p %d\n", rxF,p);
printf("ul_ch addr %p nushift %d\n",ul_ch,nushift); printf("ul_ch addr %p nushift %d\n",ul_ch,nushift);
#endif #endif
//if ((gNB->frame_parms.N_RB_UL&1)==0) { //if ((gNB->frame_parms.N_RB_DL&1)==0) {
// Treat first 2 pilots specially (left edge) // Treat first 2 pilots specially (left edge)
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
...@@ -149,7 +140,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -149,7 +140,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
ul_ch, ul_ch,
8); 8);
pil+=2; pil+=2;
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size; re_offset = (re_offset+2)&(gNB->frame_parms.ofdm_symbol_size-1);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
//for (int i= 0; i<8; i++) //for (int i= 0; i<8; i++)
//printf("ul_ch addr %p %d\n", ul_ch+i, *(ul_ch+i)); //printf("ul_ch addr %p %d\n", ul_ch+i, *(ul_ch+i));
...@@ -165,7 +156,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -165,7 +156,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
ul_ch, ul_ch,
8); 8);
pil+=2; pil+=2;
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size; re_offset = (re_offset+2)&(gNB->frame_parms.ofdm_symbol_size-1);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
//printf("ul_ch addr %p\n",ul_ch); //printf("ul_ch addr %p\n",ul_ch);
...@@ -184,7 +175,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -184,7 +175,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
//printf("ul_ch addr %p %d\n", ul_ch+i, *(ul_ch+i)); //printf("ul_ch addr %p %d\n", ul_ch+i, *(ul_ch+i));
pil+=2; pil+=2;
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size; re_offset = (re_offset+2)&(gNB->frame_parms.ofdm_symbol_size-1);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ul_ch+=8; ul_ch+=8;
...@@ -202,7 +193,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -202,7 +193,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
8); 8);
pil+=2; pil+=2;
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size; re_offset = (re_offset+2)&(gNB->frame_parms.ofdm_symbol_size-1);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
...@@ -215,7 +206,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -215,7 +206,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
ul_ch, ul_ch,
8); 8);
pil+=2; pil+=2;
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size; re_offset = (re_offset+2)&(gNB->frame_parms.ofdm_symbol_size-1);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ul_ch+=8; ul_ch+=8;
...@@ -236,7 +227,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -236,7 +227,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
//printf("ul_ch addr %p %d\n", ul_ch+i, *(ul_ch+i)); //printf("ul_ch addr %p %d\n", ul_ch+i, *(ul_ch+i));
pil+=2; pil+=2;
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size; re_offset = (re_offset+2)&(gNB->frame_parms.ofdm_symbol_size-1);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
...@@ -251,7 +242,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -251,7 +242,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
8); 8);
pil+=2; pil+=2;
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size; re_offset = (re_offset+2)&(gNB->frame_parms.ofdm_symbol_size-1);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ul_ch+=8; ul_ch+=8;
...@@ -265,69 +256,6 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -265,69 +256,6 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
ul_ch, ul_ch,
8); 8);
// check if PRB crosses DC and improve estimates around DC
if ((bwp_start_subcarrier >= gNB->frame_parms.ofdm_symbol_size/2) && (bwp_start_subcarrier+nb_rb_pusch*12 >= gNB->frame_parms.ofdm_symbol_size)) {
ul_ch = (int16_t *)&ul_ch_estimates[aarx][ch_offset];
uint16_t idxDC = 2*(gNB->frame_parms.ofdm_symbol_size - bwp_start_subcarrier);
uint16_t idxPil = idxDC/2;
re_offset = k;
pil = (int16_t *)&pilot[0];
pil += (idxPil-2);
ul_ch += (idxDC-4);
ul_ch = memset(ul_ch, 0, sizeof(int16_t)*10);
re_offset = (re_offset+idxDC/2-2) % gNB->frame_parms.ofdm_symbol_size;
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
// for proper allignment of SIMD vectors
if((gNB->frame_parms.N_RB_UL&1)==0) {
multadd_real_vector_complex_scalar(fdcl,
ch,
ul_ch-4,
8);
pil += 4;
re_offset = (re_offset+4) % gNB->frame_parms.ofdm_symbol_size;
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
multadd_real_vector_complex_scalar(fdcr,
ch,
ul_ch-4,
8);
} else {
multadd_real_vector_complex_scalar(fdclh,
ch,
ul_ch,
8);
pil += 4;
re_offset = (re_offset+4) % gNB->frame_parms.ofdm_symbol_size;
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
multadd_real_vector_complex_scalar(fdcrh,
ch,
ul_ch,
8);
}
}
#ifdef DEBUG_PDSCH
ul_ch = (int16_t *)&ul_ch_estimates[aarx][ch_offset];
for(uint16_t idxP=0; idxP<ceil((float)nb_rb_pusch*12/8); idxP++) {
for(uint8_t idxI=0; idxI<16; idxI+=2) {
printf("%d\t%d\t",ul_ch[idxP*16+idxI],ul_ch[idxP*16+idxI+1]);
}
printf("%d\n",idxP);
}
#endif
// Convert to time domain // Convert to time domain
memset(temp_in_ifft_0, 0, gNB->frame_parms.ofdm_symbol_size*sizeof(int32_t)); memset(temp_in_ifft_0, 0, gNB->frame_parms.ofdm_symbol_size*sizeof(int32_t));
memcpy(temp_in_ifft_0, &ul_ch_estimates[aarx][symbol_offset], nb_rb_pusch * NR_NB_SC_PER_RB * sizeof(int32_t)); memcpy(temp_in_ifft_0, &ul_ch_estimates[aarx][symbol_offset], nb_rb_pusch * NR_NB_SC_PER_RB * sizeof(int32_t));
...@@ -394,4 +322,4 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -394,4 +322,4 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
#endif #endif
return(0); return(0);
} }
\ No newline at end of file
...@@ -55,7 +55,7 @@ int pseudo_random_sequence(int M_PN, uint32_t *c, uint32_t cinit); ...@@ -55,7 +55,7 @@ int pseudo_random_sequence(int M_PN, uint32_t *c, uint32_t cinit);
void lte_gold_new(LTE_DL_FRAME_PARMS *frame_parms, uint32_t lte_gold_table[20][2][14], uint16_t Nid_cell); void lte_gold_new(LTE_DL_FRAME_PARMS *frame_parms, uint32_t lte_gold_table[20][2][14], uint16_t Nid_cell);
void generate_dmrs_pbch(uint32_t dmrs_pbch_bitmap[DMRS_PBCH_I_SSB][DMRS_PBCH_N_HF][DMRS_BITMAP_SIZE], uint16_t Nid_cell); void generate_dmrs_pbch(uint32_t dmrs_pbch_bitmap[DMRS_PBCH_I_SSB][DMRS_PBCH_N_HF][DMRS_BITMAP_SIZE], uint16_t Nid_cell);
uint8_t get_l0_ul(uint8_t mapping_type, uint8_t dmrs_typeA_position); uint8_t get_l0_ul(uint8_t mapping_type, uint8_t dmrs_typeA_position);
uint16_t get_dmrs_freq_idx_ul(uint16_t n, uint8_t k_prime, uint8_t delta, uint8_t dmrs_type); uint16_t get_dmrs_freq_idx_ul(uint8_t n, uint8_t k_prime, uint8_t delta, uint8_t dmrs_type);
#undef EXTERN #undef EXTERN
......
...@@ -148,7 +148,7 @@ void nr_gold_pdsch(PHY_VARS_NR_UE* ue, ...@@ -148,7 +148,7 @@ void nr_gold_pdsch(PHY_VARS_NR_UE* ue,
//printf("x1 : %x, x2 : %x\n",x1,x2); //printf("x1 : %x, x2 : %x\n",x1,x2);
} }
for (n=0; n<NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD; n++) { for (n=0; n<52; n++) {
x1 = (x1>>1) ^ (x1>>4); x1 = (x1>>1) ^ (x1>>4);
x1 = x1 ^ (x1<<31) ^ (x1<<28); x1 = x1 ^ (x1<<31) ^ (x1<<28);
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4); x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
......
...@@ -90,7 +90,6 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t *dlsch, ...@@ -90,7 +90,6 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t *dlsch,
uint8_t Qm = rel15->modulation_order; uint8_t Qm = rel15->modulation_order;
uint32_t encoded_length = nb_symbols*Qm; uint32_t encoded_length = nb_symbols*Qm;
/// CRC, coding, interleaving and rate matching /// CRC, coding, interleaving and rate matching
AssertFatal(harq->pdu!=NULL,"harq->pdu is null\n"); AssertFatal(harq->pdu!=NULL,"harq->pdu is null\n");
start_meas(dlsch_encoding_stats); start_meas(dlsch_encoding_stats);
...@@ -207,6 +206,7 @@ for (int i=0; i<n_dmrs>>4; i++) { ...@@ -207,6 +206,7 @@ for (int i=0; i<n_dmrs>>4; i++) {
printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_symbols %d)\n", printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_symbols %d)\n",
start_sc, rel15->start_symbol, rel15->n_prb, rel15->nb_symbols); start_sc, rel15->start_symbol, rel15->n_prb, rel15->nb_symbols);
#endif #endif
for (int ap=0; ap<rel15->nb_layers; ap++) { for (int ap=0; ap<rel15->nb_layers; ap++) {
// DMRS params for this ap // DMRS params for this ap
...@@ -221,7 +221,6 @@ ap, Wt[0], Wt[1], Wf[0], Wf[1], delta, l_prime[0], l0, dmrs_symbol); ...@@ -221,7 +221,6 @@ ap, Wt[0], Wt[1], Wf[0], Wf[1], delta, l_prime[0], l0, dmrs_symbol);
#endif #endif
uint8_t k_prime=0; uint8_t k_prime=0;
uint16_t m=0, n=0, dmrs_idx=0, k=0; uint16_t m=0, n=0, dmrs_idx=0, k=0;
int txdataF_offset = (slot%2)*frame_parms->samples_per_slot_wCP;
if (dmrs_type == NFAPI_NR_DMRS_TYPE1) // another if condition to be included to check pdsch config type (reference of k) if (dmrs_type == NFAPI_NR_DMRS_TYPE1) // another if condition to be included to check pdsch config type (reference of k)
dmrs_idx = rel15->start_prb*6; dmrs_idx = rel15->start_prb*6;
else else
...@@ -231,12 +230,12 @@ ap, Wt[0], Wt[1], Wf[0], Wf[1], delta, l_prime[0], l0, dmrs_symbol); ...@@ -231,12 +230,12 @@ ap, Wt[0], Wt[1], Wf[0], Wf[1], delta, l_prime[0], l0, dmrs_symbol);
k = start_sc; k = start_sc;
for (int i=0; i<rel15->n_prb*NR_NB_SC_PER_RB; i++) { for (int i=0; i<rel15->n_prb*NR_NB_SC_PER_RB; i++) {
if ((l == dmrs_symbol) && (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_type))%(frame_parms->ofdm_symbol_size)))) { if ((l == dmrs_symbol) && (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_type))%(frame_parms->ofdm_symbol_size)))) {
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime[0]]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; ((int16_t*)txdataF[ap])[(l*frame_parms->ofdm_symbol_size + k)<<1] = (Wt[l_prime[0]]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15;
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime[0]]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (Wt[l_prime[0]]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15;
#ifdef DEBUG_DLSCH_MAPPING #ifdef DEBUG_DLSCH_MAPPING
printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n",
dmrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], dmrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[(l*frame_parms->ofdm_symbol_size + k)<<1],
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1]);
#endif #endif
dmrs_idx++; dmrs_idx++;
k_prime++; k_prime++;
...@@ -246,12 +245,12 @@ dmrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol ...@@ -246,12 +245,12 @@ dmrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol
else { else {
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15; ((int16_t*)txdataF[ap])[(l*frame_parms->ofdm_symbol_size + k)<<1] = (amp * tx_layers[ap][m<<1]) >> 15;
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15;
#ifdef DEBUG_DLSCH_MAPPING #ifdef DEBUG_DLSCH_MAPPING
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, k, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], m, l, k, ((int16_t*)txdataF[ap])[(l*frame_parms->ofdm_symbol_size + k)<<1],
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1]);
#endif #endif
m++; m++;
} }
......
...@@ -123,30 +123,6 @@ short filt8_m0[8] = { ...@@ -123,30 +123,6 @@ short filt8_m0[8] = {
short filt8_mm0[8]= { short filt8_mm0[8]= {
0,0,0,8192,16384,8192,0,0}; 0,0,0,8192,16384,8192,0,0};
short filt8_dcma[8]= {
16384,12288,8192,4096,4096,0,0,0};
short filt8_dcmb[8]= {
0,4096,8192,4096,4096,0,0,0};
short filt8_dcmc[8]= {
0,0,0,4096,4096,8192,4096,0};
short filt8_dcmd[8]= {
0,0,0,4096,4096,8192,12288,16384};
short filt8_dcl0[8]= {
0,0,16384,12288,8192,4096,0,0};
short filt8_dcr0[8]= {
0,0,0,4096,8192,12288,16384,0};
short filt8_dcl0_h[8]= {
16384,12288,8192,4096,0,0,0,0};
short filt8_dcr0_h[8]= {
0,4096,8192,12288,16384,0,0,0};
short filt8_l1[8] = { short filt8_l1[8] = {
24576,16384,0,0,0,0,0,0}; 24576,16384,0,0,0,0,0,0};
...@@ -160,16 +136,4 @@ short filt8_m1[8] = { ...@@ -160,16 +136,4 @@ short filt8_m1[8] = {
0,0,8192,16384,8192,0,0,0}; 0,0,8192,16384,8192,0,0,0};
short filt8_mm1[8]= { short filt8_mm1[8]= {
0,0,0,0,8192,16384,8192,0}; 0,0,0,0,8192,16384,8192,0};
\ No newline at end of file
short filt8_dcl1[8]= {
0,0,0,16384,12288,8192,4096,0};
short filt8_dcr1[8]= {
0,0,0,0,4096,8192,12288,16384};
short filt8_dcl1_h[8]= {
0,16384,12288,8192,4096,0,0,0};
short filt8_dcr1_h[8]= {
0,0,4096,8192,12288,16384,0,0};
...@@ -91,22 +91,6 @@ extern short filt8_m0[8]; ...@@ -91,22 +91,6 @@ extern short filt8_m0[8];
extern short filt8_mm0[8]; extern short filt8_mm0[8];
extern short filt8_dcma[8];
extern short filt8_dcmb[8];
extern short filt8_dcmc[8];
extern short filt8_dcmd[8];
extern short filt8_dcl0[8];
extern short filt8_dcr0[8];
extern short filt8_dcl0_h[8];
extern short filt8_dcr0_h[8];
extern short filt8_l1[8]; extern short filt8_l1[8];
extern short filt8_ml1[8]; extern short filt8_ml1[8];
...@@ -117,11 +101,4 @@ extern short filt8_m1[8]; ...@@ -117,11 +101,4 @@ extern short filt8_m1[8];
extern short filt8_mm1[8]; extern short filt8_mm1[8];
extern short filt8_dcl1[8]; #endif
\ No newline at end of file
extern short filt8_dcr1[8];
extern short filt8_dcl1_h[8];
extern short filt8_dcr1_h[8];
#endif
...@@ -98,7 +98,8 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, ...@@ -98,7 +98,8 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
#endif #endif
pil+=2; pil+=2;
re_offset = (re_offset+4) % ue->frame_parms.ofdm_symbol_size; //re_offset = (re_offset+4)&(ue->frame_parms.ofdm_symbol_size-1);
re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 4) : (re_offset+4);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)];
...@@ -113,7 +114,8 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, ...@@ -113,7 +114,8 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
#endif #endif
pil+=2; pil+=2;
re_offset = (re_offset+4) % ue->frame_parms.ofdm_symbol_size; //re_offset = (re_offset+4)&(ue->frame_parms.ofdm_symbol_size-1);
re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 4) : (re_offset+4);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)];
current_ssb->c_re +=ch[0]; current_ssb->c_re +=ch[0];
...@@ -124,7 +126,8 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, ...@@ -124,7 +126,8 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
#endif #endif
pil+=2; pil+=2;
re_offset = (re_offset+4) % ue->frame_parms.ofdm_symbol_size; //re_offset = (re_offset+4)&(ue->frame_parms.ofdm_symbol_size-1);
re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 4) : (re_offset+4);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)];
for (pilot_cnt=3; pilot_cnt<(3*20); pilot_cnt+=3) { for (pilot_cnt=3; pilot_cnt<(3*20); pilot_cnt+=3) {
...@@ -135,7 +138,8 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, ...@@ -135,7 +138,8 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
// in 2nd symbol, skip middle REs (48 with DMRS, 144 for SSS, and another 48 with DMRS) // in 2nd symbol, skip middle REs (48 with DMRS, 144 for SSS, and another 48 with DMRS)
if (dmrss == 1 && pilot_cnt == 12) { if (dmrss == 1 && pilot_cnt == 12) {
pilot_cnt=48; pilot_cnt=48;
re_offset = (re_offset+144) % ue->frame_parms.ofdm_symbol_size; //re_offset = (re_offset+144)&(ue->frame_parms.ofdm_symbol_size-1);
re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 144) : (re_offset+144);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)];
} }
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
...@@ -149,7 +153,8 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, ...@@ -149,7 +153,8 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
#endif #endif
pil+=2; pil+=2;
re_offset = (re_offset+4) % ue->frame_parms.ofdm_symbol_size; //re_offset = (re_offset+4)&(ue->frame_parms.ofdm_symbol_size-1);
re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 4) : (re_offset+4);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)];
...@@ -163,7 +168,8 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, ...@@ -163,7 +168,8 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
#endif #endif
pil+=2; pil+=2;
re_offset = (re_offset+4) % ue->frame_parms.ofdm_symbol_size; //re_offset = (re_offset+4)&(ue->frame_parms.ofdm_symbol_size-1);
re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 4) : (re_offset+4);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)];
...@@ -178,7 +184,8 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, ...@@ -178,7 +184,8 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
#endif #endif
pil+=2; pil+=2;
re_offset = (re_offset+4) % ue->frame_parms.ofdm_symbol_size; //re_offset = (re_offset+4)&(ue->frame_parms.ofdm_symbol_size-1);
re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 4) : (re_offset+4);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)];
} }
...@@ -307,7 +314,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -307,7 +314,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
dl_ch, dl_ch,
16); 16);
pil+=2; pil+=2;
re_offset = (re_offset+4) % ue->frame_parms.ofdm_symbol_size; //re_offset = (re_offset+4)&(ue->frame_parms.ofdm_symbol_size-1);
re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 4) : (re_offset+4);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)];
//for (int i= 0; i<8; i++) //for (int i= 0; i<8; i++)
...@@ -325,7 +333,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -325,7 +333,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
dl_ch, dl_ch,
16); 16);
pil+=2; pil+=2;
re_offset = (re_offset+4) % ue->frame_parms.ofdm_symbol_size; //re_offset = (re_offset+4)&(ue->frame_parms.ofdm_symbol_size-1);
re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 4) : (re_offset+4);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)];
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
...@@ -340,7 +349,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -340,7 +349,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
dl_ch, dl_ch,
16); 16);
pil+=2; pil+=2;
re_offset = (re_offset+4) % ue->frame_parms.ofdm_symbol_size; //re_offset = (re_offset+4)&(ue->frame_parms.ofdm_symbol_size-1);
re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 4) : (re_offset+4);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)];
dl_ch+=24; dl_ch+=24;
...@@ -352,7 +362,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -352,7 +362,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
// in 2nd symbol, skip middle REs (48 with DMRS, 144 for SSS, and another 48 with DMRS) // in 2nd symbol, skip middle REs (48 with DMRS, 144 for SSS, and another 48 with DMRS)
if (dmrss == 1 && pilot_cnt == 12) { if (dmrss == 1 && pilot_cnt == 12) {
pilot_cnt=48; pilot_cnt=48;
re_offset = (re_offset+144) % ue->frame_parms.ofdm_symbol_size; //re_offset = (re_offset+144)&(ue->frame_parms.ofdm_symbol_size-1);
re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 144) : (re_offset+144);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)];
dl_ch += 288; dl_ch += 288;
} }
...@@ -371,7 +382,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -371,7 +382,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
// printf("pilot_cnt %d dl_ch %d %d\n", pilot_cnt, dl_ch+i, *(dl_ch+i)); // printf("pilot_cnt %d dl_ch %d %d\n", pilot_cnt, dl_ch+i, *(dl_ch+i));
pil+=2; pil+=2;
re_offset = (re_offset+4) % ue->frame_parms.ofdm_symbol_size; //re_offset = (re_offset+4)&(ue->frame_parms.ofdm_symbol_size-1);
re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 4) : (re_offset+4);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)];
...@@ -386,7 +398,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -386,7 +398,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
dl_ch, dl_ch,
16); 16);
pil+=2; pil+=2;
re_offset = (re_offset+4) % ue->frame_parms.ofdm_symbol_size; //re_offset = (re_offset+4)&(ue->frame_parms.ofdm_symbol_size-1);
re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 4) : (re_offset+4);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)];
...@@ -402,7 +415,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -402,7 +415,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
dl_ch, dl_ch,
16); 16);
pil+=2; pil+=2;
re_offset = (re_offset+4) % ue->frame_parms.ofdm_symbol_size; //re_offset = (re_offset+4)&(ue->frame_parms.ofdm_symbol_size-1);
re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 4) : (re_offset+4);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)];
dl_ch+=24; dl_ch+=24;
...@@ -652,12 +666,11 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -652,12 +666,11 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
unsigned short bwp_start_subcarrier, unsigned short bwp_start_subcarrier,
unsigned short nb_rb_pdsch) unsigned short nb_rb_pdsch)
{ {
int pilot[3280] __attribute__((aligned(16))); int pilot[1320] __attribute__((aligned(16)));
unsigned char aarx; unsigned char aarx;
unsigned short k; unsigned short k;
unsigned int pilot_cnt; unsigned int pilot_cnt;
int16_t ch[2],*pil,*rxF,*dl_ch; int16_t ch[2],*pil,*rxF,*dl_ch,*fl,*fm,*fr,*fml,*fmr,*fmm;
int16_t *fl,*fm,*fr,*fml,*fmr,*fmm,*fdcl,*fdcr,*fdclh,*fdcrh;
int ch_offset,symbol_offset; int ch_offset,symbol_offset;
//uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1]; //uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1];
...@@ -692,10 +705,6 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -692,10 +705,6 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
fmm = filt8_mm0; fmm = filt8_mm0;
fml = filt8_m0; fml = filt8_m0;
fmr = filt8_mr0; fmr = filt8_mr0;
fdcl = filt8_dcl0;
fdcr = filt8_dcr0;
fdclh = filt8_dcl0_h;
fdcrh = filt8_dcr0_h;
break; break;
case 1: case 1:
...@@ -705,10 +714,6 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -705,10 +714,6 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
fmm = filt8_mm1; fmm = filt8_mm1;
fml = filt8_ml1; fml = filt8_ml1;
fmr = filt8_m1; fmr = filt8_m1;
fdcl = filt8_dcl1;
fdcr = filt8_dcr1;
fdclh = filt8_dcl1_h;
fdcrh = filt8_dcr1_h;
break; break;
default: default:
...@@ -726,7 +731,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -726,7 +731,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) { for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
pil = (int16_t *)&pilot[rb_offset*((config_type==0) ? 6:4)]; pil = (int16_t *)&pilot[rb_offset*((config_type==0) ? 6:4)];
k = k % ue->frame_parms.ofdm_symbol_size; k = k&(ue->frame_parms.ofdm_symbol_size-1);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+nushift)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+nushift)];
dl_ch = (int16_t *)&dl_ch_estimates[aarx][ch_offset]; dl_ch = (int16_t *)&dl_ch_estimates[aarx][ch_offset];
...@@ -756,7 +761,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -756,7 +761,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
dl_ch, dl_ch,
8); 8);
pil+=2; pil+=2;
re_offset = (re_offset+2) % ue->frame_parms.ofdm_symbol_size; re_offset = (re_offset+2)&(ue->frame_parms.ofdm_symbol_size-1);
//re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 2) : (re_offset+2);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
//for (int i= 0; i<8; i++) //for (int i= 0; i<8; i++)
//printf("dl_ch addr %p %d\n", dl_ch+i, *(dl_ch+i)); //printf("dl_ch addr %p %d\n", dl_ch+i, *(dl_ch+i));
...@@ -771,7 +777,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -771,7 +777,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
dl_ch, dl_ch,
8); 8);
pil+=2; pil+=2;
re_offset = (re_offset+2) % ue->frame_parms.ofdm_symbol_size; re_offset = (re_offset+2)&(ue->frame_parms.ofdm_symbol_size-1);
//re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 2) : (re_offset+2);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
//printf("dl_ch addr %p\n",dl_ch); //printf("dl_ch addr %p\n",dl_ch);
...@@ -789,7 +796,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -789,7 +796,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
//printf("dl_ch addr %p %d\n", dl_ch+i, *(dl_ch+i)); //printf("dl_ch addr %p %d\n", dl_ch+i, *(dl_ch+i));
pil+=2; pil+=2;
re_offset = (re_offset+2) % ue->frame_parms.ofdm_symbol_size; re_offset = (re_offset+2)&(ue->frame_parms.ofdm_symbol_size-1);
//re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 2) : (re_offset+2);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
dl_ch+=8; dl_ch+=8;
...@@ -809,7 +817,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -809,7 +817,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
8); 8);
pil+=2; pil+=2;
re_offset = (re_offset+2) % ue->frame_parms.ofdm_symbol_size; re_offset = (re_offset+2)&(ue->frame_parms.ofdm_symbol_size-1);
//re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 2) : (re_offset+2);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
...@@ -822,14 +831,15 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -822,14 +831,15 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
dl_ch, dl_ch,
8); 8);
pil+=2; pil+=2;
re_offset = (re_offset+2) % ue->frame_parms.ofdm_symbol_size; re_offset = (re_offset+2)&(ue->frame_parms.ofdm_symbol_size-1);
//re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 2) : (re_offset+2);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
dl_ch+=8; dl_ch+=8;
} }
// Treat first 2 pilots specially (right edge) // Treat first 2 pilots specially (right edge)
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
#ifdef DEBUG_PDSCH #ifdef DEBUG_PDSCH
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
...@@ -843,7 +853,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -843,7 +853,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
//printf("dl_ch addr %p %d\n", dl_ch+i, *(dl_ch+i)); //printf("dl_ch addr %p %d\n", dl_ch+i, *(dl_ch+i));
pil+=2; pil+=2;
re_offset = (re_offset+2) % ue->frame_parms.ofdm_symbol_size; re_offset = (re_offset+2)&(ue->frame_parms.ofdm_symbol_size-1);
//re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 2) : (re_offset+2);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
...@@ -858,7 +869,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -858,7 +869,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
8); 8);
pil+=2; pil+=2;
re_offset = (re_offset+2) % ue->frame_parms.ofdm_symbol_size; re_offset = (re_offset+2)&(ue->frame_parms.ofdm_symbol_size-1);
//re_offset = (re_offset >= ue->frame_parms.ofdm_symbol_size) ? (re_offset - ue->frame_parms.ofdm_symbol_size + 2) : (re_offset+2);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
dl_ch+=8; dl_ch+=8;
...@@ -872,70 +884,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -872,70 +884,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
dl_ch, dl_ch,
8); 8);
//} //}
// check if PRB crosses DC and improve estimates around DC
if ((bwp_start_subcarrier >= ue->frame_parms.ofdm_symbol_size/2) && (bwp_start_subcarrier+nb_rb_pdsch*12 >= ue->frame_parms.ofdm_symbol_size)) {
dl_ch = (int16_t *)&dl_ch_estimates[aarx][ch_offset];
uint16_t idxDC = 2*(ue->frame_parms.ofdm_symbol_size - bwp_start_subcarrier);
uint16_t idxPil = idxDC/2;
re_offset = k;
pil = (int16_t *)&pilot[rb_offset*((config_type==0) ? 6:4)];
pil += (idxPil-2);
dl_ch += (idxDC-4);
dl_ch = memset(dl_ch, 0, sizeof(int16_t)*10);
re_offset = (re_offset+idxDC/2-2) % ue->frame_parms.ofdm_symbol_size;
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
// for proper allignment of SIMD vectors
if((ue->frame_parms.N_RB_DL&1)==0) {
multadd_real_vector_complex_scalar(fdcl,
ch,
dl_ch-4,
8);
pil += 4;
re_offset = (re_offset+4) % ue->frame_parms.ofdm_symbol_size;
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
multadd_real_vector_complex_scalar(fdcr,
ch,
dl_ch-4,
8);
} else {
multadd_real_vector_complex_scalar(fdclh,
ch,
dl_ch,
8);
pil += 4;
re_offset = (re_offset+4) % ue->frame_parms.ofdm_symbol_size;
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
multadd_real_vector_complex_scalar(fdcrh,
ch,
dl_ch,
8);
}
}
#ifdef DEBUG_PDSCH
dl_ch = (int16_t *)&dl_ch_estimates[aarx][ch_offset];
for(uint16_t idxP=0; idxP<ceil((float)nb_rb_pdsch*12/8); idxP++) {
for(uint8_t idxI=0; idxI<16; idxI+=2) {
printf("%d\t%d\t",dl_ch[idxP*16+idxI],dl_ch[idxP*16+idxI+1]);
}
printf("%d\n",idxP);
}
#endif
} }
return(0); return(0);
......
...@@ -258,7 +258,7 @@ uint8_t get_l0_ul(uint8_t mapping_type, uint8_t dmrs_typeA_position) { ...@@ -258,7 +258,7 @@ uint8_t get_l0_ul(uint8_t mapping_type, uint8_t dmrs_typeA_position) {
* *
*********************************************************************/ *********************************************************************/
uint16_t get_dmrs_freq_idx_ul(uint16_t n, uint8_t k_prime, uint8_t delta, uint8_t dmrs_type) { uint16_t get_dmrs_freq_idx_ul(uint8_t n, uint8_t k_prime, uint8_t delta, uint8_t dmrs_type) {
uint16_t dmrs_idx; uint16_t dmrs_idx;
......
...@@ -564,13 +564,13 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -564,13 +564,13 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
// Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int // Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int
if (check_crc((uint8_t*)llrProcBuf,length_dec,harq_process->F,crc_type)) { if (check_crc((uint8_t*)llrProcBuf,length_dec,harq_process->F,crc_type)) {
printf("\x1B[34m" "Segment %d CRC OK\n\033[0m",r); printf("\x1B[34m" "Segment %d CRC OK\n",r);
//Temporary hack //Temporary hack
no_iteration_ldpc = dlsch->max_ldpc_iterations; no_iteration_ldpc = dlsch->max_ldpc_iterations;
ret = no_iteration_ldpc; ret = no_iteration_ldpc;
} }
else { else {
printf("\x1B[33m" "CRC NOK\n\033[0m"); printf("\x1B[33m" "CRC NOK\n");
ret = 1 + dlsch->max_ldpc_iterations; ret = 1 + dlsch->max_ldpc_iterations;
} }
......
...@@ -104,10 +104,6 @@ typedef struct { ...@@ -104,10 +104,6 @@ typedef struct {
/// - first index: tx antenna [0..nb_antennas_tx[ /// - first index: tx antenna [0..nb_antennas_tx[
/// - second index: sample [0..] /// - second index: sample [0..]
int32_t **txdataF_BF; int32_t **txdataF_BF;
/// \brief holds the transmit data before beamforming in the frequency domain.
/// - first index: tx antenna [0..nb_antennas_tx[
/// - second index: sample [0..]
int32_t **txdataF;
/// \brief holds the transmit data before beamforming for epdcch/mpdcch /// \brief holds the transmit data before beamforming for epdcch/mpdcch
/// - first index : tx antenna [0..nb_epdcch_antenna_ports[ /// - first index : tx antenna [0..nb_epdcch_antenna_ports[
/// - second index: sampl [0..] /// - second index: sampl [0..]
...@@ -151,44 +147,6 @@ typedef struct { ...@@ -151,44 +147,6 @@ typedef struct {
} RU_CALIBRATION; } RU_CALIBRATION;
typedef struct RU_prec_t_s{
/// \internal This variable is protected by \ref mutex_feptx_prec
int instance_cnt_feptx_prec;
/// pthread struct for RU TX FEP PREC worker thread
pthread_t pthread_feptx_prec;
/// pthread attributes for worker feptx prec thread
pthread_attr_t attr_feptx_prec;
/// condition varible for RU TX FEP PREC thread
pthread_cond_t cond_feptx_prec;
/// mutex for fep PREC TX worker thread
pthread_mutex_t mutex_feptx_prec;
int symbol;
int p;//logical
int aa;//physical MAX nb_tx
struct RU_t_s *ru;
int index;
} RU_prec_t;
typedef struct RU_feptx_t_s{
/// \internal This variable is protected by \ref mutex_feptx_prec
int instance_cnt_feptx;
/// pthread struct for RU TX FEP PREC worker thread
pthread_t pthread_feptx;
/// pthread attributes for worker feptx prec thread
pthread_attr_t attr_feptx;
/// condition varible for RU TX FEP PREC thread
pthread_cond_t cond_feptx;
/// mutex for fep PREC TX worker thread
pthread_mutex_t mutex_feptx;
struct RU_t_s *ru;
int aa;//physical MAX nb_tx
int half_slot;//first or second half of a slot
int slot;//current slot
int symbol;//current symbol
int nb_antenna_ports;//number of logical port
int index;
}RU_feptx_t;
typedef struct RU_proc_t_s { typedef struct RU_proc_t_s {
/// Pointer to associated RU descriptor /// Pointer to associated RU descriptor
struct RU_t_s *ru; struct RU_t_s *ru;
...@@ -381,15 +339,9 @@ typedef struct RU_proc_t_s { ...@@ -381,15 +339,9 @@ typedef struct RU_proc_t_s {
int ru_rx_ready; int ru_rx_ready;
int ru_tx_ready; int ru_tx_ready;
int emulate_rf_busy; int emulate_rf_busy;
/// structure for precoding thread
RU_prec_t prec[16];
/// structure for feptx thread
RU_feptx_t feptx[16];
/// mask for checking process finished
int feptx_mask;
} RU_proc_t; } RU_proc_t;
typedef enum { typedef enum {
LOCAL_RF =0, LOCAL_RF =0,
REMOTE_IF5 =1, REMOTE_IF5 =1,
...@@ -543,16 +495,10 @@ typedef struct RU_t_s { ...@@ -543,16 +495,10 @@ typedef struct RU_t_s {
void (*eNB_top)(struct PHY_VARS_eNB_s *eNB, int frame_rx, int subframe_rx, char *string, struct RU_t_s *ru); void (*eNB_top)(struct PHY_VARS_eNB_s *eNB, int frame_rx, int subframe_rx, char *string, struct RU_t_s *ru);
void (*gNB_top)(struct PHY_VARS_gNB_s *gNB, int frame_rx, int slot_rx, char *string, struct RU_t_s *ru); void (*gNB_top)(struct PHY_VARS_gNB_s *gNB, int frame_rx, int slot_rx, char *string, struct RU_t_s *ru);
/// Timing data copy statistics (TX)
time_stats_t txdataF_copy_stats;
/// Timing statistics (TX)
time_stats_t precoding_stats;
/// Timing statistics /// Timing statistics
time_stats_t ofdm_demod_stats; time_stats_t ofdm_demod_stats;
/// Timing statistics (TX) /// Timing statistics (TX)
time_stats_t ofdm_mod_stats; time_stats_t ofdm_mod_stats;
/// Timing statistics (TX)
time_stats_t ofdm_total_stats;
/// Timing wait statistics /// Timing wait statistics
time_stats_t ofdm_demod_wait_stats; time_stats_t ofdm_demod_wait_stats;
/// Timing wakeup statistics /// Timing wakeup statistics
......
...@@ -994,7 +994,7 @@ typedef struct { ...@@ -994,7 +994,7 @@ typedef struct {
uint32_t nr_gold_pbch[2][64][NR_PBCH_DMRS_LENGTH_DWORD]; uint32_t nr_gold_pbch[2][64][NR_PBCH_DMRS_LENGTH_DWORD];
/// PDSCH DMRS /// PDSCH DMRS
uint32_t nr_gold_pdsch[2][20][2][NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD]; uint32_t nr_gold_pdsch[2][20][2][52];
/// PDCCH DMRS /// PDCCH DMRS
uint32_t nr_gold_pdcch[7][20][3][52]; uint32_t nr_gold_pdcch[7][20][3][52];
......
...@@ -218,8 +218,6 @@ int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subf ...@@ -218,8 +218,6 @@ int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subf
void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset); void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset);
void release_rnti_of_phy(module_id_t mod_id); void release_rnti_of_phy(module_id_t mod_id);
void ru_fep_full_2thread(RU_t *ru, int subframe);
/*@}*/ /*@}*/
......
...@@ -56,238 +56,154 @@ extern openair0_config_t openair0_cfg[MAX_CARDS]; ...@@ -56,238 +56,154 @@ extern openair0_config_t openair0_cfg[MAX_CARDS];
extern int oai_exit; extern int oai_exit;
void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols, int aa) { void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols) {
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
unsigned int slot_offset,slot_offsetF; unsigned int aa,slot_offset,slot_offsetF;
int slot = tti_tx; int slot = tti_tx;
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+(first_symbol!=0?1:0) , 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+(first_symbol!=0?1:0) , 1 );
slot_offset = slot*fp->samples_per_slot; slot_offset = slot*fp->samples_per_slot;
slot_offsetF = first_symbol*fp->ofdm_symbol_size; slot_offsetF = first_symbol*fp->ofdm_symbol_size;
if (first_symbol>0) slot_offset += (fp->ofdm_symbol_size*first_symbol) + (fp->nb_prefix_samples0) + (fp->nb_prefix_samples*(first_symbol-1)); if (first_symbol>0) slot_offset += (fp->ofdm_symbol_size*first_symbol) + (fp->nb_prefix_samples0) + (fp->nb_prefix_samples*(first_symbol-1));
LOG_D(PHY,"SFN/SF:RU:TX:%d/%d Generating slot %d (first_symbol %d num_symbols %d)\n",ru->proc.frame_tx, ru->proc.tti_tx,slot,first_symbol,num_symbols); LOG_D(PHY,"SFN/SF:RU:TX:%d/%d Generating slot %d (first_symbol %d num_symbols %d)\n",ru->proc.frame_tx, ru->proc.tti_tx,slot,first_symbol,num_symbols);
if (fp->Ncp == 1) { for (aa=0; aa<ru->nb_tx; aa++) {
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF], if (fp->Ncp == 1) {
(int*)&ru->common.txdata[aa][slot_offset],
fp->ofdm_symbol_size,
num_symbols,
fp->nb_prefix_samples,
CYCLIC_PREFIX);
}
else {
if (first_symbol==0) {
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF], PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF],
(int*)&ru->common.txdata[aa][slot_offset], (int*)&ru->common.txdata[aa][slot_offset],
fp->ofdm_symbol_size, fp->ofdm_symbol_size,
1, num_symbols,
fp->nb_prefix_samples0, fp->nb_prefix_samples,
CYCLIC_PREFIX); CYCLIC_PREFIX);
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF+fp->ofdm_symbol_size],
(int*)&ru->common.txdata[aa][slot_offset+fp->nb_prefix_samples0+fp->ofdm_symbol_size],
fp->ofdm_symbol_size,
num_symbols-1,
fp->nb_prefix_samples,
CYCLIC_PREFIX);
} }
else { else {
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF], if (first_symbol==0) {
(int*)&ru->common.txdata[aa][slot_offset], PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF],
fp->ofdm_symbol_size, (int*)&ru->common.txdata[aa][slot_offset],
num_symbols, fp->ofdm_symbol_size,
fp->nb_prefix_samples, 1,
CYCLIC_PREFIX); fp->nb_prefix_samples0,
CYCLIC_PREFIX);
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF+fp->ofdm_symbol_size],
(int*)&ru->common.txdata[aa][slot_offset+fp->nb_prefix_samples0+fp->ofdm_symbol_size],
fp->ofdm_symbol_size,
num_symbols-1,
fp->nb_prefix_samples,
CYCLIC_PREFIX);
}
else {
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF],
(int*)&ru->common.txdata[aa][slot_offset],
fp->ofdm_symbol_size,
num_symbols,
fp->nb_prefix_samples,
CYCLIC_PREFIX);
}
} }
} }
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+(first_symbol!=0?1:0), 0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+(first_symbol!=0?1:0), 0);
} }
void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) { void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) {
NR_DL_FRAME_PARMS *fp=ru->nr_frame_parms;
nfapi_nr_config_request_t *cfg = &ru->gNB_list[0]->gNB_config; nfapi_nr_config_request_t *cfg = &ru->gNB_list[0]->gNB_config;
RU_proc_t *proc = &ru->proc; RU_proc_t *proc = &ru->proc;
RU_feptx_t *feptx = proc->feptx; struct timespec wait;
PHY_VARS_gNB *gNB;
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
int slot = tti_tx; int slot = tti_tx;
int i = 0;
int j = 0;
int aa = 0;
int ret = 0;
int nb_antenna_ports = fp->N_ssb;
int ofdm_mask_full = (1<<(ru->nb_tx*2))-1;
int txdataF_offset = ((tti_tx%2)*fp->samples_per_slot_wCP);
if (nr_slot_select(cfg,slot) == SF_UL) return; wait.tv_sec=0;
for (aa=0; aa<fp->Lmax; aa++) { wait.tv_nsec=5000000L;
memset(ru->common.txdataF[aa],0,fp->samples_per_slot_wCP*sizeof(int32_t));
}
start_meas(&ru->ofdm_total_stats);
for(j=0; j<fp->symbols_per_slot; ++j){ start_meas(&ru->ofdm_mod_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+j , 1); if (nr_slot_select(cfg,slot) == SF_UL) return;
start_meas(&ru->txdataF_copy_stats);
if (ru->num_gNB == 1){
gNB = ru->gNB_list[0];
cfg = &gNB->gNB_config;
for(i=0; i<nb_antenna_ports; ++i){ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
memcpy((void*)&ru->common.txdataF[i][j*fp->ofdm_symbol_size],
(void*)&gNB->common_vars.txdataF[i][j*fp->ofdm_symbol_size + txdataF_offset],
fp->ofdm_symbol_size*sizeof(int32_t));
}
}//num_gNB == 1 if (nr_slot_select(cfg,slot)==SF_DL) {
stop_meas(&ru->txdataF_copy_stats); // If this is not an S-tti
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+j , 0); if (pthread_mutex_timedlock(&proc->mutex_feptx,&wait) != 0) {
printf("[RU] ERROR pthread_mutex_lock for feptx thread (IC %d)\n", proc->instance_cnt_feptx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 ); exit_fun( "error locking mutex_feptx" );
return;
if (nr_slot_select(cfg,slot)==SF_DL) { }
// If this is not an S-tti
for(i=0; i<ru->nb_tx; ++i){ if (proc->instance_cnt_feptx==0) {
if(j%2 == 0){ printf("[RU] FEPtx thread busy\n");
while(feptx[i].instance_cnt_feptx != -1){ exit_fun("FEPtx thread busy");
usleep(5); pthread_mutex_unlock( &proc->mutex_feptx );
} return;
AssertFatal((ret=pthread_mutex_lock(&feptx[i].mutex_feptx))==0,"mutex_lock return %d\n",ret); }
feptx[i].aa = i;
feptx[i].index = i; ++proc->instance_cnt_feptx;
feptx[i].ru = ru; // slot to pass to worker thread
feptx[i].symbol = j; proc->slot_feptx = slot;
feptx[i].slot = slot; pthread_mutex_unlock( &proc->mutex_feptx );
feptx[i].nb_antenna_ports = nb_antenna_ports;
feptx[i].instance_cnt_feptx = 0;
AssertFatal(pthread_cond_signal(&feptx[i].cond_feptx) == 0,"ERROR pthread_cond_signal for feptx_ofdm_thread\n"); if (pthread_cond_signal(&proc->cond_feptx) != 0) {
AssertFatal((ret=pthread_mutex_unlock(&feptx[i].mutex_feptx))==0,"mutex_lock returns %d\n",ret); printf("[RU] ERROR pthread_cond_signal for feptx thread\n");
} exit_fun( "ERROR pthread_cond_signal" );
else{ return;
while(feptx[i+ru->nb_tx].instance_cnt_feptx != -1){
usleep(5);
}
AssertFatal((ret=pthread_mutex_lock(&feptx[i+ru->nb_tx].mutex_feptx))==0,"mutex_lock return %d\n",ret);
feptx[i+ru->nb_tx].aa = i;
feptx[i+ru->nb_tx].index = i+ru->nb_tx;
feptx[i+ru->nb_tx].ru = ru;
feptx[i+ru->nb_tx].symbol = j;
feptx[i+ru->nb_tx].slot = slot;
feptx[i+ru->nb_tx].nb_antenna_ports = nb_antenna_ports;
feptx[i+ru->nb_tx].instance_cnt_feptx = 0;
AssertFatal(pthread_cond_signal(&feptx[i+ru->nb_tx].cond_feptx) == 0,"ERROR pthread_cond_signal for feptx_ofdm_thread\n");
AssertFatal((ret=pthread_mutex_unlock(&feptx[i+ru->nb_tx].mutex_feptx))==0,"mutex_lock returns %d\n",ret);
}
}
}//if == SF_DL
else {
proc->feptx_mask = ofdm_mask_full;
} }
}//j<fp->symbols_per_slot
// wait all process to finish
AssertFatal((ret=pthread_mutex_lock(&proc->mutex_feptx))==0,"mutex_lock return %d\n",ret);
while (proc->feptx_mask != ofdm_mask_full) {
// most of the time the thread is waiting here
// proc->instance_cnt_rxtx is -1
pthread_cond_wait(&proc->cond_feptx,&proc->mutex_feptx); // this unlocks mutex_rxtx while waiting and then locks it again
} }
proc->feptx_mask = 0;
AssertFatal((ret=pthread_mutex_unlock(&proc->mutex_feptx))==0,"mutex_lock return %d\n",ret);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RU_TX_OFDM_MASK, proc->feptx_mask ); // call first half-slot in this thread
nr_feptx0(ru,slot,0,fp->symbols_per_slot>>1);
wait_on_busy_condition(&proc->mutex_feptx,&proc->cond_feptx,&proc->instance_cnt_feptx,"NR feptx thread");
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 0 );
//write_output //write_output
stop_meas(&ru->ofdm_total_stats); stop_meas(&ru->ofdm_mod_stats);
} }
static void *nr_feptx_thread(void *param) { static void *nr_feptx_thread(void *param) {
RU_feptx_t *feptx = (RU_feptx_t *)param; RU_t *ru = (RU_t *)param;
RU_t *ru; RU_proc_t *proc = &ru->proc;
int aa, slot, start, l, nb_antenna_ports, ret;
int32_t ***bw;
NR_DL_FRAME_PARMS *fp;
int ofdm_mask_full;
while (!oai_exit) { while (!oai_exit) {
ret = 0; if (wait_on_condition(&proc->mutex_feptx,&proc->cond_feptx,&proc->instance_cnt_feptx,"NR feptx thread")<0) break;
if (wait_on_condition(&feptx->mutex_feptx,&feptx->cond_feptx,&feptx->instance_cnt_feptx,"NR feptx thread")<0) break; int slot=proc->slot_feptx;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+feptx->index+1 , 1 ); if (release_thread(&proc->mutex_feptx,&proc->instance_cnt_feptx,"NR feptx thread")<0) break;
ru = feptx->ru; nr_feptx0(ru,slot,ru->nr_frame_parms->symbols_per_slot>>1,ru->nr_frame_parms->symbols_per_slot>>1);
slot = feptx->slot;
aa = feptx->aa;
l = feptx->symbol;
fp = ru->nr_frame_parms;
start = feptx->symbol;
nb_antenna_ports = feptx->nb_antenna_ports;
ofdm_mask_full = (1<<(ru->nb_tx*2))-1;
bw = ru->beam_weights[0]; if (pthread_cond_signal(&proc->cond_feptx) != 0) {
start_meas(&ru->precoding_stats); LOG_E(PHY,"[gNB] ERROR pthread_cond_signal for NR feptx thread exit\n");
nr_beam_precoding(ru->common.txdataF, exit_fun( "ERROR pthread_cond_signal" );
ru->common.txdataF_BF, return NULL;
fp,
bw,
slot,
l,
aa,
nb_antenna_ports);
stop_meas(&ru->precoding_stats);
start_meas(&ru->ofdm_mod_stats);
nr_feptx0(ru,slot,start,1,aa);
stop_meas(&ru->ofdm_mod_stats);
if (release_thread(&feptx->mutex_feptx,&feptx->instance_cnt_feptx,"NR feptx thread")<0) break;
if(l >= fp->symbols_per_slot -2){
AssertFatal((ret=pthread_mutex_lock(&ru->proc.mutex_feptx))==0,"mutex_lock return %d\n",ret);
ru->proc.feptx_mask |= 1<<(feptx->index);
if(ru->proc.feptx_mask == ofdm_mask_full)
AssertFatal(pthread_cond_signal(&ru->proc.cond_feptx) == 0,"ERROR pthread_cond_signal for precoding and ofdm finish\n");
AssertFatal((ret=pthread_mutex_unlock(&ru->proc.mutex_feptx))==0,"mutex_lock returns %d\n",ret);
} }
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RU_TX_OFDM_MASK, ru->proc.feptx_mask );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+feptx->index+1 , 0 );
} }
return(NULL); return(NULL);
} }
void nr_init_feptx_thread(RU_t *ru) { void nr_init_feptx_thread(RU_t *ru) {
RU_proc_t *proc = &ru->proc; RU_proc_t *proc = &ru->proc;
RU_feptx_t *feptx = proc->feptx;
int i = 0;
for(i=0; i<16; i++){ proc->instance_cnt_feptx = -1;
feptx[i].instance_cnt_feptx = -1;
pthread_mutex_init( &feptx[i].mutex_feptx, NULL); pthread_mutex_init( &proc->mutex_feptx, NULL);
pthread_cond_init( &feptx[i].cond_feptx, NULL); pthread_cond_init( &proc->cond_feptx, NULL);
threadCreate(&feptx[i].pthread_feptx, nr_feptx_thread, (void*)&feptx[i], "feptx", -1, OAI_PRIORITY_RT); threadCreate(&proc->pthread_feptx, nr_feptx_thread, (void*)ru, "feptx", -1, OAI_PRIORITY_RT);
LOG_I(PHY,"init feptx thread %d\n", i);
}
}
}
// is this supposed to generate a slot or a subframe??? // is this supposed to generate a slot or a subframe???
// seems to be hardcoded to numerology 1 (2 slots=1 subframe) // seems to be hardcoded to numerology 1 (2 slots=1 subframe)
...@@ -309,7 +225,7 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx) { ...@@ -309,7 +225,7 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx) {
((nr_slot_select(cfg,slot)==SF_S))) { ((nr_slot_select(cfg,slot)==SF_S))) {
// LOG_D(HW,"Frame %d: Generating slot %d\n",frame,next_slot); // LOG_D(HW,"Frame %d: Generating slot %d\n",frame,next_slot);
nr_feptx0(ru,slot,0,fp->symbols_per_slot,aa); nr_feptx0(ru,slot,0,fp->symbols_per_slot);
} }
...@@ -322,165 +238,47 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx) { ...@@ -322,165 +238,47 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx) {
} }
static void *nr_feptx_prec_thread(void *param) {
RU_prec_t *prec = (RU_prec_t *) param;
RU_t *ru;
NR_DL_FRAME_PARMS *fp;
int symbol;
int p;
int aa;
int32_t *bw;
int32_t **txdataF;
int32_t **txdataF_BF;
while(!oai_exit)
{
if (wait_on_condition(&prec->mutex_feptx_prec,&prec->cond_feptx_prec,&prec->instance_cnt_feptx_prec,"NR feptx prec thread")<0) break;
ru = prec->ru;
symbol = prec->symbol;
p = prec->p;
aa = prec->aa;
fp = ru->nr_frame_parms;
bw = ru->beam_weights[0][p][aa];
txdataF = ru->common.txdataF;
txdataF_BF = ru->common.txdataF_BF;
multadd_cpx_vector((int16_t*)&txdataF[p][symbol*fp->ofdm_symbol_size],
(int16_t*)bw,
(int16_t*)&txdataF_BF[aa][symbol*fp->ofdm_symbol_size],
0,
fp->ofdm_symbol_size,
15);
if (release_thread(&prec->mutex_feptx_prec,&prec->instance_cnt_feptx_prec,"NR feptx thread")<0) break;
}
return 0;
}
void nr_feptx_prec_control(RU_t *ru,int frame,int tti_tx) {
int ret = 0;
int i = 0;
int symbol = 0;
int p = 0;
int aa = 0;
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
int nb_antenna_ports = fp->Lmax; // for now logical antenna ports corresponds to SSB
RU_prec_t *prec = ru->proc.prec;
PHY_VARS_gNB **gNB_list = ru->gNB_list,*gNB;
gNB = gNB_list[0];
start_meas(&ru->precoding_stats);
for(i=0; i<nb_antenna_ports; ++i)
memcpy((void*)ru->common.txdataF[i],
(void*)gNB->common_vars.txdataF[i],
fp->samples_per_slot_wCP*sizeof(int32_t));
for(symbol = 0; symbol < fp->symbols_per_slot; ++symbol){
for(p=0; p<nb_antenna_ports; p++){
for(aa=0;aa<ru->nb_tx;aa++){
if ((fp->L_ssb >> p) & 0x01){
while(1){
if(prec[i].instance_cnt_feptx_prec == -1){
AssertFatal((ret=pthread_mutex_lock(&prec[i].mutex_feptx_prec))==0,"mutex_lock return %d\n",ret);
prec[i].instance_cnt_feptx_prec = 0;
prec[i].symbol = symbol;
prec[i].p = p;
prec[i].aa = aa;
prec[i].index = i;
prec[i].ru = ru;
AssertFatal(pthread_cond_signal(&prec[i].cond_feptx_prec) == 0,"ERROR pthread_cond_signal for gNB_L1_thread\n");
AssertFatal((ret=pthread_mutex_unlock(&prec[i].mutex_feptx_prec))==0,"mutex_lock returns %d\n",ret);
i = (i+1) % 16;
break;
}
i = (i+1) % 16;
}
}//(frame_params->Lssb >> p) & 0x01
}//aa
}//p
}//symbol
i = 0;
while(1){
if(prec[i].instance_cnt_feptx_prec == -1) ++i;
if(i == 16) break;
}
stop_meas(&ru->precoding_stats);
}
void nr_feptx_prec(RU_t *ru,int frame,int tti_tx) { void nr_feptx_prec(RU_t *ru,int frame,int tti_tx) {
int l,aa; int l,aa;
PHY_VARS_gNB **gNB_list = ru->gNB_list,*gNB; NR_DL_FRAME_PARMS *fp=ru->nr_frame_parms;
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
nfapi_nr_config_request_t *cfg;
int32_t ***bw; int32_t ***bw;
int i=0; PHY_VARS_gNB **gNB_list = ru->gNB_list,*gNB;
gNB = gNB_list[0];
start_meas(&ru->precoding_stats);
if (ru->num_gNB == 1){
gNB = gNB_list[0];
cfg = &gNB->gNB_config;
if (nr_slot_select(cfg,tti_tx) == SF_UL) return;
for(i=0; i<fp->Lmax; ++i)
memcpy((void*)ru->common.txdataF[i],
(void*)gNB->common_vars.txdataF[i],
fp->samples_per_slot_wCP*sizeof(int32_t));
if (ru->nb_tx == 1) { if (ru->nb_tx == 1) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 1);
AssertFatal(fp->N_ssb==ru->nb_tx,"Attempting to transmit %d SSB while Nb_tx = %d",fp->N_ssb,ru->nb_tx);
for (int p=0; p<fp->Lmax; p++) {
if ((fp->L_ssb >> p) & 0x01){
memcpy((void*)ru->common.txdataF_BF[0],
(void*)ru->common.txdataF[p],
fp->samples_per_slot_wCP*sizeof(int32_t));
}
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 0);
}// if (ru->nb_tx == 1)
else {
bw = ru->beam_weights[0];
for (l=0;l<fp->symbols_per_slot;l++) {
for (aa=0;aa<ru->nb_tx;aa++) {
nr_beam_precoding(ru->common.txdataF,
ru->common.txdataF_BF,
fp,
bw,
tti_tx,
l,
aa,
fp->Lmax);
}// for (aa=0;aa<ru->nb_tx;aa++)
}// for (l=0;l<fp->symbols_per_slot;l++)
}// if (ru->nb_tx == 1)
}// if (ru->num_gNB == 1)
stop_meas(&ru->precoding_stats);
}
void nr_init_feptx_prec_thread(RU_t *ru){ AssertFatal(fp->N_ssb==ru->nb_tx,"Attempting to transmit %d SSB while Nb_tx = %d",fp->N_ssb,ru->nb_tx);
RU_proc_t *proc = &ru->proc; for (int p=0; p<fp->Lmax; p++) {
RU_prec_t *prec = proc->prec; if ((fp->L_ssb >> p) & 0x01)
int i=0; memcpy((void*)ru->common.txdataF_BF[0],
(void*)gNB->common_vars.txdataF[p],
for(i=0; i<16; ++i){ fp->samples_per_slot_wCP*sizeof(int32_t));
prec[i].instance_cnt_feptx_prec = -1; }
pthread_mutex_init( &prec[i].mutex_feptx_prec, NULL);
pthread_cond_init( &prec[i].cond_feptx_prec, NULL);
threadCreate(&prec[i].pthread_feptx_prec, nr_feptx_prec_thread, (void*)&prec[i], "nr_feptx_prec", -1, OAI_PRIORITY_RT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 0);
}
else {
bw = ru->beam_weights[0];
for (l=0;l<fp->symbols_per_slot;l++) {
for (aa=0;aa<ru->nb_tx;aa++) {
nr_beam_precoding(ru->gNB_list[0]->common_vars.txdataF,
ru->common.txdataF_BF,
fp,
bw,
tti_tx,
l,
aa);
}
}
} }
} }
void nr_fep0(RU_t *ru, int first_half) { void nr_fep0(RU_t *ru, int first_half) {
uint8_t start_symbol, end_symbol, l, aa; uint8_t start_symbol, end_symbol, l, aa;
......
...@@ -96,7 +96,6 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) { ...@@ -96,7 +96,6 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) {
uint8_t *pbch_pdu=&gNB->pbch_pdu[0]; uint8_t *pbch_pdu=&gNB->pbch_pdu[0];
uint8_t ssb_index, n_hf; uint8_t ssb_index, n_hf;
int ssb_start_symbol, rel_slot; int ssb_start_symbol, rel_slot;
int txdataF_offset = (slot%2)*fp->samples_per_slot_wCP;
n_hf = cfg->sch_config.half_frame_index.value; n_hf = cfg->sch_config.half_frame_index.value;
...@@ -126,18 +125,18 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) { ...@@ -126,18 +125,18 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) {
// it is supposed that each logical antenna port correspont to a different beam so each SSB is stored into its own index of txdataF // it is supposed that each logical antenna port correspont to a different beam so each SSB is stored into its own index of txdataF
LOG_D(PHY,"SS TX: frame %d, slot %d, start_symbol %d\n",frame,slot, ssb_start_symbol); LOG_D(PHY,"SS TX: frame %d, slot %d, start_symbol %d\n",frame,slot, ssb_start_symbol);
nr_generate_pss(gNB->d_pss, &txdataF[ssb_index][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); nr_generate_pss(gNB->d_pss, txdataF[ssb_index], AMP, ssb_start_symbol, cfg, fp);
nr_generate_sss(gNB->d_sss, &txdataF[ssb_index][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); nr_generate_sss(gNB->d_sss, txdataF[ssb_index], AMP, ssb_start_symbol, cfg, fp);
if (fp->Lmax == 4) if (fp->Lmax == 4)
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index],&txdataF[ssb_index][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index],txdataF[ssb_index], AMP, ssb_start_symbol, cfg, fp);
else else
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[0][ssb_index],&txdataF[ssb_index][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[0][ssb_index],txdataF[ssb_index], AMP, ssb_start_symbol, cfg, fp);
nr_generate_pbch(&gNB->pbch, nr_generate_pbch(&gNB->pbch,
pbch_pdu, pbch_pdu,
gNB->nr_pbch_interleaver, gNB->nr_pbch_interleaver,
&txdataF[ssb_index][txdataF_offset], txdataF[ssb_index],
AMP, AMP,
ssb_start_symbol, ssb_start_symbol,
n_hf,fp->Lmax,ssb_index, n_hf,fp->Lmax,ssb_index,
...@@ -156,7 +155,6 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, ...@@ -156,7 +155,6 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
nfapi_nr_config_request_t *cfg = &gNB->gNB_config; nfapi_nr_config_request_t *cfg = &gNB->gNB_config;
int offset = gNB->CC_id; int offset = gNB->CC_id;
uint8_t ssb_frame_periodicity; // every how many frames SSB are generated uint8_t ssb_frame_periodicity; // every how many frames SSB are generated
int txdataF_offset = (slot%2)*fp->samples_per_slot_wCP;
if (cfg->sch_config.ssb_periodicity.value < 20) if (cfg->sch_config.ssb_periodicity.value < 20)
ssb_frame_periodicity = 1; ssb_frame_periodicity = 1;
...@@ -171,7 +169,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, ...@@ -171,7 +169,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
// clear the transmit data array for the current subframe // clear the transmit data array for the current subframe
for (aa=0; aa<fp->Lmax; aa++) { for (aa=0; aa<fp->Lmax; aa++) {
memset(&gNB->common_vars.txdataF[aa][txdataF_offset],0,fp->samples_per_slot_wCP*sizeof(int32_t)); memset(gNB->common_vars.txdataF[aa],0,fp->samples_per_slot_wCP*sizeof(int32_t));
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_COMMON_TX,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_COMMON_TX,1);
...@@ -191,10 +189,9 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, ...@@ -191,10 +189,9 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,1);
nr_generate_dci_top(gNB->pdcch_vars.dci_alloc[i], nr_generate_dci_top(gNB->pdcch_vars.dci_alloc[i],
gNB->nr_gold_pdcch_dmrs[slot], gNB->nr_gold_pdcch_dmrs[slot],
&gNB->common_vars.txdataF[0][txdataF_offset], // hardcoded to beam 0 gNB->common_vars.txdataF[0], // hardcoded to beam 0
AMP, *fp, *cfg); AMP, *fp, *cfg);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,0);
} }
......
...@@ -42,16 +42,12 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx); ...@@ -42,16 +42,12 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx);
void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot); void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot);
void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx); void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx);
void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx); void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx);
void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols, int aa); void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols);
void nr_init_feptx_thread(RU_t *ru); void nr_init_feptx_thread(RU_t *ru);
void fep_full(RU_t *ru,int slot);
void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx); void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx);
void nr_init_feptx_prec_thread(RU_t *ru);
void nr_feptx_prec_control(RU_t *ru,int frame,int tti_tx);
void nr_init_feprx_thread(RU_t *ru); void nr_init_feprx_thread(RU_t *ru);
void nr_fep_full(RU_t *ru, int slot); void nr_fep_full(RU_t *ru, int slot);
void nr_fep_full_2thread(RU_t *ru, int slot); void nr_fep_full_2thread(RU_t *ru, int slot);
void feptx_prec(RU_t *ru,int frame_tx,int tti_tx);
int nr_phy_init_RU(RU_t *ru); int nr_phy_init_RU(RU_t *ru);
void nr_configure_css_dci_initial(nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params, void nr_configure_css_dci_initial(nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params,
......
...@@ -602,26 +602,24 @@ int main(int argc, char **argv) ...@@ -602,26 +602,24 @@ int main(int argc, char **argv)
phy_procedures_gNB_TX(gNB,frame,slot,0); phy_procedures_gNB_TX(gNB,frame,slot,0);
//nr_common_signal_procedures (gNB,frame,subframe); //nr_common_signal_procedures (gNB,frame,subframe);
int txdataF_offset = (slot%2) * frame_parms->samples_per_slot_wCP;
LOG_M("txsigF0.m","txsF0", gNB->common_vars.txdataF[0],frame_length_complex_samples_no_prefix,1,1); LOG_M("txsigF0.m","txsF0", gNB->common_vars.txdataF[0],frame_length_complex_samples_no_prefix,1,1);
if (gNB->frame_parms.nb_antennas_tx>1) if (gNB->frame_parms.nb_antennas_tx>1)
LOG_M("txsigF1.m","txsF1", gNB->common_vars.txdataF[1],frame_length_complex_samples_no_prefix,1,1); LOG_M("txsigF1.m","txsF1", gNB->common_vars.txdataF[1],frame_length_complex_samples_no_prefix,1,1);
int tx_offset = slot*frame_parms->samples_per_slot; int tx_offset = slot*frame_parms->samples_per_slot;
printf("samples_per_slot_wCP = %d\n", frame_parms->samples_per_slot_wCP);
//TODO: loop over slots //TODO: loop over slots
for (aa=0; aa<gNB->frame_parms.nb_antennas_tx; aa++) { for (aa=0; aa<gNB->frame_parms.nb_antennas_tx; aa++) {
if (gNB_config->subframe_config.dl_cyclic_prefix_type.value == 1) { if (gNB_config->subframe_config.dl_cyclic_prefix_type.value == 1) {
PHY_ofdm_mod(&gNB->common_vars.txdataF[aa][txdataF_offset], PHY_ofdm_mod(gNB->common_vars.txdataF[aa],
&txdata[aa][tx_offset], &txdata[aa][tx_offset],
frame_parms->ofdm_symbol_size, frame_parms->ofdm_symbol_size,
12, 12,
frame_parms->nb_prefix_samples, frame_parms->nb_prefix_samples,
CYCLIC_PREFIX); CYCLIC_PREFIX);
} else { } else {
nr_normal_prefix_mod(&gNB->common_vars.txdataF[aa][txdataF_offset], nr_normal_prefix_mod(gNB->common_vars.txdataF[aa],
&txdata[aa][tx_offset], &txdata[aa][tx_offset],
14, 14,
frame_parms); frame_parms);
...@@ -879,17 +877,25 @@ int main(int argc, char **argv) ...@@ -879,17 +877,25 @@ int main(int argc, char **argv)
printf("*****************************************\n"); printf("*****************************************\n");
printf("SNR %f, (false positive %f)\n", SNR, printf("SNR %f, (false positive %f)\n", SNR,
(float) n_errors / (float) n_trials); (float) n_false_positive / (float) n_trials);
printf("*****************************************\n"); printf("*****************************************\n");
printf("\n"); printf("\n");
if (errors_bit == 0) {
printf("PDSCH test OK\n");
printf("\n");
}
printf("SNR %f : n_errors (negative CRC) = %d/%d\n", SNR, n_errors, n_trials); printf("SNR %f : n_errors (negative CRC) = %d/%d\n", SNR, n_errors, n_trials);
printf("\n"); printf("\n");
if ((float)n_errors/(float)n_trials <= target_error_rate) { if ((float)n_errors/(float)n_trials <= target_error_rate) {
printf("PDSCH test OK\n"); printf("PDCCH test OK\n");
break; break;
} }
if (n_trials == 1)
break;
} // NSR } // NSR
......
...@@ -455,14 +455,14 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, ...@@ -455,14 +455,14 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
#if defined(__x86_64) || defined(__i386__) #if defined(__x86_64) || defined(__i386__)
#ifdef __AVX2__ #ifdef __AVX2__
nsamps2 = (nsamps+7)>>3; nsamps2 = (nsamps+7)>>3;
__m256i buff_tx[8][nsamps2]; __m256i buff_tx[2][nsamps2];
#else #else
nsamps2 = (nsamps+3)>>2; nsamps2 = (nsamps+3)>>2;
__m128i buff_tx[8][nsamps2]; __m128i buff_tx[2][nsamps2];
#endif #endif
#elif defined(__arm__) #elif defined(__arm__)
nsamps2 = (nsamps+3)>>2; nsamps2 = (nsamps+3)>>2;
int16x8_t buff_tx[8][nsamps2]; int16x8_t buff_tx[2][nsamps2];
#else #else
#error Unsupported CPU architecture, USRP device cannot be built #error Unsupported CPU architecture, USRP device cannot be built
#endif #endif
...@@ -566,14 +566,14 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp ...@@ -566,14 +566,14 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
#if defined(__x86_64) || defined(__i386__) #if defined(__x86_64) || defined(__i386__)
#ifdef __AVX2__ #ifdef __AVX2__
nsamps2 = (nsamps+7)>>3; nsamps2 = (nsamps+7)>>3;
__m256i buff_tmp[8][nsamps2]; __m256i buff_tmp[2][nsamps2];
#else #else
nsamps2 = (nsamps+3)>>2; nsamps2 = (nsamps+3)>>2;
__m128i buff_tmp[8][nsamps2]; __m128i buff_tmp[2][nsamps2];
#endif #endif
#elif defined(__arm__) #elif defined(__arm__)
nsamps2 = (nsamps+3)>>2; nsamps2 = (nsamps+3)>>2;
int16x8_t buff_tmp[8][nsamps2]; int16x8_t buff_tmp[2][nsamps2];
#endif #endif
if (device->type == USRP_B200_DEV) { if (device->type == USRP_B200_DEV) {
......
...@@ -246,16 +246,15 @@ L1s = ( ...@@ -246,16 +246,15 @@ L1s = (
RUs = ( RUs = (
{ {
local_rf = "yes" local_rf = "yes"
nb_tx = 1; nb_tx = 1
nb_rx = 1; nb_rx = 1
att_tx = 0; att_tx = 0
att_rx = 0; att_rx = 0;
bands = [7]; bands = [7];
max_pdschReferenceSignalPower = -27; max_pdschReferenceSignalPower = -27;
max_rxgain = 114; max_rxgain = 114;
eNB_instances = [0]; eNB_instances = [0];
sdr_addrs = "addr=192.168.10.2,second_addr=192.168.20.2,mgmt_addr=192.168.10.2,clock_source=external,time_source=external";
sdr_addrs = "addr=192.168.10.2,second_addr=192.168.20.2,clock_source=external,time_source=external";
} }
); );
......
...@@ -70,7 +70,7 @@ gNBs = ...@@ -70,7 +70,7 @@ gNBs =
UL_BWP_prefix_type = "NORMAL"; UL_BWP_prefix_type = "NORMAL";
UL_timeAlignmentTimerCommon = "infinity"; UL_timeAlignmentTimerCommon = "infinity";
ServingCellConfigCommon_n_TimingAdvanceOffset = "n0" ServingCellConfigCommon_n_TimingAdvanceOffset = "n0"
ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0x01;##### ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0x01;
ServingCellConfigCommon_ssb_periodicityServingCell = 10; ServingCellConfigCommon_ssb_periodicityServingCell = 10;
ServingCellConfigCommon_dmrs_TypeA_Position = 2; ServingCellConfigCommon_dmrs_TypeA_Position = 2;
NIA_SubcarrierSpacing = "kHz15"; NIA_SubcarrierSpacing = "kHz15";
...@@ -246,7 +246,7 @@ L1s = ( ...@@ -246,7 +246,7 @@ L1s = (
RUs = ( RUs = (
{ {
local_rf = "yes" local_rf = "yes"
nb_tx = 1 nb_tx = 1
nb_rx = 1 nb_rx = 1
att_tx = 0 att_tx = 0
att_rx = 0; att_rx = 0;
...@@ -262,9 +262,9 @@ RUs = ( ...@@ -262,9 +262,9 @@ RUs = (
THREAD_STRUCT = ( THREAD_STRUCT = (
{ {
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT"; parallel_config = "PARALLEL_SINGLE_THREAD";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE"; worker_config = "WORKER_DISABLE";
} }
); );
......
...@@ -70,7 +70,7 @@ gNBs = ...@@ -70,7 +70,7 @@ gNBs =
UL_BWP_prefix_type = "NORMAL"; UL_BWP_prefix_type = "NORMAL";
UL_timeAlignmentTimerCommon = "infinity"; UL_timeAlignmentTimerCommon = "infinity";
ServingCellConfigCommon_n_TimingAdvanceOffset = "n0" ServingCellConfigCommon_n_TimingAdvanceOffset = "n0"
ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0x0ff; ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0x01;
ServingCellConfigCommon_ssb_periodicityServingCell = 10; ServingCellConfigCommon_ssb_periodicityServingCell = 10;
ServingCellConfigCommon_dmrs_TypeA_Position = 2; ServingCellConfigCommon_dmrs_TypeA_Position = 2;
NIA_SubcarrierSpacing = "kHz15"; NIA_SubcarrierSpacing = "kHz15";
...@@ -246,7 +246,7 @@ L1s = ( ...@@ -246,7 +246,7 @@ L1s = (
RUs = ( RUs = (
{ {
local_rf = "yes" local_rf = "yes"
nb_tx = 8 nb_tx = 1
nb_rx = 1 nb_rx = 1
att_tx = 0 att_tx = 0
att_rx = 0; att_rx = 0;
...@@ -264,7 +264,7 @@ THREAD_STRUCT = ( ...@@ -264,7 +264,7 @@ THREAD_STRUCT = (
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_SINGLE_THREAD"; parallel_config = "PARALLEL_SINGLE_THREAD";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE"; worker_config = "WORKER_DISABLE";
} }
); );
......
[*] [*]
[*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI [*] GTKWave Analyzer v3.3.61 (w)1999-2014 BSI
[*] Fri Sep 6 15:01:30 2019 [*] Sat May 18 17:25:11 2019
[*] [*]
[dumpfile] "/tmp/gNB_prec.vcd" [dumpfile] "/tmp/openair_dump_gNB40.vcd"
[dumpfile_mtime] "Fri Sep 6 14:59:50 2019" [dumpfile_mtime] "Sat May 18 17:11:31 2019"
[dumpfile_size] 13106022 [dumpfile_size] 53148516
[savefile] "/homes/wangts/openairinterface5g/targets/RT/USER/gNB_usrp.gtkw" [savefile] "/home/caracal/raymond/openairinterface5g/targets/RT/USER/gNB_usrp.gtkw"
[timestart] 2183320000 [timestart] 11552775390
[size] 1920 1018 [size] 1840 795
[pos] -1 -1 [pos] -1 -1
*-18.423141 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 *-13.848083 11552814436 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
[sst_width] 386 [sst_width] 386
[signals_width] 344 [signals_width] 344
[sst_expanded] 1 [sst_expanded] 1
[sst_vpaned_height] 267 [sst_vpaned_height] 197
@28 @28
functions.trx_read functions.trx_read
functions.trx_write functions.trx_write
...@@ -24,8 +24,9 @@ variables.frame_number_TX1_UE[63:0] ...@@ -24,8 +24,9 @@ variables.frame_number_TX1_UE[63:0]
functions.ue_gain_control functions.ue_gain_control
@420 @420
variables.frame_number_RX1_UE[63:0] variables.frame_number_RX1_UE[63:0]
@24 @25
variables.trx_ts_ue[63:0] variables.trx_ts_ue[63:0]
@24
variables.trx_ts[63:0] variables.trx_ts[63:0]
variables.trx_tst[63:0] variables.trx_tst[63:0]
variables.frame_number_RX0_RU[63:0] variables.frame_number_RX0_RU[63:0]
...@@ -62,7 +63,5 @@ functions.phy_procedures_ru_feptx_ofdm0 ...@@ -62,7 +63,5 @@ functions.phy_procedures_ru_feptx_ofdm0
functions.phy_procedures_ru_feptx_ofdm1 functions.phy_procedures_ru_feptx_ofdm1
functions.phy_procedures_ru_feptx_prec0 functions.phy_procedures_ru_feptx_prec0
functions.phy_procedures_ru_feptx_prec1 functions.phy_procedures_ru_feptx_prec1
@23
variables.ru_tx_ofdm_mask[63:0]
[pattern_trace] 1 [pattern_trace] 1
[pattern_trace] 0 [pattern_trace] 0
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