mirror of
https://github.com/EttusResearch/uhd.git
synced 2026-10-25 17:36:10 +00:00
rfnoc: Add CHDR width to make args
This provides every block controller with a copy of its CHDR width. Note: mock blocks always get configured with a 64-bit CHDR width, to retain API compatibility.
This commit is contained in:
parent
bccc2b49ab
commit
09839fa232
@ -12,6 +12,7 @@
|
||||
#include <uhd/rfnoc/defaults.hpp>
|
||||
#include <uhd/rfnoc/node.hpp>
|
||||
#include <uhd/rfnoc/register_iface_holder.hpp>
|
||||
#include <uhd/rfnoc/rfnoc_types.hpp>
|
||||
#include <uhd/types/device_addr.hpp>
|
||||
|
||||
//! Shorthand for block constructor
|
||||
@ -306,6 +307,9 @@ private:
|
||||
//! The actual MTU value
|
||||
std::unordered_map<res_source_info, size_t> _mtu;
|
||||
|
||||
//! CHDR width of this block
|
||||
chdr_w_t _chdr_w;
|
||||
|
||||
//! Reference to the ctrlport clock_iface object shared with the register_iface
|
||||
std::shared_ptr<clock_iface> _ctrlport_clock_iface;
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
#include <uhd/property_tree.hpp>
|
||||
#include <uhd/rfnoc/noc_block_base.hpp>
|
||||
#include <uhd/rfnoc/register_iface.hpp>
|
||||
#include <uhd/rfnoc/rfnoc_types.hpp>
|
||||
|
||||
namespace uhd { namespace rfnoc {
|
||||
|
||||
@ -36,9 +37,12 @@ struct noc_block_base::make_args_t
|
||||
//! Number of output ports (gets reported from the FPGA)
|
||||
size_t num_output_ports;
|
||||
|
||||
//! Value of the MTU register
|
||||
//! Value of the MTU register, converted to bytes
|
||||
size_t mtu;
|
||||
|
||||
//! CHDR width of this block
|
||||
chdr_w_t chdr_w;
|
||||
|
||||
//! Register interface to this block's register space
|
||||
register_iface::sptr reg_iface;
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
|
||||
#include <uhd/property_tree.hpp>
|
||||
#include <uhd/rfnoc/defaults.hpp>
|
||||
#include <uhd/rfnoc/rfnoc_types.hpp>
|
||||
#include <uhd/rfnoc/mock_block.hpp>
|
||||
#include <uhd/types/device_addr.hpp>
|
||||
#include <uhdlib/rfnoc/clock_iface.hpp>
|
||||
@ -36,6 +37,7 @@ uhd::rfnoc::mock_block_container uhd::rfnoc::get_mock_block(const noc_id_t noc_i
|
||||
ret_val.make_args->num_input_ports = num_inputs;
|
||||
ret_val.make_args->num_output_ports = num_outputs;
|
||||
ret_val.make_args->mtu = mtu;
|
||||
ret_val.make_args->chdr_w = CHDR_W_64;
|
||||
ret_val.make_args->reg_iface = ret_val.reg_iface;
|
||||
ret_val.make_args->tree = ret_val.tree;
|
||||
ret_val.make_args->args = args;
|
||||
|
||||
@ -23,6 +23,7 @@ noc_block_base::noc_block_base(make_args_ptr make_args)
|
||||
, _block_id(make_args->block_id)
|
||||
, _num_input_ports(make_args->num_input_ports)
|
||||
, _num_output_ports(make_args->num_output_ports)
|
||||
, _chdr_w(make_args->chdr_w)
|
||||
, _ctrlport_clock_iface(make_args->ctrlport_clk_iface)
|
||||
, _tb_clock_iface(make_args->tb_clk_iface)
|
||||
, _mb_controller(std::move(make_args->mb_control))
|
||||
|
||||
@ -718,6 +718,7 @@ private:
|
||||
make_args_uptr->num_output_ports = block_info.num_outputs;
|
||||
make_args_uptr->mtu =
|
||||
(1 << block_info.data_mtu) * chdr_w_to_bits(mb.get_chdr_w()) / 8;
|
||||
make_args_uptr->chdr_w = mb.get_chdr_w();
|
||||
make_args_uptr->reg_iface = block_reg_iface;
|
||||
make_args_uptr->tb_clk_iface = tb_clk_iface;
|
||||
make_args_uptr->ctrlport_clk_iface = ctrlport_clk_iface;
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
#include "rfnoc_graph_mock_nodes.hpp"
|
||||
#include <uhd/rfnoc/mock_block.hpp>
|
||||
#include <uhd/rfnoc/noc_block_base.hpp>
|
||||
#include <uhd/rfnoc/rfnoc_types.hpp>
|
||||
#include <uhd/utils/log.hpp>
|
||||
#include <uhdlib/rfnoc/clock_iface.hpp>
|
||||
#include <uhdlib/rfnoc/graph.hpp>
|
||||
@ -258,6 +259,7 @@ BOOST_AUTO_TEST_CASE(test_mtu_forwarding_policy_restrictions)
|
||||
mbc.make_args->num_input_ports = 2;
|
||||
mbc.make_args->num_output_ports = 2;
|
||||
mbc.make_args->mtu = 8000;
|
||||
mbc.make_args->chdr_w = uhd::rfnoc::CHDR_W_64;
|
||||
mbc.make_args->reg_iface = mbc.reg_iface;
|
||||
mbc.make_args->tree = mbc.tree;
|
||||
mbc.make_args->tb_clk_iface =
|
||||
|
||||
Loading…
Reference in New Issue
Block a user