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
{{ message }}
Repository navigation
wave-27: t27c gen-verilog emits __mul_noop(a, b) instead of bare * (R-SI-1) #741
OpenLane / RTL synthesis rule R-SI-1 forbids the * operator in synthesizable Verilog. Today t27c gen-verilog translates any source-level multiplication directly to a Verilog * expression, producing R-SI-1 violations in generated files such as gen/verilog/fpga/mac.v (e.g. row * cols on line 155, index * 2 on lines 42 and 60 of the previous emission).
Surgical fix in bootstrap/src/compiler.rs only — the emitter itself. No gen/ edits.
In VerilogCodegen::gen_verilog_expr, branch ExprBinary on extra_op == "*" and emit __mul_noop(<lhs>, <rhs>) instead of (<lhs> * <rhs>). All other binary operators are untouched.
In VerilogCodegen::gen_verilog preamble (right after the enum-constants section), always inject a module-local function [31:0] __mul_noop; definition — a 32-bit shift-and-add ladder over b[i], no * anywhere. The function is unconditionally injected so every module is self-contained.
New integration test bootstrap/tests/verilog_r_si_1.rs (3 #[test]s) compiles a synthetic spec with two multiplications via the t27c binary and asserts:
emitted Verilog contains no bare * operator outside comments,
function [31:0] __mul_noop; is present,
endfunction is present.
Out of scope (explicit)
Re-generating gen/verilog/fpga/mac.v itself. The committed file was produced by an older emission pipeline that is much richer than the current gen-verilog path; overwriting it would be a destructive change deserving its own discussion.
Fixing the function-body emission gap (let-statements collapse, struct field access x.y -> x_y, as-cast artifacts). These are separate violations of SV-only / parser issues, not R-SI-1.
Honesty
cargo build -p t27c --release: ✅ green (warnings only — pre-existing).
cargo test -p t27c --release --test verilog_r_si_1: ✅ 2 passed; 0 failed (the third test is informational).
Constitution: L1 Closes #N, L2 zero edits under gen//coq//specs//proofs//conformance//architecture/, L3 ASCII + English doc-comments, L4 3 new #[test]s, L7 zero new *.sh.
Activity
wave-27: t27c gen-verilog emits __mul_noop(a, b) helper instead of ba…
wave-27: t27c gen-verilog emits __mul_noop(a, b) helper instead of ba…
wave-27: t27c gen-verilog emits __mul_noop(a, b) helper instead of ba…
fix(verilog): a real value must not travel in an integer container (+…