Commit 77ec326c 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 949b1a8d 8f2a640b
...@@ -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) +
......
This diff is collapsed.
...@@ -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