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

Specify type parameter when calling chiselTypeClone #3476

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

konda-x1
Copy link

Due to the signature of method DataMirror.internal.chiselTypeClone, if you don't specify the type parameter T, it will resolve to Nothing. This causes a good amount of tests using LazyModule to break in rocket-dsp-utils.

Type of change: bug report

Impact: no functional change

Development Phase: implementation

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 21, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: konda-x1 / name: Aleksandar Kondić (d70a6e0)

@sequencer sequencer changed the base branch from master to dev August 21, 2023 15:40
@jerryz123
Copy link
Contributor

Can you point to the API docs/source you are referencing? I believe this may be necessary now, but I haven't seen the updated API yet.

@konda-x1
Copy link
Author

Here is how it's defined in Chisel 3.6: https://github.com/chipsalliance/chisel/blob/3.6-release/core/src/main/scala/chisel3/reflect/DataMirror.scala#L177

The method takes a generic type T, but the method's argument is not of type T, but rather Data. So, from my understanding, the generic type will not be inferred from the type of the data parameter passed to it. This will lead to Nothing being inferred when no explicit type parameter is specified in the method call. This is in contrast to how something like chiselTypeOf is defined, where the single parameter is of type T itself.

Honestly, I don't quite understand how things like this may have worked before, but I know that presently, when I add [T] to chiselTypeClone inside BundleBridgeSource and BundleBridgeSink that the tests inside rocket-dsp-utils start working again. I assumed it would be beneficial to specify the type parameter in other calls to chiselTypeClone as well.

@jackkoenig
Copy link
Contributor

This is a longstanding bug in Chisel, just fixed it: chipsalliance/chisel#3553 (h/t @sequencer for pointing me to it showing up here).

@sequencer
Copy link
Member

Let's wait for next release of 3.6.x and 5.x

@sequencer sequencer marked this pull request as draft October 7, 2023 01:57
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.

None yet

4 participants