diff options
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | gnuradio-core/src/lib/reed-solomon/char.h | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/reed-solomon/rs.h | 6 | ||||
-rw-r--r-- | gr-atsc/CMakeLists.txt | 109 | ||||
-rw-r--r-- | gr-atsc/src/lib/CMakeLists.txt | 229 | ||||
-rw-r--r-- | gr-atsc/src/python/CMakeLists.txt | 58 |
6 files changed, 401 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d8af33bac..517d96998 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -180,6 +180,7 @@ ADD_SUBDIRECTORY(gnuradio-core) ADD_SUBDIRECTORY(grc) ADD_SUBDIRECTORY(docs) +ADD_SUBDIRECTORY(gr-atsc) ADD_SUBDIRECTORY(gr-audio) ADD_SUBDIRECTORY(gr-digital) ADD_SUBDIRECTORY(gr-noaa) diff --git a/gnuradio-core/src/lib/reed-solomon/char.h b/gnuradio-core/src/lib/reed-solomon/char.h index f4db986c3..8010fb0b9 100644 --- a/gnuradio-core/src/lib/reed-solomon/char.h +++ b/gnuradio-core/src/lib/reed-solomon/char.h @@ -48,7 +48,7 @@ static inline int modnn(struct rs *rs,int x){ GR_CORE_API void ENCODE_RS(void *p,DTYPE *data,DTYPE *parity); GR_CORE_API int DECODE_RS(void *p,DTYPE *data,int *eras_pos,int no_eras); -void *INIT_RS(unsigned int symsize,unsigned int gfpoly,unsigned int fcr, +GR_CORE_API void *INIT_RS(unsigned int symsize,unsigned int gfpoly,unsigned int fcr, unsigned int prim,unsigned int nroots); GR_CORE_API void FREE_RS(void *p); diff --git a/gnuradio-core/src/lib/reed-solomon/rs.h b/gnuradio-core/src/lib/reed-solomon/rs.h index b56e1cff6..97e78769e 100644 --- a/gnuradio-core/src/lib/reed-solomon/rs.h +++ b/gnuradio-core/src/lib/reed-solomon/rs.h @@ -6,16 +6,16 @@ /* General purpose RS codec, 8-bit symbols */ GR_CORE_API void encode_rs_char(void *rs,unsigned char *data,unsigned char *parity); -int decode_rs_char(void *rs,unsigned char *data,int *eras_pos, +GR_CORE_API int decode_rs_char(void *rs,unsigned char *data,int *eras_pos, int no_eras); -void *init_rs_char(unsigned int symsize,unsigned int gfpoly, +GR_CORE_API void *init_rs_char(unsigned int symsize,unsigned int gfpoly, unsigned int fcr,unsigned int prim,unsigned int nroots); GR_CORE_API void free_rs_char(void *rs); /* General purpose RS codec, integer symbols */ GR_CORE_API void encode_rs_int(void *rs,int *data,int *parity); GR_CORE_API int decode_rs_int(void *rs,int *data,int *eras_pos,int no_eras); -void *init_rs_int(unsigned int symsize,unsigned int gfpoly,unsigned int fcr, +GR_CORE_API void *init_rs_int(unsigned int symsize,unsigned int gfpoly,unsigned int fcr, unsigned int prim,unsigned int nroots); GR_CORE_API void free_rs_int(void *rs); diff --git a/gr-atsc/CMakeLists.txt b/gr-atsc/CMakeLists.txt new file mode 100644 index 000000000..99ba390dd --- /dev/null +++ b/gr-atsc/CMakeLists.txt @@ -0,0 +1,109 @@ +# Copyright 2011 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. + +######################################################################## +# Setup dependencies +######################################################################## +INCLUDE(GrBoost) + +######################################################################## +# Register component +######################################################################## +INCLUDE(GrComponent) +GR_REGISTER_COMPONENT("gr-atsc" ENABLE_GR_ATSC + UNIX #FIXME until we get MSVC working with this and Reed-Solomon codec + Boost_FOUND + ENABLE_GR_CORE_ +) + +REMOVE_DEFINITIONS(-fvisibility=hidden) #FIXME until we do symbol visibility + +GR_SET_GLOBAL(GR_ATSC_INCLUDE_DIRS + ${CMAKE_CURRENT_SOURCE_DIR}/src/lib +) + +######################################################################## +# Begin conditional configuration +######################################################################## +IF(ENABLE_GR_ATSC) + +######################################################################## +# Setup CPack components +######################################################################## +INCLUDE(GrPackage) +CPACK_SET(CPACK_COMPONENT_GROUP_ATSC_DESCRIPTION "The GNU Radio ATSC Blocks") + +CPACK_COMPONENT("atsc_runtime" + GROUP "ATSC" + DISPLAY_NAME "Runtime" + DESCRIPTION "Runtime" + DEPENDS "core_runtime" +) + +CPACK_COMPONENT("atsc_devel" + GROUP "ATSC" + DISPLAY_NAME "Development" + DESCRIPTION "C++ headers, package config, import libraries" + DEPENDS "core_devel" +) + +CPACK_COMPONENT("atsc_python" + GROUP "ATSC" + DISPLAY_NAME "Python" + DESCRIPTION "Python modules for runtime; GRC xml files" + DEPENDS "core_python;atsc_runtime" +) + +CPACK_COMPONENT("atsc_examples" + GROUP "ATSC" + DISPLAY_NAME "Examples" + DESCRIPTION "Python examples for ATSC" + DEPENDS "atsc_python" +) + +CPACK_COMPONENT("atsc_swig" + GROUP "ATSC" + DISPLAY_NAME "SWIG" + DESCRIPTION "SWIG development .i files" + DEPENDS "core_swig;atsc_python;atsc_devel" +) + +######################################################################## +# Add subdirectories +######################################################################## +ADD_SUBDIRECTORY(src/lib) +IF(ENABLE_PYTHON) + ADD_SUBDIRECTORY(src/python) +ENDIF(ENABLE_PYTHON) + +######################################################################## +# Create Pkg Config File +######################################################################## +CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-atsc.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-atsc.pc +@ONLY) + +INSTALL( + FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-atsc.pc + DESTINATION ${GR_LIBRARY_DIR}/pkgconfig + COMPONENT "atsc_devel" +) + +ENDIF(ENABLE_GR_ATSC) diff --git a/gr-atsc/src/lib/CMakeLists.txt b/gr-atsc/src/lib/CMakeLists.txt new file mode 100644 index 000000000..fbada9bcd --- /dev/null +++ b/gr-atsc/src/lib/CMakeLists.txt @@ -0,0 +1,229 @@ +# Copyright 2011 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. + +######################################################################## +# Setup the include and linker paths +######################################################################## +INCLUDE_DIRECTORIES( + ${GNURADIO_CORE_INCLUDE_DIRS} + ${GR_ATSC_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} +) + +INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) +LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) + +######################################################################## +# Generate viterbi mux source +######################################################################## +ADD_EXECUTABLE(atsci_viterbi_gen atsci_viterbi_gen.cc) + +SET(atsci_viterbi_mux_cc ${CMAKE_CURRENT_BINARY_DIR}/atsci_viterbi_mux.cc) + +ADD_CUSTOM_COMMAND( + OUTPUT ${atsci_viterbi_mux_cc} + DEPENDS atsci_viterbi_gen + COMMAND atsci_viterbi_gen -o ${atsci_viterbi_mux_cc} +) + +######################################################################## +# Setup library +######################################################################## +LIST(APPEND gr_atsc_sources + ${atsci_viterbi_mux_cc} + atsc_derandomizer.cc + atsc_randomizer.cc + atsc_rs_decoder.cc + atsc_rs_encoder.cc + atsc_interleaver.cc + atsc_deinterleaver.cc + atsc_trellis_encoder.cc + atsc_viterbi_decoder.cc + atsc_ds_to_softds.cc + atsc_field_sync_mux.cc + atsc_field_sync_demux.cc + atsc_equalizer.cc + atsc_fs_checker.cc + atsc_bit_timing_loop.cc + atsc_fpll.cc + atsc_depad.cc + atsc_pad.cc + atsci_basic_trellis_encoder.cc + atsci_data_interleaver.cc + atsci_equalizer.cc + atsci_equalizer_lms.cc + atsci_equalizer_lms2.cc + atsci_equalizer_nop.cc + atsci_fake_single_viterbi.cc + atsci_fs_checker.cc + atsci_fs_checker_naive.cc + atsci_fs_correlator.cc + atsci_fs_correlator_naive.cc + atsci_single_viterbi.cc + atsci_sssr.cc + atsci_pnXXX.cc + atsci_randomizer.cc + atsci_reed_solomon.cc + atsci_sliding_correlator.cc + atsci_trellis_encoder.cc + atsci_viterbi_decoder.cc + create_atsci_equalizer.cc + create_atsci_fs_checker.cc + create_atsci_fs_correlator.cc + plinfo.cc +) + +LIST(APPEND atsc_libs + gnuradio-core + ${Boost_LIBRARIES} +) + +ADD_LIBRARY(gnuradio-atsc SHARED ${gr_atsc_sources}) +TARGET_LINK_LIBRARIES(gnuradio-atsc ${atsc_libs}) +SET_TARGET_PROPERTIES(gnuradio-atsc PROPERTIES DEFINE_SYMBOL "gnuradio_atsc_EXPORTS") +SET_TARGET_PROPERTIES(gnuradio-atsc PROPERTIES SOVERSION ${LIBVER}) + +INSTALL(TARGETS gnuradio-atsc + LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "atsc_runtime" # .so/.dylib file + ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "atsc_devel" # .lib file + RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "atsc_runtime" # .dll file +) + +######################################################################## +# Build and register unit test +######################################################################## +IF(ENABLE_TESTING) + +INCLUDE_DIRECTORIES(${CPPUNIT_INCLUDE_DIRS}) +LINK_DIRECTORIES(${CPPUNIT_LIBRARY_DIRS}) + +LIST(APPEND test_atsci_sources + qa_atsci_basic_trellis_encoder.cc + qa_atsci_data_interleaver.cc + qa_atsci_equalizer_nop.cc + qa_atsci_fake_single_viterbi.cc + qa_atsci_fs_correlator.cc + qa_atsci_single_viterbi.cc + qa_atsci_randomizer.cc + qa_atsci_reed_solomon.cc + qa_atsci_sliding_correlator.cc + qa_atsci_trellis_encoder.cc + qa_atsci_viterbi_decoder.cc + qa_convolutional_interleaver.cc + qa_atsci.cc + qa_interleaver_fifo.cc +) + +INCLUDE(GrTest) +SET(GR_TEST_TARGET_DEPS gnuradio-atsc) +ADD_EXECUTABLE(test_atsci ${test_atsci_sources} test_atsci.cc) +TARGET_LINK_LIBRARIES(test_atsci gnuradio-atsc gnuradio-core ${CPPUNIT_LIBRARIES}) +GR_ADD_TEST(atsci-test test_atsci) + +ENDIF(ENABLE_TESTING) + +######################################################################## +# Install public header files +######################################################################## +INSTALL(FILES + atsc_consts.h + atsc_derandomizer.h + atsc_randomizer.h + atsc_rs_decoder.h + atsc_rs_encoder.h + atsc_interleaver.h + atsc_deinterleaver.h + atsc_trellis_encoder.h + atsc_viterbi_decoder.h + atsc_ds_to_softds.h + atsc_field_sync_mux.h + atsc_field_sync_demux.h + atsc_equalizer.h + atsc_fs_checker.h + atsc_bit_timing_loop.h + atsc_fpll.h + atsc_depad.h + atsc_pad.h + atsc_types.h + atsci_basic_trellis_encoder.h + atsci_data_interleaver.h + atsci_diag_output.h + atsci_equalizer.h + atsci_equalizer_lms.h + atsci_equalizer_lms2.h + atsci_equalizer_nop.h + atsci_exp2_lp.h + atsci_fake_single_viterbi.h + atsci_fs_checker.h + atsci_fs_checker_naive.h + atsci_fs_correlator.h + atsci_fs_correlator_naive.h + atsci_pnXXX.h + atsci_randomizer.h + atsci_reed_solomon.h + atsci_root_raised_cosine.h + atsci_root_raised_cosine_bandpass.h + atsci_single_viterbi.h + atsci_slicer_agc.h + atsci_sliding_correlator.h + atsci_sssr.h + atsci_syminfo.h + atsci_sync_tag.h + atsci_trellis_encoder.h + atsci_viterbi_decoder.h + atsci_vsbtx_lp.h + convolutional_interleaver.h + create_atsci_equalizer.h + create_atsci_fs_checker.h + create_atsci_fs_correlator.h + fpll_btloop_coupling.h + interleaver_fifo.h + DESTINATION ${GR_INCLUDE_DIR}/gnuradio + COMPONENT "atsc_devel" +) + +######################################################################## +# Setup swig generation +######################################################################## +IF(ENABLE_PYTHON) +INCLUDE(GrPython) +INCLUDE(GrSwig) + +SET(GR_SWIG_INCLUDE_DIRS + ${GR_ATSC_INCLUDE_DIRS} + ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} +) + +SET(GR_SWIG_LIBRARIES gnuradio-atsc) + +GR_SWIG_MAKE(atsc atsc.i) + +GR_SWIG_INSTALL( + TARGETS atsc + DESTINATION ${GR_PYTHON_DIR}/gnuradio + COMPONENT "atsc_python" +) + +INSTALL( + FILES atsc.i + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig + COMPONENT "atsc_swig" +) + +ENDIF(ENABLE_PYTHON) diff --git a/gr-atsc/src/python/CMakeLists.txt b/gr-atsc/src/python/CMakeLists.txt new file mode 100644 index 000000000..a8394d3da --- /dev/null +++ b/gr-atsc/src/python/CMakeLists.txt @@ -0,0 +1,58 @@ +# Copyright 2011 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. + +######################################################################## +# Install python examples +######################################################################## +INCLUDE(GrPython) + +GR_PYTHON_INSTALL( + PROGRAMS + btl-fsd.py + fpll.py + interp.py + xlate.py + viterbi-out.py + DESTINATION ${GR_PKG_DATA_DIR}/examples/atsc + COMPONENT "atsc_examples" +) + +INSTALL( + FILES README + DESTINATION ${GR_PKG_DATA_DIR}/examples/atsc + COMPONENT "atsc_examples" +) + +######################################################################## +# Handle the unit tests +######################################################################## +IF(ENABLE_TESTING) +INCLUDE(GrTest) +FILE(GLOB py_qa_test_files "qa_*.py") +FOREACH(py_qa_test_file ${py_qa_test_files}) + GET_FILENAME_COMPONENT(py_qa_test_name ${py_qa_test_file} NAME_WE) + SET(GR_TEST_PYTHON_DIRS + ${CMAKE_BINARY_DIR}/gnuradio-core/src/python + ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig + ${CMAKE_BINARY_DIR}/gr-atsc/src/lib + ) + SET(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-atsc) + GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${py_qa_test_file}) +ENDFOREACH(py_qa_test_file) +ENDIF(ENABLE_TESTING) |