Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix_sched_ue_rem' into fix_sched…
Browse files Browse the repository at this point in the history
…_ue_rem
  • Loading branch information
Ismael committed Oct 30, 2024
2 parents d7e21c3 + 933d507 commit 3c7b857
Show file tree
Hide file tree
Showing 51 changed files with 723 additions and 330 deletions.
8 changes: 4 additions & 4 deletions include/srsran/ran/csi_rs/csi_meas_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,10 @@ struct csi_aperiodic_trigger_state {
bool operator!=(const csi_aperiodic_trigger_state& rhs) const { return !(rhs == *this); }
};

/// Used to configure the UE with a list of aperiodic trigger states. Each codepoint of the DCI field "CSI request" is
/// associated with one trigger state.
/// \brief Used to configure the UE with a list of aperiodic trigger states. Each codepoint of the DCI field
/// "CSI request" is associated with one trigger state. List size ranges from 0 to MAX_NOF_CSI_APERIODIC_TRIGGERS.
/// \remark TS 38.331, \c CSI-AperiodicTriggerStateList.
using csi_aperiodic_trigger_state_list = static_vector<csi_aperiodic_trigger_state, MAX_NOF_CSI_APERIODIC_TRIGGERS>;
using csi_aperiodic_trigger_state_list = std::vector<csi_aperiodic_trigger_state>;

