Expand description
full_asm — assemble a compiled LOGOS program (register bytecode CompiledProgram) into the
instruction words the FULL soft-core (soft_core.v) executes: the whole 113-op ISA — user functions
(hardware arg-copy Call), division/modulo (the sequential shared divider), and the structured heap
(lists, tuples, ranges, sets, maps, structs) — so the ENTIRE benchmark suite compiles from .lg source
to words that run on silicon byte-identically to the VM.
Unlike scalar_asm (the function-free combinational subset), this targets the full datapath and lays
out Main + every function body in one imem image. The op BYTE is always binisa::opcode(op) — the
append-only ISA ABI the hardware decoder keys on — and every operand field is packed exactly as
codegen_sva::rtl::run_soft_core decodes it (the ≡VM software model is the field-layout spec).
Locked ≡ VM by rtl.rs::tests::encode_full_matches_vm.
Functions§
- compile_
to_ full_ words - Compile a
.lgsource all the way to full soft-core imem words, through the chip compile path (compile_for_chip— plain Div/Mod, no magic reciprocals).Errif it doesn’t parse/compile or uses anything outside the chip’s integer subset. Targets the 32-bit datapath (the tape-out core); for a 64-bit datapath (VM parity on 64-bit-range arithmetic) usecompile_to_full_words_w. - compile_
to_ full_ words_ w - The WIDTH-PARAMETRIC form of
compile_to_full_words: compile.lgsource to full soft-core imem words for a datapath ofwidthbits (32= the tape-out core, byte-identical to the historical output;64= full-i64 VM parity — a constant that exceeds i32, like the benchmark PRNGs’% 2147483648/% 4294967296moduli, is emitted as a 3-wordLoadConstWide64instead of being truncated). Pair withcrate::codegen_sva::soft_core_model::run_soft_core_wat the SAME width. - encode_
soft_ core_ full - Assemble a whole compiled program (from
crate::vm::Compiler::compile_for_chip) into full soft-core imem words. TWO-PASS: pass 1 lays out Main then every function body, computing each code index’s imem word offset (aCalland a wideLoadConstoccupy two words); pass 2 emits the words, resolving every Jump/branch/iter target and callee entry through that pc→imem map.Errif the program uses an op with no chip lowering (floats, Text, closures, CRDTs, channels, …) or overflows an operand field. - encode_
soft_ core_ full_ w - The width-parametric form of
encode_soft_core_full.widthis retained as an API/experimental knob describing the runtime datapath’s fast-path size, but it NO LONGER changes the emitted image: every over-i32 constant is a 3-wordLoadConstWide64(op 222) carrying the fulli64at every width, and the value plane auto-promotes to BigInt on overflow exactly like the VM’s unboundedInt. So the full core reproduces the VM EXACTLY — every constant and every arithmetic result, into the BigInt tail — and does so identically at width 32 and 64 (BigInt handles exactness; the width is a perf/area knob, not a correctness switch). Runs oncrate::codegen_sva::soft_core_model::run_soft_core_wat the matching width. (The distinct 32-bit tape-out core inscalar_asm.rsgenuinely wraps at 2³² — that is the small-area chip.) - to_hex
- Render imem words as a
.hexfile body (one 8-hex-digit word per line).