Fix ulprbbl based on SRS
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
#define CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD "pucch0_dtx_threshold"
|
||||
#define CONFIG_STRING_L1_PRACH_DTX_THRESHOLD "prach_dtx_threshold"
|
||||
#define CONFIG_STRING_L1_PUSCH_DTX_THRESHOLD "pusch_dtx_threshold"
|
||||
#define CONFIG_STRING_L1_SRS_DTX_THRESHOLD "srs_dtx_threshold"
|
||||
#define CONFIG_STRING_L1_MAX_LDPC_ITERATIONS "max_ldpc_iterations"
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* L1 configuration parameters */
|
||||
@@ -71,6 +72,7 @@
|
||||
{CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:100, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_L1_PRACH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:150, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_L1_PUSCH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:50, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_L1_SRS_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:50, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_L1_MAX_LDPC_ITERATIONS, NULL, 0, uptr:NULL, defintval:5, TYPE_UINT, 0}, \
|
||||
}
|
||||
#define L1_CC_IDX 0
|
||||
@@ -87,7 +89,8 @@
|
||||
#define L1_PUCCH0_DTX_THRESHOLD 11
|
||||
#define L1_PRACH_DTX_THRESHOLD 12
|
||||
#define L1_PUSCH_DTX_THRESHOLD 13
|
||||
#define L1_MAX_LDPC_ITERATIONS 14
|
||||
#define L1_SRS_DTX_THRESHOLD 14
|
||||
#define L1_MAX_LDPC_ITERATIONS 15
|
||||
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#endif
|
||||
|
||||
@@ -731,6 +731,7 @@ void RCconfig_NR_L1(void) {
|
||||
RC.gNB[j]->pucch0_thres = *(L1_ParamList.paramarray[j][L1_PUCCH0_DTX_THRESHOLD].uptr);
|
||||
RC.gNB[j]->prach_thres = *(L1_ParamList.paramarray[j][L1_PRACH_DTX_THRESHOLD].uptr);
|
||||
RC.gNB[j]->pusch_thres = *(L1_ParamList.paramarray[j][L1_PUSCH_DTX_THRESHOLD].uptr);
|
||||
RC.gNB[j]->srs_thres = *(L1_ParamList.paramarray[j][L1_SRS_DTX_THRESHOLD].uptr);
|
||||
RC.gNB[j]->max_ldpc_iterations = *(L1_ParamList.paramarray[j][L1_MAX_LDPC_ITERATIONS].uptr);
|
||||
RC.gNB[j]->num_ulprbbl = num_prbbl;
|
||||
RC.gNB[j]->ap_N1 = N1;
|
||||
|
||||
@@ -795,8 +795,8 @@ void handle_nr_srs_measurements(const module_id_t module_id,
|
||||
const uint8_t num_symbols,
|
||||
const uint8_t wide_band_snr,
|
||||
const uint8_t num_reported_symbols,
|
||||
nfapi_nr_srs_indication_reported_symbol_t* reported_symbol_list) {
|
||||
|
||||
nfapi_nr_srs_indication_reported_symbol_t *reported_symbol_list)
|
||||
{
|
||||
LOG_D(NR_MAC, "(%d.%d) Received SRS indication for rnti: 0x%04x\n", frame, slot, rnti);
|
||||
|
||||
#ifdef SRS_IND_DEBUG
|
||||
@@ -805,32 +805,39 @@ void handle_nr_srs_measurements(const module_id_t module_id,
|
||||
LOG_I(NR_MAC, "rnti = 0x%04x\n", rnti);
|
||||
LOG_I(NR_MAC, "timing_advance = %i\n", timing_advance);
|
||||
LOG_I(NR_MAC, "num_symbols = %i\n", num_symbols);
|
||||
LOG_I(NR_MAC, "wide_band_snr = %i (%i dB)\n", wide_band_snr, (wide_band_snr>>1)-64);
|
||||
LOG_I(NR_MAC, "wide_band_snr = %i (%i dB)\n", wide_band_snr, (wide_band_snr >> 1) - 64);
|
||||
LOG_I(NR_MAC, "num_reported_symbols = %i\n", num_reported_symbols);
|
||||
LOG_I(NR_MAC, "reported_symbol_list[0].num_rbs = %i\n", reported_symbol_list[0].num_rbs);
|
||||
for(int rb = 0; rb < reported_symbol_list[0].num_rbs; rb++) {
|
||||
LOG_I(NR_MAC, "reported_symbol_list[0].rb_list[%3i].rb_snr = %i (%i dB)\n",
|
||||
rb, reported_symbol_list[0].rb_list[rb].rb_snr, (reported_symbol_list[0].rb_list[rb].rb_snr>>1)-64);
|
||||
for (int rb = 0; rb < reported_symbol_list[0].num_rbs; rb++) {
|
||||
LOG_I(NR_MAC, "reported_symbol_list[0].rb_list[%3i].rb_snr = %i (%i dB)\n", rb, reported_symbol_list[0].rb_list[rb].rb_snr, (reported_symbol_list[0].rb_list[rb].rb_snr >> 1) - 64);
|
||||
}
|
||||
#endif
|
||||
|
||||
NR_UE_info_t *UE = find_nr_UE(&RC.nrmac[module_id]->UE_info, rnti);
|
||||
if (!UE) {
|
||||
LOG_W(NR_MAC, "Could not find UE for RNTI 0x%04x\n", rnti);
|
||||
LOG_W(NR_MAC, "Could not find UE for RNTI %04x\n", rnti);
|
||||
return;
|
||||
}
|
||||
|
||||
if (wide_band_snr == 0xFF) {
|
||||
LOG_W(NR_MAC, "Invalid wide_band_snr for RNTI %04x\n", rnti);
|
||||
return;
|
||||
}
|
||||
|
||||
int wide_band_snr_dB = (wide_band_snr >> 1) - 64;
|
||||
|
||||
gNB_MAC_INST *nr_mac = RC.nrmac[module_id];
|
||||
NR_mac_stats_t *stats = &UE->mac_stats;
|
||||
stats->srs_wide_band_snr = (wide_band_snr>>1)-64;
|
||||
stats->srs_wide_band_snr = wide_band_snr_dB;
|
||||
|
||||
const int ul_prbblack_SNR_threshold = nr_mac->ul_prbblack_SNR_threshold;
|
||||
uint16_t *ulprbbl = nr_mac->ulprbbl;
|
||||
|
||||
memset(ulprbbl, 0, reported_symbol_list[0].num_rbs*sizeof(uint16_t));
|
||||
memset(ulprbbl, 0, reported_symbol_list[0].num_rbs * sizeof(uint16_t));
|
||||
|
||||
for (int rb = 0; rb < reported_symbol_list[0].num_rbs; rb++) {
|
||||
int snr = (reported_symbol_list[0].rb_list[rb].rb_snr>>1)-64;
|
||||
if (snr < ul_prbblack_SNR_threshold) {
|
||||
int snr = (reported_symbol_list[0].rb_list[rb].rb_snr >> 1) - 64;
|
||||
if (snr < wide_band_snr_dB - ul_prbblack_SNR_threshold) {
|
||||
ulprbbl[rb] = 0x3FFF; // all symbols taken
|
||||
}
|
||||
LOG_D(NR_MAC, "ulprbbl[%3i] = 0x%x\n", rb, ulprbbl[rb]);
|
||||
|
||||
Reference in New Issue
Block a user