feat(ntt): implement synchronous NTT core with Barrett modular reduction
Phase 2.1: Merged Path00+Path01 NTT engine. - barrett_mul.v: Barrett modular multiplication (a·b mod 3329) - butterfly_unit.v: Cooley-Tukey/Gentleman-Sande butterfly - zeta_rom.v: 128-entry ROM with bit-reversed roots of unity - ntt_core.v: 7-layer NTT FSM, 256×12-bit register file - ntt_sync.v: valid/ready streaming wrapper Verified: 13/13 vectors bit-exact vs Python NTT/NTTInverse
This commit is contained in:
36
test_framework/modules/ntt/test_plan.json
Normal file
36
test_framework/modules/ntt/test_plan.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"module": "ntt",
|
||||
"rtl_top": "sync_rtl/ntt/ntt_sync.v",
|
||||
"rtl_deps": [
|
||||
"sync_rtl/ntt/ntt_core.v",
|
||||
"sync_rtl/ntt/butterfly_unit.v",
|
||||
"sync_rtl/ntt/barrett_mul.v",
|
||||
"sync_rtl/ntt/zeta_rom.v"
|
||||
],
|
||||
"tb_cpp": "sync_rtl/ntt/TB/tb_ntt.cpp",
|
||||
"simulator": "verilator",
|
||||
"timeout_s": 300,
|
||||
"cases": [
|
||||
{
|
||||
"id": "forward",
|
||||
"description": "Forward NTT: 256-coeff polynomial -> NTT domain, vs Python NTT()",
|
||||
"params": {"mode": "forward"},
|
||||
"num_vectors": 5,
|
||||
"tolerance": "bit_exact"
|
||||
},
|
||||
{
|
||||
"id": "inverse",
|
||||
"description": "Inverse NTT: 256-coeff NTT-domain -> normal domain, vs Python NTTInverse()",
|
||||
"params": {"mode": "inverse"},
|
||||
"num_vectors": 5,
|
||||
"tolerance": "bit_exact"
|
||||
},
|
||||
{
|
||||
"id": "roundtrip",
|
||||
"description": "Round-trip: NTT(INTT(f)) == f",
|
||||
"params": {"mode": "roundtrip"},
|
||||
"num_vectors": 3,
|
||||
"tolerance": "bit_exact"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user