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:

CSV Directory Structure

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

LRU Inheritance

An LRU can inherit another LRU's blocks, so a block only has to be defined once even when several LRUs need it. Declare the dependency in an lrus.json file placed in the ICD project folder, alongside the LRU subfolders (not inside any of them):

project_name/
├── lrus.json
├── LRUBase/
│   └── ConfigAllMessage.csv
└── LRUDerived/
    └── ConfigAccelRangeMessage.csv
  
{
  "LRUs": [
    { "name": "LRUDerived", "dependency": "LRUBase" }
  ]
}

Here LRUDerived ends up with both ConfigAllMessage (inherited from LRUBase) and its own ConfigAccelRangeMessage — without LRUBase's CSV ever being copied or re-authored under LRUDerived.

Memory Layout

DBSimGenerator generates the derived LRU's struct as a genuine C++ struct inheriting from the base LRU's struct:

#pragma pack(push,1)
struct lru_LRUBase {
    blk_ConfigAllMessage ConfigAllMessage;
};

struct lru_LRUDerived : public lru_LRUBase {
    blk_ConfigAccelRangeMessage ConfigAccelRangeMessage;   // only the new block is declared here
};
#pragma pack(pop)

Because both structs are tightly packed (#pragma pack(push,1)), lru_LRUDerived's memory is contiguous: the inherited base blocks come first, immediately followed by the derived LRU's own blocks — with no gap and no duplication of layout logic. Elements are addressed exactly as if they'd been defined directly on the derived LRU (e.g. LRUDerived.ConfigAllMessage.Sync1), even though ConfigAllMessage is only defined once, in LRUBase's CSV.

This is compile-time ICD reuse, not shared runtime memory: LRUDerived gets its own independent copy of the inherited blocks in its own shared-memory region. LRUBase is still registered and usable on its own, completely separate from the copy inherited into LRUDerived — writing to one does not affect the other.

ICD Addons

While LRU Inheritance reuses a block within a project, an addon pulls a whole external, self-contained ICD package — with its own LRU folders, blocks, and enums — into your project, without copying any of its files. List the addon folders in an lrus-addon.json file, placed beside lrus.json in the ICD project folder:

project_name/
├── lrus.json
├── lrus-addon.json
└── LRU_name/
    └── Block_name.csv
  
[
    "c:/dev/simD/CoreEng/CoreEngICDAddons/FlightModel_Advance/"
]

Each entry is the root folder of an addon — a self-contained ICD folder laid out just like a normal project (its own LRU subfolders with block CSVs and enums). DBSimGenerator loads every LRU it finds in each listed addon folder, lets you view them alongside your project's own LRUs in the generator, and generates their code into the same coredb/ output folder — so an addon's LRUs become part of your project exactly like locally-defined ones.

Use an addon to share a whole reusable ICD package (e.g. a common flight-model interface) across multiple projects from one maintained source, instead of copying its CSVs into every project that needs it.

Key Features

Workflow

  1. Prepare ICD CSV files and Enums for your blocks.
  2. Organize CSVs in the project → LRU → block structure.
  3. DBSimGenerator reads the CSVs and generates high-performance code.
  4. 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
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–––

3. Enums

NameValue
Mode_Manual0
Mode_Auto1
Error_None0x00
Error_Sensor0x01