v4.0.0a1 (Alpha 1) #3625
LeStarch
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
F Prime v4 Alpha Release 1 🎉
This is the first alpha release of F Prime v4. This release comes with the following amazing features:
Svc/FpySequencer
)GdsStandardApp
,DataHandlerPlugin
)Breaking Changes
Typing Changes
F Prime is removing the
NATIVE_INT_TYPE
,PlatformIntType
, etc. Additionally, F Prime has begun ensuring that configurable types (e.g.FwIndexType
) are configured to fixed-width values. The requirements (signed, minimum sizes) can be found in the numerical types document.Users needing non-default values for configurable types should set them as type aliases in FPP using the new configuration system.
FwIndexType Required as Port Indices
Users of older F Prime code may still have
NATIVE_INT_TYPE
used as port indices. This is now required to beFwIndexType
. Other uses ofNATIVE_INT_TYPE
must also be replaced.Before:
const NATIVE_INT_TYPE portNum
After:
Rate Group Contexts
Rate group context has been changed to the fixed-width type
U32
.Before
After:
Unit Test Constant Changes
In the same capacity as above, unit test constants of
NATIVE_INT_TYPE
are not supportedBefore:
After:
New CMake Module Structure
The old module registration structure in F Prime had one primary limitation: SOURCE_FILES and MOD_DEPS were variables and thus could bleed into other module registrations if not unset. This pollution of CMake's variable namespace, high chance for user error, and poor choice of the name "MOD_DEPS" led to a need to refactor how modules are done. To fit in with modern CMake practices, all module inputs are arguments to the registration calls with individual variables specified by directive arguments (e.g. SOURCES, DEPENDS).
Tip
register_fprime_module
,register_fprime_deployment
andregister_fprime_ut
still supportMOD_DEPS
,SOURCE_FILES
,UT_MOD_DEPS
,UT_SOURCE_FILES
. Updating to the new structure is only required forregister_fprime_configuration
calls. However, new features will only be supported with the new structure and as such, users are encouraged to update when needed.The new
register_fprime_*
calls are provided arguments lists separated by argument directives to specify sources (SOURCES
), dependencies (DEPENDS
) etc.The first argument is an optional explicit module name followed by directives and their argument lists.
Before:
After:
Tip
Notice that autocoder inputs are now specifically called out separately from compiled source files.
Warning
Do not specify an explicit module name when autocoding FPP.
Old variable usage can be translated to new directives using the following table:
cc
,c++
, or other compilerDeployment Ordering
Since deployments in F Prime do recursive detection of items like unit tests, etc, deployments now check for the existence of F Prime modules that support them. This means F Prime deployments must be defined last in the CMake structure.
Before:
After:
Project Configuration Changes
One of the flaws of historical F Prime is that configuration was an all-or-nothing copy. It meant that projects, libraries, etc could not just override what was changed. This presented projects with a maintenance issue: owning unchanged code provided by F Prime while tracking their own minor changes.
With
v4.0.0
projects choose to override specific files and the rest are inherited from underlying configuration modules.Additionally, each configuration is specified as a module. Use the
CONFIGURATION_OVERRIDES
directive to override existing config. UserSOURCES
,HEADERS
, andAUTOCODER_INPUTS
as usual to specify new configuration (i.e. new configuration for your library). Modules specifying onlyCONFIGURATION_OVERRIDES
must also use theINTERFACE
specifier.To specify a new configuration module, ensure that some directory added to the project with
add_fprime_subdirectory
contains aCMakeLists.txt
including aregister_fprime_config
call.See changes in cmake module structure to understand the format of the
register_fprime_config
call.CMakeLists.txt
This example shows how to override just
FpConifg.fpp
andIpCfg.hpp
from fprime.Tip
Configurations are overridden by filename, so remember to keep your filenames consistent with the file you wish to override.
Tip
Default F Prime configuration lives at
fprime/default/config
projects will use these settings unless the filename is included in a projects configuration module viaCONFIGURATION_OVERRIDES
.Warning
F Prime only has the notion of a single configuration per project (i.e. build). You still may not specify different configurations for different modules built by the same project.
Component Configuration Usage Changes
All configuration headers used from the F Prime configuration directory
default/config
, a library configuration directory, or a project configuration directory must specify the path including the parent folder.Before:
After:
Additionally, components wanting to depend on and use core F Prime configured types must depend on
Fw_Types
and includeFw/FPrimeBasicTypes.h
orFw/FPrimeBasicTypes.hpp
.Before: C++
After: C++
Before: CMakeLists.txt
After: CMakeLists.txt
Tip
Fw_Types
is auto-detected for FPP-based modules. Add this dependency when not using FPP autocoding on your module.Platform Changes
Platforms have had several major changes in
v4.0.0
:register_fprime_config
Platform Types
Platform types were previously defined as header typedefs, however; this meant these types (which flow into configurable types) are not available to FPP models. These types are now aliases within FPP.
Before (PlatformTypes.h)
After (PlatformTypes.fpp)
Warning
Since
PlatfromPointerCast
should not be used in the model, it is kept inPlatformTypes.h
The requirements on these types, and the complete list are found in the numerical types documentation.
Platform Definitions
Platform definitions are defined in
cmake/platform/<name-of-platform>.cmake
. This file must now define an fprime configuration module that performs the autocoding for the newPlatformTypes.fpp
Before
After
Uplink/Downlink Changes
The Uplink and Downlink components have been updated for better modularity and to allow for easy support of other communication protocols.
Example Change Set
If using a standard Uplink/Downlink stack as generated by
fprime-util new --deployment
, the full change-set that users need to apply to their topology is shown in the LedBlinker change logClick to Expand changes to a topology.fpp
Before (topology.fpp)
After (topology.fpp)
Click to Expand changes to a instances.fpp
Diff (instances.fpp)
Click to Expand changes to a Topology.cpp
The following removes the old framing/deframing protocols, and introduces the new
FprimeFrameDetector
.Diff (Topology.cpp)
Uplink Changes
The old
Svc.Deframer
was performing 3 functionalities: (1) accumulating bytes in a circular buffer until it detects a full frame, (2) validating the frame and extracting the payload data, and (3) routing payload data to its destination.In the new Uplink stack, these 3 functionalities have been split into 3 distinct components: (1)
Svc.FrameAccumulator
, (2)Svc.FprimeDeframer
, and (3)Svc.FprimeRouter
. To learn more about these components, please check out their SDDs on the website!Each component implements an FPP Interface (in
Svc/Interfaces/
) so that they can be swapped with project-specific components, allowing for custom Deframing / Routing.Memory Management
Memory management in the Uplink/Downlink stack has been updated so that a buffer coming out of a component on
dataOut
shall come back ondataReturnIn
. This allows for components to allocate/deallocate memory as they see fit, and for the Topology Engineer not to have to track down memory management of each component to make sure they are wired correctly with the appropriate BufferManagers.Downlink Changes
In the Downlink stack, the port connections have been modified to fit the new memory management pattern. The Framer now implements the
FramerInterface.fppi
to allow projects to implement custom Framing easily.Other Components
FileUplink and FileDownlink now prepend the buffers (file packets) they send out with the appropriate
FW_PACKET_FILE
marker, as it is expected for all F´ data packets.ComQueue has been updated to handle buffer management according the "Data Return" pattern mentioned above.
New Contributors
This discussion was created from the release v4.0.0a1 (Alpha 1).
Beta Was this translation helpful? Give feedback.
All reactions