diff options
author | robot-rover <sam.obrien@ni.com> | 2020-06-11 16:34:07 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-07-13 15:21:52 -0500 |
commit | 22837edfe20feb57c24f2a55edbb65757b3fab6a (patch) | |
tree | a7aed19205f2851ab8e32e52093fbbe761ac9e86 /host/lib/rfnoc | |
parent | b0cb065111dc3f40b89bdda76e9bd98f3e70b72e (diff) | |
download | uhd-22837edfe20feb57c24f2a55edbb65757b3fab6a.tar.gz uhd-22837edfe20feb57c24f2a55edbb65757b3fab6a.tar.bz2 uhd-22837edfe20feb57c24f2a55edbb65757b3fab6a.zip |
utils: Expose CHDR Types in Public API
This commit exposes uhdlib/rfnoc/chdr_types.hpp in the public includes.
Additionally, it takes some types from uhdlib/rfnoc/rfnoc_common.hpp and
exposes them publicly in uhd/rfnoc/rfnoc_types.hpp.
Finally, one constant is moved from uhdlib/rfnoc/rfnoc_common.hpp to
uhd/rfnoc/constants.hpp
Signed-off-by: robot-rover <sam.obrien@ni.com>
Diffstat (limited to 'host/lib/rfnoc')
-rw-r--r-- | host/lib/rfnoc/chdr_ctrl_endpoint.cpp | 2 | ||||
-rw-r--r-- | host/lib/rfnoc/chdr_ctrl_xport.cpp | 2 | ||||
-rw-r--r-- | host/lib/rfnoc/chdr_rx_data_xport.cpp | 2 | ||||
-rw-r--r-- | host/lib/rfnoc/chdr_tx_data_xport.cpp | 2 | ||||
-rw-r--r-- | host/lib/rfnoc/chdr_types.cpp | 20 | ||||
-rw-r--r-- | host/lib/rfnoc/ctrlport_endpoint.cpp | 2 |
6 files changed, 15 insertions, 15 deletions
diff --git a/host/lib/rfnoc/chdr_ctrl_endpoint.cpp b/host/lib/rfnoc/chdr_ctrl_endpoint.cpp index 3b2865c73..8fe6a8856 100644 --- a/host/lib/rfnoc/chdr_ctrl_endpoint.cpp +++ b/host/lib/rfnoc/chdr_ctrl_endpoint.cpp @@ -5,12 +5,12 @@ // #include <uhd/exception.hpp> +#include <uhd/rfnoc/chdr_types.hpp> #include <uhd/utils/log.hpp> #include <uhd/utils/safe_call.hpp> #include <uhd/utils/thread.hpp> #include <uhdlib/rfnoc/chdr_ctrl_endpoint.hpp> #include <uhdlib/rfnoc/chdr_packet_writer.hpp> -#include <uhdlib/rfnoc/chdr_types.hpp> #include <boost/format.hpp> #include <atomic> #include <mutex> diff --git a/host/lib/rfnoc/chdr_ctrl_xport.cpp b/host/lib/rfnoc/chdr_ctrl_xport.cpp index a59d56b30..8946a3b08 100644 --- a/host/lib/rfnoc/chdr_ctrl_xport.cpp +++ b/host/lib/rfnoc/chdr_ctrl_xport.cpp @@ -4,9 +4,9 @@ // SPDX-License-Identifier: GPL-3.0-or-later // +#include <uhd/rfnoc/chdr_types.hpp> #include <uhd/utils/log.hpp> #include <uhdlib/rfnoc/chdr_ctrl_xport.hpp> -#include <uhdlib/rfnoc/chdr_types.hpp> using namespace uhd; using namespace uhd::rfnoc; diff --git a/host/lib/rfnoc/chdr_rx_data_xport.cpp b/host/lib/rfnoc/chdr_rx_data_xport.cpp index ebfcda2b8..d4476d54f 100644 --- a/host/lib/rfnoc/chdr_rx_data_xport.cpp +++ b/host/lib/rfnoc/chdr_rx_data_xport.cpp @@ -4,8 +4,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // +#include <uhd/rfnoc/chdr_types.hpp> #include <uhdlib/rfnoc/chdr_rx_data_xport.hpp> -#include <uhdlib/rfnoc/chdr_types.hpp> #include <uhdlib/rfnoc/mgmt_portal.hpp> #include <uhdlib/rfnoc/rfnoc_common.hpp> #include <uhdlib/transport/io_service.hpp> diff --git a/host/lib/rfnoc/chdr_tx_data_xport.cpp b/host/lib/rfnoc/chdr_tx_data_xport.cpp index a51835a07..530da5a47 100644 --- a/host/lib/rfnoc/chdr_tx_data_xport.cpp +++ b/host/lib/rfnoc/chdr_tx_data_xport.cpp @@ -4,8 +4,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // +#include <uhd/rfnoc/chdr_types.hpp> #include <uhdlib/rfnoc/chdr_tx_data_xport.hpp> -#include <uhdlib/rfnoc/chdr_types.hpp> #include <uhdlib/rfnoc/mgmt_portal.hpp> #include <uhdlib/rfnoc/rfnoc_common.hpp> #include <uhdlib/transport/io_service.hpp> diff --git a/host/lib/rfnoc/chdr_types.cpp b/host/lib/rfnoc/chdr_types.cpp index cb4642f3a..3cb68ff9a 100644 --- a/host/lib/rfnoc/chdr_types.cpp +++ b/host/lib/rfnoc/chdr_types.cpp @@ -5,8 +5,8 @@ // #include <uhd/exception.hpp> +#include <uhd/rfnoc/chdr_types.hpp> #include <uhd/types/endianness.hpp> -#include <uhdlib/rfnoc/chdr_types.hpp> #include <boost/format.hpp> #include <cassert> @@ -53,16 +53,16 @@ size_t ctrl_payload::serialize(uint64_t* buff, buff[ptr++] = conv_byte_order( ((static_cast<uint64_t>(dst_port) & mask_u64(DST_PORT_WIDTH)) << DST_PORT_OFFSET) | ((static_cast<uint64_t>(src_port) & mask_u64(SRC_PORT_WIDTH)) - << SRC_PORT_OFFSET) + << SRC_PORT_OFFSET) | ((static_cast<uint64_t>(data_vtr.size()) & mask_u64(NUM_DATA_WIDTH)) - << NUM_DATA_OFFSET) + << NUM_DATA_OFFSET) | ((static_cast<uint64_t>(seq_num) & mask_u64(SEQ_NUM_WIDTH)) << SEQ_NUM_OFFSET) | ((static_cast<uint64_t>(timestamp.is_initialized() ? 1 : 0) & mask_u64(HAS_TIME_WIDTH)) - << HAS_TIME_OFFSET) + << HAS_TIME_OFFSET) | ((static_cast<uint64_t>(is_ack) & mask_u64(IS_ACK_WIDTH)) << IS_ACK_OFFSET) | ((static_cast<uint64_t>(src_epid) & mask_u64(SRC_EPID_WIDTH)) - << SRC_EPID_OFFSET)); + << SRC_EPID_OFFSET)); // Populate optional timestamp if (timestamp.is_initialized()) { @@ -73,7 +73,7 @@ size_t ctrl_payload::serialize(uint64_t* buff, buff[ptr++] = conv_byte_order( ((static_cast<uint64_t>(address) & mask_u64(ADDRESS_WIDTH)) << ADDRESS_OFFSET) | ((static_cast<uint64_t>(byte_enable) & mask_u64(BYTE_ENABLE_WIDTH)) - << BYTE_ENABLE_OFFSET) + << BYTE_ENABLE_OFFSET) | ((static_cast<uint64_t>(op_code) & mask_u64(OPCODE_WIDTH)) << OPCODE_OFFSET) | ((static_cast<uint64_t>(status) & mask_u64(STATUS_WIDTH)) << STATUS_OFFSET) | (static_cast<uint64_t>(data_vtr[0]) << HI_DATA_OFFSET)); @@ -189,14 +189,14 @@ size_t strs_payload::serialize(uint64_t* buff, ((static_cast<uint64_t>(src_epid) & mask_u64(SRC_EPID_WIDTH)) << SRC_EPID_OFFSET) | ((static_cast<uint64_t>(status) & mask_u64(STATUS_WIDTH)) << STATUS_OFFSET) | ((static_cast<uint64_t>(capacity_bytes) & mask_u64(CAPACITY_BYTES_WIDTH)) - << CAPACITY_BYTES_OFFSET)); + << CAPACITY_BYTES_OFFSET)); // Populate second word buff[1] = conv_byte_order( ((static_cast<uint64_t>(capacity_pkts) & mask_u64(CAPACITY_PKTS_WIDTH)) << CAPACITY_PKTS_OFFSET) | ((static_cast<uint64_t>(xfer_count_pkts) & mask_u64(XFER_COUNT_PKTS_WIDTH)) - << XFER_COUNT_PKTS_OFFSET)); + << XFER_COUNT_PKTS_OFFSET)); // Populate third word buff[2] = conv_byte_order(xfer_count_bytes); @@ -206,7 +206,7 @@ size_t strs_payload::serialize(uint64_t* buff, ((static_cast<uint64_t>(buff_info) & mask_u64(BUFF_INFO_WIDTH)) << BUFF_INFO_OFFSET) | ((static_cast<uint64_t>(status_info) & mask_u64(STATUS_INFO_WIDTH)) - << STATUS_INFO_OFFSET)); + << STATUS_INFO_OFFSET)); // Return bytes written return (4 * sizeof(uint64_t)); @@ -285,7 +285,7 @@ size_t strc_payload::serialize(uint64_t* buff, | ((static_cast<uint64_t>(op_code) & mask_u64(OP_CODE_WIDTH)) << OP_CODE_OFFSET) | ((static_cast<uint64_t>(op_data) & mask_u64(OP_DATA_WIDTH)) << OP_DATA_OFFSET) | ((static_cast<uint64_t>(num_pkts) & mask_u64(NUM_PKTS_WIDTH)) - << NUM_PKTS_OFFSET)); + << NUM_PKTS_OFFSET)); // Populate second word buff[1] = conv_byte_order(num_bytes); diff --git a/host/lib/rfnoc/ctrlport_endpoint.cpp b/host/lib/rfnoc/ctrlport_endpoint.cpp index 5afb3919e..e4f256d91 100644 --- a/host/lib/rfnoc/ctrlport_endpoint.cpp +++ b/host/lib/rfnoc/ctrlport_endpoint.cpp @@ -5,9 +5,9 @@ // #include <uhd/exception.hpp> +#include <uhd/rfnoc/chdr_types.hpp> #include <uhd/utils/log.hpp> #include <uhdlib/rfnoc/chdr_packet_writer.hpp> -#include <uhdlib/rfnoc/chdr_types.hpp> #include <uhdlib/rfnoc/ctrlport_endpoint.hpp> #include <condition_variable> #include <boost/format.hpp> |