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
38 changes: 17 additions & 21 deletions bootstrap/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12307,14 +12307,15 @@ impl VerilogCodegen {
}
}

// NO CALL SITE is not a defect. An array parameter that cannot
// be bound to a module-level array is simply passed BY VALUE:
// it stays a real `input [W-1:0]` and the body indexes it by
// element slice (#1745). Refusing instead skipped the whole
// function, which is how specs/ternary/bitnet_layer came to
// print "function on_comb has array parameter(s) but no call
// site" four lines above `assign result = on_comb(...)` -- the
// emitter wrote the call and then denied it. t27#2743.
if call_sites.is_empty() {
errors.insert(
f.name.clone(),
format!(
"function {} has array parameter(s) but no call site",
f.name
),
);
continue;
}

Expand All @@ -12337,26 +12338,21 @@ impl VerilogCodegen {
}
let unique: std::collections::HashSet<String> =
arg_names.iter().cloned().collect();
// CONFLICTING call sites are not a defect either: one
// function used with two different arrays -- `neuronN(acts,
// w0, ..)` and `neuronN(acts, w1, ..)` -- cannot be
// specialised to one name, so it takes the by-value path
// like any other unbindable parameter.
if unique.len() != 1 {
errors.insert(
f.name.clone(),
format!(
"function {} array parameter {} has conflicting call-site arguments",
f.name, pname
),
);
broken = true;
break;
}
let bound = arg_names.into_iter().next().unwrap();
// An argument that is not a plain identifier -- an
// expression, or absent -- names no module array to bind
// to. Third form of the same situation, and the same
// answer: pass the array by value.
if bound == "W458_NON_ID" || bound == "W458_MISSING" {
errors.insert(
f.name.clone(),
format!(
"function {} array parameter {} must be passed a module-level array identifier",
f.name, pname
),
);
broken = true;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/stage0/FROZEN_HASH
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9e344df23322451ff7ddb46380cab671eb47e77b4a7008f687adfb021675e7aa
25a9c40dc2737fdefdba078a3ac7f25e67e214d4098af477a504287e6415045f
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# NOW -- An array parameter that cannot be bound is passed by value (2026-08-28)

## An array parameter that cannot be bound is passed by value (Closes #2743)

- three refusals deleted: no call site, disagreeing call sites, non-identifier argument -- none of them a defect
- whole suite with --no-fail-fast: 2419 passed 5 failed -> 2424 passed 0 failed, no test file touched
- earlier 1786/1 figures were from runs that stop at the first failing binary; four of the five failures had never been printed
- blast radius 10 of 650 specs, all one direction: 19 refusals removed, 19 functions gained
Loading