|
| 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_t * | get_mtu_prop_ref (const res_source_info &edge) |
|
std::shared_ptr< mb_controller > | get_mb_controller () |
|
virtual void | deinit () |
|
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 () |
|
void | update_reg_iface (register_iface::sptr new_iface=nullptr) |
|
The primary interface to a NoC block in the FPGA
The block supports three types of data access:
- Low-level register access
- High-level property access
- Action execution
The main difference between this class and its parent is the direct access to registers, and the NoC&block IDs.
virtual void uhd::rfnoc::noc_block_base::deinit |
( |
| ) |
|
|
protectedvirtual |
Safely de-initialize the block
This function is called by the framework when the RFNoC session is about to finish to allow blocks to safely perform actions to shut down a block. For example, if your block is producing samples, like a radio or signal generator, this is a good place to issue a "stop" command.
After this function is called, register access is no more possible. So make sure not to interact with regs() after this was called. Future access to regs() won't throw, but will print error messages and do nothing.
The rationale for having this separate from the destructor is because rfnoc_graph allows exporting references to blocks, and this function ensures that blocks are safely shut down when the rest of the device control goes away.
std::shared_ptr< mb_controller > uhd::rfnoc::noc_block_base::get_mb_controller |
( |
| ) |
|
|
protected |
Get access to the motherboard controller for this block's motherboard
This will return a nullptr if this block doesn't have access to the motherboard. In order to gain access to the motherboard, the block needs to have requested access to the motherboard during the registration procedure. See also registry.hpp.
Even if this block requested access to the motherboard controller, there is no guarantee that UHD will honour that request. It is therefore important to verify that the returned pointer is valid.
Return the current MTU on a given edge
The MTU is determined by the block itself (i.e., how big of a packet can this block handle on this edge), but also the neighboring block, and possibly the transport medium between the blocks. This value can thus be lower than what the block defines as MTU, but never higher.
- Parameters
-
edge | The edge on which the MTU is queried. edge.type must be INPUT_EDGE or OUTPUT_EDGE! |
- Returns
- the MTU as determined by the overall graph on this edge
- Exceptions
-
Change the way MTUs are forwarded
The policy will have the following effect:
- DROP: This means that the MTU of one port has no bearing on the MTU of another port. This is usually a valid choice if the FPGA is repacking data, for example, a block could be consuming continous streams of data, and producing small packets of a different type.
- ONE_TO_ONE: This means the MTU is passed through from input to output and vice versa. This is typically a good choice if packets are being passed through without modifying their size. The DDC/DUC blocks will choose this policy, because the want to relay MTU information to the radio.
- ONE_TO_ALL: This means the MTU is being set to the same value on all ports.
- ONE_TO_FAN: This means the MTU is forwarded from any input port to all opposite side ports. This is an appropriate policy for the split-stream block.
The default policy is DROP.
Note: The MTU forwarding policy can only be set ONCE per instance of a noc_block_base. If an RFNoC block subclassing noc_block_base wants to modify the MTU forwarding policy, it would typically call this function in its constructor. Once set, however, the MTU forwarding policy cannot be changed. This represents a change in behaviour from UHD 4.0. Violations of this restriction will result in a uhd::runtime_error being thrown.