Skip to content

Commit fa57461

Browse files
authored
Fix CDC FIFO reset overlap check (#1246)
## Summary - replace `$fell` in `br_cdc_fifo_reset_overlap_checks` with explicit known `1` to known `0` reset-deassertion detection - prevent unknown-to-zero reset transitions from triggering the overlap assertion ## Root cause and impact SystemVerilog `$fell` evaluates true for `X` to `0` transitions. At simulation startup, an unknown reset value becoming deasserted could therefore falsely trigger `reset_overlap_a`, even though no known asserted-to-deasserted reset transition occurred. The checker now evaluates reset deassertion using delayed reset values and case equality, so only a known `1` to known `0` transition checks the minimum overlap count. ## Validation - all 9 focused `br_cdc_fifo_reset_overlap_checks` lint and elaboration targets - `pre-commit run --all-files`
1 parent 33720f6 commit fa57461

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

cdc/rtl/internal/br_cdc_fifo_reset_overlap_checks.sv

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module br_cdc_fifo_reset_overlap_checks #(
4242
localparam int MaxValue = 1 << 31;
4343
localparam int CounterWidth = $clog2(MaxValue + 1);
4444

45-
logic overlap_next, counter_rst, reset_active_push_d, reset_active_pop_d;
45+
logic overlap_next, counter_rst, reset_active_push_d, reset_active_pop_d, reset_deasserted;
4646
logic [CounterWidth-1:0] overlap_cycles, overlap_cycles_next;
4747

4848
`BR_REGN(reset_active_push_d, reset_active_push)
@@ -59,6 +59,13 @@ module br_cdc_fifo_reset_overlap_checks #(
5959
// ri lint_check_waive FOURSTATE_COMP
6060
(reset_active_pop === 1'b1 && reset_active_pop_d !== 1'b1));
6161

62+
// Only treat a known 1-to-0 transition as reset deassertion. $fell also detects
63+
// X-to-0 transitions, which can cause a false failure at the start of simulation.
64+
// ri lint_check_waive FOURSTATE_COMP
65+
assign reset_deasserted = (reset_active_push_d === 1'b1 && reset_active_push === 1'b0) ||
66+
// ri lint_check_waive FOURSTATE_COMP
67+
(reset_active_pop_d === 1'b1 && reset_active_pop === 1'b0);
68+
6269
// Not using br_counter_incr because it has implementation assertions
6370
// that assume we won't drive Xes into its inputs when it's not in reset.
6471
`BR_REGN(overlap_cycles, overlap_cycles_next)
@@ -80,8 +87,8 @@ module br_cdc_fifo_reset_overlap_checks #(
8087
`endif // BR_DISABLE_INTG_CHECKS
8188
`endif // BR_ASSERT_ON
8289

83-
`BR_ASSERT_CR_INTG(reset_overlap_a, $fell(reset_active_push) || $fell(reset_active_pop)
84-
|-> overlap_cycles >= MinOverlapCycles, clk, 1'b0)
90+
`BR_ASSERT_CR_INTG(reset_overlap_a, reset_deasserted |-> overlap_cycles >= MinOverlapCycles, clk,
91+
1'b0)
8592

8693
`BR_UNUSED(reset_active_push)
8794
`BR_UNUSED(reset_active_pop)

0 commit comments

Comments
 (0)