SRSENB: UL TA measurement waits for a start order before start measuring

master
Xavier Arteaga 5 years ago committed by Xavier Arteaga
parent 198684ce32
commit 8b265883e4

@ -42,17 +42,18 @@ public:
/** /**
* UE's FSM for controlling Time Aligment command generation. * 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 * Initially the FSM starts at idle state which transitions to Measure as soon as start is called. Measurements are
* the FSM is in Measure state. Up to MAX_NOF_MEAS are stored. The FSM uses a minimum of MIN_NOF_MEAS measurements to * collected while the FSM is in Measure state. Up to MAX_NOF_MEAS are stored. The FSM uses a minimum of MIN_NOF_MEAS
* compute the TA average. The TA command is triggered as soon as the TA average is higher than TA_N_THRESHOLD. After * measurements to compute the TA average. The TA command is triggered as soon as the TA average is higher than
* triggering a TA command, holds in prohibit state for PROHIBIT_PERIOD_MS before start collecting measurements. * TA_N_THRESHOLD. After triggering a TA command, holds in prohibit state for PROHIBIT_PERIOD_MS before start collecting
* measurements.
* *
* +------+ First call +---------+ Trigger +----------+ * +------+ Start +---------+ Trigger +----------+
* | None | ------------->| Measure |------------>| Prohibit | * | Idle | ------->| Measure |------------>| Prohibit |
* +------+ +---------+ +----------+ * +------+ +---------+ +----------+
* ^ ^ | * ^ ^ |
* | | Prohibit expires | * | | Prohibit expires |
* --+ +------------------------+ * --+ +------------------------+
* *
* *
*/ */
@ -82,11 +83,11 @@ private:
// FSM states // FSM states
typedef enum { typedef enum {
state_none = 0, ///< NO state has been set yet state_idle = 0, ///< Waits for start order
state_measure, ///< Performing measurement state_measure, ///< Performing measurement
state_prohibit ///< Waiting for HARQ to transmit CE command, NO measurement shall be stored state_prohibit ///< Waiting for HARQ to transmit CE command, NO measurement shall be stored
} state_t; } state_t;
state_t state = state_none; state_t state = state_idle;
/** /**
* Reset Measurement and timer counter * 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)); 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 * Runs measure state
* @return the number of enqueued MAC CE carrying TA commands * @return the number of enqueued MAC CE carrying TA commands
@ -187,8 +177,9 @@ private:
uint32_t run_fsm() uint32_t run_fsm()
{ {
switch (state) { switch (state) {
case state_none: case state_idle:
return run_state_none(); // Waits for Start order, do nothing
return 0;
case state_measure: case state_measure:
return run_state_measure(); return run_state_measure();
case state_prohibit: case state_prohibit:
@ -210,6 +201,17 @@ public:
run_fsm(); 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 * Pushes TA measurement and runs internal FSM
* *

@ -59,15 +59,10 @@ public:
uint32_t set_ta(int ta) override; 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 set_ta_us(float ta_us) { return ta_fsm.push_value(ta_us); };
uint32_t tick_ta_fsm() { return ta_fsm.tick(); }; 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, uint8_t* generate_pdu(uint32_t ue_cc_idx,
uint32_t harq_pid, uint32_t harq_pid,
uint32_t tb_idx, 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(); 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 // Add RNTI to the PHY (pregenerate signals) now instead of after PRACH
if (not ue_ptr->is_phy_added) { if (not ue_ptr->is_phy_added) {
Info("Registering RNTI=0x%X to PHY...\n", rnti); Info("Registering RNTI=0x%X to PHY...\n", rnti);

Loading…
Cancel
Save