# HG changeset patch # User paul # Date 2017-04-06 06:53:07 # Node ID 9a3997f734227ca2d6f44db325bad8d1016ae9b5 # Parent 64f2b79a9046ae5272e8690c78a8ef93408763a6 3.2.0.15 sources not changed compilation chain RCC 1.2.20b (-mfixb2bst native support) diff --git a/sparc/sparc-rtems.cmake b/sparc/sparc-rtems.cmake --- a/sparc/sparc-rtems.cmake +++ b/sparc/sparc-rtems.cmake @@ -1,10 +1,25 @@ +set(rtems_dir /opt/rtems-4.10/) + set(CMAKE_SYSTEM_NAME rtems) +set(CMAKE_C_COMPILER ${rtems_dir}/bin/sparc-rtems-gcc) +set(CMAKE_CXX_COMPILER ${rtems_dir}/bin/sparc-rtems-g++) +set(CMAKE_LINKER ${rtems_dir}/bin/sparc-rtems-g++) +SET(CMAKE_EXE_LINKER_FLAGS "-static") +option(fix-b2bst "Activate -mfix-b2bst switch to mitigate \"LEON3FT Stale Cache Entry After Store with Data Tag Parity Error\" errata, GRLIB-TN-0009" ON) -set(CMAKE_C_COMPILER /opt/rtems-4.10/bin/sparc-rtems-gcc) -set(CMAKE_CXX_COMPILER /opt/rtems-4.10/bin/sparc-rtems-g++) -set(CMAKE_LINKER /opt/rtems-4.10/bin/sparc-rtems-g++) -SET(CMAKE_EXE_LINKER_FLAGS "-static") -set(CMAKE_C_FLAGS_RELEASE "-O3 -mfix-b2bst") -#set(CMAKE_C_FLAGS_RELEASE "-O3") +if(fix-b2bst) + set(CMAKE_C_FLAGS_RELEASE "-O3 -mfix-b2bst") +else() + set(CMAKE_C_FLAGS_RELEASE "-O3") +endif() + set(CMAKE_C_LINK_EXECUTABLE " -o ") -include_directories("/opt/rtems-4.10/sparc-rtems/leon3/lib/include") + +include_directories("${rtems_dir}/sparc-rtems/leon3/lib/include") + +function (check_b2bst target bin) + add_custom_command(TARGET ${target} + POST_BUILD + COMMAND ${rtems_dir}/bin/sparc-rtems-objdump -d ${bin}/${target} | ${CMAKE_SOURCE_DIR}/sparc/leon3ft-b2bst-scan.tcl + ) +endfunction() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -64,7 +64,7 @@ option(FSW_debug_tch "?" OFF) set(SW_VERSION_N1 "3" CACHE STRING "Choose N1 FSW Version." FORCE) set(SW_VERSION_N2 "2" CACHE STRING "Choose N2 FSW Version." FORCE) set(SW_VERSION_N3 "0" CACHE STRING "Choose N3 FSW Version." FORCE) -set(SW_VERSION_N4 "14" CACHE STRING "Choose N4 FSW Version." FORCE) +set(SW_VERSION_N4 "15" CACHE STRING "Choose N4 FSW Version." FORCE) if(FSW_verbose) add_definitions(-DPRINT_MESSAGES_ON_CONSOLE) @@ -103,5 +103,10 @@ add_definitions(-DSW_VERSION_N3=${SW_VER add_definitions(-DSW_VERSION_N4=${SW_VERSION_N4}) add_executable(fsw ${SOURCES}) + +if(fix-b2bst) + check_b2bst(fsw ${CMAKE_CURRENT_BINARY_DIR}) +endif() + add_test_cppcheck(fsw STYLE UNUSED_FUNCTIONS POSSIBLE_ERROR MISSING_INCLUDE)