Bit Splitter
Component Type: Program
Status: Implemented
Overview
CProgBitSplit extracts logical bit slices from one input into N output IO
outputs. Each output starts at its configured bit offset in the source
logical bitstream. bool outputs receive one logical bit per element;
other fixed-width scalar dtypes receive the raw bit slice for their size and
dimension.
This is a callback-driven standalone program. It is the complement of CProgBitPack.
Implementation
Source IO must be notify-capable.
Each bind specifies one bit position; the number of binds must match the number of entries in the
bitsconfig array.On every incoming sample, the program copies the requested logical bit slice into the corresponding output via
setData().Unsupported dtypes:
charandblock.
Logical bit model
For
boolIOs, each element contributes one bit.For other supported fixed-width scalar dtypes, each element contributes
dtype_size * 8bits.The
bitsentry for a bind is the start offset in the source logical bitstream.Example:
uint32input0x44332211withbit: 8anduint16output yields0x3322.
Configuration
Kconfig
CONFIG_DAWN_PROG_BITSPLIT: enables the program.
YAML
programs:
- id: my_bitsplit
type: bitsplit
config:
inputs: [button_io, button_io, button_io, button_io]
outputs: [virt_btn0, virt_btn1, virt_btn2, virt_btn3]
bits: [0, 1, 2, 3]
The inputs must all reference the same source IO. outputs and
bits must have the same length.
Supported descriptor patterns include:
uint32 -> boolbutton-style bit extractionuint32 -> uint16slice extractionAny supported fixed-width scalar input/output combination where the output bit width fits inside the source logical bit range