Skip to content

Commit

Permalink
EDS: Update prototype to GSFC 2024-10-01 baseline
Browse files Browse the repository at this point in the history
Merge branch 'jph-baseline-20241001' into techdev-sois-eds
  • Loading branch information
jphickey committed Oct 1, 2024
2 parents 9b4b6d5 + 0f20d57 commit 2878379
Show file tree
Hide file tree
Showing 20 changed files with 210 additions and 346 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4.1.7

- name: Display structure of downloaded files
run: ls -R
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## Development Build: equuleus-rc1+dev199
- Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows
- See <https://github.com/nasa/cFE/pull/2599>

## Development Build: equuleus-rc1+dev195
- Use string append and add newline
- Yield cpu to other tasks in SB Perf Test
- See <https://github.com/nasa/cFE/pull/2596> and <https://github.com/nasa/cFE/pull/2593>

## Development Build: equuleus-rc1+dev187
- Use proper printf format for size_t
- See <https://github.com/nasa/cFE/pull/2591>

## Development Build: equuleus-rc1+dev183
- Runtime Error in coverage-es-ALL, TestApps
- add config tool for platform-specific settings
Expand Down
35 changes: 33 additions & 2 deletions modules/cfe_testcase/src/sb_performance_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
/* Number of messages to send during test */
uint32_t UT_BulkTestDuration = 1000;

/* Number of SB messages sent before yielding CPU (has to be power of 2 minus 1)*/
static uint32_t UT_CpuYieldMask = 1024 - 1;

/* State structure for multicore test - shared between threads */
typedef struct UT_BulkMultiCoreSharedState
{
Expand Down Expand Up @@ -209,6 +212,13 @@ void RunSingleCmdSendRecv(void)
UtAssert_UINT32_EQ(CmdPtr->Payload.Value, CmdMsg.Payload.Value);
break;
}

/* Only yield CPU once in a while to avoid slowing down the test with too many context switches */
if ((BulkCmd.SendCount & UT_CpuYieldMask) == 0)
{
/* Yield cpu to other task with same priority */
OS_TaskDelay(0);
}
}

CFE_PSP_GetTime(&BulkCmd.EndTime);
Expand Down Expand Up @@ -255,6 +265,13 @@ void RunSingleTlmSendRecv(void)
UtAssert_UINT32_EQ(TlmPtr->Payload.Value, TlmMsg.Payload.Value);
break;
}

/* Only yield CPU once in a while to avoid slowing down the test with too many context switches */
if ((BulkTlm.SendCount & UT_CpuYieldMask) == 0)
{
/* Yield cpu to other task with same priority */
OS_TaskDelay(0);
}
}

CFE_PSP_GetTime(&BulkTlm.EndTime);
Expand Down Expand Up @@ -388,12 +405,19 @@ void UT_CommandTransmitterTask(void)
CFE_Assert_STATUS_MUST_BE(CFE_SUCCESS);
break;
}

/* Only yield CPU once in a while to avoid slowing down the test with too many context switches */
if ((BulkCmd.SendCount & UT_CpuYieldMask) == 0)
{
/* Yield cpu to other task with same priority */
OS_TaskDelay(0);
}
}

BulkCmd.XmitFinished = true;
}

void UT_TelemtryTransmitterTask(void)
void UT_TelemetryTransmitterTask(void)
{
CFE_SB_Buffer_t * BufPtr;
CFE_TEST_TestTlmMessage32_t *TlmMsgPtr;
Expand Down Expand Up @@ -424,6 +448,13 @@ void UT_TelemtryTransmitterTask(void)
CFE_Assert_STATUS_MUST_BE(CFE_SUCCESS);
break;
}

/* Only yield CPU once in a while to avoid slowing down the test with too many context switches */
if ((BulkTlm.SendCount & UT_CpuYieldMask) == 0)
{
/* Yield cpu to other task with same priority */
OS_TaskDelay(0);
}
}

BulkTlm.XmitFinished = true;
Expand Down Expand Up @@ -521,7 +552,7 @@ void TestBulkTransferMulti4(void)
CFE_ES_CreateChildTask(&BulkCmd.TaskIdXmit, "CmdXmit", UT_CommandTransmitterTask, NULL, 32768, 150, 0),
CFE_SUCCESS);
UtAssert_INT32_EQ(
CFE_ES_CreateChildTask(&BulkTlm.TaskIdXmit, "TlmXmit", UT_TelemtryTransmitterTask, NULL, 32768, 150, 0),
CFE_ES_CreateChildTask(&BulkTlm.TaskIdXmit, "TlmXmit", UT_TelemetryTransmitterTask, NULL, 32768, 150, 0),
CFE_SUCCESS);
UtAssert_INT32_EQ(
CFE_ES_CreateChildTask(&BulkCmd.TaskIdRecv, "CmdRecv", UT_CommandReceiverTask, NULL, 32768, 100, 0),
Expand Down
9 changes: 7 additions & 2 deletions modules/config/tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,15 @@ foreach(SYSVAR ${TGTSYS_LIST})
${TEMP_ARCH_BINARY_DIR}/inc
)

