From 0db669b3ce4dc5ec6cd38d8d80159d9030393288 Mon Sep 17 00:00:00 2001 From: michael-west Date: Fri, 13 Jun 2014 11:58:29 -0700 Subject: Enhancement #512: B210: Need an Internal PPS - Added support for internal PPS selection (set as default) --- host/lib/usrp/b200/b200_impl.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 98141dbaa..91a3cb037 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -427,7 +427,7 @@ b200_impl::b200_impl(const device_addr_t &device_addr) //setup time source props _tree->create(mb_path / "time_source" / "value") .subscribe(boost::bind(&b200_impl::update_time_source, this, _1)); - static const std::vector time_sources = boost::assign::list_of("none")("external")("gpsdo"); + static const std::vector time_sources = boost::assign::list_of("none")("internal")("external")("gpsdo"); _tree->create >(mb_path / "time_source" / "options").set(time_sources); //setup reference source props _tree->create(mb_path / "clock_source" / "value") @@ -464,10 +464,6 @@ b200_impl::b200_impl(const device_addr_t &device_addr) _tree->access(mb_path / "rx_subdev_spec").set(rx_spec); _tree->access(mb_path / "tx_subdev_spec").set(tx_spec); - //init to internal clock and time source - _tree->access(mb_path / "clock_source/value").set("internal"); - _tree->access(mb_path / "time_source/value").set("none"); - //GPS installed: use external ref, time, and init time spec if (_gps and _gps->gps_detected()) { @@ -477,6 +473,10 @@ b200_impl::b200_impl(const device_addr_t &device_addr) UHD_MSG(status) << "Initializing time to the internal GPSDO" << std::endl; const time_t tp = time_t(_gps->get_sensor("gps_time").to_int()+1); _tree->access(mb_path / "time" / "pps").set(time_spec_t(tp)); + } else { + //init to internal clock and time source + _tree->access(mb_path / "clock_source/value").set("internal"); + _tree->access(mb_path / "time_source/value").set("internal"); } } @@ -785,11 +785,17 @@ void b200_impl::update_clock_source(const std::string &source) void b200_impl::update_time_source(const std::string &source) { - if (source == "none"){} - else if (source == "external"){} - else if (source == "gpsdo"){} + boost::uint32_t value = 0; + if (source == "none") + value = 3; + else if (source == "internal") + value = 2; + else if (source == "external") + value = 1; + else if (source == "gpsdo") + value = 0; else throw uhd::key_error("update_time_source: unknown source: " + source); - _local_ctrl->poke32(TOREG(SR_CORE_PPS_SEL), (source == "external")? 1 : 0); + _local_ctrl->poke32(TOREG(SR_CORE_PPS_SEL), value); } /*********************************************************************** -- cgit v1.2.3 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.cpp | 4 ++-- host/lib/usrp/x300/x300_impl.hpp | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index 2c291f422..a624ebf6b 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -1129,12 +1129,12 @@ x300_impl::both_xports_t x300_impl::make_transport( if (mb.xport_path == "nirio") { default_buff_args.send_frame_size = (prefix == X300_RADIO_DEST_PREFIX_TX) - ? X300_PCIE_DATA_FRAME_SIZE + ? X300_PCIE_TX_DATA_FRAME_SIZE : X300_PCIE_MSG_FRAME_SIZE; default_buff_args.recv_frame_size = (prefix == X300_RADIO_DEST_PREFIX_RX) - ? X300_PCIE_DATA_FRAME_SIZE + ? X300_PCIE_RX_DATA_FRAME_SIZE : X300_PCIE_MSG_FRAME_SIZE; default_buff_args.num_send_frames = 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 24aaac8e3f25a6d52cd11645e1f4b4533fa3d2fc Mon Sep 17 00:00:00 2001 From: michael-west Date: Tue, 1 Jul 2014 17:11:30 -0700 Subject: Fix for BUG #527: N200: 50 Msps results in two tones - Adjusted check to enable first half-band filter only if the rate is decimated enough between the CIC and other half-band filter --- host/lib/usrp/cores/rx_dsp_core_200.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/cores/rx_dsp_core_200.cpp b/host/lib/usrp/cores/rx_dsp_core_200.cpp index 2fdc220b5..2e5ca8e7a 100644 --- a/host/lib/usrp/cores/rx_dsp_core_200.cpp +++ b/host/lib/usrp/cores/rx_dsp_core_200.cpp @@ -176,7 +176,8 @@ public: //determine which half-band filters are activated int hb0 = 0, hb1 = 0; - if (decim % 2 == 0){ + // hb0 can only be enabled if the rate will be decimated by at least 2 between the CIC and hb1 + if (decim >= 4 && decim % 2 == 0){ hb0 = 1; decim /= 2; } -- cgit v1.2.3