diff options
author | Ashish Chaudhari <ashish@ettus.com> | 2014-04-24 12:40:58 -0700 |
---|---|---|
committer | Ashish Chaudhari <ashish@ettus.com> | 2014-04-24 12:40:58 -0700 |
commit | 4b4e493f976094115dad7809121a092e2ac31668 (patch) | |
tree | 9eef93cca3bda2183059d2812f36c6c061c32958 /host/include | |
parent | 8f46b048818ba107126910159c76453cfb2025e2 (diff) | |
download | uhd-4b4e493f976094115dad7809121a092e2ac31668.tar.gz uhd-4b4e493f976094115dad7809121a092e2ac31668.tar.bz2 uhd-4b4e493f976094115dad7809121a092e2ac31668.zip |
x300: Added hardware flush mechanism to PCIe logic.
- Added DMA enabled states to DMA logic to allow for hardware data flushing during init.
- niusrprio_session will now check for FPGA busy before downloading
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/transport/nirio/niriok_proxy.h | 2 | ||||
-rw-r--r-- | host/include/uhd/transport/nirio/niusrprio_session.h | 71 |
2 files changed, 38 insertions, 35 deletions
diff --git a/host/include/uhd/transport/nirio/niriok_proxy.h b/host/include/uhd/transport/nirio/niriok_proxy.h index a6b6183d1..ca6a4ba02 100644 --- a/host/include/uhd/transport/nirio/niriok_proxy.h +++ b/host/include/uhd/transport/nirio/niriok_proxy.h @@ -126,6 +126,8 @@ namespace uhd { namespace niusrprio nirio_status unmap_fifo_memory( nirio_driver_iface::rio_mmap_t& map); + nirio_status stop_all_fifos(); + nirio_quirks& get_rio_quirks() { return _rio_quirks; } diff --git a/host/include/uhd/transport/nirio/niusrprio_session.h b/host/include/uhd/transport/nirio/niusrprio_session.h index c9a61ae76..c84bc75d0 100644 --- a/host/include/uhd/transport/nirio/niusrprio_session.h +++ b/host/include/uhd/transport/nirio/niusrprio_session.h @@ -37,31 +37,31 @@ public: typedef uhd::usrprio_rpc::usrprio_device_info device_info; typedef uhd::usrprio_rpc::usrprio_device_info_vtr device_info_vtr; - static nirio_status enumerate( + static nirio_status enumerate( const std::string& rpc_port_name, device_info_vtr& device_info_vtr); - niusrprio_session( + niusrprio_session( const std::string& resource_name, const std::string& port_name); - virtual ~niusrprio_session(); + virtual ~niusrprio_session(); - nirio_status open( + nirio_status open( nifpga_lvbitx::sptr lvbitx, bool force_download = false); - void close(bool skip_reset = false); + void close(bool skip_reset = false); - nirio_status reset(); + nirio_status reset(); - template<typename data_t> - nirio_status create_tx_fifo( - const char* fifo_name, - boost::shared_ptr< nirio_fifo<data_t> >& fifo) - { + template<typename data_t> + nirio_status create_tx_fifo( + const char* fifo_name, + boost::shared_ptr< nirio_fifo<data_t> >& fifo) + { if (!_session_open) return NiRio_Status_ResourceNotInitialized; return _resource_manager.create_tx_fifo(fifo_name, fifo); - } + } template<typename data_t> nirio_status create_tx_fifo( @@ -73,13 +73,13 @@ public: } template<typename data_t> - nirio_status create_rx_fifo( - const char* fifo_name, - boost::shared_ptr< nirio_fifo<data_t> >& fifo) - { + nirio_status create_rx_fifo( + const char* fifo_name, + boost::shared_ptr< nirio_fifo<data_t> >& fifo) + { if (!_session_open) return NiRio_Status_ResourceNotInitialized; return _resource_manager.create_rx_fifo(fifo_name, fifo); - } + } template<typename data_t> nirio_status create_rx_fifo( @@ -90,9 +90,9 @@ public: return create_rx_fifo(_lvbitx->get_input_fifo_names()[fifo_instance], fifo); } - niriok_proxy& get_kernel_proxy() { - return _riok_proxy; - } + niriok_proxy& get_kernel_proxy() { + return _riok_proxy; + } nirio_status download_bitstream_to_flash(const std::string& bitstream_path); @@ -102,21 +102,22 @@ public: const std::string& rpc_port_name); private: - nirio_status _verify_signature(); - std::string _read_bitstream_checksum(); - nirio_status _write_bitstream_checksum(const std::string& checksum); - nirio_status _wait_for_device_available(); - - std::string _resource_name; - nifpga_lvbitx::sptr _lvbitx; - std::string _interface_path; - bool _session_open; - niriok_proxy _riok_proxy; - nirio_resource_manager _resource_manager; - usrprio_rpc::usrprio_rpc_client _rpc_client; - boost::recursive_mutex _session_mutex; - - static const uint32_t SESSION_LOCK_TIMEOUT_IN_MS = 3000; + nirio_status _verify_signature(); + std::string _read_bitstream_checksum(); + nirio_status _write_bitstream_checksum(const std::string& checksum); + nirio_status _ensure_fpga_ready(); + + std::string _resource_name; + nifpga_lvbitx::sptr _lvbitx; + std::string _interface_path; + bool _session_open; + niriok_proxy _riok_proxy; + nirio_resource_manager _resource_manager; + usrprio_rpc::usrprio_rpc_client _rpc_client; + boost::recursive_mutex _session_mutex; + + static const uint32_t FPGA_READY_TIMEOUT_IN_MS = 1000; + static const uint32_t SESSION_LOCK_TIMEOUT_IN_MS = 3000; static const uint32_t SESSION_LOCK_RETRY_INT_IN_MS = 500; }; |