code wiki / _hdl_build / rv64im_min_kernel_boot_smoke.nx

rv64im_min_kernel_boot_smoke.nx

buildroot/runtime/_hdl_build/rv64im_min_kernel_boot_smoke.nx

5191 B120 linesdepth 6pulls 17 transitivereach 0 importersview sourcekind smoketopic rv64im
docsdependenciesstructsconstsfunctions

about

rv64im_min_kernel_boot_smoke.nx -- boot the nishi-os kernel ELF in sim. End-to-end test that closes the loop from "shipped NishiHDL modules" -> "sim runs hand-coded RV64IM" -> "ELF loader works" -> "ACTUAL KERNEL BOOTS in our pure-NishiLang substrate, no qemu, no external interpreter" What this proves: The 11 NishiHDL files under nishi-silicon/hdl/ collectively implement enough of RV64IM-min that the shipped nishi-os kernel ELF executes correctly: at minimum, the kernel's selftest path prints the first [m0-mcs-live] UART marker to our captured tx_buf within the step budget. What this DOES NOT prove (still needed for Tier A FPGA bring-up): - nishi-synth gate-netlist emit (HDL graph -> Verilog/gates) - Yosys + nextpnr place-and-route (gates -> ECP5 bitstream) - FPGA board execution (bitstream -> ULX3S -> physical UART) Status: SEED. 2026-05-26. Initial harness. Step budget is generous (10M) since the kernel runs many cycles before reaching the first observable marker.

dependencies 10 imports · 0 importers

nx_syscalls.nx nishi_hdl_primitives.nx rv64im_min_decoder.nx rv64im_min_alu.nx rv64im_min_regfile.nx rv64im_min_csr.nx rv64im_min_clint.nx rv64im_min_uart.nx rv64im_min_sim.nx rv64im_min_elf_loader.nx rv64im_min_kernel_boot_smoke.n

imports: nx_syscalls.nxnishi_hdl_primitives.nxrv64im_min_decoder.nxrv64im_min_alu.nxrv64im_min_regfile.nxrv64im_min_csr.nxrv64im_min_clint.nxrv64im_min_uart.nxrv64im_min_sim.nxrv64im_min_elf_loader.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_rv64im_rf_init nx_rv64im_csr_init nx_clint_init nx_uart_init nx_rv64im_sim_init nx_elf_load nx_elf_validate_ident nx_elf_read_u16 nx_elf_read_u64 nx_elf_read_u16 ↻ nx_elf_read_u32 nx_elf_copy_segment nx_rv64im_sim_run nx_rv64im_sim_step nx_clint_tick nx_clint_update_mtip nx_rv64im_csr_tick_mcycle nx_clint_mtip_get nx_rv64im_csr_read nx_csr_addr_to_slot nx_rv64im_sim_take_trap nx_rv64im_csr_read ↻ nx_rv64im_csr_write nx_csr_addr_to_slot ↻ nx_csr_is_read_only nx_rv64im_xlate nx_rv64im_csr_read ↻ nx_rv64im_is_device sys_mmap ↻ nx_sv39_walk nx_mmu_inrange nx_mmu_rd64

structs

none

consts

35const BOOT_MEM_BASE: i64 = 0x80000000
36const BOOT_MEM_SIZE: i64 = 0x40000 // 256 KiB (kernel + stack + frames)
37const BOOT_TX_CAP: i64 = 4096 // capture up to 4 KiB of UART output
38const BOOT_MAX_STEPS: i64 = 10000000 // 10M cycle budget
40const BOOT_KERNEL_PATH: *u8 = "/mnt/c/Users/elder/nishi-os/kernel/nishi-kernel.elf"

functions

44func boot_contains(hay: *u8, hay_len: i64, needle: *u8, needle_len: i64) -> i64
called by 1: main
61func main() -> i64