Expand description
The HFT decision as a workload: its one LOGOS source, lowered to a combinational select-DAG by
emit_decision_fabric (the decision fabric), and run as ordinary bytecode on the routable scalar
core by the program here — the CPU twin of decision_hft_realbist. Both blocks decide over the same
realistic input ranges, so their gate-level switching power per decision is one comparison.
Constants§
- DECIDE_
FN - The HFT decision: microprice market-making, a fat-finger clamp and a position risk gate, returning the signed order (+buy / -sell / 0). No division — the microprice arrives normalized — so the body is compare / arithmetic / branch only.
- DECIDE_
NAME - The function name
DECIDE_FNdefines. - LCG_A
- The CPU twin’s stimulus: a 15-bit linear congruential generator, s’ = (s * A + C) mod 2^15. A ≡ 1 (mod 4) with C odd gives the full period of 32768 (Hull–Dobell), and every product stays below 2^31, so the 32-bit core and the 64-bit VM compute it identically.
- LCG_C
- LCG_
MASK - SOFT_
CORE_ REALBIST_ ITERATIONS - Decisions the boot ROM makes before it halts — far more than any measured window spans.
Functions§
- inline_
body - The body of the single-
Returnfunctionfuncspliced in atindentspaces, and the expression its finalReturn e.yields. Each parameter is bound to its argument: an integer literal is substituted at every whole-word use (a constant needs no register of its own), an argument that is the parameter’s own name needs no binding, and anything else is bound byLet. Refused: an argument count that is not the arity, and anyReturnother than the body’s last line — its early exit has no inline equivalent. - inline_
call inline_body, with the returned value assigned to the already-declaredresult.- soft_
core_ realbist_ program - The boot ROM the block ships: the program at
SOFT_CORE_REALBIST_ITERATIONS, encoded for the scalar core. - soft_
core_ realbist_ source - The CPU twin’s program: each iteration advances the LCG three times, mapping each output onto the
realbist’s input ranges as it is drawn, runs the decision inline, and shows
signed_order * 4 + order_side— the whole decision, side included, so the output stream classifies every decision as buy, sell, risk-blocked or no-trade. - soft_
core_ realbist_ verilog - The block’s top: the scalar core itself, whose
$readmemh("program.hex")boot ROM holdssoft_core_realbist_program. Onlyclkandrstenter; the decision stream leaves onout.