From 1bca847406dc4829fd6cfe0ba8bc49b83d25e1ee Mon Sep 17 00:00:00 2001 From: Ashish Chaudhari Date: Fri, 27 Jun 2014 10:50:51 -0700 Subject: x300: Bugfix for overflows on PCIe at 200MS/s --- host/lib/usrp/x300/x300_impl.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'host/lib/usrp/x300/x300_impl.hpp') diff --git a/host/lib/usrp/x300/x300_impl.hpp b/host/lib/usrp/x300/x300_impl.hpp index 80f3e8faa..27f20fbd9 100644 --- a/host/lib/usrp/x300/x300_impl.hpp +++ b/host/lib/usrp/x300/x300_impl.hpp @@ -63,7 +63,11 @@ static const size_t X300_RX_SW_BUFF_SIZE_ETH_MACOS = 0x100000; //1Mib static const double X300_RX_SW_BUFF_FULL_FACTOR = 0.90; //Buffer should ideally be 90% full. static const size_t X300_RX_FC_REQUEST_FREQ = 32; //per flow-control window -static const size_t X300_PCIE_DATA_FRAME_SIZE = 8192; //bytes +//The FIFO closest to the DMA controller is 1023 elements deep for RX and 1029 elements deep for TX +//where an element is 8 bytes. For best throughput ensure that the data frame fits in these buffers. +//Also ensure that the kernel has enough frames to hold buffered TX and RX data +static const size_t X300_PCIE_RX_DATA_FRAME_SIZE = 8184; //bytes +static const size_t X300_PCIE_TX_DATA_FRAME_SIZE = 8192; //bytes static const size_t X300_PCIE_DATA_NUM_FRAMES = 2048; static const size_t X300_PCIE_MSG_FRAME_SIZE = 256; //bytes static const size_t X300_PCIE_MSG_NUM_FRAMES = 32; -- cgit v1.2.3 From 42b47cea158d3a767a87ff4da71a00b3243e14f1 Mon Sep 17 00:00:00 2001 From: Ian Buckley Date: Mon, 16 Jun 2014 16:50:08 -0700 Subject: X300: Added UHD support for TX FE --- host/lib/usrp/x300/x300_impl.cpp | 13 ++++++++++++- host/lib/usrp/x300/x300_impl.hpp | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'host/lib/usrp/x300/x300_impl.hpp') diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index a624ebf6b..0c19e7b39 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -1077,11 +1077,17 @@ void x300_impl::setup_radio(const size_t mb_i, const std::string &slot_name) this->update_atr_leds(mb.radio_perifs[radio_index].leds, ""); //init anyway, even if never called //bind frontend corrections to the dboard freq props + const fs_path db_tx_fe_path = db_path / "tx_frontends"; + BOOST_FOREACH(const std::string &name, _tree->list(db_tx_fe_path)) + { + _tree->access(db_tx_fe_path / name / "freq" / "value") + .subscribe(boost::bind(&x300_impl::set_tx_fe_corrections, this, mb_path, slot_name, _1)); + } const fs_path db_rx_fe_path = db_path / "rx_frontends"; BOOST_FOREACH(const std::string &name, _tree->list(db_rx_fe_path)) { _tree->access(db_rx_fe_path / name / "freq" / "value") - .subscribe(boost::bind(&x300_impl::set_rx_fe_corrections, this, mb_path, slot_name, _1)); + .subscribe(boost::bind(&x300_impl::set_rx_fe_corrections, this, mb_path, slot_name, _1)); } } @@ -1090,6 +1096,11 @@ void x300_impl::set_rx_fe_corrections(const uhd::fs_path &mb_path, const std::st apply_rx_fe_corrections(this->get_tree()->subtree(mb_path), fe_name, lo_freq); } +void x300_impl::set_tx_fe_corrections(const uhd::fs_path &mb_path, const std::string &fe_name, const double lo_freq) +{ + apply_tx_fe_corrections(this->get_tree()->subtree(mb_path), fe_name, lo_freq); +} + boost::uint32_t get_pcie_dma_channel(boost::uint8_t destination, boost::uint8_t prefix) { static const boost::uint32_t RADIO_GRP_SIZE = 3; diff --git a/host/lib/usrp/x300/x300_impl.hpp b/host/lib/usrp/x300/x300_impl.hpp index 27f20fbd9..4108afbb0 100644 --- a/host/lib/usrp/x300/x300_impl.hpp +++ b/host/lib/usrp/x300/x300_impl.hpp @@ -321,6 +321,8 @@ private: uhd::dict _dboard_ifaces; void set_rx_fe_corrections(const uhd::fs_path &mb_path, const std::string &fe_name, const double lo_freq); + void set_tx_fe_corrections(const uhd::fs_path &mb_path, const std::string &fe_name, const double lo_freq); + /*! Update the IQ MUX settings for the radio peripheral according to given subdev spec. * -- cgit v1.2.3 From eafae66c030aa86e9da127de4f6d5ec4fd641c59 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Fri, 25 Jul 2014 09:44:07 -0700 Subject: tx fe corrections: fixing mixed tabs / spaces, other horrible whitespace cruft --- host/lib/usrp/x300/x300_impl.cpp | 23 ++++++++++------------- host/lib/usrp/x300/x300_impl.hpp | 2 +- 2 files changed, 11 insertions(+), 14 deletions(-) (limited to 'host/lib/usrp/x300/x300_impl.hpp') diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index 28d5b49ee..31db04673 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -1079,16 +1079,14 @@ void x300_impl::setup_radio(const size_t mb_i, const std::string &slot_name) //bind frontend corrections to the dboard freq props const fs_path db_tx_fe_path = db_path / "tx_frontends"; - BOOST_FOREACH(const std::string &name, _tree->list(db_tx_fe_path)) - { - _tree->access(db_tx_fe_path / name / "freq" / "value") - .subscribe(boost::bind(&x300_impl::set_tx_fe_corrections, this, mb_path, slot_name, _1)); - } + BOOST_FOREACH(const std::string &name, _tree->list(db_tx_fe_path)) { + _tree->access(db_tx_fe_path / name / "freq" / "value") + .subscribe(boost::bind(&x300_impl::set_tx_fe_corrections, this, mb_path, slot_name, _1)); + } const fs_path db_rx_fe_path = db_path / "rx_frontends"; - BOOST_FOREACH(const std::string &name, _tree->list(db_rx_fe_path)) - { + BOOST_FOREACH(const std::string &name, _tree->list(db_rx_fe_path)) { _tree->access(db_rx_fe_path / name / "freq" / "value") - .subscribe(boost::bind(&x300_impl::set_rx_fe_corrections, this, mb_path, slot_name, _1)); + .subscribe(boost::bind(&x300_impl::set_rx_fe_corrections, this, mb_path, slot_name, _1)); } } @@ -1118,8 +1116,7 @@ x300_impl::both_xports_t x300_impl::make_transport( const boost::uint8_t& destination, const boost::uint8_t& prefix, const uhd::device_addr_t& args, - boost::uint32_t& sid -) + boost::uint32_t& sid) { mboard_members_t &mb = _mb[mb_index]; both_xports_t xports; @@ -1216,10 +1213,10 @@ x300_impl::both_xports_t x300_impl::make_transport( << std::endl; } - size_t system_max_send_frame_size = (size_t) _max_frame_sizes.send_frame_size; - size_t system_max_recv_frame_size = (size_t) _max_frame_sizes.recv_frame_size; + size_t system_max_send_frame_size = (size_t) _max_frame_sizes.send_frame_size; + size_t system_max_recv_frame_size = (size_t) _max_frame_sizes.recv_frame_size; - // Make sure frame sizes do not exceed the max available value supported by UHD + // Make sure frame sizes do not exceed the max available value supported by UHD default_buff_args.send_frame_size = (prefix == X300_RADIO_DEST_PREFIX_TX) ? std::min(system_max_send_frame_size, X300_10GE_DATA_FRAME_MAX_SIZE) diff --git a/host/lib/usrp/x300/x300_impl.hpp b/host/lib/usrp/x300/x300_impl.hpp index 4108afbb0..578e96383 100644 --- a/host/lib/usrp/x300/x300_impl.hpp +++ b/host/lib/usrp/x300/x300_impl.hpp @@ -211,7 +211,7 @@ private: //perifs in each radio radio_perifs_t radio_perifs[2]; //!< This is hardcoded s.t. radio_perifs[0] points to slot A and [1] to B uhd::usrp::dboard_eeprom_t db_eeproms[8]; - //! Return the index of a radio component, given a slot name. This means DSPs, radio_perifs + //! Return the index of a radio component, given a slot name. This means DSPs, radio_perifs size_t get_radio_index(const std::string &slot_name) { UHD_ASSERT_THROW(slot_name == "A" or slot_name == "B"); return slot_name == "A" ? 0 : 1; -- cgit v1.2.3