Addition of PRACH TA correction

This commit is contained in:
Xavier Arteaga 2020-03-11 10:27:53 +01:00 committed by Xavier Arteaga
parent 442926cf66
commit e8f9bfc6ba
8 changed files with 15 additions and 11 deletions

View File

@ -544,8 +544,8 @@ public:
/* Configure PRACH using parameters written by RRC */
virtual void configure_prach_params() = 0;
virtual void prach_send(uint32_t preamble_idx, int allowed_subframe, float target_power_dbm) = 0;
virtual prach_info_t prach_get_info() = 0;
virtual void prach_send(uint32_t preamble_idx, int allowed_subframe, float target_power_dbm, float ta_base_sec) = 0;
virtual prach_info_t prach_get_info() = 0;
/* Indicates the transmission of a SR signal in the next opportunity */
virtual void sr_send() = 0;

View File

@ -85,7 +85,7 @@ public:
void configure_prach_params() final;
/* Transmits PRACH in the next opportunity */
void prach_send(uint32_t preamble_idx, int allowed_subframe, float target_power_dbm) final;
void prach_send(uint32_t preamble_idx, int allowed_subframe, float target_power_dbm, float ta_base_sec) final;
prach_info_t prach_get_info() final;
/* Indicates the transmission of a SR signal in the next opportunity */
@ -158,6 +158,7 @@ private:
/* Current time advance */
uint32_t n_ta = 0;
uint32_t n_ta_base = 0;
static void set_default_args(phy_args_t& args);
bool check_args(const phy_args_t& args);

View File

@ -259,6 +259,7 @@ void phy::get_metrics(phy_metrics_t* m)
void phy::set_timeadv_rar(uint32_t ta_cmd)
{
n_ta = srslte_N_ta_new_rar(ta_cmd);
n_ta += n_ta_base;
sfsync.set_time_adv_sec(((float)n_ta) * SRSLTE_LTE_TS);
Info("PHY: Set TA RAR: ta_cmd: %d, n_ta: %d, ta_usec: %.1f\n", ta_cmd, n_ta, ((float)n_ta) * SRSLTE_LTE_TS * 1e6);
}
@ -339,10 +340,11 @@ float phy::get_pathloss_db()
return common.cur_pathloss;
}
void phy::prach_send(uint32_t preamble_idx, int allowed_subframe, float target_power_dbm)
void phy::prach_send(uint32_t preamble_idx, int allowed_subframe, float target_power_dbm, float ta_base_sec)
{
n_ta = 0;
sfsync.set_time_adv_sec(0.0f);
n_ta = 0; /* Reset Time aligment */
n_ta_base = (uint32_t)roundf(ta_base_sec / SRSLTE_LTE_TS);
sfsync.set_time_adv_sec(ta_base_sec);
common.reset_radio();
if (!prach_buffer.prepare_to_send(preamble_idx, allowed_subframe, target_power_dbm)) {
Error("Preparing PRACH to send\n");
@ -370,6 +372,7 @@ void phy::reset()
{
Info("Resetting PHY\n");
n_ta = 0;
n_ta_base = 0;
sfsync.set_time_adv_sec(0);
for (uint32_t i = 0; i < nof_workers; i++) {
workers[i]->reset();

View File

@ -343,7 +343,7 @@ void ra_proc::preamble_transmission()
received_target_power_dbm = rach_cfg.iniReceivedTargetPower + delta_preamble_db +
(preambleTransmissionCounter - 1) * rach_cfg.powerRampingStep;
phy_h->prach_send(sel_preamble, sel_maskIndex - 1, received_target_power_dbm);
phy_h->prach_send(sel_preamble, sel_maskIndex - 1, received_target_power_dbm, 0.0f);
rntis->rar_rnti = 0;
ra_tti = 0;
rar_received = false;

View File

@ -123,7 +123,7 @@ public:
// phy_interface_mac_lte
void configure_prach_params(){};
void prach_send(uint32_t preamble_idx, int allowed_subframe, float target_power_dbm)
void prach_send(uint32_t preamble_idx, int allowed_subframe, float target_power_dbm, float ta_base_sec)
{
prach_delay_cnt = 0;
last_preamble_idx = preamble_idx;

View File

@ -501,7 +501,7 @@ int main(int argc, char** argv)
// 3. Transmit PRACH
phy_test->get_phy_interface_mac()->configure_prach_params();
phy_test->get_phy_interface_mac()->prach_send(0, -1, 0.0f);
phy_test->get_phy_interface_mac()->prach_send(0, -1, 0.0f, 0.0f);
TESTASSERT(phy_test->get_radio()->wait_tx(default_timeout, false));
// 4. Configure RNTI with PUCCH and check transmission

View File

@ -93,7 +93,7 @@ public:
// phy_interface_mac_lte
void configure_prach_params();
void prach_send(uint32_t preamble_idx, int allowed_subframe, float target_power_dbm);
void prach_send(uint32_t preamble_idx, int allowed_subframe, float target_power_dbm, float ta_base_sec);
prach_info_t prach_get_info();
void sr_send();
int sr_last_tx_tti();

View File

@ -194,7 +194,7 @@ void lte_ttcn3_phy::configure_prach_params()
log.debug("%s not implemented.\n", __FUNCTION__);
};
void lte_ttcn3_phy::prach_send(uint32_t preamble_idx, int allowed_subframe, float target_power_dbm)
void lte_ttcn3_phy::prach_send(uint32_t preamble_idx, int allowed_subframe, float target_power_dbm, float ta_base_sec)
{
log.info("Sending PRACH with preamble %d on PCID=%d\n", preamble_idx, pcell.info.id);
prach_tti_tx = current_tti;