aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include/uhdlib/rfnoc/factory.hpp
blob: 2bd1feb09ec649f2c3aed483bd973d2cfaeada42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// Copyright 2019 Ettus Research, a National Instruments Brand
//
// SPDX-License-Identifier: GPL-3.0-or-later
//

#ifndef INCLUDED_LIBUHD_RFNOC_FACTORY_HPP
#define INCLUDED_LIBUHD_RFNOC_FACTORY_HPP

#include <uhd/rfnoc/defaults.hpp>
#include <uhd/rfnoc/noc_block_base.hpp>
#include <uhd/rfnoc/registry.hpp>

namespace uhd { namespace rfnoc {

struct block_factory_info_t
{
    std::string block_name;
    bool mb_access;
    std::string timebase_clk;
    std::string ctrlport_clk;
    registry::factory_t factory_fn;
};

/*! Container for factory functionality
 */
class factory
{
public:
    /*! Return a factory function for an RFNoC block based on the Noc-ID
     *
     * \returns a block_factory_info_t object
     * \throws uhd::lookup_error if no block is found
     */
    static block_factory_info_t get_block_factory(
        noc_id_t noc_id, device_type_t device_id);
};

}} /* namespace uhd::rfnoc */

#endif /* INCLUDED_LIBUHD_RFNOC_FACTORY_HPP */