fix(test): break on unknown signal in count_concat_bits
When an unknown signal is encountered, total is set to -1 but the loop continues. Subsequent known signals add their widths to -1, producing incorrect totals (e.g. -1 + 16 = 15 instead of -1). This can mask genuine truncation bugs in status word packing.
This commit is contained in:
@@ -497,6 +497,7 @@ def count_concat_bits(concat_expr: str, port_widths: dict[str, int]) -> ConcatWi
|
|||||||
# Unknown width — flag it
|
# Unknown width — flag it
|
||||||
fragments.append((part, -1))
|
fragments.append((part, -1))
|
||||||
total = -1 # Can't compute
|
total = -1 # Can't compute
|
||||||
|
break
|
||||||
|
|
||||||
return ConcatWidth(
|
return ConcatWidth(
|
||||||
total_bits=total,
|
total_bits=total,
|
||||||
|
|||||||
Reference in New Issue
Block a user