Added SR option in NR PHY Test

master
Xavier Arteaga 4 years ago committed by Andre Puschmann
parent 54a12870ec
commit b82491bc74

@ -21,15 +21,18 @@ private:
srsran_random_t random_gen = srsran_random_init(0x4567); srsran_random_t random_gen = srsran_random_init(0x4567);
uint16_t rnti = 0; uint16_t rnti = 0;
bool valid = false; bool valid = false;
uint32_t sr_period = 0;
uint32_t sr_count = 0;
srsran::circular_array<dummy_tx_harq_proc, SRSRAN_MAX_HARQ_PROC_DL_NR> tx_harq_proc; srsran::circular_array<dummy_tx_harq_proc, SRSRAN_MAX_HARQ_PROC_DL_NR> tx_harq_proc;
srsran::circular_array<dummy_rx_harq_proc, SRSRAN_MAX_HARQ_PROC_DL_NR> rx_harq_proc; srsran::circular_array<dummy_rx_harq_proc, SRSRAN_MAX_HARQ_PROC_DL_NR> rx_harq_proc;
public: public:
struct args_t { struct args_t {
uint16_t rnti = 0x1234; uint16_t rnti = 0x1234; ///< C-RNTI for PUSCH and PDSCH transmissions
uint32_t sr_period = 0; ///< Indicates positive SR period in number of opportunities. Set to 0 to disable.
}; };
ue_dummy_stack(const args_t& args) : rnti(args.rnti) { valid = true; } ue_dummy_stack(const args_t& args) : rnti(args.rnti), sr_period(args.sr_period) { valid = true; }
~ue_dummy_stack() { srsran_random_free(random_gen); } ~ue_dummy_stack() { srsran_random_free(random_gen); }
void in_sync() override {} void in_sync() override {}
void out_of_sync() override {} void out_of_sync() override {}
@ -54,7 +57,18 @@ public:
srsran_random_byte_vector(random_gen, action->tb.payload->msg, grant.tbs / 8); srsran_random_byte_vector(random_gen, action->tb.payload->msg, grant.tbs / 8);
} }
void prach_sent(uint32_t tti, uint32_t s_id, uint32_t t_id, uint32_t f_id, uint32_t ul_carrier_id) override {} void prach_sent(uint32_t tti, uint32_t s_id, uint32_t t_id, uint32_t f_id, uint32_t ul_carrier_id) override {}
bool sr_opportunity(uint32_t tti, uint32_t sr_id, bool meas_gap, bool ul_sch_tx) override { return false; } bool sr_opportunity(uint32_t tti, uint32_t sr_id, bool meas_gap, bool ul_sch_tx) override
{
if (sr_period == 0) {
return false;
}
bool ret = (sr_count % sr_period == 0);
sr_count++;
return ret;
}
bool is_valid() const { return valid; } bool is_valid() const { return valid; }
}; };

@ -71,6 +71,10 @@ test_bench::args_t::args_t(int argc, char** argv)
("ue.phy.log.id_preamble", bpo::value<std::string>(&ue_phy.log.id_preamble)->default_value(" UE/"), "UE PHY log ID preamble") ("ue.phy.log.id_preamble", bpo::value<std::string>(&ue_phy.log.id_preamble)->default_value(" UE/"), "UE PHY log ID preamble")
; ;
options_ue_stack.add_options()
("ue.stack.sr.period", bpo::value<uint32_t>(&ue_stack.sr_period)->default_value(ue_stack.sr_period), "SR period in number of opportunities. Set 0 to disable and 1 for all.")
;
options.add(options_gnb_stack).add(options_gnb_phy).add(options_ue_stack).add(options_ue_phy).add_options() options.add(options_gnb_stack).add(options_gnb_phy).add(options_ue_stack).add(options_ue_phy).add_options()
("help", "Show this message") ("help", "Show this message")
; ;

Loading…
Cancel
Save