A fully verified, FPGA-synthesizable RISC-V SoC with an integrated neural processing unit (NPU), multi-core CPU subsystem, L2 cache coherence, and AXI4 bus fabric. Targets the Nexys Video board (xc7a200tfbg484-1) and is designed as a stepping stone toward a production ASIC.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β GRX930 SoC β
β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β CPU 0 β β CPU 1 β β CPU 2 β β CPU 3 β β
β β RV64IMAC β β RV64IMAC β β RV64IMAC β β RV64IMAC β β
β β I/D Cacheβ β I/D Cacheβ β I/D Cacheβ β I/D Cacheβ β
β ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ β
β β β β β β
β ββββββΌβββββββββββββββΌβββββββββββββββΌβββββββββββββββΌβββββ β
β β AXI4 Crossbar (4-master) β β
β ββββ¬ββββββββββββββ¬βββββββββββββββ¬ββββββββββββββββ¬βββββββ β
β β β β β β
β ββββΌββββ βββββββΌββββββ ββββββΌβββββ ββββββββΌβββββββ β
β β L2 β β NPU 0 β β NPU 1 β β Peripheralsβ β
β βCache β β 8Γ8 GEMM β β 8Γ8 GEMMβ β UART β β
β β4-way β β INT8/FP16 β β INT8/FP16β β APLIC β β
β ββββ¬ββββ βββββββββββββ βββββββββββ β Boot ROM β β
β β β DMA Arb β β
β ββββΌβββββββββββββββββββββββββββββββββββββββΌβββββββββββ β β
β β DDR Stub / DDR3L Controller β β β
β β 64 KB BRAM (FPGA) / Real DRAM β β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Feature | Details |
|---|---|
| CPU | 4Γ RV64IMAC, 5-stage in-order pipeline, AMO/LR/SC, I/D caches (256-bit lines) |
| NPU | 2Γ 8Γ8 systolic array, INT8/INT16/FP16/BF16 GEMM, pipelined normalize |
| L2 Cache | 4-way set-associative, 32β512 configurable sets, write-back, coherence invalidation |
| Bus Fabric | 4-master AXI4 crossbar, 64-bit data bus, 4-bit ID |
| DMA Arbiter | 4-master store-and-forward B-skid, combinational-loop-free |
| Peripherals | UART (115200 8N1), APLIC interrupt controller, 1 KB boot ROM |
| Memory | 64 KB BRAM stub (FPGA) or DDR3L MIG (real hardware) |
| Target FPGA | xc7a200tfbg484-1 (Nexys Video), 100 MHz sys_clk β 50 MHz core clock |
| Fmax | ~121 MHz post-implementation (WNS +7.883 ns) |
| Utilization | 125,735 LUTs (93.97%), 67,007 FFs (25.04%), 55 BRAM, 227 DSP |
grx930/
βββ c930/
β βββ rtl/ # SoC RTL (29 SystemVerilog modules)
β β βββ c930_soc_top.sv # Top-level SoC
β β βββ c930_npu_top.sv # NPU wrapper (2 instances)
β β βββ c930_npu_core.sv # NPU datapath + control FSM
β β βββ c930_systolic_array.sv
β β βββ c930_tensor_pe.sv # Processing element (FP32 normalize pipelined)
β β βββ c930_fp16_acc.sv # FP16/BF16 accumulator (CLA-based)
β β βββ c930_fp_mul.sv # FP16 multiplier
β β βββ c930_npu_act.sv # Activation unit (sigmoid/tanh via LUT)
β β βββ c930_npu_dma.sv # NPU AXI4 DMA master
β β βββ c930_npu_csr.sv # NPU AXI4-Lite CSR slave
β β βββ c930_axi_crossbar.sv # 4-master AXI4 interconnect
β β βββ c930_axi_dma_arb.sv # DMA arbiter (B-skid for timing closure)
β β βββ c930_axi_cache_adapter.sv
β β βββ c930_l2.sv # L2 cache (4-way, configurable sets)
β β βββ c930_uart.sv # UART 115200 8N1
β β βββ c930_aplic.sv # APLIC interrupt controller
β β βββ c930_bootrom.sv # Boot ROM (firmware hex preload)
β β βββ c930_mmio_bridge.sv # CPU MMIO β AXI4-Lite
β β βββ c930_mmio_arb.sv # MMIO arbiter
β β βββ c930_ddr.sv # BRAM DDR stub (64 KB)
β β βββ c930_ddr3l.sv # DDR3L MIG wrapper
β βββ rv64imac/RTL/ # RISC-V CPU (38 modules)
β β βββ riscv_core_top.sv # CPU top (5-stage RV64IMAC)
β β βββ riscv_core_hazard_unit.sv # Forwarding + hazard detection (re-timed)
β β βββ riscv_core_csr_unit.sv # CSR registers (mstatus, mtvec, etc.)
β β βββ riscv_core_icache_*.sv # I-cache (controller + memory)
β β βββ riscv_core_dcache_*.sv # D-cache (controller + memory)
β β βββ ...
β βββ tb/ # Testbenches (52 files)
β β βββ tb_c930_soc.sv # Full SoC with firmware
β β βββ tb_c930_soc_full.sv # Full SoC with DDR
β β βββ tb_arb_bskid_equiv.sv # Arbiter equivalence (1200+ txns)
β β βββ tb_hazard_equiv.sv # Hazard unit equivalence (300K cycles)
β β βββ ...
β βββ sw/ # Firmware source + hex files
β β βββ c930_npu_driver.c # NPU register-level driver
β β βββ boot.hex # Boot ROM initialization
β β βββ ...
β βββ sim/ # Verilator models
β βββ doc/ # Design notes & architecture docs
β βββ synth_xilinx/ # Vivado synthesis flow
β β βββ create_project.tcl # Project creation (xc7a200t)
β β βββ run_synth.tcl # Synth + impl + timing reports
β β βββ xc7a200t_nexys_video.xdc # Nexys Video pin constraints
β β βββ heal_mac.sh # License MAC fix for WSL
β β βββ export_schematics.tcl # Gate-level netlist export
β β βββ quick_export.tcl # Per-subsystem batch export
β β βββ export_schematic_pdfs.tcl # GUI schematic helper
β βββ build/ # Build artifacts (gitignored)
β βββ Makefile # Simulation targets
βββ rv64imac/ # CPU core (submodule/directory)
βββ README.md
- Icarus Verilog (
iverilog+vvp) β for simulation - Vivado 2026.1 β for FPGA synthesis (Nexys Video)
- RISC-V toolchain (
riscv64-unknown-elf-gcc) β for firmware builds - Python 3 β for utility scripts
cd c930
# Run the full SoC test suite (11 firmware tests, ~5-10 min)
make soc
# Run NPU integer GEMM tests (all matrix sizes)
make npu
# Run NPU FP16/BF16 GEMM tests
make npu_float
# Run arbiter equivalence gate (1200+ strict + random transactions)
make arb_equiv
# Run hazard unit equivalence gate (300K cycles)
make hazard_equiv| Target | Description | Duration |
|---|---|---|
make npu |
NPU integer GEMM (all matrix sizes) | ~1 min |
make npu_float |
NPU FP16/BF16 GEMM | ~2 min |
make npu_feed |
NPU feed/measurement pipeline | ~2 min |
make hazard |
CPU hazard unit (CSR flush, stalls) | ~30 sec |
make hazard_equiv |
Hazard unit equivalence (300K cycles) | ~5 min |
make arb_equiv |
DMA arbiter B-skid equivalence (1200+ txns) | ~3 min |
make soc |
Full SoC with firmware (11 tests) | ~10 min |
make soc_full |
Full SoC with DDR, all peripherals | ~15 min |
make quad |
Quad-core coherency | ~10 min |
make l2_coherent |
L2 cache coherence | ~10 min |
cd c930
# Launch full Vivado flow (synth + impl + timing reports)
make vivado_synth
# Or via the retry driver (auto-heals MAC, relaunches on failure)
powershell -File build/run_schematic_export.cmdThe flow targets xc7a200tfbg484-1 (Nexys Video) with:
- 100 MHz board clock β 50 MHz core clock (CLK_DIV=2)
- UART TX/RX on FTDI pins
- 8 status LEDs (NPU0 busy/done/error/irq + NPU1 busy/done/error/irq)
- Quad-SPI bitstream generation (6.1 MB .bit + 6.1 MB .bin)
- JTAG (volatile): Open Vivado β Hardware Manager β Program Device β
c930_soc_top.bit - Quad-SPI flash (persistent): Add Configuration Memory Device β Program
c930_soc_top.bin
The RISC-V core is a 5-stage in-order pipeline with:
- Integer multiplication/division β Booth multiplier, non-restoring divider
- I-Cache β 4 KB direct-mapped, 256-bit cache lines, AXI4 burst read
- D-Cache β 4 KB direct-mapped, write-back with byte strobes
- AMO/LR/SC β Full atomic memory operation support
- Hazard unit β 3-stage forwarding, stall-on-use for loads, CSR flush on exceptions
- MMIO port β AXI4-Lite bridge for uncached peripheral access
parameter int ICACHE_INDEX_WIDTH = 7 // 128-entry I-cache
parameter int DCACHE_INDEX_WIDTH = 7 // 128-entry D-cache
parameter logic [63:0] CORE_RESET_PC = 64'h0 // Boot vectorThe NPU is a parameterized systolic array GEMM engine:
- Systolic array: 8Γ8 PEs (configurable via
NUM_ROWS/NUM_COLS) - Data types: INT8, INT16, FP16, BF16 (selectable per GEMM)
- Accumulator: 48-bit fixed-point or FP16 with CLA-based adder
- Normalize stage: Pipelined FP32 β FP16 conversion (1 extra cycle latency)
- Activation unit: Sigmoid/tanh via piecewise-linear LUT
- DMA: AXI4 full master, burst reads/writes for A/B/C matrices
- CSR interface: AXI4-Lite slave, command queue (depth 4), cross-GEMM prefetch
- Dual instance: NPU0 + NPU1 (ENABLE_NPU1 generic)
parameter int NUM_ROWS = 8 // Systolic rows (reduction elements)
parameter int NUM_COLS = 8 // Systolic cols (output elements)
parameter int DIN_W = 8 // Activation/weight width
parameter int ACC_W = 48 // Accumulator width
parameter int MAX_M = 64 // Max output rows
parameter int MAX_K = 256 // Max reduction length
parameter int MAX_N = 8 // Max output cols4-way set-associative write-back cache with:
- Configurable sets: 32β512 (32 sets for FPGA fit, 512 for simulation)
- Coherence: Invalidation-based protocol with 8 L1 invalidation ports
- Write log: Depth-8 FIFO for write-back scheduling
- AXI4 slave ports: Separate read/write channels for concurrent CPU + NPU access
The design achieved full timing closure on xc7a200tfbg484-1 through a systematic retiming campaign:
| Milestone | WNS (ns) | Fmax (MHz) | Technique |
|---|---|---|---|
| Initial | β20.7 | 0 | β |
| BUFG clock distribution | β4.0 | 0 | BUFG on core clock |
| Accumulator retiming | β1.5 | 45 | Pipeline FP16 normalize stage |
| Hazard unit retime | β0.76 | 48 | Shadow forwarding + registered selects |
| B-skid (wr_owner fanout) | +7.9 | 121 | Store-and-forward B response |
| Final | +7.883 | ~121 | All paths MET |
Post-implementation: 0 failing endpoints, WHS +0.585 ns, DRC clean.
| Testbench | What it tests |
|---|---|
tb_c930_soc.sv |
Full SoC with firmware boot (11 tests: NPU GEMM, cache coherency, MMIO) |
tb_c930_soc_full.sv |
Full SoC with DDR controller |
tb_arb_bskid_equiv.sv |
Dual-DUT arbiter equivalence (strict + random modes, 1200+ txns) |
tb_hazard_equiv.sv |
Retimed hazard unit vs golden reference (300K cycles) |
tb_npu_core_fp16.sv |
NPU FP16 GEMM precision |
tb_l2_coherent.sv |
L2 cache coherence protocol |
tb_quad_isolated.sv |
Quad-core isolation |
tb_ptm_c_lockstep.sv |
PTM-C error model lockstep |
The firmware-driven make soc runs 11 tests exercising:
- CPU boot from bootrom
- DDR stub initialization
- UART output
- NPU0 integer GEMM (single shape)
- NPU0 FP16 GEMM
- NPU0 multi-shape sweep
- NPU1 integer GEMM (if ENABLE_NPU1=1)
- NPU0 + NPU1 dual-operation
- Cache coherency (known failure β 28 expected FAILs)
- MMIO stress (known failure β 28 expected FAILs)
- DDR stress with mixed traffic (known failure β 54 expected FAILs)
Tests 9β11 have expected failures that match the baseline exactly, confirming no regression.
Detailed design documentation lives in c930/doc/:
- Architecture:
c930_full_soc_architecture.md,c930_architecture.md - Multi-core:
multicore_architecture_plan.md,c930_core_scaling.md - NPU:
npu_optimization_design_note.md,npu_act_stage_design_note.md - Error model:
pta_error_model_design_note.md(PTM-C drift/crosstalk) - Integration:
phase7_integration_guide.md,phase7_roadmap.md - Tapeout:
grx930_tapeout_readiness.md
cd c930
# Generate interactive HTML hierarchy diagram
python build/gen_schematics.py rtl build/schematics
# Generate SVG block diagram
python build/gen_svg_diagram.pyOpen build/schematics/c930_hierarchy_schematic.html in any browser for an interactive, color-coded hierarchy tree with timing stats and resource bars.
For gate-level PDFs (individual LUTs, FFs, BRAMs):
- Open Vivado GUI with
build/vivado/c930_artix7.xpr - Window β Schematic
- Navigate to any subsystem β File β Export β Schematic β PDF
FPGA (current): Fully synthesized and routed on xc7a200tfbg484-1. BRAM-based DDR stub provides 64 KB for firmware boot. Ready for hardware validation.
ASIC (future): The design targets Xilinx primitives (LUTRAM, BRAM, DSP48). An ASIC flow would require:
- Standard cell library (SkyWater SKY130, TSMC N28, etc.)
- Technology mapping of Xilinx primitives to SRAM macros
- DFT (scan chains, JTAG, BIST)
- Clock tree synthesis and physical design
- Tapeout ($10Kβ$30K MPW shuttle, $100K+ full mask set)
mainβ Production branch, FPGA-synthesized, timing-closed- Feature branches β
npu/*,l2-bram, etc. - Auto-retry driver β
synth_xilinx/run_full_wsl_retry.sh(heals MAC, relaunches Vivado on failure)
Apache License 2.0 β see LICENSE. Copyright 2026 Gridworkz.
Vendored third-party trees keep their own terms: the wafer.space pre-check tool and project
template under c930/asic_gf180mcu/tools/, the OpenROAD/openLane-derived scripts under
c930/asic_gf180mcu/openlane2_rtl/, and the GF180MCU PDK, which the flow configs reference at run
time rather than ship.