Support negative edge-triggered Sequential
s
#483
Draft
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
Adds support for negative edge-triggered
Sequential
s. In some cases, downstream tools may treat an inverted clock fed into a sequential differently than a negative edge triggered sequential. Functionally, in simulation, the behavior is the same for either option. Generators may choose to generate these differently (e.g. usingnegedge
vs.posedge
in SystemVerilog generation).Additionally fixed a bug where a multi-triggered
Sequential
may not generate X's if one trigger is valid and another (later specified) trigger is invalid.The changes also motivated some refactoring of trigger handling in
Sequential
, as well as renaming of the first positional argument inSequential.multi
.Related Issue(s)
This is related to the discussion on #42, where previously it was decided not to include
negedge
due to lack of motivation. Downstream tool differences now motivate adding the feature.Testing
Added new tests, existing tests pass.
Backwards-compatibility
No, but the signature of
Sequential.multi
has been slightly expanded and modified:clks
toposedgeTriggers
negedgeTriggers
as a named optional argumentDocumentation
This is a relatively uncommon feature, so documentation added onto the API docs should be sufficient (extra example in user guide not really needed).