diff options
author | Tom Rondeau <trondeau@vt.edu> | 2013-02-21 19:34:27 -0500 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2013-02-21 19:34:27 -0500 |
commit | 4f479665bc9f04e52b047cb270772ee61e319a59 (patch) | |
tree | 09a018da0d2c14f160520707ecc2a2ff6ae8e1f1 /gnuradio-core/src/lib/gengen | |
parent | 7b4a518bfe47fb1d0b2a32fc5c93ed0157d2dc6c (diff) |
blocks: removing blocks from gnuradio-core.
delay, rms, packed_to_unpacked, unpacked_to_packed.
Diffstat (limited to 'gnuradio-core/src/lib/gengen')
8 files changed, 0 insertions, 503 deletions
diff --git a/gnuradio-core/src/lib/gengen/CMakeLists.txt b/gnuradio-core/src/lib/gengen/CMakeLists.txt index d018876183..5d5b2536c3 100644 --- a/gnuradio-core/src/lib/gengen/CMakeLists.txt +++ b/gnuradio-core/src/lib/gengen/CMakeLists.txt @@ -90,8 +90,6 @@ expand_h_cc_i(gr_probe_signal_vX b s i f c) expand_h_cc_i(gr_mute_XX ss ii ff cc) expand_h_cc_i(gr_moving_average_XX ss ii ff cc) -expand_h_cc_i(gr_unpacked_to_packed_XX bb ss ii) -expand_h_cc_i(gr_packed_to_unpacked_XX bb ss ii) expand_h_cc_i(gr_sample_and_hold_XX bb ss ii ff) expand_h_cc_i(gr_argmax_XX fs is ss) expand_h_cc_i(gr_max_XX ff ii ss) diff --git a/gnuradio-core/src/lib/gengen/generate_common.py b/gnuradio-core/src/lib/gengen/generate_common.py index 6a04a75d72..ba9f7625e1 100755 --- a/gnuradio-core/src/lib/gengen/generate_common.py +++ b/gnuradio-core/src/lib/gengen/generate_common.py @@ -46,8 +46,6 @@ reg_roots = [ # other blocks others = ( - ('gr_unpacked_to_packed_XX', ('bb','ss','ii')), - ('gr_packed_to_unpacked_XX', ('bb','ss','ii')), ('gr_sample_and_hold_XX', ('bb','ss','ii','ff')), ('gr_argmax_XX', ('fs','is','ss')), ('gr_max_XX', ('ff','ii','ss')), diff --git a/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.cc.t deleted file mode 100644 index 75e53c4ca1..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.cc.t +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 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. - */ - -// @WARNING@ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <@NAME@.h> -#include <gr_io_signature.h> -#include <assert.h> -#include <gr_log2_const.h> - -static const unsigned int BITS_PER_TYPE = sizeof(@I_TYPE@) * 8; -static const unsigned int LOG2_L_TYPE = gr_log2_const<sizeof(@I_TYPE@) * 8>(); - - -@SPTR_NAME@ -gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness) -{ - return @SPTR_NAME@ - (new @NAME@ (bits_per_chunk,endianness)); -} - -@NAME@::@NAME@ (unsigned int bits_per_chunk, - gr_endianness_t endianness) - : gr_block ("@BASE_NAME@", - gr_make_io_signature (1, -1, sizeof (@I_TYPE@)), - gr_make_io_signature (1, -1, sizeof (@O_TYPE@))), - d_bits_per_chunk(bits_per_chunk),d_endianness(endianness),d_index(0) -{ - assert (bits_per_chunk <= BITS_PER_TYPE); - assert (bits_per_chunk > 0); - - set_relative_rate ((1.0 * BITS_PER_TYPE) / bits_per_chunk); -} - -void -@NAME@::forecast(int noutput_items, gr_vector_int &ninput_items_required) -{ - - int input_required = (int) ceil((d_index + noutput_items * d_bits_per_chunk) / (1.0 * BITS_PER_TYPE)); - unsigned ninputs = ninput_items_required.size(); - for (unsigned int i = 0; i < ninputs; i++) { - ninput_items_required[i] = input_required; - //printf("Forecast wants %d needs %d\n",noutput_items,ninput_items_required[i]); - } -} - -unsigned int -get_bit_le (const @I_TYPE@ *in_vector,unsigned int bit_addr) -{ - @I_TYPE@ x = in_vector[bit_addr>>LOG2_L_TYPE]; - return (x>>(bit_addr&(BITS_PER_TYPE-1)))&1; -} - -unsigned int -get_bit_be (const @I_TYPE@ *in_vector,unsigned int bit_addr) -{ - @I_TYPE@ x = in_vector[bit_addr>>LOG2_L_TYPE]; - return (x>>((BITS_PER_TYPE-1)-(bit_addr&(BITS_PER_TYPE-1))))&1; -} - -int -@NAME@::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - unsigned int index_tmp = d_index; - - assert (input_items.size() == output_items.size()); - int nstreams = input_items.size(); - - for (int m=0; m < nstreams; m++){ - const @I_TYPE@ *in = (@I_TYPE@ *) input_items[m]; - @O_TYPE@ *out = (@O_TYPE@ *) output_items[m]; - index_tmp = d_index; - - // per stream processing - - switch (d_endianness){ - - case GR_MSB_FIRST: - for (int i = 0; i < noutput_items; i++){ - //printf("here msb %d\n",i); - @O_TYPE@ x = 0; - for(unsigned int j=0; j<d_bits_per_chunk; j++, index_tmp++) - x = (x<<1) | get_bit_be(in, index_tmp); - out[i] = x; - } - break; - - case GR_LSB_FIRST: - for (int i = 0; i < noutput_items; i++){ - //printf("here lsb %d\n",i); - @O_TYPE@ x = 0; - for(unsigned int j=0; j<d_bits_per_chunk; j++, index_tmp++) - x = (x<<1) | get_bit_le(in, index_tmp); - out[i] = x; - } - break; - - default: - assert(0); - } - - //printf("almost got to end\n"); - assert(ninput_items[m] >= (int) ((d_index+(BITS_PER_TYPE-1))>>LOG2_L_TYPE)); - } - - d_index = index_tmp; - consume_each (d_index >> LOG2_L_TYPE); - d_index = d_index & (BITS_PER_TYPE-1); - //printf("got to end\n"); - return noutput_items; -} diff --git a/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.h.t b/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.h.t deleted file mode 100644 index e95771b371..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.h.t +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 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. - */ - -// @WARNING@ - -#ifndef @GUARD_NAME@ -#define @GUARD_NAME@ - -#include <gr_core_api.h> -#include <gr_block.h> -#include <gr_endianness.h> - -class @NAME@; -typedef boost::shared_ptr<@NAME@> @SPTR_NAME@; - -GR_CORE_API @SPTR_NAME@ -gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - -/*! - * \brief Convert a stream of packed bytes or shorts to stream of unpacked bytes or shorts. - * \ingroup converter_blk - * - * input: stream of @I_TYPE@; output: stream of @O_TYPE@ - * - * This is the inverse of gr_unpacked_to_packed_XX. - * - * The bits in the bytes or shorts input stream are grouped into chunks of - * \p bits_per_chunk bits and each resulting chunk is written right- - * justified to the output stream of bytes or shorts. - * All b or 16 bits of the each input bytes or short are processed. - * The right thing is done if bits_per_chunk is not a power of two. - * - * The combination of gr_packed_to_unpacked_XX_ followed by - * gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the - * general case of mapping from a stream of bytes or shorts into - * arbitrary float or complex symbols. - * - * \sa gr_packed_to_unpacked_bb, gr_unpacked_to_packed_bb, - * \sa gr_packed_to_unpacked_ss, gr_unpacked_to_packed_ss, - * \sa gr_chunks_to_symbols_bf, gr_chunks_to_symbols_bc. - * \sa gr_chunks_to_symbols_sf, gr_chunks_to_symbols_sc. - */ - -class GR_CORE_API @NAME@ : public gr_block -{ - friend GR_CORE_API @SPTR_NAME@ - gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - - @NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - - unsigned int d_bits_per_chunk; - gr_endianness_t d_endianness; - unsigned int d_index; - - public: - void forecast(int noutput_items, gr_vector_int &ninput_items_required); - int general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - bool check_topology(int ninputs, int noutputs) { return ninputs == noutputs; } - -}; - -#endif diff --git a/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.i.t b/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.i.t deleted file mode 100644 index 1e978956a1..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.i.t +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 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. - */ - -// @WARNING@ - -GR_SWIG_BLOCK_MAGIC(gr,@BASE_NAME@); - -@SPTR_NAME@ -gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - -class @NAME@ : public gr_block -{ - @NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); -}; diff --git a/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.cc.t deleted file mode 100644 index ed2b713dbb..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.cc.t +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2006 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. - */ - -// @WARNING@ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <@NAME@.h> -#include <gr_io_signature.h> -#include <assert.h> - -static const unsigned int BITS_PER_TYPE = sizeof(@O_TYPE@) * 8; - - -@SPTR_NAME@ -gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness) -{ - return @SPTR_NAME@ - (new @NAME@ (bits_per_chunk,endianness)); -} - -@NAME@::@NAME@ (unsigned int bits_per_chunk, - gr_endianness_t endianness) - : gr_block ("@BASE_NAME@", - gr_make_io_signature (1, -1, sizeof (@I_TYPE@)), - gr_make_io_signature (1, -1, sizeof (@O_TYPE@))), - d_bits_per_chunk(bits_per_chunk),d_endianness(endianness),d_index(0) -{ - assert (bits_per_chunk <= BITS_PER_TYPE); - assert (bits_per_chunk > 0); - - set_relative_rate (bits_per_chunk/(1.0 * BITS_PER_TYPE)); -} - -void -@NAME@::forecast(int noutput_items, gr_vector_int &ninput_items_required) -{ - int input_required = (int) ceil( (d_index+noutput_items * 1.0 * BITS_PER_TYPE)/d_bits_per_chunk); - unsigned ninputs = ninput_items_required.size(); - for (unsigned int i = 0; i < ninputs; i++) { - ninput_items_required[i] = input_required; - } -} - -unsigned int -get_bit_be1 (const @I_TYPE@ *in_vector,unsigned int bit_addr, unsigned int bits_per_chunk) { - unsigned int byte_addr = (int)bit_addr/bits_per_chunk; - @I_TYPE@ x = in_vector[byte_addr]; - unsigned int residue = bit_addr - byte_addr * bits_per_chunk; - //printf("Bit addr %d byte addr %d residue %d val %d\n",bit_addr,byte_addr,residue,(x>>(bits_per_chunk-1-residue))&1); - return (x >> (bits_per_chunk-1-residue))&1; -} - -int -@NAME@::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - unsigned int index_tmp = d_index; - - assert (input_items.size() == output_items.size()); - int nstreams = input_items.size(); - - for (int m=0; m< nstreams; m++) { - const @I_TYPE@ *in = (@I_TYPE@ *) input_items[m]; - @O_TYPE@ *out = (@O_TYPE@ *) output_items[m]; - index_tmp=d_index; - - // per stream processing - - //assert((ninput_items[m]-d_index)*d_bits_per_chunk >= noutput_items*BITS_PER_TYPE); - - switch(d_endianness){ - - case GR_MSB_FIRST: - for(int i=0;i<noutput_items;i++) { - @O_TYPE@ tmp=0; - for(unsigned int j=0; j<BITS_PER_TYPE; j++) { - tmp = (tmp<<1) | get_bit_be1(in,index_tmp,d_bits_per_chunk); - index_tmp++; - } - out[i] = tmp; - } - break; - - case GR_LSB_FIRST: - for(int i=0;i<noutput_items;i++) { - unsigned long tmp=0; - for(unsigned int j=0; j<BITS_PER_TYPE; j++) { - tmp = (tmp>>1)| (get_bit_be1(in,index_tmp,d_bits_per_chunk)<<(BITS_PER_TYPE-1)); - index_tmp++; - } - out[i] = tmp; - } - break; - - default: - assert(0); - } - } - - d_index = index_tmp; - consume_each ((int)(d_index/d_bits_per_chunk)); - d_index = d_index%d_bits_per_chunk; - - return noutput_items; -} diff --git a/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.h.t b/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.h.t deleted file mode 100644 index a7b7b54df9..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.h.t +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 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. - */ - -// @WARNING@ - -#ifndef @GUARD_NAME@ -#define @GUARD_NAME@ - -#include <gr_core_api.h> -#include <gr_block.h> -#include <gr_endianness.h> - -class @NAME@; -typedef boost::shared_ptr<@NAME@> @NAME@_sptr; - -GR_CORE_API @SPTR_NAME@ -gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - -/*! - * \brief Convert a stream of unpacked bytes or shorts into a stream of packed bytes or shorts. - * \ingroup converter_blk - * - * input: stream of @I_TYPE@; output: stream of @O_TYPE@ - * - * This is the inverse of gr_packed_to_unpacked_XX. - * - * The low \p bits_per_chunk bits are extracted from each input byte or short. - * These bits are then packed densely into the output bytes or shorts, such that - * all 8 or 16 bits of the output bytes or shorts are filled with valid input bits. - * The right thing is done if bits_per_chunk is not a power of two. - * - * The combination of gr_packed_to_unpacked_XX followed by - * gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the - * general case of mapping from a stream of bytes or shorts into arbitrary float - * or complex symbols. - * - * \sa gr_packed_to_unpacked_bb, gr_unpacked_to_packed_bb, - * \sa gr_packed_to_unpacked_ss, gr_unpacked_to_packed_ss, - * \sa gr_chunks_to_symbols_bf, gr_chunks_to_symbols_bc. - * \sa gr_chunks_to_symbols_sf, gr_chunks_to_symbols_sc. - */ -class GR_CORE_API @NAME@ : public gr_block -{ - friend GR_CORE_API @SPTR_NAME@ - gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - - @NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - - unsigned int d_bits_per_chunk; - gr_endianness_t d_endianness; - unsigned int d_index; - - public: - void forecast(int noutput_items, gr_vector_int &ninput_items_required); - int general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - bool check_topology(int ninputs, int noutputs) { return ninputs == noutputs; } -}; - -#endif diff --git a/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.i.t b/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.i.t deleted file mode 100644 index 1e978956a1..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.i.t +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 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. - */ - -// @WARNING@ - -GR_SWIG_BLOCK_MAGIC(gr,@BASE_NAME@); - -@SPTR_NAME@ -gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - -class @NAME@ : public gr_block -{ - @NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); -}; |