rrc/phy/nr: calculate tuning freq of NR carrier from RRC signaling params

skip initial tuning to hard-coded NR frequency and use RRC-provided
values to calculate center frequency
master
Andre Puschmann 4 years ago
parent 6e79ae67aa
commit 4dd17aee45

@ -280,6 +280,7 @@ typedef struct SRSRAN_API {
uint32_t pci; uint32_t pci;
uint32_t absolute_frequency_ssb; uint32_t absolute_frequency_ssb;
uint32_t absolute_frequency_point_a; uint32_t absolute_frequency_point_a;
uint32_t offset_to_carrier; ///< Offset between point A and the lowest subcarrier of the lowest RB
srsran_subcarrier_spacing_t scs; srsran_subcarrier_spacing_t scs;
uint32_t nof_prb; ///< @brief See TS 38.101-1 Table 5.3.2-1 for more details uint32_t nof_prb; ///< @brief See TS 38.101-1 Table 5.3.2-1 for more details
uint32_t start; uint32_t start;

@ -1182,13 +1182,11 @@ bool make_phy_carrier_cfg(const freq_info_dl_s& asn1_freq_info_dl, srsran_carrie
asn1::log_warning("Option absolute_freq_ssb not present"); asn1::log_warning("Option absolute_freq_ssb not present");
return false; return false;
} }
uint32_t absolute_frequency_point_a = asn1_freq_info_dl.absolute_freq_point_a;
if (asn1_freq_info_dl.scs_specific_carrier_list.size() != 1) { if (asn1_freq_info_dl.scs_specific_carrier_list.size() != 1) {
asn1::log_warning("Option absolute_freq_ssb not present"); asn1::log_warning("Option absolute_freq_ssb not present");
return false; return false;
} }
uint32_t nof_prb = asn1_freq_info_dl.scs_specific_carrier_list[0].carrier_bw;
srsran_subcarrier_spacing_t scs = srsran_subcarrier_spacing_15kHz; srsran_subcarrier_spacing_t scs = srsran_subcarrier_spacing_15kHz;
switch (asn1_freq_info_dl.scs_specific_carrier_list[0].subcarrier_spacing) { switch (asn1_freq_info_dl.scs_specific_carrier_list[0].subcarrier_spacing) {
case subcarrier_spacing_opts::options::khz15: case subcarrier_spacing_opts::options::khz15:
@ -1211,8 +1209,9 @@ bool make_phy_carrier_cfg(const freq_info_dl_s& asn1_freq_info_dl, srsran_carrie
} }
// As the carrier structure requires parameters from different objects, set fields separately // As the carrier structure requires parameters from different objects, set fields separately
out_carrier_nr->absolute_frequency_ssb = absolute_frequency_ssb; out_carrier_nr->absolute_frequency_ssb = absolute_frequency_ssb;
out_carrier_nr->absolute_frequency_point_a = absolute_frequency_point_a; out_carrier_nr->absolute_frequency_point_a = asn1_freq_info_dl.absolute_freq_point_a;
out_carrier_nr->nof_prb = nof_prb; out_carrier_nr->offset_to_carrier = asn1_freq_info_dl.scs_specific_carrier_list[0].offset_to_carrier;
out_carrier_nr->nof_prb = asn1_freq_info_dl.scs_specific_carrier_list[0].carrier_bw;
out_carrier_nr->scs = scs; out_carrier_nr->scs = scs;
return true; return true;
} }

@ -18,6 +18,8 @@ int bands_test_nr()
srsran::srsran_band_helper bands; srsran::srsran_band_helper bands;
TESTASSERT(bands.nr_arfcn_to_freq(632628) == 3489.42e6); TESTASSERT(bands.nr_arfcn_to_freq(632628) == 3489.42e6);
TESTASSERT(bands.nr_arfcn_to_freq(633928) == 3508.92e6); // default refPointA
TESTASSERT(bands.nr_arfcn_to_freq(634240) == 3513.6e6); // default ARFCN with freq divisible by 11.52 MHz
const uint32_t max_valid_nr_arfcn = 3279165; const uint32_t max_valid_nr_arfcn = 3279165;

@ -21,6 +21,7 @@ static srsran_carrier_nr_t carrier = {
1, // pci 1, // pci
0, // absolute_frequency_ssb 0, // absolute_frequency_ssb
0, // absolute_frequency_point_a 0, // absolute_frequency_point_a
0, // offset_to_carrier
srsran_subcarrier_spacing_15kHz, // scs srsran_subcarrier_spacing_15kHz, // scs
50, // nof_prb 50, // nof_prb
0, // start 0, // start

@ -20,11 +20,11 @@
#include <strings.h> #include <strings.h>
#include <unistd.h> #include <unistd.h>
static srsran_carrier_nr_t carrier = { static srsran_carrier_nr_t carrier = {
1, // pci 1, // pci
0, // absolute_frequency_ssb 0, // absolute_frequency_ssb
0, // absolute_frequency_point_a 0, // absolute_frequency_point_a
0, // offset_to_carrier
srsran_subcarrier_spacing_15kHz, // scs srsran_subcarrier_spacing_15kHz, // scs
50, // nof_prb 50, // nof_prb
0, // start 0, // start

@ -19,6 +19,7 @@ static srsran_carrier_nr_t carrier = {
1, // pci 1, // pci
0, // absolute_frequency_ssb 0, // absolute_frequency_ssb
0, // absolute_frequency_point_a 0, // absolute_frequency_point_a
0, // offset_to_carrier
srsran_subcarrier_spacing_15kHz, // scs srsran_subcarrier_spacing_15kHz, // scs
50, // nof_prb 50, // nof_prb
0, // start 0, // start

@ -24,13 +24,13 @@ static srsran_carrier_nr_t carrier = {
1, // pci 1, // pci
0, // absolute_frequency_ssb 0, // absolute_frequency_ssb
0, // absolute_frequency_point_a 0, // absolute_frequency_point_a
0, // offset_to_carrier
srsran_subcarrier_spacing_15kHz, // scs srsran_subcarrier_spacing_15kHz, // scs
SRSRAN_MAX_PRB_NR, // nof_prb SRSRAN_MAX_PRB_NR, // nof_prb
0, // start 0, // start
1 // max_mimo_layers 1 // max_mimo_layers
}; };
static uint32_t n_prb = 0; // Set to 0 for steering static uint32_t n_prb = 0; // Set to 0 for steering
static uint32_t mcs = 30; // Set to 30 for steering static uint32_t mcs = 30; // Set to 30 for steering
static srsran_sch_cfg_nr_t pdsch_cfg = {}; static srsran_sch_cfg_nr_t pdsch_cfg = {};

@ -26,6 +26,7 @@ static srsran_carrier_nr_t carrier = {
1, // pci 1, // pci
0, // absolute_frequency_ssb 0, // absolute_frequency_ssb
0, // absolute_frequency_point_a 0, // absolute_frequency_point_a
0, // offset_to_carrier
srsran_subcarrier_spacing_15kHz, // scs srsran_subcarrier_spacing_15kHz, // scs
6, // nof_prb 6, // nof_prb
0, // start 0, // start

@ -23,6 +23,7 @@ static srsran_carrier_nr_t carrier = {
1, // pci 1, // pci
0, // absolute_frequency_ssb 0, // absolute_frequency_ssb
0, // absolute_frequency_point_a 0, // absolute_frequency_point_a
0, // offset_to_carrier
srsran_subcarrier_spacing_15kHz, // scs srsran_subcarrier_spacing_15kHz, // scs
SRSRAN_MAX_PRB_NR, // nof_prb SRSRAN_MAX_PRB_NR, // nof_prb
0, // start 0, // start

@ -22,6 +22,7 @@ static srsran_carrier_nr_t carrier = {
1, // pci 1, // pci
0, // absolute_frequency_ssb 0, // absolute_frequency_ssb
0, // absolute_frequency_point_a 0, // absolute_frequency_point_a
0, // offset_to_carrier
srsran_subcarrier_spacing_15kHz, // scs srsran_subcarrier_spacing_15kHz, // scs
SRSRAN_MAX_PRB_NR, // nof_prb SRSRAN_MAX_PRB_NR, // nof_prb
0, // start 0, // start

@ -23,6 +23,7 @@ static srsran_carrier_nr_t carrier = {
501, // pci 501, // pci
0, // absolute_frequency_ssb 0, // absolute_frequency_ssb
0, // absolute_frequency_point_a 0, // absolute_frequency_point_a
0, // offset_to_carrier
srsran_subcarrier_spacing_15kHz, // scs srsran_subcarrier_spacing_15kHz, // scs
52, // nof_prb 52, // nof_prb
0, // start 0, // start

@ -13,6 +13,7 @@
#include <string> #include <string>
#include <sys/mman.h> #include <sys/mman.h>
#include "srsran/common/band_helper.h"
#include "srsran/common/standard_streams.h" #include "srsran/common/standard_streams.h"
#include "srsran/srsran.h" #include "srsran/srsran.h"
#include "srsue/hdr/phy/phy.h" #include "srsue/hdr/phy/phy.h"
@ -634,6 +635,22 @@ void phy::set_earfcn(std::vector<uint32_t> earfcns)
bool phy::set_config(const srsran::phy_cfg_nr_t& cfg) bool phy::set_config(const srsran::phy_cfg_nr_t& cfg)
{ {
// Derive actual RF frequencies for NR carrier
double abs_freq_point_a_freq = srsran::srsran_band_helper().nr_arfcn_to_freq(cfg.carrier.absolute_frequency_point_a);
// for FR1 unit of resources blocks for freq calc is always 180kHz regardless for actual SCS of carrier
// TODO: add offset_to_carrier
double carrier_center_freq =
abs_freq_point_a_freq +
(cfg.carrier.nof_prb / 2 * SRSRAN_SUBC_SPACING_NR(srsran_subcarrier_spacing_t::srsran_subcarrier_spacing_15kHz) *
SRSRAN_NRE);
for (uint32_t i = 0; i < common.args->nof_nr_carriers; i++) {
logger_phy.info("Tuning channel %d to %.2f GHz", i + common.args->nof_lte_carriers, carrier_center_freq / 1e6);
radio->set_rx_freq(i + common.args->nof_lte_carriers, carrier_center_freq);
radio->set_tx_freq(i + common.args->nof_lte_carriers, carrier_center_freq);
}
return nr_workers.set_config(cfg); return nr_workers.set_config(cfg);
} }

@ -861,11 +861,6 @@ bool sync::set_frequency()
radio_h->set_rx_freq(0, set_dl_freq); radio_h->set_rx_freq(0, set_dl_freq);
radio_h->set_tx_freq(0, set_ul_freq); radio_h->set_tx_freq(0, set_ul_freq);
for (uint32_t i = 0; i < worker_com->args->nof_nr_carriers; i++) {
radio_h->set_rx_freq(i + worker_com->args->nof_lte_carriers, worker_com->args->nr_freq_hz);
radio_h->set_tx_freq(i + worker_com->args->nof_lte_carriers, worker_com->args->nr_freq_hz);
}
ul_dl_factor = (float)(set_ul_freq / set_dl_freq); ul_dl_factor = (float)(set_ul_freq / set_dl_freq);
srsran_ue_sync_reset(&ue_sync); srsran_ue_sync_reset(&ue_sync);

@ -12,7 +12,6 @@
#include "srsue/hdr/ue.h" #include "srsue/hdr/ue.h"
#include "srsran/build_info.h" #include "srsran/build_info.h"
#include "srsran/common/band_helper.h"
#include "srsran/common/string_helpers.h" #include "srsran/common/string_helpers.h"
#include "srsran/radio/radio.h" #include "srsran/radio/radio.h"
#include "srsran/radio/radio_null.h" #include "srsran/radio/radio_null.h"
@ -251,8 +250,6 @@ int ue::parse_args(const all_args_t& args_)
} }
} }
srsran_band_helper bands_helper;
// populate NR DL ARFCNs // populate NR DL ARFCNs
if (args.phy.nof_nr_carriers > 0) { if (args.phy.nof_nr_carriers > 0) {
if (not args.stack.rrc_nr.supported_bands_nr_str.empty()) { if (not args.stack.rrc_nr.supported_bands_nr_str.empty()) {

Loading…
Cancel
Save