Commit 3a924009 authored by Bo Zhao's avatar Bo Zhao Committed by Thomas Schlichter

DL AMC based on the SINR report from UE

- get the reported SINR value from the index
- use BLER vs SNR look-up table from dlsim simulation (BLER threshold 10^-3)
- add a flag at gNB from CML to activate AMC
- add additional SINR offset at gNB from CML, to apply to the reported value for DL AMC
parent c61d0b6c
......@@ -137,6 +137,8 @@
#define CONFIG_HLP_TO_Iinit "Init the I part of the PI controller for timing offset compensation"
#define CONFIG_HLP_AGC "Enable Receive Automatic Gain control"
#define CONFIG_HLP_ULPC "Enable NR Uplink power control for PUSCH and PUCCH"
#define CONFIG_HLP_AMC "flag to use adaptive modulation and coding: 1 = use AMC \n"
#define CONFIG_HLP_SINR_OSET_DL "Additional SINR offset in [dB] applied to the reported SINR from UE for DL AMC \n"
/*--------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters for LOG utility */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
......
......@@ -42,10 +42,14 @@
{"PET" , CONFIG_HLP_PathEnd, 0, .u16ptr=&pathEndingTime, .defintval=1280, TYPE_UINT16, 0}, \
{"ue_PosY" , CONFIG_HLP_uePosY, 0, .iptr=&uePosY, .defintval=0, TYPE_INT, 0}, \
{"FDC" , CONFIG_HLP_FDopplerPrePost,0, .iptr=&fdopplerPrePost, .defintval=0, TYPE_INT32, 0}, \
{"FC" , CONFIG_HLP_FDopplerComp, 0, .iptr=&fdopplerComp, .defintval=0, TYPE_INT32, 0} \
{"FC" , CONFIG_HLP_FDopplerComp, 0, .iptr=&fdopplerComp, .defintval=0, TYPE_INT32, 0}, \
{"amc" , CONFIG_HLP_AMC, 0, .u8ptr=&amc_flag, .defdblval=0, TYPE_UINT8, 0}, \
{"sinr-offset-dl" , CONFIG_HLP_SINR_OSET_DL, 0, .dblptr=&sinr_offset_dl, .defdblval=0, TYPE_DOUBLE, 0} \
}
// clang-format on
extern uint8_t amc_flag; // flag to use adaptive modulation and coding
extern double sinr_offset_dl; // additional SINR offset in [dB] applied to the reported SINR from UE for DL AMC
extern uint32_t target_dl_mcs;
extern uint32_t target_dl_Nl;
extern uint32_t target_ul_Nl;
......
......@@ -53,6 +53,13 @@
#define WORD 32
//#define SIZE_OF_POINTER sizeof (void *)
// look-up table for AMC. Based on BLER vs SNR curves from the DLsim simulation
// SNR Thresholds for MCS 0 - 28; with a resolution of 0.5dB; to maintain a BLER of 10^-3;
// [min <= ... < max] for each MCS
const uint8_t Nr_MCS = 29; // 0-28
float SINR_MCS_mapping[29] = {3, 3, 3.5, 4, 4.5, 5, 5.5, 6, 7, 7.5, 9.5, 10, 11, 11.5, 12.5,
13, 13.5, 15, 16, 16.5, 17.5, 18, 19, 20, 21, 22, 23, 24, 25.5};
const int get_dl_tda(const gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon_t *scc, int slot) {
/* we assume that this function is mutex-protected from outside */
......@@ -583,6 +590,19 @@ static int comparator(const void *p, const void *q) {
return ((UEsched_t*)p)->coef < ((UEsched_t*)q)->coef;
}
uint8_t get_MCS_from_SINR(float SINR)
{
for (int i = Nr_MCS - 1; i >= 0; i--) {
if (SINR >= SINR_MCS_mapping[i])
return i;
}
LOG_I(MAC, "SINR (%f dB) too low, no MCS possible to achieve BLER of 10^-3\n", SINR);
return 0;
}
extern uint8_t amc_flag; // flag to use adaptive modulation and coding
extern double sinr_offset_dl; // additional SINR offset in [dB] applied to the reported SINR from UE for DL AMC
static void pf_dl(module_id_t module_id,
frame_t frame,
sub_frame_t slot,
......@@ -657,7 +677,10 @@ static void pf_dl(module_id_t module_id,
const NR_bler_options_t *bo = &mac->dl_bler;
const int max_mcs_table = current_BWP->mcsTableIdx == 1 ? 27 : 28;
const int max_mcs = min(sched_ctrl->dl_max_mcs, max_mcs_table);
if (bo->harq_round_max == 1)
if (amc_flag) {
float SINR = get_measured_sinr(sched_ctrl->CSI_report.ssb_cri_report.SINR);
sched_pdsch->mcs = min(get_MCS_from_SINR(SINR + sinr_offset_dl), max_mcs);
} else if (bo->harq_round_max == 1)
sched_pdsch->mcs = max_mcs;
else
sched_pdsch->mcs = get_mcs_from_bler(bo, stats, &sched_ctrl->dl_bler_stats, max_mcs, frame);
......
......@@ -41,6 +41,8 @@ extern RAN_CONTEXT_t RC;
//#define ENABLE_MAC_PAYLOAD_DEBUG 1
uint8_t amc_flag = 0; // flag to use adaptive modulation and coding
double sinr_offset_dl = 0.0; // additional SINR offset in [dB] applied to the reported SINR from UE for DL AMC
uint32_t target_dl_mcs = 9;
uint32_t target_dl_Nl = 1;
uint32_t target_dl_bw = 50;
......@@ -154,6 +156,12 @@ void nr_preprocessor_phytest(module_id_t module_id,
&tda_info,
target_dl_Nl);
if (amc_flag) {
if (sched_ctrl->retrans_dl_harq.head == -1) { // first transmission only
float SINR = get_measured_sinr(sched_ctrl->CSI_report.ssb_cri_report.SINR);
sched_pdsch->mcs = get_MCS_from_SINR(SINR + sinr_offset_dl);
}
} else
sched_pdsch->mcs = target_dl_mcs;
sched_pdsch->nrOfLayers = target_dl_Nl;
sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, dl_bwp->mcsTableIdx);
......
......@@ -131,22 +131,33 @@ static const int L1_SSB_CSI_RSRP_measReport_mapping_38133_10_1_6_1_1[128] = {
//Differential RSRP values Table 10.1.6.1-2 from 36.133
//Stored the upper limits[MAX RSRP Value]
static const int diff_rsrp_ssb_csi_meas_10_1_6_1_2[16] = {
0,
-2,
-4,
-6,
-8,
-10,
-12,
-14,
-16,
-18, // 0 - 9
-20,
-22,
-24,
-26,
-28,
-30 // 10 - 15
0, -2, -4, -6, -8, -10, -12, -14, -16, -18, // 0 - 9
-20, -22, -24, -26, -28, -30 // 10 - 15
};
// Measured SINR Values Table 10.1.16.1-1 from 38.133 V16.7.0
// Stored all the lower limits[Min SINR Value of corresponding index]
float L1_SSB_CSI_SINR_measReport_mapping_38133_10_1_16_1_1[128] = {
INT_MIN, -23, -22.5, -22, -21.5, -21, -20.5, -20, -19.5, -19, // 0 - 9
-18.5, -18, -17.5, -17, -16.5, -16, -15.5, -15, -14.5, -14, // 10 - 19
-13.5, -13, -12.5, -12, -11.5, -11, -10.5, -10, -9.5, -9, // 20 - 29
-8.5, -8, -7.5, -7, -6.5, -6, -5.5, -5, -4.5, -4, // 30 - 39
-3.5, -3, -2.5, -2, -1.5, -1, -0.5, 0, 0.5, 1, // 40 - 49
1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, // 50 - 59
6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10, 10.5, 11, // 60 - 69
11.5, 12, 12.5, 13, 13.5, 14, 14.5, 15, 15.5, 16, // 70 - 79
16.5, 17, 17.5, 18, 18.5, 19, 19.5, 20, 20.5, 21, // 80 - 89
21.5, 22, 22.5, 23, 23.5, 24, 24.5, 25, 25.5, 26, // 90 - 99
26.5, 27, 27.5, 28, 28.5, 29, 29.5, 30, 30.5, 31, // 100 - 109
31.5, 32, 32.5, 33, 33.5, 34, 34.5, 35, 35.5, 36, // 110 - 119
36.5, 37, 37.5, 38, 38.5, 39, 39.5, 40 // 120 - 127
};
// Differential SINR values Table 10.1.16.1-2 from 38.133 V16.7.0
// Stored the upper limits[MAX delta SINR Value]
int diff_sinr_ssb_csi_meas_10_1_16_1_2[16] = {
0, -1, -2, -3, -4, -5, -6, -7, -8, -9, // 0 - 9
-10, -11, -12, -13, -14, -15 // 10 - 15
};
static int get_pucch_index(int frame, int slot, int n_slots_frame, const NR_TDD_UL_DL_Pattern_t *tdd, int sched_pucch_size)
......@@ -488,6 +499,18 @@ static int get_diff_rsrp(uint8_t index, int strongest_rsrp) {
return MIN_RSRP_VALUE;
}
// returns the measured SINR value (lower limit)
float get_measured_sinr(uint8_t index)
{
// if index is invalid, return minimum value
if (index > 127) {
LOG_E(MAC, "%s: invalid SINR report index: %d\n", __func__, index);
return INT_MIN; // invalid index
}
return L1_SSB_CSI_SINR_measReport_mapping_38133_10_1_16_1_1[index];
}
//identifies the target SSB Beam index
//keeps the required date for PDCCH and PDSCH TCI state activation/deactivation CE consutruction globally
//handles triggering of PDCCH and PDSCH MAC CEs
......
......@@ -455,4 +455,7 @@ void nr_mac_check_ul_failure(const gNB_MAC_INST *nrmac, int rnti, NR_UE_sched_ct
void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, const NR_UE_info_t *UE);
float get_measured_sinr(uint8_t index);
uint8_t get_MCS_from_SINR(float SINR);
#endif /*__LAYER2_NR_MAC_PROTO_H__*/
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