From a0ded71188aa96282736a9bc13a086b71f92d965 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 3 May 2017 15:49:10 -0700 Subject: eiscat: Added skeleton for dboard driver support --- host/include/uhd/rfnoc/blocks/ddc_eiscat.xml | 178 ++++++++++++++++ host/include/uhd/rfnoc/blocks/radio_eiscat.xml | 229 +++++++++++++++++++++ host/lib/usrp/CMakeLists.txt | 1 - host/lib/usrp/dboard/CMakeLists.txt | 2 + host/lib/usrp/dboard/eiscat/CMakeLists.txt | 24 +++ .../usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp | 178 ++++++++++++++++ .../usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp | 73 +++++++ host/lib/usrp/dboard/magnesium/CMakeLists.txt | 24 +++ .../dboard/magnesium/magnesium_radio_ctrl_impl.cpp | 99 +++++++++ .../dboard/magnesium/magnesium_radio_ctrl_impl.hpp | 72 +++++++ host/lib/usrp/magnesium/CMakeLists.txt | 24 --- .../usrp/magnesium/magnesium_radio_ctrl_impl.cpp | 99 --------- .../usrp/magnesium/magnesium_radio_ctrl_impl.hpp | 72 ------- host/lib/usrp/netd/netd_impl.cpp | 8 +- 14 files changed, 883 insertions(+), 200 deletions(-) create mode 100644 host/include/uhd/rfnoc/blocks/ddc_eiscat.xml create mode 100644 host/include/uhd/rfnoc/blocks/radio_eiscat.xml create mode 100644 host/lib/usrp/dboard/eiscat/CMakeLists.txt create mode 100644 host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp create mode 100644 host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp create mode 100644 host/lib/usrp/dboard/magnesium/CMakeLists.txt create mode 100644 host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp create mode 100644 host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp delete mode 100644 host/lib/usrp/magnesium/CMakeLists.txt delete mode 100644 host/lib/usrp/magnesium/magnesium_radio_ctrl_impl.cpp delete mode 100644 host/lib/usrp/magnesium/magnesium_radio_ctrl_impl.hpp diff --git a/host/include/uhd/rfnoc/blocks/ddc_eiscat.xml b/host/include/uhd/rfnoc/blocks/ddc_eiscat.xml new file mode 100644 index 000000000..93cf8371f --- /dev/null +++ b/host/include/uhd/rfnoc/blocks/ddc_eiscat.xml @@ -0,0 +1,178 @@ + + + EISCAT Rx DSP (DDC/CORDIC) + DDC + DDC + + + DDC5E15CA7000000 + + + + + + N +
128
+
+ + M +
129
+
+ + + CONFIG +
130
+
+ + + + CORDIC_FREQ +
132
+
+ + + SCALE_IQ +
133
+
+ + + DECIM_WORD +
134
+
+ + + MODE +
135
+
+ + + RELOAD +
136
+
+
+ + + + freq + double + 0.0 + 0 + + + + + + + input_rate + double + 1.0 + 0 + GE($input_rate, 0.0) + The input rate must be a positive value (in Hz). + + + output_rate + double + 1.0 + 0 + GE($output_rate, 0.0) + The output rate must be a positive value (in Hz). + + + fullscale + double + 1.0 + 0 + GE($fullscale, 0.0) + + + scalar_correction + double + 1.0 + 0 + + + freq + double + 0.0 + 1 + + + + + + + input_rate + double + 1.0 + 1 + GE($input_rate, 0.0) + The input rate must be a positive value (in Hz). + + + output_rate + double + 1.0 + 1 + GE($output_rate, 0.0) + The output rate must be a positive value (in Hz). + + + fullscale + double + 1.0 + 1 + GE($fullscale, 0.0) + + + scalar_correction + double + 1.0 + 1 + + + + + + in0 + s16 + + + in1 + s16 + + + in2 + s16 + + + in3 + s16 + + + in4 + s16 + + + out0 + sc16 + + + out1 + sc16 + + + out2 + sc16 + + + out3 + sc16 + + + out4 + sc16 + + +
+ diff --git a/host/include/uhd/rfnoc/blocks/radio_eiscat.xml b/host/include/uhd/rfnoc/blocks/radio_eiscat.xml new file mode 100644 index 000000000..03b440943 --- /dev/null +++ b/host/include/uhd/rfnoc/blocks/radio_eiscat.xml @@ -0,0 +1,229 @@ + + Radio (EISCAT) + Radio + EISCATRadio + + + E15CA70000000000 + + + + + + SR_BEAMS_TO_NEIGHBOR +
135
+
+ + + SR_PREV_OR_NULL +
136
+
+ + + SR_FIR_COMMANDS_RELOAD +
131
+
+ + SR_FIR_COMMANDS_CTRL_TIME_HI +
132
+
+ + SR_FIR_COMMANDS_CTRL_TIME_LO +
133
+
+ + + SR_FIR_BRAM_WRITE_TAPS +
134
+
+ + + + + + RB_NUM_TAPS +
0
+
+ + RB_NUM_CHANNELS +
1
+
+ + RB_NUM_BEAMS +
2
+
+ + RB_NUM_FILTERS +
3
+
+ + RB_VITA_TIME +
4
+
+
+ + + + + spp + int + 1996 + + + taps + int + + + use_prev + int + 0 + EQUAL($use_prev, 0) OR EQUAL($use_prev, 1) + use_prev must be 0 or 1. + SR_WRITE("SR_PREV_OR_NULL", $use_prev) AND SR_WRITE("SR_PREV_OR_NULL", $use_prev) + + + neighbors + int + 0 + + + gain + double + 1.0 + 0 + + + gain + double + 1.0 + 1 + + + gain + double + 1.0 + 2 + + + gain + double + 1.0 + 3 + + + gain + double + 1.0 + 4 + + + gain + double + 1.0 + 5 + + + gain + double + 1.0 + 6 + + + gain + double + 1.0 + 7 + + + gain + double + 1.0 + 8 + + + gain + double + 1.0 + 9 + + + gain + double + 1.0 + 10 + + + gain + double + 1.0 + 11 + + + gain + double + 1.0 + 12 + + + gain + double + 1.0 + 13 + + + gain + double + 1.0 + 14 + + + gain + double + 1.0 + 15 + + + + + out0 + s16 + + + out1 + s16 + + + out2 + s16 + + + out3 + s16 + + + out4 + s16 + + + in0 + s16 + + + in1 + s16 + + + in2 + s16 + + + in3 + s16 + + + in4 + s16 + + +
+ diff --git a/host/lib/usrp/CMakeLists.txt b/host/lib/usrp/CMakeLists.txt index 6d69093e9..0f8172d41 100644 --- a/host/lib/usrp/CMakeLists.txt +++ b/host/lib/usrp/CMakeLists.txt @@ -49,4 +49,3 @@ INCLUDE_SUBDIRECTORY(e300) INCLUDE_SUBDIRECTORY(x300) INCLUDE_SUBDIRECTORY(b200) INCLUDE_SUBDIRECTORY(n230) -INCLUDE_SUBDIRECTORY(magnesium) diff --git a/host/lib/usrp/dboard/CMakeLists.txt b/host/lib/usrp/dboard/CMakeLists.txt index 92d2b2a24..1372406b8 100644 --- a/host/lib/usrp/dboard/CMakeLists.txt +++ b/host/lib/usrp/dboard/CMakeLists.txt @@ -45,3 +45,5 @@ IF(ENABLE_X300) ) ENDIF(ENABLE_X300) +INCLUDE_SUBDIRECTORY(magnesium) +INCLUDE_SUBDIRECTORY(eiscat) diff --git a/host/lib/usrp/dboard/eiscat/CMakeLists.txt b/host/lib/usrp/dboard/eiscat/CMakeLists.txt new file mode 100644 index 000000000..bd55dcc14 --- /dev/null +++ b/host/lib/usrp/dboard/eiscat/CMakeLists.txt @@ -0,0 +1,24 @@ +# +# Copyright 2017 Ettus Research LLC +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +IF(ENABLE_NETD AND ENABLE_EISCAT) + LIST(APPEND EISCAT_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/eiscat_radio_ctrl_impl.cpp + ) + LIBUHD_APPEND_SOURCES(${EISCAT_SOURCES}) +ENDIF(ENABLE_NETD AND ENABLE_EISCAT) + diff --git a/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp b/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp new file mode 100644 index 000000000..e65f2f6df --- /dev/null +++ b/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp @@ -0,0 +1,178 @@ +// +// Copyright 2017 Ettus Research (National Instruments Corp.) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +#include "eiscat_radio_ctrl_impl.hpp" + +#include +#include +#include +#include +#include +#include +#include + +using namespace uhd; +using namespace uhd::usrp; +using namespace uhd::rfnoc; + +static const size_t IO_MASTER_RADIO = 0; +static const double EISCAT_TICK_RATE = 208e6; // Hz +static const double EISCAT_RADIO_RATE = 104e6; // Hz +static const double EISCAT_CENTER_FREQ = 104e6; // Hz +static const double EISCAT_DEFAULT_GAIN = 0.0; // Hz +static const double EISCAT_DEFAULT_BANDWIDTH = 52e6; // Hz +static const std::string EISCAT_ANTENNA_NAME = "Rx"; +static const size_t EISCAT_NUM_CHANS = 5; + +UHD_RFNOC_RADIO_BLOCK_CONSTRUCTOR(eiscat_radio_ctrl) +{ + UHD_LOG_TRACE("EISCAT", "eiscat_radio_ctrl_impl::ctor() "); + _radio_type = (get_block_id().get_block_count() == IO_MASTER_RADIO) ? PRIMARY : SECONDARY; + _radio_slot = (get_block_id().get_block_count() == IO_MASTER_RADIO) ? "A" : "B"; + UHD_LOG_TRACE("EISCAT", "Radio slot: " << _radio_slot); + const size_t num_chans = get_output_ports().size(); + UHD_ASSERT_THROW(num_chans == EISCAT_NUM_CHANS); + UHD_LOG_TRACE("EISCAT", "Number of channels: " << num_chans); + + UHD_LOG_TRACE("EISCAT", "Setting tick rate to " << EISCAT_TICK_RATE/1e6 << " MHz"); + radio_ctrl_impl::set_rate(EISCAT_TICK_RATE); + + // For legacy prop tree init: + fs_path fe_path = fs_path("dboards" / _radio_slot / "rx_frontends"); + + // Init parent class + for (size_t chan = 0; chan < num_chans; chan++) { + radio_ctrl_impl::set_rx_frequency(EISCAT_CENTER_FREQ, chan); + radio_ctrl_impl::set_rx_gain(EISCAT_DEFAULT_GAIN, chan); + radio_ctrl_impl::set_rx_antenna(EISCAT_ANTENNA_NAME, chan); + radio_ctrl_impl::set_rx_bandwidth(EISCAT_DEFAULT_BANDWIDTH, chan); + + // Legacy prop tree paths (for use with multi_usrp API) + _tree->access(fe_path / chan / "antenna" / "value") + .add_coerced_subscriber(boost::bind(&eiscat_radio_ctrl_impl::set_rx_antenna, this, _1, chan)) + .set_publisher(boost::bind(&radio_ctrl_impl::get_rx_antenna, this, chan)) + ; + _tree->access(fe_path / chan / "freq" / "value") + .set_coercer(boost::bind(&eiscat_radio_ctrl_impl::set_rx_frequency, this, _1, chan)) + .set_publisher(boost::bind(&radio_ctrl_impl::get_rx_frequency, this, chan)) + ; + _tree->access(fe_path / chan / "gain" / "value") + .set_coercer(boost::bind(&eiscat_radio_ctrl_impl::set_rx_gain, this, _1, chan)) + .set_publisher(boost::bind(&radio_ctrl_impl::get_rx_gain, this, chan)) + ; + _tree->access(fe_path / chan / "bandwidth" / "value") + .set_coercer(boost::bind(&eiscat_radio_ctrl_impl::set_rx_bandwidth, this, _1, chan)) + .set_publisher(boost::bind(&radio_ctrl_impl::get_rx_bandwidth, this, chan)) + ; + // TODO: Add ranges or options for all of these. Not high-prio. + } + + UHD_HERE(); + UHD_VAR((_tree->exists(fs_path("time/cmd")))); +} + +eiscat_radio_ctrl_impl::~eiscat_radio_ctrl_impl() +{ + UHD_LOG_TRACE("EISCAT", "eiscat_radio_ctrl_impl::dtor() "); +} + +void eiscat_radio_ctrl_impl::set_tx_antenna(const std::string &, const size_t) +{ + throw uhd::runtime_error("Cannot set Tx antenna on EISCAT daughterboard"); +} + +void eiscat_radio_ctrl_impl::set_rx_antenna(const std::string & /* ant */, const size_t /* chan */) +{ + UHD_LOG_WARNING("EISCAT", "Ignoring attempt to set Rx antenna"); +} + +double eiscat_radio_ctrl_impl::get_tx_frequency(const size_t /* chan */) +{ + UHD_LOG_WARNING("EISCAT", "Ignoring attempt to read Tx frequency"); + return 0.0; +} + +double eiscat_radio_ctrl_impl::set_tx_frequency(const double /* freq */, const size_t /* chan */) +{ + throw uhd::runtime_error("Cannot set Tx frequency on EISCAT daughterboard"); +} + +double eiscat_radio_ctrl_impl::set_rx_frequency(const double freq, const size_t chan) +{ + if (freq != get_rx_frequency(chan)) { + UHD_LOG_WARNING("EISCAT", "Ignoring attempt to set Rx frequency"); + } + return get_rx_frequency(chan); +} + +double eiscat_radio_ctrl_impl::set_rx_bandwidth(const double bandwidth, const size_t chan) +{ + if (bandwidth != get_rx_bandwidth(chan)) { + UHD_LOG_WARNING("EISCAT", "Ignoring attempt to set Rx bandwidth"); + } + return get_rx_bandwidth(chan); +} + + +double eiscat_radio_ctrl_impl::set_tx_gain(const double /* gain */, const size_t /* chan */) +{ + throw uhd::runtime_error("Cannot set Tx gain on EISCAT daughterboard"); +} + +double eiscat_radio_ctrl_impl::set_rx_gain(const double gain, const size_t chan) +{ + // TODO: Add ability to set digital gain or make it explicit this function is not supported. + if (gain != get_rx_gain(chan)) { + UHD_LOG_WARNING("EISCAT", "Ignoring attempt to set Rx gain."); + } + return get_rx_gain(chan); +} + +double eiscat_radio_ctrl_impl::set_rate(double rate) +{ + if (rate != get_rate()) { + UHD_LOG_WARNING("EISCAT", "Attempting to set sampling rate to invalid value " << rate); + } + return get_rate(); +} + +size_t eiscat_radio_ctrl_impl::get_chan_from_dboard_fe(const std::string &fe, const uhd::direction_t dir) +{ + if (dir != uhd::direction_t::RX_DIRECTION) { + throw uhd::runtime_error("Unable to get chan from fe, EISCAT only has Rx frontends"); + } + + // A:0 -> A:7, B:0 -> B:7 + return boost::lexical_cast(fe.substr(2)); +} + +std::string eiscat_radio_ctrl_impl::get_dboard_fe_from_chan(const size_t chan, const uhd::direction_t dir) +{ + if (dir != uhd::direction_t::RX_DIRECTION) { + throw uhd::runtime_error("Unable to get fe from chan, EISCAT only has Rx frontends"); + } + + // A:0 -> A:7, B:0 -> B:7 + return _radio_slot + ':' + std::to_string(chan); +} + +double eiscat_radio_ctrl_impl::get_output_samp_rate(size_t /* port */) +{ + return EISCAT_RADIO_RATE; +} + +UHD_RFNOC_BLOCK_REGISTER(eiscat_radio_ctrl, "EISCATRadio"); diff --git a/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp b/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp new file mode 100644 index 000000000..5ffdffc6a --- /dev/null +++ b/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp @@ -0,0 +1,73 @@ +// +// Copyright 2017 Ettus Research +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +#ifndef INCLUDED_LIBUHD_RFNOC_EISCAT_RADIO_CTRL_IMPL_HPP +#define INCLUDED_LIBUHD_RFNOC_EISCAT_RADIO_CTRL_IMPL_HPP + +#include "radio_ctrl_impl.hpp" +#include "uhd/types/direction.hpp" + +namespace uhd { + namespace rfnoc { + +/*! \brief Provide access to an eiscat radio. + */ +class eiscat_radio_ctrl_impl : public radio_ctrl_impl +{ +public: + typedef boost::shared_ptr sptr; + + /************************************************************************ + * Structors + ***********************************************************************/ + UHD_RFNOC_RADIO_BLOCK_CONSTRUCTOR_DECL(eiscat_radio_ctrl) + virtual ~eiscat_radio_ctrl_impl(); + + /************************************************************************ + * API calls + * Note: Tx calls are here mostly to throw errors. + ***********************************************************************/ + double set_rate(double rate); + + void set_tx_antenna(const std::string &ant, const size_t chan); + void set_rx_antenna(const std::string &ant, const size_t chan); + + double set_tx_frequency(const double freq, const size_t chan); + double set_rx_frequency(const double freq, const size_t chan); + double set_rx_bandwidth(const double bandwidth, const size_t chan); + double get_tx_frequency(const size_t chan); + + double set_tx_gain(const double gain, const size_t chan); + double set_rx_gain(const double gain, const size_t chan); + + size_t get_chan_from_dboard_fe(const std::string &fe, const uhd::direction_t dir); + std::string get_dboard_fe_from_chan(const size_t chan, const uhd::direction_t dir); + + double get_output_samp_rate(size_t port); + +private: + enum radio_connection_t { PRIMARY, SECONDARY }; + + radio_connection_t _radio_type; + std::string _radio_slot; +}; /* class radio_ctrl_impl */ + +}} /* namespace uhd::rfnoc */ + +#endif /* INCLUDED_LIBUHD_RFNOC_EISCAT_RADIO_CTRL_IMPL_HPP */ +// vim: sw=4 et: + diff --git a/host/lib/usrp/dboard/magnesium/CMakeLists.txt b/host/lib/usrp/dboard/magnesium/CMakeLists.txt new file mode 100644 index 000000000..6d3f53fba --- /dev/null +++ b/host/lib/usrp/dboard/magnesium/CMakeLists.txt @@ -0,0 +1,24 @@ +# +# Copyright 2017 Ettus Research LLC +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +IF(ENABLE_NETD) + LIST(APPEND MAGNESIUM_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/magnesium_radio_ctrl_impl.cpp + ) + LIBUHD_APPEND_SOURCES(${MAGNESIUM_SOURCES}) +ENDIF(ENABLE_NETD) + diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp new file mode 100644 index 000000000..6bac969ed --- /dev/null +++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp @@ -0,0 +1,99 @@ +// +// Copyright 2017 Ettus Research +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +#include "magnesium_radio_ctrl_impl.hpp" + +#include +#include +#include +#include +#include +#include +#include + +using namespace uhd; +using namespace uhd::usrp; +using namespace uhd::rfnoc; + +static const size_t IO_MASTER_RADIO = 0; + +UHD_RFNOC_RADIO_BLOCK_CONSTRUCTOR(magnesium_radio_ctrl) +{ + std::cout << "magnesium_radio_ctrl_impl::ctor() " << std::endl; +} + +magnesium_radio_ctrl_impl::~magnesium_radio_ctrl_impl() +{ +} + + +double magnesium_radio_ctrl_impl::set_rate(double rate) +{ +} + +void magnesium_radio_ctrl_impl::set_tx_antenna(const std::string &ant, const size_t chan) +{ +} + +void magnesium_radio_ctrl_impl::set_rx_antenna(const std::string &ant, const size_t chan) +{ +} + +double magnesium_radio_ctrl_impl::set_tx_frequency(const double freq, const size_t chan) +{ +} + +double magnesium_radio_ctrl_impl::set_rx_frequency(const double freq, const size_t chan) +{ +} + +double magnesium_radio_ctrl_impl::set_rx_bandwidth(const double bandwidth, const size_t chan) +{ +} + +double magnesium_radio_ctrl_impl::get_tx_frequency(const size_t chan) +{ +} + +double magnesium_radio_ctrl_impl::get_rx_frequency(const size_t chan) +{ +} + +double magnesium_radio_ctrl_impl::get_rx_bandwidth(const size_t chan) +{ +} + +double magnesium_radio_ctrl_impl::set_tx_gain(const double gain, const size_t chan) +{ +} + +double magnesium_radio_ctrl_impl::set_rx_gain(const double gain, const size_t chan) +{ +} + +size_t magnesium_radio_ctrl_impl::get_chan_from_dboard_fe(const std::string &fe, const direction_t dir) +{ +} + +std::string magnesium_radio_ctrl_impl::get_dboard_fe_from_chan(const size_t chan, const direction_t dir) { +} + +double magnesium_radio_ctrl_impl::get_output_samp_rate(size_t port) +{ +} + +UHD_RFNOC_BLOCK_REGISTER(magnesium_radio_ctrl, "MagnesiumRadio"); diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp new file mode 100644 index 000000000..ea8282532 --- /dev/null +++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp @@ -0,0 +1,72 @@ +// +// Copyright 2017 Ettus Research +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +#ifndef INCLUDED_LIBUHD_RFNOC_MAGNESIUM_RADIO_CTRL_IMPL_HPP +#define INCLUDED_LIBUHD_RFNOC_MAGNESIUM_RADIO_CTRL_IMPL_HPP + +#include "radio_ctrl_impl.hpp" +#include +#include + +namespace uhd { + namespace rfnoc { + +/*! \brief Provide access to an Magnesium radio. + */ +class magnesium_radio_ctrl_impl : public radio_ctrl_impl +{ +public: + typedef boost::shared_ptr sptr; + + /************************************************************************ + * Structors + ***********************************************************************/ + UHD_RFNOC_RADIO_BLOCK_CONSTRUCTOR_DECL(magnesium_radio_ctrl) + virtual ~magnesium_radio_ctrl_impl(); + + /************************************************************************ + * API calls + ***********************************************************************/ + double set_rate(double rate); + + void set_tx_antenna(const std::string &ant, const size_t chan); + void set_rx_antenna(const std::string &ant, const size_t chan); + + double set_tx_frequency(const double freq, const size_t chan); + double set_rx_frequency(const double freq, const size_t chan); + double set_rx_bandwidth(const double bandwidth, const size_t chan); + double get_tx_frequency(const size_t chan); + double get_rx_frequency(const size_t chan); + double get_rx_bandwidth(const size_t chan); + + double set_tx_gain(const double gain, const size_t chan); + double set_rx_gain(const double gain, const size_t chan); + + size_t get_chan_from_dboard_fe(const std::string &fe, const direction_t dir); + std::string get_dboard_fe_from_chan(const size_t chan, const direction_t dir); + + double get_output_samp_rate(size_t port); + + + +}; /* class radio_ctrl_impl */ + +}} /* namespace uhd::rfnoc */ + +#endif /* INCLUDED_LIBUHD_RFNOC_MAGNESIUM_RADIO_CTRL_IMPL_HPP */ +// vim: sw=4 et: + diff --git a/host/lib/usrp/magnesium/CMakeLists.txt b/host/lib/usrp/magnesium/CMakeLists.txt deleted file mode 100644 index 6d3f53fba..000000000 --- a/host/lib/usrp/magnesium/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright 2017 Ettus Research LLC -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -IF(ENABLE_NETD) - LIST(APPEND MAGNESIUM_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/magnesium_radio_ctrl_impl.cpp - ) - LIBUHD_APPEND_SOURCES(${MAGNESIUM_SOURCES}) -ENDIF(ENABLE_NETD) - diff --git a/host/lib/usrp/magnesium/magnesium_radio_ctrl_impl.cpp b/host/lib/usrp/magnesium/magnesium_radio_ctrl_impl.cpp deleted file mode 100644 index 6bac969ed..000000000 --- a/host/lib/usrp/magnesium/magnesium_radio_ctrl_impl.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// -// Copyright 2017 Ettus Research -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#include "magnesium_radio_ctrl_impl.hpp" - -#include -#include -#include -#include -#include -#include -#include - -using namespace uhd; -using namespace uhd::usrp; -using namespace uhd::rfnoc; - -static const size_t IO_MASTER_RADIO = 0; - -UHD_RFNOC_RADIO_BLOCK_CONSTRUCTOR(magnesium_radio_ctrl) -{ - std::cout << "magnesium_radio_ctrl_impl::ctor() " << std::endl; -} - -magnesium_radio_ctrl_impl::~magnesium_radio_ctrl_impl() -{ -} - - -double magnesium_radio_ctrl_impl::set_rate(double rate) -{ -} - -void magnesium_radio_ctrl_impl::set_tx_antenna(const std::string &ant, const size_t chan) -{ -} - -void magnesium_radio_ctrl_impl::set_rx_antenna(const std::string &ant, const size_t chan) -{ -} - -double magnesium_radio_ctrl_impl::set_tx_frequency(const double freq, const size_t chan) -{ -} - -double magnesium_radio_ctrl_impl::set_rx_frequency(const double freq, const size_t chan) -{ -} - -double magnesium_radio_ctrl_impl::set_rx_bandwidth(const double bandwidth, const size_t chan) -{ -} - -double magnesium_radio_ctrl_impl::get_tx_frequency(const size_t chan) -{ -} - -double magnesium_radio_ctrl_impl::get_rx_frequency(const size_t chan) -{ -} - -double magnesium_radio_ctrl_impl::get_rx_bandwidth(const size_t chan) -{ -} - -double magnesium_radio_ctrl_impl::set_tx_gain(const double gain, const size_t chan) -{ -} - -double magnesium_radio_ctrl_impl::set_rx_gain(const double gain, const size_t chan) -{ -} - -size_t magnesium_radio_ctrl_impl::get_chan_from_dboard_fe(const std::string &fe, const direction_t dir) -{ -} - -std::string magnesium_radio_ctrl_impl::get_dboard_fe_from_chan(const size_t chan, const direction_t dir) { -} - -double magnesium_radio_ctrl_impl::get_output_samp_rate(size_t port) -{ -} - -UHD_RFNOC_BLOCK_REGISTER(magnesium_radio_ctrl, "MagnesiumRadio"); diff --git a/host/lib/usrp/magnesium/magnesium_radio_ctrl_impl.hpp b/host/lib/usrp/magnesium/magnesium_radio_ctrl_impl.hpp deleted file mode 100644 index ea8282532..000000000 --- a/host/lib/usrp/magnesium/magnesium_radio_ctrl_impl.hpp +++ /dev/null @@ -1,72 +0,0 @@ -// -// Copyright 2017 Ettus Research -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#ifndef INCLUDED_LIBUHD_RFNOC_MAGNESIUM_RADIO_CTRL_IMPL_HPP -#define INCLUDED_LIBUHD_RFNOC_MAGNESIUM_RADIO_CTRL_IMPL_HPP - -#include "radio_ctrl_impl.hpp" -#include -#include - -namespace uhd { - namespace rfnoc { - -/*! \brief Provide access to an Magnesium radio. - */ -class magnesium_radio_ctrl_impl : public radio_ctrl_impl -{ -public: - typedef boost::shared_ptr sptr; - - /************************************************************************ - * Structors - ***********************************************************************/ - UHD_RFNOC_RADIO_BLOCK_CONSTRUCTOR_DECL(magnesium_radio_ctrl) - virtual ~magnesium_radio_ctrl_impl(); - - /************************************************************************ - * API calls - ***********************************************************************/ - double set_rate(double rate); - - void set_tx_antenna(const std::string &ant, const size_t chan); - void set_rx_antenna(const std::string &ant, const size_t chan); - - double set_tx_frequency(const double freq, const size_t chan); - double set_rx_frequency(const double freq, const size_t chan); - double set_rx_bandwidth(const double bandwidth, const size_t chan); - double get_tx_frequency(const size_t chan); - double get_rx_frequency(const size_t chan); - double get_rx_bandwidth(const size_t chan); - - double set_tx_gain(const double gain, const size_t chan); - double set_rx_gain(const double gain, const size_t chan); - - size_t get_chan_from_dboard_fe(const std::string &fe, const direction_t dir); - std::string get_dboard_fe_from_chan(const size_t chan, const direction_t dir); - - double get_output_samp_rate(size_t port); - - - -}; /* class radio_ctrl_impl */ - -}} /* namespace uhd::rfnoc */ - -#endif /* INCLUDED_LIBUHD_RFNOC_MAGNESIUM_RADIO_CTRL_IMPL_HPP */ -// vim: sw=4 et: - diff --git a/host/lib/usrp/netd/netd_impl.cpp b/host/lib/usrp/netd/netd_impl.cpp index 5a8b3e59c..557ebff4a 100644 --- a/host/lib/usrp/netd/netd_impl.cpp +++ b/host/lib/usrp/netd/netd_impl.cpp @@ -106,15 +106,15 @@ netd_impl::netd_impl(const device_addr_t& device_addr) : try { enumerate_rfnoc_blocks( 0, - 1, + 3, /* num blocks */ 3, /* base port */ uhd::sid_t(0x0200), device_addr ); - } catch (...) { - printf("%s Derp\n", __func__); + } catch (const std::exception &ex) { + UHD_HERE(); + std::cout << ex.what() << std::endl; } - } netd_impl::~netd_impl() {} -- cgit v1.2.3