# If this is an EDS build, this needs to be built after the EDS tool runs
if (CFE_EDS_ENABLED_BUILD)
add_dependencies(${OBJLIB_NAME} edstool-execute)
endif()

set(PLATFORM_DEFINE_FILE ${MISSION_BINARY_DIR}/src/${OBJLIB_NAME}.c)
set(PLATFORM_LIST_FILE ${MISSION_BINARY_DIR}/src/${OBJLIB_NAME}.list)
list(APPEND PLATFORM_CONFIG_LIST $<TARGET_OBJECTS:${OBJLIB_NAME}>)
list(APPEND PLATFORM_OBJ_NAMES "CFE_PLATFORM(${SYSVAR})")
string(APPEND PLATFORM_OBJ_NAMES "CFE_PLATFORM(${SYSVAR})\n")

add_custom_command(
OUTPUT ${PLATFORM_DEFINE_FILE}
Expand Down Expand Up @@ -79,4 +84,4 @@ target_include_directories(cfeconfig_platformdata_tool PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)

add_dependencies(mission-prebuild cfeconfig_platformdata_tool)
add_dependencies(mission-prebuild cfeconfig_platformdata_tool)
2 changes: 1 addition & 1 deletion modules/config/tool/cfeconfig_platformdata_tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,4 +289,4 @@ int main(int argc, char *argv[])
}

return EXIT_SUCCESS;
}
}
2 changes: 1 addition & 1 deletion modules/core_api/fsw/inc/cfe_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define CFE_VERSION_H

/* Development Build Macro Definitions */
#define CFE_BUILD_NUMBER 183 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */
#define CFE_BUILD_NUMBER 199 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */
#define CFE_BUILD_BASELINE "equuleus-rc1" /**< @brief Development: Reference git tag for build number */
#define CFE_BUILD_DEV_CYCLE "equuleus-rc2" /**< @brief Development: Release name for current development cycle */
#define CFE_BUILD_CODENAME "Equuleus" /**< @brief: Development: Code name for the current build */
Expand Down
47 changes: 16 additions & 31 deletions modules/es/fsw/src/cfe_es_cds_mempool.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,7 @@

#include "cfe_es_module_all.h"

/*****************************************************************************/
/*
** Type Definitions
*/

/*****************************************************************************/
/*
** File Global Data
*/

const size_t CFE_ES_CDSMemPoolDefSize[CFE_ES_CDS_NUM_BLOCK_SIZES] = {
CFE_PLATFORM_ES_CDS_MAX_BLOCK_SIZE, CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_16, CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_15,
CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_14, CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_13, CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_12,
CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_11, CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_10, CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_09,
CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_08, CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_07, CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_06,
CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_05, CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_04, CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_03,
CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_02, CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_01};
#include "cfe_config.h"

/*****************************************************************************/
/*
Expand Down Expand Up @@ -103,27 +87,27 @@ int32 CFE_ES_CDS_PoolCommit(CFE_ES_GenPoolRecord_t *GenPoolRecPtr, size_t Offset
*-----------------------------------------------------------------*/
int32 CFE_ES_CreateCDSPool(size_t CDSPoolSize, size_t StartOffset)
{
CFE_ES_CDS_Instance_t *CDS = &CFE_ES_Global.CDSVars;
int32 Status;
size_t SizeCheck;
size_t ActualSize;
CFE_ES_CDS_Instance_t * CDS = &CFE_ES_Global.CDSVars;
int32 Status;
size_t SizeCheck;
CFE_Config_ArrayValue_t CDSMemPoolDefSize;

SizeCheck = CFE_ES_GenPoolCalcMinSize(CFE_ES_CDS_NUM_BLOCK_SIZES, CFE_ES_CDSMemPoolDefSize, 1);
ActualSize = CDSPoolSize;
CDSMemPoolDefSize = CFE_Config_GetArrayValue(CFE_CONFIGID_PLATFORM_ES_CDS_MEM_BLOCK_SIZE);
SizeCheck = CFE_ES_GenPoolCalcMinSize(CDSMemPoolDefSize.NumElements, CDSMemPoolDefSize.ElementPtr, 1);

if (ActualSize < SizeCheck)
if (CDSPoolSize < SizeCheck)
{
/* Must be able make Pool verification, block descriptor and at least one of the smallest blocks */
CFE_ES_SysLogWrite_Unsync("%s: Pool size(%lu) too small for one CDS Block, need >=%lu\n", __func__,
(unsigned long)ActualSize, (unsigned long)SizeCheck);
(unsigned long)CDSPoolSize, (unsigned long)SizeCheck);
return CFE_ES_CDS_INVALID_SIZE;
}

Status = CFE_ES_GenPoolInitialize(&CDS->Pool, StartOffset, /* starting offset */
ActualSize, /* total size */
CDSPoolSize, /* total size */
4, /* alignment */
CFE_ES_CDS_NUM_BLOCK_SIZES, CFE_ES_CDSMemPoolDefSize, CFE_ES_CDS_PoolRetrieve,
CFE_ES_CDS_PoolCommit);
CDSMemPoolDefSize.NumElements, CDSMemPoolDefSize.ElementPtr,
CFE_ES_CDS_PoolRetrieve, CFE_ES_CDS_PoolCommit);

return Status;
}
Expand Down Expand Up @@ -351,9 +335,10 @@ int32 CFE_ES_CDSBlockRead(void *DataRead, CFE_ES_CDSHandle_t Handle)
*-----------------------------------------------------------------*/
size_t CFE_ES_CDSReqdMinSize(uint32 MaxNumBlocksToSupport)
{
size_t ReqSize;
CFE_Config_ArrayValue_t CDSMemPoolDefSize;

ReqSize = CFE_ES_GenPoolCalcMinSize(CFE_ES_CDS_NUM_BLOCK_SIZES, CFE_ES_CDSMemPoolDefSize, MaxNumBlocksToSupport);
CDSMemPoolDefSize = CFE_Config_GetArrayValue(CFE_CONFIGID_PLATFORM_ES_CDS_MEM_BLOCK_SIZE);

return ReqSize;
return CFE_ES_GenPoolCalcMinSize(CDSMemPoolDefSize.NumElements, CDSMemPoolDefSize.ElementPtr,
MaxNumBlocksToSupport);
}
6 changes: 6 additions & 0 deletions modules/es/fsw/src/cfe_es_generic_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,12 @@ int32 CFE_ES_GenPoolInitialize(CFE_ES_GenPoolRecord_t *PoolRecPtr, size_t StartO
uint32 j;
CFE_ES_GenPoolBucket_t *BucketPtr;

if (NumBlockSizes == 0)
{
CFE_ES_WriteToSysLog("%s: cannot create pool with 0 block sizes\n", __func__);
return CFE_ES_BAD_ARGUMENT;
}

/*
* Note - being an internal/non-public API this does not need to
* check the directly-supplied arguments, it is assumed they are already
Expand Down
45 changes: 26 additions & 19 deletions modules/es/fsw/src/cfe_es_mempool.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
** Includes
*/
#include "cfe_es_module_all.h"
#include "cfe_config.h"

#include <stdio.h>
#include <string.h>
Expand All @@ -53,19 +54,6 @@
} *)0) \
->Align)

/*****************************************************************************/
/*
** Type Definitions
*/

const size_t CFE_ES_MemPoolDefSize[CFE_PLATFORM_ES_POOL_MAX_BUCKETS] = {
CFE_PLATFORM_ES_MAX_BLOCK_SIZE, CFE_PLATFORM_ES_MEM_BLOCK_SIZE_16, CFE_PLATFORM_ES_MEM_BLOCK_SIZE_15,
CFE_PLATFORM_ES_MEM_BLOCK_SIZE_14, CFE_PLATFORM_ES_MEM_BLOCK_SIZE_13, CFE_PLATFORM_ES_MEM_BLOCK_SIZE_12,
CFE_PLATFORM_ES_MEM_BLOCK_SIZE_11, CFE_PLATFORM_ES_MEM_BLOCK_SIZE_10, CFE_PLATFORM_ES_MEM_BLOCK_SIZE_09,
CFE_PLATFORM_ES_MEM_BLOCK_SIZE_08, CFE_PLATFORM_ES_MEM_BLOCK_SIZE_07, CFE_PLATFORM_ES_MEM_BLOCK_SIZE_06,
CFE_PLATFORM_ES_MEM_BLOCK_SIZE_05, CFE_PLATFORM_ES_MEM_BLOCK_SIZE_04, CFE_PLATFORM_ES_MEM_BLOCK_SIZE_03,
CFE_PLATFORM_ES_MEM_BLOCK_SIZE_02, CFE_PLATFORM_ES_MEM_BLOCK_SIZE_01};

