removed tti from some mac subcomponent interfaces

master
Francisco Paisana 5 years ago committed by Francisco Paisana
parent d3f49d0e3c
commit e3e5b5be11

@ -58,7 +58,7 @@ public:
void reset(); void reset();
void init(rlc_interface_mac* rlc, bsr_interface_mux* bsr_procedure, phr_proc* phr_procedure_); void init(rlc_interface_mac* rlc, bsr_interface_mux* bsr_procedure, phr_proc* phr_procedure_);
void step(const uint32_t tti); void step();
bool is_pending_any_sdu(); bool is_pending_any_sdu();
bool is_pending_sdu(uint32_t lcid); bool is_pending_sdu(uint32_t lcid);

@ -97,7 +97,6 @@ private:
triggered_bsr_type_t triggered_bsr_type; triggered_bsr_type_t triggered_bsr_type;
bool sr_is_sent; bool sr_is_sent;
uint32_t last_print;
uint32_t current_tti; uint32_t current_tti;
uint32_t trigger_tti; uint32_t trigger_tti;

@ -212,7 +212,7 @@ void mac::run_tti(const uint32_t tti)
// Step all procedures // Step all procedures
Debug("Running MAC tti=%d\n", tti); Debug("Running MAC tti=%d\n", tti);
mux_unit.step(tti); mux_unit.step();
bsr_procedure.step(tti); bsr_procedure.step(tti);
phr_procedure.step(tti); phr_procedure.step(tti);

@ -56,7 +56,7 @@ void mux::reset()
pending_crnti_ce = 0; pending_crnti_ce = 0;
} }
void mux::step(const uint32_t tti) void mux::step()
{ {
std::lock_guard<std::mutex> lock(mutex); std::lock_guard<std::mutex> lock(mutex);

@ -34,7 +34,6 @@ bsr_proc::bsr_proc()
{ {
log_h = NULL; log_h = NULL;
initiated = false; initiated = false;
last_print = 0;
current_tti = 0; current_tti = 0;
trigger_tti = 0; trigger_tti = 0;
triggered_bsr_type = NONE; triggered_bsr_type = NONE;
@ -52,6 +51,24 @@ void bsr_proc::init(rlc_interface_mac* rlc_, srslte::log* log_h_, srslte::timer_
timer_retx = timers_db->get_unique_timer(); timer_retx = timers_db->get_unique_timer();
reset(); reset();
// Print periodically the LCID queue status
auto queue_status_print_task = [this]() {
char str[128];
str[0] = '\0';
int n = 0;
for (auto& lcg : lcgs) {
for (auto& iter : lcg) {
n = srslte_print_check(str, 128, n, "%d: %d ", iter.first, iter.second.old_buffer);
}
}
Info("BSR: triggered_bsr_type=%d, LCID QUEUE status: %s\n", triggered_bsr_type, str);
};
timers_db->defer_callback(QUEUE_STATUS_PERIOD_MS, [this, queue_status_print_task]() {
queue_status_print_task();
timers_db->defer_callback(QUEUE_STATUS_PERIOD_MS, queue_status_print_task);
});
initiated = true; initiated = true;
} }
@ -269,6 +286,7 @@ void bsr_proc::step(uint32_t tti)
} }
pthread_mutex_lock(&mutex); pthread_mutex_lock(&mutex);
current_tti = tti; current_tti = tti;
update_new_data(); update_new_data();
@ -280,18 +298,6 @@ void bsr_proc::step(uint32_t tti)
update_buffer_state(); update_buffer_state();
if ((tti - last_print) % 10240 > QUEUE_STATUS_PERIOD_MS) {
char str[128];
str[0] = '\0';
int n = 0;
for (int i = 0; i < NOF_LCG; i++) {
for (std::map<uint32_t, lcid_t>::iterator iter = lcgs[i].begin(); iter != lcgs[i].end(); ++iter) {
n = srslte_print_check(str, 128, n, "%d: %d ", iter->first, iter->second.old_buffer);
}
}
Info("BSR: triggered_bsr_type=%d, LCID QUEUE status: %s\n", triggered_bsr_type, str);
last_print = tti;
}
pthread_mutex_unlock(&mutex); pthread_mutex_unlock(&mutex);
} }

Loading…
Cancel
Save