fix fdd delays in scheduler

master
Francisco Paisana 5 years ago committed by Xavier Arteaga
parent 04b3416d87
commit e62972d38e

@ -43,6 +43,7 @@
#define SRSLTE_N_MCH_LCIDS 32
#define TX_DELAY 4
#define TX_DELAY_DL 4
#define MSG3_DELAY_MS 2 // Delay added to TX_DELAY
#define TTI_SUB(a, b) ((((a) + 10240) - (b)) % 10240)
@ -52,6 +53,7 @@
// Use only in FDD mode!!
#define FDD_HARQ_DELAY_MS 4
#define FDD_HARQ_DELAY_DL_MS 4
#define TTI_RX(tti) (TTI_SUB(tti, FDD_HARQ_DELAY_MS))
#define TTI_RX_ACK(tti) (TTI_ADD(tti, FDD_HARQ_DELAY_MS + TX_DELAY))

@ -33,7 +33,7 @@
namespace srsenb {
struct sched_ue_carrier {
const static int SCHED_MAX_HARQ_PROC = TX_DELAY + FDD_HARQ_DELAY_MS;
const static int SCHED_MAX_HARQ_PROC = TX_DELAY_DL + FDD_HARQ_DELAY_DL_MS;
sched_ue_carrier(const sched_interface::ue_cfg_t& cfg_,
const sched_cell_params_t& cell_cfg_,

@ -378,7 +378,7 @@ int sched::dl_sched(uint32_t tti, uint32_t cc_idx, sched_interface::dl_sched_res
}
std::lock_guard<std::mutex> lock(sched_mutex);
uint32_t tti_rx = sched_utils::tti_subtract(tti, TX_DELAY);
uint32_t tti_rx = sched_utils::tti_subtract(tti, TX_DELAY_DL);
last_tti = sched_utils::max_tti(last_tti, tti_rx);
if (cc_idx < carrier_schedulers.size()) {
@ -401,7 +401,7 @@ int sched::ul_sched(uint32_t tti, uint32_t cc_idx, srsenb::sched_interface::ul_s
std::lock_guard<std::mutex> lock(sched_mutex);
// Compute scheduling Result for tti_rx
uint32_t tti_rx = sched_utils::tti_subtract(tti, TX_DELAY + FDD_HARQ_DELAY_MS);
uint32_t tti_rx = sched_utils::tti_subtract(tti, TX_DELAY_DL + FDD_HARQ_DELAY_DL_MS);
if (cc_idx < carrier_schedulers.size()) {
const sf_sched_result& tti_sched = carrier_schedulers[cc_idx]->generate_tti_result(tti_rx);

@ -48,10 +48,10 @@ const char* alloc_outcome_t::to_string() const
tti_params_t::tti_params_t(uint32_t tti_rx_) :
tti_rx(tti_rx_),
sf_idx_tx_dl(TTI_ADD(tti_rx, TX_DELAY) % 10),
tti_tx_dl(TTI_ADD(tti_rx, TX_DELAY)),
tti_tx_ul(TTI_ADD(tti_rx, (TX_DELAY + FDD_HARQ_DELAY_MS))),
sfn_tx_dl(TTI_ADD(tti_rx, TX_DELAY) / 10)
sf_idx_tx_dl(TTI_ADD(tti_rx, TX_DELAY_DL) % 10),
tti_tx_dl(TTI_ADD(tti_rx, TX_DELAY_DL)),
tti_tx_ul(TTI_ADD(tti_rx, (TX_DELAY_DL + FDD_HARQ_DELAY_DL_MS))),
sfn_tx_dl(TTI_ADD(tti_rx, TX_DELAY_DL) / 10)
{
}

@ -223,7 +223,8 @@ rbgmask_t dl_harq_proc::get_rbgmask() const
bool dl_harq_proc::has_pending_retx(uint32_t tb_idx, uint32_t tti_tx_dl) const
{
uint32_t tti_diff = srslte_tti_interval(tti_tx_dl, tti);
return (tti_diff < (10240 / 2)) and (tti_diff >= TX_DELAY + FDD_HARQ_DELAY_MS) and has_pending_retx_common(tb_idx);
return (tti_diff < (10240 / 2)) and (tti_diff >= TX_DELAY_DL + FDD_HARQ_DELAY_DL_MS) and
has_pending_retx_common(tb_idx);
}
int dl_harq_proc::get_tbs(uint32_t tb_idx) const
@ -366,7 +367,7 @@ dl_harq_proc* harq_entity::get_pending_dl_harq(uint32_t tti_tx_dl)
std::pair<uint32_t, int> harq_entity::set_ack_info(uint32_t tti_rx, uint32_t tb_idx, bool ack)
{
for (auto& h : dl_harqs) {
if (TTI_ADD(h.get_tti(), FDD_HARQ_DELAY_MS) == tti_rx) {
if (TTI_ADD(h.get_tti(), FDD_HARQ_DELAY_DL_MS) == tti_rx) {
h.set_ack(tb_idx, ack);
return {h.get_id(), h.get_tbs(tb_idx)};
}
@ -381,8 +382,8 @@ ul_harq_proc* harq_entity::get_ul_harq(uint32_t tti_tx_ul)
void harq_entity::reset_pending_data(uint32_t tti_rx)
{
uint32_t tti_tx_ul = TTI_ADD(tti_rx, (TX_DELAY + FDD_HARQ_DELAY_MS));
uint32_t tti_tx_dl = TTI_ADD(tti_rx, TX_DELAY);
uint32_t tti_tx_ul = TTI_ADD(tti_rx, (TX_DELAY_DL + FDD_HARQ_DELAY_DL_MS));
uint32_t tti_tx_dl = TTI_ADD(tti_rx, TX_DELAY_DL);
// Reset ACK state of UL Harq
get_ul_harq(tti_tx_ul)->reset_pending_data();

@ -182,7 +182,7 @@ int test_scell_activation(test_scell_activation_params params)
// Event: Wait for UE to receive and ack CE. Send cqi==0, which should not activate the SCell
uint32_t cqi = 0;
for (uint32_t i = 0; i < TX_DELAY; ++i) {
for (uint32_t i = 0; i < TX_DELAY_DL; ++i) {
tester.dl_cqi_info(tester.tti_info.tti_params.tti_rx, rnti1, 1, cqi);
generator.step_tti();
}

@ -395,7 +395,7 @@ int user_state_sched_tester::test_ra(uint32_t enb_
CONDERROR(ul_result.pusch[i].needs_pdcch and not userinfo.msg3_tic.is_valid() and
userinfo.msg3_tic.tti_rx() > tic.tti_rx(),
"No UL newtxs allocs allowed before Msg3 Rx\n");
tti_counter msg3_tic = userinfo.rar_tic + FDD_HARQ_DELAY_MS + MSG3_DELAY_MS;
tti_counter msg3_tic = userinfo.rar_tic + FDD_HARQ_DELAY_DL_MS + MSG3_DELAY_MS;
CONDERROR(msg3_tic > tic.tic_tx_ul(), "No UL allocs allowed before Msg3 alloc\n");
}
}
@ -404,7 +404,7 @@ int user_state_sched_tester::test_ra(uint32_t enb_
for (uint32_t i = 0; i < dl_result.nof_data_elems; ++i) {
if (dl_result.data[i].dci.rnti == rnti) {
CONDERROR(not userinfo.msg3_tic.is_valid(), "No DL data alloc allowed before Msg3 alloc\n");
CONDERROR(tic + FDD_HARQ_DELAY_MS < userinfo.msg3_tic, "Msg4 cannot be tx without Msg3 being acked\n");
CONDERROR(tic + FDD_HARQ_DELAY_DL_MS < userinfo.msg3_tic, "Msg4 cannot be tx without Msg3 being acked\n");
}
}
@ -438,7 +438,7 @@ int user_state_sched_tester::test_ra(uint32_t enb_
/* TEST: Check Msg3 */
if (userinfo.rar_tic.is_valid()) {
tti_counter expected_msg3_tti = userinfo.rar_tic + FDD_HARQ_DELAY_MS + MSG3_DELAY_MS;
tti_counter expected_msg3_tti = userinfo.rar_tic + FDD_HARQ_DELAY_DL_MS + MSG3_DELAY_MS;
if (expected_msg3_tti == tic.tic_tx_ul()) {
for (uint32_t i = 0; i < ul_result.nof_dci_elems; ++i) {
if (ul_result.pusch[i].dci.rnti == rnti) {
@ -750,7 +750,7 @@ int common_sched_tester::schedule_acks()
for (uint32_t i = 0; i < tti_info.dl_sched_result[ccidx].nof_data_elems; ++i) {
ack_info_t ack_data;
ack_data.rnti = tti_info.dl_sched_result[ccidx].data[i].dci.rnti;
ack_data.tti = FDD_HARQ_DELAY_MS + tti_info.tti_params.tti_tx_dl;
ack_data.tti = FDD_HARQ_DELAY_DL_MS + tti_info.tti_params.tti_tx_dl;
ack_data.enb_cc_idx = ccidx;
ack_data.ue_cc_idx = ue_db[ack_data.rnti].get_cell_index(ccidx).second;
const srsenb::dl_harq_proc& dl_h =
@ -767,7 +767,7 @@ int common_sched_tester::schedule_acks()
while (it != to_ack.end() and it->first < ack_data.tti) {
if (it->second.rnti == ack_data.rnti and it->second.dl_harq.get_id() == ack_data.dl_harq.get_id() and
it->second.ue_cc_idx == ack_data.ue_cc_idx) {
CONDERROR(it->second.tti + 2 * FDD_HARQ_DELAY_MS > ack_data.tti,
CONDERROR(it->second.tti + TX_DELAY_DL + FDD_HARQ_DELAY_DL_MS > ack_data.tti,
"The retx dl harq id=%d was transmitted too soon\n",
ack_data.dl_harq.get_id());
auto toerase_it = it++;

@ -33,8 +33,8 @@ struct tti_counter {
tti_counter() = default;
void set_start_tti(uint32_t tti_) { counter = tti_; }
uint32_t tti_rx() const { return counter % 10240u; }
tti_counter tic_tx_dl() const { return tti_counter{counter + TX_DELAY}; }
tti_counter tic_tx_ul() const { return tti_counter{counter + TX_DELAY + FDD_HARQ_DELAY_MS}; }
tti_counter tic_tx_dl() const { return tti_counter{counter + TX_DELAY_DL}; }
tti_counter tic_tx_ul() const { return tti_counter{counter + TX_DELAY_DL + FDD_HARQ_DELAY_DL_MS}; }
bool operator==(const tti_counter& other) const { return counter == other.counter; }
bool operator!=(const tti_counter& other) const { return counter != other.counter; }
bool operator<(const tti_counter& other) const { return counter < other.counter; }

Loading…
Cancel
Save