Commit 30509955 authored by frtabu's avatar frtabu

remove compilation warnings, especially when disabling T_TRACER. enhance LOG_M...

remove compilation warnings, especially when disabling T_TRACER. enhance LOG_M macro implementation, introduce LOG_DEBUG_XXX macro to replace #ifdef DEBUG_XXX
parent b85cbdde
Pipeline #10217 failed with stage
in 0 seconds
......@@ -1214,7 +1214,7 @@ set(PHY_MEX_UE
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation_avx2.c
${OPENAIR1_DIR}/PHY/TOOLS/signal_energy.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ue_measurements.c
${OPENAIR2_DIR}/UTIL/LOG/log.c
${OPENAIR_DIR}/common/utils/LOG/log.c
)
add_library(PHY_MEX ${PHY_MEX_UE})
......
......@@ -508,7 +508,9 @@ function main() {
lte_exec=lte-uesoftmodem
fi
fi
if [ "$T_TRACER" = "False" ] ; then
lte_build_dir=${lte_build_dir}_noLOG
fi
# configuration module libraries, one currently available, using libconfig
config_libconfig_shlib=params_libconfig
......
......@@ -71,8 +71,11 @@ mapping log_options[] = {
mapping log_maskmap[] = {
{"prach", DEBUG_PRACH},
{"RU", DEBUG_RU},
{"prach", DEBUG_PRACH},
{"RU", DEBUG_RU},
{"ctrlsocket", DEBUG_CTRLSOCKET},
{"UE_PHYPROC", DEBUG_UE_PHYPROC},
{"UE_TIMING", UE_TIMING},
{NULL,-1}
};
......@@ -377,7 +380,6 @@ int logInit (void)
register_log_component("RLC","log",RLC);
register_log_component("PDCP","log",PDCP);
register_log_component("RRC","log",RRC);
register_log_component("EMU","log",EMU);
register_log_component("OMG","csv",OMG);
register_log_component("OTG","log",OTG);
register_log_component("OTG_LATENCY","dat",OTG_LATENCY);
......@@ -399,7 +401,7 @@ int logInit (void)
register_log_component("FLEXRAN_AGENT","log",FLEXRAN_AGENT);
register_log_component("TMR","",TMR);
register_log_component("USIM","txt",USIM);
register_log_component("SIM","txt",SIM);
/* following log component are used for the localization*/
register_log_component("LOCALIZE","log",LOCALIZE);
......@@ -465,14 +467,15 @@ int logInit (void)
char *log_getthreadname(char *threadname) {
if (pthread_getname_np(pthread_self(), threadname, sizeof(threadname)) != 0)
{
return "thread?";
} else {
return threadname;
}
char *log_getthreadname(char *threadname, int bufsize) {
int rt = pthread_getname_np(pthread_self(), threadname,bufsize) ;
if (rt == 0)
{
return threadname;
} else {
return "thread?";
}
}
......@@ -495,7 +498,7 @@ void logRecord_mt(const char *file, const char *func, int line, int comp, int le
( (g_log->flag & FLAG_NOCOLOR)?"":log_level_highlight_start[level]),
g_log->log_component[comp].name,
( (g_log->flag & FLAG_LEVEL)?g_log->level2string[level]:""),
( (g_log->flag & FLAG_THREAD)?log_getthreadname(threadname):""),
( (g_log->flag & FLAG_THREAD)?log_getthreadname(threadname,PR_SET_NAME+1):""),
format);
g_log->log_component[comp].fwrite(g_log->log_component[comp].stream,log_buffer, args);
......
......@@ -131,8 +131,11 @@ extern "C" {
* it allows to dynamically activate or not blocks of code
* @brief
* @{*/
#define DEBUG_PRACH (1<<0)
#define DEBUG_RU (1<<1)
#define DEBUG_PRACH (1<<0)
#define DEBUG_RU (1<<1)
#define DEBUG_UE_PHYPROC (1<<2)
#define DEBUG_CTRLSOCKET (1<<10)
#define UE_TIMING (1<<20)
#define SET_LOG_DEBUG(O) g_log->debug_mask = (g_log->debug_mask | O)
#define CLEAR_LOG_DEBUG(O) g_log->debug_mask = (g_log->debug_mask & (~O))
......@@ -340,6 +343,8 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
# define LOG_M_BEGIN(D) if (g_log->matlab_mask & D) {
# define LOG_M_END }
# define LOG_M(file, vector, data, len, dec, format) do { write_file_matlab(file, vector, data, len, dec, format);} while(0)/* */
/* define variable only used in LOG macro's */
# define LOG_VAR(A,B) A B
# else /* T_TRACER: remove all debugging and tracing messages, except errors */
# define LOG_I(c, x...) /* */
# define LOG_W(c, x...) /* */
......@@ -353,10 +358,15 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
# define LOG_M_BEGIN(D) if (0) {
# define LOG_M_END }
# define LOG_M(file, vector, data, len, dec, format)
# define LOG_VAR(A,B)
# endif /* T_TRACER */
/* avoid warnings for variables only used in LOG macro's but set outside debug section */
#define LOG_USEDINLOG_VAR(A,B) __attribute__((unused)) A B
/* unfiltered macros, usefull for simulators or messages at init time, before log is configured */
#define LOG_UM(file, vector, data, len, dec, format) do { write_file_matlab(file, vector, data, len, dec, format);} while(0)
#define LOG_UI(c, x...) do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ; } while(0)
/* @}*/
......
......@@ -361,7 +361,7 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
int l;
int optbit;
l=sscanf(logsubcmd,"%m[^'_']_%m[^'_']",&logparam,&opt);
l=sscanf(logsubcmd,"%m[^'_']_%ms",&logparam,&opt);
if (l == 2 && strcmp(logparam,"print") == 0){
optbit=map_str_to_int(log_options,opt);
if (optbit < 0) {
......
......@@ -193,24 +193,25 @@ typedef struct {
static pnf_info pnf;
static pthread_t pnf_start_pthread;
int nfapitooai_level(int nfapi_level) {
switch(nfapi_level) {
case NFAPI_TRACE_ERROR:
return LOG_ERR;
case NFAPI_TRACE_WARN:
return LOG_WARNING;
case NFAPI_TRACE_NOTE:
return LOG_INFO;
case NFAPI_TRACE_INFO:
return LOG_DEBUG;
}
return LOG_ERR;
}
void pnf_nfapi_trace(nfapi_trace_level_t nfapi_level, const char* message, ...) {
va_list args;
int oai_level;
if (nfapi_level==NFAPI_TRACE_ERROR) {
oai_level = LOG_ERR;
} else if (nfapi_level==NFAPI_TRACE_WARN) {
oai_level = LOG_WARNING;
} else if (nfapi_level==NFAPI_TRACE_NOTE) {
oai_level = LOG_INFO;
} else if (nfapi_level==NFAPI_TRACE_INFO) {
oai_level = LOG_DEBUG;
} else {
oai_level = LOG_ERR;
}
va_start(args, message);
nfapi_log("FILE>", "FUNC", 999, PHY, oai_level, message, args);
nfapi_log("FILE>", "FUNC", 999, PHY, nfapitooai_level(nfapi_level), message, args);
va_end(args);
}
......
......@@ -684,31 +684,9 @@ void vnf_deallocate(void* ptr) {
void vnf_trace(nfapi_trace_level_t nfapi_level, const char* message, ...) {
va_list args;
int oai_level;
if (nfapi_level==NFAPI_TRACE_ERROR)
{
oai_level = LOG_ERR;
}
else if (nfapi_level==NFAPI_TRACE_WARN)
{
oai_level = LOG_WARNING;
}
else if (nfapi_level==NFAPI_TRACE_NOTE)
{
oai_level = LOG_INFO;
}
else if (nfapi_level==NFAPI_TRACE_INFO)
{
oai_level = LOG_INFO;
}
else
{
oai_level = LOG_INFO;
}
va_start(args, message);
nfapi_log("FILE>", "FUNC", 999, PHY, oai_level, message, args);
nfapi_log("FILE>", "FUNC", 999, PHY, nfapitooai_level(nfapi_level), message, args);
va_end(args);
}
......
......@@ -25,7 +25,7 @@ extern "C" {
// todo : move to public_inc so can be used by vendor extensions
#define MAX_BAD_TAG 3
int nfapitooai_level(int nfapilevel);
uint8_t push8(uint8_t in, uint8_t **out, uint8_t *end);
uint8_t pushs8(int8_t in, uint8_t **out, uint8_t *end);
uint8_t push16(uint16_t in, uint8_t **out, uint8_t *end);
......
......@@ -712,12 +712,10 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
LTE_DL_FRAME_PARMS *frame_parms=&eNB->frame_parms;
int32_t **txdataF = eNB->common_vars.txdataF;
uint8_t harq_pid;
uint8_t Ngroup_PHICH,ngroup_PHICH,nseq_PHICH;
uint8_t NSF_PHICH = 4;
uint8_t pusch_subframe;
uint8_t i;
uint32_t pusch_frame;
int subframe = proc->subframe_tx;
phich_config_t *phich;
......@@ -732,9 +730,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
NSF_PHICH = 2;
if (eNB->phich_vars[subframe&1].num_hi > 0) {
pusch_frame = phich_frame2_pusch_frame(frame_parms,proc->frame_tx,subframe);
pusch_subframe = phich_subframe2_pusch_subframe(frame_parms,subframe);
harq_pid = subframe2harq_pid(frame_parms,pusch_frame,pusch_subframe);
}
for (i=0; i<eNB->phich_vars[subframe&1].num_hi; i++) {
......@@ -753,13 +749,15 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
nseq_PHICH = ((phich->first_rb/Ngroup_PHICH) +
phich->n_DMRS)%(2*NSF_PHICH);
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, AMP %d ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d)\n",
eNB->Mod_id,harq_pid,proc->frame_tx,
eNB->Mod_id,subframe2harq_pid(frame_parms,
phich_frame2_pusch_frame(frame_parms,proc->frame_tx,subframe),pusch_subframe),proc->frame_tx,
subframe,amp,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,
phich->hi,
phich->first_rb);
T(T_ENB_PHY_PHICH, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(subframe),
T_INT(-1 /* TODO: rnti */), T_INT(harq_pid),
T_INT(-1 /* TODO: rnti */),
T_INT(subframe2harq_pid(frame_parms,phich_frame2_pusch_frame(frame_parms,proc->frame_tx,subframe),pusch_subframe)),
T_INT(Ngroup_PHICH), T_INT(NSF_PHICH),
T_INT(ngroup_PHICH), T_INT(nseq_PHICH),
T_INT(phich->hi),
......
......@@ -208,19 +208,21 @@ LOG_M_BEGIN(PRACH)
int32_t en0=signal_energy((int32_t*)prach[aa],fp->samples_per_tti);
int8_t dbEn0 = dB_fixed(en0);
int8_t rach_dBm = dbEn0 - ru->rx_total_gain_dB;
char buffer[80];
if (dbEn0>32 && prach[0]!= NULL)
{
static int counter=0;
char buffer[80];
//counter++;
sprintf(buffer, "%s%d", "/tmp/prach_rx",counter);
LOG_M(buffer,"prach_rx",prach[0],fp->samples_per_tti,1,13);
}
if (dB_fixed(en0)>32)
{
sprintf(buffer, "rach_dBm:%d",rach_dBm);
if (prach[0]!= NULL) LOG_M("prach_rx","prach_rx",prach[0],fp->samples_per_tti,1,1);
LOG_I(PHY,"RU %d, br_flag %d ce_level %d frame %d subframe %d per_tti:%d prach:%p (energy %d) TA:%d rach_dBm:%d rxdata:%p index:%d\n",ru->idx,br_flag,ce_level,ru->proc.frame_prach,subframe,fp->samples_per_tti,prach[aa],dbEn0,ru->N_TA_offset,rach_dBm,ru->common.rxdata[aa], (subframe*fp->samples_per_tti)-ru->N_TA_offset);
LOG_I(PHY,"RU %d, br_flag %d ce_level %d frame %d subframe %d per_tti:%d prach:%p (energy %d) TA:%d %s rxdata:%p index:%d\n",
ru->idx,br_flag,ce_level,ru->proc.frame_prach,subframe,fp->samples_per_tti,
prach[aa],dbEn0,ru->N_TA_offset,buffer,ru->common.rxdata[aa],
(subframe*fp->samples_per_tti)-ru->N_TA_offset);
}
LOG_M_END
}
......
......@@ -1350,70 +1350,70 @@ void rx_ulsch_emul(PHY_VARS_eNB *eNB,
eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch);
sprintf(fname,"/tmp/ulsch_r%d_d",round);
sprintf(vname,"/tmp/ulsch_r%d_dseq",round);
LOG_M(fname,vname,&eNB->ulsch[UE_id]->harq_processes[harq_pid]->d[0][96],
LOG_UM(fname,vname,&eNB->ulsch[UE_id]->harq_processes[harq_pid]->d[0][96],
eNB->ulsch[UE_id]->harq_processes[harq_pid]->Kplus*3,1,0);
if (eNB->common_vars.rxdata) {
sprintf(fname,"/tmp/rxsig0_r%d.m",round);
sprintf(vname,"rxs0_r%d",round);
LOG_M(fname,vname, &eNB->common_vars.rxdata[0][0],eNB->frame_parms.samples_per_tti*10,1,1);
LOG_UM(fname,vname, &eNB->common_vars.rxdata[0][0],eNB->frame_parms.samples_per_tti*10,1,1);
if (eNB->frame_parms.nb_antennas_rx>1)
if (eNB->common_vars.rxdata) {
sprintf(fname,"/tmp/rxsig1_r%d.m",round);
sprintf(vname,"rxs1_r%d",round);
LOG_M(fname,vname, &eNB->common_vars.rxdata[1][0],eNB->frame_parms.samples_per_tti*10,1,1);
LOG_UM(fname,vname, &eNB->common_vars.rxdata[1][0],eNB->frame_parms.samples_per_tti*10,1,1);
}
}
sprintf(fname,"/tmp/rxsigF0_r%d.m",round);
sprintf(vname,"rxsF0_r%d",round);
LOG_M(fname,vname, (void*)&eNB->common_vars.rxdataF[0][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
LOG_UM(fname,vname, (void*)&eNB->common_vars.rxdataF[0][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
if (eNB->frame_parms.nb_antennas_rx>1) {
sprintf(fname,"/tmp/rxsigF1_r%d.m",round);
sprintf(vname,"rxsF1_r%d",round);
LOG_M(vname,fname, &eNB->common_vars.rxdataF[1][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
LOG_UM(vname,fname, &eNB->common_vars.rxdataF[1][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
}
sprintf(fname,"/tmp/rxsigF0_ext_r%d.m",round);
sprintf(vname,"rxsF0_ext_r%d",round);
LOG_M(fname,vname, &eNB->pusch_vars[UE_id]->rxdataF_ext[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
LOG_UM(fname,vname, &eNB->pusch_vars[UE_id]->rxdataF_ext[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
if (eNB->frame_parms.nb_antennas_rx>1) {
sprintf(fname,"/tmp/rxsigF1_ext_r%d.m",round);
sprintf(vname,"rxsF1_ext_r%d",round);
LOG_M(fname,vname,&eNB->pusch_vars[UE_id]->rxdataF_ext[1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
LOG_UM(fname,vname,&eNB->pusch_vars[UE_id]->rxdataF_ext[1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
}
/*
if (eNB->srs_vars[UE_id].srs_ch_estimates) LOG_M("/tmp/srs_est0.m","srsest0",eNB->srs_vars[UE_id].srs_ch_estimates[0],eNB->frame_parms.ofdm_symbol_size,1,1);
if (eNB->srs_vars[UE_id].srs_ch_estimates) LOG_UM("/tmp/srs_est0.m","srsest0",eNB->srs_vars[UE_id].srs_ch_estimates[0],eNB->frame_parms.ofdm_symbol_size,1,1);
if (eNB->frame_parms.nb_antennas_rx>1)
if (eNB->srs_vars[UE_id].srs_ch_estimates) LOG_M("/tmp/srs_est1.m","srsest1",eNB->srs_vars[UE_id].srs_ch_estimates[1],eNB->frame_parms.ofdm_symbol_size,1,1);
if (eNB->srs_vars[UE_id].srs_ch_estimates) LOG_UM("/tmp/srs_est1.m","srsest1",eNB->srs_vars[UE_id].srs_ch_estimates[1],eNB->frame_parms.ofdm_symbol_size,1,1);
*/
sprintf(fname,"/tmp/drs_est0_r%d.m",round);
sprintf(vname,"drsest0_r%d",round);
LOG_M(fname,vname,eNB->pusch_vars[UE_id]->drs_ch_estimates[0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
LOG_UM(fname,vname,eNB->pusch_vars[UE_id]->drs_ch_estimates[0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
if (eNB->frame_parms.nb_antennas_rx>1) {
sprintf(fname,"/tmp/drs_est1_r%d.m",round);
sprintf(vname,"drsest1_r%d",round);
LOG_M(fname,vname,eNB->pusch_vars[UE_id]->drs_ch_estimates[1],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
LOG_UM(fname,vname,eNB->pusch_vars[UE_id]->drs_ch_estimates[1],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
}
sprintf(fname,"/tmp/ulsch0_rxF_comp0_r%d.m",round);
sprintf(vname,"ulsch0_rxF_comp0_r%d",round);
LOG_M(fname,vname,&eNB->pusch_vars[UE_id]->rxdataF_comp[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
LOG_UM(fname,vname,&eNB->pusch_vars[UE_id]->rxdataF_comp[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
// LOG_M("ulsch_rxF_comp1.m","ulsch0_rxF_comp1",&eNB->pusch_vars[UE_id]->rxdataF_comp[0][1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
sprintf(fname,"/tmp/ulsch_rxF_llr_r%d.m",round);
sprintf(vname,"ulsch_llr_r%d",round);
LOG_M(fname,vname,eNB->pusch_vars[UE_id]->llr,
LOG_UM(fname,vname,eNB->pusch_vars[UE_id]->llr,
eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12*eNB->ulsch[UE_id]->harq_processes[harq_pid]->Qm
*eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch,1,0);
sprintf(fname,"/tmp/ulsch_ch_mag_r%d.m",round);
sprintf(vname,"ulsch_ch_mag_r%d",round);
LOG_M(fname,vname,&eNB->pusch_vars[UE_id]->ul_ch_mag[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
// LOG_M("ulsch_ch_mag1.m","ulsch_ch_mag1",&eNB->pusch_vars[UE_id]->ul_ch_mag[1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
LOG_UM(fname,vname,&eNB->pusch_vars[UE_id]->ul_ch_mag[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
// LOG_UM("ulsch_ch_mag1.m","ulsch_ch_mag1",&eNB->pusch_vars[UE_id]->ul_ch_mag[1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
//#endif
}
......@@ -3950,15 +3950,11 @@ void dlsch_channel_level_median(int **dl_ch_estimates_ext,
short ii;
int aatx,aarx;
int length_mod4;
int length2;
int max = 0, min=0;
int norm_pack;
__m128i *dl_ch128, norm128D;
int16_t x = factor2(length);
int16_t y = (length)>>x;
for (aatx=0; aatx<n_tx; aatx++){
for (aarx=0; aarx<n_rx; aarx++) {
max = 0;
......@@ -3967,8 +3963,6 @@ void dlsch_channel_level_median(int **dl_ch_estimates_ext,
dl_ch128=(__m128i *)&dl_ch_estimates_ext[aatx*2 + aarx][start_point];
length_mod4=length&3;
length2 = length>>2;
for (ii=0;ii<length2;ii++) {
......@@ -3981,7 +3975,7 @@ void dlsch_channel_level_median(int **dl_ch_estimates_ext,
((int32_t*)&norm128D)[3];
if (ii<1){
print_ints("norm128D",&norm128D[0]);
// print_ints("norm128D",&norm128D[0]);
printf("norm_pack[%d] %d\n", aatx*n_rx + aarx, norm_pack);
}
......@@ -6921,79 +6915,90 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t subframe,unsigned int *coded_bits_per_codeword,int round, unsigned char harq_pid)
{
unsigned int nsymb = (ue->frame_parms.Ncp == 0) ? 14 : 12;
#define NSYMB ((ue->frame_parms.Ncp == 0) ? 14 : 12)
char fname[32],vname[32];
int N_RB_DL=ue->frame_parms.N_RB_DL;
sprintf(fname,"dlsch%d_rxF_r%d_ext0.m",eNB_id,round);
sprintf(vname,"dl%d_rxF_r%d_ext0",eNB_id,round);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->rxdataF_ext[0],12*N_RB_DL*nsymb,1,1);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->rxdataF_ext[0],
12*(ue->frame_parms.N_RB_DL)*NSYMB,1,1);
if (ue->frame_parms.nb_antennas_rx >1) {
sprintf(fname,"dlsch%d_rxF_r%d_ext1.m",eNB_id,round);
sprintf(vname,"dl%d_rxF_r%d_ext1",eNB_id,round);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->rxdataF_ext[1],12*N_RB_DL*nsymb,1,1);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->rxdataF_ext[1],
12*(ue->frame_parms.N_RB_DL)*NSYMB,1,1);
}
sprintf(fname,"dlsch%d_ch_r%d_ext00.m",eNB_id,round);
sprintf(vname,"dl%d_ch_r%d_ext00",eNB_id,round);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_estimates_ext[0],
12*(ue->frame_parms.N_RB_DL)*NSYMB,1,1);
if (ue->transmission_mode[eNB_id]==7){
sprintf(fname,"dlsch%d_bf_ch_r%d.m",eNB_id,round);
sprintf(vname,"dl%d_bf_ch_r%d",eNB_id,round);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_bf_ch_estimates[0],512*nsymb,1,1);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_bf_ch_estimates[0],512*NSYMB,1,1);
//LOG_M(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates[0],512,1,1);
sprintf(fname,"dlsch%d_bf_ch_r%d_ext00.m",eNB_id,round);
sprintf(vname,"dl%d_bf_ch_r%d_ext00",eNB_id,round);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_bf_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_bf_ch_estimates_ext[0],
12*(ue->frame_parms.N_RB_DL)*NSYMB,1,1);
}
if (ue->frame_parms.nb_antennas_rx == 2) {
sprintf(fname,"dlsch%d_ch_r%d_ext01.m",eNB_id,round);
sprintf(vname,"dl%d_ch_r%d_ext01",eNB_id,round);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_estimates_ext[1],
12*(ue->frame_parms.N_RB_DL)*NSYMB,1,1);
}
if (ue->frame_parms.nb_antenna_ports_eNB == 2) {
sprintf(fname,"dlsch%d_ch_r%d_ext10.m",eNB_id,round);
sprintf(vname,"dl%d_ch_r%d_ext10",eNB_id,round);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_estimates_ext[2],
12*(ue->frame_parms.N_RB_DL)*NSYMB,1,1);
if (ue->frame_parms.nb_antennas_rx == 2) {
sprintf(fname,"dlsch%d_ch_r%d_ext11.m",eNB_id,round);
sprintf(vname,"dl%d_ch_r%d_ext11",eNB_id,round);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb,1,1);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_estimates_ext[3],
12*(ue->frame_parms.N_RB_DL)*NSYMB,1,1);
}
}
sprintf(fname,"dlsch%d_rxF_r%d_uespec0.m",eNB_id,round);
sprintf(vname,"dl%d_rxF_r%d_uespec0",eNB_id,round);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->rxdataF_uespec_pilots[0],12*N_RB_DL,1,1);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->rxdataF_uespec_pilots[0],
12*(ue->frame_parms.N_RB_DL)*NSYMB,1,1);
/*
LOG_M("dlsch%d_ch_ext01.m","dl01_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1);
LOG_M("dlsch%d_ch_ext10.m","dl10_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1);
LOG_M("dlsch%d_ch_ext11.m","dl11_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb,1,1);
LOG_M("dlsch%d_ch_ext01.m","dl01_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*NSYMB,1,1);
LOG_M("dlsch%d_ch_ext10.m","dl10_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*NSYMB,1,1);
LOG_M("dlsch%d_ch_ext11.m","dl11_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*NSYMB,1,1);
*/
sprintf(fname,"dlsch%d_r%d_rho.m",eNB_id,round);
sprintf(vname,"dl_rho_r%d_%d",eNB_id,round);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_rho_ext[harq_pid][round][0],12*N_RB_DL*nsymb,1,1);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_rho_ext[harq_pid][round][0],
12*(ue->frame_parms.N_RB_DL)*NSYMB,1,1);
sprintf(fname,"dlsch%d_r%d_rho2.m",eNB_id,round);
sprintf(vname,"dl_rho2_r%d_%d",eNB_id,round);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_rho2_ext[0],12*N_RB_DL*nsymb,1,1);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_rho2_ext[0],
12*(ue->frame_parms.N_RB_DL)*NSYMB,1,1);
sprintf(fname,"dlsch%d_rxF_r%d_comp0.m",eNB_id,round);
sprintf(vname,"dl%d_rxF_r%d_comp0",eNB_id,round);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp0[0],12*N_RB_DL*nsymb,1,1);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp0[0],
12*(ue->frame_parms.N_RB_DL)*NSYMB,1,1);
if (ue->frame_parms.nb_antenna_ports_eNB == 2) {
sprintf(fname,"dlsch%d_rxF_r%d_comp1.m",eNB_id,round);
sprintf(vname,"dl%d_rxF_r%d_comp1",eNB_id,round);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp1[harq_pid][round][0],12*N_RB_DL*nsymb,1,1);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp1[harq_pid][round][0],
12*(ue->frame_parms.N_RB_DL)*NSYMB,1,1);
}
sprintf(fname,"dlsch%d_rxF_r%d_llr.m",eNB_id,round);
......@@ -7001,52 +7006,13 @@ void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t subframe,unsigned int *c
LOG_M(fname,vname, ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->llr[0],coded_bits_per_codeword[0],1,0);
sprintf(fname,"dlsch%d_r%d_mag1.m",eNB_id,round);
sprintf(vname,"dl%d_r%d_mag1",eNB_id,round);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_mag0[0],12*N_RB_DL*nsymb,1,1);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_mag0[0],
12*(ue->frame_parms.N_RB_DL)*NSYMB,1,1);
sprintf(fname,"dlsch%d_r%d_mag2.m",eNB_id,round);
sprintf(vname,"dl%d_r%d_mag2",eNB_id,round);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_magb0[0],12*N_RB_DL*nsymb,1,1);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_magb0[0],
12*(ue->frame_parms.N_RB_DL)*NSYMB,1,1);
// printf("log2_maxh = %d\n",ue->pdsch_vars[eNB_id]->log2_maxh);
}
#ifdef DEBUG_DLSCH_DEMOD
/*
void print_bytes(char *s,__m128i *x)
{
char *tempb = (char *)x;
printf("%s : %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",s,
tempb[0],tempb[1],tempb[2],tempb[3],tempb[4],tempb[5],tempb[6],tempb[7],
tempb[8],tempb[9],tempb[10],tempb[11],tempb[12],tempb[13],tempb[14],tempb[15]
);
}
void print_shorts(char *s,__m128i *x)
{
short *tempb = (short *)x;
printf("%s : %d,%d,%d,%d,%d,%d,%d,%d\n",s,
tempb[0],tempb[1],tempb[2],tempb[3],tempb[4],tempb[5],tempb[6],tempb[7]);
}
void print_shorts2(char *s,__m64 *x)
{
short *tempb = (short *)x;
printf("%s : %d,%d,%d,%d\n",s,
tempb[0],tempb[1],tempb[2],tempb[3]);
}
void print_ints(char *s,__m128i *x)
{
int *tempb = (int *)x;
printf("%s : %d,%d,%d,%d\n",s,
tempb[0],tempb[1],tempb[2],tempb[3]);
}*/
#endif
......@@ -43,34 +43,32 @@
void dump_mch(PHY_VARS_UE *ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,int subframe)
{
unsigned int nsymb_pmch=12;
char fname[32],vname[32];
int N_RB_DL=ue->frame_parms.N_RB_DL;
#define NSYMB_PMCH 12
sprintf(fname,"mch_rxF_ext0.m");
sprintf(vname,"pmch_rxF_ext0");
LOG_M(fname,vname,ue->pdsch_vars_MCH[eNB_id]->rxdataF_ext[0],12*N_RB_DL*nsymb_pmch,1,1);
LOG_M(fname,vname,ue->pdsch_vars_MCH[eNB_id]->rxdataF_ext[0],12*(ue->frame_parms.N_RB_DL)*12,1,1);
sprintf(fname,"mch_ch_ext00.m");
sprintf(vname,"pmch_ch_ext00");
LOG_M(fname,vname,ue->pdsch_vars_MCH[eNB_id]->dl_ch_estimates_ext[0],12*N_RB_DL*nsymb_pmch,1,1);
LOG_M(fname,vname,ue->pdsch_vars_MCH[eNB_id]->dl_ch_estimates_ext[0],12*(ue->frame_parms.N_RB_DL)*NSYMB_PMCH,1,1);
/*
LOG_M("dlsch%d_ch_ext01.m","dl01_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb_pmch,1,1);
LOG_M("dlsch%d_ch_ext10.m","dl10_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb_pmch,1,1);
LOG_M("dlsch%d_ch_ext11.m","dl11_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb_pmch,1,1);
LOG_M("dlsch%d_rho.m","dl_rho",pdsch_vars[eNB_id]->rho[0],12*N_RB_DL*nsymb_pmch,1,1);
LOG_M("dlsch%d_ch_ext01.m","dl01_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*NSYMB_PMCH,1,1);
LOG_M("dlsch%d_ch_ext10.m","dl10_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*NSYMB_PMCH,1,1);
LOG_M("dlsch%d_ch_ext11.m","dl11_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*NSYMB_PMCH,1,1);
LOG_M("dlsch%d_rho.m","dl_rho",pdsch_vars[eNB_id]->rho[0],12*N_RB_DL*NSYMB_PMCH,1,1);
*/
sprintf(fname,"mch_rxF_comp0.m");
sprintf(vname,"pmch_rxF_comp0");
LOG_M(fname,vname,ue->pdsch_vars_MCH[eNB_id]->rxdataF_comp0[0],12*N_RB_DL*nsymb_pmch,1,1);
LOG_M(fname,vname,ue->pdsch_vars_MCH[eNB_id]->rxdataF_comp0[0],12*(ue->frame_parms.N_RB_DL)*NSYMB_PMCH,1,1);
sprintf(fname,"mch_rxF_llr.m");
sprintf(vname,"pmch_llr");
LOG_M(fname,vname, ue->pdsch_vars_MCH[eNB_id]->llr[0],coded_bits_per_codeword,1,0);
sprintf(fname,"mch_mag1.m");
sprintf(vname,"pmch_mag1");
LOG_M(fname,vname,ue->pdsch_vars_MCH[eNB_id]->dl_ch_mag0[0],12*N_RB_DL*nsymb_pmch,1,1);
LOG_M(fname,vname,ue->pdsch_vars_MCH[eNB_id]->dl_ch_mag0[0],12*(ue->frame_parms.N_RB_DL)*NSYMB_PMCH,1,1);
sprintf(fname,"mch_mag2.m");
sprintf(vname,"pmch_mag2");
LOG_M(fname,vname,ue->pdsch_vars_MCH[eNB_id]->dl_ch_magb0[0],12*N_RB_DL*nsymb_pmch,1,1);
LOG_M(fname,vname,ue->pdsch_vars_MCH[eNB_id]->dl_ch_magb0[0],12*(ue->frame_parms.N_RB_DL)*NSYMB_PMCH,1,1);
LOG_M("mch00_ch0.m","pmch00_ch0",
&(ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][0][0]),
......
......@@ -134,7 +134,6 @@ int32_t generate_srs(LTE_DL_FRAME_PARMS *frame_parms,
//uint32_t subframe_offset;
uint8_t Bsrs = soundingrs_ul_config_dedicated->srs_Bandwidth;
uint8_t Csrs = frame_parms->soundingrs_ul_config_common.srs_BandwidthConfig;
uint8_t Ssrs = frame_parms->soundingrs_ul_config_common.srs_SubframeConfig;
uint8_t n_RRC = soundingrs_ul_config_dedicated->freqDomainPosition;
uint8_t kTC = soundingrs_ul_config_dedicated->transmissionComb;
......@@ -144,7 +143,9 @@ int32_t generate_srs(LTE_DL_FRAME_PARMS *frame_parms,
uint32_t v=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)];
LOG_D(PHY,"SRS root sequence: u %d, v %d\n",u,v);
LOG_D(PHY,"CommonSrsConfig: Csrs %d, Ssrs %d, AnSrsSimultan %d \n",Csrs,Ssrs,frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission);
LOG_D(PHY,"CommonSrsConfig: Csrs %d, Ssrs %d, AnSrsSimultan %d \n",Csrs,
frame_parms->soundingrs_ul_config_common.srs_SubframeConfig,
frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission);
LOG_D(PHY,"DedicatedSrsConfig: Bsrs %d, bhop %d, nRRC %d, Isrs %d, kTC %d, n_SRS %d\n",Bsrs,soundingrs_ul_config_dedicated->srs_HoppingBandwidth,n_RRC
,soundingrs_ul_config_dedicated->srs_ConfigIndex,kTC
,soundingrs_ul_config_dedicated->cyclicShift);
......
......@@ -124,14 +124,11 @@ void prach_procedures(PHY_VARS_eNB *eNB
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if (br_flag==1) {
int prach_mask;
prach_mask = is_prach_subframe(&eNB->frame_parms,eNB->proc.frame_prach_br,eNB->proc.subframe_prach_br);
eNB->UL_INFO.rach_ind_br.rach_indication_body.preamble_list = eNB->preamble_list_br;
int ind=0;
int ce_level=0;
/* Save for later, it doesn't work
/* Save for later, it doesn't work
int prach_mask = is_prach_subframe(&eNB->frame_parms,eNB->proc.frame_prach_br,eNB->proc.subframe_prach_br);
for (int ind=0,ce_level=0;ce_level<4;ce_level++) {
if ((eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[ce_level]==1)&&
......@@ -153,7 +150,7 @@ void prach_procedures(PHY_VARS_eNB *eNB
LOG_D