Commit a2637621 authored by Raymond Knopp's avatar Raymond Knopp

testing UL

parent 10f2b4fb
......@@ -63,7 +63,6 @@ int get_ul_tda(gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon_t *scc, int
return 0; // if FDD or not mixed slot in TDD, for now use default TDA (TODO handle CSI-RS slots)
}
static int compute_ph_factor(int mu, int tbs_bits, int rb, int n_layers, int n_symbols, int n_dmrs, long *deltaMCS, int include_bw)
{
// 38.213 7.1.1
......@@ -72,7 +71,7 @@ static int compute_ph_factor(int mu, int tbs_bits, int rb, int n_layers, int n_s
if(deltaMCS != NULL && n_layers == 1) {
const int n_re = (NR_NB_SC_PER_RB * n_symbols - n_dmrs) * rb;
const float BPRE = (float) tbs_bits/n_re; //TODO change for PUSCH with CSI
const float f = pow(2, BPRE * 1.25);
const float f = pow(2, BPRE * /*1.25*/1.5);
const float beta = 1.0f; //TODO change for PUSCH with CSI
delta_tf = (10 * log10((f - 1) * beta));
LOG_D(NR_MAC,"compute_ph_factor delta_tf %f (n_re %d, n_rb %d, n_dmrs %d, n_symbols %d, tbs %d BPRE %f f %f)\n",delta_tf,n_re,rb, n_dmrs, n_symbols, tbs_bits, BPRE,f);
......@@ -1455,6 +1454,7 @@ static void nr_ue_max_mcs_min_rb(int mu,
update_ul_ue_R_Qm(*mcs, ul_bwp->mcs_table, ul_bwp->pusch_Config, &R, &Qm);
long *deltaMCS = ul_bwp->pusch_Config ? ul_bwp->pusch_Config->pusch_PowerControl->deltaMCS : NULL;
if (ul_bwp->mcs_table == 1) R>>=1;
tbs_bits = nr_compute_tbs(Qm, R, *Rb,
sched_pusch->tda_info.nrOfSymbols,
sched_pusch->dmrs_info.N_PRB_DMRS * sched_pusch->dmrs_info.num_dmrs_symb,
......@@ -1469,6 +1469,7 @@ static void nr_ue_max_mcs_min_rb(int mu,
sched_pusch->dmrs_info.N_PRB_DMRS * sched_pusch->dmrs_info.num_dmrs_symb,
deltaMCS,
1);
while (ph_limit < tx_power && *Rb > minRb) {
(*Rb)--;
tbs_bits = nr_compute_tbs(Qm, R, *Rb,
......@@ -1491,6 +1492,7 @@ static void nr_ue_max_mcs_min_rb(int mu,
while (ph_limit < tx_power && *mcs > 0) {
(*mcs)--;
update_ul_ue_R_Qm(*mcs, ul_bwp->mcs_table, ul_bwp->pusch_Config, &R, &Qm);
if (ul_bwp->mcs_table == 1) R>>=1;
tbs_bits = nr_compute_tbs(Qm, R, *Rb,
sched_pusch->tda_info.nrOfSymbols,
sched_pusch->dmrs_info.N_PRB_DMRS * sched_pusch->dmrs_info.num_dmrs_symb,
......@@ -1524,6 +1526,7 @@ static void nr_ue_max_mcs_min_rb(int mu,
*Rb,
*mcs,
ph_limit);
/*else if (*Rb<10) LOG_I(NR_MAC,"Qm %d (table %d), R %d, Nl %d, nb_rb %d, mcs %d, ph_limit %d, tx_power %d, tbs_bits %d,nrOfSymbols %d, dmrs_re %d\n",Qm,ul_bwp->mcs_table,R,sched_pusch->nrOfLayers,*Rb,*mcs,ph_limit,tx_power,tbs_bits,sched_pusch->tda_info.nrOfSymbols,sched_pusch->dmrs_info.N_PRB_DMRS * sched_pusch->dmrs_info.num_dmrs_symb);*/
}
static bool allocate_ul_retransmission(gNB_MAC_INST *nrmac,
......
......@@ -157,11 +157,12 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset
output += snprintf(output,
end - output,
", ulsch_DTX %d, ulsch_errors %" PRIu64 ", BLER %.5f MCS %d SNR %d.%d dB\n",
", ulsch_DTX %d, ulsch_errors %" PRIu64 ", BLER %.5f MCS %d (Qm %d) SNR %d.%d dB\n",
stats->ulsch_DTX,
stats->ul.errors,
sched_ctrl->ul_bler_stats.bler,
sched_ctrl->ul_bler_stats.mcs,
nr_get_Qm_ul(sched_ctrl->ul_bler_stats.mcs,UE->current_UL_BWP.mcs_table),
sched_ctrl->pusch_snrx10 / 10,
sched_ctrl->pusch_snrx10 % 10);
output += snprintf(output,
......
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