How to Generate Simulation Code with DBSimGenerator

Convert ICD CSV documents into simulation-ready C++ code blocks.

This guide shows you how to structure your ICD CSV files and run them through DBSimGenerator to produce high-performance C++ simulation and interface code.

1. Understand What DBSimGenerator Does

DBSimGenerator automatically generates high-performance C++ code for simulation and interface directly from ICD (Interface Control Document) CSV files. Each CSV defines one block, containing fields and metadata describing how data is structured, scaled, and interpreted.

2. Organize Your CSV Directory

Arrange your ICD CSV files in a project → LRU → block structure:

project_name/
├── LRU_name/
│   ├── Block_name.csv
│   └── Enums.csv

3. Write the ICD CSV

Each row of a block CSV describes one field. A minimal example:

BlockName, FieldName, Type, Size, Description
Telemetry, Altitude, float, 4, Aircraft altitude (m)
Telemetry, Speed, float, 4, Airspeed (m/s)

A full ICD block definition includes these columns:

# BytesNameData TypeArray SizeBitsBits SizeEnumValue / UnitsEng TypeScaleDefaultDescription
4AltitudeR41---mfloat1.00Aircraft altitude
4SpeedR41---m/sfloat1.00Aircraft speed

4. Choose the Correct Data Type Codes

Use these short type codes when specifying a field's Data Type:

ShortTypeSize (Bytes)MinMaxResolution
U1Unsigned Char102551
I1Signed Char1-1281271
X1Bitfield1n/an/an/a
U2Unsigned Short20655351
I2Signed Short2-32768327671
X2Bitfield2n/an/an/a
U4Unsigned Long404,294,967,2951
I4Signed Long4-2,147,483,6482,147,483,6471
X4Bitfield4n/an/an/a
R4IEEE 754 Single Precision4-1×21272127≈2⁻²⁴
R8IEEE 754 Double Precision8-1×2102321023≈2⁻⁵³
X8Bitfield8

5. Define Enums

List named values in an Enums.csv file alongside your block CSVs:

NameValue
Mode_Manual0
Mode_Auto1
Error_None0x00
Error_Sensor0x01

6. Run the Generator Workflow

  1. Prepare ICD CSV files and Enums for your blocks.
  2. Organize CSVs in the project → LRU → block structure.
  3. Run DBSimGenerator so it reads the CSVs and generates high-performance code.
  4. Integrate the generated code with your simulation frameworks and hardware drivers.

7. Take Advantage of Key Features

With DBSimGenerator, you can focus on building your technology while the platform handles roughly 80% of the integration and boilerplate code automatically.