Skip to content

fix(gen-verilog): test-block for-loops, no CSE of loop-variant calls, tail expressions - #1986

Merged
gHashTag merged 1 commit into
masterfrom
fix/verilog-tb-loops
Aug 8, 2026
Merged

fix(gen-verilog): test-block for-loops, no CSE of loop-variant calls, tail expressions#1986
gHashTag merged 1 commit into
masterfrom
fix/verilog-tb-loops

Conversation

@gHashTag

@gHashTag gHashTag commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Refs #1948

Three linked test-block/fn-body defects:

  • for/while in a test block was dropped as // (stmt: StmtForRange), silently voiding loop bodies that accumulate assertions. Loops emit now; the loop var is declared integer.
  • Call-CSE hoisted a loop-variant call out of the loop into one temp evaluated once with an uninitialized index — the loop then tested a constant. predeclare no longer recurses into loop bodies.
  • Tail expression (fn body ending in a bare expr, no return) lowered to a bare expr; (unknown-task enable) → <fn> = <expr>; now.

tri-net: icarus 97 → 98 (m3_multihop). Top-level if in test blocks stays dropped as before (no regression). bridge.v regenerated; unit suite at the single pre-existing red. FROZEN_HASH resealed; NOW.md entries added.

🤖 Generated with Claude Code

… tail expressions

Refs #1948

Three linked test-block/fn-body defects:

- `for i in ..`/`while` in a test block was DROPPED as
  `// (stmt: StmtForRange)`, silently voiding loop bodies that
  accumulate assertions. Loops emit now; the loop variable is declared
  `integer` at the block top.
- The call-CSE pass hoisted a call from INSIDE a loop into one temp
  evaluated once before the loop with an uninitialized index, so the
  loop tested a constant. predeclare_call_array_tmps no longer recurses
  into loop bodies -- loop-variant calls are emitted inline per
  iteration.
- A Rust-style tail expression (a fn body ending in a bare expression,
  no `return`) lowered to a bare `expr;` that iverilog read as an
  unknown-task enable; it lowers to `<fn> = <expr>;` now.

tri-net corpus: icarus 97 -> 98 (m3_multihop). Top-level `if` in test
blocks stays dropped as before (asserts inside need the TB
assert-lowering -- out of scope, no regression). bridge.v regenerated;
unit suite at the single pre-existing red. FROZEN_HASH resealed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gHashTag
gHashTag enabled auto-merge (squash) August 8, 2026 22:37
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-08 22:37:54 UTC

Summary

Status Count
Total Open PRs 15
PRs with Failing Checks 2
PRs with All Checks Green 13
READY 5
FAILING 2
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=871ec3135001 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@gHashTag
gHashTag merged commit 1788e6a into master Aug 8, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant