SRSUE: Unify PRACH reconfiguration conditions

This commit is contained in:
Xavier Arteaga 2021-01-20 16:42:37 +01:00 committed by Andre Puschmann
parent e0937d1dd1
commit 59114206ae
3 changed files with 14 additions and 23 deletions

View File

@ -30,7 +30,6 @@ public:
void init(uint32_t max_prb, srslte::log* log_h); void init(uint32_t max_prb, srslte::log* log_h);
void stop(); void stop();
bool set_cell(srslte_cell_t cell, srslte_prach_cfg_t prach_cfg); bool set_cell(srslte_cell_t cell, srslte_prach_cfg_t prach_cfg);
void reset_cfg();
bool prepare_to_send(uint32_t preamble_idx, int allowed_subframe = -1, float target_power_dbm = -1); bool prepare_to_send(uint32_t preamble_idx, int allowed_subframe = -1, float target_power_dbm = -1);
bool is_ready_to_send(uint32_t current_tti, uint32_t current_pci); bool is_ready_to_send(uint32_t current_tti, uint32_t current_pci);
bool is_pending() const; bool is_pending() const;

View File

@ -466,18 +466,15 @@ bool phy::set_config(srslte::phy_cfg_t config_, uint32_t cc_idx)
Info("Setting configuration\n"); Info("Setting configuration\n");
// The PRACH shall be re-configured only if: // The PRACH configuration shall be updated only if:
// - The new configuration belongs to the primary cell // - The new configuration belongs to the primary cell
// - The PRACH configuration is present // - The PRACH configuration is present
// - The PRACH configuration has changed if (!cc_idx && config_.prach_cfg_present) {
bool reconfigure_prach = !cc_idx && config_.prach_cfg_present && (prach_cfg != config_.prach_cfg); prach_cfg = config_.prach_cfg;
if (reconfigure_prach) {
prach_buffer.reset_cfg();
} }
// Apply configuration after the worker is finished to avoid race conditions // Apply configuration after the worker is finished to avoid race conditions
cmd_worker.add_cmd([this, config_, cc_idx, reconfigure_prach]() { cmd_worker.add_cmd([this, config_, cc_idx]() {
log_h->info("Setting new PHY configuration cc_idx=%d...\n", cc_idx); log_h->info("Setting new PHY configuration cc_idx=%d...\n", cc_idx);
for (uint32_t i = 0; i < args.nof_phy_threads; i++) { for (uint32_t i = 0; i < args.nof_phy_threads; i++) {
// set_cell is not protected so run when worker is finished // set_cell is not protected so run when worker is finished
@ -488,13 +485,10 @@ bool phy::set_config(srslte::phy_cfg_t config_, uint32_t cc_idx)
} }
} }
log_h->info("Finished setting new PHY configuration cc_idx=%d\n", cc_idx); log_h->info("Finished setting new PHY configuration cc_idx=%d\n", cc_idx);
if (reconfigure_prach) {
// Reconfigure PRACH parameters only if configuration is different // It is up to the PRACH component to detect whether the cell or the configuration have changed to reconfigure
prach_cfg = config_.prach_cfg; configure_prach_params();
log_h->info("Setting new PRACH configuration...\n");
configure_prach_params();
log_h->info("Finished setting new PRACH configuration.\n");
}
stack->set_config_complete(true); stack->set_config_complete(true);
}); });
return true; return true;

View File

@ -12,6 +12,7 @@
#include "srsue/hdr/phy/prach.h" #include "srsue/hdr/phy/prach.h"
#include "srslte/common/log.h" #include "srslte/common/log.h"
#include "srslte/interfaces/phy_interface_types.h"
#include "srslte/interfaces/ue_interfaces.h" #include "srslte/interfaces/ue_interfaces.h"
#include "srslte/srslte.h" #include "srslte/srslte.h"
@ -83,11 +84,6 @@ void prach::stop()
mem_initiated = false; mem_initiated = false;
} }
void prach::reset_cfg()
{
cell_initiated = false;
}
bool prach::set_cell(srslte_cell_t cell_, srslte_prach_cfg_t prach_cfg) bool prach::set_cell(srslte_cell_t cell_, srslte_prach_cfg_t prach_cfg)
{ {
if (!mem_initiated) { if (!mem_initiated) {
@ -95,8 +91,7 @@ bool prach::set_cell(srslte_cell_t cell_, srslte_prach_cfg_t prach_cfg)
return false; return false;
} }
// TODO: Check if other PRACH parameters changed if (cell.id == cell_.id && cell_initiated && prach_cfg == cfg) {
if (cell.id == cell_.id && cell_initiated) {
return true; return true;
} }
@ -110,7 +105,8 @@ bool prach::set_cell(srslte_cell_t cell_, srslte_prach_cfg_t prach_cfg)
return false; return false;
} }
Info("PRACH: configIdx=%d, rootSequence=%d, zeroCorrelationConfig=%d, freqOffset=%d\n", Info("PRACH: cell.id=%d, configIdx=%d, rootSequence=%d, zeroCorrelationConfig=%d, freqOffset=%d\n",
cell.id,
prach_cfg.config_idx, prach_cfg.config_idx,
prach_cfg.root_seq_idx, prach_cfg.root_seq_idx,
prach_cfg.zero_corr_zone, prach_cfg.zero_corr_zone,
@ -126,6 +122,8 @@ bool prach::set_cell(srslte_cell_t cell_, srslte_prach_cfg_t prach_cfg)
transmitted_tti = -1; transmitted_tti = -1;
cell_initiated = true; cell_initiated = true;
log_h->info("Finished setting new PRACH configuration.\n");
return true; return true;
} }