Commit d9d39305 authored by r.karey's avatar r.karey Committed by guhan

Added more logs and fixed assertion

parent e6f43992
...@@ -949,6 +949,8 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, ...@@ -949,6 +949,8 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
n_set = pucch_Config->resourceSetToAddModList->list.count; n_set = pucch_Config->resourceSetToAddModList->list.count;
AssertFatal(n_set>0,"PUCCH resourceSetToAddModList is empty\n"); AssertFatal(n_set>0,"PUCCH resourceSetToAddModList is empty\n");
LOG_I(MAC, "UCI n_set= %d\n", n_set);
N2 = 2; N2 = 2;
// procedure to select pucch resource id from resource sets according to // procedure to select pucch resource id from resource sets according to
// number of uci bits and pucch resource indicator pucch_resource // number of uci bits and pucch resource indicator pucch_resource
...@@ -976,6 +978,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, ...@@ -976,6 +978,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
} }
else N2 = N3; else N2 = N3;
} }
LOG_I(MAC, "UCI resource id = %ld\n", *resource_id);
} }
AssertFatal(resource_id!=NULL,"Couldn-t find any matching PUCCH resource in the PUCCH resource sets"); AssertFatal(resource_id!=NULL,"Couldn-t find any matching PUCCH resource in the PUCCH resource sets");
...@@ -1014,6 +1017,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, ...@@ -1014,6 +1017,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
pucch_pdu->sr_flag = O_sr; pucch_pdu->sr_flag = O_sr;
break; break;
case NR_PUCCH_Resource__format_PR_format2 : case NR_PUCCH_Resource__format_PR_format2 :
LOG_I(MAC,"UCI format2 is being scheduled\n");
pucch_pdu->format_type = 2; pucch_pdu->format_type = 2;
pucch_pdu->nr_of_symbols = pucchres->format.choice.format2->nrofSymbols; pucch_pdu->nr_of_symbols = pucchres->format.choice.format2->nrofSymbols;
pucch_pdu->start_symbol_index = pucchres->format.choice.format2->startingSymbolIndex; pucch_pdu->start_symbol_index = pucchres->format.choice.format2->startingSymbolIndex;
......
...@@ -78,20 +78,32 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) { ...@@ -78,20 +78,32 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) {
//!TODO : smae function can be written to handle csi_resources //!TODO : smae function can be written to handle csi_resources
uint8_t get_ssb_resources (NR_CSI_MeasConfig_t *csi_MeasConfig, uint8_t get_ssb_resources (NR_CSI_MeasConfig_t *csi_MeasConfig,
NR_CSI_ResourceConfigId_t csi_ResourceConfigId, NR_CSI_ResourceConfigId_t csi_ResourceConfigId,
NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type) { NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type,
uint8_t *nb_resource_sets) {
uint8_t idx = 0; uint8_t idx = 0;
//uint8_t csi_ssb_idx =0; uint8_t csi_ssb_idx =0;
for ( idx = 0; idx < csi_MeasConfig->csi_ResourceConfigToAddModList->list.count; idx++) { for ( idx = 0; idx < csi_MeasConfig->csi_ResourceConfigToAddModList->list.count; idx++) {
if ( csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[idx]->csi_ResourceConfigId == csi_ResourceConfigId) { if ( csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[idx]->csi_ResourceConfigId == csi_ResourceConfigId) {
//Finding the CSI_RS or SSB Resources //Finding the CSI_RS or SSB Resources
if ( csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[idx]->csi_RS_ResourceSetList.present == NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB) { if ( csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[idx]->csi_RS_ResourceSetList.present == NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB) {
if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type ) if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type ){
return (csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[idx]->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list.count); *nb_resource_sets=csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[idx]->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list.count;
for ( csi_ssb_idx = 0; csi_ssb_idx < csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.count; csi_ssb_idx++) {
if (csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_ssb_idx]->csi_SSB_ResourceSetId ==
*(csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[idx]->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list.array[0])) {
return csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_ssb_idx]->csi_SSB_ResourceList.list.count;
} else {
//handle error condition
AssertFatal(csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_ssb_idx]->csi_SSB_ResourceSetId, "csi_SSB_ResourcesSetId is not configured");
}
}
}
else if (NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP == reportQuantity_type) else if (NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP == reportQuantity_type)
return (csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[idx]->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list.count); *nb_resource_sets=csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[idx]->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list.count;
} else { } else {
//TODO: find the CSI_RS IM resources //TODO: find the CSI_RS IM resources
...@@ -171,15 +183,17 @@ void extract_pucch_csi_report ( NR_CSI_MeasConfig_t *csi_MeasConfig, ...@@ -171,15 +183,17 @@ void extract_pucch_csi_report ( NR_CSI_MeasConfig_t *csi_MeasConfig,
AssertFatal(reportQuantity_type, "reportQuantity is not configured"); AssertFatal(reportQuantity_type, "reportQuantity is not configured");
if ( NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type ) { if ( NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type ) {
uint8_t nb_ssb_resource_set = get_ssb_resources(csi_MeasConfig, uint8_t nb_ssb_resource_set=0;
uint8_t nb_ssb_resources = get_ssb_resources(csi_MeasConfig,
csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->resourcesForChannelMeasurement, csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->resourcesForChannelMeasurement,
reportQuantity_type);//csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[0]->CSI_SSB_ResourceList.list.count; reportQuantity_type,&nb_ssb_resource_set);//csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[0]->CSI_SSB_ResourceList.list.count;
uint8_t idx = 0; uint8_t idx = 0;
uint8_t ssb_idx = 0; uint8_t ssb_idx = 0;
uint8_t diff_rsrp_idx = 0; uint8_t diff_rsrp_idx = 0;
uint8_t bitlen_ssbri = log (nb_ssb_resource_set)/log (2); uint8_t bitlen_ssbri = log (nb_ssb_resources)/log (2);
sched_ctrl->nr_of_csi_report[UE_id] = nb_ssb_resource_set; sched_ctrl->nr_of_csi_report[UE_id] = nb_ssb_resource_set;
LOG_I(MAC,"csi_payload = %d, bitlen_ssbri = %d, nb_ssb_resource_set = %d,nb_ssb_resources = %d\n",payload_size, bitlen_ssbri, nb_ssb_resource_set,nb_ssb_resources);
/*! As per the spec 38.212 and table: 6.3.1.1.2-12 in a single UCI sequence we can have multiple CSI_report /*! As per the spec 38.212 and table: 6.3.1.1.2-12 in a single UCI sequence we can have multiple CSI_report
* the number of CSI_report will depend on number of CSI resource sets that are configured in CSI-ResourceConfig RRC IE * the number of CSI_report will depend on number of CSI resource sets that are configured in CSI-ResourceConfig RRC IE
* From spec 38.331 from the IE CSI-ResourceConfig for SSB RSRP reporting we can configure only one resource set * From spec 38.331 from the IE CSI-ResourceConfig for SSB RSRP reporting we can configure only one resource set
...@@ -216,6 +230,7 @@ void extract_pucch_csi_report ( NR_CSI_MeasConfig_t *csi_MeasConfig, ...@@ -216,6 +230,7 @@ void extract_pucch_csi_report ( NR_CSI_MeasConfig_t *csi_MeasConfig,
} }
sched_ctrl->CSI_report[UE_id][idx].choice.ssb_cri_report.RSRP = (*payload) & 0x7f; sched_ctrl->CSI_report[UE_id][idx].choice.ssb_cri_report.RSRP = (*payload) & 0x7f;
*payload >>= 7;
for ( diff_rsrp_idx =0; diff_rsrp_idx <= sched_ctrl->CSI_report[UE_id][idx].choice.ssb_cri_report.nr_ssbri_cri - 1; diff_rsrp_idx++ ) { for ( diff_rsrp_idx =0; diff_rsrp_idx <= sched_ctrl->CSI_report[UE_id][idx].choice.ssb_cri_report.nr_ssbri_cri - 1; diff_rsrp_idx++ ) {
sched_ctrl->CSI_report[UE_id][idx].choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx] = (*payload) & 0x0f; sched_ctrl->CSI_report[UE_id][idx].choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx] = (*payload) & 0x0f;
...@@ -232,6 +247,7 @@ void extract_pucch_csi_report ( NR_CSI_MeasConfig_t *csi_MeasConfig, ...@@ -232,6 +247,7 @@ void extract_pucch_csi_report ( NR_CSI_MeasConfig_t *csi_MeasConfig,
} }
sched_ctrl->CSI_report[UE_id][idx].choice.ssb_cri_report.RSRP = (*payload) & 0x7f; sched_ctrl->CSI_report[UE_id][idx].choice.ssb_cri_report.RSRP = (*payload) & 0x7f;
*payload >>= 7;
/** From Table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel */ /** From Table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel */
sched_ctrl->CSI_report[UE_id][idx].choice.ssb_cri_report.diff_RSRP[0] = (*payload) & 0x0f; sched_ctrl->CSI_report[UE_id][idx].choice.ssb_cri_report.diff_RSRP[0] = (*payload) & 0x0f;
*payload >>= 4; *payload >>= 4;
......
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