nx_robot_firmware_gate.nx
buildroot/runtime/nx_robot_firmware_gate.nx
about
nx_robot_firmware_gate.nx -- R-ROBO-4 GATE: MCU firmware generation + fail-safe behaviour.
Generates NishiLang firmware for a control board, writes the real .nx artifact, and VERIFIES:
(1) the emitted firmware contains the never-brick STRUCTURE (clamp + watchdog + safe-state + loop);
(2) it embeds the board SPEC (setpoint/umax/pins) verbatim;
(3) host-sim NORMAL run converges to setpoint (the generated control law works);
(4) NEVER-BRICK clamp: command never exceeds UMAX;
(5) FAULT -> SAFE-STATE: with a sensor-loss fault injected, the generated firmware does NOT run
away (commands safe, position stays bounded);
(6) NEGATIVE CONTROL: a NAIVE firmware (no safe-state) with the SAME fault DOES run away --
proving the generated safe-state is doing real work.
100% sovereign, integer-only. license_tier: ORIGINAL expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_robot_firmware.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 15 | func sw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 16 | func sn(v: i64) -> i64 |
| 26 | func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: contains |
| 27 | func contains(hay: *u8, haylen: i64, needle: *u8) -> i64 |
| 40 | func check(name: *u8, cond: i64, tot: *i64) -> i64 |
| 46 | func abs_i(v: i64) -> i64 { if v < 0 { return 0 - v } return v } called by 1: main |
| 48 | func main() -> i64 |