Accept multiple phases instead of one#685
Open
Nergy-TCGeneric wants to merge 1 commit intoscoverage:mainfrom
Open
Accept multiple phases instead of one#685Nergy-TCGeneric wants to merge 1 commit intoscoverage:mainfrom
Nergy-TCGeneric wants to merge 1 commit intoscoverage:mainfrom
Conversation
- scoverage#164 opened up the possibility of configurable phase control - But sometimes, one may need to use more phases than one - Now accepts multiple phases delimited by ; - This is for making it consistent along other options
7d1efcf to
b7840f6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Ever since #164, we have some control over phase,
scoverage-instrument. We can just specify which phase thescoverage-instrumentshould sit in by supplying a compiler option-P:scoverage:extraBeforePhase:<phaseName>and-P:scoverage:extraAfterPhase:<phaseName>.However, while normally up to one customized phase is enough, my use case is somewhat peculiar. I was working on a personal project which relies on chipsalliance/chisel and to generate coverage without any issue,
scoverage-instrumentmust run before two phases, not just one.That's because chisel's plugin generates additional AST on the fly. Here's an example:
Source: https://github.com/chipsalliance/chisel/blob/v3.6.1/plugin/src/main/scala/chisel3/internal/plugin/ChiselComponent.scala#L194
Without specifying any of
extraBeforePhaseandextraAfterPhase, scoverage plugin emits following warnings (on 1.9.0, now it's error afterwards).As described above, the only way to solve this is putting
scoverage-instrumentahead of chisel's phases, calledchiselbundlephaseandchiselcomponent.I can't simply disable such plugins because they're simply indispensible to generate a hardware code. Before this pull request, I've devised a dummy plugin to workaround such ordering issue. However, that approach is only a temporary measure, so I decided to file this feature request as well.
Change Summary
-Poption.-P:scoverage:extraBeforePhase:chiselcomponent;chiselbundlephase;as a delimiter to match the style of other options likeexcludedSymbolsand so on.Related issues / PRs