Skip to content

Use require instead of Builder.error for Mux size mismatch#5311

Open
kimjune01 wants to merge 1 commit into
chipsalliance:mainfrom
kimjune01:fix-4444-priority-mux-require
Open

Use require instead of Builder.error for Mux size mismatch#5311
kimjune01 wants to merge 1 commit into
chipsalliance:mainfrom
kimjune01:fix-4444-priority-mux-require

Conversation

@kimjune01
Copy link
Copy Markdown

Summary

Test plan

  • Updated existing mismatch tests for both Mux1H and PriorityMux to verify IllegalArgumentException is thrown
  • Added regression test: PriorityMux(Seq(a, b), Seq(foo, bar, fizz)) now fails fast instead of silently dropping fizz

Change from Builder.error to require for size mismatch validation.
Builder.error allows execution to continue, causing silent data loss
when zip truncates the longer sequence. With require, the error is
caught immediately preventing incorrect circuit generation.

Fixes chipsalliance#4444 where PriorityMux(Seq(a, b), Seq(foo, bar, fizz)) would
silently drop fizz instead of failing fast.

Updated tests to expect IllegalArgumentException instead of
ChiselException since require throws immediately rather than
collecting errors for later batch reporting.
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 12, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: kimjune01 / name: June Kim (471a0ea)

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.

PriorityMux drops arguments if input sequences are not the same size

1 participant