Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[reggen] Support a multireg count of 0 #26545

Open
andreaskurth opened this issue Mar 6, 2025 · 1 comment · May be fixed by #26795
Open

[reggen] Support a multireg count of 0 #26545

andreaskurth opened this issue Mar 6, 2025 · 1 comment · May be fixed by #26795

Comments

@andreaskurth
Copy link
Contributor

andreaskurth commented Mar 6, 2025

reggen currently doesn't support 0 instances of a multireg. It fails with the following error:

File "util/reggen/multi_register.py", line 132, in __init__                                                                                                                                                                        
    raise ValueError("Multireg {} has a count of {}, "                                                            
ValueError: Multireg INP_PRD_CNT_CTRL has a count of 0, which isn't positive.

Instead of this error, I'd expect reggen to completely omit a multireg with count 0.

The problem can be avoided if the count of the multireg is a template parameter: in that case, a % if template_parameter > 0: can be placed around the multireg.

@rswarbrick
Copy link
Contributor

On the plus side, this should be pretty trivial to fix. An easy fix:

  • Define a specialized EmptyMultiReg exception
  • Throw it instead of spitting out that error if the count is zero.
  • Construct the object in a try / except in RegBlock._handle_multireg.

I'm hoping that it's just an hour's work.

@rswarbrick rswarbrick linked a pull request Mar 30, 2025 that will close this issue
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 a pull request may close this issue.

2 participants