Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
sync repos
  • Loading branch information
Clément BRUGUERA committed Dec 3, 2020
2 parents e490d2c + 20ab77f commit b82daad
Show file tree
Hide file tree
Showing 23 changed files with 262 additions and 77 deletions.
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
umtrx (1.0.19) bionic; urgency=medium

* library now supports python3
* updated for latest UHD/libboost

-- Kirill Zakharenko <kirill.zakharenko@fairwaves.co> Tue, 26 May 2020 07:48:32 +0300

umtrx (1.0.18) bionic; urgency=medium

* umtrx status monitor now binds to localhost instead of 0.0.0.0
Expand Down
1 change: 1 addition & 0 deletions debian/umtrx.install
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
usr/bin
images/u2plus_umtrx_v2.bin images/umtrx_txrx_uhd.bin usr/share/umtrx/firmware
host/utils/umtrx_property_tree.py host/utils/umtrx_vswr.py usr/lib/python2.7/dist-packages
host/utils/umtrx_property_tree.py host/utils/umtrx_vswr.py usr/lib/python3/dist-packages
14 changes: 14 additions & 0 deletions host/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@ list(APPEND UMTRX_LIBRARIES ${UHD_LIBRARIES})
MESSAGE(STATUS "UHD include directories: ${UHD_INCLUDE_DIRS}")
MESSAGE(STATUS "UHD libraries: ${UHD_LIBRARIES}")

if (EXISTS "${UHD_INCLUDE_DIRS}/uhd/utils/msg.hpp")
add_definitions(-DUHD_HAS_MSG_HPP)
message(STATUS " use msg.hpp for logging")
else()
message(STATUS " use log.hpp for logging")
endif()

if (EXISTS "${UHD_INCLUDE_DIRS}/uhd/utils/thread.hpp")
add_definitions(-DTHREAD_PRIORITY_HPP_DEPRECATED)
message(STATUS " use thread.hpp (new interface)")
else()
message(STATUS " use thread_priority.hpp (old interface)")
endif()

########################################################################
# Setup Boost
########################################################################
Expand Down
2 changes: 1 addition & 1 deletion host/cores/apply_corrections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "apply_corrections.hpp"
#include <uhd/usrp/dboard_eeprom.hpp>
#include <uhd/utils/paths.hpp>
#include <uhd/utils/msg.hpp>
#include "umtrx_log_adapter.hpp"
#include <uhd/utils/csv.hpp>
#include <uhd/types/dict.hpp>
#include <boost/filesystem.hpp>
Expand Down
8 changes: 4 additions & 4 deletions host/cores/async_packet_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <uhd/transport/vrt_if_packet.hpp>
#include <uhd/types/metadata.hpp>
#include <uhd/utils/byteswap.hpp>
#include <uhd/utils/msg.hpp>
#include "umtrx_log_adapter.hpp"

namespace uhd{ namespace usrp{

Expand Down Expand Up @@ -55,14 +55,14 @@ namespace uhd{ namespace usrp{
if (metadata.event_code &
( async_metadata_t::EVENT_CODE_UNDERFLOW
| async_metadata_t::EVENT_CODE_UNDERFLOW_IN_PACKET)
) UHD_MSG(fastpath) << "U";
) {UHD_LOG_FASTPATH("U");}
else if (metadata.event_code &
( async_metadata_t::EVENT_CODE_SEQ_ERROR
| async_metadata_t::EVENT_CODE_SEQ_ERROR_IN_BURST)
) UHD_MSG(fastpath) << "S";
) {UHD_LOG_FASTPATH("S");}
else if (metadata.event_code &
async_metadata_t::EVENT_CODE_TIME_ERROR
) UHD_MSG(fastpath) << "L";
) {UHD_LOG_FASTPATH("L");}
}


Expand Down
2 changes: 1 addition & 1 deletion host/cores/rx_dsp_core_200.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "rx_dsp_core_200.hpp"
#include <uhd/types/dict.hpp>
#include <uhd/exception.hpp>
#include <uhd/utils/msg.hpp>
#include "umtrx_log_adapter.hpp"
#include <uhd/utils/safe_call.hpp>
#include <uhd/utils/algorithm.hpp>
#include <boost/assign/list_of.hpp>
Expand Down
21 changes: 3 additions & 18 deletions host/cores/super_recv_packet_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
#include <uhd/exception.hpp>
#include <uhd/convert.hpp>
#include <uhd/stream.hpp>
#include <uhd/utils/msg.hpp>
#include "umtrx_log_adapter.hpp"
#include <uhd/utils/tasks.hpp>
#include <uhd/utils/atomic.hpp>
#include <uhd/utils/byteswap.hpp>
#include <uhd/types/metadata.hpp>
#include <uhd/transport/vrt_if_packet.hpp>
Expand Down Expand Up @@ -92,22 +91,14 @@ class recv_packet_handler{
}

~recv_packet_handler(void){
_task_barrier.interrupt();
_task_handlers.clear();
}

