Skip to content

Commit 4180cb1

Browse files
carlo-galcodebot
authored andcommitted
du, band_helper: add option to set UL ARFCN
Signed-off-by: Carlo Galiotto <[email protected]>
1 parent 340050c commit 4180cb1

File tree

8 files changed

+82
-17
lines changed

8 files changed

+82
-17
lines changed

apps/units/flexible_du/du_high/du_high_config.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,10 @@ struct du_high_unit_base_cell_config {
547547
std::optional<unsigned> sector_id;
548548
/// DL ARFCN of "F_REF", which is the RF reference frequency, as per TS 38.104, Section 5.4.2.1.
549549
unsigned dl_f_ref_arfcn = 536020;
550+
/// UL ARFCN of "F_REF", which is the RF reference frequency, as per TS 38.104, Section 5.4.2.1.
551+
/// \remark Only relevant for FDD bands. If set with TDD bands, it will be ignored.
552+
/// For FDD bands, if not set, the UL ARFCN will be computed automatically.
553+
std::optional<unsigned> ul_f_ref_arfcn = std::nullopt;
550554
/// Common subcarrier spacing for the entire resource grid. It must be supported by the band SS raster.
551555
subcarrier_spacing common_scs = subcarrier_spacing::kHz15;
552556
/// NR band.

apps/units/flexible_du/du_high/du_high_config_cli11_schema.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,7 @@ static void configure_cli11_common_cell_args(CLI::App& app, du_high_unit_base_ce
11141114
->capture_default_str()
11151115
->check(CLI::Range(0U, (1U << 14) - 1U));
11161116
add_option(app, "--dl_arfcn", cell_params.dl_f_ref_arfcn, "Downlink ARFCN")->capture_default_str();
1117+
add_option(app, "--ul_arfcn", cell_params.ul_f_ref_arfcn, "Uplink ARFCN")->capture_default_str();
11171118
add_auto_enum_option(app, "--band", cell_params.band, "NR band");
11181119
add_option_function<std::string>(
11191120
app,

apps/units/flexible_du/du_high/du_high_config_translators.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ std::vector<srs_du::du_cell_config> srsran::generate_du_cell_config(const du_hig
230230
param.scs_common = base_cell.common_scs;
231231
param.channel_bw_mhz = base_cell.channel_bw_mhz;
232232
param.dl_f_ref_arfcn = base_cell.dl_f_ref_arfcn;
233+
param.ul_f_ref_arfcn = base_cell.ul_f_ref_arfcn;
233234
param.band = *base_cell.band;
234235
// Enable CSI-RS if the PDSCH mcs is dynamic (min_ue_mcs != max_ue_mcs).
235236
param.csi_rs_enabled = base_cell.csi_cfg.csi_rs_enabled;

apps/units/flexible_du/du_high/du_high_config_validator.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ static bool validate_tdd_ul_dl_unit_config(const du_high_unit_tdd_ul_dl_config&
601601
return true;
602602
}
603603

604-
static bool validate_dl_arfcn_and_band(const du_high_unit_base_cell_config& config)
604+
static bool validate_dl_ul_arfcn_and_band(const du_high_unit_base_cell_config& config)
605605
{
606606
nr_band band =
607607
config.band.has_value() ? config.band.value() : band_helper::get_band_from_dl_arfcn(config.dl_f_ref_arfcn);
@@ -643,14 +643,22 @@ static bool validate_dl_arfcn_and_band(const du_high_unit_base_cell_config& conf
643643
return false;
644644
}
645645

646-
// Check whether the DL-ARFCN is within the band and follows the Raster step.
646+
// Check whether the DL-ARFCN (and optionally the UL-ARFCN) is within the band and follows the Raster step.
647647
if (config.band.has_value()) {
648648
error_type<std::string> ret = band_helper::is_dl_arfcn_valid_given_band(
649649
*config.band, config.dl_f_ref_arfcn, config.common_scs, config.channel_bw_mhz);
650650
if (not ret.has_value()) {
651651
fmt::print("Invalid DL ARFCN={} for band {}. Cause: {}.\n", config.dl_f_ref_arfcn, band, ret.error());
652652
return false;
653653
}
654+
if (config.ul_f_ref_arfcn.has_value()) {
655+
ret =
656+
band_helper::is_ul_arfcn_valid_given_band(*config.band, config.ul_f_ref_arfcn.value(), config.channel_bw_mhz);
657+
if (not ret.has_value()) {
658+
fmt::print("Invalid UL ARFCN={} for band {}. Cause: {}.\n", config.dl_f_ref_arfcn, band, ret.error());
659+
return false;
660+
}
661+
}
654662
} else {
655663
if (band == nr_band::invalid) {
656664
fmt::print("Invalid DL ARFCN={}. Cause: Could not find a valid band.\n", config.dl_f_ref_arfcn);
@@ -757,7 +765,7 @@ static bool validate_base_cell_unit_config(const du_high_unit_base_cell_config&
757765
fmt::print("Maximum Channel BW with SCS common 120kHz is 400MHz.\n");
758766
return false;
759767
}
760-
if (!validate_dl_arfcn_and_band(config)) {
768+
if (!validate_dl_ul_arfcn_and_band(config)) {
761769
return false;
762770
}
763771

include/srsran/ran/band_helper.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ error_type<std::string> is_dl_arfcn_valid_given_band(nr_band band,
8585
subcarrier_spacing scs,
8686
bs_channel_bandwidth bw = bs_channel_bandwidth::MHz10);
8787

88+
/// \brief Checks whether an Uplink ARFCN is valid for a given band.
89+
/// \param[in] band Given NR band.
90+
/// \param[in] arfcn_f_ref Given Uplink ARFCN of \c F_REF, as per TS 38.104, Section 5.4.2.1.
91+
/// \param[in] bw Channel Bandwidth in MHz, which is required to validate some bands' ARFCN values.
92+
/// \return If the UL ARFCN is invalid for the band, a std::string value is returned with the reason.
93+
error_type<std::string>
94+
is_ul_arfcn_valid_given_band(nr_band band, uint32_t arfcn_f_ref, bs_channel_bandwidth bw = bs_channel_bandwidth::MHz10);
95+
8896
/// @brief Get the respective UL ARFCN of a DL ARFCN.
8997
///
9098
/// For paired spectrum (FDD) the function returns the respective ARFCN in the same band.

include/srsran/scheduler/config/cell_config_builder_params.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ struct cell_config_builder_params {
3131
/// This ARFCN represents "f_ref" for DL, as per TS 38.104, Section 5.4.2.1. As per TS 38.104, Section 5.4.2.2,
3232
/// "f_ref" maps to the central frequency of the band.
3333
unsigned dl_f_ref_arfcn = 365000;
34+
/// This ARFCN represents "f_ref" for UL, as per TS 38.104, Section 5.4.2.1. As per TS 38.104, Section 5.4.2.2,
35+
/// "f_ref" maps to the central frequency of the band.
36+
/// \remark Only relevant for FDD bands.
37+
/// If set, this value has been set by the application user.
38+
std::optional<unsigned> ul_f_ref_arfcn = std::nullopt;
3439
/// <em>NR operating band<\em>, as per Table 5.2-1 and 5.2-2, TS 38.104. If not specified, a valid band for the
3540
/// provided DL ARFCN is automatically derived.
3641
std::optional<nr_band> band;

lib/ran/band_helper.cpp

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct nr_band_raster {
5656
// NOTE: FR2 bands have two different Freq raster, we only consider raster 120kHz.
5757
const uint32_t nof_nr_DL_bands = 83;
5858
static constexpr std::array<nr_band_raster, nof_nr_DL_bands> nr_band_table = {{
59-
// clang-format off
59+
// clang-format off
6060
{nr_band::n1, delta_freq_raster::kHz100, 384000, 20, 396000, 422000, 20, 434000},
6161
{nr_band::n2, delta_freq_raster::kHz100, 370000, 20, 382000, 386000, 20, 398000},
6262
{nr_band::n3, delta_freq_raster::kHz100, 342000, 20, 357000, 361000, 20, 376000},
@@ -150,7 +150,7 @@ struct nr_operating_band {
150150
};
151151
static const uint32_t nof_nr_operating_band = 68;
152152
static constexpr std::array<nr_operating_band, nof_nr_operating_band> nr_operating_bands = {{
153-
// clang-format off
153+
// clang-format off
154154
{nr_band::n1, duplex_mode::FDD},
155155
{nr_band::n2, duplex_mode::FDD},
156156
{nr_band::n3, duplex_mode::FDD},
@@ -456,30 +456,33 @@ static bool is_valid_raster_param(const nr_raster_params& raster)
456456

457457
// Validates band n28, which has an additional ARFCN value to the given interval, as per Table 5.4.2.3-1, TS 38.104,
458458
// version 17.8.0.
459-
static error_type<std::string> validate_band_n28(uint32_t arfcn, bs_channel_bandwidth bw)
459+
static error_type<std::string> validate_band_n28(uint32_t arfcn, bs_channel_bandwidth bw, bool is_dl = true)
460460
{
461461
const nr_band_raster band_raster = fetch_band_raster(nr_band::n28, {});
462462
if (band_raster.band == srsran::nr_band::invalid) {
463463
return make_unexpected(fmt::format("Band n28 channel raster not found"));
464464
}
465465

466466
// Try first if the ARFCN matches any value of the interval for 100kHz channel raster.
467-
if (arfcn >= band_raster.dl_nref_first and arfcn <= band_raster.dl_nref_last and
468-
((arfcn - band_raster.dl_nref_first) % band_raster.dl_nref_step) == 0) {
467+
uint32_t nref_first = is_dl ? band_raster.dl_nref_first : band_raster.ul_nref_first;
468+
uint32_t nref_last = is_dl ? band_raster.dl_nref_last : band_raster.ul_nref_last;
469+
uint32_t nref_step = is_dl ? band_raster.dl_nref_step : band_raster.ul_nref_step;
470+
if (arfcn >= nref_first and arfcn <= nref_last and ((arfcn - nref_first) % nref_step) == 0) {
469471
return error_type<std::string>{};
470472
}
471473

472474
// Extra ARFCN value as per Table 5.4.2.3-1, TS 38.104, version 17.8.0 (see NOTE 4 in the table).
473-
const uint32_t dl_arfnc_40MHz = 155608U;
474-
if (bw == srsran::bs_channel_bandwidth::MHz40 and arfcn == dl_arfnc_40MHz) {
475+
const uint32_t arfnc_40MHz = is_dl ? 155608U : 144608U;
476+
if (bw == srsran::bs_channel_bandwidth::MHz40 and arfcn == arfnc_40MHz) {
475477
return error_type<std::string>{};
476478
}
477479

478480
return make_unexpected(
479-
fmt::format("DL ARFCN must be within the interval [{},{}], in steps of {}, for the chosen band",
480-
band_raster.dl_nref_first,
481-
band_raster.dl_nref_last,
482-
band_raster.dl_nref_step));
481+
fmt::format("{} ARFCN must be within the interval [{},{}], in steps of {}, for the chosen band",
482+
is_dl ? "DL" : "UL",
483+
nref_first,
484+
nref_last,
485+
nref_step));
483486
}
484487

485488
// Validates band n46, whose valid ARFCN values depend on the channel BW, as per Table 5.4.2.3-1, TS 38.104,
@@ -743,7 +746,7 @@ error_type<std::string> srsran::band_helper::is_dl_arfcn_valid_given_band(nr_ban
743746
{
744747
// Validates first the bands with non-standard ARFCN values.
745748
if (band == nr_band::n28) {
746-
return validate_band_n28(arfcn_f_ref, bw);
749+
return validate_band_n28(arfcn_f_ref, bw, true);
747750
}
748751

749752
if (band == nr_band::n46) {
@@ -796,6 +799,37 @@ error_type<std::string> srsran::band_helper::is_dl_arfcn_valid_given_band(nr_ban
796799
return make_unexpected(fmt::format("Band {} is not valid", band));
797800
}
798801

802+
error_type<std::string>
803+
srsran::band_helper::is_ul_arfcn_valid_given_band(nr_band band, uint32_t arfcn_f_ref, bs_channel_bandwidth bw)
804+
{
805+
if (get_duplex_mode(band) != duplex_mode::FDD) {
806+
return {};
807+
}
808+
809+
// Validates first the bands with non-standard ARFCN values.
810+
if (band == nr_band::n28) {
811+
return validate_band_n28(arfcn_f_ref, bw, false);
812+
}
813+
814+
// Assume standard Delta freq raster of 100kHz.
815+
const delta_freq_raster band_delta_freq_raster = delta_freq_raster::kHz100;
816+
817+
for (const nr_band_raster& raster_band : nr_band_table) {
818+
if (raster_band.band == band and raster_band.delta_f_rast == band_delta_freq_raster) {
819+
if (arfcn_f_ref >= raster_band.ul_nref_first and arfcn_f_ref <= raster_band.ul_nref_last and
820+
((arfcn_f_ref - raster_band.ul_nref_first) % raster_band.ul_nref_step) == 0) {
821+
return {};
822+
}
823+
return make_unexpected(
824+
fmt::format("UL ARFCN must be within the interval [{},{}], in steps of {}, for the chosen band",
825+
raster_band.ul_nref_first,
826+
raster_band.ul_nref_last,
827+
raster_band.ul_nref_step));
828+
}
829+
}
830+
return make_unexpected(fmt::format("Band {} is not valid", band));
831+
}
832+
799833
uint32_t srsran::band_helper::get_ul_arfcn_from_dl_arfcn(uint32_t dl_arfcn, std::optional<nr_band> band)
800834
{
801835
// NOTE: The procedure implemented in this function is implementation-defined.

lib/scheduler/config/serving_cell_config_factory.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ static carrier_configuration make_default_carrier_configuration(const cell_confi
8989
cfg.arfcn_f_ref = params.dl_f_ref_arfcn;
9090
cfg.nof_ant = params.nof_dl_ports;
9191
} else {
92-
cfg.arfcn_f_ref = band_helper::get_ul_arfcn_from_dl_arfcn(params.dl_f_ref_arfcn, cfg.band);
92+
cfg.arfcn_f_ref = params.ul_f_ref_arfcn.has_value()
93+
? params.ul_f_ref_arfcn.value()
94+
: band_helper::get_ul_arfcn_from_dl_arfcn(params.dl_f_ref_arfcn, cfg.band);
9395
cfg.nof_ant = 1;
9496
}
9597
const min_channel_bandwidth min_channel_bw = band_helper::get_min_channel_bw(cfg.band, params.scs_common);
@@ -334,7 +336,9 @@ srsran::config_helpers::make_default_ul_config_common(const cell_config_builder_
334336
{
335337
ul_config_common cfg{};
336338
// This is the ARFCN of the UL f_ref, as per TS 38.104, Section 5.4.2.1.
337-
const uint32_t ul_arfcn = band_helper::get_ul_arfcn_from_dl_arfcn(params.dl_f_ref_arfcn, params.band);
339+
const uint32_t ul_arfcn = params.ul_f_ref_arfcn.has_value()
340+
? params.ul_f_ref_arfcn.value()
341+
: band_helper::get_ul_arfcn_from_dl_arfcn(params.dl_f_ref_arfcn, params.band);
338342
const double ul_absolute_freq_point_a = band_helper::get_abs_freq_point_a_from_f_ref(
339343
band_helper::nr_arfcn_to_freq(ul_arfcn), params.cell_nof_crbs, params.scs_common);
340344
// \c absolute_freq_point_a needs to be expressed as in ARFCN, as per \c absoluteFrequencyPointA definition in 38.211,

0 commit comments

Comments
 (0)