diff options
author | Ryan Marlow <ryan.marlow@ettus.com> | 2017-09-29 11:45:46 -0400 |
---|---|---|
committer | Ashish Chaudhari <ashish@ettus.com> | 2017-09-29 15:13:10 -0700 |
commit | 1bd3db57cab62517ecf282c670f2ccd35d1d303d (patch) | |
tree | 48968bdb8351cd10473f697a07080d6290f78b1a /host/lib/usrp/cores | |
parent | 895c965f75f4a0d85143b614dd7232ce85c45307 (diff) | |
download | uhd-1bd3db57cab62517ecf282c670f2ccd35d1d303d.tar.gz uhd-1bd3db57cab62517ecf282c670f2ccd35d1d303d.tar.bz2 uhd-1bd3db57cab62517ecf282c670f2ccd35d1d303d.zip |
dram_fifo, BIST: BUS_CLK_RATE is now a readback reg.
Diffstat (limited to 'host/lib/usrp/cores')
-rw-r--r-- | host/lib/usrp/cores/dma_fifo_core_3000.cpp | 17 | ||||
-rw-r--r-- | host/lib/usrp/cores/dma_fifo_core_3000.hpp | 2 |
2 files changed, 15 insertions, 4 deletions
diff --git a/host/lib/usrp/cores/dma_fifo_core_3000.cpp b/host/lib/usrp/cores/dma_fifo_core_3000.cpp index 18c79f4c5..b80ce62d8 100644 --- a/host/lib/usrp/cores/dma_fifo_core_3000.cpp +++ b/host/lib/usrp/cores/dma_fifo_core_3000.cpp @@ -20,7 +20,7 @@ #include <boost/thread/thread.hpp> //sleep #include <uhd/utils/soft_register.hpp> #include <uhd/utils/log.hpp> - +#include <boost/format.hpp> using namespace uhd; #define SR_DRAM_BIST_BASE 16 @@ -40,6 +40,7 @@ protected: static const uint32_t RB_BIST_STATUS = 1; static const uint32_t RB_BIST_XFER_CNT = 2; static const uint32_t RB_BIST_CYC_CNT = 3; + static const uint32_t RB_BUS_CLK_RATE = 4; rb_addr_reg_t(uint32_t base): soft_reg32_wo_t(base + 0) @@ -214,6 +215,14 @@ public: return (static_cast<double>(xfer_cnt)/cyc_cnt); } + double get_bus_clk_rate() { + uint32_t bus_clk_rate = 0; + boost::lock_guard<boost::mutex> lock(_mutex); + _addr_reg.write(rb_addr_reg_t::ADDR, rb_addr_reg_t::RB_BUS_CLK_RATE); + bus_clk_rate = _iface->peek32(_rb_addr); + return (static_cast<double>(bus_clk_rate)); + } + private: wb_iface::sptr _iface; rb_addr_reg_t _addr_reg; @@ -326,11 +335,13 @@ public: return _fifo_readback.get_bist_status().error; } - virtual double get_bist_throughput(double fifo_clock_rate) { + virtual double get_bist_throughput() { if (_has_ext_bist) { _wait_for_bist_done(1000); static const double BYTES_PER_CYC = 8; - return _fifo_readback.get_xfer_ratio() * fifo_clock_rate * BYTES_PER_CYC; + double bus_clk_rate = _fifo_readback.get_bus_clk_rate(); + UHD_LOGGER_INFO("DEBUG") << boost::format("[DMA FIFO] Clock rate for BIST calculation: %d ") % bus_clk_rate; + return _fifo_readback.get_xfer_ratio() * bus_clk_rate * BYTES_PER_CYC; } else { throw uhd::not_implemented_error( "dma_fifo_core_3000: Throughput counter only available on FPGA images with extended BIST enabled"); diff --git a/host/lib/usrp/cores/dma_fifo_core_3000.hpp b/host/lib/usrp/cores/dma_fifo_core_3000.hpp index 46a913c93..55a126f76 100644 --- a/host/lib/usrp/cores/dma_fifo_core_3000.hpp +++ b/host/lib/usrp/cores/dma_fifo_core_3000.hpp @@ -79,7 +79,7 @@ public: /*! * Get the throughput measured from the last invocation of the BIST (extended BIST only) */ - virtual double get_bist_throughput(double fifo_clock_rate) = 0; + virtual double get_bist_throughput() = 0; }; |