USRP Hardware Driver and USRP Manual  Version: 3.15.0.HEAD-0-g6563c537
UHD and USRP Manual
uhd::rfnoc::source_block_ctrl_base Class Reference

#include <uhd/rfnoc/source_block_ctrl_base.hpp>

Inheritance diagram for uhd::rfnoc::source_block_ctrl_base:
uhd::rfnoc::block_ctrl_base uhd::rfnoc::source_node_ctrl uhd::rfnoc::node_ctrl_base uhd::rfnoc::node_ctrl_base uhd::rfnoc::block_ctrl uhd::rfnoc::ddc_block_ctrl uhd::rfnoc::dma_fifo_block_ctrl uhd::rfnoc::duc_block_ctrl uhd::rfnoc::fir_block_ctrl uhd::rfnoc::null_block_ctrl uhd::rfnoc::radio_ctrl uhd::rfnoc::replay_block_ctrl uhd::rfnoc::siggen_block_ctrl uhd::rfnoc::window_block_ctrl

Public Types

typedef boost::shared_ptr< source_block_ctrl_basesptr
 
- Public Types inherited from uhd::rfnoc::block_ctrl_base
typedef boost::shared_ptr< block_ctrl_basesptr
 
typedef boost::function< sptr(const make_args_t &)> make_t
 
- Public Types inherited from uhd::rfnoc::node_ctrl_base
typedef boost::shared_ptr< node_ctrl_basesptr
 
typedef boost::weak_ptr< node_ctrl_basewptr
 
typedef std::map< size_t, wptrnode_map_t
 
typedef std::pair< size_t, wptrnode_map_pair_t
 
- Public Types inherited from uhd::rfnoc::source_node_ctrl
typedef boost::shared_ptr< source_node_ctrlsptr
 
typedef std::map< size_t, boost::weak_ptr< source_node_ctrl > > node_map_t
 
typedef std::pair< size_t, boost::weak_ptr< source_node_ctrl > > node_map_pair_t
 

Public Member Functions

virtual void issue_stream_cmd (const uhd::stream_cmd_t &stream_cmd, const size_t chan=0)
 
stream_sig_t get_output_signature (size_t block_port=0) const
 
std::vector< size_t > get_output_ports () const
 
virtual void set_destination (uint32_t next_address, size_t output_block_port=0)
 
virtual void configure_flow_control_out (const bool enable_output, const bool lossless_link, const size_t buf_size_bytes, const size_t pkt_limit=0, const size_t block_port=0, const uhd::sid_t &sid=uhd::sid_t())
 
size_t get_mtu (size_t block_port=0) const
 
- Public Member Functions inherited from uhd::rfnoc::block_ctrl_base
uint32_t get_address (size_t block_port=0)
 
block_id_t get_block_id () const
 
std::string unique_id () const
 
std::vector< size_t > get_ctrl_ports () const
 
void sr_write (const uint32_t reg, const uint32_t data, const size_t port=0)
 
void sr_write (const std::string &reg, const uint32_t data, const size_t port=0)
 
uint64_t sr_read64 (const settingsbus_reg_t reg, const size_t port=0)
 
uint32_t sr_read32 (const settingsbus_reg_t reg, const size_t port=0)
 
uint64_t user_reg_read64 (const uint32_t addr, const size_t port=0)
 
uint64_t user_reg_read64 (const std::string &reg, const size_t port=0)
 
uint32_t user_reg_read32 (const uint32_t addr, const size_t port=0)
 
uint32_t user_reg_read32 (const std::string &reg, const size_t port=0)
 
void set_command_time (const time_spec_t &time_spec, const size_t port=ANY_PORT)
 
time_spec_t get_command_time (const size_t port=0)
 
void set_command_tick_rate (const double tick_rate, const size_t port=ANY_PORT)
 
void clear_command_time (const size_t port)
 
void clear ()
 
void set_args (const uhd::device_addr_t &args, const size_t port=0)
 
void set_arg (const std::string &key, const std::string &val, const size_t port=0)
 Set a specific block argument. val is converted to the corresponding. More...
 
template<typename T >
void set_arg (const std::string &key, const T &val, const size_t port=0)
 Direct access to set a block argument. More...
 
uhd::device_addr_t get_args (const size_t port=0) const
 Return all block arguments as a device_addr_t. More...
 
std::string get_arg (const std::string &key, const size_t port=0) const
 Return a single block argument in string format. More...
 
