srsue,rrc_nr: expose main carrier parameters as config

* remove hard-coded ARFCN, SCS, etc
* use PCI deteceted in cell search for carrier config
master
Andre Puschmann 3 years ago
parent 8464a6ed63
commit 7c63da9e4d

@ -27,7 +27,6 @@ struct rrc_nr_args_t {
uint32_t dl_nr_arfcn; uint32_t dl_nr_arfcn;
uint32_t ssb_nr_arfcn; uint32_t ssb_nr_arfcn;
uint32_t nof_prb; uint32_t nof_prb;
uint32_t pci;
srsran_subcarrier_spacing_t scs; srsran_subcarrier_spacing_t scs;
srsran_subcarrier_spacing_t ssb_scs; srsran_subcarrier_spacing_t ssb_scs;
std::string log_level; std::string log_level;

@ -60,6 +60,7 @@ string config_file;
static int parse_args(all_args_t* args, int argc, char* argv[]) static int parse_args(all_args_t* args, int argc, char* argv[])
{ {
bool use_standard_lte_rates = false; bool use_standard_lte_rates = false;
std::string scs_khz, ssb_scs_khz; // temporary value to store integer
// Command line only options // Command line only options
bpo::options_description general("General options"); bpo::options_description general("General options");
@ -122,9 +123,14 @@ static int parse_args(all_args_t* args, int argc, char* argv[])
("rat.eutra.ul_freq", bpo::value<float>(&args->phy.ul_freq)->default_value(-1), "Uplink Frequency (if positive overrides EARFCN)") ("rat.eutra.ul_freq", bpo::value<float>(&args->phy.ul_freq)->default_value(-1), "Uplink Frequency (if positive overrides EARFCN)")
("rat.eutra.nof_carriers", bpo::value<uint32_t>(&args->phy.nof_lte_carriers)->default_value(1), "Number of carriers") ("rat.eutra.nof_carriers", bpo::value<uint32_t>(&args->phy.nof_lte_carriers)->default_value(1), "Number of carriers")
("rat.nr.bands", bpo::value<string>(&args->stack.rrc_nr.supported_bands_nr_str)->default_value("78"), "Supported NR bands") ("rat.nr.bands", bpo::value<string>(&args->stack.rrc_nr.supported_bands_nr_str)->default_value("3"), "Supported NR bands")
("rat.nr.nof_carriers", bpo::value<uint32_t>(&args->phy.nof_nr_carriers)->default_value(0), "Number of NR carriers") ("rat.nr.nof_carriers", bpo::value<uint32_t>(&args->phy.nof_nr_carriers)->default_value(0), "Number of NR carriers")
("rat.nr.max_nof_prb", bpo::value<uint32_t>(&args->phy.nr_max_nof_prb)->default_value(52), "Maximum NR carrier bandwidth in PRB") ("rat.nr.max_nof_prb", bpo::value<uint32_t>(&args->phy.nr_max_nof_prb)->default_value(52), "Maximum NR carrier bandwidth in PRB")
("rat.nr.dl_nr_arfcn", bpo::value<uint32_t>(&args->stack.rrc_nr.dl_nr_arfcn)->default_value(368500), "DL ARFCN of NR cell")
("rat.nr.ssb_nr_arfcn", bpo::value<uint32_t>(&args->stack.rrc_nr.ssb_nr_arfcn)->default_value(368410), "SSB ARFCN of NR cell")
("rat.nr.nof_prb", bpo::value<uint32_t>(&args->stack.rrc_nr.nof_prb)->default_value(52), "Actual NR carrier bandwidth in PRB")
("rat.nr.scs", bpo::value<string>(&scs_khz)->default_value("15"), "PDSCH subcarrier spacing in kHz")
("rat.nr.ssb_scs", bpo::value<string>(&ssb_scs_khz)->default_value("15"), "SSB subcarrier spacing in kHz")
("rrc.feature_group", bpo::value<uint32_t>(&args->stack.rrc.feature_group)->default_value(0xe6041000), "Hex value of the featureGroupIndicators field in the" ("rrc.feature_group", bpo::value<uint32_t>(&args->stack.rrc.feature_group)->default_value(0xe6041000), "Hex value of the featureGroupIndicators field in the"
"UECapabilityInformation message. Default 0xe6041000") "UECapabilityInformation message. Default 0xe6041000")
@ -620,6 +626,14 @@ static int parse_args(all_args_t* args, int argc, char* argv[])
srsran_use_standard_symbol_size(use_standard_lte_rates); srsran_use_standard_symbol_size(use_standard_lte_rates);
args->stack.rrc_nr.scs = srsran_subcarrier_spacing_from_str(scs_khz.c_str());
args->stack.rrc_nr.ssb_scs = srsran_subcarrier_spacing_from_str(ssb_scs_khz.c_str());
if (args->stack.rrc_nr.scs == srsran_subcarrier_spacing_invalid ||
args->stack.rrc_nr.ssb_scs == srsran_subcarrier_spacing_invalid) {
cout << "Invalid subcarrier spacing config" << endl;
return SRSRAN_ERROR;
}
return SRSRAN_SUCCESS; return SRSRAN_SUCCESS;
} }

@ -89,7 +89,6 @@ int rrc_nr::init(phy_interface_rrc_nr* phy_,
phy_cfg.carrier.ssb_center_freq_hz = bands.nr_arfcn_to_freq(args.ssb_nr_arfcn); phy_cfg.carrier.ssb_center_freq_hz = bands.nr_arfcn_to_freq(args.ssb_nr_arfcn);
phy_cfg.carrier.nof_prb = args.nof_prb; phy_cfg.carrier.nof_prb = args.nof_prb;
phy_cfg.carrier.max_mimo_layers = 1; phy_cfg.carrier.max_mimo_layers = 1;
phy_cfg.carrier.pci = args.pci;
phy_cfg.carrier.scs = args.scs; phy_cfg.carrier.scs = args.scs;
phy_cfg.duplex.mode = bands.get_duplex_mode(bands.get_band_from_dl_arfcn(args.dl_nr_arfcn)); phy_cfg.duplex.mode = bands.get_duplex_mode(bands.get_band_from_dl_arfcn(args.dl_nr_arfcn));

@ -426,13 +426,13 @@ rrc_nr::cell_selection_proc::handle_cell_search_result(const rrc_interface_phy_n
// Transition to cell selection ignoring the cell search result // Transition to cell selection ignoring the cell search result
state = state_t::phy_cell_select; state = state_t::phy_cell_select;
// until cell selection is done, update PHY config to take the last found PCI
rrc_handle.phy_cfg.carrier.pci = result.pci;
phy_interface_rrc_nr::cell_select_args_t cs_args = {}; phy_interface_rrc_nr::cell_select_args_t cs_args = {};
cs_args.carrier = rrc_handle.phy_cfg.carrier; cs_args.carrier = rrc_handle.phy_cfg.carrier;
cs_args.ssb_cfg = rrc_handle.phy_cfg.get_ssb_cfg(); cs_args.ssb_cfg = rrc_handle.phy_cfg.get_ssb_cfg();
// until cell selection is done, update PHY config to take the last found PCI
rrc_handle.phy_cfg.carrier.pci = result.pci;
{ {
// Coreset0 configuration // Coreset0 configuration
srsran::phy_cfg_nr_t& phy_cfg = rrc_handle.phy_cfg; srsran::phy_cfg_nr_t& phy_cfg = rrc_handle.phy_cfg;

@ -278,14 +278,6 @@ int ue::parse_args(const all_args_t& args_)
// SA params // SA params
if (args.phy.nof_lte_carriers == 0 && args.phy.nof_nr_carriers == 1) { if (args.phy.nof_lte_carriers == 0 && args.phy.nof_nr_carriers == 1) {
// TODO: expose to UE config
args.stack.rrc_nr.dl_nr_arfcn = 368500;
args.stack.rrc_nr.ssb_nr_arfcn = 368410;
args.stack.rrc_nr.nof_prb = 52;
args.stack.rrc_nr.pci = 500;
args.stack.rrc_nr.scs = srsran_subcarrier_spacing_15kHz;
args.stack.rrc_nr.ssb_scs = srsran_subcarrier_spacing_15kHz;
// Update NAS-5G args // Update NAS-5G args
args.stack.nas_5g.ia5g = args.stack.nas.eia; args.stack.nas_5g.ia5g = args.stack.nas.eia;
args.stack.nas_5g.ea5g = args.stack.nas.eea; args.stack.nas_5g.ea5g = args.stack.nas.eea;

Loading…
Cancel
Save