Repository navigation
fix(codegen): improve Verilog + C backend quality for all specs - #52
Merged
Merged
Conversation
- Implement ExprSwitch as nested ternary operators in Verilog backend (eliminates 12 unsupported expression placeholders) - Implement StmtFor as Verilog for-loops with integer iteration (eliminates 15 unsupported statement placeholders) - Fix ExprReturn to assign to function name (Verilog semantics) instead of emitting /* return */ placeholder (fixes 577 instances) - Sanitize module names: hyphens and special chars → underscores (fixes 5 invalid Verilog module identifiers) - Add current_fn_name tracking to VerilogCodegen struct Results: 0/28 gen-verilog failures, 0/28 gen-c failures (target: < 5) Zig backend (gen) unchanged — 0 regressions. Closes #49 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gHashTag
added a commit
that referenced
this pull request
Jun 1, 2026
fix(codegen): improve Verilog + C backend quality for all specs
gHashTag
added a commit
that referenced
this pull request
Jun 17, 2026
- Coq [MANUAL_FIX] audit: 65 tags across 12 files - 1 invalid formula withdrawn (arcsin(8/(φπ)), argument > 1) - 2 valid formulas identified (Lucas identities) - 56 placeholders reclassified with granular tags - +4 competitors: PMMD (#50), Priya et al. (#51), Gimranov (#52), Eusani (#53) - Total competitors: 53 Closes #1190
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ExprSwitchas nested ternary operators in Verilog backend (eliminates 12 unsupported expression placeholders)StmtForas Verilog for-loops with integer iteration (eliminates 15 unsupported statement placeholders)ExprReturnto assign to function name (Verilog semantics) instead of/* return */placeholder (fixes 577 instances)current_fn_nametracking toVerilogCodegenstructResults
Test plan
gen-verilog(exit code 0)gen-c(exit code 0)gen(Zig — no regression)/* unsupported expr */markers in Verilog output/* return */placeholders in Verilog outputcargo build --releasesucceedscargo testpassesCloses #49
🤖 Generated with Claude Code