diff options
311 files changed, 3285 insertions, 3153 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index 4947b3fa0..40819f176 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -338,8 +338,8 @@ UHD_INSTALL(FILES #{{{IMG_SECTION # This section is written automatically by /images/create_imgs_package.py # Any manual changes in here will be overwritten. -SET(UHD_IMAGES_MD5SUM "078b883192ef8d68465e4681537c1a8a") -SET(UHD_IMAGES_DOWNLOAD_SRC "uhd-images_003.010.001.000-rc2.zip") +SET(UHD_IMAGES_MD5SUM "21f58d903775485e2243a6ee77706679") +SET(UHD_IMAGES_DOWNLOAD_SRC "uhd-images_003.010.001.000-release.zip") #}}} ######################################################################## diff --git a/host/cmake/debian/changelog b/host/cmake/debian/changelog index f38aab406..94ee3885a 100644 --- a/host/cmake/debian/changelog +++ b/host/cmake/debian/changelog @@ -1,3 +1,31 @@ +uhd (3.10.1.0-0ubuntu1) trusty; urgency=low + + - Fixed multiple compiler warnings + - Multiple documentation fixes + - X300: RX strobe lines are always in sync on device initialization. DB EEPROM + now properly written. ignore-cal-file no longer ignored. Fixed case where too + large recv_frame_size settings could break things. Reduced ZPU clock speed + (helps FPGA timing). Added area constraints for AXI interconnect. Improved + halfband scaling in rx_frontend. Improved PCIe streaming reliability + - B2xx: Clear sequence numbers in idle state. + - RFNoC: Nodes disconnect on destruction. Fixed setting of correct bits on + sr_error_policy. DDC does no longer clear timed commands on EOB. DUC fixed + timed CORDIC tuning. Enable Noc-Shell response FIFOs (fixes simultaneous + commands on multiple channels). + - UBX: Changed default performance parameters + - TwinRX: LEDs properly light up depending on channels. Fixed issue of multiple + (redundant) writes. Simplified API steps for phase synchronization + - XCVR: Query dboard clock instead of DAC clock. Helps in X3x0s. + - GPS: Fixed message for case when no GPS is present. Fixed multiple GPS-related + issues. + - Converters: Fixed floating point rounding error in tests. + - Utils: uhd_usrp_probe can now query vectors + - Fixed issue that prevented soft_regs working on 32-bit systems + - Tools: Merged dissectors into common directory. + - CMake: -Og is the default now for gcc-based Debug builds. + + -- Ettus Research <packages@ettus.com> Wed, 02 Nov 2016 01:20:07 -0800 + uhd (3.10.0.0-0ubuntu1) trusty; urgency=low - Changed version string to quadruplets (Major.API.ABI.Patch) diff --git a/host/cmake/msvc/amd64/WdfCoInstaller01009.dll b/host/cmake/msvc/amd64/WdfCoInstaller01009.dll Binary files differnew file mode 100644 index 000000000..1731b962d --- /dev/null +++ b/host/cmake/msvc/amd64/WdfCoInstaller01009.dll diff --git a/host/cmake/msvc/amd64/winusbcoinstaller2.dll b/host/cmake/msvc/amd64/winusbcoinstaller2.dll Binary files differnew file mode 100644 index 000000000..30e55025b --- /dev/null +++ b/host/cmake/msvc/amd64/winusbcoinstaller2.dll diff --git a/host/cmake/msvc/erllc_uhd.cat b/host/cmake/msvc/erllc_uhd.cat Binary files differnew file mode 100644 index 000000000..cc6fbdc55 --- /dev/null +++ b/host/cmake/msvc/erllc_uhd.cat diff --git a/host/cmake/msvc/erllc_uhd_b100.inf b/host/cmake/msvc/erllc_uhd_b100.inf index b28126932..c3a10535a 100644 --- a/host/cmake/msvc/erllc_uhd_b100.inf +++ b/host/cmake/msvc/erllc_uhd_b100.inf @@ -39,22 +39,21 @@ ; ===================================================== DeviceName = "Ettus Research LLC B100" -; Make sure "VID_" and "PID_" are always part of the strings below VendorID = "VID_2500" ProductID = "PID_0002" DeviceGUID = "{43ec6c7f-2686-492f-add6-601ebbf5e89a}" DeviceClassGUID = "{78a1c341-4539-11d3-b88d-00c04fad5171}" ; Date MUST be in MM/DD/YYYY format -Date = "10/10/2011" +Date = "03/29/2016" ; ===================================================== ; ========== END USER CONFIGURABLE SECTION ============ ; ===================================================== -ProviderName = "libusb 1.0" +ProviderName = "Ettus Research" WinUSB_SvcDesc = "WinUSB Driver Service" DiskName = "libusb (WinUSB) Device Install Disk" -ClassName = "libusb (WinUSB) devices" +ClassName = "USRPs" ; ====================== Version ====================== @@ -64,7 +63,7 @@ Signature = "$Windows NT$" Class = %ClassName% ClassGuid = %DeviceClassGUID% Provider = %ProviderName% -CatalogFile = libusb_device.cat +CatalogFile = erllc_uhd.cat ; =================== Class section =================== @@ -100,7 +99,7 @@ Needs=WINUSB.NT ; The Include directive in the USB_Install.Services section includes the system- ; supplied INF for WinUSB. This INF is installed by the WinUSB co-installer if ; it is not already on the target system. The AddService directive specifies -; WinUsb.sys as the device’s function driver. These directives should not be +; WinUsb.sys as the device's function driver. These directives should not be ; modified. [USB_Install.Services] Include=winusb.inf @@ -128,7 +127,7 @@ KmdfLibraryVersion=1.9 ; USB_Install.HW is the key section in the INF. It specifies the device ; interface globally unique identifier (GUID) for your device. The AddReg ; directive puts the interface GUID in a standard registry value. When -; WinUsb.sys is loaded as the device’s function driver, it reads the registry +; WinUsb.sys is loaded as the device's function driver, it reads the registry ; value and uses the specified GUID to represent the device interface. You ; should replace the GUID in this example with one that you create specifically ; for your device. If the protocols for the device change, you should create a diff --git a/host/cmake/msvc/erllc_uhd_b200.inf b/host/cmake/msvc/erllc_uhd_b200.inf index 44647f726..26a3cc0d6 100644 --- a/host/cmake/msvc/erllc_uhd_b200.inf +++ b/host/cmake/msvc/erllc_uhd_b200.inf @@ -39,22 +39,21 @@ ; ===================================================== DeviceName = "Ettus Research LLC B200/B210" -; Make sure "VID_" and "PID_" are always part of the strings below VendorID = "VID_2500" ProductID = "PID_0020" DeviceGUID = "{43ec6c7f-2686-492f-add6-601ebbf5e89a}" DeviceClassGUID = "{78a1c341-4539-11d3-b88d-00c04fad5171}" ; Date MUST be in MM/DD/YYYY format -Date = "10/10/2011" +Date = "03/29/2016" ; ===================================================== ; ========== END USER CONFIGURABLE SECTION ============ ; ===================================================== -ProviderName = "libusb 1.0" +ProviderName = "Ettus Research" WinUSB_SvcDesc = "WinUSB Driver Service" DiskName = "libusb (WinUSB) Device Install Disk" -ClassName = "libusb (WinUSB) devices" +ClassName = "USRPs" ; ====================== Version ====================== @@ -64,7 +63,7 @@ Signature = "$Windows NT$" Class = %ClassName% ClassGuid = %DeviceClassGUID% Provider = %ProviderName% -CatalogFile = libusb_device.cat +CatalogFile = erllc_uhd.cat ; =================== Class section =================== diff --git a/host/cmake/msvc/erllc_uhd_b200_reinit.inf b/host/cmake/msvc/erllc_uhd_b200_reinit.inf Binary files differindex 13934ef53..bb65e9c3e 100644 --- a/host/cmake/msvc/erllc_uhd_b200_reinit.inf +++ b/host/cmake/msvc/erllc_uhd_b200_reinit.inf diff --git a/host/cmake/msvc/erllc_uhd_b200mini.inf b/host/cmake/msvc/erllc_uhd_b200mini.inf index ce8f730e0..63aa2a0a7 100644 --- a/host/cmake/msvc/erllc_uhd_b200mini.inf +++ b/host/cmake/msvc/erllc_uhd_b200mini.inf @@ -45,16 +45,16 @@ ProductID = "PID_0021" DeviceGUID = "{6960fcb7-8440-4271-a4e3-fef0cb9d01f7}" DeviceClassGUID = "{78a1c341-4539-11d3-b88d-00c04fad5171}" ; Date MUST be in MM/DD/YYYY format -Date = "08/13/2015" +Date = "03/29/2016" ; ===================================================== ; ========== END USER CONFIGURABLE SECTION ============ ; ===================================================== -ProviderName = "libusb 1.0" +ProviderName = "Ettus Research" WinUSB_SvcDesc = "WinUSB Driver Service" DiskName = "libusb (WinUSB) Device Install Disk" -ClassName = "libusb (WinUSB) devices" +ClassName = "USRPs" ; ====================== Version ====================== @@ -64,7 +64,7 @@ Signature = "$Windows NT$" Class = %ClassName% ClassGuid = %DeviceClassGUID% Provider = %ProviderName% -CatalogFile = libusb_device.cat +CatalogFile = erllc_uhd.cat ; =================== Class section =================== diff --git a/host/cmake/msvc/erllc_uhd_b205mini.inf b/host/cmake/msvc/erllc_uhd_b205mini.inf index 1e5852656..e72474181 100644 --- a/host/cmake/msvc/erllc_uhd_b205mini.inf +++ b/host/cmake/msvc/erllc_uhd_b205mini.inf @@ -39,22 +39,21 @@ ; ===================================================== DeviceName = "Ettus Research B205mini" -; Make sure "VID_" and "PID_" are always part of the strings below VendorID = "VID_2500" ProductID = "PID_0022" DeviceGUID = "{211d89c8-92d7-11e5-be76-3c970eb8a18b}" DeviceClassGUID = "{78a1c341-4539-11d3-b88d-00c04fad5171}" ; Date MUST be in MM/DD/YYYY format -Date = "11/24/2015" +Date = "03/29/2016" ; ===================================================== ; ========== END USER CONFIGURABLE SECTION ============ ; ===================================================== -ProviderName = "libusb 1.0" +ProviderName = "Ettus Research" WinUSB_SvcDesc = "WinUSB Driver Service" DiskName = "libusb (WinUSB) Device Install Disk" -ClassName = "libusb (WinUSB) devices" +ClassName = "USRPs" ; ====================== Version ====================== @@ -64,7 +63,7 @@ Signature = "$Windows NT$" Class = %ClassName% ClassGuid = %DeviceClassGUID% Provider = %ProviderName% -CatalogFile = libusb_device.cat +CatalogFile = erllc_uhd.cat ; =================== Class section =================== diff --git a/host/cmake/msvc/erllc_uhd_makecat.cdf b/host/cmake/msvc/erllc_uhd_makecat.cdf new file mode 100644 index 000000000..9e4ec7a92 --- /dev/null +++ b/host/cmake/msvc/erllc_uhd_makecat.cdf @@ -0,0 +1,17 @@ +[CatalogHeader]
+Name=erllc_uhd.cat
+PublicVersion=0x0000001
+EncodingType=0x00010001
+CATATTR1=0x10010001:OSAttr:2:5.1
+
+[CatalogFiles]
+<hash>erllc_uhd_usrp1.inf=erllc_uhd_usrp1.inf
+<hash>erllc_uhd_b100.inf=erllc_uhd_b100.inf
+<hash>erllc_uhd_b200.inf=erllc_uhd_b200.inf
+<hash>erllc_uhd_b200_reinit.inf=erllc_uhd_b200_reinit.inf
+<hash>erllc_uhd_b200mini.inf=erllc_uhd_b200mini.inf
+<hash>erllc_uhd_b205mini.inf=erllc_uhd_b205mini.inf
+<hash>WdfCoInstaller01009.dll=amd64\WdfCoInstaller01009.dll
+<hash>WdfCoInstaller01009.dll=x86\WdfCoInstaller01009.dll
+<hash>winusbcoinstaller2.dll=amd64\winusbcoinstaller2.dll
+<hash>winusbcoinstaller2.dll=x86\winusbcoinstaller2.dll
\ No newline at end of file diff --git a/host/cmake/msvc/erllc_uhd_usrp1.inf b/host/cmake/msvc/erllc_uhd_usrp1.inf index 59c6c0074..c9e38b474 100644 --- a/host/cmake/msvc/erllc_uhd_usrp1.inf +++ b/host/cmake/msvc/erllc_uhd_usrp1.inf @@ -39,22 +39,21 @@ ; ===================================================== DeviceName = "Ettus Research LLC USRP1" -; Make sure "VID_" and "PID_" are always part of the strings below VendorID = "VID_FFFE" ProductID = "PID_0002" DeviceGUID = "{E61C0BFC-4E86-4E82-B1F5-1C3EA28802FC}" DeviceClassGUID = "{78a1c341-4539-11d3-b88d-00c04fad5171}" ; Date MUST be in MM/DD/YYYY format -Date = "09/06/2011" +Date = "03/29/2016" ; ===================================================== ; ========== END USER CONFIGURABLE SECTION ============ ; ===================================================== -ProviderName = "libusb 1.0" +ProviderName = "Ettus Research" WinUSB_SvcDesc = "WinUSB Driver Service" DiskName = "libusb (WinUSB) Device Install Disk" -ClassName = "libusb (WinUSB) devices" +ClassName = "USRPs" ; ====================== Version ====================== @@ -64,7 +63,7 @@ Signature = "$Windows NT$" Class = %ClassName% ClassGuid = %DeviceClassGUID% Provider = %ProviderName% -CatalogFile = libusb_device.cat +CatalogFile = erllc_uhd.cat ; =================== Class section =================== diff --git a/host/cmake/msvc/x86/WdfCoInstaller01009.dll b/host/cmake/msvc/x86/WdfCoInstaller01009.dll Binary files differnew file mode 100644 index 000000000..30e81af62 --- /dev/null +++ b/host/cmake/msvc/x86/WdfCoInstaller01009.dll diff --git a/host/cmake/msvc/x86/winusbcoinstaller2.dll b/host/cmake/msvc/x86/winusbcoinstaller2.dll Binary files differnew file mode 100644 index 000000000..fc450d2b2 --- /dev/null +++ b/host/cmake/msvc/x86/winusbcoinstaller2.dll diff --git a/host/docs/transport.dox b/host/docs/transport.dox index 3922efa85..07aaa3249 100644 --- a/host/docs/transport.dox +++ b/host/docs/transport.dox @@ -83,7 +83,7 @@ Coalescing" settings for your OS and Ethernet chipset. It seems the Intel Ethernet chipsets offer fine-grained control in Linux. Also, consult: -- <http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/interrupt_coal.htm> +- <http://www.ibm.com/support/knowledgecenter/SSQPD3_2.6.0/com.ibm.wllm.doc/batchingnic.html> \subsection transport_udp_linux Linux specific notes diff --git a/host/examples/gpio.cpp b/host/examples/gpio.cpp index b0d15f35a..f0884468b 100644 --- a/host/examples/gpio.cpp +++ b/host/examples/gpio.cpp @@ -80,7 +80,7 @@ #include <boost/assign.hpp> #include <boost/program_options.hpp> #include <boost/format.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/thread.hpp> #include <csignal> #include <iostream> diff --git a/host/include/uhd/rfnoc/block_ctrl_base.hpp b/host/include/uhd/rfnoc/block_ctrl_base.hpp index fa3ceadc5..725f0d966 100644 --- a/host/include/uhd/rfnoc/block_ctrl_base.hpp +++ b/host/include/uhd/rfnoc/block_ctrl_base.hpp @@ -29,7 +29,6 @@ #include <uhd/rfnoc/stream_sig.hpp> #include <uhd/rfnoc/blockdef.hpp> #include <uhd/rfnoc/constants.hpp> -#include <boost/cstdint.hpp> #include <boost/shared_ptr.hpp> #include <boost/lexical_cast.hpp> #include <stdint.h> @@ -142,7 +141,7 @@ public: * \param noc_id The 64-Bit NoC-ID. * \return a shared pointer to a new device instance */ - static sptr make(const make_args_t &make_args, boost::uint64_t noc_id = ~0); + static sptr make(const make_args_t &make_args, uint64_t noc_id = ~0); /*********************************************************************** * Block Communication and Control @@ -152,7 +151,7 @@ public: /*! Returns the 16-Bit address for this block. */ - boost::uint32_t get_address(size_t block_port=0); + uint32_t get_address(size_t block_port=0); /*! Returns the unique block ID for this block (e.g. "0/FFT_1"). */ @@ -178,7 +177,7 @@ public: * \param reg The settings register to write to. * \param data New value of this register. */ - void sr_write(const boost::uint32_t reg, const boost::uint32_t data, const size_t port = 0); + void sr_write(const uint32_t reg, const uint32_t data, const size_t port = 0); /*! Allows setting one register on the settings bus. * @@ -190,7 +189,7 @@ public: * \throw uhd::key_error if \p reg is not a valid register name * */ - void sr_write(const std::string ®, const boost::uint32_t data, const size_t port = 0); + void sr_write(const std::string ®, const uint32_t data, const size_t port = 0); /*! Allows reading one register on the settings bus (64-Bit version). * @@ -199,7 +198,7 @@ public: * * Returns the readback value. */ - boost::uint64_t sr_read64(const settingsbus_reg_t reg, const size_t port = 0); + uint64_t sr_read64(const settingsbus_reg_t reg, const size_t port = 0); /*! Allows reading one register on the settings bus (32-Bit version). * @@ -208,7 +207,7 @@ public: * * Returns the readback value. */ - boost::uint32_t sr_read32(const settingsbus_reg_t reg, const size_t port = 0); + uint32_t sr_read32(const settingsbus_reg_t reg, const size_t port = 0); /*! Allows reading one user-defined register (64-Bit version). * @@ -220,7 +219,7 @@ public: * \param port Port on which to read * \returns the readback value. */ - boost::uint64_t user_reg_read64(const boost::uint32_t addr, const size_t port = 0); + uint64_t user_reg_read64(const uint32_t addr, const size_t port = 0); /*! Allows reading one user-defined register (64-Bit version). * @@ -233,7 +232,7 @@ public: * \returns the readback value. * \throws uhd::key_error if \p reg is not a valid register name */ - boost::uint64_t user_reg_read64(const std::string ®, const size_t port = 0); + uint64_t user_reg_read64(const std::string ®, const size_t port = 0); /*! Allows reading one user-defined register (32-Bit version). * @@ -245,7 +244,7 @@ public: * \param port Port on which to read * \returns the readback value. */ - boost::uint32_t user_reg_read32(const boost::uint32_t addr, const size_t port = 0); + uint32_t user_reg_read32(const uint32_t addr, const size_t port = 0); /*! Allows reading one user-defined register (32-Bit version). * @@ -257,7 +256,7 @@ public: * \returns the readback value. * \throws uhd::key_error if \p reg is not a valid register name */ - boost::uint32_t user_reg_read32(const std::string ®, const size_t port = 0); + uint32_t user_reg_read32(const std::string ®, const size_t port = 0); /*! Sets a command time for all future command packets. diff --git a/host/include/uhd/rfnoc/block_id.hpp b/host/include/uhd/rfnoc/block_id.hpp index a8f2aec5a..e731f20f8 100644 --- a/host/include/uhd/rfnoc/block_id.hpp +++ b/host/include/uhd/rfnoc/block_id.hpp @@ -18,7 +18,7 @@ #define INCLUDED_UHD_TYPES_BLOCK_ID_HPP #include <uhd/config.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/shared_ptr.hpp> #include <iostream> #include <string> diff --git a/host/include/uhd/rfnoc/blockdef.hpp b/host/include/uhd/rfnoc/blockdef.hpp index fc3505d3c..6af8c340c 100644 --- a/host/include/uhd/rfnoc/blockdef.hpp +++ b/host/include/uhd/rfnoc/blockdef.hpp @@ -18,7 +18,7 @@ #ifndef INCLUDED_LIBUHD_RFNOC_BLOCKDEF_HPP #define INCLUDED_LIBUHD_RFNOC_BLOCKDEF_HPP -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/enable_shared_from_this.hpp> #include <uhd/config.hpp> #include <uhd/types/device_addr.hpp> @@ -85,7 +85,7 @@ public: * Note: If nothing is found, returns an * empty sptr. Does not throw. */ - static sptr make_from_noc_id(boost::uint64_t noc_id); + static sptr make_from_noc_id(uint64_t noc_id); //! Returns true if this represents a NoC block virtual bool is_block() const = 0; @@ -100,7 +100,7 @@ public: virtual std::string get_name() const = 0; //! Return the one NoC that is valid for this block - virtual boost::uint64_t noc_id() const = 0; + virtual uint64_t noc_id() const = 0; virtual ports_t get_input_ports() = 0; virtual ports_t get_output_ports() = 0; diff --git a/host/include/uhd/rfnoc/constants.hpp b/host/include/uhd/rfnoc/constants.hpp index 14e0da55c..4135d44e3 100644 --- a/host/include/uhd/rfnoc/constants.hpp +++ b/host/include/uhd/rfnoc/constants.hpp @@ -20,7 +20,7 @@ #include <uhd/types/dict.hpp> #include <boost/assign/list_of.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <string> namespace uhd { @@ -34,7 +34,7 @@ static const std::string XML_PATH_ENV = "UHD_RFNOC_DIR"; //! If the block name can't be automatically detected, this name is used static const std::string DEFAULT_BLOCK_NAME = "Block"; -static const boost::uint64_t DEFAULT_NOC_ID = 0xFFFFFFFFFFFFFFFF; +static const uint64_t DEFAULT_NOC_ID = 0xFFFFFFFFFFFFFFFF; static const size_t MAX_PACKET_SIZE = 8000; // bytes static const size_t DEFAULT_PACKET_SIZE = 1456; // bytes @@ -56,21 +56,21 @@ static const size_t DEFAULT_FC_TX_RESPONSE_FREQ = 8; // ACKs per flow control wi static const double DEFAULT_FC_RX_SW_BUFF_FULL_FACTOR = 0.80; // Common settings registers. -static const boost::uint32_t SR_FLOW_CTRL_CYCS_PER_ACK = 0; -static const boost::uint32_t SR_FLOW_CTRL_PKTS_PER_ACK = 1; -static const boost::uint32_t SR_FLOW_CTRL_WINDOW_SIZE = 2; -static const boost::uint32_t SR_FLOW_CTRL_WINDOW_EN = 3; -static const boost::uint32_t SR_ERROR_POLICY = 4; -static const boost::uint32_t SR_BLOCK_SID = 5; // TODO rename to SRC_SID -static const boost::uint32_t SR_NEXT_DST_SID = 6; -static const boost::uint32_t SR_RESP_IN_DST_SID = 7; -static const boost::uint32_t SR_RESP_OUT_DST_SID = 8; - -static const boost::uint32_t SR_READBACK_ADDR = 124; -static const boost::uint32_t SR_READBACK = 127; - -static const boost::uint32_t SR_CLEAR_RX_FC = 125; -static const boost::uint32_t SR_CLEAR_TX_FC = 126; +static const uint32_t SR_FLOW_CTRL_CYCS_PER_ACK = 0; +static const uint32_t SR_FLOW_CTRL_PKTS_PER_ACK = 1; +static const uint32_t SR_FLOW_CTRL_WINDOW_SIZE = 2; +static const uint32_t SR_FLOW_CTRL_WINDOW_EN = 3; +static const uint32_t SR_ERROR_POLICY = 4; +static const uint32_t SR_BLOCK_SID = 5; // TODO rename to SRC_SID +static const uint32_t SR_NEXT_DST_SID = 6; +static const uint32_t SR_RESP_IN_DST_SID = 7; +static const uint32_t SR_RESP_OUT_DST_SID = 8; + +static const uint32_t SR_READBACK_ADDR = 124; +static const uint32_t SR_READBACK = 127; + +static const uint32_t SR_CLEAR_RX_FC = 125; +static const uint32_t SR_CLEAR_TX_FC = 126; //! Settings register readback enum settingsbus_reg_t { @@ -84,12 +84,12 @@ enum settingsbus_reg_t { }; // AXI stream configuration bus (output master bus of axi wrapper) registers -static const boost::uint32_t AXI_WRAPPER_BASE = 128; -static const boost::uint32_t AXIS_CONFIG_BUS = AXI_WRAPPER_BASE+1; // tdata with tvalid asserted -static const boost::uint32_t AXIS_CONFIG_BUS_TLAST = AXI_WRAPPER_BASE+2; // tdata with tvalid & tlast asserted +static const uint32_t AXI_WRAPPER_BASE = 128; +static const uint32_t AXIS_CONFIG_BUS = AXI_WRAPPER_BASE+1; // tdata with tvalid asserted +static const uint32_t AXIS_CONFIG_BUS_TLAST = AXI_WRAPPER_BASE+2; // tdata with tvalid & tlast asserted // Named settings registers -static const uhd::dict<std::string, boost::uint32_t> DEFAULT_NAMED_SR = boost::assign::map_list_of +static const uhd::dict<std::string, uint32_t> DEFAULT_NAMED_SR = boost::assign::map_list_of ("AXIS_CONFIG_BUS", AXIS_CONFIG_BUS) ("AXIS_CONFIG_BUS_TLAST", AXIS_CONFIG_BUS_TLAST) ; diff --git a/host/include/uhd/rfnoc/node_ctrl_base.hpp b/host/include/uhd/rfnoc/node_ctrl_base.hpp index bf799d2c2..6fd6fd288 100644 --- a/host/include/uhd/rfnoc/node_ctrl_base.hpp +++ b/host/include/uhd/rfnoc/node_ctrl_base.hpp @@ -21,7 +21,7 @@ #include <uhd/types/device_addr.hpp> #include <uhd/rfnoc/constants.hpp> #include <uhd/utils/log.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/shared_ptr.hpp> #include <boost/utility.hpp> #include <boost/enable_shared_from_this.hpp> diff --git a/host/include/uhd/rfnoc/source_block_ctrl_base.hpp b/host/include/uhd/rfnoc/source_block_ctrl_base.hpp index 02882307c..7d90bb2f0 100644 --- a/host/include/uhd/rfnoc/source_block_ctrl_base.hpp +++ b/host/include/uhd/rfnoc/source_block_ctrl_base.hpp @@ -95,7 +95,7 @@ public: * have bit 16 set to 1, since some blocks require this to respect this value. */ virtual void set_destination( - boost::uint32_t next_address, + uint32_t next_address, size_t output_block_port = 0 ); diff --git a/host/include/uhd/transport/chdr.hpp b/host/include/uhd/transport/chdr.hpp index 5e8cd58a9..fa2ae074e 100644 --- a/host/include/uhd/transport/chdr.hpp +++ b/host/include/uhd/transport/chdr.hpp @@ -59,7 +59,7 @@ namespace chdr{ * \param if_packet_info the if packet info (read/write) */ UHD_API void if_hdr_pack_be( - boost::uint32_t *packet_buff, + uint32_t *packet_buff, if_packet_info_t &if_packet_info ); @@ -73,7 +73,7 @@ namespace chdr{ * \param if_packet_info the if packet info (read/write) */ UHD_API void if_hdr_unpack_be( - const boost::uint32_t *packet_buff, + const uint32_t *packet_buff, if_packet_info_t &if_packet_info ); @@ -87,7 +87,7 @@ namespace chdr{ * \param if_packet_info the if packet info (read/write) */ UHD_API void if_hdr_pack_le( - boost::uint32_t *packet_buff, + uint32_t *packet_buff, if_packet_info_t &if_packet_info ); @@ -101,7 +101,7 @@ namespace chdr{ * \param if_packet_info the if packet info (read/write) */ UHD_API void if_hdr_unpack_le( - const boost::uint32_t *packet_buff, + const uint32_t *packet_buff, if_packet_info_t &if_packet_info ); diff --git a/host/include/uhd/transport/nirio/rpc/rpc_client.hpp b/host/include/uhd/transport/nirio/rpc/rpc_client.hpp index f90034e37..78761c1fc 100644 --- a/host/include/uhd/transport/nirio/rpc/rpc_client.hpp +++ b/host/include/uhd/transport/nirio/rpc/rpc_client.hpp @@ -30,14 +30,14 @@ namespace uhd { namespace usrprio_rpc { class rpc_client : private boost::noncopyable { public: - static const boost::uint32_t CURRENT_VERSION = 1; - static const boost::uint32_t OLDEST_COMPATIBLE_VERSION = 1; + static const uint32_t CURRENT_VERSION = 1; + static const uint32_t OLDEST_COMPATIBLE_VERSION = 1; 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); ~rpc_client(); const boost::system::error_code& call( diff --git a/host/include/uhd/transport/nirio/rpc/rpc_common.hpp b/host/include/uhd/transport/nirio/rpc/rpc_common.hpp index ea5b3337d..578ff2fe1 100644 --- a/host/include/uhd/transport/nirio/rpc/rpc_common.hpp +++ b/host/include/uhd/transport/nirio/rpc/rpc_common.hpp @@ -31,25 +31,26 @@ #include <boost/archive/text_oarchive.hpp> #include <boost/archive/text_iarchive.hpp> #endif +#include <stdint.h> namespace uhd { namespace usrprio_rpc { //[Over-the-wire] IDs -typedef boost::int32_t func_id_t; -typedef boost::uint64_t client_id_t; +typedef int32_t func_id_t; +typedef uint64_t client_id_t; #define build_client_id(host_id, process_id) \ - ((static_cast<boost::uint64_t>(host_id) << 32) | static_cast<boost::uint64_t>(process_id)) + ((static_cast<uint64_t>(host_id) << 32) | static_cast<uint64_t>(process_id)) #define get_process_id_from_client_id(client_id) \ - (static_cast<boost::int32_t>(client_id)) + (static_cast<int32_t>(client_id)) #define get_host_id_from_client_id(client_id) \ - (static_cast<boost::uint32_t>(client_id >> 32)) + (static_cast<uint32_t>(client_id >> 32)) //[Over-the-wire] Handshake format struct hshake_args_t { - boost::uint32_t version; - boost::uint32_t oldest_comp_version; - boost::int32_t boost_archive_version; + uint32_t version; + uint32_t oldest_comp_version; + int32_t boost_archive_version; client_id_t client_id; }; @@ -58,7 +59,7 @@ class func_args_header_t { public: func_id_t func_id; client_id_t client_id; - boost::uint32_t func_args_size; + uint32_t func_args_size; static bool match_function(const func_args_header_t& a, const func_args_header_t& b) { return ((a.func_id == b.func_id) && (a.client_id == b.client_id)); @@ -139,7 +140,7 @@ private: class boost_serialization_archive_utils { public: - static boost::int32_t get_version() { + static int32_t get_version() { #if (USE_BINARY_ARCHIVE) typedef boost::archive::binary_oarchive archive_t; #else @@ -147,7 +148,7 @@ public: #endif std::ostringstream stream; archive_t dummy_archive(stream, boost::archive::no_header); - return static_cast<boost::int32_t>(dummy_archive.get_library_version()); + return static_cast<int32_t>(dummy_archive.get_library_version()); } }; diff --git a/host/include/uhd/transport/nirio/rpc/usrprio_rpc_client.hpp b/host/include/uhd/transport/nirio/rpc/usrprio_rpc_client.hpp index 4b205cceb..b9600f99f 100644 --- a/host/include/uhd/transport/nirio/rpc/usrprio_rpc_client.hpp +++ b/host/include/uhd/transport/nirio/rpc/usrprio_rpc_client.hpp @@ -55,7 +55,7 @@ public: nirio_status niusrprio_download_fpga_to_flash( NIUSRPRIO_DOWNLOAD_FPGA_TO_FLASH_ARGS); - static const boost::int64_t DEFAULT_TIMEOUT_IN_MS = 5000; + static const int64_t DEFAULT_TIMEOUT_IN_MS = 5000; private: static nirio_status _boost_error_to_nirio_status(const boost::system::error_code& err); diff --git a/host/include/uhd/transport/nirio/rpc/usrprio_rpc_common.hpp b/host/include/uhd/transport/nirio/rpc/usrprio_rpc_common.hpp index 362d9a174..23b260a89 100644 --- a/host/include/uhd/transport/nirio/rpc/usrprio_rpc_common.hpp +++ b/host/include/uhd/transport/nirio/rpc/usrprio_rpc_common.hpp @@ -37,7 +37,7 @@ static const func_id_t NIUSRPRIO_DOWNLOAD_FPGA_TO_FLASH = NIUSRPRIO_FUNC_BAS //Function Args struct usrprio_device_info { - boost::uint32_t interface_num; + uint32_t interface_num; std::string resource_name; std::string pcie_serial_num; std::string interface_path; @@ -62,7 +62,7 @@ typedef std::vector<usrprio_device_info> usrprio_device_info_vtr; const std::string& resource, \ const std::string& path, \ const std::string& signature, \ - const boost::uint16_t& download_fpga + const uint16_t& download_fpga #define NIUSRPRIO_CLOSE_SESSION_ARGS \ const std::string& resource diff --git a/host/include/uhd/transport/usb_control.hpp b/host/include/uhd/transport/usb_control.hpp index 4576d6e92..5576b29a5 100644 --- a/host/include/uhd/transport/usb_control.hpp +++ b/host/include/uhd/transport/usb_control.hpp @@ -56,13 +56,13 @@ public: * \param timeout 4-byte (timeout, default is infinite wait) * \return number of bytes submitted or error code */ - virtual int submit(boost::uint8_t request_type, - boost::uint8_t request, - boost::uint16_t value, - boost::uint16_t index, + virtual 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 timeout = 0) = 0; + uint16_t length, + uint32_t timeout = 0) = 0; }; }} //namespace diff --git a/host/include/uhd/transport/usb_device_handle.hpp b/host/include/uhd/transport/usb_device_handle.hpp index a8bbfc965..06f24371c 100644 --- a/host/include/uhd/transport/usb_device_handle.hpp +++ b/host/include/uhd/transport/usb_device_handle.hpp @@ -21,7 +21,7 @@ #include <uhd/config.hpp> #include <boost/utility.hpp> #include <boost/shared_ptr.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <vector> namespace uhd { namespace transport { @@ -41,7 +41,7 @@ namespace uhd { namespace transport { class UHD_API usb_device_handle : boost::noncopyable { public: typedef boost::shared_ptr<usb_device_handle> sptr; - typedef std::pair<boost::uint16_t, boost::uint16_t> vid_pid_pair_t; + typedef std::pair<uint16_t, uint16_t> vid_pid_pair_t; virtual ~usb_device_handle(void); @@ -67,13 +67,13 @@ public: * Return the device's Vendor ID (usually assigned by the USB-IF) * \return a Vendor ID */ - virtual boost::uint16_t get_vendor_id() const = 0; + virtual uint16_t get_vendor_id() const = 0; /*! * Return the device's Product ID (usually assigned by manufacturer) * \return a Product ID */ - virtual boost::uint16_t get_product_id() const = 0; + virtual uint16_t get_product_id() const = 0; /*! * Test whether the firmware is loaded on the device. @@ -85,7 +85,7 @@ public: * Return a vector of USB devices on this host * \return a vector of USB device handles that match vid and pid */ - static std::vector<usb_device_handle::sptr> get_device_list(boost::uint16_t vid, boost::uint16_t pid); + static std::vector<usb_device_handle::sptr> get_device_list(uint16_t vid, uint16_t pid); static std::vector<usb_device_handle::sptr> get_device_list(const std::vector<usb_device_handle::vid_pid_pair_t>& vid_pid_pair_list); diff --git a/host/include/uhd/transport/vrt_if_packet.hpp b/host/include/uhd/transport/vrt_if_packet.hpp index 0150e7f13..7d0123c42 100644 --- a/host/include/uhd/transport/vrt_if_packet.hpp +++ b/host/include/uhd/transport/vrt_if_packet.hpp @@ -19,7 +19,7 @@ #define INCLUDED_UHD_TRANSPORT_VRT_IF_PACKET_HPP #include <uhd/config.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <cstddef> //size_t namespace uhd{ namespace transport{ @@ -81,15 +81,15 @@ namespace vrt{ //optional fields //! Stream ID (SID). See uhd::sid_t - bool has_sid; boost::uint32_t sid; + bool has_sid; uint32_t sid; //! Class ID. - bool has_cid; boost::uint64_t cid; + bool has_cid; uint64_t cid; //! Integer timestamp - bool has_tsi; boost::uint32_t tsi; + bool has_tsi; uint32_t tsi; //! Fractional timestamp - bool has_tsf; boost::uint64_t tsf; + bool has_tsf; uint64_t tsf; //! Trailer - bool has_tlr; boost::uint32_t tlr; + bool has_tlr; uint32_t tlr; }; /*! @@ -118,7 +118,7 @@ namespace vrt{ * \param if_packet_info the if packet info (read/write) */ UHD_API void if_hdr_pack_be( - boost::uint32_t *packet_buff, + uint32_t *packet_buff, if_packet_info_t &if_packet_info ); @@ -156,7 +156,7 @@ namespace vrt{ * \param if_packet_info the if packet info (read/write) */ UHD_API void if_hdr_unpack_be( - const boost::uint32_t *packet_buff, + const uint32_t *packet_buff, if_packet_info_t &if_packet_info ); @@ -169,7 +169,7 @@ namespace vrt{ * \param if_packet_info the if packet info (read/write) */ UHD_API void if_hdr_pack_le( - boost::uint32_t *packet_buff, + uint32_t *packet_buff, if_packet_info_t &if_packet_info ); @@ -182,7 +182,7 @@ namespace vrt{ * \param if_packet_info the if packet info (read/write) */ UHD_API void if_hdr_unpack_le( - const boost::uint32_t *packet_buff, + const uint32_t *packet_buff, if_packet_info_t &if_packet_info ); diff --git a/host/include/uhd/types/byte_vector.hpp b/host/include/uhd/types/byte_vector.hpp index b7637fb5d..619a74d61 100644 --- a/host/include/uhd/types/byte_vector.hpp +++ b/host/include/uhd/types/byte_vector.hpp @@ -23,14 +23,14 @@ #include <vector> #include <boost/assign.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <uhd/config.hpp> namespace uhd{ //! Byte vector used for I2C data passing and EEPROM parsing. - typedef std::vector<boost::uint8_t> byte_vector_t; + typedef std::vector<uint8_t> byte_vector_t; template<typename RangeSrc, typename RangeDst> UHD_INLINE void byte_copy(const RangeSrc &src, RangeDst &dst){ diff --git a/host/include/uhd/types/filters.hpp b/host/include/uhd/types/filters.hpp index 2c30c1007..e3756b7a5 100644 --- a/host/include/uhd/types/filters.hpp +++ b/host/include/uhd/types/filters.hpp @@ -21,7 +21,7 @@ #include <uhd/config.hpp> #include <uhd/utils/log.hpp> #include <uhd/utils/msg.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/shared_ptr.hpp> #include <boost/scoped_array.hpp> #include <string> @@ -151,10 +151,10 @@ namespace uhd{ { protected: double _rate; - boost::uint32_t _interpolation; - boost::uint32_t _decimation; + uint32_t _interpolation; + uint32_t _decimation; tap_t _tap_full_scale; - boost::uint32_t _max_num_taps; + uint32_t _max_num_taps; std::vector<tap_t> _taps; public: diff --git a/host/include/uhd/types/metadata.hpp b/host/include/uhd/types/metadata.hpp index c4fe00271..53d633f83 100644 --- a/host/include/uhd/types/metadata.hpp +++ b/host/include/uhd/types/metadata.hpp @@ -20,7 +20,7 @@ #include <uhd/config.hpp> #include <uhd/types/time_spec.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <string> namespace uhd{ @@ -199,7 +199,7 @@ namespace uhd{ /*! * A special payload populated by custom FPGA fabric. */ - boost::uint32_t user_payload[4]; + uint32_t user_payload[4]; }; diff --git a/host/include/uhd/types/serial.hpp b/host/include/uhd/types/serial.hpp index cb90d7c71..caa95adf9 100644 --- a/host/include/uhd/types/serial.hpp +++ b/host/include/uhd/types/serial.hpp @@ -20,7 +20,7 @@ #include <uhd/config.hpp> #include <boost/shared_ptr.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <vector> namespace uhd{ @@ -28,7 +28,7 @@ namespace uhd{ /*! * Byte vector typedef for passing data in and out of I2C interfaces. */ - typedef std::vector<boost::uint8_t> byte_vector_t; + typedef std::vector<uint8_t> byte_vector_t; /*! * The i2c interface class: @@ -57,7 +57,7 @@ namespace uhd{ * \param buf the vector of bytes */ virtual void write_i2c( - boost::uint16_t addr, + uint16_t addr, const byte_vector_t &buf ) = 0; @@ -68,7 +68,7 @@ namespace uhd{ * \return a vector of bytes */ virtual byte_vector_t read_i2c( - boost::uint16_t addr, + uint16_t addr, size_t num_bytes ) = 0; @@ -79,8 +79,8 @@ namespace uhd{ * \param buf the vector of bytes */ virtual void write_eeprom( - boost::uint16_t addr, - boost::uint16_t offset, + uint16_t addr, + uint16_t offset, const byte_vector_t &buf ); @@ -92,8 +92,8 @@ namespace uhd{ * \return a vector of bytes */ virtual byte_vector_t read_eeprom( - boost::uint16_t addr, - boost::uint16_t offset, + uint16_t addr, + uint16_t offset, size_t num_bytes ); }; @@ -150,10 +150,10 @@ namespace uhd{ * \param readback true to readback a value * \return spi data if readback set */ - virtual boost::uint32_t transact_spi( + virtual uint32_t transact_spi( int which_slave, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits, bool readback ) = 0; @@ -166,10 +166,10 @@ namespace uhd{ * \param num_bits how many bits in data * \return spi data */ - virtual boost::uint32_t read_spi( + virtual uint32_t read_spi( int which_slave, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ); @@ -183,7 +183,7 @@ namespace uhd{ virtual void write_spi( int which_slave, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ); }; diff --git a/host/include/uhd/types/wb_iface.hpp b/host/include/uhd/types/wb_iface.hpp index e24e9363e..95f8392a9 100644 --- a/host/include/uhd/types/wb_iface.hpp +++ b/host/include/uhd/types/wb_iface.hpp @@ -20,7 +20,7 @@ #include <uhd/config.hpp> #include <uhd/types/time_spec.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/shared_ptr.hpp> namespace uhd @@ -30,7 +30,7 @@ class UHD_API wb_iface { public: typedef boost::shared_ptr<wb_iface> sptr; - typedef boost::uint32_t wb_addr_type; + typedef uint32_t wb_addr_type; virtual ~wb_iface(void); @@ -39,42 +39,42 @@ public: * \param addr the address * \param data the 64bit data */ - virtual void poke64(const wb_addr_type addr, const boost::uint64_t data); + virtual void poke64(const wb_addr_type addr, const uint64_t data); /*! * Read a register (64 bits) * \param addr the address * \return the 64bit data */ - virtual boost::uint64_t peek64(const wb_addr_type addr); + virtual uint64_t peek64(const wb_addr_type addr); /*! * Write a register (32 bits) * \param addr the address * \param data the 32bit data */ - virtual void poke32(const wb_addr_type addr, const boost::uint32_t data); + virtual void poke32(const wb_addr_type addr, const uint32_t data); /*! * Read a register (32 bits) * \param addr the address * \return the 32bit data */ - virtual boost::uint32_t peek32(const wb_addr_type addr); + virtual uint32_t peek32(const wb_addr_type addr); /*! * Write a register (16 bits) * \param addr the address * \param data the 16bit data */ - virtual void poke16(const wb_addr_type addr, const boost::uint16_t data); + virtual void poke16(const wb_addr_type addr, const uint16_t data); /*! * Read a register (16 bits) * \param addr the address * \return the 16bit data */ - virtual boost::uint16_t peek16(const wb_addr_type addr); + virtual uint16_t peek16(const wb_addr_type addr); }; class UHD_API timed_wb_iface : public wb_iface diff --git a/host/include/uhd/usrp/dboard_eeprom.hpp b/host/include/uhd/usrp/dboard_eeprom.hpp index 93fc5ac7d..6565130e5 100644 --- a/host/include/uhd/usrp/dboard_eeprom.hpp +++ b/host/include/uhd/usrp/dboard_eeprom.hpp @@ -46,14 +46,14 @@ struct UHD_API dboard_eeprom_t{ * \param iface the serial interface with i2c * \param addr the i2c address for the eeprom */ - void load(i2c_iface &iface, boost::uint8_t addr); + void load(i2c_iface &iface, uint8_t addr); /*! * Store the object to bytes in the eeprom. * \param iface the serial interface with i2c * \param addr the i2c address for the eeprom */ - void store(i2c_iface &iface, boost::uint8_t addr) const; + void store(i2c_iface &iface, uint8_t addr) const; }; diff --git a/host/include/uhd/usrp/dboard_id.hpp b/host/include/uhd/usrp/dboard_id.hpp index 1fda8182e..52d0e7d73 100644 --- a/host/include/uhd/usrp/dboard_id.hpp +++ b/host/include/uhd/usrp/dboard_id.hpp @@ -19,7 +19,7 @@ #define INCLUDED_UHD_USRP_DBOARD_ID_HPP #include <uhd/config.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/operators.hpp> #include <string> @@ -31,7 +31,7 @@ namespace uhd{ namespace usrp{ * Create a dboard id from an integer. * \param id the integer representation */ - dboard_id_t(boost::uint16_t id = 0xffff); + dboard_id_t(uint16_t id = 0xffff); /*! * Obtain a dboard id that represents no dboard. @@ -44,13 +44,13 @@ namespace uhd{ namespace usrp{ * \param uint16 an unsigned 16 bit integer * \return a new dboard id containing the integer */ - static dboard_id_t from_uint16(boost::uint16_t uint16); + static dboard_id_t from_uint16(uint16_t uint16); /*! * Get the dboard id represented as an integer. * \return an unsigned 16 bit integer representation */ - boost::uint16_t to_uint16(void) const; + uint16_t to_uint16(void) const; /*! * Create a new dboard id from a string representation. @@ -79,7 +79,7 @@ namespace uhd{ namespace usrp{ std::string to_pp_string(void) const; private: - boost::uint16_t _id; //internal representation + uint16_t _id; //internal representation }; /*! diff --git a/host/include/uhd/usrp/dboard_iface.hpp b/host/include/uhd/usrp/dboard_iface.hpp index 7c730f59d..0c4e45f1d 100644 --- a/host/include/uhd/usrp/dboard_iface.hpp +++ b/host/include/uhd/usrp/dboard_iface.hpp @@ -25,7 +25,7 @@ #include <uhd/usrp/fe_connection.hpp> #include <uhd/usrp/gpio_defs.hpp> #include <boost/shared_ptr.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/thread/thread.hpp> #include <string> #include <vector> @@ -123,7 +123,7 @@ public: * \param mask 16-bits, 0=do not change, 1=change value */ virtual void set_pin_ctrl( - unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffff + unit_t unit, uint32_t value, uint32_t mask = 0xffff ) = 0; /*! @@ -132,7 +132,7 @@ public: * \param unit which unit rx or tx * \return the 16-bit settings value */ - virtual boost::uint32_t get_pin_ctrl(unit_t unit) = 0; + virtual uint32_t get_pin_ctrl(unit_t unit) = 0; /*! * Set a daughterboard ATR register. @@ -143,7 +143,7 @@ public: * \param mask 16-bits, 0=do not change, 1=change value */ virtual void set_atr_reg( - unit_t unit, atr_reg_t reg, boost::uint32_t value, boost::uint32_t mask = 0xffff + unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask = 0xffff ) = 0; /*! @@ -153,7 +153,7 @@ public: * \param reg which ATR register * \return the 16-bit settings value */ - virtual boost::uint32_t get_atr_reg(unit_t unit, atr_reg_t reg) = 0; + virtual uint32_t get_atr_reg(unit_t unit, atr_reg_t reg) = 0; /*! * Set daughterboard GPIO data direction setting. @@ -163,7 +163,7 @@ public: * \param mask 16-bits, 0=do not change, 1=change value */ virtual void set_gpio_ddr( - unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffff + unit_t unit, uint32_t value, uint32_t mask = 0xffff ) = 0; /*! @@ -172,7 +172,7 @@ public: * \param unit which unit rx or tx * \return the 16-bit settings value */ - virtual boost::uint32_t get_gpio_ddr(unit_t unit) = 0; + virtual uint32_t get_gpio_ddr(unit_t unit) = 0; /*! * Set daughterboard GPIO pin output setting. @@ -182,7 +182,7 @@ public: * \param mask 16-bits, 0=do not change, 1=change value */ virtual void set_gpio_out( - unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffff + unit_t unit, uint32_t value, uint32_t mask = 0xffff ) = 0; /*! @@ -191,7 +191,7 @@ public: * \param unit which unit rx or tx * \return the 16-bit settings value */ - virtual boost::uint32_t get_gpio_out(unit_t unit) = 0; + virtual uint32_t get_gpio_out(unit_t unit) = 0; /*! * Read daughterboard GPIO pin values. @@ -199,7 +199,7 @@ public: * \param unit which unit rx or tx * \return the value of the gpio unit */ - virtual boost::uint32_t read_gpio(unit_t unit) = 0; + virtual uint32_t read_gpio(unit_t unit) = 0; /*! * Write data to SPI bus peripheral. @@ -212,7 +212,7 @@ public: virtual void write_spi( unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ) = 0; @@ -225,10 +225,10 @@ public: * \param num_bits the number of bits in data * \return the data that was read */ - virtual boost::uint32_t read_write_spi( + virtual uint32_t read_write_spi( unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ) = 0; diff --git a/host/include/uhd/usrp/multi_usrp.hpp b/host/include/uhd/usrp/multi_usrp.hpp index f0029c1af..1a64a8f3a 100644 --- a/host/include/uhd/usrp/multi_usrp.hpp +++ b/host/include/uhd/usrp/multi_usrp.hpp @@ -405,7 +405,7 @@ public: * \param data 32-bit register value * \param mboard which motherboard to set the user register */ - virtual void set_user_register(const boost::uint8_t addr, const boost::uint32_t data, size_t mboard = ALL_MBOARDS) = 0; + virtual void set_user_register(const uint8_t addr, const uint32_t data, size_t mboard = ALL_MBOARDS) = 0; /******************************************************************* * RX methods @@ -1051,7 +1051,7 @@ public: * \param mask the bit mask to effect which pins are changed * \param mboard the motherboard index 0 to M-1 */ - virtual void set_gpio_attr(const std::string &bank, const std::string &attr, const boost::uint32_t value, const boost::uint32_t mask = 0xffffffff, const size_t mboard = 0) = 0; + virtual void set_gpio_attr(const std::string &bank, const std::string &attr, const uint32_t value, const uint32_t mask = 0xffffffff, const size_t mboard = 0) = 0; /*! * Get a GPIO attribute on a particular GPIO bank. @@ -1069,7 +1069,7 @@ public: * \param mboard the motherboard index 0 to M-1 * \return the value set for this attribute */ - virtual boost::uint32_t get_gpio_attr(const std::string &bank, const std::string &attr, const size_t mboard = 0) = 0; + virtual uint32_t get_gpio_attr(const std::string &bank, const std::string &attr, const size_t mboard = 0) = 0; /******************************************************************* * Register IO methods @@ -1102,7 +1102,7 @@ public: * \param value the value to write to the register field * \param mboard the motherboard index 0 to M-1 */ - virtual void write_register(const std::string &path, const boost::uint32_t field, const boost::uint64_t value, const size_t mboard = 0) = 0; + virtual void write_register(const std::string &path, const uint32_t field, const uint64_t value, const size_t mboard = 0) = 0; /*! * Read a low-level register field from a register in the USRP hardware @@ -1111,7 +1111,7 @@ public: * \param mboard the motherboard index 0 to M-1 * \return the value of the register field */ - virtual boost::uint64_t read_register(const std::string &path, const boost::uint32_t field, const size_t mboard = 0) = 0; + virtual uint64_t read_register(const std::string &path, const uint32_t field, const size_t mboard = 0) = 0; /******************************************************************* * Filter API methods diff --git a/host/include/uhd/usrp_clock/multi_usrp_clock.hpp b/host/include/uhd/usrp_clock/multi_usrp_clock.hpp index 48d433d71..0fbaa3136 100644 --- a/host/include/uhd/usrp_clock/multi_usrp_clock.hpp +++ b/host/include/uhd/usrp_clock/multi_usrp_clock.hpp @@ -83,7 +83,7 @@ public: virtual size_t get_num_boards(void) = 0; //! Get time from device - virtual boost::uint32_t get_time(size_t board = 0) = 0; + virtual uint32_t get_time(size_t board = 0) = 0; /*! * Get a USRP Clock sensor value. diff --git a/host/include/uhd/usrp_clock/octoclock_eeprom.hpp b/host/include/uhd/usrp_clock/octoclock_eeprom.hpp index aaa6296ae..6cd551e7f 100644 --- a/host/include/uhd/usrp_clock/octoclock_eeprom.hpp +++ b/host/include/uhd/usrp_clock/octoclock_eeprom.hpp @@ -42,7 +42,7 @@ public: * \param transport the UDP transport to the OctoClock * \param proto_ver firmware protocol version */ - octoclock_eeprom_t(transport::udp_simple::sptr transport, boost::uint32_t proto_ver); + octoclock_eeprom_t(transport::udp_simple::sptr transport, uint32_t proto_ver); /*! * Write the contents of this object to the EEPROM. @@ -51,7 +51,7 @@ public: private: transport::udp_simple::sptr xport; - boost::uint32_t _proto_ver; + uint32_t _proto_ver; void _load(); void _store() const; diff --git a/host/include/uhd/utils/algorithm.hpp b/host/include/uhd/utils/algorithm.hpp index 6c6cdf033..1c4d7101c 100644 --- a/host/include/uhd/utils/algorithm.hpp +++ b/host/include/uhd/utils/algorithm.hpp @@ -19,7 +19,7 @@ #define INCLUDED_UHD_UTILS_ALGORITHM_HPP #include <algorithm> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/range/begin.hpp> #include <boost/range/end.hpp> diff --git a/host/include/uhd/utils/atomic.hpp b/host/include/uhd/utils/atomic.hpp index 8da71b359..f37fb4395 100644 --- a/host/include/uhd/utils/atomic.hpp +++ b/host/include/uhd/utils/atomic.hpp @@ -40,31 +40,31 @@ namespace uhd{ } //! Compare with cmp, swap with newval if same, return old value - UHD_INLINE boost::uint32_t cas(boost::uint32_t newval, boost::uint32_t cmp){ + UHD_INLINE uint32_t cas(uint32_t newval, uint32_t cmp){ return BOOST_IPC_DETAIL::atomic_cas32(&_num, newval, cmp); } //! Sets the atomic integer to a new value - UHD_INLINE void write(const boost::uint32_t newval){ + UHD_INLINE void write(const uint32_t newval){ BOOST_IPC_DETAIL::atomic_write32(&_num, newval); } //! Gets the current value of the atomic integer - UHD_INLINE boost::uint32_t read(void){ + UHD_INLINE uint32_t read(void){ return BOOST_IPC_DETAIL::atomic_read32(&_num); } //! Increment by 1 and return the old value - UHD_INLINE boost::uint32_t inc(void){ + UHD_INLINE uint32_t inc(void){ return BOOST_IPC_DETAIL::atomic_inc32(&_num); } //! Decrement by 1 and return the old value - UHD_INLINE boost::uint32_t dec(void){ + UHD_INLINE uint32_t dec(void){ return BOOST_IPC_DETAIL::atomic_dec32(&_num); } - private: volatile boost::uint32_t _num; + private: volatile uint32_t _num; }; /*! @@ -76,7 +76,7 @@ namespace uhd{ */ UHD_INLINE bool spin_wait_with_timeout( atomic_uint32_t &cond, - boost::uint32_t value, + uint32_t value, const double timeout ){ if (cond.read() == value) return true; diff --git a/host/include/uhd/utils/byteswap.hpp b/host/include/uhd/utils/byteswap.hpp index 8e3b7dc8a..bd2fb05de 100644 --- a/host/include/uhd/utils/byteswap.hpp +++ b/host/include/uhd/utils/byteswap.hpp @@ -19,7 +19,7 @@ #define INCLUDED_UHD_UTILS_BYTESWAP_HPP #include <uhd/config.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> /*! \file byteswap.hpp * @@ -29,13 +29,13 @@ namespace uhd{ //! perform a byteswap on a 16 bit integer - boost::uint16_t byteswap(boost::uint16_t); + uint16_t byteswap(uint16_t); //! perform a byteswap on a 32 bit integer - boost::uint32_t byteswap(boost::uint32_t); + uint32_t byteswap(uint32_t); //! perform a byteswap on a 64 bit integer - boost::uint64_t byteswap(boost::uint64_t); + uint64_t byteswap(uint64_t); //! network to host: short, long, or long-long template<typename T> T ntohx(T); diff --git a/host/include/uhd/utils/byteswap.ipp b/host/include/uhd/utils/byteswap.ipp index f6c9407b6..fc15d8a0a 100644 --- a/host/include/uhd/utils/byteswap.ipp +++ b/host/include/uhd/utils/byteswap.ipp @@ -24,74 +24,74 @@ #if defined(BOOST_MSVC) //http://msdn.microsoft.com/en-us/library/a3140177%28VS.80%29.aspx #include <cstdlib> - UHD_INLINE boost::uint16_t uhd::byteswap(boost::uint16_t x){ + UHD_INLINE uint16_t uhd::byteswap(uint16_t x){ return _byteswap_ushort(x); } - UHD_INLINE boost::uint32_t uhd::byteswap(boost::uint32_t x){ + UHD_INLINE uint32_t uhd::byteswap(uint32_t x){ return _byteswap_ulong(x); } - UHD_INLINE boost::uint64_t uhd::byteswap(boost::uint64_t x){ + UHD_INLINE uint64_t uhd::byteswap(uint64_t x){ return _byteswap_uint64(x); } #elif defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 - UHD_INLINE boost::uint16_t uhd::byteswap(boost::uint16_t x){ + UHD_INLINE uint16_t uhd::byteswap(uint16_t x){ return (x>>8) | (x<<8); //DNE return __builtin_bswap16(x); } - UHD_INLINE boost::uint32_t uhd::byteswap(boost::uint32_t x){ + UHD_INLINE uint32_t uhd::byteswap(uint32_t x){ return __builtin_bswap32(x); } - UHD_INLINE boost::uint64_t uhd::byteswap(boost::uint64_t x){ + UHD_INLINE uint64_t uhd::byteswap(uint64_t x){ return __builtin_bswap64(x); } #elif defined(UHD_PLATFORM_MACOS) #include <libkern/OSByteOrder.h> - UHD_INLINE boost::uint16_t uhd::byteswap(boost::uint16_t x){ + UHD_INLINE uint16_t uhd::byteswap(uint16_t x){ return OSSwapInt16(x); } - UHD_INLINE boost::uint32_t uhd::byteswap(boost::uint32_t x){ + UHD_INLINE uint32_t uhd::byteswap(uint32_t x){ return OSSwapInt32(x); } - UHD_INLINE boost::uint64_t uhd::byteswap(boost::uint64_t x){ + UHD_INLINE uint64_t uhd::byteswap(uint64_t x){ return OSSwapInt64(x); } #elif defined(UHD_PLATFORM_LINUX) #include <byteswap.h> - UHD_INLINE boost::uint16_t uhd::byteswap(boost::uint16_t x){ + UHD_INLINE uint16_t uhd::byteswap(uint16_t x){ return bswap_16(x); } - UHD_INLINE boost::uint32_t uhd::byteswap(boost::uint32_t x){ + UHD_INLINE uint32_t uhd::byteswap(uint32_t x){ return bswap_32(x); } - UHD_INLINE boost::uint64_t uhd::byteswap(boost::uint64_t x){ + UHD_INLINE uint64_t uhd::byteswap(uint64_t x){ return bswap_64(x); } #else //http://www.koders.com/c/fidB93B34CD44F0ECF724F1A4EAE3854BA2FE692F59.aspx - UHD_INLINE boost::uint16_t uhd::byteswap(boost::uint16_t x){ + UHD_INLINE uint16_t uhd::byteswap(uint16_t x){ return (x>>8) | (x<<8); } - UHD_INLINE boost::uint32_t uhd::byteswap(boost::uint32_t x){ - return (boost::uint32_t(uhd::byteswap(boost::uint16_t(x&0xfffful)))<<16) | (uhd::byteswap(boost::uint16_t(x>>16))); + UHD_INLINE uint32_t uhd::byteswap(uint32_t x){ + return (uint32_t(uhd::byteswap(uint16_t(x&0xfffful)))<<16) | (uhd::byteswap(uint16_t(x>>16))); } - UHD_INLINE boost::uint64_t uhd::byteswap(boost::uint64_t x){ - return (boost::uint64_t(uhd::byteswap(boost::uint32_t(x&0xffffffffull)))<<32) | (uhd::byteswap(boost::uint32_t(x>>32))); + UHD_INLINE uint64_t uhd::byteswap(uint64_t x){ + return (uint64_t(uhd::byteswap(uint32_t(x&0xffffffffull)))<<32) | (uhd::byteswap(uint32_t(x>>32))); } #endif diff --git a/host/include/uhd/utils/cast.hpp b/host/include/uhd/utils/cast.hpp index 869d53053..471e89bfe 100644 --- a/host/include/uhd/utils/cast.hpp +++ b/host/include/uhd/utils/cast.hpp @@ -26,7 +26,7 @@ namespace uhd{ namespace cast{ //! Convert a hexadecimal string into a value. // // Example: - // boost::uint16_t x = hexstr_cast<boost::uint16_t>("0xDEADBEEF"); + // uint16_t x = hexstr_cast<uint16_t>("0xDEADBEEF"); // Uses stringstream. template<typename T> UHD_INLINE T hexstr_cast(const std::string &in) { diff --git a/host/include/uhd/utils/math.hpp b/host/include/uhd/utils/math.hpp index 0b35f1f17..5039aa82e 100644 --- a/host/include/uhd/utils/math.hpp +++ b/host/include/uhd/utils/math.hpp @@ -20,7 +20,7 @@ #include <cmath> #include <uhd/config.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/numeric/conversion/bounds.hpp> namespace uhd { diff --git a/host/include/uhd/utils/msg_task.hpp b/host/include/uhd/utils/msg_task.hpp index 8ae789d72..b36cf4b2a 100644 --- a/host/include/uhd/utils/msg_task.hpp +++ b/host/include/uhd/utils/msg_task.hpp @@ -24,15 +24,15 @@ #include <boost/function.hpp> #include <boost/utility.hpp> #include <boost/optional/optional.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <vector> namespace uhd{ class UHD_API msg_task : boost::noncopyable{ public: typedef boost::shared_ptr<msg_task> sptr; - typedef std::vector<boost::uint8_t> msg_payload_t; - typedef std::pair<boost::uint32_t, msg_payload_t > msg_type_t; + typedef std::vector<uint8_t> msg_payload_t; + typedef std::pair<uint32_t, msg_payload_t > msg_type_t; typedef boost::function<boost::optional<msg_type_t>(void)> task_fcn_type; /* @@ -40,15 +40,15 @@ namespace uhd{ * Such stranded messages get pushed into a dump queue. * With this function radio_ctrl_core can check if one of the messages meant for it got stranded. */ - virtual msg_payload_t get_msg_from_dump_queue(boost::uint32_t sid) = 0; + virtual msg_payload_t get_msg_from_dump_queue(uint32_t sid) = 0; - UHD_INLINE static std::vector<boost::uint8_t> buff_to_vector(boost::uint8_t* p, size_t n) { + UHD_INLINE static std::vector<uint8_t> buff_to_vector(uint8_t* p, size_t n) { if(p and n > 0){ - std::vector<boost::uint8_t> v(n); + std::vector<uint8_t> v(n); memcpy(&v.front(), p, n); return v; } - return std::vector<boost::uint8_t>(); + return std::vector<uint8_t>(); } virtual ~msg_task(void) = 0; diff --git a/host/include/uhd/utils/platform.hpp b/host/include/uhd/utils/platform.hpp index de778f61c..58eec360d 100644 --- a/host/include/uhd/utils/platform.hpp +++ b/host/include/uhd/utils/platform.hpp @@ -18,18 +18,18 @@ #ifndef INCLUDED_UHD_UTILS_PLATFORM_HPP #define INCLUDED_UHD_UTILS_PLATFORM_HPP -#include <boost/cstdint.hpp> +#include <stdint.h> namespace uhd { /* Returns the process ID of the current process */ - boost::int32_t get_process_id(); + int32_t get_process_id(); /* Returns a unique identifier for the current machine */ - boost::uint32_t get_host_id(); + uint32_t get_host_id(); /* Get a unique identifier for the current machine and process */ - boost::uint32_t get_process_hash(); + uint32_t get_process_hash(); } //namespace uhd diff --git a/host/include/uhd/utils/soft_register.hpp b/host/include/uhd/utils/soft_register.hpp index 22c3a0ff0..2870ad595 100644 --- a/host/include/uhd/utils/soft_register.hpp +++ b/host/include/uhd/utils/soft_register.hpp @@ -18,7 +18,7 @@ #ifndef INCLUDED_UHD_UTILS_SOFT_REGISTER_HPP #define INCLUDED_UHD_UTILS_SOFT_REGISTER_HPP -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/noncopyable.hpp> #include <uhd/types/wb_iface.hpp> #include <uhd/exception.hpp> @@ -83,7 +83,7 @@ UHD_INLINE bool unlikely(bool expr) * of this type because it will get optimized out by the compiler and * will result in zero memory overhead */ -typedef boost::uint32_t soft_reg_field_t; +typedef uint32_t soft_reg_field_t; namespace soft_reg_field { UHD_INLINE size_t width(const soft_reg_field_t field) { @@ -212,11 +212,11 @@ public: //out by the compiler because it is never read if (_flush_mode == ALWAYS_FLUSH || _soft_copy.is_dirty()) { if (get_bitwidth() <= 16) { - _iface->poke16(_wr_addr, static_cast<boost::uint16_t>(_soft_copy)); + _iface->poke16(_wr_addr, static_cast<uint16_t>(_soft_copy)); } else if (get_bitwidth() <= 32) { - _iface->poke32(_wr_addr, static_cast<boost::uint32_t>(_soft_copy)); + _iface->poke32(_wr_addr, static_cast<uint32_t>(_soft_copy)); } else if (get_bitwidth() <= 64) { - _iface->poke64(_wr_addr, static_cast<boost::uint64_t>(_soft_copy)); + _iface->poke64(_wr_addr, static_cast<uint64_t>(_soft_copy)); } else { throw uhd::not_implemented_error("soft_register only supports up to 64 bits."); } @@ -380,26 +380,26 @@ private: */ //16-bit shortcuts -typedef soft_register_t<boost::uint16_t, false, true> soft_reg16_wo_t; -typedef soft_register_t<boost::uint16_t, true, false> soft_reg16_ro_t; -typedef soft_register_t<boost::uint16_t, true, true> soft_reg16_rw_t; -typedef soft_register_sync_t<boost::uint16_t, false, true> soft_reg16_wo_sync_t; -typedef soft_register_sync_t<boost::uint16_t, true, false> soft_reg16_ro_sync_t; -typedef soft_register_sync_t<boost::uint16_t, true, true> soft_reg16_rw_sync_t; +typedef soft_register_t<uint16_t, false, true> soft_reg16_wo_t; +typedef soft_register_t<uint16_t, true, false> soft_reg16_ro_t; +typedef soft_register_t<uint16_t, true, true> soft_reg16_rw_t; +typedef soft_register_sync_t<uint16_t, false, true> soft_reg16_wo_sync_t; +typedef soft_register_sync_t<uint16_t, true, false> soft_reg16_ro_sync_t; +typedef soft_register_sync_t<uint16_t, true, true> soft_reg16_rw_sync_t; //32-bit shortcuts -typedef soft_register_t<boost::uint32_t, false, true> soft_reg32_wo_t; -typedef soft_register_t<boost::uint32_t, true, false> soft_reg32_ro_t; -typedef soft_register_t<boost::uint32_t, true, true> soft_reg32_rw_t; -typedef soft_register_sync_t<boost::uint32_t, false, true> soft_reg32_wo_sync_t; -typedef soft_register_sync_t<boost::uint32_t, true, false> soft_reg32_ro_sync_t; -typedef soft_register_sync_t<boost::uint32_t, true, true> soft_reg32_rw_sync_t; +typedef soft_register_t<uint32_t, false, true> soft_reg32_wo_t; +typedef soft_register_t<uint32_t, true, false> soft_reg32_ro_t; +typedef soft_register_t<uint32_t, true, true> soft_reg32_rw_t; +typedef soft_register_sync_t<uint32_t, false, true> soft_reg32_wo_sync_t; +typedef soft_register_sync_t<uint32_t, true, false> soft_reg32_ro_sync_t; +typedef soft_register_sync_t<uint32_t, true, true> soft_reg32_rw_sync_t; //64-bit shortcuts -typedef soft_register_t<boost::uint64_t, false, true> soft_reg64_wo_t; -typedef soft_register_t<boost::uint64_t, true, false> soft_reg64_ro_t; -typedef soft_register_t<boost::uint64_t, true, true> soft_reg64_rw_t; -typedef soft_register_sync_t<boost::uint64_t, false, true> soft_reg64_wo_sync_t; -typedef soft_register_sync_t<boost::uint64_t, true, false> soft_reg64_ro_sync_t; -typedef soft_register_sync_t<boost::uint64_t, true, true> soft_reg64_rw_sync_t; +typedef soft_register_t<uint64_t, false, true> soft_reg64_wo_t; +typedef soft_register_t<uint64_t, true, false> soft_reg64_ro_t; +typedef soft_register_t<uint64_t, true, true> soft_reg64_rw_t; +typedef soft_register_sync_t<uint64_t, false, true> soft_reg64_wo_sync_t; +typedef soft_register_sync_t<uint64_t, true, false> soft_reg64_ro_sync_t; +typedef soft_register_sync_t<uint64_t, true, true> soft_reg64_rw_sync_t; /* diff --git a/host/lib/convert/convert_common.hpp b/host/lib/convert/convert_common.hpp index 6e73e9436..7ad7f1671 100644 --- a/host/lib/convert/convert_common.hpp +++ b/host/lib/convert/convert_common.hpp @@ -20,7 +20,7 @@ #include <uhd/convert.hpp> #include <uhd/utils/static.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <complex> #define _DECLARE_CONVERTER(name, in_form, num_in, out_form, num_out, prio) \ @@ -78,17 +78,17 @@ static const int PRIORITY_TABLE = 1; **********************************************************************/ typedef std::complex<double> fc64_t; typedef std::complex<float> fc32_t; -typedef std::complex<boost::int32_t> sc32_t; -typedef std::complex<boost::int16_t> sc16_t; -typedef std::complex<boost::int8_t> sc8_t; +typedef std::complex<int32_t> sc32_t; +typedef std::complex<int16_t> sc16_t; +typedef std::complex<int8_t> sc8_t; typedef double f64_t; typedef float f32_t; -typedef boost::int32_t s32_t; -typedef boost::int16_t s16_t; -typedef boost::int8_t s8_t; -typedef boost::uint8_t u8_t; +typedef int32_t s32_t; +typedef int16_t s16_t; +typedef int8_t s8_t; +typedef uint8_t u8_t; -typedef boost::uint32_t item32_t; +typedef uint32_t item32_t; typedef item32_t (*xtox_t)(item32_t); @@ -98,16 +98,16 @@ typedef item32_t (*xtox_t)(item32_t); template <typename T> UHD_INLINE item32_t xx_to_item32_sc16_x1( const std::complex<T> &num, const double scale_factor ){ - boost::uint16_t real = boost::int16_t(num.real()*float(scale_factor)); - boost::uint16_t imag = boost::int16_t(num.imag()*float(scale_factor)); + uint16_t real = int16_t(num.real()*float(scale_factor)); + uint16_t imag = int16_t(num.imag()*float(scale_factor)); return (item32_t(real) << 16) | (item32_t(imag) << 0); } template <> UHD_INLINE item32_t xx_to_item32_sc16_x1( const sc16_t &num, const double ){ - boost::uint16_t real = boost::int16_t(num.real()); - boost::uint16_t imag = boost::int16_t(num.imag()); + uint16_t real = int16_t(num.real()); + uint16_t imag = int16_t(num.imag()); return (item32_t(real) << 16) | (item32_t(imag) << 0); } @@ -131,8 +131,8 @@ template <typename T> UHD_INLINE std::complex<T> item32_sc16_x1_to_xx( const item32_t item, const double scale_factor ){ return std::complex<T>( - T(boost::int16_t(item >> 16)*float(scale_factor)), - T(boost::int16_t(item >> 0)*float(scale_factor)) + T(int16_t(item >> 16)*float(scale_factor)), + T(int16_t(item >> 0)*float(scale_factor)) ); } @@ -140,7 +140,7 @@ template <> UHD_INLINE sc16_t item32_sc16_x1_to_xx( const item32_t item, const double ){ return sc16_t( - boost::int16_t(item >> 16), boost::int16_t(item >> 0) + int16_t(item >> 16), int16_t(item >> 0) ); } @@ -163,10 +163,10 @@ UHD_INLINE void item32_sc16_to_xx( template <typename T> UHD_INLINE item32_t xx_to_item32_sc8_x1( const std::complex<T> &in0, const std::complex<T> &in1, const double scale_factor ){ - boost::uint8_t real1 = boost::int8_t(in0.real()*float(scale_factor)); - boost::uint8_t imag1 = boost::int8_t(in0.imag()*float(scale_factor)); - boost::uint8_t real0 = boost::int8_t(in1.real()*float(scale_factor)); - boost::uint8_t imag0 = boost::int8_t(in1.imag()*float(scale_factor)); + uint8_t real1 = int8_t(in0.real()*float(scale_factor)); + uint8_t imag1 = int8_t(in0.imag()*float(scale_factor)); + uint8_t real0 = int8_t(in1.real()*float(scale_factor)); + uint8_t imag0 = int8_t(in1.imag()*float(scale_factor)); return (item32_t(real0) << 8) | (item32_t(imag0) << 0) | (item32_t(real1) << 24) | (item32_t(imag1) << 16) @@ -176,10 +176,10 @@ template <typename T> UHD_INLINE item32_t xx_to_item32_sc8_x1( template <> UHD_INLINE item32_t xx_to_item32_sc8_x1( const sc16_t &in0, const sc16_t &in1, const double ){ - boost::uint8_t real1 = boost::int8_t(in0.real()); - boost::uint8_t imag1 = boost::int8_t(in0.imag()); - boost::uint8_t real0 = boost::int8_t(in1.real()); - boost::uint8_t imag0 = boost::int8_t(in1.imag()); + uint8_t real1 = int8_t(in0.real()); + uint8_t imag1 = int8_t(in0.imag()); + uint8_t real0 = int8_t(in1.real()); + uint8_t imag0 = int8_t(in1.imag()); return (item32_t(real0) << 8) | (item32_t(imag0) << 0) | (item32_t(real1) << 24) | (item32_t(imag1) << 16) @@ -189,10 +189,10 @@ template <> UHD_INLINE item32_t xx_to_item32_sc8_x1( template <> UHD_INLINE item32_t xx_to_item32_sc8_x1( const sc8_t &in0, const sc8_t &in1, const double ){ - boost::uint8_t real1 = boost::int8_t(in0.real()); - boost::uint8_t imag1 = boost::int8_t(in0.imag()); - boost::uint8_t real0 = boost::int8_t(in1.real()); - boost::uint8_t imag0 = boost::int8_t(in1.imag()); + uint8_t real1 = int8_t(in0.real()); + uint8_t imag1 = int8_t(in0.imag()); + uint8_t real0 = int8_t(in1.real()); + uint8_t imag0 = int8_t(in1.imag()); return (item32_t(real0) << 8) | (item32_t(imag0) << 0) | (item32_t(real1) << 24) | (item32_t(imag1) << 16) @@ -225,12 +225,12 @@ template <typename T> UHD_INLINE void item32_sc8_x1_to_xx( const item32_t item, std::complex<T> &out0, std::complex<T> &out1, const double scale_factor ){ out1 = std::complex<T>( - T(boost::int8_t(item >> 8)*float(scale_factor)), - T(boost::int8_t(item >> 0)*float(scale_factor)) + T(int8_t(item >> 8)*float(scale_factor)), + T(int8_t(item >> 0)*float(scale_factor)) ); out0 = std::complex<T>( - T(boost::int8_t(item >> 24)*float(scale_factor)), - T(boost::int8_t(item >> 16)*float(scale_factor)) + T(int8_t(item >> 24)*float(scale_factor)), + T(int8_t(item >> 16)*float(scale_factor)) ); } @@ -238,12 +238,12 @@ template <> UHD_INLINE void item32_sc8_x1_to_xx( const item32_t item, sc16_t &out0, sc16_t &out1, const double ){ out1 = sc16_t( - boost::int16_t(boost::int8_t(item >> 8)), - boost::int16_t(boost::int8_t(item >> 0)) + int16_t(int8_t(item >> 8)), + int16_t(int8_t(item >> 0)) ); out0 = sc16_t( - boost::int16_t(boost::int8_t(item >> 24)), - boost::int16_t(boost::int8_t(item >> 16)) + int16_t(int8_t(item >> 24)), + int16_t(int8_t(item >> 16)) ); } @@ -251,12 +251,12 @@ template <> UHD_INLINE void item32_sc8_x1_to_xx( const item32_t item, sc8_t &out0, sc8_t &out1, const double ){ out1 = sc8_t( - boost::int8_t(boost::int8_t(item >> 8)), - boost::int8_t(boost::int8_t(item >> 0)) + int8_t(int8_t(item >> 8)), + int8_t(int8_t(item >> 0)) ); out0 = sc8_t( - boost::int8_t(boost::int8_t(item >> 24)), - boost::int8_t(boost::int8_t(item >> 16)) + int8_t(int8_t(item >> 24)), + int8_t(int8_t(item >> 16)) ); } diff --git a/host/lib/convert/convert_fc32_item32.cpp b/host/lib/convert/convert_fc32_item32.cpp index 641fc2608..4a188780a 100644 --- a/host/lib/convert/convert_fc32_item32.cpp +++ b/host/lib/convert/convert_fc32_item32.cpp @@ -23,7 +23,7 @@ using namespace uhd::convert; -typedef boost::uint32_t (*to32_type)(boost::uint32_t); +typedef uint32_t (*to32_type)(uint32_t); template <typename type, to32_type tohost> struct convert_fc32_item32_1_to_star_1 : public converter diff --git a/host/lib/convert/convert_impl.cpp b/host/lib/convert/convert_impl.cpp index 7dfbb33fd..d624bf970 100644 --- a/host/lib/convert/convert_impl.cpp +++ b/host/lib/convert/convert_impl.cpp @@ -20,7 +20,7 @@ #include <uhd/utils/static.hpp> #include <uhd/types/dict.hpp> #include <uhd/exception.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/format.hpp> #include <boost/foreach.hpp> #include <complex> @@ -159,20 +159,20 @@ UHD_STATIC_BLOCK(convert_register_item_sizes){ //register standard complex types convert::register_bytes_per_item("fc64", sizeof(std::complex<double>)); convert::register_bytes_per_item("fc32", sizeof(std::complex<float>)); - convert::register_bytes_per_item("sc64", sizeof(std::complex<boost::int64_t>)); - convert::register_bytes_per_item("sc32", sizeof(std::complex<boost::int32_t>)); - convert::register_bytes_per_item("sc16", sizeof(std::complex<boost::int16_t>)); - convert::register_bytes_per_item("sc8", sizeof(std::complex<boost::int8_t>)); + convert::register_bytes_per_item("sc64", sizeof(std::complex<int64_t>)); + convert::register_bytes_per_item("sc32", sizeof(std::complex<int32_t>)); + convert::register_bytes_per_item("sc16", sizeof(std::complex<int16_t>)); + convert::register_bytes_per_item("sc8", sizeof(std::complex<int8_t>)); //register standard real types convert::register_bytes_per_item("f64", sizeof(double)); convert::register_bytes_per_item("f32", sizeof(float)); - convert::register_bytes_per_item("s64", sizeof(boost::int64_t)); - convert::register_bytes_per_item("s32", sizeof(boost::int32_t)); - convert::register_bytes_per_item("s16", sizeof(boost::int16_t)); - convert::register_bytes_per_item("s8", sizeof(boost::int8_t)); - convert::register_bytes_per_item("u8", sizeof(boost::uint8_t)); + convert::register_bytes_per_item("s64", sizeof(int64_t)); + convert::register_bytes_per_item("s32", sizeof(int32_t)); + convert::register_bytes_per_item("s16", sizeof(int16_t)); + convert::register_bytes_per_item("s8", sizeof(int8_t)); + convert::register_bytes_per_item("u8", sizeof(uint8_t)); //register VITA types - convert::register_bytes_per_item("item32", sizeof(boost::int32_t)); + convert::register_bytes_per_item("item32", sizeof(int32_t)); } diff --git a/host/lib/convert/convert_pack_sc12.cpp b/host/lib/convert/convert_pack_sc12.cpp index 370e4a3e4..fd32fc95f 100644 --- a/host/lib/convert/convert_pack_sc12.cpp +++ b/host/lib/convert/convert_pack_sc12.cpp @@ -23,7 +23,7 @@ using namespace uhd::convert; -typedef boost::uint32_t (*towire32_type)(boost::uint32_t); +typedef uint32_t (*towire32_type)(uint32_t); /* C language specification requires this to be packed * (i.e., line0, line1, line2 will be in adjacent memory locations). @@ -71,17 +71,17 @@ void convert_star_4_to_sc12_item32_3 const double scalar ) { - const item32_t i0 = boost::int32_t(type(in0.real()*scalar)) & 0xfff; - const item32_t q0 = boost::int32_t(type(in0.imag()*scalar)) & 0xfff; + const item32_t i0 = int32_t(type(in0.real()*scalar)) & 0xfff; + const item32_t q0 = int32_t(type(in0.imag()*scalar)) & 0xfff; - const item32_t i1 = boost::int32_t(type(in1.real()*scalar)) & 0xfff; - const item32_t q1 = boost::int32_t(type(in1.imag()*scalar)) & 0xfff; + const item32_t i1 = int32_t(type(in1.real()*scalar)) & 0xfff; + const item32_t q1 = int32_t(type(in1.imag()*scalar)) & 0xfff; - const item32_t i2 = boost::int32_t(type(in2.real()*scalar)) & 0xfff; - const item32_t q2 = boost::int32_t(type(in2.imag()*scalar)) & 0xfff; + const item32_t i2 = int32_t(type(in2.real()*scalar)) & 0xfff; + const item32_t q2 = int32_t(type(in2.imag()*scalar)) & 0xfff; - const item32_t i3 = boost::int32_t(type(in3.real()*scalar)) & 0xfff; - const item32_t q3 = boost::int32_t(type(in3.imag()*scalar)) & 0xfff; + const item32_t i3 = int32_t(type(in3.real()*scalar)) & 0xfff; + const item32_t q3 = int32_t(type(in3.imag()*scalar)) & 0xfff; const item32_t line0 = (i0 << 20) | (q0 << 8) | (i1 >> 4); const item32_t line1 = (i1 << 28) | (q1 << 16) | (i2 << 4) | (q2 >> 8); diff --git a/host/lib/convert/convert_unpack_sc12.cpp b/host/lib/convert/convert_unpack_sc12.cpp index 9f7a84300..acc815951 100644 --- a/host/lib/convert/convert_unpack_sc12.cpp +++ b/host/lib/convert/convert_unpack_sc12.cpp @@ -23,7 +23,7 @@ using namespace uhd::convert; -typedef boost::uint32_t (*tohost32_type)(boost::uint32_t); +typedef uint32_t (*tohost32_type)(uint32_t); /* C language specification requires this to be packed * (i.e., line0, line1, line2 will be in adjacent memory locations). @@ -63,21 +63,21 @@ void convert_sc12_item32_3_to_star_4 const item32_t line0 = tohost(input.line0); const item32_t line1 = tohost(input.line1); const item32_t line2 = tohost(input.line2); - const boost::uint64_t line01 = (boost::uint64_t(line0) << 32) | line1; - const boost::uint64_t line12 = (boost::uint64_t(line1) << 32) | line2; + const uint64_t line01 = (uint64_t(line0) << 32) | line1; + const uint64_t line12 = (uint64_t(line1) << 32) | line2; //step 1: shift out and mask off the individual numbers - const type i0 = type(boost::int16_t((line0 >> 16) & 0xfff0)*scalar); - const type q0 = type(boost::int16_t((line0 >> 4) & 0xfff0)*scalar); + const type i0 = type(int16_t((line0 >> 16) & 0xfff0)*scalar); + const type q0 = type(int16_t((line0 >> 4) & 0xfff0)*scalar); - const type i1 = type(boost::int16_t((line01 >> 24) & 0xfff0)*scalar); - const type q1 = type(boost::int16_t((line1 >> 12) & 0xfff0)*scalar); + const type i1 = type(int16_t((line01 >> 24) & 0xfff0)*scalar); + const type q1 = type(int16_t((line1 >> 12) & 0xfff0)*scalar); - const type i2 = type(boost::int16_t((line1 >> 0) & 0xfff0)*scalar); - const type q2 = type(boost::int16_t((line12 >> 20) & 0xfff0)*scalar); + const type i2 = type(int16_t((line1 >> 0) & 0xfff0)*scalar); + const type q2 = type(int16_t((line12 >> 20) & 0xfff0)*scalar); - const type i3 = type(boost::int16_t((line2 >> 8) & 0xfff0)*scalar); - const type q3 = type(boost::int16_t((line2 << 4) & 0xfff0)*scalar); + const type i3 = type(int16_t((line2 >> 8) & 0xfff0)*scalar); + const type q3 = type(int16_t((line2 << 4) & 0xfff0)*scalar); //step 2: load the outputs out0 = std::complex<type>(i0, q0); diff --git a/host/lib/convert/convert_with_tables.cpp b/host/lib/convert/convert_with_tables.cpp index 4d295fa01..2dd1b42cc 100644 --- a/host/lib/convert/convert_with_tables.cpp +++ b/host/lib/convert/convert_with_tables.cpp @@ -24,7 +24,7 @@ using namespace uhd::convert; static const size_t sc16_table_len = size_t(1 << 16); -typedef boost::uint16_t (*tohost16_type)(boost::uint16_t); +typedef uint16_t (*tohost16_type)(uint16_t); /*********************************************************************** * Implementation for sc16 to sc8 lookup table @@ -37,8 +37,8 @@ public: void set_scalar(const double scalar){ for (size_t i = 0; i < sc16_table_len; i++){ - const boost::int16_t val = boost::uint16_t(i); - _table[i] = boost::int8_t(boost::math::iround(val * scalar / 32767.)); + const int16_t val = uint16_t(i); + _table[i] = int8_t(boost::math::iround(val * scalar / 32767.)); } } @@ -59,20 +59,20 @@ public: item32_t lookup(const sc16_t &in0, const sc16_t &in1){ if (swap){ //hope this compiles out, its a template constant return - (item32_t(_table[boost::uint16_t(in1.real())]) << 16) | - (item32_t(_table[boost::uint16_t(in1.imag())]) << 24) | - (item32_t(_table[boost::uint16_t(in0.real())]) << 0) | - (item32_t(_table[boost::uint16_t(in0.imag())]) << 8) ; + (item32_t(_table[uint16_t(in1.real())]) << 16) | + (item32_t(_table[uint16_t(in1.imag())]) << 24) | + (item32_t(_table[uint16_t(in0.real())]) << 0) | + (item32_t(_table[uint16_t(in0.imag())]) << 8) ; } return - (item32_t(_table[boost::uint16_t(in1.real())]) << 8) | - (item32_t(_table[boost::uint16_t(in1.imag())]) << 0) | - (item32_t(_table[boost::uint16_t(in0.real())]) << 24) | - (item32_t(_table[boost::uint16_t(in0.imag())]) << 16) ; + (item32_t(_table[uint16_t(in1.real())]) << 8) | + (item32_t(_table[uint16_t(in1.imag())]) << 0) | + (item32_t(_table[uint16_t(in0.real())]) << 24) | + (item32_t(_table[uint16_t(in0.imag())]) << 16) ; } private: - std::vector<boost::uint8_t> _table; + std::vector<uint8_t> _table; }; /*********************************************************************** @@ -86,8 +86,8 @@ public: void set_scalar(const double scalar){ for (size_t i = 0; i < sc16_table_len; i++){ - const boost::uint16_t val = tohost(boost::uint16_t(i & 0xffff)); - _table[i] = type(boost::int16_t(val)*scalar); + const uint16_t val = tohost(uint16_t(i & 0xffff)); + _table[i] = type(int16_t(val)*scalar); } } @@ -98,8 +98,8 @@ public: for (size_t i = 0; i < nsamps; i++){ const item32_t item = input[i]; output[i] = std::complex<type>( - _table[boost::uint16_t(item >> re_shift)], - _table[boost::uint16_t(item >> im_shift)] + _table[uint16_t(item >> re_shift)], + _table[uint16_t(item >> im_shift)] ); } } @@ -118,7 +118,7 @@ public: convert_sc8_item32_1_to_fcxx_1(void): _table(sc16_table_len){} //special case for sc16 type, 32767 undoes float normalization - static type conv(const boost::int8_t &num, const double scalar){ + static type conv(const int8_t &num, const double scalar){ if (sizeof(type) == sizeof(s16_t)){ return type(boost::math::iround(num*scalar*32767)); } @@ -127,9 +127,9 @@ public: void set_scalar(const double scalar){ for (size_t i = 0; i < sc16_table_len; i++){ - const boost::uint16_t val = tohost(boost::uint16_t(i & 0xffff)); - const type real = conv(boost::int8_t(val >> 8), scalar); - const type imag = conv(boost::int8_t(val >> 0), scalar); + const uint16_t val = tohost(uint16_t(i & 0xffff)); + const type real = conv(int8_t(val >> 8), scalar); + const type imag = conv(int8_t(val >> 0), scalar); _table[i] = std::complex<type>(real, imag); } } @@ -142,20 +142,20 @@ public: if ((size_t(inputs[0]) & 0x3) != 0){ const item32_t item0 = *input++; - *output++ = _table[boost::uint16_t(item0 >> hi_shift)]; + *output++ = _table[uint16_t(item0 >> hi_shift)]; num_samps--; } const size_t num_pairs = num_samps/2; for (size_t i = 0, j = 0; i < num_pairs; i++, j+=2){ const item32_t item_i = (input[i]); - output[j] = _table[boost::uint16_t(item_i >> lo_shift)]; - output[j + 1] = _table[boost::uint16_t(item_i >> hi_shift)]; + output[j] = _table[uint16_t(item_i >> lo_shift)]; + output[j + 1] = _table[uint16_t(item_i >> hi_shift)]; } if (num_samps != num_pairs*2){ const item32_t item_n = input[num_pairs]; - output[num_samps-1] = _table[boost::uint16_t(item_n >> lo_shift)]; + output[num_samps-1] = _table[uint16_t(item_n >> lo_shift)]; } } diff --git a/host/lib/convert/gen_convert_general.py b/host/lib/convert/gen_convert_general.py index 5c62d51df..6e38d9c81 100644 --- a/host/lib/convert/gen_convert_general.py +++ b/host/lib/convert/gen_convert_general.py @@ -149,18 +149,18 @@ DECLARE_CONVERTER(${cpu_type}, ${width}, sc16_item16_usrp1, 1, PRIORITY_GENERAL) % for w in range(width): const ${cpu_type}_t *input${w} = reinterpret_cast<const ${cpu_type}_t *>(inputs[${w}]); % endfor - boost::uint16_t *output = reinterpret_cast<boost::uint16_t *>(outputs[0]); + uint16_t *output = reinterpret_cast<uint16_t *>(outputs[0]); for (size_t i = 0, j = 0; i < nsamps; i++){ % for w in range(width): - output[j++] = ${to_wire}(boost::uint16_t(boost::int16_t(input${w}[i].real()${do_scale}))); - output[j++] = ${to_wire}(boost::uint16_t(boost::int16_t(input${w}[i].imag()${do_scale}))); + output[j++] = ${to_wire}(uint16_t(int16_t(input${w}[i].real()${do_scale}))); + output[j++] = ${to_wire}(uint16_t(int16_t(input${w}[i].imag()${do_scale}))); % endfor } } DECLARE_CONVERTER(sc16_item16_usrp1, 1, ${cpu_type}, ${width}, PRIORITY_GENERAL){ - const boost::uint16_t *input = reinterpret_cast<const boost::uint16_t *>(inputs[0]); + const uint16_t *input = reinterpret_cast<const uint16_t *>(inputs[0]); % for w in range(width): ${cpu_type}_t *output${w} = reinterpret_cast<${cpu_type}_t *>(outputs[${w}]); % endfor @@ -168,8 +168,8 @@ DECLARE_CONVERTER(sc16_item16_usrp1, 1, ${cpu_type}, ${width}, PRIORITY_GENERAL) for (size_t i = 0, j = 0; i < nsamps; i++){ % for w in range(width): output${w}[i] = ${cpu_type}_t( - boost::int16_t(${to_host}(input[j+0]))${do_scale}, - boost::int16_t(${to_host}(input[j+1]))${do_scale} + int16_t(${to_host}(input[j+0]))${do_scale}, + int16_t(${to_host}(input[j+1]))${do_scale} ); j += 2; % endfor @@ -177,7 +177,7 @@ DECLARE_CONVERTER(sc16_item16_usrp1, 1, ${cpu_type}, ${width}, PRIORITY_GENERAL) } DECLARE_CONVERTER(sc8_item16_usrp1, 1, ${cpu_type}, ${width}, PRIORITY_GENERAL){ - const boost::uint16_t *input = reinterpret_cast<const boost::uint16_t *>(inputs[0]); + const uint16_t *input = reinterpret_cast<const uint16_t *>(inputs[0]); % for w in range(width): ${cpu_type}_t *output${w} = reinterpret_cast<${cpu_type}_t *>(outputs[${w}]); % endfor @@ -185,10 +185,10 @@ DECLARE_CONVERTER(sc8_item16_usrp1, 1, ${cpu_type}, ${width}, PRIORITY_GENERAL){ for (size_t i = 0, j = 0; i < nsamps; i++){ % for w in range(width): { - const boost::uint16_t num = ${to_host}(input[j++]); + const uint16_t num = ${to_host}(input[j++]); output${w}[i] = ${cpu_type}_t( - boost::int8_t(num)${do_scale}, - boost::int8_t(num >> 8)${do_scale} + int8_t(num)${do_scale}, + int8_t(num >> 8)${do_scale} ); } % endfor diff --git a/host/lib/deprecated.cpp b/host/lib/deprecated.cpp index 0fc751eeb..839f7a3e8 100644 --- a/host/lib/deprecated.cpp +++ b/host/lib/deprecated.cpp @@ -4,7 +4,7 @@ #include <uhd/types/otw_type.hpp> #include <uhd/types/io_type.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <stdexcept> #include <complex> #include <vector> @@ -33,8 +33,8 @@ static std::vector<size_t> get_tid_size_table(void){ std::vector<size_t> table(128, 0); table[size_t(io_type_t::COMPLEX_FLOAT64)] = sizeof(std::complex<double>); table[size_t(io_type_t::COMPLEX_FLOAT32)] = sizeof(std::complex<float>); - table[size_t(io_type_t::COMPLEX_INT16)] = sizeof(std::complex<boost::int16_t>); - table[size_t(io_type_t::COMPLEX_INT8)] = sizeof(std::complex<boost::int8_t>); + table[size_t(io_type_t::COMPLEX_INT16)] = sizeof(std::complex<int16_t>); + table[size_t(io_type_t::COMPLEX_INT8)] = sizeof(std::complex<int8_t>); return table; } diff --git a/host/lib/experts/expert_container.cpp b/host/lib/experts/expert_container.cpp index 78c783790..1d945aa42 100644 --- a/host/lib/experts/expert_container.cpp +++ b/host/lib/experts/expert_container.cpp @@ -151,11 +151,11 @@ public: const dag_vertex_t& vertex = _get_vertex(*vi.first); if (vertex.get_class() != CLASS_WORKER) { dot_str += str(boost::format(" %d [label=\"%s\",shape=%s,xlabel=\"%s\"];\n") % - boost::uint32_t(*vi.first) % vertex.get_name() % + uint32_t(*vi.first) % vertex.get_name() % DATA_SHAPE % vertex.get_dtype()); } else { dot_str += str(boost::format(" %d [label=\"%s\",shape=%s];\n") % - boost::uint32_t(*vi.first) % vertex.get_name() % WORKER_SHAPE); + uint32_t(*vi.first) % vertex.get_name() % WORKER_SHAPE); } } @@ -165,8 +165,8 @@ public: ++ei.first ) { dot_str += str(boost::format(" %d -> %d;\n") % - boost::uint32_t(boost::source(*(ei.first), _expert_dag)) % - boost::uint32_t(boost::target(*(ei.first), _expert_dag))); + uint32_t(boost::source(*(ei.first), _expert_dag)) % + uint32_t(boost::target(*(ei.first), _expert_dag))); } dot_str += "}\n"; return dot_str; diff --git a/host/lib/experts/expert_nodes.hpp b/host/lib/experts/expert_nodes.hpp index a704023a3..6040cd19e 100644 --- a/host/lib/experts/expert_nodes.hpp +++ b/host/lib/experts/expert_nodes.hpp @@ -29,6 +29,7 @@ #include <boost/units/detail/utility.hpp> #include <memory> #include <list> +#include <stdint.h> namespace uhd { namespace experts { @@ -94,7 +95,7 @@ namespace uhd { namespace experts { return os.str(); } - static std::string print(const boost::uint8_t& val) { + static std::string print(const uint8_t& val) { std::ostringstream os; os << int(val); return os.str(); diff --git a/host/lib/ic_reg_maps/common.py b/host/lib/ic_reg_maps/common.py index 5c0cfc109..c342a4ff5 100755 --- a/host/lib/ic_reg_maps/common.py +++ b/host/lib/ic_reg_maps/common.py @@ -30,8 +30,8 @@ COMMON_TMPL = """<% import time %>\ #include <uhd/config.hpp> #include <uhd/exception.hpp> -#include <boost/cstdint.hpp> #include <set> +#include <stdint.h> class ${name}_t{ public: @@ -145,7 +145,7 @@ class reg: return self._default def get_type(self): if self.get_enums(): return '%s_t'%self.get_name() - return 'boost::uint%d_t'%max(2**math.ceil(math.log(self.get_bit_width(), 2)), 8) + return 'uint%d_t'%max(2**math.ceil(math.log(self.get_bit_width(), 2)), 8) def get_shift(self): return self._addr_spec[0] def get_mask(self): return hex(int('1'*self.get_bit_width(), 2)) def get_bit_width(self): return self._addr_spec[1] - self._addr_spec[0] + 1 @@ -166,7 +166,7 @@ class mreg: def get_regs(self): return self._regs def get_bit_width(self): return sum(map(reg.get_bit_width, self._regs)) def get_type(self): - return 'boost::uint%d_t'%max(2**math.ceil(math.log(self.get_bit_width(), 2)), 8) + return 'uint%d_t'%max(2**math.ceil(math.log(self.get_bit_width(), 2)), 8) def generate(name, regs_tmpl, body_tmpl='', file=__file__, append=False): #evaluate the regs template and parse each line into a register diff --git a/host/lib/ic_reg_maps/gen_ad5623_regs.py b/host/lib/ic_reg_maps/gen_ad5623_regs.py index 8b70a9f0a..99ae4c77d 100755 --- a/host/lib/ic_reg_maps/gen_ad5623_regs.py +++ b/host/lib/ic_reg_maps/gen_ad5623_regs.py @@ -30,10 +30,10 @@ cmd 0[19:21] 0 wr_input_n, up_dac_n, wr_input_n_up_a # Template for methods in the body of the struct ######################################################################## BODY_TMPL="""\ -boost::uint32_t get_reg(void){ - boost::uint32_t reg = 0; +uint32_t get_reg(void){ + uint32_t reg = 0; % for reg in filter(lambda r: r.get_addr() == 0, regs): - reg |= (boost::uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor return reg; } diff --git a/host/lib/ic_reg_maps/gen_ad7922_regs.py b/host/lib/ic_reg_maps/gen_ad7922_regs.py index c77991182..da79a0b97 100755 --- a/host/lib/ic_reg_maps/gen_ad7922_regs.py +++ b/host/lib/ic_reg_maps/gen_ad7922_regs.py @@ -30,15 +30,15 @@ chn 0[13] 0 # Template for methods in the body of the struct ######################################################################## BODY_TMPL="""\ -boost::uint16_t get_reg(void){ - boost::uint16_t reg = 0; +uint16_t get_reg(void){ + uint16_t reg = 0; % for reg in filter(lambda r: r.get_addr() == 0, regs): - reg |= (boost::uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor return reg; } -void set_reg(boost::uint16_t reg){ +void set_reg(uint16_t reg){ % for reg in filter(lambda r: r.get_addr() == 0, regs): ${reg.get_name()} = ${reg.get_type()}((reg >> ${reg.get_shift()}) & ${reg.get_mask()}); % endfor diff --git a/host/lib/ic_reg_maps/gen_ad9510_regs.py b/host/lib/ic_reg_maps/gen_ad9510_regs.py index 9f194b5c9..29b3eb58a 100755 --- a/host/lib/ic_reg_maps/gen_ad9510_regs.py +++ b/host/lib/ic_reg_maps/gen_ad9510_regs.py @@ -107,13 +107,13 @@ update_registers 0x5A[0] 0 # Template for methods in the body of the struct ######################################################################## BODY_TMPL="""\ -boost::uint8_t get_reg(boost::uint16_t addr){ - boost::uint8_t reg = 0; +uint8_t get_reg(uint16_t addr){ + uint8_t reg = 0; switch(addr){ % for addr in sorted(set(map(lambda r: r.get_addr(), regs))): case ${addr}: % for reg in filter(lambda r: r.get_addr() == addr, regs): - reg |= (boost::uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor break; % endfor @@ -121,12 +121,12 @@ boost::uint8_t get_reg(boost::uint16_t addr){ return reg; } -boost::uint32_t get_write_reg(boost::uint16_t addr){ - return (boost::uint32_t(addr) << 8) | get_reg(addr); +uint32_t get_write_reg(uint16_t addr){ + return (uint32_t(addr) << 8) | get_reg(addr); } -boost::uint32_t get_read_reg(boost::uint16_t addr){ - return (boost::uint32_t(addr) << 8) | (1 << 23); +uint32_t get_read_reg(uint16_t addr){ + return (uint32_t(addr) << 8) | (1 << 23); } """ diff --git a/host/lib/ic_reg_maps/gen_ad9522_regs.py b/host/lib/ic_reg_maps/gen_ad9522_regs.py index cc906b76c..eeda5e799 100755 --- a/host/lib/ic_reg_maps/gen_ad9522_regs.py +++ b/host/lib/ic_reg_maps/gen_ad9522_regs.py @@ -141,13 +141,13 @@ reg2eeprom 0xB03[0] 0 # Template for methods in the body of the struct ######################################################################## BODY_TMPL="""\ -boost::uint32_t get_reg(boost::uint16_t addr){ - boost::uint32_t reg = 0; +uint32_t get_reg(uint16_t addr){ + uint32_t reg = 0; switch(addr){ % for addr in sorted(set(map(lambda r: r.get_addr(), regs))): case ${addr}: % for reg in filter(lambda r: r.get_addr() == addr, regs): - reg |= (boost::uint8_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint8_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor break; % endfor @@ -161,7 +161,7 @@ boost::uint32_t get_reg(boost::uint16_t addr){ return reg; } -void set_reg(boost::uint16_t addr, boost::uint32_t reg){ +void set_reg(uint16_t addr, uint32_t reg){ switch(addr){ % for addr in sorted(set(map(lambda r: r.get_addr(), regs))): case ${addr}: @@ -173,12 +173,12 @@ void set_reg(boost::uint16_t addr, boost::uint32_t reg){ } } -boost::uint32_t get_write_reg(boost::uint16_t addr){ - return (boost::uint32_t(addr) << 8) | get_reg(addr); +uint32_t get_write_reg(uint16_t addr){ + return (uint32_t(addr) << 8) | get_reg(addr); } -boost::uint32_t get_read_reg(boost::uint16_t addr){ - return (boost::uint32_t(addr) << 8) | (1 << 23); +uint32_t get_read_reg(uint16_t addr){ + return (uint32_t(addr) << 8) | (1 << 23); } """ diff --git a/host/lib/ic_reg_maps/gen_ad9777_regs.py b/host/lib/ic_reg_maps/gen_ad9777_regs.py index 514283409..b1facfd79 100755 --- a/host/lib/ic_reg_maps/gen_ad9777_regs.py +++ b/host/lib/ic_reg_maps/gen_ad9777_regs.py @@ -88,13 +88,13 @@ qdac_ioffset_direction 0xC[7] 0 out_a, out_b # Template for methods in the body of the struct ######################################################################## BODY_TMPL="""\ -boost::uint8_t get_reg(boost::uint8_t addr){ - boost::uint8_t reg = 0; +uint8_t get_reg(uint8_t addr){ + uint8_t reg = 0; switch(addr){ % for addr in sorted(set(map(lambda r: r.get_addr(), regs))): case ${addr}: % for reg in filter(lambda r: r.get_addr() == addr, regs): - reg |= (boost::uint8_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint8_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor break; % endfor @@ -102,12 +102,12 @@ boost::uint8_t get_reg(boost::uint8_t addr){ return reg; } -boost::uint16_t get_write_reg(boost::uint8_t addr){ - return (boost::uint16_t(addr) << 8) | get_reg(addr); +uint16_t get_write_reg(uint8_t addr){ + return (uint16_t(addr) << 8) | get_reg(addr); } -boost::uint16_t get_read_reg(boost::uint8_t addr){ - return (boost::uint16_t(addr) << 8) | (1 << 7); +uint16_t get_read_reg(uint8_t addr){ + return (uint16_t(addr) << 8) | (1 << 7); } """ diff --git a/host/lib/ic_reg_maps/gen_ad9862_regs.py b/host/lib/ic_reg_maps/gen_ad9862_regs.py index 022d97c16..738e9c616 100755 --- a/host/lib/ic_reg_maps/gen_ad9862_regs.py +++ b/host/lib/ic_reg_maps/gen_ad9862_regs.py @@ -202,13 +202,13 @@ chip_id 63[0:7] 0 # Header and Source templates below ######################################################################## BODY_TMPL=""" -boost::uint8_t get_reg(boost::uint8_t addr){ - boost::uint8_t reg = 0; +uint8_t get_reg(uint8_t addr){ + uint8_t reg = 0; switch(addr){ % for addr in range(0, 63+1): case ${addr}: % for reg in filter(lambda r: r.get_addr() == addr, regs): - reg |= (boost::uint16_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint16_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor break; % endfor @@ -216,7 +216,7 @@ boost::uint8_t get_reg(boost::uint8_t addr){ return reg; } -void set_reg(boost::uint8_t addr, boost::uint16_t reg){ +void set_reg(uint8_t addr, uint16_t reg){ switch(addr){ % for addr in sorted(set(map(lambda r: r.get_addr(), regs))): case ${addr}: @@ -228,12 +228,12 @@ void set_reg(boost::uint8_t addr, boost::uint16_t reg){ } } -boost::uint16_t get_write_reg(boost::uint8_t addr){ - return (boost::uint16_t(addr) << 8) | get_reg(addr); +uint16_t get_write_reg(uint8_t addr){ + return (uint16_t(addr) << 8) | get_reg(addr); } -boost::uint16_t get_read_reg(boost::uint8_t addr){ - return (boost::uint16_t(addr) << 8) | (1 << 15); +uint16_t get_read_reg(uint8_t addr){ + return (uint16_t(addr) << 8) | (1 << 15); } """ diff --git a/host/lib/ic_reg_maps/gen_adf4350_regs.py b/host/lib/ic_reg_maps/gen_adf4350_regs.py index 644654dee..51744711b 100755 --- a/host/lib/ic_reg_maps/gen_adf4350_regs.py +++ b/host/lib/ic_reg_maps/gen_adf4350_regs.py @@ -98,13 +98,13 @@ enum addr_t{ ADDR_R5 = 5 }; -boost::uint32_t get_reg(boost::uint8_t addr){ - boost::uint32_t reg = addr & 0x7; +uint32_t get_reg(uint8_t addr){ + uint32_t reg = addr & 0x7; switch(addr){ % for addr in range(5+1): case ${addr}: % for reg in filter(lambda r: r.get_addr() == addr, regs): - reg |= (boost::uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor break; % endfor diff --git a/host/lib/ic_reg_maps/gen_adf4351_regs.py b/host/lib/ic_reg_maps/gen_adf4351_regs.py index 6699e5137..28f782995 100755 --- a/host/lib/ic_reg_maps/gen_adf4351_regs.py +++ b/host/lib/ic_reg_maps/gen_adf4351_regs.py @@ -102,13 +102,13 @@ enum addr_t{ ADDR_R5 = 5 }; -boost::uint32_t get_reg(boost::uint8_t addr){ - boost::uint32_t reg = addr & 0x7; +uint32_t get_reg(uint8_t addr){ + uint32_t reg = addr & 0x7; switch(addr){ % for addr in range(5+1): case ${addr}: % for reg in filter(lambda r: r.get_addr() == addr, regs): - reg |= (boost::uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor break; % endfor diff --git a/host/lib/ic_reg_maps/gen_adf4360_regs.py b/host/lib/ic_reg_maps/gen_adf4360_regs.py index 921f014ff..0bd954057 100755 --- a/host/lib/ic_reg_maps/gen_adf4360_regs.py +++ b/host/lib/ic_reg_maps/gen_adf4360_regs.py @@ -65,13 +65,13 @@ enum addr_t{ ADDR_RCOUNTER = 1 }; -boost::uint32_t get_reg(addr_t addr){ - boost::uint32_t reg = addr & 0x3; +uint32_t get_reg(addr_t addr){ + uint32_t reg = addr & 0x3; switch(addr){ % for addr in sorted(set(map(lambda r: r.get_addr(), regs))): case ${addr}: % for reg in filter(lambda r: r.get_addr() == addr, regs): - reg |= (boost::uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor break; % endfor diff --git a/host/lib/ic_reg_maps/gen_adf5355_regs.py b/host/lib/ic_reg_maps/gen_adf5355_regs.py index db7cc09a9..9644f2e53 100755 --- a/host/lib/ic_reg_maps/gen_adf5355_regs.py +++ b/host/lib/ic_reg_maps/gen_adf5355_regs.py @@ -142,13 +142,13 @@ enum addr_t{ ADDR_R12 = 12 }; -boost::uint32_t get_reg(boost::uint8_t addr){ - boost::uint32_t reg = addr & 0xF; +uint32_t get_reg(uint8_t addr){ + uint32_t reg = addr & 0xF; switch(addr){ % for addr in range(12+1): case ${addr}: % for reg in filter(lambda r: r.get_addr() == addr, regs): - reg |= (boost::uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor break; % endfor diff --git a/host/lib/ic_reg_maps/gen_ads62p44_regs.py b/host/lib/ic_reg_maps/gen_ads62p44_regs.py index df5c0c66c..fd929e555 100755 --- a/host/lib/ic_reg_maps/gen_ads62p44_regs.py +++ b/host/lib/ic_reg_maps/gen_ads62p44_regs.py @@ -92,13 +92,13 @@ decimation_filter_bands 29[0:1] 0 # Template for methods in the body of the struct ######################################################################## BODY_TMPL="""\ -boost::uint8_t get_reg(boost::uint8_t addr){ - boost::uint8_t reg = 0; +uint8_t get_reg(uint8_t addr){ + uint8_t reg = 0; switch(addr){ % for addr in sorted(set(map(lambda r: r.get_addr(), regs))): case ${addr}: % for reg in filter(lambda r: r.get_addr() == addr, regs): - reg |= (boost::uint8_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint8_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor break; % endfor @@ -106,12 +106,12 @@ boost::uint8_t get_reg(boost::uint8_t addr){ return reg; } -boost::uint16_t get_write_reg(boost::uint8_t addr){ - return (boost::uint16_t(addr) << 8) | get_reg(addr); +uint16_t get_write_reg(uint8_t addr){ + return (uint16_t(addr) << 8) | get_reg(addr); } -boost::uint16_t get_read_reg(boost::uint8_t addr){ - return (boost::uint16_t(addr) << 8) | (1 << 7); +uint16_t get_read_reg(uint8_t addr){ + return (uint16_t(addr) << 8) | (1 << 7); } """ diff --git a/host/lib/ic_reg_maps/gen_ads62p48_regs.py b/host/lib/ic_reg_maps/gen_ads62p48_regs.py index fa5668d4f..b0b841f50 100755 --- a/host/lib/ic_reg_maps/gen_ads62p48_regs.py +++ b/host/lib/ic_reg_maps/gen_ads62p48_regs.py @@ -52,13 +52,13 @@ offset_pedestal_chB 0x76[5:0] 0 # Template for methods in the body of the struct ######################################################################## BODY_TMPL="""\ -boost::uint8_t get_reg(boost::uint8_t addr){ - boost::uint8_t reg = 0; +uint8_t get_reg(uint8_t addr){ + uint8_t reg = 0; switch(addr){ % for addr in sorted(set(map(lambda r: r.get_addr(), regs))): case ${addr}: % for reg in filter(lambda r: r.get_addr() == addr, regs): - reg |= (boost::uint8_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint8_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor break; % endfor @@ -66,12 +66,12 @@ boost::uint8_t get_reg(boost::uint8_t addr){ return reg; } -boost::uint16_t get_write_reg(boost::uint8_t addr){ - return (boost::uint16_t(addr) << 8) | get_reg(addr); +uint16_t get_write_reg(uint8_t addr){ + return (uint16_t(addr) << 8) | get_reg(addr); } -boost::uint16_t get_read_reg(boost::uint8_t addr){ - return (boost::uint16_t(addr) << 8) | (1 << 7); +uint16_t get_read_reg(uint8_t addr){ + return (uint16_t(addr) << 8) | (1 << 7); } """ diff --git a/host/lib/ic_reg_maps/gen_lmk04816_regs.py b/host/lib/ic_reg_maps/gen_lmk04816_regs.py index d432ac706..71613c761 100755 --- a/host/lib/ic_reg_maps/gen_lmk04816_regs.py +++ b/host/lib/ic_reg_maps/gen_lmk04816_regs.py @@ -375,13 +375,13 @@ BODY_TMPL = """\ -boost::uint32_t get_reg(int addr){ - boost::uint32_t reg = 0; +uint32_t get_reg(int addr){ + uint32_t reg = 0; switch(addr){ % for addr in sorted(set(map(lambda r: r.get_addr(), regs))): case ${addr}: % for reg in filter(lambda r: r.get_addr() == addr, regs): - reg |= (boost::uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor break; % endfor diff --git a/host/lib/ic_reg_maps/gen_max2112_regs.py b/host/lib/ic_reg_maps/gen_max2112_regs.py index be760ec2e..734ad9213 100755 --- a/host/lib/ic_reg_maps/gen_max2112_regs.py +++ b/host/lib/ic_reg_maps/gen_max2112_regs.py @@ -130,21 +130,21 @@ adc 0xD[0:2] 0 ool0, lock0, vaslock0, vaslock1, vas # Template for methods in the body of the struct ######################################################################## BODY_TMPL="""\ -boost::uint8_t get_reg(boost::uint8_t addr){ - boost::uint8_t reg = 0; +uint8_t get_reg(uint8_t addr){ + uint8_t reg = 0; switch(addr){ % for addr in sorted(set(map(lambda r: r.get_addr(), regs))): case ${addr}: % for reg in filter(lambda r: r.get_addr() == addr, regs): - reg |= (boost::uint8_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint8_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor break; % endfor } - return boost::uint8_t(reg); + return uint8_t(reg); } -void set_reg(boost::uint8_t addr, boost::uint8_t reg){ +void set_reg(uint8_t addr, uint8_t reg){ switch(addr){ % for addr in sorted(set(map(lambda r: r.get_addr(), regs))): case ${addr}: diff --git a/host/lib/ic_reg_maps/gen_max2118_regs.py b/host/lib/ic_reg_maps/gen_max2118_regs.py index 01d7615de..6b6acdaf7 100755 --- a/host/lib/ic_reg_maps/gen_max2118_regs.py +++ b/host/lib/ic_reg_maps/gen_max2118_regs.py @@ -87,21 +87,21 @@ filter_dac 1[0:6] 0 # Template for methods in the body of the struct ######################################################################## BODY_TMPL="""\ -boost::uint8_t get_reg(boost::uint8_t addr){ - boost::uint8_t reg = 0; +uint8_t get_reg(uint8_t addr){ + uint8_t reg = 0; switch(addr){ % for addr in sorted(set(map(lambda r: r.get_addr(), regs))): case ${addr}: % for reg in filter(lambda r: r.get_addr() == addr, regs): - reg |= (boost::uint8_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint8_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor break; % endfor } - return boost::uint8_t(reg); + return uint8_t(reg); } -void set_reg(boost::uint8_t addr, boost::uint8_t reg){ +void set_reg(uint8_t addr, uint8_t reg){ switch(addr){ % for addr in sorted(set(map(lambda r: r.get_addr(), regs))): case ${addr}: diff --git a/host/lib/ic_reg_maps/gen_max2829_regs.py b/host/lib/ic_reg_maps/gen_max2829_regs.py index dbcb68ec9..c1ded91b6 100755 --- a/host/lib/ic_reg_maps/gen_max2829_regs.py +++ b/host/lib/ic_reg_maps/gen_max2829_regs.py @@ -109,18 +109,18 @@ tx_vga_gain 12[0:5] 0 # Template for methods in the body of the struct ######################################################################## BODY_TMPL="""\ -boost::uint32_t get_reg(boost::uint8_t addr){ - boost::uint16_t reg = 0; +uint32_t get_reg(uint8_t addr){ + uint16_t reg = 0; switch(addr){ % for addr in sorted(set(map(lambda r: r.get_addr(), regs))): case ${addr}: % for reg in filter(lambda r: r.get_addr() == addr, regs): - reg |= (boost::uint16_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint16_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor break; % endfor } - return (boost::uint32_t(reg) << 4) | (addr & 0xf); + return (uint32_t(reg) << 4) | (addr & 0xf); } """ diff --git a/host/lib/ic_reg_maps/gen_max2870_regs.py b/host/lib/ic_reg_maps/gen_max2870_regs.py index af4e3c786..24c04c98a 100755 --- a/host/lib/ic_reg_maps/gen_max2870_regs.py +++ b/host/lib/ic_reg_maps/gen_max2870_regs.py @@ -117,13 +117,13 @@ enum addr_t{ ADDR_R5 = 5 }; -boost::uint32_t get_reg(boost::uint8_t addr){ - boost::uint32_t reg = addr & 0x7; +uint32_t get_reg(uint8_t addr){ + uint32_t reg = addr & 0x7; switch(addr){ % for addr in range(5+1): case ${addr}: % for reg in filter(lambda r: r.get_addr() == addr, regs): - reg |= (boost::uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor break; % endfor diff --git a/host/lib/ic_reg_maps/gen_max2871_regs.py b/host/lib/ic_reg_maps/gen_max2871_regs.py index f500d8aa8..5ec74f281 100755 --- a/host/lib/ic_reg_maps/gen_max2871_regs.py +++ b/host/lib/ic_reg_maps/gen_max2871_regs.py @@ -133,13 +133,13 @@ enum addr_t{ ADDR_R5 = 5 }; -boost::uint32_t get_reg(boost::uint8_t addr){ - boost::uint32_t reg = addr & 0x7; +uint32_t get_reg(uint8_t addr){ + uint32_t reg = addr & 0x7; switch(addr){ % for addr in range(5+1): case ${addr}: % for reg in filter(lambda r: r.get_addr() == addr, regs): - reg |= (boost::uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor break; % endfor diff --git a/host/lib/ic_reg_maps/gen_tda18272hnm_regs.py b/host/lib/ic_reg_maps/gen_tda18272hnm_regs.py index 308d7d524..717438665 100755 --- a/host/lib/ic_reg_maps/gen_tda18272hnm_regs.py +++ b/host/lib/ic_reg_maps/gen_tda18272hnm_regs.py @@ -484,21 +484,21 @@ magic 0x43[7] 1 untouched, xtal_cal_dac # Template for methods in the body of the struct ######################################################################## BODY_TMPL="""\ -boost::uint8_t get_reg(boost::uint8_t addr){ - boost::uint8_t reg = 0; +uint8_t get_reg(uint8_t addr){ + uint8_t reg = 0; switch(addr){ % for addr in sorted(set(map(lambda r: r.get_addr(), regs))): case ${addr}: % for reg in filter(lambda r: r.get_addr() == addr, regs): - reg |= (boost::uint8_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint8_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor break; % endfor } - return boost::uint8_t(reg); + return uint8_t(reg); } -void set_reg(boost::uint8_t addr, boost::uint8_t reg){ +void set_reg(uint8_t addr, uint8_t reg){ switch(addr){ % for addr in sorted(set(map(lambda r: r.get_addr(), regs))): case ${addr}: diff --git a/host/lib/ic_reg_maps/gen_tuner_4937di5_regs.py b/host/lib/ic_reg_maps/gen_tuner_4937di5_regs.py index 9b8e1958f..2176402ed 100755 --- a/host/lib/ic_reg_maps/gen_tuner_4937di5_regs.py +++ b/host/lib/ic_reg_maps/gen_tuner_4937di5_regs.py @@ -50,18 +50,18 @@ power 3[3] 0x00 on,off # Template for methods in the body of the struct ######################################################################## BODY_TMPL="""\ -boost::uint8_t get_reg(boost::uint8_t addr){ - boost::uint8_t reg = 0; +uint8_t get_reg(uint8_t addr){ + uint8_t reg = 0; switch(addr){ % for addr in sorted(set(map(lambda r: r.get_addr(), regs))): case ${addr}: % for reg in filter(lambda r: r.get_addr() == addr, regs): - reg |= (boost::uint8_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + reg |= (uint8_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; % endfor break; % endfor } - return boost::uint8_t(reg); + return uint8_t(reg); } """ diff --git a/host/lib/rfnoc/block_ctrl_base.cpp b/host/lib/rfnoc/block_ctrl_base.cpp index 21bd32a1c..c273fa76b 100644 --- a/host/lib/rfnoc/block_ctrl_base.cpp +++ b/host/lib/rfnoc/block_ctrl_base.cpp @@ -39,8 +39,8 @@ using std::string; * Helpers **********************************************************************/ //! Convert register to a peek/poke compatible address -inline boost::uint32_t _sr_to_addr(boost::uint32_t reg) { return reg * 4; }; -inline boost::uint32_t _sr_to_addr64(boost::uint32_t reg) { return reg * 8; }; // for peek64 +inline uint32_t _sr_to_addr(uint32_t reg) { return reg * 4; }; +inline uint32_t _sr_to_addr64(uint32_t reg) { return reg * 8; }; // for peek64 /*********************************************************************** * Structors @@ -56,7 +56,7 @@ block_ctrl_base::block_ctrl_base( /*** Identify this block (NoC-ID, block-ID, and block definition) *******/ // Read NoC-ID (name is passed in through make_args): - boost::uint64_t noc_id = sr_read64(SR_READBACK_REG_ID); + uint64_t noc_id = sr_read64(SR_READBACK_REG_ID); _block_def = blockdef::make_from_noc_id(noc_id); if (_block_def) UHD_BLOCK_LOG() << "Found valid blockdef" << std::endl; if (not _block_def) @@ -74,7 +74,7 @@ block_ctrl_base::block_ctrl_base( /*** Initialize property tree *******************************************/ _root_path = "xbar/" + _block_id.get_local(); - _tree->create<boost::uint64_t>(_root_path / "noc_id").set(noc_id); + _tree->create<uint64_t>(_root_path / "noc_id").set(noc_id); /*** Reset block state *******************************************/ clear(); @@ -224,7 +224,7 @@ std::vector<size_t> block_ctrl_base::get_ctrl_ports() const return ctrl_ports; } -void block_ctrl_base::sr_write(const boost::uint32_t reg, const boost::uint32_t data, const size_t port) +void block_ctrl_base::sr_write(const uint32_t reg, const uint32_t data, const size_t port) { //UHD_BLOCK_LOG() << " "; //UHD_RFNOC_BLOCK_TRACE() << boost::format("sr_write(%d, %08X, %d)") % reg % data % port << std::endl; @@ -239,9 +239,9 @@ void block_ctrl_base::sr_write(const boost::uint32_t reg, const boost::uint32_t } } -void block_ctrl_base::sr_write(const std::string ®, const boost::uint32_t data, const size_t port) +void block_ctrl_base::sr_write(const std::string ®, const uint32_t data, const size_t port) { - boost::uint32_t reg_addr = 255; + uint32_t reg_addr = 255; if (DEFAULT_NAMED_SR.has_key(reg)) { reg_addr = DEFAULT_NAMED_SR[reg]; } else { @@ -251,14 +251,14 @@ void block_ctrl_base::sr_write(const std::string ®, const boost::uint32_t dat % reg )); } - reg_addr = boost::uint32_t(_tree->access<size_t>(_root_path / "registers" / "sr" / reg).get()); + reg_addr = uint32_t(_tree->access<size_t>(_root_path / "registers" / "sr" / reg).get()); } UHD_BLOCK_LOG() << " "; UHD_RFNOC_BLOCK_TRACE() << boost::format("sr_write(%s, %08X) ==> ") % reg % data << std::endl; return sr_write(reg_addr, data, port); } -boost::uint64_t block_ctrl_base::sr_read64(const settingsbus_reg_t reg, const size_t port) +uint64_t block_ctrl_base::sr_read64(const settingsbus_reg_t reg, const size_t port) { if (not _ctrl_ifaces.count(port)) { throw uhd::key_error(str(boost::format("[%s] sr_read64(): No such port: %d") % get_block_id().get() % port)); @@ -271,7 +271,7 @@ boost::uint64_t block_ctrl_base::sr_read64(const settingsbus_reg_t reg, const si } } -boost::uint32_t block_ctrl_base::sr_read32(const settingsbus_reg_t reg, const size_t port) +uint32_t block_ctrl_base::sr_read32(const settingsbus_reg_t reg, const size_t port) { if (not _ctrl_ifaces.count(port)) { throw uhd::key_error(str(boost::format("[%s] sr_read32(): No such port: %d") % get_block_id().get() % port)); @@ -284,7 +284,7 @@ boost::uint32_t block_ctrl_base::sr_read32(const settingsbus_reg_t reg, const si } } -boost::uint64_t block_ctrl_base::user_reg_read64(const boost::uint32_t addr, const size_t port) +uint64_t block_ctrl_base::user_reg_read64(const uint32_t addr, const size_t port) { try { // Set readback register address @@ -297,7 +297,7 @@ boost::uint64_t block_ctrl_base::user_reg_read64(const boost::uint32_t addr, con } } -boost::uint64_t block_ctrl_base::user_reg_read64(const std::string ®, const size_t port) +uint64_t block_ctrl_base::user_reg_read64(const std::string ®, const size_t port) { if (not _tree->exists(_root_path / "registers" / "rb" / reg)) { throw uhd::key_error(str( @@ -305,12 +305,12 @@ boost::uint64_t block_ctrl_base::user_reg_read64(const std::string ®, const s % reg )); } - return user_reg_read64(boost::uint32_t( + return user_reg_read64(uint32_t( _tree->access<size_t>(_root_path / "registers" / "rb" / reg).get() ), port); } -boost::uint32_t block_ctrl_base::user_reg_read32(const boost::uint32_t addr, const size_t port) +uint32_t block_ctrl_base::user_reg_read32(const uint32_t addr, const size_t port) { try { // Set readback register address @@ -323,7 +323,7 @@ boost::uint32_t block_ctrl_base::user_reg_read32(const boost::uint32_t addr, con } } -boost::uint32_t block_ctrl_base::user_reg_read32(const std::string ®, const size_t port) +uint32_t block_ctrl_base::user_reg_read32(const std::string ®, const size_t port) { if (not _tree->exists(_root_path / "registers" / "rb" / reg)) { throw uhd::key_error(str( @@ -331,7 +331,7 @@ boost::uint32_t block_ctrl_base::user_reg_read32(const std::string ®, const s % reg )); } - return user_reg_read32(boost::uint32_t( + return user_reg_read32(uint32_t( _tree->access<size_t>(_root_path / "registers" / "sr" / reg).get() ), port); } @@ -420,7 +420,7 @@ void block_ctrl_base::clear(const size_t /* port */) } } -boost::uint32_t block_ctrl_base::get_address(size_t block_port) { +uint32_t block_ctrl_base::get_address(size_t block_port) { UHD_ASSERT_THROW(block_port < 16); return (_base_address & 0xFFF0) | (block_port & 0xF); } diff --git a/host/lib/rfnoc/block_ctrl_base_factory.cpp b/host/lib/rfnoc/block_ctrl_base_factory.cpp index aab2ed475..0e2d5ae03 100644 --- a/host/lib/rfnoc/block_ctrl_base_factory.cpp +++ b/host/lib/rfnoc/block_ctrl_base_factory.cpp @@ -45,7 +45,7 @@ void block_ctrl_base::register_block( /*! Look up names for blocks in XML files using NoC ID. */ -static void lookup_block_key(boost::uint64_t noc_id, make_args_t &make_args) +static void lookup_block_key(uint64_t noc_id, make_args_t &make_args) { try { blockdef::sptr bd = blockdef::make_from_noc_id(noc_id); @@ -69,7 +69,7 @@ static void lookup_block_key(boost::uint64_t noc_id, make_args_t &make_args) block_ctrl_base::sptr block_ctrl_base::make( const make_args_t &make_args_, - boost::uint64_t noc_id + uint64_t noc_id ) { UHD_FACTORY_LOG() << "[RFNoC Factory] block_ctrl_base::make() " << std::endl; make_args_t make_args = make_args_; diff --git a/host/lib/rfnoc/blockdef_xml_impl.cpp b/host/lib/rfnoc/blockdef_xml_impl.cpp index 5ff69d512..3de3a0ba0 100644 --- a/host/lib/rfnoc/blockdef_xml_impl.cpp +++ b/host/lib/rfnoc/blockdef_xml_impl.cpp @@ -192,7 +192,7 @@ public: } //! Matches a NoC ID through substring matching - static bool match_noc_id(const std::string &lhs_, boost::uint64_t rhs_) + static bool match_noc_id(const std::string &lhs_, uint64_t rhs_) { // Sanitize input: Make both values strings with all uppercase // characters and no leading 0x. Check inputs are valid. @@ -213,7 +213,7 @@ public: } //! Open the file at filename and see if it's a block definition for the given NoC ID - static bool has_noc_id(boost::uint64_t noc_id, const fs::path &filename) + static bool has_noc_id(uint64_t noc_id, const fs::path &filename) { pt::ptree propt; try { @@ -230,7 +230,7 @@ public: return false; } - blockdef_xml_impl(const fs::path &filename, boost::uint64_t noc_id, xml_repr_t type=DESCRIBES_BLOCK) : + blockdef_xml_impl(const fs::path &filename, uint64_t noc_id, xml_repr_t type=DESCRIBES_BLOCK) : _type(type), _noc_id(noc_id) { @@ -282,7 +282,7 @@ public: return _pt.get<std::string>("nocblock.blockname"); } - boost::uint64_t noc_id() const + uint64_t noc_id() const { return _noc_id; } @@ -405,7 +405,7 @@ private: //! Tells us if is this for a NoC block, or a component. const xml_repr_t _type; //! The NoC-ID as reported (there may be several valid NoC IDs, this is the one used) - const boost::uint64_t _noc_id; + const uint64_t _noc_id; //! This is a boost property tree, not the same as // our property tree. @@ -413,7 +413,7 @@ private: }; -blockdef::sptr blockdef::make_from_noc_id(boost::uint64_t noc_id) +blockdef::sptr blockdef::make_from_noc_id(uint64_t noc_id) { std::vector<fs::path> paths = blockdef_xml_impl::get_xml_paths(); // Iterate over all paths diff --git a/host/lib/rfnoc/ctrl_iface.cpp b/host/lib/rfnoc/ctrl_iface.cpp index 83c3a2626..b2ac1778e 100644 --- a/host/lib/rfnoc/ctrl_iface.cpp +++ b/host/lib/rfnoc/ctrl_iface.cpp @@ -50,7 +50,7 @@ public: ctrl_iface_impl(const bool big_endian, uhd::transport::zero_copy_if::sptr ctrl_xport, uhd::transport::zero_copy_if::sptr resp_xport, - const boost::uint32_t sid, const std::string &name + const uint32_t sid, const std::string &name ) : _link_type(vrt::if_packet_info_t::LINK_TYPE_CHDR), _packet_type(vrt::if_packet_info_t::PACKET_TYPE_CONTEXT), @@ -83,24 +83,24 @@ public: /******************************************************************* * Peek and poke 32 bit implementation ******************************************************************/ - void poke32(const wb_addr_type addr, const boost::uint32_t data) + void poke32(const wb_addr_type addr, const uint32_t data) { boost::mutex::scoped_lock lock(_mutex); this->send_pkt(addr/4, data); this->wait_for_ack(false); } - boost::uint32_t peek32(const wb_addr_type addr) + uint32_t peek32(const wb_addr_type addr) { boost::mutex::scoped_lock lock(_mutex); this->send_pkt(_rb_address, addr/8); - const boost::uint64_t res = this->wait_for_ack(true); - const boost::uint32_t lo = boost::uint32_t(res & 0xffffffff); - const boost::uint32_t hi = boost::uint32_t(res >> 32); + const uint64_t res = this->wait_for_ack(true); + const uint32_t lo = uint32_t(res & 0xffffffff); + const uint32_t hi = uint32_t(res >> 32); return ((addr/4) & 0x1)? hi : lo; } - boost::uint64_t peek64(const wb_addr_type addr) + uint64_t peek64(const wb_addr_type addr) { boost::mutex::scoped_lock lock(_mutex); this->send_pkt(_rb_address, addr/8); @@ -134,26 +134,26 @@ private: // This is the buffer type for response messages struct resp_buff_type { - boost::uint32_t data[8]; + uint32_t data[8]; }; /******************************************************************* * Primary control and interaction private methods ******************************************************************/ - inline void send_pkt(const boost::uint32_t addr, const boost::uint32_t data = 0) + inline void send_pkt(const uint32_t addr, const uint32_t data = 0) { managed_send_buffer::sptr buff = _ctrl_xport->get_send_buff(0.0); if (not buff) { throw uhd::runtime_error("fifo ctrl timed out getting a send buffer"); } - boost::uint32_t *pkt = buff->cast<boost::uint32_t *>(); + uint32_t *pkt = buff->cast<uint32_t *>(); //load packet info vrt::if_packet_info_t packet_info; packet_info.link_type = _link_type; packet_info.packet_type = _packet_type; packet_info.num_payload_words32 = 2; - packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(boost::uint32_t); + packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(uint32_t); packet_info.packet_count = _seq_out; packet_info.tsf = _time.to_ticks(_tick_rate); packet_info.sob = false; @@ -175,12 +175,12 @@ private: //UHD_MSG(status) << boost::format("0x%08x, 0x%08x\n") % addr % data; //send the buffer over the interface _outstanding_seqs.push(_seq_out); - buff->commit(sizeof(boost::uint32_t)*(packet_info.num_packet_words32)); + buff->commit(sizeof(uint32_t)*(packet_info.num_packet_words32)); _seq_out++;//inc seq for next call } - UHD_INLINE boost::uint64_t wait_for_ack(const bool readback) + UHD_INLINE uint64_t wait_for_ack(const bool readback) { while (readback or (_outstanding_seqs.size() >= _resp_queue_size)) { @@ -193,7 +193,7 @@ private: vrt::if_packet_info_t packet_info; resp_buff_type resp_buff; memset(&resp_buff, 0x00, sizeof(resp_buff)); - boost::uint32_t const *pkt = NULL; + uint32_t const *pkt = NULL; managed_recv_buffer::sptr buff; //get buffer from response endpoint - or die in timeout @@ -209,8 +209,8 @@ private: { throw uhd::io_error(str(boost::format("Block ctrl (%s) no response packet - %s") % _name % ex.what())); } - pkt = buff->cast<const boost::uint32_t *>(); - packet_info.num_packet_words32 = buff->size()/sizeof(boost::uint32_t); + pkt = buff->cast<const uint32_t *>(); + packet_info.num_packet_words32 = buff->size()/sizeof(uint32_t); } //get buffer from response endpoint - or die in timeout @@ -238,7 +238,7 @@ private: } pkt = resp_buff.data; - packet_info.num_packet_words32 = sizeof(resp_buff)/sizeof(boost::uint32_t); + packet_info.num_packet_words32 = sizeof(resp_buff)/sizeof(uint32_t); } //parse the buffer @@ -266,7 +266,7 @@ private: try { UHD_ASSERT_THROW(packet_info.has_sid); - if (packet_info.sid != boost::uint32_t((_sid >> 16) | (_sid << 16))) { + if (packet_info.sid != uint32_t((_sid >> 16) | (_sid << 16))) { throw uhd::io_error( str( boost::format("Expected SID: %s Received SID: %s") @@ -297,8 +297,8 @@ private: //return the readback value if (readback and _outstanding_seqs.empty()) { - const boost::uint64_t hi = (_bige)? uhd::ntohx(pkt[packet_info.num_header_words32+0]) : uhd::wtohx(pkt[packet_info.num_header_words32+0]); - const boost::uint64_t lo = (_bige)? uhd::ntohx(pkt[packet_info.num_header_words32+1]) : uhd::wtohx(pkt[packet_info.num_header_words32+1]); + const uint64_t hi = (_bige)? uhd::ntohx(pkt[packet_info.num_header_words32+0]) : uhd::wtohx(pkt[packet_info.num_header_words32+0]); + const uint64_t lo = (_bige)? uhd::ntohx(pkt[packet_info.num_header_words32+1]) : uhd::wtohx(pkt[packet_info.num_header_words32+1]); return ((hi << 32) | lo); } } @@ -316,7 +316,7 @@ private: */ bool check_dump_queue(resp_buff_type& b) { const size_t min_buff_size = 8; // Same value as in b200_io_impl->handle_async_task - boost::uint32_t recv_sid = (((_sid)<<16)|((_sid)>>16)); + uint32_t recv_sid = (((_sid)<<16)|((_sid)>>16)); uhd::msg_task::msg_payload_t msg; do{ msg = _async_task->get_msg_from_dump_queue(recv_sid); @@ -330,7 +330,7 @@ private: return false; } - void push_response(const boost::uint32_t *buff) + void push_response(const uint32_t *buff) { resp_buff_type resp_buff; std::memcpy(resp_buff.data, buff, sizeof(resp_buff)); @@ -348,7 +348,7 @@ private: const uhd::transport::zero_copy_if::sptr _ctrl_xport; const uhd::transport::zero_copy_if::sptr _resp_xport; uhd::msg_task::sptr _async_task; - const boost::uint32_t _sid; + const uint32_t _sid; const std::string _name; boost::mutex _mutex; size_t _seq_out; @@ -367,7 +367,7 @@ ctrl_iface::sptr ctrl_iface::make( const bool big_endian, zero_copy_if::sptr ctrl_xport, zero_copy_if::sptr resp_xport, - const boost::uint32_t sid, + const uint32_t sid, const std::string &name ) { return sptr(new ctrl_iface_impl( diff --git a/host/lib/rfnoc/ctrl_iface.hpp b/host/lib/rfnoc/ctrl_iface.hpp index 4141b6583..3690874f9 100644 --- a/host/lib/rfnoc/ctrl_iface.hpp +++ b/host/lib/rfnoc/ctrl_iface.hpp @@ -43,7 +43,7 @@ public: const bool big_endian, uhd::transport::zero_copy_if::sptr ctrl_xport, uhd::transport::zero_copy_if::sptr resp_xport, - const boost::uint32_t sid, + const uint32_t sid, const std::string &name = "0" ); @@ -51,7 +51,7 @@ public: virtual void hold_task(uhd::msg_task::sptr task) = 0; //! Push a response externall (resp_xport is NULL) - virtual void push_response(const boost::uint32_t *buff) = 0; + virtual void push_response(const uint32_t *buff) = 0; //! Set the command time that will activate virtual void set_time(const uhd::time_spec_t &time) = 0; diff --git a/host/lib/rfnoc/dma_fifo_block_ctrl_impl.cpp b/host/lib/rfnoc/dma_fifo_block_ctrl_impl.cpp index 5f476074b..aea7c591c 100644 --- a/host/lib/rfnoc/dma_fifo_block_ctrl_impl.cpp +++ b/host/lib/rfnoc/dma_fifo_block_ctrl_impl.cpp @@ -42,18 +42,18 @@ public: _perifs[i].ctrl = boost::make_shared<wb_iface_adapter>( // poke32 functor boost::bind( - static_cast< void (block_ctrl_base::*)(const boost::uint32_t, const boost::uint32_t, const size_t) >(&block_ctrl_base::sr_write), + static_cast< void (block_ctrl_base::*)(const uint32_t, const uint32_t, const size_t) >(&block_ctrl_base::sr_write), this, _1, _2, i ), // peek32 functor boost::bind( - static_cast< boost::uint32_t (block_ctrl_base::*)(const boost::uint32_t, const size_t) >(&block_ctrl_base::user_reg_read32), + static_cast< uint32_t (block_ctrl_base::*)(const uint32_t, const size_t) >(&block_ctrl_base::user_reg_read32), this, _1, i ), // peek64 functor boost::bind( - static_cast< boost::uint64_t (block_ctrl_base::*)(const boost::uint32_t, const size_t) >(&block_ctrl_base::user_reg_read64), + static_cast< uint64_t (block_ctrl_base::*)(const uint32_t, const size_t) >(&block_ctrl_base::user_reg_read64), this, _1, i ) @@ -66,7 +66,7 @@ public: _perifs[i].core->resize(_perifs[i].base_addr, _perifs[i].depth); UHD_MSG(status) << boost::format("[DMA FIFO] Running BIST for FIFO %d... ") % i; if (_perifs[i].core->ext_bist_supported()) { - boost::uint32_t bisterr = _perifs[i].core->run_bist(); + uint32_t bisterr = _perifs[i].core->run_bist(); if (bisterr != 0) { throw uhd::runtime_error(str(boost::format("BIST failed! (code: %d)\n") % bisterr)); } else { diff --git a/host/lib/rfnoc/legacy_compat.cpp b/host/lib/rfnoc/legacy_compat.cpp index 20553062f..e1eff757e 100644 --- a/host/lib/rfnoc/legacy_compat.cpp +++ b/host/lib/rfnoc/legacy_compat.cpp @@ -382,6 +382,9 @@ private: // methods const std::string block_name = _get_streamer_block_id_and_port<dir>(mboard_idx, radio_index, port_index); args.args[str(boost::format("block_id%d") % stream_arg_chan_idx)] = block_name; args.args[str(boost::format("block_port%d") % stream_arg_chan_idx)] = str(boost::format("%d") % port_index); + // Map radio to channel (for in-band response) + args.args[str(boost::format("radio_id%d") % stream_arg_chan_idx)] = block_id_t(mboard_idx, RADIO_BLOCK_NAME, radio_index).to_string(); + args.args[str(boost::format("radio_port%d") % stream_arg_chan_idx)] = str(boost::format("%d") % chan_map[mboard_idx][this_mboard_chan_idx].port_index); } } diff --git a/host/lib/rfnoc/nocscript/block_iface.cpp b/host/lib/rfnoc/nocscript/block_iface.cpp index 2034d3438..0d301e5bc 100644 --- a/host/lib/rfnoc/nocscript/block_iface.cpp +++ b/host/lib/rfnoc/nocscript/block_iface.cpp @@ -140,7 +140,7 @@ void block_iface::run_and_check(const std::string &code, const std::string &erro expression_literal block_iface::_nocscript__sr_write(expression_container::expr_list_type args) { const std::string reg_name = args[0]->eval().get_string(); - const boost::uint32_t reg_val = boost::uint32_t(args[1]->eval().get_int()); + const uint32_t reg_val = uint32_t(args[1]->eval().get_int()); bool result = true; try { UHD_NOCSCRIPT_LOG() << "[NocScript] Executing SR_WRITE() " << std::endl; diff --git a/host/lib/rfnoc/radio_ctrl_impl.cpp b/host/lib/rfnoc/radio_ctrl_impl.cpp index 1cc7a2472..43e5cb7fc 100644 --- a/host/lib/rfnoc/radio_ctrl_impl.cpp +++ b/host/lib/rfnoc/radio_ctrl_impl.cpp @@ -58,18 +58,18 @@ radio_ctrl_impl::radio_ctrl_impl() : _perifs[i].ctrl = boost::make_shared<wb_iface_adapter>( // poke32 functor boost::bind( - static_cast< void (block_ctrl_base::*)(const boost::uint32_t, const boost::uint32_t, const size_t) >(&block_ctrl_base::sr_write), + static_cast< void (block_ctrl_base::*)(const uint32_t, const uint32_t, const size_t) >(&block_ctrl_base::sr_write), this, _1, _2, i ), // peek32 functor boost::bind( - static_cast< boost::uint32_t (block_ctrl_base::*)(const boost::uint32_t, const size_t) >(&block_ctrl_base::user_reg_read32), + static_cast< uint32_t (block_ctrl_base::*)(const uint32_t, const size_t) >(&block_ctrl_base::user_reg_read32), this, _1, i ), // peek64 functor boost::bind( - static_cast< boost::uint64_t (block_ctrl_base::*)(const boost::uint32_t, const size_t) >(&block_ctrl_base::user_reg_read64), + static_cast< uint64_t (block_ctrl_base::*)(const uint32_t, const size_t) >(&block_ctrl_base::user_reg_read64), this, _1, i ), @@ -142,11 +142,11 @@ void radio_ctrl_impl::_register_loopback_self_test(size_t chan) for (size_t i = 0; i < 100; i++) { boost::hash_combine(hash, i); - sr_write(regs::TEST, boost::uint32_t(hash), chan); - boost::uint32_t result = user_reg_read32(regs::RB_TEST, chan); - if (result != boost::uint32_t(hash)) { + sr_write(regs::TEST, uint32_t(hash), chan); + uint32_t result = user_reg_read32(regs::RB_TEST, chan); + if (result != uint32_t(hash)) { UHD_MSG(status) << "fail" << std::endl; - UHD_MSG(status) << boost::format("expected: %x result: %x") % boost::uint32_t(hash) % result << std::endl; + UHD_MSG(status) << boost::format("expected: %x result: %x") % uint32_t(hash) % result << std::endl; return; // exit on any failure } } @@ -265,18 +265,18 @@ void radio_ctrl_impl::issue_stream_cmd(const uhd::stream_cmd_t &stream_cmd, cons boost::tie(inst_reload, inst_chain, inst_samps, inst_stop) = mode_to_inst[stream_cmd.stream_mode]; //calculate the word from flags and length - boost::uint32_t cmd_word = 0; - cmd_word |= boost::uint32_t((stream_cmd.stream_now)? 1 : 0) << 31; - cmd_word |= boost::uint32_t((inst_chain)? 1 : 0) << 30; - cmd_word |= boost::uint32_t((inst_reload)? 1 : 0) << 29; - cmd_word |= boost::uint32_t((inst_stop)? 1 : 0) << 28; + uint32_t cmd_word = 0; + cmd_word |= uint32_t((stream_cmd.stream_now)? 1 : 0) << 31; + cmd_word |= uint32_t((inst_chain)? 1 : 0) << 30; + cmd_word |= uint32_t((inst_reload)? 1 : 0) << 29; + cmd_word |= uint32_t((inst_stop)? 1 : 0) << 28; cmd_word |= (inst_samps)? stream_cmd.num_samps : ((inst_stop)? 0 : 1); //issue the stream command - const boost::uint64_t ticks = (stream_cmd.stream_now)? 0 : stream_cmd.time_spec.to_ticks(get_rate()); + const uint64_t ticks = (stream_cmd.stream_now)? 0 : stream_cmd.time_spec.to_ticks(get_rate()); sr_write(regs::RX_CTRL_CMD, cmd_word, chan); - sr_write(regs::RX_CTRL_TIME_HI, boost::uint32_t(ticks >> 32), chan); - sr_write(regs::RX_CTRL_TIME_LO, boost::uint32_t(ticks >> 0), chan); //latches the command + sr_write(regs::RX_CTRL_TIME_HI, uint32_t(ticks >> 32), chan); + sr_write(regs::RX_CTRL_TIME_LO, uint32_t(ticks >> 0), chan); //latches the command } std::vector<size_t> radio_ctrl_impl::get_active_rx_ports() diff --git a/host/lib/rfnoc/radio_ctrl_impl.hpp b/host/lib/rfnoc/radio_ctrl_impl.hpp index 881cce3b4..d6b402120 100644 --- a/host/lib/rfnoc/radio_ctrl_impl.hpp +++ b/host/lib/rfnoc/radio_ctrl_impl.hpp @@ -98,7 +98,7 @@ protected: // TODO see what's protected and what's private * Registers **********************************************************************/ struct regs { - static inline boost::uint32_t sr_addr(const boost::uint32_t offset) + static inline uint32_t sr_addr(const uint32_t offset) { return offset * 4; } diff --git a/host/lib/rfnoc/sink_block_ctrl_base.cpp b/host/lib/rfnoc/sink_block_ctrl_base.cpp index e4107c0b8..55d502ede 100644 --- a/host/lib/rfnoc/sink_block_ctrl_base.cpp +++ b/host/lib/rfnoc/sink_block_ctrl_base.cpp @@ -67,13 +67,13 @@ void sink_block_ctrl_base::configure_flow_control_in( size_t block_port ) { UHD_RFNOC_BLOCK_TRACE() << boost::format("sink_block_ctrl_base::configure_flow_control_in(cycles=%d, packets=%d)") % cycles % packets << std::endl; - boost::uint32_t cycles_word = 0; + uint32_t cycles_word = 0; if (cycles) { cycles_word = (1<<31) | cycles; } sr_write(SR_FLOW_CTRL_CYCS_PER_ACK, cycles_word, block_port); - boost::uint32_t packets_word = 0; + uint32_t packets_word = 0; if (packets) { packets_word = (1<<31) | packets; } diff --git a/host/lib/rfnoc/source_block_ctrl_base.cpp b/host/lib/rfnoc/source_block_ctrl_base.cpp index 72845ad64..94e271541 100644 --- a/host/lib/rfnoc/source_block_ctrl_base.cpp +++ b/host/lib/rfnoc/source_block_ctrl_base.cpp @@ -74,7 +74,7 @@ std::vector<size_t> source_block_ctrl_base::get_output_ports() const * FPGA Configuration **********************************************************************/ void source_block_ctrl_base::set_destination( - boost::uint32_t next_address, + uint32_t next_address, size_t output_block_port ) { UHD_RFNOC_BLOCK_TRACE() << "source_block_ctrl_base::set_destination() " << uhd::sid_t(next_address) << std::endl; diff --git a/host/lib/rfnoc/wb_iface_adapter.cpp b/host/lib/rfnoc/wb_iface_adapter.cpp index 6688fe86b..c2de754b2 100644 --- a/host/lib/rfnoc/wb_iface_adapter.cpp +++ b/host/lib/rfnoc/wb_iface_adapter.cpp @@ -45,17 +45,17 @@ wb_iface_adapter::wb_iface_adapter( // nop } -void wb_iface_adapter::poke32(const wb_addr_type addr, const boost::uint32_t data) +void wb_iface_adapter::poke32(const wb_addr_type addr, const uint32_t data) { poke32_functor(addr / 4, data); // FIXME remove the requirement for /4 } -boost::uint32_t wb_iface_adapter::peek32(const wb_addr_type addr) +uint32_t wb_iface_adapter::peek32(const wb_addr_type addr) { return peek32_functor(addr); } -boost::uint64_t wb_iface_adapter::peek64(const wb_addr_type addr) +uint64_t wb_iface_adapter::peek64(const wb_addr_type addr) { return peek64_functor(addr); } diff --git a/host/lib/rfnoc/wb_iface_adapter.hpp b/host/lib/rfnoc/wb_iface_adapter.hpp index 04623d203..d83bf9427 100644 --- a/host/lib/rfnoc/wb_iface_adapter.hpp +++ b/host/lib/rfnoc/wb_iface_adapter.hpp @@ -29,9 +29,9 @@ class UHD_API wb_iface_adapter : public uhd::timed_wb_iface { public: typedef boost::shared_ptr<wb_iface_adapter> sptr; - typedef boost::function<void(wb_addr_type, boost::uint32_t)> poke32_type; - typedef boost::function<boost::uint32_t(wb_addr_type)> peek32_type; - typedef boost::function<boost::uint64_t(wb_addr_type)> peek64_type; + typedef boost::function<void(wb_addr_type, uint32_t)> poke32_type; + typedef boost::function<uint32_t(wb_addr_type)> peek32_type; + typedef boost::function<uint64_t(wb_addr_type)> peek64_type; typedef boost::function<time_spec_t(void)> gettime_type; typedef boost::function<void(const time_spec_t&)> settime_type; @@ -51,9 +51,9 @@ public: virtual ~wb_iface_adapter(void) {}; - virtual void poke32(const wb_addr_type addr, const boost::uint32_t data); - virtual boost::uint32_t peek32(const wb_addr_type addr); - virtual boost::uint64_t peek64(const wb_addr_type addr); + virtual void poke32(const wb_addr_type addr, const uint32_t data); + virtual uint32_t peek32(const wb_addr_type addr); + virtual uint64_t peek64(const wb_addr_type addr); virtual time_spec_t get_time(void); virtual void set_time(const time_spec_t& t); 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/muxed_zero_copy_if.cpp b/host/lib/transport/muxed_zero_copy_if.cpp index 996db3c98..7a2b76165 100644 --- a/host/lib/transport/muxed_zero_copy_if.cpp +++ b/host/lib/transport/muxed_zero_copy_if.cpp @@ -74,7 +74,12 @@ public: if (_streams.size() >= _max_num_streams) { throw uhd::runtime_error("muxed_zero_copy_if: stream capacity exceeded. cannot create more streams."); } - stream_impl::sptr stream = boost::make_shared<stream_impl>(this->shared_from_this(), stream_num); + // Only allocate a portion of the base transport's frames to each stream + // to prevent all streams from attempting to use all the frames. + stream_impl::sptr stream = boost::make_shared<stream_impl>( + this->shared_from_this(), stream_num, + _base_xport->get_num_send_frames() / _max_num_streams, + _base_xport->get_num_recv_frames() / _max_num_streams); _streams[stream_num] = stream; return stream; } @@ -91,16 +96,55 @@ public: } private: + /* + * @class stream_mrb is used to copy the data and release the original + * managed receive buffer back to the base transport. + */ + class stream_mrb : public managed_recv_buffer + { + public: + stream_mrb(size_t size) : _buff(new char[size]) {} + + ~stream_mrb() { + delete _buff; + } + + void release() {} + + UHD_INLINE sptr get_new(char *buff, size_t len) + { + memcpy(_buff, buff, len); + return make(this, _buff, len); + } + + private: + char *_buff; + }; + class stream_impl : public zero_copy_if { public: typedef boost::shared_ptr<stream_impl> sptr; typedef boost::weak_ptr<stream_impl> wptr; - stream_impl(muxed_zero_copy_if_impl::sptr muxed_xport, const uint32_t stream_num): + stream_impl( + muxed_zero_copy_if_impl::sptr muxed_xport, + const uint32_t stream_num, + const size_t num_send_frames, + const size_t num_recv_frames + ) : _stream_num(stream_num), _muxed_xport(muxed_xport), - _buff_queue(muxed_xport->base_xport()->get_num_recv_frames()) + _num_send_frames(num_send_frames), + _send_frame_size(_muxed_xport->base_xport()->get_send_frame_size()), + _num_recv_frames(num_recv_frames), + _recv_frame_size(_muxed_xport->base_xport()->get_recv_frame_size()), + _buff_queue(num_recv_frames), + _buffers(num_recv_frames), + _buffer_index(0) { + for (size_t i = 0; i < num_recv_frames; i++) { + _buffers[i] = boost::make_shared<stream_mrb>(_recv_frame_size); + } } ~stream_impl(void) @@ -116,11 +160,11 @@ private: } size_t get_num_recv_frames(void) const { - return _muxed_xport->base_xport()->get_num_recv_frames(); + return _num_recv_frames; } size_t get_recv_frame_size(void) const { - return _muxed_xport->base_xport()->get_recv_frame_size(); + return _recv_frame_size; } managed_recv_buffer::sptr get_recv_buff(double timeout) { @@ -130,19 +174,19 @@ private: } else { return managed_recv_buffer::sptr(); } - } void push_recv_buff(managed_recv_buffer::sptr buff) { - _buff_queue.push_with_wait(buff); + _buff_queue.push_with_wait(_buffers.at(_buffer_index++)->get_new(buff->cast<char*>(), buff->size())); + _buffer_index %= _buffers.size(); } size_t get_num_send_frames(void) const { - return _muxed_xport->base_xport()->get_num_send_frames(); + return _num_send_frames; } size_t get_send_frame_size(void) const { - return _muxed_xport->base_xport()->get_send_frame_size(); + return _send_frame_size; } managed_send_buffer::sptr get_send_buff(double timeout) @@ -153,7 +197,13 @@ private: private: const uint32_t _stream_num; muxed_zero_copy_if_impl::sptr _muxed_xport; + const size_t _num_send_frames; + const size_t _send_frame_size; + const size_t _num_recv_frames; + const size_t _recv_frame_size; bounded_buffer<managed_recv_buffer::sptr> _buff_queue; + std::vector< boost::shared_ptr<stream_mrb> > _buffers; + size_t _buffer_index; }; inline zero_copy_if::sptr& base_xport() { return _base_xport; } 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; diff --git a/host/lib/types/byte_vector.cpp b/host/lib/types/byte_vector.cpp index 071cdb8cb..15ae93858 100644 --- a/host/lib/types/byte_vector.cpp +++ b/host/lib/types/byte_vector.cpp @@ -23,7 +23,7 @@ namespace uhd{ std::string bytes_to_string(const byte_vector_t &bytes){ std::string out; - BOOST_FOREACH(boost::uint8_t byte, bytes){ + BOOST_FOREACH(uint8_t byte, bytes){ if (byte < 32 or byte > 127) return out; out += byte; } diff --git a/host/lib/types/mac_addr.cpp b/host/lib/types/mac_addr.cpp index a5cb90f97..ab71bc0c3 100644 --- a/host/lib/types/mac_addr.cpp +++ b/host/lib/types/mac_addr.cpp @@ -20,7 +20,7 @@ #include <boost/tokenizer.hpp> #include <boost/foreach.hpp> #include <boost/format.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <sstream> using namespace uhd; @@ -49,7 +49,7 @@ mac_addr_t mac_addr_t::from_string(const std::string &mac_addr_str){ int hex_num; std::istringstream iss(hex_str); iss >> std::hex >> hex_num; - bytes.push_back(boost::uint8_t(hex_num)); + bytes.push_back(uint8_t(hex_num)); } } @@ -68,7 +68,7 @@ byte_vector_t mac_addr_t::to_bytes(void) const{ std::string mac_addr_t::to_string(void) const{ std::string addr = ""; - BOOST_FOREACH(boost::uint8_t byte, this->to_bytes()){ + BOOST_FOREACH(uint8_t byte, this->to_bytes()){ addr += str(boost::format("%s%02x") % ((addr == "")?"":":") % int(byte)); } return addr; diff --git a/host/lib/types/serial.cpp b/host/lib/types/serial.cpp index 52961691c..5d03d40cf 100644 --- a/host/lib/types/serial.cpp +++ b/host/lib/types/serial.cpp @@ -45,8 +45,8 @@ spi_config_t::spi_config_t(edge_t edge): } void i2c_iface::write_eeprom( - boost::uint16_t addr, - boost::uint16_t offset, + uint16_t addr, + uint16_t offset, const byte_vector_t &bytes ){ for (size_t i = 0; i < bytes.size(); i++){ @@ -58,8 +58,8 @@ void i2c_iface::write_eeprom( } byte_vector_t i2c_iface::read_eeprom( - boost::uint16_t addr, - boost::uint16_t offset, + uint16_t addr, + uint16_t offset, size_t num_bytes ){ byte_vector_t bytes; @@ -80,22 +80,22 @@ struct eeprom16_impl : i2c_iface i2c_iface* _internal; byte_vector_t read_i2c( - boost::uint16_t addr, + uint16_t addr, size_t num_bytes ){ return _internal->read_i2c(addr, num_bytes); } void write_i2c( - boost::uint16_t addr, + uint16_t addr, const byte_vector_t &bytes ){ return _internal->write_i2c(addr, bytes); } byte_vector_t read_eeprom( - boost::uint16_t addr, - boost::uint16_t offset, + uint16_t addr, + uint16_t offset, size_t num_bytes ){ byte_vector_t cmd = boost::assign::list_of(offset >> 8)(offset & 0xff); @@ -104,14 +104,14 @@ struct eeprom16_impl : i2c_iface } void write_eeprom( - boost::uint16_t addr, - boost::uint16_t offset, + uint16_t addr, + uint16_t offset, const byte_vector_t &bytes ){ for (size_t i = 0; i < bytes.size(); i++) { //write a byte at a time, its easy that way - boost::uint16_t offset_i = offset+i; + uint16_t offset_i = offset+i; byte_vector_t cmd = boost::assign::list_of(offset_i >> 8)(offset_i & 0xff)(bytes[i]); this->write_i2c(addr, cmd); boost::this_thread::sleep(boost::posix_time::milliseconds(10)); //worst case write @@ -124,10 +124,10 @@ i2c_iface::sptr i2c_iface::eeprom16(void) return i2c_iface::sptr(new eeprom16_impl(this)); } -boost::uint32_t spi_iface::read_spi( +uint32_t spi_iface::read_spi( int which_slave, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ){ return transact_spi( @@ -138,7 +138,7 @@ boost::uint32_t spi_iface::read_spi( void spi_iface::write_spi( int which_slave, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ){ transact_spi( diff --git a/host/lib/types/wb_iface.cpp b/host/lib/types/wb_iface.cpp index dc8d2a83e..686f0e1ee 100644 --- a/host/lib/types/wb_iface.cpp +++ b/host/lib/types/wb_iface.cpp @@ -25,32 +25,32 @@ wb_iface::~wb_iface(void) //NOP } -void wb_iface::poke64(const wb_iface::wb_addr_type, const boost::uint64_t) +void wb_iface::poke64(const wb_iface::wb_addr_type, const uint64_t) { throw uhd::not_implemented_error("poke64 not implemented"); } -boost::uint64_t wb_iface::peek64(const wb_iface::wb_addr_type) +uint64_t wb_iface::peek64(const wb_iface::wb_addr_type) { throw uhd::not_implemented_error("peek64 not implemented"); } -void wb_iface::poke32(const wb_iface::wb_addr_type, const boost::uint32_t) +void wb_iface::poke32(const wb_iface::wb_addr_type, const uint32_t) { throw uhd::not_implemented_error("poke32 not implemented"); } -boost::uint32_t wb_iface::peek32(const wb_iface::wb_addr_type) +uint32_t wb_iface::peek32(const wb_iface::wb_addr_type) { throw uhd::not_implemented_error("peek32 not implemented"); } -void wb_iface::poke16(const wb_iface::wb_addr_type, const boost::uint16_t) +void wb_iface::poke16(const wb_iface::wb_addr_type, const uint16_t) { throw uhd::not_implemented_error("poke16 not implemented"); } -boost::uint16_t wb_iface::peek16(const wb_iface::wb_addr_type) +uint16_t wb_iface::peek16(const wb_iface::wb_addr_type) { throw uhd::not_implemented_error("peek16 not implemented"); } diff --git a/host/lib/usrp/b100/b100_impl.cpp b/host/lib/usrp/b100/b100_impl.cpp index eec9f0e9a..d0b9d835d 100644 --- a/host/lib/usrp/b100/b100_impl.cpp +++ b/host/lib/usrp/b100/b100_impl.cpp @@ -37,10 +37,10 @@ using namespace uhd; using namespace uhd::usrp; using namespace uhd::transport; -const boost::uint16_t B100_VENDOR_ID = 0x2500; -const boost::uint16_t B100_PRODUCT_ID = 0x0002; -const boost::uint16_t FX2_VENDOR_ID = 0x04b4; -const boost::uint16_t FX2_PRODUCT_ID = 0x8613; +const uint16_t B100_VENDOR_ID = 0x2500; +const uint16_t B100_PRODUCT_ID = 0x0002; +const uint16_t FX2_VENDOR_ID = 0x04b4; +const uint16_t FX2_PRODUCT_ID = 0x8613; static const boost::posix_time::milliseconds REENUMERATION_TIMEOUT_MS(3000); /*********************************************************************** @@ -57,11 +57,11 @@ static device_addrs_t b100_find(const device_addr_t &hint) //since an address and resource is intended for a different, non-USB, device. if (hint.has_key("addr") || hint.has_key("resource")) return b100_addrs; - boost::uint16_t vid, pid; + uint16_t vid, pid; if(hint.has_key("vid") && hint.has_key("pid") && hint.has_key("type") && hint["type"] == "b100") { - vid = uhd::cast::hexstr_cast<boost::uint16_t>(hint.get("vid")); - pid = uhd::cast::hexstr_cast<boost::uint16_t>(hint.get("pid")); + vid = uhd::cast::hexstr_cast<uint16_t>(hint.get("vid")); + pid = uhd::cast::hexstr_cast<uint16_t>(hint.get("pid")); } else { vid = B100_VENDOR_ID; pid = B100_PRODUCT_ID; @@ -261,7 +261,7 @@ b100_impl::b100_impl(const device_addr_t &device_addr){ //let packet padder know the LUT size in number of words32 const size_t rx_lut_size = size_t(data_xport_args.cast<double>("recv_frame_size", 0.0)); - _fifo_ctrl->poke32(TOREG(SR_PADDER+0), rx_lut_size/sizeof(boost::uint32_t)); + _fifo_ctrl->poke32(TOREG(SR_PADDER+0), rx_lut_size/sizeof(uint32_t)); _data_transport = usb_zero_copy_make_wrapper( usb_zero_copy::make( @@ -526,7 +526,7 @@ b100_impl::~b100_impl(void){ void b100_impl::check_fw_compat(void){ unsigned char data[4]; //useless data buffer - const boost::uint16_t fw_compat_num = _fx2_ctrl->usrp_control_read( + const uint16_t fw_compat_num = _fx2_ctrl->usrp_control_read( VRQ_FW_COMPAT, 0, 0, data, sizeof(data) ); if (fw_compat_num != B100_FW_COMPAT_NUM){ @@ -540,8 +540,8 @@ void b100_impl::check_fw_compat(void){ } void b100_impl::check_fpga_compat(void){ - const boost::uint32_t fpga_compat_num = _fifo_ctrl->peek32(REG_RB_COMPAT); - boost::uint16_t fpga_major = fpga_compat_num >> 16, fpga_minor = fpga_compat_num & 0xffff; + const uint32_t fpga_compat_num = _fifo_ctrl->peek32(REG_RB_COMPAT); + uint16_t fpga_major = fpga_compat_num >> 16, fpga_minor = fpga_compat_num & 0xffff; if (fpga_major == 0){ //old version scheme fpga_major = fpga_minor; fpga_minor = 0; diff --git a/host/lib/usrp/b100/b100_impl.hpp b/host/lib/usrp/b100/b100_impl.hpp index 7f37030d2..ba4b3cd90 100644 --- a/host/lib/usrp/b100/b100_impl.hpp +++ b/host/lib/usrp/b100/b100_impl.hpp @@ -46,11 +46,11 @@ static const double B100_LINK_RATE_BPS = 256e6/5; //pratical link rate (< 480 Mbps) static const std::string B100_FW_FILE_NAME = "usrp_b100_fw.ihx"; static const std::string B100_FPGA_FILE_NAME = "usrp_b100_fpga.bin"; -static const boost::uint16_t B100_FW_COMPAT_NUM = 4; -static const boost::uint16_t B100_FPGA_COMPAT_NUM = 11; -static const boost::uint32_t B100_RX_SID_BASE = 30; -static const boost::uint32_t B100_TX_ASYNC_SID = 10; -static const boost::uint32_t B100_CTRL_MSG_SID = 20; +static const uint16_t B100_FW_COMPAT_NUM = 4; +static const uint16_t B100_FPGA_COMPAT_NUM = 11; +static const uint32_t B100_RX_SID_BASE = 30; +static const uint32_t B100_TX_ASYNC_SID = 10; +static const uint32_t B100_CTRL_MSG_SID = 20; static const double B100_DEFAULT_TICK_RATE = 64e6; static const size_t B100_MAX_PKT_BYTE_LIMIT = 2048; static const std::string B100_EEPROM_MAP_KEY = "B100"; diff --git a/host/lib/usrp/b100/b100_regs.hpp b/host/lib/usrp/b100/b100_regs.hpp index 48eb0460d..1498613f5 100644 --- a/host/lib/usrp/b100/b100_regs.hpp +++ b/host/lib/usrp/b100/b100_regs.hpp @@ -18,7 +18,7 @@ #ifndef INCLUDED_B100_REGS_HPP #define INCLUDED_B100_REGS_HPP -#include <boost/cstdint.hpp> +#include <stdint.h> #define TOREG(x) ((x)*4) diff --git a/host/lib/usrp/b100/clock_ctrl.cpp b/host/lib/usrp/b100/clock_ctrl.cpp index 85f318470..5700a321a 100644 --- a/host/lib/usrp/b100/clock_ctrl.cpp +++ b/host/lib/usrp/b100/clock_ctrl.cpp @@ -22,7 +22,7 @@ #include <uhd/exception.hpp> #include <uhd/utils/assert_has.hpp> #include <uhd/utils/safe_call.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include "b100_regs.hpp" //spi slave constants #include <boost/assign/list_of.hpp> #include <boost/foreach.hpp> @@ -119,8 +119,8 @@ static clock_settings_type get_clock_settings(double rate){ //X = chan_div * vco_div * R //Y = P*B + A - const boost::uint64_t out_rate = boost::uint64_t(rate); - const boost::uint64_t ref_rate = boost::uint64_t(cs.get_ref_rate()); + const uint64_t out_rate = uint64_t(rate); + const uint64_t ref_rate = uint64_t(cs.get_ref_rate()); const size_t gcd = size_t(boost::math::gcd(ref_rate, out_rate)); for (size_t i = 1; i <= 100; i++){ @@ -446,8 +446,8 @@ public: } bool get_locked(void){ - static const boost::uint8_t addr = 0x01F; - boost::uint32_t reg = this->read_reg(addr); + static const uint8_t addr = 0x01F; + uint32_t reg = this->read_reg(addr); _ad9522_regs.set_reg(addr, reg); return _ad9522_regs.digital_lock_detect != 0; } @@ -464,26 +464,26 @@ private: this->send_reg(0x232); } - void send_reg(boost::uint16_t addr){ - boost::uint32_t reg = _ad9522_regs.get_write_reg(addr); + void send_reg(uint16_t addr){ + uint32_t reg = _ad9522_regs.get_write_reg(addr); UHD_LOGV(often) << "clock control write reg: " << std::hex << reg << std::endl; byte_vector_t buf; - buf.push_back(boost::uint8_t(reg >> 16)); - buf.push_back(boost::uint8_t(reg >> 8)); - buf.push_back(boost::uint8_t(reg & 0xff)); + buf.push_back(uint8_t(reg >> 16)); + buf.push_back(uint8_t(reg >> 8)); + buf.push_back(uint8_t(reg & 0xff)); _iface->write_i2c(0x5C, buf); } - boost::uint8_t read_reg(boost::uint16_t addr){ + uint8_t read_reg(uint16_t addr){ byte_vector_t buf; - buf.push_back(boost::uint8_t(addr >> 8)); - buf.push_back(boost::uint8_t(addr & 0xff)); + buf.push_back(uint8_t(addr >> 8)); + buf.push_back(uint8_t(addr & 0xff)); _iface->write_i2c(0x5C, buf); buf = _iface->read_i2c(0x5C, 1); - return boost::uint32_t(buf[0] & 0xFF); + return uint32_t(buf[0] & 0xFF); } void calibrate_now(void){ @@ -495,10 +495,10 @@ private: this->send_reg(0x18); this->latch_regs(); //wait for calibration done: - static const boost::uint8_t addr = 0x01F; + static const uint8_t addr = 0x01F; for (size_t ms10 = 0; ms10 < 100; ms10++){ boost::this_thread::sleep(boost::posix_time::milliseconds(10)); - boost::uint32_t reg = read_reg(addr); + uint32_t reg = read_reg(addr); _ad9522_regs.set_reg(addr, reg); if (_ad9522_regs.vco_calibration_finished) goto wait_for_ld; } @@ -507,7 +507,7 @@ private: //wait for digital lock detect: for (size_t ms10 = 0; ms10 < 100; ms10++){ boost::this_thread::sleep(boost::posix_time::milliseconds(10)); - boost::uint32_t reg = read_reg(addr); + uint32_t reg = read_reg(addr); _ad9522_regs.set_reg(addr, reg); if (_ad9522_regs.digital_lock_detect) return; } @@ -525,7 +525,7 @@ private: void send_all_regs(void){ //setup a list of register ranges to write - typedef std::pair<boost::uint16_t, boost::uint16_t> range_t; + typedef std::pair<uint16_t, uint16_t> range_t; static const std::vector<range_t> ranges = boost::assign::list_of (range_t(0x000, 0x000)) (range_t(0x010, 0x01F)) (range_t(0x0F0, 0x0FD)) (range_t(0x190, 0x19B)) @@ -534,7 +534,7 @@ private: //write initial register values and latch/update BOOST_FOREACH(const range_t &range, ranges){ - for(boost::uint16_t addr = range.first; addr <= range.second; addr++){ + for(uint16_t addr = range.first; addr <= range.second; addr++){ this->send_reg(addr); } } diff --git a/host/lib/usrp/b100/codec_ctrl.cpp b/host/lib/usrp/b100/codec_ctrl.cpp index 04fbebded..e78608beb 100644 --- a/host/lib/usrp/b100/codec_ctrl.cpp +++ b/host/lib/usrp/b100/codec_ctrl.cpp @@ -22,7 +22,7 @@ #include <uhd/utils/algorithm.hpp> #include <uhd/utils/log.hpp> #include <uhd/utils/safe_call.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/tuple/tuple.hpp> #include <boost/math/special_functions/round.hpp> #include "b100_regs.hpp" //spi slave constants @@ -59,8 +59,8 @@ public: private: spi_iface::sptr _iface; ad9862_regs_t _ad9862_regs; - void send_reg(boost::uint8_t addr); - void recv_reg(boost::uint8_t addr); + void send_reg(uint8_t addr); + void recv_reg(uint8_t addr); }; /*********************************************************************** @@ -109,7 +109,7 @@ b100_codec_ctrl_impl::b100_codec_ctrl_impl(spi_iface::sptr iface){ _ad9862_regs.dll_mode = ad9862_regs_t::DLL_MODE_FAST; //write the register settings to the codec - for (boost::uint8_t addr = 0; addr <= 25; addr++){ + for (uint8_t addr = 0; addr <= 25; addr++){ this->send_reg(addr); } @@ -185,8 +185,8 @@ double b100_codec_ctrl_impl::get_rx_pga_gain(char which){ /*********************************************************************** * Codec Control AUX ADC Methods **********************************************************************/ -static double aux_adc_to_volts(boost::uint8_t high, boost::uint8_t low){ - return double((boost::uint16_t(high) << 2) | low)*3.3/0x3ff; +static double aux_adc_to_volts(uint8_t high, uint8_t low){ + return double((uint16_t(high) << 2) | low)*3.3/0x3ff; } double b100_codec_ctrl_impl::read_aux_adc(aux_adc_t which){ @@ -227,19 +227,19 @@ double b100_codec_ctrl_impl::read_aux_adc(aux_adc_t which){ void b100_codec_ctrl_impl::write_aux_dac(aux_dac_t which, double volts){ //special case for aux dac d (aka sigma delta word) if (which == AUX_DAC_D){ - boost::uint16_t dac_word = uhd::clip(boost::math::iround(volts*0xfff/3.3), 0, 0xfff); - _ad9862_regs.sig_delt_11_4 = boost::uint8_t(dac_word >> 4); - _ad9862_regs.sig_delt_3_0 = boost::uint8_t(dac_word & 0xf); + uint16_t dac_word = uhd::clip(boost::math::iround(volts*0xfff/3.3), 0, 0xfff); + _ad9862_regs.sig_delt_11_4 = uint8_t(dac_word >> 4); + _ad9862_regs.sig_delt_3_0 = uint8_t(dac_word & 0xf); this->send_reg(42); this->send_reg(43); return; } //calculate the dac word for aux dac a, b, c - boost::uint8_t dac_word = uhd::clip(boost::math::iround(volts*0xff/3.3), 0, 0xff); + uint8_t dac_word = uhd::clip(boost::math::iround(volts*0xff/3.3), 0, 0xff); //setup a lookup table for the aux dac params (reg ref, reg addr) - typedef boost::tuple<boost::uint8_t*, boost::uint8_t> dac_params_t; + typedef boost::tuple<uint8_t*, uint8_t> dac_params_t; uhd::dict<aux_dac_t, dac_params_t> aux_dac_to_params = boost::assign::map_list_of (AUX_DAC_A, dac_params_t(&_ad9862_regs.aux_dac_a, 36)) (AUX_DAC_B, dac_params_t(&_ad9862_regs.aux_dac_b, 37)) @@ -248,7 +248,7 @@ void b100_codec_ctrl_impl::write_aux_dac(aux_dac_t which, double volts){ //set the aux dac register UHD_ASSERT_THROW(aux_dac_to_params.has_key(which)); - boost::uint8_t *reg_ref, reg_addr; + uint8_t *reg_ref, reg_addr; boost::tie(reg_ref, reg_addr) = aux_dac_to_params[which]; *reg_ref = dac_word; this->send_reg(reg_addr); @@ -257,8 +257,8 @@ void b100_codec_ctrl_impl::write_aux_dac(aux_dac_t which, double volts){ /*********************************************************************** * Codec Control SPI Methods **********************************************************************/ -void b100_codec_ctrl_impl::send_reg(boost::uint8_t addr){ - boost::uint32_t reg = _ad9862_regs.get_write_reg(addr); +void b100_codec_ctrl_impl::send_reg(uint8_t addr){ + uint32_t reg = _ad9862_regs.get_write_reg(addr); UHD_LOGV(rarely) << "codec control write reg: " << std::hex << reg << std::endl; _iface->transact_spi( B100_SPI_SS_AD9862, @@ -267,16 +267,16 @@ void b100_codec_ctrl_impl::send_reg(boost::uint8_t addr){ ); } -void b100_codec_ctrl_impl::recv_reg(boost::uint8_t addr){ - boost::uint32_t reg = _ad9862_regs.get_read_reg(addr); +void b100_codec_ctrl_impl::recv_reg(uint8_t addr){ + uint32_t reg = _ad9862_regs.get_read_reg(addr); UHD_LOGV(rarely) << "codec control read reg: " << std::hex << reg << std::endl; - boost::uint32_t ret = _iface->transact_spi( + uint32_t ret = _iface->transact_spi( B100_SPI_SS_AD9862, spi_config_t::EDGE_RISE, reg, 16, true /*rb*/ ); - UHD_LOGV(rarely) << "codec control read ret: " << std::hex << boost::uint16_t(ret & 0xFF) << std::endl; - _ad9862_regs.set_reg(addr, boost::uint8_t(ret&0xff)); + UHD_LOGV(rarely) << "codec control read ret: " << std::hex << uint16_t(ret & 0xFF) << std::endl; + _ad9862_regs.set_reg(addr, uint8_t(ret&0xff)); } /*********************************************************************** diff --git a/host/lib/usrp/b100/dboard_iface.cpp b/host/lib/usrp/b100/dboard_iface.cpp index 9829f3f09..9b90d676a 100644 --- a/host/lib/usrp/b100/dboard_iface.cpp +++ b/host/lib/usrp/b100/dboard_iface.cpp @@ -66,33 +66,33 @@ public: void write_aux_dac(unit_t, aux_dac_t, double); double read_aux_adc(unit_t, aux_adc_t); - void set_pin_ctrl(unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_pin_ctrl(unit_t unit); - void set_atr_reg(unit_t unit, atr_reg_t reg, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_atr_reg(unit_t unit, atr_reg_t reg); - void set_gpio_ddr(unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_gpio_ddr(unit_t unit); - void set_gpio_out(unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_gpio_out(unit_t unit); - boost::uint32_t read_gpio(unit_t unit); + void set_pin_ctrl(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_pin_ctrl(unit_t unit); + void set_atr_reg(unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_atr_reg(unit_t unit, atr_reg_t reg); + void set_gpio_ddr(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_gpio_ddr(unit_t unit); + void set_gpio_out(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_gpio_out(unit_t unit); + uint32_t read_gpio(unit_t unit); void set_command_time(const uhd::time_spec_t& t); uhd::time_spec_t get_command_time(void); - void write_i2c(boost::uint16_t, const byte_vector_t &); - byte_vector_t read_i2c(boost::uint16_t, size_t); + void write_i2c(uint16_t, const byte_vector_t &); + byte_vector_t read_i2c(uint16_t, size_t); void write_spi( unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ); - boost::uint32_t read_write_spi( + uint32_t read_write_spi( unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ); @@ -167,39 +167,39 @@ double b100_dboard_iface::get_codec_rate(unit_t){ /*********************************************************************** * GPIO **********************************************************************/ -void b100_dboard_iface::set_pin_ctrl(unit_t unit, boost::uint32_t value, boost::uint32_t mask){ - _gpio->set_pin_ctrl(unit, static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask)); +void b100_dboard_iface::set_pin_ctrl(unit_t unit, uint32_t value, uint32_t mask){ + _gpio->set_pin_ctrl(unit, static_cast<uint16_t>(value), static_cast<uint16_t>(mask)); } -boost::uint32_t b100_dboard_iface::get_pin_ctrl(unit_t unit){ - return static_cast<boost::uint32_t>(_gpio->get_pin_ctrl(unit)); +uint32_t b100_dboard_iface::get_pin_ctrl(unit_t unit){ + return static_cast<uint32_t>(_gpio->get_pin_ctrl(unit)); } -void b100_dboard_iface::set_atr_reg(unit_t unit, atr_reg_t reg, boost::uint32_t value, boost::uint32_t mask){ - _gpio->set_atr_reg(unit, reg, static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask)); +void b100_dboard_iface::set_atr_reg(unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask){ + _gpio->set_atr_reg(unit, reg, static_cast<uint16_t>(value), static_cast<uint16_t>(mask)); } -boost::uint32_t b100_dboard_iface::get_atr_reg(unit_t unit, atr_reg_t reg){ - return static_cast<boost::uint32_t>(_gpio->get_atr_reg(unit, reg)); +uint32_t b100_dboard_iface::get_atr_reg(unit_t unit, atr_reg_t reg){ + return static_cast<uint32_t>(_gpio->get_atr_reg(unit, reg)); } -void b100_dboard_iface::set_gpio_ddr(unit_t unit, boost::uint32_t value, boost::uint32_t mask){ - _gpio->set_gpio_ddr(unit, static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask)); +void b100_dboard_iface::set_gpio_ddr(unit_t unit, uint32_t value, uint32_t mask){ + _gpio->set_gpio_ddr(unit, static_cast<uint16_t>(value), static_cast<uint16_t>(mask)); } -boost::uint32_t b100_dboard_iface::get_gpio_ddr(unit_t unit){ - return static_cast<boost::uint32_t>(_gpio->get_gpio_ddr(unit)); +uint32_t b100_dboard_iface::get_gpio_ddr(unit_t unit){ + return static_cast<uint32_t>(_gpio->get_gpio_ddr(unit)); } -void b100_dboard_iface::set_gpio_out(unit_t unit, boost::uint32_t value, boost::uint32_t mask){ - _gpio->set_gpio_out(unit, static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask)); +void b100_dboard_iface::set_gpio_out(unit_t unit, uint32_t value, uint32_t mask){ + _gpio->set_gpio_out(unit, static_cast<uint16_t>(value), static_cast<uint16_t>(mask)); } -boost::uint32_t b100_dboard_iface::get_gpio_out(unit_t unit){ - return static_cast<boost::uint32_t>(_gpio->get_gpio_out(unit)); +uint32_t b100_dboard_iface::get_gpio_out(unit_t unit){ + return static_cast<uint32_t>(_gpio->get_gpio_out(unit)); } -boost::uint32_t b100_dboard_iface::read_gpio(unit_t unit){ +uint32_t b100_dboard_iface::read_gpio(unit_t unit){ return _gpio->read_gpio(unit); } @@ -211,7 +211,7 @@ boost::uint32_t b100_dboard_iface::read_gpio(unit_t unit){ * \param unit the dboard interface unit type enum * \return the slave device number */ -static boost::uint32_t unit_to_otw_spi_dev(dboard_iface::unit_t unit){ +static uint32_t unit_to_otw_spi_dev(dboard_iface::unit_t unit){ switch(unit){ case dboard_iface::UNIT_TX: return B100_SPI_SS_TX_DB; case dboard_iface::UNIT_RX: return B100_SPI_SS_RX_DB; @@ -222,16 +222,16 @@ static boost::uint32_t unit_to_otw_spi_dev(dboard_iface::unit_t unit){ void b100_dboard_iface::write_spi( unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ){ _spi_iface->write_spi(unit_to_otw_spi_dev(unit), config, data, num_bits); } -boost::uint32_t b100_dboard_iface::read_write_spi( +uint32_t b100_dboard_iface::read_write_spi( unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ){ return _spi_iface->read_spi(unit_to_otw_spi_dev(unit), config, data, num_bits); @@ -240,11 +240,11 @@ boost::uint32_t b100_dboard_iface::read_write_spi( /*********************************************************************** * I2C **********************************************************************/ -void b100_dboard_iface::write_i2c(boost::uint16_t addr, const byte_vector_t &bytes){ +void b100_dboard_iface::write_i2c(uint16_t addr, const byte_vector_t &bytes){ return _i2c_iface->write_i2c(addr, bytes); } -byte_vector_t b100_dboard_iface::read_i2c(boost::uint16_t addr, size_t num_bytes){ +byte_vector_t b100_dboard_iface::read_i2c(uint16_t addr, size_t num_bytes){ return _i2c_iface->read_i2c(addr, num_bytes); } diff --git a/host/lib/usrp/b100/io_impl.cpp b/host/lib/usrp/b100/io_impl.cpp index 86edb4ed6..c1810ed8c 100644 --- a/host/lib/usrp/b100/io_impl.cpp +++ b/host/lib/usrp/b100/io_impl.cpp @@ -129,7 +129,7 @@ rx_streamer::sptr b100_impl::get_rx_stream(const uhd::stream_args_t &args_){ //calculate packet size static const size_t hdr_size = 0 - + vrt::max_if_hdr_words32*sizeof(boost::uint32_t) + + vrt::max_if_hdr_words32*sizeof(uint32_t) + sizeof(vrt::if_packet_info_t().tlr) //forced to have trailer - sizeof(vrt::if_packet_info_t().cid) //no class id ever used - sizeof(vrt::if_packet_info_t().tsi) //no int time ever used @@ -188,7 +188,7 @@ tx_streamer::sptr b100_impl::get_tx_stream(const uhd::stream_args_t &args_){ //calculate packet size static const size_t hdr_size = 0 - + vrt::max_if_hdr_words32*sizeof(boost::uint32_t) + + vrt::max_if_hdr_words32*sizeof(uint32_t) + sizeof(vrt::if_packet_info_t().tlr) //forced to have trailer - sizeof(vrt::if_packet_info_t().sid) //no stream id ever used - sizeof(vrt::if_packet_info_t().cid) //no class id ever used diff --git a/host/lib/usrp/b100/usb_zero_copy_wrapper.cpp b/host/lib/usrp/b100/usb_zero_copy_wrapper.cpp index d646fcc94..d57d57f21 100644 --- a/host/lib/usrp/b100/usb_zero_copy_wrapper.cpp +++ b/host/lib/usrp/b100/usb_zero_copy_wrapper.cpp @@ -60,9 +60,9 @@ public: //extract this packet's memory address and length in bytes char *mem = mrb->cast<char *>() + offset_bytes; - const boost::uint32_t *mem32 = reinterpret_cast<const boost::uint32_t *>(mem); + const uint32_t *mem32 = reinterpret_cast<const uint32_t *>(mem); const size_t words32 = (uhd::wtohx(mem32[0]) & 0xffff); //length in words32 (from VRT header) - const size_t len = words32*sizeof(boost::uint32_t); //length in bytes + const size_t len = words32*sizeof(uint32_t); //length in bytes //check if this receive buffer has been exhausted offset_bytes += len; @@ -100,7 +100,7 @@ public: _ok_to_auto_flush = true; //get a reference to the VITA header before incrementing - const boost::uint32_t vita_header = reinterpret_cast<const boost::uint32_t *>(_mem_buffer_tip)[0]; + const uint32_t vita_header = reinterpret_cast<const uint32_t *>(_mem_buffer_tip)[0]; _bytes_in_buffer += size(); _mem_buffer_tip += size(); diff --git a/host/lib/usrp/b200/b200_cores.cpp b/host/lib/usrp/b200/b200_cores.cpp index 19e637ef4..dcfd41825 100644 --- a/host/lib/usrp/b200/b200_cores.cpp +++ b/host/lib/usrp/b200/b200_cores.cpp @@ -29,10 +29,10 @@ b200_local_spi_core::b200_local_spi_core( change_perif(default_perif); } -boost::uint32_t b200_local_spi_core::transact_spi( +uint32_t b200_local_spi_core::transact_spi( int which_slave, const uhd::spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits, bool readback) { diff --git a/host/lib/usrp/b200/b200_cores.hpp b/host/lib/usrp/b200/b200_cores.hpp index 32e583794..54f5e5926 100644 --- a/host/lib/usrp/b200/b200_cores.hpp +++ b/host/lib/usrp/b200/b200_cores.hpp @@ -33,10 +33,10 @@ public: b200_local_spi_core(uhd::wb_iface::sptr iface, perif_t default_perif); - virtual boost::uint32_t transact_spi( + virtual uint32_t transact_spi( int which_slave, const uhd::spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits, bool readback); diff --git a/host/lib/usrp/b200/b200_iface.cpp b/host/lib/usrp/b200/b200_iface.cpp index 218f8fd0e..4e6dd2144 100644 --- a/host/lib/usrp/b200/b200_iface.cpp +++ b/host/lib/usrp/b200/b200_iface.cpp @@ -24,7 +24,7 @@ #include <uhd/exception.hpp> #include <boost/functional/hash.hpp> #include <boost/thread/thread.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/lexical_cast.hpp> #include <boost/format.hpp> #include <fstream> @@ -45,42 +45,42 @@ using namespace uhd::transport; static const bool load_img_msg = true; -const static boost::uint8_t FX3_FIRMWARE_LOAD = 0xA0; -const static boost::uint8_t VRT_VENDOR_OUT = (LIBUSB_REQUEST_TYPE_VENDOR +const static uint8_t FX3_FIRMWARE_LOAD = 0xA0; +const static uint8_t VRT_VENDOR_OUT = (LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_OUT); -const static boost::uint8_t VRT_VENDOR_IN = (LIBUSB_REQUEST_TYPE_VENDOR +const static uint8_t VRT_VENDOR_IN = (LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN); -const static boost::uint8_t B200_VREQ_FPGA_START = 0x02; -const static boost::uint8_t B200_VREQ_FPGA_DATA = 0x12; -const static boost::uint8_t B200_VREQ_GET_COMPAT = 0x15; -const static boost::uint8_t B200_VREQ_SET_FPGA_HASH = 0x1C; -const static boost::uint8_t B200_VREQ_GET_FPGA_HASH = 0x1D; -const static boost::uint8_t B200_VREQ_SET_FW_HASH = 0x1E; -const static boost::uint8_t B200_VREQ_GET_FW_HASH = 0x1F; -const static boost::uint8_t B200_VREQ_LOOP = 0x22; -const static boost::uint8_t B200_VREQ_FPGA_CONFIG = 0x55; -const static boost::uint8_t B200_VREQ_FPGA_RESET = 0x62; -const static boost::uint8_t B200_VREQ_GPIF_RESET = 0x72; -const static boost::uint8_t B200_VREQ_GET_USB = 0x80; -const static boost::uint8_t B200_VREQ_GET_STATUS = 0x83; -const static boost::uint8_t B200_VREQ_FX3_RESET = 0x99; -const static boost::uint8_t B200_VREQ_EEPROM_WRITE = 0xBA; -const static boost::uint8_t B200_VREQ_EEPROM_READ = 0xBB; - -const static boost::uint8_t FX3_STATE_UNDEFINED = 0x00; -const static boost::uint8_t FX3_STATE_FPGA_READY = 0x01; -const static boost::uint8_t FX3_STATE_CONFIGURING_FPGA = 0x02; -const static boost::uint8_t FX3_STATE_BUSY = 0x03; -const static boost::uint8_t FX3_STATE_RUNNING = 0x04; -const static boost::uint8_t FX3_STATE_UNCONFIGURED = 0x05; -const static boost::uint8_t FX3_STATE_ERROR = 0x06; +const static uint8_t B200_VREQ_FPGA_START = 0x02; +const static uint8_t B200_VREQ_FPGA_DATA = 0x12; +const static uint8_t B200_VREQ_GET_COMPAT = 0x15; +const static uint8_t B200_VREQ_SET_FPGA_HASH = 0x1C; +const static uint8_t B200_VREQ_GET_FPGA_HASH = 0x1D; +const static uint8_t B200_VREQ_SET_FW_HASH = 0x1E; +const static uint8_t B200_VREQ_GET_FW_HASH = 0x1F; +const static uint8_t B200_VREQ_LOOP = 0x22; +const static uint8_t B200_VREQ_FPGA_CONFIG = 0x55; +const static uint8_t B200_VREQ_FPGA_RESET = 0x62; +const static uint8_t B200_VREQ_GPIF_RESET = 0x72; +const static uint8_t B200_VREQ_GET_USB = 0x80; +const static uint8_t B200_VREQ_GET_STATUS = 0x83; +const static uint8_t B200_VREQ_FX3_RESET = 0x99; +const static uint8_t B200_VREQ_EEPROM_WRITE = 0xBA; +const static uint8_t B200_VREQ_EEPROM_READ = 0xBB; + +const static uint8_t FX3_STATE_UNDEFINED = 0x00; +const static uint8_t FX3_STATE_FPGA_READY = 0x01; +const static uint8_t FX3_STATE_CONFIGURING_FPGA = 0x02; +const static uint8_t FX3_STATE_BUSY = 0x03; +const static uint8_t FX3_STATE_RUNNING = 0x04; +const static uint8_t FX3_STATE_UNCONFIGURED = 0x05; +const static uint8_t FX3_STATE_ERROR = 0x06; const static int VREQ_MAX_SIZE_USB2 = 64; const static int VREQ_MAX_SIZE_USB3 = 512; const static int VREQ_DEFAULT_SIZE = VREQ_MAX_SIZE_USB2; const static int VREQ_MAX_SIZE = VREQ_MAX_SIZE_USB3; -typedef boost::uint32_t hash_type; +typedef uint32_t hash_type; /*********************************************************************** @@ -137,12 +137,12 @@ public: //NOP } - int fx3_control_write(boost::uint8_t request, - boost::uint16_t value, - boost::uint16_t index, + int fx3_control_write(uint8_t request, + uint16_t value, + uint16_t index, unsigned char *buff, - boost::uint16_t length, - boost::uint32_t timeout = 0) { + uint16_t length, + uint32_t timeout = 0) { return _usb_ctrl->submit(VRT_VENDOR_OUT, // bmReqeustType request, // bRequest value, // wValue @@ -152,12 +152,12 @@ public: timeout); // timeout } - int fx3_control_read(boost::uint8_t request, - boost::uint16_t value, - boost::uint16_t index, + int fx3_control_read(uint8_t request, + uint16_t value, + uint16_t index, unsigned char *buff, - boost::uint16_t length, - boost::uint32_t timeout = 0) { + uint16_t length, + uint32_t timeout = 0) { return _usb_ctrl->submit(VRT_VENDOR_IN, // bmReqeustType request, // bRequest value, // wValue @@ -167,21 +167,21 @@ public: timeout); // timeout } - void write_i2c(UHD_UNUSED(boost::uint16_t addr), UHD_UNUSED(const byte_vector_t &bytes)) + void write_i2c(UHD_UNUSED(uint16_t addr), UHD_UNUSED(const byte_vector_t &bytes)) { throw uhd::not_implemented_error("b200 write i2c"); } - byte_vector_t read_i2c(UHD_UNUSED(boost::uint16_t addr), UHD_UNUSED(size_t num_bytes)) + byte_vector_t read_i2c(UHD_UNUSED(uint16_t addr), UHD_UNUSED(size_t num_bytes)) { throw uhd::not_implemented_error("b200 read i2c"); } - void write_eeprom(boost::uint16_t addr, boost::uint16_t offset, + void write_eeprom(uint16_t addr, uint16_t offset, const byte_vector_t &bytes) { int ret = fx3_control_write(B200_VREQ_EEPROM_WRITE, - 0, offset | (boost::uint16_t(addr) << 8), + 0, offset | (uint16_t(addr) << 8), (unsigned char *) &bytes[0], bytes.size()); @@ -192,12 +192,12 @@ public: } byte_vector_t read_eeprom( - boost::uint16_t addr, - boost::uint16_t offset, + uint16_t addr, + uint16_t offset, size_t num_bytes) { byte_vector_t recv_bytes(num_bytes); int bytes_read = fx3_control_read(B200_VREQ_EEPROM_READ, - 0, offset | (boost::uint16_t(addr) << 8), + 0, offset | (uint16_t(addr) << 8), (unsigned char*) &recv_bytes[0], num_bytes); @@ -281,7 +281,7 @@ public: */ } - boost::uint8_t get_usb_speed(void) { + uint8_t get_usb_speed(void) { unsigned char rx_data[1]; memset(rx_data, 0x00, sizeof(rx_data)); @@ -293,10 +293,10 @@ public: else if (ret != bytes_to_recv) throw uhd::io_error((boost::format("Short read on get USB speed (expecting: %d, returned: %d)") % bytes_to_recv % ret).str()); - return boost::lexical_cast<boost::uint8_t>(rx_data[0]); + return boost::lexical_cast<uint8_t>(rx_data[0]); } - boost::uint8_t get_fx3_status(void) { + uint8_t get_fx3_status(void) { unsigned char rx_data[1]; memset(rx_data, 0x00, sizeof(rx_data)); @@ -308,10 +308,10 @@ public: else if (ret != bytes_to_recv) throw uhd::io_error((boost::format("Short read on get FX3 status (expecting: %d, returned: %d)") % bytes_to_recv % ret).str()); - return boost::lexical_cast<boost::uint8_t>(rx_data[0]); + return boost::lexical_cast<uint8_t>(rx_data[0]); } - boost::uint16_t get_compat_num(void) { + uint16_t get_compat_num(void) { unsigned char rx_data[2]; memset(rx_data, 0x00, sizeof(rx_data)); @@ -374,10 +374,10 @@ public: throw uhd::io_error((boost::format("Short write on set FPGA hash (expecting: %d, returned: %d)") % bytes_to_send % ret).str()); } - boost::uint32_t load_fpga(const std::string filestring, bool force) { + uint32_t load_fpga(const std::string filestring, bool force) { - boost::uint8_t fx3_state = 0; - boost::uint32_t wait_count; + uint8_t fx3_state = 0; + uint32_t wait_count; int ret = 0; int bytes_to_xfer = 0; @@ -476,7 +476,7 @@ public: if(n == 0) continue; - boost::uint16_t transfer_count = boost::uint16_t(n); + uint16_t transfer_count = uint16_t(n); /* Send the data to the device. */ int nwritten = fx3_control_write(B200_VREQ_FPGA_DATA, 0, 0, out_buff, transfer_count, 5000); @@ -526,7 +526,7 @@ private: }; -std::string b200_iface::fx3_state_string(boost::uint8_t state) +std::string b200_iface::fx3_state_string(uint8_t state) { switch (state) { diff --git a/host/lib/usrp/b200/b200_iface.hpp b/host/lib/usrp/b200/b200_iface.hpp index e45c78d49..0cddbf801 100644 --- a/host/lib/usrp/b200/b200_iface.hpp +++ b/host/lib/usrp/b200/b200_iface.hpp @@ -35,19 +35,19 @@ enum b200_product_t { }; // These are actual USB PIDs (not Ettus Product IDs) -const static boost::uint16_t B200_VENDOR_ID = 0x2500; -const static boost::uint16_t B200_VENDOR_NI_ID = 0x3923; -const static boost::uint16_t B200_PRODUCT_ID = 0x0020; -const static boost::uint16_t B200MINI_PRODUCT_ID = 0x0021; -const static boost::uint16_t B205MINI_PRODUCT_ID = 0x0022; -const static boost::uint16_t B200_PRODUCT_NI_ID = 0x7813; -const static boost::uint16_t B210_PRODUCT_NI_ID = 0x7814; -const static boost::uint16_t FX3_VID = 0x04b4; -const static boost::uint16_t FX3_DEFAULT_PID = 0x00f3; -const static boost::uint16_t FX3_REENUM_PID = 0x00f0; +const static uint16_t B200_VENDOR_ID = 0x2500; +const static uint16_t B200_VENDOR_NI_ID = 0x3923; +const static uint16_t B200_PRODUCT_ID = 0x0020; +const static uint16_t B200MINI_PRODUCT_ID = 0x0021; +const static uint16_t B205MINI_PRODUCT_ID = 0x0022; +const static uint16_t B200_PRODUCT_NI_ID = 0x7813; +const static uint16_t B210_PRODUCT_NI_ID = 0x7814; +const static uint16_t FX3_VID = 0x04b4; +const static uint16_t FX3_DEFAULT_PID = 0x00f3; +const static uint16_t FX3_REENUM_PID = 0x00f0; //! Map the USB PID to the product (only for PIDs that map to a single product) -static const uhd::dict<boost::uint16_t, b200_product_t> B2XX_PID_TO_PRODUCT = boost::assign::map_list_of +static const uhd::dict<uint16_t, b200_product_t> B2XX_PID_TO_PRODUCT = boost::assign::map_list_of (B200_PRODUCT_NI_ID, B200) (B210_PRODUCT_NI_ID, B210) (B200MINI_PRODUCT_ID, B200MINI) @@ -57,7 +57,7 @@ static const uhd::dict<boost::uint16_t, b200_product_t> B2XX_PID_TO_PRODUCT = bo static const std::string B200_FW_FILE_NAME = "usrp_b200_fw.hex"; //! Map the EEPROM product ID codes to the product -static const uhd::dict<boost::uint16_t, b200_product_t> B2XX_PRODUCT_ID = boost::assign::map_list_of +static const uhd::dict<uint16_t, b200_product_t> B2XX_PRODUCT_ID = boost::assign::map_list_of (0x0001, B200) (0x7737, B200) (B200_PRODUCT_NI_ID, B200) @@ -98,13 +98,13 @@ public: static sptr make(uhd::transport::usb_control::sptr usb_ctrl); //! query the device USB speed (2, 3) - virtual boost::uint8_t get_usb_speed(void) = 0; + virtual uint8_t get_usb_speed(void) = 0; //! get the current status of the FX3 - virtual boost::uint8_t get_fx3_status(void) = 0; + virtual uint8_t get_fx3_status(void) = 0; //! get the current status of the FX3 - virtual boost::uint16_t get_compat_num(void) = 0; + virtual uint16_t get_compat_num(void) = 0; //! load a firmware image virtual void load_firmware(const std::string filestring, bool force=false) = 0; @@ -119,13 +119,13 @@ public: virtual void set_fpga_reset_pin(const bool reset) = 0; //! load an FPGA image - virtual boost::uint32_t load_fpga(const std::string filestring, bool force=false) = 0; + virtual uint32_t load_fpga(const std::string filestring, bool force=false) = 0; - virtual void write_eeprom(boost::uint16_t addr, boost::uint16_t offset, const uhd::byte_vector_t &bytes) = 0; + virtual void write_eeprom(uint16_t addr, uint16_t offset, const uhd::byte_vector_t &bytes) = 0; - virtual uhd::byte_vector_t read_eeprom(boost::uint16_t addr, boost::uint16_t offset, size_t num_bytes) = 0; + virtual uhd::byte_vector_t read_eeprom(uint16_t addr, uint16_t offset, size_t num_bytes) = 0; - static std::string fx3_state_string(boost::uint8_t state); + static std::string fx3_state_string(uint8_t state); }; diff --git a/host/lib/usrp/b200/b200_image_loader.cpp b/host/lib/usrp/b200/b200_image_loader.cpp index e8fb8afea..b9c2c0caf 100644 --- a/host/lib/usrp/b200/b200_image_loader.cpp +++ b/host/lib/usrp/b200/b200_image_loader.cpp @@ -114,7 +114,7 @@ static bool b200_image_loader(const image_loader::image_loader_args_t &image_loa * filename for us to use. */ std::string product = mb_eeprom.get("product"); - if(not B2XX_PRODUCT_ID.has_key(boost::lexical_cast<boost::uint16_t>(product))){ + if(not B2XX_PRODUCT_ID.has_key(boost::lexical_cast<uint16_t>(product))){ if(user_specified){ // The user specified a bad device but expects us to know what it is throw uhd::runtime_error("Could not determine model. You must manually specify an FPGA image filename."); diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 9bd2799c2..e2a0e0b70 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -130,7 +130,7 @@ std::string check_option_valid( b200_product_t get_b200_product(const usb_device_handle::sptr& handle, const mboard_eeprom_t &mb_eeprom) { // Try USB PID first - boost::uint16_t product_id = handle->get_product_id(); + uint16_t product_id = handle->get_product_id(); if (B2XX_PID_TO_PRODUCT.has_key(product_id)) return B2XX_PID_TO_PRODUCT[product_id]; @@ -138,7 +138,7 @@ b200_product_t get_b200_product(const usb_device_handle::sptr& handle, const mbo if (mb_eeprom["product"].empty()) { throw uhd::runtime_error("B200: Missing product ID on EEPROM."); } - product_id = boost::lexical_cast<boost::uint16_t>(mb_eeprom["product"]); + product_id = boost::lexical_cast<uint16_t>(mb_eeprom["product"]); if (not B2XX_PRODUCT_ID.has_key(product_id)) { throw uhd::runtime_error(str( boost::format("B200 unknown product code: 0x%04x") @@ -153,8 +153,8 @@ std::vector<usb_device_handle::sptr> get_b200_device_handles(const device_addr_t std::vector<usb_device_handle::vid_pid_pair_t> vid_pid_pair_list; if(hint.has_key("vid") && hint.has_key("pid") && hint.has_key("type") && hint["type"] == "b200") { - vid_pid_pair_list.push_back(usb_device_handle::vid_pid_pair_t(uhd::cast::hexstr_cast<boost::uint16_t>(hint.get("vid")), - uhd::cast::hexstr_cast<boost::uint16_t>(hint.get("pid")))); + vid_pid_pair_list.push_back(usb_device_handle::vid_pid_pair_t(uhd::cast::hexstr_cast<uint16_t>(hint.get("vid")), + uhd::cast::hexstr_cast<uint16_t>(hint.get("pid")))); } else { vid_pid_pair_list = b200_vid_pid_pairs; } @@ -292,20 +292,20 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s const fs_path mb_path = "/mboards/0"; //try to match the given device address with something on the USB bus - boost::uint16_t vid = B200_VENDOR_ID; - boost::uint16_t pid = B200_PRODUCT_ID; + uint16_t vid = B200_VENDOR_ID; + uint16_t pid = B200_PRODUCT_ID; bool specified_vid = false; bool specified_pid = false; if (device_addr.has_key("vid")) { - vid = uhd::cast::hexstr_cast<boost::uint16_t>(device_addr.get("vid")); + vid = uhd::cast::hexstr_cast<uint16_t>(device_addr.get("vid")); specified_vid = true; } if (device_addr.has_key("pid")) { - pid = uhd::cast::hexstr_cast<boost::uint16_t>(device_addr.get("pid")); + pid = uhd::cast::hexstr_cast<uint16_t>(device_addr.get("pid")); specified_pid = true; } @@ -425,7 +425,7 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s device_addr.has_key("fpga")? device_addr["fpga"] : default_file_name ); - boost::uint32_t status = _iface->load_fpga(b200_fpga_image); + uint32_t status = _iface->load_fpga(b200_fpga_image); if(status != 0) { throw uhd::runtime_error(str(boost::format("fx3 is in state %1%") % status)); @@ -436,7 +436,7 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s //////////////////////////////////////////////////////////////////// // Create control transport //////////////////////////////////////////////////////////////////// - boost::uint8_t usb_speed = _iface->get_usb_speed(); + uint8_t usb_speed = _iface->get_usb_speed(); UHD_MSG(status) << "Operating over USB " << (int) usb_speed << "." << std::endl; const std::string min_frame_size = (usb_speed == 3) ? "1024" : "512"; @@ -672,11 +672,11 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s _radio_perifs[0].fp_gpio = gpio_atr_3000::make(_radio_perifs[0].ctrl, TOREG(SR_FP_GPIO), RB32_FP_GPIO); BOOST_FOREACH(const gpio_attr_map_t::value_type attr, gpio_attr_map) { - _tree->create<boost::uint32_t>(mb_path / "gpio" / "FP0" / attr.second) + _tree->create<uint32_t>(mb_path / "gpio" / "FP0" / attr.second) .set(0) .add_coerced_subscriber(boost::bind(&gpio_atr_3000::set_gpio_attr, _radio_perifs[0].fp_gpio, attr.first, _1)); } - _tree->create<boost::uint32_t>(mb_path / "gpio" / "FP0" / "READBACK") + _tree->create<uint32_t>(mb_path / "gpio" / "FP0" / "READBACK") .set_publisher(boost::bind(&gpio_atr_3000::read_gpio, _radio_perifs[0].fp_gpio)); //////////////////////////////////////////////////////////////////// @@ -751,7 +751,7 @@ void b200_impl::setup_radio(const size_t dspno) //////////////////////////////////////////////////////////////////// // Set up transport //////////////////////////////////////////////////////////////////// - const boost::uint32_t sid = (dspno == 0) ? B200_CTRL0_MSG_SID : B200_CTRL1_MSG_SID; + const uint32_t sid = (dspno == 0) ? B200_CTRL0_MSG_SID : B200_CTRL1_MSG_SID; //////////////////////////////////////////////////////////////////// // radio control @@ -879,8 +879,8 @@ void b200_impl::register_loopback_self_test(wb_iface::sptr iface) for (size_t i = 0; i < 100; i++) { boost::hash_combine(hash, i); - iface->poke32(TOREG(SR_TEST), boost::uint32_t(hash)); - test_fail = iface->peek32(RB32_TEST) != boost::uint32_t(hash); + iface->poke32(TOREG(SR_TEST), uint32_t(hash)); + test_fail = iface->peek32(RB32_TEST) != uint32_t(hash); if (test_fail) break; //exit loop on any failure } UHD_MSG(status) << ((test_fail)? "fail" : "pass") << std::endl; @@ -946,9 +946,9 @@ double b200_impl::set_tick_rate(const double new_tick_rate) void b200_impl::check_fw_compat(void) { - boost::uint16_t compat_num = _iface->get_compat_num(); - boost::uint32_t compat_major = (boost::uint32_t) (compat_num >> 8); - boost::uint32_t compat_minor = (boost::uint32_t) (compat_num & 0xFF); + uint16_t compat_num = _iface->get_compat_num(); + uint32_t compat_major = (uint32_t) (compat_num >> 8); + uint32_t compat_minor = (uint32_t) (compat_num & 0xFF); if (compat_major != B200_FW_COMPAT_NUM_MAJOR){ throw uhd::runtime_error(str(boost::format( @@ -964,14 +964,14 @@ void b200_impl::check_fw_compat(void) void b200_impl::check_fpga_compat(void) { - const boost::uint64_t compat = _local_ctrl->peek64(0); - const boost::uint32_t signature = boost::uint32_t(compat >> 32); - const boost::uint16_t compat_major = boost::uint16_t(compat >> 16); - const boost::uint16_t compat_minor = boost::uint16_t(compat & 0xffff); + const uint64_t compat = _local_ctrl->peek64(0); + const uint32_t signature = uint32_t(compat >> 32); + const uint16_t compat_major = uint16_t(compat >> 16); + const uint16_t compat_minor = uint16_t(compat & 0xffff); if (signature != 0xACE0BA5E) throw uhd::runtime_error( "b200::check_fpga_compat signature register readback failed"); - const boost::uint16_t expected = ((_product == B200MINI or _product == B205MINI) ? B205_FPGA_COMPAT_NUM : B200_FPGA_COMPAT_NUM); + const uint16_t expected = ((_product == B200MINI or _product == B205MINI) ? B205_FPGA_COMPAT_NUM : B200_FPGA_COMPAT_NUM); if (compat_major != expected) { throw uhd::runtime_error(str(boost::format( @@ -1090,7 +1090,7 @@ void b200_impl::set_time(const uhd::time_spec_t& t) { BOOST_FOREACH(radio_perifs_t &perif, _radio_perifs) perif.time64->set_time_sync(t); - _local_ctrl->poke32(TOREG(SR_CORE_SYNC), 1 << 2 | boost::uint32_t(_time_source)); + _local_ctrl->poke32(TOREG(SR_CORE_SYNC), 1 << 2 | uint32_t(_time_source)); _local_ctrl->poke32(TOREG(SR_CORE_SYNC), _time_source); } @@ -1145,7 +1145,7 @@ void b200_impl::update_bandsel(const std::string& which, double freq) void b200_impl::update_gpio_state(void) { - const boost::uint32_t misc_word = 0 + const uint32_t misc_word = 0 | (_gpio_state.swap_atr << 8) | (_gpio_state.tx_bandsel_a << 7) | (_gpio_state.tx_bandsel_b << 6) @@ -1243,7 +1243,7 @@ sensor_value_t b200_impl::get_ref_locked(void) sensor_value_t b200_impl::get_fe_pll_locked(const bool is_tx) { - const boost::uint32_t st = _local_ctrl->peek32(RB32_CORE_PLL); + const uint32_t st = _local_ctrl->peek32(RB32_CORE_PLL); const bool locked = is_tx ? ((st & 0x1) > 0) : ((st & 0x2) > 0); return sensor_value_t("LO", locked, "locked", "unlocked"); } diff --git a/host/lib/usrp/b200/b200_impl.hpp b/host/lib/usrp/b200/b200_impl.hpp index 130e93891..1c756c56d 100644 --- a/host/lib/usrp/b200/b200_impl.hpp +++ b/host/lib/usrp/b200/b200_impl.hpp @@ -47,37 +47,37 @@ #include <boost/assign.hpp> #include <boost/weak_ptr.hpp> #include "recv_packet_demuxer_3000.hpp" -static const boost::uint8_t B200_FW_COMPAT_NUM_MAJOR = 8; -static const boost::uint8_t B200_FW_COMPAT_NUM_MINOR = 0; -static const boost::uint16_t B200_FPGA_COMPAT_NUM = 14; -static const boost::uint16_t B205_FPGA_COMPAT_NUM = 5; +static const uint8_t B200_FW_COMPAT_NUM_MAJOR = 8; +static const uint8_t B200_FW_COMPAT_NUM_MINOR = 0; +static const uint16_t B200_FPGA_COMPAT_NUM = 14; +static const uint16_t B205_FPGA_COMPAT_NUM = 5; static const double B200_BUS_CLOCK_RATE = 100e6; -static const boost::uint32_t B200_GPSDO_ST_NONE = 0x83; +static const uint32_t B200_GPSDO_ST_NONE = 0x83; static const size_t B200_MAX_RATE_USB2 = 53248000; // bytes/s static const size_t B200_MAX_RATE_USB3 = 500000000; // bytes/s #define FLIP_SID(sid) (((sid)<<16)|((sid)>>16)) -static const boost::uint32_t B200_CTRL0_MSG_SID = 0x00000010; -static const boost::uint32_t B200_RESP0_MSG_SID = FLIP_SID(B200_CTRL0_MSG_SID); +static const uint32_t B200_CTRL0_MSG_SID = 0x00000010; +static const uint32_t B200_RESP0_MSG_SID = FLIP_SID(B200_CTRL0_MSG_SID); -static const boost::uint32_t B200_CTRL1_MSG_SID = 0x00000020; -static const boost::uint32_t B200_RESP1_MSG_SID = FLIP_SID(B200_CTRL1_MSG_SID); +static const uint32_t B200_CTRL1_MSG_SID = 0x00000020; +static const uint32_t B200_RESP1_MSG_SID = FLIP_SID(B200_CTRL1_MSG_SID); -static const boost::uint32_t B200_TX_DATA0_SID = 0x00000050; -static const boost::uint32_t B200_TX_MSG0_SID = FLIP_SID(B200_TX_DATA0_SID); +static const uint32_t B200_TX_DATA0_SID = 0x00000050; +static const uint32_t B200_TX_MSG0_SID = FLIP_SID(B200_TX_DATA0_SID); -static const boost::uint32_t B200_TX_DATA1_SID = 0x00000060; -static const boost::uint32_t B200_TX_MSG1_SID = FLIP_SID(B200_TX_DATA1_SID); +static const uint32_t B200_TX_DATA1_SID = 0x00000060; +static const uint32_t B200_TX_MSG1_SID = FLIP_SID(B200_TX_DATA1_SID); -static const boost::uint32_t B200_RX_DATA0_SID = 0x000000A0; -static const boost::uint32_t B200_RX_DATA1_SID = 0x000000B0; +static const uint32_t B200_RX_DATA0_SID = 0x000000A0; +static const uint32_t B200_RX_DATA1_SID = 0x000000B0; -static const boost::uint32_t B200_TX_GPS_UART_SID = 0x00000030; -static const boost::uint32_t B200_RX_GPS_UART_SID = FLIP_SID(B200_TX_GPS_UART_SID); +static const uint32_t B200_TX_GPS_UART_SID = 0x00000030; +static const uint32_t B200_RX_GPS_UART_SID = FLIP_SID(B200_TX_GPS_UART_SID); -static const boost::uint32_t B200_LOCAL_CTRL_SID = 0x00000040; -static const boost::uint32_t B200_LOCAL_RESP_SID = FLIP_SID(B200_LOCAL_CTRL_SID); +static const uint32_t B200_LOCAL_CTRL_SID = 0x00000040; +static const uint32_t B200_LOCAL_RESP_SID = FLIP_SID(B200_LOCAL_CTRL_SID); static const unsigned char B200_USB_CTRL_RECV_INTERFACE = 4; static const unsigned char B200_USB_CTRL_RECV_ENDPOINT = 8; @@ -207,7 +207,7 @@ private: void handle_overflow(const size_t radio_index); struct gpio_state { - boost::uint32_t tx_bandsel_a, tx_bandsel_b, rx_bandsel_a, rx_bandsel_b, rx_bandsel_c, mimo, ref_sel, swap_atr; + uint32_t tx_bandsel_a, tx_bandsel_b, rx_bandsel_a, rx_bandsel_b, rx_bandsel_c, mimo, ref_sel, swap_atr; gpio_state() { tx_bandsel_a = 0; diff --git a/host/lib/usrp/b200/b200_io_impl.cpp b/host/lib/usrp/b200/b200_io_impl.cpp index d1468332e..0a00b9402 100644 --- a/host/lib/usrp/b200/b200_io_impl.cpp +++ b/host/lib/usrp/b200/b200_io_impl.cpp @@ -93,7 +93,7 @@ void b200_impl::set_auto_tick_rate( // See also the doxygen documentation for these steps in b200_impl.hpp // Step 1: Obtain LCM and max rate from all relevant dsps - boost::uint32_t lcm_rate = (rate == 0) ? 1 : static_cast<boost::uint32_t>(floor(rate + 0.5)); + uint32_t lcm_rate = (rate == 0) ? 1 : static_cast<uint32_t>(floor(rate + 0.5)); for (int i = 0; i < 2; i++) { // Loop through rx and tx std::string dir = (i == 0) ? "tx" : "rx"; // We assume all 'set' DSPs are being used. @@ -115,9 +115,9 @@ void b200_impl::set_auto_tick_rate( } // Clean up floating point rounding errors if they crept in this_dsp_rate = std::min(max_tick_rate, this_dsp_rate); - lcm_rate = boost::math::lcm<boost::uint32_t>( + lcm_rate = boost::math::lcm<uint32_t>( lcm_rate, - static_cast<boost::uint32_t>(floor(this_dsp_rate + 0.5)) + static_cast<uint32_t>(floor(this_dsp_rate + 0.5)) ); } } @@ -266,7 +266,7 @@ void b200_impl::update_subdev_spec(const std::string &tx_rx, const uhd::usrp::su } static void b200_if_hdr_unpack_le( - const boost::uint32_t *packet_buff, + const uint32_t *packet_buff, vrt::if_packet_info_t &if_packet_info ){ if_packet_info.link_type = vrt::if_packet_info_t::LINK_TYPE_CHDR; @@ -274,7 +274,7 @@ static void b200_if_hdr_unpack_le( } static void b200_if_hdr_pack_le( - boost::uint32_t *packet_buff, + uint32_t *packet_buff, vrt::if_packet_info_t &if_packet_info ){ if_packet_info.link_type = vrt::if_packet_info_t::LINK_TYPE_CHDR; @@ -310,7 +310,7 @@ boost::optional<uhd::msg_task::msg_type_t> b200_impl::handle_async_task( if (not buff or buff->size() < 8) return boost::none; - const boost::uint32_t sid = uhd::wtohx(buff->cast<const boost::uint32_t *>()[1]); + const uint32_t sid = uhd::wtohx(buff->cast<const uint32_t *>()[1]); switch (sid) { //if the packet is a control response @@ -323,10 +323,10 @@ boost::optional<uhd::msg_task::msg_type_t> b200_impl::handle_async_task( if (sid == B200_RESP1_MSG_SID) ctrl = data->radio_ctrl[1].lock(); if (sid == B200_LOCAL_RESP_SID) ctrl = data->local_ctrl.lock(); if (ctrl){ - ctrl->push_response(buff->cast<const boost::uint32_t *>()); + ctrl->push_response(buff->cast<const uint32_t *>()); } else{ - return std::make_pair(sid, uhd::msg_task::buff_to_vector(buff->cast<boost::uint8_t *>(), buff->size() ) ); + return std::make_pair(sid, uhd::msg_task::buff_to_vector(buff->cast<uint8_t *>(), buff->size() ) ); } break; } @@ -346,8 +346,8 @@ boost::optional<uhd::msg_task::msg_type_t> b200_impl::handle_async_task( //extract packet info vrt::if_packet_info_t if_packet_info; - if_packet_info.num_packet_words32 = buff->size()/sizeof(boost::uint32_t); - const boost::uint32_t *packet_buff = buff->cast<const boost::uint32_t *>(); + if_packet_info.num_packet_words32 = buff->size()/sizeof(uint32_t); + const uint32_t *packet_buff = buff->cast<const uint32_t *>(); //unpacking can fail try @@ -362,7 +362,7 @@ boost::optional<uhd::msg_task::msg_type_t> b200_impl::handle_async_task( //fill in the async metadata async_metadata_t metadata; - load_metadata_from_buff(uhd::wtohx<boost::uint32_t>, metadata, if_packet_info, packet_buff, _tick_rate, i); + load_metadata_from_buff(uhd::wtohx<uint32_t>, metadata, if_packet_info, packet_buff, _tick_rate, i); data->async_md->push_with_pop_on_full(metadata); standard_async_msg_prints(metadata); break; @@ -403,11 +403,11 @@ rx_streamer::sptr b200_impl::get_rx_stream(const uhd::stream_args_t &args_) if (args.otw_format == "sc12") perif.ctrl->poke32(TOREG(SR_RX_FMT), 1); if (args.otw_format == "fc32") perif.ctrl->poke32(TOREG(SR_RX_FMT), 2); if (args.otw_format == "sc8") perif.ctrl->poke32(TOREG(SR_RX_FMT), 3); - const boost::uint32_t sid = radio_index ? B200_RX_DATA1_SID : B200_RX_DATA0_SID; + const uint32_t sid = radio_index ? B200_RX_DATA1_SID : B200_RX_DATA0_SID; //calculate packet size static const size_t hdr_size = 0 - + vrt::max_if_hdr_words32*sizeof(boost::uint32_t) + + vrt::max_if_hdr_words32*sizeof(uint32_t) //+ sizeof(vrt::if_packet_info_t().tlr) //no longer using trailer - sizeof(vrt::if_packet_info_t().cid) //no class id ever used - sizeof(vrt::if_packet_info_t().tsi) //no int time ever used @@ -516,7 +516,7 @@ tx_streamer::sptr b200_impl::get_tx_stream(const uhd::stream_args_t &args_) //calculate packet size static const size_t hdr_size = 0 - + vrt::max_if_hdr_words32*sizeof(boost::uint32_t) + + vrt::max_if_hdr_words32*sizeof(uint32_t) //+ sizeof(vrt::if_packet_info_t().tlr) //forced to have trailer - sizeof(vrt::if_packet_info_t().cid) //no class id ever used - sizeof(vrt::if_packet_info_t().tsi) //no int time ever used diff --git a/host/lib/usrp/b200/b200_regs.hpp b/host/lib/usrp/b200/b200_regs.hpp index e9ab81bae..038a59d11 100644 --- a/host/lib/usrp/b200/b200_regs.hpp +++ b/host/lib/usrp/b200/b200_regs.hpp @@ -18,7 +18,7 @@ #ifndef INCLUDED_B200_REGS_HPP #define INCLUDED_B200_REGS_HPP -#include <boost/cstdint.hpp> +#include <stdint.h> #define TOREG(x) ((x)*4) @@ -61,64 +61,64 @@ static const double AD9361_SPI_RATE = 1e6; static const double ADF4001_SPI_RATE = 10e3; //slow for large time constant on spi lines /* ATR Control Bits */ -static const boost::uint32_t TX_ENABLE1 = (1 << 7); -static const boost::uint32_t SFDX1_RX = (1 << 6); -static const boost::uint32_t SFDX1_TX = (1 << 5); -static const boost::uint32_t SRX1_RX = (1 << 4); -static const boost::uint32_t SRX1_TX = (1 << 3); -static const boost::uint32_t LED_RX1 = (1 << 2); -static const boost::uint32_t LED_TXRX_RX1 = (1 << 1); -static const boost::uint32_t LED_TXRX_TX1 = (1 << 0); - -static const boost::uint32_t TX_ENABLE2 = (1 << 7); -static const boost::uint32_t SFDX2_RX = (1 << 6); -static const boost::uint32_t SFDX2_TX = (1 << 5); -static const boost::uint32_t SRX2_RX = (1 << 4); -static const boost::uint32_t SRX2_TX = (1 << 3); -static const boost::uint32_t LED_RX2 = (1 << 2); -static const boost::uint32_t LED_TXRX_RX2 = (1 << 1); -static const boost::uint32_t LED_TXRX_TX2 = (1 << 0); +static const uint32_t TX_ENABLE1 = (1 << 7); +static const uint32_t SFDX1_RX = (1 << 6); +static const uint32_t SFDX1_TX = (1 << 5); +static const uint32_t SRX1_RX = (1 << 4); +static const uint32_t SRX1_TX = (1 << 3); +static const uint32_t LED_RX1 = (1 << 2); +static const uint32_t LED_TXRX_RX1 = (1 << 1); +static const uint32_t LED_TXRX_TX1 = (1 << 0); + +static const uint32_t TX_ENABLE2 = (1 << 7); +static const uint32_t SFDX2_RX = (1 << 6); +static const uint32_t SFDX2_TX = (1 << 5); +static const uint32_t SRX2_RX = (1 << 4); +static const uint32_t SRX2_TX = (1 << 3); +static const uint32_t LED_RX2 = (1 << 2); +static const uint32_t LED_TXRX_RX2 = (1 << 1); +static const uint32_t LED_TXRX_TX2 = (1 << 0); /* ATR State Definitions. */ -static const boost::uint32_t STATE_OFF = 0x00; +static const uint32_t STATE_OFF = 0x00; ///////////////////////// side 1 /////////////////////////////////// -static const boost::uint32_t STATE_RX1_RX2 = (SFDX1_RX +static const uint32_t STATE_RX1_RX2 = (SFDX1_RX | SFDX1_TX | LED_RX1); -static const boost::uint32_t STATE_RX1_TXRX = (SRX1_RX +static const uint32_t STATE_RX1_TXRX = (SRX1_RX | SRX1_TX | LED_TXRX_RX1); -static const boost::uint32_t STATE_FDX1_TXRX = (TX_ENABLE1 +static const uint32_t STATE_FDX1_TXRX = (TX_ENABLE1 | SFDX1_RX | SFDX1_TX | LED_TXRX_TX1 | LED_RX1); -static const boost::uint32_t STATE_TX1_TXRX = (TX_ENABLE1 +static const uint32_t STATE_TX1_TXRX = (TX_ENABLE1 | SFDX1_RX | SFDX1_TX | LED_TXRX_TX1); ///////////////////////// side 2 /////////////////////////////////// -static const boost::uint32_t STATE_RX2_RX2 = (SFDX2_RX +static const uint32_t STATE_RX2_RX2 = (SFDX2_RX | SRX2_TX | LED_RX2); -static const boost::uint32_t STATE_RX2_TXRX = (SRX2_TX +static const uint32_t STATE_RX2_TXRX = (SRX2_TX | SRX2_RX | LED_TXRX_RX2); -static const boost::uint32_t STATE_FDX2_TXRX = (TX_ENABLE2 +static const uint32_t STATE_FDX2_TXRX = (TX_ENABLE2 | SFDX2_RX | SFDX2_TX | LED_TXRX_TX2 | LED_RX2); -static const boost::uint32_t STATE_TX2_TXRX = (TX_ENABLE2 +static const uint32_t STATE_TX2_TXRX = (TX_ENABLE2 | SFDX2_RX | SFDX2_TX | LED_TXRX_TX2); diff --git a/host/lib/usrp/b200/b200_uart.cpp b/host/lib/usrp/b200/b200_uart.cpp index 065aa49ce..3c49ebf2a 100644 --- a/host/lib/usrp/b200/b200_uart.cpp +++ b/host/lib/usrp/b200/b200_uart.cpp @@ -30,7 +30,7 @@ using namespace uhd::transport; struct b200_uart_impl : b200_uart { - b200_uart_impl(zero_copy_if::sptr xport, const boost::uint32_t sid): + b200_uart_impl(zero_copy_if::sptr xport, const uint32_t sid): _xport(xport), _sid(sid), _count(0), @@ -49,7 +49,7 @@ struct b200_uart_impl : b200_uart packet_info.link_type = vrt::if_packet_info_t::LINK_TYPE_CHDR; packet_info.packet_type = vrt::if_packet_info_t::PACKET_TYPE_CONTEXT; packet_info.num_payload_words32 = 2; - packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(boost::uint32_t); + packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(uint32_t); packet_info.packet_count = _count++; packet_info.sob = false; packet_info.eob = false; @@ -60,11 +60,11 @@ struct b200_uart_impl : b200_uart packet_info.has_tsf = false; packet_info.has_tlr = false; - boost::uint32_t *packet_buff = buff->cast<boost::uint32_t *>(); + uint32_t *packet_buff = buff->cast<uint32_t *>(); vrt::if_hdr_pack_le(packet_buff, packet_info); - packet_buff[packet_info.num_header_words32+0] = uhd::htowx(boost::uint32_t(_baud_div)); - packet_buff[packet_info.num_header_words32+1] = uhd::htowx(boost::uint32_t(ch)); - buff->commit(packet_info.num_packet_words32*sizeof(boost::uint32_t)); + packet_buff[packet_info.num_header_words32+0] = uhd::htowx(uint32_t(_baud_div)); + packet_buff[packet_info.num_header_words32+1] = uhd::htowx(uint32_t(ch)); + buff->commit(packet_info.num_packet_words32*sizeof(uint32_t)); } void write_uart(const std::string &buff) @@ -84,10 +84,10 @@ struct b200_uart_impl : b200_uart void handle_uart_packet(managed_recv_buffer::sptr buff) { - const boost::uint32_t *packet_buff = buff->cast<const boost::uint32_t *>(); + const uint32_t *packet_buff = buff->cast<const uint32_t *>(); vrt::if_packet_info_t packet_info; packet_info.link_type = vrt::if_packet_info_t::LINK_TYPE_CHDR; - packet_info.num_packet_words32 = buff->size()/sizeof(boost::uint32_t); + packet_info.num_packet_words32 = buff->size()/sizeof(uint32_t); vrt::if_hdr_unpack_le(packet_buff, packet_info); const char ch = char(uhd::wtohx(packet_buff[packet_info.num_header_words32+1])); _line += ch; @@ -99,7 +99,7 @@ struct b200_uart_impl : b200_uart } const zero_copy_if::sptr _xport; - const boost::uint32_t _sid; + const uint32_t _sid; size_t _count; size_t _baud_div; bounded_buffer<std::string> _line_queue; @@ -107,7 +107,7 @@ struct b200_uart_impl : b200_uart }; -b200_uart::sptr b200_uart::make(zero_copy_if::sptr xport, const boost::uint32_t sid) +b200_uart::sptr b200_uart::make(zero_copy_if::sptr xport, const uint32_t sid) { return b200_uart::sptr(new b200_uart_impl(xport, sid)); } diff --git a/host/lib/usrp/b200/b200_uart.hpp b/host/lib/usrp/b200/b200_uart.hpp index f58479888..3d4ece240 100644 --- a/host/lib/usrp/b200/b200_uart.hpp +++ b/host/lib/usrp/b200/b200_uart.hpp @@ -27,7 +27,7 @@ class b200_uart: boost::noncopyable, public uhd::uart_iface { public: typedef boost::shared_ptr<b200_uart> sptr; - static sptr make(uhd::transport::zero_copy_if::sptr, const boost::uint32_t sid); + static sptr make(uhd::transport::zero_copy_if::sptr, const uint32_t sid); virtual void handle_uart_packet(uhd::transport::managed_recv_buffer::sptr buff) = 0; }; diff --git a/host/lib/usrp/common/ad9361_ctrl.cpp b/host/lib/usrp/common/ad9361_ctrl.cpp index 654311424..0dc5e7919 100644 --- a/host/lib/usrp/common/ad9361_ctrl.cpp +++ b/host/lib/usrp/common/ad9361_ctrl.cpp @@ -36,12 +36,12 @@ using namespace uhd::usrp; class ad9361_io_spi : public ad9361_io { public: - ad9361_io_spi(uhd::spi_iface::sptr spi_iface, boost::uint32_t slave_num) : + ad9361_io_spi(uhd::spi_iface::sptr spi_iface, uint32_t slave_num) : _spi_iface(spi_iface), _slave_num(slave_num) { } virtual ~ad9361_io_spi() { } - virtual boost::uint8_t peek8(boost::uint32_t reg) + virtual uint8_t peek8(uint32_t reg) { boost::lock_guard<boost::mutex> lock(_mutex); @@ -49,16 +49,16 @@ public: config.mosi_edge = uhd::spi_config_t::EDGE_FALL; config.miso_edge = uhd::spi_config_t::EDGE_FALL; //TODO (Ashish): FPGA SPI workaround. This should be EDGE_RISE - boost::uint32_t rd_word = AD9361_SPI_READ_CMD | - ((boost::uint32_t(reg) << AD9361_SPI_ADDR_SHIFT) & AD9361_SPI_ADDR_MASK); + uint32_t rd_word = AD9361_SPI_READ_CMD | + ((uint32_t(reg) << AD9361_SPI_ADDR_SHIFT) & AD9361_SPI_ADDR_MASK); - boost::uint32_t val = (_spi_iface->read_spi(_slave_num, config, rd_word, AD9361_SPI_NUM_BITS)); + uint32_t val = (_spi_iface->read_spi(_slave_num, config, rd_word, AD9361_SPI_NUM_BITS)); val &= 0xFF; - return static_cast<boost::uint8_t>(val); + return static_cast<uint8_t>(val); } - virtual void poke8(boost::uint32_t reg, boost::uint8_t val) + virtual void poke8(uint32_t reg, uint8_t val) { boost::lock_guard<boost::mutex> lock(_mutex); @@ -66,24 +66,24 @@ public: config.mosi_edge = uhd::spi_config_t::EDGE_FALL; config.miso_edge = uhd::spi_config_t::EDGE_FALL; //TODO (Ashish): FPGA SPI workaround. This should be EDGE_RISE - boost::uint32_t wr_word = AD9361_SPI_WRITE_CMD | - ((boost::uint32_t(reg) << AD9361_SPI_ADDR_SHIFT) & AD9361_SPI_ADDR_MASK) | - ((boost::uint32_t(val) << AD9361_SPI_DATA_SHIFT) & AD9361_SPI_DATA_MASK); + uint32_t wr_word = AD9361_SPI_WRITE_CMD | + ((uint32_t(reg) << AD9361_SPI_ADDR_SHIFT) & AD9361_SPI_ADDR_MASK) | + ((uint32_t(val) << AD9361_SPI_DATA_SHIFT) & AD9361_SPI_DATA_MASK); _spi_iface->write_spi(_slave_num, config, wr_word, AD9361_SPI_NUM_BITS); } private: uhd::spi_iface::sptr _spi_iface; - boost::uint32_t _slave_num; + uint32_t _slave_num; boost::mutex _mutex; - static const boost::uint32_t AD9361_SPI_WRITE_CMD = 0x00800000; - static const boost::uint32_t AD9361_SPI_READ_CMD = 0x00000000; - static const boost::uint32_t AD9361_SPI_ADDR_MASK = 0x003FFF00; - static const boost::uint32_t AD9361_SPI_ADDR_SHIFT = 8; - static const boost::uint32_t AD9361_SPI_DATA_MASK = 0x000000FF; - static const boost::uint32_t AD9361_SPI_DATA_SHIFT = 0; - static const boost::uint32_t AD9361_SPI_NUM_BITS = 24; + static const uint32_t AD9361_SPI_WRITE_CMD = 0x00800000; + static const uint32_t AD9361_SPI_READ_CMD = 0x00000000; + static const uint32_t AD9361_SPI_ADDR_MASK = 0x003FFF00; + static const uint32_t AD9361_SPI_ADDR_SHIFT = 8; + static const uint32_t AD9361_SPI_DATA_MASK = 0x000000FF; + static const uint32_t AD9361_SPI_DATA_SHIFT = 0; + static const uint32_t AD9361_SPI_NUM_BITS = 24; }; /*********************************************************************** @@ -98,13 +98,13 @@ public: _device.initialize(); } - void set_timed_spi(uhd::spi_iface::sptr spi_iface, boost::uint32_t slave_num) + void set_timed_spi(uhd::spi_iface::sptr spi_iface, uint32_t slave_num) { _timed_spi = boost::make_shared<ad9361_io_spi>(spi_iface, slave_num); _use_timed_spi(); } - void set_safe_spi(uhd::spi_iface::sptr spi_iface, boost::uint32_t slave_num) + void set_safe_spi(uhd::spi_iface::sptr spi_iface, uint32_t slave_num) { _safe_spi = boost::make_shared<ad9361_io_spi>(spi_iface, slave_num); } @@ -327,7 +327,7 @@ private: ad9361_ctrl::sptr ad9361_ctrl::make_spi( ad9361_params::sptr client_settings, uhd::spi_iface::sptr spi_iface, - boost::uint32_t slave_num + uint32_t slave_num ) { boost::shared_ptr<ad9361_io_spi> spi_io_iface = boost::make_shared<ad9361_io_spi>(spi_iface, slave_num); return sptr(new ad9361_ctrl_impl(client_settings, spi_io_iface)); diff --git a/host/lib/usrp/common/ad9361_ctrl.hpp b/host/lib/usrp/common/ad9361_ctrl.hpp index 5770c3ec4..5a10e4b5f 100644 --- a/host/lib/usrp/common/ad9361_ctrl.hpp +++ b/host/lib/usrp/common/ad9361_ctrl.hpp @@ -58,11 +58,11 @@ public: static sptr make_spi( ad9361_params::sptr client_settings, uhd::spi_iface::sptr spi_iface, - boost::uint32_t slave_num + uint32_t slave_num ); - virtual void set_timed_spi(uhd::spi_iface::sptr spi_iface, boost::uint32_t slave_num) = 0; - virtual void set_safe_spi(uhd::spi_iface::sptr spi_iface, boost::uint32_t slave_num) = 0; + virtual void set_timed_spi(uhd::spi_iface::sptr spi_iface, uint32_t slave_num) = 0; + virtual void set_safe_spi(uhd::spi_iface::sptr spi_iface, uint32_t slave_num) = 0; //! Get a list of gain names for RX or TX static std::vector<std::string> get_gain_names(const std::string &/*which*/) diff --git a/host/lib/usrp/common/ad9361_driver/ad9361_client.h b/host/lib/usrp/common/ad9361_driver/ad9361_client.h index e9ea1404a..921045fbd 100644 --- a/host/lib/usrp/common/ad9361_driver/ad9361_client.h +++ b/host/lib/usrp/common/ad9361_driver/ad9361_client.h @@ -51,10 +51,10 @@ typedef enum { * Interface timing */ typedef struct { - boost::uint8_t rx_clk_delay; - boost::uint8_t rx_data_delay; - boost::uint8_t tx_clk_delay; - boost::uint8_t tx_data_delay; + uint8_t rx_clk_delay; + uint8_t rx_data_delay; + uint8_t tx_clk_delay; + uint8_t tx_data_delay; } digital_interface_delays_t; class ad9361_params { @@ -76,8 +76,8 @@ public: virtual ~ad9361_io() {} - virtual boost::uint8_t peek8(boost::uint32_t reg) = 0; - virtual void poke8(boost::uint32_t reg, boost::uint8_t val) = 0; + virtual uint8_t peek8(uint32_t reg) = 0; + virtual void poke8(uint32_t reg, uint8_t val) = 0; }; diff --git a/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp b/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp index 095017bb6..45ebf78bf 100644 --- a/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp +++ b/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp @@ -25,7 +25,7 @@ #include <uhd/exception.hpp> #include <uhd/utils/log.hpp> #include <uhd/utils/msg.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/thread/thread.hpp> #include <boost/scoped_array.hpp> @@ -107,9 +107,9 @@ const double ad9361_device_t::DEFAULT_TX_FREQ = 850e6; * how many taps are in the filter, and given a vector of the taps * themselves. */ -void ad9361_device_t::_program_fir_filter(direction_t direction, chain_t chain, int num_taps, boost::uint16_t *coeffs) +void ad9361_device_t::_program_fir_filter(direction_t direction, chain_t chain, int num_taps, uint16_t *coeffs) { - boost::uint16_t base; + uint16_t base; /* RX and TX filters use largely identical sets of programming registers. Select the appropriate bank of registers here. */ @@ -120,9 +120,9 @@ void ad9361_device_t::_program_fir_filter(direction_t direction, chain_t chain, } /* Encode number of filter taps for programming register */ - boost::uint8_t reg_numtaps = (((num_taps / 16) - 1) & 0x07) << 5; + uint8_t reg_numtaps = (((num_taps / 16) - 1) & 0x07) << 5; - boost::uint8_t reg_chain = 0; + uint8_t reg_chain = 0; switch (chain) { case CHAIN_1: reg_chain = 0x01 << 3; @@ -182,25 +182,25 @@ void ad9361_device_t::_program_fir_filter(direction_t direction, chain_t chain, /* Program the RX FIR Filter. */ -void ad9361_device_t::_setup_rx_fir(size_t num_taps, boost::int32_t decimation) +void ad9361_device_t::_setup_rx_fir(size_t num_taps, int32_t decimation) { if (not (decimation == 1 or decimation == 2 or decimation == 4)) { throw uhd::runtime_error("[ad9361_device_t] Invalid Rx FIR decimation."); } - boost::scoped_array<boost::uint16_t> coeffs(new boost::uint16_t[num_taps]); + boost::scoped_array<uint16_t> coeffs(new uint16_t[num_taps]); for (size_t i = 0; i < num_taps; i++) { switch (num_taps) { case 128: - coeffs[i] = boost::uint16_t((decimation==4) ? fir_128_x4_coeffs[i] : hb127_coeffs[i]); + coeffs[i] = uint16_t((decimation==4) ? fir_128_x4_coeffs[i] : hb127_coeffs[i]); break; case 96: - coeffs[i] = boost::uint16_t((decimation==4) ? fir_96_x4_coeffs[i] : hb95_coeffs[i]); + coeffs[i] = uint16_t((decimation==4) ? fir_96_x4_coeffs[i] : hb95_coeffs[i]); break; case 64: - coeffs[i] = boost::uint16_t((decimation==4) ? fir_64_x4_coeffs[i] : hb63_coeffs[i]); + coeffs[i] = uint16_t((decimation==4) ? fir_64_x4_coeffs[i] : hb63_coeffs[i]); break; case 48: - coeffs[i] = boost::uint16_t((decimation==4) ? fir_48_x4_coeffs[i] : hb47_coeffs[i]); + coeffs[i] = uint16_t((decimation==4) ? fir_48_x4_coeffs[i] : hb47_coeffs[i]); break; default: throw uhd::runtime_error("[ad9361_device_t] Unsupported number of Rx FIR taps."); @@ -211,7 +211,7 @@ void ad9361_device_t::_setup_rx_fir(size_t num_taps, boost::int32_t decimation) } /* Program the TX FIR Filter. */ -void ad9361_device_t::_setup_tx_fir(size_t num_taps, boost::int32_t interpolation) +void ad9361_device_t::_setup_tx_fir(size_t num_taps, int32_t interpolation) { if (not (interpolation == 1 or interpolation == 2 or interpolation == 4)) { throw uhd::runtime_error("[ad9361_device_t] Invalid Tx FIR interpolation."); @@ -219,20 +219,20 @@ void ad9361_device_t::_setup_tx_fir(size_t num_taps, boost::int32_t interpolatio if (interpolation == 1 and num_taps > 64) { throw uhd::runtime_error("[ad9361_device_t] Too many Tx FIR taps for interpolation value."); } - boost::scoped_array<boost::uint16_t> coeffs(new boost::uint16_t[num_taps]); + boost::scoped_array<uint16_t> coeffs(new uint16_t[num_taps]); for (size_t i = 0; i < num_taps; i++) { switch (num_taps) { case 128: - coeffs[i] = boost::uint16_t((interpolation==4) ? fir_128_x4_coeffs[i] : hb127_coeffs[i]); + coeffs[i] = uint16_t((interpolation==4) ? fir_128_x4_coeffs[i] : hb127_coeffs[i]); break; case 96: - coeffs[i] = boost::uint16_t((interpolation==4) ? fir_96_x4_coeffs[i] : hb95_coeffs[i]); + coeffs[i] = uint16_t((interpolation==4) ? fir_96_x4_coeffs[i] : hb95_coeffs[i]); break; case 64: - coeffs[i] = boost::uint16_t((interpolation==4) ? fir_64_x4_coeffs[i] : hb63_coeffs[i]); + coeffs[i] = uint16_t((interpolation==4) ? fir_64_x4_coeffs[i] : hb63_coeffs[i]); break; case 48: - coeffs[i] = boost::uint16_t((interpolation==4) ? fir_48_x4_coeffs[i] : hb47_coeffs[i]); + coeffs[i] = uint16_t((interpolation==4) ? fir_48_x4_coeffs[i] : hb47_coeffs[i]); break; default: throw uhd::runtime_error("[ad9361_device_t] Unsupported number of Tx FIR taps."); @@ -335,16 +335,16 @@ double ad9361_device_t::_calibrate_baseband_rx_analog_filter(double req_rfbw) } double rxtune_clk = ((1.4 * bbbw * 2 * M_PI) / M_LN2); - _rx_bbf_tunediv = std::min<boost::uint16_t>(511, boost::uint16_t(std::ceil(_bbpll_freq / rxtune_clk))); + _rx_bbf_tunediv = std::min<uint16_t>(511, uint16_t(std::ceil(_bbpll_freq / rxtune_clk))); _regs.bbftune_config = (_regs.bbftune_config & 0xFE) | ((_rx_bbf_tunediv >> 8) & 0x0001); double bbbw_mhz = bbbw / 1e6; double temp = ((bbbw_mhz - std::floor(bbbw_mhz)) * 1000) / 7.8125; - boost::uint8_t bbbw_khz = std::min<boost::uint8_t>(127, boost::uint8_t(std::floor(temp + 0.5))); + uint8_t bbbw_khz = std::min<uint8_t>(127, uint8_t(std::floor(temp + 0.5))); /* Set corner frequencies and dividers. */ - _io_iface->poke8(0x1fb, (boost::uint8_t) (bbbw_mhz)); + _io_iface->poke8(0x1fb, (uint8_t) (bbbw_mhz)); _io_iface->poke8(0x1fc, bbbw_khz); _io_iface->poke8(0x1f8, (_rx_bbf_tunediv & 0x00FF)); _io_iface->poke8(0x1f9, _regs.bbftune_config); @@ -402,7 +402,7 @@ double ad9361_device_t::_calibrate_baseband_tx_analog_filter(double req_rfbw) } double txtune_clk = ((1.6 * bbbw * 2 * M_PI) / M_LN2); - boost::uint16_t txbbfdiv = std::min<boost::uint16_t>(511, boost::uint16_t(std::ceil(_bbpll_freq / txtune_clk))); + uint16_t txbbfdiv = std::min<uint16_t>(511, uint16_t(std::ceil(_bbpll_freq / txtune_clk))); _regs.bbftune_mode = (_regs.bbftune_mode & 0xFE) | ((txbbfdiv >> 8) & 0x0001); @@ -481,7 +481,7 @@ double ad9361_device_t::_calibrate_secondary_tx_filter(double req_rfbw) cap = 63; } - boost::uint8_t reg0d0, reg0d1, reg0d2; + uint8_t reg0d0, reg0d1, reg0d2; /* Translate baseband bandwidths to register settings. */ if ((bbbw_mhz * 2) <= 9) { @@ -526,14 +526,14 @@ double ad9361_device_t::_calibrate_secondary_tx_filter(double req_rfbw) * UG570 page 33 states that this filter should be calibrated to 2.5 * bbbw */ double ad9361_device_t::_calibrate_rx_TIAs(double req_rfbw) { - boost::uint8_t reg1eb = _io_iface->peek8(0x1eb) & 0x3F; - boost::uint8_t reg1ec = _io_iface->peek8(0x1ec) & 0x7F; - boost::uint8_t reg1e6 = _io_iface->peek8(0x1e6) & 0x07; - boost::uint8_t reg1db = 0x00; - boost::uint8_t reg1dc = 0x00; - boost::uint8_t reg1dd = 0x00; - boost::uint8_t reg1de = 0x00; - boost::uint8_t reg1df = 0x00; + uint8_t reg1eb = _io_iface->peek8(0x1eb) & 0x3F; + uint8_t reg1ec = _io_iface->peek8(0x1ec) & 0x7F; + uint8_t reg1e6 = _io_iface->peek8(0x1e6) & 0x07; + uint8_t reg1db = 0x00; + uint8_t reg1dc = 0x00; + uint8_t reg1dd = 0x00; + uint8_t reg1de = 0x00; + uint8_t reg1df = 0x00; double bbbw = req_rfbw / 2.0; @@ -572,12 +572,12 @@ double ad9361_device_t::_calibrate_rx_TIAs(double req_rfbw) if (CTIA_fF > 2920) { reg1dc = 0x40; reg1de = 0x40; - boost::uint8_t temp = (boost::uint8_t) std::min<boost::uint8_t>(127, - boost::uint8_t(std::floor(0.5 + ((CTIA_fF - 400.0) / 320.0)))); + uint8_t temp = (uint8_t) std::min<uint8_t>(127, + uint8_t(std::floor(0.5 + ((CTIA_fF - 400.0) / 320.0)))); reg1dd = temp; reg1df = temp; } else { - boost::uint8_t temp = boost::uint8_t(std::floor(0.5 + ((CTIA_fF - 400.0) / 40.0)) + 0x40); + uint8_t temp = uint8_t(std::floor(0.5 + ((CTIA_fF - 400.0) / 40.0)) + 0x40); reg1dc = temp; reg1de = temp; reg1dd = 0; @@ -613,9 +613,9 @@ void ad9361_device_t::_setup_adc() bbbw_mhz = 0.20; } - boost::uint8_t rxbbf_c3_msb = _io_iface->peek8(0x1eb) & 0x3F; - boost::uint8_t rxbbf_c3_lsb = _io_iface->peek8(0x1ec) & 0x7F; - boost::uint8_t rxbbf_r2346 = _io_iface->peek8(0x1e6) & 0x07; + uint8_t rxbbf_c3_msb = _io_iface->peek8(0x1eb) & 0x3F; + uint8_t rxbbf_c3_lsb = _io_iface->peek8(0x1ec) & 0x7F; + uint8_t rxbbf_r2346 = _io_iface->peek8(0x1e6) & 0x07; double fsadc = _adcclock_freq / 1e6; @@ -644,71 +644,71 @@ void ad9361_device_t::_setup_adc() /* Calculate the values for all 40 settings registers. * * DO NOT TOUCH THIS UNLESS YOU KNOW EXACTLY WHAT YOU ARE DOING. kthx.*/ - boost::uint8_t data[40]; + uint8_t data[40]; data[0] = 0; data[1] = 0; data[2] = 0; data[3] = 0x24; data[4] = 0x24; data[5] = 0; data[6] = 0; - data[7] = std::min<boost::uint8_t>(124, boost::uint8_t(std::floor(-0.5 + data[7] = std::min<uint8_t>(124, uint8_t(std::floor(-0.5 + (80.0 * scale_snr * scale_res * std::min<double>(1.0, sqrt(maxsnr * fsadc / 640.0)))))); double data007 = data[7]; - data[8] = std::min<boost::uint8_t>(255, boost::uint8_t(std::floor(0.5 + data[8] = std::min<uint8_t>(255, uint8_t(std::floor(0.5 + ((20.0 * (640.0 / fsadc) * ((data007 / 80.0)) / (scale_res * scale_cap)))))); - data[10] = std::min<boost::uint8_t>(127, boost::uint8_t(std::floor(-0.5 + (77.0 * scale_res + data[10] = std::min<uint8_t>(127, uint8_t(std::floor(-0.5 + (77.0 * scale_res * std::min<double>(1.0, sqrt(maxsnr * fsadc / 640.0)))))); double data010 = data[10]; - data[9] = std::min<boost::uint8_t>(127, boost::uint8_t(std::floor(0.8 * data010))); - data[11] = std::min<boost::uint8_t>(255, boost::uint8_t(std::floor(0.5 + data[9] = std::min<uint8_t>(127, uint8_t(std::floor(0.8 * data010))); + data[11] = std::min<uint8_t>(255, uint8_t(std::floor(0.5 + (20.0 * (640.0 / fsadc) * ((data010 / 77.0) / (scale_res * scale_cap)))))); - data[12] = std::min<boost::uint8_t>(127, boost::uint8_t(std::floor(-0.5 + data[12] = std::min<uint8_t>(127, uint8_t(std::floor(-0.5 + (80.0 * scale_res * std::min<double>(1.0, sqrt(maxsnr * fsadc / 640.0)))))); double data012 = data[12]; - data[13] = std::min<boost::uint8_t>(255, boost::uint8_t(std::floor(-1.5 + data[13] = std::min<uint8_t>(255, uint8_t(std::floor(-1.5 + (20.0 * (640.0 / fsadc) * ((data012 / 80.0) / (scale_res * scale_cap)))))); - data[14] = 21 * boost::uint8_t(std::floor(0.1 * 640.0 / fsadc)); - data[15] = std::min<boost::uint8_t>(127, boost::uint8_t(1.025 * data007)); + data[14] = 21 * uint8_t(std::floor(0.1 * 640.0 / fsadc)); + data[15] = std::min<uint8_t>(127, uint8_t(1.025 * data007)); double data015 = data[15]; - data[16] = std::min<boost::uint8_t>(127, boost::uint8_t(std::floor((data015 + data[16] = std::min<uint8_t>(127, uint8_t(std::floor((data015 * (0.98 + (0.02 * std::max<double>(1.0, (640.0 / fsadc) / maxsnr))))))); data[17] = data[15]; - data[18] = std::min<boost::uint8_t>(127, boost::uint8_t(0.975 * (data010))); + data[18] = std::min<uint8_t>(127, uint8_t(0.975 * (data010))); double data018 = data[18]; - data[19] = std::min<boost::uint8_t>(127, boost::uint8_t(std::floor((data018 + data[19] = std::min<uint8_t>(127, uint8_t(std::floor((data018 * (0.98 + (0.02 * std::max<double>(1.0, (640.0 / fsadc) / maxsnr))))))); data[20] = data[18]; - data[21] = std::min<boost::uint8_t>(127, boost::uint8_t(0.975 * data012)); + data[21] = std::min<uint8_t>(127, uint8_t(0.975 * data012)); double data021 = data[21]; - data[22] = std::min<boost::uint8_t>(127, boost::uint8_t(std::floor((data021 + data[22] = std::min<uint8_t>(127, uint8_t(std::floor((data021 * (0.98 + (0.02 * std::max<double>(1.0, (640.0 / fsadc) / maxsnr))))))); data[23] = data[21]; data[24] = 0x2e; - data[25] = boost::uint8_t(std::floor(128.0 + std::min<double>(63.0, + data[25] = uint8_t(std::floor(128.0 + std::min<double>(63.0, 63.0 * (fsadc / 640.0)))); - data[26] = boost::uint8_t(std::floor(std::min<double>(63.0, 63.0 * (fsadc / 640.0) + data[26] = uint8_t(std::floor(std::min<double>(63.0, 63.0 * (fsadc / 640.0) * (0.92 + (0.08 * (640.0 / fsadc)))))); - data[27] = boost::uint8_t(std::floor(std::min<double>(63.0, + data[27] = uint8_t(std::floor(std::min<double>(63.0, 32.0 * sqrt(fsadc / 640.0)))); - data[28] = boost::uint8_t(std::floor(128.0 + std::min<double>(63.0, + data[28] = uint8_t(std::floor(128.0 + std::min<double>(63.0, 63.0 * (fsadc / 640.0)))); - data[29] = boost::uint8_t(std::floor(std::min<double>(63.0, + data[29] = uint8_t(std::floor(std::min<double>(63.0, 63.0 * (fsadc / 640.0) * (0.92 + (0.08 * (640.0 / fsadc)))))); - data[30] = boost::uint8_t(std::floor(std::min<double>(63.0, + data[30] = uint8_t(std::floor(std::min<double>(63.0, 32.0 * sqrt(fsadc / 640.0)))); - data[31] = boost::uint8_t(std::floor(128.0 + std::min<double>(63.0, + data[31] = uint8_t(std::floor(128.0 + std::min<double>(63.0, 63.0 * (fsadc / 640.0)))); - data[32] = boost::uint8_t(std::floor(std::min<double>(63.0, + data[32] = uint8_t(std::floor(std::min<double>(63.0, 63.0 * (fsadc / 640.0) * (0.92 + (0.08 * (640.0 / fsadc)))))); - data[33] = boost::uint8_t(std::floor(std::min<double>(63.0, + data[33] = uint8_t(std::floor(std::min<double>(63.0, 63.0 * sqrt(fsadc / 640.0)))); - data[34] = std::min<boost::uint8_t>(127, boost::uint8_t(std::floor(64.0 + data[34] = std::min<uint8_t>(127, uint8_t(std::floor(64.0 * sqrt(fsadc / 640.0)))); data[35] = 0x40; data[36] = 0x40; @@ -848,8 +848,8 @@ void ad9361_device_t::_tx_quadrature_cal_routine() { * 3) Re-read 0A3 to get bits [5:0] because maybe they changed? * 4) Update only the TX NCO freq bits in 0A3. * 5) Profit (I hope). */ - boost::uint8_t reg0a3 = _io_iface->peek8(0x0a3); - boost::uint8_t nco_freq = (reg0a3 & 0xC0); + uint8_t reg0a3 = _io_iface->peek8(0x0a3); + uint8_t nco_freq = (reg0a3 & 0xC0); _io_iface->poke8(0x0a0, 0x15 | (nco_freq >> 1)); reg0a3 = _io_iface->peek8(0x0a3); _io_iface->poke8(0x0a3, (reg0a3 & 0x3F) | nco_freq); @@ -916,7 +916,7 @@ void ad9361_device_t::_calibrate_tx_quadrature() /* This calibration must be done in a certain order, and for both TX_A * and TX_B, separately. Store the original setting so that we can * restore it later. */ - boost::uint8_t orig_reg_inputsel = _regs.inputsel; + uint8_t orig_reg_inputsel = _regs.inputsel; /*********************************************************************** * TX1/2-A Calibration @@ -951,9 +951,9 @@ void ad9361_device_t::_calibrate_tx_quadrature() * Note that this table is fixed for all frequency settings. */ void ad9361_device_t::_program_mixer_gm_subtable() { - boost::uint8_t gain[] = { 0x78, 0x74, 0x70, 0x6C, 0x68, 0x64, 0x60, 0x5C, 0x58, + uint8_t gain[] = { 0x78, 0x74, 0x70, 0x6C, 0x68, 0x64, 0x60, 0x5C, 0x58, 0x54, 0x50, 0x4C, 0x48, 0x30, 0x18, 0x00 }; - boost::uint8_t gm[] = { 0x00, 0x0D, 0x15, 0x1B, 0x21, 0x25, 0x29, 0x2C, 0x2F, 0x31, + uint8_t gm[] = { 0x00, 0x0D, 0x15, 0x1B, 0x21, 0x25, 0x29, 0x2C, 0x2F, 0x31, 0x33, 0x34, 0x35, 0x3A, 0x3D, 0x3E }; /* Start the clock. */ @@ -984,8 +984,8 @@ void ad9361_device_t::_program_mixer_gm_subtable() void ad9361_device_t::_program_gain_table() { /* Figure out which gain table we should be using for our current * frequency band. */ - boost::uint8_t (*gain_table)[3] = NULL; - boost::uint8_t new_gain_table; + uint8_t (*gain_table)[3] = NULL; + uint8_t new_gain_table; if (_rx_freq < 1300e6) { gain_table = gain_table_sub_1300mhz; new_gain_table = 1; @@ -1012,7 +1012,7 @@ void ad9361_device_t::_program_gain_table() { _io_iface->poke8(0x137, 0x1A); /* IT'S PROGRAMMING TIME. */ - boost::uint8_t index = 0; + uint8_t index = 0; for (; index < 77; index++) { _io_iface->poke8(0x130, index); _io_iface->poke8(0x131, gain_table[index][0]); @@ -1118,18 +1118,18 @@ void ad9361_device_t::_setup_synth(direction_t direction, double vcorate) throw uhd::runtime_error("[ad9361_device_t] vcoindex > 53"); /* Parse the values out of the LUT based on our calculated index... */ - boost::uint8_t vco_output_level = synth_cal_lut[vcoindex][0]; - boost::uint8_t vco_varactor = synth_cal_lut[vcoindex][1]; - boost::uint8_t vco_bias_ref = synth_cal_lut[vcoindex][2]; - boost::uint8_t vco_bias_tcf = synth_cal_lut[vcoindex][3]; - boost::uint8_t vco_cal_offset = synth_cal_lut[vcoindex][4]; - boost::uint8_t vco_varactor_ref = synth_cal_lut[vcoindex][5]; - boost::uint8_t charge_pump_curr = synth_cal_lut[vcoindex][6]; - boost::uint8_t loop_filter_c2 = synth_cal_lut[vcoindex][7]; - boost::uint8_t loop_filter_c1 = synth_cal_lut[vcoindex][8]; - boost::uint8_t loop_filter_r1 = synth_cal_lut[vcoindex][9]; - boost::uint8_t loop_filter_c3 = synth_cal_lut[vcoindex][10]; - boost::uint8_t loop_filter_r3 = synth_cal_lut[vcoindex][11]; + uint8_t vco_output_level = synth_cal_lut[vcoindex][0]; + uint8_t vco_varactor = synth_cal_lut[vcoindex][1]; + uint8_t vco_bias_ref = synth_cal_lut[vcoindex][2]; + uint8_t vco_bias_tcf = synth_cal_lut[vcoindex][3]; + uint8_t vco_cal_offset = synth_cal_lut[vcoindex][4]; + uint8_t vco_varactor_ref = synth_cal_lut[vcoindex][5]; + uint8_t charge_pump_curr = synth_cal_lut[vcoindex][6]; + uint8_t loop_filter_c2 = synth_cal_lut[vcoindex][7]; + uint8_t loop_filter_c1 = synth_cal_lut[vcoindex][8]; + uint8_t loop_filter_r1 = synth_cal_lut[vcoindex][9]; + uint8_t loop_filter_c3 = synth_cal_lut[vcoindex][10]; + uint8_t loop_filter_r3 = synth_cal_lut[vcoindex][11]; /* ... annnd program! */ if (direction == RX) { @@ -1566,7 +1566,7 @@ void ad9361_device_t::initialize() boost::this_thread::sleep(boost::posix_time::milliseconds(20)); /* Check device ID to make sure iface works */ - boost::uint32_t device_id = (_io_iface->peek8(0x037) & 0x8); + uint32_t device_id = (_io_iface->peek8(0x037) & 0x8); if (device_id != 0x8) { throw uhd::runtime_error(str(boost::format("[ad9361_device_t::initialize] Device ID readback failure. Expected: 0x8, Received: 0x%x") % device_id)); } @@ -1631,9 +1631,9 @@ void ad9361_device_t::initialize() /* Data delay for TX and RX data clocks */ digital_interface_delays_t timing = _client_params->get_digital_interface_timing(); - boost::uint8_t rx_delays = ((timing.rx_clk_delay & 0xF) << 4) + uint8_t rx_delays = ((timing.rx_clk_delay & 0xF) << 4) | (timing.rx_data_delay & 0xF); - boost::uint8_t tx_delays = ((timing.tx_clk_delay & 0xF) << 4) + uint8_t tx_delays = ((timing.tx_clk_delay & 0xF) << 4) | (timing.tx_data_delay & 0xF); _io_iface->poke8(0x006, rx_delays); _io_iface->poke8(0x007, tx_delays); @@ -1811,7 +1811,7 @@ double ad9361_device_t::set_clock_rate(const double req_rate) /* We must be in the SLEEP / WAIT state to do this. If we aren't already * there, transition the ENSM to State 0. */ - boost::uint8_t current_state = _io_iface->peek8(0x017) & 0x0F; + uint8_t current_state = _io_iface->peek8(0x017) & 0x0F; switch (current_state) { case 0x05: /* We are in the ALERT state. */ @@ -1833,8 +1833,8 @@ double ad9361_device_t::set_clock_rate(const double req_rate) /* Store the current chain / antenna selections so that we can restore * them at the end of this routine; all chains will be enabled from * within setup_rates for calibration purposes. */ - boost::uint8_t orig_tx_chains = _regs.txfilt & 0xC0; - boost::uint8_t orig_rx_chains = _regs.rxfilt & 0xC0; + uint8_t orig_tx_chains = _regs.txfilt & 0xC0; + uint8_t orig_rx_chains = _regs.rxfilt & 0xC0; /* Call into the clock configuration / settings function. This is where * all the hard work gets done. */ @@ -1962,8 +1962,8 @@ void ad9361_device_t::set_active_chains(bool tx1, bool tx2, bool rx1, bool rx2) } /* Check for FDD state */ - boost::uint8_t set_back_to_fdd = 0; - boost::uint8_t ensm_state = _io_iface->peek8(0x017) & 0x0F; + uint8_t set_back_to_fdd = 0; + uint8_t ensm_state = _io_iface->peek8(0x017) & 0x0F; if (ensm_state == 0xA) // FDD { /* Put into ALERT state (via the FDD flush state). */ @@ -2124,7 +2124,7 @@ double ad9361_device_t::set_gain(direction_t direction, chain_t chain, const dou * outside this function. */ double atten = AD9361_MAX_GAIN - value; - boost::uint32_t attenreg = boost::uint32_t(atten * 4); + uint32_t attenreg = uint32_t(atten * 4); if (chain == CHAIN_1) { _tx1_gain = value; _io_iface->poke8(0x073, attenreg & 0xFF); @@ -2166,8 +2166,8 @@ void ad9361_device_t::data_port_loopback(const bool loopback_enabled) * -0.25dB / bit 9bit resolution.*/ double ad9361_device_t::get_rssi(chain_t chain) { - boost::uint32_t reg_rssi = 0; - boost::uint8_t lsb_bit_pos = 0; + uint32_t reg_rssi = 0; + uint8_t lsb_bit_pos = 0; if (chain == CHAIN_1) { reg_rssi = 0x1A7; lsb_bit_pos = 0; @@ -2175,9 +2175,9 @@ double ad9361_device_t::get_rssi(chain_t chain) reg_rssi = 0x1A9; lsb_bit_pos = 1; } - boost::uint8_t msbs = _io_iface->peek8(reg_rssi); - boost::uint8_t lsb = ((_io_iface->peek8(0x1AB)) >> lsb_bit_pos) & 0x01; - boost::uint16_t val = ((msbs << 1) | lsb); + uint8_t msbs = _io_iface->peek8(reg_rssi); + uint8_t lsb = ((_io_iface->peek8(0x1AB)) >> lsb_bit_pos) & 0x01; + uint16_t val = ((msbs << 1) | lsb); double rssi = (-0.25f * ((double)val)); //-0.25dB/lsb (See Gain Control Users Guide p. 25) return rssi; } @@ -2190,7 +2190,7 @@ double ad9361_device_t::get_rssi(chain_t chain) double ad9361_device_t::_get_temperature(const double cal_offset, const double timeout) { //set 0x01D[0] to 1 to disable AuxADC GPIO reading - boost::uint8_t tmp = 0; + uint8_t tmp = 0; tmp = _io_iface->peek8(0x01D); _io_iface->poke8(0x01D, (tmp | 0x01)); _io_iface->poke8(0x00B, 0); //set offset to 0 @@ -2209,7 +2209,7 @@ double ad9361_device_t::_get_temperature(const double cal_offset, const double t } _io_iface->poke8(0x00C, 0x00); //clear read flag - boost::uint8_t temp = _io_iface->peek8(0x00E); //read temperature. + uint8_t temp = _io_iface->peek8(0x00E); //read temperature. double tmp_temp = temp/1.140f; //according to ADI driver tmp_temp = tmp_temp + cal_offset; //Constant offset acquired by one point calibration. @@ -2275,9 +2275,9 @@ void ad9361_device_t::set_iq_balance_auto(direction_t direction, const bool on) * the gain configuration will be reloaded. */ void ad9361_device_t::_setup_agc(chain_t chain, gain_mode_t gain_mode) { - boost::uint8_t gain_mode_reg = 0; - boost::uint8_t gain_mode_prev = 0; - boost::uint8_t gain_mode_bits_pos = 0; + uint8_t gain_mode_reg = 0; + uint8_t gain_mode_prev = 0; + uint8_t gain_mode_bits_pos = 0; gain_mode_reg = _io_iface->peek8(0x0FA); gain_mode_prev = (gain_mode_reg & 0x0F); @@ -2306,7 +2306,7 @@ void ad9361_device_t::_setup_agc(chain_t chain, gain_mode_t gain_mode) throw uhd::runtime_error("[ad9361_device_t] Gain mode does not exist"); } _io_iface->poke8(0x0FA, gain_mode_reg); - boost::uint8_t gain_mode_status = _io_iface->peek8(0x0FA); + uint8_t gain_mode_status = _io_iface->peek8(0x0FA); gain_mode_status = (gain_mode_status & 0x0F); /*Check if gain mode configuration needs to be reprogrammed*/ if (((gain_mode_prev == 0) && (gain_mode_status != 0)) || ((gain_mode_prev != 0) && (gain_mode_status == 0))) { @@ -2434,16 +2434,16 @@ double ad9361_device_t::set_bw_filter(direction_t direction, const double rf_bw) return (2.0 * set_analog_bb_bw); } -void ad9361_device_t::_set_fir_taps(direction_t direction, chain_t chain, const std::vector<boost::int16_t>& taps) +void ad9361_device_t::_set_fir_taps(direction_t direction, chain_t chain, const std::vector<int16_t>& taps) { size_t num_taps = taps.size(); size_t num_taps_avail = _get_num_fir_taps(direction); if(num_taps == num_taps_avail) { - boost::scoped_array<boost::uint16_t> coeffs(new boost::uint16_t[num_taps_avail]); + boost::scoped_array<uint16_t> coeffs(new uint16_t[num_taps_avail]); for (size_t i = 0; i < num_taps_avail; i++) { - coeffs[i] = boost::uint16_t(taps[i]); + coeffs[i] = uint16_t(taps[i]); } _program_fir_filter(direction, chain, num_taps_avail, coeffs.get()); } else if(num_taps < num_taps_avail){ @@ -2455,7 +2455,7 @@ void ad9361_device_t::_set_fir_taps(direction_t direction, chain_t chain, const size_t ad9361_device_t::_get_num_fir_taps(direction_t direction) { - boost::uint8_t num = 0; + uint8_t num = 0; if(direction == RX) num = _io_iface->peek8(0x0F5); else @@ -2466,7 +2466,7 @@ size_t ad9361_device_t::_get_num_fir_taps(direction_t direction) size_t ad9361_device_t::_get_fir_dec_int(direction_t direction) { - boost::uint8_t dec_int = 0; + uint8_t dec_int = 0; if(direction == RX) dec_int = _io_iface->peek8(0x003); else @@ -2484,12 +2484,12 @@ size_t ad9361_device_t::_get_fir_dec_int(direction_t direction) return dec_int; } -std::vector<boost::int16_t> ad9361_device_t::_get_fir_taps(direction_t direction, chain_t chain) +std::vector<int16_t> ad9361_device_t::_get_fir_taps(direction_t direction, chain_t chain) { int base; size_t num_taps = _get_num_fir_taps(direction); - boost::uint8_t config; - boost::uint8_t reg_numtaps = (((num_taps / 16) - 1) & 0x07) << 5; + uint8_t config; + uint8_t reg_numtaps = (((num_taps / 16) - 1) & 0x07) << 5; config = reg_numtaps | 0x02; //start the programming clock if(chain == CHAIN_1) @@ -2510,17 +2510,17 @@ std::vector<boost::int16_t> ad9361_device_t::_get_fir_taps(direction_t direction _io_iface->poke8(base+5,config); - std::vector<boost::int16_t> taps; - boost::uint8_t lower_val; - boost::uint8_t higher_val; - boost::uint16_t coeff; + std::vector<int16_t> taps; + uint8_t lower_val; + uint8_t higher_val; + uint16_t coeff; for(size_t i = 0;i < num_taps;i++) { _io_iface->poke8(base,0x00+i); lower_val = _io_iface->peek8(base+3); higher_val = _io_iface->peek8(base+4); coeff = ((higher_val << 8) | lower_val); - taps.push_back(boost::int16_t(coeff)); + taps.push_back(int16_t(coeff)); } config = (config & (~(1 << 1))); //disable filter clock @@ -2569,16 +2569,16 @@ filter_info_base::sptr ad9361_device_t::_get_filter_lp_bb(direction_t direction) * For TX direction the INT3 is returned. */ filter_info_base::sptr ad9361_device_t::_get_filter_dec_int_3(direction_t direction) { - boost::uint8_t enable = 0; + uint8_t enable = 0; double rate = _adcclock_freq; double full_scale; size_t dec = 0; size_t interpol = 0; filter_info_base::filter_type type = filter_info_base::DIGITAL_I16; std::string name; - boost::int16_t taps_array_rx[] = {55, 83, 0, -393, -580, 0, 1914, 4041, 5120, 4041, 1914, 0, -580, -393, 0, 83, 55}; - boost::int16_t taps_array_tx[] = {36, -19, 0, -156, -12, 0, 479, 233, 0, -1215, -993, 0, 3569, 6277, 8192, 6277, 3569, 0, -993, -1215, 0, 223, 479, 0, -12, -156, 0, -19, 36}; - std::vector<boost::int16_t> taps; + int16_t taps_array_rx[] = {55, 83, 0, -393, -580, 0, 1914, 4041, 5120, 4041, 1914, 0, -580, -393, 0, 83, 55}; + int16_t taps_array_tx[] = {36, -19, 0, -156, -12, 0, 479, 233, 0, -1215, -993, 0, 3569, 6277, 8192, 6277, 3569, 0, -993, -1215, 0, 223, 479, 0, -12, -156, 0, -19, 36}; + std::vector<int16_t> taps; filter_info_base::sptr ret; @@ -2590,14 +2590,14 @@ filter_info_base::sptr ad9361_device_t::_get_filter_dec_int_3(direction_t direct enable = _io_iface->peek8(0x003); enable = ((enable >> 4) & 0x03); - taps.assign(taps_array_rx, taps_array_rx + sizeof(taps_array_rx) / sizeof(boost::int16_t) ); + taps.assign(taps_array_rx, taps_array_rx + sizeof(taps_array_rx) / sizeof(int16_t) ); } else { full_scale = 8192; dec = 1; interpol = 3; - boost::uint8_t use_dac_clk_div = _io_iface->peek8(0x00A); + uint8_t use_dac_clk_div = _io_iface->peek8(0x00A); use_dac_clk_div = ((use_dac_clk_div >> 3) & 0x01); if(use_dac_clk_div == 1) { @@ -2611,24 +2611,24 @@ filter_info_base::sptr ad9361_device_t::_get_filter_dec_int_3(direction_t direct rate /= 3; } - taps.assign(taps_array_tx, taps_array_tx + sizeof(taps_array_tx) / sizeof(boost::int16_t) ); + taps.assign(taps_array_tx, taps_array_tx + sizeof(taps_array_tx) / sizeof(int16_t) ); } - ret = filter_info_base::sptr(new digital_filter_base<boost::int16_t>(type, (enable != 2) ? true : false, 2, rate, interpol, dec, full_scale, taps.size(), taps)); + ret = filter_info_base::sptr(new digital_filter_base<int16_t>(type, (enable != 2) ? true : false, 2, rate, interpol, dec, full_scale, taps.size(), taps)); return ret; } filter_info_base::sptr ad9361_device_t::_get_filter_hb_3(direction_t direction) { - boost::uint8_t enable = 0; + uint8_t enable = 0; double rate = _adcclock_freq; double full_scale = 0; size_t dec = 1; size_t interpol = 1; filter_info_base::filter_type type = filter_info_base::DIGITAL_I16; - boost::int16_t taps_array_rx[] = {1, 4, 6, 4, 1}; - boost::int16_t taps_array_tx[] = {1, 2, 1}; - std::vector<boost::int16_t> taps; + int16_t taps_array_rx[] = {1, 4, 6, 4, 1}; + int16_t taps_array_tx[] = {1, 2, 1}; + std::vector<int16_t> taps; if(direction == RX) { @@ -2637,12 +2637,12 @@ filter_info_base::sptr ad9361_device_t::_get_filter_hb_3(direction_t direction) enable = _io_iface->peek8(0x003); enable = ((enable >> 4) & 0x03); - taps.assign(taps_array_rx, taps_array_rx + sizeof(taps_array_rx) / sizeof(boost::int16_t) ); + taps.assign(taps_array_rx, taps_array_rx + sizeof(taps_array_rx) / sizeof(int16_t) ); } else { full_scale = 2; interpol = 2; - boost::uint8_t use_dac_clk_div = _io_iface->peek8(0x00A); + uint8_t use_dac_clk_div = _io_iface->peek8(0x00A); use_dac_clk_div = ((use_dac_clk_div >> 3) & 0x01); if(use_dac_clk_div == 1) { @@ -2655,26 +2655,26 @@ filter_info_base::sptr ad9361_device_t::_get_filter_hb_3(direction_t direction) { rate /= 2; } - taps.assign(taps_array_tx, taps_array_tx + sizeof(taps_array_tx) / sizeof(boost::int16_t) ); + taps.assign(taps_array_tx, taps_array_tx + sizeof(taps_array_tx) / sizeof(int16_t) ); } - filter_info_base::sptr hb = filter_info_base::sptr(new digital_filter_base<boost::int16_t>(type, (enable != 1) ? true : false, 2, rate, interpol, dec, full_scale, taps.size(), taps)); + filter_info_base::sptr hb = filter_info_base::sptr(new digital_filter_base<int16_t>(type, (enable != 1) ? true : false, 2, rate, interpol, dec, full_scale, taps.size(), taps)); return hb; } filter_info_base::sptr ad9361_device_t::_get_filter_hb_2(direction_t direction) { - boost::uint8_t enable = 0; + uint8_t enable = 0; double rate = _adcclock_freq; double full_scale = 0; size_t dec = 1; size_t interpol = 1; filter_info_base::filter_type type = filter_info_base::DIGITAL_I16; - boost::int16_t taps_array[] = {-9, 0, 73, 128, 73, 0, -9}; - std::vector<boost::int16_t> taps(taps_array, taps_array + sizeof(taps_array) / sizeof(boost::int16_t) ); + int16_t taps_array[] = {-9, 0, 73, 128, 73, 0, -9}; + std::vector<int16_t> taps(taps_array, taps_array + sizeof(taps_array) / sizeof(int16_t) ); - digital_filter_base<boost::int16_t>::sptr hb_3 = boost::dynamic_pointer_cast<digital_filter_base<boost::int16_t> >(_get_filter_hb_3(direction)); - digital_filter_base<boost::int16_t>::sptr dec_int_3 = boost::dynamic_pointer_cast<digital_filter_base<boost::int16_t> >(_get_filter_dec_int_3(direction)); + digital_filter_base<int16_t>::sptr hb_3 = boost::dynamic_pointer_cast<digital_filter_base<int16_t> >(_get_filter_hb_3(direction)); + digital_filter_base<int16_t>::sptr dec_int_3 = boost::dynamic_pointer_cast<digital_filter_base<int16_t> >(_get_filter_dec_int_3(direction)); if(direction == RX) { @@ -2714,24 +2714,24 @@ filter_info_base::sptr ad9361_device_t::_get_filter_hb_2(direction_t direction) } } - filter_info_base::sptr hb(new digital_filter_base<boost::int16_t>(type, (enable == 0) ? true : false, 3, rate, interpol, dec, full_scale, taps.size(), taps)); + filter_info_base::sptr hb(new digital_filter_base<int16_t>(type, (enable == 0) ? true : false, 3, rate, interpol, dec, full_scale, taps.size(), taps)); return hb; } filter_info_base::sptr ad9361_device_t::_get_filter_hb_1(direction_t direction) { - boost::uint8_t enable = 0; + uint8_t enable = 0; double rate = 0; double full_scale = 0; size_t dec = 1; size_t interpol = 1; filter_info_base::filter_type type = filter_info_base::DIGITAL_I16; - std::vector<boost::int16_t> taps; - boost::int16_t taps_rx_array[] = {-8, 0, 42, 0, -147, 0, 619, 1013, 619, 0, -147, 0, 42, 0, -8}; - boost::int16_t taps_tx_array[] = {-53, 0, 313, 0, -1155, 0, 4989, 8192, 4989, 0, -1155, 0, 313, 0, -53}; + std::vector<int16_t> taps; + int16_t taps_rx_array[] = {-8, 0, 42, 0, -147, 0, 619, 1013, 619, 0, -147, 0, 42, 0, -8}; + int16_t taps_tx_array[] = {-53, 0, 313, 0, -1155, 0, 4989, 8192, 4989, 0, -1155, 0, 313, 0, -53}; - digital_filter_base<boost::int16_t>::sptr hb_2 = boost::dynamic_pointer_cast<digital_filter_base<boost::int16_t> >(_get_filter_hb_2(direction)); + digital_filter_base<int16_t>::sptr hb_2 = boost::dynamic_pointer_cast<digital_filter_base<int16_t> >(_get_filter_hb_2(direction)); if(direction == RX) { @@ -2740,7 +2740,7 @@ filter_info_base::sptr ad9361_device_t::_get_filter_hb_1(direction_t direction) enable = _io_iface->peek8(0x003); enable = ((enable >> 2) & 0x01); rate = hb_2->get_output_rate(); - taps.assign(taps_rx_array, taps_rx_array + sizeof(taps_rx_array) / sizeof(boost::int16_t) ); + taps.assign(taps_rx_array, taps_rx_array + sizeof(taps_rx_array) / sizeof(int16_t) ); } else if (direction == TX) { full_scale = 8192; interpol = 2; @@ -2751,10 +2751,10 @@ filter_info_base::sptr ad9361_device_t::_get_filter_hb_1(direction_t direction) { rate /= 2; } - taps.assign(taps_tx_array, taps_tx_array + sizeof(taps_tx_array) / sizeof(boost::int16_t) ); + taps.assign(taps_tx_array, taps_tx_array + sizeof(taps_tx_array) / sizeof(int16_t) ); } - filter_info_base::sptr hb(new digital_filter_base<boost::int16_t>(type, (enable == 0) ? true : false, 4, rate, interpol, dec, full_scale, taps.size(), taps)); + filter_info_base::sptr hb(new digital_filter_base<int16_t>(type, (enable == 0) ? true : false, 4, rate, interpol, dec, full_scale, taps.size(), taps)); return hb; } @@ -2764,9 +2764,9 @@ filter_info_base::sptr ad9361_device_t::_get_filter_fir(direction_t direction, c size_t dec = 1; size_t interpol = 1; size_t max_num_taps = 128; - boost::uint8_t enable = 1; + uint8_t enable = 1; - digital_filter_base<boost::int16_t>::sptr hb_1 = boost::dynamic_pointer_cast<digital_filter_base<boost::int16_t> >(_get_filter_hb_1(direction)); + digital_filter_base<int16_t>::sptr hb_1 = boost::dynamic_pointer_cast<digital_filter_base<int16_t> >(_get_filter_hb_1(direction)); if(direction == RX) { @@ -2794,14 +2794,14 @@ filter_info_base::sptr ad9361_device_t::_get_filter_fir(direction_t direction, c } max_num_taps = _get_num_fir_taps(direction); - filter_info_base::sptr fir(new digital_filter_fir<boost::int16_t>(filter_info_base::DIGITAL_FIR_I16, (enable == 0) ? true : false, 5, rate, interpol, dec, 32767, max_num_taps, _get_fir_taps(direction, chain))); + filter_info_base::sptr fir(new digital_filter_fir<int16_t>(filter_info_base::DIGITAL_FIR_I16, (enable == 0) ? true : false, 5, rate, interpol, dec, 32767, max_num_taps, _get_fir_taps(direction, chain))); return fir; } void ad9361_device_t::_set_filter_fir(direction_t direction, chain_t channel, filter_info_base::sptr filter) { - digital_filter_fir<boost::int16_t>::sptr fir = boost::dynamic_pointer_cast<digital_filter_fir<boost::int16_t> >(filter); + digital_filter_fir<int16_t>::sptr fir = boost::dynamic_pointer_cast<digital_filter_fir<int16_t> >(filter); //only write taps. Ignore everything else for now _set_fir_taps(direction, channel, fir->get_taps()); } diff --git a/host/lib/usrp/common/ad9361_driver/ad9361_device.h b/host/lib/usrp/common/ad9361_driver/ad9361_device.h index d0e8a7e39..ae065d78e 100644 --- a/host/lib/usrp/common/ad9361_driver/ad9361_device.h +++ b/host/lib/usrp/common/ad9361_driver/ad9361_device.h @@ -167,10 +167,10 @@ public: static const double DEFAULT_TX_FREQ; private: //Methods - void _program_fir_filter(direction_t direction, int num_taps, boost::uint16_t *coeffs); - void _setup_tx_fir(size_t num_taps, boost::int32_t interpolation); - void _setup_rx_fir(size_t num_taps, boost::int32_t decimation); - void _program_fir_filter(direction_t direction, chain_t chain, int num_taps, boost::uint16_t *coeffs); + void _program_fir_filter(direction_t direction, int num_taps, uint16_t *coeffs); + void _setup_tx_fir(size_t num_taps, int32_t interpolation); + void _setup_rx_fir(size_t num_taps, int32_t decimation); + void _program_fir_filter(direction_t direction, chain_t chain, int num_taps, uint16_t *coeffs); void _setup_tx_fir(size_t num_taps); void _setup_rx_fir(size_t num_taps); void _calibrate_lock_bbpll(); @@ -197,8 +197,8 @@ private: //Methods void _configure_bb_dc_tracking(); void _configure_rx_iq_tracking(); void _setup_agc(chain_t chain, gain_mode_t gain_mode); - void _set_fir_taps(direction_t direction, chain_t chain, const std::vector<boost::int16_t>& taps); - std::vector<boost::int16_t> _get_fir_taps(direction_t direction, chain_t chain); + void _set_fir_taps(direction_t direction, chain_t chain, const std::vector<int16_t>& taps); + std::vector<int16_t> _get_fir_taps(direction_t direction, chain_t chain); size_t _get_num_fir_taps(direction_t direction); size_t _get_fir_dec_int(direction_t direction); filter_info_base::sptr _get_filter_lp_tia_sec(direction_t direction); @@ -214,13 +214,13 @@ private: //Methods private: //Members typedef struct { - boost::uint8_t vcodivs; - boost::uint8_t inputsel; - boost::uint8_t rxfilt; - boost::uint8_t txfilt; - boost::uint8_t bbpll; - boost::uint8_t bbftune_config; - boost::uint8_t bbftune_mode; + uint8_t vcodivs; + uint8_t inputsel; + uint8_t rxfilt; + uint8_t txfilt; + uint8_t bbpll; + uint8_t bbftune_config; + uint8_t bbftune_mode; } chip_regs_t; struct filter_query_helper @@ -256,11 +256,11 @@ private: //Members // if another call to set_clock_rate() actually has the same value. double _req_clock_rate; double _req_coreclk; - boost::uint16_t _rx_bbf_tunediv; - boost::uint8_t _curr_gain_table; + uint16_t _rx_bbf_tunediv; + uint8_t _curr_gain_table; double _rx1_gain, _rx2_gain, _tx1_gain, _tx2_gain; - boost::int32_t _tfir_factor; - boost::int32_t _rfir_factor; + int32_t _tfir_factor; + int32_t _rfir_factor; gain_mode_t _rx1_agc_mode, _rx2_agc_mode; bool _rx1_agc_enable, _rx2_agc_enable; //Register soft-copies diff --git a/host/lib/usrp/common/ad9361_driver/ad9361_filter_taps.h b/host/lib/usrp/common/ad9361_driver/ad9361_filter_taps.h index 97ff858fd..927d9e2a7 100644 --- a/host/lib/usrp/common/ad9361_driver/ad9361_filter_taps.h +++ b/host/lib/usrp/common/ad9361_driver/ad9361_filter_taps.h @@ -18,7 +18,7 @@ #ifndef INCLUDED_AD9361_FILTER_TAPS_HPP #define INCLUDED_AD9361_FILTER_TAPS_HPP -#include <boost/cstdint.hpp> +#include <stdint.h> /* A default 128-tap filter that can be used for generic circumstances. */ /* static uint16_t default_128tap_coeffs[] = { @@ -63,25 +63,25 @@ static uint16_t lte10mhz_tx_coeffs[] = { /************************************************************/ /* 127 tap Halfband designed with: round(2^16 * halfgen4(0.9/4,32)) (center tap tweaked to 32767) */ -static boost::int16_t hb127_coeffs[] = { +static int16_t hb127_coeffs[] = { -0,0,1,-0,-2,0,3,-0,-5,0,8,-0,-11,0,17,-0,-24,0,33,-0,-45,0,61,-0,-80,0,104,-0,-134,0,169,-0, -213,0,264,-0,-327,0,401,-0,-489,0,595,-0,-724,0,880,-0,-1075,0,1323,-0,-1652,0,2114,-0,-2819,0,4056,-0,-6883,0,20837,32767, 20837,0,-6883,-0,4056,0,-2819,-0,2114,0,-1652,-0,1323,0,-1075,-0,880,0,-724,-0,595,0,-489,-0,401,0,-327,-0,264,0,-213,-0, 169,0,-134,-0,104,0,-80,-0,61,0,-45,-0,33,0,-24,-0,17,0,-11,-0,8,0,-5,-0,3,0,-2,-0,1,0,-0, 0 }; /* 95 tap Halfband designed with: round(2^16 * halfgen4(0.9/4,24)) (center tap tweaked to 32767) */ -static boost::int16_t hb95_coeffs[] = { +static int16_t hb95_coeffs[] = { -4,0,8,-0,-14,0,23,-0,-36,0,52,-0,-75,0,104,-0,-140,0,186,-0,-243,0,314,-0,-400,0,505,-0,-634,0,793,-0, -993,0,1247,-0,-1585,0,2056,-0,-2773,0,4022,-0,-6862,0,20830,32767,20830,0,-6862,-0,4022,0,-2773,-0,2056,0,-1585,-0,1247,0,-993,-0, 793,0,-634,-0,505,0,-400,-0,314,0,-243,-0,186,0,-140,-0,104,0,-75,-0,52,0,-36,-0,23,0,-14,-0,8,0,-4,0}; /* 63 tap Halfband designed with: round(2^16 * halfgen4(0.9/4,16)) (center tap tweaked to 32767) */ -static boost::int16_t hb63_coeffs[] = { +static int16_t hb63_coeffs[] = { -58,0,83,-0,-127,0,185,-0,-262,0,361,-0,-488,0,648,-0,-853,0,1117,-0,-1466,0,1954,-0,-2689,0,3960,-0,-6825,0,20818,32767, 20818,0,-6825,-0,3960,0,-2689,-0,1954,0,-1466,-0,1117,0,-853,-0,648,0,-488,-0,361,0,-262,-0,185,0,-127,-0,83,0,-58,0}; /* 47 tap Halfband designed with: round(2^16 * halfgen4(0.85/4,12)) (center tap tweaked to 32767) */ -static boost::int16_t hb47_coeffs[] = { +static int16_t hb47_coeffs[] = { -50,0,98,-0,-181,0,307,-0,-489,0,747,-0,-1109,0,1628,-0,-2413,0,3750,-0,-6693,0,20773,32767,20773,0,-6693,-0,3750,0,-2413,-0, 1628,0,-1109,-0,747,0,-489,-0,307,0,-181,-0,98,0,-50,0}; @@ -91,7 +91,7 @@ static boost::int16_t hb47_coeffs[] = { /************************************************************/ /* 128 tap equiripple FIR low-pass designed with: round(2^16 * fir1(127,0.25)); */ -static boost::int16_t fir_128_x4_coeffs[] = { +static int16_t fir_128_x4_coeffs[] = { -15,-27,-23,-6,17,33,31,9,-23,-47,-45,-13,34,69,67,21,-49,-102,-99,-32,69,146,143,48,-96,-204,-200,-69,129,278,275,97,-170, -372,-371,-135,222,494,497,187,-288,-654,-665,-258,376,875,902,363,-500,-1201,-1265,-530,699,1748,1906,845,-1089,-2922,-3424, -1697,2326,7714,12821,15921,15921,12821,7714,2326,-1697,-3424,-2922,-1089,845,1906,1748,699,-530,-1265,-1201,-500,363,902,875, @@ -99,20 +99,20 @@ static boost::int16_t fir_128_x4_coeffs[] = { 67,69,34,-13,-45,-47,-23,9,31,33,17,-6,-23,-27,-15}; /* 96 tap equiripple FIR low-pass designed with: round(2^16 * fir1(95,0.25)); */ -static boost::int16_t fir_96_x4_coeffs[] = { +static int16_t fir_96_x4_coeffs[] = { -18,-35,-33,-11,23,50,51,18,-37,-83,-86,-31,62,140,145,54,-98,-224,-232,-88,149,343,356,138,-218,-509,-530,-211,313,743,781, 320,-447,-1089,-1163,-494,658,1663,1830,819,-1062,-2868,-3379,-1682,2314,7695,12812,15924,15924,12812,7695,2314,-1682,-3379, -2868,-1062,819,1830,1663,658,-494,-1163,-1089,-447,320,781,743,313,-211,-530,-509,-218,138,356,343,149,-88,-232,-224,-98,54, 145,140,62,-31,-86,-83,-37,18,51,50,23,-11,-33,-35,-18}; /* 64 tap equiripple FIR low-pass designed with: round(2^16 * fir1(63,0.25)); */ -static boost::int16_t fir_64_x4_coeffs[] = { +static int16_t fir_64_x4_coeffs[] = { -25,-54,-56,-22,41,102,117,50,-87,-223,-253,-109,174,443,496,215,-317,-809,-903,-398,550,1434,1623,744,-987,-2715,-3251, -1640,2279,7638,12782,15928,15928,12782,7638,2279,-1640,-3251,-2715,-987,744,1623,1434,550,-398,-903,-809,-317,215,496, 443,174,-109,-253,-223,-87,50,117,102,41,-22,-56,-54,-25}; /* 48 tap equiripple FIR low-pass designed with: round(2^16 * fir1(47,0.25)); */ -static boost::int16_t fir_48_x4_coeffs[] = { +static int16_t fir_48_x4_coeffs[] = { -32,-74,-84,-39,68,191,237,114,-183,-508,-609,-287,419,1149,1358,647,-887,-2508,-3073,-1580,2230,7555,12736,15928,15928, 12736,7555,2230,-1580,-3073,-2508,-887,647,1358,1149,419,-287,-609,-508,-183,114,237,191,68,-39,-84,-74,-32}; diff --git a/host/lib/usrp/common/ad9361_driver/ad9361_gain_tables.h b/host/lib/usrp/common/ad9361_driver/ad9361_gain_tables.h index 8cd958e23..99794697a 100644 --- a/host/lib/usrp/common/ad9361_driver/ad9361_gain_tables.h +++ b/host/lib/usrp/common/ad9361_driver/ad9361_gain_tables.h @@ -18,9 +18,9 @@ #ifndef INCLUDED_AD9361_GAIN_TABLES_HPP #define INCLUDED_AD9361_GAIN_TABLES_HPP -#include <boost/cstdint.hpp> +#include <stdint.h> -boost::uint8_t gain_table_sub_1300mhz[77][3] = { +uint8_t gain_table_sub_1300mhz[77][3] = { { 0x00, 0x00, 0x20 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x00 }, { 0x00, 0x02, 0x00 }, { 0x00, 0x03, 0x00 }, { 0x00, 0x04, 0x00 }, { 0x00, 0x05, 0x00 }, { 0x01, 0x03, 0x20 }, @@ -49,7 +49,7 @@ boost::uint8_t gain_table_sub_1300mhz[77][3] = { { 0x6E, 0x38, 0x20 }, { 0x6F, 0x38, 0x20 } }; -boost::uint8_t gain_table_1300mhz_to_4000mhz[77][3] = { +uint8_t gain_table_1300mhz_to_4000mhz[77][3] = { { 0x00, 0x00, 0x20 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x00 }, { 0x00, 0x02, 0x00 }, { 0x00, 0x03, 0x00 }, { 0x00, 0x04, 0x00 }, { 0x00, 0x05, 0x00 }, { 0x01, 0x03, 0x20 }, @@ -78,7 +78,7 @@ boost::uint8_t gain_table_1300mhz_to_4000mhz[77][3] = { { 0x6E, 0x38, 0x20 }, { 0x6F, 0x38, 0x20 } }; -boost::uint8_t gain_table_4000mhz_to_6000mhz[77][3] = { +uint8_t gain_table_4000mhz_to_6000mhz[77][3] = { { 0x00, 0x00, 0x20 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x00 }, { 0x00, 0x02, 0x00 }, { 0x00, 0x03, 0x00 }, { 0x01, 0x01, 0x20 }, diff --git a/host/lib/usrp/common/ad936x_manager.cpp b/host/lib/usrp/common/ad936x_manager.cpp index e7af411fa..2b6d69c15 100644 --- a/host/lib/usrp/common/ad936x_manager.cpp +++ b/host/lib/usrp/common/ad936x_manager.cpp @@ -113,15 +113,15 @@ class ad936x_manager_impl : public ad936x_manager { // Create test word boost::hash_combine(hash, i); - const boost::uint32_t word32 = boost::uint32_t(hash) & 0xfff0fff0; + const uint32_t word32 = uint32_t(hash) & 0xfff0fff0; // Write test word to codec_idle idle register (on TX side) poker_functor(word32); // Read back values - TX is lower 32-bits and RX is upper 32-bits - const boost::uint64_t rb_word64 = peeker_functor(); - const boost::uint32_t rb_tx = boost::uint32_t(rb_word64 >> 32); - const boost::uint32_t rb_rx = boost::uint32_t(rb_word64 & 0xffffffff); + const uint64_t rb_word64 = peeker_functor(); + const uint32_t rb_tx = uint32_t(rb_word64 >> 32); + const uint32_t rb_rx = uint32_t(rb_word64 & 0xffffffff); // Compare TX and RX values to test word bool test_fail = word32 != rb_tx or word32 != rb_rx; diff --git a/host/lib/usrp/common/adf4001_ctrl.cpp b/host/lib/usrp/common/adf4001_ctrl.cpp index 001b68b7a..01a35dbec 100644 --- a/host/lib/usrp/common/adf4001_ctrl.cpp +++ b/host/lib/usrp/common/adf4001_ctrl.cpp @@ -47,47 +47,47 @@ adf4001_regs_t::adf4001_regs_t(void) { } -boost::uint32_t adf4001_regs_t::get_reg(boost::uint8_t addr) { - boost::uint32_t reg = 0; +uint32_t adf4001_regs_t::get_reg(uint8_t addr) { + uint32_t reg = 0; switch (addr) { case 0: - reg |= (boost::uint32_t(ref_counter) & 0x003FFF) << 2; - reg |= (boost::uint32_t(anti_backlash_width) & 0x000003) << 16; - reg |= (boost::uint32_t(lock_detect_precision) & 0x000001) << 20; + reg |= (uint32_t(ref_counter) & 0x003FFF) << 2; + reg |= (uint32_t(anti_backlash_width) & 0x000003) << 16; + reg |= (uint32_t(lock_detect_precision) & 0x000001) << 20; break; case 1: - reg |= (boost::uint32_t(n) & 0x001FFF) << 8; - reg |= (boost::uint32_t(charge_pump_gain) & 0x000001) << 21; + reg |= (uint32_t(n) & 0x001FFF) << 8; + reg |= (uint32_t(charge_pump_gain) & 0x000001) << 21; break; case 2: - reg |= (boost::uint32_t(counter_reset) & 0x000001) << 2; - reg |= (boost::uint32_t(power_down) & 0x000001) << 3; - reg |= (boost::uint32_t(muxout) & 0x000007) << 4; - reg |= (boost::uint32_t(phase_detector_polarity) & 0x000001) << 7; - reg |= (boost::uint32_t(charge_pump_mode) & 0x000001) << 8; - reg |= (boost::uint32_t(fastlock_mode) & 0x000003) << 9; - reg |= (boost::uint32_t(timer_counter_control) & 0x00000F) << 11; - reg |= (boost::uint32_t(charge_pump_current_1) & 0x000007) << 15; - reg |= (boost::uint32_t(charge_pump_current_2) & 0x000007) << 18; - reg |= (boost::uint32_t(power_down) & 0x000002) << 21; + reg |= (uint32_t(counter_reset) & 0x000001) << 2; + reg |= (uint32_t(power_down) & 0x000001) << 3; + reg |= (uint32_t(muxout) & 0x000007) << 4; + reg |= (uint32_t(phase_detector_polarity) & 0x000001) << 7; + reg |= (uint32_t(charge_pump_mode) & 0x000001) << 8; + reg |= (uint32_t(fastlock_mode) & 0x000003) << 9; + reg |= (uint32_t(timer_counter_control) & 0x00000F) << 11; + reg |= (uint32_t(charge_pump_current_1) & 0x000007) << 15; + reg |= (uint32_t(charge_pump_current_2) & 0x000007) << 18; + reg |= (uint32_t(power_down) & 0x000002) << 21; break; case 3: - reg |= (boost::uint32_t(counter_reset) & 0x000001) << 2; - reg |= (boost::uint32_t(power_down) & 0x000001) << 3; - reg |= (boost::uint32_t(muxout) & 0x000007) << 4; - reg |= (boost::uint32_t(phase_detector_polarity) & 0x000001) << 7; - reg |= (boost::uint32_t(charge_pump_mode) & 0x000001) << 8; - reg |= (boost::uint32_t(fastlock_mode) & 0x000003) << 9; - reg |= (boost::uint32_t(timer_counter_control) & 0x00000F) << 11; - reg |= (boost::uint32_t(charge_pump_current_1) & 0x000007) << 15; - reg |= (boost::uint32_t(charge_pump_current_2) & 0x000007) << 18; - reg |= (boost::uint32_t(power_down) & 0x000002) << 20; + reg |= (uint32_t(counter_reset) & 0x000001) << 2; + reg |= (uint32_t(power_down) & 0x000001) << 3; + reg |= (uint32_t(muxout) & 0x000007) << 4; + reg |= (uint32_t(phase_detector_polarity) & 0x000001) << 7; + reg |= (uint32_t(charge_pump_mode) & 0x000001) << 8; + reg |= (uint32_t(fastlock_mode) & 0x000003) << 9; + reg |= (uint32_t(timer_counter_control) & 0x00000F) << 11; + reg |= (uint32_t(charge_pump_current_1) & 0x000007) << 15; + reg |= (uint32_t(charge_pump_current_2) & 0x000007) << 18; + reg |= (uint32_t(power_down) & 0x000002) << 20; break; default: break; } - reg |= (boost::uint32_t(addr) & 0x03); + reg |= (uint32_t(addr) & 0x03); return reg; } @@ -140,8 +140,8 @@ void adf4001_ctrl::program_regs(void) { } -void adf4001_ctrl::write_reg(boost::uint8_t addr) { - boost::uint32_t reg = adf4001_regs.get_reg(addr); //load the reg data +void adf4001_ctrl::write_reg(uint8_t addr) { + uint32_t reg = adf4001_regs.get_reg(addr); //load the reg data spi_iface->transact_spi(slaveno, spi_config, diff --git a/host/lib/usrp/common/adf4001_ctrl.hpp b/host/lib/usrp/common/adf4001_ctrl.hpp index e801ae0c4..c6813f43c 100644 --- a/host/lib/usrp/common/adf4001_ctrl.hpp +++ b/host/lib/usrp/common/adf4001_ctrl.hpp @@ -25,7 +25,7 @@ #include "spi_core_3000.hpp" #include <uhd/types/serial.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/thread/thread.hpp> namespace uhd { namespace usrp { @@ -34,14 +34,14 @@ class adf4001_regs_t { public: /* Function prototypes */ - boost::uint32_t get_reg(boost::uint8_t addr); + uint32_t get_reg(uint8_t addr); adf4001_regs_t(void); /* Register values / addresses */ - boost::uint16_t ref_counter; //14 bits - boost::uint16_t n; //13 bits - boost::uint8_t charge_pump_current_1; //3 bits - boost::uint8_t charge_pump_current_2; //3 bits + uint16_t ref_counter; //14 bits + uint16_t n; //13 bits + uint8_t charge_pump_current_1; //3 bits + uint8_t charge_pump_current_2; //3 bits enum anti_backlash_width_t { ANTI_BACKLASH_WIDTH_2_9NS = 0, @@ -133,7 +133,7 @@ private: adf4001_regs_t adf4001_regs; void program_regs(void); - void write_reg(boost::uint8_t addr); + void write_reg(uint8_t addr); }; }} diff --git a/host/lib/usrp/common/adf435x.hpp b/host/lib/usrp/common/adf435x.hpp index d08c6b9dd..ff7b1a2f4 100644 --- a/host/lib/usrp/common/adf435x.hpp +++ b/host/lib/usrp/common/adf435x.hpp @@ -33,7 +33,7 @@ class adf435x_iface { public: typedef boost::shared_ptr<adf435x_iface> sptr; - typedef boost::function<void(std::vector<boost::uint32_t>)> write_fn_t; + typedef boost::function<void(std::vector<uint32_t>)> write_fn_t; static sptr make_adf4350(write_fn_t write); static sptr make_adf4351(write_fn_t write); @@ -162,8 +162,8 @@ public: uhd::range_t int_range = get_int_range(); double pfd_freq = 0; - boost::uint16_t R = 0, BS = 0, N = 0, FRAC = 0, MOD = 0; - boost::uint16_t RFdiv = static_cast<boost::uint16_t>(rf_divider_range.start()); + uint16_t R = 0, BS = 0, N = 0, FRAC = 0, MOD = 0; + uint16_t RFdiv = static_cast<uint16_t>(rf_divider_range.start()); bool D = false, T = false; //Reference doubler for 50% duty cycle @@ -171,7 +171,7 @@ public: //increase RF divider until acceptable VCO frequency double vco_freq = target_freq; - while (vco_freq < VCO_FREQ_MIN && RFdiv < static_cast<boost::uint16_t>(rf_divider_range.stop())) { + while (vco_freq < VCO_FREQ_MIN && RFdiv < static_cast<uint16_t>(rf_divider_range.stop())) { vco_freq *= 2; RFdiv *= 2; } @@ -202,10 +202,10 @@ public: if (pfd_freq > PFD_FREQ_MAX) continue; //First, ignore fractional part of tuning - N = boost::uint16_t(std::floor(feedback_freq/pfd_freq)); + N = uint16_t(std::floor(feedback_freq/pfd_freq)); //keep N > minimum int divider requirement - if (N < static_cast<boost::uint16_t>(int_range.start())) continue; + if (N < static_cast<uint16_t>(int_range.start())) continue; for(BS=1; BS <= 255; BS+=1){ //keep the band select frequency at or below band_sel_freq_max @@ -217,7 +217,7 @@ public: //Fractional-N calculation MOD = 4095; //max fractional accuracy - FRAC = static_cast<boost::uint16_t>(boost::math::round((feedback_freq/pfd_freq - N)*MOD)); + FRAC = static_cast<uint16_t>(boost::math::round((feedback_freq/pfd_freq - N)*MOD)); if (int_n_mode) { if (FRAC > (MOD / 2)) { //Round integer such that actual freq is closest to target N++; @@ -247,7 +247,7 @@ public: _regs.frac_12_bit = FRAC; _regs.int_16_bit = N; _regs.mod_12_bit = MOD; - _regs.clock_divider_12_bit = std::max<boost::uint16_t>(1, boost::uint16_t(std::ceil(PHASE_RESYNC_TIME*pfd_freq/MOD))); + _regs.clock_divider_12_bit = std::max<uint16_t>(1, uint16_t(std::ceil(PHASE_RESYNC_TIME*pfd_freq/MOD))); _regs.feedback_select = _fb_after_divider ? adf435x_regs_t::FEEDBACK_SELECT_DIVIDED : adf435x_regs_t::FEEDBACK_SELECT_FUNDAMENTAL; @@ -261,7 +261,7 @@ public: _regs.reference_doubler = D ? adf435x_regs_t::REFERENCE_DOUBLER_ENABLED : adf435x_regs_t::REFERENCE_DOUBLER_DISABLED; - _regs.band_select_clock_div = boost::uint8_t(BS); + _regs.band_select_clock_div = uint8_t(BS); _regs.rf_divider_select = static_cast<typename adf435x_regs_t::rf_divider_select_t>(_get_rfdiv_setting(RFdiv)); _regs.ldf = int_n_mode ? adf435x_regs_t::LDF_INT_N : @@ -277,16 +277,16 @@ public: << boost::format("ADF 435X Settings: R=%d, BS=%d, N=%d, FRAC=%d, MOD=%d, T=%d, D=%d, RFdiv=%d" ) % R % BS % N % FRAC % MOD % T % D % RFdiv << std::endl; - UHD_ASSERT_THROW((_regs.frac_12_bit & ((boost::uint16_t)~0xFFF)) == 0); - UHD_ASSERT_THROW((_regs.mod_12_bit & ((boost::uint16_t)~0xFFF)) == 0); - UHD_ASSERT_THROW((_regs.clock_divider_12_bit & ((boost::uint16_t)~0xFFF)) == 0); - UHD_ASSERT_THROW((_regs.r_counter_10_bit & ((boost::uint16_t)~0x3FF)) == 0); + UHD_ASSERT_THROW((_regs.frac_12_bit & ((uint16_t)~0xFFF)) == 0); + UHD_ASSERT_THROW((_regs.mod_12_bit & ((uint16_t)~0xFFF)) == 0); + UHD_ASSERT_THROW((_regs.clock_divider_12_bit & ((uint16_t)~0xFFF)) == 0); + UHD_ASSERT_THROW((_regs.r_counter_10_bit & ((uint16_t)~0x3FF)) == 0); UHD_ASSERT_THROW(vco_freq >= VCO_FREQ_MIN and vco_freq <= VCO_FREQ_MAX); - UHD_ASSERT_THROW(RFdiv >= static_cast<boost::uint16_t>(rf_divider_range.start())); - UHD_ASSERT_THROW(RFdiv <= static_cast<boost::uint16_t>(rf_divider_range.stop())); - UHD_ASSERT_THROW(_regs.int_16_bit >= static_cast<boost::uint16_t>(int_range.start())); - UHD_ASSERT_THROW(_regs.int_16_bit <= static_cast<boost::uint16_t>(int_range.stop())); + UHD_ASSERT_THROW(RFdiv >= static_cast<uint16_t>(rf_divider_range.start())); + UHD_ASSERT_THROW(RFdiv <= static_cast<uint16_t>(rf_divider_range.stop())); + UHD_ASSERT_THROW(_regs.int_16_bit >= static_cast<uint16_t>(int_range.start())); + UHD_ASSERT_THROW(_regs.int_16_bit <= static_cast<uint16_t>(int_range.stop())); if (flush) commit(); return actual_freq; @@ -296,8 +296,8 @@ public: { //reset counters _regs.counter_reset = adf435x_regs_t::COUNTER_RESET_ENABLED; - std::vector<boost::uint32_t> regs; - regs.push_back(_regs.get_reg(boost::uint32_t(2))); + std::vector<uint32_t> regs; + regs.push_back(_regs.get_reg(uint32_t(2))); _write_fn(regs); _regs.counter_reset = adf435x_regs_t::COUNTER_RESET_DISABLED; @@ -305,14 +305,14 @@ public: //correct power-up sequence to write registers (5, 4, 3, 2, 1, 0) regs.clear(); for (int addr = 5; addr >= 0; addr--) { - regs.push_back(_regs.get_reg(boost::uint32_t(addr))); + regs.push_back(_regs.get_reg(uint32_t(addr))); } _write_fn(regs); } protected: uhd::range_t _get_rfdiv_range(); - int _get_rfdiv_setting(boost::uint16_t div); + int _get_rfdiv_setting(uint16_t div); write_fn_t _write_fn; adf435x_regs_t _regs; @@ -334,7 +334,7 @@ inline uhd::range_t adf435x_impl<adf4351_regs_t>::_get_rfdiv_range() } template <> -inline int adf435x_impl<adf4350_regs_t>::_get_rfdiv_setting(boost::uint16_t div) +inline int adf435x_impl<adf4350_regs_t>::_get_rfdiv_setting(uint16_t div) { switch (div) { case 1: return int(adf4350_regs_t::RF_DIVIDER_SELECT_DIV1); @@ -347,7 +347,7 @@ inline int adf435x_impl<adf4350_regs_t>::_get_rfdiv_setting(boost::uint16_t div) } template <> -inline int adf435x_impl<adf4351_regs_t>::_get_rfdiv_setting(boost::uint16_t div) +inline int adf435x_impl<adf4351_regs_t>::_get_rfdiv_setting(uint16_t div) { switch (div) { case 1: return int(adf4351_regs_t::RF_DIVIDER_SELECT_DIV1); diff --git a/host/lib/usrp/common/adf5355.cpp b/host/lib/usrp/common/adf5355.cpp index bb0906724..ee9b54622 100644 --- a/host/lib/usrp/common/adf5355.cpp +++ b/host/lib/usrp/common/adf5355.cpp @@ -46,9 +46,9 @@ static const double ADF5355_MIN_OUTB_FREQ = (3.4e9 * 2); static const double ADF5355_PHASE_RESYNC_TIME = 400e-6; -static const boost::uint32_t ADF5355_MOD1 = 16777216; -static const boost::uint32_t ADF5355_MAX_MOD2 = 16384; -static const boost::uint16_t ADF5355_MIN_INT_PRESCALER_89 = 75; +static const uint32_t ADF5355_MOD1 = 16777216; +static const uint32_t ADF5355_MAX_MOD2 = 16384; +static const uint16_t ADF5355_MIN_INT_PRESCALER_89 = 75; class adf5355_impl : public adf5355_iface { @@ -164,31 +164,31 @@ public: adf5355_regs_t::REFERENCE_DOUBLER_ENABLED : adf5355_regs_t::REFERENCE_DOUBLER_DISABLED; _regs.r_counter_10_bit = ref_div_factor; - UHD_ASSERT_THROW((_regs.r_counter_10_bit & ((boost::uint16_t)~0x3FF)) == 0); + UHD_ASSERT_THROW((_regs.r_counter_10_bit & ((uint16_t)~0x3FF)) == 0); //----------------------------------------------------------- //Set timeouts (code from ADI driver) - _regs.timeout = clamp<boost::uint16_t>( - static_cast<boost::uint16_t>(ceil(_pfd_freq / (20e3 * 30))), 1, 1023); - UHD_ASSERT_THROW((_regs.timeout & ((boost::uint16_t)~0x3FF)) == 0); + _regs.timeout = clamp<uint16_t>( + static_cast<uint16_t>(ceil(_pfd_freq / (20e3 * 30))), 1, 1023); + UHD_ASSERT_THROW((_regs.timeout & ((uint16_t)~0x3FF)) == 0); _regs.synth_lock_timeout = - static_cast<boost::uint8_t>(ceil((_pfd_freq * 2) / (100e3 * _regs.timeout))); - UHD_ASSERT_THROW((_regs.synth_lock_timeout & ((boost::uint16_t)~0x1F)) == 0); + static_cast<uint8_t>(ceil((_pfd_freq * 2) / (100e3 * _regs.timeout))); + UHD_ASSERT_THROW((_regs.synth_lock_timeout & ((uint16_t)~0x1F)) == 0); _regs.auto_level_timeout = - static_cast<boost::uint8_t>(ceil((_pfd_freq * 5) / (100e3 * _regs.timeout))); + static_cast<uint8_t>(ceil((_pfd_freq * 5) / (100e3 * _regs.timeout))); //----------------------------------------------------------- //Set VCO band divider _regs.vco_band_div = - static_cast<boost::uint8_t>(ceil(_pfd_freq / 2.4e6)); + static_cast<uint8_t>(ceil(_pfd_freq / 2.4e6)); //----------------------------------------------------------- //Set ADC delay (code from ADI driver) _regs.adc_enable = adf5355_regs_t::ADC_ENABLE_ENABLED; _regs.adc_conversion = adf5355_regs_t::ADC_CONVERSION_ENABLED; - _regs.adc_clock_divider = clamp<boost::uint8_t>( - static_cast<boost::uint8_t>(ceil(((_pfd_freq / 100e3) - 2) / 4)), 1, 255); - _wait_time_us = static_cast<boost::uint32_t>( + _regs.adc_clock_divider = clamp<uint8_t>( + static_cast<uint8_t>(ceil(((_pfd_freq / 100e3) - 2) / 4)), 1, 255); + _wait_time_us = static_cast<uint32_t>( ceil(16e6 / (_pfd_freq / ((4 * _regs.adc_clock_divider) + 2)))); //----------------------------------------------------------- @@ -196,7 +196,7 @@ public: _regs.phase_resync = adf5355_regs_t::PHASE_RESYNC_DISABLED; // Disabled during development _regs.phase_adjust = adf5355_regs_t::PHASE_ADJUST_DISABLED; _regs.sd_load_reset = adf5355_regs_t::SD_LOAD_RESET_ON_REG0_UPDATE; - _regs.phase_resync_clk_div = static_cast<boost::uint16_t>( + _regs.phase_resync_clk_div = static_cast<uint16_t>( floor(ADF5355_PHASE_RESYNC_TIME * _pfd_freq)); _rewrite_regs = true; @@ -247,14 +247,14 @@ public: if (target_freq > ADF5355_MAX_OUT_FREQ or target_freq < ADF5355_MIN_OUT_FREQ) { throw uhd::runtime_error("requested frequency out of range."); } - if ((boost::uint32_t) freq_resolution == 0) { + if ((uint32_t) freq_resolution == 0) { throw uhd::runtime_error("requested resolution cannot be less than 1."); } /* Calculate target VCOout frequency */ //Increase RF divider until acceptable VCO frequency double target_vco_freq = target_freq; - boost::uint32_t rf_divider = 1; + uint32_t rf_divider = 1; while (target_vco_freq < ADF5355_MIN_VCO_FREQ && rf_divider < 64) { target_vco_freq *= 2; rf_divider *= 2; @@ -278,17 +278,17 @@ public: } double N = prescaler_input_freq / _pfd_freq; - boost::uint16_t INT = static_cast<boost::uint16_t>(floor(N)); - boost::uint32_t FRAC1 = static_cast<boost::uint32_t>(floor((N - INT) * ADF5355_MOD1)); + uint16_t INT = static_cast<uint16_t>(floor(N)); + uint32_t FRAC1 = static_cast<uint32_t>(floor((N - INT) * ADF5355_MOD1)); double residue = ADF5355_MOD1 * (N - (INT + FRAC1 / ADF5355_MOD1)); double gcd = boost::math::gcd(static_cast<int>(_pfd_freq), static_cast<int>(freq_resolution)); - boost::uint16_t MOD2 = static_cast<boost::uint16_t>(floor(_pfd_freq / gcd)); + uint16_t MOD2 = static_cast<uint16_t>(floor(_pfd_freq / gcd)); if (MOD2 > ADF5355_MAX_MOD2) { MOD2 = ADF5355_MAX_MOD2; } - boost::uint16_t FRAC2 = ceil(residue * MOD2); + uint16_t FRAC2 = ceil(residue * MOD2); double coerced_vco_freq = _pfd_freq * ( todbl(INT) + ( @@ -317,9 +317,9 @@ public: // ADI: Tests have shown that the optimal bleed set is the following: // 4/N < IBLEED/ICP < 10/N */ /* - boost::uint32_t cp_curr_ua = - (static_cast<boost::uint32_t>(_regs.charge_pump_current) + 1) * 315; - _regs.cp_bleed_current = clamp<boost::uint8_t>( + uint32_t cp_curr_ua = + (static_cast<uint32_t>(_regs.charge_pump_current) + 1) * 315; + _regs.cp_bleed_current = clamp<uint8_t>( ceil((todbl(400)*cp_curr_ua) / (_regs.int_16_bit*375)), 1, 255); _regs.negative_bleed = adf5355_regs_t::NEGATIVE_BLEED_ENABLED; _regs.gated_bleed = adf5355_regs_t::GATED_BLEED_DISABLED; @@ -335,7 +335,7 @@ public: //For a full state sync write registers in reverse order 12 - 0 addr_vtr_t regs; for (int addr = 12; addr >= 0; addr--) { - regs.push_back(_regs.get_reg(boost::uint32_t(addr))); + regs.push_back(_regs.get_reg(uint32_t(addr))); } _write_fn(regs); _rewrite_regs = false; @@ -359,12 +359,12 @@ public: } private: //Members - typedef std::vector<boost::uint32_t> addr_vtr_t; + typedef std::vector<uint32_t> addr_vtr_t; write_fn_t _write_fn; adf5355_regs_t _regs; bool _rewrite_regs; - boost::uint32_t _wait_time_us; + uint32_t _wait_time_us; double _ref_freq; double _pfd_freq; double _fb_after_divider; diff --git a/host/lib/usrp/common/adf5355.hpp b/host/lib/usrp/common/adf5355.hpp index fb262cc9f..55294cda1 100644 --- a/host/lib/usrp/common/adf5355.hpp +++ b/host/lib/usrp/common/adf5355.hpp @@ -20,12 +20,13 @@ #include <boost/function.hpp> #include <vector> +#include <stdint.h> class adf5355_iface { public: typedef boost::shared_ptr<adf5355_iface> sptr; - typedef boost::function<void(std::vector<boost::uint32_t>)> write_fn_t; + typedef boost::function<void(std::vector<uint32_t>)> write_fn_t; static sptr make(write_fn_t write); diff --git a/host/lib/usrp/common/async_packet_handler.hpp b/host/lib/usrp/common/async_packet_handler.hpp index fef03483f..20409c77a 100644 --- a/host/lib/usrp/common/async_packet_handler.hpp +++ b/host/lib/usrp/common/async_packet_handler.hpp @@ -31,11 +31,11 @@ namespace uhd{ namespace usrp{ const to_host_type &to_host, async_metadata_t &metadata, const transport::vrt::if_packet_info_t &if_packet_info, - const boost::uint32_t *vrt_hdr, + const uint32_t *vrt_hdr, const double tick_rate, const size_t channel = 0 ){ - const boost::uint32_t *payload = vrt_hdr + if_packet_info.num_header_words32; + const uint32_t *payload = vrt_hdr + if_packet_info.num_header_words32; //load into metadata metadata.channel = channel; diff --git a/host/lib/usrp/common/fifo_ctrl_excelsior.cpp b/host/lib/usrp/common/fifo_ctrl_excelsior.cpp index f55d1ef41..a9995a161 100644 --- a/host/lib/usrp/common/fifo_ctrl_excelsior.cpp +++ b/host/lib/usrp/common/fifo_ctrl_excelsior.cpp @@ -38,7 +38,7 @@ static const size_t POKE32_CMD = (1 << 8); static const size_t PEEK32_CMD = 0; static const double ACK_TIMEOUT = 0.5; static const double MASSIVE_TIMEOUT = 10.0; //for when we wait on a timed command -static const boost::uint32_t MAX_SEQS_OUT = 15; +static const uint32_t MAX_SEQS_OUT = 15; #define SPI_DIV _config.spi_base + 0 #define SPI_CTRL _config.spi_base + 4 @@ -46,7 +46,7 @@ static const boost::uint32_t MAX_SEQS_OUT = 15; #define SPI_DIVIDER 4 struct ctrl_result_t{ - boost::uint32_t msg[2]; + uint32_t msg[2]; }; class fifo_ctrl_excelsior_impl : public fifo_ctrl_excelsior{ @@ -90,9 +90,9 @@ public: void handle_msg1(void){ managed_recv_buffer::sptr buff = _xport->get_recv_buff(); if (not buff) return; - const boost::uint32_t *pkt = buff->cast<const boost::uint32_t *>(); + const uint32_t *pkt = buff->cast<const uint32_t *>(); vrt::if_packet_info_t packet_info; - packet_info.num_packet_words32 = buff->size()/sizeof(boost::uint32_t); + packet_info.num_packet_words32 = buff->size()/sizeof(uint32_t); try{ vrt::if_hdr_unpack_le(pkt, packet_info); } @@ -107,7 +107,7 @@ public: } else if (packet_info.has_sid and packet_info.sid >= _config.async_sid_base and packet_info.sid <= _config.async_sid_base + _config.num_async_chan){ async_metadata_t metadata; - load_metadata_from_buff(uhd::wtohx<boost::uint32_t>, metadata, packet_info, pkt, _tick_rate, packet_info.sid - _config.async_sid_base); + load_metadata_from_buff(uhd::wtohx<uint32_t>, metadata, packet_info, pkt, _tick_rate, packet_info.sid - _config.async_sid_base); _async_fifo.push_with_pop_on_full(metadata); standard_async_msg_prints(metadata); } @@ -119,7 +119,7 @@ public: /******************************************************************* * Peek and poke 32 bit implementation ******************************************************************/ - void poke32(const wb_addr_type addr, const boost::uint32_t data){ + void poke32(const wb_addr_type addr, const uint32_t data){ boost::mutex::scoped_lock lock(_mutex); this->send_pkt(addr, data, POKE32_CMD); @@ -127,7 +127,7 @@ public: this->wait_for_ack(_seq_out-MAX_SEQS_OUT); } - boost::uint32_t peek32(const wb_addr_type addr){ + uint32_t peek32(const wb_addr_type addr){ boost::mutex::scoped_lock lock(_mutex); this->send_pkt(addr, 0, PEEK32_CMD); @@ -138,11 +138,11 @@ public: /******************************************************************* * Peek and poke 16 bit not implemented ******************************************************************/ - void poke16(const wb_addr_type, const boost::uint16_t){ + void poke16(const wb_addr_type, const uint16_t){ throw uhd::not_implemented_error("poke16 not implemented in fifo ctrl module"); } - boost::uint16_t peek16(const wb_addr_type){ + uint16_t peek16(const wb_addr_type){ throw uhd::not_implemented_error("peek16 not implemented in fifo ctrl module"); } @@ -158,24 +158,24 @@ public: _ctrl_word_cache = 0; // force update first time around } - boost::uint32_t transact_spi( + uint32_t transact_spi( int which_slave, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits, bool readback ){ boost::mutex::scoped_lock lock(_mutex); //load control word - boost::uint32_t ctrl_word = 0; + uint32_t ctrl_word = 0; ctrl_word |= ((which_slave & 0xffffff) << 0); ctrl_word |= ((num_bits & 0x3ff) << 24); if (config.mosi_edge == spi_config_t::EDGE_FALL) ctrl_word |= (1 << 31); if (config.miso_edge == spi_config_t::EDGE_RISE) ctrl_word |= (1 << 30); //load data word (must be in upper bits) - const boost::uint32_t data_out = data << (32 - num_bits); + const uint32_t data_out = data << (32 - num_bits); //conditionally send control word if (_ctrl_word_cache != ctrl_word){ @@ -223,18 +223,18 @@ private: /******************************************************************* * Primary control and interaction private methods ******************************************************************/ - UHD_INLINE void send_pkt(wb_addr_type addr, boost::uint32_t data, int cmd){ + UHD_INLINE void send_pkt(wb_addr_type addr, uint32_t data, int cmd){ managed_send_buffer::sptr buff = _xport->get_send_buff(); if (not buff){ throw uhd::runtime_error("fifo ctrl timed out getting a send buffer"); } - boost::uint32_t *pkt = buff->cast<boost::uint32_t *>(); + uint32_t *pkt = buff->cast<uint32_t *>(); //load packet info vrt::if_packet_info_t packet_info; packet_info.packet_type = vrt::if_packet_info_t::PACKET_TYPE_CONTEXT; packet_info.num_payload_words32 = 2; - packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(boost::uint32_t); + packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(uint32_t); packet_info.packet_count = ++_seq_out; packet_info.tsf = _time.to_ticks(_tick_rate); packet_info.sob = false; @@ -249,21 +249,21 @@ private: vrt::if_hdr_pack_le(pkt, packet_info); //load payload - const boost::uint32_t ctrl_word = (addr/4 & 0xff) | cmd | (_seq_out << 16); + const uint32_t ctrl_word = (addr/4 & 0xff) | cmd | (_seq_out << 16); pkt[packet_info.num_header_words32+0] = uhd::htowx(ctrl_word); pkt[packet_info.num_header_words32+1] = uhd::htowx(data); //send the buffer over the interface - buff->commit(sizeof(boost::uint32_t)*(packet_info.num_packet_words32)); + buff->commit(sizeof(uint32_t)*(packet_info.num_packet_words32)); } - UHD_INLINE bool wraparound_lt16(const boost::int16_t i0, const boost::int16_t i1){ + UHD_INLINE bool wraparound_lt16(const int16_t i0, const int16_t i1){ if (((i0 ^ i1) & 0x8000) == 0) //same sign bits - return boost::uint16_t(i0) < boost::uint16_t(i1); - return boost::int16_t(i1 - i0) > 0; + return uint16_t(i0) < uint16_t(i1); + return int16_t(i1 - i0) > 0; } - UHD_INLINE boost::uint32_t wait_for_ack(const boost::uint16_t seq_to_ack){ + UHD_INLINE uint32_t wait_for_ack(const uint16_t seq_to_ack){ while (wraparound_lt16(_seq_ack, seq_to_ack)){ ctrl_result_t res = ctrl_result_t(); @@ -280,13 +280,13 @@ private: zero_copy_if::sptr _xport; const fifo_ctrl_excelsior_config _config; boost::mutex _mutex; - boost::uint16_t _seq_out; - boost::uint16_t _seq_ack; + uint16_t _seq_out; + uint16_t _seq_ack; uhd::time_spec_t _time; bool _use_time; double _tick_rate; double _timeout; - boost::uint32_t _ctrl_word_cache; + uint32_t _ctrl_word_cache; bounded_buffer<async_metadata_t> _async_fifo; bounded_buffer<ctrl_result_t> _ctrl_fifo; task::sptr _msg_task; diff --git a/host/lib/usrp/common/fx2_ctrl.cpp b/host/lib/usrp/common/fx2_ctrl.cpp index 7ae97e4d0..c69223747 100644 --- a/host/lib/usrp/common/fx2_ctrl.cpp +++ b/host/lib/usrp/common/fx2_ctrl.cpp @@ -21,7 +21,7 @@ #include <uhd/transport/usb_control.hpp> #include <boost/functional/hash.hpp> #include <boost/thread/thread.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <fstream> #include <sstream> #include <string> @@ -35,7 +35,7 @@ using namespace uhd::usrp; static const bool load_img_msg = true; -typedef boost::uint32_t hash_type; +typedef uint32_t hash_type; /*********************************************************************** * Helper Functions @@ -259,7 +259,7 @@ public: file.read((char *)buf, sizeof(buf)); const std::streamsize n = file.gcount(); if(n == 0) continue; - int ret = usrp_control_write(VRQ_FPGA_LOAD, 0, FL_XFER, buf, boost::uint16_t(n)); + int ret = usrp_control_write(VRQ_FPGA_LOAD, 0, FL_XFER, buf, uint16_t(n)); if (ret < 0 or std::streamsize(ret) != n) { throw uhd::io_error("usrp_load_fpga: fpga load error"); } @@ -281,7 +281,7 @@ public: { if (load_img_msg) UHD_MSG(status) << "Loading EEPROM image: " << filestring << "..." << std::flush; const char *filename = filestring.c_str(); - const boost::uint16_t i2c_addr = 0x50; + const uint16_t i2c_addr = 0x50; unsigned int addr; unsigned char data[256]; @@ -381,11 +381,11 @@ public: UHD_ASSERT_THROW(usrp_control_write_cmd(VRQ_FPGA_SET_RESET, on, 0) >= 0); } - int usrp_control_write(boost::uint8_t request, - boost::uint16_t value, - boost::uint16_t index, + int usrp_control_write(uint8_t request, + uint16_t value, + uint16_t index, unsigned char *buff, - boost::uint16_t length) + uint16_t length) { return _ctrl_transport->submit(VRT_VENDOR_OUT, // bmReqeustType request, // bRequest @@ -396,11 +396,11 @@ public: } - int usrp_control_read(boost::uint8_t request, - boost::uint16_t value, - boost::uint16_t index, + int usrp_control_read(uint8_t request, + uint16_t value, + uint16_t index, unsigned char *buff, - boost::uint16_t length) + uint16_t length) { return _ctrl_transport->submit(VRT_VENDOR_IN, // bmReqeustType request, // bRequest @@ -411,26 +411,26 @@ public: } - int usrp_control_write_cmd(boost::uint8_t request, boost::uint16_t value, boost::uint16_t index) + int usrp_control_write_cmd(uint8_t request, uint16_t value, uint16_t index) { return usrp_control_write(request, value, index, 0, 0); } byte_vector_t read_eeprom( - boost::uint16_t addr, - boost::uint16_t offset, + uint16_t addr, + uint16_t offset, size_t num_bytes ){ - this->write_i2c(addr, byte_vector_t(1, boost::uint8_t(offset))); + this->write_i2c(addr, byte_vector_t(1, uint8_t(offset))); return this->read_i2c(addr, num_bytes); } - int usrp_i2c_write(boost::uint16_t i2c_addr, unsigned char *buf, boost::uint16_t len) + int usrp_i2c_write(uint16_t i2c_addr, unsigned char *buf, uint16_t len) { return usrp_control_write(VRQ_I2C_WRITE, i2c_addr, 0, buf, len); } - int usrp_i2c_read(boost::uint16_t i2c_addr, unsigned char *buf, boost::uint16_t len) + int usrp_i2c_read(uint16_t i2c_addr, unsigned char *buf, uint16_t len) { return usrp_control_read(VRQ_I2C_READ, i2c_addr, 0, buf, len); } @@ -438,7 +438,7 @@ public: static const bool iface_debug = false; static const size_t max_i2c_data_bytes = 64; - void write_i2c(boost::uint16_t addr, const byte_vector_t &bytes) + void write_i2c(uint16_t addr, const byte_vector_t &bytes) { UHD_ASSERT_THROW(bytes.size() < max_i2c_data_bytes); @@ -448,7 +448,7 @@ public: uhd::runtime_error("USRP: failed i2c write"); } - byte_vector_t read_i2c(boost::uint16_t addr, size_t num_bytes) + byte_vector_t read_i2c(uint16_t addr, size_t num_bytes) { UHD_ASSERT_THROW(num_bytes < max_i2c_data_bytes); diff --git a/host/lib/usrp/common/fx2_ctrl.hpp b/host/lib/usrp/common/fx2_ctrl.hpp index 9f8cec296..40f91b9b6 100644 --- a/host/lib/usrp/common/fx2_ctrl.hpp +++ b/host/lib/usrp/common/fx2_ctrl.hpp @@ -87,11 +87,11 @@ public: * \param buff buffer to place data * \return number of bytes read or error */ - virtual int usrp_control_read(boost::uint8_t request, - boost::uint16_t value, - boost::uint16_t index, + virtual int usrp_control_read(uint8_t request, + uint16_t value, + uint16_t index, unsigned char *buff, - boost::uint16_t length) = 0; + uint16_t length) = 0; /*! * Submit an OUT transfer @@ -101,11 +101,11 @@ public: * \param buff buffer of data to be sent * \return number of bytes written or error */ - virtual int usrp_control_write(boost::uint8_t request, - boost::uint16_t value, - boost::uint16_t index, + virtual int usrp_control_write(uint8_t request, + uint16_t value, + uint16_t index, unsigned char *buff, - boost::uint16_t length) = 0; + uint16_t length) = 0; /*! * Perform an I2C write @@ -115,9 +115,9 @@ public: * \return number of bytes written or error */ - virtual int usrp_i2c_write(boost::uint16_t i2c_addr, + virtual int usrp_i2c_write(uint16_t i2c_addr, unsigned char *buf, - boost::uint16_t len) = 0; + uint16_t len) = 0; /*! * Perform an I2C read @@ -127,9 +127,9 @@ public: * \return number of bytes read or error */ - virtual int usrp_i2c_read(boost::uint16_t i2c_addr, + virtual int usrp_i2c_read(uint16_t i2c_addr, unsigned char *buf, - boost::uint16_t len) = 0; + uint16_t len) = 0; //! enable/disable the rx path virtual void usrp_rx_enable(bool on) = 0; diff --git a/host/lib/usrp/common/max287x.hpp b/host/lib/usrp/common/max287x.hpp index 540f5207f..9022e0f02 100644 --- a/host/lib/usrp/common/max287x.hpp +++ b/host/lib/usrp/common/max287x.hpp @@ -40,7 +40,7 @@ class max287x_iface public: typedef boost::shared_ptr<max287x_iface> sptr; - typedef boost::function<void(std::vector<boost::uint32_t>)> write_fn; + typedef boost::function<void(std::vector<uint32_t>)> write_fn; /** * LD Pin Modes @@ -207,7 +207,7 @@ public: * Set phase * @param phase the phase offset */ - virtual void set_phase(boost::uint16_t phase) = 0; + virtual void set_phase(uint16_t phase) = 0; /** * Write values configured by the set_* functions. @@ -251,7 +251,7 @@ public: virtual void set_clock_divider_mode(clock_divider_mode_t mode); virtual void set_cycle_slip_mode(bool enabled); virtual void set_low_noise_and_spur(low_noise_and_spur_t mode); - virtual void set_phase(boost::uint16_t phase); + virtual void set_phase(uint16_t phase); virtual void commit(); virtual bool can_sync(); virtual void config_for_sync(bool enable); @@ -877,7 +877,7 @@ void max287x<max287x_regs_t>::set_low_noise_and_spur(low_noise_and_spur_t mode) } template <typename max287x_regs_t> -void max287x<max287x_regs_t>::set_phase(boost::uint16_t phase) +void max287x<max287x_regs_t>::set_phase(uint16_t phase) { _regs.phase_12_bit = phase & 0xFFF; } @@ -885,26 +885,26 @@ void max287x<max287x_regs_t>::set_phase(boost::uint16_t phase) template <typename max287x_regs_t> void max287x<max287x_regs_t>::commit() { - std::vector<boost::uint32_t> regs; - std::set<boost::uint32_t> changed_regs; + std::vector<uint32_t> regs; + std::set<uint32_t> changed_regs; // Get only regs with changes if (_write_all_regs) { for (int addr = 5; addr >= 0; addr--) - regs.push_back(_regs.get_reg(boost::uint32_t(addr))); + regs.push_back(_regs.get_reg(uint32_t(addr))); } else { try { - changed_regs = _regs.template get_changed_addrs<boost::uint32_t> (); + changed_regs = _regs.template get_changed_addrs<uint32_t> (); for (int addr = 5; addr >= 0; addr--) { - if (changed_regs.find(boost::uint32_t(addr)) != changed_regs.end()) - regs.push_back(_regs.get_reg(boost::uint32_t(addr))); + if (changed_regs.find(uint32_t(addr)) != changed_regs.end()) + regs.push_back(_regs.get_reg(uint32_t(addr))); } } catch (uhd::runtime_error&) { // No saved state - write all regs for (int addr = 5; addr >= 0; addr--) - regs.push_back(_regs.get_reg(boost::uint32_t(addr))); + regs.push_back(_regs.get_reg(uint32_t(addr))); } } diff --git a/host/lib/usrp/common/recv_packet_demuxer.cpp b/host/lib/usrp/common/recv_packet_demuxer.cpp index db0f71280..8d9dcee9e 100644 --- a/host/lib/usrp/common/recv_packet_demuxer.cpp +++ b/host/lib/usrp/common/recv_packet_demuxer.cpp @@ -39,12 +39,12 @@ public: delete this; } - boost::uint32_t buff[10]; + uint32_t buff[10]; }; -static UHD_INLINE boost::uint32_t extract_sid(managed_recv_buffer::sptr &buff){ +static UHD_INLINE uint32_t extract_sid(managed_recv_buffer::sptr &buff){ //ASSUME that the data is in little endian format - return uhd::wtohx(buff->cast<const boost::uint32_t *>()[1]); + return uhd::wtohx(buff->cast<const uint32_t *>()[1]); } recv_packet_demuxer::~recv_packet_demuxer(void){ @@ -56,7 +56,7 @@ public: recv_packet_demuxer_impl( transport::zero_copy_if::sptr transport, const size_t size, - const boost::uint32_t sid_base + const uint32_t sid_base ): _transport(transport), _sid_base(sid_base), _queues(size) { @@ -92,19 +92,19 @@ public: vrt::if_packet_info_t info; info.packet_type = vrt::if_packet_info_t::PACKET_TYPE_DATA; info.num_payload_words32 = 1; - info.num_payload_bytes = info.num_payload_words32*sizeof(boost::uint32_t); + info.num_payload_bytes = info.num_payload_words32*sizeof(uint32_t); info.has_sid = true; info.sid = _sid_base + index; vrt::if_hdr_pack_le(mrb->buff, info); mrb->buff[info.num_header_words32] = rx_metadata_t::ERROR_CODE_OVERFLOW; - return mrb->make(mrb, mrb->buff, info.num_packet_words32*sizeof(boost::uint32_t)); + return mrb->make(mrb, mrb->buff, info.num_packet_words32*sizeof(uint32_t)); } } } private: transport::zero_copy_if::sptr _transport; - const boost::uint32_t _sid_base; + const uint32_t _sid_base; boost::mutex _mutex; struct channel_guts_type{ channel_guts_type(void): wrapper(container){} @@ -114,6 +114,6 @@ private: std::vector<channel_guts_type> _queues; }; -recv_packet_demuxer::sptr recv_packet_demuxer::make(transport::zero_copy_if::sptr transport, const size_t size, const boost::uint32_t sid_base){ +recv_packet_demuxer::sptr recv_packet_demuxer::make(transport::zero_copy_if::sptr transport, const size_t size, const uint32_t sid_base){ return sptr(new recv_packet_demuxer_impl(transport, size, sid_base)); } diff --git a/host/lib/usrp/common/recv_packet_demuxer.hpp b/host/lib/usrp/common/recv_packet_demuxer.hpp index a03f25f47..fc9b005a5 100644 --- a/host/lib/usrp/common/recv_packet_demuxer.hpp +++ b/host/lib/usrp/common/recv_packet_demuxer.hpp @@ -21,7 +21,7 @@ #include <uhd/config.hpp> #include <uhd/transport/zero_copy.hpp> #include <boost/shared_ptr.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> namespace uhd{ namespace usrp{ @@ -32,7 +32,7 @@ namespace uhd{ namespace usrp{ virtual ~recv_packet_demuxer(void) = 0; //! Make a new demuxer from a transport and parameters - static sptr make(transport::zero_copy_if::sptr transport, const size_t size, const boost::uint32_t sid_base); + static sptr make(transport::zero_copy_if::sptr transport, const size_t size, const uint32_t sid_base); //! Get a buffer at the given index from the transport virtual transport::managed_recv_buffer::sptr get_recv_buff(const size_t index, const double timeout) = 0; diff --git a/host/lib/usrp/common/recv_packet_demuxer_3000.hpp b/host/lib/usrp/common/recv_packet_demuxer_3000.hpp index ec930f3ad..3ad76f1a0 100644 --- a/host/lib/usrp/common/recv_packet_demuxer_3000.hpp +++ b/host/lib/usrp/common/recv_packet_demuxer_3000.hpp @@ -20,7 +20,7 @@ #include <uhd/config.hpp> #include <uhd/transport/zero_copy.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/thread.hpp> #include <uhd/utils/msg.hpp> #include <uhd/utils/atomic.hpp> @@ -44,7 +44,7 @@ namespace uhd{ namespace usrp{ _xport(xport) {/*NOP*/} - transport::managed_recv_buffer::sptr get_recv_buff(const boost::uint32_t sid, const double timeout) + transport::managed_recv_buffer::sptr get_recv_buff(const uint32_t sid, const double timeout) { const time_spec_t exit_time = time_spec_t(timeout) + time_spec_t::get_system_time(); transport::managed_recv_buffer::sptr buff; @@ -59,7 +59,7 @@ namespace uhd{ namespace usrp{ return buff; } - transport::managed_recv_buffer::sptr _internal_get_recv_buff(const boost::uint32_t sid, const double timeout) + transport::managed_recv_buffer::sptr _internal_get_recv_buff(const uint32_t sid, const double timeout) { transport::managed_recv_buffer::sptr buff; @@ -99,7 +99,7 @@ namespace uhd{ namespace usrp{ buff = _xport->get_recv_buff(timeout); if (buff) { - const boost::uint32_t new_sid = uhd::wtohx(buff->cast<const boost::uint32_t *>()[1]); + const uint32_t new_sid = uhd::wtohx(buff->cast<const uint32_t *>()[1]); if (new_sid != sid) { boost::mutex::scoped_lock l(mutex); @@ -118,7 +118,7 @@ namespace uhd{ namespace usrp{ return buff; } - void realloc_sid(const boost::uint32_t sid) + void realloc_sid(const uint32_t sid) { boost::mutex::scoped_lock l(mutex); while(not _queues[sid].empty()) //allocated and clears if already allocated @@ -127,10 +127,10 @@ namespace uhd{ namespace usrp{ } } - transport::zero_copy_if::sptr make_proxy(const boost::uint32_t sid); + transport::zero_copy_if::sptr make_proxy(const uint32_t sid); typedef std::queue<transport::managed_recv_buffer::sptr> queue_type_t; - std::map<boost::uint32_t, queue_type_t> _queues; + std::map<uint32_t, queue_type_t> _queues; transport::zero_copy_if::sptr _xport; #ifdef RECV_PACKET_DEMUXER_3000_THREAD_SAFE uhd::atomic_uint32_t _claimed; @@ -141,7 +141,7 @@ namespace uhd{ namespace usrp{ struct recv_packet_demuxer_proxy_3000 : transport::zero_copy_if { - recv_packet_demuxer_proxy_3000(recv_packet_demuxer_3000::sptr demux, transport::zero_copy_if::sptr xport, const boost::uint32_t sid): + recv_packet_demuxer_proxy_3000(recv_packet_demuxer_3000::sptr demux, transport::zero_copy_if::sptr xport, const uint32_t sid): _demux(demux), _xport(xport), _sid(sid) { _demux->realloc_sid(_sid); //causes clear @@ -167,10 +167,10 @@ namespace uhd{ namespace usrp{ recv_packet_demuxer_3000::sptr _demux; transport::zero_copy_if::sptr _xport; - const boost::uint32_t _sid; + const uint32_t _sid; }; - inline transport::zero_copy_if::sptr recv_packet_demuxer_3000::make_proxy(const boost::uint32_t sid) + inline transport::zero_copy_if::sptr recv_packet_demuxer_3000::make_proxy(const uint32_t sid) { return transport::zero_copy_if::sptr(new recv_packet_demuxer_proxy_3000(this->shared_from_this(), _xport, sid)); } diff --git a/host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp b/host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp index ef541e37f..16ee84140 100644 --- a/host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp +++ b/host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp @@ -32,7 +32,7 @@ namespace uhd { namespace usrp { namespace usrp3 { //---------------------------------------------------------- uhd::wb_iface::sptr usrp3_fw_ctrl_iface::make( uhd::transport::udp_simple::sptr udp_xport, - const boost::uint16_t product_id, + const uint16_t product_id, const bool verbose) { return wb_iface::sptr(new usrp3_fw_ctrl_iface(udp_xport, product_id, verbose)); @@ -44,7 +44,7 @@ uhd::wb_iface::sptr usrp3_fw_ctrl_iface::make( usrp3_fw_ctrl_iface::usrp3_fw_ctrl_iface( uhd::transport::udp_simple::sptr udp_xport, - const boost::uint16_t product_id, + const uint16_t product_id, const bool verbose) : _product_id(product_id), _verbose(verbose), _udp_xport(udp_xport), _seq_num(0) @@ -64,7 +64,7 @@ void usrp3_fw_ctrl_iface::flush() _flush(); } -void usrp3_fw_ctrl_iface::poke32(const wb_addr_type addr, const boost::uint32_t data) +void usrp3_fw_ctrl_iface::poke32(const wb_addr_type addr, const uint32_t data) { boost::mutex::scoped_lock lock(_mutex); @@ -81,7 +81,7 @@ void usrp3_fw_ctrl_iface::poke32(const wb_addr_type addr, const boost::uint32_t } } -boost::uint32_t usrp3_fw_ctrl_iface::peek32(const wb_addr_type addr) +uint32_t usrp3_fw_ctrl_iface::peek32(const wb_addr_type addr) { boost::mutex::scoped_lock lock(_mutex); @@ -98,13 +98,13 @@ boost::uint32_t usrp3_fw_ctrl_iface::peek32(const wb_addr_type addr) return 0; } -void usrp3_fw_ctrl_iface::_poke32(const wb_addr_type addr, const boost::uint32_t data) +void usrp3_fw_ctrl_iface::_poke32(const wb_addr_type addr, const uint32_t data) { //Load request struct fw_comm_pkt_t request; - request.id = uhd::htonx<boost::uint32_t>(FW_COMM_GENERATE_ID(_product_id)); - request.flags = uhd::htonx<boost::uint32_t>(FW_COMM_FLAGS_ACK | FW_COMM_CMD_POKE32); - request.sequence = uhd::htonx<boost::uint32_t>(_seq_num++); + request.id = uhd::htonx<uint32_t>(FW_COMM_GENERATE_ID(_product_id)); + request.flags = uhd::htonx<uint32_t>(FW_COMM_FLAGS_ACK | FW_COMM_CMD_POKE32); + request.sequence = uhd::htonx<uint32_t>(_seq_num++); request.addr = uhd::htonx(addr); request.data_words = 1; request.data[0] = uhd::htonx(data); @@ -119,7 +119,7 @@ void usrp3_fw_ctrl_iface::_poke32(const wb_addr_type addr, const boost::uint32_t if (nbytes == 0) throw uhd::io_error("udp fw poke32 - reply timed out"); //Sanity checks - const size_t flags = uhd::ntohx<boost::uint32_t>(reply.flags); + const size_t flags = uhd::ntohx<uint32_t>(reply.flags); UHD_ASSERT_THROW(nbytes == sizeof(reply)); UHD_ASSERT_THROW(not (flags & FW_COMM_FLAGS_ERROR_MASK)); UHD_ASSERT_THROW(flags & FW_COMM_CMD_POKE32); @@ -129,13 +129,13 @@ void usrp3_fw_ctrl_iface::_poke32(const wb_addr_type addr, const boost::uint32_t UHD_ASSERT_THROW(reply.data[0] == request.data[0]); } -boost::uint32_t usrp3_fw_ctrl_iface::_peek32(const wb_addr_type addr) +uint32_t usrp3_fw_ctrl_iface::_peek32(const wb_addr_type addr) { //Load request struct fw_comm_pkt_t request; - request.id = uhd::htonx<boost::uint32_t>(FW_COMM_GENERATE_ID(_product_id)); - request.flags = uhd::htonx<boost::uint32_t>(FW_COMM_FLAGS_ACK | FW_COMM_CMD_PEEK32); - request.sequence = uhd::htonx<boost::uint32_t>(_seq_num++); + request.id = uhd::htonx<uint32_t>(FW_COMM_GENERATE_ID(_product_id)); + request.flags = uhd::htonx<uint32_t>(FW_COMM_FLAGS_ACK | FW_COMM_CMD_PEEK32); + request.sequence = uhd::htonx<uint32_t>(_seq_num++); request.addr = uhd::htonx(addr); request.data_words = 1; request.data[0] = 0; @@ -150,7 +150,7 @@ boost::uint32_t usrp3_fw_ctrl_iface::_peek32(const wb_addr_type addr) if (nbytes == 0) throw uhd::io_error("udp fw peek32 - reply timed out"); //Sanity checks - const size_t flags = uhd::ntohx<boost::uint32_t>(reply.flags); + const size_t flags = uhd::ntohx<uint32_t>(reply.flags); UHD_ASSERT_THROW(nbytes == sizeof(reply)); UHD_ASSERT_THROW(not (flags & FW_COMM_FLAGS_ERROR_MASK)); UHD_ASSERT_THROW(flags & FW_COMM_CMD_PEEK32); @@ -159,7 +159,7 @@ boost::uint32_t usrp3_fw_ctrl_iface::_peek32(const wb_addr_type addr) UHD_ASSERT_THROW(reply.addr == request.addr); //return result! - return uhd::ntohx<boost::uint32_t>(reply.data[0]); + return uhd::ntohx<uint32_t>(reply.data[0]); } void usrp3_fw_ctrl_iface::_flush(void) @@ -172,7 +172,7 @@ void usrp3_fw_ctrl_iface::_flush(void) std::vector<std::string> usrp3_fw_ctrl_iface::discover_devices( const std::string& addr_hint, const std::string& port, - boost::uint16_t product_id) + uint16_t product_id) { std::vector<std::string> addrs; @@ -190,9 +190,9 @@ std::vector<std::string> usrp3_fw_ctrl_iface::discover_devices( //Send dummy request fw_comm_pkt_t request; - request.id = uhd::htonx<boost::uint32_t>(FW_COMM_GENERATE_ID(product_id)); - request.flags = uhd::htonx<boost::uint32_t>(FW_COMM_FLAGS_ACK|FW_COMM_CMD_ECHO); - request.sequence = uhd::htonx<boost::uint32_t>(std::rand()); + request.id = uhd::htonx<uint32_t>(FW_COMM_GENERATE_ID(product_id)); + request.flags = uhd::htonx<uint32_t>(FW_COMM_FLAGS_ACK|FW_COMM_CMD_ECHO); + request.sequence = uhd::htonx<uint32_t>(std::rand()); udp_bcast_xport->send(boost::asio::buffer(&request, sizeof(request))); //loop for replies until timeout @@ -213,18 +213,18 @@ std::vector<std::string> usrp3_fw_ctrl_iface::discover_devices( return addrs; } -boost::uint32_t usrp3_fw_ctrl_iface::get_iface_id( +uint32_t usrp3_fw_ctrl_iface::get_iface_id( const std::string& addr, const std::string& port, - boost::uint16_t product_id) + uint16_t product_id) { uhd::transport::udp_simple::sptr udp_xport = uhd::transport::udp_simple::make_connected(addr, port); //Send dummy request fw_comm_pkt_t request; - request.id = uhd::htonx<boost::uint32_t>(FW_COMM_GENERATE_ID(product_id)); - request.flags = uhd::htonx<boost::uint32_t>(FW_COMM_FLAGS_ACK|FW_COMM_CMD_ECHO); - request.sequence = uhd::htonx<boost::uint32_t>(std::rand()); + request.id = uhd::htonx<uint32_t>(FW_COMM_GENERATE_ID(product_id)); + request.flags = uhd::htonx<uint32_t>(FW_COMM_FLAGS_ACK|FW_COMM_CMD_ECHO); + request.sequence = uhd::htonx<uint32_t>(std::rand()); udp_xport->send(boost::asio::buffer(&request, sizeof(request))); //loop for replies until timeout @@ -237,7 +237,7 @@ boost::uint32_t usrp3_fw_ctrl_iface::get_iface_id( request.flags == reply->flags && request.sequence == reply->sequence) { - return uhd::ntohx<boost::uint32_t>(reply->data[0]); + return uhd::ntohx<uint32_t>(reply->data[0]); } else { throw uhd::io_error("udp get_iface_id - bad response"); } diff --git a/host/lib/usrp/common/usrp3_fw_ctrl_iface.hpp b/host/lib/usrp/common/usrp3_fw_ctrl_iface.hpp index 33286861b..9dc35ef9e 100644 --- a/host/lib/usrp/common/usrp3_fw_ctrl_iface.hpp +++ b/host/lib/usrp/common/usrp3_fw_ctrl_iface.hpp @@ -30,38 +30,38 @@ class usrp3_fw_ctrl_iface : public uhd::wb_iface public: usrp3_fw_ctrl_iface( uhd::transport::udp_simple::sptr udp_xport, - const boost::uint16_t product_id, + const uint16_t product_id, const bool verbose); virtual ~usrp3_fw_ctrl_iface(); // -- uhd::wb_iface -- - void poke32(const wb_addr_type addr, const boost::uint32_t data); - boost::uint32_t peek32(const wb_addr_type addr); + void poke32(const wb_addr_type addr, const uint32_t data); + uint32_t peek32(const wb_addr_type addr); void flush(); static uhd::wb_iface::sptr make( uhd::transport::udp_simple::sptr udp_xport, - const boost::uint16_t product_id, + const uint16_t product_id, const bool verbose = true); // -- uhd::wb_iface -- static std::vector<std::string> discover_devices( const std::string& addr_hint, const std::string& port, - boost::uint16_t product_id); + uint16_t product_id); - static boost::uint32_t get_iface_id( + static uint32_t get_iface_id( const std::string& addr, const std::string& port, - boost::uint16_t product_id); + uint16_t product_id); private: - void _poke32(const wb_addr_type addr, const boost::uint32_t data); - boost::uint32_t _peek32(const wb_addr_type addr); + void _poke32(const wb_addr_type addr, const uint32_t data); + uint32_t _peek32(const wb_addr_type addr); void _flush(void); - const boost::uint16_t _product_id; + const uint16_t _product_id; const bool _verbose; uhd::transport::udp_simple::sptr _udp_xport; - boost::uint32_t _seq_num; + uint32_t _seq_num; boost::mutex _mutex; static const size_t NUM_RETRIES = 3; diff --git a/host/lib/usrp/cores/dma_fifo_core_3000.cpp b/host/lib/usrp/cores/dma_fifo_core_3000.cpp index 5df28f7c2..908ba906e 100644 --- a/host/lib/usrp/cores/dma_fifo_core_3000.cpp +++ b/host/lib/usrp/cores/dma_fifo_core_3000.cpp @@ -36,12 +36,12 @@ protected: public: UHD_DEFINE_SOFT_REG_FIELD(ADDR, /*width*/ 3, /*shift*/ 0); //[2:0] - static const boost::uint32_t RB_FIFO_STATUS = 0; - static const boost::uint32_t RB_BIST_STATUS = 1; - static const boost::uint32_t RB_BIST_XFER_CNT = 2; - static const boost::uint32_t RB_BIST_CYC_CNT = 3; + static const uint32_t RB_FIFO_STATUS = 0; + static const uint32_t RB_BIST_STATUS = 1; + static const uint32_t RB_BIST_XFER_CNT = 2; + static const uint32_t RB_BIST_CYC_CNT = 3; - rb_addr_reg_t(boost::uint32_t base): + rb_addr_reg_t(uint32_t base): soft_reg32_wo_t(base + 0) { //Initial values @@ -56,7 +56,7 @@ protected: UHD_DEFINE_SOFT_REG_FIELD(BURST_TIMEOUT, /*width*/ 12, /*shift*/ 4); //[15:4] UHD_DEFINE_SOFT_REG_FIELD(RD_SUPPRESS_THRESH, /*width*/ 16, /*shift*/ 16); //[31:16] - fifo_ctrl_reg_t(boost::uint32_t base): + fifo_ctrl_reg_t(uint32_t base): soft_reg32_wo_t(base + 4) { //Initial values @@ -71,7 +71,7 @@ protected: public: UHD_DEFINE_SOFT_REG_FIELD(BASE_ADDR, /*width*/ 30, /*shift*/ 0); //[29:0] - base_addr_reg_t(boost::uint32_t base): + base_addr_reg_t(uint32_t base): soft_reg32_wo_t(base + 8) { //Initial values @@ -83,7 +83,7 @@ protected: public: UHD_DEFINE_SOFT_REG_FIELD(ADDR_MASK, /*width*/ 30, /*shift*/ 0); //[29:0] - addr_mask_reg_t(boost::uint32_t base): + addr_mask_reg_t(uint32_t base): soft_reg32_wo_t(base + 12) { //Initial values @@ -97,12 +97,12 @@ protected: UHD_DEFINE_SOFT_REG_FIELD(CONTINUOUS_MODE, /*width*/ 1, /*shift*/ 1); //[1] UHD_DEFINE_SOFT_REG_FIELD(TEST_PATT, /*width*/ 2, /*shift*/ 4); //[5:4] - static const boost::uint32_t TEST_PATT_ZERO_ONE = 0; - static const boost::uint32_t TEST_PATT_CHECKERBOARD = 1; - static const boost::uint32_t TEST_PATT_COUNT = 2; - static const boost::uint32_t TEST_PATT_COUNT_INV = 3; + static const uint32_t TEST_PATT_ZERO_ONE = 0; + static const uint32_t TEST_PATT_CHECKERBOARD = 1; + static const uint32_t TEST_PATT_COUNT = 2; + static const uint32_t TEST_PATT_COUNT_INV = 3; - bist_ctrl_reg_t(boost::uint32_t base): + bist_ctrl_reg_t(uint32_t base): soft_reg32_wo_t(base + 16) { //Initial values @@ -118,7 +118,7 @@ protected: UHD_DEFINE_SOFT_REG_FIELD(MAX_PKT_SIZE, /*width*/ 13, /*shift*/ 18); //[30:18] UHD_DEFINE_SOFT_REG_FIELD(PKT_SIZE_RAMP, /*width*/ 1, /*shift*/ 31); //[31] - bist_cfg_reg_t(boost::uint32_t base): + bist_cfg_reg_t(uint32_t base): soft_reg32_wo_t(base + 20) { //Initial values @@ -133,7 +133,7 @@ protected: UHD_DEFINE_SOFT_REG_FIELD(TX_PKT_DELAY, /*width*/ 16, /*shift*/ 0); //[15:0] UHD_DEFINE_SOFT_REG_FIELD(RX_SAMP_DELAY, /*width*/ 8, /*shift*/ 16); //[23:16] - bist_delay_reg_t(boost::uint32_t base): + bist_delay_reg_t(uint32_t base): soft_reg32_wo_t(base + 24) { //Initial values @@ -146,7 +146,7 @@ protected: public: UHD_DEFINE_SOFT_REG_FIELD(SID, /*width*/ 32, /*shift*/ 0); //[31:0] - bist_sid_reg_t(boost::uint32_t base): + bist_sid_reg_t(uint32_t base): soft_reg32_wo_t(base + 28) { //Initial values @@ -169,13 +169,13 @@ public: return _iface->peek32(_rb_addr) & 0x80000000; } - boost::uint32_t get_occupied_cnt() { + uint32_t get_occupied_cnt() { boost::lock_guard<boost::mutex> lock(_mutex); _addr_reg.write(rb_addr_reg_t::ADDR, rb_addr_reg_t::RB_FIFO_STATUS); return _iface->peek32(_rb_addr) & 0x7FFFFFF; } - boost::uint32_t is_fifo_busy() { + uint32_t is_fifo_busy() { boost::lock_guard<boost::mutex> lock(_mutex); _addr_reg.write(rb_addr_reg_t::ADDR, rb_addr_reg_t::RB_FIFO_STATUS); return _iface->peek32(_rb_addr) & 0x40000000; @@ -184,17 +184,17 @@ public: struct bist_status_t { bool running; bool finished; - boost::uint8_t error; + uint8_t error; }; bist_status_t get_bist_status() { boost::lock_guard<boost::mutex> lock(_mutex); _addr_reg.write(rb_addr_reg_t::ADDR, rb_addr_reg_t::RB_BIST_STATUS); - boost::uint32_t st32 = _iface->peek32(_rb_addr) & 0xF; + uint32_t st32 = _iface->peek32(_rb_addr) & 0xF; bist_status_t status; status.running = st32 & 0x1; status.finished = st32 & 0x2; - status.error = static_cast<boost::uint8_t>((st32>>2) & 0x3); + status.error = static_cast<uint8_t>((st32>>2) & 0x3); return status; } @@ -206,7 +206,7 @@ public: double get_xfer_ratio() { boost::lock_guard<boost::mutex> lock(_mutex); - boost::uint32_t xfer_cnt = 0, cyc_cnt = 0; + uint32_t xfer_cnt = 0, cyc_cnt = 0; _addr_reg.write(rb_addr_reg_t::ADDR, rb_addr_reg_t::RB_BIST_XFER_CNT); xfer_cnt = _iface->peek32(_rb_addr); _addr_reg.write(rb_addr_reg_t::ADDR, rb_addr_reg_t::RB_BIST_CYC_CNT); @@ -252,10 +252,10 @@ public: _fifo_ctrl_reg.write(fifo_ctrl_reg_t::CLEAR_FIFO, 0); } - virtual void resize(const boost::uint32_t base_addr, const boost::uint32_t size) { + virtual void resize(const uint32_t base_addr, const uint32_t size) { //Validate parameters if (size < 8192) throw uhd::runtime_error("DMA FIFO must be larger than 8KiB"); - boost::uint32_t size_mask = size - 1; + uint32_t size_mask = size - 1; if (size & size_mask) throw uhd::runtime_error("DMA FIFO size must be a power of 2"); //Clear the FIFO and hold it in that state @@ -268,7 +268,7 @@ public: flush(); } - virtual boost::uint32_t get_bytes_occupied() { + virtual uint32_t get_bytes_occupied() { return _fifo_readback.get_occupied_cnt() * 8; } @@ -276,16 +276,16 @@ public: return _fifo_readback.is_ext_bist_supported(); } - virtual boost::uint8_t run_bist(bool finite = true, boost::uint32_t timeout_ms = 500) { + virtual uint8_t run_bist(bool finite = true, uint32_t timeout_ms = 500) { return run_ext_bist(finite, 0, 0, 0, timeout_ms); } - virtual boost::uint8_t run_ext_bist( + virtual uint8_t run_ext_bist( bool finite, - boost::uint32_t rx_samp_delay, - boost::uint32_t tx_pkt_delay, - boost::uint32_t sid, - boost::uint32_t timeout_ms = 500 + uint32_t rx_samp_delay, + uint32_t tx_pkt_delay, + uint32_t sid, + uint32_t timeout_ms = 500 ) { boost::lock_guard<boost::mutex> lock(_mutex); @@ -350,7 +350,7 @@ private: } } - void _wait_for_bist_done(boost::uint32_t timeout_ms, bool force_stop = false) + void _wait_for_bist_done(uint32_t timeout_ms, bool force_stop = false) { boost::posix_time::ptime start_time = boost::posix_time::microsec_clock::local_time(); boost::posix_time::time_duration elapsed; diff --git a/host/lib/usrp/cores/dma_fifo_core_3000.hpp b/host/lib/usrp/cores/dma_fifo_core_3000.hpp index 41430e5c3..46a913c93 100644 --- a/host/lib/usrp/cores/dma_fifo_core_3000.hpp +++ b/host/lib/usrp/cores/dma_fifo_core_3000.hpp @@ -49,17 +49,17 @@ public: /*! * Resize and rebase the DMA FIFO. Will clear all contents. */ - virtual void resize(const boost::uint32_t base_addr, const boost::uint32_t size) = 0; + virtual void resize(const uint32_t base_addr, const uint32_t size) = 0; /*! * Get the (approx) number of bytes currently in the DMA FIFO */ - virtual boost::uint32_t get_bytes_occupied() = 0; + virtual uint32_t get_bytes_occupied() = 0; /*! * Run the built-in-self-test routine for the DMA FIFO */ - virtual boost::uint8_t run_bist(bool finite = true, boost::uint32_t timeout_ms = 500) = 0; + virtual uint8_t run_bist(bool finite = true, uint32_t timeout_ms = 500) = 0; /*! * Is extended BIST supported @@ -69,12 +69,12 @@ public: /*! * Run the built-in-self-test routine for the DMA FIFO (extended BIST only) */ - virtual boost::uint8_t run_ext_bist( + virtual uint8_t run_ext_bist( bool finite, - boost::uint32_t rx_samp_delay, - boost::uint32_t tx_pkt_delay, - boost::uint32_t sid, - boost::uint32_t timeout_ms = 500) = 0; + uint32_t rx_samp_delay, + uint32_t tx_pkt_delay, + uint32_t sid, + uint32_t timeout_ms = 500) = 0; /*! * Get the throughput measured from the last invocation of the BIST (extended BIST only) diff --git a/host/lib/usrp/cores/dsp_core_utils.cpp b/host/lib/usrp/cores/dsp_core_utils.cpp index aea809ae8..cf022f767 100644 --- a/host/lib/usrp/cores/dsp_core_utils.cpp +++ b/host/lib/usrp/cores/dsp_core_utils.cpp @@ -21,8 +21,8 @@ #include <boost/math/special_functions/round.hpp> #include <boost/math/special_functions/sign.hpp> -static const int32_t MAX_FREQ_WORD = boost::numeric::bounds<boost::int32_t>::highest(); -static const int32_t MIN_FREQ_WORD = boost::numeric::bounds<boost::int32_t>::lowest(); +static const int32_t MAX_FREQ_WORD = boost::numeric::bounds<int32_t>::highest(); +static const int32_t MIN_FREQ_WORD = boost::numeric::bounds<int32_t>::lowest(); void get_freq_and_freq_word( const double requested_freq, diff --git a/host/lib/usrp/cores/gpio_atr_3000.cpp b/host/lib/usrp/cores/gpio_atr_3000.cpp index 5844af601..6df592e1b 100644 --- a/host/lib/usrp/cores/gpio_atr_3000.cpp +++ b/host/lib/usrp/cores/gpio_atr_3000.cpp @@ -58,7 +58,7 @@ public: _atr_disable_reg.initialize(*_iface, true); } - virtual void set_atr_mode(const gpio_atr_mode_t mode, const boost::uint32_t mask) + virtual void set_atr_mode(const gpio_atr_mode_t mode, const uint32_t mask) { //Each bit in the "ATR Disable" register determines whether the respective bit in the GPIO //output bus is driven by the ATR engine or a static register. @@ -70,7 +70,7 @@ public: _atr_disable_reg.flush(); } - virtual void set_gpio_ddr(const gpio_ddr_t dir, const boost::uint32_t mask) + virtual void set_gpio_ddr(const gpio_ddr_t dir, const uint32_t mask) { //Each bit in the "DDR" register determines whether the respective bit in the GPIO //bus is an input or an output. @@ -82,7 +82,7 @@ public: _ddr_reg.flush(); } - virtual void set_atr_reg(const gpio_atr_reg_t atr, const boost::uint32_t value, const boost::uint32_t mask = MASK_SET_ALL) + virtual void set_atr_reg(const gpio_atr_reg_t atr, const uint32_t value, const uint32_t mask = MASK_SET_ALL) { //Set the value of the specified ATR register. For bits with ATR Disable set to 1, //the IDLE register will hold the output state @@ -102,7 +102,7 @@ public: reg->flush(); } - virtual void set_gpio_out(const boost::uint32_t value, const boost::uint32_t mask = MASK_SET_ALL) { + virtual void set_gpio_out(const uint32_t value, const uint32_t mask = MASK_SET_ALL) { //Set the value of the specified GPIO output register. //This setting will only get applied to all bits in the "mask" that are 1. All other //bits will retain their old value. @@ -113,7 +113,7 @@ public: _atr_idle_reg.flush(); } - virtual boost::uint32_t read_gpio() + virtual uint32_t read_gpio() { //Read the state of the GPIO pins //If a pin is configured as an input, reads the actual value of the pin @@ -125,7 +125,7 @@ public: } } - inline virtual void set_gpio_attr(const gpio_attr_t attr, const boost::uint32_t value) + inline virtual void set_gpio_attr(const gpio_attr_t attr, const uint32_t value) { //An attribute based API to configure all settings for the GPIO bus in one function //call. This API does not have a mask so it configures all bits at the same time. @@ -175,12 +175,12 @@ protected: uhd::soft_reg32_wo_t::set(REGISTER, 0); } - virtual void set_with_mask(const boost::uint32_t value, const boost::uint32_t mask) { + virtual void set_with_mask(const uint32_t value, const uint32_t mask) { uhd::soft_reg32_wo_t::set(REGISTER, (value&mask)|(uhd::soft_reg32_wo_t::get(REGISTER)&(~mask))); } - virtual boost::uint32_t get() { + virtual uint32_t get() { return uhd::soft_reg32_wo_t::get(uhd::soft_reg32_wo_t::REGISTER); } @@ -197,19 +197,19 @@ protected: _atr_disable_reg(atr_disable_reg) { } - virtual void set_with_mask(const boost::uint32_t value, const boost::uint32_t mask) { + virtual void set_with_mask(const uint32_t value, const uint32_t mask) { _atr_idle_cache = (value&mask)|(_atr_idle_cache&(~mask)); } - virtual boost::uint32_t get() { + virtual uint32_t get() { return _atr_idle_cache; } - void set_gpio_out_with_mask(const boost::uint32_t value, const boost::uint32_t mask) { + void set_gpio_out_with_mask(const uint32_t value, const uint32_t mask) { _gpio_out_cache = (value&mask)|(_gpio_out_cache&(~mask)); } - virtual boost::uint32_t get_gpio_out() { + virtual uint32_t get_gpio_out() { return _gpio_out_cache; } @@ -222,8 +222,8 @@ protected: } private: - boost::uint32_t _atr_idle_cache; - boost::uint32_t _gpio_out_cache; + uint32_t _atr_idle_cache; + uint32_t _gpio_out_cache; masked_reg_t& _atr_disable_reg; }; @@ -260,34 +260,34 @@ public: db_gpio_atr_3000_impl(wb_iface::sptr iface, const wb_iface::wb_addr_type base, const wb_iface::wb_addr_type rb_addr): gpio_atr_3000_impl(iface, base, rb_addr) { /* NOP */ } - inline void set_pin_ctrl(const db_unit_t unit, const boost::uint32_t value, const boost::uint32_t mask) + inline void set_pin_ctrl(const db_unit_t unit, const uint32_t value, const uint32_t mask) { gpio_atr_3000_impl::set_atr_mode(MODE_ATR, compute_mask(unit, value&mask)); gpio_atr_3000_impl::set_atr_mode(MODE_GPIO, compute_mask(unit, (~value)&mask)); } - inline boost::uint32_t get_pin_ctrl(const db_unit_t unit) + inline uint32_t get_pin_ctrl(const db_unit_t unit) { return (~_atr_disable_reg.get()) >> compute_shift(unit); } - inline void set_gpio_ddr(const db_unit_t unit, const boost::uint32_t value, const boost::uint32_t mask) + inline void set_gpio_ddr(const db_unit_t unit, const uint32_t value, const uint32_t mask) { gpio_atr_3000_impl::set_gpio_ddr(DDR_OUTPUT, compute_mask(unit, value&mask)); gpio_atr_3000_impl::set_gpio_ddr(DDR_INPUT, compute_mask(unit, (~value)&mask)); } - inline boost::uint32_t get_gpio_ddr(const db_unit_t unit) + inline uint32_t get_gpio_ddr(const db_unit_t unit) { return _ddr_reg.get() >> compute_shift(unit); } - inline void set_atr_reg(const db_unit_t unit, const gpio_atr_reg_t atr, const boost::uint32_t value, const boost::uint32_t mask) + inline void set_atr_reg(const db_unit_t unit, const gpio_atr_reg_t atr, const uint32_t value, const uint32_t mask) { gpio_atr_3000_impl::set_atr_reg(atr, value << compute_shift(unit), compute_mask(unit, mask)); } - inline boost::uint32_t get_atr_reg(const db_unit_t unit, const gpio_atr_reg_t atr) + inline uint32_t get_atr_reg(const db_unit_t unit, const gpio_atr_reg_t atr) { masked_reg_t* reg = NULL; switch (atr) { @@ -300,25 +300,25 @@ public: return (reg->get() & compute_mask(unit, MASK_SET_ALL)) >> compute_shift(unit); } - inline void set_gpio_out(const db_unit_t unit, const boost::uint32_t value, const boost::uint32_t mask) + inline void set_gpio_out(const db_unit_t unit, const uint32_t value, const uint32_t mask) { gpio_atr_3000_impl::set_gpio_out( - static_cast<boost::uint32_t>(value) << compute_shift(unit), + static_cast<uint32_t>(value) << compute_shift(unit), compute_mask(unit, mask)); } - inline boost::uint32_t get_gpio_out(const db_unit_t unit) + inline uint32_t get_gpio_out(const db_unit_t unit) { return (_atr_idle_reg.get_gpio_out() & compute_mask(unit, MASK_SET_ALL)) >> compute_shift(unit); } - inline boost::uint32_t read_gpio(const db_unit_t unit) + inline uint32_t read_gpio(const db_unit_t unit) { return (gpio_atr_3000_impl::read_gpio() & compute_mask(unit, MASK_SET_ALL)) >> compute_shift(unit); } private: - inline boost::uint32_t compute_shift(const db_unit_t unit) { + inline uint32_t compute_shift(const db_unit_t unit) { switch (unit) { case dboard_iface::UNIT_RX: return 0; case dboard_iface::UNIT_TX: return 16; @@ -326,8 +326,8 @@ private: } } - inline boost::uint32_t compute_mask(const db_unit_t unit, const boost::uint32_t mask) { - boost::uint32_t tmp_mask = (unit == dboard_iface::UNIT_BOTH) ? mask : (mask & 0xFFFF); + inline uint32_t compute_mask(const db_unit_t unit, const uint32_t mask) { + uint32_t tmp_mask = (unit == dboard_iface::UNIT_BOTH) ? mask : (mask & 0xFFFF); return tmp_mask << (compute_shift(unit)); } }; diff --git a/host/lib/usrp/cores/gpio_atr_3000.hpp b/host/lib/usrp/cores/gpio_atr_3000.hpp index 7b90429fe..1e7c304fa 100644 --- a/host/lib/usrp/cores/gpio_atr_3000.hpp +++ b/host/lib/usrp/cores/gpio_atr_3000.hpp @@ -30,7 +30,7 @@ class gpio_atr_3000 : boost::noncopyable { public: typedef boost::shared_ptr<gpio_atr_3000> sptr; - static const boost::uint32_t MASK_SET_ALL = 0xFFFFFFFF; + static const uint32_t MASK_SET_ALL = 0xFFFFFFFF; virtual ~gpio_atr_3000(void) {}; @@ -61,7 +61,7 @@ public: * \param mode the mode to apply {ATR = outputs driven by ATR state machine, GPIO = outputs static} * \param mask apply the mode to all non-zero bits in the mask */ - virtual void set_atr_mode(const gpio_atr_mode_t mode, const boost::uint32_t mask) = 0; + virtual void set_atr_mode(const gpio_atr_mode_t mode, const uint32_t mask) = 0; /*! * Select the data direction for all bits in the mask @@ -69,7 +69,7 @@ public: * \param dir the direction {OUTPUT, INPUT} * \param mask apply the mode to all non-zero bits in the mask */ - virtual void set_gpio_ddr(const gpio_ddr_t dir, const boost::uint32_t mask) = 0; + virtual void set_gpio_ddr(const gpio_ddr_t dir, const uint32_t mask) = 0; /*! * Write the specified (masked) value to the ATR register @@ -78,7 +78,7 @@ public: * \param value the value to write * \param mask only writes to the bits where mask is non-zero */ - virtual void set_atr_reg(const gpio_atr_reg_t atr, const boost::uint32_t value, const boost::uint32_t mask = MASK_SET_ALL) = 0; + virtual void set_atr_reg(const gpio_atr_reg_t atr, const uint32_t value, const uint32_t mask = MASK_SET_ALL) = 0; /*! * Write to a static GPIO output @@ -86,7 +86,7 @@ public: * \param value the value to write * \param mask only writes to the bits where mask is non-zero */ - virtual void set_gpio_out(const boost::uint32_t value, const boost::uint32_t mask = MASK_SET_ALL) = 0; + virtual void set_gpio_out(const uint32_t value, const uint32_t mask = MASK_SET_ALL) = 0; /*! * Read the state of the GPIO pins @@ -95,7 +95,7 @@ public: * * \return the value read back */ - virtual boost::uint32_t read_gpio() = 0; + virtual uint32_t read_gpio() = 0; /*! * Set a GPIO attribute @@ -103,7 +103,7 @@ public: * \param attr the attribute to set * \param value the value to write to the attribute */ - virtual void set_gpio_attr(const gpio_attr_t attr, const boost::uint32_t value) = 0; + virtual void set_gpio_attr(const gpio_attr_t attr, const uint32_t value) = 0; }; class db_gpio_atr_3000 { @@ -132,9 +132,9 @@ public: * \param unit the side of the daughterboard interface to configure (TX or RX) * \param value if value[i] is 1, the i'th bit is in ATR mode otherwise it is in GPIO mode */ - virtual void set_pin_ctrl(const db_unit_t unit, const boost::uint32_t value, const boost::uint32_t mask) = 0; + virtual void set_pin_ctrl(const db_unit_t unit, const uint32_t value, const uint32_t mask) = 0; - virtual boost::uint32_t get_pin_ctrl(const db_unit_t unit) = 0; + virtual uint32_t get_pin_ctrl(const db_unit_t unit) = 0; /*! * Configure the direction for all pins in the daughterboard connector @@ -142,9 +142,9 @@ public: * \param unit the side of the daughterboard interface to configure (TX or RX) * \param value if value[i] is 1, the i'th bit is an output otherwise it is an input */ - virtual void set_gpio_ddr(const db_unit_t unit, const boost::uint32_t value, const boost::uint32_t mask) = 0; + virtual void set_gpio_ddr(const db_unit_t unit, const uint32_t value, const uint32_t mask) = 0; - virtual boost::uint32_t get_gpio_ddr(const db_unit_t unit) = 0; + virtual uint32_t get_gpio_ddr(const db_unit_t unit) = 0; /*! * Write the specified value to the ATR register (all bits) @@ -153,9 +153,9 @@ public: * \param unit the side of the daughterboard interface to configure (TX or RX) * \param value the value to write */ - virtual void set_atr_reg(const db_unit_t unit, const gpio_atr_reg_t atr, const boost::uint32_t value, const boost::uint32_t mask) = 0; + virtual void set_atr_reg(const db_unit_t unit, const gpio_atr_reg_t atr, const uint32_t value, const uint32_t mask) = 0; - virtual boost::uint32_t get_atr_reg(const db_unit_t unit, const gpio_atr_reg_t atr) = 0; + virtual uint32_t get_atr_reg(const db_unit_t unit, const gpio_atr_reg_t atr) = 0; /*! * Write the specified value to the GPIO register (all bits) @@ -163,9 +163,9 @@ public: * \param atr the type of ATR register to write to {IDLE, RX, TX, FDX} * \param value the value to write */ - virtual void set_gpio_out(const db_unit_t unit, const boost::uint32_t value, const boost::uint32_t mask) = 0; + virtual void set_gpio_out(const db_unit_t unit, const uint32_t value, const uint32_t mask) = 0; - virtual boost::uint32_t get_gpio_out(const db_unit_t unit) = 0; + virtual uint32_t get_gpio_out(const db_unit_t unit) = 0; /*! * Read the state of the GPIO pins @@ -175,7 +175,7 @@ public: * \param unit the side of the daughterboard interface to configure (TX or RX) * \return the value read back */ - virtual boost::uint32_t read_gpio(const db_unit_t unit) = 0; + virtual uint32_t read_gpio(const db_unit_t unit) = 0; }; }}} //namespaces diff --git a/host/lib/usrp/cores/gpio_core_200.cpp b/host/lib/usrp/cores/gpio_core_200.cpp index 8ada95b1f..3bce8e078 100644 --- a/host/lib/usrp/cores/gpio_core_200.cpp +++ b/host/lib/usrp/cores/gpio_core_200.cpp @@ -41,18 +41,18 @@ public: gpio_core_200_impl(wb_iface::sptr iface, const size_t base, const size_t rb_addr): _iface(iface), _base(base), _rb_addr(rb_addr), _first_atr(true) { /* NOP */ } - void set_pin_ctrl(const unit_t unit, const boost::uint16_t value, const boost::uint16_t mask){ + void set_pin_ctrl(const unit_t unit, const uint16_t value, const uint16_t mask){ if (unit == dboard_iface::UNIT_BOTH) throw uhd::runtime_error("UNIT_BOTH not supported in gpio_core_200"); shadow_it(_pin_ctrl[unit], value, mask); update(); //full update } - boost::uint16_t get_pin_ctrl(unit_t unit){ + uint16_t get_pin_ctrl(unit_t unit){ if (unit == dboard_iface::UNIT_BOTH) throw uhd::runtime_error("UNIT_BOTH not supported in gpio_core_200"); return _pin_ctrl[unit]; } - void set_atr_reg(const unit_t unit, const atr_reg_t atr, const boost::uint16_t value, const boost::uint16_t mask){ + void set_atr_reg(const unit_t unit, const atr_reg_t atr, const uint16_t value, const uint16_t mask){ if (unit == dboard_iface::UNIT_BOTH) throw uhd::runtime_error("UNIT_BOTH not supported in gpio_core_200"); shadow_it(_atr_regs[unit][atr], value, mask); if (_first_atr) @@ -65,39 +65,39 @@ public: update(atr); } - boost::uint16_t get_atr_reg(unit_t unit, atr_reg_t reg){ + uint16_t get_atr_reg(unit_t unit, atr_reg_t reg){ if (unit == dboard_iface::UNIT_BOTH) throw uhd::runtime_error("UNIT_BOTH not supported in gpio_core_200"); return _atr_regs[unit][reg]; } - void set_gpio_ddr(const unit_t unit, const boost::uint16_t value, const boost::uint16_t mask){ + void set_gpio_ddr(const unit_t unit, const uint16_t value, const uint16_t mask){ if (unit == dboard_iface::UNIT_BOTH) throw uhd::runtime_error("UNIT_BOTH not supported in gpio_core_200"); shadow_it(_gpio_ddr[unit], value, mask); _iface->poke32(REG_GPIO_DDR, //update the 32 bit register - (boost::uint32_t(_gpio_ddr[dboard_iface::UNIT_RX]) << shift_by_unit(dboard_iface::UNIT_RX)) | - (boost::uint32_t(_gpio_ddr[dboard_iface::UNIT_TX]) << shift_by_unit(dboard_iface::UNIT_TX)) + (uint32_t(_gpio_ddr[dboard_iface::UNIT_RX]) << shift_by_unit(dboard_iface::UNIT_RX)) | + (uint32_t(_gpio_ddr[dboard_iface::UNIT_TX]) << shift_by_unit(dboard_iface::UNIT_TX)) ); } - boost::uint16_t get_gpio_ddr(unit_t unit){ + uint16_t get_gpio_ddr(unit_t unit){ if (unit == dboard_iface::UNIT_BOTH) throw uhd::runtime_error("UNIT_BOTH not supported in gpio_core_200"); return _gpio_ddr[unit]; } - void set_gpio_out(const unit_t unit, const boost::uint16_t value, const boost::uint16_t mask){ + void set_gpio_out(const unit_t unit, const uint16_t value, const uint16_t mask){ if (unit == dboard_iface::UNIT_BOTH) throw uhd::runtime_error("UNIT_BOTH not supported in gpio_core_200"); shadow_it(_gpio_out[unit], value, mask); this->update(); //full update } - boost::uint16_t get_gpio_out(unit_t unit){ + uint16_t get_gpio_out(unit_t unit){ if (unit == dboard_iface::UNIT_BOTH) throw uhd::runtime_error("UNIT_BOTH not supported in gpio_core_200"); return _gpio_out[unit]; } - boost::uint16_t read_gpio(const unit_t unit){ + uint16_t read_gpio(const unit_t unit){ if (unit == dboard_iface::UNIT_BOTH) throw uhd::runtime_error("UNIT_BOTH not supported in gpio_core_200"); - return boost::uint16_t(_iface->peek32(_rb_addr) >> shift_by_unit(unit)); + return uint16_t(_iface->peek32(_rb_addr) >> shift_by_unit(unit)); } private: @@ -105,10 +105,10 @@ private: const size_t _base; const size_t _rb_addr; bool _first_atr; - uhd::dict<size_t, boost::uint32_t> _update_cache; + uhd::dict<size_t, uint32_t> _update_cache; - uhd::dict<unit_t, boost::uint16_t> _pin_ctrl, _gpio_out, _gpio_ddr; - uhd::dict<unit_t, uhd::dict<atr_reg_t, boost::uint16_t> > _atr_regs; + uhd::dict<unit_t, uint16_t> _pin_ctrl, _gpio_out, _gpio_ddr; + uhd::dict<unit_t, uhd::dict<atr_reg_t, uint16_t> > _atr_regs; unsigned shift_by_unit(const unit_t unit){ return (unit == dboard_iface::UNIT_RX)? 0 : 16; @@ -140,18 +140,18 @@ private: default: UHD_THROW_INVALID_CODE_PATH(); } - const boost::uint32_t atr_val = - (boost::uint32_t(_atr_regs[dboard_iface::UNIT_RX][atr]) << shift_by_unit(dboard_iface::UNIT_RX)) | - (boost::uint32_t(_atr_regs[dboard_iface::UNIT_TX][atr]) << shift_by_unit(dboard_iface::UNIT_TX)); - - const boost::uint32_t gpio_val = - (boost::uint32_t(_gpio_out[dboard_iface::UNIT_RX]) << shift_by_unit(dboard_iface::UNIT_RX)) | - (boost::uint32_t(_gpio_out[dboard_iface::UNIT_TX]) << shift_by_unit(dboard_iface::UNIT_TX)); - - const boost::uint32_t ctrl = - (boost::uint32_t(_pin_ctrl[dboard_iface::UNIT_RX]) << shift_by_unit(dboard_iface::UNIT_RX)) | - (boost::uint32_t(_pin_ctrl[dboard_iface::UNIT_TX]) << shift_by_unit(dboard_iface::UNIT_TX)); - const boost::uint32_t val = (ctrl & atr_val) | ((~ctrl) & gpio_val); + const uint32_t atr_val = + (uint32_t(_atr_regs[dboard_iface::UNIT_RX][atr]) << shift_by_unit(dboard_iface::UNIT_RX)) | + (uint32_t(_atr_regs[dboard_iface::UNIT_TX][atr]) << shift_by_unit(dboard_iface::UNIT_TX)); + + const uint32_t gpio_val = + (uint32_t(_gpio_out[dboard_iface::UNIT_RX]) << shift_by_unit(dboard_iface::UNIT_RX)) | + (uint32_t(_gpio_out[dboard_iface::UNIT_TX]) << shift_by_unit(dboard_iface::UNIT_TX)); + + const uint32_t ctrl = + (uint32_t(_pin_ctrl[dboard_iface::UNIT_RX]) << shift_by_unit(dboard_iface::UNIT_RX)) | + (uint32_t(_pin_ctrl[dboard_iface::UNIT_TX]) << shift_by_unit(dboard_iface::UNIT_TX)); + const uint32_t val = (ctrl & atr_val) | ((~ctrl) & gpio_val); if (not _update_cache.has_key(addr) or _update_cache[addr] != val) { _iface->poke32(addr, val); @@ -182,7 +182,7 @@ public: } - void set_atr_reg(const atr_reg_t atr, const boost::uint32_t value){ + void set_atr_reg(const atr_reg_t atr, const uint32_t value){ if (atr == gpio_atr::ATR_REG_IDLE) _iface->poke32(REG_GPIO_IDLE, value); else if (atr == gpio_atr::ATR_REG_TX_ONLY) @@ -195,7 +195,7 @@ public: UHD_THROW_INVALID_CODE_PATH(); } - void set_all_regs(const boost::uint32_t value){ + void set_all_regs(const uint32_t value){ set_atr_reg(gpio_atr::ATR_REG_IDLE, value); set_atr_reg(gpio_atr::ATR_REG_TX_ONLY, value); set_atr_reg(gpio_atr::ATR_REG_RX_ONLY, value); diff --git a/host/lib/usrp/cores/gpio_core_200.hpp b/host/lib/usrp/cores/gpio_core_200.hpp index c697f0e77..95362de1b 100644 --- a/host/lib/usrp/cores/gpio_core_200.hpp +++ b/host/lib/usrp/cores/gpio_core_200.hpp @@ -22,7 +22,7 @@ #include <uhd/usrp/dboard_iface.hpp> #include <uhd/usrp/gpio_defs.hpp> #include <boost/assign.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/utility.hpp> #include <boost/shared_ptr.hpp> #include <uhd/types/wb_iface.hpp> @@ -43,27 +43,27 @@ public: //! 1 = ATR virtual void set_pin_ctrl( - const unit_t unit, const boost::uint16_t value, const boost::uint16_t mask) = 0; + const unit_t unit, const uint16_t value, const uint16_t mask) = 0; - virtual boost::uint16_t get_pin_ctrl(unit_t unit) = 0; + virtual uint16_t get_pin_ctrl(unit_t unit) = 0; virtual void set_atr_reg( - const unit_t unit, const atr_reg_t atr, const boost::uint16_t value, const boost::uint16_t mask) = 0; + const unit_t unit, const atr_reg_t atr, const uint16_t value, const uint16_t mask) = 0; - virtual boost::uint16_t get_atr_reg(unit_t unit, atr_reg_t reg) = 0; + virtual uint16_t get_atr_reg(unit_t unit, atr_reg_t reg) = 0; //! 1 = OUTPUT virtual void set_gpio_ddr( - const unit_t unit, const boost::uint16_t value, const boost::uint16_t mask) = 0; + const unit_t unit, const uint16_t value, const uint16_t mask) = 0; - virtual boost::uint16_t get_gpio_ddr(unit_t unit) = 0; + virtual uint16_t get_gpio_ddr(unit_t unit) = 0; virtual void set_gpio_out( - const unit_t unit, const boost::uint16_t value, const boost::uint16_t mask) = 0; + const unit_t unit, const uint16_t value, const uint16_t mask) = 0; - virtual boost::uint16_t get_gpio_out(unit_t unit) = 0; + virtual uint16_t get_gpio_out(unit_t unit) = 0; - virtual boost::uint16_t read_gpio(const unit_t unit) = 0; + virtual uint16_t read_gpio(const unit_t unit) = 0; }; //! Simple wrapper for 32 bit write only @@ -79,9 +79,9 @@ public: virtual void set_ddr_reg() = 0; - virtual void set_atr_reg(const atr_reg_t atr, const boost::uint32_t value) = 0; + virtual void set_atr_reg(const atr_reg_t atr, const uint32_t value) = 0; - virtual void set_all_regs(const boost::uint32_t value) = 0; + virtual void set_all_regs(const uint32_t value) = 0; }; #endif /* INCLUDED_LIBUHD_USRP_GPIO_CORE_200_HPP */ diff --git a/host/lib/usrp/cores/i2c_core_100.cpp b/host/lib/usrp/cores/i2c_core_100.cpp index 796447e0c..029b6eaa7 100644 --- a/host/lib/usrp/cores/i2c_core_100.cpp +++ b/host/lib/usrp/cores/i2c_core_100.cpp @@ -65,16 +65,16 @@ public: //init I2C FPGA interface. _iface->poke16(REG_I2C_CTRL, 0x0000); //set prescalers to operate at 400kHz: WB_CLK is 64MHz... - static const boost::uint32_t i2c_datarate = 400000; - static const boost::uint32_t wishbone_clk = 64000000; //FIXME should go somewhere else - boost::uint16_t prescaler = wishbone_clk / (i2c_datarate*5) - 1; + static const uint32_t i2c_datarate = 400000; + static const uint32_t wishbone_clk = 64000000; //FIXME should go somewhere else + uint16_t prescaler = wishbone_clk / (i2c_datarate*5) - 1; _iface->poke16(REG_I2C_PRESCALER_LO, prescaler & 0xFF); _iface->poke16(REG_I2C_PRESCALER_HI, (prescaler >> 8) & 0xFF); _iface->poke16(REG_I2C_CTRL, I2C_CTRL_EN); //enable I2C core } void write_i2c( - boost::uint16_t addr, + uint16_t addr, const byte_vector_t &bytes ){ _iface->poke16(REG_I2C_DATA, (addr << 1) | 0); //addr and read bit (0) @@ -97,7 +97,7 @@ public: } byte_vector_t read_i2c( - boost::uint16_t addr, + uint16_t addr, size_t num_bytes ){ byte_vector_t bytes; @@ -116,7 +116,7 @@ public: for (size_t i = 0; i < num_bytes; i++) { _iface->poke16(REG_I2C_CMD_STATUS, I2C_CMD_RD | ((num_bytes == i+1) ? (I2C_CMD_STOP | I2C_CMD_NACK) : 0)); i2c_wait(); - bytes.push_back(boost::uint8_t(_iface->peek16(REG_I2C_DATA))); + bytes.push_back(uint8_t(_iface->peek16(REG_I2C_DATA))); } return bytes; } diff --git a/host/lib/usrp/cores/i2c_core_100_wb32.cpp b/host/lib/usrp/cores/i2c_core_100_wb32.cpp index 530267f6c..099b80447 100644 --- a/host/lib/usrp/cores/i2c_core_100_wb32.cpp +++ b/host/lib/usrp/cores/i2c_core_100_wb32.cpp @@ -69,14 +69,14 @@ public: void set_clock_rate(const double rate) { - static const boost::uint32_t i2c_datarate = 400000; - boost::uint16_t prescaler = boost::uint16_t(rate / (i2c_datarate*5) - 1); + static const uint32_t i2c_datarate = 400000; + uint16_t prescaler = uint16_t(rate / (i2c_datarate*5) - 1); _iface->poke32(REG_I2C_PRESCALER_LO, prescaler & 0xFF); _iface->poke32(REG_I2C_PRESCALER_HI, (prescaler >> 8) & 0xFF); } void write_i2c( - boost::uint16_t addr, + uint16_t addr, const byte_vector_t &bytes ){ _iface->poke32(REG_I2C_DATA, (addr << 1) | 0); //addr and read bit (0) @@ -99,7 +99,7 @@ public: } byte_vector_t read_i2c( - boost::uint16_t addr, + uint16_t addr, size_t num_bytes ){ byte_vector_t bytes; @@ -118,16 +118,16 @@ public: for (size_t i = 0; i < num_bytes; i++) { _iface->poke32(REG_I2C_CMD_STATUS, I2C_CMD_RD | ((num_bytes == i+1) ? (I2C_CMD_STOP | I2C_CMD_NACK) : 0)); i2c_wait(); - bytes.push_back(boost::uint8_t(_iface->peek32(REG_I2C_DATA))); + bytes.push_back(uint8_t(_iface->peek32(REG_I2C_DATA))); } return bytes; } //override read_eeprom so we can write once, read all N bytes //the default implementation calls read i2c once per byte - byte_vector_t read_eeprom(boost::uint16_t addr, boost::uint16_t offset, size_t num_bytes) + byte_vector_t read_eeprom(uint16_t addr, uint16_t offset, size_t num_bytes) { - this->write_i2c(addr, byte_vector_t(1, boost::uint8_t(offset))); + this->write_i2c(addr, byte_vector_t(1, uint8_t(offset))); return this->read_i2c(addr, num_bytes); } diff --git a/host/lib/usrp/cores/i2c_core_200.cpp b/host/lib/usrp/cores/i2c_core_200.cpp index 2f0f6f815..eae91253c 100644 --- a/host/lib/usrp/cores/i2c_core_200.cpp +++ b/host/lib/usrp/cores/i2c_core_200.cpp @@ -68,16 +68,16 @@ public: //init I2C FPGA interface. this->poke(REG_I2C_WR_CTRL, 0x0000); //set prescalers to operate at 400kHz: WB_CLK is 64MHz... - static const boost::uint32_t i2c_datarate = 400000; - static const boost::uint32_t wishbone_clk = 64000000; //FIXME should go somewhere else - boost::uint16_t prescaler = wishbone_clk / (i2c_datarate*5) - 1; + static const uint32_t i2c_datarate = 400000; + static const uint32_t wishbone_clk = 64000000; //FIXME should go somewhere else + uint16_t prescaler = wishbone_clk / (i2c_datarate*5) - 1; this->poke(REG_I2C_WR_PRESCALER_LO, prescaler & 0xFF); this->poke(REG_I2C_WR_PRESCALER_HI, (prescaler >> 8) & 0xFF); this->poke(REG_I2C_WR_CTRL, I2C_CTRL_EN); //enable I2C core } void write_i2c( - boost::uint16_t addr, + uint16_t addr, const byte_vector_t &bytes ){ this->poke(REG_I2C_WR_DATA, (addr << 1) | 0); //addr and read bit (0) @@ -100,7 +100,7 @@ public: } byte_vector_t read_i2c( - boost::uint16_t addr, + uint16_t addr, size_t num_bytes ){ byte_vector_t bytes; @@ -138,17 +138,17 @@ private: return (this->peek(REG_I2C_RD_ST) & I2C_ST_RXACK) == 0; } - void poke(const size_t what, const boost::uint8_t cmd) + void poke(const size_t what, const uint8_t cmd) { boost::mutex::scoped_lock lock(_mutex); _iface->poke32(_base, (what << 8) | cmd); } - boost::uint8_t peek(const size_t what) + uint8_t peek(const size_t what) { boost::mutex::scoped_lock lock(_mutex); _iface->poke32(_base, what << 8); - return boost::uint8_t(_iface->peek32(_readback)); + return uint8_t(_iface->peek32(_readback)); } wb_iface::sptr _iface; diff --git a/host/lib/usrp/cores/radio_ctrl_core_3000.cpp b/host/lib/usrp/cores/radio_ctrl_core_3000.cpp index 47cfaf3ca..2e405d735 100644 --- a/host/lib/usrp/cores/radio_ctrl_core_3000.cpp +++ b/host/lib/usrp/cores/radio_ctrl_core_3000.cpp @@ -48,7 +48,7 @@ public: radio_ctrl_core_3000_impl(const bool big_endian, uhd::transport::zero_copy_if::sptr ctrl_xport, uhd::transport::zero_copy_if::sptr resp_xport, - const boost::uint32_t sid, const std::string &name) : + const uint32_t sid, const std::string &name) : _link_type(vrt::if_packet_info_t::LINK_TYPE_CHDR), _packet_type( vrt::if_packet_info_t::PACKET_TYPE_CONTEXT), _bige( big_endian), _ctrl_xport(ctrl_xport), _resp_xport( @@ -76,24 +76,24 @@ public: /******************************************************************* * Peek and poke 32 bit implementation ******************************************************************/ - void poke32(const wb_addr_type addr, const boost::uint32_t data) + void poke32(const wb_addr_type addr, const uint32_t data) { boost::mutex::scoped_lock lock(_mutex); this->send_pkt(addr/4, data); this->wait_for_ack(false); } - boost::uint32_t peek32(const wb_addr_type addr) + uint32_t peek32(const wb_addr_type addr) { boost::mutex::scoped_lock lock(_mutex); this->send_pkt(SR_READBACK, addr/8); - const boost::uint64_t res = this->wait_for_ack(true); - const boost::uint32_t lo = boost::uint32_t(res & 0xffffffff); - const boost::uint32_t hi = boost::uint32_t(res >> 32); + const uint64_t res = this->wait_for_ack(true); + const uint32_t lo = uint32_t(res & 0xffffffff); + const uint32_t hi = uint32_t(res >> 32); return ((addr/4) & 0x1)? hi : lo; } - boost::uint64_t peek64(const wb_addr_type addr) + uint64_t peek64(const wb_addr_type addr) { boost::mutex::scoped_lock lock(_mutex); this->send_pkt(SR_READBACK, addr/8); @@ -127,26 +127,26 @@ private: // This is the buffer type for messages in radio control core. struct resp_buff_type { - boost::uint32_t data[8]; + uint32_t data[8]; }; /******************************************************************* * Primary control and interaction private methods ******************************************************************/ - UHD_INLINE void send_pkt(const boost::uint32_t addr, const boost::uint32_t data = 0) + UHD_INLINE void send_pkt(const uint32_t addr, const uint32_t data = 0) { managed_send_buffer::sptr buff = _ctrl_xport->get_send_buff(0.0); if (not buff) { throw uhd::runtime_error("fifo ctrl timed out getting a send buffer"); } - boost::uint32_t *pkt = buff->cast<boost::uint32_t *>(); + uint32_t *pkt = buff->cast<uint32_t *>(); //load packet info vrt::if_packet_info_t packet_info; packet_info.link_type = _link_type; packet_info.packet_type = _packet_type; packet_info.num_payload_words32 = 2; - packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(boost::uint32_t); + packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(uint32_t); packet_info.packet_count = _seq_out; packet_info.tsf = _time.to_ticks(_tick_rate); packet_info.sob = false; @@ -168,12 +168,12 @@ private: //UHD_MSG(status) << boost::format("0x%08x, 0x%08x\n") % addr % data; //send the buffer over the interface _outstanding_seqs.push(_seq_out); - buff->commit(sizeof(boost::uint32_t)*(packet_info.num_packet_words32)); + buff->commit(sizeof(uint32_t)*(packet_info.num_packet_words32)); _seq_out++;//inc seq for next call } - UHD_INLINE boost::uint64_t wait_for_ack(const bool readback) + UHD_INLINE uint64_t wait_for_ack(const bool readback) { while (readback or (_outstanding_seqs.size() >= _resp_queue_size)) { @@ -186,7 +186,7 @@ private: vrt::if_packet_info_t packet_info; resp_buff_type resp_buff; memset(&resp_buff, 0x00, sizeof(resp_buff)); - boost::uint32_t const *pkt = NULL; + uint32_t const *pkt = NULL; managed_recv_buffer::sptr buff; //get buffer from response endpoint - or die in timeout @@ -202,8 +202,8 @@ private: { throw uhd::io_error(str(boost::format("Radio ctrl (%s) no response packet - %s") % _name % ex.what())); } - pkt = buff->cast<const boost::uint32_t *>(); - packet_info.num_packet_words32 = buff->size()/sizeof(boost::uint32_t); + pkt = buff->cast<const uint32_t *>(); + packet_info.num_packet_words32 = buff->size()/sizeof(uint32_t); } //get buffer from response endpoint - or die in timeout @@ -231,7 +231,7 @@ private: } pkt = resp_buff.data; - packet_info.num_packet_words32 = sizeof(resp_buff)/sizeof(boost::uint32_t); + packet_info.num_packet_words32 = sizeof(resp_buff)/sizeof(uint32_t); } //parse the buffer @@ -260,7 +260,7 @@ private: try { UHD_ASSERT_THROW(packet_info.has_sid); - UHD_ASSERT_THROW(packet_info.sid == boost::uint32_t((_sid >> 16) | (_sid << 16))); + UHD_ASSERT_THROW(packet_info.sid == uint32_t((_sid >> 16) | (_sid << 16))); UHD_ASSERT_THROW(packet_info.packet_count == (seq_to_ack & 0xfff)); UHD_ASSERT_THROW(packet_info.num_payload_words32 == 2); UHD_ASSERT_THROW(packet_info.packet_type == _packet_type); @@ -273,8 +273,8 @@ private: //return the readback value if (readback and _outstanding_seqs.empty()) { - const boost::uint64_t hi = (_bige)? uhd::ntohx(pkt[packet_info.num_header_words32+0]) : uhd::wtohx(pkt[packet_info.num_header_words32+0]); - const boost::uint64_t lo = (_bige)? uhd::ntohx(pkt[packet_info.num_header_words32+1]) : uhd::wtohx(pkt[packet_info.num_header_words32+1]); + const uint64_t hi = (_bige)? uhd::ntohx(pkt[packet_info.num_header_words32+0]) : uhd::wtohx(pkt[packet_info.num_header_words32+0]); + const uint64_t lo = (_bige)? uhd::ntohx(pkt[packet_info.num_header_words32+1]) : uhd::wtohx(pkt[packet_info.num_header_words32+1]); return ((hi << 32) | lo); } } @@ -292,7 +292,7 @@ private: */ bool check_dump_queue(resp_buff_type& b) { const size_t min_buff_size = 8; // Same value as in b200_io_impl->handle_async_task - boost::uint32_t recv_sid = (((_sid)<<16)|((_sid)>>16)); + uint32_t recv_sid = (((_sid)<<16)|((_sid)>>16)); uhd::msg_task::msg_payload_t msg; do{ msg = _async_task->get_msg_from_dump_queue(recv_sid); @@ -306,7 +306,7 @@ private: return false; } - void push_response(const boost::uint32_t *buff) + void push_response(const uint32_t *buff) { resp_buff_type resp_buff; std::memcpy(resp_buff.data, buff, sizeof(resp_buff)); @@ -324,7 +324,7 @@ private: const uhd::transport::zero_copy_if::sptr _ctrl_xport; const uhd::transport::zero_copy_if::sptr _resp_xport; uhd::msg_task::sptr _async_task; - const boost::uint32_t _sid; + const uint32_t _sid; const std::string _name; boost::mutex _mutex; size_t _seq_out; @@ -339,7 +339,7 @@ private: radio_ctrl_core_3000::sptr radio_ctrl_core_3000::make(const bool big_endian, zero_copy_if::sptr ctrl_xport, zero_copy_if::sptr resp_xport, - const boost::uint32_t sid, const std::string &name) + const uint32_t sid, const std::string &name) { return sptr( new radio_ctrl_core_3000_impl(big_endian, ctrl_xport, resp_xport, diff --git a/host/lib/usrp/cores/radio_ctrl_core_3000.hpp b/host/lib/usrp/cores/radio_ctrl_core_3000.hpp index c1cc1d372..3685ac1a1 100644 --- a/host/lib/usrp/cores/radio_ctrl_core_3000.hpp +++ b/host/lib/usrp/cores/radio_ctrl_core_3000.hpp @@ -41,7 +41,7 @@ public: const bool big_endian, uhd::transport::zero_copy_if::sptr ctrl_xport, uhd::transport::zero_copy_if::sptr resp_xport, - const boost::uint32_t sid, + const uint32_t sid, const std::string &name = "0" ); @@ -49,7 +49,7 @@ public: virtual void hold_task(uhd::msg_task::sptr task) = 0; //! Push a response externall (resp_xport is NULL) - virtual void push_response(const boost::uint32_t *buff) = 0; + virtual void push_response(const uint32_t *buff) = 0; //! Set the command time that will activate virtual void set_time(const uhd::time_spec_t &time) = 0; diff --git a/host/lib/usrp/cores/rx_dsp_core_200.cpp b/host/lib/usrp/cores/rx_dsp_core_200.cpp index e51862d3b..e781cfc6d 100644 --- a/host/lib/usrp/cores/rx_dsp_core_200.cpp +++ b/host/lib/usrp/cores/rx_dsp_core_200.cpp @@ -62,7 +62,7 @@ public: rx_dsp_core_200_impl( wb_iface::sptr iface, const size_t dsp_base, const size_t ctrl_base, - const boost::uint32_t sid, const bool lingering_packet + const uint32_t sid, const bool lingering_packet ): _iface(iface), _dsp_base(dsp_base), _ctrl_base(ctrl_base), _sid(sid) { @@ -128,22 +128,22 @@ public: boost::tie(inst_reload, inst_chain, inst_samps, inst_stop) = mode_to_inst[stream_cmd.stream_mode]; //calculate the word from flags and length - boost::uint32_t cmd_word = 0; - cmd_word |= boost::uint32_t((stream_cmd.stream_now)? 1 : 0) << 31; - cmd_word |= boost::uint32_t((inst_chain)? 1 : 0) << 30; - cmd_word |= boost::uint32_t((inst_reload)? 1 : 0) << 29; - cmd_word |= boost::uint32_t((inst_stop)? 1 : 0) << 28; + uint32_t cmd_word = 0; + cmd_word |= uint32_t((stream_cmd.stream_now)? 1 : 0) << 31; + cmd_word |= uint32_t((inst_chain)? 1 : 0) << 30; + cmd_word |= uint32_t((inst_reload)? 1 : 0) << 29; + cmd_word |= uint32_t((inst_stop)? 1 : 0) << 28; cmd_word |= (inst_samps)? stream_cmd.num_samps : ((inst_stop)? 0 : 1); //issue the stream command _iface->poke32(REG_RX_CTRL_STREAM_CMD, cmd_word); - const boost::uint64_t ticks = (stream_cmd.stream_now)? 0 : stream_cmd.time_spec.to_ticks(_tick_rate); - _iface->poke32(REG_RX_CTRL_TIME_HI, boost::uint32_t(ticks >> 32)); - _iface->poke32(REG_RX_CTRL_TIME_LO, boost::uint32_t(ticks >> 0)); //latches the command + const uint64_t ticks = (stream_cmd.stream_now)? 0 : stream_cmd.time_spec.to_ticks(_tick_rate); + _iface->poke32(REG_RX_CTRL_TIME_HI, uint32_t(ticks >> 32)); + _iface->poke32(REG_RX_CTRL_TIME_LO, uint32_t(ticks >> 0)); //latches the command } void set_mux(const std::string &mode, const bool fe_swapped){ - static const uhd::dict<std::string, boost::uint32_t> mode_to_mux = boost::assign::map_list_of + static const uhd::dict<std::string, uint32_t> mode_to_mux = boost::assign::map_list_of ("IQ", 0) ("QI", FLAG_DSP_RX_MUX_SWAP_IQ) ("I", FLAG_DSP_RX_MUX_REAL_MODE) @@ -157,8 +157,8 @@ public: } void set_link_rate(const double rate){ - //_link_rate = rate/sizeof(boost::uint32_t); //in samps/s - _link_rate = rate/sizeof(boost::uint16_t); //in samps/s (allows for 8sc) + //_link_rate = rate/sizeof(uint32_t); //in samps/s + _link_rate = rate/sizeof(uint16_t); //in samps/s (allows for 8sc) } uhd::meta_range_t get_host_rates(void){ @@ -214,7 +214,7 @@ public: void update_scalar(void){ const double factor = 1.0 + std::max(ceil_log2(_scaling_adjustment), 0.0); const double target_scalar = (1 << 17)*_scaling_adjustment/_dsp_extra_scaling/factor; - const boost::int32_t actual_scalar = boost::math::iround(target_scalar); + const int32_t actual_scalar = boost::math::iround(target_scalar); _fxpt_scalar_correction = target_scalar/actual_scalar*factor; //should be small _iface->poke32(REG_DSP_RX_SCALE_IQ, actual_scalar); } @@ -227,7 +227,7 @@ public: double actual_freq; int32_t freq_word; get_freq_and_freq_word(requested_freq, _tick_rate, actual_freq, freq_word); - _iface->poke32(REG_DSP_RX_FREQ, boost::uint32_t(freq_word)); + _iface->poke32(REG_DSP_RX_FREQ, uint32_t(freq_word)); return actual_freq; } @@ -271,9 +271,9 @@ private: double _tick_rate, _link_rate; bool _continuous_streaming; double _scaling_adjustment, _dsp_extra_scaling, _host_extra_scaling, _fxpt_scalar_correction; - const boost::uint32_t _sid; + const uint32_t _sid; }; -rx_dsp_core_200::sptr rx_dsp_core_200::make(wb_iface::sptr iface, const size_t dsp_base, const size_t ctrl_base, const boost::uint32_t sid, const bool lingering_packet){ +rx_dsp_core_200::sptr rx_dsp_core_200::make(wb_iface::sptr iface, const size_t dsp_base, const size_t ctrl_base, const uint32_t sid, const bool lingering_packet){ return sptr(new rx_dsp_core_200_impl(iface, dsp_base, ctrl_base, sid, lingering_packet)); } diff --git a/host/lib/usrp/cores/rx_dsp_core_200.hpp b/host/lib/usrp/cores/rx_dsp_core_200.hpp index 1dc51fa24..a565ffebd 100644 --- a/host/lib/usrp/cores/rx_dsp_core_200.hpp +++ b/host/lib/usrp/cores/rx_dsp_core_200.hpp @@ -36,7 +36,7 @@ public: static sptr make( uhd::wb_iface::sptr iface, const size_t dsp_base, const size_t ctrl_base, - const boost::uint32_t sid, const bool lingering_packet = false + const uint32_t sid, const bool lingering_packet = false ); virtual void clear(void) = 0; diff --git a/host/lib/usrp/cores/rx_dsp_core_3000.cpp b/host/lib/usrp/cores/rx_dsp_core_3000.cpp index eedbbef95..fdd73a7ac 100644 --- a/host/lib/usrp/cores/rx_dsp_core_3000.cpp +++ b/host/lib/usrp/cores/rx_dsp_core_3000.cpp @@ -81,7 +81,7 @@ public: } void set_mux(const uhd::usrp::fe_connection_t& fe_conn){ - boost::uint32_t reg_val = 0; + uint32_t reg_val = 0; switch (fe_conn.get_sampling_mode()) { case uhd::usrp::fe_connection_t::REAL: case uhd::usrp::fe_connection_t::HETERODYNE: @@ -122,8 +122,8 @@ public: } void set_link_rate(const double rate){ - //_link_rate = rate/sizeof(boost::uint32_t); //in samps/s - _link_rate = rate/sizeof(boost::uint16_t); //in samps/s (allows for 8sc) + //_link_rate = rate/sizeof(uint32_t); //in samps/s + _link_rate = rate/sizeof(uint16_t); //in samps/s (allows for 8sc) } uhd::meta_range_t get_host_rates(void){ @@ -223,7 +223,7 @@ public: // Further more factor in OTW format which adds further gain factor to weight output samples correctly. void update_scalar(void){ const double target_scalar = (1 << (_is_b200 ? 16 : 15))*_scaling_adjustment/_dsp_extra_scaling; - const boost::int32_t actual_scalar = boost::math::iround(target_scalar); + const int32_t actual_scalar = boost::math::iround(target_scalar); // Calculate the error introduced by using integer representation for the scalar, can be corrected in host later. _fxpt_scalar_correction = target_scalar/actual_scalar; // Write DDC with scaling correction for CIC and CORDIC that maximizes dynamic range in 32/16/12/8bits. @@ -238,7 +238,7 @@ public: double actual_freq; int32_t freq_word; get_freq_and_freq_word(requested_freq + _dsp_freq_offset, _tick_rate, actual_freq, freq_word); - _iface->poke32(REG_DSP_RX_FREQ, boost::uint32_t(freq_word)); + _iface->poke32(REG_DSP_RX_FREQ, uint32_t(freq_word)); return actual_freq; } diff --git a/host/lib/usrp/cores/rx_frontend_core_200.cpp b/host/lib/usrp/cores/rx_frontend_core_200.cpp index 0a60bf87c..1ecc3e420 100644 --- a/host/lib/usrp/cores/rx_frontend_core_200.cpp +++ b/host/lib/usrp/cores/rx_frontend_core_200.cpp @@ -31,8 +31,8 @@ using namespace uhd; #define OFFSET_SET (1ul << 30) #define FLAG_MASK (OFFSET_FIXED | OFFSET_SET) -static boost::uint32_t fs_to_bits(const double num, const size_t bits){ - return boost::int32_t(boost::math::round(num * (1 << (bits-1)))); +static uint32_t fs_to_bits(const double num, const size_t bits){ + return int32_t(boost::math::round(num * (1 << (bits-1)))); } rx_frontend_core_200::~rx_frontend_core_200(void){ @@ -69,7 +69,7 @@ public: return std::complex<double>(_i_dc_off/scaler, _q_dc_off/scaler); } - void set_dc_offset(const boost::uint32_t flags){ + void set_dc_offset(const uint32_t flags){ _iface->poke32(REG_RX_FE_OFFSET_I, flags | (_i_dc_off & ~FLAG_MASK)); _iface->poke32(REG_RX_FE_OFFSET_Q, flags | (_q_dc_off & ~FLAG_MASK)); } @@ -96,7 +96,7 @@ public: } private: - boost::int32_t _i_dc_off, _q_dc_off; + int32_t _i_dc_off, _q_dc_off; wb_iface::sptr _iface; const size_t _base; }; diff --git a/host/lib/usrp/cores/rx_frontend_core_3000.cpp b/host/lib/usrp/cores/rx_frontend_core_3000.cpp index 23197cf5a..1c4674a8a 100644 --- a/host/lib/usrp/cores/rx_frontend_core_3000.cpp +++ b/host/lib/usrp/cores/rx_frontend_core_3000.cpp @@ -46,8 +46,8 @@ using namespace uhd; using namespace uhd::usrp; -static boost::uint32_t fs_to_bits(const double num, const size_t bits){ - return boost::int32_t(boost::math::round(num * (1 << (bits-1)))); +static uint32_t fs_to_bits(const double num, const size_t bits){ + return int32_t(boost::math::round(num * (1 << (bits-1)))); } rx_frontend_core_3000::~rx_frontend_core_3000(void){ @@ -82,7 +82,7 @@ public: } void set_fe_connection(const fe_connection_t& fe_conn) { - boost::uint32_t mapping_reg_val = 0; + uint32_t mapping_reg_val = 0; switch (fe_conn.get_sampling_mode()) { case fe_connection_t::REAL: case fe_connection_t::HETERODYNE: @@ -118,7 +118,7 @@ public: } int32_t freq_word; get_freq_and_freq_word(cordic_freq, _adc_rate, actual_cordic_freq, freq_word); - _iface->poke32(REG_RX_FE_HET_CORDIC_PHASE, boost::uint32_t(freq_word)); + _iface->poke32(REG_RX_FE_HET_CORDIC_PHASE, uint32_t(freq_word)); _fe_conn = fe_conn; } @@ -137,7 +137,7 @@ public: return std::complex<double>(_i_dc_off/scaler, _q_dc_off/scaler); } - void _set_dc_offset(const boost::uint32_t flags) { + void _set_dc_offset(const uint32_t flags) { _iface->poke32(REG_RX_FE_OFFSET_I, flags | (_i_dc_off & ~FLAG_MASK)); _iface->poke32(REG_RX_FE_OFFSET_Q, flags | (_q_dc_off & ~FLAG_MASK)); } @@ -174,7 +174,7 @@ public: } private: - boost::int32_t _i_dc_off, _q_dc_off; + int32_t _i_dc_off, _q_dc_off; double _adc_rate; fe_connection_t _fe_conn; wb_iface::sptr _iface; diff --git a/host/lib/usrp/cores/rx_vita_core_3000.cpp b/host/lib/usrp/cores/rx_vita_core_3000.cpp index 54c57c2d5..57868ff54 100644 --- a/host/lib/usrp/cores/rx_vita_core_3000.cpp +++ b/host/lib/usrp/cores/rx_vita_core_3000.cpp @@ -117,18 +117,18 @@ struct rx_vita_core_3000_impl : rx_vita_core_3000 boost::tie(inst_reload, inst_chain, inst_samps, inst_stop) = mode_to_inst[stream_cmd.stream_mode]; //calculate the word from flags and length - boost::uint32_t cmd_word = 0; - cmd_word |= boost::uint32_t((stream_cmd.stream_now)? 1 : 0) << 31; - cmd_word |= boost::uint32_t((inst_chain)? 1 : 0) << 30; - cmd_word |= boost::uint32_t((inst_reload)? 1 : 0) << 29; - cmd_word |= boost::uint32_t((inst_stop)? 1 : 0) << 28; + uint32_t cmd_word = 0; + cmd_word |= uint32_t((stream_cmd.stream_now)? 1 : 0) << 31; + cmd_word |= uint32_t((inst_chain)? 1 : 0) << 30; + cmd_word |= uint32_t((inst_reload)? 1 : 0) << 29; + cmd_word |= uint32_t((inst_stop)? 1 : 0) << 28; cmd_word |= (inst_samps)? stream_cmd.num_samps : ((inst_stop)? 0 : 1); //issue the stream command _iface->poke32(REG_CTRL_CMD, cmd_word); - const boost::uint64_t ticks = (stream_cmd.stream_now)? 0 : stream_cmd.time_spec.to_ticks(_tick_rate); - _iface->poke32(REG_CTRL_TIME_HI, boost::uint32_t(ticks >> 32)); - _iface->poke32(REG_CTRL_TIME_LO, boost::uint32_t(ticks >> 0)); //latches the command + const uint64_t ticks = (stream_cmd.stream_now)? 0 : stream_cmd.time_spec.to_ticks(_tick_rate); + _iface->poke32(REG_CTRL_TIME_HI, uint32_t(ticks >> 32)); + _iface->poke32(REG_CTRL_TIME_LO, uint32_t(ticks >> 0)); //latches the command } void set_tick_rate(const double rate) @@ -136,7 +136,7 @@ struct rx_vita_core_3000_impl : rx_vita_core_3000 _tick_rate = rate; } - void set_sid(const boost::uint32_t sid) + void set_sid(const uint32_t sid) { _iface->poke32(REG_FRAMER_SID, sid); } diff --git a/host/lib/usrp/cores/rx_vita_core_3000.hpp b/host/lib/usrp/cores/rx_vita_core_3000.hpp index cd718a190..94e901bf4 100644 --- a/host/lib/usrp/cores/rx_vita_core_3000.hpp +++ b/host/lib/usrp/cores/rx_vita_core_3000.hpp @@ -47,7 +47,7 @@ public: virtual void set_tick_rate(const double rate) = 0; - virtual void set_sid(const boost::uint32_t sid) = 0; + virtual void set_sid(const uint32_t sid) = 0; virtual void handle_overflow(void) = 0; diff --git a/host/lib/usrp/cores/spi_core_100.cpp b/host/lib/usrp/cores/spi_core_100.cpp index 71d92bcb6..22b163b14 100644 --- a/host/lib/usrp/cores/spi_core_100.cpp +++ b/host/lib/usrp/cores/spi_core_100.cpp @@ -48,10 +48,10 @@ public: spi_core_100_impl(wb_iface::sptr iface, const size_t base): _iface(iface), _base(base) { /* NOP */} - boost::uint32_t transact_spi( + uint32_t transact_spi( int which_slave, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits, bool readback ){ @@ -60,7 +60,7 @@ public: int edge_flags = ((config.miso_edge==spi_config_t::EDGE_FALL) ? SPI_CTRL_RXNEG : 0) | ((config.mosi_edge==spi_config_t::EDGE_FALL) ? 0 : SPI_CTRL_TXNEG) ; - boost::uint16_t ctrl = SPI_CTRL_ASS | (SPI_CTRL_CHAR_LEN_MASK & num_bits) | edge_flags; + uint16_t ctrl = SPI_CTRL_ASS | (SPI_CTRL_CHAR_LEN_MASK & num_bits) | edge_flags; spi_wait(); _iface->poke16(REG_SPI_DIV, 0x0001); // = fpga_clk / 4 diff --git a/host/lib/usrp/cores/spi_core_3000.cpp b/host/lib/usrp/cores/spi_core_3000.cpp index 01df71cec..78b0af1a3 100644 --- a/host/lib/usrp/cores/spi_core_3000.cpp +++ b/host/lib/usrp/cores/spi_core_3000.cpp @@ -40,10 +40,10 @@ public: this->set_divider(30); } - boost::uint32_t transact_spi( + uint32_t transact_spi( int which_slave, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits, bool readback ){ @@ -64,7 +64,7 @@ public: } //load control word - boost::uint32_t ctrl_word = 0; + uint32_t ctrl_word = 0; ctrl_word |= ((which_slave & 0xffffff) << 0); ctrl_word |= ((num_bits & 0x3f) << 24); if (config.mosi_edge == spi_config_t::EDGE_FALL) ctrl_word |= (1 << 31); @@ -78,7 +78,7 @@ public: } //load data word (must be in upper bits) - const boost::uint32_t data_out = data << (32 - num_bits); + const uint32_t data_out = data << (32 - num_bits); //send data word _iface->poke32(SPI_DATA, data_out); @@ -113,7 +113,7 @@ private: wb_iface::sptr _iface; const size_t _base; const size_t _readback; - boost::uint32_t _ctrl_word_cache; + uint32_t _ctrl_word_cache; bool _shutdown_cache; boost::mutex _mutex; size_t _div; diff --git a/host/lib/usrp/cores/time64_core_200.cpp b/host/lib/usrp/cores/time64_core_200.cpp index 54b60b6ad..b0138400d 100644 --- a/host/lib/usrp/cores/time64_core_200.cpp +++ b/host/lib/usrp/cores/time64_core_200.cpp @@ -71,10 +71,10 @@ public: uhd::time_spec_t get_time_now(void){ for (size_t i = 0; i < 3; i++){ //special algorithm because we cant read 64 bits synchronously - const boost::uint32_t ticks_hi = _iface->peek32(_readback_bases.rb_hi_now); - const boost::uint32_t ticks_lo = _iface->peek32(_readback_bases.rb_lo_now); + const uint32_t ticks_hi = _iface->peek32(_readback_bases.rb_hi_now); + const uint32_t ticks_lo = _iface->peek32(_readback_bases.rb_lo_now); if (ticks_hi != _iface->peek32(_readback_bases.rb_hi_now)) continue; - const boost::uint64_t ticks = (boost::uint64_t(ticks_hi) << 32) | ticks_lo; + const uint64_t ticks = (uint64_t(ticks_hi) << 32) | ticks_lo; return time_spec_t::from_ticks(ticks, _tick_rate); } throw uhd::runtime_error("time64_core_200: get time now timeout"); @@ -82,27 +82,27 @@ public: uhd::time_spec_t get_time_last_pps(void){ for (size_t i = 0; i < 3; i++){ //special algorithm because we cant read 64 bits synchronously - const boost::uint32_t ticks_hi = _iface->peek32(_readback_bases.rb_hi_pps); - const boost::uint32_t ticks_lo = _iface->peek32(_readback_bases.rb_lo_pps); + const uint32_t ticks_hi = _iface->peek32(_readback_bases.rb_hi_pps); + const uint32_t ticks_lo = _iface->peek32(_readback_bases.rb_lo_pps); if (ticks_hi != _iface->peek32(_readback_bases.rb_hi_pps)) continue; - const boost::uint64_t ticks = (boost::uint64_t(ticks_hi) << 32) | ticks_lo; + const uint64_t ticks = (uint64_t(ticks_hi) << 32) | ticks_lo; return time_spec_t::from_ticks(ticks, _tick_rate); } throw uhd::runtime_error("time64_core_200: get time last pps timeout"); } void set_time_now(const uhd::time_spec_t &time){ - const boost::uint64_t ticks = time.to_ticks(_tick_rate); - _iface->poke32(REG_TIME64_TICKS_LO, boost::uint32_t(ticks >> 0)); + const uint64_t ticks = time.to_ticks(_tick_rate); + _iface->poke32(REG_TIME64_TICKS_LO, uint32_t(ticks >> 0)); _iface->poke32(REG_TIME64_IMM, FLAG_TIME64_LATCH_NOW); - _iface->poke32(REG_TIME64_TICKS_HI, boost::uint32_t(ticks >> 32)); //latches all 3 + _iface->poke32(REG_TIME64_TICKS_HI, uint32_t(ticks >> 32)); //latches all 3 } void set_time_next_pps(const uhd::time_spec_t &time){ - const boost::uint64_t ticks = time.to_ticks(_tick_rate); - _iface->poke32(REG_TIME64_TICKS_LO, boost::uint32_t(ticks >> 0)); + const uint64_t ticks = time.to_ticks(_tick_rate); + _iface->poke32(REG_TIME64_TICKS_LO, uint32_t(ticks >> 0)); _iface->poke32(REG_TIME64_IMM, FLAG_TIME64_LATCH_NEXT_PPS); - _iface->poke32(REG_TIME64_TICKS_HI, boost::uint32_t(ticks >> 32)); //latches all 3 + _iface->poke32(REG_TIME64_TICKS_HI, uint32_t(ticks >> 32)); //latches all 3 } void set_time_source(const std::string &source){ diff --git a/host/lib/usrp/cores/time_core_3000.cpp b/host/lib/usrp/cores/time_core_3000.cpp index 45b1750d2..25142b9fe 100644 --- a/host/lib/usrp/cores/time_core_3000.cpp +++ b/host/lib/usrp/cores/time_core_3000.cpp @@ -82,37 +82,37 @@ struct time_core_3000_impl : time_core_3000 uhd::time_spec_t get_time_now(void) { - const boost::uint64_t ticks = _iface->peek64(_readback_bases.rb_now); + const uint64_t ticks = _iface->peek64(_readback_bases.rb_now); return time_spec_t::from_ticks(ticks, _tick_rate); } uhd::time_spec_t get_time_last_pps(void) { - const boost::uint64_t ticks = _iface->peek64(_readback_bases.rb_pps); + const uint64_t ticks = _iface->peek64(_readback_bases.rb_pps); return time_spec_t::from_ticks(ticks, _tick_rate); } void set_time_now(const uhd::time_spec_t &time) { - const boost::uint64_t ticks = time.to_ticks(_tick_rate); - _iface->poke32(REG_TIME_HI, boost::uint32_t(ticks >> 32)); - _iface->poke32(REG_TIME_LO, boost::uint32_t(ticks >> 0)); + const uint64_t ticks = time.to_ticks(_tick_rate); + _iface->poke32(REG_TIME_HI, uint32_t(ticks >> 32)); + _iface->poke32(REG_TIME_LO, uint32_t(ticks >> 0)); _iface->poke32(REG_TIME_CTRL, CTRL_LATCH_TIME_NOW); } void set_time_sync(const uhd::time_spec_t &time) { - const boost::uint64_t ticks = time.to_ticks(_tick_rate); - _iface->poke32(REG_TIME_HI, boost::uint32_t(ticks >> 32)); - _iface->poke32(REG_TIME_LO, boost::uint32_t(ticks >> 0)); + const uint64_t ticks = time.to_ticks(_tick_rate); + _iface->poke32(REG_TIME_HI, uint32_t(ticks >> 32)); + _iface->poke32(REG_TIME_LO, uint32_t(ticks >> 0)); _iface->poke32(REG_TIME_CTRL, CTRL_LATCH_TIME_SYNC); } void set_time_next_pps(const uhd::time_spec_t &time) { - const boost::uint64_t ticks = time.to_ticks(_tick_rate); - _iface->poke32(REG_TIME_HI, boost::uint32_t(ticks >> 32)); - _iface->poke32(REG_TIME_LO, boost::uint32_t(ticks >> 0)); + const uint64_t ticks = time.to_ticks(_tick_rate); + _iface->poke32(REG_TIME_HI, uint32_t(ticks >> 32)); + _iface->poke32(REG_TIME_LO, uint32_t(ticks >> 0)); _iface->poke32(REG_TIME_CTRL, CTRL_LATCH_TIME_PPS); } diff --git a/host/lib/usrp/cores/tx_dsp_core_200.cpp b/host/lib/usrp/cores/tx_dsp_core_200.cpp index 4c456a10d..4e1743ee1 100644 --- a/host/lib/usrp/cores/tx_dsp_core_200.cpp +++ b/host/lib/usrp/cores/tx_dsp_core_200.cpp @@ -60,7 +60,7 @@ public: tx_dsp_core_200_impl( wb_iface::sptr iface, const size_t dsp_base, const size_t ctrl_base, - const boost::uint32_t sid + const uint32_t sid ): _iface(iface), _dsp_base(dsp_base), _ctrl_base(ctrl_base), _sid(sid) { @@ -98,8 +98,8 @@ public: } void set_link_rate(const double rate){ - //_link_rate = rate/sizeof(boost::uint32_t); //in samps/s - _link_rate = rate/sizeof(boost::uint16_t); //in samps/s (allows for 8sc) + //_link_rate = rate/sizeof(uint32_t); //in samps/s + _link_rate = rate/sizeof(uint16_t); //in samps/s (allows for 8sc) } uhd::meta_range_t get_host_rates(void){ @@ -154,7 +154,7 @@ public: void update_scalar(void){ const double factor = 1.0 + std::max(ceil_log2(_scaling_adjustment), 0.0); const double target_scalar = (1 << 17)*_scaling_adjustment/_dsp_extra_scaling/factor; - const boost::int32_t actual_scalar = boost::math::iround(target_scalar); + const int32_t actual_scalar = boost::math::iround(target_scalar); _fxpt_scalar_correction = target_scalar/actual_scalar*factor; //should be small _iface->poke32(REG_DSP_TX_SCALE_IQ, actual_scalar); } @@ -167,7 +167,7 @@ public: double actual_freq; int32_t freq_word; get_freq_and_freq_word(requested_freq, _tick_rate, actual_freq, freq_word); - _iface->poke32(REG_DSP_TX_FREQ, boost::uint32_t(freq_word)); + _iface->poke32(REG_DSP_TX_FREQ, uint32_t(freq_word)); return actual_freq; } @@ -214,9 +214,9 @@ private: const size_t _dsp_base, _ctrl_base; double _tick_rate, _link_rate; double _scaling_adjustment, _dsp_extra_scaling, _host_extra_scaling, _fxpt_scalar_correction; - const boost::uint32_t _sid; + const uint32_t _sid; }; -tx_dsp_core_200::sptr tx_dsp_core_200::make(wb_iface::sptr iface, const size_t dsp_base, const size_t ctrl_base, const boost::uint32_t sid){ +tx_dsp_core_200::sptr tx_dsp_core_200::make(wb_iface::sptr iface, const size_t dsp_base, const size_t ctrl_base, const uint32_t sid){ return sptr(new tx_dsp_core_200_impl(iface, dsp_base, ctrl_base, sid)); } diff --git a/host/lib/usrp/cores/tx_dsp_core_200.hpp b/host/lib/usrp/cores/tx_dsp_core_200.hpp index f0475c579..02faad587 100644 --- a/host/lib/usrp/cores/tx_dsp_core_200.hpp +++ b/host/lib/usrp/cores/tx_dsp_core_200.hpp @@ -34,7 +34,7 @@ public: static sptr make( uhd::wb_iface::sptr iface, const size_t dsp_base, const size_t ctrl_base, - const boost::uint32_t sid + const uint32_t sid ); virtual void clear(void) = 0; diff --git a/host/lib/usrp/cores/tx_dsp_core_3000.cpp b/host/lib/usrp/cores/tx_dsp_core_3000.cpp index 3889bbdc4..67ff418b3 100644 --- a/host/lib/usrp/cores/tx_dsp_core_3000.cpp +++ b/host/lib/usrp/cores/tx_dsp_core_3000.cpp @@ -66,8 +66,8 @@ public: } void set_link_rate(const double rate){ - //_link_rate = rate/sizeof(boost::uint32_t); //in samps/s - _link_rate = rate/sizeof(boost::uint16_t); //in samps/s (allows for 8sc) + //_link_rate = rate/sizeof(uint32_t); //in samps/s + _link_rate = rate/sizeof(uint16_t); //in samps/s (allows for 8sc) } uhd::meta_range_t get_host_rates(void){ @@ -127,7 +127,7 @@ public: // Further more factor in OTW format which adds further gain factor to weight output samples correctly. void update_scalar(void){ const double target_scalar = (1 << 16)*_scaling_adjustment/_dsp_extra_scaling; - const boost::int32_t actual_scalar = boost::math::iround(target_scalar); + const int32_t actual_scalar = boost::math::iround(target_scalar); _fxpt_scalar_correction = target_scalar/actual_scalar; //should be small _iface->poke32(REG_DSP_TX_SCALE_IQ, actual_scalar); } @@ -140,7 +140,7 @@ public: double actual_freq; int32_t freq_word; get_freq_and_freq_word(requested_freq, _tick_rate, actual_freq, freq_word); - _iface->poke32(REG_DSP_TX_FREQ, boost::uint32_t(freq_word)); + _iface->poke32(REG_DSP_TX_FREQ, uint32_t(freq_word)); return actual_freq; } diff --git a/host/lib/usrp/cores/tx_frontend_core_200.cpp b/host/lib/usrp/cores/tx_frontend_core_200.cpp index be4f77f39..241f98d07 100644 --- a/host/lib/usrp/cores/tx_frontend_core_200.cpp +++ b/host/lib/usrp/cores/tx_frontend_core_200.cpp @@ -33,8 +33,8 @@ using namespace uhd; const std::complex<double> tx_frontend_core_200::DEFAULT_DC_OFFSET_VALUE = std::complex<double>(0.0, 0.0); const std::complex<double> tx_frontend_core_200::DEFAULT_IQ_BALANCE_VALUE = std::complex<double>(0.0, 0.0); -static boost::uint32_t fs_to_bits(const double num, const size_t bits){ - return boost::int32_t(boost::math::round(num * (1 << (bits-1)))); +static uint32_t fs_to_bits(const double num, const size_t bits){ + return int32_t(boost::math::round(num * (1 << (bits-1)))); } tx_frontend_core_200::~tx_frontend_core_200(void){ @@ -50,7 +50,7 @@ public: } void set_mux(const std::string &mode){ - static const uhd::dict<std::string, boost::uint32_t> mode_to_mux = boost::assign::map_list_of + static const uhd::dict<std::string, uint32_t> mode_to_mux = boost::assign::map_list_of ("IQ", (0x1 << 4) | (0x0 << 0)) //DAC0Q=DUC0Q, DAC0I=DUC0I ("QI", (0x0 << 4) | (0x1 << 0)) //DAC0Q=DUC0I, DAC0I=DUC0Q ("I", (0xf << 4) | (0x0 << 0)) //DAC0Q=ZERO, DAC0I=DUC0I @@ -61,8 +61,8 @@ public: std::complex<double> set_dc_offset(const std::complex<double> &off){ static const double scaler = double(1ul << 23); - const boost::int32_t i_dc_off = boost::math::iround(off.real()*scaler); - const boost::int32_t q_dc_off = boost::math::iround(off.imag()*scaler); + const int32_t i_dc_off = boost::math::iround(off.real()*scaler); + const int32_t q_dc_off = boost::math::iround(off.imag()*scaler); _iface->poke32(REG_TX_FE_DC_OFFSET_I, i_dc_off); _iface->poke32(REG_TX_FE_DC_OFFSET_Q, q_dc_off); diff --git a/host/lib/usrp/cores/user_settings_core_200.hpp b/host/lib/usrp/cores/user_settings_core_200.hpp index a8efeed38..9e985c23b 100644 --- a/host/lib/usrp/cores/user_settings_core_200.hpp +++ b/host/lib/usrp/cores/user_settings_core_200.hpp @@ -26,7 +26,7 @@ class user_settings_core_200 : boost::noncopyable{ public: typedef boost::shared_ptr<user_settings_core_200> sptr; - typedef std::pair<boost::uint8_t, boost::uint32_t> user_reg_t; + typedef std::pair<uint8_t, uint32_t> user_reg_t; virtual ~user_settings_core_200(void) = 0; diff --git a/host/lib/usrp/cores/user_settings_core_3000.cpp b/host/lib/usrp/cores/user_settings_core_3000.cpp index 549264f57..22d27cfbb 100644 --- a/host/lib/usrp/cores/user_settings_core_3000.cpp +++ b/host/lib/usrp/cores/user_settings_core_3000.cpp @@ -34,40 +34,40 @@ public: { } - void poke64(const wb_addr_type offset, const boost::uint64_t value) + void poke64(const wb_addr_type offset, const uint64_t value) { - if (offset % sizeof(boost::uint64_t) != 0) throw uhd::value_error("poke64: Incorrect address alignment"); - poke32(offset, static_cast<boost::uint32_t>(value)); - poke32(offset + 4, static_cast<boost::uint32_t>(value >> 32)); + if (offset % sizeof(uint64_t) != 0) throw uhd::value_error("poke64: Incorrect address alignment"); + poke32(offset, static_cast<uint32_t>(value)); + poke32(offset + 4, static_cast<uint32_t>(value >> 32)); } - boost::uint64_t peek64(const wb_addr_type offset) + uint64_t peek64(const wb_addr_type offset) { - if (offset % sizeof(boost::uint64_t) != 0) throw uhd::value_error("peek64: Incorrect address alignment"); + if (offset % sizeof(uint64_t) != 0) throw uhd::value_error("peek64: Incorrect address alignment"); boost::unique_lock<boost::mutex> lock(_mutex); _iface->poke32(REG_USER_RB_ADDR, offset >> 3); //Translate byte offset to 64-bit offset return _iface->peek64(_rb_reg_addr); } - void poke32(const wb_addr_type offset, const boost::uint32_t value) + void poke32(const wb_addr_type offset, const uint32_t value) { - if (offset % sizeof(boost::uint32_t) != 0) throw uhd::value_error("poke32: Incorrect address alignment"); + if (offset % sizeof(uint32_t) != 0) throw uhd::value_error("poke32: Incorrect address alignment"); boost::unique_lock<boost::mutex> lock(_mutex); _iface->poke32(REG_USER_SR_ADDR, offset >> 2); //Translate byte offset to 64-bit offset _iface->poke32(REG_USER_SR_DATA, value); } - boost::uint32_t peek32(const wb_addr_type offset) + uint32_t peek32(const wb_addr_type offset) { - if (offset % sizeof(boost::uint32_t) != 0) throw uhd::value_error("peek32: Incorrect address alignment"); + if (offset % sizeof(uint32_t) != 0) throw uhd::value_error("peek32: Incorrect address alignment"); - boost::uint64_t value = peek64((offset >> 3) << 3); + uint64_t value = peek64((offset >> 3) << 3); if ((offset & 0x7) == 0) { - return static_cast<boost::uint32_t>(value); + return static_cast<uint32_t>(value); } else { - return static_cast<boost::uint32_t>(value >> 32); + return static_cast<uint32_t>(value >> 32); } } diff --git a/host/lib/usrp/dboard/db_cbx.cpp b/host/lib/usrp/dboard/db_cbx.cpp index daf9a8dfd..c27cbf58a 100644 --- a/host/lib/usrp/dboard/db_cbx.cpp +++ b/host/lib/usrp/dboard/db_cbx.cpp @@ -38,9 +38,9 @@ sbx_xcvr::cbx::~cbx(void){ /* NOP */ } -void sbx_xcvr::cbx::write_lo_regs(dboard_iface::unit_t unit, const std::vector<boost::uint32_t> ®s) +void sbx_xcvr::cbx::write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s) { - BOOST_FOREACH(boost::uint32_t reg, regs) + BOOST_FOREACH(uint32_t reg, regs) { self_base->get_iface()->write_spi(unit, spi_config_t::EDGE_RISE, reg, 32); } diff --git a/host/lib/usrp/dboard/db_dbsrx.cpp b/host/lib/usrp/dboard/db_dbsrx.cpp index 6e1846fb8..f296820c5 100644 --- a/host/lib/usrp/dboard/db_dbsrx.cpp +++ b/host/lib/usrp/dboard/db_dbsrx.cpp @@ -74,7 +74,7 @@ private: uhd::dict<std::string, double> _gains; max2118_write_regs_t _max2118_write_regs; max2118_read_regs_t _max2118_read_regs; - boost::uint8_t _max2118_addr(void){ + uint8_t _max2118_addr(void){ return (this->get_iface()->get_special_props().mangle_i2c_addrs)? 0x65 : 0x67; }; @@ -82,12 +82,12 @@ private: double set_gain(double gain, const std::string &name); double set_bandwidth(double bandwidth); - void send_reg(boost::uint8_t start_reg, boost::uint8_t stop_reg){ - start_reg = boost::uint8_t(uhd::clip(int(start_reg), 0x0, 0x5)); - stop_reg = boost::uint8_t(uhd::clip(int(stop_reg), 0x0, 0x5)); + void send_reg(uint8_t start_reg, uint8_t stop_reg){ + start_reg = uint8_t(uhd::clip(int(start_reg), 0x0, 0x5)); + stop_reg = uint8_t(uhd::clip(int(stop_reg), 0x0, 0x5)); - for(boost::uint8_t start_addr=start_reg; start_addr <= stop_reg; start_addr += sizeof(boost::uint32_t) - 1){ - int num_bytes = int(stop_reg - start_addr + 1) > int(sizeof(boost::uint32_t)) - 1 ? sizeof(boost::uint32_t) - 1 : stop_reg - start_addr + 1; + for(uint8_t start_addr=start_reg; start_addr <= stop_reg; start_addr += sizeof(uint32_t) - 1){ + int num_bytes = int(stop_reg - start_addr + 1) > int(sizeof(uint32_t)) - 1 ? sizeof(uint32_t) - 1 : stop_reg - start_addr + 1; //create buffer for register data (+1 for start address) byte_vector_t regs_vector(num_bytes + 1); @@ -110,13 +110,13 @@ private: } } - void read_reg(boost::uint8_t start_reg, boost::uint8_t stop_reg){ - static const boost::uint8_t status_addr = 0x0; - start_reg = boost::uint8_t(uhd::clip(int(start_reg), 0x0, 0x1)); - stop_reg = boost::uint8_t(uhd::clip(int(stop_reg), 0x0, 0x1)); + void read_reg(uint8_t start_reg, uint8_t stop_reg){ + static const uint8_t status_addr = 0x0; + start_reg = uint8_t(uhd::clip(int(start_reg), 0x0, 0x1)); + stop_reg = uint8_t(uhd::clip(int(stop_reg), 0x0, 0x1)); - for(boost::uint8_t start_addr=start_reg; start_addr <= stop_reg; start_addr += sizeof(boost::uint32_t)){ - int num_bytes = int(stop_reg - start_addr + 1) > int(sizeof(boost::uint32_t)) ? sizeof(boost::uint32_t) : stop_reg - start_addr + 1; + for(uint8_t start_addr=start_reg; start_addr <= stop_reg; start_addr += sizeof(uint32_t)){ + int num_bytes = int(stop_reg - start_addr + 1) > int(sizeof(uint32_t)) ? sizeof(uint32_t) : stop_reg - start_addr + 1; //create buffer for register data byte_vector_t regs_vector(num_bytes); @@ -126,7 +126,7 @@ private: _max2118_addr(), num_bytes ); - for(boost::uint8_t i=0; i < num_bytes; i++){ + for(uint8_t i=0; i < num_bytes; i++){ if (i + start_addr >= status_addr){ _max2118_read_regs.set_reg(i + start_addr, regs_vector[i]); } diff --git a/host/lib/usrp/dboard/db_dbsrx2.cpp b/host/lib/usrp/dboard/db_dbsrx2.cpp index 11d706ed6..21b0fd02d 100644 --- a/host/lib/usrp/dboard/db_dbsrx2.cpp +++ b/host/lib/usrp/dboard/db_dbsrx2.cpp @@ -68,7 +68,7 @@ private: uhd::dict<std::string, double> _gains; max2112_write_regs_t _max2112_write_regs; max2112_read_regs_t _max2112_read_regs; - boost::uint8_t _max2112_addr(){ //0x60 or 0x61 depending on which side + uint8_t _max2112_addr(){ //0x60 or 0x61 depending on which side return (this->get_iface()->get_special_props().mangle_i2c_addrs)? 0x60 : 0x61; } @@ -76,12 +76,12 @@ private: double set_gain(double gain, const std::string &name); double set_bandwidth(double bandwidth); - void send_reg(boost::uint8_t start_reg, boost::uint8_t stop_reg){ - start_reg = boost::uint8_t(uhd::clip(int(start_reg), 0x0, 0xB)); - stop_reg = boost::uint8_t(uhd::clip(int(stop_reg), 0x0, 0xB)); + void send_reg(uint8_t start_reg, uint8_t stop_reg){ + start_reg = uint8_t(uhd::clip(int(start_reg), 0x0, 0xB)); + stop_reg = uint8_t(uhd::clip(int(stop_reg), 0x0, 0xB)); - for(boost::uint8_t start_addr=start_reg; start_addr <= stop_reg; start_addr += sizeof(boost::uint32_t) - 1){ - int num_bytes = int(stop_reg - start_addr + 1) > int(sizeof(boost::uint32_t)) - 1 ? sizeof(boost::uint32_t) - 1 : stop_reg - start_addr + 1; + for(uint8_t start_addr=start_reg; start_addr <= stop_reg; start_addr += sizeof(uint32_t) - 1){ + int num_bytes = int(stop_reg - start_addr + 1) > int(sizeof(uint32_t)) - 1 ? sizeof(uint32_t) - 1 : stop_reg - start_addr + 1; //create buffer for register data (+1 for start address) byte_vector_t regs_vector(num_bytes + 1); @@ -104,13 +104,13 @@ private: } } - void read_reg(boost::uint8_t start_reg, boost::uint8_t stop_reg){ - static const boost::uint8_t status_addr = 0xC; - start_reg = boost::uint8_t(uhd::clip(int(start_reg), 0x0, 0xD)); - stop_reg = boost::uint8_t(uhd::clip(int(stop_reg), 0x0, 0xD)); + void read_reg(uint8_t start_reg, uint8_t stop_reg){ + static const uint8_t status_addr = 0xC; + start_reg = uint8_t(uhd::clip(int(start_reg), 0x0, 0xD)); + stop_reg = uint8_t(uhd::clip(int(stop_reg), 0x0, 0xD)); - for(boost::uint8_t start_addr=start_reg; start_addr <= stop_reg; start_addr += sizeof(boost::uint32_t)){ - int num_bytes = int(stop_reg - start_addr + 1) > int(sizeof(boost::uint32_t)) ? sizeof(boost::uint32_t) : stop_reg - start_addr + 1; + for(uint8_t start_addr=start_reg; start_addr <= stop_reg; start_addr += sizeof(uint32_t)){ + int num_bytes = int(stop_reg - start_addr + 1) > int(sizeof(uint32_t)) ? sizeof(uint32_t) : stop_reg - start_addr + 1; //create address to start reading register data byte_vector_t address_vector(1); @@ -129,7 +129,7 @@ private: _max2112_addr(), num_bytes ); - for(boost::uint8_t i=0; i < num_bytes; i++){ + for(uint8_t i=0; i < num_bytes; i++){ if (i + start_addr >= status_addr){ _max2112_read_regs.set_reg(i + start_addr, regs_vector[i]); /* @@ -183,7 +183,7 @@ UHD_STATIC_BLOCK(reg_dbsrx2_dboard){ dbsrx2::dbsrx2(ctor_args_t args) : rx_dboard_base(args){ //send initial register settings send_reg(0x0, 0xB); - //for (boost::uint8_t addr=0; addr<=12; addr++) this->send_reg(addr, addr); + //for (uint8_t addr=0; addr<=12; addr++) this->send_reg(addr, addr); //////////////////////////////////////////////////////////////////// // Register properties diff --git a/host/lib/usrp/dboard/db_rfx.cpp b/host/lib/usrp/dboard/db_rfx.cpp index dbb1600ec..9bbd73425 100644 --- a/host/lib/usrp/dboard/db_rfx.cpp +++ b/host/lib/usrp/dboard/db_rfx.cpp @@ -86,7 +86,7 @@ private: const uhd::dict<dboard_iface::unit_t, bool> _div2; std::string _rx_ant; uhd::dict<std::string, double> _rx_gains; - boost::uint16_t _power_up; + uint16_t _power_up; void set_rx_ant(const std::string &ant); void set_tx_ant(const std::string &ant); @@ -241,7 +241,7 @@ rfx_xcvr::rfx_xcvr( this->get_iface()->set_clock_enabled(dboard_iface::UNIT_RX, true); //set the gpio directions and atr controls (identically) - boost::uint16_t output_enables = POWER_IO | ANTSW_IO | MIXER_IO; + uint16_t output_enables = POWER_IO | ANTSW_IO | MIXER_IO; this->get_iface()->set_pin_ctrl(dboard_iface::UNIT_TX, output_enables); this->get_iface()->set_pin_ctrl(dboard_iface::UNIT_RX, output_enables); this->get_iface()->set_gpio_ddr(dboard_iface::UNIT_TX, output_enables); diff --git a/host/lib/usrp/dboard/db_sbx_common.cpp b/host/lib/usrp/dboard/db_sbx_common.cpp index be02cf77a..efc84d7e6 100644 --- a/host/lib/usrp/dboard/db_sbx_common.cpp +++ b/host/lib/usrp/dboard/db_sbx_common.cpp @@ -150,7 +150,7 @@ sbx_xcvr::sbx_xcvr(ctor_args_t args) : xcvr_dboard_base(args){ //////////////////////////////////////////////////////////////////// this->get_rx_subtree()->create<device_addr_t>("tune_args").set(device_addr_t()); - boost::uint16_t rx_id = get_rx_id().to_uint16(); + uint16_t rx_id = get_rx_id().to_uint16(); if(rx_id == 0x0054) this->get_rx_subtree()->create<std::string>("name").set("SBXv3 RX"); else if(rx_id == 0x0065) this->get_rx_subtree()->create<std::string>("name").set("SBXv4 RX"); else if(rx_id == 0x0067) this->get_rx_subtree()->create<std::string>("name").set("CBX RX"); @@ -191,7 +191,7 @@ sbx_xcvr::sbx_xcvr(ctor_args_t args) : xcvr_dboard_base(args){ //////////////////////////////////////////////////////////////////// this->get_tx_subtree()->create<device_addr_t>("tune_args").set(device_addr_t()); - boost::uint16_t tx_id = get_tx_id().to_uint16(); + uint16_t tx_id = get_tx_id().to_uint16(); if(tx_id == 0x0055) this->get_tx_subtree()->create<std::string>("name").set("SBXv3 TX"); else if(tx_id == 0x0064) this->get_tx_subtree()->create<std::string>("name").set("SBXv4 TX"); else if(tx_id == 0x0066) this->get_tx_subtree()->create<std::string>("name").set("CBX TX"); diff --git a/host/lib/usrp/dboard/db_sbx_common.hpp b/host/lib/usrp/dboard/db_sbx_common.hpp index c0e29f263..ad64e2267 100644 --- a/host/lib/usrp/dboard/db_sbx_common.hpp +++ b/host/lib/usrp/dboard/db_sbx_common.hpp @@ -200,7 +200,7 @@ protected: private: adf435x_iface::sptr _txlo; adf435x_iface::sptr _rxlo; - void write_lo_regs(dboard_iface::unit_t unit, const std::vector<boost::uint32_t> ®s); + void write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s); }; /*! @@ -220,7 +220,7 @@ protected: private: adf435x_iface::sptr _txlo; adf435x_iface::sptr _rxlo; - void write_lo_regs(dboard_iface::unit_t unit, const std::vector<boost::uint32_t> ®s); + void write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s); }; /*! @@ -240,7 +240,7 @@ protected: /*! This is the registered instance of the wrapper class, sbx_base. */ sbx_xcvr *self_base; private: - void write_lo_regs(dboard_iface::unit_t unit, const std::vector<boost::uint32_t> ®s); + void write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s); max287x_iface::sptr _txlo; max287x_iface::sptr _rxlo; }; diff --git a/host/lib/usrp/dboard/db_sbx_version3.cpp b/host/lib/usrp/dboard/db_sbx_version3.cpp index 76ad7b04f..bb2ba6bd6 100644 --- a/host/lib/usrp/dboard/db_sbx_version3.cpp +++ b/host/lib/usrp/dboard/db_sbx_version3.cpp @@ -38,9 +38,9 @@ sbx_xcvr::sbx_version3::~sbx_version3(void){ /* NOP */ } -void sbx_xcvr::sbx_version3::write_lo_regs(dboard_iface::unit_t unit, const std::vector<boost::uint32_t> ®s) +void sbx_xcvr::sbx_version3::write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s) { - BOOST_FOREACH(boost::uint32_t reg, regs) + BOOST_FOREACH(uint32_t reg, regs) { self_base->get_iface()->write_spi(unit, spi_config_t::EDGE_RISE, reg, 32); } diff --git a/host/lib/usrp/dboard/db_sbx_version4.cpp b/host/lib/usrp/dboard/db_sbx_version4.cpp index 639bce250..e5b6e081c 100644 --- a/host/lib/usrp/dboard/db_sbx_version4.cpp +++ b/host/lib/usrp/dboard/db_sbx_version4.cpp @@ -39,9 +39,9 @@ sbx_xcvr::sbx_version4::~sbx_version4(void){ /* NOP */ } -void sbx_xcvr::sbx_version4::write_lo_regs(dboard_iface::unit_t unit, const std::vector<boost::uint32_t> ®s) +void sbx_xcvr::sbx_version4::write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s) { - BOOST_FOREACH(boost::uint32_t reg, regs) + BOOST_FOREACH(uint32_t reg, regs) { self_base->get_iface()->write_spi(unit, spi_config_t::EDGE_RISE, reg, 32); } diff --git a/host/lib/usrp/dboard/db_tvrx.cpp b/host/lib/usrp/dboard/db_tvrx.cpp index 0f84cd68a..5c0600c61 100644 --- a/host/lib/usrp/dboard/db_tvrx.cpp +++ b/host/lib/usrp/dboard/db_tvrx.cpp @@ -125,7 +125,7 @@ static uhd::dict<std::string, gain_range_t> get_tvrx_gain_ranges(void) { static const double opamp_gain = 1.22; //onboard DAC opamp gain static const double tvrx_if_freq = 43.75e6; //IF freq of TVRX module -static const boost::uint16_t reference_divider = 640; //clock reference divider to use +static const uint16_t reference_divider = 640; //clock reference divider to use static const double reference_freq = 4.0e6; /*********************************************************************** @@ -140,7 +140,7 @@ private: uhd::dict<std::string, double> _gains; double _lo_freq; tuner_4937di5_regs_t _tuner_4937di5_regs; - boost::uint8_t _tuner_4937di5_addr(void){ + uint8_t _tuner_4937di5_addr(void){ return (this->get_iface()->get_special_props().mangle_i2c_addrs)? 0x61 : 0x60; //ok really? we could rename that call }; @@ -271,7 +271,7 @@ static double gain_interp(double gain, const boost::array<double, 17>& db_vector double volts; gain = uhd::clip<double>(gain, db_vector.front(), db_vector.back()); //let's not get carried away here - boost::uint8_t gain_step = 0; + uint8_t gain_step = 0; //find which bin we're in for(size_t i = 0; i < db_vector.size()-1; i++) { if(gain >= db_vector[i] && gain <= db_vector[i+1]) gain_step = i; diff --git a/host/lib/usrp/dboard/db_tvrx2.cpp b/host/lib/usrp/dboard/db_tvrx2.cpp index 6f0604f72..1bac81153 100644 --- a/host/lib/usrp/dboard/db_tvrx2.cpp +++ b/host/lib/usrp/dboard/db_tvrx2.cpp @@ -77,32 +77,32 @@ using namespace boost::assign; * The TVRX2 types **********************************************************************/ struct tvrx2_tda18272_rfcal_result_t { - boost::int8_t delta_c; - boost::int8_t c_offset; + int8_t delta_c; + int8_t c_offset; tvrx2_tda18272_rfcal_result_t(void): delta_c(0), c_offset(0){} }; struct tvrx2_tda18272_rfcal_coeffs_t { - boost::uint8_t cal_number; - boost::int32_t RF_A1; - boost::int32_t RF_B1; + uint8_t cal_number; + int32_t RF_A1; + int32_t RF_B1; tvrx2_tda18272_rfcal_coeffs_t(void): cal_number(0), RF_A1(0), RF_B1(0) {} - tvrx2_tda18272_rfcal_coeffs_t(boost::uint32_t num): RF_A1(0), RF_B1(0) { cal_number = num; } + tvrx2_tda18272_rfcal_coeffs_t(uint32_t num): RF_A1(0), RF_B1(0) { cal_number = num; } }; struct tvrx2_tda18272_cal_map_t { - boost::array<boost::uint32_t, 4> cal_freq; - boost::array<boost::uint8_t, 4> c_offset; - tvrx2_tda18272_cal_map_t(boost::array<boost::uint32_t, 4> freqs, boost::array<boost::uint8_t, 4> offsets) + boost::array<uint32_t, 4> cal_freq; + boost::array<uint8_t, 4> c_offset; + tvrx2_tda18272_cal_map_t(boost::array<uint32_t, 4> freqs, boost::array<uint8_t, 4> offsets) { cal_freq = freqs; c_offset = offsets; } }; struct tvrx2_tda18272_freq_map_t { - boost::uint32_t rf_max; - boost::uint8_t c_prog; - boost::uint8_t gain_taper; - boost::uint8_t rf_band; - tvrx2_tda18272_freq_map_t( boost::uint32_t max, boost::uint8_t c, boost::uint8_t taper, boost::uint8_t band) + uint32_t rf_max; + uint8_t c_prog; + uint8_t gain_taper; + uint8_t rf_band; + tvrx2_tda18272_freq_map_t( uint32_t max, uint8_t c, uint8_t taper, uint8_t band) { rf_max = max; c_prog = c; gain_taper = taper; rf_band = band; } }; @@ -119,7 +119,7 @@ static const boost::array<freq_range_t, 4> tvrx2_tda18272_rf_bands = list_of #define TVRX2_TDA18272_FREQ_MAP_ENTRIES (565) -static const uhd::dict<boost::uint32_t, tvrx2_tda18272_cal_map_t> tvrx2_tda18272_cal_map = map_list_of +static const uhd::dict<uint32_t, tvrx2_tda18272_cal_map_t> tvrx2_tda18272_cal_map = map_list_of ( 0, tvrx2_tda18272_cal_map_t( list_of( 44032000)( 48128000)( 52224000)( 56320000), list_of(15)( 0)(10)(17) ) ) ( 1, tvrx2_tda18272_cal_map_t( list_of( 84992000)( 89088000)( 93184000)( 97280000), list_of( 1)( 0)(-2)( 3) ) ) ( 2, tvrx2_tda18272_cal_map_t( list_of(106496000)(111616000)(115712000)(123904000), list_of( 0)(-1)( 1)( 2) ) ) @@ -722,12 +722,12 @@ static const uhd::dict<std::string, std::string> tvrx2_sd_name_to_conn = map_lis ("RX2", "I") ; -static const uhd::dict<std::string, boost::uint8_t> tvrx2_sd_name_to_i2c_addr = map_list_of +static const uhd::dict<std::string, uint8_t> tvrx2_sd_name_to_i2c_addr = map_list_of ("RX1", 0x63) ("RX2", 0x60) ; -static const uhd::dict<std::string, boost::uint8_t> tvrx2_sd_name_to_irq_io = map_list_of +static const uhd::dict<std::string, uint8_t> tvrx2_sd_name_to_irq_io = map_list_of ("RX1", (RX1_IRQ)) ("RX2", (RX2_IRQ)) ; @@ -760,8 +760,8 @@ private: double _bandwidth; uhd::dict<std::string, double> _gains; tda18272hnm_regs_t _tda18272hnm_regs; - uhd::dict<boost::uint32_t, tvrx2_tda18272_rfcal_result_t> _rfcal_results; - uhd::dict<boost::uint32_t, tvrx2_tda18272_rfcal_coeffs_t> _rfcal_coeffs; + uhd::dict<uint32_t, tvrx2_tda18272_rfcal_result_t> _rfcal_results; + uhd::dict<uint32_t, tvrx2_tda18272_rfcal_coeffs_t> _rfcal_coeffs; bool _enabled; @@ -775,12 +775,12 @@ private: double get_scaled_rf_freq(void); void set_scaled_if_freq(double if_freq); double get_scaled_if_freq(void); - void send_reg(boost::uint8_t start_reg, boost::uint8_t stop_reg); - void read_reg(boost::uint8_t start_reg, boost::uint8_t stop_reg); + void send_reg(uint8_t start_reg, uint8_t stop_reg); + void read_reg(uint8_t start_reg, uint8_t stop_reg); - freq_range_t get_tda18272_rfcal_result_freq_range(boost::uint32_t result); + freq_range_t get_tda18272_rfcal_result_freq_range(uint32_t result); void tvrx2_tda18272_init_rfcal(void); - void tvrx2_tda18272_tune_rf_filter(boost::uint32_t uRF); + void tvrx2_tda18272_tune_rf_filter(uint32_t uRF); void soft_calibration(void); void transition_0(void); void transition_1(void); @@ -1103,7 +1103,7 @@ tvrx2::~tvrx2(void){ * TDA18272 Register IO Functions **********************************************************************/ void tvrx2::set_scaled_rf_freq(double rf_freq){ - _tda18272hnm_regs.set_rf_freq(boost::uint32_t(_freq_scalar*rf_freq/1e3)); + _tda18272hnm_regs.set_rf_freq(uint32_t(_freq_scalar*rf_freq/1e3)); } double tvrx2::get_scaled_rf_freq(void){ @@ -1118,12 +1118,12 @@ double tvrx2::get_scaled_if_freq(void){ return _tda18272hnm_regs.if_freq*50e3/_freq_scalar; } -void tvrx2::send_reg(boost::uint8_t start_reg, boost::uint8_t stop_reg){ - start_reg = boost::uint8_t(uhd::clip(int(start_reg), 0x0, 0x43)); - stop_reg = boost::uint8_t(uhd::clip(int(stop_reg), 0x0, 0x43)); +void tvrx2::send_reg(uint8_t start_reg, uint8_t stop_reg){ + start_reg = uint8_t(uhd::clip(int(start_reg), 0x0, 0x43)); + stop_reg = uint8_t(uhd::clip(int(stop_reg), 0x0, 0x43)); - for(boost::uint8_t start_addr=start_reg; start_addr <= stop_reg; start_addr += sizeof(boost::uint32_t) - 1){ - int num_bytes = int(stop_reg - start_addr + 1) > int(sizeof(boost::uint32_t)) - 1 ? sizeof(boost::uint32_t) - 1 : stop_reg - start_addr + 1; + for(uint8_t start_addr=start_reg; start_addr <= stop_reg; start_addr += sizeof(uint32_t) - 1){ + int num_bytes = int(stop_reg - start_addr + 1) > int(sizeof(uint32_t)) - 1 ? sizeof(uint32_t) - 1 : stop_reg - start_addr + 1; //create buffer for register data (+1 for start address) byte_vector_t regs_vector(num_bytes + 1); @@ -1146,13 +1146,13 @@ void tvrx2::send_reg(boost::uint8_t start_reg, boost::uint8_t stop_reg){ } } -void tvrx2::read_reg(boost::uint8_t start_reg, boost::uint8_t stop_reg){ - static const boost::uint8_t status_addr = 0x0; - start_reg = boost::uint8_t(uhd::clip(int(start_reg), 0x0, 0x43)); - stop_reg = boost::uint8_t(uhd::clip(int(stop_reg), 0x0, 0x43)); +void tvrx2::read_reg(uint8_t start_reg, uint8_t stop_reg){ + static const uint8_t status_addr = 0x0; + start_reg = uint8_t(uhd::clip(int(start_reg), 0x0, 0x43)); + stop_reg = uint8_t(uhd::clip(int(stop_reg), 0x0, 0x43)); - for(boost::uint8_t start_addr=start_reg; start_addr <= stop_reg; start_addr += sizeof(boost::uint32_t)){ - int num_bytes = int(stop_reg - start_addr + 1) > int(sizeof(boost::uint32_t)) ? sizeof(boost::uint32_t) : stop_reg - start_addr + 1; + for(uint8_t start_addr=start_reg; start_addr <= stop_reg; start_addr += sizeof(uint32_t)){ + int num_bytes = int(stop_reg - start_addr + 1) > int(sizeof(uint32_t)) ? sizeof(uint32_t) : stop_reg - start_addr + 1; //create buffer for starting address byte_vector_t start_address_vector(1); @@ -1173,7 +1173,7 @@ void tvrx2::read_reg(boost::uint8_t start_reg, boost::uint8_t stop_reg){ tvrx2_sd_name_to_i2c_addr[get_subdev_name()], num_bytes ); - for(boost::uint8_t i=0; i < num_bytes; i++){ + for(uint8_t i=0; i < num_bytes; i++){ if (i + start_addr >= status_addr){ _tda18272hnm_regs.set_reg(i + start_addr, regs_vector[i]); } @@ -1188,10 +1188,10 @@ void tvrx2::read_reg(boost::uint8_t start_reg, boost::uint8_t stop_reg){ /*********************************************************************** * TDA18272 Calibration Functions **********************************************************************/ -freq_range_t tvrx2::get_tda18272_rfcal_result_freq_range(boost::uint32_t result) +freq_range_t tvrx2::get_tda18272_rfcal_result_freq_range(uint32_t result) { - uhd::dict<boost::uint32_t, freq_range_t> result_to_cal_freq_ranges_map = map_list_of + uhd::dict<uint32_t, freq_range_t> result_to_cal_freq_ranges_map = map_list_of ( 0, freq_range_t( (double) tvrx2_tda18272_cal_map[0].cal_freq[_tda18272hnm_regs.rfcal_freq0] * _freq_scalar, (double) tvrx2_tda18272_cal_map[1].cal_freq[_tda18272hnm_regs.rfcal_freq1] * _freq_scalar @@ -1254,7 +1254,7 @@ void tvrx2::tvrx2_tda18272_init_rfcal(void) /* read byte 0x38-0x43 */ read_reg(0x38, 0x43); - uhd::dict<boost::uint32_t, boost::uint8_t> result_to_cal_regs = map_list_of + uhd::dict<uint32_t, uint8_t> result_to_cal_regs = map_list_of ( 0, _tda18272hnm_regs.rfcal_log_1) ( 1, _tda18272hnm_regs.rfcal_log_2) ( 2, _tda18272hnm_regs.rfcal_log_3) @@ -1271,27 +1271,27 @@ void tvrx2::tvrx2_tda18272_init_rfcal(void) // Loop through rfcal_log_* registers, initialize _rfcal_results - BOOST_FOREACH(const boost::uint32_t &result, result_to_cal_regs.keys()) + BOOST_FOREACH(const uint32_t &result, result_to_cal_regs.keys()) _rfcal_results[result].delta_c = result_to_cal_regs[result] > 63 ? result_to_cal_regs[result] - 128 : result_to_cal_regs[result]; /* read byte 0x26-0x2B */ read_reg(0x26, 0x2B); // Loop through rfcal_byte_* registers, initialize _rfcal_coeffs - BOOST_FOREACH(const boost::uint32_t &subband, _rfcal_coeffs.keys()) + BOOST_FOREACH(const uint32_t &subband, _rfcal_coeffs.keys()) { freq_range_t subband_freqs; - boost::uint32_t result = _rfcal_coeffs[subband].cal_number; + uint32_t result = _rfcal_coeffs[subband].cal_number; subband_freqs = get_tda18272_rfcal_result_freq_range(result); _rfcal_coeffs[subband].RF_B1 = _rfcal_results[result].delta_c + tvrx2_tda18272_cal_map[result].c_offset[_rfcal_results[result].c_offset]; - boost::uint32_t quotient = (((_rfcal_results[result+1].delta_c + tvrx2_tda18272_cal_map[result+1].c_offset[_rfcal_results[result].c_offset]) + uint32_t quotient = (((_rfcal_results[result+1].delta_c + tvrx2_tda18272_cal_map[result+1].c_offset[_rfcal_results[result].c_offset]) - (_rfcal_results[result].delta_c + tvrx2_tda18272_cal_map[result].c_offset[_rfcal_results[result].c_offset])) * 1000000); - boost::uint32_t divisor = ((boost::int32_t)(subband_freqs.stop() - subband_freqs.start())/1000); + uint32_t divisor = ((int32_t)(subband_freqs.stop() - subband_freqs.start())/1000); _rfcal_coeffs[subband].RF_A1 = quotient / divisor; @@ -1302,27 +1302,27 @@ void tvrx2::tvrx2_tda18272_init_rfcal(void) /* * Apply calibration coefficients to RF Filter tuning */ -void tvrx2::tvrx2_tda18272_tune_rf_filter(boost::uint32_t uRF) +void tvrx2::tvrx2_tda18272_tune_rf_filter(uint32_t uRF) { - boost::uint32_t uCounter = 0; - boost::uint8_t cal_result = 0; - boost::uint32_t uRFCal0 = 0; - boost::uint32_t uRFCal1 = 0; - boost::uint8_t subband = 0; - boost::int32_t cProg = 0; - boost::uint8_t gain_taper = 0; - boost::uint8_t RFBand = 0; - boost::int32_t RF_A1 = 0; - boost::int32_t RF_B1 = 0; + uint32_t uCounter = 0; + uint8_t cal_result = 0; + uint32_t uRFCal0 = 0; + uint32_t uRFCal1 = 0; + uint8_t subband = 0; + int32_t cProg = 0; + uint8_t gain_taper = 0; + uint8_t RFBand = 0; + int32_t RF_A1 = 0; + int32_t RF_B1 = 0; freq_range_t subband_freqs; /* read byte 0x26-0x2B */ read_reg(0x26, 0x2B); subband_freqs = get_tda18272_rfcal_result_freq_range(1); - uRFCal0 = boost::uint32_t(subband_freqs.start()); + uRFCal0 = uint32_t(subband_freqs.start()); subband_freqs = get_tda18272_rfcal_result_freq_range(4); - uRFCal1 = boost::uint32_t(subband_freqs.start()); + uRFCal1 = uint32_t(subband_freqs.start()); if(uRF < uRFCal0) subband = 0; @@ -1335,9 +1335,9 @@ void tvrx2::tvrx2_tda18272_tune_rf_filter(boost::uint32_t uRF) else { subband_freqs = get_tda18272_rfcal_result_freq_range(7); - uRFCal0 = boost::uint32_t(subband_freqs.start()); + uRFCal0 = uint32_t(subband_freqs.start()); subband_freqs = get_tda18272_rfcal_result_freq_range(10); - uRFCal1 = boost::uint32_t(subband_freqs.start()); + uRFCal1 = uint32_t(subband_freqs.start()); if(uRF < uRFCal0) subband = 4; @@ -1351,7 +1351,7 @@ void tvrx2::tvrx2_tda18272_tune_rf_filter(boost::uint32_t uRF) cal_result = _rfcal_coeffs[subband].cal_number; subband_freqs = get_tda18272_rfcal_result_freq_range(cal_result); - uRFCal0 = boost::uint32_t(subband_freqs.start()); + uRFCal0 = uint32_t(subband_freqs.start()); RF_A1 = _rfcal_coeffs[subband].RF_A1; RF_B1 = _rfcal_coeffs[subband].RF_B1; @@ -1364,13 +1364,13 @@ void tvrx2::tvrx2_tda18272_tune_rf_filter(boost::uint32_t uRF) gain_taper = tvrx2_tda18272_freq_map[uCounter - 1].gain_taper; RFBand = tvrx2_tda18272_freq_map[uCounter - 1].rf_band; - cProg = (boost::int32_t)(cProg + RF_B1 + (RF_A1*((boost::int32_t)(uRF - uRFCal0)/1000))/1000000); + cProg = (int32_t)(cProg + RF_B1 + (RF_A1*((int32_t)(uRF - uRFCal0)/1000))/1000000); if(cProg>255) cProg = 255; if(cProg<0) cProg = 0; _tda18272hnm_regs.rf_filter_bypass = 1; - _tda18272hnm_regs.rf_filter_cap = (boost::uint8_t) cProg; + _tda18272hnm_regs.rf_filter_cap = (uint8_t) cProg; _tda18272hnm_regs.gain_taper = gain_taper; _tda18272hnm_regs.rf_filter_band = RFBand; @@ -1462,7 +1462,7 @@ void tvrx2::test_rf_filter_robustness(void){ read_reg(0x38, 0x43); - uhd::dict<std::string, boost::uint8_t> filter_cal_regs = map_list_of + uhd::dict<std::string, uint8_t> filter_cal_regs = map_list_of ("VHFLow_0", 0x38) ("VHFLow_1", 0x3a) ("VHFHigh_0", 0x3b) @@ -1474,7 +1474,7 @@ void tvrx2::test_rf_filter_robustness(void){ ; BOOST_FOREACH(const std::string &name, filter_cal_regs.keys()){ - boost::uint8_t cal_result = _tda18272hnm_regs.get_reg(filter_cal_regs[name]); + uint8_t cal_result = _tda18272hnm_regs.get_reg(filter_cal_regs[name]); if (cal_result & 0x80) { _filter_ratings.set(name, "E"); _filter_margins.set(name, 0.0); diff --git a/host/lib/usrp/dboard/db_twinrx.cpp b/host/lib/usrp/dboard/db_twinrx.cpp index 477412de0..2af6bc4ff 100644 --- a/host/lib/usrp/dboard/db_twinrx.cpp +++ b/host/lib/usrp/dboard/db_twinrx.cpp @@ -39,6 +39,7 @@ using namespace uhd::usrp::dboard::twinrx; using namespace uhd::experts; static const dboard_id_t TWINRX_V100_000_ID(0x91); +static const dboard_id_t TWINRX_V100_100_ID(0x93); /*! * twinrx_rcvr_fe is the dbaord class (dboard_base) that @@ -170,13 +171,13 @@ public: prepend_ch("ch/preamp2", _ch_name), false); expert_factory::add_data_node<bool>(_expert, prepend_ch("ant/preamp2", _ch_name), false); - expert_factory::add_data_node<boost::uint8_t>(_expert, + expert_factory::add_data_node<uint8_t>(_expert, prepend_ch("ch/input_atten", _ch_name), 0); - expert_factory::add_data_node<boost::uint8_t>(_expert, + expert_factory::add_data_node<uint8_t>(_expert, prepend_ch("ant/input_atten", _ch_name), 0); - expert_factory::add_data_node<boost::uint8_t>(_expert, + expert_factory::add_data_node<uint8_t>(_expert, prepend_ch("ch/lb_atten", _ch_name), 0); - expert_factory::add_data_node<boost::uint8_t>(_expert, + expert_factory::add_data_node<uint8_t>(_expert, prepend_ch("ch/hb_atten", _ch_name), 0); expert_factory::add_data_node<twinrx_ctrl::lo_source_t>(_expert, prepend_ch("ch/LO1/source", _ch_name), twinrx_ctrl::LO_INTERNAL); @@ -340,4 +341,12 @@ UHD_STATIC_BLOCK(reg_twinrx_dboards) boost::assign::list_of("0")("1"), &make_twinrx_container ); + + dboard_manager::register_dboard_restricted( + TWINRX_V100_100_ID, + &twinrx_rcvr::make_twinrx_fe, + "TwinRX v1.1", + boost::assign::list_of("0")("1"), + &make_twinrx_container + ); } diff --git a/host/lib/usrp/dboard/db_wbx_common.cpp b/host/lib/usrp/dboard/db_wbx_common.cpp index 6539e798a..5afbb1f88 100644 --- a/host/lib/usrp/dboard/db_wbx_common.cpp +++ b/host/lib/usrp/dboard/db_wbx_common.cpp @@ -65,7 +65,7 @@ wbx_base::wbx_base(ctor_args_t args) : xcvr_dboard_base(args){ //////////////////////////////////////////////////////////////////// // Register RX and TX properties //////////////////////////////////////////////////////////////////// - boost::uint16_t rx_id = this->get_rx_id().to_uint16(); + uint16_t rx_id = this->get_rx_id().to_uint16(); this->get_rx_subtree()->create<device_addr_t>("tune_args").set(device_addr_t()); this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked") @@ -139,7 +139,7 @@ void wbx_base::set_rx_enabled(bool enb){ double wbx_base::set_rx_gain(double gain, const std::string &name){ assert_has(wbx_rx_gain_ranges.keys(), name, "wbx rx gain name"); if(name == "PGA0"){ - boost::uint16_t io_bits = rx_pga0_gain_to_iobits(gain); + uint16_t io_bits = rx_pga0_gain_to_iobits(gain); _rx_gains[name] = gain; //write the new gain to rx gpio outputs @@ -157,8 +157,8 @@ sensor_value_t wbx_base::get_locked(dboard_iface::unit_t unit){ return sensor_value_t("LO", locked, "locked", "unlocked"); } -void wbx_base::wbx_versionx::write_lo_regs(dboard_iface::unit_t unit, const std::vector<boost::uint32_t> ®s) { - BOOST_FOREACH(boost::uint32_t reg, regs) { +void wbx_base::wbx_versionx::write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s) { + BOOST_FOREACH(uint32_t reg, regs) { self_base->get_iface()->write_spi(unit, spi_config_t::EDGE_RISE, reg, 32); } } diff --git a/host/lib/usrp/dboard/db_wbx_common.hpp b/host/lib/usrp/dboard/db_wbx_common.hpp index 0e339e4a3..a6b2ca852 100644 --- a/host/lib/usrp/dboard/db_wbx_common.hpp +++ b/host/lib/usrp/dboard/db_wbx_common.hpp @@ -153,7 +153,7 @@ protected: adf435x_iface::sptr _txlo; adf435x_iface::sptr _rxlo; - void write_lo_regs(dboard_iface::unit_t unit, const std::vector<boost::uint32_t> ®s); + void write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s); }; diff --git a/host/lib/usrp/dboard/db_wbx_version3.cpp b/host/lib/usrp/dboard/db_wbx_version3.cpp index 4dcf3bb71..1bd326e6f 100644 --- a/host/lib/usrp/dboard/db_wbx_version3.cpp +++ b/host/lib/usrp/dboard/db_wbx_version3.cpp @@ -175,7 +175,7 @@ void wbx_base::wbx_version3::set_tx_enabled(bool enb){ double wbx_base::wbx_version3::set_tx_gain(double gain, const std::string &name){ assert_has(wbx_v3_tx_gain_ranges.keys(), name, "wbx tx gain name"); if(name == "PGA0"){ - boost::uint16_t io_bits = tx_pga0_gain_to_iobits(gain); + uint16_t io_bits = tx_pga0_gain_to_iobits(gain); self_base->_tx_gains[name] = gain; diff --git a/host/lib/usrp/dboard/db_wbx_version4.cpp b/host/lib/usrp/dboard/db_wbx_version4.cpp index dc351af1d..3cc0f1887 100644 --- a/host/lib/usrp/dboard/db_wbx_version4.cpp +++ b/host/lib/usrp/dboard/db_wbx_version4.cpp @@ -87,7 +87,7 @@ wbx_base::wbx_version4::wbx_version4(wbx_base *_self_wbx_base) { //////////////////////////////////////////////////////////////////// // Register RX properties //////////////////////////////////////////////////////////////////// - boost::uint16_t rx_id = _self_wbx_base->get_rx_id().to_uint16(); + uint16_t rx_id = _self_wbx_base->get_rx_id().to_uint16(); if(rx_id == 0x0063) this->get_rx_subtree()->create<std::string>("name").set("WBXv4 RX"); else if(rx_id == 0x0081) this->get_rx_subtree()->create<std::string>("name").set("WBX-120 RX"); @@ -182,7 +182,7 @@ void wbx_base::wbx_version4::set_tx_enabled(bool enb) { double wbx_base::wbx_version4::set_tx_gain(double gain, const std::string &name) { assert_has(wbx_v4_tx_gain_ranges.keys(), name, "wbx tx gain name"); if(name == "PGA0"){ - boost::uint16_t io_bits = tx_pga0_gain_to_iobits(gain); + uint16_t io_bits = tx_pga0_gain_to_iobits(gain); self_base->_tx_gains[name] = gain; diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp index 0f839b03e..6876ee4be 100644 --- a/host/lib/usrp/dboard/db_xcvr2450.cpp +++ b/host/lib/usrp/dboard/db_xcvr2450.cpp @@ -133,8 +133,8 @@ private: void update_atr(void); void spi_reset(void); - void send_reg(boost::uint8_t addr){ - boost::uint32_t value = _max2829_regs.get_reg(addr); + void send_reg(uint8_t addr){ + uint32_t value = _max2829_regs.get_reg(addr); UHD_LOGV(often) << boost::format( "XCVR2450: send reg 0x%02x, value 0x%05x" ) % int(addr) % value << std::endl; @@ -221,7 +221,7 @@ xcvr2450::xcvr2450(ctor_args_t args) : xcvr_dboard_base(args){ _max2829_regs.tx_upconv_linearity = max2829_regs_t::TX_UPCONV_LINEARITY_78; //send initial register settings - for(boost::uint8_t reg = 0x2; reg <= 0xC; reg++){ + for(uint8_t reg = 0x2; reg <= 0xC; reg++){ this->send_reg(reg); } diff --git a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp index 172992f0a..dfbea9917 100644 --- a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp +++ b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp @@ -27,7 +27,7 @@ using namespace usrp; using namespace dboard::twinrx; typedef twinrx_cpld_regmap rm; -static boost::uint32_t bool2bin(bool x) { return x ? 1 : 0; } +static uint32_t bool2bin(bool x) { return x ? 1 : 0; } static const double TWINRX_DESIRED_REFERENCE_FREQ = 50e6; @@ -224,7 +224,7 @@ public: void set_lb_preselector(channel_t ch, preselector_path_t path, bool commit = true) { boost::lock_guard<boost::mutex> lock(_mutex); - boost::uint32_t sw7val = 0, sw8val = 0; + uint32_t sw7val = 0, sw8val = 0; switch (path) { case PRESEL_PATH1: sw7val = 3; sw8val = 1; break; case PRESEL_PATH2: sw7val = 2; sw8val = 0; break; @@ -246,7 +246,7 @@ public: void set_hb_preselector(channel_t ch, preselector_path_t path, bool commit = true) { boost::lock_guard<boost::mutex> lock(_mutex); - boost::uint32_t sw9ch1val = 0, sw10ch1val = 0, sw9ch2val = 0, sw10ch2val = 0; + uint32_t sw9ch1val = 0, sw10ch1val = 0, sw9ch2val = 0, sw10ch2val = 0; switch (path) { case PRESEL_PATH1: sw9ch1val = 3; sw10ch1val = 0; sw9ch2val = 0; sw10ch2val = 3; break; case PRESEL_PATH2: sw9ch1val = 1; sw10ch1val = 2; sw9ch2val = 1; sw10ch2val = 1; break; @@ -266,7 +266,7 @@ public: } - void set_input_atten(channel_t ch, boost::uint8_t atten, bool commit = true) + void set_input_atten(channel_t ch, uint8_t atten, bool commit = true) { boost::lock_guard<boost::mutex> lock(_mutex); if (ch == CH1 or ch == BOTH) { @@ -278,7 +278,7 @@ public: if (commit) _commit(); } - void set_lb_atten(channel_t ch, boost::uint8_t atten, bool commit = true) + void set_lb_atten(channel_t ch, uint8_t atten, bool commit = true) { boost::lock_guard<boost::mutex> lock(_mutex); if (ch == CH1 or ch == BOTH) { @@ -290,7 +290,7 @@ public: if (commit) _commit(); } - void set_hb_atten(channel_t ch, boost::uint8_t atten, bool commit = true) + void set_hb_atten(channel_t ch, uint8_t atten, bool commit = true) { boost::lock_guard<boost::mutex> lock(_mutex); if (ch == CH1 or ch == BOTH) { @@ -502,9 +502,9 @@ private: //Functions _cpld_regs->if0_reg2.flush(); } - void _write_lo_spi(dboard_iface::unit_t unit, const std::vector<boost::uint32_t> ®s) + void _write_lo_spi(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s) { - BOOST_FOREACH(boost::uint32_t reg, regs) { + BOOST_FOREACH(uint32_t reg, regs) { spi_config_t spi_config = spi_config_t(spi_config_t::EDGE_RISE); spi_config.use_custom_divider = true; spi_config.divider = 67; diff --git a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.hpp b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.hpp index 521e27ae9..5537d00ab 100644 --- a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.hpp +++ b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.hpp @@ -69,11 +69,11 @@ public: virtual void set_hb_preselector(channel_t ch, preselector_path_t path, bool commit = true) = 0; - virtual void set_input_atten(channel_t ch, boost::uint8_t atten, bool commit = true) = 0; + virtual void set_input_atten(channel_t ch, uint8_t atten, bool commit = true) = 0; - virtual void set_lb_atten(channel_t ch, boost::uint8_t atten, bool commit = true) = 0; + virtual void set_lb_atten(channel_t ch, uint8_t atten, bool commit = true) = 0; - virtual void set_hb_atten(channel_t ch, boost::uint8_t atten, bool commit = true) = 0; + virtual void set_hb_atten(channel_t ch, uint8_t atten, bool commit = true) = 0; virtual void set_lo1_source(channel_t ch, lo_source_t source, bool commit = true) = 0; diff --git a/host/lib/usrp/dboard/twinrx/twinrx_experts.hpp b/host/lib/usrp/dboard/twinrx/twinrx_experts.hpp index 9c83dbfa8..7b85137e1 100644 --- a/host/lib/usrp/dboard/twinrx/twinrx_experts.hpp +++ b/host/lib/usrp/dboard/twinrx/twinrx_experts.hpp @@ -436,9 +436,9 @@ private: experts::data_reader_t<twinrx_ctrl::preselector_path_t> _hb_presel; experts::data_reader_t<twinrx_ctrl::antenna_mapping_t> _ant_mapping; //Outputs - experts::data_writer_t<boost::uint8_t> _input_atten; - experts::data_writer_t<boost::uint8_t> _lb_atten; - experts::data_writer_t<boost::uint8_t> _hb_atten; + experts::data_writer_t<uint8_t> _input_atten; + experts::data_writer_t<uint8_t> _lb_atten; + experts::data_writer_t<uint8_t> _hb_atten; experts::data_writer_t<twinrx_ctrl::preamp_state_t> _preamp1; experts::data_writer_t<bool> _preamp2; }; @@ -499,21 +499,21 @@ private: //Inputs experts::data_reader_t<twinrx_ctrl::antenna_mapping_t> _ant_mapping; - experts::data_reader_t<boost::uint8_t> _ch0_input_atten; + experts::data_reader_t<uint8_t> _ch0_input_atten; experts::data_reader_t<twinrx_ctrl::preamp_state_t> _ch0_preamp1; experts::data_reader_t<bool> _ch0_preamp2; experts::data_reader_t<bool> _ch0_lb_preamp_presel; - experts::data_reader_t<boost::uint8_t> _ch1_input_atten; + experts::data_reader_t<uint8_t> _ch1_input_atten; experts::data_reader_t<twinrx_ctrl::preamp_state_t> _ch1_preamp1; experts::data_reader_t<bool> _ch1_preamp2; experts::data_reader_t<bool> _ch1_lb_preamp_presel; //Outputs - experts::data_writer_t<boost::uint8_t> _ant0_input_atten; + experts::data_writer_t<uint8_t> _ant0_input_atten; experts::data_writer_t<twinrx_ctrl::preamp_state_t> _ant0_preamp1; experts::data_writer_t<bool> _ant0_preamp2; experts::data_writer_t<bool> _ant0_lb_preamp_presel; - experts::data_writer_t<boost::uint8_t> _ant1_input_atten; + experts::data_writer_t<uint8_t> _ant1_input_atten; experts::data_writer_t<twinrx_ctrl::preamp_state_t> _ant1_preamp1; experts::data_writer_t<bool> _ant1_preamp2; experts::data_writer_t<bool> _ant1_lb_preamp_presel; @@ -623,9 +623,9 @@ private: experts::data_reader_t<twinrx_ctrl::signal_path_t> signal_path; experts::data_reader_t<twinrx_ctrl::preselector_path_t> lb_presel; experts::data_reader_t<twinrx_ctrl::preselector_path_t> hb_presel; - experts::data_reader_t<boost::uint8_t> input_atten; - experts::data_reader_t<boost::uint8_t> lb_atten; - experts::data_reader_t<boost::uint8_t> hb_atten; + experts::data_reader_t<uint8_t> input_atten; + experts::data_reader_t<uint8_t> lb_atten; + experts::data_reader_t<uint8_t> hb_atten; experts::data_reader_t<twinrx_ctrl::lo_source_t> lo1_source; experts::data_reader_t<twinrx_ctrl::lo_source_t> lo2_source; experts::data_reader_t<double> lo1_freq_d; diff --git a/host/lib/usrp/dboard/twinrx/twinrx_gain_tables.hpp b/host/lib/usrp/dboard/twinrx/twinrx_gain_tables.hpp index 0148965da..8ebab4243 100644 --- a/host/lib/usrp/dboard/twinrx/twinrx_gain_tables.hpp +++ b/host/lib/usrp/dboard/twinrx/twinrx_gain_tables.hpp @@ -19,7 +19,7 @@ #define INCLUDED_DBOARD_TWINRX_GAIN_TABLES_HPP #include <uhd/config.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <uhd/types/ranges.hpp> #include "twinrx_ctrl.hpp" @@ -29,7 +29,7 @@ class twinrx_gain_config_t { public: twinrx_gain_config_t( size_t index_, double sys_gain_, - boost::uint8_t atten1_, boost::uint8_t atten2_, + uint8_t atten1_, uint8_t atten2_, bool amp1_, bool amp2_ ): index(index_), sys_gain(sys_gain_), atten1(atten1_), atten2(atten2_), amp1(amp1_), amp2(amp2_) @@ -49,8 +49,8 @@ public: size_t index; double sys_gain; - boost::uint8_t atten1; - boost::uint8_t atten2; + uint8_t atten1; + uint8_t atten2; bool amp1; bool amp2; }; diff --git a/host/lib/usrp/dboard/twinrx/twinrx_io.hpp b/host/lib/usrp/dboard/twinrx/twinrx_io.hpp index 5d099e361..4fa5a22d5 100644 --- a/host/lib/usrp/dboard/twinrx/twinrx_io.hpp +++ b/host/lib/usrp/dboard/twinrx/twinrx_io.hpp @@ -26,13 +26,13 @@ namespace uhd { namespace usrp { namespace dboard { namespace twinrx { -static const boost::uint32_t SET_ALL_BITS = 0xFFFFFFFF; +static const uint32_t SET_ALL_BITS = 0xFFFFFFFF; namespace cpld { -static wb_iface::wb_addr_type addr(boost::uint8_t cpld_num, boost::uint8_t cpld_addr) { +static wb_iface::wb_addr_type addr(uint8_t cpld_num, uint8_t cpld_addr) { //Decode CPLD addressing for the following bitmap: // {CPLD1_EN, CPLD2_EN, CPLD3_EN, CPLD4_EN, CPLD_ADDR[2:0]} - boost::uint8_t addr = 0; + uint8_t addr = 0; switch (cpld_num) { case 1: addr = 0x8 << 3; break; case 2: addr = 0x4 << 3; break; @@ -43,8 +43,8 @@ static wb_iface::wb_addr_type addr(boost::uint8_t cpld_num, boost::uint8_t cpld_ return static_cast<wb_iface::wb_addr_type>(addr | (cpld_addr & 0x7)); } -static boost::uint32_t get_reg(wb_iface::wb_addr_type addr) { - return static_cast<boost::uint32_t>(addr) & 0x7; +static uint32_t get_reg(wb_iface::wb_addr_type addr) { + return static_cast<uint32_t>(addr) & 0x7; } } @@ -84,37 +84,37 @@ public: _db_iface->set_gpio_ddr(dboard_iface::UNIT_BOTH, ~GPIO_OUTPUT_MASK, SET_ALL_BITS); } - void set_field(const uhd::soft_reg_field_t field, const boost::uint32_t value) { + void set_field(const uhd::soft_reg_field_t field, const uint32_t value) { boost::lock_guard<boost::mutex> lock(_mutex); using namespace soft_reg_field; _db_iface->set_gpio_out(dboard_iface::UNIT_BOTH, (value << shift(field)), - mask<boost::uint32_t>(field)); + mask<uint32_t>(field)); } - boost::uint32_t get_field(const uhd::soft_reg_field_t field) { + uint32_t get_field(const uhd::soft_reg_field_t field) { boost::lock_guard<boost::mutex> lock(_mutex); using namespace soft_reg_field; - return (_db_iface->read_gpio(dboard_iface::UNIT_BOTH) & mask<boost::uint32_t>(field)) >> shift(field); + return (_db_iface->read_gpio(dboard_iface::UNIT_BOTH) & mask<uint32_t>(field)) >> shift(field); } // CPLD register write-only interface - void poke32(const wb_addr_type addr, const boost::uint32_t data) { + void poke32(const wb_addr_type addr, const uint32_t data) { boost::lock_guard<boost::mutex> lock(_mutex); using namespace soft_reg_field; //Step 1: Write the reg offset and data to the GPIO bus and de-assert all enables _db_iface->set_gpio_out(dboard_iface::UNIT_BOTH, (cpld::get_reg(addr) << shift(CPLD_FULL_ADDR)) | (data << shift(CPLD_DATA)), - mask<boost::uint32_t>(CPLD_FULL_ADDR)|mask<boost::uint32_t>(CPLD_DATA)); + mask<uint32_t>(CPLD_FULL_ADDR)|mask<uint32_t>(CPLD_DATA)); //Sleep for 166ns to ensure that we don't toggle the enables too quickly //The underlying sleep function rounds to microsecond precision. _db_iface->sleep(boost::chrono::nanoseconds(166)); //Step 2: Write the reg offset and data, and assert the necessary enable _db_iface->set_gpio_out(dboard_iface::UNIT_BOTH, - (static_cast<boost::uint32_t>(addr) << shift(CPLD_FULL_ADDR)) | (data << shift(CPLD_DATA)), - mask<boost::uint32_t>(CPLD_FULL_ADDR)|mask<boost::uint32_t>(CPLD_DATA)); + (static_cast<uint32_t>(addr) << shift(CPLD_FULL_ADDR)) | (data << shift(CPLD_DATA)), + mask<uint32_t>(CPLD_FULL_ADDR)|mask<uint32_t>(CPLD_DATA)); } // Timed command interface @@ -128,8 +128,8 @@ public: } private: //Members/definitions - static const boost::uint32_t GPIO_OUTPUT_MASK = 0xFC06FE03; - static const boost::uint32_t GPIO_PINCTRL_MASK = 0x00000000; + static const uint32_t GPIO_OUTPUT_MASK = 0xFC06FE03; + static const uint32_t GPIO_PINCTRL_MASK = 0x00000000; //Private GPIO fields UHD_DEFINE_SOFT_REG_FIELD(CPLD_FULL_ADDR, /*width*/ 7, /*shift*/ 9); //GPIO[15:9] diff --git a/host/lib/usrp/dboard_eeprom.cpp b/host/lib/usrp/dboard_eeprom.cpp index 3b56ae19a..9c748f556 100644 --- a/host/lib/usrp/dboard_eeprom.cpp +++ b/host/lib/usrp/dboard_eeprom.cpp @@ -63,13 +63,13 @@ using namespace uhd::usrp; //////////////////////////////////////////////////////////////////////// //negative sum of bytes excluding checksum byte -static boost::uint8_t checksum(const byte_vector_t &bytes){ +static uint8_t checksum(const byte_vector_t &bytes){ int sum = 0; for (size_t i = 0; i < std::min(bytes.size(), size_t(DB_EEPROM_CHKSUM)); i++){ sum -= int(bytes.at(i)); } UHD_LOGV(often) << boost::format("sum: 0x%02x") % sum << std::endl; - return boost::uint8_t(sum); + return uint8_t(sum); } dboard_eeprom_t::dboard_eeprom_t(void){ @@ -77,7 +77,7 @@ dboard_eeprom_t::dboard_eeprom_t(void){ serial = ""; } -void dboard_eeprom_t::load(i2c_iface &iface, boost::uint8_t addr){ +void dboard_eeprom_t::load(i2c_iface &iface, uint8_t addr){ byte_vector_t bytes = iface.read_eeprom(addr, 0, DB_EEPROM_CLEN); std::ostringstream ss; @@ -95,8 +95,8 @@ void dboard_eeprom_t::load(i2c_iface &iface, boost::uint8_t addr){ //parse the ids id = dboard_id_t::from_uint16(0 - | (boost::uint16_t(bytes[DB_EEPROM_ID_LSB]) << 0) - | (boost::uint16_t(bytes[DB_EEPROM_ID_MSB]) << 8) + | (uint16_t(bytes[DB_EEPROM_ID_LSB]) << 0) + | (uint16_t(bytes[DB_EEPROM_ID_MSB]) << 8) ); //parse the serial @@ -106,9 +106,9 @@ void dboard_eeprom_t::load(i2c_iface &iface, boost::uint8_t addr){ ); //parse the revision - const boost::uint16_t rev_num = 0 - | (boost::uint16_t(bytes[DB_EEPROM_REV_LSB]) << 0) - | (boost::uint16_t(bytes[DB_EEPROM_REV_MSB]) << 8) + const uint16_t rev_num = 0 + | (uint16_t(bytes[DB_EEPROM_REV_LSB]) << 0) + | (uint16_t(bytes[DB_EEPROM_REV_MSB]) << 8) ; if (rev_num != 0 and rev_num != 0xffff){ revision = boost::lexical_cast<std::string>(rev_num); @@ -120,13 +120,13 @@ void dboard_eeprom_t::load(i2c_iface &iface, boost::uint8_t addr){ } } -void dboard_eeprom_t::store(i2c_iface &iface, boost::uint8_t addr) const{ +void dboard_eeprom_t::store(i2c_iface &iface, uint8_t addr) const{ byte_vector_t bytes(DB_EEPROM_CLEN, 0); //defaults to all zeros bytes[DB_EEPROM_MAGIC] = DB_EEPROM_MAGIC_VALUE; //load the id bytes - bytes[DB_EEPROM_ID_LSB] = boost::uint8_t(id.to_uint16() >> 0); - bytes[DB_EEPROM_ID_MSB] = boost::uint8_t(id.to_uint16() >> 8); + bytes[DB_EEPROM_ID_LSB] = uint8_t(id.to_uint16() >> 0); + bytes[DB_EEPROM_ID_MSB] = uint8_t(id.to_uint16() >> 8); //load the serial bytes byte_vector_t ser_bytes = string_to_bytes(serial, DB_EEPROM_SERIAL_LEN); @@ -134,9 +134,9 @@ void dboard_eeprom_t::store(i2c_iface &iface, boost::uint8_t addr) const{ //load the revision bytes if (not revision.empty()){ - const boost::uint16_t rev_num = boost::lexical_cast<boost::uint16_t>(revision); - bytes[DB_EEPROM_REV_LSB] = boost::uint8_t(rev_num >> 0); - bytes[DB_EEPROM_REV_MSB] = boost::uint8_t(rev_num >> 8); + const uint16_t rev_num = boost::lexical_cast<uint16_t>(revision); + bytes[DB_EEPROM_REV_LSB] = uint8_t(rev_num >> 0); + bytes[DB_EEPROM_REV_MSB] = uint8_t(rev_num >> 8); } //load the checksum diff --git a/host/lib/usrp/dboard_id.cpp b/host/lib/usrp/dboard_id.cpp index 557e13914..b4d458c5f 100644 --- a/host/lib/usrp/dboard_id.cpp +++ b/host/lib/usrp/dboard_id.cpp @@ -23,7 +23,7 @@ using namespace uhd::usrp; -dboard_id_t::dboard_id_t(boost::uint16_t id){ +dboard_id_t::dboard_id_t(uint16_t id){ _id = id; } @@ -31,11 +31,11 @@ dboard_id_t dboard_id_t::none(void){ return dboard_id_t(); } -dboard_id_t dboard_id_t::from_uint16(boost::uint16_t uint16){ +dboard_id_t dboard_id_t::from_uint16(uint16_t uint16){ return dboard_id_t(uint16); } -boost::uint16_t dboard_id_t::to_uint16(void) const{ +uint16_t dboard_id_t::to_uint16(void) const{ return _id; } @@ -52,11 +52,11 @@ template <class T> struct to_hex{ dboard_id_t dboard_id_t::from_string(const std::string &string){ if (string.substr(0, 2) == "0x"){ std::stringstream interpreter(string); - to_hex<boost::uint16_t> hh; + to_hex<uint16_t> hh; interpreter >> hh; return dboard_id_t::from_uint16(hh); } - return dboard_id_t::from_uint16(boost::lexical_cast<boost::uint16_t>(string)); + return dboard_id_t::from_uint16(boost::lexical_cast<uint16_t>(string)); } std::string dboard_id_t::to_string(void) const{ diff --git a/host/lib/usrp/device3/device3_impl.cpp b/host/lib/usrp/device3/device3_impl.cpp index 7fcbc01b2..50598a519 100644 --- a/host/lib/usrp/device3/device3_impl.cpp +++ b/host/lib/usrp/device3/device3_impl.cpp @@ -17,6 +17,7 @@ #include "device3_impl.hpp" #include "graph_impl.hpp" +#include "ctrl_iface.hpp" #include <uhd/utils/msg.hpp> #include <uhd/rfnoc/block_ctrl_base.hpp> #include <boost/make_shared.hpp> diff --git a/host/lib/usrp/device3/device3_impl.hpp b/host/lib/usrp/device3/device3_impl.hpp index 0d94ae21c..117e4af1c 100644 --- a/host/lib/usrp/device3/device3_impl.hpp +++ b/host/lib/usrp/device3/device3_impl.hpp @@ -32,18 +32,6 @@ #include <uhd/utils/tasks.hpp> #include <uhd/device3.hpp> #include "xports.hpp" -// Common FPGA cores: -#include "ctrl_iface.hpp" -#include "rx_dsp_core_3000.hpp" -#include "tx_dsp_core_3000.hpp" -#include "rx_vita_core_3000.hpp" -#include "tx_vita_core_3000.hpp" -#include "rx_frontend_core_200.hpp" -#include "tx_frontend_core_200.hpp" -#include "time_core_3000.hpp" -#include "gpio_atr_3000.hpp" -// RFNoC-specific includes: -#include "radio_ctrl_impl.hpp" namespace uhd { namespace usrp { @@ -54,8 +42,8 @@ static const size_t DEVICE3_RX_FC_REQUEST_FREQ = 32; //per flow-contr static const size_t DEVICE3_TX_FC_RESPONSE_FREQ = 8; static const size_t DEVICE3_TX_FC_RESPONSE_CYCLES = 0; // Cycles: Off. -static const size_t DEVICE3_TX_MAX_HDR_LEN = uhd::transport::vrt::chdr::max_if_hdr_words64 * sizeof(boost::uint64_t); // Bytes -static const size_t DEVICE3_RX_MAX_HDR_LEN = uhd::transport::vrt::chdr::max_if_hdr_words64 * sizeof(boost::uint64_t); // Bytes +static const size_t DEVICE3_TX_MAX_HDR_LEN = uhd::transport::vrt::chdr::max_if_hdr_words64 * sizeof(uint64_t); // Bytes +static const size_t DEVICE3_RX_MAX_HDR_LEN = uhd::transport::vrt::chdr::max_if_hdr_words64 * sizeof(uint64_t); // Bytes class device3_impl : public uhd::device3, public boost::enable_shared_from_this<device3_impl> { diff --git a/host/lib/usrp/device3/device3_io_impl.cpp b/host/lib/usrp/device3/device3_io_impl.cpp index af8ce772f..4ec14c43b 100644 --- a/host/lib/usrp/device3/device3_io_impl.cpp +++ b/host/lib/usrp/device3/device3_io_impl.cpp @@ -39,7 +39,7 @@ using namespace uhd::usrp; using namespace uhd::transport; //! CVITA uses 12-Bit sequence numbers -static const boost::uint32_t HW_SEQ_NUM_MASK = 0xfff; +static const uint32_t HW_SEQ_NUM_MASK = 0xfff; /*********************************************************************** @@ -103,34 +103,47 @@ void generate_channel_list( std::vector<device_addr_t> &chan_args ) { uhd::stream_args_t args = args_; - BOOST_FOREACH(const size_t chan_idx, args.channels) { - //// Find block ID for this channel: - if (args.args.has_key(str(boost::format("block_id%d") % chan_idx))) { - chan_list.push_back( - uhd::rfnoc::block_id_t( - args.args.pop(str(boost::format("block_id%d") % chan_idx)) - ) - ); - chan_args.push_back(args.args); + std::vector<uhd::rfnoc::block_id_t> chan_list_(args.channels.size()); + std::vector<device_addr_t> chan_args_(args.channels.size()); + + for (size_t i = 0; i < args.channels.size(); i++) + { + // Extract block ID + size_t chan_idx = args.channels[i]; + std::string key = str(boost::format("block_id%d") % chan_idx); + if (args.args.has_key(key)) { + chan_list_[i] = args.args.pop(key); } else if (args.args.has_key("block_id")) { - chan_list.push_back(args.args.get("block_id")); - chan_args.push_back(args.args); - chan_args.back().pop("block_id"); + chan_list[i] = args.args["block_id"]; } else { throw uhd::runtime_error(str( boost::format("Cannot create streamers: No block_id specified for channel %d.") % chan_idx )); } - //// Find block port for this channel - if (args.args.has_key(str(boost::format("block_port%d") % chan_idx))) { - chan_args.back()["block_port"] = args.args.pop(str(boost::format("block_port%d") % chan_idx)); - } else if (args.args.has_key("block_port")) { - // We have to write it again, because the chan args from the - // property tree might have overwritten this - chan_args.back()["block_port"] = args.args.get("block_port"); + + // Split off known channel specific args + key = str(boost::format("block_port%d") % chan_idx); + if (args.args.has_key(key)) { + chan_args_[i]["block_port"] = args.args.pop(key); } + key = str(boost::format("radio_id%d") % chan_idx); + if (args.args.has_key(key)) { + chan_args_[i]["radio_id"] = args.args.pop(key); + } + key = str(boost::format("radio_port%d") % chan_idx); + if (args.args.has_key(key)) { + chan_args_[i]["radio_port"] = args.args.pop(key); + } + } + + // Add all remaining args to all channel args + BOOST_FOREACH(device_addr_t &chan_arg, chan_args_) { + chan_arg = chan_arg.to_string() + "," + args.args.to_string(); } + + chan_list = chan_list_; + chan_args = chan_args_; } @@ -223,7 +236,7 @@ static void handle_rx_flowctrl( if (not buff) { throw uhd::runtime_error("handle_rx_flowctrl timed out getting a send buffer"); } - boost::uint32_t *pkt = buff->cast<boost::uint32_t *>(); + uint32_t *pkt = buff->cast<uint32_t *>(); // Recover sequence number. The sequence numbers handled by the streamers // are 12 Bits, but we want to know the 32-Bit sequence number. @@ -242,7 +255,7 @@ static void handle_rx_flowctrl( vrt::if_packet_info_t packet_info; packet_info.packet_type = vrt::if_packet_info_t::PACKET_TYPE_FC; packet_info.num_payload_words32 = RXFC_PACKET_LEN_IN_WORDS; - packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(boost::uint32_t); + packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(uint32_t); packet_info.packet_count = seq32; packet_info.sob = false; packet_info.eob = false; @@ -257,14 +270,14 @@ static void handle_rx_flowctrl( // Load Header: vrt::chdr::if_hdr_pack_be(pkt, packet_info); // Load Payload: (the sequence number) - pkt[packet_info.num_header_words32+RXFC_CMD_CODE_OFFSET] = uhd::htonx<boost::uint32_t>(0); - pkt[packet_info.num_header_words32+RXFC_SEQ_NUM_OFFSET] = uhd::htonx<boost::uint32_t>(seq32); + pkt[packet_info.num_header_words32+RXFC_CMD_CODE_OFFSET] = uhd::htonx<uint32_t>(0); + pkt[packet_info.num_header_words32+RXFC_SEQ_NUM_OFFSET] = uhd::htonx<uint32_t>(seq32); } else { // Load Header: vrt::chdr::if_hdr_pack_le(pkt, packet_info); // Load Payload: (the sequence number) - pkt[packet_info.num_header_words32+RXFC_CMD_CODE_OFFSET] = uhd::htowx<boost::uint32_t>(0); - pkt[packet_info.num_header_words32+RXFC_SEQ_NUM_OFFSET] = uhd::htowx<boost::uint32_t>(seq32); + pkt[packet_info.num_header_words32+RXFC_CMD_CODE_OFFSET] = uhd::htowx<uint32_t>(0); + pkt[packet_info.num_header_words32+RXFC_SEQ_NUM_OFFSET] = uhd::htowx<uint32_t>(seq32); } //std::cout << " SID=" << std::hex << sid << " hdr bits=" << packet_info.packet_type << " seq32=" << seq32 << std::endl; @@ -277,7 +290,7 @@ static void handle_rx_flowctrl( //} //send the buffer over the interface - buff->commit(sizeof(boost::uint32_t)*(packet_info.num_packet_words32)); + buff->commit(sizeof(uint32_t)*(packet_info.num_packet_words32)); } /*********************************************************************** @@ -371,11 +384,11 @@ static void handle_tx_async_msgs( //extract packet info vrt::if_packet_info_t if_packet_info; - if_packet_info.num_packet_words32 = buff->size()/sizeof(boost::uint32_t); - const boost::uint32_t *packet_buff = buff->cast<const boost::uint32_t *>(); + if_packet_info.num_packet_words32 = buff->size()/sizeof(uint32_t); + const uint32_t *packet_buff = buff->cast<const uint32_t *>(); //unpacking can fail - boost::uint32_t (*endian_conv)(boost::uint32_t) = uhd::ntohx; + uint32_t (*endian_conv)(uint32_t) = uhd::ntohx; try { if (endianness == ENDIANNESS_BIG) @@ -803,11 +816,34 @@ tx_streamer::sptr device3_impl::get_tx_stream(const uhd::stream_args_t &args_) blk_ctrl->sr_write(uhd::rfnoc::SR_RESP_IN_DST_SID, xport.recv_sid.get_dst(), block_port); UHD_STREAMER_LOG() << "[TX Streamer] resp_in_dst_sid == " << boost::format("0x%04X") % xport.recv_sid.get_dst() << std::endl; - // Find all downstream radio nodes and set their response in SID to the host - std::vector<boost::shared_ptr<uhd::rfnoc::radio_ctrl> > downstream_radio_nodes = blk_ctrl->find_downstream_node<uhd::rfnoc::radio_ctrl>(); - UHD_STREAMER_LOG() << "[TX Streamer] Number of downstream radio nodes: " << downstream_radio_nodes.size() << std::endl; - BOOST_FOREACH(const boost::shared_ptr<uhd::rfnoc::radio_ctrl> &node, downstream_radio_nodes) { - node->sr_write(uhd::rfnoc::SR_RESP_IN_DST_SID, xport.send_sid.get_src(), block_port); + + // FIXME: Once there is a better way to map the radio block and port + // to the channel or another way to receive asynchronous messages that + // is not in-band, this should be removed. + if (args.args.has_key("radio_id") and args.args.has_key("radio_port")) + { + // Find downstream radio node and set the response SID to the host + uhd::rfnoc::block_id_t radio_id(args.args["radio_id"]); + size_t radio_port = args.args.cast<size_t>("radio_port", 0); + std::vector<boost::shared_ptr<uhd::rfnoc::radio_ctrl> > downstream_radio_nodes = blk_ctrl->find_downstream_node<uhd::rfnoc::radio_ctrl>(); + UHD_STREAMER_LOG() << "[TX Streamer] Number of downstream radio nodes: " << downstream_radio_nodes.size() << std::endl; + BOOST_FOREACH(const boost::shared_ptr<uhd::rfnoc::radio_ctrl> &node, downstream_radio_nodes) { + if (node->get_block_id() == radio_id) { + node->sr_write(uhd::rfnoc::SR_RESP_IN_DST_SID, xport.send_sid.get_src(), radio_port); + } + } + } else { + // FIXME: This block is preserved for legacy behavior where the + // radio_id and radio_port are not provided. It fails if more + // than one radio is visible downstream or the port on the radio + // is not the same as the block_port. It should be removed as + // soon as possible. + // Find all downstream radio nodes and set their response SID to the host + std::vector<boost::shared_ptr<uhd::rfnoc::radio_ctrl> > downstream_radio_nodes = blk_ctrl->find_downstream_node<uhd::rfnoc::radio_ctrl>(); + UHD_STREAMER_LOG() << "[TX Streamer] Number of downstream radio nodes: " << downstream_radio_nodes.size() << std::endl; + BOOST_FOREACH(const boost::shared_ptr<uhd::rfnoc::radio_ctrl> &node, downstream_radio_nodes) { + node->sr_write(uhd::rfnoc::SR_RESP_IN_DST_SID, xport.send_sid.get_src(), block_port); + } } //Give the streamer a functor to get the send buffer diff --git a/host/lib/usrp/e100/clock_ctrl.cpp b/host/lib/usrp/e100/clock_ctrl.cpp index 9e355ce17..0dbd6a5d3 100644 --- a/host/lib/usrp/e100/clock_ctrl.cpp +++ b/host/lib/usrp/e100/clock_ctrl.cpp @@ -20,7 +20,7 @@ #include <uhd/utils/msg.hpp> #include <uhd/utils/log.hpp> #include <uhd/utils/assert_has.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include "e100_regs.hpp" //spi slave constants #include <boost/assign/list_of.hpp> #include <boost/foreach.hpp> @@ -107,8 +107,8 @@ static clock_settings_type get_clock_settings(double rate){ //X = chan_div * vco_div * R //Y = P*B + A - const boost::uint64_t out_rate = boost::uint64_t(rate); - const boost::uint64_t ref_rate = boost::uint64_t(cs.get_ref_rate()); + const uint64_t out_rate = uint64_t(rate); + const uint64_t ref_rate = uint64_t(cs.get_ref_rate()); const size_t gcd = size_t(boost::math::gcd(ref_rate, out_rate)); for (size_t i = 1; i <= 100; i++){ @@ -436,8 +436,8 @@ public: } bool get_locked(void){ - static const boost::uint8_t addr = 0x01F; - boost::uint32_t reg = _iface->read_spi( + static const uint8_t addr = 0x01F; + uint32_t reg = _iface->read_spi( UE_SPI_SS_AD9522, spi_config_t::EDGE_RISE, _ad9522_regs.get_read_reg(addr), 24 ); @@ -458,8 +458,8 @@ private: this->send_reg(0x232); } - void send_reg(boost::uint16_t addr){ - boost::uint32_t reg = _ad9522_regs.get_write_reg(addr); + void send_reg(uint16_t addr){ + uint32_t reg = _ad9522_regs.get_write_reg(addr); UHD_LOGV(often) << "clock control write reg: " << std::hex << reg << std::endl; _iface->write_spi( UE_SPI_SS_AD9522, @@ -477,10 +477,10 @@ private: this->send_reg(0x18); this->latch_regs(); //wait for calibration done: - static const boost::uint8_t addr = 0x01F; + static const uint8_t addr = 0x01F; for (size_t ms10 = 0; ms10 < 100; ms10++){ boost::this_thread::sleep(boost::posix_time::milliseconds(10)); - boost::uint32_t reg = _iface->read_spi( + uint32_t reg = _iface->read_spi( UE_SPI_SS_AD9522, spi_config_t::EDGE_RISE, _ad9522_regs.get_read_reg(addr), 24 ); @@ -492,7 +492,7 @@ private: //wait for digital lock detect: for (size_t ms10 = 0; ms10 < 100; ms10++){ boost::this_thread::sleep(boost::posix_time::milliseconds(10)); - boost::uint32_t reg = _iface->read_spi( + uint32_t reg = _iface->read_spi( UE_SPI_SS_AD9522, spi_config_t::EDGE_RISE, _ad9522_regs.get_read_reg(addr), 24 ); @@ -513,7 +513,7 @@ private: void send_all_regs(void){ //setup a list of register ranges to write - typedef std::pair<boost::uint16_t, boost::uint16_t> range_t; + typedef std::pair<uint16_t, uint16_t> range_t; static const std::vector<range_t> ranges = boost::assign::list_of (range_t(0x000, 0x000)) (range_t(0x010, 0x01F)) (range_t(0x0F0, 0x0FD)) (range_t(0x190, 0x19B)) @@ -522,7 +522,7 @@ private: //write initial register values and latch/update BOOST_FOREACH(const range_t &range, ranges){ - for(boost::uint16_t addr = range.first; addr <= range.second; addr++){ + for(uint16_t addr = range.first; addr <= range.second; addr++){ this->send_reg(addr); } } diff --git a/host/lib/usrp/e100/codec_ctrl.cpp b/host/lib/usrp/e100/codec_ctrl.cpp index 2c13176a3..7dce01e46 100644 --- a/host/lib/usrp/e100/codec_ctrl.cpp +++ b/host/lib/usrp/e100/codec_ctrl.cpp @@ -21,7 +21,7 @@ #include <uhd/types/dict.hpp> #include <uhd/exception.hpp> #include <uhd/utils/algorithm.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/tuple/tuple.hpp> #include <boost/math/special_functions/round.hpp> #include "e100_regs.hpp" //spi slave constants @@ -54,8 +54,8 @@ public: private: spi_iface::sptr _iface; ad9862_regs_t _ad9862_regs; - void send_reg(boost::uint8_t addr); - void recv_reg(boost::uint8_t addr); + void send_reg(uint8_t addr); + void recv_reg(uint8_t addr); }; /*********************************************************************** @@ -110,7 +110,7 @@ e100_codec_ctrl_impl::e100_codec_ctrl_impl(spi_iface::sptr iface){ //_ad9862_regs.dis2 = ad9862_regs_t::DIS2_DIS; needed for transmit //write the register settings to the codec - for (boost::uint8_t addr = 0; addr <= 25; addr++){ + for (uint8_t addr = 0; addr <= 25; addr++){ this->send_reg(addr); } @@ -185,8 +185,8 @@ double e100_codec_ctrl_impl::get_rx_pga_gain(char which){ /*********************************************************************** * Codec Control AUX ADC Methods **********************************************************************/ -static double aux_adc_to_volts(boost::uint8_t high, boost::uint8_t low){ - return double((boost::uint16_t(high) << 2) | low)*3.3/0x3ff; +static double aux_adc_to_volts(uint8_t high, uint8_t low){ + return double((uint16_t(high) << 2) | low)*3.3/0x3ff; } double e100_codec_ctrl_impl::read_aux_adc(aux_adc_t which){ @@ -228,19 +228,19 @@ double e100_codec_ctrl_impl::read_aux_adc(aux_adc_t which){ void e100_codec_ctrl_impl::write_aux_dac(aux_dac_t which, double volts){ //special case for aux dac d (aka sigma delta word) if (which == AUX_DAC_D){ - boost::uint16_t dac_word = uhd::clip(boost::math::iround(volts*0xfff/3.3), 0, 0xfff); - _ad9862_regs.sig_delt_11_4 = boost::uint8_t(dac_word >> 4); - _ad9862_regs.sig_delt_3_0 = boost::uint8_t(dac_word & 0xf); + uint16_t dac_word = uhd::clip(boost::math::iround(volts*0xfff/3.3), 0, 0xfff); + _ad9862_regs.sig_delt_11_4 = uint8_t(dac_word >> 4); + _ad9862_regs.sig_delt_3_0 = uint8_t(dac_word & 0xf); this->send_reg(42); this->send_reg(43); return; } //calculate the dac word for aux dac a, b, c - boost::uint8_t dac_word = uhd::clip(boost::math::iround(volts*0xff/3.3), 0, 0xff); + uint8_t dac_word = uhd::clip(boost::math::iround(volts*0xff/3.3), 0, 0xff); //setup a lookup table for the aux dac params (reg ref, reg addr) - typedef boost::tuple<boost::uint8_t*, boost::uint8_t> dac_params_t; + typedef boost::tuple<uint8_t*, uint8_t> dac_params_t; uhd::dict<aux_dac_t, dac_params_t> aux_dac_to_params = boost::assign::map_list_of (AUX_DAC_A, dac_params_t(&_ad9862_regs.aux_dac_a, 36)) (AUX_DAC_B, dac_params_t(&_ad9862_regs.aux_dac_b, 37)) @@ -249,7 +249,7 @@ void e100_codec_ctrl_impl::write_aux_dac(aux_dac_t which, double volts){ //set the aux dac register UHD_ASSERT_THROW(aux_dac_to_params.has_key(which)); - boost::uint8_t *reg_ref, reg_addr; + uint8_t *reg_ref, reg_addr; boost::tie(reg_ref, reg_addr) = aux_dac_to_params[which]; *reg_ref = dac_word; this->send_reg(reg_addr); @@ -258,8 +258,8 @@ void e100_codec_ctrl_impl::write_aux_dac(aux_dac_t which, double volts){ /*********************************************************************** * Codec Control SPI Methods **********************************************************************/ -void e100_codec_ctrl_impl::send_reg(boost::uint8_t addr){ - boost::uint32_t reg = _ad9862_regs.get_write_reg(addr); +void e100_codec_ctrl_impl::send_reg(uint8_t addr){ + uint32_t reg = _ad9862_regs.get_write_reg(addr); UHD_LOGV(often) << "codec control write reg: " << std::hex << reg << std::endl; _iface->write_spi( UE_SPI_SS_AD9862, @@ -268,16 +268,16 @@ void e100_codec_ctrl_impl::send_reg(boost::uint8_t addr){ ); } -void e100_codec_ctrl_impl::recv_reg(boost::uint8_t addr){ - boost::uint32_t reg = _ad9862_regs.get_read_reg(addr); +void e100_codec_ctrl_impl::recv_reg(uint8_t addr){ + uint32_t reg = _ad9862_regs.get_read_reg(addr); UHD_LOGV(often) << "codec control read reg: " << std::hex << reg << std::endl; - boost::uint32_t ret = _iface->read_spi( + uint32_t ret = _iface->read_spi( UE_SPI_SS_AD9862, spi_config_t::EDGE_RISE, reg, 16 ); UHD_LOGV(often) << "codec control read ret: " << std::hex << ret << std::endl; - _ad9862_regs.set_reg(addr, boost::uint16_t(ret)); + _ad9862_regs.set_reg(addr, uint16_t(ret)); } /*********************************************************************** diff --git a/host/lib/usrp/e100/dboard_iface.cpp b/host/lib/usrp/e100/dboard_iface.cpp index ce0ac026b..ce42c5506 100644 --- a/host/lib/usrp/e100/dboard_iface.cpp +++ b/host/lib/usrp/e100/dboard_iface.cpp @@ -66,33 +66,33 @@ public: void write_aux_dac(unit_t, aux_dac_t, double); double read_aux_adc(unit_t, aux_adc_t); - void set_pin_ctrl(unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_pin_ctrl(unit_t unit); - void set_atr_reg(unit_t unit, atr_reg_t reg, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_atr_reg(unit_t unit, atr_reg_t reg); - void set_gpio_ddr(unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_gpio_ddr(unit_t unit); - void set_gpio_out(unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_gpio_out(unit_t unit); - boost::uint32_t read_gpio(unit_t unit); + void set_pin_ctrl(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_pin_ctrl(unit_t unit); + void set_atr_reg(unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_atr_reg(unit_t unit, atr_reg_t reg); + void set_gpio_ddr(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_gpio_ddr(unit_t unit); + void set_gpio_out(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_gpio_out(unit_t unit); + uint32_t read_gpio(unit_t unit); void set_command_time(const uhd::time_spec_t& t); uhd::time_spec_t get_command_time(void); - void write_i2c(boost::uint16_t, const byte_vector_t &); - byte_vector_t read_i2c(boost::uint16_t, size_t); + void write_i2c(uint16_t, const byte_vector_t &); + byte_vector_t read_i2c(uint16_t, size_t); void write_spi( unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ); - boost::uint32_t read_write_spi( + uint32_t read_write_spi( unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ); @@ -167,39 +167,39 @@ double e100_dboard_iface::get_codec_rate(unit_t){ /*********************************************************************** * GPIO **********************************************************************/ -void e100_dboard_iface::set_pin_ctrl(unit_t unit, boost::uint32_t value, boost::uint32_t mask){ - _gpio->set_pin_ctrl(unit, static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask)); +void e100_dboard_iface::set_pin_ctrl(unit_t unit, uint32_t value, uint32_t mask){ + _gpio->set_pin_ctrl(unit, static_cast<uint16_t>(value), static_cast<uint16_t>(mask)); } -boost::uint32_t e100_dboard_iface::get_pin_ctrl(unit_t unit){ - return static_cast<boost::uint32_t>(_gpio->get_pin_ctrl(unit)); +uint32_t e100_dboard_iface::get_pin_ctrl(unit_t unit){ + return static_cast<uint32_t>(_gpio->get_pin_ctrl(unit)); } -void e100_dboard_iface::set_atr_reg(unit_t unit, atr_reg_t reg, boost::uint32_t value, boost::uint32_t mask){ - _gpio->set_atr_reg(unit, reg, static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask)); +void e100_dboard_iface::set_atr_reg(unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask){ + _gpio->set_atr_reg(unit, reg, static_cast<uint16_t>(value), static_cast<uint16_t>(mask)); } -boost::uint32_t e100_dboard_iface::get_atr_reg(unit_t unit, atr_reg_t reg){ - return static_cast<boost::uint32_t>(_gpio->get_atr_reg(unit, reg)); +uint32_t e100_dboard_iface::get_atr_reg(unit_t unit, atr_reg_t reg){ + return static_cast<uint32_t>(_gpio->get_atr_reg(unit, reg)); } -void e100_dboard_iface::set_gpio_ddr(unit_t unit, boost::uint32_t value, boost::uint32_t mask){ - _gpio->set_gpio_ddr(unit, static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask)); +void e100_dboard_iface::set_gpio_ddr(unit_t unit, uint32_t value, uint32_t mask){ + _gpio->set_gpio_ddr(unit, static_cast<uint16_t>(value), static_cast<uint16_t>(mask)); } -boost::uint32_t e100_dboard_iface::get_gpio_ddr(unit_t unit){ - return static_cast<boost::uint32_t>(_gpio->get_gpio_ddr(unit)); +uint32_t e100_dboard_iface::get_gpio_ddr(unit_t unit){ + return static_cast<uint32_t>(_gpio->get_gpio_ddr(unit)); } -void e100_dboard_iface::set_gpio_out(unit_t unit, boost::uint32_t value, boost::uint32_t mask){ - _gpio->set_gpio_out(unit, static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask)); +void e100_dboard_iface::set_gpio_out(unit_t unit, uint32_t value, uint32_t mask){ + _gpio->set_gpio_out(unit, static_cast<uint16_t>(value), static_cast<uint16_t>(mask)); } -boost::uint32_t e100_dboard_iface::get_gpio_out(unit_t unit){ - return static_cast<boost::uint32_t>(_gpio->get_gpio_out(unit)); +uint32_t e100_dboard_iface::get_gpio_out(unit_t unit){ + return static_cast<uint32_t>(_gpio->get_gpio_out(unit)); } -boost::uint32_t e100_dboard_iface::read_gpio(unit_t unit){ +uint32_t e100_dboard_iface::read_gpio(unit_t unit){ return _gpio->read_gpio(unit); } @@ -211,7 +211,7 @@ boost::uint32_t e100_dboard_iface::read_gpio(unit_t unit){ * \param unit the dboard interface unit type enum * \return the slave device number */ -static boost::uint32_t unit_to_otw_spi_dev(dboard_iface::unit_t unit){ +static uint32_t unit_to_otw_spi_dev(dboard_iface::unit_t unit){ switch(unit){ case dboard_iface::UNIT_TX: return UE_SPI_SS_TX_DB; case dboard_iface::UNIT_RX: return UE_SPI_SS_RX_DB; @@ -222,16 +222,16 @@ static boost::uint32_t unit_to_otw_spi_dev(dboard_iface::unit_t unit){ void e100_dboard_iface::write_spi( unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ){ _spi_iface->write_spi(unit_to_otw_spi_dev(unit), config, data, num_bits); } -boost::uint32_t e100_dboard_iface::read_write_spi( +uint32_t e100_dboard_iface::read_write_spi( unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ){ return _spi_iface->read_spi(unit_to_otw_spi_dev(unit), config, data, num_bits); @@ -240,11 +240,11 @@ boost::uint32_t e100_dboard_iface::read_write_spi( /*********************************************************************** * I2C **********************************************************************/ -void e100_dboard_iface::write_i2c(boost::uint16_t addr, const byte_vector_t &bytes){ +void e100_dboard_iface::write_i2c(uint16_t addr, const byte_vector_t &bytes){ return _i2c_iface->write_i2c(addr, bytes); } -byte_vector_t e100_dboard_iface::read_i2c(boost::uint16_t addr, size_t num_bytes){ +byte_vector_t e100_dboard_iface::read_i2c(uint16_t addr, size_t num_bytes){ return _i2c_iface->read_i2c(addr, num_bytes); } diff --git a/host/lib/usrp/e100/e100_ctrl.cpp b/host/lib/usrp/e100/e100_ctrl.cpp index c164a6fb0..4217286f8 100644 --- a/host/lib/usrp/e100/e100_ctrl.cpp +++ b/host/lib/usrp/e100/e100_ctrl.cpp @@ -94,15 +94,15 @@ public: this->spi_sclk_gpio(1); //out of reset } - boost::uint32_t transact_spi( + uint32_t transact_spi( int, const spi_config_t &, //not used params - boost::uint32_t bits, + uint32_t bits, size_t num_bits, bool readback ){ boost::mutex::scoped_lock lock(gpio_irq_resp_mutex); - boost::uint32_t rb_bits = 0; + uint32_t rb_bits = 0; this->spi_sen_gpio(0); for (size_t i = 0; i < num_bits; i++){ @@ -144,7 +144,7 @@ public: ::close(_node_fd); } - void write_i2c(boost::uint16_t addr, const byte_vector_t &bytes){ + void write_i2c(uint16_t addr, const byte_vector_t &bytes){ byte_vector_t rw_bytes(bytes); //setup the message @@ -163,7 +163,7 @@ public: UHD_ASSERT_THROW(::ioctl(_node_fd, I2C_RDWR, &data) >= 0); } - byte_vector_t read_i2c(boost::uint16_t addr, size_t num_bytes){ + byte_vector_t read_i2c(uint16_t addr, size_t num_bytes){ byte_vector_t bytes(num_bytes); //setup the message diff --git a/host/lib/usrp/e100/e100_impl.cpp b/host/lib/usrp/e100/e100_impl.cpp index 1f8fe84cb..25c967cfa 100644 --- a/host/lib/usrp/e100/e100_impl.cpp +++ b/host/lib/usrp/e100/e100_impl.cpp @@ -183,8 +183,8 @@ e100_impl::e100_impl(const uhd::device_addr_t &device_addr){ size_t hash = time(NULL); for (size_t i = 0; i < 100; i++){ boost::hash_combine(hash, i); - _fifo_ctrl->poke32(TOREG(SR_MISC+0), boost::uint32_t(hash)); - test_fail = _fifo_ctrl->peek32(REG_RB_CONFIG0) != boost::uint32_t(hash); + _fifo_ctrl->poke32(TOREG(SR_MISC+0), uint32_t(hash)); + test_fail = _fifo_ctrl->peek32(REG_RB_CONFIG0) != uint32_t(hash); if (test_fail) break; //exit loop on any failure } UHD_MSG(status) << ((test_fail)? " fail" : "pass") << std::endl; @@ -533,8 +533,8 @@ sensor_value_t e100_impl::get_ref_locked(void){ } void e100_impl::check_fpga_compat(void){ - const boost::uint32_t fpga_compat_num = _fifo_ctrl->peek32(REG_RB_COMPAT); - boost::uint16_t fpga_major = fpga_compat_num >> 16, fpga_minor = fpga_compat_num & 0xffff; + const uint32_t fpga_compat_num = _fifo_ctrl->peek32(REG_RB_COMPAT); + uint16_t fpga_major = fpga_compat_num >> 16, fpga_minor = fpga_compat_num & 0xffff; if (fpga_major == 0){ //old version scheme fpga_major = fpga_minor; fpga_minor = 0; diff --git a/host/lib/usrp/e100/e100_impl.hpp b/host/lib/usrp/e100/e100_impl.hpp index b05053f84..5f8277dda 100644 --- a/host/lib/usrp/e100/e100_impl.hpp +++ b/host/lib/usrp/e100/e100_impl.hpp @@ -50,10 +50,10 @@ static const double E100_RX_LINK_RATE_BPS = 166e6/3/2*2; static const double E100_TX_LINK_RATE_BPS = 166e6/3/1*2; static const std::string E100_I2C_DEV_NODE = "/dev/i2c-3"; static const std::string E100_UART_DEV_NODE = "/dev/ttyO0"; -static const boost::uint16_t E100_FPGA_COMPAT_NUM = 11; -static const boost::uint32_t E100_RX_SID_BASE = 30; -static const boost::uint32_t E100_TX_ASYNC_SID = 10; -static const boost::uint32_t E100_CTRL_MSG_SID = 20; +static const uint16_t E100_FPGA_COMPAT_NUM = 11; +static const uint32_t E100_RX_SID_BASE = 30; +static const uint32_t E100_TX_ASYNC_SID = 10; +static const uint32_t E100_CTRL_MSG_SID = 20; static const double E100_DEFAULT_CLOCK_RATE = 64e6; static const std::string E100_EEPROM_MAP_KEY = "E100"; diff --git a/host/lib/usrp/e100/e100_regs.hpp b/host/lib/usrp/e100/e100_regs.hpp index 654163dce..208abede8 100644 --- a/host/lib/usrp/e100/e100_regs.hpp +++ b/host/lib/usrp/e100/e100_regs.hpp @@ -18,7 +18,7 @@ #ifndef INCLUDED_E100_REGS_HPP #define INCLUDED_E100_REGS_HPP -#include <boost/cstdint.hpp> +#include <stdint.h> #define TOREG(x) ((x)*4) diff --git a/host/lib/usrp/e100/io_impl.cpp b/host/lib/usrp/e100/io_impl.cpp index bf04a5871..ebed3614c 100644 --- a/host/lib/usrp/e100/io_impl.cpp +++ b/host/lib/usrp/e100/io_impl.cpp @@ -131,7 +131,7 @@ rx_streamer::sptr e100_impl::get_rx_stream(const uhd::stream_args_t &args_){ //calculate packet size static const size_t hdr_size = 0 - + vrt::max_if_hdr_words32*sizeof(boost::uint32_t) + + vrt::max_if_hdr_words32*sizeof(uint32_t) + sizeof(vrt::if_packet_info_t().tlr) //forced to have trailer - sizeof(vrt::if_packet_info_t().cid) //no class id ever used - sizeof(vrt::if_packet_info_t().tsi) //no int time ever used @@ -189,8 +189,8 @@ tx_streamer::sptr e100_impl::get_tx_stream(const uhd::stream_args_t &args_){ //calculate packet size static const size_t hdr_size = 0 - + vrt_send_header_offset_words32*sizeof(boost::uint32_t) - + vrt::max_if_hdr_words32*sizeof(boost::uint32_t) + + vrt_send_header_offset_words32*sizeof(uint32_t) + + vrt::max_if_hdr_words32*sizeof(uint32_t) + sizeof(vrt::if_packet_info_t().tlr) //forced to have trailer - sizeof(vrt::if_packet_info_t().sid) //no stream id ever used - sizeof(vrt::if_packet_info_t().cid) //no class id ever used diff --git a/host/lib/usrp/e300/e300_eeprom_manager.cpp b/host/lib/usrp/e300/e300_eeprom_manager.cpp index 00200747d..d43ca3d4c 100644 --- a/host/lib/usrp/e300/e300_eeprom_manager.cpp +++ b/host/lib/usrp/e300/e300_eeprom_manager.cpp @@ -21,7 +21,7 @@ namespace uhd { namespace usrp { namespace e300 { -static const std::string _bytes_to_string(const boost::uint8_t* bytes, size_t max_len) +static const std::string _bytes_to_string(const uint8_t* bytes, size_t max_len) { std::string out; for (size_t i = 0; i < max_len; i++) { @@ -31,7 +31,7 @@ static const std::string _bytes_to_string(const boost::uint8_t* bytes, size_t ma return out; } -static void _string_to_bytes(const std::string &string, size_t max_len, boost::uint8_t* buffer) +static void _string_to_bytes(const std::string &string, size_t max_len, uint8_t* buffer) { byte_vector_t bytes; const size_t len = std::min(string.size(), max_len); @@ -56,7 +56,7 @@ const mboard_eeprom_t& e300_eeprom_manager::read_mb_eeprom(void) { boost::mutex::scoped_lock(_mutex); - std::vector<boost::uint8_t> bytes; + std::vector<uint8_t> bytes; bytes.resize(sizeof(mb_eeprom_map_t)); mb_eeprom_map_t *map_ptr = reinterpret_cast<mb_eeprom_map_t*>(&bytes[0]); memset(map_ptr, 0xff, sizeof(mb_eeprom_map_t)); @@ -68,9 +68,9 @@ const mboard_eeprom_t& e300_eeprom_manager::read_mb_eeprom(void) mb_eeprom_map_t &map = *map_ptr; _mb_eeprom["product"] = boost::lexical_cast<std::string>( - uhd::ntohx<boost::uint16_t>(map.hw_product)); + uhd::ntohx<uint16_t>(map.hw_product)); _mb_eeprom["revision"] = boost::lexical_cast<std::string>( - uhd::ntohx<boost::uint16_t>(map.hw_revision)); + uhd::ntohx<uint16_t>(map.hw_revision)); _mb_eeprom["serial"] = _bytes_to_string( map.serial, MB_SERIAL_LEN); @@ -87,7 +87,7 @@ const dboard_eeprom_t& e300_eeprom_manager::read_db_eeprom(void) { boost::mutex::scoped_lock(_mutex); - std::vector<boost::uint8_t> bytes; + std::vector<uint8_t> bytes; bytes.resize(sizeof(db_eeprom_map_t)); db_eeprom_map_t *map_ptr = reinterpret_cast<db_eeprom_map_t*>(&bytes[0]); memset(map_ptr, 0xff, sizeof(db_eeprom_map_t)); @@ -99,10 +99,10 @@ const dboard_eeprom_t& e300_eeprom_manager::read_db_eeprom(void) db_eeprom_map_t &map = *map_ptr; _db_eeprom.id = uhd::usrp::dboard_id_t::from_uint16( - uhd::ntohx<boost::uint16_t>(map.hw_product)); + uhd::ntohx<uint16_t>(map.hw_product)); _db_eeprom.revision = boost::lexical_cast<std::string>( - uhd::ntohx<boost::uint16_t>(map.hw_revision)); + uhd::ntohx<uint16_t>(map.hw_revision)); _db_eeprom.serial = _bytes_to_string( map.serial, DB_SERIAL_LEN); @@ -113,7 +113,7 @@ void e300_eeprom_manager::write_db_eeprom(const dboard_eeprom_t& eeprom) { boost::mutex::scoped_lock(_mutex); _db_eeprom = eeprom; - std::vector<boost::uint8_t> bytes; + std::vector<uint8_t> bytes; bytes.resize(sizeof(db_eeprom_map_t)); @@ -131,13 +131,13 @@ void e300_eeprom_manager::write_db_eeprom(const dboard_eeprom_t& eeprom) map.data_version_minor = E310_DB_MAP_MINOR; if (_db_eeprom.id != dboard_id_t::none()) { - map.hw_product = uhd::htonx<boost::uint16_t>( + map.hw_product = uhd::htonx<uint16_t>( _db_eeprom.id.to_uint16()); } if (not _db_eeprom.revision.empty()) { - map.hw_revision = uhd::htonx<boost::uint16_t>( - boost::lexical_cast<boost::uint16_t>(_db_eeprom.revision)); + map.hw_revision = uhd::htonx<uint16_t>( + boost::lexical_cast<uint16_t>(_db_eeprom.revision)); } if (not _db_eeprom.serial.empty()) { @@ -151,7 +151,7 @@ void e300_eeprom_manager::write_mb_eeprom(const mboard_eeprom_t& eeprom) { boost::mutex::scoped_lock(_mutex); _mb_eeprom = eeprom; - std::vector<boost::uint8_t> bytes; + std::vector<uint8_t> bytes; bytes.resize(sizeof(mb_eeprom_map_t)); @@ -170,12 +170,12 @@ void e300_eeprom_manager::write_mb_eeprom(const mboard_eeprom_t& eeprom) if (_mb_eeprom.has_key("product")) { - map.hw_product = uhd::htonx<boost::uint16_t>( - boost::lexical_cast<boost::uint16_t>(_mb_eeprom["product"])); + map.hw_product = uhd::htonx<uint16_t>( + boost::lexical_cast<uint16_t>(_mb_eeprom["product"])); } if (_mb_eeprom.has_key("revision")) { - map.hw_revision = uhd::htonx<boost::uint16_t>( - boost::lexical_cast<boost::uint16_t>(_mb_eeprom["revision"])); + map.hw_revision = uhd::htonx<uint16_t>( + boost::lexical_cast<uint16_t>(_mb_eeprom["revision"])); } if (_mb_eeprom.has_key("serial")) { _string_to_bytes(_mb_eeprom["serial"], MB_SERIAL_LEN, map.serial); @@ -198,13 +198,13 @@ void e300_eeprom_manager::write_mb_eeprom(const mboard_eeprom_t& eeprom) e300_eeprom_manager::mboard_t e300_eeprom_manager::get_mb_type(void) const { boost::mutex::scoped_lock(_mutex); - boost::uint16_t pid = boost::lexical_cast<boost::uint16_t>( + uint16_t pid = boost::lexical_cast<uint16_t>( _mb_eeprom["product"]); return get_mb_type(pid); } e300_eeprom_manager::mboard_t e300_eeprom_manager::get_mb_type( - boost::uint16_t pid) + uint16_t pid) { switch (pid) { case E300_MB_PID: @@ -225,7 +225,7 @@ e300_eeprom_manager::mboard_t e300_eeprom_manager::get_mb_type( std::string e300_eeprom_manager::get_mb_type_string(void) const { boost::mutex::scoped_lock(_mutex); - boost::uint16_t product = boost::lexical_cast<boost::uint16_t>( + uint16_t product = boost::lexical_cast<uint16_t>( _mb_eeprom["product"]); switch (product) { case E300_MB_PID: diff --git a/host/lib/usrp/e300/e300_eeprom_manager.hpp b/host/lib/usrp/e300/e300_eeprom_manager.hpp index b06eeada9..14acfba26 100644 --- a/host/lib/usrp/e300/e300_eeprom_manager.hpp +++ b/host/lib/usrp/e300/e300_eeprom_manager.hpp @@ -28,18 +28,18 @@ namespace uhd { namespace usrp { namespace e300 { -static const boost::uint16_t E300_MB_PID = 0x77d1; -static const boost::uint16_t E310_SG1_MB_PID = 0x77d2; -static const boost::uint16_t E310_SG3_MB_PID = 0x77d3; +static const uint16_t E300_MB_PID = 0x77d1; +static const uint16_t E310_SG1_MB_PID = 0x77d2; +static const uint16_t E310_SG3_MB_PID = 0x77d3; -static const boost::uint16_t E300_DB_PID = 0x0100; -static const boost::uint16_t E310_DB_PID = 0x0110; +static const uint16_t E300_DB_PID = 0x0100; +static const uint16_t E310_DB_PID = 0x0110; -static const boost::uint16_t E310_MB_MAP_MAJOR = 0x0001; -static const boost::uint16_t E310_MB_MAP_MINOR = 0x0000; +static const uint16_t E310_MB_MAP_MAJOR = 0x0001; +static const uint16_t E310_MB_MAP_MINOR = 0x0000; -static const boost::uint16_t E310_DB_MAP_MAJOR = 0x0001; -static const boost::uint16_t E310_DB_MAP_MINOR = 0x0000; +static const uint16_t E310_DB_MAP_MAJOR = 0x0001; +static const uint16_t E310_DB_MAP_MINOR = 0x0000; class e300_eeprom_manager : boost::noncopyable { @@ -72,7 +72,7 @@ public: enum mboard_t {USRP_E300_MB, USRP_E310_SG1_MB, USRP_E310_SG3_MB, UNKNOWN}; mboard_t get_mb_type(void) const; - static mboard_t get_mb_type(boost::uint16_t pid); + static mboard_t get_mb_type(uint16_t pid); std::string get_mb_type_string(void) const; private: // types @@ -86,37 +86,37 @@ private: // types struct mb_eeprom_map_t { // Data format version - boost::uint16_t data_version_major; - boost::uint16_t data_version_minor; + uint16_t data_version_major; + uint16_t data_version_minor; // NIC mac address - boost::uint8_t mac_addr[6]; + uint8_t mac_addr[6]; // HW identification info - boost::uint16_t hw_product; - boost::uint16_t hw_revision; + uint16_t hw_product; + uint16_t hw_revision; // serial - boost::uint8_t serial[MB_SERIAL_LEN]; - boost::uint8_t pad[20 - MB_SERIAL_LEN]; + uint8_t serial[MB_SERIAL_LEN]; + uint8_t pad[20 - MB_SERIAL_LEN]; //User specific - boost::uint8_t user_name[MB_NAME_LEN]; + uint8_t user_name[MB_NAME_LEN]; }; struct db_eeprom_map_t { // Data format version - boost::uint16_t data_version_major; - boost::uint16_t data_version_minor; + uint16_t data_version_major; + uint16_t data_version_minor; // HW identification info - boost::uint16_t hw_product; - boost::uint16_t hw_revision; + uint16_t hw_product; + uint16_t hw_revision; // serial - boost::uint8_t serial[DB_SERIAL_LEN]; - boost::uint8_t pad[20 - DB_SERIAL_LEN]; + uint8_t serial[DB_SERIAL_LEN]; + uint8_t pad[20 - DB_SERIAL_LEN]; }; private: // members diff --git a/host/lib/usrp/e300/e300_fifo_config.cpp b/host/lib/usrp/e300/e300_fifo_config.cpp index ac4ace7f2..4138bb581 100644 --- a/host/lib/usrp/e300/e300_fifo_config.cpp +++ b/host/lib/usrp/e300/e300_fifo_config.cpp @@ -17,7 +17,7 @@ #ifdef E300_NATIVE -#include <boost/cstdint.hpp> +#include <stdint.h> #include <uhd/config.hpp> // constants coded into the fpga parameters @@ -141,15 +141,15 @@ struct __mem_addrz_t /*********************************************************************** * peek n' poke mmapped space **********************************************************************/ -UHD_INLINE void zf_poke32(const boost::uint32_t addr, const boost::uint32_t data) +UHD_INLINE void zf_poke32(const uint32_t addr, const uint32_t data) { - volatile boost::uint32_t *p = reinterpret_cast<boost::uint32_t *>(addr); + volatile uint32_t *p = reinterpret_cast<uint32_t *>(addr); *p = data; } -UHD_INLINE boost::uint32_t zf_peek32(const boost::uint32_t addr) +UHD_INLINE uint32_t zf_peek32(const uint32_t addr) { - volatile const boost::uint32_t *p = reinterpret_cast<const boost::uint32_t *>(addr); + volatile const uint32_t *p = reinterpret_cast<const uint32_t *>(addr); return *p; } @@ -206,7 +206,7 @@ public: //UHD_MSG(status) << boost::format("data 0x%x") % addrs.data << std::endl; //UHD_MSG(status) << boost::format("ctrl 0x%x") % addrs.ctrl << std::endl; - const boost::uint32_t sig = zf_peek32(_addrs.ctrl + ARBITER_RD_SIG); + const uint32_t sig = zf_peek32(_addrs.ctrl + ARBITER_RD_SIG); UHD_ASSERT_THROW((sig >> 16) == 0xACE0); zf_poke32(_addrs.ctrl + ARBITER_WR_CLEAR, 1); @@ -240,7 +240,7 @@ public: { if (zf_peek32(_addrs.ctrl + ARBITER_RB_STATUS_OCC)) { - const boost::uint32_t sts = zf_peek32(_addrs.ctrl + ARBITER_RB_STATUS); + const uint32_t sts = zf_peek32(_addrs.ctrl + ARBITER_RB_STATUS); UHD_ASSERT_THROW((sts >> 7) & 0x1); //assert OK UHD_ASSERT_THROW((sts & 0xf) == _addrs.which); //expected tag zf_poke32(_addrs.ctrl + ARBITER_WR_STS_RDY, 1); //pop from sts fifo diff --git a/host/lib/usrp/e300/e300_fpga_defs.hpp b/host/lib/usrp/e300/e300_fpga_defs.hpp index 36dd47383..af54c0a9a 100644 --- a/host/lib/usrp/e300/e300_fpga_defs.hpp +++ b/host/lib/usrp/e300/e300_fpga_defs.hpp @@ -21,8 +21,8 @@ namespace uhd { namespace usrp { namespace e300 { namespace fpga { static const size_t NUM_RADIOS = 2; -static const boost::uint32_t COMPAT_MAJOR = 16; -static const boost::uint32_t COMPAT_MINOR = 0; +static const uint32_t COMPAT_MAJOR = 16; +static const uint32_t COMPAT_MINOR = 0; }}}} // namespace diff --git a/host/lib/usrp/e300/e300_global_regs.cpp b/host/lib/usrp/e300/e300_global_regs.cpp index 3ba895826..bfd166e67 100644 --- a/host/lib/usrp/e300/e300_global_regs.cpp +++ b/host/lib/usrp/e300/e300_global_regs.cpp @@ -17,7 +17,7 @@ #include "e300_global_regs.hpp" -#include <boost/cstdint.hpp> +#include <stdint.h> #include <uhd/exception.hpp> #include <uhd/utils/byteswap.hpp> #include <cstring> @@ -36,14 +36,14 @@ public: { } - boost::uint32_t peek32(const uhd::wb_iface::wb_addr_type addr) + uint32_t peek32(const uhd::wb_iface::wb_addr_type addr) { // setup readback register _poke32(_ctrl_base + global_regs::SR_CORE_READBACK, addr); return _peek32(_ctrl_base); } - void poke32(const uhd::wb_iface::wb_addr_type addr, const boost::uint32_t data) + void poke32(const uhd::wb_iface::wb_addr_type addr, const uint32_t data) { _poke32(_ctrl_base + static_cast<size_t>(addr), data); } @@ -52,15 +52,15 @@ public: private: const size_t _ctrl_base; - UHD_INLINE void _poke32(const boost::uint32_t addr, const boost::uint32_t data) + UHD_INLINE void _poke32(const uint32_t addr, const uint32_t data) { - volatile boost::uint32_t *p = reinterpret_cast<boost::uint32_t *>(addr); + volatile uint32_t *p = reinterpret_cast<uint32_t *>(addr); *p = data; } - UHD_INLINE boost::uint32_t _peek32(const boost::uint32_t addr) + UHD_INLINE uint32_t _peek32(const uint32_t addr) { - volatile const boost::uint32_t *p = reinterpret_cast<const boost::uint32_t *>(addr); + volatile const uint32_t *p = reinterpret_cast<const uint32_t *>(addr); return *p; } }; @@ -81,12 +81,12 @@ public: { } - boost::uint32_t peek32(const uhd::wb_iface::wb_addr_type addr) + uint32_t peek32(const uhd::wb_iface::wb_addr_type addr) { global_regs_transaction_t transaction; - transaction.is_poke = uhd::htonx<boost::uint32_t>(0); - transaction.addr = uhd::htonx<boost::uint32_t>( - static_cast<boost::uint32_t>(addr)); + transaction.is_poke = uhd::htonx<uint32_t>(0); + transaction.addr = uhd::htonx<uint32_t>( + static_cast<uint32_t>(addr)); { uhd::transport::managed_send_buffer::sptr buff = _xport->get_send_buff(10.0); if (not buff or buff->size() < sizeof(transaction)) @@ -100,16 +100,16 @@ public: throw std::runtime_error("global_regs_zc_impl recv timeout"); std::memcpy(&transaction, buff->cast<const void *>(), sizeof(transaction)); } - return uhd::ntohx<boost::uint32_t>(transaction.data); + return uhd::ntohx<uint32_t>(transaction.data); } - void poke32(const uhd::wb_iface::wb_addr_type addr, const boost::uint32_t data) + void poke32(const uhd::wb_iface::wb_addr_type addr, const uint32_t data) { global_regs_transaction_t transaction; - transaction.is_poke = uhd::htonx<boost::uint32_t>(1); - transaction.addr = uhd::htonx<boost::uint32_t>( - static_cast<boost::uint32_t>(addr)); - transaction.data = uhd::htonx<boost::uint32_t>(data); + transaction.is_poke = uhd::htonx<uint32_t>(1); + transaction.addr = uhd::htonx<uint32_t>( + static_cast<uint32_t>(addr)); + transaction.data = uhd::htonx<uint32_t>(data); { uhd::transport::managed_send_buffer::sptr buff = _xport->get_send_buff(10.0); if (not buff or buff->size() < sizeof(transaction)) diff --git a/host/lib/usrp/e300/e300_global_regs.hpp b/host/lib/usrp/e300/e300_global_regs.hpp index 12693da79..3b6b26239 100644 --- a/host/lib/usrp/e300/e300_global_regs.hpp +++ b/host/lib/usrp/e300/e300_global_regs.hpp @@ -24,10 +24,10 @@ namespace uhd { namespace usrp { namespace e300 { struct global_regs_transaction_t { - boost::uint32_t is_poke; - boost::uint32_t addr; - boost::uint32_t data; - boost::uint32_t pad; + uint32_t is_poke; + uint32_t addr; + uint32_t data; + uint32_t pad; }; class global_regs : boost::noncopyable, public virtual uhd::wb_iface @@ -63,12 +63,12 @@ public: static const size_t PPS_EXT = 3; }; -UHD_INLINE boost::uint32_t XB_ADDR(const boost::uint32_t addr) +UHD_INLINE uint32_t XB_ADDR(const uint32_t addr) { return global_regs::SR_CORE_XBAR + (addr << 2); } -UHD_INLINE boost::uint32_t DST_ADDR(const boost::uint32_t addr) +UHD_INLINE uint32_t DST_ADDR(const uint32_t addr) { return global_regs::SR_CORE_DST + (addr << 2); } diff --git a/host/lib/usrp/e300/e300_i2c.cpp b/host/lib/usrp/e300/e300_i2c.cpp index d8f535a98..b3e872aff 100644 --- a/host/lib/usrp/e300/e300_i2c.cpp +++ b/host/lib/usrp/e300/e300_i2c.cpp @@ -37,14 +37,14 @@ public: } void set_i2c_reg8( - const boost::uint8_t addr, - const boost::uint8_t reg, - const boost::uint8_t value) + const uint8_t addr, + const uint8_t reg, + const uint8_t value) { i2c_transaction_t transaction; transaction.type = WRITE | ONEBYTE; transaction.addr = addr; - transaction.reg = uhd::htonx<boost::uint16_t>(reg); + transaction.reg = uhd::htonx<uint16_t>(reg); transaction.data = value; { uhd::transport::managed_send_buffer::sptr buff = _xport->get_send_buff(10.0); @@ -55,14 +55,14 @@ public: } } - boost::uint8_t get_i2c_reg8( - const boost::uint8_t addr, - const boost::uint8_t reg) + uint8_t get_i2c_reg8( + const uint8_t addr, + const uint8_t reg) { i2c_transaction_t transaction; transaction.type = READ | ONEBYTE; transaction.addr = addr; - transaction.reg = uhd::htonx<boost::uint16_t>(reg); + transaction.reg = uhd::htonx<uint16_t>(reg); { uhd::transport::managed_send_buffer::sptr buff = _xport->get_send_buff(10.0); if (not buff or buff->size() < sizeof(transaction)) @@ -80,14 +80,14 @@ public: } void set_i2c_reg16( - const boost::uint8_t addr, - const boost::uint16_t reg, - const boost::uint8_t value) + const uint8_t addr, + const uint16_t reg, + const uint8_t value) { i2c_transaction_t transaction; transaction.type = WRITE | TWOBYTE; transaction.addr = addr; - transaction.reg = uhd::htonx<boost::uint16_t>(reg); + transaction.reg = uhd::htonx<uint16_t>(reg); transaction.data = value; { uhd::transport::managed_send_buffer::sptr buff = _xport->get_send_buff(10.0); @@ -98,14 +98,14 @@ public: } } - boost::uint8_t get_i2c_reg16( - const boost::uint8_t addr, - const boost::uint16_t reg) + uint8_t get_i2c_reg16( + const uint8_t addr, + const uint16_t reg) { i2c_transaction_t transaction; transaction.type = READ | TWOBYTE; transaction.addr = addr; - transaction.reg = uhd::htonx<boost::uint16_t>(reg); + transaction.reg = uhd::htonx<uint16_t>(reg); { uhd::transport::managed_send_buffer::sptr buff = _xport->get_send_buff(10.0); if (not buff or buff->size() < sizeof(transaction)) @@ -145,14 +145,14 @@ public: } void set_i2c_reg8( - const boost::uint8_t addr, - const boost::uint8_t reg, - const boost::uint8_t value) + const uint8_t addr, + const uint8_t reg, + const uint8_t value) { i2c_transaction_t transaction; transaction.type = i2c::WRITE | ONEBYTE; transaction.addr = addr; - transaction.reg = uhd::htonx<boost::uint16_t>(reg); + transaction.reg = uhd::htonx<uint16_t>(reg); transaction.data = value; _xport->send( @@ -161,14 +161,14 @@ public: sizeof(transaction))); } - boost::uint8_t get_i2c_reg8( - const boost::uint8_t addr, - const boost::uint8_t reg) + uint8_t get_i2c_reg8( + const uint8_t addr, + const uint8_t reg) { i2c_transaction_t transaction; transaction.type = i2c::READ | ONEBYTE; transaction.addr = addr; - transaction.reg = uhd::htonx<boost::uint16_t>(reg); + transaction.reg = uhd::htonx<uint16_t>(reg); transaction.data = 0; _xport->send( @@ -176,7 +176,7 @@ public: &transaction, sizeof(transaction))); - boost::uint8_t buff[sizeof(i2c_transaction_t)] = {}; + uint8_t buff[sizeof(i2c_transaction_t)] = {}; const size_t nbytes = _xport->recv( boost::asio::buffer(buff), 0.100); if (not (nbytes == sizeof(transaction))) @@ -186,14 +186,14 @@ public: } void set_i2c_reg16( - const boost::uint8_t addr, - const boost::uint16_t reg, - const boost::uint8_t value) + const uint8_t addr, + const uint16_t reg, + const uint8_t value) { i2c_transaction_t transaction; transaction.type = i2c::WRITE | TWOBYTE; transaction.addr = addr; - transaction.reg = uhd::htonx<boost::uint16_t>(reg); + transaction.reg = uhd::htonx<uint16_t>(reg); transaction.data = value; _xport->send( @@ -202,14 +202,14 @@ public: sizeof(transaction))); } - boost::uint8_t get_i2c_reg16( - const boost::uint8_t addr, - const boost::uint16_t reg) + uint8_t get_i2c_reg16( + const uint8_t addr, + const uint16_t reg) { i2c_transaction_t transaction; transaction.type = i2c::READ | TWOBYTE; transaction.addr = addr; - transaction.reg = uhd::htonx<boost::uint16_t>(reg); + transaction.reg = uhd::htonx<uint16_t>(reg); transaction.data = 0; _xport->send( @@ -217,7 +217,7 @@ public: &transaction, sizeof(transaction))); - boost::uint8_t buff[sizeof(i2c_transaction_t)] = {}; + uint8_t buff[sizeof(i2c_transaction_t)] = {}; const size_t nbytes = _xport->recv( boost::asio::buffer(buff), 0.100); if (not (nbytes == sizeof(transaction))) @@ -248,7 +248,7 @@ i2c::sptr i2c::make_simple_udp( #include <sys/ioctl.h> #include <boost/thread.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> namespace uhd { namespace usrp { namespace e300 { @@ -268,11 +268,11 @@ public: } void set_i2c_reg8( - const boost::uint8_t addr, - const boost::uint8_t reg, - const boost::uint8_t value) + const uint8_t addr, + const uint8_t reg, + const uint8_t value) { - boost::uint8_t outbuf[2]; + uint8_t outbuf[2]; i2c_rdwr_ioctl_data packets; i2c_msg messages[1]; @@ -294,20 +294,20 @@ public: boost::this_thread::sleep(boost::posix_time::milliseconds(5)); } - boost::uint8_t get_i2c_reg8( - const boost::uint8_t addr, - const boost::uint8_t reg) + uint8_t get_i2c_reg8( + const uint8_t addr, + const uint8_t reg) { i2c_rdwr_ioctl_data packets; i2c_msg messages[2]; - boost::uint8_t outbuf = reg; + uint8_t outbuf = reg; messages[0].addr = addr; messages[0].flags = 0; messages[0].len = sizeof(outbuf); messages[0].buf = &outbuf; - boost::uint8_t inbuf; + uint8_t inbuf; messages[1].addr = addr; messages[1].flags = I2C_M_RD; messages[1].len = sizeof(inbuf); @@ -325,11 +325,11 @@ public: // the daughterboard uses 16 bit addresses void set_i2c_reg16( - const boost::uint8_t addr, - const boost::uint16_t reg, - const boost::uint8_t value) + const uint8_t addr, + const uint16_t reg, + const uint8_t value) { - boost::uint8_t outbuf[3]; + uint8_t outbuf[3]; i2c_rdwr_ioctl_data packets; i2c_msg messages[1]; @@ -354,15 +354,15 @@ public: // the daughterboard eeprom uses 16 bit addresses - boost::uint8_t get_i2c_reg16( - const boost::uint8_t addr, - const boost::uint16_t reg) + uint8_t get_i2c_reg16( + const uint8_t addr, + const uint16_t reg) { i2c_rdwr_ioctl_data packets; i2c_msg messages[2]; // always little endian - boost::uint8_t outbuf[2]; + uint8_t outbuf[2]; outbuf[0] = (reg >> 8) & 0xff; outbuf[1] = reg & 0xff; @@ -371,7 +371,7 @@ public: messages[0].len = sizeof(outbuf); messages[0].buf = outbuf; - boost::uint8_t inbuf; + uint8_t inbuf; messages[1].addr = addr; messages[1].flags = I2C_M_RD; messages[1].len = sizeof(inbuf); diff --git a/host/lib/usrp/e300/e300_i2c.hpp b/host/lib/usrp/e300/e300_i2c.hpp index 6cca7ab70..98a1f80aa 100644 --- a/host/lib/usrp/e300/e300_i2c.hpp +++ b/host/lib/usrp/e300/e300_i2c.hpp @@ -19,7 +19,7 @@ #define INCLUDED_E300_I2C_HPP #include <boost/noncopyable.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/shared_ptr.hpp> #include <uhd/transport/zero_copy.hpp> @@ -27,10 +27,10 @@ namespace uhd { namespace usrp { namespace e300 { struct i2c_transaction_t { - boost::uint16_t reg; - boost::uint8_t addr; - boost::uint8_t data; - boost::uint8_t type; + uint16_t reg; + uint8_t addr; + uint8_t data; + uint8_t type; }; class i2c : public boost::noncopyable @@ -44,32 +44,32 @@ public: const std::string &ip_addr, const std::string &port); - virtual boost::uint8_t get_i2c_reg8( - const boost::uint8_t addr, - const boost::uint8_t reg) = 0; + virtual uint8_t get_i2c_reg8( + const uint8_t addr, + const uint8_t reg) = 0; - virtual boost::uint8_t get_i2c_reg16( - const boost::uint8_t addr, - const boost::uint16_t reg) = 0; + virtual uint8_t get_i2c_reg16( + const uint8_t addr, + const uint16_t reg) = 0; virtual void set_i2c_reg8( - const boost::uint8_t addr, - const boost::uint8_t reg, - const boost::uint8_t value) = 0; + const uint8_t addr, + const uint8_t reg, + const uint8_t value) = 0; virtual void set_i2c_reg16( - const boost::uint8_t addr, - const boost::uint16_t reg, - const boost::uint8_t value) = 0; + const uint8_t addr, + const uint16_t reg, + const uint8_t value) = 0; - static const boost::uint8_t DB_EEPROM_ADDR = 0x50; - static const boost::uint8_t MB_EEPROM_ADDR = 0x51; + static const uint8_t DB_EEPROM_ADDR = 0x50; + static const uint8_t MB_EEPROM_ADDR = 0x51; - static const boost::uint8_t WRITE = 0x1; - static const boost::uint8_t READ = 0x0; - static const boost::uint8_t TWOBYTE = 0x4; - static const boost::uint8_t ONEBYTE = 0x2; + static const uint8_t WRITE = 0x1; + static const uint8_t READ = 0x0; + static const uint8_t TWOBYTE = 0x4; + static const uint8_t ONEBYTE = 0x2; }; }}}; diff --git a/host/lib/usrp/e300/e300_impl.cpp b/host/lib/usrp/e300/e300_impl.cpp index 114686b4f..84f50c67b 100644 --- a/host/lib/usrp/e300/e300_impl.cpp +++ b/host/lib/usrp/e300/e300_impl.cpp @@ -104,7 +104,7 @@ static std::vector<std::string> discover_ip_addrs( // loop for replies until timeout while (true) { - boost::uint8_t buff[sizeof(i2c_transaction_t)] = {}; + uint8_t buff[sizeof(i2c_transaction_t)] = {}; const size_t nbytes = udp_bcast_xport->recv(boost::asio::buffer(buff), 0.050); if (nbytes == 0) break; //No more responses @@ -273,7 +273,7 @@ static device::sptr e300_make(const device_addr_t &device_addr) void get_e3x0_fpga_images(const uhd::device_addr_t &device_addr, std::string &fpga_image, std::string &idle_image){ - const boost::uint16_t pid = boost::lexical_cast<boost::uint16_t>( + const uint16_t pid = boost::lexical_cast<uint16_t>( device_addr["product"]); //extract the FPGA path for the e300 @@ -526,11 +526,11 @@ e300_impl::e300_impl(const uhd::device_addr_t &device_addr) gpio_atr_3000::sptr fp_gpio = gpio_atr_3000::make(_radio_perifs[0].ctrl, radio::sr_addr(radio::FP_GPIO), radio::RB32_FP_GPIO); BOOST_FOREACH(const gpio_attr_map_t::value_type attr, gpio_attr_map) { - _tree->create<boost::uint32_t>(mb_path / "gpio" / "INT0" / attr.second) + _tree->create<uint32_t>(mb_path / "gpio" / "INT0" / attr.second) .add_coerced_subscriber(boost::bind(&gpio_atr_3000::set_gpio_attr, fp_gpio, attr.first, _1)) .set(0); } - _tree->create<boost::uint8_t>(mb_path / "gpio" / "INT0" / "READBACK") + _tree->create<uint8_t>(mb_path / "gpio" / "INT0" / "READBACK") .set_publisher(boost::bind(&gpio_atr_3000::read_gpio, fp_gpio)); @@ -639,7 +639,7 @@ e300_impl::e300_impl(const uhd::device_addr_t &device_addr) uhd::sensor_value_t e300_impl::_get_fe_pll_lock(const bool is_tx) { - const boost::uint32_t st = + const uint32_t st = _global_regs->peek32(global_regs::RB32_CORE_PLL); const bool locked = is_tx ? ((st & 0x1) > 0) : ((st & 0x2) > 0); return sensor_value_t("LO", locked, "locked", "unlocked"); @@ -712,16 +712,16 @@ void e300_impl::_register_loopback_self_test(wb_iface::sptr iface) for (size_t i = 0; i < 100; i++) { boost::hash_combine(hash, i); - iface->poke32(radio::sr_addr(radio::TEST), boost::uint32_t(hash)); - test_fail = iface->peek32(radio::RB32_TEST) != boost::uint32_t(hash); + iface->poke32(radio::sr_addr(radio::TEST), uint32_t(hash)); + test_fail = iface->peek32(radio::RB32_TEST) != uint32_t(hash); if (test_fail) break; //exit loop on any failure } UHD_MSG(status) << ((test_fail)? " fail" : "pass") << std::endl; } -boost::uint32_t e300_impl::_get_version(compat_t which) +uint32_t e300_impl::_get_version(compat_t which) { - const boost::uint16_t compat_num + const uint16_t compat_num = _global_regs->peek32(global_regs::RB32_CORE_COMPAT); switch(which) { @@ -736,18 +736,18 @@ boost::uint32_t e300_impl::_get_version(compat_t which) std::string e300_impl::_get_version_hash(void) { - const boost::uint32_t git_hash + const uint32_t git_hash = _global_regs->peek32(global_regs::RB32_CORE_GITHASH); return str(boost::format("%7x%s") % (git_hash & 0x0FFFFFFF) % ((git_hash & 0xF000000) ? "-dirty" : "")); } -boost::uint32_t e300_impl::_allocate_sid(const sid_config_t &config) +uint32_t e300_impl::_allocate_sid(const sid_config_t &config) { - const boost::uint32_t stream = (config.dst_prefix | (config.router_dst_there << 2)) & 0xff; + const uint32_t stream = (config.dst_prefix | (config.router_dst_there << 2)) & 0xff; - const boost::uint32_t sid = 0 + const uint32_t sid = 0 | (E300_DEVICE_HERE << 24) | (_sid_framer << 16) | (config.router_addr_there << 8) @@ -785,7 +785,7 @@ boost::uint32_t e300_impl::_allocate_sid(const sid_config_t &config) return sid; } -void e300_impl::_setup_dest_mapping(const boost::uint32_t sid, const size_t which_stream) +void e300_impl::_setup_dest_mapping(const uint32_t sid, const size_t which_stream) { UHD_LOG << boost::format("Setting up dest map for 0x%lx to be stream %d") % (sid & 0xff) % which_stream << std::endl; @@ -825,44 +825,44 @@ void e300_impl::_sync_times() } size_t e300_impl::_get_axi_dma_channel( - boost::uint8_t destination, - boost::uint8_t prefix) + uint8_t destination, + uint8_t prefix) { - static const boost::uint32_t RADIO_GRP_SIZE = 4; - static const boost::uint32_t RADIO0_GRP = 0; - static const boost::uint32_t RADIO1_GRP = 1; + static const uint32_t RADIO_GRP_SIZE = 4; + static const uint32_t RADIO0_GRP = 0; + static const uint32_t RADIO1_GRP = 1; - boost::uint32_t radio_grp = (destination == E300_XB_DST_R0) ? RADIO0_GRP : RADIO1_GRP; + uint32_t radio_grp = (destination == E300_XB_DST_R0) ? RADIO0_GRP : RADIO1_GRP; return ((radio_grp * RADIO_GRP_SIZE) + prefix); } -boost::uint16_t e300_impl::_get_udp_port( - boost::uint8_t destination, - boost::uint8_t prefix) +uint16_t e300_impl::_get_udp_port( + uint8_t destination, + uint8_t prefix) { if (destination == E300_XB_DST_R0) { if (prefix == E300_RADIO_DEST_PREFIX_CTRL) - return boost::lexical_cast<boost::uint16_t>(E300_SERVER_CTRL_PORT0); + return boost::lexical_cast<uint16_t>(E300_SERVER_CTRL_PORT0); else if (prefix == E300_RADIO_DEST_PREFIX_TX) - return boost::lexical_cast<boost::uint16_t>(E300_SERVER_TX_PORT0); + return boost::lexical_cast<uint16_t>(E300_SERVER_TX_PORT0); else if (prefix == E300_RADIO_DEST_PREFIX_RX) - return boost::lexical_cast<boost::uint16_t>(E300_SERVER_RX_PORT0); + return boost::lexical_cast<uint16_t>(E300_SERVER_RX_PORT0); } else if (destination == E300_XB_DST_R1) { if (prefix == E300_RADIO_DEST_PREFIX_CTRL) - return boost::lexical_cast<boost::uint16_t>(E300_SERVER_CTRL_PORT1); + return boost::lexical_cast<uint16_t>(E300_SERVER_CTRL_PORT1); else if (prefix == E300_RADIO_DEST_PREFIX_TX) - return boost::lexical_cast<boost::uint16_t>(E300_SERVER_TX_PORT1); + return boost::lexical_cast<uint16_t>(E300_SERVER_TX_PORT1); else if (prefix == E300_RADIO_DEST_PREFIX_RX) - return boost::lexical_cast<boost::uint16_t>(E300_SERVER_RX_PORT1); + return boost::lexical_cast<uint16_t>(E300_SERVER_RX_PORT1); } throw uhd::value_error(str(boost::format("No UDP port defined for combination: %u %u") % destination % prefix)); } e300_impl::both_xports_t e300_impl::_make_transport( - const boost::uint8_t &destination, - const boost::uint8_t &prefix, + const uint8_t &destination, + const uint8_t &prefix, const uhd::transport::zero_copy_xport_params ¶ms, - boost::uint32_t &sid) + uint32_t &sid) { both_xports_t xports; @@ -890,7 +890,7 @@ e300_impl::both_xports_t e300_impl::_make_transport( } else if (_xport_path == ETH) { // lookup which udp port we need // to use to create our transport - const boost::uint16_t port = _get_udp_port( + const uint16_t port = _get_udp_port( destination, prefix); @@ -950,7 +950,7 @@ void e300_impl::_setup_radio(const size_t dspno) //////////////////////////////////////////////////////////////////// // make a transport, grab a sid - boost::uint32_t ctrl_sid; + uint32_t ctrl_sid; both_xports_t ctrl_xports = _make_transport( dspno ? E300_XB_DST_R1 : E300_XB_DST_R0, E300_RADIO_DEST_PREFIX_CTRL, @@ -1102,7 +1102,7 @@ void e300_impl::_update_enables(void) void e300_impl::_update_gpio_state(void) { - boost::uint32_t misc_reg = 0 + uint32_t misc_reg = 0 | (_misc.pps_sel << gpio_t::PPS_SEL) | (_misc.mimo << gpio_t::MIMO) | (_misc.codec_arst << gpio_t::CODEC_ARST) diff --git a/host/lib/usrp/e300/e300_impl.hpp b/host/lib/usrp/e300/e300_impl.hpp index e9a0b4b9a..632424438 100644 --- a/host/lib/usrp/e300/e300_impl.hpp +++ b/host/lib/usrp/e300/e300_impl.hpp @@ -85,18 +85,18 @@ static const size_t E300_RX_FC_REQUEST_FREQ = 32; // per flow ctrl window static const size_t E300_TX_FC_RESPONSE_FREQ = 8; // per flow ctrl window // crossbar settings -static const boost::uint8_t E300_RADIO_DEST_PREFIX_TX = 0; -static const boost::uint8_t E300_RADIO_DEST_PREFIX_CTRL = 1; -static const boost::uint8_t E300_RADIO_DEST_PREFIX_RX = 2; +static const uint8_t E300_RADIO_DEST_PREFIX_TX = 0; +static const uint8_t E300_RADIO_DEST_PREFIX_CTRL = 1; +static const uint8_t E300_RADIO_DEST_PREFIX_RX = 2; -static const boost::uint8_t E300_XB_DST_AXI = 0; -static const boost::uint8_t E300_XB_DST_R0 = 1; -static const boost::uint8_t E300_XB_DST_R1 = 2; -static const boost::uint8_t E300_XB_DST_CE0 = 3; -static const boost::uint8_t E300_XB_DST_CE1 = 4; +static const uint8_t E300_XB_DST_AXI = 0; +static const uint8_t E300_XB_DST_R0 = 1; +static const uint8_t E300_XB_DST_R1 = 2; +static const uint8_t E300_XB_DST_CE0 = 3; +static const uint8_t E300_XB_DST_CE1 = 4; -static const boost::uint8_t E300_DEVICE_THERE = 2; -static const boost::uint8_t E300_DEVICE_HERE = 0; +static const uint8_t E300_DEVICE_THERE = 2; +static const uint8_t E300_DEVICE_HERE = 0; static const size_t E300_R0_CTRL_STREAM = (0 << 2) | E300_RADIO_DEST_PREFIX_CTRL; static const size_t E300_R0_TX_DATA_STREAM = (0 << 2) | E300_RADIO_DEST_PREFIX_TX; @@ -137,10 +137,10 @@ private: // types // sid convenience struct struct sid_config_t { - boost::uint8_t router_addr_there; - boost::uint8_t dst_prefix; //2bits - boost::uint8_t router_dst_there; - boost::uint8_t router_dst_here; + uint8_t router_addr_there; + uint8_t dst_prefix; //2bits + uint8_t router_dst_there; + uint8_t router_dst_here; }; // perifs in the radio core @@ -192,16 +192,16 @@ private: // types rx_bandsel_a(0), rx_bandsel_b(0), rx_bandsel_c(0) {} - boost::uint32_t pps_sel; - boost::uint32_t mimo; - boost::uint32_t codec_arst; + uint32_t pps_sel; + uint32_t mimo; + uint32_t codec_arst; - boost::uint32_t tx_bandsels; - boost::uint32_t rx_bandsel_a; - boost::uint32_t rx_bandsel_b; - boost::uint32_t rx_bandsel_c; + uint32_t tx_bandsels; + uint32_t rx_bandsel_a; + uint32_t rx_bandsel_b; + uint32_t rx_bandsel_c; - boost::uint32_t time_sync; + uint32_t time_sync; static const size_t PPS_SEL = 0; static const size_t MIMO = 2; @@ -216,30 +216,30 @@ private: // types private: // methods void _register_loopback_self_test(uhd::wb_iface::sptr iface); - boost::uint32_t _get_version(compat_t which); + uint32_t _get_version(compat_t which); std::string _get_version_hash(void); void _setup_radio(const size_t which_radio); - boost::uint32_t _allocate_sid(const sid_config_t &config); + uint32_t _allocate_sid(const sid_config_t &config); void _setup_dest_mapping( - const boost::uint32_t sid, + const uint32_t sid, const size_t which_stream); size_t _get_axi_dma_channel( - boost::uint8_t destination, - boost::uint8_t prefix); + uint8_t destination, + uint8_t prefix); - boost::uint16_t _get_udp_port( - boost::uint8_t destination, - boost::uint8_t prefix); + uint16_t _get_udp_port( + uint8_t destination, + uint8_t prefix); both_xports_t _make_transport( - const boost::uint8_t &destination, - const boost::uint8_t &prefix, + const uint8_t &destination, + const uint8_t &prefix, const uhd::transport::zero_copy_xport_params ¶ms, - boost::uint32_t &sid); + uint32_t &sid); double _get_tick_rate(void){return _tick_rate;} double _set_tick_rate(const double rate); diff --git a/host/lib/usrp/e300/e300_io_impl.cpp b/host/lib/usrp/e300/e300_io_impl.cpp index c84042e98..2514b7f40 100644 --- a/host/lib/usrp/e300/e300_io_impl.cpp +++ b/host/lib/usrp/e300/e300_io_impl.cpp @@ -35,7 +35,7 @@ using namespace uhd::transport; namespace uhd { namespace usrp { namespace e300 { -static const boost::uint32_t HW_SEQ_NUM_MASK = 0xfff; +static const uint32_t HW_SEQ_NUM_MASK = 0xfff; /*********************************************************************** * update streamer rates @@ -169,7 +169,7 @@ void e300_impl::_update_subdev_spec( * VITA stuff **********************************************************************/ static void e300_if_hdr_unpack_le( - const boost::uint32_t *packet_buff, + const uint32_t *packet_buff, vrt::if_packet_info_t &if_packet_info ){ if_packet_info.link_type = vrt::if_packet_info_t::LINK_TYPE_CHDR; @@ -177,7 +177,7 @@ static void e300_if_hdr_unpack_le( } static void e300_if_hdr_pack_le( - boost::uint32_t *packet_buff, + uint32_t *packet_buff, vrt::if_packet_info_t &if_packet_info ){ if_packet_info.link_type = vrt::if_packet_info_t::LINK_TYPE_CHDR; @@ -240,7 +240,7 @@ static size_t get_rx_flow_control_window(size_t frame_size, size_t sw_buff_size, } static void handle_rx_flowctrl( - const boost::uint32_t sid, + const uint32_t sid, zero_copy_if::sptr xport, boost::shared_ptr<e300_rx_fc_cache_t> fc_cache, const size_t last_seq) @@ -254,7 +254,7 @@ static void handle_rx_flowctrl( { throw uhd::runtime_error("handle_rx_flowctrl timed out getting a send buffer"); } - boost::uint32_t *pkt = buff->cast<boost::uint32_t *>(); + uint32_t *pkt = buff->cast<uint32_t *>(); //recover seq32 size_t& seq_sw = fc_cache->last_seq_in; @@ -268,7 +268,7 @@ static void handle_rx_flowctrl( vrt::if_packet_info_t packet_info; packet_info.packet_type = vrt::if_packet_info_t::PACKET_TYPE_CONTEXT; packet_info.num_payload_words32 = RXFC_PACKET_LEN_IN_WORDS; - packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(boost::uint32_t); + packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(uint32_t); packet_info.packet_count = seq_sw; packet_info.sob = false; packet_info.eob = false; @@ -283,11 +283,11 @@ static void handle_rx_flowctrl( e300_if_hdr_pack_le(pkt, packet_info); //load payload - pkt[packet_info.num_header_words32+RXFC_CMD_CODE_OFFSET] = uhd::htowx<boost::uint32_t>(0); - pkt[packet_info.num_header_words32+RXFC_SEQ_NUM_OFFSET] = uhd::htowx<boost::uint32_t>(seq_sw); + pkt[packet_info.num_header_words32+RXFC_CMD_CODE_OFFSET] = uhd::htowx<uint32_t>(0); + pkt[packet_info.num_header_words32+RXFC_SEQ_NUM_OFFSET] = uhd::htowx<uint32_t>(seq_sw); //send the buffer over the interface - buff->commit(sizeof(boost::uint32_t)*(packet_info.num_packet_words32)); + buff->commit(sizeof(uint32_t)*(packet_info.num_packet_words32)); } @@ -326,8 +326,8 @@ static void handle_tx_async_msgs(boost::shared_ptr<e300_tx_fc_cache_t> fc_cache, //extract packet info vrt::if_packet_info_t if_packet_info; - if_packet_info.num_packet_words32 = buff->size()/sizeof(boost::uint32_t); - const boost::uint32_t *packet_buff = buff->cast<const boost::uint32_t *>(); + if_packet_info.num_packet_words32 = buff->size()/sizeof(uint32_t); + const uint32_t *packet_buff = buff->cast<const uint32_t *>(); //unpacking can fail try @@ -350,7 +350,7 @@ static void handle_tx_async_msgs(boost::shared_ptr<e300_tx_fc_cache_t> fc_cache, //fill in the async metadata async_metadata_t metadata; - load_metadata_from_buff(uhd::wtohx<boost::uint32_t>, + load_metadata_from_buff(uhd::wtohx<uint32_t>, metadata, if_packet_info, packet_buff, get_tick_rate(), fc_cache->stream_channel); @@ -434,7 +434,7 @@ rx_streamer::sptr e300_impl::get_rx_stream(const uhd::stream_args_t &args_) radio_perifs_t &perif = _radio_perifs[radio_index]; // make a transport, grab a sid - boost::uint32_t data_sid; + uint32_t data_sid; both_xports_t data_xports = _make_transport( radio_index ? E300_XB_DST_R1 : E300_XB_DST_R0, E300_RADIO_DEST_PREFIX_RX, @@ -443,8 +443,8 @@ rx_streamer::sptr e300_impl::get_rx_stream(const uhd::stream_args_t &args_) //calculate packet size static const size_t hdr_size = 0 - + vrt::num_vrl_words32*sizeof(boost::uint32_t) - + vrt::max_if_hdr_words32*sizeof(boost::uint32_t) + + vrt::num_vrl_words32*sizeof(uint32_t) + + vrt::max_if_hdr_words32*sizeof(uint32_t) + sizeof(vrt::if_packet_info_t().tlr) //forced to have trailer - sizeof(vrt::if_packet_info_t().cid) //no class id ever used - sizeof(vrt::if_packet_info_t().tsi) //no int time ever used @@ -548,7 +548,7 @@ tx_streamer::sptr e300_impl::get_tx_stream(const uhd::stream_args_t &args_) // make a transport, grab a sid - boost::uint32_t data_sid; + uint32_t data_sid; both_xports_t data_xports = _make_transport( radio_index ? E300_XB_DST_R1 : E300_XB_DST_R0, E300_RADIO_DEST_PREFIX_TX, @@ -557,8 +557,8 @@ tx_streamer::sptr e300_impl::get_tx_stream(const uhd::stream_args_t &args_) //calculate packet size static const size_t hdr_size = 0 - + vrt::num_vrl_words32*sizeof(boost::uint32_t) - + vrt::max_if_hdr_words32*sizeof(boost::uint32_t) + + vrt::num_vrl_words32*sizeof(uint32_t) + + vrt::max_if_hdr_words32*sizeof(uint32_t) + sizeof(vrt::if_packet_info_t().tlr) //forced to have trailer - sizeof(vrt::if_packet_info_t().cid) //no class id ever used - sizeof(vrt::if_packet_info_t().tsi) //no int time ever used diff --git a/host/lib/usrp/e300/e300_network.cpp b/host/lib/usrp/e300/e300_network.cpp index 0aa5a21ae..e68f2a54d 100644 --- a/host/lib/usrp/e300/e300_network.cpp +++ b/host/lib/usrp/e300/e300_network.cpp @@ -190,7 +190,7 @@ static void e300_codec_ctrl_tunnel( std::memcpy(out, in, sizeof(codec_xact_t)); std::string which_str; - switch (uhd::ntohx<boost::uint32_t>(in->which)) { + switch (uhd::ntohx<uint32_t>(in->which)) { case codec_xact_t::CHAIN_TX1: which_str = "TX1"; break; case codec_xact_t::CHAIN_TX2: @@ -203,7 +203,7 @@ static void e300_codec_ctrl_tunnel( which_str = ""; break; } - switch (uhd::ntohx<boost::uint32_t>(in->action)) { + switch (uhd::ntohx<uint32_t>(in->action)) { case codec_xact_t::ACTION_SET_GAIN: out->gain = _codec_ctrl->set_gain(which_str, in->gain); break; @@ -212,10 +212,10 @@ static void e300_codec_ctrl_tunnel( break; case codec_xact_t::ACTION_SET_ACTIVE_CHANS: _codec_ctrl->set_active_chains( - uhd::ntohx<boost::uint32_t>(in->bits) & (1<<0), - uhd::ntohx<boost::uint32_t>(in->bits) & (1<<1), - uhd::ntohx<boost::uint32_t>(in->bits) & (1<<2), - uhd::ntohx<boost::uint32_t>(in->bits) & (1<<3)); + uhd::ntohx<uint32_t>(in->bits) & (1<<0), + uhd::ntohx<uint32_t>(in->bits) & (1<<1), + uhd::ntohx<uint32_t>(in->bits) & (1<<2), + uhd::ntohx<uint32_t>(in->bits) & (1<<3)); break; case codec_xact_t::ACTION_TUNE: out->freq = _codec_ctrl->tune(which_str, in->freq); @@ -225,7 +225,7 @@ static void e300_codec_ctrl_tunnel( break; case codec_xact_t::ACTION_SET_LOOPBACK: _codec_ctrl->data_port_loopback( - uhd::ntohx<boost::uint32_t>(in->bits) & 1); + uhd::ntohx<uint32_t>(in->bits) & 1); break; case codec_xact_t::ACTION_GET_RSSI: out->rssi = _codec_ctrl->get_rssi(which_str).to_real(); @@ -254,7 +254,7 @@ static void e300_codec_ctrl_tunnel( default: UHD_MSG(status) << "Got unknown request?!" << std::endl; //Zero out actions to fail this request on client - out->action = uhd::htonx<boost::uint32_t>(0); + out->action = uhd::htonx<uint32_t>(0); } socket->send_to(asio::buffer(out_buff, 64), *endpoint); @@ -298,11 +298,11 @@ static void e300_global_regs_tunnel( global_regs_transaction_t *in = reinterpret_cast<global_regs_transaction_t *>(in_buff); - if(uhd::ntohx<boost::uint32_t>(in->is_poke)) { - regs->poke32(uhd::ntohx<boost::uint32_t>(in->addr), uhd::ntohx<boost::uint32_t>(in->data)); + if(uhd::ntohx<uint32_t>(in->is_poke)) { + regs->poke32(uhd::ntohx<uint32_t>(in->addr), uhd::ntohx<uint32_t>(in->data)); } else { - in->data = uhd::htonx<boost::uint32_t>(regs->peek32(uhd::ntohx<boost::uint32_t>(in->addr))); + in->data = uhd::htonx<uint32_t>(regs->peek32(uhd::ntohx<uint32_t>(in->addr))); socket->send_to(asio::buffer(in_buff, 16), *endpoint); } } @@ -347,10 +347,10 @@ static void e300_sensor_tunnel( if (uhd::ntohx(in->which) == ZYNQ_TEMP) { sensor_value_t temp = sensor_manager->get_mb_temp(); // TODO: This is ugly ... use proper serialization - in->value = uhd::htonx<boost::uint32_t>( + in->value = uhd::htonx<uint32_t>( e300_sensor_manager::pack_float_in_uint32_t(temp.to_real())); } else if (uhd::ntohx(in->which) == REF_LOCK) { - in->value = uhd::htonx<boost::uint32_t>( + in->value = uhd::htonx<uint32_t>( sensor_manager->get_ref_lock().to_bool() ? 1 : 0); } else UHD_MSG(status) << "Got unknown request?!" << std::endl; @@ -401,9 +401,9 @@ static void e300_i2c_tunnel( if(in->type & i2c::WRITE) { i2c->set_i2c_reg8( in->addr, - uhd::ntohx<boost::uint16_t>(in->reg), in->data); + uhd::ntohx<uint16_t>(in->reg), in->data); } else { - in->data = i2c->get_i2c_reg8(in->addr, uhd::ntohx<boost::uint16_t>(in->reg)); + in->data = i2c->get_i2c_reg8(in->addr, uhd::ntohx<uint16_t>(in->reg)); socket->send_to(asio::buffer(in_buff, sizeof(in_buff)), *endpoint); } @@ -412,9 +412,9 @@ static void e300_i2c_tunnel( if(in->type & i2c::WRITE) { i2c->set_i2c_reg16( in->addr, - uhd::ntohx<boost::uint16_t>(in->reg), in->data); + uhd::ntohx<uint16_t>(in->reg), in->data); } else { - in->data = i2c->get_i2c_reg16(in->addr, uhd::ntohx<boost::uint16_t>(in->reg)); + in->data = i2c->get_i2c_reg16(in->addr, uhd::ntohx<uint16_t>(in->reg)); socket->send_to(asio::buffer(in_buff, sizeof(in_buff)), *endpoint); } @@ -571,7 +571,7 @@ network_server_impl::network_server_impl(const uhd::device_addr_t &device_addr) // Else load the FPGA image based on the product ID } else { //extract the FPGA path for the e300 - const boost::uint16_t pid = boost::lexical_cast<boost::uint16_t>( + const uint16_t pid = boost::lexical_cast<uint16_t>( _eeprom_manager->get_mb_eeprom()["product"]); std::string fpga_image; switch(e300_eeprom_manager::get_mb_type(pid)) { diff --git a/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp b/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp index 6ec39131d..b7c46c17d 100644 --- a/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp +++ b/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp @@ -17,7 +17,7 @@ #include "e300_remote_codec_ctrl.hpp" -#include <boost/cstdint.hpp> +#include <stdint.h> #include <uhd/exception.hpp> #include <uhd/utils/byteswap.hpp> #include <cstring> @@ -36,17 +36,17 @@ public: { } - void set_timed_spi(uhd::spi_iface::sptr, boost::uint32_t ) {}; - void set_safe_spi(uhd::spi_iface::sptr, boost::uint32_t ) {}; + void set_timed_spi(uhd::spi_iface::sptr, uint32_t ) {}; + void set_safe_spi(uhd::spi_iface::sptr, uint32_t ) {}; double set_gain(const std::string &which, const double value) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_SET_GAIN); - if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); - else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); - else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); - else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_SET_GAIN); + if (which == "TX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX2); else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); _args.gain = value; @@ -57,9 +57,9 @@ public: double set_clock_rate(const double rate) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>( + _args.action = uhd::htonx<uint32_t>( transaction_t::ACTION_SET_CLOCK_RATE); - _args.which = uhd::htonx<boost::uint32_t>( + _args.which = uhd::htonx<uint32_t>( transaction_t::CHAIN_NONE); /*Unused*/ _args.rate = rate; @@ -70,12 +70,12 @@ public: void set_active_chains(bool tx1, bool tx2, bool rx1, bool rx2) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>( + _args.action = uhd::htonx<uint32_t>( transaction_t::ACTION_SET_ACTIVE_CHANS); /*Unused*/ - _args.which = uhd::htonx<boost::uint32_t>( + _args.which = uhd::htonx<uint32_t>( transaction_t::CHAIN_NONE); - _args.bits = uhd::htonx<boost::uint32_t>( + _args.bits = uhd::htonx<uint32_t>( (tx1 ? (1<<0) : 0) | (tx2 ? (1<<1) : 0) | (rx1 ? (1<<2) : 0) | @@ -87,11 +87,11 @@ public: double tune(const std::string &which, const double value) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_TUNE); - if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); - else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); - else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); - else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_TUNE); + if (which == "TX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX2); else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); _args.freq = value; @@ -102,11 +102,11 @@ public: double get_freq(const std::string &which) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_GET_FREQ); - if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); - else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); - else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); - else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_GET_FREQ); + if (which == "TX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX2); else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); _transact(); @@ -116,9 +116,9 @@ public: void data_port_loopback(const bool on) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_SET_LOOPBACK); - _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_NONE); /*Unused*/ - _args.bits = uhd::htonx<boost::uint32_t>(on ? 1 : 0); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_SET_LOOPBACK); + _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_NONE); /*Unused*/ + _args.bits = uhd::htonx<uint32_t>(on ? 1 : 0); _transact(); } @@ -126,11 +126,11 @@ public: sensor_value_t get_rssi(const std::string &which) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_GET_RSSI); - if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); - else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_GET_RSSI); + if (which == "RX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX2); else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); - _args.bits = uhd::htonx<boost::uint32_t>(0); + _args.bits = uhd::htonx<uint32_t>(0); _transact(); return sensor_value_t("RSSI", _retval.rssi, "dB"); @@ -139,9 +139,9 @@ public: sensor_value_t get_temperature() { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_GET_TEMPERATURE); - _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_NONE); /*Unused*/ - _args.bits = uhd::htonx<boost::uint32_t>(0); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_GET_TEMPERATURE); + _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_NONE); /*Unused*/ + _args.bits = uhd::htonx<uint32_t>(0); _transact(); return sensor_value_t("temp", _retval.temp, "C"); @@ -150,11 +150,11 @@ public: void set_dc_offset_auto(const std::string &which, const bool on) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_SET_DC_OFFSET_AUTO); - if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); - else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); - else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); - else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_SET_DC_OFFSET_AUTO); + if (which == "TX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX2); else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); _args.use_dc_correction = on ? 1 : 0; @@ -164,11 +164,11 @@ public: void set_iq_balance_auto(const std::string &which, const bool on) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_SET_IQ_BALANCE_AUTO); - if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); - else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); - else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); - else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_SET_IQ_BALANCE_AUTO); + if (which == "TX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX2); else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); _args.use_iq_correction = on ? 1 : 0; @@ -178,11 +178,11 @@ public: void set_agc(const std::string &which, bool enable) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_SET_AGC); - if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); - else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); - else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); - else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_SET_AGC); + if (which == "TX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX2); else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); _args.use_agc = enable ? 1 : 0; @@ -192,12 +192,12 @@ public: void set_agc_mode(const std::string &which, const std::string &mode) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_SET_AGC_MODE); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_SET_AGC_MODE); - if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); - else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); - else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); - else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + if (which == "TX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX2); else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); if(mode == "slow") { @@ -215,11 +215,11 @@ public: double set_bw_filter(const std::string &which, const double bw) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_SET_BW); - if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); - else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); - else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); - else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_SET_BW); + if (which == "TX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX2); else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); _args.bw = bw; diff --git a/host/lib/usrp/e300/e300_remote_codec_ctrl.hpp b/host/lib/usrp/e300/e300_remote_codec_ctrl.hpp index 43723e0d5..9453a6b39 100644 --- a/host/lib/usrp/e300/e300_remote_codec_ctrl.hpp +++ b/host/lib/usrp/e300/e300_remote_codec_ctrl.hpp @@ -27,8 +27,8 @@ class e300_remote_codec_ctrl : public uhd::usrp::ad9361_ctrl { public: struct transaction_t { - boost::uint32_t action; - boost::uint32_t which; + uint32_t action; + uint32_t which; union { double rate; double gain; @@ -36,34 +36,34 @@ public: double rssi; double temp; double bw; - boost::uint32_t use_dc_correction; - boost::uint32_t use_iq_correction; - boost::uint32_t use_agc; - boost::uint32_t agc_mode; - boost::uint64_t bits; + uint32_t use_dc_correction; + uint32_t use_iq_correction; + uint32_t use_agc; + uint32_t agc_mode; + uint64_t bits; }; //Actions - static const boost::uint32_t ACTION_SET_GAIN = 10; - static const boost::uint32_t ACTION_SET_CLOCK_RATE = 11; - static const boost::uint32_t ACTION_SET_ACTIVE_CHANS = 12; - static const boost::uint32_t ACTION_TUNE = 13; - static const boost::uint32_t ACTION_SET_LOOPBACK = 14; - static const boost::uint32_t ACTION_GET_RSSI = 15; - static const boost::uint32_t ACTION_GET_TEMPERATURE = 16; - static const boost::uint32_t ACTION_SET_DC_OFFSET_AUTO = 17; - static const boost::uint32_t ACTION_SET_IQ_BALANCE_AUTO = 18; - static const boost::uint32_t ACTION_SET_AGC = 19; - static const boost::uint32_t ACTION_SET_AGC_MODE = 20; - static const boost::uint32_t ACTION_SET_BW = 21; - static const boost::uint32_t ACTION_GET_FREQ = 22; + static const uint32_t ACTION_SET_GAIN = 10; + static const uint32_t ACTION_SET_CLOCK_RATE = 11; + static const uint32_t ACTION_SET_ACTIVE_CHANS = 12; + static const uint32_t ACTION_TUNE = 13; + static const uint32_t ACTION_SET_LOOPBACK = 14; + static const uint32_t ACTION_GET_RSSI = 15; + static const uint32_t ACTION_GET_TEMPERATURE = 16; + static const uint32_t ACTION_SET_DC_OFFSET_AUTO = 17; + static const uint32_t ACTION_SET_IQ_BALANCE_AUTO = 18; + static const uint32_t ACTION_SET_AGC = 19; + static const uint32_t ACTION_SET_AGC_MODE = 20; + static const uint32_t ACTION_SET_BW = 21; + static const uint32_t ACTION_GET_FREQ = 22; //Values for "which" - static const boost::uint32_t CHAIN_NONE = 0; - static const boost::uint32_t CHAIN_TX1 = 1; - static const boost::uint32_t CHAIN_TX2 = 2; - static const boost::uint32_t CHAIN_RX1 = 3; - static const boost::uint32_t CHAIN_RX2 = 4; + static const uint32_t CHAIN_NONE = 0; + static const uint32_t CHAIN_TX1 = 1; + static const uint32_t CHAIN_TX2 = 2; + static const uint32_t CHAIN_RX1 = 3; + static const uint32_t CHAIN_RX2 = 4; }; static sptr make(uhd::transport::zero_copy_if::sptr xport); diff --git a/host/lib/usrp/e300/e300_sensor_manager.cpp b/host/lib/usrp/e300/e300_sensor_manager.cpp index a4319fa4b..b96656e5e 100644 --- a/host/lib/usrp/e300/e300_sensor_manager.cpp +++ b/host/lib/usrp/e300/e300_sensor_manager.cpp @@ -55,7 +55,7 @@ public: { boost::mutex::scoped_lock(_mutex); sensor_transaction_t transaction; - transaction.which = uhd::htonx<boost::uint32_t>(ZYNQ_TEMP); + transaction.which = uhd::htonx<uint32_t>(ZYNQ_TEMP); { uhd::transport::managed_send_buffer::sptr buff = _xport->get_send_buff(1.0); @@ -80,7 +80,7 @@ public: buff->cast<const void *>(), sizeof(transaction)); } - UHD_ASSERT_THROW(uhd::ntohx<boost::uint32_t>(transaction.which) == ZYNQ_TEMP); + UHD_ASSERT_THROW(uhd::ntohx<uint32_t>(transaction.which) == ZYNQ_TEMP); // TODO: Use proper serialization here ... return sensor_value_t( "temp", @@ -93,7 +93,7 @@ public: { boost::mutex::scoped_lock(_mutex); sensor_transaction_t transaction; - transaction.which = uhd::htonx<boost::uint32_t>(REF_LOCK); + transaction.which = uhd::htonx<uint32_t>(REF_LOCK); { uhd::transport::managed_send_buffer::sptr buff = _xport->get_send_buff(1.0); @@ -118,7 +118,7 @@ public: buff->cast<const void *>(), sizeof(transaction)); } - UHD_ASSERT_THROW(uhd::ntohx<boost::uint32_t>(transaction.which) == REF_LOCK); + UHD_ASSERT_THROW(uhd::ntohx<uint32_t>(transaction.which) == REF_LOCK); // TODO: Use proper serialization here ... return sensor_value_t("Ref", (uhd::ntohx(transaction.value) > 0), "locked", "unlocked"); } @@ -185,10 +185,10 @@ public: //PPSLOOP_LOCKED_MASK is asserted in the following cases: //- (Time source = GPS or External) AND (Loop is locked and is in fine adj mode) //- Time source is Internal - static const boost::uint32_t PPSLOOP_LOCKED_MASK = 0x04; - static const boost::uint32_t REFPLL_LOCKED_MASK = 0x20; + static const uint32_t PPSLOOP_LOCKED_MASK = 0x04; + static const uint32_t REFPLL_LOCKED_MASK = 0x20; - const boost::uint32_t status = + const uint32_t status = _global_regs->peek32(global_regs::RB32_CORE_MISC); bool ref_locked = (status & PPSLOOP_LOCKED_MASK) && (status & REFPLL_LOCKED_MASK); diff --git a/host/lib/usrp/e300/e300_sensor_manager.hpp b/host/lib/usrp/e300/e300_sensor_manager.hpp index 1252e07b9..c2d31bff7 100644 --- a/host/lib/usrp/e300/e300_sensor_manager.hpp +++ b/host/lib/usrp/e300/e300_sensor_manager.hpp @@ -16,7 +16,7 @@ // #include <boost/noncopyable.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <uhd/transport/zero_copy.hpp> #include <uhd/types/sensors.hpp> @@ -30,10 +30,10 @@ namespace uhd { namespace usrp { namespace e300 { struct sensor_transaction_t { - boost::uint32_t which; + uint32_t which; union { - boost::uint32_t value; - boost::uint32_t value64; + uint32_t value; + uint32_t value64; }; }; @@ -59,13 +59,13 @@ public: static sptr make_local(global_regs::sptr global_regs); // Note: This is a hack - static boost::uint32_t pack_float_in_uint32_t(const float &v) + static uint32_t pack_float_in_uint32_t(const float &v) { - const boost::uint32_t *cast = reinterpret_cast<const boost::uint32_t*>(&v); + const uint32_t *cast = reinterpret_cast<const uint32_t*>(&v); return *cast; } - static float unpack_float_from_uint32_t(const boost::uint32_t &v) + static float unpack_float_from_uint32_t(const uint32_t &v) { const float *cast = reinterpret_cast<const float*>(&v); return *cast; diff --git a/host/lib/usrp/e300/e300_spi.cpp b/host/lib/usrp/e300/e300_spi.cpp index 74d348555..906b32474 100644 --- a/host/lib/usrp/e300/e300_spi.cpp +++ b/host/lib/usrp/e300/e300_spi.cpp @@ -75,20 +75,20 @@ public: close(_fd); } - boost::uint32_t transact_spi(int, const uhd::spi_config_t &, - boost::uint32_t data, size_t num_bits, + uint32_t transact_spi(int, const uhd::spi_config_t &, + uint32_t data, size_t num_bits, bool) { int ret(0); struct spi_ioc_transfer tr; - boost::uint8_t *tx_data = reinterpret_cast<boost::uint8_t *>(&data); + uint8_t *tx_data = reinterpret_cast<uint8_t *>(&data); UHD_ASSERT_THROW(num_bits == 24); - boost::uint8_t tx[] = {tx_data[2], tx_data[1], tx_data[0]}; + uint8_t tx[] = {tx_data[2], tx_data[1], tx_data[0]}; - boost::uint8_t rx[3]; + uint8_t rx[3]; tr.tx_buf = (unsigned long) &tx[0]; tr.rx_buf = (unsigned long) &rx[0]; tr.len = num_bits >> 3; @@ -107,10 +107,10 @@ public: private: int _fd; - boost::uint8_t _mode; - boost::uint32_t _speed; - boost::uint8_t _bits; - boost::uint16_t _delay; + uint8_t _mode; + uint32_t _speed; + uint8_t _bits; + uint16_t _delay; }; spi::sptr spi::make(const std::string &device) diff --git a/host/lib/usrp/gps_ctrl.cpp b/host/lib/usrp/gps_ctrl.cpp index 2c78b1834..28f5a28cd 100644 --- a/host/lib/usrp/gps_ctrl.cpp +++ b/host/lib/usrp/gps_ctrl.cpp @@ -22,7 +22,7 @@ #include <uhd/types/sensors.hpp> #include <boost/algorithm/string.hpp> #include <boost/assign/list_of.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/thread/thread.hpp> #include <boost/tokenizer.hpp> @@ -118,8 +118,8 @@ private: return false; std::stringstream ss; - boost::uint32_t string_crc; - boost::uint32_t calculated_crc = 0; + uint32_t string_crc; + uint32_t calculated_crc = 0; // get crc from string ss << std::hex << nmea.substr(nmea.length()-2, 2); diff --git a/host/lib/usrp/gpsd_iface.cpp b/host/lib/usrp/gpsd_iface.cpp index cd7e5601a..98b359135 100644 --- a/host/lib/usrp/gpsd_iface.cpp +++ b/host/lib/usrp/gpsd_iface.cpp @@ -21,7 +21,7 @@ #include <boost/assign/list_of.hpp> #include <boost/bind.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include "boost/date_time/gregorian/gregorian.hpp" #include <boost/format.hpp> #include <boost/lexical_cast.hpp> @@ -43,7 +43,7 @@ static const size_t CLICK_RATE = 250000; class gpsd_iface_impl : public virtual gpsd_iface { public: - gpsd_iface_impl(const std::string &addr, boost::uint16_t port) + gpsd_iface_impl(const std::string &addr, uint16_t port) : _detected(false), _bthread(), _timeout_cnt(0) { boost::unique_lock<boost::shared_mutex> l(_d_mutex); @@ -182,9 +182,9 @@ private: // member functions if ((s.at(0) != '$')) return 0; - boost::uint8_t sum = '\0'; + uint8_t sum = '\0'; for (size_t i = 1; i < s.size(); i++) - sum ^= static_cast<boost::uint8_t>(s.at(i)); + sum ^= static_cast<uint8_t>(s.at(i)); return sum; } @@ -303,7 +303,7 @@ private: // members using namespace uhd::usrp; -gpsd_iface::sptr gpsd_iface::make(const std::string &addr, const boost::uint16_t port) +gpsd_iface::sptr gpsd_iface::make(const std::string &addr, const uint16_t port) { return gpsd_iface::sptr(new gpsd_iface_impl(addr, port)); } diff --git a/host/lib/usrp/gpsd_iface.hpp b/host/lib/usrp/gpsd_iface.hpp index 7d934ae5c..ad8ebb92a 100644 --- a/host/lib/usrp/gpsd_iface.hpp +++ b/host/lib/usrp/gpsd_iface.hpp @@ -18,7 +18,7 @@ #ifndef INCLUDED_GPSD_IFACE_HPP #define INCLUDED_GPSD_IFACE_HPP -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/shared_ptr.hpp> #include <uhd/usrp/gps_ctrl.hpp> @@ -28,7 +28,7 @@ namespace uhd { namespace usrp { class gpsd_iface : public virtual uhd::gps_ctrl { public: typedef boost::shared_ptr<gpsd_iface> sptr; - static sptr make(const std::string &addr, boost::uint16_t port); + static sptr make(const std::string &addr, uint16_t port); }; }}; diff --git a/host/lib/usrp/mboard_eeprom.cpp b/host/lib/usrp/mboard_eeprom.cpp index f60182c76..f10e0319a 100644 --- a/host/lib/usrp/mboard_eeprom.cpp +++ b/host/lib/usrp/mboard_eeprom.cpp @@ -42,36 +42,36 @@ static const size_t NAME_MAX_LEN = 32 - SERIAL_LEN; //! convert a string to a byte vector to write to eeprom static byte_vector_t string_to_uint16_bytes(const std::string &num_str){ - const boost::uint16_t num = boost::lexical_cast<boost::uint16_t>(num_str); + const uint16_t num = boost::lexical_cast<uint16_t>(num_str); const byte_vector_t lsb_msb = boost::assign::list_of - (boost::uint8_t(num >> 0))(boost::uint8_t(num >> 8)); + (uint8_t(num >> 0))(uint8_t(num >> 8)); return lsb_msb; } //! convert a byte vector read from eeprom to a string static std::string uint16_bytes_to_string(const byte_vector_t &bytes){ - const boost::uint16_t num = (boost::uint16_t(bytes.at(0)) << 0) | (boost::uint16_t(bytes.at(1)) << 8); + const uint16_t num = (uint16_t(bytes.at(0)) << 0) | (uint16_t(bytes.at(1)) << 8); return (num == 0 or num == 0xffff)? "" : boost::lexical_cast<std::string>(num); } /*********************************************************************** * Implementation of N100 load/store **********************************************************************/ -static const boost::uint8_t N100_EEPROM_ADDR = 0x50; +static const uint8_t N100_EEPROM_ADDR = 0x50; struct n100_eeprom_map{ - boost::uint16_t hardware; - boost::uint8_t mac_addr[6]; - boost::uint32_t subnet; - boost::uint32_t ip_addr; - boost::uint16_t _pad0; - boost::uint16_t revision; - boost::uint16_t product; + uint16_t hardware; + uint8_t mac_addr[6]; + uint32_t subnet; + uint32_t ip_addr; + uint16_t _pad0; + uint16_t revision; + uint16_t product; unsigned char _pad1; unsigned char gpsdo; unsigned char serial[SERIAL_LEN]; unsigned char name[NAME_MAX_LEN]; - boost::uint32_t gateway; + uint32_t gateway; }; enum n200_gpsdo_type{ @@ -112,7 +112,7 @@ static void load_n100(mboard_eeprom_t &mb_eeprom, i2c_iface &iface){ mb_eeprom["gateway"] = boost::asio::ip::address_v4(ip_addr_bytes).to_string(); //gpsdo capabilities - boost::uint8_t gpsdo_byte = iface.read_eeprom(N100_EEPROM_ADDR, offsetof(n100_eeprom_map, gpsdo), 1).at(0); + uint8_t gpsdo_byte = iface.read_eeprom(N100_EEPROM_ADDR, offsetof(n100_eeprom_map, gpsdo), 1).at(0); switch(n200_gpsdo_type(gpsdo_byte)){ case N200_GPSDO_INTERNAL: mb_eeprom["gpsdo"] = "internal"; break; case N200_GPSDO_ONBOARD: mb_eeprom["gpsdo"] = "onboard"; break; @@ -184,7 +184,7 @@ static void store_n100(const mboard_eeprom_t &mb_eeprom, i2c_iface &iface){ //gpsdo capabilities if (mb_eeprom.has_key("gpsdo")){ - boost::uint8_t gpsdo_byte = N200_GPSDO_NONE; + uint8_t gpsdo_byte = N200_GPSDO_NONE; if (mb_eeprom["gpsdo"] == "internal") gpsdo_byte = N200_GPSDO_INTERNAL; if (mb_eeprom["gpsdo"] == "onboard") gpsdo_byte = N200_GPSDO_ONBOARD; iface.write_eeprom(N100_EEPROM_ADDR, offsetof(n100_eeprom_map, gpsdo), byte_vector_t(1, gpsdo_byte)); @@ -206,7 +206,7 @@ static void store_n100(const mboard_eeprom_t &mb_eeprom, i2c_iface &iface){ /*********************************************************************** * Implementation of X300 load/store **********************************************************************/ -static const boost::uint8_t X300_EEPROM_ADDR = 0x50; +static const uint8_t X300_EEPROM_ADDR = 0x50; struct x300_eeprom_map { @@ -214,19 +214,19 @@ struct x300_eeprom_map unsigned char revision[2]; unsigned char product[2]; unsigned char revision_compat[2]; - boost::uint8_t _pad0[2]; + uint8_t _pad0[2]; //all the mac addrs - boost::uint8_t mac_addr0[6]; - boost::uint8_t _pad1[2]; - boost::uint8_t mac_addr1[6]; - boost::uint8_t _pad2[2]; + uint8_t mac_addr0[6]; + uint8_t _pad1[2]; + uint8_t mac_addr1[6]; + uint8_t _pad2[2]; //all the IP addrs - boost::uint32_t gateway; - boost::uint32_t subnet[4]; - boost::uint32_t ip_addr[4]; - boost::uint8_t _pad3[16]; + uint32_t gateway; + uint32_t subnet[4]; + uint32_t ip_addr[4]; + uint8_t _pad3[16]; //names and serials unsigned char name[NAME_MAX_LEN]; @@ -349,7 +349,7 @@ static void store_x300(const mboard_eeprom_t &mb_eeprom, i2c_iface &iface) /*********************************************************************** * Implementation of B000 load/store **********************************************************************/ -static const boost::uint8_t B000_EEPROM_ADDR = 0x50; +static const uint8_t B000_EEPROM_ADDR = 0x50; static const size_t B000_SERIAL_LEN = 8; //use char array so we dont need to attribute packed @@ -372,13 +372,13 @@ static void load_b000(mboard_eeprom_t &mb_eeprom, i2c_iface &iface){ )); //extract master clock rate as a 32-bit uint in Hz - boost::uint32_t master_clock_rate; + uint32_t master_clock_rate; const byte_vector_t rate_bytes = iface.read_eeprom( B000_EEPROM_ADDR, offsetof(b000_eeprom_map, mcr), sizeof(master_clock_rate) ); std::copy( rate_bytes.begin(), rate_bytes.end(), //input - reinterpret_cast<boost::uint8_t *>(&master_clock_rate) //output + reinterpret_cast<uint8_t *>(&master_clock_rate) //output ); master_clock_rate = ntohl(master_clock_rate); if (master_clock_rate > 1e6 and master_clock_rate < 1e9){ @@ -402,11 +402,11 @@ static void store_b000(const mboard_eeprom_t &mb_eeprom, i2c_iface &iface){ //store the master clock rate as a 32-bit uint in Hz if (mb_eeprom.has_key("mcr")){ - boost::uint32_t master_clock_rate = boost::uint32_t(boost::lexical_cast<double>(mb_eeprom["mcr"])); + uint32_t master_clock_rate = uint32_t(boost::lexical_cast<double>(mb_eeprom["mcr"])); master_clock_rate = htonl(master_clock_rate); const byte_vector_t rate_bytes( - reinterpret_cast<const boost::uint8_t *>(&master_clock_rate), - reinterpret_cast<const boost::uint8_t *>(&master_clock_rate) + sizeof(master_clock_rate) + reinterpret_cast<const uint8_t *>(&master_clock_rate), + reinterpret_cast<const uint8_t *>(&master_clock_rate) + sizeof(master_clock_rate) ); iface.write_eeprom( B000_EEPROM_ADDR, offsetof(b000_eeprom_map, mcr), rate_bytes @@ -417,7 +417,7 @@ static void store_b000(const mboard_eeprom_t &mb_eeprom, i2c_iface &iface){ /*********************************************************************** * Implementation of B100 load/store **********************************************************************/ -static const boost::uint8_t B100_EEPROM_ADDR = 0x50; +static const uint8_t B100_EEPROM_ADDR = 0x50; //use char array so we dont need to attribute packed struct b100_eeprom_map{ @@ -481,7 +481,7 @@ static void store_b100(const mboard_eeprom_t &mb_eeprom, i2c_iface &iface){ **********************************************************************/ /* On the B200, this field indicates the slave address. From the FX3, this * address is always 0. */ -static const boost::uint8_t B200_EEPROM_SLAVE_ADDR = 0x04; +static const uint8_t B200_EEPROM_SLAVE_ADDR = 0x04; //use char array so we dont need to attribute packed struct b200_eeprom_map{ @@ -542,11 +542,11 @@ static void store_b200(const mboard_eeprom_t &mb_eeprom, i2c_iface &iface){ /*********************************************************************** * Implementation of E100 load/store **********************************************************************/ -static const boost::uint8_t E100_EEPROM_ADDR = 0x51; +static const uint8_t E100_EEPROM_ADDR = 0x51; struct e100_eeprom_map{ - boost::uint16_t vendor; - boost::uint16_t device; + uint16_t vendor; + uint16_t device; unsigned char revision; unsigned char content; unsigned char model[8]; @@ -591,12 +591,12 @@ static void store_e100(const mboard_eeprom_t &mb_eeprom, i2c_iface &iface){ if (mb_eeprom.has_key("vendor")) iface.write_eeprom( E100_EEPROM_ADDR, offsetof(e100_eeprom_map, vendor), - to_bytes(uhd::htonx(boost::lexical_cast<boost::uint16_t>(mb_eeprom["vendor"]))) + to_bytes(uhd::htonx(boost::lexical_cast<uint16_t>(mb_eeprom["vendor"]))) ); if (mb_eeprom.has_key("device")) iface.write_eeprom( E100_EEPROM_ADDR, offsetof(e100_eeprom_map, device), - to_bytes(uhd::htonx(boost::lexical_cast<boost::uint16_t>(mb_eeprom["device"]))) + to_bytes(uhd::htonx(boost::lexical_cast<uint16_t>(mb_eeprom["device"]))) ); if (mb_eeprom.has_key("revision")) iface.write_eeprom( diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp index 52dfa5773..7c3bf8007 100644 --- a/host/lib/usrp/multi_usrp.cpp +++ b/host/lib/usrp/multi_usrp.cpp @@ -749,9 +749,9 @@ public: return _tree->list(mb_root(mboard) / "sensors"); } - void set_user_register(const boost::uint8_t addr, const boost::uint32_t data, size_t mboard){ + void set_user_register(const uint8_t addr, const uint32_t data, size_t mboard){ if (mboard != ALL_MBOARDS){ - typedef std::pair<boost::uint8_t, boost::uint32_t> user_reg_t; + typedef std::pair<uint8_t, uint32_t> user_reg_t; _tree->access<user_reg_t>(mb_root(mboard) / "user/regs").set(user_reg_t(addr, data)); return; } @@ -1525,13 +1525,13 @@ public: return banks; } - void set_gpio_attr(const std::string &bank, const std::string &attr, const boost::uint32_t value, const boost::uint32_t mask, const size_t mboard) + void set_gpio_attr(const std::string &bank, const std::string &attr, const uint32_t value, const uint32_t mask, const size_t mboard) { if (_tree->exists(mb_root(mboard) / "gpio" / bank)) { - const boost::uint32_t current = _tree->access<boost::uint32_t>(mb_root(mboard) / "gpio" / bank / attr).get(); - const boost::uint32_t new_value = (current & ~mask) | (value & mask); - _tree->access<boost::uint32_t>(mb_root(mboard) / "gpio" / bank / attr).set(new_value); + const uint32_t current = _tree->access<uint32_t>(mb_root(mboard) / "gpio" / bank / attr).get(); + const uint32_t new_value = (current & ~mask) | (value & mask); + _tree->access<uint32_t>(mb_root(mboard) / "gpio" / bank / attr).set(new_value); return; } if (bank.size() > 2 and bank[1] == 'X') @@ -1539,21 +1539,21 @@ public: const std::string name = bank.substr(2); const dboard_iface::unit_t unit = (bank[0] == 'R')? dboard_iface::UNIT_RX : dboard_iface::UNIT_TX; dboard_iface::sptr iface = _tree->access<dboard_iface::sptr>(mb_root(mboard) / "dboards" / name / "iface").get(); - if (attr == "CTRL") iface->set_pin_ctrl(unit, boost::uint16_t(value), boost::uint16_t(mask)); - if (attr == "DDR") iface->set_gpio_ddr(unit, boost::uint16_t(value), boost::uint16_t(mask)); - if (attr == "OUT") iface->set_gpio_out(unit, boost::uint16_t(value), boost::uint16_t(mask)); - if (attr == "ATR_0X") iface->set_atr_reg(unit, gpio_atr::ATR_REG_IDLE, boost::uint16_t(value), boost::uint16_t(mask)); - if (attr == "ATR_RX") iface->set_atr_reg(unit, gpio_atr::ATR_REG_RX_ONLY, boost::uint16_t(value), boost::uint16_t(mask)); - if (attr == "ATR_TX") iface->set_atr_reg(unit, gpio_atr::ATR_REG_TX_ONLY, boost::uint16_t(value), boost::uint16_t(mask)); - if (attr == "ATR_XX") iface->set_atr_reg(unit, gpio_atr::ATR_REG_FULL_DUPLEX, boost::uint16_t(value), boost::uint16_t(mask)); + if (attr == "CTRL") iface->set_pin_ctrl(unit, uint16_t(value), uint16_t(mask)); + if (attr == "DDR") iface->set_gpio_ddr(unit, uint16_t(value), uint16_t(mask)); + if (attr == "OUT") iface->set_gpio_out(unit, uint16_t(value), uint16_t(mask)); + if (attr == "ATR_0X") iface->set_atr_reg(unit, gpio_atr::ATR_REG_IDLE, uint16_t(value), uint16_t(mask)); + if (attr == "ATR_RX") iface->set_atr_reg(unit, gpio_atr::ATR_REG_RX_ONLY, uint16_t(value), uint16_t(mask)); + if (attr == "ATR_TX") iface->set_atr_reg(unit, gpio_atr::ATR_REG_TX_ONLY, uint16_t(value), uint16_t(mask)); + if (attr == "ATR_XX") iface->set_atr_reg(unit, gpio_atr::ATR_REG_FULL_DUPLEX, uint16_t(value), uint16_t(mask)); } } - boost::uint32_t get_gpio_attr(const std::string &bank, const std::string &attr, const size_t mboard) + uint32_t get_gpio_attr(const std::string &bank, const std::string &attr, const size_t mboard) { if (_tree->exists(mb_root(mboard) / "gpio" / bank)) { - return boost::uint32_t(_tree->access<boost::uint64_t>(mb_root(mboard) / "gpio" / bank / attr).get()); + return uint32_t(_tree->access<uint64_t>(mb_root(mboard) / "gpio" / bank / attr).get()); } if (bank.size() > 2 and bank[1] == 'X') { @@ -1572,7 +1572,7 @@ public: return 0; } - void write_register(const std::string &path, const boost::uint32_t field, const boost::uint64_t value, const size_t mboard) + void write_register(const std::string &path, const uint32_t field, const uint64_t value, const size_t mboard) { if (_tree->exists(mb_root(mboard) / "registers")) { @@ -1587,16 +1587,16 @@ public: switch (reg.get_bitwidth()) { case 16: if (reg.is_readable()) - uhd::soft_register_base::cast<uhd::soft_reg16_rw_t>(reg).write(field, static_cast<boost::uint16_t>(value)); + uhd::soft_register_base::cast<uhd::soft_reg16_rw_t>(reg).write(field, static_cast<uint16_t>(value)); else - uhd::soft_register_base::cast<uhd::soft_reg16_wo_t>(reg).write(field, static_cast<boost::uint16_t>(value)); + uhd::soft_register_base::cast<uhd::soft_reg16_wo_t>(reg).write(field, static_cast<uint16_t>(value)); break; case 32: if (reg.is_readable()) - uhd::soft_register_base::cast<uhd::soft_reg32_rw_t>(reg).write(field, static_cast<boost::uint32_t>(value)); + uhd::soft_register_base::cast<uhd::soft_reg32_rw_t>(reg).write(field, static_cast<uint32_t>(value)); else - uhd::soft_register_base::cast<uhd::soft_reg32_wo_t>(reg).write(field, static_cast<boost::uint32_t>(value)); + uhd::soft_register_base::cast<uhd::soft_reg32_wo_t>(reg).write(field, static_cast<uint32_t>(value)); break; case 64: @@ -1615,7 +1615,7 @@ public: } } - boost::uint64_t read_register(const std::string &path, const boost::uint32_t field, const size_t mboard) + uint64_t read_register(const std::string &path, const uint32_t field, const size_t mboard) { if (_tree->exists(mb_root(mboard) / "registers")) { @@ -1630,16 +1630,16 @@ public: switch (reg.get_bitwidth()) { case 16: if (reg.is_writable()) - return static_cast<boost::uint64_t>(uhd::soft_register_base::cast<uhd::soft_reg16_rw_t>(reg).read(field)); + return static_cast<uint64_t>(uhd::soft_register_base::cast<uhd::soft_reg16_rw_t>(reg).read(field)); else - return static_cast<boost::uint64_t>(uhd::soft_register_base::cast<uhd::soft_reg16_ro_t>(reg).read(field)); + return static_cast<uint64_t>(uhd::soft_register_base::cast<uhd::soft_reg16_ro_t>(reg).read(field)); break; case 32: if (reg.is_writable()) - return static_cast<boost::uint64_t>(uhd::soft_register_base::cast<uhd::soft_reg32_rw_t>(reg).read(field)); + return static_cast<uint64_t>(uhd::soft_register_base::cast<uhd::soft_reg32_rw_t>(reg).read(field)); else - return static_cast<boost::uint64_t>(uhd::soft_register_base::cast<uhd::soft_reg32_ro_t>(reg).read(field)); + return static_cast<uint64_t>(uhd::soft_register_base::cast<uhd::soft_reg32_ro_t>(reg).read(field)); break; case 64: diff --git a/host/lib/usrp/n230/n230_clk_pps_ctrl.cpp b/host/lib/usrp/n230/n230_clk_pps_ctrl.cpp index 9d704b702..2bcfb0394 100644 --- a/host/lib/usrp/n230/n230_clk_pps_ctrl.cpp +++ b/host/lib/usrp/n230/n230_clk_pps_ctrl.cpp @@ -19,7 +19,7 @@ #include <uhd/utils/msg.hpp> #include <uhd/utils/safe_call.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/format.hpp> #include <boost/foreach.hpp> #include <stdexcept> diff --git a/host/lib/usrp/n230/n230_cores.cpp b/host/lib/usrp/n230/n230_cores.cpp index 58c702ec1..26e69e14d 100644 --- a/host/lib/usrp/n230/n230_cores.cpp +++ b/host/lib/usrp/n230/n230_cores.cpp @@ -33,10 +33,10 @@ n230_core_spi_core::n230_core_spi_core( change_perif(default_perif); } -boost::uint32_t n230_core_spi_core::transact_spi( +uint32_t n230_core_spi_core::transact_spi( int which_slave, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits, bool readback) { diff --git a/host/lib/usrp/n230/n230_cores.hpp b/host/lib/usrp/n230/n230_cores.hpp index 3f56c1889..db92658f1 100644 --- a/host/lib/usrp/n230/n230_cores.hpp +++ b/host/lib/usrp/n230/n230_cores.hpp @@ -35,10 +35,10 @@ public: n230_core_spi_core(uhd::wb_iface::sptr iface, perif_t default_perif); - virtual boost::uint32_t transact_spi( + virtual uint32_t transact_spi( int which_slave, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits, bool readback); diff --git a/host/lib/usrp/n230/n230_eeprom_manager.cpp b/host/lib/usrp/n230/n230_eeprom_manager.cpp index b19deb23a..d9d02c58c 100644 --- a/host/lib/usrp/n230/n230_eeprom_manager.cpp +++ b/host/lib/usrp/n230/n230_eeprom_manager.cpp @@ -65,13 +65,13 @@ const mboard_eeprom_t& n230_eeprom_manager::read_mb_eeprom() const n230_eeprom_map_t* map_ptr = reinterpret_cast<const n230_eeprom_map_t*>(_response.data); const n230_eeprom_map_t& map = *map_ptr; - uint16_t ver_major = uhd::htonx<boost::uint16_t>(map.data_version_major); - uint16_t ver_minor = uhd::htonx<boost::uint16_t>(map.data_version_minor); + uint16_t ver_major = uhd::htonx<uint16_t>(map.data_version_major); + uint16_t ver_minor = uhd::htonx<uint16_t>(map.data_version_minor); _mb_eeprom["product"] = boost::lexical_cast<std::string>( - uhd::htonx<boost::uint16_t>(map.hw_product)); + uhd::htonx<uint16_t>(map.hw_product)); _mb_eeprom["revision"] = boost::lexical_cast<std::string>( - uhd::htonx<boost::uint16_t>(map.hw_revision)); + uhd::htonx<uint16_t>(map.hw_revision)); //The revision_compat field does not exist in version 1.0 //EEPROM version 1.0 will only exist on HW revision 1 so it is safe to set //revision_compat = revision @@ -79,20 +79,20 @@ const mboard_eeprom_t& n230_eeprom_manager::read_mb_eeprom() _mb_eeprom["revision_compat"] = _mb_eeprom["revision"]; } else { _mb_eeprom["revision_compat"] = boost::lexical_cast<std::string>( - uhd::htonx<boost::uint16_t>(map.hw_revision_compat)); + uhd::htonx<uint16_t>(map.hw_revision_compat)); } _mb_eeprom["serial"] = _bytes_to_string( map.serial, N230_EEPROM_SERIAL_LEN); //Extract ethernet info _mb_eeprom["gateway"] = boost::asio::ip::address_v4( - uhd::htonx<boost::uint32_t>(map.gateway)).to_string(); + uhd::htonx<uint32_t>(map.gateway)).to_string(); for (size_t i = 0; i < N230_MAX_NUM_ETH_PORTS; i++) { const std::string n(1, i+'0'); _mb_eeprom["ip-addr"+n] = boost::asio::ip::address_v4( - uhd::htonx<boost::uint32_t>(map.eth_info[i].ip_addr)).to_string(); + uhd::htonx<uint32_t>(map.eth_info[i].ip_addr)).to_string(); _mb_eeprom["subnet"+n] = boost::asio::ip::address_v4( - uhd::htonx<boost::uint32_t>(map.eth_info[i].subnet)).to_string(); + uhd::htonx<uint32_t>(map.eth_info[i].subnet)).to_string(); byte_vector_t mac_addr(map.eth_info[i].mac_addr, map.eth_info[i].mac_addr + 6); _mb_eeprom["mac-addr"+n] = mac_addr_t::from_bytes(mac_addr).to_string(); } @@ -117,28 +117,28 @@ void n230_eeprom_manager::write_mb_eeprom(const mboard_eeprom_t& eeprom) n230_eeprom_map_t& map = *map_ptr; // Automatic version upgrade handling - uint16_t old_ver_major = uhd::htonx<boost::uint16_t>(map.data_version_major); - uint16_t old_ver_minor = uhd::htonx<boost::uint16_t>(map.data_version_minor); + uint16_t old_ver_major = uhd::htonx<uint16_t>(map.data_version_major); + uint16_t old_ver_minor = uhd::htonx<uint16_t>(map.data_version_minor); //The revision_compat field does not exist for version 1.0 so force write it //EEPROM version 1.0 will only exist on HW revision 1 so it is safe to set //revision_compat = revision for the upgrade bool force_write_version_compat = (old_ver_major == 1 and old_ver_minor == 0); - map.data_version_major = uhd::htonx<boost::uint16_t>(N230_EEPROM_VER_MAJOR); - map.data_version_minor = uhd::htonx<boost::uint16_t>(N230_EEPROM_VER_MINOR); + map.data_version_major = uhd::htonx<uint16_t>(N230_EEPROM_VER_MAJOR); + map.data_version_minor = uhd::htonx<uint16_t>(N230_EEPROM_VER_MINOR); if (_mb_eeprom.has_key("product")) { - map.hw_product = uhd::htonx<boost::uint16_t>( - boost::lexical_cast<boost::uint16_t>(_mb_eeprom["product"])); + map.hw_product = uhd::htonx<uint16_t>( + boost::lexical_cast<uint16_t>(_mb_eeprom["product"])); } if (_mb_eeprom.has_key("revision")) { - map.hw_revision = uhd::htonx<boost::uint16_t>( - boost::lexical_cast<boost::uint16_t>(_mb_eeprom["revision"])); + map.hw_revision = uhd::htonx<uint16_t>( + boost::lexical_cast<uint16_t>(_mb_eeprom["revision"])); } if (_mb_eeprom.has_key("revision_compat")) { - map.hw_revision_compat = uhd::htonx<boost::uint16_t>( - boost::lexical_cast<boost::uint16_t>(_mb_eeprom["revision_compat"])); + map.hw_revision_compat = uhd::htonx<uint16_t>( + boost::lexical_cast<uint16_t>(_mb_eeprom["revision_compat"])); } else if (force_write_version_compat) { map.hw_revision_compat = map.hw_revision; } @@ -148,17 +148,17 @@ void n230_eeprom_manager::write_mb_eeprom(const mboard_eeprom_t& eeprom) //Push ethernet info if (_mb_eeprom.has_key("gateway")){ - map.gateway = uhd::htonx<boost::uint32_t>( + map.gateway = uhd::htonx<uint32_t>( boost::asio::ip::address_v4::from_string(_mb_eeprom["gateway"]).to_ulong()); } for (size_t i = 0; i < N230_MAX_NUM_ETH_PORTS; i++) { const std::string n(1, i+'0'); if (_mb_eeprom.has_key("ip-addr"+n)){ - map.eth_info[i].ip_addr = uhd::htonx<boost::uint32_t>( + map.eth_info[i].ip_addr = uhd::htonx<uint32_t>( boost::asio::ip::address_v4::from_string(_mb_eeprom["ip-addr"+n]).to_ulong()); } if (_mb_eeprom.has_key("subnet"+n)){ - map.eth_info[i].subnet = uhd::htonx<boost::uint32_t>( + map.eth_info[i].subnet = uhd::htonx<uint32_t>( boost::asio::ip::address_v4::from_string(_mb_eeprom["subnet"+n]).to_ulong()); } if (_mb_eeprom.has_key("mac-addr"+n)) { @@ -175,11 +175,11 @@ void n230_eeprom_manager::write_mb_eeprom(const mboard_eeprom_t& eeprom) _transact(N230_FLASH_COMM_CMD_WRITE_NV_DATA); } -void n230_eeprom_manager::_transact(const boost::uint32_t command) +void n230_eeprom_manager::_transact(const uint32_t command) { //Load request struct - _request.flags = uhd::htonx<boost::uint32_t>(N230_FLASH_COMM_FLAGS_ACK | command); - _request.seq = uhd::htonx<boost::uint32_t>(_seq_num++); + _request.flags = uhd::htonx<uint32_t>(N230_FLASH_COMM_FLAGS_ACK | command); + _request.seq = uhd::htonx<uint32_t>(_seq_num++); //Send request _flush_xport(); @@ -190,7 +190,7 @@ void n230_eeprom_manager::_transact(const boost::uint32_t command) if (nbytes == 0) throw uhd::io_error("n230_eeprom_manager::_transact failure"); //Sanity checks - const size_t flags = uhd::ntohx<boost::uint32_t>(_response.flags); + const size_t flags = uhd::ntohx<uint32_t>(_response.flags); UHD_ASSERT_THROW(nbytes == sizeof(_response)); UHD_ASSERT_THROW(_response.seq == _request.seq); UHD_ASSERT_THROW(flags & command); diff --git a/host/lib/usrp/n230/n230_eeprom_manager.hpp b/host/lib/usrp/n230/n230_eeprom_manager.hpp index cc5aee9f3..190ed943f 100644 --- a/host/lib/usrp/n230/n230_eeprom_manager.hpp +++ b/host/lib/usrp/n230/n230_eeprom_manager.hpp @@ -39,7 +39,7 @@ public: } private: //Functions - void _transact(const boost::uint32_t command); + void _transact(const uint32_t command); void _flush_xport(); private: //Members @@ -47,7 +47,7 @@ private: //Members transport::udp_simple::sptr _udp_xport; n230_flash_prog_t _request; n230_flash_prog_t _response; - boost::uint32_t _seq_num; + uint32_t _seq_num; boost::mutex _mutex; static const double UDP_TIMEOUT_IN_SEC; diff --git a/host/lib/usrp/n230/n230_fpga_defs.h b/host/lib/usrp/n230/n230_fpga_defs.h index 3aa96643f..3fa0451e7 100644 --- a/host/lib/usrp/n230/n230_fpga_defs.h +++ b/host/lib/usrp/n230/n230_fpga_defs.h @@ -55,9 +55,9 @@ enum xb_endpoint_t { N230_XB_DST_UART = 5 }; -static const boost::uint8_t RADIO_CTRL_SUFFIX = 0x00; -static const boost::uint8_t RADIO_FC_SUFFIX = 0x01; -static const boost::uint8_t RADIO_DATA_SUFFIX = 0x02; +static const uint8_t RADIO_CTRL_SUFFIX = 0x00; +static const uint8_t RADIO_FC_SUFFIX = 0x01; +static const uint8_t RADIO_DATA_SUFFIX = 0x02; /******************************************************************* * Seting Register Base addresses diff --git a/host/lib/usrp/n230/n230_frontend_ctrl.cpp b/host/lib/usrp/n230/n230_frontend_ctrl.cpp index e0820d9b2..3d81721ec 100644 --- a/host/lib/usrp/n230/n230_frontend_ctrl.cpp +++ b/host/lib/usrp/n230/n230_frontend_ctrl.cpp @@ -27,29 +27,29 @@ namespace uhd { namespace usrp { namespace n230 { /* ATR Control Bits */ -static const boost::uint32_t TX_ENABLE = (1 << 7); -static const boost::uint32_t SFDX_RX = (1 << 6); -static const boost::uint32_t SFDX_TX = (1 << 5); -static const boost::uint32_t SRX_RX = (1 << 4); -static const boost::uint32_t SRX_TX = (1 << 3); -static const boost::uint32_t LED_RX = (1 << 2); -static const boost::uint32_t LED_TXRX_RX = (1 << 1); -static const boost::uint32_t LED_TXRX_TX = (1 << 0); +static const uint32_t TX_ENABLE = (1 << 7); +static const uint32_t SFDX_RX = (1 << 6); +static const uint32_t SFDX_TX = (1 << 5); +static const uint32_t SRX_RX = (1 << 4); +static const uint32_t SRX_TX = (1 << 3); +static const uint32_t LED_RX = (1 << 2); +static const uint32_t LED_TXRX_RX = (1 << 1); +static const uint32_t LED_TXRX_TX = (1 << 0); /* ATR State Definitions. */ -static const boost::uint32_t STATE_OFF = 0x00; -static const boost::uint32_t STATE_RX_RX2 = (SFDX_RX +static const uint32_t STATE_OFF = 0x00; +static const uint32_t STATE_RX_RX2 = (SFDX_RX | SFDX_TX | LED_RX); -static const boost::uint32_t STATE_RX_TXRX = (SRX_RX +static const uint32_t STATE_RX_TXRX = (SRX_RX | SRX_TX | LED_TXRX_RX); -static const boost::uint32_t STATE_FDX_TXRX = (TX_ENABLE +static const uint32_t STATE_FDX_TXRX = (TX_ENABLE | SFDX_RX | SFDX_TX | LED_TXRX_TX | LED_RX); -static const boost::uint32_t STATE_TX_TXRX = (TX_ENABLE +static const uint32_t STATE_TX_TXRX = (TX_ENABLE | SFDX_RX | SFDX_TX | LED_TXRX_TX); diff --git a/host/lib/usrp/n230/n230_image_loader.cpp b/host/lib/usrp/n230/n230_image_loader.cpp index 9dd4a252d..25f498a73 100644 --- a/host/lib/usrp/n230/n230_image_loader.cpp +++ b/host/lib/usrp/n230/n230_image_loader.cpp @@ -40,23 +40,23 @@ struct xil_bitfile_hdr_t { {} bool valid; - boost::uint32_t userid; + uint32_t userid; std::string product; std::string fpga; std::string timestamp; - boost::uint32_t filesize; + uint32_t filesize; }; -static inline boost::uint16_t _to_uint16(boost::uint8_t* buf) { - return (static_cast<boost::uint16_t>(buf[0]) << 8) | - (static_cast<boost::uint16_t>(buf[1]) << 0); +static inline uint16_t _to_uint16(uint8_t* buf) { + return (static_cast<uint16_t>(buf[0]) << 8) | + (static_cast<uint16_t>(buf[1]) << 0); } -static inline boost::uint32_t _to_uint32(boost::uint8_t* buf) { - return (static_cast<boost::uint32_t>(buf[0]) << 24) | - (static_cast<boost::uint32_t>(buf[1]) << 16) | - (static_cast<boost::uint32_t>(buf[2]) << 8) | - (static_cast<boost::uint32_t>(buf[3]) << 0); +static inline uint32_t _to_uint32(uint8_t* buf) { + return (static_cast<uint32_t>(buf[0]) << 24) | + (static_cast<uint32_t>(buf[1]) << 16) | + (static_cast<uint32_t>(buf[2]) << 8) | + (static_cast<uint32_t>(buf[3]) << 0); } static void _parse_bitfile_header(const std::string& filepath, xil_bitfile_hdr_t& hdr) { @@ -70,9 +70,9 @@ static void _parse_bitfile_header(const std::string& filepath, xil_bitfile_hdr_t //Parse header size_t ptr = 0; - boost::uint8_t* buf = reinterpret_cast<boost::uint8_t*>(hdr_buf.get()); //Shortcut + uint8_t* buf = reinterpret_cast<uint8_t*>(hdr_buf.get()); //Shortcut - boost::uint8_t signature[10] = {0x00, 0x09, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xf0}; + uint8_t signature[10] = {0x00, 0x09, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xf0}; if (memcmp(buf, signature, 10) == 0) { //Validate signature ptr += _to_uint16(buf + ptr) + 2; ptr += _to_uint16(buf + ptr) + 1; @@ -80,7 +80,7 @@ static void _parse_bitfile_header(const std::string& filepath, xil_bitfile_hdr_t std::string fields[4]; for (size_t i = 0; i < 4; i++) { size_t key = buf[ptr++] - 'a'; - boost::uint16_t len = _to_uint16(buf + ptr); ptr += 2; + uint16_t len = _to_uint16(buf + ptr); ptr += 2; fields[key] = std::string(reinterpret_cast<char*>(buf + ptr), size_t(len)); ptr += len; } @@ -108,11 +108,11 @@ static size_t _send_and_recv( udp_simple::sptr xport, n230_flash_prog_t& out, n230_flash_prog_t& in) { - static boost::uint32_t seqno = 0; - out.seq = htonx<boost::uint32_t>(++seqno); + static uint32_t seqno = 0; + out.seq = htonx<uint32_t>(++seqno); xport->send(boost::asio::buffer(&out, sizeof(n230_flash_prog_t))); size_t len = xport->recv(boost::asio::buffer(&in, udp_simple::mtu), 0.5); - if (len != sizeof(n230_flash_prog_t) or ntohx<boost::uint32_t>(in.seq) != seqno) { + if (len != sizeof(n230_flash_prog_t) or ntohx<uint32_t>(in.seq) != seqno) { throw uhd::io_error("Error communicating with the device."); } return len; @@ -173,17 +173,17 @@ static bool n230_image_loader(const image_loader::image_loader_args_t &loader_ar while (bytes_written < image_size) { size_t payload_size = std::min<size_t>(image_size - bytes_written, N230_FLASH_COMM_MAX_PAYLOAD_SIZE); if (bytes_written % SECTOR_SIZE == 0) { - out.flags = htonx<boost::uint32_t>(N230_FLASH_COMM_FLAGS_ACK|N230_FLASH_COMM_CMD_ERASE_FPGA); - out.offset = htonx<boost::uint32_t>(bytes_written + IMAGE_BASE); - out.size = htonx<boost::uint32_t>(payload_size); + out.flags = htonx<uint32_t>(N230_FLASH_COMM_FLAGS_ACK|N230_FLASH_COMM_CMD_ERASE_FPGA); + out.offset = htonx<uint32_t>(bytes_written + IMAGE_BASE); + out.size = htonx<uint32_t>(payload_size); _send_and_recv(udp_xport, out, in); } - out.flags = htonx<boost::uint32_t>(N230_FLASH_COMM_FLAGS_ACK|N230_FLASH_COMM_CMD_WRITE_FPGA); - out.offset = htonx<boost::uint32_t>(bytes_written + IMAGE_BASE); - out.size = htonx<boost::uint32_t>(payload_size); + out.flags = htonx<uint32_t>(N230_FLASH_COMM_FLAGS_ACK|N230_FLASH_COMM_CMD_WRITE_FPGA); + out.offset = htonx<uint32_t>(bytes_written + IMAGE_BASE); + out.size = htonx<uint32_t>(payload_size); image.read((char*)out.data, payload_size); _send_and_recv(udp_xport, out, in); - bytes_written += ntohx<boost::uint32_t>(in.size); + bytes_written += ntohx<uint32_t>(in.size); std::cout << boost::format("\r-- Loading FPGA image: %d%%") % (int(double(bytes_written) / double(image_size) * 100.0)) << std::flush; diff --git a/host/lib/usrp/n230/n230_impl.cpp b/host/lib/usrp/n230/n230_impl.cpp index 5e8aa37b7..24ef5d97d 100644 --- a/host/lib/usrp/n230/n230_impl.cpp +++ b/host/lib/usrp/n230/n230_impl.cpp @@ -214,8 +214,8 @@ n230_impl::n230_impl(const uhd::device_addr_t& dev_addr) "checks.\nOperating in this mode may cause hardware damage and unstable " "radio performance!"<< std::endl; } - boost::uint16_t hw_rev = boost::lexical_cast<boost::uint16_t>(mb_eeprom["revision"]); - boost::uint16_t hw_rev_compat = boost::lexical_cast<boost::uint16_t>(mb_eeprom["revision_compat"]); + uint16_t hw_rev = boost::lexical_cast<uint16_t>(mb_eeprom["revision"]); + uint16_t hw_rev_compat = boost::lexical_cast<uint16_t>(mb_eeprom["revision_compat"]); if (not recover_mb_eeprom) { if (hw_rev_compat > N230_HW_REVISION_COMPAT) { throw uhd::runtime_error(str(boost::format( @@ -411,25 +411,25 @@ void n230_impl::_initialize_property_tree(const fs_path& mb_path) //------------------------------------------------------------------ // MiniSAS GPIO //------------------------------------------------------------------ - _tree->create<boost::uint32_t>(mb_path / "gpio" / "FP0" / "DDR") + _tree->create<uint32_t>(mb_path / "gpio" / "FP0" / "DDR") .set(0) .add_coerced_subscriber(boost::bind(&gpio_atr::gpio_atr_3000::set_gpio_attr, _resource_mgr->get_minisas_gpio_ctrl_sptr(0), gpio_atr::GPIO_DDR, _1)); - _tree->create<boost::uint32_t>(mb_path / "gpio" / "FP1" / "DDR") + _tree->create<uint32_t>(mb_path / "gpio" / "FP1" / "DDR") .set(0) .add_coerced_subscriber(boost::bind(&gpio_atr::gpio_atr_3000::set_gpio_attr, _resource_mgr->get_minisas_gpio_ctrl_sptr(1), gpio_atr::GPIO_DDR, _1)); - _tree->create<boost::uint32_t>(mb_path / "gpio" / "FP0" / "OUT") + _tree->create<uint32_t>(mb_path / "gpio" / "FP0" / "OUT") .set(0) .add_coerced_subscriber(boost::bind(&gpio_atr::gpio_atr_3000::set_gpio_attr, _resource_mgr->get_minisas_gpio_ctrl_sptr(0), gpio_atr::GPIO_OUT, _1)); - _tree->create<boost::uint32_t>(mb_path / "gpio" / "FP1" / "OUT") + _tree->create<uint32_t>(mb_path / "gpio" / "FP1" / "OUT") .set(0) .add_coerced_subscriber(boost::bind(&gpio_atr::gpio_atr_3000::set_gpio_attr, _resource_mgr->get_minisas_gpio_ctrl_sptr(1), gpio_atr::GPIO_OUT, _1)); - _tree->create<boost::uint32_t>(mb_path / "gpio" / "FP0" / "READBACK") + _tree->create<uint32_t>(mb_path / "gpio" / "FP0" / "READBACK") .set_publisher(boost::bind(&gpio_atr::gpio_atr_3000::read_gpio, _resource_mgr->get_minisas_gpio_ctrl_sptr(0))); - _tree->create<boost::uint32_t>(mb_path / "gpio" / "FP1" / "READBACK") + _tree->create<uint32_t>(mb_path / "gpio" / "FP1" / "READBACK") .set_publisher(boost::bind(&gpio_atr::gpio_atr_3000::read_gpio, _resource_mgr->get_minisas_gpio_ctrl_sptr(1))); //------------------------------------------------------------------ diff --git a/host/lib/usrp/n230/n230_resource_manager.cpp b/host/lib/usrp/n230/n230_resource_manager.cpp index f13dd0b33..826db5ed2 100644 --- a/host/lib/usrp/n230/n230_resource_manager.cpp +++ b/host/lib/usrp/n230/n230_resource_manager.cpp @@ -89,7 +89,7 @@ n230_resource_manager::n230_resource_manager( n230_eth_conn_t conn_iface; conn_iface.ip_addr = addr; - boost::uint32_t iface_id = 0xFFFFFFFF; + uint32_t iface_id = 0xFFFFFFFF; try { iface_id = usrp3::usrp3_fw_ctrl_iface::get_iface_id( conn_iface.ip_addr, BOOST_STRINGIZE(N230_FW_COMMS_UDP_PORT), N230_FW_PRODUCT_ID); @@ -360,16 +360,16 @@ void n230_resource_manager::_initialize_radio(size_t instance) } } -boost::uint8_t xb_ep_to_sid(fpga::xb_endpoint_t ep) { - return static_cast<boost::uint8_t>(ep) << 4; +uint8_t xb_ep_to_sid(fpga::xb_endpoint_t ep) { + return static_cast<uint8_t>(ep) << 4; } const sid_t n230_resource_manager::_generate_sid(const n230_endpoint_t type, const n230_eth_port_t xport, size_t instance) { fpga::xb_endpoint_t xb_dest_ep; - boost::uint8_t sid_dest_ep = 0; + uint8_t sid_dest_ep = 0; fpga::xb_endpoint_t xb_ret_ep = (xport == ETH1) ? fpga::N230_XB_DST_E1 : fpga::N230_XB_DST_E0; - boost::uint8_t sid_ret_addr = (xport == ETH1) ? N230_HOST_SRC_ADDR_ETH1 : N230_HOST_SRC_ADDR_ETH0; + uint8_t sid_ret_addr = (xport == ETH1) ? N230_HOST_SRC_ADDR_ETH1 : N230_HOST_SRC_ADDR_ETH0; if (type == CORE or type == GPS_UART) { //Non-radio endpoints @@ -399,10 +399,10 @@ const sid_t n230_resource_manager::_generate_sid(const n230_endpoint_t type, con _fw_ctrl->poke32(fw::reg_addr(fw::WB_SBRB_BASE, fw::SR_ZPU_XB_LOCAL), sid.get_dst_addr()); // Program CAM entry for returning packets to us // This type of packet does not match the XB_LOCAL address and is looked up in the lower half of the CAM - _fw_ctrl->poke32(fw::reg_addr(fw::WB_XB_SBRB_BASE, sid.get_src_addr()), static_cast<boost::uint32_t>(xb_ret_ep)); + _fw_ctrl->poke32(fw::reg_addr(fw::WB_XB_SBRB_BASE, sid.get_src_addr()), static_cast<uint32_t>(xb_ret_ep)); // Program CAM entry for outgoing packets matching a N230 resource (for example a Radio) // This type of packet does matches the XB_LOCAL address and is looked up in the upper half of the CAM - _fw_ctrl->poke32(fw::reg_addr(fw::WB_XB_SBRB_BASE, 256 + sid.get_dst_endpoint()), static_cast<boost::uint32_t>(xb_dest_ep)); + _fw_ctrl->poke32(fw::reg_addr(fw::WB_XB_SBRB_BASE, 256 + sid.get_dst_endpoint()), static_cast<uint32_t>(xb_dest_ep)); return sid; } @@ -434,8 +434,8 @@ void n230_resource_manager::_program_dispatcher( //Send a mini packet with SID into the ZPU //ZPU will reprogram the ethernet framer transport::managed_send_buffer::sptr buff = xport.get_send_buff(); - buff->cast<boost::uint32_t *>()[0] = 0; //eth dispatch looks for != 0 - buff->cast<boost::uint32_t *>()[1] = uhd::htonx(sid.get()); + buff->cast<uint32_t *>()[0] = 0; //eth dispatch looks for != 0 + buff->cast<uint32_t *>()[1] = uhd::htonx(sid.get()); buff->commit(8); buff.reset(); @@ -466,8 +466,8 @@ bool n230_resource_manager::_radio_register_loopback_self_test(wb_iface::sptr if size_t hash = static_cast<size_t>(time(NULL)); for (size_t i = 0; i < 100; i++) { boost::hash_combine(hash, i); - iface->poke32(fpga::sr_addr(fpga::SR_RADIO_TEST), boost::uint32_t(hash)); - test_fail = iface->peek32(fpga::rb_addr(fpga::RB_RADIO_TEST)) != boost::uint32_t(hash); + iface->poke32(fpga::sr_addr(fpga::SR_RADIO_TEST), uint32_t(hash)); + test_fail = iface->peek32(fpga::rb_addr(fpga::RB_RADIO_TEST)) != uint32_t(hash); if (test_fail) break; //exit loop on any failure } return !test_fail; @@ -479,13 +479,13 @@ bool n230_resource_manager::_radio_data_loopback_self_test(wb_iface::sptr iface) size_t hash = size_t(time(NULL)); for (size_t i = 0; i < 100; i++) { boost::hash_combine(hash, i); - const boost::uint32_t word32 = boost::uint32_t(hash) & (IF_DATA_I_MASK | IF_DATA_Q_MASK); + const uint32_t word32 = uint32_t(hash) & (IF_DATA_I_MASK | IF_DATA_Q_MASK); iface->poke32(fpga::sr_addr(fpga::SR_RADIO_CODEC_IDLE), word32); iface->peek64(fpga::rb_addr(fpga::RB_RADIO_CODEC_DATA)); //block until request completes boost::this_thread::sleep(boost::posix_time::microseconds(100)); //wait for loopback to propagate through codec - const boost::uint64_t rb_word64 = iface->peek64(fpga::rb_addr(fpga::RB_RADIO_CODEC_DATA)); - const boost::uint32_t rb_tx = boost::uint32_t(rb_word64 >> 32); - const boost::uint32_t rb_rx = boost::uint32_t(rb_word64 & 0xffffffff); + const uint64_t rb_word64 = iface->peek64(fpga::rb_addr(fpga::RB_RADIO_CODEC_DATA)); + const uint32_t rb_tx = uint32_t(rb_word64 >> 32); + const uint32_t rb_rx = uint32_t(rb_word64 & 0xffffffff); test_fail = word32 != rb_tx or word32 != rb_rx; if (test_fail) UHD_MSG(fastpath) << boost::format("mismatch (exp:%x, got:%x and %x)... ") % word32 % rb_tx % rb_rx; @@ -514,7 +514,7 @@ std::string n230_resource_manager::_get_fpga_upgrade_msg() { void n230_resource_manager::_check_fw_compat() { - boost::uint32_t compat_num = _fw_ctrl->peek32(N230_FW_HOST_SHMEM_OFFSET(fw_compat_num)); + uint32_t compat_num = _fw_ctrl->peek32(N230_FW_HOST_SHMEM_OFFSET(fw_compat_num)); _fw_version.compat_major = compat_num >> 16; _fw_version.compat_minor = compat_num; _fw_version.version_hash = _fw_ctrl->peek32(N230_FW_HOST_SHMEM_OFFSET(fw_version_hash)); @@ -524,23 +524,23 @@ void n230_resource_manager::_check_fw_compat() "Expected firmware compatibility number %d.x, but got %d.%d\n" "The firmware build is not compatible with the host code build.\n" "%s" - ) % static_cast<boost::uint32_t>(N230_FW_COMPAT_NUM_MAJOR) - % static_cast<boost::uint32_t>(_fw_version.compat_major) - % static_cast<boost::uint32_t>(_fw_version.compat_minor) + ) % static_cast<uint32_t>(N230_FW_COMPAT_NUM_MAJOR) + % static_cast<uint32_t>(_fw_version.compat_major) + % static_cast<uint32_t>(_fw_version.compat_minor) % _get_fpga_upgrade_msg())); } } void n230_resource_manager::_check_fpga_compat() { - const boost::uint64_t compat = _core_ctrl->peek64(fpga::rb_addr(fpga::RB_CORE_SIGNATUE)); - const boost::uint32_t signature = boost::uint32_t(compat >> 32); - const boost::uint16_t product_id = boost::uint8_t(compat >> 24); - _fpga_version.compat_major = static_cast<boost::uint8_t>(compat >> 16); - _fpga_version.compat_minor = static_cast<boost::uint16_t>(compat); + const uint64_t compat = _core_ctrl->peek64(fpga::rb_addr(fpga::RB_CORE_SIGNATUE)); + const uint32_t signature = uint32_t(compat >> 32); + const uint16_t product_id = uint8_t(compat >> 24); + _fpga_version.compat_major = static_cast<uint8_t>(compat >> 16); + _fpga_version.compat_minor = static_cast<uint16_t>(compat); - const boost::uint64_t version_hash = _core_ctrl->peek64(fpga::rb_addr(fpga::RB_CORE_VERSION_HASH)); - _fpga_version.version_hash = boost::uint32_t(version_hash); + const uint64_t version_hash = _core_ctrl->peek64(fpga::rb_addr(fpga::RB_CORE_VERSION_HASH)); + _fpga_version.version_hash = uint32_t(version_hash); if (signature != 0x0ACE0BA5E || product_id != fpga::RB_N230_PRODUCT_ID) throw uhd::runtime_error("Signature check failed. Please contact support."); @@ -559,9 +559,9 @@ void n230_resource_manager::_check_fpga_compat() "Expected FPGA compatibility number %d.x, but got %d.%d:\n" "The FPGA build is not compatible with the host code build.\n" "%s" - ) % static_cast<boost::uint32_t>(fpga::RB_N230_COMPAT_MAJOR) - % static_cast<boost::uint32_t>(_fpga_version.compat_major) - % static_cast<boost::uint32_t>(_fpga_version.compat_minor) + ) % static_cast<uint32_t>(fpga::RB_N230_COMPAT_MAJOR) + % static_cast<uint32_t>(_fpga_version.compat_major) + % static_cast<uint32_t>(_fpga_version.compat_minor) % _get_fpga_upgrade_msg())); } } diff --git a/host/lib/usrp/n230/n230_resource_manager.hpp b/host/lib/usrp/n230/n230_resource_manager.hpp index 0a1178bd2..180f4f437 100644 --- a/host/lib/usrp/n230/n230_resource_manager.hpp +++ b/host/lib/usrp/n230/n230_resource_manager.hpp @@ -108,7 +108,7 @@ public: //Methods } } - inline boost::uint32_t get_version(n230_ver_src_t src, n230_version_t type) { + inline uint32_t get_version(n230_ver_src_t src, n230_version_t type) { switch (src) { case FPGA: return _fpga_version.get(type); case FIRMWARE: return _fw_version.get(type); @@ -210,11 +210,11 @@ public: //Methods private: struct ver_info_t { - boost::uint8_t compat_major; - boost::uint16_t compat_minor; - boost::uint32_t version_hash; + uint8_t compat_major; + uint16_t compat_minor; + uint32_t version_hash; - boost::uint32_t get(n230_version_t type) { + uint32_t get(n230_version_t type) { switch (type) { case COMPAT_MAJOR: return compat_major; case COMPAT_MINOR: return compat_minor; @@ -281,7 +281,7 @@ private: static boost::mutex _claimer_mutex; //All claims and checks in this process are serialized //Transport - boost::uint8_t _last_host_enpoint; + uint8_t _last_host_enpoint; //Radio settings interface radio_ctrl_core_3000::sptr _core_ctrl; diff --git a/host/lib/usrp/n230/n230_stream_manager.cpp b/host/lib/usrp/n230/n230_stream_manager.cpp index e7624ecd6..0528212d0 100644 --- a/host/lib/usrp/n230/n230_stream_manager.cpp +++ b/host/lib/usrp/n230/n230_stream_manager.cpp @@ -33,7 +33,7 @@ static const size_t N230_TX_MAX_ASYNC_MESSAGES = 1000; static const size_t N230_TX_MAX_SPP = 4092; static const size_t N230_TX_FC_RESPONSE_FREQ = 10; //per flow-control window -static const boost::uint32_t N230_EVENT_CODE_FLOW_CTRL = 0; +static const uint32_t N230_EVENT_CODE_FLOW_CTRL = 0; namespace uhd { namespace usrp { namespace n230 { @@ -97,7 +97,7 @@ rx_streamer::sptr n230_stream_manager::get_rx_stream(const uhd::stream_args_t &a //calculate packet size static const size_t hdr_size = 0 - + vrt::max_if_hdr_words32*sizeof(boost::uint32_t) + + vrt::max_if_hdr_words32*sizeof(uint32_t) //+ sizeof(vrt::if_packet_info_t().tlr) //no longer using trailer - sizeof(vrt::if_packet_info_t().cid) //no class id ever used - sizeof(vrt::if_packet_info_t().tsi) //no int time ever used @@ -224,8 +224,8 @@ tx_streamer::sptr n230_stream_manager::get_tx_stream(const uhd::stream_args_t &a //calculate packet size static const size_t hdr_size = 0 - + vrt::num_vrl_words32*sizeof(boost::uint32_t) - + vrt::max_if_hdr_words32*sizeof(boost::uint32_t) + + vrt::num_vrl_words32*sizeof(uint32_t) + + vrt::max_if_hdr_words32*sizeof(uint32_t) //+ sizeof(vrt::if_packet_info_t().tlr) //forced to have trailer - sizeof(vrt::if_packet_info_t().cid) //no class id ever used - sizeof(vrt::if_packet_info_t().tsi) //no int time ever used @@ -424,7 +424,7 @@ void n230_stream_manager::_handle_rx_flowctrl( if (not buff) { throw uhd::runtime_error("handle_rx_flowctrl timed out getting a send buffer"); } - boost::uint32_t *pkt = buff->cast<boost::uint32_t *>(); + uint32_t *pkt = buff->cast<uint32_t *>(); //recover seq32 size_t& seq_sw = fc_cache->last_seq_in; @@ -437,7 +437,7 @@ void n230_stream_manager::_handle_rx_flowctrl( vrt::if_packet_info_t packet_info; packet_info.packet_type = vrt::if_packet_info_t::PACKET_TYPE_CONTEXT; packet_info.num_payload_words32 = RXFC_PACKET_LEN_IN_WORDS; - packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(boost::uint32_t); + packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(uint32_t); packet_info.packet_count = seq_sw; packet_info.sob = false; packet_info.eob = false; @@ -452,11 +452,11 @@ void n230_stream_manager::_handle_rx_flowctrl( _cvita_hdr_pack(pkt, packet_info); //load payload - pkt[packet_info.num_header_words32 + RXFC_CMD_CODE_OFFSET] = uhd::htonx<boost::uint32_t>(N230_EVENT_CODE_FLOW_CTRL); - pkt[packet_info.num_header_words32 + RXFC_SEQ_NUM_OFFSET] = uhd::htonx<boost::uint32_t>(seq_sw); + pkt[packet_info.num_header_words32 + RXFC_CMD_CODE_OFFSET] = uhd::htonx<uint32_t>(N230_EVENT_CODE_FLOW_CTRL); + pkt[packet_info.num_header_words32 + RXFC_SEQ_NUM_OFFSET] = uhd::htonx<uint32_t>(seq_sw); //send the buffer over the interface - buff->commit(sizeof(boost::uint32_t)*(packet_info.num_packet_words32)); + buff->commit(sizeof(uint32_t)*(packet_info.num_packet_words32)); } void n230_stream_manager::_handle_tx_async_msgs( @@ -469,8 +469,8 @@ void n230_stream_manager::_handle_tx_async_msgs( //extract packet info vrt::if_packet_info_t if_packet_info; - if_packet_info.num_packet_words32 = buff->size()/sizeof(boost::uint32_t); - const boost::uint32_t *packet_buff = buff->cast<const boost::uint32_t *>(); + if_packet_info.num_packet_words32 = buff->size()/sizeof(uint32_t); + const uint32_t *packet_buff = buff->cast<const uint32_t *>(); //unpacking can fail uint32_t (*endian_conv)(uint32_t) = uhd::ntohx; @@ -544,7 +544,7 @@ double n230_stream_manager::_get_tick_rate() } void n230_stream_manager::_cvita_hdr_unpack( - const boost::uint32_t *packet_buff, + const uint32_t *packet_buff, vrt::if_packet_info_t &if_packet_info) { if_packet_info.link_type = vrt::if_packet_info_t::LINK_TYPE_CHDR; @@ -552,7 +552,7 @@ void n230_stream_manager::_cvita_hdr_unpack( } void n230_stream_manager::_cvita_hdr_pack( - boost::uint32_t *packet_buff, + uint32_t *packet_buff, vrt::if_packet_info_t &if_packet_info) { if_packet_info.link_type = vrt::if_packet_info_t::LINK_TYPE_CHDR; diff --git a/host/lib/usrp/n230/n230_stream_manager.hpp b/host/lib/usrp/n230/n230_stream_manager.hpp index 7a496c4e9..c3588474e 100644 --- a/host/lib/usrp/n230/n230_stream_manager.hpp +++ b/host/lib/usrp/n230/n230_stream_manager.hpp @@ -123,11 +123,11 @@ private: size_t hw_buff_size); static void _cvita_hdr_unpack( - const boost::uint32_t *packet_buff, + const uint32_t *packet_buff, transport::vrt::if_packet_info_t &if_packet_info); static void _cvita_hdr_pack( - boost::uint32_t *packet_buff, + uint32_t *packet_buff, transport::vrt::if_packet_info_t &if_packet_info); const n230_device_args_t _dev_args; @@ -143,7 +143,7 @@ private: stream_args_t _tx_stream_cached_args[fpga::NUM_RADIOS]; stream_args_t _rx_stream_cached_args[fpga::NUM_RADIOS]; - static const boost::uint32_t HW_SEQ_NUM_MASK = 0xFFF; + static const uint32_t HW_SEQ_NUM_MASK = 0xFFF; }; }}} //namespace diff --git a/host/lib/usrp/n230/n230_uart.cpp b/host/lib/usrp/n230/n230_uart.cpp index 20936c303..7291a7276 100644 --- a/host/lib/usrp/n230/n230_uart.cpp +++ b/host/lib/usrp/n230/n230_uart.cpp @@ -31,7 +31,7 @@ namespace uhd { namespace usrp { namespace n230 { struct n230_uart_impl : n230_uart { - n230_uart_impl(zero_copy_if::sptr xport, const boost::uint32_t sid): + n230_uart_impl(zero_copy_if::sptr xport, const uint32_t sid): _xport(xport), _sid(sid), _count(0), @@ -53,7 +53,7 @@ struct n230_uart_impl : n230_uart packet_info.link_type = vrt::if_packet_info_t::LINK_TYPE_CHDR; packet_info.packet_type = vrt::if_packet_info_t::PACKET_TYPE_CONTEXT; packet_info.num_payload_words32 = 2; - packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(boost::uint32_t); + packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(uint32_t); packet_info.packet_count = _count++; packet_info.sob = false; packet_info.eob = false; @@ -64,11 +64,11 @@ struct n230_uart_impl : n230_uart packet_info.has_tsf = false; packet_info.has_tlr = false; - boost::uint32_t *packet_buff = buff->cast<boost::uint32_t *>(); + uint32_t *packet_buff = buff->cast<uint32_t *>(); vrt::if_hdr_pack_le(packet_buff, packet_info); - packet_buff[packet_info.num_header_words32+0] = uhd::htonx(boost::uint32_t(_baud_div)); - packet_buff[packet_info.num_header_words32+1] = uhd::htonx(boost::uint32_t(ch)); - buff->commit(packet_info.num_packet_words32*sizeof(boost::uint32_t)); + packet_buff[packet_info.num_header_words32+0] = uhd::htonx(uint32_t(_baud_div)); + packet_buff[packet_info.num_header_words32+1] = uhd::htonx(uint32_t(ch)); + buff->commit(packet_info.num_packet_words32*sizeof(uint32_t)); } void write_uart(const std::string &buff) @@ -100,10 +100,10 @@ struct n230_uart_impl : n230_uart managed_recv_buffer::sptr buff = _xport->get_recv_buff(); if (not buff) return; - const boost::uint32_t *packet_buff = buff->cast<const boost::uint32_t *>(); + const uint32_t *packet_buff = buff->cast<const uint32_t *>(); vrt::if_packet_info_t packet_info; packet_info.link_type = vrt::if_packet_info_t::LINK_TYPE_CHDR; - packet_info.num_packet_words32 = buff->size()/sizeof(boost::uint32_t); + packet_info.num_packet_words32 = buff->size()/sizeof(uint32_t); vrt::if_hdr_unpack_be(packet_buff, packet_info); const char ch = char(uhd::ntohx(packet_buff[packet_info.num_header_words32+1])); _char_queue.push_with_pop_on_full(ch); @@ -115,7 +115,7 @@ struct n230_uart_impl : n230_uart } const zero_copy_if::sptr _xport; - const boost::uint32_t _sid; + const uint32_t _sid; size_t _count; size_t _baud_div; bounded_buffer<char> _char_queue; @@ -123,7 +123,7 @@ struct n230_uart_impl : n230_uart }; -n230_uart::sptr n230_uart::make(zero_copy_if::sptr xport, const boost::uint32_t sid) +n230_uart::sptr n230_uart::make(zero_copy_if::sptr xport, const uint32_t sid) { return n230_uart::sptr(new n230_uart_impl(xport, sid)); } diff --git a/host/lib/usrp/n230/n230_uart.hpp b/host/lib/usrp/n230/n230_uart.hpp index 0bde12ab2..168399f50 100644 --- a/host/lib/usrp/n230/n230_uart.hpp +++ b/host/lib/usrp/n230/n230_uart.hpp @@ -29,7 +29,7 @@ class n230_uart: boost::noncopyable, public uhd::uart_iface { public: typedef boost::shared_ptr<n230_uart> sptr; - static sptr make(uhd::transport::zero_copy_if::sptr, const boost::uint32_t sid); + static sptr make(uhd::transport::zero_copy_if::sptr, const uint32_t sid); virtual void set_baud_divider(const double baud_div) = 0; }; diff --git a/host/lib/usrp/usrp1/codec_ctrl.cpp b/host/lib/usrp/usrp1/codec_ctrl.cpp index 8ba7b54ca..4c811d5e2 100644 --- a/host/lib/usrp/usrp1/codec_ctrl.cpp +++ b/host/lib/usrp/usrp1/codec_ctrl.cpp @@ -23,7 +23,7 @@ #include <uhd/exception.hpp> #include <uhd/utils/algorithm.hpp> #include <uhd/utils/byteswap.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/format.hpp> #include <boost/tuple/tuple.hpp> #include <boost/math/special_functions/round.hpp> @@ -70,8 +70,8 @@ private: spi_iface::sptr _iface; int _spi_slave; ad9862_regs_t _ad9862_regs; - void send_reg(boost::uint8_t addr); - void recv_reg(boost::uint8_t addr); + void send_reg(uint8_t addr); + void recv_reg(uint8_t addr); double coarse_tune(double codec_rate, double freq); double fine_tune(double codec_rate, double freq); @@ -124,7 +124,7 @@ usrp1_codec_ctrl_impl::usrp1_codec_ctrl_impl(spi_iface::sptr iface, int spi_slav _ad9862_regs.clkout2_div_factor = ad9862_regs_t::CLKOUT2_DIV_FACTOR_2; //write the register settings to the codec - for (boost::uint8_t addr = 0; addr <= 25; addr++) { + for (uint8_t addr = 0; addr <= 25; addr++) { this->send_reg(addr); } @@ -198,9 +198,9 @@ double usrp1_codec_ctrl_impl::get_rx_pga_gain(char which){ /*********************************************************************** * Codec Control AUX ADC Methods **********************************************************************/ -static double aux_adc_to_volts(boost::uint8_t high, boost::uint8_t low) +static double aux_adc_to_volts(uint8_t high, uint8_t low) { - return double(((boost::uint16_t(high) << 2) | low)*3.3)/0x3ff; + return double(((uint16_t(high) << 2) | low)*3.3)/0x3ff; } double usrp1_codec_ctrl_impl::read_aux_adc(aux_adc_t which){ @@ -243,19 +243,19 @@ void usrp1_codec_ctrl_impl::write_aux_dac(aux_dac_t which, double volts) { //special case for aux dac d (aka sigma delta word) if (which == AUX_DAC_D) { - boost::uint16_t dac_word = uhd::clip(boost::math::iround(volts*0xfff/3.3), 0, 0xfff); - _ad9862_regs.sig_delt_11_4 = boost::uint8_t(dac_word >> 4); - _ad9862_regs.sig_delt_3_0 = boost::uint8_t(dac_word & 0xf); + uint16_t dac_word = uhd::clip(boost::math::iround(volts*0xfff/3.3), 0, 0xfff); + _ad9862_regs.sig_delt_11_4 = uint8_t(dac_word >> 4); + _ad9862_regs.sig_delt_3_0 = uint8_t(dac_word & 0xf); this->send_reg(42); this->send_reg(43); return; } //calculate the dac word for aux dac a, b, c - boost::uint8_t dac_word = uhd::clip(boost::math::iround(volts*0xff/3.3), 0, 0xff); + uint8_t dac_word = uhd::clip(boost::math::iround(volts*0xff/3.3), 0, 0xff); //setup a lookup table for the aux dac params (reg ref, reg addr) - typedef boost::tuple<boost::uint8_t*, boost::uint8_t> dac_params_t; + typedef boost::tuple<uint8_t*, uint8_t> dac_params_t; uhd::dict<aux_dac_t, dac_params_t> aux_dac_to_params = boost::assign::map_list_of (AUX_DAC_A, dac_params_t(&_ad9862_regs.aux_dac_a, 36)) (AUX_DAC_B, dac_params_t(&_ad9862_regs.aux_dac_b, 37)) @@ -264,7 +264,7 @@ void usrp1_codec_ctrl_impl::write_aux_dac(aux_dac_t which, double volts) //set the aux dac register UHD_ASSERT_THROW(aux_dac_to_params.has_key(which)); - boost::uint8_t *reg_ref, reg_addr; + uint8_t *reg_ref, reg_addr; boost::tie(reg_ref, reg_addr) = aux_dac_to_params[which]; *reg_ref = dac_word; this->send_reg(reg_addr); @@ -273,9 +273,9 @@ void usrp1_codec_ctrl_impl::write_aux_dac(aux_dac_t which, double volts) /*********************************************************************** * Codec Control SPI Methods **********************************************************************/ -void usrp1_codec_ctrl_impl::send_reg(boost::uint8_t addr) +void usrp1_codec_ctrl_impl::send_reg(uint8_t addr) { - boost::uint32_t reg = _ad9862_regs.get_write_reg(addr); + uint32_t reg = _ad9862_regs.get_write_reg(addr); UHD_LOGV(often) << "codec control write reg: 0x" @@ -285,16 +285,16 @@ void usrp1_codec_ctrl_impl::send_reg(boost::uint8_t addr) spi_config_t::EDGE_RISE, reg, 16); } -void usrp1_codec_ctrl_impl::recv_reg(boost::uint8_t addr) +void usrp1_codec_ctrl_impl::recv_reg(uint8_t addr) { - boost::uint32_t reg = _ad9862_regs.get_read_reg(addr); + uint32_t reg = _ad9862_regs.get_read_reg(addr); UHD_LOGV(often) << "codec control read reg: 0x" << std::setw(8) << std::hex << reg << std::endl ; - boost::uint32_t ret = _iface->read_spi(_spi_slave, + uint32_t ret = _iface->read_spi(_spi_slave, spi_config_t::EDGE_RISE, reg, 16); UHD_LOGV(often) @@ -302,7 +302,7 @@ void usrp1_codec_ctrl_impl::recv_reg(boost::uint8_t addr) << std::setw(8) << std::hex << ret << std::endl ; - _ad9862_regs.set_reg(addr, boost::uint16_t(ret)); + _ad9862_regs.set_reg(addr, uint16_t(ret)); } /*********************************************************************** @@ -356,7 +356,7 @@ double usrp1_codec_ctrl_impl::fine_tune(double codec_rate, double target_freq) { static const double scale_factor = std::pow(2.0, 24); - boost::uint32_t freq_word = boost::uint32_t( + uint32_t freq_word = uint32_t( boost::math::round(std::abs((target_freq / codec_rate) * scale_factor))); double actual_freq = freq_word * codec_rate / scale_factor; diff --git a/host/lib/usrp/usrp1/dboard_iface.cpp b/host/lib/usrp/usrp1/dboard_iface.cpp index 5640e8dae..645c0bfd3 100644 --- a/host/lib/usrp/usrp1/dboard_iface.cpp +++ b/host/lib/usrp/usrp1/dboard_iface.cpp @@ -107,35 +107,35 @@ public: void write_aux_dac(unit_t, aux_dac_t, double); double read_aux_adc(unit_t, aux_adc_t); - void set_pin_ctrl(unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_pin_ctrl(unit_t unit); - void set_atr_reg(unit_t unit, atr_reg_t reg, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_atr_reg(unit_t unit, atr_reg_t reg); - void set_gpio_ddr(unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_gpio_ddr(unit_t unit); - void set_gpio_out(unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_gpio_out(unit_t unit); - boost::uint32_t read_gpio(unit_t unit); - - void _set_pin_ctrl(unit_t, boost::uint16_t); - void _set_atr_reg(unit_t, atr_reg_t, boost::uint16_t); - void _set_gpio_ddr(unit_t, boost::uint16_t); - void _set_gpio_out(unit_t, boost::uint16_t); + void set_pin_ctrl(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_pin_ctrl(unit_t unit); + void set_atr_reg(unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_atr_reg(unit_t unit, atr_reg_t reg); + void set_gpio_ddr(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_gpio_ddr(unit_t unit); + void set_gpio_out(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_gpio_out(unit_t unit); + uint32_t read_gpio(unit_t unit); + + void _set_pin_ctrl(unit_t, uint16_t); + void _set_atr_reg(unit_t, atr_reg_t, uint16_t); + void _set_gpio_ddr(unit_t, uint16_t); + void _set_gpio_out(unit_t, uint16_t); void set_command_time(const uhd::time_spec_t& t); uhd::time_spec_t get_command_time(void); - void write_i2c(boost::uint16_t, const byte_vector_t &); - byte_vector_t read_i2c(boost::uint16_t, size_t); + void write_i2c(uint16_t, const byte_vector_t &); + byte_vector_t read_i2c(uint16_t, size_t); void write_spi(unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits); - boost::uint32_t read_write_spi(unit_t unit, + uint32_t read_write_spi(unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits); void set_clock_rate(unit_t, double); @@ -152,8 +152,8 @@ private: const usrp1_impl::dboard_slot_t _dboard_slot; const double &_master_clock_rate; const dboard_id_t _rx_dboard_id; - uhd::dict<unit_t, boost::uint16_t> _pin_ctrl, _gpio_out, _gpio_ddr; - uhd::dict<unit_t, uhd::dict<atr_reg_t, boost::uint16_t> > _atr_regs; + uhd::dict<unit_t, uint16_t> _pin_ctrl, _gpio_out, _gpio_ddr; + uhd::dict<unit_t, uhd::dict<atr_reg_t, uint16_t> > _atr_regs; }; /*********************************************************************** @@ -238,41 +238,41 @@ static T shadow_it(T &shadow, const T &value, const T &mask){ return shadow; } -void usrp1_dboard_iface::set_pin_ctrl(unit_t unit, boost::uint32_t value, boost::uint32_t mask){ - _set_pin_ctrl(unit, shadow_it(_pin_ctrl[unit], static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask))); +void usrp1_dboard_iface::set_pin_ctrl(unit_t unit, uint32_t value, uint32_t mask){ + _set_pin_ctrl(unit, shadow_it(_pin_ctrl[unit], static_cast<uint16_t>(value), static_cast<uint16_t>(mask))); } -boost::uint32_t usrp1_dboard_iface::get_pin_ctrl(unit_t unit){ +uint32_t usrp1_dboard_iface::get_pin_ctrl(unit_t unit){ return _pin_ctrl[unit]; } -void usrp1_dboard_iface::set_atr_reg(unit_t unit, atr_reg_t reg, boost::uint32_t value, boost::uint32_t mask){ - _set_atr_reg(unit, reg, shadow_it(_atr_regs[unit][reg], static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask))); +void usrp1_dboard_iface::set_atr_reg(unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask){ + _set_atr_reg(unit, reg, shadow_it(_atr_regs[unit][reg], static_cast<uint16_t>(value), static_cast<uint16_t>(mask))); } -boost::uint32_t usrp1_dboard_iface::get_atr_reg(unit_t unit, atr_reg_t reg){ +uint32_t usrp1_dboard_iface::get_atr_reg(unit_t unit, atr_reg_t reg){ return _atr_regs[unit][reg]; } -void usrp1_dboard_iface::set_gpio_ddr(unit_t unit, boost::uint32_t value, boost::uint32_t mask){ - _set_gpio_ddr(unit, shadow_it(_gpio_ddr[unit], static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask))); +void usrp1_dboard_iface::set_gpio_ddr(unit_t unit, uint32_t value, uint32_t mask){ + _set_gpio_ddr(unit, shadow_it(_gpio_ddr[unit], static_cast<uint16_t>(value), static_cast<uint16_t>(mask))); } -boost::uint32_t usrp1_dboard_iface::get_gpio_ddr(unit_t unit){ +uint32_t usrp1_dboard_iface::get_gpio_ddr(unit_t unit){ return _gpio_ddr[unit]; } -void usrp1_dboard_iface::set_gpio_out(unit_t unit, boost::uint32_t value, boost::uint32_t mask){ - _set_gpio_out(unit, shadow_it(_gpio_out[unit], static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask))); +void usrp1_dboard_iface::set_gpio_out(unit_t unit, uint32_t value, uint32_t mask){ + _set_gpio_out(unit, shadow_it(_gpio_out[unit], static_cast<uint16_t>(value), static_cast<uint16_t>(mask))); } -boost::uint32_t usrp1_dboard_iface::get_gpio_out(unit_t unit){ +uint32_t usrp1_dboard_iface::get_gpio_out(unit_t unit){ return _gpio_out[unit]; } -boost::uint32_t usrp1_dboard_iface::read_gpio(unit_t unit) +uint32_t usrp1_dboard_iface::read_gpio(unit_t unit) { - boost::uint32_t out_value; + uint32_t out_value; if (_dboard_slot == usrp1_impl::DBOARD_SLOT_A) out_value = _iface->peek32(1); @@ -283,15 +283,15 @@ boost::uint32_t usrp1_dboard_iface::read_gpio(unit_t unit) switch(unit) { case UNIT_RX: - return (boost::uint32_t)((out_value >> 16) & 0x0000ffff); + return (uint32_t)((out_value >> 16) & 0x0000ffff); case UNIT_TX: - return (boost::uint32_t)((out_value >> 0) & 0x0000ffff); + return (uint32_t)((out_value >> 0) & 0x0000ffff); default: UHD_THROW_INVALID_CODE_PATH(); } UHD_ASSERT_THROW(false); } -void usrp1_dboard_iface::_set_pin_ctrl(unit_t unit, boost::uint16_t value) +void usrp1_dboard_iface::_set_pin_ctrl(unit_t unit, uint16_t value) { switch(unit) { case UNIT_RX: @@ -310,7 +310,7 @@ void usrp1_dboard_iface::_set_pin_ctrl(unit_t unit, boost::uint16_t value) } } -void usrp1_dboard_iface::_set_gpio_ddr(unit_t unit, boost::uint16_t value) +void usrp1_dboard_iface::_set_gpio_ddr(unit_t unit, uint16_t value) { switch(unit) { case UNIT_RX: @@ -329,7 +329,7 @@ void usrp1_dboard_iface::_set_gpio_ddr(unit_t unit, boost::uint16_t value) } } -void usrp1_dboard_iface::_set_gpio_out(unit_t unit, boost::uint16_t value) +void usrp1_dboard_iface::_set_gpio_out(unit_t unit, uint16_t value) { switch(unit) { case UNIT_RX: @@ -349,7 +349,7 @@ void usrp1_dboard_iface::_set_gpio_out(unit_t unit, boost::uint16_t value) } void usrp1_dboard_iface::_set_atr_reg(unit_t unit, - atr_reg_t atr, boost::uint16_t value) + atr_reg_t atr, uint16_t value) { // Ignore unsupported states if ((atr == ATR_REG_IDLE) || (atr == ATR_REG_TX_ONLY)) @@ -397,7 +397,7 @@ void usrp1_dboard_iface::_set_atr_reg(unit_t unit, * \param slot the side (A or B) the dboard is attached * \return the slave device number */ -static boost::uint32_t unit_to_otw_spi_dev(dboard_iface::unit_t unit, +static uint32_t unit_to_otw_spi_dev(dboard_iface::unit_t unit, usrp1_impl::dboard_slot_t slot) { switch(unit) { @@ -423,16 +423,16 @@ static boost::uint32_t unit_to_otw_spi_dev(dboard_iface::unit_t unit, void usrp1_dboard_iface::write_spi(unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits) { _iface->write_spi(unit_to_otw_spi_dev(unit, _dboard_slot), config, data, num_bits); } -boost::uint32_t usrp1_dboard_iface::read_write_spi(unit_t unit, +uint32_t usrp1_dboard_iface::read_write_spi(unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits) { return _iface->read_spi(unit_to_otw_spi_dev(unit, _dboard_slot), @@ -442,13 +442,13 @@ boost::uint32_t usrp1_dboard_iface::read_write_spi(unit_t unit, /*********************************************************************** * I2C **********************************************************************/ -void usrp1_dboard_iface::write_i2c(boost::uint16_t addr, +void usrp1_dboard_iface::write_i2c(uint16_t addr, const byte_vector_t &bytes) { return _iface->write_i2c(addr, bytes); } -byte_vector_t usrp1_dboard_iface::read_i2c(boost::uint16_t addr, +byte_vector_t usrp1_dboard_iface::read_i2c(uint16_t addr, size_t num_bytes) { return _iface->read_i2c(addr, num_bytes); diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp index e1f17e5a6..920023dad 100644 --- a/host/lib/usrp/usrp1/io_impl.cpp +++ b/host/lib/usrp/usrp1/io_impl.cpp @@ -115,7 +115,7 @@ private: * BS VRT packer/unpacker functions (since samples don't have headers) **********************************************************************/ static void usrp1_bs_vrt_packer( - boost::uint32_t *, + uint32_t *, vrt::if_packet_info_t &if_packet_info ){ if_packet_info.num_header_words32 = 0; @@ -123,12 +123,12 @@ static void usrp1_bs_vrt_packer( } static void usrp1_bs_vrt_unpacker( - const boost::uint32_t *, + const uint32_t *, vrt::if_packet_info_t &if_packet_info ){ if_packet_info.packet_type = vrt::if_packet_info_t::PACKET_TYPE_DATA; if_packet_info.num_payload_words32 = if_packet_info.num_packet_words32; - if_packet_info.num_payload_bytes = if_packet_info.num_packet_words32*sizeof(boost::uint32_t); + if_packet_info.num_payload_bytes = if_packet_info.num_packet_words32*sizeof(uint32_t); if_packet_info.num_header_words32 = 0; if_packet_info.packet_count = 0; if_packet_info.sob = false; @@ -286,7 +286,7 @@ void usrp1_impl::vandal_conquest_loop(void){ //start the polling loop... try{ while (not boost::this_thread::interruption_requested()){ - boost::uint8_t underflow = 0, overflow = 0; + uint8_t underflow = 0, overflow = 0; //shutoff transmit if it has been too long since send() was called if (_tx_enabled and (boost::get_system_time() - _io_impl->last_send_time) > boost::posix_time::milliseconds(100)){ @@ -566,9 +566,9 @@ double usrp1_impl::update_rx_dsp_freq(const size_t dspno, const double freq_){ //calculate the freq register word (signed) UHD_ASSERT_THROW(std::abs(freq) <= _master_clock_rate/2.0); static const double scale_factor = std::pow(2.0, 32); - const boost::int32_t freq_word = boost::int32_t(boost::math::round((freq / _master_clock_rate) * scale_factor)); + const int32_t freq_word = int32_t(boost::math::round((freq / _master_clock_rate) * scale_factor)); - static const boost::uint32_t dsp_index_to_reg_val[4] = { + static const uint32_t dsp_index_to_reg_val[4] = { FR_RX_FREQ_0, FR_RX_FREQ_1, FR_RX_FREQ_2, FR_RX_FREQ_3 }; _iface->poke32(dsp_index_to_reg_val[dspno], freq_word); diff --git a/host/lib/usrp/usrp1/usrp1_calc_mux.hpp b/host/lib/usrp/usrp1/usrp1_calc_mux.hpp index d86a7a809..3577a8042 100644 --- a/host/lib/usrp/usrp1/usrp1_calc_mux.hpp +++ b/host/lib/usrp/usrp1/usrp1_calc_mux.hpp @@ -47,7 +47,7 @@ static int calc_rx_mux_pair(int adc_for_i, int adc_for_q){ * | must be zero | Q3| I3| Q2| I2| Q1| I1| Q0| I0|Z| NCH | * +-----------------------+-------+-------+-------+-------+-+-----+ */ -static boost::uint32_t calc_rx_mux(const std::vector<mapping_pair_t> &mapping){ +static uint32_t calc_rx_mux(const std::vector<mapping_pair_t> &mapping){ //create look-up-table for mapping dboard name and connection type to ADC flags static const int ADC0 = 0, ADC1 = 1, ADC2 = 2, ADC3 = 3; static const uhd::dict<std::string, uhd::dict<std::string, int> > name_to_conn_to_flag = boost::assign::map_list_of @@ -108,7 +108,7 @@ static int calc_tx_mux_pair(int chn_for_i, int chn_for_q){ * | | DAC1Q | DAC1I | DAC0Q | DAC0I |0| NCH | * +-----------------------------------------------+-------+-+-----+ */ -static boost::uint32_t calc_tx_mux(const std::vector<mapping_pair_t> &mapping){ +static uint32_t calc_tx_mux(const std::vector<mapping_pair_t> &mapping){ //create look-up-table for mapping channel number and connection type to flags static const int ENB = 1 << 3, CHAN_I0 = 0, CHAN_Q0 = 1, CHAN_I1 = 2, CHAN_Q1 = 3; static const uhd::dict<size_t, uhd::dict<std::string, int> > chan_to_conn_to_flag = boost::assign::map_list_of diff --git a/host/lib/usrp/usrp1/usrp1_iface.cpp b/host/lib/usrp/usrp1/usrp1_iface.cpp index 48fdfcf12..b65f8fa2f 100644 --- a/host/lib/usrp/usrp1/usrp1_iface.cpp +++ b/host/lib/usrp/usrp1/usrp1_iface.cpp @@ -45,9 +45,9 @@ public: /******************************************************************* * Peek and Poke ******************************************************************/ - void poke32(const boost::uint32_t addr, const boost::uint32_t value) + void poke32(const uint32_t addr, const uint32_t value) { - boost::uint32_t swapped = uhd::htonx(value); + uint32_t swapped = uhd::htonx(value); UHD_LOGV(always) << "poke32(" @@ -55,48 +55,48 @@ public: << std::hex << std::setw(8) << value << ")" << std::endl ; - boost::uint8_t w_index_h = SPI_ENABLE_FPGA & 0xff; - boost::uint8_t w_index_l = (SPI_FMT_MSB | SPI_FMT_HDR_1) & 0xff; + uint8_t w_index_h = SPI_ENABLE_FPGA & 0xff; + uint8_t w_index_l = (SPI_FMT_MSB | SPI_FMT_HDR_1) & 0xff; int ret =_ctrl_transport->usrp_control_write( VRQ_SPI_WRITE, addr & 0x7f, (w_index_h << 8) | (w_index_l << 0), (unsigned char*) &swapped, - sizeof(boost::uint32_t)); + sizeof(uint32_t)); if (ret < 0) throw uhd::io_error("USRP1: failed control write"); } - boost::uint32_t peek32(const boost::uint32_t addr) + uint32_t peek32(const uint32_t addr) { UHD_LOGV(always) << "peek32(" << std::dec << std::setw(2) << addr << ")" << std::endl ; - boost::uint32_t value_out; + uint32_t value_out; - boost::uint8_t w_index_h = SPI_ENABLE_FPGA & 0xff; - boost::uint8_t w_index_l = (SPI_FMT_MSB | SPI_FMT_HDR_1) & 0xff; + uint8_t w_index_h = SPI_ENABLE_FPGA & 0xff; + uint8_t w_index_l = (SPI_FMT_MSB | SPI_FMT_HDR_1) & 0xff; int ret = _ctrl_transport->usrp_control_read( VRQ_SPI_READ, 0x80 | (addr & 0x7f), (w_index_h << 8) | (w_index_l << 0), (unsigned char*) &value_out, - sizeof(boost::uint32_t)); + sizeof(uint32_t)); if (ret < 0) throw uhd::io_error("USRP1: failed control read"); return uhd::ntohx(value_out); } - void poke16(const boost::uint32_t, const boost::uint16_t) { + void poke16(const uint32_t, const uint16_t) { throw uhd::not_implemented_error("Unhandled command poke16()"); } - boost::uint16_t peek16(const boost::uint32_t) { + uint16_t peek16(const uint32_t) { throw uhd::not_implemented_error("Unhandled command peek16()"); return 0; } @@ -104,11 +104,11 @@ public: /******************************************************************* * I2C ******************************************************************/ - void write_i2c(boost::uint16_t addr, const byte_vector_t &bytes){ + void write_i2c(uint16_t addr, const byte_vector_t &bytes){ return _ctrl_transport->write_i2c(addr, bytes); } - byte_vector_t read_i2c(boost::uint16_t addr, size_t num_bytes){ + byte_vector_t read_i2c(uint16_t addr, size_t num_bytes){ return _ctrl_transport->read_i2c(addr, num_bytes); } @@ -123,9 +123,9 @@ public: * 4 bytes of OUT data in the device request fields and uses the * control buffer for IN data. ******************************************************************/ - boost::uint32_t transact_spi(int which_slave, + uint32_t transact_spi(int which_slave, const spi_config_t &, - boost::uint32_t bits, + uint32_t bits, size_t num_bits, bool readback) { @@ -166,10 +166,10 @@ public: else{ throw uhd::io_error("USRP1: invalid input data for SPI readback"); } - boost::uint32_t val = (((boost::uint32_t)buff[0]) << 0) | - (((boost::uint32_t)buff[1]) << 8) | - (((boost::uint32_t)buff[2]) << 16) | - (((boost::uint32_t)buff[3]) << 24); + uint32_t val = (((uint32_t)buff[0]) << 0) | + (((uint32_t)buff[1]) << 8) | + (((uint32_t)buff[2]) << 16) | + (((uint32_t)buff[3]) << 24); return val; } else { @@ -178,8 +178,8 @@ public: for (size_t i = 1; i <= num_bytes; i++) buff[num_bytes - i] = (bits >> ((i - 1) * 8)) & 0xff; - boost::uint8_t w_index_h = which_slave & 0xff; - boost::uint8_t w_index_l = (SPI_FMT_MSB | SPI_FMT_HDR_0) & 0xff; + uint8_t w_index_h = which_slave & 0xff; + uint8_t w_index_l = (SPI_FMT_MSB | SPI_FMT_HDR_0) & 0xff; int ret =_ctrl_transport->usrp_control_write( VRQ_SPI_WRITE, diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp index 5e1a70a8f..baecc6081 100644 --- a/host/lib/usrp/usrp1/usrp1_impl.cpp +++ b/host/lib/usrp/usrp1/usrp1_impl.cpp @@ -36,10 +36,10 @@ using namespace uhd; using namespace uhd::usrp; using namespace uhd::transport; -const boost::uint16_t USRP1_VENDOR_ID = 0xfffe; -const boost::uint16_t USRP1_PRODUCT_ID = 0x0002; -const boost::uint16_t FX2_VENDOR_ID = 0x04b4; -const boost::uint16_t FX2_PRODUCT_ID = 0x8613; +const uint16_t USRP1_VENDOR_ID = 0xfffe; +const uint16_t USRP1_PRODUCT_ID = 0x0002; +const uint16_t FX2_VENDOR_ID = 0x04b4; +const uint16_t FX2_PRODUCT_ID = 0x8613; static const boost::posix_time::milliseconds REENUMERATION_TIMEOUT_MS(3000); const std::vector<usrp1_impl::dboard_slot_t> usrp1_impl::_dboard_slots = boost::assign::list_of @@ -60,11 +60,11 @@ static device_addrs_t usrp1_find(const device_addr_t &hint) //since an address and resource is intended for a different, non-USB, device. if (hint.has_key("addr") || hint.has_key("resource")) return usrp1_addrs; - boost::uint16_t vid, pid; + uint16_t vid, pid; if(hint.has_key("vid") && hint.has_key("pid") && hint.has_key("type") && hint["type"] == "usrp1") { - vid = uhd::cast::hexstr_cast<boost::uint16_t>(hint.get("vid")); - pid = uhd::cast::hexstr_cast<boost::uint16_t>(hint.get("pid")); + vid = uhd::cast::hexstr_cast<uint16_t>(hint.get("vid")); + pid = uhd::cast::hexstr_cast<uint16_t>(hint.get("pid")); } else { vid = USRP1_VENDOR_ID; pid = USRP1_PRODUCT_ID; @@ -214,7 +214,7 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){ //////////////////////////////////////////////////////////////////// // create user-defined control objects //////////////////////////////////////////////////////////////////// - _tree->create<std::pair<boost::uint8_t, boost::uint32_t> >(mb_path / "user" / "regs") + _tree->create<std::pair<uint8_t, uint32_t> >(mb_path / "user" / "regs") .add_coerced_subscriber(boost::bind(&usrp1_impl::set_reg, this, _1)); //////////////////////////////////////////////////////////////////// @@ -432,22 +432,22 @@ usrp1_impl::~usrp1_impl(void){ * +-----------------------------------------------+-+-----+-+-----+ */ size_t usrp1_impl::get_num_ddcs(void){ - boost::uint32_t regval = _iface->peek32(FR_RB_CAPS); + uint32_t regval = _iface->peek32(FR_RB_CAPS); return (regval >> 0) & 0x0007; } size_t usrp1_impl::get_num_ducs(void){ - boost::uint32_t regval = _iface->peek32(FR_RB_CAPS); + uint32_t regval = _iface->peek32(FR_RB_CAPS); return (regval >> 4) & 0x0007; } bool usrp1_impl::has_rx_halfband(void){ - boost::uint32_t regval = _iface->peek32(FR_RB_CAPS); + uint32_t regval = _iface->peek32(FR_RB_CAPS); return (regval >> 3) & 0x0001; } bool usrp1_impl::has_tx_halfband(void){ - boost::uint32_t regval = _iface->peek32(FR_RB_CAPS); + uint32_t regval = _iface->peek32(FR_RB_CAPS); return (regval >> 7) & 0x0001; } @@ -489,8 +489,8 @@ void usrp1_impl::set_enb_rx_dc_offset(const std::string &db, const bool enb){ } std::complex<double> usrp1_impl::set_rx_dc_offset(const std::string &db, const std::complex<double> &offset){ - const boost::int32_t i_off = boost::math::iround(offset.real() * (1ul << 31)); - const boost::int32_t q_off = boost::math::iround(offset.imag() * (1ul << 31)); + const int32_t i_off = boost::math::iround(offset.real() * (1ul << 31)); + const int32_t q_off = boost::math::iround(offset.imag() * (1ul << 31)); if (db == "A"){ _iface->poke32(FR_ADC_OFFSET_0, i_off); @@ -505,7 +505,7 @@ std::complex<double> usrp1_impl::set_rx_dc_offset(const std::string &db, const s return std::complex<double>(double(i_off) * (1ul << 31), double(q_off) * (1ul << 31)); } -void usrp1_impl::set_reg(const std::pair<boost::uint8_t, boost::uint32_t> ®) +void usrp1_impl::set_reg(const std::pair<uint8_t, uint32_t> ®) { _iface->poke32(reg.first, reg.second); } diff --git a/host/lib/usrp/usrp1/usrp1_impl.hpp b/host/lib/usrp/usrp1/usrp1_impl.hpp index da901bd6c..18c5c8bd3 100644 --- a/host/lib/usrp/usrp1/usrp1_impl.hpp +++ b/host/lib/usrp/usrp1/usrp1_impl.hpp @@ -147,7 +147,7 @@ private: void vandal_conquest_loop(void); - void set_reg(const std::pair<boost::uint8_t, boost::uint32_t> ®); + void set_reg(const std::pair<uint8_t, uint32_t> ®); //handle the enables bool _rx_enabled, _tx_enabled; diff --git a/host/lib/usrp/usrp2/clock_ctrl.cpp b/host/lib/usrp/usrp2/clock_ctrl.cpp index ecb5a7101..c05453c40 100644 --- a/host/lib/usrp/usrp2/clock_ctrl.cpp +++ b/host/lib/usrp/usrp2/clock_ctrl.cpp @@ -21,7 +21,7 @@ #include "usrp2_clk_regs.hpp" #include <uhd/utils/safe_call.hpp> #include <uhd/utils/assert_has.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/lexical_cast.hpp> #include <boost/math/special_functions/round.hpp> #include <iostream> @@ -334,8 +334,8 @@ private: * Write a single register to the spi regs. * \param addr the address to write */ - void write_reg(boost::uint8_t addr){ - boost::uint32_t data = _ad9510_regs.get_write_reg(addr); + void write_reg(uint8_t addr){ + uint32_t data = _ad9510_regs.get_write_reg(addr); _spiface->write_spi(SPI_SS_AD9510, spi_config_t::EDGE_RISE, data, 24); } diff --git a/host/lib/usrp/usrp2/codec_ctrl.cpp b/host/lib/usrp/usrp2/codec_ctrl.cpp index a565078cf..a0e456708 100644 --- a/host/lib/usrp/usrp2/codec_ctrl.cpp +++ b/host/lib/usrp/usrp2/codec_ctrl.cpp @@ -22,7 +22,7 @@ #include <uhd/utils/log.hpp> #include <uhd/utils/safe_call.hpp> #include <uhd/exception.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/foreach.hpp> using namespace uhd; @@ -58,7 +58,7 @@ public: _ad9777_regs.qdac_offset_adjust_lsb = 0; _ad9777_regs.qdac_offset_adjust_msb = 0; //write all regs - for(boost::uint8_t addr = 0; addr <= 0xC; addr++){ + for(uint8_t addr = 0; addr <= 0xC; addr++){ this->send_ad9777_reg(addr); } set_tx_mod_mode(0); @@ -196,8 +196,8 @@ private: usrp2_iface::sptr _iface; uhd::spi_iface::sptr _spiface; - void send_ad9777_reg(boost::uint8_t addr){ - boost::uint16_t reg = _ad9777_regs.get_write_reg(addr); + void send_ad9777_reg(uint8_t addr){ + uint16_t reg = _ad9777_regs.get_write_reg(addr); UHD_LOGV(always) << "send_ad9777_reg: " << std::hex << reg << std::endl; _spiface->write_spi( SPI_SS_AD9777, spi_config_t::EDGE_RISE, @@ -205,8 +205,8 @@ private: ); } - void send_ads62p44_reg(boost::uint8_t addr) { - boost::uint16_t reg = _ads62p44_regs.get_write_reg(addr); + void send_ads62p44_reg(uint8_t addr) { + uint16_t reg = _ads62p44_regs.get_write_reg(addr); _spiface->write_spi( SPI_SS_ADS62P44, spi_config_t::EDGE_FALL, reg, 16 diff --git a/host/lib/usrp/usrp2/dboard_iface.cpp b/host/lib/usrp/usrp2/dboard_iface.cpp index a6ba1e0b7..9fde9a626 100644 --- a/host/lib/usrp/usrp2/dboard_iface.cpp +++ b/host/lib/usrp/usrp2/dboard_iface.cpp @@ -54,21 +54,21 @@ public: void write_aux_dac(unit_t, aux_dac_t, double); double read_aux_adc(unit_t, aux_adc_t); - void set_pin_ctrl(unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_pin_ctrl(unit_t unit); - void set_atr_reg(unit_t unit, atr_reg_t reg, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_atr_reg(unit_t unit, atr_reg_t reg); - void set_gpio_ddr(unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_gpio_ddr(unit_t unit); - void set_gpio_out(unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_gpio_out(unit_t unit); - boost::uint32_t read_gpio(unit_t unit); + void set_pin_ctrl(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_pin_ctrl(unit_t unit); + void set_atr_reg(unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_atr_reg(unit_t unit, atr_reg_t reg); + void set_gpio_ddr(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_gpio_ddr(unit_t unit); + void set_gpio_out(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_gpio_out(unit_t unit); + uint32_t read_gpio(unit_t unit); void set_command_time(const uhd::time_spec_t& t); uhd::time_spec_t get_command_time(void); - void write_i2c(boost::uint16_t, const byte_vector_t &); - byte_vector_t read_i2c(boost::uint16_t, size_t); + void write_i2c(uint16_t, const byte_vector_t &); + byte_vector_t read_i2c(uint16_t, size_t); void set_clock_rate(unit_t, double); double get_clock_rate(unit_t); @@ -80,14 +80,14 @@ public: void write_spi( unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ); - boost::uint32_t read_write_spi( + uint32_t read_write_spi( unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ); @@ -194,39 +194,39 @@ double usrp2_dboard_iface::get_codec_rate(unit_t unit){ /*********************************************************************** * GPIO **********************************************************************/ -void usrp2_dboard_iface::set_pin_ctrl(unit_t unit, boost::uint32_t value, boost::uint32_t mask){ - _gpio->set_pin_ctrl(unit, static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask)); +void usrp2_dboard_iface::set_pin_ctrl(unit_t unit, uint32_t value, uint32_t mask){ + _gpio->set_pin_ctrl(unit, static_cast<uint16_t>(value), static_cast<uint16_t>(mask)); } -boost::uint32_t usrp2_dboard_iface::get_pin_ctrl(unit_t unit){ - return static_cast<boost::uint32_t>(_gpio->get_pin_ctrl(unit)); +uint32_t usrp2_dboard_iface::get_pin_ctrl(unit_t unit){ + return static_cast<uint32_t>(_gpio->get_pin_ctrl(unit)); } -void usrp2_dboard_iface::set_atr_reg(unit_t unit, atr_reg_t reg, boost::uint32_t value, boost::uint32_t mask){ - _gpio->set_atr_reg(unit, reg, static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask)); +void usrp2_dboard_iface::set_atr_reg(unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask){ + _gpio->set_atr_reg(unit, reg, static_cast<uint16_t>(value), static_cast<uint16_t>(mask)); } -boost::uint32_t usrp2_dboard_iface::get_atr_reg(unit_t unit, atr_reg_t reg){ - return static_cast<boost::uint32_t>(_gpio->get_atr_reg(unit, reg)); +uint32_t usrp2_dboard_iface::get_atr_reg(unit_t unit, atr_reg_t reg){ + return static_cast<uint32_t>(_gpio->get_atr_reg(unit, reg)); } -void usrp2_dboard_iface::set_gpio_ddr(unit_t unit, boost::uint32_t value, boost::uint32_t mask){ - _gpio->set_gpio_ddr(unit, static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask)); +void usrp2_dboard_iface::set_gpio_ddr(unit_t unit, uint32_t value, uint32_t mask){ + _gpio->set_gpio_ddr(unit, static_cast<uint16_t>(value), static_cast<uint16_t>(mask)); } -boost::uint32_t usrp2_dboard_iface::get_gpio_ddr(unit_t unit){ - return static_cast<boost::uint32_t>(_gpio->get_gpio_ddr(unit)); +uint32_t usrp2_dboard_iface::get_gpio_ddr(unit_t unit){ + return static_cast<uint32_t>(_gpio->get_gpio_ddr(unit)); } -void usrp2_dboard_iface::set_gpio_out(unit_t unit, boost::uint32_t value, boost::uint32_t mask){ - _gpio->set_gpio_out(unit, static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask)); +void usrp2_dboard_iface::set_gpio_out(unit_t unit, uint32_t value, uint32_t mask){ + _gpio->set_gpio_out(unit, static_cast<uint16_t>(value), static_cast<uint16_t>(mask)); } -boost::uint32_t usrp2_dboard_iface::get_gpio_out(unit_t unit){ - return static_cast<boost::uint32_t>(_gpio->get_gpio_out(unit)); +uint32_t usrp2_dboard_iface::get_gpio_out(unit_t unit){ + return static_cast<uint32_t>(_gpio->get_gpio_out(unit)); } -boost::uint32_t usrp2_dboard_iface::read_gpio(unit_t unit){ +uint32_t usrp2_dboard_iface::read_gpio(unit_t unit){ return _gpio->read_gpio(unit); } @@ -241,17 +241,17 @@ static const uhd::dict<dboard_iface::unit_t, int> unit_to_spi_dev = map_list_of void usrp2_dboard_iface::write_spi( unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ){ if (unit == UNIT_BOTH) throw uhd::runtime_error("UNIT_BOTH not supported."); _spi_iface->write_spi(unit_to_spi_dev[unit], config, data, num_bits); } -boost::uint32_t usrp2_dboard_iface::read_write_spi( +uint32_t usrp2_dboard_iface::read_write_spi( unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ){ if (unit == UNIT_BOTH) throw uhd::runtime_error("UNIT_BOTH not supported."); @@ -261,11 +261,11 @@ boost::uint32_t usrp2_dboard_iface::read_write_spi( /*********************************************************************** * I2C **********************************************************************/ -void usrp2_dboard_iface::write_i2c(boost::uint16_t addr, const byte_vector_t &bytes){ +void usrp2_dboard_iface::write_i2c(uint16_t addr, const byte_vector_t &bytes){ return _i2c_iface->write_i2c(addr, bytes); } -byte_vector_t usrp2_dboard_iface::read_i2c(boost::uint16_t addr, size_t num_bytes){ +byte_vector_t usrp2_dboard_iface::read_i2c(uint16_t addr, size_t num_bytes){ return _i2c_iface->read_i2c(addr, num_bytes); } @@ -334,7 +334,7 @@ double usrp2_dboard_iface::read_aux_adc(unit_t unit, aux_adc_t which){ unit_to_spi_adc[unit], config, ad7922_regs.get_reg(), 16 ); - ad7922_regs.set_reg(boost::uint16_t(_spi_iface->read_spi( + ad7922_regs.set_reg(uint16_t(_spi_iface->read_spi( unit_to_spi_adc[unit], config, ad7922_regs.get_reg(), 16 ))); diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp index 81be97fa5..ae39028a1 100644 --- a/host/lib/usrp/usrp2/io_impl.cpp +++ b/host/lib/usrp/usrp2/io_impl.cpp @@ -66,7 +66,7 @@ static const size_t vrt_send_header_offset_words32 = 1; **********************************************************************/ class flow_control_monitor{ public: - typedef boost::uint32_t seq_type; + typedef uint32_t seq_type; typedef boost::shared_ptr<flow_control_monitor> sptr; /*! @@ -159,7 +159,7 @@ struct usrp2_impl::io_impl{ managed_send_buffer::sptr buff = tx_xports[chan]->get_send_buff(timeout); //write the flow control word into the buffer - if (buff.get()) buff->cast<boost::uint32_t *>()[0] = uhd::htonx(fc_mon.get_curr_seq_out()); + if (buff.get()) buff->cast<uint32_t *>()[0] = uhd::htonx(fc_mon.get_curr_seq_out()); return buff; } @@ -196,8 +196,8 @@ void usrp2_impl::io_impl::recv_pirate_loop( try{ //extract the vrt header packet info vrt::if_packet_info_t if_packet_info; - if_packet_info.num_packet_words32 = buff->size()/sizeof(boost::uint32_t); - const boost::uint32_t *vrt_hdr = buff->cast<const boost::uint32_t *>(); + if_packet_info.num_packet_words32 = buff->size()/sizeof(uint32_t); + const uint32_t *vrt_hdr = buff->cast<const uint32_t *>(); vrt::if_hdr_unpack_be(vrt_hdr, if_packet_info); //handle a tx async report message @@ -205,11 +205,11 @@ void usrp2_impl::io_impl::recv_pirate_loop( //fill in the async metadata async_metadata_t metadata; - load_metadata_from_buff(uhd::ntohx<boost::uint32_t>, metadata, if_packet_info, vrt_hdr, tick_rate, index); + load_metadata_from_buff(uhd::ntohx<uint32_t>, metadata, if_packet_info, vrt_hdr, tick_rate, index); //catch the flow control packets and react if (metadata.event_code == 0){ - boost::uint32_t fc_word32 = (vrt_hdr + if_packet_info.num_header_words32)[1]; + uint32_t fc_word32 = (vrt_hdr + if_packet_info.num_header_words32)[1]; fc_mon.update_fc_condition(uhd::ntohx(fc_word32)); continue; } @@ -374,8 +374,8 @@ void usrp2_impl::program_stream_dest( //program the stream command usrp2_stream_ctrl_t stream_ctrl = usrp2_stream_ctrl_t(); - stream_ctrl.sequence = uhd::htonx(boost::uint32_t(0 /* don't care seq num */)); - stream_ctrl.vrt_hdr = uhd::htonx(boost::uint32_t(USRP2_INVALID_VRT_HEADER)); + stream_ctrl.sequence = uhd::htonx(uint32_t(0 /* don't care seq num */)); + stream_ctrl.vrt_hdr = uhd::htonx(uint32_t(USRP2_INVALID_VRT_HEADER)); //user has provided an alternative address and port for destination if (args.args.has_key("addr") and args.args.has_key("port")){ @@ -388,8 +388,8 @@ void usrp2_impl::program_stream_dest( asio::ip::udp::resolver resolver(io_service); asio::ip::udp::resolver::query query(asio::ip::udp::v4(), args.args["addr"], args.args["port"]); asio::ip::udp::endpoint endpoint = *resolver.resolve(query); - stream_ctrl.ip_addr = uhd::htonx(boost::uint32_t(endpoint.address().to_v4().to_ulong())); - stream_ctrl.udp_port = uhd::htonx(boost::uint32_t(endpoint.port())); + stream_ctrl.ip_addr = uhd::htonx(uint32_t(endpoint.address().to_v4().to_ulong())); + stream_ctrl.udp_port = uhd::htonx(uint32_t(endpoint.port())); for (size_t i = 0; i < 3; i++){ UHD_MSG(status) << "ARP attempt " << i << std::endl; @@ -399,8 +399,8 @@ void usrp2_impl::program_stream_dest( send_buff.reset(); boost::this_thread::sleep(boost::posix_time::milliseconds(300)); managed_recv_buffer::sptr recv_buff = xport->get_recv_buff(0.0); - if (recv_buff and recv_buff->size() >= sizeof(boost::uint32_t)){ - const boost::uint32_t result = uhd::ntohx(recv_buff->cast<const boost::uint32_t *>()[0]); + if (recv_buff and recv_buff->size() >= sizeof(uint32_t)){ + const uint32_t result = uhd::ntohx(recv_buff->cast<const uint32_t *>()[0]); if (result == 0){ UHD_MSG(status) << "Success! " << std::endl; return; @@ -430,7 +430,7 @@ rx_streamer::sptr usrp2_impl::get_rx_stream(const uhd::stream_args_t &args_){ //calculate packet size static const size_t hdr_size = 0 - + vrt::max_if_hdr_words32*sizeof(boost::uint32_t) + + vrt::max_if_hdr_words32*sizeof(uint32_t) + sizeof(vrt::if_packet_info_t().tlr) //forced to have trailer - sizeof(vrt::if_packet_info_t().cid) //no class id ever used - sizeof(vrt::if_packet_info_t().tsi) //no int time ever used @@ -498,8 +498,8 @@ tx_streamer::sptr usrp2_impl::get_tx_stream(const uhd::stream_args_t &args_){ //calculate packet size static const size_t hdr_size = 0 - + vrt_send_header_offset_words32*sizeof(boost::uint32_t) - + vrt::max_if_hdr_words32*sizeof(boost::uint32_t) + + vrt_send_header_offset_words32*sizeof(uint32_t) + + vrt::max_if_hdr_words32*sizeof(uint32_t) + sizeof(vrt::if_packet_info_t().tlr) //forced to have trailer - sizeof(vrt::if_packet_info_t().cid) //no class id ever used - sizeof(vrt::if_packet_info_t().sid) //no stream id ever used diff --git a/host/lib/usrp/usrp2/n200_image_loader.cpp b/host/lib/usrp/usrp2/n200_image_loader.cpp index d6acfe39d..16cc7b08a 100644 --- a/host/lib/usrp/usrp2/n200_image_loader.cpp +++ b/host/lib/usrp/usrp2/n200_image_loader.cpp @@ -100,7 +100,7 @@ typedef enum { /* * Mapping revision numbers to names */ -static const uhd::dict<boost::uint32_t, std::string> n200_filename_map = boost::assign::map_list_of +static const uhd::dict<uint32_t, std::string> n200_filename_map = boost::assign::map_list_of (0, "n2xx") // Is an N-Series, but the EEPROM value is invalid (0xa, "n200_r3") (0x100a, "n200_r4") @@ -112,20 +112,20 @@ static const uhd::dict<boost::uint32_t, std::string> n200_filename_map = boost:: * Packet structure */ typedef struct { - boost::uint32_t proto_ver; - boost::uint32_t id; - boost::uint32_t seq; + uint32_t proto_ver; + uint32_t id; + uint32_t seq; union { - boost::uint32_t ip_addr; - boost::uint32_t hw_rev; + uint32_t ip_addr; + uint32_t hw_rev; struct { - boost::uint32_t flash_addr; - boost::uint32_t length; - boost::uint8_t data[256]; + uint32_t flash_addr; + uint32_t length; + uint8_t data[256]; } flash_args; struct { - boost::uint32_t sector_size_bytes; - boost::uint32_t memory_size_bytes; + uint32_t sector_size_bytes; + uint32_t memory_size_bytes; } flash_info_args; } data; } n200_fw_update_data_t; @@ -140,10 +140,10 @@ typedef struct { uhd::device_addr_t dev_addr; std::string burn_type; std::string filepath; - boost::uint8_t data_in[udp_simple::mtu]; - boost::uint32_t size; - boost::uint32_t max_size; - boost::uint32_t flash_addr; + uint8_t data_in[udp_simple::mtu]; + uint32_t size; + uint32_t max_size; + uint32_t flash_addr; udp_simple::sptr xport; } n200_session_t; @@ -190,9 +190,9 @@ static void print_usrp2_error(const image_loader::image_loader_args_t &image_loa static UHD_INLINE size_t n200_send_and_recv(udp_simple::sptr xport, n200_fw_update_id_t pkt_code, n200_fw_update_data_t *pkt_out, - boost::uint8_t* data){ - pkt_out->proto_ver = htonx<boost::uint32_t>(USRP2_FW_COMPAT_NUM); - pkt_out->id = htonx<boost::uint32_t>(pkt_code); + uint8_t* data){ + pkt_out->proto_ver = htonx<uint32_t>(USRP2_FW_COMPAT_NUM); + pkt_out->id = htonx<uint32_t>(pkt_code); xport->send(boost::asio::buffer(pkt_out, sizeof(*pkt_out))); return xport->recv(boost::asio::buffer(data, udp_simple::mtu), UDP_TIMEOUT); } @@ -215,7 +215,7 @@ static uhd::device_addr_t n200_find(const image_loader::image_loader_args_t &ima uhd::device_addrs_t n200_found; udp_simple::sptr rev_xport; n200_fw_update_data_t pkt_out; - boost::uint8_t data_in[udp_simple::mtu]; + uint8_t data_in[udp_simple::mtu]; const n200_fw_update_data_t *pkt_in = reinterpret_cast<const n200_fw_update_data_t*>(data_in); size_t len = 0; @@ -233,7 +233,7 @@ static uhd::device_addr_t n200_find(const image_loader::image_loader_args_t &ima len = n200_send_and_recv(rev_xport, GET_HW_REV_CMD, &pkt_out, data_in); if(n200_response_matches(pkt_in, GET_HW_REV_ACK, len)){ - boost::uint32_t rev = ntohl(pkt_in->data.hw_rev); + uint32_t rev = ntohl(pkt_in->data.hw_rev); std::string hw_rev = n200_filename_map.get(rev, "n2xx"); n200_found.push_back(dev); @@ -291,7 +291,7 @@ static void n200_validate_firmware_image(n200_session_t &session){ // File must have proper header std::ifstream image_file(session.filepath.c_str(), std::ios::binary); - boost::uint8_t test_bytes[4]; + uint8_t test_bytes[4]; image_file.seekg(0, std::ios::beg); image_file.read((char*)test_bytes,4); image_file.close(); @@ -320,7 +320,7 @@ static void n200_validate_fpga_image(n200_session_t &session){ // File must have proper header std::ifstream image_file(session.filepath.c_str(), std::ios::binary); - boost::uint8_t test_bytes[63]; + uint8_t test_bytes[63]; image_file.seekg(0, std::ios::beg); image_file.read((char*)test_bytes, 63); bool is_good = false; @@ -402,8 +402,8 @@ static void n200_erase_image(n200_session_t &session){ const n200_fw_update_data_t *pkt_in = reinterpret_cast<const n200_fw_update_data_t*>(session.data_in); // Setting up UDP packet - pkt_out.data.flash_args.flash_addr = htonx<boost::uint32_t>(session.flash_addr); - pkt_out.data.flash_args.length = htonx<boost::uint32_t>(session.size); + pkt_out.data.flash_args.flash_addr = htonx<uint32_t>(session.flash_addr); + pkt_out.data.flash_args.length = htonx<uint32_t>(session.size); // Begin erasing size_t len = n200_send_and_recv(session.xport, ERASE_FLASH_CMD, &pkt_out, session.data_in); @@ -452,10 +452,10 @@ static void n200_write_image(n200_session_t &session){ // Write image std::ifstream image(session.filepath.c_str(), std::ios::binary); - boost::uint32_t current_addr = session.flash_addr; - pkt_out.data.flash_args.length = htonx<boost::uint32_t>(N200_FLASH_DATA_PACKET_SIZE); + uint32_t current_addr = session.flash_addr; + pkt_out.data.flash_args.length = htonx<uint32_t>(N200_FLASH_DATA_PACKET_SIZE); for(size_t i = 0; i < ((session.size/N200_FLASH_DATA_PACKET_SIZE)+1); i++){ - pkt_out.data.flash_args.flash_addr = htonx<boost::uint32_t>(current_addr); + pkt_out.data.flash_args.flash_addr = htonx<uint32_t>(current_addr); memset(pkt_out.data.flash_args.data, 0x0, N200_FLASH_DATA_PACKET_SIZE); image.read((char*)pkt_out.data.flash_args.data, N200_FLASH_DATA_PACKET_SIZE); @@ -502,15 +502,15 @@ static void n200_verify_image(n200_session_t &session){ // Read and verify image std::ifstream image(session.filepath.c_str(), std::ios::binary); - boost::uint8_t image_part[N200_FLASH_DATA_PACKET_SIZE]; - boost::uint32_t current_addr = session.flash_addr; - pkt_out.data.flash_args.length = htonx<boost::uint32_t>(N200_FLASH_DATA_PACKET_SIZE); - boost::uint16_t cmp_len = 0; + uint8_t image_part[N200_FLASH_DATA_PACKET_SIZE]; + uint32_t current_addr = session.flash_addr; + pkt_out.data.flash_args.length = htonx<uint32_t>(N200_FLASH_DATA_PACKET_SIZE); + uint16_t cmp_len = 0; for(size_t i = 0; i < ((session.size/N200_FLASH_DATA_PACKET_SIZE)+1); i++){ memset(image_part, 0x0, N200_FLASH_DATA_PACKET_SIZE); memset((void*)pkt_in->data.flash_args.data, 0x0, N200_FLASH_DATA_PACKET_SIZE); - pkt_out.data.flash_args.flash_addr = htonx<boost::uint32_t>(current_addr); + pkt_out.data.flash_args.flash_addr = htonx<uint32_t>(current_addr); image.read((char*)image_part, N200_FLASH_DATA_PACKET_SIZE); cmp_len = image.gcount(); diff --git a/host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp b/host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp index e0544862d..9cd3afc6c 100644 --- a/host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp +++ b/host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp @@ -33,7 +33,7 @@ static const size_t POKE32_CMD = (1 << 8); static const size_t PEEK32_CMD = 0; static const double ACK_TIMEOUT = 0.5; static const double MASSIVE_TIMEOUT = 10.0; //for when we wait on a timed command -static const boost::uint32_t MAX_SEQS_OUT = 63; +static const uint32_t MAX_SEQS_OUT = 63; #define SPI_DIV SR_SPI_CORE + 0 #define SPI_CTRL SR_SPI_CORE + 1 @@ -67,7 +67,7 @@ public: /******************************************************************* * Peek and poke 32 bit implementation ******************************************************************/ - void poke32(const wb_addr_type addr, const boost::uint32_t data){ + void poke32(const wb_addr_type addr, const uint32_t data){ boost::mutex::scoped_lock lock(_mutex); this->send_pkt((addr - SETTING_REGS_BASE)/4, data, POKE32_CMD); @@ -75,7 +75,7 @@ public: this->wait_for_ack(_seq_out-MAX_SEQS_OUT); } - boost::uint32_t peek32(const wb_addr_type addr){ + uint32_t peek32(const wb_addr_type addr){ boost::mutex::scoped_lock lock(_mutex); this->send_pkt((addr - READBACK_BASE)/4, 0, PEEK32_CMD); @@ -86,11 +86,11 @@ public: /******************************************************************* * Peek and poke 16 bit not implemented ******************************************************************/ - void poke16(const wb_addr_type, const boost::uint16_t){ + void poke16(const wb_addr_type, const uint16_t){ throw uhd::not_implemented_error("poke16 not implemented in fifo ctrl module"); } - boost::uint16_t peek16(const wb_addr_type){ + uint16_t peek16(const wb_addr_type){ throw uhd::not_implemented_error("peek16 not implemented in fifo ctrl module"); } @@ -106,24 +106,24 @@ public: _ctrl_word_cache = 0; // force update first time around } - boost::uint32_t transact_spi( + uint32_t transact_spi( int which_slave, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits, bool readback ){ boost::mutex::scoped_lock lock(_mutex); //load control word - boost::uint32_t ctrl_word = 0; + uint32_t ctrl_word = 0; ctrl_word |= ((which_slave & 0xffffff) << 0); ctrl_word |= ((num_bits & 0x3ff) << 24); if (config.mosi_edge == spi_config_t::EDGE_FALL) ctrl_word |= (1 << 31); if (config.miso_edge == spi_config_t::EDGE_RISE) ctrl_word |= (1 << 30); //load data word (must be in upper bits) - const boost::uint32_t data_out = data << (32 - num_bits); + const uint32_t data_out = data << (32 - num_bits); //conditionally send control word if (_ctrl_word_cache != ctrl_word){ @@ -171,20 +171,20 @@ private: /******************************************************************* * Primary control and interaction private methods ******************************************************************/ - UHD_INLINE void send_pkt(wb_addr_type addr, boost::uint32_t data, int cmd){ + UHD_INLINE void send_pkt(wb_addr_type addr, uint32_t data, int cmd){ managed_send_buffer::sptr buff = _xport->get_send_buff(0.0); if (not buff){ throw uhd::runtime_error("fifo ctrl timed out getting a send buffer"); } - boost::uint32_t *trans = buff->cast<boost::uint32_t *>(); + uint32_t *trans = buff->cast<uint32_t *>(); trans[0] = htonl(++_seq_out); - boost::uint32_t *pkt = trans + 1; + uint32_t *pkt = trans + 1; //load packet info vrt::if_packet_info_t packet_info; packet_info.packet_type = vrt::if_packet_info_t::PACKET_TYPE_CONTEXT; packet_info.num_payload_words32 = 2; - packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(boost::uint32_t); + packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(uint32_t); packet_info.packet_count = _seq_out; packet_info.tsf = _time.to_ticks(_tick_rate); packet_info.sob = false; @@ -199,30 +199,30 @@ private: vrt::if_hdr_pack_be(pkt, packet_info); //load payload - const boost::uint32_t ctrl_word = (addr & 0xff) | cmd | (_seq_out << 16); + const uint32_t ctrl_word = (addr & 0xff) | cmd | (_seq_out << 16); pkt[packet_info.num_header_words32+0] = htonl(ctrl_word); pkt[packet_info.num_header_words32+1] = htonl(data); //send the buffer over the interface - buff->commit(sizeof(boost::uint32_t)*(packet_info.num_packet_words32+1)); + buff->commit(sizeof(uint32_t)*(packet_info.num_packet_words32+1)); } - UHD_INLINE bool wraparound_lt16(const boost::int16_t i0, const boost::int16_t i1){ + UHD_INLINE bool wraparound_lt16(const int16_t i0, const int16_t i1){ if (((i0 ^ i1) & 0x8000) == 0) //same sign bits - return boost::uint16_t(i0) < boost::uint16_t(i1); - return boost::int16_t(i1 - i0) > 0; + return uint16_t(i0) < uint16_t(i1); + return int16_t(i1 - i0) > 0; } - UHD_INLINE boost::uint32_t wait_for_ack(const boost::uint16_t seq_to_ack){ + UHD_INLINE uint32_t wait_for_ack(const uint16_t seq_to_ack){ while (wraparound_lt16(_seq_ack, seq_to_ack)){ managed_recv_buffer::sptr buff = _xport->get_recv_buff(_timeout); if (not buff){ throw uhd::runtime_error("fifo ctrl timed out looking for acks"); } - const boost::uint32_t *pkt = buff->cast<const boost::uint32_t *>(); + const uint32_t *pkt = buff->cast<const uint32_t *>(); vrt::if_packet_info_t packet_info; - packet_info.num_packet_words32 = buff->size()/sizeof(boost::uint32_t); + packet_info.num_packet_words32 = buff->size()/sizeof(uint32_t); vrt::if_hdr_unpack_be(pkt, packet_info); _seq_ack = ntohl(pkt[packet_info.num_header_words32+0]) >> 16; if (_seq_ack == seq_to_ack){ @@ -235,13 +235,13 @@ private: zero_copy_if::sptr _xport; boost::mutex _mutex; - boost::uint16_t _seq_out; - boost::uint16_t _seq_ack; + uint16_t _seq_out; + uint16_t _seq_ack; uhd::time_spec_t _time; bool _use_time; double _tick_rate; double _timeout; - boost::uint32_t _ctrl_word_cache; + uint32_t _ctrl_word_cache; }; diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp index 2b382ae38..522d6c6d0 100644 --- a/host/lib/usrp/usrp2/usrp2_iface.cpp +++ b/host/lib/usrp/usrp2/usrp2_iface.cpp @@ -57,12 +57,12 @@ struct timeout_error : uhd::runtime_error } }; -static const boost::uint32_t MIN_PROTO_COMPAT_SPI = 7; -static const boost::uint32_t MIN_PROTO_COMPAT_I2C = 7; +static const uint32_t MIN_PROTO_COMPAT_SPI = 7; +static const uint32_t MIN_PROTO_COMPAT_I2C = 7; // The register compat number must reflect the protocol compatibility // and the compatibility of the register mapping (more likely to change). -static const boost::uint32_t MIN_PROTO_COMPAT_REG = 10; -static const boost::uint32_t MIN_PROTO_COMPAT_UART = 7; +static const uint32_t MIN_PROTO_COMPAT_REG = 10; +static const uint32_t MIN_PROTO_COMPAT_UART = 7; class usrp2_iface_impl : public usrp2_iface{ public: @@ -110,15 +110,15 @@ public: //never assume lock with fpga image mismatch if ((this->peek32(U2_REG_COMPAT_NUM_RB) >> 16) != USRP2_FPGA_COMPAT_NUM) return false; - boost::uint32_t lock_time = this->peekfw(U2_FW_REG_LOCK_TIME); - boost::uint32_t lock_gpid = this->peekfw(U2_FW_REG_LOCK_GPID); + uint32_t lock_time = this->peekfw(U2_FW_REG_LOCK_TIME); + uint32_t lock_gpid = this->peekfw(U2_FW_REG_LOCK_GPID); //may not be the right tick rate, but this is ok for locking purposes - const boost::uint32_t lock_timeout_time = boost::uint32_t(3*100e6); + const uint32_t lock_timeout_time = uint32_t(3*100e6); //if the difference is larger, assume not locked anymore if ((lock_time & 1) == 0) return false; //bit0 says unlocked - const boost::uint32_t time_diff = this->get_curr_time() - lock_time; + const uint32_t time_diff = this->get_curr_time() - lock_time; if (time_diff >= lock_timeout_time) return false; //otherwise only lock if the device hash is different that ours @@ -132,37 +132,37 @@ public: boost::this_thread::sleep(boost::posix_time::milliseconds(1500)); } - boost::uint32_t get_curr_time(void){ + uint32_t get_curr_time(void){ return this->peek32(U2_REG_TIME64_LO_RB_IMM) | 1; //bit 1 says locked } /*********************************************************************** * Peek and Poke **********************************************************************/ - void poke32(const wb_addr_type addr, const boost::uint32_t data){ - this->get_reg<boost::uint32_t, USRP2_REG_ACTION_FPGA_POKE32>(addr, data); + void poke32(const wb_addr_type addr, const uint32_t data){ + this->get_reg<uint32_t, USRP2_REG_ACTION_FPGA_POKE32>(addr, data); } - boost::uint32_t peek32(const wb_addr_type addr){ - return this->get_reg<boost::uint32_t, USRP2_REG_ACTION_FPGA_PEEK32>(addr); + uint32_t peek32(const wb_addr_type addr){ + return this->get_reg<uint32_t, USRP2_REG_ACTION_FPGA_PEEK32>(addr); } - void poke16(const wb_addr_type addr, const boost::uint16_t data){ - this->get_reg<boost::uint16_t, USRP2_REG_ACTION_FPGA_POKE16>(addr, data); + void poke16(const wb_addr_type addr, const uint16_t data){ + this->get_reg<uint16_t, USRP2_REG_ACTION_FPGA_POKE16>(addr, data); } - boost::uint16_t peek16(const wb_addr_type addr){ - return this->get_reg<boost::uint16_t, USRP2_REG_ACTION_FPGA_PEEK16>(addr); + uint16_t peek16(const wb_addr_type addr){ + return this->get_reg<uint16_t, USRP2_REG_ACTION_FPGA_PEEK16>(addr); } - void pokefw(wb_addr_type addr, boost::uint32_t data) + void pokefw(wb_addr_type addr, uint32_t data) { - this->get_reg<boost::uint32_t, USRP2_REG_ACTION_FW_POKE32>(addr, data); + this->get_reg<uint32_t, USRP2_REG_ACTION_FW_POKE32>(addr, data); } - boost::uint32_t peekfw(wb_addr_type addr) + uint32_t peekfw(wb_addr_type addr) { - return this->get_reg<boost::uint32_t, USRP2_REG_ACTION_FW_PEEK32>(addr); + return this->get_reg<uint32_t, USRP2_REG_ACTION_FW_PEEK32>(addr); } template <class T, usrp2_reg_action_t action> @@ -171,7 +171,7 @@ public: usrp2_ctrl_data_t out_data = usrp2_ctrl_data_t(); out_data.id = htonl(USRP2_CTRL_ID_GET_THIS_REGISTER_FOR_ME_BRO); out_data.data.reg_args.addr = htonl(addr); - out_data.data.reg_args.data = htonl(boost::uint32_t(data)); + out_data.data.reg_args.data = htonl(uint32_t(data)); out_data.data.reg_args.action = action; //send and recv @@ -183,10 +183,10 @@ public: /*********************************************************************** * SPI **********************************************************************/ - boost::uint32_t transact_spi( + uint32_t transact_spi( int which_slave, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits, bool readback ){ @@ -215,7 +215,7 @@ public: /*********************************************************************** * I2C **********************************************************************/ - void write_i2c(boost::uint16_t addr, const byte_vector_t &buf){ + void write_i2c(uint16_t addr, const byte_vector_t &buf){ //setup the out data usrp2_ctrl_data_t out_data = usrp2_ctrl_data_t(); out_data.id = htonl(USRP2_CTRL_ID_WRITE_THESE_I2C_VALUES_BRO); @@ -233,7 +233,7 @@ public: UHD_ASSERT_THROW(ntohl(in_data.id) == USRP2_CTRL_ID_COOL_IM_DONE_I2C_WRITE_DUDE); } - byte_vector_t read_i2c(boost::uint16_t addr, size_t num_bytes){ + byte_vector_t read_i2c(uint16_t addr, size_t num_bytes){ //setup the out data usrp2_ctrl_data_t out_data = usrp2_ctrl_data_t(); out_data.id = htonl(USRP2_CTRL_ID_DO_AN_I2C_READ_FOR_ME_BRO); @@ -259,8 +259,8 @@ public: **********************************************************************/ usrp2_ctrl_data_t ctrl_send_and_recv( const usrp2_ctrl_data_t &out_data, - boost::uint32_t lo = USRP2_FW_COMPAT_NUM, - boost::uint32_t hi = USRP2_FW_COMPAT_NUM + uint32_t lo = USRP2_FW_COMPAT_NUM, + uint32_t hi = USRP2_FW_COMPAT_NUM ){ boost::mutex::scoped_lock lock(_ctrl_mutex); @@ -280,7 +280,7 @@ public: usrp2_ctrl_data_t ctrl_send_and_recv_internal( const usrp2_ctrl_data_t &out_data, - boost::uint32_t lo, boost::uint32_t hi, + uint32_t lo, uint32_t hi, const double timeout ){ //fill in the seq number and send @@ -290,12 +290,12 @@ public: _ctrl_transport->send(boost::asio::buffer(&out_copy, sizeof(usrp2_ctrl_data_t))); //loop until we get the packet or timeout - boost::uint8_t usrp2_ctrl_data_in_mem[udp_simple::mtu]; //allocate max bytes for recv + uint8_t usrp2_ctrl_data_in_mem[udp_simple::mtu]; //allocate max bytes for recv const usrp2_ctrl_data_t *ctrl_data_in = reinterpret_cast<const usrp2_ctrl_data_t *>(usrp2_ctrl_data_in_mem); while(true){ size_t len = _ctrl_transport->recv(boost::asio::buffer(usrp2_ctrl_data_in_mem), timeout); - boost::uint32_t compat = ntohl(ctrl_data_in->proto_ver); - if(len >= sizeof(boost::uint32_t) and (hi < compat or lo > compat)){ + uint32_t compat = ntohl(ctrl_data_in->proto_ver); + if(len >= sizeof(uint32_t) and (hi < compat or lo > compat)){ throw uhd::runtime_error(str(boost::format( "\nPlease update the firmware and FPGA images for your device.\n" "See the application notes for USRP2/N-Series for instructions.\n" @@ -317,7 +317,7 @@ public: rev_type get_rev(void){ std::string hw = mb_eeprom["hardware"]; if (hw.empty()) return USRP_NXXX; - switch (boost::lexical_cast<boost::uint16_t>(hw)){ + switch (boost::lexical_cast<uint16_t>(hw)){ case 0x0300: case 0x0301: return USRP2_REV3; case 0x0400: return USRP2_REV4; @@ -343,7 +343,7 @@ public: } const std::string get_fw_version_string(void){ - boost::uint32_t minor = this->get_reg<boost::uint32_t, USRP2_REG_ACTION_FW_PEEK32>(U2_FW_REG_VER_MINOR); + uint32_t minor = this->get_reg<uint32_t, USRP2_REG_ACTION_FW_PEEK32>(U2_FW_REG_VER_MINOR); return str(boost::format("%u.%u") % _protocol_compat % minor); } @@ -415,8 +415,8 @@ private: //used in send/recv boost::mutex _ctrl_mutex; - boost::uint32_t _ctrl_seq_num; - boost::uint32_t _protocol_compat; + uint32_t _ctrl_seq_num; + uint32_t _protocol_compat; //lock thread stuff task::sptr _lock_task; diff --git a/host/lib/usrp/usrp2/usrp2_iface.hpp b/host/lib/usrp/usrp2/usrp2_iface.hpp index 833016b7c..9d7642bc1 100644 --- a/host/lib/usrp/usrp2/usrp2_iface.hpp +++ b/host/lib/usrp/usrp2/usrp2_iface.hpp @@ -45,10 +45,10 @@ public: static sptr make(uhd::transport::udp_simple::sptr ctrl_transport); //! poke a register in the virtual fw table - virtual void pokefw(wb_addr_type addr, boost::uint32_t data) = 0; + virtual void pokefw(wb_addr_type addr, uint32_t data) = 0; //! peek a register in the virtual fw table - virtual boost::uint32_t peekfw(wb_addr_type addr) = 0; + virtual uint32_t peekfw(wb_addr_type addr) = 0; //! The list of possible revision types enum rev_type { diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp index b0c29392c..ee2434fab 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp/usrp2/usrp2_impl.cpp @@ -112,8 +112,8 @@ device_addrs_t usrp2_find(const device_addr_t &hint_){ //send a hello control packet usrp2_ctrl_data_t ctrl_data_out = usrp2_ctrl_data_t(); - ctrl_data_out.proto_ver = uhd::htonx<boost::uint32_t>(USRP2_FW_COMPAT_NUM); - ctrl_data_out.id = uhd::htonx<boost::uint32_t>(USRP2_CTRL_ID_WAZZUP_BRO); + ctrl_data_out.proto_ver = uhd::htonx<uint32_t>(USRP2_FW_COMPAT_NUM); + ctrl_data_out.id = uhd::htonx<uint32_t>(USRP2_CTRL_ID_WAZZUP_BRO); try { udp_transport->send(boost::asio::buffer(&ctrl_data_out, sizeof(ctrl_data_out))); @@ -128,7 +128,7 @@ device_addrs_t usrp2_find(const device_addr_t &hint_){ } //loop and recieve until the timeout - boost::uint8_t usrp2_ctrl_data_in_mem[udp_simple::mtu]; //allocate max bytes for recv + uint8_t usrp2_ctrl_data_in_mem[udp_simple::mtu]; //allocate max bytes for recv const usrp2_ctrl_data_t *ctrl_data_in = reinterpret_cast<const usrp2_ctrl_data_t *>(usrp2_ctrl_data_in_mem); while(true){ size_t len = udp_transport->recv(asio::buffer(usrp2_ctrl_data_in_mem)); @@ -218,7 +218,7 @@ static mtu_result_t determine_mtu(const std::string &addr, const mtu_result_t &u //The FPGA offers 4K buffers, and the user may manually request this. //However, multiple simultaneous receives (2DSP slave + 2DSP master), //require that buffering to be used internally, and this is a safe setting. - std::vector<boost::uint8_t> buffer(std::max(user_mtu.recv_mtu, user_mtu.send_mtu)); + std::vector<uint8_t> buffer(std::max(user_mtu.recv_mtu, user_mtu.send_mtu)); usrp2_ctrl_data_t *ctrl_data = reinterpret_cast<usrp2_ctrl_data_t *>(&buffer.front()); static const double echo_timeout = 0.020; //20 ms @@ -302,9 +302,9 @@ static zero_copy_if::sptr make_xport( //Send a small data packet so the usrp2 knows the udp source port. //This setup must happen before further initialization occurs //or the async update packets will cause ICMP destination unreachable. - static const boost::uint32_t data[2] = { - uhd::htonx(boost::uint32_t(0 /* don't care seq num */)), - uhd::htonx(boost::uint32_t(USRP2_INVALID_VRT_HEADER)) + static const uint32_t data[2] = { + uhd::htonx(uint32_t(0 /* don't care seq num */)), + uhd::htonx(uint32_t(USRP2_INVALID_VRT_HEADER)) }; transport::managed_send_buffer::sptr send_buff = xport->get_send_buff(); std::memcpy(send_buff->cast<void*>(), &data, sizeof(data)); @@ -389,8 +389,8 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) : _tree->create<std::string>(mb_path / "fw_version").set(_mbc[mb].iface->get_fw_version_string()); //check the fpga compatibility number - const boost::uint32_t fpga_compat_num = _mbc[mb].iface->peek32(U2_REG_COMPAT_NUM_RB); - boost::uint16_t fpga_major = fpga_compat_num >> 16, fpga_minor = fpga_compat_num & 0xffff; + const uint32_t fpga_compat_num = _mbc[mb].iface->peek32(U2_REG_COMPAT_NUM_RB); + uint16_t fpga_major = fpga_compat_num >> 16, fpga_minor = fpga_compat_num & 0xffff; if (fpga_major == 0){ //old version scheme fpga_major = fpga_minor; fpga_minor = 0; @@ -520,7 +520,7 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) : //////////////////////////////////////////////////////////////////// // Create the GPSDO control //////////////////////////////////////////////////////////////////// - static const boost::uint32_t dont_look_for_gpsdo = 0x1234abcdul; + static const uint32_t dont_look_for_gpsdo = 0x1234abcdul; //disable check for internal GPSDO when not the following: switch(_mbc[mb].iface->get_rev()){ diff --git a/host/lib/usrp/usrp2/usrp2_impl.hpp b/host/lib/usrp/usrp2/usrp2_impl.hpp index 47fcec657..790daa749 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.hpp +++ b/host/lib/usrp/usrp2/usrp2_impl.hpp @@ -52,8 +52,8 @@ static const double mimo_clock_delay_usrp2_rev4 = 4.18e-9; static const double mimo_clock_delay_usrp_n2xx = 4.10e-9; static const size_t mimo_clock_sync_delay_cycles = 138; static const size_t USRP2_SRAM_BYTES = size_t(1 << 20); -static const boost::uint32_t USRP2_TX_ASYNC_SID = 2; -static const boost::uint32_t USRP2_RX_SID_BASE = 3; +static const uint32_t USRP2_TX_ASYNC_SID = 2; +static const uint32_t USRP2_RX_SID_BASE = 3; static const std::string USRP2_EEPROM_MAP_KEY = "N100"; uhd::device_addrs_t usrp2_find(const uhd::device_addr_t &hint_); diff --git a/host/lib/usrp/x300/x300_adc_ctrl.cpp b/host/lib/usrp/x300/x300_adc_ctrl.cpp index ce6102b35..fed2ffaf7 100644 --- a/host/lib/usrp/x300/x300_adc_ctrl.cpp +++ b/host/lib/usrp/x300/x300_adc_ctrl.cpp @@ -97,7 +97,7 @@ public: return gain_bits/2; } - void set_test_word(const std::string &patterna, const std::string &patternb, const boost::uint32_t num) + void set_test_word(const std::string &patterna, const std::string &patternb, const uint32_t num) { _ads62p48_regs.custom_pattern_low = num & 0xff; _ads62p48_regs.custom_pattern_high = num >> 8; @@ -131,9 +131,9 @@ private: uhd::spi_iface::sptr _iface; const size_t _slaveno; - void send_ads62p48_reg(boost::uint8_t addr) + void send_ads62p48_reg(uint8_t addr) { - boost::uint16_t reg = _ads62p48_regs.get_write_reg(addr); + uint16_t reg = _ads62p48_regs.get_write_reg(addr); _iface->write_spi(_slaveno, spi_config_t::EDGE_FALL, reg, 16); } }; diff --git a/host/lib/usrp/x300/x300_adc_ctrl.hpp b/host/lib/usrp/x300/x300_adc_ctrl.hpp index 90fb88cec..bda93628e 100644 --- a/host/lib/usrp/x300/x300_adc_ctrl.hpp +++ b/host/lib/usrp/x300/x300_adc_ctrl.hpp @@ -39,7 +39,7 @@ public: virtual double set_gain(const double &) = 0; - virtual void set_test_word(const std::string &patterna, const std::string &patternb, const boost::uint32_t = 0) = 0; + virtual void set_test_word(const std::string &patterna, const std::string &patternb, const uint32_t = 0) = 0; virtual void reset(void) = 0; }; diff --git a/host/lib/usrp/x300/x300_adc_dac_utils.cpp b/host/lib/usrp/x300/x300_adc_dac_utils.cpp index cd337febb..6fd0ca50b 100644 --- a/host/lib/usrp/x300/x300_adc_dac_utils.cpp +++ b/host/lib/usrp/x300/x300_adc_dac_utils.cpp @@ -47,7 +47,7 @@ void x300_impl::synchronize_dacs(const std::vector<radio_perifs_t*>& radios) boost::posix_time::microsec_clock::local_time() - t_start; //Add 100% of headroom + uncertaintly to the command time - boost::uint64_t t_sync_us = (t_elapsed.total_microseconds() * 2) + 13000 /*Scheduler latency*/; + uint64_t t_sync_us = (t_elapsed.total_microseconds() * 2) + 13000 /*Scheduler latency*/; //Pick radios[0] as the time reference. uhd::time_spec_t sync_time = @@ -71,9 +71,9 @@ void x300_impl::synchronize_dacs(const std::vector<radio_perifs_t*>& radios) * ADC: Self-test operations **********************************************************************/ -static void check_adc(uhd::wb_iface::sptr iface, const boost::uint32_t val, const boost::uint32_t i) +static void check_adc(uhd::wb_iface::sptr iface, const uint32_t val, const uint32_t i) { - boost::uint32_t adc_rb = iface->peek32(uhd::usrp::radio::RB32_RX); + uint32_t adc_rb = iface->peek32(uhd::usrp::radio::RB32_RX); adc_rb ^= 0xfffc0000; //adapt for I inversion in FPGA if (val != adc_rb) { throw uhd::runtime_error( @@ -81,7 +81,7 @@ static void check_adc(uhd::wb_iface::sptr iface, const boost::uint32_t val, cons } } -void x300_impl::self_test_adcs(mboard_members_t& mb, boost::uint32_t ramp_time_ms) { +void x300_impl::self_test_adcs(mboard_members_t& mb, uint32_t ramp_time_ms) { for (size_t r = 0; r < mboard_members_t::NUM_RADIOS; r++) { radio_perifs_t &perif = mb.radio_perifs[r]; @@ -186,20 +186,20 @@ void x300_impl::self_cal_adc_capture_delay(mboard_members_t& mb, const size_t ra radio_perifs_t& perif = mb.radio_perifs[radio_i]; if (print_status) UHD_MSG(status) << "Running ADC capture delay self-cal..." << std::flush; - static const boost::uint32_t NUM_DELAY_STEPS = 32; //The IDELAYE2 element has 32 steps - static const boost::uint32_t NUM_RETRIES = 2; //Retry self-cal if it fails in warmup situations - static const boost::int32_t MIN_WINDOW_LEN = 4; + static const uint32_t NUM_DELAY_STEPS = 32; //The IDELAYE2 element has 32 steps + static const uint32_t NUM_RETRIES = 2; //Retry self-cal if it fails in warmup situations + static const int32_t MIN_WINDOW_LEN = 4; - boost::int32_t win_start = -1, win_stop = -1; - boost::uint32_t iter = 0; + int32_t win_start = -1, win_stop = -1; + uint32_t iter = 0; while (iter++ < NUM_RETRIES) { - for (boost::uint32_t dly_tap = 0; dly_tap < NUM_DELAY_STEPS; dly_tap++) { + for (uint32_t dly_tap = 0; dly_tap < NUM_DELAY_STEPS; dly_tap++) { //Apply delay perif.regmap->misc_outs_reg.write(radio_regmap_t::misc_outs_reg_t::ADC_DATA_DLY_VAL, dly_tap); perif.regmap->misc_outs_reg.write(radio_regmap_t::misc_outs_reg_t::ADC_DATA_DLY_STB, 1); perif.regmap->misc_outs_reg.write(radio_regmap_t::misc_outs_reg_t::ADC_DATA_DLY_STB, 0); - boost::uint32_t err_code = 0; + uint32_t err_code = 0; // -- Test I Channel -- //Put ADC in ramp test mode. Tie the other channel to all ones. @@ -270,7 +270,7 @@ void x300_impl::self_cal_adc_capture_delay(mboard_members_t& mb, const size_t ra throw uhd::runtime_error("self_cal_adc_capture_delay: Self calibration failed. Valid window too narrow."); } - boost::uint32_t ideal_tap = (win_stop + win_start) / 2; + uint32_t ideal_tap = (win_stop + win_start) / 2; perif.regmap->misc_outs_reg.write(radio_regmap_t::misc_outs_reg_t::ADC_DATA_DLY_VAL, ideal_tap); perif.regmap->misc_outs_reg.write(radio_regmap_t::misc_outs_reg_t::ADC_DATA_DLY_STB, 1); perif.regmap->misc_outs_reg.write(radio_regmap_t::misc_outs_reg_t::ADC_DATA_DLY_STB, 0); @@ -304,7 +304,7 @@ double x300_impl::self_cal_adc_xfer_delay(mboard_members_t& mb, bool apply_delay double delay = mb.clock->set_clock_delay(X300_CLOCK_WHICH_ADC0, delay_incr*i + delay_start); wait_for_clk_locked(mb, fw_regmap_t::clk_status_reg_t::LMK_LOCK, 0.1); - boost::uint32_t err_code = 0; + uint32_t err_code = 0; for (size_t r = 0; r < mboard_members_t::NUM_RADIOS; r++) { //Test each channel (I and Q) individually so as to not accidentally trigger //on the data from the other channel if there is a swap diff --git a/host/lib/usrp/x300/x300_clock_ctrl.cpp b/host/lib/usrp/x300/x300_clock_ctrl.cpp index 3df2b7c02..b8b100ceb 100644 --- a/host/lib/usrp/x300/x300_clock_ctrl.cpp +++ b/host/lib/usrp/x300/x300_clock_ctrl.cpp @@ -19,7 +19,7 @@ #include "x300_clock_ctrl.hpp" #include <uhd/utils/safe_call.hpp> #include <uhd/utils/math.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/format.hpp> #include <boost/math/special_functions/round.hpp> #include <stdexcept> @@ -27,7 +27,7 @@ #include <cstdlib> static const double X300_REF_CLK_OUT_RATE = 10e6; -static const boost::uint16_t X300_MAX_CLKOUT_DIV = 1045; +static const uint16_t X300_MAX_CLKOUT_DIV = 1045; struct x300_clk_delays { x300_clk_delays() : @@ -118,9 +118,9 @@ public: } void set_dboard_rate(const x300_clock_which_t which, double rate) { - boost::uint16_t div = boost::uint16_t(_vco_freq / rate); - boost::uint16_t *reg = NULL; - boost::uint8_t addr = 0xFF; + uint16_t div = uint16_t(_vco_freq / rate); + uint16_t *reg = NULL; + uint8_t addr = 0xFF; // Make sure requested rate is an even divisor of the VCO frequency if (not math::frequencies_are_equal(_vco_freq / div, rate)) @@ -234,16 +234,16 @@ public: this->write_regs(8); } - void write_regs(boost::uint8_t addr) { - boost::uint32_t data = _lmk04816_regs.get_reg(addr); + void write_regs(uint8_t addr) { + uint32_t data = _lmk04816_regs.get_reg(addr); _spiface->write_spi(_slaveno, spi_config_t::EDGE_RISE, data,32); } double set_clock_delay(const x300_clock_which_t which, const double delay_ns, const bool resync = true) { //All dividers have are delayed by 5 taps by default. The delay //set by this function is relative to the 5 tap delay - static const boost::uint16_t DDLY_MIN_TAPS = 5; - static const boost::uint16_t DDLY_MAX_TAPS = 522; //Extended mode + static const uint16_t DDLY_MIN_TAPS = 5; + static const uint16_t DDLY_MAX_TAPS = 522; //Extended mode //The resolution and range of the analog delay is fixed static const double ADLY_RES_NS = 0.025; @@ -259,19 +259,19 @@ public: //A caveat here is that the analog delay starts at ADLY_MIN_NS, so we need to back off //by that much when coming up with the digital taps so that the difference can be made //up using the analog delay. - boost::uint16_t ddly_taps = 0; + uint16_t ddly_taps = 0; if (delay_ns < ADLY_MIN_NS) { - ddly_taps = static_cast<boost::uint16_t>(std::floor((delay_ns)/vco_period_ns)); + ddly_taps = static_cast<uint16_t>(std::floor((delay_ns)/vco_period_ns)); } else { - ddly_taps = static_cast<boost::uint16_t>(std::floor((delay_ns-ADLY_MIN_NS)/vco_period_ns)); + ddly_taps = static_cast<uint16_t>(std::floor((delay_ns-ADLY_MIN_NS)/vco_period_ns)); } double leftover_delay = delay_ns - (vco_period_ns * ddly_taps); //Compute settings - boost::uint16_t ddly_value = ddly_taps + DDLY_MIN_TAPS; + uint16_t ddly_value = ddly_taps + DDLY_MIN_TAPS; bool adly_en = false; - boost::uint8_t adly_value = 0; - boost::uint8_t half_shift_en = 0; + uint8_t adly_value = 0; + uint8_t half_shift_en = 0; if (ddly_value > DDLY_MAX_TAPS) { throw uhd::value_error("set_clock_delay: Requested delay is out of range."); @@ -282,18 +282,18 @@ public: //The VCO is running too slowly for us to compensate the digital delay difference using //analog delay. Do the best we can. adly_en = true; - adly_value = static_cast<boost::uint8_t>(boost::math::round((ADLY_MAX_NS-ADLY_MIN_NS)/ADLY_RES_NS)); + adly_value = static_cast<uint8_t>(boost::math::round((ADLY_MAX_NS-ADLY_MIN_NS)/ADLY_RES_NS)); coerced_delay += ADLY_MAX_NS; } else if (leftover_delay >= ADLY_MIN_NS && leftover_delay <= ADLY_MAX_NS) { //The leftover delay can be compensated by the analog delay up to the analog delay resolution adly_en = true; - adly_value = static_cast<boost::uint8_t>(boost::math::round((leftover_delay-ADLY_MIN_NS)/ADLY_RES_NS)); + adly_value = static_cast<uint8_t>(boost::math::round((leftover_delay-ADLY_MIN_NS)/ADLY_RES_NS)); coerced_delay += ADLY_MIN_NS+(ADLY_RES_NS*adly_value); } else if (leftover_delay >= (ADLY_MIN_NS - half_vco_period_ns) && leftover_delay < ADLY_MIN_NS) { //The leftover delay if less than the minimum supported analog delay but if we move the digital //delay back by half a VCO cycle then it will be in the range of the analog delay. So do that! adly_en = true; - adly_value = static_cast<boost::uint8_t>(boost::math::round((leftover_delay+half_vco_period_ns-ADLY_MIN_NS)/ADLY_RES_NS)); + adly_value = static_cast<uint8_t>(boost::math::round((leftover_delay+half_vco_period_ns-ADLY_MIN_NS)/ADLY_RES_NS)); half_shift_en = 1; coerced_delay += ADLY_MIN_NS+(ADLY_RES_NS*adly_value)-half_vco_period_ns; } else { @@ -600,10 +600,10 @@ private: break; }; - boost::uint16_t master_clock_div = static_cast<boost::uint16_t>( + uint16_t master_clock_div = static_cast<uint16_t>( std::ceil(_vco_freq / _master_clock_rate)); - boost::uint16_t dboard_div = static_cast<boost::uint16_t>( + uint16_t dboard_div = static_cast<uint16_t>( std::ceil(_vco_freq / _dboard_clock_rate)); /* Reset the LMK clock controller. */ @@ -632,7 +632,7 @@ private: // Register 5 _lmk04816_regs.CLKout10_11_PD = lmk04816_regs_t::CLKOUT10_11_PD_NORMAL; _lmk04816_regs.CLKout10_11_DIV = - static_cast<boost::uint16_t>(std::ceil(_vco_freq / _system_ref_rate)); + static_cast<uint16_t>(std::ceil(_vco_freq / _system_ref_rate)); // Register 6 _lmk04816_regs.CLKout0_TYPE = lmk04816_regs_t::CLKOUT0_TYPE_LVDS; //FPGA diff --git a/host/lib/usrp/x300/x300_dac_ctrl.cpp b/host/lib/usrp/x300/x300_dac_ctrl.cpp index 6ffd1ede4..162eeb143 100644 --- a/host/lib/usrp/x300/x300_dac_ctrl.cpp +++ b/host/lib/usrp/x300/x300_dac_ctrl.cpp @@ -250,7 +250,7 @@ public: void _sleep_mode(bool sleep) { - boost::uint8_t sleep_val = sleep ? (1<<7) : 0x00; + uint8_t sleep_val = sleep ? (1<<7) : 0x00; //Set sleep word and default fullscale value write_ad9146_reg(0x41, sleep_val | 0x01); //I DAC write_ad9146_reg(0x45, sleep_val | 0x01); //Q DAC diff --git a/host/lib/usrp/x300/x300_dboard_iface.cpp b/host/lib/usrp/x300/x300_dboard_iface.cpp index b28768f90..092c888b0 100644 --- a/host/lib/usrp/x300/x300_dboard_iface.cpp +++ b/host/lib/usrp/x300/x300_dboard_iface.cpp @@ -126,47 +126,47 @@ double x300_dboard_iface::get_codec_rate(unit_t unit) /*********************************************************************** * GPIO **********************************************************************/ -void x300_dboard_iface::set_pin_ctrl(unit_t unit, boost::uint32_t value, boost::uint32_t mask) +void x300_dboard_iface::set_pin_ctrl(unit_t unit, uint32_t value, uint32_t mask) { _config.gpio->set_pin_ctrl(unit, value, mask); } -boost::uint32_t x300_dboard_iface::get_pin_ctrl(unit_t unit) +uint32_t x300_dboard_iface::get_pin_ctrl(unit_t unit) { return _config.gpio->get_pin_ctrl(unit); } -void x300_dboard_iface::set_atr_reg(unit_t unit, atr_reg_t reg, boost::uint32_t value, boost::uint32_t mask) +void x300_dboard_iface::set_atr_reg(unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask) { _config.gpio->set_atr_reg(unit, reg, value, mask); } -boost::uint32_t x300_dboard_iface::get_atr_reg(unit_t unit, atr_reg_t reg) +uint32_t x300_dboard_iface::get_atr_reg(unit_t unit, atr_reg_t reg) { return _config.gpio->get_atr_reg(unit, reg); } -void x300_dboard_iface::set_gpio_ddr(unit_t unit, boost::uint32_t value, boost::uint32_t mask) +void x300_dboard_iface::set_gpio_ddr(unit_t unit, uint32_t value, uint32_t mask) { _config.gpio->set_gpio_ddr(unit, value, mask); } -boost::uint32_t x300_dboard_iface::get_gpio_ddr(unit_t unit) +uint32_t x300_dboard_iface::get_gpio_ddr(unit_t unit) { return _config.gpio->get_gpio_ddr(unit); } -void x300_dboard_iface::set_gpio_out(unit_t unit, boost::uint32_t value, boost::uint32_t mask) +void x300_dboard_iface::set_gpio_out(unit_t unit, uint32_t value, uint32_t mask) { _config.gpio->set_gpio_out(unit, value, mask); } -boost::uint32_t x300_dboard_iface::get_gpio_out(unit_t unit) +uint32_t x300_dboard_iface::get_gpio_out(unit_t unit) { return _config.gpio->get_gpio_out(unit); } -boost::uint32_t x300_dboard_iface::read_gpio(unit_t unit) +uint32_t x300_dboard_iface::read_gpio(unit_t unit) { return _config.gpio->read_gpio(unit); } @@ -177,20 +177,20 @@ boost::uint32_t x300_dboard_iface::read_gpio(unit_t unit) void x300_dboard_iface::write_spi( unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ){ - boost::uint32_t slave = 0; + uint32_t slave = 0; if (unit == UNIT_TX) slave |= _config.tx_spi_slaveno; if (unit == UNIT_RX) slave |= _config.rx_spi_slaveno; _config.spi->write_spi(int(slave), config, data, num_bits); } -boost::uint32_t x300_dboard_iface::read_write_spi( +uint32_t x300_dboard_iface::read_write_spi( unit_t unit, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ){ if (unit == UNIT_BOTH) throw uhd::runtime_error("UNIT_BOTH not supported."); @@ -202,12 +202,12 @@ boost::uint32_t x300_dboard_iface::read_write_spi( /*********************************************************************** * I2C **********************************************************************/ -void x300_dboard_iface::write_i2c(boost::uint16_t addr, const byte_vector_t &bytes) +void x300_dboard_iface::write_i2c(uint16_t addr, const byte_vector_t &bytes) { return _config.i2c->write_i2c(addr, bytes); } -byte_vector_t x300_dboard_iface::read_i2c(boost::uint16_t addr, size_t num_bytes) +byte_vector_t x300_dboard_iface::read_i2c(uint16_t addr, size_t num_bytes) { return _config.i2c->read_i2c(addr, num_bytes); } @@ -280,7 +280,7 @@ double x300_dboard_iface::read_aux_adc(unit_t unit, aux_adc_t which) unit_to_spi_adc[unit], config, ad7922_regs.get_reg(), 16 ); - ad7922_regs.set_reg(boost::uint16_t(_config.spi->read_spi( + ad7922_regs.set_reg(uint16_t(_config.spi->read_spi( unit_to_spi_adc[unit], config, ad7922_regs.get_reg(), 16 ))); diff --git a/host/lib/usrp/x300/x300_dboard_iface.hpp b/host/lib/usrp/x300/x300_dboard_iface.hpp index 124d768e8..82e08b016 100644 --- a/host/lib/usrp/x300/x300_dboard_iface.hpp +++ b/host/lib/usrp/x300/x300_dboard_iface.hpp @@ -38,7 +38,7 @@ struct x300_dboard_iface_config_t x300_clock_ctrl::sptr clock; x300_clock_which_t which_rx_clk; x300_clock_which_t which_tx_clk; - boost::uint8_t dboard_slot; + uint8_t dboard_slot; uhd::timed_wb_iface::sptr cmd_time_ctrl; }; @@ -59,21 +59,21 @@ public: void write_aux_dac(unit_t, aux_dac_t, double); double read_aux_adc(unit_t, aux_adc_t); - void set_pin_ctrl(unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_pin_ctrl(unit_t unit); - void set_atr_reg(unit_t unit, atr_reg_t reg, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_atr_reg(unit_t unit, atr_reg_t reg); - void set_gpio_ddr(unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_gpio_ddr(unit_t unit); - void set_gpio_out(unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffffffff); - boost::uint32_t get_gpio_out(unit_t unit); - boost::uint32_t read_gpio(unit_t unit); + void set_pin_ctrl(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_pin_ctrl(unit_t unit); + void set_atr_reg(unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_atr_reg(unit_t unit, atr_reg_t reg); + void set_gpio_ddr(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_gpio_ddr(unit_t unit); + void set_gpio_out(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff); + uint32_t get_gpio_out(unit_t unit); + uint32_t read_gpio(unit_t unit); void set_command_time(const uhd::time_spec_t& t); uhd::time_spec_t get_command_time(void); - void write_i2c(boost::uint16_t, const uhd::byte_vector_t &); - uhd::byte_vector_t read_i2c(boost::uint16_t, size_t); + void write_i2c(uint16_t, const uhd::byte_vector_t &); + uhd::byte_vector_t read_i2c(uint16_t, size_t); void set_clock_rate(unit_t, double); double get_clock_rate(unit_t); @@ -84,14 +84,14 @@ public: void write_spi( unit_t unit, const uhd::spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ); - boost::uint32_t read_write_spi( + uint32_t read_write_spi( unit_t unit, const uhd::spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ); void set_fe_connection( diff --git a/host/lib/usrp/x300/x300_fw_ctrl.cpp b/host/lib/usrp/x300/x300_fw_ctrl.cpp index 25960ede0..080d235a4 100644 --- a/host/lib/usrp/x300/x300_fw_ctrl.cpp +++ b/host/lib/usrp/x300/x300_fw_ctrl.cpp @@ -48,7 +48,7 @@ public: __flush(); } - void poke32(const wb_addr_type addr, const boost::uint32_t data) + void poke32(const wb_addr_type addr, const uint32_t data) { for (size_t i = 1; i <= num_retries; i++) { @@ -67,14 +67,14 @@ public: } } - boost::uint32_t peek32(const wb_addr_type addr) + uint32_t peek32(const wb_addr_type addr) { for (size_t i = 1; i <= num_retries; i++) { boost::mutex::scoped_lock lock(reg_access); try { - boost::uint32_t data = this->__peek32(addr); + uint32_t data = this->__peek32(addr); return data; } catch(const uhd::io_error &ex) @@ -91,8 +91,8 @@ public: protected: bool errors; - virtual void __poke32(const wb_addr_type addr, const boost::uint32_t data) = 0; - virtual boost::uint32_t __peek32(const wb_addr_type addr) = 0; + virtual void __poke32(const wb_addr_type addr, const uint32_t data) = 0; + virtual uint32_t __peek32(const wb_addr_type addr) = 0; virtual void __flush() = 0; boost::mutex reg_access; @@ -116,12 +116,12 @@ public: } protected: - virtual void __poke32(const wb_addr_type addr, const boost::uint32_t data) + virtual void __poke32(const wb_addr_type addr, const uint32_t data) { //load request struct x300_fw_comms_t request = x300_fw_comms_t(); - request.flags = uhd::htonx<boost::uint32_t>(X300_FW_COMMS_FLAGS_ACK | X300_FW_COMMS_FLAGS_POKE32); - request.sequence = uhd::htonx<boost::uint32_t>(seq++); + request.flags = uhd::htonx<uint32_t>(X300_FW_COMMS_FLAGS_ACK | X300_FW_COMMS_FLAGS_POKE32); + request.sequence = uhd::htonx<uint32_t>(seq++); request.addr = uhd::htonx(addr); request.data = uhd::htonx(data); @@ -135,7 +135,7 @@ protected: if (nbytes == 0) throw uhd::io_error("x300 fw poke32 - reply timed out"); //sanity checks - const size_t flags = uhd::ntohx<boost::uint32_t>(reply.flags); + const size_t flags = uhd::ntohx<uint32_t>(reply.flags); UHD_ASSERT_THROW(nbytes == sizeof(reply)); UHD_ASSERT_THROW(not (flags & X300_FW_COMMS_FLAGS_ERROR)); UHD_ASSERT_THROW(flags & X300_FW_COMMS_FLAGS_POKE32); @@ -145,12 +145,12 @@ protected: UHD_ASSERT_THROW(reply.data == request.data); } - virtual boost::uint32_t __peek32(const wb_addr_type addr) + virtual uint32_t __peek32(const wb_addr_type addr) { //load request struct x300_fw_comms_t request = x300_fw_comms_t(); - request.flags = uhd::htonx<boost::uint32_t>(X300_FW_COMMS_FLAGS_ACK | X300_FW_COMMS_FLAGS_PEEK32); - request.sequence = uhd::htonx<boost::uint32_t>(seq++); + request.flags = uhd::htonx<uint32_t>(X300_FW_COMMS_FLAGS_ACK | X300_FW_COMMS_FLAGS_PEEK32); + request.sequence = uhd::htonx<uint32_t>(seq++); request.addr = uhd::htonx(addr); request.data = 0; @@ -164,7 +164,7 @@ protected: if (nbytes == 0) throw uhd::io_error("x300 fw peek32 - reply timed out"); //sanity checks - const size_t flags = uhd::ntohx<boost::uint32_t>(reply.flags); + const size_t flags = uhd::ntohx<uint32_t>(reply.flags); UHD_ASSERT_THROW(nbytes == sizeof(reply)); UHD_ASSERT_THROW(not (flags & X300_FW_COMMS_FLAGS_ERROR)); UHD_ASSERT_THROW(flags & X300_FW_COMMS_FLAGS_PEEK32); @@ -173,7 +173,7 @@ protected: UHD_ASSERT_THROW(reply.addr == request.addr); //return result! - return uhd::ntohx<boost::uint32_t>(reply.data); + return uhd::ntohx<uint32_t>(reply.data); } virtual void __flush(void) @@ -202,14 +202,14 @@ public: //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. - boost::uint32_t pcie_fpga_signature = 0; + uint32_t pcie_fpga_signature = 0; _drv_proxy->peek(FPGA_PCIE_SIG_REG, pcie_fpga_signature); if (pcie_fpga_signature != FPGA_X3xx_SIG_VALUE) throw uhd::io_error("cannot create x300_ctrl_iface_pcie. incorrect/no fpga image"); //Also, poll on the ZPU_STATUS bit to ensure all the state machines in the FPGA are //ready to accept register transaction requests. - boost::uint32_t reg_data = 0xffffffff; + uint32_t reg_data = 0xffffffff; boost::posix_time::ptime start_time = boost::posix_time::microsec_clock::local_time(); boost::posix_time::time_duration elapsed; @@ -232,10 +232,10 @@ public: } protected: - virtual void __poke32(const wb_addr_type addr, const boost::uint32_t data) + virtual void __poke32(const wb_addr_type addr, const uint32_t data) { nirio_status status = 0; - boost::uint32_t reg_data = 0xffffffff; + uint32_t reg_data = 0xffffffff; boost::posix_time::ptime start_time = boost::posix_time::microsec_clock::local_time(); boost::posix_time::time_duration elapsed; @@ -257,10 +257,10 @@ protected: throw uhd::io_error("x300 fw poke32 - operation timed out"); } - virtual boost::uint32_t __peek32(const wb_addr_type addr) + virtual uint32_t __peek32(const wb_addr_type addr) { nirio_status status = 0; - boost::uint32_t reg_data = 0xffffffff; + uint32_t reg_data = 0xffffffff; boost::posix_time::ptime start_time = boost::posix_time::microsec_clock::local_time(); boost::posix_time::time_duration elapsed; @@ -292,8 +292,8 @@ protected: private: niriok_proxy::sptr _drv_proxy; - static const boost::uint32_t READ_TIMEOUT_IN_MS = 10; - static const boost::uint32_t INIT_TIMEOUT_IN_MS = 5000; + static const uint32_t READ_TIMEOUT_IN_MS = 10; + static const uint32_t INIT_TIMEOUT_IN_MS = 5000; }; wb_iface::sptr x300_make_ctrl_iface_enet(uhd::transport::udp_simple::sptr udp, bool enable_errors = true) diff --git a/host/lib/usrp/x300/x300_fw_uart.cpp b/host/lib/usrp/x300/x300_fw_uart.cpp index 7f60e26fc..6e7425c4d 100644 --- a/host/lib/usrp/x300/x300_fw_uart.cpp +++ b/host/lib/usrp/x300/x300_fw_uart.cpp @@ -48,7 +48,7 @@ struct x300_uart_iface : uart_iface { const int shift = ((txoffset%4) * 8); if (shift == 0) txword32 = 0; - txword32 |= boost::uint32_t(ch) << shift; + txword32 |= uint32_t(ch) << shift; // Write out full 32 bit words or whatever we have if end of string if (txoffset % 4 == 3 or ch == '\n') { @@ -82,15 +82,15 @@ struct x300_uart_iface : uart_iface void update_cache(void) { - boost::uint32_t device_rxoffset = _iface->peek32(SR_ADDR(X300_FW_SHMEM_BASE, X300_FW_SHMEM_UART_RX_INDEX)); - boost::uint32_t delta = device_rxoffset - rxoffset; + uint32_t device_rxoffset = _iface->peek32(SR_ADDR(X300_FW_SHMEM_BASE, X300_FW_SHMEM_UART_RX_INDEX)); + uint32_t delta = device_rxoffset - rxoffset; while (delta) { if (delta >= poolsize*4) { // all the data is new - reload the entire cache - for (boost::uint32_t i = 0; i < poolsize; i++) + for (uint32_t i = 0; i < poolsize; i++) _rxcache[i] = _iface->peek32(SR_ADDR(rxpool, i)); // set rxoffset to the end of the first string @@ -104,7 +104,7 @@ struct x300_uart_iface : uart_iface else if (rxoffset == _last_device_rxoffset) { // new data was added - refresh the portion of the cache that was updated - for (boost::uint32_t i = ((_last_device_rxoffset+1)/4) % poolsize; i != (((device_rxoffset)/4)+1) % poolsize; i = (i+1) % poolsize) + for (uint32_t i = ((_last_device_rxoffset+1)/4) % poolsize; i != (((device_rxoffset)/4)+1) % poolsize; i = (i+1) % poolsize) { _rxcache[i] = _iface->peek32(SR_ADDR(rxpool, i)); } @@ -155,9 +155,9 @@ struct x300_uart_iface : uart_iface } wb_iface::sptr _iface; - boost::uint32_t rxoffset, txoffset, txword32, rxpool, txpool, poolsize; - boost::uint32_t _last_device_rxoffset; - std::vector<boost::uint32_t> _rxcache; + uint32_t rxoffset, txoffset, txword32, rxpool, txpool, poolsize; + uint32_t _last_device_rxoffset; + std::vector<uint32_t> _rxcache; std::string _rxbuff; boost::mutex _read_mutex; boost::mutex _write_mutex; diff --git a/host/lib/usrp/x300/x300_image_loader.cpp b/host/lib/usrp/x300/x300_image_loader.cpp index e8a1b5269..f08b21f9b 100644 --- a/host/lib/usrp/x300/x300_image_loader.cpp +++ b/host/lib/usrp/x300/x300_image_loader.cpp @@ -61,13 +61,13 @@ using namespace uhd::transport; * Packet structure */ typedef struct { - boost::uint32_t flags; - boost::uint32_t sector; - boost::uint32_t index; - boost::uint32_t size; + uint32_t flags; + uint32_t sector; + uint32_t index; + uint32_t size; union { - boost::uint8_t data8[X300_PACKET_SIZE_BYTES]; - boost::uint16_t data16[X300_PACKET_SIZE_BYTES/2]; + uint8_t data8[X300_PACKET_SIZE_BYTES]; + uint16_t data16[X300_PACKET_SIZE_BYTES/2]; }; } x300_fpga_update_data_t; @@ -86,10 +86,10 @@ typedef struct { std::string resource; std::string filepath; std::string rpc_port; - boost::uint32_t size; + uint32_t size; udp_simple::sptr xport; std::vector<char> bitstream; // .bin image extracted from .lvbitx file - boost::uint8_t data_in[udp_simple::mtu]; + uint8_t data_in[udp_simple::mtu]; } x300_session_t; /* @@ -139,7 +139,7 @@ static void x300_validate_image(x300_session_t &session){ if(!session.ethernet) session.bitstream.clear(); } else if(extension == ".bin" or extension == ".bit"){ - boost::uint32_t max_size = (extension == ".bin") ? X300_FPGA_BIN_SIZE_BYTES + uint32_t max_size = (extension == ".bin") ? X300_FPGA_BIN_SIZE_BYTES : X300_FPGA_BIT_SIZE_BYTES; session.size = fs::file_size(session.filepath); @@ -221,10 +221,10 @@ static void x300_setup_session(x300_session_t &session, * Ethernet communication functions */ static UHD_INLINE size_t x300_send_and_recv(udp_simple::sptr xport, - boost::uint32_t pkt_code, + uint32_t pkt_code, x300_fpga_update_data_t *pkt_out, - boost::uint8_t* data){ - pkt_out->flags = uhd::htonx<boost::uint32_t>(pkt_code); + uint8_t* data){ + pkt_out->flags = uhd::htonx<uint32_t>(pkt_code); xport->send(boost::asio::buffer(pkt_out, sizeof(*pkt_out))); return xport->recv(boost::asio::buffer(data, udp_simple::mtu), UDP_TIMEOUT); } @@ -236,7 +236,7 @@ static UHD_INLINE bool x300_recv_ok(const x300_fpga_update_data_t *pkt_in, } // Image data needs to be bitswapped -static UHD_INLINE void x300_bitswap(boost::uint8_t *num){ +static UHD_INLINE void x300_bitswap(uint8_t *num){ *num = ((*num & 0xF0) >> 4) | ((*num & 0x0F) << 4); *num = ((*num & 0xCC) >> 2) | ((*num & 0x33) << 2); *num = ((*num & 0xAA) >> 1) | ((*num & 0x55) << 1); @@ -249,7 +249,7 @@ static void x300_ethernet_load(x300_session_t &session){ const x300_fpga_update_data_t *pkt_in = reinterpret_cast<const x300_fpga_update_data_t*>(session.data_in); // Initialize write session - boost::uint32_t flags = X300_FPGA_PROG_FLAGS_ACK | X300_FPGA_PROG_FLAGS_INIT; + uint32_t flags = X300_FPGA_PROG_FLAGS_ACK | X300_FPGA_PROG_FLAGS_INIT; size_t len = x300_send_and_recv(session.xport, flags, &pkt_out, session.data_in); if(x300_recv_ok(pkt_in, len)){ std::cout << "-- Initializing FPGA loading..." << std::flush; @@ -290,9 +290,9 @@ static void x300_ethernet_load(x300_session_t &session){ if(session.verify) flags |= X300_FPGA_PROG_FLAGS_VERIFY; // Set burn location - pkt_out.sector = htonx<boost::uint32_t>(X300_FPGA_SECTOR_START + (i/X300_FLASH_SECTOR_SIZE)); - pkt_out.index = htonx<boost::uint32_t>((j % X300_FLASH_SECTOR_SIZE) / 2); - pkt_out.size = htonx<boost::uint32_t>(X300_PACKET_SIZE_BYTES / 2); + pkt_out.sector = htonx<uint32_t>(X300_FPGA_SECTOR_START + (i/X300_FLASH_SECTOR_SIZE)); + pkt_out.index = htonx<uint32_t>((j % X300_FLASH_SECTOR_SIZE) / 2); + pkt_out.size = htonx<uint32_t>(X300_PACKET_SIZE_BYTES / 2); // Read next piece of image memset(pkt_out.data8, 0, X300_PACKET_SIZE_BYTES); @@ -309,7 +309,7 @@ static void x300_ethernet_load(x300_session_t &session){ x300_bitswap(&pkt_out.data8[k]); } for(size_t k = 0; k < (X300_PACKET_SIZE_BYTES/2); k++){ - pkt_out.data16[k] = htonx<boost::uint16_t>(pkt_out.data16[k]); + pkt_out.data16[k] = htonx<uint16_t>(pkt_out.data16[k]); } len = x300_send_and_recv(session.xport, flags, &pkt_out, session.data_in); diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index 776fac928..959245135 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -91,8 +91,8 @@ static device_addrs_t x300_find_with_addr(const device_addr_t &hint) //load request struct x300_fw_comms_t request = x300_fw_comms_t(); - request.flags = uhd::htonx<boost::uint32_t>(X300_FW_COMMS_FLAGS_ACK); - request.sequence = uhd::htonx<boost::uint32_t>(std::rand()); + request.flags = uhd::htonx<uint32_t>(X300_FW_COMMS_FLAGS_ACK); + request.sequence = uhd::htonx<uint32_t>(std::rand()); //send request comm->send(asio::buffer(&request, sizeof(request))); @@ -358,17 +358,17 @@ static void x300_load_fw(wb_iface::sptr fw_reg_ctrl, const std::string &file_nam //load file into memory std::ifstream fw_file(file_name.c_str()); - boost::uint32_t fw_file_buff[X300_FW_NUM_BYTES/sizeof(boost::uint32_t)]; + uint32_t fw_file_buff[X300_FW_NUM_BYTES/sizeof(uint32_t)]; fw_file.read((char *)fw_file_buff, sizeof(fw_file_buff)); fw_file.close(); //Poke the fw words into the WB boot loader fw_reg_ctrl->poke32(SR_ADDR(BOOT_LDR_BASE, BL_ADDRESS), 0); - for (size_t i = 0; i < X300_FW_NUM_BYTES; i+=sizeof(boost::uint32_t)) + for (size_t i = 0; i < X300_FW_NUM_BYTES; i+=sizeof(uint32_t)) { //@TODO: FIXME: Since x300_ctrl_iface acks each write and traps exceptions, the first try for the last word // written will print an error because it triggers a FW reload and fails to reply. - fw_reg_ctrl->poke32(SR_ADDR(BOOT_LDR_BASE, BL_DATA), uhd::byteswap(fw_file_buff[i/sizeof(boost::uint32_t)])); + fw_reg_ctrl->poke32(SR_ADDR(BOOT_LDR_BASE, BL_DATA), uhd::byteswap(fw_file_buff[i/sizeof(uint32_t)])); if ((i & 0x1fff) == 0) UHD_MSG(status) << "." << std::flush; } @@ -445,16 +445,16 @@ void x300_impl::mboard_members_t::discover_eth( ); if (addr == boost::asio::ip::address_v4( - boost::uint32_t(X300_DEFAULT_IP_ETH0_1G)).to_string()) { + uint32_t(X300_DEFAULT_IP_ETH0_1G)).to_string()) { conn_iface.type = X300_IFACE_ETH0; } else if (addr == boost::asio::ip::address_v4( - boost::uint32_t(X300_DEFAULT_IP_ETH1_1G)).to_string()) { + uint32_t(X300_DEFAULT_IP_ETH1_1G)).to_string()) { conn_iface.type = X300_IFACE_ETH1; } else if (addr == boost::asio::ip::address_v4( - boost::uint32_t(X300_DEFAULT_IP_ETH0_10G)).to_string()) { + uint32_t(X300_DEFAULT_IP_ETH0_10G)).to_string()) { conn_iface.type = X300_IFACE_ETH0; } else if (addr == boost::asio::ip::address_v4( - boost::uint32_t(X300_DEFAULT_IP_ETH1_10G)).to_string()) { + uint32_t(X300_DEFAULT_IP_ETH1_10G)).to_string()) { conn_iface.type = X300_IFACE_ETH1; } else { throw uhd::assertion_error(str(boost::format( @@ -555,7 +555,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr) nirio_status_to_exception(status, "x300_impl: Could not initialize RIO session."); //Tell the quirks object which FIFOs carry TX stream data - const boost::uint32_t tx_data_fifos[2] = {X300_RADIO_DEST_PREFIX_TX, X300_RADIO_DEST_PREFIX_TX + 3}; + const uint32_t tx_data_fifos[2] = {X300_RADIO_DEST_PREFIX_TX, X300_RADIO_DEST_PREFIX_TX + 3}; mb.rio_fpga_interface->get_kernel_proxy()->get_rio_quirks().register_tx_streams(tx_data_fifos, 2); _tree->create<size_t>(mb_path / "mtu/recv").set(X300_PCIE_RX_DATA_FRAME_SIZE); @@ -849,7 +849,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr) //////////////////////////////////////////////////////////////////// // Create the GPSDO control //////////////////////////////////////////////////////////////////// - static const boost::uint32_t dont_look_for_gpsdo = 0x1234abcdul; + static const uint32_t dont_look_for_gpsdo = 0x1234abcdul; //otherwise if not disabled, look for the internal GPSDO if (mb.zpu_ctrl->peek32(SR_ADDR(X300_FW_SHMEM_BASE, X300_FW_SHMEM_GPSDO_STATUS)) != dont_look_for_gpsdo) @@ -1048,8 +1048,8 @@ uint32_t x300_impl::allocate_pcie_dma_chan(const uhd::sid_t &tx_sid, const xport } } -static boost::uint32_t extract_sid_from_pkt(void* pkt, size_t) { - return uhd::sid_t(uhd::wtohx(static_cast<const boost::uint32_t*>(pkt)[1])).get_dst(); +static uint32_t extract_sid_from_pkt(void* pkt, size_t) { + return uhd::sid_t(uhd::wtohx(static_cast<const uint32_t*>(pkt)[1])).get_dst(); } uhd::both_xports_t x300_impl::make_transport( @@ -1251,8 +1251,8 @@ uhd::both_xports_t x300_impl::make_transport( //YES, get a __send__ buffer from the __recv__ socket //-- this is the only way to program the framer for recv: managed_send_buffer::sptr buff = xports.recv->get_send_buff(); - buff->cast<boost::uint32_t *>()[0] = 0; //eth dispatch looks for != 0 - buff->cast<boost::uint32_t *>()[1] = uhd::htonx(xports.send_sid.get()); + buff->cast<uint32_t *>()[0] = 0; //eth dispatch looks for != 0 + buff->cast<uint32_t *>()[1] = uhd::htonx(xports.send_sid.get()); buff->commit(8); buff.reset(); @@ -1413,7 +1413,7 @@ void x300_impl::sync_times(mboard_members_t &mb, const uhd::time_spec_t& t) mb.fw_regmap->clock_ctrl_reg.write(fw_regmap_t::clk_ctrl_reg_t::TIME_SYNC, 0); } -bool x300_impl::wait_for_clk_locked(mboard_members_t& mb, boost::uint32_t which, double timeout) +bool x300_impl::wait_for_clk_locked(mboard_members_t& mb, uint32_t which, double timeout) { boost::system_time timeout_time = boost::get_system_time() + boost::posix_time::milliseconds(timeout * 1000.0); do { @@ -1439,7 +1439,7 @@ bool x300_impl::is_pps_present(mboard_members_t& mb) { // The ZPU_RB_CLK_STATUS_PPS_DETECT bit toggles with each rising edge of the PPS. // We monitor it for up to 1.5 seconds looking for it to toggle. - boost::uint32_t pps_detect = mb.fw_regmap->clock_status_reg.read(fw_regmap_t::clk_status_reg_t::PPS_DETECT); + uint32_t pps_detect = mb.fw_regmap->clock_status_reg.read(fw_regmap_t::clk_status_reg_t::PPS_DETECT); for (int i = 0; i < 15; i++) { boost::this_thread::sleep(boost::posix_time::milliseconds(100)); @@ -1494,16 +1494,16 @@ x300_impl::frame_size_t x300_impl::determine_max_frame_size(const std::string &a udp_simple::sptr udp = udp_simple::make_connected(addr, BOOST_STRINGIZE(X300_MTU_DETECT_UDP_PORT)); - std::vector<boost::uint8_t> buffer(std::max(user_frame_size.recv_frame_size, user_frame_size.send_frame_size)); + std::vector<uint8_t> buffer(std::max(user_frame_size.recv_frame_size, user_frame_size.send_frame_size)); x300_mtu_t *request = reinterpret_cast<x300_mtu_t *>(&buffer.front()); static const double echo_timeout = 0.020; //20 ms //test holler - check if its supported in this fw version - request->flags = uhd::htonx<boost::uint32_t>(X300_MTU_DETECT_ECHO_REQUEST); - request->size = uhd::htonx<boost::uint32_t>(sizeof(x300_mtu_t)); + request->flags = uhd::htonx<uint32_t>(X300_MTU_DETECT_ECHO_REQUEST); + request->size = uhd::htonx<uint32_t>(sizeof(x300_mtu_t)); udp->send(boost::asio::buffer(buffer, sizeof(x300_mtu_t))); udp->recv(boost::asio::buffer(buffer), echo_timeout); - if (!(uhd::ntohx<boost::uint32_t>(request->flags) & X300_MTU_DETECT_ECHO_REPLY)) + if (!(uhd::ntohx<uint32_t>(request->flags) & X300_MTU_DETECT_ECHO_REPLY)) throw uhd::not_implemented_error("Holler protocol not implemented"); //Reducing range of (min,max) by setting max value to 10gig max_frame_size as larger sizes are not supported @@ -1517,8 +1517,8 @@ x300_impl::frame_size_t x300_impl::determine_max_frame_size(const std::string &a { size_t test_frame_size = (max_recv_frame_size/2 + min_recv_frame_size/2 + 3) & ~3; - request->flags = uhd::htonx<boost::uint32_t>(X300_MTU_DETECT_ECHO_REQUEST); - request->size = uhd::htonx<boost::uint32_t>(test_frame_size); + request->flags = uhd::htonx<uint32_t>(X300_MTU_DETECT_ECHO_REQUEST); + request->size = uhd::htonx<uint32_t>(test_frame_size); udp->send(boost::asio::buffer(buffer, sizeof(x300_mtu_t))); size_t len = udp->recv(boost::asio::buffer(buffer), echo_timeout); @@ -1537,13 +1537,13 @@ x300_impl::frame_size_t x300_impl::determine_max_frame_size(const std::string &a { size_t test_frame_size = (max_send_frame_size/2 + min_send_frame_size/2 + 3) & ~3; - request->flags = uhd::htonx<boost::uint32_t>(X300_MTU_DETECT_ECHO_REQUEST); - request->size = uhd::htonx<boost::uint32_t>(sizeof(x300_mtu_t)); + request->flags = uhd::htonx<uint32_t>(X300_MTU_DETECT_ECHO_REQUEST); + request->size = uhd::htonx<uint32_t>(sizeof(x300_mtu_t)); udp->send(boost::asio::buffer(buffer, test_frame_size)); size_t len = udp->recv(boost::asio::buffer(buffer), echo_timeout); if (len >= sizeof(x300_mtu_t)) - len = uhd::ntohx<boost::uint32_t>(request->size); + len = uhd::ntohx<uint32_t>(request->size); if (len >= test_frame_size) min_send_frame_size = test_frame_size; @@ -1571,9 +1571,9 @@ x300_impl::frame_size_t x300_impl::determine_max_frame_size(const std::string &a void x300_impl::check_fw_compat(const fs_path &mb_path, wb_iface::sptr iface) { - boost::uint32_t compat_num = iface->peek32(SR_ADDR(X300_FW_SHMEM_BASE, X300_FW_SHMEM_COMPAT_NUM)); - boost::uint32_t compat_major = (compat_num >> 16); - boost::uint32_t compat_minor = (compat_num & 0xffff); + uint32_t compat_num = iface->peek32(SR_ADDR(X300_FW_SHMEM_BASE, X300_FW_SHMEM_COMPAT_NUM)); + uint32_t compat_major = (compat_num >> 16); + uint32_t compat_minor = (compat_num & 0xffff); if (compat_major != X300_FW_COMPAT_MAJOR) { @@ -1590,9 +1590,9 @@ void x300_impl::check_fw_compat(const fs_path &mb_path, wb_iface::sptr iface) void x300_impl::check_fpga_compat(const fs_path &mb_path, const mboard_members_t &members) { - boost::uint32_t compat_num = members.zpu_ctrl->peek32(SR_ADDR(SET0_BASE, ZPU_RB_COMPAT_NUM)); - boost::uint32_t compat_major = (compat_num >> 16); - boost::uint32_t compat_minor = (compat_num & 0xffff); + uint32_t compat_num = members.zpu_ctrl->peek32(SR_ADDR(SET0_BASE, ZPU_RB_COMPAT_NUM)); + uint32_t compat_major = (compat_num >> 16); + uint32_t compat_minor = (compat_num & 0xffff); if (compat_major != X300_FPGA_COMPAT_MAJOR) { @@ -1623,7 +1623,7 @@ void x300_impl::check_fpga_compat(const fs_path &mb_path, const mboard_members_t _tree->create<std::string>(mb_path / "fpga_version").set(str(boost::format("%u.%u") % compat_major % compat_minor)); - const boost::uint32_t git_hash = members.zpu_ctrl->peek32(SR_ADDR(SET0_BASE, + const uint32_t git_hash = members.zpu_ctrl->peek32(SR_ADDR(SET0_BASE, ZPU_RB_GIT_HASH)); _tree->create<std::string>(mb_path / "fpga_version_hash").set( str(boost::format("%07x%s") @@ -1637,7 +1637,7 @@ x300_impl::x300_mboard_t x300_impl::get_mb_type_from_pcie(const std::string& res //Detect the PCIe product ID to distinguish between X300 and X310 nirio_status status = NiRio_Status_Success; - boost::uint32_t pid; + uint32_t pid; niriok_proxy::sptr discovery_proxy = niusrprio_session::create_kernel_proxy(resource, rpc_port); if (discovery_proxy) { @@ -1696,9 +1696,9 @@ x300_impl::x300_mboard_t x300_impl::get_mb_type_from_eeprom(const uhd::usrp::mbo x300_mboard_t mb_type = UNKNOWN; if (not mb_eeprom["product"].empty()) { - boost::uint16_t product_num = 0; + uint16_t product_num = 0; try { - product_num = boost::lexical_cast<boost::uint16_t>(mb_eeprom["product"]); + product_num = boost::lexical_cast<uint16_t>(mb_eeprom["product"]); } catch (const boost::bad_lexical_cast &) { product_num = 0; } diff --git a/host/lib/usrp/x300/x300_impl.hpp b/host/lib/usrp/x300/x300_impl.hpp index 5d3fa4fed..ff18b1a22 100644 --- a/host/lib/usrp/x300/x300_impl.hpp +++ b/host/lib/usrp/x300/x300_impl.hpp @@ -266,7 +266,7 @@ private: void sync_times(mboard_members_t&, const uhd::time_spec_t&); uhd::sensor_value_t get_ref_locked(mboard_members_t& mb); - bool wait_for_clk_locked(mboard_members_t& mb, boost::uint32_t which, double timeout); + bool wait_for_clk_locked(mboard_members_t& mb, uint32_t which, double timeout); bool is_pps_present(mboard_members_t& mb); void set_mb_eeprom(uhd::i2c_iface::sptr i2c, const uhd::usrp::mboard_eeprom_t &); diff --git a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp index 991b97696..4bb9c9fb5 100644 --- a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp +++ b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp @@ -82,11 +82,11 @@ UHD_RFNOC_RADIO_BLOCK_CONSTRUCTOR(x300_radio_ctrl) if (_radio_type==PRIMARY) { _fp_gpio = gpio_atr::gpio_atr_3000::make(ctrl, regs::sr_addr(regs::FP_GPIO), regs::RB_FP_GPIO); BOOST_FOREACH(const gpio_atr::gpio_attr_map_t::value_type attr, gpio_atr::gpio_attr_map) { - _tree->create<boost::uint32_t>(fs_path("gpio") / "FP0" / attr.second) + _tree->create<uint32_t>(fs_path("gpio") / "FP0" / attr.second) .set(0) .add_coerced_subscriber(boost::bind(&gpio_atr::gpio_atr_3000::set_gpio_attr, _fp_gpio, attr.first, _1)); } - _tree->create<boost::uint32_t>(fs_path("gpio") / "FP0" / "READBACK") + _tree->create<uint32_t>(fs_path("gpio") / "FP0" / "READBACK") .set_publisher(boost::bind(&gpio_atr::gpio_atr_3000::read_gpio, _fp_gpio)); } @@ -125,9 +125,10 @@ UHD_RFNOC_RADIO_BLOCK_CONSTRUCTOR(x300_radio_ctrl) // Bind the daughterboard command time to the motherboard level property //////////////////////////////////////////////////////////////// - if (_tree->exists(fs_path("time") / "cmd")) { + if (_tree->exists(fs_path("time") / "cmd") and + _tree->exists(fs_path("dboards" / _radio_slot / "rx_frontends" / _rx_fe_map.at(i).db_fe_name / "time" / "cmd"))) { _tree->access<time_spec_t>(fs_path("time") / "cmd") - .add_coerced_subscriber(boost::bind(&x300_radio_ctrl_impl::set_fe_cmd_time, this, _1, i)); + .add_coerced_subscriber(boost::bind(&x300_radio_ctrl_impl::set_fe_cmd_time, this, _1, i)); } } @@ -172,11 +173,11 @@ double x300_radio_ctrl_impl::set_rate(double /* rate */) return get_rate(); } -time_spec_t x300_radio_ctrl_impl::set_fe_cmd_time(const time_spec_t &time, const size_t chan) +void x300_radio_ctrl_impl::set_fe_cmd_time(const time_spec_t &time, const size_t chan) { - return _tree->access<time_spec_t>( + _tree->access<time_spec_t>( fs_path("dboards" / _radio_slot / "rx_frontends" / _rx_fe_map.at(chan).db_fe_name / "time" / "cmd") - ).set(time).get(); + ).set(time); } void x300_radio_ctrl_impl::set_tx_antenna(const std::string &ant, const size_t chan) @@ -483,7 +484,7 @@ void x300_radio_ctrl_impl::reset_codec() _dac->reset(); } -void x300_radio_ctrl_impl::self_test_adc(boost::uint32_t ramp_time_ms) +void x300_radio_ctrl_impl::self_test_adc(uint32_t ramp_time_ms) { //Bypass all front-end corrections for (size_t i = 0; i < _get_num_radios(); i++) { @@ -602,7 +603,7 @@ void x300_radio_ctrl_impl::synchronize_dacs(const std::vector<x300_radio_ctrl_im boost::posix_time::microsec_clock::local_time() - t_start; //Add 100% of headroom + uncertaintly to the command time - boost::uint64_t t_sync_us = (t_elapsed.total_microseconds() * 2) + 13000 /*Scheduler latency*/; + uint64_t t_sync_us = (t_elapsed.total_microseconds() * 2) + 13000 /*Scheduler latency*/; //Pick radios[0] as the time reference. uhd::time_spec_t sync_time = @@ -653,7 +654,7 @@ double x300_radio_ctrl_impl::self_cal_adc_xfer_delay( double delay = clock->set_clock_delay(X300_CLOCK_WHICH_ADC0, delay_incr*i + delay_start); wait_for_clk_locked(0.1); - boost::uint32_t err_code = 0; + uint32_t err_code = 0; for (size_t r = 0; r < radios.size(); r++) { //Test each channel (I and Q) individually so as to not accidentally trigger //on the data from the other channel if there is a swap @@ -784,20 +785,20 @@ void x300_radio_ctrl_impl::_self_cal_adc_capture_delay(bool print_status) { if (print_status) UHD_MSG(status) << "Running ADC capture delay self-cal..." << std::flush; - static const boost::uint32_t NUM_DELAY_STEPS = 32; //The IDELAYE2 element has 32 steps - static const boost::uint32_t NUM_RETRIES = 2; //Retry self-cal if it fails in warmup situations - static const boost::int32_t MIN_WINDOW_LEN = 4; + static const uint32_t NUM_DELAY_STEPS = 32; //The IDELAYE2 element has 32 steps + static const uint32_t NUM_RETRIES = 2; //Retry self-cal if it fails in warmup situations + static const int32_t MIN_WINDOW_LEN = 4; - boost::int32_t win_start = -1, win_stop = -1; - boost::uint32_t iter = 0; + int32_t win_start = -1, win_stop = -1; + uint32_t iter = 0; while (iter++ < NUM_RETRIES) { - for (boost::uint32_t dly_tap = 0; dly_tap < NUM_DELAY_STEPS; dly_tap++) { + for (uint32_t dly_tap = 0; dly_tap < NUM_DELAY_STEPS; dly_tap++) { //Apply delay _regs->misc_outs_reg.write(radio_regmap_t::misc_outs_reg_t::ADC_DATA_DLY_VAL, dly_tap); _regs->misc_outs_reg.write(radio_regmap_t::misc_outs_reg_t::ADC_DATA_DLY_STB, 1); _regs->misc_outs_reg.write(radio_regmap_t::misc_outs_reg_t::ADC_DATA_DLY_STB, 0); - boost::uint32_t err_code = 0; + uint32_t err_code = 0; // -- Test I Channel -- //Put ADC in ramp test mode. Tie the other channel to all ones. @@ -868,7 +869,7 @@ void x300_radio_ctrl_impl::_self_cal_adc_capture_delay(bool print_status) throw uhd::runtime_error("self_cal_adc_capture_delay: Self calibration failed. Valid window too narrow."); } - boost::uint32_t ideal_tap = (win_stop + win_start) / 2; + uint32_t ideal_tap = (win_stop + win_start) / 2; _regs->misc_outs_reg.write(radio_regmap_t::misc_outs_reg_t::ADC_DATA_DLY_VAL, ideal_tap); _regs->misc_outs_reg.write(radio_regmap_t::misc_outs_reg_t::ADC_DATA_DLY_STB, 1); _regs->misc_outs_reg.write(radio_regmap_t::misc_outs_reg_t::ADC_DATA_DLY_STB, 0); @@ -879,14 +880,14 @@ void x300_radio_ctrl_impl::_self_cal_adc_capture_delay(bool print_status) } } -void x300_radio_ctrl_impl::_check_adc(const boost::uint32_t val) +void x300_radio_ctrl_impl::_check_adc(const uint32_t val) { //Wait for previous control transaction to flush user_reg_read64(regs::RB_TEST); //Wait for ADC test pattern to propagate boost::this_thread::sleep(boost::posix_time::microsec(5)); //Read value of RX readback register and verify - boost::uint32_t adc_rb = static_cast<boost::uint32_t>(user_reg_read64(regs::RB_TEST)>>32); + uint32_t adc_rb = static_cast<uint32_t>(user_reg_read64(regs::RB_TEST)>>32); adc_rb ^= 0xfffc0000; //adapt for I inversion in FPGA if (val != adc_rb) { throw uhd::runtime_error( diff --git a/host/lib/usrp/x300/x300_radio_ctrl_impl.hpp b/host/lib/usrp/x300/x300_radio_ctrl_impl.hpp index 5b9d47841..6e17778bd 100644 --- a/host/lib/usrp/x300/x300_radio_ctrl_impl.hpp +++ b/host/lib/usrp/x300/x300_radio_ctrl_impl.hpp @@ -82,7 +82,7 @@ public: void reset_codec(); void self_test_adc( - boost::uint32_t ramp_time_ms = 100); + uint32_t ramp_time_ms = 100); static void extended_adc_test( const std::vector<x300_radio_ctrl_impl::sptr>&, double duration_s); @@ -154,14 +154,14 @@ private: void _self_cal_adc_capture_delay(bool print_status); - void _check_adc(const boost::uint32_t val); + void _check_adc(const uint32_t val); void _set_db_eeprom(uhd::i2c_iface::sptr i2c, const size_t, const uhd::usrp::dboard_eeprom_t &); void set_rx_fe_corrections(const uhd::fs_path &db_path, const uhd::fs_path &rx_fe_corr_path, const double lo_freq); void set_tx_fe_corrections(const uhd::fs_path &db_path, const uhd::fs_path &tx_fe_corr_path, const double lo_freq); - time_spec_t set_fe_cmd_time(const time_spec_t &time, const size_t chan); + void set_fe_cmd_time(const time_spec_t &time, const size_t chan); private: // members enum radio_connection_t { PRIMARY, SECONDARY }; diff --git a/host/lib/usrp/x300/x300_regs.hpp b/host/lib/usrp/x300/x300_regs.hpp index 80d275949..6e7c47a64 100644 --- a/host/lib/usrp/x300/x300_regs.hpp +++ b/host/lib/usrp/x300/x300_regs.hpp @@ -184,9 +184,9 @@ namespace uhd { namespace usrp { namespace x300 { UHD_DEFINE_SOFT_REG_FIELD(GPSDO_PWR_EN, /*width*/ 1, /*shift*/ 6); //[6] UHD_DEFINE_SOFT_REG_FIELD(TIME_SYNC, /*width*/ 1, /*shift*/ 7); //[7] - static const boost::uint32_t SRC_EXTERNAL = 0x0; - static const boost::uint32_t SRC_INTERNAL = 0x2; - static const boost::uint32_t SRC_GPSDO = 0x3; + static const uint32_t SRC_EXTERNAL = 0x0; + static const uint32_t SRC_INTERNAL = 0x2; + static const uint32_t SRC_GPSDO = 0x3; clk_ctrl_reg_t(): uhd::soft_reg32_wo_t(SR_ADDR(SET0_BASE, ZPU_SR_CLOCK_CTRL)) { //Initial values diff --git a/host/lib/usrp_clock/multi_usrp_clock.cpp b/host/lib/usrp_clock/multi_usrp_clock.cpp index 4d3e526d6..71521190e 100644 --- a/host/lib/usrp_clock/multi_usrp_clock.cpp +++ b/host/lib/usrp_clock/multi_usrp_clock.cpp @@ -61,10 +61,10 @@ public: return _tree->list("/mboards").size(); } - boost::uint32_t get_time(size_t board){ + uint32_t get_time(size_t board){ std::string board_str = str(boost::format("/mboards/%d") % board); - return _tree->access<boost::uint32_t>(board_str / "time").get(); + return _tree->access<uint32_t>(board_str / "time").get(); } sensor_value_t get_sensor(const std::string &name, size_t board){ diff --git a/host/lib/usrp_clock/octoclock/octoclock_eeprom.cpp b/host/lib/usrp_clock/octoclock/octoclock_eeprom.cpp index b39bc4b52..b0d24deec 100644 --- a/host/lib/usrp_clock/octoclock/octoclock_eeprom.cpp +++ b/host/lib/usrp_clock/octoclock/octoclock_eeprom.cpp @@ -41,13 +41,13 @@ using namespace uhd::transport; * Implementation **********************************************************************/ void octoclock_eeprom_t::_load(){ - boost::uint8_t octoclock_data[udp_simple::mtu]; + uint8_t octoclock_data[udp_simple::mtu]; const octoclock_packet_t *pkt_in = reinterpret_cast<const octoclock_packet_t*>(octoclock_data); const octoclock_fw_eeprom_t *eeprom_in = reinterpret_cast<const octoclock_fw_eeprom_t*>(pkt_in->data); octoclock_packet_t pkt_out; // To avoid replicating sequence numbers between sessions - pkt_out.sequence = boost::uint32_t(std::rand()); + pkt_out.sequence = uint32_t(std::rand()); size_t len = 0; UHD_OCTOCLOCK_SEND_AND_RECV(xport, _proto_ver, SEND_EEPROM_CMD, pkt_out, len, octoclock_data); @@ -57,19 +57,19 @@ void octoclock_eeprom_t::_load(){ (*this)["mac-addr"] = mac_addr_t::from_bytes(mac_bytes).to_string(); //IP address - boost::uint32_t ip_addr = uhd::htonx<boost::uint32_t>(eeprom_in->ip_addr); + uint32_t ip_addr = uhd::htonx<uint32_t>(eeprom_in->ip_addr); ip_v4::bytes_type ip_addr_bytes; memcpy(&ip_addr_bytes, &ip_addr, 4); (*this)["ip-addr"] = ip_v4(ip_addr_bytes).to_string(); //Default router - boost::uint32_t dr_addr = uhd::htonx<boost::uint32_t>(eeprom_in->dr_addr); + uint32_t dr_addr = uhd::htonx<uint32_t>(eeprom_in->dr_addr); ip_v4::bytes_type dr_addr_bytes; memcpy(&dr_addr_bytes, &dr_addr, 4); (*this)["gateway"] = ip_v4(dr_addr_bytes).to_string(); //Netmask - boost::uint32_t netmask = uhd::htonx<boost::uint32_t>(eeprom_in->netmask); + uint32_t netmask = uhd::htonx<uint32_t>(eeprom_in->netmask); ip_v4::bytes_type netmask_bytes; memcpy(&netmask_bytes, &netmask, 4); (*this)["netmask"] = ip_v4(netmask_bytes).to_string(); @@ -91,12 +91,12 @@ void octoclock_eeprom_t::_load(){ } void octoclock_eeprom_t::_store() const { - boost::uint8_t octoclock_data[udp_simple::mtu]; + uint8_t octoclock_data[udp_simple::mtu]; const octoclock_packet_t *pkt_in = reinterpret_cast<const octoclock_packet_t *>(octoclock_data); octoclock_packet_t pkt_out; // To avoid replicating sequence numbers between sessions - pkt_out.sequence = boost::uint32_t(std::rand()); + pkt_out.sequence = uint32_t(std::rand()); pkt_out.len = sizeof(octoclock_fw_eeprom_t); size_t len = 0; @@ -112,21 +112,21 @@ void octoclock_eeprom_t::_store() const { if((*this).has_key("ip-addr")){ ip_v4::bytes_type ip_addr_bytes = ip_v4::from_string((*this)["ip-addr"]).to_bytes(); memcpy(&eeprom_out->ip_addr, &ip_addr_bytes, 4); - eeprom_out->ip_addr = uhd::htonx<boost::uint32_t>(eeprom_out->ip_addr); + eeprom_out->ip_addr = uhd::htonx<uint32_t>(eeprom_out->ip_addr); } //Default router if((*this).has_key("gateway")){ ip_v4::bytes_type dr_addr_bytes = ip_v4::from_string((*this)["gateway"]).to_bytes(); memcpy(&eeprom_out->dr_addr, &dr_addr_bytes, 4); - eeprom_out->dr_addr = uhd::htonx<boost::uint32_t>(eeprom_out->dr_addr); + eeprom_out->dr_addr = uhd::htonx<uint32_t>(eeprom_out->dr_addr); } //Netmask if((*this).has_key("netmask")){ ip_v4::bytes_type netmask_bytes = ip_v4::from_string((*this)["netmask"]).to_bytes(); memcpy(&eeprom_out->netmask, &netmask_bytes, 4); - eeprom_out->netmask = uhd::htonx<boost::uint32_t>(eeprom_out->netmask); + eeprom_out->netmask = uhd::htonx<uint32_t>(eeprom_out->netmask); } //Serial diff --git a/host/lib/usrp_clock/octoclock/octoclock_image_loader.cpp b/host/lib/usrp_clock/octoclock/octoclock_image_loader.cpp index 3f89a9263..d3502113e 100644 --- a/host/lib/usrp_clock/octoclock/octoclock_image_loader.cpp +++ b/host/lib/usrp_clock/octoclock/octoclock_image_loader.cpp @@ -28,7 +28,7 @@ #include <uhd/utils/paths.hpp> #include <uhd/utils/static.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/filesystem.hpp> #include <boost/format.hpp> #include <boost/lexical_cast.hpp> @@ -57,14 +57,14 @@ typedef struct { bool found; uhd::device_addr_t dev_addr; std::string image_filepath; - boost::uint16_t crc; - boost::uint16_t num_blocks; - boost::uint32_t sequence; + uint16_t crc; + uint16_t num_blocks; + uint32_t sequence; udp_simple::sptr ctrl_xport; udp_simple::sptr fw_xport; - boost::uint8_t data_in[udp_simple::mtu]; - boost::uint32_t starting_firmware_version; - std::vector<boost::uint8_t> image; + uint8_t data_in[udp_simple::mtu]; + uint32_t starting_firmware_version; + std::vector<uint8_t> image; } octoclock_session_t; static void octoclock_calculate_crc(octoclock_session_t &session){ @@ -72,7 +72,7 @@ static void octoclock_calculate_crc(octoclock_session_t &session){ for(size_t i = 0; i < session.image.size(); i++) { session.crc ^= session.image[i]; - for(boost::uint8_t j = 0; j < 8; ++j){ + for(uint8_t j = 0; j < 8; ++j){ if(session.crc & 1) session.crc = (session.crc >> 1) ^ 0xA001; else session.crc = (session.crc >> 1); } @@ -172,7 +172,7 @@ static void octoclock_setup_session(octoclock_session_t &session, session.fw_xport = udp_simple::make_connected(session.dev_addr["addr"], BOOST_STRINGIZE(OCTOCLOCK_UDP_FW_PORT)); // To avoid replicating sequence numbers between sessions - session.sequence = boost::uint32_t(std::rand()); + session.sequence = uint32_t(std::rand()); // Query OctoClock again to get compat number octoclock_packet_t pkt_out; @@ -180,7 +180,7 @@ static void octoclock_setup_session(octoclock_session_t &session, size_t len = 0; UHD_OCTOCLOCK_SEND_AND_RECV(session.ctrl_xport, OCTOCLOCK_FW_COMPAT_NUM, OCTOCLOCK_QUERY_CMD, pkt_out, len, session.data_in); if(UHD_OCTOCLOCK_PACKET_MATCHES(OCTOCLOCK_QUERY_ACK, pkt_out, pkt_in, len)){ - session.starting_firmware_version = uhd::htonx<boost::uint32_t>(pkt_in->proto_ver); + session.starting_firmware_version = uhd::htonx<uint32_t>(pkt_in->proto_ver); } else { throw uhd::runtime_error("Failed to communicate with OctoClock."); } @@ -194,8 +194,8 @@ static void octoclock_reset_into_bootloader(octoclock_session_t &session){ // Force compat num to device's current, works around old firmware bug octoclock_packet_t pkt_out; - pkt_out.sequence = uhd::htonx<boost::uint32_t>(++session.sequence); - pkt_out.proto_ver = uhd::htonx<boost::uint32_t>(session.starting_firmware_version); + pkt_out.sequence = uhd::htonx<uint32_t>(++session.sequence); + pkt_out.proto_ver = uhd::htonx<uint32_t>(session.starting_firmware_version); pkt_out.code = RESET_CMD; std::cout << " -- Resetting into bootloader..." << std::flush; @@ -235,11 +235,11 @@ static void octoclock_burn(octoclock_session_t &session){ octoclock_reset_into_bootloader(session); octoclock_packet_t pkt_out; - pkt_out.sequence = uhd::htonx<boost::uint32_t>(++session.sequence); + pkt_out.sequence = uhd::htonx<uint32_t>(++session.sequence); const octoclock_packet_t* pkt_in = reinterpret_cast<const octoclock_packet_t*>(session.data_in); // Tell OctoClock to prepare for burn - pkt_out.len = htonx<boost::uint16_t>(session.image.size()); + pkt_out.len = htonx<uint16_t>(session.image.size()); size_t len = 0; std::cout << " -- Preparing OctoClock for firmware load..." << std::flush; pkt_out.len = session.image.size(); @@ -255,7 +255,7 @@ static void octoclock_burn(octoclock_session_t &session){ // Start burning for(size_t i = 0; i < session.num_blocks; i++){ - pkt_out.sequence = uhd::htonx<boost::uint32_t>(++session.sequence); + pkt_out.sequence = uhd::htonx<uint32_t>(++session.sequence); pkt_out.addr = i * OCTOCLOCK_BLOCK_SIZE; std::cout << str(boost::format("\r -- Loading firmware: %d%% (%d/%d blocks)") @@ -280,14 +280,14 @@ static void octoclock_burn(octoclock_session_t &session){ static void octoclock_verify(octoclock_session_t &session){ octoclock_packet_t pkt_out; - pkt_out.sequence = uhd::htonx<boost::uint32_t>(++session.sequence); + pkt_out.sequence = uhd::htonx<uint32_t>(++session.sequence); const octoclock_packet_t* pkt_in = reinterpret_cast<const octoclock_packet_t*>(session.data_in); size_t len = 0; - boost::uint8_t image_part[OCTOCLOCK_BLOCK_SIZE]; - boost::uint16_t cmp_len = 0; + uint8_t image_part[OCTOCLOCK_BLOCK_SIZE]; + uint16_t cmp_len = 0; for(size_t i = 0; i < session.num_blocks; i++){ - pkt_out.sequence = uhd::htonx<boost::uint32_t>(++session.sequence); + pkt_out.sequence = uhd::htonx<uint32_t>(++session.sequence); pkt_out.addr = i * OCTOCLOCK_BLOCK_SIZE; std::cout << str(boost::format("\r -- Verifying firmware load: %d%% (%d/%d blocks)") @@ -320,7 +320,7 @@ static void octoclock_verify(octoclock_session_t &session){ static void octoclock_finalize(octoclock_session_t &session){ octoclock_packet_t pkt_out; - pkt_out.sequence = uhd::htonx<boost::uint32_t>(++session.sequence); + pkt_out.sequence = uhd::htonx<uint32_t>(++session.sequence); const octoclock_packet_t* pkt_in = reinterpret_cast<const octoclock_packet_t*>(session.data_in); size_t len = 0; diff --git a/host/lib/usrp_clock/octoclock/octoclock_impl.cpp b/host/lib/usrp_clock/octoclock/octoclock_impl.cpp index 297983c15..4da9db19f 100644 --- a/host/lib/usrp_clock/octoclock/octoclock_impl.cpp +++ b/host/lib/usrp_clock/octoclock/octoclock_impl.cpp @@ -19,7 +19,7 @@ #include <boost/asio.hpp> #include <boost/assign.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/filesystem.hpp> #include <boost/foreach.hpp> #include <boost/format.hpp> @@ -111,7 +111,7 @@ device_addrs_t octoclock_find(const device_addr_t &hint){ octoclock_packet_t pkt_out; pkt_out.proto_ver = OCTOCLOCK_FW_COMPAT_NUM; // To avoid replicating sequence numbers between sessions - pkt_out.sequence = boost::uint32_t(std::rand()); + pkt_out.sequence = uint32_t(std::rand()); pkt_out.len = 0; pkt_out.code = OCTOCLOCK_QUERY_CMD; try{ @@ -124,7 +124,7 @@ device_addrs_t octoclock_find(const device_addr_t &hint){ UHD_MSG(error) << "OctoClock network discovery unknown error" << std::endl; } - boost::uint8_t octoclock_data[udp_simple::mtu]; + uint8_t octoclock_data[udp_simple::mtu]; const octoclock_packet_t *pkt_in = reinterpret_cast<octoclock_packet_t*>(octoclock_data); while(true){ @@ -191,7 +191,7 @@ octoclock_impl::octoclock_impl(const device_addr_t &_device_addr){ _type = device::CLOCK; device_addrs_t device_args = separate_device_addr(_device_addr); // To avoid replicating sequence numbers between sessions - _sequence = boost::uint32_t(std::rand()); + _sequence = uint32_t(std::rand()); //////////////////////////////////////////////////////////////////// // Initialize the property tree @@ -248,7 +248,7 @@ octoclock_impl::octoclock_impl(const device_addr_t &_device_addr){ //////////////////////////////////////////////////////////////////// // Initialize non-GPSDO sensors //////////////////////////////////////////////////////////////////// - _tree->create<boost::uint32_t>(oc_path / "time") + _tree->create<uint32_t>(oc_path / "time") .set_publisher(boost::bind(&octoclock_impl::_get_time, this, oc)); _tree->create<sensor_value_t>(oc_path / "sensors/ext_ref_detected") .set_publisher(boost::bind(&octoclock_impl::_ext_ref_detected, this, oc)); @@ -330,13 +330,13 @@ void octoclock_impl::_set_eeprom(const std::string &oc, const octoclock_eeprom_t _oc_dict[oc].eeprom.commit(); } -boost::uint32_t octoclock_impl::_get_fw_version(const std::string &oc){ +uint32_t octoclock_impl::_get_fw_version(const std::string &oc){ octoclock_packet_t pkt_out; - pkt_out.sequence = uhd::htonx<boost::uint32_t>(++_sequence); + pkt_out.sequence = uhd::htonx<uint32_t>(++_sequence); pkt_out.len = 0; size_t len; - boost::uint8_t octoclock_data[udp_simple::mtu]; + uint8_t octoclock_data[udp_simple::mtu]; const octoclock_packet_t *pkt_in = reinterpret_cast<octoclock_packet_t*>(octoclock_data); UHD_OCTOCLOCK_SEND_AND_RECV(_oc_dict[oc].ctrl_xport, OCTOCLOCK_FW_COMPAT_NUM, OCTOCLOCK_QUERY_CMD, pkt_out, len, octoclock_data); @@ -348,11 +348,11 @@ boost::uint32_t octoclock_impl::_get_fw_version(const std::string &oc){ void octoclock_impl::_get_state(const std::string &oc){ octoclock_packet_t pkt_out; - pkt_out.sequence = uhd::htonx<boost::uint32_t>(++_sequence); + pkt_out.sequence = uhd::htonx<uint32_t>(++_sequence); pkt_out.len = 0; size_t len = 0; - boost::uint8_t octoclock_data[udp_simple::mtu]; + uint8_t octoclock_data[udp_simple::mtu]; const octoclock_packet_t *pkt_in = reinterpret_cast<octoclock_packet_t*>(octoclock_data); UHD_OCTOCLOCK_SEND_AND_RECV(_oc_dict[oc].ctrl_xport, _proto_ver, SEND_STATE_CMD, pkt_out, len, octoclock_data); @@ -408,10 +408,10 @@ sensor_value_t octoclock_impl::_switch_pos(const std::string &oc){ return sensor_value_t("Switch position", _switch_pos_strings[switch_pos_t(_oc_dict[oc].state.switch_pos)], ""); } -boost::uint32_t octoclock_impl::_get_time(const std::string &oc){ +uint32_t octoclock_impl::_get_time(const std::string &oc){ if(_oc_dict[oc].state.gps_detected){ std::string time_str = _oc_dict[oc].gps->get_sensor("gps_time").value; - return boost::lexical_cast<boost::uint32_t>(time_str); + return boost::lexical_cast<uint32_t>(time_str); } else throw uhd::runtime_error("This device cannot return a time."); } diff --git a/host/lib/usrp_clock/octoclock/octoclock_impl.hpp b/host/lib/usrp_clock/octoclock/octoclock_impl.hpp index 2c74b9b03..1cb3b60e1 100644 --- a/host/lib/usrp_clock/octoclock/octoclock_impl.hpp +++ b/host/lib/usrp_clock/octoclock/octoclock_impl.hpp @@ -56,12 +56,12 @@ private: uhd::gps_ctrl::sptr gps; }; uhd::dict<std::string, oc_container_type> _oc_dict; - boost::uint32_t _sequence; - boost::uint32_t _proto_ver; + uint32_t _sequence; + uint32_t _proto_ver; void _set_eeprom(const std::string &oc, const uhd::usrp_clock::octoclock_eeprom_t &oc_eeprom); - boost::uint32_t _get_fw_version(const std::string &oc); + uint32_t _get_fw_version(const std::string &oc); void _get_state(const std::string &oc); @@ -73,7 +73,7 @@ private: uhd::sensor_value_t _switch_pos(const std::string &oc); - boost::uint32_t _get_time(const std::string &oc); + uint32_t _get_time(const std::string &oc); std::string _get_images_help_message(const std::string &addr); diff --git a/host/lib/usrp_clock/octoclock/octoclock_uart.cpp b/host/lib/usrp_clock/octoclock/octoclock_uart.cpp index 0b5b840d3..0def2fdba 100644 --- a/host/lib/usrp_clock/octoclock/octoclock_uart.cpp +++ b/host/lib/usrp_clock/octoclock/octoclock_uart.cpp @@ -21,7 +21,7 @@ #include <boost/algorithm/string.hpp> #include <boost/asio.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/format.hpp> #include <boost/thread/thread.hpp> @@ -48,15 +48,15 @@ namespace uhd{ _device_state.pos = 0; _proto_ver = proto_ver; // To avoid replicating sequence numbers between sessions - _sequence = boost::uint32_t(std::rand()); + _sequence = uint32_t(std::rand()); size_t len = 0; //Get pool size from device octoclock_packet_t pkt_out; - pkt_out.sequence = uhd::htonx<boost::uint32_t>(_sequence); + pkt_out.sequence = uhd::htonx<uint32_t>(_sequence); pkt_out.len = 0; - boost::uint8_t octoclock_data[udp_simple::mtu]; + uint8_t octoclock_data[udp_simple::mtu]; const octoclock_packet_t *pkt_in = reinterpret_cast<octoclock_packet_t*>(octoclock_data); UHD_OCTOCLOCK_SEND_AND_RECV(_udp, _proto_ver, SEND_POOLSIZE_CMD, pkt_out, len, octoclock_data); @@ -71,11 +71,11 @@ namespace uhd{ size_t len = 0; octoclock_packet_t pkt_out; - pkt_out.sequence = uhd::htonx<boost::uint32_t>(++_sequence); + pkt_out.sequence = uhd::htonx<uint32_t>(++_sequence); pkt_out.len = buf.size(); memcpy(pkt_out.data, buf.c_str(), buf.size()); - boost::uint8_t octoclock_data[udp_simple::mtu]; + uint8_t octoclock_data[udp_simple::mtu]; const octoclock_packet_t *pkt_in = reinterpret_cast<octoclock_packet_t*>(octoclock_data); UHD_OCTOCLOCK_SEND_AND_RECV(_udp, _proto_ver, HOST_SEND_TO_GPSDO_CMD, pkt_out, len, octoclock_data); @@ -116,7 +116,7 @@ namespace uhd{ pkt_out.len = 0; size_t len = 0; - boost::uint8_t octoclock_data[udp_simple::mtu]; + uint8_t octoclock_data[udp_simple::mtu]; const octoclock_packet_t *pkt_in = reinterpret_cast<octoclock_packet_t*>(octoclock_data); if(STATES_EQUAL){ @@ -124,7 +124,7 @@ namespace uhd{ boost::posix_time::time_duration age = time - _last_cache_update; bool cache_expired = (age > boost::posix_time::seconds(MAX_CACHE_AGE)); - pkt_out.sequence = uhd::htonx<boost::uint32_t>(++_sequence); + pkt_out.sequence = uhd::htonx<uint32_t>(++_sequence); UHD_OCTOCLOCK_SEND_AND_RECV(_udp, _proto_ver, SEND_GPSDO_CACHE_CMD, pkt_out, len, octoclock_data); if(UHD_OCTOCLOCK_PACKET_MATCHES(SEND_GPSDO_CACHE_ACK, pkt_out, pkt_in, len)){ memcpy(&_cache[0], pkt_in->data, _poolsize); @@ -132,7 +132,7 @@ namespace uhd{ _last_cache_update = time; } - boost::uint8_t delta_wraps = (_device_state.num_wraps - _state.num_wraps); + uint8_t delta_wraps = (_device_state.num_wraps - _state.num_wraps); if(cache_expired or delta_wraps > 1 or ((delta_wraps == 1) and (_device_state.pos > _state.pos))){ diff --git a/host/lib/usrp_clock/octoclock/octoclock_uart.hpp b/host/lib/usrp_clock/octoclock/octoclock_uart.hpp index d3a9738c4..390c202fe 100644 --- a/host/lib/usrp_clock/octoclock/octoclock_uart.hpp +++ b/host/lib/usrp_clock/octoclock/octoclock_uart.hpp @@ -40,13 +40,13 @@ public: private: uhd::transport::udp_simple::sptr _udp; - boost::uint16_t _poolsize; + uint16_t _poolsize; gpsdo_cache_state_t _state; gpsdo_cache_state_t _device_state; - std::vector<boost::uint8_t> _cache; + std::vector<uint8_t> _cache; std::string _rxbuff; - boost::uint32_t _sequence; - boost::uint32_t _proto_ver; + uint32_t _sequence; + uint32_t _proto_ver; boost::system_time _last_cache_update; void _update_cache(); diff --git a/host/lib/utils/ihex.cpp b/host/lib/utils/ihex.cpp index a29ac3e72..98f4fa760 100644 --- a/host/lib/utils/ihex.cpp +++ b/host/lib/utils/ihex.cpp @@ -59,9 +59,9 @@ static bool checksum(const std::string& record) */ static bool parse_record( const std::string& record, - boost::uint16_t &len, - boost::uint16_t &addr, - boost::uint16_t &type, + uint16_t &len, + uint16_t &addr, + uint16_t &type, unsigned char* data ) { unsigned int i; @@ -98,16 +98,16 @@ void ihex_reader::read(ihex_reader::record_handle_type record_handler) const char *filename = _ihex_filename.c_str(); /* Fields used in every record. */ - boost::uint16_t len = 0; - boost::uint16_t type = 0; - boost::uint16_t lower_address_bits = 0x0000; + uint16_t len = 0; + uint16_t type = 0; + uint16_t lower_address_bits = 0x0000; static const int MAX_RECORD_LENGTH = 255; unsigned char data[MAX_RECORD_LENGTH]; /* Can be set by the Intel HEX record 0x04, used for all 0x00 records * thereafter. Note this field takes the place of the 'index' parameter in * libusb calls, and is necessary for FX3's 32-bit addressing. */ - boost::uint16_t upper_address_bits = 0x0000; + uint16_t upper_address_bits = 0x0000; std::ifstream file; file.open(filename, std::ifstream::in); @@ -117,7 +117,7 @@ void ihex_reader::read(ihex_reader::record_handle_type record_handler) } while (!file.eof()) { - boost::int32_t ret = 0; + int32_t ret = 0; std::string record; file >> record; @@ -156,8 +156,8 @@ void ihex_reader::read(ihex_reader::record_handle_type record_handler) throw uhd::io_error("ihex_reader::read(): For ELA record, address must be 0, length must be 2."); } - upper_address_bits = ((boost::uint16_t)((data[0] & 0x00FF) << 8))\ - + ((boost::uint16_t)(data[1] & 0x00FF)); + upper_address_bits = ((uint16_t)((data[0] & 0x00FF) << 8))\ + + ((uint16_t)(data[1] & 0x00FF)); } /* Type 0x05: Start Linear Address Record. */ @@ -170,10 +170,10 @@ void ihex_reader::read(ihex_reader::record_handle_type record_handler) * to jump to an execution address start point, now contained within * the data field. Parse these address bits out, and then push the * instruction. */ - upper_address_bits = ((boost::uint16_t)((data[0] & 0x00FF) << 8))\ - + ((boost::uint16_t)(data[1] & 0x00FF)); - lower_address_bits = ((boost::uint16_t)((data[2] & 0x00FF) << 8))\ - + ((boost::uint16_t)(data[3] & 0x00FF)); + upper_address_bits = ((uint16_t)((data[0] & 0x00FF) << 8))\ + + ((uint16_t)(data[1] & 0x00FF)); + lower_address_bits = ((uint16_t)((data[2] & 0x00FF) << 8))\ + + ((uint16_t)(data[3] & 0x00FF)); record_handler(lower_address_bits, upper_address_bits, 0, 0); } @@ -192,7 +192,7 @@ void ihex_reader::read(ihex_reader::record_handle_type record_handler) int _file_writer_callback( boost::shared_ptr<std::ofstream> output_file, unsigned char *buff, - boost::uint16_t len + uint16_t len ) { output_file->write((const char *) buff, len); return 0; @@ -213,9 +213,9 @@ void ihex_reader::to_bin_file(const std::string &bin_filename) // We need a functor for the cast, a lambda would be perfect... int _vector_writer_callback( - std::vector<boost::uint8_t>& vector, + std::vector<uint8_t>& vector, unsigned char *buff, - boost::uint16_t len + uint16_t len ) { for (size_t i = 0; i < len; i++) { vector.push_back(buff[i]); @@ -224,9 +224,9 @@ int _vector_writer_callback( } #define DEFAULT_SIZE_ESTIMATE 8000000 -std::vector<boost::uint8_t> ihex_reader::to_vector(const size_t size_estimate) +std::vector<uint8_t> ihex_reader::to_vector(const size_t size_estimate) { - std::vector<boost::uint8_t> buf; + std::vector<uint8_t> buf; buf.reserve(size_estimate == 0 ? DEFAULT_SIZE_ESTIMATE : size_estimate); this->read(boost::bind(&_vector_writer_callback, boost::ref(buf), _3, _4)); diff --git a/host/lib/utils/ihex.hpp b/host/lib/utils/ihex.hpp index 9df1fcbc3..8a8f84b15 100644 --- a/host/lib/utils/ihex.hpp +++ b/host/lib/utils/ihex.hpp @@ -20,7 +20,7 @@ #include <boost/bind.hpp> #include <boost/function.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <string> #include <vector> @@ -30,7 +30,7 @@ class ihex_reader { public: // Arguments are: lower address bits, upper address bits, buff, length - typedef boost::function<int(boost::uint16_t,boost::uint16_t,unsigned char*,boost::uint16_t)> record_handle_type; + typedef boost::function<int(uint16_t,uint16_t,unsigned char*,uint16_t)> record_handle_type; /* * \param ihex_filename Path to the *.ihx file @@ -67,7 +67,7 @@ public: * * \throws uhd::io_error if the HEX file is corrupted or unreadable. */ - std::vector<boost::uint8_t> to_vector(const size_t size_estimate = 0); + std::vector<uint8_t> to_vector(const size_t size_estimate = 0); private: const std::string _ihex_filename; diff --git a/host/lib/utils/platform.cpp b/host/lib/utils/platform.cpp index a9cef663b..30f3337ac 100644 --- a/host/lib/utils/platform.cpp +++ b/host/lib/utils/platform.cpp @@ -26,15 +26,15 @@ namespace uhd { - boost::int32_t get_process_id() { + int32_t get_process_id() { #ifdef UHD_PLATFORM_WIN32 - return boost::int32_t(GetCurrentProcessId()); + return int32_t(GetCurrentProcessId()); #else - return boost::int32_t(getpid()); + return int32_t(getpid()); #endif } - boost::uint32_t get_host_id() { + uint32_t get_host_id() { #ifdef UHD_PLATFORM_WIN32 //extract volume serial number char szVolName[MAX_PATH+1], szFileSysName[MAX_PATH+1]; @@ -43,16 +43,16 @@ namespace uhd { &dwSerialNumber, &dwMaxComponentLen, &dwFileSysFlags, szFileSysName, sizeof(szFileSysName)); - return boost::uint32_t(dwSerialNumber); + return uint32_t(dwSerialNumber); #else - return boost::uint32_t(gethostid()); + return uint32_t(gethostid()); #endif } - boost::uint32_t get_process_hash() { + uint32_t get_process_hash() { size_t hash = 0; boost::hash_combine(hash, uhd::get_process_id()); boost::hash_combine(hash, uhd::get_host_id()); - return boost::uint32_t(hash); + return uint32_t(hash); } } diff --git a/host/lib/utils/tasks.cpp b/host/lib/utils/tasks.cpp index 6dbca5fc9..1e8f50736 100644 --- a/host/lib/utils/tasks.cpp +++ b/host/lib/utils/tasks.cpp @@ -115,7 +115,7 @@ public: * This might happen during shutdown when dtors are called. * See also: comments in b200_io_impl->handle_async_task */ - msg_payload_t get_msg_from_dump_queue(boost::uint32_t sid) + msg_payload_t get_msg_from_dump_queue(uint32_t sid) { boost::mutex::scoped_lock lock(_mutex); msg_payload_t b; diff --git a/host/tests/blockdef_test.cpp b/host/tests/blockdef_test.cpp index 2cd06a43a..11ddc4b59 100644 --- a/host/tests/blockdef_test.cpp +++ b/host/tests/blockdef_test.cpp @@ -17,7 +17,7 @@ #include <iostream> #include <map> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/assign/list_of.hpp> #include <boost/test/unit_test.hpp> #include <boost/format.hpp> @@ -27,7 +27,7 @@ using namespace uhd::rfnoc; BOOST_AUTO_TEST_CASE(test_lookup) { - std::map<boost::uint64_t, std::string> blocknames = boost::assign::list_of< std::pair<boost::uint64_t, std::string> > + std::map<uint64_t, std::string> blocknames = boost::assign::list_of< std::pair<uint64_t, std::string> > (0, "NullSrcSink") (0xFF70000000000000, "FFT") (0xF112000000000001, "FIR") @@ -38,7 +38,7 @@ BOOST_AUTO_TEST_CASE(test_lookup) { std::cout << blocknames.size() << std::endl; - for (std::map<boost::uint64_t, std::string>::iterator it = blocknames.begin(); it != blocknames.end(); ++it) { + for (std::map<uint64_t, std::string>::iterator it = blocknames.begin(); it != blocknames.end(); ++it) { std::cout << "Testing " << it->second << " => " << str(boost::format("%016X") % it->first) << std::endl; blockdef::sptr block_definition = blockdef::make_from_noc_id(it->first); // If the previous function fails, it'll return a NULL pointer diff --git a/host/tests/byteswap_test.cpp b/host/tests/byteswap_test.cpp index 7d94bbfba..ca5e0cb19 100644 --- a/host/tests/byteswap_test.cpp +++ b/host/tests/byteswap_test.cpp @@ -19,21 +19,21 @@ #include <uhd/utils/byteswap.hpp> BOOST_AUTO_TEST_CASE(test_byteswap16){ - boost::uint16_t x = 0x0123; - boost::uint16_t y = 0x2301; + uint16_t x = 0x0123; + uint16_t y = 0x2301; BOOST_CHECK_EQUAL(uhd::byteswap(x), y); } BOOST_AUTO_TEST_CASE(test_byteswap32){ - boost::uint32_t x = 0x01234567; - boost::uint32_t y = 0x67452301; + uint32_t x = 0x01234567; + uint32_t y = 0x67452301; BOOST_CHECK_EQUAL(uhd::byteswap(x), y); } BOOST_AUTO_TEST_CASE(test_byteswap64){ //split up 64 bit constants to avoid long-long compiler warnings - boost::uint64_t x = 0x01234567 | (boost::uint64_t(0x89abcdef) << 32); - boost::uint64_t y = 0xefcdab89 | (boost::uint64_t(0x67452301) << 32); + uint64_t x = 0x01234567 | (uint64_t(0x89abcdef) << 32); + uint64_t y = 0xefcdab89 | (uint64_t(0x67452301) << 32); BOOST_CHECK_EQUAL(uhd::byteswap(x), y); } diff --git a/host/tests/cast_test.cpp b/host/tests/cast_test.cpp index 6b8a4c527..1bd09e1a5 100644 --- a/host/tests/cast_test.cpp +++ b/host/tests/cast_test.cpp @@ -17,14 +17,14 @@ #include <iostream> #include <boost/test/unit_test.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <uhd/utils/cast.hpp> BOOST_AUTO_TEST_CASE(test_mac_addr){ std::string in = "0x0100"; - boost::uint16_t correct_result = 256; - boost::uint16_t x = uhd::cast::hexstr_cast<boost::uint16_t>(in); - //boost::uint16_t x = uhd::cast::hexstr_cast(in); + uint16_t correct_result = 256; + uint16_t x = uhd::cast::hexstr_cast<uint16_t>(in); + //uint16_t x = uhd::cast::hexstr_cast(in); std::cout << "Testing hex -> uint16_t conversion. " << in << " == " << std::hex << x << "?" << std::endl; diff --git a/host/tests/chdr_test.cpp b/host/tests/chdr_test.cpp index f48073a09..cdad7f35e 100644 --- a/host/tests/chdr_test.cpp +++ b/host/tests/chdr_test.cpp @@ -28,7 +28,7 @@ static void pack_and_unpack( if_packet_info_t &if_packet_info_in ){ // Temp buffer for packed packet - boost::uint32_t packet_buff[2048] = {0}; + uint32_t packet_buff[2048] = {0}; // Check input (must not be lazy) BOOST_REQUIRE( @@ -46,7 +46,7 @@ static void pack_and_unpack( packet_buff, if_packet_info_in ); std::cout << std::endl; - boost::uint32_t header_bits = (uhd::ntohx(packet_buff[0]) >> 28); + uint32_t header_bits = (uhd::ntohx(packet_buff[0]) >> 28); std::cout << boost::format("header bits = 0b%d%d%d%d") % ((header_bits & 8) > 0) % ((header_bits & 4) > 0) % ((header_bits & 2) > 0) diff --git a/host/tests/convert_test.cpp b/host/tests/convert_test.cpp index 84e7480a6..b5f63bcbb 100644 --- a/host/tests/convert_test.cpp +++ b/host/tests/convert_test.cpp @@ -18,7 +18,7 @@ #include <uhd/convert.hpp> #include <boost/test/unit_test.hpp> #include <boost/foreach.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/assign/list_of.hpp> #include <complex> #include <vector> @@ -28,7 +28,7 @@ using namespace uhd; //typedefs for complex types -typedef std::complex<boost::int16_t> sc16_t; +typedef std::complex<int16_t> sc16_t; typedef std::complex<float> fc32_t; typedef std::complex<double> fc64_t; @@ -51,7 +51,7 @@ template <typename Range> static void loopback( const int prio_out = -1 ){ //make this buffer large enough for all test types - std::vector<boost::uint64_t> interm(nsamps); + std::vector<uint64_t> interm(nsamps); std::vector<const void *> input0(1, &input[0]), input1(1, &interm[0]); std::vector<void *> output0(1, &interm[0]), output1(1, &output[0]); @@ -288,7 +288,7 @@ BOOST_AUTO_TEST_CASE(test_convert_types_fc32_to_sc16){ (std::rand()/float(RAND_MAX/2)) - 1, (std::rand()/float(RAND_MAX/2)) - 1 ); - std::vector<boost::uint32_t> interm(nsamps); + std::vector<uint32_t> interm(nsamps); std::vector<sc16_t> output(nsamps); std::vector<const void *> input0(1, &input[0]), input1(1, &interm[0]); @@ -333,7 +333,7 @@ BOOST_AUTO_TEST_CASE(test_convert_types_sc16_to_fc32){ std::rand()-(RAND_MAX/2), std::rand()-(RAND_MAX/2) ); - std::vector<boost::uint32_t> interm(nsamps); + std::vector<uint32_t> interm(nsamps); std::vector<fc32_t> output(nsamps); std::vector<const void *> input0(1, &input[0]), input1(1, &interm[0]); @@ -423,10 +423,10 @@ static void test_convert_types_u8( size_t nsamps, convert::id_type &id ){ //fill the input samples - std::vector<boost::uint8_t> input(nsamps), output(nsamps); - BOOST_FOREACH(boost::uint8_t &in, input) in = boost::uint8_t(std::rand() & 0xFF); - //boost::uint32_t d = 48; - //BOOST_FOREACH(boost::uint8_t &in, input) in = d++; + std::vector<uint8_t> input(nsamps), output(nsamps); + BOOST_FOREACH(uint8_t &in, input) in = uint8_t(std::rand() & 0xFF); + //uint32_t d = 48; + //BOOST_FOREACH(uint8_t &in, input) in = d++; //run the loopback and test convert::id_type in_id = id; @@ -463,8 +463,8 @@ static void test_convert_types_s8( size_t nsamps, convert::id_type &id ){ //fill the input samples - std::vector<boost::int8_t> input(nsamps), output(nsamps); - BOOST_FOREACH(boost::int8_t &in, input) in = boost::int8_t(std::rand() & 0xFF); + std::vector<int8_t> input(nsamps), output(nsamps); + BOOST_FOREACH(int8_t &in, input) in = int8_t(std::rand() & 0xFF); //run the loopback and test convert::id_type in_id = id; @@ -501,8 +501,8 @@ static void test_convert_types_s16( size_t nsamps, convert::id_type &id ){ //fill the input samples - std::vector<boost::int16_t> input(nsamps), output(nsamps); - BOOST_FOREACH(boost::int16_t &in, input) in = boost::int16_t(std::rand() & 0xFFFF); + std::vector<int16_t> input(nsamps), output(nsamps); + BOOST_FOREACH(int16_t &in, input) in = int16_t(std::rand() & 0xFFFF); //run the loopback and test convert::id_type in_id = id; diff --git a/host/tests/device3_test.cpp b/host/tests/device3_test.cpp index 593facb9a..657436717 100644 --- a/host/tests/device3_test.cpp +++ b/host/tests/device3_test.cpp @@ -27,7 +27,7 @@ using namespace uhd; using namespace uhd::rfnoc; -static const boost::uint64_t TEST_NOC_ID = 0xAAAABBBBCCCCDDDD; +static const uint64_t TEST_NOC_ID = 0xAAAABBBBCCCCDDDD; static const sid_t TEST_SID0 = 0x00000200; // 0.0.2.0 static const sid_t TEST_SID1 = 0x00000210; // 0.0.2.F @@ -38,11 +38,11 @@ class pseudo_wb_iface_impl : public uhd::wb_iface pseudo_wb_iface_impl() {}; ~pseudo_wb_iface_impl() {}; - void poke64(const wb_addr_type addr, const boost::uint64_t data) { + void poke64(const wb_addr_type addr, const uint64_t data) { std::cout << str(boost::format("[PSEUDO] poke64 to addr: %016X, data == %016X") % addr % data) << std::endl; }; - boost::uint64_t peek64(const wb_addr_type addr) { + uint64_t peek64(const wb_addr_type addr) { std::cout << str(boost::format("[PSEUDO] peek64 to addr: %016X") % addr) << std::endl; switch (addr) { case SR_READBACK_REG_ID: @@ -57,11 +57,11 @@ class pseudo_wb_iface_impl : public uhd::wb_iface return 0; } - void poke32(const wb_addr_type addr, const boost::uint32_t data) { + void poke32(const wb_addr_type addr, const uint32_t data) { std::cout << str(boost::format("poke32 to addr: %08X, data == %08X") % addr % data) << std::endl; } - boost::uint32_t peek32(const wb_addr_type addr) { + uint32_t peek32(const wb_addr_type addr) { std::cout << str(boost::format("peek32 to addr: %08X") % addr) << std::endl; return 0; } diff --git a/host/tests/math_test.cpp b/host/tests/math_test.cpp index 6c890c484..8a92e074f 100644 --- a/host/tests/math_test.cpp +++ b/host/tests/math_test.cpp @@ -16,7 +16,7 @@ // #include <boost/test/unit_test.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <uhd/utils/math.hpp> // NOTE: This is not the only math test case, see e.g. special tests diff --git a/host/tests/sph_recv_test.cpp b/host/tests/sph_recv_test.cpp index a22e7a7c2..e10926834 100644 --- a/host/tests/sph_recv_test.cpp +++ b/host/tests/sph_recv_test.cpp @@ -72,18 +72,18 @@ public: void push_back_packet( uhd::transport::vrt::if_packet_info_t &ifpi, - const boost::uint32_t optional_msg_word = 0 + const uint32_t optional_msg_word = 0 ){ - const size_t max_pkt_len = (ifpi.num_payload_words32 + uhd::transport::vrt::max_if_hdr_words32 + 1/*tlr*/)*sizeof(boost::uint32_t); + const size_t max_pkt_len = (ifpi.num_payload_words32 + uhd::transport::vrt::max_if_hdr_words32 + 1/*tlr*/)*sizeof(uint32_t); _mems.push_back(boost::shared_array<char>(new char[max_pkt_len])); if (_end == "big"){ - uhd::transport::vrt::if_hdr_pack_be(reinterpret_cast<boost::uint32_t *>(_mems.back().get()), ifpi); + uhd::transport::vrt::if_hdr_pack_be(reinterpret_cast<uint32_t *>(_mems.back().get()), ifpi); } if (_end == "little"){ - uhd::transport::vrt::if_hdr_pack_le(reinterpret_cast<boost::uint32_t *>(_mems.back().get()), ifpi); + uhd::transport::vrt::if_hdr_pack_le(reinterpret_cast<uint32_t *>(_mems.back().get()), ifpi); } - (reinterpret_cast<boost::uint32_t *>(_mems.back().get()) + ifpi.num_header_words32)[0] = optional_msg_word | uhd::byteswap(optional_msg_word); - _lens.push_back(ifpi.num_packet_words32*sizeof(boost::uint32_t)); + (reinterpret_cast<uint32_t *>(_mems.back().get()) + ifpi.num_header_words32)[0] = optional_msg_word | uhd::byteswap(optional_msg_word); + _lens.push_back(ifpi.num_packet_words32*sizeof(uint32_t)); } uhd::transport::managed_recv_buffer::sptr get_recv_buff(double){ diff --git a/host/tests/sph_send_test.cpp b/host/tests/sph_send_test.cpp index 9cd195c7e..39c7429db 100644 --- a/host/tests/sph_send_test.cpp +++ b/host/tests/sph_send_test.cpp @@ -56,12 +56,12 @@ public: void pop_front_packet( uhd::transport::vrt::if_packet_info_t &ifpi ){ - ifpi.num_packet_words32 = _lens.front()/sizeof(boost::uint32_t); + ifpi.num_packet_words32 = _lens.front()/sizeof(uint32_t); if (_end == "big"){ - uhd::transport::vrt::if_hdr_unpack_be(reinterpret_cast<boost::uint32_t *>(_mems.front().get()), ifpi); + uhd::transport::vrt::if_hdr_unpack_be(reinterpret_cast<uint32_t *>(_mems.front().get()), ifpi); } if (_end == "little"){ - uhd::transport::vrt::if_hdr_unpack_le(reinterpret_cast<boost::uint32_t *>(_mems.front().get()), ifpi); + uhd::transport::vrt::if_hdr_unpack_le(reinterpret_cast<uint32_t *>(_mems.front().get()), ifpi); } _mems.pop_front(); _lens.pop_front(); diff --git a/host/tests/time_spec_test.cpp b/host/tests/time_spec_test.cpp index b98bea7d9..76dfb1930 100644 --- a/host/tests/time_spec_test.cpp +++ b/host/tests/time_spec_test.cpp @@ -21,6 +21,7 @@ #include <boost/thread.hpp> //sleep #include <iostream> #include <iomanip> +#include <stdint.h> BOOST_AUTO_TEST_CASE(test_time_spec_compare){ std::cout << "Testing time specification compare..." << std::endl; @@ -102,7 +103,7 @@ BOOST_AUTO_TEST_CASE(test_time_spec_neg_values){ BOOST_AUTO_TEST_CASE(test_time_large_ticks_to_time_spec) { std::cout << "sizeof(time_t) " << sizeof(time_t) << std::endl; - const boost::uint64_t ticks0 = boost::uint64_t(100e6*1360217663.739296); + const uint64_t ticks0 = uint64_t(100e6*1360217663.739296); const uhd::time_spec_t t0 = uhd::time_spec_t::from_ticks(ticks0, 100e6); std::cout << "t0.get_real_secs() " << t0.get_real_secs() << std::endl; std::cout << "t0.get_full_secs() " << t0.get_full_secs() << std::endl; diff --git a/host/tests/vrt_test.cpp b/host/tests/vrt_test.cpp index 62284b239..f9dc5aafa 100644 --- a/host/tests/vrt_test.cpp +++ b/host/tests/vrt_test.cpp @@ -29,9 +29,9 @@ static void pack_and_unpack( ){ if (if_packet_info_in.num_payload_bytes == 0) { - if_packet_info_in.num_payload_bytes = if_packet_info_in.num_payload_words32 * sizeof(boost::uint32_t); + if_packet_info_in.num_payload_bytes = if_packet_info_in.num_payload_words32 * sizeof(uint32_t); } - boost::uint32_t packet_buff[2048]; + uint32_t packet_buff[2048]; //pack metadata into a vrt header vrt::if_hdr_pack_be( diff --git a/host/utils/b2xx_fx3_utils.cpp b/host/utils/b2xx_fx3_utils.cpp index a6896c868..89794ed84 100644 --- a/host/utils/b2xx_fx3_utils.cpp +++ b/host/utils/b2xx_fx3_utils.cpp @@ -26,7 +26,7 @@ #include <cmath> #include <cstring> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/filesystem.hpp> #include <boost/lexical_cast.hpp> #include <boost/format.hpp> |