Fix Double Elaboration Backportably #1426
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a replacement for #1412 that also fixes the double elaboration problem in a backwards compatible way. This PR does the following things:
Elaborate
run inChiselStage
(you don't care that elaboration ran and wasn't invalidated)Elaborate
by theEmitter
(the emitter doesn't touch any annotations)optionalPrerequisiteOf
fromEmitter
->Convert
to get the correct ordering (this is @davidbiancolin's Have phases.Emitter name phases.Convert as a dependent #1412)To test this, this adds:
ChiselStage
exposes it's phase managerWhen running
ChiselStage
, you now get the following phase order:This cannot fix the bug where
Convert
should invalidateElaborate
due to the use ofPreservesAll
. Mixing inPreservesAll
or removing it from being mixed in is backwards incompatible and should probably be killed 1.4. 😬Closes #1412
Related issue: #1412, #1418
Type of change: bug fix
Impact: API addition (no impact on existing code)
Development Phase: implementation
Release Notes