/*****************************************************************************/
/*
** Functions
Expand Down Expand Up @@ -158,7 +146,11 @@ CFE_ES_MemPoolRecord_t *CFE_ES_LocateMemPoolRecordByID(CFE_ES_MemHandle_t PoolID
*-----------------------------------------------------------------*/
CFE_Status_t CFE_ES_PoolCreateNoSem(CFE_ES_MemHandle_t *PoolID, void *MemPtr, size_t Size)
{
return CFE_ES_PoolCreateEx(PoolID, MemPtr, Size, CFE_PLATFORM_ES_POOL_MAX_BUCKETS, &CFE_ES_MemPoolDefSize[0],
CFE_Config_ArrayValue_t MemPoolDefSize;

MemPoolDefSize = CFE_Config_GetArrayValue(CFE_CONFIGID_PLATFORM_ES_MEM_BLOCK_SIZE);

return CFE_ES_PoolCreateEx(PoolID, MemPtr, Size, MemPoolDefSize.NumElements, MemPoolDefSize.ElementPtr,
CFE_ES_NO_MUTEX);
}

Expand All @@ -170,7 +162,11 @@ CFE_Status_t CFE_ES_PoolCreateNoSem(CFE_ES_MemHandle_t *PoolID, void *MemPtr, si
*-----------------------------------------------------------------*/
CFE_Status_t CFE_ES_PoolCreate(CFE_ES_MemHandle_t *PoolID, void *MemPtr, size_t Size)
{
return CFE_ES_PoolCreateEx(PoolID, MemPtr, Size, CFE_PLATFORM_ES_POOL_MAX_BUCKETS, &CFE_ES_MemPoolDefSize[0],
CFE_Config_ArrayValue_t MemPoolDefSize;

MemPoolDefSize = CFE_Config_GetArrayValue(CFE_CONFIGID_PLATFORM_ES_MEM_BLOCK_SIZE);

return CFE_ES_PoolCreateEx(PoolID, MemPtr, Size, MemPoolDefSize.NumElements, MemPoolDefSize.ElementPtr,
CFE_ES_USE_MUTEX);
}

Expand All @@ -190,6 +186,7 @@ CFE_Status_t CFE_ES_PoolCreateEx(CFE_ES_MemHandle_t *PoolID, void *MemPtr, size_
size_t Alignment;
size_t MinimumSize;
char MutexName[OS_MAX_API_NAME];
CFE_Config_ArrayValue_t MemPoolDefSize;

/* Sanity Check inputs */
if (MemPtr == NULL || PoolID == NULL)
Expand All @@ -198,10 +195,10 @@ CFE_Status_t CFE_ES_PoolCreateEx(CFE_ES_MemHandle_t *PoolID, void *MemPtr, size_
}

/* If too many sizes are specified, return an error */
if (NumBlockSizes > CFE_PLATFORM_ES_POOL_MAX_BUCKETS)
if (NumBlockSizes > CFE_MISSION_ES_POOL_MAX_BUCKETS)
{
CFE_ES_WriteToSysLog("%s: Num Block Sizes (%d) greater than max (%d)\n", __func__, (int)NumBlockSizes,
CFE_PLATFORM_ES_POOL_MAX_BUCKETS);
CFE_MISSION_ES_POOL_MAX_BUCKETS);
return CFE_ES_BAD_ARGUMENT;
}

Expand All @@ -210,10 +207,20 @@ CFE_Status_t CFE_ES_PoolCreateEx(CFE_ES_MemHandle_t *PoolID, void *MemPtr, size_
*/
if (BlockSizes == NULL)
{
BlockSizes = CFE_ES_MemPoolDefSize;
MemPoolDefSize = CFE_Config_GetArrayValue(CFE_CONFIGID_PLATFORM_ES_MEM_BLOCK_SIZE);

BlockSizes = MemPoolDefSize.ElementPtr;
if (NumBlockSizes == 0)
{
NumBlockSizes = CFE_PLATFORM_ES_POOL_MAX_BUCKETS;
NumBlockSizes = MemPoolDefSize.NumElements;
}

/* If too many sizes are specified, return an error */
if (NumBlockSizes > MemPoolDefSize.NumElements)
{
CFE_ES_WriteToSysLog("%s: Num Block Sizes (%d) greater than max (%lu)\n", __func__, (int)NumBlockSizes,
(unsigned long)MemPoolDefSize.NumElements);
return CFE_ES_BAD_ARGUMENT;
}
}

Expand Down
Loading

0 comments on commit 2878379

Please sign in to comment.