Commit bde67173 authored by hardy's avatar hardy

Merge remote-tracking branch 'origin/NR_rsrp_meas_report_fix' into integration_2021_wk47_b

parents adcccec0 a3e921ca
...@@ -2106,7 +2106,8 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in ...@@ -2106,7 +2106,8 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in
} }
// CSI // CSI
if (mac->ra.ra_state == RA_SUCCEEDED) if (mac->ra.ra_state == RA_SUCCEEDED ||
get_softmodem_params()->phy_test == 1)
O_CSI = nr_get_csi_measurements(mac, frameP, slotP, pucch); O_CSI = nr_get_csi_measurements(mac, frameP, slotP, pucch);
// ACKNACK // ACKNACK
......
...@@ -347,7 +347,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -347,7 +347,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
if ((slot == 0) && (frame & 127) == 0) { if ((slot == 0) && (frame & 127) == 0) {
stats_output[0]='\0'; stats_output[0]='\0';
dump_mac_stats(RC.nrmac[module_idP],stats_output,16384); dump_mac_stats(RC.nrmac[module_idP],stats_output,16384,true);
LOG_I(NR_MAC,"Frame.Slot %d.%d\n%s\n",frame,slot,stats_output); LOG_I(NR_MAC,"Frame.Slot %d.%d\n%s\n",frame,slot,stats_output);
} }
......
...@@ -702,7 +702,6 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) { ...@@ -702,7 +702,6 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) {
uint8_t diff_rsrp_idx = 0; uint8_t diff_rsrp_idx = 0;
uint8_t i, j; uint8_t i, j;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id];
if (n_dl_bwp < 4) if (n_dl_bwp < 4)
pdsch_bwp_id = bwp_id; pdsch_bwp_id = bwp_id;
...@@ -728,9 +727,6 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) { ...@@ -728,9 +727,6 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) {
//if strongest measured RSRP is configured //if strongest measured RSRP is configured
strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP); strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP);
// including ssb rsrp in mac stats
stats->cumul_rsrp += strongest_ssb_rsrp;
stats->num_rsrp_meas++;
ssb_rsrp[idx * nb_of_csi_ssb_report] = strongest_ssb_rsrp; ssb_rsrp[idx * nb_of_csi_ssb_report] = strongest_ssb_rsrp;
LOG_D(NR_MAC,"ssb_rsrp = %d\n",strongest_ssb_rsrp); LOG_D(NR_MAC,"ssb_rsrp = %d\n",strongest_ssb_rsrp);
...@@ -872,12 +868,12 @@ uint8_t pickandreverse_bits(uint8_t *payload, uint16_t bitlen, uint8_t start_bit ...@@ -872,12 +868,12 @@ uint8_t pickandreverse_bits(uint8_t *payload, uint16_t bitlen, uint8_t start_bit
void evaluate_rsrp_report(NR_UE_info_t *UE_info, void evaluate_rsrp_report(NR_UE_info_t *UE_info,
NR_UE_sched_ctrl_t *sched_ctrl, NR_UE_sched_ctrl_t *sched_ctrl,
int UE_id, int UE_id,
uint8_t csi_report_id, uint8_t csi_report_id,
uint8_t *payload, uint8_t *payload,
int *cumul_bits, int *cumul_bits,
NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type){ NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type){
uint8_t cri_ssbri_bitlen = UE_info->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.cri_ssbri_bitlen; uint8_t cri_ssbri_bitlen = UE_info->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.cri_ssbri_bitlen;
uint16_t curr_payload; uint16_t curr_payload;
...@@ -907,14 +903,17 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info, ...@@ -907,14 +903,17 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info,
curr_payload = pickandreverse_bits(payload, cri_ssbri_bitlen, *cumul_bits); curr_payload = pickandreverse_bits(payload, cri_ssbri_bitlen, *cumul_bits);
if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type) if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type)
sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI[csi_ssb_idx] =
*(UE_info->csi_report_template[UE_id][csi_report_id].SSB_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); *(UE_info->csi_report_template[UE_id][csi_report_id].SSB_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
else else
sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI[csi_ssb_idx] =
*(UE_info->csi_report_template[UE_id][csi_report_id].CSI_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); *(UE_info->csi_report_template[UE_id][csi_report_id].CSI_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
*cumul_bits += cri_ssbri_bitlen; *cumul_bits += cri_ssbri_bitlen;
LOG_D(MAC,"SSB_index = %d\n",sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx]); if(UE_info->csi_report_template[UE_id][csi_report_id].reportQuantity_type == NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP)
LOG_D(MAC,"CSI-RS Resource Indicator = %d\n",sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI[csi_ssb_idx]);
else
LOG_D(MAC,"SSB Resource Indicator = %d\n",sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI[csi_ssb_idx]);
} }
curr_payload = pickandreverse_bits(payload, 7, *cumul_bits); curr_payload = pickandreverse_bits(payload, 7, *cumul_bits);
...@@ -927,9 +926,14 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info, ...@@ -927,9 +926,14 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info,
*cumul_bits += 4; *cumul_bits += 4;
} }
UE_info->csi_report_template[UE_id][csi_report_id].nb_of_csi_ssb_report++; UE_info->csi_report_template[UE_id][csi_report_id].nb_of_csi_ssb_report++;
int strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP);
NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id];
// including ssb rsrp in mac stats
stats->cumul_rsrp += strongest_ssb_rsrp;
stats->num_rsrp_meas++;
LOG_D(MAC,"rsrp_id = %d rsrp = %d\n", LOG_D(MAC,"rsrp_id = %d rsrp = %d\n",
sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP, sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP,
get_measured_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP)); strongest_ssb_rsrp);
} }
...@@ -1156,7 +1160,7 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id, ...@@ -1156,7 +1160,7 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
} }
if ((uci_234->pduBitmap >> 2) & 0x01) { if ((uci_234->pduBitmap >> 2) & 0x01) {
//API to parse the csi report and store it into sched_ctrl //API to parse the csi report and store it into sched_ctrl
extract_pucch_csi_report (csi_MeasConfig, uci_234, frame, slot, UE_id, mod_id); extract_pucch_csi_report(csi_MeasConfig, uci_234, frame, slot, UE_id, mod_id);
//TCI handling function //TCI handling function
tci_handling(mod_id, UE_id,frame, slot); tci_handling(mod_id, UE_id,frame, slot);
} }
......
...@@ -442,5 +442,5 @@ bool nr_find_nb_rb(uint16_t Qm, ...@@ -442,5 +442,5 @@ bool nr_find_nb_rb(uint16_t Qm,
void nr_sr_reporting(int Mod_idP, frame_t frameP, sub_frame_t slotP); void nr_sr_reporting(int Mod_idP, frame_t frameP, sub_frame_t slotP);
void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen); void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen, bool reset_rsrp);
#endif /*__LAYER2_NR_MAC_PROTO_H__*/ #endif /*__LAYER2_NR_MAC_PROTO_H__*/
...@@ -57,7 +57,7 @@ void *nrmac_stats_thread(void *arg) { ...@@ -57,7 +57,7 @@ void *nrmac_stats_thread(void *arg) {
AssertFatal(fd!=NULL,"Cannot open nrMAC_stats.log, error %s\n",strerror(errno)); AssertFatal(fd!=NULL,"Cannot open nrMAC_stats.log, error %s\n",strerror(errno));
while (oai_exit == 0) { while (oai_exit == 0) {
dump_mac_stats(gNB,output,MACSTATSSTRLEN); dump_mac_stats(gNB,output,MACSTATSSTRLEN,false);
fprintf(fd,"%s\n",output); fprintf(fd,"%s\n",output);
fflush(fd); fflush(fd);
usleep(200000); usleep(200000);
...@@ -71,7 +71,7 @@ void clear_mac_stats(gNB_MAC_INST *gNB) { ...@@ -71,7 +71,7 @@ void clear_mac_stats(gNB_MAC_INST *gNB) {
memset((void*)gNB->UE_info.mac_stats,0,MAX_MOBILES_PER_GNB*sizeof(NR_mac_stats_t)); memset((void*)gNB->UE_info.mac_stats,0,MAX_MOBILES_PER_GNB*sizeof(NR_mac_stats_t));
} }
void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen) void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen, bool reset_rsrp)
{ {
NR_UE_info_t *UE_info = &gNB->UE_info; NR_UE_info_t *UE_info = &gNB->UE_info;
int num = 1; int num = 1;
...@@ -102,9 +102,10 @@ void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen) ...@@ -102,9 +102,10 @@ void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen)
stats->pucch0_DTX, stats->pucch0_DTX,
sched_ctrl->dl_bler_stats.bler, sched_ctrl->dl_bler_stats.bler,
sched_ctrl->dl_bler_stats.mcs); sched_ctrl->dl_bler_stats.mcs);
if (reset_rsrp) {
stats->num_rsrp_meas = 0; stats->num_rsrp_meas = 0;
stats->cumul_rsrp = 0 ; stats->cumul_rsrp = 0;
}
stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %"PRIu64"\n", UE_id, stats->dlsch_total_bytes); stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %"PRIu64"\n", UE_id, stats->dlsch_total_bytes);
stroff+=sprintf(output+stroff,"UE %d: ulsch_rounds %"PRIu64"/%"PRIu64"/%"PRIu64"/%"PRIu64", ulsch_DTX %d, ulsch_errors %"PRIu64"\n", stroff+=sprintf(output+stroff,"UE %d: ulsch_rounds %"PRIu64"/%"PRIu64"/%"PRIu64"/%"PRIu64", ulsch_DTX %d, ulsch_errors %"PRIu64"\n",
UE_id, UE_id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment