Commit 0cc5a12e authored by Thomas Schlichter's avatar Thomas Schlichter

Merge branch 'develop'

parents 42413bc5 c918f1d8
develop 1 128-ues 256_QAM_demod NCTU_OpinConnect_LDPC NR-PHY-MAC-IF-multi-UE NR_10MHz NR_CSI_reporting NR_DCI_01 NR_DL_sched_fixes NR_DL_scheduler NR_FAPI_beamindex_SSB_RO NR_FR2_RA NR_FR2_RRC_SSB NR_MAC_CE_GlobalEdge NR_MAC_Multi_Rach_GlobalEdge NR_MAC_SSB_RO_GlobalEdge NR_MAC_SSB_RO_UE_IDCC NR_MAC_SSB_RO_merge NR_MAC_TCI_UCI_GlobalEdge NR_NGAP NR_PUCCH_MultiUE NR_RA_updates NR_RRCConfiguration_FR2 NR_RRC_PDCP NR_RRC_X2AP_AMBR_Change_Global_edge NR_RRC_X2AP_RemoveHardcodings_GlobalEdge NR_RRC_config_simplified NR_SA_NGAP_RRC NR_SA_NGAP_RRC_wk42 NR_SA_itti_sim_wk48 NR_SRB_Config NR_UE_MAC_scheduler NR_UE_RA_fixes NR_UE_UL_DCI_improvements NR_UE_enable_parallelization NR_UE_stability_fixes NR_UL_scheduler NR_UL_scheduler_rebased NR_UL_scheduling NR_ipaccess_testing NR_mac_uci_functions_rework NR_msg2_phytest NR_scheduling_CSIRS NR_scheduling_request NR_ue_dlsch_dmrs_cdm PUSCH_TA_update RA_CI_test UE_DL_DCI_hotfix bch-fixes-bitmap benetel_5g_prach_fix benetel_phase_rotation benetel_phase_rotation_old bugfix-minor-remove-wrong-log bugfix-nr-bands bugfix-nr-ldpc-post-processing bugfix-nr-ldpc-size-typo bugfix-nr-pdcp-sn-size bugfix-nr-rate-matching-assertion cce_indexing_fix cce_indexing_fix2 ci-deploy-docker-compose ci-rd-july-improvements ci-ul-iperf-from-trf-container clean-5G-scope-round2 cleanup_softmodem_main constant_power develop-oriecpriupdates develop-sib1 develop_inria_ci_deployment dfts_alternatives dlsch-all-dlslots dlsch_encode_mthread dlsch_parallel dongzhanyi-zte-develop dongzhanyi-zte-develop2 fapi_for_dmrs_and_ptrs feature/make-s1-mme-port-configurable feature/make-s1-mme-port-configurable-with-astyle-fixes fembms-enb-ue finalize-oaicn-integration firas fix-ci-tun fix-itti-segv fix-softmodem-restart fix_do_ra_data fix_pdsch_low_prb fix_rfsim_mimo fix_rrc_x2_ticking fixes-mac-sched-nfapi fixes-mac-sched-tun fixes-tun flexran-apps flexran-repair-mme-mgmt fujitsu_lte_contribution fujitsu_lte_contribution-128 harq-hotfix hotfix-minor-remove-nr-rlc-cppcheck-error hotfix-nr-rlc-tick hotfix-ocp-executable improve_nr_modulation improve_ue_stability integration_2020_wk40 integration_2020_wk41 integration_2020_wk42_2 integration_2020_wk45 integration_2020_wk45_2 integration_2020_wk46 integration_2020_wk46_2 integration_2020_wk47 integration_2020_wk48 integration_2020_wk48_2 integration_2020_wk49 integration_2020_wk50 integration_2020_wk50_1 inter-RRU-final inter-RRU-oairu inter-rru-UE ldpc-decoder-codegen ldpc-decoder-codegen2 ldpc-offload ldpc_short_codeword_fixes load_gnb lte_uplink_improvement mac-fixes-wk45_2 mosaic5g-oai-ran mosaic5g-oai-sim nfapi-bugfix nfapi_nr_develop ngap-dlul ngap-support ngap-w48-merge2 ngap-wf ngap-wf-1120 ngap-wf-1120-srb ngap-wf-1120-srb-gtp ngap-wf-1120-srb-gtp-hs ngap-wf-1120-srb-gtp-hs1 ngap-wf-1120-srb-gtp-hs2 ngap-wf-1203-yunsdr ngap-wf-liuyu ngap_lfq_1120 ngap_merge noCore nr-mac-pdu-wireshark nr-mac-remove-ue-list nr-rlc-am-bugfix-w44 nr-rlc-bugfix-w44 nrUE nrUE-hs nrUE-upper-layer nr_bsr nr_dl_dmrs_type2 nr_dl_pf nr_dl_pf2 nr_dl_ul_ptrs nr_fdd_if_fix nr_polar_decoder_improvement nr_prach_fr2 nr_ue_msg3 nr_ue_tti_cleanup nrue_msg2_reception nsa-ue nsa_remove_band_hardcodings oai-sim oairu oc-docker-october-improvements openxg/develop polar8 ptrs_rrc_config pusch-mthread-scaling-fix ra-dl-ul remove_nos1_hack_pdcp remove_x2_gnb_hardcoding repair-TA revert_memcpy rh_ci_fix_autoterminate rh_ci_fr1_update rh_ci_oc rh_ci_py rh_ci_rfsim_ra rh_doc_update_3 rh_fr1_newjenkins rh_fr1_update rh_gnb_compile_fix rh_wk50_debug rlc-v2-bugfix-status-reporting rlc-v2-tick rrc-enb-phy-testmode s1_subnormal s1ap-bugfix-rab_setup small-bugfixes-w40 smallcleanup testing_with_external_txdata tp-ota-test trx_thread_param ue-csi ue-fixes-ota ul_dl_dci_same_slot ul_harq ulsch_decode_mthread ulsim_changes x2-endc-processing yihongzheng_srb zzs
No related merge requests found
This diff is collapsed.
......@@ -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
......@@ -1585,6 +1588,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,9 +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>
......@@ -1248,11 +1247,11 @@
<pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
<pre_exec_args></pre_exec_args>
<main_exec> $OPENAIR_DIR/targets/bin/nr_ulsim.Rel15</main_exec>
<main_exec_args>-n100 -m9 -r106 -s0
<main_exec_args>-n100 -m9 -r106 -s5
-n100 -m16 -s10
-n100 -m28 -s20
-n100 -m9 -R217 -r217 -s0
-n100 -m9 -R273 -r273 -s0</main_exec_args>
-n100 -m9 -R217 -r217 -s5
-n100 -m9 -R273 -r273 -s5</main_exec_args>
<tags>nr_ulsim.test1 nr_ulsim.test2 nr_ulsim.test3 nr_ulsim.test4 nr_ulsim.test5</tags>
<search_expr_true>PUSCH test OK</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
......
......@@ -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,12 +961,12 @@ 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;
gNB->UL_INFO.cqi_ind.cqi_raw_pdu_list = gNB->cqi_raw_pdu_list;*/
gNB->prach_energy_counter = 0;
}
......
......@@ -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"
......
......@@ -1393,7 +1393,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,7 +96,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
while(gNB->configured == 0) usleep(10000);
init_dfts();
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,
......@@ -112,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();
load_nrLDPClib();
// PBCH DMRS gold sequences generation
nr_init_pbch_dmrs(gNB);
......
......@@ -986,7 +986,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*) &lte_eNB_srs->srs_ch_estimates[aa][0],
dft(DFT_128,(int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
1);
break;
case 25:
dft512((int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0],
dft(DFT_512,(int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
1);
break;
case 50:
dft1024((int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0],
dft(DFT_1024,(int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
1);
break;
case 100:
dft2048((int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0],
dft(DFT_2048,(int16_t*) &lte_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
......
......@@ -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");
......
......@@ -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:
......@@ -1074,7 +1074,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,
......@@ -1082,17 +1082,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,
......@@ -1121,6 +1123,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,
......@@ -1133,6 +1136,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);
......@@ -1141,7 +1145,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,
......@@ -1150,6 +1154,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);
}
}
......
This diff is collapsed.
......@@ -349,11 +349,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
Kr_bytes = Kr>>3;
#endif
///////////
/////////////////////////////////////////////////////////////////////////////////////
opp_enabled=0;
///////////////////////// c---->| LDCP coding |---->d /////////////////////////
///////////
......@@ -379,6 +374,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]);
......@@ -395,10 +396,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 */
......
/*
* 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
......
This diff is collapsed.
......@@ -598,6 +598,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
......@@ -624,19 +630,17 @@ typedef struct PHY_VARS_gNB_s {
pthread_mutex_t UL_INFO_mutex;
/// NFAPI RX ULSCH information
nfapi_rx_indication_pdu_t rx_pdu_list[NFAPI_RX_IND_MAX_PDU];
nfapi_nr_rx_data_pdu_t rx_pdu_list[MAX_UL_PDUS_PER_SLOT];
/// NFAPI RX ULSCH CRC information
nfapi_crc_indication_pdu_t crc_pdu_list[NFAPI_CRC_IND_MAX_PDU];
/// NFAPI HARQ information
nfapi_harq_indication_pdu_t harq_pdu_list[NFAPI_HARQ_IND_MAX_PDU];
/// NFAPI SR information
nfapi_sr_indication_pdu_t sr_pdu_list[NFAPI_SR_IND_MAX_PDU];
/// NFAPI CQI information
nfapi_cqi_indication_pdu_t cqi_pdu_list[NFAPI_CQI_IND_MAX_PDU];
/// NFAPI CQI information (raw component)
nfapi_cqi_indication_raw_pdu_t cqi_raw_pdu_list[NFAPI_CQI_IND_MAX_PDU];
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_preamble_pdu_t preamble_list[MAX_NUM_RX_PRACH_PREAMBLES];
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;
......@@ -713,9 +717,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;
......@@ -731,18 +733,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 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_ldpc_decoding_stats;
time_stats_t ulsch_deinterleaving_stats;
time_stats_t ulsch_demultiplexing_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_freq_offset_estimation_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->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
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;
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);
}
This diff is collapsed.
......@@ -412,6 +412,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;
}
......@@ -901,7 +902,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;
......@@ -528,6 +535,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;
......@@ -671,15 +690,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 >=
......@@ -733,6 +754,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;
}
}
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -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;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment