From d6b7277c522715d316e28aa08032094e229b95a9 Mon Sep 17 00:00:00 2001 From: Joseph Martin Date: Wed, 20 Nov 2024 15:46:21 +0000 Subject: [PATCH] Sample app runs now --- .github/workflows/codeql-build.yml | 4 +- CMakeLists.txt | 4 +- README.md | 22 ++------ SECURITY.md | 14 ++--- arch_build.cmake | 26 +++++----- config/default_bpacc_fun_msgdefs.h | 2 +- fsw/src/{bpacc_fun_app.h => bpacc_fun.h} | 0 fsw/src/bpacc_fun_app.c | 1 + fsw/src/bpacc_fun_cmds.c | 6 +-- mission_build.cmake | 52 +++++++++---------- .../bpacc_fun_coveragetest_common.h | 2 +- .../coveragetest/coveragetest_bpacc_fun_app.c | 3 +- .../coveragetest_bpacc_fun_cmds.c | 7 --- .../coveragetest_bpacc_fun_utils.c | 1 - unit-test/stubs/bpacc_fun_dispatch_stubs.c | 4 +- unit-test/stubs/bpacc_fun_stubs.c | 4 +- 16 files changed, 65 insertions(+), 87 deletions(-) rename fsw/src/{bpacc_fun_app.h => bpacc_fun.h} (100%) diff --git a/.github/workflows/codeql-build.yml b/.github/workflows/codeql-build.yml index 2753b54..b38fed5 100644 --- a/.github/workflows/codeql-build.yml +++ b/.github/workflows/codeql-build.yml @@ -10,6 +10,6 @@ jobs: name: Codeql Analysis uses: nasa/cFS/.github/workflows/codeql-reusable.yml@main with: - component-path: apps/sample_app + component-path: apps/bpacc_fun prep: 'make prep; make -C build/tools/elf2cfetbl' - make: 'make -C build/native/default_cpu1/apps/sample_app' + make: 'make -C build/native/default_cpu1/apps/bpacc_fun' diff --git a/CMakeLists.txt b/CMakeLists.txt index c264cc5..c6523be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,9 +20,9 @@ endif() add_cfe_app(bpacc_fun ${APP_SRC_FILES}) target_include_directories(bpacc_fun PUBLIC fsw/inc) -# Include the public API from sample_lib to demonstrate how +# Include the public API from BPAccel to demonstrate how # to call library-provided functions -add_cfe_app_dependency(bpacc_fun sample_lib) +#add_cfe_app_dependency(bpacc_fun bpaccel) # Add table add_cfe_tables(bpacc_fun fsw/tables/bpacc_fun_tbl.c) diff --git a/README.md b/README.md index 5c69ebb..8ddd219 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,8 @@ -![Static Analysis](https://github.com/nasa/sample_app/workflows/Static%20Analysis/badge.svg) -![Format Check](https://github.com/nasa/sample_app/workflows/Format%20Check/badge.svg) +![Static Analysis](https://github.com/nasa/bpacc_fun/workflows/Static%20Analysis/badge.svg) +![Format Check](https://github.com/nasa/bpacc_fun/workflows/Format%20Check/badge.svg) -# Core Flight System : Framework : App : Sample +# Core Flight System : Framework : App : BPACC Functional -This repository contains a sample application (sample_app), which is a framework component of the Core Flight System. +This repository contains the BPAccel Functional Test App -This sample application is a non-flight example application implementation for the cFS Bundle. It is intended to be located in the `apps/sample_app` subdirectory of a cFS Mission Tree. The Core Flight System is bundled at (which includes sample_app as a submodule), which includes build and execution instructions. - -sample_app is an example for how to build and link an application in cFS. See also the skeleton_app () if you are looking for a bare-bones application to which to add your business logic. - -## Known issues - -As a sample application, extensive testing is not performed prior to release and only minimal functionality is included. Note discrepancies likely exist between this application and the example detailed in the application developer guide. - -## Getting Help - -For best results, submit issues:questions or issues:help wanted requests at . - -Official cFS page: +This application is a non-flight example application implementation used for exercising BPAccel and BP7 HW Acceleration efforts in a cFS context. diff --git a/SECURITY.md b/SECURITY.md index dccd248..00ce306 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,7 +2,7 @@ ## Reporting a Vulnerability -To report a vulnerability for the sample_app subsystem please [submit an issue](https://github.com/nasa/sample_app/issues/new/choose). +To report a vulnerability for the bpacc_fun subsystem please [submit an issue](https://github.com/nasa/bpacc_fun/issues/new/choose). For general cFS vulnerabilities please [open a cFS framework issue](https://github.com/nasa/cfs/issues/new/choose) and see our [top-level security policy](https://github.com/nasa/cFS/security/policy) for additional information. @@ -10,25 +10,25 @@ In either case please use the "Bug Report" template and provide as much informat ## Testing -**Disclaimer: nasa/sample_app is not responsible for any liability incurred under the [Apache License 2.0](https://github.com/nasa/sample_app/blob/main/LICENSE).** +**Disclaimer: nasa/bpacc_fun is not responsible for any liability incurred under the [Apache License 2.0](https://github.com/nasa/bpacc_fun/blob/main/LICENSE).** -Testing is an important aspect our team values to improve sample_app. +Testing is an important aspect our team values to improve bpacc_fun. To view tools used for the cFS bundle, see our [top-level security policy](https://github.com/nasa/cFS/security/policy). ### CodeQL -The [sample_app CodeQL GitHub Actions workflow](https://github.com/nasa/sample_app/actions/workflows/codeql-build.yml) is available to the public. To review the results, fork the sample_app repository and run the CodeQL workflow. +The [bpacc_fun CodeQL GitHub Actions workflow](https://github.com/nasa/bpacc_fun/actions/workflows/codeql-build.yml) is available to the public. To review the results, fork the bpacc_fun repository and run the CodeQL workflow. -CodeQL is ran for every push and pull-request on all branches of sample_app in GitHub Actions. +CodeQL is ran for every push and pull-request on all branches of bpacc_fun in GitHub Actions. For the CodeQL GitHub Actions setup, visit https://github.com/github/codeql-action. ### Cppcheck -The [sample_app Cppcheck GitHub Actions workflow and results](https://github.com/nasa/sample_app/actions/workflows/static-analysis.yml) are available to the public. To view the results, select a workflow and download the artifacts. +The [bpacc_fun Cppcheck GitHub Actions workflow and results](https://github.com/nasa/bpacc_fun/actions/workflows/static-analysis.yml) are available to the public. To view the results, select a workflow and download the artifacts. -Cppcheck is ran for every push on the main branch and every pull request on all branches of sample_app in Github Actions. +Cppcheck is ran for every push on the main branch and every pull request on all branches of bpacc_fun in Github Actions. For more information about Cppcheck, visit http://cppcheck.sourceforge.net/. diff --git a/arch_build.cmake b/arch_build.cmake index c526397..c300164 100644 --- a/arch_build.cmake +++ b/arch_build.cmake @@ -1,6 +1,6 @@ ########################################################### # -# SAMPLE_APP platform build setup +# BPACC_FUN platform build setup # # This file is evaluated as part of the "prepare" stage # and can be used to set up prerequisites for the build, @@ -8,26 +8,26 @@ # ########################################################### -# The list of header files that control the SAMPLE_APP configuration -set(SAMPLE_APP_PLATFORM_CONFIG_FILE_LIST - sample_app_internal_cfg.h - sample_app_platform_cfg.h - sample_app_perfids.h - sample_app_msgids.h +# The list of header files that control the BPACC_FUN configuration +set(BPACC_FUN_PLATFORM_CONFIG_FILE_LIST + bpacc_fun_internal_cfg.h + bpacc_fun_platform_cfg.h + bpacc_fun_perfids.h + bpacc_fun_msgids.h ) # Create wrappers around the all the config header files # This makes them individually overridable by the missions, without modifying # the distribution default copies -foreach(SAMPLE_APP_CFGFILE ${SAMPLE_APP_PLATFORM_CONFIG_FILE_LIST}) - get_filename_component(CFGKEY "${SAMPLE_APP_CFGFILE}" NAME_WE) - if (DEFINED SAMPLE_APP_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE GENERATED_FILE "${SAMPLE_APP_CFGFILE_SRC_${CFGKEY}}") +foreach(BPACC_FUN_CFGFILE ${BPACC_FUN_PLATFORM_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${BPACC_FUN_CFGFILE}" NAME_WE) + if (DEFINED BPACC_FUN_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE GENERATED_FILE "${BPACC_FUN_CFGFILE_SRC_${CFGKEY}}") else() - set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${SAMPLE_APP_CFGFILE}") + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${BPACC_FUN_CFGFILE}") endif() generate_config_includefile( - FILE_NAME "${SAMPLE_APP_CFGFILE}" + FILE_NAME "${BPACC_FUN_CFGFILE}" ${DEFAULT_SOURCE} ) endforeach() diff --git a/config/default_bpacc_fun_msgdefs.h b/config/default_bpacc_fun_msgdefs.h index 39dad26..b4485f0 100644 --- a/config/default_bpacc_fun_msgdefs.h +++ b/config/default_bpacc_fun_msgdefs.h @@ -27,7 +27,7 @@ #define BPACC_FUN_MSGDEFS_H #include "common_types.h" -#include "bpacc_fun_app_fcncodes.h" +#include "default_bpacc_fun_fcncodes.h" typedef struct BPACC_FUN_DisplayParam_Payload { diff --git a/fsw/src/bpacc_fun_app.h b/fsw/src/bpacc_fun.h similarity index 100% rename from fsw/src/bpacc_fun_app.h rename to fsw/src/bpacc_fun.h diff --git a/fsw/src/bpacc_fun_app.c b/fsw/src/bpacc_fun_app.c index 7188548..bc4a948 100644 --- a/fsw/src/bpacc_fun_app.c +++ b/fsw/src/bpacc_fun_app.c @@ -74,6 +74,7 @@ void BPACC_FUN_Main(void) CFE_ES_PerfLogExit(BPACC_FUN_PERF_ID); /* Pend on receipt of command packet */ + printf("CFE_SB_ReceiveBuffer PEND FOREVER\n"); status = CFE_SB_ReceiveBuffer(&SBBufPtr, BPACC_FUN_Data.CommandPipe, CFE_SB_PEND_FOREVER); /* diff --git a/fsw/src/bpacc_fun_cmds.c b/fsw/src/bpacc_fun_cmds.c index 07729f0..b001437 100644 --- a/fsw/src/bpacc_fun_cmds.c +++ b/fsw/src/bpacc_fun_cmds.c @@ -33,8 +33,7 @@ #include "bpacc_fun_utils.h" #include "bpacc_fun_msg.h" -// /* The bpaccel_lib module provides the BPACC_FUN_Function() prototype */ -// #include "bpaccel_lib.h" +//#include bpaccel.h /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/ /* */ @@ -138,8 +137,7 @@ CFE_Status_t BPACC_FUN_ProcessCmd(const BPACC_FUN_ProcessCmd_t *Msg) return status; } - /* Invoke a function provided by BPACC_FUN_LIB */ - BPACC_FUN_LIB_Function(); + /* Call BPAccel Here */ return CFE_SUCCESS; } diff --git a/mission_build.cmake b/mission_build.cmake index 7c156c6..4733787 100644 --- a/mission_build.cmake +++ b/mission_build.cmake @@ -1,6 +1,6 @@ ########################################################### # -# SAMPLE_APP mission build setup +# BPACC_FUN_APP mission build setup # # This file is evaluated as part of the "prepare" stage # and can be used to set up prerequisites for the build, @@ -8,45 +8,45 @@ # ########################################################### -# The list of header files that control the SAMPLE_APP configuration -set(SAMPLE_APP_MISSION_CONFIG_FILE_LIST - sample_app_fcncodes.h - sample_app_interface_cfg.h - sample_app_mission_cfg.h - sample_app_perfids.h - sample_app_msg.h - sample_app_msgdefs.h - sample_app_msgstruct.h - sample_app_tbl.h - sample_app_tbldefs.h - sample_app_tblstruct.h - sample_app_topicids.h +# The list of header files that control the BPACC_FUN_APP configuration +set(BPACC_FUN_APP_MISSION_CONFIG_FILE_LIST + bpacc_fun_fcncodes.h + bpacc_fun_interface_cfg.h + bpacc_fun_mission_cfg.h + bpacc_fun_perfids.h + bpacc_fun_msg.h + bpacc_fun_msgdefs.h + bpacc_fun_msgstruct.h + bpacc_fun_tbl.h + bpacc_fun_tbldefs.h + bpacc_fun_tblstruct.h + bpacc_fun_topicids.h ) if (CFE_EDS_ENABLED_BUILD) # In an EDS-based build, these files come generated from the EDS tool - set(SAMPLE_APP_CFGFILE_SRC_sample_app_interface_cfg "sample_app_eds_designparameters.h") - set(SAMPLE_APP_CFGFILE_SRC_sample_app_tbldefs "sample_app_eds_typedefs.h") - set(SAMPLE_APP_CFGFILE_SRC_sample_app_tblstruct "sample_app_eds_typedefs.h") - set(SAMPLE_APP_CFGFILE_SRC_sample_app_msgdefs "sample_app_eds_typedefs.h") - set(SAMPLE_APP_CFGFILE_SRC_sample_app_msgstruct "sample_app_eds_typedefs.h") - set(SAMPLE_APP_CFGFILE_SRC_sample_app_fcncodes "sample_app_eds_cc.h") + set(BPACC_FUN_APP_CFGFILE_SRC_bpacc_fun_interface_cfg "bpacc_fun_eds_designparameters.h") + set(BPACC_FUN_APP_CFGFILE_SRC_bpacc_fun_tbldefs "bpacc_fun_eds_typedefs.h") + set(BPACC_FUN_APP_CFGFILE_SRC_bpacc_fun_tblstruct "bpacc_fun_eds_typedefs.h") + set(BPACC_FUN_APP_CFGFILE_SRC_bpacc_fun_msgdefs "bpacc_fun_eds_typedefs.h") + set(BPACC_FUN_APP_CFGFILE_SRC_bpacc_fun_msgstruct "bpacc_fun_eds_typedefs.h") + set(BPACC_FUN_APP_CFGFILE_SRC_bpacc_fun_fcncodes "bpacc_fun_eds_cc.h") endif(CFE_EDS_ENABLED_BUILD) # Create wrappers around the all the config header files # This makes them individually overridable by the missions, without modifying # the distribution default copies -foreach(SAMPLE_APP_CFGFILE ${SAMPLE_APP_MISSION_CONFIG_FILE_LIST}) - get_filename_component(CFGKEY "${SAMPLE_APP_CFGFILE}" NAME_WE) - if (DEFINED SAMPLE_APP_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE GENERATED_FILE "${SAMPLE_APP_CFGFILE_SRC_${CFGKEY}}") +foreach(BPACC_FUN_APP_CFGFILE ${BPACC_FUN_APP_MISSION_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${BPACC_FUN_APP_CFGFILE}" NAME_WE) + if (DEFINED BPACC_FUN_APP_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE GENERATED_FILE "${BPACC_FUN_APP_CFGFILE_SRC_${CFGKEY}}") else() - set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${SAMPLE_APP_CFGFILE}") + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${BPACC_FUN_APP_CFGFILE}") endif() generate_config_includefile( - FILE_NAME "${SAMPLE_APP_CFGFILE}" + FILE_NAME "${BPACC_FUN_APP_CFGFILE}" ${DEFAULT_SOURCE} ) endforeach() diff --git a/unit-test/coveragetest/bpacc_fun_coveragetest_common.h b/unit-test/coveragetest/bpacc_fun_coveragetest_common.h index 6152d2b..323037a 100644 --- a/unit-test/coveragetest/bpacc_fun_coveragetest_common.h +++ b/unit-test/coveragetest/bpacc_fun_coveragetest_common.h @@ -19,7 +19,7 @@ /** * @file * - * Common definitions for all sample_app coverage tests + * Common definitions for all bpacc_fun coverage tests */ #ifndef BPACC_FUN_COVERAGETEST_COMMON_H diff --git a/unit-test/coveragetest/coveragetest_bpacc_fun_app.c b/unit-test/coveragetest/coveragetest_bpacc_fun_app.c index c054835..a87ba57 100644 --- a/unit-test/coveragetest/coveragetest_bpacc_fun_app.c +++ b/unit-test/coveragetest/coveragetest_bpacc_fun_app.c @@ -17,7 +17,7 @@ ************************************************************************/ /* -** File: coveragetest_sample_app.c +** File: coveragetest_bpacc_fun_app.c ** ** Purpose: ** Coverage Unit Test cases for the BPACC_FUN Application @@ -35,7 +35,6 @@ /* * Includes */ -#include "sample_lib.h" /* For BPACC_FUN_LIB_Function */ #include "bpacc_fun_coveragetest_common.h" /* diff --git a/unit-test/coveragetest/coveragetest_bpacc_fun_cmds.c b/unit-test/coveragetest/coveragetest_bpacc_fun_cmds.c index eee8b61..e87ccff 100644 --- a/unit-test/coveragetest/coveragetest_bpacc_fun_cmds.c +++ b/unit-test/coveragetest/coveragetest_bpacc_fun_cmds.c @@ -36,7 +36,6 @@ * Includes */ -//#include "sample_lib.h" /* For BPACC_FUN_LIB_Function */ #include "bpacc_fun_coveragetest_common.h" #include "bpacc_fun.h" #include "bpacc_fun_dispatch.h" @@ -154,12 +153,6 @@ void Test_BPACC_FUN_APP_ProcessCmd(void) */ UtAssert_STUB_COUNT(CFE_TBL_GetAddress, 1); - /* - * Confirm that the BPACC_FUN_LIB_Function() call was done - * NOTE: This stub is provided by the sample_lib library - */ - UtAssert_STUB_COUNT(BPACC_FUN_LIB_Function, 1); - /* * Configure the CFE_TBL_GetAddress function to return an error. * Exercise the error return path. diff --git a/unit-test/coveragetest/coveragetest_bpacc_fun_utils.c b/unit-test/coveragetest/coveragetest_bpacc_fun_utils.c index a7a223d..88e7e72 100644 --- a/unit-test/coveragetest/coveragetest_bpacc_fun_utils.c +++ b/unit-test/coveragetest/coveragetest_bpacc_fun_utils.c @@ -35,7 +35,6 @@ /* * Includes */ -#include "sample_lib.h" /* For SAMPLE_LIB_Function */ #include "bpacc_fun_coveragetest_common.h" /* diff --git a/unit-test/stubs/bpacc_fun_dispatch_stubs.c b/unit-test/stubs/bpacc_fun_dispatch_stubs.c index fd801fd..cd816b0 100644 --- a/unit-test/stubs/bpacc_fun_dispatch_stubs.c +++ b/unit-test/stubs/bpacc_fun_dispatch_stubs.c @@ -19,10 +19,10 @@ /** * @file * - * Auto-Generated stub implementations for functions defined in sample_app_dispatch header + * Auto-Generated stub implementations for functions defined in bpacc_fun_dispatch header */ -#include "sample_app_dispatch.h" +#include "bpacc_fun_dispatch.h" #include "utgenstub.h" /* diff --git a/unit-test/stubs/bpacc_fun_stubs.c b/unit-test/stubs/bpacc_fun_stubs.c index 06a2405..2a4af80 100644 --- a/unit-test/stubs/bpacc_fun_stubs.c +++ b/unit-test/stubs/bpacc_fun_stubs.c @@ -19,10 +19,10 @@ /** * @file * - * Auto-Generated stub implementations for functions defined in sample_app header + * Auto-Generated stub implementations for functions defined in bpacc_fun header */ -#include "bpacc_fun_app.h" +#include "bpacc_fun.h" #include "utgenstub.h" /*