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

RegEnable does not take named arguments #3768

Closed
iansseijelly opened this issue Jan 26, 2024 · 3 comments
Closed

RegEnable does not take named arguments #3768

iansseijelly opened this issue Jan 26, 2024 · 3 comments

Comments

@iansseijelly
Copy link

iansseijelly commented Jan 26, 2024

Type of issue: Bug Report

Please provide the steps to reproduce the problem:
Any Chisel design using RegEnable(next=x_next, enable=x_en) instead of RegEnable(x_next, x_en)

What is the current behavior?

[Error]:macro applications do not support named and/or default arguments

What is the expected behavior?
It should work and it was working in previous versions.

What is the use case for changing the behavior?
Adding named arguments makes the register declaration much more readable, especially for use cases where declaring separate enable and next wires does not make sense.

@jackkoenig
Copy link
Contributor

jackkoenig commented Jan 26, 2024

I agree that it would be nice to take named arguments, but it's a fundamental limitation of def macros in Scala 2. This fundamental limitation is fixed in Scala 3 so this is a "Wont Fix" in the Scala 2 version of Chisel, but this will be fixed by virtue of upgrading to Scala 3 when we finally do that (hopefully in the coming months).

@jackkoenig jackkoenig closed this as not planned Won't fix, can't repro, duplicate, stale Jan 26, 2024
@jerryz123
Copy link
Contributor

@jackkoenig is there any info on the Scala 3 upgrade? Is this the 7.0.0 release? Is there any migration plan?

@jackkoenig
Copy link
Contributor

Probably not in 7.0.0, or at least I certainly won't hold up a 7.0 for it. No formal migration plan except that at least initially Chisel will cross-compile for 2.13 and 3 so that users can bump Chisel, and then migrate to Scala 3. There are some relatively minor but nevertheless backwards incompatible changes we need to make before upgrading to Scala 3.

  1. We have to remove this.type, we can make cloneType work as an extension method. This change should be source compatible but is very much not binary compatible (mandating the change be on a major version bump).
  2. Scala 3 doesn't support macro annotations in the same way, so D/I needs to switch to a different implementation. I have prototyped how to do it using whitebox def macros, @instantiable and @public will go away. I think we need to make this change in a major version bump before we try to add Scala 3 support, otherwise I don't see how lots of code will cross-compile which would be a huge pain.

Depending on maintenance burden I would like to support cross-compilation for a while.

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

No branches or pull requests

3 participants