USRP Hardware Driver and USRP Manual Version: 4.1.0.3
UHD and USRP Manual
uhd::rfnoc::keep_one_in_n_block_control Class Referenceabstract

#include <uhd/rfnoc/keep_one_in_n_block_control.hpp>

Inheritance diagram for uhd::rfnoc::keep_one_in_n_block_control:
uhd::rfnoc::noc_block_base uhd::rfnoc::node_t uhd::rfnoc::register_iface_holder

Public Types

enum class  mode { SAMPLE_MODE , PACKET_MODE }
 
- Public Types inherited from uhd::rfnoc::noc_block_base
using sptr = std::shared_ptr< noc_block_base >
 
using make_args_ptr = std::unique_ptr< make_args_t >
 Opaque pointer to the constructor arguments. More...
 
- Public Types inherited from uhd::rfnoc::node_t
enum class  forwarding_policy_t {
  ONE_TO_ONE , ONE_TO_FAN , ONE_TO_ALL_IN , ONE_TO_ALL_OUT ,
  ONE_TO_ALL , DROP , USE_MAP
}
 Types of property/action forwarding for those not defined by the block itself. More...
 
using resolver_fn_t = std::function< void(void)>
 
using resolve_callback_t = std::function< void(void)>
 
using action_handler_t = std::function< void(const res_source_info &, action_info::sptr)>
 
using forwarding_map_t = std::unordered_map< res_source_info, std::vector< res_source_info > >
 

Public Member Functions

virtual size_t get_max_n () const =0
 
virtual size_t get_n (const size_t chan=0) const =0
 
virtual void set_n (const size_t n, const size_t chan=0)=0
 
virtual mode get_mode (const size_t chan=0) const =0
 
virtual void set_mode (const mode mode, const size_t chan=0)=0
 
- Public Member Functions inherited from uhd::rfnoc::noc_block_base
 ~noc_block_base () override
 
std::string get_unique_id () const override
 Unique ID for an RFNoC block is its block ID. More...
 
size_t get_num_input_ports () const override
 Number of input ports. Note: This gets passed into this block from the. More...
 
size_t get_num_output_ports () const override
 Number of output ports. Note: This gets passed outto this block from the. More...
 
noc_id_t get_noc_id () const
 
const block_id_tget_block_id () const
 
double get_tick_rate () const
 
size_t get_mtu (const res_source_info &edge)
 
uhd::device_addr_t get_block_args () const
 
uhd::property_tree::sptrget_tree () const
 Return a reference to this block's subtree. More...
 
uhd::property_tree::sptrget_tree ()
 Return a reference to this block's subtree (non-const version) More...
 
- Public Member Functions inherited from uhd::rfnoc::node_t
 node_t ()
 
virtual ~node_t ()
 
virtual std::string get_unique_id () const
 Return a unique identifier string for this node. In every RFNoC graph,. More...
 
virtual size_t get_num_input_ports () const =0
 
virtual size_t get_num_output_ports () const =0
 
std::vector< std::string > get_property_ids () const
 
template<typename prop_data_t >
void set_property (const std::string &id, const prop_data_t &val, const size_t instance=0)
 
void set_properties (const uhd::device_addr_t &props, const size_t instance=0)
 
template<typename prop_data_t >
const prop_data_t & get_property (const std::string &id, const size_t instance=0)
 
virtual void set_command_time (uhd::time_spec_t time, const size_t instance)
 
virtual uhd::time_spec_t get_command_time (const size_t instance) const
 
virtual void clear_command_time (const size_t instance)
 
- Public Member Functions inherited from uhd::rfnoc::register_iface_holder
 register_iface_holder (register_iface::sptr reg)
 
virtual ~register_iface_holder ()=default
 
register_ifaceregs ()
 

Static Public Attributes

static const uint32_t REG_N_OFFSET
 
static const uint32_t REG_MODE_OFFSET
 
static const uint32_t REG_WIDTH_N_OFFSET
 
- Static Public Attributes inherited from uhd::rfnoc::node_t
static const size_t ANY_PORT = size_t(~0)
 

Additional Inherited Members

- Protected Types inherited from uhd::rfnoc::node_t
using prop_ptrs_t = std::unordered_set< property_base_t * >
 
- Protected Member Functions inherited from uhd::rfnoc::noc_block_base
 noc_block_base (make_args_ptr make_args)
 
void set_num_input_ports (const size_t num_ports)
 Update number of input ports. More...
 
