Skip to main content

Module engine_build

Module engine_build 

Source
Expand description

LOGOS source → what the whole-program fabric engine loads: the program lowered to an engine config, proven to answer what the VM answers on the exact arguments about to be streamed before a byte is emitted, checked against the deployed engine’s profile and the flashed image’s caps. One path for every caller — the emit_wpe_soc example the board hosts compile through, and the Fabric Terminal’s library — so a program is lowered the same way wherever it runs.

Structs§

FabricMap
What each part of the fabric does for one compiled program, read off the config the engine runs: the labels the Fabric Terminal draws beside its activity panel, whose BLOCKS tiles are the config’s blocks and whose CELLS strip is its cells in the engine’s flat order.
MapBlock
One block of the config: a BLOCKS tile.

Enums§

Lifter
A way to lift a program to an engine config. A lifter panics on a program it cannot take; lower tries the function lifters in order, so a caller that runs one lifter at a time (a process or an instance per attempt) takes the same path.
MapNext
A block’s terminator, as the map gives it.
Profile
The deployed engine a program must fit. A .wire carries no record of the profile it was built for, and an over-cap image loads fine and returns a plausible wrong number, so this check is the guard.

Functions§

fabric_map
The map of cfg, with names for the registers of the blocks Lifter::Main’s ## Main region runs — the blocks reached from block 0 without entering a call.
fits_caps
Check the program against the caps of the image that is actually on the board (NAME=N,…, the recipe the build records beside every bitstream). The static dimensions are read off the config; DEPTH and HEAP are data-dependent, so they are MEASURED by running the program on the model with the exact params about to be streamed. An over-cap program loads fine and returns a plausible wrong number — this is the guard.
lower
Lower func to an engine config the same way the benchmark lane does: the single-function CFG lifter when it agrees with the VM on these params, else the multi-function (call-stack) lifter. Either way the config is PROVEN ≡ VM on the exact params about to be streamed before a byte is emitted.
lower_main
Lower a whole ## Main program and PROVE the engine model prints exactly what the VM prints before a byte is emitted: the output tape rendered line by line == vm_outcome(src).output.
main_register_names
The Main frame’s variable names by register — the registers a Lifter::Main config’s own blocks read and write. A function’s blocks have registers of their own frame, which these names do not describe.
vm_golden
The VM’s answer for func(params) — a synthesized ## Main showing the call, run on the reference VM (the same vm_outcome every execution tier is locked against). This is the golden the chip must reproduce.
vm_output_lines
The VM’s OUTPUT for a whole program — one line per Show — the golden a Main program’s streamed records are checked against.