USRP Hardware Driver and USRP Manual Version: 3.15.0.0-MacPorts-Release
UHD and USRP Manual
 
Loading...
Searching...
No Matches
constants.hpp
Go to the documentation of this file.
1//
2// Copyright 2014 Ettus Research LLC
3// Copyright 2018 Ettus Research, a National Instruments Company
4//
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
7
8#ifndef INCLUDED_LIBUHD_RFNOC_CONSTANTS_HPP
9#define INCLUDED_LIBUHD_RFNOC_CONSTANTS_HPP
10
11#include <uhd/types/dict.hpp>
12#include <stdint.h>
13#include <boost/assign/list_of.hpp>
14#include <string>
15
16namespace uhd { namespace rfnoc {
17
18// All these configure the XML reader
20static const std::string XML_DEFAULT_PATH = "share/uhd/rfnoc";
22static const std::string XML_PATH_ENV = "UHD_RFNOC_DIR";
23
25static const std::string DEFAULT_BLOCK_NAME = "Block";
26static const uint64_t DEFAULT_NOC_ID = 0xFFFFFFFFFFFFFFFF;
27static const size_t NOC_SHELL_COMPAT_MAJOR = 6;
28static const size_t NOC_SHELL_COMPAT_MINOR = 0;
29
30static const size_t MAX_PACKET_SIZE = 8000; // bytes
31static const size_t DEFAULT_PACKET_SIZE = 1456; // bytes
32
33// One line in FPGA is 64 Bits
34static const size_t BYTES_PER_LINE = 8;
35
37static const size_t DEFAULT_FC_XBAR_RESPONSE_FREQ = 8;
39static const size_t DEFAULT_FC_RX_RESPONSE_FREQ = 64; // ACKs per flow control window
41static const size_t DEFAULT_FC_TX_RESPONSE_FREQ = 8; // ACKs per flow control window
43// Why not 100% full? Because we need to have some headroom to account for the inaccuracy
44// when computing the window size. We compute the flow control window based on the frame
45// size but the buffer can have overhead due to things like UDP headers, page alignment,
46// housekeeping info, etc. This number has to be transport agnostic so 20% of headroom is
47// safe.
48static const double DEFAULT_FC_RX_SW_BUFF_FULL_FACTOR = 0.80;
49
50// Common settings registers.
51static const uint32_t SR_FLOW_CTRL_BYTES_PER_ACK = 1;
52static const uint32_t SR_FLOW_CTRL_WINDOW_SIZE = 2;
53static const uint32_t SR_FLOW_CTRL_EN = 3;
54static const uint32_t SR_ERROR_POLICY = 4;
55static const uint32_t SR_BLOCK_SID = 5; // TODO rename to SRC_SID
56static const uint32_t SR_NEXT_DST_SID = 6;
57static const uint32_t SR_RESP_IN_DST_SID = 7;
58static const uint32_t SR_RESP_OUT_DST_SID = 8;
59static const uint32_t SR_FLOW_CTRL_PKT_LIMIT = 9;
60
61static const uint32_t SR_READBACK_ADDR = 124;
62static const uint32_t SR_READBACK = 127;
63
64static const uint32_t SR_CLEAR_RX_FC = 125;
65static const uint32_t SR_CLEAR_TX_FC = 126;
66
77
78// AXI stream configuration bus (output master bus of axi wrapper) registers
79static const uint32_t AXI_WRAPPER_BASE = 128;
80static const uint32_t AXIS_CONFIG_BUS =
81 AXI_WRAPPER_BASE + 1; // tdata with tvalid asserted
82static const uint32_t AXIS_CONFIG_BUS_TLAST =
83 AXI_WRAPPER_BASE + 2; // tdata with tvalid & tlast asserted
84
85static const size_t CMD_FIFO_SIZE = 256; // Lines == multiples of 8 bytes
86static const size_t MAX_CMD_PKT_SIZE = 3; // Lines == multiples of 8 bytes
87
88// Named settings registers
89static const uhd::dict<std::string, uint32_t> DEFAULT_NAMED_SR =
90 boost::assign::map_list_of("AXIS_CONFIG_BUS", AXIS_CONFIG_BUS)(
91 "AXIS_CONFIG_BUS_TLAST", AXIS_CONFIG_BUS_TLAST);
92
93// Blocks
94static const size_t MAX_NUM_BLOCKS = 16;
95
96// Block ports
97static const size_t ANY_PORT = size_t(~0);
98static const size_t MAX_NUM_PORTS = 16;
99
100// Regular expressions
101static const std::string VALID_BLOCKNAME_REGEX = "[A-Za-z][A-Za-z0-9]*";
102static const std::string VALID_BLOCKID_REGEX =
103 "(?:(\\d+)(?:/))?([A-Za-z][A-Za-z0-9]*)(?:(?:_)(\\d\\d?))?";
104
105}} /* namespace uhd::rfnoc */
106
107#endif /* INCLUDED_LIBUHD_RFNOC_CONSTANTS_HPP */
Definition dict.hpp:22
settingsbus_reg_t
Settings register readback.
Definition constants.hpp:68
@ SR_READBACK_REG_MTU
Definition constants.hpp:72
@ SR_READBACK_REG_BLOCKPORT_SIDS
Definition constants.hpp:73
@ SR_READBACK_REG_ID
Definition constants.hpp:69
@ SR_READBACK_COMPAT
Definition constants.hpp:75
@ SR_READBACK_REG_FIFOSIZE
Definition constants.hpp:71
@ SR_READBACK_REG_USER
Definition constants.hpp:74
@ SR_READBACK_REG_GLOBAL_PARAMS
Definition constants.hpp:70
Definition build_info.hpp:13