let the gNB print a LOG with the UE command line parameters to simplfy the life of the users
This commit is contained in:
@@ -102,6 +102,12 @@ Command line parameters for UE in `--sa` mode:
|
|||||||
- `--band` : NR band number (default value 78)
|
- `--band` : NR band number (default value 78)
|
||||||
- `--ssb` : SSB start subcarrier (default value 516)
|
- `--ssb` : SSB start subcarrier (default value 516)
|
||||||
|
|
||||||
|
To simplify the configuration for the user testing OAI UE with OAI gNB, the latter prints the following LOG that guides the user to correctly set the UE command line parameters.
|
||||||
|
|
||||||
|
```
|
||||||
|
[PHY] Command line parameters for the UE: -C 3319680000 -r 106 --numerology 1 --band 78 --ssb 516
|
||||||
|
```
|
||||||
|
|
||||||
You can run this, using USRPs, on two separate machines:
|
You can run this, using USRPs, on two separate machines:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -212,22 +212,20 @@ uint32_t get_samples_slot_timestamp(int slot, const NR_DL_FRAME_PARMS *fp, uint8
|
|||||||
return samp_count;
|
return samp_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg,
|
void nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg, NR_DL_FRAME_PARMS *fp)
|
||||||
NR_DL_FRAME_PARMS *fp)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
AssertFatal (cfg != NULL, "%s %s:%i Null pointer to cfg %p!\n", __FUNCTION__, __FILE__, __LINE__, cfg);
|
AssertFatal (cfg, "Null pointer to cfg!\n");
|
||||||
|
|
||||||
fp->frame_type = cfg->cell_config.frame_duplex_type.value;
|
fp->frame_type = cfg->cell_config.frame_duplex_type.value;
|
||||||
fp->L_ssb = (((uint64_t) cfg->ssb_table.ssb_mask_list[0].ssb_mask.value)<<32) | cfg->ssb_table.ssb_mask_list[1].ssb_mask.value ;
|
fp->L_ssb = (((uint64_t) cfg->ssb_table.ssb_mask_list[0].ssb_mask.value) << 32) | cfg->ssb_table.ssb_mask_list[1].ssb_mask.value;
|
||||||
fp->N_RB_DL = cfg->carrier_config.dl_grid_size[cfg->ssb_config.scs_common.value].value;
|
fp->N_RB_DL = cfg->carrier_config.dl_grid_size[cfg->ssb_config.scs_common.value].value;
|
||||||
fp->N_RB_UL = cfg->carrier_config.ul_grid_size[cfg->ssb_config.scs_common.value].value;
|
fp->N_RB_UL = cfg->carrier_config.ul_grid_size[cfg->ssb_config.scs_common.value].value;
|
||||||
|
|
||||||
int Ncp = NFAPI_CP_NORMAL;
|
int Ncp = NFAPI_CP_NORMAL;
|
||||||
int mu = cfg->ssb_config.scs_common.value;
|
int mu = cfg->ssb_config.scs_common.value;
|
||||||
|
|
||||||
|
LOG_I(PHY,"Initializing frame parms for mu %d, N_RB %d, Ncp %d\n", mu, fp->N_RB_DL, Ncp);
|
||||||
LOG_I(PHY,"Initializing frame parms for mu %d, N_RB %d, Ncp %d\n",mu, fp->N_RB_DL, Ncp);
|
|
||||||
|
|
||||||
if (Ncp == NFAPI_CP_EXTENDED)
|
if (Ncp == NFAPI_CP_EXTENDED)
|
||||||
AssertFatal(mu == NR_MU_2,"Invalid cyclic prefix %d for numerology index %d\n", Ncp, mu);
|
AssertFatal(mu == NR_MU_2,"Invalid cyclic prefix %d for numerology index %d\n", Ncp, mu);
|
||||||
@@ -266,8 +264,7 @@ int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg,
|
|||||||
for (int p=0; p<num_tx_ant; p++)
|
for (int p=0; p<num_tx_ant; p++)
|
||||||
fp->N_ssb += ((fp->L_ssb >> (63-p)) & 0x01);
|
fp->N_ssb += ((fp->L_ssb >> (63-p)) & 0x01);
|
||||||
|
|
||||||
return 0;
|
fp->print_ue_help_cmdline_log = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
|
int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
#include "PHY/defs_nr_UE.h"
|
#include "PHY/defs_nr_UE.h"
|
||||||
|
|
||||||
int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp,uint8_t i_ssb);
|
int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp,uint8_t i_ssb);
|
||||||
int nr_init_frame_parms(nfapi_nr_config_request_scf_t *config, NR_DL_FRAME_PARMS *frame_parms);
|
void nr_init_frame_parms(nfapi_nr_config_request_scf_t *config, NR_DL_FRAME_PARMS *frame_parms);
|
||||||
int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms, fapi_nr_config_request_t *config, uint16_t nr_band);
|
int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms, fapi_nr_config_request_t *config, uint16_t nr_band);
|
||||||
void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, uint64_t downlink_frequency, int32_t uplink_frequency_offset, uint8_t mu, uint16_t nr_band);
|
void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, uint64_t downlink_frequency, int32_t uplink_frequency_offset, uint8_t mu, uint16_t nr_band);
|
||||||
void nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *frame_parms, uint64_t sidelink_frequency, uint16_t nr_band);
|
void nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *frame_parms, uint64_t sidelink_frequency, uint16_t nr_band);
|
||||||
|
|||||||
@@ -261,6 +261,7 @@ struct NR_DL_FRAME_PARMS {
|
|||||||
uint32_t ofdm_offset_divisor;
|
uint32_t ofdm_offset_divisor;
|
||||||
uint16_t tdd_slot_config;
|
uint16_t tdd_slot_config;
|
||||||
uint8_t tdd_period;
|
uint8_t tdd_period;
|
||||||
|
bool print_ue_help_cmdline_log;
|
||||||
};
|
};
|
||||||
|
|
||||||
// PRS config structures
|
// PRS config structures
|
||||||
|
|||||||
@@ -45,26 +45,25 @@
|
|||||||
|
|
||||||
extern uint8_t nfapi_mode;
|
extern uint8_t nfapi_mode;
|
||||||
|
|
||||||
void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_dl_tti_ssb_pdu ssb_pdu) {
|
void nr_common_signal_procedures(PHY_VARS_gNB *gNB,int frame,int slot, nfapi_nr_dl_tti_ssb_pdu ssb_pdu)
|
||||||
|
{
|
||||||
NR_DL_FRAME_PARMS *fp=&gNB->frame_parms;
|
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
||||||
nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
|
nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
|
||||||
c16_t **txdataF = gNB->common_vars.txdataF;
|
c16_t **txdataF = gNB->common_vars.txdataF;
|
||||||
uint8_t ssb_index, n_hf;
|
uint8_t n_hf;
|
||||||
uint16_t ssb_start_symbol;
|
|
||||||
int txdataF_offset = slot*fp->samples_per_slot_wCP;
|
int txdataF_offset = slot*fp->samples_per_slot_wCP;
|
||||||
uint16_t slots_per_hf = (fp->slots_per_frame)>>1;
|
uint16_t slots_per_hf = (fp->slots_per_frame) >> 1;
|
||||||
|
|
||||||
if (slot<slots_per_hf)
|
if (slot<slots_per_hf)
|
||||||
n_hf=0;
|
n_hf=0;
|
||||||
else
|
else
|
||||||
n_hf=1;
|
n_hf=1;
|
||||||
|
|
||||||
ssb_index = ssb_pdu.ssb_pdu_rel15.SsbBlockIndex;
|
uint8_t ssb_index = ssb_pdu.ssb_pdu_rel15.SsbBlockIndex;
|
||||||
LOG_D(PHY,"common_signal_procedures: frame %d, slot %d ssb index %d\n",frame,slot,ssb_index);
|
LOG_D(PHY,"common_signal_procedures: frame %d, slot %d ssb index %d\n", frame, slot, ssb_index);
|
||||||
|
|
||||||
int ssb_start_symbol_abs = nr_get_ssb_start_symbol(fp,ssb_index); // computing the starting symbol for current ssb
|
int ssb_start_symbol_abs = nr_get_ssb_start_symbol(fp, ssb_index); // computing the starting symbol for current ssb
|
||||||
ssb_start_symbol = ssb_start_symbol_abs % fp->symbols_per_slot; // start symbol wrt slot
|
uint16_t ssb_start_symbol = ssb_start_symbol_abs % fp->symbols_per_slot; // start symbol wrt slot
|
||||||
|
|
||||||
// Setting the first subcarrier
|
// Setting the first subcarrier
|
||||||
// 3GPP TS 38.211 sections 7.4.3.1 and 4.4.4.2
|
// 3GPP TS 38.211 sections 7.4.3.1 and 4.4.4.2
|
||||||
@@ -77,6 +76,27 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_
|
|||||||
const int sc_offset =
|
const int sc_offset =
|
||||||
(fp->freq_range == nr_FR1) ? ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset >> scs : ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset;
|
(fp->freq_range == nr_FR1) ? ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset >> scs : ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset;
|
||||||
fp->ssb_start_subcarrier = (12 * prb_offset + sc_offset);
|
fp->ssb_start_subcarrier = (12 * prb_offset + sc_offset);
|
||||||
|
|
||||||
|
if (fp->print_ue_help_cmdline_log && get_softmodem_params()->sa) {
|
||||||
|
fp->print_ue_help_cmdline_log = false;
|
||||||
|
if (fp->dl_CarrierFreq != fp->ul_CarrierFreq)
|
||||||
|
LOG_A(PHY,
|
||||||
|
"Command line parameters for the UE: -C %lu --CO %lu -r %d --numerology %d --band %d --ssb %d\n",
|
||||||
|
fp->dl_CarrierFreq,
|
||||||
|
fp->dl_CarrierFreq - fp->ul_CarrierFreq,
|
||||||
|
fp->N_RB_DL,
|
||||||
|
scs,
|
||||||
|
fp->nr_band,
|
||||||
|
fp->ssb_start_subcarrier);
|
||||||
|
else
|
||||||
|
LOG_A(PHY,
|
||||||
|
"Command line parameters for the UE: -C %lu -r %d --numerology %d --band %d --ssb %d\n",
|
||||||
|
fp->dl_CarrierFreq,
|
||||||
|
fp->N_RB_DL,
|
||||||
|
scs,
|
||||||
|
fp->nr_band,
|
||||||
|
fp->ssb_start_subcarrier);
|
||||||
|
}
|
||||||
LOG_D(PHY,
|
LOG_D(PHY,
|
||||||
"ssbOffsetPointA %d SSB SsbSubcarrierOffset %d prb_offset %d sc_offset %d scs %d ssb_start_subcarrier %d\n",
|
"ssbOffsetPointA %d SSB SsbSubcarrierOffset %d prb_offset %d sc_offset %d scs %d ssb_start_subcarrier %d\n",
|
||||||
ssb_pdu.ssb_pdu_rel15.ssbOffsetPointA,
|
ssb_pdu.ssb_pdu_rel15.ssbOffsetPointA,
|
||||||
|
|||||||
Reference in New Issue
Block a user