From 218fa5cf55ac3424279d1ee1c9b2a32a0eda4665 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Thu, 2 Jul 2020 17:39:43 +0200 Subject: [PATCH] ttcn3_dut: fix bug in DUT reducing the sync queue len to 1 caused an issue when the PHY was locking the mutex while trying to push a TTI event on the stack. instead of signaling the new TTI within the PHY, we now do it outside in the DUT (after releasing the PHY mutex) --- srsue/test/ttcn3/src/lte_ttcn3_phy.cc | 5 ++--- srsue/test/ttcn3/src/ttcn3_ue.cc | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/srsue/test/ttcn3/src/lte_ttcn3_phy.cc b/srsue/test/ttcn3/src/lte_ttcn3_phy.cc index d9804b761..0f634f844 100644 --- a/srsue/test/ttcn3/src/lte_ttcn3_phy.cc +++ b/srsue/test/ttcn3/src/lte_ttcn3_phy.cc @@ -159,7 +159,7 @@ void lte_ttcn3_phy::reset() log.debug("%s not implemented.\n", __FUNCTION__); }; -// The interface for MAC +// The interface for MAC (called from Stack thread context) void lte_ttcn3_phy::configure_prach_params() { log.debug("%s not implemented.\n", __FUNCTION__); @@ -167,6 +167,7 @@ void lte_ttcn3_phy::configure_prach_params() void lte_ttcn3_phy::prach_send(uint32_t preamble_idx, int allowed_subframe, float target_power_dbm, float ta_base_sec) { + std::lock_guard lock(mutex); log.info("Sending PRACH with preamble %d on PCID=%d\n", preamble_idx, pcell.info.id); prach_tti_tx = current_tti; ra_trans_cnt++; @@ -372,8 +373,6 @@ void lte_ttcn3_phy::run_tti() sr_pending = false; sr_tx_tti = current_tti; } - - stack->run_tti(current_tti, 1); } void lte_ttcn3_phy::set_cells_to_meas(uint32_t earfcn, const std::set& pci) {} diff --git a/srsue/test/ttcn3/src/ttcn3_ue.cc b/srsue/test/ttcn3/src/ttcn3_ue.cc index 9d061e3b5..87ab5df46 100644 --- a/srsue/test/ttcn3/src/ttcn3_ue.cc +++ b/srsue/test/ttcn3/src/ttcn3_ue.cc @@ -146,6 +146,7 @@ void ttcn3_ue::new_tb(const srsue::mac_interface_phy_lte::mac_grant_dl_t mac_gra void ttcn3_ue::set_current_tti(uint32_t tti) { phy->set_current_tti(tti); + stack->run_tti(tti, 1); } uint16_t ttcn3_ue::get_dl_sched_rnti(uint32_t tti)