8 #ifndef USRP_SERVER_SETTING_IMPORTED 9 #define USRP_SERVER_SETTING_IMPORTED 11 #include <sys/prctl.h> 15 #include <sys/socket.h> 29 #include <uhd/utils/thread.hpp> 30 #include <uhd/utils/safe_main.hpp> 31 #include <uhd/utils/static.hpp> 32 #include <uhd/exception.hpp> 33 #include <uhd/usrp/multi_usrp.hpp> 35 #include <boost/math/special_functions/round.hpp> 36 #include <boost/format.hpp> 37 #include <boost/lexical_cast.hpp> 38 #include <boost/algorithm/string.hpp> 39 #include <boost/atomic.hpp> 40 #include <boost/filesystem.hpp> 41 #include <boost/asio.hpp> 42 #include <boost/asio/use_future.hpp> 43 #include <boost/array.hpp> 44 #include <boost/lockfree/queue.hpp> 45 #include <boost/lockfree/spsc_queue.hpp> 46 #include <boost/timer/timer.hpp> 47 #include <boost/property_tree/json_parser.hpp> 48 #include <boost/exception/diagnostic_information.hpp> 49 #include <boost/date_time/posix_time/posix_time.hpp> 50 #include <boost/asio/basic_deadline_timer.hpp> 51 #include <boost/thread/thread.hpp> 53 #define BOOST_LOG_DYN_LINK 1 54 #include <boost/log/core.hpp> 55 #include <boost/log/trivial.hpp> 56 #include <boost/log/expressions.hpp> 57 #include <boost/log/sinks/text_file_backend.hpp> 58 #include <boost/log/utility/setup/file.hpp> 59 #include <boost/log/utility/setup/common_attributes.hpp> 60 #include <boost/log/sources/severity_logger.hpp> 61 #include <boost/log/sources/record_ostream.hpp> 63 namespace logging = boost::log;
64 namespace src = boost::log::sources;
65 namespace sinks = boost::log::sinks;
66 namespace keywords = boost::log::keywords;
67 using namespace logging::trivial;
71 #include <cuda_runtime.h> 75 #define OFFSET_F 0//100000000 82 #define RX_QUEUE_LENGTH 100 85 #define TX_QUEUE_LENGTH 100 88 #define ERROR_QUEUE_LENGTH 1000 89 #define STREAM_QUEUE_LENGTH 1000 92 #define SW_LOOP_QUEUE_LENGTH 100 93 #define SECONDARY_STREAM_QUEUE_LENGTH 100 //between the stream and the filewriter (keep it long if writing files) 96 #define ADDITIONAL_FILTER_FCUT 0.2 99 #define MAX_USEFULL_BUFFER 6000000 100 #define MIN_USEFULL_BUFFER 50000 102 #define DEFAULT_BUFFER_LEN 1000000 113 enum w_type { TONES, CHIRP, NOISE , RAMP, NODSP, SWONLY, DIRECT};
122 enum ant_mode { TX, RX, OFF };
146 std::vector<int> freq;
147 std::vector<w_type> wave_type;
148 std::vector<float> ampl;
150 std::vector<float> chirp_t;
151 std::vector<int> chirp_f;
152 std::vector<int> swipe_s;
154 size_t data_mem_mult;
162 int get_output_buffer_size();
165 bool dynamic_buffer();
180 int get_number(ant_mode T);
190 struct server_settings{
193 std::string clock_reference;
196 int GPU_device_index;
199 int default_rx_buffer_len;
200 int default_tx_buffer_len;
229 typedef boost::lockfree::queue< RX_wrapper, boost::lockfree::fixed_sized<(bool)true>> rx_queue;
230 typedef boost::lockfree::queue< float2*, boost::lockfree::fixed_sized<(bool)true>> tx_queue;
231 typedef boost::lockfree::queue< int, boost::lockfree::fixed_sized<(bool)true>> error_queue;
235 void Thread_Prioriry(boost::thread& Thread,
int priority,
int affinity);
240 void SetThreadName(boost::thread* thread,
const char* threadName);
std::string device_arguments
std::string ant_mode_to_str(ant_mode enumerator)
std::string get_front_end_name(char code)
void SetThreadName(boost::thread *thread, const char *threadName)
std::string w_type_to_str(w_type enumerator)
void Thread_Prioriry(boost::thread &Thread, int priority, int affinity)
ant_mode ant_mode_from_string(std::string str)
w_type string_to_w_type(std::string input_string)
std::vector< w_type > string_to_w_type_vector(std::vector< std::string > string_vector)