mirror of https://github.com/PentHertz/srsLTE.git
SRSENB: UL TA measurement waits for a start order before start measuring
This commit is contained in:
parent
198684ce32
commit
8b265883e4
|
@ -42,13 +42,14 @@ public:
|
|||
/**
|
||||
* UE's FSM for controlling Time Aligment command generation.
|
||||
*
|
||||
* Initially the FSM starts at none state which automatically transitions to Measure. Measurements are collected while
|
||||
* the FSM is in Measure state. Up to MAX_NOF_MEAS are stored. The FSM uses a minimum of MIN_NOF_MEAS measurements to
|
||||
* compute the TA average. The TA command is triggered as soon as the TA average is higher than TA_N_THRESHOLD. After
|
||||
* triggering a TA command, holds in prohibit state for PROHIBIT_PERIOD_MS before start collecting measurements.
|
||||
* Initially the FSM starts at idle state which transitions to Measure as soon as start is called. Measurements are
|
||||
* collected while the FSM is in Measure state. Up to MAX_NOF_MEAS are stored. The FSM uses a minimum of MIN_NOF_MEAS
|
||||
* measurements to compute the TA average. The TA command is triggered as soon as the TA average is higher than
|
||||
* TA_N_THRESHOLD. After triggering a TA command, holds in prohibit state for PROHIBIT_PERIOD_MS before start collecting
|
||||
* measurements.
|
||||
*
|
||||
* +------+ First call +---------+ Trigger +----------+
|
||||
* | None | ------------->| Measure |------------>| Prohibit |
|
||||
* +------+ Start +---------+ Trigger +----------+
|
||||
* | Idle | ------->| Measure |------------>| Prohibit |
|
||||
* +------+ +---------+ +----------+
|
||||
* ^ ^ |
|
||||
* | | Prohibit expires |
|
||||
|
@ -82,11 +83,11 @@ private:
|
|||
|
||||
// FSM states
|
||||
typedef enum {
|
||||
state_none = 0, ///< NO state has been set yet
|
||||
state_idle = 0, ///< Waits for start order
|
||||
state_measure, ///< Performing measurement
|
||||
state_prohibit ///< Waiting for HARQ to transmit CE command, NO measurement shall be stored
|
||||
} state_t;
|
||||
state_t state = state_none;
|
||||
state_t state = state_idle;
|
||||
|
||||
/**
|
||||
* Reset Measurement and timer counter
|
||||
|
@ -120,17 +121,6 @@ private:
|
|||
return static_cast<int>(std::roundf(ta_us * 1e-6f / SRSLTE_LTE_TS / 16.0f));
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs initial state none
|
||||
* @return 0
|
||||
*/
|
||||
uint32_t run_state_none()
|
||||
{
|
||||
reset_measurements();
|
||||
state = state_measure;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs measure state
|
||||
* @return the number of enqueued MAC CE carrying TA commands
|
||||
|
@ -187,8 +177,9 @@ private:
|
|||
uint32_t run_fsm()
|
||||
{
|
||||
switch (state) {
|
||||
case state_none:
|
||||
return run_state_none();
|
||||
case state_idle:
|
||||
// Waits for Start order, do nothing
|
||||
return 0;
|
||||
case state_measure:
|
||||
return run_state_measure();
|
||||
case state_prohibit:
|
||||
|
@ -210,6 +201,17 @@ public:
|
|||
run_fsm();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gives an start order to the FSM
|
||||
*/
|
||||
void start()
|
||||
{
|
||||
// Transition to idle only if the current state is idle
|
||||
if (state == state_idle) {
|
||||
state = state_measure;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Pushes TA measurement and runs internal FSM
|
||||
*
|
||||
|
|
|
@ -59,15 +59,10 @@ public:
|
|||
|
||||
uint32_t set_ta(int ta) override;
|
||||
|
||||
void start_ta() { ta_fsm.start(); };
|
||||
uint32_t set_ta_us(float ta_us) { return ta_fsm.push_value(ta_us); };
|
||||
uint32_t tick_ta_fsm() { return ta_fsm.tick(); };
|
||||
|
||||
void config(uint16_t rnti,
|
||||
uint32_t nof_prb,
|
||||
sched_interface* sched,
|
||||
rrc_interface_mac* rrc_,
|
||||
rlc_interface_mac* rlc,
|
||||
srslte::log* log_h);
|
||||
uint8_t* generate_pdu(uint32_t ue_cc_idx,
|
||||
uint32_t harq_pid,
|
||||
uint32_t tb_idx,
|
||||
|
|
|
@ -202,6 +202,9 @@ int mac::ue_cfg(uint16_t rnti, sched_interface::ue_cfg_t* cfg)
|
|||
}
|
||||
ue_ptr = it->second.get();
|
||||
|
||||
// Start TA FSM in UE entity
|
||||
ue_ptr->start_ta();
|
||||
|
||||
// Add RNTI to the PHY (pregenerate signals) now instead of after PRACH
|
||||
if (not ue_ptr->is_phy_added) {
|
||||
Info("Registering RNTI=0x%X to PHY...\n", rnti);
|
||||
|
|
Loading…
Reference in New Issue