SRSUE: Call Radio tx-end when PHY is reseted and removed redundant attribute is_start_of_burst.

master
Xavier Arteaga 5 years ago committed by Andre Puschmann
parent 4ea9ed058c
commit 1a567a764e

@ -57,17 +57,18 @@ public:
virtual void set_rx_srate(const uint32_t& radio_idx, const double& srate) = 0; virtual void set_rx_srate(const uint32_t& radio_idx, const double& srate) = 0;
// getter // getter
virtual float get_rx_gain(const uint32_t& radio_idx) = 0; virtual float get_rx_gain(const uint32_t& radio_idx) = 0;
virtual double get_freq_offset() = 0; virtual double get_freq_offset() = 0;
virtual double get_tx_freq(const uint32_t& radio_idx) = 0; virtual double get_tx_freq(const uint32_t& radio_idx) = 0;
virtual double get_rx_freq(const uint32_t& radio_idx) = 0; virtual double get_rx_freq(const uint32_t& radio_idx) = 0;
virtual float get_max_tx_power() = 0; virtual float get_max_tx_power() = 0;
virtual float get_tx_gain_offset() = 0; virtual float get_tx_gain_offset() = 0;
virtual float get_rx_gain_offset() = 0; virtual float get_rx_gain_offset() = 0;
virtual bool is_continuous_tx() = 0; virtual bool is_continuous_tx() = 0;
virtual bool is_init() = 0; virtual bool get_is_start_of_burst(const uint32_t& radio_idx) = 0;
virtual void reset() = 0; virtual bool is_init() = 0;
virtual srslte_rf_info_t* get_info(const uint32_t& radio_idx) = 0; virtual void reset() = 0;
virtual srslte_rf_info_t* get_info(const uint32_t& radio_idx) = 0;
}; };
class phy_interface_radio class phy_interface_radio

@ -92,6 +92,7 @@ class radio {
bool tx_single(cf_t* buffer, uint32_t nof_samples, srslte_timestamp_t tx_time); bool tx_single(cf_t* buffer, uint32_t nof_samples, srslte_timestamp_t tx_time);
bool tx(cf_t* buffer[SRSLTE_MAX_PORTS], uint32_t nof_samples, srslte_timestamp_t tx_time); bool tx(cf_t* buffer[SRSLTE_MAX_PORTS], uint32_t nof_samples, srslte_timestamp_t tx_time);
void tx_end(); void tx_end();
bool get_is_start_of_burst();
bool rx_now(cf_t* buffer[SRSLTE_MAX_PORTS], uint32_t nof_samples, srslte_timestamp_t* rxd_time); bool rx_now(cf_t* buffer[SRSLTE_MAX_PORTS], uint32_t nof_samples, srslte_timestamp_t* rxd_time);
bool rx_at(cf_t* buffer, uint32_t nof_samples, srslte_timestamp_t rx_time); bool rx_at(cf_t* buffer, uint32_t nof_samples, srslte_timestamp_t rx_time);

@ -57,6 +57,10 @@ public:
bool is_init() override { return radios.at(0)->is_init(); } bool is_init() override { return radios.at(0)->is_init(); }
void reset() override { return radios.at(0)->reset(); } void reset() override { return radios.at(0)->reset(); }
bool is_continuous_tx() override { return radios.at(0)->is_continuous_tx(); } bool is_continuous_tx() override { return radios.at(0)->is_continuous_tx(); }
bool get_is_start_of_burst(const uint32_t& radio_idx) override
{
return radios.at(radio_idx)->get_is_start_of_burst();
}
bool tx(const uint32_t& radio_idx, bool tx(const uint32_t& radio_idx,
cf_t* buffer[SRSLTE_MAX_PORTS], cf_t* buffer[SRSLTE_MAX_PORTS],
const uint32_t& nof_samples, const uint32_t& nof_samples,
@ -64,7 +68,13 @@ public:
{ {
return radios.at(radio_idx)->tx(buffer, nof_samples, tx_time); return radios.at(radio_idx)->tx(buffer, nof_samples, tx_time);
} }
void tx_end() override { return radios.at(0)->tx_end(); } void tx_end() override
{
// Send Tx exd to all radios
for (auto& r : radios) {
r->tx_end();
}
}
bool rx_now(const uint32_t& radio_idx, bool rx_now(const uint32_t& radio_idx,
cf_t* buffer[SRSLTE_MAX_PORTS], cf_t* buffer[SRSLTE_MAX_PORTS],

@ -255,6 +255,11 @@ void radio::tx_end()
} }
} }
bool radio::get_is_start_of_burst()
{
return is_start_of_burst;
}
void radio::set_freq_offset(double freq) { void radio::set_freq_offset(double freq) {
freq_offset = freq; freq_offset = freq;
} }

@ -177,7 +177,6 @@ private:
uint32_t nof_workers; uint32_t nof_workers;
uint32_t max_workers; uint32_t max_workers;
bool is_first_of_burst[SRSLTE_MAX_RADIOS];
srslte::radio_interface_phy* radio_h; srslte::radio_interface_phy* radio_h;
float cfo; float cfo;
srslte::log* log_h; srslte::log* log_h;

@ -582,10 +582,9 @@ void phy_common::worker_end(uint32_t tti,
} }
radio_h->tx(i, buffer[i], nof_samples[i], tx_time[i]); radio_h->tx(i, buffer[i], nof_samples[i], tx_time[i]);
is_first_of_burst[i] = false;
} else { } else {
if (radio_h->is_continuous_tx()) { if (radio_h->is_continuous_tx()) {
if (!is_first_of_burst[i]) { if (!radio_h->get_is_start_of_burst(i)) {
if (ul_channel && !srslte_timestamp_iszero(&tx_time[i])) { if (ul_channel && !srslte_timestamp_iszero(&tx_time[i])) {
bzero(zeros_multi[0], sizeof(cf_t) * nof_samples[i]); bzero(zeros_multi[0], sizeof(cf_t) * nof_samples[i]);
@ -595,10 +594,7 @@ void phy_common::worker_end(uint32_t tti,
radio_h->tx(i, zeros_multi, nof_samples[i], tx_time[i]); radio_h->tx(i, zeros_multi, nof_samples[i], tx_time[i]);
} }
} else { } else {
if (!is_first_of_burst[i]) { radio_h->tx_end();
radio_h->tx_end();
is_first_of_burst[i] = true;
}
} }
} }
} }
@ -695,8 +691,13 @@ void phy_common::get_sync_metrics(sync_metrics_t m[SRSLTE_MAX_CARRIERS])
void phy_common::reset_radio() void phy_common::reset_radio()
{ {
is_first_tx = true; is_first_tx = true;
for (int i = 0; i < SRSLTE_MAX_RADIOS; i++) {
is_first_of_burst[i] = true; // End Tx streams even if they are continuous
// Since is_first_of_burst is set to true, the radio need to send
// end of burst in order to stall correctly the Tx stream.
// This is required for UHD version 3.10 and newer.
if (radio_h) {
radio_h->tx_end();
} }
} }

Loading…
Cancel
Save