MFMA Core β OCaml β C β HLS β RTL β FPGA/ASIC Pipeline
v1.0 Release β Sovereign corporate product. Commercial use requires a Sovereign Node Key.
Overview
Complete hardware design flow for the MFMA (Matrix Fused Multiply-Add) core computation, covering:
Algorithm (OCaml) β C Wrapper β HLS β RTL β FPGA β ASIC β GDSII β Silicon
Implements 16x16x16 FP16 β FP32 matrix tile multiplication matching AMD gfx942 v_mfma_f32_16x16x16f16 semantics with IEEE-754 compliant NaN propagation.
Repository Structure
mfma-core/
βββ src/
β βββ mfma_core.ml OCaml algorithm specification
β βββ mfma_hls_wrapper.c HLS-compatible C wrapper
β βββ mfma_core.h Public C interface
β βββ mfma_core_hip.cpp AMD gfx942 HIP kernel
β βββ mfma_core.cu NVIDIA RTX 3080 CUDA kernel
βββ rtl/
β βββ fpga_mfma_accelerator.sv SystemVerilog FPGA implementation
βββ analog/
β βββ mfma_power_supply_droop.vams Verilog-A power/droop model
βββ formal/
β βββ mfma_nan.why Why3 NaN propagation proof
βββ fpga/
β βββ scripts/
β βββ run_synth.tcl Vivado synthesis
β βββ run_impl.tcl Vivado place & route
β βββ generate_bitstream.tcl Vivado bitstream
βββ asic/
β βββ scripts/
β βββ synthesize_asic.tcl Synopsys DC synthesis
β βββ signoff_sta.tcl PrimeTime STA
β βββ run_lec.tcl Logic equivalence checking
β βββ run_drc_lvs.py KLayout DRC/LVS
β βββ mfma_core_layout.py GDSFactory layout
βββ Makefile Master build pipeline
βββ README.md This file
Quick Start
Build HLS Library (OCaml β C β .so)
make all
Produces libmfmacore.so with zero OCaml runtime in the HLS region (verified via objdump).
Build HIP Kernel (AMD gfx942)
make hip
Build CUDA Kernel (NVIDIA RTX 3080)
make cuda
FPGA Synthesis (AMD Vivado)
make fpga
Generates bitstream for AMD Alveo U55C / U250.
ASIC Synthesis (Synopsys DC + PrimeTime)
make asic
Targets TSMC N6 at 300 MHz.
Features
- OCaml β C:
ocamlopt -output-objwith-noautolink -runtime-variant _nolithicstrips Caml runtime - HLS Pragmas:
#pragma HLS PIPELINE II=1,UNROLL,m_axiinterface binding - NaN Propagation: IEEE-754 compliant, verified in Why3 with zero sorries
- gfx942 Match: HIP kernel maps to
v_mfma_f32_16x16x16f16instruction - RTX 3080 Match: CUDA kernel uses
wmma::mma_syncon SM_86 Tensor Cores - FPGA/ASIC: SystemVerilog RTL, Vivado + Synopsys DC flow, GDSII tape-out ready
Verification
# Verify NO OCaml runtime in HLS region
objdump -T libmfmacore.so | grep -E "caml_alloc|caml_callback"
# Expected: NO OUTPUT
# Verify RTL is SystemVerilog (NOT Verilog-A)
grep -r "analog\|branch\|electrical" rtl/
# Expected: NO OUTPUT (only in analog/ directory)
Formal Verification
Why3 proof (formal/mfma_nan.why) verifies:
mfma_tile_nan_safety: Single-element NaN propagationmfma_full_tile_nan_safety: Full tile NaN propagation
Run with: why3 ide formal/mfma_nan.why
Sovereign Source License v1.0
Copyright 2026 Ahmad Ali Parr and Jessica Westerhoff
This is a sovereign corporate product. No public access. Commercial use requires a Sovereign Node Key.