diff --git a/CMakeLists.txt b/CMakeLists.txt index d5f2a45b2..c77a24fc6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,14 +33,14 @@ endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) CMAKE_MINIMUM_REQUIRED (VERSION 2.6) PROJECT (SRSLTE) -LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules") -INCLUDE(SRSLTEVersion) #sets version information -INCLUDE(SRSLTEPackage) #setup cpack -INCLUDE(BuildMex) +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules") +include(SRSLTEVersion) #sets version information +include(SRSLTEPackage) #setup cpack +include(BuildMex) include(CTest) set( CTEST_MEMORYCHECK_COMMAND valgrind ) -CONFIGURE_FILE( +configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake" IMMEDIATE @ONLY) @@ -63,112 +63,112 @@ if (NOT EXISTS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") set(CMAKE_INSTALL_LIBDIR lib) endif() -SET(RUNTIME_DIR bin) -SET(LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}) -SET(INCLUDE_DIR include) -SET(MEX_DIR mex) -SET(DOC_DIR "share/doc/${CPACK_PACKAGE_NAME}") -SET(DATA_DIR share/${CPACK_PACKAGE_NAME}) +set(RUNTIME_DIR bin) +set(LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}) +set(INCLUDE_DIR include) +set(MEX_DIR mex) +set(DOC_DIR "share/doc/${CPACK_PACKAGE_NAME}") +set(DATA_DIR share/${CPACK_PACKAGE_NAME}) -IF(NOT CMAKE_BUILD_TYPE) - SET(CMAKE_BUILD_TYPE Release) - MESSAGE(STATUS "Build type not specified: defaulting to Release.") -ENDIF(NOT CMAKE_BUILD_TYPE) -SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) + message(STATUS "Build type not specified: defaulting to Release.") +endif(NOT CMAKE_BUILD_TYPE) +set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") ######################################################################## # Compiler specific setup ######################################################################## macro(ADD_CXX_COMPILER_FLAG_IF_AVAILABLE flag have) include(CheckCXXCompilerFlag) - CHECK_CXX_COMPILER_FLAG(${flag} ${have}) + check_cxx_compiler_flag(${flag} ${have}) if(${have}) add_definitions(${flag}) endif(${have}) endmacro(ADD_CXX_COMPILER_FLAG_IF_AVAILABLE) -IF(CMAKE_COMPILER_IS_GNUCXX) +if(CMAKE_COMPILER_IS_GNUCXX) #Any additional flags for CXX -ENDIF(CMAKE_COMPILER_IS_GNUCXX) +endif(CMAKE_COMPILER_IS_GNUCXX) -IF(CMAKE_COMPILER_IS_GNUCC) +if(CMAKE_COMPILER_IS_GNUCC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-write-strings -Wno-format-extra-args -Winline -Wno-unused-result -Wno-format -std=c99 -D_GNU_SOURCE -g") - IF(${CMAKE_BUILD_TYPE} STREQUAL "Debug") + if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0") - ELSE(${CMAKE_BUILD_TYPE} STREQUAL "Debug") - FIND_PACKAGE(SSE) - IF(HAVE_AVX) + else(${CMAKE_BUILD_TYPE} STREQUAL "Debug") + find_package(SSE) + if(HAVE_AVX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -mfpmath=sse -mavx -DLV_HAVE_AVX -DLV_HAVE_SSE") - ELSEIF(HAVE_SSE) + elseif(HAVE_SSE) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -mfpmath=sse -msse4.1 -DLV_HAVE_SSE") - ENDIF(HAVE_AVX) - ENDIF(${CMAKE_BUILD_TYPE} STREQUAL "Debug") + endif(HAVE_AVX) + endif(${CMAKE_BUILD_TYPE} STREQUAL "Debug") - IF(NOT WIN32) + if(NOT WIN32) ADD_CXX_COMPILER_FLAG_IF_AVAILABLE(-fvisibility=hidden HAVE_VISIBILITY_HIDDEN) - ENDIF(NOT WIN32) -ENDIF(CMAKE_COMPILER_IS_GNUCC) - -IF(MSVC) - INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/msvc) #missing headers - ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501) #minimum version required is windows xp - ADD_DEFINITIONS(-DNOMINMAX) #disables stupidity and enables std::min and std::max - ADD_DEFINITIONS( #stop all kinds of compatibility warnings + endif(NOT WIN32) +endif(CMAKE_COMPILER_IS_GNUCC) + +if(MSVC) + include_directories(${PROJECT_SOURCE_DIR}/msvc) #missing headers + add_definitions(-D_WIN32_WINNT=0x0501) #minimum version required is windows xp + add_definitions(-DNOMINMAX) #disables stupidity and enables std::min and std::max + add_definitions( #stop all kinds of compatibility warnings -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE ) - ADD_DEFINITIONS(/MP) #build with multiple processors -ENDIF(MSVC) + add_definitions(/MP) #build with multiple processors +endif(MSVC) -IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # The following is needed for weak linking to work under OS X - SET(CMAKE_SHARED_LINKER_FLAGS "-undefined dynamic_lookup") -ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(CMAKE_SHARED_LINKER_FLAGS "-undefined dynamic_lookup") +endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ######################################################################## # Create uninstall targets ######################################################################## -CONFIGURE_FILE( +configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) -ADD_CUSTOM_TARGET(uninstall +add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) ######################################################################## # Macro to add -fPIC property to static libs ######################################################################## -MACRO(SRSLTE_SET_PIC) - IF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" ) - SET_TARGET_PROPERTIES(${ARGV} PROPERTIES COMPILE_FLAGS -fPIC) - ENDIF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" ) -ENDMACRO(SRSLTE_SET_PIC) +macro(SRSLTE_SET_PIC) + if( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" ) + set_target_properties(${ARGV} PROPERTIES COMPILE_FLAGS -fPIC) + endif( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" ) +endmacro(SRSLTE_SET_PIC) ######################################################################## # Print summary ######################################################################## -MESSAGE(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}") -MESSAGE(STATUS "Building for version: ${VERSION}") +message(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}") +message(STATUS "Building for version: ${VERSION}") ######################################################################## # Add general includes and dependencies ######################################################################## -INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/srslte/include/) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/srslte/include/) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/mex/include) +include_directories(${PROJECT_BINARY_DIR}/srslte/include/) +include_directories(${PROJECT_SOURCE_DIR}/srslte/include/) +include_directories(${PROJECT_SOURCE_DIR}/mex/include) ######################################################################## # Add the subdirectories ######################################################################## -ADD_SUBDIRECTORY(srslte) -ADD_SUBDIRECTORY(mex) +add_subdirectory(srslte) +add_subdirectory(mex) diff --git a/cmake/modules/CheckFunctionExistsMath.cmake b/cmake/modules/CheckFunctionExistsMath.cmake index de276ef3f..82f371a0a 100644 --- a/cmake/modules/CheckFunctionExistsMath.cmake +++ b/cmake/modules/CheckFunctionExistsMath.cmake @@ -53,13 +53,13 @@ MACRO(CHECK_FUNCTION_EXISTS_MATH FUNCTION VARIABLE) IF(${VARIABLE}) SET(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}") MESSAGE(STATUS "Looking for ${FUNCTION} - found") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the function ${FUNCTION} exists passed with the following output:\n" "${OUTPUT}\n\n") ELSE(${VARIABLE}) MESSAGE(STATUS "Looking for ${FUNCTION} - not found") SET(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the function ${FUNCTION} exists failed with the following output:\n" "${OUTPUT}\n\n") ENDIF(${VARIABLE}) diff --git a/mex/CMakeLists.txt b/mex/CMakeLists.txt index a8017f423..51df7daea 100644 --- a/mex/CMakeLists.txt +++ b/mex/CMakeLists.txt @@ -31,19 +31,19 @@ if(NOT DisableMEX) ######################################################################## # Add headers to cmake project (useful for IDEs) ######################################################################## - SET(HEADERS_ALL "") - FILE(GLOB headers *) + set(HEADERS_ALL "") + file(GLOB headers *) FOREACH (_header ${headers}) - IF(IS_DIRECTORY ${_header}) - FILE(GLOB_RECURSE tmp "${_header}/*.h") - LIST(APPEND HEADERS_ALL ${tmp}) - ENDIF(IS_DIRECTORY ${_header}) + if(IS_DIRECTORY ${_header}) + file(GLOB_RECURSE tmp "${_header}/*.h") + list(APPEND HEADERS_ALL ${tmp}) + endif(IS_DIRECTORY ${_header}) ENDFOREACH() - ADD_CUSTOM_TARGET (add_mex_headers SOURCES ${HEADERS_ALL}) + add_custom_target (add_mex_headers SOURCES ${HEADERS_ALL}) ######################################################################## # Add the subdirectories ######################################################################## - ADD_SUBDIRECTORY(lib) + add_subdirectory(lib) endif() diff --git a/srslte/CMakeLists.txt b/srslte/CMakeLists.txt index cb1c27107..354e88281 100644 --- a/srslte/CMakeLists.txt +++ b/srslte/CMakeLists.txt @@ -29,31 +29,61 @@ INSTALL(DIRECTORY include/ ######################################################################## # Add headers to cmake project (useful for IDEs) ######################################################################## -SET(HEADERS_ALL "") -FILE(GLOB headers *) +set(HEADERS_ALL "") +file(GLOB headers *) FOREACH (_header ${headers}) - IF(IS_DIRECTORY ${_header}) - FILE(GLOB_RECURSE tmp "${_header}/*.h") - LIST(APPEND HEADERS_ALL ${tmp}) - ENDIF(IS_DIRECTORY ${_header}) + if(IS_DIRECTORY ${_header}) + file(GLOB_RECURSE tmp "${_header}/*.h") + list(APPEND HEADERS_ALL ${tmp}) + endif(IS_DIRECTORY ${_header}) ENDFOREACH() -ADD_CUSTOM_TARGET (add_srslte_headers SOURCES ${HEADERS_ALL}) +add_custom_target (add_srslte_headers SOURCES ${HEADERS_ALL}) ######################################################################## # Find Dependencies ######################################################################## -FIND_PACKAGE(UHD) -FIND_PACKAGE(bladeRF) +find_package(UHD) +find_package(bladeRF) -IF(BLADERF_FOUND OR UHD_FOUND) +if(UHD_FOUND) + include_directories(${UHD_INCLUDE_DIRS}) + link_directories(${UHD_LIBRARY_DIRS}) +endif(UHD_FOUND) + +if(BLADERF_FOUND) + include_directories(${BLADERF_INCLUDE_DIRS}) + link_directories(${BLADERF_LIBRARY_DIRS}) +endif(BLADERF_FOUND) + +if(BLADERF_FOUND OR UHD_FOUND) set(RF_FOUND TRUE CACHE INTERNAL "RF frontend found") -ELSE(BLADERF_FOUND OR UHD_FOUND) +else(BLADERF_FOUND OR UHD_FOUND) set(RF_FOUND FALSE CACHE INTERNAL "RF frontend found") -ENDIF(BLADERF_FOUND OR UHD_FOUND) + add_definitions(-DDISABLE_RF) +endif(BLADERF_FOUND OR UHD_FOUND) + +include(CheckFunctionExistsMath) +if(${DISABLE_VOLK}) + if(${DISABLE_VOLK} EQUAL 0) + find_package(Volk) + else(${DISABLE_VOLK} EQUAL 0) + message(STATUS "VOLK library disabled (DISABLE_VOLK=1)") + endif(${DISABLE_VOLK} EQUAL 0) +else(${DISABLE_VOLK}) + find_package(Volk) +endif(${DISABLE_VOLK}) + +if(VOLK_FOUND) + include_directories(${VOLK_INCLUDE_DIRS}) + link_directories(${VOLK_LIBRARY_DIRS}) + message(STATUS " Compiling with VOLK SIMD library.") +else(VOLK_FOUND) + message(STATUS " VOLK SIMD library NOT found. Using generic implementation.") +endif(VOLK_FOUND) ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(lib) -ADD_SUBDIRECTORY(include) -ADD_SUBDIRECTORY(examples) +add_subdirectory(lib) +add_subdirectory(include) +add_subdirectory(examples) diff --git a/srslte/examples/CMakeLists.txt b/srslte/examples/CMakeLists.txt index bf0f357e7..557083fd5 100644 --- a/srslte/examples/CMakeLists.txt +++ b/srslte/examples/CMakeLists.txt @@ -18,10 +18,6 @@ # and at http://www.gnu.org/licenses/. # -IF(UHD_FOUND) - LINK_DIRECTORIES(${UHD_LIBRARY_DIRS}) -ENDIF(UHD_FOUND) - ################################################################# # Applications @@ -40,28 +36,28 @@ target_link_libraries(pdsch_ue srslte pthread) add_executable(pdsch_enodeb pdsch_enodeb.c) target_link_libraries(pdsch_enodeb srslte pthread) -IF(RF_FOUND) +if(RF_FOUND) target_link_libraries(pdsch_ue srslte_rf) target_link_libraries(pdsch_enodeb srslte_rf) -ELSE(RF_FOUND) +else(RF_FOUND) add_definitions(-DDISABLE_RF) -ENDIF(RF_FOUND) +endif(RF_FOUND) -FIND_PACKAGE(SRSGUI) +find_package(SRSGUI) -IF(SRSGUI_FOUND) +if(SRSGUI_FOUND) include_directories(${SRSGUI_INCLUDE_DIRS}) target_link_libraries(pdsch_ue ${SRSGUI_LIBRARIES}) -ELSE(SRSGUI_FOUND) +else(SRSGUI_FOUND) add_definitions(-DDISABLE_GRAPHICS) -ENDIF(SRSGUI_FOUND) +endif(SRSGUI_FOUND) ################################################################# # These examples need the UHD driver ################################################################# -IF(RF_FOUND) +if(RF_FOUND) add_executable(cell_search cell_search.c) target_link_libraries(cell_search srslte srslte_rf) @@ -78,11 +74,11 @@ IF(RF_FOUND) add_executable(usrp_txrx usrp_txrx.c) target_link_libraries(usrp_txrx srslte srslte_rf) - MESSAGE(STATUS " examples will be installed.") + message(STATUS " examples will be installed.") -ELSE(RF_FOUND) - MESSAGE(STATUS " examples will NOT BE INSTALLED.") -ENDIF(RF_FOUND) +else(RF_FOUND) + message(STATUS " examples will NOT BE INSTALLED.") +endif(RF_FOUND) # Add subdirectories add_subdirectory(tutorial_examples) diff --git a/srslte/examples/pdsch_enodeb.c b/srslte/examples/pdsch_enodeb.c index 36b93d8d5..011164bd8 100644 --- a/srslte/examples/pdsch_enodeb.c +++ b/srslte/examples/pdsch_enodeb.c @@ -653,8 +653,8 @@ int main(int argc, char **argv) { start_of_burst=false; #endif } - nf++; } + nf++; sfn = (sfn + 1) % 1024; } diff --git a/srslte/examples/pdsch_ue.c b/srslte/examples/pdsch_ue.c index ee33392de..9dae833b0 100644 --- a/srslte/examples/pdsch_ue.c +++ b/srslte/examples/pdsch_ue.c @@ -256,7 +256,7 @@ int srslte_rf_recv_wrapper(void *h, void *data, uint32_t nsamples, srslte_timest return srslte_rf_recv(h, data, nsamples, 1); } -double srslte_rf_set_rx_gain_th_wrapper(void *h, double f) { +double srslte_rf_set_rx_gain_th_wrapper_(void *h, double f) { return srslte_rf_set_rx_gain_th((srslte_rf_t*) h, f); } @@ -440,7 +440,7 @@ int main(int argc, char **argv) { #ifndef DISABLE_RF if (prog_args.rf_gain < 0) { - srslte_ue_sync_start_agc(&ue_sync, srslte_rf_set_rx_gain_th_wrapper, cell_detect_config.init_agc); + srslte_ue_sync_start_agc(&ue_sync, srslte_rf_set_rx_gain_th_wrapper_, cell_detect_config.init_agc); } #endif #ifdef PRINT_CHANGE_SCHEDULIGN diff --git a/srslte/examples/tutorial_examples/CMakeLists.txt b/srslte/examples/tutorial_examples/CMakeLists.txt index cf139f515..a6b92f1f9 100644 --- a/srslte/examples/tutorial_examples/CMakeLists.txt +++ b/srslte/examples/tutorial_examples/CMakeLists.txt @@ -23,7 +23,7 @@ # EXAMPLES shown in WinnForum 2015 Tutorial ################################################################# -IF(SRSGUI_FOUND AND UHD_FOUND) +if(SRSGUI_FOUND AND UHD_FOUND) add_executable(pss pss.c) target_link_libraries(pss srslte ${SRSGUI_LIBRARIES} srslte_rf) @@ -31,5 +31,5 @@ IF(SRSGUI_FOUND AND UHD_FOUND) add_executable(simple_tx simple_tx.c) target_link_libraries(simple_tx srslte srslte_rf) -ENDIF(SRSGUI_FOUND AND UHD_FOUND) +endif(SRSGUI_FOUND AND UHD_FOUND) diff --git a/srslte/include/CMakeLists.txt b/srslte/include/CMakeLists.txt index 66657af2d..96888e1de 100644 --- a/srslte/include/CMakeLists.txt +++ b/srslte/include/CMakeLists.txt @@ -21,5 +21,5 @@ ######################################################################## # Add subdirectories ######################################################################## -ADD_SUBDIRECTORY(srslte) +add_subdirectory(srslte) diff --git a/srslte/include/srslte/CMakeLists.txt b/srslte/include/srslte/CMakeLists.txt index 3fe2e0ac9..0a0550b96 100644 --- a/srslte/include/srslte/CMakeLists.txt +++ b/srslte/include/srslte/CMakeLists.txt @@ -18,7 +18,7 @@ # and at http://www.gnu.org/licenses/. # -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h ) diff --git a/srslte/lib/CMakeLists.txt b/srslte/lib/CMakeLists.txt index 1b2cc2aa3..1c61c34d7 100644 --- a/srslte/lib/CMakeLists.txt +++ b/srslte/lib/CMakeLists.txt @@ -18,115 +18,49 @@ # and at http://www.gnu.org/licenses/. # - -######################################################################## -# Find Dependencies -######################################################################## -include(CheckFunctionExistsMath) - -FIND_PACKAGE(SRSGUI) -FIND_PACKAGE(FFTW3F REQUIRED) # TODO: distribute kissfft instead - -IF(${DISABLE_VOLK}) - IF(${DISABLE_VOLK} EQUAL 0) - FIND_PACKAGE(Volk) - ELSE(${DISABLE_VOLK} EQUAL 0) - MESSAGE(STATUS "VOLK library disabled (DISABLE_VOLK=1)") - ENDIF(${DISABLE_VOLK} EQUAL 0) -ELSE(${DISABLE_VOLK}) - FIND_PACKAGE(Volk) -ENDIF(${DISABLE_VOLK}) - -IF(VOLK_FOUND) - INCLUDE_DIRECTORIES(${VOLK_INCLUDE_DIRS}) - LINK_DIRECTORIES(${VOLK_LIBRARY_DIRS}) -ENDIF(VOLK_FOUND) - -IF(FFTW3F_FOUND) - INCLUDE_DIRECTORIES(${FFTW3F_INCLUDE_DIRS}) - LINK_DIRECTORIES(${FFTW3F_LIBRARY_DIRS}) -ENDIF(FFTW3F_FOUND) - -IF(SRSGUI_FOUND) - INCLUDE_DIRECTORIES(${SRSGUI_INCLUDE_DIRS}) - LINK_DIRECTORIES(${SRSGUI_LIBRARY_DIRS}) -ENDIF(SRSGUI_FOUND) - -######################################################################## -# Recurse subdirectories and compile all source files into the same lib -######################################################################## -FILE(GLOB modules *) -SET(SOURCES_ALL "") -FOREACH (_module ${modules}) - IF(IS_DIRECTORY ${_module}) - IF (NOT ${_module} MATCHES "rf") - FILE(GLOB_RECURSE tmp "${_module}/src/*.c") - LIST(APPEND SOURCES_ALL ${tmp}) - ENDIF (NOT ${_module} MATCHES "rf") - ENDIF(IS_DIRECTORY ${_module}) -ENDFOREACH() - -ADD_LIBRARY(srslte SHARED ${SOURCES_ALL}) -TARGET_LINK_LIBRARIES(srslte m ${FFTW3F_LIBRARIES}) -SET_TARGET_PROPERTIES(srslte - PROPERTIES VERSION ${SRSLTE_VERSION_MAJOR}.${SRSLTE_VERSION_MINOR} -) - -IF(RF_FOUND) - # Include common RF files - SET(SOURCES_RF "") - LIST(APPEND SOURCES_RF "rf/src/rf_imp.c" "rf/src/rf_utils.c") - - IF (UHD_FOUND) - INCLUDE_DIRECTORIES(${UHD_INCLUDE_DIRS}) - LINK_DIRECTORIES(${UHD_LIBRARY_DIRS}) - add_definitions(-DENABLE_UHD) - LIST(APPEND SOURCES_RF "rf/src/rf_uhd_imp.c" "rf/src/uhd_c_api.cpp") - ENDIF (UHD_FOUND) - - IF (BLADERF_FOUND) - INCLUDE_DIRECTORIES(${BLADERF_INCLUDE_DIRS}) - add_definitions(-DENABLE_BLADERF) - LIST(APPEND SOURCES_RF "rf/src/rf_blade_imp.c") - ENDIF (BLADERF_FOUND) - - ADD_LIBRARY(srslte_rf SHARED ${SOURCES_RF}) - SET_TARGET_PROPERTIES(srslte_rf - PROPERTIES VERSION ${SRSLTE_VERSION_MAJOR}.${SRSLTE_VERSION_MINOR} - ) - - IF (UHD_FOUND) - TARGET_LINK_LIBRARIES(srslte_rf ${UHD_LIBRARIES}) - ENDIF (UHD_FOUND) - - IF (BLADERF_FOUND) - TARGET_LINK_LIBRARIES(srslte_rf ${BLADERF_LIBRARIES}) - ENDIF (BLADERF_FOUND) - - INSTALL(TARGETS srslte_rf DESTINATION ${LIBRARY_DIR}) - SRSLTE_SET_PIC(srslte_rf) -ENDIF(RF_FOUND) +add_subdirectory(agc) +add_subdirectory(ch_estimation) +add_subdirectory(common) +add_subdirectory(fec) +add_subdirectory(mimo) +add_subdirectory(phch) +add_subdirectory(rf) +add_subdirectory(sync) +add_subdirectory(utils) +add_subdirectory(channel) +add_subdirectory(dft) +add_subdirectory(io) +add_subdirectory(modem) +add_subdirectory(resampling) +add_subdirectory(scrambling) +add_subdirectory(ue) + +add_library(srslte SHARED version.c) +target_link_libraries(srslte srslte_agc + srslte_ch_estimation + srslte_common + srslte_fec + srslte_mimo + srslte_phch + srslte_sync + srslte_utils + srslte_channel + srslte_dft + srslte_io + srslte_modem + srslte_resampling + srslte_scrambling + srslte_ue + srslte_rf + pthread) +set_target_properties(srslte PROPERTIES + VERSION ${SRSLTE_VERSION_MAJOR}.${SRSLTE_VERSION_MINOR}) + +if(VOLK_FOUND) + set_target_properties(srslte PROPERTIES COMPILE_DEFINITIONS "${VOLK_DEFINITIONS}") + target_link_libraries(srslte ${VOLK_LIBRARIES}) +endif(VOLK_FOUND) INSTALL(TARGETS srslte DESTINATION ${LIBRARY_DIR}) SRSLTE_SET_PIC(srslte) -IF(VOLK_FOUND) - INCLUDE_DIRECTORIES(${VOLK_INCLUDE_DIRS}) - SET_TARGET_PROPERTIES(srslte PROPERTIES COMPILE_DEFINITIONS "${VOLK_DEFINITIONS}") - TARGET_LINK_LIBRARIES(srslte ${VOLK_LIBRARIES}) - MESSAGE(STATUS " Compiling with VOLK SIMD library.") -ELSE(VOLK_FOUND) - MESSAGE(STATUS " VOLK SIMD library NOT found. Using generic implementation.") -ENDIF(VOLK_FOUND) - -######################################################################## -# Recurse subdirectories and find all directories with a CMakeLists.txt file in it -######################################################################## -FILE(GLOB_RECURSE cmakefiles CMakeLists.txt) -FOREACH (_file ${cmakefiles}) - GET_FILENAME_COMPONENT(dir ${_file} PATH) - IF (NOT ${dir} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) - ADD_SUBDIRECTORY(${dir}) - ENDIF () -ENDFOREACH() - diff --git a/srslte/lib/agc/CMakeLists.txt b/srslte/lib/agc/CMakeLists.txt new file mode 100644 index 000000000..cef47f1ba --- /dev/null +++ b/srslte/lib/agc/CMakeLists.txt @@ -0,0 +1,22 @@ +# +# Copyright 2013-2015 Software Radio Systems Limited +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE 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 Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +file(GLOB SOURCES "*.c") +add_library(srslte_agc ${SOURCES}) diff --git a/srslte/lib/agc/src/agc.c b/srslte/lib/agc/agc.c similarity index 100% rename from srslte/lib/agc/src/agc.c rename to srslte/lib/agc/agc.c diff --git a/srslte/lib/ch_estimation/CMakeLists.txt b/srslte/lib/ch_estimation/CMakeLists.txt new file mode 100644 index 000000000..9991720ff --- /dev/null +++ b/srslte/lib/ch_estimation/CMakeLists.txt @@ -0,0 +1,27 @@ +# +# Copyright 2013-2015 Software Radio Systems Limited +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE 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 Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +file(GLOB SOURCES "*.c") +add_library(srslte_ch_estimation ${SOURCES}) +target_link_libraries(srslte_ch_estimation srslte_common + srslte_resampling + srslte_utils + srslte_phch) +add_subdirectory(test) diff --git a/srslte/lib/ch_estimation/src/chest_dl.c b/srslte/lib/ch_estimation/chest_dl.c similarity index 100% rename from srslte/lib/ch_estimation/src/chest_dl.c rename to srslte/lib/ch_estimation/chest_dl.c diff --git a/srslte/lib/ch_estimation/src/refsignal_dl.c b/srslte/lib/ch_estimation/refsignal_dl.c similarity index 100% rename from srslte/lib/ch_estimation/src/refsignal_dl.c rename to srslte/lib/ch_estimation/refsignal_dl.c diff --git a/srslte/lib/ch_estimation/src/refsignal_ul.c b/srslte/lib/ch_estimation/refsignal_ul.c similarity index 100% rename from srslte/lib/ch_estimation/src/refsignal_ul.c rename to srslte/lib/ch_estimation/refsignal_ul.c diff --git a/srslte/lib/ch_estimation/test/CMakeLists.txt b/srslte/lib/ch_estimation/test/CMakeLists.txt index 4fff63002..ecd0a25db 100644 --- a/srslte/lib/ch_estimation/test/CMakeLists.txt +++ b/srslte/lib/ch_estimation/test/CMakeLists.txt @@ -22,16 +22,16 @@ # Downlink Channel Estimation TEST ######################################################################## -ADD_EXECUTABLE(chest_test_dl chest_test_dl.c) -TARGET_LINK_LIBRARIES(chest_test_dl srslte) +add_executable(chest_test_dl chest_test_dl.c) +target_link_libraries(chest_test_dl srslte) -ADD_TEST(chest_test_dl_cellid0 chest_test_dl -c 0) -ADD_TEST(chest_test_dl_cellid1 chest_test_dl -c 1) -ADD_TEST(chest_test_dl_cellid2 chest_test_dl -c 2) +add_test(chest_test_dl_cellid0 chest_test_dl -c 0) +add_test(chest_test_dl_cellid1 chest_test_dl -c 1) +add_test(chest_test_dl_cellid2 chest_test_dl -c 2) -ADD_TEST(chest_test_dl_cellid0 chest_test_dl -c 0 -r 50) -ADD_TEST(chest_test_dl_cellid1 chest_test_dl -c 1 -r 50) -ADD_TEST(chest_test_dl_cellid2 chest_test_dl -c 2 -r 50) +add_test(chest_test_dl_cellid0 chest_test_dl -c 0 -r 50) +add_test(chest_test_dl_cellid1 chest_test_dl -c 1 -r 50) +add_test(chest_test_dl_cellid2 chest_test_dl -c 2 -r 50) ######################################################################## # Downlink MEX libs @@ -44,8 +44,8 @@ BuildMex(MEXNAME chest SOURCES chest_test_dl_mex.c LIBRARIES srslte srslte_mex) # Uplink Channel Estimation TEST ######################################################################## -ADD_EXECUTABLE(refsignal_ul_test_all refsignal_ul_test.c) -TARGET_LINK_LIBRARIES(refsignal_ul_test_all srslte) +add_executable(refsignal_ul_test_all refsignal_ul_test.c) +target_link_libraries(refsignal_ul_test_all srslte) BuildMex(MEXNAME refsignal_pusch SOURCES refsignal_pusch_mex.c LIBRARIES srslte srslte_mex) diff --git a/srslte/lib/ch_estimation/src/ul_rs_tables.h b/srslte/lib/ch_estimation/ul_rs_tables.h similarity index 100% rename from srslte/lib/ch_estimation/src/ul_rs_tables.h rename to srslte/lib/ch_estimation/ul_rs_tables.h diff --git a/srslte/lib/channel/CMakeLists.txt b/srslte/lib/channel/CMakeLists.txt new file mode 100644 index 000000000..f876f524b --- /dev/null +++ b/srslte/lib/channel/CMakeLists.txt @@ -0,0 +1,22 @@ +# +# Copyright 2013-2015 Software Radio Systems Limited +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE 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 Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +file(GLOB SOURCES "*.c") +add_library(srslte_channel ${SOURCES}) diff --git a/srslte/lib/channel/src/ch_awgn.c b/srslte/lib/channel/ch_awgn.c similarity index 100% rename from srslte/lib/channel/src/ch_awgn.c rename to srslte/lib/channel/ch_awgn.c diff --git a/srslte/lib/channel/src/gauss.c b/srslte/lib/channel/gauss.c similarity index 100% rename from srslte/lib/channel/src/gauss.c rename to srslte/lib/channel/gauss.c diff --git a/srslte/lib/channel/src/gauss.h b/srslte/lib/channel/gauss.h similarity index 100% rename from srslte/lib/channel/src/gauss.h rename to srslte/lib/channel/gauss.h diff --git a/srslte/lib/common/CMakeLists.txt b/srslte/lib/common/CMakeLists.txt new file mode 100644 index 000000000..fa6b96450 --- /dev/null +++ b/srslte/lib/common/CMakeLists.txt @@ -0,0 +1,22 @@ +# +# Copyright 2013-2015 Software Radio Systems Limited +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE 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 Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +file(GLOB SOURCES "*.c") +add_library(srslte_common ${SOURCES}) diff --git a/srslte/lib/common/src/phy_common.c b/srslte/lib/common/phy_common.c similarity index 100% rename from srslte/lib/common/src/phy_common.c rename to srslte/lib/common/phy_common.c diff --git a/srslte/lib/common/src/sequence.c b/srslte/lib/common/sequence.c similarity index 100% rename from srslte/lib/common/src/sequence.c rename to srslte/lib/common/sequence.c diff --git a/srslte/lib/common/src/timestamp.c b/srslte/lib/common/timestamp.c similarity index 100% rename from srslte/lib/common/src/timestamp.c rename to srslte/lib/common/timestamp.c diff --git a/srslte/lib/dft/CMakeLists.txt b/srslte/lib/dft/CMakeLists.txt new file mode 100644 index 000000000..7eb2f0ea8 --- /dev/null +++ b/srslte/lib/dft/CMakeLists.txt @@ -0,0 +1,35 @@ +# +# Copyright 2013-2015 Software Radio Systems Limited +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE 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 Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + + + +find_package(FFTW3F REQUIRED) +if(FFTW3F_FOUND) + include_directories(${FFTW3F_INCLUDE_DIRS}) + link_directories(${FFTW3F_LIBRARY_DIRS}) +endif(FFTW3F_FOUND) + +set(SRCS dft_fftw.c dft_precoding.c ofdm.c) +add_library(srslte_dft ${SRCS}) +target_link_libraries(srslte_dft srslte_utils + m + ${FFTW3F_LIBRARIES}) + +add_subdirectory(test) diff --git a/srslte/lib/dft/src/dft.c b/srslte/lib/dft/dft_fftw.c similarity index 100% rename from srslte/lib/dft/src/dft.c rename to srslte/lib/dft/dft_fftw.c diff --git a/srslte/lib/dft/src/dft_precoding.c b/srslte/lib/dft/dft_precoding.c similarity index 100% rename from srslte/lib/dft/src/dft_precoding.c rename to srslte/lib/dft/dft_precoding.c diff --git a/srslte/lib/dft/src/ofdm.c b/srslte/lib/dft/ofdm.c similarity index 100% rename from srslte/lib/dft/src/ofdm.c rename to srslte/lib/dft/ofdm.c diff --git a/srslte/lib/dft/test/CMakeLists.txt b/srslte/lib/dft/test/CMakeLists.txt index 500a5e2cb..0fc781cfd 100644 --- a/srslte/lib/dft/test/CMakeLists.txt +++ b/srslte/lib/dft/test/CMakeLists.txt @@ -22,12 +22,12 @@ # FFT TEST ######################################################################## -ADD_EXECUTABLE(ofdm_test ofdm_test.c) -TARGET_LINK_LIBRARIES(ofdm_test srslte) +add_executable(ofdm_test ofdm_test.c) +target_link_libraries(ofdm_test srslte) -ADD_TEST(ofdm_normal ofdm_test) -ADD_TEST(ofdm_extended ofdm_test -e) +add_test(ofdm_normal ofdm_test) +add_test(ofdm_extended ofdm_test -e) -ADD_TEST(ofdm_normal_single ofdm_test -n 6) -ADD_TEST(ofdm_extended_single ofdm_test -e -n 6) +add_test(ofdm_normal_single ofdm_test -n 6) +add_test(ofdm_extended_single ofdm_test -e -n 6) diff --git a/srslte/lib/fec/CMakeLists.txt b/srslte/lib/fec/CMakeLists.txt new file mode 100644 index 000000000..7d73d6938 --- /dev/null +++ b/srslte/lib/fec/CMakeLists.txt @@ -0,0 +1,24 @@ +# +# Copyright 2013-2015 Software Radio Systems Limited +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE 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 Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +file(GLOB SOURCES "*.c") +add_library(srslte_fec ${SOURCES}) +target_link_libraries(srslte_fec srslte_utils) +add_subdirectory(test) diff --git a/srslte/lib/fec/src/cbsegm.c b/srslte/lib/fec/cbsegm.c similarity index 100% rename from srslte/lib/fec/src/cbsegm.c rename to srslte/lib/fec/cbsegm.c diff --git a/srslte/lib/fec/src/convcoder.c b/srslte/lib/fec/convcoder.c similarity index 100% rename from srslte/lib/fec/src/convcoder.c rename to srslte/lib/fec/convcoder.c diff --git a/srslte/lib/fec/src/crc.c b/srslte/lib/fec/crc.c similarity index 100% rename from srslte/lib/fec/src/crc.c rename to srslte/lib/fec/crc.c diff --git a/srslte/lib/fec/src/parity.c b/srslte/lib/fec/parity.c similarity index 100% rename from srslte/lib/fec/src/parity.c rename to srslte/lib/fec/parity.c diff --git a/srslte/lib/fec/src/parity.h b/srslte/lib/fec/parity.h similarity index 100% rename from srslte/lib/fec/src/parity.h rename to srslte/lib/fec/parity.h diff --git a/srslte/lib/fec/src/rm_conv.c b/srslte/lib/fec/rm_conv.c similarity index 100% rename from srslte/lib/fec/src/rm_conv.c rename to srslte/lib/fec/rm_conv.c diff --git a/srslte/lib/fec/src/rm_turbo.c b/srslte/lib/fec/rm_turbo.c similarity index 100% rename from srslte/lib/fec/src/rm_turbo.c rename to srslte/lib/fec/rm_turbo.c diff --git a/srslte/lib/fec/src/softbuffer.c b/srslte/lib/fec/softbuffer.c similarity index 100% rename from srslte/lib/fec/src/softbuffer.c rename to srslte/lib/fec/softbuffer.c diff --git a/srslte/lib/fec/src/tc_interl_lte.c b/srslte/lib/fec/tc_interl_lte.c similarity index 100% rename from srslte/lib/fec/src/tc_interl_lte.c rename to srslte/lib/fec/tc_interl_lte.c diff --git a/srslte/lib/fec/src/tc_interl_umts.c b/srslte/lib/fec/tc_interl_umts.c similarity index 100% rename from srslte/lib/fec/src/tc_interl_umts.c rename to srslte/lib/fec/tc_interl_umts.c diff --git a/srslte/lib/fec/test/CMakeLists.txt b/srslte/lib/fec/test/CMakeLists.txt index b87076ec9..2a240d591 100644 --- a/srslte/lib/fec/test/CMakeLists.txt +++ b/srslte/lib/fec/test/CMakeLists.txt @@ -23,53 +23,53 @@ # RATEMATCHING TEST ######################################################################## -ADD_EXECUTABLE(rm_conv_test rm_conv_test.c) -TARGET_LINK_LIBRARIES(rm_conv_test srslte) +add_executable(rm_conv_test rm_conv_test.c) +target_link_libraries(rm_conv_test srslte) -ADD_EXECUTABLE(rm_turbo_test rm_turbo_test.c) -TARGET_LINK_LIBRARIES(rm_turbo_test srslte) +add_executable(rm_turbo_test rm_turbo_test.c) +target_link_libraries(rm_turbo_test srslte) -ADD_TEST(rm_conv_test_1 rm_conv_test -t 480 -r 1920) -ADD_TEST(rm_conv_test_2 rm_conv_test -t 1920 -r 480) +add_test(rm_conv_test_1 rm_conv_test -t 480 -r 1920) +add_test(rm_conv_test_2 rm_conv_test -t 1920 -r 480) -ADD_TEST(rm_turbo_test_1 rm_turbo_test -e 1920) -ADD_TEST(rm_turbo_test_2 rm_turbo_test -e 8192) +add_test(rm_turbo_test_1 rm_turbo_test -e 1920) +add_test(rm_turbo_test_2 rm_turbo_test -e 8192) BuildMex(MEXNAME rm_turbo_rx SOURCES rm_turbo_rx_mex.c LIBRARIES srslte srslte_mex) ######################################################################## # Turbo Coder TEST ######################################################################## -ADD_EXECUTABLE(turbodecoder_test turbodecoder_test.c) -TARGET_LINK_LIBRARIES(turbodecoder_test srslte) +add_executable(turbodecoder_test turbodecoder_test.c) +target_link_libraries(turbodecoder_test srslte) -ADD_TEST(turbodecoder_test_504_1 turbodecoder_test -n 100 -s 1 -l 504 -e 1.0 -t) -ADD_TEST(turbodecoder_test_504_2 turbodecoder_test -n 100 -s 1 -l 504 -e 2.0 -t) -ADD_TEST(turbodecoder_test_6114_1_5 turbodecoder_test -n 100 -s 1 -l 6144 -e 1.5 -t) -ADD_TEST(turbodecoder_test_known turbodecoder_test -n 1 -s 1 -k -e 0.5) +add_test(turbodecoder_test_504_1 turbodecoder_test -n 100 -s 1 -l 504 -e 1.0 -t) +add_test(turbodecoder_test_504_2 turbodecoder_test -n 100 -s 1 -l 504 -e 2.0 -t) +add_test(turbodecoder_test_6114_1_5 turbodecoder_test -n 100 -s 1 -l 6144 -e 1.5 -t) +add_test(turbodecoder_test_known turbodecoder_test -n 1 -s 1 -k -e 0.5) BuildMex(MEXNAME turbodecoder SOURCES turbodecoder_test_mex.c LIBRARIES srslte srslte_mex) -ADD_EXECUTABLE(turbocoder_test turbocoder_test.c) -TARGET_LINK_LIBRARIES(turbocoder_test srslte) -ADD_TEST(turbocoder_test_all turbocoder_test) +add_executable(turbocoder_test turbocoder_test.c) +target_link_libraries(turbocoder_test srslte) +add_test(turbocoder_test_all turbocoder_test) ######################################################################## # Viterbi TEST ######################################################################## -ADD_EXECUTABLE(viterbi_test viterbi_test.c) -TARGET_LINK_LIBRARIES(viterbi_test srslte) +add_executable(viterbi_test viterbi_test.c) +target_link_libraries(viterbi_test srslte) -ADD_TEST(viterbi_40_0 viterbi_test -n 1000 -s 1 -l 40 -t -e 0.0) -ADD_TEST(viterbi_40_2 viterbi_test -n 1000 -s 1 -l 40 -t -e 2.0) -ADD_TEST(viterbi_40_3 viterbi_test -n 1000 -s 1 -l 40 -t -e 3.0) -ADD_TEST(viterbi_40_4 viterbi_test -n 1000 -s 1 -l 40 -t -e 4.5) +add_test(viterbi_40_0 viterbi_test -n 1000 -s 1 -l 40 -t -e 0.0) +add_test(viterbi_40_2 viterbi_test -n 1000 -s 1 -l 40 -t -e 2.0) +add_test(viterbi_40_3 viterbi_test -n 1000 -s 1 -l 40 -t -e 3.0) +add_test(viterbi_40_4 viterbi_test -n 1000 -s 1 -l 40 -t -e 4.5) -ADD_TEST(viterbi_1000_0 viterbi_test -n 100 -s 1 -l 1000 -t -e 0.0) -ADD_TEST(viterbi_1000_2 viterbi_test -n 100 -s 1 -l 1000 -t -e 2.0) -ADD_TEST(viterbi_1000_3 viterbi_test -n 100 -s 1 -l 1000 -t -e 3.0) -ADD_TEST(viterbi_1000_4 viterbi_test -n 100 -s 1 -l 1000 -t -e 4.5) +add_test(viterbi_1000_0 viterbi_test -n 100 -s 1 -l 1000 -t -e 0.0) +add_test(viterbi_1000_2 viterbi_test -n 100 -s 1 -l 1000 -t -e 2.0) +add_test(viterbi_1000_3 viterbi_test -n 100 -s 1 -l 1000 -t -e 3.0) +add_test(viterbi_1000_4 viterbi_test -n 100 -s 1 -l 1000 -t -e 4.5) BuildMex(MEXNAME viterbi SOURCES viterbi_test_mex.c LIBRARIES srslte srslte_mex) @@ -77,12 +77,12 @@ BuildMex(MEXNAME viterbi SOURCES viterbi_test_mex.c LIBRARIES srslte srslte_mex) # CRC TEST ######################################################################## -ADD_EXECUTABLE(crc_test crc_test.c) -TARGET_LINK_LIBRARIES(crc_test srslte) +add_executable(crc_test crc_test.c) +target_link_libraries(crc_test srslte) -ADD_TEST(crc_24A crc_test -n 5001 -l 24 -p 0x1864CFB -s 1) -ADD_TEST(crc_24B crc_test -n 5001 -l 24 -p 0x1800063 -s 1) -ADD_TEST(crc_16 crc_test -n 5001 -l 16 -p 0x11021 -s 1) -ADD_TEST(crc_8 crc_test -n 5001 -l 8 -p 0x19B -s 1) +add_test(crc_24A crc_test -n 5001 -l 24 -p 0x1864CFB -s 1) +add_test(crc_24B crc_test -n 5001 -l 24 -p 0x1800063 -s 1) +add_test(crc_16 crc_test -n 5001 -l 16 -p 0x11021 -s 1) +add_test(crc_8 crc_test -n 5001 -l 8 -p 0x19B -s 1) diff --git a/srslte/lib/fec/src/turbocoder.c b/srslte/lib/fec/turbocoder.c similarity index 100% rename from srslte/lib/fec/src/turbocoder.c rename to srslte/lib/fec/turbocoder.c diff --git a/srslte/lib/fec/src/turbodecoder.c b/srslte/lib/fec/turbodecoder.c similarity index 100% rename from srslte/lib/fec/src/turbodecoder.c rename to srslte/lib/fec/turbodecoder.c diff --git a/srslte/lib/fec/src/turbodecoder_gen.c b/srslte/lib/fec/turbodecoder_gen.c similarity index 100% rename from srslte/lib/fec/src/turbodecoder_gen.c rename to srslte/lib/fec/turbodecoder_gen.c diff --git a/srslte/lib/fec/src/turbodecoder_sse.c b/srslte/lib/fec/turbodecoder_sse.c similarity index 100% rename from srslte/lib/fec/src/turbodecoder_sse.c rename to srslte/lib/fec/turbodecoder_sse.c diff --git a/srslte/lib/fec/src/viterbi.c b/srslte/lib/fec/viterbi.c similarity index 100% rename from srslte/lib/fec/src/viterbi.c rename to srslte/lib/fec/viterbi.c diff --git a/srslte/lib/fec/src/viterbi37.h b/srslte/lib/fec/viterbi37.h similarity index 100% rename from srslte/lib/fec/src/viterbi37.h rename to srslte/lib/fec/viterbi37.h diff --git a/srslte/lib/fec/src/viterbi37_port.c b/srslte/lib/fec/viterbi37_port.c similarity index 100% rename from srslte/lib/fec/src/viterbi37_port.c rename to srslte/lib/fec/viterbi37_port.c diff --git a/srslte/lib/fec/src/viterbi37_sse.c b/srslte/lib/fec/viterbi37_sse.c similarity index 100% rename from srslte/lib/fec/src/viterbi37_sse.c rename to srslte/lib/fec/viterbi37_sse.c diff --git a/srslte/lib/io/CMakeLists.txt b/srslte/lib/io/CMakeLists.txt new file mode 100644 index 000000000..03dadbe50 --- /dev/null +++ b/srslte/lib/io/CMakeLists.txt @@ -0,0 +1,22 @@ +# +# Copyright 2013-2015 Software Radio Systems Limited +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE 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 Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +file(GLOB SOURCES "*.c") +add_library(srslte_io ${SOURCES}) diff --git a/srslte/lib/io/src/binsource.c b/srslte/lib/io/binsource.c similarity index 100% rename from srslte/lib/io/src/binsource.c rename to srslte/lib/io/binsource.c diff --git a/srslte/lib/io/src/filesink.c b/srslte/lib/io/filesink.c similarity index 100% rename from srslte/lib/io/src/filesink.c rename to srslte/lib/io/filesink.c diff --git a/srslte/lib/io/src/filesource.c b/srslte/lib/io/filesource.c similarity index 100% rename from srslte/lib/io/src/filesource.c rename to srslte/lib/io/filesource.c diff --git a/srslte/lib/io/src/netsink.c b/srslte/lib/io/netsink.c similarity index 100% rename from srslte/lib/io/src/netsink.c rename to srslte/lib/io/netsink.c diff --git a/srslte/lib/io/src/netsource.c b/srslte/lib/io/netsource.c similarity index 100% rename from srslte/lib/io/src/netsource.c rename to srslte/lib/io/netsource.c diff --git a/srslte/lib/mimo/CMakeLists.txt b/srslte/lib/mimo/CMakeLists.txt new file mode 100644 index 000000000..261f47964 --- /dev/null +++ b/srslte/lib/mimo/CMakeLists.txt @@ -0,0 +1,23 @@ +# +# Copyright 2013-2015 Software Radio Systems Limited +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE 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 Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +file(GLOB SOURCES "*.c") +add_library(srslte_mimo ${SOURCES}) +add_subdirectory(test) diff --git a/srslte/lib/mimo/src/layermap.c b/srslte/lib/mimo/layermap.c similarity index 100% rename from srslte/lib/mimo/src/layermap.c rename to srslte/lib/mimo/layermap.c diff --git a/srslte/lib/mimo/src/precoding.c b/srslte/lib/mimo/precoding.c similarity index 100% rename from srslte/lib/mimo/src/precoding.c rename to srslte/lib/mimo/precoding.c diff --git a/srslte/lib/mimo/test/CMakeLists.txt b/srslte/lib/mimo/test/CMakeLists.txt index 28cd4a772..8a633c9b1 100644 --- a/srslte/lib/mimo/test/CMakeLists.txt +++ b/srslte/lib/mimo/test/CMakeLists.txt @@ -22,43 +22,43 @@ # LAYER MAPPING TEST ######################################################################## -ADD_EXECUTABLE(layermap_test layermap_test.c) -TARGET_LINK_LIBRARIES(layermap_test srslte) +add_executable(layermap_test layermap_test.c) +target_link_libraries(layermap_test srslte) -ADD_TEST(layermap_single layermap_test -n 1000 -m single -c 1 -l 1) +add_test(layermap_single layermap_test -n 1000 -m single -c 1 -l 1) -ADD_TEST(layermap_diversity_2 layermap_test -n 1000 -m diversity -c 1 -l 2) -ADD_TEST(layermap_diversity_4 layermap_test -n 1000 -m diversity -c 1 -l 4) +add_test(layermap_diversity_2 layermap_test -n 1000 -m diversity -c 1 -l 2) +add_test(layermap_diversity_4 layermap_test -n 1000 -m diversity -c 1 -l 4) -ADD_TEST(layermap_multiplex_11 layermap_test -n 1000 -m multiplex -c 1 -l 1) -ADD_TEST(layermap_multiplex_12 layermap_test -n 1000 -m multiplex -c 1 -l 2) -ADD_TEST(layermap_multiplex_13 layermap_test -n 1002 -m multiplex -c 1 -l 3) -ADD_TEST(layermap_multiplex_14 layermap_test -n 1000 -m multiplex -c 1 -l 4) -ADD_TEST(layermap_multiplex_15 layermap_test -n 1000 -m multiplex -c 1 -l 5) -ADD_TEST(layermap_multiplex_16 layermap_test -n 1002 -m multiplex -c 1 -l 6) -ADD_TEST(layermap_multiplex_17 layermap_test -n 994 -m multiplex -c 1 -l 7) -ADD_TEST(layermap_multiplex_18 layermap_test -n 1000 -m multiplex -c 1 -l 8) +add_test(layermap_multiplex_11 layermap_test -n 1000 -m multiplex -c 1 -l 1) +add_test(layermap_multiplex_12 layermap_test -n 1000 -m multiplex -c 1 -l 2) +add_test(layermap_multiplex_13 layermap_test -n 1002 -m multiplex -c 1 -l 3) +add_test(layermap_multiplex_14 layermap_test -n 1000 -m multiplex -c 1 -l 4) +add_test(layermap_multiplex_15 layermap_test -n 1000 -m multiplex -c 1 -l 5) +add_test(layermap_multiplex_16 layermap_test -n 1002 -m multiplex -c 1 -l 6) +add_test(layermap_multiplex_17 layermap_test -n 994 -m multiplex -c 1 -l 7) +add_test(layermap_multiplex_18 layermap_test -n 1000 -m multiplex -c 1 -l 8) -ADD_TEST(layermap_multiplex_22 layermap_test -n 1000 -m multiplex -c 2 -l 2) -ADD_TEST(layermap_multiplex_23 layermap_test -n 1002 -m multiplex -c 2 -l 3) -ADD_TEST(layermap_multiplex_24 layermap_test -n 1000 -m multiplex -c 2 -l 4) -ADD_TEST(layermap_multiplex_25 layermap_test -n 1002 -m multiplex -c 2 -l 5) -ADD_TEST(layermap_multiplex_26 layermap_test -n 1002 -m multiplex -c 2 -l 6) -ADD_TEST(layermap_multiplex_27 layermap_test -n 1000 -m multiplex -c 2 -l 7) -ADD_TEST(layermap_multiplex_28 layermap_test -n 1000 -m multiplex -c 2 -l 8) +add_test(layermap_multiplex_22 layermap_test -n 1000 -m multiplex -c 2 -l 2) +add_test(layermap_multiplex_23 layermap_test -n 1002 -m multiplex -c 2 -l 3) +add_test(layermap_multiplex_24 layermap_test -n 1000 -m multiplex -c 2 -l 4) +add_test(layermap_multiplex_25 layermap_test -n 1002 -m multiplex -c 2 -l 5) +add_test(layermap_multiplex_26 layermap_test -n 1002 -m multiplex -c 2 -l 6) +add_test(layermap_multiplex_27 layermap_test -n 1000 -m multiplex -c 2 -l 7) +add_test(layermap_multiplex_28 layermap_test -n 1000 -m multiplex -c 2 -l 8) ######################################################################## # LAYER MAPPING TEST ######################################################################## -ADD_EXECUTABLE(precoding_test precoding_test.c) -TARGET_LINK_LIBRARIES(precoding_test srslte) +add_executable(precoding_test precoding_test.c) +target_link_libraries(precoding_test srslte) -ADD_TEST(precoding_single precoding_test -n 1000 -m single) -ADD_TEST(precoding_diversity2 precoding_test -n 1000 -m diversity -l 2 -p 2) -ADD_TEST(precoding_diversity4 precoding_test -n 1024 -m diversity -l 4 -p 4) +add_test(precoding_single precoding_test -n 1000 -m single) +add_test(precoding_diversity2 precoding_test -n 1000 -m diversity -l 2 -p 2) +add_test(precoding_diversity4 precoding_test -n 1024 -m diversity -l 4 -p 4) # MEX file for predecoding and layer demapping test diff --git a/srslte/lib/modem/CMakeLists.txt b/srslte/lib/modem/CMakeLists.txt new file mode 100644 index 000000000..94ec0754e --- /dev/null +++ b/srslte/lib/modem/CMakeLists.txt @@ -0,0 +1,23 @@ +# +# Copyright 2013-2015 Software Radio Systems Limited +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE 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 Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +file(GLOB SOURCES "*.c") +add_library(srslte_modem ${SOURCES}) +add_subdirectory(test) diff --git a/srslte/lib/modem/src/demod_hard.c b/srslte/lib/modem/demod_hard.c similarity index 100% rename from srslte/lib/modem/src/demod_hard.c rename to srslte/lib/modem/demod_hard.c diff --git a/srslte/lib/modem/src/demod_soft.c b/srslte/lib/modem/demod_soft.c similarity index 100% rename from srslte/lib/modem/src/demod_soft.c rename to srslte/lib/modem/demod_soft.c diff --git a/srslte/lib/modem/src/hard_demod_lte.c b/srslte/lib/modem/hard_demod_lte.c similarity index 100% rename from srslte/lib/modem/src/hard_demod_lte.c rename to srslte/lib/modem/hard_demod_lte.c diff --git a/srslte/lib/modem/src/hard_demod_lte.h b/srslte/lib/modem/hard_demod_lte.h similarity index 100% rename from srslte/lib/modem/src/hard_demod_lte.h rename to srslte/lib/modem/hard_demod_lte.h diff --git a/srslte/lib/modem/src/lte_tables.c b/srslte/lib/modem/lte_tables.c similarity index 100% rename from srslte/lib/modem/src/lte_tables.c rename to srslte/lib/modem/lte_tables.c diff --git a/srslte/lib/modem/src/lte_tables.h b/srslte/lib/modem/lte_tables.h similarity index 100% rename from srslte/lib/modem/src/lte_tables.h rename to srslte/lib/modem/lte_tables.h diff --git a/srslte/lib/modem/src/mod.c b/srslte/lib/modem/mod.c similarity index 100% rename from srslte/lib/modem/src/mod.c rename to srslte/lib/modem/mod.c diff --git a/srslte/lib/modem/src/modem_table.c b/srslte/lib/modem/modem_table.c similarity index 100% rename from srslte/lib/modem/src/modem_table.c rename to srslte/lib/modem/modem_table.c diff --git a/srslte/lib/modem/test/CMakeLists.txt b/srslte/lib/modem/test/CMakeLists.txt index 61aaedab4..f3bff6175 100644 --- a/srslte/lib/modem/test/CMakeLists.txt +++ b/srslte/lib/modem/test/CMakeLists.txt @@ -22,21 +22,21 @@ # MODEM TEST ######################################################################## -ADD_EXECUTABLE(modem_test modem_test.c) -TARGET_LINK_LIBRARIES(modem_test srslte) +add_executable(modem_test modem_test.c) +target_link_libraries(modem_test srslte) -ADD_TEST(modem_bpsk modem_test -n 1024 -m 1) -ADD_TEST(modem_qpsk modem_test -n 1024 -m 2) -ADD_TEST(modem_qam16 modem_test -n 1024 -m 4) -ADD_TEST(modem_qam64 modem_test -n 1008 -m 6) +add_test(modem_bpsk modem_test -n 1024 -m 1) +add_test(modem_qpsk modem_test -n 1024 -m 2) +add_test(modem_qam16 modem_test -n 1024 -m 4) +add_test(modem_qam64 modem_test -n 1008 -m 6) -ADD_TEST(modem_bpsk_soft modem_test -n 1024 -m 1) -ADD_TEST(modem_qpsk_soft modem_test -n 1024 -m 2) -ADD_TEST(modem_qam16_soft modem_test -n 1024 -m 4) -ADD_TEST(modem_qam64_soft modem_test -n 1008 -m 6) +add_test(modem_bpsk_soft modem_test -n 1024 -m 1) +add_test(modem_qpsk_soft modem_test -n 1024 -m 2) +add_test(modem_qam16_soft modem_test -n 1024 -m 4) +add_test(modem_qam64_soft modem_test -n 1008 -m 6) -ADD_EXECUTABLE(soft_demod_test soft_demod_test.c) -TARGET_LINK_LIBRARIES(soft_demod_test srslte) +add_executable(soft_demod_test soft_demod_test.c) +target_link_libraries(soft_demod_test srslte) diff --git a/srslte/lib/phch/CMakeLists.txt b/srslte/lib/phch/CMakeLists.txt new file mode 100644 index 000000000..e203ee7ea --- /dev/null +++ b/srslte/lib/phch/CMakeLists.txt @@ -0,0 +1,29 @@ +# +# Copyright 2013-2015 Software Radio Systems Limited +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE 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 Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +file(GLOB SOURCES "*.c") +add_library(srslte_phch ${SOURCES}) +target_link_libraries(srslte_phch srslte_common + srslte_mimo + srslte_fec + srslte_modem + srslte_scrambling + srslte_ch_estimation) +add_subdirectory(test) diff --git a/srslte/lib/phch/src/cqi.c b/srslte/lib/phch/cqi.c similarity index 100% rename from srslte/lib/phch/src/cqi.c rename to srslte/lib/phch/cqi.c diff --git a/srslte/lib/phch/src/dci.c b/srslte/lib/phch/dci.c similarity index 100% rename from srslte/lib/phch/src/dci.c rename to srslte/lib/phch/dci.c diff --git a/srslte/lib/phch/src/dci_sz_table.h b/srslte/lib/phch/dci_sz_table.h similarity index 100% rename from srslte/lib/phch/src/dci_sz_table.h rename to srslte/lib/phch/dci_sz_table.h diff --git a/srslte/lib/phch/src/pbch.c b/srslte/lib/phch/pbch.c similarity index 100% rename from srslte/lib/phch/src/pbch.c rename to srslte/lib/phch/pbch.c diff --git a/srslte/lib/phch/src/pcfich.c b/srslte/lib/phch/pcfich.c similarity index 100% rename from srslte/lib/phch/src/pcfich.c rename to srslte/lib/phch/pcfich.c diff --git a/srslte/lib/phch/src/pdcch.c b/srslte/lib/phch/pdcch.c similarity index 100% rename from srslte/lib/phch/src/pdcch.c rename to srslte/lib/phch/pdcch.c diff --git a/srslte/lib/phch/src/pdsch.c b/srslte/lib/phch/pdsch.c similarity index 100% rename from srslte/lib/phch/src/pdsch.c rename to srslte/lib/phch/pdsch.c diff --git a/srslte/lib/phch/src/phich.c b/srslte/lib/phch/phich.c similarity index 100% rename from srslte/lib/phch/src/phich.c rename to srslte/lib/phch/phich.c diff --git a/srslte/lib/phch/src/prach.c b/srslte/lib/phch/prach.c similarity index 100% rename from srslte/lib/phch/src/prach.c rename to srslte/lib/phch/prach.c diff --git a/srslte/lib/phch/src/prb_dl.c b/srslte/lib/phch/prb_dl.c similarity index 100% rename from srslte/lib/phch/src/prb_dl.c rename to srslte/lib/phch/prb_dl.c diff --git a/srslte/lib/phch/src/prb_dl.h b/srslte/lib/phch/prb_dl.h similarity index 100% rename from srslte/lib/phch/src/prb_dl.h rename to srslte/lib/phch/prb_dl.h diff --git a/srslte/lib/phch/src/pucch.c b/srslte/lib/phch/pucch.c similarity index 100% rename from srslte/lib/phch/src/pucch.c rename to srslte/lib/phch/pucch.c diff --git a/srslte/lib/phch/src/pusch.c b/srslte/lib/phch/pusch.c similarity index 100% rename from srslte/lib/phch/src/pusch.c rename to srslte/lib/phch/pusch.c diff --git a/srslte/lib/phch/src/ra.c b/srslte/lib/phch/ra.c similarity index 100% rename from srslte/lib/phch/src/ra.c rename to srslte/lib/phch/ra.c diff --git a/srslte/lib/phch/src/regs.c b/srslte/lib/phch/regs.c similarity index 100% rename from srslte/lib/phch/src/regs.c rename to srslte/lib/phch/regs.c diff --git a/srslte/lib/phch/src/sch.c b/srslte/lib/phch/sch.c similarity index 100% rename from srslte/lib/phch/src/sch.c rename to srslte/lib/phch/sch.c diff --git a/srslte/lib/phch/src/sequences.c b/srslte/lib/phch/sequences.c similarity index 100% rename from srslte/lib/phch/src/sequences.c rename to srslte/lib/phch/sequences.c diff --git a/srslte/lib/phch/src/tbs_tables.h b/srslte/lib/phch/tbs_tables.h similarity index 100% rename from srslte/lib/phch/src/tbs_tables.h rename to srslte/lib/phch/tbs_tables.h diff --git a/srslte/lib/phch/test/CMakeLists.txt b/srslte/lib/phch/test/CMakeLists.txt index fd7dc4cb0..c9a7d140b 100644 --- a/srslte/lib/phch/test/CMakeLists.txt +++ b/srslte/lib/phch/test/CMakeLists.txt @@ -22,15 +22,15 @@ # PBCH TEST ######################################################################## -ADD_EXECUTABLE(pbch_test pbch_test.c) -TARGET_LINK_LIBRARIES(pbch_test srslte) - -ADD_TEST(pbch_test_6 pbch_test -p 1 -n 6 -c 100) -ADD_TEST(pbch_test_62 pbch_test -p 2 -n 6 -c 100) -ADD_TEST(pbch_test_64 pbch_test -p 4 -n 6 -c 100) -ADD_TEST(pbch_test_50 pbch_test -p 1 -n 50 -c 50) -ADD_TEST(pbch_test_502 pbch_test -p 2 -n 50 -c 50) -ADD_TEST(pbch_test_504 pbch_test -p 4 -n 50 -c 50) +add_executable(pbch_test pbch_test.c) +target_link_libraries(pbch_test srslte) + +add_test(pbch_test_6 pbch_test -p 1 -n 6 -c 100) +add_test(pbch_test_62 pbch_test -p 2 -n 6 -c 100) +add_test(pbch_test_64 pbch_test -p 4 -n 6 -c 100) +add_test(pbch_test_50 pbch_test -p 1 -n 50 -c 50) +add_test(pbch_test_502 pbch_test -p 2 -n 50 -c 50) +add_test(pbch_test_504 pbch_test -p 4 -n 50 -c 50) BuildMex(MEXNAME pbch SOURCES pbch_test_mex.c LIBRARIES srslte srslte_mex) @@ -39,15 +39,15 @@ BuildMex(MEXNAME pbch SOURCES pbch_test_mex.c LIBRARIES srslte srslte_mex) # PCFICH TEST ######################################################################## -ADD_EXECUTABLE(pcfich_test pcfich_test.c) -TARGET_LINK_LIBRARIES(pcfich_test srslte) +add_executable(pcfich_test pcfich_test.c) +target_link_libraries(pcfich_test srslte) -ADD_TEST(pcfich_test_6 pcfich_test -p 1 -n 6) -ADD_TEST(pcfich_test_62 pcfich_test -p 2 -n 6) -ADD_TEST(pcfich_test_64 pcfich_test -p 4 -n 6) -ADD_TEST(pcfich_test_10 pcfich_test -p 1 -n 10) -ADD_TEST(pcfich_test_102 pcfich_test -p 2 -n 10) -ADD_TEST(pcfich_test_104 pcfich_test -p 4 -n 10) +add_test(pcfich_test_6 pcfich_test -p 1 -n 6) +add_test(pcfich_test_62 pcfich_test -p 2 -n 6) +add_test(pcfich_test_64 pcfich_test -p 4 -n 6) +add_test(pcfich_test_10 pcfich_test -p 1 -n 10) +add_test(pcfich_test_102 pcfich_test -p 2 -n 10) +add_test(pcfich_test_104 pcfich_test -p 4 -n 10) BuildMex(MEXNAME pcfich SOURCES pcfich_test_mex.c LIBRARIES srslte srslte_mex) @@ -55,33 +55,33 @@ BuildMex(MEXNAME pcfich SOURCES pcfich_test_mex.c LIBRARIES srslte srslte_mex) # PHICH TEST ######################################################################## -ADD_EXECUTABLE(phich_test phich_test.c) -TARGET_LINK_LIBRARIES(phich_test srslte) +add_executable(phich_test phich_test.c) +target_link_libraries(phich_test srslte) -ADD_TEST(phich_test_6 phich_test -p 1 -n 6) -ADD_TEST(phich_test_62 phich_test -p 2 -n 6) -ADD_TEST(phich_test_64 phich_test -p 4 -n 6 -g 1/6) +add_test(phich_test_6 phich_test -p 1 -n 6) +add_test(phich_test_62 phich_test -p 2 -n 6) +add_test(phich_test_64 phich_test -p 4 -n 6 -g 1/6) -ADD_TEST(phich_test_6e phich_test -p 1 -n 6 -e) -ADD_TEST(phich_test_62e phich_test -p 2 -n 6 -e -l) -ADD_TEST(phich_test_64e phich_test -p 4 -n 6 -e -l -g 2) +add_test(phich_test_6e phich_test -p 1 -n 6 -e) +add_test(phich_test_62e phich_test -p 2 -n 6 -e -l) +add_test(phich_test_64e phich_test -p 4 -n 6 -e -l -g 2) -ADD_TEST(phich_test_10 phich_test -p 1 -n 10 -e) -ADD_TEST(phich_test_102 phich_test -p 2 -n 10 -g 2) -ADD_TEST(phich_test_104 phich_test -p 4 -n 10 -e -l -g 1/2) +add_test(phich_test_10 phich_test -p 1 -n 10 -e) +add_test(phich_test_102 phich_test -p 2 -n 10 -g 2) +add_test(phich_test_104 phich_test -p 4 -n 10 -e -l -g 1/2) ######################################################################## # PDCCH TEST ######################################################################## -ADD_EXECUTABLE(pdcch_test pdcch_test.c) -TARGET_LINK_LIBRARIES(pdcch_test srslte) +add_executable(pdcch_test pdcch_test.c) +target_link_libraries(pdcch_test srslte) -ADD_TEST(pdcch_test pdcch_test) +add_test(pdcch_test pdcch_test) -ADD_EXECUTABLE(dci_unpacking dci_unpacking.c) -TARGET_LINK_LIBRARIES(dci_unpacking srslte) +add_executable(dci_unpacking dci_unpacking.c) +target_link_libraries(dci_unpacking srslte) BuildMex(MEXNAME pdcch SOURCES pdcch_test_mex.c LIBRARIES srslte srslte_mex) @@ -89,12 +89,12 @@ BuildMex(MEXNAME pdcch SOURCES pdcch_test_mex.c LIBRARIES srslte srslte_mex) # PDSCH TEST ######################################################################## -ADD_EXECUTABLE(pdsch_test pdsch_test.c) -TARGET_LINK_LIBRARIES(pdsch_test srslte) +add_executable(pdsch_test pdsch_test.c) +target_link_libraries(pdsch_test srslte) -ADD_TEST(pdsch_test_qpsk pdsch_test -m 10 -n 50 -r 1) -ADD_TEST(pdsch_test_qam16 pdsch_test -m 20 -n 100) -ADD_TEST(pdsch_test_qam64 pdsch_test -m 28 -n 100 -r 0) +add_test(pdsch_test_qpsk pdsch_test -m 10 -n 50 -r 1) +add_test(pdsch_test_qam16 pdsch_test -m 20 -n 100) +add_test(pdsch_test_qam64 pdsch_test -m 28 -n 100 -r 0) BuildMex(MEXNAME pdsch SOURCES pdsch_test_mex.c LIBRARIES srslte srslte_mex) BuildMex(MEXNAME dlsch_encode SOURCES dlsch_encode_test_mex.c LIBRARIES srslte srslte_mex) @@ -103,47 +103,47 @@ BuildMex(MEXNAME dlsch_encode SOURCES dlsch_encode_test_mex.c LIBRARIES srslte s # FILE TEST ######################################################################## -ADD_EXECUTABLE(pbch_file_test pbch_file_test.c) -TARGET_LINK_LIBRARIES(pbch_file_test srslte) +add_executable(pbch_file_test pbch_file_test.c) +target_link_libraries(pbch_file_test srslte) -ADD_EXECUTABLE(pcfich_file_test pcfich_file_test.c) -TARGET_LINK_LIBRARIES(pcfich_file_test srslte) +add_executable(pcfich_file_test pcfich_file_test.c) +target_link_libraries(pcfich_file_test srslte) -ADD_EXECUTABLE(phich_file_test phich_file_test.c) -TARGET_LINK_LIBRARIES(phich_file_test srslte) +add_executable(phich_file_test phich_file_test.c) +target_link_libraries(phich_file_test srslte) -ADD_EXECUTABLE(pdcch_file_test pdcch_file_test.c) -TARGET_LINK_LIBRARIES(pdcch_file_test srslte) +add_executable(pdcch_file_test pdcch_file_test.c) +target_link_libraries(pdcch_file_test srslte) -ADD_EXECUTABLE(pdsch_pdcch_file_test pdsch_pdcch_file_test.c) -TARGET_LINK_LIBRARIES(pdsch_pdcch_file_test srslte) +add_executable(pdsch_pdcch_file_test pdsch_pdcch_file_test.c) +target_link_libraries(pdsch_pdcch_file_test srslte) -ADD_TEST(pbch_file_test pbch_file_test -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.1.92M.dat) -ADD_TEST(pcfich_file_test pcfich_file_test -c 150 -n 50 -p 2 -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.10M.dat) -ADD_TEST(phich_file_test phich_file_test -c 150 -n 50 -p 2 -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.10M.dat) -ADD_TEST(pdcch_file_test pdcch_file_test -c 1 -f 3 -n 6 -p 1 -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.1.92M.amar.dat) -ADD_TEST(pdsch_pdcch_file_test pdsch_pdcch_file_test -c 1 -f 3 -n 6 -p 1 -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.1.92M.amar.dat) +add_test(pbch_file_test pbch_file_test -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.1.92M.dat) +add_test(pcfich_file_test pcfich_file_test -c 150 -n 50 -p 2 -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.10M.dat) +add_test(phich_file_test phich_file_test -c 150 -n 50 -p 2 -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.10M.dat) +add_test(pdcch_file_test pdcch_file_test -c 1 -f 3 -n 6 -p 1 -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.1.92M.amar.dat) +add_test(pdsch_pdcch_file_test pdsch_pdcch_file_test -c 1 -f 3 -n 6 -p 1 -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.1.92M.amar.dat) ######################################################################## # PUSCH TEST ######################################################################## -ADD_EXECUTABLE(pusch_test pusch_test.c) -TARGET_LINK_LIBRARIES(pusch_test srslte) +add_executable(pusch_test pusch_test.c) +target_link_libraries(pusch_test srslte) BuildMex(MEXNAME ulsch_encode SOURCES ulsch_encode_test_mex.c LIBRARIES srslte srslte_mex) BuildMex(MEXNAME pusch_encode SOURCES pusch_encode_test_mex.c LIBRARIES srslte srslte_mex) -ADD_TEST(pusch_test pusch_test) +add_test(pusch_test pusch_test) ######################################################################## # PUCCH TEST ######################################################################## -ADD_EXECUTABLE(pucch_test pucch_test.c) -TARGET_LINK_LIBRARIES(pucch_test srslte) +add_executable(pucch_test pucch_test.c) +target_link_libraries(pucch_test srslte) -ADD_TEST(pucch_test pucch_test) +add_test(pucch_test pucch_test) BuildMex(MEXNAME pucch_encode SOURCES pucch_encode_test_mex.c LIBRARIES srslte srslte_mex) @@ -155,45 +155,45 @@ BuildMex(MEXNAME pucch_encode SOURCES pucch_encode_test_mex.c LIBRARIES srslte s # PRACH TEST ######################################################################## -ADD_EXECUTABLE(prach_test prach_test.c) -TARGET_LINK_LIBRARIES(prach_test srslte) +add_executable(prach_test prach_test.c) +target_link_libraries(prach_test srslte) -ADD_TEST(prach prach_test) +add_test(prach prach_test) -ADD_TEST(prach_256 prach_test -N 256) -ADD_TEST(prach_512 prach_test -N 512) -ADD_TEST(prach_1024 prach_test -N 1024) -ADD_TEST(prach_1536 prach_test -N 1536) -ADD_TEST(prach_2048 prach_test -N 2048) +add_test(prach_256 prach_test -N 256) +add_test(prach_512 prach_test -N 512) +add_test(prach_1024 prach_test -N 1024) +add_test(prach_1536 prach_test -N 1536) +add_test(prach_2048 prach_test -N 2048) -ADD_TEST(prach_f0 prach_test -f 0) -ADD_TEST(prach_f1 prach_test -f 1) -ADD_TEST(prach_f2 prach_test -f 2) -ADD_TEST(prach_f3 prach_test -f 3) +add_test(prach_f0 prach_test -f 0) +add_test(prach_f1 prach_test -f 1) +add_test(prach_f2 prach_test -f 2) +add_test(prach_f3 prach_test -f 3) -ADD_TEST(prach_rs1 prach_test -r 1) -ADD_TEST(prach_rs2 prach_test -r 2) -ADD_TEST(prach_rs3 prach_test -r 3) +add_test(prach_rs1 prach_test -r 1) +add_test(prach_rs2 prach_test -r 2) +add_test(prach_rs3 prach_test -r 3) -ADD_TEST(prach_zc0 prach_test -z 0) -ADD_TEST(prach_zc2 prach_test -z 2) -ADD_TEST(prach_zc3 prach_test -z 3) +add_test(prach_zc0 prach_test -z 0) +add_test(prach_zc2 prach_test -z 2) +add_test(prach_zc3 prach_test -z 3) -ADD_EXECUTABLE(prach_test_multi prach_test_multi.c) -TARGET_LINK_LIBRARIES(prach_test_multi srslte) +add_executable(prach_test_multi prach_test_multi.c) +target_link_libraries(prach_test_multi srslte) -ADD_TEST(prach_test_multi prach_test_multi) +add_test(prach_test_multi prach_test_multi) -ADD_TEST(prach_test_multi_n32 prach_test_multi -n 32) -ADD_TEST(prach_test_multi_n16 prach_test_multi -n 16) -ADD_TEST(prach_test_multi_n8 prach_test_multi -n 8) -ADD_TEST(prach_test_multi_n4 prach_test_multi -n 4) +add_test(prach_test_multi_n32 prach_test_multi -n 32) +add_test(prach_test_multi_n16 prach_test_multi -n 16) +add_test(prach_test_multi_n8 prach_test_multi -n 8) +add_test(prach_test_multi_n4 prach_test_multi -n 4) BuildMex(MEXNAME prach SOURCES prach_test_mex.c LIBRARIES srslte srslte_mex) -IF(UHD_FOUND) - ADD_EXECUTABLE(prach_test_usrp prach_test_usrp.c) - TARGET_LINK_LIBRARIES(prach_test_usrp srslte_rf srslte) -ENDIF(UHD_FOUND) +if(UHD_FOUND) + add_executable(prach_test_usrp prach_test_usrp.c) + target_link_libraries(prach_test_usrp srslte_rf srslte pthread) +endif(UHD_FOUND) diff --git a/srslte/lib/phch/src/uci.c b/srslte/lib/phch/uci.c similarity index 100% rename from srslte/lib/phch/src/uci.c rename to srslte/lib/phch/uci.c diff --git a/srslte/lib/resampling/CMakeLists.txt b/srslte/lib/resampling/CMakeLists.txt new file mode 100644 index 000000000..bc99d620e --- /dev/null +++ b/srslte/lib/resampling/CMakeLists.txt @@ -0,0 +1,23 @@ +# +# Copyright 2013-2015 Software Radio Systems Limited +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE 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 Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +file(GLOB SOURCES "*.c") +add_library(srslte_resampling ${SOURCES}) +add_subdirectory(test) diff --git a/srslte/lib/resampling/src/decim.c b/srslte/lib/resampling/decim.c similarity index 100% rename from srslte/lib/resampling/src/decim.c rename to srslte/lib/resampling/decim.c diff --git a/srslte/lib/resampling/src/interp.c b/srslte/lib/resampling/interp.c similarity index 100% rename from srslte/lib/resampling/src/interp.c rename to srslte/lib/resampling/interp.c diff --git a/srslte/lib/resampling/src/resample_arb.c b/srslte/lib/resampling/resample_arb.c similarity index 100% rename from srslte/lib/resampling/src/resample_arb.c rename to srslte/lib/resampling/resample_arb.c diff --git a/srslte/lib/resampling/test/CMakeLists.txt b/srslte/lib/resampling/test/CMakeLists.txt index 7874859d5..058b4cbdd 100644 --- a/srslte/lib/resampling/test/CMakeLists.txt +++ b/srslte/lib/resampling/test/CMakeLists.txt @@ -22,13 +22,13 @@ # RESAMPLING TEST ######################################################################## -ADD_EXECUTABLE(resample_arb_test resample_arb_test.c) -TARGET_LINK_LIBRARIES(resample_arb_test srslte) +add_executable(resample_arb_test resample_arb_test.c) +target_link_libraries(resample_arb_test srslte) -ADD_EXECUTABLE(resample_arb_bench resample_arb_bench.c) -TARGET_LINK_LIBRARIES(resample_arb_bench srslte) +add_executable(resample_arb_bench resample_arb_bench.c) +target_link_libraries(resample_arb_bench srslte) -ADD_TEST(resample resample_arb_test) +add_test(resample resample_arb_test) diff --git a/srslte/lib/rf/CMakeLists.txt b/srslte/lib/rf/CMakeLists.txt new file mode 100644 index 000000000..8c88918be --- /dev/null +++ b/srslte/lib/rf/CMakeLists.txt @@ -0,0 +1,47 @@ +# +# Copyright 2013-2015 Software Radio Systems Limited +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE 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 Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +if(RF_FOUND) + # Include common RF files + set(SOURCES_RF "") + list(APPEND SOURCES_RF rf_imp.c rf_utils.c) + + if (UHD_FOUND) + add_definitions(-DENABLE_UHD) + list(APPEND SOURCES_RF rf_uhd_imp.c uhd_c_api.cpp) + endif (UHD_FOUND) + + if (BLADERF_FOUND) + add_definitions(-DENABLE_BLADERF) + list(APPEND SOURCES_RF rf_blade_imp.c) + endif (BLADERF_FOUND) + + add_library(srslte_rf ${SOURCES_RF}) + target_link_libraries(srslte_rf pthread) + + if (UHD_FOUND) + target_link_libraries(srslte_rf ${UHD_LIBRARIES}) + endif (UHD_FOUND) + + if (BLADERF_FOUND) + target_link_libraries(srslte_rf ${BLADERF_LIBRARIES}) + endif (BLADERF_FOUND) + +endif(RF_FOUND) diff --git a/srslte/lib/rf/src/rf_blade_imp.c b/srslte/lib/rf/rf_blade_imp.c similarity index 100% rename from srslte/lib/rf/src/rf_blade_imp.c rename to srslte/lib/rf/rf_blade_imp.c diff --git a/srslte/lib/rf/src/rf_blade_imp.h b/srslte/lib/rf/rf_blade_imp.h similarity index 100% rename from srslte/lib/rf/src/rf_blade_imp.h rename to srslte/lib/rf/rf_blade_imp.h diff --git a/srslte/lib/rf/src/rf_dev.h b/srslte/lib/rf/rf_dev.h similarity index 100% rename from srslte/lib/rf/src/rf_dev.h rename to srslte/lib/rf/rf_dev.h diff --git a/srslte/lib/rf/src/rf_imp.c b/srslte/lib/rf/rf_imp.c similarity index 100% rename from srslte/lib/rf/src/rf_imp.c rename to srslte/lib/rf/rf_imp.c diff --git a/srslte/lib/rf/src/rf_uhd_imp.c b/srslte/lib/rf/rf_uhd_imp.c similarity index 100% rename from srslte/lib/rf/src/rf_uhd_imp.c rename to srslte/lib/rf/rf_uhd_imp.c diff --git a/srslte/lib/rf/src/rf_uhd_imp.h b/srslte/lib/rf/rf_uhd_imp.h similarity index 100% rename from srslte/lib/rf/src/rf_uhd_imp.h rename to srslte/lib/rf/rf_uhd_imp.h diff --git a/srslte/lib/rf/src/rf_utils.c b/srslte/lib/rf/rf_utils.c similarity index 100% rename from srslte/lib/rf/src/rf_utils.c rename to srslte/lib/rf/rf_utils.c diff --git a/srslte/lib/rf/src/uhd_c_api.cpp b/srslte/lib/rf/uhd_c_api.cpp similarity index 100% rename from srslte/lib/rf/src/uhd_c_api.cpp rename to srslte/lib/rf/uhd_c_api.cpp diff --git a/srslte/lib/rf/src/uhd_c_api.h b/srslte/lib/rf/uhd_c_api.h similarity index 100% rename from srslte/lib/rf/src/uhd_c_api.h rename to srslte/lib/rf/uhd_c_api.h diff --git a/srslte/lib/scrambling/CMakeLists.txt b/srslte/lib/scrambling/CMakeLists.txt new file mode 100644 index 000000000..ff04a7dba --- /dev/null +++ b/srslte/lib/scrambling/CMakeLists.txt @@ -0,0 +1,23 @@ +# +# Copyright 2013-2015 Software Radio Systems Limited +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE 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 Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +file(GLOB SOURCES "*.c") +add_library(srslte_scrambling ${SOURCES}) +add_subdirectory(test) diff --git a/srslte/lib/scrambling/src/scrambling.c b/srslte/lib/scrambling/scrambling.c similarity index 100% rename from srslte/lib/scrambling/src/scrambling.c rename to srslte/lib/scrambling/scrambling.c diff --git a/srslte/lib/scrambling/test/CMakeLists.txt b/srslte/lib/scrambling/test/CMakeLists.txt index 36b089023..4f658e31f 100644 --- a/srslte/lib/scrambling/test/CMakeLists.txt +++ b/srslte/lib/scrambling/test/CMakeLists.txt @@ -22,13 +22,13 @@ # SCRAMBLING TEST ######################################################################## -ADD_EXECUTABLE(scrambling_test scrambling_test.c) -TARGET_LINK_LIBRARIES(scrambling_test srslte) +add_executable(scrambling_test scrambling_test.c) +target_link_libraries(scrambling_test srslte) -ADD_TEST(scrambling_pbch_bit scrambling_test -s PBCH -c 50) -ADD_TEST(scrambling_pbch_float scrambling_test -s PBCH -c 50 -f) -ADD_TEST(scrambling_pbch_e_bit scrambling_test -s PBCH -c 50 -e) -ADD_TEST(scrambling_pbch_e_float scrambling_test -s PBCH -c 50 -f -e) +add_test(scrambling_pbch_bit scrambling_test -s PBCH -c 50) +add_test(scrambling_pbch_float scrambling_test -s PBCH -c 50 -f) +add_test(scrambling_pbch_e_bit scrambling_test -s PBCH -c 50 -e) +add_test(scrambling_pbch_e_float scrambling_test -s PBCH -c 50 -f -e) diff --git a/srslte/lib/sync/CMakeLists.txt b/srslte/lib/sync/CMakeLists.txt new file mode 100644 index 000000000..a380ff651 --- /dev/null +++ b/srslte/lib/sync/CMakeLists.txt @@ -0,0 +1,24 @@ +# +# Copyright 2013-2015 Software Radio Systems Limited +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE 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 Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +file(GLOB SOURCES "*.c") +add_library(srslte_sync ${SOURCES}) +target_link_libraries(srslte_sync srslte_common) +add_subdirectory(test) diff --git a/srslte/lib/sync/src/cfo.c b/srslte/lib/sync/cfo.c similarity index 100% rename from srslte/lib/sync/src/cfo.c rename to srslte/lib/sync/cfo.c diff --git a/srslte/lib/sync/src/cp.c b/srslte/lib/sync/cp.c similarity index 100% rename from srslte/lib/sync/src/cp.c rename to srslte/lib/sync/cp.c diff --git a/srslte/lib/sync/src/find_sss.c b/srslte/lib/sync/find_sss.c similarity index 100% rename from srslte/lib/sync/src/find_sss.c rename to srslte/lib/sync/find_sss.c diff --git a/srslte/lib/sync/src/gen_sss.c b/srslte/lib/sync/gen_sss.c similarity index 100% rename from srslte/lib/sync/src/gen_sss.c rename to srslte/lib/sync/gen_sss.c diff --git a/srslte/lib/sync/src/pss.c b/srslte/lib/sync/pss.c similarity index 96% rename from srslte/lib/sync/src/pss.c rename to srslte/lib/sync/pss.c index 9eb53b604..16efa4f1b 100644 --- a/srslte/lib/sync/src/pss.c +++ b/srslte/lib/sync/pss.c @@ -38,7 +38,7 @@ #include "srslte/utils/debug.h" -int srslte_pss_synch_init_N_id_2(cf_t *pss_signal_time, cf_t *pss_signal_freq, +int srslte_pss_synch_init_N_id_2(cf_t *pss_signal_freq, cf_t *pss_signal_time, uint32_t N_id_2, uint32_t fft_size, int cfo_i) { srslte_dft_plan_t plan; cf_t pss_signal_pad[2048]; @@ -48,11 +48,11 @@ int srslte_pss_synch_init_N_id_2(cf_t *pss_signal_time, cf_t *pss_signal_freq, fft_size <= 2048) { - srslte_pss_generate(pss_signal_time, N_id_2); + srslte_pss_generate(pss_signal_freq, N_id_2); bzero(pss_signal_pad, fft_size * sizeof(cf_t)); - bzero(pss_signal_freq, fft_size * sizeof(cf_t)); - memcpy(&pss_signal_pad[(fft_size-SRSLTE_PSS_LEN)/2+cfo_i], pss_signal_time, SRSLTE_PSS_LEN * sizeof(cf_t)); + bzero(pss_signal_time, fft_size * sizeof(cf_t)); + memcpy(&pss_signal_pad[(fft_size-SRSLTE_PSS_LEN)/2+cfo_i], pss_signal_freq, SRSLTE_PSS_LEN * sizeof(cf_t)); /* Convert signal into the time domain */ if (srslte_dft_plan(&plan, fft_size, SRSLTE_DFT_BACKWARD, SRSLTE_DFT_COMPLEX)) { @@ -62,10 +62,10 @@ int srslte_pss_synch_init_N_id_2(cf_t *pss_signal_time, cf_t *pss_signal_freq, srslte_dft_plan_set_mirror(&plan, true); srslte_dft_plan_set_dc(&plan, true); srslte_dft_plan_set_norm(&plan, true); - srslte_dft_run_c(&plan, pss_signal_pad, pss_signal_freq); + srslte_dft_run_c(&plan, pss_signal_pad, pss_signal_time); - srslte_vec_conj_cc(pss_signal_freq, pss_signal_freq, fft_size); - srslte_vec_sc_prod_cfc(pss_signal_freq, 1.0/SRSLTE_PSS_LEN, pss_signal_freq, fft_size); + srslte_vec_conj_cc(pss_signal_time, pss_signal_time, fft_size); + srslte_vec_sc_prod_cfc(pss_signal_time, 1.0/SRSLTE_PSS_LEN, pss_signal_time, fft_size); srslte_dft_plan_free(&plan); diff --git a/srslte/lib/sync/src/sfo.c b/srslte/lib/sync/sfo.c similarity index 100% rename from srslte/lib/sync/src/sfo.c rename to srslte/lib/sync/sfo.c diff --git a/srslte/lib/sync/src/sss.c b/srslte/lib/sync/sss.c similarity index 100% rename from srslte/lib/sync/src/sss.c rename to srslte/lib/sync/sss.c diff --git a/srslte/lib/sync/src/sync.c b/srslte/lib/sync/sync.c similarity index 100% rename from srslte/lib/sync/src/sync.c rename to srslte/lib/sync/sync.c diff --git a/srslte/lib/sync/test/CMakeLists.txt b/srslte/lib/sync/test/CMakeLists.txt index 760b9de8b..a38c9c60b 100644 --- a/srslte/lib/sync/test/CMakeLists.txt +++ b/srslte/lib/sync/test/CMakeLists.txt @@ -22,24 +22,24 @@ # PROGRAM TO DEBUG PSS FROM USRP ######################################################################## -ADD_EXECUTABLE(pss_file pss_file.c) -TARGET_LINK_LIBRARIES(pss_file srslte) +add_executable(pss_file pss_file.c) +target_link_libraries(pss_file srslte) -IF(SRSGUI_FOUND) +if(SRSGUI_FOUND) target_link_libraries(pss_file ${SRSGUI_LIBRARIES}) -ELSE(SRSGUI_FOUND) - SET_TARGET_PROPERTIES(pss_file PROPERTIES COMPILE_DEFINITIONS "DISABLE_GRAPHICS") -ENDIF(SRSGUI_FOUND) - -IF(UHD_FOUND) - ADD_EXECUTABLE(pss_usrp pss_usrp.c) - TARGET_LINK_LIBRARIES(pss_usrp srslte srslte_rf) - IF(SRSGUI_FOUND) +else(SRSGUI_FOUND) + set_target_properties(pss_file PROPERTIES COMPILE_DEFINITIONS "DISABLE_GRAPHICS") +endif(SRSGUI_FOUND) + +if(UHD_FOUND) + add_executable(pss_usrp pss_usrp.c) + target_link_libraries(pss_usrp srslte srslte_rf) + if(SRSGUI_FOUND) target_link_libraries(pss_usrp ${SRSGUI_LIBRARIES}) - ELSE(SRSGUI_FOUND) - SET_TARGET_PROPERTIES(pss_usrp PROPERTIES COMPILE_DEFINITIONS "DISABLE_GRAPHICS") - ENDIF(SRSGUI_FOUND) -ENDIF(UHD_FOUND) + else(SRSGUI_FOUND) + set_target_properties(pss_usrp PROPERTIES COMPILE_DEFINITIONS "DISABLE_GRAPHICS") + endif(SRSGUI_FOUND) +endif(UHD_FOUND) BuildMex(MEXNAME pss SOURCES pss_mex.c LIBRARIES srslte srslte_mex) BuildMex(MEXNAME sss SOURCES sss_mex.c LIBRARIES srslte srslte_mex) @@ -51,28 +51,28 @@ BuildMex(MEXNAME cp_synch SOURCES cp_mex.c LIBRARIES srslte srslte_mex) # SYNC TEST ######################################################################## -ADD_EXECUTABLE(sync_test sync_test.c) -TARGET_LINK_LIBRARIES(sync_test srslte) +add_executable(sync_test sync_test.c) +target_link_libraries(sync_test srslte) -ADD_TEST(sync_test_100 sync_test -o 100 -c 501) -ADD_TEST(sync_test_400 sync_test -o 400 -c 2) -ADD_TEST(sync_test_100_e sync_test -o 100 -e -c 150) -ADD_TEST(sync_test_400_e sync_test -o 400 -e -c 151) +add_test(sync_test_100 sync_test -o 100 -c 501) +add_test(sync_test_400 sync_test -o 400 -c 2) +add_test(sync_test_100_e sync_test -o 100 -e -c 150) +add_test(sync_test_400_e sync_test -o 400 -e -c 151) -ADD_TEST(sync_test_100 sync_test -o 100 -p 50 -c 501) -ADD_TEST(sync_test_400 sync_test -o 400 -p 50 -c 500) -ADD_TEST(sync_test_100_e sync_test -o 100 -e -p 50 -c 133) -ADD_TEST(sync_test_400_e sync_test -o 400 -e -p 50 -c 123) +add_test(sync_test_100 sync_test -o 100 -p 50 -c 501) +add_test(sync_test_400 sync_test -o 400 -p 50 -c 500) +add_test(sync_test_100_e sync_test -o 100 -e -p 50 -c 133) +add_test(sync_test_400_e sync_test -o 400 -e -p 50 -c 123) ######################################################################## # CFO TEST ######################################################################## -ADD_EXECUTABLE(cfo_test cfo_test.c) -TARGET_LINK_LIBRARIES(cfo_test srslte) +add_executable(cfo_test cfo_test.c) +target_link_libraries(cfo_test srslte) -ADD_TEST(cfo_test_1 cfo_test -f 0.12345 -n 1000) -ADD_TEST(cfo_test_2 cfo_test -f 0.99849 -n 1000) +add_test(cfo_test_1 cfo_test -f 0.12345 -n 1000) +add_test(cfo_test_2 cfo_test -f 0.99849 -n 1000) diff --git a/srslte/lib/ue/CMakeLists.txt b/srslte/lib/ue/CMakeLists.txt new file mode 100644 index 000000000..c3c535cae --- /dev/null +++ b/srslte/lib/ue/CMakeLists.txt @@ -0,0 +1,27 @@ +# +# Copyright 2013-2015 Software Radio Systems Limited +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE 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 Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +file(GLOB SOURCES "*.c") +add_library(srslte_ue ${SOURCES}) +target_link_libraries(srslte_ue srslte_io + srslte_sync + srslte_dft + srslte_ch_estimation + srslte_agc) diff --git a/srslte/lib/ue/src/ue_cell_search.c b/srslte/lib/ue/ue_cell_search.c similarity index 100% rename from srslte/lib/ue/src/ue_cell_search.c rename to srslte/lib/ue/ue_cell_search.c diff --git a/srslte/lib/ue/src/ue_dl.c b/srslte/lib/ue/ue_dl.c similarity index 100% rename from srslte/lib/ue/src/ue_dl.c rename to srslte/lib/ue/ue_dl.c diff --git a/srslte/lib/ue/src/ue_mib.c b/srslte/lib/ue/ue_mib.c similarity index 100% rename from srslte/lib/ue/src/ue_mib.c rename to srslte/lib/ue/ue_mib.c diff --git a/srslte/lib/ue/src/ue_sync.c b/srslte/lib/ue/ue_sync.c similarity index 100% rename from srslte/lib/ue/src/ue_sync.c rename to srslte/lib/ue/ue_sync.c diff --git a/srslte/lib/ue/src/ue_ul.c b/srslte/lib/ue/ue_ul.c similarity index 100% rename from srslte/lib/ue/src/ue_ul.c rename to srslte/lib/ue/ue_ul.c diff --git a/srslte/lib/utils/CMakeLists.txt b/srslte/lib/utils/CMakeLists.txt new file mode 100644 index 000000000..b6fd05bdd --- /dev/null +++ b/srslte/lib/utils/CMakeLists.txt @@ -0,0 +1,24 @@ +# +# Copyright 2013-2015 Software Radio Systems Limited +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE 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 Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +file(GLOB SOURCES "*.c") +add_library(srslte_utils ${SOURCES}) +target_link_libraries(srslte_utils srslte_dft) +add_subdirectory(test) diff --git a/srslte/lib/utils/src/bit.c b/srslte/lib/utils/bit.c similarity index 100% rename from srslte/lib/utils/src/bit.c rename to srslte/lib/utils/bit.c diff --git a/srslte/lib/utils/src/cexptab.c b/srslte/lib/utils/cexptab.c similarity index 100% rename from srslte/lib/utils/src/cexptab.c rename to srslte/lib/utils/cexptab.c diff --git a/srslte/lib/utils/src/convolution.c b/srslte/lib/utils/convolution.c similarity index 100% rename from srslte/lib/utils/src/convolution.c rename to srslte/lib/utils/convolution.c diff --git a/srslte/lib/utils/src/debug.c b/srslte/lib/utils/debug.c similarity index 100% rename from srslte/lib/utils/src/debug.c rename to srslte/lib/utils/debug.c diff --git a/srslte/lib/utils/test/CMakeLists.txt b/srslte/lib/utils/test/CMakeLists.txt index 49be3041d..611d40fad 100644 --- a/srslte/lib/utils/test/CMakeLists.txt +++ b/srslte/lib/utils/test/CMakeLists.txt @@ -22,14 +22,14 @@ # DFT TEST ######################################################################## -ADD_EXECUTABLE(dft_test dft_test.c) -TARGET_LINK_LIBRARIES(dft_test srslte) +add_executable(dft_test dft_test.c) +target_link_libraries(dft_test srslte) -ADD_TEST(dft_test dft_test) -ADD_TEST(dft_reverse dft_test -b) # Backwards first -ADD_TEST(dft_mirror dft_test -m) # Mirror the freq bins -ADD_TEST(dft_norm dft_test -n) # Normalize each transform -ADD_TEST(dft_dc dft_test -b -d) # Backwards first & handle dc internally -ADD_TEST(dft_odd dft_test -N 255) # Odd-length -ADD_TEST(dft_odd_dc dft_test -N 255 -b -d) # Odd-length, backwards first, handle dc +add_test(dft_test dft_test) +add_test(dft_reverse dft_test -b) # Backwards first +add_test(dft_mirror dft_test -m) # Mirror the freq bins +add_test(dft_norm dft_test -n) # Normalize each transform +add_test(dft_dc dft_test -b -d) # Backwards first & handle dc internally +add_test(dft_odd dft_test -N 255) # Odd-length +add_test(dft_odd_dc dft_test -N 255 -b -d) # Odd-length, backwards first, handle dc diff --git a/srslte/lib/utils/src/vector.c b/srslte/lib/utils/vector.c similarity index 100% rename from srslte/lib/utils/src/vector.c rename to srslte/lib/utils/vector.c diff --git a/srslte/lib/utils/src/vector_simd.c b/srslte/lib/utils/vector_simd.c similarity index 100% rename from srslte/lib/utils/src/vector_simd.c rename to srslte/lib/utils/vector_simd.c diff --git a/srslte/lib/version/src/version.c b/srslte/lib/version.c similarity index 100% rename from srslte/lib/version/src/version.c rename to srslte/lib/version.c