aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorLars Amsel <lars.amsel@ni.com>2019-07-08 15:36:52 +0200
committerMartin Braun <martin.braun@ettus.com>2019-11-26 11:49:32 -0800
commit2a66eb62d89c5d18c176878ce036f0109706a9e2 (patch)
tree6715fd163aa1e7bdc55a5da5e09f67d04d3a6ed6 /host/include
parent914fbdbcb297322edd8e037cb776d29be4f58c31 (diff)
downloaduhd-2a66eb62d89c5d18c176878ce036f0109706a9e2.tar.gz
uhd-2a66eb62d89c5d18c176878ce036f0109706a9e2.tar.bz2
uhd-2a66eb62d89c5d18c176878ce036f0109706a9e2.zip
rfnoc: Introduce device-specific blocks
- Add device ID constants (e.g., E310 == 0xE310, X300 == 0xA300). These are stored in the device FPGA, and can be used for decisions later - Blocks can be specific to a device. For example, x300_radio_control can only work on an X300 series device. - Because blocks can be device-specific, all radio blocks can now share a common Noc-ID (0x12AD1000). - The registry and factory functions are modified to acommodate for this. - The motherboard access is now also factored into the same registry macro.
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/erfnoc/core/x310_bsp.yml3
-rw-r--r--host/include/uhd/rfnoc/defaults.hpp30
-rw-r--r--host/include/uhd/rfnoc/noc_block_base.hpp6
-rw-r--r--host/include/uhd/rfnoc/registry.hpp54
-rw-r--r--host/include/uhd/rfnoc_graph.hpp2
5 files changed, 57 insertions, 38 deletions
diff --git a/host/include/uhd/erfnoc/core/x310_bsp.yml b/host/include/uhd/erfnoc/core/x310_bsp.yml
index 497927a08..e63d382d8 100644
--- a/host/include/uhd/erfnoc/core/x310_bsp.yml
+++ b/host/include/uhd/erfnoc/core/x310_bsp.yml
@@ -1,5 +1,5 @@
type: x300
-type_id: DEAD
+type_id: A300
family: 7SERIES
transports:
- name: eth0
@@ -14,6 +14,7 @@ transports:
clocks:
- name: radio
+- name: ce
io_ports:
ctrlport_radio0:
diff --git a/host/include/uhd/rfnoc/defaults.hpp b/host/include/uhd/rfnoc/defaults.hpp
index 3eb9e1d30..696d31f30 100644
--- a/host/include/uhd/rfnoc/defaults.hpp
+++ b/host/include/uhd/rfnoc/defaults.hpp
@@ -39,6 +39,36 @@ static const double DEFAULT_TICK_RATE = 1.0;
// block/device-specific constraints. It will keep the frame size below 1500.
static const int DEFAULT_SPP = 1996;
+/*! The NoC ID is the unique identifier of the block type. All blocks of the
+ * same type have the same NoC ID.
+ */
+using noc_id_t = uint32_t;
+
+/*** Device Identifiers ******************************************************/
+//! Device ID Type
+using device_type_t = uint16_t;
+// first nibble for device family (E = E, N = 1, X = A), remaining three nibbles
+// for device number
+//! placeholder for unspecified device
+static const device_type_t ANY_DEVICE = 0xFFFF;
+//! E300 device family
+static const device_type_t E300 = 0xE300;
+//! E310 device
+static const device_type_t E310 = 0xE310;
+//! E320
+static const device_type_t E320 = 0xE320;
+//! N300 device family (N300, N310)
+static const device_type_t N300 = 0x1300;
+//! N320 device
+static const device_type_t N320 = 0x1320;
+//! X300 device family (X300, X310)
+static const device_type_t X300 = 0xA300;
+
+// block identifiers
+static const noc_id_t RADIO_BLOCK = 0x12AD1000;
+static const noc_id_t DUC_BLOCK = 0xD0C00000;
+static const noc_id_t DDC_BLOCK = 0xDDC00000;
+
}} // namespace uhd::rfnoc
#endif /* INCLUDED_LIBUHD_RFNOC_DEFAULTS_HPP */
diff --git a/host/include/uhd/rfnoc/noc_block_base.hpp b/host/include/uhd/rfnoc/noc_block_base.hpp
index d9659862c..485b2c8a3 100644
--- a/host/include/uhd/rfnoc/noc_block_base.hpp
+++ b/host/include/uhd/rfnoc/noc_block_base.hpp
@@ -10,6 +10,7 @@
#include <uhd/config.hpp>
#include <uhd/property_tree.hpp>
#include <uhd/rfnoc/block_id.hpp>
+#include <uhd/rfnoc/defaults.hpp>
#include <uhd/rfnoc/node.hpp>
#include <uhd/rfnoc/register_iface_holder.hpp>
#include <uhd/types/device_addr.hpp>
@@ -46,11 +47,6 @@ public:
*/
using sptr = std::shared_ptr<noc_block_base>;
- /*! The NoC ID is the unique identifier of the block type. All blocks of the
- * same type have the same NoC ID.
- */
- using noc_id_t = uint32_t;
-
//! Forward declaration for the constructor arguments
struct make_args_t;
diff --git a/host/include/uhd/rfnoc/registry.hpp b/host/include/uhd/rfnoc/registry.hpp
index 9815ce3c6..7110c3fe4 100644
--- a/host/include/uhd/rfnoc/registry.hpp
+++ b/host/include/uhd/rfnoc/registry.hpp
@@ -8,6 +8,7 @@
#define INCLUDED_LIBUHD_RFNOC_REGISTRY_HPP
#include <uhd/config.hpp>
+#include <uhd/rfnoc/defaults.hpp>
#include <uhd/rfnoc/noc_block_base.hpp>
#include <uhd/utils/static.hpp>
#include <functional>
@@ -15,8 +16,8 @@
//! This macro must be placed inside a block implementation file
// after the class definition
-#define UHD_RFNOC_BLOCK_REGISTER_DIRECT( \
- CLASS_NAME, NOC_ID, BLOCK_NAME, TB_CLOCK, CTRL_CLOCK) \
+#define UHD_RFNOC_BLOCK_REGISTER_FOR_DEVICE_DIRECT(CLASS_NAME, \
+ NOC_ID, DEVICE_ID, BLOCK_NAME, MB_ACCESS, TB_CLOCK, CTRL_CLOCK) \
uhd::rfnoc::noc_block_base::sptr CLASS_NAME##_make( \
uhd::rfnoc::noc_block_base::make_args_ptr make_args) \
{ \
@@ -24,15 +25,20 @@
} \
UHD_STATIC_BLOCK(register_rfnoc_##CLASS_NAME) \
{ \
- uhd::rfnoc::registry::register_block_direct( \
- NOC_ID, BLOCK_NAME, TB_CLOCK, CTRL_CLOCK, &CLASS_NAME##_make); \
+ uhd::rfnoc::registry::register_block_direct(NOC_ID, DEVICE_ID, \
+ BLOCK_NAME, MB_ACCESS, \
+ TB_CLOCK, CTRL_CLOCK, &CLASS_NAME##_make); \
}
-#define UHD_RFNOC_BLOCK_REQUEST_MB_ACCESS(NOC_ID) \
- UHD_STATIC_BLOCK(rfnoc_block_##NOC_ID##_request_mb_access) \
- { \
- uhd::rfnoc::registry::request_mb_access(NOC_ID); \
- }
+#define UHD_RFNOC_BLOCK_REGISTER_DIRECT( \
+ CLASS_NAME, NOC_ID, BLOCK_NAME, TB_CLOCK, CTRL_CLOCK) \
+ UHD_RFNOC_BLOCK_REGISTER_FOR_DEVICE_DIRECT(CLASS_NAME, \
+ NOC_ID, ANY_DEVICE, BLOCK_NAME, false, TB_CLOCK, CTRL_CLOCK)
+
+#define UHD_RFNOC_BLOCK_REGISTER_DIRECT_MB_ACCESS( \
+ CLASS_NAME, NOC_ID, BLOCK_NAME, TB_CLOCK, CTRL_CLOCK) \
+ UHD_RFNOC_BLOCK_REGISTER_FOR_DEVICE_DIRECT(CLASS_NAME, \
+ NOC_ID, ANY_DEVICE, BLOCK_NAME, true, TB_CLOCK, CTRL_CLOCK)
namespace uhd { namespace rfnoc {
@@ -56,13 +62,17 @@ public:
* If the Noc-ID is already registered, it will print an error to stderr and
* ignore the new block.
*
- * \param noc_id The 32-bit Noc-ID for this block (e.g. 0xDDC00000)
- * \param block_name The name used for the block ID (e.g. "Radio")
+ * \param noc_id The 32-bit Noc-ID for this block (e.g. 0xDDC00000).
+ * \param device_id The 16-bit Device-ID for this block
+ * (ANY_DEVICE for device agnostic blocks).
+ * \param block_name The name used for the block ID (e.g. "Radio").
* \param factory_fn A factory function that returns a reference to the
- * block
+ * block.
*/
- static void register_block_direct(noc_block_base::noc_id_t noc_id,
+ static void register_block_direct(noc_id_t noc_id,
+ device_type_t device_id,
const std::string& block_name,
+ bool mb_access,
const std::string& timebase_clock,
const std::string& ctrlport_clock,
factory_t factory_fn);
@@ -81,24 +91,6 @@ public:
static void register_block_descriptor(const std::string& block_key,
factory_t factory_fn);
- /*! Call this after registering a block if it requires access to the
- * mb_controller
- *
- * Note: This is a request to the framework, and may be denied.
- *
- * \param noc_id Noc-ID of the block that requires access to the mb_controller
- */
- static void request_mb_access(noc_block_base::noc_id_t noc_id);
-
- /*! Call this after registering a block if it requires access to the
- * mb_controller
- *
- * Note: This is a request to the framework, and may be denied.
- *
- * \param noc_id Noc-ID of the block that requires access to the mb_controller
- */
- static void request_mb_access(const std::string& block_key);
-
};
}} /* namespace uhd::rfnoc */
diff --git a/host/include/uhd/rfnoc_graph.hpp b/host/include/uhd/rfnoc_graph.hpp
index 08d5fc095..ff7e46aa8 100644
--- a/host/include/uhd/rfnoc_graph.hpp
+++ b/host/include/uhd/rfnoc_graph.hpp
@@ -44,7 +44,7 @@ public:
struct block_xbar_info
{
size_t xbar_port;
- noc_block_base::noc_id_t noc_id;
+ noc_id_t noc_id;
size_t inst_num;
};