diff options
author | Josh Blum <josh@joshknows.com> | 2010-07-07 18:32:44 +0000 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-07-07 18:32:44 +0000 |
commit | ed29bc87996972ee7257b9e186f125efe5b0294b (patch) | |
tree | 342d4c9c815b1bd08eeddc55d94f50942ac5034e | |
parent | aff6a7146145a9cf9398a06d519775fae91d1930 (diff) | |
parent | c48f029971a879b367e8876351b4795d90346208 (diff) | |
download | uhd-ed29bc87996972ee7257b9e186f125efe5b0294b.tar.gz uhd-ed29bc87996972ee7257b9e186f125efe5b0294b.tar.bz2 uhd-ed29bc87996972ee7257b9e186f125efe5b0294b.zip |
Merge branch 'master' of ettus.sourcerepo.com:ettus/uhdpriv into usrp_e_wip
-rw-r--r-- | host/examples/benchmark_rx_rate.cpp | 17 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_regs.hpp | 5 |
2 files changed, 13 insertions, 9 deletions
diff --git a/host/examples/benchmark_rx_rate.cpp b/host/examples/benchmark_rx_rate.cpp index a913261eb..7b512e56e 100644 --- a/host/examples/benchmark_rx_rate.cpp +++ b/host/examples/benchmark_rx_rate.cpp @@ -104,6 +104,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ //variables to be set by po std::string args; double duration; + double only_rate; //setup the program options po::options_description desc("Allowed options"); @@ -111,6 +112,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ ("help", "help message") ("args", po::value<std::string>(&args)->default_value(""), "simple uhd device address args") ("duration", po::value<double>(&duration)->default_value(10.0), "duration for each test in seconds") + ("rate", po::value<double>(&only_rate), "specify to perform a single test as this rate (sps)") ; po::variables_map vm; po::store(po::parse_command_line(argc, argv, desc), vm); @@ -128,12 +130,19 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ uhd::usrp::simple_usrp::sptr sdev = uhd::usrp::simple_usrp::make(args); std::cout << boost::format("Using Device: %s") % sdev->get_pp_string() << std::endl; - sdev->set_rx_rate(500e3); //initial rate - while(true){ + if (not vm.count("rate")){ + sdev->set_rx_rate(500e3); //initial rate + while(true){ + double rate = sdev->get_rx_rate(); + test_device(sdev, rate, duration); + sdev->set_rx_rate(rate*2); //double the rate + if (sdev->get_rx_rate() == rate) break; + } + } + else{ + sdev->set_rx_rate(only_rate); double rate = sdev->get_rx_rate(); test_device(sdev, rate, duration); - sdev->set_rx_rate(rate*2); //double the rate - if (sdev->get_rx_rate() == rate) break; } //finished diff --git a/host/lib/usrp/usrp2/usrp2_regs.hpp b/host/lib/usrp/usrp2/usrp2_regs.hpp index c859d3603..1a5864c85 100644 --- a/host/lib/usrp/usrp2/usrp2_regs.hpp +++ b/host/lib/usrp/usrp2/usrp2_regs.hpp @@ -241,9 +241,4 @@ #define U2_REG_RX_CTRL_NSAMPS_PER_PKT _SR_ADDR(SR_RX_CTRL + 7) #define U2_REG_RX_CTRL_NCHANNELS _SR_ADDR(SR_RX_CTRL + 8) // 1 in basic case, up to 4 for vector sources -//helpful macros for dealing with stream cmd -#define U2_REG_RX_CTRL_MAX_SAMPS_PER_CMD 0x1fffffff -#define U2_REG_RX_CTRL_MAKE_CMD(nsamples, now, chain, reload) \ - ((((now) & 0x1) << 31) | (((chain) & 0x1) << 30) | (((reload) & 0x1) << 29) | ((nsamples) & 0x1fffffff)) - #endif /* INCLUDED_USRP2_REGS_HPP */ |