added DL TTI mask for MBMS

This commit is contained in:
Francisco Paisana 2019-07-02 17:03:13 +01:00 committed by Andre Puschmann
parent 2e9a981a8a
commit 424876c5e4
7 changed files with 30 additions and 5 deletions

View File

@ -89,7 +89,8 @@ public:
virtual int get_dl_sched(uint32_t tti, dl_sched_t *dl_sched_res) = 0;
virtual int get_mch_sched(uint32_t tti, bool is_mcch, dl_sched_t* dl_sched_res) = 0;
virtual int get_ul_sched(uint32_t tti, ul_sched_t *ul_sched_res) = 0;
virtual void set_sched_dl_tti_mask(uint8_t* tti_mask, uint32_t nof_sfs) = 0;
// Radio-Link status
virtual void rl_failure(uint16_t rnti) = 0;
virtual void rl_ok(uint16_t rnti) = 0;

View File

@ -244,8 +244,10 @@ public:
/* Run Scheduler for this tti */
virtual int dl_sched(uint32_t tti, dl_sched_res_t *sched_result) = 0;
virtual int ul_sched(uint32_t tti, ul_sched_res_t *sched_result) = 0;
virtual int ul_sched(uint32_t tti, ul_sched_res_t *sched_result) = 0;
/* Custom */
virtual void set_dl_tti_mask(uint8_t* tti_mask, uint32_t nof_sfs) = 0;
};
}

View File

@ -79,6 +79,10 @@ public:
return mac.get_mch_sched(tti, is_mcch, dl_sched_res);
}
int get_ul_sched(uint32_t tti, ul_sched_t* ul_sched_res) final { return mac.get_ul_sched(tti, ul_sched_res); }
void set_sched_dl_tti_mask(uint8_t* tti_mask, uint32_t nof_sfs) final
{
mac.set_sched_dl_tti_mask(tti_mask, nof_sfs);
}
// Radio-Link status
void rl_failure(uint16_t rnti) final { mac.rl_failure(rnti); }
void rl_ok(uint16_t rnti) final { mac.rl_ok(rnti); }

View File

@ -79,6 +79,10 @@ public:
int get_dl_sched(uint32_t tti, dl_sched_t *dl_sched_res);
int get_ul_sched(uint32_t tti, ul_sched_t *ul_sched_res);
int get_mch_sched(uint32_t tti, bool is_mcch, dl_sched_t* dl_sched_res);
void set_sched_dl_tti_mask(uint8_t* tti_mask, uint32_t nof_sfs) final
{
scheduler.set_dl_tti_mask(tti_mask, nof_sfs);
}
void build_mch_sched(uint32_t tbs);
void rl_failure(uint16_t rnti);
void rl_ok(uint16_t rnti);

View File

@ -137,8 +137,9 @@ public:
int dl_sched(uint32_t tti, dl_sched_res_t* sched_result) final;
int ul_sched(uint32_t tti, ul_sched_res_t* sched_result) final;
/* Custom TPC functions
/* Custom functions
*/
void set_dl_tti_mask(uint8_t* tti_mask, uint32_t nof_sfs) final;
void tpc_inc(uint16_t rnti);
void tpc_dec(uint16_t rnti);
@ -284,6 +285,7 @@ protected:
const static uint32_t nof_sched_ttis = 10;
tti_sched_t tti_scheds[nof_sched_ttis];
tti_sched_t* get_tti_sched(uint32_t tti_rx) { return &tti_scheds[tti_rx % nof_sched_ttis]; }
std::vector<uint8_t> tti_dl_mask;
tti_sched_t* new_tti(uint32_t tti_rx);
void generate_phich(tti_sched_t* tti_sched);

View File

@ -264,10 +264,12 @@ void phy_common::build_mch_table()
ZERO_OBJECT(mcch_table);
// 40 element table represents 4 frames (40 subframes)
uint32_t nof_sfs = 10;
if (mbsfn.mbsfn_subfr_cnfg.sf_alloc.type().value == mbsfn_sf_cfg_s::sf_alloc_c_::types::one_frame) {
generate_mch_table(&mch_table[0], (uint32_t)mbsfn.mbsfn_subfr_cnfg.sf_alloc.one_frame().to_number(), 1);
} else {
generate_mch_table(&mch_table[0], (uint32_t)mbsfn.mbsfn_subfr_cnfg.sf_alloc.four_frames().to_number(), 4);
nof_sfs = 40;
}
// Debug
std::stringstream ss;
@ -275,6 +277,8 @@ void phy_common::build_mch_table()
for(uint32_t j=0; j<40; j++) {
ss << (int) mch_table[j] << "|";
}
stack->set_sched_dl_tti_mask(mch_table, nof_sfs);
}
void phy_common::build_mcch_table()

View File

@ -576,6 +576,7 @@ sched::sched() : bc_aggr_level(0), rar_aggr_level(0), P(0), si_n_rbg(0), rar_n_r
bzero(&sched_cfg, sizeof(sched_cfg));
bzero(&common_locations, sizeof(common_locations));
bzero(&pdsch_re, sizeof(pdsch_re));
tti_dl_mask.resize(10, 1);
for (int i = 0; i < 3; i++) {
bzero(rar_locations[i], sizeof(sched_ue::sched_dci_cce_t) * 10);
@ -1006,6 +1007,11 @@ int sched::ul_sr_info(uint32_t tti, uint16_t rnti)
return ret;
}
void sched::set_dl_tti_mask(uint8_t* tti_mask, uint32_t nof_sfs)
{
tti_dl_mask.assign(tti_mask, tti_mask + nof_sfs);
}
void sched::tpc_inc(uint16_t rnti)
{
pthread_rwlock_rdlock(&rwlock);
@ -1051,7 +1057,9 @@ sched::tti_sched_t* sched::new_tti(uint32_t tti_rx)
generate_phich(tti_sched);
/* Schedule DL */
generate_dl_sched(tti_sched);
if (tti_dl_mask[tti_rx % tti_dl_mask.size()] > 0) {
generate_dl_sched(tti_sched);
}
/* Schedule UL */
generate_ul_sched(tti_sched);