From 49520bfecb5e13126224ee915208c2cd936f911c Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 1 Nov 2016 16:45:29 -0700 Subject: rfnoc: ctrl_iface cleanup - ctrl_iface is now longer a wb_iface. All it can do now is send command packets, and receive responses to those. - ctrl_iface does not store command time or tick rate - wb_iface_adapter is no longer a set of functors, but a wrapper around ctrl_iface. Command times are stored once, in the block. - DMA FIFO and radio block controllers have an easier time getting access to a timed_wb_iface --- host/include/uhd/rfnoc/block_ctrl_base.hpp | 17 +++++++++++------ host/include/uhd/rfnoc/constants.hpp | 2 ++ 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'host/include') diff --git a/host/include/uhd/rfnoc/block_ctrl_base.hpp b/host/include/uhd/rfnoc/block_ctrl_base.hpp index 25b1e4a09..70725627a 100644 --- a/host/include/uhd/rfnoc/block_ctrl_base.hpp +++ b/host/include/uhd/rfnoc/block_ctrl_base.hpp @@ -24,8 +24,9 @@ namespace uhd { namespace rfnoc { + // Forward declarations + class ctrl_iface; namespace nocscript { - // Forward declaration class block_iface; } @@ -39,8 +40,8 @@ struct make_args_t block_key(key) {} - //! A valid interface that allows us to do peeks and pokes - std::map ctrl_ifaces; + //! A valid interface that allows us to read and write registers + std::map > ctrl_ifaces; //! This block's base address (address of block port 0) uint32_t base_address; //! The device index (or motherboard index). @@ -359,8 +360,7 @@ protected: }; //! Get a control interface object for block port \p block_port - wb_iface::sptr get_ctrl_iface(const size_t block_port); - + timed_wb_iface::sptr get_ctrl_iface(const size_t block_port); /*********************************************************************** * Hooks & Derivables @@ -397,11 +397,16 @@ private: //! Helper function to initialize the block args (used by ctor only) void _init_block_args(); + //! Helper to create a lambda to read tick rate + double get_command_tick_rate(const size_t port); + /*********************************************************************** * Private members **********************************************************************/ //! Objects to actually send and receive the commands - std::map _ctrl_ifaces; + std::map > _ctrl_ifaces; + std::map _cmd_timespecs; + std::map _cmd_tickrates; //! The base address of this block (the address of block port 0) uint32_t _base_address; diff --git a/host/include/uhd/rfnoc/constants.hpp b/host/include/uhd/rfnoc/constants.hpp index 53514c157..94cca3e7a 100644 --- a/host/include/uhd/rfnoc/constants.hpp +++ b/host/include/uhd/rfnoc/constants.hpp @@ -80,6 +80,8 @@ static const uint32_t AXI_WRAPPER_BASE = 128; static const uint32_t AXIS_CONFIG_BUS = AXI_WRAPPER_BASE+1; // tdata with tvalid asserted static const uint32_t AXIS_CONFIG_BUS_TLAST = AXI_WRAPPER_BASE+2; // tdata with tvalid & tlast asserted +static const size_t CMD_FIFO_SIZE = 128; // Lines == multiples of 8 bytes + // Named settings registers static const uhd::dict DEFAULT_NAMED_SR = boost::assign::map_list_of ("AXIS_CONFIG_BUS", AXIS_CONFIG_BUS) -- cgit v1.2.3