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

Allow modules to globally enable layers #3799

Merged
merged 3 commits into from Jan 31, 2024

Conversation

seldridge
Copy link
Member

@seldridge seldridge commented Jan 30, 2024

Add a function that allows the layer to be "enabled" within the current module scope. This has the effect of emitting the module with the "enablelayer " FIRRTL format. This is not currently in the FIRRTL spec---it is being prototyped inside CIRCT and is expected to land in the spec soon.

This is done to allow for the use case of a Test Harness needing to enable one or more layers (more than one layer is the union of several layers) inside a DUT in order to drive it properly. The specific use case is to get access to an expensive core trace inside a microprocessor that is hidden behind a layer.

This was originally written using an API where the layer provided a trait that enabled the layer. This runs afoul of Scala's restriction on inheriting the same trait multiple times.

FYI: @rwy7

Add a function that allows the layer to be "enabled" within the current
module scope.  This has the effect of emitting the module with the
"enablelayer <layer>" FIRRTL format.  This is not currently in the FIRRTL
spec---it is being prototyped inside CIRCT and is expected to land in the
spec soon.

This is done to allow for the use case of a Test Harness needing to enable
one or more layers (more than one layer is the union of several layers)
inside a DUT in order to drive it properly.  The specific use case is to
get access to an expensive core trace inside a microprocessor that is
hidden behind a layer.

This was originally written using an API where the layer provided a trait
that enabled the layer.  This runs afoul of Scala's restriction on
inheriting the same trait multiple times.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
@jackkoenig jackkoenig added this to the 7.0 milestone Jan 30, 2024
@jackkoenig jackkoenig added the Feature New feature, will be included in release notes label Jan 30, 2024
Copy link
Contributor

@jackkoenig jackkoenig left a comment

Choose a reason for hiding this comment

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

Looks good to me, just a question and a nit

core/src/main/scala/chisel3/Layer.scala Outdated Show resolved Hide resolved
src/test/scala/chiselTests/LayerSpec.scala Show resolved Hide resolved
@seldridge seldridge enabled auto-merge (squash) January 31, 2024 02:52
@seldridge seldridge merged commit 507f989 into main Jan 31, 2024
13 checks passed
@seldridge seldridge deleted the dev/seldridge/module-enabled-layers branch January 31, 2024 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature, will be included in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants