sched,nr: ack/crc info included in nr_phy_test

master
Francisco Paisana 4 years ago
parent 592d9332ba
commit b589c0d184

@ -72,11 +72,11 @@ public:
void toggle_padding() override { srsran::console("padding not available for NR\n"); } void toggle_padding() override { srsran::console("padding not available for NR\n"); }
int slot_indication(const srsran_slot_cfg_t& slot_cfg) override; int slot_indication(const srsran_slot_cfg_t& slot_cfg) override;
int get_dl_sched(const srsran_slot_cfg_t& slot_cfg, dl_sched_t& dl_sched) override; int get_dl_sched(const srsran_slot_cfg_t& slot_cfg, dl_sched_t& dl_sched) override;
int get_ul_sched(const srsran_slot_cfg_t& slot_cfg, ul_sched_t& ul_sched) override; int get_ul_sched(const srsran_slot_cfg_t& slot_cfg, ul_sched_t& ul_sched) override;
int pucch_info(const srsran_slot_cfg_t& slot_cfg, const pucch_info_t& pucch_info) override; int pucch_info(const srsran_slot_cfg_t& slot_cfg, const pucch_info_t& pucch_info) override;
int pusch_info(const srsran_slot_cfg_t& slot_cfg, const pusch_info_t& pusch_info) override; int pusch_info(const srsran_slot_cfg_t& slot_cfg, const pusch_info_t& pusch_info) override;
void rach_detected(const rach_info_t& rach_info) override; void rach_detected(const rach_info_t& rach_info) override;
private: private:

@ -42,6 +42,7 @@ public:
void ue_cfg(uint16_t rnti, const ue_cfg_t& cfg) override; void ue_cfg(uint16_t rnti, const ue_cfg_t& cfg) override;
void dl_ack_info(uint16_t rnti, uint32_t cc, uint32_t pid, uint32_t tb_idx, bool ack) override; void dl_ack_info(uint16_t rnti, uint32_t cc, uint32_t pid, uint32_t tb_idx, bool ack) override;
void ul_crc_info(uint16_t rnti, uint32_t cc, uint32_t pid, bool crc) override;
void ul_sr_info(tti_point tti_rx, uint16_t rnti) override; void ul_sr_info(tti_point tti_rx, uint16_t rnti) override;
int get_dl_sched(tti_point pdsch_tti, uint32_t cc, dl_sched_t& result) override; int get_dl_sched(tti_point pdsch_tti, uint32_t cc, dl_sched_t& result) override;

@ -116,6 +116,7 @@ public:
void new_tti(tti_point tti_rx_); void new_tti(tti_point tti_rx_);
void dl_ack_info(uint32_t pid, uint32_t tb_idx, bool ack) { dl_harqs[pid].ack_info(tb_idx, ack); } void dl_ack_info(uint32_t pid, uint32_t tb_idx, bool ack) { dl_harqs[pid].ack_info(tb_idx, ack); }
void ul_crc_info(uint32_t pid, bool ack) { ul_harqs[pid].ack_info(0, ack); }
dl_harq_proc* find_pending_dl_retx() dl_harq_proc* find_pending_dl_retx()
{ {

@ -100,6 +100,7 @@ public:
virtual int get_ul_sched(tti_point tti_rx, uint32_t cc, ul_sched_t& result) = 0; virtual int get_ul_sched(tti_point tti_rx, uint32_t cc, ul_sched_t& result) = 0;
virtual void dl_ack_info(uint16_t rnti, uint32_t cc, uint32_t pid, uint32_t tb_idx, bool ack) = 0; virtual void dl_ack_info(uint16_t rnti, uint32_t cc, uint32_t pid, uint32_t tb_idx, bool ack) = 0;
virtual void ul_crc_info(uint16_t rnti, uint32_t cc, uint32_t pid, bool crc) = 0;
virtual void ul_sr_info(tti_point, uint16_t rnti) = 0; virtual void ul_sr_info(tti_point, uint16_t rnti) = 0;
}; };

