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 ul_buffer;
int dl_buffer;
float dl_cqi;
float phr;
};

@ -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<NOF_HARQ_PROCESSES;i++) {
pending_buffers[i] = NULL;
@ -91,6 +92,8 @@ public:
void metrics_read(srsenb::mac_metrics_t* metrics);
void metrics_rx(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;
@ -101,11 +104,10 @@ private:
bool process_ce(srslte::sch_subh *subh);
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];
uint32_t phr_counter;
uint32_t dl_cqi_counter;
mac_metrics_t metrics;
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)) {
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;

@ -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;
}

@ -398,6 +398,7 @@ void ue::metrics_read(mac_metrics_t* metrics_)
memcpy(metrics_, &metrics, sizeof(mac_metrics_t));
phr_counter = 0;
dl_cqi_counter = 0;
bzero(&metrics, sizeof(mac_metrics_t));
}
@ -406,6 +407,11 @@ void ue::metrics_phr(float phr) {
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)
{
if (crc) {

@ -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 {

Loading…
Cancel
Save