code wiki / _hdl_build / nx_fpga_pc.nx
nx_fpga_pc.nx
buildroot/runtime/_hdl_build/nx_fpga_pc.nx
about
nx_fpga_pc.nx -- LIB: RUNG 13a -- the PROGRAM COUNTER as a LOADABLE fabric register (the control-flow atom).
A clocked W-bit register that, on each TICK, either INCREMENTS (PC+1, the default sequential flow) or LOADS a
branch/jump target (when `load`=1). PC.D = load ? loadval : PC+1. Built on nx_fpga_seq (DFF + seq_tick).
PIs (npi = W+1): load[0] | loadval[1..W]. POs: the W PC bits. NEVER-BRICK (#26): bounded state, deterministic.
license_tier: ORIGINAL
dependencies 4 imports · 10 importers
imports: nx_fpga_seq.nxnx_fpga_lut.nxnx_fpga_fabric.nxnx_syscalls.nx
imported by: nx_fpga_boot_gate.nxnx_fpga_cpu3_gate.nxnx_fpga_cpu5_gate.nxnx_fpga_cpu6_gate.nxnx_fpga_cpu7_gate.nxnx_fpga_cpu8_gate.nxnx_fpga_cpu9_gate.nxnx_fpga_cpu_dc_gate.nxnx_fpga_ecall_gate.nxnx_fpga_pc_gate.nx
structs
| none |
consts
| 10 | const K_MAGIC_65535: i64 = 65535 |
functions
| 12 | func seq_build_pc(width: i64, kind: *i64, init: *i64, src: *i64, po_src: *i64) -> i64 |
| 52 | func pc_ncells(width: i64) -> i64 { return 4*width + 1 } |
| 55 | func pc_read(width: i64, q: *i64) -> i64 |
| 61 | func pc_tick(width: i64, kind: *i64, init: *i64, src: *i64, pi: *i64, cellout: *i64, q: *i64, load: i64, loadval: i64) -> i64 |