aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/b100/io_impl.cpp3
-rw-r--r--host/lib/usrp/cores/rx_dsp_core_200.cpp1
-rw-r--r--host/lib/usrp/cores/tx_dsp_core_200.cpp11
-rw-r--r--host/lib/usrp/e100/io_impl.cpp3
-rw-r--r--host/lib/usrp/usrp2/io_impl.cpp19
5 files changed, 24 insertions, 13 deletions
diff --git a/host/lib/usrp/b100/io_impl.cpp b/host/lib/usrp/b100/io_impl.cpp
index ccd00a91f..feafd3e4a 100644
--- a/host/lib/usrp/b100/io_impl.cpp
+++ b/host/lib/usrp/b100/io_impl.cpp
@@ -229,6 +229,7 @@ rx_streamer::sptr b100_impl::get_rx_stream(const uhd::stream_args_t &args_){
for (size_t chan_i = 0; chan_i < args.channels.size(); chan_i++){
const size_t dsp = args.channels[chan_i];
_rx_dsps[dsp]->set_nsamps_per_packet(spp); //seems to be a good place to set this
+ if (not args.args.has_key("noclear")) _rx_dsps[dsp]->clear();
_rx_dsps[dsp]->set_format(args.otw_format, sc8_scalar);
my_streamer->set_xport_chan_get_buff(chan_i, boost::bind(
&recv_packet_demuxer::get_recv_buff, _io_impl->demuxer, dsp, _1
@@ -286,7 +287,7 @@ tx_streamer::sptr b100_impl::get_tx_stream(const uhd::stream_args_t &args_){
for (size_t chan_i = 0; chan_i < args.channels.size(); chan_i++){
const size_t dsp = args.channels[chan_i];
UHD_ASSERT_THROW(dsp == 0); //always 0
- _tx_dsp->clear();
+ if (not args.args.has_key("noclear")) _tx_dsp->clear();
my_streamer->set_xport_chan_get_buff(chan_i, boost::bind(
&zero_copy_if::get_send_buff, _data_transport, _1
));
diff --git a/host/lib/usrp/cores/rx_dsp_core_200.cpp b/host/lib/usrp/cores/rx_dsp_core_200.cpp
index 7c9fe0695..481260e32 100644
--- a/host/lib/usrp/cores/rx_dsp_core_200.cpp
+++ b/host/lib/usrp/cores/rx_dsp_core_200.cpp
@@ -84,7 +84,6 @@ public:
}
void set_nsamps_per_packet(const size_t nsamps){
- this->clear(); // a good place to clear as well!
_iface->poke32(REG_RX_CTRL_NSAMPS_PP, nsamps);
}
diff --git a/host/lib/usrp/cores/tx_dsp_core_200.cpp b/host/lib/usrp/cores/tx_dsp_core_200.cpp
index 38d04a7de..4e1a3e44d 100644
--- a/host/lib/usrp/cores/tx_dsp_core_200.cpp
+++ b/host/lib/usrp/cores/tx_dsp_core_200.cpp
@@ -56,17 +56,17 @@ public:
const size_t dsp_base, const size_t ctrl_base,
const boost::uint32_t sid
):
- _iface(iface), _dsp_base(dsp_base), _ctrl_base(ctrl_base)
+ _iface(iface), _dsp_base(dsp_base), _ctrl_base(ctrl_base), _sid(sid)
{
//init the tx control registers
- _iface->poke32(REG_TX_CTRL_CLEAR_STATE, 1); //reset
- _iface->poke32(REG_TX_CTRL_NUM_CHAN, 0); //1 channel
- _iface->poke32(REG_TX_CTRL_REPORT_SID, sid);
- _iface->poke32(REG_TX_CTRL_POLICY, FLAG_TX_CTRL_POLICY_NEXT_PACKET);
+ this->clear();
}
void clear(void){
_iface->poke32(REG_TX_CTRL_CLEAR_STATE, 1); //reset
+ _iface->poke32(REG_TX_CTRL_NUM_CHAN, 0); //1 channel
+ _iface->poke32(REG_TX_CTRL_REPORT_SID, _sid);
+ _iface->poke32(REG_TX_CTRL_POLICY, FLAG_TX_CTRL_POLICY_NEXT_PACKET);
}
void set_tick_rate(const double rate){
@@ -150,6 +150,7 @@ private:
wb_iface::sptr _iface;
const size_t _dsp_base, _ctrl_base;
double _tick_rate, _link_rate;
+ const boost::uint32_t _sid;
};
tx_dsp_core_200::sptr tx_dsp_core_200::make(wb_iface::sptr iface, const size_t dsp_base, const size_t ctrl_base, const boost::uint32_t sid){
diff --git a/host/lib/usrp/e100/io_impl.cpp b/host/lib/usrp/e100/io_impl.cpp
index 855fda0d7..dc090ad28 100644
--- a/host/lib/usrp/e100/io_impl.cpp
+++ b/host/lib/usrp/e100/io_impl.cpp
@@ -305,6 +305,7 @@ rx_streamer::sptr e100_impl::get_rx_stream(const uhd::stream_args_t &args_){
for (size_t chan_i = 0; chan_i < args.channels.size(); chan_i++){
const size_t dsp = args.channels[chan_i];
_rx_dsps[dsp]->set_nsamps_per_packet(spp); //seems to be a good place to set this
+ if (not args.args.has_key("noclear")) _rx_dsps[dsp]->clear();
_rx_dsps[dsp]->set_format(args.otw_format, sc8_scalar);
my_streamer->set_xport_chan_get_buff(chan_i, boost::bind(
&recv_packet_demuxer::get_recv_buff, _io_impl->demuxer, dsp, _1
@@ -362,7 +363,7 @@ tx_streamer::sptr e100_impl::get_tx_stream(const uhd::stream_args_t &args_){
for (size_t chan_i = 0; chan_i < args.channels.size(); chan_i++){
const size_t dsp = args.channels[chan_i];
UHD_ASSERT_THROW(dsp == 0); //always 0
- _tx_dsp->clear();
+ if (not args.args.has_key("noclear")) _tx_dsp->clear();
my_streamer->set_xport_chan_get_buff(chan_i, boost::bind(
&zero_copy_if::get_send_buff, _data_transport, _1
));
diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp
index 742fe3e94..f3a00c119 100644
--- a/host/lib/usrp/usrp2/io_impl.cpp
+++ b/host/lib/usrp/usrp2/io_impl.cpp
@@ -70,11 +70,15 @@ public:
* Make a new flow control monitor.
* \param max_seqs_out num seqs before throttling
*/
- flow_control_monitor(seq_type max_seqs_out){
+ flow_control_monitor(seq_type max_seqs_out):_max_seqs_out(max_seqs_out){
+ this->clear();
+ _ready_fcn = boost::bind(&flow_control_monitor::ready, this);
+ }
+
+ //! Clear the monitor, Ex: when a streamer is created
+ void clear(void){
_last_seq_out = 0;
_last_seq_ack = 0;
- _max_seqs_out = max_seqs_out;
- _ready_fcn = boost::bind(&flow_control_monitor::ready, this);
}
/*!
@@ -116,7 +120,8 @@ private:
boost::mutex _fc_mutex;
boost::condition _fc_cond;
- seq_type _last_seq_out, _last_seq_ack, _max_seqs_out;
+ seq_type _last_seq_out, _last_seq_ack;
+ const seq_type _max_seqs_out;
boost::function<bool(void)> _ready_fcn;
};
@@ -407,6 +412,7 @@ rx_streamer::sptr usrp2_impl::get_rx_stream(const uhd::stream_args_t &args_){
if (chan < num_chan_so_far){
const size_t dsp = chan + _mbc[mb].rx_chan_occ - num_chan_so_far;
_mbc[mb].rx_dsps[dsp]->set_nsamps_per_packet(spp); //seems to be a good place to set this
+ if (not args.args.has_key("noclear")) _mbc[mb].rx_dsps[dsp]->clear();
_mbc[mb].rx_dsps[dsp]->set_format(args.otw_format, sc8_scalar);
my_streamer->set_xport_chan_get_buff(chan_i, boost::bind(
&zero_copy_if::get_recv_buff, _mbc[mb].rx_dsp_xports[dsp], _1
@@ -474,7 +480,10 @@ tx_streamer::sptr usrp2_impl::get_tx_stream(const uhd::stream_args_t &args_){
num_chan_so_far += _mbc[mb].tx_chan_occ;
if (chan < num_chan_so_far){
const size_t dsp = chan + _mbc[mb].tx_chan_occ - num_chan_so_far;
- _mbc[mb].tx_dsp->clear();
+ if (not args.args.has_key("noclear")){
+ _mbc[mb].tx_dsp->clear();
+ _io_impl->fc_mons[abs]->clear();
+ }
my_streamer->set_xport_chan_get_buff(chan_i, boost::bind(
&usrp2_impl::io_impl::get_send_buff, _io_impl.get(), abs, _1
));