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

Add missing ResolveKinds/ResolveFlows invalidates #1760

Open
wants to merge 1 commit into
base: master-deprecated
Choose a base branch
from

Conversation

seldridge
Copy link
Member

@seldridge seldridge commented Jul 12, 2020

Update the dependencies of transforms which empirically invalidate
ResolveKinds or ResolveFlows.

This was discovered with some to-be-committed work that automates
looking for incorrect transform dependencies. Specifically, the
deficient transforms were found to not invalidate ResolveKinds or
ResolveFlows, yet running ReslveKinds or ResolveFlows after these
transforms would result in modifications to the circuit.

The LoweringCompilersSpec was updated with patches to indicate the
location of these new transforms.

Depends on: [#1753, #1754]

This should be backported to 1.3.x, but will need to be done manually.

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?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • bug fix

API Impact

None.

Backend Code Generation Impact

None.

Desired Merge Strategy

  • Rebase: You will rebase the PR onto master and it will be merged with a merge commit.

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 12, 2020 20:37
@seldridge seldridge force-pushed the add-ResolveKinds-invalidations branch 2 times, most recently from 32c6252 to 1cf3321 Compare July 24, 2020 17:19
@seldridge seldridge mentioned this pull request Jul 24, 2020
17 tasks
Update the dependencies of transforms which empirically invalidate
ResolveKinds or ResolveFlows.

This was discovered with some to-be-committed work that automates
looking for incorrect transform dependencies. Specifically, the
deficient transforms were found to not invalidate ResolveKinds or
ResolveFlows, yet running ReslveKinds or ResolveFlows after these
transforms would result in modifications to the circuit.

The LoweringCompilersSpec was updated with patches to indicate the
location of these new transforms.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
@seldridge seldridge force-pushed the add-ResolveKinds-invalidations branch from 1cf3321 to f5e7c2e Compare July 25, 2020 17:12
Copy link
Contributor

@ekiwi-sifive ekiwi-sifive left a comment

Choose a reason for hiding this comment

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

Maybe you can see if the FlattenReg pass is easy to fix.
Alternatively I could give that a shot in a follow on PR once your testing setup is available to everyone.

@@ -133,7 +134,7 @@ class FlattenRegUpdate extends Transform with DependencyAPIMigration {
override def optionalPrerequisiteOf = Seq.empty

override def invalidates(a: Transform): Boolean = a match {
case _: DeadCodeElimination => true
case _: DeadCodeElimination | ResolveKinds => true
Copy link
Contributor

Choose a reason for hiding this comment

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

This can probably be fixed by adding the correct kind (RegKind) to the WRef created on line 100.

@@ -53,7 +53,7 @@ class DeadCodeElimination extends Transform
Dependency(passes.VerilogPrep),
Dependency[firrtl.AddDescriptionNodes] )

override def invalidates(a: Transform) = false
override def invalidates(a: Transform) = a == ResolveKinds
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know if this had anything todo with the use of ExprKind instead of MemKind on line 134?

@@ -175,7 +175,7 @@ object VerilogMemDelays extends Pass {
Dependency[SystemVerilogEmitter] )

override def invalidates(a: Transform): Boolean = a match {
case _: transforms.ConstantPropagation | ResolveFlows => true
case _: transforms.ConstantPropagation | ResolveFlows | ResolveKinds => true
Copy link
Contributor

Choose a reason for hiding this comment

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

This one is interesting because the one WRef it seems to create actually appears to have the correct kind (RegKind).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants