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
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
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"
XFORMS="True"
FLEXRAN_AGENT_SB_IF="True"
......@@ -55,11 +62,10 @@ T_TRACER="False"
DISABLE_HARDWARE_DEPENDENCY="False"
CMAKE_BUILD_TYPE=""
UE_AUTOTEST_TRACE="False"
BUILD_ECLIPSE=0
CMAKE_CMD='cmake'
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() {
echo_info "
This program installs OpenAirInterface Software
......@@ -141,6 +147,8 @@ Options
Disable HW dependency during installation
--ue-autotest-trace
Enable specific traces for UE autotest framework
--build-eclipse
Build eclipse project files. Paths are auto corrected by fixprj.sh
Usage (first build):
oaisim (eNB + UE): ./build_oai -I --oaisim -x --install-system-files
Eurecom EXMIMO + COTS UE : ./build_oai -I --eNB -x --install-system-files
......@@ -179,6 +187,7 @@ function main() {
GDB=1
CMAKE_BUILD_TYPE="Debug"
echo_info "Will Compile with gdb symbols and disable compiler optimization"
CMAKE_CMD="$CMAKE_CMD -DCMAKE_BUILD_TYPE=Debug"
shift;;
--eNB)
eNB=1
......@@ -311,6 +320,11 @@ function main() {
UHD_IMAGES_DIR=$2
echo_info "Downloading UHD images in the indicated location"
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)
print_help
exit 1;;
......@@ -321,6 +335,9 @@ function main() {
esac
done
CMAKE_CMD="$CMAKE_CMD .."
echo_info "CMAKE_CMD=$CMAKE_CMD"
#########################################################
# check validity of HW and TP parameters for RRH and eNB
#########################################################
......@@ -391,7 +408,6 @@ function main() {
echo_info "2. Setting the OAI PATHS ..."
set_openair_env
cecho "OPENAIR_DIR = $OPENAIR_DIR" $green
# for conf files copy in this bash script
......@@ -495,7 +511,7 @@ function main() {
fi
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$lte_build_dir/build
cmake ..
eval $CMAKE_CMD
fi
if [ "$eNB" = "1" -o "$UE" = "1" ] ; then
......@@ -524,7 +540,7 @@ function main() {
# mkdir -p $DIR/at_commands/build
# cd $DIR/at_commands/build
# cmake ..
# eval $CMAKE_CMD
# compilations \
# at_commands at_nas_ue \
# at_nas_ue $dbin/at_nas_ue
......@@ -533,7 +549,7 @@ function main() {
mkdir -p $DIR/nas_sim_tools/build
cd $DIR/nas_sim_tools/build
cmake ..
eval $CMAKE_CMD
compilations \
nas_sim_tools usim \
usim $dbin/usim
......@@ -562,7 +578,7 @@ function main() {
mkdir -p build
cd build
rm -f *sim
cmake ..
eval $CMAKE_CMD
fi
if [ "$SIMUS_PHY" = "1" ] ; then
......@@ -640,7 +656,7 @@ function main() {
[ "$CLEAN" = "1" ] && rm -rf $DIR/$oaisim_build_dir/build
mkdir -p $DIR/$oaisim_build_dir/build
cd $DIR/$oaisim_build_dir/build
cmake ..
eval $CMAKE_CMD
compilations \
$oaisim_build_dir $oaisim_exec \
$oaisim_exec $dbin/$oaisim_exec.$REL
......@@ -651,7 +667,7 @@ function main() {
echo_info "Compiling at_nas_ue"
mkdir -p $DIR/at_commands/build
cd $DIR/at_commands/build
cmake ..
eval $CMAKE_CMD
compilations \
at_commands at_nas_ue \
at_nas_ue $dbin/at_nas_ue
......@@ -665,7 +681,7 @@ function main() {
[ "$CLEAN" = "1" ] && rm -rf $DIR/nas_sim_tools/build
mkdir -p $DIR/nas_sim_tools/build
cd $DIR/nas_sim_tools/build
cmake ..
eval $CMAKE_CMD
compilations \
nas_sim_tools usim \
usim $dbin/usim
......@@ -722,7 +738,7 @@ function main() {
#[ "$CLEAN" = "1" ] && rm -rf $DIR/oaisim_mme_build_oai/build
#mkdir -p $DIR/oaisim_mme_build_oai/build
#cd $DIR/oaisim_mme_build_oai/build
#cmake ..
#eval $CMAKE_CMD
#compilations \
# oaisim_mme_build_oai oaisim_mme \
# oaisim_mme $dbin/oaisim_mme.$REL
......@@ -752,7 +768,7 @@ function main() {
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$rrh_build_dir/build
cmake ..
eval $CMAKE_CMD
compilations \
rrh_gw rrh_gw \
rrh_gw $dbin/rrh_gw
......@@ -761,9 +777,9 @@ function main() {
# 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
else
build_dir=$rrh_build_dir
......@@ -847,7 +863,7 @@ fi
[ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/doxygen/build
mkdir -p $OPENAIR_DIR/cmake_targets/doxygen/build
cd $OPENAIR_DIR/cmake_targets/doxygen/build
cmake ..
eval $CMAKE_CMD
make doc
) >& $doxygen_log
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 @@
#
#######################################
LTEIF=oip0
LTEIF=oip1
#OPENAIR_DIR=/home/oai/svn-oai/openair4G
load_module() {
......@@ -48,11 +48,11 @@ load_module() {
sudo insmod $1
}
load_module $OPENAIR_DIR/targets/bin/ue_ip.ko
load_module ../../targets/bin/ue_ip.ko
if [ "$1" = "UE" ]; then
echo "bring up oip0 interface for UE"
ifconfig oip0 up
echo "bring up $LTEIF interface for UE"
ifconfig $LTEIF up
fi
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,
return(0);
}
if(harq_pid >8)
if(harq_pid>=8)
{
LOG_I(PHY,"bad harq id \n");
return(0);
......@@ -5013,7 +5013,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
#endif
// I- check dci content minimum coherency
if(harq_pid >8)
if(harq_pid>=8)
{
LOG_I(PHY,"bad harq pid\n");
return(0);
......
......@@ -258,7 +258,7 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *ue,
if (ulsch->harq_processes[harq_pid]->nb_rb > 4) {
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;
......
......@@ -242,7 +242,7 @@ uint32_t ulsch_encoding(uint8_t *a,
return(-1);
}
if (harq_pid > 7) {
if (harq_pid >= 8) {
LOG_E(PHY,"Illegal harq_pid %d\n",harq_pid);
return(-1);
}
......
......@@ -402,7 +402,7 @@ void ulsch_modulation(int32_t **txdataF,
// 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
if (harq_pid > 7) {
if (harq_pid>=8) {
printf("ulsch_modulation.c: Illegal harq_pid %d\n",harq_pid);
return;
}
......
......@@ -493,6 +493,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
int16_t **chest_f;
int16_t *pdsch_llr;
int16_t *pdsch_comp;
int16_t *pdsch_mag;
int8_t *pdcch_llr;
int16_t *pdcch_comp;
int8_t *pbch_llr;
......@@ -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->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_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
if (rxsig_t != NULL) {
......@@ -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 (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];
Q[ind] = pdsch_comp[(2*frame_parms->N_RB_DL*12*k)+4*i+1];
int j = (2*frame_parms->N_RB_DL*12*k)+4*i;
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++;
}
}
......
......@@ -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];
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
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");
return(-1);
} else {
......
......@@ -633,7 +633,13 @@ PUCCH_FMT_t get_pucch_format(lte_frame_type_t frame_type,
}
if(SR_payload == 1)
{
if (frame_type == FDD) {
return pucch_format1;
} else if (frame_type == TDD) {
return pucch_format1b;
} else {
AssertFatal(1==0,"Unknown frame_type");
}
}
}
else
......@@ -729,7 +735,7 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
} else if (subframe == 8) { // ACK subframes 4
candidate_dl[0] = 4;
} 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);
return(0);
}
......@@ -743,8 +749,8 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
}
}
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",
ue->Mod_id,proc->frame_tx,last_dl,frame_parms->tdd_config);
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,subframe,frame_parms->tdd_config);
return (0);
}
......@@ -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,
subframe_tx,
pucch_ack_payload,
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,
subframe_tx,
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
ue->prach_resources[eNB_id]->ra_RNTI,
dlsch0->harq_processes[0]->b,
&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;
......
......@@ -1301,7 +1301,7 @@ int main(int argc, char **argv)
unsigned int ret;
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;
char fname[32],vname[32];
FILE *bler_fd;
......@@ -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
UL_alloc_pdu.type = 0;
......@@ -2246,7 +2246,10 @@ int main(int argc, char **argv)
round_trials[2] = 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;
round=0;
......@@ -2499,6 +2502,9 @@ int main(int argc, char **argv)
if (UE->dlsch[subframe&0x1][0][0]->active == 0) {
//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("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)
double std_phy_proc_rx_demod=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",
SNR,
(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],
errs2[0],
round_trials[0],
......@@ -2857,13 +2863,13 @@ int main(int argc, char **argv)
(double)errs[1]/(round_trials[0]),
(double)errs[2]/(round_trials[0]),
(double)errs[3]/(round_trials[0]),
dci_errors,
round_trials[0],
(double)dci_errors/(round_trials[0]),
rate*effective_rate,
dci_errors[0]+dci_errors[1]+dci_errors[2]+dci_errors[3],
round_trials[0]+round_trials[1]+round_trials[2]+round_trials[3],
(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,
100*effective_rate,
rate,
rate*get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs),
//rate,
//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])/
(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]));
......@@ -2986,7 +2992,7 @@ int main(int argc, char **argv)
round_trials[2],
errs[3],
round_trials[3],
dci_errors);
dci_errors[0]);
} else {
fprintf(bler_fd,"%f;%d;%d;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d\n",
SNR,
......@@ -3002,7 +3008,7 @@ int main(int argc, char **argv)
round_trials[2],
errs[3],
round_trials[3],
dci_errors);
dci_errors[0]);
}
......@@ -3035,7 +3041,7 @@ int main(int argc, char **argv)
round_trials[2],
errs[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,"%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)
(double)errs[1]/(round_trials[0]),
(double)errs[2]/(round_trials[0]),
(double)errs[3]/(round_trials[0]),
dci_errors,
dci_errors[0],
round_trials[0],
(double)dci_errors/(round_trials[0]),
(double)dci_errors[0]/(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,
(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]));
......@@ -3079,7 +3085,7 @@ int main(int argc, char **argv)
round_trials[2],
errs[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,"%f;%d;%d;%d;%d;%f;%2.1f;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%e;%e;%e;%e;%d;%d;%e;%f;%f;",
......@@ -3103,9 +3109,9 @@ int main(int argc, char **argv)
(double)errs[1]/(round_trials[0]),
(double)errs[2]/(round_trials[0]),
(double)errs[3]/(round_trials[0]),
dci_errors,
dci_errors[0],
round_trials[0],
(double)dci_errors/(round_trials[0]),
(double)dci_errors[0]/(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,
(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]));
......
......@@ -653,6 +653,7 @@ int main(int argc, char **argv)
printf("-h This message\n");
printf("-a Use AWGN channel and not multipath\n");
printf("-c TDD config\n");
printf("-S Subframe number (0..9)\n");
printf("-R N_RB_DL\n");
printf("-F use FDD frame\n");
printf("-p Use extended prefix mode\n");
......
......@@ -388,9 +388,9 @@ typedef struct {
struct PMCH_InfoList_r9 *pmch_InfoList
#endif
);
unsigned int (*mac_rlc_data_req)(module_id_t, unsigned int, char*);
unsigned int (*mac_rlc_data_req)(module_id_t, unsigned int, const unsigned int,char*);
void (*mac_rlc_data_ind)(module_id_t, logical_chan_id_t, char*, tb_size_t, num_tb_t, crc_t* );
mac_rlc_status_resp_t (*mac_rlc_status_ind) (module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, eNB_flag_t eNB_flagP, MBMS_flag_t MBMS_flagP,
mac_rlc_status_resp_t (*mac_rlc_status_ind) (module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, sub_frame_t subframeP, eNB_flag_t eNB_flagP, MBMS_flag_t MBMS_flagP,
logical_chan_id_t channel_idP, tb_size_t tb_sizeP);
signed int (*rrc_rlc_data_req)(module_id_t, rb_id_t, mui_t, confirm_t, sdu_size_t, char *);
void (*rrc_rlc_register_rrc) (void (*rrc_data_indP)(module_id_t , rb_id_t , sdu_size_t , char* ),
......
......@@ -562,14 +562,16 @@ int flexran_get_ue_wcqi (mid_t mod_id, mid_t ue_id) {
int flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id) {
rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id);
uint16_t frame = (uint16_t) flexran_get_current_frame(mod_id);
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id,rnti, mod_id,frame,ENB_FLAG_YES,MBMS_FLAG_NO, channel_id, 0);
uint16_t subframe = (uint16_t) flexran_get_current_subframe(mod_id);
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id,rnti, mod_id,frame,subframe,ENB_FLAG_YES,MBMS_FLAG_NO, channel_id, 0);
return rlc_status.bytes_in_buffer;
}
int flexran_get_hol_delay(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id) {
rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id);
uint16_t frame = (uint16_t) flexran_get_current_frame(mod_id);
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id, rnti, mod_id, frame, ENB_FLAG_YES, MBMS_FLAG_NO, channel_id, 0);
uint16_t subframe = (uint16_t) flexran_get_current_subframe(mod_id);
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id, rnti, mod_id, frame, subframe, ENB_FLAG_YES, MBMS_FLAG_NO, channel_id, 0);
return rlc_status.head_sdu_creation_time;
}
......
......@@ -332,16 +332,18 @@ rrc_mac_config_req(
if (eNB_flagP == 0) {
if (measObj!= NULL) {
if (measObj[0]!= NULL) {
if (measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList != NULL) {
UE_mac_inst[Mod_idP].n_adj_cells = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.count;
LOG_I(MAC,"Number of adjacent cells %d\n",UE_mac_inst[Mod_idP].n_adj_cells);
LOG_D(MAC,"Number of adjacent cells %d\n",UE_mac_inst[Mod_idP].n_adj_cells);
for (i=0; i<UE_mac_inst[Mod_idP].n_adj_cells; i++) {
UE_mac_inst[Mod_idP].adj_cell_id[i] = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.array[i]->physCellId;
LOG_I(MAC,"Cell %d : Nid_cell %d\n",i,UE_mac_inst[Mod_idP].adj_cell_id[i]);
LOG_D(MAC,"Cell %d : Nid_cell %d\n",i,UE_mac_inst[Mod_idP].adj_cell_id[i]);
}
mac_xface->phy_config_meas_ue(Mod_idP,0,eNB_index,UE_mac_inst[Mod_idP].n_adj_cells,UE_mac_inst[Mod_idP].adj_cell_id);
}
}
/*
if (quantityConfig != NULL) {
......
......@@ -821,6 +821,7 @@ schedule_ue_spec(
rnti,
module_idP,
frameP,
subframeP,
ENB_FLAG_YES,
MBMS_FLAG_NO,
DCCH,
......@@ -839,6 +840,7 @@ schedule_ue_spec(
ENB_FLAG_YES,
MBMS_FLAG_NO,
DCCH,
TBS, //not used
(char *)&dlsch_buffer[0]);
T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
......@@ -872,6 +874,7 @@ schedule_ue_spec(
rnti,
module_idP,
frameP,
subframeP,
ENB_FLAG_YES,
MBMS_FLAG_NO,
DCCH+1,
......@@ -890,6 +893,7 @@ schedule_ue_spec(
ENB_FLAG_YES,
MBMS_FLAG_NO,
DCCH+1,
TBS, //not used
(char *)&dlsch_buffer[sdu_length_total]);
T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
......@@ -932,6 +936,7 @@ schedule_ue_spec(
rnti,
module_idP,
frameP,
subframeP,
ENB_FLAG_YES,
MBMS_FLAG_NO,
lcid,
......@@ -949,6 +954,7 @@ schedule_ue_spec(
ENB_FLAG_YES,
MBMS_FLAG_NO,
lcid,
TBS, //not used
(char*)&dlsch_buffer[sdu_length_total]);
T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
T_INT(harq_pid), T_INT(lcid), T_INT(sdu_lengths[num_sdus]));
......
......@@ -504,7 +504,7 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
module_idP,CC_id,frameP,MTCH,TBS,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
rlc_status = mac_rlc_status_ind(module_idP,0,frameP,module_idP,ENB_FLAG_YES,MBMS_FLAG_YES,MTCH,
rlc_status = mac_rlc_status_ind(module_idP,0,frameP,subframeP,module_idP,ENB_FLAG_YES,MBMS_FLAG_YES,MTCH,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
LOG_D(MAC,"e-MBMS log channel %u frameP %d, subframeP %d, rlc_status.bytes_in_buffer is %d\n",
MTCH,frameP,subframeP, rlc_status.bytes_in_buffer);
......@@ -521,6 +521,7 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
ENB_FLAG_YES,
MBMS_FLAG_YES,
MTCH,
0, //not used
(char*)&mch_buffer[sdu_length_total]);
//sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,frameP, MBMS_FLAG_NO, MTCH+(MAX_NUM_RB*(NUMBER_OF_UE_MAX+1)), (char*)&mch_buffer[sdu_length_total]);
LOG_I(MAC,"[eNB %d][MBMS USER-PLANE] CC_id %d Got %d bytes for MTCH %d\n",module_idP,CC_id,sdu_lengths[num_sdus],MTCH);
......
......@@ -174,6 +174,7 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id,
rnti,
mod_id,
frame,
subframe,
ENB_FLAG_YES,
MBMS_FLAG_NO,
lcid,
......@@ -193,6 +194,7 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id,
rnti,
mod_id,
frame,
subframe,
ENB_FLAG_YES,
MBMS_FLAG_NO,
lcid,
......@@ -209,6 +211,7 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id,
ENB_FLAG_YES,
MBMS_FLAG_NO,
lcid,
rlc_size, //not used
(char *)&dlsch_buffer[sdu_length_total]);
LOG_D(MAC,"[eNB %d][LCID %d] CC_id %d Got %d bytes from RLC\n",mod_id, lcid, CC_id, sdu_lengths[j]);
......
......@@ -160,7 +160,7 @@ void _store_dlsch_buffer (module_id_t Mod_id,
for(i=0; i< MAX_NUM_LCID; i++) { // loop over all the logical channels
rlc_status = mac_rlc_status_ind(Mod_id,rnti, Mod_id,frameP,ENB_FLAG_YES,MBMS_FLAG_NO,i,0 );
rlc_status = mac_rlc_status_ind(Mod_id,rnti, Mod_id,frameP,subframeP,ENB_FLAG_YES,MBMS_FLAG_NO,i,0 );
UE_template->dl_buffer_info[i] = rlc_status.bytes_in_buffer; //storing the dlsch buffer for each logical channel
UE_template->dl_pdus_in_buffer[i] = rlc_status.pdus_in_buffer;
UE_template->dl_buffer_head_sdu_creation_time[i] = rlc_status.head_sdu_creation_time ;
......@@ -1241,6 +1241,7 @@ flexran_schedule_ue_spec_common(mid_t mod_id,
rnti,
mod_id,
frame,
subframe,
ENB_FLAG_YES,
MBMS_FLAG_NO,
j,
......
......@@ -109,7 +109,7 @@ void store_dlsch_buffer (module_id_t Mod_id,
for(i=0; i< MAX_NUM_LCID; i++) { // loop over all the logical channels
rlc_status = mac_rlc_status_ind(Mod_id,rnti, Mod_id,frameP,ENB_FLAG_YES,MBMS_FLAG_NO,i,0 );
rlc_status = mac_rlc_status_ind(Mod_id,rnti, Mod_id,frameP,subframeP,ENB_FLAG_YES,MBMS_FLAG_NO,i,0 );
UE_template->dl_buffer_info[i] = rlc_status.bytes_in_buffer; //storing the dlsch buffer for each logical channel
UE_template->dl_pdus_in_buffer[i] = rlc_status