Commit 430a8c4e authored by Cedric Roux's avatar Cedric Roux

Merge branch 'develop_integration_w19' into 'develop'

develop_integration_w19 into develop

Summary of changes:
- bug fixes:
  * RLC AM fixes
  * UE TDD fixes
  * Fujitsu bug fixes (TDD also)
  * mobipass fixes (bad management of carriers, softmodem was failing with more than one CC)
  * compilation warnings removal
- PUCCH format 3 preliminary support (work from Fujitsu)
- build fixes: do not include shared library in main executable (work from Nokia)
  express MIMO2 needs some more work here

See merge request !184
parents c124e32a 099b7f2a
......@@ -499,18 +499,18 @@ set(HWLIB_EXMIMO_SOURCE
add_library(oai_exmimodevif MODULE ${HWLIB_EXMIMO_SOURCE} )
include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/")
set (option_HWUSRPLIB_lib "-l uhd")
set(HWLIB_USRP_SOURCE
${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
)
add_library(oai_usrpdevif MODULE ${HWLIB_USRP_SOURCE} )
target_link_libraries(oai_usrpdevif uhd)
include_directories("${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/")
set (option_HWBLADERFLIB_lib "-l bladerf")
set(HWLIB_BLADERF_SOURCE
${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c
)
add_library(oai_bladerfdevif MODULE ${HWLIB_BLADERF_SOURCE} )
target_link_libraries(oai_bladerfdevif bladeRF)
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/")
......@@ -518,6 +518,8 @@ set(HWLIB_LMSSDR_SOURCE
${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
)
add_library(oai_lmssdrdevif MODULE ${HWLIB_LMSSDR_SOURCE} )
target_include_directories(oai_lmssdrdevif PRIVATE /usr/local/include/lime)
target_link_libraries(oai_lmssdrdevif LimeSuite )
include_directories("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/")
set(TPLIB_ETHERNET_SOURCE
......@@ -528,70 +530,6 @@ set(TPLIB_ETHERNET_SOURCE
add_library(oai_eth_transpro MODULE ${TPLIB_ETHERNET_SOURCE} )
# RF devices / transport protocols settings
######################################################################
if (${RF_BOARD} STREQUAL "EXMIMO")
set(DRIVER2013)
include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/")
include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/DEFS/")
set(HW_SOURCE ${HW_SOURCE}
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c)
# ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c)
set(option_HW_lib "-rdynamic -ldl")
elseif (${RF_BOARD} STREQUAL "OAI_USRP")
include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/")
include_directories("/opt/include/uhd")
set(HW_SOURCE ${HW_SOURCE}
${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp)
LINK_DIRECTORIES("/opt/lib")
set(option_HW_lib "-luhd -rdynamic -ldl -lboost_system")
elseif (${RF_BOARD} STREQUAL "OAI_BLADERF")
include_directories("${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/")
include_directories("${OPENAIR2_DIR}/UTIL/LOG")
include_directories("/usr/include")
set(HW_SOURCE ${HW_SOURCE}
${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c
)
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
set(option_HW_lib "bladeRF -rdynamic -ldl")
elseif (${RF_BOARD} STREQUAL "OAI_LMSSDR")
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB")
include_directories("/usr/local/include/lime")
include_directories("/usr/include/lime")
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
LINK_DIRECTORIES("/usr/local/lib")
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lmsSDR")
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lms7002m")
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/Si5351C")
set(HW_SOURCE ${HW_SOURCE} ${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp)
set(option_HW_lib "-lLimeSuite -rdynamic -ldl")
elseif (${RF_BOARD} STREQUAL "CPRIGW")
set(HW_SOURCE ${HW_SOURCE}
${OPENAIR_TARGETS}/ARCH/CPRIGW/USERSPACE/LIB/cprigw_lib.c
)
include_directories("${OPENAIR_TARGETS}/ARCH/CPRIGW/USERSPACE/LIB/")
set(option_HW_lib "-rdynamic dl")
endif (${RF_BOARD} STREQUAL "EXMIMO")
if (${TRANSP_PRO} STREQUAL "ETHERNET")
include_directories ("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB")
set(TRANSPORT_SOURCE ${TRANSPORT_SOURCE}
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
)
set(option_TP_lib "-rdynamic -ldl")
endif (${TRANSP_PRO} STREQUAL "ETHERNET")
##########################################################
include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON")
......@@ -1773,8 +1711,6 @@ add_executable(lte-softmodem
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
${GTPU_need_ITTI}
${HW_SOURCE}
${TRANSPORT_SOURCE}
${RTAI_SOURCE}
${XFORMS_SOURCE}
${XFORMS_SOURCE_SOFTMODEM}
......@@ -1787,7 +1723,7 @@ target_link_libraries (lte-softmodem -ldl
-Wl,--end-group )
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-softmodem ${T_LIB})
......@@ -1809,8 +1745,6 @@ add_executable(lte-softmodem-nos1
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR_DIR}/common/utils/system.c
${HW_SOURCE}
${TRANSPORT_SOURCE}
${RTAI_SOURCE}
${XFORMS_SOURCE}
${XFORMS_SOURCE_SOFTMODEM}
......@@ -1822,7 +1756,7 @@ target_link_libraries (lte-softmodem-nos1
-Wl,--end-group )
target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 ${T_LIB})
......@@ -1835,24 +1769,17 @@ add_executable(rrh_gw
${OPENAIR_TARGETS}/RT/USER/UE_transport_IQ.c
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${HW_SOURCE}
${TRANSPORT_SOURCE}
${T_SOURCE}
)
target_include_directories(rrh_gw PRIVATE ${OPENAIR_DIR}/common/utils/itti)
target_link_libraries(rrh_gw
-Wl,--start-group
UTIL LFDS
UTIL LFDS -ldl
-Wl,--end-group )
target_link_libraries (rrh_gw rt pthread m )
target_link_libraries (rrh_gw ${option_HW_lib} ${option_TP_lib})
target_link_libraries (rrh_gw ${LIB_LMS_LIBRARIES})
target_link_libraries (rrh_gw ${T_LIB})
Message("-- option_HW_lib=${option_HW_lib}")
Message("-- HW_SOURCE=${HW_SOURCE}")
Message("-- option_TP_lib=${option_TP_lib}")
Message("-- TRANSPORT_SOURCE=${TRANSPORT_SOURCE}")
# USIM process
#################
......@@ -1907,8 +1834,6 @@ add_executable(oaisim
${OPENAIR_DIR}/common/utils/system.c
${GTPU_need_ITTI}
${OPENAIR_TARGETS}/COMMON/create_tasks.c
${HW_SOURCE}
${TRANSPORT_SOURCE}
${XFORMS_SOURCE}
${T_SOURCE}
)
......@@ -1921,7 +1846,7 @@ target_link_libraries (oaisim
-Wl,--end-group )
target_link_libraries (oaisim ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${option_TP_lib}
target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp
${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES})
#Force link with forms, regardless XFORMS option
target_link_libraries (oaisim forms)
......@@ -1952,8 +1877,6 @@ add_executable(oaisim_nos1
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR_TARGETS}/COMMON/create_tasks.c
${OPENAIR_DIR}/common/utils/system.c
${HW_SOURCE}
${TRANSPORT_SOURCE}
${XFORMS_SOURCE}
${T_SOURCE}
)
......@@ -1964,7 +1887,7 @@ target_link_libraries (oaisim_nos1
-Wl,--end-group )
target_link_libraries (oaisim_nos1 ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
target_link_libraries (oaisim_nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${option_TP_lib}
target_link_libraries (oaisim_nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES}
${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
#Force link with forms, regardless XFORMS option
target_link_libraries (oaisim_nos1 forms)
......
......@@ -243,7 +243,7 @@ check_install_bladerf_driver(){
$SUDO add-apt-repository -y ppa:bladerf/bladerf
$SUDO apt-get update
fi
$SUDO apt-get install -y--allow-unauthenticated bladerf libbladerf-dev
$SUDO apt-get install -y --allow-unauthenticated bladerf libbladerf-dev
$SUDO apt-get install -y --allow-unauthenticated bladerf-firmware-fx3
$SUDO apt-get install -y --allow-unauthenticated bladerf-fpga-hostedx40
}
......@@ -252,6 +252,21 @@ flash_firmware_bladerf() {
$SUDO bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img
}
check_install_lmssdr_driver(){
if ( [ -d "/usr/local/include/lime" ] &&
[ -f "/usr/local/include/lime/LimeSuite.h" ] )
then
echo_success "Found lmssdr drivers and tools installed from source"
else
echo_error "lmssdr support implies installing lmssdr drivers and tools" \
" from sources. check:"
echo_info "https://open-cells.com/index.php/2017/05/10/limesdr-installation/"
echo_fatal "Cannot compile lmssdr device"
fi
}
check_install_additional_tools (){
$SUDO apt-get update
$SUDO apt-get install -y \
......
......@@ -77,7 +77,7 @@ typedef struct items_group_s {
} items_group_t;
/*------------------------------------------------------------------------------*/
static const items_group_position_t ITEMS_GROUP_POSITION_INVALID = -1;
//static const items_group_position_t ITEMS_GROUP_POSITION_INVALID = -1;
static const items_group_index_t ITEMS_GROUP_INDEX_INVALID = -1;
/*------------------------------------------------------------------------------*/
......
......@@ -8013,13 +8013,20 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
ulsch->bundling = 1-AckNackFBMode;
if (frame_parms->frame_type == FDD) {
int dl_subframe = (subframe<4) ? (subframe+6) : (subframe-4);
//int dl_subframe = (subframe<4) ? (subframe+6) : (subframe-4);
int dl_subframe = subframe;
if (ue->dlsch[dl_subframe&0x1][eNB_id][0]->harq_ack[dl_subframe].send_harq_status>0) { // we have downlink transmission
ulsch->harq_processes[harq_pid]->O_ACK = 1;
} else {
ulsch->harq_processes[harq_pid]->O_ACK = 0;
}
/*LOG_I(PHY,"DCI 0 Processing: dl_subframe %d send_harq_status Odd %d send_harq_status Even %d harq_pid %d O_ACK %d\n", dl_subframe,
ue->dlsch[0][eNB_id][0]->harq_ack[dl_subframe].send_harq_status,
ue->dlsch[1][eNB_id][0]->harq_ack[dl_subframe].send_harq_status,
harq_pid,
ulsch->harq_processes[harq_pid]->O_ACK);*/
} else {
if (ulsch->bundling)
ulsch->harq_processes[harq_pid]->O_ACK = (dai == 3)? 0 : 1;
......@@ -8031,10 +8038,16 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
dlsch[0]->harq_ack[subframe].vDAI_UL = dai+1;
LOG_D(PHY, "[PUSCH %d] Format0 DCI %s, CQI_req=%d, cshift=%d, TPC=%d, DAI=%d, vDAI_UL[sf#%d]=%d, NDI=%d, MCS=%d, RBalloc=%d, first_rb=%d, harq_pid=%d, nb_rb=%d, subframe_scheduling_flag=%d\n",
/*LOG_I(PHY, "[PUSCH %d] Format0 DCI %s, CQI_req=%d, cshift=%d, TPC=%d, DAI=%d, vDAI_UL[sf#%d]=%d, NDI=%d, MCS=%d, RBalloc=%d, first_rb=%d, harq_pid=%d, nb_rb=%d, subframe_scheduling_flag=%d"
" ulsch->bundling %d, O_ACK %d \n",
harq_pid,
(frame_parms->frame_type == TDD? "TDD" : "FDD"),
cqi_req, cshift, TPC, dai, subframe, dlsch[0]->harq_ack[subframe].vDAI_UL, ndi, mcs, rballoc, ulsch->harq_processes[harq_pid]->first_rb, harq_pid, ulsch->harq_processes[harq_pid]->nb_rb, ulsch->harq_processes[harq_pid]->subframe_scheduling_flag);
cqi_req, cshift, TPC, dai, subframe, dlsch[0]->harq_ack[subframe].vDAI_UL, ndi, mcs, rballoc,
ulsch->harq_processes[harq_pid]->first_rb, harq_pid, ulsch->harq_processes[harq_pid]->nb_rb,
ulsch->harq_processes[harq_pid]->subframe_scheduling_flag,
ulsch->bundling,
ulsch->harq_processes[harq_pid]->O_ACK);*/
ulsch->beta_offset_cqi_times8 = beta_cqi[ue->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index];//18;
ulsch->beta_offset_ri_times8 = beta_ri[ue->pusch_config_dedicated[eNB_id].betaOffset_RI_Index];//10;
......
......@@ -777,7 +777,8 @@ typedef enum {
pucch_format1b,
pucch_format2,
pucch_format2a,
pucch_format2b
pucch_format2b,
pucch_format3 // PUCCH format3
} PUCCH_FMT_t;
......
......@@ -461,11 +461,11 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
//#ifndef __AVX2__
#if 1
if (err_flag == 0) {
LOG_D(PHY, "turbo algo Kr=%d cb_cnt=%d C=%d nbRB=%d TBSInput=%d TBSHarq=%d TBSplus24=%d mcs=%d Qm=%d RIV=%d round=%d maxIter %d\n",
Kr,r,harq_process->C,harq_process->nb_rb,A,harq_process->TBS,
/*
LOG_I(PHY, "turbo algo Kr=%d cb_cnt=%d C=%d nbRB=%d crc_type %d TBSInput=%d TBSHarq=%d TBSplus24=%d mcs=%d Qm=%d RIV=%d round=%d maxIter %d\n",
Kr,r,harq_process->C,harq_process->nb_rb,crc_type,A,harq_process->TBS,
harq_process->B,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round,dlsch->max_turbo_iterations);
*/
if (llr8_flag) {
AssertFatal (Kr >= 256, "turbo algo issue Kr=%d cb_cnt=%d C=%d nbRB=%d TBSInput=%d TBSHarq=%d TBSplus24=%d mcs=%d Qm=%d RIV=%d round=%d\n",
Kr,r,harq_process->C,harq_process->nb_rb,A,harq_process->TBS,harq_process->B,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round);
......@@ -641,8 +641,8 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
frame_rx_prev = frame_rx_prev%1024;
if (err_flag == 1) {
LOG_D(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, round %d, subframe %d)\n",
phy_vars_ue->Mod_id, frame_rx_prev, subframe_rx_prev, harq_pid, harq_process->round, subframe);
//LOG_I(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n",
// phy_vars_ue->Mod_id, frame, subframe, harq_pid,harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs,Kr,r,harq_process->round);
dlsch->harq_ack[subframe].ack = 0;
dlsch->harq_ack[subframe].harq_id = harq_pid;
......@@ -665,13 +665,16 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
return((1+dlsch->max_turbo_iterations));
} else {
//LOG_I(PHY,"[UE %d] DLSCH: Setting ACK for subframe %d TBS %d harq_process->mcs %d harq_process->nb_rb %d\n",
//phy_vars_ue->Mod_id,subframe,harq_process->TBS,harq_process->mcs,harq_process->nb_rb);
harq_process->status = SCH_IDLE;
harq_process->round = 0;
dlsch->harq_ack[subframe].ack = 1;
dlsch->harq_ack[subframe].harq_id = harq_pid;
dlsch->harq_ack[subframe].send_harq_status = 1;
LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for SFN/SF %d/%d (pid %d, pid status %d, round %d, subframe %d)\n",
phy_vars_ue->Mod_id, frame_rx_prev, subframe_rx_prev, harq_pid, harq_process->status, harq_process->round, subframe);
//LOG_I(PHY,"[UE %d] DLSCH: Setting ACK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d)\n",
// phy_vars_ue->Mod_id, frame, subframe, harq_pid, harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs);
if(is_crnti)
{
......
......@@ -31,6 +31,7 @@
*/
//#include "PHY/defs.h"
#include "PHY/extern.h"
#include "SCHED/defs.h"
#include "defs.h"
#include "extern.h"
#include "PHY/sse_intrin.h"
......@@ -256,12 +257,12 @@ int rx_pdsch(PHY_VARS_UE *ue,
ue->high_speed_flag,
frame_parms,
dlsch0_harq->mimo_mode);
//#ifdef DEBUG_DLSCH_MOD
/* printf("dlsch: using pmi %lx, rb_alloc %x, pmi_ext ",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),*rballoc);
#ifdef DEBUG_DLSCH_MOD
printf("dlsch: using pmi %lx, rb_alloc %x, pmi_ext ",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),*rballoc);
for (rb=0;rb<nb_rb;rb++)
printf("%d",pdsch_vars[eNB_id]->pmi_ext[rb]);
printf("\n");*/
//#endif
printf("\n");
#endif
if (rx_type >= rx_IC_single_stream) {
if (eNB_id_i<ue->n_connected_eNB) // we are in TM5
......@@ -353,7 +354,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
#ifdef DEBUG_PHY
LOG_D(PHY,"[DLSCH] log2_maxh = %d (%d,%d)\n",pdsch_vars[eNB_id]->log2_maxh,avg[0],avgs);
LOG_D(PHY,"[DLSCH] nb_rb %d log2_maxh = %d (%d,%d)\n",nb_rb,pdsch_vars[eNB_id]->log2_maxh,avg[0],avgs);
LOG_D(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode);
#endif
......@@ -465,11 +466,12 @@ int rx_pdsch(PHY_VARS_UE *ue,
symbol,
nb_rb);
#ifdef DEBUG_PHY
LOG_I(PHY,"[DLSCH] log2_maxh = %d [log2_maxh0 %d log2_maxh1 %d] (%d,%d)\n",pdsch_vars[eNB_id]->log2_maxh,
LOG_I(PHY,"[DLSCH] AbsSubframe %d.%d log2_maxh = %d [log2_maxh0 %d log2_maxh1 %d] (%d,%d)\n",
frame%1024,subframe, pdsch_vars[eNB_id]->log2_maxh,
pdsch_vars[eNB_id]->log2_maxh0,
pdsch_vars[eNB_id]->log2_maxh1,
avg[0],avgs);
LOG_I(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode);
LOG_D(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode);
#endif
}
......@@ -744,6 +746,8 @@ int rx_pdsch(PHY_VARS_UE *ue,
//i_mod should have been passed as a parameter
}
//printf("LLR dlsch0_harq->Qm %d rx_type %d cw0 %d cw1 %d symbol %d \n",dlsch0_harq->Qm,rx_type,codeword_TB0,codeword_TB1,symbol);
switch (dlsch0_harq->Qm) {
case 2 :
if ((rx_type==rx_standard) || (codeword_TB0 == -1) || (codeword_TB1 == -1)) {
......@@ -909,6 +913,8 @@ int rx_pdsch(PHY_VARS_UE *ue,
}
break;
case 6 :
//printf("LLR rx_type %d cw0 %d cw1 %d symbol %d first symbol %d nb_rb %d rballoceven %d sfn %d beamforming_mode %d\n",
// rx_type,codeword_TB0,codeword_TB1,symbol,first_symbol_flag,nb_rb,dlsch0_harq->rb_alloc_even,subframe,beamforming_mode);
if ((rx_type==rx_standard) || (codeword_TB0 == -1) || (codeword_TB1 == -1)) {
dlsch_64qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
......@@ -1045,15 +1051,15 @@ int rx_pdsch(PHY_VARS_UE *ue,
// Please keep it: useful for debugging
#if 0
if( (symbol == 13) && (dlsch0_harq->mimo_mode == 2) )
if( (symbol == 13) && (subframe==0) && (dlsch0_harq->Qm == 6) /*&& (nb_rb==25)*/)
{
LOG_E(PHY,"Dump Phy Chan Est \n");
if(subframe&0x1)
if(1)
{
#if 1
//write_output("rxdataF0.m" , "rxdataF0", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1);
write_output("rxdataF0.m" , "rxdataF0", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1);
//write_output("rxdataF1.m" , "rxdataF1", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1);
//write_output("dl_ch_estimates00.m", "dl_ch_estimates00", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0],14*frame_parms->ofdm_symbol_size,1,1);
write_output("dl_ch_estimates00.m", "dl_ch_estimates00", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0],14*frame_parms->ofdm_symbol_size,1,1);
//write_output("dl_ch_estimates01.m", "dl_ch_estimates01", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0],14*frame_parms->ofdm_symbol_size,1,1);
//write_output("dl_ch_estimates10.m", "dl_ch_estimates10", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0],14*frame_parms->ofdm_symbol_size,1,1);
//write_output("dl_ch_estimates11.m", "dl_ch_estimates11", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0],14*frame_parms->ofdm_symbol_size,1,1);
......@@ -1064,16 +1070,16 @@ int rx_pdsch(PHY_VARS_UE *ue,
//write_output("rxdataF_ext10.m" , "rxdataF_ext10", &pdsch_vars[eNB_id]->rxdataF_ext[2][0],14*frame_parms->N_RB_DL*12,1,1);
//write_output("rxdataF_ext11.m" , "rxdataF_ext11", &pdsch_vars[eNB_id]->rxdataF_ext[3][0],14*frame_parms->N_RB_DL*12,1,1);
write_output("dl_ch_estimates_ext00.m", "dl_ch_estimates_ext00", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[0][0],14*frame_parms->N_RB_DL*12,1,1);
write_output("dl_ch_estimates_ext01.m", "dl_ch_estimates_ext01", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[1][0],14*frame_parms->N_RB_DL*12,1,1);
write_output("dl_ch_estimates_ext10.m", "dl_ch_estimates_ext10", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[2][0],14*frame_parms->N_RB_DL*12,1,1);
write_output("dl_ch_estimates_ext11.m", "dl_ch_estimates_ext11", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[3][0],14*frame_parms->N_RB_DL*12,1,1);
//write_output("dl_ch_estimates_ext01.m", "dl_ch_estimates_ext01", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[1][0],14*frame_parms->N_RB_DL*12,1,1);
//write_output("dl_ch_estimates_ext10.m", "dl_ch_estimates_ext10", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[2][0],14*frame_parms->N_RB_DL*12,1,1);
//write_output("dl_ch_estimates_ext11.m", "dl_ch_estimates_ext11", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[3][0],14*frame_parms->N_RB_DL*12,1,1);
write_output("rxdataF_comp00.m","rxdataF_comp00", &pdsch_vars[eNB_id]->rxdataF_comp0[0][0],14*frame_parms->N_RB_DL*12,1,1);
write_output("rxdataF_comp01.m","rxdataF_comp01", &pdsch_vars[eNB_id]->rxdataF_comp0[1][0],14*frame_parms->N_RB_DL*12,1,1);
write_output("rxdataF_comp10.m","rxdataF_comp10", &pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][0][0],14*frame_parms->N_RB_DL*12,1,1);
write_output("rxdataF_comp11.m","rxdataF_comp11", &pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][1][0],14*frame_parms->N_RB_DL*12,1,1);
//write_output("rxdataF_comp01.m","rxdataF_comp01", &pdsch_vars[eNB_id]->rxdataF_comp0[1][0],14*frame_parms->N_RB_DL*12,1,1);
//write_output("rxdataF_comp10.m","rxdataF_comp10", &pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][0][0],14*frame_parms->N_RB_DL*12,1,1);
//write_output("rxdataF_comp11.m","rxdataF_comp11", &pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][1][0],14*frame_parms->N_RB_DL*12,1,1);
#endif
write_output("llr0.m","llr0", &pdsch_vars[eNB_id]->llr[0][0],(14*nb_rb*12*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm),1,0);
write_output("llr1.m","llr1", &pdsch_vars[eNB_id]->llr[1][0],(14*nb_rb*12*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm),1,0);
//write_output("llr1.m","llr1", &pdsch_vars[eNB_id]->llr[1][0],(14*nb_rb*12*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm),1,0);
AssertFatal(0," ");
......@@ -3323,7 +3329,7 @@ void dlsch_scale_channel(int **dl_ch_estimates_ext,
ch_amp = ((pilots) ? (dlsch_ue[0]->sqrt_rho_b) : (dlsch_ue[0]->sqrt_rho_a));
LOG_D(PHY,"Scaling PDSCH Chest in OFDM symbol %d by %d\n",symbol_mod,ch_amp);
LOG_D(PHY,"Scaling PDSCH Chest in OFDM symbol %d by %d, pilots %d nb_rb %d NCP %d symbol %d\n",symbol_mod,ch_amp,pilots,nb_rb,frame_parms->Ncp,symbol);
// printf("Scaling PDSCH Chest in OFDM symbol %d by %d\n",symbol_mod,ch_amp);
ch_amp128 = _mm_set1_epi16(ch_amp); // Q3.13
......
......@@ -583,7 +583,7 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->frame_parms;
int first_layer0; //= dlsch0_harq->first_layer;
int first_layer0 = -1; //= dlsch0_harq->first_layer;
int Nlayers0 = -1; // = dlsch0_harq->Nlayers;
uint8_t mod_order0=0; // = get_Qm(dlsch0_harq->mcs);
uint8_t mod_order1=0; //=2;
......
......@@ -1333,7 +1333,8 @@ int pss_sss_extract(PHY_VARS_UE *phy_vars_ue,
@returns 0 on success
*/
int pss_only_extract(PHY_VARS_UE *phy_vars_ue,
int32_t pss_ext[4][72]);
int32_t pss_ext[4][72],
uint8_t subframe);
/*! \brief Extract only SSS resource elements
@param phy_vars_ue Pointer to UE variables
......@@ -1341,7 +1342,8 @@ int pss_only_extract(PHY_VARS_UE *phy_vars_ue,
@returns 0 on success
*/
int sss_only_extract(PHY_VARS_UE *phy_vars_ue,
int32_t sss_ext[4][72]);
int32_t sss_ext[4][72],
uint8_t subframe);
/*! \brief Performs detection of SSS to find cell ID and other framing parameters (FDD/TDD, normal/extended prefix)
@param phy_vars_ue Pointer to UE variables
......@@ -1998,6 +2000,17 @@ void generate_pucch2x(int32_t **txdataF,
uint8_t subframe,
uint16_t rnti);
void generate_pucch3x(int32_t **txdataF,
LTE_DL_FRAME_PARMS *frame_parms,
uint8_t ncs_cell[20][7],
PUCCH_FMT_t fmt,
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
uint16_t n3_pucch,
uint8_t shortened_format,
uint8_t *payload,
int16_t amp,
uint8_t subframe,
uint16_t rnti);
void generate_pucch_emul(PHY_VARS_UE *phy_vars_ue,
UE_rxtx_proc_t *proc,
......
This diff is collapsed.
......@@ -238,7 +238,7 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *ue,
ulsch->harq_processes[harq_pid]->TPC = (rar[3]>>3)&7;//rar->TPC;
ulsch->harq_processes[harq_pid]->TPC = (rar[3]>>2)&7;//rar->TPC;
rballoc = (((uint16_t)(rar[1]&7))<<7)|(rar[2]>>1);
cqireq=rar[3]&1;
......
......@@ -166,6 +166,7 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue,
int32_t **rxdataF;
//LOG_I(PHY,"do_pss_sss_extract subframe %d \n",subframe);
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
if (frame_parms->frame_type == FDD) {
......@@ -180,11 +181,26 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue,
pss_symb = 2;
sss_symb = frame_parms->symbols_per_tti-1;
if(subframe==5 || subframe==0)
{
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF;
sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))];
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[((subframe+1)&0x1)].rxdataF;
pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))];
}
else if(subframe==6 || subframe==1)
{
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF;
pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))];
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF;
sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))];
}
else
{
AssertFatal(0,"");
}
}
//printf("extract_rbs: symbol_mod=%d, rx_offset=%d, ch_offset=%d\n",symbol_mod,
......@@ -204,11 +220,26 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue,
}
else
{
if(subframe==5 || subframe==0)
{
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF;
sss_rxF = &rxdataF[aarx][(1 + (sss_symb*(frame_parms->ofdm_symbol_size)))];
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[((subframe+1)&0x1)].rxdataF;
pss_rxF = &rxdataF[aarx][(1 + (pss_symb*(frame_parms->ofdm_symbol_size)))];
}
else if(subframe==6 || subframe==1)
{
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF;
pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))];
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF;
sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))];
}
else
{
AssertFatal(0,"");
}
}
}
......@@ -237,18 +268,20 @@ int pss_sss_extract(PHY_VARS_UE *phy_vars_ue,
}
int pss_only_extract(PHY_VARS_UE *phy_vars_ue,
int32_t pss_ext[4][72])
int32_t pss_ext[4][72],
uint8_t subframe)
{
static int32_t dummy[4][72];
return _do_pss_sss_extract(phy_vars_ue, pss_ext, dummy, 1 /* doPss */, 0 /* doSss */, 0);
return _do_pss_sss_extract(phy_vars_ue, pss_ext, dummy, 1 /* doPss */, 0 /* doSss */, subframe);
}
int sss_only_extract(PHY_VARS_UE *phy_vars_ue,
int32_t sss_ext[4][72])
int32_t sss_ext[4][72],
uint8_t subframe)
{
static int32_t dummy[4][72];
return _do_pss_sss_extract(phy_vars_ue, dummy, sss_ext, 0 /* doPss */, 1 /* doSss */, 0);
return _do_pss_sss_extract(phy_vars_ue, dummy, sss_ext, 0 /* doPss */, 1 /* doSss */, subframe);
}
......
......@@ -2067,7 +2067,8 @@ uint32_t ulsch_decoding_emul(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc,
if ((UE_index >= oai_emulation.info.first_ue_local) ||(UE_index <(oai_emulation.info.first_ue_local+oai_emulation.info.nb_ue_local))) {
get_ack(&eNB->frame_parms,
PHY_vars_UE_g[UE_id][CC_id]->dlsch[0][0][0]->harq_ack,
subframe,
proc->subframe_tx,
proc->subframe_rx,
eNB->ulsch[UE_index]->harq_processes[harq_pid]->o_ACK,0);
} else { // get remote UEs' ack
eNB->ulsch[UE_index]->harq_processes[harq_pid]->o_ACK[0] = PHY_vars_UE_g[UE_id][CC_id]->ulsch[0]->o_ACK[0];
......
......@@ -212,6 +212,7 @@ void prach_procedures(PHY_VARS_eNB *eNB);
lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
/*! \brief Function to compute which type of DCIs to detect in the given subframe
@param frame_parms Pointer to DL frame parameter descriptor
@param subframe Subframe index
......@@ -305,7 +306,7 @@ uint8_t pdcch_alloc2ul_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n);
@param o_ACK Pointer to ACK/NAK payload for PUCCH/PUSCH
@returns status indicator for PUCCH/PUSCH transmission
*/
uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,harq_status_t *harq_ack,uint8_t subframe,uint8_t *o_ACK, uint8_t cw_idx);
uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,harq_status_t *harq_ack,uint8_t subframe_tx,uint8_t subframe_rx,uint8_t *o_ACK, uint8_t cw_idx);
/*! \brief Reset ACK/NACK information
@param frame_parms Pointer to DL frame parameter descriptor
......@@ -316,8 +317,10 @@ uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,harq_status_t *harq_ack,uint8_t
*/
uint8_t reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
harq_status_t *harq_ack,
unsigned char subframe,
unsigned char subframe_tx,
unsigned char subframe_rx,
unsigned char *o_ACK,
uint8_t *pN_bundled,
uint8_t cw_idx);
/*! \brief Compute UL ACK subframe from DL subframe. This is used to retrieve corresponding DLSCH HARQ pid at eNB upon reception of ACK/NAK information on PUCCH/PUSCH. Derived from Table 10.1-1 in 36.213 (p. 69 in version 8.6)
......
......@@ -323,8 +323,10 @@ unsigned char ul_ACK_subframe2_M(LTE_DL_FRAME_PARMS *frame_parms,unsigned char s
// return the number 'Nbundled'
uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
harq_status_t *harq_ack,
unsigned char subframe,
unsigned char subframe_tx,
unsigned char subframe_rx,
unsigned char *o_ACK,
uint8_t *pN_bundled,
uint8_t cw_idx,
uint8_t do_reset) // 1 to reset ACK/NACK status : 0 otherwise
{
......@@ -333,60 +335,61 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
// printf("get_ack: SF %d\n",subframe);
if (frame_parms->frame_type == FDD) {
if (subframe < 4)
subframe_dl0 = subframe + 6;
if (subframe_tx < 4)
subframe_dl0 = subframe_tx + 6;
else
subframe_dl0 = subframe - 4;
subframe_dl0 = subframe_tx - 4;
o_ACK[cw_idx] = harq_ack[subframe_dl0].ack;
status = harq_ack[subframe_dl0].send_harq_status;
//LOG_I(PHY,"dl subframe %d send_harq_status %d cw_idx %d, reset %d\n",subframe_dl0, status, cw_idx, do_reset);
if(do_reset)
harq_ack[subframe_dl0].send_harq_status = 0;
//printf("get_ack: Getting ACK/NAK for PDSCH (subframe %d) => %d\n",subframe_dl,o_ACK[0]);
} else {
switch (frame_parms->tdd_config) {
case 1:
if (subframe == 2) { // ACK subframes 5,6
if (subframe_tx == 2) { // ACK subframes 5,6
subframe_ul = 6;
subframe_dl0 = 5;
subframe_dl1 = 6;
} else if (subframe == 3) { // ACK subframe 9
} else if (subframe_tx == 3) { // ACK subframe 9
subframe_ul = 9;
subframe_dl0 = 9;
subframe_dl1 = 0xff;
} else if (subframe == 4) { // nothing
} else if (subframe_tx == 4) { // nothing
subframe_ul = 0xff;
subframe_dl0 = 0xff; // invalid subframe number indicates ACK/NACK is not needed
subframe_dl1 = 0xff;
} else if (subframe == 7) { // ACK subframes 0,1
} else if (subframe_tx == 7) { // ACK subframes 0,1
subframe_ul = 1;
subframe_dl0 = 0;
subframe_dl1 = 1;
} else if (subframe == 8) { // ACK subframes 4
} else if (subframe_tx == 8) { // ACK subframes 4
subframe_ul = 4;
subframe_dl0 = 4;
subframe_dl1 = 0xff;
} else {
LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe %d for tdd_config %d\n",
subframe,frame_parms->tdd_config);
LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe_tx %d for tdd_config %d\n",
subframe_tx,frame_parms->