-
Notifications
You must be signed in to change notification settings - Fork 637
Add --remap-layers to ChiselStage #4322
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
Conversation
Add a new annotation/option to Chisel, `RemapLayer`, which is intended to be used to allow a Chisel compilation to change which layers are used by an upstream project's libraries in a downstream project. The motivation here is to fix mismatches between upstream and downstream when they have different layers. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
Add the ability for ChiselStage to globally remap a layer to another layer. This is intended to be used as a Chisel-level mechanism for a downstream project to change the layers of all upstream projects. This may be necessary in order to produce compatible FIRRTL designs where the upstream project and downstream project have different layers, but the upstream project has put certain constructs (e.g., asserts) into specific layers. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
This also needs to remap layer colored probes. |
This should also probably grow a feature for remapping to the root layer with the effect. This has overlap with CIRCT specialization flows, but is necessary in order to produce legal FIRRTL. |
Should this feature goes to circt by adding some cmdline option? |
another idea is we can simply append the package name of each layer to identify them(or provide an user defined override-able val instead.) |
A variation of this will need to show up as a FIRRTL language feature. However, I don't want to have CIRCT handle corrections to illegal FIRRTL to make it legal. I want to have Chisel always be able to emit legal FIRRTL. E.g., we need some kind of "layer alias" or "layer remapping" at an extmodule boundary:
In the above
I wanted a more Chisel language level way of doing this but couldn't come up with something. The problem is that there is no "global configuration" for Chisel where you can do this. Where could you put a All that said, practically, I don't think that this feature will be frequently used. I want most people to align on the upstream provided layers that Chisel has. Draft PR here: https://github.com/chipsalliance/chisel/pull/4323/files#diff-ef2aee2c3e90ffd56af995e76ac6573da3db4f939ea66b5c2f95756c29041504 These then give us a common place to put assertions for standard library generators or internal things. Users are then free to add more layers based on what they care about. (There is a missing feature to add a layer that is a parent of an existing layer.) |
Added in: fdfdff9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good, a couple of nits and a suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but still see nits.
Add a new annotation/option to Chisel, `RemapLayer`, which is intended to be used to allow a Chisel compilation to change which layers are used by an upstream project's libraries in a downstream project. The motivation here is to fix mismatches between upstream and downstream when they have different layers. Add the ability for ChiselStage to globally remap a layer to another layer. This is intended to be used as a Chisel-level mechanism for a downstream project to change the layers of all upstream projects. This may be necessary in order to produce compatible FIRRTL designs where the upstream project and downstream project have different layers, but the upstream project has put certain constructs (e.g., asserts) into specific layers. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
Add a new annotation/option to Chisel,
RemapLayer
, which is intended tobe used to allow a Chisel compilation to change which layers are used by
an upstream project's libraries in a downstream project. The motivation
here is to fix mismatches between upstream and downstream when they have
different layers.
Add the ability for ChiselStage to globally remap a layer to another
layer. This is intended to be used as a Chisel-level mechanism for a
downstream project to change the layers of all upstream projects. This
may be necessary in order to produce compatible FIRRTL designs where the
upstream project and downstream project have different layers, but the
upstream project has put certain constructs (e.g., asserts) into
specific layers.
Release Notes
Add --remap-layers ChiselStage option for changing all layers in an upstream project.