@ -164,6 +164,11 @@ void sched_nr::dl_ack_info(uint16_t rnti, uint32_t cc, uint32_t pid, uint32_t tb
rnti, cc, [pid, tb_idx, ack](ue_carrier& ue_cc) { ue_cc.harq_ent.dl_ack_info(pid, tb_idx, ack); }); rnti, cc, [pid, tb_idx, ack](ue_carrier& ue_cc) { ue_cc.harq_ent.dl_ack_info(pid, tb_idx, ack); });
} }
void sched_nr::ul_crc_info(uint16_t rnti, uint32_t cc, uint32_t pid, bool crc)
{
sched_workers->enqueue_cc_feedback(rnti, cc, [pid, crc](ue_carrier& ue_cc) { ue_cc.harq_ent.ul_crc_info(pid, crc); });
}
void sched_nr::ul_sr_info(tti_point tti_rx, uint16_t rnti) void sched_nr::ul_sr_info(tti_point tti_rx, uint16_t rnti)
{ {
sched_workers->enqueue_event(rnti, [this, rnti, tti_rx]() { ue_db[rnti]->ul_sr_info(tti_rx); }); sched_workers->enqueue_event(rnti, [this, rnti, tti_rx]() { ue_db[rnti]->ul_sr_info(tti_rx); });

@ -71,8 +71,9 @@ private:
srsran::phy_cfg_nr_t phy_cfg = {}; srsran::phy_cfg_nr_t phy_cfg = {};
bool valid = false; bool valid = false;
srsenb::sched_nr sched; srsenb::sched_nr sched;
srsran::tti_point pdsch_tti, pusch_tti; srsran::tti_point pdsch_tti, pusch_tti;
srslog::basic_logger& sched_logger;
std::mutex metrics_mutex; std::mutex metrics_mutex;
metrics_t metrics = {}; metrics_t metrics = {};
@ -287,6 +288,8 @@ private:
metrics.mac.tx_errors += tb_count; metrics.mac.tx_errors += tb_count;
logger.debug("NACK received!"); logger.debug("NACK received!");
} }
sched.dl_ack_info(rnti, 0, ack_bit->pid, 0, is_ok);
} }
// Process SR // Process SR
@ -320,9 +323,11 @@ public:
phy_cfg(args.phy_cfg), phy_cfg(args.phy_cfg),
ss_id(args.ss_id), ss_id(args.ss_id),
sched(srsenb::sched_nr_interface::sched_cfg_t{}), sched(srsenb::sched_nr_interface::sched_cfg_t{}),
use_dummy_sched(args.use_dummy_sched) use_dummy_sched(args.use_dummy_sched),
sched_logger(srslog::fetch_basic_logger("MAC"))
{ {
logger.set_level(srslog::str_to_basic_level(args.log_level)); logger.set_level(srslog::str_to_basic_level(args.log_level));
sched_logger.set_level(srslog::basic_levels::debug);
// create sched object // create sched object
std::vector<srsenb::sched_nr_interface::cell_cfg_t> cells_cfg = srsenb::get_default_cells_cfg(1, phy_cfg); std::vector<srsenb::sched_nr_interface::cell_cfg_t> cells_cfg = srsenb::get_default_cells_cfg(1, phy_cfg);
@ -400,6 +405,7 @@ public:
int get_dl_sched(const srsran_slot_cfg_t& slot_cfg, dl_sched_t& dl_sched) override int get_dl_sched(const srsran_slot_cfg_t& slot_cfg, dl_sched_t& dl_sched) override
{ {
logger.set_context(slot_cfg.idx); logger.set_context(slot_cfg.idx);
sched_logger.set_context(slot_cfg.idx);
if (not pdsch_tti.is_valid()) { if (not pdsch_tti.is_valid()) {
pdsch_tti = srsran::tti_point{slot_cfg.idx}; pdsch_tti = srsran::tti_point{slot_cfg.idx};
} else { } else {
@ -445,6 +451,7 @@ public:
int get_ul_sched(const srsran_slot_cfg_t& slot_cfg, ul_sched_t& ul_sched) override int get_ul_sched(const srsran_slot_cfg_t& slot_cfg, ul_sched_t& ul_sched) override
{ {
logger.set_context(slot_cfg.idx); logger.set_context(slot_cfg.idx);
sched_logger.set_context(slot_cfg.idx);
if (not pusch_tti.is_valid()) { if (not pusch_tti.is_valid()) {
pusch_tti = srsran::tti_point{slot_cfg.idx}; pusch_tti = srsran::tti_point{slot_cfg.idx};
} else { } else {
@ -537,6 +544,20 @@ public:
return SRSRAN_SUCCESS; return SRSRAN_SUCCESS;
} }
void dl_ack_info(uint16_t rnti_, uint32_t cc, uint32_t pid, uint32_t tb_idx, bool ack)
{
if (not use_dummy_sched) {
sched.dl_ack_info(rnti_, cc, pid, tb_idx, ack);
}
}
void ul_crc_info(uint16_t rnti_, uint32_t cc, uint32_t pid, bool crc)
{
if (not use_dummy_sched) {
sched.ul_crc_info(rnti_, cc, pid, crc);
}
}
int pucch_info(const srsran_slot_cfg_t& slot_cfg, const pucch_info_t& pucch_info) override int pucch_info(const srsran_slot_cfg_t& slot_cfg, const pucch_info_t& pucch_info) override
{ {
// Handle UCI data // Handle UCI data
@ -579,6 +600,8 @@ public:
metrics.mac.rx_brate += rx_harq_proc[pusch_info.pid].get_tbs(); metrics.mac.rx_brate += rx_harq_proc[pusch_info.pid].get_tbs();
metrics.mac.rx_pkts++; metrics.mac.rx_pkts++;
ul_crc_info(rnti, 0, pusch_info.pid, pusch_info.pusch_data.tb[0].crc);
return SRSRAN_SUCCESS; return SRSRAN_SUCCESS;
} }

Loading…
Cancel
Save