Merge remote-tracking branch 'origin/develop' into nr_pucch2
Conflicts: cmake_targets/autotests/test_case_list.xml executables/nr-gnb.c openair1/PHY/INIT/nr_init.c openair1/PHY/TOOLS/tools_defs.h openair1/PHY/defs_gNB.h openair1/SCHED_NR/phy_procedures_nr_gNB.c
This commit is contained in:
+93
-83
@@ -342,34 +342,8 @@ function check_iperf {
|
||||
local FILE_COMPLETE=`egrep -c "Server Report" ${LOC_BASE_LOG}_client.txt`
|
||||
if [ $FILE_COMPLETE -eq 0 ]
|
||||
then
|
||||
# This part will become obsolete once we have UL
|
||||
if [[ $LOC_IS_RF_SIM -eq 1 ]] && [[ $LOC_IS_NR -eq 1 ]]
|
||||
then
|
||||
echo "no UL integration right now --> normal to have no server report"
|
||||
if [ -f ${LOC_BASE_LOG}_server.txt ]
|
||||
then
|
||||
local EFFECTIVE_BANDWIDTH=`tail -n1 ${LOC_BASE_LOG}_server.txt | sed -e "s#^.*MBytes *##" -e "s#^.*KBytes *##" -e "s#sec.*#sec#"`
|
||||
if [[ $2 =~ .*K.* ]]
|
||||
then
|
||||
local BW_PREFIX="K"
|
||||
else
|
||||
local BW_PREFIX="M"
|
||||
fi
|
||||
if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*${BW_PREFIX}bits.* ]]
|
||||
then
|
||||
echo "got requested DL bandwidth: $EFFECTIVE_BANDWIDTH"
|
||||
else
|
||||
echo "got LESS than requested DL bandwidth: $EFFECTIVE_BANDWIDTH"
|
||||
IPERF_STATUS=-1
|
||||
fi
|
||||
else
|
||||
IPERF_STATUS=-1
|
||||
echo "Server File Report not found"
|
||||
fi
|
||||
else
|
||||
IPERF_STATUS=-1
|
||||
echo "File Report not found"
|
||||
fi
|
||||
IPERF_STATUS=-1
|
||||
echo "File Report not found"
|
||||
else
|
||||
if [ `egrep -c "Mbits/sec" ${LOC_BASE_LOG}_client.txt` -ne 0 ]
|
||||
then
|
||||
@@ -2044,81 +2018,117 @@ function run_test_on_vm {
|
||||
|
||||
if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-rf-sim.* ]]
|
||||
then
|
||||
NR_STATUS=0
|
||||
PING_STATUS=0
|
||||
IPERF_STATUS=0
|
||||
|
||||
CN_CONFIG="noS1"
|
||||
CONF_FILE=gnb.band78.tm1.106PRB.usrpn300.conf
|
||||
S1_NOS1_CFG=0
|
||||
PRB=106
|
||||
FREQUENCY=3510
|
||||
|
||||
local try_cnt="0"
|
||||
NR_STATUS=0
|
||||
|
||||
######### start of loop
|
||||
while [ $try_cnt -lt 5 ]
|
||||
do
|
||||
SYNC_STATUS=0
|
||||
PING_STATUS=0
|
||||
IPERF_STATUS=0
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Starting the gNB"
|
||||
echo "############################################################"
|
||||
CURRENT_GNB_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_gnb.log
|
||||
start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Starting the gNB"
|
||||
echo "############################################################"
|
||||
CURRENT_GNB_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_gnb.log
|
||||
start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Starting the NR-UE"
|
||||
echo "############################################################"
|
||||
CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue.log
|
||||
start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG
|
||||
if [ $NR_UE_SYNC -eq 0 ]
|
||||
then
|
||||
echo "Problem w/ gNB and NR-UE not syncing"
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Starting the NR-UE"
|
||||
echo "############################################################"
|
||||
CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue.log
|
||||
start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG
|
||||
if [ $NR_UE_SYNC -eq 0 ]
|
||||
then
|
||||
echo "Problem w/ gNB and NR-UE not syncing"
|
||||
terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2
|
||||
terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1
|
||||
SYNC_STATUS=-1
|
||||
try_cnt=$[$try_cnt+1]
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Pinging the gNB from NR-UE"
|
||||
echo "############################################################"
|
||||
get_enb_noS1_ip_addr $GNB_VM_CMDS $GNB_VM_IP_ADDR
|
||||
PING_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ping_gnb_from_nrue.log
|
||||
ping_epc_ip_addr $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $ENB_IP_ADDR $PING_LOG_FILE 1 0
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC
|
||||
check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Pinging the NR-UE from gNB"
|
||||
echo "############################################################"
|
||||
get_ue_ip_addr $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 1
|
||||
PING_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ping_from_gnb_nrue.log
|
||||
ping_enb_ip_addr $GNB_VM_CMDS $GNB_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE 0
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC
|
||||
check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : iperf DL -- NR-UE is server and gNB is client"
|
||||
echo "############################################################"
|
||||
THROUGHPUT="30K"
|
||||
CURR_IPERF_LOG_BASE=tdd_${PRB}prb_${CN_CONFIG}_iperf_dl
|
||||
get_enb_noS1_ip_addr $GNB_VM_CMDS $GNB_VM_IP_ADDR
|
||||
get_ue_ip_addr $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 1
|
||||
generic_iperf $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $UE_IP_ADDR $GNB_VM_CMDS $GNB_VM_IP_ADDR $ENB_IP_ADDR $THROUGHPUT $CURR_IPERF_LOG_BASE 1 0
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
|
||||
check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT
|
||||
if [ $IPERF_STATUS -ne 0 ]
|
||||
then
|
||||
echo "DL test not OK"
|
||||
terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2
|
||||
terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1
|
||||
try_cnt=$[$try_cnt+1]
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : iperf UL -- gNB is server and NR-UE is client"
|
||||
echo "############################################################"
|
||||
THROUGHPUT="30K"
|
||||
CURR_IPERF_LOG_BASE=tdd_${PRB}prb_${CN_CONFIG}_iperf_ul
|
||||
get_enb_noS1_ip_addr $GNB_VM_CMDS $GNB_VM_IP_ADDR
|
||||
get_ue_ip_addr $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 1
|
||||
generic_iperf $GNB_VM_CMDS $GNB_VM_IP_ADDR $ENB_IP_ADDR $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $UE_IP_ADDR $THROUGHPUT $CURR_IPERF_LOG_BASE 1 0
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
|
||||
check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Terminate gNB/NR-UE simulators"
|
||||
echo "############################################################"
|
||||
terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2
|
||||
terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC
|
||||
echo "5G-NR RFSIM seems to FAIL"
|
||||
echo "5G-NR: TEST_KO" >> $ARCHIVES_LOC/test_final_status.log
|
||||
STATUS=-1
|
||||
return
|
||||
fi
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : iperf DL -- NR-UE is server and gNB is client"
|
||||
echo "############################################################"
|
||||
THROUGHPUT="30K"
|
||||
CURR_IPERF_LOG_BASE=tdd_${PRB}prb_${CN_CONFIG}_iperf_dl
|
||||
get_enb_noS1_ip_addr $GNB_VM_CMDS $GNB_VM_IP_ADDR
|
||||
get_ue_ip_addr $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 1
|
||||
generic_iperf $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $UE_IP_ADDR $GNB_VM_CMDS $GNB_VM_IP_ADDR $ENB_IP_ADDR $THROUGHPUT $CURR_IPERF_LOG_BASE 1 0
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
|
||||
check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : iperf UL -- gNB is server and NR-UE is client"
|
||||
echo "############################################################"
|
||||
THROUGHPUT="30K"
|
||||
CURR_IPERF_LOG_BASE=tdd_${PRB}prb_${CN_CONFIG}_iperf_ul
|
||||
get_enb_noS1_ip_addr $GNB_VM_CMDS $GNB_VM_IP_ADDR
|
||||
get_ue_ip_addr $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 1
|
||||
generic_iperf $GNB_VM_CMDS $GNB_VM_IP_ADDR $ENB_IP_ADDR $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $UE_IP_ADDR $THROUGHPUT $CURR_IPERF_LOG_BASE 1 0
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
|
||||
check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Terminate gNB/NR-UE simulators"
|
||||
echo "############################################################"
|
||||
terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2
|
||||
terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC
|
||||
|
||||
if [ $IPERF_STATUS -ne 0 ]
|
||||
then
|
||||
echo "UL test not OK"
|
||||
try_cnt=$[$try_cnt+1]
|
||||
else
|
||||
try_cnt=$[$try_cnt+10]
|
||||
fi
|
||||
done
|
||||
######### end of loop
|
||||
full_l2_sim_destroy
|
||||
|
||||
|
||||
echo "############################################################"
|
||||
echo "Checking run status"
|
||||
echo "############################################################"
|
||||
|
||||
if [ $SYNC_STATUS -ne 0 ]; then NR_STATUS=-1; fi
|
||||
if [ $PING_STATUS -ne 0 ]; then NR_STATUS=-1; fi
|
||||
if [ $IPERF_STATUS -ne 0 ]; then NR_STATUS=-1; fi
|
||||
if [ $NR_STATUS -eq 0 ]
|
||||
|
||||
@@ -1330,6 +1330,9 @@ add_library(ldpc MODULE ${PHY_LDPC_OPTIM8SEGMULTI_SRC} )
|
||||
|
||||
add_library(coding MODULE ${PHY_TURBOSRC} )
|
||||
|
||||
add_library(dfts MODULE ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts.c )
|
||||
|
||||
|
||||
set(PHY_SRC_COMMON
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools_common.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c
|
||||
@@ -1370,7 +1373,7 @@ set(PHY_SRC_COMMON
|
||||
${OPENAIR1_DIR}/PHY/INIT/lte_parms.c
|
||||
${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/lte_dfts.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/dfts_load.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/log2_approx.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/cmult_sv.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/cmult_vv.c
|
||||
@@ -1588,6 +1591,7 @@ endif ()
|
||||
|
||||
add_library(PHY_COMMON ${PHY_SRC_COMMON})
|
||||
add_dependencies(PHY_COMMON rrc_flag)
|
||||
add_dependencies(PHY_COMMON dfts)
|
||||
add_library(PHY ${PHY_SRC})
|
||||
add_dependencies(PHY rrc_flag)
|
||||
add_library(PHY_UE ${PHY_SRC_UE})
|
||||
|
||||
@@ -1104,8 +1104,8 @@
|
||||
-n100 -R217 -a80 -s5
|
||||
-n100 -R217 -a110 -s5 -b100
|
||||
-n100 -e27 -s30
|
||||
-n100 -e16 -s10 </main_exec_args>
|
||||
<tags>nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10 </tags>
|
||||
-n100 -e16 -s10</main_exec_args>
|
||||
<tags>nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10</tags>
|
||||
<search_expr_true>PDSCH test OK</search_expr_true>
|
||||
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
|
||||
<nruns>3</nruns>
|
||||
|
||||
@@ -217,7 +217,7 @@ install_protobuf_from_source(){
|
||||
#tar -xzvf protobuf-2.6.1.tar.gz --owner $USER --group $USER --no-same-owner
|
||||
#cd protobuf-2.6.1/
|
||||
rm -rf /tmp/protobuf-cpp-3.3.0.tar.gz* /tmp/protobuf-3.3.0
|
||||
wget https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz
|
||||
wget --tries=3 --retry-connrefused https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz
|
||||
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $USER --group $(groups | cut -d" " -f1) --no-same-owner
|
||||
cd protobuf-3.3.0/
|
||||
./configure
|
||||
@@ -353,8 +353,8 @@ install_bladerf_driver_from_source(){
|
||||
$SUDO ldconfig
|
||||
echo "Downloading FPGA and firmware images"
|
||||
cd /tmp/bladeRF
|
||||
wget https://www.nuand.com/fx3/bladeRF_fw_latest.img
|
||||
wget https://www.nuand.com/fpga/hostedx40-latest.rbf
|
||||
wget --tries=3 --retry-connrefused https://www.nuand.com/fx3/bladeRF_fw_latest.img
|
||||
wget --tries=3 --retry-connrefused https://www.nuand.com/fpga/hostedx40-latest.rbf
|
||||
sudo mkdir -p /usr/share/Nuand/bladeRF
|
||||
sudo mv bladeRF_fw_latest.img /usr/share/Nuand/bladeRF/bladeRF_fw.img
|
||||
sudo mv hostedx40-latest.rbf /usr/share/Nuand/bladeRF/hostedx40.rbf
|
||||
@@ -567,7 +567,7 @@ check_install_additional_tools (){
|
||||
echo_info "Installing Netinterfaces package. The logfile for installation is in $log_netiface"
|
||||
(
|
||||
$SUDO rm -fr /tmp/netifaces-0.10.4.tar.gz /tmp/netifaces
|
||||
wget -P /tmp https://pypi.python.org/packages/18/fa/dd13d4910aea339c0bb87d2b3838d8fd923c11869b1f6e741dbd0ff3bc00/netifaces-0.10.4.tar.gz
|
||||
wget --tries=3 --retry-connrefused -P /tmp https://pypi.python.org/packages/18/fa/dd13d4910aea339c0bb87d2b3838d8fd923c11869b1f6e741dbd0ff3bc00/netifaces-0.10.4.tar.gz
|
||||
tar -xzvf /tmp/netifaces-0.10.4.tar.gz -C /tmp
|
||||
cd /tmp/netifaces-0.10.4
|
||||
$SUDO python setup.py install
|
||||
|
||||
@@ -110,13 +110,13 @@ void measurcmd_display_pdcpcpu(telnet_printfunc_t prnt) {
|
||||
|
||||
|
||||
void measurcmd_display_macstats_ue(telnet_printfunc_t prnt) {
|
||||
UE_list_t *UE_list = &(RC.mac[eNB_id]->UE_list);
|
||||
UE_info_t *UE_info = &(RC.mac[eNB_id]->UE_info);
|
||||
|
||||
for (int UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
|
||||
for (int i=0; i<UE_list->numactiveCCs[UE_id]; i++) {
|
||||
int CC_id = UE_list->ordered_CCids[i][UE_id];
|
||||
for (int UE_id=UE_info->list.head; UE_id>=0; UE_id=UE_info->list.next[UE_id]) {
|
||||
for (int i=0; i<UE_info->numactiveCCs[UE_id]; i++) {
|
||||
int CC_id = UE_info->ordered_CCids[i][UE_id];
|
||||
prnt("%s UE %i Id %i CCid %i %s\n",HDR,i,UE_id,CC_id,HDR);
|
||||
eNB_UE_STATS *macuestatptr = &(UE_list->eNB_UE_stats[CC_id][UE_id]);
|
||||
eNB_UE_STATS *macuestatptr = &(UE_info->eNB_UE_stats[CC_id][UE_id]);
|
||||
telnet_ltemeasurdef_t statsptr[]=LTEMAC_UEMEASURE;
|
||||
measurcmd_display_measures(prnt, statsptr, sizeof(statsptr)/sizeof(telnet_ltemeasurdef_t));
|
||||
}
|
||||
@@ -155,7 +155,7 @@ void measurcmd_display_one_rlcstat(telnet_printfunc_t prnt, int UE_id, telnet_lt
|
||||
|
||||
void measurcmd_display_rlcstats(telnet_printfunc_t prnt) {
|
||||
protocol_ctxt_t ctxt;
|
||||
UE_list_t *UE_list = &(RC.mac[eNB_id]->UE_list);
|
||||
UE_info_t *UE_info = &(RC.mac[eNB_id]->UE_info);
|
||||
telnet_ltemeasurdef_t statsptr[]=LTE_RLCMEASURE;
|
||||
int num_rlcmeasure = sizeof(statsptr)/sizeof(telnet_ltemeasurdef_t );
|
||||
unsigned int *rlcstats = malloc(num_rlcmeasure*sizeof(unsigned int));
|
||||
@@ -165,9 +165,9 @@ void measurcmd_display_rlcstats(telnet_printfunc_t prnt) {
|
||||
statsptr[i].vptr = rlcstats + i;
|
||||
}
|
||||
|
||||
for (int UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
|
||||
for (int UE_id=UE_info->list.head; UE_id>=0; UE_id=UE_info->list.next[UE_id]) {
|
||||
#define NB_eNB_INST 1
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt,eNB_id, ENB_FLAG_YES,UE_list->eNB_UE_stats[0][UE_id].crnti,
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt,eNB_id, ENB_FLAG_YES,UE_info->eNB_UE_stats[0][UE_id].crnti,
|
||||
eNB->frame,eNB->subframe,eNB_id);
|
||||
measurcmd_display_one_rlcstat(prnt, UE_id, statsptr, num_rlcmeasure, rlcstats, "DCCH", &ctxt, SRB_FLAG_YES, DCCH);
|
||||
measurcmd_display_one_rlcstat(prnt, UE_id, statsptr, num_rlcmeasure, rlcstats, "DTCH", &ctxt, SRB_FLAG_NO, DTCH-2);
|
||||
|
||||
@@ -62,9 +62,7 @@
|
||||
#include "PHY/phy_extern.h"
|
||||
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface.h"
|
||||
#include "common/utils/LOG/log_extern.h"
|
||||
@@ -161,7 +159,7 @@ static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_t
|
||||
oai_subframe_ind(frame_rx, slot_rx);
|
||||
stop_meas(&nfapi_meas);
|
||||
|
||||
if (gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus||
|
||||
/*if (gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus||
|
||||
gNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs ||
|
||||
gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs ||
|
||||
gNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles ||
|
||||
@@ -175,7 +173,7 @@ static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_t
|
||||
gNB->UL_INFO.cqi_ind.number_of_cqis,
|
||||
frame_rx, slot_rx,
|
||||
frame_tx, slot_tx);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
// ****************************************
|
||||
|
||||
@@ -963,9 +961,9 @@ void init_gNB(int single_thread_flag,int wait_for_sync) {
|
||||
gNB->if_inst->NR_PHY_config_req = nr_phy_config_request;
|
||||
memset((void *)&gNB->UL_INFO,0,sizeof(gNB->UL_INFO));
|
||||
LOG_I(PHY,"Setting indication lists\n");
|
||||
/*gNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list = gNB->rx_pdu_list;
|
||||
gNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list = gNB->crc_pdu_list;
|
||||
gNB->UL_INFO.sr_ind.sr_indication_body.sr_pdu_list = gNB->sr_pdu_list;
|
||||
gNB->UL_INFO.rx_ind.pdu_list = gNB->rx_pdu_list;
|
||||
gNB->UL_INFO.crc_ind.crc_list = gNB->crc_pdu_list;
|
||||
/*gNB->UL_INFO.sr_ind.sr_indication_body.sr_pdu_list = gNB->sr_pdu_list;
|
||||
gNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list = gNB->harq_pdu_list;
|
||||
gNB->UL_INFO.cqi_ind.cqi_pdu_list = gNB->cqi_pdu_list;
|
||||
gNB->UL_INFO.cqi_ind.cqi_raw_pdu_list = gNB->cqi_raw_pdu_list;*/
|
||||
|
||||
+18
-2
@@ -72,9 +72,7 @@
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "SCHED_NR/sched_nr.h"
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface.h"
|
||||
|
||||
@@ -2298,6 +2296,24 @@ void RCconfig_RU(void)
|
||||
RC.ru[j]->openair0_cfg.clock_source = unset;
|
||||
}
|
||||
|
||||
if (config_isparamset(RUParamList.paramarray[j], RU_SDR_TME_SRC)) {
|
||||
if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "internal") == 0) {
|
||||
RC.ru[j]->openair0_cfg.time_source = internal;
|
||||
LOG_D(PHY, "RU time source set as internal\n");
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "external") == 0) {
|
||||
RC.ru[j]->openair0_cfg.time_source = external;
|
||||
LOG_D(PHY, "RU time source set as external\n");
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "gpsdo") == 0) {
|
||||
RC.ru[j]->openair0_cfg.time_source = gpsdo;
|
||||
LOG_D(PHY, "RU time source set as gpsdo\n");
|
||||
} else {
|
||||
LOG_E(PHY, "Erroneous RU time source in the provided configuration file: '%s'\n", *(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr));
|
||||
}
|
||||
}
|
||||
else {
|
||||
RC.ru[j]->openair0_cfg.time_source = unset;
|
||||
}
|
||||
|
||||
if (strcmp(*(RUParamList.paramarray[j][RU_LOCAL_RF_IDX].strptr), "yes") == 0) {
|
||||
if ( !(config_isparamset(RUParamList.paramarray[j],RU_LOCAL_IF_NAME_IDX)) ) {
|
||||
RC.ru[j]->if_south = LOCAL_RF;
|
||||
|
||||
@@ -49,8 +49,6 @@
|
||||
#include "PHY/phy_vars.h"
|
||||
#include "SCHED/sched_common_vars.h"
|
||||
#include "LAYER2/MAC/mac_vars.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "RRC/LTE/rrc_vars.h"
|
||||
#include "PHY_INTERFACE/phy_interface_vars.h"
|
||||
#include "gnb_config.h"
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
#include "PHY/NR_REFSIG/nr_mod_table.h"
|
||||
|
||||
#include "LAYER2/MAC/mac_vars.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "RRC/LTE/rrc_vars.h"
|
||||
#include "PHY_INTERFACE/phy_interface_vars.h"
|
||||
#include "openair1/SIMULATION/TOOLS/sim.h"
|
||||
@@ -127,7 +126,6 @@ volatile int start_eNB = 0;
|
||||
volatile int start_UE = 0;
|
||||
volatile int oai_exit = 0;
|
||||
|
||||
static clock_source_t clock_source = unset;
|
||||
int single_thread_flag=1;
|
||||
static double snr_dB=20;
|
||||
|
||||
@@ -597,7 +595,8 @@ void init_openair0(void) {
|
||||
PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx);
|
||||
openair0_cfg[card].Mod_id = 0;
|
||||
openair0_cfg[card].num_rb_dl=frame_parms[0]->N_RB_DL;
|
||||
openair0_cfg[card].clock_source = clock_source;
|
||||
openair0_cfg[card].clock_source = get_softmodem_params()->clock_source;
|
||||
openair0_cfg[card].time_source = get_softmodem_params()->timing_source;
|
||||
openair0_cfg[card].tx_num_channels=min(2,PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_tx);
|
||||
openair0_cfg[card].rx_num_channels=min(2,PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx);
|
||||
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define CMDLINE_PARAMS_DESC_UE { \
|
||||
{"clock-source", CONFIG_HLP_EXCCLK, 0, iptr:&clock_source, defintval:0, TYPE_INT, 0}, \
|
||||
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
|
||||
{"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
|
||||
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
|
||||
|
||||
@@ -53,6 +53,7 @@ extern "C"
|
||||
#define CONFIG_HLP_EXTS "tells hardware to use an external timing reference\n"
|
||||
#define CONFIG_HLP_DMRSSYNC "tells RU to insert DMRS in subframe 1 slot 0"
|
||||
#define CONFIG_HLP_CLK "tells hardware to use a clock reference (0:internal, 1:external, 2:gpsdo)\n"
|
||||
#define CONFIG_HLP_TME "tells hardware to use a time reference (0:internal, 1:external, 2:gpsdo)\n"
|
||||
#define CONFIG_HLP_USIM "use XOR autentication algo in case of test usim mode\n"
|
||||
#define CONFIG_HLP_NOSNGLT "Disables single-thread mode in lte-softmodem\n"
|
||||
#define CONFIG_HLP_DLF "Set the downlink frequency for all component carriers\n"
|
||||
@@ -105,7 +106,8 @@ extern "C"
|
||||
{"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&RF_CONFIG_FILE, defstrval:NULL, TYPE_STRING, sizeof(RF_CONFIG_FILE)},\
|
||||
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&PHY_TEST, defintval:0, TYPE_INT, 0}, \
|
||||
{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&USIM_TEST, defintval:0, TYPE_UINT8, 0}, \
|
||||
{"clock", CONFIG_HLP_CLK, 0, uptr:&CLOCK_SOURCE, defintval:0, TYPE_UINT, 0}, \
|
||||
{"clock-source", CONFIG_HLP_CLK, 0, uptr:&CLOCK_SOURCE, defintval:0, TYPE_UINT, 0}, \
|
||||
{"time-source", CONFIG_HLP_TME, 0, uptr:&TIMING_SOURCE, defintval:0, TYPE_UINT, 0}, \
|
||||
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&WAIT_FOR_SYNC, defintval:0, TYPE_INT, 0}, \
|
||||
{"single-thread-enable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&SINGLE_THREAD_FLAG, defintval:0, TYPE_INT, 0}, \
|
||||
{"C" , CONFIG_HLP_DLF, 0, u64ptr:&(downlink_frequency[0][0]), defuintval:0, TYPE_UINT64, 0}, \
|
||||
|
||||
@@ -49,7 +49,6 @@ extern RAN_CONTEXT_t RC;
|
||||
#include "fapi_stub.h"
|
||||
//#include "fapi_l1.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "openair2/LAYER2/MAC/mac_proto.h"
|
||||
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
|
||||
@@ -1394,7 +1394,7 @@ typedef struct
|
||||
uint16_t timing_advance;//Timing advance 𝑇𝐴 measured for the UE [TS 38.213, Section 4.2] NTA_new = NTA_old + (TA − 31) ⋅ 16 ⋅ 64⁄2μ Value: 0 → 63 0xffff should be set if this field is invalid
|
||||
uint16_t rssi;
|
||||
//variable ! fixme
|
||||
uint32_t pdu; //MAC PDU
|
||||
uint8_t *pdu; //MAC PDU
|
||||
|
||||
} nfapi_nr_rx_data_pdu_t;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ int phy_init_RU(RU_t *ru) {
|
||||
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
|
||||
RU_CALIBRATION *calibration = &ru->calibration;
|
||||
int i,j,p,re;
|
||||
init_dfts();
|
||||
//load_dftslib();
|
||||
LOG_I(PHY,"Initializing RU signal buffers (if_south %s) nb_tx %d\n",ru_if_types[ru->if_south],ru->nb_tx);
|
||||
|
||||
if (ru->is_slave == 1) {
|
||||
@@ -76,7 +76,7 @@ int phy_init_RU(RU_t *ru) {
|
||||
}
|
||||
|
||||
if (ru->function != NGFI_RRU_IF5) { // we need to do RX/TX RU processing
|
||||
init_dfts();
|
||||
load_dftslib();
|
||||
init_7_5KHz();
|
||||
LOG_I(PHY,"nb_tx %d\n",ru->nb_tx);
|
||||
ru->common.rxdata_7_5kHz = (int32_t **)malloc16(ru->nb_rx*sizeof(int32_t *) );
|
||||
|
||||
@@ -625,7 +625,7 @@ int init_lte_ue_signal(PHY_VARS_UE *ue,
|
||||
int th_id;
|
||||
LOG_D(PHY,"Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,fp->nb_antennas_tx,fp->nb_antennas_rx);
|
||||
crcTableInit();
|
||||
init_dfts();
|
||||
load_dftslib();
|
||||
init_frame_parms(&ue->frame_parms,1);
|
||||
lte_sync_time_init(&ue->frame_parms);
|
||||
init_lte_top(&ue->frame_parms);
|
||||
|
||||
@@ -96,6 +96,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
|
||||
while(gNB->configured == 0) usleep(10000);
|
||||
|
||||
load_dftslib();
|
||||
/*
|
||||
LOG_I(PHY,"[gNB %"PRIu8"] Initializing DL_FRAME_PARMS : N_RB_DL %"PRIu8", PHICH Resource %d, PHICH Duration %d nb_antennas_tx:%u nb_antennas_rx:%u PRACH[rootSequenceIndex:%u prach_Config_enabled:%u configIndex:%u highSpeed:%u zeroCorrelationZoneConfig:%u freqOffset:%u]\n",
|
||||
gNB->Mod_id,
|
||||
@@ -111,7 +112,6 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
);*/
|
||||
LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_gNB][MOD %02"PRIu8"][]\n", gNB->Mod_id);
|
||||
crcTableInit();
|
||||
init_dfts();
|
||||
init_scrambling_luts();
|
||||
init_pucch2_luts();
|
||||
load_nrLDPClib();
|
||||
|
||||
@@ -988,7 +988,7 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue,
|
||||
void phy_init_nr_top(PHY_VARS_NR_UE *ue) {
|
||||
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
crcTableInit();
|
||||
init_dfts();
|
||||
load_dftslib();
|
||||
init_context_synchro_nr(frame_parms);
|
||||
generate_ul_reference_signal_sequences(SHRT_MAX);
|
||||
// Polar encoder init for PBCH
|
||||
|
||||
@@ -56,22 +56,22 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
// do ifft of channel estimate
|
||||
switch(frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
dft128((int16_t*) <e_eNB_srs->srs_ch_estimates[aa][0],
|
||||
dft(DFT_128,(int16_t*) <e_eNB_srs->srs_ch_estimates[aa][0],
|
||||
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
|
||||
1);
|
||||
break;
|
||||
case 25:
|
||||
dft512((int16_t*) <e_eNB_srs->srs_ch_estimates[aa][0],
|
||||
dft(DFT_512,(int16_t*) <e_eNB_srs->srs_ch_estimates[aa][0],
|
||||
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
|
||||
1);
|
||||
break;
|
||||
case 50:
|
||||
dft1024((int16_t*) <e_eNB_srs->srs_ch_estimates[aa][0],
|
||||
dft(DFT_1024,(int16_t*) <e_eNB_srs->srs_ch_estimates[aa][0],
|
||||
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
|
||||
1);
|
||||
break;
|
||||
case 100:
|
||||
dft2048((int16_t*) <e_eNB_srs->srs_ch_estimates[aa][0],
|
||||
dft(DFT_2048,(int16_t*) <e_eNB_srs->srs_ch_estimates[aa][0],
|
||||
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
|
||||
1);
|
||||
break;
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "PHY/defs_UE.h"
|
||||
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
|
||||
#include "PHY/impl_defs_top.h"
|
||||
#include "openair2/LAYER2/MAC/mac_proto.h"
|
||||
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
|
||||
@@ -657,35 +657,35 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
}
|
||||
}
|
||||
|
||||
void (*idft)(int16_t *,int16_t *, int);
|
||||
idft_size_idx_t idftsizeidx;
|
||||
|
||||
switch (ue->frame_parms.ofdm_symbol_size) {
|
||||
case 128:
|
||||
idft = idft128;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
idft = idft256;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
idft = idft512;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
idft = idft1024;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
idft = idft1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
idft = idft2048;
|
||||
break;
|
||||
|
||||
default:
|
||||
idft = idft512;
|
||||
idftsizeidx = IDFT_128;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
idftsizeidx = IDFT_256;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
idftsizeidx = IDFT_512;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
idftsizeidx = IDFT_1024;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
idftsizeidx = IDFT_1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
idftsizeidx = IDFT_2048;
|
||||
break;
|
||||
|
||||
default:
|
||||
idftsizeidx = IDFT_512;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -695,7 +695,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
for (p=0; p<ue->frame_parms.nb_antenna_ports_eNB; p++) {
|
||||
if (ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx]) {
|
||||
//LOG_I(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d \n", Ns, ue->current_thread_id[Ns>>1], l);
|
||||
idft((int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx][8],
|
||||
idft(idftsizeidx,(int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx][8],
|
||||
(int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -724,31 +724,31 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *ue,
|
||||
if (ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa]) {
|
||||
switch (ue->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
idft128((int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8],
|
||||
idft(IDFT_128,(int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 25:
|
||||
idft512((int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8],
|
||||
idft(IDFT_512,(int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 50:
|
||||
idft1024((int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8],
|
||||
idft(IDFT_1024,(int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 75:
|
||||
idft1536((int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8],
|
||||
idft(IDFT_1536,(int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 100:
|
||||
idft2048((int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8],
|
||||
idft(IDFT_2048,(int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa],
|
||||
1);
|
||||
break;
|
||||
|
||||
@@ -141,28 +141,28 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
|
||||
|
||||
switch (frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
idft128((short*)syncF_tmp, /// complex input
|
||||
idft(IDFT_128,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 25:
|
||||
idft512((short*)syncF_tmp, /// complex input
|
||||
idft(IDFT_512,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 50:
|
||||
idft1024((short*)syncF_tmp, /// complex input
|
||||
idft(IDFT_1024,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
|
||||
case 75:
|
||||
idft1536((short*)syncF_tmp, /// complex input
|
||||
idft(IDFT_1536,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp,
|
||||
1); /// complex output
|
||||
break;
|
||||
case 100:
|
||||
idft2048((short*)syncF_tmp, /// complex input
|
||||
idft(IDFT_2048,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
@@ -189,28 +189,28 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
|
||||
|
||||
switch (frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
idft128((short*)syncF_tmp, /// complex input
|
||||
idft(IDFT_128,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 25:
|
||||
idft512((short*)syncF_tmp, /// complex input
|
||||
idft(IDFT_512,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 50:
|
||||
idft1024((short*)syncF_tmp, /// complex input
|
||||
idft(IDFT_1024,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
|
||||
case 75:
|
||||
idft1536((short*)syncF_tmp, /// complex input
|
||||
idft(IDFT_1536,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 100:
|
||||
idft2048((short*)syncF_tmp, /// complex input
|
||||
idft(IDFT_2048,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
@@ -237,28 +237,28 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
|
||||
|
||||
switch (frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
idft128((short*)syncF_tmp, /// complex input
|
||||
idft(IDFT_128,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 25:
|
||||
idft512((short*)syncF_tmp, /// complex input
|
||||
idft(IDFT_512,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 50:
|
||||
idft1024((short*)syncF_tmp, /// complex input
|
||||
idft(IDFT_1024,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
|
||||
case 75:
|
||||
idft1536((short*)syncF_tmp, /// complex input
|
||||
idft(IDFT_1536,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 100:
|
||||
idft2048((short*)syncF_tmp, /// complex input
|
||||
idft(IDFT_2048,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
@@ -492,28 +492,28 @@ int ru_sync_time_init(RU_t *ru) // LTE_UE_COMMON *common_vars
|
||||
|
||||
switch (ru->frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
idft128((int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
idft(IDFT_128,(int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
ru->dmrssync, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 25:
|
||||
idft512((int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
idft(IDFT_512,(int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
ru->dmrssync, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 50:
|
||||
idft1024((int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
idft(IDFT_1024,(int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
ru->dmrssync, /// complex output
|
||||
1);
|
||||
break;
|
||||
|
||||
case 75:
|
||||
idft1536((int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
idft(IDFT_1536,(int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
ru->dmrssync,
|
||||
1); /// complex output
|
||||
break;
|
||||
case 100:
|
||||
idft2048((int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
idft(IDFT_2048,(int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
ru->dmrssync, /// complex output
|
||||
1);
|
||||
break;
|
||||
|
||||
@@ -80,7 +80,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
|
||||
while (1) {
|
||||
|
||||
//compute frequency-domain representation of 6144-sample chunk
|
||||
dft6144((int16_t *)rxp,
|
||||
dft(DFT_6144,(int16_t *)rxp,
|
||||
sp,1);
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
|
||||
}
|
||||
|
||||
// ifft, accumulate energy over two half-frames
|
||||
idft256((int16_t*)autocorr0,(int16_t*)tmp_t,1);
|
||||
idft(IDFT_256,(int16_t*)autocorr0,(int16_t*)tmp_t,1);
|
||||
/*
|
||||
if (i==12288) {
|
||||
sprintf(fname,"corr256F_%d.m",abs(f));
|
||||
@@ -285,12 +285,12 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
|
||||
for (re=0; re<(256/4); re++)
|
||||
autocorr0_t[re] = _mm_add_epi32(autocorr0_t[re],_mm_madd_epi16(tmp_t[re],tmp_t[re]));
|
||||
|
||||
idft256((int16_t*)autocorr1,(int16_t*)tmp_t,1);
|
||||
idft(IDFT_256,(int16_t*)autocorr1,(int16_t*)tmp_t,1);
|
||||
|
||||
for (re=0; re<(256/4); re++)
|
||||
autocorr1_t[re] = _mm_add_epi32(autocorr1_t[re],_mm_madd_epi16(tmp_t[re],tmp_t[re]));
|
||||
|
||||
idft256((int16_t*)autocorr2,(int16_t*)tmp_t,1);
|
||||
idft(IDFT_256,(int16_t*)autocorr2,(int16_t*)tmp_t,1);
|
||||
|
||||
for (re=0; re<(256/4); re++)
|
||||
autocorr2_t[re] = _mm_add_epi32(autocorr2_t[re],_mm_madd_epi16(tmp_t[re],tmp_t[re]));
|
||||
|
||||
@@ -246,25 +246,25 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
|
||||
|
||||
switch(frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
idft128((int16_t *) temp_in_ifft_0,
|
||||
idft(IDFT_128,(int16_t *) temp_in_ifft_0,
|
||||
(int16_t *) ul_ch_estimates_time[aa],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 25:
|
||||
idft512((int16_t *) temp_in_ifft_0,
|
||||
idft(IDFT_512,(int16_t *) temp_in_ifft_0,
|
||||
(int16_t *) ul_ch_estimates_time[aa],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 50:
|
||||
idft1024((int16_t *) temp_in_ifft_0,
|
||||
idft(IDFT_1024,(int16_t *) temp_in_ifft_0,
|
||||
(int16_t *) ul_ch_estimates_time[aa],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 100:
|
||||
idft2048((int16_t *) temp_in_ifft_0,
|
||||
idft(IDFT_2048,(int16_t *) temp_in_ifft_0,
|
||||
(int16_t *) ul_ch_estimates_time[aa],
|
||||
1);
|
||||
break;
|
||||
@@ -575,25 +575,25 @@ int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
switch(frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
idft128((int16_t *) temp_in_ifft_0,
|
||||
idft(IDFT_128,(int16_t *) temp_in_ifft_0,
|
||||
(int16_t *) ul_ch_estimates_time[aa],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 25:
|
||||
idft512((int16_t *) temp_in_ifft_0,
|
||||
idft(IDFT_512,(int16_t *) temp_in_ifft_0,
|
||||
(int16_t *) ul_ch_estimates_time[aa],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 50:
|
||||
idft1024((int16_t *) temp_in_ifft_0,
|
||||
idft(IDFT_1024,(int16_t *) temp_in_ifft_0,
|
||||
(int16_t *) ul_ch_estimates_time[aa],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 100:
|
||||
idft2048((int16_t *) temp_in_ifft_0,
|
||||
idft(IDFT_2048,(int16_t *) temp_in_ifft_0,
|
||||
(int16_t *) ul_ch_estimates_time[aa],
|
||||
1);
|
||||
break;
|
||||
|
||||
@@ -94,6 +94,35 @@ unsigned char I_TBS2I_MCS(unsigned char I_TBS) {
|
||||
return I_MCS;
|
||||
}
|
||||
|
||||
uint16_t find_nb_rb_DL(uint8_t mcs, uint32_t bytes, uint16_t nb_rb_max, uint16_t rb_gran) {
|
||||
if (bytes == 0 || mcs > 28 || nb_rb_max == 0)
|
||||
return 0;
|
||||
const uint32_t bits = bytes << 3;
|
||||
const unsigned char I_TBS = get_I_TBS(mcs);
|
||||
|
||||
uint32_t TBS = TBStable[I_TBS][nb_rb_max - 1];
|
||||
if (bits >= TBS) // is nb_rb_max too small?
|
||||
return nb_rb_max;
|
||||
|
||||
TBS = TBStable[I_TBS][rb_gran - 1];
|
||||
if (bits <= TBS) // is rb_gran RB enough?
|
||||
return rb_gran;
|
||||
|
||||
nb_rb_max += nb_rb_max % rb_gran; // round up to full RBG
|
||||
uint16_t hi = nb_rb_max/rb_gran - 1;
|
||||
uint16_t lo = 0;
|
||||
uint16_t p = (hi + lo) / 2;
|
||||
for (; lo + 1 != hi; p = (hi + lo) / 2) {
|
||||
const uint16_t rbi = (p + 1) * rb_gran - 1; // convert "RBG" -> RB
|
||||
TBS = TBStable[I_TBS][rbi];
|
||||
if (bits <= TBS) // need less RBs
|
||||
hi = p;
|
||||
else // need more RBs
|
||||
lo = p;
|
||||
}
|
||||
return (hi + 1) * rb_gran;
|
||||
}
|
||||
|
||||
uint32_t get_TBS_DL(uint8_t mcs, uint16_t nb_rb) {
|
||||
uint32_t TBS;
|
||||
|
||||
|
||||
@@ -298,24 +298,24 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
switch (fp->N_RB_UL) {
|
||||
case 6:
|
||||
if (prach_fmt == 4) {
|
||||
dft256(prach2,rxsigF[aa],1);
|
||||
dft(DFT_256,prach2,rxsigF[aa],1);
|
||||
} else {
|
||||
dft1536(prach2,rxsigF[aa],1);
|
||||
dft(DFT_1536,prach2,rxsigF[aa],1);
|
||||
|
||||
if (prach_fmt>1)
|
||||
dft1536(prach2+3072,rxsigF[aa]+3072,1);
|
||||
dft(DFT_1536,prach2+3072,rxsigF[aa]+3072,1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 15:
|
||||
if (prach_fmt == 4) {
|
||||
dft256(prach2,rxsigF[aa],1);
|
||||
dft(DFT_256,prach2,rxsigF[aa],1);
|
||||
} else {
|
||||
dft3072(prach2,rxsigF[aa],1);
|
||||
dft(DFT_3072,prach2,rxsigF[aa],1);
|
||||
|
||||
if (prach_fmt>1)
|
||||
dft3072(prach2+6144,rxsigF[aa]+6144,1);
|
||||
dft(DFT_3072,prach2+6144,rxsigF[aa]+6144,1);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -323,13 +323,13 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
case 25:
|
||||
default:
|
||||
if (prach_fmt == 4) {
|
||||
dft1024(prach2,rxsigF[aa],1);
|
||||
dft(DFT_1024,prach2,rxsigF[aa],1);
|
||||
fft_size = 1024;
|
||||
} else {
|
||||
dft6144(prach2,rxsigF[aa],1);
|
||||
dft(DFT_6144,prach2,rxsigF[aa],1);
|
||||
|
||||
if (prach_fmt>1)
|
||||
dft6144(prach2+12288,rxsigF[aa]+12288,1);
|
||||
dft(DFT_6144,prach2+12288,rxsigF[aa]+12288,1);
|
||||
|
||||
fft_size = 6144;
|
||||
}
|
||||
@@ -338,24 +338,24 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
|
||||
case 50:
|
||||
if (prach_fmt == 4) {
|
||||
dft2048(prach2,rxsigF[aa],1);
|
||||
dft(DFT_2048,prach2,rxsigF[aa],1);
|
||||
} else {
|
||||
dft12288(prach2,rxsigF[aa],1);
|
||||
dft(DFT_12288,prach2,rxsigF[aa],1);
|
||||
|
||||
if (prach_fmt>1)
|
||||
dft12288(prach2+24576,rxsigF[aa]+24576,1);
|
||||
dft(DFT_12288,prach2+24576,rxsigF[aa]+24576,1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 75:
|
||||
if (prach_fmt == 4) {
|
||||
dft3072(prach2,rxsigF[aa],1);
|
||||
dft(DFT_3072,prach2,rxsigF[aa],1);
|
||||
} else {
|
||||
dft18432(prach2,rxsigF[aa],1);
|
||||
dft(DFT_18432,prach2,rxsigF[aa],1);
|
||||
|
||||
if (prach_fmt>1)
|
||||
dft18432(prach2+36864,rxsigF[aa]+36864,1);
|
||||
dft(DFT_18432,prach2+36864,rxsigF[aa]+36864,1);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -363,21 +363,21 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
case 100:
|
||||
if (fp->threequarter_fs==0) {
|
||||
if (prach_fmt == 4) {
|
||||
dft4096(prach2,rxsigF[aa],1);
|
||||
dft(DFT_4096,prach2,rxsigF[aa],1);
|
||||
} else {
|
||||
dft24576(prach2,rxsigF[aa],1);
|
||||
dft(DFT_24576,prach2,rxsigF[aa],1);
|
||||
|
||||
if (prach_fmt>1)
|
||||
dft24576(prach2+49152,rxsigF[aa]+49152,1);
|
||||
dft(DFT_24576,prach2+49152,rxsigF[aa]+49152,1);
|
||||
}
|
||||
} else {
|
||||
if (prach_fmt == 4) {
|
||||
dft3072(prach2,rxsigF[aa],1);
|
||||
dft(DFT_3072,prach2,rxsigF[aa],1);
|
||||
} else {
|
||||
dft18432(prach2,rxsigF[aa],1);
|
||||
dft(DFT_18432,prach2,rxsigF[aa],1);
|
||||
|
||||
if (prach_fmt>1)
|
||||
dft18432(prach2+36864,rxsigF[aa]+36864,1);
|
||||
dft(DFT_18432,prach2+36864,rxsigF[aa]+36864,1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -589,13 +589,13 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
// Now do IFFT of size 1024 (N_ZC=839) or 256 (N_ZC=139)
|
||||
if (N_ZC == 839) {
|
||||
log2_ifft_size = 10;
|
||||
idft1024(prachF,prach_ifft_tmp,1);
|
||||
idft(IDFT_1024,prachF,prach_ifft_tmp,1);
|
||||
|
||||
// compute energy and accumulate over receive antennas and repetitions for BR
|
||||
for (i=0; i<2048; i++)
|
||||
prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[i<<1] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>9;
|
||||
} else {
|
||||
idft256(prachF,prach_ifft_tmp,1);
|
||||
idft(IDFT_256,prachF,prach_ifft_tmp,1);
|
||||
log2_ifft_size = 8;
|
||||
|
||||
// compute energy and accumulate over receive antennas and repetitions for BR
|
||||
|
||||
@@ -60,6 +60,8 @@ unsigned char get_I_TBS_UL(unsigned char I_MCS);
|
||||
@return Transport block size */
|
||||
uint32_t get_TBS_DL(uint8_t mcs, uint16_t nb_rb);
|
||||
|
||||
uint16_t find_nb_rb_DL(uint8_t mcs, uint32_t bytes, uint16_t nb_rb_max, uint16_t rb_gran);
|
||||
|
||||
/** \brief Compute Q (modulation order) based on uplink I_MCS. Implements table 7.1.7.1-1 from 36.213.
|
||||
@param I_MCS
|
||||
@param nb_rb
|
||||
|
||||
@@ -154,9 +154,9 @@ void lte_idft(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *z, uint16_t Msc_PUSCH) {
|
||||
|
||||
switch (Msc_PUSCH) {
|
||||
case 12:
|
||||
dft12((int16_t *)idft_in0,(int16_t *)idft_out0);
|
||||
dft12((int16_t *)idft_in1,(int16_t *)idft_out1);
|
||||
dft12((int16_t *)idft_in2,(int16_t *)idft_out2);
|
||||
dft(DFT_12,(int16_t *)idft_in0,(int16_t *)idft_out0,0);
|
||||
dft(DFT_12,(int16_t *)idft_in1,(int16_t *)idft_out1,0);
|
||||
dft(DFT_12,(int16_t *)idft_in2,(int16_t *)idft_out2,0);
|
||||
#if defined(__x86_64__)||defined(__i386__)
|
||||
norm128 = _mm_set1_epi16(9459);
|
||||
#elif defined(__arm__)
|
||||
@@ -178,201 +178,201 @@ void lte_idft(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *z, uint16_t Msc_PUSCH) {
|
||||
break;
|
||||
|
||||
case 24:
|
||||
dft24(idft_in0,idft_out0,1);
|
||||
dft24(idft_in1,idft_out1,1);
|
||||
dft24(idft_in2,idft_out2,1);
|
||||
dft(DFT_24,idft_in0,idft_out0,1);
|
||||
dft(DFT_24,idft_in1,idft_out1,1);
|
||||
dft(DFT_24,idft_in2,idft_out2,1);
|
||||
break;
|
||||
|
||||
case 36:
|
||||
dft36(idft_in0,idft_out0,1);
|
||||
dft36(idft_in1,idft_out1,1);
|
||||
dft36(idft_in2,idft_out2,1);
|
||||
dft(DFT_36,idft_in0,idft_out0,1);
|
||||
dft(DFT_36,idft_in1,idft_out1,1);
|
||||
dft(DFT_36,idft_in2,idft_out2,1);
|
||||
break;
|
||||
|
||||
case 48:
|
||||
dft48(idft_in0,idft_out0,1);
|
||||
dft48(idft_in1,idft_out1,1);
|
||||
dft48(idft_in2,idft_out2,1);
|
||||
dft(DFT_48,idft_in0,idft_out0,1);
|
||||
dft(DFT_48,idft_in1,idft_out1,1);
|
||||
dft(DFT_48,idft_in2,idft_out2,1);
|
||||
break;
|
||||
|
||||
case 60:
|
||||
dft60(idft_in0,idft_out0,1);
|
||||
dft60(idft_in1,idft_out1,1);
|
||||
dft60(idft_in2,idft_out2,1);
|
||||
dft(DFT_60,idft_in0,idft_out0,1);
|
||||
dft(DFT_60,idft_in1,idft_out1,1);
|
||||
dft(DFT_60,idft_in2,idft_out2,1);
|
||||
break;
|
||||
|
||||
case 72:
|
||||
dft72(idft_in0,idft_out0,1);
|
||||
dft72(idft_in1,idft_out1,1);
|
||||
dft72(idft_in2,idft_out2,1);
|
||||
dft(DFT_72,idft_in0,idft_out0,1);
|
||||
dft(DFT_72,idft_in1,idft_out1,1);
|
||||
dft(DFT_72,idft_in2,idft_out2,1);
|
||||
break;
|
||||
|
||||
case 96:
|
||||
dft96(idft_in0,idft_out0,1);
|
||||
dft96(idft_in1,idft_out1,1);
|
||||
dft96(idft_in2,idft_out2,1);
|
||||
dft(DFT_96,idft_in0,idft_out0,1);
|
||||
dft(DFT_96,idft_in1,idft_out1,1);
|
||||
dft(DFT_96,idft_in2,idft_out2,1);
|
||||
break;
|
||||
|
||||
case 108:
|
||||
dft108(idft_in0,idft_out0,1);
|
||||
dft108(idft_in1,idft_out1,1);
|
||||
dft108(idft_in2,idft_out2,1);
|
||||
dft(DFT_108,idft_in0,idft_out0,1);
|
||||
dft(DFT_108,idft_in1,idft_out1,1);
|
||||
dft(DFT_108,idft_in2,idft_out2,1);
|
||||
break;
|
||||
|
||||
case 120:
|
||||
dft120(idft_in0,idft_out0,1);
|
||||
dft120(idft_in1,idft_out1,1);
|
||||
dft120(idft_in2,idft_out2,1);
|
||||
dft(DFT_120,idft_in0,idft_out0,1);
|
||||
dft(DFT_120,idft_in1,idft_out1,1);
|
||||
dft(DFT_120,idft_in2,idft_out2,1);
|
||||
break;
|
||||
|
||||
case 144:
|
||||
dft144(idft_in0,idft_out0,1);
|
||||
dft144(idft_in1,idft_out1,1);
|
||||
dft144(idft_in2,idft_out2,1);
|
||||
dft(DFT_144,idft_in0,idft_out0,1);
|
||||
dft(DFT_144,idft_in1,idft_out1,1);
|
||||
dft(DFT_144,idft_in2,idft_out2,1);
|
||||
break;
|
||||
|
||||
case 180:
|
||||
dft180(idft_in0,idft_out0,1);
|
||||
dft180(idft_in1,idft_out1,1);
|
||||
dft180(idft_in2,idft_out2,1);
|
||||
dft(DFT_180,idft_in0,idft_out0,1);
|
||||
dft(DFT_180,idft_in1,idft_out1,1);
|
||||
dft(DFT_180,idft_in2,idft_out2,1);
|
||||
break;
|
||||
|
||||
case 192:
|
||||
dft192(idft_in0,idft_out0,1);
|
||||
dft192(idft_in1,idft_out1,1);
|
||||
dft192(idft_in2,idft_out2,1);
|
||||
dft(DFT_192,idft_in0,idft_out0,1);
|
||||
dft(DFT_192,idft_in1,idft_out1,1);
|
||||
dft(DFT_192,idft_in2,idft_out2,1);
|
||||
break;
|
||||
|
||||
case 216:
|
||||
dft216(idft_in0,idft_out0,1);
|
||||
dft216(idft_in1,idft_out1,1);
|
||||
dft216(idft_in2,idft_out2,1);
|
||||
dft(DFT_216,idft_in0,idft_out0,1);
|
||||
dft(DFT_216,idft_in1,idft_out1,1);
|
||||
dft(DFT_216,idft_in2,idft_out2,1);
|
||||
break;
|
||||
|
||||
case 240:
|
||||
dft240(idft_in0,idft_out0,1);
|
||||
dft240(idft_in1,idft_out1,1);
|
||||
dft240(idft_in2,idft_out2,1);
|
||||
dft(DFT_240,idft_in0,idft_out0,1);
|
||||
dft(DFT_240,idft_in1,idft_out1,1);
|
||||
dft(DFT_240,idft_in2,idft_out2,1);
|
||||
break;
|
||||
|
||||
case 288:
|
||||
dft288(idft_in0,idft_out0,1);
|
||||
dft288(idft_in1,idft_out1,1);
|
||||
dft288(idft_in2,idft_out2,1);
|
||||
dft(DFT_288,idft_in0,idft_out0,1);
|
||||
dft(DFT_288,idft_in1,idft_out1,1);
|
||||
dft(DFT_288,idft_in2,idft_out2,1);
|
||||
break;
|
||||
|
||||
case 300:
|
||||
dft300(idft_in0,idft_out0,1);
|
||||
dft300(idft_in1,idft_out1,1);
|
||||
dft300(idft_in2,idft_out2,1);
|
||||
dft(DFT_300,idft_in0,idft_out0,1);
|
||||
dft(DFT_300,idft_in1,idft_out1,1);
|
||||
dft(DFT_300,idft_in2,idft_out2,1);
|
||||
break;
|
||||
|
||||
case 324:
|
||||
dft324((int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft324((int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft324((int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
dft(DFT_324,(int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft(DFT_324,(int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft(DFT_324,(int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
break;
|
||||
|
||||
case 360:
|
||||
dft360((int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft360((int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft360((int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
dft(DFT_360,(int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft(DFT_360,(int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft(DFT_360,(int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
break;
|
||||
|
||||
case 384:
|
||||
dft384((int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft384((int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft384((int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
dft(DFT_384,(int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft(DFT_384,(int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft(DFT_384,(int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
break;
|
||||
|
||||
case 432:
|
||||
dft432((int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft432((int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft432((int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
dft(DFT_432,(int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft(DFT_432,(int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft(DFT_432,(int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
break;
|
||||
|
||||
case 480:
|
||||
dft480((int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft480((int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft480((int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
dft(DFT_480,(int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft(DFT_480,(int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft(DFT_480,(int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
break;
|
||||
|
||||
case 540:
|
||||
dft540((int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft540((int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft540((int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
dft(DFT_540,(int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft(DFT_540,(int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft(DFT_540,(int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
break;
|
||||
|
||||
case 576:
|
||||
dft576((int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft576((int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft576((int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
dft(DFT_576,(int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft(DFT_576,(int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft(DFT_576,(int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
break;
|
||||
|
||||
case 600:
|
||||
dft600((int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft600((int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft600((int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
dft(DFT_600,(int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft(DFT_600,(int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft(DFT_600,(int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
break;
|
||||
|
||||
case 648:
|
||||
dft648((int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft648((int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft648((int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
dft(DFT_648,(int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft(DFT_648,(int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft(DFT_648,(int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
break;
|
||||
|
||||
case 720:
|
||||
dft720((int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft720((int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft720((int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
dft(DFT_720,(int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft(DFT_720,(int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft(DFT_720,(int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
break;
|
||||
|
||||
case 768:
|
||||
dft768((int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft768((int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft768((int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
dft(DFT_768,(int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft(DFT_768,(int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft(DFT_768,(int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
break;
|
||||
|
||||
case 864:
|
||||
dft864((int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft864((int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft864((int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
dft(DFT_864,(int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft(DFT_864,(int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft(DFT_864,(int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
break;
|
||||
|
||||
case 900:
|
||||
dft900((int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft900((int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft900((int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
dft(DFT_900,(int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft(DFT_900,(int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft(DFT_900,(int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
break;
|
||||
|
||||
case 960:
|
||||
dft960((int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft960((int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft960((int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
dft(DFT_960,(int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft(DFT_960,(int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft(DFT_960,(int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
break;
|
||||
|
||||
case 972:
|
||||
dft972((int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft972((int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft972((int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
dft(DFT_972,(int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft(DFT_972,(int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft(DFT_972,(int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
break;
|
||||
|
||||
case 1080:
|
||||
dft1080((int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft1080((int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft1080((int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
dft(DFT_1080,(int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft(DFT_1080,(int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft(DFT_1080,(int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
break;
|
||||
|
||||
case 1152:
|
||||
dft1152((int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft1152((int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft1152((int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
dft(DFT_1152,(int16_t *)idft_in0,(int16_t *)idft_out0,1);
|
||||
dft(DFT_1152,(int16_t *)idft_in1,(int16_t *)idft_out1,1);
|
||||
dft(DFT_1152,(int16_t *)idft_in2,(int16_t *)idft_out2,1);
|
||||
break;
|
||||
|
||||
case 1200:
|
||||
dft1200(idft_in0,idft_out0,1);
|
||||
dft1200(idft_in1,idft_out1,1);
|
||||
dft1200(idft_in2,idft_out2,1);
|
||||
dft(DFT_1200,idft_in0,idft_out0,1);
|
||||
dft(DFT_1200,idft_in1,idft_out1,1);
|
||||
dft(DFT_1200,idft_in2,idft_out2,1);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#include "PHY/MODULATION/modulation_UE.h"
|
||||
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
|
||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
#include "openair2/LAYER2/MAC/mac_proto.h"
|
||||
#include "common_lib.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
|
||||
|
||||
@@ -338,11 +338,11 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
||||
switch (ue->frame_parms.N_RB_UL) {
|
||||
case 6:
|
||||
if (prach_fmt == 4) {
|
||||
idft256(prachF,prach2,1);
|
||||
idft(IDFT_256,prachF,prach2,1);
|
||||
memmove( prach, prach+512, Ncp<<2 );
|
||||
prach_len = 256+Ncp;
|
||||
} else {
|
||||
idft1536(prachF,prach2,1);
|
||||
idft(IDFT_1536,prachF,prach2,1);
|
||||
memmove( prach, prach+3072, Ncp<<2 );
|
||||
prach_len = 1536+Ncp;
|
||||
|
||||
@@ -356,12 +356,12 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
||||
|
||||
case 15:
|
||||
if (prach_fmt == 4) {
|
||||
idft512(prachF,prach2,1);
|
||||
idft(IDFT_512,prachF,prach2,1);
|
||||
//TODO: account for repeated format in dft output
|
||||
memmove( prach, prach+1024, Ncp<<2 );
|
||||
prach_len = 512+Ncp;
|
||||
} else {
|
||||
idft3072(prachF,prach2,1);
|
||||
idft(IDFT_3072,prachF,prach2,1);
|
||||
memmove( prach, prach+6144, Ncp<<2 );
|
||||
prach_len = 3072+Ncp;
|
||||
|
||||
@@ -376,11 +376,11 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
||||
case 25:
|
||||
default:
|
||||
if (prach_fmt == 4) {
|
||||
idft1024(prachF,prach2,1);
|
||||
idft(IDFT_1024,prachF,prach2,1);
|
||||
memmove( prach, prach+2048, Ncp<<2 );
|
||||
prach_len = 1024+Ncp;
|
||||
} else {
|
||||
idft6144(prachF,prach2,1);
|
||||
idft(IDFT_6144,prachF,prach2,1);
|
||||
/*for (i=0;i<6144*2;i++)
|
||||
prach2[i]<<=1;*/
|
||||
memmove( prach, prach+12288, Ncp<<2 );
|
||||
@@ -396,11 +396,11 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
||||
|
||||
case 50:
|
||||
if (prach_fmt == 4) {
|
||||
idft2048(prachF,prach2,1);
|
||||
idft(IDFT_2048,prachF,prach2,1);
|
||||
memmove( prach, prach+4096, Ncp<<2 );
|
||||
prach_len = 2048+Ncp;
|
||||
} else {
|
||||
idft12288(prachF,prach2,1);
|
||||
idft(IDFT_12288,prachF,prach2,1);
|
||||
memmove( prach, prach+24576, Ncp<<2 );
|
||||
prach_len = 12288+Ncp;
|
||||
|
||||
@@ -414,12 +414,12 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
||||
|
||||
case 75:
|
||||
if (prach_fmt == 4) {
|
||||
idft3072(prachF,prach2,1);
|
||||
idft(IDFT_3072,prachF,prach2,1);
|
||||
//TODO: account for repeated format in dft output
|
||||
memmove( prach, prach+6144, Ncp<<2 );
|
||||
prach_len = 3072+Ncp;
|
||||
} else {
|
||||
idft18432(prachF,prach2,1);
|
||||
idft(IDFT_18432,prachF,prach2,1);
|
||||
memmove( prach, prach+36864, Ncp<<2 );
|
||||
prach_len = 18432+Ncp;
|
||||
|
||||
@@ -434,11 +434,11 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
||||
case 100:
|
||||
if (ue->frame_parms.threequarter_fs == 0) {
|
||||
if (prach_fmt == 4) {
|
||||
idft4096(prachF,prach2,1);
|
||||
idft(IDFT_4096,prachF,prach2,1);
|
||||
memmove( prach, prach+8192, Ncp<<2 );
|
||||
prach_len = 4096+Ncp;
|
||||
} else {
|
||||
idft24576(prachF,prach2,1);
|
||||
idft(IDFT_24576,prachF,prach2,1);
|
||||
memmove( prach, prach+49152, Ncp<<2 );
|
||||
prach_len = 24576+Ncp;
|
||||
|
||||
@@ -449,12 +449,12 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
||||
}
|
||||
} else {
|
||||
if (prach_fmt == 4) {
|
||||
idft3072(prachF,prach2,1);
|
||||
idft(IDFT_3072,prachF,prach2,1);
|
||||
//TODO: account for repeated format in dft output
|
||||
memmove( prach, prach+6144, Ncp<<2 );
|
||||
prach_len = 3072+Ncp;
|
||||
} else {
|
||||
idft18432(prachF,prach2,1);
|
||||
idft(IDFT_18432,prachF,prach2,1);
|
||||
memmove( prach, prach+36864, Ncp<<2 );
|
||||
prach_len = 18432+Ncp;
|
||||
printf("Generated prach for 100 PRB, 3/4 sampling\n");
|
||||
|
||||
@@ -104,9 +104,9 @@ void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
|
||||
|
||||
switch (Msc_PUSCH) {
|
||||
case 12:
|
||||
dft12((int16_t *)dft_in0,(int16_t *)dft_out0);
|
||||
dft12((int16_t *)dft_in1,(int16_t *)dft_out1);
|
||||
dft12((int16_t *)dft_in2,(int16_t *)dft_out2);
|
||||
dft(DFT_12,(int16_t *)dft_in0,(int16_t *)dft_out0,0);
|
||||
dft(DFT_12,(int16_t *)dft_in1,(int16_t *)dft_out1,0);
|
||||
dft(DFT_12,(int16_t *)dft_in2,(int16_t *)dft_out2,0);
|
||||
|
||||
/*
|
||||
dft12f(&((__m128i *)dft_in0)[0],&((__m128i *)dft_in0)[1],&((__m128i *)dft_in0)[2],&((__m128i *)dft_in0)[3],&((__m128i *)dft_in0)[4],&((__m128i *)dft_in0)[5],&((__m128i *)dft_in0)[6],&((__m128i *)dft_in0)[7],&((__m128i *)dft_in0)[8],&((__m128i *)dft_in0)[9],&((__m128i *)dft_in0)[10],&((__m128i *)dft_in0)[11],
|
||||
@@ -138,201 +138,201 @@ void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
|
||||
break;
|
||||
|
||||
case 24:
|
||||
dft24((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft24((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft24((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_24,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_24,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_24,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 36:
|
||||
dft36((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft36((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft36((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_36,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_36,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_36,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 48:
|
||||
dft48((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft48((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft48((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_48,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_48,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_48,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 60:
|
||||
dft60((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft60((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft60((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_60,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_60,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_60,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 72:
|
||||
dft72((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft72((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft72((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_72,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_72,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_72,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 96:
|
||||
dft96((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft96((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft96((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_96,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_96,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_96,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 108:
|
||||
dft108((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft108((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft108((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_108,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_108,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_108,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 120:
|
||||
dft120((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft120((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft120((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_120,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_120,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_120,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 144:
|
||||
dft144((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft144((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft144((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_144,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_144,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_144,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 180:
|
||||
dft180((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft180((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft180((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_180,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_180,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_180,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 192:
|
||||
dft192((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft192((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft192((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_192,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_192,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_192,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 216:
|
||||
dft216((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft216((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft216((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_216,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_216,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_216,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 240:
|
||||
dft240((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft240((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft240((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_240,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_240,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_240,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 288:
|
||||
dft288((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft288((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft288((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_288,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_288,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_288,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 300:
|
||||
dft300((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft300((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft300((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_300,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_300,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_300,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 324:
|
||||
dft324((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft324((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft324((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_324,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_324,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_324,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 360:
|
||||
dft360((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft360((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft360((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_360,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_360,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_360,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 384:
|
||||
dft384((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft384((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft384((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_384,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_384,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_384,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 432:
|
||||
dft432((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft432((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft432((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_432,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_432,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_432,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 480:
|
||||
dft480((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft480((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft480((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_480,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_480,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_480,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 540:
|
||||
dft540((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft540((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft540((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_540,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_540,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_540,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 576:
|
||||
dft576((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft576((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft576((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_576,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_576,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_576,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 600:
|
||||
dft600((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft600((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft600((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_600,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_600,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_600,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 648:
|
||||
dft648((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft648((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft648((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_648,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_648,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_648,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 720:
|
||||
dft720((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft720((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft720((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_720,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_720,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_720,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 768:
|
||||
dft768((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft768((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft768((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_768,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_768,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_768,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 864:
|
||||
dft864((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft864((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft864((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_864,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_864,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_864,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 900:
|
||||
dft900((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft900((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft900((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_900,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_900,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_900,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 960:
|
||||
dft960((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft960((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft960((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_960,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_960,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_960,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 972:
|
||||
dft972((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft972((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft972((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_972,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_972,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_972,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 1080:
|
||||
dft1080((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft1080((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft1080((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_1080,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_1080,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_1080,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 1152:
|
||||
dft1152((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft1152((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft1152((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_1152,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_1152,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_1152,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 1200:
|
||||
dft1200((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft1200((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft1200((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
dft(DFT_1200,(int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft(DFT_1200,(int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft(DFT_1200,(int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ void nr_dft(int32_t *z, int32_t *d, uint32_t Msc_PUSCH)
|
||||
|
||||
switch (Msc_PUSCH) {
|
||||
case 12:
|
||||
dft12((int16_t *)dft_in0, (int16_t *)dft_out0);
|
||||
dft(DFT_12,(int16_t *)dft_in0, (int16_t *)dft_out0,0);
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
norm128 = _mm_set1_epi16(9459);
|
||||
@@ -260,135 +260,135 @@ void nr_dft(int32_t *z, int32_t *d, uint32_t Msc_PUSCH)
|
||||
break;
|
||||
|
||||
case 24:
|
||||
dft24((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_24,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 36:
|
||||
dft36((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_36,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 48:
|
||||
dft48((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_48,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 60:
|
||||
dft60((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_60,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 72:
|
||||
dft72((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_72,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 96:
|
||||
dft96((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_96,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 108:
|
||||
dft108((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_108,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 120:
|
||||
dft120((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_120,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 144:
|
||||
dft144((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_144,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 180:
|
||||
dft180((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_180,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 192:
|
||||
dft192((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_192,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 216:
|
||||
dft216((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_216,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 240:
|
||||
dft240((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_240,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 288:
|
||||
dft288((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_288,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 300:
|
||||
dft300((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_300,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 324:
|
||||
dft324((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_324,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 360:
|
||||
dft360((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_360,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 384:
|
||||
dft384((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_384,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 432:
|
||||
dft432((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_432,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 480:
|
||||
dft480((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_480,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 540:
|
||||
dft540((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_540,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 576:
|
||||
dft576((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_576,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 600:
|
||||
dft600((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_600,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 648:
|
||||
dft648((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_648,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 720:
|
||||
dft720((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_720,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 768:
|
||||
dft768((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_768,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 864:
|
||||
dft864((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_864,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 900:
|
||||
dft900((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_900,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 960:
|
||||
dft960((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_960,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 972:
|
||||
dft972((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_960,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1080:
|
||||
dft1080((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_1080,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1152:
|
||||
dft1152((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_1152,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1200:
|
||||
dft1200((int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_1200,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -95,41 +95,41 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
||||
volatile int *output_ptr=(int*)0;
|
||||
|
||||
int *temp_ptr=(int*)0;
|
||||
void (*idft)(int16_t *,int16_t *, int);
|
||||
idft_size_idx_t idftsize;
|
||||
|
||||
switch (fftsize) {
|
||||
case 128:
|
||||
idft = idft128;
|
||||
idftsize = IDFT_128;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
idft = idft256;
|
||||
idftsize = IDFT_256;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
idft = idft512;
|
||||
idftsize = IDFT_512;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
idft = idft1024;
|
||||
idftsize = IDFT_1024;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
idft = idft1536;
|
||||
idftsize = IDFT_1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
idft = idft2048;
|
||||
idftsize = IDFT_2048;
|
||||
break;
|
||||
|
||||
case 3072:
|
||||
idft = idft3072;
|
||||
idftsize = IDFT_3072;
|
||||
break;
|
||||
case 4096:
|
||||
idft = idft4096;
|
||||
idftsize = IDFT_4096;
|
||||
break;
|
||||
default:
|
||||
idft = idft512;
|
||||
idftsize = IDFT_512;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -148,12 +148,12 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
||||
|
||||
#ifndef __AVX2__
|
||||
// handle 128-bit alignment for 128-bit SIMD (SSE4,NEON,AltiVEC)
|
||||
idft((int16_t *)&input[i*fftsize],
|
||||
idft(idftsize,(int16_t *)&input[i*fftsize],
|
||||
(fftsize==128) ? (int16_t *)temp : (int16_t *)&output[(i*fftsize) + ((1+i)*nb_prefix_samples)],
|
||||
1);
|
||||
#else
|
||||
// on AVX2 need 256-bit alignment
|
||||
idft((int16_t *)&input[i*fftsize],
|
||||
idft(idftsize,(int16_t *)&input[i*fftsize],
|
||||
(int16_t *)temp,
|
||||
1);
|
||||
|
||||
|
||||
@@ -49,36 +49,36 @@ int slot_fep(PHY_VARS_UE *ue,
|
||||
unsigned char harq_pid = dlsch_ue[0]->current_harq_pid;
|
||||
LTE_DL_UE_HARQ_t *dlsch0_harq = dlsch_ue[0]->harq_processes[harq_pid];
|
||||
int uespec_pilot[9][1200];*/
|
||||
void (*dft)(int16_t *,int16_t *, int);
|
||||
dft_size_idx_t dftsizeidx;
|
||||
int tmp_dft_in[2048] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs
|
||||
|
||||
switch (frame_parms->ofdm_symbol_size) {
|
||||
case 128:
|
||||
dft = dft128;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
dft = dft256;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
dft = dft512;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
dft = dft1024;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
dft = dft1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
dft = dft2048;
|
||||
dftsizeidx = DFT_128;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
dftsizeidx = DFT_256;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
dftsizeidx = DFT_512;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
dftsizeidx = DFT_1024;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
dftsizeidx = DFT_1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
dftsizeidx = DFT_2048;
|
||||
break;
|
||||
|
||||
default:
|
||||
dft = dft512;
|
||||
dftsizeidx = DFT_512;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -118,13 +118,13 @@ int slot_fep(PHY_VARS_UE *ue,
|
||||
memcpy((void *)tmp_dft_in,
|
||||
(void *)&common_vars->rxdata[aa][rx_offset % frame_length_samples],
|
||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
dft((int16_t *)tmp_dft_in,
|
||||
dft(dftsizeidx,(int16_t *)tmp_dft_in,
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
} else { // use dft input from RX buffer directly
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&ue->rx_dft_stats);
|
||||
#endif
|
||||
dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
dft(dftsizeidx,(int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&ue->rx_dft_stats);
|
||||
@@ -153,10 +153,10 @@ int slot_fep(PHY_VARS_UE *ue,
|
||||
memcpy((void *)tmp_dft_in,
|
||||
(void *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
dft((int16_t *)tmp_dft_in,
|
||||
dft(dftsizeidx,(int16_t *)tmp_dft_in,
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
} else { // use dft input from RX buffer directly
|
||||
dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
dft(dftsizeidx,(int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
}
|
||||
|
||||
@@ -247,36 +247,36 @@ int front_end_fft(PHY_VARS_UE *ue,
|
||||
unsigned char harq_pid = dlsch_ue[0]->current_harq_pid;
|
||||
LTE_DL_UE_HARQ_t *dlsch0_harq = dlsch_ue[0]->harq_processes[harq_pid];
|
||||
int uespec_pilot[9][1200];*/
|
||||
void (*dft)(int16_t *,int16_t *, int);
|
||||
dft_size_idx_t dftsizeidx;
|
||||
int tmp_dft_in[2048] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs
|
||||
|
||||
switch (frame_parms->ofdm_symbol_size) {
|
||||
case 128:
|
||||
dft = dft128;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
dft = dft256;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
dft = dft512;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
dft = dft1024;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
dft = dft1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
dft = dft2048;
|
||||
break;
|
||||
|
||||
default:
|
||||
dft = dft512;
|
||||
dftsizeidx = DFT_128;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
dftsizeidx = DFT_256;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
dftsizeidx = DFT_512;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
dftsizeidx = DFT_1024;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
dftsizeidx = DFT_1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
dftsizeidx = DFT_2048;
|
||||
break;
|
||||
|
||||
default:
|
||||
dftsizeidx = DFT_512;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -319,11 +319,11 @@ int front_end_fft(PHY_VARS_UE *ue,
|
||||
memcpy((void *)tmp_dft_in,
|
||||
(void *)&common_vars->rxdata[aa][rx_offset % frame_length_samples],
|
||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
dft((int16_t *)tmp_dft_in,
|
||||
dft(dftsizeidx,(int16_t *)tmp_dft_in,
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[threadId].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
} else { // use dft input from RX buffer directly
|
||||
start_meas(&ue->rx_dft_stats);
|
||||
dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
dft(dftsizeidx,(int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[threadId].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
stop_meas(&ue->rx_dft_stats);
|
||||
}
|
||||
@@ -349,10 +349,10 @@ int front_end_fft(PHY_VARS_UE *ue,
|
||||
memcpy((void *)tmp_dft_in,
|
||||
(void *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
dft((int16_t *)tmp_dft_in,
|
||||
dft(dftsizeidx,(int16_t *)tmp_dft_in,
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[threadId].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
} else { // use dft input from RX buffer directly
|
||||
dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
dft(dftsizeidx,(int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[threadId].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,35 +42,35 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue,
|
||||
unsigned int subframe_offset;
|
||||
// int i;
|
||||
unsigned int frame_length_samples = frame_parms->samples_per_tti * 10;
|
||||
void (*dft)(int16_t *,int16_t *, int);
|
||||
dft_size_idx_t dftsizeidx;
|
||||
|
||||
switch (frame_parms->ofdm_symbol_size) {
|
||||
case 128:
|
||||
dft = dft128;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
dft = dft256;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
dft = dft512;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
dft = dft1024;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
dft = dft1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
dft = dft2048;
|
||||
break;
|
||||
|
||||
default:
|
||||
dft = dft512;
|
||||
dftsizeidx = DFT_128;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
dftsizeidx = DFT_256;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
dftsizeidx = DFT_512;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
dftsizeidx = DFT_1024;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
dftsizeidx = DFT_1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
dftsizeidx = DFT_2048;
|
||||
break;
|
||||
|
||||
default:
|
||||
dftsizeidx = DFT_512;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue,
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&ue->rx_dft_stats);
|
||||
#endif
|
||||
dft((int16_t *)&common_vars->rxdata[aa][(sample_offset +
|
||||
dft(dftsizeidx,(int16_t *)&common_vars->rxdata[aa][(sample_offset +
|
||||
nb_prefix_samples0 +
|
||||
subframe_offset -
|
||||
SOFFSET) % frame_length_samples],
|
||||
@@ -131,7 +131,7 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue,
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&ue->rx_dft_stats);
|
||||
#endif
|
||||
dft((int16_t *)&common_vars->rxdata[aa][(sample_offset +
|
||||
dft(dftsizeidx,(int16_t *)&common_vars->rxdata[aa][(sample_offset +
|
||||
(frame_parms->ofdm_symbol_size+nb_prefix_samples0+nb_prefix_samples) +
|
||||
(frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1) +
|
||||
subframe_offset-
|
||||
@@ -208,43 +208,43 @@ int slot_fep_mbsfn_khz_1dot25(PHY_VARS_UE *ue,
|
||||
int ofdm_symbol_size;
|
||||
unsigned int subframe_offset;
|
||||
unsigned int frame_length_samples = frame_parms->samples_per_tti * 10;
|
||||
void (*dft)(int16_t *,int16_t *, int);
|
||||
dft_size_idx_t dftsizeidx;
|
||||
AssertFatal(frame_parms->frame_type == FDD, "Frame is TDD!\n");
|
||||
|
||||
switch (frame_parms->ofdm_symbol_size) {
|
||||
case 128:
|
||||
dft = dft1536;
|
||||
dftsizeidx = DFT_1536;
|
||||
ofdm_symbol_size=1536;
|
||||
nb_prefix_samples=384;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
AssertFatal(1==0,"FeMBMS dft3072 not implemented\n");
|
||||
dft = dft3072;
|
||||
dftsizeidx = DFT_3072;
|
||||
ofdm_symbol_size=3072;
|
||||
nb_prefix_samples=768;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
dft = dft6144;
|
||||
dftsizeidx = DFT_6144;
|
||||
nb_prefix_samples=1536;
|
||||
ofdm_symbol_size=6144;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
dft = dft12288;
|
||||
dftsizeidx = DFT_12288;
|
||||
nb_prefix_samples=3072;
|
||||
ofdm_symbol_size=12288;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
dft = dft18432;
|
||||
dftsizeidx = DFT_18432;
|
||||
nb_prefix_samples=4608;
|
||||
ofdm_symbol_size=18432;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
dft = dft24576;
|
||||
dftsizeidx = DFT_24576;
|
||||
nb_prefix_samples=6144;
|
||||
ofdm_symbol_size=24576;
|
||||
break;
|
||||
@@ -265,7 +265,7 @@ int slot_fep_mbsfn_khz_1dot25(PHY_VARS_UE *ue,
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&ue->rx_dft_stats);
|
||||
#endif
|
||||
dft((int16_t *)&common_vars->rxdata[aa][(sample_offset +
|
||||
dft(dftsizeidx,(int16_t *)&common_vars->rxdata[aa][(sample_offset +
|
||||
nb_prefix_samples +
|
||||
subframe_offset -
|
||||
SOFFSET) % frame_length_samples],
|
||||
|
||||
@@ -62,44 +62,44 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
||||
unsigned int rx_offset;
|
||||
|
||||
|
||||
void (*dft)(int16_t *,int16_t *, int);
|
||||
dft_size_idx_t dftsize;
|
||||
int tmp_dft_in[8192] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs
|
||||
|
||||
switch (frame_parms->ofdm_symbol_size) {
|
||||
case 128:
|
||||
dft = dft128;
|
||||
dftsize = DFT_128;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
dft = dft256;
|
||||
dftsize = DFT_256;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
dft = dft512;
|
||||
dftsize = DFT_512;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
dft = dft1024;
|
||||
dftsize = DFT_1024;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
dft = dft1536;
|
||||
dftsize = DFT_1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
dft = dft2048;
|
||||
dftsize = DFT_2048;
|
||||
break;
|
||||
|
||||
case 3072:
|
||||
dft = dft3072;
|
||||
dftsize = DFT_3072;
|
||||
break;
|
||||
|
||||
case 4096:
|
||||
dft = dft4096;
|
||||
dftsize = DFT_4096;
|
||||
break;
|
||||
|
||||
case 8192:
|
||||
dft = dft8192;
|
||||
dftsize = DFT_8192;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -155,14 +155,14 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
||||
memcpy((void *)tmp_dft_in,
|
||||
(void *) &common_vars->rxdata[aa][rx_offset % frame_length_samples],
|
||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
dft((int16_t *)tmp_dft_in,
|
||||
dft(dftsize,(int16_t *)tmp_dft_in,
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
} else { // use dft input from RX buffer directly
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&ue->rx_dft_stats);
|
||||
#endif
|
||||
|
||||
dft((int16_t *) &common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
dft(dftsize,(int16_t *) &common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&ue->rx_dft_stats);
|
||||
@@ -183,11 +183,11 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
||||
memcpy((void *)tmp_dft_in,
|
||||
(void *) &common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
dft((int16_t *)tmp_dft_in,
|
||||
dft(dftsize,(int16_t *)tmp_dft_in,
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
} else { // use dft input from RX buffer directly
|
||||
|
||||
dft((int16_t *) &common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
dft(dftsize,(int16_t *) &common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
}
|
||||
#if UE_TIMING_TRACE
|
||||
@@ -237,44 +237,44 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue,
|
||||
unsigned int rx_offset;
|
||||
|
||||
|
||||
void (*dft)(int16_t *,int16_t *, int);
|
||||
dft_size_idx_t dftsize;
|
||||
int tmp_dft_in[8192] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs
|
||||
|
||||
switch (frame_parms->ofdm_symbol_size) {
|
||||
case 128:
|
||||
dft = dft128;
|
||||
dftsize = DFT_128;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
dft = dft256;
|
||||
dftsize = DFT_256;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
dft = dft512;
|
||||
dftsize = DFT_512;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
dft = dft1024;
|
||||
dftsize = DFT_1024;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
dft = dft1536;
|
||||
dftsize = DFT_1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
dft = dft2048;
|
||||
dftsize = DFT_2048;
|
||||
break;
|
||||
|
||||
case 3072:
|
||||
dft = dft3072;
|
||||
dftsize = DFT_3072;
|
||||
break;
|
||||
|
||||
case 4096:
|
||||
dft = dft4096;
|
||||
dftsize = DFT_4096;
|
||||
break;
|
||||
|
||||
case 8192:
|
||||
dft = dft8192;
|
||||
dftsize = DFT_8192;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -330,14 +330,15 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue,
|
||||
memcpy((void *)tmp_dft_in,
|
||||
(void *) &common_vars->rxdata[aa][rx_offset],
|
||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
dft((int16_t *)tmp_dft_in,
|
||||
dft(dftsize,(int16_t *)tmp_dft_in,
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
} else { // use dft input from RX buffer directly
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&ue->rx_dft_stats);
|
||||
#endif
|
||||
|
||||
dft((int16_t *) &common_vars->rxdata[aa][rx_offset],
|
||||
|
||||
dft(dftsize,(int16_t *) &common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&ue->rx_dft_stats);
|
||||
@@ -358,11 +359,10 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue,
|
||||
memcpy((void *)tmp_dft_in,
|
||||
(void *) &common_vars->rxdata[aa][rx_offset],
|
||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
dft((int16_t *)tmp_dft_in,
|
||||
dft(dftsize,(int16_t *)tmp_dft_in,
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
} else { // use dft input from RX buffer directly
|
||||
|
||||
dft((int16_t *) &common_vars->rxdata[aa][rx_offset],
|
||||
dft(dftsize,(int16_t *) &common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
}
|
||||
#if UE_TIMING_TRACE
|
||||
@@ -400,43 +400,43 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned int nb_prefix_samples = (no_prefix ? 0 : frame_parms->nb_prefix_samples);
|
||||
unsigned int nb_prefix_samples0 = (no_prefix ? 0 : frame_parms->nb_prefix_samples0);
|
||||
|
||||
void (*dft)(int16_t *,int16_t *, int);
|
||||
dft_size_idx_t dftsize;
|
||||
|
||||
switch (frame_parms->ofdm_symbol_size) {
|
||||
case 128:
|
||||
dft = dft128;
|
||||
dftsize = DFT_128;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
dft = dft256;
|
||||
dftsize = DFT_256;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
dft = dft512;
|
||||
dftsize = DFT_512;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
dft = dft1024;
|
||||
dftsize = DFT_1024;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
dft = dft1536;
|
||||
dftsize = DFT_1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
dft = dft2048;
|
||||
dftsize = DFT_2048;
|
||||
break;
|
||||
|
||||
case 4096:
|
||||
dft = dft4096;
|
||||
dftsize = DFT_4096;
|
||||
break;
|
||||
|
||||
case 8192:
|
||||
dft = dft8192;
|
||||
dftsize = DFT_8192;
|
||||
break;
|
||||
|
||||
default:
|
||||
dft = dft512;
|
||||
dftsize = DFT_512;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -448,7 +448,7 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms,
|
||||
else
|
||||
rxdata_offset = slot_offset + nb_prefix_samples0 + (symbol * (frame_parms->ofdm_symbol_size + nb_prefix_samples)) - SOFFSET;
|
||||
|
||||
dft((int16_t *)&rxdata[rxdata_offset],
|
||||
dft(dftsize,(int16_t *)&rxdata[rxdata_offset],
|
||||
(int16_t *)&rxdataF[symbol * frame_parms->ofdm_symbol_size], 1);
|
||||
|
||||
return(0);
|
||||
|
||||
@@ -44,7 +44,7 @@ int slot_fep_ul(RU_t *ru,
|
||||
unsigned int slot_offset;
|
||||
|
||||
|
||||
void (*dft)(int16_t *,int16_t *, int);
|
||||
dft_size_idx_t dftsize;
|
||||
|
||||
int tmp_dft_in[2048] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs
|
||||
unsigned int frame_length_samples = fp->samples_per_tti * 10;
|
||||
@@ -52,31 +52,31 @@ int slot_fep_ul(RU_t *ru,
|
||||
|
||||
switch (fp->ofdm_symbol_size) {
|
||||
case 128:
|
||||
dft = dft128;
|
||||
dftsize = DFT_128;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
dft = dft256;
|
||||
dftsize = DFT_256;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
dft = dft512;
|
||||
dftsize = DFT_512;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
dft = dft1024;
|
||||
dftsize = DFT_1024;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
dft = dft1536;
|
||||
dftsize = DFT_1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
dft = dft2048;
|
||||
dftsize = DFT_2048;
|
||||
break;
|
||||
|
||||
default:
|
||||
dft = dft512;
|
||||
dftsize = DFT_512;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ int slot_fep_ul(RU_t *ru,
|
||||
LOG_D(PHY,"slot_fep: symbol 0 %d dB\n",
|
||||
dB_fixed(signal_energy(&common->rxdata_7_5kHz[aa][rx_offset],fp->ofdm_symbol_size)));
|
||||
#endif
|
||||
dft( (int16_t *)&common->rxdata_7_5kHz[aa][rx_offset],
|
||||
dft( dftsize,(int16_t *)&common->rxdata_7_5kHz[aa][rx_offset],
|
||||
(int16_t *)&common->rxdataF[aa][fp->ofdm_symbol_size*symbol],
|
||||
1
|
||||
);
|
||||
@@ -121,13 +121,13 @@ int slot_fep_ul(RU_t *ru,
|
||||
memcpy((void *)&tmp_dft_in,
|
||||
(void *)&common->rxdata_7_5kHz[aa][(rx_offset % frame_length_samples)],
|
||||
fp->ofdm_symbol_size*sizeof(int));
|
||||
dft( (short *) tmp_dft_in,
|
||||
dft( dftsize,(short *) tmp_dft_in,
|
||||
(short*) &common->rxdataF[aa][fp->ofdm_symbol_size*symbol],
|
||||
1
|
||||
);
|
||||
}
|
||||
else{
|
||||
dft( (short *)&common->rxdata_7_5kHz[aa][rx_offset],
|
||||
dft( dftsize,(short *)&common->rxdata_7_5kHz[aa][rx_offset],
|
||||
(short*)&common->rxdataF[aa][fp->ofdm_symbol_size*symbol],
|
||||
1
|
||||
);
|
||||
|
||||
@@ -430,55 +430,55 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
switch (gNB->frame_parms.ofdm_symbol_size) {
|
||||
case 128:
|
||||
idft128((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
idft(IDFT_128,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 256:
|
||||
idft256((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
idft(IDFT_256,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 512:
|
||||
idft512((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
idft(IDFT_512,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
idft1024((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
idft(IDFT_1024,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
idft1536((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
idft(IDFT_1536,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
idft2048((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
idft(IDFT_2048,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 4096:
|
||||
idft4096((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
idft(IDFT_4096,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 8192:
|
||||
idft8192((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
idft(IDFT_8192,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
default:
|
||||
idft512((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
idft(IDFT_512,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
@@ -127,8 +127,8 @@ time_stats_t generic_time[TIME_LAST];
|
||||
|
||||
/************** FUNCTION ******************************************/
|
||||
|
||||
void *get_idft(int ofdm_symbol_size);
|
||||
void *get_dft(int ofdm_symbol_size);
|
||||
idft_size_idx_t get_idft(int ofdm_symbol_size);
|
||||
dft_size_idx_t get_dft(int ofdm_symbol_size);
|
||||
void init_context_synchro_nr(NR_DL_FRAME_PARMS *frame_parms_ue);
|
||||
void free_context_synchro_nr(void);
|
||||
void init_context_pss_nr(NR_DL_FRAME_PARMS *frame_parms_ue);
|
||||
|
||||
@@ -175,39 +175,39 @@ void rx_nr_prach_ru(RU_t *ru,
|
||||
//50 MHz @ 61.44 Ms/s
|
||||
prach2 = prach[aa] + (Ncp<<2);
|
||||
if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2)
|
||||
dft49152(prach2,rxsigF[aa],1);
|
||||
dft(DFT_49152,prach2,rxsigF[aa],1);
|
||||
if (prach_fmt == 1 || prach_fmt == 2) {
|
||||
dft49152(prach2+98304,rxsigF[aa]+98304,1);
|
||||
dft(DFT_49152,prach2+98304,rxsigF[aa]+98304,1);
|
||||
reps++;
|
||||
}
|
||||
if (prach_fmt == 2) {
|
||||
dft49152(prach2+(98304*2),rxsigF[aa]+(98304*2),1);
|
||||
dft49152(prach2+(98304*3),rxsigF[aa]+(98304*3),1);
|
||||
dft(DFT_49152,prach2+(98304*2),rxsigF[aa]+(98304*2),1);
|
||||
dft(DFT_49152,prach2+(98304*3),rxsigF[aa]+(98304*3),1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 3) {
|
||||
for (int i=0;i<4;i++) dft12288(prach2+(i*12288*2),rxsigF[aa]+(i*12288*2),1);
|
||||
for (int i=0;i<4;i++) dft(DFT_12288,prach2+(i*12288*2),rxsigF[aa]+(i*12288*2),1);
|
||||
reps=4;
|
||||
}
|
||||
if (prach_fmt >3) {
|
||||
dft2048(prach2,rxsigF[aa],1);
|
||||
dft(DFT_2048,prach2,rxsigF[aa],1);
|
||||
if (prach_fmt != 0xc0) {
|
||||
dft2048(prach2+4096,rxsigF[aa]+4096,1);
|
||||
dft(DFT_2048,prach2+4096,rxsigF[aa]+4096,1);
|
||||
reps++;
|
||||
}
|
||||
}
|
||||
if (prach_fmt == 0xa2 || prach_fmt == 0xa3 || prach_fmt == 0xb2 || prach_fmt == 0xb3 || prach_fmt == 0xb4 || prach_fmt == 0xc2) {
|
||||
dft2048(prach2+4096*2,rxsigF[aa]+4096*2,1);
|
||||
dft2048(prach2+4096*3,rxsigF[aa]+4096*3,1);
|
||||
dft(DFT_2048,prach2+4096*2,rxsigF[aa]+4096*2,1);
|
||||
dft(DFT_2048,prach2+4096*3,rxsigF[aa]+4096*3,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 0xa3 || prach_fmt == 0xb3 || prach_fmt == 0xc2) {
|
||||
dft2048(prach2+4096*4,rxsigF[aa]+4096*4,1);
|
||||
dft2048(prach2+4096*5,rxsigF[aa]+4096*5,1);
|
||||
dft(DFT_2048,prach2+4096*4,rxsigF[aa]+4096*4,1);
|
||||
dft(DFT_2048,prach2+4096*5,rxsigF[aa]+4096*5,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 0xc2) {
|
||||
for (int i=6;i<11;i++) dft2048(prach2+(3072*i),rxsigF[aa]+(3072*i),1);
|
||||
for (int i=6;i<11;i++) dft(DFT_2048,prach2+(3072*i),rxsigF[aa]+(3072*i),1);
|
||||
reps+=6;
|
||||
}
|
||||
} else {
|
||||
@@ -215,41 +215,41 @@ void rx_nr_prach_ru(RU_t *ru,
|
||||
prach2 = prach[aa] + (3*Ncp);
|
||||
AssertFatal(fp->N_RB_UL <= 107,"cannot do 108..136 PRBs with 3/4 sampling\n");
|
||||
if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2) {
|
||||
dft36864(prach2,rxsigF[aa],1);
|
||||
dft(DFT_36864,prach2,rxsigF[aa],1);
|
||||
reps++;
|
||||
}
|
||||
if (prach_fmt == 1 || prach_fmt == 2) {
|
||||
dft36864(prach2+73728,rxsigF[aa]+73728,1);
|
||||
dft(DFT_36864,prach2+73728,rxsigF[aa]+73728,1);
|
||||
reps++;
|
||||
}
|
||||
if (prach_fmt == 2) {
|
||||
dft36864(prach2+(98304*2),rxsigF[aa]+(98304*2),1);
|
||||
dft36864(prach2+(98304*3),rxsigF[aa]+(98304*3),1);
|
||||
dft(DFT_36864,prach2+(98304*2),rxsigF[aa]+(98304*2),1);
|
||||
dft(DFT_36864,prach2+(98304*3),rxsigF[aa]+(98304*3),1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 3) {
|
||||
for (int i=0;i<4;i++) dft9216(prach2+(i*9216*2),rxsigF[aa]+(i*9216*2),1);
|
||||
for (int i=0;i<4;i++) dft(DFT_9216,prach2+(i*9216*2),rxsigF[aa]+(i*9216*2),1);
|
||||
reps=4;
|
||||
}
|
||||
if (prach_fmt >3) {
|
||||
dft1536(prach2,rxsigF[aa],1);
|
||||
dft(DFT_1536,prach2,rxsigF[aa],1);
|
||||
if (prach_fmt != 0xc0) {
|
||||
dft1536(prach2+3072,rxsigF[aa]+3072,1);
|
||||
dft(DFT_1536,prach2+3072,rxsigF[aa]+3072,1);
|
||||
reps++;
|
||||
}
|
||||
}
|
||||
if (prach_fmt == 0xa2 || prach_fmt == 0xa3 || prach_fmt == 0xb2 || prach_fmt == 0xb3 || prach_fmt == 0xb4 || prach_fmt == 0xc2) {
|
||||
dft1536(prach2+3072*2,rxsigF[aa]+3072*2,1);
|
||||
dft1536(prach2+3072*3,rxsigF[aa]+3072*3,1);
|
||||
dft(DFT_1536,prach2+3072*2,rxsigF[aa]+3072*2,1);
|
||||
dft(DFT_1536,prach2+3072*3,rxsigF[aa]+3072*3,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 0xa3 || prach_fmt == 0xb3 || prach_fmt == 0xc2) {
|
||||
dft1536(prach2+3072*4,rxsigF[aa]+3072*4,1);
|
||||
dft1536(prach2+3072*5,rxsigF[aa]+3072*5,1);
|
||||
dft(DFT_1536,prach2+3072*4,rxsigF[aa]+3072*4,1);
|
||||
dft(DFT_1536,prach2+3072*5,rxsigF[aa]+3072*5,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 0xc2) {
|
||||
for (int i=6;i<11;i++) dft1536(prach2+(3072*i),rxsigF[aa]+(3072*i),1);
|
||||
for (int i=6;i<11;i++) dft(DFT_1536,prach2+(3072*i),rxsigF[aa]+(3072*i),1);
|
||||
reps+=6;
|
||||
}
|
||||
}
|
||||
@@ -260,41 +260,41 @@ void rx_nr_prach_ru(RU_t *ru,
|
||||
dftlen=98304;
|
||||
//80,90,100 MHz @ 61.44 Ms/s
|
||||
if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2)
|
||||
dft98304(prach2,rxsigF[aa],1);
|
||||
dft(DFT_98304,prach2,rxsigF[aa],1);
|
||||
if (prach_fmt == 1 || prach_fmt == 2) {
|
||||
dft98304(prach2+196608,rxsigF[aa]+196608,1);
|
||||
dft(DFT_98304,prach2+196608,rxsigF[aa]+196608,1);
|
||||
reps++;
|
||||
}
|
||||
if (prach_fmt == 1 || prach_fmt == 2) {
|
||||
dft98304(prach2+196608,rxsigF[aa]+196608,1);
|
||||
dft98304(prach2+(196608*2),rxsigF[aa]+(196608*2),1);
|
||||
dft(DFT_98304,prach2+196608,rxsigF[aa]+196608,1);
|
||||
dft(DFT_98304,prach2+(196608*2),rxsigF[aa]+(196608*2),1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 3) {
|
||||
dft24576(prach2+(2*49152),rxsigF[aa]+(2*49152),1);
|
||||
dft(DFT_24576,prach2+(2*49152),rxsigF[aa]+(2*49152),1);
|
||||
reps=4;
|
||||
dftlen=24576;
|
||||
}
|
||||
if (prach_fmt >3) {
|
||||
dftlen=4096;
|
||||
dft4096(prach2,rxsigF[aa],1);
|
||||
dft(DFT_4096,prach2,rxsigF[aa],1);
|
||||
if (prach_fmt != 0xc0) {
|
||||
dft4096(prach2+8192,rxsigF[aa]+8192,1);
|
||||
dft(DFT_4096,prach2+8192,rxsigF[aa]+8192,1);
|
||||
reps++;
|
||||
}
|
||||
}
|
||||
if (prach_fmt == 0xa2 || prach_fmt == 0xa3 || prach_fmt == 0xb2 || prach_fmt == 0xb3 || prach_fmt == 0xb4 || prach_fmt == 0xc2) {
|
||||
dft4096(prach2+8192*2,rxsigF[aa]+8192*2,1);
|
||||
dft4096(prach2+8192*3,rxsigF[aa]+8192*3,1);
|
||||
dft(DFT_4096,prach2+8192*2,rxsigF[aa]+8192*2,1);
|
||||
dft(DFT_4096,prach2+8192*3,rxsigF[aa]+8192*3,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 0xa3 || prach_fmt == 0xb3 || prach_fmt == 0xc2) {
|
||||
dft4096(prach2+8192*4,rxsigF[aa]+8192*4,1);
|
||||
dft4096(prach2+8192*5,rxsigF[aa]+8192*5,1);
|
||||
dft(DFT_4096,prach2+8192*4,rxsigF[aa]+8192*4,1);
|
||||
dft(DFT_4096,prach2+8192*5,rxsigF[aa]+8192*5,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 0xc2) {
|
||||
for (int i=6;i<11;i++) dft4096(prach2+(8192*i),rxsigF[aa]+(8192*i),1);
|
||||
for (int i=6;i<11;i++) dft(DFT_4096,prach2+(8192*i),rxsigF[aa]+(8192*i),1);
|
||||
reps+=6;
|
||||
}
|
||||
} else {
|
||||
@@ -303,39 +303,39 @@ void rx_nr_prach_ru(RU_t *ru,
|
||||
// 80 MHz @ 46.08 Ms/s
|
||||
dftlen=73728;
|
||||
if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2) {
|
||||
dft73728(prach2,rxsigF[aa],1);
|
||||
dft(DFT_73728,prach2,rxsigF[aa],1);
|
||||
reps++;
|
||||
}
|
||||
if (prach_fmt == 1 || prach_fmt == 2) {
|
||||
dft73728(prach2+(2*73728),rxsigF[aa]+(2*73728),1);
|
||||
dft(DFT_73728,prach2+(2*73728),rxsigF[aa]+(2*73728),1);
|
||||
reps++;
|
||||
}
|
||||
if (prach_fmt == 3) {
|
||||
dft73728(prach2+(4*73728),rxsigF[aa]+(4*73728),1);
|
||||
dft(DFT_73728,prach2+(4*73728),rxsigF[aa]+(4*73728),1);
|
||||
reps=4;
|
||||
dftlen=18432;
|
||||
}
|
||||
|
||||
if (prach_fmt >3) {
|
||||
dftlen=3072;
|
||||
dft3072(prach2,rxsigF[aa],1);
|
||||
dft(DFT_3072,prach2,rxsigF[aa],1);
|
||||
if (prach_fmt != 0xc0) {
|
||||
dft3072(prach2+6144,rxsigF[aa]+6144,1);
|
||||
dft(DFT_3072,prach2+6144,rxsigF[aa]+6144,1);
|
||||
reps++;
|
||||
}
|
||||
}
|
||||
if (prach_fmt == 0xa2 || prach_fmt == 0xa3 || prach_fmt == 0xb2 || prach_fmt == 0xb3 || prach_fmt == 0xb4 || prach_fmt == 0xc2) {
|
||||
dft3072(prach2+6144*2,rxsigF[aa]+6144*2,1);
|
||||
dft3072(prach2+6144*3,rxsigF[aa]+6144*3,1);
|
||||
dft(DFT_3072,prach2+6144*2,rxsigF[aa]+6144*2,1);
|
||||
dft(DFT_3072,prach2+6144*3,rxsigF[aa]+6144*3,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 0xa3 || prach_fmt == 0xb3 || prach_fmt == 0xc2) {
|
||||
dft3072(prach2+6144*4,rxsigF[aa]+6144*4,1);
|
||||
dft3072(prach2+6144*5,rxsigF[aa]+6144*5,1);
|
||||
dft(DFT_3072,prach2+6144*4,rxsigF[aa]+6144*4,1);
|
||||
dft(DFT_3072,prach2+6144*5,rxsigF[aa]+6144*5,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 0xc2) {
|
||||
for (int i=6;i<11;i++) dft3072(prach2+(6144*i),rxsigF[aa]+(6144*i),1);
|
||||
for (int i=6;i<11;i++) dft(DFT_3072,prach2+(6144*i),rxsigF[aa]+(6144*i),1);
|
||||
reps+=6;
|
||||
}
|
||||
}
|
||||
@@ -590,12 +590,12 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
// Now do IFFT of size 1024 (N_ZC=839) or 256 (N_ZC=139)
|
||||
if (N_ZC == 839) {
|
||||
log2_ifft_size = 10;
|
||||
idft1024(prachF,prach_ifft_tmp,1);
|
||||
idft(IDFT_1024,prachF,prach_ifft_tmp,1);
|
||||
// compute energy and accumulate over receive antennas
|
||||
for (i=0;i<2048;i++)
|
||||
prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[i<<1] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>10;
|
||||
} else {
|
||||
idft256(prachF,prach_ifft_tmp,1);
|
||||
idft(IDFT_256,prachF,prach_ifft_tmp,1);
|
||||
log2_ifft_size = 8;
|
||||
// compute energy and accumulate over receive antennas and repetitions for BR
|
||||
for (i=0;i<256;i++)
|
||||
|
||||
@@ -458,9 +458,8 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
for (r=0; r<harq_process->C; r++) {
|
||||
E = nr_get_E(G, harq_process->C, Qm, n_layers, r);
|
||||
|
||||
#if gNB_TIMING_TRACE
|
||||
start_meas(ulsch_deinterleaving_stats);
|
||||
#endif
|
||||
|
||||
start_meas(&phy_vars_gNB->ulsch_deinterleaving_stats);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////// nr_deinterleaving_ldpc ///////////////////////////////////
|
||||
@@ -476,13 +475,8 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
//for (int i =0; i<16; i++)
|
||||
// printf("rx output deinterleaving w[%d]= %d r_offset %d\n", i,harq_process->w[r][i], r_offset);
|
||||
|
||||
#if gNB_TIMING_TRACE
|
||||
stop_meas(ulsch_deinterleaving_stats);
|
||||
#endif
|
||||
stop_meas(&phy_vars_gNB->ulsch_deinterleaving_stats);
|
||||
|
||||
#if gNB_TIMING_TRACE
|
||||
start_meas(ulsch_rate_unmatching_stats);
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
LOG_D(PHY,"HARQ_PID %d Rate Matching Segment %d (coded bits %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rv %d, round %d)...\n",
|
||||
@@ -504,6 +498,8 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
|
||||
///////////////////////// harq_process->e =====> harq_process->d /////////////////////////
|
||||
|
||||
start_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats);
|
||||
|
||||
Tbslbrm = nr_compute_tbslbrm(0,nb_rb,n_layers,harq_process->C);
|
||||
|
||||
if (nr_rate_matching_ldpc_rx(Ilbrm,
|
||||
@@ -518,15 +514,13 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
E,
|
||||
harq_process->F,
|
||||
Kr-harq_process->F-2*(p_decParams->Z))==-1) {
|
||||
#if gNB_TIMING_TRACE
|
||||
stop_meas(ulsch_rate_unmatching_stats);
|
||||
#endif
|
||||
|
||||
stop_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats);
|
||||
|
||||
LOG_E(PHY,"ulsch_decoding.c: Problem in rate_matching\n");
|
||||
return (ulsch->max_ldpc_iterations + 1);
|
||||
} else {
|
||||
#if gNB_TIMING_TRACE
|
||||
stop_meas(ulsch_rate_unmatching_stats);
|
||||
#endif
|
||||
stop_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats);
|
||||
}
|
||||
|
||||
r_offset += E;
|
||||
@@ -564,9 +558,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
|
||||
if (err_flag == 0) {
|
||||
|
||||
#if gNB_TIMING_TRACE
|
||||
start_meas(ulsch_turbo_decoding_stats);
|
||||
#endif
|
||||
start_meas(&phy_vars_gNB->ulsch_ldpc_decoding_stats);
|
||||
|
||||
//LOG_E(PHY,"AbsSubframe %d.%d Start LDPC segment %d/%d A %d ",frame%1024,nr_tti_rx,r,harq_process->C-1, A);
|
||||
|
||||
@@ -636,9 +628,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
//write_output("dec_output.m","dec0",harq_process->c[0],Kr_bytes,1,4);
|
||||
#endif
|
||||
|
||||
#if gNB_TIMING_TRACE
|
||||
stop_meas(ulsch_turbo_decoding_stats);
|
||||
#endif
|
||||
stop_meas(&phy_vars_gNB->ulsch_ldpc_decoding_stats);
|
||||
}
|
||||
|
||||
if ((err_flag == 0) && (ret >= (ulsch->max_ldpc_iterations + 1))) {
|
||||
|
||||
@@ -44,7 +44,7 @@ void nr_idft(uint32_t *z, uint32_t Msc_PUSCH)
|
||||
|
||||
switch (Msc_PUSCH) {
|
||||
case 12:
|
||||
dft12((int16_t *)idft_in0, (int16_t *)idft_out0);
|
||||
dft(DFT_12,(int16_t *)idft_in0, (int16_t *)idft_out0,0);
|
||||
|
||||
#if defined(__x86_64__)||defined(__i386__)
|
||||
norm128 = _mm_set1_epi16(9459);
|
||||
@@ -63,135 +63,135 @@ void nr_idft(uint32_t *z, uint32_t Msc_PUSCH)
|
||||
break;
|
||||
|
||||
case 24:
|
||||
dft24(idft_in0, idft_out0, 1);
|
||||
dft(DFT_24,idft_in0, idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 36:
|
||||
dft36(idft_in0, idft_out0, 1);
|
||||
dft(DFT_36,idft_in0, idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 48:
|
||||
dft48(idft_in0, idft_out0, 1);
|
||||
dft(DFT_48,idft_in0, idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 60:
|
||||
dft60(idft_in0, idft_out0, 1);
|
||||
dft(DFT_60,idft_in0, idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 72:
|
||||
dft72(idft_in0, idft_out0, 1);
|
||||
dft(DFT_72,idft_in0, idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 96:
|
||||
dft96(idft_in0, idft_out0, 1);
|
||||
dft(DFT_96,idft_in0, idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 108:
|
||||
dft108(idft_in0, idft_out0, 1);
|
||||
dft(DFT_108,idft_in0, idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 120:
|
||||
dft120(idft_in0, idft_out0, 1);
|
||||
dft(DFT_120,idft_in0, idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 144:
|
||||
dft144(idft_in0, idft_out0, 1);
|
||||
dft(DFT_144,idft_in0, idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 180:
|
||||
dft180(idft_in0, idft_out0, 1);
|
||||
dft(DFT_180,idft_in0, idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 192:
|
||||
dft192(idft_in0, idft_out0, 1);
|
||||
dft(DFT_192,idft_in0, idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 216:
|
||||
dft216(idft_in0, idft_out0, 1);
|
||||
dft(DFT_216,idft_in0, idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 240:
|
||||
dft240(idft_in0, idft_out0, 1);
|
||||
dft(DFT_240,idft_in0, idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 288:
|
||||
dft288(idft_in0, idft_out0, 1);
|
||||
dft(DFT_288,idft_in0, idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 300:
|
||||
dft300(idft_in0, idft_out0, 1);
|
||||
dft(DFT_300,idft_in0, idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 324:
|
||||
dft324((int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
dft(DFT_324,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 360:
|
||||
dft360((int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
dft(DFT_360,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 384:
|
||||
dft384((int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
dft(DFT_384,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 432:
|
||||
dft432((int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
dft(DFT_432,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 480:
|
||||
dft480((int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
dft(DFT_480,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 540:
|
||||
dft540((int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
dft(DFT_540,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 576:
|
||||
dft576((int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
dft(DFT_576,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 600:
|
||||
dft600((int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
dft(DFT_600,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 648:
|
||||
dft648((int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
dft(DFT_648,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 720:
|
||||
dft720((int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
dft(DFT_720,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 768:
|
||||
dft768((int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
dft(DFT_768,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 864:
|
||||
dft864((int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
dft(DFT_864,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 900:
|
||||
dft900((int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
dft(DFT_900,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 960:
|
||||
dft960((int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
dft(DFT_960,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 972:
|
||||
dft972((int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
dft(DFT_972,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1080:
|
||||
dft1080((int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
dft(DFT_1080,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1152:
|
||||
dft1152((int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
dft(DFT_1152,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1200:
|
||||
dft1200(idft_in0, idft_out0, 1);
|
||||
dft(DFT_1200,idft_in0, idft_out0, 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -1093,7 +1093,7 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
//----------------------------------------------------------
|
||||
//--------------------- Channel estimation ---------------------
|
||||
//----------------------------------------------------------
|
||||
|
||||
start_meas(&gNB->ulsch_channel_estimation_stats);
|
||||
if (dmrs_symbol_flag == 1)
|
||||
nr_pusch_channel_estimation(gNB,
|
||||
nr_tti_rx,
|
||||
@@ -1101,17 +1101,19 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
symbol,
|
||||
bwp_start_subcarrier,
|
||||
rel15_ul);
|
||||
|
||||
stop_meas(&gNB->ulsch_channel_estimation_stats);
|
||||
//----------------------------------------------------------
|
||||
//--------------------- RBs extraction ---------------------
|
||||
//----------------------------------------------------------
|
||||
|
||||
start_meas(&gNB->ulsch_rbs_extraction_stats);
|
||||
nr_ulsch_extract_rbs_single(gNB->common_vars.rxdataF,
|
||||
gNB->pusch_vars[UE_id],
|
||||
symbol,
|
||||
dmrs_symbol_flag,
|
||||
rel15_ul,
|
||||
frame_parms);
|
||||
stop_meas(&gNB->ulsch_rbs_extraction_stats);
|
||||
|
||||
nr_ulsch_scale_channel(gNB->pusch_vars[UE_id]->ul_ch_estimates_ext,
|
||||
frame_parms,
|
||||
@@ -1140,6 +1142,7 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
|
||||
}
|
||||
|
||||
start_meas(&gNB->ulsch_channel_compensation_stats);
|
||||
nr_ulsch_channel_compensation(gNB->pusch_vars[UE_id]->rxdataF_ext,
|
||||
gNB->pusch_vars[UE_id]->ul_ch_estimates_ext,
|
||||
gNB->pusch_vars[UE_id]->ul_ch_mag0,
|
||||
@@ -1152,6 +1155,7 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
rel15_ul->qam_mod_order,
|
||||
rel15_ul->rb_size,
|
||||
gNB->pusch_vars[UE_id]->log2_maxh);
|
||||
stop_meas(&gNB->ulsch_channel_compensation_stats);
|
||||
|
||||
#ifdef NR_SC_FDMA
|
||||
nr_idft(&((uint32_t*)gNB->pusch_vars[UE_id]->rxdataF_ext[0])[symbol * rel15_ul->rb_size * NR_NB_SC_PER_RB], nb_re_pusch);
|
||||
@@ -1160,7 +1164,7 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
//----------------------------------------------------------
|
||||
//-------------------- LLRs computation --------------------
|
||||
//----------------------------------------------------------
|
||||
|
||||
start_meas(&gNB->ulsch_llr_stats);
|
||||
nr_ulsch_compute_llr(&gNB->pusch_vars[UE_id]->rxdataF_comp[0][symbol * rel15_ul->rb_size * NR_NB_SC_PER_RB],
|
||||
gNB->pusch_vars[UE_id]->ul_ch_mag0,
|
||||
gNB->pusch_vars[UE_id]->ul_ch_magb0,
|
||||
@@ -1169,6 +1173,7 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
nb_re_pusch,
|
||||
symbol,
|
||||
rel15_ul->qam_mod_order);
|
||||
stop_meas(&gNB->ulsch_llr_stats);
|
||||
|
||||
gNB->pusch_vars[UE_id]->rxdataF_ext_offset = gNB->pusch_vars[UE_id]->rxdataF_ext_offset + nb_re_pusch - gNB->pusch_vars[UE_id]->ptrs_sc_per_ofdm_symbol;
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "PHY/NR_UE_ESTIMATION/nr_estimation.h"
|
||||
#include "PHY/impl_defs_top.h"
|
||||
//#include "openair2/LAYER2/MAC/mac_proto.h"
|
||||
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
|
||||
@@ -405,39 +405,39 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
|
||||
}
|
||||
|
||||
void (*idft)(int16_t *,int16_t *, int);
|
||||
idft_size_idx_t idftsizeidx;
|
||||
|
||||
switch (ue->frame_parms.ofdm_symbol_size) {
|
||||
case 128:
|
||||
idft = idft128;
|
||||
idftsizeidx = IDFT_128;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
idft = idft256;
|
||||
idftsizeidx = IDFT_256;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
idft = idft512;
|
||||
idftsizeidx = IDFT_512;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
idft = idft1024;
|
||||
idftsizeidx = IDFT_1024;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
idft = idft1536;
|
||||
idftsizeidx = IDFT_1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
idft = idft2048;
|
||||
idftsizeidx = IDFT_2048;
|
||||
break;
|
||||
|
||||
case 3072:
|
||||
idft = idft3072;
|
||||
idftsizeidx = IDFT_3072;
|
||||
break;
|
||||
|
||||
case 4096:
|
||||
idft = idft4096;
|
||||
idftsizeidx = IDFT_4096;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -453,7 +453,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
if (ue->pbch_vars[eNB_offset]->dl_ch_estimates[(p<<1)+aarx])
|
||||
{
|
||||
LOG_D(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d ch_offset %d\n", Ns, ue->current_thread_id[Ns], symbol, ch_offset);
|
||||
idft((int16_t*) &ue->pbch_vars[eNB_offset]->dl_ch_estimates[(p<<1)+aarx][ch_offset],
|
||||
idft(idftsizeidx,
|
||||
(int16_t*) &ue->pbch_vars[eNB_offset]->dl_ch_estimates[(p<<1)+aarx][ch_offset],
|
||||
(int16_t*) ue->pbch_vars[eNB_offset]->dl_ch_estimates_time[(p<<1)+aarx],1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -398,7 +398,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
// This is after cyclic prefix (Ncp<<1 samples for 30.72 Ms/s, Ncp<<2 samples for 61.44 Ms/s
|
||||
prach2 = prach+(Ncp<<1);
|
||||
if (prach_fmt == 0) { //24576 samples @ 30.72 Ms/s, 49152 samples @ 61.44 Ms/s
|
||||
idft49152(prachF,prach2,1);
|
||||
idft(IDFT_49152,prachF,prach2,1);
|
||||
// here we have |empty | Prach49152|
|
||||
memmove(prach,prach+(49152<<1),(Ncp<<3));
|
||||
// here we have |Prefix | Prach49152|
|
||||
@@ -406,7 +406,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
dftlen=49152;
|
||||
}
|
||||
else if (prach_fmt == 1) { //24576 samples @ 30.72 Ms/s, 49152 samples @ 61.44 Ms/s
|
||||
idft49152(prachF,prach2,1);
|
||||
idft(IDFT_49152,prachF,prach2,1);
|
||||
memmove(prach2+(49152<<1),prach2,(49152<<2));
|
||||
// here we have |empty | Prach49152 | Prach49152|
|
||||
memmove(prach,prach+(49152<<2),(Ncp<<3));
|
||||
@@ -415,7 +415,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
dftlen=49152;
|
||||
}
|
||||
else if (prach_fmt == 2) { //24576 samples @ 30.72 Ms/s, 49152 samples @ 61.44 Ms/s
|
||||
idft49152(prachF,prach2,1);
|
||||
idft(IDFT_49152,prachF,prach2,1);
|
||||
memmove(prach2+(49152<<1),prach2,(49152<<2));
|
||||
// here we have |empty | Prach49152 | Prach49152| empty49152 | empty49152
|
||||
memmove(prach2+(49152<<2),prach2,(49152<<3));
|
||||
@@ -426,7 +426,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
dftlen=49152;
|
||||
}
|
||||
else if (prach_fmt == 3) { // //6144 samples @ 30.72 Ms/s, 12288 samples @ 61.44 Ms/s
|
||||
idft12288(prachF,prach2,1);
|
||||
idft(IDFT_12288,prachF,prach2,1);
|
||||
memmove(prach2+(12288<<1),prach2,(12288<<2));
|
||||
// here we have |empty | Prach12288 | Prach12288| empty12288 | empty12288
|
||||
memmove(prach2+(12288<<2),prach2,(12288<<3));
|
||||
@@ -438,7 +438,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
}
|
||||
else if (prach_fmt == 0xa1 || prach_fmt == 0xb1 || prach_fmt == 0xc0) {
|
||||
prach2 = prach+(Ncp<<1);
|
||||
idft2048(prachF,prach2,1);
|
||||
idft(IDFT_2048,prachF,prach2,1);
|
||||
dftlen=2048;
|
||||
// here we have |empty | Prach2048 |
|
||||
if (prach_fmt != 0xc0) {
|
||||
@@ -450,7 +450,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
// here we have |Prefix | Prach2048 | Prach2048 (if ! 0xc0) |
|
||||
}
|
||||
else if (prach_fmt == 0xa2 || prach_fmt == 0xb2) { // 6x2048
|
||||
idft2048(prachF,prach2,1);
|
||||
idft(IDFT_2048,prachF,prach2,1);
|
||||
dftlen=2048;
|
||||
// here we have |empty | Prach2048 |
|
||||
memmove(prach2+(2048<<1),prach2,(2048<<2));
|
||||
@@ -463,7 +463,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
}
|
||||
else if (prach_fmt == 0xa3 || prach_fmt == 0xb3) { // 6x2048
|
||||
prach2 = prach+(Ncp<<1);
|
||||
idft2048(prachF,prach2,1);
|
||||
idft(IDFT_2048,prachF,prach2,1);
|
||||
dftlen=2048;
|
||||
// here we have |empty | Prach2048 |
|
||||
memmove(prach2+(2048<<1),prach2,(2048<<2));
|
||||
@@ -477,7 +477,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (2048*6)+Ncp;
|
||||
}
|
||||
else if (prach_fmt == 0xb4) { // 12x2048
|
||||
idft2048(prachF,prach2,1);
|
||||
idft(IDFT_2048,prachF,prach2,1);
|
||||
dftlen=2048;
|
||||
// here we have |empty | Prach2048 |
|
||||
memmove(prach2+(2048<<1),prach2,(2048<<2));
|
||||
@@ -498,7 +498,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
Ncp = (Ncp*3)/2;
|
||||
prach2 = prach+(Ncp<<1);
|
||||
if (prach_fmt == 0) {
|
||||
idft36864(prachF,prach2,1);
|
||||
idft(IDFT_36864,prachF,prach2,1);
|
||||
dftlen=36864;
|
||||
// here we have |empty | Prach73728|
|
||||
memmove(prach,prach+(36864<<1),(Ncp<<2));
|
||||
@@ -506,7 +506,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (36864*1)+Ncp;
|
||||
}
|
||||
else if (prach_fmt == 1) {
|
||||
idft36864(prachF,prach2,1);
|
||||
idft(IDFT_36864,prachF,prach2,1);
|
||||
dftlen=36864;
|
||||
memmove(prach2+(36864<<1),prach2,(36864<<2));
|
||||
// here we have |empty | Prach73728 | Prach73728|
|
||||
@@ -515,7 +515,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (36864*2)+Ncp;
|
||||
}
|
||||
if (prach_fmt == 2) {
|
||||
idft36864(prachF,prach2,1);
|
||||
idft(IDFT_36864,prachF,prach2,1);
|
||||
dftlen=36864;
|
||||
memmove(prach2+(36864<<1),prach2,(36864<<2));
|
||||
// here we have |empty | Prach73728 | Prach73728| empty73728 | empty73728
|
||||
@@ -526,7 +526,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (36864*4)+Ncp;
|
||||
}
|
||||
else if (prach_fmt == 3) {
|
||||
idft9216(prachF,prach2,1);
|
||||
idft(IDFT_9216,prachF,prach2,1);
|
||||
dftlen=36864;
|
||||
memmove(prach2+(9216<<1),prach2,(9216<<2));
|
||||
// here we have |empty | Prach9216 | Prach9216| empty9216 | empty9216
|
||||
@@ -537,7 +537,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (9216*4)+Ncp;
|
||||
}
|
||||
else if (prach_fmt == 0xa1 || prach_fmt == 0xb1 || prach_fmt == 0xc0) {
|
||||
idft1536(prachF,prach2,1);
|
||||
idft(IDFT_1536,prachF,prach2,1);
|
||||
dftlen=1536;
|
||||
// here we have |empty | Prach1536 |
|
||||
if (prach_fmt != 0xc0)
|
||||
@@ -547,7 +547,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (1536*2)+Ncp;
|
||||
}
|
||||
else if (prach_fmt == 0xa2 || prach_fmt == 0xb2) { // 6x1536
|
||||
idft1536(prachF,prach2,1);
|
||||
idft(IDFT_1536,prachF,prach2,1);
|
||||
dftlen=1536;
|
||||
// here we have |empty | Prach1536 |
|
||||
memmove(prach2+(1536<<1),prach2,(1536<<2));
|
||||
@@ -559,7 +559,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (1536*4)+Ncp;
|
||||
}
|
||||
else if (prach_fmt == 0xa3 || prach_fmt == 0xb3) { // 6x1536
|
||||
idft1536(prachF,prach2,1);
|
||||
idft(IDFT_1536,prachF,prach2,1);
|
||||
dftlen=1536;
|
||||
// here we have |empty | Prach1536 |
|
||||
memmove(prach2+(1536<<1),prach2,(1536<<2));
|
||||
@@ -573,7 +573,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (1536*6)+Ncp;
|
||||
}
|
||||
else if (prach_fmt == 0xb4) { // 12x1536
|
||||
idft1536(prachF,prach2,1);
|
||||
idft(IDFT_1536,prachF,prach2,1);
|
||||
dftlen=1536;
|
||||
// here we have |empty | Prach1536 |
|
||||
memmove(prach2+(1536<<1),prach2,(1536<<2));
|
||||
@@ -595,7 +595,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
Ncp<<=2;
|
||||
prach2 = prach+(Ncp<<1);
|
||||
if (prach_fmt == 0) { //24576 samples @ 30.72 Ms/s, 98304 samples @ 122.88 Ms/s
|
||||
idft98304(prachF,prach2,1);
|
||||
idft(IDFT_98304,prachF,prach2,1);
|
||||
dftlen=98304;
|
||||
// here we have |empty | Prach98304|
|
||||
memmove(prach,prach+(98304<<1),(Ncp<<2));
|
||||
@@ -603,7 +603,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (98304*1)+Ncp;
|
||||
}
|
||||
else if (prach_fmt == 1) {
|
||||
idft98304(prachF,prach2,1);
|
||||
idft(IDFT_98304,prachF,prach2,1);
|
||||
dftlen=98304;
|
||||
memmove(prach2+(98304<<1),prach2,(98304<<2));
|
||||
// here we have |empty | Prach98304 | Prach98304|
|
||||
@@ -612,7 +612,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (98304*2)+Ncp;
|
||||
}
|
||||
else if (prach_fmt == 2) {
|
||||
idft98304(prachF,prach2,1);
|
||||
idft(IDFT_98304,prachF,prach2,1);
|
||||
dftlen=98304;
|
||||
memmove(prach2+(98304<<1),prach2,(98304<<2));
|
||||
// here we have |empty | Prach98304 | Prach98304| empty98304 | empty98304
|
||||
@@ -623,7 +623,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (98304*4)+Ncp;
|
||||
}
|
||||
else if (prach_fmt == 3) { // 4x6144, Ncp 3168
|
||||
idft24576(prachF,prach2,1);
|
||||
idft(IDFT_24576,prachF,prach2,1);
|
||||
dftlen=24576;
|
||||
memmove(prach2+(24576<<1),prach2,(24576<<2));
|
||||
// here we have |empty | Prach24576 | Prach24576| empty24576 | empty24576
|
||||
@@ -634,7 +634,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (24576*4)+(Ncp<<1);
|
||||
}
|
||||
else if (prach_fmt == 0xa1 || prach_fmt == 0xb1 || prach_fmt == 0xc0) {
|
||||
idft4096(prachF,prach2,1);
|
||||
idft(IDFT_4096,prachF,prach2,1);
|
||||
dftlen=4096;
|
||||
// here we have |empty | Prach4096 |
|
||||
if (prach_fmt != 0xc0) {
|
||||
@@ -647,7 +647,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
|
||||
}
|
||||
else if (prach_fmt == 0xa2 || prach_fmt == 0xb2) { // 4x4096
|
||||
idft4096(prachF,prach2,1);
|
||||
idft(IDFT_4096,prachF,prach2,1);
|
||||
dftlen=4096;
|
||||
// here we have |empty | Prach4096 |
|
||||
memmove(prach2+(4096<<1),prach2,(4096<<2));
|
||||
@@ -659,7 +659,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (4096*4)+Ncp;
|
||||
}
|
||||
else if (prach_fmt == 0xa3 || prach_fmt == 0xb3) { // 6x4096
|
||||
idft4096(prachF,prach2,1);
|
||||
idft(IDFT_4096,prachF,prach2,1);
|
||||
dftlen=4096;
|
||||
// here we have |empty | Prach4096 |
|
||||
memmove(prach2+(4096<<1),prach2,(4096<<2));
|
||||
@@ -673,7 +673,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (4096*6)+Ncp;
|
||||
}
|
||||
else if (prach_fmt == 0xb4) { // 12x4096
|
||||
idft4096(prachF,prach2,1);
|
||||
idft(IDFT_4096,prachF,prach2,1);
|
||||
dftlen=4096;
|
||||
// here we have |empty | Prach4096 |
|
||||
memmove(prach2+(4096<<1),prach2,(4096<<2));
|
||||
@@ -693,7 +693,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
Ncp = (Ncp*3);
|
||||
prach2 = prach+(Ncp<<1);
|
||||
if (prach_fmt == 0) {
|
||||
idft73728(prachF,prach2,1);
|
||||
idft(IDFT_73728,prachF,prach2,1);
|
||||
dftlen=73728;
|
||||
// here we have |empty | Prach73728|
|
||||
memmove(prach,prach+(73728<<1),(Ncp<<4));
|
||||
@@ -701,7 +701,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (73728*1)+Ncp;
|
||||
}
|
||||
else if (prach_fmt == 1) {
|
||||
idft73728(prachF,prach2,1);
|
||||
idft(IDFT_73728,prachF,prach2,1);
|
||||
dftlen=73728;
|
||||
memmove(prach2+(73728<<1),prach2,(73728<<2));
|
||||
// here we have |empty | Prach73728 | Prach73728|
|
||||
@@ -710,7 +710,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (73728*2)+Ncp;
|
||||
}
|
||||
if (prach_fmt == 2) {
|
||||
idft73728(prachF,prach2,1);
|
||||
idft(IDFT_73728,prachF,prach2,1);
|
||||
dftlen=73728;
|
||||
memmove(prach2+(73728<<1),prach2,(73728<<2));
|
||||
// here we have |empty | Prach73728 | Prach73728| empty73728 | empty73728
|
||||
@@ -721,7 +721,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (73728*4)+Ncp;
|
||||
}
|
||||
else if (prach_fmt == 3) {
|
||||
idft18432(prachF,prach2,1);
|
||||
idft(IDFT_18432,prachF,prach2,1);
|
||||
dftlen=18432;
|
||||
memmove(prach2+(18432<<1),prach2,(18432<<2));
|
||||
// here we have |empty | Prach18432 | Prach18432| empty18432 | empty18432
|
||||
@@ -732,7 +732,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (18432*4)+Ncp;
|
||||
}
|
||||
else if (prach_fmt == 0xa1 || prach_fmt == 0xb1 || prach_fmt == 0xc0) {
|
||||
idft3072(prachF,prach2,1);
|
||||
idft(IDFT_3072,prachF,prach2,1);
|
||||
dftlen=3072;
|
||||
// here we have |empty | Prach3072 |
|
||||
if (prach_fmt != 0xc0) {
|
||||
@@ -744,7 +744,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
// here we have |Prefix | Prach3072 | Prach3072 (if ! 0xc0) |
|
||||
}
|
||||
else if (prach_fmt == 0xa3 || prach_fmt == 0xb3) { // 6x3072
|
||||
idft3072(prachF,prach2,1);
|
||||
idft(IDFT_3072,prachF,prach2,1);
|
||||
dftlen=3072;
|
||||
// here we have |empty | Prach3072 |
|
||||
memmove(prach2+(3072<<1),prach2,(3072<<2));
|
||||
@@ -758,7 +758,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (3072*6)+Ncp;
|
||||
}
|
||||
else if (prach_fmt == 0xa2 || prach_fmt == 0xb2) { // 4x3072
|
||||
idft3072(prachF,prach2,1);
|
||||
idft(IDFT_3072,prachF,prach2,1);
|
||||
dftlen=3072;
|
||||
// here we have |empty | Prach3072 |
|
||||
memmove(prach2+(3072<<1),prach2,(3072<<2));
|
||||
@@ -770,7 +770,7 @@ int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe,
|
||||
prach_len = (3072*4)+Ncp;
|
||||
}
|
||||
else if (prach_fmt == 0xb4) { // 12x3072
|
||||
idft3072(prachF,prach2,1);
|
||||
idft(IDFT_3072,prachF,prach2,1);
|
||||
dftlen=3072;
|
||||
// here we have |empty | Prach3072 |
|
||||
memmove(prach2+(3072<<1),prach2,(3072<<2));
|
||||
|
||||
@@ -356,11 +356,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
Kr_bytes = Kr>>3;
|
||||
#endif
|
||||
|
||||
///////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
opp_enabled=0;
|
||||
|
||||
///////////////////////// c---->| LDCP coding |---->d /////////////////////////
|
||||
///////////
|
||||
|
||||
@@ -386,6 +381,12 @@ opp_enabled=0;
|
||||
//for (int i=0;i<68*384;i++)
|
||||
// printf("channel_input[%d]=%d\n",i,channel_input[i]);
|
||||
|
||||
int temp_opp = 0;
|
||||
|
||||
if (opp_enabled) {
|
||||
opp_enabled = 0;
|
||||
temp_opp = 1;
|
||||
}
|
||||
|
||||
|
||||
/*printf("output %d %d %d %d %d \n", harq_process->d[0][0], harq_process->d[0][1], harq_process->d[r][2],harq_process->d[0][3], harq_process->d[0][4]);
|
||||
@@ -402,10 +403,12 @@ opp_enabled=0;
|
||||
//stop_meas(te_stats);
|
||||
//printf("end ldpc encoder -- output\n");
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
write_output("ulsch_enc_input0.m","enc_in0",&harq_process->c[0][0],Kr_bytes,1,4);
|
||||
write_output("ulsch_enc_output0.m","enc0",&harq_process->d[0][0],(3*8*Kr_bytes)+12,1,4);
|
||||
write_output("ulsch_enc_input0.m","enc_in0",&harq_process->c[0][0],Kr_bytes,1,4);
|
||||
write_output("ulsch_enc_output0.m","enc0",&harq_process->d[0][0],(3*8*Kr_bytes)+12,1,4);
|
||||
#endif
|
||||
|
||||
if (temp_opp) opp_enabled = 1;
|
||||
|
||||
///////////
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
*
|
||||
* PARAMETERS : size of ofdm symbol
|
||||
*
|
||||
* RETURN : function idft
|
||||
* RETURN : index pointing to the dft func in the dft library
|
||||
*
|
||||
* DESCRIPTION : get idft function depending of ofdm size
|
||||
*
|
||||
@@ -60,45 +60,45 @@
|
||||
|
||||
//#define DBG_PSS_NR
|
||||
|
||||
void *get_idft(int ofdm_symbol_size)
|
||||
idft_size_idx_t get_idft(int ofdm_symbol_size)
|
||||
{
|
||||
void (*idft)(int16_t *,int16_t *, int);
|
||||
|
||||
|
||||
|
||||
switch (ofdm_symbol_size) {
|
||||
case 128:
|
||||
idft = idft128;
|
||||
return IDFT_128;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
idft = idft256;
|
||||
return IDFT_256;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
idft = idft512;
|
||||
return IDFT_512;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
idft = idft1024;
|
||||
return IDFT_1024;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
idft = idft1536;
|
||||
return IDFT_1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
idft = idft2048;
|
||||
return IDFT_2048;
|
||||
break;
|
||||
|
||||
case 3072:
|
||||
idft = idft3072;
|
||||
return IDFT_3072;
|
||||
break;
|
||||
|
||||
case 4096:
|
||||
idft = idft4096;
|
||||
return IDFT_4096;
|
||||
break;
|
||||
|
||||
case 8192:
|
||||
idft = idft8192;
|
||||
return IDFT_8192;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -106,7 +106,7 @@ void *get_idft(int ofdm_symbol_size)
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
return idft;
|
||||
return IDFT_SIZE_IDXTABLESIZE; // never reached and will trigger assertion in idft function
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
@@ -121,41 +121,41 @@ void *get_idft(int ofdm_symbol_size)
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
void *get_dft(int ofdm_symbol_size)
|
||||
dft_size_idx_t get_dft(int ofdm_symbol_size)
|
||||
{
|
||||
void (*dft)(int16_t *,int16_t *, int);
|
||||
|
||||
|
||||
switch (ofdm_symbol_size) {
|
||||
case 128:
|
||||
dft = dft128;
|
||||
return DFT_128;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
dft = dft256;
|
||||
return DFT_256;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
dft = dft512;
|
||||
return DFT_512;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
dft = dft1024;
|
||||
return DFT_1024;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
dft = dft1536;
|
||||
return DFT_1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
dft = dft2048;
|
||||
return DFT_2048;
|
||||
break;
|
||||
|
||||
case 4096:
|
||||
dft = dft4096;
|
||||
return DFT_4096;
|
||||
break;
|
||||
|
||||
case 8192:
|
||||
dft = dft8192;
|
||||
return DFT_8192;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -163,7 +163,7 @@ void *get_dft(int ofdm_symbol_size)
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
return dft;
|
||||
return DFT_SIZE_IDXTABLESIZE; // never reached and will trigger assertion in idft function;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
@@ -191,7 +191,7 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2)
|
||||
unsigned int size = length * IQ_SIZE; /* i & q */
|
||||
int16_t *primary_synchro = primary_synchro_nr[N_ID_2]; /* pss in complex with alternatively i then q */
|
||||
int16_t *primary_synchro2 = primary_synchro_nr2[N_ID_2]; /* pss in complex with alternatively i then q */
|
||||
void (*idft)(int16_t *,int16_t *, int);
|
||||
|
||||
|
||||
#define INITIAL_PSS_NR (7)
|
||||
const int x_initial[INITIAL_PSS_NR] = {0, 1, 1 , 0, 1, 1, 1};
|
||||
@@ -282,9 +282,10 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2)
|
||||
|
||||
/* IFFT will give temporal signal of Pss */
|
||||
|
||||
idft = get_idft(length);
|
||||
|
||||
idft(synchroF_tmp, /* complex input */
|
||||
|
||||
|
||||
idft((int16_t)get_idft(length),
|
||||
synchroF_tmp, /* complex input */
|
||||
synchro_tmp, /* complex output */
|
||||
1); /* scaling factor */
|
||||
|
||||
@@ -312,6 +313,7 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
/* it allows checking that process of idft on a signal and then dft gives same signal with limited errors */
|
||||
@@ -323,10 +325,11 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2)
|
||||
|
||||
bzero(synchroF_tmp, size);
|
||||
|
||||
void (*dft)(int16_t *,int16_t *, int) = get_dft(length);
|
||||
|
||||
|
||||
/* get pss in the time domain by applying an inverse FFT */
|
||||
dft(synchro_tmp, /* complex input */
|
||||
dft((int16_t)get_dft(length),
|
||||
synchro_tmp, /* complex input */
|
||||
synchroF_tmp, /* complex output */
|
||||
1); /* scaling factor */
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ void insert_sss_nr(int16_t *sss_time,
|
||||
}
|
||||
|
||||
/* get sss in the frequency domain by applying an inverse FFT */
|
||||
idft2048(synchroF_tmp, /* complex input */
|
||||
idft(IDFT_2048,synchroF_tmp, /* complex input */
|
||||
synchro_tmp, /* complex output */
|
||||
1); /* scaling factor */
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file openair1/PHY/CODING/coding_nr_load.c
|
||||
* \brief: load library implementing coding/decoding algorithms
|
||||
* \author Francois TABURET
|
||||
* \date 2020
|
||||
* \version 0.1
|
||||
* \company NOKIA BellLabs France
|
||||
* \email: francois.taburet@nokia-bell-labs.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#define _GNU_SOURCE
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include "assertions.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#define OAIDFTS_LOADER
|
||||
#include "tools_defs.h"
|
||||
#include "common/config/config_userapi.h"
|
||||
#include "common/utils/load_module_shlib.h"
|
||||
|
||||
|
||||
/* function description array, to be used when loading the dfts/idfts lib */
|
||||
static loader_shlibfunc_t shlib_fdesc[2];
|
||||
static char *arg[64]={"phytest","-O","cmdlineonly::dbgl0"};
|
||||
|
||||
|
||||
int load_dftslib(void) {
|
||||
|
||||
char *ptr = (char*)config_get_if();
|
||||
if ( ptr==NULL ) {// phy simulators, config module possibly not loaded
|
||||
load_configmodule(3,(char **)arg,CONFIG_ENABLECMDLINEONLY) ;
|
||||
logInit();
|
||||
}
|
||||
shlib_fdesc[0].fname = "dft";
|
||||
shlib_fdesc[1].fname = "idft";
|
||||
int ret=load_module_shlib("dfts",shlib_fdesc,sizeof(shlib_fdesc)/sizeof(loader_shlibfunc_t),NULL);
|
||||
AssertFatal( (ret >= 0),"Error loading dftsc decoder");
|
||||
dft = (dftfunc_t)shlib_fdesc[0].fptr;
|
||||
idft = (idftfunc_t)shlib_fdesc[1].fptr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ void phy_scope_gNB(FD_phy_scope_gnb *form,
|
||||
int Qm = 2;
|
||||
|
||||
/*
|
||||
if (!RC.nrmac[0]->UE_list.active[UE_id])
|
||||
if (!RC.nrmac[0]->UE_info.active[UE_id])
|
||||
return;
|
||||
|
||||
// choose max MCS to compute coded_bits_per_codeword
|
||||
|
||||
@@ -31,11 +31,10 @@
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
#define OAIDFTS_MAIN
|
||||
#ifndef MR_MAIN
|
||||
#include "PHY/defs_common.h"
|
||||
#include "PHY/impl_defs_top.h"
|
||||
#include "tools_defs.h"
|
||||
#else
|
||||
#include "time_meas.h"
|
||||
#include "LOG/log.h"
|
||||
@@ -64,6 +63,9 @@ const static int16_t reflip[32] __attribute__((aligned(32))) = {1,-1,1,-1,1,-1,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
static inline void cmac(__m128i a,__m128i b, __m128i *re32, __m128i *im32) __attribute__((always_inline));
|
||||
static inline void cmac(__m128i a,__m128i b, __m128i *re32, __m128i *im32)
|
||||
@@ -2592,7 +2594,7 @@ const static int16_t tw64c[96] __attribute__((aligned(32))) = {
|
||||
#endif
|
||||
|
||||
#ifndef __AVX2__
|
||||
void dft64(int16_t *x,int16_t *y,int scale)
|
||||
void dft64(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd_q15_t xtmp[16],ytmp[16],*tw64a_128=(simd_q15_t *)tw64a,*tw64b_128=(simd_q15_t *)tw64b,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y;
|
||||
@@ -2706,7 +2708,7 @@ void dft64(int16_t *x,int16_t *y,int scale)
|
||||
}
|
||||
|
||||
#else // __AVX2__
|
||||
void dft64(int16_t *x,int16_t *y,int scale)
|
||||
void dft64(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd256_q15_t xtmp[16],ytmp[16],*tw64a_256=(simd256_q15_t *)tw64a,*tw64b_256=(simd256_q15_t *)tw64b,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y;
|
||||
@@ -2854,7 +2856,7 @@ void dft64(int16_t *x,int16_t *y,int scale)
|
||||
#endif
|
||||
|
||||
#ifndef __AVX2__
|
||||
void idft64(int16_t *x,int16_t *y,int scale)
|
||||
void idft64(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd_q15_t xtmp[16],ytmp[16],*tw64a_128=(simd_q15_t *)tw64,*tw64b_128=(simd_q15_t *)tw64c,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y;
|
||||
@@ -2946,7 +2948,7 @@ void idft64(int16_t *x,int16_t *y,int scale)
|
||||
}
|
||||
|
||||
#else // __AVX2__
|
||||
void idft64(int16_t *x,int16_t *y,int scale)
|
||||
void idft64(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd256_q15_t xtmp[16],ytmp[16],*tw64a_256=(simd256_q15_t *)tw64,*tw64b_256=(simd256_q15_t *)tw64c,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y;
|
||||
@@ -3056,7 +3058,7 @@ int16_t tw128b[128] __attribute__((aligned(32))) = {0,32767,-1608,32727,-3212,32
|
||||
int16_t tw128c[128] __attribute__((aligned(32))) = {0,32767,1608,32727,3212,32609,4808,32412,6393,32137,7962,31785,9512,31356,11039,30851,12540,30272,14010,29621,15447,28897,16846,28105,18205,27244,19520,26318,20788,25329,22005,24278,23170,23169,24279,22004,25330,20787,26319,19519,27245,18204,28106,16845,28898,15446,29622,14009,30273,12539,30852,11038,31357,9511,31786,7961,32138,6392,32413,4807,32610,3211,32728,1607,32767,0,32728,-1608,32610,-3212,32413,-4808,32138,-6393,31786,-7962,31357,-9512,30852,-11039,30273,-12540,29622,-14010,28898,-15447,28106,-16846,27245,-18205,26319,-19520,25330,-20788,24279,-22005,23170,-23170,22005,-24279,20788,-25330,19520,-26319,18205,-27245,16846,-28106,15447,-28898,14010,-29622,12540,-30273,11039,-30852,9512,-31357,7962,-31786,6393,-32138,4808,-32413,3212,-32610,1608,-32728};
|
||||
|
||||
#ifndef __AVX2__
|
||||
void dft128(int16_t *x,int16_t *y,int scale)
|
||||
void dft128(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simdshort_q15_t xtmp[64],*x64 = (simdshort_q15_t *)x;
|
||||
@@ -3163,7 +3165,7 @@ void dft128(int16_t *x,int16_t *y,int scale)
|
||||
}
|
||||
|
||||
#else // __AVX2__
|
||||
void dft128(int16_t *x,int16_t *y,int scale)
|
||||
void dft128(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd256_q15_t xtmp[16],*x256 = (simd256_q15_t *)x;
|
||||
@@ -3233,7 +3235,7 @@ void dft128(int16_t *x,int16_t *y,int scale)
|
||||
#endif
|
||||
|
||||
#ifndef __AVX2__
|
||||
void idft128(int16_t *x,int16_t *y,int scale)
|
||||
void idft128(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simdshort_q15_t xtmp[64],*x64 = (simdshort_q15_t *)x;
|
||||
@@ -3332,7 +3334,7 @@ void idft128(int16_t *x,int16_t *y,int scale)
|
||||
}
|
||||
|
||||
#else // __AVX2__
|
||||
void idft128(int16_t *x,int16_t *y,int scale)
|
||||
void idft128(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd256_q15_t xtmp[16],*x256 = (simd256_q15_t *)x;
|
||||
@@ -3405,7 +3407,7 @@ int16_t tw256b[384] __attribute__((aligned(32))) = {0,32767,-805,32757,-1608,327
|
||||
0,32767,-2411,32678,-4808,32412,-7180,31970,-9512,31356,-11793,30571,-14010,29621,-16151,28510,-18205,27244,-20160,25831,-22005,24278,-23732,22594,-25330,20787,-26790,18867,-28106,16845,-29269,14732,-30273,12539,-31114,10278,-31786,7961,-32285,5601,-32610,3211,-32758,804,-32728,-1608,-32521,-4012,-32138,-6393,-31581,-8740,-30852,-11039,-29956,-13279,-28898,-15447,-27684,-17531,-26319,-19520,-24812,-21403,-23170,-23170,-21403,-24812,-19520,-26319,-17531,-27684,-15447,-28898,-13279,-29956,-11039,-30852,-8740,-31581,-6393,-32138,-4012,-32521,-1608,-32728,804,-32758,3211,-32610,5601,-32285,7961,-31786,10278,-31114,12539,-30273,14732,-29269,16845,-28106,18867,-26790,20787,-25330,22594,-23732,24278,-22005,25831,-20160,27244,-18205,28510,-16151,29621,-14010,30571,-11793,31356,-9512,31970,-7180,32412,-4808,32678,-2411
|
||||
};
|
||||
#ifndef __AVX2__
|
||||
void dft256(int16_t *x,int16_t *y,int scale)
|
||||
void dft256(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd_q15_t xtmp[64],ytmp[64],*tw256a_128p=(simd_q15_t *)tw256a,*tw256b_128p=(simd_q15_t *)tw256b,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
|
||||
@@ -3517,7 +3519,7 @@ void dft256(int16_t *x,int16_t *y,int scale)
|
||||
|
||||
|
||||
|
||||
void idft256(int16_t *x,int16_t *y,int scale)
|
||||
void idft256(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd_q15_t xtmp[64],ytmp[64],*tw256_128p=(simd_q15_t *)tw256,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
|
||||
@@ -3575,7 +3577,7 @@ void idft256(int16_t *x,int16_t *y,int scale)
|
||||
|
||||
#else //__AVX2__
|
||||
|
||||
void dft256(int16_t *x,int16_t *y,int scale)
|
||||
void dft256(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd256_q15_t xtmp[32],ytmp[32],*tw256a_256p=(simd256_q15_t *)tw256a,*tw256b_256p=(simd256_q15_t *)tw256b,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y;
|
||||
@@ -3667,7 +3669,7 @@ void dft256(int16_t *x,int16_t *y,int scale)
|
||||
|
||||
}
|
||||
|
||||
void idft256(int16_t *x,int16_t *y,int scale)
|
||||
void idft256(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd256_q15_t xtmp[32],ytmp[32],*tw256_256p=(simd256_q15_t *)tw256,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y;
|
||||
@@ -3772,7 +3774,7 @@ int16_t tw512c[512] __attribute__((aligned(32))) = {
|
||||
};
|
||||
|
||||
#ifndef __AVX2__
|
||||
void dft512(int16_t *x,int16_t *y,int scale)
|
||||
void dft512(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simdshort_q15_t xtmp[256],*xtmpp,*x64 = (simdshort_q15_t *)x;
|
||||
@@ -3892,7 +3894,7 @@ void dft512(int16_t *x,int16_t *y,int scale)
|
||||
|
||||
}
|
||||
|
||||
void idft512(int16_t *x,int16_t *y,int scale)
|
||||
void idft512(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simdshort_q15_t xtmp[256],*xtmpp,*x64 = (simdshort_q15_t *)x;
|
||||
@@ -3984,7 +3986,7 @@ void idft512(int16_t *x,int16_t *y,int scale)
|
||||
|
||||
#else //__AVX2__
|
||||
|
||||
void dft512(int16_t *x,int16_t *y,int scale)
|
||||
void dft512(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd256_q15_t xtmp[64],*x256 = (simd256_q15_t *)x;
|
||||
@@ -4066,7 +4068,7 @@ void dft512(int16_t *x,int16_t *y,int scale)
|
||||
|
||||
}
|
||||
|
||||
void idft512(int16_t *x,int16_t *y,int scale)
|
||||
void idft512(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd256_q15_t xtmp[64],*x256 = (simd256_q15_t *)x;
|
||||
@@ -4153,7 +4155,7 @@ void idft512(int16_t *x,int16_t *y,int scale)
|
||||
int16_t tw1024[1536] __attribute__((aligned(32)));
|
||||
|
||||
#ifndef __AVX2__
|
||||
void dft1024(int16_t *x,int16_t *y,int scale)
|
||||
void dft1024(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd_q15_t xtmp[256],ytmp[256],*tw1024_128p=(simd_q15_t *)tw1024,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
|
||||
@@ -4209,7 +4211,7 @@ void dft1024(int16_t *x,int16_t *y,int scale)
|
||||
|
||||
}
|
||||
|
||||
void idft1024(int16_t *x,int16_t *y,int scale)
|
||||
void idft1024(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd_q15_t xtmp[256],ytmp[256],*tw1024_128p=(simd_q15_t *)tw1024,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
|
||||
@@ -4266,7 +4268,7 @@ void idft1024(int16_t *x,int16_t *y,int scale)
|
||||
}
|
||||
|
||||
#else //__AVX2__
|
||||
void dft1024(int16_t *x,int16_t *y,int scale)
|
||||
void dft1024(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd256_q15_t xtmp[128],ytmp[128],*tw1024_256p=(simd256_q15_t *)tw1024,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y;
|
||||
@@ -4322,7 +4324,7 @@ void dft1024(int16_t *x,int16_t *y,int scale)
|
||||
|
||||
}
|
||||
|
||||
void idft1024(int16_t *x,int16_t *y,int scale)
|
||||
void idft1024(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd256_q15_t xtmp[128],ytmp[128],*tw1024_256p=(simd256_q15_t *)tw1024,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y;
|
||||
@@ -4382,7 +4384,7 @@ void idft1024(int16_t *x,int16_t *y,int scale)
|
||||
int16_t tw2048[2048] __attribute__((aligned(32)));
|
||||
|
||||
#ifndef __AVX2__
|
||||
void dft2048(int16_t *x,int16_t *y,int scale)
|
||||
void dft2048(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simdshort_q15_t xtmp[1024],*xtmpp,*x64 = (simdshort_q15_t *)x;
|
||||
@@ -4473,7 +4475,7 @@ void dft2048(int16_t *x,int16_t *y,int scale)
|
||||
|
||||
}
|
||||
|
||||
void idft2048(int16_t *x,int16_t *y,int scale)
|
||||
void idft2048(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simdshort_q15_t xtmp[1024],*xtmpp,*x64 = (simdshort_q15_t *)x;
|
||||
@@ -4565,7 +4567,7 @@ void idft2048(int16_t *x,int16_t *y,int scale)
|
||||
|
||||
#else // __AVX2__
|
||||
|
||||
void dft2048(int16_t *x,int16_t *y,int scale)
|
||||
void dft2048(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd256_q15_t xtmp[256],*xtmpp,*x256 = (simd256_q15_t *)x;
|
||||
@@ -4656,7 +4658,7 @@ void dft2048(int16_t *x,int16_t *y,int scale)
|
||||
|
||||
}
|
||||
|
||||
void idft2048(int16_t *x,int16_t *y,int scale)
|
||||
void idft2048(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd256_q15_t xtmp[256],*xtmpp,*x256 = (simd256_q15_t *)x;
|
||||
@@ -4753,7 +4755,7 @@ void idft2048(int16_t *x,int16_t *y,int scale)
|
||||
int16_t tw4096[3*2*1024];
|
||||
|
||||
#ifndef __AVX2__
|
||||
void dft4096(int16_t *x,int16_t *y,int scale)
|
||||
void dft4096(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd_q15_t xtmp[1024],ytmp[1024],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
|
||||
@@ -4811,7 +4813,7 @@ void dft4096(int16_t *x,int16_t *y,int scale)
|
||||
|
||||
|
||||
|
||||
void idft4096(int16_t *x,int16_t *y,int scale)
|
||||
void idft4096(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd_q15_t xtmp[1024],ytmp[1024],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
|
||||
@@ -4868,7 +4870,7 @@ void idft4096(int16_t *x,int16_t *y,int scale)
|
||||
}
|
||||
|
||||
#else //__AVX2__
|
||||
void dft4096(int16_t *x,int16_t *y,int scale)
|
||||
void dft4096(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd256_q15_t xtmp[512],ytmp[512],*tw4096_256p=(simd256_q15_t *)tw4096,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y;
|
||||
@@ -4924,7 +4926,7 @@ void dft4096(int16_t *x,int16_t *y,int scale)
|
||||
|
||||
}
|
||||
|
||||
void idft4096(int16_t *x,int16_t *y,int scale)
|
||||
void idft4096(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd256_q15_t xtmp[512],ytmp[512],*tw4096_256p=(simd256_q15_t *)tw4096,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y;
|
||||
@@ -4986,7 +4988,7 @@ void idft4096(int16_t *x,int16_t *y,int scale)
|
||||
int16_t tw8192[2*4096] __attribute__((aligned(32)));
|
||||
|
||||
#ifndef __AVX2__
|
||||
void dft8192(int16_t *x,int16_t *y,int scale)
|
||||
void dft8192(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simdshort_q15_t xtmp[4096],*xtmpp,*x64 = (simdshort_q15_t *)x;
|
||||
@@ -5076,7 +5078,7 @@ void dft8192(int16_t *x,int16_t *y,int scale)
|
||||
|
||||
}
|
||||
|
||||
void idft8192(int16_t *x,int16_t *y,int scale)
|
||||
void idft8192(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simdshort_q15_t xtmp[4096],*xtmpp,*x64 = (simdshort_q15_t *)x;
|
||||
@@ -5167,7 +5169,7 @@ void idft8192(int16_t *x,int16_t *y,int scale)
|
||||
}
|
||||
|
||||
#else // __AVX2__
|
||||
void dft8192(int16_t *x,int16_t *y,int scale)
|
||||
void dft8192(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd256_q15_t xtmp[1024],*xtmpp,*x256 = (simd256_q15_t *)x;
|
||||
@@ -5258,7 +5260,7 @@ void dft8192(int16_t *x,int16_t *y,int scale)
|
||||
|
||||
}
|
||||
|
||||
void idft8192(int16_t *x,int16_t *y,int scale)
|
||||
void idft8192(int16_t *x,int16_t *y,unsigned char scale)
|
||||
{
|
||||
|
||||
simd256_q15_t xtmp[1024],*xtmpp,*x256 = (simd256_q15_t *)x;
|
||||
@@ -5354,7 +5356,7 @@ void idft8192(int16_t *x,int16_t *y,int scale)
|
||||
int16_t twa1536[1024],twb1536[1024];
|
||||
|
||||
// 512 x 3
|
||||
void idft1536(int16_t *input, int16_t *output, int scale)
|
||||
void idft1536(int16_t *input, int16_t *output, unsigned char scale)
|
||||
{
|
||||
int i,i2,j;
|
||||
uint32_t tmp[3][512 ]__attribute__((aligned(32)));
|
||||
@@ -5406,7 +5408,7 @@ void idft1536(int16_t *input, int16_t *output, int scale)
|
||||
|
||||
}
|
||||
|
||||
void dft1536(int16_t *input, int16_t *output, int scale)
|
||||
void dft1536(int16_t *input, int16_t *output, unsigned char scale)
|
||||
{
|
||||
int i,i2,j;
|
||||
uint32_t tmp[3][512] __attribute__((aligned(32)));
|
||||
@@ -5471,7 +5473,7 @@ void dft1536(int16_t *input, int16_t *output, int scale)
|
||||
int16_t twa3072[2048] __attribute__((aligned(32)));
|
||||
int16_t twb3072[2048] __attribute__((aligned(32)));
|
||||
// 1024 x 3
|
||||
void dft3072(int16_t *input, int16_t *output,int scale)
|
||||
void dft3072(int16_t *input, int16_t *output,unsigned char scale)
|
||||
{
|
||||
int i,i2,j;
|
||||
uint32_t tmp[3][1024] __attribute__((aligned(32)));
|
||||
@@ -5521,7 +5523,7 @@ void dft3072(int16_t *input, int16_t *output,int scale)
|
||||
_m_empty();
|
||||
}
|
||||
|
||||
void idft3072(int16_t *input, int16_t *output,int scale)
|
||||
void idft3072(int16_t *input, int16_t *output,unsigned char scale)
|
||||
{
|
||||
int i,i2,j;
|
||||
uint32_t tmp[3][1024]__attribute__((aligned(32)));
|
||||
@@ -5575,7 +5577,7 @@ void idft3072(int16_t *input, int16_t *output,int scale)
|
||||
int16_t twa6144[4096] __attribute__((aligned(32)));
|
||||
int16_t twb6144[4096] __attribute__((aligned(32)));
|
||||
|
||||
void idft6144(int16_t *input, int16_t *output,int scale)
|
||||
void idft6144(int16_t *input, int16_t *output,unsigned char scale)
|
||||
{
|
||||
int i,i2,j;
|
||||
uint32_t tmp[3][2048] __attribute__((aligned(32)));
|
||||
@@ -5635,7 +5637,7 @@ void idft6144(int16_t *input, int16_t *output,int scale)
|
||||
}
|
||||
|
||||
|
||||
void dft6144(int16_t *input, int16_t *output,int scale)
|
||||
void dft6144(int16_t *input, int16_t *output,unsigned char scale)
|
||||
{
|
||||
int i,i2,j;
|
||||
uint32_t tmp[3][2048] __attribute__((aligned(32)));
|
||||
@@ -5699,12 +5701,12 @@ void dft6144(int16_t *input, int16_t *output,int scale)
|
||||
int16_t twa9216[6144] __attribute__((aligned(32)));
|
||||
int16_t twb9216[6144] __attribute__((aligned(32)));
|
||||
// 3072 x 3
|
||||
void dft9216(int16_t *input, int16_t *output,int scale) {
|
||||
void dft9216(int16_t *input, int16_t *output,uint8_t scale) {
|
||||
|
||||
AssertFatal(1==0,"Need to do this ..\n");
|
||||
}
|
||||
|
||||
void idft9216(int16_t *input, int16_t *output,int scale) {
|
||||
void idft9216(int16_t *input, int16_t *output,uint8_t scale) {
|
||||
|
||||
AssertFatal(1==0,"Need to do this ..\n");
|
||||
}
|
||||
@@ -5712,7 +5714,7 @@ void idft9216(int16_t *input, int16_t *output,int scale) {
|
||||
int16_t twa12288[8192] __attribute__((aligned(32)));
|
||||
int16_t twb12288[8192] __attribute__((aligned(32)));
|
||||
// 4096 x 3
|
||||
void dft12288(int16_t *input, int16_t *output,int scale)
|
||||
void dft12288(int16_t *input, int16_t *output,unsigned char scale)
|
||||
{
|
||||
int i,i2,j;
|
||||
uint32_t tmp[3][4096] __attribute__((aligned(32)));
|
||||
@@ -5772,7 +5774,7 @@ void dft12288(int16_t *input, int16_t *output,int scale)
|
||||
|
||||
}
|
||||
|
||||
void idft12288(int16_t *input, int16_t *output,int scale)
|
||||
void idft12288(int16_t *input, int16_t *output,unsigned char scale)
|
||||
{
|
||||
int i,i2,j;
|
||||
uint32_t tmp[3][4096] __attribute__((aligned(32)));
|
||||
@@ -5836,7 +5838,7 @@ void idft12288(int16_t *input, int16_t *output,int scale)
|
||||
int16_t twa18432[12288] __attribute__((aligned(32)));
|
||||
int16_t twb18432[12288] __attribute__((aligned(32)));
|
||||
// 6144 x 3
|
||||
void dft18432(int16_t *input, int16_t *output,int scale) {
|
||||
void dft18432(int16_t *input, int16_t *output,unsigned char scale) {
|
||||
|
||||
int i,i2,j;
|
||||
uint32_t tmp[3][6144] __attribute__((aligned(32)));
|
||||
@@ -5884,7 +5886,7 @@ void dft18432(int16_t *input, int16_t *output,int scale) {
|
||||
_m_empty();
|
||||
}
|
||||
|
||||
void idft18432(int16_t *input, int16_t *output,int scale) {
|
||||
void idft18432(int16_t *input, int16_t *output,unsigned char scale) {
|
||||
|
||||
int i,i2,j;
|
||||
uint32_t tmp[3][6144] __attribute__((aligned(32)));
|
||||
@@ -5936,7 +5938,7 @@ void idft18432(int16_t *input, int16_t *output,int scale) {
|
||||
int16_t twa24576[16384] __attribute__((aligned(32)));
|
||||
int16_t twb24576[16384] __attribute__((aligned(32)));
|
||||
// 8192 x 3
|
||||
void dft24576(int16_t *input, int16_t *output,int scale)
|
||||
void dft24576(int16_t *input, int16_t *output,unsigned char scale)
|
||||
{
|
||||
int i,i2,j;
|
||||
uint32_t tmp[3][8192] __attribute__((aligned(32)));
|
||||
@@ -5999,7 +6001,7 @@ void dft24576(int16_t *input, int16_t *output,int scale)
|
||||
}
|
||||
}
|
||||
|
||||
void idft24576(int16_t *input, int16_t *output,int scale)
|
||||
void idft24576(int16_t *input, int16_t *output,unsigned char scale)
|
||||
{
|
||||
int i,i2,j;
|
||||
uint32_t tmp[3][8192] __attribute__((aligned(32)));
|
||||
@@ -6061,11 +6063,11 @@ void idft24576(int16_t *input, int16_t *output,int scale)
|
||||
int16_t twa36864[24576] __attribute__((aligned(32)));
|
||||
int16_t twb36884[24576] __attribute__((aligned(32)));
|
||||
// 12288 x 3
|
||||
void dft36864(int16_t *input, int16_t *output,int scale) {
|
||||
void dft36864(int16_t *input, int16_t *output,uint8_t scale) {
|
||||
|
||||
AssertFatal(1==0,"Need to do this ..\n");
|
||||
}
|
||||
void idft36864(int16_t *input, int16_t *output,int scale) {
|
||||
void idft36864(int16_t *input, int16_t *output,uint8_t scale) {
|
||||
|
||||
AssertFatal(1==0,"Need to do this ..\n");
|
||||
}
|
||||
@@ -6073,12 +6075,12 @@ void idft36864(int16_t *input, int16_t *output,int scale) {
|
||||
int16_t twa49152[32768] __attribute__((aligned(32)));
|
||||
int16_t twb49152[32768] __attribute__((aligned(32)));
|
||||
// 16384 x 3
|
||||
void dft49152(int16_t *input, int16_t *output,int scale) {
|
||||
void dft49152(int16_t *input, int16_t *output,uint8_t scale) {
|
||||
|
||||
AssertFatal(1==0,"Need to do this ..\n");
|
||||
}
|
||||
|
||||
void idft49152(int16_t *input, int16_t *output,int scale) {
|
||||
void idft49152(int16_t *input, int16_t *output,uint8_t scale) {
|
||||
|
||||
AssertFatal(1==0,"Need to do this ..\n");
|
||||
}
|
||||
@@ -6086,12 +6088,12 @@ void idft49152(int16_t *input, int16_t *output,int scale) {
|
||||
int16_t twa73728[49152] __attribute__((aligned(32)));
|
||||
int16_t twb73728[49152] __attribute__((aligned(32)));
|
||||
// 24576 x 3
|
||||
void dft73728(int16_t *input, int16_t *output,int scale) {
|
||||
void dft73728(int16_t *input, int16_t *output,uint8_t scale) {
|
||||
|
||||
AssertFatal(1==0,"Need to do this ..\n");
|
||||
}
|
||||
|
||||
void idft73728(int16_t *input, int16_t *output,int scale) {
|
||||
void idft73728(int16_t *input, int16_t *output,uint8_t scale) {
|
||||
|
||||
AssertFatal(1==0,"Need to do this ..\n");
|
||||
}
|
||||
@@ -6100,12 +6102,12 @@ void idft73728(int16_t *input, int16_t *output,int scale) {
|
||||
int16_t twa98304[49152] __attribute__((aligned(32)));
|
||||
int16_t twb98304[49152] __attribute__((aligned(32)));
|
||||
// 32768 x 3
|
||||
void dft98304(int16_t *input, int16_t *output,int scale) {
|
||||
void dft98304(int16_t *input, int16_t *output,uint8_t scale) {
|
||||
|
||||
AssertFatal(1==0,"Need to do this ..\n");
|
||||
}
|
||||
|
||||
void idft98304(int16_t *input, int16_t *output,int scale) {
|
||||
void idft98304(int16_t *input, int16_t *output,uint8_t scale) {
|
||||
|
||||
AssertFatal(1==0,"Need to do this ..\n");
|
||||
}
|
||||
@@ -6263,7 +6265,7 @@ static inline void dft12f(simd_q15_t *x0,
|
||||
|
||||
|
||||
|
||||
void dft12(int16_t *x,int16_t *y)
|
||||
void dft12(int16_t *x,int16_t *y ,unsigned char scale_flag)
|
||||
{
|
||||
|
||||
simd_q15_t *x128 = (simd_q15_t *)x,*y128 = (simd_q15_t *)y;
|
||||
@@ -8595,8 +8597,6 @@ void dft1200(int16_t *x,int16_t *y,unsigned char scale_flag)
|
||||
|
||||
}
|
||||
|
||||
//#define round trunc
|
||||
|
||||
void init_rad4(int N,int16_t *tw) {
|
||||
|
||||
int16_t *twa = tw;
|
||||
@@ -8712,12 +8712,13 @@ void init_rad5_rep(int N,int16_t *twa,int16_t *twb,int16_t *twc,int16_t *twd) {
|
||||
twa+=8;
|
||||
twb+=8;
|
||||
twc+=8;
|
||||
twd+=8;
|
||||
twd+=8;
|
||||
}
|
||||
}
|
||||
/*----------------------------------------------------------------*/
|
||||
/* dft library entry points: */
|
||||
|
||||
|
||||
void init_dfts(void)
|
||||
int dfts_autoinit(void)
|
||||
{
|
||||
init_rad4(1024,tw1024);
|
||||
init_rad2(2048,tw2048);
|
||||
@@ -8764,9 +8765,23 @@ void init_dfts(void)
|
||||
init_rad3_rep(1080,twa1080,twb1080);
|
||||
init_rad4_rep(1152,twa1152,twb1152,twc1152);
|
||||
init_rad4_rep(1200,twa1200,twb1200,twc1200);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//#undef round
|
||||
|
||||
|
||||
|
||||
void dft(uint8_t sizeidx, int16_t *sigF,int16_t *sig,unsigned char scale_flag){
|
||||
AssertFatal((sizeidx>=0 && sizeidx<(int)DFT_SIZE_IDXTABLESIZE),"Invalid dft size index %i\n",sizeidx);
|
||||
dft_ftab[sizeidx](sigF,sig,scale_flag);
|
||||
};
|
||||
|
||||
void idft(uint8_t sizeidx, int16_t *sigF,int16_t *sig,unsigned char scale_flag){
|
||||
AssertFatal((sizeidx>=0 && sizeidx<(int)IDFT_SIZE_IDXTABLESIZE),"Invalid idft size index %i\n",sizeidx);
|
||||
idft_ftab[sizeidx](sigF,sig,scale_flag);
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef MR_MAIN
|
||||
#include <string.h>
|
||||
@@ -8937,12 +8952,12 @@ int main(int argc, char**argv)
|
||||
#ifdef __AVX2__
|
||||
simd256_q15_t x[4096],x2[4096],y[4096],tw0,tw1,tw2,tw3;
|
||||
#else
|
||||
simd_q15_t x[8192],x2[8192],y[8192],tw0,tw1,tw2,tw3;
|
||||
simd_q15_t x[8192],y[8192],tw0,tw1,tw2,tw3;
|
||||
#endif
|
||||
int i;
|
||||
simd_q15_t *x128=(simd_q15_t*)x,*y128=(simd_q15_t*)y;
|
||||
|
||||
init_dfts();
|
||||
dfts_autoinit();
|
||||
|
||||
set_taus_seed(0);
|
||||
opp_enabled = 1;
|
||||
+123
-73
@@ -36,6 +36,8 @@ extern "C" {
|
||||
#include <stdint.h>
|
||||
#include "PHY/sse_intrin.h"
|
||||
|
||||
#define CEILIDIV(a,b) ((a+b-1)/b)
|
||||
#define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1))
|
||||
|
||||
struct complex {
|
||||
double x;
|
||||
@@ -179,46 +181,144 @@ This function performs optimized fixed-point radix-2 FFT/IFFT.
|
||||
);
|
||||
*/
|
||||
|
||||
void idft16f(int16_t *x,int16_t *y);
|
||||
|
||||
void idft1536(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void idft6144(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void idft12288(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void idft18432(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void idft3072(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void idft24576(int16_t *sigF,int16_t *sig,int scale);
|
||||
#ifdef OAIDFTS_MAIN
|
||||
typedef void(*adftfunc_t)(int16_t *sigF,int16_t *sig,unsigned char scale_flag);
|
||||
typedef void(*aidftfunc_t)(int16_t *sigF,int16_t *sig,unsigned char scale_flag);
|
||||
|
||||
void dft1536(int16_t *sigF,int16_t *sig,int scale);
|
||||
void dft12(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft24(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft36(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft48(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft60(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft64(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft72(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft96(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft108(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft120(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft128(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft144(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft180(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft192(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft216(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft240(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft256(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft288(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft300(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft324(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft360(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft384(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft432(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft480(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft512(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft540(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft576(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft600(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft648(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft720(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft768(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft864(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft900(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft960(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft972(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft1024(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft1080(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft1152(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft1200(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft1536(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
|
||||
void dft2048(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft3072(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
|
||||
void dft4096(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft6144(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
|
||||
void dft8192(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft9216(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft12288(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft18432(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft24576(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft36864(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft49152(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft73728(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft98304(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
|
||||
void dft3072(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void dft6144(int16_t *sigF,int16_t *sig,int scale);
|
||||
void idft64(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void idft128(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void idft256(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void idft512(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void idft1024(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void idft1536(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
|
||||
void idft2048(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void idft3072(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
|
||||
void idft4096(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void idft6144(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
|
||||
void idft8192(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void idft9216(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void idft12288(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
|
||||
void idft18432(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
|
||||
void idft24576(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
|
||||
void idft36864(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
|
||||
void idft49152(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
|
||||
void idft73728(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
|
||||
void idft98304(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
|
||||
|
||||
void dft12288(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void dft18432(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void dft24576(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void dft49152(int16_t *sigF,int16_t *sig,int scale);
|
||||
void idft49152(int16_t *sigF,int16_t *sig,int scale);
|
||||
#else
|
||||
typedef void(*dftfunc_t)(uint8_t sizeidx,int16_t *sigF,int16_t *sig,unsigned char scale_flag);
|
||||
typedef void(*idftfunc_t)(uint8_t sizeidx,int16_t *sigF,int16_t *sig,unsigned char scale_flag);
|
||||
# ifdef OAIDFTS_LOADER
|
||||
dftfunc_t dft;
|
||||
idftfunc_t idft;
|
||||
# else
|
||||
extern dftfunc_t dft;
|
||||
extern idftfunc_t idft;
|
||||
extern int load_dftslib(void);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
void dft9216(int16_t *sigF,int16_t *sig,int scale);
|
||||
void idft9216(int16_t *sigF,int16_t *sig,int scale);
|
||||
typedef enum DFT_size_idx {
|
||||
DFT_12, DFT_24, DFT_36, DFT_48, DFT_60, DFT_72, DFT_96,
|
||||
DFT_108, DFT_120, DFT_128, DFT_144, DFT_180, DFT_192, DFT_216, DFT_240,
|
||||
DFT_256, DFT_288, DFT_300, DFT_324, DFT_360, DFT_384, DFT_432, DFT_480,
|
||||
DFT_512, DFT_540, DFT_576, DFT_600, DFT_648, DFT_720, DFT_768, DFT_864,
|
||||
DFT_900, DFT_960, DFT_972, DFT_1024, DFT_1080, DFT_1152, DFT_1200, DFT_1536,
|
||||
DFT_2048, DFT_3072, DFT_4096, DFT_6144, DFT_8192, DFT_9216, DFT_12288, DFT_18432,
|
||||
DFT_24576, DFT_36864, DFT_49152, DFT_73728, DFT_98304,
|
||||
DFT_SIZE_IDXTABLESIZE
|
||||
} dft_size_idx_t;
|
||||
|
||||
void dft36864(int16_t *sigF,int16_t *sig,int scale);
|
||||
void idft36864(int16_t *sigF,int16_t *sig,int scale);
|
||||
#ifdef OAIDFTS_MAIN
|
||||
adftfunc_t dft_ftab[]={
|
||||
dft12, dft24, dft36, dft48, dft60, dft72, dft96,
|
||||
dft108, dft120, dft128, dft144, dft180, dft192, dft216, dft240,
|
||||
dft256, dft288, dft300, dft324, dft360, dft384, dft432, dft480,
|
||||
dft512, dft540, dft576, dft600, dft648, dft720, dft768, dft864,
|
||||
dft900, dft960, dft972, dft1024, dft1080, dft1152, dft1200, dft1536,
|
||||
dft2048, dft3072, dft4096, dft6144, dft8192, dft9216, dft12288, dft18432,
|
||||
dft24576, dft36864, dft49152, dft73728, dft98304
|
||||
};
|
||||
#endif
|
||||
|
||||
void dft98304(int16_t *sigF,int16_t *sig,int scale);
|
||||
void idft98304(int16_t *sigF,int16_t *sig,int scale);
|
||||
typedef enum idft_size_idx {
|
||||
IDFT_128, IDFT_256, IDFT_512, IDFT_1024, IDFT_1536, IDFT_2048, IDFT_3072, IDFT_4096,
|
||||
IDFT_6144, IDFT_8192, IDFT_9216, IDFT_12288, IDFT_18432, IDFT_24576, IDFT_36864, IDFT_49152,
|
||||
IDFT_73728, IDFT_98304,
|
||||
IDFT_SIZE_IDXTABLESIZE
|
||||
} idft_size_idx_t;
|
||||
#ifdef OAIDFTS_MAIN
|
||||
aidftfunc_t idft_ftab[]={
|
||||
idft128, idft256, idft512, idft1024, idft1536, idft2048, idft3072, idft4096,
|
||||
idft6144, idft8192, idft9216, idft12288, idft18432, idft24576, idft36864, idft49152,
|
||||
idft73728, idft98304
|
||||
};
|
||||
#endif
|
||||
|
||||
void dft73728(int16_t *sigF,int16_t *sig,int scale);
|
||||
void idft73728(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
|
||||
/*!\fn int32_t rotate_cpx_vector(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N,uint16_t output_shift)
|
||||
@@ -389,57 +489,7 @@ int64_t dot_product64(int16_t *x,
|
||||
uint32_t N, //must be a multiple of 8
|
||||
uint8_t output_shift);
|
||||
|
||||
void dft12(int16_t *x,int16_t *y);
|
||||
void dft24(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft36(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft48(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft60(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft72(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft96(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft108(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft120(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft144(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft180(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft192(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft216(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft240(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft288(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft300(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft324(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft360(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft384(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft432(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft480(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft540(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft576(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft600(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft648(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft720(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft768(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft864(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft900(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft960(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft972(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft1080(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft1152(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft1200(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
|
||||
void dft64(int16_t *x,int16_t *y,int scale);
|
||||
void dft128(int16_t *x,int16_t *y,int scale);
|
||||
void dft256(int16_t *x,int16_t *y,int scale);
|
||||
void dft512(int16_t *x,int16_t *y,int scale);
|
||||
void dft1024(int16_t *x,int16_t *y,int scale);
|
||||
void dft2048(int16_t *x,int16_t *y,int scale);
|
||||
void dft4096(int16_t *x,int16_t *y,int scale);
|
||||
void dft8192(int16_t *x,int16_t *y,int scale);
|
||||
void idft64(int16_t *x,int16_t *y,int scale);
|
||||
void idft128(int16_t *x,int16_t *y,int scale);
|
||||
void idft256(int16_t *x,int16_t *y,int scale);
|
||||
void idft512(int16_t *x,int16_t *y,int scale);
|
||||
void idft1024(int16_t *x,int16_t *y,int scale);
|
||||
void idft2048(int16_t *x,int16_t *y,int scale);
|
||||
void idft4096(int16_t *x,int16_t *y,int scale);
|
||||
void idft8192(int16_t *x,int16_t *y,int scale);
|
||||
/** @} */
|
||||
|
||||
|
||||
|
||||
+29
-12
@@ -605,6 +605,12 @@ typedef struct {
|
||||
int prach_I0;
|
||||
} PHY_MEASUREMENTS_gNB;
|
||||
|
||||
#define MAX_NUM_NR_RX_RACH_PDUS 4
|
||||
#define MAX_NUM_NR_RX_PRACH_PREAMBLES 4
|
||||
#define MAX_UL_PDUS_PER_SLOT 100
|
||||
#define MAX_NUM_NR_SRS_PDUS 100
|
||||
#define MAX_NUM_NR_UCI_PDUS 100
|
||||
|
||||
/// Top-level PHY Data Structure for gNB
|
||||
typedef struct PHY_VARS_gNB_s {
|
||||
/// Module ID indicator for this instance
|
||||
@@ -630,8 +636,18 @@ typedef struct PHY_VARS_gNB_s {
|
||||
NR_UL_IND_t UL_INFO;
|
||||
pthread_mutex_t UL_INFO_mutex;
|
||||
|
||||
/// NFAPI PRACH information (to be removed)
|
||||
nfapi_preamble_pdu_t preamble_list[MAX_NUM_RX_PRACH_PREAMBLES];
|
||||
/// NFAPI RX ULSCH information
|
||||
nfapi_nr_rx_data_pdu_t rx_pdu_list[MAX_UL_PDUS_PER_SLOT];
|
||||
/// NFAPI RX ULSCH CRC information
|
||||
nfapi_nr_crc_t crc_pdu_list[MAX_UL_PDUS_PER_SLOT];
|
||||
/// NFAPI SRS information
|
||||
nfapi_nr_srs_indication_pdu_t srs_pdu_list[MAX_NUM_NR_SRS_PDUS];
|
||||
/// NFAPI UCI information
|
||||
nfapi_nr_uci_t uci_pdu_list[MAX_NUM_NR_UCI_PDUS];
|
||||
/// NFAPI PRACH information
|
||||
nfapi_nr_prach_indication_pdu_t prach_pdu_indication_list[MAX_NUM_NR_RX_RACH_PDUS];
|
||||
/// NFAPI PRACH information
|
||||
nfapi_nr_prach_indication_preamble_t preamble_list[MAX_NUM_NR_RX_PRACH_PREAMBLES];
|
||||
|
||||
//Sched_Rsp_t Sched_INFO;
|
||||
nfapi_nr_ul_tti_request_t UL_tti_req;
|
||||
@@ -712,9 +728,7 @@ typedef struct PHY_VARS_gNB_s {
|
||||
time_stats_t phy_proc;
|
||||
*/
|
||||
time_stats_t phy_proc_tx;
|
||||
/*
|
||||
time_stats_t phy_proc_rx;
|
||||
*/
|
||||
time_stats_t rx_prach;
|
||||
/*
|
||||
time_stats_t ofdm_mod_stats;
|
||||
@@ -730,18 +744,21 @@ typedef struct PHY_VARS_gNB_s {
|
||||
time_stats_t dlsch_rate_matching_stats;
|
||||
time_stats_t dlsch_interleaving_stats;
|
||||
time_stats_t dlsch_segmentation_stats;
|
||||
|
||||
time_stats_t ulsch_decoding_stats;
|
||||
time_stats_t ulsch_rate_unmatching_stats;
|
||||
time_stats_t ulsch_ldpc_decoding_stats;
|
||||
time_stats_t ulsch_deinterleaving_stats;
|
||||
time_stats_t ulsch_unscrambling_stats;
|
||||
time_stats_t ulsch_channel_estimation_stats;
|
||||
time_stats_t ulsch_channel_compensation_stats;
|
||||
time_stats_t ulsch_rbs_extraction_stats;
|
||||
time_stats_t ulsch_llr_stats;
|
||||
/*
|
||||
time_stats_t rx_dft_stats;
|
||||
time_stats_t ulsch_channel_estimation_stats;
|
||||
time_stats_t ulsch_freq_offset_estimation_stats;
|
||||
time_stats_t ulsch_decoding_stats;
|
||||
time_stats_t ulsch_demodulation_stats;
|
||||
time_stats_t ulsch_rate_unmatching_stats;
|
||||
time_stats_t ulsch_turbo_decoding_stats;
|
||||
time_stats_t ulsch_deinterleaving_stats;
|
||||
time_stats_t ulsch_demultiplexing_stats;
|
||||
time_stats_t ulsch_llr_stats;
|
||||
*/
|
||||
|
||||
} PHY_VARS_gNB;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -596,7 +596,7 @@ void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,
|
||||
uci->frame = frame;
|
||||
uci->subframe = subframe;
|
||||
uci->rnti = ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti;
|
||||
uci->ue_id = find_dlsch(ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE);
|
||||
uci->ue_id = find_ulsch(ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE);
|
||||
uci->type = SR;
|
||||
uci->pucch_fmt = pucch_format1;
|
||||
uci->num_antenna_ports = 1;
|
||||
@@ -622,7 +622,7 @@ void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_
|
||||
uci->frame = frame;
|
||||
uci->subframe = subframe;
|
||||
uci->rnti = ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti;
|
||||
uci->ue_id = find_dlsch(ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE);
|
||||
uci->ue_id = find_ulsch(ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE);
|
||||
uci->type = HARQ_SR;
|
||||
uci->num_antenna_ports = 1;
|
||||
uci->num_pucch_resources = 1;
|
||||
@@ -644,7 +644,7 @@ void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu
|
||||
uci->frame = frame;
|
||||
uci->subframe = subframe;
|
||||
uci->rnti = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti;
|
||||
uci->ue_id = find_dlsch(ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE);
|
||||
uci->ue_id = find_ulsch(ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE);
|
||||
uci->type = HARQ;
|
||||
uci->srs_active = srs_active;
|
||||
uci->num_antenna_ports = ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel11.num_ant_ports;
|
||||
|
||||
@@ -640,6 +640,10 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
uci = &(eNB->uci_vars[i]);
|
||||
|
||||
if ((uci->active == 1) && (uci->frame == frame) && (uci->subframe == subframe)) {
|
||||
if (uci->ue_id > MAX_MOBILES_PER_ENB) {
|
||||
LOG_W(PHY, "UCI for UE %d and/or but is not active in MAC\n", uci->ue_id);
|
||||
continue;
|
||||
}
|
||||
LOG_D(PHY,"Frame %d, subframe %d: Running uci procedures (type %d) for %d \n",
|
||||
frame,
|
||||
subframe,
|
||||
@@ -1239,11 +1243,11 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
|
||||
print_CQI(ulsch_harq->o,ulsch_harq->uci_format,0,fp->N_RB_DL);
|
||||
#endif
|
||||
fill_ulsch_cqi_indication(eNB,frame,subframe,ulsch_harq,ulsch->rnti);
|
||||
RC.mac[eNB->Mod_id]->UE_list.UE_sched_ctrl[i].cqi_req_flag &= (~(1 << subframe));
|
||||
RC.mac[eNB->Mod_id]->UE_info.UE_sched_ctrl[i].cqi_req_flag &= (~(1 << subframe));
|
||||
} else {
|
||||
if(RC.mac[eNB->Mod_id]->UE_list.UE_sched_ctrl[i].cqi_req_flag & (1 << subframe) ) {
|
||||
RC.mac[eNB->Mod_id]->UE_list.UE_sched_ctrl[i].cqi_req_flag &= (~(1 << subframe));
|
||||
RC.mac[eNB->Mod_id]->UE_list.UE_sched_ctrl[i].cqi_req_timer=30;
|
||||
if(RC.mac[eNB->Mod_id]->UE_info.UE_sched_ctrl[i].cqi_req_flag & (1 << subframe) ) {
|
||||
RC.mac[eNB->Mod_id]->UE_info.UE_sched_ctrl[i].cqi_req_flag &= (~(1 << subframe));
|
||||
RC.mac[eNB->Mod_id]->UE_info.UE_sched_ctrl[i].cqi_req_timer=30;
|
||||
LOG_D(PHY,"Frame %d,Subframe %d, We're supposed to get a cqi here. Set cqi_req_timer to 30.\n",frame,subframe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,5 @@ void handle_nr_nfapi_pdsch_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
|
||||
nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu,
|
||||
uint8_t *sdu);
|
||||
|
||||
void nr_fill_rx_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t harq_pid);
|
||||
|
||||
void nr_fill_crc_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t crc_flag);
|
||||
void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t harq_pid, uint8_t crc_flag);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport.h"
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
#include "fapi_nr_l1.h"
|
||||
#include "nfapi_pnf.h"
|
||||
@@ -47,17 +47,19 @@
|
||||
|
||||
#include "intertask_interface.h"
|
||||
|
||||
extern uint32_t nfapi_mode;
|
||||
extern uint8_t nfapi_mode;
|
||||
|
||||
extern int oai_nfapi_nr_rach_ind(nfapi_rach_indication_t *rach_ind);
|
||||
|
||||
|
||||
void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int subframe) {
|
||||
void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot,
|
||||
nfapi_nr_prach_pdu_t *prach_pdu) {
|
||||
|
||||
uint16_t max_preamble[4],max_preamble_energy[4],max_preamble_delay[4];
|
||||
uint16_t i;
|
||||
|
||||
|
||||
gNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles=0;
|
||||
gNB->UL_INFO.rach_ind.number_of_pdus=0;
|
||||
|
||||
RU_t *ru;
|
||||
int aa=0;
|
||||
@@ -75,16 +77,18 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int subframe) {
|
||||
}
|
||||
}
|
||||
|
||||
rx_nr_prach(gNB,
|
||||
|
||||
/* rx_nr_prach(gNB,
|
||||
prach_pdu,
|
||||
frame,
|
||||
subframe,
|
||||
slot,
|
||||
&max_preamble[0],
|
||||
&max_preamble_energy[0],
|
||||
&max_preamble_delay[0]
|
||||
);
|
||||
);*/
|
||||
|
||||
LOG_D(PHY,"[RAPROC] Frame %d, subframe %d : Most likely preamble %d, energy %d dB delay %d (prach_energy counter %d)\n",
|
||||
frame,subframe,
|
||||
LOG_D(PHY,"[RAPROC] Frame %d, slot %d : Most likely preamble %d, energy %d dB delay %d (prach_energy counter %d)\n",
|
||||
frame,slot,
|
||||
max_preamble[0],
|
||||
max_preamble_energy[0]/10,
|
||||
max_preamble_delay[0],
|
||||
@@ -93,49 +97,43 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int subframe) {
|
||||
if ((gNB->prach_energy_counter == 100) &&
|
||||
(max_preamble_energy[0] > gNB->measurements.prach_I0+100)) {
|
||||
|
||||
LOG_I(PHY,"[gNB %d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n",
|
||||
LOG_I(PHY,"[gNB %d][RAPROC] Frame %d, slot %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n",
|
||||
gNB->Mod_id,
|
||||
frame,
|
||||
subframe,
|
||||
slot,
|
||||
max_preamble[0],
|
||||
max_preamble_energy[0]/10,
|
||||
max_preamble_energy[0]%10,
|
||||
max_preamble_delay[0]);
|
||||
|
||||
T(T_ENB_PHY_INITIATE_RA_PROCEDURE, T_INT(gNB->Mod_id), T_INT(frame), T_INT(subframe),
|
||||
T(T_ENB_PHY_INITIATE_RA_PROCEDURE, T_INT(gNB->Mod_id), T_INT(frame), T_INT(slot),
|
||||
T_INT(max_preamble[0]), T_INT(max_preamble_energy[0]), T_INT(max_preamble_delay[0]));
|
||||
|
||||
|
||||
gNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles = 1;
|
||||
gNB->UL_INFO.rach_ind.rach_indication_body.preamble_list = &gNB->preamble_list[0];
|
||||
gNB->UL_INFO.rach_ind.rach_indication_body.tl.tag = NFAPI_RACH_INDICATION_BODY_TAG;
|
||||
gNB->UL_INFO.rach_ind.header.message_id = NFAPI_RACH_INDICATION;
|
||||
gNB->UL_INFO.rach_ind.sfn_sf = frame<<4 | subframe;
|
||||
gNB->UL_INFO.rach_ind.number_of_pdus = 1;
|
||||
gNB->UL_INFO.rach_ind.pdu_list = &gNB->prach_pdu_indication_list[0];
|
||||
gNB->UL_INFO.rach_ind.sfn = frame;
|
||||
gNB->UL_INFO.rach_ind.slot = slot;
|
||||
|
||||
gNB->preamble_list[0].preamble_rel8.tl.tag = NFAPI_PREAMBLE_REL8_TAG;
|
||||
gNB->preamble_list[0].preamble_rel8.timing_advance = max_preamble_delay[0];
|
||||
gNB->preamble_list[0].preamble_rel8.preamble = max_preamble[0];
|
||||
gNB->preamble_list[0].preamble_rel8.rnti = 1+subframe; // note: fid is implicitly 0 here
|
||||
gNB->preamble_list[0].instance_length = 0; //don't know exactly what this is
|
||||
|
||||
if (nfapi_mode == 1) { // If NFAPI PNF then we need to send the message to the VNF
|
||||
|
||||
LOG_D(PHY,"Filling NFAPI indication for NR RACH : SFN_SF:%d TA %d, Preamble %d, rnti %x\n",
|
||||
NFAPI_SFNSF2DEC(gNB->UL_INFO.rach_ind.sfn_sf),
|
||||
gNB->preamble_list[0].preamble_rel8.timing_advance,
|
||||
gNB->preamble_list[0].preamble_rel8.preamble,
|
||||
gNB->preamble_list[0].preamble_rel8.rnti);
|
||||
AssertFatal(1==0,"shouldn't be here yet..\n");
|
||||
//oai_nfapi_nr_rach_ind(&gNB->UL_INFO.rach_ind);
|
||||
|
||||
gNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles = 0;
|
||||
}
|
||||
} // max_preamble_energy > prach_I0 + 100
|
||||
else {
|
||||
gNB->measurements.prach_I0 = ((gNB->measurements.prach_I0*900)>>10) + ((max_preamble_energy[0]*124)>>10);
|
||||
if (frame==0) LOG_I(PHY,"prach_I0 = %d.%d dB\n",gNB->measurements.prach_I0/10,gNB->measurements.prach_I0%10);
|
||||
if (gNB->prach_energy_counter < 100) gNB->prach_energy_counter++;
|
||||
}
|
||||
gNB->prach_pdu_indication_list[0].phy_cell_id = gNB->gNB_config.cell_config.phy_cell_id.value;
|
||||
gNB->prach_pdu_indication_list[0].symbol_index = prach_pdu->prach_start_symbol; // FIXME to be changed for multi-ssb (this is only the start symbol of first occasion)
|
||||
gNB->prach_pdu_indication_list[0].slot_index = slot;
|
||||
gNB->prach_pdu_indication_list[0].freq_index = prach_pdu->num_ra;
|
||||
gNB->prach_pdu_indication_list[0].avg_rssi = (max_preamble_energy[0]<631) ? (128+(max_preamble_energy[0]/5)) : 254;
|
||||
gNB->prach_pdu_indication_list[0].avg_snr = 0xff; // invalid for now
|
||||
|
||||
|
||||
gNB->prach_pdu_indication_list[0].num_preamble = 1;
|
||||
gNB->prach_pdu_indication_list[0].preamble_list = gNB->preamble_list;
|
||||
gNB->prach_pdu_indication_list[0].preamble_list[0].preamble_index = max_preamble[0];
|
||||
gNB->prach_pdu_indication_list[0].preamble_list[0].timing_advance = max_preamble_delay[0];
|
||||
gNB->prach_pdu_indication_list[0].preamble_list[0].preamble_pwr = 0xffffffff;
|
||||
}
|
||||
gNB->measurements.prach_I0 = ((gNB->measurements.prach_I0*900)>>10) + ((max_preamble_energy[0]*124)>>10);
|
||||
if (frame==0) LOG_I(PHY,"prach_I0 = %d.%d dB\n",gNB->measurements.prach_I0/10,gNB->measurements.prach_I0%10);
|
||||
if (gNB->prach_energy_counter < 100) gNB->prach_energy_counter++;
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,0);
|
||||
}
|
||||
|
||||
|
||||
@@ -243,16 +243,18 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
|
||||
//------------------- ULSCH unscrambling -------------------
|
||||
//----------------------------------------------------------
|
||||
|
||||
start_meas(&gNB->ulsch_unscrambling_stats);
|
||||
nr_ulsch_unscrambling(gNB->pusch_vars[ULSCH_id]->llr,
|
||||
G,
|
||||
0,
|
||||
pusch_pdu->data_scrambling_id,
|
||||
pusch_pdu->rnti);
|
||||
|
||||
stop_meas(&gNB->ulsch_unscrambling_stats);
|
||||
//----------------------------------------------------------
|
||||
//--------------------- ULSCH decoding ---------------------
|
||||
//----------------------------------------------------------
|
||||
|
||||
start_meas(&gNB->ulsch_decoding_stats);
|
||||
ret = nr_ulsch_decoding(gNB,
|
||||
ULSCH_id,
|
||||
gNB->pusch_vars[ULSCH_id]->llr,
|
||||
@@ -262,56 +264,30 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
|
||||
slot_rx,
|
||||
harq_pid,
|
||||
G);
|
||||
stop_meas(&gNB->ulsch_decoding_stats);
|
||||
|
||||
|
||||
if (ret > gNB->ulsch[ULSCH_id][0]->max_ldpc_iterations)
|
||||
if (ret > gNB->ulsch[ULSCH_id][0]->max_ldpc_iterations){
|
||||
LOG_I(PHY, "ULSCH %d in error\n",ULSCH_id);
|
||||
//gNB->ulsch[ULSCH_id+1][0]->harq_processes[harq_pid]->b
|
||||
nr_fill_indication(gNB,frame_rx, slot_rx, ULSCH_id, harq_pid, 1);
|
||||
}
|
||||
else if(gNB->ulsch[ULSCH_id][0]->harq_processes[harq_pid]->b!=NULL){
|
||||
LOG_I(PHY, "ULSCH received ok \n");
|
||||
if(IS_SOFTMODEM_NOS1){ //&& gNB->ulsch[ULSCH_id][0]->rnti == 0x1234
|
||||
nr_fill_crc_indication(gNB,frame_rx, slot_rx, ULSCH_id, 0);
|
||||
nr_fill_rx_indication(gNB, frame_rx, slot_rx, ULSCH_id, harq_pid);
|
||||
}
|
||||
LOG_I(PHY, "ULSCH received ok \n");
|
||||
nr_fill_indication(gNB,frame_rx, slot_rx, ULSCH_id, harq_pid, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void nr_fill_rx_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, uint8_t harq_pid)
|
||||
{
|
||||
// --------------------
|
||||
// [hna] TO BE CLEANED
|
||||
// --------------------
|
||||
nfapi_rx_indication_pdu_t *pdu;
|
||||
void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, uint8_t harq_pid, uint8_t crc_flag) {
|
||||
|
||||
int timing_advance_update;
|
||||
pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||
|
||||
int timing_advance_update, cqi;
|
||||
int sync_pos;
|
||||
|
||||
uint16_t mu = gNB->frame_parms.numerology_index;
|
||||
// pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0];
|
||||
NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid];
|
||||
|
||||
pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||
|
||||
gNB->UL_INFO.rx_ind.sfn_sf = frame<<4| slot_rx;
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.tl.tag = NFAPI_RX_INDICATION_BODY_TAG;
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list->rx_indication_rel8.length = gNB->ulsch[ULSCH_id][0]->harq_processes[harq_pid]->TBS;
|
||||
|
||||
pdu = &gNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list[gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus];
|
||||
|
||||
//pdu->rx_ue_information.handle = gNB->ulsch[ULSCH_id+1][0]->handle;
|
||||
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
|
||||
pdu->rx_ue_information.rnti = gNB->ulsch[ULSCH_id][0]->rnti;
|
||||
pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
|
||||
pdu->rx_indication_rel8.offset = 1; // DJP - I dont understand - but broken unless 1 ???? 0; // filled in at the end of the UL_INFO formation
|
||||
pdu->data = harq_process->b;//gNB->ulsch[ULSCH_id+1][0]->harq_processes[harq_pid]->b;
|
||||
// estimate timing advance for MAC
|
||||
sync_pos = nr_est_timing_advance_pusch(gNB, ULSCH_id);
|
||||
timing_advance_update = sync_pos; // - gNB->frame_parms.nb_prefix_samples/4; //to check
|
||||
// printf("\x1B[33m" "timing_advance_update = %d\n" "\x1B[0m", timing_advance_update);
|
||||
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu = &harq_process->ulsch_pdu;
|
||||
|
||||
// pdu->data = gNB->ulsch[ULSCH_id+1][0]->harq_processes[harq_pid]->b;
|
||||
sync_pos = nr_est_timing_advance_pusch(gNB, ULSCH_id); // estimate timing advance for MAC
|
||||
@@ -335,39 +311,50 @@ void nr_fill_rx_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_
|
||||
|
||||
LOG_D(PHY, "Estimated timing advance PUSCH is = %d, timing_advance_update is %d \n", sync_pos,timing_advance_update);
|
||||
|
||||
pdu->rx_indication_rel8.timing_advance = timing_advance_update;
|
||||
|
||||
// estimate UL_CQI for MAC (from antenna port 0 only)
|
||||
int SNRtimes10 = dB_fixed_times10(gNB->pusch_vars[ULSCH_id]->ulsch_power[0]) - 300;//(10*gNB->measurements.n0_power_dB[0]);
|
||||
|
||||
if (SNRtimes10 < -640) pdu->rx_indication_rel8.ul_cqi=0;
|
||||
else if (SNRtimes10 > 635) pdu->rx_indication_rel8.ul_cqi=255;
|
||||
else pdu->rx_indication_rel8.ul_cqi=(640+SNRtimes10)/5;
|
||||
if (SNRtimes10 < -640) cqi=0;
|
||||
else if (SNRtimes10 > 635) cqi=255;
|
||||
else cqi=(640+SNRtimes10)/5;
|
||||
|
||||
// LOG_D(PHY,"[PUSCH %d] Frame %d Subframe %d Filling RX_indication with SNR %d (%d), timing_advance %d (update %d)\n",
|
||||
// harq_pid,frame,slot_rx,SNRtimes10,pdu->rx_indication_rel8.ul_cqi,pdu->rx_indication_rel8.timing_advance,
|
||||
// timing_advance_update);
|
||||
// crc indication
|
||||
uint16_t num_crc = gNB->UL_INFO.crc_ind.number_crcs;
|
||||
gNB->UL_INFO.crc_ind.crc_list = &gNB->crc_pdu_list[0];
|
||||
gNB->UL_INFO.crc_ind.sfn = frame;
|
||||
gNB->UL_INFO.crc_ind.slot = slot_rx;
|
||||
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus++;
|
||||
gNB->UL_INFO.rx_ind.sfn_sf = frame<<4 | slot_rx;
|
||||
gNB->crc_pdu_list[num_crc].handle = pusch_pdu->handle;
|
||||
gNB->crc_pdu_list[num_crc].rnti = pusch_pdu->rnti;
|
||||
gNB->crc_pdu_list[num_crc].harq_id = harq_pid;
|
||||
gNB->crc_pdu_list[num_crc].tb_crc_status = crc_flag;
|
||||
gNB->crc_pdu_list[num_crc].num_cb = pusch_pdu->pusch_data.num_cb;
|
||||
gNB->crc_pdu_list[num_crc].ul_cqi = cqi;
|
||||
gNB->crc_pdu_list[num_crc].timing_advance = timing_advance_update;
|
||||
gNB->crc_pdu_list[num_crc].rssi = 0xffff; // invalid value as this is not yet computed
|
||||
|
||||
pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
||||
}
|
||||
gNB->UL_INFO.crc_ind.number_crcs++;
|
||||
|
||||
// rx indication
|
||||
uint16_t num_rx = gNB->UL_INFO.rx_ind.number_of_pdus;
|
||||
gNB->UL_INFO.rx_ind.pdu_list = &gNB->rx_pdu_list[0];
|
||||
gNB->UL_INFO.rx_ind.sfn = frame;
|
||||
gNB->UL_INFO.rx_ind.slot = slot_rx;
|
||||
gNB->rx_pdu_list[num_rx].handle = pusch_pdu->handle;
|
||||
gNB->rx_pdu_list[num_rx].rnti = pusch_pdu->rnti;
|
||||
gNB->rx_pdu_list[num_rx].harq_id = harq_pid;
|
||||
gNB->rx_pdu_list[num_rx].ul_cqi = cqi;
|
||||
gNB->rx_pdu_list[num_rx].timing_advance = timing_advance_update;
|
||||
gNB->rx_pdu_list[num_rx].rssi = 0xffff; // invalid value as this is not yet computed
|
||||
if (crc_flag)
|
||||
gNB->rx_pdu_list[num_rx].pdu_length = 0;
|
||||
else {
|
||||
gNB->rx_pdu_list[num_rx].pdu_length = harq_process->TBS;
|
||||
gNB->rx_pdu_list[num_rx].pdu = harq_process->b;
|
||||
}
|
||||
|
||||
gNB->UL_INFO.rx_ind.number_of_pdus++;
|
||||
|
||||
void nr_fill_crc_indication (PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, uint8_t crc_flag) {
|
||||
pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||
nfapi_crc_indication_pdu_t *pdu = &gNB->UL_INFO. crc_ind.crc_indication_body.crc_pdu_list[gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs];
|
||||
gNB->UL_INFO.crc_ind.sfn_sf = frame<<4 | slot_rx;
|
||||
gNB->UL_INFO.crc_ind.header.message_id = NFAPI_CRC_INDICATION;
|
||||
gNB->UL_INFO.crc_ind.crc_indication_body.tl.tag = NFAPI_CRC_INDICATION_BODY_TAG;
|
||||
pdu->instance_length = 0; // don't know what to do with this
|
||||
// pdu->rx_ue_information.handle = handle;
|
||||
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
|
||||
pdu->rx_ue_information.rnti = gNB->ulsch[ULSCH_id][0]->rnti;
|
||||
pdu->crc_indication_rel8.tl.tag = NFAPI_CRC_INDICATION_REL8_TAG;
|
||||
pdu->crc_indication_rel8.crc_flag = crc_flag;
|
||||
gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs++;
|
||||
//LOG_D(PHY, "%s() rnti:%04x crcs:%d crc_flag:%d\n", __FUNCTION__, pdu->rx_ue_information.rnti, eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs, crc_flag);
|
||||
pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
||||
}
|
||||
|
||||
@@ -404,55 +391,57 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
|
||||
LOG_D(PHY,"phy_procedures_gNB_uespec_RX frame %d, slot %d, num_pdus %d\n",frame_rx,slot_rx,num_pdus);
|
||||
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
gNB->UL_INFO.rx_ind.number_of_pdus = 0;
|
||||
gNB->UL_INFO.crc_ind.number_crcs = 0;
|
||||
|
||||
for (int i = 0; i < num_pdus; i++) {
|
||||
switch (UL_tti_req->pdus_list[i].pdu_type) {
|
||||
case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE:{
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE\n",frame_rx,slot_rx);
|
||||
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu = &UL_tti_req->pdus_list[0].pusch_pdu;
|
||||
nr_fill_ulsch(gNB,frame_rx,slot_rx,pusch_pdu);
|
||||
|
||||
uint8_t ULSCH_id = find_nr_ulsch(pusch_pdu->rnti,gNB,SEARCH_EXIST);
|
||||
uint8_t harq_pid = pusch_pdu->pusch_data.harq_process_id;
|
||||
uint8_t symbol_start = pusch_pdu->start_symbol_index;
|
||||
uint8_t symbol_end = symbol_start + pusch_pdu->nr_of_symbols;
|
||||
|
||||
for(uint8_t symbol = symbol_start; symbol < symbol_end; symbol++) {
|
||||
nr_rx_pusch(gNB, ULSCH_id, frame_rx, slot_rx, symbol, harq_pid);
|
||||
}
|
||||
//LOG_M("rxdataF_comp.m","rxF_comp",gNB->pusch_vars[0]->rxdataF_comp[0],6900,1,1);
|
||||
//LOG_M("rxdataF_ext.m","rxF_ext",gNB->pusch_vars[0]->rxdataF_ext[0],6900,1,1);
|
||||
nr_ulsch_procedures(gNB, frame_rx, slot_rx, ULSCH_id, harq_pid);
|
||||
nr_fill_rx_indication(gNB, frame_rx, slot_rx, ULSCH_id, harq_pid); // indicate SDU to MAC
|
||||
nr_fill_crc_indication(gNB, frame_rx, slot_rx, ULSCH_id, 0);
|
||||
}
|
||||
break;
|
||||
case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE:{
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE\n",frame_rx,slot_rx);
|
||||
|
||||
nfapi_nr_pucch_pdu_t *pucch_pdu = &UL_tti_req->pdus_list[i].pucch_pdu;
|
||||
switch (pucch_pdu->format_type) {
|
||||
case 0:
|
||||
uci_indication->uci_list[uci_indication->num_ucis].pdu_type = NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE;
|
||||
uci_indication->uci_list[uci_indication->num_ucis].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_0_1_t);
|
||||
nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu_format0 = &uci_indication->uci_list[uci_indication->num_ucis].pucch_pdu_format_0_1;
|
||||
case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE:
|
||||
{
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE\n",frame_rx,slot_rx);
|
||||
|
||||
nr_decode_pucch0(gNB,
|
||||
slot_rx,
|
||||
uci_pdu_format0,
|
||||
pucch_pdu);
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu = &UL_tti_req->pdus_list[0].pusch_pdu;
|
||||
nr_fill_ulsch(gNB,frame_rx,slot_rx,pusch_pdu);
|
||||
|
||||
uci_indication->num_ucis += 1;
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Only PUCCH format 0 and 1 are currently supported\n");
|
||||
uint8_t ULSCH_id = find_nr_ulsch(pusch_pdu->rnti,gNB,SEARCH_EXIST);
|
||||
uint8_t harq_pid = pusch_pdu->pusch_data.harq_process_id;
|
||||
uint8_t symbol_start = pusch_pdu->start_symbol_index;
|
||||
uint8_t symbol_end = symbol_start + pusch_pdu->nr_of_symbols;
|
||||
|
||||
for(uint8_t symbol = symbol_start; symbol < symbol_end; symbol++) {
|
||||
nr_rx_pusch(gNB, ULSCH_id, frame_rx, slot_rx, symbol, harq_pid);
|
||||
}
|
||||
//LOG_M("rxdataF_comp.m","rxF_comp",gNB->pusch_vars[0]->rxdataF_comp[0],6900,1,1);
|
||||
//LOG_M("rxdataF_ext.m","rxF_ext",gNB->pusch_vars[0]->rxdataF_ext[0],6900,1,1);
|
||||
nr_ulsch_procedures(gNB, frame_rx, slot_rx, ULSCH_id, harq_pid);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE:
|
||||
{
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE\n",frame_rx,slot_rx);
|
||||
|
||||
nfapi_nr_pucch_pdu_t *pucch_pdu = &UL_tti_req->pdus_list[i].pucch_pdu;
|
||||
switch (pucch_pdu->format_type) {
|
||||
case 0:
|
||||
uci_indication->uci_list[uci_indication->num_ucis].pdu_type = NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE;
|
||||
uci_indication->uci_list[uci_indication->num_ucis].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_0_1_t);
|
||||
nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu_format0 = &uci_indication->uci_list[uci_indication->num_ucis].pucch_pdu_format_0_1;
|
||||
|
||||
nr_decode_pucch0(gNB,
|
||||
slot_rx,
|
||||
uci_pdu_format0,
|
||||
pucch_pdu);
|
||||
|
||||
uci_indication->num_ucis += 1;
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Only PUCCH format 0,1 and 2 are currently supported\n")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,6 +413,7 @@ int main(int argc, char **argv)
|
||||
printf("-c Start symbol for PDSCH (fixed for now)\n");
|
||||
printf("-j Number of symbols for PDSCH (fixed for now)\n");
|
||||
printf("-e MSC index\n");
|
||||
printf("-P Print DLSCH performances\n");
|
||||
exit (-1);
|
||||
break;
|
||||
}
|
||||
@@ -902,7 +903,6 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (print_perf==1) {
|
||||
printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, TBS %d, Kr %d (Zc %d))\n",
|
||||
1000>>*scc->ssbSubcarrierSpacing,dlsch_config.rbSize,dlsch_config.mcsIndex[0],
|
||||
|
||||
@@ -55,7 +55,8 @@
|
||||
#include "openair2/RRC/NR/MESSAGES/asn1_msg.h"
|
||||
#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
|
||||
#define inMicroS(a) (((double)(a))/(cpu_freq_GHz*1000.0))
|
||||
#include "SIMULATION/LTE_PHY/common_sim.h"
|
||||
//#define DEBUG_ULSIM
|
||||
|
||||
PHY_VARS_gNB *gNB;
|
||||
@@ -140,7 +141,7 @@ int main(int argc, char **argv)
|
||||
int start_rb = 0;
|
||||
int UE_id =0; // [hna] only works for UE_id = 0 because NUMBER_OF_NR_UE_MAX is set to 1 (phy_init_nr_gNB causes segmentation fault)
|
||||
float target_error_rate = 0.01;
|
||||
|
||||
int print_perf = 0;
|
||||
cpuf = get_cpu_freq_GHz();
|
||||
|
||||
|
||||
@@ -155,7 +156,7 @@ int main(int argc, char **argv)
|
||||
//logInit();
|
||||
randominit(0);
|
||||
|
||||
while ((c = getopt(argc, argv, "d:f:g:h:i:j:l:m:n:p:r:s:y:z:F:M:N:P:R:S:L:")) != -1) {
|
||||
while ((c = getopt(argc, argv, "d:f:g:h:i:j:l:m:n:p:r:s:y:z:F:M:N:PR:S:L:")) != -1) {
|
||||
switch (c) {
|
||||
|
||||
/*case 'd':
|
||||
@@ -309,9 +310,14 @@ int main(int argc, char **argv)
|
||||
printf("Setting SNR1 to %f\n", snr1);
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
loglvl = atoi(optarg);
|
||||
break;
|
||||
case 'P':
|
||||
print_perf=1;
|
||||
opp_enabled=1;
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
loglvl = atoi(optarg);
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'h':
|
||||
@@ -340,6 +346,7 @@ int main(int argc, char **argv)
|
||||
printf("-O oversampling factor (1,2,4,8,16)\n");
|
||||
printf("-R N_RB_DL\n");
|
||||
printf("-S Ending SNR, runs from SNR0 to SNR1\n");
|
||||
printf("-P Print ULSCH performances\n");
|
||||
exit(-1);
|
||||
break;
|
||||
}
|
||||
@@ -370,10 +377,10 @@ int main(int argc, char **argv)
|
||||
//gNB_config = &gNB->gNB_config;
|
||||
|
||||
//memset((void *)&gNB->UL_INFO,0,sizeof(gNB->UL_INFO));
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list = (nfapi_rx_indication_pdu_t *)malloc(NB_UE_INST*sizeof(nfapi_rx_indication_pdu_t));
|
||||
gNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list = (nfapi_crc_indication_pdu_t *)malloc(NB_UE_INST*sizeof(nfapi_crc_indication_pdu_t));
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs = 0;
|
||||
gNB->UL_INFO.rx_ind.pdu_list = (nfapi_nr_rx_data_pdu_t *)malloc(NB_UE_INST*sizeof(nfapi_nr_rx_data_pdu_t));
|
||||
gNB->UL_INFO.crc_ind.crc_list = (nfapi_nr_crc_t *)malloc(NB_UE_INST*sizeof(nfapi_nr_crc_t));
|
||||
gNB->UL_INFO.rx_ind.number_of_pdus = 0;
|
||||
gNB->UL_INFO.crc_ind.number_crcs = 0;
|
||||
frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH)
|
||||
frame_parms->nb_antennas_tx = n_tx;
|
||||
frame_parms->nb_antennas_rx = n_rx;
|
||||
@@ -524,6 +531,18 @@ int main(int argc, char **argv)
|
||||
|
||||
for (SNR = snr0; SNR < snr1; SNR += snr_step) {
|
||||
|
||||
varArray_t *table_rx=initVarArray(1000,sizeof(double));
|
||||
reset_meas(&gNB->phy_proc_rx);
|
||||
reset_meas(&gNB->ulsch_decoding_stats);
|
||||
reset_meas(&gNB->ulsch_deinterleaving_stats);
|
||||
reset_meas(&gNB->ulsch_rate_unmatching_stats);
|
||||
reset_meas(&gNB->ulsch_ldpc_decoding_stats);
|
||||
reset_meas(&gNB->ulsch_unscrambling_stats);
|
||||
reset_meas(&gNB->ulsch_channel_estimation_stats);
|
||||
reset_meas(&gNB->ulsch_llr_stats);
|
||||
reset_meas(&gNB->ulsch_channel_compensation_stats);
|
||||
reset_meas(&gNB->ulsch_rbs_extraction_stats);
|
||||
|
||||
UE_proc.nr_tti_tx = slot;
|
||||
UE_proc.frame_tx = frame;
|
||||
|
||||
@@ -651,15 +670,17 @@ int main(int argc, char **argv)
|
||||
//----------------------------------------------------------
|
||||
//------------------- gNB phy procedures -------------------
|
||||
//----------------------------------------------------------
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs = 0;
|
||||
gNB->UL_INFO.rx_ind.number_of_pdus = 0;
|
||||
gNB->UL_INFO.crc_ind.number_crcs = 0;
|
||||
|
||||
start_meas(&gNB->phy_proc_rx);
|
||||
phy_procedures_gNB_common_RX(gNB, frame, slot);
|
||||
|
||||
if (n_trials==1)
|
||||
LOG_M("rxsigF0.m","rxsF0",gNB->common_vars.rxdataF[0],frame_length_complex_samples_no_prefix,1,1);
|
||||
|
||||
phy_procedures_gNB_uespec_RX(gNB, frame, slot);
|
||||
start_meas(&gNB->phy_proc_rx);
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
if (gNB->ulsch[0][0]->last_iteration_cnt >=
|
||||
@@ -713,6 +734,20 @@ int main(int argc, char **argv)
|
||||
printf("*****************************************\n");
|
||||
printf("\n");
|
||||
|
||||
if (print_perf==1) {
|
||||
printDistribution(&gNB->phy_proc_rx,table_rx,"Total PHY proc rx");
|
||||
printStatIndent(&gNB->ulsch_channel_estimation_stats,"ULSCH channel estimation time");
|
||||
printStatIndent(&gNB->ulsch_rbs_extraction_stats,"ULSCH rbs extraction time");
|
||||
printStatIndent(&gNB->ulsch_channel_compensation_stats,"ULSCH channel compensation time");
|
||||
printStatIndent(&gNB->ulsch_llr_stats,"ULSCH llr computation");
|
||||
printStatIndent(&gNB->ulsch_unscrambling_stats,"ULSCH unscrambling");
|
||||
printStatIndent(&gNB->ulsch_decoding_stats,"ULSCH total decoding time");
|
||||
printStatIndent2(&gNB->ulsch_deinterleaving_stats,"ULSCH deinterleaving");
|
||||
printStatIndent2(&gNB->ulsch_rate_unmatching_stats,"ULSCH rate matching rx");
|
||||
printStatIndent2(&gNB->ulsch_ldpc_decoding_stats,"ULSCH ldpc decoding");
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
if(n_trials==1)
|
||||
break;
|
||||
|
||||
|
||||
@@ -939,7 +939,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
|
||||
|
||||
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
|
||||
for (j = 0; j < 8; j++) {
|
||||
if (RC.mac && RC.mac[mod_id] && RC.mac[mod_id]->UE_list.eNB_UE_stats[UE_PCCID(mod_id,i)][i].harq_pid == 1) {
|
||||
if (RC.mac && RC.mac[mod_id] && RC.mac[mod_id]->UE_info.eNB_UE_stats[UE_PCCID(mod_id,i)][i].harq_pid == 1) {
|
||||
available_harq[i] = j;
|
||||
break;
|
||||
}
|
||||
@@ -977,13 +977,13 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
|
||||
|
||||
dl_info[i]->harq_process_id = available_harq[UE_id];
|
||||
if (RC.mac && RC.mac[mod_id])
|
||||
RC.mac[mod_id]->UE_list.eNB_UE_stats[UE_PCCID(mod_id, UE_id)][UE_id].harq_pid = 0;
|
||||
RC.mac[mod_id]->UE_info.eNB_UE_stats[UE_PCCID(mod_id, UE_id)][UE_id].harq_pid = 0;
|
||||
dl_info[i]->has_harq_process_id = 1;
|
||||
/* Fill in the status of the HARQ process (2 TBs)*/
|
||||
dl_info[i]->n_harq_status = 2;
|
||||
dl_info[i]->harq_status = malloc(sizeof(uint32_t) * dl_info[i]->n_harq_status);
|
||||
for (j = 0; j < dl_info[i]->n_harq_status; j++) {
|
||||
dl_info[i]->harq_status[j] = RC.mac[mod_id]->UE_list.UE_sched_ctrl[UE_id].round[UE_PCCID(mod_id, UE_id)][j];
|
||||
dl_info[i]->harq_status[j] = RC.mac[mod_id]->UE_info.UE_sched_ctrl[UE_id].round[UE_PCCID(mod_id, UE_id)][j];
|
||||
// TODO: This should be different per TB
|
||||
}
|
||||
// LOG_I(FLEXRAN_AGENT, "Sending subframe trigger for frame %d and subframe %d and harq %d (round %d)\n", flexran_get_current_frame(mod_id), (flexran_get_current_subframe(mod_id) + 1) % 10, dl_info[i]->harq_process_id, dl_info[i]->harq_status[0]);
|
||||
@@ -1357,7 +1357,7 @@ void flexran_agent_init_mac_agent(mid_t mod_id) {
|
||||
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
|
||||
for (j = 0; j < 8; j++) {
|
||||
if (RC.mac && RC.mac[mod_id])
|
||||
RC.mac[mod_id]->UE_list.eNB_UE_stats[UE_PCCID(mod_id,i)][i].harq_pid = 0;
|
||||
RC.mac[mod_id]->UE_info.eNB_UE_stats[UE_PCCID(mod_id,i)][i].harq_pid = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ typedef enum {
|
||||
#define CONFIG_STRING_RU_NBIOTRRC_LIST "NbIoT_RRC_instances"
|
||||
#define CONFIG_STRING_RU_SDR_ADDRS "sdr_addrs"
|
||||
#define CONFIG_STRING_RU_SDR_CLK_SRC "clock_src"
|
||||
#define CONFIG_STRING_RU_SDR_TME_SRC "time_src"
|
||||
#define CONFIG_STRING_RU_SF_EXTENSION "sf_extension"
|
||||
#define CONFIG_STRING_RU_END_OF_BURST_DELAY "end_of_burst_delay"
|
||||
#define CONFIG_STRING_RU_OTA_SYNC_ENABLE "ota_sync_enabled"
|
||||
@@ -117,11 +118,12 @@ typedef enum {
|
||||
#define RU_NBIOTRRC_LIST_IDX 18
|
||||
#define RU_SDR_ADDRS 19
|
||||
#define RU_SDR_CLK_SRC 20
|
||||
#define RU_SF_EXTENSION_IDX 21
|
||||
#define RU_END_OF_BURST_DELAY_IDX 22
|
||||
#define RU_OTA_SYNC_ENABLE_IDX 23
|
||||
#define RU_BF_WEIGHTS_LIST_IDX 24
|
||||
#define RU_IF_FREQUENCY 25
|
||||
#define RU_SDR_TME_SRC 21
|
||||
#define RU_SF_EXTENSION_IDX 22
|
||||
#define RU_END_OF_BURST_DELAY_IDX 23
|
||||
#define RU_OTA_SYNC_ENABLE_IDX 24
|
||||
#define RU_BF_WEIGHTS_LIST_IDX 25
|
||||
#define RU_IF_FREQUENCY 26
|
||||
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* RU configuration parameters */
|
||||
@@ -149,6 +151,7 @@ typedef enum {
|
||||
{CONFIG_STRING_RU_NBIOTRRC_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFENBS, TYPE_INTARRAY, 1}, \
|
||||
{CONFIG_STRING_RU_SDR_ADDRS, NULL, 0, strptr:NULL, defstrval:"type=b200", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_SDR_CLK_SRC, NULL, 0, strptr:NULL, defstrval:"internal", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_SDR_TME_SRC, NULL, 0, strptr:NULL, defstrval:"internal", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_SF_EXTENSION, NULL, 0, uptr:NULL, defuintval:312, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_END_OF_BURST_DELAY, NULL, 0, uptr:NULL, defuintval:400, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_OTA_SYNC_ENABLE, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
|
||||
|
||||
@@ -98,7 +98,7 @@ uint16_t flexran_get_future_sfn_sf(mid_t mod_id, int ahead_of_time) {
|
||||
int flexran_get_mac_num_ues(mid_t mod_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.num_UEs;
|
||||
return RC.mac[mod_id]->UE_info.num_UEs;
|
||||
}
|
||||
|
||||
int flexran_get_num_ue_lcs(mid_t mod_id, mid_t ue_id) {
|
||||
@@ -123,7 +123,7 @@ int flexran_get_mac_ue_id_rnti(mid_t mod_id, rnti_t rnti) {
|
||||
|
||||
/* get the (active) UE with RNTI i */
|
||||
for (n = 0; n < MAX_MOBILES_PER_ENB; ++n) {
|
||||
if (RC.mac[mod_id]->UE_list.active[n] == TRUE
|
||||
if (RC.mac[mod_id]->UE_info.active[n] == TRUE
|
||||
&& rnti == UE_RNTI(mod_id, n)) {
|
||||
return n;
|
||||
}
|
||||
@@ -139,7 +139,7 @@ int flexran_get_mac_ue_id(mid_t mod_id, int i) {
|
||||
|
||||
/* get the (i+1)'th active UE */
|
||||
for (n = 0; n < MAX_MOBILES_PER_ENB; ++n) {
|
||||
if (RC.mac[mod_id]->UE_list.active[n] == TRUE) {
|
||||
if (RC.mac[mod_id]->UE_info.active[n] == TRUE) {
|
||||
if (i == 0)
|
||||
return n;
|
||||
|
||||
@@ -159,19 +159,19 @@ rnti_t flexran_get_mac_ue_crnti(mid_t mod_id, mid_t ue_id) {
|
||||
int flexran_get_ue_bsr_ul_buffer_info(mid_t mod_id, mid_t ue_id, lcid_t lcid) {
|
||||
if (!mac_is_present(mod_id)) return -1;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.UE_template[UE_PCCID(mod_id, ue_id)][ue_id].ul_buffer_info[lcid];
|
||||
return RC.mac[mod_id]->UE_info.UE_template[UE_PCCID(mod_id, ue_id)][ue_id].ul_buffer_info[lcid];
|
||||
}
|
||||
|
||||
int8_t flexran_get_ue_phr(mid_t mod_id, mid_t ue_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.UE_template[UE_PCCID(mod_id, ue_id)][ue_id].phr_info;
|
||||
return RC.mac[mod_id]->UE_info.UE_template[UE_PCCID(mod_id, ue_id)][ue_id].phr_info;
|
||||
}
|
||||
|
||||
uint8_t flexran_get_ue_wcqi(mid_t mod_id, mid_t ue_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.UE_sched_ctrl[ue_id].dl_cqi[0];
|
||||
return RC.mac[mod_id]->UE_info.UE_sched_ctrl[ue_id].dl_cqi[0];
|
||||
}
|
||||
|
||||
rlc_buffer_occupancy_t flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id) {
|
||||
@@ -180,7 +180,7 @@ rlc_buffer_occupancy_t flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logi
|
||||
rnti_t rnti = flexran_get_mac_ue_crnti(mod_id, ue_id);
|
||||
frame_t frame = flexran_get_current_frame(mod_id);
|
||||
sub_frame_t subframe = flexran_get_current_subframe(mod_id);
|
||||
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id,rnti, mod_id, frame, subframe, ENB_FLAG_YES,MBMS_FLAG_NO, channel_id, 0,0, 0
|
||||
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id,rnti, mod_id, frame, subframe, ENB_FLAG_YES,MBMS_FLAG_NO, channel_id, 0, 0
|
||||
);
|
||||
return rlc_status.bytes_in_buffer;
|
||||
}
|
||||
@@ -191,7 +191,7 @@ rlc_buffer_occupancy_t flexran_get_num_pdus_buffer(mid_t mod_id, mid_t ue_id, lo
|
||||
rnti_t rnti = flexran_get_mac_ue_crnti(mod_id,ue_id);
|
||||
frame_t frame = flexran_get_current_frame(mod_id);
|
||||
sub_frame_t subframe = flexran_get_current_subframe(mod_id);
|
||||
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id,rnti, mod_id, frame, subframe, ENB_FLAG_YES,MBMS_FLAG_NO, channel_id, 0,0, 0
|
||||
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id,rnti, mod_id, frame, subframe, ENB_FLAG_YES,MBMS_FLAG_NO, channel_id, 0, 0
|
||||
);
|
||||
return rlc_status.pdus_in_buffer;
|
||||
}
|
||||
@@ -202,7 +202,7 @@ frame_t flexran_get_hol_delay(mid_t mod_id, mid_t ue_id, logical_chan_id_t chann
|
||||
rnti_t rnti = flexran_get_mac_ue_crnti(mod_id,ue_id);
|
||||
frame_t frame = flexran_get_current_frame(mod_id);
|
||||
sub_frame_t subframe = flexran_get_current_subframe(mod_id);
|
||||
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id, rnti, mod_id, frame, subframe, ENB_FLAG_YES, MBMS_FLAG_NO, channel_id, 0,0, 0
|
||||
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id, rnti, mod_id, frame, subframe, ENB_FLAG_YES, MBMS_FLAG_NO, channel_id, 0, 0
|
||||
);
|
||||
return rlc_status.head_sdu_creation_time;
|
||||
}
|
||||
@@ -242,7 +242,7 @@ int32_t flexran_get_TA(mid_t mod_id, mid_t ue_id, uint8_t cc_id) {
|
||||
uint32_t flexran_get_total_size_dl_mac_sdus(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].total_sdu_bytes;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].total_sdu_bytes;
|
||||
}
|
||||
|
||||
uint32_t flexran_get_total_size_ul_mac_sdus(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
@@ -251,7 +251,7 @@ uint32_t flexran_get_total_size_ul_mac_sdus(mid_t mod_id, mid_t ue_id, int cc_id
|
||||
uint64_t bytes = 0;
|
||||
|
||||
for (int i = 0; i < NB_RB_MAX; ++i) {
|
||||
bytes += RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].num_bytes_rx[i];
|
||||
bytes += RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].num_bytes_rx[i];
|
||||
}
|
||||
|
||||
return bytes;
|
||||
@@ -260,135 +260,135 @@ uint32_t flexran_get_total_size_ul_mac_sdus(mid_t mod_id, mid_t ue_id, int cc_id
|
||||
uint32_t flexran_get_TBS_dl(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].TBS;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].TBS;
|
||||
}
|
||||
|
||||
uint32_t flexran_get_TBS_ul(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].ulsch_TBS;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].ulsch_TBS;
|
||||
}
|
||||
|
||||
uint16_t flexran_get_num_prb_retx_dl_per_ue(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].rbs_used_retx;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].rbs_used_retx;
|
||||
}
|
||||
|
||||
uint32_t flexran_get_num_prb_retx_ul_per_ue(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].rbs_used_retx_rx;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].rbs_used_retx_rx;
|
||||
}
|
||||
|
||||
uint16_t flexran_get_num_prb_dl_tx_per_ue(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].rbs_used;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].rbs_used;
|
||||
}
|
||||
|
||||
uint16_t flexran_get_num_prb_ul_rx_per_ue(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].rbs_used_rx;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].rbs_used_rx;
|
||||
}
|
||||
|
||||
uint8_t flexran_get_ue_wpmi(mid_t mod_id, mid_t ue_id, uint8_t cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.UE_sched_ctrl[ue_id].periodic_wideband_pmi[cc_id];
|
||||
return RC.mac[mod_id]->UE_info.UE_sched_ctrl[ue_id].periodic_wideband_pmi[cc_id];
|
||||
}
|
||||
|
||||
uint8_t flexran_get_mcs1_dl(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].dlsch_mcs1;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].dlsch_mcs1;
|
||||
}
|
||||
|
||||
uint8_t flexran_get_mcs2_dl(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].dlsch_mcs2;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].dlsch_mcs2;
|
||||
}
|
||||
|
||||
uint8_t flexran_get_mcs1_ul(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].ulsch_mcs1;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].ulsch_mcs1;
|
||||
}
|
||||
|
||||
uint8_t flexran_get_mcs2_ul(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].ulsch_mcs2;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].ulsch_mcs2;
|
||||
}
|
||||
|
||||
uint32_t flexran_get_total_prb_dl_tx_per_ue(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].total_rbs_used;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].total_rbs_used;
|
||||
}
|
||||
|
||||
uint32_t flexran_get_total_prb_ul_rx_per_ue(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].total_rbs_used_rx;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].total_rbs_used_rx;
|
||||
}
|
||||
|
||||
uint32_t flexran_get_total_num_pdu_dl(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].total_num_pdus;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].total_num_pdus;
|
||||
}
|
||||
|
||||
uint32_t flexran_get_total_num_pdu_ul(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].total_num_pdus_rx;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].total_num_pdus_rx;
|
||||
}
|
||||
|
||||
uint64_t flexran_get_total_TBS_dl(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].total_pdu_bytes;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].total_pdu_bytes;
|
||||
}
|
||||
|
||||
uint64_t flexran_get_total_TBS_ul(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].total_ulsch_TBS;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].total_ulsch_TBS;
|
||||
}
|
||||
|
||||
int flexran_get_harq_round(mid_t mod_id, uint8_t cc_id, mid_t ue_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].harq_round;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].harq_round;
|
||||
}
|
||||
|
||||
uint32_t flexran_get_num_mac_sdu_tx(mid_t mod_id, mid_t ue_id, int cc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].num_mac_sdu_tx;
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].num_mac_sdu_tx;
|
||||
}
|
||||
|
||||
unsigned char flexran_get_mac_sdu_lcid_index(mid_t mod_id, mid_t ue_id, int cc_id, int index) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].lcid_sdu[index];
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].lcid_sdu[index];
|
||||
}
|
||||
|
||||
uint32_t flexran_get_mac_sdu_size(mid_t mod_id, mid_t ue_id, int cc_id, int lcid) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].sdu_length_tx[lcid];
|
||||
return RC.mac[mod_id]->UE_info.eNB_UE_stats[cc_id][ue_id].sdu_length_tx[lcid];
|
||||
}
|
||||
|
||||
|
||||
/* TODO needs to be revised */
|
||||
void flexran_update_TA(mid_t mod_id, mid_t ue_id, uint8_t cc_id) {
|
||||
/*
|
||||
UE_list_t *UE_list=&eNB_mac_inst[mod_id].UE_list;
|
||||
UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[ue_id];
|
||||
UE_info_t *UE_info=&eNB_mac_inst[mod_id].UE_info;
|
||||
UE_sched_ctrl *ue_sched_ctl = &UE_info->UE_sched_ctrl[ue_id];
|
||||
|
||||
if (ue_sched_ctl->ta_timer == 0) {
|
||||
|
||||
@@ -432,7 +432,7 @@ int flexran_get_MAC_CE_bitmap_TA(mid_t mod_id, mid_t ue_id, uint8_t cc_id) {
|
||||
int flexran_get_active_CC(mid_t mod_id, mid_t ue_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.numactiveCCs[ue_id];
|
||||
return RC.mac[mod_id]->UE_info.numactiveCCs[ue_id];
|
||||
}
|
||||
|
||||
uint8_t flexran_get_current_RI(mid_t mod_id, mid_t ue_id, uint8_t cc_id) {
|
||||
@@ -890,13 +890,13 @@ uint8_t flexran_get_rrc_status(mid_t mod_id, rnti_t rnti) {
|
||||
uint64_t flexran_get_ue_aggregated_max_bitrate_dl(mid_t mod_id, mid_t ue_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.UE_sched_ctrl[ue_id].ue_AggregatedMaximumBitrateDL;
|
||||
return 0; //RC.mac[mod_id]->UE_info.UE_sched_ctrl[ue_id].ue_AggregatedMaximumBitrateDL;
|
||||
}
|
||||
|
||||
uint64_t flexran_get_ue_aggregated_max_bitrate_ul(mid_t mod_id, mid_t ue_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.UE_sched_ctrl[ue_id].ue_AggregatedMaximumBitrateUL;
|
||||
return 0; //RC.mac[mod_id]->UE_info.UE_sched_ctrl[ue_id].ue_AggregatedMaximumBitrateUL;
|
||||
}
|
||||
|
||||
int flexran_get_half_duplex(mid_t mod_id, rnti_t rnti) {
|
||||
@@ -1235,7 +1235,7 @@ uint64_t flexran_get_ue_imsi(mid_t mod_id, rnti_t rnti) {
|
||||
long flexran_get_lcg(mid_t mod_id, mid_t ue_id, mid_t lc_id) {
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
|
||||
return RC.mac[mod_id]->UE_list.UE_template[UE_PCCID(mod_id, ue_id)][ue_id].lcgidmap[lc_id];
|
||||
return RC.mac[mod_id]->UE_info.UE_template[UE_PCCID(mod_id, ue_id)][ue_id].lcgidmap[lc_id];
|
||||
}
|
||||
|
||||
/* TODO Navid: needs to be revised */
|
||||
@@ -3016,7 +3016,7 @@ uint32_t flexran_get_rrc_enb_ue_s1ap_id(mid_t mod_id, rnti_t rnti)
|
||||
int flexran_get_ue_dl_slice_id(mid_t mod_id, mid_t ue_id) {
|
||||
if (!mac_is_present(mod_id)) return -1;
|
||||
|
||||
int slice_idx = RC.mac[mod_id]->UE_list.assoc_dl_slice_idx[ue_id];
|
||||
int slice_idx = 0; //RC.mac[mod_id]->UE_info.assoc_dl_slice_idx[ue_id];
|
||||
|
||||
if (slice_idx >= 0 && slice_idx < RC.mac[mod_id]->slice_info.n_dl)
|
||||
return RC.mac[mod_id]->slice_info.dl[slice_idx].id;
|
||||
@@ -3031,13 +3031,13 @@ void flexran_set_ue_dl_slice_idx(mid_t mod_id, mid_t ue_id, int slice_idx) {
|
||||
|
||||
if (!flexran_dl_slice_exists(mod_id, slice_idx)) return;
|
||||
|
||||
RC.mac[mod_id]->UE_list.assoc_dl_slice_idx[ue_id] = slice_idx;
|
||||
//RC.mac[mod_id]->UE_info.assoc_dl_slice_idx[ue_id] = slice_idx;
|
||||
}
|
||||
|
||||
int flexran_get_ue_ul_slice_id(mid_t mod_id, mid_t ue_id) {
|
||||
if (!mac_is_present(mod_id)) return -1;
|
||||
|
||||
int slice_idx = RC.mac[mod_id]->UE_list.assoc_ul_slice_idx[ue_id];
|
||||
int slice_idx = 0; //RC.mac[mod_id]->UE_info.assoc_ul_slice_idx[ue_id];
|
||||
|
||||
if (slice_idx >= 0 && slice_idx < RC.mac[mod_id]->slice_info.n_ul)
|
||||
return RC.mac[mod_id]->slice_info.ul[slice_idx].id;
|
||||
@@ -3052,7 +3052,7 @@ void flexran_set_ue_ul_slice_idx(mid_t mod_id, mid_t ue_id, int slice_idx) {
|
||||
|
||||
if (!flexran_ul_slice_exists(mod_id, slice_idx)) return;
|
||||
|
||||
RC.mac[mod_id]->UE_list.assoc_ul_slice_idx[ue_id] = slice_idx;
|
||||
//RC.mac[mod_id]->UE_info.assoc_ul_slice_idx[ue_id] = slice_idx;
|
||||
}
|
||||
|
||||
int flexran_dl_slice_exists(mid_t mod_id, int slice_idx) {
|
||||
@@ -3103,14 +3103,14 @@ int flexran_remove_dl_slice(mid_t mod_id, int slice_idx) {
|
||||
|
||||
memset(&sli->dl[sli->n_dl], 0, sizeof(sli->dl[sli->n_dl]));
|
||||
/* all UEs that have been in the old slice are put into slice index 0 */
|
||||
int *assoc_list = RC.mac[mod_id]->UE_list.assoc_dl_slice_idx;
|
||||
//int *assoc_list = RC.mac[mod_id]->UE_info.assoc_dl_slice_idx;
|
||||
|
||||
for (int i = 0; i < MAX_MOBILES_PER_ENB; ++i) {
|
||||
if (assoc_list[i] == slice_idx)
|
||||
assoc_list[i] = 0;
|
||||
}
|
||||
//for (int i = 0; i < MAX_MOBILES_PER_ENB; ++i) {
|
||||
// if (assoc_list[i] == slice_idx)
|
||||
// assoc_list[i] = 0;
|
||||
//}
|
||||
|
||||
return sli->n_dl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int flexran_get_num_dl_slices(mid_t mod_id) {
|
||||
@@ -3397,12 +3397,12 @@ int flexran_remove_ul_slice(mid_t mod_id, int slice_idx) {
|
||||
|
||||
memset(&sli->ul[sli->n_ul], 0, sizeof(sli->ul[sli->n_ul]));
|
||||
/* all UEs that have been in the old slice are put into slice index 0 */
|
||||
int *assoc_list = RC.mac[mod_id]->UE_list.assoc_ul_slice_idx;
|
||||
//int *assoc_list = RC.mac[mod_id]->UE_info.assoc_ul_slice_idx;
|
||||
|
||||
for (int i = 0; i < MAX_MOBILES_PER_ENB; ++i) {
|
||||
if (assoc_list[i] == slice_idx)
|
||||
assoc_list[i] = 0;
|
||||
}
|
||||
//for (int i = 0; i < MAX_MOBILES_PER_ENB; ++i) {
|
||||
// if (assoc_list[i] == slice_idx)
|
||||
// assoc_list[i] = 0;
|
||||
//}
|
||||
|
||||
return sli->n_ul;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "f1ap_cu_ue_context_management.h"
|
||||
#include <string.h>
|
||||
|
||||
#include "openair2/LAYER2/MAC/mac_proto.h"
|
||||
#include "rrc_extern.h"
|
||||
#include "rrc_eNB_UE_context.h"
|
||||
#include "rrc_eNB_S1AP.h"
|
||||
|
||||
@@ -697,7 +697,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
break;
|
||||
}
|
||||
|
||||
UE_sched_ctrl_t *UE_scheduling_control = &(RC.mac[instance]->UE_list.UE_sched_ctrl[UE_id_mac]);
|
||||
UE_sched_ctrl_t *UE_scheduling_control = &(RC.mac[instance]->UE_info.UE_sched_ctrl[UE_id_mac]);
|
||||
|
||||
if (UE_scheduling_control->cdrx_waiting_ack == TRUE) {
|
||||
UE_scheduling_control->cdrx_waiting_ack = FALSE;
|
||||
|
||||
@@ -633,9 +633,9 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
|
||||
int UE_out_of_sync = 0;
|
||||
|
||||
for (int n = 0; n < MAX_MOBILES_PER_ENB; ++n) {
|
||||
if (RC.mac[instance]->UE_list.active[n] == TRUE
|
||||
if (RC.mac[instance]->UE_info.active[n] == TRUE
|
||||
&& rnti == UE_RNTI(instance, n)) {
|
||||
UE_out_of_sync = RC.mac[instance]->UE_list.UE_sched_ctrl[n].ul_out_of_sync;
|
||||
UE_out_of_sync = RC.mac[instance]->UE_info.UE_sched_ctrl[n].ul_out_of_sync;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -782,7 +782,7 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP,
|
||||
int i;
|
||||
int UE_id = -1;
|
||||
eNB_MAC_INST *eNB = RC.mac[Mod_idP];
|
||||
UE_list_t *UE_list= &eNB->UE_list;
|
||||
UE_info_t *UE_info= &eNB->UE_info;
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN);
|
||||
LOG_D(MAC, "RC.mac:%p mib:%p\n", RC.mac, mib);
|
||||
|
||||
@@ -882,6 +882,34 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP,
|
||||
}
|
||||
}
|
||||
|
||||
if (logicalChannelIdentity > 0) { // is SRB1,2 or DRB
|
||||
if ((UE_id = find_UE_id(Mod_idP, rntiP)) < 0) {
|
||||
LOG_E(MAC,"Configuration received for unknown UE (%x), shouldn't happen\n",rntiP);
|
||||
return(-1);
|
||||
}
|
||||
int idx = -1;
|
||||
UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
for (int i = 0; i < sched_ctrl->dl_lc_num; ++i) {
|
||||
if (sched_ctrl->dl_lc_ids[i] == logicalChannelIdentity) {
|
||||
/* TODO this might also mean we have to remove it, not clear */
|
||||
idx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (idx < 0) {
|
||||
sched_ctrl->dl_lc_num++;
|
||||
sched_ctrl->dl_lc_ids[sched_ctrl->dl_lc_num-1] = logicalChannelIdentity;
|
||||
sched_ctrl->dl_lc_bytes[sched_ctrl->dl_lc_num-1] = 0;
|
||||
LOG_I(MAC, "UE %d RNTI %x adding LC %ld idx %d to scheduling control (total %d)\n", UE_id, rntiP, logicalChannelIdentity, sched_ctrl->dl_lc_num-1, sched_ctrl->dl_lc_num);
|
||||
if (logicalChannelIdentity == 1) { // if it is SRB1, add SRB2 directly because RRC does not indicate this separately
|
||||
sched_ctrl->dl_lc_num++;
|
||||
sched_ctrl->dl_lc_ids[sched_ctrl->dl_lc_num-1] = 2;
|
||||
sched_ctrl->dl_lc_bytes[sched_ctrl->dl_lc_num-1] = 0;
|
||||
LOG_I(MAC, "UE %d RNTI %x adding LC 2 idx %d to scheduling control (total %d)\n", UE_id, rntiP, sched_ctrl->dl_lc_num-1, sched_ctrl->dl_lc_num);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters->logicalChannelGroup
|
||||
if (logicalChannelConfig != NULL) { // check for eMTC specific things
|
||||
UE_id = find_UE_id(Mod_idP, rntiP);
|
||||
@@ -892,9 +920,9 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP,
|
||||
}
|
||||
|
||||
if (logicalChannelConfig) {
|
||||
UE_list->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = *logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup;
|
||||
UE_list->UE_template[CC_idP][UE_id].lcgidpriority[logicalChannelIdentity] = logicalChannelConfig->ul_SpecificParameters->priority;
|
||||
} else UE_list->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = 0;
|
||||
UE_info->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = *logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup;
|
||||
UE_info->UE_template[CC_idP][UE_id].lcgidpriority[logicalChannelIdentity] = logicalChannelConfig->ul_SpecificParameters->priority;
|
||||
} else UE_info->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = 0;
|
||||
}
|
||||
|
||||
if (physicalConfigDedicated != NULL) {
|
||||
@@ -905,7 +933,7 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP,
|
||||
return(-1);
|
||||
}
|
||||
|
||||
UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated = physicalConfigDedicated;
|
||||
UE_info->UE_template[CC_idP][UE_id].physicalConfigDedicated = physicalConfigDedicated;
|
||||
LOG_I(MAC,"Added physicalConfigDedicated %p for %d.%d\n",physicalConfigDedicated,CC_idP,UE_id);
|
||||
}
|
||||
|
||||
@@ -1048,15 +1076,11 @@ void eNB_Config_Local_DRX(instance_t Mod_id,
|
||||
rrc_mac_drx_config_req_t *rrc_mac_drx_config_req)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
UE_list_t *UE_list_mac = NULL;
|
||||
UE_info_t *UE_info_mac = &RC.mac[Mod_id]->UE_info;
|
||||
UE_sched_ctrl_t *UE_scheduling_control = NULL;
|
||||
int UE_id = -1;
|
||||
|
||||
rnti_t rnti = rrc_mac_drx_config_req->rnti;
|
||||
LTE_DRX_Config_t *const drx_Configuration = rrc_mac_drx_config_req->drx_Configuration;
|
||||
|
||||
UE_list_mac = &(RC.mac[Mod_id]->UE_list);
|
||||
UE_id = find_UE_id(Mod_id, rnti);
|
||||
rnti_t rnti = rrc_mac_drx_config_req->rnti;
|
||||
int UE_id = find_UE_id(Mod_id, rnti);
|
||||
|
||||
/* Check UE_id */
|
||||
if (UE_id == -1) {
|
||||
@@ -1065,7 +1089,7 @@ void eNB_Config_Local_DRX(instance_t Mod_id,
|
||||
}
|
||||
|
||||
/* Get struct to modify */
|
||||
UE_scheduling_control = &(UE_list_mac->UE_sched_ctrl[UE_id]);
|
||||
UE_scheduling_control = &(UE_info_mac->UE_sched_ctrl[UE_id]);
|
||||
UE_scheduling_control->cdrx_configured = FALSE; // will be set to true when no error
|
||||
|
||||
/* Check drx_Configuration */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -35,7 +35,6 @@
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
@@ -89,7 +88,7 @@ void schedule_SRS(module_id_t module_idP,
|
||||
const uint16_t deltaTSFCTabType1[15][2] = { {1, 1}, {1, 2}, {2, 2}, {1, 5}, {2, 5}, {4, 5}, {8, 5}, {3, 5}, {12, 5}, {1, 10}, {2, 10}, {4, 10}, {8, 10}, {351, 10}, {383, 10} }; // Table 5.5.3.3-2 3GPP 36.211 FDD
|
||||
const uint16_t deltaTSFCTabType2[14][2] = { {2, 5}, {6, 5}, {10, 5}, {18, 5}, {14, 5}, {22, 5}, {26, 5}, {30, 5}, {70, 10}, {74, 10}, {194, 10}, {326, 10}, {586, 10}, {210, 10} }; // Table 5.5.3.3-2 3GPP 36.211 TDD
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
UE_list_t *UE_list = &(eNB->UE_list);
|
||||
UE_info_t *UE_info = &eNB->UE_info;
|
||||
nfapi_ul_config_request_body_t *ul_req = NULL;
|
||||
UE_sched_ctrl_t *UE_scheduling_control = NULL;
|
||||
COMMON_channels_t *cc = eNB->common_channels;
|
||||
@@ -117,7 +116,7 @@ void schedule_SRS(module_id_t module_idP,
|
||||
if ((1 << tmp) & deltaTSFC) {
|
||||
/* This is an SRS subframe, loop over UEs */
|
||||
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
|
||||
if (!UE_list->active[UE_id]) {
|
||||
if (!UE_info->active[UE_id]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -126,14 +125,14 @@ void schedule_SRS(module_id_t module_idP,
|
||||
continue;
|
||||
}
|
||||
|
||||
if(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated == NULL) {
|
||||
if(UE_info->UE_template[CC_id][UE_id].physicalConfigDedicated == NULL) {
|
||||
LOG_E(MAC,"physicalConfigDedicated is null for UE %d\n",UE_id);
|
||||
printf("physicalConfigDedicated is null for UE %d\n",UE_id);
|
||||
return;
|
||||
}
|
||||
|
||||
/* CDRX condition on Active Time and SRS type-0 report (36.321 5.7) */
|
||||
UE_scheduling_control = &(UE_list->UE_sched_ctrl[UE_id]);
|
||||
UE_scheduling_control = &(UE_info->UE_sched_ctrl[UE_id]);
|
||||
|
||||
/* Test if Active Time not running since 6+ subframes */
|
||||
if (UE_scheduling_control->cdrx_configured == TRUE && UE_scheduling_control->in_active_time == FALSE) {
|
||||
@@ -145,7 +144,7 @@ void schedule_SRS(module_id_t module_idP,
|
||||
|
||||
ul_req = &(eNB->UL_req[CC_id].ul_config_request_body);
|
||||
|
||||
if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated) != NULL) {
|
||||
if ((soundingRS_UL_ConfigDedicated = UE_info->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated) != NULL) {
|
||||
if (soundingRS_UL_ConfigDedicated->present == LTE_SoundingRS_UL_ConfigDedicated_PR_setup) {
|
||||
get_srs_pos(&cc[CC_id],
|
||||
soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex,
|
||||
@@ -161,7 +160,7 @@ void schedule_SRS(module_id_t module_idP,
|
||||
ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_srs_pdu));
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.size = (uint8_t)sizeof(nfapi_ul_config_srs_pdu);
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.rnti = UE_info->UE_template[CC_id][UE_id].rnti;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.frequency_domain_position = soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition;
|
||||
ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_hopping_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth;;
|
||||
@@ -173,7 +172,7 @@ void schedule_SRS(module_id_t module_idP,
|
||||
ul_req->number_of_pdus++;
|
||||
} // if (((10*frameP+subframeP) % srsPeriodicity) == srsOffset)
|
||||
} // if (soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup)
|
||||
} // if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated)!=NULL)
|
||||
} // if ((soundingRS_UL_ConfigDedicated = UE_info->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated)!=NULL)
|
||||
} // end for loop on UE_id
|
||||
} // if((1<<tmp) & deltaTSFC)
|
||||
} // SRS config not NULL
|
||||
@@ -196,7 +195,7 @@ void schedule_CSI(module_id_t module_idP,
|
||||
uint16_t N_OFFSET_CQI = 0;
|
||||
struct LTE_CQI_ReportPeriodic *cqi_ReportPeriodic = NULL;
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
UE_list_t *UE_list = &eNB->UE_list;
|
||||
UE_info_t *UE_info = &eNB->UE_info;
|
||||
COMMON_channels_t *cc = NULL;
|
||||
nfapi_ul_config_request_body_t *ul_req = NULL;
|
||||
UE_sched_ctrl_t *UE_scheduling_control = NULL;
|
||||
@@ -205,7 +204,7 @@ void schedule_CSI(module_id_t module_idP,
|
||||
cc = &eNB->common_channels[CC_id];
|
||||
|
||||
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
|
||||
if (UE_list->active[UE_id] == FALSE) {
|
||||
if (UE_info->active[UE_id] == FALSE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -214,7 +213,7 @@ void schedule_CSI(module_id_t module_idP,
|
||||
continue;
|
||||
}
|
||||
|
||||
AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL,
|
||||
AssertFatal(UE_info->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL,
|
||||
"physicalConfigDedicated is null for UE %d\n",
|
||||
UE_id);
|
||||
/*
|
||||
@@ -222,7 +221,7 @@ void schedule_CSI(module_id_t module_idP,
|
||||
* Here we consider classic periodic reports on PUCCH without PUSCH simultaneous transmission condition.
|
||||
* TODO: add the handling or test on simultaneous PUCCH/PUSCH transmission
|
||||
*/
|
||||
UE_scheduling_control = &(UE_list->UE_sched_ctrl[UE_id]);
|
||||
UE_scheduling_control = &(UE_info->UE_sched_ctrl[UE_id]);
|
||||
|
||||
if (UE_scheduling_control->cdrx_configured == TRUE) {
|
||||
/* Test if CQI masking activated */
|
||||
@@ -246,8 +245,8 @@ void schedule_CSI(module_id_t module_idP,
|
||||
|
||||
ul_req = &(eNB->UL_req[CC_id].ul_config_request_body);
|
||||
|
||||
if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig != NULL) {
|
||||
cqi_ReportPeriodic = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic;
|
||||
if (UE_info->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig != NULL) {
|
||||
cqi_ReportPeriodic = UE_info->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic;
|
||||
|
||||
if (cqi_ReportPeriodic != NULL) {
|
||||
/* Rel8 Periodic CSI (CQI/PMI/RI) reporting */
|
||||
@@ -262,10 +261,10 @@ void schedule_CSI(module_id_t module_idP,
|
||||
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE;
|
||||
ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_uci_cqi_pdu));
|
||||
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
|
||||
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
|
||||
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_info->UE_template[CC_id][UE_id].rnti;
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG;
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex;
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = get_rel8_dl_cqi_pmi_size(&UE_list->UE_sched_ctrl[UE_id], CC_id, cc, get_tmode(module_idP, CC_id, UE_id),
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = get_rel8_dl_cqi_pmi_size(&UE_info->UE_sched_ctrl[UE_id], CC_id, cc, get_tmode(module_idP, CC_id, UE_id),
|
||||
cqi_ReportPeriodic);
|
||||
ul_req->number_of_pdus++;
|
||||
ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
|
||||
@@ -279,7 +278,7 @@ void schedule_CSI(module_id_t module_idP,
|
||||
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE;
|
||||
ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_uci_cqi_pdu));
|
||||
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
|
||||
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
|
||||
ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_info->UE_template[CC_id][UE_id].rnti;
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG;
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex;
|
||||
ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = (cc->p_eNB == 2) ? 1 : 2;
|
||||
@@ -291,7 +290,7 @@ void schedule_CSI(module_id_t module_idP,
|
||||
} // if CSI Periodic is not release state
|
||||
} // if (cqi_ReportPeriodic != NULL)
|
||||
} // if cqi_ReportConfig != NULL
|
||||
} // for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
|
||||
} // for (UE_id=UE_info->head; UE_id>=0; UE_id=UE_info->next[UE_id]) {
|
||||
} // for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
}
|
||||
|
||||
@@ -309,7 +308,7 @@ schedule_SR (module_id_t module_idP,
|
||||
int is_harq = 0;
|
||||
int pdu_list_index = 0;
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
UE_list_t *UE_list = &eNB->UE_list;
|
||||
UE_info_t *UE_info = &eNB->UE_info;
|
||||
nfapi_ul_config_request_t *ul_req = NULL;
|
||||
nfapi_ul_config_request_body_t *ul_req_body = NULL;
|
||||
LTE_SchedulingRequestConfig_t *SRconfig = NULL;
|
||||
@@ -319,13 +318,13 @@ schedule_SR (module_id_t module_idP,
|
||||
eNB->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP;
|
||||
|
||||
for (int UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
|
||||
if (!UE_list->active[UE_id]) {
|
||||
if (!UE_info->active[UE_id]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated == NULL) continue;
|
||||
if (UE_info->UE_template[CC_id][UE_id].physicalConfigDedicated == NULL) continue;
|
||||
|
||||
if ((SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig) != NULL) {
|
||||
if ((SRconfig = UE_info->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig) != NULL) {
|
||||
if (SRconfig->present == LTE_SchedulingRequestConfig_PR_setup) {
|
||||
if (SRconfig->choice.setup.sr_ConfigIndex <= 4) { // 5 ms SR period
|
||||
if ((subframeP % 5) != SRconfig->choice.setup.sr_ConfigIndex) continue;
|
||||
@@ -337,9 +336,11 @@ schedule_SR (module_id_t module_idP,
|
||||
if ((10 * (frameP & 3) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 35)) continue;
|
||||
} else if (SRconfig->choice.setup.sr_ConfigIndex <= 154) { // 80 ms SR period
|
||||
if ((10 * (frameP & 7) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 75)) continue;
|
||||
} else if (SRconfig->choice.setup.sr_ConfigIndex <= 156) { // 2ms SR period
|
||||
if ((subframeP % 2) != (SRconfig->choice.setup.sr_ConfigIndex - 155)) continue;
|
||||
}
|
||||
} // SRconfig->present == SchedulingRequestConfig_PR_setup)
|
||||
} // SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig)!=NULL)
|
||||
} // SRconfig = UE_info->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig)!=NULL)
|
||||
|
||||
/* If we get here there is some PUCCH1 reception to schedule for SR */
|
||||
ul_req = &(eNB->UL_req[CC_id]);
|
||||
@@ -354,14 +355,14 @@ schedule_SR (module_id_t module_idP,
|
||||
(ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) ||
|
||||
(ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) ||
|
||||
(ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE)) &&
|
||||
(ul_req_body->ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) {
|
||||
(ul_req_body->ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_info->UE_template[CC_id][UE_id].rnti)) {
|
||||
skip_ue = 1;
|
||||
pdu_list_index = i;
|
||||
break;
|
||||
}
|
||||
/* If there is already an HARQ pdu, convert to SR_HARQ */
|
||||
else if ((ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) &&
|
||||
(ul_req_body->ul_config_pdu_list[i].uci_harq_pdu.ue_information.ue_information_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) {
|
||||
(ul_req_body->ul_config_pdu_list[i].uci_harq_pdu.ue_information.ue_information_rel8.rnti == UE_info->UE_template[CC_id][UE_id].rnti)) {
|
||||
is_harq = 1;
|
||||
pdu_list_index = i;
|
||||
break;
|
||||
@@ -375,20 +376,20 @@ schedule_SR (module_id_t module_idP,
|
||||
frameP,
|
||||
subframeP,
|
||||
UE_id,
|
||||
UE_list->UE_template[CC_id][UE_id].rnti,
|
||||
UE_info->UE_template[CC_id][UE_id].rnti,
|
||||
is_harq);
|
||||
|
||||
/* Check Rel10 or Rel8 SR */
|
||||
if ((UE_list-> UE_template[CC_id][UE_id].physicalConfigDedicated->ext2) &&
|
||||
(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020) &&
|
||||
(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)) {
|
||||
if ((UE_info-> UE_template[CC_id][UE_id].physicalConfigDedicated->ext2) &&
|
||||
(UE_info->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020) &&
|
||||
(UE_info->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)) {
|
||||
sr.sr_information_rel10.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG;
|
||||
sr.sr_information_rel10.number_of_pucch_resources = 1;
|
||||
sr.sr_information_rel10.pucch_index_p1 = *UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020->sr_PUCCH_ResourceIndexP1_r10;
|
||||
sr.sr_information_rel10.pucch_index_p1 = *UE_info->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020->sr_PUCCH_ResourceIndexP1_r10;
|
||||
LOG_D(MAC, "REL10 PUCCH INDEX P1:%d \n", sr.sr_information_rel10.pucch_index_p1);
|
||||
} else {
|
||||
sr.sr_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG;
|
||||
sr.sr_information_rel8.pucch_index = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex;
|
||||
sr.sr_information_rel8.pucch_index = UE_info->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex;
|
||||
LOG_D(MAC, "REL8 PUCCH INDEX:%d\n", sr.sr_information_rel8.pucch_index);
|
||||
}
|
||||
|
||||
@@ -401,7 +402,7 @@ schedule_SR (module_id_t module_idP,
|
||||
} else {
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].pdu_type = NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE;
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.rnti = UE_info->UE_template[CC_id][UE_id].rnti;
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel11.tl.tag = 0;
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel13.tl.tag = 0;
|
||||
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.sr_information = sr;
|
||||
@@ -416,20 +417,20 @@ schedule_SR (module_id_t module_idP,
|
||||
void
|
||||
check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
|
||||
frame_t frameP, sub_frame_t subframeP) {
|
||||
UE_list_t *UE_list = &RC.mac[module_idP]->UE_list;
|
||||
UE_info_t *UE_info = &RC.mac[module_idP]->UE_info;
|
||||
nfapi_dl_config_request_t *DL_req = &RC.mac[module_idP]->DL_req[0];
|
||||
uint16_t rnti = UE_RNTI(module_idP, UE_id);
|
||||
COMMON_channels_t *cc = RC.mac[module_idP]->common_channels;
|
||||
|
||||
// check uplink failure
|
||||
if ((UE_list->UE_sched_ctrl[UE_id].ul_failure_timer > 0) &&
|
||||
(UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 0)) {
|
||||
if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer == 1)
|
||||
if ((UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0) &&
|
||||
(UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 0)) {
|
||||
if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer == 1)
|
||||
LOG_I(MAC, "UE %d rnti %x: UL Failure timer %d \n", UE_id, rnti,
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer);
|
||||
UE_info->UE_sched_ctrl[UE_id].ul_failure_timer);
|
||||
|
||||
if (UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent == 0) {
|
||||
UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 1;
|
||||
if (UE_info->UE_sched_ctrl[UE_id].ra_pdcch_order_sent == 0) {
|
||||
UE_info->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 1;
|
||||
// add a format 1A dci for this UE to request an RA procedure (only one UE per subframe)
|
||||
nfapi_dl_config_request_pdu_t *dl_config_pdu = &DL_req[CC_id].dl_config_request_body.dl_config_pdu_list[DL_req[CC_id].dl_config_request_body.number_pdu];
|
||||
memset((void *) dl_config_pdu, 0,sizeof(nfapi_dl_config_request_pdu_t));
|
||||
@@ -438,7 +439,7 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = get_aggregation(get_bw_index(module_idP, CC_id),
|
||||
UE_list->UE_sched_ctrl[UE_id].
|
||||
UE_info->UE_sched_ctrl[UE_id].
|
||||
dl_cqi[CC_id], format1A);
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // CRNTI : see Table 4-10 from SCF082 - nFAPI specifications
|
||||
@@ -454,22 +455,22 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
|
||||
LOG_D(MAC,
|
||||
"UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d), resource_block_coding %d \n",
|
||||
UE_id, rnti,
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer,
|
||||
UE_info->UE_sched_ctrl[UE_id].ul_failure_timer,
|
||||
dl_config_pdu->dci_dl_pdu.
|
||||
dci_dl_pdu_rel8.resource_block_coding);
|
||||
} else { // ra_pdcch_sent==1
|
||||
LOG_D(MAC,
|
||||
"UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n",
|
||||
UE_id, rnti,
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer);
|
||||
UE_info->UE_sched_ctrl[UE_id].ul_failure_timer);
|
||||
|
||||
if ((UE_list->UE_sched_ctrl[UE_id].ul_failure_timer % 80) == 0) UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 0; // resend every 8 frames
|
||||
if ((UE_info->UE_sched_ctrl[UE_id].ul_failure_timer % 80) == 0) UE_info->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 0; // resend every 8 frames
|
||||
}
|
||||
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer++;
|
||||
UE_info->UE_sched_ctrl[UE_id].ul_failure_timer++;
|
||||
|
||||
// check threshold
|
||||
if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer > 4000) {
|
||||
if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 4000) {
|
||||
// note: probably ul_failure_timer should be less than UE radio link failure time(see T310/N310/N311)
|
||||
if (NODE_IS_DU(RC.rrc[module_idP]->node_type)) {
|
||||
MessageDef *m = itti_alloc_new_message(TASK_MAC_ENB, F1AP_UE_CONTEXT_RELEASE_REQ);
|
||||
@@ -491,17 +492,17 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
|
||||
rnti);
|
||||
}
|
||||
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0;
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync = 1;
|
||||
UE_info->UE_sched_ctrl[UE_id].ul_failure_timer = 0;
|
||||
UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync = 1;
|
||||
}
|
||||
} // ul_failure_timer>0
|
||||
|
||||
UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer++;
|
||||
UE_info->UE_sched_ctrl[UE_id].uplane_inactivity_timer++;
|
||||
|
||||
if((U_PLANE_INACTIVITY_VALUE != 0) && (UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer > (U_PLANE_INACTIVITY_VALUE * 10))) {
|
||||
if((U_PLANE_INACTIVITY_VALUE != 0) && (UE_info->UE_sched_ctrl[UE_id].uplane_inactivity_timer > (U_PLANE_INACTIVITY_VALUE * 10))) {
|
||||
LOG_D(MAC,"UE %d rnti %x: U-Plane Failure after repeated PDCCH orders: Triggering RRC \n",UE_id,rnti);
|
||||
mac_eNB_rrc_uplane_failure(module_idP,CC_id,frameP,subframeP,rnti);
|
||||
UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0;
|
||||
UE_info->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0;
|
||||
}// time > 60s
|
||||
}
|
||||
|
||||
@@ -565,7 +566,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
int CC_id = 0;
|
||||
int UE_id = -1;
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
UE_list_t *UE_list = &(eNB->UE_list);
|
||||
UE_info_t *UE_info = &(eNB->UE_info);
|
||||
COMMON_channels_t *cc = eNB->common_channels;
|
||||
UE_sched_ctrl_t *UE_scheduling_control = NULL;
|
||||
start_meas(&(eNB->eNB_scheduler));
|
||||
@@ -584,16 +585,16 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
|
||||
/* Refresh UE list based on UEs dropped by PHY in previous subframe */
|
||||
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
|
||||
if (UE_list->active[UE_id]) {
|
||||
if (UE_info->active[UE_id]) {
|
||||
rnti = UE_RNTI(module_idP, UE_id);
|
||||
CC_id = UE_PCCID(module_idP, UE_id);
|
||||
UE_scheduling_control = &(UE_list->UE_sched_ctrl[UE_id]);
|
||||
UE_scheduling_control = &(UE_info->UE_sched_ctrl[UE_id]);
|
||||
|
||||
if (((frameP & 127) == 0) && (subframeP == 0)) {
|
||||
LOG_I(MAC,"UE rnti %x : %s, PHR %d dB DL CQI %d PUSCH SNR %d PUCCH SNR %d\n",
|
||||
rnti,
|
||||
UE_scheduling_control->ul_out_of_sync == 0 ? "in synch" : "out of sync",
|
||||
UE_list->UE_template[CC_id][UE_id].phr_info,
|
||||
UE_info->UE_template[CC_id][UE_id].phr_info,
|
||||
UE_scheduling_control->dl_cqi[CC_id],
|
||||
(5 * UE_scheduling_control->pusch_snr[CC_id] - 640) / 10,
|
||||
(5 * UE_scheduling_control->pucch1_snr[CC_id] - 640) / 10);
|
||||
@@ -601,7 +602,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
|
||||
RC.eNB[module_idP][CC_id]->pusch_stats_bsr[UE_id][(frameP * 10) + subframeP] = -63;
|
||||
|
||||
if (UE_id == UE_list->head) {
|
||||
if (UE_id == UE_info->list.head) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR, RC.eNB[module_idP][CC_id]->pusch_stats_bsr[UE_id][(frameP * 10) + subframeP]);
|
||||
}
|
||||
|
||||
@@ -735,7 +736,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
* here for the current subframe. The variable 'UE_scheduling_control->in_active_time' should be updated
|
||||
* ONLY here. The variable can then be used for testing the actual state of the UE for scheduling purpose.
|
||||
*/
|
||||
UE_template = &(UE_list->UE_template[CC_id][UE_id]);
|
||||
UE_template = &(UE_info->UE_template[CC_id][UE_id]);
|
||||
|
||||
/* (a)synchronous HARQ processes handling for Active Time */
|
||||
for (int harq_process_id = 0; harq_process_id < 8; harq_process_id++) {
|
||||
@@ -981,7 +982,9 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
/* Allocate CCEs for good after scheduling is done */
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
if (cc[CC_id].tdd_Config == NULL || !(is_UL_sf(&cc[CC_id],subframeP))) {
|
||||
allocate_CCEs(module_idP, CC_id, frameP, subframeP, 2);
|
||||
int rc = allocate_CCEs(module_idP, CC_id, frameP, subframeP, 2);
|
||||
if (rc < 0)
|
||||
LOG_E(MAC, "%s() %4d.%d ERROR ALLOCATING CCEs\n", __func__, frameP, subframeP);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -587,7 +587,7 @@ generate_Msg4(module_id_t module_idP,
|
||||
{
|
||||
eNB_MAC_INST *mac = RC.mac[module_idP];
|
||||
COMMON_channels_t *cc = mac->common_channels;
|
||||
UE_list_t *UE_list = &(mac->UE_list);
|
||||
UE_info_t *UE_info = &mac->UE_info;
|
||||
int16_t rrc_sdu_length = 0;
|
||||
uint16_t msg4_padding = 0;
|
||||
uint16_t msg4_post_padding = 0;
|
||||
@@ -831,7 +831,7 @@ generate_Msg4(module_id_t module_idP,
|
||||
dl_req_body->number_pdu++;
|
||||
ra->state = WAITMSG4ACK;
|
||||
lcid = 0;
|
||||
UE_list->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid] = 0;
|
||||
UE_info->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid] = 0;
|
||||
msg4_header = 1 + 6 + 1; // CR header, CR CE, SDU header
|
||||
AssertFatal((ra->msg4_TBsize - ra->msg4_rrc_sdu_length - msg4_header)>=0,
|
||||
"msg4_TBS %d is too small, change mcs to increase by %d bytes\n",ra->msg4_TBsize,ra->msg4_rrc_sdu_length+msg4_header-ra->msg4_TBsize);
|
||||
@@ -848,7 +848,7 @@ generate_Msg4(module_id_t module_idP,
|
||||
module_idP, CC_idP, frameP, subframeP, ra->msg4_TBsize, ra->msg4_rrc_sdu_length, msg4_header, msg4_padding, msg4_post_padding);
|
||||
DevAssert (UE_id != UE_INDEX_INVALID); // FIXME not sure how to gracefully return
|
||||
// CHECK THIS: &cc[CC_idP].CCCH_pdu.payload[0]
|
||||
offset = generate_dlsch_header ((unsigned char *) mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0], 1, //num_sdus
|
||||
offset = generate_dlsch_header ((unsigned char *) mac->UE_info.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0], 1, //num_sdus
|
||||
(unsigned short *) &ra->msg4_rrc_sdu_length, //
|
||||
&lcid, // sdu_lcid
|
||||
255, // no drx
|
||||
@@ -856,7 +856,7 @@ generate_Msg4(module_id_t module_idP,
|
||||
ra->cont_res_id, // contention res id
|
||||
msg4_padding, // no padding
|
||||
msg4_post_padding);
|
||||
memcpy ((void *) &mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0][(unsigned char) offset], &cc[CC_idP].CCCH_pdu.payload[0], ra->msg4_rrc_sdu_length);
|
||||
memcpy ((void *) &mac->UE_info.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0][(unsigned char) offset], &cc[CC_idP].CCCH_pdu.payload[0], ra->msg4_rrc_sdu_length);
|
||||
// DL request
|
||||
mac->TX_req[CC_idP].sfn_sf = (frameP << 4) + subframeP;
|
||||
TX_req = &mac->TX_req[CC_idP].tx_request_body.tx_pdu_list[mac->TX_req[CC_idP].tx_request_body.number_of_pdus];
|
||||
@@ -864,7 +864,7 @@ generate_Msg4(module_id_t module_idP,
|
||||
TX_req->pdu_index = mac->pdu_index[CC_idP]++;
|
||||
TX_req->num_segments = 1;
|
||||
TX_req->segments[0].segment_length = ra->msg4_TBsize;
|
||||
TX_req->segments[0].segment_data = mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0];
|
||||
TX_req->segments[0].segment_data = mac->UE_info.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0];
|
||||
mac->TX_req[CC_idP].tx_request_body.number_of_pdus++;
|
||||
// Program ACK/NAK for Msg4 PDSCH
|
||||
int absSF = (frameP * 10) + subframeP;
|
||||
@@ -899,8 +899,8 @@ generate_Msg4(module_id_t module_idP,
|
||||
|
||||
ul_req_body->number_of_pdus++;
|
||||
T (T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT (module_idP), T_INT (CC_idP), T_INT (ra->rnti), T_INT (frameP), T_INT (subframeP),
|
||||
T_INT (0 /*harq_pid always 0? */ ), T_BUFFER (&mac->UE_list.DLSCH_pdu[CC_idP][0][UE_id].payload[0], ra->msg4_TBsize));
|
||||
trace_pdu (DIRECTION_DOWNLINK, (uint8_t *) mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0],
|
||||
T_INT (0 /*harq_pid always 0? */ ), T_BUFFER (&mac->UE_info.DLSCH_pdu[CC_idP][0][UE_id].payload[0], ra->msg4_TBsize));
|
||||
trace_pdu (DIRECTION_DOWNLINK, (uint8_t *) mac->UE_info.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0],
|
||||
ra->msg4_rrc_sdu_length,
|
||||
UE_id, 3, UE_RNTI (module_idP, UE_id),
|
||||
mac->frame, mac->subframe, 0, 0);
|
||||
@@ -963,10 +963,10 @@ generate_Msg4(module_id_t module_idP,
|
||||
1, // tpc, none
|
||||
getRIV(N_RB_DL, first_rb, 4), // resource_block_coding
|
||||
ra->msg4_mcs, // mcs
|
||||
1 - UE_list->UE_template[CC_idP][UE_id].oldNDI[ra->harq_pid],
|
||||
1 - UE_info->UE_template[CC_idP][UE_id].oldNDI[ra->harq_pid],
|
||||
0, // rv
|
||||
0); // vrb_flag
|
||||
UE_list->UE_template[CC_idP][UE_id].oldNDI[ra->harq_pid] = 1 - UE_list->UE_template[CC_idP][UE_id].oldNDI[ra->harq_pid];
|
||||
UE_info->UE_template[CC_idP][UE_id].oldNDI[ra->harq_pid] = 1 - UE_info->UE_template[CC_idP][UE_id].oldNDI[ra->harq_pid];
|
||||
LOG_D(MAC,
|
||||
"Frame %d, subframe %d: Msg4 DCI pdu_num %d (rnti %x,rnti_type %d,harq_pid %d, resource_block_coding (%p) %d\n",
|
||||
frameP, subframeP, dl_req_body->number_pdu,
|
||||
@@ -1000,7 +1000,7 @@ generate_Msg4(module_id_t module_idP,
|
||||
lcid = 0;
|
||||
// put HARQ process round to 0
|
||||
ra->harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP,subframeP);
|
||||
UE_list->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid] = 0;
|
||||
UE_info->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid] = 0;
|
||||
|
||||
if ((ra->msg4_TBsize - rrc_sdu_length - msg4_header) <= 2) {
|
||||
msg4_padding = ra->msg4_TBsize - rrc_sdu_length - msg4_header;
|
||||
@@ -1018,7 +1018,7 @@ generate_Msg4(module_id_t module_idP,
|
||||
DevAssert(UE_id != UE_INDEX_INVALID); // FIXME not sure how to gracefully return
|
||||
// CHECK THIS: &cc[CC_idP].CCCH_pdu.payload[0]
|
||||
int num_sdus = rrc_sdu_length > 0 ? 1 : 0;
|
||||
offset = generate_dlsch_header((unsigned char *) mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0],
|
||||
offset = generate_dlsch_header((unsigned char *) mac->UE_info.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0],
|
||||
num_sdus, //num_sdus
|
||||
(unsigned short *) &rrc_sdu_length, //
|
||||
&lcid, // sdu_lcid
|
||||
@@ -1027,10 +1027,14 @@ generate_Msg4(module_id_t module_idP,
|
||||
ra->cont_res_id, // contention res id
|
||||
msg4_padding, // no padding
|
||||
msg4_post_padding);
|
||||
memcpy((void *) &mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0][(unsigned char)offset],
|
||||
memcpy((void *) &mac->UE_info.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0][(unsigned char)offset],
|
||||
&cc[CC_idP].CCCH_pdu.payload[0], rrc_sdu_length);
|
||||
// DLSCH Config
|
||||
fill_nfapi_dlsch_config(mac, dl_req_body, ra->msg4_TBsize, mac->pdu_index[CC_idP], ra->rnti, 2, // resource_allocation_type : format 1A/1B/1D
|
||||
fill_nfapi_dlsch_config(&dl_req_body->dl_config_pdu_list[dl_req_body->number_pdu],
|
||||
ra->msg4_TBsize,
|
||||
mac->pdu_index[CC_idP],
|
||||
ra->rnti,
|
||||
2, // resource_allocation_type : format 1A/1B/1D
|
||||
0, // virtual_resource_block_assignment_flag : localized
|
||||
getRIV(N_RB_DL, first_rb, 4), // resource_block_coding : RIV, 4 PRB
|
||||
2, // modulation: QPSK
|
||||
@@ -1049,6 +1053,7 @@ generate_Msg4(module_id_t module_idP,
|
||||
(cc->p_eNB == 1) ? 1 : 2, // transmission mode
|
||||
1, // num_bf_prb_per_subband
|
||||
1); // num_bf_vector
|
||||
dl_req_body->number_pdu++;
|
||||
LOG_D(MAC,
|
||||
"Filled DLSCH config, pdu number %d, non-dci pdu_index %d\n",
|
||||
dl_req_body->number_pdu, mac->pdu_index[CC_idP]);
|
||||
@@ -1058,7 +1063,7 @@ generate_Msg4(module_id_t module_idP,
|
||||
(frameP * 10) + subframeP,
|
||||
rrc_sdu_length+offset,
|
||||
mac->pdu_index[CC_idP],
|
||||
mac->UE_list.
|
||||
mac->UE_info.
|
||||
DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0]);
|
||||
mac->pdu_index[CC_idP]++;
|
||||
dl_req->sfn_sf = mac->TX_req[CC_idP].sfn_sf;
|
||||
@@ -1074,11 +1079,11 @@ generate_Msg4(module_id_t module_idP,
|
||||
T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP),
|
||||
T_INT(CC_idP), T_INT(ra->rnti), T_INT(frameP),
|
||||
T_INT(subframeP), T_INT(0 /*harq_pid always 0? */ ),
|
||||
T_BUFFER(&mac->UE_list.DLSCH_pdu[CC_idP][0][UE_id].
|
||||
T_BUFFER(&mac->UE_info.DLSCH_pdu[CC_idP][0][UE_id].
|
||||
payload[0], ra->msg4_TBsize));
|
||||
trace_pdu(DIRECTION_DOWNLINK,
|
||||
(uint8_t *) mac->
|
||||
UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0],
|
||||
UE_info.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0],
|
||||
rrc_sdu_length, UE_id, WS_C_RNTI,
|
||||
UE_RNTI(module_idP, UE_id), mac->frame,
|
||||
mac->subframe, 0, 0);
|
||||
@@ -1116,14 +1121,14 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
|
||||
int first_rb;
|
||||
int N_RB_DL;
|
||||
nfapi_dl_config_request_pdu_t *dl_config_pdu;
|
||||
UE_list_t *UE_list = &mac->UE_list;
|
||||
UE_info_t *UE_info = &mac->UE_info;
|
||||
nfapi_dl_config_request_t *dl_req;
|
||||
nfapi_dl_config_request_body_t *dl_req_body;
|
||||
int round;
|
||||
// check HARQ status and retransmit if necessary
|
||||
UE_id = find_UE_id(module_idP, ra->rnti);
|
||||
AssertFatal(UE_id >= 0, "Can't find UE for t-crnti\n");
|
||||
round = UE_list->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid];
|
||||
round = UE_info->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid];
|
||||
vrb_map = cc[CC_idP].vrb_map;
|
||||
dl_req = &mac->DL_req[CC_idP];
|
||||
dl_req_body = &dl_req->dl_config_request_body;
|
||||
@@ -1156,7 +1161,7 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
|
||||
1, // tpc, none
|
||||
getRIV(N_RB_DL, first_rb, 4), // resource_block_coding
|
||||
ra->msg4_mcs, // mcs
|
||||
UE_list->UE_template[CC_idP][UE_id].oldNDI[ra->harq_pid],
|
||||
UE_info->UE_template[CC_idP][UE_id].oldNDI[ra->harq_pid],
|
||||
round & 3, // rv
|
||||
0); // vrb_flag
|
||||
|
||||
@@ -1173,7 +1178,8 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
|
||||
// DLSCH Config
|
||||
//DJP - fix this pdu_index = -1
|
||||
LOG_D(MAC, "check_Msg4_retransmission() before fill_nfapi_dlsch_config() with pdu_index = -1 \n");
|
||||
fill_nfapi_dlsch_config(mac, dl_req_body, ra->msg4_TBsize,
|
||||
fill_nfapi_dlsch_config(&dl_req_body->dl_config_pdu_list[dl_req_body->number_pdu],
|
||||
ra->msg4_TBsize,
|
||||
-1
|
||||
/* retransmission, no pdu_index */
|
||||
, ra->rnti, 2, // resource_allocation_type : format 1A/1B/1D
|
||||
@@ -1195,6 +1201,7 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
|
||||
(cc->p_eNB == 1) ? 1 : 2, // transmission mode
|
||||
1, // num_bf_prb_per_subband
|
||||
1); // num_bf_vector
|
||||
dl_req_body->number_pdu++;
|
||||
|
||||
if(RC.mac[module_idP]->scheduler_mode == SCHED_MODE_FAIR_RR) {
|
||||
set_dl_ue_select_msg4(CC_idP, 4, UE_id, ra->rnti);
|
||||
@@ -1226,8 +1233,8 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
|
||||
LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d: state:IDLE\n", module_idP, frameP, subframeP);
|
||||
UE_id = find_UE_id(module_idP, ra->rnti);
|
||||
DevAssert(UE_id != -1);
|
||||
mac->UE_list.UE_template[UE_PCCID(module_idP, UE_id)][UE_id].configured = TRUE;
|
||||
mac->UE_list.UE_template[UE_PCCID(module_idP, UE_id)][UE_id].pusch_repetition_levels=ra->pusch_repetition_levels;
|
||||
mac->UE_info.UE_template[UE_PCCID(module_idP, UE_id)][UE_id].configured = TRUE;
|
||||
mac->UE_info.UE_template[UE_PCCID(module_idP, UE_id)][UE_id].pusch_repetition_levels=ra->pusch_repetition_levels;
|
||||
cancel_ra_proc(module_idP, CC_idP, frameP, ra->rnti);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -85,6 +85,30 @@ void dlsch_scheduler_pre_ue_select_fairRR(
|
||||
uint16_t nb_rbs_required[MAX_NUM_CCs][MAX_MOBILES_PER_ENB],
|
||||
DLSCH_UE_SELECT dlsch_ue_select[MAX_NUM_CCs]);
|
||||
|
||||
void dlsch_scheduler_pre_processor_reset_fairRR(
|
||||
module_id_t module_idP,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframeP,
|
||||
int min_rb_unit[NFAPI_CC_MAX],
|
||||
uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
|
||||
uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX],
|
||||
uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX]);
|
||||
|
||||
void assign_rbs_required_fairRR(
|
||||
module_id_t Mod_id,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframe,
|
||||
uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]);
|
||||
|
||||
void dlsch_scheduler_pre_processor_allocate_fairRR(
|
||||
module_id_t Mod_id,
|
||||
int UE_id,
|
||||
uint8_t CC_id,
|
||||
int N_RBG,
|
||||
uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
|
||||
uint16_t nb_rbs_remaining[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
|
||||
uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX]);
|
||||
|
||||
void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframeP,
|
||||
|
||||
@@ -718,9 +718,7 @@ schedule_MBMS_NFAPI(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
|
||||
module_idP, ENB_FLAG_YES, MBMS_FLAG_YES,
|
||||
cc->mbms_SessionList[0]->list.array[0]->logicalChannelIdentity_r9,
|
||||
//MTCH,
|
||||
TBS - header_len_mcch - header_len_msi -
|
||||
sdu_length_total - header_len_mtch
|
||||
,0, 0
|
||||
0, 0
|
||||
);
|
||||
bytes_in_buffer = rlc_status.bytes_in_buffer;
|
||||
|
||||
@@ -773,7 +771,8 @@ schedule_MBMS_NFAPI(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
|
||||
TBS - header_len_mcch - header_len_msi -
|
||||
sdu_length_total - header_len_mtch, header_len_mtch, rlc_status.bytes_in_buffer);
|
||||
|
||||
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, 0/*0xfffd*/, module_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_YES,cc->mbms_SessionList[0]->list.array[0]->logicalChannelIdentity_r9, 0, //not used
|
||||
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, 0, module_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_YES,cc->mbms_SessionList[0]->list.array[0]->logicalChannelIdentity_r9,
|
||||
TBS - header_len_mcch - header_len_msi - sdu_length_total - header_len_mtch,
|
||||
(char *)
|
||||
&mch_buffer[sdu_length_total]
|
||||
,0,
|
||||
@@ -1558,9 +1557,7 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
|
||||
module_idP, ENB_FLAG_YES, MBMS_FLAG_YES,
|
||||
cc->mbms_SessionList[0]->list.array[0]->logicalChannelIdentity_r9,
|
||||
//MTCH,
|
||||
TBS - header_len_mcch - header_len_msi -
|
||||
sdu_length_total - header_len_mtch
|
||||
,0, 0
|
||||
0, 0
|
||||
);
|
||||
bytes_in_buffer = rlc_status.bytes_in_buffer;
|
||||
|
||||
@@ -1579,7 +1576,8 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
|
||||
TBS - header_len_mcch - header_len_msi -
|
||||
sdu_length_total - header_len_mtch, header_len_mtch, rlc_status.bytes_in_buffer);
|
||||
|
||||
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, 0/*0xfffd*/, module_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_YES,cc->mbms_SessionList[0]->list.array[0]->logicalChannelIdentity_r9, 0, //not used
|
||||
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, 0, module_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_YES,cc->mbms_SessionList[0]->list.array[0]->logicalChannelIdentity_r9,
|
||||
TBS - header_len_mcch - header_len_msi - sdu_length_total - header_len_mtch,
|
||||
(char *)
|
||||
&mch_buffer[sdu_length_total]
|
||||
,0,
|
||||
|
||||
@@ -133,16 +133,15 @@ schedule_ue_spec_phy_test(
|
||||
/*
|
||||
LOG_D(MAC,"CC_id %d Frame %d, subframeP %d: Toggling Format1 NDI for UE %d (rnti %x/%d) oldNDI %d\n",
|
||||
CC_id, frameP,subframeP,UE_id,
|
||||
rnti,harq_pid,UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid]);
|
||||
rnti,harq_pid,UE_info->UE_template[CC_id][UE_id].oldNDI[harq_pid]);
|
||||
|
||||
UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid]=1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
UE_list->UE_template[CC_id][UE_id].oldmcs1[harq_pid] = mcs;
|
||||
UE_list->UE_template[CC_id][UE_id].oldmcs2[harq_pid] = 0;
|
||||
AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated!=NULL,"physicalConfigDedicated is NULL\n");
|
||||
AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->pdsch_ConfigDedicated!=NULL,"physicalConfigDedicated->pdsch_ConfigDedicated is NULL\n");
|
||||
UE_info->UE_template[CC_id][UE_id].oldNDI[harq_pid]=1-UE_info->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
UE_info->UE_template[CC_id][UE_id].oldmcs1[harq_pid] = mcs;
|
||||
UE_info->UE_template[CC_id][UE_id].oldmcs2[harq_pid] = 0;
|
||||
AssertFatal(UE_info->UE_template[CC_id][UE_id].physicalConfigDedicated!=NULL,"physicalConfigDedicated is NULL\n");
|
||||
AssertFatal(UE_info->UE_template[CC_id][UE_id].physicalConfigDedicated->pdsch_ConfigDedicated!=NULL,"physicalConfigDedicated->pdsch_ConfigDedicated is NULL\n");
|
||||
*/
|
||||
fill_nfapi_dlsch_config(eNB,
|
||||
dl_req,
|
||||
fill_nfapi_dlsch_config(&dl_req->dl_config_pdu_list[dl_req->number_pdu],
|
||||
TBS,
|
||||
eNB->pdu_index[CC_id],
|
||||
rnti,
|
||||
@@ -166,11 +165,12 @@ schedule_ue_spec_phy_test(
|
||||
0, //number of PRBs treated as one subband, not used here
|
||||
0 // number of beamforming vectors, not used here
|
||||
);
|
||||
dl_req->number_pdu++;
|
||||
eNB->TX_req[CC_id].sfn_sf = fill_nfapi_tx_req(&eNB->TX_req[CC_id].tx_request_body,
|
||||
(frameP*10)+subframeP,
|
||||
TBS,
|
||||
eNB->pdu_index[CC_id],
|
||||
eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0]);
|
||||
eNB->UE_info.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0]);
|
||||
} else {
|
||||
LOG_W(MAC,"[eNB_scheduler_phytest] DCI allocation infeasible!\n");
|
||||
}
|
||||
@@ -192,7 +192,7 @@ void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t s
|
||||
int N_RB_UL;
|
||||
eNB_MAC_INST *mac = RC.mac[module_idP];
|
||||
COMMON_channels_t *cc = &mac->common_channels[0];
|
||||
UE_list_t *UE_list=&mac->UE_list;
|
||||
UE_info_t *UE_info=&mac->UE_info;
|
||||
UE_TEMPLATE *UE_template;
|
||||
UE_sched_ctrl_t *UE_sched_ctrl;
|
||||
int sched_frame=frameP;
|
||||
@@ -231,8 +231,8 @@ void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t s
|
||||
first_rb[CC_id] = 1;
|
||||
// loop over all active UEs
|
||||
// if (eNB_UE_stats->mode == PUSCH) { // ue has a ulsch channel
|
||||
UE_template = &UE_list->UE_template[CC_id][UE_id];
|
||||
UE_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id];
|
||||
UE_template = &UE_info->UE_template[CC_id][UE_id];
|
||||
UE_sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
harq_pid = subframe2harqpid(&cc[CC_id],sched_frame,sched_subframe);
|
||||
RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP] = UE_template->TBS_UL[harq_pid];
|
||||
//power control
|
||||
@@ -242,15 +242,15 @@ void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t s
|
||||
// new transmission
|
||||
ndi = 1-UE_template->oldNDI_UL[harq_pid];
|
||||
UE_template->oldNDI_UL[harq_pid]=ndi;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].snr = snr;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].target_snr = target_snr;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1 = mcs;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].snr = snr;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].target_snr = target_snr;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1 = mcs;
|
||||
UE_template->mcs_UL[harq_pid] = mcs;//cmin (UE_template->pre_assigned_mcs_ul, openair_daq_vars.target_ue_ul_mcs); // adjust, based on user-defined MCS
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2 = mcs;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2 = mcs;
|
||||
// buffer_occupancy = UE_template->ul_total_buffer;
|
||||
UE_template->TBS_UL[harq_pid] = get_TBS_UL(mcs,nb_rb);
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used_rx += nb_rb;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS = get_TBS_UL(mcs,nb_rb);
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_rbs_used_rx += nb_rb;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_TBS = get_TBS_UL(mcs,nb_rb);
|
||||
// buffer_occupancy -= TBS;
|
||||
// bad indices : 20 (40 PRB), 21 (45 PRB), 22 (48 PRB)
|
||||
//store for possible retransmission
|
||||
|
||||
@@ -1169,14 +1169,14 @@ program_dlsch_acknak(module_id_t module_idP,
|
||||
{
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
COMMON_channels_t *cc = eNB->common_channels;
|
||||
UE_list_t *UE_list = &eNB->UE_list;
|
||||
UE_info_t *UE_info = &eNB->UE_info;
|
||||
rnti_t rnti = UE_RNTI(module_idP, UE_idP);
|
||||
nfapi_ul_config_request_body_t *ul_req;
|
||||
nfapi_ul_config_request_pdu_t *ul_config_pdu;
|
||||
int use_simultaneous_pucch_pusch = 0;
|
||||
nfapi_ul_config_ulsch_harq_information *ulsch_harq_information = NULL;
|
||||
nfapi_ul_config_harq_information *harq_information = NULL;
|
||||
struct LTE_PhysicalConfigDedicated__ext2 *ext2 = UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2;
|
||||
struct LTE_PhysicalConfigDedicated__ext2 *ext2 = UE_info->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2;
|
||||
|
||||
if (ext2 &&
|
||||
ext2->pucch_ConfigDedicated_v1020 &&
|
||||
@@ -1363,12 +1363,12 @@ fill_nfapi_ulsch_harq_information(module_id_t module_
|
||||
{
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
COMMON_channels_t *cc = &eNB->common_channels[CC_idP];
|
||||
UE_list_t *UE_list = &eNB->UE_list;
|
||||
UE_info_t *UE_info = &eNB->UE_info;
|
||||
int UE_id = find_UE_id(module_idP, rntiP);
|
||||
nfapi_ul_config_ulsch_harq_information_rel10_t *harq_information_rel10 = &harq_information->harq_information_rel10;
|
||||
AssertFatal(UE_id >= 0, "UE_id cannot be found, impossible\n");
|
||||
AssertFatal(UE_list != NULL, "UE_list is null\n");
|
||||
LTE_PhysicalConfigDedicated_t *physicalConfigDedicated = UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated;
|
||||
AssertFatal(UE_info != NULL, "UE_info is null\n");
|
||||
LTE_PhysicalConfigDedicated_t *physicalConfigDedicated = UE_info->UE_template[CC_idP][UE_id].physicalConfigDedicated;
|
||||
AssertFatal(physicalConfigDedicated != NULL, "physicalConfigDedicated for rnti %x is null\n",
|
||||
rntiP);
|
||||
struct LTE_PUSCH_ConfigDedicated *puschConfigDedicated = physicalConfigDedicated->pusch_ConfigDedicated;
|
||||
@@ -1468,14 +1468,14 @@ fill_nfapi_harq_information(module_id_t module_idP,
|
||||
{
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
COMMON_channels_t *cc = &eNB->common_channels[CC_idP];
|
||||
UE_list_t *UE_list = &eNB->UE_list;
|
||||
UE_info_t *UE_info = &eNB->UE_info;
|
||||
int UE_id = find_UE_id(module_idP,
|
||||
rntiP);
|
||||
AssertFatal(UE_id >= 0, "UE_id cannot be found, impossible\n");
|
||||
AssertFatal(UE_list != NULL, "UE_list is null\n");
|
||||
AssertFatal(UE_info != NULL, "UE_info is null\n");
|
||||
harq_information->harq_information_rel11.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL11_TAG;
|
||||
harq_information->harq_information_rel11.num_ant_ports = 1;
|
||||
LTE_PhysicalConfigDedicated_t *physicalConfigDedicated = UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated;
|
||||
LTE_PhysicalConfigDedicated_t *physicalConfigDedicated = UE_info->UE_template[CC_idP][UE_id].physicalConfigDedicated;
|
||||
struct LTE_PUCCH_ConfigDedicated *pucch_ConfigDedicated = NULL;
|
||||
|
||||
if (physicalConfigDedicated != NULL) pucch_ConfigDedicated = physicalConfigDedicated->pucch_ConfigDedicated;
|
||||
@@ -1489,7 +1489,7 @@ fill_nfapi_harq_information(module_id_t module_idP,
|
||||
case 6:
|
||||
case 7:
|
||||
if (cc->tdd_Config != NULL) {
|
||||
// AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated != NULL,
|
||||
// AssertFatal(UE_info->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated != NULL,
|
||||
// "pucch_ConfigDedicated is null for TDD!\n");
|
||||
if (physicalConfigDedicated != NULL && pucch_ConfigDedicated != NULL &&
|
||||
pucch_ConfigDedicated->tdd_AckNackFeedbackMode != NULL &&
|
||||
@@ -1619,15 +1619,14 @@ fill_nfapi_mch_config(nfapi_dl_config_request_body_t *dl_req,
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void
|
||||
fill_nfapi_dlsch_config(eNB_MAC_INST *eNB,
|
||||
nfapi_dl_config_request_body_t *dl_req,
|
||||
fill_nfapi_dlsch_config(nfapi_dl_config_request_pdu_t *dl_config_pdu,
|
||||
uint16_t length,
|
||||
int16_t pdu_index,
|
||||
uint16_t rnti,
|
||||
uint8_t resource_allocation_type,
|
||||
uint8_t
|
||||
virtual_resource_block_assignment_flag,
|
||||
uint16_t resource_block_coding,
|
||||
uint32_t resource_block_coding,
|
||||
uint8_t modulation,
|
||||
uint8_t redundancy_version,
|
||||
uint8_t transport_blocks,
|
||||
@@ -1646,7 +1645,6 @@ fill_nfapi_dlsch_config(eNB_MAC_INST *eNB,
|
||||
uint8_t num_bf_vector)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
nfapi_dl_config_request_pdu_t *dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
|
||||
memset((void *) dl_config_pdu, 0, sizeof(nfapi_dl_config_request_pdu_t));
|
||||
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
|
||||
dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dlsch_pdu));
|
||||
@@ -1673,7 +1671,6 @@ fill_nfapi_dlsch_config(eNB_MAC_INST *eNB,
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = transmission_mode;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = num_bf_prb_per_subband;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = num_bf_vector;
|
||||
dl_req->number_pdu++;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1879,8 +1876,7 @@ mpdcch_sf_condition(eNB_MAC_INST *eNB,
|
||||
break;
|
||||
|
||||
case TYPEUESPEC:
|
||||
epdcch_setconfig_r11 =
|
||||
eNB->UE_list.UE_template[CC_id][UE_id].physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11->list.array[0];
|
||||
epdcch_setconfig_r11 = eNB->UE_info.UE_template[CC_id][UE_id].physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11->list.array[0];
|
||||
AssertFatal(epdcch_setconfig_r11 != NULL, " epdcch_setconfig_r11 is null for UE specific \n");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2 != NULL, " ext2 doesn't exist in epdcch config ' \n");
|
||||
|
||||
@@ -1988,11 +1984,11 @@ find_UE_id(module_id_t mod_idP,
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
int UE_id;
|
||||
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
|
||||
UE_info_t *UE_info = &RC.mac[mod_idP]->UE_info;
|
||||
|
||||
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
|
||||
if (UE_list->active[UE_id] == TRUE) {
|
||||
if (UE_list->UE_template[UE_PCCID(mod_idP, UE_id)][UE_id].rnti == rntiP) {
|
||||
if (UE_info->active[UE_id] == TRUE) {
|
||||
if (UE_info->UE_template[UE_PCCID(mod_idP, UE_id)][UE_id].rnti == rntiP) {
|
||||
return UE_id;
|
||||
}
|
||||
}
|
||||
@@ -2027,7 +2023,7 @@ find_RA_id(module_id_t mod_idP,
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
UE_num_active_CC(UE_list_t *listP,
|
||||
UE_num_active_CC(UE_info_t *listP,
|
||||
int ue_idP)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
@@ -2040,7 +2036,7 @@ UE_PCCID(module_id_t mod_idP,
|
||||
int ue_idP)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
return (RC.mac[mod_idP]->UE_list.pCC_id[ue_idP]);
|
||||
return (RC.mac[mod_idP]->UE_info.pCC_id[ue_idP]);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -2051,7 +2047,7 @@ UE_RNTI(module_id_t mod_idP,
|
||||
{
|
||||
if (!RC.mac || !RC.mac[mod_idP]) return 0;
|
||||
|
||||
rnti_t rnti = RC.mac[mod_idP]->UE_list.UE_template[UE_PCCID(mod_idP,
|
||||
rnti_t rnti = RC.mac[mod_idP]->UE_info.UE_template[UE_PCCID(mod_idP,
|
||||
ue_idP)][ue_idP].rnti;
|
||||
|
||||
if (rnti > 0) {
|
||||
@@ -2069,7 +2065,7 @@ is_UE_active(module_id_t mod_idP,
|
||||
int ue_idP)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
return (RC.mac[mod_idP]->UE_list.active[ue_idP]);
|
||||
return (RC.mac[mod_idP]->UE_info.active[ue_idP]);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -2122,28 +2118,46 @@ get_aggregation(uint8_t bw_index,
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Dump the UL or DL UE_list into LOG_T(MAC)
|
||||
* Dump the UE_list into LOG_T(MAC)
|
||||
*/
|
||||
void
|
||||
dump_ue_list(UE_list_t *listP,
|
||||
int ul_flag)
|
||||
dump_ue_list(UE_list_t *listP) {
|
||||
for (int j = listP->head; j >= 0; j = listP->next[j])
|
||||
LOG_T(MAC, "DL list node %d => %d\n", j, listP->next[j]);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
if (ul_flag == 0) {
|
||||
for (int j = listP->head; j >= 0; j = listP->next[j]) {
|
||||
LOG_T(MAC, "DL list node %d => %d\n",
|
||||
j,
|
||||
listP->next[j]);
|
||||
}
|
||||
/*
|
||||
* Add a UE to UE_list listP
|
||||
*/
|
||||
inline void add_ue_list(UE_list_t *listP, int UE_id) {
|
||||
if (listP->head == -1) {
|
||||
listP->head = UE_id;
|
||||
listP->next[UE_id] = -1;
|
||||
} else {
|
||||
for (int j = listP->head_ul; j >= 0; j = listP->next_ul[j]) {
|
||||
LOG_T(MAC, "UL list node %d => %d\n",
|
||||
j,
|
||||
listP->next_ul[j]);
|
||||
}
|
||||
int i = listP->head;
|
||||
while (listP->next[i] >= 0)
|
||||
i = listP->next[i];
|
||||
listP->next[i] = UE_id;
|
||||
listP->next[UE_id] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Remove a UE from the UE_list listP, return the previous element
|
||||
*/
|
||||
inline int remove_ue_list(UE_list_t *listP, int UE_id) {
|
||||
listP->next[UE_id] = -1;
|
||||
if (listP->head == UE_id) {
|
||||
listP->head = listP->next[UE_id];
|
||||
return -1;
|
||||
}
|
||||
|
||||
return;
|
||||
int previous = prev(listP, UE_id);
|
||||
if (previous != -1)
|
||||
listP->next[previous] = listP->next[UE_id];
|
||||
return previous;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -2158,50 +2172,47 @@ add_new_ue(module_id_t mod_idP,
|
||||
{
|
||||
int UE_id;
|
||||
int i, j;
|
||||
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
|
||||
LOG_D(MAC, "[eNB %d, CC_id %d] Adding UE with rnti %x (next avail %d, num_UEs %d)\n",
|
||||
UE_info_t *UE_info = &RC.mac[mod_idP]->UE_info;
|
||||
LOG_D(MAC, "[eNB %d, CC_id %d] Adding UE with rnti %x (prev. num_UEs %d)\n",
|
||||
mod_idP,
|
||||
cc_idP,
|
||||
rntiP,
|
||||
UE_list->avail,
|
||||
UE_list->num_UEs);
|
||||
dump_ue_list(UE_list, 0);
|
||||
UE_info->num_UEs);
|
||||
|
||||
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
|
||||
if (UE_list->active[i] == TRUE)
|
||||
if (UE_info->active[i] == TRUE)
|
||||
continue;
|
||||
|
||||
UE_id = i;
|
||||
memset(&UE_list->UE_template[cc_idP][UE_id], 0, sizeof(UE_TEMPLATE));
|
||||
UE_list->UE_template[cc_idP][UE_id].rnti = rntiP;
|
||||
UE_list->UE_template[cc_idP][UE_id].configured = FALSE;
|
||||
UE_list->numactiveCCs[UE_id] = 1;
|
||||
UE_list->numactiveULCCs[UE_id] = 1;
|
||||
UE_list->pCC_id[UE_id] = cc_idP;
|
||||
UE_list->ordered_CCids[0][UE_id] = cc_idP;
|
||||
UE_list->ordered_ULCCids[0][UE_id] = cc_idP;
|
||||
UE_list->num_UEs++;
|
||||
UE_list->active[UE_id] = TRUE;
|
||||
memset(&UE_info->UE_template[cc_idP][UE_id], 0, sizeof(UE_TEMPLATE));
|
||||
UE_info->UE_template[cc_idP][UE_id].rnti = rntiP;
|
||||
UE_info->UE_template[cc_idP][UE_id].configured = FALSE;
|
||||
UE_info->numactiveCCs[UE_id] = 1;
|
||||
UE_info->numactiveULCCs[UE_id] = 1;
|
||||
UE_info->pCC_id[UE_id] = cc_idP;
|
||||
UE_info->ordered_CCids[0][UE_id] = cc_idP;
|
||||
UE_info->ordered_ULCCids[0][UE_id] = cc_idP;
|
||||
UE_info->num_UEs++;
|
||||
UE_info->active[UE_id] = TRUE;
|
||||
add_ue_list(&UE_info->list, UE_id);
|
||||
dump_ue_list(&UE_info->list);
|
||||
if (IS_SOFTMODEM_IQPLAYER)// not specific to record/playback ?
|
||||
UE_list->UE_template[cc_idP][UE_id].pre_assigned_mcs_ul = 0;
|
||||
UE_list->UE_template[cc_idP][UE_id].rach_resource_type = rach_resource_type;
|
||||
memset((void *) &UE_list->UE_sched_ctrl[UE_id],
|
||||
UE_info->UE_template[cc_idP][UE_id].pre_assigned_mcs_ul = 0;
|
||||
UE_info->UE_template[cc_idP][UE_id].rach_resource_type = rach_resource_type;
|
||||
memset((void *) &UE_info->UE_sched_ctrl[UE_id],
|
||||
0,
|
||||
sizeof(UE_sched_ctrl_t));
|
||||
memset((void *) &UE_list->eNB_UE_stats[cc_idP][UE_id],
|
||||
memset((void *) &UE_info->eNB_UE_stats[cc_idP][UE_id],
|
||||
0,
|
||||
sizeof(eNB_UE_STATS));
|
||||
UE_list->UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 0;
|
||||
/* default slice in case there was something different */
|
||||
UE_list->assoc_dl_slice_idx[UE_id] = 0;
|
||||
UE_list->assoc_ul_slice_idx[UE_id] = 0;
|
||||
UE_list->UE_sched_ctrl[UE_id].ta_update = 31;
|
||||
UE_info->UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 0;
|
||||
UE_info->UE_sched_ctrl[UE_id].ta_update = 31;
|
||||
|
||||
for (j = 0; j < 8; j++) {
|
||||
UE_list->UE_template[cc_idP][UE_id].oldNDI[j] = 0;
|
||||
UE_list->UE_template[cc_idP][UE_id].oldNDI_UL[j] = 0;
|
||||
UE_list->UE_sched_ctrl[UE_id].round[cc_idP][j] = 8;
|
||||
UE_list->UE_sched_ctrl[UE_id].round_UL[cc_idP][j] = 0;
|
||||
UE_info->UE_template[cc_idP][UE_id].oldNDI[j] = 0;
|
||||
UE_info->UE_template[cc_idP][UE_id].oldNDI_UL[j] = 0;
|
||||
UE_info->UE_sched_ctrl[UE_id].round[cc_idP][j] = 8;
|
||||
UE_info->UE_sched_ctrl[UE_id].round_UL[cc_idP][j] = 0;
|
||||
}
|
||||
|
||||
eNB_ulsch_info[mod_idP][cc_idP][UE_id].status = S_UL_WAITING;
|
||||
@@ -2211,15 +2222,11 @@ add_new_ue(module_id_t mod_idP,
|
||||
UE_id,
|
||||
cc_idP,
|
||||
rntiP);
|
||||
dump_ue_list(UE_list,
|
||||
0);
|
||||
return (UE_id);
|
||||
}
|
||||
|
||||
// printf("MAC: cannot add new UE for rnti %x\n", rntiP);
|
||||
LOG_E(MAC, "error in add_new_ue(), could not find space in UE_list, Dumping UE list\n");
|
||||
dump_ue_list(UE_list,
|
||||
0);
|
||||
dump_ue_list(&UE_info->list);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -2232,7 +2239,7 @@ rrc_mac_remove_ue(module_id_t mod_idP,
|
||||
rnti_t rntiP)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
|
||||
UE_info_t *UE_info = &RC.mac[mod_idP]->UE_info;
|
||||
int UE_id = find_UE_id(mod_idP, rntiP);
|
||||
eNB_UE_STATS *ue_stats = NULL;
|
||||
int pCC_id = -1;
|
||||
@@ -2248,37 +2255,14 @@ rrc_mac_remove_ue(module_id_t mod_idP,
|
||||
UE_id,
|
||||
pCC_id,
|
||||
rntiP);
|
||||
dump_ue_list(UE_list, 0); // DL list displayed in LOG_T(MAC)
|
||||
UE_list->active[UE_id] = FALSE;
|
||||
UE_list->num_UEs--;
|
||||
UE_info->active[UE_id] = FALSE;
|
||||
UE_info->num_UEs--;
|
||||
|
||||
/* If present, remove UE from DL list */
|
||||
if (UE_list->head == UE_id) {
|
||||
UE_list->head = UE_list->next[UE_id];
|
||||
} else {
|
||||
int previous = prev(UE_list, UE_id, 0);
|
||||
|
||||
if (previous != -1) {
|
||||
UE_list->next[previous] = UE_list->next[UE_id];
|
||||
}
|
||||
}
|
||||
|
||||
/* If present, remove UE from UL list */
|
||||
if (UE_list->head_ul == UE_id) {
|
||||
UE_list->head_ul = UE_list->next_ul[UE_id];
|
||||
} else {
|
||||
int previous = prev(UE_list, UE_id, 1);
|
||||
|
||||
if (previous != -1) {
|
||||
UE_list->next_ul[previous] = UE_list->next_ul[UE_id];
|
||||
}
|
||||
}
|
||||
remove_ue_list(&UE_info->list, UE_id);
|
||||
|
||||
/* Clear all remaining pending transmissions */
|
||||
memset(&UE_list->UE_template[pCC_id][UE_id],
|
||||
0,
|
||||
sizeof(UE_TEMPLATE));
|
||||
ue_stats = &UE_list->eNB_UE_stats[pCC_id][UE_id];
|
||||
memset(&UE_info->UE_template[pCC_id][UE_id], 0, sizeof(UE_TEMPLATE));
|
||||
ue_stats = &UE_info->eNB_UE_stats[pCC_id][UE_id];
|
||||
ue_stats->total_rbs_used = 0;
|
||||
ue_stats->total_rbs_used_retx = 0;
|
||||
|
||||
@@ -2355,166 +2339,19 @@ rrc_mac_remove_ue(module_id_t mod_idP,
|
||||
/*
|
||||
* Returns the previous UE_id in the scheduling list in UL or DL
|
||||
*/
|
||||
int
|
||||
prev(UE_list_t *listP,
|
||||
int nodeP,
|
||||
int ul_flag)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
if (ul_flag == 0) {
|
||||
if (nodeP == listP->head) {
|
||||
return nodeP;
|
||||
}
|
||||
inline int prev(UE_list_t *listP, int nodeP) {
|
||||
if (nodeP == listP->head)
|
||||
return -1; /* there is no previous of the head */
|
||||
|
||||
for (int j = listP->head; j >= 0; j = listP->next[j]) {
|
||||
if (listP->next[j] == nodeP) {
|
||||
return j;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (nodeP == listP->head_ul) {
|
||||
return nodeP;
|
||||
}
|
||||
for (int j = listP->head; j >= 0; j = listP->next[j])
|
||||
if (listP->next[j] == nodeP)
|
||||
return j;
|
||||
|
||||
for (int j = listP->head_ul; j >= 0; j = listP->next_ul[j]) {
|
||||
if (listP->next_ul[j] == nodeP) {
|
||||
return j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOG_E(MAC, "error in prev(), could not find previous to %d in UE_list %s, should never happen, Dumping UE list\n",
|
||||
nodeP,
|
||||
(ul_flag == 0) ? "DL" : "UL");
|
||||
dump_ue_list(listP,
|
||||
ul_flag);
|
||||
LOG_E(MAC, "%s(): could not find previous to %d in UE_list\n", __func__, nodeP);
|
||||
dump_ue_list(listP);
|
||||
return -1;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void
|
||||
swap_UEs(UE_list_t *listP,
|
||||
int nodeiP,
|
||||
int nodejP,
|
||||
int ul_flag)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
int prev_i, prev_j, next_i, next_j;
|
||||
LOG_T(MAC, "Swapping UE %d,%d\n",
|
||||
nodeiP,
|
||||
nodejP);
|
||||
dump_ue_list(listP,
|
||||
ul_flag);
|
||||
prev_i = prev(listP,
|
||||
nodeiP,
|
||||
ul_flag);
|
||||
prev_j = prev(listP,
|
||||
nodejP,
|
||||
ul_flag);
|
||||
AssertFatal((prev_i >= 0) && (prev_j >= 0), "swap_UEs: problem");
|
||||
|
||||
if (ul_flag == 0) {
|
||||
next_i = listP->next[nodeiP];
|
||||
next_j = listP->next[nodejP];
|
||||
} else {
|
||||
next_i = listP->next_ul[nodeiP];
|
||||
next_j = listP->next_ul[nodejP];
|
||||
}
|
||||
|
||||
LOG_T(MAC, "[%s] next_i %d, next_i, next_j %d, head %d \n",
|
||||
(ul_flag == 0) ? "DL" : "UL",
|
||||
next_i,
|
||||
next_j,
|
||||
listP->head);
|
||||
|
||||
if (ul_flag == 0) {
|
||||
if (next_i == nodejP) { // case ... p(i) i j n(j) ... => ... p(j) j i n(i) ...
|
||||
LOG_T(MAC, "Case ... p(i) i j n(j) ... => ... p(j) j i n(i) ...\n");
|
||||
listP->next[nodeiP] = next_j;
|
||||
listP->next[nodejP] = nodeiP;
|
||||
|
||||
if (nodeiP == listP->head) { // case i j n(j)
|
||||
listP->head = nodejP;
|
||||
} else {
|
||||
listP->next[prev_i] = nodejP;
|
||||
}
|
||||
} else if (next_j == nodeiP) { // case ... p(j) j i n(i) ... => ... p(i) i j n(j) ...
|
||||
LOG_T(MAC, "Case ... p(j) j i n(i) ... => ... p(i) i j n(j) ...\n");
|
||||
listP->next[nodejP] = next_i;
|
||||
listP->next[nodeiP] = nodejP;
|
||||
|
||||
if (nodejP == listP->head) { // case j i n(i)
|
||||
listP->head = nodeiP;
|
||||
} else {
|
||||
listP->next[prev_j] = nodeiP;
|
||||
}
|
||||
} else { // case ... p(i) i n(i) ... p(j) j n(j) ...
|
||||
listP->next[nodejP] = next_i;
|
||||
listP->next[nodeiP] = next_j;
|
||||
|
||||
if (nodeiP == listP->head) {
|
||||
LOG_T(MAC, "changing head to %d\n",
|
||||
nodejP);
|
||||
listP->head = nodejP;
|
||||
listP->next[prev_j] = nodeiP;
|
||||
} else if (nodejP == listP->head) {
|
||||
LOG_D(MAC, "changing head to %d\n",
|
||||
nodeiP);
|
||||
listP->head = nodeiP;
|
||||
listP->next[prev_i] = nodejP;
|
||||
} else {
|
||||
listP->next[prev_i] = nodejP;
|
||||
listP->next[prev_j] = nodeiP;
|
||||
}
|
||||
}
|
||||
} else { // ul_flag
|
||||
if (next_i == nodejP) { // case ... p(i) i j n(j) ... => ... p(j) j i n(i) ...
|
||||
LOG_T(MAC, "[UL] Case ... p(i) i j n(j) ... => ... p(j) j i n(i) ...\n");
|
||||
listP->next_ul[nodeiP] = next_j;
|
||||
listP->next_ul[nodejP] = nodeiP;
|
||||
|
||||
if (nodeiP == listP->head_ul) { // case i j n(j)
|
||||
listP->head_ul = nodejP;
|
||||
} else {
|
||||
listP->next_ul[prev_i] = nodejP;
|
||||
}
|
||||
} else if (next_j == nodeiP) { // case ... p(j) j i n(i) ... => ... p(i) i j n(j) ...
|
||||
LOG_T(MAC, "[UL]Case ... p(j) j i n(i) ... => ... p(i) i j n(j) ...\n");
|
||||
listP->next_ul[nodejP] = next_i;
|
||||
listP->next_ul[nodeiP] = nodejP;
|
||||
|
||||
if (nodejP == listP->head_ul) { // case j i n(i)
|
||||
listP->head_ul = nodeiP;
|
||||
} else {
|
||||
listP->next_ul[prev_j] = nodeiP;
|
||||
}
|
||||
} else { // case ... p(i) i n(i) ... p(j) j n(j) ...
|
||||
listP->next_ul[nodejP] = next_i;
|
||||
listP->next_ul[nodeiP] = next_j;
|
||||
|
||||
if (nodeiP == listP->head_ul) {
|
||||
LOG_T(MAC, "[UL]changing head to %d\n",
|
||||
nodejP);
|
||||
listP->head_ul = nodejP;
|
||||
listP->next_ul[prev_j] = nodeiP;
|
||||
} else if (nodejP == listP->head_ul) {
|
||||
LOG_T(MAC, "[UL]changing head to %d\n",
|
||||
nodeiP);
|
||||
listP->head_ul = nodeiP;
|
||||
listP->next_ul[prev_i] = nodejP;
|
||||
} else {
|
||||
listP->next_ul[prev_i] = nodejP;
|
||||
listP->next_ul[prev_j] = nodeiP;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOG_T(MAC, "After swap\n");
|
||||
dump_ue_list(listP,
|
||||
ul_flag);
|
||||
return;
|
||||
}
|
||||
|
||||
// This has to be updated to include BSR information
|
||||
//------------------------------------------------------------------------------
|
||||
uint8_t
|
||||
@@ -2523,8 +2360,8 @@ UE_is_to_be_scheduled(module_id_t module_idP,
|
||||
uint8_t UE_id)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
UE_TEMPLATE *UE_template = &RC.mac[module_idP]->UE_list.UE_template[CC_id][UE_id];
|
||||
UE_sched_ctrl_t *UE_sched_ctl = &RC.mac[module_idP]->UE_list.UE_sched_ctrl[UE_id];
|
||||
UE_TEMPLATE *UE_template = &RC.mac[module_idP]->UE_info.UE_template[CC_id][UE_id];
|
||||
UE_sched_ctrl_t *UE_sched_ctl = &RC.mac[module_idP]->UE_info.UE_sched_ctrl[UE_id];
|
||||
int rrc_status;
|
||||
|
||||
// do not schedule UE if UL is not working
|
||||
@@ -2566,7 +2403,7 @@ get_tmode(module_id_t module_idP,
|
||||
{
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
COMMON_channels_t *cc = &eNB->common_channels[CC_idP];
|
||||
struct LTE_PhysicalConfigDedicated *physicalConfigDedicated = eNB->UE_list.UE_template[CC_idP][UE_idP].physicalConfigDedicated;
|
||||
struct LTE_PhysicalConfigDedicated *physicalConfigDedicated = eNB->UE_info.UE_template[CC_idP][UE_idP].physicalConfigDedicated;
|
||||
|
||||
if (physicalConfigDedicated == NULL) { // RRCConnectionSetup not received by UE yet
|
||||
AssertFatal(cc->p_eNB <= 2, "p_eNB is %d, should be <2\n",
|
||||
@@ -2776,19 +2613,21 @@ get_min_rb_unit(module_id_t module_id,
|
||||
int N_RB_DL = to_prb(RC.mac[module_id]->common_channels[CC_id].mib->message.dl_Bandwidth);
|
||||
|
||||
switch (N_RB_DL) {
|
||||
case 6: // 1.4 MHz
|
||||
case 6: // 1.4MHz
|
||||
min_rb_unit = 1;
|
||||
break;
|
||||
|
||||
case 25: // 5HMz
|
||||
case 15: // 3MHz
|
||||
case 25: // 5MHz
|
||||
min_rb_unit = 2;
|
||||
break;
|
||||
|
||||
case 50: // 10HMz
|
||||
case 50: // 10MHz
|
||||
min_rb_unit = 3;
|
||||
break;
|
||||
|
||||
case 100: // 20HMz
|
||||
case 75: // 15MHz
|
||||
case 100: // 20MHz
|
||||
min_rb_unit = 4;
|
||||
break;
|
||||
|
||||
@@ -2809,7 +2648,7 @@ uint32_t
|
||||
allocate_prbs_sub(int nb_rb,
|
||||
int N_RB_DL,
|
||||
int N_RBG,
|
||||
uint8_t *rballoc)
|
||||
const uint8_t *rballoc)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
int check = 0; //check1=0,check2=0;
|
||||
@@ -3482,7 +3321,7 @@ try_again:
|
||||
|
||||
if (fCCE == -1) {
|
||||
if (DL_req->number_pdcch_ofdm_symbols == max_symbol) {
|
||||
LOG_I(MAC, "subframe %d: Dropping Allocation for RNTI %x\n",
|
||||
LOG_D(MAC, "subframe %d: Dropping Allocation for RNTI %x\n",
|
||||
subframeP,
|
||||
dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.rnti);
|
||||
|
||||
@@ -3671,6 +3510,121 @@ CCE_allocation_infeasible(int module_idP,
|
||||
return res;
|
||||
}
|
||||
|
||||
int CCE_try_allocate_dlsch(int module_id,
|
||||
int CC_id,
|
||||
int subframe,
|
||||
int UE_id,
|
||||
uint8_t dl_cqi) {
|
||||
const rnti_t rnti = RC.mac[module_id]->UE_info.UE_template[CC_id][UE_id].rnti;
|
||||
nfapi_dl_config_request_body_t *DL_req = &RC.mac[module_id]->DL_req[CC_id].dl_config_request_body;
|
||||
|
||||
if (DL_req->number_pdu >= MAX_NUM_DL_PDU) {
|
||||
LOG_W(MAC, "Subframe %d: FAPI DL structure is full, skip scheduling UE %d\n", subframe, rnti);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int aggregation = 2;
|
||||
const uint8_t tm = get_tmode(module_id, CC_id, UE_id);
|
||||
switch (tm) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 7:
|
||||
aggregation = get_aggregation(get_bw_index(module_id, CC_id),
|
||||
dl_cqi,
|
||||
format1);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
aggregation = get_aggregation(get_bw_index(module_id, CC_id),
|
||||
dl_cqi,
|
||||
format2A);
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(0, "Unsupported transmission mode %d\n", tm);
|
||||
break;
|
||||
}
|
||||
|
||||
nfapi_dl_config_request_pdu_t *dl_config_pdu = &DL_req->dl_config_pdu_list[DL_req->number_pdu];
|
||||
memset(dl_config_pdu, 0, sizeof(nfapi_dl_config_request_pdu_t));
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
|
||||
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = aggregation;
|
||||
DL_req->number_pdu++;
|
||||
LOG_D(MAC, "Subframe %d: Checking CCE feasibility format 1: (%x,%d) \n",
|
||||
subframe, rnti, aggregation);
|
||||
|
||||
if (allocate_CCEs(module_id, CC_id, 0, subframe, 0) < 0) {
|
||||
DL_req->number_pdu--;
|
||||
return -1;
|
||||
}
|
||||
|
||||
DL_req->number_dci++;
|
||||
nfapi_dl_config_request_pdu_t *dl_dlsch_pdu = &DL_req->dl_config_pdu_list[DL_req->number_pdu];
|
||||
dl_dlsch_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
|
||||
dl_dlsch_pdu->dlsch_pdu.dlsch_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG;
|
||||
dl_dlsch_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = rnti;
|
||||
DL_req->number_pdu++;
|
||||
|
||||
return DL_req->number_pdu - 2;
|
||||
}
|
||||
|
||||
int CCE_try_allocate_ulsch(int module_id,
|
||||
int CC_id,
|
||||
int subframe,
|
||||
int UE_id,
|
||||
uint8_t dl_cqi) {
|
||||
const rnti_t rnti = RC.mac[module_id]->UE_info.UE_template[CC_id][UE_id].rnti;
|
||||
nfapi_hi_dci0_request_body_t *HI_DCI0_req = &RC.mac[module_id]->HI_DCI0_req[CC_id][subframe].hi_dci0_request_body;
|
||||
|
||||
if (HI_DCI0_req->number_of_dci + HI_DCI0_req->number_of_hi >= MAX_NUM_HI_DCI0_PDU) {
|
||||
LOG_W(MAC, "Subframe %d: FAPI UL structure is full, skip scheduling UE %d\n", subframe, rnti);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int aggregation = 2;
|
||||
const uint8_t tm = get_tmode(module_id, CC_id, UE_id);
|
||||
switch (tm) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 7:
|
||||
aggregation = get_aggregation(get_bw_index(module_id, CC_id),
|
||||
dl_cqi,
|
||||
format1);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
aggregation = get_aggregation(get_bw_index(module_id, CC_id),
|
||||
dl_cqi,
|
||||
format2A);
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(0, "Unsupported transmission mode %d\n", tm);
|
||||
break;
|
||||
}
|
||||
|
||||
const int idx = HI_DCI0_req->number_of_dci + HI_DCI0_req->number_of_hi;
|
||||
nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[idx];
|
||||
memset(hi_dci0_pdu, 0, sizeof(nfapi_hi_dci0_request_pdu_t));
|
||||
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE;
|
||||
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG;
|
||||
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.rnti = rnti;
|
||||
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.aggregation_level = aggregation;
|
||||
HI_DCI0_req->number_of_dci++;
|
||||
LOG_D(MAC, "%s() sf %d: Checking CCE feasibility format 2: RNTI %04x, agg %d\n",
|
||||
__func__, subframe, rnti, aggregation);
|
||||
|
||||
if (allocate_CCEs(module_id, CC_id, 0, subframe, 0) < 0) {
|
||||
HI_DCI0_req->number_of_dci--;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void
|
||||
get_retransmission_timing(LTE_TDD_Config_t *tdd_Config,
|
||||
@@ -3931,15 +3885,15 @@ extract_harq(module_id_t mod_idP,
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
eNB_MAC_INST *eNB = RC.mac[mod_idP];
|
||||
UE_list_t *UE_list = &eNB->UE_list;
|
||||
UE_sched_ctrl_t *sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
|
||||
UE_info_t *UE_info = &eNB->UE_info;
|
||||
UE_sched_ctrl_t *sched_ctl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
rnti_t rnti = UE_RNTI(mod_idP, UE_id);
|
||||
COMMON_channels_t *cc = &eNB->common_channels[CC_idP];
|
||||
nfapi_harq_indication_fdd_rel13_t *harq_indication_fdd;
|
||||
nfapi_harq_indication_tdd_rel13_t *harq_indication_tdd;
|
||||
uint16_t num_ack_nak;
|
||||
int numCC = UE_list->numactiveCCs[UE_id];
|
||||
int pCCid = UE_list->pCC_id[UE_id];
|
||||
int numCC = UE_info->numactiveCCs[UE_id];
|
||||
int pCCid = UE_info->pCC_id[UE_id];
|
||||
int spatial_bundling = 0;
|
||||
int tmode[5];
|
||||
int i, j, m;
|
||||
@@ -3947,7 +3901,7 @@ extract_harq(module_id_t mod_idP,
|
||||
sub_frame_t subframe_tx;
|
||||
int frame_tx;
|
||||
uint8_t harq_pid;
|
||||
LTE_PhysicalConfigDedicated_t *physicalConfigDedicated = UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated;
|
||||
LTE_PhysicalConfigDedicated_t *physicalConfigDedicated = UE_info->UE_template[pCCid][UE_id].physicalConfigDedicated;
|
||||
|
||||
if (physicalConfigDedicated != NULL && physicalConfigDedicated->pucch_ConfigDedicated != NULL &&
|
||||
physicalConfigDedicated->ext7 != NULL && physicalConfigDedicated->ext7->pucch_ConfigDedicated_r13 != NULL &&
|
||||
@@ -4081,7 +4035,7 @@ extract_harq(module_id_t mod_idP,
|
||||
sched_ctl->round[CC_idP][harq_pid]);
|
||||
|
||||
// use 1 HARQ proces of BL/CE UE for now
|
||||
if (UE_list->UE_template[pCCid][UE_id].rach_resource_type > 0) harq_pid = 0;
|
||||
if (UE_info->UE_template[pCCid][UE_id].rach_resource_type > 0) harq_pid = 0;
|
||||
|
||||
switch (harq_indication_fdd->mode) {
|
||||
case 0: // Format 1a/b (10.1.2.1)
|
||||
@@ -4567,18 +4521,18 @@ extract_pucch_csi(module_id_t mod_idP,
|
||||
uint8_t length)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
|
||||
UE_sched_ctrl_t *sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
|
||||
UE_info_t *UE_info = &RC.mac[mod_idP]->UE_info;
|
||||
UE_sched_ctrl_t *sched_ctl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
COMMON_channels_t *cc = &RC.mac[mod_idP]->common_channels[CC_idP];
|
||||
int no_pmi;
|
||||
uint8_t Ltab[6] = { 0, 2, 4, 4, 4, 4 };
|
||||
uint8_t Jtab[6] = { 0, 2, 2, 3, 4, 4 };
|
||||
int feedback_cnt;
|
||||
AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",
|
||||
AssertFatal(UE_info->UE_template[CC_idP][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",
|
||||
UE_id);
|
||||
AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig != NULL, "cqi_ReportConfig is null for UE %d\n",
|
||||
AssertFatal(UE_info->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig != NULL, "cqi_ReportConfig is null for UE %d\n",
|
||||
UE_id);
|
||||
struct LTE_CQI_ReportPeriodic *cqi_ReportPeriodic = UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic;
|
||||
struct LTE_CQI_ReportPeriodic *cqi_ReportPeriodic = UE_info->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic;
|
||||
AssertFatal(cqi_ReportPeriodic != NULL, "cqi_ReportPeriodic is null for UE %d\n",
|
||||
UE_id);
|
||||
// determine feedback mode
|
||||
@@ -4678,9 +4632,9 @@ extract_pusch_csi(module_id_t mod_idP,
|
||||
uint8_t length)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
|
||||
UE_info_t *UE_info = &RC.mac[mod_idP]->UE_info;
|
||||
COMMON_channels_t *cc = &RC.mac[mod_idP]->common_channels[CC_idP];
|
||||
UE_sched_ctrl_t *sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
|
||||
UE_sched_ctrl_t *sched_ctl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
int Ntab[6] = { 0, 4, 7, 9, 10, 13 };
|
||||
int Ntab_uesel[6] = { 0, 8, 13, 17, 19, 25 };
|
||||
int Ltab_uesel[6] = { 0, 6, 9, 13, 15, 18 };
|
||||
@@ -4689,12 +4643,12 @@ extract_pusch_csi(module_id_t mod_idP,
|
||||
int i;
|
||||
uint64_t p = *(uint64_t *) pdu;
|
||||
int curbyte, curbit;
|
||||
AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",
|
||||
AssertFatal(UE_info->UE_template[CC_idP][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",
|
||||
UE_id);
|
||||
AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig != NULL, "cqi_ReportConfig is null for UE %d\n",
|
||||
AssertFatal(UE_info->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig != NULL, "cqi_ReportConfig is null for UE %d\n",
|
||||
UE_id);
|
||||
LTE_CQI_ReportModeAperiodic_t *cqi_ReportModeAperiodic
|
||||
= UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic;
|
||||
= UE_info->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic;
|
||||
AssertFatal(cqi_ReportModeAperiodic != NULL, "cqi_ReportModeAperiodic is null for UE %d\n",
|
||||
UE_id);
|
||||
int N = Ntab[cc->mib->message.dl_Bandwidth];
|
||||
@@ -4964,14 +4918,14 @@ cqi_indication(module_id_t mod_idP,
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
int UE_id = find_UE_id(mod_idP, rntiP);
|
||||
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
|
||||
UE_info_t *UE_info = &RC.mac[mod_idP]->UE_info;
|
||||
|
||||
if (UE_id == -1) {
|
||||
LOG_W(MAC, "cqi_indication: UE %x not found\n", rntiP);
|
||||
return;
|
||||
}
|
||||
|
||||
UE_sched_ctrl_t *sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
|
||||
UE_sched_ctrl_t *sched_ctl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
|
||||
if (UE_id >= 0) {
|
||||
LOG_D(MAC,"%s() UE_id:%d channel:%d cqi:%d\n",
|
||||
@@ -5037,11 +4991,11 @@ SR_indication(module_id_t mod_idP,
|
||||
T_INT(subframeP),
|
||||
T_INT(rntiP));
|
||||
int UE_id = find_UE_id(mod_idP, rntiP);
|
||||
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
|
||||
UE_info_t *UE_info = &RC.mac[mod_idP]->UE_info;
|
||||
UE_sched_ctrl_t *UE_scheduling_ctrl = NULL;
|
||||
|
||||
if (UE_id != -1) {
|
||||
UE_scheduling_ctrl = &(UE_list->UE_sched_ctrl[UE_id]);
|
||||
UE_scheduling_ctrl = &(UE_info->UE_sched_ctrl[UE_id]);
|
||||
|
||||
if ((UE_scheduling_ctrl->cdrx_configured == TRUE) &&
|
||||
(UE_scheduling_ctrl->dci0_ongoing_timer > 0) &&
|
||||
@@ -5065,8 +5019,8 @@ SR_indication(module_id_t mod_idP,
|
||||
cc_idP);
|
||||
}
|
||||
|
||||
UE_list->UE_template[cc_idP][UE_id].ul_SR = 1;
|
||||
UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE;
|
||||
UE_info->UE_template[cc_idP][UE_id].ul_SR = 1;
|
||||
UE_info->UE_template[cc_idP][UE_id].ul_active = TRUE;
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION, 1);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION, 0);
|
||||
}
|
||||
@@ -5093,7 +5047,7 @@ UL_failure_indication(module_id_t mod_idP,
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
int UE_id = find_UE_id(mod_idP, rntiP);
|
||||
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
|
||||
UE_info_t *UE_info = &RC.mac[mod_idP]->UE_info;
|
||||
|
||||
if (UE_id != -1) {
|
||||
LOG_D(MAC, "[eNB %d][UE %d/%x] Frame %d subframeP %d Signaling UL Failure for UE %d on CC_id %d (timer %d)\n",
|
||||
@@ -5104,9 +5058,9 @@ UL_failure_indication(module_id_t mod_idP,
|
||||
subframeP,
|
||||
UE_id,
|
||||
cc_idP,
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer);
|
||||
UE_info->UE_sched_ctrl[UE_id].ul_failure_timer);
|
||||
|
||||
if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer == 0) UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 1;
|
||||
if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer == 0) UE_info->UE_sched_ctrl[UE_id].ul_failure_timer = 1;
|
||||
} else {
|
||||
// AssertFatal(0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP);
|
||||
// AssertError(0, 0, "Frame %d: find_UE_id(%u,rnti %d) not found\n", frameP, enb_mod_idP, rntiP);
|
||||
@@ -5169,8 +5123,8 @@ harq_indication(module_id_t mod_idP,
|
||||
return;
|
||||
}
|
||||
|
||||
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
|
||||
UE_sched_ctrl_t *sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
|
||||
UE_info_t *UE_info = &RC.mac[mod_idP]->UE_info;
|
||||
UE_sched_ctrl_t *sched_ctl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
COMMON_channels_t *cc = &RC.mac[mod_idP]->common_channels[CC_idP];
|
||||
// extract HARQ Information
|
||||
|
||||
@@ -5201,51 +5155,3 @@ harq_indication(module_id_t mod_idP,
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Flexran Slicing functions
|
||||
//------------------------------------------------------------------------------
|
||||
uint16_t
|
||||
nb_rbs_allowed_slice(float rb_percentage,
|
||||
int total_rbs)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
return (uint16_t) floor(rb_percentage * total_rbs);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
ue_dl_slice_membership(module_id_t mod_id,
|
||||
int UE_id,
|
||||
int slice_idx)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
eNB_MAC_INST *eNB = RC.mac[mod_id];
|
||||
|
||||
if (slice_idx < 0 || slice_idx >= eNB->slice_info.n_dl) {
|
||||
LOG_W(MAC, "out of range slice index %d (slice ID %d)\n",
|
||||
slice_idx,
|
||||
eNB->slice_info.dl[slice_idx].id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return eNB->UE_list.active[UE_id] == TRUE && eNB->UE_list.assoc_dl_slice_idx[UE_id] == slice_idx;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
ue_ul_slice_membership(module_id_t mod_id,
|
||||
int UE_id,
|
||||
int slice_idx)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
eNB_MAC_INST *eNB = RC.mac[mod_id];
|
||||
|
||||
if (slice_idx < 0 || slice_idx >= eNB->slice_info.n_ul) {
|
||||
LOG_W(MAC, "out of range slice index %d (slice ID %d)\n",
|
||||
slice_idx,
|
||||
eNB->slice_info.dl[slice_idx].id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return eNB->UE_list.active[UE_id] == TRUE && eNB->UE_list.assoc_ul_slice_idx[UE_id] == slice_idx;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+35
-56
@@ -824,11 +824,16 @@ typedef struct {
|
||||
uint16_t cshift[8]; // num_max_harq
|
||||
|
||||
/// Number of Allocated RBs by the ulsch preprocessor
|
||||
uint8_t pre_allocated_nb_rb_ul[MAX_NUM_SLICES];
|
||||
uint8_t pre_allocated_nb_rb_ul;
|
||||
/// Start of Allocated RBs by the USLCH preprocessor
|
||||
uint8_t pre_first_nb_rb_ul;
|
||||
|
||||
/// index of Allocated RBs by the ulsch preprocessor
|
||||
int8_t pre_allocated_rb_table_index_ul;
|
||||
|
||||
/// index of allocated HI_DCI0
|
||||
int pre_dci_ul_pdu_idx;
|
||||
|
||||
/// total allocated RBs
|
||||
int8_t total_allocated_rbs;
|
||||
|
||||
@@ -852,10 +857,10 @@ typedef struct {
|
||||
|
||||
// Logical channel info for link with RLC
|
||||
|
||||
/// LCGID mapping
|
||||
/// LCGID mapping (UL)
|
||||
long lcgidmap[11];
|
||||
|
||||
///UE logical channel priority
|
||||
///UE logical channel priority (UL)
|
||||
long lcgidpriority[11];
|
||||
|
||||
/// phr information
|
||||
@@ -913,31 +918,12 @@ typedef struct {
|
||||
|
||||
/*! \brief scheduling control information set through an API (not used)*/
|
||||
typedef struct {
|
||||
///UL transmission bandwidth in RBs
|
||||
uint8_t ul_bandwidth[MAX_NUM_LCID];
|
||||
///DL transmission bandwidth in RBs
|
||||
uint8_t dl_bandwidth[MAX_NUM_LCID];
|
||||
|
||||
//To do GBR bearer
|
||||
uint8_t min_ul_bandwidth[MAX_NUM_LCID];
|
||||
|
||||
uint8_t min_dl_bandwidth[MAX_NUM_LCID];
|
||||
|
||||
///aggregated bit rate of non-gbr bearer per UE
|
||||
uint64_t ue_AggregatedMaximumBitrateDL;
|
||||
///aggregated bit rate of non-gbr bearer per UE
|
||||
uint64_t ue_AggregatedMaximumBitrateUL;
|
||||
///CQI scheduling interval in subframes.
|
||||
uint16_t cqiSchedInterval;
|
||||
///Contention resolution timer used during random access
|
||||
uint8_t mac_ContentionResolutionTimer;
|
||||
|
||||
uint16_t max_rbs_allowed_slice[NFAPI_CC_MAX][MAX_NUM_SLICES];
|
||||
uint16_t max_rbs_allowed_slice_uplink[NFAPI_CC_MAX][MAX_NUM_SLICES];
|
||||
|
||||
uint8_t max_mcs[MAX_NUM_LCID];
|
||||
|
||||
uint16_t priority[MAX_NUM_LCID];
|
||||
/// number of active DL LCs
|
||||
uint8_t dl_lc_num;
|
||||
/// order in which DLSCH scheduler should allocate LCs
|
||||
uint8_t dl_lc_ids[MAX_NUM_LCID];
|
||||
/// number of bytes to schedule for each LC
|
||||
uint32_t dl_lc_bytes[MAX_NUM_LCID];
|
||||
|
||||
// resource scheduling information
|
||||
|
||||
@@ -950,6 +936,7 @@ typedef struct {
|
||||
uint8_t dl_pow_off[NFAPI_CC_MAX];
|
||||
uint16_t pre_nb_available_rbs[NFAPI_CC_MAX];
|
||||
unsigned char rballoc_sub_UE[NFAPI_CC_MAX][N_RBG_MAX];
|
||||
int pre_dci_dl_pdu_idx;
|
||||
uint16_t ta_timer;
|
||||
int16_t ta_update;
|
||||
uint16_t ul_consecutive_errors;
|
||||
@@ -1130,7 +1117,15 @@ typedef struct {
|
||||
uint8_t sb_size;
|
||||
uint8_t nb_active_sb;
|
||||
} SBMAP_CONF;
|
||||
/*! \brief UE list used by eNB to order UEs/CC for scheduling*/
|
||||
|
||||
/*! \brief UE_list_t is a "list" of users within UE_info_t. Especial useful in
|
||||
* the scheduler and to keep "classes" of users. */
|
||||
typedef struct {
|
||||
int head;
|
||||
int next[MAX_MOBILES_PER_ENB];
|
||||
} UE_list_t;
|
||||
|
||||
/*! \brief UE info used by eNB to order UEs/CC for scheduling*/
|
||||
typedef struct {
|
||||
|
||||
DLSCH_PDU DLSCH_pdu[NFAPI_CC_MAX][2][MAX_MOBILES_PER_ENB];
|
||||
@@ -1152,21 +1147,13 @@ typedef struct {
|
||||
eNB_UE_STATS eNB_UE_stats[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
|
||||
/// scheduling control info
|
||||
UE_sched_ctrl_t UE_sched_ctrl[MAX_MOBILES_PER_ENB];
|
||||
int next[MAX_MOBILES_PER_ENB];
|
||||
int head;
|
||||
int next_ul[MAX_MOBILES_PER_ENB];
|
||||
int head_ul;
|
||||
int avail;
|
||||
UE_list_t list;
|
||||
int num_UEs;
|
||||
boolean_t active[MAX_MOBILES_PER_ENB];
|
||||
|
||||
/// Sorting criteria for the UE list in the MAC preprocessor
|
||||
uint16_t sorting_criteria[MAX_NUM_SLICES][CR_NUM];
|
||||
uint16_t first_rb_offset[NFAPI_CC_MAX][MAX_NUM_SLICES];
|
||||
|
||||
int assoc_dl_slice_idx[MAX_MOBILES_PER_ENB];
|
||||
int assoc_ul_slice_idx[MAX_MOBILES_PER_ENB];
|
||||
} UE_list_t;
|
||||
} UE_info_t;
|
||||
|
||||
/*! \brief deleting control information*/
|
||||
typedef struct {
|
||||
@@ -1184,20 +1171,6 @@ typedef struct {
|
||||
int tail_freelist; ///the tail position of the delete list
|
||||
} UE_free_list_t;
|
||||
|
||||
/// Structure for saving the output of each pre_processor instance
|
||||
typedef struct {
|
||||
uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
|
||||
uint16_t nb_rbs_accounted[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
|
||||
uint16_t nb_rbs_remaining[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
|
||||
uint8_t slice_allocation_mask[NFAPI_CC_MAX][N_RBG_MAX];
|
||||
uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX];
|
||||
|
||||
uint32_t bytes_lcid[MAX_MOBILES_PER_ENB][MAX_NUM_LCID];
|
||||
uint32_t wb_pmi[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
|
||||
uint8_t mcs[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
|
||||
|
||||
} pre_processor_results_t;
|
||||
|
||||
/**
|
||||
* slice specific scheduler for the DL
|
||||
*/
|
||||
@@ -1289,12 +1262,18 @@ typedef struct {
|
||||
int n_ul;
|
||||
slice_sched_conf_ul_t ul[MAX_NUM_SLICES];
|
||||
|
||||
pre_processor_results_t pre_processor_results[MAX_NUM_SLICES];
|
||||
|
||||
/// common rb allocation list between slices
|
||||
uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX];
|
||||
} slice_info_t;
|
||||
|
||||
/**
|
||||
* describes contiguous RBs
|
||||
*/
|
||||
typedef struct {
|
||||
int start;
|
||||
int length;
|
||||
} contig_rbs_t;
|
||||
|
||||
/*! \brief eNB common channels */
|
||||
typedef struct {
|
||||
int physCellId;
|
||||
@@ -1414,7 +1393,7 @@ typedef struct eNB_MAC_INST_s {
|
||||
nfapi_ue_release_request_t UE_release_req;
|
||||
/// UL handle
|
||||
uint32_t ul_handle;
|
||||
UE_list_t UE_list;
|
||||
UE_info_t UE_info;
|
||||
|
||||
/// slice-related configuration
|
||||
slice_info_t slice_info;
|
||||
|
||||
+37
-116
@@ -122,15 +122,14 @@ void schedule_ulsch(module_id_t module_idP, frame_t frameP,
|
||||
|
||||
/** \brief ULSCH Scheduling per RNTI
|
||||
@param Mod_id Instance ID of eNB
|
||||
@param slice_idx Slice instance index for this eNB
|
||||
@param CC_id The component carrier to schedule
|
||||
@param frame Frame index
|
||||
@param subframe Subframe number on which to act
|
||||
@param sched_subframe Subframe number where PUSCH is transmitted (for DAI lookup)
|
||||
*/
|
||||
void schedule_ulsch_rnti(module_id_t module_idP, int slice_idx, frame_t frameP,
|
||||
void schedule_ulsch_rnti(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
sub_frame_t subframe,
|
||||
unsigned char sched_subframe,
|
||||
uint16_t *first_rb);
|
||||
unsigned char sched_subframe);
|
||||
|
||||
void schedule_ulsch_rnti_emtc(module_id_t module_idP,
|
||||
frame_t frameP,
|
||||
@@ -138,14 +137,6 @@ void schedule_ulsch_rnti_emtc(module_id_t module_idP,
|
||||
unsigned char sched_subframeP,
|
||||
int *emtc_active);
|
||||
|
||||
/** \brief Second stage of DLSCH scheduling, after schedule_SI, schedule_RA and schedule_dlsch have been called. This routine first allocates random frequency assignments for SI and RA SDUs using distributed VRB allocations and adds the corresponding DCI SDU to the DCI buffer for PHY. It then loops over the UE specific DCIs previously allocated and fills in the remaining DCI fields related to frequency allocation. It assumes localized allocation of type 0 (DCI.rah=0). The allocation is done for tranmission modes 1,2,4.
|
||||
@param Mod_id Instance of eNB
|
||||
@param frame Frame index
|
||||
@param subframe Index of subframe
|
||||
@param mbsfn_flag Indicates that this subframe is for MCH/MCCH
|
||||
*/
|
||||
void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,int *mbsfn_flag);
|
||||
|
||||
/** \brief UE specific DLSCH scheduling. Retrieves next ue to be schduled from round-robin scheduler and gets the appropriate harq_pid for the subframe from PHY. If the process is active and requires a retransmission, it schedules the retransmission with the same PRB count and MCS as the first transmission. Otherwise it consults RLC for DCCH/DTCH SDUs (status with maximum number of available PRBS), builds the MAC header (timing advance sent by default) and copies
|
||||
@param Mod_id Instance ID of eNB
|
||||
@param frame Frame index
|
||||
@@ -156,8 +147,10 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,i
|
||||
void schedule_dlsch(module_id_t module_idP, frame_t frameP,
|
||||
sub_frame_t subframe, int *mbsfn_flag);
|
||||
|
||||
void schedule_ue_spec(module_id_t module_idP, int slice_idxP,
|
||||
frame_t frameP,sub_frame_t subframe, int *mbsfn_flag);
|
||||
void schedule_ue_spec(module_id_t module_idP,
|
||||
int CC_id,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframe);
|
||||
void schedule_ue_spec_br(module_id_t module_idP,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframeP);
|
||||
@@ -192,7 +185,7 @@ void add_msg3(module_id_t module_idP, int CC_id, RA_t *ra, frame_t frameP,
|
||||
|
||||
//main.c
|
||||
|
||||
void init_UE_list(UE_list_t *UE_list);
|
||||
void init_UE_info(UE_info_t *UE_info);
|
||||
|
||||
void init_slice_info(slice_info_t *sli);
|
||||
|
||||
@@ -231,73 +224,9 @@ void clear_nfapi_information(eNB_MAC_INST *eNB, int CC_idP,
|
||||
|
||||
|
||||
void dlsch_scheduler_pre_processor(module_id_t module_idP,
|
||||
int slice_idxP,
|
||||
int CC_id,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframe,
|
||||
int *mbsfn_flag,
|
||||
uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX]);
|
||||
|
||||
void dlsch_scheduler_pre_processor_reset(module_id_t module_idP,
|
||||
int slice_idx,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframeP,
|
||||
int min_rb_unit[NFAPI_CC_MAX],
|
||||
uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
|
||||
uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX],
|
||||
uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX],
|
||||
int *mbsfn_flag);
|
||||
|
||||
void dlsch_scheduler_pre_processor_partitioning(module_id_t Mod_id,
|
||||
int slice_idx,
|
||||
const uint8_t rbs_retx[NFAPI_CC_MAX]);
|
||||
|
||||
void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
|
||||
int slice_idx,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframeP,
|
||||
int min_rb_unit[NFAPI_CC_MAX],
|
||||
uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
|
||||
uint16_t nb_rbs_accounted[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]);
|
||||
|
||||
void dlsch_scheduler_pre_processor_positioning(module_id_t Mod_id,
|
||||
int slice_idx,
|
||||
int min_rb_unit[NFAPI_CC_MAX],
|
||||
uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
|
||||
uint16_t nb_rbs_accounted[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
|
||||
uint16_t nb_rbs_remaining[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
|
||||
uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX],
|
||||
uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX]);
|
||||
|
||||
void dlsch_scheduler_pre_processor_intraslice_sharing(module_id_t Mod_id,
|
||||
int slice_idx,
|
||||
int min_rb_unit[NFAPI_CC_MAX],
|
||||
uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
|
||||
uint16_t nb_rbs_accounted[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
|
||||
uint16_t nb_rbs_remaining[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
|
||||
uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX],
|
||||
uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX]);
|
||||
|
||||
void slice_priority_sort(module_id_t Mod_id, int slice_list[MAX_NUM_SLICES]);
|
||||
|
||||
void dlsch_scheduler_interslice_multiplexing(module_id_t Mod_id,
|
||||
int frameP,
|
||||
sub_frame_t subframeP,
|
||||
uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX]);
|
||||
|
||||
void dlsch_scheduler_qos_multiplexing(module_id_t Mod_id,
|
||||
int frameP,
|
||||
sub_frame_t subframeP);
|
||||
|
||||
void dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id,
|
||||
int UE_id,
|
||||
uint8_t CC_id,
|
||||
int N_RBG,
|
||||
int min_rb_unit,
|
||||
uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
|
||||
uint16_t nb_rbs_remaining[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB],
|
||||
uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX],
|
||||
uint8_t slice_allocation_mask[NFAPI_CC_MAX][N_RBG_MAX],
|
||||
uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX]);
|
||||
sub_frame_t subframe);
|
||||
|
||||
/* \brief Function to trigger the eNB scheduling procedure. It is called by PHY at the beginning of each subframe, \f$n$\f
|
||||
and generates all DLSCH allocations for subframe \f$n\f$ and ULSCH allocations for subframe \f$n+k$\f.
|
||||
@@ -484,10 +413,23 @@ boolean_t CCE_allocation_infeasible(int module_idP,
|
||||
int common_flag,
|
||||
int subframe,
|
||||
int aggregation, int rnti);
|
||||
/* tries to allocate a CCE. If it succeeds, reserves NFAPI DCI and DLSCH config */
|
||||
int CCE_try_allocate_dlsch(int module_id,
|
||||
int CC_id,
|
||||
int subframe,
|
||||
int UE_id,
|
||||
uint8_t dl_cqi);
|
||||
|
||||
/* tries to allocate a CCE for UL. If it succeeds, reserves the NFAPI DCI */
|
||||
int CCE_try_allocate_ulsch(int module_id,
|
||||
int CC_id,
|
||||
int subframe,
|
||||
int UE_id,
|
||||
uint8_t dl_cqi);
|
||||
|
||||
void set_ue_dai(sub_frame_t subframeP,
|
||||
int UE_id,
|
||||
uint8_t CC_id, uint8_t tdd_config, UE_list_t *UE_list);
|
||||
uint8_t CC_id, uint8_t tdd_config, UE_info_t *UE_info);
|
||||
|
||||
uint8_t frame_subframe2_dl_harq_pid(LTE_TDD_Config_t *tdd_Config, int abs_frameP, sub_frame_t subframeP);
|
||||
/** \brief First stage of PCH Scheduling. Gets a PCH SDU from RRC if available and computes the MCS required to transport it as a function of the SDU length. It assumes a length less than or equal to 64 bytes (MCS 6, 3 PRBs).
|
||||
@@ -510,14 +452,6 @@ uint8_t UE_is_to_be_scheduled(module_id_t module_idP, int CC_id,
|
||||
module_id_t schedule_next_ulue(module_id_t module_idP, int UE_id,
|
||||
sub_frame_t subframe);
|
||||
|
||||
/** \brief Round-robin scheduler for DLSCH traffic.
|
||||
@param Mod_id Instance ID for eNB
|
||||
@param subframe Subframe number on which to act
|
||||
@returns UE index that is to be scheduled if needed/room
|
||||
*/
|
||||
int schedule_next_dlue(module_id_t module_idP, int CC_id,
|
||||
sub_frame_t subframe);
|
||||
|
||||
/* \brief Allocates a set of PRBS for a particular UE. This is a simple function for the moment, later it should process frequency-domain CQI information and/or PMI information. Currently it just returns the first PRBS that are available in the subframe based on the number requested.
|
||||
@param UE_id Index of UE on which to act
|
||||
@param nb_rb Number of PRBs allocated to UE by scheduler
|
||||
@@ -721,13 +655,13 @@ int mac_init(void);
|
||||
int add_new_ue(module_id_t Mod_id, int CC_id, rnti_t rnti, int harq_pid, uint8_t rach_resource_type);
|
||||
int rrc_mac_remove_ue(module_id_t Mod_id, rnti_t rntiP);
|
||||
|
||||
void store_dlsch_buffer(module_id_t Mod_id, int slice_idx, frame_t frameP, sub_frame_t subframeP);
|
||||
void assign_rbs_required(module_id_t Mod_id, int slice_idx, frame_t frameP, sub_frame_t subframe, uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], int min_rb_unit[NFAPI_CC_MAX]);
|
||||
void store_dlsch_buffer(module_id_t Mod_id, int CC_id, frame_t frameP, sub_frame_t subframeP);
|
||||
|
||||
void swap_UEs(UE_list_t *listP, int nodeiP, int nodejP, int ul_flag);
|
||||
int prev(UE_list_t *listP, int nodeP, int ul_flag);
|
||||
void dump_ue_list(UE_list_t *listP, int ul_flag);
|
||||
int UE_num_active_CC(UE_list_t *listP, int ue_idP);
|
||||
int prev(UE_list_t *listP, int nodeP);
|
||||
void add_ue_list(UE_list_t *listP, int UE_id);
|
||||
int remove_ue_list(UE_list_t *listP, int UE_id);
|
||||
void dump_ue_list(UE_list_t *listP);
|
||||
int UE_num_active_CC(UE_info_t *listP, int ue_idP);
|
||||
int UE_PCCID(module_id_t mod_idP, int ue_idP);
|
||||
rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP);
|
||||
|
||||
@@ -739,20 +673,14 @@ void set_ul_DAI(int module_idP,
|
||||
int frameP,
|
||||
int subframeP);
|
||||
|
||||
void ulsch_scheduler_pre_processor(module_id_t module_idP, int slice_idx, int frameP,
|
||||
void ulsch_scheduler_pre_processor(module_id_t module_idP,
|
||||
int CC_id,
|
||||
int frameP,
|
||||
sub_frame_t subframeP,
|
||||
int sched_frameP,
|
||||
unsigned char sched_subframeP,
|
||||
uint16_t *first_rb);
|
||||
void store_ulsch_buffer(module_id_t module_idP, int frameP,
|
||||
sub_frame_t subframeP);
|
||||
void assign_max_mcs_min_rb(module_id_t module_idP, int slice_idx, int frameP,
|
||||
sub_frame_t subframeP, uint16_t *first_rb);
|
||||
void adjust_bsr_info(int buffer_occupancy, uint16_t TBS,
|
||||
UE_TEMPLATE *UE_template);
|
||||
unsigned char sched_subframeP);
|
||||
|
||||
int phy_stats_exist(module_id_t Mod_id, int rnti);
|
||||
void sort_UEs(module_id_t Mod_idP, int slice_idx, int frameP, sub_frame_t subframeP);
|
||||
|
||||
/*! \fn UE_L2_state_t ue_scheduler(const module_id_t module_idP,const frame_t frameP, const sub_frame_t subframe, const lte_subframe_t direction,const uint8_t eNB_index)
|
||||
\brief UE scheduler where all the ue background tasks are done. This function performs the following: 1) Trigger PDCP every 5ms 2) Call RRC for link status return to PHY3) Perform SR/BSR procedures for scheduling feedback 4) Perform PHR procedures.
|
||||
@@ -913,8 +841,7 @@ void add_common_dci(DCI_PDU *DCI_pdu,
|
||||
uint8_t ra_flag);
|
||||
*/
|
||||
|
||||
uint32_t allocate_prbs_sub(int nb_rb, int N_RB_DL, int N_RBG,
|
||||
uint8_t *rballoc);
|
||||
uint32_t allocate_prbs_sub(int nb_rb, int N_RB_DL, int N_RBG, const uint8_t *rballoc);
|
||||
|
||||
void update_ul_dci(module_id_t module_idP, uint8_t CC_id, rnti_t rnti,
|
||||
uint8_t dai, sub_frame_t subframe);
|
||||
@@ -1176,14 +1103,13 @@ void program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP,
|
||||
frame_t frameP, sub_frame_t subframeP,
|
||||
uint8_t cce_idx);
|
||||
|
||||
void fill_nfapi_dlsch_config(eNB_MAC_INST *eNB,
|
||||
nfapi_dl_config_request_body_t *dl_req,
|
||||
void fill_nfapi_dlsch_config(nfapi_dl_config_request_pdu_t *dl_config_pdu,
|
||||
uint16_t length, int16_t pdu_index,
|
||||
uint16_t rnti,
|
||||
uint8_t resource_allocation_type,
|
||||
uint8_t
|
||||
virtual_resource_block_assignment_flag,
|
||||
uint16_t resource_block_coding,
|
||||
uint32_t resource_block_coding,
|
||||
uint8_t modulation,
|
||||
uint8_t redundancy_version,
|
||||
uint8_t transport_blocks,
|
||||
@@ -1277,11 +1203,6 @@ void pre_scd_nb_rbs_required( module_id_t module_idP,
|
||||
uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX]);
|
||||
#endif
|
||||
|
||||
/* Slice related functions */
|
||||
uint16_t nb_rbs_allowed_slice(float rb_percentage, int total_rbs);
|
||||
int ue_dl_slice_membership(module_id_t mod_id, int UE_id, int slice_idx);
|
||||
int ue_ul_slice_membership(module_id_t mod_id, int UE_id, int slice_idx);
|
||||
|
||||
/* DRX Configuration */
|
||||
/* Configure local DRX timers and thresholds in UE context, following the drx_configuration input */
|
||||
void eNB_Config_Local_DRX(instance_t Mod_id, rrc_mac_drx_config_req_t *rrc_mac_drx_config_req);
|
||||
|
||||
+14
-22
@@ -43,26 +43,18 @@
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
void init_UE_list(UE_list_t *UE_list)
|
||||
void init_UE_info(UE_info_t *UE_info)
|
||||
{
|
||||
int list_el;
|
||||
UE_list->num_UEs = 0;
|
||||
UE_list->head = -1;
|
||||
UE_list->head_ul = -1;
|
||||
UE_list->avail = 0;
|
||||
for (list_el = 0; list_el < MAX_MOBILES_PER_ENB - 1; list_el++) {
|
||||
UE_list->next[list_el] = list_el + 1;
|
||||
UE_list->next_ul[list_el] = list_el + 1;
|
||||
}
|
||||
UE_list->next[list_el] = -1;
|
||||
UE_list->next_ul[list_el] = -1;
|
||||
memset(UE_list->DLSCH_pdu, 0, sizeof(UE_list->DLSCH_pdu));
|
||||
memset(UE_list->UE_template, 0, sizeof(UE_list->UE_template));
|
||||
memset(UE_list->eNB_UE_stats, 0, sizeof(UE_list->eNB_UE_stats));
|
||||
memset(UE_list->UE_sched_ctrl, 0, sizeof(UE_list->UE_sched_ctrl));
|
||||
memset(UE_list->active, 0, sizeof(UE_list->active));
|
||||
memset(UE_list->assoc_dl_slice_idx, 0, sizeof(UE_list->assoc_dl_slice_idx));
|
||||
memset(UE_list->assoc_ul_slice_idx, 0, sizeof(UE_list->assoc_ul_slice_idx));
|
||||
UE_info->num_UEs = 0;
|
||||
UE_info->list.head = -1;
|
||||
for (list_el = 0; list_el < MAX_MOBILES_PER_ENB; list_el++)
|
||||
UE_info->list.next[list_el] = -1;
|
||||
memset(UE_info->DLSCH_pdu, 0, sizeof(UE_info->DLSCH_pdu));
|
||||
memset(UE_info->UE_template, 0, sizeof(UE_info->UE_template));
|
||||
memset(UE_info->eNB_UE_stats, 0, sizeof(UE_info->eNB_UE_stats));
|
||||
memset(UE_info->UE_sched_ctrl, 0, sizeof(UE_info->UE_sched_ctrl));
|
||||
memset(UE_info->active, 0, sizeof(UE_info->active));
|
||||
}
|
||||
|
||||
void init_slice_info(slice_info_t *sli)
|
||||
@@ -137,7 +129,7 @@ void mac_top_init_eNB(void)
|
||||
|
||||
mac[i]->if_inst = IF_Module_init(i);
|
||||
|
||||
init_UE_list(&mac[i]->UE_list);
|
||||
init_UE_info(&mac[i]->UE_info);
|
||||
init_slice_info(&mac[i]->slice_info);
|
||||
}
|
||||
|
||||
@@ -163,12 +155,12 @@ void mac_init_cell_params(int Mod_idP, int CC_idP)
|
||||
|
||||
memset(&RC.mac[Mod_idP]->eNB_stats, 0, sizeof(eNB_STATS));
|
||||
UE_template =
|
||||
(UE_TEMPLATE *) & RC.mac[Mod_idP]->UE_list.UE_template[CC_idP][0];
|
||||
(UE_TEMPLATE *) & RC.mac[Mod_idP]->UE_info.UE_template[CC_idP][0];
|
||||
|
||||
for (j = 0; j < MAX_MOBILES_PER_ENB; j++) {
|
||||
UE_template[j].rnti = 0;
|
||||
// initiallize the eNB to UE statistics
|
||||
memset(&RC.mac[Mod_idP]->UE_list.eNB_UE_stats[CC_idP][j], 0,
|
||||
memset(&RC.mac[Mod_idP]->UE_info.eNB_UE_stats[CC_idP][j], 0,
|
||||
sizeof(eNB_UE_STATS));
|
||||
}
|
||||
|
||||
@@ -263,4 +255,4 @@ void *mac_enb_task(void *arg)
|
||||
} // end while
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
+725
-1929
File diff suppressed because it is too large
Load Diff
@@ -390,7 +390,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id,
|
||||
LOG_USEDINLOG_VAR(mac_rlc_status_resp_t,rlc_status)=mac_rlc_status_ind(module_idP,
|
||||
UE_mac_inst[module_idP].crnti,
|
||||
eNB_indexP, frameP, subframeP,
|
||||
ENB_FLAG_NO, MBMS_FLAG_NO, DCCH, 6,0, 0
|
||||
ENB_FLAG_NO, MBMS_FLAG_NO, DCCH, 0, 0
|
||||
);
|
||||
|
||||
if (UE_mac_inst[module_idP].crnti_before_ho)
|
||||
@@ -406,7 +406,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id,
|
||||
module_idP, frameP, rlc_status.bytes_in_buffer,
|
||||
dcch_header_len);
|
||||
|
||||
sdu_lengths = mac_rlc_data_req(module_idP, UE_mac_inst[module_idP].crnti, eNB_indexP, frameP, ENB_FLAG_NO, MBMS_FLAG_NO, DCCH, 6, //not used
|
||||
sdu_lengths = mac_rlc_data_req(module_idP, UE_mac_inst[module_idP].crnti, eNB_indexP, frameP, ENB_FLAG_NO, MBMS_FLAG_NO, DCCH, 6,
|
||||
(char *) &ulsch_buff[0],0,
|
||||
0
|
||||
);
|
||||
|
||||
@@ -2809,7 +2809,6 @@ update_bsr(module_id_t module_idP, frame_t frameP,
|
||||
|
||||
rlc_status = mac_rlc_status_ind(module_idP, UE_mac_inst[module_idP].crnti,eNB_index,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
|
||||
lcid,
|
||||
0xFFFF, //TBS is not used in RLC at this step, set a special value for debug
|
||||
0, 0
|
||||
);
|
||||
lcid_bytes_in_buffer[lcid] = rlc_status.bytes_in_buffer;
|
||||
@@ -3176,7 +3175,7 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
|
||||
for (int j = 0; j < ue->numCommFlows; j++) {
|
||||
if ((ue->sourceL2Id > 0) && (ue->destinationList[j] >0) ) {
|
||||
rlc_status = mac_rlc_status_ind(module_idP, 0x1234,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
|
||||
ue->SL_LCID[i], 0xFFFF, ue->sourceL2Id, ue->destinationList[j]);
|
||||
ue->SL_LCID[i], ue->sourceL2Id, ue->destinationList[j]);
|
||||
|
||||
if (rlc_status.bytes_in_buffer > 2) {
|
||||
LOG_I(MAC,"SFN.SF %d.%d: Scheduling for %d bytes in Sidelink buffer\n",frameP,subframeP,rlc_status.bytes_in_buffer);
|
||||
|
||||
@@ -1917,6 +1917,7 @@ int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_in
|
||||
|
||||
nr_extract_dci_info(mac,dci->dci_format,dci->payloadSize,dci->rnti,(uint64_t *)dci->payloadBits,&dci_pdu_rel15);
|
||||
nr_ue_process_dci(module_id, cc_id, gNB_index, &dci_pdu_rel15, dci->rnti, dci->dci_format);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, nr_dci_pdu_rel15_t *dci, uint16_t rnti, uint32_t dci_format){
|
||||
|
||||
@@ -567,7 +567,6 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
TBS_bytes - ta_len - header_length_total - sdu_length_total - 3,
|
||||
0,
|
||||
0);
|
||||
|
||||
@@ -584,7 +583,7 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
TBS_bytes,
|
||||
TBS_bytes - ta_len - header_length_total - sdu_length_total - 3,
|
||||
(char *)&mac_sdus[sdu_length_total],
|
||||
0,
|
||||
0);
|
||||
|
||||
@@ -236,7 +236,7 @@ void nr_process_mac_pdu(
|
||||
void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
const int CC_idP,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const sub_frame_t slotP,
|
||||
const rnti_t rntiP,
|
||||
uint8_t *sduP,
|
||||
const uint16_t sdu_lenP,
|
||||
@@ -260,7 +260,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
harq_pid,
|
||||
CC_idP,
|
||||
frameP,
|
||||
subframeP,
|
||||
slotP,
|
||||
UE_scheduling_control->round_UL[CC_idP][harq_pid],
|
||||
current_rnti,
|
||||
UE_id,
|
||||
|
||||
@@ -459,7 +459,6 @@ struct mac_status_resp
|
||||
rlc_am_mac_status_indication (
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
void *const rlc_pP,
|
||||
const uint16_t tb_sizeP,
|
||||
struct mac_status_ind tx_statusP,
|
||||
const eNB_flag_t enb_flagP) {
|
||||
struct mac_status_resp status_resp;
|
||||
@@ -491,10 +490,6 @@ rlc_am_mac_status_indication (
|
||||
|
||||
rlc->last_absolute_subframe_status_indication = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP);
|
||||
|
||||
if (tb_sizeP > 0) {
|
||||
rlc->nb_bytes_requested_by_mac = tb_sizeP;
|
||||
}
|
||||
|
||||
status_resp.buffer_occupancy_in_bytes = rlc_am_get_buffer_occupancy_in_bytes(ctxt_pP, rlc);
|
||||
|
||||
// For eNB scheduler : Add Max RLC header size for new PDU
|
||||
@@ -549,8 +544,7 @@ rlc_am_mac_status_indication (
|
||||
NULL,0,
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS-IND %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc),
|
||||
tb_sizeP);
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc));
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_MAC_ENB:MSC_MAC_UE,
|
||||
@@ -565,26 +559,14 @@ rlc_am_mac_status_indication (
|
||||
}
|
||||
|
||||
if (LOG_DEBUGFLAG(DEBUG_RLC)) {
|
||||
if (tb_sizeP > 0) {
|
||||
LOG_UI(RLC, PROTOCOL_RLC_AM_CTXT_FMT" MAC_STATUS_INDICATION (DATA) %d bytes -> %d bytes\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc),
|
||||
tb_sizeP,
|
||||
status_resp.buffer_occupancy_in_bytes);
|
||||
}
|
||||
LOG_UI(RLC, PROTOCOL_RLC_AM_CTXT_FMT" MAC_STATUS_INDICATION (DATA) -> %d bytes\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc),
|
||||
status_resp.buffer_occupancy_in_bytes);
|
||||
}
|
||||
|
||||
return status_resp;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
rlc_am_set_nb_bytes_requested_by_mac (
|
||||
void *const rlc_pP,
|
||||
const tb_size_t tb_sizeP
|
||||
) {
|
||||
((rlc_am_entity_t *) rlc_pP)->nb_bytes_requested_by_mac = tb_sizeP;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
struct mac_data_req
|
||||
rlc_am_mac_data_request (
|
||||
|
||||
@@ -255,23 +255,15 @@ rlc_am_get_pdus (
|
||||
*/
|
||||
void rlc_am_rx (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, struct mac_data_ind);
|
||||
|
||||
/*! \fn struct mac_status_resp rlc_am_mac_status_indication (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP,const eNB_flag_t enb_flagP)
|
||||
/*! \fn struct mac_status_resp rlc_am_mac_status_indication (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, struct mac_status_ind tx_statusP,const eNB_flag_t enb_flagP)
|
||||
* \brief Request the maximum number of bytes that can be served by RLC instance to MAC and fix the amount of bytes requested by MAC for next RLC transmission.
|
||||
* \param[in] ctxt_pP Running context.
|
||||
* \param[in] rlc_pP RLC AM protocol instance pointer.
|
||||
* \param[in] tbs_sizeP Number of bytes requested by MAC for next transmission.
|
||||
* \param[in] tx_statusP Transmission status given by MAC on previous MAC transmission of the PDU.
|
||||
* \param[in] enb_flagP eNB or UE flag indication.
|
||||
* \return The maximum number of bytes that can be served by RLC instance to MAC.
|
||||
*/
|
||||
struct mac_status_resp rlc_am_mac_status_indication (const protocol_ctxt_t* const ctxtP, void * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP,const eNB_flag_t enb_flagP);
|
||||
|
||||
/*! \fn void rlc_am_set_nb_bytes_requested_by_mac (void * const rlc_pP,const tb_size_t tb_sizeP)
|
||||
* \brief Set available TBS for RLC Tx just before am_mac_data_request. Used for UE only.
|
||||
* \param[in] rlc_pP RLC AM protocol instance pointer.
|
||||
* \param[in] tb_sizeP Available Tx Transport Block size in bytes.
|
||||
*/
|
||||
void rlc_am_set_nb_bytes_requested_by_mac (void * const rlc_pP,const tb_size_t tb_sizeP);
|
||||
struct mac_status_resp rlc_am_mac_status_indication (const protocol_ctxt_t* const ctxtP, void * const rlc_pP, struct mac_status_ind tx_statusP,const eNB_flag_t enb_flagP);
|
||||
|
||||
/*! \fn struct mac_data_req rlc_am_mac_data_request (const protocol_ctxt_t* const ctxtP,void * const rlc_pP,const eNB_flag_t enb_flagP)
|
||||
* \brief Gives PDUs to lower layer MAC.
|
||||
|
||||
@@ -151,13 +151,10 @@ struct mac_status_resp
|
||||
rlc_tm_mac_status_indication (
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
void * const rlc_pP,
|
||||
const tb_size_t tb_sizeP,
|
||||
struct mac_status_ind tx_statusP)
|
||||
{
|
||||
struct mac_status_resp status_resp;
|
||||
|
||||
((rlc_tm_entity_t *) rlc_pP)->rlc_pdu_size = tb_sizeP;
|
||||
|
||||
status_resp.buffer_occupancy_in_bytes = ((rlc_tm_entity_t *) rlc_pP)->buffer_occupancy;
|
||||
status_resp.buffer_occupancy_in_pdus = status_resp.buffer_occupancy_in_bytes / ((rlc_tm_entity_t *) rlc_pP)->rlc_pdu_size;
|
||||
status_resp.rlc_info.rlc_protocol_state = ((rlc_tm_entity_t *) rlc_pP)->protocol_state;
|
||||
|
||||
@@ -88,11 +88,10 @@ void rlc_tm_rx (
|
||||
struct mac_data_ind data_indP);
|
||||
|
||||
|
||||
/*! \fn struct mac_status_resp rlc_tm_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void * const rlcP, const uint16_t tbs_sizeP, struct mac_status_ind tx_statusP)
|
||||
/*! \fn struct mac_status_resp rlc_tm_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void * const rlcP, struct mac_status_ind tx_statusP)
|
||||
* \brief Request the maximum number of bytes that can be served by RLC instance to MAC and fix the amount of bytes requested by MAC for next RLC transmission.
|
||||
* \param[in] ctxtP Running context.
|
||||
* \param[in] rlcP RLC TM protocol instance pointer.
|
||||
* \param[in] tbs_sizeP Number of bytes requested by MAC for next transmission.
|
||||
* \param[in] tx_statusP Transmission status given by MAC on previous MAC transmission of the PDU.
|
||||
* \return The maximum number of bytes that can be served by RLC instance to MAC.
|
||||
*/
|
||||
@@ -100,7 +99,6 @@ struct mac_status_resp
|
||||
rlc_tm_mac_status_indication (
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
void * const rlc_pP,
|
||||
const tb_size_t tb_sizeP,
|
||||
struct mac_status_ind tx_statusP);
|
||||
|
||||
|
||||
|
||||
@@ -370,7 +370,7 @@ rlc_um_rx (const protocol_ctxt_t *const ctxt_pP, void *argP, struct mac_data_ind
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
struct mac_status_resp
|
||||
rlc_um_mac_status_indication (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP,const eNB_flag_t enb_flagP) {
|
||||
rlc_um_mac_status_indication (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP, struct mac_status_ind tx_statusP,const eNB_flag_t enb_flagP) {
|
||||
struct mac_status_resp status_resp;
|
||||
uint16_t sdu_size = 0;
|
||||
uint16_t sdu_remaining_size = 0;
|
||||
@@ -386,7 +386,6 @@ rlc_um_mac_status_indication (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP
|
||||
if (rlc_pP) {
|
||||
status_resp.rlc_info.rlc_protocol_state = rlc_p->protocol_state;
|
||||
rlc_um_check_timer_dar_time_out(ctxt_pP, rlc_p);
|
||||
rlc_p->nb_bytes_requested_by_mac = tbs_sizeP;
|
||||
status_resp.buffer_occupancy_in_bytes = rlc_um_get_buffer_occupancy (rlc_p);
|
||||
|
||||
if ((status_resp.buffer_occupancy_in_bytes > 0) && ((mb_p = list_get_head(&rlc_p->input_sdus)) != NULL)) {
|
||||
@@ -416,9 +415,8 @@ rlc_um_mac_status_indication (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP
|
||||
|
||||
if (LOG_DEBUGFLAG(DEBUG_RLC)) {
|
||||
if (( rlc_p->rb_id > 0) && (status_resp.buffer_occupancy_in_bytes > 0)) {
|
||||
LOG_UI(RLC, PROTOCOL_RLC_UM_CTXT_FMT"MAC_STATUS_INDICATION (DATA) %d bytes requested -> %d bytes available\n",
|
||||
LOG_UI(RLC, PROTOCOL_RLC_UM_CTXT_FMT"MAC_STATUS_INDICATION (DATA) -> %d bytes available\n",
|
||||
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p),
|
||||
tbs_sizeP,
|
||||
status_resp.buffer_occupancy_in_bytes);
|
||||
|
||||
if ((tx_statusP.tx_status == MAC_TX_STATUS_SUCCESSFUL) && (tx_statusP.no_pdu)) {
|
||||
@@ -441,15 +439,6 @@ rlc_um_mac_status_indication (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP
|
||||
return status_resp;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
rlc_um_set_nb_bytes_requested_by_mac (
|
||||
void *rlc_pP,
|
||||
const tb_size_t tb_sizeP
|
||||
) {
|
||||
((rlc_um_entity_t *) rlc_pP)->nb_bytes_requested_by_mac = tb_sizeP;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
struct mac_data_req
|
||||
rlc_um_mac_data_request (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP,const eNB_flag_t enb_flagP) {
|
||||
|
||||
@@ -160,27 +160,15 @@ rlc_um_get_pdus (const protocol_ctxt_t* const ctxt_pP, void *argP);
|
||||
*/
|
||||
void
|
||||
rlc_um_rx (const protocol_ctxt_t* const ctxt_pP, void *argP, struct mac_data_ind data_indP);
|
||||
/*! \fn struct mac_status_resp rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP)
|
||||
/*! \fn struct mac_status_resp rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, struct mac_status_ind tx_statusP)
|
||||
* \brief Request the maximum number of bytes that can be served by RLC instance to MAC and fix the amount of bytes requested by MAC for next RLC transmission.
|
||||
* \param[in] ctxt_pP Running context.
|
||||
* \param[in] rlc_pP RLC UM protocol instance pointer.
|
||||
* \param[in] tbs_sizeP Number of bytes requested by MAC for next transmission.
|
||||
* \param[in] tx_statusP Transmission status given by MAC on previous MAC transmission of the PDU.
|
||||
* \return The maximum number of bytes that can be served by RLC instance to MAC.
|
||||
*/
|
||||
struct mac_status_resp
|
||||
rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP,const eNB_flag_t enb_flagP);
|
||||
|
||||
/*! \fn void rlc_um_set_nb_bytes_requested_by_mac (rlc_um_entity_t * const rlc_pP, const tb_size_t tb_sizeP)
|
||||
* \brief Set available TBS size for MAC Tx.
|
||||
* \param[in] rlc_pP RLC UM protocol instance pointer.
|
||||
* \param[in] tb_sizeP remaining TBS in bytes.
|
||||
*/
|
||||
void
|
||||
rlc_um_set_nb_bytes_requested_by_mac (
|
||||
void * rlc_pP,
|
||||
const tb_size_t tb_sizeP
|
||||
);
|
||||
rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP, struct mac_status_ind tx_statusP,const eNB_flag_t enb_flagP);
|
||||
|
||||
/*! \fn struct mac_data_req rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP,const eNB_flag_t enb_flagP)
|
||||
* \brief Gives PDUs to lower layer MAC.
|
||||
|
||||
@@ -391,7 +391,7 @@ void rrc_rlc_register_rrc (rrc_data_ind_cb_t rrc_data_indP, rrc_data_conf_cb_t r
|
||||
* \param [in] eNB_flagP Flag to indicate eNB (1) or UE (0)
|
||||
* \param [in] MBMS_flagP Flag to indicate whether this is the MBMS service (1) or not (0)
|
||||
* \param [in] rb_idP Radio bearer identifier.
|
||||
* \param [in] tb_sizeP Available Tx TBS in bytes. For UE only.
|
||||
* \param [in] tb_sizeP Requested Tx TBS in bytes.
|
||||
* \param [in,out] bufferP Memory area to fill with the bytes requested by MAC.
|
||||
* \return A status about the processing, OK or error code.
|
||||
*/
|
||||
@@ -416,7 +416,7 @@ tbs_size_t mac_rlc_data_req (const module_id_t, const rnti_t, con
|
||||
void mac_rlc_data_ind (const module_id_t, const rnti_t, const eNB_index_t,const frame_t, const eNB_flag_t, const MBMS_flag_t, logical_chan_id_t, char *, tb_size_t, num_tb_t,
|
||||
crc_t * );
|
||||
|
||||
/*! \fn mac_rlc_status_resp_t mac_rlc_status_ind (const module_id_t mod_idP, const rnti_t rntiP, const frame_t frameP, const sub_frame_t subframeP, const eNB_flag_t eNB_flagP, const MBMS_flag_t MBMS_flagP, logical_chan_id_t rb_idP, tb_size_t tb_sizeP)
|
||||
/*! \fn mac_rlc_status_resp_t mac_rlc_status_ind (const module_id_t mod_idP, const rnti_t rntiP, const frame_t frameP, const sub_frame_t subframeP, const eNB_flag_t eNB_flagP, const MBMS_flag_t MBMS_flagP, logical_chan_id_t rb_idP)
|
||||
* \brief Interface with MAC layer, request and set the number of bytes scheduled for transmission by the RLC instance corresponding to the radio bearer identifier.
|
||||
* \param[in] mod_idP Virtualized module identifier.
|
||||
* \param[in] rntiP UE identifier.
|
||||
@@ -425,10 +425,9 @@ void mac_rlc_data_ind (const module_id_t, const rnti_t, con
|
||||
* \param[in] eNB_flagP Flag to indicate eNB operation (1 true, 0 false)
|
||||
* \param[in] MBMS_flagP Flag to indicate whether this is the MBMS service (1) or not (0)
|
||||
* \param[in] rb_idP Radio bearer identifier.
|
||||
* \param[in] tb_sizeP Size of a transport block set in bytes.
|
||||
* \return The maximum number of bytes that the RLC instance can send in the next transmission sequence.
|
||||
*/
|
||||
mac_rlc_status_resp_t mac_rlc_status_ind (const module_id_t, const rnti_t, const eNB_index_t, const frame_t, const sub_frame_t, const eNB_flag_t, const MBMS_flag_t, logical_chan_id_t, tb_size_t
|
||||
mac_rlc_status_resp_t mac_rlc_status_ind (const module_id_t, const rnti_t, const eNB_index_t, const frame_t, const sub_frame_t, const eNB_flag_t, const MBMS_flag_t, logical_chan_id_t
|
||||
,const uint32_t sourceL2Id
|
||||
,const uint32_t destinationL2Id
|
||||
);
|
||||
|
||||
@@ -191,20 +191,19 @@ tbs_size_t mac_rlc_data_req(
|
||||
case RLC_MODE_AM:
|
||||
rlc_am_mui.rrc_mui_num = 0;
|
||||
|
||||
if (!enb_flagP) rlc_am_set_nb_bytes_requested_by_mac(&rlc_union_p->rlc.am,tb_sizeP);
|
||||
|
||||
((rlc_am_entity_t *) &rlc_union_p->rlc.am)->nb_bytes_requested_by_mac = tb_sizeP;
|
||||
data_request = rlc_am_mac_data_request(&ctxt, &rlc_union_p->rlc.am,enb_flagP);
|
||||
ret_tb_size =mac_rlc_serialize_tb(buffer_pP, data_request.data);
|
||||
break;
|
||||
|
||||
case RLC_MODE_UM:
|
||||
if (!enb_flagP) rlc_um_set_nb_bytes_requested_by_mac(&rlc_union_p->rlc.um,tb_sizeP);
|
||||
|
||||
((rlc_um_entity_t *) &rlc_union_p->rlc.um)->nb_bytes_requested_by_mac = tb_sizeP;
|
||||
data_request = rlc_um_mac_data_request(&ctxt, &rlc_union_p->rlc.um,enb_flagP);
|
||||
ret_tb_size = mac_rlc_serialize_tb(buffer_pP, data_request.data);
|
||||
break;
|
||||
|
||||
case RLC_MODE_TM:
|
||||
((rlc_tm_entity_t *) &rlc_union_p->rlc.tm)->rlc_pdu_size = tb_sizeP;
|
||||
data_request = rlc_tm_mac_data_request(&ctxt, &rlc_union_p->rlc.tm);
|
||||
ret_tb_size = mac_rlc_serialize_tb(buffer_pP, data_request.data);
|
||||
break;
|
||||
@@ -317,7 +316,6 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
|
||||
const eNB_flag_t enb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
const tb_size_t tb_sizeP,
|
||||
const uint32_t sourceL2Id,
|
||||
const uint32_t destinationL2Id
|
||||
) {
|
||||
@@ -370,7 +368,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
|
||||
break;
|
||||
|
||||
case RLC_MODE_AM:
|
||||
status_resp = rlc_am_mac_status_indication(&ctxt, &rlc_union_p->rlc.am, tb_sizeP, tx_status,enb_flagP);
|
||||
status_resp = rlc_am_mac_status_indication(&ctxt, &rlc_union_p->rlc.am, tx_status,enb_flagP);
|
||||
mac_rlc_status_resp.bytes_in_buffer = status_resp.buffer_occupancy_in_bytes;
|
||||
mac_rlc_status_resp.head_sdu_creation_time = status_resp.head_sdu_creation_time;
|
||||
mac_rlc_status_resp.head_sdu_remaining_size_to_send = status_resp.head_sdu_remaining_size_to_send;
|
||||
@@ -379,7 +377,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
|
||||
break;
|
||||
|
||||
case RLC_MODE_UM:
|
||||
status_resp = rlc_um_mac_status_indication(&ctxt, &rlc_union_p->rlc.um, tb_sizeP, tx_status, enb_flagP);
|
||||
status_resp = rlc_um_mac_status_indication(&ctxt, &rlc_union_p->rlc.um, tx_status, enb_flagP);
|
||||
mac_rlc_status_resp.bytes_in_buffer = status_resp.buffer_occupancy_in_bytes;
|
||||
mac_rlc_status_resp.pdus_in_buffer = status_resp.buffer_occupancy_in_pdus;
|
||||
mac_rlc_status_resp.head_sdu_creation_time = status_resp.head_sdu_creation_time;
|
||||
@@ -389,7 +387,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
|
||||
break;
|
||||
|
||||
case RLC_MODE_TM:
|
||||
status_resp = rlc_tm_mac_status_indication(&ctxt, &rlc_union_p->rlc.tm, tb_sizeP, tx_status);
|
||||
status_resp = rlc_tm_mac_status_indication(&ctxt, &rlc_union_p->rlc.tm, tx_status);
|
||||
mac_rlc_status_resp.bytes_in_buffer = status_resp.buffer_occupancy_in_bytes;
|
||||
mac_rlc_status_resp.pdus_in_buffer = status_resp.buffer_occupancy_in_pdus;
|
||||
// return mac_rlc_status_resp;
|
||||
|
||||
@@ -123,10 +123,7 @@ tbs_size_t mac_rlc_data_req(
|
||||
rb->set_time(rb, nr_rlc_current_time);
|
||||
/* UE does not seem to use saved_status_ind_tb_size */
|
||||
is_enb = nr_rlc_manager_get_enb_flag(nr_rlc_ue_manager);
|
||||
if (is_enb)
|
||||
maxsize = ue->saved_status_ind_tb_size[channel_idP - 1];
|
||||
else
|
||||
maxsize = tb_sizeP;
|
||||
maxsize = tb_sizeP;
|
||||
ret = rb->generate_pdu(rb, buffer_pP, maxsize);
|
||||
} else {
|
||||
LOG_E(RLC, "%s:%d:%s: fatal: data req for unknown RB\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
@@ -152,7 +149,6 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
|
||||
const eNB_flag_t enb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
const tb_size_t tb_sizeP,
|
||||
const uint32_t sourceL2Id,
|
||||
const uint32_t destinationL2Id
|
||||
)
|
||||
@@ -189,7 +185,6 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
|
||||
ret.bytes_in_buffer = buf_stat.status_size
|
||||
+ buf_stat.retx_size
|
||||
+ buf_stat.tx_size;
|
||||
ue->saved_status_ind_tb_size[channel_idP - 1] = tb_sizeP;
|
||||
} else {
|
||||
ret.bytes_in_buffer = 0;
|
||||
}
|
||||
|
||||
@@ -91,12 +91,12 @@ int dump_eNB_l2_stats(char *buffer, int length) {
|
||||
number_of_cards=NB_eNB_INST;
|
||||
#endif
|
||||
eNB_MAC_INST *eNB;
|
||||
UE_list_t *UE_list;
|
||||
UE_info_t *UE_info;
|
||||
|
||||
for (eNB_id=0; eNB_id<number_of_cards; eNB_id++) {
|
||||
/* reset the values */
|
||||
eNB = RC.mac[eNB_id];
|
||||
UE_list = &eNB->UE_list;
|
||||
UE_info = &eNB->UE_info;
|
||||
|
||||
for (CC_id=0 ; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
eNB->eNB_stats[CC_id].dlsch_bitrate= 0;
|
||||
@@ -141,76 +141,76 @@ int dump_eNB_l2_stats(char *buffer, int length) {
|
||||
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
|
||||
for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
|
||||
for (i=0; i<UE_list->numactiveCCs[UE_id]; i++) {
|
||||
CC_id=UE_list->ordered_CCids[i][UE_id];
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_bitrate=((UE_list->eNB_UE_stats[CC_id][UE_id].TBS*8)/((eNB->frame + 1)*10));
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_dlsch_bitrate= ((UE_list->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes*8)/((eNB->frame + 1)*10));
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_overhead_bytes+= UE_list->eNB_UE_stats[CC_id][UE_id].overhead_bytes;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].avg_overhead_bytes=((UE_list->eNB_UE_stats[CC_id][UE_id].total_overhead_bytes*8)/((eNB->frame + 1)*10));
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_bitrate=((UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS*8)/((eNB->frame + 1)*10));
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_ulsch_bitrate= ((UE_list->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes_rx*8)/((eNB->frame + 1)*10));
|
||||
for (UE_id=UE_info->list.head; UE_id>=0; UE_id=UE_info->list.next[UE_id]) {
|
||||
for (i=0; i<UE_info->numactiveCCs[UE_id]; i++) {
|
||||
CC_id=UE_info->ordered_CCids[i][UE_id];
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_bitrate=((UE_info->eNB_UE_stats[CC_id][UE_id].TBS*8)/((eNB->frame + 1)*10));
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_dlsch_bitrate= ((UE_info->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes*8)/((eNB->frame + 1)*10));
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_overhead_bytes+= UE_info->eNB_UE_stats[CC_id][UE_id].overhead_bytes;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].avg_overhead_bytes=((UE_info->eNB_UE_stats[CC_id][UE_id].total_overhead_bytes*8)/((eNB->frame + 1)*10));
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_bitrate=((UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_TBS*8)/((eNB->frame + 1)*10));
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_ulsch_bitrate= ((UE_info->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes_rx*8)/((eNB->frame + 1)*10));
|
||||
len += sprintf(&buffer[len],"[MAC] UE %d (DLSCH),status %s, RNTI %x : CQI %d, MCS1 %d, MCS2 %d, RB (tx %d, retx %d, total %d), ncce (tx %d, retx %d) \n",
|
||||
UE_id,
|
||||
map_int_to_str(rrc_status_names, UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status),
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].crnti,
|
||||
UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id],
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs1,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs2,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used_retx,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ncce_used,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ncce_used_retx
|
||||
map_int_to_str(rrc_status_names, UE_info->eNB_UE_stats[CC_id][UE_id].rrc_status),
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].crnti,
|
||||
UE_info->UE_sched_ctrl[UE_id].dl_cqi[CC_id],
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_mcs1,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_mcs2,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].rbs_used,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].rbs_used_retx,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_rbs_used,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ncce_used,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ncce_used_retx
|
||||
);
|
||||
len += sprintf(&buffer[len],
|
||||
"[MAC] DLSCH bitrate (TTI %d, avg %d), Transmitted bytes "
|
||||
"(TTI %d, total %"PRIu64"), Total Transmitted PDU %d, Overhead "
|
||||
"(TTI %"PRIu64", total %"PRIu64", avg %"PRIu64")\n",
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_bitrate,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_dlsch_bitrate,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].TBS,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_num_pdus,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].overhead_bytes,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_overhead_bytes,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].avg_overhead_bytes
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_bitrate,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_dlsch_bitrate,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].TBS,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_num_pdus,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].overhead_bytes,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_overhead_bytes,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].avg_overhead_bytes
|
||||
);
|
||||
len += sprintf(&buffer[len],"[MAC] UE %d (ULSCH), Status %s, Failute timer %d, RNTI %x : snr (%d, target %d), MCS (pre %d, post %d), RB (rx %d, retx %d, total %d), Current TBS %d \n",
|
||||
UE_id,
|
||||
map_int_to_str(rrc_status_names, UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status),
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].crnti,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].snr,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].target_snr,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used_rx,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used_retx_rx,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used_rx,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS
|
||||
map_int_to_str(rrc_status_names, UE_info->eNB_UE_stats[CC_id][UE_id].rrc_status),
|
||||
UE_info->UE_sched_ctrl[UE_id].ul_failure_timer,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].crnti,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].snr,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].target_snr,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].rbs_used_rx,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].rbs_used_retx_rx,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_rbs_used_rx,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_TBS
|
||||
);
|
||||
len += sprintf(&buffer[len],
|
||||
"[MAC] ULSCH bitrate (TTI %d, avg %d), received bytes (total %"PRIu64"),"
|
||||
"Total received PDU %d, Total errors %d\n",
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_bitrate,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_ulsch_bitrate,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes_rx,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_num_pdus_rx,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_errors_rx);
|
||||
len+= sprintf(&buffer[len],"[MAC] Received PHR PH = %d (db)\n", UE_list->UE_template[CC_id][UE_id].phr_info);
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_bitrate,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_ulsch_bitrate,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes_rx,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_num_pdus_rx,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].num_errors_rx);
|
||||
len+= sprintf(&buffer[len],"[MAC] Received PHR PH = %d (db)\n", UE_info->UE_template[CC_id][UE_id].phr_info);
|
||||
len+= sprintf(&buffer[len],"[MAC] Estimated size LCGID[0][1][2][3] = %u %u %u %u\n",
|
||||
UE_list->UE_template[CC_id][UE_id].ul_buffer_info[LCGID0],
|
||||
UE_list->UE_template[CC_id][UE_id].ul_buffer_info[LCGID1],
|
||||
UE_list->UE_template[CC_id][UE_id].ul_buffer_info[LCGID2],
|
||||
UE_list->UE_template[CC_id][UE_id].ul_buffer_info[LCGID3]
|
||||
UE_info->UE_template[CC_id][UE_id].ul_buffer_info[LCGID0],
|
||||
UE_info->UE_template[CC_id][UE_id].ul_buffer_info[LCGID1],
|
||||
UE_info->UE_template[CC_id][UE_id].ul_buffer_info[LCGID2],
|
||||
UE_info->UE_template[CC_id][UE_id].ul_buffer_info[LCGID3]
|
||||
);
|
||||
}
|
||||
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt,
|
||||
eNB_id,
|
||||
ENB_FLAG_YES,
|
||||
UE_list->eNB_UE_stats[0][UE_id].crnti,//UE_PCCID(eNB_id,UE_id)][UE_id].crnti,
|
||||
UE_info->eNB_UE_stats[0][UE_id].crnti,//UE_PCCID(eNB_id,UE_id)][UE_id].crnti,
|
||||
eNB->frame,
|
||||
eNB->subframe,
|
||||
eNB_id);
|
||||
@@ -509,7 +509,7 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length) {
|
||||
for(i=1; i<=NB_CNX_CH; i++) {
|
||||
if (CH_mac_inst[Mod_id].Dcch_lchan[i].Active==1) {
|
||||
len+=sprintf(&buffer[len],"\nMR index %u: DL SINR (feedback) %d dB, CQI: %s\n\n",
|
||||
i,//CH_rrc_inst[Mod_id].Info.UE_list[i].L2_id[0],
|
||||
i,//CH_rrc_inst[Mod_id].Info.UE_info[i].L2_id[0],
|
||||
CH_mac_inst[Mod_id].Def_meas[i].Wideband_sinr,
|
||||
print_cqi(CH_mac_inst[Mod_id].Def_meas[i].cqi));
|
||||
len+=sprintf(&buffer[len],
|
||||
|
||||
@@ -54,34 +54,32 @@ extern uint16_t sf_ahead;
|
||||
extern uint16_t sl_ahead;
|
||||
|
||||
void handle_nr_rach(NR_UL_IND_t *UL_info) {
|
||||
if (UL_info->rach_ind.rach_indication_body.number_of_preambles>0) {
|
||||
AssertFatal(UL_info->rach_ind.rach_indication_body.number_of_preambles==1,"More than 1 preamble not supported\n");
|
||||
UL_info->rach_ind.rach_indication_body.number_of_preambles=0;
|
||||
LOG_D(MAC,"UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SF:%d\n",UL_info->frame,UL_info->slot, NFAPI_SFNSF2DEC(UL_info->rach_ind.sfn_sf));
|
||||
/*
|
||||
initiate_ra_proc(UL_info->module_id,
|
||||
if (UL_info->rach_ind.number_of_pdus>0) {
|
||||
AssertFatal(UL_info->rach_ind.number_of_pdus==1,"More than 1 RACH pdu not supported\n");
|
||||
UL_info->rach_ind.number_of_pdus=0;
|
||||
LOG_D(MAC,"UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SLOT:%d/%d\n",UL_info->frame,UL_info->slot, UL_info->rach_ind.sfn,UL_info->rach_ind.slot);
|
||||
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rach_ind.sfn_sf),
|
||||
NFAPI_SFNSF2SF(UL_info->rach_ind.sfn_sf),
|
||||
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.preamble,
|
||||
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.timing_advance,
|
||||
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.rnti
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) || (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
//#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,0
|
||||
#endif
|
||||
if (UL_info->rach_ind.pdu_list[0].num_preamble>0)
|
||||
AssertFatal(UL_info->rach_ind.pdu_list[0].num_preamble==1,
|
||||
"More than 1 preamble not supported\n");
|
||||
|
||||
/*nr_initiate_ra_proc(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->rach_ind.sfn,
|
||||
UL_info->rach_ind.slot,
|
||||
UL_info->rach_ind.pdu_list[0].preamble_list[0].preamble_index,
|
||||
UL_info->rach_ind.pdu_list[0].freq_index,
|
||||
UL_info->rach_ind.pdu_list[0].symbol_index,
|
||||
UL_info->rach_ind.pdu_list[0].preamble_list[0].timing_advance);*/
|
||||
|
||||
);
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void handle_nr_sr(NR_UL_IND_t *UL_info) {
|
||||
|
||||
|
||||
if (nfapi_mode == 1) // PNF
|
||||
/* if (nfapi_mode == 1) // PNF
|
||||
{
|
||||
if (UL_info->sr_ind.sr_indication_body.number_of_srs>0)
|
||||
{
|
||||
@@ -91,20 +89,20 @@ void handle_nr_sr(NR_UL_IND_t *UL_info) {
|
||||
else
|
||||
{
|
||||
|
||||
/*
|
||||
|
||||
for (int i=0;i<UL_info->sr_ind.sr_indication_body.number_of_srs;i++)
|
||||
SR_indication(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->slot,
|
||||
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].rx_ue_information.rnti,
|
||||
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].ul_cqi_information.ul_cqi);*/
|
||||
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].ul_cqi_information.ul_cqi);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
UL_info->sr_ind.sr_indication_body.number_of_srs=0;
|
||||
UL_info->sr_ind.sr_indication_body.number_of_srs=0;*/
|
||||
}
|
||||
|
||||
void handle_nr_cqi(NR_UL_IND_t *UL_info) {
|
||||
@@ -119,103 +117,99 @@ void handle_nr_cqi(NR_UL_IND_t *UL_info) {
|
||||
&UL_info->cqi_ind.cqi_pdu_list[i].cqi_indication_rel9,
|
||||
UL_info->cqi_ind.cqi_raw_pdu_list[i].pdu,
|
||||
&UL_info->cqi_ind.cqi_pdu_list[i].ul_cqi_information);
|
||||
*/
|
||||
UL_info->cqi_ind.number_of_cqis=0;
|
||||
|
||||
UL_info->cqi_ind.number_of_cqis=0;*/
|
||||
|
||||
}
|
||||
|
||||
void handle_nr_harq(NR_UL_IND_t *UL_info) {
|
||||
if (nfapi_mode == 1 && UL_info->harq_ind.harq_indication_body.number_of_harqs>0) { // PNF
|
||||
/* if (nfapi_mode == 1 && UL_info->harq_ind.harq_indication_body.number_of_harqs>0) { // PNF
|
||||
//LOG_D(PHY, "UL_info->harq_ind.harq_indication_body.number_of_harqs:%d Send to VNF\n", UL_info->harq_ind.harq_indication_body.number_of_harqs);
|
||||
/* int retval = oai_nfapi_harq_indication(&UL_info->harq_ind);
|
||||
int retval = oai_nfapi_harq_indication(&UL_info->harq_ind);
|
||||
|
||||
if (retval!=0) {
|
||||
LOG_E(PHY, "Failed to encode NFAPI HARQ_IND retval:%d\n", retval);
|
||||
}
|
||||
*/
|
||||
|
||||
UL_info->harq_ind.harq_indication_body.number_of_harqs = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
|
||||
for (int i=0;i<UL_info->harq_ind.harq_indication_body.number_of_harqs;i++)
|
||||
harq_indication(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->harq_ind.sfn_sf),
|
||||
NFAPI_SFNSF2SF(UL_info->harq_ind.sfn_sf),
|
||||
&UL_info->harq_ind.harq_indication_body.harq_pdu_list[i]);
|
||||
*/
|
||||
|
||||
UL_info->harq_ind.harq_indication_body.number_of_harqs=0;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
void handle_nr_ulsch(NR_UL_IND_t *UL_info) {
|
||||
if(nfapi_mode == 1) {
|
||||
if (UL_info->crc_ind.crc_indication_body.number_of_crcs>0) {
|
||||
if (UL_info->crc_ind.number_crcs>0) {
|
||||
//LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf));
|
||||
// oai_nfapi_crc_indication(&UL_info->crc_ind);
|
||||
|
||||
UL_info->crc_ind.crc_indication_body.number_of_crcs = 0;
|
||||
UL_info->crc_ind.number_crcs = 0;
|
||||
}
|
||||
|
||||
if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0) {
|
||||
if (UL_info->rx_ind.number_of_pdus>0) {
|
||||
//LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf));
|
||||
// oai_nfapi_rx_ind(&UL_info->rx_ind);
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
UL_info->rx_ind.number_of_pdus = 0;
|
||||
}
|
||||
} else {
|
||||
|
||||
if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->crc_ind.crc_indication_body.number_of_crcs>0) {
|
||||
for (int i=0; i<UL_info->rx_ind.rx_indication_body.number_of_pdus; i++) {
|
||||
for (int j=0; j<UL_info->crc_ind.crc_indication_body.number_of_crcs; j++) {
|
||||
if (UL_info->rx_ind.number_of_pdus>0 && UL_info->crc_ind.number_crcs>0) {
|
||||
for (int i=0; i<UL_info->rx_ind.number_of_pdus; i++) {
|
||||
for (int j=0; j<UL_info->crc_ind.number_crcs; j++) {
|
||||
// find crc_indication j corresponding rx_indication i
|
||||
LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].rx_ue_information.rnti:%04x UL_info->rx_ind.rx_indication_body.rx_pdu_list[%d].rx_ue_information.rnti:%04x\n", j,
|
||||
UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti, i, UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti);
|
||||
UL_info->crc_ind.crc_list[j].rnti, i, UL_info->rx_ind.pdu_list[i].rnti);
|
||||
|
||||
if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti ==
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti) {
|
||||
LOG_D(PHY, "UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].crc_indication_rel8.crc_flag:%d\n", j, UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag);
|
||||
if (UL_info->crc_ind.crc_list[j].rnti ==
|
||||
UL_info->rx_ind.pdu_list[i].rnti) {
|
||||
LOG_D(PHY, "UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].crc_indication_rel8.crc_flag:%d\n", j, UL_info->crc_ind.crc_list[j].tb_crc_status);
|
||||
|
||||
if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag == 1) { // CRC error indication
|
||||
if (UL_info->crc_ind.crc_list[j].tb_crc_status == 1) { // CRC error indication
|
||||
LOG_D(MAC,"Frame %d, Slot %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->slot);
|
||||
|
||||
nr_rx_sdu(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
|
||||
NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->slot,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
|
||||
UL_info->rx_ind.sfn, //UL_info->frame,
|
||||
UL_info->rx_ind.slot, //UL_info->slot,
|
||||
UL_info->rx_ind.pdu_list[i].rnti,
|
||||
(uint8_t *)NULL,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
UL_info->rx_ind.pdu_list[i].pdu_length,
|
||||
UL_info->rx_ind.pdu_list[i].timing_advance,
|
||||
UL_info->rx_ind.pdu_list[i].ul_cqi);
|
||||
} else {
|
||||
LOG_D(MAC,"Frame %d, Slot %d Calling rx_sdu (CRC ok) \n",UL_info->frame,UL_info->slot);
|
||||
nr_rx_sdu(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
|
||||
NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->slot,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].data,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
UL_info->rx_ind.sfn, //UL_info->frame,
|
||||
UL_info->rx_ind.slot, //UL_info->slot,
|
||||
UL_info->rx_ind.pdu_list[i].rnti,
|
||||
UL_info->rx_ind.pdu_list[i].pdu,
|
||||
UL_info->rx_ind.pdu_list[i].pdu_length,
|
||||
UL_info->rx_ind.pdu_list[i].timing_advance,
|
||||
UL_info->rx_ind.pdu_list[i].ul_cqi);
|
||||
}
|
||||
//printf("rx_indication_rel8.timing_advance %d\n", UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance);
|
||||
break;
|
||||
} //if (UL_info->crc_ind.crc_pdu_list[j].rx_ue_information.rnti ==
|
||||
|
||||
// UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti)
|
||||
} // for (j=0;j<UL_info->crc_ind.crc_indication_body.number_of_crcs;j++)
|
||||
}
|
||||
} // for (j=0;j<UL_info->crc_ind.number_crcs;j++)
|
||||
} // for (i=0;i<UL_info->rx_ind.number_of_pdus;i++)
|
||||
|
||||
UL_info->crc_ind.crc_indication_body.number_of_crcs=0;
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
} // UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->slot && UL_info->crc_ind.crc_indication_body.number_of_crcs>0
|
||||
else if (UL_info->rx_ind.rx_indication_body.number_of_pdus!=0 || UL_info->crc_ind.crc_indication_body.number_of_crcs!=0) {
|
||||
LOG_E(PHY,"hoping not to have mis-match between CRC ind and RX ind - hopefully the missing message is coming shortly rx_ind:%d(SFN/SF:%05d) crc_ind:%d(SFN/SF:%05d) UL_info(SFN/SF):%04d%d\n",
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf),
|
||||
UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf),
|
||||
UL_info->frame, UL_info->slot);
|
||||
UL_info->crc_ind.number_crcs=0;
|
||||
UL_info->rx_ind.number_of_pdus = 0;
|
||||
}
|
||||
else if (UL_info->rx_ind.number_of_pdus!=0 || UL_info->crc_ind.number_crcs!=0) {
|
||||
LOG_E(PHY,"hoping not to have mis-match between CRC ind and RX ind - hopefully the missing message is coming shortly rx_ind:%d(SFN/SL:%d/%d) crc_ind:%d(SFN/SL:%d/%d) \n",
|
||||
UL_info->rx_ind.number_of_pdus, UL_info->rx_ind.sfn, UL_info->rx_ind.slot,
|
||||
UL_info->crc_ind.number_crcs, UL_info->rx_ind.sfn, UL_info->rx_ind.slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -230,11 +224,10 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
||||
NR_Sched_Rsp_t *sched_info = &Sched_INFO[module_id][CC_id];
|
||||
NR_IF_Module_t *ifi = if_inst[module_id];
|
||||
gNB_MAC_INST *mac = RC.nrmac[module_id];
|
||||
LOG_D(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rx_ind:%d harqs:%d crcs:%d cqis:%d preambles:%d sr_ind:%d]\n",
|
||||
LOG_D(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rx_ind:%d crcs:%d]\n",
|
||||
UL_info->frame,UL_info->slot,
|
||||
module_id,CC_id,
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus, UL_info->harq_ind.harq_indication_body.number_of_harqs, UL_info->crc_ind.crc_indication_body.number_of_crcs, UL_info->cqi_ind.number_of_cqis,
|
||||
UL_info->rach_ind.rach_indication_body.number_of_preambles, UL_info->sr_ind.sr_indication_body.number_of_srs);
|
||||
UL_info->rx_ind.number_of_pdus, UL_info->crc_ind.number_crcs);
|
||||
|
||||
if (nfapi_mode != 1) {
|
||||
if (ifi->CC_mask==0) {
|
||||
|
||||
@@ -61,29 +61,20 @@ typedef struct {
|
||||
/// slot
|
||||
slot_t slot;
|
||||
|
||||
/// harq indication list
|
||||
nfapi_harq_indication_t harq_ind;
|
||||
|
||||
/// crc indication list
|
||||
nfapi_crc_indication_t crc_ind;
|
||||
|
||||
/// SR indication list
|
||||
nfapi_sr_indication_t sr_ind;
|
||||
|
||||
/// CQI indication list
|
||||
nfapi_cqi_indication_body_t cqi_ind;
|
||||
nfapi_nr_crc_indication_t crc_ind;
|
||||
|
||||
/// RACH indication list
|
||||
nfapi_rach_indication_t rach_ind;
|
||||
|
||||
/// RACH indication list for BR UEs
|
||||
nfapi_rach_indication_t rach_ind_br;
|
||||
nfapi_nr_rach_indication_t rach_ind;
|
||||
|
||||
/// SRS indication list
|
||||
nfapi_srs_indication_body_t srs_ind;
|
||||
nfapi_nr_srs_indication_t srs_ind;
|
||||
|
||||
/// RX indication
|
||||
nfapi_rx_indication_t rx_ind;
|
||||
nfapi_nr_rx_data_indication_t rx_ind;
|
||||
|
||||
/// UCI indication
|
||||
nfapi_nr_uci_indication_t uci_ind;
|
||||
|
||||
} NR_UL_IND_t;
|
||||
|
||||
|
||||
@@ -708,195 +708,142 @@ int tx_req_UE_MAC(nfapi_tx_request_t *req) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req, module_id_t Mod_id) {
|
||||
int sfn = NFAPI_SFNSF2SFN(req->sfn_sf);
|
||||
int sf = NFAPI_SFNSF2SF(req->sfn_sf);
|
||||
void dl_config_req_UE_MAC_dci(int sfn,
|
||||
int sf,
|
||||
nfapi_dl_config_request_pdu_t *dci,
|
||||
nfapi_dl_config_request_pdu_t *dlsch,
|
||||
int num_ue) {
|
||||
DevAssert(dci->pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE);
|
||||
DevAssert(dlsch->pdu_type == NFAPI_DL_CONFIG_DLSCH_PDU_TYPE);
|
||||
|
||||
nfapi_dl_config_request_pdu_t* dl_config_pdu_list = req->dl_config_request_body.dl_config_pdu_list;
|
||||
const rnti_t rnti = dci->dci_dl_pdu.dci_dl_pdu_rel8.rnti;
|
||||
const int rnti_type = dci->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type;
|
||||
if (rnti != dlsch->dlsch_pdu.dlsch_pdu_rel8.rnti) {
|
||||
LOG_E(MAC,
|
||||
"%s(): sfn/sf %d.%d DLSCH PDU RNTI %x does not match DCI RNTI %x\n",
|
||||
__func__, sfn, sf, rnti, dlsch->dlsch_pdu.dlsch_pdu_rel8.rnti);
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < req->dl_config_request_body.number_pdu; i++) {
|
||||
if (dl_config_pdu_list[i].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE) {
|
||||
const rnti_t rnti = dl_config_pdu_list[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti;
|
||||
const int rnti_type = dl_config_pdu_list[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti_type;
|
||||
/* We assume the DCI DL PDU is followed by the DLSCH (the standard is
|
||||
* more free), so advance by one more and directly process the
|
||||
* following DLSCH PDU */
|
||||
i++;
|
||||
AssertFatal(i < req->dl_config_request_body.number_pdu,
|
||||
"Need PDU following DCI at index %d, but not found\n",
|
||||
i);
|
||||
nfapi_dl_config_request_pdu_t *dl_config_pdu_tmp = &dl_config_pdu_list[i];
|
||||
if (dl_config_pdu_tmp->pdu_type != NFAPI_DL_CONFIG_DLSCH_PDU_TYPE) {
|
||||
LOG_E(MAC, "expected DLSCH PDU at index %d\n", i);
|
||||
continue;
|
||||
}
|
||||
if (rnti != dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.rnti) {
|
||||
LOG_I(MAC,
|
||||
"%s(): sfn/sf %d DLSCH PDU RNTI %x does not match DCI RNTI %x\n",
|
||||
__func__,
|
||||
NFAPI_SFNSF2DEC(req->sfn_sf),
|
||||
rnti,
|
||||
dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.rnti);
|
||||
continue;
|
||||
}
|
||||
const int pdu_index = dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index;
|
||||
if (pdu_index < 0 && pdu_index >= tx_req_num_elems) {
|
||||
LOG_E(MAC,
|
||||
"dl_config_req_UE_MAC 2: Problem with receiving data: "
|
||||
"sfn/sf:%d PDU[%d] size:%d, TX_PDU index: %d\n",
|
||||
NFAPI_SFNSF2DEC(req->sfn_sf),
|
||||
i,
|
||||
dl_config_pdu_list[i].pdu_size,
|
||||
dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index);
|
||||
continue;
|
||||
}
|
||||
if (rnti_type == 1) {
|
||||
// C-RNTI (Normal DLSCH case)
|
||||
if (UE_mac_inst[Mod_id].crnti != rnti) {
|
||||
LOG_D(MAC,
|
||||
"sfn/sf %d/%d DCI not for UE %d/RNTI %x but for RNTI %x, "
|
||||
"skipping\n",
|
||||
sfn, sf, Mod_id, UE_mac_inst[Mod_id].crnti, rnti);
|
||||
continue;
|
||||
}
|
||||
const int pdu_index = dlsch->dlsch_pdu.dlsch_pdu_rel8.pdu_index;
|
||||
if (pdu_index < 0 || pdu_index >= tx_req_num_elems) {
|
||||
LOG_E(MAC,
|
||||
"%s(): Problem with receiving data: "
|
||||
"sfn/sf:%d.%d PDU size:%d, TX_PDU index: %d\n",
|
||||
__func__,
|
||||
sfn, sf, dci->pdu_size, dlsch->dlsch_pdu.dlsch_pdu_rel8.pdu_index);
|
||||
return;
|
||||
}
|
||||
|
||||
if (rnti_type == 1) { // C-RNTI (Normal DLSCH case)
|
||||
for (int ue_id = 0; ue_id < num_ue; ue_id++) {
|
||||
if (UE_mac_inst[ue_id].crnti == rnti) {
|
||||
LOG_D(MAC,
|
||||
"%s() Received data: sfn/sf:%d PDU[%d] "
|
||||
"%s() Received data: sfn/sf:%d.%d "
|
||||
"size:%d, TX_PDU index: %d, tx_req_num_elems: %d \n",
|
||||
__func__,
|
||||
NFAPI_SFNSF2DEC(req->sfn_sf),
|
||||
i,
|
||||
dl_config_pdu_list[i].pdu_size,
|
||||
dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index,
|
||||
sfn, sf, dci->pdu_size,
|
||||
dlsch->dlsch_pdu.dlsch_pdu_rel8.pdu_index,
|
||||
tx_req_num_elems);
|
||||
ue_send_sdu(Mod_id, 0, sfn, sf,
|
||||
ue_send_sdu(ue_id, 0, sfn, sf,
|
||||
tx_request_pdu_list[pdu_index].segments[0].segment_data,
|
||||
tx_request_pdu_list[pdu_index].segments[0].segment_length,
|
||||
0);
|
||||
} else if (rnti_type == 2) {
|
||||
if (rnti == 0xFFFF) { /* SI-RNTI */
|
||||
if (UE_mac_inst[Mod_id].UE_mode[0] == NOT_SYNCHED) {
|
||||
/* this check is in the code before refactoring, but I don't know
|
||||
* why. Leave it in here for the moment */
|
||||
continue;
|
||||
}
|
||||
|
||||
ue_decode_si(Mod_id, 0, sfn, 0,
|
||||
tx_request_pdu_list[pdu_index].segments[0].segment_data,
|
||||
tx_request_pdu_list[pdu_index].segments[0].segment_length);
|
||||
} else if (rnti == 0xFFFE) { /* PI-RNTI */
|
||||
LOG_I(MAC, "%s() Received paging message: sfn/sf:%d PDU[%d]\n",
|
||||
__func__, NFAPI_SFNSF2DEC(req->sfn_sf), i);
|
||||
ue_decode_p(Mod_id, 0, sfn, 0,
|
||||
tx_request_pdu_list[pdu_index].segments[0].segment_data,
|
||||
tx_request_pdu_list[pdu_index].segments[0].segment_length);
|
||||
} else if (rnti == 0x0002) { /* RA-RNTI */
|
||||
LOG_E(MAC, "%s(): Received RAR?\n", __func__);
|
||||
// RNTI parameter not actually used. Provided only to comply with
|
||||
// existing function definition. Not sure about parameters to fill
|
||||
// the preamble index.
|
||||
const rnti_t ra_rnti = UE_mac_inst[Mod_id].RA_prach_resources.ra_RNTI;
|
||||
DevAssert(ra_rnti == 0x0002);
|
||||
if (UE_mac_inst[Mod_id].UE_mode[0] != PUSCH
|
||||
&& UE_mac_inst[Mod_id].RA_prach_resources.Msg3 != NULL
|
||||
&& ra_rnti == dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.rnti) {
|
||||
LOG_E(MAC,
|
||||
"dl_config_req_UE_MAC 5 Received RAR, PreambleIndex: %d \n",
|
||||
UE_mac_inst[Mod_id].RA_prach_resources.ra_PreambleIndex);
|
||||
ue_process_rar(Mod_id, 0, sfn,
|
||||
ra_rnti, //RA-RNTI
|
||||
tx_request_pdu_list[pdu_index].segments[0].segment_data,
|
||||
&dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.rnti, //t-crnti
|
||||
UE_mac_inst[Mod_id].RA_prach_resources.ra_PreambleIndex,
|
||||
tx_request_pdu_list[pdu_index].segments[0].segment_data);
|
||||
UE_mac_inst[Mod_id].UE_mode[0] = RA_RESPONSE;
|
||||
// Expecting an UL_CONFIG_ULSCH_PDU to enable Msg3 Txon (first
|
||||
// ULSCH Txon for the UE)
|
||||
UE_mac_inst[Mod_id].first_ULSCH_Tx = 1;
|
||||
}
|
||||
} else {
|
||||
LOG_W(MAC, "can not handle special RNTI %x\n", rnti);
|
||||
}
|
||||
}
|
||||
} else if (dl_config_pdu_list[i].pdu_type == NFAPI_DL_CONFIG_BCH_PDU_TYPE) {
|
||||
// BCH case: Last parameter is 1 if first time synchronization and zero
|
||||
// otherwise. Not sure which value to put for our case.
|
||||
if (UE_mac_inst[Mod_id].UE_mode[0] == NOT_SYNCHED){
|
||||
dl_phy_sync_success(Mod_id, sfn, 0, 1);
|
||||
LOG_E(MAC,
|
||||
"%s(): Received MIB: UE_mode: %d, sfn/sf: %d.%d\n",
|
||||
__func__,
|
||||
UE_mac_inst[Mod_id].UE_mode[0],
|
||||
sfn,
|
||||
sf);
|
||||
UE_mac_inst[Mod_id].UE_mode[0] = PRACH;
|
||||
} else {
|
||||
dl_phy_sync_success(Mod_id, sfn, 0, 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if (rnti_type == 2) {
|
||||
if (rnti == 0xFFFF) { /* SI-RNTI */
|
||||
for (int ue_id = 0; ue_id < num_ue; ue_id++) {
|
||||
if (UE_mac_inst[ue_id].UE_mode[0] == NOT_SYNCHED)
|
||||
continue;
|
||||
|
||||
ue_decode_si(ue_id, 0, sfn, 0,
|
||||
tx_request_pdu_list[pdu_index].segments[0].segment_data,
|
||||
tx_request_pdu_list[pdu_index].segments[0].segment_length);
|
||||
}
|
||||
} else if (rnti == 0xFFFE) { /* PI-RNTI */
|
||||
for (int ue_id = 0; ue_id < num_ue; ue_id++) {
|
||||
LOG_I(MAC, "%s() Received paging message: sfn/sf:%d.%d\n",
|
||||
__func__, sfn, sf);
|
||||
ue_decode_p(ue_id, 0, sfn, 0,
|
||||
tx_request_pdu_list[pdu_index].segments[0].segment_data,
|
||||
tx_request_pdu_list[pdu_index].segments[0].segment_length);
|
||||
}
|
||||
} else if (rnti == 0x0002) { /* RA-RNTI */
|
||||
for (int ue_id = 0; ue_id < num_ue; ue_id++) {
|
||||
if (UE_mac_inst[ue_id].UE_mode[0] != RA_RESPONSE) {
|
||||
LOG_D(MAC, "UE %d not awaiting RAR, is in mode %d\n",
|
||||
ue_id, UE_mac_inst[ue_id].UE_mode[0]);
|
||||
continue;
|
||||
}
|
||||
// RNTI parameter not actually used. Provided only to comply with
|
||||
// existing function definition. Not sure about parameters to fill
|
||||
// the preamble index.
|
||||
const rnti_t ra_rnti = UE_mac_inst[ue_id].RA_prach_resources.ra_RNTI;
|
||||
DevAssert(ra_rnti == 0x0002);
|
||||
if (UE_mac_inst[ue_id].UE_mode[0] != PUSCH
|
||||
&& UE_mac_inst[ue_id].RA_prach_resources.Msg3 != NULL
|
||||
&& ra_rnti == dlsch->dlsch_pdu.dlsch_pdu_rel8.rnti) {
|
||||
LOG_E(MAC,
|
||||
"%s(): Received RAR, PreambleIndex: %d\n",
|
||||
__func__, UE_mac_inst[ue_id].RA_prach_resources.ra_PreambleIndex);
|
||||
ue_process_rar(ue_id, 0, sfn,
|
||||
ra_rnti, //RA-RNTI
|
||||
tx_request_pdu_list[pdu_index].segments[0].segment_data,
|
||||
&UE_mac_inst[ue_id].crnti, //t-crnti
|
||||
UE_mac_inst[ue_id].RA_prach_resources.ra_PreambleIndex,
|
||||
tx_request_pdu_list[pdu_index].segments[0].segment_data);
|
||||
UE_mac_inst[ue_id].UE_mode[0] = RA_RESPONSE;
|
||||
// Expecting an UL_CONFIG_ULSCH_PDU to enable Msg3 Txon (first
|
||||
// ULSCH Txon for the UE)
|
||||
UE_mac_inst[ue_id].first_ULSCH_Tx = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
LOG_W(MAC, "can not handle special RNTI %x\n", rnti);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int hi_dci0_req_UE_MAC(nfapi_hi_dci0_request_t *req, module_id_t Mod_id) {
|
||||
if (req != NULL && req->hi_dci0_request_body.hi_dci0_pdu_list != NULL) {
|
||||
LOG_D(PHY,
|
||||
"[UE-PHY_STUB] hi dci0 request sfn_sf:%d number_of_dci:%d "
|
||||
"number_of_hi:%d\n",
|
||||
NFAPI_SFNSF2DEC(req->sfn_sf),
|
||||
req->hi_dci0_request_body.number_of_dci,
|
||||
req->hi_dci0_request_body.number_of_hi);
|
||||
void dl_config_req_UE_MAC_bch(int sfn,
|
||||
int sf,
|
||||
nfapi_dl_config_request_pdu_t *bch,
|
||||
int num_ue) {
|
||||
DevAssert(bch->pdu_type == NFAPI_DL_CONFIG_BCH_PDU_TYPE);
|
||||
|
||||
for (int i = 0; i < req->hi_dci0_request_body.number_of_dci
|
||||
+ req->hi_dci0_request_body.number_of_hi;
|
||||
i++) {
|
||||
LOG_D(PHY,
|
||||
"[UE-PHY_STUB] HI_DCI0_REQ sfn_sf:%d PDU[%d]\n",
|
||||
NFAPI_SFNSF2DEC(req->sfn_sf),
|
||||
i);
|
||||
|
||||
if (req->hi_dci0_request_body.hi_dci0_pdu_list[i].pdu_type
|
||||
== NFAPI_HI_DCI0_DCI_PDU_TYPE) {
|
||||
LOG_D(PHY,
|
||||
"[UE-PHY_STUB] HI_DCI0_REQ sfn_sf:%d PDU[%d] - "
|
||||
"NFAPI_HI_DCI0_DCI_PDU_TYPE\n",
|
||||
NFAPI_SFNSF2DEC(req->sfn_sf),
|
||||
i);
|
||||
const nfapi_hi_dci0_dci_pdu_rel8_t *dci =
|
||||
&req->hi_dci0_request_body.hi_dci0_pdu_list[i].dci_pdu.dci_pdu_rel8;
|
||||
if (dci->rnti != UE_mac_inst[Mod_id].crnti)
|
||||
continue;
|
||||
const int sfn = NFAPI_SFNSF2SFN(req->sfn_sf);
|
||||
const int sf = NFAPI_SFNSF2SF(req->sfn_sf);
|
||||
if (dci->cqi_csi_request)
|
||||
fill_ulsch_cqi_indication_UE_MAC(Mod_id, sfn, sf, UL_INFO, dci->rnti);
|
||||
} else if (req->hi_dci0_request_body.hi_dci0_pdu_list[i].pdu_type
|
||||
== NFAPI_HI_DCI0_HI_PDU_TYPE) {
|
||||
nfapi_hi_dci0_request_pdu_t *hi_dci0_req_pdu =
|
||||
&req->hi_dci0_request_body.hi_dci0_pdu_list[i];
|
||||
|
||||
// This is meaningful only after ACKnowledging the first ULSCH Txon
|
||||
// (i.e. Msg3)
|
||||
if (hi_dci0_req_pdu->hi_pdu.hi_pdu_rel8.hi_value == 1
|
||||
&& UE_mac_inst[Mod_id].first_ULSCH_Tx == 1) {
|
||||
// LOG_I(MAC,"[UE-PHY_STUB] HI_DCI0_REQ 2 sfn_sf:%d PDU[%d] -
|
||||
// NFAPI_HI_DCI0_HI_PDU_TYPE\n", NFAPI_SFNSF2DEC(req->sfn_sf), i);
|
||||
// UE_mac_inst[Mod_id].UE_mode[0] = PUSCH;
|
||||
// UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
|
||||
}
|
||||
|
||||
} else {
|
||||
LOG_E(PHY,
|
||||
"[UE-PHY_STUB] HI_DCI0_REQ sfn_sf:%d PDU[%d] - unknown pdu "
|
||||
"type:%d\n",
|
||||
NFAPI_SFNSF2DEC(req->sfn_sf),
|
||||
i,
|
||||
req->hi_dci0_request_body.hi_dci0_pdu_list[i].pdu_type);
|
||||
}
|
||||
for (int ue_id = 0; ue_id < num_ue; ue_id++) {
|
||||
if (UE_mac_inst[ue_id].UE_mode[0] == NOT_SYNCHED){
|
||||
dl_phy_sync_success(ue_id, sfn, 0, 1);
|
||||
LOG_E(MAC,
|
||||
"%s(): Received MIB: UE_mode: %d, sfn/sf: %d.%d\n",
|
||||
__func__,
|
||||
UE_mac_inst[ue_id].UE_mode[0],
|
||||
sfn,
|
||||
sf);
|
||||
UE_mac_inst[ue_id].UE_mode[0] = PRACH;
|
||||
} else {
|
||||
dl_phy_sync_success(ue_id, sfn, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
void hi_dci0_req_UE_MAC(int sfn,
|
||||
int sf,
|
||||
nfapi_hi_dci0_request_pdu_t* hi_dci0,
|
||||
int num_ue) {
|
||||
if (hi_dci0->pdu_type != NFAPI_HI_DCI0_DCI_PDU_TYPE)
|
||||
return;
|
||||
|
||||
const nfapi_hi_dci0_dci_pdu_rel8_t *dci = &hi_dci0->dci_pdu.dci_pdu_rel8;
|
||||
if (!dci->cqi_csi_request)
|
||||
return;
|
||||
for (int ue_id = 0; ue_id < num_ue; ue_id++) {
|
||||
if (dci->rnti == UE_mac_inst[ue_id].crnti) {
|
||||
fill_ulsch_cqi_indication_UE_MAC(ue_id, sfn, sf, UL_INFO, dci->rnti);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The following set of memcpy functions should be getting called as callback
|
||||
|
||||
@@ -93,13 +93,23 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
|
||||
nfapi_ul_config_request_pdu_t *ul_config_pdu,
|
||||
uint16_t frame,uint8_t subframe,uint8_t srs_present, int index);
|
||||
|
||||
//int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req, nfapi_tx_request_pdu_t* tx_request_pdu_list);
|
||||
int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req, module_id_t Mod_id);
|
||||
void dl_config_req_UE_MAC_dci(int sfn,
|
||||
int sf,
|
||||
nfapi_dl_config_request_pdu_t *dci,
|
||||
nfapi_dl_config_request_pdu_t *dlsch,
|
||||
int num_ue);
|
||||
void dl_config_req_UE_MAC_bch(int sfn,
|
||||
int sf,
|
||||
nfapi_dl_config_request_pdu_t *bch,
|
||||
int num_ue);
|
||||
|
||||
int tx_req_UE_MAC(nfapi_tx_request_t* req);
|
||||
|
||||
|
||||
int hi_dci0_req_UE_MAC(nfapi_hi_dci0_request_t* req, module_id_t Mod_id);
|
||||
void hi_dci0_req_UE_MAC(int sfn,
|
||||
int sf,
|
||||
nfapi_hi_dci0_request_pdu_t* bch,
|
||||
int num_ue);
|
||||
|
||||
// The following set of memcpy functions should be getting called as callback functions from
|
||||
// pnf_p7_subframe_ind.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user