|
|
@ -33,12 +33,13 @@ class tpc
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
static constexpr int PHR_NEG_NOF_PRB = 1;
|
|
|
|
static constexpr int PHR_NEG_NOF_PRB = 1;
|
|
|
|
|
|
|
|
|
|
|
|
tpc(uint32_t cell_nof_prb, float target_snr_dB_ = -1.0) :
|
|
|
|
tpc(uint32_t cell_nof_prb, float target_snr_dB_ = -1.0, bool phr_handling_flag_ = false) :
|
|
|
|
nof_prb(cell_nof_prb),
|
|
|
|
nof_prb(cell_nof_prb),
|
|
|
|
target_snr_dB(target_snr_dB_),
|
|
|
|
target_snr_dB(target_snr_dB_),
|
|
|
|
snr_avg(0.1, target_snr_dB_),
|
|
|
|
snr_avg(0.1, target_snr_dB_),
|
|
|
|
win_pusch_tpc_values(FDD_HARQ_DELAY_UL_MS + FDD_HARQ_DELAY_DL_MS),
|
|
|
|
win_pusch_tpc_values(FDD_HARQ_DELAY_UL_MS + FDD_HARQ_DELAY_DL_MS),
|
|
|
|
win_pucch_tpc_values(FDD_HARQ_DELAY_DL_MS + FDD_HARQ_DELAY_UL_MS)
|
|
|
|
win_pucch_tpc_values(FDD_HARQ_DELAY_DL_MS + FDD_HARQ_DELAY_UL_MS),
|
|
|
|
|
|
|
|
phr_handling_flag(phr_handling_flag_)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
max_prbs_cached = nof_prb;
|
|
|
|
max_prbs_cached = nof_prb;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -52,6 +53,7 @@ public:
|
|
|
|
pusch_phr_flag = false;
|
|
|
|
pusch_phr_flag = false;
|
|
|
|
|
|
|
|
|
|
|
|
// compute and cache the max nof UL PRBs that avoids overflowing PHR
|
|
|
|
// compute and cache the max nof UL PRBs that avoids overflowing PHR
|
|
|
|
|
|
|
|
if (phr_handling_flag) {
|
|
|
|
max_prbs_cached = PHR_NEG_NOF_PRB;
|
|
|
|
max_prbs_cached = PHR_NEG_NOF_PRB;
|
|
|
|
for (int n = nof_prb; n > PHR_NEG_NOF_PRB; --n) {
|
|
|
|
for (int n = nof_prb; n > PHR_NEG_NOF_PRB; --n) {
|
|
|
|
if (last_phr >= 10 * log10(n)) {
|
|
|
|
if (last_phr >= 10 * log10(n)) {
|
|
|
@ -60,6 +62,7 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void new_tti()
|
|
|
|
void new_tti()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -178,6 +181,7 @@ private:
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t nof_prb;
|
|
|
|
uint32_t nof_prb;
|
|
|
|
float target_snr_dB;
|
|
|
|
float target_snr_dB;
|
|
|
|
|
|
|
|
bool phr_handling_flag;
|
|
|
|
|
|
|
|
|
|
|
|
// PHR-related variables
|
|
|
|
// PHR-related variables
|
|
|
|
int last_phr = undefined_phr;
|
|
|
|
int last_phr = undefined_phr;
|
|
|
|