|
|
|
@ -189,13 +189,16 @@ int test_ul_sched_result(const sim_enb_ctxt_t& enb_ctxt, const sf_output_res_t&
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const auto& h = ue.cc_list[ue_cc_idx].ul_harqs[pid];
|
|
|
|
|
bool phich_ack = phich_ptr != nullptr and phich_ptr->phich == phich_t::ACK;
|
|
|
|
|
bool is_msg3 = h.first_tti_rx == ue.msg3_tti_rx and h.nof_txs == h.nof_retxs + 1;
|
|
|
|
|
bool last_retx = h.nof_retxs + 1 >= (is_msg3 ? sf_out.cc_params[0].cfg.maxharq_msg3tx : ue.ue_cfg.maxharq_tx);
|
|
|
|
|
tti_point tti_tx_phich = to_tx_dl(sf_out.tti_rx);
|
|
|
|
|
bool phich_in_meas_gap = is_in_measgap(tti_tx_phich, ue.ue_cfg.measgap_period, ue.ue_cfg.measgap_offset);
|
|
|
|
|
bool h_inactive_now = (not h.active) or (phich_ack or last_retx or phich_in_meas_gap);
|
|
|
|
|
const auto& h = ue.cc_list[ue_cc_idx].ul_harqs[pid];
|
|
|
|
|
bool phich_ack = phich_ptr != nullptr and phich_ptr->phich == phich_t::ACK;
|
|
|
|
|
bool is_msg3 = h.first_tti_rx == ue.msg3_tti_rx and h.nof_txs == h.nof_retxs + 1;
|
|
|
|
|
uint32_t max_nof_retxs = is_msg3 ? sf_out.cc_params[0].cfg.maxharq_msg3tx : ue.ue_cfg.maxharq_tx;
|
|
|
|
|
bool last_retx = h.nof_retxs + 1 >= max_nof_retxs;
|
|
|
|
|
tti_point tti_tx_phich = to_tx_dl(sf_out.tti_rx);
|
|
|
|
|
bool phich_in_meas_gap = is_in_measgap(tti_tx_phich, ue.ue_cfg.measgap_period, ue.ue_cfg.measgap_offset);
|
|
|
|
|
bool pusch_in_meas_gap =
|
|
|
|
|
is_in_measgap(to_tx_ul(sf_out.tti_rx), ue.ue_cfg.measgap_period, ue.ue_cfg.measgap_offset);
|
|
|
|
|
bool h_cleared = (not h.active) or (phich_ack or last_retx);
|
|
|
|
|
|
|
|
|
|
// TEST: Already active UL HARQs have to receive PHICH (unless MeasGap collision)
|
|
|
|
|
CONDERROR(h.active and phich_ptr == nullptr and not phich_in_meas_gap,
|
|
|
|
@ -209,7 +212,7 @@ int test_ul_sched_result(const sim_enb_ctxt_t& enb_ctxt, const sf_output_res_t&
|
|
|
|
|
|
|
|
|
|
// TEST: absent PUSCH grants for active UL HARQs must be either ACKs, last retx, or interrupted HARQs
|
|
|
|
|
if (phich_ptr != nullptr) {
|
|
|
|
|
CONDERROR(not h_inactive_now and pusch_ptr == nullptr,
|
|
|
|
|
CONDERROR(not h_cleared and pusch_ptr == nullptr and not pusch_in_meas_gap,
|
|
|
|
|
"PHICH NACK received for rnti=0x%x but no PUSCH retx reallocated",
|
|
|
|
|
rnti);
|
|
|
|
|
}
|
|
|
|
@ -224,11 +227,13 @@ int test_ul_sched_result(const sim_enb_ctxt_t& enb_ctxt, const sf_output_res_t&
|
|
|
|
|
// newtx
|
|
|
|
|
CONDERROR(nof_retx != 0, "Invalid rv index for new UL tx");
|
|
|
|
|
CONDERROR(pusch_ptr->current_tx_nb != 0, "UL HARQ retxs need to have been previously transmitted");
|
|
|
|
|
CONDERROR(not h_inactive_now, "New tx for already active UL HARQ");
|
|
|
|
|
CONDERROR(not h_cleared, "New tx for already active UL HARQ");
|
|
|
|
|
CONDERROR(not pusch_ptr->needs_pdcch and ue.msg3_tti_rx.is_valid() and sf_out.tti_rx > ue.msg3_tti_rx,
|
|
|
|
|
"In case of newtx, PDCCH allocation is required, unless it is Msg3");
|
|
|
|
|
} else {
|
|
|
|
|
CONDERROR(pusch_ptr->current_tx_nb == 0, "UL retx has to have nof tx > 0");
|
|
|
|
|
CONDERROR(h.nof_retxs >= max_nof_retxs, "UL max nof retxs exceeded");
|
|
|
|
|
CONDERROR(pusch_ptr->current_tx_nb != h.nof_retxs + 1, "UL HARQ nof_retx mismatch");
|
|
|
|
|
if (not h.active) {
|
|
|
|
|
// the HARQ is being resumed. PDCCH must be active with the exception of Msg3
|
|
|
|
|
CONDERROR(ue.msg4_tti_rx.is_valid() and not pusch_ptr->needs_pdcch,
|
|
|
|
@ -239,11 +244,11 @@ int test_ul_sched_result(const sim_enb_ctxt_t& enb_ctxt, const sf_output_res_t&
|
|
|
|
|
} else {
|
|
|
|
|
// non-adaptive retx
|
|
|
|
|
CONDERROR(pusch_ptr->dci.type2_alloc.riv != h.riv, "Non-adaptive retx must keep the same riv");
|
|
|
|
|
CONDERROR(to_tx_ul(h.last_tti_rx) > sf_out.tti_rx, "UL harq pid=%d was reused too soon", h.pid);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
CONDERROR(get_rvidx(h.nof_retxs + 1) != (uint32_t)pusch_ptr->dci.tb.rv, "Invalid rv index for retx");
|
|
|
|
|
CONDERROR(get_rvidx(h.nof_retxs + 1) != (uint32_t)pusch_ptr->dci.tb.rv, "Invalid rv index for UL retx");
|
|
|
|
|
CONDERROR(h.tbs != pusch_ptr->tbs, "TBS changed during HARQ retx");
|
|
|
|
|
CONDERROR(to_tx_ul(h.last_tti_rx) > sf_out.tti_rx, "UL harq pid=%d was reused too soon", h.pid);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|