Commit 7361e74e authored by Rohit Gupta's avatar Rohit Gupta

Merge branch 'enhancement-10-harmony' into develop

parents 23822ea2 33fddd3a
......@@ -179,7 +179,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CU
# these changes are related to hardcoded path to include .h files
add_definitions(-DCMAKER)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O2")
set(GIT_BRANCH "UNKNOWN")
......@@ -262,15 +262,7 @@ if (${ENABLE_ITTI})
endif (${ENABLE_ITTI})
add_boolean_option(RTAI False "Use RTAI")
if (${RTAI})
set(DEADLINE_SCHEDULER False)
set(CPU_AFFINITY False)
add_definitions("-DENABLE_RTAI_CLOCK")
add_definitions("-DCONFIG_RTAI_LXRT_INLINE")
include_directories ("/usr/realtime/include")
include_directories ("/usr/realtime/include/asm")
set(RTAI_SOURCE sched_dlsch.c sched_rx_pdsch.c rt_wrapper.c vcd_signal_dumper.c log.c)
endif (${RTAI})
#############################
# ASN.1 grammar C code generation & dependancies
......@@ -505,7 +497,7 @@ include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/DEFS/")
#set (option_HWEXMIMOLIB_lib "-l ")
set(HWLIB_EXMIMO_SOURCE
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c
# ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c
)
add_library(oai_exmimodevif MODULE ${HWLIB_EXMIMO_SOURCE} )
......@@ -546,8 +538,8 @@ if (${RF_BOARD} STREQUAL "EXMIMO")
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)
${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")
......@@ -628,6 +620,7 @@ add_boolean_option(NAS_ADDRESS_FIX False "specific to oaisim: for nasmesh driver
add_boolean_option(NAS_NETLINK False "???? Must be True to compile nasmesh driver without rtai")
add_boolean_option(OAISIM False "specific to oaisim")
add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????")
add_boolean_option(USE_MME False "this flag is used only one time in lte-softmodem.c")
add_list_string_option(PACKAGE_NAME "NotDefined" "As per attribute name")
add_boolean_option(MESSAGE_CHART_GENERATOR False "For generating sequence diagrams")
......@@ -968,6 +961,7 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pucch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pmch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/group_hopping.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/srs_modulation.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/drs_modulation.c
......@@ -978,6 +972,8 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/rar_tools.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/print_stats.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/initial_sync.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/if4_tools.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/if5_tools.c
${OPENAIR1_DIR}/PHY/MODULATION/ofdm_mod.c
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep.c
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_mbsfn.c
......@@ -1614,10 +1610,9 @@ add_executable(lte-softmodem
${rrc_h}
${s1ap_h}
${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_TARGETS}/RT/USER/sched_dlsch.c
${OPENAIR_TARGETS}/RT/USER/sched_rx_pdsch.c
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
......@@ -1650,10 +1645,9 @@ add_executable(lte-softmodem-nos1
${rrc_h}
${s1ap_h}
${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_TARGETS}/RT/USER/sched_dlsch.c
${OPENAIR_TARGETS}/RT/USER/sched_rx_pdsch.c
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
......@@ -1749,6 +1743,9 @@ add_executable(oaisim
${s1ap_h}
${x2ap_h}
${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/SIMU/USER/channel_sim.c
${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
${OPENAIR_TARGETS}/SIMU/USER/oaisim_config.c
......@@ -1792,6 +1789,9 @@ add_executable(oaisim_nos1
${s1ap_h}
${x2ap_h}
${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/SIMU/USER/channel_sim.c
${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
${OPENAIR_TARGETS}/SIMU/USER/oaisim_config.c
......
......@@ -16,17 +16,22 @@ Obj.# Case# Test# Description
01 01 20 Build lte-softmodem.USRP.Rel10
01 01 21 Build lte-softmodem.EXMIMO.Rel10
01 01 22 Build lte-softmodem.BLADERF.Rel10
01 01 23 Build lte-softmodem.ETHERNET.Rel10
01 01 23 Build lte-softmodem.ETHERNET.Rel10 (RCC)
01 01 24 Build lte-softmodem.LMSSDR.Rel10
01 01 30 Build (dlsim.Rel10 + ulsim.Rel10 + pucchsim.Rel10 + prachsim.Rel10 + pdcchsim.Rel10 + pbchsim.Rel10 + mbmssim.Rel10
secu_knas_encrypt_eia1.Rel10 secu_kenb.Rel10 aes128_ctr_encrypt.Rel10 aes128_ctr_decrypt.Rel10 secu_knas_encrypt_eea2.Rel10
secu_knas.Rel10 secu_knas_encrypt_eea1.Rel10 kdf.Rel10 aes128_cmac_encrypt.Rel10 secu_knas_encrypt_eia2.Rel10)
01 01 40 Build RRH Gateway for USRP (Rel 10)
01 01 41 Build RRH Gateway for EXMIMO (Rel 10)
01 01 42 Build RRH Gateway for BLADERF (Rel 10)
01 01 43 Build RRH Gateway for LMSSDR (Rel 10)
01 01 40 Build RRH Gateway (time domain) for USRP (Rel 10)
01 01 41 Build RRH Gateway (time domain) for EXMIMO (Rel 10)
01 01 42 Build RRH Gateway (time domain) for BLADERF (Rel 10)
01 01 43 Build RRH Gateway (time domain) for LMSSDR (Rel 10)
01 01 50 Build RRU (NGFI) for USRP (Rel 10) w/ ETHERNET transport
01 01 51 Build RRU (NGFI) for EXMIMO (Rel 10) w/ ETHERNET transport
01 01 52 Build RRU (NGFI) for BLADERF (Rel 10) w/ ETHERNET transport
01 01 53 Build RRU (NGFI) for LMSSDR (Rel 10) w/ ETHERNET transport
01 02 Run OAISIM-NOS1 Rel10 (TDD + 5MHz/10MHz/20MHz + TM 1,2), and check the operation
......
......@@ -588,7 +588,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
RRH_pre_exec_args = testcase.findtext('RRH_pre_exec_args',default='')
RRH_main_exec = testcase.findtext('RRH_main_exec',default='')
RRH_main_exec_args = testcase.findtext('RRH_main_exec_args',default='')
RRH_terminate_missing_procs = testcase.findtext('RRH_terminate_missing_procs',default='True')
RRH_terminate_missing_procs = testcase.findtext('RRH_terminate_missing_procs',default='False')
eNBMachine = testcase.findtext('eNB',default='')
......@@ -601,7 +601,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
eNB_main_exec_args = testcase.findtext('eNB_main_exec_args',default='')
eNB_traffic_exec = testcase.findtext('eNB_traffic_exec',default='')
eNB_traffic_exec_args = testcase.findtext('eNB_traffic_exec_args',default='')
eNB_terminate_missing_procs = testcase.findtext('eNB_terminate_missing_procs',default='True')
eNB_terminate_missing_procs = testcase.findtext('eNB_terminate_missing_procs',default='False')
eNB_search_expr_true = testcase.findtext('eNB_search_expr_true','')
if re.compile('\w+').match(eNB_search_expr_true) != None:
eNB_search_expr_true = eNB_search_expr_true + ' duration=' + str(timeout_cmd-90) + 's'
......@@ -616,7 +616,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
UE_main_exec_args = testcase.findtext('UE_main_exec_args',default='')
UE_traffic_exec = testcase.findtext('UE_traffic_exec',default='')
UE_traffic_exec_args = testcase.findtext('UE_traffic_exec_args',default='')
UE_terminate_missing_procs = testcase.findtext('UE_terminate_missing_procs',default='True')
UE_terminate_missing_procs = testcase.findtext('UE_terminate_missing_procs',default='False')
UE_search_expr_true = testcase.findtext('UE_search_expr_true','')
UE_stop_script = testcase.findtext('UE_stop_script','')
if re.compile('\w+').match(UE_search_expr_true) != None:
......@@ -637,7 +637,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
HSS_main_exec_args = testcase.findtext('HSS_main_exec_args',default='')
EPC_traffic_exec = testcase.findtext('EPC_traffic_exec',default='')
EPC_traffic_exec_args = testcase.findtext('EPC_traffic_exec_args',default='')
EPC_terminate_missing_procs = testcase.findtext('EPC_terminate_missing_procs',default='True')
EPC_terminate_missing_procs = testcase.findtext('EPC_terminate_missing_procs',default='False')
EPC_search_expr_true = testcase.findtext('EPC_search_expr_true','')
if re.compile('\w+').match(EPC_search_expr_true) != None:
EPC_search_expr_true = EPC_search_expr_true + ' duration=' + str(timeout_cmd-90) + 's'
......@@ -1304,6 +1304,8 @@ logdirOpenaircnRepo = logdir + 'openair-cn/'
if flag_remove_logdir == True:
print "Removing directory: " + locallogdir
os.system(' rm -fr ' + locallogdir + '; mkdir -p ' + locallogdir )
else:
os.system('mkdir -p ' + locallogdir)
paramiko_logfile = os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/log/paramiko.log')
res=os.system(' echo > ' + paramiko_logfile)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -31,6 +31,26 @@
# \author Navid Nikaein, Rohit Gupta
# To free unused memory else test setup runs out of memory
sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches '
mem_threshold=0.2 #If free memory is less than this threshold, then VM drop cache is called
mem_tot=`vmstat -s -S k |grep "total memory" | awk '{print $1}'`
mem_free=`vmstat -s -S k |grep "free memory" | awk '{print $1}'`
mem_frac=`bc <<< "scale=4;$mem_free/$mem_tot"`
echo $mem_frac
#mem_frac=`bc <<< "scale=4;`echo $mem_free`/`echo $mem_tot`"`
echo "Total Memory = $mem_tot k "
echo "Free Memory = $mem_free k"
echo "Fraction free memory = $mem_frac "
res=`bc <<< "$mem_frac < 0.2" `
echo "Comparison Result = $res"
if [ "$res" == "1" ]
then
echo "Free memory less than threshold = $mem_threshold"
sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches '
fi
......@@ -48,7 +48,7 @@ PRINT_STATS="False"
VCD_TIMING="False"
DEADLINE_SCHEDULER_FLAG_USER="False"
FORCE_DEADLINE_SCHEDULER_FLAG_USER=""
CPU_AFFINITY_FLAG_USER="True" #Only valid when lowlatecy flag is set to False
CPU_AFFINITY_FLAG_USER="False" #Only valid when lowlatecy flag is set to False
REL="Rel10"
HW="None"
TP="None"
......@@ -306,9 +306,6 @@ function main() {
if [ "$HW" = "None" -a "$TP" = "None" ] ; then
echo_fatal "Define a local radio head (e.g. -w EXMIMO) or a transport protocol (e.g. -t ETHERNET) to communicate with a remote radio head!"
fi
if [ "$HW" != "None" -a "$TP" != "None" ] ; then
echo_fatal "Currently eNB can not support simultaniously local and remote radio heads!!"
fi
if [ "$HW" = "None" ] ; then
echo_info "No radio head has been selected (HW set to $HW)"
fi
......@@ -333,9 +330,9 @@ function main() {
#By default: EXMIMO: enable
if [ "$FORCE_DEADLINE_SCHEDULER_FLAG_USER" = "" ]; then
if [ "$HW" = "EXMIMO" ] ; then
DEADLINE_SCHEDULER_FLAG_USER="True"
DEADLINE_SCHEDULER_FLAG_USER="False"
elif [ "$HW" = "ETHERNET" ] ; then
DEADLINE_SCHEDULER_FLAG_USER="True"
DEADLINE_SCHEDULER_FLAG_USER="False"
elif [ "$HW" = "OAI_USRP" ] ; then
DEADLINE_SCHEDULER_FLAG_USER="False"
elif [ "$HW" = "OAI_BLADERF" ] ; then
......@@ -725,7 +722,9 @@ function main() {
#add exmimo compilation
#TODO EXMIMO library support
compilations \
$build_dir oai_exmimodevif \
liboai_exmimodevif.so $dbin/liboai_exmimodevif.so.$REL
echo_info "liboai_device.so is linked to EXMIMO device library"
elif [ "$HW" == "OAI_USRP" ] ; then
if [ -d "/usr/include/uhd" ] ; then
......
......@@ -179,7 +179,7 @@ install_nettle_from_source() {
cd /tmp
echo "Downloading nettle archive"
$SUDO rm -rf /tmp/nettle-2.5.tar.gz* /tmp/nettle-2.5
wget https://ftp.gnu.org/gnu/nettle/nettle-2.5.tar.gz
wget http://ftp.nluug.nl/gnu/nettle/nettle-2.5.tar.gz
if [ $? -ne 0 ]; then
wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz
fi
......@@ -284,7 +284,9 @@ check_install_additional_tools (){
wvdial \
python-numpy \
sshpass \
nscd
nscd \
bc \
ntp
$SUDO pip install paramiko
$SUDO pip install pyroute2
......
......@@ -52,7 +52,7 @@
#define print_bytes2(s,x) printf("%s %x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7],(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15],(x)[16],(x)[17],(x)[18],(x)[19],(x)[20],(x)[21],(x)[22],(x)[23],(x)[24],(x)[25],(x)[26],(x)[27],(x)[28],(x)[29],(x)[30],(x)[31])
//#define DEBUG_TURBO_ENCODER 1
#define CALLGRIND 1
//#define CALLGRIND 1
unsigned short threegpplte_interleaver_output;
unsigned long long threegpplte_interleaver_tmp;
......@@ -233,7 +233,7 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
loop++;
#endif
for (i=0; i<loop ; i++ ) {
// int cur_byte=i<<3;
// for (b=0;b<8;b++)
......@@ -441,9 +441,11 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
int input_length_words=1+((n-1)>>1);
#else
int input_length_words=1+((n-1)>>2);
#endif
#endif
for ( i=0; i< input_length_words ; i ++ ) {
#if defined(__x86_64__) || defined(__i386__)
#ifndef __AVX2__
tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],7);
......@@ -571,6 +573,7 @@ void threegpplte_turbo_encoder(unsigned char *input,
unsigned char systematic2[768] __attribute__((aligned(32)));
interleave_compact_byte(base_interleaver,input,systematic2,input_length_bytes);
#if defined(__x86_64__) || defined(__i386__)
......@@ -584,7 +587,7 @@ void threegpplte_turbo_encoder(unsigned char *input,
for ( state0=state1=i=0 ; i<input_length_bytes; i++ ) {
cur_s1=input[i];
cur_s2=systematic2[i];
for ( code_rate=0; code_rate<3; code_rate++) {
#if defined(__x86_64__) || defined(__i386__)
/*
......@@ -592,6 +595,7 @@ void threegpplte_turbo_encoder(unsigned char *input,
_mm_add_pi8(all_treillis[state0][cur_s1].parity1_64[code_rate],
all_treillis[state1][cur_s2].parity2_64[code_rate]));
*/
*ptr_output++ = _mm_add_pi8(all_treillis[state0][cur_s1].systematic_andp1_64[code_rate],
all_treillis[state1][cur_s2].parity2_64[code_rate]);
......
......@@ -44,6 +44,7 @@
///
///
#undef __AVX2__
#include "PHY/sse_intrin.h"
#ifndef TEST_DEBUG
......
......@@ -132,18 +132,18 @@ void log_map8(llr_t* systematic,
msg("log_map, frame_length %d\n",frame_length);
#endif
start_meas(gamma_stats) ;
if (gamma_stats) start_meas(gamma_stats) ;
compute_gamma8(m11,m10,systematic,y_parity,frame_length,term_flag) ;
stop_meas(gamma_stats);
start_meas(alpha_stats) ;
if (gamma_stats) stop_meas(gamma_stats);
if (alpha_stats) start_meas(alpha_stats) ;
compute_alpha8(alpha,beta,m11,m10,frame_length,F) ;
stop_meas(alpha_stats);
start_meas(beta_stats) ;
if (alpha_stats) stop_meas(alpha_stats);
if (beta_stats) start_meas(beta_stats) ;
compute_beta8(alpha,beta,m11,m10,frame_length,F,offset8_flag) ;
stop_meas(beta_stats);
start_meas(ext_stats) ;
if (beta_stats) stop_meas(beta_stats);
if (ext_stats) start_meas(ext_stats) ;
compute_ext8(alpha,beta,m11,m10,ext,systematic,frame_length) ;
stop_meas(ext_stats);
if (ext_stats) stop_meas(ext_stats);
}
......@@ -963,7 +963,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
}
start_meas(init_stats);
if (init_stats) start_meas(init_stats);
if ((n&15)>0) {
......@@ -1326,7 +1326,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
msg("\n");
#endif //DEBUG_LOGMAP
stop_meas(init_stats);
if (init_stats) stop_meas(init_stats);
// do log_map from first parity bit
......@@ -1338,7 +1338,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
printf("\n*******************ITERATION %d (n %d, n2 %d), ext %p\n\n",iteration_cnt,n,n2,ext);
#endif //DEBUG_LOGMAP
start_meas(intl1_stats);
if (intl1_stats) start_meas(intl1_stats);
pi4_p=pi4tab8[iind];
for (i=0; i<(n2>>4); i++) { // steady-state portion
......@@ -1379,7 +1379,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
#endif
}
stop_meas(intl1_stats);
if (intl1_stats) stop_meas(intl1_stats);
// do log_map from second parity bit
......@@ -1484,7 +1484,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
// Check if we decoded the block
if (iteration_cnt>1) {
start_meas(intl2_stats);
if (intl2_stats) start_meas(intl2_stats);
if ((n2&0x7f) == 0) { // n2 is a multiple of 128 bits
......@@ -1623,7 +1623,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
break;
}
stop_meas(intl2_stats);
if (intl2_stats) stop_meas(intl2_stats);
if ((crc == oldcrc) && (crc!=0)) {
return(iteration_cnt);
......
......@@ -53,7 +53,7 @@ uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
{
uint32_t RTC = (D>>5), ND, ND3;
uint32_t row,col,Kpi,index;
uint32_t row,col,Kpi;
uint32_t index3,k,k2;
#ifdef RM_DEBUG
uint32_t nulled=0;
......@@ -84,7 +84,6 @@ uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
#ifdef RM_DEBUG
printf("Col %d\n",col);
#endif
index = bitrev[col];
index3 = bitrev_x3[col];//3*index;
for (row=0; row<RTC; row++) {
......@@ -108,10 +107,7 @@ uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
#endif
index3+=96;
index+=32;
k++;
k2++;
k2++;
k++;k2+=2;
}
}
......@@ -522,7 +518,8 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
// if (rvidx==3)
// for (cnt=0;cnt<Ncb;cnt++)
// counter_buffer[rvidx][cnt]=0;
AssertFatal(Ncb>=(3*RTC<<5),"Exiting, RM condition (Ncb %d, Nir/C %d, Nsoft %d, Kw %d\n",Ncb,Nir/C,Nsoft,3*(RTC<<5));
if (Ncb>(3*(RTC<<5)))
AssertFatal(1==0,"Exiting, RM condition (Ncb %d, RTC %d, Nir/C %d, Nsoft %d, Kw %d)\n",Ncb,RTC,Nir/C,Nsoft,3*(RTC<<5));
Gp = G/Nl/Qm;
......
......@@ -153,7 +153,7 @@ int lte_segmentation(unsigned char *input_buffer,
while (k<((Kr - L)>>3)) {
output_buffers[r][k] = input_buffer[s];
// printf("encoding segment %d : byte %d => %d\n",r,k,input_buffer[s]);
// printf("encoding segment %d : byte %d (%d) => %d\n",r,k,Kr>>3,input_buffer[s]);
k++;
s++;
}
......
......@@ -31,7 +31,7 @@
#include "PHY/defs.h"
#ifdef OPENAIR_LTE
#include "SystemInformationBlockType2.h"
//#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
......@@ -41,18 +41,6 @@
#ifdef Rel10
#include "SCellToAddMod-r10.h"
#endif
#else
/**
\fn int phy_init(unsigned char nb_antennas_tx)
\brief Allocate and Initialize the PHY variables after receiving static configuration
@param nb_antennas_tx Number of TX antennas
*/
int phy_init(unsigned char nb_antennas_tx);
#endif
#ifdef OPENAIR_LTE
/** @addtogroup _PHY_STRUCTURES_
* @{
*/
......@@ -85,7 +73,6 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
\details Only a subset of phy_vars_eNb is initialized.
@param[out] phy_vars_eNb Pointer to eNB Variables
@param is_secondary_eNb Flag to indicate this eNB gets synch from another
@param cooperation_flag 0 for no cooperation, 1 for Delay Diversity and 2 for Distributed Alamouti
@param abstraction_flag 1 indicates memory should be allocated for abstracted MODEM
@returns 0 on success
@returns -1 if any memory allocation failed
......@@ -93,7 +80,6 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
*/
int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNb,
unsigned char is_secondary_eNb,
unsigned char cooperation_flag,
unsigned char abstraction_flag);
/** \brief Configure LTE_DL_FRAME_PARMS with components derived after initial synchronization (MIB decoding + primary/secondary synch).
......@@ -337,17 +323,28 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
int CC_id);
#endif
#endif
/*! !\fn void phy_cleanup(void)
\brief Cleanup the PHY variables*/
void phy_cleanup(void);
#ifdef OPENAIR_LTE
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
#endif
void lte_param_init(unsigned char N_tx,
unsigned char N_rx,
unsigned char transmission_mode,
uint8_t extended_prefix_flag,
frame_t frame_type,
uint16_t Nid_cell,
uint8_t tdd_config,
uint8_t N_RB_DL,
uint8_t threequarter_fs,
uint8_t osf,
uint32_t perfect_ce);
/** @} */
#endif
......
......@@ -45,7 +45,7 @@
*/
//#define DEBUG_PHY
t
/*
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -9,8 +9,8 @@
#include "PHY/defs.h"
#include "PHY/extern.h"
extern PHY_VARS_eNB *PHY_vars_eNB;
extern PHY_VARS_UE *PHY_vars_UE;
extern PHY_VARS_eNB *eNB;
extern PHY_VARS_UE *UE;
void lte_param_init(unsigned char N_tx,
unsigned char N_rx,
......@@ -25,13 +25,14 @@ void lte_param_init(unsigned char N_tx,
uint32_t perfect_ce)
{
LTE_DL_FRAME_PARMS *lte_frame_parms;
LTE_DL_FRAME_PARMS *frame_parms;
int i;
printf("Start lte_param_init\n");
PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
eNB = malloc(sizeof(PHY_VARS_eNB));
UE = malloc(sizeof(PHY_VARS_UE));
memset((void*)eNB,0,sizeof(PHY_VARS_eNB));
memset((void*)UE,0,sizeof(PHY_VARS_UE));
//PHY_config = malloc(sizeof(PHY_CONFIG));
mac_xface = malloc(sizeof(MAC_xface));
......@@ -39,69 +40,68 @@ void lte_param_init(unsigned char N_tx,
randominit(0);
set_taus_seed(0);
lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms);
lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
lte_frame_parms->N_RB_UL = N_RB_DL;
lte_frame_parms->threequarter_fs = threequarter_fs;
lte_frame_parms->Ncp = extended_prefix_flag;
lte_frame_parms->Ncp_UL = extended_prefix_flag;
lte_frame_parms->Nid_cell = Nid_cell;
lte_frame_parms->nushift = Nid_cell%6;
lte_frame_parms->nb_antennas_tx = N_tx;
lte_frame_parms->nb_antennas_rx = N_rx;
lte_frame_parms->nb_antennas_tx_eNB = (transmission_mode == 1)? 1 : 2;
lte_frame_parms->phich_config_common.phich_resource = oneSixth;
lte_frame_parms->phich_config_common.phich_duration = normal;
lte_frame_parms->tdd_config = tdd_config;
lte_frame_parms->frame_type = frame_type;
// lte_frame_parms->Csrs = 2;
// lte_frame_parms->Bsrs = 0;
// lte_frame_parms->kTC = 0;44
// lte_frame_parms->n_RRC = 0;
lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
init_frame_parms(lte_frame_parms,osf);
//copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
// phy_init_top(lte_frame_parms); //allocation
PHY_vars_UE->is_secondary_ue = 0;
PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
PHY_vars_eNB->lte_frame_parms = *lte_frame_parms;
phy_init_lte_top(lte_frame_parms);
dump_frame_parms(lte_frame_parms);
PHY_vars_UE->PHY_measurements.n_adj_cells=0;
PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1;
PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
frame_parms = &(eNB->frame_parms);
frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
frame_parms->N_RB_UL = N_RB_DL;
frame_parms->threequarter_fs = threequarter_fs;
frame_parms->Ncp = extended_prefix_flag;
frame_parms->Ncp_UL = extended_prefix_flag;
frame_parms->Nid_cell = Nid_cell;
frame_parms->nushift = Nid_cell%6;
frame_parms->nb_antennas_tx = N_tx;
frame_parms->nb_antennas_rx = N_rx;
frame_parms->nb_antennas_tx_eNB = N_tx;
frame_parms->phich_config_common.phich_resource = oneSixth;
frame_parms->phich_config_common.phich_duration = normal;
frame_parms->tdd_config = tdd_config;
frame_parms->frame_type = frame_type;
// frame_parms->Csrs = 2;
// frame_parms->Bsrs = 0;
// frame_parms->kTC = 0;44
// frame_parms->n_RRC = 0;
frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
init_frame_parms(frame_parms,osf);
//copy_lte_parms_to_phy_framing(frame_parms, &(PHY_config->PHY_framing));
// phy_init_top(frame_parms); //allocation
UE->is_secondary_ue = 0;
UE->frame_parms = *frame_parms;
eNB->frame_parms = *frame_parms;
phy_init_lte_top(frame_parms);
dump_frame_parms(frame_parms);
UE->measurements.n_adj_cells=0;
UE->measurements.adj_cell_id[0] = Nid_cell+1;
UE->measurements.adj_cell_id[1] = Nid_cell+2;
for (i=0; i<3; i++)
lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
lte_gold(frame_parms,UE->lte_gold_table[i],Nid_cell+i);
phy_init_lte_ue(PHY_vars_UE,1,0);
phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
phy_init_lte_ue(UE,1,0);
phy_init_lte_eNB(eNB,0,0);
generate_pcfich_reg_mapping(&PHY_vars_UE->lte_frame_parms);
generate_phich_reg_mapping(&PHY_vars_UE->lte_frame_parms);
generate_pcfich_reg_mapping(&UE->frame_parms);
generate_phich_reg_mapping(&UE->frame_parms);
// DL power control init
if (transmission_mode == 1) {
PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_eNB->lte_frame_parms).pdsch_config_common).p_b = 0;
PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 0;
eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((eNB->frame_parms).pdsch_config_common).p_b = 0;
UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((UE->frame_parms).pdsch_config_common).p_b = 0;
} else { // rho_a = rhob
PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_eNB->lte_frame_parms).pdsch_config_common).p_b = 1;
PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 1;
eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((eNB->frame_parms).pdsch_config_common).p_b = 1;
UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((UE->frame_parms).pdsch_config_common).p_b = 1;
}
PHY_vars_UE->perfect_ce = perfect_ce;
UE->perfect_ce = perfect_ce;
printf("Done lte_param_init\n");
......
......@@ -30,131 +30,50 @@
#include "PHY/defs.h"
#include "PHY/extern.h"
#ifdef EXMIMO
#include "openair0_lib.h"
extern int card;
#endif
void
phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, uint32_t rx_power_fil_dB, uint8_t eNB_id)
phy_adjust_gain (PHY_VARS_UE *ue, uint32_t rx_power_fil_dB, uint8_t eNB_id)
{
#ifdef EXMIMO
exmimo_config_t *p_exmimo_config = openair0_exmimo_pci[card].exmimo_config_ptr;
uint16_t i;
#endif
LOG_D(PHY,"Gain control: rssi %d (%d,%d)\n",
rx_power_fil_dB,
phy_vars_ue->PHY_measurements.rssi,
phy_vars_ue->PHY_measurements.rx_power_avg_dB[eNB_id]
rx_power_fil_dB,
ue->measurements.rssi,
ue->measurements.rx_power_avg_dB[eNB_id]
);
// Gain control with hysterisis
// Adjust gain in phy_vars_ue->rx_vars[0].rx_total_gain_dB
// Adjust gain in ue->rx_vars[0].rx_total_gain_dB
if (rx_power_fil_dB < TARGET_RX_POWER - 5) //&& (phy_vars_ue->rx_total_gain_dB < MAX_RF_GAIN) )
phy_vars_ue->rx_total_gain_dB+=5;
else if (rx_power_fil_dB > TARGET_RX_POWER + 5) //&& (phy_vars_ue->rx_total_gain_dB > MIN_RF_GAIN) )
phy_vars_ue->rx_total_gain_dB-=5;
if (rx_power_fil_dB < TARGET_RX_POWER - 5) //&& (ue->rx_total_gain_dB < MAX_RF_GAIN) )
ue->rx_total_gain_dB+=5;
else if (rx_power_fil_dB > TARGET_RX_POWER + 5) //&& (ue->rx_total_gain_dB > MIN_RF_GAIN) )
ue->rx_total_gain_dB-=5;
if (phy_vars_ue->rx_total_gain_dB>MAX_RF_GAIN) {
if (ue->rx_total_gain_dB>MAX_RF_GAIN) {
/*
if ((openair_daq_vars.rx_rf_mode==0) && (openair_daq_vars.mode == openair_NOT_SYNCHED)) {
openair_daq_vars.rx_rf_mode=1;
phy_vars_ue->rx_total_gain_dB = max(MIN_RF_GAIN,MAX_RF_GAIN-25);
ue->rx_total_gain_dB = max(MIN_RF_GAIN,MAX_RF_GAIN-25);
}
else {
*/
phy_vars_ue->rx_total_gain_dB = MAX_RF_GAIN;
} else if (phy_vars_ue->rx_total_gain_dB<MIN_RF_GAIN) {
ue->rx_total_gain_dB = MAX_RF_GAIN;
} else if (ue->rx_total_gain_dB<MIN_RF_GAIN) {
/*
if ((openair_daq_vars.rx_rf_mode==1) && (openair_daq_vars.mode == openair_NOT_SYNCHED)) {
openair_daq_vars.rx_rf_mode=0;
phy_vars_ue->rx_total_gain_dB = min(MAX_RF_GAIN,MIN_RF_GAIN+25);
ue->rx_total_gain_dB = min(MAX_RF_GAIN,MIN_RF_GAIN+25);
}
else {
*/
phy_vars_ue->rx_total_gain_dB = MIN_RF_GAIN;
ue->rx_total_gain_dB = MIN_RF_GAIN;
}
LOG_D(PHY,"Gain control: rx_total_gain_dB = %d (max %d,rxpf %d)\n",phy_vars_ue->rx_total_gain_dB,MAX_RF_GAIN,rx_power_fil_dB);
#ifdef EXMIMO
if (phy_vars_ue->rx_total_gain_dB>phy_vars_ue->rx_gain_max[0]) {
phy_vars_ue->rx_total_gain_dB = phy_vars_ue->rx_gain_max[0];
for (i=0; i<phy_vars_ue->lte_frame_parms.nb_antennas_rx; i++) {
p_exmimo_config->rf.rx_gain[i][0] = 30;
}
} else if (phy_vars_ue->rx_total_gain_dB<(phy_vars_ue->rx_gain_max[0]-30)) {
// for the moment we stay in max gain mode
phy_vars_ue->rx_total_gain_dB = phy_vars_ue->rx_gain_max[0] - 30;
for (i=0; i<phy_vars_ue->lte_frame_parms.nb_antennas_rx; i++) {
p_exmimo_config->rf.rx_gain[i][0] = 0;
}
/*
phy_vars_ue->rx_gain_mode[0] = byp;
phy_vars_ue->rx_gain_mode[1] = byp;
exmimo_pci_interface->rf.rf_mode0 = 22991; //bypass
exmimo_pci_interface->rf.rf_mode1 = 22991; //bypass
if (phy_vars_ue->rx_total_gain_dB<(phy_vars_ue->rx_gain_byp[0]-50)) {
exmimo_pci_interface->rf.rx_gain00 = 0;
exmimo_pci_interface->rf.rx_gain10 = 0;
}
*/
} else {
for (i=0; i<phy_vars_ue->lte_frame_parms.nb_antennas_rx; i++) {
p_exmimo_config->rf.rx_gain[i][0] = 30 - phy_vars_ue->rx_gain_max[0] + phy_vars_ue->rx_total_gain_dB;
}
}
/*
break;
case med_gain:
case byp_gain:
if (phy_vars_ue->rx_total_gain_dB>phy_vars_ue->rx_gain_byp[0]) {
phy_vars_ue->rx_gain_mode[0] = max_gain;
phy_vars_ue->rx_gain_mode[1] = max_gain;
exmimo_pci_interface->rf.rf_mode0 = 55759; //max gain
exmimo_pci_interface->rf.rf_mode1 = 55759; //max gain
if (phy_vars_ue->rx_total_gain_dB>phy_vars_ue->rx_gain_max[0]) {
exmimo_pci_interface->rf.rx_gain00 = 50;
exmimo_pci_interface->rf.rx_gain10 = 50;
}
else {
exmimo_pci_interface->rf.rx_gain00 = 50 - phy_vars_ue->rx_gain_max[0] + phy_vars_ue->rx_total_gain_dB;
exmimo_pci_interface->rf.rx_gain10 = 50 - phy_vars_ue->rx_gain_max[1] + phy_vars_ue->rx_total_gain_dB;
}
}
else if (phy_vars_ue->rx_total_gain_dB<(phy_vars_ue->rx_gain_byp[0]-50)) {
exmimo_pci_interface->rf.rx_gain00 = 0;
exmimo_pci_interface->rf.rx_gain10 = 0;
}
else {
exmimo_pci_interface->rf.rx_gain00 = 50 - phy_vars_ue->rx_gain_byp[0] + phy_vars_ue->rx_total_gain_dB;
exmimo_pci_interface->rf.rx_gain10 = 50 - phy_vars_ue->rx_gain_byp[1] + phy_vars_ue->rx_total_gain_dB;
}
break;
default:
exmimo_pci_interface->rf.rx_gain00 = 50;
exmimo_pci_interface->rf.rx_gain10 = 50;
break;
}
*/
#endif
LOG_D(PHY,"Gain control: rx_total_gain_dB = %d (max %d,rxpf %d)\n",ue->rx_total_gain_dB,MAX_RF_GAIN,rx_power_fil_dB);
#ifdef DEBUG_PHY
/* if ((phy_vars_ue->frame%100==0) || (phy_vars_ue->frame < 10))
/* if ((ue->frame%100==0) || (ue->frame < 10))
msg("[PHY][ADJUST_GAIN] frame %d, rx_power = %d, rx_power_fil = %d, rx_power_fil_dB = %d, coef=%d, ncoef=%d, rx_total_gain_dB = %d (%d,%d,%d)\n",
phy_vars_ue->frame,rx_power,rx_power_fil,rx_power_fil_dB,coef,ncoef,phy_vars_ue->rx_total_gain_dB,
ue->frame,rx_power,rx_power_fil,rx_power_fil_dB,coef,ncoef,ue->rx_total_gain_dB,
TARGET_RX_POWER,MAX_RF_GAIN,MIN_RF_GAIN);
*/
#endif //DEBUG_PHY
......
......@@ -217,9 +217,9 @@ void phy_adjust_gain (PHY_VARS_UE *phy_vars_ue,
unsigned char eNB_id);
int lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
eNB_rxtx_proc_t *proc,
module_id_t eNB_id,
module_id_t UE_id,
uint8_t subframe,
uint8_t l,
uint8_t Ns,
uint8_t cooperation_flag);
......@@ -242,7 +242,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
unsigned char number_of_cards,
short coef);
int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,module_id_t UE_id,uint8_t subframe);
int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,module_id_t UE_id);
void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
int subframe,
......
......@@ -30,6 +30,8 @@
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#define DEBUG_PHY
// Adjust location synchronization point to account for drift
......@@ -37,7 +39,7 @@
// last channel estimate of the receiver
void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
PHY_VARS_UE *phy_vars_ue,
PHY_VARS_UE *ue,
unsigned char eNB_id,
unsigned char clear,
short coef)
......@@ -48,10 +50,12 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
int diff;
short Re,Im,ncoef;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ADJUST_SYNCH, VCD_FUNCTION_IN);
ncoef = 32767 - coef;
#ifdef DEBUG_PHY
LOG_D(PHY,"frame %d, slot %d: rx_offset (before) = %d\n",phy_vars_ue->frame_rx,phy_vars_ue->slot_rx,phy_vars_ue->rx_offset);
LOG_D(PHY,"frame %d: rx_offset (before) = %d\n",ue->proc.proc_rxtx[0].frame_rx,ue->rx_offset);
#endif //DEBUG_PHY
......@@ -60,8 +64,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
temp = 0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
Re = ((int16_t*)phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_id][aa])[(i<<2)];
Im = ((int16_t*)phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_id][aa])[1+(i<<2)];
Re = ((int16_t*)ue->common_vars.dl_ch_estimates_time[eNB_id][aa])[(i<<2)];
Im = ((int16_t*)ue->common_vars.dl_ch_estimates_time[eNB_id][aa])[1+(i<<2)];
temp += (Re*Re/2) + (Im*Im/2);
}
......@@ -81,29 +85,30 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
diff = max_pos_fil - frame_parms->nb_prefix_samples/8;
if ( diff > SYNCH_HYST )
phy_vars_ue->rx_offset++;
ue->rx_offset++;
else if (diff < -SYNCH_HYST)
phy_vars_ue->rx_offset--;
ue->rx_offset--;
if ( phy_vars_ue->rx_offset < 0 )
phy_vars_ue->rx_offset += FRAME_LENGTH_COMPLEX_SAMPLES;
if ( ue->rx_offset < 0 )
ue->rx_offset += FRAME_LENGTH_COMPLEX_SAMPLES;
if ( phy_vars_ue->rx_offset >= FRAME_LENGTH_COMPLEX_SAMPLES )
phy_vars_ue->rx_offset -= FRAME_LENGTH_COMPLEX_SAMPLES;
if ( ue->rx_offset >= FRAME_LENGTH_COMPLEX_SAMPLES )
ue->rx_offset -= FRAME_LENGTH_COMPLEX_SAMPLES;
#ifdef DEBUG_PHY
LOG_D(PHY,"frame %d: rx_offset (after) = %d : max_pos = %d,max_pos_fil = %d (peak %d)\n",
phy_vars_ue->frame_rx,phy_vars_ue->rx_offset,max_pos,max_pos_fil,temp);
ue->proc.proc_rxtx[0].frame_rx,ue->rx_offset,max_pos,max_pos_fil,temp);
#endif //DEBUG_PHY
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ADJUST_SYNCH, VCD_FUNCTION_OUT);
}
int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
LTE_eNB_SRS *lte_eNb_srs,
LTE_eNB_SRS *lte_eNB_srs,
unsigned int *eNB_id,
unsigned char clear,
unsigned char number_of_cards,
......@@ -133,23 +138,23 @@ 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[ind][aa][0],
(int16_t*) lte_eNb_srs->srs_ch_estimates_time[ind][aa],
dft128((int16_t*) &lte_eNB_srs->srs_ch_estimates[ind][aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[ind][aa],
1);
break;
case 25:
dft512((int16_t*) &lte_eNb_srs->srs_ch_estimates[ind][aa][0],
(int16_t*) lte_eNb_srs->srs_ch_estimates_time[ind][aa],
dft512((int16_t*) &lte_eNB_srs->srs_ch_estimates[ind][aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[ind][aa],
1);
break;
case 50:
dft1024((int16_t*) &lte_eNb_srs->srs_ch_estimates[ind][aa][0],
(int16_t*) lte_eNb_srs->srs_ch_estimates_time[ind][aa],
dft1024((int16_t*) &lte_eNB_srs->srs_ch_estimates[ind][aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[ind][aa],
1);
break;
case 100:
dft2048((int16_t*) &lte_eNb_srs->srs_ch_estimates[ind][aa][0],
(int16_t*) lte_eNb_srs->srs_ch_estimates_time[ind][aa],
dft2048((int16_t*) &lte_eNB_srs->srs_ch_estimates[ind][aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[ind][aa],
1);
break;
}
......@@ -157,7 +162,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
#ifdef DEBUG_PHY
sprintf(fname,"srs_ch_estimates_time_%d%d.m",ind,aa);
sprintf(vname,"srs_time_%d%d",ind,aa);
write_output(fname,vname,lte_eNb_srs->srs_ch_estimates_time[ind][aa],frame_parms->ofdm_symbol_size*2,2,1);
write_output(fname,vname,lte_eNB_srs->srs_ch_estimates_time[ind][aa],frame_parms->ofdm_symbol_size*2,2,1);
#endif
#endif
}
......@@ -168,8 +173,8 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
temp = 0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
Re = ((int16_t*)lte_eNb_srs->srs_ch_estimates_time[ind][aa])[(i<<1)];
Im = ((int16_t*)lte_eNb_srs->srs_ch_estimates_time[ind][aa])[1+(i<<1)];
Re = ((int16_t*)lte_eNB_srs->srs_ch_estimates_time[ind][aa])[(i<<1)];
Im = ((int16_t*)lte_eNB_srs->srs_ch_estimates_time[ind][aa])[1+(i<<1)];
temp += (Re*Re/2) + (Im*Im/2);
}
......@@ -195,7 +200,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
}
int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_t sched_subframe)
int lte_est_timing_advance_pusch(PHY_VARS_eNB* eNB,uint8_t UE_id)
{
static int first_run=1;
static int max_pos_fil2=0;
......@@ -203,8 +208,8 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_
short Re,Im,coef=24576;
short ncoef = 32768 - coef;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms;
LTE_eNB_PUSCH *eNB_pusch_vars = phy_vars_eNB->lte_eNB_pusch_vars[UE_id];
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
LTE_eNB_PUSCH *eNB_pusch_vars = eNB->pusch_vars[UE_id];
int32_t **ul_ch_estimates_time= eNB_pusch_vars->drs_ch_estimates_time[0];
uint8_t cyclic_shift = 0;
int sync_pos = (frame_parms->ofdm_symbol_size-cyclic_shift*frame_parms->ofdm_symbol_size/12)%(frame_parms->ofdm_symbol_size);
......@@ -236,7 +241,7 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_
max_pos_fil2 = ((max_pos_fil2 * coef) + (max_pos * ncoef)) >> 15;
#ifdef DEBUG_PHY
LOG_D(PHY,"frame %d: max_pos = %d, max_pos_fil = %d, sync_pos=%d\n",phy_vars_eNB->proc[sched_subframe].frame_rx,max_pos,max_pos_fil2,sync_pos);
LOG_D(PHY,"frame %d: max_pos = %d, max_pos_fil = %d, sync_pos=%d\n",eNB->proc.frame_rx,max_pos,max_pos_fil2,sync_pos);
#endif //DEBUG_PHY
return(max_pos_fil2-sync_pos);
......
......@@ -82,7 +82,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
//compute frequency-domain representation of 6144-sample chunk
rxp = &ue->lte_ue_common_vars.rxdata[0][i];
rxp = &ue->common_vars.rxdata[0][i];
sp=spectrum;
while (1) {
......@@ -341,8 +341,8 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
} // loop on pss index
}
if (rxp == &ue->lte_ue_common_vars.rxdata[0][i+38400*4]) {
rxp = &ue->lte_ue_common_vars.rxdata[0][i+38400*4];
if (rxp == &ue->common_vars.rxdata[0][i+38400*4]) {
rxp = &ue->common_vars.rxdata[0][i+38400*4];
sp=spectrum_p5ms;
} else {
break;
......
......@@ -53,29 +53,29 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32
#define SCALE 0x3FFF
int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
uint8_t eNB_id,
uint8_t UE_id,
uint8_t sched_subframe,
unsigned char l,
unsigned char Ns,
uint8_t cooperation_flag)
{
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms;
LTE_eNB_PUSCH *eNB_pusch_vars = phy_vars_eNB->lte_eNB_pusch_vars[UE_id];
int32_t **ul_ch_estimates=eNB_pusch_vars->drs_ch_estimates[eNB_id];
int32_t **ul_ch_estimates_time= eNB_pusch_vars->drs_ch_estimates_time[eNB_id];
int32_t **ul_ch_estimates_0= eNB_pusch_vars->drs_ch_estimates_0[eNB_id];
int32_t **ul_ch_estimates_1= eNB_pusch_vars->drs_ch_estimates_1[eNB_id];
int32_t **rxdataF_ext= eNB_pusch_vars->rxdataF_ext[eNB_id];
int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
uint8_t harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[sched_subframe].frame_rx,subframe);
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
LTE_eNB_PUSCH *pusch_vars = eNB->pusch_vars[UE_id];
int32_t **ul_ch_estimates=pusch_vars->drs_ch_estimates[eNB_id];
int32_t **ul_ch_estimates_time= pusch_vars->drs_ch_estimates_time[eNB_id];
int32_t **ul_ch_estimates_0= pusch_vars->drs_ch_estimates_0[eNB_id];
int32_t **ul_ch_estimates_1= pusch_vars->drs_ch_estimates_1[eNB_id];
int32_t **rxdataF_ext= pusch_vars->rxdataF_ext[eNB_id];
int subframe = proc->subframe_rx;
uint8_t harq_pid = subframe2harq_pid(frame_parms,proc->frame_rx,subframe);
int16_t delta_phase = 0;
int16_t *ru1 = ru_90;
int16_t *ru2 = ru_90;
int16_t current_phase1,current_phase2;
uint16_t N_rb_alloc = phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->nb_rb;
uint16_t N_rb_alloc = eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb;
uint16_t aa,Msc_RS,Msc_RS_idx;
uint16_t * Msc_idx_ptr;
int k,pilot_pos1 = 3 - frame_parms->Ncp, pilot_pos2 = 10 - 2*frame_parms->Ncp;
......@@ -117,7 +117,7 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
Msc_RS = N_rb_alloc*12;
cyclic_shift = (frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->n_DMRS2 +
eNB->ulsch[UE_id]->harq_processes[harq_pid]->n_DMRS2 +
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[(subframe<<1)+Ns]) % 12;
#if defined(USER_MODE)
......@@ -335,7 +335,7 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
#if T_TRACER
if (aa == 0)
T(T_ENB_PHY_UL_CHANNEL_ESTIMATE, T_INT(eNB_id), T_INT(UE_id),
T_INT(phy_vars_eNB->proc[sched_subframe].frame_rx), T_INT(subframe),
T_INT(proc->frame_rx), T_INT(subframe),
T_INT(0), T_BUFFER(ul_ch_estimates_time[0], 512 * 4));
#endif
......@@ -677,11 +677,11 @@ extern uint16_t transmission_offset_tdd[16];
#define DEBUG_SRS
int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
LTE_eNB_COMMON *eNb_common_vars,
LTE_eNB_SRS *eNb_srs_vars,
LTE_eNB_COMMON *common_vars,
LTE_eNB_SRS *srs_vars,
SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated,
unsigned char sub_frame_number,
unsigned char eNb_id)
unsigned char eNB_id)
{
int T_SFC,aa;
......@@ -698,7 +698,7 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
T_SFC = (Ssrs<=7 ? 5 : 10);
/*
msg("SRS channel estimation eNb %d, subframs %d, %d %d %d %d %d\n",eNb_id,sub_frame_number,
msg("SRS channel estimation eNB %d, subframs %d, %d %d %d %d %d\n",eNB_id,sub_frame_number,
SRS_parms->Csrs,
SRS_parms->Bsrs,
SRS_parms->kTC,
......@@ -710,34 +710,34 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
if (generate_srs_rx(frame_parms,
soundingrs_ul_config_dedicated,
eNb_srs_vars->srs)==-1) {
srs_vars->srs)==-1) {
msg("lte_srs_channel_estimation: Error in generate_srs_rx\n");
return(-1);
}
for (aa=0; aa<nb_antennas_rx; aa++) {
#ifdef DEBUG_SRS
msg("SRS channel estimation eNb %d, subframs %d, aarx %d, %p, %p, %p\n",eNb_id,sub_frame_number,aa,
&eNb_common_vars->rxdataF[eNb_id][aa][2*frame_parms->ofdm_symbol_size*symbol],
eNb_srs_vars->srs,
eNb_srs_vars->srs_ch_estimates[eNb_id][aa]);
msg("SRS channel estimation eNB %d, subframs %d, aarx %d, %p, %p, %p\n",eNB_id,sub_frame_number,aa,
&common_vars->rxdataF[eNB_id][aa][2*frame_parms->ofdm_symbol_size*symbol],
srs_vars->srs,
srs_vars->srs_ch_estimates[eNB_id][aa]);
#endif
//write_output("eNb_rxF.m","rxF",&eNb_common_vars->rxdataF[0][aa][2*frame_parms->ofdm_symbol_size*symbol],2*(frame_parms->ofdm_symbol_size),2,1);
//write_output("eNb_srs.m","srs_eNb",eNb_common_vars->srs,(frame_parms->ofdm_symbol_size),1,1);
//write_output("eNB_rxF.m","rxF",&common_vars->rxdataF[0][aa][2*frame_parms->ofdm_symbol_size*symbol],2*(frame_parms->ofdm_symbol_size),2,1);
//write_output("eNB_srs.m","srs_eNB",common_vars->srs,(frame_parms->ofdm_symbol_size),1,1);
mult_cpx_conj_vector((int16_t*) &eNb_common_vars->rxdataF[eNb_id][aa][2*frame_parms->ofdm_symbol_size*symbol],
(int16_t*) eNb_srs_vars->srs,
(int16_t*) eNb_srs_vars->srs_ch_estimates[eNb_id][aa],
mult_cpx_conj_vector((int16_t*) &common_vars->rxdataF[eNB_id][aa][2*frame_parms->ofdm_symbol_size*symbol],
(int16_t*) srs_vars->srs,
(int16_t*) srs_vars->srs_ch_estimates[eNB_id][aa],
frame_parms->ofdm_symbol_size,
15);
//msg("SRS channel estimation cmult out\n");
#ifdef USER_MODE
#ifdef DEBUG_SRS
sprintf(fname,"eNB_id%d_an%d_srs_ch_est.m",eNb_id,aa);
sprintf(vname,"eNB%d_%d_srs_ch_est",eNb_id,aa);
write_output(fname,vname,eNb_srs_vars->srs_ch_estimates[eNb_id][aa],frame_parms->ofdm_symbol_size,1,1);
sprintf(fname,"eNB_id%d_an%d_srs_ch_est.m",eNB_id,aa);
sprintf(vname,"eNB%d_%d_srs_ch_est",eNB_id,aa);
write_output(fname,vname,srs_vars->srs_ch_estimates[eNB_id][aa],frame_parms->ofdm_symbol_size,1,1);
#endif
#endif
}
......@@ -746,7 +746,7 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
/*
else {
for (aa=0;aa<nb_antennas_rx;aa++)
bzero(eNb_srs_vars->srs_ch_estimates[eNb_id][aa],frame_parms->ofdm_symbol_size*sizeof(int));
bzero(srs_vars->srs_ch_estimates[eNB_id][aa],frame_parms->ofdm_symbol_size*sizeof(int));
}
*/
return(0);
......
......@@ -40,7 +40,7 @@
//Calibration
int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
int lte_dl_cell_spec_SS(PHY_VARS_eNB *eNB,
int32_t *output,
short amp,
unsigned char Ns,
......@@ -76,27 +76,27 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
return(-1);
}
mprime = 110 - phy_vars_eNB->lte_frame_parms.N_RB_DL;
mprime = 110 - eNB->frame_parms.N_RB_DL;
k = (nu + phy_vars_eNB->lte_frame_parms.nushift);
k = (nu + eNB->frame_parms.nushift);
if (k > 6)//b
k -=6;//b
k+=phy_vars_eNB->lte_frame_parms.first_carrier_offset;
k+=eNB->frame_parms.first_carrier_offset;
for (m=0; m<phy_vars_eNB->lte_frame_parms.N_RB_DL<<1; m++) { // loop over pilots in one slot/symbol, 2*N_RB_DL pilots
for (m=0; m<eNB->frame_parms.N_RB_DL<<1; m++) { // loop over pilots in one slot/symbol, 2*N_RB_DL pilots
mprime_dword = mprime>>4;
mprime_qpsk_symb = mprime&0xf;
// this is r_mprime from 3GPP 36-211 6.10.1.2
output[k] = qpsk[(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
output[k] = qpsk[(eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
//output[k] = (lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3;
#ifdef DEBUG_DL_CELL_SPEC
printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb);
printf("index = %d (k %d)\n",(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
printf("index = %d (k %d)\n",(eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
#endif
mprime++;
......@@ -108,9 +108,9 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
#endif
k+=6;//b
if (k >= phy_vars_eNB->lte_frame_parms.ofdm_symbol_size) {
if (k >= eNB->frame_parms.ofdm_symbol_size) {
k++; // skip DC carrier
k-=phy_vars_eNB->lte_frame_parms.ofdm_symbol_size;
k-=eNB->frame_parms.ofdm_symbol_size;
}
// printf("** k %d\n",k);
......@@ -120,7 +120,7 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
}
int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
int lte_dl_cell_spec(PHY_VARS_eNB *eNB,
int32_t *output,
short amp,
unsigned char Ns,
......@@ -155,31 +155,31 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
return(-1);
}
mprime = 110 - phy_vars_eNB->lte_frame_parms.N_RB_DL;
mprime = 110 - eNB->frame_parms.N_RB_DL;
k = (nu + phy_vars_eNB->lte_frame_parms.nushift);
k = (nu + eNB->frame_parms.nushift);
if (k > 5)
k -=6;
k+=phy_vars_eNB->lte_frame_parms.first_carrier_offset;
k+=eNB->frame_parms.first_carrier_offset;
DevAssert( Ns < 20 );
DevAssert( l < 2 );
DevAssert( mprime>>4 < 14 );
for (m=0; m<phy_vars_eNB->lte_frame_parms.N_RB_DL<<1; m++) {
for (m=0; m<eNB->frame_parms.N_RB_DL<<1; m++) {
mprime_dword = mprime>>4;
mprime_qpsk_symb = mprime&0xf;
// this is r_mprime from 3GPP 36-211 6.10.1.2
output[k] = qpsk[(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
output[k] = qpsk[(eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
//output[k] = (lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3;
#ifdef DEBUG_DL_CELL_SPEC
printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb);
printf("index = %d (k %d)\n",(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
printf("index = %d (k %d)\n",(eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
#endif
mprime++;
......@@ -191,9 +191,9 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
#endif
k+=6;
if (k >= phy_vars_eNB->lte_frame_parms.ofdm_symbol_size) {
if (k >= eNB->frame_parms.ofdm_symbol_size) {
k++; // skip DC carrier
k-=phy_vars_eNB->lte_frame_parms.ofdm_symbol_size;
k-=eNB->frame_parms.ofdm_symbol_size;
}
// printf("** k %d\n",k);
......@@ -202,7 +202,7 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
return(0);
}
int lte_dl_cell_spec_rx(PHY_VARS_UE *phy_vars_ue,
int lte_dl_cell_spec_rx(PHY_VARS_UE *ue,
uint8_t eNB_offset,
int *output,
unsigned char Ns,
......@@ -230,19 +230,19 @@ int lte_dl_cell_spec_rx(PHY_VARS_UE *phy_vars_ue,
((short *)&qpsk[3])[0] = -pamp;
((short *)&qpsk[3])[1] = pamp;
mprime = 110 - phy_vars_ue->lte_frame_parms.N_RB_DL;
mprime = 110 - ue->frame_parms.N_RB_DL;
for (m=0; m<phy_vars_ue->lte_frame_parms.N_RB_DL<<1; m++) {
for (m=0; m<ue->frame_parms.N_RB_DL<<1; m++) {
mprime_dword = mprime>>4;
mprime_qpsk_symb = mprime&0xf;
// this is r_mprime from 3GPP 36-211 6.10.1.2
output[k] = qpsk[(phy_vars_ue->lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
output[k] = qpsk[(ue->lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
#ifdef DEBUG_DL_CELL_SPEC
printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb);
printf("index = %d (k %d)\n",(phy_vars_ue->lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
printf("index = %d (k %d)\n",(ue->lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
#endif
mprime++;
......
......@@ -39,7 +39,7 @@
//extern unsigned int lte_gold_table[10][3][42];
//#define DEBUG_DL_MBSFN
int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output,
int lte_dl_mbsfn(PHY_VARS_eNB *eNB, int32_t *output,
short amp,
int subframe,
unsigned char l)
......@@ -62,9 +62,9 @@ int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output,
((short *)&qpsk[3])[1] = -a;
mprime = 3*(110 - phy_vars_eNB->lte_frame_parms.N_RB_DL);
mprime = 3*(110 - eNB->frame_parms.N_RB_DL);
for (m=0; m<phy_vars_eNB->lte_frame_parms.N_RB_DL*6; m++) {
for (m=0; m<eNB->frame_parms.N_RB_DL*6; m++) {
if ((l==0) || (l==2))
k = m<<1;
......@@ -75,24 +75,24 @@ int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output,
return(-1);
}
k+=phy_vars_eNB->lte_frame_parms.first_carrier_offset;
k+=eNB->frame_parms.first_carrier_offset;
mprime_dword = mprime>>4;
mprime_qpsk_symb = mprime&0xf;
if (k >= phy_vars_eNB->lte_frame_parms.ofdm_symbol_size) {
if (k >= eNB->frame_parms.ofdm_symbol_size) {
k++; // skip DC carrier
k-=phy_vars_eNB->lte_frame_parms.ofdm_symbol_size;
k-=eNB->frame_parms.ofdm_symbol_size;
}
output[k] = qpsk[(phy_vars_eNB->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
output[k] = qpsk[(eNB->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
//output[k] = (lte_gold_table[eNB_offset][subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3;
#ifdef DEBUG_DL_MBSFN
msg("subframe %d, l %d, m %d, mprime %d, mprime_dword %d, mprime_qpsk_symbol %d\n",
subframe,l,m,mprime,mprime_dword,mprime_qpsk_symb);
msg("index = %d (k %d)(%x)\n",(phy_vars_eNB->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k,phy_vars_eNB->lte_gold_mbsfn_table[subframe][l][mprime_dword]);
msg("index = %d (k %d)(%x)\n",(eNB->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k,eNB->lte_gold_mbsfn_table[subframe][l][mprime_dword]);
#endif
mprime++;
......@@ -110,7 +110,7 @@ int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output,
int lte_dl_mbsfn_rx(PHY_VARS_UE *phy_vars_ue,
int lte_dl_mbsfn_rx(PHY_VARS_UE *ue,
int *output,
int subframe,
unsigned char l)
......@@ -131,20 +131,20 @@ int lte_dl_mbsfn_rx(PHY_VARS_UE *phy_vars_ue,
((short *)&qpsk[3])[0] = -ONE_OVER_SQRT2_Q15;
((short *)&qpsk[3])[1] = ONE_OVER_SQRT2_Q15;
mprime = 3*(110 - phy_vars_ue->lte_frame_parms.N_RB_DL);
mprime = 3*(110 - ue->frame_parms.N_RB_DL);
for (m=0; m<phy_vars_ue->lte_frame_parms.N_RB_DL*6; m++) {
for (m=0; m<ue->frame_parms.N_RB_DL*6; m++) {
mprime_dword = mprime>>4;
mprime_qpsk_symb = mprime&0xf;
// this is r_mprime from 3GPP 36-211 6.10.1.2
output[k] = qpsk[(phy_vars_ue->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
output[k] = qpsk[(ue->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
#ifdef DEBUG_DL_MBSFN
printf("subframe %d, l %d, m %d, mprime %d, mprime_dword %d, mprime_qpsk_symbol %d\n",
subframe,l,m,mprime, mprime_dword,mprime_qpsk_symb);
printf("index = %d (k %d) (%x)\n",(phy_vars_ue->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k,phy_vars_ue->lte_gold_mbsfn_table[subframe][l][mprime_dword]);
printf("index = %d (k %d) (%x)\n",(ue->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k,ue->lte_gold_mbsfn_table[subframe][l][mprime_dword]);
#endif
mprime++;
......
......@@ -52,7 +52,7 @@
int Wbar_NCP[8][4] = {{1,1,1,1},{1,-1,1,-1},{1,1,1,1},{1,-1,1,-1},{1,1,-1,-1},{-1,-1,1,1},{1,-1,-1,1},{-1,1,1,-1}};
int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
int lte_dl_ue_spec(PHY_VARS_eNB *eNB,
uint8_t UE_id,
int32_t *output,
short amp,
......@@ -64,7 +64,7 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
int32_t qpsk[4],nqpsk[4],*qpsk_p,*output_p;
int16_t a;
int w,lprime,ind,l,ind_dword,ind_qpsk_symb,nPRB;
// LTE_eNB_DLSCH_t *dlsch = phy_vars_eNB->dlsch_eNB[UE_id][0];
// LTE_eNB_DLSCH_t *dlsch = eNB->dlsch_eNB[UE_id][0];
a = (amp*ONE_OVER_SQRT2_Q15)>>15;
((short *)&qpsk[0])[0] = a;
......@@ -87,13 +87,13 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
if (p>=7) {
if (SS_flag==0) {
if (phy_vars_eNB->lte_frame_parms.Ncp == NORMAL) {
if (eNB->frame_parms.Ncp == NORMAL) {
// this is 3GPP 36-211 6.10.3.2, NORMAL CP, p>=7
// position output pointer to 5th symbol in slot
output_p = output+(60*phy_vars_eNB->lte_frame_parms.N_RB_DL);
output_p = output+(60*eNB->frame_parms.N_RB_DL);
// shift to 2nd RE in PRB for p=7,8,11,13
if ((p==7) || (p==8) || (p==11) || (p==13)) output_p++;
......@@ -101,12 +101,12 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
for (lprime=0; lprime<2; lprime++) {
ind = 3*lprime*phy_vars_eNB->lte_frame_parms.N_RB_DL;
ind = 3*lprime*eNB->frame_parms.N_RB_DL;
l = lprime + ((Ns&1)<<1);
// loop over pairs of PRBs, this is the periodicity of the W_bar_NCP sequence
// unroll the computations for the 6 pilots, select qpsk or nqpsk as function of W_bar_NCP
for (nPRB=0; nPRB<phy_vars_eNB->lte_frame_parms.N_RB_DL; nPRB+=2) {
for (nPRB=0; nPRB<eNB->frame_parms.N_RB_DL; nPRB+=2) {
// First pilot
w = Wbar_NCP[p-7][l];
......@@ -116,13 +116,13 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
*output_p = qpsk_p[(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_UESPEC
LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb);
LOG_D(PHY,"index = %d\n",(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
LOG_D(PHY,"index = %d\n",(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif
output_p+=5;
......@@ -135,12 +135,12 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
*output_p = qpsk_p[(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_UESPEC
LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb);
LOG_D(PHY,"index = %d\n",(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
LOG_D(PHY,"index = %d\n",(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif
output_p+=5;
......@@ -152,12 +152,12 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
*output_p = qpsk_p[(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_UESPEC
LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb);
LOG_D(PHY,"index = %d\n",(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
LOG_D(PHY,"index = %d\n",(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif
output_p+=2;
......@@ -171,13 +171,13 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
*output_p = qpsk_p[(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_UESPEC
LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb);
LOG_D(PHY,"index = %d\n",(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
LOG_D(PHY,"index = %d\n",(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif
output_p+=5;
......@@ -190,12 +190,12 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
*output_p = qpsk_p[(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_UESPEC
LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb);
LOG_D(PHY,"index = %d\n",(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
LOG_D(PHY,"index = %d\n",(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif
output_p+=5;
......@@ -207,12 +207,12 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
*output_p = qpsk_p[(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_UESPEC
LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb);
LOG_D(PHY,"index = %d\n",(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
LOG_D(PHY,"index = %d\n",(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif
output_p+=2;
......@@ -260,9 +260,9 @@ int lte_dl_cell_spec_rx(PHY_VARS_UE *phy_vars_ue,
((short *)&qpsk[3])[0] = -pamp;
((short *)&qpsk[3])[1] = pamp;
mprime = 110 - phy_vars_ue->lte_frame_parms.N_RB_DL;
mprime = 110 - phy_vars_ue->frame_parms.N_RB_DL;
for (m=0;m<phy_vars_ue->lte_frame_parms.N_RB_DL<<1;m++) {
for (m=0;m<phy_vars_ue->frame_parms.N_RB_DL<<1;m++) {
mprime_dword = mprime>>4;
mprime_qpsk_symb = mprime&0xf;
......
This diff is collapsed.
This diff is collapsed.
......@@ -143,7 +143,7 @@ typedef struct {
/// downlink power offset field
uint8_t dl_power_off;
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
uint8_t e[MAX_NUM_CHANNEL_BITS];
uint8_t e[MAX_NUM_CHANNEL_BITS] __attribute__((aligned(32)));
/// Turbo-code outputs (36-212 V8.6 2009-03, p.12
uint8_t *d[MAX_NUM_DLSCH_SEGMENTS];//[(96+3+(3*6144))];
/// Sub-block interleaver outputs (36-212 V8.6 2009-03, p.16-17)
......@@ -407,7 +407,7 @@ typedef struct {
/// coded RI bits
int16_t q_RI[MAX_RI_PAYLOAD];
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
int16_t e[MAX_NUM_CHANNEL_BITS];
int16_t e[MAX_NUM_CHANNEL_BITS] __attribute__((aligned(32)));
/// Temporary h sequence to flag PUSCH_x/PUSCH_y symbols which are not scrambled
uint8_t h[MAX_NUM_CHANNEL_BITS];
/// Pointer to the payload
......@@ -703,6 +703,8 @@ typedef struct {
uint32_t Nsoft;
/// Maximum number of Turbo iterations
uint8_t max_turbo_iterations;
/// number of iterations used in last turbo decoding
uint8_t last_iteration_cnt;
/// accumulated tx power adjustment for PUCCH
int8_t g_pucch;
} LTE_UE_DLSCH_t;
......@@ -719,13 +721,17 @@ typedef enum {format0,
format2B,
format2C,
format2D,
format3
format3,
format3A,
format4
} DCI_format_t;
typedef enum {
SI_PDSCH=0,
RA_PDSCH,
P_PDSCH,
PDSCH,
PDSCH1,
PMCH
} PDSCH_t;
......
This diff is collapsed.
......@@ -188,7 +188,8 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
#ifdef DEBUG_DLSCH_DECODING
uint16_t i;
#endif
#ifdef __AVX2__
//#ifdef __AVX2__
#if 0
int Kr_last,skipped_last=0;
uint8_t (*tc_2cw)(int16_t *y,
int16_t *y2,
......@@ -249,7 +250,8 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
}
if (llr8_flag == 0) {
#ifdef __AVX2__
//#ifdef __AVX2__
#if 0
tc_2cw = phy_threegpplte_turbo_decoder16avx2;
#endif
tc = phy_threegpplte_turbo_decoder16;
......@@ -668,6 +670,8 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
}
}
dlsch->last_iteration_cnt = ret;
return(ret);
}
......@@ -812,7 +816,7 @@ int dlsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint32_t rb_alloc[4], ui
uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
uint8_t subframe,
uint8_t dlsch_id,
PDSCH_t dlsch_id,
uint8_t eNB_id)
{
......@@ -828,7 +832,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
// may not be necessary for PMCH??
for (eNB_id2=0; eNB_id2<NB_eNB_INST; eNB_id2++) {
if (PHY_vars_eNB_g[eNB_id2][CC_id]->lte_frame_parms.Nid_cell == phy_vars_ue->lte_frame_parms.Nid_cell)
if (PHY_vars_eNB_g[eNB_id2][CC_id]->frame_parms.Nid_cell == phy_vars_ue->frame_parms.Nid_cell)
break;
}
......@@ -843,9 +847,9 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
switch (dlsch_id) {
case 0: // SI
dlsch_ue = phy_vars_ue->dlsch_ue_SI[eNB_id];
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_eNB_SI;
case SI_PDSCH: // SI
dlsch_ue = phy_vars_ue->dlsch_SI[eNB_id];
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_SI;
// printf("Doing SI: TBS %d\n",dlsch_ue->harq_processes[0]->TBS>>3);
memcpy(dlsch_ue->harq_processes[0]->b,dlsch_eNB->harq_processes[0]->b,dlsch_ue->harq_processes[0]->TBS>>3);
#ifdef DEBUG_DLSCH_DECODING
......@@ -859,9 +863,9 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
return(1);
break;
case 1: // RA
dlsch_ue = phy_vars_ue->dlsch_ue_ra[eNB_id];
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_eNB_ra;
case RA_PDSCH: // RA
dlsch_ue = phy_vars_ue->dlsch_ra[eNB_id];
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_ra;
memcpy(dlsch_ue->harq_processes[0]->b,dlsch_eNB->harq_processes[0]->b,dlsch_ue->harq_processes[0]->TBS>>3);
#ifdef DEBUG_DLSCH_DECODING
LOG_D(PHY,"RA Decoded\n");
......@@ -874,12 +878,12 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
return(1);
break;
case 2: // TB0
dlsch_ue = phy_vars_ue->dlsch_ue[eNB_id][0];
case PDSCH: // TB0
dlsch_ue = phy_vars_ue->dlsch[eNB_id][0];
harq_pid = dlsch_ue->current_harq_pid;
ue_id= (uint32_t)find_ue((int16_t)phy_vars_ue->lte_ue_pdcch_vars[(uint32_t)eNB_id]->crnti,PHY_vars_eNB_g[eNB_id2][CC_id]);
ue_id= (uint32_t)find_ue((int16_t)phy_vars_ue->pdcch_vars[(uint32_t)eNB_id]->crnti,PHY_vars_eNB_g[eNB_id2][CC_id]);
DevAssert( ue_id != (uint32_t)-1 );
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_eNB[ue_id][0];
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch[ue_id][0];
#ifdef DEBUG_DLSCH_DECODING
......@@ -914,17 +918,18 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
dlsch_ue->harq_ack[subframe].ack = 0;
dlsch_ue->harq_ack[subframe].harq_id = harq_pid;
dlsch_ue->harq_ack[subframe].send_harq_status = 1;
dlsch_ue->last_iteration_cnt = 1+dlsch_ue->max_turbo_iterations;
return(1+dlsch_ue->max_turbo_iterations);
}
break;
case 3: { // TB1
dlsch_ue = phy_vars_ue->dlsch_ue[eNB_id][1];
case PDSCH1: { // TB1
dlsch_ue = phy_vars_ue->dlsch[eNB_id][1];
harq_pid = dlsch_ue->current_harq_pid;
int8_t UE_id = find_ue( phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti, PHY_vars_eNB_g[eNB_id2][CC_id] );
int8_t UE_id = find_ue( phy_vars_ue->pdcch_vars[eNB_id]->crnti, PHY_vars_eNB_g[eNB_id2][CC_id] );
DevAssert( UE_id != -1 );
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_eNB[UE_id][1];
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch[UE_id][1];
// reset HARQ
dlsch_ue->harq_processes[harq_pid]->status = SCH_IDLE;
dlsch_ue->harq_processes[harq_pid]->round = 0;
......@@ -938,10 +943,10 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
break;
}
case 5: // PMCH
case PMCH: // PMCH
dlsch_ue = phy_vars_ue->dlsch_ue_MCH[eNB_id];
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_eNB_MCH;
dlsch_ue = phy_vars_ue->dlsch_MCH[eNB_id];
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_MCH;
LOG_D(PHY,"decoding pmch emul (size is %d, enb %d %d)\n", dlsch_ue->harq_processes[0]->TBS>>3, eNB_id, eNB_id2);
#ifdef DEBUG_DLSCH_DECODING
......@@ -963,17 +968,20 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
memcpy(dlsch_ue->harq_processes[0]->b,
dlsch_eNB->harq_processes[0]->b,
dlsch_ue->harq_processes[0]->TBS>>3);
dlsch_ue->last_iteration_cnt = 1;
return(1);
} else {
// retransmission
dlsch_ue->last_iteration_cnt = 1+dlsch_ue->max_turbo_iterations;
return(1+dlsch_ue->max_turbo_iterations);
}
break;
default:
dlsch_ue = phy_vars_ue->dlsch_ue[eNB_id][0];
dlsch_ue = phy_vars_ue->dlsch[eNB_id][0];
LOG_E(PHY,"dlsch_decoding_emul: FATAL, unknown DLSCH_id %d\n",dlsch_id);
dlsch_ue->last_iteration_cnt = 1+dlsch_ue->max_turbo_iterations;
return(1+dlsch_ue->max_turbo_iterations);
}
......
......@@ -861,7 +861,7 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
len_mod4 =len&3;
len2=len>>2; // length in quad words (4 REs)
len2+=(len_mod4?0:1);
len2+=((len_mod4==0)?0:1);
for (i=0; i<len2; i++) {
......
This diff is collapsed.
This diff is collapsed.
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*! \file PHY/LTE_TRANSPORT/if4_tools.h
* \brief
* \author S. Sandeep Kumar, Raymond Knopp
* \date 2016
* \version 0.1
* \company Eurecom
* \email: ee13b1025@iith.ac.in, knopp@eurecom.fr
* \note
* \warning
*/
#include "PHY/defs.h"
/// Macro for IF4 packet type
#define IF4p5_PACKET_TYPE 0x080A
#define IF4p5_PULFFT 0x0019
#define IF4p5_PDLFFT 0x0020
#define IF4p5_PRACH 0x0021
struct IF4p5_header {
/// Type
uint16_t type;
/// Sub-Type
uint16_t sub_type;
/// Reserved
uint32_t rsvd;
/// Frame Status
uint32_t frame_status;
} __attribute__ ((__packed__));
typedef struct IF4p5_header IF4p5_header_t;
#define sizeof_IF4p5_header_t 12
void gen_IF4p5_dl_header(IF4p5_header_t*, int, int);
void gen_IF4p5_ul_header(IF4p5_header_t*, int, int);
void gen_IF4p5_prach_header(IF4p5_header_t*, int, int);
void send_IF4p5(PHY_VARS_eNB*, int, int, uint16_t, int);
void recv_IF4p5(PHY_VARS_eNB*, int*, int*, uint16_t*, uint32_t*);
void malloc_IF4p5_buffer(PHY_VARS_eNB*);
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -1053,9 +1053,10 @@ uint16_t rx_pbch_emul(PHY_VARS_UE *phy_vars_ue,
double bler=0.0;//, x=0.0;
double sinr=0.0;
uint16_t nb_rb = phy_vars_ue->lte_frame_parms.N_RB_DL;
uint16_t nb_rb = phy_vars_ue->frame_parms.N_RB_DL;
int16_t f;
uint8_t CC_id=phy_vars_ue->CC_id;
int frame_rx = phy_vars_ue->proc.proc_rxtx[0].frame_rx;
// compute effective sinr
// TODO: adapt this to varible bandwidth
......@@ -1074,10 +1075,10 @@ uint16_t rx_pbch_emul(PHY_VARS_UE *phy_vars_ue,
sinr,
bler);
if (pbch_phase == (phy_vars_ue->frame_rx % 4)) {
if (pbch_phase == (frame_rx % 4)) {
if (uniformrandom() >= bler) {
memcpy(phy_vars_ue->lte_ue_pbch_vars[eNB_id]->decoded_output,PHY_vars_eNB_g[eNB_id][CC_id]->pbch_pdu,PBCH_PDU_SIZE);
return(PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.nb_antennas_tx_eNB);
memcpy(phy_vars_ue->pbch_vars[eNB_id]->decoded_output,PHY_vars_eNB_g[eNB_id][CC_id]->pbch_pdu,PBCH_PDU_SIZE);
return(PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.nb_antennas_tx_eNB);
} else
return(-1);
} else
......
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.
......@@ -129,15 +129,15 @@ int compareints (const void * a, const void * b)
}
int32_t generate_srs_tx(PHY_VARS_UE *phy_vars_ue,
int32_t generate_srs_tx(PHY_VARS_UE *ue,
uint8_t eNB_id,
int16_t amp,
uint32_t subframe)
{
LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_ue->lte_frame_parms;
SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated=&phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id];
int32_t *txdataF = phy_vars_ue->lte_ue_common_vars.txdataF[0];
LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated=&ue->soundingrs_ul_config_dedicated[eNB_id];
int32_t *txdataF = ue->common_vars.txdataF[0];
uint16_t msrsb=0,Nb=0,nb,b,msrs0=0,k,Msc_RS,Msc_RS_idx,carrier_pos,symbol_offset;
uint16_t *Msc_idx_ptr;
int32_t k0;
......
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.
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.
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