From 18ce1c315cb1a8b9a25c0941beea23a520967cad Mon Sep 17 00:00:00 2001 From: Tom <82247342+Shadowcaster77@users.noreply.github.com> Date: Thu, 7 Jul 2022 14:01:40 -0400 Subject: [PATCH 01/13] Update receiver.cc --- CC/Sounder/receiver.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/CC/Sounder/receiver.cc b/CC/Sounder/receiver.cc index 56c47b2f..50dbc21b 100644 --- a/CC/Sounder/receiver.cc +++ b/CC/Sounder/receiver.cc @@ -6,7 +6,6 @@ Handles received samples from massive-mimo base station ---------------------------------------------------------- */ - #include "include/receiver.h" #include From 82749b1e4c2c685c4fe8a6d26174c74f7e493c40 Mon Sep 17 00:00:00 2001 From: Tom <82247342+Shadowcaster77@users.noreply.github.com> Date: Thu, 7 Jul 2022 14:04:03 -0400 Subject: [PATCH 02/13] Update receiver.cc --- CC/Sounder/receiver.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/CC/Sounder/receiver.cc b/CC/Sounder/receiver.cc index 50dbc21b..56c47b2f 100644 --- a/CC/Sounder/receiver.cc +++ b/CC/Sounder/receiver.cc @@ -6,6 +6,7 @@ Handles received samples from massive-mimo base station ---------------------------------------------------------- */ + #include "include/receiver.h" #include From 26392d07bb349255711a18862095afcabf19306e Mon Sep 17 00:00:00 2001 From: Tom <82247342+Shadowcaster77@users.noreply.github.com> Date: Fri, 29 Jul 2022 13:26:16 -0400 Subject: [PATCH 03/13] Update ClientRadioSetUHD.cc --- CC/Sounder/ClientRadioSetUHD.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CC/Sounder/ClientRadioSetUHD.cc b/CC/Sounder/ClientRadioSetUHD.cc index 40a1fb41..ed8b8959 100644 --- a/CC/Sounder/ClientRadioSetUHD.cc +++ b/CC/Sounder/ClientRadioSetUHD.cc @@ -126,7 +126,7 @@ void ClientRadioSetUHD::init(ClientRadioContext* context) { std::map args; args["timeout"] = "1000000"; args["driver"] = "uhd"; - args["addr"] = _cfg->cl_sdr_ids().at(i); + args["serial"] = _cfg->cl_sdr_ids().at(i); try { radio_ = nullptr; From dab9cf7b86d6203ae83d8e56c8119d164934b75c Mon Sep 17 00:00:00 2001 From: Tom <82247342+Shadowcaster77@users.noreply.github.com> Date: Fri, 29 Jul 2022 13:27:28 -0400 Subject: [PATCH 04/13] Update RadioUHD.cc --- CC/Sounder/RadioUHD.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CC/Sounder/RadioUHD.cc b/CC/Sounder/RadioUHD.cc index 6f3ad7b7..4fd06480 100644 --- a/CC/Sounder/RadioUHD.cc +++ b/CC/Sounder/RadioUHD.cc @@ -46,8 +46,8 @@ void RadioUHD::dev_init(Config* _cfg, int ch, double rxgain, double txgain) { dev_->set_rx_antenna("TX/RX", ch); // update for UHD multi USRP - dev_->set_rx_gain(std::min(31.5, rxgain), "PGA0", ch); - dev_->set_tx_gain(std::min(31.5, txgain), "PGA0", ch); + dev_->set_rx_gain(std::min(31.5, rxgain), ch); + dev_->set_tx_gain(std::min(31.5, txgain), ch); } void RadioUHD::drain_buffers(std::vector buffs, int symSamp) { From 62c7eabdc79ab5667878f8b09256bd102578bcbe Mon Sep 17 00:00:00 2001 From: Tom <82247342+Shadowcaster77@users.noreply.github.com> Date: Fri, 29 Jul 2022 13:34:28 -0400 Subject: [PATCH 05/13] Update usrp_16qam.json --- CC/Sounder/files/special_conf/usrp_16qam.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CC/Sounder/files/special_conf/usrp_16qam.json b/CC/Sounder/files/special_conf/usrp_16qam.json index caa0cf22..685e6bd9 100644 --- a/CC/Sounder/files/special_conf/usrp_16qam.json +++ b/CC/Sounder/files/special_conf/usrp_16qam.json @@ -15,7 +15,7 @@ }, "Clients": { "sdr": [ - "10.10.23.5" + "30AD2E0" ] } } From 50d851fe1e811fe3a0ba6ded204122463779b1f2 Mon Sep 17 00:00:00 2001 From: Tom <82247342+Shadowcaster77@users.noreply.github.com> Date: Fri, 29 Jul 2022 13:51:17 -0400 Subject: [PATCH 06/13] Update RadioUHD.cc --- CC/Sounder/RadioUHD.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CC/Sounder/RadioUHD.cc b/CC/Sounder/RadioUHD.cc index 4fd06480..58102bf3 100644 --- a/CC/Sounder/RadioUHD.cc +++ b/CC/Sounder/RadioUHD.cc @@ -46,8 +46,8 @@ void RadioUHD::dev_init(Config* _cfg, int ch, double rxgain, double txgain) { dev_->set_rx_antenna("TX/RX", ch); // update for UHD multi USRP - dev_->set_rx_gain(std::min(31.5, rxgain), ch); - dev_->set_tx_gain(std::min(31.5, txgain), ch); + dev_->set_rx_gain(std::min(100.5, rxgain), ch); + dev_->set_tx_gain(std::min(100.5, txgain), ch); } void RadioUHD::drain_buffers(std::vector buffs, int symSamp) { From da7a6bed332b7dd3d6f9e4b3589e7a0efaff31a6 Mon Sep 17 00:00:00 2001 From: Tom <82247342+Shadowcaster77@users.noreply.github.com> Date: Thu, 7 Jul 2022 14:01:40 -0400 Subject: [PATCH 07/13] Update receiver.cc --- CC/Sounder/receiver.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/CC/Sounder/receiver.cc b/CC/Sounder/receiver.cc index fc00664e..7e23e1b2 100644 --- a/CC/Sounder/receiver.cc +++ b/CC/Sounder/receiver.cc @@ -6,7 +6,6 @@ Handles received samples from massive-mimo base station ---------------------------------------------------------- */ - #include "include/receiver.h" #include From 624918d455d2493ecd8062f3cd4d47d2e4c5959b Mon Sep 17 00:00:00 2001 From: Tom <82247342+Shadowcaster77@users.noreply.github.com> Date: Thu, 7 Jul 2022 14:04:03 -0400 Subject: [PATCH 08/13] Update receiver.cc --- CC/Sounder/receiver.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/CC/Sounder/receiver.cc b/CC/Sounder/receiver.cc index 7e23e1b2..fc00664e 100644 --- a/CC/Sounder/receiver.cc +++ b/CC/Sounder/receiver.cc @@ -6,6 +6,7 @@ Handles received samples from massive-mimo base station ---------------------------------------------------------- */ + #include "include/receiver.h" #include From 97aebca0a771fb67667a3cf6e7b95635b26be4e0 Mon Sep 17 00:00:00 2001 From: Tom <82247342+Shadowcaster77@users.noreply.github.com> Date: Fri, 29 Jul 2022 13:26:16 -0400 Subject: [PATCH 09/13] Update ClientRadioSetUHD.cc --- CC/Sounder/ClientRadioSetUHD.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CC/Sounder/ClientRadioSetUHD.cc b/CC/Sounder/ClientRadioSetUHD.cc index f365f2e1..15fcfa5b 100644 --- a/CC/Sounder/ClientRadioSetUHD.cc +++ b/CC/Sounder/ClientRadioSetUHD.cc @@ -137,7 +137,7 @@ void ClientRadioSetUHD::init(ClientRadioContext* context) { std::map args; args["timeout"] = "1000000"; args["driver"] = "uhd"; - args["addr"] = _cfg->cl_sdr_ids().at(i); + args["serial"] = _cfg->cl_sdr_ids().at(i); try { radio_ = nullptr; From d1369f32a07129cb9bbddf6d3699ebbb805ec05c Mon Sep 17 00:00:00 2001 From: Tom <82247342+Shadowcaster77@users.noreply.github.com> Date: Fri, 29 Jul 2022 13:27:28 -0400 Subject: [PATCH 10/13] Update RadioUHD.cc --- CC/Sounder/RadioUHD.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CC/Sounder/RadioUHD.cc b/CC/Sounder/RadioUHD.cc index f882428f..bc2299df 100644 --- a/CC/Sounder/RadioUHD.cc +++ b/CC/Sounder/RadioUHD.cc @@ -47,8 +47,8 @@ void RadioUHD::dev_init([[maybe_unused]] Config* _cfg, int ch, double rxgain, dev_->set_rx_antenna("TX/RX", ch); // update for UHD multi USRP - dev_->set_rx_gain(std::min(31.5, rxgain), "PGA0", ch); - dev_->set_tx_gain(std::min(31.5, txgain), "PGA0", ch); + dev_->set_rx_gain(std::min(31.5, rxgain), ch); + dev_->set_tx_gain(std::min(31.5, txgain), ch); } void RadioUHD::drain_buffers(std::vector buffs, int symSamp) { From 52bcf99fb0eefeaf0589400a4fe906a2a169c474 Mon Sep 17 00:00:00 2001 From: Tom <82247342+Shadowcaster77@users.noreply.github.com> Date: Fri, 29 Jul 2022 13:34:28 -0400 Subject: [PATCH 11/13] Update usrp_16qam.json --- CC/Sounder/files/special_conf/usrp_16qam.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CC/Sounder/files/special_conf/usrp_16qam.json b/CC/Sounder/files/special_conf/usrp_16qam.json index caa0cf22..685e6bd9 100644 --- a/CC/Sounder/files/special_conf/usrp_16qam.json +++ b/CC/Sounder/files/special_conf/usrp_16qam.json @@ -15,7 +15,7 @@ }, "Clients": { "sdr": [ - "10.10.23.5" + "30AD2E0" ] } } From fc33b60c34780e9f3bad6b237815b4153fb2f3ad Mon Sep 17 00:00:00 2001 From: Tom <82247342+Shadowcaster77@users.noreply.github.com> Date: Fri, 29 Jul 2022 13:51:17 -0400 Subject: [PATCH 12/13] Update RadioUHD.cc --- CC/Sounder/RadioUHD.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CC/Sounder/RadioUHD.cc b/CC/Sounder/RadioUHD.cc index bc2299df..e4a244e0 100644 --- a/CC/Sounder/RadioUHD.cc +++ b/CC/Sounder/RadioUHD.cc @@ -47,8 +47,8 @@ void RadioUHD::dev_init([[maybe_unused]] Config* _cfg, int ch, double rxgain, dev_->set_rx_antenna("TX/RX", ch); // update for UHD multi USRP - dev_->set_rx_gain(std::min(31.5, rxgain), ch); - dev_->set_tx_gain(std::min(31.5, txgain), ch); + dev_->set_rx_gain(std::min(100.5, rxgain), ch); + dev_->set_tx_gain(std::min(100.5, txgain), ch); } void RadioUHD::drain_buffers(std::vector buffs, int symSamp) { From c2e832bb15a40ac4c3d2fef35bf3845a87c44ac1 Mon Sep 17 00:00:00 2001 From: obejarano Date: Wed, 3 May 2023 17:47:52 -0500 Subject: [PATCH 13/13] Separate timing and clock source variables --- CC/Sounder/BaseRadioSetUHD.cc | 13 +++++++------ CC/Sounder/ClientRadioSetUHD.cc | 8 +++++--- CC/Sounder/config.cc | 18 ++++++++++++------ CC/Sounder/include/config.h | 16 +++++++++++----- 4 files changed, 35 insertions(+), 20 deletions(-) diff --git a/CC/Sounder/BaseRadioSetUHD.cc b/CC/Sounder/BaseRadioSetUHD.cc index 43916b9f..9fda3e89 100644 --- a/CC/Sounder/BaseRadioSetUHD.cc +++ b/CC/Sounder/BaseRadioSetUHD.cc @@ -80,11 +80,12 @@ BaseRadioSetUHD::BaseRadioSetUHD(Config* cfg) : _cfg(cfg) { } // write TDD schedule and beacons to FPFA buffers only for Iris - const auto clock_source = _cfg->getBsClockType(); - bsRadios->RawDev()->set_time_source(clock_source); + const auto timing_source = _cfg->getBsTimingSrc(); + const auto clock_source = _cfg->getBsClockSrc(); + bsRadios->RawDev()->set_time_source(timing_source); bsRadios->RawDev()->set_clock_source(clock_source); bsRadios->RawDev()->set_time_unknown_pps(uhd::time_spec_t(0.0)); - MLPD_INFO( + /*MLPD_INFO( "USRP BS Clock source requested %s, actual %s, Time Source requested " "%s, actual %s\n", clock_source.c_str(), @@ -95,7 +96,7 @@ BaseRadioSetUHD::BaseRadioSetUHD(Config* cfg) : _cfg(cfg) { bsRadios->RawDev() ->get_time_source(uhd::usrp::multi_usrp::ALL_MBOARDS) .c_str()); - + */ // Wait for pps sync pulse std::this_thread::sleep_for(std::chrono::seconds(1)); @@ -212,7 +213,6 @@ void BaseRadioSetUHD::init(BaseRadioContext* context) { int c = context->cell; std::atomic_ulong* thread_count = context->thread_count; delete context; - MLPD_TRACE("Deleting context for tid: %d\n", i); std::map args; @@ -222,7 +222,8 @@ void BaseRadioSetUHD::init(BaseRadioContext* context) { std::vector address_list; for (size_t i = 0; i < num_radios; i++) { std::ostringstream oss; - oss << "addr" << i; + //oss << "addr" << i; + oss << "serial"; address_list.push_back(oss.str()); args[address_list.at(i)] = _cfg->bs_sdr_ids().at(c).at(i); } diff --git a/CC/Sounder/ClientRadioSetUHD.cc b/CC/Sounder/ClientRadioSetUHD.cc index 15fcfa5b..7e4d46d9 100644 --- a/CC/Sounder/ClientRadioSetUHD.cc +++ b/CC/Sounder/ClientRadioSetUHD.cc @@ -93,11 +93,12 @@ ClientRadioSetUHD::ClientRadioSetUHD(Config* cfg) : _cfg(cfg) { "discovered in the network!" << std::endl; } else { - const auto cl_clock_source = _cfg->getClClockType(0); - radio_->RawDev()->set_time_source(cl_clock_source); + const auto cl_timing_source = _cfg->getClTimingSrc(0); + const auto cl_clock_source = _cfg->getClClockSrc(0); + radio_->RawDev()->set_time_source(cl_timing_source); radio_->RawDev()->set_clock_source(cl_clock_source); radio_->RawDev()->set_time_unknown_pps(uhd::time_spec_t(0.0)); - MLPD_INFO( + /*MLPD_INFO( "USRP UE Clock source requested %s, actual %s, Time Source requested " "%s, actual %s\n", cl_clock_source.c_str(), @@ -108,6 +109,7 @@ ClientRadioSetUHD::ClientRadioSetUHD(Config* cfg) : _cfg(cfg) { radio_->RawDev() ->get_time_source(uhd::usrp::multi_usrp::ALL_MBOARDS) .c_str()); + */ radio_->activateRecv(); radio_->activateXmit(); MLPD_INFO("%s done!\n", __func__); diff --git a/CC/Sounder/config.cc b/CC/Sounder/config.cc index 5d04798b..12065634 100644 --- a/CC/Sounder/config.cc +++ b/CC/Sounder/config.cc @@ -22,8 +22,10 @@ static constexpr size_t kMaxSupportedFFTSize = 2048; static constexpr size_t kMinSupportedFFTSize = 64; static constexpr size_t kMaxSupportedCPSize = 128; -static const std::string kDefaultBsClockType = "external"; -static const std::string kDefaultUeClockType = "internal"; +static const std::string kDefaultBsClockSrc = "internal"; +static const std::string kDefaultUeClockSrc = "internal"; +static const std::string kDefaultBsTimingSrc = "internal"; +static const std::string kDefaultUeTimingSrc = "internal"; Config::Config(const std::string& jsonfile, const std::string& directory, const bool bs_only, const bool client_only, const bool calibrate) @@ -127,7 +129,8 @@ Config::Config(const std::string& jsonfile, const std::string& directory, beacon_ch_ = beacon_ant_ % bs_sdr_ch_; max_frame_ = tddConf.value("max_frame", 0); bs_hw_framer_ = tddConf.value("bs_hw_framer", true); - bs_clock_type_ = tddConf.value("bs_clock_type", kDefaultBsClockType); + bs_clock_src_ = tddConf.value("bs_clock_src", kDefaultBsClockSrc); + bs_timing_src_ = tddConf.value("bs_timing_src", kDefaultBsTimingSrc); // Load/Build BS and Client SDRs' Schedules bs_array_frames_.resize(num_cells_); @@ -211,15 +214,18 @@ Config::Config(const std::string& jsonfile, const std::string& directory, corr_scale_.assign(corr_scale.begin(), corr_scale.end()); } - auto cl_clock_type = tddConf.value("cl_clock_type", json::array()); + auto cl_clock_src = tddConf.value("cl_clock_src", json::array()); + auto cl_timing_src = tddConf.value("cl_timing_src", json::array()); if (tx_advance.empty() == true) { - cl_clock_type_.resize(num_cl_sdrs_, kDefaultUeClockType); + cl_clock_src_.resize(num_cl_sdrs_, kDefaultUeClockSrc); + cl_timing_src_.resize(num_cl_sdrs_, kDefaultUeTimingSrc); } else { if (client_present_ && tx_advance.size() != num_cl_sdrs_) { MLPD_ERROR("cl_clock_type size must be same as the number of clients!\n"); std::exit(1); } - cl_clock_type_.assign(cl_clock_type.begin(), cl_clock_type.end()); + cl_clock_src_.assign(cl_clock_src.begin(), cl_clock_src.end()); + cl_timing_src_.assign(cl_timing_src.begin(), cl_timing_src.end()); } ul_data_frame_num_ = tddConf.value("ul_data_frame_num", 1); diff --git a/CC/Sounder/include/config.h b/CC/Sounder/include/config.h index d2619b0b..31224c63 100644 --- a/CC/Sounder/include/config.h +++ b/CC/Sounder/include/config.h @@ -263,9 +263,13 @@ class Config { } inline size_t getTxFrameDelta() const { return tx_frame_delta_; } - inline const std::string getBsClockType() const { return bs_clock_type_; } - inline const std::string getClClockType(size_t ue_idx) const { - return cl_clock_type_.at(ue_idx); + inline const std::string getBsClockSrc() const { return bs_clock_src_; } + inline const std::string getClClockSrc(size_t ue_idx) const { + return cl_clock_src_.at(ue_idx); + } + inline const std::string getBsTimingSrc() const { return bs_timing_src_; } + inline const std::string getClTimingSrc(size_t ue_idx) const { + return cl_timing_src_.at(ue_idx); } size_t getNumAntennas(); @@ -384,7 +388,8 @@ class Config { bool ref_node_enable_; size_t cal_ref_sdr_id_; size_t tx_frame_delta_; - std::string bs_clock_type_; + std::string bs_clock_src_; + std::string bs_timing_src_; // Clients features std::vector cl_sdr_ids_; @@ -398,7 +403,8 @@ class Config { bool cl_power_ramp_; int cl_power_ramp_lo_; int cl_power_ramp_hi_; - std::vector cl_clock_type_; + std::vector cl_clock_src_; + std::vector cl_timing_src_; std::vector tx_advance_; std::vector corr_scale_;