Skip to content

Fix formatter dropping function ports when packed dims contain $clog2() - #2578

Open
kbrunham-intel wants to merge 2 commits into
chipsalliance:masterfrom
kbrunham-intel:fix/886
Open

Fix formatter dropping function ports when packed dims contain $clog2()#2578
kbrunham-intel wants to merge 2 commits into
chipsalliance:masterfrom
kbrunham-intel:fix/886

Conversation

@kbrunham-intel

@kbrunham-intel kbrunham-intel commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Function headers whose return packed dimensions contain a system call such as $clog2(...) used to lose their port list: ReshapeFittingSubpartitions expected [header, args, trailer] and treated extra $clog2 fragments as the args, discarding the real ports.
  • Collapse those extra header fragments before reshaping so the ports are kept and wrapped normally.
  • Adds formatter regression tests for the original Formatting long function header removes part of code #886 sample, $bits(), multi-arg $clog2(), and extern prototypes.

Fixes #886

Test plan

ReshapeFittingSubpartitions assumed [header, args, trailer]. Extra
header fragments from $clog2() in packed dimensions caused the port
list to be dropped (issue chipsalliance#886).
@kbrunham-intel
kbrunham-intel marked this pull request as ready for review August 18, 2026 01:09
@kbrunham-intel

Copy link
Copy Markdown
Contributor Author

Hi @hzeller. Please consider this change which fixes issue 886.

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.

Formatting long function header removes part of code

1 participant