19 #ifndef INCLUDED_UHD_TRANSPORT_NIRIO_NIUSRPRIO_SESSION_H 20 #define INCLUDED_UHD_TRANSPORT_NIRIO_NIUSRPRIO_SESSION_H 27 #include <boost/noncopyable.hpp> 28 #include <boost/smart_ptr.hpp> 29 #include <boost/thread/recursive_mutex.hpp> 32 namespace uhd {
namespace niusrprio {
37 typedef boost::shared_ptr<niusrprio_session>
sptr;
42 const std::string& rpc_port_name,
43 device_info_vtr& device_info_vtr);
46 const std::string& resource_name,
47 const std::string& port_name);
52 bool force_download =
false);
54 void close(
bool skip_reset =
false);
58 template<
typename data_t>
60 const char* fifo_name,
63 if (!_session_open)
return NiRio_Status_ResourceNotInitialized;
64 return _resource_manager.create_tx_fifo(fifo_name, fifo);
67 template<
typename data_t>
69 uint32_t fifo_instance,
72 if ((
size_t)fifo_instance >= _lvbitx->get_output_fifo_count())
return NiRio_Status_InvalidParameter;
73 return create_tx_fifo(_lvbitx->get_output_fifo_names()[fifo_instance], fifo);
76 template<
typename data_t>
78 const char* fifo_name,
81 if (!_session_open)
return NiRio_Status_ResourceNotInitialized;
82 return _resource_manager.create_rx_fifo(fifo_name, fifo);
85 template<
typename data_t>
87 uint32_t fifo_instance,
90 if ((
size_t)fifo_instance >= _lvbitx->get_input_fifo_count())
return NiRio_Status_InvalidParameter;
91 return create_rx_fifo(_lvbitx->get_input_fifo_names()[fifo_instance], fifo);
98 nirio_status download_bitstream_to_flash(
const std::string& bitstream_path);
102 const std::string& resource_name,
103 const std::string& rpc_port_name);
107 std::string _read_bitstream_checksum();
108 nirio_status _write_bitstream_checksum(
const std::string& checksum);
111 std::string _resource_name;
113 std::string _interface_path;
118 boost::recursive_mutex _session_mutex;
120 static const uint32_t FPGA_READY_TIMEOUT_IN_MS = 1000;
121 static const uint32_t SESSION_LOCK_TIMEOUT_IN_MS = 3000;
122 static const uint32_t SESSION_LOCK_RETRY_INT_IN_MS = 500;
Definition: nirio_resource_manager.h:58
Definition: usrprio_rpc_common.hpp:39
boost::shared_ptr< niriok_proxy > sptr
Definition: niriok_proxy.h:168
boost::shared_ptr< nifpga_lvbitx > sptr
Definition: nifpga_lvbitx.h:29
uhd::usrprio_rpc::usrprio_device_info_vtr device_info_vtr
Definition: niusrprio_session.h:39
#define UHD_API
Definition: config.hpp:79
Definition: convert.hpp:28
#define UHD_INLINE
Definition: config.hpp:69
uhd::usrprio_rpc::usrprio_device_info device_info
Definition: niusrprio_session.h:38
int32_t nirio_status
Definition: status.h:31
nirio_status create_tx_fifo(const char *fifo_name, boost::shared_ptr< nirio_fifo< data_t > > &fifo)
Definition: niusrprio_session.h:59
boost::shared_ptr< niusrprio_session > sptr
Definition: niusrprio_session.h:37
nirio_status create_rx_fifo(const char *fifo_name, boost::shared_ptr< nirio_fifo< data_t > > &fifo)
Definition: niusrprio_session.h:77
std::vector< usrprio_device_info > usrprio_device_info_vtr
Definition: usrprio_rpc_common.hpp:56
UHD_INLINE niriok_proxy::sptr get_kernel_proxy()
Definition: niusrprio_session.h:94
Definition: niusrprio_session.h:34
nirio_status create_rx_fifo(uint32_t fifo_instance, boost::shared_ptr< nirio_fifo< data_t > > &fifo)
Definition: niusrprio_session.h:86
Definition: usrprio_rpc_client.hpp:28
Definition: nirio_fifo.h:41
nirio_status create_tx_fifo(uint32_t fifo_instance, boost::shared_ptr< nirio_fifo< data_t > > &fifo)
Definition: niusrprio_session.h:68