This file tracks user visible API changes
bugfix release:
- blockdiagram: don't reject connections among iblocks
- ubx.lua: handle different libubx naming schemes
-
trig
,ptrig
,trig_utils
: addevery
member to configure reduced frequency triggering. If set, the respective block will be only triggered everyevery
time with respect to the base frequency. -
blockdiagram
, hierarchical composition: add support for adding subsystems without a namespace, i.e. effectively merging them. If a subsystem is added to thesubsystems
table without a name, then it will me merged similar to when multiple models are provided on the cmdline. However, in the latter case, the merged models override existing entries, whereas when specified insubsystems
, the parent subsystem takes precedence. This feature is mainly useful to avoid deep hierarchies. In addition this cleans up the merge function and adds a verbose-v
option toubx-launch
, for printing early messages (mainly merge actions for now). -
ubx-mq
- add support for writing to mqueues. Example:
ubx-mq write mymq "{0,0.01,0,0.1,0}" -r 0.1
- show types in mq listing (this requires latest
uutils
v1.1.0.
- add support for writing to mqueues. Example:
-
rtlog:
-
move spinlock into shm and initialize with
PTHREAD_PROCESS_SHARED
cmdline tools such asubx-mq
create processes and nodes that log to the same shm. Hence we set the default to shared. Users that really need to squeeze performance can explicitely set this back toPTHREAD_PROCESS_PRIVATE
. -
don't delete the log shm upon cleanup and don't truncate it during node init if the size is correct. This avoids unnecessary reopening (incl. seeks backs) especially in multi-node setups and facilitates debugging by preserving the log buffer.
-
-
ubx.lua
: add genericconnect
function. This replacesconn_lfds_cyclic
andconn_uni
and allows the following connection types:- cblock to cblock
- cblock to existing iblocks (and vice versa)
- cblock to non-existing iblock (and vice versa). In this case the iblock block will be created.
See the user docs for more information.
-
ubx_ports_connect
: check and enforce that types and data length match. -
lfds_cyclic
: makebuffer_len
config optional and let it default to 1 if unset. -
removed the deprecated
file_logger
block. This was messy and hard to maintain. The preferred approach to log is now by usingubx/mqueue
blocks andubx-mq(1)
. -
std_blocks
: cleanup block naming. all blocks understd_blocks/
are now calledubx/BLOCKNAME
.
-
typemacros: added
def_cfg_set_fun
to define type safe configuration setters akin akin todef_cfg_getptr_fun
. Seeexamples/platform/platform_launch/main.c
for a usage example. -
std_blocks: added saturation block. This multi-length block will limit the given signal to the configured minima and maxima.
-
trig, ptrig: added multi-chain (i.e. formerly called
trig_blocks
lists). The desired number of chains can now be configured usingnum_chains
and it can be switched among these via theactive_chain
port. To make this feasible, a number of cleanups and renames was done in trig_utils:- the previous
trig_blocks
config was renamed tochain0
. Additional chains are calledchain1
,chain2
etc. struct trig_info
was renamed tostruct ubx_chain
trig_info_*
API was renamed totrig_chain_*
stuct ubx_trig_spec
was renamed tostruct ubx_triggee
tstat.block_name
renamed totstat.id
- the previous
-
add function based predicates
blk_is_*
,port_is_*
andcfg_is_*
to replace the oldIS_
macros . -
lfds_cyclic
: addedallow_partial
config to allow transporting messags that are <data_len
. If unset, the new default is to reject these. This also extends the lua port_clone_conn function with an optionalallow_partial
parameter. -
ubx_node_info_t
renamed toubx_node_t
for consistency.ubx_node_t
variables renamed fromni
tond
. -
ubx-genblock
updated to generate state of the art blocks -
ubx_ports_connect_uni
/ubx_ports_disconnect_uni
/- renamed: dropped
_uni
suffix - made iblock parameter
const
- renamed: dropped
-
ubx_block_
: storeports
andconfigs
in autlist.h
double linked list instead of a dynamic array (background). -
registration of static blocks has changed. Use the types
ubx_proto_block_t
,ubx_proto_port_t
andubx_proto_config_t
to define blocks definition andubx_block_register(ubx_node_t*, ubx_block_proto_t* bt)
to register them. Note that this only changed for the static definition/registration of blocks. At runtime (i.e. in hooks etc) the non-_proto_
versions are used as before (background). -
ubx_config_add2
adds a config inclmin
/max
constraints and attrs. -
The attributes
CONFIG_ATTR_CLONED
andPORT_ATTR_CLONED
are set for ports/configs that were created as a consequence of creating a block by cloning. Put differently, these attributes are unset for configs and ports that were added dynamically. -
ubx_port_add
ubx_inport_add
,ubx_outport_add
: the parameterstate
has been dropped (as has the member inubx_port_t
. Insteadattrs
has been added as parameter #4. Checkubx_proto.h
for the new prototypes. -
ubx_types.h
: converted object names (node, block, port, config) from dynamically allocated strings to fixed strings where possible. -
ubx_types.h
:-
removed port
state
, which was never used. The functionsubx_port_add
(luaubx.port_add
) consequently drop the last parameter. -
removed port direction attributes
PORT_DIR_OUT
andPORT_DIR_IN
. Instead this is determined from a non-NULLin_
orout_type
ptr. The macrosIS_OUTPORT
,IS_INPORT
andIS_INOUTPORT
do this in a portable way. -
removed port statistics (were never used)
-
-
renamed constants for consistency:
BLOCK_NAME_MAXLEN
->UBX_BLOCK_NAME_MAXLEN
PORT_NAME_MAXLEN
->UBX_PORT_NAME_MAXLEN
TYPE_NAME_MAXLEN
->UBX_TYPE_NAME_MAXLEN
LOG_MSG_MAXLEN
->UBX_LOG_MSG_MAXLEN
TYPE_HASH_LEN
->UBX_TYPE_HASH_LEN
TYPE_HASHSTR_LEN
->UBX_TYPE_HASHSTR_LEN
-
doc improvements:
- added
examples/usc/threshold.usc
gentle example docs/user/
introduction improved
- added
-
added
math_double
block which supports a large number ofmath.h
functions. -
std_blocks/examples
cleanupsimple_fifo
andrandom
moved underexamples/
- added
skelleton.c
as a minimal but complete empty block - added
threshold
example block for use in simple usc intro
-
trig
,ptrig
:- indepent of
tstats_output_rate
, all stats are written to the porttstats
(if it exists) instop()
. - config
autostop_steps
added to stop ptrig after triggering this number of times.
- indepent of
-
port_clone_conn
: addloglevel_overruns
argument. -
const
block refactored into a generic block that is configured with the ubxtype_name
anddata_len
, and then with the actual value of the type. Both a cblockcconst
and an iblockiconst
variant are available. -
blockdiagram: small extension to support dynamic configurations. If a config does not exist in state
preinit
, configuration will be retried ininactive
. -
core: add
ubx_node_clear
. This function stops, cleans up and removes all non-prototype blocks. -
ptrig
: add CPUaffinity
config (optional). This takes a list of the cores to run on. Default is no affinity. -
lfds_cyclic
: addloglevel_overruns
config. This allows configuring the loglevel of overrun conditions, or silencing them completly by setting the value-1
.
-
triggers: if
num_steps
is 0, this will be interpreted as the default (1 step). To disable triggering of a block, set to -1. -
Accessors for all stdtypes are defined using
def_type_accessors
, hence blocks can use these instead of defining their own. -
core: cleanup of port read/write and config accessors. The macros
def_write_fun
anddef_read_fun
def_write_arr_fun
def_read_arr_fun
def_write_dynarr_fun
anddef_read_dynarr_fun
have been deprecated in favor of the following new ones (the macro parameters are the same, so simple renaming will work in most cases):
def_port_readers(FUNCNAME, TYPENAME)
def_port_writers(FUNCNAME, TYPENAME)
will each define both single element function as well as the array version, e.g. for the writer side:
long FUNCNAME(const ubx_port_t* p, TYPENAME* val)
long FUNCNAME_array(const ubx_port_t* p, TYPENAME* val, const int len)
For convenience, the the macros
def_port_accessors(SUFFIX, TYPENAME)
anddef_type_accessors(SUFFIX, TYPENAME)
can be used to define both port readers and writers or port readers, writers and config accessors respectively (Note: these take a function name suffix instead of the whole name).Internally, the implementation is both safer and significantly faster due to avoiding a hash table lookup.
-
lua:
conn_uni
: iblock name generation scheme changed from using a timestamp to an incrementing counter. This is to facilitate testing, that can rely on reproducable names. -
tools:
ubx_launch
,ubx_ilaunch
,ubx_genblock
,ubx_log
andubx_tocarr
are renamed toubx-launch
,ubx-ilaunch
,ubx-genblock
,ubx-log
andubx_tocarr
respectively. -
convert
CONFIG_DUMPABLE
andCONFIG_MLOCK_ALL
to node attributes. These can now be set asubx-launch
parameters (or at C-API level by setting the respective bits in theattrs
parameter). -
doc: generate block reStructuredText docs using
ubx-modinfo
-
core: added
ubx_module_get
function and extended Luaload_module
to return the module id (i.e. path from which it was loaded). The latter can be passed to the former function (e.g. for looking up an spdx license id). -
core: added functions for
ubx_type_t
lookup via hash or hashstr. -
added PID controller block and extended ramp block with a
data_len
parameter to allow vector ramp output. Added helper functions for reading/writing arrays (def_write_dynarr_fun
anddef_read_dynarr_fun
) where the size is determined at run-time. Added helpers for resizing port data lenght (ubx_inport_resize
andubx_outport_resize
). -
ubx_launch
:-c
options now supports multiple arguments and will merge all given models into the first before launching. Use-case is for late addition of policy (e.g.ptrig
blocks etc.) to otherwise reusable compositions. -
blockdiagram: drop the
start
directive that was used to pass the last blocks to be started (i.e. ptrig) to the launch logic. This is not necessary anymore, as the launch logic will ensure to startup active blocks (seeBLOCK_ATTR_ACTIVE
) after all others. -
blockdiagram: add composition support to permit hierarchical composition of usc systems. This change introduces the
subsystems
keyword and is backwards compatible with existing compositions. -
ubx-launch
:-s
option added for printing usc launch messages to stderr (in additon to the rtlog). Useful for debugging when long messages may get truncated in the rtlog. -
triggering:
trig
,ptrig
,trig_utils
-
tstat_utils
: rename totrig_utils
. Created generic trigger implementation intrig_utils
for use bytrig
andptrig
as well as custom usertriggers
. -
ptrig
andtrig
converted to use generic trigger handling fromtrig_utils
-
tstats_enabled
renamed totstats_mode
. Values are- 0: off
- 1: total tstats only
- 2: total and per block tstats
-
ptrig
andtrig
: new configtstats_output_rate
for configuring how often statistics are written to the tstats port. -
config
tstats_print_on_stop
dropped. New behavior is: iftstats_mode
is non-zero, then stats will be logged on stop.
-
-
stattypes
: merge intostdtypes
as this only contains the ubx_tstat type. Hence, there is no need to importstattypes
anymore.
-
core: add environment variable
UBX_PATH
that can be used to specify alternative installation paths. If defined, ubx will search the colon separated list of directories for ubx headers and modules. -
core: ffi: types: strip preprocessor directives from types that are fed to the ffi. This is to allow include guards in these header files.
-
config: add
min
/max
specifiers for introducing constraints such as optional or mandatory configs. -
struct ubx_block: added attributes variable (
attrs
) and defined first block attributes (BLOCK_ATTR_TRIGGER
andBLOCK_ATTR_ACTIVE
). These will be used by tools such as ubx_launch, so blocks should be updated to define these appropriately. -
blockdiagram.load: change to return
system
or fail and exit -
rtlog: enable gcc format checking. This checks the provided arguments match the given format string.
-
ubx_tocarr: cmdline args added to allow overriding output file file
-
ubxcore:
ubx_node_cleanup
changed to remove blocks and unload modules, but to leaving the node intact. For destroying a node,ubx_node_rm
was introduced. -
ubx.lua:
config_get
returnsnil
if a config doesn't exist instead of throwing and error -
added
ubx-modinfo
tool for offline module introspection -
lfds_cyclic: increased loglevel for buffer overflow logging to NOTICE.
-
introduced real-time safe logging and switched core and std_blocks to it
-
data_size
: changed return value tolong
(signed) to be able to signal errors via negative return value.
-
renamed TSC configure option
tsc-timers
totimesrc-tsc
-
added hooks for extra checking
-check
and-werror
and two checks for unconnected in- and outports. -
removed generated
ubx_proto.h
from git -
cleanup: headers moved to
include/ubx/
. pkg-config file adapted, so this change should be transparent. -
trig, tstat: timing statistics support generalized for use in non-core blocks.
-
support for using TSC timers (x86) as a low-overhead time source for timing statistics.
-
ubx.lua
use unversionedlibubx.so
-
bugfix in
ubx_port_add
(see 28e6d8acc42)
- ubx_launch, blockdiagram: exit and complain loudly if launching a blockdiagram fails
-
updated all blocks to new config handling
-
switch len and ptr*
ubx_config_get_data_ptr
to be streamlined with the newcfg_getptr_*
utilities and to allow reporting errors. The new prototype is:
`long ubx_config_get_data_ptr(ubx_block_t *b, const char *name,
void **ptr)
len < 0 signifies and error, 0 that the config is unset and > 0
means configured and array lenght of len
.
-
configurations are not initalized to size 1 by default. This was useful back in the day when most configurations were of len 1, but this is not true anymore and it makes in cumbersome to distinguish between unconfigured and configurations with value 0. This is mainly visible through
ubx_config_get_data_ptr
, which may now returnNULL
and len=0. Blocks must handle this case. -
cfg_getptr_[char|int|...]
convenience functions added. These functions allow retrieving configuration in a somewhat more typesafe manner. Example:long len; uint32_t *val; len = cfg_getptr_uint32(b, "myconf", &val); if(len == 0) /* myconf unconfigured */ else if(len > 1) /* myconfig configured, use val */ else /* len < 0, error */
-
removed unused and deprecated
lfds_cyclic_raw
block.
-
blockdiagram, ubx_launch: moved node config from
configurations
to a separate top level sectionnode_configurations
. This avoids thatconfigurations
becomes a hybrid dictionary/array which causes problems when importing from json. -
pkg-config:
ubx_moddir
renamed toUBX_MODDIR
for consistency.
-
support for node configuration in C and via the
ubx_launch
DSL. Using the node (global) configuration mechanism multiple block configurations can be setup to refer to the same configuration value. This way, only one "screw" needs to be turned to change the configuration for all blocks, and the required memory is only allocated once.Note that it is transparent to the blocks whether they are configured individually or via a node config.
For an example, take a look at node_config_demo.usc
-
the static initialization of block configuration array length has changed during the refactoring for node config support:
/* old way */
ubx_config_t blk_conf[] = {
{ .name="foo", .type_name="char", .value = { .len=32 }
{ NULL }
};
/* new way */
ubx_config_t blk_conf[] = {
{ .name="foo", .type_name="char", .data_len=32 }
{ NULL }
};
if you didn't use this (probably the case for most blocks), there's nothing to change.
-
ubx_launch
: shutdown option-b
added to shutdown when a (trigger) block is stopped. -
ubx_data_free
: removed unused ni argument -
enabled full warnings
-Wall -Wextra -Werror
and fixed all occurences. -
added
ubx_outport_add
andubx_inport_add
convenience functions. -
thorough cleanup of
ptrig
:- removed ifdef'ed timing statistics
- removed MAX_BLOCKS define for number of timing blocks
tstats_print_on_stop
config to print statistics
-
ubx_types.h
: reduceBLOCK_NAME_MAXLEN
to 30 -
more tests added: ptrig
-
various fixes
-
ramp
block generalized to support all basic types -
various fixes
-
simple ramp block added
-
blockmodel
: pulldown support added. -
promoted
get_num_configs
andget_num_ports
to public IF. -
ubx_ts_to_ns
added to convertubx_timespec
to uint64_t ns. -
ubx_launch
: -t added to run for a specific amount of time.
-
ubx_launch
start directive e5a716c4c096020ec0767a7eb87c3952977919a2 -
ubx_launch
JSON support 4cc5fc83ae966153289c4dc9733d77737f7342e1 -
various smaller cleanups
-
support for type registration in C++ added 0736a5172e7fb2a93dc7c9f42c525c0e5626ae0e
-
introduce
ubx_ilaunch
for interactive mode 1725f6172d92730044928ffaf984ec8b57be8bcb. Renamed non interactive version toubx_launch
. -
file2carr.lua
renamed toubx_tocarr
a3eee190b93423a49a678d20b239bc1dd30a3444 -
install core modules into
$(prefix)/lib/microblx/<major.minor>/
51e1bbb6c79dc3aa9081802334c54f2c5bab1270 -
[9ff5615f9d] removed std Lua modules provided by separate package
uutils
(see README.md). -
[469e930b8a] Clang dependency removed: compiling with gcc works when using initialization as demonstrated in
std_blocks/cppdemo
. -
[4213621d55] merged support for autotools build
-
[4e3a0b9a72] OO support for node, block, port, config, data and type. Removed old and unused Lua functions.
-
[65cd7088c6] interaction blocks are not strongly typed, i.e. instead if data element size and number of buffer elements, the type name, array len and number of buffer elements are given. This will help ensure type safety for inter-process iblocks.
-
[575d26d8ea] removed
ubx_connect_one
andubx_connect
. Useubx_connect_out
,ubx_connect_in
andubx_connect_uni
instead. -
the port direction attrs
PORT_DIR_IN/OUT/INOUT
can be ommitted in the definition of block ports. They are automatically inferred from the presence ofin_type_name
/out_type_name
. -
renamed
module_init/module_cleanup
toUBX_MODULE_INIT/UBX_MODULE_CLEANUP