Commit 316f6aba authored by Cedric Roux's avatar Cedric Roux

Merge branch 'develop_integration_w13' into 'develop'

Develop integration w13

Summary of changes:
- RLC AM reworking (a lot has changed)
- several bug fixes
  * support processing multiple MAC RAR control elements in a single MSG2
  * fix ACK/NACK resetting
  * do not correct USRP frequency from carrier offset estimation when --ue-carrier-scan == off
  * fix TDD uplink due to incorrect PUCCH format for SR in TDD
  * several other simple fixes
- better support for LMS SDR

See merge request !168
parents a77082c1 c36c0453
...@@ -33,6 +33,13 @@ ORIGIN_PATH=$PWD ...@@ -33,6 +33,13 @@ ORIGIN_PATH=$PWD
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0)) THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source $THIS_SCRIPT_PATH/tools/build_helper source $THIS_SCRIPT_PATH/tools/build_helper
# set environment variables (OPENAIR_HOME, ...)
set_openair_env
#variables for UE data generation
gen_nvram_path=$OPENAIR_DIR/targets/bin
conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
MSC_GEN="False" MSC_GEN="False"
XFORMS="True" XFORMS="True"
FLEXRAN_AGENT_SB_IF="True" FLEXRAN_AGENT_SB_IF="True"
...@@ -55,11 +62,10 @@ T_TRACER="False" ...@@ -55,11 +62,10 @@ T_TRACER="False"
DISABLE_HARDWARE_DEPENDENCY="False" DISABLE_HARDWARE_DEPENDENCY="False"
CMAKE_BUILD_TYPE="" CMAKE_BUILD_TYPE=""
UE_AUTOTEST_TRACE="False" UE_AUTOTEST_TRACE="False"
BUILD_ECLIPSE=0
CMAKE_CMD='cmake'
trap handle_ctrl_c INT trap handle_ctrl_c INT
gen_nvram_path=$OPENAIR_DIR/targets/bin
conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
function print_help() { function print_help() {
echo_info " echo_info "
This program installs OpenAirInterface Software This program installs OpenAirInterface Software
...@@ -141,6 +147,8 @@ Options ...@@ -141,6 +147,8 @@ Options
Disable HW dependency during installation Disable HW dependency during installation
--ue-autotest-trace --ue-autotest-trace
Enable specific traces for UE autotest framework Enable specific traces for UE autotest framework
--build-eclipse
Build eclipse project files. Paths are auto corrected by fixprj.sh
Usage (first build): Usage (first build):
oaisim (eNB + UE): ./build_oai -I --oaisim -x --install-system-files oaisim (eNB + UE): ./build_oai -I --oaisim -x --install-system-files
Eurecom EXMIMO + COTS UE : ./build_oai -I --eNB -x --install-system-files Eurecom EXMIMO + COTS UE : ./build_oai -I --eNB -x --install-system-files
...@@ -179,6 +187,7 @@ function main() { ...@@ -179,6 +187,7 @@ function main() {
GDB=1 GDB=1
CMAKE_BUILD_TYPE="Debug" CMAKE_BUILD_TYPE="Debug"
echo_info "Will Compile with gdb symbols and disable compiler optimization" echo_info "Will Compile with gdb symbols and disable compiler optimization"
CMAKE_CMD="$CMAKE_CMD -DCMAKE_BUILD_TYPE=Debug"
shift;; shift;;
--eNB) --eNB)
eNB=1 eNB=1
...@@ -311,6 +320,11 @@ function main() { ...@@ -311,6 +320,11 @@ function main() {
UHD_IMAGES_DIR=$2 UHD_IMAGES_DIR=$2
echo_info "Downloading UHD images in the indicated location" echo_info "Downloading UHD images in the indicated location"
shift 2;; shift 2;;
--build-eclipse)
BUILD_ECLIPSE=1
CMAKE_CMD="$CMAKE_CMD"' -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE -G"Eclipse CDT4 - Unix Makefiles"'
echo_info "Enabling build eclipse project support"
shift 1;;
-h | --help) -h | --help)
print_help print_help
exit 1;; exit 1;;
...@@ -321,6 +335,9 @@ function main() { ...@@ -321,6 +335,9 @@ function main() {
esac esac
done done
CMAKE_CMD="$CMAKE_CMD .."
echo_info "CMAKE_CMD=$CMAKE_CMD"
######################################################### #########################################################
# check validity of HW and TP parameters for RRH and eNB # check validity of HW and TP parameters for RRH and eNB
######################################################### #########################################################
...@@ -391,7 +408,6 @@ function main() { ...@@ -391,7 +408,6 @@ function main() {
echo_info "2. Setting the OAI PATHS ..." echo_info "2. Setting the OAI PATHS ..."
set_openair_env
cecho "OPENAIR_DIR = $OPENAIR_DIR" $green cecho "OPENAIR_DIR = $OPENAIR_DIR" $green
# for conf files copy in this bash script # for conf files copy in this bash script
...@@ -495,7 +511,7 @@ function main() { ...@@ -495,7 +511,7 @@ function main() {
fi fi
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$lte_build_dir/build cd $DIR/$lte_build_dir/build
cmake .. eval $CMAKE_CMD
fi fi
if [ "$eNB" = "1" -o "$UE" = "1" ] ; then if [ "$eNB" = "1" -o "$UE" = "1" ] ; then
...@@ -524,7 +540,7 @@ function main() { ...@@ -524,7 +540,7 @@ function main() {
# mkdir -p $DIR/at_commands/build # mkdir -p $DIR/at_commands/build
# cd $DIR/at_commands/build # cd $DIR/at_commands/build
# cmake .. # eval $CMAKE_CMD
# compilations \ # compilations \
# at_commands at_nas_ue \ # at_commands at_nas_ue \
# at_nas_ue $dbin/at_nas_ue # at_nas_ue $dbin/at_nas_ue
...@@ -533,7 +549,7 @@ function main() { ...@@ -533,7 +549,7 @@ function main() {
mkdir -p $DIR/nas_sim_tools/build mkdir -p $DIR/nas_sim_tools/build
cd $DIR/nas_sim_tools/build cd $DIR/nas_sim_tools/build
cmake .. eval $CMAKE_CMD
compilations \ compilations \
nas_sim_tools usim \ nas_sim_tools usim \
usim $dbin/usim usim $dbin/usim
...@@ -562,7 +578,7 @@ function main() { ...@@ -562,7 +578,7 @@ function main() {
mkdir -p build mkdir -p build
cd build cd build
rm -f *sim rm -f *sim
cmake .. eval $CMAKE_CMD
fi fi
if [ "$SIMUS_PHY" = "1" ] ; then if [ "$SIMUS_PHY" = "1" ] ; then
...@@ -640,7 +656,7 @@ function main() { ...@@ -640,7 +656,7 @@ function main() {
[ "$CLEAN" = "1" ] && rm -rf $DIR/$oaisim_build_dir/build [ "$CLEAN" = "1" ] && rm -rf $DIR/$oaisim_build_dir/build
mkdir -p $DIR/$oaisim_build_dir/build mkdir -p $DIR/$oaisim_build_dir/build
cd $DIR/$oaisim_build_dir/build cd $DIR/$oaisim_build_dir/build
cmake .. eval $CMAKE_CMD
compilations \ compilations \
$oaisim_build_dir $oaisim_exec \ $oaisim_build_dir $oaisim_exec \
$oaisim_exec $dbin/$oaisim_exec.$REL $oaisim_exec $dbin/$oaisim_exec.$REL
...@@ -651,7 +667,7 @@ function main() { ...@@ -651,7 +667,7 @@ function main() {
echo_info "Compiling at_nas_ue" echo_info "Compiling at_nas_ue"
mkdir -p $DIR/at_commands/build mkdir -p $DIR/at_commands/build
cd $DIR/at_commands/build cd $DIR/at_commands/build
cmake .. eval $CMAKE_CMD
compilations \ compilations \
at_commands at_nas_ue \ at_commands at_nas_ue \
at_nas_ue $dbin/at_nas_ue at_nas_ue $dbin/at_nas_ue
...@@ -665,7 +681,7 @@ function main() { ...@@ -665,7 +681,7 @@ function main() {
[ "$CLEAN" = "1" ] && rm -rf $DIR/nas_sim_tools/build [ "$CLEAN" = "1" ] && rm -rf $DIR/nas_sim_tools/build
mkdir -p $DIR/nas_sim_tools/build mkdir -p $DIR/nas_sim_tools/build
cd $DIR/nas_sim_tools/build cd $DIR/nas_sim_tools/build
cmake .. eval $CMAKE_CMD
compilations \ compilations \
nas_sim_tools usim \ nas_sim_tools usim \
usim $dbin/usim usim $dbin/usim
...@@ -722,7 +738,7 @@ function main() { ...@@ -722,7 +738,7 @@ function main() {
#[ "$CLEAN" = "1" ] && rm -rf $DIR/oaisim_mme_build_oai/build #[ "$CLEAN" = "1" ] && rm -rf $DIR/oaisim_mme_build_oai/build
#mkdir -p $DIR/oaisim_mme_build_oai/build #mkdir -p $DIR/oaisim_mme_build_oai/build
#cd $DIR/oaisim_mme_build_oai/build #cd $DIR/oaisim_mme_build_oai/build
#cmake .. #eval $CMAKE_CMD
#compilations \ #compilations \
# oaisim_mme_build_oai oaisim_mme \ # oaisim_mme_build_oai oaisim_mme \
# oaisim_mme $dbin/oaisim_mme.$REL # oaisim_mme $dbin/oaisim_mme.$REL
...@@ -752,7 +768,7 @@ function main() { ...@@ -752,7 +768,7 @@ function main() {
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$rrh_build_dir/build cd $DIR/$rrh_build_dir/build
cmake .. eval $CMAKE_CMD
compilations \ compilations \
rrh_gw rrh_gw \ rrh_gw rrh_gw \
rrh_gw $dbin/rrh_gw rrh_gw $dbin/rrh_gw
...@@ -761,9 +777,9 @@ function main() { ...@@ -761,9 +777,9 @@ function main() {
# build RF device and transport protocol libraries # build RF device and transport protocol libraries
##################################### #####################################
if [ "$eNB" = "1" -o "$RRH" = "1" ] ; then if [ "$eNB" = "1" -o "$UE" = "1" -o "$RRH" = "1" ] ; then
if [ "$eNB" = "1" ] ; then if [ "$eNB" = "1" -o "$UE" = "1" ] ; then
build_dir=$lte_build_dir build_dir=$lte_build_dir
else else
build_dir=$rrh_build_dir build_dir=$rrh_build_dir
...@@ -847,7 +863,7 @@ fi ...@@ -847,7 +863,7 @@ fi
[ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/doxygen/build [ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/doxygen/build
mkdir -p $OPENAIR_DIR/cmake_targets/doxygen/build mkdir -p $OPENAIR_DIR/cmake_targets/doxygen/build
cd $OPENAIR_DIR/cmake_targets/doxygen/build cd $OPENAIR_DIR/cmake_targets/doxygen/build
cmake .. eval $CMAKE_CMD
make doc make doc
) >& $doxygen_log ) >& $doxygen_log
fi fi
......
#!/bin/bash
#sudo ./build_oai -c -C -I --install-optional-packages --install-system-files --UE -w USRP -V
#sudo ./build_oai -c -C -I --install-optional-packages --UE -w USRP -V
#sudo ./build_oai -c -C --UE -w USRP -V
sudo ./build_oai -c -C --UE -w USRP
#sudo ./build_oai -c -C --UE -w USRP --build-eclipse
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
# #
####################################### #######################################
LTEIF=oip0 LTEIF=oip1
#OPENAIR_DIR=/home/oai/svn-oai/openair4G #OPENAIR_DIR=/home/oai/svn-oai/openair4G
load_module() { load_module() {
...@@ -48,11 +48,11 @@ load_module() { ...@@ -48,11 +48,11 @@ load_module() {
sudo insmod $1 sudo insmod $1
} }
load_module $OPENAIR_DIR/targets/bin/ue_ip.ko load_module ../../targets/bin/ue_ip.ko
if [ "$1" = "UE" ]; then if [ "$1" = "UE" ]; then
echo "bring up oip0 interface for UE" echo "bring up $LTEIF interface for UE"
ifconfig oip0 up ifconfig $LTEIF up
fi fi
ip route flush cache ip route flush cache
......
#!/bin/bash
# Carrier frequency in Hz
#FREQ=2660000000 #FDD
FREQ=2350000000 #TDD
NRB=50
TA=0
#9:trace, 8/7:debug, 6:info, 4:warn, 3:error
LOGLEVEL=6
#enable or disable soft scope
#SCOPE=''
SCOPE='-d'
#enable or disable VCD logging
VCD=''
#VCD='-V'
ISTDD='-T'
#ISTDD=''
#use external clock
ECLK="--external-clock"
#ECLK=""
#UE scan carrier
#ISSCAN="--ue-scan-carrier"
ISSCAN=""
sudo sh -c './init_nas_s1 UE'
cd ../../targets/bin/
sudo -E ./lte-softmodem.Rel10 -U -C$FREQ -r$NRB $ISSCAN --ue-txgain 70 --ue-rxgain 80 -A $TA $ECLK -W $ISTDD -g $LOGLEVEL $SCOPE 2>&1 | sudo tee /tmp/UE.log
...@@ -4799,7 +4799,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format, ...@@ -4799,7 +4799,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
return(0); return(0);
} }
if(harq_pid >8) if(harq_pid>=8)
{ {
LOG_I(PHY,"bad harq id \n"); LOG_I(PHY,"bad harq id \n");
return(0); return(0);
...@@ -5013,7 +5013,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format, ...@@ -5013,7 +5013,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
#endif #endif
// I- check dci content minimum coherency // I- check dci content minimum coherency
if(harq_pid >8) if(harq_pid>=8)
{ {
LOG_I(PHY,"bad harq pid\n"); LOG_I(PHY,"bad harq pid\n");
return(0); return(0);
......
...@@ -258,7 +258,7 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *ue, ...@@ -258,7 +258,7 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *ue,
if (ulsch->harq_processes[harq_pid]->nb_rb > 4) { if (ulsch->harq_processes[harq_pid]->nb_rb > 4) {
msg("rar_tools.c: unlikely rb count for RAR grant : nb_rb > 3\n"); msg("rar_tools.c: unlikely rb count for RAR grant : nb_rb > 3\n");
return(-1); // return(-1);
} }
// ulsch->harq_processes[harq_pid]->Ndi = 1; // ulsch->harq_processes[harq_pid]->Ndi = 1;
......
...@@ -242,7 +242,7 @@ uint32_t ulsch_encoding(uint8_t *a, ...@@ -242,7 +242,7 @@ uint32_t ulsch_encoding(uint8_t *a,
return(-1); return(-1);
} }
if (harq_pid > 7) { if (harq_pid >= 8) {
LOG_E(PHY,"Illegal harq_pid %d\n",harq_pid); LOG_E(PHY,"Illegal harq_pid %d\n",harq_pid);
return(-1); return(-1);
} }
......
...@@ -402,7 +402,7 @@ void ulsch_modulation(int32_t **txdataF, ...@@ -402,7 +402,7 @@ void ulsch_modulation(int32_t **txdataF,
// x1 is set in lte_gold_generic // x1 is set in lte_gold_generic
x2 = (ulsch->rnti<<14) + (subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1 x2 = (ulsch->rnti<<14) + (subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1
if (harq_pid > 7) { if (harq_pid>=8) {
printf("ulsch_modulation.c: Illegal harq_pid %d\n",harq_pid); printf("ulsch_modulation.c: Illegal harq_pid %d\n",harq_pid);
return; return;
} }
......
...@@ -493,6 +493,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -493,6 +493,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
int16_t **chest_f; int16_t **chest_f;
int16_t *pdsch_llr; int16_t *pdsch_llr;
int16_t *pdsch_comp; int16_t *pdsch_comp;
int16_t *pdsch_mag;
int8_t *pdcch_llr; int8_t *pdcch_llr;
int16_t *pdcch_comp; int16_t *pdcch_comp;
int8_t *pbch_llr; int8_t *pbch_llr;
...@@ -571,6 +572,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -571,6 +572,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[0]; // stream 0 pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[0]; // stream 0
// pdsch_llr = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars_SI[eNB_id]->llr[0]; // stream 0 // pdsch_llr = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars_SI[eNB_id]->llr[0]; // stream 0
pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp0[0]; pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp0[0];
pdsch_mag = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag0[0];
// Received signal in time domain of receive antenna 0 // Received signal in time domain of receive antenna 0
if (rxsig_t != NULL) { if (rxsig_t != NULL) {
...@@ -752,8 +754,9 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -752,8 +754,9 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
for (k=0; k<frame_parms->symbols_per_tti; k++) { for (k=0; k<frame_parms->symbols_per_tti; k++) {
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) { for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
I[ind] = pdsch_comp[(2*frame_parms->N_RB_DL*12*k)+4*i]; int j = (2*frame_parms->N_RB_DL*12*k)+4*i;
Q[ind] = pdsch_comp[(2*frame_parms->N_RB_DL*12*k)+4*i+1]; I[ind] = (pdsch_mag[j ]!=0? 1.0/pdsch_mag[j ]: 0.0) * pdsch_comp[j ]*1.0;
Q[ind] = (pdsch_mag[j+1]!=0? 1.0/pdsch_mag[j+1]: 0.0) * pdsch_comp[j+1]*1.0;
ind++; ind++;
} }
} }
......
...@@ -190,7 +190,7 @@ int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rntiP) { ...@@ -190,7 +190,7 @@ int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rntiP) {
eNB = PHY_vars_eNB_g[Mod_idP][CC_id]; eNB = PHY_vars_eNB_g[Mod_idP][CC_id];
for (i=0; i<NUMBER_OF_UE_MAX; i++) { for (i=0; i<NUMBER_OF_UE_MAX; i++) {
if ((eNB->dlsch[i]==NULL) || (eNB->ulsch[i]==NULL)) { if ((eNB->dlsch[i]==NULL) || (eNB->ulsch[i]==NULL)) {
MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (ENOMEM)", rnti); MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (ENOMEM)", rntiP);
LOG_E(PHY,"Can't remove UE, not enough memory allocated\n"); LOG_E(PHY,"Can't remove UE, not enough memory allocated\n");
return(-1); return(-1);
} else { } else {
......
...@@ -633,7 +633,13 @@ PUCCH_FMT_t get_pucch_format(lte_frame_type_t frame_type, ...@@ -633,7 +633,13 @@ PUCCH_FMT_t get_pucch_format(lte_frame_type_t frame_type,
} }
if(SR_payload == 1) if(SR_payload == 1)
{ {
if (frame_type == FDD) {
return pucch_format1; return pucch_format1;
} else if (frame_type == TDD) {
return pucch_format1b;
} else {
AssertFatal(1==0,"Unknown frame_type");
}
} }
} }
else else
...@@ -729,7 +735,7 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, ...@@ -729,7 +735,7 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
} else if (subframe == 8) { // ACK subframes 4 } else if (subframe == 8) { // ACK subframes 4
candidate_dl[0] = 4; candidate_dl[0] = 4;
} else { } else {
LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, illegal subframe %d for tdd_config %d\n", LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, illegal tx-subframe %d for tdd_config %d\n",
ue->Mod_id,proc->frame_tx,subframe,frame_parms->tdd_config); ue->Mod_id,proc->frame_tx,subframe,frame_parms->tdd_config);
return(0); return(0);
} }
...@@ -743,8 +749,8 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, ...@@ -743,8 +749,8 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
} }
} }
if (last_dl >= 10) { if (last_dl >= 10) {
LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, illegal subframe %d for tdd_config %d\n", LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, illegal rx-subframe %d (tx-subframe %d) for tdd_config %d\n",
ue->Mod_id,proc->frame_tx,last_dl,frame_parms->tdd_config); ue->Mod_id,proc->frame_tx,last_dl,subframe,frame_parms->tdd_config);
return (0); return (0);
} }
...@@ -1775,13 +1781,13 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -1775,13 +1781,13 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
} }
} }
ack_status_cw0 = reset_ack(&ue->frame_parms, ack_status_cw0 = get_ack(&ue->frame_parms,
ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack, ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack,
subframe_tx, subframe_tx,
pucch_ack_payload, pucch_ack_payload,
0); 0);
ack_status_cw1 = reset_ack(&ue->frame_parms, ack_status_cw1 = get_ack(&ue->frame_parms,
ue->dlsch[proc->subframe_rx&0x1][eNB_id][1]->harq_ack, ue->dlsch[proc->subframe_rx&0x1][eNB_id][1]->harq_ack,
subframe_tx, subframe_tx,
pucch_ack_payload, pucch_ack_payload,
...@@ -3236,7 +3242,8 @@ void process_rar(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, runmode_t mo ...@@ -3236,7 +3242,8 @@ void process_rar(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, runmode_t mo
ue->prach_resources[eNB_id]->ra_RNTI, ue->prach_resources[eNB_id]->ra_RNTI,
dlsch0->harq_processes[0]->b, dlsch0->harq_processes[0]->b,
&ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti, &ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti,
ue->prach_resources[eNB_id]->ra_PreambleIndex); ue->prach_resources[eNB_id]->ra_PreambleIndex,
dlsch0->harq_processes[0]->b); // alter the 'b' buffer so it contains only the selected RAR header and RAR payload
ue->pdcch_vars[(subframe_rx+1) & 0x1][eNB_id]->crnti = ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti; ue->pdcch_vars[(subframe_rx+1) & 0x1][eNB_id]->crnti = ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti;
......
...@@ -1301,7 +1301,7 @@ int main(int argc, char **argv) ...@@ -1301,7 +1301,7 @@ int main(int argc, char **argv)
unsigned int ret; unsigned int ret;
unsigned int coded_bits_per_codeword=0,nsymb; //,tbs=0; unsigned int coded_bits_per_codeword=0,nsymb; //,tbs=0;
unsigned int tx_lev=0,tx_lev_dB=0,trials,errs[4]= {0,0,0,0},errs2[4]= {0,0,0,0},round_trials[4]= {0,0,0,0},dci_errors=0;//,num_layers; unsigned int tx_lev=0,tx_lev_dB=0,trials,errs[4]= {0,0,0,0},errs2[4]= {0,0,0,0},round_trials[4]= {0,0,0,0},dci_errors[4]={0,0,0,0};//,num_layers;
//int re_allocated; //int re_allocated;
char fname[32],vname[32]; char fname[32],vname[32];
FILE *bler_fd; FILE *bler_fd;
...@@ -1998,7 +1998,7 @@ int main(int argc, char **argv) ...@@ -1998,7 +1998,7 @@ int main(int argc, char **argv)
} }
*/ */
UE->pdcch_vars[0][0]->crnti = n_rnti; UE->pdcch_vars[subframe & 0x1][0]->crnti = n_rnti;
// Fill in UL_alloc // Fill in UL_alloc
UL_alloc_pdu.type = 0; UL_alloc_pdu.type = 0;
...@@ -2246,7 +2246,10 @@ int main(int argc, char **argv) ...@@ -2246,7 +2246,10 @@ int main(int argc, char **argv)
round_trials[2] = 0; round_trials[2] = 0;
round_trials[3] = 0; round_trials[3] = 0;
dci_errors=0; dci_errors[0]=0;
dci_errors[1]=0;
dci_errors[2]=0;
dci_errors[3]=0;
// avg_ber = 0; // avg_ber = 0;
round=0; round=0;
...@@ -2499,6 +2502,9 @@ int main(int argc, char **argv) ...@@ -2499,6 +2502,9 @@ int main(int argc, char **argv)
if (UE->dlsch[subframe&0x1][0][0]->active == 0) { if (UE->dlsch[subframe&0x1][0][0]->active == 0) {
//printf("DCI not received\n"); //printf("DCI not received\n");
dci_errors[round]++;
UE->dlsch_errors[0] = 1;
/* /*
write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1); write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1);
write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[eNB_id]->dl_ch_estimates_ext[0],12*UE->frame_parms.N_RB_DL*3,1,1); write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[eNB_id]->dl_ch_estimates_ext[0],12*UE->frame_parms.N_RB_DL*3,1,1);
...@@ -2837,13 +2843,13 @@ int main(int argc, char **argv) ...@@ -2837,13 +2843,13 @@ int main(int argc, char **argv)
double std_phy_proc_rx_demod=0; double std_phy_proc_rx_demod=0;
double std_phy_proc_rx_dec=0; double std_phy_proc_rx_dec=0;
effective_rate = ((double)(round_trials[0]-dci_errors)/((double)round_trials[0] + round_trials[1] + round_trials[2] + round_trials[3])); effective_rate = 1.0-((double)(errs[0]+errs[1]+errs[2]+errs[3])/((double)round_trials[0] + round_trials[1] + round_trials[2] + round_trials[3]));
printf("\n**********************SNR = %f dB (tx_lev %f)**************************\n", printf("\n**********************SNR = %f dB (tx_lev %f)**************************\n",
SNR, SNR,
(double)tx_lev_dB+10*log10(UE->frame_parms.ofdm_symbol_size/(NB_RB*12))); (double)tx_lev_dB+10*log10(UE->frame_parms.ofdm_symbol_size/(NB_RB*12)));
printf("Errors (%d(%d)/%d %d/%d %d/%d %d/%d), Pe = (%e,%e,%e,%e), dci_errors %d/%d, Pe = %e => effective rate %f (%2.1f%%,%f, %f), normalized delay %f (%f)\n", printf("Errors (%d(%d)/%d %d/%d %d/%d %d/%d), Pe = (%e,%e,%e,%e), dci_errors %d/%d, Pe = %e => effective rate %f, normalized delay %f (%f)\n",
errs[0], errs[0],
errs2[0], errs2[0],
round_trials[0], round_trials[0],
...@@ -2857,13 +2863,13 @@ int main(int argc, char **argv) ...@@ -2857,13 +2863,13 @@ int main(int argc, char **argv)
(double)errs[1]/(round_trials[0]), (double)errs[1]/(round_trials[0]),
(double)errs[2]/(round_trials[0]), (double)errs[2]/(round_trials[0]),
(double)errs[3]/(round_trials[0]), (double)errs[3]/(round_trials[0]),
dci_errors, dci_errors[0]+dci_errors[1]+dci_errors[2]+dci_errors[3],
round_trials[0], round_trials[0]+round_trials[1]+round_trials[2]+round_trials[3],
(double)dci_errors/(round_trials[0]), (double)(dci_errors[0]+dci_errors[1]+dci_errors[2]+dci_errors[3])/(round_trials[0]+round_trials[1]+round_trials[2]+round_trials[3]),
rate*effective_rate, //rate*effective_rate,
100*effective_rate, 100*effective_rate,
rate, //rate,
rate*get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs), //rate*get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs),
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/ (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/
(double)eNB->dlsch[0][0]->harq_processes[0]->TBS, (double)eNB->dlsch[0][0]->harq_processes[0]->TBS,
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])); (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0]));
...@@ -2986,7 +2992,7 @@ int main(int argc, char **argv) ...@@ -2986,7 +2992,7 @@ int main(int argc, char **argv)
round_trials[2], round_trials[2],
errs[3], errs[3],
round_trials[3], round_trials[3],
dci_errors); dci_errors[0]);
} else { } else {
fprintf(bler_fd,"%f;%d;%d;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d\n", fprintf(bler_fd,"%f;%d;%d;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d\n",
SNR, SNR,
...@@ -3002,7 +3008,7 @@ int main(int argc, char **argv) ...@@ -3002,7 +3008,7 @@ int main(int argc, char **argv)
round_trials[2], round_trials[2],
errs[3], errs[3],
round_trials[3], round_trials[3],
dci_errors); dci_errors[0]);
} }
...@@ -3035,7 +3041,7 @@ int main(int argc, char **argv) ...@@ -3035,7 +3041,7 @@ int main(int argc, char **argv)
round_trials[2], round_trials[2],
errs[3], errs[3],
round_trials[3], round_trials[3],
dci_errors); dci_errors[0]);
//fprintf(time_meas_fd,"SNR; MCS; TBS; rate; DL_DECOD_ITER; err0; trials0; err1; trials1; err2; trials2; err3; trials3; PE; dci_err;PE;ND;\n"); //fprintf(time_meas_fd,"SNR; MCS; TBS; rate; DL_DECOD_ITER; err0; trials0; err1; trials1; err2; trials2; err3; trials3; PE; dci_err;PE;ND;\n");
fprintf(time_meas_fd,"%f;%d;%d;%f; %2.1f%%;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%e;%e;%e;%e;%d;%d;%e;%f;%f;", fprintf(time_meas_fd,"%f;%d;%d;%f; %2.1f%%;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%e;%e;%e;%e;%d;%d;%e;%f;%f;",
...@@ -3058,9 +3064,9 @@ int main(int argc, char **argv) ...@@ -3058,9 +3064,9 @@ int main(int argc, char **argv)
(double)errs[1]/(round_trials[0]), (double)errs[1]/(round_trials[0]),
(double)errs[2]/(round_trials[0]), (double)errs[2]/(round_trials[0]),
(double)errs[3]/(round_trials[0]), (double)errs[3]/(round_trials[0]),
dci_errors,