/// See TS 38.331, \c CSI-SemiPersistentOnPUSCH-TriggerState.
struct csi_semi_persistent_on_pusch_trigger_state {
Expand Down Expand Up @@ -322,7 +322,7 @@ struct csi_meas_config {
std::vector<csi_report_config> csi_report_cfg_list;
/// Size of CSI request field in DCI (bits). See TS 38.214, clause 5.2.1.5.1.
std::optional<unsigned> report_trigger_size;
std::optional<csi_aperiodic_trigger_state_list> aperiodic_trigger_state_list;
csi_aperiodic_trigger_state_list aperiodic_trigger_state_list;
std::optional<csi_semi_persistent_on_pusch_trigger_state_list> semi_persistent_on_pusch_trigger_state_list;

bool operator==(const csi_meas_config& rhs) const
Expand Down
50 changes: 50 additions & 0 deletions include/srsran/ran/meas_gap_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
*
* Copyright 2021-2024 Software Radio Systems Limited
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the distribution.
*
*/

#pragma once

#include "srsran/ran/slot_point.h"
#include "srsran/ran/subcarrier_spacing.h"

namespace srsran {

/// Measurement Gap Repetition Period (MGRP) in msec, as per TS 38.331.
enum class meas_gap_repetition_period : uint8_t { ms20 = 20, ms40 = 40, ms80 = 80, ms160 = 160 };

/// Measurement Gap Length (MGL) in msec, as per TS 38.331.
enum class meas_gap_length : uint8_t { ms1dot5, ms3, ms3dot5, ms4, ms5dot5, ms6 };

/// Configuration of a Measurement Gap as per TS 38.331, GapConfig.
struct meas_gap_config {
/// Gap offset of the pattern in msec. Value must be between 0 and gap repetition period - 1.
unsigned offset;
/// Measurement Gap Length (MGL).
meas_gap_length mgl;
/// Measurement Gap Repetition Period (MGRP).
meas_gap_repetition_period mgrp;
};

/// Convert measurement gap length into a float in milliseconds.
inline unsigned meas_gap_length_to_msec(meas_gap_length len)
{
constexpr static std::array<float, 6> vals{1.5, 3, 3.5, 4, 5.5, 6};
return vals[static_cast<unsigned>(len)];
}

/// Determines whether a slot is inside the measurement gap.
inline bool is_inside_meas_gap(const meas_gap_config& gap, slot_point sl)
{
unsigned period_slots = static_cast<uint8_t>(gap.mgrp) * sl.nof_slots_per_subframe();
unsigned length_slots = meas_gap_length_to_msec(gap.mgl) * sl.nof_slots_per_subframe();
unsigned slot_mod = sl.to_uint() % period_slots;
return slot_mod <= length_slots;
}

} // namespace srsran
8 changes: 6 additions & 2 deletions include/srsran/scheduler/config/serving_cell_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "srsran/mac/time_alignment_group_config.h"
#include "srsran/ran/carrier_configuration.h"
#include "srsran/ran/csi_rs/csi_meas_config.h"
#include "srsran/ran/meas_gap_config.h"
#include "srsran/ran/pdcch/downlink_preemption.h"
#include "srsran/ran/pdsch/pdsch_mcs.h"
#include "srsran/ran/pdsch/pdsch_prb_bundling.h"
Expand Down Expand Up @@ -250,10 +251,13 @@ struct serving_cell_config {
tag_id_t tag_id;
};

/// UE-dedicated configuration for serving cell, as per TS38.331.
/// UE-dedicated configuration for serving cell.
struct cell_config_dedicated {
serv_cell_index_t serv_cell_idx;
serv_cell_index_t serv_cell_idx;
/// Serving Cell Configuration as per TS 38.331.
serving_cell_config serv_cell_cfg;
/// Measurement Gap Configuration for the cell.
std::optional<meas_gap_config> meas_gap_cfg;
};

} // namespace srsran
2 changes: 1 addition & 1 deletion lib/du/du_high/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# the distribution.
#

add_subdirectory(adapters)
add_subdirectory(du_manager)
add_subdirectory(test_mode)

add_library(srsran_du_high STATIC
du_high_impl.cpp
Expand Down
4 changes: 0 additions & 4 deletions lib/du/du_high/adapters/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,3 @@
# the distribution.
#

add_library(srsran_du_high_adapters
mac_test_mode_adapter.cpp
f1ap_test_mode_adapter.cpp)
target_link_libraries(srsran_du_high_adapters srslog srsran_support srsran_du_manager srsran_mac srsran_f1ap_du srsran_e2)
2 changes: 1 addition & 1 deletion lib/du/du_high/du_high_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "adapters/adapters.h"
#include "adapters/du_high_adapter_factories.h"
#include "adapters/f1ap_adapters.h"
#include "adapters/f1ap_test_mode_adapter.h"
#include "test_mode/f1ap_test_mode_adapter.h"
#include "srsran/du/du_high/du_manager/du_manager_factory.h"
#include "srsran/f1ap/du/f1ap_du_factory.h"
#include "srsran/support/executors/task_redispatcher.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1273,15 +1273,15 @@ void srsran::srs_du::calculate_csi_meas_config_diff(asn1::rrc_nr::csi_meas_cfg_s
out.report_trigger_size = dest.report_trigger_size.value();
}

if ((dest.aperiodic_trigger_state_list.has_value() and not src.aperiodic_trigger_state_list.has_value()) or
(dest.aperiodic_trigger_state_list.has_value() and src.aperiodic_trigger_state_list.has_value() and
if ((not dest.aperiodic_trigger_state_list.empty() and src.aperiodic_trigger_state_list.empty()) or
(not dest.aperiodic_trigger_state_list.empty() and not src.aperiodic_trigger_state_list.empty() and
dest.aperiodic_trigger_state_list != src.aperiodic_trigger_state_list)) {
out.aperiodic_trigger_state_list_present = true;
auto& ap_trigger_state_list = out.aperiodic_trigger_state_list.set_setup();
for (const auto& trigger_state : dest.aperiodic_trigger_state_list.value()) {
for (const auto& trigger_state : dest.aperiodic_trigger_state_list) {
ap_trigger_state_list.push_back(make_asn1_aperiodic_trigger_state(trigger_state));
}
} else if (src.aperiodic_trigger_state_list.has_value() and not dest.aperiodic_trigger_state_list.has_value()) {
} else if (not src.aperiodic_trigger_state_list.empty() and dest.aperiodic_trigger_state_list.empty()) {
out.aperiodic_trigger_state_list_present = true;
out.aperiodic_trigger_state_list.set_release();
}
Expand Down
13 changes: 13 additions & 0 deletions lib/du/du_high/test_mode/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# Copyright 2021-2024 Software Radio Systems Limited
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the distribution.
#

add_library(srsran_du_high_adapters
mac_test_mode_adapter.cpp
f1ap_test_mode_adapter.cpp
mac_test_mode_helpers.cpp)
target_link_libraries(srsran_du_high_adapters srslog srsran_support srsran_du_manager srsran_mac srsran_f1ap_du srsran_e2)
Loading

0 comments on commit 3c7b857

Please sign in to comment.