Commit d41a6e05 authored by Bartosz Podrygajlo's avatar Bartosz Podrygajlo

Remove hardcode for minimum TX power

parent d8572d55
......@@ -238,6 +238,8 @@ float nr_get_Pcmax(int p_Max,
int n_prbs,
int start_prb);
float nr_get_Pcmin(int scs, int nr_band, int N_RB_UL);
int get_sum_delta_pucch(NR_UE_MAC_INST_t *mac, int slot, frame_t frame);
/* Random Access */
......
......@@ -224,6 +224,14 @@ float nr_get_Pcmax(int p_Max,
}
}
float nr_get_Pcmin(int scs, int nr_band, int N_RB_UL) {
int band_index = get_supported_band_index(nr_band > 256 ? FR2 : FR1, scs, N_RB_UL);
const float table_38101_6_3_1_1[] = {
-40, -40, -40, -40, -39, -38.2, -37.5, -37, -36.5, -35.2, -34.6, -34, -33.5, -33
};
return table_38101_6_3_1_1[band_index];
}
// This is not entirely correct. In certain k2/k1/k0 settings we might postpone accumulating delta_PUCCH until next HARQ feedback
// slot. The correct way to do this would be to calculate the K_PUCCH (delta_PUCCH summation window end) for each PUCCH occasion and
// compare PUCCH transmission symbol with the reception symbol of the DCI containing delta_PUCCH to determine if the delta_PUCCH
......@@ -339,7 +347,7 @@ int16_t get_pucch_tx_power_ue(NR_UE_MAC_INST_t *mac,
format_type == 2,
1,
start_prb);
int P_CMIN = -40; // TODO: minimum TX power, possibly 38.101-1 6.3.1
int P_CMIN = nr_get_Pcmin(mac->current_UL_BWP->scs, mac->nr_band, mac->current_UL_BWP->BWPSize);
int16_t pathloss = compute_nr_SSB_PL(mac, mac->ssb_measurements.ssb_rsrp_dBm);
if (power_config->twoPUCCH_PC_AdjustmentStates && *power_config->twoPUCCH_PC_AdjustmentStates > 1) {
......
......@@ -104,7 +104,6 @@ TEST(test_pucch_power_state, test_accumulated_delta_pucch)
uint16_t start_prb = 0;
int P_CMAX =
nr_get_Pcmax(23, mac.nr_band, FR1, 2, false, current_UL_BWP.scs, current_UL_BWP.BWPSize, false, nb_of_prbs, start_prb);
int pucch_power_prev = get_pucch_tx_power_ue(&mac,
scs,
&pucch_Config,
......@@ -165,6 +164,15 @@ TEST(test_pucch_power_state, test_accumulated_delta_pucch)
}
}
TEST(pc_min, check_all_bw_indexes) {
const int NB_RB_UL[] ={
11, 24, 38, 51, 65, 78, 106, 133, 162, 217, 245, 273
};
for (auto i = 0U; i < sizeof(NB_RB_UL)/sizeof(NB_RB_UL[0]); i++) {
(void)nr_get_Pcmin(1, 20, NB_RB_UL[i]);
}
}
int main(int argc, char** argv)
{
logInit();
......
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