Fix combinational sensitivity excessive pessimism, fix #233 #240
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.
Description & Motivation
Issue #233 finds that searches for
Combinational
sensitivity lists, it is excessively pessimistic in that sometimes there aren't really any combinational paths, but it assumes that there may be. This can cause an issue where a false combinational loop is detected, causing incorrect X-generation.This PR fixes the bug by calculating more detailed combinational paths for
Module
s atbuild
time. This information can be leveraged byCombinational
to understand more accurately where combinational paths may exist. Results are cached to avoid repeated calculations when multipleCombinational
s search through similar paths of potential sensitivities. AllModule
s with custom functionality must explicitly define any combinational paths from all inputs to applicable outputs or elseCombinational
will be unable to properly determine an accurate sensitivity list. A newFullyCombinational
mixin is included in this PR to automatically add all input/output combinations as potential combinational paths, since that's a common case for many small custom gates.Additionally,
RohdException
base type for all ROHD exceptions, making it easier to handle ROHD-related exceptionsModuleNotBuiltException
, used in multiple places inModule
Related Issue(s)
Fix #233
Testing
Backwards-compatibility
Other custom functionality modules defined outside of the ROHD framework which had previously benefited from assumption of the behavior of
FullyCombinational
will now be treated as the complete opposite (no combinational paths). This could meanCombinational
s would now be missing sensitivities that previously existed. If those sensitivities were true, then existing simulations in ROHD might now have incorrect behavior. This is likely rare, and since this is really a bug fix it doesn't quite feel like it's breaking backwards-compatibility.Documentation
Doc comments updated/included