aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include/uhdlib/utils/compat_check.hpp
blob: 8fe96d1188a0d9c2fc03f35f2244be2d79b342cf (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
42
43
//
// Copyright 2018 Ettus Research, a National Instruments Company
//
// SPDX-License-Identifier: GPL-3.0-or-later
//

#ifndef INCLUDED_UHDLIB_UTILS_COMPATCHECK_HPP
#define INCLUDED_UHDLIB_UTILS_COMPATCHECK_HPP

#include <cstddef>
#include <string>

namespace uhd {

    /*! Checks for FPGA compatibility, and throws an exception on mismatch.
     *
     * \throws uhd::runtime_error on mismatch.
     */
    void assert_fpga_compat(
        const size_t uhd_major,
        const size_t uhd_minor,
        const uint64_t fpga_compat,
        const std::string& fpga_component,
        const std::string& log_component,
        const bool fail_on_minor_behind=false
    );

    /*! Checks for FPGA compatibility, and throws an exception on mismatch.
     *
     * \throws uhd::runtime_error on mismatch.
     */
    void assert_fpga_compat(
        const size_t uhd_major,
        const size_t uhd_minor,
        const uint32_t fpga_compat,
        const std::string& fpga_component,
        const std::string& log_component,
        const bool fail_on_minor_behind=false
    );

} /* namespace uhd */

#endif /* INCLUDED_UHDLIB_UTILS_COMPATCHECK_HPP */