diff options
author | Elof Wecksell <elof@wecksell.se> | 2021-01-12 10:35:31 +0100 |
---|---|---|
committer | Martin Braun <martin@gnuradio.org> | 2021-01-29 03:31:03 -0800 |
commit | b16924381c90e07d5d8cf5bc236c7dc48a0fd677 (patch) | |
tree | e5fe0c4005af6c6f0a6178139439a478de0abacf /gr-digital/lib/glfsr_source_f_impl.cc | |
parent | 761b327c761e0596f72cbe9f63e510f1b36c4b47 (diff) |
gr-digital: improved performance and capability of scramblers to 64-bit registers. Use __builtin_parity or volk popcnt. qa was also enhanced to detect errors.
Signed-off-by: Elof Wecksell <elof@wecksell.se>
Co-authored-by: Martin Braun <martin@gnuradio.org>
Diffstat (limited to 'gr-digital/lib/glfsr_source_f_impl.cc')
-rw-r--r-- | gr-digital/lib/glfsr_source_f_impl.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/gr-digital/lib/glfsr_source_f_impl.cc b/gr-digital/lib/glfsr_source_f_impl.cc index 41559b570e..359e9dbff8 100644 --- a/gr-digital/lib/glfsr_source_f_impl.cc +++ b/gr-digital/lib/glfsr_source_f_impl.cc @@ -21,31 +21,30 @@ namespace gr { namespace digital { glfsr_source_f::sptr -glfsr_source_f::make(unsigned int degree, bool repeat, uint32_t mask, uint32_t seed) +glfsr_source_f::make(unsigned int degree, bool repeat, uint64_t mask, uint64_t seed) { return gnuradio::make_block_sptr<glfsr_source_f_impl>(degree, repeat, mask, seed); } glfsr_source_f_impl::glfsr_source_f_impl(unsigned int degree, bool repeat, - uint32_t mask, - uint32_t seed) + uint64_t mask, + uint64_t seed) : sync_block("glfsr_source_f", io_signature::make(0, 0, 0), io_signature::make(1, 1, sizeof(float))), d_glfsr(mask ? mask : glfsr::glfsr_mask(degree), seed), d_repeat(repeat), d_index(0), - d_length((((uint32_t)1) << degree) - 1) + d_length((1ULL << degree) - 1) { - if (degree < 1 || degree > 32) - throw std::runtime_error( - "glfsr_source_f_impl: degree must be between 1 and 32 inclusive"); + if (degree < 1 || degree > 64) + throw std::runtime_error("glfsr_source_f_impl: must be 1 <= degree <= 64"); } glfsr_source_f_impl::~glfsr_source_f_impl() {} -uint32_t glfsr_source_f_impl::mask() const { return d_glfsr.mask(); } +uint64_t glfsr_source_f_impl::mask() const { return d_glfsr.mask(); } int glfsr_source_f_impl::work(int noutput_items, gr_vector_const_void_star& input_items, |