-
Notifications
You must be signed in to change notification settings - Fork 5
Add asserts to br_cdc_bit_pulse and scrub some obsolete TODOs #653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,10 +56,18 @@ module br_cdc_bit_pulse #( | |
| input logic dst_rst, | ||
| output logic dst_pulse | ||
| ); | ||
| // Integration Assertions | ||
|
|
||
| //------------------------------------------ | ||
| // Integration checks | ||
| //------------------------------------------ | ||
| // Relying on checks in br_cdc_bit_toggle | ||
|
|
||
| `BR_ASSERT_CR_INTG(src_pulse_high_then_low_a, src_pulse |=> !src_pulse, src_clk, src_rst) | ||
| `BR_COVER_CR_INTG(back_to_back_src_pulse_c, src_pulse ##2 src_pulse, src_clk, src_rst) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Conversely, if the source clock is much faster than the destination clock, it may not be safe to have pulses two cycles apart on the source clock.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose if this is true then you should probably use a 1-bit CDC FIFO?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you can guarantee that the pulses are sufficiently spaced on the source side, you don't need to use a FIFO. I think if you want to add this cover, you should have a parameter like
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right so I only see two possibilities. Unless I'm missing something.
If 2, then shouldn't we have the source side assert
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I think have an assert that the pulses are minimum number of cycles apart and have the minimum be configurable. |
||
|
|
||
| //------------------------------------------ | ||
| // Implementation | ||
| //------------------------------------------ | ||
| logic src_level; | ||
| logic dst_level; | ||
| logic dst_level_d; | ||
|
|
@@ -98,7 +106,10 @@ module br_cdc_bit_pulse #( | |
| assign dst_pulse = dst_pulse_internal; | ||
| end | ||
|
|
||
| // Implementation assertions | ||
| // TODO(zhemao): Add some here | ||
| //------------------------------------------ | ||
| // Implementation checks | ||
| //------------------------------------------ | ||
| `BR_ASSERT_CR_IMPL(dst_pulse_high_then_low_a, dst_pulse |=> !dst_pulse, dst_clk, dst_rst) | ||
| `BR_COVER_CR_IMPL(back_to_back_dst_pulse_c, dst_pulse ##2 dst_pulse, dst_clk, dst_rst) | ||
|
|
||
| endmodule | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't add these in my PR because I think this is too stringent. If the source clock is much slower than the destination clock, it would be perfectly fine to have two back to back pulses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree: the purpose of the module is to transfer pulses. If you're saying you don't have to pulse on the sender side then it seems ill-defined?
Also "two back to back pulses" means there must be a falling edge between, no?