End of burst is transmitted from MAC thread. Bust pre/post padding initialized to zero

This commit is contained in:
ismagom 2015-06-30 12:52:22 +02:00
parent ce5bece317
commit 083cd89058
6 changed files with 13 additions and 21 deletions

View File

@ -81,7 +81,7 @@ namespace srslte {
void *uhd;
static const double lo_offset = 8e6; // LO offset (in Hz)
static const double burst_settle_time = 0.42e-3; // Start of burst settle time (off->on RF transition time)
static const double burst_settle_time = 0.3e-3; // Start of burst settle time (off->on RF transition time)
const static uint32_t burst_settle_max_samples = 30720000; // 30.72 MHz is maximum frequency
srslte_timestamp_t end_of_burst_time;

View File

@ -42,6 +42,7 @@ bool radio_uhd::init(char *args)
fprintf(stderr, "Error opening uhd\n");
return false;
}
bzero(zeros, burst_settle_max_samples*sizeof(cf_t));
return true;
}

View File

@ -59,7 +59,7 @@ bool mac::init(phy *phy_h_, tti_sync* ttisync_, log* log_h_)
is_first_of_burst = true;
reset();
if (threads_new_rt_prio(&mac_thread, mac_thread_fnc, this, 5)) {
if (threads_new_rt_prio(&mac_thread, mac_thread_fnc, this, 0)) {
started = true;
}
@ -274,7 +274,7 @@ void mac::main_radio_loop() {
is_first_of_burst = false;
} else {
if (!is_first_of_burst) {
ul_buffer->set_end_of_burst();
ul_buffer->send_end_of_burst();
is_first_of_burst = true;
}
}

View File

@ -62,8 +62,7 @@ namespace ue {
bool generate_data(ul_sched_grant *pusch_grant, uint8_t *payload);
bool generate_data(ul_sched_grant *pusch_grant, srslte_softbuffer_tx_t *softbuffer, uint8_t *payload);
void set_tx_params(float cfo, float time_adv_sec, srslte_timestamp_t tx_time);
void set_end_of_burst();
bool is_end_of_burst();
void send_end_of_burst();
static const uint32_t tx_advance_sf = 1; // Number of subframes to advance transmission
static const bool normalize_amp = true;
private:
@ -71,7 +70,6 @@ namespace ue {
phy_params *params_db;
radio *radio_h;
float cfo;
bool tti_is_end_of_burst;
srslte_timestamp_t tx_time;
srslte_cell_t cell;
srslte_ue_ul_t ue_ul;

View File

@ -106,7 +106,7 @@ bool phy::init_(srslte::radio* radio_handler_, srslte::ue::tti_sync* ttisync_, l
params_db.set_param(phy_params::CELLSEARCH_TIMEOUT_PSS_CORRELATION_THRESHOLD, 160);
params_db.set_param(phy_params::CELLSEARCH_TIMEOUT_MIB_NFRAMES, 100);
if (threads_new_rt(&phy_thread, phy_thread_fnc, this)) {
if (threads_new_rt_prio(&phy_thread, phy_thread_fnc, this, 1)) {
started = true;
}
return started;
@ -547,9 +547,7 @@ void phy::run_rx_tx_state()
radio_handler->set_tx_gain(old_gain);
srslte_agc_lock(&ue_sync.agc, false);
Info("Restoring AGC. Set TX gain to %.1f dB\n", old_gain);
} else if (get_ul_buffer_adv(current_tti)->is_end_of_burst()) {
radio_handler->tx_end();
}
}
// Receive alligned buffer for the current tti
tr_log_end();

View File

@ -47,7 +47,7 @@ bool ul_buffer::init_cell(srslte_cell_t cell_, phy_params *params_db_, log *log_
radio_h = radio_h_;
params_db = params_db_;
current_tx_nb = 0;
tti_is_end_of_burst = false;
if (!srslte_ue_ul_init(&ue_ul, cell)) {
srslte_ue_ul_set_normalization(&ue_ul, false);
signal_buffer = (cf_t*) srslte_vec_malloc(sizeof(cf_t) * SRSLTE_SF_LEN_PRB(cell.nof_prb));
@ -282,7 +282,7 @@ bool ul_buffer::generate_data(ul_sched_grant *grant, srslte_softbuffer_tx_t *sof
}
// Normalize before TX
srslte_vec_sc_prod_cfc(signal_buffer, 0.7/max, signal_buffer, SRSLTE_SF_LEN_PRB(cell.nof_prb));
srslte_vec_sc_prod_cfc(signal_buffer, 0.9/max, signal_buffer, SRSLTE_SF_LEN_PRB(cell.nof_prb));
}
radio_h->tx(signal_buffer, SRSLTE_SF_LEN_PRB(cell.nof_prb), tx_time);
@ -305,22 +305,17 @@ int nof_tx = 0;
void ul_buffer::set_tx_params(float cfo_, float time_adv_sec, srslte_timestamp_t tx_time_)
{
tti_is_end_of_burst = false;
cfo = cfo_;
srslte_timestamp_copy(&tx_time, &tx_time_);
srslte_timestamp_add(&tx_time, 0, 4e-3 - time_adv_sec);
srslte_timestamp_add(&tx_time, 0, 4e-3 - time_adv_sec); // UL buffer is configured for tti+4
}
void ul_buffer::set_end_of_burst()
void ul_buffer::send_end_of_burst()
{
Info("TTI %d Is end of burst\n", tti);
tti_is_end_of_burst = true;
Info("TTI %d sending end of burst\n", tti);
radio_h->tx_end();
}
bool ul_buffer::is_end_of_burst()
{
return tti_is_end_of_burst;
}
} // namespace ue
} // namespace srslte