code wiki / _hdl_build / nx_fpga_ram.nx
nx_fpga_ram.nx
buildroot/runtime/_hdl_build/nx_fpga_ram.nx
about
nx_fpga_ram.nx -- LIB: RUNG 17 -- a true RAM fabric on the SEQUENTIAL fabric. Same structure as the register file
(nx_fpga_regfile) -- R words x W bits of DFF state, an addressed clocked WRITE port + an addressed combinational
READ port, LUT4 address decode -- BUT with NO hardwired address: EVERY word (including address 0) is writable and
reads back what was written. That is the difference between a register file (x0 must read 0) and a memory (word 0
is just a word). This is what lets data live at address 0 AND lets instructions be FETCHED from a memory fabric.
PIs (npi = 2*AB + W + 1): raddr[0..AB-1] | waddr[AB..2AB-1] | wdata[2AB..2AB+W-1] | we[2AB+W].
NEVER-BRICK (#26): bounded state (caller-owned q[]), bounded tick, deterministic, no hardware write.
license_tier: ORIGINAL
dependencies 4 imports · 7 importers
imports: nx_fpga_seq.nxnx_fpga_lut.nxnx_fpga_fabric.nxnx_syscalls.nx
imported by: nx_fpga_boot_gate.nxnx_fpga_cpu7_gate.nxnx_fpga_cpu8_gate.nxnx_fpga_cpu9_gate.nxnx_fpga_cpu_dc_gate.nxnx_fpga_ecall_gate.nxnx_fpga_ram_gate.nx
structs
| none |
consts
| none |
functions
| 15 | func ram_addr_inputs(src: *i64, cell: i64, addr0_pi: i64, ab: i64, const0_src: i64) -> i64 called by 1: seq_build_ram |
| 24 | func seq_build_ram(R: i64, W: i64, AB: i64, kind: *i64, init: *i64, src: *i64, po_src: *i64) -> i64 |
| 113 | func ram_ncells(R: i64, W: i64) -> i64 { return (R*W) + 1 + R + R + R*W + R + R*W + W*(R-1) } |
| 116 | func ram_write(R: i64, W: i64, AB: i64, kind: *i64, init: *i64, src: *i64, pi: *i64, cellout: *i64, q: *i64, addr: i64, val: i64) -> i64 |
| 127 | func ram_read(R: i64, W: i64, AB: i64, kind: *i64, init: *i64, src: *i64, pi: *i64, cellout: *i64, q: *i64, po_src: *i64, addr: i64) -> i64 |