Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions NOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

Last updated: 2026-08-08

## gen-verilog: tuple-destructure temp declared in test blocks (Refs #1948)

- A test-block `let (a, b) = call()` slices a packed temp `__tup_l{line}`, but that temp (and the element regs) are declared only in emit_local's Decl phase, which the TB Init-only path skips -- the temp was referenced undeclared ("Could not find variable __tup_l242")
- The top-of-block declaration pass now emits the tuple-destructure decls (emit_local Decl) for empty-name/extra_field locals
- tri-net corpus: icarus 96 -> 97 (cross_layer_optimizer)
- FROZEN_HASH resealed

## gen-verilog: `_` discard in tuple destructure gets a throwaway reg (Refs #1948)

- `(link1, _) = create_2node_mesh(50)` emitted `{_, link1} = call()` -- Verilog has no `_` wildcard, so iverilog could not find the variable
Expand Down
11 changes: 11 additions & 0 deletions bootstrap/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8479,6 +8479,17 @@ impl VerilogCodegen {
self.write_indent();
self.emit_local(child, LocalEmitPhase::Decl);
}
// Tuple-destructure local `let (a, b) = call()`: the packed temp
// (__tup_l{line}) and the element regs are declared only in the
// Decl phase, which the TB Init-only path skips -- so the temp
// was referenced undeclared ("Could not find variable
// __tup_l242"). Declare them at the top of the block here.
if child.kind == NodeKind::StmtLocal
&& child.name.is_empty()
&& !child.extra_field.is_empty()
{
self.emit_local(child, LocalEmitPhase::Decl);
}
// Pre-declare a probe for every assert_eq in the block.
let stmt = if child.kind == NodeKind::StmtExpr {
child.children.first()
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/stage0/FROZEN_HASH
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fbbe3e1568e833b001e94be2d4cb612011d41d1e38fb5b57bca42e91ca510fb4
df2991ce372f7f3ecb9de196116662a7a40f2490cdeeb75ca77b2df18dfbb5fd
7 changes: 7 additions & 0 deletions docs/NOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

Last updated: 2026-08-08

## gen-verilog: tuple-destructure temp declared in test blocks (Refs #1948)

- A test-block `let (a, b) = call()` slices a packed temp `__tup_l{line}`, but that temp (and the element regs) are declared only in emit_local's Decl phase, which the TB Init-only path skips -- the temp was referenced undeclared ("Could not find variable __tup_l242")
- The top-of-block declaration pass now emits the tuple-destructure decls (emit_local Decl) for empty-name/extra_field locals
- tri-net corpus: icarus 96 -> 97 (cross_layer_optimizer)
- FROZEN_HASH resealed

## gen-verilog: `_` discard in tuple destructure gets a throwaway reg (Refs #1948)

- `(link1, _) = create_2node_mesh(50)` emitted `{_, link1} = call()` -- Verilog has no `_` wildcard, so iverilog could not find the variable
Expand Down
Loading