Skip to main content

Module program

Module program 

Source
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§

LanesInfo
Consumer metadata carried in Module::extra (vihaco has no version field).

Enums§

BinaryError
Error from binary (de)serialization.

Constants§

MAGIC
5-byte magic identifying a native vihaco-backed Bloqade Lanes program. Distinct from the legacy BLQD container so the two can’t be confused.

Functions§

from_binary
Deserialize from the native binary format.
from_code
Build a Program from a version + flat instruction list. This is the ONE constructor used by both binary and text loading, so all Programs 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 Module specialised to our ISA. A single @main function’s worth of flat code plus the version in extra.