-
Notifications
You must be signed in to change notification settings - Fork 177
Conversation
Change the CompilerAnnotation object to emit RunFirrtlTransformAnnotations containing the associated emitter. This requires a fix in the Driver compatibility layer to know how to enable one-file-per module emission if either a CompilerAnnotation or a RunFirrtlTransformAnnotation(_: Emitter) is present. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
Add a phase, ConvertCompilerAnnotation, that converts a CompilerAnnotation to a RunFirrtlTransformAnnotation. This provides a warning to the user if this path is taken. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
src/main/scala/firrtl/stage/phases/ConvertCompilerAnnotations.scala
Outdated
Show resolved
Hide resolved
src/main/scala/firrtl/stage/phases/ConvertCompilerAnnotations.scala
Outdated
Show resolved
Hide resolved
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.
This fixes the annoying deprecation warning when running (new ChiselStage).emitChirrtl
(or whatever) and looks good. A few minor questions but the overall PR looks great.
Deprecate the CompilerAnnotation companion object and move it's private utility inside the RunFirrtlTransformAnnotation companion object. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
Make this phase private to avoid adding a deprecation warning. Also, remove an unused string value. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
src/test/scala/firrtl/stage/phases/tests/ConvertCompilerAnnotationsSpec.scala
Outdated
Show resolved
Hide resolved
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
Did you make sure that specifying only |
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
@ekiwi: I added a test to |
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.
This is a follow-on to #1835 to fully deprecate
CompilerAnnotation
.This does a couple of things:
The
CompilerAnnotation$
companion object is changed to emitRunFirrtlTransformAnnotation
s instead ofCompilerAnnotation
s. In effect, when you do-X verilog
, you now get aRunFirrtlTransformAnnotation(new VerilogEmitter)
as opposed to aCompilerAnnotation(new VerilogCompiler)
.This adds a
ConvertCompilerAnnotation
phase which is doing an explicit conversion of aCompilerAnnotation
to aRunFirrtlTransformAnnotation
. This differs from stage: allow a RunFirrtlTransformAnnotation(_:Emitter) annotation to be used in place of a CompilerAnnotation #1835 which relaxed support so that aRunFirrtlTransformAnnotation(_ <: Emitter)
could substitute for aCompilerAnnotation
. This PR goes one step further and forces internal phases to only understand transforms.Better checks and warnings are now provided inside
ConvertCompilerAnnotation
. The check of a single compiler is migrated fromChecks
here. Additionally, if aCompilerAnnotation
is converted, a verbose warning is printed telling you exactly how to replace your transform, e.g., you now get:Note that you should only now get a warning if you actually use a
CompilerAnnotation
. Any use of-X
will not produce an error.Contributor Checklist
Type of Improvement
API Impact
None. Removes a warning that the user couldn't do anything to fix.
Backend Code Generation Impact
None.
Desired Merge Strategy
Release Notes
None.
Reviewer Checklist (only modified by reviewer)
Please Merge
?