Commit 87dc3875 authored by Bo Zhao's avatar Bo Zhao Committed by Thomas Schlichter

UL AMC based on ul_cqi indication

parent 3a924009
...@@ -139,6 +139,7 @@ ...@@ -139,6 +139,7 @@
#define CONFIG_HLP_ULPC "Enable NR Uplink power control for PUSCH and PUCCH" #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_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" #define CONFIG_HLP_SINR_OSET_DL "Additional SINR offset in [dB] applied to the reported SINR from UE for DL AMC \n"
#define CONFIG_HLP_SINR_OSET_UL "Additional SINR offset in [dB] applied to the measured SINR at gNB for UL AMC \n"
/*--------------------------------------------------------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters for LOG utility */ /* command line parameters for LOG utility */
/* optname helpstr paramflags XXXptr defXXXval type numelt */ /* optname helpstr paramflags XXXptr defXXXval type numelt */
......
...@@ -44,12 +44,14 @@ ...@@ -44,12 +44,14 @@
{"FDC" , CONFIG_HLP_FDopplerPrePost,0, .iptr=&fdopplerPrePost, .defintval=0, TYPE_INT32, 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}, \ {"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} \ {"sinr-offset-dl" , CONFIG_HLP_SINR_OSET_DL, 0, .dblptr=&sinr_offset_dl, .defdblval=0, TYPE_DOUBLE, 0}, \
{"sinr-offset-ul" , CONFIG_HLP_SINR_OSET_UL, 0, .dblptr=&sinr_offset_ul, .defdblval=0, TYPE_DOUBLE, 0} \
} }
// clang-format on // clang-format on
extern uint8_t amc_flag; // flag to use adaptive modulation and coding 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 double sinr_offset_dl; // additional SINR offset in [dB] applied to the reported SINR from UE for DL AMC
extern double sinr_offset_ul; // additional SINR offset in [dB] applied to the measured SINR at gNB for UL AMC
extern uint32_t target_dl_mcs; extern uint32_t target_dl_mcs;
extern uint32_t target_dl_Nl; extern uint32_t target_dl_Nl;
extern uint32_t target_ul_Nl; extern uint32_t target_ul_Nl;
......
...@@ -43,6 +43,7 @@ extern RAN_CONTEXT_t RC; ...@@ -43,6 +43,7 @@ extern RAN_CONTEXT_t RC;
uint8_t amc_flag = 0; // flag to use adaptive modulation and coding 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 double sinr_offset_dl = 0.0; // additional SINR offset in [dB] applied to the reported SINR from UE for DL AMC
double sinr_offset_ul = 0.0; // additional SINR offset in [dB] applied to the measured SINR at gNB for UL AMC
uint32_t target_dl_mcs = 9; uint32_t target_dl_mcs = 9;
uint32_t target_dl_Nl = 1; uint32_t target_dl_Nl = 1;
uint32_t target_dl_bw = 50; uint32_t target_dl_bw = 50;
...@@ -286,8 +287,15 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ ...@@ -286,8 +287,15 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_
sched_ctrl->cce_index = CCEIndex; sched_ctrl->cce_index = CCEIndex;
const int mcs = target_ul_mcs;
NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch;
int mcs = sched_pusch->mcs;
if (amc_flag) {
if (sched_ctrl->retrans_ul_harq.head == -1) { // first transmission only
mcs = get_MCS_from_SINR(sched_ctrl->pusch_snrx10 / 10.0 + sinr_offset_ul);
}
} else
mcs = target_ul_mcs;
sched_pusch->mcs = mcs; sched_pusch->mcs = mcs;
sched_ctrl->ul_bler_stats.mcs = mcs; /* for logging output */ sched_ctrl->ul_bler_stats.mcs = mcs; /* for logging output */
sched_pusch->rbStart = rbStart; sched_pusch->rbStart = rbStart;
......
...@@ -1627,6 +1627,9 @@ static int comparator(const void *p, const void *q) { ...@@ -1627,6 +1627,9 @@ static int comparator(const void *p, const void *q) {
return ((UEsched_t*)p)->coef < ((UEsched_t*)q)->coef; return ((UEsched_t*)p)->coef < ((UEsched_t*)q)->coef;
} }
extern uint8_t amc_flag; // flag to use adaptive modulation and coding
extern double sinr_offset_ul; // additional SINR offset in [dB] applied to the measured SINR at gNB for UL AMC
static void pf_ul(module_id_t module_id, static void pf_ul(module_id_t module_id,
frame_t frame, frame_t frame,
sub_frame_t slot, sub_frame_t slot,
...@@ -1714,7 +1717,10 @@ static void pf_ul(module_id_t module_id, ...@@ -1714,7 +1717,10 @@ static void pf_ul(module_id_t module_id,
const NR_bler_options_t *bo = &nrmac->ul_bler; const NR_bler_options_t *bo = &nrmac->ul_bler;
const int max_mcs_table = (current_BWP->mcs_table == 0 || current_BWP->mcs_table == 2) ? 28 : 27; const int max_mcs_table = (current_BWP->mcs_table == 0 || current_BWP->mcs_table == 2) ? 28 : 27;
const int max_mcs = min(bo->max_mcs, max_mcs_table); /* no per-user maximum MCS yet */ const int max_mcs = min(bo->max_mcs, max_mcs_table); /* no per-user maximum MCS yet */
if (bo->harq_round_max == 1) if (amc_flag) {
uint8_t MCS_temp = get_MCS_from_SINR(sched_ctrl->pusch_snrx10 / 10.0 + sinr_offset_ul);
sched_pusch->mcs = min(MCS_temp, max_mcs);
} else if (bo->harq_round_max == 1)
sched_pusch->mcs = max_mcs; sched_pusch->mcs = max_mcs;
else else
sched_pusch->mcs = get_mcs_from_bler(bo, stats, &sched_ctrl->ul_bler_stats, max_mcs, frame); sched_pusch->mcs = get_mcs_from_bler(bo, stats, &sched_ctrl->ul_bler_stats, max_mcs, frame);
......
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