Merge branch 'oaisim_config_module_fix' into develop-nos1-fixes
Includes the following updates: 1. oaisim/lte-softmodem in noS1 2. UE fixes for oaisim 3. IF4p5 fixes (doesn't work on develop) 4. UE fixes for DCI handling (corrects problem introduced in develop) Conflicts: cmake_targets/CMakeLists.txt targets/SIMU/USER/oaisim_functions.c
This commit is contained in:
@@ -1934,7 +1934,6 @@ add_executable(oaisim_nos1
|
||||
${x2ap_h}
|
||||
${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
|
||||
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
|
||||
${OPENAIR_TARGETS}/SIMU/USER/channel_sim.c
|
||||
|
||||
@@ -52,9 +52,12 @@ char defbool[2]="1";
|
||||
switch(cfgoptions->type)
|
||||
{
|
||||
case TYPE_STRING:
|
||||
config_check_valptr(cfgoptions, (char **)(cfgoptions->strptr), sizeof(char *));
|
||||
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval+1));
|
||||
sprintf(*(cfgoptions->strptr), "%s",tmpval);
|
||||
if (cfgoptions->numelt == 0 ) {
|
||||
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval)+1);
|
||||
sprintf(*(cfgoptions->strptr), "%s",tmpval);
|
||||
} else {
|
||||
sprintf( (char *)(cfgoptions->strptr), "%s",tmpval);
|
||||
}
|
||||
printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval);
|
||||
optisset=1;
|
||||
break;
|
||||
|
||||
@@ -129,20 +129,21 @@ int i;
|
||||
|
||||
/* default */
|
||||
if (cfgparam == NULL) {
|
||||
cfgparam = "libconfig:oaisoftmodem.conf";
|
||||
tmpflags = tmpflags | CONFIG_NOOOPT;
|
||||
cfgparam = DEFAULT_CFGMODE ":" DEFAULT_CFGFILENAME;
|
||||
}
|
||||
/* parse the config parameters to set the config source */
|
||||
i = sscanf(cfgparam,"%m[^':']:%ms",&cfgmode,&modeparams);
|
||||
if (i< 0) {
|
||||
fprintf(stderr,"[CONFIG] %s, %d, sscanf error parsing config source %s: %s\n", __FILE__, __LINE__,cfgparam, strerror(errno));
|
||||
cfgmode=strdup("libconfig");
|
||||
modeparams = strdup("oaisoftmodem.conf");
|
||||
cfgmode=strdup(DEFAULT_CFGMODE);
|
||||
modeparams = strdup(DEFAULT_CFGFILENAME);
|
||||
}
|
||||
else if ( i == 1 ) {
|
||||
/* -O argument doesn't contain ":" separator, assume -O <conf file> option, default cfgmode to libconfig
|
||||
with one parameter, the path to the configuration file */
|
||||
modeparams=cfgmode;
|
||||
cfgmode=strdup("libconfig");
|
||||
cfgmode=strdup(DEFAULT_CFGMODE);
|
||||
}
|
||||
|
||||
cfgptr = malloc(sizeof(configmodule_interface_t));
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#define CONFIG_DEBUGCMDLINE 4 // print command line processing messages
|
||||
#define CONFIG_HELP 8 // print help message
|
||||
#define CONFIG_ABORT 16 // config failed,abort execution
|
||||
#define CONFIG_NOOOPT 32 // no -O option found when parsing command line
|
||||
|
||||
|
||||
typedef int(*configmodule_initfunc_t)(char *cfgP[],int numP);
|
||||
|
||||
@@ -50,7 +50,11 @@ configmodule_interface_t *config_get_if(void)
|
||||
char * config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length)
|
||||
{
|
||||
|
||||
printf_ptrs("-- %s 0x%08lx %i\n",cfgoptions->optname,(uintptr_t)(*ptr),length);
|
||||
printf_ptrs("[CONFIG] %s ptr: 0x%08lx requested size: %i\n",cfgoptions->optname,(uintptr_t)(ptr),length);
|
||||
if(cfgoptions->numelt > 0) { /* already allocated */
|
||||
return *ptr;
|
||||
}
|
||||
|
||||
if (*ptr == NULL) {
|
||||
*ptr = malloc(length);
|
||||
if ( *ptr != NULL) {
|
||||
@@ -147,3 +151,7 @@ int config_isparamset(paramdef_t *params,int paramidx)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int config_getparamval_fromparamdefidx(paramdef_t *cfgoptions,int paramidx) {
|
||||
|
||||
}
|
||||
|
||||
@@ -38,6 +38,9 @@
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
#define DEFAULT_CFGFILENAME "oaisoftmodem.conf"
|
||||
#define DEFAULT_CFGMODE "libconfig"
|
||||
|
||||
#define CONFIG_GETSOURCE ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgmode )
|
||||
#define CONFIG_GETNUMP ( (config_get_if()==NULL) ? 0 : config_get_if()->num_cfgP )
|
||||
#define CONFIG_GETP(P) ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgP[P] )
|
||||
@@ -51,6 +54,7 @@ extern int config_get(paramdef_t *params,int numparams, char *prefix);
|
||||
extern int config_isparamset(paramdef_t *params,int paramidx);
|
||||
extern void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val);
|
||||
extern int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix);
|
||||
extern int config_getparamval_fromparamdefidx(paramdef_t *cfgoptions,int paramidx);
|
||||
#define config_getlist config_get_if()->getlist
|
||||
#define CONFIG_GETCONFFILE (config_get_if()->cfgP[0])
|
||||
|
||||
|
||||
@@ -104,17 +104,28 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
|
||||
cfgpath,str,cfgoptions[i].numelt);
|
||||
str[strlen(str)-1] = 0;
|
||||
}
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
|
||||
config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(str)+1);
|
||||
sprintf( *(cfgoptions[i].strptr) , "%s", str);
|
||||
printf_params("[LIBCONFIG] %s: %s\n", cfgpath,*(cfgoptions[i].strptr) );
|
||||
if (cfgoptions[i].numelt == 0 ) {
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
|
||||
config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(str)+1);
|
||||
sprintf( *(cfgoptions[i].strptr) , "%s", str);
|
||||
printf_params("[LIBCONFIG] %s: %s\n", cfgpath,*(cfgoptions[i].strptr) );
|
||||
} else {
|
||||
sprintf( (char *)(cfgoptions[i].strptr) , "%s", str);
|
||||
printf_params("[LIBCONFIG] %s: %s\n", cfgpath,(char *)cfgoptions[i].strptr );
|
||||
}
|
||||
} else {
|
||||
if( cfgoptions[i].defstrval != NULL) {
|
||||
defval=1;
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
|
||||
config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(cfgoptions[i].defstrval)+1);
|
||||
sprintf(*(cfgoptions[i].strptr), "%s",cfgoptions[i].defstrval);
|
||||
printf_params("[LIBCONFIG] %s set to default value %s\n", cfgpath, *(cfgoptions[i].strptr));
|
||||
|
||||
if (cfgoptions[i].numelt == 0 ) {
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
|
||||
config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(cfgoptions[i].defstrval)+1);
|
||||
sprintf(*(cfgoptions[i].strptr), "%s",cfgoptions[i].defstrval);
|
||||
printf_params("[LIBCONFIG] %s set to default value %s\n", cfgpath, *(cfgoptions[i].strptr));
|
||||
} else {
|
||||
sprintf((char *)(cfgoptions[i].strptr), "%s",cfgoptions[i].defstrval);
|
||||
printf_params("[LIBCONFIG] %s set to default value %s\n", cfgpath, (char *)cfgoptions[i].strptr);
|
||||
}
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
@@ -183,7 +194,7 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
|
||||
read_intarray(&cfgoptions[i],setting,cfgpath);
|
||||
} else {
|
||||
if( cfgoptions[i].defintarrayval != NULL) {
|
||||
config_check_valptr(&(cfgoptions[i]),(char **)&(cfgoptions[i].iptr), sizeof(int32_t));
|
||||
config_check_valptr(&(cfgoptions[i]),(char **)&(cfgoptions[i].iptr), sizeof(int32_t*));
|
||||
cfgoptions[i].iptr=cfgoptions[i].defintarrayval;
|
||||
defval=1;
|
||||
for (int j=0; j<cfgoptions[i].numelt ; j++) {
|
||||
|
||||
@@ -1228,6 +1228,7 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
|
||||
LOG_I(PHY,"C-RNTI %x %x \n", phy_vars_ue->pdcch_vars[0][eNB_id]->crnti,
|
||||
phy_vars_ue->pdcch_vars[1][eNB_id]->crnti);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void phy_config_cba_rnti (module_id_t Mod_id,int CC_id,eNB_flag_t eNB_flag, uint8_t index, rnti_t cba_rnti, uint8_t cba_group_id, uint8_t num_active_cba_groups)
|
||||
|
||||
@@ -2257,7 +2257,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
|
||||
y[0] = &yseq0[0];
|
||||
y[1] = &yseq1[0];
|
||||
|
||||
#if 0
|
||||
#if 1
|
||||
// reset all bits to <NIL>, here we set <NIL> elements as 2
|
||||
// memset(e, 2, DCI_BITS_MAX);
|
||||
// here we interpret NIL as a random QPSK sequence. That makes power estimation easier.
|
||||
@@ -2268,7 +2268,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
|
||||
/* clear all bits, the above code may generate too much false detections
|
||||
* (not sure about this, to be checked somehow)
|
||||
*/
|
||||
memset(e, 0, DCI_BITS_MAX);
|
||||
// memset(e, 0, DCI_BITS_MAX);
|
||||
|
||||
e_ptr = e;
|
||||
|
||||
@@ -3095,8 +3095,8 @@ uint16_t dci_CRNTI_decoding_procedure(PHY_VARS_UE *ue,
|
||||
mi,
|
||||
((ue->decode_SIB == 1) ? SI_RNTI : 0),
|
||||
ra_rnti,
|
||||
P_RNTI,
|
||||
agregationLevel,
|
||||
P_RNTI,
|
||||
agregationLevel,
|
||||
format1A,
|
||||
format1A,
|
||||
format1A,
|
||||
@@ -3114,7 +3114,7 @@ uint16_t dci_CRNTI_decoding_procedure(PHY_VARS_UE *ue,
|
||||
((format0_found==1)&&(format_c_found==1)))
|
||||
return(dci_cnt);
|
||||
|
||||
if (DCIFormat == 1)
|
||||
if (DCIFormat == format1)
|
||||
{
|
||||
if ((tmode < 3) || (tmode == 7)) {
|
||||
//printf("Crnti decoding frame param agregation %d DCI %d \n",agregationLevel,DCIFormat);
|
||||
@@ -3157,14 +3157,14 @@ uint16_t dci_CRNTI_decoding_procedure(PHY_VARS_UE *ue,
|
||||
//printf("Crnti 1 decoding frame param agregation %d DCI %d \n",agregationLevel,DCIFormat);
|
||||
|
||||
}
|
||||
else
|
||||
else if (DCIFormat == format1A)
|
||||
{
|
||||
AssertFatal(0,"Other Transmission mode not yet coded\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AssertFatal(0,"DCI format %d not yet implemented \n",DCIFormat);
|
||||
LOG_W(PHY,"DCI format %d wrong or not yet implemented \n",DCIFormat);
|
||||
}
|
||||
|
||||
return(dci_cnt);
|
||||
@@ -3388,7 +3388,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
||||
|
||||
if (do_common == 1) {
|
||||
#ifdef DEBUG_DCI_DECODING
|
||||
printf("[DCI search] doing common search/format0 aggregation 4\n");
|
||||
printf("[DCI search] subframe %d: doing common search/format0 aggregation 4\n",subframe);
|
||||
#endif
|
||||
|
||||
if (ue->prach_resources[eNB_id])
|
||||
|
||||
@@ -4988,10 +4988,10 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
if(symbol < (frame_parms->symbols_per_tti-1))
|
||||
pdsch_vars->llr_offset[symbol+1] = pdsch_vars->llr_offset[symbol] + llr_offset;
|
||||
|
||||
//LOG_I(PHY,"Granted Re subframe %d / symbol %d => %d (%d RBs)\n", subframe, symbol_mod, granted_re,dlsch0_harq->nb_rb);
|
||||
//LOG_I(PHY,"Pbch/PSS/SSS Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, pbch_pss_sss_re);
|
||||
//LOG_I(PHY,"CRS Re Per PRB subframe %d / symbol %d => %d \n", subframe, symbol_mod, crs_re);
|
||||
//LOG_I(PHY,"Data Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, data_re);
|
||||
// LOG_I(PHY,"Granted Re subframe %d / symbol %d => %d (%d RBs)\n", subframe, symbol_mod, granted_re,dlsch0_harq->nb_rb);
|
||||
// LOG_I(PHY,"Pbch/PSS/SSS Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, pbch_pss_sss_re);
|
||||
// LOG_I(PHY,"CRS Re Per PRB subframe %d / symbol %d => %d \n", subframe, symbol_mod, crs_re);
|
||||
// LOG_I(PHY,"Data Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, data_re);
|
||||
|
||||
|
||||
|
||||
@@ -5028,7 +5028,6 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format,
|
||||
|
||||
uint8_t NPRB = 0;
|
||||
uint8_t NPRB4TBS = 0;
|
||||
uint8_t nb_rb_alloc = 0;
|
||||
|
||||
if(dci_format == format1A)
|
||||
{
|
||||
@@ -5070,14 +5069,12 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format,
|
||||
}
|
||||
|
||||
*/
|
||||
nb_rb_alloc = NPRB;
|
||||
}
|
||||
}
|
||||
else // format1
|
||||
{
|
||||
NPRB = conv_nprb(rah, rballoc, N_RB_DL);
|
||||
NPRB4TBS=NPRB;
|
||||
nb_rb_alloc = NPRB;
|
||||
}
|
||||
|
||||
pdlsch0->current_harq_pid = harq_pid;
|
||||
@@ -5178,7 +5175,6 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format,
|
||||
pdlsch0_harq->rb_alloc_even[1] = localRIV2alloc_LUT50_1[rballoc];
|
||||
pdlsch0_harq->rb_alloc_odd[0] = localRIV2alloc_LUT50_0[rballoc];
|
||||
pdlsch0_harq->rb_alloc_odd[1] = localRIV2alloc_LUT50_1[rballoc];
|
||||
printf("rballoc: %08x.%08x\n",pdlsch0_harq->rb_alloc_even[0],pdlsch0_harq->rb_alloc_even[1]);
|
||||
} else { // DISTRIBUTED
|
||||
if ((rballoc&(1<<10)) == 0) {
|
||||
rballoc = rballoc&(~(1<<10));
|
||||
@@ -5260,7 +5256,7 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format,
|
||||
pdcch_vars,
|
||||
pdsch_vars,
|
||||
pdlsch0_harq,
|
||||
nb_rb_alloc,
|
||||
NPRB,
|
||||
subframe);
|
||||
}
|
||||
|
||||
@@ -6492,7 +6488,7 @@ uint8_t pdcch_alloc2ul_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n)
|
||||
else
|
||||
ul_subframe = ((n+4)%10);
|
||||
|
||||
if (subframe_select(frame_parms,ul_subframe) != SF_UL) return(255);
|
||||
AssertFatal(frame_parms->frame_type == FDD || subframe_select(frame_parms,ul_subframe) == SF_UL,"illegal ul_subframe %d\n",ul_subframe);
|
||||
|
||||
LOG_D(PHY, "subframe %d: PUSCH subframe = %d\n", n, ul_subframe);
|
||||
return ul_subframe;
|
||||
@@ -7193,6 +7189,10 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
|
||||
harq_pid = subframe2harq_pid(frame_parms,
|
||||
pdcch_alloc2ul_frame(frame_parms,proc->frame_rx,subframe),
|
||||
pdcch_alloc2ul_subframe(frame_parms,subframe));
|
||||
LOG_D(PHY,"Frame %d, Subframe %d: Programming ULSCH for (%d.%d) => harq_pid %d\n",
|
||||
proc->frame_rx,subframe,
|
||||
pdcch_alloc2ul_frame(frame_parms,proc->frame_rx,subframe),
|
||||
pdcch_alloc2ul_subframe(frame_parms,subframe), harq_pid);
|
||||
|
||||
if (harq_pid == 255) {
|
||||
LOG_E(PHY, "frame %d, subframe %d, rnti %x, format %d: illegal harq_pid!\n",
|
||||
@@ -7985,7 +7985,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
|
||||
dlsch[0]->harq_ack[subframe].vDAI_UL = dai+1;
|
||||
|
||||
|
||||
/*LOG_I(PHY, "[PUSCH %d] Format0 DCI %s, CQI_req=%d, cshift=%d, TPC=%d, DAI=%d, vDAI_UL[sf#%d]=%d, NDI=%d, MCS=%d, RBalloc=%d, first_rb=%d, harq_pid=%d, nb_rb=%d, subframe_scheduling_flag=%d"
|
||||
LOG_D(PHY, "[PUSCH %d] Format0 DCI %s, CQI_req=%d, cshift=%d, TPC=%d, DAI=%d, vDAI_UL[sf#%d]=%d, NDI=%d, MCS=%d, RBalloc=%d, first_rb=%d, harq_pid=%d, nb_rb=%d, subframe_scheduling_flag=%d"
|
||||
" ulsch->bundling %d, O_ACK %d \n",
|
||||
harq_pid,
|
||||
(frame_parms->frame_type == TDD? "TDD" : "FDD"),
|
||||
@@ -7993,7 +7993,8 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
|
||||
ulsch->harq_processes[harq_pid]->first_rb, harq_pid, ulsch->harq_processes[harq_pid]->nb_rb,
|
||||
ulsch->harq_processes[harq_pid]->subframe_scheduling_flag,
|
||||
ulsch->bundling,
|
||||
ulsch->harq_processes[harq_pid]->O_ACK);*/
|
||||
ulsch->harq_processes[harq_pid]->O_ACK);
|
||||
|
||||
LOG_D(PHY,"Setting beta_offset_cqi_times8 to %d, index %d\n",
|
||||
beta_cqi[ue->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index],
|
||||
ue->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index);
|
||||
@@ -8050,7 +8051,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
|
||||
|
||||
#ifdef UE_DEBUG_TRACE
|
||||
|
||||
LOG_I(PHY,"Format 0 DCI : ulsch (ue): AbsSubframe %d.%d\n",proc->frame_rx%1024,subframe);
|
||||
LOG_D(PHY,"Format 0 DCI : ulsch (ue): AbsSubframe %d.%d\n",proc->frame_rx%1024,subframe);
|
||||
LOG_D(PHY,"Format 0 DCI : ulsch (ue): NBRB %d\n",ulsch->harq_processes[harq_pid]->nb_rb);
|
||||
LOG_D(PHY,"Format 0 DCI :ulsch (ue): first_rb %d\n",ulsch->harq_processes[harq_pid]->first_rb);
|
||||
LOG_D(PHY,"Format 0 DCI :ulsch (ue): rballoc %d\n",rballoc);
|
||||
|
||||
@@ -849,18 +849,20 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
pllr_symbol_cw1 = (int8_t*)pdsch_vars[eNB_id]->llr[1];
|
||||
pllr_symbol_cw0 += llr_offset_symbol;
|
||||
pllr_symbol_cw1 += llr_offset_symbol;
|
||||
|
||||
/*LOG_I(PHY,"compute LLRs [AbsSubframe %d.%d-%d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d @LLR Buff %x @LLR Buff(symb) %x\n",
|
||||
proc->frame_rx, proc->subframe_rx,symbol,
|
||||
/*
|
||||
LOG_I(PHY,"compute LLRs [AbsSubframe %d.%d-%d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d @LLR Buff %x @LLR Buff(symb) %x\n",
|
||||
frame, subframe,symbol,
|
||||
nb_rb,dlsch0_harq->Qm,
|
||||
pdsch_vars[eNB_id]->llr_length[symbol],
|
||||
pdsch_vars[eNB_id]->llr_offset[symbol],
|
||||
(int16_t*)pdsch_vars[eNB_id]->llr[0],
|
||||
pllr_symbol);*/
|
||||
|
||||
pllr_symbol_cw0);
|
||||
*/
|
||||
switch (dlsch0_harq->Qm) {
|
||||
case 2 :
|
||||
if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
|
||||
|
||||
|
||||
dlsch_qpsk_llr(frame_parms,
|
||||
pdsch_vars[eNB_id]->rxdataF_comp0,
|
||||
(int16_t*)pllr_symbol_cw0,
|
||||
|
||||
@@ -672,14 +672,14 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
}
|
||||
|
||||
|
||||
//printf("dlsch_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
|
||||
/*LOG_I(PHY,"dlsch_qpsk_llr: [symb %d / FirstSym %d / Length %d]: @LLR Buff %x, @LLR Buff(symb) %x \n",
|
||||
/*
|
||||
LOG_I(PHY,"dlsch_qpsk_llr: [symb %d / FirstSym %d / Length %d]: @LLR Buff %x, @LLR Buff(symb) %x \n",
|
||||
symbol,
|
||||
first_symbol_flag,
|
||||
len,
|
||||
dlsch_llr,
|
||||
llr32);*/
|
||||
|
||||
llr32);
|
||||
*/
|
||||
//printf("ll32p=%p , dlsch_llr=%p, symbol=%d, flag=%d \n", llr32, dlsch_llr, symbol, first_symbol_flag);
|
||||
for (i=0; i<len; i++) {
|
||||
*llr32 = *rxF;
|
||||
|
||||
@@ -105,7 +105,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
|
||||
if ((ru->ifdevice.trx_write_func(&ru->ifdevice,
|
||||
symbol_id,
|
||||
&tx_buffer,
|
||||
db_fulllength,
|
||||
db_fulllength,
|
||||
1,
|
||||
IF4p5_PDLFFT)) < 0) {
|
||||
perror("ETHERNET write for IF4p5_PDLFFT\n");
|
||||
@@ -138,19 +138,18 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
|
||||
|
||||
if (packet_type == IF4p5_PULFFT) {
|
||||
|
||||
uint16_t *rx0 = (uint16_t*) &rxdataF[0][blockoffsetF];
|
||||
uint16_t *rx1 = (uint16_t*) &rxdataF[0][slotoffsetF];
|
||||
for (symbol_id=fp->symbols_per_tti-nsym; symbol_id<fp->symbols_per_tti; symbol_id++) {
|
||||
|
||||
uint32_t *rx0 = (uint32_t*) &rxdataF[0][blockoffsetF];
|
||||
uint32_t *rx1 = (uint32_t*) &rxdataF[0][slotoffsetF];
|
||||
|
||||
for (symbol_id=fp->symbols_per_tti-nsym; symbol_id<fp->symbols_per_tti; symbol_id++) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF4_SYMBOL, symbol_id );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF4_SYMBOL, symbol_id );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 1 );
|
||||
|
||||
|
||||
start_meas(&ru->compression);
|
||||
|
||||
for (element_id=0; element_id<db_halflength; element_id+=8) {
|
||||
i = (uint16_t*) &rx0[element_id];
|
||||
for (element_id=0; element_id<db_halflength; element_id+=8) {
|
||||
i = (uint16_t*) &rx0[element_id];
|
||||
d = (uint16_t*) &data_block[element_id];
|
||||
d[0] = ((uint16_t) lin2alaw_if4p5[i[0]]) | ((uint16_t)(lin2alaw_if4p5[i[1]]<<8));
|
||||
d[1] = ((uint16_t) lin2alaw_if4p5[i[2]]) | ((uint16_t)(lin2alaw_if4p5[i[3]]<<8));
|
||||
@@ -176,10 +175,10 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
|
||||
|
||||
stop_meas(&ru->compression);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 0 );
|
||||
packet_header->frame_status &= ~(0x000f<<26);
|
||||
packet_header->frame_status |= (symbol_id&0x000f)<<26;
|
||||
packet_header->frame_status &= ~(0x000f<<26);
|
||||
packet_header->frame_status |= (symbol_id&0x000f)<<26;
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 1 );
|
||||
start_meas(&ru->transport);
|
||||
start_meas(&ru->transport);
|
||||
if ((ru->ifdevice.trx_write_func(&ru->ifdevice,
|
||||
symbol_id,
|
||||
&tx_buffer,
|
||||
@@ -188,7 +187,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
|
||||
IF4p5_PULFFT)) < 0) {
|
||||
perror("ETHERNET write for IF4p5_PULFFT\n");
|
||||
}
|
||||
stop_meas(&ru->transport);
|
||||
stop_meas(&ru->transport);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 0 );
|
||||
slotoffsetF += fp->ofdm_symbol_size;
|
||||
blockoffsetF += fp->ofdm_symbol_size;
|
||||
@@ -351,6 +350,9 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint
|
||||
|
||||
//if (element_id==0) LOG_I(PHY,"recv_if4p5: symbol %d rxdata0 = (%u,%u)\n",*symbol_number,*i,*(i+1));
|
||||
}
|
||||
LOG_D(PHY,"PULFFT_IF4p5: CC_id %d : frame %d, subframe %d (symbol %d)=> %d dB\n",ru->idx,*frame,*subframe,*symbol_number,
|
||||
dB_fixed(signal_energy((int*)&rxdataF[0][slotoffsetF],db_halflength)+
|
||||
signal_energy((int*)&rxdataF[0][blockoffsetF],db_halflength)));
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, 0 );
|
||||
} else if (*packet_type >= IF4p5_PRACH &&
|
||||
*packet_type <= IF4p5_PRACH + 4) {
|
||||
|
||||
@@ -607,13 +607,14 @@ void prach_procedures(PHY_VARS_eNB *eNB,
|
||||
#endif
|
||||
);
|
||||
|
||||
//#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"[RAPROC] Frame %d, subframe %d : Most likely preamble %d, energy %d dB delay %d\n",
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"[RAPROC] Frame %d, subframe %d : Most likely preamble %d, energy %d dB delay %d (prach_energy counter %d)\n",
|
||||
frame,subframe,
|
||||
max_preamble[0],
|
||||
max_preamble_energy[0]/10,
|
||||
max_preamble_delay[0]);
|
||||
//q#endif
|
||||
max_preamble_delay[0],
|
||||
eNB->prach_energy_counter);
|
||||
#endif
|
||||
|
||||
#ifdef Rel14
|
||||
if (br_flag==1) {
|
||||
@@ -665,7 +666,7 @@ void prach_procedures(PHY_VARS_eNB *eNB,
|
||||
if ((eNB->prach_energy_counter == 100) &&
|
||||
(max_preamble_energy[0] > eNB->measurements.prach_I0+100)) {
|
||||
|
||||
LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n",
|
||||
LOG_I(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n",
|
||||
eNB->Mod_id,
|
||||
eNB->CC_id,
|
||||
frame,
|
||||
@@ -1374,13 +1375,14 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
fill_crc_indication(eNB,i,frame,subframe,1); // indicate NAK to MAC
|
||||
fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC
|
||||
|
||||
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n",
|
||||
LOG_I(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n",
|
||||
eNB->Mod_id,harq_pid,
|
||||
frame,subframe, i,
|
||||
ulsch_harq->round-1,
|
||||
ulsch->Mlimit,
|
||||
ulsch_harq->o_ACK[0],
|
||||
ulsch_harq->o_ACK[1]);
|
||||
|
||||
if (ulsch_harq->round >= 3) {
|
||||
ulsch_harq->status = SCH_IDLE;
|
||||
ulsch_harq->handled = 0;
|
||||
|
||||
@@ -82,6 +82,7 @@ extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
#endif
|
||||
|
||||
|
||||
#define DEBUG_UE_TRACE 1
|
||||
|
||||
void dump_dlsch(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid)
|
||||
{
|
||||
@@ -1543,18 +1544,21 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
||||
frame_tx,
|
||||
subframe_tx);
|
||||
|
||||
LOG_D(PHY,"Frame %d, Subframe %d : ue_uespec_procedures, harq_pid %d => subframe_scheduling %d\n",
|
||||
frame_tx,subframe_tx,harq_pid,
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag);
|
||||
|
||||
if (ue->mac_enabled == 1) {
|
||||
if ((ue->ulsch_Msg3_active[eNB_id] == 1) &&
|
||||
(ue->ulsch_Msg3_frame[eNB_id] == frame_tx) &&
|
||||
(ue->ulsch_Msg3_subframe[eNB_id] == subframe_tx)) { // Initial Transmission of Msg3
|
||||
if ((ue->ulsch_Msg3_active[eNB_id] == 1) &&
|
||||
(ue->ulsch_Msg3_frame[eNB_id] == frame_tx) &&
|
||||
(ue->ulsch_Msg3_subframe[eNB_id] == subframe_tx)) { // Initial Transmission of Msg3
|
||||
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
|
||||
|
||||
if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->round==0)
|
||||
generate_ue_ulsch_params_from_rar(ue,
|
||||
proc,
|
||||
eNB_id);
|
||||
generate_ue_ulsch_params_from_rar(ue,
|
||||
proc,
|
||||
eNB_id);
|
||||
|
||||
ue->ulsch[eNB_id]->power_offset = 14;
|
||||
LOG_D(PHY,"[UE %d][RAPROC] Frame %d: Setting Msg3_flag in subframe %d, for harq_pid %d\n",
|
||||
@@ -1621,7 +1625,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
||||
|
||||
// deactivate service request
|
||||
// ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0;
|
||||
LOG_D(PHY,"Generating PUSCH (Abssubframe: %d.%d): harq-Id: %d, round: %d, MaxReTrans: %d \n",frame_tx,subframe_tx,harq_pid,ue->ulsch[eNB_id]->harq_processes[harq_pid]->round,ue->ulsch[eNB_id]->Mlimit);
|
||||
LOG_I(PHY,"Generating PUSCH (Abssubframe: %d.%d): harq-Id: %d, round: %d, MaxReTrans: %d \n",frame_tx,subframe_tx,harq_pid,ue->ulsch[eNB_id]->harq_processes[harq_pid]->round,ue->ulsch[eNB_id]->Mlimit);
|
||||
if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->round >= (ue->ulsch[eNB_id]->Mlimit - 1))
|
||||
{
|
||||
LOG_D(PHY,"PUSCH MAX Retransmission achieved ==> send last pusch\n");
|
||||
@@ -1697,7 +1701,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
||||
|
||||
|
||||
#ifdef UE_DEBUG_TRACE
|
||||
LOG_I(PHY,
|
||||
LOG_D(PHY,
|
||||
"[UE %d][PUSCH %d] AbsSubframe %d.%d Generating PUSCH : first_rb %d, nb_rb %d, round %d, mcs %d, rv %d, "
|
||||
"cyclic_shift %d (cyclic_shift_common %d,n_DMRS2 %d,n_PRS %d), ACK (%d,%d), O_ACK %d, ack_status_cw0 %d ack_status_cw1 %d bundling %d, Nbundled %d, CQI %d, RI %d\n",
|
||||
Mod_id,harq_pid,frame_tx%1024,subframe_tx,
|
||||
@@ -1756,7 +1760,6 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
||||
stop_meas(&ue->phy_proc_tx);
|
||||
printf("------FULL TX PROC : %5.2f ------\n",ue->phy_proc_tx.p_time/(cpuf*1000.0));
|
||||
#endif
|
||||
return;
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&ue->ulsch_encoding_stats);
|
||||
@@ -1867,7 +1870,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
||||
T_INT(tx_amp),T_INT(ue->ulsch[eNB_id]->f_pusch),T_INT(get_PL(Mod_id,0,eNB_id)),T_INT(nb_rb));
|
||||
|
||||
#ifdef UE_DEBUG_TRACE
|
||||
LOG_I(PHY,"[UE %d][PUSCH %d] AbsSubFrame %d.%d, generating PUSCH, Po_PUSCH: %d dBm (max %d dBm), amp %d\n",
|
||||
LOG_D(PHY,"[UE %d][PUSCH %d] AbsSubFrame %d.%d, generating PUSCH, Po_PUSCH: %d dBm (max %d dBm), amp %d\n",
|
||||
Mod_id,harq_pid,frame_tx%1024,subframe_tx,ue->tx_power_dBm[subframe_tx],ue->tx_power_max_dBm, tx_amp);
|
||||
#endif
|
||||
#if UE_TIMING_TRACE
|
||||
@@ -1892,6 +1895,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&ue->ulsch_modulation_stats);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
if (abstraction_flag==1) {
|
||||
@@ -2228,20 +2232,20 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
|
||||
#ifdef UE_DEBUG_TRACE
|
||||
if(format == pucch_format1)
|
||||
{
|
||||
LOG_I(PHY,"[UE %d][SR %x] AbsSubframe %d.%d Generating PUCCH 1 (SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d\n",
|
||||
Mod_id,
|
||||
ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti,
|
||||
frame_tx%1024, subframe_tx,
|
||||
frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission,
|
||||
isShortenPucch,
|
||||
ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex,
|
||||
Po_PUCCH);
|
||||
{
|
||||
LOG_D(PHY,"[UE %d][SR %x] AbsSubframe %d.%d Generating PUCCH 1 (SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d\n",
|
||||
Mod_id,
|
||||
ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti,
|
||||
frame_tx%1024, subframe_tx,
|
||||
frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission,
|
||||
isShortenPucch,
|
||||
ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex,
|
||||
Po_PUCCH);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SR_payload>0) {
|
||||
LOG_I(PHY,"[UE %d][SR %x] AbsSubFrame %d.%d Generating PUCCH %s payload %d,%d (with SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d, amp %d\n",
|
||||
LOG_D(PHY,"[UE %d][SR %x] AbsSubFrame %d.%d Generating PUCCH %s payload %d,%d (with SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d, amp %d\n",
|
||||
Mod_id,
|
||||
ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti,
|
||||
frame_tx % 1024, subframe_tx,
|
||||
@@ -2254,7 +2258,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
Po_PUCCH,
|
||||
tx_amp);
|
||||
} else {
|
||||
LOG_I(PHY,"[UE %d][PDSCH %x] AbsSubFrame %d.%d rx_offset_diff: %d, Generating PUCCH %s, an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, b[0]=%d,b[1]=%d (SR_Payload %d), Po_PUCCH %d, amp %d\n",
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x] AbsSubFrame %d.%d rx_offset_diff: %d, Generating PUCCH %s, an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, b[0]=%d,b[1]=%d (SR_Payload %d), Po_PUCCH %d, amp %d\n",
|
||||
Mod_id,
|
||||
ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti,
|
||||
frame_tx%1024, subframe_tx,ue->rx_offset_diff,
|
||||
@@ -2321,7 +2325,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
T_INT(tx_amp),T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id)));
|
||||
#endif
|
||||
#ifdef UE_DEBUG_TRACE
|
||||
LOG_I(PHY,"[UE %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2 (RI or CQI), Po_PUCCH %d, isShortenPucch %d, amp %d\n",
|
||||
LOG_D(PHY,"[UE %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2 (RI or CQI), Po_PUCCH %d, isShortenPucch %d, amp %d\n",
|
||||
Mod_id,
|
||||
ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti,
|
||||
frame_tx%1024, subframe_tx,
|
||||
@@ -2411,6 +2415,8 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
|
||||
|
||||
ue_ulsch_uespec_procedures(ue,proc,eNB_id,abstraction_flag);
|
||||
|
||||
LOG_D(PHY,"ULPOWERS After ulsch_uespec_procedures : ue->tx_power_dBm[%d]=%d, NPRB %d\n",
|
||||
subframe_tx,ue->tx_power_dBm[subframe_tx],ue->tx_total_RE[subframe_tx]);
|
||||
}
|
||||
|
||||
if (ue->UE_mode[eNB_id] == PUSCH) {
|
||||
@@ -2934,24 +2940,24 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
|
||||
// we received a CRNTI, so we're in PUSCH
|
||||
if (ue->UE_mode[eNB_id] != PUSCH) {
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_I(PHY,"[UE %d] Frame %d, subframe %d: Received DCI with CRNTI %x => Mode PUSCH\n",ue->Mod_id,frame_rx,subframe_rx,ue->pdcch_vars[subframe_rx&1][eNB_id]->crnti);
|
||||
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: Received DCI with CRNTI %x => Mode PUSCH\n",ue->Mod_id,frame_rx,subframe_rx,ue->pdcch_vars[subframe_rx&1][eNB_id]->crnti);
|
||||
#endif
|
||||
|
||||
//dump_dci(&ue->frame_parms, &dci_alloc_rx[i]);
|
||||
ue->UE_mode[eNB_id] = PUSCH;
|
||||
|
||||
} else {
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Problem in DCI!\n",ue->Mod_id,frame_rx,subframe_rx);
|
||||
dump_dci(&ue->frame_parms, &dci_alloc_rx[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if ((dci_alloc_rx[i].rnti == SI_RNTI) &&
|
||||
((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) {
|
||||
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_I(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i);
|
||||
LOG_D(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i);
|
||||
#endif
|
||||
|
||||
if (generate_ue_dlsch_params_from_dci(frame_rx,
|
||||
@@ -2972,18 +2978,17 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
|
||||
|
||||
ue->dlsch_SI_received[eNB_id]++;
|
||||
|
||||
LOG_I(PHY,"[UE %d] Frame %d, subframe %d : Generate UE DLSCH SI_RNTI format 1%s\n",ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].format==format1A?"A":"C");
|
||||
LOG_D(PHY,"[UE %d] Frame %d, subframe %d : Generate UE DLSCH SI_RNTI format 1%s\n",ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].format==format1A?"A":"C");
|
||||
//dump_dci(&ue->frame_parms, &dci_alloc_rx[i]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if ((dci_alloc_rx[i].rnti == P_RNTI) &&
|
||||
((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) {
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_I(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i);
|
||||
LOG_D(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -3015,7 +3020,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
|
||||
(dci_alloc_rx[i].format == format1A)) {
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_I(PHY,"[UE %d][RAPROC] subframe %d: Found RA rnti %x, format 1A, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,i);
|
||||
LOG_D(PHY,"[UE %d][RAPROC] subframe %d: Found RA rnti %x, format 1A, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,i);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -3081,7 +3086,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
|
||||
T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS));
|
||||
#endif
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"[UE %d] Generate UE ULSCH C_RNTI format 0 (subframe %d)\n",ue->Mod_id,subframe_rx);
|
||||
LOG_D(PHY,"[UE %d] Generate UE ULSCH C_RNTI format 0 (subframe %d)\n",ue->Mod_id,subframe_rx);
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -3124,7 +3129,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
|
||||
|
||||
else {
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_I(PHY,"[UE %d] frame %d, subframe %d: received DCI %d with RNTI=%x (C-RNTI:%x, CBA_RNTI %x) and format %d!\n",ue->Mod_id,frame_rx,subframe_rx,i,dci_alloc_rx[i].rnti,
|
||||
LOG_D(PHY,"[UE %d] frame %d, subframe %d: received DCI %d with RNTI=%x (C-RNTI:%x, CBA_RNTI %x) and format %d!\n",ue->Mod_id,frame_rx,subframe_rx,i,dci_alloc_rx[i].rnti,
|
||||
ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti,
|
||||
ue->ulsch[eNB_id]->cba_rnti[0],
|
||||
dci_alloc_rx[i].format);
|
||||
@@ -3812,7 +3817,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue,
|
||||
if(is_cw1_active)
|
||||
{
|
||||
if (ret1 == (1+dlsch0->max_turbo_iterations)) {
|
||||
LOG_I(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d DLSCH CW1 in error (rv %d,mcs %d,TBS %d)\n",
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d DLSCH CW1 in error (rv %d,mcs %d,TBS %d)\n",
|
||||
ue->Mod_id,dlsch0->rnti,
|
||||
harq_pid,frame_rx,subframe_rx,
|
||||
dlsch0->harq_processes[harq_pid]->rvidx,
|
||||
@@ -3820,7 +3825,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue,
|
||||
dlsch0->harq_processes[harq_pid]->TBS);
|
||||
|
||||
} else {
|
||||
LOG_I(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d: Received DLSCH CW1 (rv %d,mcs %d,TBS %d)\n",
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d: Received DLSCH CW1 (rv %d,mcs %d,TBS %d)\n",
|
||||
ue->Mod_id,dlsch0->rnti,
|
||||
harq_pid,frame_rx,subframe_rx,
|
||||
dlsch0->harq_processes[harq_pid]->rvidx,
|
||||
@@ -4202,7 +4207,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr
|
||||
|
||||
// start timers
|
||||
#ifdef UE_DEBUG_TRACE
|
||||
LOG_I(PHY," ****** start RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx);
|
||||
LOG_D(PHY," ****** start RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx);
|
||||
#endif
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
|
||||
@@ -2592,7 +2592,9 @@ void RCConfig(void) {
|
||||
|
||||
|
||||
/* get global parameters, defined outside any section in the config file */
|
||||
|
||||
|
||||
printf("Getting ENBSParams\n");
|
||||
|
||||
config_get( ENBSParams,sizeof(ENBSParams)/sizeof(paramdef_t),NULL);
|
||||
RC.nb_inst = ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt;
|
||||
|
||||
|
||||
@@ -912,8 +912,8 @@ schedule_ue_spec(module_id_t module_idP,
|
||||
|
||||
if (rlc_status.bytes_in_buffer > 0) { // There is DCCH to transmit
|
||||
LOG_D(MAC,
|
||||
"[eNB %d] Frame %d, DL-DCCH->DLSCH CC_id %d, Requesting %d bytes from RLC (RRC message)\n",
|
||||
module_idP, frameP, CC_id,
|
||||
"[eNB %d] SFN/SF %d.%d, DL-DCCH->DLSCH CC_id %d, Requesting %d bytes from RLC (RRC message)\n",
|
||||
module_idP, frameP, subframeP, CC_id,
|
||||
TBS - header_len_dcch);
|
||||
sdu_lengths[0] = mac_rlc_data_req(module_idP, rnti, module_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_NO, DCCH, TBS, //not used
|
||||
(char *)
|
||||
|
||||
@@ -1181,8 +1181,8 @@ schedule_ulsch_rnti(module_id_t module_idP,
|
||||
AssertFatal(round < 8, "round %d > 7 for UE %d/%x\n", round,
|
||||
UE_id, rnti);
|
||||
LOG_D(MAC,
|
||||
"[eNB %d] frame %d subframe %d,Checking PUSCH %d for UE %d/%x CC %d : aggregation level %d, N_RB_UL %d\n",
|
||||
module_idP, frameP, subframeP, harq_pid, UE_id, rnti,
|
||||
"[eNB %d] frame %d subframe %d (sched_frame %d, sched_subframe %d), Checking PUSCH %d for UE %d/%x CC %d : aggregation level %d, N_RB_UL %d\n",
|
||||
module_idP, frameP, subframeP, sched_frame, sched_subframeP, harq_pid, UE_id, rnti,
|
||||
CC_id, aggregation, N_RB_UL);
|
||||
|
||||
RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP *
|
||||
|
||||
@@ -807,7 +807,10 @@ mac_UE_get_rrc_status(
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
return(UE_rrc_inst[Mod_idP].Info[indexP].State);
|
||||
if (UE_rrc_inst)
|
||||
return(UE_rrc_inst[Mod_idP].Info[indexP].State);
|
||||
else
|
||||
return(-1);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
|
||||
+107
-99
@@ -1691,64 +1691,68 @@ rrc_ue_process_securityModeCommand(
|
||||
#endif //#if defined(ENABLE_SECURITY)
|
||||
|
||||
if (securityModeCommand->criticalExtensions.present == SecurityModeCommand__criticalExtensions_PR_c1) {
|
||||
if (securityModeCommand->criticalExtensions.choice.c1.present == SecurityModeCommand__criticalExtensions__c1_PR_securityModeCommand_r8) {
|
||||
|
||||
ul_dcch_msg.message.choice.c1.choice.securityModeComplete.rrc_TransactionIdentifier = securityModeCommand->rrc_TransactionIdentifier;
|
||||
ul_dcch_msg.message.choice.c1.choice.securityModeComplete.criticalExtensions.present = SecurityModeCommand__criticalExtensions_PR_c1;
|
||||
ul_dcch_msg.message.choice.c1.choice.securityModeComplete.criticalExtensions.choice.securityModeComplete_r8.nonCriticalExtension =NULL;
|
||||
|
||||
LOG_I(RRC,"[UE %d] Frame %d: Receiving from SRB1 (DL-DCCH), encoding securityModeComplete (eNB %d)\n",
|
||||
ctxt_pP->module_id,ctxt_pP->frame,eNB_index);
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message,
|
||||
(void*)&ul_dcch_msg,
|
||||
buffer,
|
||||
100);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
|
||||
if (securityModeCommand->criticalExtensions.choice.c1.present != SecurityModeCommand__criticalExtensions__c1_PR_securityModeCommand_r8)
|
||||
LOG_W(RRC,"securityModeCommand->criticalExtensions.choice.c1.present (%d) != SecurityModeCommand__criticalExtensions__c1_PR_securityModeCommand_r8\n",
|
||||
securityModeCommand->criticalExtensions.choice.c1.present);
|
||||
|
||||
|
||||
ul_dcch_msg.message.choice.c1.choice.securityModeComplete.rrc_TransactionIdentifier = securityModeCommand->rrc_TransactionIdentifier;
|
||||
ul_dcch_msg.message.choice.c1.choice.securityModeComplete.criticalExtensions.present = SecurityModeCommand__criticalExtensions_PR_c1;
|
||||
ul_dcch_msg.message.choice.c1.choice.securityModeComplete.criticalExtensions.choice.securityModeComplete_r8.nonCriticalExtension =NULL;
|
||||
|
||||
LOG_I(RRC,"[UE %d] Frame %d: Receiving from SRB1 (DL-DCCH), encoding securityModeComplete (eNB %d)\n",
|
||||
ctxt_pP->module_id,ctxt_pP->frame,eNB_index);
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message,
|
||||
(void*)&ul_dcch_msg,
|
||||
buffer,
|
||||
100);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
|
||||
#ifdef XER_PRINT
|
||||
xer_fprint(stdout, &asn_DEF_UL_DCCH_Message, (void*)&ul_dcch_msg);
|
||||
xer_fprint(stdout, &asn_DEF_UL_DCCH_Message, (void*)&ul_dcch_msg);
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
# if !defined(DISABLE_XER_SPRINT)
|
||||
{
|
||||
char message_string[20000];
|
||||
size_t message_string_size;
|
||||
|
||||
if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_UL_DCCH_Message, (void *) &ul_dcch_msg)) > 0) {
|
||||
MessageDef *msg_p;
|
||||
|
||||
msg_p = itti_alloc_new_message_sized (TASK_RRC_UE, RRC_UL_DCCH, message_string_size + sizeof (IttiMsgText));
|
||||
msg_p->ittiMsg.rrc_ul_dcch.size = message_string_size;
|
||||
memcpy(&msg_p->ittiMsg.rrc_ul_dcch.text, message_string, message_string_size);
|
||||
|
||||
itti_send_msg_to_task(TASK_UNKNOWN, ctxt_pP->instance, msg_p);
|
||||
}
|
||||
{
|
||||
char message_string[20000];
|
||||
size_t message_string_size;
|
||||
|
||||
if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_UL_DCCH_Message, (void *) &ul_dcch_msg)) > 0) {
|
||||
MessageDef *msg_p;
|
||||
|
||||
msg_p = itti_alloc_new_message_sized (TASK_RRC_UE, RRC_UL_DCCH, message_string_size + sizeof (IttiMsgText));
|
||||
msg_p->ittiMsg.rrc_ul_dcch.size = message_string_size;
|
||||
memcpy(&msg_p->ittiMsg.rrc_ul_dcch.text, message_string, message_string_size);
|
||||
|
||||
itti_send_msg_to_task(TASK_UNKNOWN, ctxt_pP->instance, msg_p);
|
||||
}
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef USER_MODE
|
||||
LOG_D(RRC, "securityModeComplete Encoded %zd bits (%zd bytes)\n", enc_rval.encoded, (enc_rval.encoded+7)/8);
|
||||
LOG_D(RRC, "securityModeComplete Encoded %zd bits (%zd bytes)\n", enc_rval.encoded, (enc_rval.encoded+7)/8);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < (enc_rval.encoded + 7) / 8; i++) {
|
||||
LOG_T(RRC, "%02x.", buffer[i]);
|
||||
}
|
||||
|
||||
LOG_T(RRC, "\n");
|
||||
rrc_data_req (
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
rrc_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
(enc_rval.encoded + 7) / 8,
|
||||
buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
|
||||
for (i = 0; i < (enc_rval.encoded + 7) / 8; i++) {
|
||||
LOG_T(RRC, "%02x.", buffer[i]);
|
||||
}
|
||||
|
||||
LOG_T(RRC, "\n");
|
||||
rrc_data_req (
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
rrc_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
(enc_rval.encoded + 7) / 8,
|
||||
buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
}
|
||||
else LOG_W(RRC,"securityModeCommand->criticalExtensions.present (%d) != SecurityModeCommand__criticalExtensions_PR_c1\n",
|
||||
securityModeCommand->criticalExtensions.present);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -1792,68 +1796,72 @@ rrc_ue_process_ueCapabilityEnquiry(
|
||||
// ue_CapabilityRAT_Container.ueCapabilityRAT_Container.size = UE_rrc_inst[ue_mod_idP].UECapability_size;
|
||||
|
||||
|
||||
if (UECapabilityEnquiry->criticalExtensions.present == UECapabilityEnquiry__criticalExtensions_PR_c1) {
|
||||
if (UECapabilityEnquiry->criticalExtensions.choice.c1.present == UECapabilityEnquiry__criticalExtensions__c1_PR_ueCapabilityEnquiry_r8) {
|
||||
ul_dcch_msg.message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.present = UECapabilityInformation__criticalExtensions_PR_c1;
|
||||
ul_dcch_msg.message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.present =
|
||||
UECapabilityInformation__criticalExtensions__c1_PR_ueCapabilityInformation_r8;
|
||||
ul_dcch_msg.message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list.count
|
||||
=0;
|
||||
|
||||
for (i=0; i<UECapabilityEnquiry->criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list.count; i++) {
|
||||
|
||||
if (*UECapabilityEnquiry->criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list.array[i]
|
||||
== RAT_Type_eutra) {
|
||||
ASN_SEQUENCE_ADD(
|
||||
&ul_dcch_msg.message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list,
|
||||
&ue_CapabilityRAT_Container);
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, (void*) &ul_dcch_msg, buffer, 100);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
AssertFatal(UECapabilityEnquiry->criticalExtensions.present == UECapabilityEnquiry__criticalExtensions_PR_c1,
|
||||
"UECapabilityEnquiry->criticalExtensions.present (%d) != UECapabilityEnquiry__criticalExtensions_PR_c1 (%d)\n",
|
||||
UECapabilityEnquiry->criticalExtensions.present,UECapabilityEnquiry__criticalExtensions_PR_c1);
|
||||
|
||||
if (UECapabilityEnquiry->criticalExtensions.choice.c1.present != UECapabilityEnquiry__criticalExtensions__c1_PR_ueCapabilityEnquiry_r8)
|
||||
LOG_W(RRC,"UECapabilityEnquiry->criticalExtensions.choice.c1.present (%d) != UECapabilityEnquiry__criticalExtensions__c1_PR_ueCapabilityEnquiry_r8)\n",
|
||||
UECapabilityEnquiry->criticalExtensions.choice.c1.present);
|
||||
|
||||
ul_dcch_msg.message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.present = UECapabilityInformation__criticalExtensions_PR_c1;
|
||||
ul_dcch_msg.message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.present =
|
||||
UECapabilityInformation__criticalExtensions__c1_PR_ueCapabilityInformation_r8;
|
||||
ul_dcch_msg.message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list.count
|
||||
=0;
|
||||
|
||||
for (i=0; i<UECapabilityEnquiry->criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list.count; i++) {
|
||||
|
||||
if (*UECapabilityEnquiry->criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list.array[i]
|
||||
== RAT_Type_eutra) {
|
||||
ASN_SEQUENCE_ADD(
|
||||
&ul_dcch_msg.message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list,
|
||||
&ue_CapabilityRAT_Container);
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, (void*) &ul_dcch_msg, buffer, 100);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
|
||||
#ifdef XER_PRINT
|
||||
xer_fprint(stdout, &asn_DEF_UL_DCCH_Message, (void*)&ul_dcch_msg);
|
||||
xer_fprint(stdout, &asn_DEF_UL_DCCH_Message, (void*)&ul_dcch_msg);
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
# if !defined(DISABLE_XER_SPRINT)
|
||||
{
|
||||
char message_string[20000];
|
||||
size_t message_string_size;
|
||||
|
||||
if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_UL_DCCH_Message, (void *) &ul_dcch_msg)) > 0) {
|
||||
MessageDef *msg_p;
|
||||
|
||||
msg_p = itti_alloc_new_message_sized (TASK_RRC_UE, RRC_UL_DCCH, message_string_size + sizeof (IttiMsgText));
|
||||
msg_p->ittiMsg.rrc_ul_dcch.size = message_string_size;
|
||||
memcpy(&msg_p->ittiMsg.rrc_ul_dcch.text, message_string, message_string_size);
|
||||
|
||||
itti_send_msg_to_task(TASK_UNKNOWN, ctxt_pP->instance, msg_p);
|
||||
}
|
||||
}
|
||||
{
|
||||
char message_string[20000];
|
||||
size_t message_string_size;
|
||||
|
||||
if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_UL_DCCH_Message, (void *) &ul_dcch_msg)) > 0) {
|
||||
MessageDef *msg_p;
|
||||
|
||||
msg_p = itti_alloc_new_message_sized (TASK_RRC_UE, RRC_UL_DCCH, message_string_size + sizeof (IttiMsgText));
|
||||
msg_p->ittiMsg.rrc_ul_dcch.size = message_string_size;
|
||||
memcpy(&msg_p->ittiMsg.rrc_ul_dcch.text, message_string, message_string_size);
|
||||
|
||||
itti_send_msg_to_task(TASK_UNKNOWN, ctxt_pP->instance, msg_p);
|
||||
}
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef USER_MODE
|
||||
LOG_D(RRC,"UECapabilityInformation Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
|
||||
#endif
|
||||
LOG_I(RRC,"UECapabilityInformation Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
|
||||
|
||||
for (i = 0; i < (enc_rval.encoded + 7) / 8; i++) {
|
||||
LOG_T(RRC, "%02x.", buffer[i]);
|
||||
}
|
||||
|
||||
LOG_T(RRC, "\n");
|
||||
rrc_data_req (
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
rrc_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
(enc_rval.encoded + 7) / 8,
|
||||
buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
}
|
||||
|
||||
for (i = 0; i < (enc_rval.encoded + 7) / 8; i++) {
|
||||
LOG_T(RRC, "%02x.", buffer[i]);
|
||||
}
|
||||
|
||||
LOG_T(RRC, "\n");
|
||||
rrc_data_req (
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
rrc_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
(enc_rval.encoded + 7) / 8,
|
||||
buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -627,12 +627,12 @@ void rrc_eNB_emulation_notify_ue_module_id(
|
||||
return;
|
||||
}
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
if (RC.rrc[enb_module_id].carrier[CC_id].sib1 != NULL) {
|
||||
if (&RC.rrc[enb_module_id]->carrier[CC_id].sib1 != NULL) {
|
||||
if (
|
||||
(RC.rrc[enb_module_id].carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[0] == cell_identity_byte0P) &&
|
||||
(RC.rrc[enb_module_id].carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[1] == cell_identity_byte1P) &&
|
||||
(RC.rrc[enb_module_id].carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[2] == cell_identity_byte2P) &&
|
||||
(RC.rrc[enb_module_id].carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[3] == cell_identity_byte3P)
|
||||
(&RC.rrc[enb_module_id]->carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[0] == cell_identity_byte0P) &&
|
||||
(&RC.rrc[enb_module_id]->carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[1] == cell_identity_byte1P) &&
|
||||
(&RC.rrc[enb_module_id]->carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[2] == cell_identity_byte2P) &&
|
||||
(&RC.rrc[enb_module_id]->carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[3] == cell_identity_byte3P)
|
||||
) {
|
||||
ue_context_p = rrc_eNB_get_ue_context(
|
||||
RC.rrc[enb_module_id],
|
||||
|
||||
@@ -314,8 +314,8 @@ void *log_thread_function(void * list);
|
||||
/* optname helpstr 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, sizeof(gloglevel)}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_VERBOSITY,NULL, 0, strptr:(char **)&glogverbo, defstrval:log_verbosity_names[2].name, TYPE_STRING, sizeof(glogverbo)}, \
|
||||
{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, }, \
|
||||
}
|
||||
|
||||
@@ -197,13 +197,13 @@ RUs = (
|
||||
);
|
||||
|
||||
log_config = {
|
||||
global_log_level ="debug";
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
hw_log_level ="info";
|
||||
hw_log_verbosity ="medium";
|
||||
phy_log_level ="debug";
|
||||
phy_log_level ="info";
|
||||
phy_log_verbosity ="medium";
|
||||
mac_log_level ="debug";
|
||||
mac_log_level ="info";
|
||||
mac_log_verbosity ="high";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
|
||||
@@ -17,3 +17,20 @@ RUs = (
|
||||
}
|
||||
);
|
||||
|
||||
log_config = {
|
||||
global_log_level ="debug";
|
||||
global_log_verbosity ="medium";
|
||||
hw_log_level ="info";
|
||||
hw_log_verbosity ="medium";
|
||||
phy_log_level ="debug";
|
||||
phy_log_verbosity ="medium";
|
||||
mac_log_level ="debug";
|
||||
mac_log_verbosity ="high";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
|
||||
|
||||
@@ -227,6 +227,9 @@ threads_t threads= {-1,-1,-1,-1,-1,-1,-1};
|
||||
*/
|
||||
uint8_t abstraction_flag=0;
|
||||
|
||||
/* forward declarations */
|
||||
void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
|
||||
|
||||
/*---------------------BMC: timespec helpers -----------------------------*/
|
||||
|
||||
struct timespec min_diff_time = { .tv_sec = 0, .tv_nsec = 0 };
|
||||
@@ -593,10 +596,11 @@ static void get_options(void) {
|
||||
|
||||
|
||||
if (UE_flag > 0) {
|
||||
uint8_t n_rb_dl;
|
||||
paramdef_t cmdline_uemodeparams[] =CMDLINE_UEMODEPARAMS_DESC;
|
||||
paramdef_t cmdline_ueparams[] =CMDLINE_UEPARAMS_DESC;
|
||||
|
||||
|
||||
set_default_frame_parms(frame_parms);
|
||||
|
||||
config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL);
|
||||
config_process_cmdline( cmdline_ueparams,sizeof(cmdline_ueparams)/sizeof(paramdef_t),NULL);
|
||||
@@ -606,22 +610,21 @@ static void get_options(void) {
|
||||
input_fd = fopen(loopfile,"r");
|
||||
AssertFatal(input_fd != NULL,"Please provide a valid input file\n");
|
||||
}
|
||||
|
||||
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERX_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue;
|
||||
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXMED_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_med;
|
||||
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXBYP_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_byp;
|
||||
if ( *(cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].uptr) > 0) mode = debug_prach;
|
||||
if ( *(cmdline_uemodeparams[CMDLINE_NOL2CONNECT_IDX].uptr) > 0) mode = no_L2_connect;
|
||||
if ( *(cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].uptr) > 0) mode = calib_prach_tx;
|
||||
if ( (cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = debug_prach;
|
||||
if ( (cmdline_uemodeparams[CMDLINE_NOL2CONNECT_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = no_L2_connect;
|
||||
if ( (cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = calib_prach_tx;
|
||||
if (dumpframe > 0) mode = rx_dump_frame;
|
||||
|
||||
if ( downlink_frequency[0][0] > 0) {
|
||||
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
downlink_frequency[CC_id][1] = downlink_frequency[0][0];
|
||||
downlink_frequency[CC_id][2] = downlink_frequency[0][0];
|
||||
downlink_frequency[CC_id][3] = downlink_frequency[0][0];
|
||||
printf("Downlink for CC_id %d frequency set to %u\n", CC_id, downlink_frequency[CC_id][0]);
|
||||
}
|
||||
UE_scan=0;
|
||||
printf("Downlink frequency set to %u\n", downlink_frequency[0][0]);
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
|
||||
}
|
||||
UE_scan=0;
|
||||
}
|
||||
|
||||
if (tddflag > 0) {
|
||||
@@ -629,38 +632,38 @@ static void get_options(void) {
|
||||
frame_parms[CC_id]->frame_type = TDD;
|
||||
}
|
||||
|
||||
if (frame_parms[0]->N_RB_DL !=0) {
|
||||
if ( frame_parms[0]->N_RB_DL < 6 ) {
|
||||
frame_parms[0]->N_RB_DL = 6;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 6\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
if ( frame_parms[0]->N_RB_DL > 100 ) {
|
||||
frame_parms[0]->N_RB_DL = 100;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 100\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
if ( frame_parms[0]->N_RB_DL > 50 && frame_parms[0]->N_RB_DL < 100 ) {
|
||||
frame_parms[0]->N_RB_DL = 50;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 50\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
if ( frame_parms[0]->N_RB_DL > 25 && frame_parms[0]->N_RB_DL < 50 ) {
|
||||
frame_parms[0]->N_RB_DL = 25;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 25\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
UE_scan = 0;
|
||||
frame_parms[0]->N_RB_UL=frame_parms[0]->N_RB_DL;
|
||||
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
frame_parms[CC_id]->N_RB_DL=frame_parms[0]->N_RB_DL;
|
||||
frame_parms[CC_id]->N_RB_UL=frame_parms[0]->N_RB_UL;
|
||||
}
|
||||
if (n_rb_dl !=0) {
|
||||
printf("NB_RB set to %d\n",n_rb_dl);
|
||||
if ( n_rb_dl < 6 ) {
|
||||
n_rb_dl = 6;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 6\n",n_rb_dl);
|
||||
}
|
||||
if ( n_rb_dl > 100 ) {
|
||||
n_rb_dl = 100;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 100\n",n_rb_dl);
|
||||
}
|
||||
if ( n_rb_dl > 50 && n_rb_dl < 100 ) {
|
||||
n_rb_dl = 50;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 50\n",n_rb_dl);
|
||||
}
|
||||
if ( n_rb_dl > 25 && n_rb_dl < 50 ) {
|
||||
n_rb_dl = 25;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 25\n",n_rb_dl);
|
||||
}
|
||||
UE_scan = 0;
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
frame_parms[CC_id]->N_RB_DL=n_rb_dl;
|
||||
frame_parms[CC_id]->N_RB_UL=n_rb_dl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (CC_id=1;CC_id<MAX_NUM_CCs;CC_id++) {
|
||||
tx_max_power[CC_id]=tx_max_power[0];
|
||||
rx_gain[0][CC_id] = rx_gain[0][0];
|
||||
tx_gain[0][CC_id] = tx_gain[0][0];
|
||||
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
|
||||
tx_max_power[CC_id]=tx_max_power[0];
|
||||
rx_gain[0][CC_id] = rx_gain[0][0];
|
||||
tx_gain[0][CC_id] = tx_gain[0][0];
|
||||
}
|
||||
} /* UE_flag > 0 */
|
||||
|
||||
#if T_TRACER
|
||||
paramdef_t cmdline_ttraceparams[] =CMDLINE_TTRACEPARAMS_DESC ;
|
||||
config_process_cmdline( cmdline_ttraceparams,sizeof(cmdline_ttraceparams)/sizeof(paramdef_t),NULL);
|
||||
@@ -675,10 +678,11 @@ static void get_options(void) {
|
||||
NB_RU = RC.nb_RU;
|
||||
printf("Configuration: nb_rrc_inst %d, nb_L1_inst %d, nb_ru %d\n",NB_eNB_INST,RC.nb_L1_inst,NB_RU);
|
||||
}
|
||||
} else if (UE_flag == 1 && (CONFIG_GETCONFFILE != NULL)) {
|
||||
} else if (UE_flag == 1 && (!(CONFIG_ISFLAGSET(CONFIG_NOOOPT))) ) {
|
||||
// Here the configuration file is the XER encoded UE capabilities
|
||||
// Read it in and store in asn1c data structures
|
||||
strcpy(uecap_xer,CONFIG_GETCONFFILE);
|
||||
sprintf(uecap_xer,"%stargets/PROJECTS/GENERIC-LTE-EPC/CONF/UE_config.xml",getenv("OPENAIR_HOME"));
|
||||
printf("%s\n",uecap_xer);
|
||||
uecap_xer_in=1;
|
||||
} /* UE with config file */
|
||||
}
|
||||
@@ -691,7 +695,7 @@ int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */
|
||||
#endif
|
||||
|
||||
|
||||
void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
|
||||
|
||||
void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
|
||||
|
||||
int CC_id;
|
||||
@@ -728,11 +732,12 @@ void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
|
||||
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.highSpeedFlag=0;
|
||||
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;
|
||||
|
||||
downlink_frequency[CC_id][0] = 2680000000; // Use float to avoid issue with frequency over 2^31.
|
||||
downlink_frequency[CC_id][1] = downlink_frequency[CC_id][0];
|
||||
downlink_frequency[CC_id][2] = downlink_frequency[CC_id][0];
|
||||
downlink_frequency[CC_id][3] = downlink_frequency[CC_id][0];
|
||||
// downlink_frequency[CC_id][0] = 2680000000; // Use float to avoid issue with frequency over 2^31.
|
||||
// downlink_frequency[CC_id][1] = downlink_frequency[CC_id][0];
|
||||
// downlink_frequency[CC_id][2] = downlink_frequency[CC_id][0];
|
||||
// downlink_frequency[CC_id][3] = downlink_frequency[CC_id][0];
|
||||
//printf("Downlink for CC_id %d frequency set to %u\n", CC_id, downlink_frequency[CC_id][0]);
|
||||
frame_parms[CC_id]->dl_CarrierFreq=downlink_frequency[CC_id][0];
|
||||
|
||||
}
|
||||
|
||||
@@ -905,14 +910,14 @@ int main( int argc, char **argv )
|
||||
|
||||
|
||||
// set default parameters
|
||||
if (UE_flag == 1) set_default_frame_parms(frame_parms);
|
||||
//if (UE_flag == 1) set_default_frame_parms(frame_parms);
|
||||
|
||||
logInit();
|
||||
|
||||
printf("Reading in command-line options\n");
|
||||
|
||||
get_options ();
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT) && UE_flag == 0) {
|
||||
fprintf(stderr,"Getting configuration failed\n");
|
||||
exit(-1);
|
||||
}
|
||||
@@ -931,7 +936,7 @@ int main( int argc, char **argv )
|
||||
printf("configuring for UE\n");
|
||||
|
||||
set_comp_log(HW, LOG_DEBUG, LOG_HIGH, 1);
|
||||
set_comp_log(PHY, LOG_DEBUG, LOG_HIGH, 1);
|
||||
set_comp_log(PHY, LOG_INFO, LOG_HIGH, 1);
|
||||
set_comp_log(MAC, LOG_INFO, LOG_HIGH, 1);
|
||||
set_comp_log(RLC, LOG_INFO, LOG_HIGH | FLAG_THREAD, 1);
|
||||
set_comp_log(PDCP, LOG_INFO, LOG_HIGH, 1);
|
||||
@@ -1080,8 +1085,9 @@ int main( int argc, char **argv )
|
||||
else if (frame_parms[CC_id]->N_RB_DL == 25)
|
||||
UE[CC_id]->N_TA_offset = 624/4;
|
||||
}
|
||||
|
||||
init_openair0();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fill_modeled_runtime_table(runtime_phy_rx,runtime_phy_tx);
|
||||
@@ -1130,8 +1136,6 @@ int main( int argc, char **argv )
|
||||
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
|
||||
if ((UE_flag == 1)||
|
||||
(RC.nb_inst > 0)) {
|
||||
|
||||
@@ -1149,16 +1153,6 @@ int main( int argc, char **argv )
|
||||
}
|
||||
#endif
|
||||
|
||||
if (phy_test==0) {
|
||||
if (UE_flag==1) {
|
||||
printf("Filling UE band info\n");
|
||||
fill_ue_band_info();
|
||||
dl_phy_sync_success (0, 0, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
|
||||
@@ -1225,14 +1219,18 @@ int main( int argc, char **argv )
|
||||
rt_sleep_ns(10*100000000ULL);
|
||||
|
||||
|
||||
|
||||
|
||||
// start the main threads
|
||||
if (UE_flag == 1) {
|
||||
int eMBMS_active = 0;
|
||||
init_UE(1,eMBMS_active,uecap_xer_in);
|
||||
init_UE(1,eMBMS_active,uecap_xer_in,0);
|
||||
|
||||
if (phy_test==0) {
|
||||
printf("Filling UE band info\n");
|
||||
fill_ue_band_info();
|
||||
dl_phy_sync_success (0, 0, 0, 1);
|
||||
}
|
||||
|
||||
number_of_cards = 1;
|
||||
|
||||
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.card=0;
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.chain=CC_id+chain_offset;
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
#define CONFIG_HLP_NOSNGLT "Disables single-thread mode in lte-softmodem\n"
|
||||
#define CONFIG_HLP_TADV "Set timing_advance\n"
|
||||
#define CONFIG_HLP_DLF "Set the downlink frequency for all component carriers\n"
|
||||
#define CONFIG_HLP_CHOFF "Channel id offset"
|
||||
#define CONFIG_HLP_CHOFF "Channel id offset\n"
|
||||
#define CONFIG_HLP_SOFTS "Enable soft scope and L1 and L2 stats (Xforms)\n"
|
||||
#define CONFIG_HLP_EXMCAL "Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n"
|
||||
#define CONFIG_HLP_ITTIL "Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n"
|
||||
@@ -127,7 +127,7 @@
|
||||
{"ue-nb-ant-tx", CONFIG_HLP_UENANTT, 0, u8ptr:&nb_antenna_tx, defuintval:1, TYPE_UINT8, 0}, \
|
||||
{"ue-scan-carrier", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&UE_scan_carrier, defintval:0, TYPE_INT, 0}, \
|
||||
{"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \
|
||||
{"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:0, TYPE_UINT8, 0}, \
|
||||
{"r" , CONFIG_HLP_PRB, 0, u8ptr:&n_rb_dl, defintval:0, TYPE_UINT8, 0}, \
|
||||
}
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ extern void init_RU(const char*);
|
||||
extern int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
|
||||
extern void fill_ue_band_info(void);
|
||||
|
||||
extern void init_UE(int,int,int);
|
||||
extern void init_UE(int,int,int,int);
|
||||
extern void init_thread(int sched_runtime, int sched_deadline, int sched_fifo, cpu_set_t *cpuset, char * name);
|
||||
|
||||
extern void reset_opp_meas(void);
|
||||
|
||||
@@ -70,7 +70,7 @@ typedef enum {
|
||||
|
||||
void init_UE_threads(int);
|
||||
void *UE_thread(void *arg);
|
||||
void init_UE(int nb_inst,int,int);
|
||||
void init_UE(int nb_inst,int,int,int);
|
||||
|
||||
int32_t **rxdata;
|
||||
int32_t **txdata;
|
||||
@@ -202,7 +202,7 @@ void init_thread(int sched_runtime, int sched_deadline, int sched_fifo, cpu_set_
|
||||
|
||||
}
|
||||
|
||||
void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in) {
|
||||
void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correction) {
|
||||
|
||||
PHY_VARS_UE *UE;
|
||||
int inst;
|
||||
@@ -218,6 +218,8 @@ void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in) {
|
||||
|
||||
LOG_I(PHY,"Initializing memory for UE instance %d (%p)\n",inst,PHY_vars_UE_g[inst]);
|
||||
PHY_vars_UE_g[inst][0] = init_ue_vars(NULL,inst,0);
|
||||
// turn off timing control loop in UE
|
||||
PHY_vars_UE_g[inst][0]->no_timing_correction = timing_correction;
|
||||
|
||||
LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]);
|
||||
init_UE_threads(inst);
|
||||
@@ -303,6 +305,7 @@ static void *UE_thread_synch(void *arg)
|
||||
} while (ind < sizeof(eutra_bands) / sizeof(eutra_bands[0]));
|
||||
|
||||
if (found == 0) {
|
||||
LOG_E(PHY,"Can't find EUTRA band for frequency %d",UE->frame_parms.dl_CarrierFreq);
|
||||
exit_fun("Can't find EUTRA band for frequency");
|
||||
return &UE_thread_synch_retval;
|
||||
}
|
||||
@@ -851,14 +854,19 @@ void *UE_thread(void *arg) {
|
||||
writeBlockSize=UE->frame_parms.samples_per_tti;
|
||||
} else {
|
||||
// set TO compensation to zero
|
||||
|
||||
UE->rx_offset_diff = 0;
|
||||
|
||||
// compute TO compensation that should be applied for this frame
|
||||
if ( UE->rx_offset < 5*UE->frame_parms.samples_per_tti &&
|
||||
UE->rx_offset > 0 )
|
||||
|
||||
if (UE->no_timing_correction == 0) {
|
||||
if ( UE->rx_offset < 5*UE->frame_parms.samples_per_tti &&
|
||||
UE->rx_offset > 0 )
|
||||
UE->rx_offset_diff = -1 ;
|
||||
if ( UE->rx_offset > 5*UE->frame_parms.samples_per_tti &&
|
||||
UE->rx_offset < 10*UE->frame_parms.samples_per_tti )
|
||||
if ( UE->rx_offset > 5*UE->frame_parms.samples_per_tti &&
|
||||
UE->rx_offset < 10*UE->frame_parms.samples_per_tti )
|
||||
UE->rx_offset_diff = 1;
|
||||
}
|
||||
|
||||
LOG_D(PHY,"AbsSubframe %d.%d SET rx_off_diff to %d rx_offset %d \n",proc->frame_rx,sub_frame,UE->rx_offset_diff,UE->rx_offset);
|
||||
readBlockSize=UE->frame_parms.samples_per_tti -
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
#include "oaisim.h"
|
||||
|
||||
#define RF
|
||||
#define DEBUG_SIM
|
||||
//#define DEBUG_SIM
|
||||
|
||||
int number_rb_ul;
|
||||
int first_rbUL ;
|
||||
@@ -83,8 +83,8 @@ void do_DL_sig(channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM
|
||||
node_desc_t *enb_data[NUMBER_OF_RU_MAX],
|
||||
node_desc_t *ue_data[NUMBER_OF_UE_MAX],
|
||||
uint16_t subframe,
|
||||
uint16_t offset,
|
||||
uint16_t length,
|
||||
uint32_t offset,
|
||||
uint32_t length,
|
||||
uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *ue_frame_parms,
|
||||
uint8_t UE_id,
|
||||
int CC_id)
|
||||
@@ -244,22 +244,54 @@ void do_DL_sig(channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM
|
||||
frame_parms = &RC.ru[ru_id]->frame_parms;
|
||||
|
||||
sf_offset = (subframe*frame_parms->samples_per_tti) + offset;
|
||||
LOG_D(EMU,"TXPATH: RU %d : DL_sig reading TX for subframe %d (sf_offset %d, length %d) from %p\n",ru_id,subframe,sf_offset,length,txdata[0]+sf_offset);
|
||||
LOG_D(EMU,">>>>>>>>>>>>>>>>>TXPATH: RU %d : DL_sig reading TX for subframe %d (sf_offset %d, length %d) from %p\n",ru_id,subframe,sf_offset,length,txdata[0]+sf_offset);
|
||||
int length_meas = frame_parms->ofdm_symbol_size;
|
||||
tx_pwr = dac_fixed_gain(s_re,
|
||||
s_im,
|
||||
txdata,
|
||||
sf_offset,
|
||||
nb_antennas_tx,
|
||||
length,
|
||||
sf_offset,
|
||||
length_meas,
|
||||
14,
|
||||
frame_parms->pdsch_config_common.referenceSignalPower, // dBm/RE
|
||||
0,
|
||||
&ru_amp[ru_id],
|
||||
frame_parms->N_RB_DL*12);
|
||||
if (sf_offset+length <= frame_parms->samples_per_tti*10) {
|
||||
|
||||
tx_pwr = dac_fixed_gain(s_re,
|
||||
s_im,
|
||||
txdata,
|
||||
sf_offset,
|
||||
nb_antennas_tx,
|
||||
length,
|
||||
sf_offset,
|
||||
length_meas,
|
||||
14,
|
||||
frame_parms->pdsch_config_common.referenceSignalPower, // dBm/RE
|
||||
0,
|
||||
&ru_amp[ru_id],
|
||||
frame_parms->N_RB_DL*12);
|
||||
|
||||
}
|
||||
else {
|
||||
tx_pwr = dac_fixed_gain(s_re,
|
||||
s_im,
|
||||
txdata,
|
||||
sf_offset,
|
||||
nb_antennas_tx,
|
||||
(frame_parms->samples_per_tti*10)-sf_offset,
|
||||
sf_offset,
|
||||
length_meas,
|
||||
14,
|
||||
frame_parms->pdsch_config_common.referenceSignalPower, // dBm/RE
|
||||
0,
|
||||
&ru_amp[ru_id],
|
||||
frame_parms->N_RB_DL*12);
|
||||
|
||||
tx_pwr = dac_fixed_gain(s_re,
|
||||
s_im,
|
||||
txdata,
|
||||
sf_offset,
|
||||
nb_antennas_tx,
|
||||
length+sf_offset-(frame_parms->samples_per_tti*10),
|
||||
sf_offset,
|
||||
length_meas,
|
||||
14,
|
||||
frame_parms->pdsch_config_common.referenceSignalPower, // dBm/RE
|
||||
0,
|
||||
&ru_amp[ru_id],
|
||||
frame_parms->N_RB_DL*12);
|
||||
}
|
||||
#ifdef DEBUG_SIM
|
||||
LOG_D(PHY,"[SIM][DL] subframe %d: txp (time) %d dB\n",
|
||||
subframe,dB_fixed(signal_energy(&txdata[0][sf_offset],length_meas)));
|
||||
@@ -503,7 +535,7 @@ void do_UL_sig(channel_desc_t *UE2RU[NUMBER_OF_UE_MAX][NUMBER_OF_RU_MAX][MAX_NUM
|
||||
if (((double)PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm[subframe] +
|
||||
UE2RU[UE_id][ru_id][CC_id]->path_loss_dB) <= -125.0) {
|
||||
// don't simulate a UE that is too weak
|
||||
LOG_D(OCM,"[SIM][UL] UE %d tx_pwr %d dBm (num_RE %d) for subframe %d (sf_offset %d)\n",
|
||||
LOG_D(OCM,"[SIM][UL] ULPOWERS UE %d tx_pwr %d dBm (num_RE %d) for subframe %d (sf_offset %d)\n",
|
||||
UE_id,
|
||||
PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm[subframe],
|
||||
PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe],
|
||||
@@ -522,7 +554,7 @@ void do_UL_sig(channel_desc_t *UE2RU[NUMBER_OF_UE_MAX][NUMBER_OF_RU_MAX][MAX_NUM
|
||||
1,
|
||||
NULL,
|
||||
PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe]); // This make the previous argument the total power
|
||||
LOG_D(OCM,"[SIM][UL] UE %d tx_pwr %f dBm (target %d dBm, num_RE %d) for subframe %d (sf_offset %d)\n",
|
||||
LOG_D(OCM,"[SIM][UL] ULPOWERS UE %d tx_pwr %f dBm (target %d dBm, num_RE %d) for subframe %d (sf_offset %d)\n",
|
||||
UE_id,
|
||||
10*log10(tx_pwr*PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe]),
|
||||
PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm[subframe],
|
||||
@@ -582,11 +614,11 @@ void do_UL_sig(channel_desc_t *UE2RU[NUMBER_OF_UE_MAX][NUMBER_OF_RU_MAX][MAX_NUM
|
||||
1e3/UE2RU[0][ru_id][CC_id]->sampling_rate, // sampling time (ns)
|
||||
(double)RC.ru[ru_id]->max_rxgain-(double)RC.ru[ru_id]->att_rx - 66.227); // rx_gain (dB) (66.227 = 20*log10(pow2(11)) = gain from the adc that will be applied later)
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
//#ifdef DEBUG_SIM
|
||||
rx_pwr = signal_energy_fp(r_re_p,r_im_p,nb_antennas_rx,frame_parms->samples_per_tti,0);//*(double)frame_parms->ofdm_symbol_size/(12.0*frame_parms->N_RB_DL;
|
||||
LOG_D(OCM,"[SIM][UL] rx_pwr (ADC in) %f dB for subframe %d (rx_gain %f)\n",10*log10(rx_pwr),subframe,
|
||||
(double)RC.ru[ru_id]->max_rxgain-(double)RC.ru[ru_id]->att_rx);
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
rxdata = RC.ru[ru_id]->common.rxdata;
|
||||
sf_offset = subframe*frame_parms->samples_per_tti;
|
||||
|
||||
@@ -524,11 +524,6 @@ l2l1_task (void *args_p)
|
||||
}
|
||||
|
||||
}
|
||||
// UL scope at eNB 0
|
||||
form_enb[UE_inst] = create_lte_phy_scope_enb();
|
||||
sprintf (title, "LTE UL SCOPE UE %d to eNB %d", UE_inst, eNB_inst);
|
||||
fl_show_form (form_enb[UE_inst]->lte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1237,9 +1232,22 @@ void wait_RUs() {
|
||||
printf("RUs are ready, let's go\n");
|
||||
}
|
||||
|
||||
void init_UE(int,int,int);
|
||||
void init_UE(int,int,int,int);
|
||||
void init_RU(const char*);
|
||||
|
||||
void set_UE_defaults(int nb_ue) {
|
||||
|
||||
for (int UE_id = 0;UE_id<nb_ue;UE_id++) {
|
||||
for (int CC_id = 0;CC_id<MAX_NUM_CCs;CC_id++) {
|
||||
for (uint8_t i=0; i<RX_NB_TH_MAX; i++) {
|
||||
PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[i][0]->dciFormat = 0;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[i][0]->agregationLevel = 0xFF;
|
||||
}
|
||||
PHY_vars_UE_g[UE_id][CC_id]->current_dlsch_cqi[0] = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void print_current_directory(void)
|
||||
{
|
||||
@@ -1372,7 +1380,10 @@ main (int argc, char **argv)
|
||||
printf("Waiting for RUs to get set up\n");
|
||||
wait_RUs();
|
||||
|
||||
init_UE(NB_UE_INST,0,0);
|
||||
init_UE(NB_UE_INST,0,0,1);
|
||||
|
||||
set_UE_defaults(NB_UE_INST);
|
||||
|
||||
|
||||
init_ocm ();
|
||||
printf("Sending sync to all threads\n");
|
||||
@@ -1493,6 +1504,8 @@ reset_opp_meas_oaisim (void)
|
||||
reset_meas (&PHY_vars_UE_g[UE_id][0]->ulsch_turbo_encoding_stats);
|
||||
reset_meas (&PHY_vars_UE_g[UE_id][0]->ulsch_interleaving_stats);
|
||||
reset_meas (&PHY_vars_UE_g[UE_id][0]->ulsch_multiplexing_stats);
|
||||
|
||||
|
||||
/*
|
||||
* L2 functions
|
||||
*/
|
||||
@@ -1513,6 +1526,7 @@ reset_opp_meas_oaisim (void)
|
||||
reset_meas (&UE_pdcp_stats[UE_id].pdcp_ip);
|
||||
reset_meas (&UE_pdcp_stats[UE_id].ip_pdcp);
|
||||
|
||||
|
||||
}
|
||||
|
||||
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
|
||||
|
||||
@@ -48,10 +48,11 @@ void do_UL_sig(channel_desc_t *UE2RU[NUMBER_OF_UE_MAX][NUMBER_OF_RU_MAX][MAX_NUM
|
||||
uint32_t frame,int eNB_id,uint8_t CC_id);
|
||||
|
||||
void do_DL_sig(channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs],
|
||||
node_desc_t *enb_data[NUMBER_OF_RU_MAX],node_desc_t *ue_data[NUMBER_OF_UE_MAX],
|
||||
node_desc_t *enb_data[NUMBER_OF_RU_MAX],
|
||||
node_desc_t *ue_data[NUMBER_OF_UE_MAX],
|
||||
uint16_t subframe,
|
||||
uint16_t offset,
|
||||
uint16_t length,
|
||||
uint32_t offset,
|
||||
uint32_t length,
|
||||
uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms,uint8_t UE_id,int CC_id);
|
||||
|
||||
void init_ue(node_desc_t *ue_data, UE_Antenna ue_ant);//Abstraction changes
|
||||
|
||||
@@ -1099,62 +1099,68 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
|
||||
int UE_id = device->Mod_id;
|
||||
int CC_id = device->CC_id;
|
||||
|
||||
int subframe,new_subframe;
|
||||
int subframe;
|
||||
int sample_count=0;
|
||||
int read_size;
|
||||
int sptti = PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti;
|
||||
|
||||
*ptimestamp = last_UE_rx_timestamp[UE_id][CC_id];
|
||||
|
||||
LOG_D(EMU,"[TXPATH]UE_trx_read nsamps %d TS %llu (%llu) antenna %d\n",nsamps,
|
||||
LOG_D(EMU,"DL simulation 0: UE_trx_read nsamps %d TS %llu (%llu, offset %d) antenna %d\n",nsamps,
|
||||
(unsigned long long)current_UE_rx_timestamp[UE_id][CC_id],
|
||||
(unsigned long long)last_UE_rx_timestamp[UE_id][CC_id],
|
||||
(int)(last_UE_rx_timestamp[UE_id][CC_id]%sptti),
|
||||
cc);
|
||||
|
||||
|
||||
if (nsamps < PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti)
|
||||
if (nsamps < sptti)
|
||||
read_size = nsamps;
|
||||
else
|
||||
read_size = PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti;
|
||||
read_size = sptti;
|
||||
|
||||
while (sample_count<nsamps) {
|
||||
LOG_D(EMU,"DL simulation 1: UE_trx_read : current TS now %llu, last TS %llu\n",current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
while (current_UE_rx_timestamp[UE_id][CC_id] <
|
||||
(last_UE_rx_timestamp[UE_id][CC_id]+read_size)) {
|
||||
LOG_D(EMU,"[TXPATH]UE_trx_read : current TS %d, last TS %d, sleeping\n",current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
LOG_D(EMU,"DL simulation 2: UE_trx_read : current TS %llu, last TS %llu, sleeping\n",current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
usleep(500);
|
||||
}
|
||||
|
||||
// LOG_D(EMU,"UE_trx_read : current TS %d, last TS %d, sleeping\n",current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
LOG_D(EMU,"DL simulation 3: UE_trx_read : current TS now %llu, last TS %llu\n",current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
|
||||
// if we cross a subframe-boundary
|
||||
subframe = (last_UE_rx_timestamp[UE_id][CC_id]/PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti)%10;
|
||||
new_subframe = ((last_UE_rx_timestamp[UE_id][CC_id]+read_size)/PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti)%10;
|
||||
if (new_subframe!=subframe) {
|
||||
// tell top-level we are busy
|
||||
pthread_mutex_lock(&subframe_mutex);
|
||||
subframe_UE_mask|=(1<<UE_id);
|
||||
LOG_D(EMU,"Setting UE_id %d mask to busy (%d)\n",UE_id,subframe_UE_mask);
|
||||
pthread_mutex_unlock(&subframe_mutex);
|
||||
subframe = (last_UE_rx_timestamp[UE_id][CC_id]/sptti)%10;
|
||||
|
||||
}
|
||||
// tell top-level we are busy
|
||||
pthread_mutex_lock(&subframe_mutex);
|
||||
subframe_UE_mask|=(1<<UE_id);
|
||||
LOG_D(EMU,"Setting UE_id %d mask to busy (%d)\n",UE_id,subframe_UE_mask);
|
||||
pthread_mutex_unlock(&subframe_mutex);
|
||||
|
||||
|
||||
|
||||
LOG_D(PHY,"UE_trx_read generating DL subframe %d (Ts %llu, current TS %llu)\n",
|
||||
LOG_D(PHY,"DL simulation 4: UE_trx_read generating DL subframe %d (Ts %llu, current TS %llu,nsamps %d)\n",
|
||||
subframe,(unsigned long long)*ptimestamp,
|
||||
(unsigned long long)current_UE_rx_timestamp[UE_id][CC_id]);
|
||||
(unsigned long long)current_UE_rx_timestamp[UE_id][CC_id],
|
||||
nsamps);
|
||||
|
||||
LOG_D(EMU,"DL simulation 5: Doing DL simulation for %d samples starting in subframe %d at offset %d\n",
|
||||
nsamps,subframe,
|
||||
(int)(last_UE_rx_timestamp[UE_id][CC_id]%sptti));
|
||||
|
||||
do_DL_sig(RU2UE,
|
||||
enb_data,
|
||||
ue_data,
|
||||
subframe,
|
||||
last_UE_rx_timestamp[UE_id][CC_id]%PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti,
|
||||
nsamps,
|
||||
last_UE_rx_timestamp[UE_id][CC_id]%sptti,
|
||||
sptti,
|
||||
0, //abstraction_flag,
|
||||
&PHY_vars_UE_g[UE_id][CC_id]->frame_parms,
|
||||
UE_id,
|
||||
CC_id);
|
||||
|
||||
LOG_D(EMU,"[TXPATH]UE_trx_read @ TS %llu (%llu)=> frame %d, subframe %d\n",
|
||||
LOG_D(EMU,"DL simulation 6: UE_trx_read @ TS %llu (%llu)=> frame %d, subframe %d\n",
|
||||
(unsigned long long)current_UE_rx_timestamp[UE_id][CC_id],
|
||||
(unsigned long long)last_UE_rx_timestamp[UE_id][CC_id],
|
||||
((unsigned long long)last_UE_rx_timestamp[UE_id][CC_id]/(PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti*10))&1023,
|
||||
((unsigned long long)last_UE_rx_timestamp[UE_id][CC_id]/(sptti*10))&1023,
|
||||
subframe);
|
||||
|
||||
last_UE_rx_timestamp[UE_id][CC_id] += read_size;
|
||||
@@ -1329,7 +1335,9 @@ void init_devices(void){
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_set_freq_func = UE_trx_set_freq;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_set_gains_func = UE_trx_set_gains;
|
||||
last_UE_rx_timestamp[UE_id][CC_id] = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1399,7 +1407,7 @@ void init_ocm(void)
|
||||
for (ru_id = 0; ru_id < RC.nb_RU; ru_id++) {
|
||||
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
LOG_D(OCM,"Initializing channel (%s, %d) from eNB %d to UE %d\n", oai_emulation.environment_system_config.fading.small_scale.selected_option,
|
||||
LOG_I(OCM,"Initializing channel (%s, %d) from RU %d to UE %d\n", oai_emulation.environment_system_config.fading.small_scale.selected_option,
|
||||
map_str_to_int(small_scale_names,oai_emulation.environment_system_config.fading.small_scale.selected_option), ru_id, UE_id);
|
||||
|
||||
|
||||
@@ -1542,7 +1550,7 @@ void update_ocm()
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
|
||||
AssertFatal(RU2UE[ru_id][UE_id][CC_id]!=NULL,"RU2UE[%d][%d][%d] is null\n",ru_id,UE_id,CC_id);
|
||||
AssertFatal(UE2RU[ru_id][UE_id][CC_id]!=NULL,"RU2UE[%d][%d][%d] is null\n",ru_id,UE_id,CC_id);
|
||||
AssertFatal(UE2RU[UE_id][ru_id][CC_id]!=NULL,"UE2RU[%d][%d][%d] is null\n",UE_id,ru_id,CC_id);
|
||||
//pathloss: -132.24 dBm/15kHz RE + target SNR - eNB TX power per RE
|
||||
if (ru_id == (UE_id % RC.nb_RU)) {
|
||||
RU2UE[ru_id][UE_id][CC_id]->path_loss_dB = -132.24 + snr_dB - RC.ru[ru_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
|
||||
Reference in New Issue
Block a user