template<typename T >
get_arg (const std::string &key, const size_t port=0) const
 Direct access to get a block argument. More...
 
std::string get_arg_type (const std::string &key, const size_t port=0) const
 
- Public Member Functions inherited from uhd::rfnoc::node_ctrl_base
node_map_t list_downstream_nodes ()
 
node_map_t list_upstream_nodes ()
 
void disconnect ()
 
void disconnect_output_port (const size_t output_port)
 
void disconnect_input_port (const size_t input_port)
 
void set_downstream_port (const size_t this_port, const size_t remote_port)
 
size_t get_downstream_port (const size_t this_port)
 
void set_upstream_port (const size_t this_port, const size_t remote_port)
 
size_t get_upstream_port (const size_t this_port)
 
template<typename T >
UHD_INLINE std::vector< boost::shared_ptr< T > > find_downstream_node (bool active_only=false)
 
template<typename T >
UHD_INLINE std::vector< boost::shared_ptr< T > > find_upstream_node (bool active_only=false)
 
template<typename T , typename value_type >
UHD_INLINE value_type find_downstream_unique_property (boost::function< value_type(boost::shared_ptr< T > node, size_t port)> get_property, value_type null_value, const std::set< boost::shared_ptr< T > > &exclude_nodes=std::set< boost::shared_ptr< T > >())
 
template<typename T , typename value_type >
UHD_INLINE value_type find_upstream_unique_property (boost::function< value_type(boost::shared_ptr< T > node, size_t port)> get_property, value_type null_value, const std::set< boost::shared_ptr< T > > &exclude_nodes=std::set< boost::shared_ptr< T > >())
 
- Public Member Functions inherited from uhd::rfnoc::source_node_ctrl
size_t connect_downstream (node_ctrl_base::sptr downstream_node, size_t port=ANY_PORT, const uhd::device_addr_t &args=uhd::device_addr_t())
 
virtual void set_rx_streamer (bool active, const size_t port)
 

Protected Member Functions

virtual size_t _request_output_port (const size_t suggested_port, const uhd::device_addr_t &args) const
 
- Protected Member Functions inherited from uhd::rfnoc::block_ctrl_base
 block_ctrl_base (void)
 
virtual ~block_ctrl_base ()
 
 block_ctrl_base (const make_args_t &make_args)
 
stream_sig_t _resolve_port_def (const blockdef::port_t &port_def) const
 
uhd::fs_path get_arg_path (const std::string &key, size_t port=0) const
 Return the property tree path to a block argument key on port. More...
 
timed_wb_iface::sptr get_ctrl_iface (const size_t block_port)
 Get a control interface object for block port block_port. More...
 
virtual void _clear (const size_t port=0)
 Override this function if your block does something else. More...
 
virtual void _set_command_time (const time_spec_t &time_spec, const size_t port=ANY_PORT)
 Override this function if your block needs to specially handle. More...
 
- Protected Member Functions inherited from uhd::rfnoc::node_ctrl_base
 node_ctrl_base (void)
 
virtual ~node_ctrl_base ()
 
virtual void _register_upstream_node (node_ctrl_base::sptr upstream_node, size_t port)
 

Additional Inherited Members

- Static Public Member Functions inherited from uhd::rfnoc::block_ctrl_base
static void register_block (const make_t &make, const std::string &name)
 
static sptr make (const make_args_t &make_args, uint64_t noc_id=~0)
 Create a block controller class given a NoC-ID or a block name. More...
 
- Protected Attributes inherited from uhd::rfnoc::block_ctrl_base
uhd::property_tree::sptr _tree
 Property sub-tree. More...
 
uhd::fs_path _root_path
 Root node of this block's properties. More...
 
blockdef::sptr _block_def
 Block definition (stores info about the block such as ports) More...
 
- Protected Attributes inherited from uhd::rfnoc::node_ctrl_base
uhd::device_addr_t _args
 Stores default arguments. More...
 
node_map_t _upstream_nodes
 List of upstream nodes. More...
 
node_map_t _downstream_nodes
 List of downstream nodes. More...
 
size_t _num_input_ports
 
size_t _num_output_ports
 
std::map< size_t, bool > _rx_streamer_active
 
std::map< size_t, bool > _tx_streamer_active
 

Member Typedef Documentation

◆ sptr

Member Function Documentation

◆ _request_output_port()

