Expand description
Flat program container for the vihaco-backed ISA.
A program is a Version plus a flat Vec<Instruction> — no
functions, labels, or string interner (our programs are a single flat
instruction list; see https://github.com/QuEraComputing/bloqade-lanes/issues/769).
vihaco’s [vihaco::module::Module] / [vihaco::ProgramLoader] carry that
structured-language machinery, so we keep a thin container and delegate the
per-instruction work to vihaco’s derived codec ([WriteBytes]/[FromBytes])
and text parser ([vihaco_parser_core::Parse]).
§Binary layout (native, breaking vs. legacy BLQD)
magic : 5 bytes = b"LANES"
version : u32 LE = (major << 16) | minor
code : N * INSTRUCTION_WIDTH bytes (vihaco fixed-width words)There is no section container: instruction words are fixed-width and self-delimiting, so the code section is simply the remaining bytes.
Structs§
- Lanes
Info - Consumer metadata carried in
Module::extra(vihaco has no version field).
Enums§
- Binary
Error - Error from binary (de)serialization.
Constants§
- MAGIC
- 5-byte magic identifying a native vihaco-backed Bloqade Lanes program.
Distinct from the legacy
BLQDcontainer so the two can’t be confused.
Functions§
- from_
binary - Deserialize from the native binary format.
- from_
code - Build a
Programfrom a version + flat instruction list. This is the ONE constructor used by both binary and text loading, so allPrograms built from the same (version, code) compare equal regardless of source. - to_
binary - Serialize to the native binary format (see module docs).
Type Aliases§
- Program
- A Bloqade Lanes program: a vihaco
Modulespecialised to our ISA. A single@mainfunction’s worth of flat code plus the version inextra.