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

Add NoChiselNamePrefix to ignore instances in @chiselName #1383

Merged
merged 1 commit into from
Mar 23, 2020

Conversation

jackkoenig
Copy link
Contributor

Add trait chisel3.experimental.NoChiselNamePrefix which causes
@chiselName to skip naming of the instance effectively preventing it
from prefixing any vals inside the instance. It can be applied to
classes such that all instances of that class have this property, or to
individual instances (via creating an anonymous class inline).

Also add basic ScalaDoc for NoChiselNamePrefix and chiselName.

Resolves #1371

This may not be the best way to solve the issue, but it works well enough and it's an experimental API such that if we find a better solution we can change it.

Related issue: #1371

Type of change: other enhancement

Impact: API addition (no impact on existing code)

Development Phase: implementation

Release Notes

Add trait chisel3.experimental.NoChiselNamePrefix for excluding instances of @chiselName annotated classes from naming. This prevents the val name of the instance from prefixing the names components inside the object.

@jackkoenig jackkoenig requested a review from ducky64 March 23, 2020 00:34
@jackkoenig jackkoenig requested a review from a team as a code owner March 23, 2020 00:34
@jackkoenig jackkoenig added this to the 3.3.0 milestone Mar 23, 2020
Copy link
Contributor

@ducky64 ducky64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, especially since it's experimental we can push through a fast fix now. The trait solution also makes more sense given your example of use in an anonymous class, instead of being in the main class definition.

Add trait chisel3.experimental.NoChiselNamePrefix which causes
@chiselName to skip naming of the instance effectively preventing it
from prefixing any vals inside the instance. It can be applied to
classes such that all instances of that class have this property, or to
individual instances (via creating an anonymous class inline).

Also add basic ScalaDoc for NoChiselNamePrefix and chiselName.
@jackkoenig jackkoenig added the Please Merge Accepted PRs that are ready to be merged. Useful when waiting on CI. label Mar 23, 2020
@mergify mergify bot merged commit 1d81119 into master Mar 23, 2020
@jackkoenig jackkoenig deleted the no-chiselname-prefix branch May 5, 2020 00:24
jackkoenig added a commit that referenced this pull request Feb 28, 2023
* Removed unused imports in src/test/

* Update ScalaTest deprecations.

* Update scalatest from 3.0.8 to 3.1.0; apply auto fix for deprecations

Co-authored-by: Jack Koenig <koenig@sifive.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Please Merge Accepted PRs that are ready to be merged. Useful when waiting on CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nested @chiselName adds extra names
3 participants