virtual size_t uhd::rfnoc::source_block_ctrl_base::_request_output_port ( const size_t  suggested_port,
const uhd::device_addr_t args 
) const
protectedvirtual

Like source_node_ctrl::_request_output_port(), but also checks if the port has an output signature.

Reimplemented from uhd::rfnoc::source_node_ctrl.

◆ configure_flow_control_out()

virtual void uhd::rfnoc::source_block_ctrl_base::configure_flow_control_out ( const bool  enable_output,
const bool  lossless_link,
const size_t  buf_size_bytes,
const size_t  pkt_limit = 0,
const size_t  block_port = 0,
const uhd::sid_t sid = uhd::sid_t() 
)
virtual

Configure flow control for outgoing streams.

In the default implementation, this just sets registers SR_FLOW_CTRL_BUF_SIZE and SR_FLOW_CTRL_ENABLE accordingly; block_port and sid are ignored.

Override this function if your block has port-specific flow control settings.

Parameters
enable_outputEnable flow control module's output. If disabled, no packets will be output regardless of flow control state.
buf_size_bytesThe size of the downstream block's input FIFO size in number of bytes. Setting this to zero disables byte based flow control. If both byte based flow control and the packet limit are set to zero, the block will then produce data as fast as it can. Warning: This can cause head-of-line blocking, and potentially lock up your device!
lossless_linkThe link for the connection is lossless. Periodic sync packets will be disabled.
pkt_limitLimit the maximum number of packets in flight. Setting this to zero disables packet limiting. Usually kept disabled except for special case connections (such as DMA) that support only a finite number of packets in flight.
block_portSpecify on which outgoing port this setting is valid.
sidThe SID for which this is valid. This is meant for cases where the outgoing block port is not sufficient to set the flow control, and as such is rarely used.

◆ get_mtu()

size_t uhd::rfnoc::source_block_ctrl_base::get_mtu ( size_t  block_port = 0) const

Return the MTU size on a given block port.

This is necessary for setting up transports, among other things.

If the block port is not defined, it will return 0, and not throw.

Parameters
block_portThe block port (0 through 15).

Returns the MTU in bytes.

◆ get_output_ports()

std::vector<size_t> uhd::rfnoc::source_block_ctrl_base::get_output_ports ( ) const

Return a list of valid output ports.

◆ get_output_signature()

stream_sig_t uhd::rfnoc::source_block_ctrl_base::get_output_signature ( size_t  block_port = 0) const

Return the output stream signature for a given block port.

The actual signature is determined by the current configuration and the block definition file. The value returned here is calculated on-the-fly and is only valid as long as the configuration does not change.

Returns
The stream signature for port block_port
Exceptions
uhd::runtime_errorif block_port is not a valid port

◆ issue_stream_cmd()

virtual void uhd::rfnoc::source_block_ctrl_base::issue_stream_cmd ( const uhd::stream_cmd_t stream_cmd,
const size_t  chan = 0 
)
virtual

Issue a stream command for this block.

There is no guaranteed action for this command. The default implementation is to send this command to the next upstream block, or issue a warning if there is no upstream block registered.

However, implementations of block_ctrl_base might choose to do whatever seems appropriate, including throwing exceptions. This may also be true for some stream commands and not for others (i.e. STREAM_MODE_START_CONTINUOUS may be implemented, and STREAM_MODE_NUM_SAMPS_AND_DONE may be not).

This function does not check for infinite loops. Example: Say you have two blocks, which are both registered as upstream from one another. If they both use block_ctrl_base::issue_stream_cmd(), then the stream command will be passed from one block to another indefinitely. This will not happen if one the block's controller classes overrides this function and actually handles it.

See also register_upstream_block().

Parameters
stream_cmdThe stream command.
chanChannel for which this command is meant (data shall be produced on this channel).

Implements uhd::rfnoc::source_node_ctrl.

◆ set_destination()

virtual void uhd::rfnoc::source_block_ctrl_base::set_destination ( uint32_t  next_address,
size_t  output_block_port = 0 
)
virtual

Configures data flowing from port output_block_port to go to next_address

Parameters
next_addressAddress of the downstream block
output_block_portPort for which this is valid

In the default implementation, this will write the value in next_address to register SR_NEXT_DST of this blocks settings bus. The value will also have bit 16 set to 1, since some blocks require this to respect this value.


The documentation for this class was generated from the following file: