Skip to content

[3.5.x] Deprecate named arguments for methods moving to macros in 3.6#2530

Merged
jackkoenig merged 2 commits into3.5.xfrom
3.5.x-deprecated-named-arguments
May 14, 2022
Merged

[3.5.x] Deprecate named arguments for methods moving to macros in 3.6#2530
jackkoenig merged 2 commits into3.5.xfrom
3.5.x-deprecated-named-arguments

Conversation

@jackkoenig
Copy link
Copy Markdown
Contributor

@jackkoenig jackkoenig commented May 13, 2022

These methods will start using def macros and since def macros do not
supported named arguments this will be a source-incompatible change.
This deprecation will warn users that they need to remove any uses of
named arguments on these methods.

This resolves the issue discussed in #2515.

This doesn't give perfect error messages, but it's not bad. For the following

RegEnable(next = 0.U, enable = true.B)

You'll get the warnings:

[warn] .../Example.scala:5:18: naming parameter next is deprecated (since Chisel 3.5).
[warn]   RegEnable(next = 0.U, enable = true.B)
[warn]                  ^
[warn] .../Example.scala:5:32: naming parameter enable is deprecated (since Chisel 3.5).
[warn]   RegEnable(next = 0.U, enable = true.B)
[warn]                                ^

Note as precise as one would like but it does suggest that you should stop using the names 🤷‍♂️

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you add appropriate documentation in docs/src?
  • Did you state the API impact?
  • Did you specify the code generation impact?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • code cleanup

API Impact

Warn about impending API change in 3.6.

Backend Code Generation Impact

No impact

Desired Merge Strategy

  • Squash

Release Notes

In Chisel 3.6, several chisel3 utils will start using def macros which do not allow named arguments. These utils are: Cat, Fill, FillInterleaved, PopCount, Reverse, RegEnable, ShiftRegister, and ShiftRegisters.

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels?
  • Did you mark the proper milestone (Bug fix: 3.4.x, [small] API extension: 3.5.x, API modification or big change: 3.6.0)?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you mark as Please Merge?

These methods will start using def macros and since def macros do not
supported named arguments this will be a source-incompatible change.
This deprecation will warn users that they need to remove any uses of
named arguments on these methods.
@jackkoenig jackkoenig requested review from mwachs5 and sequencer May 13, 2022 23:25
@jackkoenig jackkoenig enabled auto-merge (squash) May 14, 2022 02:06
@jackkoenig jackkoenig merged commit 99ae2ee into 3.5.x May 14, 2022
@jackkoenig jackkoenig deleted the 3.5.x-deprecated-named-arguments branch May 14, 2022 02:46
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.

2 participants