diff options
-rw-r--r-- | gnuradio-core/src/lib/filter/CMakeLists.txt | 3 | ||||
-rw-r--r-- | gnuradio-core/src/lib/filter/dotprod_ccf_armv7_a.c | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/filter/dotprod_fff_armv7_a.c | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/io/CMakeLists.txt | 1 | ||||
-rw-r--r-- | gnuradio-core/src/lib/io/gr_message_burst_source.cc | 144 | ||||
-rw-r--r-- | gnuradio-core/src/lib/io/gr_message_burst_source.h | 71 | ||||
-rw-r--r-- | gnuradio-core/src/lib/io/gr_message_burst_source.i | 38 | ||||
-rw-r--r-- | gnuradio-core/src/lib/io/io.i | 2 | ||||
-rw-r--r-- | gr-fcd/doc/README.fcd | 2 | ||||
-rw-r--r-- | gr-fcd/doc/fcd.dox | 2 | ||||
-rw-r--r-- | gr-filter/lib/CMakeLists.txt | 31 | ||||
-rw-r--r-- | grc/blocks/block_tree.xml | 1 | ||||
-rw-r--r-- | grc/blocks/gr_message_burst_source.xml | 58 | ||||
-rw-r--r-- | volk/lib/CMakeLists.txt | 13 |
14 files changed, 354 insertions, 16 deletions
diff --git a/gnuradio-core/src/lib/filter/CMakeLists.txt b/gnuradio-core/src/lib/filter/CMakeLists.txt index facaff764..088d3376d 100644 --- a/gnuradio-core/src/lib/filter/CMakeLists.txt +++ b/gnuradio-core/src/lib/filter/CMakeLists.txt @@ -210,6 +210,9 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)") ${CMAKE_CURRENT_SOURCE_DIR}/qa_dotprod_powerpc.cc ) elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm") + if(have_mfpu_neon) + add_definitions(-DHAVE_MFPU_NEON) + endif() list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/sysconfig_armv7_a.cc ${CMAKE_CURRENT_SOURCE_DIR}/gr_fir_sysconfig_armv7_a.cc diff --git a/gnuradio-core/src/lib/filter/dotprod_ccf_armv7_a.c b/gnuradio-core/src/lib/filter/dotprod_ccf_armv7_a.c index e7c6b266e..c125b49b3 100644 --- a/gnuradio-core/src/lib/filter/dotprod_ccf_armv7_a.c +++ b/gnuradio-core/src/lib/filter/dotprod_ccf_armv7_a.c @@ -37,7 +37,7 @@ gr_p2_round_down(size_t x, size_t pow2) } -#if 0 +#ifndef HAVE_MFPU_NEON void dotprod_ccf_armv7_a(const float *a, const float *b, float *res, size_t n) diff --git a/gnuradio-core/src/lib/filter/dotprod_fff_armv7_a.c b/gnuradio-core/src/lib/filter/dotprod_fff_armv7_a.c index 68c448b35..23bbef033 100644 --- a/gnuradio-core/src/lib/filter/dotprod_fff_armv7_a.c +++ b/gnuradio-core/src/lib/filter/dotprod_fff_armv7_a.c @@ -37,7 +37,7 @@ gr_p2_round_down(size_t x, size_t pow2) } -#if 0 +#ifndef HAVE_MFPU_NEON float dotprod_fff_armv7_a(const float *a, const float *b, size_t n) diff --git a/gnuradio-core/src/lib/io/CMakeLists.txt b/gnuradio-core/src/lib/io/CMakeLists.txt index af9d7583c..3dea13396 100644 --- a/gnuradio-core/src/lib/io/CMakeLists.txt +++ b/gnuradio-core/src/lib/io/CMakeLists.txt @@ -87,6 +87,7 @@ set(gr_core_io_triple_threats gr_file_descriptor_source gr_message_sink gr_message_source + gr_message_burst_source microtune_xxxx_eval_board microtune_4702_eval_board microtune_4937_eval_board diff --git a/gnuradio-core/src/lib/io/gr_message_burst_source.cc b/gnuradio-core/src/lib/io/gr_message_burst_source.cc new file mode 100644 index 000000000..e9e2dfd4d --- /dev/null +++ b/gnuradio-core/src/lib/io/gr_message_burst_source.cc @@ -0,0 +1,144 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <gr_message_burst_source.h> +#include <gr_io_signature.h> +#include <cstdio> +#include <errno.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <stdexcept> +#include <string.h> +#include <gr_tags.h> + +// public constructor that returns a shared_ptr + +gr_message_burst_source_sptr +gr_make_message_burst_source(size_t itemsize, int msgq_limit) +{ + return gnuradio::get_initial_sptr(new gr_message_burst_source(itemsize, msgq_limit)); +} + +// public constructor that takes existing message queue +gr_message_burst_source_sptr +gr_make_message_burst_source(size_t itemsize, gr_msg_queue_sptr msgq) +{ + return gnuradio::get_initial_sptr(new gr_message_burst_source(itemsize, msgq)); +} + +gr_message_burst_source::gr_message_burst_source (size_t itemsize, int msgq_limit) + : gr_sync_block("message_burst_source", + gr_make_io_signature(0, 0, 0), + gr_make_io_signature(1, 1, itemsize)), + d_itemsize(itemsize), d_msgq(gr_make_msg_queue(msgq_limit)), d_msg_offset(0), d_eof(false) +{ + std::stringstream id; + id << name() << unique_id(); + d_me = pmt::pmt_string_to_symbol(id.str()); +} + +gr_message_burst_source::gr_message_burst_source (size_t itemsize, gr_msg_queue_sptr msgq) + : gr_sync_block("message_burst_source", + gr_make_io_signature(0, 0, 0), + gr_make_io_signature(1, 1, itemsize)), + d_itemsize(itemsize), d_msgq(msgq), d_msg_offset(0), d_eof(false) +{ + std::stringstream id; + id << name() << unique_id(); + d_me = pmt::pmt_string_to_symbol(id.str()); +} + +gr_message_burst_source::~gr_message_burst_source() +{ +} + +int +gr_message_burst_source::work(int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) +{ + char *out = (char *) output_items[0]; + int nn = 0; + + uint64_t abs_sample_count = nitems_written(0); + + while (nn < noutput_items){ + if (d_msg){ + // + // Consume whatever we can from the current message + // + + int mm = std::min(noutput_items - nn, (int)((d_msg->length() - d_msg_offset) / d_itemsize)); + memcpy (out, &(d_msg->msg()[d_msg_offset]), mm * d_itemsize); + + nn += mm; + out += mm * d_itemsize; + d_msg_offset += mm * d_itemsize; + assert(d_msg_offset <= d_msg->length()); + + if (d_msg_offset == d_msg->length()){ + if (d_msg->type() == 1) // type == 1 sets EOF + d_eof = true; + d_msg.reset(); + //tag end of burst + add_item_tag(0, //stream ID + abs_sample_count+nn-1, //sample number + pmt::pmt_string_to_symbol("tx_eob"), + pmt::pmt_from_bool(1), + d_me //block src id + ); + } + } + else { + // + // No current message + // + if (d_msgq->empty_p() && nn > 0){ // no more messages in the queue, return what we've got + break; + } + + if (d_eof) + return -1; + + d_msg = d_msgq->delete_head(); // block, waiting for a message + d_msg_offset = 0; + //tag start of burst + add_item_tag(0, //stream ID + abs_sample_count+nn, //sample number + pmt::pmt_string_to_symbol("tx_sob"), + pmt::pmt_from_bool(1), + d_me //block src id + ); + + + if ((d_msg->length() % d_itemsize) != 0) + throw std::runtime_error("msg length is not a multiple of d_itemsize"); + } + } + + return nn; +} diff --git a/gnuradio-core/src/lib/io/gr_message_burst_source.h b/gnuradio-core/src/lib/io/gr_message_burst_source.h new file mode 100644 index 000000000..63e220113 --- /dev/null +++ b/gnuradio-core/src/lib/io/gr_message_burst_source.h @@ -0,0 +1,71 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_GR_MESSAGE_BURST_SOURCE_H +#define INCLUDED_GR_MESSAGE_BURST_SOURCE_H + +#include <gr_core_api.h> +#include <gr_sync_block.h> +#include <gr_message.h> +#include <gr_msg_queue.h> + +class gr_message_burst_source; +typedef boost::shared_ptr<gr_message_burst_source> gr_message_burst_source_sptr; + +GR_CORE_API gr_message_burst_source_sptr gr_make_message_burst_source (size_t itemsize, int msgq_limit=0); +GR_CORE_API gr_message_burst_source_sptr gr_make_message_burst_source (size_t itemsize, gr_msg_queue_sptr msgq); + +/*! + * \brief Turn received messages into a stream and tag them for UHD to send. + * \ingroup source_blk + */ +class GR_CORE_API gr_message_burst_source : public gr_sync_block +{ + private: + size_t d_itemsize; + gr_msg_queue_sptr d_msgq; + gr_message_sptr d_msg; + unsigned d_msg_offset; + bool d_eof; + + pmt::pmt_t d_me; + + friend GR_CORE_API gr_message_burst_source_sptr + gr_make_message_burst_source(size_t itemsize, int msgq_limit); + friend GR_CORE_API gr_message_burst_source_sptr + gr_make_message_burst_source(size_t itemsize, gr_msg_queue_sptr msgq); + + protected: + gr_message_burst_source (size_t itemsize, int msgq_limit); + gr_message_burst_source (size_t itemsize, gr_msg_queue_sptr msgq); + + public: + ~gr_message_burst_source (); + + gr_msg_queue_sptr msgq() const { return d_msgq; } + + int work (int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); +}; + +#endif /* INCLUDED_gr_message_burst_source_H */ diff --git a/gnuradio-core/src/lib/io/gr_message_burst_source.i b/gnuradio-core/src/lib/io/gr_message_burst_source.i new file mode 100644 index 000000000..f7ad840c2 --- /dev/null +++ b/gnuradio-core/src/lib/io/gr_message_burst_source.i @@ -0,0 +1,38 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +GR_SWIG_BLOCK_MAGIC(gr,message_burst_source); + +gr_message_burst_source_sptr gr_make_message_burst_source (size_t itemsize, int msgq_limit=0); +gr_message_burst_source_sptr gr_make_message_burst_source (size_t itemsize, gr_msg_queue_sptr msgq); + +class gr_message_burst_source : public gr_sync_block +{ + protected: + gr_message_burst_source (size_t itemsize, int msgq_limit); + gr_message_burst_source (size_t itemsize, gr_msg_queue_sptr msgq); + + public: + ~gr_message_burst_source (); + + gr_msg_queue_sptr msgq() const; +}; diff --git a/gnuradio-core/src/lib/io/io.i b/gnuradio-core/src/lib/io/io.i index eab1346f1..5cd352905 100644 --- a/gnuradio-core/src/lib/io/io.i +++ b/gnuradio-core/src/lib/io/io.i @@ -38,6 +38,7 @@ #include <gr_oscope_sink_f.h> #include <ppio.h> #include <gr_message_source.h> +#include <gr_message_burst_source.h> #include <gr_message_sink.h> #include <gr_udp_sink.h> #include <gr_udp_source.h> @@ -59,6 +60,7 @@ %include "gr_oscope_sink.i" %include "ppio.i" %include "gr_message_source.i" +%include "gr_message_burst_source.i" %include "gr_message_sink.i" %include "gr_udp_sink.i" %include "gr_udp_source.i" diff --git a/gr-fcd/doc/README.fcd b/gr-fcd/doc/README.fcd index 83b4da1ce..c6ee02fff 100644 --- a/gr-fcd/doc/README.fcd +++ b/gr-fcd/doc/README.fcd @@ -1,7 +1,7 @@ This is the gr-fcd package. It contains a source block for the FunCube Dongle hardware. -The Python namespace is in gnuradio.qtgui, which would be normally +The Python namespace is in gnuradio.fcd, which would be normally imported as: from gnuradio import fcd diff --git a/gr-fcd/doc/fcd.dox b/gr-fcd/doc/fcd.dox index 6e07c585b..aca4dadaa 100644 --- a/gr-fcd/doc/fcd.dox +++ b/gr-fcd/doc/fcd.dox @@ -5,7 +5,7 @@ This is the gr-fcd package. It contains a source block for the FunCube Dongle hardware. -The Python namespace is in gnuradio.qtgui, which would be normally +The Python namespace is in gnuradio.fcd, which would be normally imported as: \code diff --git a/gr-filter/lib/CMakeLists.txt b/gr-filter/lib/CMakeLists.txt index 73d7d7bae..532bd1992 100644 --- a/gr-filter/lib/CMakeLists.txt +++ b/gr-filter/lib/CMakeLists.txt @@ -98,7 +98,6 @@ include_directories( ${GR_FFT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${FFTW3F_INCLUDE_DIRS} - ${CPPUNIT_INCLUDE_DIRS} ) link_directories(${FFT_LIBRARY_DIRS}) @@ -157,22 +156,30 @@ add_dependencies(gnuradio-filter gnuradio-fft filter_generated_includes filter_g ######################################################################## # QA C++ Code for gr-filter ######################################################################## -list(APPEND test_gr_filter_sources +if(ENABLE_TESTING) + include(GrTest) + + include_directories(${CPPUNIT_INCLUDE_DIRS}) + link_directories(${CPPUNIT_LIBRARY_DIRS}) + + list(APPEND test_gr_filter_sources ${CMAKE_CURRENT_SOURCE_DIR}/test_gr_filter.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_filter.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_firdes.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_fir_filter_with_buffer.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_mmse_fir_interpolator_cc.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_mmse_fir_interpolator_ff.cc -) + ) -add_executable(test-gr-filter ${test_gr_filter_sources}) -target_link_libraries( - test-gr-filter - gnuradio-core - gnuradio-filter - ${CPPUNIT_LIBRARIES} - ${Boost_LIBRARIES} -) + add_executable(test-gr-filter ${test_gr_filter_sources}) + + target_link_libraries( + test-gr-filter + gnuradio-core + gnuradio-filter + ${Boost_LIBRARIES} + ${CPPUNIT_LIBRARIES} + ) -GR_ADD_TEST(test_gr_filter test-gr-filter) + GR_ADD_TEST(test_gr_filter test-gr-filter) +endif(ENABLE_TESTING) diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index f94bd30bd..3b5491a74 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -20,6 +20,7 @@ <block>gr_udp_source</block> <block>gr_wavfile_source</block> <block>gr_message_source</block> + <block>gr_message_burst_source</block> <block>pad_source</block> <block>virtual_source</block> </cat> diff --git a/grc/blocks/gr_message_burst_source.xml b/grc/blocks/gr_message_burst_source.xml new file mode 100644 index 000000000..e835d2a2c --- /dev/null +++ b/grc/blocks/gr_message_burst_source.xml @@ -0,0 +1,58 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Message Burst Source (the sink port is a message) +################################################### + --> +<block> + <name>Message Burst Source</name> + <key>gr_message_burst_source</key> + <import>from gnuradio import gr</import> + <make>gr.message_burst_source($type.size*$vlen, $(id)_msgq_in)</make> + <param> + <name>Output Type</name> + <key>type</key> + <type>enum</type> + <option> + <name>Complex</name> + <key>complex</key> + <opt>size:gr.sizeof_gr_complex</opt> + </option> + <option> + <name>Float</name> + <key>float</key> + <opt>size:gr.sizeof_float</opt> + </option> + <option> + <name>Int</name> + <key>int</key> + <opt>size:gr.sizeof_int</opt> + </option> + <option> + <name>Short</name> + <key>short</key> + <opt>size:gr.sizeof_short</opt> + </option> + <option> + <name>Byte</name> + <key>byte</key> + <opt>size:gr.sizeof_char</opt> + </option> + </param> + <param> + <name>Vec Length</name> + <key>vlen</key> + <value>1</value> + <type>int</type> + </param> + <check>$vlen > 0</check> + <sink> + <name>in</name> + <type>msg</type> + </sink> + <source> + <name>out</name> + <type>$type</type> + <vlen>$vlen</vlen> + </source> +</block> diff --git a/volk/lib/CMakeLists.txt b/volk/lib/CMakeLists.txt index 59d78b446..58bf026b4 100644 --- a/volk/lib/CMakeLists.txt +++ b/volk/lib/CMakeLists.txt @@ -55,6 +55,17 @@ if(NOT DEFINED COMPILER_NAME) endif() ######################################################################## +# Special clang flag so flag checks can fail +######################################################################## +if(COMPILER_NAME MATCHES "GNU") + include(CheckCXXCompilerFlag) + CHECK_CXX_COMPILER_FLAG("-Werror=unused-command-line-argument" HAVE_WERROR_UNUSED_CMD_LINE_ARG) + if(HAVE_WERROR_UNUSED_CMD_LINE_ARG) + set(VOLK_FLAG_CHECK_FLAGS "-Werror=unused-command-line-argument") + endif() +endif() + +######################################################################## # detect x86 flavor of CPU ######################################################################## if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(i.86|x86|x86_64|amd64)$") @@ -82,7 +93,9 @@ macro(check_arch arch_name) COMMAND ${PYTHON_EXECUTABLE} -c "import re; print(re.sub('\\W', '_', '${have_flag}'))" OUTPUT_VARIABLE have_flag OUTPUT_STRIP_TRAILING_WHITESPACE ) + set(CMAKE_REQUIRED_FLAGS VOLK_FLAG_CHECK_FLAGS) CHECK_CXX_COMPILER_FLAG(${flag} ${have_flag}) + unset(CMAKE_REQUIRED_FLAGS) if (NOT ${have_flag}) set(have_${arch_name} FALSE) endif() |