Merge branch 'next' into next_testers

master
Ismael Gomez 7 years ago
commit 3ea3469cef

@ -43,6 +43,7 @@ struct mac_metrics_t
int rx_brate; int rx_brate;
int ul_buffer; int ul_buffer;
int dl_buffer; int dl_buffer;
float dl_cqi;
float phr; float phr;
}; };

@ -48,8 +48,9 @@ public:
log_h = NULL; log_h = NULL;
rnti = 0; rnti = 0;
pcap = NULL; pcap = NULL;
nof_failures = 0; nof_failures = 0;
phr_counter = 0; phr_counter = 0;
dl_cqi_counter = 0;
is_phy_added = false; is_phy_added = false;
for (int i=0;i<NOF_HARQ_PROCESSES;i++) { for (int i=0;i<NOF_HARQ_PROCESSES;i++) {
pending_buffers[i] = NULL; pending_buffers[i] = NULL;
@ -91,8 +92,10 @@ public:
void metrics_read(srsenb::mac_metrics_t* metrics); void metrics_read(srsenb::mac_metrics_t* metrics);
void metrics_rx(bool crc, uint32_t tbs); void metrics_rx(bool crc, uint32_t tbs);
void metrics_tx(bool crc, uint32_t tbs); void metrics_tx(bool crc, uint32_t tbs);
void metrics_phr(float phr);
void metrics_dl_cqi(uint32_t dl_cqi);
bool is_phy_added; bool is_phy_added;
private: private:
@ -100,12 +103,11 @@ private:
void allocate_sdu(srslte::sch_pdu *pdu, uint32_t lcid, uint32_t sdu_len); void allocate_sdu(srslte::sch_pdu *pdu, uint32_t lcid, uint32_t sdu_len);
bool process_ce(srslte::sch_subh *subh); bool process_ce(srslte::sch_subh *subh);
void allocate_ce(srslte::sch_pdu *pdu, uint32_t lcid); void allocate_ce(srslte::sch_pdu *pdu, uint32_t lcid);
void metrics_phr(float phr);
uint32_t phr_counter;
std::vector<uint32_t> lc_groups[4]; std::vector<uint32_t> lc_groups[4];
uint32_t phr_counter;
uint32_t dl_cqi_counter;
mac_metrics_t metrics; mac_metrics_t metrics;
srslte::mac_pcap* pcap; srslte::mac_pcap* pcap;

@ -329,6 +329,7 @@ int mac::cqi_info(uint32_t tti, uint16_t rnti, uint32_t cqi_value)
if (ue_db.count(rnti)) { if (ue_db.count(rnti)) {
scheduler.dl_cqi_info(tti, rnti, cqi_value); scheduler.dl_cqi_info(tti, rnti, cqi_value);
ue_db[rnti]->metrics_dl_cqi(cqi_value);
} else { } else {
Error("User rnti=0x%x not found\n", rnti); Error("User rnti=0x%x not found\n", rnti);
return -1; return -1;

@ -257,7 +257,7 @@ bool sched_ue::get_pucch_sched(uint32_t current_tti, uint32_t prb_idx[2], uint32
if (L) { if (L) {
*L = 1; *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; return true;
} }
} }
@ -271,7 +271,7 @@ bool sched_ue::get_pucch_sched(uint32_t current_tti, uint32_t prb_idx[2], uint32
if (L) { if (L) {
*L = 1; *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; return true;
} }
// Finally check Format2 (periodic CQI) // 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) { if(L) {
*L = 2; *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); rnti, prb_idx[0], prb_idx[1], cfg.cqi_pucch, cfg.cqi_idx);
return true; return true;
} }

@ -396,14 +396,20 @@ void ue::metrics_read(mac_metrics_t* metrics_)
metrics.dl_buffer = sched->get_dl_buffer(rnti); metrics.dl_buffer = sched->get_dl_buffer(rnti);
memcpy(metrics_, &metrics, sizeof(mac_metrics_t)); memcpy(metrics_, &metrics, sizeof(mac_metrics_t));
phr_counter = 0; phr_counter = 0;
dl_cqi_counter = 0;
bzero(&metrics, sizeof(mac_metrics_t)); bzero(&metrics, sizeof(mac_metrics_t));
} }
void ue::metrics_phr(float phr) { void ue::metrics_phr(float phr) {
metrics.phr = SRSLTE_VEC_CMA(phr, metrics.phr, phr_counter); 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) void ue::metrics_rx(bool crc, uint32_t tbs)

@ -108,8 +108,8 @@ void metrics_stdout::print_metrics()
{ {
n_reports = 0; n_reports = 0;
cout << endl; cout << endl;
cout << "------DL-------------------UL----------------" << endl; cout << "------DL-------------------------UL-------------------------------" << endl;
cout << "rnti mcs brate bler snr phr turbo mcs brate bler" << endl; cout << "rnti cqi mcs brate bler snr phr mcs brate bler bsr" << endl;
} }
if (metrics.rrc.n_ues > 0) { if (metrics.rrc.n_ues > 0) {
@ -122,6 +122,7 @@ void metrics_stdout::print_metrics()
} }
cout << std::hex << metrics.mac[i].rnti << " "; 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); cout << float_to_string(metrics.phy[i].dl.mcs, 2);
if (metrics.mac[i].tx_brate > 0 && metrics_report_period) { 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); 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.phy[i].ul.sinr, 2);
cout << float_to_string(metrics.mac[i].phr, 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); cout << float_to_string(metrics.phy[i].ul.mcs, 2);
if (metrics.mac[i].rx_brate > 0 && metrics_report_period) { 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); 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 { } else {
cout << float_to_string(0, 2) << "%"; cout << float_to_string(0, 2) << "%";
} }
cout << float_to_eng_string(metrics.mac[i].ul_buffer, 2);
cout << endl; cout << endl;
} }
} else { } else {

Loading…
Cancel
Save