Commit 83f4f69f authored by Florian Kaltenberger's avatar Florian Kaltenberger

Merge branch 'enhancement-64-phy_test' into 'develop'

Enhancement 64 phy test

this branch (re)-introduces functionality that allows to run the eNB as a signal generator and the UE as a vector signal analyzer (old OPENAIR2=0). 
Tests mostly pass (as good as before).

See merge request !18
parents 78b109c9 3b4a5f25
...@@ -496,20 +496,20 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) ...@@ -496,20 +496,20 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
#endif #endif
if (phy_vars_ue->UE_scan_carrier == 0) { if (phy_vars_ue->UE_scan_carrier == 0) {
#ifdef OPENAIR2 if (phy_vars_ue->mac_enabled==1) {
LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",phy_vars_ue->Mod_id); LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",phy_vars_ue->Mod_id);
//mac_resynch(); //mac_resynch();
mac_xface->dl_phy_sync_success(phy_vars_ue->Mod_id,phy_vars_ue->frame_rx,0,1);//phy_vars_ue->lte_ue_common_vars.eNb_id); mac_xface->dl_phy_sync_success(phy_vars_ue->Mod_id,phy_vars_ue->frame_rx,0,1);//phy_vars_ue->lte_ue_common_vars.eNb_id);
#endif //OPENAIR2 phy_vars_ue->UE_mode[0] = PRACH;
}
else {
phy_vars_ue->UE_mode[0] = PUSCH;
}
generate_pcfich_reg_mapping(frame_parms); generate_pcfich_reg_mapping(frame_parms);
generate_phich_reg_mapping(frame_parms); generate_phich_reg_mapping(frame_parms);
// init_prach625(frame_parms); // init_prach625(frame_parms);
#ifndef OPENAIR2
phy_vars_ue->UE_mode[0] = PUSCH;
#else
phy_vars_ue->UE_mode[0] = PRACH;
#endif
//phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors=0; //phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors=0;
phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors_conseq=0; phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors_conseq=0;
//phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors_last=0; //phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors_last=0;
......
...@@ -107,10 +107,10 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t ...@@ -107,10 +107,10 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
len += sprintf(&buffer[len], "[UE PROC] timing_advance = %d\n",phy_vars_ue->timing_advance); len += sprintf(&buffer[len], "[UE PROC] timing_advance = %d\n",phy_vars_ue->timing_advance);
if (phy_vars_ue->UE_mode[0]==PUSCH) { if (phy_vars_ue->UE_mode[0]==PUSCH) {
len += sprintf(&buffer[len], "[UE PROC] Po_PUSCH = %d dBm (PL %d dB, Po_NOMINAL_PUSCH %d dBm, PHR %d dB)\n", len += sprintf(&buffer[len], "[UE PROC] Po_PUSCH = %d dBm (PL %d dB, Po_NOMINAL_PUSCH %d dBm, PHR %d dB)\n",
PHY_vars_UE_g[0][0]->ulsch_ue[0]->Po_PUSCH, phy_vars_ue->ulsch_ue[0]->Po_PUSCH,
get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,0), get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,0),
mac_xface->get_Po_NOMINAL_PUSCH(phy_vars_ue->Mod_id,0), phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUSCH,
PHY_vars_UE_g[0][0]->ulsch_ue[0]->PHR); phy_vars_ue->ulsch_ue[0]->PHR);
len += sprintf(&buffer[len], "[UE PROC] Po_PUCCH = %d dBm (Po_NOMINAL_PUCCH %d dBm, g_pucch %d dB)\n", len += sprintf(&buffer[len], "[UE PROC] Po_PUCCH = %d dBm (Po_NOMINAL_PUCCH %d dBm, g_pucch %d dB)\n",
get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,0)+ get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,0)+
phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+ phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+
...@@ -582,9 +582,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) ...@@ -582,9 +582,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
len += sprintf(&buffer[len],"%4d ", len += sprintf(&buffer[len],"%4d ",
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dBm[i]); phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dBm[i]);
if ((i>0) && ((i%25) == 0)) if ((i>0) && ((i%25) == 0))
len += sprintf(&buffer[len],"\n ", len += sprintf(&buffer[len],"\n");
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dBm[i]);
} }
len += sprintf(&buffer[len],"\n"); len += sprintf(&buffer[len],"\n");
len += sprintf(&buffer[len],"\n[eNB PROC] PERFORMANCE PARAMETERS\n"); len += sprintf(&buffer[len],"\n[eNB PROC] PERFORMANCE PARAMETERS\n");
...@@ -644,7 +642,6 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) ...@@ -644,7 +642,6 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB, dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH, phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB, dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
PUCCH1_THRES+phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm-dB_fixed(phy_vars_eNB->lte_frame_parms.N_RB_UL), PUCCH1_THRES+phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm-dB_fixed(phy_vars_eNB->lte_frame_parms.N_RB_UL),
phy_vars_eNB->eNB_UE_stats[UE_id].sector); phy_vars_eNB->eNB_UE_stats[UE_id].sector);
......
...@@ -278,6 +278,9 @@ typedef struct PHY_VARS_eNB_s { ...@@ -278,6 +278,9 @@ typedef struct PHY_VARS_eNB_s {
int **dl_precoder_SeNB[3]; int **dl_precoder_SeNB[3];
char log2_maxp; /// holds the maximum channel/precoder coefficient char log2_maxp; /// holds the maximum channel/precoder coefficient
/// if ==0 enables phy only test mode
int mac_enabled;
/// For emulation only (used by UE abstraction to retrieve DCI) /// For emulation only (used by UE abstraction to retrieve DCI)
uint8_t num_common_dci[2]; // num_dci in even/odd subframes uint8_t num_common_dci[2]; // num_dci in even/odd subframes
uint8_t num_ue_spec_dci[2]; // num_dci in even/odd subframes uint8_t num_ue_spec_dci[2]; // num_dci in even/odd subframes
...@@ -579,6 +582,9 @@ typedef struct { ...@@ -579,6 +582,9 @@ typedef struct {
/// holds the maximum channel/precoder coefficient /// holds the maximum channel/precoder coefficient
char log2_maxp; char log2_maxp;
/// if ==0 enables phy only test mode
int mac_enabled;
/// Flag to initialize averaging of PHY measurements /// Flag to initialize averaging of PHY measurements
int init_averaging; int init_averaging;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -47,8 +47,8 @@ int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP,uint8_t CC_id) ...@@ -47,8 +47,8 @@ int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP,uint8_t CC_id)
if (CC_id>0) { if (CC_id>0) {
LOG_E(MAC,"Transmission on secondary CCs is not supported yet\n"); LOG_E(MAC,"Transmission on secondary CCs is not supported yet\n");
mac_xface->macphy_exit("MAC FATAL CC_id>0"); //mac_xface->macphy_exit("MAC FATAL CC_id>0");
return 0; // not reached return 0;
} }
if (UE_mac_inst[module_idP].radioResourceConfigCommon) { if (UE_mac_inst[module_idP].radioResourceConfigCommon) {
...@@ -56,7 +56,8 @@ int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP,uint8_t CC_id) ...@@ -56,7 +56,8 @@ int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP,uint8_t CC_id)
} }
else { else {
LOG_E(MAC,"[UE %d] CCid %d FATAL radioResourceConfigCommon is NULL !!!\n",module_idP,CC_id); LOG_E(MAC,"[UE %d] CCid %d FATAL radioResourceConfigCommon is NULL !!!\n",module_idP,CC_id);
mac_xface->macphy_exit("FATAL radioResourceConfigCommon is NULL"); //mac_xface->macphy_exit("FATAL radioResourceConfigCommon is NULL");
return 0;
} }
return(-120 + (rach_ConfigCommon->powerRampingParameters.preambleInitialReceivedTargetPower<<1) + return(-120 + (rach_ConfigCommon->powerRampingParameters.preambleInitialReceivedTargetPower<<1) +
......
...@@ -293,6 +293,7 @@ static int tx_max_power[MAX_NUM_CCs]; /* = {0,0}*/; ...@@ -293,6 +293,7 @@ static int tx_max_power[MAX_NUM_CCs]; /* = {0,0}*/;
char rf_config_file[1024]; char rf_config_file[1024];
int chain_offset=0; int chain_offset=0;
int phy_test = 0;
#ifndef EXMIMO #ifndef EXMIMO
char ref[128] = "internal"; char ref[128] = "internal";
...@@ -472,7 +473,7 @@ void help (void) { ...@@ -472,7 +473,7 @@ void help (void) {
printf(" -d Enable soft scope and L1 and L2 stats (Xforms)\n"); printf(" -d Enable soft scope and L1 and L2 stats (Xforms)\n");
printf(" -F Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n"); printf(" -F Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n");
printf(" -g Set the global log level, valide options: (9:trace, 8/7:debug, 6:info, 4:warn, 3:error)\n"); printf(" -g Set the global log level, valide options: (9:trace, 8/7:debug, 6:info, 4:warn, 3:error)\n");
printf(" -G Set the global log level \n"); printf(" -G Set the global log verbosity \n");
printf(" -h provides this help message!\n"); printf(" -h provides this help message!\n");
printf(" -K Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n"); printf(" -K Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n");
printf(" -m Set the maximum downlink MCS\n"); printf(" -m Set the maximum downlink MCS\n");
...@@ -577,12 +578,12 @@ static void *scope_thread(void *arg) ...@@ -577,12 +578,12 @@ static void *scope_thread(void *arg)
0,7); 0,7);
} else { } else {
#ifdef OPENAIR2 if (PHY_vars_eNB_g[0][0]->mac_enabled==1) {
len = dump_eNB_l2_stats (stats_buffer, 0); len = dump_eNB_l2_stats (stats_buffer, 0);
//fl_set_object_label(form_stats_l2->stats_text, stats_buffer); //fl_set_object_label(form_stats_l2->stats_text, stats_buffer);
fl_clear_browser(form_stats_l2->stats_text); fl_clear_browser(form_stats_l2->stats_text);
fl_add_browser_line(form_stats_l2->stats_text, stats_buffer); fl_add_browser_line(form_stats_l2->stats_text, stats_buffer);
#endif }
len = dump_eNB_stats (PHY_vars_eNB_g[0][0], stats_buffer, 0); len = dump_eNB_stats (PHY_vars_eNB_g[0][0], stats_buffer, 0);
if (MAX_NUM_CCs>1) if (MAX_NUM_CCs>1)
...@@ -2117,7 +2118,8 @@ static void get_options (int argc, char **argv) ...@@ -2117,7 +2118,8 @@ static void get_options (int argc, char **argv)
LONG_OPTION_SCANCARRIER, LONG_OPTION_SCANCARRIER,
LONG_OPTION_MAXPOWER, LONG_OPTION_MAXPOWER,
LONG_OPTION_DUMP_FRAME, LONG_OPTION_DUMP_FRAME,
LONG_OPTION_LOOPMEMORY LONG_OPTION_LOOPMEMORY,
LONG_OPTION_PHYTEST
}; };
static const struct option long_options[] = { static const struct option long_options[] = {
...@@ -2135,6 +2137,7 @@ static void get_options (int argc, char **argv) ...@@ -2135,6 +2137,7 @@ static void get_options (int argc, char **argv)
{"ue-max-power", required_argument, NULL, LONG_OPTION_MAXPOWER}, {"ue-max-power", required_argument, NULL, LONG_OPTION_MAXPOWER},
{"ue-dump-frame", no_argument, NULL, LONG_OPTION_DUMP_FRAME}, {"ue-dump-frame", no_argument, NULL, LONG_OPTION_DUMP_FRAME},
{"loop-memory", required_argument, NULL, LONG_OPTION_LOOPMEMORY}, {"loop-memory", required_argument, NULL, LONG_OPTION_LOOPMEMORY},
{"phy-test", no_argument, NULL, LONG_OPTION_PHYTEST},
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
}; };
...@@ -2217,6 +2220,11 @@ static void get_options (int argc, char **argv) ...@@ -2217,6 +2220,11 @@ static void get_options (int argc, char **argv)
case LONG_OPTION_DUMP_FRAME: case LONG_OPTION_DUMP_FRAME:
mode = rx_dump_frame; mode = rx_dump_frame;
break; break;
case LONG_OPTION_PHYTEST:
phy_test = 1;
break;
case 'A': case 'A':
timing_advance = atoi (optarg); timing_advance = atoi (optarg);
break; break;
...@@ -2272,7 +2280,6 @@ static void get_options (int argc, char **argv) ...@@ -2272,7 +2280,6 @@ static void get_options (int argc, char **argv)
case 't': case 't':
target_ul_mcs = atoi (optarg); target_ul_mcs = atoi (optarg);
break; break;
#ifdef OPENAIR2
case 'W': case 'W':
opt_enabled=1; opt_enabled=1;
...@@ -2307,7 +2314,6 @@ static void get_options (int argc, char **argv) ...@@ -2307,7 +2314,6 @@ static void get_options (int argc, char **argv)
} }
break; break;
#endif
case 'V': case 'V':
ouput_vcd = 1; ouput_vcd = 1;
...@@ -2415,8 +2421,8 @@ static void get_options (int argc, char **argv) ...@@ -2415,8 +2421,8 @@ static void get_options (int argc, char **argv)
case 'x': case 'x':
transmission_mode = atoi(optarg); transmission_mode = atoi(optarg);
if (transmission_mode > 2) { if (transmission_mode > 7) {
printf("Transmission mode > 2 (%d) not supported for the moment\n",transmission_mode); printf("Transmission mode %d not supported for the moment\n",transmission_mode);
exit(-1); exit(-1);
} }
break; break;
...@@ -2511,8 +2517,6 @@ static void get_options (int argc, char **argv) ...@@ -2511,8 +2517,6 @@ static void get_options (int argc, char **argv)
} }
#ifdef OPENAIR2
init_all_otg(0); init_all_otg(0);
g_otg->seed = 0; g_otg->seed = 0;
init_seeds(g_otg->seed); init_seeds(g_otg->seed);
...@@ -2530,7 +2534,6 @@ static void get_options (int argc, char **argv) ...@@ -2530,7 +2534,6 @@ static void get_options (int argc, char **argv)
init_predef_traffic(enb_properties->properties[i]->num_otg_elements, 1); init_predef_traffic(enb_properties->properties[i]->num_otg_elements, 1);
#endif
glog_level = enb_properties->properties[i]->glog_level; glog_level = enb_properties->properties[i]->glog_level;
glog_verbosity = enb_properties->properties[i]->glog_verbosity; glog_verbosity = enb_properties->properties[i]->glog_verbosity;
...@@ -2592,9 +2595,7 @@ int main( int argc, char **argv ) ...@@ -2592,9 +2595,7 @@ int main( int argc, char **argv )
int CC_id; int CC_id;
uint16_t Nid_cell = 0; uint16_t Nid_cell = 0;
uint8_t cooperation_flag=0, abstraction_flag=0; uint8_t cooperation_flag=0, abstraction_flag=0;
#ifndef OPENAIR2
uint8_t beta_ACK=0,beta_RI=0,beta_CQI=2; uint8_t beta_ACK=0,beta_RI=0,beta_CQI=2;
#endif
#ifdef ENABLE_TCXO #ifdef ENABLE_TCXO
unsigned int tcxo = 114; unsigned int tcxo = 114;
...@@ -2662,8 +2663,8 @@ int main( int argc, char **argv ) ...@@ -2662,8 +2663,8 @@ int main( int argc, char **argv )
if (UE_flag==1) { if (UE_flag==1) {
printf("configuring for UE\n"); printf("configuring for UE\n");
set_comp_log(HW, LOG_INFO, LOG_HIGH, 1); set_comp_log(HW, LOG_DEBUG, LOG_HIGH, 1);
set_comp_log(PHY, LOG_INFO, LOG_HIGH, 1); set_comp_log(PHY, LOG_DEBUG, LOG_HIGH, 1);
set_comp_log(MAC, LOG_INFO, LOG_HIGH, 1); set_comp_log(MAC, LOG_INFO, LOG_HIGH, 1);
set_comp_log(RLC, LOG_INFO, LOG_HIGH, 1); set_comp_log(RLC, LOG_INFO, LOG_HIGH, 1);
set_comp_log(PDCP, LOG_INFO, LOG_HIGH, 1); set_comp_log(PDCP, LOG_INFO, LOG_HIGH, 1);
...@@ -2679,15 +2680,9 @@ int main( int argc, char **argv ) ...@@ -2679,15 +2680,9 @@ int main( int argc, char **argv )
printf("configuring for eNB\n"); printf("configuring for eNB\n");
set_comp_log(HW, hw_log_level, hw_log_verbosity, 1); set_comp_log(HW, hw_log_level, hw_log_verbosity, 1);
#ifdef OPENAIR2
set_comp_log(PHY, phy_log_level, phy_log_verbosity, 1); set_comp_log(PHY, phy_log_level, phy_log_verbosity, 1);
if (opt_enabled == 1 ) if (opt_enabled == 1 )
set_comp_log(OPT, opt_log_level, opt_log_verbosity, 1); set_comp_log(OPT, opt_log_level, opt_log_verbosity, 1);
#else
set_comp_log(PHY, LOG_INFO, LOG_HIGH, 1);
#endif
set_comp_log(MAC, mac_log_level, mac_log_verbosity, 1); set_comp_log(MAC, mac_log_level, mac_log_verbosity, 1);
set_comp_log(RLC, rlc_log_level, rlc_log_verbosity, 1); set_comp_log(RLC, rlc_log_level, rlc_log_verbosity, 1);
set_comp_log(PDCP, pdcp_log_level, pdcp_log_verbosity, 1); set_comp_log(PDCP, pdcp_log_level, pdcp_log_verbosity, 1);
...@@ -2743,8 +2738,6 @@ int main( int argc, char **argv ) ...@@ -2743,8 +2738,6 @@ int main( int argc, char **argv )
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX); MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
#endif #endif
#ifdef OPENAIR2
if (opt_type != OPT_NONE) { if (opt_type != OPT_NONE) {
radio_type_t radio_type; radio_type_t radio_type;
...@@ -2757,7 +2750,6 @@ int main( int argc, char **argv ) ...@@ -2757,7 +2750,6 @@ int main( int argc, char **argv )
LOG_E(OPT,"failed to run OPT \n"); LOG_E(OPT,"failed to run OPT \n");
} }
#endif
#ifdef PDCP_USE_NETLINK #ifdef PDCP_USE_NETLINK
netlink_init(); netlink_init();
#if defined(PDCP_USE_NETLINK_QUEUES) #if defined(PDCP_USE_NETLINK_QUEUES)
...@@ -2827,8 +2819,13 @@ int main( int argc, char **argv ) ...@@ -2827,8 +2819,13 @@ int main( int argc, char **argv )
PHY_vars_UE_g[0][CC_id] = init_lte_UE(frame_parms[CC_id], 0,abstraction_flag,transmission_mode); PHY_vars_UE_g[0][CC_id] = init_lte_UE(frame_parms[CC_id], 0,abstraction_flag,transmission_mode);
UE[CC_id] = PHY_vars_UE_g[0][CC_id]; UE[CC_id] = PHY_vars_UE_g[0][CC_id];
printf("PHY_vars_UE_g[0][%d] = %p\n",CC_id,UE[CC_id]); printf("PHY_vars_UE_g[0][%d] = %p\n",CC_id,UE[CC_id]);
#ifndef OPENAIR2
if (phy_test==1)
UE[CC_id]->mac_enabled = 0;
else
UE[CC_id]->mac_enabled = 1;
if (UE[CC_id]->mac_enabled == 0) {
for (i=0; i<NUMBER_OF_CONNECTED_eNB_MAX; i++) { for (i=0; i<NUMBER_OF_CONNECTED_eNB_MAX; i++) {
UE[CC_id]->pusch_config_dedicated[i].betaOffset_ACK_Index = beta_ACK; UE[CC_id]->pusch_config_dedicated[i].betaOffset_ACK_Index = beta_ACK;
UE[CC_id]->pusch_config_dedicated[i].betaOffset_RI_Index = beta_RI; UE[CC_id]->pusch_config_dedicated[i].betaOffset_RI_Index = beta_RI;
...@@ -2838,9 +2835,7 @@ int main( int argc, char **argv ) ...@@ -2838,9 +2835,7 @@ int main( int argc, char **argv )
UE[CC_id]->scheduling_request_config[i].sr_ConfigIndex = 7+(0%3); UE[CC_id]->scheduling_request_config[i].sr_ConfigIndex = 7+(0%3);
UE[CC_id]->scheduling_request_config[i].dsr_TransMax = sr_n4; UE[CC_id]->scheduling_request_config[i].dsr_TransMax = sr_n4;
} }
}
#endif
UE[CC_id]->UE_scan = UE_scan; UE[CC_id]->UE_scan = UE_scan;
UE[CC_id]->UE_scan_carrier = UE_scan_carrier; UE[CC_id]->UE_scan_carrier = UE_scan_carrier;
...@@ -2850,13 +2845,12 @@ int main( int argc, char **argv ) ...@@ -2850,13 +2845,12 @@ int main( int argc, char **argv )
UE[CC_id]->lte_frame_parms.frame_type, UE[CC_id]->lte_frame_parms.frame_type,
UE[CC_id]->X_u); UE[CC_id]->X_u);
if (UE[CC_id]->mac_enabled == 1)
UE[CC_id]->lte_ue_pdcch_vars[0]->crnti = 0x1234; UE[CC_id]->lte_ue_pdcch_vars[0]->crnti = 0x1234;
#ifndef OPENAIR2 else
UE[CC_id]->lte_ue_pdcch_vars[0]->crnti = 0x1235; UE[CC_id]->lte_ue_pdcch_vars[0]->crnti = 0x1235;
#endif
#ifdef EXMIMO #ifdef EXMIMO
for (i=0; i<4; i++) { for (i=0; i<4; i++) {
UE[CC_id]->rx_gain_max[i] = rxg_max[i]; UE[CC_id]->rx_gain_max[i] = rxg_max[i];
UE[CC_id]->rx_gain_med[i] = rxg_med[i]; UE[CC_id]->rx_gain_med[i] = rxg_med[i];
...@@ -2890,9 +2884,7 @@ int main( int argc, char **argv ) ...@@ -2890,9 +2884,7 @@ int main( int argc, char **argv )
UE[CC_id]->tx_power_max_dBm = tx_max_power[CC_id]; UE[CC_id]->tx_power_max_dBm = tx_max_power[CC_id];
#ifdef EXMIMO #ifdef EXMIMO
//N_TA_offset //N_TA_offset
if (UE[CC_id]->lte_frame_parms.frame_type == TDD) { if (UE[CC_id]->lte_frame_parms.frame_type == TDD) {
if (UE[CC_id]->lte_frame_parms.N_RB_DL == 100) if (UE[CC_id]->lte_frame_parms.N_RB_DL == 100)
...@@ -2904,7 +2896,6 @@ int main( int argc, char **argv ) ...@@ -2904,7 +2896,6 @@ int main( int argc, char **argv )
} else { } else {
UE[CC_id]->N_TA_offset = 0; UE[CC_id]->N_TA_offset = 0;
} }
#else #else
//already taken care of in lte-softmodem //already taken care of in lte-softmodem
UE[CC_id]->N_TA_offset = 0; UE[CC_id]->N_TA_offset = 0;
...@@ -2928,8 +2919,12 @@ int main( int argc, char **argv ) ...@@ -2928,8 +2919,12 @@ int main( int argc, char **argv )
PHY_vars_eNB_g[0][CC_id] = init_lte_eNB(frame_parms[CC_id],0,frame_parms[CC_id]->Nid_cell,cooperation_flag,transmission_mode,abstraction_flag); PHY_vars_eNB_g[0][CC_id] = init_lte_eNB(frame_parms[CC_id],0,frame_parms[CC_id]->Nid_cell,cooperation_flag,transmission_mode,abstraction_flag);
PHY_vars_eNB_g[0][CC_id]->CC_id = CC_id; PHY_vars_eNB_g[0][CC_id]->CC_id = CC_id;
#ifndef OPENAIR2 if (phy_test==1)
PHY_vars_eNB_g[0][CC_id]->mac_enabled = 0;
else
PHY_vars_eNB_g[0][CC_id]->mac_enabled = 1;
if (PHY_vars_eNB_g[0][CC_id]->mac_enabled == 0) {
for (i=0; i<NUMBER_OF_UE_MAX; i++) { for (i=0; i<NUMBER_OF_UE_MAX; i++) {
PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_ACK_Index = beta_ACK; PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_ACK_Index = beta_ACK;
PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_RI_Index = beta_RI; PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_RI_Index = beta_RI;
...@@ -2939,8 +2934,7 @@ int main( int argc, char **argv ) ...@@ -2939,8 +2934,7 @@ int main( int argc, char **argv )
PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].sr_ConfigIndex = 7+(i%3); PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].sr_ConfigIndex = 7+(i%3);
PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].dsr_TransMax = sr_n4; PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].dsr_TransMax = sr_n4;
} }
}
#endif
compute_prach_seq(&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms.prach_config_common, compute_prach_seq(&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms.prach_config_common,
PHY_vars_eNB_g[0][CC_id]->lte_frame_parms.frame_type, PHY_vars_eNB_g[0][CC_id]->lte_frame_parms.frame_type,
...@@ -3150,16 +3144,12 @@ int main( int argc, char **argv ) ...@@ -3150,16 +3144,12 @@ int main( int argc, char **argv )
mac_xface = malloc(sizeof(MAC_xface)); mac_xface = malloc(sizeof(MAC_xface));
#ifdef OPENAIR2
int eMBMS_active=0; int eMBMS_active=0;
l2_init(frame_parms[0],eMBMS_active,(uecap_xer_in==1)?uecap_xer:NULL, l2_init(frame_parms[0],eMBMS_active,(uecap_xer_in==1)?uecap_xer:NULL,
0,// cba_group_active 0,// cba_group_active
0); // HO flag 0); // HO flag
#endif
mac_xface->macphy_exit = &exit_fun; mac_xface->macphy_exit = &exit_fun;
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
...@@ -3172,15 +3162,14 @@ int main( int argc, char **argv ) ...@@ -3172,15 +3162,14 @@ int main( int argc, char **argv )
printf("ITTI tasks created\n"); printf("ITTI tasks created\n");
#endif #endif
#ifdef OPENAIR2 if (phy_test==0) {
if (UE_flag==1) { if (UE_flag==1) {
printf("Filling UE band info\n"); printf("Filling UE band info\n");
fill_ue_band_info(); fill_ue_band_info();
mac_xface->dl_phy_sync_success (0, 0, 0, 1); mac_xface->dl_phy_sync_success (0, 0, 0, 1);
} else } else
mac_xface->mrbch_phy_sync_failure (0, 0, 0); mac_xface->mrbch_phy_sync_failure (0, 0, 0);
}
#endif
/* #ifdef OPENAIR2 /* #ifdef OPENAIR2
//if (otg_enabled) { //if (otg_enabled) {
...@@ -3571,9 +3560,6 @@ int main( int argc, char **argv ) ...@@ -3571,9 +3560,6 @@ int main( int argc, char **argv )
} }
} }
#ifdef OPENAIR2
//cleanup_pdcp_thread();
#endif
#ifdef RTAI #ifdef RTAI
stop_rt_timer(); stop_rt_timer();
...@@ -3608,13 +3594,9 @@ int main( int argc, char **argv ) ...@@ -3608,13 +3594,9 @@ int main( int argc, char **argv )
if (ouput_vcd) if (ouput_vcd)
VCD_SIGNAL_DUMPER_CLOSE(); VCD_SIGNAL_DUMPER_CLOSE();
#ifdef OPENAIR2
if (opt_enabled == 1) if (opt_enabled == 1)
terminate_opt(); terminate_opt();
#endif
logClean(); logClean();
return 0; return 0;
......
...@@ -925,9 +925,7 @@ static void *UE_thread_rx(void *arg) ...@@ -925,9 +925,7 @@ static void *UE_thread_rx(void *arg)
phy_procedures_UE_RX( UE, 0, 0, UE->mode, no_relay, NULL ); phy_procedures_UE_RX( UE, 0, 0, UE->mode, no_relay, NULL );
} }
#ifdef OPENAIR2 if ((UE->mac_enabled==1) && (i==0)) {
if (i==0) {
ret = mac_xface->ue_scheduler(UE->Mod_id, ret = mac_xface->ue_scheduler(UE->Mod_id,
UE->frame_tx, UE->frame_tx,
UE->slot_rx>>1, UE->slot_rx>>1,
...@@ -950,7 +948,6 @@ static void *UE_thread_rx(void *arg) ...@@ -950,7 +948,6 @@ static void *UE_thread_rx(void *arg)
} }
} }
#endif
UE->slot_rx++; UE->slot_rx++;
if (UE->slot_rx == 20) { if (UE->slot_rx == 20) {
......
...@@ -136,6 +136,8 @@ int td = 0; ...@@ -136,6 +136,8 @@ int td = 0;
int td_avg = 0; int td_avg = 0;
int sleep_time_us = 0; int sleep_time_us = 0;
int phy_test = 0;
#ifdef OPENAIR2 #ifdef OPENAIR2
// omv related info // omv related info
//pid_t omv_pid; //pid_t omv_pid;
...@@ -209,6 +211,7 @@ void get_simulation_options(int argc, char *argv[]) ...@@ -209,6 +211,7 @@ void get_simulation_options(int argc, char *argv[])
LONG_OPTION_CBA_BACKOFF_TIMER, LONG_OPTION_CBA_BACKOFF_TIMER,
LONG_OPTION_PHYTEST,
LONG_OPTION_XFORMS, LONG_OPTION_XFORMS,
}; };
...@@ -241,6 +244,7 @@ void get_simulation_options(int argc, char *argv[]) ...@@ -241,6 +244,7 @@ void get_simulation_options(int argc, char *argv[])
{"cba-backoff", required_argument, 0, LONG_OPTION_CBA_BACKOFF_TIMER}, {"cba-backoff", required_argument, 0, LONG_OPTION_CBA_BACKOFF_TIMER},
{"phy-test", no_argument, NULL, LONG_OPTION_PHYTEST},
{"xforms", no_argument, 0, LONG_OPTION_XFORMS}, {"xforms", no_argument, 0, LONG_OPTION_XFORMS},
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
...@@ -248,6 +252,10 @@ void get_simulation_options(int argc, char *argv[]) ...@@ -248,6 +252,10 @@ void get_simulation_options(int argc, char *argv[])
while ((option = getopt_long (argc, argv, "aA:b:B:c:C:D:d:eE:f:FGg:hHi:IJ:j:k:K:l:L:m:M:n:N:oO:p:P:qQ:rR:s:S:t:T:u:U:vV:w:W:x:X:y:Y:z:Z:", long_options, NULL)) != -1) { while ((option = getopt_long (argc, argv, "aA:b:B:c:C:D:d:eE:f:FGg:hHi:IJ:j:k:K:l:L:m:M:n:N:oO:p:P:qQ:rR:s:S:t:T:u:U:vV:w:W:x:X:y:Y:z:Z:", long_options, NULL)) != -1) {
switch (option) { switch (option) {
case LONG_OPTION_PHYTEST:
phy_test = 1;
break;
case LONG_OPTION_ENB_CONF: case LONG_OPTION_ENB_CONF:
if (optarg) { if (optarg) {
free(conf_config_file_name); // prevent memory leak if option is used multiple times free(conf_config_file_name); // prevent memory leak if option is used multiple times
...@@ -986,6 +994,14 @@ void init_openair1(void) ...@@ -986,6 +994,14 @@ void init_openair1(void)
} }
} }
for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++)
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
if (phy_test==1)
PHY_vars_eNB_g[eNB_id][CC_id]->mac_enabled=0;
else
PHY_vars_eNB_g[eNB_id][CC_id]->mac_enabled=1;
}
// init_ue_status(); // init_ue_status();
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) for (UE_id=0; UE_id<NB_UE_INST; UE_id++)
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
...@@ -1002,6 +1018,11 @@ void init_openair1(void) ...@@ -1002,6 +1018,11 @@ void init_openair1(void)
PHY_vars_UE_g[UE_id][CC_id]->UE_mode[0] = PRACH; PHY_vars_UE_g[UE_id][CC_id]->UE_mode[0] = PRACH;
} }
if (phy_test==1)
PHY_vars_UE_g[UE_id][CC_id]->mac_enabled=0;
else
PHY_vars_UE_g[UE_id][CC_id]->mac_enabled=1;
PHY_vars_UE_g[UE_id][CC_id]->lte_ue_pdcch_vars[0]->crnti = 0x1235 + UE_id; PHY_vars_UE_g[UE_id][CC_id]->lte_ue_pdcch_vars[0]->crnti = 0x1235 + UE_id;
PHY_vars_UE_g[UE_id][CC_id]->current_dlsch_cqi[0] = 10; PHY_vars_UE_g[UE_id][CC_id]->current_dlsch_cqi[0] = 10;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment