rrc,gnb: move non-phy fields out of phy_cell_nr_t

master
Francisco Paisana 3 years ago
parent e9760f110a
commit e4a15c9c51

@ -133,7 +133,7 @@ bool fill_phy_ssb_cfg(const srsran_carrier_nr_t& carrier
void fill_ssb_pos_in_burst(const asn1::rrc_nr::serving_cell_cfg_common_sib_s& ssb_pos,
phy_cfg_nr_t::ssb_cfg_t* out_ssb);
bool fill_ssb_pattern_scs(const srsran_carrier_nr_t& carrier,
srsran_ssb_patern_t* pattern,
srsran_ssb_pattern_t* pattern,
srsran_subcarrier_spacing_t* ssb_scs);
bool fill_phy_ssb_cfg(const srsran_carrier_nr_t& carrier,
const asn1::rrc_nr::serving_cell_cfg_common_sib_s& serv_cell_cfg,

@ -80,7 +80,7 @@ public:
* @param scs SSB Subcarrier spacing
* @return The SSB pattern case if band and subcarrier spacing match, SRSRAN_SSB_PATTERN_INVALID otherwise
*/
static srsran_ssb_patern_t get_ssb_pattern(uint16_t band, srsran_subcarrier_spacing_t scs);
static srsran_ssb_pattern_t get_ssb_pattern(uint16_t band, srsran_subcarrier_spacing_t scs);
/**
* @brief Select the lower SSB subcarrier spacing valid for this band
@ -402,7 +402,7 @@ private:
struct nr_band_ss_raster {
uint16_t band;
srsran_subcarrier_spacing_t scs;
srsran_ssb_patern_t pattern;
srsran_ssb_pattern_t pattern;
uint32_t gscn_first;
uint32_t gscn_step;
uint32_t gscn_last;

@ -33,7 +33,7 @@ struct phy_cfg_nr_t {
uint32_t periodicity_ms = 0;
std::array<bool, SRSRAN_SSB_NOF_CANDIDATES> position_in_burst = {};
srsran_subcarrier_spacing_t scs = srsran_subcarrier_spacing_30kHz;
srsran_ssb_patern_t pattern = SRSRAN_SSB_PATTERN_A;
srsran_ssb_pattern_t pattern = SRSRAN_SSB_PATTERN_A;
};
srsran_duplex_config_nr_t duplex = {};

@ -301,7 +301,7 @@ public:
double center_freq_hz;
double ssb_freq_hz;
srsran_subcarrier_spacing_t ssb_scs;
srsran_ssb_patern_t ssb_pattern;
srsran_ssb_pattern_t ssb_pattern;
srsran_duplex_mode_t duplex_mode;
};

@ -349,7 +349,7 @@ typedef enum SRSRAN_API {
SRSRAN_SSB_PATTERN_D, // FR2, 120 kHz SCS
SRSRAN_SSB_PATTERN_E, // FR2, 240 kHz SCS
SRSRAN_SSB_PATTERN_INVALID,
} srsran_ssb_patern_t;
} srsran_ssb_pattern_t;
typedef enum SRSRAN_API {
SRSRAN_DUPLEX_MODE_FDD = 0, // Paired
@ -732,14 +732,14 @@ SRSRAN_API int srsran_coreset_to_str(srsran_coreset_t* coreset, char* str, uint3
* @param pattern
* @return a string describing the SSB pattern
*/
SRSRAN_API const char* srsran_ssb_pattern_to_str(srsran_ssb_patern_t pattern);
SRSRAN_API const char* srsran_ssb_pattern_to_str(srsran_ssb_pattern_t pattern);
/**
* @brief Convert string to SSB pattern
* @param str String to convert
* @return The pattern, SRSRAN_SSB_PATTERN_INVALID if string is invalid
*/
SRSRAN_API srsran_ssb_patern_t srsran_ssb_pattern_fom_str(const char* str);
SRSRAN_API srsran_ssb_pattern_t srsran_ssb_pattern_fom_str(const char* str);
/**
* @brief Compares if two NR carrier structures are equal

@ -61,7 +61,7 @@ typedef struct SRSRAN_API {
double center_freq_hz; ///< Base-band center frequency in Hz
double ssb_freq_hz; ///< SSB center frequency
srsran_subcarrier_spacing_t scs; ///< SSB configured Subcarrier spacing
srsran_ssb_patern_t pattern; ///< SSB pattern as defined in TS 38.313 section 4.1 Cell search
srsran_ssb_pattern_t pattern; ///< SSB pattern as defined in TS 38.313 section 4.1 Cell search
srsran_duplex_mode_t duplex_mode; ///< Set to true if the spectrum is paired (FDD)
uint32_t periodicity_ms; ///< SSB periodicity in ms
float beta_pss; ///< PSS power allocation

@ -1558,7 +1558,7 @@ void fill_ssb_pos_in_burst(const asn1::rrc_nr::serving_cell_cfg_common_sib_s& cf
}
bool fill_ssb_pattern_scs(const srsran_carrier_nr_t& carrier,
srsran_ssb_patern_t* pattern,
srsran_ssb_pattern_t* pattern,
srsran_subcarrier_spacing_t* ssb_scs)
{
srsran::srsran_band_helper bands;

@ -166,7 +166,7 @@ uint32_t srsran_band_helper::get_abs_freq_ssb_arfcn(uint16_t
return find_lower_bound_abs_freq_ssb(band, scs, freq_point_a_hz + coreset0_offset_hz);
}
srsran_ssb_patern_t srsran_band_helper::get_ssb_pattern(uint16_t band, srsran_subcarrier_spacing_t scs)
srsran_ssb_pattern_t srsran_band_helper::get_ssb_pattern(uint16_t band, srsran_subcarrier_spacing_t scs)
{
// Look for the given band and SCS
for (const nr_band_ss_raster& ss_raster : nr_band_ss_raster_table) {

@ -775,7 +775,7 @@ int srsran_coreset0_ssb_offset(uint32_t idx, srsran_subcarrier_spacing_t ssb_scs
return entry->offset_rb;
}
const char* srsran_ssb_pattern_to_str(srsran_ssb_patern_t pattern)
const char* srsran_ssb_pattern_to_str(srsran_ssb_pattern_t pattern)
{
switch (pattern) {
case SRSRAN_SSB_PATTERN_A:
@ -795,7 +795,7 @@ const char* srsran_ssb_pattern_to_str(srsran_ssb_patern_t pattern)
return "Invalid";
}
srsran_ssb_patern_t srsran_ssb_pattern_fom_str(const char* str)
srsran_ssb_pattern_t srsran_ssb_pattern_fom_str(const char* str)
{
if (str == NULL) {
return SRSRAN_SSB_PATTERN_INVALID;

@ -29,7 +29,7 @@ static srsran_subcarrier_spacing_t carrier_scs = srsran_subcarrier_spacing_1
static double carrier_freq_hz = 3.5e9 + 960e3;
static srsran_subcarrier_spacing_t ssb_scs = srsran_subcarrier_spacing_30kHz;
static double ssb_freq_hz = 3.5e9;
static srsran_ssb_patern_t ssb_pattern = SRSRAN_SSB_PATTERN_A;
static srsran_ssb_pattern_t ssb_pattern = SRSRAN_SSB_PATTERN_A;
// Channel parameters
static cf_t wideband_gain = 1.0f + 0.5 * I;

@ -20,7 +20,7 @@
#include <stdlib.h>
// NR parameters
static srsran_ssb_patern_t ssb_pattern = SRSRAN_SSB_PATTERN_C;
static srsran_ssb_pattern_t ssb_pattern = SRSRAN_SSB_PATTERN_C;
static srsran_subcarrier_spacing_t ssb_scs = srsran_subcarrier_spacing_30kHz;
static srsran_duplex_mode_t duplex_mode = SRSRAN_DUPLEX_MODE_TDD;

@ -25,7 +25,7 @@ static srsran_subcarrier_spacing_t carrier_scs = srsran_subcarrier_spacing_1
static double carrier_freq_hz = 3.5e9 + 960e3;
static srsran_subcarrier_spacing_t ssb_scs = srsran_subcarrier_spacing_30kHz;
static double ssb_freq_hz = 3.5e9;
static srsran_ssb_patern_t ssb_pattern = SRSRAN_SSB_PATTERN_A;
static srsran_ssb_pattern_t ssb_pattern = SRSRAN_SSB_PATTERN_A;
static uint32_t ssb_idx = 0; // SSB candidate index to test
static uint32_t pci = 123; // N_id

@ -24,7 +24,7 @@ static srsran_subcarrier_spacing_t carrier_scs = srsran_subcarrier_spacing_1
static double carrier_freq_hz = 3.5e9 + 960e3;
static srsran_subcarrier_spacing_t ssb_scs = srsran_subcarrier_spacing_30kHz;
static double ssb_freq_hz = 3.5e9;
static srsran_ssb_patern_t ssb_pattern = SRSRAN_SSB_PATTERN_A;
static srsran_ssb_pattern_t ssb_pattern = SRSRAN_SSB_PATTERN_A;
// Channel parameters
static int32_t delay_n = 2;

@ -27,7 +27,7 @@ static srsran_subcarrier_spacing_t carrier_scs = srsran_subcarrier_spaci
static double center_frequency_hz = 3.5e9;
static srsran_subcarrier_spacing_t ssb_scs = srsran_subcarrier_spacing_15kHz;
static double ssb_frequency_hz = 3.5e9 - 960e3;
static srsran_ssb_patern_t ssb_pattern = SRSRAN_SSB_PATTERN_C;
static srsran_ssb_pattern_t ssb_pattern = SRSRAN_SSB_PATTERN_C;
static srsran_duplex_mode_t duplex_mode = SRSRAN_DUPLEX_MODE_TDD;
// Test and channel parameters

@ -122,7 +122,7 @@ public:
cc_idx -= cell_list_lte.size();
if (cc_idx < cell_list_nr.size()) {
ret = cell_list_nr[cc_idx].ul_freq_hz;
ret = cell_list_nr[cc_idx].carrier.ul_center_frequency_hz;
}
return ret;
@ -137,7 +137,7 @@ public:
cc_idx -= cell_list_lte.size();
if (cc_idx < cell_list_nr.size()) {
ret = cell_list_nr[cc_idx].dl_freq_hz;
ret = cell_list_nr[cc_idx].carrier.dl_center_frequency_hz;
}
return ret;

@ -1007,7 +1007,7 @@ static int parse_nr_cell_list(all_args_t* args, rrc_nr_cfg_t* rrc_cfg_nr, rrc_cf
parse_opt_field(cell_cfg.phy_cell.rf_port, cellroot, "rf_port");
HANDLEPARSERCODE(parse_required_field(cell_cfg.phy_cell.carrier.pci, cellroot, "pci"));
HANDLEPARSERCODE(parse_required_field(cell_cfg.phy_cell.cell_id, cellroot, "cell_id"));
HANDLEPARSERCODE(parse_required_field(cell_cfg.phy_cell.root_seq_idx, cellroot, "root_seq_idx"));
HANDLEPARSERCODE(parse_required_field(cell_cfg.prach_root_seq_idx, cellroot, "root_seq_idx"));
HANDLEPARSERCODE(parse_required_field(cell_cfg.tac, cellroot, "tac"));
cell_cfg.phy_cell.carrier.pci = cell_cfg.phy_cell.carrier.pci % SRSRAN_NOF_NID_NR;
@ -1594,8 +1594,7 @@ int set_derived_args_nr(all_args_t* args_, rrc_nr_cfg_t* rrc_nr_cfg_, phy_cfg_t*
// phy_cell_cfg.root_seq_idx = cfg.root_seq_idx;
// PDSCH
cfg.phy_cell.pdsch.rs_power = phy_cfg_->pdsch_cnfg.ref_sig_pwr;
cfg.phy_cell.pdsch.p_b = phy_cfg_->pdsch_cnfg.p_b;
cfg.pdsch_rs_power = phy_cfg_->pdsch_cnfg.ref_sig_pwr;
}
rrc_nr_cfg_->enb_id = args_->enb.enb_id;
rrc_nr_cfg_->mcc = args_->stack.s1ap.mcc;

@ -19,16 +19,10 @@
namespace srsenb {
struct phy_cell_cfg_nr_t {
srsran_carrier_nr_t carrier;
uint32_t rf_port;
uint32_t cell_id;
double dl_freq_hz;
double ul_freq_hz;
uint32_t root_seq_idx;
uint32_t num_ra_preambles;
float gain_db;
srsran_pdsch_cfg_t pdsch = {};
srsran_prach_cfg_t prach = {};
srsran_carrier_nr_t carrier;
uint32_t rf_port;
uint32_t cell_id;
float gain_db;
bool dl_measure;
};

@ -25,19 +25,22 @@ namespace srsenb {
struct rrc_cell_cfg_nr_t {
phy_cell_cfg_nr_t phy_cell; // already contains all PHY-related parameters (i.e. RF port, PCI, etc.)
uint32_t tac; // Tracking area code
uint32_t dl_arfcn; // DL freq already included in phy_cell
uint32_t ul_arfcn; // UL freq also in phy_cell
uint32_t dl_arfcn; // DL freq already included in carrier
uint32_t ul_arfcn; // UL freq also in carrier
uint32_t dl_absolute_freq_point_a; // derived from DL ARFCN
uint32_t ul_absolute_freq_point_a; // derived from UL ARFCN
uint32_t band;
uint32_t prach_root_seq_idx;
uint32_t num_ra_preambles;
uint32_t coreset0_idx; // Table 13-{1,...15} row index
srsran_duplex_mode_t duplex_mode;
double ssb_freq_hz;
uint32_t ssb_absolute_freq_point; // derived from DL ARFCN (SSB arfcn)
srsran_subcarrier_spacing_t ssb_scs;
srsran_ssb_patern_t ssb_pattern;
srsran_ssb_pattern_t ssb_pattern;
asn1::rrc_nr::pdcch_cfg_common_s pdcch_cfg_common;
asn1::rrc_nr::pdcch_cfg_s pdcch_cfg_ded;
int8_t pdsch_rs_power;
};
typedef std::vector<rrc_cell_cfg_nr_t> rrc_cell_list_nr_t;

@ -32,7 +32,7 @@ public:
srsran::unique_byte_buffer_t packed_sib1;
asn1::rrc_nr::subcarrier_spacing_e ssb_scs;
srsran_ssb_patern_t ssb_pattern;
srsran_ssb_pattern_t ssb_pattern;
double ssb_center_freq_hz;
double dl_freq_hz;
bool is_standalone;

@ -813,21 +813,21 @@ int fill_rach_cfg_common(const rrc_nr_cfg_t& cfg, uint32_t cc, rach_cfg_common_s
rach.rach_cfg_generic.ra_resp_win.value = rach_cfg_generic_s::ra_resp_win_opts::sl10;
// totalNumberOfRA-Preambles
if (cfg.cell_list[cc].phy_cell.num_ra_preambles != 64) {
if (cfg.cell_list[cc].num_ra_preambles != 64) {
rach.total_nof_ra_preambs_present = true;
rach.total_nof_ra_preambs = cfg.cell_list[cc].phy_cell.num_ra_preambles;
rach.total_nof_ra_preambs = cfg.cell_list[cc].num_ra_preambles;
}
// ssb-perRACH-OccasionAndCB-PreamblesPerSSB
rach.ssb_per_rach_occasion_and_cb_preambs_per_ssb_present = true;
if (not asn1::number_to_enum(rach.ssb_per_rach_occasion_and_cb_preambs_per_ssb.set_one(),
cfg.cell_list[cc].phy_cell.num_ra_preambles)) {
get_logger(cfg).error("Invalid number of RA preambles=%d", cfg.cell_list[cc].phy_cell.num_ra_preambles);
cfg.cell_list[cc].num_ra_preambles)) {
get_logger(cfg).error("Invalid number of RA preambles=%d", cfg.cell_list[cc].num_ra_preambles);
return -1;
}
rach.ra_contention_resolution_timer.value = rach_cfg_common_s::ra_contention_resolution_timer_opts::sf64;
rach.prach_root_seq_idx.set_l839() = cfg.cell_list[cc].phy_cell.root_seq_idx;
rach.prach_root_seq_idx.set_l839() = cfg.cell_list[cc].prach_root_seq_idx;
rach.restricted_set_cfg.value = rach_cfg_common_s::restricted_set_cfg_opts::unrestricted_set;
return SRSRAN_SUCCESS;
@ -865,7 +865,7 @@ int fill_serv_cell_common_from_enb_cfg(const rrc_nr_cfg_t& cfg, uint32_t cc, ser
{
auto& cell_cfg = cfg.cell_list.at(cc);
serv_common.ss_pbch_block_pwr = cell_cfg.phy_cell.pdsch.rs_power;
serv_common.ss_pbch_block_pwr = cell_cfg.pdsch_rs_power;
serv_common.n_timing_advance_offset_present = true;
serv_common.n_timing_advance_offset = serving_cell_cfg_common_s::n_timing_advance_offset_opts::n0;
serv_common.n_timing_advance_offset_present = true;
@ -1230,7 +1230,7 @@ int fill_serv_cell_cfg_common_sib(const rrc_nr_cfg_t& cfg, uint32_t cc, serving_
fill_tdd_ul_dl_config_common(cell_cfg, out.tdd_ul_dl_cfg_common);
}
out.ss_pbch_block_pwr = cell_cfg.phy_cell.pdsch.rs_power;
out.ss_pbch_block_pwr = cell_cfg.pdsch_rs_power;
return SRSRAN_SUCCESS;
}

@ -109,14 +109,6 @@ void generate_default_nr_phy_cell(phy_cell_cfg_nr_t& phy_cell)
phy_cell.carrier.scs = srsran_subcarrier_spacing_15kHz;
phy_cell.carrier.nof_prb = 52;
phy_cell.carrier.max_mimo_layers = 1;
phy_cell.dl_freq_hz = 0; // auto set
phy_cell.ul_freq_hz = 0;
phy_cell.num_ra_preambles = 8;
// PDSCH
phy_cell.pdsch.rs_power = 0;
phy_cell.pdsch.p_b = 0;
}
/// Generate default rrc nr cell configuration
@ -125,6 +117,7 @@ void generate_default_nr_cell(rrc_cell_cfg_nr_t& cell)
cell = {};
cell.coreset0_idx = 6;
cell.ssb_absolute_freq_point = 0; // auto derived
cell.num_ra_preambles = 8;
generate_default_nr_phy_cell(cell.phy_cell);
// PDCCH
@ -208,25 +201,21 @@ int derive_phy_cell_freq_params(uint32_t dl_arfcn, uint32_t ul_arfcn, phy_cell_c
srsran::srsran_band_helper band_helper;
// derive DL freq from ARFCN
if (phy_cell.dl_freq_hz == 0) {
phy_cell.dl_freq_hz = band_helper.nr_arfcn_to_freq(dl_arfcn);
if (phy_cell.carrier.dl_center_frequency_hz == 0) {
phy_cell.carrier.dl_center_frequency_hz = band_helper.nr_arfcn_to_freq(dl_arfcn);
}
// derive UL freq from ARFCN
if (phy_cell.ul_freq_hz == 0) {
if (phy_cell.carrier.ul_center_frequency_hz == 0) {
// auto-detect UL frequency
if (ul_arfcn == 0) {
// derive UL ARFCN from given DL ARFCN
ul_arfcn = band_helper.get_ul_arfcn_from_dl_arfcn(dl_arfcn);
ERROR_IF_NOT(ul_arfcn > 0, "Can't derive UL ARFCN from DL ARFCN %d", dl_arfcn);
}
phy_cell.ul_freq_hz = band_helper.nr_arfcn_to_freq(ul_arfcn);
phy_cell.carrier.ul_center_frequency_hz = band_helper.nr_arfcn_to_freq(ul_arfcn);
}
// copy center frequencies
phy_cell.carrier.dl_center_frequency_hz = phy_cell.dl_freq_hz;
phy_cell.carrier.ul_center_frequency_hz = phy_cell.ul_freq_hz;
return SRSRAN_SUCCESS;
}

@ -32,7 +32,7 @@ public:
double center_freq_hz;
double ssb_freq_hz;
srsran_subcarrier_spacing_t ssb_scs;
srsran_ssb_patern_t ssb_pattern;
srsran_ssb_pattern_t ssb_pattern;
srsran_duplex_mode_t duplex_mode;
};

@ -33,7 +33,7 @@ public:
double srate_hz;
srsran_carrier_nr_t carrier;
srsran_subcarrier_spacing_t ssb_scs;
srsran_ssb_patern_t ssb_pattern;
srsran_ssb_pattern_t ssb_pattern;
uint32_t ssb_periodicity_ms;
srsran_duplex_mode_t duplex_mode;
srsran::channel::args_t channel;

@ -60,7 +60,7 @@ public:
double srate_hz;
srsran_carrier_nr_t base_carrier;
srsran_subcarrier_spacing_t ssb_scs;
srsran_ssb_patern_t ssb_pattern;
srsran_ssb_pattern_t ssb_pattern;
uint32_t ssb_periodicity_ms;
srsran_duplex_mode_t duplex_mode;
std::set<uint32_t> pci_list;

@ -48,7 +48,7 @@ public:
srsran::channel::args_t channel;
std::string log_level = "error";
srsran_ssb_patern_t get_ssb_pattern() const { return srsran::srsran_band_helper().get_ssb_pattern(band, ssb_scs); }
srsran_ssb_pattern_t get_ssb_pattern() const { return srsran::srsran_band_helper().get_ssb_pattern(band, ssb_scs); }
srsran_duplex_mode_t get_duplex_mode() const { return srsran::srsran_band_helper().get_duplex_mode(band); }
};

@ -24,7 +24,7 @@ struct args_t {
// Generic parameters
double srate_hz = 11.52e6;
srsran_carrier_nr_t base_carrier = SRSRAN_DEFAULT_CARRIER_NR;
srsran_ssb_patern_t ssb_pattern = SRSRAN_SSB_PATTERN_A;
srsran_ssb_pattern_t ssb_pattern = SRSRAN_SSB_PATTERN_A;
srsran_subcarrier_spacing_t ssb_scs = srsran_subcarrier_spacing_15kHz;
srsran_duplex_mode_t duplex_mode = SRSRAN_DUPLEX_MODE_FDD;
uint32_t duration_ms = 1000;
@ -216,7 +216,7 @@ struct cell_search_result_t {
bool found = false;
double ssb_abs_freq_hz = 0.0f;
srsran_subcarrier_spacing_t ssb_scs = srsran_subcarrier_spacing_15kHz;
srsran_ssb_patern_t ssb_pattern = SRSRAN_SSB_PATTERN_A;
srsran_ssb_pattern_t ssb_pattern = SRSRAN_SSB_PATTERN_A;
srsran_duplex_mode_t duplex_mode = SRSRAN_DUPLEX_MODE_FDD;
srsran_mib_nr_t mib = {};
uint32_t pci = 0;

Loading…
Cancel
Save