mirror of https://github.com/PentHertz/srsLTE.git
fix wrong calculation of sched tx and rx delays
This commit is contained in:
parent
73c8b02820
commit
02ccb8b32b
|
@ -53,6 +53,7 @@ struct tti_params_t {
|
||||||
uint32_t sf_idx;
|
uint32_t sf_idx;
|
||||||
uint32_t sfn;
|
uint32_t sfn;
|
||||||
explicit tti_params_t(uint32_t tti_rx_);
|
explicit tti_params_t(uint32_t tti_rx_);
|
||||||
|
uint32_t tti_rx_ack_dl() const { return tti_tx_ul; }
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Result of a Subframe sched computation
|
//! Result of a Subframe sched computation
|
||||||
|
|
|
@ -41,7 +41,7 @@ struct sched_dci_cce_t {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sched_ue_carrier {
|
struct sched_ue_carrier {
|
||||||
const static int SCHED_MAX_HARQ_PROC = SRSLTE_FDD_NOF_HARQ;
|
const static int SCHED_MAX_HARQ_PROC = TX_DELAY + FDD_HARQ_DELAY_MS;
|
||||||
|
|
||||||
sched_ue_carrier(const sched_interface::ue_cfg_t& cfg_,
|
sched_ue_carrier(const sched_interface::ue_cfg_t& cfg_,
|
||||||
const sched_cell_params_t& cell_cfg_,
|
const sched_cell_params_t& cell_cfg_,
|
||||||
|
|
|
@ -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);
|
std::lock_guard<std::mutex> lock(sched_mutex);
|
||||||
// Compute scheduling Result for tti_rx
|
// Compute scheduling Result for tti_rx
|
||||||
uint32_t tti_rx = sched_utils::tti_subtract(tti, 2 * FDD_HARQ_DELAY_MS);
|
uint32_t tti_rx = sched_utils::tti_subtract(tti, TX_DELAY + FDD_HARQ_DELAY_MS);
|
||||||
|
|
||||||
if (cc_idx < carrier_schedulers.size()) {
|
if (cc_idx < carrier_schedulers.size()) {
|
||||||
const sf_sched_result& tti_sched = carrier_schedulers[cc_idx]->generate_tti_result(tti_rx);
|
const sf_sched_result& tti_sched = carrier_schedulers[cc_idx]->generate_tti_result(tti_rx);
|
||||||
|
|
|
@ -378,7 +378,7 @@ void sched::carrier_sched::alloc_dl_users(sf_sched* tti_result)
|
||||||
|
|
||||||
// NOTE: In case of 6 PRBs, do not transmit if there is going to be a PRACH in the UL to avoid collisions
|
// NOTE: In case of 6 PRBs, do not transmit if there is going to be a PRACH in the UL to avoid collisions
|
||||||
if (cc_cfg->nof_prb() == 6) {
|
if (cc_cfg->nof_prb() == 6) {
|
||||||
uint32_t tti_rx_ack = TTI_RX_ACK(tti_result->get_tti_rx());
|
uint32_t tti_rx_ack = tti_result->get_tti_params().tti_rx_ack_dl();
|
||||||
if (srslte_prach_tti_opportunity_config_fdd(cc_cfg->cfg.prach_config, tti_rx_ack, -1)) {
|
if (srslte_prach_tti_opportunity_config_fdd(cc_cfg->cfg.prach_config, tti_rx_ack, -1)) {
|
||||||
tti_result->reserve_dl_rbgs(0, cc_cfg->nof_rbgs);
|
tti_result->reserve_dl_rbgs(0, cc_cfg->nof_rbgs);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,10 +48,10 @@ const char* alloc_outcome_t::to_string() const
|
||||||
|
|
||||||
tti_params_t::tti_params_t(uint32_t tti_rx_) :
|
tti_params_t::tti_params_t(uint32_t tti_rx_) :
|
||||||
tti_rx(tti_rx_),
|
tti_rx(tti_rx_),
|
||||||
sf_idx(TTI_TX(tti_rx) % 10),
|
sf_idx(TTI_ADD(tti_rx, TX_DELAY) % 10),
|
||||||
tti_tx_dl(TTI_TX(tti_rx)),
|
tti_tx_dl(TTI_ADD(tti_rx, TX_DELAY)),
|
||||||
tti_tx_ul(TTI_RX_ACK(tti_rx)),
|
tti_tx_ul(TTI_ADD(tti_rx, (TX_DELAY + FDD_HARQ_DELAY_MS))),
|
||||||
sfn(TTI_TX(tti_rx) / 10)
|
sfn(TTI_ADD(tti_rx, TX_DELAY) / 10)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -223,7 +223,7 @@ 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
|
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);
|
uint32_t tti_diff = srslte_tti_interval(tti_tx_dl, tti);
|
||||||
return (tti_diff < (10240 / 2)) and (tti_diff >= SRSLTE_FDD_NOF_HARQ) and has_pending_retx_common(tb_idx);
|
return (tti_diff < (10240 / 2)) and (tti_diff >= TX_DELAY + FDD_HARQ_DELAY_MS) and has_pending_retx_common(tb_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
int dl_harq_proc::get_tbs(uint32_t tb_idx) const
|
int dl_harq_proc::get_tbs(uint32_t tb_idx) const
|
||||||
|
@ -366,7 +366,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)
|
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) {
|
for (auto& h : dl_harqs) {
|
||||||
if (TTI_TX(h.get_tti()) == tti_rx) {
|
if (TTI_ADD(h.get_tti(), FDD_HARQ_DELAY_MS) == tti_rx) {
|
||||||
h.set_ack(tb_idx, ack);
|
h.set_ack(tb_idx, ack);
|
||||||
return {h.get_id(), h.get_tbs(tb_idx)};
|
return {h.get_id(), h.get_tbs(tb_idx)};
|
||||||
}
|
}
|
||||||
|
@ -381,8 +381,8 @@ ul_harq_proc* harq_entity::get_ul_harq(uint32_t tti_tx_ul)
|
||||||
|
|
||||||
void harq_entity::reset_pending_data(uint32_t tti_rx)
|
void harq_entity::reset_pending_data(uint32_t tti_rx)
|
||||||
{
|
{
|
||||||
uint32_t tti_tx_ul = TTI_RX_ACK(tti_rx);
|
uint32_t tti_tx_ul = TTI_ADD(tti_rx, (TX_DELAY + FDD_HARQ_DELAY_MS));
|
||||||
uint32_t tti_tx_dl = TTI_TX(tti_rx);
|
uint32_t tti_tx_dl = TTI_ADD(tti_rx, TX_DELAY);
|
||||||
|
|
||||||
// Reset ACK state of UL Harq
|
// Reset ACK state of UL Harq
|
||||||
get_ul_harq(tti_tx_ul)->reset_pending_data();
|
get_ul_harq(tti_tx_ul)->reset_pending_data();
|
||||||
|
|
|
@ -137,7 +137,7 @@ int output_sched_tester::test_pdsch_collisions(const tti_params_t&
|
||||||
|
|
||||||
// forbid Data in DL if it conflicts with PRACH for PRB==6
|
// forbid Data in DL if it conflicts with PRACH for PRB==6
|
||||||
if (cell_params.cfg.cell.nof_prb == 6) {
|
if (cell_params.cfg.cell.nof_prb == 6) {
|
||||||
uint32_t tti_rx_ack = TTI_RX_ACK(tti_params.tti_rx);
|
uint32_t tti_rx_ack = tti_params.tti_rx_ack_dl();
|
||||||
if (srslte_prach_tti_opportunity_config_fdd(cell_params.cfg.prach_config, tti_rx_ack, -1)) {
|
if (srslte_prach_tti_opportunity_config_fdd(cell_params.cfg.prach_config, tti_rx_ack, -1)) {
|
||||||
dl_allocs.fill(0, dl_allocs.size());
|
dl_allocs.fill(0, dl_allocs.size());
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,7 @@ struct sched_tester : public srsenb::common_sched_tester {
|
||||||
bool has_ul_retx = false;
|
bool has_ul_retx = false;
|
||||||
bool has_ul_newtx = false; ///< *no* retx, but has tx
|
bool has_ul_newtx = false; ///< *no* retx, but has tx
|
||||||
bool ul_retx_got_delayed = false;
|
bool ul_retx_got_delayed = false;
|
||||||
srsenb::dl_harq_proc dl_harqs[2 * FDD_HARQ_DELAY_MS];
|
srsenb::dl_harq_proc dl_harqs[srsenb::sched_ue_carrier::SCHED_MAX_HARQ_PROC];
|
||||||
srsenb::ul_harq_proc ul_harq;
|
srsenb::ul_harq_proc ul_harq;
|
||||||
};
|
};
|
||||||
struct sched_tti_data {
|
struct sched_tti_data {
|
||||||
|
@ -174,7 +174,7 @@ void sched_tester::before_sched()
|
||||||
tti_data.total_ues.has_dl_tx |= d.has_dl_tx;
|
tti_data.total_ues.has_dl_tx |= d.has_dl_tx;
|
||||||
tti_data.total_ues.has_ul_newtx |= d.has_ul_newtx;
|
tti_data.total_ues.has_ul_newtx |= d.has_ul_newtx;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < 2 * FDD_HARQ_DELAY_MS; ++i) {
|
for (uint32_t i = 0; i < srsenb::sched_ue_carrier::SCHED_MAX_HARQ_PROC; ++i) {
|
||||||
const srsenb::dl_harq_proc& h = user->get_dl_harq(i, CARRIER_IDX);
|
const srsenb::dl_harq_proc& h = user->get_dl_harq(i, CARRIER_IDX);
|
||||||
tti_data.ue_data[rnti].dl_harqs[i] = h;
|
tti_data.ue_data[rnti].dl_harqs[i] = h;
|
||||||
}
|
}
|
||||||
|
@ -359,7 +359,7 @@ int sched_tester::test_harqs()
|
||||||
// Check whether some pids got old
|
// Check whether some pids got old
|
||||||
if (check_old_pids) {
|
if (check_old_pids) {
|
||||||
for (auto& user : ue_db) {
|
for (auto& user : ue_db) {
|
||||||
for (int i = 0; i < 2 * FDD_HARQ_DELAY_MS; i++) {
|
for (int i = 0; i < srsenb::sched_ue_carrier::SCHED_MAX_HARQ_PROC; i++) {
|
||||||
if (not user.second.get_dl_harq(i, CARRIER_IDX).is_empty(0)) {
|
if (not user.second.get_dl_harq(i, CARRIER_IDX).is_empty(0)) {
|
||||||
if (srslte_tti_interval(tti_info.tti_params.tti_tx_dl, user.second.get_dl_harq(i, CARRIER_IDX).get_tti()) >
|
if (srslte_tti_interval(tti_info.tti_params.tti_tx_dl, user.second.get_dl_harq(i, CARRIER_IDX).get_tti()) >
|
||||||
49) {
|
49) {
|
||||||
|
|
Loading…
Reference in New Issue