csp_proc

Lightweight, programmable procedures with a libcsp- and libparam-native runtime.

View the Project on GitHub discosat/csp_proc

Setup csp_proc

The easiest way to integrate csp_proc is with meson. As of writing, no other build systems are supported out-of-the-box, so you’ll have to get creative if using meson is not an option. See below for an overview of the constituent parts of csp_proc.

The following demonstrates the outline of a meson.build file in a parent project where libcsp, libparam, and csp_proc are present in the lib subdirectory:

project(..., subproject_dir: 'lib', default_options: [
	'csp_proc:slash=false',
	'csp_proc:freertos=false',
	'csp_proc:posix=true',
	'csp_proc:proc_runtime=true',
	'csp_proc:RESERVED_PROC_SLOTS=...',
    ...
])

deps = []
deps += dependency('csp', fallback: ['libcsp', 'csp_dep'])
deps += dependency('param', fallback: ['libparam', 'param_dep'])
deps += dependency('csp_proc', fallback: ['csp_proc', 'csp_proc_dep']).as_link_whole()

app = executable(...
	dependencies : deps,
	...
)

Note that csp_proc is not a standalone library. The core part of the library depends on libparam and libcsp, while optional parts depend on slash and the FreeRTOS kernel or POSIX functionality. A reference setup can be found in the following Dockerfile, which is the environment that’s used to run the automated tests in the CI pipeline.

Composition of the library

The library has the following components:

Core

The core part of the library consists of the following files:

Storage

Runtime

Slash

Configuration options at compile-time

The following options can be configured at compile-time:

In addition to the above, the default runtime implementations have their own set of configuration options:

And the FreeRTOS-based runtime has the following additional options:

Please note that the FreeRTOS-based runtime requires a FreeRTOSConfig.h file in the parent project. This configuration file should define configNUM_THREAD_LOCAL_STORAGE_POINTER to a value greater than 0, as the tracking of recursion depth is done using thread-local storage.

Lastly, the library has the following meson build options: