diff --git a/srsenb/hdr/mac/mac_metrics.h b/srsenb/hdr/mac/mac_metrics.h index 4e3452ae1..35a65f8ae 100644 --- a/srsenb/hdr/mac/mac_metrics.h +++ b/srsenb/hdr/mac/mac_metrics.h @@ -43,6 +43,7 @@ struct mac_metrics_t int rx_brate; int ul_buffer; int dl_buffer; + float dl_cqi; float phr; }; diff --git a/srsenb/hdr/mac/ue.h b/srsenb/hdr/mac/ue.h index b98b07f9d..5805e5472 100644 --- a/srsenb/hdr/mac/ue.h +++ b/srsenb/hdr/mac/ue.h @@ -48,8 +48,9 @@ public: log_h = NULL; rnti = 0; pcap = NULL; - nof_failures = 0; - phr_counter = 0; + nof_failures = 0; + phr_counter = 0; + dl_cqi_counter = 0; is_phy_added = false; for (int i=0;i lc_groups[4]; - + + uint32_t phr_counter; + uint32_t dl_cqi_counter; mac_metrics_t metrics; srslte::mac_pcap* pcap; diff --git a/srsenb/src/mac/mac.cc b/srsenb/src/mac/mac.cc index fb2c3110e..63d189c20 100644 --- a/srsenb/src/mac/mac.cc +++ b/srsenb/src/mac/mac.cc @@ -329,6 +329,7 @@ int mac::cqi_info(uint32_t tti, uint16_t rnti, uint32_t cqi_value) if (ue_db.count(rnti)) { scheduler.dl_cqi_info(tti, rnti, cqi_value); + ue_db[rnti]->metrics_dl_cqi(cqi_value); } else { Error("User rnti=0x%x not found\n", rnti); return -1; diff --git a/srsenb/src/mac/scheduler_ue.cc b/srsenb/src/mac/scheduler_ue.cc index 4c6d467a2..9a258a1a3 100644 --- a/srsenb/src/mac/scheduler_ue.cc +++ b/srsenb/src/mac/scheduler_ue.cc @@ -257,7 +257,7 @@ bool sched_ue::get_pucch_sched(uint32_t current_tti, uint32_t prb_idx[2], uint32 if (L) { *L = 1; } - Info("SCHED: Reserved Format1A PUCCH for rnti=0x%x, n_prb=%d,%d, n_pucch=%d\n", rnti, prb_idx[0], prb_idx[1], n_pucch); + Debug("SCHED: Reserved Format1A PUCCH for rnti=0x%x, n_prb=%d,%d, n_pucch=%d\n", rnti, prb_idx[0], prb_idx[1], n_pucch); return true; } } @@ -271,7 +271,7 @@ bool sched_ue::get_pucch_sched(uint32_t current_tti, uint32_t prb_idx[2], uint32 if (L) { *L = 1; } - Info("SCHED: Reserved Format1 PUCCH for rnti=0x%x, n_prb=%d,%d, n_pucch=%d\n", rnti, prb_idx[0], prb_idx[1], cfg.sr_N_pucch); + Debug("SCHED: Reserved Format1 PUCCH for rnti=0x%x, n_prb=%d,%d, n_pucch=%d\n", rnti, prb_idx[0], prb_idx[1], cfg.sr_N_pucch); return true; } // Finally check Format2 (periodic CQI) @@ -284,7 +284,7 @@ bool sched_ue::get_pucch_sched(uint32_t current_tti, uint32_t prb_idx[2], uint32 if(L) { *L = 2; } - Info("SCHED: Reserved Format2 PUCCH for rnti=0x%x, n_prb=%d,%d, n_pucch=%d, pmi_idx=%d\n", + Debug("SCHED: Reserved Format2 PUCCH for rnti=0x%x, n_prb=%d,%d, n_pucch=%d, pmi_idx=%d\n", rnti, prb_idx[0], prb_idx[1], cfg.cqi_pucch, cfg.cqi_idx); return true; } diff --git a/srsenb/src/mac/ue.cc b/srsenb/src/mac/ue.cc index 0b9776918..14944b6d4 100644 --- a/srsenb/src/mac/ue.cc +++ b/srsenb/src/mac/ue.cc @@ -396,14 +396,20 @@ void ue::metrics_read(mac_metrics_t* metrics_) metrics.dl_buffer = sched->get_dl_buffer(rnti); memcpy(metrics_, &metrics, sizeof(mac_metrics_t)); - - phr_counter = 0; + + phr_counter = 0; + dl_cqi_counter = 0; bzero(&metrics, sizeof(mac_metrics_t)); } void ue::metrics_phr(float phr) { metrics.phr = SRSLTE_VEC_CMA(phr, metrics.phr, phr_counter); - phr_counter++; + phr_counter++; +} + +void ue::metrics_dl_cqi(uint32_t dl_cqi) { + metrics.dl_cqi = SRSLTE_VEC_CMA((float) dl_cqi, metrics.dl_cqi, dl_cqi_counter); + dl_cqi_counter++; } void ue::metrics_rx(bool crc, uint32_t tbs) diff --git a/srsenb/src/metrics_stdout.cc b/srsenb/src/metrics_stdout.cc index dc6b6d575..6c294b96d 100644 --- a/srsenb/src/metrics_stdout.cc +++ b/srsenb/src/metrics_stdout.cc @@ -108,8 +108,8 @@ void metrics_stdout::print_metrics() { n_reports = 0; cout << endl; - cout << "------DL-------------------UL----------------" << endl; - cout << "rnti mcs brate bler snr phr turbo mcs brate bler" << endl; + cout << "------DL-------------------------UL-------------------------------" << endl; + cout << "rnti cqi mcs brate bler snr phr mcs brate bler bsr" << endl; } if (metrics.rrc.n_ues > 0) { @@ -122,6 +122,7 @@ void metrics_stdout::print_metrics() } cout << std::hex << metrics.mac[i].rnti << " "; + cout << float_to_string(metrics.mac[i].dl_cqi, 2); cout << float_to_string(metrics.phy[i].dl.mcs, 2); if (metrics.mac[i].tx_brate > 0 && metrics_report_period) { cout << float_to_eng_string((float) metrics.mac[i].tx_brate/metrics_report_period, 2); @@ -135,7 +136,6 @@ void metrics_stdout::print_metrics() } cout << float_to_string(metrics.phy[i].ul.sinr, 2); cout << float_to_string(metrics.mac[i].phr, 2); - cout << float_to_string(metrics.phy[i].ul.turbo_iters, 2); cout << float_to_string(metrics.phy[i].ul.mcs, 2); if (metrics.mac[i].rx_brate > 0 && metrics_report_period) { cout << float_to_eng_string((float) metrics.mac[i].rx_brate/metrics_report_period, 2); @@ -147,6 +147,7 @@ void metrics_stdout::print_metrics() } else { cout << float_to_string(0, 2) << "%"; } + cout << float_to_eng_string(metrics.mac[i].ul_buffer, 2); cout << endl; } } else {