diff options
Diffstat (limited to 'host/lib/transport')
-rw-r--r-- | host/lib/transport/chdr.cpp | 38 | ||||
-rw-r--r-- | host/lib/transport/gen_vrt_if_packet.py | 56 | ||||
-rw-r--r-- | host/lib/transport/if_addrs.cpp | 14 | ||||
-rw-r--r-- | host/lib/transport/libusb1_base.cpp | 10 | ||||
-rw-r--r-- | host/lib/transport/libusb1_control.cpp | 12 | ||||
-rw-r--r-- | host/lib/transport/nirio/niusrprio_session.cpp | 20 | ||||
-rw-r--r-- | host/lib/transport/nirio/rpc/rpc_client.cpp | 4 | ||||
-rw-r--r-- | host/lib/transport/nirio/rpc/usrprio_rpc_client.cpp | 10 | ||||
-rw-r--r-- | host/lib/transport/super_recv_packet_handler.hpp | 24 | ||||
-rw-r--r-- | host/lib/transport/super_send_packet_handler.hpp | 20 | ||||
-rw-r--r-- | host/lib/transport/udp_simple.cpp | 2 | ||||
-rw-r--r-- | host/lib/transport/usb_dummy_impl.cpp | 2 | ||||
-rw-r--r-- | host/lib/transport/xport_benchmarker.cpp | 22 | ||||
-rw-r--r-- | host/lib/transport/xport_benchmarker.hpp | 16 |
14 files changed, 125 insertions, 125 deletions
diff --git a/host/lib/transport/chdr.cpp b/host/lib/transport/chdr.cpp index 632887e56..0c4643ba7 100644 --- a/host/lib/transport/chdr.cpp +++ b/host/lib/transport/chdr.cpp @@ -30,16 +30,16 @@ using namespace uhd::transport::vrt; -static const boost::uint32_t HDR_FLAG_TSF = (1 << 29); -static const boost::uint32_t HDR_FLAG_EOB = (1 << 28); -static const boost::uint32_t HDR_FLAG_ERROR = (1 << 28); +static const uint32_t HDR_FLAG_TSF = (1 << 29); +static const uint32_t HDR_FLAG_EOB = (1 << 28); +static const uint32_t HDR_FLAG_ERROR = (1 << 28); /***************************************************************************/ /* Packing */ /***************************************************************************/ /*! Translate the contents of \p if_packet_info into a 32-Bit word and return it. */ -UHD_INLINE boost::uint32_t _hdr_pack_chdr( +UHD_INLINE uint32_t _hdr_pack_chdr( if_packet_info_t &if_packet_info ) { // Set fields in if_packet_info @@ -48,9 +48,9 @@ UHD_INLINE boost::uint32_t _hdr_pack_chdr( if_packet_info.num_header_words32 + if_packet_info.num_payload_words32; - boost::uint16_t pkt_length = + uint16_t pkt_length = if_packet_info.num_payload_bytes + (4 * if_packet_info.num_header_words32); - boost::uint32_t chdr = 0 + uint32_t chdr = 0 // 2 Bits: Packet type | (if_packet_info.packet_type << 30) // 1 Bit: Has time @@ -65,7 +65,7 @@ UHD_INLINE boost::uint32_t _hdr_pack_chdr( } void chdr::if_hdr_pack_be( - boost::uint32_t *packet_buff, + uint32_t *packet_buff, if_packet_info_t &if_packet_info ) { // Write header and update if_packet_info @@ -76,13 +76,13 @@ void chdr::if_hdr_pack_be( // Write time if (if_packet_info.has_tsf) { - packet_buff[2] = BE_MACRO(boost::uint32_t(if_packet_info.tsf >> 32)); - packet_buff[3] = BE_MACRO(boost::uint32_t(if_packet_info.tsf >> 0)); + packet_buff[2] = BE_MACRO(uint32_t(if_packet_info.tsf >> 32)); + packet_buff[3] = BE_MACRO(uint32_t(if_packet_info.tsf >> 0)); } } void chdr::if_hdr_pack_le( - boost::uint32_t *packet_buff, + uint32_t *packet_buff, if_packet_info_t &if_packet_info ) { // Write header and update if_packet_info @@ -93,8 +93,8 @@ void chdr::if_hdr_pack_le( // Write time if (if_packet_info.has_tsf) { - packet_buff[2] = LE_MACRO(boost::uint32_t(if_packet_info.tsf >> 32)); - packet_buff[3] = LE_MACRO(boost::uint32_t(if_packet_info.tsf >> 0)); + packet_buff[2] = LE_MACRO(uint32_t(if_packet_info.tsf >> 32)); + packet_buff[3] = LE_MACRO(uint32_t(if_packet_info.tsf >> 0)); } } @@ -103,7 +103,7 @@ void chdr::if_hdr_pack_le( /* Unpacking */ /***************************************************************************/ UHD_INLINE void _hdr_unpack_chdr( - const boost::uint32_t chdr, + const uint32_t chdr, if_packet_info_t &if_packet_info ) { // Set constant members @@ -143,11 +143,11 @@ UHD_INLINE void _hdr_unpack_chdr( } void chdr::if_hdr_unpack_be( - const boost::uint32_t *packet_buff, + const uint32_t *packet_buff, if_packet_info_t &if_packet_info ) { // Read header and update if_packet_info - boost::uint32_t chdr = BE_MACRO(packet_buff[0]); + uint32_t chdr = BE_MACRO(packet_buff[0]); _hdr_unpack_chdr(chdr, if_packet_info); // Read SID @@ -156,17 +156,17 @@ void chdr::if_hdr_unpack_be( // Read time (has_tsf was updated earlier) if (if_packet_info.has_tsf) { if_packet_info.tsf = 0 - | boost::uint64_t(BE_MACRO(packet_buff[2])) << 32 + | uint64_t(BE_MACRO(packet_buff[2])) << 32 | BE_MACRO(packet_buff[3]); } } void chdr::if_hdr_unpack_le( - const boost::uint32_t *packet_buff, + const uint32_t *packet_buff, if_packet_info_t &if_packet_info ) { // Read header and update if_packet_info - boost::uint32_t chdr = LE_MACRO(packet_buff[0]); + uint32_t chdr = LE_MACRO(packet_buff[0]); _hdr_unpack_chdr(chdr, if_packet_info); // Read SID @@ -175,7 +175,7 @@ void chdr::if_hdr_unpack_le( // Read time (has_tsf was updated earlier) if (if_packet_info.has_tsf) { if_packet_info.tsf = 0 - | boost::uint64_t(LE_MACRO(packet_buff[2])) << 32 + | uint64_t(LE_MACRO(packet_buff[2])) << 32 | LE_MACRO(packet_buff[3]); } } diff --git a/host/lib/transport/gen_vrt_if_packet.py b/host/lib/transport/gen_vrt_if_packet.py index 6723e3a4b..bdef39881 100644 --- a/host/lib/transport/gen_vrt_if_packet.py +++ b/host/lib/transport/gen_vrt_if_packet.py @@ -57,7 +57,7 @@ static pred_table_type get_pred_unpack_table(void) { pred_table_type table(1 << 9, 0); //only 9 bits useful here (20-28) for (size_t i = 0; i < table.size(); i++){ - boost::uint32_t vrt_hdr_word = i << 20; + uint32_t vrt_hdr_word = i << 20; if(vrt_hdr_word & ${hex(0x1 << 28)}) table[i] |= ${hex(sid_p)}; if(vrt_hdr_word & ${hex(0x1 << 27)}) table[i] |= ${hex(cid_p)}; if(vrt_hdr_word & ${hex(0x3 << 22)}) table[i] |= ${hex(tsi_p)}; @@ -75,13 +75,13 @@ static const pred_table_type pred_unpack_table(get_pred_unpack_table()); //maps num empty bytes to trailer bits static const size_t occ_table[] = {0, 2, 1, 3}; -const boost::uint32_t VRLP = ('V' << 24) | ('R' << 16) | ('L' << 8) | ('P' << 0); -const boost::uint32_t VEND = ('V' << 24) | ('E' << 16) | ('N' << 8) | ('D' << 0); +const uint32_t VRLP = ('V' << 24) | ('R' << 16) | ('L' << 8) | ('P' << 0); +const uint32_t VEND = ('V' << 24) | ('E' << 16) | ('N' << 8) | ('D' << 0); -UHD_INLINE static boost::uint32_t chdr_to_vrt(const boost::uint32_t chdr, if_packet_info_t &info) +UHD_INLINE static uint32_t chdr_to_vrt(const uint32_t chdr, if_packet_info_t &info) { - const boost::uint32_t bytes = chdr & 0xffff; - boost::uint32_t vrt = (bytes + 3)/4; + const uint32_t bytes = chdr & 0xffff; + uint32_t vrt = (bytes + 3)/4; info.packet_count = (chdr >> 16) & 0xfff; vrt |= ((chdr >> 31) & 0x1) << 30; //context packet vrt |= ((chdr >> 29) & 0x1) << 20; //has tsf @@ -90,12 +90,12 @@ UHD_INLINE static boost::uint32_t chdr_to_vrt(const boost::uint32_t chdr, if_pac return vrt; } -UHD_INLINE static boost::uint32_t vrt_to_chdr(const boost::uint32_t vrt, const if_packet_info_t &info) +UHD_INLINE static uint32_t vrt_to_chdr(const uint32_t vrt, const if_packet_info_t &info) { - const boost::uint32_t words32 = vrt & 0xffff; + const uint32_t words32 = vrt & 0xffff; int bytes_rem = info.num_payload_bytes % 4; if (bytes_rem != 0) bytes_rem -= 4; //adjust for round up - boost::uint32_t chdr = (words32 * 4) + bytes_rem; + uint32_t chdr = (words32 * 4) + bytes_rem; chdr |= (info.packet_count & 0xfff) << 16; chdr |= ((vrt >> 30) & 0x1) << 31; //context packet chdr |= ((vrt >> 20) & 0x1) << 29; //has tsf @@ -110,11 +110,11 @@ UHD_INLINE static boost::uint32_t vrt_to_chdr(const boost::uint32_t vrt, const i * internal impl of packing VRT IF header only **********************************************************************/ UHD_INLINE void __if_hdr_pack_${suffix}( - boost::uint32_t *packet_buff, + uint32_t *packet_buff, if_packet_info_t &if_packet_info, - boost::uint32_t &vrt_hdr_word32 + uint32_t &vrt_hdr_word32 ){ - boost::uint32_t vrt_hdr_flags = 0; + uint32_t vrt_hdr_flags = 0; pred_type pred = 0; if (if_packet_info.has_sid) pred |= ${hex(sid_p)}; @@ -143,15 +143,15 @@ UHD_INLINE void __if_hdr_pack_${suffix}( % endif ########## Fractional Time ########## % if pred & tsf_p: - packet_buff[${num_header_words}] = ${XE_MACRO}(boost::uint32_t(if_packet_info.tsf >> 32));<% num_header_words += 1 %> - packet_buff[${num_header_words}] = ${XE_MACRO}(boost::uint32_t(if_packet_info.tsf >> 0));<% num_header_words += 1 %><% flags |= (0x1 << 20) %> + packet_buff[${num_header_words}] = ${XE_MACRO}(uint32_t(if_packet_info.tsf >> 32));<% num_header_words += 1 %> + packet_buff[${num_header_words}] = ${XE_MACRO}(uint32_t(if_packet_info.tsf >> 0));<% num_header_words += 1 %><% flags |= (0x1 << 20) %> % endif ########## Burst Flags ########## <% if pred & eob_p: flags |= (0x1 << 24) %><% if pred & sob_p: flags |= (0x1 << 25) %> ########## Trailer ########## % if pred & tlr_p: { - const size_t empty_bytes = if_packet_info.num_payload_words32*sizeof(boost::uint32_t) - if_packet_info.num_payload_bytes; + const size_t empty_bytes = if_packet_info.num_payload_words32*sizeof(uint32_t) - if_packet_info.num_payload_bytes; if_packet_info.tlr = (0x3 << 22) | (occ_table[empty_bytes & 0x3] << 10); } packet_buff[${num_header_words}+if_packet_info.num_payload_words32] = ${XE_MACRO}(if_packet_info.tlr);<% flags |= (0x1 << 26) %><% num_trailer_words = 1 %> @@ -167,7 +167,7 @@ UHD_INLINE void __if_hdr_pack_${suffix}( } //fill in complete header word - vrt_hdr_word32 = boost::uint32_t(0 + vrt_hdr_word32 = uint32_t(0 | (if_packet_info.packet_type << 29) | vrt_hdr_flags | ((if_packet_info.packet_count & 0xf) << 16) @@ -179,9 +179,9 @@ UHD_INLINE void __if_hdr_pack_${suffix}( * internal impl of unpacking VRT IF header only **********************************************************************/ UHD_INLINE void __if_hdr_unpack_${suffix}( - const boost::uint32_t *packet_buff, + const uint32_t *packet_buff, if_packet_info_t &if_packet_info, - const boost::uint32_t vrt_hdr_word32 + const uint32_t vrt_hdr_word32 ){ const size_t packet_words32 = vrt_hdr_word32 & 0xffff; @@ -225,7 +225,7 @@ UHD_INLINE void __if_hdr_unpack_${suffix}( ########## Fractional Time ########## % if pred & tsf_p: if_packet_info.has_tsf = true; - if_packet_info.tsf = boost::uint64_t(${XE_MACRO}(packet_buff[${num_header_words}])) << 32;<% num_header_words += 1 %> + if_packet_info.tsf = uint64_t(${XE_MACRO}(packet_buff[${num_header_words}])) << 32;<% num_header_words += 1 %> if_packet_info.tsf |= ${XE_MACRO}(packet_buff[${num_header_words}]);<% num_header_words += 1 %> % else: if_packet_info.has_tsf = false; @@ -260,7 +260,7 @@ UHD_INLINE void __if_hdr_unpack_${suffix}( throw uhd::value_error("bad vrt header or invalid packet length"); if_packet_info.num_header_words32 = ${num_header_words}; if_packet_info.num_payload_words32 = packet_words32 - ${num_header_words + num_trailer_words}; - if_packet_info.num_payload_bytes = if_packet_info.num_payload_words32*sizeof(boost::uint32_t) - empty_bytes; + if_packet_info.num_payload_bytes = if_packet_info.num_payload_words32*sizeof(uint32_t) - empty_bytes; break; % endfor } @@ -270,10 +270,10 @@ UHD_INLINE void __if_hdr_unpack_${suffix}( * link layer + VRT IF packing **********************************************************************/ void vrt::if_hdr_pack_${suffix}( - boost::uint32_t *packet_buff, + uint32_t *packet_buff, if_packet_info_t &if_packet_info ){ - boost::uint32_t vrt_hdr_word32 = 0; + uint32_t vrt_hdr_word32 = 0; switch (if_packet_info.link_type) { case if_packet_info_t::LINK_TYPE_NONE: @@ -284,7 +284,7 @@ void vrt::if_hdr_pack_${suffix}( case if_packet_info_t::LINK_TYPE_CHDR: { __if_hdr_pack_${suffix}(packet_buff, if_packet_info, vrt_hdr_word32); - const boost::uint32_t chdr = vrt_to_chdr(vrt_hdr_word32, if_packet_info); + const uint32_t chdr = vrt_to_chdr(vrt_hdr_word32, if_packet_info); packet_buff[0] = ${XE_MACRO}(chdr); break; } @@ -294,7 +294,7 @@ void vrt::if_hdr_pack_${suffix}( if_packet_info.num_header_words32 += 2; if_packet_info.num_packet_words32 += 3; packet_buff[0] = ${XE_MACRO}(VRLP); - packet_buff[1] = ${XE_MACRO}(boost::uint32_t( + packet_buff[1] = ${XE_MACRO}(uint32_t( (if_packet_info.num_packet_words32 & 0xfffff) | ((if_packet_info.packet_count & 0xfff) << 20) )); @@ -308,10 +308,10 @@ void vrt::if_hdr_pack_${suffix}( * link layer + VRT IF unpacking **********************************************************************/ void vrt::if_hdr_unpack_${suffix}( - const boost::uint32_t *packet_buff, + const uint32_t *packet_buff, if_packet_info_t &if_packet_info ){ - boost::uint32_t vrt_hdr_word32 = 0; + uint32_t vrt_hdr_word32 = 0; switch (if_packet_info.link_type) { case if_packet_info_t::LINK_TYPE_NONE: @@ -321,7 +321,7 @@ void vrt::if_hdr_unpack_${suffix}( case if_packet_info_t::LINK_TYPE_CHDR: { - const boost::uint32_t chdr = ${XE_MACRO}(packet_buff[0]); + const uint32_t chdr = ${XE_MACRO}(packet_buff[0]); vrt_hdr_word32 = chdr_to_vrt(chdr, if_packet_info); size_t packet_count = if_packet_info.packet_count; __if_hdr_unpack_${suffix}(packet_buff, if_packet_info, vrt_hdr_word32); @@ -333,7 +333,7 @@ void vrt::if_hdr_unpack_${suffix}( case if_packet_info_t::LINK_TYPE_VRLP: { if (${XE_MACRO}(packet_buff[0]) != VRLP) throw uhd::value_error("bad vrl header VRLP"); - const boost::uint32_t vrl_hdr = ${XE_MACRO}(packet_buff[1]); + const uint32_t vrl_hdr = ${XE_MACRO}(packet_buff[1]); vrt_hdr_word32 = ${XE_MACRO}(packet_buff[2]); if (if_packet_info.num_packet_words32 < (vrl_hdr & 0xfffff)) throw uhd::value_error("bad vrl header or packet fragment"); if (${XE_MACRO}(packet_buff[(vrl_hdr & 0xfffff)-1]) != VEND) throw uhd::value_error("bad vrl trailer VEND"); diff --git a/host/lib/transport/if_addrs.cpp b/host/lib/transport/if_addrs.cpp index 2ad0c8c53..3b8be5dd5 100644 --- a/host/lib/transport/if_addrs.cpp +++ b/host/lib/transport/if_addrs.cpp @@ -17,7 +17,7 @@ #include <uhd/transport/if_addrs.hpp> #include <boost/asio/ip/address_v4.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <iostream> /*********************************************************************** @@ -53,9 +53,9 @@ std::vector<uhd::transport::if_addrs_t> uhd::transport::get_if_addrs(void){ if (if_addr.inet == if_addr.bcast or sockaddr_to_ip_addr(iter->ifa_broadaddr) == boost::asio::ip::address_v4(0)){ //manually calculate broadcast address //https://svn.boost.org/trac/boost/ticket/5198 - const boost::uint32_t addr = sockaddr_to_ip_addr(iter->ifa_addr).to_ulong(); - const boost::uint32_t mask = sockaddr_to_ip_addr(iter->ifa_netmask).to_ulong(); - const boost::uint32_t bcast = (addr & mask) | ~mask; + const uint32_t addr = sockaddr_to_ip_addr(iter->ifa_addr).to_ulong(); + const uint32_t mask = sockaddr_to_ip_addr(iter->ifa_netmask).to_ulong(); + const uint32_t bcast = (addr & mask) | ~mask; if_addr.bcast = boost::asio::ip::address_v4(bcast).to_string(); } @@ -93,9 +93,9 @@ std::vector<uhd::transport::if_addrs_t> uhd::transport::get_if_addrs(void){ int nNumInterfaces = nBytesReturned / sizeof(INTERFACE_INFO); for (int i = 0; i < nNumInterfaces; ++i) { - boost::uint32_t iiAddress = ntohl(reinterpret_cast<sockaddr_in&>(InterfaceList[i].iiAddress).sin_addr.s_addr); - boost::uint32_t iiNetmask = ntohl(reinterpret_cast<sockaddr_in&>(InterfaceList[i].iiNetmask).sin_addr.s_addr); - boost::uint32_t iiBroadcastAddress = (iiAddress & iiNetmask) | ~iiNetmask; + uint32_t iiAddress = ntohl(reinterpret_cast<sockaddr_in&>(InterfaceList[i].iiAddress).sin_addr.s_addr); + uint32_t iiNetmask = ntohl(reinterpret_cast<sockaddr_in&>(InterfaceList[i].iiNetmask).sin_addr.s_addr); + uint32_t iiBroadcastAddress = (iiAddress & iiNetmask) | ~iiNetmask; if_addrs_t if_addr; if_addr.inet = boost::asio::ip::address_v4(iiAddress).to_string(); diff --git a/host/lib/transport/libusb1_base.cpp b/host/lib/transport/libusb1_base.cpp index 7b9e11da9..d04b679f8 100644 --- a/host/lib/transport/libusb1_base.cpp +++ b/host/lib/transport/libusb1_base.cpp @@ -208,7 +208,7 @@ public: std::string get_ascii_property(const std::string &what) const { - boost::uint8_t off = 0; + uint8_t off = 0; if (what == "serial") off = this->get().iSerialNumber; if (what == "product") off = this->get().iProduct; if (what == "manufacturer") off = this->get().iManufacturer; @@ -227,7 +227,7 @@ public: std::string string_descriptor((char *)buff, size_t(ret)); byte_vector_t string_vec(string_descriptor.begin(), string_descriptor.end()); std::string out; - BOOST_FOREACH(boost::uint8_t byte, string_vec){ + BOOST_FOREACH(uint8_t byte, string_vec){ if (byte < 32 or byte > 127) return out; out += byte; } @@ -363,11 +363,11 @@ public: return libusb::device_descriptor::make(this->get_device())->get_ascii_property("product"); } - boost::uint16_t get_vendor_id(void) const{ + uint16_t get_vendor_id(void) const{ return libusb::device_descriptor::make(this->get_device())->get().idVendor; } - boost::uint16_t get_product_id(void) const{ + uint16_t get_product_id(void) const{ return libusb::device_descriptor::make(this->get_device())->get().idProduct; } @@ -397,7 +397,7 @@ usb_device_handle::~usb_device_handle(void) { } std::vector<usb_device_handle::sptr> usb_device_handle::get_device_list( - boost::uint16_t vid, boost::uint16_t pid + uint16_t vid, uint16_t pid ){ return usb_device_handle::get_device_list(std::vector<usb_device_handle::vid_pid_pair_t>(1,usb_device_handle::vid_pid_pair_t(vid,pid))); } diff --git a/host/lib/transport/libusb1_control.cpp b/host/lib/transport/libusb1_control.cpp index a18f657d9..2bfffc0a3 100644 --- a/host/lib/transport/libusb1_control.cpp +++ b/host/lib/transport/libusb1_control.cpp @@ -38,13 +38,13 @@ public: virtual ~libusb_control_impl(void); - int submit(boost::uint8_t request_type, - boost::uint8_t request, - boost::uint16_t value, - boost::uint16_t index, + int submit(uint8_t request_type, + uint8_t request, + uint16_t value, + uint16_t index, unsigned char *buff, - boost::uint16_t length, - boost::uint32_t libusb_timeout = 0 + uint16_t length, + uint32_t libusb_timeout = 0 ){ boost::mutex::scoped_lock lock(_mutex); return libusb_control_transfer(_handle->get(), diff --git a/host/lib/transport/nirio/niusrprio_session.cpp b/host/lib/transport/nirio/niusrprio_session.cpp index 5463e3502..07ec6a266 100644 --- a/host/lib/transport/nirio/niusrprio_session.cpp +++ b/host/lib/transport/nirio/niusrprio_session.cpp @@ -77,7 +77,7 @@ nirio_status niusrprio_session::open( //That is why we need another identifier to qualify the signature. The BIN //checksum is a good candidate. std::string lvbitx_checksum(_lvbitx->get_bitstream_checksum()); - boost::uint16_t download_fpga = (force_download || (_read_bitstream_checksum() != lvbitx_checksum)) ? 1 : 0; + uint16_t download_fpga = (force_download || (_read_bitstream_checksum() != lvbitx_checksum)) ? 1 : 0; nirio_status_chain(_ensure_fpga_ready(), status); @@ -143,12 +143,12 @@ nirio_status niusrprio_session::_verify_signature() { //Validate the signature using the kernel proxy nirio_status status = NiRio_Status_Success; - boost::uint32_t sig_offset = 0; + uint32_t sig_offset = 0; nirio_status_chain(_riok_proxy->get_attribute(RIO_FPGA_DEFAULT_SIGNATURE_OFFSET, sig_offset), status); niriok_scoped_addr_space(_riok_proxy, FPGA, status); std::string signature; - for (boost::uint32_t i = 0; i < 8; i++) { - boost::uint32_t quarter_sig; + for (uint32_t i = 0; i < 8; i++) { + uint32_t quarter_sig; nirio_status_chain(_riok_proxy->peek(sig_offset, quarter_sig), status); signature += boost::str(boost::format("%08x") % quarter_sig); } @@ -168,8 +168,8 @@ std::string niusrprio_session::_read_bitstream_checksum() nirio_status status = NiRio_Status_Success; niriok_scoped_addr_space(_riok_proxy, BUS_INTERFACE, status); std::string usr_signature; - for (boost::uint32_t i = 0; i < FPGA_USR_SIG_REG_SIZE; i+=4) { - boost::uint32_t quarter_sig; + for (uint32_t i = 0; i < FPGA_USR_SIG_REG_SIZE; i+=4) { + uint32_t quarter_sig; nirio_status_chain(_riok_proxy->peek(FPGA_USR_SIG_REG_BASE + i, quarter_sig), status); usr_signature += boost::str(boost::format("%08x") % quarter_sig); } @@ -182,8 +182,8 @@ nirio_status niusrprio_session::_write_bitstream_checksum(const std::string& che { nirio_status status = NiRio_Status_Success; niriok_scoped_addr_space(_riok_proxy, BUS_INTERFACE, status); - for (boost::uint32_t i = 0; i < FPGA_USR_SIG_REG_SIZE; i+=4) { - boost::uint32_t quarter_sig; + for (uint32_t i = 0; i < FPGA_USR_SIG_REG_SIZE; i+=4) { + uint32_t quarter_sig; try { std::stringstream ss; ss << std::hex << checksum.substr(i*2,8); @@ -203,14 +203,14 @@ nirio_status niusrprio_session::_ensure_fpga_ready() //Verify that the Ettus FPGA loaded in the device. This may not be true if the //user is switching to UHD after using LabVIEW FPGA. In that case skip this check. - boost::uint32_t pcie_fpga_signature = 0; + uint32_t pcie_fpga_signature = 0; nirio_status_chain(_riok_proxy->peek(FPGA_PCIE_SIG_REG, pcie_fpga_signature), status); //@TODO: Remove X300 specific constants for future products if (pcie_fpga_signature != FPGA_X3xx_SIG_VALUE) { return status; } - boost::uint32_t reg_data = 0xffffffff; + uint32_t reg_data = 0xffffffff; nirio_status_chain(_riok_proxy->peek(FPGA_STATUS_REG, reg_data), status); if (nirio_status_not_fatal(status) && (reg_data & FPGA_STATUS_DMA_ACTIVE_MASK)) { diff --git a/host/lib/transport/nirio/rpc/rpc_client.cpp b/host/lib/transport/nirio/rpc/rpc_client.cpp index 3d62b57ae..7beaf9974 100644 --- a/host/lib/transport/nirio/rpc/rpc_client.cpp +++ b/host/lib/transport/nirio/rpc/rpc_client.cpp @@ -35,8 +35,8 @@ using boost::asio::ip::tcp; rpc_client::rpc_client ( const std::string& server, const std::string& port, - boost::uint32_t process_id, - boost::uint32_t host_id + uint32_t process_id, + uint32_t host_id ) : _socket(_io_service) { //Fill in handshake info diff --git a/host/lib/transport/nirio/rpc/usrprio_rpc_client.cpp b/host/lib/transport/nirio/rpc/usrprio_rpc_client.cpp index 1a1f1cd21..0e58f161c 100644 --- a/host/lib/transport/nirio/rpc/usrprio_rpc_client.cpp +++ b/host/lib/transport/nirio/rpc/usrprio_rpc_client.cpp @@ -42,7 +42,7 @@ nirio_status usrprio_rpc_client::niusrprio_enumerate(NIUSRPRIO_ENUMERATE_ARGS) usrprio_rpc::func_args_writer_t in_args; usrprio_rpc::func_args_reader_t out_args; nirio_status status = NiRio_Status_Success; - boost::uint32_t vtr_size = 0; + uint32_t vtr_size = 0; status = _boost_error_to_nirio_status( _rpc_client.call(NIUSRPRIO_ENUMERATE, in_args, out_args, _timeout)); @@ -68,7 +68,7 @@ nirio_status usrprio_rpc_client::niusrprio_open_session(NIUSRPRIO_OPEN_SESSION_A const std::string& resource, \ const std::string& path, \ const std::string& signature, \ - const boost::uint16_t& download_fpga + const uint16_t& download_fpga */ { usrprio_rpc::func_args_writer_t in_args; @@ -81,7 +81,7 @@ nirio_status usrprio_rpc_client::niusrprio_open_session(NIUSRPRIO_OPEN_SESSION_A in_args << download_fpga; //Open needs a longer timeout because the FPGA download can take upto 6 secs and the NiFpga libload can take 4. - static const boost::uint32_t OPEN_TIMEOUT = 15000; + static const uint32_t OPEN_TIMEOUT = 15000; status = _boost_error_to_nirio_status( _rpc_client.call(NIUSRPRIO_OPEN_SESSION, in_args, out_args, boost::posix_time::milliseconds(OPEN_TIMEOUT))); @@ -163,7 +163,7 @@ nirio_status usrprio_rpc_client::niusrprio_get_interface_path(NIUSRPRIO_GET_INTE nirio_status usrprio_rpc_client::niusrprio_download_fpga_to_flash(NIUSRPRIO_DOWNLOAD_FPGA_TO_FLASH_ARGS) /* #define NIUSRPRIO_DOWNLOAD_FPGA_TO_FLASH_ARGS \ - const boost::uint32_t& interface_num, \ + const uint32_t& interface_num, \ const std::string& bitstream_path */ { @@ -174,7 +174,7 @@ nirio_status usrprio_rpc_client::niusrprio_download_fpga_to_flash(NIUSRPRIO_DOWN in_args << resource; in_args << bitstream_path; - static const boost::uint32_t DOWNLOAD_FPGA_TIMEOUT = 1200000; + static const uint32_t DOWNLOAD_FPGA_TIMEOUT = 1200000; status = _boost_error_to_nirio_status( _rpc_client.call(NIUSRPRIO_DOWNLOAD_FPGA_TO_FLASH, in_args, out_args, boost::posix_time::milliseconds(DOWNLOAD_FPGA_TIMEOUT))); diff --git a/host/lib/transport/super_recv_packet_handler.hpp b/host/lib/transport/super_recv_packet_handler.hpp index bd7f01c4f..d34f222e8 100644 --- a/host/lib/transport/super_recv_packet_handler.hpp +++ b/host/lib/transport/super_recv_packet_handler.hpp @@ -47,11 +47,11 @@ namespace uhd{ namespace transport{ namespace sph{ -UHD_INLINE boost::uint32_t get_context_code( - const boost::uint32_t *vrt_hdr, const vrt::if_packet_info_t &if_packet_info +UHD_INLINE uint32_t get_context_code( + const uint32_t *vrt_hdr, const vrt::if_packet_info_t &if_packet_info ){ //extract the context word (we dont know the endianness so mirror the bytes) - boost::uint32_t word0 = vrt_hdr[if_packet_info.num_header_words32] | + uint32_t word0 = vrt_hdr[if_packet_info.num_header_words32] | uhd::byteswap(vrt_hdr[if_packet_info.num_header_words32]); return word0 & 0xff; } @@ -71,8 +71,8 @@ public: typedef boost::function<managed_recv_buffer::sptr(double)> get_buff_type; typedef boost::function<void(const size_t)> handle_flowctrl_type; typedef boost::function<void(const stream_cmd_t&)> issue_stream_cmd_type; - typedef void(*vrt_unpacker_type)(const boost::uint32_t *, vrt::if_packet_info_t &); - //typedef boost::function<void(const boost::uint32_t *, vrt::if_packet_info_t &)> vrt_unpacker_type; + typedef void(*vrt_unpacker_type)(const uint32_t *, vrt::if_packet_info_t &); + //typedef boost::function<void(const uint32_t *, vrt::if_packet_info_t &)> vrt_unpacker_type; /*! * Make a new packet handler for receive @@ -115,13 +115,13 @@ public: ////////////////// RFNOC /////////////////////////// //! Set the stream ID for a specific channel (or no SID) - void set_xport_chan_sid(const size_t xport_chan, const bool has_sid, const boost::uint32_t sid = 0){ + void set_xport_chan_sid(const size_t xport_chan, const bool has_sid, const uint32_t sid = 0){ _props.at(xport_chan).has_sid = has_sid; _props.at(xport_chan).sid = sid; } //! Get the stream ID for a specific channel (or zero if no SID) - boost::uint32_t get_xport_chan_sid(const size_t xport_chan) const { + uint32_t get_xport_chan_sid(const size_t xport_chan) const { if (_props.at(xport_chan).has_sid) { return _props.at(xport_chan).sid; } else { @@ -319,7 +319,7 @@ private: size_t fc_update_window; /////// RFNOC /////////// bool has_sid; - boost::uint32_t sid; + uint32_t sid; /////// RFNOC /////////// }; std::vector<xport_chan_props_type> _props; @@ -338,7 +338,7 @@ private: copy_buff = NULL; } managed_recv_buffer::sptr buff; - const boost::uint32_t *vrt_hdr; + const uint32_t *vrt_hdr; vrt::if_packet_info_t ifpi; time_spec_t time; const char *copy_buff; @@ -423,7 +423,7 @@ private: #endif //bounds check before extract - size_t num_packet_words32 = buff->size()/sizeof(boost::uint32_t); + size_t num_packet_words32 = buff->size()/sizeof(uint32_t); if (num_packet_words32 <= _header_offset_words32){ throw std::runtime_error("recv buffer smaller than vrt packet offset"); } @@ -431,7 +431,7 @@ private: //extract packet info per_buffer_info_type &info = curr_buffer_info; info.ifpi.num_packet_words32 = num_packet_words32 - _header_offset_words32; - info.vrt_hdr = buff->cast<const boost::uint32_t *>() + _header_offset_words32; + info.vrt_hdr = buff->cast<const uint32_t *>() + _header_offset_words32; _vrt_unpacker(info.vrt_hdr, info.ifpi); info.time = time_spec_t::from_ticks(info.ifpi.tsf, _tick_rate); //assumes has_tsf is true info.copy_buff = reinterpret_cast<const char *>(info.vrt_hdr + info.ifpi.num_header_words32); @@ -633,7 +633,7 @@ private: std::swap(curr_info, next_info); //save progress from curr -> next curr_info.metadata.has_time_spec = prev_info.metadata.has_time_spec; curr_info.metadata.time_spec = prev_info.metadata.time_spec + time_spec_t::from_ticks( - prev_info[index].ifpi.num_payload_words32*sizeof(boost::uint32_t)/_bytes_per_otw_item, _samp_rate); + prev_info[index].ifpi.num_payload_words32*sizeof(uint32_t)/_bytes_per_otw_item, _samp_rate); curr_info.metadata.out_of_sequence = true; curr_info.metadata.error_code = rx_metadata_t::ERROR_CODE_OVERFLOW; UHD_MSG(fastpath) << "D"; diff --git a/host/lib/transport/super_send_packet_handler.hpp b/host/lib/transport/super_send_packet_handler.hpp index d49fb19ca..0acc8df4b 100644 --- a/host/lib/transport/super_send_packet_handler.hpp +++ b/host/lib/transport/super_send_packet_handler.hpp @@ -60,8 +60,8 @@ class send_packet_handler{ public: typedef boost::function<managed_send_buffer::sptr(double)> get_buff_type; typedef boost::function<bool(uhd::async_metadata_t &, const double)> async_receiver_type; - typedef void(*vrt_packer_type)(boost::uint32_t *, vrt::if_packet_info_t &); - //typedef boost::function<void(boost::uint32_t *, vrt::if_packet_info_t &)> vrt_packer_type; + typedef void(*vrt_packer_type)(uint32_t *, vrt::if_packet_info_t &); + //typedef boost::function<void(uint32_t *, vrt::if_packet_info_t &)> vrt_packer_type; /*! * Make a new packet handler for send @@ -82,7 +82,7 @@ public: void resize(const size_t size){ if (this->size() == size) return; _props.resize(size); - static const boost::uint64_t zero = 0; + static const uint64_t zero = 0; _zero_buffs.resize(size, &zero); } @@ -98,14 +98,14 @@ public: } //! Set the stream ID for a specific channel (or no SID) - void set_xport_chan_sid(const size_t xport_chan, const bool has_sid, const boost::uint32_t sid = 0){ + void set_xport_chan_sid(const size_t xport_chan, const bool has_sid, const uint32_t sid = 0){ _props.at(xport_chan).has_sid = has_sid; _props.at(xport_chan).sid = sid; } ///////// RFNOC /////////////////// //! Get the stream ID for a specific channel (or zero if no SID) - boost::uint32_t get_xport_chan_sid(const size_t xport_chan) const { + uint32_t get_xport_chan_sid(const size_t xport_chan) const { if (_props.at(xport_chan).has_sid) { return _props.at(xport_chan).sid; } else { @@ -230,7 +230,7 @@ public: //TODO remove this code when sample counts of zero are supported by hardware #ifndef SSPH_DONT_PAD_TO_ONE - static const boost::uint64_t zero = 0; + static const uint64_t zero = 0; _zero_buffs.resize(buffs.size(), &zero); if (nsamps_per_buff == 0) @@ -302,7 +302,7 @@ private: xport_chan_props_type(void):has_sid(false),sid(0){} get_buff_type get_buff; bool has_sid; - boost::uint32_t sid; + uint32_t sid; managed_send_buffer::sptr buff; }; std::vector<xport_chan_props_type> _props; @@ -378,7 +378,7 @@ private: //load the rest of the if_packet_info in here if_packet_info.num_payload_bytes = nsamps_per_buff*_num_inputs*_bytes_per_otw_item; - if_packet_info.num_payload_words32 = (if_packet_info.num_payload_bytes + 3/*round up*/)/sizeof(boost::uint32_t); + if_packet_info.num_payload_words32 = (if_packet_info.num_payload_bytes + 3/*round up*/)/sizeof(uint32_t); if_packet_info.packet_count = _next_packet_seq; //get a buffer for each channel or timeout @@ -425,7 +425,7 @@ private: const ref_vector<const void *> in_buffs(io_buffs, _num_inputs); //pack metadata into a vrt header - boost::uint32_t *otw_mem = buff->cast<boost::uint32_t *>() + _header_offset_words32; + uint32_t *otw_mem = buff->cast<uint32_t *>() + _header_offset_words32; if_packet_info.has_sid = _props[index].has_sid; if_packet_info.sid = _props[index].sid; _vrt_packer(otw_mem, if_packet_info); @@ -436,7 +436,7 @@ private: //commit the samples to the zero-copy interface const size_t num_vita_words32 = _header_offset_words32+if_packet_info.num_packet_words32; - buff->commit(num_vita_words32*sizeof(boost::uint32_t)); + buff->commit(num_vita_words32*sizeof(uint32_t)); buff.reset(); //effectively a release } diff --git a/host/lib/transport/udp_simple.cpp b/host/lib/transport/udp_simple.cpp index 43414feaa..0a93941b8 100644 --- a/host/lib/transport/udp_simple.cpp +++ b/host/lib/transport/udp_simple.cpp @@ -134,7 +134,7 @@ public: private: udp_simple::sptr _udp; size_t _len, _off; - boost::uint8_t _buf[udp_simple::mtu]; + uint8_t _buf[udp_simple::mtu]; std::string _line; }; diff --git a/host/lib/transport/usb_dummy_impl.cpp b/host/lib/transport/usb_dummy_impl.cpp index b53b6f590..29f813963 100644 --- a/host/lib/transport/usb_dummy_impl.cpp +++ b/host/lib/transport/usb_dummy_impl.cpp @@ -27,7 +27,7 @@ usb_control::~usb_control(void){ /* NOP */ } -std::vector<usb_device_handle::sptr> usb_device_handle::get_device_list(boost::uint16_t, boost::uint16_t){ +std::vector<usb_device_handle::sptr> usb_device_handle::get_device_list(uint16_t, uint16_t){ return std::vector<usb_device_handle::sptr>(); //empty list } diff --git a/host/lib/transport/xport_benchmarker.cpp b/host/lib/transport/xport_benchmarker.cpp index d58dbea47..d8f533edc 100644 --- a/host/lib/transport/xport_benchmarker.cpp +++ b/host/lib/transport/xport_benchmarker.cpp @@ -23,9 +23,9 @@ const device_addr_t& xport_benchmarker::benchmark_throughput_chdr ( zero_copy_if::sptr tx_transport, zero_copy_if::sptr rx_transport, - boost::uint32_t sid, + uint32_t sid, bool big_endian, - boost::uint32_t duration_ms) + uint32_t duration_ms) { vrt::if_packet_info_t pkt_info; _initialize_chdr(tx_transport, rx_transport, sid, pkt_info); @@ -45,8 +45,8 @@ const device_addr_t& xport_benchmarker::benchmark_throughput_chdr boost::posix_time::ptime stop_time(boost::posix_time::microsec_clock::local_time()); double duration_s = ((double)(stop_time-start_time).total_microseconds())/1e6; - boost::uint64_t tx_bytes = pkt_info.num_payload_words32*sizeof(uint32_t)*_num_tx_packets; - boost::uint64_t rx_bytes = pkt_info.num_payload_words32*sizeof(uint32_t)*_num_rx_packets; + uint64_t tx_bytes = pkt_info.num_payload_words32*sizeof(uint32_t)*_num_tx_packets; + uint64_t rx_bytes = pkt_info.num_payload_words32*sizeof(uint32_t)*_num_rx_packets; double tx_rate = (((double)tx_bytes)/duration_s); double rx_rate = (((double)rx_bytes)/duration_s); @@ -66,7 +66,7 @@ void xport_benchmarker::_stream_tx(zero_copy_if* transport, vrt::if_packet_info_ while (not boost::this_thread::interruption_requested()) { managed_send_buffer::sptr buff = transport->get_send_buff(_tx_timeout); if (buff) { - boost::uint32_t *packet_buff = buff->cast<boost::uint32_t *>(); + uint32_t *packet_buff = buff->cast<uint32_t *>(); //Populate packet if (big_endian) { vrt::if_hdr_pack_be(packet_buff, *pkt_info); @@ -74,7 +74,7 @@ void xport_benchmarker::_stream_tx(zero_copy_if* transport, vrt::if_packet_info_ vrt::if_hdr_pack_le(packet_buff, *pkt_info); } //send the buffer over the interface - buff->commit(sizeof(boost::uint32_t)*(pkt_info->num_packet_words32)); + buff->commit(sizeof(uint32_t)*(pkt_info->num_packet_words32)); _num_tx_packets++; } else { _num_tx_timeouts++; @@ -90,8 +90,8 @@ void xport_benchmarker::_stream_rx(zero_copy_if* transport, const vrt::if_packet //Extract packet info vrt::if_packet_info_t pkt_info; pkt_info.link_type = exp_pkt_info->link_type; - pkt_info.num_packet_words32 = buff->size()/sizeof(boost::uint32_t); - const boost::uint32_t *packet_buff = buff->cast<const boost::uint32_t *>(); + pkt_info.num_packet_words32 = buff->size()/sizeof(uint32_t); + const uint32_t *packet_buff = buff->cast<const uint32_t *>(); _num_rx_packets++; @@ -128,7 +128,7 @@ void xport_benchmarker::_reset_counters(void) void xport_benchmarker::_initialize_chdr( zero_copy_if::sptr tx_transport, zero_copy_if::sptr rx_transport, - boost::uint32_t sid, + uint32_t sid, vrt::if_packet_info_t& pkt_info) { _tx_timeout = 0.5; @@ -138,9 +138,9 @@ void xport_benchmarker::_initialize_chdr( pkt_info.link_type = vrt::if_packet_info_t::LINK_TYPE_CHDR; pkt_info.packet_type = vrt::if_packet_info_t::PACKET_TYPE_DATA; - pkt_info.num_packet_words32 = (frame_size/sizeof(boost::uint32_t)); + pkt_info.num_packet_words32 = (frame_size/sizeof(uint32_t)); pkt_info.num_payload_words32 = pkt_info.num_packet_words32 - 2; - pkt_info.num_payload_bytes = pkt_info.num_payload_words32*sizeof(boost::uint32_t); + pkt_info.num_payload_bytes = pkt_info.num_payload_words32*sizeof(uint32_t); pkt_info.packet_count = 0; pkt_info.sob = false; pkt_info.eob = false; diff --git a/host/lib/transport/xport_benchmarker.hpp b/host/lib/transport/xport_benchmarker.hpp index 9fca8d1fb..7383d34f1 100644 --- a/host/lib/transport/xport_benchmarker.hpp +++ b/host/lib/transport/xport_benchmarker.hpp @@ -33,9 +33,9 @@ public: const device_addr_t& benchmark_throughput_chdr( zero_copy_if::sptr tx_transport, zero_copy_if::sptr rx_transport, - boost::uint32_t sid, + uint32_t sid, bool big_endian, - boost::uint32_t duration_ms); + uint32_t duration_ms); private: void _stream_tx( @@ -51,7 +51,7 @@ private: void _initialize_chdr( zero_copy_if::sptr tx_transport, zero_copy_if::sptr rx_transport, - boost::uint32_t sid, + uint32_t sid, vrt::if_packet_info_t& pkt_info); void _reset_counters(void); @@ -59,11 +59,11 @@ private: boost::shared_ptr<boost::thread> _tx_thread; boost::shared_ptr<boost::thread> _rx_thread; - boost::uint64_t _num_tx_packets; - boost::uint64_t _num_rx_packets; - boost::uint64_t _num_tx_timeouts; - boost::uint64_t _num_rx_timeouts; - boost::uint64_t _num_data_errors; + uint64_t _num_tx_packets; + uint64_t _num_rx_packets; + uint64_t _num_tx_timeouts; + uint64_t _num_rx_timeouts; + uint64_t _num_data_errors; double _tx_timeout; double _rx_timeout; |