Resolve assignments with equal strengths #3637
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.
Adds step of dynamic signal strengths resolution.
When the strength is symmetric (the same strength is related to both 0 and 1 values), the exact value of the RHS doesn't matter. It only matters if it equals
z
or not.Such assignments are handled by changing the values to
z
of these bits that are overwritten by stronger assignments. Then all assignments can be aggregated as they would have equal strengths (by|
on them and their __en expressions). To change the value toz
, the RHS should be&
with negation of __en expression of stronger assignments. Changing RHS's __en expression is not needed, because it will be then aggregated with __en expression of stronger assignments using|
, so&
with the negation can be safely skipped.So the values of overwritten bits are actually changed to 0, which doesn't affect stronger assignments, because | operation was used.
This handling is implemented in the following way:
orp = orp | (var__strength & ~enp)
enp = enp | var__strength__en,
where orp is aggregated value and enp is aggregated __en value.