DBSimGenerator
DBSimGenerator generates simulation and interface code automatically from ICD (Interface Control Document) CSV files. Each CSV defines one or more blocks, containing fields and metadata that describe how data is structured, scaled, and interpreted.
DBSimGenerator automatically generates high-performance C++ code for simulation and interface directly from ICD (Interface Control Document) CSV files. Each CSV defines one block with fields and metadata describing how data is structured, scaled, and interpreted.
Terminology: LRU, Block, Element
ICDs are organized in a three-level hierarchy:
- LRU (Line Replacement Unit) - one physical or logical
replaceable unit (a named CSV subfolder, e.g.
LRU_FC). An LRU holds a list of Blocks, and it's the LRU that defines the Raw ↔ Eng conversion for everything it contains - see Raw ↔ Eng Conversion in the Model guide. - Block - one CSV file within an LRU folder (e.g.
Telemetry.csv). A Block holds a list of Elements and is the unit that streams send and receive to/from a device - the"blocks"array in streams.json is a list of Blocks. - Element - one row of a Block CSV (one field), e.g.
AltitudeorSpeedin the example below.
CSV Directory Structure
project_name/ ├── LRU_name/ │ ├── Block_name.csv │ └── Enums.csv
Key Features
- High-Performance Code: Generates optimized C++ code for fast simulations.
- RAW and ENG Types: Supports both raw data and engineering unit conversions for flexible use.
- Endian & Bit Ordering: Handles Little/Big Endian and MSB/LSB conversions automatically — see Raw ↔ Eng Conversion for the
NoRaw/LElsb/LEmsb/BElsb/BEmsbblock conventions. - Hardware Integration: Integrates directly with HW drivers using
streams.jsonfor seamless system communication. - Automated & Scalable: Reduces repetitive coding, supporting multiple blocks, LRUs, and projects effortlessly.
Workflow
- Prepare ICD CSV files and Enums for your blocks.
- Organize CSVs in the project → LRU → block structure.
- DBSimGenerator reads the CSVs and generates high-performance code.
- Generated code integrates with simulation frameworks and hardware drivers.
With DBSimGenerator, you can focus on building your technology while the platform handles 80% of the integration and boilerplate code automatically.
Example ICD CSV snippet
BlockName, FieldName, Type, Size, Description
Telemetry, Altitude, float, 4, Aircraft altitude (m)
Telemetry, Speed, float, 4, Airspeed (m/s)
1. ICD Blocks and Elements
| # Bytes | Name | Data Type | Array Size | Bits | Bits Size | Enum | Value / Units | Eng Type | Scale | Default | Description |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 4 | Altitude | R4 | 1 | - | - | - | m | float | 1.0 | 0 | Aircraft altitude |
| 4 | Speed | R4 | 1 | - | - | - | m/s | float | 1.0 | 0 | Aircraft speed |
2. Data Type Specification
| Short | Type | Size (Bytes) | Min | Max | Resolution |
|---|---|---|---|---|---|
| U1 | Unsigned Char | 1 | 0 | 255 | 1 |
| I1 | Signed Char | 1 | -128 | 127 | 1 |
| X1 | Bitfield | 1 | n/a | n/a | n/a |
| U2 | Unsigned Short | 2 | 0 | 65535 | 1 |
| I2 | Signed Short | 2 | -32768 | 32767 | 1 |
| X2 | Bitfield | 2 | n/a | n/a | n/a |
| U4 | Unsigned Long | 4 | 0 | 4,294,967,295 | 1 |
| I4 | Signed Long | 4 | -2,147,483,648 | 2,147,483,647 | 1 |
| X4 | Bitfield | 4 | n/a | n/a | n/a |
| R4 | IEEE 754 Single Precision | 4 | -1×2127 | 2127 | ≈2⁻²⁴ |
| R8 | IEEE 754 Double Precision | 8 | -1×21023 | 21023 | ≈2⁻⁵³ |
| X8 | Bitfield | 8 | – | – | – |
3. Enums
| Name | Value |
|---|---|
| Mode_Manual | 0 |
| Mode_Auto | 1 |
| Error_None | 0x00 |
| Error_Sensor | 0x01 |