Commit b60c3c95 authored by Florian Kaltenberger's avatar Florian Kaltenberger

phy test for UE first version

parent 392e38ab
...@@ -271,6 +271,7 @@ typedef struct PHY_VARS_eNB_s { ...@@ -271,6 +271,7 @@ 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; int mac_enabled;
/// For emulation only (used by UE abstraction to retrieve DCI) /// For emulation only (used by UE abstraction to retrieve DCI)
...@@ -574,6 +575,9 @@ typedef struct { ...@@ -574,6 +575,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;
......
...@@ -87,9 +87,6 @@ fifo_dump_emos_UE emos_dump_UE; ...@@ -87,9 +87,6 @@ fifo_dump_emos_UE emos_dump_UE;
# endif # endif
#endif #endif
#ifndef OPENAIR2
//#define DIAG_PHY
#endif
#define DLSCH_RB_ALLOC 0x1fbf // skip DC RB (total 23/25 RBs) #define DLSCH_RB_ALLOC 0x1fbf // skip DC RB (total 23/25 RBs)
#define DLSCH_RB_ALLOC_12 0x0aaa // skip DC RB (total 23/25 RBs) #define DLSCH_RB_ALLOC_12 0x0aaa // skip DC RB (total 23/25 RBs)
......
...@@ -291,6 +291,7 @@ double bw = 10.0e6; ...@@ -291,6 +291,7 @@ double bw = 10.0e6;
static int tx_max_power[MAX_NUM_CCs]; /* = {0,0}*/; static int tx_max_power[MAX_NUM_CCs]; /* = {0,0}*/;
int chain_offset=0; int chain_offset=0;
int phy_test = 0;
#ifndef EXMIMO #ifndef EXMIMO
char ref[128] = "internal"; char ref[128] = "internal";
...@@ -532,12 +533,12 @@ static void *scope_thread(void *arg) ...@@ -532,12 +533,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)
...@@ -2063,7 +2064,8 @@ static void get_options (int argc, char **argv) ...@@ -2063,7 +2064,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[] = {
...@@ -2080,6 +2082,7 @@ static void get_options (int argc, char **argv) ...@@ -2080,6 +2082,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}
}; };
...@@ -2152,6 +2155,10 @@ static void get_options (int argc, char **argv) ...@@ -2152,6 +2155,10 @@ static void get_options (int argc, char **argv)
mode = rx_dump_frame; mode = rx_dump_frame;
break; break;
case LONG_OPTION_PHYTEST:
phy_test = 1;
break;
case 'M': case 'M':
#ifdef ETHERNET #ifdef ETHERNET
strcpy(rrh_eNB_ip,optarg); strcpy(rrh_eNB_ip,optarg);
...@@ -2213,7 +2220,6 @@ static void get_options (int argc, char **argv) ...@@ -2213,7 +2220,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;
...@@ -2248,7 +2254,6 @@ static void get_options (int argc, char **argv) ...@@ -2248,7 +2254,6 @@ static void get_options (int argc, char **argv)
} }
break; break;
#endif
case 'V': case 'V':
ouput_vcd = 1; ouput_vcd = 1;
...@@ -2417,8 +2422,6 @@ static void get_options (int argc, char **argv) ...@@ -2417,8 +2422,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);
...@@ -2436,7 +2439,6 @@ static void get_options (int argc, char **argv) ...@@ -2436,7 +2439,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;
...@@ -2498,9 +2500,7 @@ int main( int argc, char **argv ) ...@@ -2498,9 +2500,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;
...@@ -2581,15 +2581,9 @@ int main( int argc, char **argv ) ...@@ -2581,15 +2581,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);
...@@ -2645,8 +2639,6 @@ int main( int argc, char **argv ) ...@@ -2645,8 +2639,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;
...@@ -2659,7 +2651,6 @@ int main( int argc, char **argv ) ...@@ -2659,7 +2651,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)
...@@ -2729,21 +2720,24 @@ int main( int argc, char **argv ) ...@@ -2729,21 +2720,24 @@ 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
for (i=0; i<NUMBER_OF_CONNECTED_eNB_MAX; i++) { if (phy_test==1)
UE[CC_id]->pusch_config_dedicated[i].betaOffset_ACK_Index = beta_ACK; UE[CC_id]->mac_enabled = 0;
UE[CC_id]->pusch_config_dedicated[i].betaOffset_RI_Index = beta_RI; else
UE[CC_id]->pusch_config_dedicated[i].betaOffset_CQI_Index = beta_CQI; UE[CC_id]->mac_enabled = 1;
UE[CC_id]->scheduling_request_config[i].sr_PUCCH_ResourceIndex = 0; if (UE[CC_id]->mac_enabled == 0) {
UE[CC_id]->scheduling_request_config[i].sr_ConfigIndex = 7+(0%3); for (i=0; i<NUMBER_OF_CONNECTED_eNB_MAX; i++) {
UE[CC_id]->scheduling_request_config[i].dsr_TransMax = sr_n4; 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_CQI_Index = beta_CQI;
UE[CC_id]->scheduling_request_config[i].sr_PUCCH_ResourceIndex = 0;
UE[CC_id]->scheduling_request_config[i].sr_ConfigIndex = 7+(0%3);
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;
UE[CC_id]->mode = mode; UE[CC_id]->mode = mode;
...@@ -2752,13 +2746,12 @@ int main( int argc, char **argv ) ...@@ -2752,13 +2746,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);
UE[CC_id]->lte_ue_pdcch_vars[0]->crnti = 0x1234; if (UE[CC_id]->mac_enabled == 1)
#ifndef OPENAIR2 UE[CC_id]->lte_ue_pdcch_vars[0]->crnti = 0x1234;
UE[CC_id]->lte_ue_pdcch_vars[0]->crnti = 0x1235; else
#endif UE[CC_id]->lte_ue_pdcch_vars[0]->crnti = 0x1235;
#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];
...@@ -2792,9 +2785,7 @@ int main( int argc, char **argv ) ...@@ -2792,9 +2785,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)
...@@ -2806,7 +2797,6 @@ int main( int argc, char **argv ) ...@@ -2806,7 +2797,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;
...@@ -2830,20 +2820,23 @@ int main( int argc, char **argv ) ...@@ -2830,20 +2820,23 @@ 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;
for (i=0; i<NUMBER_OF_UE_MAX; i++) { else
PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_ACK_Index = beta_ACK; PHY_vars_eNB_g[0][CC_id]->mac_enabled = 1;
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_CQI_Index = beta_CQI;
PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].sr_PUCCH_ResourceIndex = i; if (PHY_vars_eNB_g[0][CC_id]->mac_enabled == 0) {
PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].sr_ConfigIndex = 7+(i%3); for (i=0; i<NUMBER_OF_UE_MAX; i++) {
PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].dsr_TransMax = sr_n4; 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_CQI_Index = beta_CQI;
PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].sr_PUCCH_ResourceIndex = i;
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;
}
} }
#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,
PHY_vars_eNB_g[0][CC_id]->X_u); PHY_vars_eNB_g[0][CC_id]->X_u);
...@@ -3044,16 +3037,12 @@ int main( int argc, char **argv ) ...@@ -3044,16 +3037,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)
...@@ -3066,15 +3055,14 @@ int main( int argc, char **argv ) ...@@ -3066,15 +3055,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) {
...@@ -3466,9 +3454,6 @@ int main( int argc, char **argv ) ...@@ -3466,9 +3454,6 @@ int main( int argc, char **argv )
} }
} }
#ifdef OPENAIR2
//cleanup_pdcp_thread();
#endif
#ifdef RTAI #ifdef RTAI
stop_rt_timer(); stop_rt_timer();
...@@ -3503,13 +3488,9 @@ int main( int argc, char **argv ) ...@@ -3503,13 +3488,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) {
......
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