Data Schemas — Python model
The Python model is the single source of truth for every Waveflow data structure: its fields and bitwidths, its in-memory (NumPy-backed) values, and the packing rule that the generated C++ mirrors bit-for-bit. These pages cover building schemas in Python — the scalar fields, the composite lists and arrays, the tagged unions, and the fixed-point and complex element types used by signal-processing kernels.
For the synthesizable side — the C++ a schema generates and how a single value moves over each interface — see HLS.
Table of contents
- Fields - The scalar schema fields — IntField, FloatField, EnumField, BooleanField — their bitwidths, signedness, and Python values.
- Data Lists - DataList — an ordered, named composite of schema fields (the C++ struct counterpart), with nesting and per-field access; what a field read returns (a NumPy scalar, an enum, an ndarray) and where to convert it with int().
- Data arrays - DataArray — fixed- or dynamic-shape array; VarDataArray — variable-length array with in-band length field.
- Data Unions - DataUnion — a tagged union: a schema-id header selecting one of several registered payload schemas, with a fixed wire footprint.
- Tagged unions on a stream - Several kinds of message on one stream -- START, one DET per result, END -- as one DataList per type, each beginning with the same EnumField tag. The way to carry a variable number of results (the count is not known until the end, so the end is in band); the writer serializes each message with its schema, the reader reads the tag and then the rest by that type's schema. Runnable. Each message keeps its own length, unlike a fixed-size DataUnion.
- Fixed-point (FixedField) - FixedField — ap_fixed-compatible fixed-point: total width, integer bits, signedness, and the rounding/overflow modes.
- Complex (ComplexField) - ComplexField — a complex element over a scalar inner field (re/im), the interleaved layout and complex arithmetic helpers.