Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Integrate new transforms with firrtl.stage.Forms #1754

Merged
merged 2 commits into from
Jul 25, 2020
Merged

Conversation

seldridge
Copy link
Member

@seldridge seldridge commented Jul 10, 2020

Move new transforms, recently added, into existing or new sets of
transforms (defined in firrtl.stage.Forms).

One transform is a mandatory low FIRRTL optimization:

  • firrtl.transforms.LegalizeAndReductionsTransform

Previously, this was included as a prerequisite of all Verilog
emitters (minimum, normal, and SystemVerilog).

Two transforms associated with converting and removing the new
verification statements are moved into a new set of transforms,
AssertsRemoved:

  • firrtl.transforms.formal.ConvertAsserts
  • firrtl.transforms.formal.RemoveVerificationStatements

Previously, these transforms were directly added as prerequisites to
the minimum Verilog and normal Verilog emitter, but not the
SystemVerilog emitter.

The designation of inputForm=LowForm for legacy, custom transforms is
updated to include assertion removal transforms as part of their
optionalPrerequisites. This has the effect of continuing to cause
inputForm=LowForm transforms to run as late as possible (right before
the low FIRRTL, minimum Verilog, Verilog, or SystemVeriog emitter).

Tests are updated to reflect the new order in both CustomTransformSpec
and LoweringCompilersSpec. This commit also simplifies the test used
in the CustomTransformSpec to assert that inputForm=LowForm legacy
transforms run right before the emitter. The new test looks only for a
list of (customTransform, emitter) in a sliding, size-2 window of the
flattened transform order. Previously, this was looking for a match
before and after the custom transform. The old implementation
necessitate busywork updates of the test when new transforms are added
that changed the transform running before the custom transform.

Depends on #1753.

This should not be backported due to references to 1.4 verification statements.

Contributor Checklist

  • [n/a] Did you add Scaladoc to every public function/method?
  • [n/a] Did you update the FIRRTL spec to include every new feature/behavior?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you state the API impact?
  • Did you specify the code generation impact?
  • Did you request a desired merge strategy?
  • x ] Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • code refactoring

API Impact

This adds firrtl.stage.Forms.AssertRemoved to the API.

Backend Code Generation Impact

None.

Desired Merge Strategy

  • Squash: The PR will be squashed and merged (choose this if you have no preference.

Release Notes

None

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels?
  • Did you mark the proper milestone (1.2.x, 1.3.0, 1.4.0) ?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you mark as Please Merge?

@seldridge seldridge requested a review from a team as a code owner July 10, 2020 21:11
@seldridge seldridge force-pushed the cleanup-forms branch 2 times, most recently from b16ed48 to cfe6002 Compare July 11, 2020 03:35
@sequencer
Copy link
Member

One transform is a mandatory low FIRRTL optimization:
firrtl.transforms.LegalizeAndReductionsTransform

I have a question to this.
i notice debian-sid, homebrew and archlinux has updated to 4.036 or even 4.038, which won't contains bug of verilator/verilator#2300

My question is possible to remove this after some a milestone like fedora get this update?

I think distributions like Ubuntu or CentOS should not affect our development since they contains a very bad package maintaining policy.

@sequencer
Copy link
Member

Generally look good to me:)
Should we only merge this, or merge this after #1753 gets merged?

@sequencer sequencer self-requested a review July 16, 2020 17:54
@seldridge seldridge force-pushed the cleanup-forms branch 2 times, most recently from a2172aa to e9f40d9 Compare July 24, 2020 17:10
Move new transforms, recently added, into existing or new sets of
transforms (defined in firrtl.stage.Forms).

One transform is a mandatory low FIRRTL optimization:

  - firrtl.transforms.LegalizeAndReductionsTransform

Previously, this was included as a prerequisite of all Verilog
emitters (minimum, normal, and SystemVerilog).

Two transforms associated with converting and removing the new
verification statements are moved into a new set of transforms,
AssertsRemoved:

  - firrtl.transforms.formal.ConvertAsserts
  - firrtl.transforms.formal.RemoveVerificationStatements

Previously, these transforms were directly added as prerequisites to
the minimum Verilog and normal Verilog emitter, but not the
SystemVerilog emitter.

The designation of inputForm=LowForm for legacy, custom transforms is
updated to include assertion removal transforms as part of their
optionalPrerequisites. This has the effect of continuing to cause
inputForm=LowForm transforms to run as late as possible (right before
the low FIRRTL, minimum Verilog, Verilog, or SystemVeriog emitter).

Tests are updated to reflect the new order in both CustomTransformSpec
and LoweringCompilersSpec.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
@seldridge
Copy link
Member Author

@sequencer: Can you take a look at this again? This is just rebased onto master, but I think you actually have review powers now (and thereby this has the potential to get merged).

Copy link
Member

@sequencer sequencer left a comment

Choose a reason for hiding this comment

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

LGTM:)

@seldridge
Copy link
Member Author

I missed the earlier comment about LegalizeAndReductionsTransform. That's probably a @jackkoenig question on how long to leave it in. Ideally, if the transform comes out, it would be replaced with a change to the Verilog emitter that emits Verilog code that includes a compile-time check of the Verilator version. I'm not sure if this is possible, however.

@seldridge seldridge added the Please Merge Accepted PRs that are ready to be merged. Useful when waiting on CI. label Jul 25, 2020
@seldridge seldridge added this to the 1.4.0 milestone Jul 25, 2020
@mergify mergify bot merged commit d4e1a46 into master Jul 25, 2020
@seldridge seldridge deleted the cleanup-forms branch July 25, 2020 17:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bugfix 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.

2 participants