Merge remote-tracking branch 'origin/develop' into issue-centos-fixes
This commit is contained in:
@@ -897,7 +897,7 @@ set(UTIL_SRC
|
||||
${OPENAIR2_DIR}/UTIL/FIFO/pad_list.c
|
||||
${OPENAIR2_DIR}/UTIL/LISTS/list.c
|
||||
${OPENAIR2_DIR}/UTIL/LISTS/list2.c
|
||||
${OPENAIR2_DIR}/UTIL/LOG/log.c
|
||||
${OPENAIR_DIR}/common/utils/LOG/log.c
|
||||
# ${OPENAIR2_DIR}/UTIL/LOG/vcd_signal_dumper.c
|
||||
${OPENAIR2_DIR}/UTIL/MATH/oml.c
|
||||
${OPENAIR2_DIR}/UTIL/MEM/mem_block.c
|
||||
@@ -1214,7 +1214,12 @@ 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
|
||||
${OPENAIR_DIR}/common/utils/T/T.c
|
||||
${OPENAIR_DIR}/common/utils/T/local_tracer.c
|
||||
${OPENAIR_DIR}/common/config/config_cmdline.c
|
||||
${OPENAIR_DIR}/common/config/config_userapi.c
|
||||
${OPENAIR_DIR}/common/config/config_load_configmodule.c
|
||||
)
|
||||
add_library(PHY_MEX ${PHY_MEX_UE})
|
||||
|
||||
@@ -2175,14 +2180,14 @@ if (${T_TRACER})
|
||||
#all "add_executable" definitions (except tests, rb_tool, updatefw)
|
||||
lte-softmodem lte-softmodem-nos1 lte-uesoftmodem lte-uesoftmodem-nos1
|
||||
dlsim_tm4 dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim
|
||||
pdcchsim pucchsim prachsim syncsim
|
||||
pdcchsim pucchsim prachsim syncsim ulsim
|
||||
#all "add_library" definitions
|
||||
ITTI RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB
|
||||
oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif
|
||||
oai_eth_transpro
|
||||
FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE MSC UTIL OMG_SUMO SECU_OSA
|
||||
SECU_CN SCHED_LIB PHY L2 default_sched remote_sched RAL CN_UTILS
|
||||
GTPV1U SCTP_CLIENT UDP LIB_NAS_UE LFDS LFDS7 SIMU OPENAIR0_LIB)
|
||||
GTPV1U SCTP_CLIENT UDP LIB_NAS_UE LFDS LFDS7 SIMU OPENAIR0_LIB PHY_MEX)
|
||||
if (TARGET ${i})
|
||||
add_dependencies(${i} generate_T)
|
||||
endif()
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -37,6 +37,35 @@
|
||||
#include <errno.h>
|
||||
#include "config_userapi.h"
|
||||
|
||||
|
||||
void parse_stringlist(paramdef_t *cfgoptions, char *val)
|
||||
{
|
||||
char *atoken;
|
||||
char *tokctx;
|
||||
char *tmpval=strdup(val);
|
||||
int numelt=0;
|
||||
|
||||
cfgoptions->numelt=0;
|
||||
|
||||
atoken=strtok_r(tmpval, ",",&tokctx);
|
||||
while(atoken != NULL) {
|
||||
numelt++ ;
|
||||
atoken=strtok_r(NULL, ",",&tokctx);
|
||||
}
|
||||
free(tmpval);
|
||||
config_check_valptr(cfgoptions,(char **)&(cfgoptions->strlistptr), sizeof(char *) * numelt);
|
||||
cfgoptions->numelt=numelt;
|
||||
|
||||
atoken=strtok_r(val, ",",&tokctx);
|
||||
for( int i=0; i<cfgoptions->numelt && atoken != NULL ; i++) {
|
||||
config_check_valptr(cfgoptions,&(cfgoptions->strlistptr[i]),strlen(atoken)+1);
|
||||
sprintf(cfgoptions->strlistptr[i],"%s",atoken);
|
||||
printf_params("[LIBCONFIG] %s[%i]: %s\n", cfgoptions->optname,i,cfgoptions->strlistptr[i]);
|
||||
atoken=strtok_r(NULL, ",",&tokctx);
|
||||
}
|
||||
cfgoptions->numelt=numelt;
|
||||
}
|
||||
|
||||
int processoption(paramdef_t *cfgoptions, char *value)
|
||||
{
|
||||
char *tmpval = value;
|
||||
@@ -66,6 +95,7 @@ char defbool[2]="1";
|
||||
break;
|
||||
|
||||
case TYPE_STRINGLIST:
|
||||
parse_stringlist(cfgoptions,tmpval);
|
||||
break;
|
||||
case TYPE_UINT32:
|
||||
case TYPE_INT32:
|
||||
@@ -140,7 +170,7 @@ char *cfgpath;
|
||||
exit_fun("[CONFIG] Exiting after displaying help\n");
|
||||
}
|
||||
} else {
|
||||
pp=strtok_r(NULL, "_",&tokctx);
|
||||
pp=strtok_r(NULL, " ",&tokctx);
|
||||
if ( prefix != NULL && pp != NULL && strncasecmp(prefix,pp,strlen(pp)) == 0 ) {
|
||||
printf ("Help for %s section:\n",prefix);
|
||||
config_printhelp(cfgoptions,numoptions);
|
||||
@@ -167,17 +197,19 @@ char *cfgpath;
|
||||
((strlen(oneargv) > 2) && (strcmp(oneargv + 2,cfgpath ) == 0 )) ) {
|
||||
char *valptr=NULL;
|
||||
int ret;
|
||||
pp = config_get_if()->argv[i+1];
|
||||
if (pp != NULL && c > 1) {
|
||||
ret = strlen(pp);
|
||||
if (ret > 0 ) {
|
||||
if (pp[0] != '-')
|
||||
valptr=pp;
|
||||
else if ( ret > 1 && pp[0] == '-' && isdigit(pp[1]) )
|
||||
valptr=pp;
|
||||
}
|
||||
if (c > 0) {
|
||||
pp = config_get_if()->argv[i+1];
|
||||
if (pp != NULL ) {
|
||||
ret = strlen(pp);
|
||||
if (ret > 0 ) {
|
||||
if (pp[0] != '-')
|
||||
valptr=pp;
|
||||
else if ( ret > 1 && pp[0] == '-' && isdigit(pp[1]) )
|
||||
valptr=pp;
|
||||
}
|
||||
}
|
||||
}
|
||||
j += processoption(&(cfgoptions[n]), pp);
|
||||
j += processoption(&(cfgoptions[n]), valptr);
|
||||
if ( valptr != NULL ) {
|
||||
i++;
|
||||
c--;
|
||||
|
||||
@@ -0,0 +1,707 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file log.c
|
||||
* \brief log implementaion
|
||||
* \author Navid Nikaein
|
||||
* \date 2009 - 2014
|
||||
* \version 0.5
|
||||
* @ingroup util
|
||||
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE /* required for pthread_getname_np */
|
||||
//#define LOG_TEST 1
|
||||
|
||||
#define COMPONENT_LOG
|
||||
#define COMPONENT_LOG_IF
|
||||
#include <ctype.h>
|
||||
#define LOG_MAIN
|
||||
#include "log.h"
|
||||
#include "vcd_signal_dumper.h"
|
||||
#include "assertions.h"
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
# include "intertask_interface.h"
|
||||
#endif
|
||||
|
||||
# include <pthread.h>
|
||||
# include <string.h>
|
||||
#include <linux/prctl.h>
|
||||
#include "common/config/config_userapi.h"
|
||||
// main log variables
|
||||
|
||||
|
||||
|
||||
|
||||
mapping log_level_names[] = {
|
||||
{"error", OAILOG_ERR},
|
||||
{"file", OAILOG_FILE},
|
||||
{"warn", OAILOG_WARNING},
|
||||
{"info", OAILOG_INFO},
|
||||
{"debug", OAILOG_DEBUG},
|
||||
{"trace", OAILOG_TRACE},
|
||||
{NULL, -1}
|
||||
};
|
||||
|
||||
mapping log_options[] = {
|
||||
{"nocolor", FLAG_NOCOLOR },
|
||||
{"level", FLAG_LEVEL },
|
||||
{"thread", FLAG_THREAD },
|
||||
{NULL,-1}
|
||||
};
|
||||
|
||||
|
||||
mapping log_maskmap[] = {
|
||||
{"prach", DEBUG_PRACH},
|
||||
{"RU", DEBUG_RU},
|
||||
{"LTEESTIM", DEBUG_LTEESTIM},
|
||||
{"ctrlsocket", DEBUG_CTRLSOCKET},
|
||||
{"UE_PHYPROC", DEBUG_UE_PHYPROC},
|
||||
{"UE_TIMING", UE_TIMING},
|
||||
{NULL,-1}
|
||||
};
|
||||
|
||||
char *log_level_highlight_start[] = {LOG_RED, LOG_GREEN, LOG_ORANGE, "", LOG_BLUE, LOG_CYBL}; /*!< \brief Optional start-format strings for highlighting */
|
||||
char *log_level_highlight_end[] = {LOG_RESET,LOG_RESET,LOG_RESET,LOG_RESET, LOG_RESET,LOG_RESET}; /*!< \brief Optional end-format strings for highlighting */
|
||||
|
||||
|
||||
int write_file_matlab(const char *fname,const char *vname,void *data,int length,int dec,char format)
|
||||
{
|
||||
|
||||
FILE *fp=NULL;
|
||||
int i;
|
||||
|
||||
if (data == NULL)
|
||||
return -1;
|
||||
//printf("Writing %d elements of type %d to %s\n",length,format,fname);
|
||||
|
||||
|
||||
if (format == 10 || format ==11 || format == 12 || format == 13 || format == 14) {
|
||||
fp = fopen(fname,"a+");
|
||||
} else if (format != 10 && format !=11 && format != 12 && format != 13 && format != 14) {
|
||||
fp = fopen(fname,"w+");
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (fp== NULL) {
|
||||
printf("[OPENAIR][FILE OUTPUT] Cannot open file %s\n",fname);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (format != 10 && format !=11 && format != 12 && format != 13 && format != 14)
|
||||
fprintf(fp,"%s = [",vname);
|
||||
|
||||
|
||||
switch (format) {
|
||||
case 0: // real 16-bit
|
||||
|
||||
for (i=0; i<length; i+=dec) {
|
||||
fprintf(fp,"%d\n",((short *)data)[i]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 1: // complex 16-bit
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
|
||||
for (i=0; i<length<<1; i+=(2*dec)) {
|
||||
fprintf(fp,"%d + j*(%d)\n",((short *)data)[i],((short *)data)[i+1]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 2: // real 32-bit
|
||||
for (i=0; i<length; i+=dec) {
|
||||
fprintf(fp,"%d\n",((int *)data)[i]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 3: // complex 32-bit
|
||||
for (i=0; i<length<<1; i+=(2*dec)) {
|
||||
fprintf(fp,"%d + j*(%d)\n",((int *)data)[i],((int *)data)[i+1]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 4: // real 8-bit
|
||||
for (i=0; i<length; i+=dec) {
|
||||
fprintf(fp,"%d\n",((char *)data)[i]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 5: // complex 8-bit
|
||||
for (i=0; i<length<<1; i+=(2*dec)) {
|
||||
fprintf(fp,"%d + j*(%d)\n",((char *)data)[i],((char *)data)[i+1]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 6: // real 64-bit
|
||||
for (i=0; i<length; i+=dec) {
|
||||
fprintf(fp,"%lld\n",((long long*)data)[i]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 7: // real double
|
||||
for (i=0; i<length; i+=dec) {
|
||||
fprintf(fp,"%g\n",((double *)data)[i]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 8: // complex double
|
||||
for (i=0; i<length<<1; i+=2*dec) {
|
||||
fprintf(fp,"%g + j*(%g)\n",((double *)data)[i], ((double *)data)[i+1]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 9: // real unsigned 8-bit
|
||||
for (i=0; i<length; i+=dec) {
|
||||
fprintf(fp,"%d\n",((unsigned char *)data)[i]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 10 : // case eren 16 bit complex :
|
||||
|
||||
for (i=0; i<length<<1; i+=(2*dec)) {
|
||||
|
||||
if((i < 2*(length-1)) && (i > 0))
|
||||
fprintf(fp,"%d + j*(%d),",((short *)data)[i],((short *)data)[i+1]);
|
||||
else if (i == 2*(length-1))
|
||||
fprintf(fp,"%d + j*(%d);",((short *)data)[i],((short *)data)[i+1]);
|
||||
else if (i == 0)
|
||||
fprintf(fp,"\n%d + j*(%d),",((short *)data)[i],((short *)data)[i+1]);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 11 : //case eren 16 bit real for channel magnitudes:
|
||||
for (i=0; i<length; i+=dec) {
|
||||
|
||||
if((i <(length-1))&& (i > 0))
|
||||
fprintf(fp,"%d,",((short *)data)[i]);
|
||||
else if (i == (length-1))
|
||||
fprintf(fp,"%d;",((short *)data)[i]);
|
||||
else if (i == 0)
|
||||
fprintf(fp,"\n%d,",((short *)data)[i]);
|
||||
}
|
||||
|
||||
printf("\n eren: length :%d",length);
|
||||
break;
|
||||
|
||||
case 12 : // case eren for log2_maxh real unsigned 8 bit
|
||||
fprintf(fp,"%d \n",((unsigned char *)&data)[0]);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (format != 10 && format !=11 && format !=12 && format != 13 && format != 15) {
|
||||
fprintf(fp,"];\n");
|
||||
fclose(fp);
|
||||
return(0);
|
||||
} else if (format == 10 || format ==11 || format == 12 || format == 13 || format == 15) {
|
||||
fclose(fp);
|
||||
return(0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* get log parameters from configuration file */
|
||||
void log_getconfig(log_t *g_log) {
|
||||
char *gloglevel = NULL;
|
||||
int level;
|
||||
|
||||
|
||||
paramdef_t logparams_defaults[] = LOG_GLOBALPARAMS_DESC;
|
||||
paramdef_t logparams_level[MAX_LOG_PREDEF_COMPONENTS];
|
||||
paramdef_t logparams_logfile[MAX_LOG_PREDEF_COMPONENTS];
|
||||
paramdef_t logparams_debug[sizeof(log_maskmap)/sizeof(mapping)];
|
||||
paramdef_t logparams_matlab[sizeof(log_maskmap)/sizeof(mapping)];
|
||||
|
||||
int ret = config_get( logparams_defaults,sizeof(logparams_defaults)/sizeof(paramdef_t),CONFIG_STRING_LOG_PREFIX);
|
||||
if (ret <0) {
|
||||
fprintf(stderr,"[LOG] init aborted, configuration couldn't be performed");
|
||||
return;
|
||||
}
|
||||
|
||||
for(int i=0; i<logparams_defaults[LOG_OPTIONS_IDX].numelt ; i++) {
|
||||
for(int j=0; log_options[j].name != NULL ; j++) {
|
||||
if (strcmp(logparams_defaults[LOG_OPTIONS_IDX].strlistptr[i],log_options[j].name) == 0) {
|
||||
g_log->flag = g_log->flag | log_options[j].value;
|
||||
break;
|
||||
} else if (log_options[j+1].name == NULL){
|
||||
fprintf(stderr,"Unknown log option: %s\n",logparams_defaults[LOG_OPTIONS_IDX].strlistptr[i]);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* build the parameter array for setting per component log level and infile options */
|
||||
memset(logparams_level, 0, sizeof(paramdef_t)*MAX_LOG_PREDEF_COMPONENTS);
|
||||
memset(logparams_logfile, 0, sizeof(paramdef_t)*MAX_LOG_PREDEF_COMPONENTS);
|
||||
for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_PREDEF_COMPONENTS; i++) {
|
||||
if(g_log->log_component[i].name == NULL) {
|
||||
g_log->log_component[i].name = malloc(16);
|
||||
sprintf((char *)g_log->log_component[i].name,"comp%i?",i);
|
||||
logparams_logfile[i].paramflags = PARAMFLAG_DONOTREAD;
|
||||
logparams_level[i].paramflags = PARAMFLAG_DONOTREAD;
|
||||
}
|
||||
sprintf(logparams_level[i].optname, LOG_CONFIG_LEVEL_FORMAT, g_log->log_component[i].name);
|
||||
sprintf(logparams_logfile[i].optname, LOG_CONFIG_LOGFILE_FORMAT, g_log->log_component[i].name);
|
||||
/* workaround: all log options in existing configuration files use lower case component names
|
||||
where component names include uppercase char in log.h.... */
|
||||
for (int j=0 ; j<strlen(logparams_level[i].optname); j++)
|
||||
logparams_level[i].optname[j] = tolower(logparams_level[i].optname[j]);
|
||||
for (int j=0 ; j<strlen(logparams_level[i].optname); j++)
|
||||
logparams_logfile[i].optname[j] = tolower(logparams_logfile[i].optname[j]);
|
||||
/* */
|
||||
logparams_level[i].defstrval = gloglevel;
|
||||
logparams_logfile[i].defuintval = 0;
|
||||
logparams_logfile[i].numelt = 0;
|
||||
logparams_level[i].numelt = 0;
|
||||
logparams_level[i].type = TYPE_STRING;
|
||||
logparams_logfile[i].type = TYPE_UINT;
|
||||
|
||||
logparams_logfile[i].paramflags = logparams_logfile[i].paramflags|PARAMFLAG_BOOL;
|
||||
}
|
||||
/* read the per component parameters */
|
||||
config_get( logparams_level, MAX_LOG_PREDEF_COMPONENTS,CONFIG_STRING_LOG_PREFIX);
|
||||
config_get( logparams_logfile, MAX_LOG_PREDEF_COMPONENTS,CONFIG_STRING_LOG_PREFIX);
|
||||
/* now set the log levels and infile option, according to what we read */
|
||||
for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_PREDEF_COMPONENTS; i++) {
|
||||
level = map_str_to_int(log_level_names, *(logparams_level[i].strptr));
|
||||
set_log(i, level,1);
|
||||
if (*(logparams_logfile[i].uptr) == 1)
|
||||
set_component_filelog(i);
|
||||
}
|
||||
|
||||
/* build then read the debug and matlab parameter array */
|
||||
for (int i=0;log_maskmap[i].name != NULL ; i++) {
|
||||
sprintf(logparams_debug[i].optname, LOG_CONFIG_DEBUG_FORMAT, log_maskmap[i].name);
|
||||
sprintf(logparams_matlab[i].optname, LOG_CONFIG_MATLAB_FORMAT, log_maskmap[i].name);
|
||||
logparams_debug[i].defuintval = 0;
|
||||
logparams_debug[i].type = TYPE_UINT;
|
||||
logparams_debug[i].paramflags = PARAMFLAG_BOOL;
|
||||
logparams_debug[i].uptr = NULL;
|
||||
logparams_debug[i].chkPptr = NULL;
|
||||
logparams_debug[i].numelt = 0;
|
||||
logparams_matlab[i].defuintval = 0;
|
||||
logparams_matlab[i].type = TYPE_UINT;
|
||||
logparams_matlab[i].paramflags = PARAMFLAG_BOOL;
|
||||
logparams_matlab[i].uptr = NULL;
|
||||
logparams_matlab[i].chkPptr = NULL;
|
||||
logparams_matlab[i].numelt = 0;
|
||||
}
|
||||
config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX);
|
||||
config_get( logparams_matlab,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX);
|
||||
/* set the debug mask according to the debug parameters values */
|
||||
for (int i=0; log_maskmap[i].name != NULL ; i++) {
|
||||
if (*(logparams_debug[i].uptr) )
|
||||
g_log->debug_mask = g_log->debug_mask | log_maskmap[i].value;
|
||||
if (*(logparams_matlab[i].uptr) )
|
||||
g_log->matlab_mask = g_log->matlab_mask | log_maskmap[i].value;
|
||||
}
|
||||
}
|
||||
|
||||
int register_log_component(char *name, char *fext, int compidx)
|
||||
{
|
||||
int computed_compidx=compidx;
|
||||
|
||||
if (strlen(fext) > 3) {
|
||||
fext[3]=0; /* limit log file extension to 3 chars */
|
||||
}
|
||||
if (compidx < 0) { /* this is not a pre-defined component */
|
||||
for (int i = MAX_LOG_PREDEF_COMPONENTS; i< MAX_LOG_COMPONENTS; i++) {
|
||||
if (g_log->log_component[i].name == NULL) {
|
||||
computed_compidx=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (computed_compidx >= 0 && computed_compidx <MAX_LOG_COMPONENTS) {
|
||||
g_log->log_component[computed_compidx].name = strdup(name);
|
||||
g_log->log_component[computed_compidx].level = LOG_ERR;
|
||||
g_log->log_component[computed_compidx].interval = 1;
|
||||
g_log->log_component[computed_compidx].stream = NULL;
|
||||
g_log->log_component[computed_compidx].filelog = 0;
|
||||
g_log->log_component[computed_compidx].filelog_name = malloc(strlen(name)+16);/* /tmp/<name>.%s rounded to ^2 */
|
||||
sprintf(g_log->log_component[computed_compidx].filelog_name,"/tmp/%s.%s",name,fext);
|
||||
} else {
|
||||
fprintf(stderr,"{LOG} %s %d Couldn't register componemt %s\n",__FILE__,__LINE__,name);
|
||||
}
|
||||
return computed_compidx;
|
||||
}
|
||||
|
||||
int logInit (void)
|
||||
{
|
||||
int i;
|
||||
g_log = calloc(1, sizeof(log_t));
|
||||
|
||||
if (g_log == NULL) {
|
||||
perror ("cannot allocated memory for log generation module \n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
memset(g_log,0,sizeof(log_t));
|
||||
|
||||
|
||||
|
||||
register_log_component("PHY","log",PHY);
|
||||
register_log_component("MAC","log",MAC);
|
||||
register_log_component("OPT","log",OPT);
|
||||
register_log_component("RLC","log",RLC);
|
||||
register_log_component("PDCP","log",PDCP);
|
||||
register_log_component("RRC","log",RRC);
|
||||
register_log_component("OMG","csv",OMG);
|
||||
register_log_component("OTG","log",OTG);
|
||||
register_log_component("OTG_LATENCY","dat",OTG_LATENCY);
|
||||
register_log_component("OTG_LATENCY_BG","dat",OTG_LATENCY_BG);
|
||||
register_log_component("OTG_GP","dat",OTG_GP);
|
||||
register_log_component("OTG_GP_BG","dat",OTG_GP_BG);
|
||||
register_log_component("OTG_JITTER","dat",OTG_JITTER);
|
||||
register_log_component("OCG","",OCG);
|
||||
register_log_component("PERF","",PERF);
|
||||
register_log_component("OIP","",OIP);
|
||||
register_log_component("CLI","",CLI);
|
||||
register_log_component("MSC","log",MSC);
|
||||
register_log_component("OCM","log",OCM);
|
||||
register_log_component("HW","",HW);
|
||||
register_log_component("OSA","",OSA);
|
||||
register_log_component("eRAL","",RAL_ENB);
|
||||
register_log_component("mRAL","",RAL_UE);
|
||||
register_log_component("ENB_APP","log",ENB_APP);
|
||||
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);
|
||||
register_log_component("NAS","log",NAS);
|
||||
register_log_component("UDP","",UDP_);
|
||||
|
||||
|
||||
register_log_component("GTPV1U","",GTPU);
|
||||
|
||||
|
||||
register_log_component("S1AP","",S1AP);
|
||||
|
||||
|
||||
register_log_component("SCTP","",SCTP);
|
||||
register_log_component("RRH","",RRH);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
g_log->level2string[OAILOG_ERR] = "E"; // ERROR
|
||||
g_log->level2string[OAILOG_WARNING] = "W"; // WARNING
|
||||
g_log->level2string[OAILOG_INFO] = "I"; //INFO
|
||||
g_log->level2string[OAILOG_DEBUG] = "D"; // DEBUG
|
||||
g_log->level2string[OAILOG_FILE] = "F"; // file
|
||||
g_log->level2string[OAILOG_TRACE] = "T"; // TRACE
|
||||
|
||||
|
||||
g_log->onlinelog = 1; //online log file
|
||||
g_log->filelog = 0;
|
||||
|
||||
|
||||
|
||||
g_log->filelog_name = "/tmp/openair.log";
|
||||
|
||||
log_getconfig(g_log);
|
||||
|
||||
|
||||
// could put a loop here to check for all comps
|
||||
for (i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
|
||||
if (g_log->log_component[i].filelog == 1 ) {
|
||||
g_log->log_component[i].stream = fopen(g_log->log_component[i].filelog_name,"w");
|
||||
g_log->log_component[i].fwrite = vfprintf;
|
||||
} else if (g_log->log_component[i].filelog == 1 ) {
|
||||
g_log->log_component[i].stream = fopen(g_log->filelog_name,"w");
|
||||
g_log->log_component[i].fwrite = vfprintf;
|
||||
} else if (g_log->onlinelog == 1 ) {
|
||||
g_log->log_component[i].stream = stdout;
|
||||
g_log->log_component[i].fwrite = vfprintf;
|
||||
}
|
||||
}
|
||||
|
||||
// set all unused component items to 0, they are for non predefined components
|
||||
for (i=MAX_LOG_PREDEF_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
|
||||
memset(&(g_log->log_component[i]),0,sizeof(log_component_t));
|
||||
}
|
||||
printf("log init done\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
char *log_getthreadname(char *threadname, int bufsize) {
|
||||
|
||||
int rt = pthread_getname_np(pthread_self(), threadname,bufsize) ;
|
||||
if (rt == 0)
|
||||
{
|
||||
return threadname;
|
||||
} else {
|
||||
return "thread?";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void logRecord_mt(const char *file, const char *func, int line, int comp, int level, const char* format, ... )
|
||||
{
|
||||
|
||||
char threadname[PR_SET_NAME];
|
||||
char log_buffer[MAX_LOG_TOTAL];
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
snprintf(log_buffer, MAX_LOG_TOTAL , "%s%s[%s]%s %s %s",
|
||||
log_level_highlight_end[level],
|
||||
( (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,PR_SET_NAME+1):""),
|
||||
format);
|
||||
|
||||
g_log->log_component[comp].fwrite(g_log->log_component[comp].stream,log_buffer, args);
|
||||
va_end(args);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int set_log(int component, int level, int interval)
|
||||
{
|
||||
/* Checking parameters */
|
||||
DevCheck((component >= MIN_LOG_COMPONENTS) && (component < MAX_LOG_COMPONENTS),
|
||||
component, MIN_LOG_COMPONENTS, MAX_LOG_COMPONENTS);
|
||||
DevCheck((level < NUM_LOG_LEVEL) && (level >= OAILOG_ERR), level, NUM_LOG_LEVEL,
|
||||
OAILOG_ERR);
|
||||
DevCheck((interval >= 0) && (interval <= 0xFF), interval, 0, 0xFF);
|
||||
|
||||
g_log->log_component[component].level = level;
|
||||
|
||||
|
||||
g_log->log_component[component].interval = interval;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void set_glog(int level)
|
||||
{
|
||||
for (int c=0; c< MAX_LOG_COMPONENTS; c++ ) {
|
||||
g_log->log_component[c].level = level;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void set_glog_onlinelog(int enable)
|
||||
{
|
||||
g_log->onlinelog = enable;
|
||||
}
|
||||
void set_glog_filelog(int enable)
|
||||
{
|
||||
g_log->filelog = enable;
|
||||
}
|
||||
|
||||
void set_component_filelog(int comp)
|
||||
{
|
||||
if (g_log->log_component[comp].filelog == 0) {
|
||||
g_log->log_component[comp].filelog = 1;
|
||||
|
||||
if (g_log->log_component[comp].stream == NULL) {
|
||||
g_log->log_component[comp].stream = fopen(g_log->log_component[comp].filelog_name,"w");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* for the two functions below, the passed array must have a final entry
|
||||
* with string value NULL
|
||||
*/
|
||||
/* map a string to an int. Takes a mapping array and a string as arg */
|
||||
int map_str_to_int(mapping *map, const char *str)
|
||||
{
|
||||
while (1) {
|
||||
if (map->name == NULL) {
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (!strcmp(map->name, str)) {
|
||||
return(map->value);
|
||||
}
|
||||
|
||||
map++;
|
||||
}
|
||||
}
|
||||
|
||||
/* map an int to a string. Takes a mapping array and a value */
|
||||
char *map_int_to_str(mapping *map, int val)
|
||||
{
|
||||
while (1) {
|
||||
if (map->name == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (map->value == val) {
|
||||
return map->name;
|
||||
}
|
||||
|
||||
map++;
|
||||
}
|
||||
}
|
||||
|
||||
int is_newline( char *str, int size)
|
||||
{
|
||||
int i;
|
||||
|
||||
for ( i = 0; i < size; i++ ) {
|
||||
if ( str[i] == '\n' ) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* if we get all the way to here, there must not have been a newline! */
|
||||
return 0;
|
||||
}
|
||||
|
||||
void logClean (void)
|
||||
{
|
||||
int i;
|
||||
LOG_I(PHY,"\n");
|
||||
|
||||
|
||||
|
||||
|
||||
for (i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
|
||||
if (g_log->log_component[i].stream != NULL) {
|
||||
fclose(g_log->log_component[i].stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef LOG_TEST
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
logInit();
|
||||
|
||||
|
||||
test_log();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int test_log(void)
|
||||
{
|
||||
LOG_ENTER(MAC); // because the default level is DEBUG
|
||||
LOG_I(EMU, "1 Starting OAI logs version %s Build date: %s on %s\n",
|
||||
BUILD_VERSION, BUILD_DATE, BUILD_HOST);
|
||||
LOG_D(MAC, "1 debug MAC \n");
|
||||
LOG_W(MAC, "1 warning MAC \n");
|
||||
|
||||
set_log(EMU, OAILOG_INFO, FLAG_ONLINE);
|
||||
set_log(MAC, OAILOG_WARNING, 0);
|
||||
|
||||
LOG_I(EMU, "2 Starting OAI logs version %s Build date: %s on %s\n",
|
||||
BUILD_VERSION, BUILD_DATE, BUILD_HOST);
|
||||
LOG_E(MAC, "2 error MAC\n");
|
||||
LOG_D(MAC, "2 debug MAC \n");
|
||||
LOG_W(MAC, "2 warning MAC \n");
|
||||
LOG_I(MAC, "2 info MAC \n");
|
||||
|
||||
|
||||
set_log(MAC, OAILOG_NOTICE, 1);
|
||||
|
||||
LOG_ENTER(MAC);
|
||||
LOG_I(EMU, "3 Starting OAI logs version %s Build date: %s on %s\n",
|
||||
BUILD_VERSION, BUILD_DATE, BUILD_HOST);
|
||||
LOG_D(MAC, "3 debug MAC \n");
|
||||
LOG_W(MAC, "3 warning MAC \n");
|
||||
LOG_I(MAC, "3 info MAC \n");
|
||||
|
||||
set_log(MAC, LOG_DEBUG,1);
|
||||
set_log(EMU, LOG_DEBUG,1);
|
||||
|
||||
LOG_ENTER(MAC);
|
||||
LOG_I(EMU, "4 Starting OAI logs version %s Build date: %s on %s\n",
|
||||
BUILD_VERSION, BUILD_DATE, BUILD_HOST);
|
||||
LOG_D(MAC, "4 debug MAC \n");
|
||||
LOG_W(MAC, "4 warning MAC \n");
|
||||
LOG_I(MAC, "4 info MAC \n");
|
||||
|
||||
|
||||
set_log(MAC, LOG_DEBUG,0);
|
||||
set_log(EMU, LOG_DEBUG,0);
|
||||
|
||||
LOG_I(LOG, "5 Starting OAI logs version %s Build date: %s on %s\n",
|
||||
BUILD_VERSION, BUILD_DATE, BUILD_HOST);
|
||||
LOG_D(MAC, "5 debug MAC \n");
|
||||
LOG_W(MAC, "5 warning MAC \n");
|
||||
LOG_I(MAC, "5 info MAC \n");
|
||||
|
||||
|
||||
set_log(MAC, LOG_TRACE,0X07F);
|
||||
set_log(EMU, LOG_TRACE,0X07F);
|
||||
|
||||
LOG_ENTER(MAC);
|
||||
LOG_I(LOG, "6 Starting OAI logs version %s Build date: %s on %s\n",
|
||||
BUILD_VERSION, BUILD_DATE, BUILD_HOST);
|
||||
LOG_D(MAC, "6 debug MAC \n");
|
||||
LOG_W(MAC, "6 warning MAC \n");
|
||||
LOG_I(MAC, "6 info MAC \n");
|
||||
LOG_EXIT(MAC);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -52,7 +52,7 @@
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
#include <pthread.h>
|
||||
|
||||
#include "T.h"
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -73,8 +73,7 @@ extern "C" {
|
||||
* @ingroup _macro
|
||||
* @brief the macros that describe the maximum length of LOG
|
||||
* @{*/
|
||||
#define MAX_LOG_ITEM 100 /*!< \brief the maximum length of a LOG item, what is LOG_ITEM ??? */
|
||||
#define MAX_LOG_INFO 1000 /*!< \brief the maximum length of a log */
|
||||
|
||||
#define MAX_LOG_TOTAL 1500 /*!< \brief the maximum length of a log */
|
||||
/* @}*/
|
||||
|
||||
@@ -82,18 +81,15 @@ extern "C" {
|
||||
* @ingroup _macro
|
||||
* @brief LOG defines 9 levels of messages for users. Importance of these levels decrease gradually from 0 to 8
|
||||
* @{*/
|
||||
# define LOG_EMERG 0 /*!< \brief system is unusable */
|
||||
# define LOG_ALERT 1 /*!< \brief action must be taken immediately */
|
||||
# define LOG_CRIT 2 /*!< \brief critical conditions */
|
||||
# define LOG_ERR 3 /*!< \brief error conditions */
|
||||
# define LOG_WARNING 4 /*!< \brief warning conditions */
|
||||
# define LOG_NOTICE 5 /*!< \brief normal but significant condition */
|
||||
# define LOG_INFO 6 /*!< \brief informational */
|
||||
# define LOG_DEBUG 7 /*!< \brief debug-level messages */
|
||||
# define LOG_FILE 8 /*!< \brief message sequence chart -level */
|
||||
# define LOG_TRACE 9 /*!< \brief trace-level messages */
|
||||
# define LOG_MATLAB 10 /*!< \brief output to matlab file */
|
||||
#define NUM_LOG_LEVEL 11 /*!< \brief the number of message levels users have with LOG */
|
||||
|
||||
# define OAILOG_ERR 0 /*!< \brief critical error conditions, impact on "must have" fuctinalities */
|
||||
# define OAILOG_FILE 1 /*!< \brief important informational messages, but everything OK */
|
||||
# define OAILOG_WARNING 2 /*!< \brief warning conditions, shouldn't happen but doesn't impact "must have" functionalities */
|
||||
# define OAILOG_INFO 3 /*!< \brief informational messages most people don't need, shouldn't impact real-time behavior */
|
||||
# define OAILOG_DEBUG 4 /*!< \brief first level debug-level messages, for developers , may impact real-time behavior */
|
||||
# define OAILOG_TRACE 5 /*!< \brief second level debug-level messages, for developers ,likely impact real-time behavior*/
|
||||
|
||||
#define NUM_LOG_LEVEL 6 /*!< \brief the number of message levels users have with LOG */
|
||||
/* @}*/
|
||||
|
||||
|
||||
@@ -104,7 +100,7 @@ extern "C" {
|
||||
|
||||
/* .log_format = 0x13 uncolored standard messages
|
||||
* .log_format = 0x93 colored standard messages */
|
||||
|
||||
/* keep white space in first position; switching it to 0 allows colors to be disabled*/
|
||||
#define LOG_RED "\033[1;31m" /*!< \brief VT100 sequence for bold red foreground */
|
||||
#define LOG_GREEN "\033[32m" /*!< \brief VT100 sequence for green foreground */
|
||||
#define LOG_ORANGE "\033[93m" /*!< \brief VT100 sequence for orange foreground */
|
||||
@@ -118,34 +114,37 @@ extern "C" {
|
||||
* @ingroup _macro
|
||||
* @brief Macros used to write lines (local/remote) in syslog.conf
|
||||
* @{*/
|
||||
#define LOG_LOCAL 0x01
|
||||
#define LOG_REMOTE 0x02
|
||||
|
||||
#define FLAG_COLOR 0x001 /*!< \brief defaults */
|
||||
#define FLAG_PID 0x002 /*!< \brief defaults */
|
||||
#define FLAG_COMP 0x004
|
||||
#define FLAG_THREAD 0x008 /*!< \brief all : 255/511 */
|
||||
#define FLAG_LEVEL 0x010
|
||||
#define FLAG_FUNCT 0x020
|
||||
#define FLAG_FILE_LINE 0x040
|
||||
#define FLAG_TIME 0x100
|
||||
|
||||
#define LOG_NONE 0x00
|
||||
#define LOG_LOW 0x5
|
||||
#define LOG_MED 0x15
|
||||
#define LOG_HIGH 0x35
|
||||
#define LOG_FULL 0x75
|
||||
|
||||
#define OAI_OK 0 /*!< \brief all ok */
|
||||
#define OAI_ERR 1 /*!< \brief generic error */
|
||||
#define OAI_ERR_READ_ONLY 2 /*!< \brief tried to write to read-only item */
|
||||
#define OAI_ERR_NOTFOUND 3 /*!< \brief something wasn't found */
|
||||
/* @}*/
|
||||
|
||||
|
||||
//static char *log_level_highlight_start[] = {LOG_RED, LOG_RED, LOG_RED, LOG_RED, LOG_BLUE, "", "", "", LOG_GREEN}; /*!< \brief Optional start-format strings for highlighting */
|
||||
#define FLAG_NOCOLOR 0x0001 /*!< \brief use colors in log messages, depending on level */
|
||||
#define FLAG_THREAD 0x0008 /*!< \brief display thread name in log messages */
|
||||
#define FLAG_LEVEL 0x0010 /*!< \brief display log level in log messages */
|
||||
#define FLAG_FUNCT 0x0020
|
||||
#define FLAG_FILE_LINE 0x0040
|
||||
#define FLAG_TIME 0x0100
|
||||
|
||||
#define SET_LOG_OPTION(O) g_log->flag = (g_log->flag | O)
|
||||
#define CLEAR_LOG_OPTION(O) g_log->flag = (g_log->flag & (~O))
|
||||
|
||||
/** @defgroup macros to identify a debug entity
|
||||
* @ingroup each macro is a bit mask where the unique bit set identifies an entity to be debugged
|
||||
* it allows to dynamically activate or not blocks of code
|
||||
* @brief
|
||||
* @{*/
|
||||
#define DEBUG_PRACH (1<<0)
|
||||
#define DEBUG_RU (1<<1)
|
||||
#define DEBUG_UE_PHYPROC (1<<2)
|
||||
#define DEBUG_LTEESTIM (1<<3)
|
||||
#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))
|
||||
|
||||
#define SET_LOG_MATLAB(O) g_log->matlab_mask = (g_log->matlab_mask | O)
|
||||
#define CLEAR_LOG_MATLAB(O) g_log->matlab_mask = (g_log->matlab_mask & (~O))
|
||||
|
||||
|
||||
//static char *log_level_highlight_end[] = {LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, "", "", "", LOG_RESET}; /*!< \brief Optional end-format strings for highlighting */
|
||||
|
||||
typedef enum {
|
||||
MIN_LOG_COMPONENTS = 0,
|
||||
@@ -193,60 +192,40 @@ comp_name_t;
|
||||
|
||||
#define MAX_LOG_DYNALLOC_COMPONENTS 20
|
||||
#define MAX_LOG_COMPONENTS (MAX_LOG_PREDEF_COMPONENTS + MAX_LOG_DYNALLOC_COMPONENTS)
|
||||
//#define msg printf
|
||||
|
||||
|
||||
typedef struct {
|
||||
char *name; /*!< \brief string name of item */
|
||||
int value; /*!< \brief integer value of mapping */
|
||||
} mapping;
|
||||
|
||||
typedef int(*log_write_func_t)(FILE *stream, const char *format, va_list ap );
|
||||
|
||||
typedef struct {
|
||||
const char *name;
|
||||
int level;
|
||||
int flag;
|
||||
int interval;
|
||||
int fd;
|
||||
int filelog;
|
||||
char *filelog_name;
|
||||
|
||||
const char *name;
|
||||
int level;
|
||||
int flag;
|
||||
int interval;
|
||||
int filelog;
|
||||
char *filelog_name;
|
||||
FILE *stream;
|
||||
log_write_func_t fwrite;
|
||||
/* SR: make the log buffer component relative */
|
||||
char log_buffer[MAX_LOG_TOTAL];
|
||||
char log_buffer[MAX_LOG_TOTAL];
|
||||
} log_component_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned int remote_ip;
|
||||
unsigned int audit_ip;
|
||||
int remote_level;
|
||||
int facility;
|
||||
int audit_facility;
|
||||
int format;
|
||||
} log_config_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
log_component_t log_component[MAX_LOG_COMPONENTS];
|
||||
log_config_t config;
|
||||
char* level2string[NUM_LOG_LEVEL];
|
||||
int level;
|
||||
int onlinelog;
|
||||
int flag;
|
||||
int syslog;
|
||||
int filelog;
|
||||
char* filelog_name;
|
||||
int async; // asynchronous mode, via dedicated log thread + log buffer
|
||||
uint64_t debug_mask;
|
||||
uint64_t matlab_mask;
|
||||
} log_t;
|
||||
|
||||
typedef struct LOG_params {
|
||||
const char *file;
|
||||
const char *func;
|
||||
int line;
|
||||
int comp;
|
||||
int level;
|
||||
const char *format;
|
||||
char l_buff_info [MAX_LOG_INFO];
|
||||
int len;
|
||||
} LOG_params;
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
typedef enum log_instance_type_e {
|
||||
@@ -258,10 +237,6 @@ typedef enum log_instance_type_e {
|
||||
void log_set_instance_type (log_instance_type_t instance);
|
||||
#endif
|
||||
|
||||
#define LOG_MEM_SIZE 100*1024*1024
|
||||
#define LOG_MEM_FILE "./logmem.log"
|
||||
int logInit_log_mem(void);
|
||||
void output_log_mem(void);
|
||||
|
||||
#ifdef LOG_MAIN
|
||||
log_t *g_log;
|
||||
@@ -279,28 +254,20 @@ extern log_t *g_log;
|
||||
/*----------------------------------------------------------------------------*/
|
||||
int logInit (void);
|
||||
void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
|
||||
void logRecord(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
|
||||
int set_comp_log(int component, int level, int verbosity, int interval);
|
||||
|
||||
int set_log(int component, int level, int interval);
|
||||
void set_glog(int level, int verbosity);
|
||||
void set_log_syslog(int enable);
|
||||
void set_glog(int level);
|
||||
|
||||
void set_glog_onlinelog(int enable);
|
||||
void set_glog_filelog(int enable);
|
||||
|
||||
void set_component_filelog(int comp);
|
||||
|
||||
int map_str_to_int(mapping *map, const char *str);
|
||||
char *map_int_to_str(mapping *map, int val);
|
||||
void logClean (void);
|
||||
int is_newline( char *str, int size);
|
||||
void *log_thread_function(void * list);
|
||||
|
||||
int register_log_component(char *name, char *fext, int compidx);
|
||||
/** @defgroup _logIt logIt function
|
||||
* @ingroup _macro
|
||||
* @brief Macro used to call tr_log_full_ex with file, function and line information
|
||||
* @{*/
|
||||
|
||||
#define logIt(component, level, format, args...) (g_log->log_component[component].interval?logRecord_mt(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args):(void)0)
|
||||
|
||||
|
||||
/* @}*/
|
||||
|
||||
@@ -319,24 +286,34 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
|
||||
#define CONFIG_STRING_LOG_PREFIX "log_config"
|
||||
|
||||
#define LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL "global_log_level"
|
||||
#define LOG_CONFIG_STRING_GLOBAL_LOG_VERBOSITY "global_log_verbosity"
|
||||
#define LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE "global_log_online"
|
||||
#define LOG_CONFIG_STRING_GLOBAL_LOG_INFILE "global_log_infile"
|
||||
#define LOG_CONFIG_STRING_GLOBAL_LOG_OPTIONS "global_log_options"
|
||||
|
||||
#define LOG_CONFIG_LEVEL_FORMAT "%s_log_level"
|
||||
#define LOG_CONFIG_VERBOSITY_FORMAT "%s_log_verbosity"
|
||||
#define LOG_CONFIG_LOGFILE_FORMAT "%s_log_infile"
|
||||
#define LOG_CONFIG_DEBUG_FORMAT "%s_debug"
|
||||
#define LOG_CONFIG_MATLAB_FORMAT "%s_matlab"
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* LOG globalconfiguration parameters */
|
||||
/* optname help paramflags XXXptr defXXXval type numelt */
|
||||
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define LOG_CONFIG_HELP_OPTIONS " list of comma separated options to enable log module behavior. Available options: \n"\
|
||||
" nocolor: disable color usage in log messages\n"\
|
||||
" level: add log level indication in log messages\n"\
|
||||
" thread: add threads names in log messages\n"
|
||||
|
||||
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* LOG globalconfiguration parameters */
|
||||
/* optname help paramflags XXXptr defXXXval type numelt */
|
||||
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define LOG_GLOBALPARAMS_DESC { \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, NULL, 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_VERBOSITY,NULL, 0, strptr:(char **)&glogverbo, defstrval:log_verbosity_names[2].name, TYPE_STRING, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, NULL, 0, iptr:&(g_log->onlinelog), defintval:1, TYPE_INT, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_INFILE, NULL, 0, iptr:&(g_log->filelog), defintval:0, TYPE_INT, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, "Default log level for all componemts\n", 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, "Default console output option, for all components\n", 0, iptr:&(g_log->onlinelog), defintval:1, TYPE_INT, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_OPTIONS, LOG_CONFIG_HELP_OPTIONS, 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST,0} \
|
||||
}
|
||||
|
||||
#define LOG_OPTIONS_IDX 2
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
/** @defgroup _debugging debugging macros
|
||||
* @ingroup _macro
|
||||
@@ -344,32 +321,46 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
|
||||
* @{*/
|
||||
|
||||
// debugging macros(g_log->log_component[component].interval?logRecord_mt(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args):(void)0)
|
||||
# if T_TRACER
|
||||
# include "T.h"
|
||||
# define LOG_I(c, x...) do { if (T_stdout) { logIt(c, LOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_W(c, x...) do { if (T_stdout) { logIt(c, LOG_WARNING, x) ;} else { T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_E(c, x...) do { if (T_stdout) { logIt(c, LOG_ERR, x) ;} else { T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_D(c, x...) do { if (T_stdout) { logIt(c, LOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_T(c, x...) do { if (T_stdout) { logIt(c, LOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_G(c, x...) do { if (T_stdout) { logIt(c, LOG_EMERG, x) ;}} while (0) /* */
|
||||
# define LOG_A(c, x...) do { if (T_stdout) { logIt(c, LOG_ALERT, x) ;}} while (0) /* */
|
||||
# define LOG_C(c, x...) do { if (T_stdout) { logIt(c, LOG_CRIT, x) ;}} while (0) /* */
|
||||
# define LOG_N(c, x...) do { if (T_stdout) { logIt(c, LOG_NOTICE, x) ;}} while (0) /* */
|
||||
# define LOG_F(c, x...) do { if (T_stdout) { logIt(c, LOG_FILE, x) ;}} while (0) /* */
|
||||
# define LOG_M(file, vector, data, len, dec, format) write_file_matlab(file, vector, data, len, dec, format)/* */
|
||||
# else /* T_TRACER */
|
||||
# if T_TRACER
|
||||
/* per component, level dependant macros */
|
||||
# define LOG_I(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_W(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ;} else { T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_E(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} else { T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_D(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_T(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_F(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_FILE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_FILE, x) ;}} while (0) /* */
|
||||
# define nfapi_log(FILE, FNC, LN, COMP, LVL, F...) do { if (T_stdout) { logRecord_mt(__FILE__, __FUNCTION__, __LINE__,COMP, LVL, F) ;}} while (0) /* */
|
||||
/* bitmask dependant macros, to isolate debugging code */
|
||||
# define LOG_DEBUG_BEGIN(D) if (g_log->debug_mask & D) {
|
||||
# define LOG_DEBUG_END }
|
||||
/* bitmask dependant macros, to generate matlab files */
|
||||
# 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...) /* */
|
||||
# define LOG_E(c, x...) /* */
|
||||
# define LOG_D(c, x...) /* */
|
||||
# define LOG_T(c, x...) /* */
|
||||
# define LOG_G(c, x...) /* */
|
||||
# define LOG_A(c, x...) /* */
|
||||
# define LOG_C(c, x...) /* */
|
||||
# define LOG_N(c, x...) /* */
|
||||
# define LOG_F(c, x...) /* */
|
||||
# define LOG_M(file, vector, data, len, dec, format) /* */
|
||||
# define nfapi_log(FILE, FNC, LN, COMP, LVL, FMT...)
|
||||
# define LOG_DEBUG_BEGIN(D) if (0) {
|
||||
# define LOG_DEBUG_END }
|
||||
# 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)
|
||||
/* @}*/
|
||||
|
||||
|
||||
@@ -23,15 +23,8 @@
|
||||
|
||||
extern log_t *g_log;
|
||||
|
||||
#if !defined(LOG_NO_THREAD)
|
||||
extern LOG_params log_list[2000];
|
||||
extern pthread_mutex_t log_lock;
|
||||
extern pthread_cond_t log_notify;
|
||||
extern int log_shutdown;
|
||||
#endif
|
||||
|
||||
extern mapping log_level_names[];
|
||||
extern mapping log_verbosity_names[];
|
||||
extern mapping log_options[];
|
||||
extern mapping log_maskmap[];
|
||||
|
||||
extern int log_mem_flag;
|
||||
extern char * log_mem_filename;
|
||||
@@ -749,7 +749,6 @@ ID = LEGACY_OSA_TRACE
|
||||
DESC = OSA legacy logs - trace level
|
||||
GROUP = ALL:LEGACY_OSA:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
ID = LEGACY_SIM_INFO
|
||||
DESC = SIM legacy logs - info level
|
||||
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_INFO:LEGACY
|
||||
@@ -770,7 +769,6 @@ ID = LEGACY_SIM_TRACE
|
||||
DESC = SIM legacy logs - trace level
|
||||
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
# this is a bad hack but I won't fix (function util_print_hex_octets
|
||||
# in openairinterface5g/openair2/LAYER2/PDCP_v10.1.0/pdcp_util.c
|
||||
# does funky things with the LOG_x macros but we work on the C pre-processor
|
||||
|
||||
@@ -174,7 +174,8 @@ void usage(void)
|
||||
" -ip <host> connect to given IP address (default %s)\n"
|
||||
" -p <port> connect to given port (default %d)\n"
|
||||
" -b <event> <arg> <vcd name> trace as binary (0 off, anything else on)\n"
|
||||
" -l <event> <arg> <vcd name> trace as uint64_t\n",
|
||||
" -l <event> <arg> <vcd name> trace as uint64_t\n"
|
||||
" -vcd trace all VCD variables and functions\n",
|
||||
DEFAULT_REMOTE_IP,
|
||||
DEFAULT_REMOTE_PORT
|
||||
);
|
||||
@@ -192,6 +193,20 @@ void force_stop(int x)
|
||||
run = 0;
|
||||
}
|
||||
|
||||
vcd_vars *add_var(vcd_vars *vars, int nvars,
|
||||
char *event, char *arg, char *vcd_name, int is_boolean)
|
||||
{
|
||||
if (nvars % 64 == 0) {
|
||||
vars = realloc(vars, (nvars+64) * sizeof(vcd_vars));
|
||||
if (vars == NULL) abort();
|
||||
}
|
||||
vars[nvars].event = event;
|
||||
vars[nvars].arg = arg;
|
||||
vars[nvars].vcd_name = vcd_name;
|
||||
vars[nvars].boolean = is_boolean;
|
||||
return vars;
|
||||
}
|
||||
|
||||
int main(int n, char **v)
|
||||
{
|
||||
char *output_filename = NULL;
|
||||
@@ -202,11 +217,12 @@ int main(int n, char **v)
|
||||
int *is_on;
|
||||
int number_of_events;
|
||||
int i;
|
||||
vcd_vars vars[n];
|
||||
vcd_vars *vars = NULL;
|
||||
int nvars = 0;
|
||||
view *vcd_view;
|
||||
event_handler *h;
|
||||
logger *textlog;
|
||||
int all_vcd = 0;
|
||||
|
||||
/* write on a socket fails if the other end is closed and we get SIGPIPE */
|
||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort();
|
||||
@@ -221,19 +237,22 @@ int main(int n, char **v)
|
||||
if (!strcmp(v[i], "-p"))
|
||||
{ if (i > n-2) usage(); port = atoi(v[++i]); continue; }
|
||||
if (!strcmp(v[i], "-b")) { if(i>n-4)usage();
|
||||
vars[nvars].event = v[++i];
|
||||
vars[nvars].arg = v[++i];
|
||||
vars[nvars].vcd_name = v[++i];
|
||||
vars[nvars++].boolean = 1;
|
||||
char *event = v[++i];
|
||||
char *arg = v[++i];
|
||||
char *vcd_name = v[++i];
|
||||
vars = add_var(vars, nvars, event, arg, vcd_name, 1);
|
||||
nvars++;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(v[i], "-l")) { if(i>n-4)usage();
|
||||
vars[nvars].event = v[++i];
|
||||
vars[nvars].arg = v[++i];
|
||||
vars[nvars].vcd_name = v[++i];
|
||||
vars[nvars++].boolean = 0;
|
||||
char *event = v[++i];
|
||||
char *arg = v[++i];
|
||||
char *vcd_name = v[++i];
|
||||
vars = add_var(vars, nvars, event, arg, vcd_name, 0);
|
||||
nvars++;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(v[i], "-vcd")) { all_vcd = 1; continue; }
|
||||
usage();
|
||||
}
|
||||
|
||||
@@ -260,11 +279,32 @@ int main(int n, char **v)
|
||||
/* create the view */
|
||||
vcd_view = new_view_vcd();
|
||||
|
||||
if (all_vcd) {
|
||||
/* activate all VCD traces */
|
||||
for (i = 0; i < number_of_events; i++) {
|
||||
int is_boolean;
|
||||
int prefix_length;
|
||||
char *name = event_name_from_id(database, i);
|
||||
char *var_prefix = "VCD_VARIABLE_";
|
||||
char *fun_prefix = "VCD_FUNCTION_";
|
||||
if (!strncmp(name, var_prefix, strlen(var_prefix))) {
|
||||
prefix_length = strlen(var_prefix);
|
||||
is_boolean = 0;
|
||||
} else if (!strncmp(name, fun_prefix, strlen(fun_prefix))) {
|
||||
prefix_length = strlen(fun_prefix);
|
||||
is_boolean = 1;
|
||||
} else
|
||||
continue;
|
||||
vars = add_var(vars, nvars,
|
||||
name, "value", name+prefix_length, is_boolean);
|
||||
nvars++;
|
||||
}
|
||||
}
|
||||
|
||||
/* setup traces */
|
||||
for (i = 0; i < nvars; i++) {
|
||||
char format[256];
|
||||
if (strlen(vars[i].arg) > 256-3) abort();
|
||||
if (strlen(vars[i].vcd_name) > 256-1) abort();
|
||||
if (strlen(vars[i].arg) + strlen(vars[i].vcd_name) > 256-16) abort();
|
||||
sprintf(format, "%c [%s] %s",
|
||||
vars[i].boolean ? 'b' : 'l',
|
||||
vars[i].arg,
|
||||
|
||||
@@ -39,7 +39,6 @@ void output_log_mem(void);
|
||||
#define _Assert_Exit_ \
|
||||
{ \
|
||||
fprintf(stderr, "\nExiting execution\n"); \
|
||||
output_log_mem(); \
|
||||
display_backtrace(); \
|
||||
fflush(stdout); \
|
||||
fflush(stderr); \
|
||||
|
||||
@@ -117,19 +117,16 @@ int signal_handle(int *end)
|
||||
case SIGUSR1:
|
||||
SIG_DEBUG("Received SIGUSR1\n");
|
||||
*end = 1;
|
||||
output_log_mem();
|
||||
break;
|
||||
|
||||
case SIGSEGV: /* Fall through */
|
||||
case SIGABRT:
|
||||
SIG_DEBUG("Received SIGABORT\n");
|
||||
output_log_mem();
|
||||
backtrace_handle_signal(&info);
|
||||
break;
|
||||
|
||||
case SIGINT:
|
||||
printf("Received SIGINT\n");
|
||||
output_log_mem();
|
||||
itti_send_terminate_message(TASK_UNKNOWN);
|
||||
*end = 1;
|
||||
break;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#ifdef TELNETSRV_LOADER_MAIN
|
||||
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
|
||||
#include "common/utils/load_module_shlib.h"
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#ifdef TELNETSRV_PHYCMD_MAIN
|
||||
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
|
||||
#include "openair1/PHY/phy_extern.h"
|
||||
|
||||
@@ -52,8 +52,7 @@
|
||||
#define TELNETSERVERCODE
|
||||
#include "telnetsrv.h"
|
||||
#define TELNETSRV_PROCCMD_MAIN
|
||||
#include "log.h"
|
||||
#include "log_extern.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/config/config_userapi.h"
|
||||
#include "openair1/PHY/phy_extern.h"
|
||||
#include "telnetsrv_proccmd.h"
|
||||
@@ -200,16 +199,30 @@ int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
print_threads(buf,debug,prnt);
|
||||
}
|
||||
if (strcasestr(buf,"loglvl") != NULL) {
|
||||
prnt("component verbosity level enabled\n");
|
||||
prnt(" component level enabled\n");
|
||||
for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
|
||||
if (g_log->log_component[i].name != NULL) {
|
||||
prnt("%02i %17.17s:%10.10s%10.10s %s\n",i ,g_log->log_component[i].name,
|
||||
map_int_to_str(log_verbosity_names,g_log->log_component[i].flag),
|
||||
prnt("%02i %17.17s:%10.10s %s\n",i ,g_log->log_component[i].name,
|
||||
map_int_to_str(log_level_names,g_log->log_component[i].level),
|
||||
((g_log->log_component[i].interval>0)?"Y":"N") );
|
||||
}
|
||||
}
|
||||
}
|
||||
if (strcasestr(buf,"logopt") != NULL) {
|
||||
prnt(" option enabled\n");
|
||||
for (int i=0; log_options[i].name != NULL; i++) {
|
||||
prnt("%02i %17.17s %10.10s \n",i ,log_options[i].name,
|
||||
((g_log->flag & log_options[i].value)?"Y":"N") );
|
||||
}
|
||||
}
|
||||
if (strcasestr(buf,"dbgopt") != NULL) {
|
||||
prnt(" option debug matlab\n");
|
||||
for (int i=0; log_maskmap[i].name != NULL ; i++) {
|
||||
prnt("%02i %17.17s %5.5s %5.5s\n",i ,log_maskmap[i].name,
|
||||
((g_log->debug_mask & log_maskmap[i].value)?"Y":"N"),
|
||||
((g_log->matlab_mask & log_maskmap[i].value)?"Y":"N") );
|
||||
}
|
||||
}
|
||||
if (strcasestr(buf,"config") != NULL) {
|
||||
prnt("Command line arguments:\n");
|
||||
for (int i=0; i < config_get_if()->argc; i++) {
|
||||
@@ -324,24 +337,76 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
|
||||
prnt("Available log levels: \n ");
|
||||
for (int i=0; log_level_names[i].name != NULL; i++)
|
||||
prnt("%s ",log_level_names[i].name);
|
||||
prnt("\nAvailable verbosity: \n ");
|
||||
for (int i=0; log_verbosity_names[i].name != NULL; i++)
|
||||
prnt("%s ",log_verbosity_names[i].name);
|
||||
prnt("\n");
|
||||
prnt("Available display options: \n ");
|
||||
for (int i=0; log_options[i].name != NULL; i++)
|
||||
prnt("%s ",log_options[i].name);
|
||||
prnt("\n");
|
||||
prnt("Available debug or matlab options: \n ");
|
||||
for (int i=0; log_maskmap[i].name != NULL; i++)
|
||||
prnt("%s ",log_maskmap[i].name);
|
||||
prnt("\n");
|
||||
proccmd_show("loglvl",debug,prnt);
|
||||
proccmd_show("logopt",debug,prnt);
|
||||
proccmd_show("dbgopt",debug,prnt);
|
||||
}
|
||||
else if (strcasestr(logsubcmd,"help") != NULL) {
|
||||
prnt(PROCCMD_LOG_HELP_STRING);
|
||||
} else {
|
||||
prnt("%s: wrong log command...\n",logsubcmd);
|
||||
}
|
||||
} else if ( s == 2 && logsubcmd != NULL) {
|
||||
char *opt=NULL;
|
||||
char *logparam=NULL;
|
||||
int l;
|
||||
int optbit;
|
||||
|
||||
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) {
|
||||
prnt("option %s unknown\n",opt);
|
||||
} else {
|
||||
if (idx1 > 0)
|
||||
SET_LOG_OPTION(optbit);
|
||||
else
|
||||
CLEAR_LOG_OPTION(optbit);
|
||||
proccmd_show("logopt",debug,prnt);
|
||||
}
|
||||
}
|
||||
else if (l == 2 && strcmp(logparam,"debug") == 0){
|
||||
optbit=map_str_to_int(log_maskmap,opt);
|
||||
if (optbit < 0) {
|
||||
prnt("debug flag %s unknown\n",opt);
|
||||
} else {
|
||||
if (idx1 > 0)
|
||||
SET_LOG_DEBUG(optbit);
|
||||
else
|
||||
CLEAR_LOG_DEBUG(optbit);
|
||||
proccmd_show("dbgopt",debug,prnt);
|
||||
}
|
||||
}
|
||||
else if (l == 2 && strcmp(logparam,"matlab") == 0){
|
||||
optbit=map_str_to_int(log_maskmap,opt);
|
||||
if (optbit < 0) {
|
||||
prnt("matlab flag %s unknown\n",opt);
|
||||
} else {
|
||||
if (idx1 > 0)
|
||||
SET_LOG_MATLAB(optbit);
|
||||
else
|
||||
CLEAR_LOG_MATLAB(optbit);
|
||||
proccmd_show("dbgopt",debug,prnt);
|
||||
}
|
||||
}
|
||||
if (logparam != NULL) free(logparam);
|
||||
if (opt != NULL) free(opt);
|
||||
} else if ( s == 3 && logsubcmd != NULL) {
|
||||
int level, verbosity, interval;
|
||||
int level, interval;
|
||||
char *tmpstr=NULL;
|
||||
char *logparam=NULL;
|
||||
int l;
|
||||
|
||||
level = verbosity = interval = -1;
|
||||
level = interval = -1;
|
||||
l=sscanf(logsubcmd,"%m[^'_']_%m[^'_']",&logparam,&tmpstr);
|
||||
if (debug > 0)
|
||||
prnt("l=%i, %s %s\n",l,((logparam==NULL)?"\"\"":logparam), ((tmpstr==NULL)?"\"\"":tmpstr));
|
||||
@@ -349,9 +414,6 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
|
||||
if (strcmp(logparam,"level") == 0) {
|
||||
level=map_str_to_int(log_level_names,tmpstr);
|
||||
if (level < 0) prnt("level %s unknown\n",tmpstr);
|
||||
} else if (strcmp(logparam,"verbos") == 0) {
|
||||
verbosity=map_str_to_int(log_verbosity_names,tmpstr);
|
||||
if (verbosity < 0) prnt("verbosity %s unknown\n",tmpstr);
|
||||
} else {
|
||||
prnt("%s%s unknown log sub command \n",logparam, tmpstr);
|
||||
}
|
||||
@@ -372,17 +434,13 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
|
||||
if (level < 0) {
|
||||
level=g_log->log_component[i].level;
|
||||
}
|
||||
if (verbosity < 0) {
|
||||
verbosity=g_log->log_component[i].flag;
|
||||
}
|
||||
if (interval < 0) {
|
||||
interval=g_log->log_component[i].interval;
|
||||
}
|
||||
set_comp_log(i, level, verbosity, interval);
|
||||
prnt("log level/verbosity comp %i %s set to %s / %s (%s)\n",
|
||||
set_log(i, level, interval);
|
||||
prnt("log level comp %i %s set to %s (%s)\n",
|
||||
i,((g_log->log_component[i].name==NULL)?"":g_log->log_component[i].name),
|
||||
map_int_to_str(log_level_names,g_log->log_component[i].level),
|
||||
map_int_to_str(log_verbosity_names,g_log->log_component[i].flag),
|
||||
((g_log->log_component[i].interval>0)?"enabled":"disabled"));
|
||||
|
||||
|
||||
|
||||
@@ -49,9 +49,12 @@ telnetshell_vardef_t proc_vardef[] = {
|
||||
online, noonline: enable or disable console logs \n\
|
||||
enable, disable id1-id2: enable or disable logs for components index id1 to id2 \n\
|
||||
level_<level> id1-id2: set log level to <level> for components index id1 to id2 \n\
|
||||
level_<verbosity> id1-id2: set log verbosity to <verbosity> for components index id1 to id2 \n\
|
||||
use the show command to get the values for <level>, <verbosity> and the list of component indexes \
|
||||
that can be used for id1 and id2 \n"
|
||||
use the show command to get the authorized values for <level> and the list of component \
|
||||
indexes that can be used for id1 and id2 \n\
|
||||
print_<opt> <0|1> disable or enable the \"opt\" log option, use the show command to get \
|
||||
the available options\n\
|
||||
matlab_<opt> debug_<func> disable or enable the debug code or matlab file generation \
|
||||
for \"func\" function. use the show command to get the available options\n"
|
||||
|
||||
#define PROCCMD_THREAD_HELP_STRING " thread sub commands: \n\
|
||||
<thread id> aff <core> : set affinity of thread <thread id> to core <core> \n\
|
||||
|
||||
@@ -47,7 +47,7 @@ extern RAN_CONTEXT_t RC;
|
||||
#include <vendor_ext.h>
|
||||
#include "fapi_stub.h"
|
||||
//#include "fapi_l1.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "openair2/LAYER2/MAC/mac_proto.h"
|
||||
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
@@ -193,26 +193,25 @@ typedef struct {
|
||||
static pnf_info pnf;
|
||||
static pthread_t pnf_start_pthread;
|
||||
|
||||
extern void nfapi_log(char *file, char *func, int line, int comp, int level, const char* format, va_list args);
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -680,36 +680,13 @@ void vnf_deallocate(void* ptr) {
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
extern void nfapi_log(char *file, char *func, int line, int comp, int level, const char* format, va_list args);
|
||||
|
||||
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);
|
||||
|
||||
@@ -67,15 +67,12 @@ void generate_qpsk_table(void)
|
||||
void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
{
|
||||
|
||||
ccodedot11_init();
|
||||
ccodedot11_init_inv();
|
||||
|
||||
ccodelte_init();
|
||||
ccodelte_init_inv();
|
||||
|
||||
init_dfts();
|
||||
|
||||
|
||||
phy_generate_viterbi_tables();
|
||||
phy_generate_viterbi_tables_lte();
|
||||
|
||||
load_codinglib();
|
||||
@@ -86,6 +83,7 @@ void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
|
||||
generate_64qam_table();
|
||||
generate_16qam_table();
|
||||
generate_qpsk_table();
|
||||
generate_RIV_tables();
|
||||
|
||||
init_unscrambling_lut();
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "RadioResourceConfigDedicated.h"
|
||||
#include "TDD-Config.h"
|
||||
#include "MBSFN-SubframeConfigList.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "assertions.h"
|
||||
#include <math.h>
|
||||
|
||||
@@ -477,7 +477,7 @@ void phy_config_sib13_eNB(module_id_t Mod_id,int CC_id,int mbsfn_Area_idx,
|
||||
|
||||
if (mbsfn_Area_idx == 0) {
|
||||
fp->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
|
||||
LOG_N(PHY,"Fix me: only called when mbsfn_Area_idx == 0)\n");
|
||||
LOG_I(PHY,"Fix me: only called when mbsfn_Area_idx == 0)\n");
|
||||
}
|
||||
|
||||
lte_gold_mbsfn(fp,RC.eNB[Mod_id][CC_id]->lte_gold_mbsfn_table,fp->Nid_cell_mbsfn);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "RadioResourceConfigDedicated.h"
|
||||
#include "TDD-Config.h"
|
||||
#include "MBSFN-SubframeConfigList.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "assertions.h"
|
||||
#include <math.h>
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "RadioResourceConfigDedicated.h"
|
||||
#include "TDD-Config.h"
|
||||
#include "MBSFN-SubframeConfigList.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "assertions.h"
|
||||
#include <math.h>
|
||||
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
|
||||
@@ -190,7 +190,7 @@ void phy_config_sib13_ue(module_id_t Mod_id,int CC_id,uint8_t eNB_id,int mbsfn_A
|
||||
|
||||
if (mbsfn_Area_idx == 0) {
|
||||
fp->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
|
||||
LOG_N(PHY,"Fix me: only called when mbsfn_Area_idx == 0)\n");
|
||||
LOG_I(PHY,"Fix me: only called when mbsfn_Area_idx == 0)\n");
|
||||
}
|
||||
|
||||
lte_gold_mbsfn(fp,PHY_vars_UE_g[Mod_id][CC_id]->lte_gold_mbsfn_table,fp->Nid_cell_mbsfn);
|
||||
|
||||
@@ -373,6 +373,8 @@ void phy_config_request(PHY_Config_t *phy_config);
|
||||
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
|
||||
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
void init_dfts(void);
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#define DEBUG_PHY
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "PHY/impl_defs_top.h"
|
||||
#include "openair2/LAYER2/MAC/mac_proto.h"
|
||||
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#define DEBUG_PHY
|
||||
|
||||
|
||||
@@ -274,11 +274,11 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
|
||||
|
||||
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
LOG_M_BEGIN(DEBUG_LTEESTIM);
|
||||
LOG_M("primary_sync0.m","psync0",primary_synch0_time,frame_parms->ofdm_symbol_size,1,1);
|
||||
LOG_M("primary_sync1.m","psync1",primary_synch1_time,frame_parms->ofdm_symbol_size,1,1);
|
||||
LOG_M("primary_sync2.m","psync2",primary_synch2_time,frame_parms->ofdm_symbol_size,1,1);
|
||||
#endif
|
||||
LOG_M_END
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -330,10 +330,6 @@ static inline int abs32(int x)
|
||||
return (((int)((short*)&x)[0])*((int)((short*)&x)[0]) + ((int)((short*)&x)[1])*((int)((short*)&x)[1]));
|
||||
}
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
int debug_cnt=0;
|
||||
#endif
|
||||
|
||||
#define SHIFT 17
|
||||
|
||||
int lte_sync_time(int **rxdata, ///rx data in time domain
|
||||
@@ -464,7 +460,8 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
|
||||
LOG_I(PHY,"[UE] lte_sync_time: Sync source = %d, Peak found at pos %d, val = %d (%d dB)\n",sync_source,peak_pos,peak_val,dB_fixed(peak_val)/2);
|
||||
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
LOG_M_BEGIN(DEBUG_LTEESTIM)
|
||||
static int debug_cnt;
|
||||
if (debug_cnt == 0) {
|
||||
LOG_M("sync_corr0_ue.m","synccorr0",sync_corr_ue0,2*length,1,2);
|
||||
LOG_M("sync_corr1_ue.m","synccorr1",sync_corr_ue1,2*length,1,2);
|
||||
@@ -474,9 +471,7 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
|
||||
} else {
|
||||
debug_cnt++;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
LOG_M_END
|
||||
|
||||
|
||||
return(peak_pos);
|
||||
|
||||
@@ -81,7 +81,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
|
||||
|
||||
//compute frequency-domain representation of 6144-sample chunk
|
||||
dft6144((int16_t *)rxp,
|
||||
sp);
|
||||
sp,1);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/sse_intrin.h"
|
||||
//#define DEBUG_CH
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
|
||||
#include "T.h"
|
||||
#include "lte_estimation.h"
|
||||
|
||||
// round(exp(sqrt(-1)*(pi/2)*[0:1:N-1]/N)*pow2(15))
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
#include "transport_common_proto.h"
|
||||
#include "assertions.h"
|
||||
#include "T.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_extern.h"
|
||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
#include "PHY/LTE_TRANSPORT/transport_eNB.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include <syscall.h>
|
||||
#include "targets/RT/USER/rt_wrapper.h"
|
||||
|
||||
@@ -511,16 +511,15 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
|
||||
proc->tep[i].total_worker = worker_num;
|
||||
proc->tep[i].current_worker = i;
|
||||
if (pthread_cond_signal(&proc->tep[i].cond_te) != 0) {
|
||||
printf("[eNB] ERROR pthread_cond_signal for te thread exit\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return (-1);
|
||||
printf("[eNB] ERROR pthread_cond_signal for te thread exit\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fill in the "e"-sequence from 36-212, V8.6 2009-03, p. 16-17 (for each "e") and concatenate the
|
||||
// outputs for each code segment, see Section 5.1.5 p.20
|
||||
|
||||
for (r=0,r_offset=0; r<dlsch->harq_processes[harq_pid]->C; r++) {
|
||||
|
||||
// get information for E for the segments that are handled by the worker thread
|
||||
|
||||
@@ -35,11 +35,11 @@
|
||||
#include "PHY/CODING/coding_extern.h"
|
||||
#include "PHY/CODING/lte_interleaver_inline.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_eNB.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
|
||||
//#define DEBUG_DLSCH_MODULATION
|
||||
#define NEW_ALLOC_RE
|
||||
//#define NEW_ALLOC_RE
|
||||
|
||||
//#define is_not_pilot(pilots,re,nushift,use2ndpilots) ((pilots==0) || ((re!=nushift) && (re!=nushift+6)&&((re!=nushift+3)||(use2ndpilots==1))&&((re!=nushift+9)||(use2ndpilots==1)))?1:0)
|
||||
|
||||
@@ -706,6 +706,7 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
|
||||
int *P2_SHIFT)
|
||||
{
|
||||
|
||||
|
||||
uint8_t *x0 = NULL;
|
||||
MIMO_mode_t mimo_mode = -1;
|
||||
|
||||
@@ -2099,10 +2100,33 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
uint8_t mod_order0 = 0;
|
||||
uint8_t mod_order1 = 0;
|
||||
int16_t amp_rho_a, amp_rho_b;
|
||||
int16_t qam16_table_a0[4],qam64_table_a0[8],qam16_table_b0[4],qam64_table_b0[8];//qpsk_table_a0[2],qpsk_table_b0[2]
|
||||
int16_t qam16_table_a1[4],qam64_table_a1[8],qam16_table_b1[4],qam64_table_b1[8];//qpsk_table_a1[2],qpsk_table_b1[2]
|
||||
int16_t qam16_table_a0[4],qam64_table_a0[8],qam16_table_b0[4],qam64_table_b0[8],qpsk_table_a0[2],qpsk_table_b0[2];
|
||||
int16_t qam16_table_a1[4],qam64_table_a1[8],qam16_table_b1[4],qam64_table_b1[8],qpsk_table_a1[2],qpsk_table_b1[2];
|
||||
|
||||
int16_t *qam_table_s0=NULL,*qam_table_s1=NULL;
|
||||
int (*allocate_REs)(PHY_VARS_eNB*,
|
||||
int **,
|
||||
uint32_t*,
|
||||
uint32_t*,
|
||||
uint16_t,
|
||||
uint32_t,
|
||||
LTE_DL_eNB_HARQ_t *,
|
||||
LTE_DL_eNB_HARQ_t *,
|
||||
uint8_t,
|
||||
int16_t,
|
||||
uint8_t,
|
||||
int16_t *,
|
||||
int16_t *,
|
||||
uint32_t *,
|
||||
uint8_t,
|
||||
uint8_t,
|
||||
uint8_t,
|
||||
uint8_t,
|
||||
uint8_t,
|
||||
int *,
|
||||
int *);
|
||||
|
||||
|
||||
|
||||
int P1_SHIFT[13],P2_SHIFT[13];
|
||||
int offset,nushiftmod3;
|
||||
@@ -2201,7 +2225,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
amp_rho_b = (int16_t)(((int32_t)amp*dlsch1->sqrt_rho_b)>>13);
|
||||
}
|
||||
|
||||
/*if(mod_order0 == 2)
|
||||
if(mod_order0 == 2)
|
||||
{
|
||||
for(i=0;i<2;i++)
|
||||
{
|
||||
@@ -2209,7 +2233,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
qpsk_table_b0[i] = (int16_t)(((int32_t)qpsk_table[i]*amp_rho_b)>>15);
|
||||
}
|
||||
}
|
||||
else*/ if (mod_order0 == 4)
|
||||
else if (mod_order0 == 4)
|
||||
for (i=0;i<4; i++) {
|
||||
qam16_table_a0[i] = (int16_t)(((int32_t)qam16_table[i]*amp_rho_a)>>15);
|
||||
qam16_table_b0[i] = (int16_t)(((int32_t)qam16_table[i]*amp_rho_b)>>15);
|
||||
@@ -2220,14 +2244,14 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
qam64_table_b0[i] = (int16_t)(((int32_t)qam64_table[i]*amp_rho_b)>>15);
|
||||
}
|
||||
|
||||
/*if (mod_order1 == 2)
|
||||
if (mod_order1 == 2)
|
||||
{
|
||||
for (i=0; i<2; i++) {
|
||||
qpsk_table_a1[i] = (int16_t)(((int32_t)qpsk_table[i]*amp_rho_a)>>15);
|
||||
qpsk_table_b1[i] = (int16_t)(((int32_t)qpsk_table[i]*amp_rho_b)>>15);
|
||||
}
|
||||
}
|
||||
else*/ if (mod_order1 == 4)
|
||||
else if (mod_order1 == 4)
|
||||
for (i=0; i<4; i++) {
|
||||
qam16_table_a1[i] = (int16_t)(((int32_t)qam16_table[i]*amp_rho_a)>>15);
|
||||
qam16_table_b1[i] = (int16_t)(((int32_t)qam16_table[i]*amp_rho_b)>>15);
|
||||
@@ -2348,24 +2372,36 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
|
||||
re_offset = frame_parms->first_carrier_offset;
|
||||
symbol_offset = (uint32_t)frame_parms->ofdm_symbol_size*(l+(subframe_offset*nsymb));
|
||||
allocate_REs = allocate_REs_in_RB;
|
||||
|
||||
switch (mod_order0) {
|
||||
case 2:
|
||||
qam_table_s0 = NULL;
|
||||
/*if (pilots) {
|
||||
if (pilots) {
|
||||
qam_table_s0 = qpsk_table_b0;
|
||||
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
|
||||
allocate_REs_in_RB_pilots_QPSK_siso :
|
||||
allocate_REs_in_RB;
|
||||
}
|
||||
else {
|
||||
qam_table_s0 = qpsk_table_a0;
|
||||
|
||||
}*/
|
||||
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
|
||||
allocate_REs_in_RB_no_pilots_QPSK_siso :
|
||||
allocate_REs_in_RB;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (pilots) {
|
||||
qam_table_s0 = qam16_table_b0;
|
||||
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
|
||||
allocate_REs_in_RB_pilots_16QAM_siso :
|
||||
allocate_REs_in_RB;
|
||||
}
|
||||
else {
|
||||
qam_table_s0 = qam16_table_a0;
|
||||
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
|
||||
allocate_REs_in_RB_no_pilots_16QAM_siso :
|
||||
allocate_REs_in_RB;
|
||||
|
||||
}
|
||||
break;
|
||||
@@ -2373,23 +2409,41 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
case 6:
|
||||
if (pilots) {
|
||||
qam_table_s0 = qam64_table_b0;
|
||||
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
|
||||
allocate_REs_in_RB_pilots_64QAM_siso :
|
||||
allocate_REs_in_RB;
|
||||
}
|
||||
else {
|
||||
qam_table_s0 = qam64_table_a0;
|
||||
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
|
||||
allocate_REs_in_RB_no_pilots_64QAM_siso :
|
||||
allocate_REs_in_RB;
|
||||
}
|
||||
/* TODO: this is a quick hack to be removed. There is a problem
|
||||
* with above code that needs to be analyzed and fixed. In the
|
||||
* meantime, let's use the generic function.
|
||||
*/
|
||||
allocate_REs = allocate_REs_in_RB;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
/* TODO: hack, to be removed. The power is too different from
|
||||
* previous version. Some more work/validation is needed before
|
||||
* we switch to the new version.
|
||||
*/
|
||||
allocate_REs = allocate_REs_in_RB;
|
||||
|
||||
switch (mod_order1) {
|
||||
case 2:
|
||||
qam_table_s1 = NULL;
|
||||
/*if (pilots) {
|
||||
allocate_REs = allocate_REs_in_RB;
|
||||
if (pilots) {
|
||||
qam_table_s1 = qpsk_table_b1;
|
||||
}
|
||||
else {
|
||||
qam_table_s1 = qpsk_table_a1;
|
||||
}*/
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (pilots) {
|
||||
@@ -2465,7 +2519,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
rb);
|
||||
|
||||
|
||||
allocate_REs_in_RB(phy_vars_eNB,
|
||||
allocate_REs(phy_vars_eNB,
|
||||
txdataF,
|
||||
&jj,
|
||||
&jj2,
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include "PHY/CODING/lte_interleaver_inline.h"
|
||||
#include "transport_eNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int mbsfn_flag,
|
||||
|
||||
@@ -40,8 +40,7 @@
|
||||
#include "transport_proto.h"
|
||||
#include "transport_common_proto.h"
|
||||
#include "assertions.h"
|
||||
#include "T.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
|
||||
//#define DEBUG_DCI_ENCODING 1
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -37,7 +37,7 @@
|
||||
|
||||
//#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
|
||||
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
//#define DEBUG_DL_MOBIPASS
|
||||
//#define DEBUG_UL_MOBIPASS
|
||||
#define SUBFRAME_SKIP_NUM_MOBIPASS 8
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -35,14 +35,9 @@
|
||||
//#include "prach.h"
|
||||
#include "PHY/LTE_TRANSPORT/if4_tools.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "prach_extern.h"
|
||||
|
||||
//#define PRACH_DEBUG 1
|
||||
//#define PRACH_WRITE_OUTPUT_DEBUG 1
|
||||
|
||||
|
||||
|
||||
#if (RRC_VERSION < MAKE_VERSION(14, 0, 0))
|
||||
#define rx_prach0 rx_prach
|
||||
#endif
|
||||
@@ -70,10 +65,6 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
uint8_t Ncs_config;
|
||||
uint8_t restricted_set;
|
||||
uint8_t n_ra_prb;
|
||||
|
||||
#ifdef PRACH_DEBUG
|
||||
int frame;
|
||||
#endif
|
||||
int subframe;
|
||||
int16_t *prachF=NULL;
|
||||
int16_t **rxsigF=NULL;
|
||||
@@ -92,7 +83,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
uint8_t not_found;
|
||||
int k=0;
|
||||
uint16_t u;
|
||||
int16_t *Xu;
|
||||
int16_t *Xu=0;
|
||||
uint16_t offset;
|
||||
int16_t Ncp;
|
||||
uint16_t first_nonzero_root_idx=0;
|
||||
@@ -107,10 +98,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
int prach_ifft_cnt=0;
|
||||
#endif
|
||||
#ifdef PRACH_DEBUG
|
||||
int en=0;
|
||||
int en0=0;
|
||||
#endif
|
||||
|
||||
|
||||
if (ru) {
|
||||
fp = &ru->frame_parms;
|
||||
@@ -162,61 +150,49 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if (br_flag == 1) {
|
||||
prach_ifftp = eNB->prach_vars_br.prach_ifft[ce_level];
|
||||
#ifdef PRACH_DEBUG
|
||||
frame = eNB->proc.frame_prach_br;
|
||||
#endif
|
||||
subframe = eNB->proc.subframe_prach_br;
|
||||
prachF = eNB->prach_vars_br.prachF;
|
||||
rxsigF = eNB->prach_vars_br.rxsigF[ce_level];
|
||||
#ifdef PRACH_DEBUG
|
||||
if ((frame&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d, rootSequenceIndex %d, repetition number %d,numRepetitionsPrePreambleAttempt %d\n",
|
||||
br_flag,ce_level,frame,subframe,
|
||||
LOG_DEBUG_BEGIN(PRACH)
|
||||
if (((ru->proc.frame_prach)&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d, rootSequenceIndex %d, repetition number %d,numRepetitionsPrePreambleAttempt %d\n",
|
||||
br_flag,ce_level,ru->proc.frame_prach,subframe,
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],
|
||||
prach_ConfigIndex,rootSequenceIndex,
|
||||
eNB->prach_vars_br.repetition_number[ce_level],
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level]);
|
||||
#endif
|
||||
LOG_DEBUG_END
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
prach_ifftp = eNB->prach_vars.prach_ifft[0];
|
||||
#ifdef PRACH_DEBUG
|
||||
frame = eNB->proc.frame_prach;
|
||||
#endif
|
||||
subframe = eNB->proc.subframe_prach;
|
||||
prachF = eNB->prach_vars.prachF;
|
||||
rxsigF = eNB->prach_vars.rxsigF[0];
|
||||
#ifdef PRACH_DEBUG
|
||||
//if ((frame&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n", subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex,rootSequenceIndex);
|
||||
#endif
|
||||
LOG_DEBUG_BEGIN(PRACH)
|
||||
if (((ru->proc.frame_prach)&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n", subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex,rootSequenceIndex);
|
||||
LOG_DEBUG_END
|
||||
}
|
||||
}
|
||||
else {
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if (br_flag == 1) {
|
||||
#ifdef PRACH_DEBUG
|
||||
frame = ru->proc.frame_prach_br;
|
||||
#endif
|
||||
subframe = ru->proc.subframe_prach_br;
|
||||
rxsigF = ru->prach_rxsigF_br[ce_level];
|
||||
#ifdef PRACH_DEBUG
|
||||
if ((frame&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
|
||||
br_flag,ce_level,frame,subframe,fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],prach_ConfigIndex);
|
||||
#endif
|
||||
LOG_DEBUG_BEGIN(PRACH)
|
||||
if (((ru->proc.frame_prach)&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
|
||||
br_flag,ce_level,ru->proc.frame_prach,subframe,fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],prach_ConfigIndex);
|
||||
LOG_DEBUG_END
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#ifdef PRACH_DEBUG
|
||||
frame = ru->proc.frame_prach;
|
||||
#endif
|
||||
subframe = ru->proc.subframe_prach;
|
||||
rxsigF = ru->prach_rxsigF;
|
||||
#ifdef PRACH_DEBUG
|
||||
if ((frame&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
|
||||
LOG_DEBUG_BEGIN(PRACH)
|
||||
if (((ru->proc.frame_prach)&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
|
||||
subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex);
|
||||
#endif
|
||||
LOG_DEBUG_END
|
||||
}
|
||||
|
||||
}
|
||||
@@ -227,31 +203,28 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
if (ru->if_south == LOCAL_RF) { // set the time-domain signal if we have to use it in this node
|
||||
// DJP - indexing below in subframe zero takes us off the beginning of the array???
|
||||
prach[aa] = (int16_t*)&ru->common.rxdata[aa][(subframe*fp->samples_per_tti)-ru->N_TA_offset];
|
||||
#ifdef PRACH_DEBUG
|
||||
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;
|
||||
|
||||
#ifdef PRACH_WRITE_OUTPUT_DEBUG
|
||||
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);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (dbEn0>32)
|
||||
if (dB_fixed(en0)>32)
|
||||
{
|
||||
#ifdef PRACH_WRITE_OUTPUT_DEBUG
|
||||
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);
|
||||
#endif
|
||||
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,frame,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);
|
||||
}
|
||||
#endif
|
||||
LOG_M_END
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,9 +306,9 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
if (((eNB!=NULL) && (ru->function != NGFI_RAU_IF4p5))||
|
||||
((eNB==NULL) && (ru->function == NGFI_RRU_IF4p5))) { // compute the DFTs of the PRACH temporal resources
|
||||
// Do forward transform
|
||||
#ifdef PRACH_DEBUG
|
||||
LOG_DEBUG_BEGIN(PRACH)
|
||||
LOG_D(PHY,"rx_prach: Doing FFT for N_RB_UL %d nb_rx:%d Ncp:%d\n",fp->N_RB_UL, nb_rx, Ncp);
|
||||
#endif
|
||||
LOG_DEBUG_END
|
||||
for (aa=0; aa<nb_rx; aa++) {
|
||||
AssertFatal(prach[aa]!=NULL,"prach[%d] is null\n",aa);
|
||||
prach2 = prach[aa] + (Ncp<<1);
|
||||
@@ -358,10 +331,10 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
if (prach_fmt == 4) {
|
||||
dft256(prach2,rxsigF[aa],1);
|
||||
} else {
|
||||
dft3072(prach2,rxsigF[aa]);
|
||||
dft3072(prach2,rxsigF[aa],1);
|
||||
|
||||
if (prach_fmt>1)
|
||||
dft3072(prach2+6144,rxsigF[aa]+6144);
|
||||
dft3072(prach2+6144,rxsigF[aa]+6144,1);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -372,10 +345,10 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
dft1024(prach2,rxsigF[aa],1);
|
||||
fft_size = 1024;
|
||||
} else {
|
||||
dft6144(prach2,rxsigF[aa]);
|
||||
dft6144(prach2,rxsigF[aa],1);
|
||||
|
||||
if (prach_fmt>1)
|
||||
dft6144(prach2+12288,rxsigF[aa]+12288);
|
||||
dft6144(prach2+12288,rxsigF[aa]+12288,1);
|
||||
|
||||
fft_size = 6144;
|
||||
}
|
||||
@@ -386,22 +359,22 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
if (prach_fmt == 4) {
|
||||
dft2048(prach2,rxsigF[aa],1);
|
||||
} else {
|
||||
dft12288(prach2,rxsigF[aa]);
|
||||
dft12288(prach2,rxsigF[aa],1);
|
||||
|
||||
if (prach_fmt>1)
|
||||
dft12288(prach2+24576,rxsigF[aa]+24576);
|
||||
dft12288(prach2+24576,rxsigF[aa]+24576,1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 75:
|
||||
if (prach_fmt == 4) {
|
||||
dft3072(prach2,rxsigF[aa]);
|
||||
dft3072(prach2,rxsigF[aa],1);
|
||||
} else {
|
||||
dft18432(prach2,rxsigF[aa]);
|
||||
dft18432(prach2,rxsigF[aa],1);
|
||||
|
||||
if (prach_fmt>1)
|
||||
dft18432(prach2+36864,rxsigF[aa]+36864);
|
||||
dft18432(prach2+36864,rxsigF[aa]+36864,1);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -411,19 +384,19 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
if (prach_fmt == 4) {
|
||||
dft4096(prach2,rxsigF[aa],1);
|
||||
} else {
|
||||
dft24576(prach2,rxsigF[aa]);
|
||||
dft24576(prach2,rxsigF[aa],1);
|
||||
|
||||
if (prach_fmt>1)
|
||||
dft24576(prach2+49152,rxsigF[aa]+49152);
|
||||
dft24576(prach2+49152,rxsigF[aa]+49152,1);
|
||||
}
|
||||
} else {
|
||||
if (prach_fmt == 4) {
|
||||
dft3072(prach2,rxsigF[aa]);
|
||||
dft3072(prach2,rxsigF[aa],1);
|
||||
} else {
|
||||
dft18432(prach2,rxsigF[aa]);
|
||||
dft18432(prach2,rxsigF[aa],1);
|
||||
|
||||
if (prach_fmt>1)
|
||||
dft18432(prach2+36864,rxsigF[aa]+36864);
|
||||
dft18432(prach2+36864,rxsigF[aa]+36864,1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -466,10 +439,10 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
return;
|
||||
} else if (eNB!=NULL) {
|
||||
|
||||
#ifdef PRACH_DEBUG
|
||||
en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
|
||||
LOG_DEBUG_BEGIN(PRACH)
|
||||
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
|
||||
if ((en > 60)&&(br_flag==1)) LOG_I(PHY,"PRACH (br_flag %d,ce_level %d, n_ra_prb %d, k %d): Frame %d, Subframe %d => %d dB\n",br_flag,ce_level,n_ra_prb,k,eNB->proc.frame_rx,eNB->proc.subframe_rx,en);
|
||||
#endif
|
||||
LOG_DEBUG_END
|
||||
}
|
||||
|
||||
// in case of RAU and prach received rx_thread wakes up prach
|
||||
@@ -504,9 +477,10 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
*max_preamble_energy=0;
|
||||
for (preamble_index=0 ; preamble_index<64 ; preamble_index++) {
|
||||
|
||||
#ifdef PRACH_DEBUG
|
||||
if (en>60) LOG_I(PHY,"frame %d, subframe %d : Trying preamble %d (br_flag %d)\n",frame,subframe,preamble_index,br_flag);
|
||||
#endif
|
||||
LOG_DEBUG_BEGIN(PRACH)
|
||||
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
|
||||
if (en>60) LOG_I(PHY,"frame %d, subframe %d : Trying preamble %d (br_flag %d)\n",ru->proc.frame_prach,subframe,preamble_index,br_flag);
|
||||
LOG_DEBUG_END
|
||||
if (restricted_set == 0) {
|
||||
// This is the relative offset in the root sequence table (5.7.2-4 from 36.211) for the given preamble index
|
||||
preamble_offset = ((NCS==0)? preamble_index : (preamble_index/(N_ZC/NCS)));
|
||||
@@ -589,10 +563,11 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
}
|
||||
|
||||
// Compute DFT of RX signal (conjugate input, results in conjugate output) for each new rootSequenceIndex
|
||||
#ifdef PRACH_DEBUG
|
||||
LOG_DEBUG_BEGIN(PRACH)
|
||||
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
|
||||
if (en>60) LOG_I(PHY,"frame %d, subframe %d : preamble index %d: offset %d, preamble shift %d (br_flag %d, en %d)\n",
|
||||
frame,subframe,preamble_index,preamble_offset,preamble_shift,br_flag,en);
|
||||
#endif
|
||||
ru->proc.frame_prach,subframe,preamble_index,preamble_offset,preamble_shift,br_flag,en);
|
||||
LOG_DEBUG_END
|
||||
log2_ifft_size = 10;
|
||||
fft_size = 6144;
|
||||
|
||||
@@ -614,12 +589,12 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
}
|
||||
|
||||
memset(prachF, 0, sizeof(int16_t)*2*1024 );
|
||||
#if defined(PRACH_WRITE_OUTPUT_DEBUG)
|
||||
LOG_M_BEGIN(PRACH)
|
||||
if (prach[0]!= NULL) LOG_M("prach_rx0.m","prach_rx0",prach[0],6144+792,1,1);
|
||||
#endif
|
||||
// LOG_M("prach_rx1.m","prach_rx1",prach[1],6144+792,1,1);
|
||||
// LOG_M("prach_rxF0.m","prach_rxF0",rxsigF[0],24576,1,1);
|
||||
// LOG_M("prach_rxF1.m","prach_rxF1",rxsigF[1],6144,1,1);
|
||||
LOG_M("prach_rx1.m","prach_rx1",prach[1],6144+792,1,1);
|
||||
LOG_M("prach_rxF0.m","prach_rxF0",rxsigF[0],24576,1,1);
|
||||
LOG_M("prach_rxF1.m","prach_rxF1",rxsigF[1],6144,1,1);
|
||||
LOG_M_END
|
||||
|
||||
for (aa=0;aa<nb_rx; aa++) {
|
||||
// Do componentwise product with Xu* on each antenna
|
||||
@@ -647,11 +622,11 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
for (i=0;i<256;i++)
|
||||
prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[(i<<1)] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>10;
|
||||
}
|
||||
|
||||
#if defined(PRACH_WRITE_OUTPUT_DEBUG)
|
||||
|
||||
LOG_M_BEGIN(PRACH)
|
||||
if (aa==0) LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
|
||||
#endif
|
||||
// if (aa=1) LOG_M("prach_rxF_comp1.m","prach_rxF_comp1",prachF,1024,1,1);
|
||||
if (aa==1) LOG_M("prach_rxF_comp1.m","prach_rxF_comp1",prachF,1024,1,1);
|
||||
LOG_M_END
|
||||
}// antennas_rx
|
||||
} // new dft
|
||||
|
||||
@@ -662,9 +637,10 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level]))
|
||||
#endif
|
||||
{
|
||||
#ifdef PRACH_DEBUG
|
||||
if (en>60) LOG_I(PHY,"frame %d, subframe %d: Checking for peak in time-domain (br_flag %d, en %d)\n",frame,subframe,br_flag,en);
|
||||
#endif
|
||||
LOG_DEBUG_BEGIN(PRACH)
|
||||
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
|
||||
if (en>60) LOG_I(PHY,"frame %d, subframe %d: Checking for peak in time-domain (br_flag %d, en %d)\n",ru->proc.frame_prach,subframe,br_flag,en);
|
||||
LOG_DEBUG_END
|
||||
preamble_shift2 = ((preamble_shift==0) ? 0 : ((preamble_shift<<log2_ifft_size)/N_ZC));
|
||||
|
||||
|
||||
@@ -676,17 +652,18 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
*max_preamble_energy = levdB;
|
||||
*max_preamble_delay = ((i*fft_size)>>log2_ifft_size)*update_TA/update_TA2;
|
||||
*max_preamble = preamble_index;
|
||||
#ifdef PRACH_DEBUG
|
||||
if ((en>60) && (br_flag==1)) LOG_D(PHY,"frame %d, subframe %d : max_preamble_energy %d, max_preamble_delay %d, max_preamble %d (br_flag %d,ce_level %d, levdB %d, lev %d)\n",frame,subframe,*max_preamble_energy,*max_preamble_delay,*max_preamble,br_flag,ce_level,levdB,lev);
|
||||
#endif
|
||||
LOG_DEBUG_BEGIN(PRACH)
|
||||
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
|
||||
if ((en>60) && (br_flag==1)) LOG_D(PHY,"frame %d, subframe %d : max_preamble_energy %d, max_preamble_delay %d, max_preamble %d (br_flag %d,ce_level %d, levdB %d, lev %d)\n",ru->proc.frame_prach,subframe,*max_preamble_energy,*max_preamble_delay,*max_preamble,br_flag,ce_level,levdB,lev);
|
||||
LOG_DEBUG_END
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}// preamble_index
|
||||
|
||||
#ifdef PRACH_DEBUG
|
||||
|
||||
LOG_M_BEGIN(PRACH)
|
||||
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
|
||||
if (en>60) {
|
||||
k = (12*n_ra_prb) - 6*fp->N_RB_UL;
|
||||
|
||||
@@ -697,26 +674,22 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
k*=2;
|
||||
|
||||
if (br_flag == 0) {
|
||||
#if defined(PRACH_WRITE_OUTPUT_DEBUG)
|
||||
LOG_M("rxsigF.m","prach_rxF",&rxsigF[0][0],12288,1,1);
|
||||
LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
|
||||
LOG_M("Xu.m","xu",Xu,N_ZC,1,1);
|
||||
LOG_M("prach_ifft0.m","prach_t0",prach_ifft,1024,1,1);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
#if defined(PRACH_WRITE_OUTPUT_DEBUG)
|
||||
printf("Dumping prach (br_flag %d), k = %d (n_ra_prb %d)\n",br_flag,k,n_ra_prb);
|
||||
LOG_E(PHY,"Dumping prach (br_flag %d), k = %d (n_ra_prb %d)\n",br_flag,k,n_ra_prb);
|
||||
LOG_M("rxsigF_br.m","prach_rxF_br",&rxsigF[0][0],12288,1,1);
|
||||
LOG_M("prach_rxF_comp0_br.m","prach_rxF_comp0_br",prachF,1024,1,1);
|
||||
LOG_M("Xu_br.m","xu_br",Xu,N_ZC,1,1);
|
||||
LOG_M("prach_ifft0_br.m","prach_t0_br",prach_ifft,1024,1,1);
|
||||
exit(-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
LOG_M_END
|
||||
if (eNB) stop_meas(&eNB->rx_prach);
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "PHY/defs_common.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/phy_extern_ue.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
|
||||
uint16_t NCS_unrestricted[16] = {0,13,15,18,22,26,32,38,46,59,76,93,119,167,279,419};
|
||||
|
||||
@@ -34,10 +34,9 @@
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#include "T.h"
|
||||
|
||||
//uint8_t ncs_cell[20][7];
|
||||
//#define DEBUG_PUCCH_TXS
|
||||
|
||||
@@ -33,11 +33,10 @@
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
|
||||
#include "T.h"
|
||||
|
||||
void init_ncs_cell(LTE_DL_FRAME_PARMS *frame_parms,uint8_t ncs_cell[20][7])
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "assertions.h"
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface.h"
|
||||
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
//#define DEBUG_ULSCH_DECODING
|
||||
#include "targets/RT/USER/rt_wrapper.h"
|
||||
#include "transport_proto.h"
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -3128,7 +3128,7 @@ void fill_CQI(LTE_UE_ULSCH_t *ulsch,PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_
|
||||
// this is the cba mcs uci for cba transmission
|
||||
((HLC_subband_cqi_mcs_CBA_5MHz *)o)->mcs = ulsch->harq_processes[harq_pid]->mcs;
|
||||
((HLC_subband_cqi_mcs_CBA_5MHz *)o)->crnti = rnti;
|
||||
LOG_N(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, ulsch->harq_processes[harq_pid]->mcs);
|
||||
LOG_I(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, ulsch->harq_processes[harq_pid]->mcs);
|
||||
break;
|
||||
|
||||
case ue_selected:
|
||||
@@ -3182,7 +3182,7 @@ void fill_CQI(LTE_UE_ULSCH_t *ulsch,PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_
|
||||
// this is the cba mcs uci for cba transmission
|
||||
((HLC_subband_cqi_mcs_CBA_10MHz *)o)->mcs = ulsch->harq_processes[harq_pid]->mcs;
|
||||
((HLC_subband_cqi_mcs_CBA_10MHz *)o)->crnti = rnti;
|
||||
LOG_N(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, ulsch->harq_processes[harq_pid]->mcs);
|
||||
LOG_I(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, ulsch->harq_processes[harq_pid]->mcs);
|
||||
break;
|
||||
|
||||
case ue_selected:
|
||||
@@ -3236,7 +3236,7 @@ void fill_CQI(LTE_UE_ULSCH_t *ulsch,PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_
|
||||
// this is the cba mcs uci for cba transmission
|
||||
((HLC_subband_cqi_mcs_CBA_20MHz *)o)->mcs = ulsch->harq_processes[harq_pid]->mcs;
|
||||
((HLC_subband_cqi_mcs_CBA_20MHz *)o)->crnti = rnti;
|
||||
LOG_N(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, ulsch->harq_processes[harq_pid]->mcs);
|
||||
LOG_I(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, ulsch->harq_processes[harq_pid]->mcs);
|
||||
break;
|
||||
|
||||
case ue_selected:
|
||||
|
||||
@@ -43,9 +43,8 @@
|
||||
#include "SCHED/sched_common.h"
|
||||
|
||||
#include "assertions.h"
|
||||
#include "T.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
//#define DEBUG_DCI_ENCODING 1
|
||||
//#define DEBUG_DCI_DECODING 1
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "PHY/CODING/coding_extern.h"
|
||||
#include "SCHED/sched_common_extern.h"
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
|
||||
//#define DEBUG_DLSCH_DECODING
|
||||
#define UE_DEBUG_TRACE 1
|
||||
|
||||
@@ -1320,14 +1320,17 @@ void dlsch_channel_compensation(int **rxdataF_ext,
|
||||
}
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
|
||||
dl_ch128 = (__m128i *)&dl_ch_estimates_ext[aatx*2 + aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
/* TODO: hack to be removed. There is crash for 1 antenna case, so
|
||||
* for 1 antenna case, I put back the value 2 as it was before
|
||||
* Elena's commit.
|
||||
*/
|
||||
int x = frame_parms->nb_antennas_rx > 1 ? frame_parms->nb_antennas_rx : 2;
|
||||
dl_ch128 = (__m128i *)&dl_ch_estimates_ext[aatx*x + aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
//print_shorts("dl_ch128[0]=",&dl_ch128[0]);*/
|
||||
dl_ch_mag128 = (__m128i *)&dl_ch_mag[aatx*2 + aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
dl_ch_mag128b = (__m128i *)&dl_ch_magb[aatx*2 + aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
dl_ch_mag128 = (__m128i *)&dl_ch_mag[aatx*x + aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
dl_ch_mag128b = (__m128i *)&dl_ch_magb[aatx*x + aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
rxdataF128 = (__m128i *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
rxdataF_comp128 = (__m128i *)&rxdataF_comp[aatx*2 + aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
|
||||
rxdataF_comp128 = (__m128i *)&rxdataF_comp[aatx*x + aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
|
||||
for (rb=0; rb<nb_rb; rb++) {
|
||||
if (mod_order>2) {
|
||||
@@ -1777,12 +1780,17 @@ void dlsch_channel_compensation_core(int **rxdataF_ext,
|
||||
}
|
||||
|
||||
for (aarx=0; aarx<n_rx; aarx++) {
|
||||
/* TODO: hack to be removed. There is crash for 1 antenna case, so
|
||||
* for 1 antenna case, I put back the value 2 as it was before
|
||||
* Elena's commit.
|
||||
*/
|
||||
int x = n_rx > 1 ? n_rx : 2;
|
||||
|
||||
dl_ch128 = (__m128i *)&dl_ch_estimates_ext[aatx*2 + aarx][start_point];
|
||||
dl_ch_mag128 = (__m128i *)&dl_ch_mag[aatx*2 + aarx][start_point];
|
||||
dl_ch_mag128b = (__m128i *)&dl_ch_magb[aatx*2 + aarx][start_point];
|
||||
dl_ch128 = (__m128i *)&dl_ch_estimates_ext[aatx*x + aarx][start_point];
|
||||
dl_ch_mag128 = (__m128i *)&dl_ch_mag[aatx*x + aarx][start_point];
|
||||
dl_ch_mag128b = (__m128i *)&dl_ch_magb[aatx*x + aarx][start_point];
|
||||
rxdataF128 = (__m128i *)&rxdataF_ext[aarx][start_point];
|
||||
rxdataF_comp128 = (__m128i *)&rxdataF_comp[aatx*2 + aarx][start_point];
|
||||
rxdataF_comp128 = (__m128i *)&rxdataF_comp[aatx*x + aarx][start_point];
|
||||
|
||||
length_mod8 = length&7;
|
||||
if (length_mod8 == 0){
|
||||
@@ -3956,15 +3964,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;
|
||||
@@ -3973,8 +3977,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++) {
|
||||
@@ -3986,17 +3988,12 @@ void dlsch_channel_level_median(int **dl_ch_estimates_ext,
|
||||
((int32_t*)&norm128D)[2] +
|
||||
((int32_t*)&norm128D)[3];
|
||||
|
||||
if (ii<1){
|
||||
print_ints("norm128D",&norm128D[0]);
|
||||
printf("norm_pack[%d] %d\n", aatx*n_rx + aarx, norm_pack);
|
||||
}
|
||||
|
||||
if (norm_pack > max)
|
||||
max = norm_pack;
|
||||
if (norm_pack < min)
|
||||
min = norm_pack;
|
||||
|
||||
dl_ch128+=1;
|
||||
dl_ch128+=1;
|
||||
}
|
||||
|
||||
median[aatx*n_rx + aarx] = (max+min)>>1;
|
||||
@@ -6927,79 +6924,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);
|
||||
@@ -7007,52 +7015,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);
|
||||
|
||||
// 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]
|
||||
);
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
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]),
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
#include "SCHED_UE/sched_UE.h"
|
||||
#include "SCHED/sched_common_extern.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#include "../LTE_TRANSPORT/prach_extern.h"
|
||||
|
||||
@@ -376,7 +376,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
||||
memmove( prach, prach+1024, Ncp<<2 );
|
||||
prach_len = 512+Ncp;
|
||||
} else {
|
||||
idft3072(prachF,prach2);
|
||||
idft3072(prachF,prach2,1);
|
||||
memmove( prach, prach+6144, Ncp<<2 );
|
||||
prach_len = 3072+Ncp;
|
||||
|
||||
@@ -395,7 +395,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
||||
memmove( prach, prach+2048, Ncp<<2 );
|
||||
prach_len = 1024+Ncp;
|
||||
} else {
|
||||
idft6144(prachF,prach2);
|
||||
idft6144(prachF,prach2,1);
|
||||
/*for (i=0;i<6144*2;i++)
|
||||
prach2[i]<<=1;*/
|
||||
memmove( prach, prach+12288, Ncp<<2 );
|
||||
@@ -415,7 +415,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
||||
memmove( prach, prach+4096, Ncp<<2 );
|
||||
prach_len = 2048+Ncp;
|
||||
} else {
|
||||
idft12288(prachF,prach2);
|
||||
idft12288(prachF,prach2,1);
|
||||
memmove( prach, prach+24576, Ncp<<2 );
|
||||
prach_len = 12288+Ncp;
|
||||
|
||||
@@ -429,12 +429,12 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
||||
|
||||
case 75:
|
||||
if (prach_fmt == 4) {
|
||||
idft3072(prachF,prach2);
|
||||
idft3072(prachF,prach2,1);
|
||||
//TODO: account for repeated format in dft output
|
||||
memmove( prach, prach+6144, Ncp<<2 );
|
||||
prach_len = 3072+Ncp;
|
||||
} else {
|
||||
idft18432(prachF,prach2);
|
||||
idft18432(prachF,prach2,1);
|
||||
memmove( prach, prach+36864, Ncp<<2 );
|
||||
prach_len = 18432+Ncp;
|
||||
|
||||
@@ -453,7 +453,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
||||
memmove( prach, prach+8192, Ncp<<2 );
|
||||
prach_len = 4096+Ncp;
|
||||
} else {
|
||||
idft24576(prachF,prach2);
|
||||
idft24576(prachF,prach2,1);
|
||||
memmove( prach, prach+49152, Ncp<<2 );
|
||||
prach_len = 24576+Ncp;
|
||||
|
||||
@@ -465,12 +465,12 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
||||
}
|
||||
else {
|
||||
if (prach_fmt == 4) {
|
||||
idft3072(prachF,prach2);
|
||||
idft3072(prachF,prach2,1);
|
||||
//TODO: account for repeated format in dft output
|
||||
memmove( prach, prach+6144, Ncp<<2 );
|
||||
prach_len = 3072+Ncp;
|
||||
} else {
|
||||
idft18432(prachF,prach2);
|
||||
idft18432(prachF,prach2,1);
|
||||
memmove( prach, prach+36864, Ncp<<2 );
|
||||
prach_len = 18432+Ncp;
|
||||
printf("Generated prach for 100 PRB, 3/4 sampling\n");
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
#include "PHY/phy_extern_ue.h"
|
||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#include "T.h"
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "PHY/phy_extern_ue.h"
|
||||
#include "SCHED_UE/sched_UE.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "transport_proto_ue.h"
|
||||
|
||||
#include "assertions.h"
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
*/
|
||||
#include "PHY/defs_UE.h"
|
||||
#include "PHY/phy_extern_ue.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
unsigned short msrsb_6_40[8][4] = {{36,12,4,4},
|
||||
{32,16,8,4},
|
||||
@@ -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);
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "PHY/CODING/coding_extern.h"
|
||||
#include "PHY/CODING/lte_interleaver_inline.h"
|
||||
#include "PHY/LTE_UE_TRANSPORT/transport_ue.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
//#define DEBUG_ULSCH_CODING
|
||||
//#define DEBUG_ULSCH_FREE 1
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "PHY/LTE_UE_TRANSPORT/transport_ue.h"
|
||||
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_eNB.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "PHY/CODING/lte_interleaver_inline.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_eNB.h"
|
||||
#include "modulation_eNB.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
int beam_precoding(int32_t **txdataF,
|
||||
int32_t **txdataF_BF,
|
||||
|
||||
@@ -31,8 +31,8 @@ This section deals with basic functions for OFDM Modulation.
|
||||
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/impl_defs_top.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "modulation_common.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
|
||||
//#define DEBUG_OFDM_MOD
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
lte_dfts_sse4: lte_dfts.c
|
||||
gcc -O2 -msse4.1 -g -ggdb -o lte_dfts_sse4 lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
|
||||
gcc -O2 -std=gnu99 -msse4.1 -g -ggdb -o lte_dfts_sse4 lte_dfts.c time_meas.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR_HOME -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR -I$$OPENAIR2_DIR/COMMON -I$$OPENAIR_HOME/common/utils -DMR_MAIN -DNB_ANTENNAS_RX=1 -lm -lpthread # -DD256STATS #-DD64STATS
|
||||
|
||||
lte_dfts_avx2: lte_dfts.c
|
||||
gcc -O2 -mavx2 -g -ggdb -o lte_dfts_avx2 lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
|
||||
gcc -O2 -std=gnu99 -mavx2 -g -ggdb -o lte_dfts_avx2 lte_dfts.c time_meas.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR_HOME -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR -I$$OPENAIR2_DIR/COMMON -I$$OPENAIR_HOME/common/utils -DMR_MAIN -DNB_ANTENNAS_RX=1 -lm -lpthread # -DD256STATS #-DD64STATS
|
||||
|
||||
lte_dfts_avx2.s: lte_dfts.c
|
||||
gcc -O2 -mavx2 -S lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
|
||||
gcc -O2 -std=gnu99 -mavx2 -S lte_dfts.c time_meas.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR_HOME -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR -I$$OPENAIR2_DIR/COMMON -I$$OPENAIR_HOME/common/utils -DMR_MAIN -DNB_ANTENNAS_RX=1 -lm -lpthread # -DD256STATS #-DD64STATS
|
||||
|
||||
lte_dfts_sse4.s: lte_dfts.c
|
||||
gcc -O2 -msse4.1 -S lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
|
||||
gcc -O2 -std=gnu99 -msse4.1 -S lte_dfts.c time_meas.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR_HOME -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR -I$$OPENAIR2_DIR/COMMON -I$$OPENAIR_HOME/common/utils -DMR_MAIN -DNB_ANTENNAS_RX=1 -lm # -DD256STATS #-DD64STATS
|
||||
|
||||
dft_cycles_avx2: lte_dfts_avx2
|
||||
./lte_dfts_avx2 | egrep cycles
|
||||
|
||||
+985
-10631
File diff suppressed because one or more lines are too long
@@ -174,27 +174,27 @@ This function performs optimized fixed-point radix-2 FFT/IFFT.
|
||||
|
||||
void idft1536(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void idft6144(int16_t *sigF,int16_t *sig);
|
||||
void idft6144(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void idft12288(int16_t *sigF,int16_t *sig);
|
||||
void idft12288(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void idft18432(int16_t *sigF,int16_t *sig);
|
||||
void idft18432(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void idft3072(int16_t *sigF,int16_t *sig);
|
||||
void idft3072(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void idft24576(int16_t *sigF,int16_t *sig);
|
||||
void idft24576(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void dft1536(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void dft6144(int16_t *sigF,int16_t *sig);
|
||||
void dft6144(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void dft12288(int16_t *sigF,int16_t *sig);
|
||||
void dft12288(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void dft18432(int16_t *sigF,int16_t *sig);
|
||||
void dft18432(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void dft3072(int16_t *sigF,int16_t *sig);
|
||||
void dft3072(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void dft24576(int16_t *sigF,int16_t *sig);
|
||||
void dft24576(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
|
||||
/*!\fn int32_t rotate_cpx_vector(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N,uint16_t output_shift)
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -930,7 +930,7 @@ typedef enum {
|
||||
|
||||
void exit_fun(const char* s);
|
||||
|
||||
#include "UTIL/LOG/log_extern.h"
|
||||
#include "common/utils/LOG/log_extern.h"
|
||||
extern pthread_cond_t sync_cond;
|
||||
extern pthread_mutex_t sync_mutex;
|
||||
extern int sync_var;
|
||||
|
||||
@@ -194,11 +194,11 @@ typedef struct RU_proc_t_s {
|
||||
pthread_cond_t cond_synch;
|
||||
/// condition variable for asynch RX/TX thread
|
||||
pthread_cond_t cond_asynch_rxtx;
|
||||
/// condition varible for RU RX FEP thread
|
||||
/// condition variable for RU RX FEP thread
|
||||
pthread_cond_t cond_fep;
|
||||
/// condition varible for RU TX FEP thread
|
||||
/// condition variable for RU TX FEP thread
|
||||
pthread_cond_t cond_feptx;
|
||||
/// condition varible for emulated RF
|
||||
/// condition variable for emulated RF
|
||||
pthread_cond_t cond_emulateRF;
|
||||
/// condition variable for eNB signal
|
||||
pthread_cond_t cond_eNBs;
|
||||
@@ -260,6 +260,7 @@ typedef struct RU_proc_t_s {
|
||||
/// pipeline ready state
|
||||
int ru_rx_ready;
|
||||
int ru_tx_ready;
|
||||
int emulate_rf_busy;
|
||||
} RU_proc_t;
|
||||
|
||||
typedef enum {
|
||||
|
||||
@@ -668,7 +668,6 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
|
||||
AssertFatal(RC.eNB[Mod_id][CC_id]!=NULL,"RC.eNB[%d][%d] is null\n",Mod_id,CC_id);
|
||||
|
||||
|
||||
|
||||
eNB = RC.eNB[Mod_id][CC_id];
|
||||
fp = &eNB->frame_parms;
|
||||
proc = &eNB->proc.proc_rxtx[0];
|
||||
|
||||
@@ -37,10 +37,8 @@
|
||||
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
|
||||
#include "nfapi_interface.h"
|
||||
#include "fapi_l1.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#include "T.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#include "assertions.h"
|
||||
#include "msc.h"
|
||||
@@ -324,7 +322,6 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
|
||||
int frame=proc->frame_tx;
|
||||
int subframe=proc->subframe_tx;
|
||||
LTE_DL_eNB_HARQ_t *dlsch_harq=dlsch->harq_processes[harq_pid];
|
||||
int input_buffer_length = dlsch_harq->TBS/8;
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
|
||||
if (dlsch->rnti == 0x02) {//frame < 200) {
|
||||
@@ -332,7 +329,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
|
||||
LOG_D(PHY,
|
||||
"[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", pdsch_start %d, G %d, nb_rb %"PRIu16", rb0 %x, rb1 %x, TBS %"PRIu16", pmi_alloc %"PRIx64", rv %"PRIu8" (round %"PRIu8")\n",
|
||||
eNB->Mod_id, dlsch->rnti,harq_pid,
|
||||
frame, subframe, input_buffer_length, dlsch_harq->pdsch_start,
|
||||
frame, subframe, dlsch_harq->TBS/8, dlsch_harq->pdsch_start,
|
||||
get_G(fp,
|
||||
dlsch_harq->nb_rb,
|
||||
dlsch_harq->rb_alloc,
|
||||
@@ -356,7 +353,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
|
||||
NULL,0,
|
||||
"%05u:%02u PDSCH/DLSCH input size = %"PRIu16", G %d, nb_rb %"PRIu16", TBS %"PRIu16", pmi_alloc %"PRIx16", rv %"PRIu8" (round %"PRIu8")",
|
||||
frame, subframe,
|
||||
input_buffer_length,
|
||||
dlsch_harq->TBS/8,
|
||||
get_G(fp,
|
||||
dlsch_harq->nb_rb,
|
||||
dlsch_harq->rb_alloc,
|
||||
@@ -415,7 +412,6 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
|
||||
&eNB->dlsch_turbo_encoding_wakeup_stats1,
|
||||
&eNB->dlsch_interleaving_stats);
|
||||
stop_meas(&eNB->dlsch_encoding_stats);
|
||||
//////////////////////////////////////////////////*******************************************
|
||||
if(eNB->dlsch_encoding_stats.diff_now>500*3000 && opp_enabled == 1)
|
||||
{
|
||||
print_meas_now(&eNB->dlsch_encoding_stats,"total coding",stderr);
|
||||
@@ -482,12 +478,11 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
LTE_UL_eNB_HARQ_t *ulsch_harq;
|
||||
|
||||
int offset = eNB->CC_id;//proc == &eNB->proc.proc_rxtx[0] ? 0 : 1;
|
||||
|
||||
|
||||
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)==SF_UL)) return;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+offset,1);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+(eNB->CC_id),1);
|
||||
if (do_meas==1) start_meas(&eNB->phy_proc_tx);
|
||||
|
||||
// clear the transmit data array for the current subframe
|
||||
@@ -649,7 +644,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
AMP);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_PHICH,0);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+offset,0);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+(eNB->CC_id),0);
|
||||
if (do_meas==1) stop_meas(&eNB->phy_proc_tx);
|
||||
|
||||
}
|
||||
@@ -1505,7 +1500,7 @@ void init_te_thread(PHY_VARS_eNB *eNB) {
|
||||
pthread_cond_init( &proc->tep[i].cond_te, NULL);
|
||||
pthread_attr_init( &proc->tep[i].attr_te);
|
||||
|
||||
printf("Creating te_thread 0\n");
|
||||
LOG_I(PHY,"Creating te_thread %d\n",i);
|
||||
pthread_create(&proc->tep[i].pthread_te, &proc->tep[i].attr_te, te_thread, (void*)&proc->tep[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,10 +36,9 @@
|
||||
#include "nfapi_interface.h"
|
||||
#include "fapi_l1.h"
|
||||
#include "nfapi_pnf.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#include "T.h"
|
||||
|
||||
#include "assertions.h"
|
||||
#include "msc.h"
|
||||
@@ -125,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)&&
|
||||
@@ -154,7 +150,7 @@ void prach_procedures(PHY_VARS_eNB *eNB
|
||||
LOG_D(PHY,"Filling NFAPI indication for RACH %d CELevel %d (mask %x) : TA %d, Preamble %d, rnti %x, rach_resource_type %d\n",
|
||||
ind,
|
||||
ce_level,
|
||||
prach_mask,
|
||||
is_prach_subframe(&eNB->frame_parms,eNB->proc.frame_prach_br,eNB->proc.subframe_prach_br),
|
||||
eNB->preamble_list_br[ind].preamble_rel8.timing_advance,
|
||||
eNB->preamble_list_br[ind].preamble_rel8.preamble,
|
||||
eNB->preamble_list_br[ind].preamble_rel8.rnti,
|
||||
|
||||
@@ -39,10 +39,9 @@
|
||||
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#include "T.h"
|
||||
|
||||
#include "assertions.h"
|
||||
#include "msc.h"
|
||||
@@ -151,6 +150,7 @@ static void *feptx_thread(void *param) {
|
||||
while (!oai_exit) {
|
||||
|
||||
if (wait_on_condition(&proc->mutex_feptx,&proc->cond_feptx,&proc->instance_cnt_feptx,"feptx thread")<0) break;
|
||||
if (oai_exit) break;
|
||||
//stop_meas(&ru->ofdm_mod_wakeup_stats);
|
||||
feptx0(ru,1);
|
||||
if (release_thread(&proc->mutex_feptx,&proc->instance_cnt_feptx,"feptx thread")<0) break;
|
||||
@@ -248,7 +248,6 @@ void feptx_ofdm(RU_t *ru) {
|
||||
// int CC_id = ru->proc.CC_id;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
|
||||
|
||||
slot_offset_F = 0;
|
||||
|
||||
slot_offset = subframe*fp->samples_per_tti;
|
||||
@@ -456,6 +455,7 @@ static void *fep_thread(void *param) {
|
||||
while (!oai_exit) {
|
||||
|
||||
if (wait_on_condition(&proc->mutex_fep,&proc->cond_fep,&proc->instance_cnt_fep,"fep thread")<0) break;
|
||||
if (oai_exit) break;
|
||||
//stop_meas(&ru->ofdm_demod_wakeup_stats);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1, 1 );
|
||||
fep0(ru,0);
|
||||
@@ -505,6 +505,33 @@ void init_fep_thread(RU_t *ru,pthread_attr_t *attr_fep) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
extern void kill_fep_thread(RU_t *ru)
|
||||
{
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
pthread_mutex_lock( &proc->mutex_fep );
|
||||
proc->instance_cnt_fep = 0;
|
||||
pthread_cond_signal(&proc->cond_fep);
|
||||
pthread_mutex_unlock( &proc->mutex_fep );
|
||||
LOG_D(PHY, "Joining pthread_fep\n");
|
||||
pthread_join(proc->pthread_fep, NULL);
|
||||
pthread_mutex_destroy( &proc->mutex_fep );
|
||||
pthread_cond_destroy( &proc->cond_fep );
|
||||
}
|
||||
|
||||
extern void kill_feptx_thread(RU_t *ru)
|
||||
{
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
pthread_mutex_lock( &proc->mutex_feptx );
|
||||
proc->instance_cnt_feptx = 0;
|
||||
pthread_cond_signal(&proc->cond_feptx);
|
||||
pthread_mutex_unlock( &proc->mutex_feptx );
|
||||
LOG_D(PHY, "Joining pthread_feptx\n");
|
||||
pthread_join(proc->pthread_feptx, NULL);
|
||||
pthread_mutex_destroy( &proc->mutex_feptx );
|
||||
pthread_cond_destroy( &proc->cond_feptx );
|
||||
}
|
||||
|
||||
void ru_fep_full_2thread(RU_t *ru) {
|
||||
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -54,7 +54,7 @@
|
||||
#include "socket.h"
|
||||
#include "multicast_link.h"
|
||||
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
extern unsigned short Master_id;
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include "LAYER2/MAC/mac_vars.h"
|
||||
|
||||
#include "OCG_vars.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "UTIL/LISTS/list.h"
|
||||
|
||||
#include "unitary_defs.h"
|
||||
@@ -67,6 +67,7 @@
|
||||
#include "common/config/config_load_configmodule.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
|
||||
|
||||
void feptx_ofdm(RU_t *ru);
|
||||
void feptx_prec(RU_t *ru);
|
||||
|
||||
@@ -83,6 +84,8 @@ int n_rx_dropped = 0; /*!< \brief initial max process time for rx */
|
||||
|
||||
int codingw = 0;
|
||||
|
||||
int emulate_rf = 0;
|
||||
|
||||
void handler(int sig)
|
||||
{
|
||||
void *array[10];
|
||||
@@ -647,7 +650,6 @@ int main(int argc, char **argv)
|
||||
int two_thread_flag=0;
|
||||
int DLSCH_RB_ALLOC = 0;
|
||||
|
||||
int log_level = LOG_ERR;
|
||||
int dci_received;
|
||||
PHY_VARS_eNB *eNB;
|
||||
RU_t *ru;
|
||||
@@ -999,7 +1001,7 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
log_level=atoi(optarg);
|
||||
set_glog(atoi(optarg));
|
||||
break;
|
||||
|
||||
case 'h':
|
||||
@@ -1047,8 +1049,7 @@ int main(int argc, char **argv)
|
||||
"cannot load configuration module, exiting\n");
|
||||
logInit();
|
||||
// enable these lines if you need debug info
|
||||
set_comp_log(PHY,LOG_INFO,LOG_HIGH,1);
|
||||
set_glog(log_level,LOG_HIGH);
|
||||
set_glog(LOG_DEBUG);
|
||||
// moreover you need to init itti with the following line
|
||||
// however itti will catch all signals, so ctrl-c won't work anymore
|
||||
// alternatively you can disable ITTI completely in CMakeLists.txt
|
||||
|
||||
@@ -1143,6 +1143,10 @@ int main(int argc, char **argv)
|
||||
if (mcs < 11) modulation_type = 2;
|
||||
else if (mcs < 21) modulation_type = 4;
|
||||
else if (mcs < 29) modulation_type = 6;
|
||||
else {
|
||||
LOG_E(SIM,"mcs %i is not valid\n",mcs);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
fill_ulsch_dci(eNB,proc_rxtx->frame_rx,subframe,&sched_resp,14,(void*)&UL_alloc_pdu,first_rb,nb_rb,(round==0)?mcs:(28+rvidx[round]),modulation_type,ndi,get_TBS_UL(mcs,nb_rb),cqi_flag,beta_CQI,beta_RI,cqi_size);
|
||||
|
||||
@@ -1488,23 +1492,23 @@ int main(int argc, char **argv)
|
||||
|
||||
if (dump_table == 1 ) {
|
||||
int n;
|
||||
set_component_filelog(USIM); // file located in /tmp/usim.txt
|
||||
LOG_F(USIM,"The transmitter raw data: \n");
|
||||
set_component_filelog(SIM); // file located in /tmp/usim.txt
|
||||
LOG_F(SIM,"The transmitter raw data: \n");
|
||||
|
||||
for (n=0; n< time_vector_tx.size; n++) {
|
||||
// printf("%f ", table_tx[n]);
|
||||
LOG_F(USIM,"%f ", table_tx[n]);
|
||||
LOG_F(SIM,"%f ", table_tx[n]);
|
||||
}
|
||||
|
||||
LOG_F(USIM,"\n");
|
||||
LOG_F(USIM,"The receiver raw data: \n");
|
||||
LOG_F(SIM,"\n");
|
||||
LOG_F(SIM,"The receiver raw data: \n");
|
||||
|
||||
for (n=0; n< time_vector_rx.size; n++) {
|
||||
// printf("%f ", table_rx[n]);
|
||||
LOG_F(USIM,"%f ", table_rx[n]);
|
||||
LOG_F(SIM,"%f ", table_rx[n]);
|
||||
}
|
||||
|
||||
LOG_F(USIM,"\n");
|
||||
LOG_F(SIM,"\n");
|
||||
}
|
||||
|
||||
double tx_median = table_tx[time_vector_tx.size/2];
|
||||
|
||||
@@ -35,8 +35,7 @@
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "UTIL/LOG/log_if.h"
|
||||
#include "UTIL/LOG/log_extern.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface_extern.h"
|
||||
#include "UTIL/OCG/OCG.h"
|
||||
@@ -45,10 +44,6 @@
|
||||
#include "UTIL/FIFO/types.h"
|
||||
|
||||
#define RF
|
||||
//#define DEBUG_SIM
|
||||
|
||||
//#undef LOG_D
|
||||
//#define LOG_D(A,B,C...) printf(B,C)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "PHY/TOOLS/tools_defs.h"
|
||||
#include "sim.h"
|
||||
#include "scm_corrmat.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
//#define DEBUG_CH
|
||||
|
||||
#include "assertions.h"
|
||||
|
||||
@@ -49,7 +49,7 @@ void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_ch
|
||||
Protocol__FlexHeader *header = NULL;
|
||||
void *data;
|
||||
int priority = 0;
|
||||
err_code_t err_code;
|
||||
err_code_t err_code=0;
|
||||
|
||||
int xid = 0;
|
||||
|
||||
@@ -241,7 +241,8 @@ void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_ch
|
||||
LOG_D(FLEXRAN_AGENT,"sent message with size %d\n", size);
|
||||
return;
|
||||
error:
|
||||
LOG_E(FLEXRAN_AGENT, "Could not send UE state message becasue of %d \n",err_code);
|
||||
if (err_code != 0)
|
||||
LOG_E(FLEXRAN_AGENT, "Could not send UE state message becasue of %d \n",err_code);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "log_extern.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "assertions.h"
|
||||
#if defined(ENABLE_ITTI)
|
||||
# include "intertask_interface.h"
|
||||
|
||||
@@ -113,8 +113,6 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end)//,
|
||||
|
||||
for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) {
|
||||
{
|
||||
s1ap_register_enb_req_t *s1ap_register_eNB;
|
||||
|
||||
/* note: there is an implicit relationship between the data structure and the message name */
|
||||
msg_p = itti_alloc_new_message (TASK_ENB_APP, S1AP_REGISTER_ENB_REQ);
|
||||
|
||||
@@ -122,8 +120,7 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end)//,
|
||||
|
||||
if (enb_id == 0) RCconfig_gtpu();
|
||||
|
||||
s1ap_register_eNB = &S1AP_REGISTER_ENB_REQ(msg_p);
|
||||
LOG_I(ENB_APP,"default drx %d\n",s1ap_register_eNB->default_drx);
|
||||
LOG_I(ENB_APP,"default drx %d\n",((S1AP_REGISTER_ENB_REQ(msg_p)).default_drx));
|
||||
|
||||
LOG_I(ENB_APP,"[eNB %d] eNB_app_register for instance %d\n", enb_id, ENB_MODULE_ID_TO_INSTANCE(enb_id));
|
||||
|
||||
@@ -152,7 +149,6 @@ void *eNB_app_task(void *args_p)
|
||||
# endif
|
||||
uint32_t enb_id;
|
||||
MessageDef *msg_p = NULL;
|
||||
const char *msg_name = NULL;
|
||||
instance_t instance;
|
||||
int result;
|
||||
/* for no gcc warnings */
|
||||
@@ -200,7 +196,6 @@ void *eNB_app_task(void *args_p)
|
||||
// Wait for a message
|
||||
itti_receive_msg (TASK_ENB_APP, &msg_p);
|
||||
|
||||
msg_name = ITTI_MSG_NAME (msg_p);
|
||||
instance = ITTI_MSG_INSTANCE (msg_p);
|
||||
|
||||
switch (ITTI_MSG_ID(msg_p)) {
|
||||
@@ -216,7 +211,7 @@ void *eNB_app_task(void *args_p)
|
||||
# if defined(ENABLE_USE_MME)
|
||||
|
||||
case S1AP_REGISTER_ENB_CNF:
|
||||
LOG_I(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, msg_name,
|
||||
LOG_I(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p),
|
||||
S1AP_REGISTER_ENB_CNF(msg_p).nb_mme);
|
||||
|
||||
DevAssert(register_enb_pending > 0);
|
||||
@@ -237,10 +232,8 @@ void *eNB_app_task(void *args_p)
|
||||
itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
|
||||
|
||||
} else {
|
||||
uint32_t not_associated = enb_nb - registered_enb;
|
||||
|
||||
LOG_W(ENB_APP, " %d eNB %s not associated with a MME, retrying registration in %d seconds ...\n",
|
||||
not_associated, not_associated > 1 ? "are" : "is", ENB_REGISTER_RETRY_DELAY);
|
||||
LOG_W(ENB_APP, " %d eNB not associated with a MME, retrying registration in %d seconds ...\n",
|
||||
enb_nb - registered_enb, ENB_REGISTER_RETRY_DELAY);
|
||||
|
||||
/* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */
|
||||
if (timer_setup (ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,
|
||||
@@ -258,14 +251,14 @@ void *eNB_app_task(void *args_p)
|
||||
break;
|
||||
|
||||
case S1AP_DEREGISTERED_ENB_IND:
|
||||
LOG_W(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, msg_name,
|
||||
LOG_W(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p),
|
||||
S1AP_DEREGISTERED_ENB_IND(msg_p).nb_mme);
|
||||
|
||||
/* TODO handle recovering of registration */
|
||||
break;
|
||||
|
||||
case TIMER_HAS_EXPIRED:
|
||||
LOG_I(ENB_APP, " Received %s: timer_id %ld\n", msg_name, TIMER_HAS_EXPIRED(msg_p).timer_id);
|
||||
LOG_I(ENB_APP, " Received %s: timer_id %ld\n", ITTI_MSG_NAME (msg_p), TIMER_HAS_EXPIRED(msg_p).timer_id);
|
||||
|
||||
if (TIMER_HAS_EXPIRED (msg_p).timer_id == enb_register_retry_timer_id) {
|
||||
/* Restart the registration process */
|
||||
@@ -277,7 +270,7 @@ void *eNB_app_task(void *args_p)
|
||||
# endif
|
||||
|
||||
default:
|
||||
LOG_E(ENB_APP, "Received unexpected message %s\n", msg_name);
|
||||
LOG_E(ENB_APP, "Received unexpected message %s\n", ITTI_MSG_NAME (msg_p));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "log_extern.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "assertions.h"
|
||||
#include "enb_config.h"
|
||||
#include "UTIL/OTG/otg.h"
|
||||
@@ -410,7 +409,6 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) {
|
||||
|
||||
int num_enbs = 0;
|
||||
|
||||
int num_component_carriers = 0;
|
||||
int j,k = 0;
|
||||
int32_t enb_id = 0;
|
||||
int nb_cc = 0;
|
||||
@@ -704,17 +702,10 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) {
|
||||
sprintf(enbpath,"%s.[%i]",ENB_CONFIG_STRING_ENB_LIST,k),
|
||||
config_getlist( &CCsParamList,NULL,0,enbpath);
|
||||
|
||||
LOG_I(RRC,"num component carriers %d \n", num_component_carriers);
|
||||
LOG_I(RRC,"num component carriers %d \n",CCsParamList.numelt);
|
||||
if ( CCsParamList.numelt> 0) {
|
||||
char ccspath[MAX_OPTNAME_SIZE*2 + 16];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//enb_properties_loc.properties[enb_properties_loc_index]->nb_cc = num_component_carriers;
|
||||
|
||||
|
||||
for (j = 0; j < CCsParamList.numelt ;j++) {
|
||||
|
||||
sprintf(ccspath,"%s.%s.[%i]",enbpath,ENB_CONFIG_STRING_COMPONENT_CARRIERS,j);
|
||||
|
||||
@@ -47,11 +47,10 @@ void *flexran_agent_task(void *args){
|
||||
Protocol__FlexranMessage *msg;
|
||||
void *data;
|
||||
int size;
|
||||
err_code_t err_code;
|
||||
err_code_t err_code=0;
|
||||
int priority = 0;
|
||||
|
||||
MessageDef *msg_p = NULL;
|
||||
const char *msg_name = NULL;
|
||||
int result;
|
||||
struct flexran_agent_timer_element_s * elem = NULL;
|
||||
|
||||
@@ -61,7 +60,6 @@ void *flexran_agent_task(void *args){
|
||||
// Wait for a message
|
||||
itti_receive_msg (TASK_FLEXRAN_AGENT, &msg_p);
|
||||
DevAssert(msg_p != NULL);
|
||||
msg_name = ITTI_MSG_NAME (msg_p);
|
||||
|
||||
switch (ITTI_MSG_ID(msg_p)) {
|
||||
case TERMINATE_MESSAGE:
|
||||
@@ -88,7 +86,7 @@ void *flexran_agent_task(void *args){
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(FLEXRAN_AGENT, "Received unexpected message %s\n", msg_name);
|
||||
LOG_E(FLEXRAN_AGENT, "Received unexpected message %s\n", ITTI_MSG_NAME (msg_p));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -96,7 +94,8 @@ void *flexran_agent_task(void *args){
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
continue;
|
||||
error:
|
||||
LOG_E(FLEXRAN_AGENT,"flexran_agent_task: error %d occured\n",err_code);
|
||||
if (err_code != 0)
|
||||
LOG_E(FLEXRAN_AGENT,"flexran_agent_task: error %d occured\n",err_code);
|
||||
} while (1);
|
||||
|
||||
return NULL;
|
||||
@@ -108,7 +107,7 @@ void *receive_thread(void *args) {
|
||||
void *data;
|
||||
int size;
|
||||
int priority;
|
||||
err_code_t err_code;
|
||||
err_code_t err_code=0;
|
||||
|
||||
Protocol__FlexranMessage *msg;
|
||||
|
||||
@@ -140,7 +139,8 @@ void *receive_thread(void *args) {
|
||||
return NULL;
|
||||
|
||||
error:
|
||||
LOG_E(FLEXRAN_AGENT,"receive_thread: error %d occured\n",err_code);
|
||||
if (err_code != 0)
|
||||
LOG_E(FLEXRAN_AGENT,"receive_thread: error %d occured\n",err_code);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ Protocol__FlexranMessage *flexran_agent_timeout(void* args){
|
||||
//memcpy (timer_args, args, sizeof(*timer_args));
|
||||
flexran_agent_timer_args_t *timer_args = (flexran_agent_timer_args_t *) args;
|
||||
|
||||
LOG_I(FLEXRAN_AGENT, "flexran_agent %d timeout\n", timer_args->mod_id);
|
||||
LOG_UI(FLEXRAN_AGENT, "flexran_agent %d timeout\n", timer_args->mod_id);
|
||||
//LOG_I(FLEXRAN_AGENT, "eNB action %d ENB flags %d \n", timer_args->cc_actions,timer_args->cc_report_flags);
|
||||
//LOG_I(FLEXRAN_AGENT, "UE action %d UE flags %d \n", timer_args->ue_actions,timer_args->ue_report_flags);
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "flexran_agent_async.h"
|
||||
#include "flexran_agent_defs.h"
|
||||
|
||||
#include "log.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
flexran_agent_async_channel_t * flexran_agent_async_channel_info(mid_t mod_id, char *dst_ip, uint16_t dst_port) {
|
||||
|
||||
|
||||
@@ -130,16 +130,15 @@ void * flexran_agent_pack_message(Protocol__FlexranMessage *msg,
|
||||
int * size){
|
||||
|
||||
void * buffer;
|
||||
err_code_t err_code = PROTOCOL__FLEXRAN_ERR__NO_ERR;
|
||||
|
||||
if (flexran_agent_serialize_message(msg, &buffer, size) < 0 ) {
|
||||
err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENCODING;
|
||||
LOG_E(FLEXRAN_AGENT,"errno %d occured\n",PROTOCOL__FLEXRAN_ERR__MSG_ENCODING);
|
||||
goto error;
|
||||
}
|
||||
|
||||
// free the msg --> later keep this in the data struct and just update the values
|
||||
//TODO call proper destroy function
|
||||
err_code = ((*message_destruction_callback[msg->msg_case-1])(msg));
|
||||
((*message_destruction_callback[msg->msg_case-1])(msg));
|
||||
|
||||
DevAssert(buffer !=NULL);
|
||||
|
||||
@@ -148,8 +147,6 @@ void * flexran_agent_pack_message(Protocol__FlexranMessage *msg,
|
||||
return buffer;
|
||||
|
||||
error :
|
||||
LOG_E(FLEXRAN_AGENT,"errno %d occured\n",err_code);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
*/
|
||||
|
||||
#include "flexran_agent_net_comm.h"
|
||||
#include "log.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
flexran_agent_channel_t *agent_channel[NUM_MAX_ENB][FLEXRAN_AGENT_MAX];
|
||||
flexran_agent_channel_instance_t channel_instance;
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
#include "mac.h"
|
||||
#include "mac_proto.h"
|
||||
#include "mac_extern.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#include "common/ran_context.h"
|
||||
#if (RRC_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||
|
||||
@@ -46,8 +46,8 @@
|
||||
#include "mac.h"
|
||||
#include "mac_proto.h"
|
||||
#include "mac_extern.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
|
||||
#include "common/ran_context.h"
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "OCG.h"
|
||||
#include "OCG_extern.h"
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "OCG.h"
|
||||
#include "OCG_extern.h"
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "OCG.h"
|
||||
#include "OCG_extern.h"
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "OCG.h"
|
||||
#include "OCG_extern.h"
|
||||
@@ -474,7 +474,7 @@ schedule_dlsch(module_id_t module_idP,
|
||||
slice_sched_dl[i] = dlsym(NULL, dl_scheduler_type[i]);
|
||||
update_dl_scheduler[i] = 0 ;
|
||||
update_dl_scheduler_current[i] = 0;
|
||||
LOG_N(MAC,"update dl scheduler slice %d\n", i);
|
||||
LOG_I(MAC,"update dl scheduler slice %d\n", i);
|
||||
}
|
||||
|
||||
if (total_slice_percentage <= 1.0){ // the new total RB share is within the range
|
||||
@@ -482,7 +482,7 @@ schedule_dlsch(module_id_t module_idP,
|
||||
// check if the number of slices has changed, and log
|
||||
if (n_active_slices_current != n_active_slices ){
|
||||
if ((n_active_slices > 0) && (n_active_slices <= MAX_NUM_SLICES)) {
|
||||
LOG_N(MAC,"[eNB %d]frame %d subframe %d: number of active DL slices has changed: %d-->%d\n",
|
||||
LOG_I(MAC,"[eNB %d]frame %d subframe %d: number of active DL slices has changed: %d-->%d\n",
|
||||
module_idP, frameP, subframeP, n_active_slices_current, n_active_slices);
|
||||
|
||||
n_active_slices_current = n_active_slices;
|
||||
@@ -495,7 +495,7 @@ schedule_dlsch(module_id_t module_idP,
|
||||
|
||||
// check if the slice rb share has changed, and log the console
|
||||
if (slice_percentage_current[i] != slice_percentage[i]){ // new slice percentage
|
||||
LOG_N(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: total percentage %f-->%f, slice RB percentage has changed: %f-->%f\n",
|
||||
LOG_I(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: total percentage %f-->%f, slice RB percentage has changed: %f-->%f\n",
|
||||
module_idP, i, frameP, subframeP, total_slice_percentage_current, total_slice_percentage, slice_percentage_current[i], slice_percentage[i]);
|
||||
total_slice_percentage_current= total_slice_percentage;
|
||||
slice_percentage_current[i] = slice_percentage[i];
|
||||
@@ -505,7 +505,7 @@ schedule_dlsch(module_id_t module_idP,
|
||||
// check if the slice max MCS, and log the console
|
||||
if (slice_maxmcs_current[i] != slice_maxmcs[i]){
|
||||
if ((slice_maxmcs[i] >= 0) && (slice_maxmcs[i] < 29)){
|
||||
LOG_N(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: slice MAX MCS has changed: %d-->%d\n",
|
||||
LOG_I(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: slice MAX MCS has changed: %d-->%d\n",
|
||||
module_idP, i, frameP, subframeP, slice_maxmcs_current[i], slice_maxmcs[i]);
|
||||
slice_maxmcs_current[i] = slice_maxmcs[i];
|
||||
} else {
|
||||
@@ -516,7 +516,7 @@ schedule_dlsch(module_id_t module_idP,
|
||||
|
||||
// check if a new scheduler, and log the console
|
||||
if (update_dl_scheduler_current[i] != update_dl_scheduler[i]){
|
||||
LOG_N(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: DL scheduler for this slice is updated: %s \n",
|
||||
LOG_I(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: DL scheduler for this slice is updated: %s \n",
|
||||
module_idP, i, frameP, subframeP, dl_scheduler_type[i]);
|
||||
update_dl_scheduler_current[i] = update_dl_scheduler[i];
|
||||
}
|
||||
@@ -542,7 +542,7 @@ schedule_dlsch(module_id_t module_idP,
|
||||
|
||||
// Check for new sorting policy
|
||||
if (sorting_policy_current[i] != sorting_policy[i]) {
|
||||
LOG_N(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: UE sorting policy has changed (%x-->%x)\n",
|
||||
LOG_I(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: UE sorting policy has changed (%x-->%x)\n",
|
||||
module_idP, i, frameP, subframeP, sorting_policy_current[i], sorting_policy[i]);
|
||||
sorting_policy_current[i] = sorting_policy[i];
|
||||
}
|
||||
@@ -1780,7 +1780,7 @@ set_ue_dai(sub_frame_t subframeP,
|
||||
|
||||
default:
|
||||
UE_list->UE_template[CC_id][UE_id].DAI = 0;
|
||||
LOG_N(MAC, "unknow TDD config %d\n", tdd_config);
|
||||
LOG_I(MAC, "unknow TDD config %d\n", tdd_config);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/MAC/eNB_scheduler_fairRR.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "OCG.h"
|
||||
#include "OCG_extern.h"
|
||||
@@ -2264,7 +2264,6 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP,
|
||||
uint32_t tbs;
|
||||
int16_t tx_power;
|
||||
int UE_id;
|
||||
rnti_t rnti;
|
||||
COMMON_channels_t *cc;
|
||||
LOG_D(MAC,"In ulsch_preprocessor: ulsch ue select\n");
|
||||
//ue select
|
||||
@@ -2308,11 +2307,10 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP,
|
||||
continue;
|
||||
}
|
||||
|
||||
rnti = UE_RNTI(CC_id,UE_id);
|
||||
|
||||
if (first_rb[CC_id] >= frame_parms->N_RB_UL-num_pucch_rb ) {
|
||||
LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n",
|
||||
module_idP,frameP,subframeP,UE_id,rnti,CC_id);
|
||||
module_idP,frameP,subframeP,UE_id,UE_RNTI(CC_id,UE_id),CC_id);
|
||||
break;
|
||||
}
|
||||
total_rbs = frame_parms->N_RB_UL-num_pucch_rb-first_rb[CC_id];
|
||||
@@ -2390,7 +2388,7 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP,
|
||||
rb_table_index = find_rb_table_index(average_rbs);
|
||||
if (rb_table_index>=34){
|
||||
LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: average RBs %d > 100\n",
|
||||
module_idP,frameP,subframeP,UE_id,rnti,CC_id,average_rbs);
|
||||
module_idP,frameP,subframeP,UE_id,UE_RNTI(CC_id,UE_id),CC_id,average_rbs);
|
||||
break;
|
||||
}
|
||||
first_rb[CC_id] = first_rb[CC_id] + rb_table[rb_table_index];
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "OCG.h"
|
||||
#include "OCG_extern.h"
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "OCG.h"
|
||||
#include "OCG_extern.h"
|
||||
@@ -67,13 +67,13 @@ schedule_ue_spec_phy_test(
|
||||
uint16_t TBS;
|
||||
uint16_t nb_rb;
|
||||
|
||||
unsigned char harq_pid = subframeP%5;
|
||||
unsigned char harq_pid = (frameP*10+subframeP)%8;
|
||||
uint16_t rnti = 0x1235;
|
||||
uint32_t rb_alloc = 0x1FFFFFFF;
|
||||
uint32_t rb_alloc = 0x1FFFFF;
|
||||
int32_t tpc = 1;
|
||||
int32_t mcs = 28;
|
||||
int32_t cqi = 15;
|
||||
int32_t ndi = subframeP/5;
|
||||
int32_t ndi = (frameP*10+subframeP)/8;
|
||||
int32_t dai = 0;
|
||||
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
@@ -92,10 +92,9 @@ schedule_ue_spec_phy_test(
|
||||
continue;
|
||||
|
||||
nb_rb = conv_nprb(0,rb_alloc,N_RB_DL);
|
||||
//printf("////////////////////////////////////*************************nb_rb = %d\n",nb_rb);
|
||||
TBS = get_TBS_DL(mcs,nb_rb);
|
||||
|
||||
LOG_D(PHY,"schedule_ue_spec_phy_test: subframe %d/%d: nb_rb=%d, TBS=%d, mcs=%d (rb_alloc=%x, N_RB_DL=%d)\n",frameP,subframeP,nb_rb,TBS,mcs,rb_alloc,N_RB_DL);
|
||||
LOG_D(MAC,"schedule_ue_spec_phy_test: subframe %d/%d: nb_rb=%d, TBS=%d, mcs=%d harq_pid=%d (rb_alloc=%x, N_RB_DL=%d) pdu_number = %d \n", frameP, subframeP, nb_rb, TBS, mcs, harq_pid, rb_alloc, N_RB_DL, dl_req->number_pdu);
|
||||
|
||||
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
|
||||
memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t));
|
||||
@@ -136,6 +135,8 @@ schedule_ue_spec_phy_test(
|
||||
//ue_sched_ctl->round[CC_id][harq_pid] = 0;
|
||||
dl_req->number_dci++;
|
||||
dl_req->number_pdu++;
|
||||
eNB->DL_req[CC_id].sfn_sf = frameP<<4 | subframeP;
|
||||
//eNB->DL_req[CC_id].header.message_id = NFAPI_DL_CONFIG_REQUEST;
|
||||
|
||||
// Toggle NDI for next time
|
||||
/*
|
||||
@@ -150,7 +151,6 @@ schedule_ue_spec_phy_test(
|
||||
AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->pdsch_ConfigDedicated!=NULL,"physicalConfigDedicated->pdsch_ConfigDedicated is NULL\n");
|
||||
*/
|
||||
|
||||
|
||||
|
||||
fill_nfapi_dlsch_config(eNB,
|
||||
dl_req,
|
||||
@@ -196,32 +196,35 @@ void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t s
|
||||
int UE_id = 0;
|
||||
uint8_t aggregation = 2;
|
||||
rnti_t rnti = 0x1235;
|
||||
uint8_t mcs = 0;
|
||||
uint8_t mcs = 20;
|
||||
uint8_t harq_pid = 0;
|
||||
uint32_t cqi_req = 0,cshift,ndi,tpc = 1;
|
||||
int32_t normalized_rx_power;
|
||||
int32_t target_rx_power= 178;
|
||||
int CC_id = 0;
|
||||
int nb_rb = 96;
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
COMMON_channels_t *cc = eNB->common_channels;
|
||||
UE_list_t *UE_list=&eNB->UE_list;
|
||||
eNB_MAC_INST *mac = RC.mac[module_idP];
|
||||
COMMON_channels_t *cc = &mac->common_channels[0];
|
||||
UE_list_t *UE_list=&mac->UE_list;
|
||||
UE_TEMPLATE *UE_template;
|
||||
UE_sched_ctrl *UE_sched_ctrl;
|
||||
int sched_frame=frameP;
|
||||
int sched_subframe = (subframeP+4)%10;
|
||||
uint16_t ul_req_index;
|
||||
uint8_t dlsch_flag;
|
||||
|
||||
if (sched_subframe<subframeP) sched_frame++;
|
||||
|
||||
nfapi_hi_dci0_request_body_t *hi_dci0_req = &eNB->HI_DCI0_req[CC_id][subframeP].hi_dci0_request_body;
|
||||
nfapi_hi_dci0_request_t *hi_dci0_req = &mac->HI_DCI0_req[CC_id][subframeP];
|
||||
nfapi_hi_dci0_request_body_t *hi_dci0_req_body = &hi_dci0_req->hi_dci0_request_body;
|
||||
nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu;
|
||||
|
||||
//nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[0];;
|
||||
nfapi_ul_config_request_body_t *ul_req = &eNB->UL_req[CC_id].ul_config_request_body;
|
||||
nfapi_ul_config_request_body_t *ul_req = &mac->UL_req[CC_id].ul_config_request_body;
|
||||
|
||||
|
||||
eNB->UL_req[CC_id].sfn_sf = (sched_frame<<4) + sched_subframe;
|
||||
eNB->HI_DCI0_req[CC_id][subframeP].sfn_sf = (frameP<<4)+subframeP;
|
||||
mac->UL_req[CC_id].sfn_sf = (sched_frame<<4) + sched_subframe;
|
||||
hi_dci0_req->sfn_sf = (frameP << 4) + subframeP;
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
//rnti = UE_RNTI(module_idP,UE_id);
|
||||
@@ -235,7 +238,6 @@ void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t s
|
||||
UE_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id];
|
||||
harq_pid = subframe2harqpid(&cc[CC_id],sched_frame,sched_subframe);
|
||||
|
||||
LOG_D(MAC,"Scheduling for frame %d, subframe %d => harq_pid %d\n",sched_frame,sched_subframe,harq_pid);
|
||||
|
||||
RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP] = UE_template->TBS_UL[harq_pid];
|
||||
|
||||
@@ -245,7 +247,7 @@ void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t s
|
||||
//compute the expected ULSCH RX power (for the stats)
|
||||
|
||||
// this is the normalized RX power and this should be constant (regardless of mcs
|
||||
normalized_rx_power = UE_sched_ctrl->pusch_snr[CC_id];
|
||||
normalized_rx_power = (5*UE_sched_ctrl->pusch_snr[CC_id]-640)/10+30;
|
||||
|
||||
// new transmission
|
||||
|
||||
@@ -281,7 +283,7 @@ void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t s
|
||||
// save it for a potential retransmission
|
||||
UE_template->cshift[harq_pid] = cshift;
|
||||
|
||||
hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[eNB->HI_DCI0_req[CC_id][subframeP].hi_dci0_request_body.number_of_dci+eNB->HI_DCI0_req[CC_id][subframeP].hi_dci0_request_body.number_of_hi];
|
||||
hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[hi_dci0_req_body->number_of_dci + hi_dci0_req_body->number_of_hi];
|
||||
memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t));
|
||||
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE;
|
||||
hi_dci0_pdu->pdu_size = 2+sizeof(nfapi_hi_dci0_dci_pdu);
|
||||
@@ -298,18 +300,28 @@ void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t s
|
||||
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.tpc = tpc;
|
||||
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.cqi_csi_request = cqi_req;
|
||||
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index = UE_template->DAI_ul[sched_subframe];
|
||||
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.harq_pid = harq_pid;
|
||||
|
||||
|
||||
hi_dci0_req_body->number_of_dci++;
|
||||
|
||||
eNB->HI_DCI0_req[CC_id][subframeP].hi_dci0_request_body.number_of_dci++;
|
||||
|
||||
|
||||
ul_req_index = 0;
|
||||
dlsch_flag = 0;
|
||||
for(ul_req_index = 0;ul_req_index < ul_req->number_of_pdus;ul_req_index++){
|
||||
if(ul_req->ul_config_pdu_list[ul_req_index].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE){
|
||||
dlsch_flag = 1;
|
||||
LOG_D(MAC,"Frame %d, Subframe %d:rnti %x ul_req_index %d Switched UCI HARQ to ULSCH HARQ(first)\n",frameP,subframeP,rnti,ul_req_index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Add UL_config PDUs
|
||||
fill_nfapi_ulsch_config_request_rel8(&ul_req->ul_config_pdu_list[ul_req->number_of_pdus],
|
||||
fill_nfapi_ulsch_config_request_rel8(& ul_req->ul_config_pdu_list[ul_req_index],
|
||||
cqi_req,
|
||||
cc,
|
||||
0,//UE_template->physicalConfigDedicated,
|
||||
get_tmode(module_idP,CC_id,UE_id),
|
||||
eNB->ul_handle,
|
||||
mac->ul_handle,//eNB->ul_handle,
|
||||
rnti,
|
||||
first_rb[CC_id], // resource_block_start
|
||||
nb_rb, // number_of_resource_blocks
|
||||
@@ -327,7 +339,7 @@ void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t s
|
||||
);
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if (UE_template->rach_resource_type>0) { // This is a BL/CE UE allocation
|
||||
fill_nfapi_ulsch_config_request_emtc(&ul_req->ul_config_pdu_list[ul_req->number_of_pdus],
|
||||
fill_nfapi_ulsch_config_request_emtc(&ul_req->ul_config_pdu_list[ul_req_index],
|
||||
UE_template->rach_resource_type>2 ? 2 : 1,
|
||||
1, //total_number_of_repetitions
|
||||
1, //repetition_number
|
||||
@@ -335,7 +347,7 @@ void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t s
|
||||
}
|
||||
#endif
|
||||
ul_req->number_of_pdus = 1;
|
||||
eNB->ul_handle++;
|
||||
mac->ul_handle++;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "OCG.h"
|
||||
#include "OCG_extern.h"
|
||||
@@ -3399,7 +3399,7 @@ unsigned char ul_ACK_subframe2M(TDD_Config_t *tdd_Config,unsigned char subframe)
|
||||
} else if (subframe == 8) { // ACK subframe 4
|
||||
return(1); // To be updated
|
||||
} else {
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config %d\n",
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config %ld\n",
|
||||
subframe,tdd_Config->subframeAssignment);
|
||||
|
||||
}
|
||||
@@ -3413,7 +3413,7 @@ unsigned char ul_ACK_subframe2M(TDD_Config_t *tdd_Config,unsigned char subframe)
|
||||
} else if (subframe == 4) { // ACK subframes 9 and 0
|
||||
return(2);
|
||||
} else {
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config %d\n",
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config %ld\n",
|
||||
subframe,tdd_Config->subframeAssignment);
|
||||
}
|
||||
|
||||
@@ -3425,7 +3425,7 @@ unsigned char ul_ACK_subframe2M(TDD_Config_t *tdd_Config,unsigned char subframe)
|
||||
} else if (subframe == 3) { // ACK subframes 6,7,8 and 9
|
||||
return(4);
|
||||
} else {
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config %d\n",
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config %ld\n",
|
||||
subframe,tdd_Config->subframeAssignment);
|
||||
}
|
||||
|
||||
@@ -3435,7 +3435,7 @@ unsigned char ul_ACK_subframe2M(TDD_Config_t *tdd_Config,unsigned char subframe)
|
||||
if (subframe == 2) { // ACK subframes 0,3,4,5,6,7,8 and 9
|
||||
return(8); // should be 3
|
||||
} else {
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config %d\n",
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config %ld\n",
|
||||
subframe,tdd_Config->subframeAssignment);
|
||||
}
|
||||
|
||||
@@ -3464,7 +3464,7 @@ unsigned char ul_ACK_subframe2dl_subframe(TDD_Config_t *tdd_Config,unsigned char
|
||||
} else if (subframe == 4) { // ACK subframes 9 and 0
|
||||
return((9+ACK_index)%10);
|
||||
} else {
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config->subframeAssignment %d\n",
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config->subframeAssignment %ld\n",
|
||||
subframe,tdd_Config->subframeAssignment);
|
||||
}
|
||||
|
||||
@@ -3481,7 +3481,7 @@ unsigned char ul_ACK_subframe2dl_subframe(TDD_Config_t *tdd_Config,unsigned char
|
||||
} else if (subframe == 3) { // ACK subframes 6, 7 8 and 9
|
||||
return(6+ACK_index); // To be updated
|
||||
} else {
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config %d\n",
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config %ld\n",
|
||||
subframe,tdd_Config->subframeAssignment);
|
||||
}
|
||||
|
||||
@@ -3497,7 +3497,7 @@ unsigned char ul_ACK_subframe2dl_subframe(TDD_Config_t *tdd_Config,unsigned char
|
||||
} else if (subframe == 8) { // ACK subframe 4
|
||||
return(4); // To be updated
|
||||
} else {
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config %d\n",
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config %ld\n",
|
||||
subframe,tdd_Config->subframeAssignment);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "OCG.h"
|
||||
#include "OCG_extern.h"
|
||||
@@ -800,7 +800,7 @@ rx_sdu(const module_id_t enb_mod_idP,
|
||||
/*
|
||||
if (msg3_flagP != NULL) {
|
||||
if( *msg3_flagP == 1 ) {
|
||||
LOG_N(MAC,"[eNB %d] CC_id %d frame %d : false msg3 detection: signal phy to canceling RA and remove the UE\n", enb_mod_idP, CC_idP, frameP);
|
||||
LOG_I(MAC,"[eNB %d] CC_id %d frame %d : false msg3 detection: signal phy to canceling RA and remove the UE\n", enb_mod_idP, CC_idP, frameP);
|
||||
*msg3_flagP=0;
|
||||
}
|
||||
} */
|
||||
@@ -1095,7 +1095,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
|
||||
//total_slice_percentage_current_uplink+=slice_percentage_uplink[i];
|
||||
//if (total_slice_percentage_current_uplink> 1)
|
||||
//total_slice_percentage_current_uplink=1;
|
||||
LOG_N(MAC,"update ul scheduler slice %d\n", i);
|
||||
LOG_I(MAC,"update ul scheduler slice %d\n", i);
|
||||
}
|
||||
// the new total RB share is within the range
|
||||
if (total_slice_percentage_uplink <= 1.0){
|
||||
@@ -1103,7 +1103,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
|
||||
// check if the number of slices has changed, and log
|
||||
if (n_active_slices_current_uplink != n_active_slices_uplink ){
|
||||
if ((n_active_slices_uplink > 0) && (n_active_slices_uplink <= MAX_NUM_SLICES)) {
|
||||
LOG_N(MAC,"[eNB %d]frame %d subframe %d: number of active UL slices has changed: %d-->%d\n",
|
||||
LOG_I(MAC,"[eNB %d]frame %d subframe %d: number of active UL slices has changed: %d-->%d\n",
|
||||
module_idP, frameP, subframeP, n_active_slices_current_uplink, n_active_slices_uplink);
|
||||
n_active_slices_current_uplink = n_active_slices_uplink;
|
||||
} else {
|
||||
@@ -1115,7 +1115,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
|
||||
|
||||
// check if the slice rb share has changed, and log the console
|
||||
if (slice_percentage_current_uplink[i] != slice_percentage_uplink[i]){
|
||||
LOG_N(MAC,"[eNB %d][SLICE %d][UL] frame %d subframe %d: total percentage %f-->%f, slice RB percentage has changed: %f-->%f\n",
|
||||
LOG_I(MAC,"[eNB %d][SLICE %d][UL] frame %d subframe %d: total percentage %f-->%f, slice RB percentage has changed: %f-->%f\n",
|
||||
module_idP, i, frameP, subframeP, total_slice_percentage_current_uplink,
|
||||
total_slice_percentage_uplink, slice_percentage_current_uplink[i], slice_percentage_uplink[i]);
|
||||
total_slice_percentage_current_uplink = total_slice_percentage_uplink;
|
||||
@@ -1125,7 +1125,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
|
||||
// check if the slice max MCS, and log the console
|
||||
if (slice_maxmcs_current_uplink[i] != slice_maxmcs_uplink[i]){
|
||||
if ((slice_maxmcs_uplink[i] >= 0) && (slice_maxmcs_uplink[i] <= 16)){
|
||||
LOG_N(MAC,"[eNB %d][SLICE %d][UL] frame %d subframe %d: slice MAX MCS has changed: %d-->%d\n",
|
||||
LOG_I(MAC,"[eNB %d][SLICE %d][UL] frame %d subframe %d: slice MAX MCS has changed: %d-->%d\n",
|
||||
module_idP, i, frameP, subframeP, slice_maxmcs_current_uplink[i], slice_maxmcs_uplink[i]);
|
||||
slice_maxmcs_current_uplink[i] = slice_maxmcs_uplink[i];
|
||||
} else {
|
||||
@@ -1137,7 +1137,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
|
||||
|
||||
// check if a new scheduler, and log the console
|
||||
if (update_ul_scheduler_current[i] != update_ul_scheduler[i]){
|
||||
LOG_N(MAC,"[eNB %d][SLICE %d][UL] frame %d subframe %d: UL scheduler for this slice is updated: %s \n",
|
||||
LOG_I(MAC,"[eNB %d][SLICE %d][UL] frame %d subframe %d: UL scheduler for this slice is updated: %s \n",
|
||||
module_idP, i, frameP, subframeP, ul_scheduler_type[i]);
|
||||
update_ul_scheduler_current[i] = update_ul_scheduler[i];
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user