//! Resize the number of transport channels
void resize(const size_t size){
if (this->size() == size) return;
_task_handlers.clear();
_props.resize(size);
//re-initialize all buffers infos by re-creating the vector
_buffers_infos = std::vector<buffers_info_type>(4, buffers_info_type(size));
_task_barrier.resize(size);
_task_handlers.resize(size);
for (size_t i = 1/*skip 0*/; i < size; i++){
//_task_handlers[i] = task::make(boost::bind(&recv_packet_handler::converter_thread_task, this, i));
};
}

//! Get the channel width of this handler
Expand Down Expand Up @@ -559,7 +550,7 @@ class recv_packet_handler{
rx_metadata_t metadata = curr_info.metadata;
_props[index].handle_overflow();
curr_info.metadata = metadata;
UHD_MSG(fastpath) << "O";
UHD_LOG_FASTPATH("O");
}
return;

Expand All @@ -576,7 +567,7 @@ class recv_packet_handler{
prev_info[index].ifpi.num_payload_words32*sizeof(boost::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";
UHD_LOG_FASTPATH("D");
return;

}
Expand Down Expand Up @@ -666,8 +657,6 @@ class recv_packet_handler{
******************************************************************/
UHD_INLINE void converter_thread_task(const size_t index)
{
//_task_barrier.wait();

//shortcut references to local data structures
buffers_info_type &buff_info = get_curr_buffer_info();
per_buffer_info_type &info = buff_info[index];
Expand All @@ -691,13 +680,9 @@ class recv_packet_handler{
if (buff_info.data_bytes_to_copy == _convert_bytes_to_copy){
info.buff.reset(); //effectively a release
}

//if (index == 0) _task_barrier.wait_others();
}

//! Shared variables for the worker threads
reusable_barrier _task_barrier;
std::vector<task::sptr> _task_handlers;
size_t _convert_nsamps;
const rx_streamer::buffs_type *_convert_buffs;
size_t _convert_buffer_offset_bytes;
Expand Down
17 changes: 1 addition & 16 deletions host/cores/super_send_packet_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
#include <uhd/exception.hpp>
#include <uhd/convert.hpp>
#include <uhd/stream.hpp>
#include <uhd/utils/msg.hpp>
#include "umtrx_log_adapter.hpp"
#include <uhd/utils/tasks.hpp>
#include <uhd/utils/atomic.hpp>
#include <uhd/utils/byteswap.hpp>
#include <uhd/types/metadata.hpp>
#include <uhd/transport/vrt_if_packet.hpp>
Expand Down Expand Up @@ -74,22 +73,14 @@ class send_packet_handler{
}

~send_packet_handler(void){
_task_barrier.interrupt();
_task_handlers.clear();
}

//! Resize the number of transport channels
void resize(const size_t size){
if (this->size() == size) return;
_task_handlers.clear();
_props.resize(size);
static const boost::uint64_t zero = 0;
_zero_buffs.resize(size, &zero);
_task_barrier.resize(size);
_task_handlers.resize(size);
for (size_t i = 1/*skip 0*/; i < size; i++){
//_task_handlers[i] = task::make(boost::bind(&send_packet_handler::converter_thread_task, this, i));
};
}

//! Get the channel width of this handler
Expand Down Expand Up @@ -390,8 +381,6 @@ class send_packet_handler{
******************************************************************/
UHD_INLINE void converter_thread_task(const size_t index)
{
//_task_barrier.wait();

//shortcut references to local data structures
managed_send_buffer::sptr &buff = _props[index].buff;
vrt::if_packet_info_t if_packet_info = *_convert_if_packet_info;
Expand Down Expand Up @@ -419,13 +408,9 @@ class send_packet_handler{
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.reset(); //effectively a release

//if (index == 0) _task_barrier.wait_others();
}

//! Shared variables for the worker threads
reusable_barrier _task_barrier;
std::vector<task::sptr> _task_handlers;
size_t _convert_nsamps;
const tx_streamer::buffs_type *_convert_buffs;
size_t _convert_buffer_offset_bytes;
Expand Down
2 changes: 1 addition & 1 deletion host/cores/tx_dsp_core_200.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "tx_dsp_core_200.hpp"
#include <uhd/types/dict.hpp>
#include <uhd/exception.hpp>
#include <uhd/utils/msg.hpp>
#include "umtrx_log_adapter.hpp"
#include <uhd/utils/algorithm.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/math/special_functions/round.hpp>
Expand Down
2 changes: 1 addition & 1 deletion host/lms6002d_ctrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <uhd/utils/static.hpp>
#include <uhd/utils/assert_has.hpp>
#include <uhd/utils/algorithm.hpp>
#include <uhd/utils/msg.hpp>
#include "umtrx_log_adapter.hpp"
#include <uhd/types/ranges.hpp>
#include <uhd/types/sensors.hpp>
#include <uhd/types/dict.hpp>
Expand Down
2 changes: 1 addition & 1 deletion host/power_amp.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "power_amp.hpp"
#include <uhd/utils/msg.hpp>
#include "umtrx_log_adapter.hpp"
#include <uhd/exception.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/foreach.hpp>
Expand Down
Loading

0 comments on commit b82daad

Please sign in to comment.