void set_num_output_ports (const size_t num_ports)
 Update number of output ports. More...
 
void set_tick_rate (const double tick_rate)
 
void set_mtu_forwarding_policy (const forwarding_policy_t policy)
 
void set_mtu (const res_source_info &edge, const size_t new_mtu)
 
property_base_tget_mtu_prop_ref (const res_source_info &edge)
 
std::shared_ptr< mb_controllerget_mb_controller ()
 
virtual void deinit ()
 
- Protected Member Functions inherited from uhd::rfnoc::node_t
void register_property (property_base_t *prop, resolve_callback_t &&clean_callback=nullptr)
 
void add_property_resolver (prop_ptrs_t &&inputs, prop_ptrs_t &&outputs, resolver_fn_t &&resolver_fn)
 
void set_prop_forwarding_policy (forwarding_policy_t policy, const std::string &prop_id="")
 
void set_prop_forwarding_map (const forwarding_map_t &map)
 
template<typename prop_data_t >
void set_property (const std::string &id, const prop_data_t &val, const res_source_info &src_info)
 
template<typename prop_data_t >
const prop_data_t & get_property (const std::string &id, const res_source_info &src_info)
 
void register_action_handler (const std::string &id, action_handler_t &&handler)
 
void set_action_forwarding_policy (forwarding_policy_t policy, const std::string &action_key="")
 
void set_action_forwarding_map (const forwarding_map_t &map)
 
void post_action (const res_source_info &edge_info, action_info::sptr action)
 
virtual bool check_topology (const std::vector< size_t > &connected_inputs, const std::vector< size_t > &connected_outputs)
 
virtual void shutdown ()
 
- Protected Member Functions inherited from uhd::rfnoc::register_iface_holder
void update_reg_iface (register_iface::sptr new_iface=nullptr)
 
- Static Protected Attributes inherited from uhd::rfnoc::node_t
static dirtifier_t ALWAYS_DIRTY
 A dirtifyer object, useful for properties that always need updating. More...
 

Detailed Description

Keep One in N Block Control Class

The Keep One in N block has two modes: sample mode and packet mode. In sample mode, the first sample is kept and then N-1 samples are dropped. Packet mode is similar to sample mode, except a packet of samples is kept and then N-1 packets are dropped. The packet size is determined automatically.

Member Enumeration Documentation

◆ mode

Enumerator
SAMPLE_MODE 
PACKET_MODE 

Member Function Documentation

◆ get_max_n()

virtual size_t uhd::rfnoc::keep_one_in_n_block_control::get_max_n ( ) const
pure virtual

Get the maximum supported value for N

Get the maximum supported value for N for all channels

Returns
The maximum supported value for N

◆ get_mode()

virtual mode uhd::rfnoc::keep_one_in_n_block_control::get_mode ( const size_t  chan = 0) const
pure virtual

Get the current mode

Get the current mode (sample or packet mode, see mode enum)

Parameters
chanThe block channel
Returns
The current mode

◆ get_n()

virtual size_t uhd::rfnoc::keep_one_in_n_block_control::get_n ( const size_t  chan = 0) const
pure virtual

Get the current value of N

Get the current value of N

Parameters
chanThe block channel
Returns
The current value of N

◆ set_mode()

virtual void uhd::rfnoc::keep_one_in_n_block_control::set_mode ( const mode  mode,
const size_t  chan = 0 
)
pure virtual

Set the mode

Set the mode. There are two modes, sample mode (0) and packet mode (1). In sample mode, the block will keep 1 value and then drop N-1 values. In packet mode, the block will keep 1 packet and then drop N-1 packets.

Parameters
modeThe mode of the block
chanThe block channel

◆ set_n()

virtual void uhd::rfnoc::keep_one_in_n_block_control::set_n ( const size_t  n,
const size_t  chan = 0 
)
pure virtual

Set the value of N

Set the value of N. See set_mode() for how the value of N is interpreted depending on the mode.

Parameters
nThe number of samples or packets to drop (minus one)
chanThe block channel

Member Data Documentation

◆ REG_MODE_OFFSET

const uint32_t uhd::rfnoc::keep_one_in_n_block_control::REG_MODE_OFFSET
static

◆ REG_N_OFFSET

const uint32_t uhd::rfnoc::keep_one_in_n_block_control::REG_N_OFFSET
static

◆ REG_WIDTH_N_OFFSET

const uint32_t uhd::rfnoc::keep_one_in_n_block_control::REG_WIDTH_N_OFFSET
static

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