You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The spec-first .t27 compute path lowers to combinational Verilog only. This blocks a real streaming accelerator (Phase 2 of the BitNet roadmap): weights-from-BRAM, activation streaming, per-cycle accumulation all need clocked state.
A module-level var count : u8 becomes a reg, but its update lives inside a combinational function (count = count + 1; in fn tick), never in a clocked process — so the state is never actually registered/advanced by a clock.
debug-hir on any spec shows always_blocks: [] and ternary_cores: []. The HIR emitter has emit_always_block (compiler.rs:17968) and emit_ternary_core, and clocked always-blocks are constructed in unit tests (compiler.rs:19729), but the AST→HIR lowering never populates them from source.
Two paths forward for Phase 2
Compiler feature: add a clocked-process / sequential-block construct to the .t27 grammar (e.g. on posedge(clk) { ... } or a registered-var semantics) and wire the AST→HIR lowering to populate always_blocks (the emitter already exists). Then a streaming ternary accumulator can be spec-first.
The spec-first
.t27compute path lowers to combinational Verilog only. This blocks a real streaming accelerator (Phase 2 of the BitNet roadmap): weights-from-BRAM, activation streaming, per-cycle accumulation all need clocked state.Evidence
gen-verilog specs/fpga/uart.t27emits 0always @(posedge clk)blocks.var count : u8becomes areg, but its update lives inside a combinational function (count = count + 1;infn tick), never in a clocked process — so the state is never actually registered/advanced by a clock.debug-hiron any spec showsalways_blocks: []andternary_cores: []. The HIR emitter hasemit_always_block(compiler.rs:17968) andemit_ternary_core, and clocked always-blocks are constructed in unit tests (compiler.rs:19729), but the AST→HIR lowering never populates them from source.Two paths forward for Phase 2
.t27grammar (e.g.on posedge(clk) { ... }or a registered-varsemantics) and wire the AST→HIR lowering to populatealways_blocks(the emitter already exists). Then a streaming ternary accumulator can be spec-first.pipeline_stage2_compute, etc.), and the spec-firstdot27is bit-exact equal to the hand-writtentrit27_dot_product(feat(ternary): spec-first ternary MAC dot product (.t27), bit-exact vs handwritten #1743). So Phase 2 could instead complete the hand-writtenbitnet_engine_top(fix input≡weight aliasing + write-back + quantizer wiring; test: bitnet_top asserts stale contract (busy + mem tie-off) vs current gen-bitnet-engine-top #1726) using the proven-equivalent compute.This is the crux of the on-hardware MVP path; recording it so the choice is deliberate.